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

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

    +79

    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
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    /**
             * Convenience method call with one parameter
             * 
             * @param method name of method to call
             * @param p0 method's parameter
             * @return deserialized method return value
             * @throws XMLRPCException
             */
            public Object call(String method, Object p0) throws XMLRPCException {
                    Object[] params = {
                            p0,
                    };
                    return callEx(method, params);
            }
            
            /**
             * Convenience method call with two parameters
             * 
             * @param method name of method to call
             * @param p0 method's 1st parameter
             * @param p1 method's 2nd parameter
             * @return deserialized method return value
             * @throws XMLRPCException
             */
            public Object call(String method, Object p0, Object p1) throws XMLRPCException {
                    Object[] params = {
                            p0, p1,
                    };
                    return callEx(method, params);
            }
    
    //.......................................................
    //.....................cut.............................
    //.......................................................
    
            /**
             * Convenience method call with seven parameters
             * 
             * @param method name of method to call
             * @param p0 method's 1st parameter
             * @param p1 method's 2nd parameter
             * @param p2 method's 3rd parameter
             * @param p3 method's 4th parameter
             * @param p4 method's 5th parameter
             * @param p5 method's 6th parameter
             * @param p6 method's 7th parameter
             * @return deserialized method return value
             * @throws XMLRPCException
             */
            public Object call(String method, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6) throws XMLRPCException {
                    Object[] params = {
                            p0, p1, p2, p3, p4, p5, p6,
                    };
                    return callEx(method, params);
            }
    
    
            /**
             * Convenience method call with eight parameters
             * 
             * @param method name of method to call
             * @param p0 method's 1st parameter
             * @param p1 method's 2nd parameter
             * @param p2 method's 3rd parameter
             * @param p3 method's 4th parameter
             * @param p4 method's 5th parameter
             * @param p5 method's 6th parameter
             * @param p6 method's 7th parameter
             * @param p7 method's 8th parameter
             * @return deserialized method return value
             * @throws XMLRPCException
             */
            public Object call(String method, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7) throws XMLRPCException {
                    Object[] params = {
                            p0, p1, p2, p3, p4, p5, p6, p7,
                    };
                    return callEx(method, params);
            }

    http://code.google.com/p/android-xmlrpc/source/browse/trunk/XMLRPC/src/org/xmlrpc/android/XMLRPCClient.java

    striker, 31 Августа 2010

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

    +123

    1. 1
    2. 2
    3. 3
    4. 4
    string mailTo = ((Config.GetSetting("AdminNotifications_EmailAddress") == null) ||
                                 (Config.GetSetting("AdminNotifications_EmailAddress").Length <= 0))
                                    ? Globals.GetHostPortalSettings().HostSettings["SMTPPassword"].ToString()
                                    : Config.GetSetting("AdminNotifications_EmailAddress");

    из модуль для DotNetNuke

    Coffeeholic, 28 Августа 2010

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

    +164

    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
    var modo_sac = 0;
    function buscar_sacapuntas(modo){
    	try {
    		if(modo!=null || modo!='undefined')
    			modo_sac = modo;
    		cn_sac = crearXMLHttpRequest();
    		var cad_x = encodeURIComponent(null)
    		cn_sac.onreadystatechange = procesar_sacapuntas;
    		cn_sac.open("POST","extranet/portal/xml/xml_publicos/xml_sacapunta.xml",true);
    		cn_sac.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    		cn_sac.send(cad_x);
    	}catch(exception) {
    		if(exception.description == null){
    			alert("ExcepciУГn a: " + exception.message);  
    		}else{
    			alert("ExcepciУГn a: " + exception.description);
    		}//end if
    	}//end try
    }//end function

    немного о том, как говнокодит Уго Чавэс в Венесуэле:)
    http://www.opsu.gob.ve/js/js_index.js
    см. строку 4 (венесуэльное условие) и 7 (венесуэльный encodeURIComponent)

    Alfred, 24 Августа 2010

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

    +137

    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
    #include <stdio.h>
    
    #define template_pair_declare(x,y) \
    struct x##_##y##_pair \
    { \
        x first; \
        x second; \
    }
    
    #define template_pair(x,y) struct x##_##y##_pair
    
    #define template_mkpair_declare(x,y) \
    template_pair(x,y) mkpair_##x##_##y(x _first,y _second) \
    { \
        template_pair(x,y) res;res.first=_first;res.second=_second; \
        return res; \
    }
    
    #define template_mkpair(x,y) mkpair_##x##_##y
    
    template_pair_declare(int,int);
    template_pair_declare(float,float);
    
    int main()
    {
        template_pair(int,int) ip;
        scanf("%d%d",&ip.first,&ip.second);
        printf("Sum: %d\n",ip.first+ip.second);
        template_pair(float,float) fp;
        scanf("%f%f",&fp.first,&fp.second);
        printf("Sum: %f\n",fp.first+fp.second);
        return 0;
    }

    Шаблонные структуры и шаблонные функции для труЪ сишников.

    frp, 24 Августа 2010

    Комментарии (9)
  6. JavaScript / Говнокод #4060

    +166

    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
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
      <title> Определение браузера </title>
    
    <script type='text/javascript'>
    function BrowserName()
    {
      var span = document.getElementById('browser');
      if(window.opera) { span.innerHTML = 'Opera'; }
      if(document.all) { span.innerHTML = 'IE'; }
      if(document.layers) {  span.innerHTML = 'NN4'; }
      if(window.XMLHttpRequest) { span.innerHTML = 'Mozilla (FireFox)'; }
      span.innerHTML = 'неизвестный браузер';
      return true;
    }
    </script>
    
    </head>
    
    <body onload='BrowserName()'>
    
      Ваш браузер: <span id='browser'></span>
    
    </body>
    </html>

    Блуждая в поисках откопал ещё вот такое...

    istem, 22 Августа 2010

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

    +121

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    /// <summary>
            /// Returns current UTC time
            /// </summary>
            /// <returns></returns>
            public static DateTime GetCurrentTimeUtc()
            {
                DateTime dt = DateTime.UtcNow;
                return dt;
            }

    Индус-стайл метод

    sem13, 17 Августа 2010

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

    +119

    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
    cMap.put("Cn", new Category(1<<0));        // UNASSIGNED
                cMap.put("Lu", new Category(1<<1));        // UPPERCASE_LETTER
                cMap.put("Ll", new Category(1<<2));        // LOWERCASE_LETTER
                cMap.put("Lt", new Category(1<<3));        // TITLECASE_LETTER
                cMap.put("Lm", new Category(1<<4));        // MODIFIER_LETTER
                cMap.put("Lo", new Category(1<<5));        // OTHER_LETTER
                cMap.put("Mn", new Category(1<<6));        // NON_SPACING_MARK
                cMap.put("Me", new Category(1<<7));        // ENCLOSING_MARK
                cMap.put("Mc", new Category(1<<8));        // COMBINING_SPACING_MARK
                cMap.put("Nd", new Category(1<<9));        // DECIMAL_DIGIT_NUMBER
                cMap.put("Nl", new Category(1<<10));       // LETTER_NUMBER
                cMap.put("No", new Category(1<<11));       // OTHER_NUMBER
                cMap.put("Zs", new Category(1<<12));       // SPACE_SEPARATOR
                cMap.put("Zl", new Category(1<<13));       // LINE_SEPARATOR
                cMap.put("Zp", new Category(1<<14));       // PARAGRAPH_SEPARATOR
                cMap.put("Cc", new Category(1<<15));       // CNTRL
                cMap.put("Cf", new Category(1<<16));       // FORMAT
                cMap.put("Co", new Category(1<<18));       // PRIVATE USE
                cMap.put("Cs", new Category(1<<19));       // SURROGATE
                cMap.put("Pd", new Category(1<<20));       // DASH_PUNCTUATION
                cMap.put("Ps", new Category(1<<21));       // START_PUNCTUATION
                cMap.put("Pe", new Category(1<<22));       // END_PUNCTUATION
                cMap.put("Pc", new Category(1<<23));       // CONNECTOR_PUNCTUATION
                cMap.put("Po", new Category(1<<24));       // OTHER_PUNCTUATION
                cMap.put("Sm", new Category(1<<25));       // MATH_SYMBOL
                cMap.put("Sc", new Category(1<<26));       // CURRENCY_SYMBOL
                cMap.put("Sk", new Category(1<<27));       // MODIFIER_SYMBOL
                cMap.put("So", new Category(1<<28));       // OTHER_SYMBOL
                cMap.put("L", new Category(0x0000003E));   // LETTER
                cMap.put("M", new Category(0x000001C0));   // MARK
                cMap.put("N", new Category(0x00000E00));   // NUMBER
                cMap.put("Z", new Category(0x00007000));   // SEPARATOR
                cMap.put("C", new Category(0x000D8000));   // CONTROL
                cMap.put("P", new Category(0x01F00000));   // PUNCTUATION
                cMap.put("S", new Category(0x1E000000));   // SYMBOL
                cMap.put("LD", new Category(0x0000023E));   // LETTER_OR_DIGIT

    в целях дальнейшего бугурта у ((школоты)|(быдлокодеров)) не осиливших ((циклов)|(массивов, листов, сетов, мапов))
    source is same #3976 #3975 #3940 #3998 #3999

    3.14159265, 17 Августа 2010

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

    +110

    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
    // At the maximum, no match found
                    if (j >= cmax)
                        return false;
                    // Okay, must try one more atom
                    if (!atom.match(matcher, i, seq))
                        return false;
                    // If we haven't moved forward then must break out
                    if (i == matcher.last)
                        return false;
    
                if (type == GREEDY)
                    return match0(matcher, i, j, seq);
                else if (type == LAZY)
                    return match1(matcher, i, j, seq);
                else
                    return match2(matcher, i, j, seq);

    to be continued....

    3.14159265, 16 Августа 2010

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

    +144

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteCond %{REQUEST_FILENAME} !-l
    
    RewriteRule \.(jpeg|gif|bmp|png|jpg|css|js)$ - [L]
    
    RewriteRule ^([a-z]+)$ index.php?param1=$1 [L,QSA]

    abcee, 15 Августа 2010

    Комментарии (9)
  11. JavaScript / Говнокод #3974

    +162

    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
    <script language="JavaScript">
    	// Если JavaScript выключен, то объявы WMLink'а не видны, след-но, обрамление 
    	// не нужно. Поэтому его заскриптуем, и рефку тоже:
    	o=document.links.length;
    	document.write("<div style='border-top:solid 2px white;border-bottom:solid 2px white;margin-top:2px;'>");
    </script>
    
    <script language="JavaScript" src="http://r1.wmlink.ru/?id=2664"></script>
    <script language=JavaScript>
    	document.write("</div>");
    	if(document.links.length>o){
    		document.write("<p style='margin:0px;font-size:8pt;font-family:Verdana;' align=right><a href='http://wmlink.ru/index.php?ref=4186' id='wmlinkref'>$$$ <i>размести такой же блок ссылок на своём сайте и получай деньги!</i></a></p>");
    	}
    </script>

    :) логика предикатов отдыхает!!!!
    http://delajdengi.ru/
    пояснения:
    строка 4 - запоминаем кол-во ссылок в документе во время загрузки документа. по документу их 5.
    строка 11 - если скриптом подгрузились еще сслыки с сервиса ВМЛИНК => JavaScript не отключен и можно JavaScript'ом обогатить население!

    А ты!? "разместил такой же блок ссылок на своём сайте и получил деньги!"

    Alfred, 13 Августа 2010

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