Skip to content

Instantly share code, notes, and snippets.

View jongwook's full-sized avatar

Jong Wook Kim jongwook

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jongwook
jongwook / truncate.py
Last active April 20, 2018 00:07
Truncating the last 7 bits of the weights in a saved Keras model
import argparse
import h5py
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('input')
parser.add_argument('output')
args = parser.parse_args()
with h5py.File(args.output, 'w') as out:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/**
* 위상정렬 구현
* @tparam T 노드의 ID 가 될 타입
*/
class TopologicalSort[T] {
class CycleFoundException extends RuntimeException("At least one cycle found in the graph")
/** edge 목록에서 incoming edges가 없는 vertex 를 찾는다. */
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}
@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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 */

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 / 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