Skip to content

Instantly share code, notes, and snippets.

echo "Waiting for docker daemon to start up:"
until /usr/bin/docker ps 2>&1| grep STATUS>/dev/null; do sleep 1; done; >/dev/null
/usr/bin/docker ps -a | grep sandbox
if [ $? -eq 0 ]; then
/usr/bin/docker start sandbox
docker run -v hadoop:/hadoop --name sandbox --hostname "" --privileged -d \
-p 6080:6080 \
-p 9090:9090 \

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
zhelezoglo / gist:c6078587d733ea24527cfa7cc6196203
Created Aug 9, 2016 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
View gist:c6078587d733ea24527cfa7cc6196203
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
zhelezoglo / latency.txt
Created Aug 7, 2016 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
zhelezoglo / gist:887bd5cb2a43040f4011
Created Feb 27, 2016 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
View gist:887bd5cb2a43040f4011
  1. General Background and Overview
View printBinaries.scala
val n = 5
val ss: Seq[String] = 0 to math.pow(2, n).toInt - 1 map((x: Int) => x.toBinaryString)"%${n}s", _).replace(' ', '0')).foreach(println)
import java.util.Arrays;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import javax.swing.JOptionPane;
import javax.xml.bind.DatatypeConverter;
import javax.crypto.IllegalBlockSizeException;
public class AdministrationEmployee extends Employee {
public AdministrationEmployee(String name) {
super(name, Employee.TEMPORARY, 0, "Administration");
public double getSalary() {
return 18000;
find . -name target -type d -exec rm -rf {} \;