This has been moved to https://github.com/dorfsmay/deadbeef
from vector import Vector | |
from math import pi | |
from PIL import Image, ImageDraw, ImageColor | |
import random | |
WIDTH = 1448 # Final image will be twice this, resolution low | |
HEIGHT = 1024 # for performance reasons (this also leaves some artifacts) | |
SS = 8 # Supersampling, for anti-aliasing | |
THICKNESS = 1 # Line thickness | |
RECURSION_LIMIT = 100 # Just for safety |
// Processing code by Etienne JACOB | |
// motion blur template by beesandbombs | |
// opensimplexnoise code in another tab might be necessary | |
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e | |
int[][] result; | |
float t, c; | |
float ease(float p) { |
This write-up details how I re-structure and organise StatisticsNZ CSVs. It makes no mention of how I handle particular data values and codes (e.g. datetimes, missing and confidential values). My practice changes a little between projects, but typically I end up with a structure along the following lines:
- I remove all footnotes and metadata.
- I separate data measured at different scales into different CSVs (e.g. meshblock data goes in a different file from area units).
- I remove all
total
rows. - I rename all columns with concise but meaningful shortnames so they are easier refer to in code.
- I generate a JSON file containing key metadata and mappings between my shortnames and the original long fieldnames.
DelaunayJL is an incremental 2D Delaunay triangulation algorithm implemented in Julia, it is robust and ~20% faster than CGAL, the C++ de-facto industry standard. And it's MIT Licensed! all links to code are below
The figure below shows how much time it takes to run a benchmark on my computer, an Intel Core i7-4800MQ CPU @ 2.7Ghz, 16GB RAM, Win8 64bit. The benchmark consists of inserting a number of points uniformly distributed. The benchmark is run 5 times for each number of points once for CGAL and once for Julia. The numbers of points used are 10K, 100K, 1M, and 10M. CGAL v4.4 was compiled with VS2013 64bit release mode, Julia is of version 0.3.0 Commit 7681878 (2014-08-20 20:43 UTC) x86_64-w64-mingw32 the delaunay code is here (see other gists of mine for complementing files... I'll compile this all into a library when I have the time)
import java.util.Map; | |
import java.util.Comparator; | |
import java.util.Collections; | |
int index = 0; | |
PImage pokemon, current; | |
PGraphics pie; | |
HashMap<Integer,Integer> colorMap; | |
ArrayList<Integer> colorByCount; |
#!/usr/bin/env bash | |
dir=$(dirname $0) | |
gconfdir=/apps/gnome-terminal/profiles | |
echo # This makes the prompts easier to follow (as do other random echos below) | |
######################## | |
### Select a profile ### | |
######################## |
# Class for managing multiple servers or anything with start() and stop() methods | |
class ServerRack(object): | |
def __init__(self, servers): | |
self.servers = servers | |
def start(self): | |
started = [] | |
try: |