pouët.net

Random line of code thread

category: code [glöplog]
Just gotta make sure, you know that you should at least do this:
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
added on the 2008-11-10 22:43:27 by b0ib0t b0ib0t
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?
added on the 2008-11-11 09:17:55 by Jcl Jcl
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);
added on the 2008-11-11 11:37:32 by Optimus Optimus
cout << "Out" << endl;
added on the 2008-11-11 14:07:06 by xTr1m xTr1m
#define meaningOfLife 0
added on the 2008-11-11 14:08:48 by b0ib0t b0ib0t
#include <god.h>
added on the 2008-11-11 14:10:17 by neoneye neoneye
int *myPtr = 0; *myPtr = 0; // they be taking mah Ptr!!!
added on the 2008-11-11 14:16:24 by xTr1m xTr1m
/* =================
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");
}
added on the 2008-11-11 14:29:16 by Optimus Optimus
return foodProvider->iCanHas(foodFactory->createCheezBurger());
added on the 2008-11-11 14:41:45 by xTr1m xTr1m
fix_parenthesis_if_I_missed_one();

lol.

How about a "fix_semicolon_if_I_missed_one();"? Would be really useful too...
added on the 2008-11-11 14:48:06 by raer raer
Code: if(engineMode == "menu"){ render(buttonBG); playBtn = buttons(playBtn); render(playBtn); addBtn = buttons(addBtn); render(addBtn); exitBtn = buttons(exitBtn); render(exitBtn); menuMouse = mouse(); updateScreen(); }
added on the 2008-11-11 18:07:32 by b0ib0t b0ib0t
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
added on the 2008-11-11 18:27:59 by すすれ すすれ
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); }

added on the 2008-11-11 19:02:15 by Radiant Radiant
10 ? PEEK($AB00)
added on the 2008-11-23 11:08:30 by cruzer cruzer
My favorite CPC code:
Code:CALL 0
added on the 2008-11-23 12:20:42 by Joghurt Joghurt
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.
added on the 2008-11-23 23:20:30 by neoneye neoneye
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.
added on the 2008-11-23 23:58:18 by Calexico Calexico
if ((pouet==1) && (year >= 2013)) pouet++;
added on the 2008-11-24 10:17:57 by trc_wm trc_wm
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++; }
added on the 2008-11-24 13:37:00 by kb_ kb_
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 :)
added on the 2008-11-24 14:13:48 by visy visy
pea 0.w
trap #1
added on the 2008-11-24 14:46:56 by slippy slippy
xor EAX,EAX
mov EAH,hihi
mov EAL,hilo
mov AH,lohi
mov AL,lolo

AGAGA !
illegal

(the smallest program afaik)
added on the 2008-11-24 20:44:28 by earx earx

login