1. C++ / Говнокод #12592

    +16

    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
    char tab1[22][8]={"program","var","begin","end","int","float","bool","if","then","else","for","to","do","while","readln","writeln","as","||","!","&&","true","false"};
    char tab2[18][3]={"==","<",">","+","-","*","/","(",")",".",",",";"," ","!=","<=",">=",10};
    
    //Много кода
    
    if(!strcmp("program",st.top())&&!strcmp("program",&mas[j][0]))
    	{
    		st.pop();
    		j++;
    	}
    	else
    		if(!strcmp("var",st.top())&&!strcmp("var",&mas[j][0]))
    		{
    			st.pop();
    			j++;
    		}
    		else
    			if(!strcmp("begin",st.top())&&!strcmp("begin",&mas[j][0]))
    		{
    			st.pop();
    			j++;
    		}
    		else
    			if(!strcmp("end",st.top())&&!strcmp("end",&mas[j][0]))
    		{
    			st.pop();
    			j++;
    		}
    		else
    			if(!strcmp("int",st.top())&&!strcmp("int",&mas[j][0]))
    		{
    			st.pop();
    			j++;
    		}
    		else
    			if(!strcmp("float",st.top())&&!strcmp("float",&mas[j][0]))
    		{
    			st.pop();
    			j++;
    		}
    
    //Еще строк 200 такого

    Abbath, 14 Февраля 2013

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

    +14

    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
    int main(int argc, char* argv[])
    {
    
         SetConsoleCP(1251);// установка кодовой страницы win-cp 1251 в поток ввода
       SetConsoleOutputCP(1251); // установка кодовой страницы win-cp 1251 в поток вывода
        setlocale(LC_ALL,"Ukrainian");
    
        if(argc<2)
        {
            argv[1] = (char*)malloc(500*sizeof(char));
            //printf("Vvedit' imya vxidnogo failu: \n");
            //scanf("%s",argv[1]);
            argv[1]="1.txt";
    
        }

    Abbath, 14 Февраля 2013

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

    +81

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    public static void trustAllHttpsCertificates() {
        // Is the deprecated protocol setted?
        if (isDeprecatedSSLProtocol()) {
            __trustAllHttpsCertificates();
        } else {
            _trustAllHttpsCertificates();
        } // else
    } // trustAllHttpsCertificates

    Captain Obvious поучаствовал?
    P.S. Похоже, это писал старый программист, закалённый в борьбе с VisualBasic.

    wissenstein, 14 Февраля 2013

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

    +72

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    public class Test {
        public static final int a;
        static {
            System.out.println(Main.a);
            a = 42;
            System.out.println(Main.a);
        }
    }

    javac такой javac...

    Так видит проблему: http://ideone.com/jhPN5X
    А вот так - нет: http://ideone.com/qAMIvH

    bormand, 14 Февраля 2013

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

    +24

    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
    template <typename IdType, class Tag>
    class id {
    public:
        typedef IdType value_type;
    
        explicit id(value_type val)
            : value(val)
        {}
    
        bool operator==(id rhs)
        {
            return rhs.value == value;
        }
    
        bool operator!=(id rhs)
        {
            return rhs.value != value;
        }
    
        value_type value;
    };
    
    #define HASKELL_NEWTYPE(type_name, value_type) struct __##type_name##_tag__ {}; \
        typedef ::id<value_type, __##type_name##_tag__> type_name

    Когда newtype нет, но очень хочется.
    http://ideone.com/VRu56j
    Простите за синтетику

    roman-kashitsyn, 14 Февраля 2013

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

    +138

    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
    $sql_ex = array();
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '5')
    	$sql_ex[] = " `ex`.`num` = 5 ";
    else
    	$sql_ex[] = " `ex`.`num` != 5 ";
    
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '7')
    	$sql_ex[] = " `ex`.`num` = 7 ";
    else
    	$sql_ex[] = " `ex`.`num` != 7 ";
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '4')
    	$sql_ex[] = " `ex`.`num` = 4 ";
    else
    	$sql_ex[] = " `ex`.`num` != 4 ";
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '10')
    	$sql_ex[] = " `ex`.`num` = 10 ";
    else
    	$sql_ex[] = " `ex`.`num` != 10 ";
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '11')
    	$sql_ex[] = " `ex`.`num` = 11 ";
    else
    	$sql_ex[] = " `ex`.`num` != 11 ";
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '14')
    	$sql_ex[] = " `ex`.`num` = 14 ";
    else
    	$sql_ex[] = " `ex`.`num` != 14 ";
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '19')
    	$sql_ex[] = " `ex`.`num` = 19 ";
    else
    	$sql_ex[] = " `ex`.`num` != 19 ";
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '20')
    	$sql_ex[] = " `ex`.`num` = 20 ";
    else
    	$sql_ex[] = " `ex`.`num` != 20 ";
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '21')
    	$sql_ex[] = " `ex`.`num` = 21 ";
    else
    	$sql_ex[] = " `ex`.`num` != 21 ";
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '13')
    	$sql_ex[] = " `ex`.`num` = 13 ";
    else
    	$sql_ex[] = " `ex`.`num` != 13 ";
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '12')
    	$sql_ex[] = " `ex`.`num` = 12 ";
    else
    	$sql_ex[] = " `ex`.`num` != 12 ";
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '6')
    	$sql_ex[] = " `ex`.`num` = 6 ";
    else
    	$sql_ex[] = " `ex`.`num` != 6 ";
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '17')
    	$sql_ex[] = " `ex`.`num` = 17 ";
    else
    	$sql_ex[] = " `ex`.`num` != 17 ";
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '23')
    	$sql_ex[] = " `ex`.`num` = 23 ";
    else
    	$sql_ex[] = " `ex`.`num` != 23 ";
    if(isset($this->request->get["id"]) && $this->request->get["id"] == '16')
    	$sql_ex[] = " `ex`.`num` = 16 ";
    else
    	$sql_ex[] = " `ex`.`num` != 16 ";
    $sql_extra = '';
    if (!empty($sql_ex)) $sql_extra = ' AND '.implode(" AND ", $sql_ex);

    В начале нужно было одно условие, потом еще и еще и ...

    gvncode, 14 Февраля 2013

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

    +9

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    y=fopen(lex,"w+");
    fclose(y);
    FILE *r=fopen(result,"w+");
    fclose(r);
    FILE *k=fopen("pryklad.obj","w+");
    fclose(k);

    Abbath, 13 Февраля 2013

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

    +116

    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
    <style type="text/css">
    	header
    	{
    		display: block;
    	}
    
    	header
    	{
    		clear: both;
    		height: 160px;
    		width: 100%;
    		background: url(/images/imges.jpg) no-repeat;
    		-moz-background-size: 100%;
    		-webkit-background-size: 100%;
    		-o-background-size: 100%;
    		background-size: 100% 100%;
    		background-position: center center;
    
    	}
    	.block1
    	{
    		height: 160px;
    		width: 20%;
    	}
    	.block2
    	{
    		height: 160px;
    		width: 15%;
    	}
    	.block3
    	{
    		height: 160px;
    		width: 30%;
    	}
    	.block4
    	{
    		height: 160px;
    		width: 15%;
    	}
    	.block5
    	{
    		height: 160px;
    		width: 20%;
    	}
    	table
    	{
    		width: 100%;
    		border-collapse: collapse;
    		table-layout: fixed;
    	}
    
    </style>
    
    
    <header>
    	<table>
    		<tr>
    			<td class="block1" onClick="document.location='/' "  onmouseover ="this.style.cursor='pointer' " title= "Главная">
    			</td>
    			<td class="block2">
    			</td>
    			<td class="block3">
    			</td>
    			<td class="block4">
    			</td>
    			<td class="block5" onClick="document.location='/script/enter.php' " onmouseover ="this.style.cursor='pointer' " title= "Вход">
    			</td>
    		</tr>
    	</table>
    </header>

    Найдено на просторах интернета: обычная шапка сайта, ничего лишнего.
    Код был нечитаемым - форматировал я. CSS, касаемо использованных тегов, вся.

    superfood, 13 Февраля 2013

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

    +79

    1. 1
    2. 2
    3. 3
    public class StringToObjectMap extends HashMap<String, Object> {
    
        public StringToObjectMap(Map<? extends String, ? extends Object> map)

    Нет слов выразить мою печаль.

    nafania217518, 13 Февраля 2013

    Комментарии (41)
  10. Objective C / Говнокод #12582

    −88

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    // поднимаем и опускаем панель голосования при входящем вызове
            for (ASSlideView* slideView in self.view.subviews)
                if ([slideView isKindOfClass:[ASSlideView class]])
                    for (UIScrollView* scroll in slideView.subviews)
                        if ([scroll isKindOfClass:[UIScrollView class]])
                            for (UIView* view in scroll.subviews)
                                if ([view isKindOfClass:[UIView class]])
                                    for (KVRateView* rateView in view.subviews)
                                        if ([rateView isKindOfClass:[KVRateView class]]){
                                            [rateView setFrame:CGRectMake(rateView.frame.origin.x, [[UIScreen mainScreen] bounds].size.height - 140 - [[UIApplication sharedApplication]statusBarFrame].size.height, rateView.frame.size.width, rateView.frame.size.height)];
                                            break;
                                        }

    No comments

    mas_an, 13 Февраля 2013

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