Skip to content

Instantly share code, notes, and snippets.

View jongwook's full-sized avatar

Jong Wook Kim jongwook

View GitHub Profile
@jongwook
jongwook / industry.cpp
Last active December 26, 2015 08:39
Trying to reproduce Yuji Ijiri's 1964 paper about business firm growth and size
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <algorithm>
#include <vector>
static const int SESSIONS = 10000;
static const double ALPHA = 0.25;
static const double BETA = 0.95;
@jongwook
jongwook / ZooKeeper.java
Last active January 2, 2016 02:19
Code snippet - wrapping Apache Curator's APIs with RxJava
import static com.google.common.collect.Lists.transform;
import static java.nio.charset.StandardCharsets.UTF_8;
import static rx.Observable.from;
import static rx.Observable.merge;
public Observable<String> watch(String path) {
return Observable.create(observer -> {
AtomicBoolean unsubscribed = new AtomicBoolean(false);
@jongwook
jongwook / amazon-free-tier.txt
Last active June 16, 2024 01:46
UnixBench results for various virtual hosting environments
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: ip-172-31-43-143: GNU/Linux
OS: GNU/Linux -- 3.14.35-28.38.amzn1.x86_64 -- #1 SMP Wed Mar 11 22:50:37 UTC 2015
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz (5000.1 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
13:44:50 up 43 min, 2 users, load average: 0.78, 0.62, 0.33; runlevel 3
@jongwook
jongwook / guitar.ino
Created June 9, 2014 19:03
Arduino MIDI guitar
#include <SoftwareSerial.h>
SoftwareSerial midi(2, 3);
// there are 6 strings
#define STRINGS 6
// and 5 frets available
#define FRETS 5
// input pins
@jongwook
jongwook / MapReduce.jl
Created September 23, 2014 13:48
Julia Hadoop Streaming
module MapReduce
function map(mapper::Function)
for line in eachline(STDIN)
tokens = split(strip(line), '\t')
for result in @task mapper(tokens...)
println(join(result,'\t'))
end
end
end

Keybase proof

I hereby claim:

  • I am jongwook on github.
  • I am jongwook (https://keybase.io/jongwook) on keybase.
  • I have a public key whose fingerprint is E14A B36E B437 7543 AC00 8239 68A3 BFB0 C835 178E

To claim this, I am signing this object:

@jongwook
jongwook / script.js
Created January 8, 2016 20:13
Workflowy inline images - Tampermonkey script
// ==UserScript==
// @name Workflowy Images
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://workflowy.com/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jongwook
jongwook / cdh-spark.sh
Created June 24, 2016 20:31
Scripts to build Spark according to the CDH version
#!/usr/bin/env bash
# Jenkins build parameters
TAG=v2.0.0-rc1
SNAPSHOT=false
BRANCH=branch-2.0
CDH=5.7.1
DEPLOY=false
# should abort when any command fails
package com.github.jongwook
import net.recommenders.rival.core.DataModel
import net.recommenders.rival.evaluation.metric.ranking.NDCG
import net.recommenders.rival.evaluation.metric.ranking.NDCG.TYPE
import org.apache.spark.SparkConf
import org.apache.spark.mllib.evaluation.RankingMetrics
import org.apache.spark.sql.SparkSession
import scala.util.{Failure, Success, Random, Try}