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

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

    +130

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    public static void setDefaultLookAndFeelDecorated(boolean defaultLookAndFeelDecorated) {
            if (defaultLookAndFeelDecorated) {
                SwingUtilities.appContextPut(defaultLookAndFeelDecoratedKey, Boolean.TRUE);
            } else {
                SwingUtilities.appContextPut(defaultLookAndFeelDecoratedKey, Boolean.FALSE);
            }
    }

    http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Core/swing/javax/swing/JFrame.java.htm

    3.14159265, 12 Октября 2011

    Комментарии (21)
  3. Си / Говнокод #8125

    +130

    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
    #include<iostream>
    #include<stdio.h>
    #include<stdlib.h>
    #include<vector>
    #include<queue>
    #include<stack>
    #include<string.h>
    #include<sstream>
     
    #define s(m) scanf("%d",&m);
    #define sf(m) scanf("%f",&m);
    #define slld(m) scanf("%lld",&m)
    #define pb(m) push_back(m);
     
    #define FOR(m) for(int i=0;i<m;i++)
    #define FORS(m) for(int j=0;j<n;j++)
    #define REP(n,m) for(int i=n;i<m;i++)
    #define REPS(n,m) for(int j=n;j<n;j++)
     
    #define sb(m) (pr[m>>5]|=(1<<(m&31)))
    #define cb(m) (pr[m>>5]&=~(1<<(m&31)))
    #define chkb(m) (pr[m>>5]&(1<<(m&31)))
     
    #define n_sb(m) (next_pr[m>>5]|=(1<<(m&31)))
    #define n_cb(m) (next_pr[m>>5]&=~(1<<(m&31)))
    #define n_chkb(m) (next_pr[m>>5]&(1<<(m&31)))
     
    #define nev(m) (m&1)
    using namespace std;
    int main()
    {
      unsigned int pr[1000];
      
      for(int i=0;i<1000;i++)
      {
        pr[i]=0xffffffff;
      }      
        
      for(int i=3;i*i<=10000;i+=2)
      {
      if(chkb(i))
      { printf("%d\n",i);
        for(int j=i*i;j<=10000;j+=i+i)
        {          
            if(chkb(j))
            {
              cb(j);
               printf("%d\n",j);
            }            
        }
       }          
      }  
      cb(0);
      cb(1);
      cb(2); 
      FOR(10)
       {
         if(chkb(i)&&(i&1)!=0)
          printf("%d\n",i)      ;
       }
      int n;
      s(n);
      if(chkb(n)==1&&((n&1)!=0))
      {
        FOR(n)
         printf("Hello World\n");     
      }
      else
      {
        FOR(n)
          printf("Hello Codesprint\n");    
      }
      return 0;    
    }

    Горжусь РоСсией

    alexoy, 08 Октября 2011

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

    +130

    1. 1
    <script type="text/javascript" src="http://c.am11.ru/code/pop/ItsMeRu.js" style="display: none; visibility: hidden; "></script>

    от старых браузеров штоле?

    jQuery, 03 Октября 2011

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

    +130

    1. 1
    Fatal error: Call to a member function getCreated() on a non-object in /home/***/tmp/templates_c/1563503196.file.export_quote_rss.tpl.php-ru.php on line 21

    Заметил только что в вывого RSS этого сайта)

    XyHb, 20 Августа 2011

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

    +130

    1. 1
    2. 2
    3. 3
    4. 4
    Ахтунг!
    что за потоп на уютненьком говнокодике?
    
    кто-то всеми виртуалами топит все говнокоды.

    извиняюсь, что топик не с кодом, но, наверное, событие масштабное.

    просьба высказаться.

    Lure Of Chaos, 29 Июля 2011

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

    +130

    1. 1
    2. 2
    3. 3
    4. 4
    private static bool? GetBoolFromObject(object o)
            {
                return string.IsNullOrEmpty(o.ToString()) ? (bool?)null : (bool)o;
            }

    и как такое можно только писать...

    testguru, 20 Июня 2011

    Комментарии (39)
  8. Си / Говнокод #6884

    +130

    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
    MACROFIRE-MACRO 5.0.0
    
    [Info]
    Name = 
    Hotkey = 
    Repeat = 1
    
    [Macro]
    ButtonsPress = Circle
    Delay = 66
    ButtonsRelease = Circle
    Delay = 83
    ButtonsPress = Circle
    Delay = 83
    ButtonsRelease = Circle
    Delay = 50
    ButtonsPress = Circle
    Delay = 66
    ButtonsRelease = Circle
    Delay = 66
    ButtonsPress = Circle
    Delay = 83
    ButtonsRelease = Circle
    Delay = 66
    ButtonsPress = Down
    Delay = 50
    ButtonsPress = Right
    Delay = 83
    ButtonsRelease = Down
    ButtonsPress = Square
    Delay = 116
    ButtonsRelease = Right
    ButtonsRelease = Square
    Delay = 266
    ButtonsPress = RTrigger
    Delay = 83
    ButtonsRelease = RTrigger
    Delay = 50
    ButtonsPress = Circle
    Delay = 66
    ButtonsRelease = Circle
    Delay = 83
    ButtonsPress = Circle
    Delay = 66
    ButtonsRelease = Circle
    Delay = 66
    ButtonsPress = Circle
    Delay = 66
    ButtonsRelease = Circle
    Delay = 49
    ButtonsPress = Circle
    Delay = 83
    ButtonsRelease = Circle
    Delay = 66
    ButtonsPress = Circle
    Delay = 50
    ButtonsRelease = Circle
    Delay = 66
    ButtonsPress = Circle
    Delay = 100
    ButtonsChange = Down
    Delay = 83
    ButtonsPress = Right
    Delay = 66
    ButtonsRelease = Down
    Delay = 100
    ButtonsPress = Triangle
    ButtonsRelease = Right
    Delay = 83
    ButtonsRelease = Triangle
    Delay = 917
    ButtonsPress = Down
    Delay = 200
    ButtonsPress = Circle
    Delay = 83
    ButtonsRelease = Circle
    Delay = 66
    ButtonsPress = Circle
    Delay = 66
    ButtonsRelease = Circle
    Delay = 83
    ButtonsPress = Circle
    Delay = 133
    ButtonsRelease = Circle
    Delay = 50
    ButtonsRelease = Down
    Delay = 83
    ButtonsPress = Left
    ButtonsPress = Up
    Delay = 166
    ButtonsChange = Left + Circle
    ButtonsRelease = Left
    Delay = 116
    ButtonsRelease = Circle

    Lambda-11 Challenge 6

    minlexx, 07 Июня 2011

    Комментарии (24)
  9. Куча / Говнокод #6726

    +130

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    /* superNEW shapka */ 
    .spTop {background-image: url(http://img1.imgsmail.ru/mail/ru/images/ru/_sp_top2.png?1);}
    // ...
    .shSns2 a:HOVER {color: #FFF;}
    /* end superNEW shapka */
    
    /* superNEW shapka menu */
    // ...
    a:HOVER.shAaa_act {color: #013572 !important;}
    // ...
    .shMenuPROBA {float: left; margin-top: 17px; width: 240px;}
    /* end superNEW shapka menu */

    Mail.ru.
    Суперновая шапка.

    7ion, 22 Мая 2011

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

    +130

    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
    #include<stdio.h>
    #include<string.h>
    
    int main()
    {
      char s[81]; //Строка
      int k,    //Номер слова в строке
           i,j;   //Параметры цикла
      
      puts("Vvedite stroky");
      gets(s);
      int m=strlen(s); //Кол-во символов в строке
      puts("Stroka:");
      puts(s);
      // начало косыля
      int n=0;
      for(i=1;i<=m;i++) if(s[i]==' '&&s[i+1]!=' ') n++;
      // конец костыля
      if(s[m]==' '){i=m; k=0;}
      else{i=m-1; k=1;}
      while(1<i){
        if(s[i]!=' '&&s[i-1]==' ') k=k+1;
        if(k==n&&s[i-1]!=' '){ 
    	m=m+1; j=m;
        while(j>i){s[j]=s[j-1]; j--;}
        s[i]='*'; i--;}
        else i=i-1;
      }
      puts("Izmenennaia stroka:");
      puts(s);
      fflush(stdin);
      return 0;
    }

    dark-al, 13 Мая 2011

    Комментарии (21)
  11. Си / Говнокод #6521

    +130

    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
    #include <stdio.h>
    #include <signal.h>
    #include <unistd.h>
    #include <sys/wait.h>
    void sighndlr_1(int signo) { //obrabot4ik dlya 1go processa
        printf("I'm child process #1. I've got SIGINT! :) So, I won't do anything...\n"); //prosto vyvod na ekran soobscheniya o polu4enii signala
    }
    
    void sighndlr_2(int signo) { //dlhya 2go
        printf("I'm child process #2. I've got SIGINT :)\n");
    }
    
    int main(int argc, char **argv) {
        pid_t pid1,pid2,pid3,pid4; //4 do4ernih processa
        static struct sigaction act1,act2,act3; //3 struktury dlya 3h processov
        act1.sa_handler = sighndlr_1; //ustanovka obrabot4ika dlya 1 struktory
        act2.sa_handler = sighndlr_2; //dlya 2i
        act3.sa_handler = SIG_IGN; //ignoriruem signal v 3 strukture
        switch(pid1 = fork()) { //sozdaem 1 do4erniy process
        case -1: //vihodim pri oshibke sozdaniya
    	printf("Error fork\n");
    	exit(1);
    	break;
        case 0:
    	printf("Child process #1 started (pid = %d)\n", getpid()); //soobshenie ob uspeshnom sozdanii i vyvod pid
    	sigaction(SIGINT,&act1,NULL); //ustanovka struktury obrabot4ika dlya SIGINT
    	for(;;) pause(); //beskone4nyi cikl
    	break;
        default:
        switch(pid2 = fork()) { //sozdaem 2 process
        case -1:
    	printf("Error fork\n");
    	exit(1);
    	break;
        case 0:
    	printf("Child process #2 started (pid = %d)\n", getpid());
    	sigaction(SIGINT,&act2,NULL); //dlya SIGINT
    	sigaction(SIGQUIT,&act3,NULL); //ignorim SIGQUIT
    	for(;;) pause();
    	break;
        default:
        switch(pid3 = fork()) { //3 process
        case -1:
    	printf("Error fork\n");
    	exit(1);
    	break;
        case 0:
    	printf("Child process #3 started (pid = %d)\n", getpid());
    	sigaction(SIGINT,&act3,NULL); //ignorim SIGINT
    	for(;;) pause();
    	break;
        default:
        switch(pid4 = fork()) { //4 process
        case -1:
    	printf("Error fork\n");
    	exit(1);
    	break;
        case 0:
    	printf("Child process #4 started (pid = %d)\n", getpid());
    	setsid(); //menyaem identifikator seansa dlya processa
    	printf("Process #4 changed sid\n");
    	for(;;) pause();
    	break;
        default:
        printf("Finishing parent process... (pid = %d)\n", getpid());
        exit(0); //zavershaetsya roditelsky process
        break;
        }        
        break;
        }
        break;
        }
        break;
        }
    }

    Лаба по курсу операционных систем. Нужно было создать 4 дочерних процесса, и для каждого процесса создать свои обработчики для сигнала SIGINT или SIGQUIT. Полученный говнокод полон повторяющихся конструкций, и слишком сильно запутан операторами switch-case.

    Boten, 30 Апреля 2011

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