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

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

    +146.3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    if(isset($_POST["a"]))
        {
         $x=print_r($_POST["a"],true);
         $x=str_replace("    [","",$x);
         $x=str_replace("] => ","",$x);
         $x=str_replace("Array","",$x);
         $body="\n\n";
         $body.=$x;
         ...

    Отправка письма с содержимым формы.
    $_POST["a"] - массив передаваемый из формы

    guest, 31 Марта 2009

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

    +157.4

    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
    <script type="text/javascript">
    stat['asian']=0;
    pics['asian']=new Array('/thumbs/0000003/0003347/0003347_005.jpg','/thumbs/0000000/0000340/0000340_005.jpg','/thumbs/0000003/0003286/0003286_005.jpg','/thumbs/0000002/0002807/0002807_005.jpg','/thumbs/0000000/0000736/0000736_005.jpg');
    stat['anal']=0;
    pics['anal']=new Array('/thumbs/0000000/0000110/0000110_005.jpg','/thumbs/0000011/0011314/0011314_005.jpg','/thumbs/0000000/0000110/0000110_005.jpg','/thumbs/0000008/0008106/0008106_005.jpg','/thumbs/0000015/0015500/0015500_005.jpg');
    stat['gay']=0;
    pics['gay']=new Array('/thumbs/0000001/0001937/0001937_005.jpg','/thumbs/0000000/0000591/0000591_005.jpg','/thumbs/0000001/0001562/0001562_005.jpg','/thumbs/0000000/0000559/0000559_005.jpg','/thumbs/0000001/0001051/0001051_005.jpg');
    stat['mature']=0;
    pics['mature']=new Array('/thumbs/0000009/0009785/0009785_005.jpg','/thumbs/0000000/0000476/0000476_005.jpg','/thumbs/0000011/0011280/0011280_005.jpg','/thumbs/0000009/0009822/0009822_005.jpg','/thumbs/0000003/0003238/0003238_005.jpg');
    stat['lesbian']=0;
    pics['lesbian']=new Array('/thumbs/0000010/0010760/0010760_005.jpg','/thumbs/0000012/0012678/0012678_005.jpg','/thumbs/0000009/0009686/0009686_005.jpg','/thumbs/0000010/0010389/0010389_005.jpg','/thumbs/0000000/0000519/0000519_005.jpg');
    stat['blowjob']=0;
    pics['blowjob']=new Array('/thumbs/0000011/0011320/0011320_005.jpg','/thumbs/0000006/0006367/0006367_005.jpg','/thumbs/0000011/0011487/0011487_005.jpg','/thumbs/0000012/0012655/0012655_005.jpg','/thumbs/0000009/0009602/0009602_005.jpg');
    stat['teens']=0;
    pics['teens']=new Array('/thumbs/0000003/0003770/0003770_005.jpg','/thumbs/0000004/0004427/0004427_005.jpg','/thumbs/0000010/0010795/0010795_005.jpg','/thumbs/0000010/0010079/0010079_005.jpg','/thumbs/0000008/0008470/0008470_005.jpg');
    stat['public']=0;
    pics['public']=new Array('/thumbs/0000011/0011009/0011009_005.jpg','/thumbs/0000002/0002821/0002821_005.jpg','/thumbs/0000010/0010545/0010545_005.jpg','/thumbs/0000004/0004747/0004747_005.jpg','/thumbs/0000012/0012624/0012624_005.jpg');
    stat['group']=0;
    pics['group']=new Array('/thumbs/0000009/0009736/0009736_005.jpg','/thumbs/0000019/0019419/0019419_005.jpg','/thumbs/0000020/0020848/0020848_005.jpg','/thumbs/0000005/0005308/0005308_005.jpg','/thumbs/0000000/0000410/0000410_005.jpg');
    stat['bigtits']=0;
    pics['bigtits']=new Array('/thumbs/0000013/0013906/0013906_005.jpg','/thumbs/0000012/0012874/0012874_005.jpg','/thumbs/0000008/0008778/0008778_005.jpg','/thumbs/0000010/0010558/0010558_005.jpg','/thumbs/0000006/0006816/0006816_005.jpg');
    stat['cumshot']=0;
    pics['cumshot']=new Array('/thumbs/0000009/0009602/0009602_005.jpg','/thumbs/0000002/0002602/0002602_015.jpg','/thumbs/0000006/0006421/0006421_015.jpg','/thumbs/0000001/0001352/0001352_005.jpg','/thumbs/0000006/0006530/0006530_015.jpg');
    stat['ebony']=0;
    pics['ebony']=new Array('/thumbs/0000013/0013923/0013923_005.jpg','/thumbs/0000002/0002836/0002836_005.jpg','/thumbs/0000008/0008727/0008727_005.jpg','/thumbs/0000015/0015677/0015677_005.jpg','/thumbs/0000008/0008510/0008510_005.jpg');
    stat['fetish']=0;
    pics['fetish']=new Array('/thumbs/0000011/0011028/0011028_005.jpg','/thumbs/0000010/0010212/0010212_005.jpg','/thumbs/0000010/0010187/0010187_005.jpg','/thumbs/0000000/0000314/0000314_005.jpg','/thumbs/0000016/0016852/0016852_005.jpg');
    stat['hentai']=0;
    pics['hentai']=new Array('/thumbs/0000006/0006147/0006147_005.jpg','/thumbs/0000015/0015705/0015705_005.jpg','/thumbs/0000015/0015711/0015711_005.jpg','/thumbs/0000010/0010197/0010197_005.jpg','/thumbs/0000014/0014874/0014874_005.jpg');
    stat['amateur']=0;
    pics['amateur']=new Array('/thumbs/0000010/0010511/0010511_005.jpg','/thumbs/0000009/0009992/0009992_005.jpg','/thumbs/0000010/0010601/0010601_005.jpg','/thumbs/0000010/0010704/0010704_005.jpg','/thumbs/0000011/0011465/0011465_005.jpg');
    stat['wildcrazy']=0;
    pics['wildcrazy']=new Array('/thumbs/0000000/0000726/0000726_005.jpg','/thumbs/0000006/0006540/0006540_005.jpg','/thumbs/0000001/0001227/0001227_005.jpg','/thumbs/0000006/0006540/0006540_005.jpg','/thumbs/0000011/0011672/0011672_005.jpg');

    guest, 24 Марта 2009

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

    +135.9

    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
    String[] days = new String[7];
    for( int i = 0; i < 7; i++ ) {
      switch(i) {
        default:
        case 0:
          days[i] = "Monday";
          break;
        case 1:
          days[i] = "Tuesday";
          break;
        case 2:
          days[i] = "Wednesday";
          break;
        case 3:
          days[i] = "Thursday";
          break;
        case 4:
          days[i] = "Friday";
          break;
        case 5:
          days[i] = "Saturday";
          break;
        case 6:
          days[i] = "Sunday";
          break;
      }
    }

    Боян, наверное, но все-таки...

    guest, 24 Марта 2009

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

    +155.9

    1. 1
    2. 2
    $names = explode('_', $className);
    $fileName = join('/', $names) . '.php';

    Супер замена символов в строчке :)
    Это из куска нынче модной функции __autoload() :)

    guest, 18 Марта 2009

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

    +150

    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
    [Serializable]
        public class Key
        {
            public Key(long id, string code)
            {
                m_Id = id;
                m_Code = code;
            }
    
            public Key(long id) : this(id, null)
            {
            }
    
            public Key(string code) : this(0, code)
            {
            }
    
            public Key() : this(0, null)
            {
            }
    
            public long getId()
            {
                return (m_Id);
            }
    
            public long m_Id;
    
            public string getCode()
            {
                return (m_Code);
            }
    
            public string m_Code;
    
            public static string ToString(Key k)
            {
                return ((k == null) ? "(null)" : k.ToString());
            }
        }

    guest, 18 Марта 2009

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

    +154

    1. 1
    2. 2
    3. 3
    strlen($searchNumber) > 0 && strpos($row['to'], $searchNumber) === false && strpos($row['from'], $searchNumber) === false
    
    //strlen($searchNumber) && $row['to'] != $searchNumber && $row['from'] != $searchNumber

    проверка на равенство в ифе

    guest, 18 Марта 2009

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

    +139

    1. 1
    2. 2
    3. 3
    4. 4
    case IDC_CHECK1:
    			UINT uChk = IsDlgButtonChecked(hWnd, IDC_CHECK1);
    			SetWindowPos(hWnd, (HWND)((uChk != 0) -2),0,0,0,0, SWP_NOSIZE | SWP_NOMOVE );
    			break;

    индокод

    guest, 16 Марта 2009

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

    +62.9

    1. 1
    2. 2
    3. 3
    4. 4
    public void setDoubleValue( double doubleValue ) {
        DecimalFormat myFormatter = new DecimalFormat("###.##");
        this.doubleValue=Double.valueOf(myFormatter.format(doubleValue));
    }

    Округление дробной части до двух знаков запятой? Даже если так, то как насчет статического члена класса?

    guest, 13 Марта 2009

    Комментарии (5)
  10. SQL / Говнокод #698

    −852.2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    UPDATE DKNDRECTMPL SET
        TARGET = IIF(OPERATION IN (0, 1, 3, 4, 5), 0, 1),
        ACT = CASE OPERATION
              WHEN 0 THEN 0
              WHEN 1 THEN 1
          WHEN 2 THEN 1
          WHEN 3 THEN 1
          WHEN 4 THEN 1
          WHEN 5 THEN 3
              END;

    Это Firebird если чё.

    guest, 12 Марта 2009

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

    +143.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
    class upload {
    //...
    
        function upload($file = '', $destination = '', $permissions = '777', $extensions = '') {
    //...
            if ( ($this->parse() == true) && ($this->save() == true) ) {
              return true;
            } else {
              return false;
            }
          }
        }

    Интересно для кого конструктор возвращает результат...
    Oscommerce

    guest, 27 Февраля 2009

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