1. Assembler / Говнокод #12132

    +109

    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
    GLOBAL _start
        SEGMENT .text
    _start:
         mov eax,4 ; N function=write
         mov ebx,1 ; N handle=1 (stdout)
         mov ecx, txt ; address of buf
         mov edx,16 ; number of byte
         int 80h
    
         mov eax,3 ; N function=read
         mov ebx,0 ; 0 handle=0 (stdin)
         mov ecx, buf ; address of buf
         mov edx,80 ; number of byte
         int 80h
    
         mov [len],eax ;save length buf
         mov byte [buf+1],'!'
    
         mov eax,4 ; N function=write
         mov ebx,1 ; N handle=1 (stdout)
         mov ecx, buf ; address of buf
         mov edx,[len] ; number of byte
         int 80h
    
         mov eax,1 ; function=exit
         int 80h 
         
    SEGMENT .data
    	buf times 80 db 0 ;
    	len dd 0
    	txt db 'Enter the text '

    dos_, 15 Ноября 2012

    Комментарии (33)
  2. Java / Говнокод #12131

    +62

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    _L1:
            if(i$ >= len$)
                break MISSING_BLOCK_LABEL_133;
            Constructor constructor = arr$[i$];
            if(Objects.equals(pattern, constructor.getParameterTypes()))
                return instantiateByConstructor(constructor, params);
            i$++;
              goto _L1
            return instantiateByClass(clazz);
            Exception e;
            e;
            Exception cause = e;

    TopS BI и где вы только находите таких программистов.......

    mrFoxs, 15 Ноября 2012

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

    +18

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    using namespace boost;
    typedef filesystem::recursive_directory_iterator dir_iter_t;
    dir_iter_t itt(filesystem::current_path());
    while ([&](dir_iter_t &itter) -> decltype(itter)
    {
        std::cout << boost::filesystem::path((*itter++).path()).make_preferred().string() << std::endl;
        return itter;
    }(itt) != dir_iter_t());

    Вчера ночью написал сие чудо , сегодня когда увидел - меня чуть приступ не хватил.
    Выводит в консоль всё содержимое текущего каталога и всех вложенных.

    suc-daniil, 15 Ноября 2012

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

    +141

    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
    public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14, Object arg15, Object arg16, Object arg17, Object arg18, Object arg19, Object arg20, Object arg21, Object arg22, Object arg23, Object arg24, Object arg25, Object arg26, Object arg27, Object arg28, Object arg29, Object arg30) {
            return new Object[]{
                    arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21, arg22, arg23, arg24, arg25, arg26, arg27, arg28, arg29, arg30};
        }
    
        public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14, Object arg15, Object arg16, Object arg17, Object arg18, Object arg19, Object arg20, Object arg21, Object arg22, Object arg23, Object arg24, Object arg25, Object arg26, Object arg27, Object arg28, Object arg29, Object arg30, Object arg31) {
            return new Object[]{
                    arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21, arg22, arg23, arg24, arg25, arg26, arg27, arg28, arg29, arg30, arg31};
        }
    
        public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14, Object arg15, Object arg16, Object arg17, Object arg18, Object arg19, Object arg20, Object arg21, Object arg22, Object arg23, Object arg24, Object arg25, Object arg26, Object arg27, Object arg28, Object arg29, Object arg30, Object arg31, Object arg32) {
            return new Object[]{
                    arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21, arg22, arg23, arg24, arg25, arg26, arg27, arg28, arg29, arg30, arg31, arg32};
        }
    
        public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14, Object arg15, Object arg16, Object arg17, Object arg18, Object arg19, Object arg20, Object arg21, Object arg22, Object arg23, Object arg24, Object arg25, Object arg26, Object arg27, Object arg28, Object arg29, Object arg30, Object arg31, Object arg32, Object arg33) {
            return new Object[]{
                    arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21, arg22, arg23, arg24, arg25, arg26, arg27, arg28, arg29, arg30, arg31, arg32, arg33};
        }
    
        public static Object[] createArray(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14, Object arg15, Object arg16, Object arg17, Object arg18, Object arg19, Object arg20, Object arg21, Object arg22, Object arg23, Object arg24, Object arg25, Object arg26, Object arg27, Object arg28, Object arg29, Object arg30, Object arg31, Object arg32, Object arg33, Object arg34) {
            return new Object[]{
                    arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21, arg22, arg23, arg24, arg25, arg26, arg27, arg28, arg29, arg30, arg31, arg32, arg33, arg34};
        }

    Отменный говнокод http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java

    betastat, 15 Ноября 2012

    Комментарии (12)
  5. Python / Говнокод #12128

    −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
    eval_prefix = lambda inp:\
                reduce(lambda stack, symbol:\
                (
                  (stack+[symbol]) if symbol.isdigit() \
                 else \
                  (
                    stack[:-2]+\
                    [str(
                          eval(
                               stack[-1]+symbol+stack[-2]
                              )
                        )
                    ]
                  )
                ), inp[::-1], [])[0]

    Здесь вам не хаскель!

    serpinski, 15 Ноября 2012

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

    +43

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    if(!empty($_POST['word'])) {
    	$sql = "SELECT `sysname` FROM `__" . $this->tables[0] . "` WHERE `title`='".$_POST['word']."'";
    	$model = $conn->fetchAll($sql);
    	if(!sizeof($model)) {
    		header("Location: " . $_SERVER['HTTP_REFERER']);
    		exit;
    	}
    	header("Location: /catalog/brands/" . $model[0]['sysname'] . ".html");
    	exit;
    }

    Маленький кусок проекта на Symfony 2.

    UnnamedUser, 14 Ноября 2012

    Комментарии (18)
  7. Python / Говнокод #12126

    −98

    1. 1
    file.write(struct.pack('c', bytes(str('\x02'), 'ASCII')))

    Потребовалось записать 1 байт в файл...

    bazhenovc, 14 Ноября 2012

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

    +98

    1. 1
    2. 2
    3. 3
    public String toString() {
            return new String(body.toString());
        }

    Но зачем?

    3.14159265, 14 Ноября 2012

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

    +54

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    $postitle = str_replace (' ', '-', $title);
    				$postitle = str_replace ('/', '', $postitle);
    				$postitle = str_replace ('\\', '', $postitle);
    				$postitle = str_replace (':', '', $postitle);
    				$postitle = str_replace ('<', '', $postitle);
    				$postitle = str_replace ('>', '', $postitle);
    				$postitle = str_replace ('*', '', $postitle);
    				$postitle = str_replace ('?', '', $postitle);
    				$postitle = str_replace ('|', '', $postitle);
    				$postitle = str_replace ('"', '', $postitle);
    				$postitle = preg_replace ('#\[.*?\]#isu', '', $postitle);

    aleksey, 14 Ноября 2012

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

    +152

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    $cxp_pen.Submit = function() {
    		var c = t(cxp_pen_common_data.fnFldId, cxp_pen_common_data.lnFldId, cxp_pen_common_data.fnEFldId, cxp_pen_common_data.lnEFldId);
    		if (c) {
    			var a = u(cxp_pen_common_data.fnFldId, cxp_pen_common_data.fnEFldId),
    				b = false;
    			if (a)
    				b = v(cxp_pen_common_data.lnFldId, cxp_pen_common_data.lnEFldId);
    			if (a && b)
    				B()
    		}
    	};

    Лучший способ обфускации в мире.
    Отрыл в форме смены имени и фамилии в live.com, в попытках вставить различную хрень.

    ReckO, 14 Ноября 2012

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