This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main | |
import Data.Vect | |
data StackOp : Type -> Nat -> Nat -> Type where | |
Push : Integer -> StackOp () height (S height) | |
Pop : StackOp Integer (S height) height | |
Top : StackOp Integer (S height) (S height) -- this means there has to be at least one item on the stack | |
GetStr : StackOp String height height | |
PutStr : String -> StackOp () height height |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env runhaskell | |
{-# LANGUAGE OverloadedStrings #-} | |
import System.Environment | |
import System.Process | |
import System.Exit | |
usage = putStrLn "need to specify cloud and controller name" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Even = E Nat | |
data Odd = O Nat | |
data Num = Ev Nat | Od Nat | |
NumType : Num -> Type | |
NumType (Ev k) = Even | |
NumType (Od k) = Odd | |
mkEven : Nat -> Num |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let random_object = System.Random() | |
let filelines filename = System.IO.File.ReadAllLines(__SOURCE_DIRECTORY__ + "/" + filename) | |
let get_random_line file = random_object.Next(0, Seq.length(file)) | |
let get_random_word word_file = Seq.nth (get_random_line word_file) (word_file) | |
type words = | |
| Verb | |
| Noun | |
| Adjective |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
file=`mktemp` | |
echo $file | |
go test -coverprofile=$file $@ | |
go tool cover -html=$file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
runtime: g24: leftover defer argp=0xdeaddeaddeaddead pc=0x4872ea | |
defer 0xc2081d1d40 argp=0xdeaddeaddeaddead pc=0x4872ea | |
defer 0xc2081d1d00 argp=0xdeaddeaddeaddead pc=0x8f488c | |
defer 0xc208296040 argp=0xdeaddeaddeaddead pc=0xb3c28e | |
fatal error: traceback has leftover defers | |
runtime stack: | |
runtime.gothrow(0x14aeef0, 0x1d) | |
/home/mattyw/go/src/runtime/panic.go:507 +0x98 | |
runtime.gentraceback(0x42e348, 0xc208193c20, 0x0, 0xc2080e79e0, 0x0, 0x0, 0x7fffffff, 0x16a0af0, 0x0, 0x0, ...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sleep sort | |
// http://archives.cazzaserver.com/SleepSortWiki/SleepSort.html | |
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func sorter(c chan int, value int) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func getIn(i interface{}, keys []string) interface{} { | |
if len(keys) == 0 { | |
return i | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import :timer, only: [sleep: 1] | |
defmodule Main do | |
@num 1000000 | |
def thread(pid) do | |
:timer.sleep(10000) | |
pid <- {:result, 1} | |
end | |
def collector(x) when x == @num do |
NewerOlder