Random line of code thread
category: code [glöplog]
move lol,rotfl
Code:
// random comment
Image Imase = = component.createImage(ScreenImaceSrc);.
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();
}
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);
}
10 PRINT "PANTS OFF"
20 GOTO 10
20 GOTO 10
dc $60fe
Guess what it does?
Guess what it does?
Quote:
Guess what it does?
Something that could be killed with dc.w $4e71 ;) (endless loop)
Code:
_body = (CGenEllipse) ( ((CGenObj)( GenObjSet.get(i) )).body );
Sometimes even processing code can look pretty gross. :)
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
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".
Ok, I got you wrong.
dc.w $80fc,$0000
dc.w $80fc,$0000
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++
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
Code:
...
if(self::$verbose) echo 'PUTIN detected...entity converting...';
...
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;
}
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
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);
}
Quote:
hh = hh ## (ident - 2*(v # v)/total(v * v)) ;; generate matrix
you'll never guess the language! ;)
Code:
pea 0
Code:
if (ioctl(fd, EVIOCSFF, &effect) != -1)
Code:
add.l #data-START,a0 ; -> "emulate" lea data(pc),a0
earx: lisp ?
Code:
DC.B "LOL"
earx: IDL !