Skip to content

Instantly share code, notes, and snippets.

@dkuppitz
dkuppitz / Dnp1107Solution.cs
Created July 17, 2011 07:27
dotnetpro Contest 1107
namespace contest.submission
{
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using contest.submission.contract;
using contest.submission.contract.daten;
@dkuppitz
dkuppitz / flatten-example.js
Created April 28, 2012 11:29
Flatten JSON objects
var flatten, obj;
flatten = require ('./flatten');
obj = {
foo: 'bar',
bar: 'foo',
foobar: {
foo: 'foo',
bar: 'bar'
}
@dkuppitz
dkuppitz / contest.submission.cpp
Created April 30, 2012 00:12
Solution for DNP Contest 04/2012
#include "stdafx.h"
#include <iostream>
using namespace System;
using namespace System::Collections::Generic;
using namespace System::Diagnostics;
using namespace System::Runtime::InteropServices;
#pragma unmanaged
@dkuppitz
dkuppitz / trees.groovy
Last active December 15, 2015 15:19 — forked from espeed/trees.groovy
// Gremlin user-defined defined tree steps
// inTree() and outTree()
// by James Thornton, http://jamesthornton.com
// added ability to sort subtrees
// see https://groups.google.com/d/topic/gremlin-users/iCPUifiU_wk/discussion
// closure can't have the same name as the defined step
tree = { vertices ->
@dkuppitz
dkuppitz / 01-setup-server.sh
Last active December 15, 2015 18:29
Titan Movie Recommendation
#
# First: Start a new m1.large EC2 instance with Amazon Linux AMI
# Next: Copy/Paste all the following code
#
wget http://www.grouplens.org/sites/www.grouplens.org/external_files/data/ml-10m.zip
unzip ml-10m.zip
cp ml-10M100K/*.dat /tmp
rm -f ml-10m.zip
rm -rf ml-10M100K/
@dkuppitz
dkuppitz / life.cs
Created April 4, 2013 16:07
Developers Life in C#
namespace World
{
class Life
{
static int Main()
{
var developer = new Developer();
while (developer.IsAlive)
{
@dkuppitz
dkuppitz / link.groovy
Created April 5, 2013 02:54
Link 2 vertices in Gremlin
namespace TitanTest
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using MsgPack;
@dkuppitz
dkuppitz / Program.cs
Last active December 16, 2015 05:19
Simple C# Rexster Client
namespace TitanTest
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net.Sockets;
using MsgPack;
using MsgPack.Serialization;
@dkuppitz
dkuppitz / GraphOfGods.groovy
Created April 19, 2013 09:22
Create an in-memory Titan Graph with sample data (Graph of Gods)
config = new BaseConfiguration()
storage = config.subset("storage")
storage.setProperty("backend", "inmemory")
index = storage.subset("index").subset("search")
index.setProperty("backend", "elasticsearch")
index.setProperty("local-mode", true)
index.setProperty("client-only", false)
index.setProperty("directory", "/tmp/titan/es")