Random line of code thread
category: code [glöplog]
Code:
sta $D400,yhlt	; some random padding (free space ftw!)
  
wait: jp nc, wait
  
Code:
aam 0xDE ; greetings to all my german friends ;-)Code:
func cos {+ -11 sin}Code:
jc doloop    ; 2 first iteration -> next bit
js done      ; 2 op completed, store it and copy the next literal
jp doloop    ; 2 if PF is set, we have an op byte, so do next iteration
P.S.: nice, superogue!
Needs more POSIX sh
  
Code:
SAVEDPCNT=$(echo "$SAVEDBYTE $ORGSIZE" | awk '{ print ($1/$2)*100 }')Niet met uw auto op het gazon!
  
Code:
192	ldarg.0	
193	call		System.Boolean PlayerGTA::InNoDriveVolume()
198	brfalse.s	-> (70) call System.Boolean UnityEngine.Cursor::get_visible()
200	ldstr		Niet met uw auto op het gazon!
205	stsfld		System.String SofaWorldCore.Announcement::announcement
oooh, MSIL bytecode, long time no see
(source, more crimes against bytecodity from a few years ago)
  
Code:
var lbl = c.DefineLabel();
// can't emit a 'dup' here -- would be better, but might mess up the method's maxstack stuff
c.Emit(Brfalse_S, lbl); // 2 bytes
c.Emit(Ldloc_3); // 1 byte
c.Index++; // callvirt
c.Index++; // brtrue.s
c.MarkLabel(lbl); // ldc.i4.0(source, more crimes against bytecodity from a few years ago)
Code:
// can't write C without committing some crimes against code standards
#define DEFINE_HOOK(rett, name, arglist, ...) \
    rett name(__VA_ARGS__) { \
        if (pathname != NULL) pathname = fix_path(pathname); \
        static void *orig_func = NULL; \
        if (orig_func == NULL) orig_func = dlsym(RTLD_NEXT, #name); \
        return ((rett (*)(__VA_ARGS__))(orig_func)) arglist; \
    }
loopcvx
rept 4
move.w d0,(a0)+
move.w d1,(a0)+
endr
subq #1,d0 ; a multiplier par 4 pour plus tard
;and.w #15,d0
bpl.s loopcvx
moveq #15,d0
addq.w #8,d1
cmp.w #160,d1
bne.s loopcvx
  
rept 4
move.w d0,(a0)+
move.w d1,(a0)+
endr
subq #1,d0 ; a multiplier par 4 pour plus tard
;and.w #15,d0
bpl.s loopcvx
moveq #15,d0
addq.w #8,d1
cmp.w #160,d1
bne.s loopcvx
I can probably remove one of the local variable (by decreasing N instead of using y).
I agree it's less elegant than this, but sooo much faster and probably way more memory friendly:
  
Code:
//Compute nCk, iterative method computing beginning of Pascal's triangle
int nCk_Line1[16+1],nCk_Line2[16+1];
int nCk(int N, int K) {
  int x,y;
  if(K>N-K) { K=N-K; }
  nCk_Line1[0]=1;nCk_Line2[0]=1;
  for(x=1;x<=K;x++) { nCk_Line1[x]=0; nCk_Line2[x]=0; }
  for(y=0;y<N;y++) {
    for(x=1;x<=K;x++) {
      nCk_Line2[x]=nCk_Line1[x-1]+nCk_Line1[x];
    }
    for(x=1;x<=K;x++) { nCk_Line1[x]=nCk_Line2[x]; }
  }
  return(nCk_Line1[K]);
}I agree it's less elegant than this, but sooo much faster and probably way more memory friendly:
Code:
int nCk(int N, int K) {
  if(K>N-K) { K=N-K; }
  if(N==K) { return(1); }
  if(K==0) { return(1); }
  return( nCk(N-1,K)+nCk(N-1,K-1));
}SYS 64738
  
SYS 2020
  
Code:
	dc.l	(CMD_JSR<<8)|$2d888,crack2-TAB	; disguised $dff00c readCode:
	move.l d1,$707C(a5)Code:
alias lsd="ls -l | lolcat"Code:
}Quote:
_timeAdjust += ((rand() % 1995) / 1995.0) * 0.1;
Code:
BYTES=$(prep_bytes "$PIC")
BYTES=$(echo "ibase=16;obase=2;$BYTES" | bc)
for BYTE in $BYTES; do
  BINS=$(printf "%08d" "$BYTE" | sed "s/\([[:digit:]]\)/ \1/g")
  ALLBITS="$ALLBITS$BINS"
doneCode:
const bool hasLoopInfo = (fileSize % 9) == 2;
if((fileSize % 9) != 0 && !hasLoopInfo)
	return false;note to self :: offscreen rendering seems a pain with apple metal api
  
Quote:
- (void)mtkView:(nonnull MTKView *)view drawableSizeWillChange:(CGSize)size
Code:
cmp.w	#$51c8,d0	; dbf dx instruction found? Quote:
* Class StuhlService
Code:
section "Sine tables",rom0,align[8]