Skip to content

Instantly share code, notes, and snippets.

View wookay's full-sized avatar
📟
갛낲닽랔맟밪상앗잡참칼탇판학

WooKyoung Noh wookay

📟
갛낲닽랔맟밪상앗잡참칼탇판학
View GitHub Profile
@wookay
wookay / test_period.jl
Last active August 29, 2015 14:19
12-hour clock format
# load Dates module
import Base.Dates: AbstractTime, Month, Millisecond, Year, TimeType, Day, Hour, Minute, Second, Period, periodisless, yearmonthday, days, hour, minute, second, millisecond, default
import Base.Dates: DelimitedSlot, Slot, DayOfWeekSlot, slotparse
import Base.Dates: DateFormat, duplicates
Base.show(io::IO,x::DateTime) = print(io,string(x))
DateTime(dt::AbstractString,df::DateFormat=ISODateTimeFormat) = DateTime(parse(dt,df)...)
function getslot(x,slot::DelimitedSlot,df,cursor)
@wookay
wookay / gist:657a6c2adefc11f9312c
Created April 17, 2015 07:22
Picture code illustration for 3D face analysis
# https://mrkulk.github.io/www_cvpr15/1999.pdf
function PROGRAM(MU, PC, EV, VERTEX_ORDER)
# Scene Language: Stochastic Scene Gen
face=Dict();
shape = [];
texture = [];
for S in ["shape", "texture"]
for p in ["nose", "eyes", "outline", "lips"]
coeff = MvNormal(0,1,1,99)
@wookay
wookay / unary-function-chainer.jl
Created March 20, 2015 08:01
unary-function-chainer.jl
# http://www.codewars.com/kata/unary-function-chainer
# http://stackoverflow.com/questions/28713934/how-to-implement-unary-function-chainer-using-python
f1 = (x) -> x*2
f2 = (x) -> x+2
f3 = (x) -> x^2
chained(funcs) = reduce((f,g)->(n)->n|>f|>g, funcs)
@assert 4 == chained([f1 f2 f3])(0)
$ brew cask install basictex
$ sudo tlmgr update --self
$ sudo tlmgr install latexmk
@wookay
wookay / prize.scala
Created January 9, 2015 14:35
prize.scala
class Prize {
var winners: List[Int] = List.empty
def play(list: List[Int]) : List[List[Int]] = {
var w = List[Int]()
var l = List[Int]()
for (idx <- 0 until list.length/2) {
val i = idx*2
if (list(i) < list(i+1)) {
w :+= list(i)
@wookay
wookay / Rope.scala
Created December 19, 2014 13:19
Rope.scala
trait UnitTest {
def assert_equal(expected :Int, got :Int) {
expected==got match {
case true =>
println("passed: " + expected)
case _ =>
println("Assertion failed\nExpected: " + expected + "\nGot: " + got)
}
}
}
@wookay
wookay / test_hangul.swift
Created December 3, 2014 10:59
test_hangul.swift
//
// test_hangul.swift
// Hangul
//
// Created by WooKyoung Noh on 12/1/2014.
// Copyright (c) 2014 factorcat. All rights reserved.
//
@objc(TestHangul)
class TestHangul : NSObject {
@wookay
wookay / journal.py
Created December 1, 2014 06:34
journal.py
#!/usr/bin/python
#-- coding: utf-8 --
# textutil -convert txt Journal*.docx
import numpy as np
import pandas as pd
def regul(s):
$ julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.4.0-dev+1148 (2014-10-20 05:03 UTC)
_/ |\__'_|_|_|\__'_| | Commit 6290d34* (0 days old master)
|__/ | x86_64-apple-darwin13.4.0
@wookay
wookay / gist:06dd4dc043829f37d092
Created July 25, 2014 14:59
mecab-ko-dic configure
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for mecab-ko-dic 1.6.1.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.