- 1
- 2
- 3
- 4
- 5
- 6
- 7
TVector4 V0;
TVector4 V1;
TVector4 V2;
//....
//Пример компилирующегося допустимого использования:
(V0+V1)=V2;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+911
TVector4 V0;
TVector4 V1;
TVector4 V2;
//....
//Пример компилирующегося допустимого использования:
(V0+V1)=V2;
Нашёл я тут мега библиотеку в инете для работы с векторами. За такое нужно бить по рукам.
+61
FILE *h=fopen(fileDMB, "r");
char *fileDMBtext;
while(fileDMBtext=fgetc(h)!=EOF){return 0;}
Я даже знаю компилятор в котором это работает.
+71
public class XXX implements YYY
{
public static final String UTILITYBATCHES = "utilityBatches";
public static final String UTILITYCALCULATIONS = "utilityCalculations";
public static final String WARDREGISTRATION = "wardRegistration";
public static final String WARDINSPECTIONS = "wardInspections";
public static final String WARDPRIMARYREGISTRATION = "wardPrimaryRegistration";
public static final String SOCIALEVENTS2DOCUMENTS = "socialEvents2documents";
public static final String SOCIALEVENTS = "socialEvents";
public static final String SOCIALPACKAGES = "socialPackages";
public static final String SOCIALAIDS = "socialAids";
public static final String PRIVCATEGORIES = "privCategories";
public static final String PAYMENTS = "payments";
public static final String PAYMENTDETAILS = "paymentDetails";
public static final String PAYMENTBATCHES = "paymentBatches";
public static final String FAMILYRELATIONS = "familyRelations";
public static final String FOSTERFAMILIES = "fosterFamilies";
public static final String FAMILYMEMBERS = "familyMembers";
public static final String INVALIDNESS = "invalidness";
public static final String HEALTHINSPECTIONS = "healthInspections";
public static final String EMPLOYMENTS = "employments";
public static final String EDUCATION = "education";
public static final String DOCUMENTS = "documents";
public static final String FAMILIES = "families";
public static final String DECORATIONS = "decorations";
public static final String CALCULATIONS = "calculations";
public static final String ATTRIBUTEVALUEHISTORY = "attributeValueHistory";
public static final String ATTRIBUTEVALUES = "attributeValues";
public static final String ASSIGNMENTS = "assignments";
public static final String ADDRESSES = "addresses";
public static final String ATTACHMENTS = "attachments";
public static final String PERSONS = "persons";
public static final String OCCUPANCIES = "occupancies";
public static final String PROPERTIES = "properties";
public static final String BUILDINGS = "buildings";
public static final String WELFAREDELIVERY = "welfareDelivery";
}
+64.8
public static Boolean parseBoolean(Object x)
{
if(x instanceof Integer)
return (Integer) x != 0;
if(x == null)
return false;
if(x instanceof Boolean)
return (Boolean) x;
if(x instanceof Double)
return Math.abs((Double) x) < 0.00001;
return !("" + x).equals("");
}
Веселый кусочег из эмулятора сервера Lineage II (Сборка от L2f).
+154.8
#include <avr/interrupt.h>
#include <avr/io.h>
#include <stdio.h>
static void avr_init(void);
void uart_putchar(char value);
unsigned char read_adc(unsigned char adc_input);
unsigned char adc_enable;
ISR(SIG_UART_RECV)
{
unsigned char tmp;
tmp=UDR;
if (tmp=='1') adc_enable=1;
else adc_enable=0;
}
int main(void)
{
avr_init();
sei();
uart_putchar('A');
for(;;)
{
if(adc_enable)
{
uart_putchar(read_adc(0x00));
adc_enable = 0;
}
}
return(0);
}
static void avr_init(void)
{
PORTB=0b00000000;
DDRB=0b00001111;
PORTD=0b00111100;
DDRD=0b11000011;
// Baud Rate: 57600
// Character Size: 8-bit
// Mode: Asynchronous
// Parity: Disabled
// Stop Bit: 1-bit
// Multi-processor Communication
UBRRL = 0x0c;
UBRRH = 0x00;
UCSRA = 0x01;
UCSRC = 0x86;
UCSRB = 0xd8;
ADMUX=0x60;
ADCSRA=0xA6;
SFIOR&=0x0F;
SFIOR|=0x10;
return;
}
void uart_putchar(char value)
{
loop_until_bit_is_set(UCSRA, UDRE);
UDR = value;
return;
}
unsigned char read_adc(unsigned char adc_input)
{
ADMUX=adc_input|0x60;
// Start the AD conversion
ADCSRA|=0x40;
// Wait for the AD conversion to complete
while ((ADCSRA & 0x10)==0);
ADCSRA|=0x10;
return ADCH;
}
+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]);
}
}
}
}