Skip to content

Instantly share code, notes, and snippets.

View freeeve's full-sized avatar

Eve Freeman freeeve

  • Linden, VA
View GitHub Profile
@jyemin
jyemin / MongoDBWithJodaExample.java
Created July 16, 2014 16:57
An example showing how to integrate support for Joda DateTime into the MongoDB Java driver.
import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;
import com.mongodb.MongoClient;
import org.bson.BSON;
import org.bson.Transformer;
import org.joda.time.DateTime;
import java.net.UnknownHostException;
import java.util.Date;
== Chess Games and Positions in Neo4j
:neo4j-version: 2.0.0
:author: Eve Freeman
:twitter: @wefreema
:tags: chess
The goal is to load a bunch of chess games into Neo4j for further analysis. Scores listed are Stockfish's take on a position after a 25 move horizon (but this number can be deepened as the graph is filled out or as more processing is done). Positions can also be loaded as alternative moves (not connected to a game) based on suggestions from Stockfish. The positions are recorded as link:http://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation[FEN], a human-readable/compressed chess board state notation.
=== Schema diagram
@jonhyman
jonhyman / BSONIdGenerator.h
Last active April 17, 2018 18:32
BSON Object Id generator in Objective-C
/*
# Copyright 2018 Jon Hyman
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
package util
import play.cache.CacheImpl
import models.salatContext._
import scala.collection.JavaConversions.asJavaMap
import com.mongodb.casbah.Imports._
import com.mongodb.WriteResult
import java.io._
import play.jobs.{Every, Job}
import controllers.ErrorReporter
@justmoon
justmoon / bintest.js
Created July 14, 2011 15:22
MongooseJS Binary Example
var crypto = require('crypto');
var mongoose = require('./');
mongoose.connect('mongodb://localhost/bintest');
var Schema = mongoose.Schema;
var HashSchema = new Schema({
id : String
;annotation syntax
(import [java.lang.annotation Retention RetentionPolicy Target ElementType]
[javax.xml.ws WebServiceRef WebServiceRefs])
(definterface Foo (foo []))
;annotation on type
(deftype ^{Deprecated true
Retention RetentionPolicy/RUNTIME
javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"]