pouët.net

Random line of code thread

category: code [glöplog]
move lol,rotfl
added on the 2010-02-11 12:14:02 by elkmoose elkmoose
Code: // random comment
added on the 2010-02-11 15:04:26 by bull bull
Image Imase = = component.createImage(ScreenImaceSrc);.
added on the 2010-02-11 15:17:55 by dodke dodke
Code: #include "Main.h" using namespace WindowsGUI; Window *win; RECT rc = {0, 0, 800, 400}; int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { g_hwndParent = 0; g_hInstance = hInstance; win = new Window("GUI App Class", "My Tool", 0, &rc, g_hInstance); win->Register(); win->Create(); win->ShowWindow(SW_MAXIMIZE); return win->MessagePump(); }
added on the 2010-02-11 15:21:04 by rudi rudi
Code: void setFPUcw(unsigned int mode) { __asm__ __volatile__("fldcw %0" : : "m" (*&mode)); } unsigned int getFPUcw() { unsigned int cw; __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw)); return cw; } void enableFPExceptions(bool NaN, bool zeroDivide, bool infinity, bool denormal) { unsigned int cw = getFPUcw() | 0x003f; // fill exception mask unsigned int emask = 0; if (NaN) emask |= 0x0001; if (zeroDivide) emask |= 0x0004; if (infinity) emask |= 0x0008; if (denormal) emask |= 0x0002; cw &=~ emask; // unmask some setFPUcw(cw); }
added on the 2010-02-11 15:31:56 by ponce ponce
10 PRINT "PANTS OFF"
20 GOTO 10
added on the 2010-02-11 15:42:31 by trc_wm trc_wm
dc $60fe

Guess what it does?
added on the 2010-02-13 18:23:36 by model model
Quote:

Guess what it does?


Something that could be killed with dc.w $4e71 ;) (endless loop)
added on the 2010-02-13 18:28:19 by StingRay StingRay
Code: _body = (CGenEllipse) ( ((CGenObj)( GenObjSet.get(i) )).body );

Sometimes even processing code can look pretty gross. :)
added on the 2010-02-13 18:43:27 by tomaes tomaes
Quote:
Something that could be killed with dc.w $4e71 ;) (endless loop)


Actually, $4e71 is NOP. $60fe is an endless loop:

Code:loop BRA.B loop


added on the 2010-02-13 19:19:46 by model model
Errm, did I say anything else? The endless loop can be killed with a nop. I didn't want to write "$60fe is an endless loop".
added on the 2010-02-13 19:29:44 by StingRay StingRay
Ok, I got you wrong.

dc.w $80fc,$0000
added on the 2010-02-13 19:42:33 by model model
Code:template<int n> struct fact { static const int value = n * fact<n - 1>::value; }; template<> struct fact<0> { // specialization for n = 0 static const int value = 1; };


functional paradigm in C++
added on the 2010-03-02 11:37:10 by krzyzan krzyzan
Code: moveq #Y_MAX-1,D7 y_out_loop: move.w D2,D5 ;Y_y and.w D3,D5 ; Tex_Y mask move.l D0,D6 ;Y_x swap D6 and.w D4,D6 ; Tex_X mask add.w D6,D5 ; Tex_X + Tex_Y movea.l D5,A0 ;1 lea (A0),A1 ;1 |lea 0(a0,a5.l),a1 (4) adda.l A5,A1 ;2 | add.l D1,D0 ;X Increment add.w A3,D2 ;Y Increment mody_code: o SET 0 REPT 320/16 move.l 0(A0),D6 ;BASE + F000 * 4 add.w 0(A1),D6 ; F00 * 4 add.w 2(A1),D6 ; F0 * 4 add.b 0(A1),D6 ; F * 4 movea.l D6,A2 ; move.l (A2),D6 ; movep.l D6,o(A6) ; move.l 0(A0),D6 ;BASE + F000 * 4 add.w 0(A1),D6 ; F00 * 4 add.w 2(A1),D6 ; F0 * 4 add.b 0(A1),D6 ; F * 4 movea.l D6,A2 ; move.l (A2),D6 ; movep.l D6,o+1(A6) ; o SET o+8 ENDR lea 2*160(A6),A6 dbra D7,y_out_loop

added on the 2010-03-02 12:03:13 by lsl lsl
Code: ... if(self::$verbose) echo 'PUTIN detected...entity converting...'; ...
added on the 2010-03-02 14:45:15 by d0DgE d0DgE
Code: complex float BiquadFreqResponse(float f, float Fs, float *a, float *b) { f /= Fs; complex float t1 = cpow(M_E, -I*2*M_PI*f); complex float t2 = cpow(M_E, -I*4*M_PI*f); complex float R0 = (b[0]/a[0]) + (b[1]/a[0]) * t1 + (b[2]/a[0]) * t2; complex float R1 = 1 + (a[1]/a[0]) * t1 +(a[2]/a[0]) * t2; return R0 / R1; }
added on the 2010-03-12 13:20:45 by torus torus
Code: 0002 mov x,#0 0004 mov y,#$f8 0006 mov $f1, #0 0009 mov $f2, #$5c 000c mov $f2, #init_kof 000f -: cmp y,$f4 0011 bne - 0013 mov a,$f5 0015 mov $0000+y,a 0018 mov $f4,y 001a mov a,$f6 001c mov $0001+y,a 001f inc y 0020 inc y 0021 bne - 0023 inc $0017 0026 inc $001e 0029 bne - 002b mov $f2, #$4c 002e mov $f2, #init_kon 0031 jmp init
added on the 2010-03-12 13:27:22 by mic mic
Code: public static Expression<Func<TElement, bool>> BuildContainsExpression<TElement, TValue>(Expression<Func<TElement, TValue>> valueSelector, IEnumerable<TValue> values) { if (null == valueSelector) throw new ArgumentNullException("valueSelector"); if (null == values) throw new ArgumentNullException("values"); ParameterExpression p = valueSelector.Parameters.Single(); if (!values.Any()) return e => false; IEnumerable<Expression> equals = values.Select(value => (Expression) Expression.Equal(valueSelector.Body, Expression.Constant(value, typeof (TValue)))); Expression body = equals.Aggregate(Expression.Or); return Expression.Lambda<Func<TElement, bool>>(body, p); }
added on the 2010-03-12 13:27:57 by Jcl Jcl
Quote:
hh = hh ## (ident - 2*(v # v)/total(v * v)) ;; generate matrix


you'll never guess the language! ;)
added on the 2010-03-12 13:54:27 by earx earx
Code:pea 0
added on the 2010-03-12 14:10:57 by seρρjο seρρjο
Code:if (ioctl(fd, EVIOCSFF, &effect) != -1)
added on the 2010-03-12 14:20:10 by harism harism
Code:add.l #data-START,a0 ; -> "emulate" lea data(pc),a0
added on the 2010-03-12 14:54:12 by StingRay StingRay
earx: lisp ?
Code: DC.B "LOL"
added on the 2010-03-12 15:16:19 by spiny spiny
earx: IDL !

login