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 <malloc.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <sys/prctl.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
#!/usr/bin/python2 | |
# vim: set fileencoding=utf-8 syntax=python tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: | |
import os, os.path, psutil | |
def procenv(pid): | |
try: | |
env_fd = open(os.path.join('/proc', str(pid), 'environ'), 'r') | |
environ = env_fd.read() | |
env_fd.close() |
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
GLuint load_gl_shader_from_sources( | |
GLenum shader_unit, | |
char const * const * const sources ) | |
{ | |
GLuint shader = glCreateShader(shader_unit); | |
if( !shader ) { | |
goto failed_shader; | |
} | |
size_t n_sources = 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
void | |
cubehelix( | |
size_t const n_steps, | |
uint8_t * const out_lut, /* 3 * n_steps elements, r8b8g8 */ | |
double const start, /* start color */ | |
double const rotations, | |
double const hue, | |
double const gamma ) | |
{ | |
size_t i; |
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> | |
typedef long MYenum; | |
enum { | |
SINGLES, | |
PAIRS, | |
TRIPLES, | |
}; |
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 <GL/glut.h> | |
#define local_GL_MAX_3D_TEXTURE_SIZE 0x8073 | |
int main(int argc, char *argv[]) | |
{ | |
glutInit(&argc, argv); | |
glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL | GLUT_DOUBLE); | |
glutCreateWindow("Max 3D texture size"); |
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> | |
#include <stdio.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <sys/wait.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 <stdio.h> | |
#include <GL/gl.h> | |
#include <GLT/multierror.h> | |
void gltPrintMultiError(char const * const prefix) | |
{ | |
GLenum err; | |
while( (err = glGetError()) != GL_NO_ERROR) { | |
switch( err ) { |
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
""" | |
Interactive tool to draw mask on an image or image-like array. | |
Adapted from matplotlib/examples/event_handling/poly_editor.py | |
""" | |
import numpy as np | |
# import matplotlib as mpl | |
# mpl.use('tkagg') |
NewerOlder