Skip to content

Instantly share code, notes, and snippets.

hertzsprung /
Created September 14, 2014 14:27
Check NetCDF installation
from netCDF4 import Dataset
from mpl_toolkits.basemap import Basemap
hertzsprung / Makefile
Last active August 29, 2015 14:21
SDL2/cairo cross compiler test with mingw
PKG_CONFIG := pkg-config
#SDL_CONFIG := sdl2-config
SDL_CONFIG := /usr/x86_64-w64-mingw32/bin/sdl2-config
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
SDL_LDFLAGS := $(shell $(SDL_CONFIG) --libs)
CAIRO_CFLAGS := $(shell $(PKG_CONFIG) cairo --cflags)
CAIRO_LDFLAGS := $(shell $(PKG_CONFIG) cairo --libs)
cairotest: cairotest.c
clang $(SDL_CFLAGS) $(SDL_LDFLAGS) $(CAIRO_CFLAGS) $(CAIRO_LDFLAGS) -o cairotest cairotest.c
hertzsprung /
Created July 29, 2015 10:38
MSc computing notes

Work through an exercise of processing a CSV file containing time series data on amount of sunshine.

Exercise requirements


On the day

  1. Plan conceptual steps together to create a flowchart on whiteboard
  • how to find and use existing code
hertzsprung /
Created July 28, 2011 21:32
package foo;
import static java.lang.invoke.MethodHandles.catchException;
import static java.lang.invoke.MethodHandles.publicLookup;
import static java.lang.invoke.MethodType.methodType;
public class Foo {
public void sayHello(String name) throws RuntimeException {
System.out.println("hello " + name);
throw new RuntimeException("boom!");
hertzsprung /
Created July 28, 2011 21:48
Assorted Java 7 features
package foo;
import static java.util.EnumSet.of;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
hertzsprung /
Created April 7, 2012 12:39
Test case for Hamcrest AllOf missing mismatch description
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.both;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.lessThan;
import org.junit.Test;
public class AllOfTest {
public void doesPrintMismatch() {
hertzsprung / pom.xml
Created May 5, 2012 17:30
Maven release plugin
hertzsprung / pom.xml
Created May 5, 2012 17:24
Maven source code management information
hertzsprung / pom.xml
Created May 5, 2012 17:35
Maven distribution management
<name>Sonatype Nexus snapshot repository</name>
<name>Sonatype Nexus release repository</name>
hertzsprung / pom.xml
Created May 5, 2012 17:38
Maven artifact signing