- 1
- 2
- 3
while True:
if True:
return firstLevel()
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−155
while True:
if True:
return firstLevel()
+156
$entryCommentList = $db->getCommentList(array('blog_entry_id' => $id, 'uid' => !empty($user->id) ? $user->id : 0));
array_walk(
$entryCommentList,
create_function('&$c,$k,$d', '$c["author_image_url"] = !empty($d[$c["author_id"]]) ? $d[$c["author_id"]] : null;'),
$db->getPersonImage(
array_unique(
array_map(
create_function('$c', 'return (int) $c["author_id"];'),
array_filter(
$entryCommentList,
create_function('$c', 'return (int) $c["person_type_id"] == 1 && $c["is_hero"] != 1;')
)
)
),
2 /*14*/
) + $db->getPersonImage(
array_unique(
array_map(
create_function('$c', 'return (int) $c["author_id"];'),
array_filter(
$entryCommentList,
create_function('$c', 'return (int) $c["person_type_id"] == 4 && $c["is_hero"] != 1;')
)
)
),
14
) + $db->getPersonImage(
array_unique(
array_map(
create_function('$c', 'return (int) $c["author_id"];'),
array_filter(
$entryCommentList,
create_function('$c', 'return (int) $c["is_hero"] == 1;')
)
)
),
70
)
);
Необходимо было поправить код вывода каментов. Он весь состоит из таких вот вещей, арэй волков, криэйт фанкшенов и прочей жести. Можно конечно понять что здесь происходит, но ваще проще переписать
+147
if(@$_GET['modul']=="logout"){
//code
}
ленивый мудак
+113
public static byte[] GetMonthlyFinancialReport(
//...
DateTime dateInterested)
{
// ...
DateTime monthAgoDate = dateInterested;
int dayInterested = dateInterested.Day;
int daysInMonthInterested = DateTime.DaysInMonth(dateInterested.Year, dateInterested.Month);
int daysInPreviousMonth = DateTime.DaysInMonth(dateInterested.Year, (dateInterested.Month == 1) ? 12 : (dateInterested.Month - 1));
if (dayInterested == daysInMonthInterested)
{
monthAgoDate = monthAgoDate.AddDays(-1 * monthAgoDate.Day);
}
else
{
monthAgoDate = monthAgoDate.AddDays(-1 * Math.Max(daysInPreviousMonth, Math.Min(daysInMonthInterested, dayInterested)));
}
// ...
}
Головоломочка для любителей поиграться с датами... :)
+129
-- PL/SQL
-- Нарыл в недрах софта, разрабатываемого нашей конторой. Автор, к сожалению, не известен.
select decode(NVL(GetSystemSetting('EchangeRateTypes_for_Commission'),'1'),'1',1,'2',2) into aRatetype from dual;
+172
map<pair<pair<int,int>, int>, vector<pair<pair<int,int>, pair<int,int> > > > m;
великолепно потом пробегать по коллекции
+172
<script type="text/javascript" src='/wps/CacheProxyServlet/colorPalette/default/browserVendor/Netscape/browserName/Navigator/browserVersion/unknown/locale/ru/forwardurl/wps/themes/html/pgu/./js.jsp'></script>
с сайта http://portal.rosreestr.ru
−145
([xml](type $args[0])).FictionBook.body.section|ForEach-Object{"";"";$_.title;"";$_.p}>>$args[1]
PowerShell такой PowerShell.
Конвертируем FB2 в txt
+115
Function isEQ(x,y : Real) : Boolean;
Begin
if(x = y) Then isEQ := True Else isEQ := False;
End;
Begin
{...}
End.
Не выспался...
+174
function BIN(a) {
var x = false;
for (var i = 0; i < 50; i++) {
if (Math.pow(2, i) == a) {
x = true;
}
}
return x;
}
Проверка числа на степень двойки.