Skip to content

Instantly share code, notes, and snippets.

@yying
yying / volume_meter.html
Created January 29, 2015 17:02
WebAudio volume meter using a MediaStream (can be easily applied to MediaStream from WebRTC)
<!DOCTYPE html>
<html lang="en">
<head>
<title> </title>
<link rel="stylesheet" type="text/css" href="http://cdn.jsdelivr.net/min/1.5/min.min.css">
<style>
body,textarea,input,select {
background:0;
border-radius:0;
font:16px sans-serif;

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 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
@xis19
xis19 / GzipUtils.java
Created November 18, 2019 06:32
Demo of GZIPInputStream, GZIPOutputStream + PipedInputStream, PipedOutputStream
import java.io.IOException;
import java.io.InputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;