Skip to content

Instantly share code, notes, and snippets.

View s-j's full-sized avatar
😀
Better than ever

Simon Jonassen s-j

😀
Better than ever
View GitHub Profile
@s-j
s-j / Pyspark ALS.ipynb
Created October 1, 2018 12:12
Test Jupyter notebook gist
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import net.agkn.hll.*;
import com.clearspring.analytics.stream.cardinality.*;
/**
* A brief comparison of the cardinality estimator implementations
* from Clearspring and Agregated Knowledge.
**/
public final class CardinalityBench {
private CardinalityBench() { }
package com.simonj;
import java.util.Arrays;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
@s-j
s-j / Example.java
Last active August 29, 2015 13:56
Deserializing multi-level polymorphic types with Jackson.
import java.io.IOException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.google.common.base.Strings;
@s-j
s-j / .vimrc
Last active October 7, 2015 09:27
My .vimrc
set ruler
set backspace=indent,eol,start
set autoindent
set incsearch
set nocompatible
set scrolloff=4
set showcmd
set showmatch
set smartcase
set suffixes=.class,.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
@s-j
s-j / Ansi.java
Last active February 26, 2017 12:11
ANSI-colored prompt in Java.
/**
* Based on Santhosh Kumar T ANSI library distributed under GPL
*
* Original copyright (C) 2009 Santhosh Kumar T
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*