Skip to content

Instantly share code, notes, and snippets.

@hubte1g
hubte1g / example.java
Last active September 15, 2015 19:39 — forked from ZenBowman/example.java
Using the Hive Thrift Client in Java and Scala - an example
import junit.framework.TestCase;
import org.apache.hadoop.hive.service.HiveClient;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
import java.util.List;
/**
@hubte1g
hubte1g / terr_RinR.r
Last active August 29, 2015 14:14 — forked from datalove/terr_RinR.r
# Download: http://tap.tibco.com/ -> "Samples" tab -> RinR -> "Try Now" button
# Docs: http://docs.tibco.com/pub/enterprise-runtime-for-R/2.5.0/doc/html/RinR/RinR-package.html
########################################
# Setup
########################################
library(RinR)
library(Sdatasets)
@hubte1g
hubte1g / basicmap.r
Last active August 29, 2015 14:09 — forked from cdesante/basicmap.r
doInstall <- TRUE
toInstall <- c("maps", "ggplot2")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
library(ggplot2)
library(maps)
Prison <- read.csv("http://www.oberlin.edu/faculty/cdesante/assets/downloads/prison.csv")
head(Prison)
@hubte1g
hubte1g / README.md
Last active August 29, 2015 14:08 — forked from JoshRosen/README.md

Confusing Scala serialization puzzle

This writeup describes a tricky Scala serialization issue that we ran into while porting Spark to Scala 2.11.

First, let's create a factory that builds anonymous functions:

class FunctionFactory extends Serializable {
  // This method returns a function whose $outer scope is this class.
  // Note that the function does not reference any variables in this scope,