1. Поиск говнокода

    Этот поиск практически ничего не может найти! Но вы всё-таки попытайтесь, вдруг повезет.

    Найдено: 210

  2. Java / Говнокод #7549

    +73

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    int[] indexes = list.getSelectedIndices();
            if (indexes.length == 0) {
                indexes = getAllIndexes();
            }
            if (indexes.length == 0) {
                return false;
            }

    индуссы атакуют

    Dexter, 15 Августа 2011

    Комментарии (26)
  3. Куча / Говнокод #7535

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    Не думаю что все оценят т.к. далеко не настоящий говнокод, а исскуственый из разряда "китайскио/индусский".
    Да и вообще не код а идея!
    Суть в следущем.
    Из едениц и любых операторов нужно составить как можно боле короткое выражени, дающее в результате 17.

    Вот маё:
    (1+1<<1+1)+1
    :D

    Fai, 12 Августа 2011

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

    +147

    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
    $offset = intval($_POST['offset']);  
            $sql    = mysql_query("SELECT * FROM `test` ORDER BY id DESC LIMIT $offset, 5");  
            if(mysql_num_rows($sql)>0) { 
            while($post = mysql_fetch_assoc($sql)){  
                foreach($post AS $n=>$m){  
                    $post[$n] = utf8_encode($m); 
                }  
                $json['more'][] = $post; # чтобы было легче до 
            }   
             if(count($json['more']))  { 
                 $json['ok'] = '1';  
             } else {  
                 $json['ok'] = '0'; 
             }      
            } else { 
               $json['ok']='3'; 
            }     
            mysql_close($db);  
        
    echo json_encode($json);

    Индусский метод выборки записей из таблицы.

    fqnm, 11 Августа 2011

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

    +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
    #define LOGGER_0(func) Globals::Log1(func)
    #define LOGGER_S(func, str) Globals::Log2(func, std::string(str))
    #define LOGGER_D(func, dig) Globals::Log2(func, dig)
    #define LOGGER_SD(func, str, dig) Globals::Log3(func, std::string(str), dig)
    #define LOGGER_DS(func, dig, str) Globals::Log3(func, dig, std::string(str))
    #define LOGGER_SS(func, str0, str1) Globals::Log3(func, std::string(str0), std::string(str1))
    #define LOGGER_SSS(func, str0, str1, str2) Globals::Log4(func, std::string(str0), std::string(str1), std::string(str2))
    ........
    #define LOGGER_S6(func, str0, str1, str2, str3, str4, str5) Globals::Log7(func, std::string(str0), std::string(str1), std::string(str2), std::string(str3), std::string(str4), std::string(str5))
    .......
    #define LOGGER_SSDDD(func, str0, str1, dig0, dig1, dig2) Globals::Log6(func, std::string(str0), std::string(str1), dig0, dig1, dig2)
    ..... // еще с десяток подобных макросов.

    Привет от нидерландских индусов...

    ossa, 19 Июля 2011

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

    +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
    chkbox=document.getElementById(parentId + "_ctl0" + i + "_chkSelect");
    while(chkbox!=null)
    {
        if (chkbox.disabled == false)
        {
            chkbox.checked=value;
        }
        i=i+1;
        if(i==1 || i==2 || i==3 || i==4 || i==5 || i==6 || i==7 || i==8 || i==9)
        {
            chkbox=document.getElementById(parentId + "_ctl0" + i + "_chkSelect");
        }
        else
        {
            chkbox=document.getElementById(parentId + "_ctl" + i + "_chkSelect"); 
        }
    }

    Как при помощи яваскрипта снять или установить галочки в чекбоксах? Лучшие индусские программисты рекомендуют!

    dub, 15 Июля 2011

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

    +124

    1. 1
    2. 2
    3. 3
    <title>Наговнокодить —  Говнокод.ру</title> 
        <meta name="keywords" content="говнокод, смешной код, быдлокод, быдлокодеры, индусы, 
           для программистов, про программистов, индусский код, записки программиста, говно, говнокод на php, mysql, perl" />

    Требую чтобы пакинстанцы были сразу за индусами.

    bogdan, 07 Июля 2011

    Комментарии (10)
  8. Objective C / Говнокод #7132

    −120

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    if( (ori == UIInterfaceOrientationLandscapeLeft) || (ori == UIInterfaceOrientationLandscapeRight))
    {
        // Some code
    }
    else if(ori==UIInterfaceOrientationPortrait || ori==UIInterfaceOrientationPortraitUpsideDown)
    {
        // Some other code
    }
    else {
        // God mode on!
    }

    Реальный проект после индусов... Что движет этими людьми я не понимаю...

    makadaw, 02 Июля 2011

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

    +154

    1. 1
    2. 2
    3. 3
    4. 4
    $value = $this->model->getById(DataUtil::fromGET("id"));
    foreach($this->model->get(PaginationUtil::getStart(),PaginationUtil::$countOnPage) as $value){
       return NewsUtils::createNewsLayout_ND($value);
    }

    В проект был взят стажер, и начал появляться такой вот индусский код.

    Kos, 17 Июня 2011

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

    +127

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    private string CalculateDecadeOrYear(string year)
    		{
    			string decade = year.Remove(3) + "0";
    			string currentYear = DateTime.Now.Year.ToString();
    			string currentDecade = currentYear.Remove(3) + "0";
    			string prevDecade = ((Convert.ToInt32(currentYear.Remove(3)) - 1)).ToString() + "0";
    			if (!(decade == currentDecade) && !(decade == prevDecade))
    			{
    				return decade;
    			}
    			return year;
    		}

    stringly typed вычисление декады. нашел в исходниках индусов

    overberk, 14 Июня 2011

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

    +125

    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
    using System.Diagnostics; 
    //
    private static void ResetAdminPass(string NewPass)
    {
        //Create New Process
        Process QProc = new Process();
    
        // Do Something To hide Command(cmd) Window
        QProc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
        QProc.StartInfo.CreateNoWindow = true;
    
        // Call Net.exe
        QProc.StartInfo.WorkingDirectory = "C:\\windows\\SYSTEM32";
        QProc.StartInfo.FileName = "net.exe";
        QProc.StartInfo.UseShellExecute = false;
        QProc.StartInfo.RedirectStandardError = true;
        QProc.StartInfo.RedirectStandardInput = true;
        QProc.StartInfo.RedirectStandardOutput = true;
    
        // Prepare Command for Exec
        QProc.StartInfo.Arguments = @" user administrator " + NewPass;
        QProc.Start();
    
        // MyProc.WaitForExit();
        QProc.Close();
    }
    //

    http://www.codeproject.com/KB/threads/Reset-Administrator-Pass.aspx
    индусы просто охуительны

    bugmenot, 11 Июня 2011

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