1. C# / Говнокод #175

    +14.3

    1. 1
    2. 2
    bool exitstatus = true;
    if (!extremalexit) { exitstatus = true; }

    На всякий случай присвоим еще раз
    [Ф]

    guest, 15 Декабря 2008

    Комментарии (2)
  2. C# / Говнокод #173

    +929.5

    1. 1
    2. 2
    if (a == null == false) {
    }

    когда проверял чужой код пол часа смотрел пока понял что чувак просто не умеет писать if (а != null)

    guest, 14 Декабря 2008

    Комментарии (30)
  3. PHP / Говнокод #172

    +11.9

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    if ($site_is_work)
     {
     }
    else
     {
    	exit('Сайт не работает');
     }

    guest, 14 Декабря 2008

    Комментарии (23)
  4. C++ / Говнокод #171

    +28

    1. 1
    namespace ? = boost::lambda;

    навеяно http://www.govnokod.ru/165

    guest, 14 Декабря 2008

    Комментарии (2)
  5. PHP / Говнокод #169

    +13

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    echo '
    Путина - в волгу!
    Зубкова - на ВАЗ!
    Только потом 
    Принимайтесь за нас!';
    
    print'<a href="http://news.drom.ru/11803.html">ВВП в ОКУ!</a>';

    Страна идиотов! Да кому усрался этот отечественный автопром! На нем ездить страшно!

    guest, 14 Декабря 2008

    Комментарии (21)
  6. PHP / Говнокод #168

    +28

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    // 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
    }

    черная магия.

    guest, 14 Декабря 2008

    Комментарии (4)
  7. C++ / Говнокод #165

    −42.5

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    void elswap(int ?,int ?, int ?, int ?)  
     {
     int ?;
     ?=?[?][?];
     ?[?][?]=?[?][?];
     ?[?][?]=?;
     }

    обмен значений 2 элементов 2-мерного массива

    guest, 14 Декабря 2008

    Комментарии (6)
  8. PHP / Говнокод #164

    +42.9

    1. 1
    extract($GLOBALS);

    Анекдот в одну строчку

    guest, 14 Декабря 2008

    Комментарии (3)
  9. JavaScript / Говнокод #163

    +48

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    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

    zerkms, 14 Декабря 2008

    Комментарии (6)
  10. JavaScript / Говнокод #162

    +29

    1. 1
    <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;">&nbsp;</div></li> <li class="middle"><div id="middle_pb" style="background-image:url(img/m_bg_a.png); width:0px; height:50px; overflow:hidden;">&nbsp;</div></li> <li class="right"><div id="right_pb" style="background-image:url(img/r_bg_a.png); width:0px; height:50px; overflow:hidden;">&nbsp;</div></li> </ul> </div> </body> </html>

    Вот так мы делаем прогресс-бары

    guest, 14 Декабря 2008

    Комментарии (2)