1. Java / Говнокод #8464

    +78

    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
    public synchronized void add(Object obj){
    
    		if (!sequence.isEmpty()) {
    			if (sequence.size() == maxSize) {
    				sequence.remove(0);
    				sequence.add(obj);		
    			}
    			else 
    				sequence.add(obj);		
    		} 
    		
    		if (sequence.isEmpty()) 
    			sequence.add(obj);  
    		
    			
    		notifyAll();
    	}

    Альтернативный else.

    Connector, 09 Ноября 2011

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

    +70

    1. 1
    2. 2
    3. 3
    4. 4
    @Override protected void finalize()
    {
        Runtime.addShutdownHook();
    }

    Здесь без комментариев...

    dwinner, 09 Ноября 2011

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

    +125

    1. 1
    http://lurkmore.ru/govnokod.ru

    Неужели у нас наконец-то будет статья?

    C_Plus_Plus_Govno, 09 Ноября 2011

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

    +160

    1. 1
    2. 2
    unset($this->session->data['order_id']);
    $this->data['pap4_orderid'] = $this->session->data['order_id'];

    Не разбирался зачем сохраняется order_id, но в любом слусае - где логика?
    opencart, /catalog/controller/checkout/success.php, 13-14 строки

    antongorodezkiy, 09 Ноября 2011

    Комментарии (12)
  5. JavaScript / Говнокод #8460

    +153

    1. 1
    2. 2
    3. 3
    w = 640;
    h = 480;
    w+=2; h+=2;

    Tairesh, 09 Ноября 2011

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

    +120

    1. 1
    if (ViewData["partialViewName"].ToString() == "" ||  ViewData["partialViewName"] == null)

    кратко и лаконично

    sergfreest, 09 Ноября 2011

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

    +148

    1. 1
    http://dobrochan.ru/src/png/1009/тролфейс5.png

    i͞f̩̙͚̺̖͖͑͒̎͢ ̛̤̣͇͉̔ͅ(͟(͓̣rͪ̄͑̂̇͆ͣ͢e͙͓͍͒̀s̬̪̫̼̬̗̾̈͡ ͓̥̔ͪ=̺̭̄ͪ̂͟ ̞̥̳̤͉̂͊͗sͩͮ̏́̚eͦ̓ͯt̬̲̞̬̭̿̇̎̑́̚s̑ͬ͌͌ͨo̧̖͙ ͚̮͍̻͋ͧ̇c͓̝͈͙͉̞͒ͩ͋ͮ̚͞k̟̩͍̗̺͎̈̽͂̽̇ͦͦ͢ͅo͈̫͍ ̠̭̓ͣ̆ͩ̚p̴̻̰͇͇̀̃t̡́ͦ͊̎ͩ̊(̥̞̞̫̎̽̾̾ͫ.͈͎̤͉̲̙ ̠ͥ͒̐̃ͣ̑̀.̔.ͬͨͪ̽.̲̭̲͙̇)̧̫͙͇̜̜̩̘ͭ̈́̆̽̉ ̮̯̜͉̼̜̲ͬ͑̽̃ͭ̐=̳̥̗̰̘͚͝=̧̳̙ ̬̰̔ͨͨͧͯ-͘1̮̻̦̘͉̗͑)ͫ̒)͉̲̤̝ͣ̐ͩ̆͑

    AnimeGovno-_-, 08 Ноября 2011

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

    +147

    1. 1
    http://www.viva64.com/media/images/content/a/ReactOS_ru/image1.png

    Ḅ̩̝͓̆ͦͮ̅ͧ̏́ͅȌ̘̫ͯO̮̐̋ͪ̽̇ͯ̅L̸̜̯̩͗ ͔͕̦̗ͧͭ̕F̴̘͔̝̱̫̾ͫÄ̧̭̯͉̩̜̮͇́̍ͤS̮̦̰̺̗͈͆̄̄̓̚T̎̄͏̥̩͍̠̬͖ͅC̝̽̽̋ͅA̼̖̘̿ͧ̓͡L̝̝͚͚̬̓͌L̞͌
    ̿͊͆͏̫I̪̿ͮͦ͊ͮ̓̈͡n͖̱̾ͦ́͌tẸ͕̬̱̰̗̘̊͐̎ͨ̆̓ņͦ͐̽̄ͭ̆g̝͆G̬̝̲͙̼̞r̶͔̩̗̯̘̯͑ͤ͛͐̈a̫̥͇̠̗̪̔ͧ̾̾̎͜d̙̯̖͈̬ͤͤͭ͟i̢͇̥̰͔̙̺̿͛e̤̠͛̋ͭn̳͕̺͖ͨ̽̃ͬ͊̾t͖̰͓͎̼ͦ̓̑͂̚̚͜F̡̞̘̯̜i̪͕̪̲̝̬̫̋ͫ̔͌̒ͯ̿l̟͉̆l͔͔͙̗̖̄̒ͪ͑ͬ̍̍T̥͕̙̀r̮̜͓̽̉̎ͧ̈ͦͅȉ̢̹̲̝̤̫̳ͮ̆a̢̺̤͔̤ͬͮͪ̽̐̈̈n̫̄͝g̢͈̗̖ͦ̔̓ͯͫ͑̋l̡̟̬͚͍̐ͥ͐ͪ͗̽̏e͌ͫ̉͆ͪ̆͏(̳̺̪̯̎͑̓.̵̊̊ͪ͛̾ͩ̚.̔ͩ͝.̻̫̟̙ͣ̍͒͞)͍̻̠̯ͬ͛̄̕
    ̧̥̬̩̖̤ͯͪ̂̚{̲̻̪
    ͉ͬ͋͒̎͟ ̽͛ͤ̇͟ ͍̭̻̬̹̲̇̀̍ͫ̒͂͝.̲̬̳̦̀̄͐̔́̓.̬͓̭̊̏̅ͩ͊.͙͕̠̰͓̘
    ̸̤͉̬͓̲̠ͮ́ͯ̃͑ͥ ̲̥̝̞̝͓̂͐ ̑͋̾̿Ṣ̸͔̗̖̳̱͍̊̈͑̃W͔̳̰̫̿A͉̬͙͎͂̔̇ͫͨ̾́P͂ͯ(̂̓v̟̲̦̪̖̻̎͂́2͇̤̔,̧̺͎̞̞̈́̍v̘̟͕͚̘̞ͧ̒͊ͦ̚ͅ3̤̩̙̬̘̯̼,̣̰͕͑̂͌͆̉̍͢tͩ̏ͮ͋͌̆ͯ)̜̳̖̈́̎̏̏̎ͦ;̫̻̪̞̼̟̆͐̐ͨ̀̾̉
    ͛ ̹̮͓͎̑͆̌͂́ ̙̟̦̤.ͤ̎ͧ̀ͅ.̥̼̠̮͉̰̀.̧̥͙̻̲
    ̖̬̫̣̙̅̽̋̔ͤ̏̇}̵̬̞̻̜̮̟ͣ̄ͧͦ̊

    AnimeGovno-_-, 08 Ноября 2011

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

    +143

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    #̧̟̖ͣͫ̀͂ͪ̈͐̓d͕̠͙̱̆ͫ͐͂ͦ͋ͪ͂́̚͟e̵̷̤̙̎ͤ̂ͦ̍f̛̦̙͖̣̞̠͓̻͓ͪ̏͞į̸̨̳͖ͮͦͥ͋n͈̝͓ͨ͑͐́ē̖͇̦̥̗̝̫ͩ̇ͥ̔̄ͩ́ ͔͎̰̫̖̬̜͎̄͛̀̓̕͜͞M̱̞͇̳̰̰͓̀̑͋̃ͦE͐̐̊͂̔ͪ̉͌͠͏̘̜̩M̥̩̼̯̘͒ͬ̍̉̕͠S͍̬̪ͦ̈́̐̀̄ͧ̋̓̂̀Ẻ̗̮͎̜̣͛͂͢T̷̤̤ͭ̋̃͜͞_͚̝̖̲̗̱͚̓̏̀B̅͒͆̉̏̚҉̩̱Z͐ͣ̎ͥ̓̄̄̋҉̨̙̤E̗̩͇̘͕̮̩͈͔̓̓̔R̮͖̱̥͉͖̪̅̇̂ͅO̴̗̗̺̓ͧ̏̈́͘(͈̟̱̞ͭ̏̐p̥̭̹̯̮͐͒̈́ͫ͊̀͐͋,̢̲̼ͯͣ̒̾͢l̵̦̗̬̳͔͎̞̒̿̈̃ͮͧ̍͢ͅ)̫̦̱̜̐͑ͪͫ̎͐ͧ̏ ̘̮̟͓̭̺ͤͫͧ̊͒͒ͨ́͟mͬ̓̄̑͏̰͍͓e̸̛̯̬͙̗̠̮ͩ̽ͫ̍̓ͤ͑̽͊́ͅm̛̩̖̯͉̱ͩ͑̀̋͡͡s̴̡̤̻͍̳͙͉ͤ͆͆ͫͤ̓̏͊ͅe̢͔̖̦͐̊̎́̚t̷̏͂͏͔̗̠͞(̪̼͈̮͇̤̓͊ͫͥͮ͡(͕̠̼̠͙̣ͯ̌ͤ̈́̇̌̚͡͞ͅp̨̙̩̼͈͊̀)͕͙͖̦̔̂̌̽ͪͨ̚̚͝ͅ,̢̤͓͙͈̝͙ͯ̋̅̓̋ͩ͋ ̩̈́̅̀̚͟͝ͅ0͔̦͖̣̜̎ͭ̈ͪ͑͒ͣ͟͞,̯̰̤͖̭̼͗̆ͧ̋͗̾ͥ͞͝ ̟̞̼͈̰̍̃̈́ͧ̿͊̒̽ͤͅ(̨͚̰̄͛́͆̉ͩͧ̉́͘l̐҉̘̥̼͉͔̤͎̘͟)̩̜̹̯͕̫̈̔ͩ̀͢)̴̘̗̰͖̘͉̈̉͑̇͛̂̐̚
    ̸͙̝͍̓̏̇̎̏ͣ̃̂
    ̨͇̭̅̽͆ͥ̕ç͇̫̼͓̩͓̘ͥͨ̌̄͠h͓̣̰̜̳̔̈ạ̫̝̝̥̟͐ͣ̎͆̔̏͗̾r͕̰̮͍̹͙ͫ̉̅͋͋ ͎̩̳͓̍ͣ̉͒͒̚͞*̿ͫͨ̅͏̞̮̥̣͚̩̟͘S̨̾̊͠҉͈̫H̹̫͍ͧ͑́̌̚A̷̭̤̹̼̞͚̯̫̳ͦ̾́ͭ̂ͭͣ̚̚3̶̱̮́̎̑̅ͪͭͫͭ̚8̸̙̺͖̺̹̝̠͆̃̎͗ͬ̈́͢ͅ4̴̝̼̗̳̦̠͛͊́̽̈̔_̗̳̺ͯͭ̏͂̿̀E̜͉̲̮͆͐͐̊̊ͯͮ̅͆͜n̒͗ͪ̇ͫ̌̈ͣ͆͏̢̠̥̰̙̭͍̺d͑ͬ̈́ͬ͆ͩ͏͏̮̻(̵̠̣̳̟̀̇̎́͒̉͋̿̀̕S̪͈̙͚͎͎̗͂̅ͥ̌ͥ̎ͦ͟͡͝H͍̪̲͎̮͇̩̺̓ͣ̀͗͑̈́͢Ą̺̮̓̃ͥ3̈́̃͐ͯ͂͝͏͚͍8͋̓̍̔̑̋҉̬̝̝̥̝4̢̛̙̗̤͔̓ͦ͊ͤ_̩̼̗̝̫͓͚̯̍̈ͬ̄̉̚C̶̨̲̟̦ͣͯ̒ͪ͡Ț̡͇̼̌͗̉̽͞X̡̤͕̆ͪͮ͜*̷̼ͤ͐ ̵̨͇̭̼̽͛̽͂̑c̴̱̦͙̊͑͂ͧ̑͊̀õ̢̠̬̮̌̏ņ̟̝̠̣̰̠̟̤͂ͩ̔ͭ̽̀͟͡t̳̮̘̭͓̠̲͋͑̇ͬ́͢͝e͚̱̙ͤͣͨ͋͊͞x̱̠̎̉̒͊t̅ͩ̽̎̾͆҉̟͇͕̰̯̖̳,̓ͦͬ͑̉͒ͪ̌́҉̵̦̠͇̹̭̳ ̴̡̫̟̼̩͓͉̅͛ͪ̽c̍ͪ̑̍͂ͨ͏̵͇̱̞̩̰͈̭̺̦͢h̝̣͈͈̘̟̜͚ͭͮͮͣ͂̑̒͜aͣ̏͌҉͏͚̜r̳̩͇͌ͨ̏̉ͬ͗͛͟͢ ̛̪͉̽̔ͦͤ͛͆̎ͭ͡b͔͕̪̳͚̤͎̏̿u͕̠̣͓̺̓̇̃ͬͦ̔͝f̷̦͑ͥ͞f̢͉̪̉̈̓͒ͫ̌̀̕ȩ̠̬̺̩͔ͮ̾͑ͫ͘ṟ̵̝̫̜̯̇͐ͤ̑ͥͪ̽͊̅͜͞[̵͎͕̻̲̰͕̓̐̅͑ͭ̚͢͟]̵̱̰͙͖͎̇̾̈̓ͤͦͭͅͅ)̛̗̞̘̉͌ͤ̔̚͠ ̢̗̜̔́ͫ̊ͩ̈́͠͝{̡͖̯̦̦͔̤ͣ͆̓
    ̶̡͚̰͚̦͖̟̳͙̻̑͒̈́͢ ̫̞̗̞͇̣̫̭̘̌̊͗̾̂͑͐̀̕͢ ̸͕̞̅ͩ.̡̡͓͆͠.̧̲͙̜̼̤̙̫̌̓ͭ́͌͜͜ͅ.̶̣̬̦̫̲̻̔͒̌͘͟
    ̸̺̊ͯ̿ͫ ̶̡̣̣͈̄͊̂̓͋̊͐̇̚ͅ ̷̲̞̹̳̮̞͓̗̉̑͝ͅM̨͍̥̃̆̇͋̈́́Ē͙̯͓͕̳̖͇͔̐̚͝M̨̛͓̦̰̩̏͂̉̃͂̂̇͂Ş̶̵̘̗̮̦̘ͯ͑̈ͫͮͫͬͧE̠͋̀̅́T̢͚̖͓̰̥͉̮͙ͧͬ͑_̨̝̼̣ͭͨ͊̇B̖̙̟̲͉̱̈́͊̑̿ͧẔ̴̊͂ͭ̈͆͊̆͗̒͘͝ͅĘ̛̘ͦ̋̃͂Rͮ̈ͯ̊͐̎͛̂̚̕҉̣͈Ọ̺̇ͥ͛̄ͮͤ(̣̭̰̟̫́̓͌̀̂ͬͬ̓͜͡c̵̪̜̱̭̫̯̣ͪ̃͂̆ͦ͑͑́͞o̶̺̪̬̭̲̟̟͛͟n͓̮͈̉̓͛͛ͯ͗͝t͚̙̝̩͈̣̮͂͌͋ͭ͋̒ͮȩ̧̭͍͓̘͛̅̈͜ẋ̡̛͔͖͙̦̼̾͂̃̈́͌t͑ͤͮ̑̏̋̿̆͡͏̯̝,̢̨̘̬͈̰̺ͬ̆̓̃ͅ ̢̛͈͙̘͎̏ͭ̆͜s͚̩̓̔̏̋͡i̷̫̻͔̮͍̲̩̜͈ͤ̀͒̊͊̂͠͠z̨͈͙͚͈̫̅ͭ͆ͤ͊͒͛́͝e̱̗̰̳͍͙̜̦ͮͭ͡͞͡ǫ̴̺͇͚̬͖̰ͪ̿̽ͣ̃̄f̌ͫ͊͋̃͌͏͏̪̰̳͔̥̜̳̝͞(̧̖̖͉̰̙̬ͬͨ́̊̾͝c͍̰̣̰̑̂̃ͮ͗̒̈́̍͜o͓̦̿͌͊ͬ͊̓̀̚̚͝n̵̩̑͆̉̑̔̚͞t̛̼̮̙͚͕͕̫ͩ͊͟e̿͊ͫ͌ͫͥ̐͢҉̜̜͉͚x̸̡̖͈͋̓ͭͭ̒t̵̲̣̩̘͚̓̿̎̈́̄ͬͅ)̟̩̬̣̮̲͌̃͘͢͝)ͣ́̽̚͝҉̙͍̼͙͇̰;̧̨̜͎͓̰̦̂̓̄́
    ͆̑̈́͢҉͎̬͔̻͓̱ ̼͈͇͕̬̱̌̋͐ͦͣ̃́̚̚̕̕ ̥̞͉̳̭̬͕̦̉̕̕.̶̻̤̊͗͊ͨ͡.̷̞̱̤̖̼̫̹̈̃͒ͬ̽̌́̓.̡̘̥ͤ̀͛́ͮ̎̿ͫ
    ͍̠̝̰̲̪̆̆̓͐ͣ̀̏̀}͛̍͒́̂̉̓͏̷͚̦̣̖̤̥̹̬

    AnimeGovno-_-, 08 Ноября 2011

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

    +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
    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
    #include <stdio.h>
    #include <iostream>
    #include <cmath>
    #include <iostream>
    #include <stdio.h>
    #include <math.h>
    #include <limits.h>
    #include <values.h>
    #include <conio.h>
    #include <iostream.h>
    #include <stdlib.h>
    #include <cstdlib>
    #include <stdlib.h>
    #include <VCL.h>
    #include <iostream.h>
    #include <string.h>
    #include <dos.h>
     
    FILE *f=fopen( "C:\\input.txt" , "r");
    FILE *f2=fopen( "C:\\output.txt" , "w");
     
     
    int main() {
     void readmas(float x[10][10],char name,int n);
     void readmas2(float x[10],char name,int n);
     float A[10][10];
     float B[10];
     float x[10][100];
     int i,j, ha,hb,wa,n;
     float E;
     int k = 1;
     int m = 1;
     float s;
     
     
     printf("Vvedite kolichestvo uravnenij:\n");
     scanf("%d",&n);
     printf("\nA:\n");
     readmas(A, 'A',n);
     printf("\nB:\n");
     readmas2(B, 'B',n);
     printf("\nVvedite tochnost resheniya:\n");
     scanf("%f",&E);
     printf("\n");
     
    while (m > E) {
         m = 0;
         for (i = 1; i <= n; i++) {
            s = 0;
            for (j = 1; j <= n; j++) {
                if (i != j) {
                    s = s + A[i][j]*x[j][k];
                }
            }
            x[i][k+1] = (B[i]-s)/A[i][i];
            if (abs(x[i][k+1] - x[i][k]) > m) {
                m = abs(x[i][k+1] - x[i][k]);
            }
         }
         k = k + 1;
     }
     
     for (i = 1; i <= n; i++) {
            cout<<x[i][k];
            cout<<"\n";
     }
     
     getch();
     return 0;
    }
     
     
    void readmas(float x[10][10],char name,int n)
    {
     
    int i,j;
    for (i=1; i<=n;i++) {
        for (j=1; j<=n; j++) {
            fscanf(f, "%d", &x[i][j]);
            printf("%d ", x[i][j])     ;
            }
            printf("\n");
    }

    timka, 08 Ноября 2011

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