- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
$duration_date = date(
'Y-m-d H:i:s',
strtotime(
date(
'Y-m-d H:i:s',
strtotime($_REQUEST['task_start_date'])) . ' + ' . $_REQUEST['task_frequency'] . ' ' . $freq_type . ''
)
);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+150
$duration_date = date(
'Y-m-d H:i:s',
strtotime(
date(
'Y-m-d H:i:s',
strtotime($_REQUEST['task_start_date'])) . ' + ' . $_REQUEST['task_frequency'] . ' ' . $freq_type . ''
)
);
Кто-то может это упростить ? Я уже устал
+129
private List<Ball> _balls;
private Interaction GetInteraction(Ball ball) {
foreach (var b2 in _balls.SkipWhile(b => b != ball).Skip(1)) {
/* ... */
}
}
var table = _balls.Select(GetInteraction);
Откопал в своей проге.
нужно было определить, какой шарик с кем взаимодействует раньше всего, притом если уже рассчитано взаимодействие 1 и 2 шарика (при рассчёте взаимодействий 1 и 2, 1 и 3, 1 и 4, ... и выделено самое раннее взяимодействие шарика 1), то взимодействие 2 и 1 рассчитываеть не надо. Таким образом, нужно было пройти все пары шариков так, чтоб первый встретился в списке раньше второго.
Массивы, индексы и циклы? Не, не знаем такого. Только Select, только ФП, только колдовство со SkipWhile(b => b!=ball).Skip(1).
+149
<?php
if ($update_flag == '1') {
$updat_finished_task = $db->update(
'tbl_user_task',
array(
'is_finished' => '0',
'user_task_update_datetime' => date('Y-m-d H:i:s')
),
'1=1'
);
}
?>
UPDATE
tbl_user
SET
is_finished = [is_finished],
user_task_update_datetime = [data_time]
WHERE 1 = 1
MySQL 5
+151
for($j = 0; $j < count($_REQUEST['option_question']); $j++)
{
$max_id = $db->max_field("tbl_task_option","option_question_id","1=1");
$max_id = $max_id+1;
$tbl_option_insert=array(
'task_id' => $_REQUEST['task_id'],
'subtask_id' => $subtask_id,
'option_question_id' => $max_id,
'option_question' => $_REQUEST['option_question'][$j],
'option_answer' => $_REQUEST['option_ans'][$j][0],
'option_insert_datetime' => date('Y-m-d H:i:s')
);
$task_option_id = $db->insert($tbl_option_insert,"tbl_task_option");
$i = $i + 1;
}
option_question_id INT NOT NULL AUTO_INCREMENT
+149
public function fetchEmployees()
{
global $result, $check_u_id, $second_check_u_id, $query123;
....
+116
"create": "form[name=save]",
"edit": "form[name=save]",
"delete": "form[name=delete]",
- "select": "select[name=^employees]"
+ "select": "select[name^=employees]"
};
var actionTable = {
git commit
+139
for (normalize(); n > 0; scanf("%d", &temp, n--)){...}
Но ведь работает!
+126
<link rel="stylesheet" href="/libraries/mediaelement/mediaelementplayer.min.css">
<link href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" rel="stylesheet">
<script type="text/javascript" src="/js/jquery/jquery-latest.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="/libraries/mediaelement/andplayer.min.js"></script>
<script type="text/javascript" src="/js/jquery_tools.js"></script>
Все это, пара десятков строк мутного джаваскрипта и столько же HTMLя и PHP потребовалось опытному филиппинскому сотруднику, чтобы добавить видеоролик на страницу.
+12
#include <string>
#include <sstream>
#include <iostream>
int main() {
std::string str;
std::stringstream s("");
std::getline(s, str, '|');
std::cout << "good=" << s.good() <<
" bad=" << s.bad() <<
" fail=" << s.fail() <<
" eof=" << s.eof() << std::endl;
return 0;
}
good=0 bad=0 fail=1 eof=1
http://ideone.com/0Ceg8z
У меня один вопрос: нахуй так жить?
+109
BusinessLogic.Entity_InheritanceSetting.Save(
Session.SessionSettings.Settings.ContactID.Value,
Session.SessionSettings.Settings.SessionID.Value, copyID.Value,
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);