Random line of code thread
category: code [glöplog]
Just gotta make sure, you know that you should at least do this:
Right?
Code:
for(int i = 0; i < lines; i++){
for(int ii = i + 1; ii < lines; ii++){
if(buffer[i] == buffer[ii]){
cout << "ERROR: duplicated numbers found for " << buffer[i] << " and " << buffer[ii] << "n";
}
}
}
Right?
Ummm. . . Ooops. hehe
Code:
nvt = from p in d.rhTrabajadorTurnoPlans where ( p.fecha == p_fecha && tne.Encargados.Where(en => object.Equals(en.idEncargado, cbe)).Select( en => new { ENODO = (int?)en.idNodo, ETURNO = (int?)en.idTurno } ).Contains( new { ENODO = (int?)p.rhPuestoTrabajo.idNodo, ETURNO = (int?)p.idTurno } ) ) select new Programacion { idProgramacion = "P" + p.idTrabajadorTurnoPlan.ToString(), NombreTrabajador = p.rhTrabajador.nombreCompleto, NombreTurno = p.rhTurno.nombre, NombreNodo = p.rhPuestoTrabajo.rhNodo.nombre, PuestoTrabajo = p.rhPuestoTrabajo.nombre, idPuestoTrabajo = (int)(p.idPuestoTrabajo ?? 0), idTrabajador = (int)(p.idTrabajador ?? 0), idTurno = p.idTurno, fecha = p_fecha, trabajadorTurnoPlan = p.idTrabajadorTurnoPlan, HorarioPlan = p.horario, valoracion = -1 };
Doesn't LinQ just rule?
int absx = abs(rf);
int absy = abs(df);
int px = absx >> m_fpshr;
int py = absy >> m_fpshr;
int pua = px % m_bitmapWidth;
int pva = (py % m_bitmapHeight) * m_bitmapWidth;
int pub = (px + 1) % m_bitmapWidth;
int pvb = ((py + 1) % m_bitmapHeight) * m_bitmapWidth;
int ul = absx & (m_fpmul - 1);
int vl = absx & (m_fpmul - 1);
int absy = abs(df);
int px = absx >> m_fpshr;
int py = absy >> m_fpshr;
int pua = px % m_bitmapWidth;
int pva = (py % m_bitmapHeight) * m_bitmapWidth;
int pub = (px + 1) % m_bitmapWidth;
int pvb = ((py + 1) % m_bitmapHeight) * m_bitmapWidth;
int ul = absx & (m_fpmul - 1);
int vl = absx & (m_fpmul - 1);
cout << "Out" << endl;
#define meaningOfLife 0
#include <god.h>
int *myPtr = 0; *myPtr = 0; // they be taking mah Ptr!!!
/* =================
Listen to me!
I am at work but very very bored
I am also very board.
So my mind creates all this text
And I purely enjoy it's surrealism
Now I am also going to write some code
In this template
=================*/
#include <artstudio.h>
#include <soundtrakker128.h>
#include <kickassroutines.h>
#include "defines.h"
#define plasma MULTICOLOR
#define rotozoomer BILINEAR
void main()
{
init_demo();
init_leetness();
say_bass!();
k = getSomeTimerAndChewBubblegum();
run_script(int k);
}
bool run_script(int ficken)
{
do while(inkey$="25")
{
correct_code(wherever_it's_whateverism_in_the_cranium);
plasma(rotozoomer(shadebobs(envmapped_torus(ficken))))));
fix_parenthesis_if_I_missed_one();
}
loop until(kicking==hard)
}
void doh(void)
{
printf("doh\n");
}
Listen to me!
I am at work but very very bored
I am also very board.
So my mind creates all this text
And I purely enjoy it's surrealism
Now I am also going to write some code
In this template
=================*/
#include <artstudio.h>
#include <soundtrakker128.h>
#include <kickassroutines.h>
#include "defines.h"
#define plasma MULTICOLOR
#define rotozoomer BILINEAR
void main()
{
init_demo();
init_leetness();
say_bass!();
k = getSomeTimerAndChewBubblegum();
run_script(int k);
}
bool run_script(int ficken)
{
do while(inkey$="25")
{
correct_code(wherever_it's_whateverism_in_the_cranium);
plasma(rotozoomer(shadebobs(envmapped_torus(ficken))))));
fix_parenthesis_if_I_missed_one();
}
loop until(kicking==hard)
}
void doh(void)
{
printf("doh\n");
}
return foodProvider->iCanHas(foodFactory->createCheezBurger());
fix_parenthesis_if_I_missed_one();
lol.
How about a "fix_semicolon_if_I_missed_one();"? Would be really useful too...
lol.
How about a "fix_semicolon_if_I_missed_one();"? Would be really useful too...
Code:
if(engineMode == "menu"){
render(buttonBG);
playBtn = buttons(playBtn);
render(playBtn);
addBtn = buttons(addBtn);
render(addBtn);
exitBtn = buttons(exitBtn);
render(exitBtn);
menuMouse = mouse();
updateScreen();
}
Probably the best line from F1GP ULS 3.x loader:
Code:
dc.b "ARSE" ; some text so I can find this code in Steem's Boiler Room
I love procmail!
Code:
void shexec(argv)const char*const*argv;
{ int i;char**newargv;const char**p;
#ifdef SIGXCPU
signal(SIGXCPU,SIG_DFL);signal(SIGXFSZ,SIG_DFL);
#endif
#ifdef SIGLOST
signal(SIGLOST,SIG_DFL);
#endif /* or is it a shell script ? */
signal(SIGPIPE,SIG_DFL);execvp(*argv,(char*const*)argv);
for(p=(const char**)argv,i=1;i++,*p++;); /* count the arguments */
newargv=malloc(i*sizeof*p); /* no shell script? -> trouble */
for(*(p=(const char**)newargv)=binsh;*++p= *argv++;);
execv(*newargv,newargv);free(newargv);nlog("Failed to execute");
logqnl(*argv);
exit(EX_UNAVAILABLE);
}
10 ? PEEK($AB00)
My favorite CPC code:
Code:
CALL 0
Code:
switch (count % 8) {
case 0: do { *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
} while ((count -= 8) > 0);
}
beautiful.
Quote:
switch (count % 8) {
case 0: do { *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
} while ((count -= 8) > 0);
}
Crazy, this is practially assembler code. Looks as if it could be broken by some c-compiler optimizations.
if ((pouet==1) && (year >= 2013)) pouet++;
Code:
for (sInt i=0; i<particlecount; )
{
bool deleteme=false;
// insert random particle logic here that sets deleteme on end of life
if (deleteme)
particles[i]=particles[--particlecount];
else
i++;
}
Code:
lda #63
cli
sta $e000 ; ack irq
sta $c000 ; irq counter
sta $c001 ; clr counter
sta $e000 ; latch countdown value
sta $e001 ; enable counter
jsr basari_vilku
Nintendo :)
pea 0.w
trap #1
trap #1
xor EAX,EAX
mov EAH,hihi
mov EAL,hilo
mov AH,lohi
mov AL,lolo
AGAGA !
mov EAH,hihi
mov EAL,hilo
mov AH,lohi
mov AL,lolo
AGAGA !
illegal
(the smallest program afaik)
(the smallest program afaik)