This file contains 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(pack). | |
-compile([export_all]). | |
-define(SETS, gb_sets). | |
-define(DICT, dict). | |
-record(state, {pres_t = ?SETS:new(), | |
pres_f = ?SETS:new(), | |
pres_a = ?SETS:new(), |
This file contains 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
%!TEX TS-program = xelatex | |
\documentclass[12pt]{scrartcl} | |
% The declaration of the document class: | |
% The second line here, i.e. | |
% \documentclass[12pt]{scrartcl} | |
% is a standard LaTeX document class declaration: | |
% we say what kind of document we are making in curly brackets, | |
% and specify any options in square brackets. |
This file contains 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
use std::iter::Unfold; | |
fn main() { | |
let it = fibonacci(); | |
// prints the sequence | |
//for i in it.take(10) { | |
// print!("{} ", i) | |
//} |
This file contains 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
#![feature(phase, globs)] | |
#[phase(syntax, link)] extern crate log; | |
fn tokenize(s: &str) -> ~[&str] { | |
let t = std::str::replace(s, "(", " ( "); | |
let u = std::str::replace(t, ")", " ) "); | |
u.words().collect() | |
} | |
#[deriving(Eq, Show, Clone)] |
This file contains 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
2> dbg:tracer(). | |
{ok,<0.38.0>} | |
3> dbg:p(all, call). | |
{ok,[{matched,nonode@nohost,26}]} | |
4> dbg:tp(elvis_code, x). | |
{ok,[{matched,nonode@nohost,15},{saved,x}]} | |
5> dbg:tp(erl_parse, x). | |
{ok,[{matched,nonode@nohost,20},{saved,x}]} | |
6> | |
6> elvis:rock(#{src_dirs => ["src", "include", "test"], rules => []}). |
This file contains 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(mnesia_helper). | |
-compile([export_all]). | |
-record(some_record, {name=default, value=undefined}). | |
setup() -> | |
application:start(sasl), | |
application:start(mnesia), | |
{atomic, ok} = mnesia:create_table(some_record, [{attributes, |
This file contains 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
ErlNifFunc funcs[] = | |
{ | |
{"native_add", 2, native_add} | |
}; | |
ErlNifEntry* nif_init(void) { | |
static ErlNifEntry entry = { | |
2, | |
6, | |
"er", |
This file contains 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
00:25:30 erszcz @ x2 : /tmp | |
$ cat zoladz.rs | |
fn main() { | |
let z = "żołądź"; | |
println!("{:c}", z.char_at(1)); | |
} | |
00:25:33 erszcz @ x2 : /tmp | |
$ rustc zoladz.rs | |
00:25:37 erszcz @ x2 : /tmp | |
$ ./zoladz |
This file contains 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
$ erl -pa /Users/erszcz/apps/elixir/xyz/bin/../lib/eex/ebin /Users/erszcz/apps/elixir/xyz/bin/../lib/elixir/ebin /Users/erszcz/apps/elixir/xyz/bin/../lib/ex_unit/ebin /Users/erszcz/apps/elixir/xyz/bin/../lib/iex/ebin /Users/erszcz/apps/elixir/xyz/bin/../lib/logger/ebin /Users/erszcz/apps/elixir/xyz/bin/../lib/mix/ebin -elixir ansi_enabled true -noshell -s setdbg -s elixir start_cli -extra +elixirc asd.ex | |
(<0.51.0>) call elixir_compiler:file_to_path(<<"asd.ex">>,<<".">>) | |
(<0.51.0>) call elixir_compiler:file(<<"asd.ex">>,<<".">>) | |
(<0.51.0>) call elixir_compiler:get_opt(internal) | |
(<0.51.0>) returned from elixir_compiler:get_opt/1 -> false | |
(<0.51.0>) call elixir_compiler:string("defmodule Math do\n def sum(a, b) do\n a + b\n end\nend\n\n",<<"/private/tmp/zxc/asd.ex">>,<<"/private/tmp/zxc/.">>) | |
(<0.51.0>) call elixir_compiler:quoted({defmodule,[{line,1}], | |
[{'__aliases__',[{counter,0},{line,1}],['Math']}, | |
[{do,{def,[{line,2}], | |
[{sum,[{line,2}], |
This file contains 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 escript | |
%% -*- erlang -*- | |
%% vim: ft=erlang | |
%% Usage: | |
%% | |
%% echo "SELECT message FROM mam_message ORDER BY id DESC LIMIT 4" | \ | |
%% psql -U user -t | ./decode_archived_message | |
%% | |
%% Basically any query which returns just mam_message.message column can |
OlderNewer