- 1
- 2
bool exitstatus = true;
if (!extremalexit) { exitstatus = true; }
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+14.3
bool exitstatus = true;
if (!extremalexit) { exitstatus = true; }
На всякий случай присвоим еще раз
[Ф]
+929.5
if (a == null == false) {
}
когда проверял чужой код пол часа смотрел пока понял что чувак просто не умеет писать if (а != null)
+11.9
if ($site_is_work)
{
}
else
{
exit('Сайт не работает');
}
+28
namespace ? = boost::lambda;
навеяно http://www.govnokod.ru/165
+13
echo '
Путина - в волгу!
Зубкова - на ВАЗ!
Только потом
Принимайтесь за нас!';
print'<a href="http://news.drom.ru/11803.html">ВВП в ОКУ!</a>';
Страна идиотов! Да кому усрался этот отечественный автопром! На нем ездить страшно!
+28
// country
if($user_country) {
$where .= '(tbl_publications.id_country = '.$user_country;
// city
if($user_city) {
$where .= ' OR tbl_publications.id_city = '.$user_city;
}
$where .= ')';
}else{
$where .= ' 1=1'; // black magic
}
черная магия.
−42.5
void elswap(int ?,int ?, int ?, int ?)
{
int ?;
?=?[?][?];
?[?][?]=?[?][?];
?[?][?]=?;
}
обмен значений 2 элементов 2-мерного массива
+42.9
extract($GLOBALS);
Анекдот в одну строчку
+48
if ('Down' == 'Down')
{
//currentSeconds--;
currentSeconds = PromptTimer_StartCounter - correctionTime;
needTick = currentSeconds > 0;
if (!needTick)
currentSeconds = 0;
}
else
{
currentSeconds = PromptTimer_StartCounter + correctionTime;
if ('True' == 'False')
{
if (GetGMTOffsetInfo()[0] == "-")
currentSeconds += -(GetGMTOffsetInfo()[1] * 3600);
else
currentSeconds += GetGMTOffsetInfo()[1] * 3600;
}
//currentSeconds++;
}
Код таймера на странице задания, проект "Энкаунтер" (http://en.cx)
Posted by zerkms
+29
<html> <head> <style type="text/css"> html, body { background-color:#000; font-family:Segoe UI, Tahoma, Arial, sans-serif; font-size:11px; color:#FFF; margin:0px; padding:0px; width:100%; height:100%; overflow:hidden; } a:link, a:visited, a:active { color:#CCC; text-decoration:underline; } a:hover { color:#F00; text-decoration:none; } #progressbar_block { width:100%; height:100%; padding-left:50%; padding-top:50%; overflow:hidden; } ul.progressbar { width:400px; height:50px; padding:0px; margin:0px; margin-left:-200px; margin-top:-25px; clear:both; list-style-type:none; } ul.progressbar li { padding:0px; margin:0px; float:left; } li.left { background-image:url(img/l_bg_n.png); background-repeat:no-repeat; width:20px; height:50px; } li.middle { background-image:url(img/m_bg_n.png); background-repeat:repeat-x; width:360px; height:50px; } li.right { background-image:url(img/r_bg_n.png); background-repeat:no-repeat; width:20px; height:50px; } </style> <script language="javascript"> function func() { var max = 400 - 16; var pixels = 400 - 16; var step = pixels/max; next(0); } function next(i) { var max = 400 - 16; var pixels = 400 - 16; var step = pixels/max; var lft = document.getElementById("left_pb"); var mid = document.getElementById("middle_pb"); var rht = document.getElementById("right_pb"); if(i < 12) lft.style.width = String(8 + i) + "px"; else lft.style.width = String(20) + "px"; if(i < pixels - 12 && i > 12) mid.style.width = String(i - 12) + "px"; else if(i > 12) mid.style.width = String(360) + "px"; else mid.style.width = String(0) + "px"; if(i > 372) rht.style.width = String(i - 372) + "px"; else if(i < 372) rht.style.width = String(0) + "px"; setTimeout("next(" + (i + step < pixels ? i + step : 0) + ")", 25); } </script> </head> <body onload="func();"> <div id="progressbar_block"> <ul class="progressbar"> <li class="left"><div id="left_pb" style="background-image:url(img/l_bg_a.png); width:8px; height:50px; overflow:hidden;"> </div></li> <li class="middle"><div id="middle_pb" style="background-image:url(img/m_bg_a.png); width:0px; height:50px; overflow:hidden;"> </div></li> <li class="right"><div id="right_pb" style="background-image:url(img/r_bg_a.png); width:0px; height:50px; overflow:hidden;"> </div></li> </ul> </div> </body> </html>
Вот так мы делаем прогресс-бары