Skip to content

Instantly share code, notes, and snippets.

View ryanswanstrom's full-sized avatar
🏠
South Dakota

Ryan Swanstrom ryanswanstrom

🏠
South Dakota
View GitHub Profile
@ryanswanstrom
ryanswanstrom / OrientDBSpeed.java
Created December 3, 2010 21:37
This is a file for testing the speed of OrientDB
package orienttest;
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import com.orientechnologies.orient.core.db.graph.ODatabaseGraphTx;
import com.orientechnologies.orient.core.db.graph.OGraphVertex;
import com.orientechnologies.orient.core.db.object.ODatabaseObjectTx;
import com.orientechnologies.orient.core.db.record.ODatabaseColumn;
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert;
import com.orientechnologies.orient.core.record.impl.ODocument;
@ryanswanstrom
ryanswanstrom / Mashup.java
Created December 13, 2010 21:00
This code demonstrates how to make web service calls with the Play Framework.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package controllers;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.util.ArrayList;
@ryanswanstrom
ryanswanstrom / Login.java
Created December 13, 2010 21:19
This class shows some code for the callback of a Janrain (formerly Rpx Now) login using the Play Framework
package controllers;
import com.google.gson.JsonElement;
import play.Play;
import java.util.Properties;
import play.libs.WS;
import play.libs.WS.WSRequest;
import play.mvc.Controller;
/**
@ryanswanstrom
ryanswanstrom / SamplePage.html
Created December 20, 2010 20:48
This is a sample page used with the Play Framework. It demonstrates dynamic title, forms, and errors.
#{extends 'main.html' /}
#{set title: "Results: " + iters + ": " + mongoSecs /}
<h1>Speed Results - ${iters} iterations</h1>
<h3>MongoDB (Morphia) </h3>
${mongoSecs} seconds
@ryanswanstrom
ryanswanstrom / Neo4jAncestor
Created September 16, 2011 16:43
Find a common ancestor with Neo4j, this is not highly optimized.
package neotest;
import hackerunderground.NanoTimer;
import java.util.Iterator;
import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
@ryanswanstrom
ryanswanstrom / forms.css
Created November 13, 2011 21:17
Acss for input forms
@charset "UTF-8";
/* ** ** forms ** ** */
form fieldset {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
padding: 10px;
border: 1px solid #eee;
background-color: #f1f1f1;
}
@ryanswanstrom
ryanswanstrom / login.html
Created November 13, 2011 21:21
An example of a form using the previous style
<section class="cols cols4">
<article class="col first"> &nbsp; </article>
<article class="col col2" >
#{form @authenticate()}
<fieldset class="s_column">
<legend>Login</legend>
@ryanswanstrom
ryanswanstrom / SortMapByValue.java
Created March 29, 2012 02:51
Here are 2 functions to sort a Map by the value instead of the key.
/**
* This method will return a sorted Map
* @param unsortMap
* @return
*/
private static Map<String, Integer> sortMapByValue(Map<String, Integer> unsortMap) {
List<Map.Entry<String, Integer>> list = new LinkedList(unsortMap.entrySet());
//sort list based on comparator
@ryanswanstrom
ryanswanstrom / datasciencejobs.txt
Created March 29, 2012 02:57
A collection of 16 data scientist job posts
Job Category: IT
Location: United States, WA, Redmond
Job ID: 786045
Product: (Not Product Specific)
Division: IT
The Data & Decision sciences Team within technology Office in MSIT, helps drive actionable business intelligence through advanced statistical modeling and business analytics, throughout Microsoft. The team focuses on enterprise level engagement, where advanced data mining and modeling skills are needed to find business insights. We have a strong team of experienced statistician with an average experience of 15+ years in various industries. Currently we are expanding our work in areas of simulation, system modeling and text mining, to support our internal clients. Our goal is to support business performance enabled through data analysis, statistical modeling - resulting into business impact. Candidate will be expected to work with internal clients on analytic projects and identify potential improvement opportunities. The candidate must possess a passion for advanced analytics and skills in areas of
@ryanswanstrom
ryanswanstrom / JobAnalysis.java
Created March 29, 2012 03:17
A Java class to do some very basic analysis of a list of data scientist job postings.
package com.swgoof.datascience.job;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;