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

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

    +123

    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
    <? include ("header.php");
    include ("../setup.php");
    $resultg=mysql_query("select * from seting ");
    $rog=mysql_fetch_array($resultg);
    ?>
    
    <center><h4><font color=7C87C2>Настройка Казино</font></h4><br></center>
    
    
    <table border="0" align="center" cellpadding="0" cellspacing="10">
    <FORM action=config.php method=post>
    <TR><td>Логин админа : </td><TD><INPUT size=40 name=alog value=<? echo $rog[0] ?>></TD></TR>
    <TR><td>Пароль админа </td><TD><INPUT size=40 name=apas value=<? echo $rog[1] ?>></TD></TR>
    <TR><td>Email казино</td><TD><INPUT size=40 name=adm_email value=<? echo $rog[2] ?>></TD></TR>
    <TR><td>ICQ казино (если нет то пусто)</td><TD><INPUT size=40 name=icq value=<? echo $rog['icq'] ?>></TD></TR>
    <TR><td>url казино (начиная с http:// и без "/" конце)</td><TD><INPUT size=40 name=cas_url value=<? echo $rog[3] ?>></TD></TR>
    <TR><td>Название казино</td><TD><INPUT size=40 name=cas_name value=<? echo $rog[4] ?>></TD></TR>
    <TR><td>Партнерские</td><TD><INPUT size=20 name=pcash value=<? echo $rog['pcash'] ?>> %</TD></TR>
    
    <TR><td><b>Высылать Email админу:</b></td><TD></TD></TR>
    <TR><td>При пополнение счета</td><TD><input type=checkbox name="paymail" value="yes"<? if($rog["paymail"] == 'yes') { echo ' checked'; } ?>></TD></TR>
    <TR><td>Зарегился новый игрок</td><TD><input type=checkbox name="regmail" value="yes"<? if($rog["regmail"] == 'yes') { echo ' checked'; } ?>></TD></TR>
    <TR><td>Вывод средств</td><TD><input type=checkbox name="zakmail" value="yes"<? if($rog["zakmail"] == 'yes') { echo ' checked'; } ?>></TD></TR>
    
    <TR>
    
    <td bgcolor="#FFFFFF"><font face="Verdana" size="2">
    
    <span style="background-color: #FFFFFF">Сумма ежедневных бонусов WMR(разделитель .)</span></font></td>
    
    <TD bgcolor="#FFFFFF"><font face="Verdana">
    
    <INPUT size=10 name=us_bonus value="<? echo $rog['bonus'] ?>"></font></TD>
    
    </TR>
    
    
    <TR><td><b>Настройка Roboxchange.com</b></td><TD></TD></TR>
    <TR><td>LOGIN в Robox</td><TD><INPUT size=40 name=mrh_login value=<? echo $rog[5] ?>></TD></TR>
    <TR><td>PASS1 в Robox</td><TD><INPUT size=40 name=mrh_pass1 value=<? echo $rog[6] ?>></TD></TR>
    <TR><td>PASS2 в Robox</td><TD><INPUT size=40 name=mrh_pass2 value=<? echo $rog[7] ?>></TD></TR>
    
    <TR><TD><INPUT type=hidden value=1 name=send><INPUT type=hidden value=<? echo $rog[cas_bon] ?> name=cas_bon><INPUT type=submit value="Сохранить"></TD></TR>
    </FORM>
    </table>
    
    
    <?
    
    if ($send=="1"){
    mysql_query("UPDATE seting SET alog='$alog',apas='$apas',adm_email='$adm_email',cas_url='$cas_url',cas_name='$cas_name',mrh_login='$mrh_login',mrh_pass1='$mrh_pass1',mrh_pass2='$mrh_pass2',pcash='$pcash',cas_bon='$cas_bon',bonus='$us_bonus',paymail='$paymail',regmail='$regmail',zakmail='$zakmail',icq='$icq'");
    echo "<script> alert('Настройки сохранены!'); document.location.href='config.php';</script>";
    }
    
    include ("footer.php"); ?>

    Кусок Скрипта готового Казино

    Vasiliy, 17 Сентября 2010

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

    +155

    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
    typedef struct IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING344 : boost::mpl::assert_ {
    
      static boost::mpl::failed ************ (IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING::************ assert_arg()) (T&) {
        return 0;
      }
    } mpl_assert_arg344;
    
    typedef struct IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING375 : boost::mpl::assert_ {
    
      static boost::mpl::failed ************ (IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING::************ assert_arg()) (T&) {
        return 0;
      }
    } mpl_assert_arg375;
    
    template< typename Pred >
    failed ************ (Pred::************
      assert_arg(void (*)(Pred), typename assert_arg_pred<Pred>::type)
      );
    
    template< typename Pred >
    failed ************ (boost::mpl::not_<Pred>::************
      assert_not_arg(void (*)(Pred), typename assert_arg_pred_not<Pred>::type)
      );

    В том что boost'овские библиотеки достаточно хорошо оптимизированы я не сомневаюсь, но от некоторых конструкций я просто охреневаю...

    rudvil, 08 Сентября 2010

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

    +144

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    Но имей ввиду, в реали, когда на работу пойдёшь, в СУБД у тебя уже скорее всего будет помойка, в том числе с триггерами. 
    К этому надо привыкнуть, так как никакие уговоры убрать триггера на «товарищей» не подействуют, наоборот разозлят, 
    над тобой будут смеяться и скажут, что крутые пацаны работают только на триггерах.
    От хакерских атак одно подключение не спасёт, это я просто так высмеиваю шибко «умных» людей.
    
    Eсть другая идея - на странице регистрации высвети кнопки с цифрами и алфавитом чтобы пользователь вводил пароль не с клавиатуры,
     а щёлкая мышью по кнопкам. Сами кнопки можешь в случайном порядке расположить.
    Потом мы вместе с тобой будем над хакерами смеяться.

    Max Pro рассуждает на тему безопасности.
    http://sql.ru/forum/actualthread.aspx?tid=787435
    тут пытаемся выманить его на разговор про серверный жаваскрипт
    http://www.sql.ru/forum/memberinfo.aspx?mid=14149
    тут ссылка на его профиль раз
    http://www.aspnetmania.com/Users/User/1614.html
    тут ссылка на профиль два.
    сообщения доставляют
    http://aspnetmania.com/Blogs/1614.html
    тут старый блог

    ursus, 06 Сентября 2010

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

    +168

    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
    // Saves options to localStorage.
    function save_options() {
    	if(document.getElementById("rate").checked == true) {localStorage["rate"] = 1;}
    else{localStorage["rate"] = 0;}
    	if(document.getElementById("transparentmenu").checked == true) {localStorage["transparentmenu"] = 1;}
    else{localStorage["transparentmenu"] = 0;}
    	if(document.getElementById("sidebarfix").checked == true) {localStorage["sidebarfix"] = 1;}
    else{localStorage["sidebarfix"] = 0;}
    	if(document.getElementById("menufix").checked == true) {localStorage["menufix"] = 1;}
    else{localStorage["menufix"] = 0;}
    	if(document.getElementById("away").checked == true) {localStorage["away"] = 1;}
    else{localStorage["away"] = 0;}
    	if(document.getElementById("music").checked == true) {localStorage["music"] = 1;}
    else{localStorage["music"] = 0;}
    	if(document.getElementById("smiles").checked == true) {localStorage["smiles"] = 1;}
    else{localStorage["smiles"] = 0;}
    	if(document.getElementById("chat").checked == true) {localStorage["chat"] = 1;}
    else{localStorage["chat"] = 0;}
    	if(document.getElementById("wide").checked == true) {localStorage["wide"] = 1;}
    else{localStorage["wide"] = 0;}
    	if(document.getElementById("oblivionbook").checked == true) {localStorage["oblivionbook"] = 1;}
    else{localStorage["oblivionbook"] = 0;}
    	if(document.getElementById("darkblue").checked == true) {localStorage["darkblue"] = 1;}
    else{localStorage["darkblue"] = 0;}
    	if(document.getElementById("mailcollor").checked == true) {localStorage["mailcollor"] = 1;}
    else{localStorage["mailcollor"] = 0;}
    	if(document.getElementById("savetext").checked == true) {localStorage["savetext"] = 1;}
    else{localStorage["savetext"] = 0;}
    	if(document.getElementById("groupsalign").checked == true) {localStorage["groupsalign"] = 1;}
    else{localStorage["groupsalign"] = 0;}
    	if(document.getElementById("vkcom").checked == true) {localStorage["vkcom"] = 1;}
    else{localStorage["vkcom"] = 0;}
    	if(document.getElementById("messege").checked == true) {localStorage["messege"] = 1;}
    else{localStorage["messege"] = 0;}
    	if(document.getElementById("ads").checked == true) {localStorage["ads"] = 1;}
    else{localStorage["ads"] = 0;}
    	if(document.getElementById("lmessege").checked == true) {localStorage["lmessege"] = 1;}
    else{localStorage["lmessege"] = 0;}
    	if(document.getElementById("video").checked == true) {localStorage["video"] = 1;}
    else{localStorage["video"] = 0;}
    	if(document.getElementById("stylewow").checked == true) {localStorage["stylewow"] = 1;}
    else{localStorage["stylewow"] = 0;}
    	if(document.getElementById("rayman").checked == true) {localStorage["rayman"] = 1;}
    else{localStorage["rayman"] = 0;}
    	if(document.getElementById("styletf2").checked == true) {localStorage["styletf2"] = 1;}
    else{localStorage["styletf2"] = 0;}
    	if(document.getElementById("stylestandard").checked == true) {localStorage["stylestandard"] = 1;}
    else{localStorage["stylestandard"] = 0;}
    	if(document.getElementById("stylewinter").checked == true) {localStorage["stylewinter"] = 1;}
    else{localStorage["stylewinter"] = 0;}
    	if(document.getElementById("stylewide").checked == true) {localStorage["stylewide"] = 1;}
    else{localStorage["stylewide"] = 0;}
    	if(document.getElementById("styledarkforest").checked == true) {localStorage["styledarkforest"] = 1;}
    else{localStorage["styledarkforest"] = 0;}
    	if(document.getElementById("stylegray").checked == true) {localStorage["stylegray"] = 1;}
    else{localStorage["stylegray"] = 0;}
    	if(document.getElementById("styledarkkde").checked == true) {localStorage["styledarkkde"] = 1;}
    else{localStorage["styledarkkde"] = 0;}
    	if(document.getElementById("friendsonline").checked == true) {localStorage["friendsonline"] = 1;}
    else {localStorage["friendsonline"] = 0;}
    	if(document.getElementById("removeheader").checked == true) {localStorage["removeheader"] = 1;}
    else {localStorage["removeheader"] = 0;}
    }

    Сохранение настроек в одном расширении для Google Chrome. Восстановление такого же плана...

    Proxeter, 01 Сентября 2010

    Комментарии (9)
  6. 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)
  7. 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)
  8. 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)
  9. Си / Говнокод #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)
  10. 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)
  11. 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)