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

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

    +82

    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
    private static void createFile(File f) {
    	try {
    		f.createNewFile();
    		FileOutputStream fs = new FileOutputStream(f);
    		Long time = new Date().getTime();
    
    		int b = 0;
    
    		b = (int) (time % 256);
    		fs.write(b);
    		time /= 256;
    
    		b = (int) (time % 256);
    		fs.write(b);
    		time /= 256;
    
    		b = (int) (time % 256);
    		fs.write(b);
    		time /= 256;
    
    		b = (int) (time % 256);
    		fs.write(b);
    		time /= 256;
    
    		b = (int) (time % 256);
    		fs.write(b);
    		time /= 256;
    
    		b = (int) (time % 256);
    		fs.write(b);
    		time /= 256;
    
    		b = (int) (time % 256);
    		fs.write(b);
    		time /= 256;
    
    		b = (int) (time % 256);
    		fs.write(b);
    		time /= 256;
    
    		fs.flush();
    		fs.close();
    	} catch (IOException e) {
    		e.printStackTrace();
    	}
    }

    Сохранение даты в файл :)

    mastermind, 23 Ноября 2011

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

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    } catch (PDOException $e)
                {
                print_r($e->__toString());
                die();
                }

    sectus, 23 Ноября 2011

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

    +145

    1. 1
    i=i++;

    AjiTae, 22 Ноября 2011

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

    +168

    1. 1
    http://www.shkodenko.kiev.ua/index.php?lang_id=1&content_id=82

    я охуел

    dos_, 21 Ноября 2011

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

    +144

    1. 1
    app::window::event* event = new app::window::event::keyboard::press(key);

    tymofey, 20 Ноября 2011

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

    +135

    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
    -- html-код --
    <div class="sp_middle_row_right" style="margin-right: 10px;">                
                                <input type="hidden" name="capcha" value="1396309901" />               
                    <img src="http://www.uatrade.net/include/parser/capcha.php?image=1396309901" alt="capcha" title="capcha"/>
                </div> 
    -- html-код --
    
     var capcha = $('input[name=capcha]').attr('value');
            var manual_capcha = $('input[name=manual_capcha]').attr('value');
            $.post('http://www.uatrade.net/include/parser/ajax_capcha.php', {capcha:capcha, manual_capcha:manual_capcha}, function(d){
                if(Number(d) === 1){
                        -- код--
                        $.post('http://www.uatrade.net/include/parser/ajax_position.php', {domain:domain, keywords:keywords, yandex:yandex, google:google, country:country}, function(res){
                             -- код --
                       }
               }else{
                    alert('Введите правильно капчу.');
                    return false;
                }

    Пояснение. Капча генерируется "просто и со вкусом". генерится рандомное число, вырезаются первые 4 цифры и это число умножается на 2,5 потом округляется. Результат выводится на картинку. Остальное, думаю, пояснений не требует.

    Это только некоторые "гениальные" моменты из формы (http://www.uatrade.net/parser_position) для проверки позиций сайтов по ключевикам на сайте одной компании, занимающейся созданием и продвижением сайтов (www.uatrade.net).

    elderdarkelf, 20 Ноября 2011

    Комментарии (4)
  8. Java / Говнокод #8563

    +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
    15. 15
    16. 16
    17. 17
    m_scrabblerProperties = Utils.loadPropertiesFile(m_args[1]);
    if (null != m_scrabblerProperties)
    {
    	System.out.println("Executing DBScrubber with properties file " + m_args[1] + " loaded from the classpath");
    }
    else
    {
    	try
    	{
    		m_scrabblerProperties.load(new FileInputStream(m_args[1]));
    		System.out.println("Executing DBScrubber with properties file " + m_args[1] + " loaded from the file system");
    	}
    	catch (IOException e)
    	{
    		System.err.println("Failed to load " + m_args[1] + " from the classpath or the file system");
    	}
    }

    Utils.loadPropertiesFile - какая то хитрая поделуха которая ищет файл в кэше. Если он не найден в кэше, то автор видимо хотел попробовать считать файл с диска, но судя по всему оказался оказался дебилом.

    askell, 18 Ноября 2011

    Комментарии (4)
  9. VisualBasic / Говнокод #8538

    −94

    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
    ' ==== Пример №1 ====
    strParentAsset = "Parent_Asset_OnetoOneRelationship_Child_NewEarlyStaged"
    strChildAsset = "ChildAssetArray_NewEarlyStaged"
    strArrAssetList = Split(strParentAsset & "," & strChildAsset, ",")
    
    ' ==== Пример №2 ====
    strProjectNames="" & strTODO_Project & "1," & strTODO_Project & "2," & strTODO_Project & "3," & strTODO_Project & "4," & strTODO_Project & "5," & strTODO_Project & "6," & strTODO_Project & "7," & strTODO_Project & "8," & strTODO_Project & "9," & strTODO_Project & "10," & strTODO_Project & "11," & strTODO_Project & "12," & strTODO_Project & "13," & strTODO_Project & "14," & strTODO_Project & "15," & strTODO_Project & "16," & strTODO_Project & "17," & strTODO_Project & "18," & strTODO_Project & "19," & strTODO_Project & "20," & strTODO_Project & "21," & strATG_TODO_PROJECT22
    strArrProjectNames= Split(strProjectNames,",")
    
    ' ==== Пример №3 ====
    Dim strWeekday
    ...
    ReDim strWeekday(7)
    strWeekday(1)= "Sun":strWeekday(2)= "Mon":strWeekday(3)= "Tue":strWeekday(4)= "Wed":strWeekday(5)= "Thu":strWeekday(6)= "Fri":strWeekday(7)= "Sat"

    Примеры создания массивов из QTP-проекта, написанного индусами

    Lurker, 16 Ноября 2011

    Комментарии (4)
  10. Куча / Говнокод #8501

    +150

    1. 1
    http://www.gamedev.ru/users/?id=45914

    AnimeGovno-_-, 12 Ноября 2011

    Комментарии (4)
  11. Java / Говнокод #8463

    +70

    1. 1
    2. 2
    3. 3
    4. 4
    @Override protected void finalize()
    {
        Runtime.addShutdownHook();
    }

    Здесь без комментариев...

    dwinner, 09 Ноября 2011

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