Skip to content

Instantly share code, notes, and snippets.

View sooheon's full-sized avatar

Sooheon Kim sooheon

View GitHub Profile
@sooheon
sooheon / mhfp_sampling.py
Created November 5, 2020 04:43
mhfp usage example
import pandas as pd
from mhfp.encoder import MHFPEncoder
from mhfp.lsh_forest import LSHForestHelper
from tqdm import tqdm
from joblib import Parallel, delayed, cpu_count
def pmap(pickleable_fn, data, n_jobs=cpu_count() - 1, verbose=1, **kwargs):
"""
Parallel map using joblib.

Keybase proof

I hereby claim:

  • I am sooheon on github.
  • I am sooheon (https://keybase.io/sooheon) on keybase.
  • I have a public key ASDjpGj2py5IX3nusI9B2XGxpkfWAoviJ5wsk9nggCPV_wo

To claim this, I am signing this object:

(ns allstate-claims.handle-data
(:require [clojure-csv.core :as csv]
[clojure.core.reducers :as r]
[clojure.java.io :as io]
[clojure.string :as str]
[huri.core :as h]
[semantic-csv.core :as sc]
[clojure.edn :as edn]
[taoensso.nippy :as nippy]
[taoensso.nippy.compression :as ncomp])
* Before exam
Here is what you should do. The night before do not eat anything spicy (for obvious reasons). If you think you won't be able to sleep pop a sleep aid at like 8:30 - 9:00pm. Sleep is crucial for your ability to think clearly. Set your alarm before the exam so you can get in a workout. This is absolutely mandatory. You need to sweat out all your nervous energy. You need to give yourself a solid 30-60 minute cardio session. You can walk the entire time if you are not accustomed to exercising. Then eat a big ass breakfast. Bacon, eggs, potatoes, tomato, and avocado. Fuel up. It is a long test. Once you are taking the test if you do not know how to solve the problem after the initial read through mark it and move forward. Kill all the questions you are sure about the answer then revert back to the ones that you were unsure about. There are 5 pilot questions. The magic number is historically 21 correct to pass. I took the test in March of 2016. Passed. I was an earned level of 8.98 on Adapt and felt g
;; planck script for checking dcss win stats.
;; `brew install planck', then run this script with `planck crawl_won.cljs $USER'.
;; Currently only checks default location of logfile.
(ns crawl-won
(:require [planck.core :refer [*command-line-args* slurp]]
[clojure.string :as str]
goog.string.format))
(defn filepath [user]
(defun spacemacs/smart-move-beginning-of-line (arg)
"Move point back to indentation of beginning of line.
Move point to the first non-whitespace character on this line.
If point is already there, move to the beginning of the line.
Effectively toggle between the first non-whitespace character and
the beginning of the line.
If ARG is not nil or 1, move forward ARG - 1 lines first. If
point reaches the beginning or end of the buffer, stop there."
(interactive "^p")
(setq arg (or arg 1))
(set-env!
:source-paths #{"sass" "src/cljs"}
:resource-paths #{"resources"}
:dependencies '[[adzerk/boot-cljs "1.7.228-1" :scope "test"]
[adzerk/boot-cljs-repl "0.3.0" :scope "test"]
[adzerk/boot-reload "0.4.5" :scope "test"]
[pandeiro/boot-http "0.7.2" :scope "test"]
[com.cemerick/piggieback "0.2.1" :scope "test"]
[org.clojure/tools.nrepl "0.2.12" :scope "test"]
[weasel "0.7.0" :scope "test"]
@sooheon
sooheon / app.cljs
Created February 3, 2016 17:19
cljsjs use
(ns norgay.app
(:require [reagent.core :as r]
[cljsjs.d3]
[cljsjs.nvd3]))
(defn line-chart
[line-chart-data]
(.addGraph js/nv
(fn []
(let [chart (.. js/nv -models lineChart
(defn dropdown [{:keys [value] :as options} choices]
(reagent/create-class
{:component-did-mount
(fn [component]
(let [dom-node (reagent/dom-node component)]
(.dropdown (js/$ dom-node) #js {:match "text"
:onChange (fn [new-value]
(reset! value new-value))})))
:component-did-update
@sooheon
sooheon / handlers.cljs
Created July 3, 2015 08:35
re-frame typeahead attempt from reagent-forms
(ns kulive.handlers
(:require [reagent.core :as reagent]
[re-frame.core :as rf]
[kulive.db :as db]))
(defn set-typeahead-hidden
[db [_ bool]]
(assoc-in db [:typeahead :hidden?] bool))
(re-frame/register-handler :set-typeahead-hidden set-typeahead-hidden)