Instantly share code, notes, and snippets.

View join.awk
# AWK program to compare time complexity of joining strings using a
# simple O(N^2) algorithm and a slightly more complex O(N log N) one.
# Join array elements, separated by sep: O(N^2) version
function join1(a, sep, i, s) {
for (i = 1; i+1 in a; i++) {
s = s a[i] sep
if (i in a) {
s = s a[i]
View mandelbrot.go
// Print the Mandelbrot set on stdout
package main
import (
const (
def distance(s, t, cache=None):
"""Return minimum edit distance between s and t, where an edit
is a character substitution, deletion, or addition.
if not s:
return len(t)
if not t:
return len(s)
if cache is None:
View connect4.go
// A little "Connect Four" game
package main
import (
View server.go
// Simple HTTP server with regex-based router
package main
import (
View tiny-vdom-speed.html
<head><title>More speed tests</title></head>
<h1>More speed tests</h1>
<div id="main"></div>
{% for item in items %}
<li>item: {{ item }}</li>
View test_dom.html
<title>Test speed of various methods of building DOM</title>
Test speed of various methods of building DOM
View is_none_bytecode.diff
diff --git a/Include/opcode.h b/Include/opcode.h
index 99c3b0ef81..dceedc662a 100644
--- a/Include/opcode.h
+++ b/Include/opcode.h
@@ -12,6 +12,8 @@ extern "C" {
#define ROT_THREE 3
#define DUP_TOP 4
#define DUP_TOP_TWO 5
+#define COMPARE_IS_NONE 6
"""Efficient sliding-window sorting of time-series data in CSV file.
Demo for
Tested on Python 3.5.
import collections
import csv
import datetime
"""Test how many threads we can run at once."""
import itertools
import threading
import time
import sys
import requests