Skip to content

Instantly share code, notes, and snippets.

View enjalot's full-sized avatar

Ian Johnson enjalot

View GitHub Profile
year lifeExpectancy
1960 48.58163415
1961 49.23004878
1962 49.84395122
1963 50.41885366
1964 50.95229268
1965 51.44136585
1966 51.88865854
1967 52.29821951
1968 52.67707317
@enjalot
enjalot / encodingTest.cpp
Created April 22, 2011 18:42 — forked from mathnathan/encodingTest.cpp
Video Networking
# include "highgui.h"
# include "cv.h"
# include <stdio.h>
# include <vector>
# include <string>
///blah
using namespace cv;
@enjalot
enjalot / index.html
Created October 1, 2011 20:25 — forked from ZJONSSON/index.html
Using data() enter and exit in D3
<!DOCTYPE html>
<html>
<head></head>
<body></body>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript">
// Define the SVG domain in a viewbox to get automatic resize to
// window. This is a good alternative to d3.scale for simple stuff
svg=d3.select("body")
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
@enjalot
enjalot / index.html
Created December 5, 2011 05:01 — forked from mbostock/.block
Square Circle Spiral Illusion II
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<style type="text/css">
body {
background: #888;
}
@enjalot
enjalot / gist:1821600
Created February 13, 2012 23:58 — forked from erikhazzard/gist:1821595
getbbox cs getcomputedlength
<html>
<meta charset='utf-8' />
<head>
</head>
<body>
<svg>
<text id="text_node" y="1em">
<tspan>You</tspan>
<tspan dx='.25em'>shall</tspan>
<tspan dx='.25em'>not</tspan>
@enjalot
enjalot / index.html
Created February 14, 2012 18:58 — forked from erikhazzard/index.html
d3 tspan append
<html>
<meta charset='utf-8' />
<head>
</head>
<body>
<svg>
<text id='text_node' y="20px" text-anchor="start" opacity="1">
<tspan>You</tspan>
<tspan dx='.5em'>shall</tspan>
<tspan dx='.5em' dy='.9em'>not</tspan>
@enjalot
enjalot / boid.js
Created March 30, 2012 23:29 — forked from enjalot/boid.js
spermboids
// Boid flocking based on http://harry.me/2011/02/17/neat-algorithms---flocking
var boid = (function() {
function boid() {
var position = [0, 0],
velocity = [0, 0],
w = 960,
h = 500,
gravityCenter = null,
gravityMultiplier = 1,
neighborRadius = 50,
@enjalot
enjalot / index.html
Created June 19, 2012 06:05 — forked from chrisbrich/index.html
Line Chart with defaults example
<!DOCTYPE html>
<html>
<head>
<title>Line Chart</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<link href="lineplot.css" rel="stylesheet" type="text/css">
</head>
<body>
<script type="text/javascript">
function linePlot() {
@enjalot
enjalot / client.js
Created July 9, 2012 22:30 — forked from nkhine/client.js
viewDidResize
function MyClient() {
var self = this,
width = $('#map').width(),
mapCanvasHeight = (width * 0.45);
this.init = function() {
self.drawMap();
self.drawMarker();
}