1. Лучший говнокод

    В номинации:
    За время:
  2. C++ / Говнокод #504

    +140.5

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    #include <numeric>
    #include <algorithm>
    #include <iostream>
    #include <functional>
    #include <boost/iterator/counting_iterator.hpp>
    
    int main()
    {
      std::cout << std::accumulate(boost::make_counting_iterator(2), boost::make_counting_iterator(8), 1, std::multiplies<int>());
      return 0;
    }

    guest, 05 Февраля 2009

    Комментарии (5)
  3. Куча / Говнокод #1778

    +140.4

    1. 1
    2. 2
    3. 3
    4. 4
    Почему нет раздела по BrainFuck'у? )))
    Почему нет раздела по BrainFuck'у? )))
    Почему нет раздела по BrainFuck'у? )))
    Почему нет раздела по BrainFuck'у? )))

    Почему нет раздела по BrainFuck'у? )))

    Tanger, 06 Сентября 2009

    Комментарии (12)
  4. PHP / Говнокод #1243

    +140.3

    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
    if (isset($aCart['color_caption'])) {
        if (!isset($aCart['color_name']) && isset($aCart['color_caption'])) {
            $aInsert['color_name']    = $aCart[$i]['color_caption'];
            $aInsert['color_caption'] = $aCart[$i]['color_caption'];
        }
        elseif (isset($aCart['color_name']) && !isset($aCart['color_caption'])) {
            $aInsert['color_name']    = $aCart[$i]['color_name'];
            $aInsert['color_caption'] = $aCart[$i]['color_name'];
        }
        elseif (!isset($aCart['color_name']) && !isset($aCart['color_caption'])) {
            $aInsert['color_name']    = 'N/A';
            $aInsert['color_caption'] = 'N/A';
        }
        else {
            $aInsert['color_name']    = $aCart['color_caption'];
            $aInsert['color_caption'] = $aCart['color_name'];
        }
    }

    Чем была забита моя голова не известно. Как я такую логику придумал?!

    guest, 24 Июня 2009

    Комментарии (0)
  5. Куча / Говнокод #818

    +140.3

    1. 1
    2. 2
    3. 3
    4. 4
    WHSShell = Новый COMОбъект("WScript.Shell");
    WHSShell.SendKeys("%");
    WHSShell.SendKeys("~");
    WHSShell.SendKeys("{DOWN 9}");

    Это - вызов функции "печать - предварительный просмотр" имени гениальных программистов Раруса.

    guest, 06 Апреля 2009

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

    +140.3

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    ...
    
    $result = my_mysql_query($query);
    $numrows = mysql_num_rows($result);
    if ((!$result || !mysql_num_rows($result)) && $numrows !==0) {
        echo '<p>'.l('article_not_exist').'</p>';
    }
    else {
      if ($numrows) {
    
    ...

    sNews...

    guest, 19 Марта 2009

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

    +140.2

    1. 1
    if (port.id == {{ port.id }}) { selected = ' selected="selected"' }

    генерим аяксовым жабоскриптом option-ы в шаблоне.

    guest, 14 Апреля 2009

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

    +140.1

    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
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    function parce($string)
    
    
    
    {//function open
    $breaktags=array ("<"," ","=","","т");
       
       for ($pos=0;$pos<strlen($string);$pos++)
       {//for text
         
         if (substr($string,$pos,1)=="{" and substr($string,$pos+1,1)=="%")
    		{// if open symbols finded
    		   $tagopened=1;
    		   while($tagopened==1){//while opened
    			   for($inpos=$pos+2;$inpos<10000;$inpos++){// =)
    				   if ( (substr($string,$inpos,1)=="%" and substr($string,$inpos+1,1)=="}") or in_array(substr($string,$inpos,1),$breaktags)) {break 2;$tagopened=0;}//br
    				   $intag=$intag.substr($string,$inpos,1);
    		   }//for inpos
    		}//while opened closing
    		$intag=explode("->",$intag,2);
    		echo("$intag[0] with $intag[1] action!<br>");
    		unset($intag);
    				} else {//if symbols finded
    					$symbol=substr($string,$pos,1);
    					echo("$symbol");
    				}
    				
       }//for all text closing
       
    }//function end;

    guest, 23 Июня 2009

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

    +140.1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    Object[] tass = UC.getUserTaskList(off);
                             
                             int i=0;
                             
                             for (i=0; i<tass.length; i++)
                                 {
                                 Xu.data.UserTask ts = (Xu.data.UserTask)tass[i];
                                                 out.println("<br />"+UC.getById(new Integer (ts.getId()).intValue()).getTaskName());
                                 }
    //Получаем массив Object[], приводим к UserTask[], создаем новую UserTask по id
    // созданной из массива UserTask[], чтобы вывести на свойства. Но говнокод работает.

    Как ни печально, но это написал я. Ночью башка не варит. Вы себе представляете алгоритм, рождающий UserTask?:))))

    guest, 15 Июня 2009

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

    +140.1

    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
    //cache control side box detect
    	if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories1.php') ) {
    		echo tep_cache_categories_box();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories.php') ) {
    		echo tep_cache_categories_box();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories2.php') ) {
    		echo tep_cache_categories_box1();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories3.php') ) {
    		echo tep_cache_categories_box3();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories4.php') ) {
    		echo tep_cache_categories_box4();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories5.php') ) {
    		echo tep_cache_categories_box5();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'coolmenu.php') ) {
    		echo tep_cache_coolmenu();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'manufacturers.php') ) {
    		echo tep_cache_manufacturers_box();
    	} else {
    		require(DIR_FS_TEMPLATE_BOXES . '/' . $column['cfgtitle']);
    	}

    Хотите интернет-магазин? Не спрашивайте про крелоад.

    guest, 06 Марта 2009

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

    +140.1

    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
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    <?php
    //Данные на базу
    $lnk = mysql_connect('localhost', 'mysql_user', 'mysql_password')
           or die ('Not connected : ' . mysql_error());
    mysql_select_db('primecms_db', $lnk) or die ('Can\'t primecms_db foo : ' . mysql_error());
    
    
    class insert{
    	var $pid, $alias, $text, $position, $status, $create_time, $modify_time;
    }
    
    function con_in($alias, $text_en, $text_ru, $text_descr){
    	$res = new insert;
    	$res->pid=1;
    	$res->alias=addslashes($alias);
    	$res->text='<p>'.addslashes($text_en).'</p>\r\n<p>'.addslashes($text_ru).'</p>\r\n<p>'.addslashes($text_descr).'</p>';
    	$res->position=0;
    	$res->status=1;
    	$res->create_time=time();
    	$res->modify_time=time();
    	return $res;
    }
    
    if ($_POST['send']){
    	$con =  con_in($_POST['alias'],$_POST['text_en'],$_POST['text_ru'],$_POST['text_descr']);
    	mysql_query("INSERT INTO e118_glossary_items (`id`, `pid`, `alias`, `text`, `position`, `status`, `create_time`, `modify_time`) VALUES (".$con->pid.",'".$con->alias."','".$con->text."',".$con->position.",".$con->status.",".$con->create_time.",".$con->modify_time.")");
    }
    ?>
    
    <form name="" action="" method="post">
    Alias<input name="alias" size=30  type="text" value=""><br />
    text_en<input name="text_en" size=30 type="text" value=""><br />
    text_ru<input name="text_ru" size=30  type="text" value=""><br />
    text decr<textarea name="text_descr" rows=7 cols=50 wrap="off"></textarea><br />
    <input type="submit" value="Send" name="send"><br />
    </form>

    не забываем править
    //Данные на базу

    guest, 04 Марта 2009

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