1. PHP / Говнокод #3056

    +144.8

    1. 1
    2. 2
    3. 3
    <?
    echo $i++ + ++$i;
    ?>

    rvn, 19 Апреля 2010

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

    +57.2

    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
    t1->addAnimation(new QPropertyAnimation(widget, "geometry"));
        t1->addAnimation(new QPropertyAnimation(p1, "pos"));
        t1->addAnimation(new QPropertyAnimation(p2, "pos"));
        t1->addAnimation(new QPropertyAnimation(p3, "pos"));
        t1->addAnimation(new QPropertyAnimation(p4, "pos"));
        t1->addAnimation(new QPropertyAnimation(p5, "pos"));
        t1->addAnimation(new QPropertyAnimation(p6, "pos"));
        t1->addAnimation(new QPropertyAnimation(p1, "rotation"));
        t1->addAnimation(new QPropertyAnimation(p2, "rotation"));
        t1->addAnimation(new QPropertyAnimation(p3, "rotation"));
        t1->addAnimation(new QPropertyAnimation(p4, "rotation"));
        t1->addAnimation(new QPropertyAnimation(p5, "rotation"));
        t1->addAnimation(new QPropertyAnimation(p6, "rotation"));
        t1->addAnimation(new QPropertyAnimation(p1, "opacity"));
        t1->addAnimation(new QPropertyAnimation(p2, "opacity"));
        t1->addAnimation(new QPropertyAnimation(p3, "opacity"));
        t1->addAnimation(new QPropertyAnimation(p4, "opacity"));
        t1->addAnimation(new QPropertyAnimation(p5, "opacity"));
        t1->addAnimation(new QPropertyAnimation(p6, "opacity"));
    
        QAbstractTransition *t2 = state2->addTransition(button, SIGNAL(clicked()), state3);
        t2->addAnimation(new QPropertyAnimation(box, "geometry"));
        t2->addAnimation(new QPropertyAnimation(widget, "geometry"));
        t2->addAnimation(new QPropertyAnimation(p1, "pos"));
        t2->addAnimation(new QPropertyAnimation(p2, "pos"));
        t2->addAnimation(new QPropertyAnimation(p3, "pos"));
        t2->addAnimation(new QPropertyAnimation(p4, "pos"));
        t2->addAnimation(new QPropertyAnimation(p5, "pos"));
        t2->addAnimation(new QPropertyAnimation(p6, "pos"));
        t2->addAnimation(new QPropertyAnimation(p1, "rotation"));
        t2->addAnimation(new QPropertyAnimation(p2, "rotation"));
        t2->addAnimation(new QPropertyAnimation(p3, "rotation"));
        t2->addAnimation(new QPropertyAnimation(p4, "rotation"));
        t2->addAnimation(new QPropertyAnimation(p5, "rotation"));
        t2->addAnimation(new QPropertyAnimation(p6, "rotation"));
        t2->addAnimation(new QPropertyAnimation(p1, "opacity"));
        t2->addAnimation(new QPropertyAnimation(p2, "opacity"));
        t2->addAnimation(new QPropertyAnimation(p3, "opacity"));
        t2->addAnimation(new QPropertyAnimation(p4, "opacity"));
        t2->addAnimation(new QPropertyAnimation(p5, "opacity"));
        t2->addAnimation(new QPropertyAnimation(p6, "opacity"));
    
        QAbstractTransition *t3 = state3->addTransition(button, SIGNAL(clicked()), state1);
        t3->addAnimation(new QPropertyAnimation(box, "geometry"));
        t3->addAnimation(new QPropertyAnimation(widget, "geometry"));
        t3->addAnimation(new QPropertyAnimation(p1, "pos"));
        t3->addAnimation(new QPropertyAnimation(p2, "pos"));
        t3->addAnimation(new QPropertyAnimation(p3, "pos"));
        t3->addAnimation(new QPropertyAnimation(p4, "pos"));
        t3->addAnimation(new QPropertyAnimation(p5, "pos"));
        t3->addAnimation(new QPropertyAnimation(p6, "pos"));
        t3->addAnimation(new QPropertyAnimation(p1, "rotation"));
        t3->addAnimation(new QPropertyAnimation(p2, "rotation"));
        t3->addAnimation(new QPropertyAnimation(p3, "rotation"));
        t3->addAnimation(new QPropertyAnimation(p4, "rotation"));
        t3->addAnimation(new QPropertyAnimation(p5, "rotation"));
        t3->addAnimation(new QPropertyAnimation(p6, "rotation"));
        t3->addAnimation(new QPropertyAnimation(p1, "opacity"));
        t3->addAnimation(new QPropertyAnimation(p2, "opacity"));
        t3->addAnimation(new QPropertyAnimation(p3, "opacity"));
        t3->addAnimation(new QPropertyAnimation(p4, "opacity"));
        t3->addAnimation(new QPropertyAnimation(p5, "opacity"));
        t3->addAnimation(new QPropertyAnimation(p6, "opacity"));

    http://qt.gitorious.org/qt/qt/blobs/4.7/examples/animation/states/main.cpp

    Пример использования Qt animation framework: образцовый быдлокод.

    Lockal, 19 Апреля 2010

    Комментарии (10)
  3. JavaScript / Говнокод #3053

    +187.2

    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
    HTTP/1.1 404 Not found
    Server: Netscape-Enterprise/4.1
    Date: Mon, 19 Apr 2010 13:05:32 GMT
    Content-type: text/html
    Connection: close
    
    <script language="JavaScript">
                                  port=0
                      while ( port==0 || port==9 || port==7 ){
                                      port=Math.floor(Math.random()*1000)
                 while (port>=100) port-=100
                                              while (port>=10) port-=10
                                                                         }
    location="http://"+"10.1.100.120:8"+port+document.location.pathname+document.location.search+document.location.hash
    </script>

    вот такой суровый редирект. может вам будет смешно но я из-за неизвестного мудака убил полтора часа.
    думаю он хотел рандомом генить порт от 1 до 1000
    а потом смотреть входит оно в диапазон 81-86,88
    оно подтупливало и он придумал "оптимизацию" ))

    дети, никогда так не вычисляйте остатки
    а если сильно хочется рандомов и всего то уж лучше так

    <script language="JavaScript">
    port=Math.floor(Math.random()*8)+1;
    if (port==7) port++;

    location="http://"+"10.1.100.120:8"+port+document.locatio n.pathname+document.location.search+docu ment.location.hash
    </script>

    3.14159265, 19 Апреля 2010

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

    +83

    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
    public Map<ComponentType,
    				Map<GameType,
    					Map<SubGameType,
    						Map<String /*currency*/, 
    							Map<Stake /*stake*/, 
    								Map<Integer /*maxplayers*/, IPair<Long /*minChips*/, List<Long /*tableCode*/>>>
    							>
    						>
    					>
    				>
    			>
    			generate(int casinoCode) {
    
    		Map<ComponentType,
    			Map<GameType,
    				Map<SubGameType,
    					Map<String /*currency*/, 
    						Map<Stake /*stake*/, 
    							Map<Integer /*maxplayers*/, IPair<Long /*minChips*/, List<Long /*tableCode*/>>>
    						>
    					>
    				>
    			>
    		> result = new HashMap<ComponentType, Map<GameType,Map<SubGameType,Map<String,Map<Stake,Map<Integer,IPair<Long /*minChips*/, List<Long /*tableCode*/>>>>>>>>();
    
    		Map<GameType,
    		Map<SubGameType,
    			Map<String /*currency*/, 
    				Map<Stake /*stake*/, 
    					Map<Integer /*maxplayers*/, IPair<Long /*minChips*/, List<Long /*tableCode*/>>>
    				>>>> componentTypeMap = new HashMap<GameType, Map<SubGameType,Map<String,Map<Stake,Map<Integer,IPair<Long /*minChips*/, List<Long /*tableCode*/>>>>>>>();
    
    ....
    
    			Map<SubGameType,
    			Map<String /*currency*/, 
    				Map<Stake /*stake*/, 
    					Map<Integer /*maxplayers*/, IPair<Long /*minChips*/, List<Long /*tableCode*/>>>>>> gameTypeMap = new HashMap<SubGameType, Map<String,Map<Stake,Map<Integer,IPair<Long /*minChips*/, List<Long /*tableCode*/>>>>>>();

    Made in Estonia

    bot225, 19 Апреля 2010

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

    −180.6

    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
    package org.casalib.util {
        
        /**
            Utilities for constructing and working with Classes.
            
            @author Aaron Clinger
            @version 02/13/10
        */
        public class ClassUtil {
            
            /**
                Dynamically constructs a Class.
                
                @param type: The Class to create.
                @param arguments: Up to ten arguments to the constructor.
                @return Returns the dynamically created instance of the Class specified by <code>type</code> parameter.
                @throws Error if you pass more arguments than this method accepts (accepts ten or less).
                @example
                    <code>
                        var bData:* = ClassUtil.construct(BitmapData, 200, 200);
                        
                        trace(bData is BitmapData, bData.width);
                    </code>
            */
            public static function construct(type:Class, ...arguments):* {
                if (arguments.length > 10)
                    throw new Error('You have passed more arguments than the "construct" method accepts (accepts ten or less).');
                
                switch (arguments.length) {
                        case 0 :
                            return new type();
                        case 1 :
                            return new type(arguments[0]);
                        case 2 :
                            return new type(arguments[0], arguments[1]);
                        case 3 :
                            return new type(arguments[0], arguments[1], arguments[2]);
                        case 4 :
                            return new type(arguments[0], arguments[1], arguments[2], arguments[3]);
                        case 5 :
                            return new type(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);
                        case 6 :
                            return new type(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
                        case 7 :
                            return new type(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]);
                        case 8 :
                            return new type(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7]);
                        case 9 :
                            return new type(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8]);
                        case 10 :
                            return new type(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9]);
                }
            }
        }
    }

    Lavir_the_Whiolet, 19 Апреля 2010

    Комментарии (50)
  6. Си / Говнокод #3050

    +150.4

    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
    sei();
    			}
    		
    		if( xp_buff_ready > 0 && pc_rec_en == 0 )
    		{
    			for( i=0; xp_buff_ready!=i; i++ )
    				rs232_transmit(xp_response[i]);
    				
    			clear_buff(1);
    			xp_buff_ready = 0;
    			xp_rec_en = 0;
    			my_window = 0;
    		}
    		if( ack == 1 )
    		{
    			rs232_transmit('A');
    			rs232_transmit('C');
    			rs232_transmit('K');
    			rs232_transmit(' ');
    			rs232_transmit('E');
    			rs232_transmit('r');
    			rs232_transmit('r');
    			rs232_transmit('o');
    			rs232_transmit('r');
    			ack = 0;
    			my_window = 0;
    			xp_rec_en = 0;
    		}
    	};
    	return 0;
    }
    
    void clear_buff(unsigned char buff)
    {
    	if( buff == 0 )
    		for( i=0; i<18; i++ )
    			pc_command[i] = 0;
    	if( buff == 1 )
    		for( i=0; i<16; i++ )
    			xp_response[i] = 0;
    	return;
    }
    
    void avr_init(void)
    {
    	// 62500 9bit 1 stop no parity
    	UCSR0A=0x00;
    	UCSR0B=0x9C;
    	UCSR0C=0x86;
    	UBRR0H=0x00;
    	UBRR0L=0x0F;
    
    	// 56000 8bit 1 stop no parity
    	UCSR1A=0x00;
    	UCSR1B=0x98;
    	UCSR1C=0x06;
    	UBRR1H=0x00;
    	UBRR1L=0x11;
    	
    	DDRC = 0b00000011;
    	PORTC= 0b00000000;
    	
    	DDRD = 0b00000001;
    	PORTD= 0b00000000;
    	
    	DDRG  = 0b00011011;  //определить все ножки порта G (PG3 - DE status, PG4 - DE counter) 
        PORTG = 0b11100100;  //включить подтяжку резисторов 
    	
    	DDRD  = 0b11111000;  //PD0, PD1 - SCL-SDA, PD2 -RxD1, PD3 - TxD1 PD4 - STAT/COUN, PD5 - RE STAT, PD6 - RE Coun, PD7 - testLD
    	PORTD = 0b01101111;  //подключить внутренние резисторы на входах, a  выходы установить  в "0"
    	
    	PORTG &=~_BV(PG4);	 //disable DE RS485
    	PORTD &=~_BV(PD5);  //enable RE RS485
    	
    	return;
    }

    JovialLiX, 19 Апреля 2010

    Комментарии (2)
  7. Си / Говнокод #3049

    +151.4

    1. 001
    2. 002
    3. 003
    4. 004
    5. 005
    6. 006
    7. 007
    8. 008
    9. 009
    10. 010
    11. 011
    12. 012
    13. 013
    14. 014
    15. 015
    16. 016
    17. 017
    18. 018
    19. 019
    20. 020
    21. 021
    22. 022
    23. 023
    24. 024
    25. 025
    26. 026
    27. 027
    28. 028
    29. 029
    30. 030
    31. 031
    32. 032
    33. 033
    34. 034
    35. 035
    36. 036
    37. 037
    38. 038
    39. 039
    40. 040
    41. 041
    42. 042
    43. 043
    44. 044
    45. 045
    46. 046
    47. 047
    48. 048
    49. 049
    50. 050
    51. 051
    52. 052
    53. 053
    54. 054
    55. 055
    56. 056
    57. 057
    58. 058
    59. 059
    60. 060
    61. 061
    62. 062
    63. 063
    64. 064
    65. 065
    66. 066
    67. 067
    68. 068
    69. 069
    70. 070
    71. 071
    72. 072
    73. 073
    74. 074
    75. 075
    76. 076
    77. 077
    78. 078
    79. 079
    80. 080
    81. 081
    82. 082
    83. 083
    84. 084
    85. 085
    86. 086
    87. 087
    88. 088
    89. 089
    90. 090
    91. 091
    92. 092
    93. 093
    94. 094
    95. 095
    96. 096
    97. 097
    98. 098
    99. 099
    100. 100
    if( pc_rbyte == 0xFA && pc_buff_ready == 0 && pc_rec_pos == 0)
    	{
    		pc_rec_en = 1;
    		return;
    	}	
    	return;
    }
    
    ISR(USART0_RX_vect)
    {
    	cli();
    	rbyte = rs485_reciv();
    	
    	if( COMM == 1 && rbyte != 0x42 )
    		xp_rec_en = 1;
    	
    	if(COMM == 1 && rbyte == 0x42)
    	{
    		//xp_rec_pos++;
    		xp_response[xp_rec_pos] = xp_xor;
    		COMM = 0;
    		xp_rec_en = 0;
    		xp_buff_ready = xp_rec_pos;
    		xp_rec_pos = 0;
    		xp_rec_en = 0;
    		xp_xor = 0;
    	}
    	
    	
    	if( xp_rec_en == 1 ) 
    	{
    		if( rbyte != xp_xor && xp_rec_pos<16 )
    		{
    			xp_response[xp_rec_pos] = rbyte;
    			xp_xor = xp_xor^rbyte;
    			xp_rec_pos++;
    		}else{
    			xp_buff_ready = xp_rec_pos;
    			xp_rec_pos = 0;
    			xp_rec_en = 0;
    			xp_xor = 0;
    		}
    	}		
    	
    	if( rbyte == 0x60 )
    	{
    		xp_rec_en = 1;
    		xp_response[0] = rbyte;
    		xp_rec_pos++;
    	}
    	
    	if( rbyte == 0x41 && my_window!=1)
    		COMM = 1;		
    	
    	if( (bit9&0b00000010) == 0b00000010 && (rbyte&0b00011111) == myXPaddress ) 
    	
    		switch( (rbyte&0b01100000) )
    		{
    			case 0b01000000: ack = 0; if( pc_buff_ready == 1 ) my_window = 1; xp_rec_en = 0;break; // NormalInquary
    			case 0b01100000: ack = 0; my_window = 0; xp_rec_en = 1;break; // CallByte
    			case 0b00000000: ack = 1; my_window = 0; xp_rec_en = 0;break; // ACK!
    		}
    	
    	rbyte = 0;
    	sei();
    	
    	return;
    }
    
    int main(void)
    {
    	avr_init();
    	sei();
    
    	//PORTD &=~(1<<transmit_en);
    	//pc_buff_ready = 1;
    	while (1)
    	{
    		//if( pc_buff_ready == 1 ) //pc_buff_ready == 1 && 
    		//{
    			if( my_window == 1 )
    			{
    				cli();
    				_delay_us(30);
    				//PORTD |= (1<<transmit_en);
    				PORTG |=_BV(PG4);	 //disable DE RS485
    				PORTD |=_BV(PD5);  //enable RE RS485
    				//_delay_us(5);
    				for( i=0; pc_rec_pos != i; i++ )
    					rs485_ransmit(pc_command[i]);
    					
    				while ( !( UCSR0A & (1<<UDRE0)) );
    				_delay_us(160);
    				PORTG &=~_BV(PG4);	 //disable DE RS485
    				PORTD &=~_BV(PD5);  //enable RE RS485
    				
    				my_window = 0;
    				clear_buff(0);
    				pc_buff_ready = 0;
    				pc_rec_pos = 0;

    JovialLiX, 19 Апреля 2010

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

    +149.2

    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
    95. 95
    96. 96
    97. 97
    98. 98
    #include <avr/io.h>
    #include <avr/interrupt.h>
    #include <util/delay.h>
    
    #define myXPaddress 0b00000010
    //#define transmit_en PD0
    
    void avr_init(void);
    void clear_buff(unsigned char buff);
    
    volatile unsigned char bit9 = 0;
    volatile unsigned char rbyte = 0;
    volatile unsigned char pc_rbyte = 0;
    
    volatile unsigned char pc_command[17];
    volatile unsigned char xp_response[15];
    
    volatile unsigned char pc_rec_pos = 0;
    volatile unsigned char xp_rec_pos = 0;
    
    volatile unsigned char pc_rec_en = 0;
    volatile unsigned char xp_rec_en = 0;
    
    volatile unsigned char pc_buff_ready = 0;
    volatile unsigned char xp_buff_ready = 0;
    
    volatile unsigned char my_window = 0;
    volatile unsigned char ack = 0;
    
    volatile unsigned char xp_xor = 0;
    
    volatile unsigned char COMM = 0;
    
    unsigned char i;
    
    void rs485_ransmit( unsigned char data )
    {
    	while ( !( UCSR0A & (1<<UDRE0)) );
    	UCSR0B &= ~(1<<TXB80); // SET 9 BIT IN 0
    	UDR0 = data;
    }
    
    unsigned char rs485_reciv(void)
    {
    	char status,data;
    	
    	status=UCSR0A;
    	bit9 = UCSR0B;
    	data=UDR0;
    	if ( status & ( (1<<FE)|(1<<DOR)|(1<<UPE) ) )
    		return 0;
    	
    	return data;
    }
    
    unsigned char rs232_reciv( void )
    {
    	while ( !(UCSR1A & (1<<RXC1)) );
    	return UDR1;
    }
    void rs232_transmit( unsigned char data )
    {
    	while ( !( UCSR1A & (1<<UDRE1)) );
    	UDR1 = data;
    }
    
    
    ISR(USART1_RX_vect)
    {
    	pc_rbyte = rs232_reciv();
    	
    	if( pc_buff_ready == 1 && pc_rbyte == 0xFA )
    	{
    		pc_rec_en = 0;
    		rs232_transmit('B');
    		rs232_transmit('U');
    		rs232_transmit('F');
    		rs232_transmit('F');
    		rs232_transmit(' ');
    		rs232_transmit('O');
    		rs232_transmit('V');
    		rs232_transmit('F');
    		return;
    	}
    		
    	if( pc_rec_en == 1 )
    		if( pc_rbyte == 0xFF)
    		{
    			pc_rec_en = 0;
    			pc_buff_ready = 1;
    			return;
    		}
    		else
    		{
    			pc_command[pc_rec_pos] = pc_rbyte;
    			pc_rec_pos++;
    			return;
    		}

    JovialLiX, 19 Апреля 2010

    Комментарии (1)
  9. Си / Говнокод #3047

    +127.8

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    int main()
    {
    	if (2 * 2 != 4)
    	{
    		printf ("Плохой день!");
    		getch();
    		return 1;
    	}
    	
    	...
    }

    А вдруг???

    XAKEP, 19 Апреля 2010

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

    +161.4

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    $taskName=$_GET[""];
    $taskId=$_GET[""];
    $objId=$_GET[""];
    $catId=$_GET[""];
    
    $this->DoInsertQuery("crm_task","TaskID,RefObjId,ObjectID",array("TaskID"=>$taskId,"RefObjId"=>$catId,"ObjectID"=>$objId));

    а вам слабо?

    nur, 19 Апреля 2010

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