Skip to content

Instantly share code, notes, and snippets.

View bredfern's full-sized avatar

Brian Redfern bredfern

View GitHub Profile
@bredfern
bredfern / jakesine.c
Created December 1, 2012 19:24 — forked from jacobjoaquin/jakesine.c
first Csound opcode
#include "csdl.h"
#include "jakesine.h"
int jakesine_init (CSOUND *csound, JAKESINE *p)
{
p->inc = *p->freq_in * csound->tpidsr;
p->phase = *p->phase_in * TWOPI;
return OK;
}
// force certain pages to be refreshed every time. mark such pages with
// 'data-cache="never"'
//
jQuery('div').live('pagehide', function(event, ui){
var page = jQuery(event.target);
if(page.attr('data-cache') == 'never'){
page.remove();
};
});
/*
Functional programming in C
```````````````````````````
This is an example of how to use executable memory to get partial function
application (i.e. bind1st()) in C. (Well, this actually only compiles as C++
since i'm using a varargs typedef, but there's no classes or templates.)
To proceed, we need to be comfortable with the cdecl and stdcall calling
conventions on x86, and just a little assembly.