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

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

    +102

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    public static void Attack()
    {
         while (true)
          {
                new Thread(new ThreadStart(Attack)).Start();                
          }
    }

    АтакЭ ))))

    Nigma143, 01 Августа 2010

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

    +119

    1. 1
    2. 2
    3. 3
    <?php
    $query_balans_sum=(mysql_query("SELECT SUM(sum_balans) total FROM `balans` WHERE`id_balans`='".mysql_real_escape_string('13')."' "));
    ?>

    вот и не как иначе.

    Vasiliy, 31 Июля 2010

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

    +144

    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
    script type="text/javascript" src="/js/jquery.form.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
    
      var options = {
    
      	target: '#output',
            dataType:  'json',
            type: 'POST',
            success:   processJson
    
      };
    
    
      $('#myForm1').submit(function() {
        $(this).ajaxSubmit(options);
       
        return false;
      });
    
    });
    function processJson(data) {
       
        alert(data.name);
    $('#output').html('<p>'+data.name+'</p><p>').append()
    
    }
    </script>
    <div id="output"></div>
    <form action="/pm/send/"   id="myForm1" method="post">
    Логин получателя: <input type="text" value="{{loginauthor}}" name="whom" id="ValidLogin"/><br/>
    Тема: <input type="text" name="title"><br/>
    Сообщение: <textarea rows="10" cols="20"
    name=text>
    </textarea><br/>
    <input type="submit" value="Отправить" name="but"  style="background: #EFEFEF;"/> 
    
    обработчик 
    ....
     $arr=array('name'=>$done);
                                    echo json_encode($arr);
    
    
    пост уходит, но никакой реакции ни алерта ничего, и сам скрипт не срабатывает

    dalass, 29 Июля 2010

    Комментарии (10)
  5. VisualBasic / Говнокод #3814

    −120

    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
    Dim msg, sapi
    msg=InputBox("Введите ваш текст","Говорилка")
    
    msg = Replace(msg, "\n", " ")
    
    msg = Replace(msg, "а", "a")
    msg = Replace(msg, "б", "b")
    msg = Replace(msg, "в", "v")
    msg = Replace(msg, "г", "g")
    msg = Replace(msg, "д", "d")
    msg = Replace(msg, "е", "e")
    msg = Replace(msg, "ё", "e")
    msg = Replace(msg, "ж", "zh")
    msg = Replace(msg, "з", "z")
    msg = Replace(msg, "и", "i")
    msg = Replace(msg, "й", "i")
    msg = Replace(msg, "к", "k")
    msg = Replace(msg, "л", "l")
    msg = Replace(msg, "м", "m")
    msg = Replace(msg, "н", "n")
    msg = Replace(msg, "о", "o")
    msg = Replace(msg, "п", "p")
    msg = Replace(msg, "р", "r")
    msg = Replace(msg, "с", "s")
    msg = Replace(msg, "т", "t")
    msg = Replace(msg, "у", "u")
    msg = Replace(msg, "ф", "f")
    msg = Replace(msg, "х", "kh")
    msg = Replace(msg, "ц", "ts")
    msg = Replace(msg, "ч", "ch")
    msg = Replace(msg, "ш", "sh")
    msg = Replace(msg, "щ", "shch")
    msg = Replace(msg, "ъ", "")
    msg = Replace(msg, "ы", "y")
    msg = Replace(msg, "ь", "")
    msg = Replace(msg, "э", "e")
    msg = Replace(msg, "ю", "iu")
    msg = Replace(msg, "я", "ia")
    
    msg = Replace(msg, "А", "a")
    msg = Replace(msg, "Б", "b")
    msg = Replace(msg, "В", "v")
    msg = Replace(msg, "Г", "g")
    msg = Replace(msg, "Д", "d")
    msg = Replace(msg, "Е", "e")
    msg = Replace(msg, "Ё", "e")
    msg = Replace(msg, "Ж", "zh")
    msg = Replace(msg, "З", "z")
    msg = Replace(msg, "И", "i")
    msg = Replace(msg, "Й", "i")
    msg = Replace(msg, "К", "k")
    msg = Replace(msg, "Л", "l")
    msg = Replace(msg, "М", "m")
    msg = Replace(msg, "Н", "n")
    msg = Replace(msg, "О", "o")
    msg = Replace(msg, "П", "p")
    msg = Replace(msg, "Р", "r")
    msg = Replace(msg, "С", "s")
    msg = Replace(msg, "Т", "t")
    msg = Replace(msg, "У", "u")
    msg = Replace(msg, "Ф", "f")
    msg = Replace(msg, "Х", "kh")
    msg = Replace(msg, "Ц", "ts")
    msg = Replace(msg, "Ч", "ch")
    msg = Replace(msg, "Ш", "sh")
    msg = Replace(msg, "Щ", "shch")
    msg = Replace(msg, "Ъ", "")
    msg = Replace(msg, "Ы", "y")
    msg = Replace(msg, "Ь", "")
    msg = Replace(msg, "Э", "e")
    msg = Replace(msg, "Ю", "iu")
    msg = Replace(msg, "Я", "ia")
    
    Set sapi=CreateObject("sapi.spvoice")
    sapi.Speak msg

    Автор изобрел преобразователь текста в речь, оригинал:

    Программа «Говорилка» на VBS
    Cохраняете как «123.vbs».
    Запускаете.
    Ввводите текст.
    Слышите текст в в своих колонках!

    scalar4eblo4no, 29 Июля 2010

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

    +168

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if (array_keys($value) !== array_values(array_keys($value))) {
    
    } else {
    
    }

    Встретилось в ядре по работе с БД :)

    firefred, 29 Июля 2010

    Комментарии (10)
  7. Java / Говнокод #3802

    +115

    1. 1
    s.replaceAll("(\\/\\.\\.\\/)+", "/").replaceFirst("^((\\.)+\\/)+", "");

    вот такие вот суровые паттерны
    как я это увидел - мне сразу вид двух друзей переханных трактором вспомнился

    String s="../../../a./../../files/file1.rar"; // надо убрать строки вида "../"

    3.14159265, 28 Июля 2010

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

    +133

    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
    count=15;
    a=15;
    b=2.5;
    ...
    function addlistbox()
    	i=1;
    	while i<=count do
    		INIFile.SetValue("temp.ini", "temp", i, a);
    		end
    i=1;
    while i<=count do
    ttt=INIFile.GetValue("temp.ini", "temp", i);
    INIFile.SetValue("temp.ini", "temp", i, Math.Pow(ttt, b*i));
    end
    i=1;
    while i<=count do
    	ttt=INIFile.GetValue("temp.ini", "temp", i);
    	ListBox.AddItem("stepeni", i, ttt); 
    	end
    end

    Приятель прислал.
    всю эту прелесть можно написать так:
    function addlistbox(a,b,count)
    for i=1,count do
    ListBox.AddItem("stepeni", i, Math.Pow(a, b*i));
    end
    end

    XyHb, 25 Июля 2010

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

    +120

    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
    begin
       if not directoryexists('input') then createdir('input');
       if not directoryexists('output') then createdir('output');
       if not directoryexists('temp') then createdir('temp');
       if not directoryexists('temp\temp') then createdir('temp\temp');
       if not directoryexists('temp\temp_') then createdir('temp\temp_');
       if not directoryexists('temp\temp__') then createdir('temp\temp__');
       if not directoryexists('temp\temp___') then createdir('temp\temp___');
       if not directoryexists('temp\temp____') then createdir('temp\temp____');
       if not directoryexists('temp\temp_____') then createdir('temp\temp_____');
       if not directoryexists('temp\temp______') then createdir('temp\temp______');
       if not directoryexists('temp\temp_______') then createdir('temp\temp_______');
       if not directoryexists('temp\temp________') then createdir('temp\temp________');
       if not directoryexists('temp\temp_________') then createdir('temp\temp_________');
       if not directoryexists('temp\temp__________') then createdir('temp\temp__________');
       if not directoryexists('temp\temp___________') then createdir('temp\temp___________');
       if not directoryexists('temp\temp____________') then createdir('temp\temp____________');
       if not directoryexists('temp\temp_____________') then createdir('temp\temp_____________');
       if not directoryexists('temp\temp______________') then createdir('temp\temp______________');
       if not directoryexists('temp\temp_______________') then createdir('temp\temp_______________');
       if not directoryexists('temp\temp________________') then createdir('temp\temp________________');
       print_('Вас приветствует программа для сортировки слвоарей True Sort');
       print_('Если у вас есть какие-то вопросы по её работе - нажмите Help');
       turbo:=false;
    end;

    Кинул знаковый в асю=\

    BlincAttack, 23 Июля 2010

    Комментарии (10)
  10. Си / Говнокод #3751

    +136

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    recordSize=logicalRecordLength;
    BytesToRead=cnt*recordSize;
    records=cnt;
    while ( ((pos + BytesToRead)>dataSize)&&records )
    {
        BytesToRead = --records * recordSize;
    }

    Не думал, что у нас в коде встречу нечто явно похожее на пример №2 из статьи "Индусский код" на Луркморе.
    Ну и стоит добавить, что реально logicalRecordLength всегда равен 1.

    vovochka, 21 Июля 2010

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

    +172

    1. 1
    <script type="text/javascript" src='/wps/CacheProxyServlet/colorPalette/default/browserVendor/Netscape/browserName/Navigator/browserVersion/unknown/locale/ru/forwardurl/wps/themes/html/pgu/./js.jsp'></script>

    с сайта http://portal.rosreestr.ru

    Serebro, 19 Июля 2010

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