This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h>//exit | |
#include <stdio.h> | |
#include <pthread.h> | |
#include <netdb.h> //NI_NUMERICHOST | |
#include <string.h>//strlen | |
#include <unistd.h>//read write close fork | |
#define ss2sa(ss) ((struct sockaddr *)(ss)) | |
#define $(X) if((err=(X))<0)die(__LINE__,err) | |
#define Write(A,B) write(A,B,strlen(B)) | |
#define Read(A,B) len=read(A,B,sizeof(B));buf[len]=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
http://bm98.yaneu.com/bm98/bmsformat.html | |
http://fileformats.wikia.com/wiki/Be-Music_Script | |
http://mrqqn.net/dotclear/public/beatmaker/bms-specification.txt | |
http://hitkey.nekokan.dyndns.info/cmds.htm | |
*/ | |
#include <malloc.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <SDL/SDL.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <GL/gl.h> | |
#include <GL/glext.h> | |
#include <GL/wglext.h> | |
#include <sys/time.h> | |
#define COUNT(A) (sizeof(A)/sizeof(A[0])) | |
#define BLOC_EXIST (1<<0) | |
#define BLOC_COLOR (1<<1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
char* headers[]={ | |
"ID3", | |
"GIF89", | |
"‰PNG", | |
"OggS", | |
"ÿØÿà", | |
"BM6x", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <X11/X.h> | |
#include <GL/gl.h> | |
#include <GL/glx.h> | |
GLuint texture[1]; | |
int initGL(GLfloat width,GLfloat height){ | |
uint8_t pixels[32*32*3]; | |
FILE*f=fopen("sprite2.bmp","rb"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os,re,sys,json,errno,urllib2,urllib,threading | |
from fuse import FUSE, FuseOSError, Operations | |
class MyWebsite(Operations): | |
def __init__(self, root): | |
self.root = root | |
self.files = {} | |
self.cache = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <alloca.h> /*needed (yet not included) by asoundlib in c99*/ | |
#include <alsa/asoundlib.h>/* build with -lasound */ | |
#include <stdint.h> | |
#define $(x) if ((x) < 0) { fprintf(stderr, "Error:%s", # x); return -1; } | |
#define MIN(A, B) ((A) < (B) ? (A) : (B)) | |
typedef struct { | |
char RIFF[4]; | |
uint32_t ChunkSize; | |
char WAVE[4]; | |
char fmt[4]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/ioctl.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <stdbool.h> | |
#include <string.h> | |
#define POS(ROW,COL) printf("\033[%i;%iH", ROW, COL) | |
struct winsize w; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <json-c/json.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stddef.h> | |
typedef enum{ | |
diff_none, | |
diff_type, | |
diff_value, | |
diff_removed, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <inttypes.h> | |
#include <stdio.h> | |
//#include "klist.h" | |
#include "khash.h" | |
#define kh_forall(h) for(khint_t __i=kh_begin(h);__i!=kh_end(h);++__i)if(kh_exist(h,__i)) | |
#define kh_diff(name, old, new, on_add, on_keep, on_del)\ | |
kh_forall(new){/*find added(exist in new, not in old) and kept(exist in both) entries */\ | |
khiter_t __j = kh_get(name, old, kh_key(new,__i));\ | |
if((__j==kh_end(old))||(!kh_exist(old,__j))){on_add;}else{on_keep;}\ |
OlderNewer