Skip to content

Instantly share code, notes, and snippets.

@cjwebb
cjwebb / ai-notes-1.markdown
Last active December 6, 2015 15:24
Notes on MIT 6.034 Artificial Intelligence

Lecture videos, programming assignments, and exam papers for [MIT's Artificial Intelligence course][course-url] are available online. These are my notes from "taking" the course.

[Lecture 1: Introduction and Scope][lecture-1]

This course, and every subject at MIT, is based around making models. [Professor Winston][prof-winston] explains that this course will teach:

Algorithms enabled by

Constraints evolved by

@cjwebb
cjwebb / pymeals_ttl_index.json
Created September 19, 2012 19:35
Pymeals User Invite TTL Index
{
"v" : 1,
"key" : { "expiry_time" : 1 },
"ns" : "pymeals.user_invites",
"name" : "expiry_time_1",
"expireAfterSeconds" : 1
}
@cjwebb
cjwebb / pymeals_user.bson
Created September 19, 2012 19:29
Pymeals User
{
"_id" : ObjectId("504ae6e2001b9c0548ab0b64"),
"password" : "$2a$12$vCew7zzXqtyRGKQV4xfSZ.KbmmCRMx.pVJD6DesTLrOvuUghB5Oeu",
"email" : "an_email@address.com",
"created_date" : ISODate(“2012-09-18T18:59:31.753Z")
}
@cjwebb
cjwebb / pymeals_user_invite.bson
Created September 19, 2012 19:22
Pymeals User Invite
{
"_id" : ObjectId(“505a1614001b9c1a9cb10803"),
"password" : "$2a$12$vCew7zzXqtyRGKQV4xfSZ.KbmmCRMx.pVJD6DesTLrOvuUghB5Oeu",
"expiry_time" : ISODate(“2012-10-21T18:59:31.753Z"),
"invite_code" : "an-invite-code",
"activation_code" : "cbcff14"
}
acorn squash
ale
alfalfa sprouts
allspice
almond
almond extract
almonds
amaretti
amaretto
anchovies
@cjwebb
cjwebb / recipes.cypher
Created August 25, 2015 14:44
Cypher to import BBC Food recipes into Neo4J
This file has been truncated, but you can view the full file.
MERGE (f:Food:Recipe {id: "e02e63be-2b7c-4bfe-a1a0-7d6153f24673", name: "Bread sauce", source_url: "http://www.bbc.co.uk/food/recipes/breadsauce_84755", source_name: "BBC Food", image_url: "http://ichef.bbci.co.uk/food/ic/food_16x9_448/recipes/breadsauce_84755_16x9.jpg", description: "This crowd-pleasing bread sauce recipe by Nigella Lawson is an easy extra for Christmas Day and is just as good served cold with leftovers. The recipe appears in Nigella's book Feast, published by Chatto & Windus."});
MERGE (f:Food{ name:"1 day-old loaf unsliced white bread"}) ON CREATE SET f.id = "d744762e-2351-480a-84fb-878d53b72992";
MATCH (r:Recipe {id: "e02e63be-2b7c-4bfe-a1a0-7d6153f24673"}),(f:Food{id:"d744762e-2351-480a-84fb-878d53b72992"}) CREATE (r)-[:CONTAINS]->(f);
MERGE (f:Food{ name:"1 litre/2 pints full-fat milk"}) ON CREATE SET f.id = "8840ab8d-61f4-4c7a-bcbe-cd607be10772";
MATCH (r:Recipe {id: "e02e63be-2b7c-4bfe-a1a0-7d6153f24673"}),(f:Food{id:"8840ab8d-61f4-4c7a-bcbe-cd607be10772"}) CREATE (r)-[:CONTAINS]-
@cjwebb
cjwebb / cassandra-cqlsh-errors.txt
Created December 2, 2014 16:55
Creating a table with a timestamp column, and then inserting data with a massive timestamp results in CQLSH errors when trying to remove the inserted data.
Creating a table with a timestamp column, and then inserting data with a massive timestamp results in CQLSH errors when trying to remove the inserted data.
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.1.0 | CQL spec 3.2.0 | Native protocol v3]
cqlsh> create keyspace test WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };
cqlsh> use test;
cqlsh:test> create table test.table1 (id int, time timestamp, primary key (id));
clqsh:test> insert into table1(id, time) values (1, 1000000000000000) ;
cqlsh:test> select * from table1;
@cjwebb
cjwebb / irclogger.go
Created November 20, 2014 20:04
Log into IRC and display chat
package main
import (
"net"
"net/textproto"
"fmt"
"log"
"bufio"
)
@cjwebb
cjwebb / country-codes.txt
Created August 18, 2014 09:47
Valid ISO 316601 2 Letter Country Codes
AC
AD
AE
AF
AG
AI
AL
AM
AN
AO
@cjwebb
cjwebb / product-s3.json
Created June 8, 2014 09:52
GET /product/s3
{
"id": "s3",
"name": "BLT",
"image": "img/sandwich/s3.jpg"
}