pouët.net

Random line of code thread

category: code [glöplog]
Code:#define STR(x) XSTR(x) #define XSTR(x) #x #define JOIN(x) XJOIN(x) #define XJOIN(x) %x ## s #define CON STR(JOIN(MAX))
added on the 2009-05-28 05:05:16 by qwesza qwesza
err... buggy? s is not a macro!
added on the 2009-05-28 08:49:47 by decipher decipher
Code:move.l #-2,(a1)+
added on the 2009-05-28 10:06:36 by d0DgE d0DgE
move.w #$4e75,$b2(a3) ; jsr (a0) -> rts
added on the 2009-05-28 10:19:46 by StingRay StingRay
paintfuck sounds funny... :)
added on the 2009-05-28 13:02:39 by baah baah
movep.l d0,1(a0)
added on the 2009-05-28 16:24:09 by earx earx
processing

size(256,256);int x=128,y=0,i=0,r;for(;i<10000;i++){y/=2;x/=2;if((r=int(random(3)))<1)x+=64;else y+=128;if(r>1)x+=128;point(x,y);}
added on the 2009-05-28 16:49:34 by linde linde
ЛТ766 Эти папарацци такие ушлые
ЦФ837 Знаменитости не смогут укрыться от них
ЖХ734 Как бы они не старались
СМ221 Все равно их голые тела будут сняты
ОА180 Сняты и показаны всем онлайн
added on the 2009-05-28 16:49:51 by dipswitch dipswitch
Code: BRANCH MACRO .if condBranch == 0 .if branchOffset != 1 mov eax,PC sub eax,4 and eax,0F0000000h or eax,branchOffset mov word ptr [edi],05C7h ; mov r/m32,imm32 mov dword ptr [edi+2],offset PC mov [edi+6],eax add edi,10 .endif .else mov eax,PC sub eax,4 add eax,branchOffset mov word ptr [edi],05C7h mov dword ptr [edi+2],offset PC mov [edi+6],eax mov word ptr [edi+10],0AEBh ; jmp +10 add edi,12 mov eax,branchEdi mov ebx,edi sub ebx,eax mov [eax-1],bl ; set jump distance mov word ptr [edi],05C7h mov eax,PC mov dword ptr [edi+2],offset PC mov [edi+6],eax add edi,10 .endif ; mov ebx,offset _block_done / jmp ebx mov byte ptr [edi],0BBh mov dword ptr [edi+1],offset _block_done mov word ptr [edi+5],0E3FFh add edi,7 ENDM
added on the 2009-05-28 17:17:22 by mic mic
Decipher: what? xD yeah, s is 's', not a macro..
if you define MAX 10, then CON will be %10s
added on the 2009-05-28 19:01:36 by qwesza qwesza
oh well, my bad :)
added on the 2009-05-28 19:08:21 by decipher decipher
Code: isn't :: (a -> b) -> (b -> Bool) -> a -> Bool isn't f g = not . g . f

usage: filter (projection `isn't` property) stuff

example:
Code: fatPeople = filter (weightInKilograms `isn't` (<100)) people
added on the 2009-05-29 22:20:42 by blala blala
Comment Rant (scroll down).
added on the 2009-06-13 10:38:03 by tomaes tomaes
imagesc(flipud(X),[10 60]); set(gca,'YDir','normal'); fuck;
added on the 2009-09-04 20:25:17 by bdk bdk
behold my AVISynth-fu, suckaz!

Code:function frameOpacity(float t) { x = 0.0 x = (t>=60 && t<120) ? ((t - 60.0) / 60.0) : x x = (t>=120 && t<420) ? 1.0 : x x = (t>=420 && t<480) ? ((480.0 - t) / 60.0) : x return x } function OverlayText(clip c,string filename) { text = FlipVertical(ImageSource(filename,pixel_type="rgb32")) c = FrameEvaluate(c,"global OL_opacity_offset = frameOpacity(current_frame)") return ConditionalFilter(c,Overlay(c,text,mask=ShowAlpha(text),opacity=0.0),c,"OL_opacity_offset","greaterthan","0") } v1 = FlipVertical(DirectShowSource("e:\vids\eta_-_junk.mkv",pixel_type="RGB")) v1 = Trim(v1,1825,-500) # 20second segment starting at 1:13 v1 = ConvertFPS(ChangeFPS(v1,50.0),60.0) # we have 60fps video (double frames, interpolate inbetween) v1 = AddBorders(BicubicResize(v1,1920,798),0,141,0,141) # resize and letterbox to fullhd v1 = ConvertToYV12(v1) v1 = Normalize(SSRC(v1,44100),0.98) # finally, change sample rate of audio and volume v1 = OverlayText(v1,"e:\vids\images\nominee_texts_21_Junk_ETA.psd") v2 = FlipVertical(DirectShowSource("e:\vids\inward_-_give_me_future_or_give_me_death.avi",pixel_type="RGB")) v2 = Trim(v2,5100,-500) # 20second segment starting at 3:24 v2 = ConvertFPS(v2,60.0) v2 = AddBorders(BicubicResize(v2,1440,1080),240,0,240,0) # resize and letterbox to fullhd v2 = ConvertToYV12(v2) v2 = OverlayText(v2,"e:\vids\images\nominee_texts_22_Inward_Give_me_Future_or_Give_Me_Death.psd") v3 = DirectShowSource("e:\vids\HBC-00001_Donuts.avi",pixel_type="YV12") v3 = Trim(v3,4850,-500) # 20second segment starting at 3:14 v3 = ConvertFPS(ChangeFPS(v3,50.0),60.0) v3 = BicubicResize(v3,1920,1080) # resize to fullhd v3 = Normalize(SSRC(v3,44100),0.98) v3 = OverlayText(v3,"e:\vids\images\nominee_texts_38_Half-bit_Cheese_HBC-00001_Donuts.psd") v4 = DirectShowSource("e:\vids\HBC-00003_Bullet_Time.mkv",pixel_type="YV12") v4 = Trim(v4,1100,-500) # 20second segment starting at 0:44 v4 = ConvertFPS(ChangeFPS(v4,50.0),60.0) v4 = BicubicResize(v4,1920,1080) # resize to fullhd v4 = OverlayText(v4,"e:\vids\images\nominee_texts_37_Half-bit_Cheese_HBC-00003_Bullet_Time.psd") v5 = DirectShowSource("e:\vids\HBC-00004_Field_Trip.mkv",pixel_type="YV12") v5 = Trim(v5,4000,-500) # 20second segment starting at 2:40 v5 = ConvertFPS(ChangeFPS(v5,50.0),60.0) # we have 60fps video (double frames, interpolate inbetween) v5 = BicubicResize(v5,1920,1080) # resize to fullhd v5 = OverlayText(v5,"e:\vids\images\nominee_texts_36_Half-bit_Cheese_HBC-00004_Field_Trip.psd") bl = BlankClip(v1,length=30,color=$000000) en = ImageSource("e:\vids\category_screen\category_screen_sequence\category_screen_%05d.jpg",start=1257,end=1286,fps=60) text = FlipVertical(ImageSource("e:\vids\images\category_screen_07_best_animation.psd",pixel_type="rgb32")) en = Overlay(en,text,mask=ShowAlpha(text),opacity=1.0) en = ConvertToYV12(en) en = AudioDub(en,bl) Dissolve(bl,v1,v2,v3,v4,v5,en,25)
added on the 2009-09-04 20:37:37 by ryg ryg
incidentally, that doesn't use the proper way to overlay PSDs onto videos that doesn't produce artifacts, but the quick way that has some artifacts and a half-decent rendering rate.

if you want it to be correct, you have to use something like this:
Code:function clamp(float a,float min,float max) { return (a < min) ? min : ((a > max) ? max : a) } vid = ImageSource("e:\vids\winner_screen\winner_screen_sequence_flash\winner_screen_flash_%05d.jpg",start=0,end=900,fps=60,pixel_type="rgb32") ov = FlipVertical(ImageSource("e:\vids\images\winner_screen_08_best_4k_intro.psd",pixel_type="rgb32")) alpha = ShowAlpha(ov) invAlpha = Levels(alpha,0,1,255,255,0) ovBlk = Overlay(ov,invAlpha,mode="Subtract",pc_range=true) ScriptClip(vid,"fade = clamp((current_frame - 90.0) / 60.0,0.0,1.0)" + chr(13) \ + "ovBlkN = Levels(ovBlk,0,1,255,0,Int(255*fade))" + chr(13) \ + "invAlphaN = Levels(invAlpha,0,1,255,255-Int(255*fade),255)" + chr(13) \ + "Overlay(ovBlkN,Overlay(vid,invAlphaN,mode="+chr(34)+"Multiply"+chr(34)+",pc_range=true),mode="+chr(34)+"Add"+chr(34)+",pc_range=true)")


a kingdom for proper porter-duff alpha compositing operators.
added on the 2009-09-04 20:43:26 by ryg ryg
goto page 1!
added on the 2009-09-04 21:32:00 by Deus Deus
Code: // Shift-Click: Insert envelope point here if(CMainFrame::GetMainFrame()->GetInputHandler()->ShiftPressed()) { m_ptMenu = pt; m_nDragItem = EnvInsertPoint(); // returns point ID + 1 if successful, else 0. if(m_nDragItem > 0) { // Drag point if successful SetCapture(); m_dwStatus |= INSSTATUS_DRAGGING; } }
assert( WriteProcessMemory( pi.hProcess, bi->second.address, &(bi->second.opcode), 1, NULL ) != 0 ) ;
added on the 2009-09-04 21:37:20 by rmeht rmeht
if (plaa==-666) glueErrorf("\n\nERREUR: out of hash!\n\n");
added on the 2009-09-05 13:15:50 by pommak pommak
lol
added on the 2009-09-05 14:36:11 by raer raer
Code: DrawText(hTextDC, "knetmops!", 9, &TextArea, DT_NOCLIP);
added on the 2009-09-05 20:46:00 by rac rac
a+=b+++++c;
added on the 2009-10-20 22:59:58 by booster booster
Quote:
a+=b+++++c;

GLSL size coding or just another obfuscated C day?
added on the 2009-10-20 23:10:44 by auld auld
Code: move.w d4,(a6) ; ctrl & skew divs.w d2,d1 ; incr add.w d1,d1 slt d4 and.b d5,d4 ; fxsr & nfsr
added on the 2009-10-21 08:54:00 by tobé tobé

login