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

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

    +96

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    public static Entity read(final URI path) {
    	if(!(path.items!= null && (0 < path.items.size()))){
    		assert (false);
    	}
                     //дальше сам метод

    3.14159265, 02 Июля 2010

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

    +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
    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
    try {
    					string url = this.Request.Url.OriginalString;
    
    					string[] surl = Server.HtmlDecode(url).Remove(0, this.Request.Url.OriginalString.IndexOf(this.Request.Url.Query)).Replace("?", "").Split('&');
    
    					foreach (string s in surl) {
    						if (s.Contains("imark=")) {
    							ID_Mark = Convert.ToInt32(s.Replace("imark=", ""));
    							break;
    						}
    					}
    					foreach (string s in surl) {
    						if (s.Contains("imodel=")) {
    							ID_Model = Convert.ToInt32(s.Replace("imodel=", ""));
    							break;
    						}
    					}
    					foreach (string s in surl) {
    						if (s.Contains("imf=")) {
    							ID_Modification = Convert.ToInt32(s.Replace("imf=", ""));
    							break;
    						}
    					}
    
    					foreach (string s in surl) {
    						if (s.Contains("ieng=")) {
    							ID_Engine = Convert.ToInt32(s.Replace("ieng=", ""));
    							break;
    						}
    					}
    					foreach (string s in surl) {
    						if (s.Contains("ikpp=")) {
    							ID_KPP = Convert.ToInt32(s.Replace("ikpp=", ""));
    							break;
    						}
    					}
    					foreach (string s in surl) {
    						if (s.Contains("iGa=")) {
    							iGa = Convert.ToInt32(s.Replace("iGa=", ""));
    							break;
    						}
    					}
    
    					using (DBAccess da = new DBAccess()) {
    						var q = da.ContentListByModelId(ID_Model);
    						repContent.DataSource = q;
    						repContent.DataBind();
    					}
    				} catch {
    					Response.Redirect(Resources.Resource.PageNotFoundURL);
    					return;
    				}

    Back, 21 Июня 2010

    Комментарии (4)
  4. Pascal / Говнокод #3474

    +103

    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
    program lab15;
     uses crt;
     const nmax=100;
     var z,i,j,k,n,m:integer;
         pr:boolean;
         stolb:boolean;
     sum:array[1..nmax] of integer;
     A:array[1..nmax,1..nmax] of integer;
    
     procedure swap(var a,b:integer);
     var c:integer;
     begin
     c:=0;
     c:=a;
     a:=b;
     b:=c;
     end;
    
     function prostoe(x:integer):boolean;
     var i:integer;
         p:boolean;
         begin
     x:=abs(x);
     p:=false;
     if x>1 then p:=true;
     for i:=2 to x-1 do
     if x mod i=0 then p:=false;
     prostoe:=p
     end;
    
    
     begin
     z:=0;
     stolb:=false;
     pr:=false;
       clrscr;
        write('n= ');
        readln(n);
        write('m= ');
        readln(m);
        for i:=1 to n do
          for j:=1 to m do
            read(A[i,j]);
        for i:=1 to n do
        sum[i]:=0;
        for i:=1 to n do
         for j:=1 to m do
           sum[i]:=sum[i]+abs(a[i,j]);
             for i:=1 to n do
              for j:=1 to m do
               if prostoe(a[i,j])=true then pr:=true;
    
             for i:=1 to m-1 do
             begin
               for j:=i+1 to m do
               begin
               z:=0;
                for k:=1 to n do
                 begin
                   if a[k,i]=a[k,j] then z:=z+1;
                   if z=n then stolb:=true;
                 end;
               end;
             end;
    
                if (pr=true) and (stolb=true) then
                begin
                   for i:=1 to n-1 do
                   for j:=i+1 to n  do
                     if sum[i]>sum[j] then begin
                     swap(sum[i],sum[j]);
                     for k:=1 to m do
                       swap(a[i,k],a[j,k]);
                     end;
                end;
    
      writeln('stolbec= ', stolb);
      writeln('prostoe= ', pr);
    
      for i:=1 to n do
      begin
      writeln;
      for j:=1 to m do
      write(a[i,j], ' ');
      end;
        readkey;
        end.

    basic, 14 Июня 2010

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

    +161

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    QString sq(int deep, QString table, QString field, bool fin = false){
         if(fin) return sq(deep, table, field)+ ";";
         if(!deep) return "select min(" + field + ") from " + table;
        return "select " + field + " from " + table + " where " + field + " in(" + sq(deep-1, table, field)  + ")";
    }

    Так изнутри клиентского кода двоичным поиском выясняется, какое у БД ограничение на количество вложенных подзапросов.

    kit, 14 Июня 2010

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

    +115

    1. 1
    <%=Convert.ToDateTime(item.CreatedOnDate).ToString("D", new System.Globalization.CultureInfo(System.Globalization.CultureInfo.CurrentCulture.ToString()))%>

    Кусок кода, который отображает некую дату

    phoenixx, 13 Июня 2010

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

    −98

    1. 1
    lDate = DateSerial(Year(Date), Month(Date), Day(Date) - Day(Date) + 1)

    Человек формирует дату - 1 число текущего месяца.
    В каком классе учат упрощать выражения вида х-х+у?

    govnobot, 11 Июня 2010

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

    +143

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    <?php
    echo "
    <b>
    Ахуеть
    </b>
    ";
    ?>

    mistmax, 10 Июня 2010

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

    +90

    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
    procedure TForm1.registration;
    var
    reg:TRegistry;
    i,lbc:integer;
    aentsys,alawarkey:boolean;
    const
    dw:DWORD =1800000;
    begin
      reg:=TRegistry.Create;
      reg.RootKey:=HKEY_CURRENT_USER;
      aentsys:= reg.KeyExists('software\Aent Sys');
    
      alawarkey:=reg.KeyExists('software\Alawar');
      //aentsys
         if aentsys = true  then
       begin
      reg.OpenKey('software\Aent Sys\pr',true);
      reg.GetKeyNames(ListBox1.Items);
      reg.CloseKey;
      lbc:=listbox1.Items.Count;
      sProgressBar1.Max:=lbc*10;
      i:=0;
      while not (i=lbc) do
      begin
       reg.RootKey:=HKEY_CURRENT_USER;
      reg.OpenKey('software\Aent Sys\pr',true);
      reg.OpenKey(ListBox1.Items.Strings[i],true);
      reg.GetKeyNames(ListBox2.Items);
      reg.OpenKey(ListBox2.Items.Strings[0],true);
      reg.WriteInteger('Program',dw);
      sProgressBar1.Position:= sProgressBar1.Position+10;
      i:=i+1;
      listbox2.Clear;
      reg.CloseKey;
      end;
      end;
      i:=0;
      listbox2.Clear;
      listbox1.clear;
      lbc:=0;
      //alawar key
       if alawarkey = true  then
       begin
      reg.OpenKey('software\Alawar\play',true);
      reg.GetKeyNames(ListBox1.Items);
      reg.CloseKey;
      lbc:=listbox1.Items.Count;
      sProgressBar1.Max:=lbc*10;
      i:=0;
      while not (i=lbc) do
      begin
       reg.RootKey:=HKEY_CURRENT_USER;
      reg.OpenKey('software\Alawar\play',true);
      reg.OpenKey(ListBox1.Items.Strings[i]+'\trial',true);
      reg.GetKeyNames(ListBox2.Items);
      reg.OpenKey(ListBox2.Items.Strings[0],true);
      reg.WriteInteger('Program',dw);
      sProgressBar1.Position:= sProgressBar1.Position+10;
      i:=i+1;
      listbox2.Clear;
      reg.CloseKey;
      end;
      end;
    
    end;

    Заново даёт триццать минут для игры от компании Alawar))) аццкое гавно

    mistmax, 10 Июня 2010

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

    +144

    1. 1
    textPane.setText(<span style="font-size: 20pt">Big</span>);

    http://www.dynamicdrive.com/forums/showthread.php?t=18899

    O_O

    я подозревал, что вас обрезают, но что бы так?

    Lure Of Chaos, 08 Июня 2010

    Комментарии (4)
  11. ActionScript / Говнокод #3417

    −93

    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
    if (!DocumentClass.getInstance().branding)
        DocumentClass.getInstance().branding = new Branding;
    if (!DocumentClass.getInstance().encryption)
        DocumentClass.getInstance().encryption = new TEAEncryption;
     if (!DocumentClass.getInstance().eventManager)
        DocumentClass.getInstance().eventManager = new EventManager;
     if (!DocumentClass.getInstance().panelManager)
        DocumentClass.getInstance().panelManager = new PanelManager;
     if (!DocumentClass.getInstance().playLogger)
        DocumentClass.getInstance().playLogger = new PlayLogger;
     if (!DocumentClass.getInstance().sharedObject)
        DocumentClass.getInstance().sharedObject = new SharedObjectManager;
     if (!DocumentClass.getInstance().soundManager)
        DocumentClass.getInstance().soundManager = new SoundManager;
     if (!GameDocumentClass.getInstance().dataManager)
        GameDocumentClass.getInstance().dataManager = new DataManager;

    Кусочек template для игростроя :)

    dimas_art, 08 Июня 2010

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