Skip to content

Instantly share code, notes, and snippets.


Dan Osipov danosipov

View GitHub Profile
View PipelineJob.scala
package com.danosipov.example
import java.nio.ByteBuffer
import java.util.Date
import cascading.tuple.Fields
import com.twitter.algebird.Aggregator.{prepareMonoid => sumAfter}
import com.twitter.algebird.{HLL, HyperLogLog, HyperLogLogMonoid}
import com.twitter.bijection.{AbstractBijection, Bijection, Injection}
import com.twitter.scalding._
View InteractionJob.scala
package com.danosipov.example
import java.util.Date
import com.twitter.scalding._
* Simple job to calculate the total of one-way interactions from users.
class InteractionJob(args: Args) extends Job(args) {
View AliceInAggregatorLand.scala
* To get started:
* git clone
* cd algebird
* ./sbt algebird-core/console
* Let's get some data. Here is Alice in Wonderland, line by line
View gist:028b3c1331bc102164c3
# A fatal error has been detected by the Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x00000001117ec53d, pid=10285, tid=21775
# JRE version: Java(TM) SE Runtime Environment (8.0_05-b13) (build 1.8.0_05-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.5-b02 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# J 12304 C2 scala.runtime.ScalaRunTime$.hash(Ljava/lang/Object;)I (30 bytes) @ 0x00000001117ec53d [0x00000001117ec500+0x3d]
danosipov / robolectric_sans_jarCache
Created Nov 9, 2013
Sample test run, prior to implementing cache
View robolectric_sans_jarCache
Running com.aweber.api.BaseCallbackTest
2ms spent in ./TestManifest.xml
WARNING: no system properties value for
285ms spent in opening JAR /Users/dano/.m2/repository/org/robolectric/android-all/4.1.2_r1-robolectric-0/android-all-4.1.2_r1-robolectric-0.jar
DEBUG: Loading resources for com.aweber from ./res...
136ms spent in values
* DocumentLoader.parse: 83ms
* org.robolectric.res.AttrResourceLoader: 4ms
* org.robolectric.res.PluralResourceLoader: 3ms
* org.robolectric.res.StyleResourceLoader: 7ms
View ScrollDisabledListView
public class ScrollDisabledListView extends ListView {
private int mPosition;
public ScrollDisabledListView(Context context) {
public ScrollDisabledListView(Context context, AttributeSet attrs) {
super(context, attrs);
danosipov / pigDemo
Last active May 6, 2017
Apache Pig demo script
View pigDemo
-- double dash denotes comments
-- $ denotes shell command
-- everything else is Pig Latin, executed in Grunt
-- Data set downloaded from
-- Load data into Hadoop
$ hadoop fs -put ./input.txt input.txt
$ hadoop fs -ls
$ hadoop fs -tail hdfs://localhost.localdomain:8020/user/cloudera/input.txt