- 1
- 2
- 3
<?
echo $i++ + ++$i;
?>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+144.8
<?
echo $i++ + ++$i;
?>
+57.2
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: образцовый быдлокод.
+187.2
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>
+83
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
−180.6
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]);
}
}
}
}
+150.4
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;
}
+151.4
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;
+149.2
#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;
}
+127.8
int main()
{
if (2 * 2 != 4)
{
printf ("Плохой день!");
getch();
return 1;
}
...
}
А вдруг???
+161.4
$taskName=$_GET[""];
$taskId=$_GET[""];
$objId=$_GET[""];
$catId=$_GET[""];
$this->DoInsertQuery("crm_task","TaskID,RefObjId,ObjectID",array("TaskID"=>$taskId,"RefObjId"=>$catId,"ObjectID"=>$objId));
а вам слабо?