Skip to content

Instantly share code, notes, and snippets.

View ko-lem's full-sized avatar
🏠
Working from home

Lem Ko ko-lem

🏠
Working from home
View GitHub Profile
/**
* @param {number[][]} buildings
* @return {number[][]}
*/
var getSkyline = function(buildings) {
var edges = calcSortedEdges(buildings);
var skyline = [];
var heights = new SlowPriorityQueue();
var currHeight = 0;
heights.add(0);
@ko-lem
ko-lem / setup-kaggle.sh
Created January 10, 2018 04:47
Setup VPS for kaggle work
git clone https://github.com/lemonkoala/utils.git
echo "source ~/utils/_all.bash" > ~/.bashrc
source ~/.bashrc
mkdir jupyter
docker pull kaggle/python
docker run \
-it \
-d \
-p 8888:8888 \
@ko-lem
ko-lem / hist.R
Created September 3, 2014 15:48
Scripts for Criteo Challenge
setwd('~/kaggle/criteo')
library(ggplot2)
library(scales)
probs <- read.csv('submit/submit-8.csv')
num_less <- length(which(probs$Predicted < 0.5))
num_more <- length(which(probs$Predicted > 0.5))
num_less / (num_less + num_more)
@ko-lem
ko-lem / explore.R
Last active August 29, 2015 14:04
Exploring DepEd Enrollment Data
require(ggplot2)
require(reshape)
require(scales)
setwd("~/Dropbox/Projects/deped-enrollment")
which.data <- 'elementary' # elementary or secondary
num.enrollees <- read.csv(paste('data/num-enrollees-', which.data, '.csv', sep=''))
@ko-lem
ko-lem / analysis.R
Last active August 29, 2015 13:56
Analysis of Swertres lotto results.
setwd("~/Dropbox/Projects/suertres-analysis/")
data <- read.csv("data/processed/suertres.csv", header=TRUE,
colClasses=c(rep("factor", 6), "integer"))
data$date <- as.Date(data$date, format= "%m/%d/%Y")
length(data)
length(data[,1])
@ko-lem
ko-lem / Preferences.sublime-settings
Last active August 29, 2015 13:56
My settings file for sublime text 2
{
"word_wrap": false,
"fade_fold_buttons": false,
"highlight_line": true,
"font_size": 9,
"line_padding_bottom": 1,
"line_padding_top": 1,
"tab_size": 2,