1. C++ / Говнокод #13804

    +3

    1. 1
    CBinarySemaphore _there_is_only_one;//Highlander.

    laMer007, 17 Сентября 2013

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

    −11

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    Point ReadPoint ()
    {
    	Fixed x = ReadFixed();
    	Fixed y = ReadFixed();
    	return Point(x,y);
    }

    Как же меня бесит отсутствие чётко определённого стандартом порядка вычисления аргументов!!!!!!!

    TarasB, 17 Сентября 2013

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

    +11

    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
    AbstractMessageFrame * DataLength = create_frame(
    		make_condition_reader(this,
    			fnc_ext::bind(
    				fnc_ext::compose1(
    					fnc_ext::compose2(std::logical_or<bool>(),
    									  std::bind2nd(std::equal_to<byte>(), PC5000FlashFeatures::MARKER_SYMBOL),
    									  std::bind2nd(std::equal_to<byte>(), PC5000FlashFeatures::SPACE_SYMBOL)),
    					fnc_ext::mem_fun<const ByteBuffer, const byte&>(&ByteBuffer::back) ),
    				&_receivedBuffer),
    			fnc_ext::bind(
    				fnc_ext::compose2(std::logical_or<bool>(),
    								  fnc_ext::compose1(std::bind2nd(std::greater<WORD>(),
    																 PC5000FlashFeatures::LENGTH_HEADER +
    																 _maxCommandFieldLength +
    																 PC5000FlashFeatures::LENGTH_MARKER +
    																 PC5000FlashFeatures::LENGTH_OF_LENGTH),
    													fnc_ext::mem_fun(&ByteBuffer::length)),
    								  fnc_ext::compose1(fnc_ext::compose2(std::logical_and<bool>(),
    																	  std::not1(std::ptr_fun<const char, bool>((SymbolCheckFunc)isDigit)),
    																	  std::not1(std::ptr_fun<const char, bool>((SymbolCheckFunc)isEnglishLetter))),
    													fnc_ext::mem_fun<const abstractBuffer<unsigned char>, const byte&>(&ByteBuffer::back)) ),
    				&_receivedBuffer) ),
    		fnc_ext::bind(std::mem_fun(&ThisClass::setDataLength), this),
    		"Data Length");

    Композиции, частичные применения, функторы? Больше тотальной функциональщины! Вложенность продолжает расти с развитием проекта.

    laMer007, 17 Сентября 2013

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

    +153

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    $imgs = glob('images/'.$url_parts[0].'/*');
        
        // Windows detection
        if(DIRECTORY_SEPARATOR == '\\') {
            $cnt = count($imgs);
            for($i = 0; $i < $cnt; $i++) $imgs[$i] = iconv('CP1251//IGNORE', 'UTF-8', $imgs[$i]);
        }

    DIX315, 17 Сентября 2013

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

    +116

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    Кто может посоветовать сайт, на котором стоит потроллить?
    Хочу отточить свои навыки.
    
    З.Ы. Представляю, как скрежещут зубами тарас и борманд. Слово кабальеро - как только кто нибудь посоветует, заминусую топик.
     )

    Флудинг, троллинг и спаминг.

    Stertor, 16 Сентября 2013

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

    +163

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    ...
    $str = preg_replace ( array_keys ( $new ), array_values ( $new ), $str );
    $str = trim ( $str );
    $str = str_replace ( "       ", "_", $str );
    $str = str_replace ( "      ", "_", $str );
    $str = str_replace ( "     ", "_", $str );
    $str = str_replace ( "    ", "_", $str );
    $str = str_replace ( "   ", "_", $str );
    $str = str_replace ( "  ", "_", $str );
    $str = str_replace ( " ", "_", $str );

    develx0, 16 Сентября 2013

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

    +152

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    <div style="display:none;"><script type="text/javascript">
    (function(w, c) {
        (w[c] = w[c] || []).push(function() {
            try {
                w.yaCounter... = new Ya.Metrika({id:..., enableAll: true});
            }
            catch(e) { }
        });
    })(window, "yandex_metrika_callbacks");
    </script></div>

    Whattt????

    invision70, 16 Сентября 2013

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

    −4

    1. 1
    2. 2
    // please don't change this
    #define NUM_INVISIBLE_TYPES 1

    Выдержка из исходников civilization 5.

    Да, да, прекрасно, усложняйте моддинг

    kindofbear, 16 Сентября 2013

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

    +26

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    $arr['body'][$row_num] = array(
                $datas,
                $tval,
                $club1_link,
                ($results['results_url'] != '' ? '<a href="' . $results['results_url'] . '"' . ($results['results_class'] != '' ? $results['results_class'] : '') . '>' : '<span>') . $results['results'] . ($results['results_url'] != '' ? '</a>' : '</span>'),
                $club2_link,
                spb_stats_show_media_icons($row),
            );

    было еще хуже. каждая строка была адовый тернарник...

    brainstorm, 16 Сентября 2013

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

    +140

    1. 1
    2. 2
    3. 3
    4. 4
    define('SECOND', 1);
    define('MINUTE', SECOND*60);
    define('HOUR', MINUTE*60);
    // ...

    количество секунд в секунде — это определённо что-то новое.

    fidelcomandante, 16 Сентября 2013

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