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

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

    −100

    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
    ...
    @font-face 
    {
      src: url("/components/TimeNewRoman.swf");
      fontFamily: "Times New Roman";
    }
    ...
    TextArea { 
        backgroundAlpha: 0.07;
        backgroundColor: #ffffff;
        borderColor: #99ff00;
        color: #99ff66;
        font-family: "Times New Roman";
    }
    ...

    обнаружил в css своего РАБОЧЕГО проекта... не, спать все-таки надо временами)

    guest, 18 Февраля 2009

    Комментарии (1)
  3. SQL / Говнокод #565

    −30.1

    1. 001
    2. 002
    3. 003
    4. 004
    5. 005
    6. 006
    7. 007
    8. 008
    9. 009
    10. 010
    11. 011
    12. 012
    13. 013
    14. 014
    15. 015
    16. 016
    17. 017
    18. 018
    19. 019
    20. 020
    21. 021
    22. 022
    23. 023
    24. 024
    25. 025
    26. 026
    27. 027
    28. 028
    29. 029
    30. 030
    31. 031
    32. 032
    33. 033
    34. 034
    35. 035
    36. 036
    37. 037
    38. 038
    39. 039
    40. 040
    41. 041
    42. 042
    43. 043
    44. 044
    45. 045
    46. 046
    47. 047
    48. 048
    49. 049
    50. 050
    51. 051
    52. 052
    53. 053
    54. 054
    55. 055
    56. 056
    57. 057
    58. 058
    59. 059
    60. 060
    61. 061
    62. 062
    63. 063
    64. 064
    65. 065
    66. 066
    67. 067
    68. 068
    69. 069
    70. 070
    71. 071
    72. 072
    73. 073
    74. 074
    75. 075
    76. 076
    77. 077
    78. 078
    79. 079
    80. 080
    81. 081
    82. 082
    83. 083
    84. 084
    85. 085
    86. 086
    87. 087
    88. 088
    89. 089
    90. 090
    91. 091
    92. 092
    93. 093
    94. 094
    95. 095
    96. 096
    97. 097
    98. 098
    99. 099
    100. 100
    select t1.PosTag, t1.KlTOt, t1.NameKipID, t1.TypMarkaName, t1.Lim, t1.EdIzm,
    t1.OD_NUMMNF, t1.PeriodP, t1.PeriodK, 
    D3, D5, 
    case
    --поверка
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.DataOchP))  =1 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_1p)) =1 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_2p)) =1 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_3p)) =1 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_4p)) =1 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_5p)) =1 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd6_1p)) =1 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd6_2p)) =1 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.ddp)) =1 then 'Пм'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.DataOchP))  =1 then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_1p)) =1  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_2p)) =1  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_3p)) =1  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_4p)) =1  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_5p)) =1  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd6_1p)) =1  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd6_2p)) =1  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.ddp)) =1  then 'П'
    --калибровка
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.DataOchK))  =1 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd3_1k)) =1 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd3_2k)) =1 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd3_3k)) =1 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd3_4k)) =1 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd3_5k)) =1 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd6_1k)) =1 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd6_2k)) =1 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.ddk)) =1 then 'Км'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.DataOchK))  =1 then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd3_1k)) =1  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd3_2k)) =1  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd3_3k)) =1  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd3_4k)) =1  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd3_5k)) =1  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd6_1k)) =1  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd6_2k)) =1  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.ddk)) =1  then 'К' end a1,
    case
    --поверка
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.DataOchP))  =2 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_1p)) =2 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_2p)) =2 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_3p)) =2 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_4p)) =2 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_5p)) =2 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd6_1p)) =2 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd6_2p)) =2 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.ddp)) =2 then 'Пм'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.DataOchP))  =2 then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_1p)) =2  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_2p)) =2  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_3p)) =2  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_4p)) =2  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_5p)) =2  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd6_1p)) =2  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd6_2p)) =2  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.ddp)) =2  then 'П'
    --калибровка
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.DataOchK))  =2 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd3_1k)) =2 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd3_2k)) =2 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd3_3k)) =2 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd3_4k)) =2 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd3_5k)) =2 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd6_1k)) =2 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.dd6_2k)) =2 then 'Км'
    when Convert(varchar,t1.ArealK) = '1' and Convert(varchar,MONTH(t1.ddk)) =2 then 'Км'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.DataOchK))  =2 then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd3_1k)) =2  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd3_2k)) =2  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd3_3k)) =2  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd3_4k)) =2  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd3_5k)) =2  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd6_1k)) =2  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.dd6_2k)) =2  then 'К'
    when Convert(varchar,t1.ArealK) <> '1' and Convert(varchar,MONTH(t1.ddk)) =2  then 'К' end a2, 
    case
    --поверка
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.DataOchP))  =3 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_1p)) =3 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_2p)) =3 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_3p)) =3 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_4p)) =3 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd3_5p)) =3 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd6_1p)) =3 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.dd6_2p)) =3 then 'Пм'
    when Convert(varchar,t1.ArealP) = '1' and Convert(varchar,MONTH(t1.ddp)) =3 then 'Пм'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.DataOchP))  =3 then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_1p)) =3  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_2p)) =3  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_3p)) =3  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_4p)) =3  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd3_5p)) =3  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd6_1p)) =3  then 'П'
    when Convert(varchar,t1.ArealP) <> '1' and Convert(varchar,MONTH(t1.dd6_2p)) =3  then 'П'

    Взято со знаменитого топика на sql.ru: http://sql.ru/forum/actualthread.aspx?tid=591607
    Писано ручками некоего безумца. Тому, кто занял его место впоследствии, было дано задание оптимизировать это под угрозой увольнения.
    P.S. Функционал сайта, как выяснилось, не держит больше 100 строк говнокода, поэтому с полным текстом лучше ознакомиться по данной выше ссылке.

    guest, 18 Февраля 2009

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

    +147

    1. 1
    2. 2
    3. 3
    private static string ParseDate(DateTime date) {
        return date.ToString(Consts.Formatting.SHORT_DATE_WITH_SHORT_YEAR_DATA_FORMAT, CultureInfo.InvariantCulture);
    }

    неожиданный нейминг naming. после использования - сжечь

    guest, 17 Февраля 2009

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

    +141.5

    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
    $db = S4Y::getInstance()->getDb();
            $sql = 'INSERT INTO publish_groups (domain, name)
                VALUES (:domain, :name)';
            $db->query(
                $sql, array('domain' => S4Y::$domain, 'name' => $_POST['subgroup'])
            );
            if ($this->_groupId) {
                $last_insert_id = $db->lastInsertId();
                $sql = 'UPDATE publish_groups
                    SET parent_id = :parent
                    WHERE id = :id';
                $db->query(
                    $sql,
                    array('parent' => $this->_groupId, 'id' => $last_insert_id)
                );

    Кусок кода создает группу публикаций и устанавливает ей парента.
    В два приема, чтоб не напрягать мускуль более чем 2 параметрами...

    guest, 16 Февраля 2009

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

    +145

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    <?
    
    $mytext = iconv('windows-1251', 'utf-8', $mytext);
    echo $mytext;
    
    //There is a little problem with iconv in such using
    //This code isn't work correctly. Solution is:
    
    $mytext = iconv('windows-1251', 'utf-8', $mytext);
    echo $mytext;
    
    ?>

    Я всегда говорил что бездумная перепечатка чужих мануалов это зло...

    guest, 13 Февраля 2009

    Комментарии (1)
  7. VisualBasic / Говнокод #541

    −270.2

    1. 1
    Private m_FuckupDate As Date   'date when fuckup happened

    Глобальная переменная в классе

    guest, 12 Февраля 2009

    Комментарии (1)
  8. Python / Говнокод #538

    −354.8

    1. 1
    2. 2
    3. 3
    4. 4
    infle = list()
    for line in inf.read().splitlines():
      infle.append(line.decode('windows-1251'))
    infile = iter(infle)

    Функция принимает параметр inf... через пол-экрана:

    guest, 11 Февраля 2009

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

    +144.5

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    $upload_dir = ABSPATH;
    $upload_dir .= str_replace(ABSPATH, '', trim( get_option( 'upload_path' ) ) );
    		
    if ( empty( $upload_dir ) )
    $upload_dir = WP_CONTENT_DIR . '/uploads'; 
    
    //.....

    плагин WP Post Thumbnail v 0.1.8

    guest, 10 Февраля 2009

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

    +151

    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
    #include "stdafx.h"
    
    class CTest
    {
    private:
      virtual void Print()
      {
        _tprintf( _T("He he ;)\n"));
      }
    };
    
    class CX
    {
    public:
      virtual void BlaBla();
    };
    
    int _tmain(int argc, _TCHAR* argv[])
    {
      CTest t;
    
      //error C2248: 'CTest::Print' : cannot access private member declared in class 'test'
      //t.Print();
    
      //It works
      ((void (*)(void))((int*)(*(int*)&t))[0])();
    
      //It works, too
      ((CX*)&t)->BlaBla();
    
      return 0;
    }

    guest, 07 Февраля 2009

    Комментарии (1)
  11. Python / Говнокод #494

    −114

    1. 1
    2. 2
    3. 3
    4. 4
    ggaa
    awqe
    asd
    adfa

    asdasdasdas

    guest, 03 Февраля 2009

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