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

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

    +147

    1. 1
    2. 2
    3. 3
    function gId(nid) {
        return document.getElementById(nid);
    }

    Функция года. все понятно и ясно

    KlonD90, 07 Ноября 2011

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

    +131

    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
    #include <stdio.h>
    #include <conio.h>
    #include <locale>
    #include <math.h>
    int main(void)
    {
    	setlocale (LC_ALL, "Russian");
    	char c;
    	printf ("Пожалуйста\, введите символ ");
    	scanf ("%c", &c);
    	
    	switch (c)
    	{
    	case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': printf ("Это цифра"); break;
    	default: printf ("Вы ввели не цифру\!\!\!");
    	}
    	getch ();
    	float x, y1, y2;
    	printf ("\n\n Пожалуйста введите значение \"X\" ");
    	scanf ("%f", &x);
    
    	if ((x<=5)&&(x>3))
    	{
    		y1=log(2*x)+3*x;
    		y2=sqrt(x)+0.75*x;
    		printf ("\n\n При \"X\" = %g\, z(x) имеет два значения: %f и %f", x, y1, y2);
    	}
    	else
    	{
    		{
    		if (x>3)
    		{
    			y1=sqrt(x)+0.75*x;
    			printf ("\n\n При \"X\" = %g\, z(x) = %f", x, y1);
    		}
    		if ((x<=5)&&(x>0))
    		{
    			y1=log(2*x)+3*x;
    			printf ("\n\n При \"X\" = %g\, z(x) = %f", x, y1);
    		}
    		}
    		if (x<=0)
    
    		printf ("\n\n Внимание, введенное значение \"x\" не удолетворяет ОДЗ");
    	}
    		getch ();
    		int pzdc;
    		printf ("\n\n Пожалуйста введите порядковый номер месяца ");
    		scanf ("%d", &pzdc);
    		
    		switch (pzdc)
    		{
    		case 1:
    			printf ("\n 31");
    			break;
    		case 2:
    			printf ("\n 28");
    			break;
    		case 3:
    			printf ("\n 31");
    			break;
    		case 4:
    			printf ("\n 30");
    			break;
    		case 5:
    			printf ("\n 31");
    			break;
    		case 6:
    			printf ("\n 30");
    			break;
    		case 7:
    			printf ("\n 31");
    			break;
    		case 8:
    			printf ("\n 31");
    			break;
    		case 9:
    			printf ("\n 30");
    			break;
    		case 10:
    			printf ("\n 31");
    			break;
    		case 11:
    			printf ("\n 30");
    			break;
    		case 12:
    			printf ("\n 31");
    			break;
    		default:
    			printf ("ОШИБКА!!!"); break;
    		}
    getch ();
    return (0);
    }

    лаба. знаю что тут не любят, но все же

    KirAmp, 26 Октября 2011

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

    +162

    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 unzip($location,$newLocation){ 
        if(exec("unzip $location",$arr)) { 
            mkdir($newLocation); 
            for($i = 1;$i< count($arr);$i++) { 
                $file = trim(preg_replace("~inflating: ~","",$arr[$i])); 
                copy($location.'/'.$file,$newLocation.'/'.$file); 
                unlink($location.'/'.$file); 
            } 
            return TRUE; 
        } else { 
            return FALSE; 
        } 
    }

    оттуда же, http://habrahabr.ru/blogs/php/130196/

    тоже непонятно, нафига такие сложности потеха, когда есть стандартное расширение

    http://www.php.net/manual/en/function.ziparchive-extractto.php

    Lure Of Chaos, 11 Октября 2011

    Комментарии (22)
  5. Java / Говнокод #8150

    +81

    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
    if(strlength==1){str1}
    if(strlength==2{str1,str2}
    
    
    if(str2.isEmpty()){String str2=str.replaceAll(r1, r1_);
    
    String str6=str5.replaceAll(r5, r5_);
    	String str7=str6.replaceAll(r6, r6_);
    	String str8=str7.replaceAll(r7, r7_);
    	String str9=str8.replaceAll(r8, r8_);
    	String str10=str9.replaceAll(r9, r9_);
    	String str11=str10.replaceAll(r10, r10_);
    	String str12=str11.replaceAll(r11, r11_);
    	String str13=str12.replaceAll(r12, r12_);
    	String str15=str13.replaceAll(r14, r14_);
    	String str16=str15.replaceAll(r15, r15_);
    	String str17=str16.replaceAll(r16, r16_);
    	String str18=str17.replaceAll(r17, r17_);
    	String str19=str18.replaceAll(r18, r18_);
    	String str20=str19.replaceAll(r19, r19_);
    	String str21=str20.replaceAll(r20, r20_);
    	String str22=str21.replaceAll(r21, r21_);
    	String str23=str22.replaceAll(r22, r22_);
    	String str24=str23.replaceAll(r23, r23_);
    	String str25=str24.replaceAll(r24, r24_);
    	String str26=str25.replaceAll(r25, r25_);
    	String str27=str26.replaceAll(r26, r26_);
    	String str28=str27.replaceAll(r27, r27_);
    	String str29=str28.replaceAll(r28, r28_);
    	String str30=str29.replaceAll(r29, r29_);
    	String str31=str30.replaceAll(r30, r30_);
    	String str32=str31.replaceAll(r31, r31_);
    	String str33=str32.replaceAll(r32, r32_);
    	String str34=str33.replaceAll(r33, r33_);
    	String str35=str34.replaceAll(r34, r34_);
    	String str36=str35.replaceAll(r35, r35_);
    	String str37=str36.replaceAll(r36, r36_);
    	String str38=str37.replaceAll(r37, r37_);
    	String str39=str38.replaceAll(r38, r38_);
    	String str40=str39;
    	String str41=str40.replaceAll(r40, r40_);
    	String str42=str41;
    	String str43=str42.replaceAll(r42, r42_);
    	String str44=str43;
    	String str45=str44.replaceAll(r44, r44_);
    	String str46=str45.replaceAll(r45, r45_);
    	String str47=str46;
    	String str48=str47.replaceAll(r47, r47_);
    	String str49=str48.replaceAll(r48, r48_);
    	String str50=str49.replaceAll(r49, r49_);

    FanAs45809, 10 Октября 2011

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

    +141

    1. 1
    http://www.google.com/insights/search/#q=c%2B%2B&date=today%203-m&cmpt=q

    OH SHI~

    Uhehesh, 09 Октября 2011

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

    +75

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    /**
     * NOTE: This source is automatically generated please do not modify this file.  
     * Either subclass or remove the record in src/generated
     */
    public int getSize()
    {
            return 4 +  + 1 + 1 + 2 + 1 + 1 + 1 + 1 + 2 + 2 + 2 + 2 + 2 + 2 + 4 + 4 + 4 + 2 + 4 + 4 + 4 + 2 + 4 + 2 + 2 + 4 + 4 + 4 + 2 + 4 + 4 + 4 + 2 + 4 + 2 + 310 + 10 + 2 + 2 + 12 + 4 + 4 + 4 + 4 + 30 + 4 + 4 + 4 + 4 + 4 + 2 + 2 + 2 + 2;
    }

    xaoc, 05 Октября 2011

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

    −154

    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
    Лично я 1С не люблю. И вообще лучше не говорить об этом, настроение портится...
    Цикл ВЦикле Открывающая_Скобка От Ноль до Двадцать_Один Закрывающая_Скобка
    Начало_цикла
    Печать Кавычка Один С - Обратный_Слеш Кавычка Говно Обратный_Слеш Кавычка Кавычка Точка_С_Запятой
    Конец_цикла
    
    Конечно это фантазия, но представьте что случилос бы, если бы 1С писали люди, \
     которые не смогли осилить не только английский язык, но и цифры и знаки пунктуации.
    К тому же бухгалтерия предлагает отвратительнейшие задачи, которые предлагается решать на отвратительнейшем языке.
    Бюрократический ад пишется на бюрократическом языке. Зачем английский язык, если есть русский?
    Помоему это какая-то особая программа по порабощению русского народа. Русские дети хотели стать космонавтами,\
     а их осадили прямо в кресло с мерцающим монитором и программой такой бюрократически-желтой иконкой.
    Боже упаси вас от продукции этой компании!

    alexoy, 01 Октября 2011

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

    +142

    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
    double[] КосинусФПриВходе = {1,0.99939,0.997564,0.994521,0.990268,0.9848,0.97814,0.97029,0.961261,0.9510565,0.93969,0.927183,0.913545,0.898794,0.88294,
                                         0.866025,0.848048,0.8290375,0.809016,0.78801,0.76604,0.74314,0.71933,0.69465,0.66913,0.64278,0.61566,0.58778,0.55919,0.5,
                                         0.46947,0.43837,0.40673,0.3746,0.34202,0.309016,0.27563,0.24192,0.20791,0.17364,0.13917,0.104528,0.06975,0.034899,0,-0.03489,
                                         -0.06975,-0.104528,-0.13917,-0.17364,-0.20791,-0.24192,-0.27563,-0.309016,-0.34202,-0.3746,-0.40673,-0.43837,-0.46947,-0.5,
                                         -0.55919,-0.58778,-0.61566,-0.64278,-0.66913,-0.69465,-0.71933,-0.74314,-0.76604,-0.78801,-0.809016,-0.8290375,-0.848048,
                                         -0.866025,-0.88294,-0.898794,-0.913545,-0.927183,-0.93969,-0.9510565,-0.961261,-0.97029,-0.97814,-0.9848,-0.990268,-0.994521,
                                         -0.997564,-0.99939,-1,-0.99939,-0.997564,-0.994521,-0.990268,-0.9848,-0.97814,-0.97029,-0.961261,-0.9510565,-0.93969,-0.927183,
                                         -0.913545,-0.898794,-0.88294,-0.866025,-0.848048,-0.8290375,-0.809016,-0.78801,-0.76604,-0.74314,-0.71933,-0.69465,-0.66913,
                                         -0.64278,-0.61566,-0.58778,-0.55919,-0.5,-0.46947,-0.43837,-0.40673,-0.3746,-0.34202,-0.309016,-0.27563,-0.24192,-0.20791,
                                         -0.17364,-0.13917,-0.104528,-0.06975,-0.034899,0,0.03489,0.06975,0.104528,0.13917,0.17364,0.20791,0.24192,0.27563,0.309016,
                                         0.34202,0.3746,0.40673,0.43837,0.46947,0.5,0.55919,0.58778,0.61566,0.64278,0.66913,0.69465,0.71933,0.74314,0.76604,0.78801,
                                         0.809016,0.8290375,0.848048,0.866025,0.88294,0.898794,0.913545,0.927183,0.93969,0.9510565,0.961261,0.97029,0.97814,0.9848,
                                         0.990268,0.994521,0.997564,0.99939};
      
            private void XbYb()
            {
                double x;
                x = AB * КосФ;
                Xb = (int)x;
                double f=4*Ya*Ya-4*(Xa*Xa+Ya*Ya+Xb*Xb-2*Xa*Xb-AB*AB);
                if (счетчик >= 0 && счетчик <= 89) Yb = (2 * Ya + (int)Math.Sqrt(f)) / 2;
                else Yb = (2 * Ya - (int)Math.Sqrt(f)) / 2;
            }
            
            private void timer1_Tick(object sender, EventArgs e)
            {
                if (счетчик == КосинусФПриВходе.Length) счетчик = 0;
                КосФ=КосинусФПриВходе[счетчик];
                XbYb();
                pictureBox1.Invalidate();
                счетчик++;
            }

    1C головного мозга

    psina-from-ua, 30 Сентября 2011

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

    +160

    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
    <div class="pmi_cont pr" style="width:60px;float: left; min-height: 20px;z-index: 5;"><?php $k = 0;?>
                <?php if ($uno_el['pr1']): ?>
                    <div class="price_1"
                         style="height:25px;"><?php echo $uno_el['pr1']; $k = 1; echo is_numeric($uno_el['pr1']) ? ' руб.'
                            : ''; ?></div><?php endif;?>
                <?php if ($uno_el['pr2']): ?>
                    <div class="price_2"
                         style="height:25px;"><?php echo $uno_el['pr2']; $k = 1; echo is_numeric($uno_el['pr2']) ? ' руб.'
                            : ''; ?></div><?php endif;?>
                <?php if ($uno_el['pr3']): ?>
                    <div class="price_3"
                         style="height:25px;"><?php echo $uno_el['pr3']; $k = 1; echo is_numeric($uno_el['pr3']) ? ' руб.'
                            : ''; ?></div><?php endif;?>
                <?php if ($uno_el['pr4']): ?>
                    <div class="price_4"
                         style="height:25px;"><?php echo $uno_el['pr4']; $k = 1; echo is_numeric($uno_el['pr4']) ? ' руб.'
                            : ''; ?></div><?php endif;?>
                <?php if ($uno_el['pr5']): ?>
                    <div class="price_5"
                         style="height:25px;"><?php echo $uno_el['pr5']; $k = 1; echo is_numeric($uno_el['pr5']) ? ' руб.'
                            : ''; ?></div><?php endif;?>
                <?php if ($k): ?>
                    <?php if ($uno_el['link']): ?>
                        <div style="margin-left: -60px; width: 200px;"><?php echo $uno_el['link'];?></div><?php endif; ?>
                    <?php else: ?>
                    <?php if ($uno_el['link']): ?>
                        <div style="position:relative;left: -80px; width: 140px;"><?php echo $uno_el['link'];?></div><?php endif; ?>
                    <?php endif;?>
            </div>

    Эта хуита выводит цену. И так все шаблоны. Разработчик - мудак.

    amazondev, 29 Сентября 2011

    Комментарии (22)
  11. PHP / Говнокод #7997

    +161

    1. 1
    2. 2
    3. 3
    4. 4
    public function &entityFactory() {
        $entityObject = new stdClass();
        return $entityObject;
    }

    shmaltorhbooks, 27 Сентября 2011

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