Skip to content

Instantly share code, notes, and snippets.

%%%-------------------------------------------------------------------
%%% File : rdbg.erl
%%% Author : Mats Cronqvist <qthmacr@mwux005>
%%% Description :
%%%
%%% Created : 16 Aug 2004 by Mats Cronqvist <qthmacr@mwux005>
%%%-------------------------------------------------------------------
-module(rdbg).
-export([rdbg/4,rdbg/0]).
Mods = [sets], rdbg:rdbg(5000, 1000, all, lists:foldl(fun(M, L) -> [{M,F1,[return,stack]} || F1 <- sets:to_list(lists:foldl(fun({F,_}, S) -> sets:add_element(F, S) end, sets:new(), proplists:get_value(exports, M:module_info())))] ++ L end, [], Mods)).
--- otp_src_R12B-5.orig/erts/emulator/drivers/common/inet_drv.c 2008-11-04 10:51:25.000000
+++ otp_src_R12B-5/erts/emulator/drivers/common/inet_drv.c 2008-11-21 12:28:47.000000
@@ -2003,7 +2003,7 @@
} else {
i = LOAD_INT(spec, i, uri->port);
}
- i = LOAD_STRING(spec, i, uri->s2_ptr, uri->s1_len);
+ i = LOAD_STRING(spec, i, uri->s2_ptr, uri->s2_len);
i = LOAD_TUPLE(spec, i, 5);
break;
--2009-02-16 13:51:19-- (try: 2) http://www.google.co.uk/
Connecting to www.google.co.uk|208.69.34.231|:80... failed: Connection refused.
Connecting to www.google.co.uk|208.69.34.230|:80... failed: Connection refused.
Resolving www.google.co.uk... 208.69.34.231, 208.69.34.230
Connecting to www.google.co.uk|208.69.34.231|:80... failed: Connection refused.
Connecting to www.google.co.uk|208.69.34.230|:80... failed: Connection refused.
-module(test_re2).
-compile(export_all).
-type word() :: list().
-type phi() :: 'phi'.
-type empty() :: 'empty'.
-record(letter, {l :: char()}).
-record(choice, {left, right}).
-record(seq, {left, right}).
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
#!/bin/bash
FOO="Hello, world"
FOO_ARGS=" -kernel bar \"${FOO}\" "
exec erl -noshell ${FOO_ARGS} -eval 'io:format("~p~n", [application:get_env(kernel, bar)]), halt(0).'
#exec erl -noshell -kernel bar '"Hello, world"' -eval 'io:format("~p~n", [application:get_env(kernel, bar)]), halt(0).'
@hntrmrrs
hntrmrrs / foo.py
Created June 4, 2009 15:46
OMG I forgot the return statement...
#!/usr/bin/env python
def baz(f):
def wrapper(*args, **kwargs):
print 'Calling wrapper...'
return f(*args, **kwargs)
return wrapper
class Foo(object):
def __init__(self, i):
%% =====================================================================
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions
%% are met:
%%
%% 1. Redistributions of source code must retain the above
%% copyright notice, this list of conditions and the following
%% disclaimer.
%%
%% 2. Redistributions in binary form must reproduce the above
-spec(read_input_string/2 :: (integer(), ewgi_context()) -> string()).
read_input_string(Size, Ctx) when is_integer(Size) ->
R = read_input(Ctx),
Iol = R(read_input_string_cb([]), Size),
Bin = iolist_to_binary(Iol),
binary_to_list(Bin).
read_input_string_cb(Acc) ->
F = fun(eof) ->