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
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-} | |
import Data.Vector as V | |
import Data.Word | |
import Data.Bits | |
data Instr = Seed Word32 | |
| Mutate Word32 | |
| JmpFwd Word16 | |
| JmpRev Word16 |
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
> (c 'trace) | |
#(module trace) | |
> (l 'trace) | |
(#(module trace)) | |
> (: trace start) | |
IN [ myfunc, x=0 ] | |
IN [ myfunc, x=1 ] | |
IN [ myfunc, x=2 ] | |
IN [ myfunc, x=3 ] | |
OUT[ myfunc, x=3 => 0 ] |
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
%% @doc Function description. | |
-spec f( Item::type() % description of item | |
, Action::type() % yet another description | |
... | |
) -> type() % blah | |
f(Item,Action) -> |
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
ak@rifter:~/code/erl/erlang_rebar_example_project$ rebar generate-upgrade previous_release=dummynode_first -v | |
DEBUG: Rebar location: "/home/ak/bin/rebar" | |
DEBUG: Entering /home/ak/code/erl/erlang_rebar_example_project | |
DEBUG: Available deps: [] | |
DEBUG: Missing deps : [] | |
DEBUG: Predirs: ["/home/ak/code/erl/erlang_rebar_example_project/apps/dummy_app", | |
"/home/ak/code/erl/erlang_rebar_example_project/rel"] | |
DEBUG: Entering /home/ak/code/erl/erlang_rebar_example_project/apps/dummy_app | |
DEBUG: Available deps: [] | |
DEBUG: Missing deps : [] |
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
{excl_sys_filters, ["^bin/.*", "^erts.*/bin/(dialyzer|typer)", | |
"^.git/.*"]}, | |
{excl_archive_filters, [".*"]}, |
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
(defmodule homework (export letters)) | |
(defun lut (x) | |
(: lists nth (- x (car '"/")) | |
'("0" | |
"1" "abc" "def" | |
"ghi" "jkl" "mno" | |
"pqrs" "tuv" "wxyz"))) | |
(defun letters |
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
(defmacro bin-parser ((cons name raw-clauses) | |
(flet ((fun-clause | |
((list (list* cmd chan match) body) | |
`((,cmd ,chan (binary ,@(: lists map (fun bin-chunk 1) match))) ,body)) | |
((x) (error `(what_is_this ,x)))) | |
(bin-chunk | |
(((list name n)) (when (is_integer n)) | |
`(,name little integer (size ,(* 8 n)))) | |
(((list name 'float)) | |
`(,name little float)) |
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
(defmodule egs_proto (export (parse_packet 1) (dsl_test 0))) | |
;; Subset of binaries. | |
;; | |
;; Looks like little-endian 32 bit floats are hella broken. | |
;; Unsure why. | |
(defmacro egs-prot (chunks | |
(flet* ((chunk2bin | |
(((list name n)) (when (is_integer n)) | |
`(,name little integer (size ,(* 8 n)))) |
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
app="myapp" | |
function gen-ups { | |
rebar generate-appups previous_release=$1 | |
cat $app/lib/*/ebin/*.appup | |
} | |
# This uses a dirty bunch of hacks to "generate" downgrade instructions | |
# (upgrade instructions in the opposite direction) with the current rebar | |
# version. |
OlderNewer