Skip to content

Instantly share code, notes, and snippets.

@soulne4ny
soulne4ny / stan-0.11.0-extra-redelivery-case.go
Last active September 22, 2018 17:04
stan-0.11.0-extra-redelivery-case.go
package main
import (
"fmt"
"log"
"os"
"os/signal"
"strconv"
"syscall"
"time"
@soulne4ny
soulne4ny / instantiate_generic.dart
Last active December 20, 2015 09:19
Generics in Dart: instance construction is broken. None of the following examples is working, but all are compiled. $ dart --version Dart VM version: 0.6.9.2_r25388 (Tue Jul 23 20:28:47 2013) on "macos_x64"
class GenericInstantiator<T> {
T parse(String s) {
return new T.parse(s);
}
}
class Stuff {
String s;
Stuff.parse(this.s);
}
@soulne4ny
soulne4ny / deque.clj
Created October 19, 2012 13:48 — forked from achim/deque.clj
Persistent Deque in Clojure
; see http://blogs.msdn.com/ericlippert/archive/2008/02/12/immutability-in-c-part-eleven-a-working-double-ended-queue.aspx
(defn- inner-pop [i end]
(condp = end
:left (subvec i 1)
:right (pop i)))
(defn- inner-peek [i end]
(condp = end
:left (first i)