This file contains hidden or 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
// NEEDS WORK!!! | |
// I have no doubt that there are memory leaks in here | |
#include <Ecore.h> | |
#include <fcntl.h> | |
#include <linux/joystick.h> | |
#include <libudev.h> |
This file contains hidden or 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
root@host:/srv# cdebootstrap squeeze squeeze | |
root@host:/srv# mount -o bind /proc squeeze/proc | |
root@host:/srv# chroot squeeze | |
root@host:/# . etc/environment | |
root@host:/# export LANG=C | |
root@host:~# apt-get update | |
root@host:~# apt-get -y install libgc1c2 libpcre3 libgl1-mesa-glx | |
root@host:/# cd | |
root@host:~# wget -O- http://www.haxenme.org/releases/NME-3.4.2-Linux.tar.gz | tar -xzO | sed 's/sudo //g' > nme-installer.sh | |
root@host:~# sh nme-installer.sh |
This file contains hidden or 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
#!/bin/sh | |
cd ~/monitor | |
interval=15 | |
columns=20 | |
pidsfile=/tmp/benjaminr-monitor-pids-$$ | |
statusfile=/tmp/benjaminr-monitor-status-$$ |
This file contains hidden or 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
// gcc foo.c $(pkg-config --cflags --libs glew gl) -lglut | |
#include <GL/glew.h> | |
#include <GL/glut.h> | |
void display() { | |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | |
glutSolidSphere(1, 8, 8); | |
glutSwapBuffers(); | |
} |
This file contains hidden or 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 <GL/glew.h> | |
#include "shader.h" | |
// http://en.wikipedia.org/wiki/Vertex_Buffer_Object#Example_usage_in_C_Using_OpenGL_3.x_and_OpenGL_4.x | |
char* file2buf(char *file) { |
This file contains hidden or 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 GL | |
#include "glsl.h" | |
void glsl_setup(glsl_program *program) { | |
int gl_program = program->gl_program = glCreateProgram(); | |
int i; | |
for (i = 0; i < program->n_shaders; i++) { | |
glsl_shader *shader = &program->shaders[i]; |
This file contains hidden or 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
from math import * | |
# settings | |
n = 4 | |
radii = [1/2.0 * sqrt((2.0 ** i - 1) / (2.0 ** n - 1)) for i in range(1, n + 1)] | |
# calculate bezier |
This file contains hidden or 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
CONTENT = $(addsuffix .html,$(addprefix http/,$(notdir $(wildcard content/*)))) | |
all: $(CONTENT) http/index.html | |
clean: | |
rm -r http | |
mkdir http | |
http/%.html: content/% script.content.html.sh template.content.html | |
mkdir -p $(dir $@) |
This file contains hidden or 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
/* Finished crunching numbers... . | |
* | |
* Best here would require a processor array capable of performing | |
* 32 operations in parallel to break even performance-wise. | |
* | |
* Scalability above that floor looks fair, but the trade-off in | |
* power consumption is intense. | |
* | |
* Serial processing on a single core and just waiting for a | |
* delayed result looks like a far more promising approach to this |
This file contains hidden or 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
# losetup --show -f /path/to/disk-image | |
/dev/loop0 | |
# partx -a /dev/loop0 | |
# ls /dev/loop0* | |
/dev/loop0 /dev/loop0p4 | |
# partx -d /dev/loop0 | |
partx: /dev/loop0: error deleting partitions 1-3 | |
# losetup -d /dev/loop0 |