Genomics - A programmer's guide.
Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.
import numpy as np | |
import pyarrow as pa | |
import pyarrow.feather as pf | |
import pandas as pd | |
dtypes = ['i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8', 'f4', 'f8'] | |
strings = ['a', 'bc', 'de', 'efgh', 'five'] | |
cols = {d: np.ones(dtype=d, shape=(20)) for d in dtypes} |
Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.
////////////////////////////////////////////////////////////////////////////////////////// | |
// | |
// Example Exif thumbnail extractor. | |
// | |
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
//////////////////////////////////////////////////////////////////////////////// | |
// | |
// Example of converting stb_image to a libjpeg-style background process. | |
// This enables you to stream JPEG files from the internet and interleave | |
// decoding time without frameout on the main thread. | |
// | |
// The example uses three parts of the C++11 threads API. | |
// 1) std::async This is used to run the loader in its own thread. | |
// 2) std::mutex This is used to protect the members of the class from race | |
// conditions. |
#define GL_GLEXT_PROTOTYPES 1 | |
#include <SDL2/SDL.h> | |
#include <SDL2/SDL_opengles2.h> | |
int main() { | |
auto window = SDL_CreateWindow( | |
"triangle", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, | |
512, 512, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | |
); |
#include <stdio.h> | |
#include <libexif/exif-loader.h> | |
// Note: no error handling and no cleanup for clarity. | |
int main() | |
{ | |
ExifLoader *loader = exif_loader_new(); | |
exif_loader_write_file(loader, "IMG_20170422_132409.jpg"); | |
ExifData *ed = exif_loader_get_data(loader); | |
ed = exif_loader_get_data(loader); |
import time | |
import sdl2 | |
import openvr | |
import numpy | |
from OpenGL.GL import * | |
from OpenGL.GL.shaders import compileShader, compileProgram | |
from openvr.glframework import shader_string | |
from sdl2 import * |
<html> | |
<head> | |
<script> | |
function main() { | |
var canvas = document.getElementById("myGLCanvas"); | |
try { | |
gl = canvas.getContext("webgl"); | |
} catch(e) { | |
console.log(e); | |
} |