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

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

    −127

    1. 1
    Папка, создаваемая USB Disk Antivirus в корне всех дисков предотвращает заражение компьютера через Autorun. Пожалуйста не изменяйте и не удаляйте ее.

    Напомнило кое-что.

    dos_, 30 Ноября 2011

    Комментарии (7)
  3. ActionScript / Говнокод #8672

    −122

    1. 1
    var mapDress:BitmapData = MathUtils.getTransformationMapTShort(bottomMovie.width, bottomMovie.height, pointFilterTopLeft, pointFilterBezierLeft, point1, pointFilterLimitLeft, pointFilterTopRight, pointFilterBezierRight, point2, pointFilterLimitRight, this.clothes[bottomIndex.layer][bottomIndex.child].colored_set[this.clothes[bottomIndex.layer][bottomIndex.child].currentColorVariant].variants[this.clothes[bottomIndex.layer][bottomIndex.child].currentWearVariant][this.currentView].arm_points_right, this.clothes[bottomIndex.layer][bottomIndex.child].colored_set[this.clothes[bottomIndex.layer][bottomIndex.child].currentColorVariant].variants[this.clothes[bottomIndex.layer][bottomIndex.child].currentWearVariant][this.currentView].arm_points_left);

    "752 см позитива!"

    Z-13, 29 Ноября 2011

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

    +161

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    AnsiString DateArray = "";
    int DaysBetween = 0;
    DaysBetween = DateTimePicker2->Date - DateTimePicker1->Date;
    for (int i = 0; i <= DaysBetween; i++ )
    {
     if (i != 0)
     DateArray = DateArray + " OR ";
     DateArray =  DateArray + " date_made = '"+DateToStr(DateTimePicker1->Date + i)+"'";
    }

    Очевидно, подготавливаем запрос для отбора по диапазону дат :)

    labutinpa, 29 Ноября 2011

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

    +154

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    // сохраняем лог
    $log = fopen($logfile,'w'); // открыли файл, стерев его
    foreach($temp as $tmp) {fwrite($log,trim($tmp)."n");} // каждый элемент массива записали в строку
    fclose($log); // закрыли лог
    ?>

    Зачем мне implode и file_put_contents?
    У меня нет времени, чтобы ебаться с ними! Лучше я создам цикл.

    http://forum.htmlbook.ru/index.php?showtopic=7169
    На это ссылка в топ-теме причем.

    7ion, 22 Ноября 2011

    Комментарии (7)
  6. Куча / Говнокод #8575

    +127

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    <p>
    Журкабаев
    <span>                                            </span>
    <span>-  заместитель акима города Костаная,</span>
    </p>
    <p>
    Марат Кенжебекович 
    <span>                             председатель комиссии</span>
    </p>

    http://kostanay-city.kz/index.php?mod=page&obj=2701 таблица в центре страницы, кода много, поэтому приведу часть... Мне жаль того кто её делал, но еще больше жаль знакомого которому пришлось переносить это чудо на новый сайт... CTRL + U, не поможет посмотреть всю картину, т.к. данные подгружаются, но firebug приятно радует)

    EnigmA2030, 19 Ноября 2011

    Комментарии (7)
  7. PHP / Говнокод #8568

    +158

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    foreach ($aa as $key => $value) {
                $aa[$key][2] = str_replace(',', '.', $aa[$key][2]);
                $aa[$key][3] = str_replace(',', '.', $aa[$key][3]);
                $aa[$key][4] = str_replace(',', '.', $aa[$key][4]);
            }

    jf4ever, 18 Ноября 2011

    Комментарии (7)
  8. Куча / Говнокод #8517

    +140

    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
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>По колено в коде —  Говнокод.ру</title>
        <meta name="keywords" content="говнокод, смешной код, быдлокод, быдлокодеры, индусы, для программистов, про программистов, индусский код, записки программиста, говно, говнокод на php, mysql, perl" />
        <meta name="description" content="Сборник говнокода на различных языках программирования" />
        <meta property="og:image" content="http://govnokod.ru/images/brand.gif" />
        <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
        <link rel="icon" href="/animated_favicon.gif" type="image/gif" />
        <link rel="stylesheet" href="/css/style.css?v=4" media="all" type="text/css" />
        <!--[if lte IE 7]><link href="/css/ie.css" rel="stylesheet" type="text/css"><![endif]-->
        <link title="rss govnokod.ru" type="application/rss+xml" rel="alternate" href="http://govnokod.ru/rss"/>
        <link rel="stylesheet" type="text/css" href="/media/b5aabef57bd7c3fa62379caa0e483deb.css?files=jshighlight/govnokod.css" />
        <script type="text/javascript">
        //<!--
        var SITE_PATH = ''; var SITE_LANG = '';
        //-->
        </script>
        <script type="text/javascript" src="/media/ddd20ce56acf1d9ebadd126322495087.js?files=jquery.js,jquery.scrollTo.js,govnokod.js,jshighlight/highlight.pack.js&v=4"></script>
    </head>

    Привлекает внимание поисковиков(04).

    ReallyBugMeNot2, 14 Ноября 2011

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

    +80

    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
    public static java.util.Date getPreviousMonth () throws ParseException {
            Date currentDate = new Date(System.currentTimeMillis());
            Calendar currentCalendar = Calendar.getInstance();
            currentCalendar.setTimeInMillis(currentDate.getTime());
            
            SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy");
            //currentCalendar.set(Calendar.MONTH, currentCalendar.get(Calendar.MONTH) - 1);
            currentCalendar.set(Calendar.DAY_OF_MONTH, currentCalendar.get(Calendar.DAY_OF_MONTH) - 30);
            //currentCalendar.set(Calendar.DATE, currentCalendar.getActualMinimum(Calendar.DAY_OF_MONTH));
            format.format(currentCalendar.getTime());
            java.util.Date resultDate = null;
            resultDate = format.parse(format.format(currentCalendar.getTime()));
            return resultDate;
        }

    Занимаюсь рефакторингом. Особо радует предпоследняя строчка.

    MAK, 11 Ноября 2011

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

    +121

    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
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    private void textBox1_TextChanged(object sender, EventArgs e)
    {
    	if ((textBox1.Text + textBox2.Text).Length + 1 > 255)
    	{
    		textBox1.BackColor = Color.LightPink;
    		textBox2.BackColor = Color.LightPink;
    	}
    	else
    	{
    		textBox1.BackColor = Color.White;
    		textBox2.BackColor = Color.White;
    	}
    
    	if ((textBox3.Text + textBox6.Text).Length + 1 > 255)
    	{
    		textBox3.BackColor = Color.LightPink;
    		textBox6.BackColor = Color.LightPink;
    	}
    	else
    	{
    		textBox3.BackColor = Color.White;
    		textBox6.BackColor = Color.White;
    	}
    }
    
    private void bntSave_Click(object sender, EventArgs e)
    {
    	if (textBox1.BackColor == Color.LightPink)
    	{
    		MessageBox.Show("Длинна полей От и Адрес в сумме не должна превышать 255");
    		return;
    	}
    	if (textBox3.BackColor == Color.LightPink)
    	{
    		MessageBox.Show("Длинна полей Кому и Адрес в сумме не должна превышать 255");
    		return;
    	}
    
    	Properties.Settings.Default.Save();
    	Navigator.Navigate(new ConfigMenuPage());
    }

    ТЗ: "Суммарная длина полей X и Y не должна превышать 255 символов"
    Решение шедеврально как по вычислению длинны суммы строк, так и по цветовой идентификации :)

    ddv_demon, 10 Ноября 2011

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

    +158

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    public function addOffer($type='vendor.model', $values) {
        switch ($type) {
          case 'vendor.model': $offer = new yml_type_vendor_model(); break;
          }
        // Заполняем значениями
        $offer->setValues($values);
       ......

    jonnywalker, 10 Ноября 2011

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