Skip to content

Instantly share code, notes, and snippets.

View jerluc's full-sized avatar
😵‍💫

Jeremy Lucas jerluc

😵‍💫
View GitHub Profile
@jerluc
jerluc / worldcup.csv
Created July 7, 2014 07:18
2014 World cup scores
date team_1 team_1_score team_2 team_2_score
2014-06-12 Brazil 3 Croatia 1
2014-06-13 Mexico 1 Cameroon 0
2014-06-17 Brazil 0 Mexico 0
2014-06-18 Cameroon 0 Croatia 4
2014-06-23 Cameroon 1 Brazil 4
2014-06-23 Croatia 1 Mexico 3
2014-06-13 Spain 1 Netherlands 5
2014-06-13 Chile 3 Australia 1
2014-06-18 Spain 0 Chile 2
@jerluc
jerluc / Resolve.java
Last active August 29, 2015 14:11
Resolving a deeplink on Android using a plain URI and the URX SDK
package my.cool.app;
import android.content.Context;
import com.urx.android.AndroidClient;
import com.urx.android.resolve.AndroidResolver;
import com.urx.core.ClientConfig;
import com.urx.core.resolution.UriResolve;
public class Resolve {
@jerluc
jerluc / lacey.py
Created August 31, 2015 06:30
Lacey's first program
def turtle(name, num):
for n in range(num):
if n < num-1:
print(name + ",")
else:
print(name)
turtle("Lacey Leeder", 10)
@jerluc
jerluc / ExactMatchPOC.java
Created May 2, 2012 02:44
Exact token pattern matching
public class ExactMatchPOC {
private static final String TOKEN_DELIMITER = " ";
private static final String PHRASE_DELIMITER = ",";
public static void main(String[] args) {
String[] phraseTokens = buildTokenHashArray(args[0]);
String[][] labelTokens = buildMultiTokenHashArray(args[1]);
int i;
@jerluc
jerluc / BrandRecommendation.scala
Created July 27, 2012 19:21
Brand Recommendation Prototype Using Scalding
import com.twitter.scalding._
import scala.util.matching.Regex
class BrandRecommandation(args : Args) extends Job(args) {
val brandData = Tsv(args("input"), ('userId, 'brandId, 'interactions))
val brandIncidence = brandData.groupBy('brandId) { _.size } rename { 'size -> 'brandIncidence }
val brandDataWithIncidence = brandData.joinWithSmaller('brandId -> 'brandId, brandIncidence)
@jerluc
jerluc / hello.rift
Last active December 16, 2015 05:08
Rift Source + PEG-generated AST XML
hello {
// Create our simple function
sum(a, b) => a + b
// Create a function to defer the computation
deferredSum(a, b) => => sum(a, b)
// Bind the evaluation of the computation in "myThread" to variable "a"
a := deferredSum(10, 20) @ myThread
// Print out the value once it's available
print(a)
}
@jerluc
jerluc / Markov.scala
Last active December 16, 2015 13:18
My first naive attempt at Markov chains
import util.Random
object Markov extends App {
// Just some long plain-text sources from Project Gutenberg
val sherlockHolmes = "http://www.gutenberg.org/cache/epub/1661/pg1661.txt"
val kingJamesBible = "http://www.gutenberg.org/cache/epub/10/pg10.txt"
@jerluc
jerluc / instructions.md
Last active December 17, 2015 22:19
These instructions are for my session on rapidly developing software on the Hadoop technology stack through the use of commonly-found test utilities.
@jerluc
jerluc / hadoop-installation.md
Last active December 21, 2015 23:19
Hadoop CDH3 setup

What you need

By now, you should have the following prerequisites installed and configured on your machine:

  • Ubuntu 12.04
  • Java (Oracle JDK 6; ensure $JAVA_HOME is set)
  • Git
  • Apache Maven

What you get

After successful installation, you should be setup for running:

  • Hadoop (local-mode + pseudo-distributed)
/*
Copyright 2012 Viktor Klang
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software