1. Pascal / Говнокод #9891

    +75

    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
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    program pr8;
    uses crt;
    var
    a:array [1..32] of char;
    b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r:integer;
    a1,b1,c1,d1,e1,f1,g1,h1,i1,j1,k1,l1,m1,n1,o1,p1: integer;
    begin
    a[1]:=' ';
    a[2]:='Ў';
    a[3]:='ў';
    a[4]:='Ј';
    a[5]:='¤';
    a[6]:='Ґ';
    a[7]:='¦';
    a[8]:='§';
    a[9]:='Ё';
    a[10]:='©';
    a[11]:='Є';
    a[12]:='«';
    a[13]:='¬';
    a[14]:='­';
    a[15]:='®';
    a[16]:='Ї';
    a[17]:='а';
    a[18]:='б';
    a[19]:='в';
    a[20]:='г';
    a[21]:='д';
    a[22]:='е';
    a[23]:='ж';
    a[24]:='з';
    a[25]:='и';
    a[26]:='й';
    a[27]:='к';
    a[28]:='л';
    a[29]:='м';
    a[30]:='н';
    a[31]:='о';
    a[32]:='п';
    b:=21;
    c:=24;
    d:=6;
    e:=13;
    f:=15;
    g:=19;
    h:=18;
    i:=20;
    j:=10;
    k:=21;
    l:=10;
    m:=10;
    n:=14;
    o:=9;
    p:=10;
    q:=18;
    for r:=1 to 32 do
    begin
    a1:=b+r;
    if a1>32 then a1:=a1-32;
    b1:=c+r;
    if b1>32 then b1:=b1-32;
    c1:=d+r;
    if c1>32 then c1:=c1-32;
    d1:=e+r;
    if d1>32 then d1:=d1-32;
    e1:=f+r;
    if e1>32 then e1:=e1-32;
    f1:=g+r;
    if f1>32 then f1:=f1-32;
    g1:=h+r;
    if g1>32 then g1:=g1-32;
    h1:=i+r;
    if h1>32 then h1:=h1-32;
    i1:=j+r;
    if i1>32 then i1:=i1-32;
    j1:=k+r;
    if j1>32 then j1:=j1-32;
    k1:=l+r;
    if k1>32 then k1:=k1-32;
    l1:=n+r;
    if l1>32 then l1:=l1-32;
    m1:=m+r;
    if m1>32 then m1:=m1-32;
    n1:=o+r;
    if n1>32 then n1:=n1-32;
    o1:=p+r;
    if o1>32 then o1:=o1-32;
    p1:=q+r;
    if p1>32 then p1:=p1-32;
    writeln(a[a1],a[b1],a[c1],a[d1],a[e1],a[f1],a[g1],'  ',a[h1],a[i1],a[j1],a[k1],a[l1],a[m1],a[n1],a[o1],a[p1]);
    end;
    readln;
    CLRSCR
    end.

    Парниша пытался написать шифр Цезаря... :)

    Vendetta, 08 Апреля 2012

    Комментарии (2)
  2. JavaScript / Говнокод #9889

    +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
    n = 1;
    			sel_images[n] = new Array();
    			sel_images[n]['images'] = new Array(<?=$t ?>);
    			sel_images[n]['images_numb'] = new Array(<?=$t_del ?>);
    			sel_images[n]['maxcount'] = 2;
    			sel_images[n]['blockid'] = 'imgbl2';
    			sel_images[n]['type'] = 'one';
    			
    			sel_images[n]['tmp_names'] = 'image2[]';
    			sel_images[n]['tmp_blockid'] = 'tmp_imgbl2';
    			sel_images[n]['tmp_images'] = new Array();
    				
    			imagetmp_input(n);
    			imageselection_input(n);

    Итак, на каждый инпут файлов, пхп кодеры пишут вот такой участок кода.

    Китайский код везде и всюду.

    m1el, 07 Апреля 2012

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

    +155

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    interface SQLDriver
    {
    	...
    	public function __construct() {
    		...
    	}
    	...
    }

    Испытатель...

    nethak, 07 Апреля 2012

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

    +119

    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
    using System;
    
    namespace IPGuard
    {
    	class Program
    	{
    		public static void Main(string[] args)
    		{
    			System.Net.IPAddress IPAdress = null;
    			System.Net.NetworkInformation.Ping Ping = null;
    			for (int IP1 = 1; IP1 < 255; IP1++)
    			{
    				for (int IP2 = 0; IP2 < 255; IP2++) 
    				{
    					for (int IP3 = 0; IP3 < 255; IP3++) 
    					{
    						for (int IP4 = 0; IP4 < 255; IP4++) 
    						{
    							IPAdress = System.Net.IPAddress.Parse(Convert.ToString(IP1) + "." + Convert.ToString(IP2) + "." + Convert.ToString(IP3) + "." + Convert.ToString(IP4));
    							Ping = new System.Net.NetworkInformation.Ping();
    							if (Ping.Send(IPAdress).Status == System.Net.NetworkInformation.IPStatus.Success) 
    							{
    								Console.WriteLine(IPAdress);
    							} 
    						}
    					}
    				}
    			}
    		}
    	}
    }

    Программа для поиска всех доступных IP адрессов.

    KusokGovna, 07 Апреля 2012

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

    +153

    1. 1
    2. 2
    imagettftext ($im,9, 0, 12, 21, $black,$font, 'Mike Lowry');
    imagettftext ($im,9, 0, 10, 20, $text_color,$font, 'Mike Lowry');

    Профессиональная тень текста. Скоро в ваших экранах.

    stuffort, 07 Апреля 2012

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

    +169

    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
    #define AS_STRING2(ARG) #ARG
    #define AS_STRING(ARG) AS_STRING2(ARG)
    
    #define PORT 5473
    		const uint16_t g_config_port=PORT;
    		const std::string g_config_port_string=AS_STRING(PORT);
    #undef PORT
    
    #define PORT 5474
    		const uint16_t g_request_port=PORT;
    		const std::string g_request_port_string=AS_STRING(PORT);
    #undef PORT
    
    #define PORT 5475
    		const uint16_t g_response_port=PORT;
    		const std::string g_response_port_string=AS_STRING(PORT);
    #undef PORT
    
    #undef AS_STRING
    #undef AS_STRING2

    Чувак нереально любит препроцессор, что говорит от том, что даже Страуструпа не читал.

    gvy, 06 Апреля 2012

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

    −116

    1. 1
    var rowIndex:Boolean = Number(isNaN(parseInt(nextCharacter)));

    Проверка строки на наличие чисел.
    Пикантность ситуации еще придает что parseInt ('буква') всегда равно нулю.

    kyzi007, 06 Апреля 2012

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

    +117

    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
    private void cmd_Click(object sender, MouseEventArgs e)
        {
            for (int y = 0; y < matrixHeight; y++)
            {
                for (int x = 0; x < matrixWidth; x++)
                {
                    if (cmd[x, y].GetHashCode() == sender.GetHashCode())
                    {
                        //your code here
                    }
                }
            }
        }

    Таким волшебным способом реализован единый метод обработки кликов для двумерного массива кнопок...

    vistefan, 06 Апреля 2012

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

    +124

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    if (!string.IsNullOrEmpty(ReadTextFile("BrandsSitemap.xml")))
    
    ...
    public string ReadTextFile(string fileName)
            {
                string fullPath = Server.MapPath("~/") + fileName;
                StreamReader sr = new StreamReader(fullPath);
                return sr.ReadToEnd();
            }

    Коммерческий проект.
    Проверка файла на существование. Файлы бывают по несколько метров))

    sergfreest, 06 Апреля 2012

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

    +149

    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
    $(function(){
      // ... тут могла быть ваша реклама
      var answers_height = 0;
      $(".game-test .answers li a").each(function(){                              // Array.prototype.sort не для нас (как и underscore.js' max)
        if (answers_height < $(this).height()) answers_height = $(this).height();
      }).click(function(){                                                        // чувак не в курсе, что можно вешать онклик прямо на li
        $(this).parent().addClass("checked").siblings().removeClass("checked");   // ничего jQuery#parent() нас спасёт
        $(this).parent().find("input").click();                                   // замкнуть инпут в переменную не для нас
        alert($(this).parent().parent().find("input:checked").val());             // да и зачем, когда есть jQuery?
        return false;                                                             // Event#preventDefault() не для нас, но ничего, jQuery поймёт и так
      });
      $(".game-test .answers li a").height(answers_height);                       // ах да, совсем забыл...
    });

    давным-давно известно, что верстальщики не умеют кодить, но всё же

    P.S. JQuery говно.

    maker_up, 06 Апреля 2012

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