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

    В номинации:
    За время:
  2. Куча / Говнокод #7221

    +146

    1. 1
    http://picomot.ru/

    Наговнокодили тут новый проект

    striker, 11 Июля 2011

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

    +170

    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
    function load_class($module, $class) {
      $class_inc = strtoupper($class) . "_INC";
      $file_inc = $class  . ".inc";
    
      if (!file_exists(MODROOT.$module."/lib/".$class.".inc")) {
         echo "ERROR Loading Class: $class<BR>";
         echo "      Loading Module: $module<BR>";
    //     echo MODROOT.$module."/lib/".$class.".inc";
         exit;
      }
      else {
      $load_class = "if (!defined(\"".$class_inc."\")) {";
      $load_class .= "include(\"".MODROOT.$module."/lib/". $file_inc ."\");";
      $load_class .= "define(\"".$class_inc."\",\"1\");";
      $load_class .= "}";
       }
      return $load_class;
    }
    
    // вызов
    eval(load_class("module", "className"));

    Fffuf

    sl1p, 08 Июля 2011

    Комментарии (12)
  4. Ruby / Говнокод #7199

    −98

    1. 1
    amount = ('-' + batch['settleAmount'].to_s).to_i

    работа с платежными системами требует вдумчивости и оригинальности.

    malleus, 07 Июля 2011

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

    +962

    1. 1
    2. 2
    3. 3
    bool isVisible = Convert.ToBoolean(Convert.ToBoolean(paramsArr[3]));
    
    чтоб наверняка :)

    wader, 07 Июля 2011

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

    +163

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    WCHAR *qStringToWideChar(const QString &str) {
        if (str.isNull())
            return 0;
        WCHAR *result = new WCHAR[str.length() + 1];
        for (unsigned int i = 0; i < str.length(); ++i)
            result[i] = str[i].unicode();
        result[str.length()] = 0;
        return result;
    }

    Опять неосиляторы ассистента издеваются над Qt.

    panter_dsd, 06 Июля 2011

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

    +961

    1. 1
    2. 2
    //МегаДекодер)
       _word = HttpUtility.UrlEncode(HttpUtility.UrlDecode(SearchDataHelper.RemoveSpecialCharacters(word, true)));

    drakoner, 04 Июля 2011

    Комментарии (12)
  8. PHP / Говнокод #7116

    +151

    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
    <?
    if(!defined('Hacking')) { die('Hacking attempt!'); exit;}
    
    $database_user_name="demo";
    $database_password="demo";
    $database_name="demo";
    $display_errors = false;
    $AdminEmail="[email protected]";
    $bpref="demo";
    $domenname="demo";
    function connect_db()
    {
    global $database_user_name, $database_password;
    $db=mysql_connect("localhost",$database_user_name,$database_password) or die ("Could not connect");
    mysql_query("SET NAMES cp1251") or die("Invalid query: " .mysql_error());
    return $db;
    }
    function db_name()
    {
    global $database_name;
    $db_name=$database_name;
    return $db_name;
    }
    function get_now()
    {
    $db=connect_db();
    $db_name=db_name();
    mysql_select_db($db_name,$db);
    $sql="select now() as now";
    $result=mysql_query($sql,$db);
    $myrow=mysql_fetch_array($result);
    $now=$myrow["now"];
    return $now;
    }
    function puterror($message)
    {
    echo("<p>$message</p>");
    exit();
    }
    foreach($_GET as $chexss) {
    if((eregi("<[^>]*script[^>]*>", $chexss)) || (eregi("<[^>]*object[^>]*>", $chexss)) ||
    (eregi("<[^>]*iframe[^>]*>", $chexss)) || (eregi("<[^>]*applet[^>]*>", $chexss)) ||
    (eregi("<[^>]*meta[^>]*>", $chexss)) || (eregi("<[^>]*style[^>]*>", $chexss)) ||
    (eregi("<[^>]*form[^>]*>", $chexss)) || (eregi("\([^>][^)]*\)", $chexss)) ||
    (eregi("<[^>]*frameset[^>]*>", $chexss)) || (eregi("<[^>]*onmouseover[^>]*>", $chexss)) ||
    (eregi("<[^>]*img[^>]*>", $chexss)) || (eregi("\"", $chexss)) || (eregi("'", $chexss))){
    die("Попытка ХАКА !");
    }
    } 
    $zzzz = html_entity_decode(urldecode($_SERVER['QUERY_STRING']));
    if ($zzzz) {
    if ((strpos($zzzz, '<') !== false) ||
    (strpos($zzzz, '>') !== false) ||
    (strpos($zzzz, '"') !== false) ||
    (strpos($zzzz, './') !== false) ||
    (strpos($zzzz, '../') !== false) ||
    (strpos($zzzz, '\'') !== false) ||
    (strpos($zzzz, '.pl') !== false) ||
    (strpos($zzzz, '.php') !== false)) 
    {
    die("Попытка ХАКА !");
    }
    }
    $zamena_b = array( "\x27", "\x22", "\x60", "\t",'\n','\r', '\\', "'","¬","#",";","~","[","]","{","}","=","-","+",")","(","*","&","^","%","$","<",">","?","!",".pl", ".php",'"' );
    $_GET = str_replace($zamena_b, '', $_GET);
    $_POST = str_replace($zamena_b, '', $_POST);
    $_SESSION = str_replace($zamena_b, '', $_SESSION);
    $_COOKIE = str_replace($zamena_b, '', $_COOKIE);
    $_ENV = str_replace($zamena_b, '', $_ENV);
    $_FILES = str_replace($zamena_b, '', $_FILES);
    $_REQUEST = str_replace($zamena_b, '', $_REQUEST);
    $_SERVER = str_replace($zamena_b, '', $_SERVER);
    ?>

    Просторы интернета богаты... Так вот люди работают с СУБД

    nethak, 30 Июня 2011

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

    +139

    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
    bool aiccu_os_install(void)
    {
        /* Check if IPv6 support is available */
        if (access("/proc/net/if_inet6", F_OK))
        {
            /* Doing the modprobe doesn't guarantee success unfortunately */
            (void)system("modprobe -q ipv6 2>/dev/null >/dev/null");
    
            /* Thus test it again */
            if (access("/proc/net/if_inet6", F_OK))
            {
                dolog(LOG_ERR, "No IPv6 Stack found! Please check your kernel and module configuration\n");
                return false;
            }
        }
    
        /* Try to load modules (SIT tunnel, TUN/TAP)
         * They can be kernel builtins and there is no easy
         * way to check if they are loaded/built except for
         * trying to use them and fail at that point
         */
        (void)system("modprobe -q sit 2>/dev/null >/dev/null");
        (void)system("modprobe -q tun 2>/dev/null >/dev/null");
    
        return true;
    }

    raorn, 27 Июня 2011

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

    +154

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    function getDateFromTime($dataTime){
      $strDate = date('d-m-Y', $dataTime);
      $arrDate = explode('-', $strDate);
    
      return mktime(0, 0, 0, $arrDate[1], $arrDate[0], $arrDate[2]);
    }

    руки-жопа-голова%)

    warider, 23 Июня 2011

    Комментарии (12)
  11. C++ / Говнокод #7013

    +159

    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
    #include <math.h>
    #include <iostream>
    using namespace std;
    void main()
    { int month,day;
            cin>>month,day;
            int den=1;
            switch(month)
    {       case 1: cout<<"month: "<<month<<endl<<"day: "<<day+1;
    if(day==31){cout<<"month: "<<month+1<<endl<<den;}
    break;
            case 2: cout<<"month: "<<month<<endl<<"day: "<<day+1;
            if(day==28){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 3:cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==31){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 4:cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==30){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 5: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==31){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 6: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==30){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 7: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==31){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 8: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==31){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 9: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==30){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 10: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==31){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 11: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==30){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
    break;
            case 12: cout<<"month: "<<month<<endl<<"day: "<<day+1;
                    if(day==31){cout<<"month: "<<month+1<<endl<<"day: "<<den;}
                    
                                    
    }       
     
    cin.get();
            cin.get();
    }

    Juris_Kabanis, 20 Июня 2011

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