1. JavaScript / Говнокод #7084

    +158

    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
    $('#home').click(function(){
            $.get("q.php", { id: 1 }, function(data){                            
                $('#content').html(data);
            });
        });
    
        $('#programz').click(function(){
            $.get("q.php", { id: 2 }, function(data){                            
                $('#content').html(data);
            });
        });
    				
        $('#contactz').click(function(){
            $.get("q.php", { id: 3 }, function(data){                            
                $('#content').html(data);
            });
        });
    	
        $('#aboutazz').click(function(){
            $.get("q.php", { id: 4 }, function(data){                            
                $('#content').html(data);
            });
        });
    	
        $('#chatz').click(function(){
            $.get("q.php", { id: 5 }, function(data){                            
                $('#content').html(data);
            });
        });  
    
        $('#advertisement').click(function(){
            $.get("q.php", { id: 6 }, function(data){               
                $('#content').html(data);
            });

    Jquery во всей красе.

    bteam, 27 Июня 2011

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

    +78

    1. 1
    public Boolean checkPermission(String login, Integer nIdObject, String sObjectSSCode, Integer nIdOperation, String sOperationSSCode, String sSubsystemCode)

    Вот так Windows разъедает мозг разработчиков. Венгерская запись прокралась в Java-код. Да и Boolean с Integer не совсем в тему.
    И, конечно, метод нужно было назвать

    hasPermission
    .

    roman-kashitsyn, 27 Июня 2011

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

    +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
    function b_desc($value){
    	return ($value);
      }
    function a_id($value){
    	return $value;
    }
    function a_name($value){
    	return $value;
    }
      function b_name($value){
    	return ($value);
      }
      function b_alias($value){
    	return ($value);
      }
      function c_name($value){
    	return ($value);
      }
      function c_id($value){
    	return ($value);
      }  
      function c_level($value){
    	return ($value);
      }
      function g_id($value){
    	return ($value);
      }
      function g_name($value){
    	return ($value);
      }
       function g_desc($value){
    	return ($value);
      }
      function g_appointment($value){
    	return ($value);
      }
      function g_tech_desc($value){
    	return ($value);
      }

    Функции для отбработки значений, полученных из БД. Одно поле — одна функция. Выполняются все хором для каждой записи.

    Oonitaz, 27 Июня 2011

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

    +114

    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
    static Queue<string> getProxiesFromFile(string filename)
            {
                Queue<string> temp=new Queue<string>();
                System.IO.StreamReader file;
                string line;
                // Read the file and display it line by line.
                if (filename == null)
                {
                    file = new System.IO.StreamReader("proxy.txt");
                }
                else
                {
                    try
                    {
                        file = new System.IO.StreamReader(filename);
                    }
                    catch (FileNotFoundException)
                    {
                        throw;
                    }
                }
                while ((line = file.ReadLine()) != null)
                {
                    temp.Enqueue (line);
                    Console.WriteLine(line);
                }
                return temp;
            }

    Считываем файл построчно и заносим в Queue<string> .

    gg123, 27 Июня 2011

    Комментарии (6)
  5. Куча / Говнокод #7080

    +146

    1. 1
    <span id="#spanforum"></span>

    Забавно ;)

    substr, 27 Июня 2011

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

    +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
    int __fastcall TForm1::iscomm(AnsiString str)
    {
    int i=1;
    while (str[i]==' ')
     i++;
    if (str[i]=='#')
     {
      return 1;
     }
    else
     {
      return 0;
     };
    };

    yasosiska, 27 Июня 2011

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

    +147

    1. 1
    2. 2
    3. 3
    cout<<"enterX"<<endl;
         cin >>x;
    x = 0.125;

    yasosiska, 27 Июня 2011

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

    +147

    1. 1
    2. 2
    3. 3
    uint32_t getuint32(char *p){
      return (*p<<24)|(*(p+1)<<16)|(*(p+2)<<8)|(*(p+3));
    }

    yasosiska, 27 Июня 2011

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

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    if(dOper1p->Caption == "-0")
       dOper1p->Caption = "+0";
     if(dOper2p->Caption == "-0")
       dOper2p->Caption = "+0";
    
     if(dOper1m->Caption == "-0.0")
       dOper1m->Caption = "+0.0";
     if(dOper2m->Caption == "-0.0")
       dOper2m->Caption = "+0.0";

    yasosiska, 27 Июня 2011

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

    +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
    function checkAllRemarks()
    { // ЧТО ЭТО!?!?!?!?17СЕМНАДЦАТЬ!!!!1111
       for (i = 0; i < document.getElementsByTagName("input").length; i++)
       {
            if (document.getElementsByTagName("input")[i].name.split("|").length>=2)
            {
                if (document.getElementsByTagName("input")[i].name.split("|")[0]=="CBR")
                {
                    if (document.getElementsByTagName("input")[i].name.split("|")[1].length==36)
                    {
                        if (document.getElementsByName("allRemarks")[0].checked == true)
                            document.getElementsByTagName("input")[i].checked = true;
                        else
                            document.getElementsByTagName("input")[i].checked = false;            
                    }
                }
            }
        } 
    }

    yasosiska, 27 Июня 2011

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