From carsten@REDACTED Thu Jul 1 00:52:37 2004 From: carsten@REDACTED (Carsten Schultz) Date: Thu, 1 Jul 2004 00:52:37 +0200 Subject: SSL accept In-Reply-To: <20040630214429.GA697@penne.localnet> References: <20040630091430.GG17389@penne.localnet> <20040630214429.GA697@penne.localnet> Message-ID: <20040630225237.GA2116@penne.localnet> Hi again, Peter! Having played around a bit, I think that your suggestion might work better than I thought it would. It seems that the semantics of ssl:accept(Socket, Timeout) are not what I thought. What happens to an SSL negotiation in progress when the timeout is reached? It seems to somehow survive, even though the call to accept returns. Is this true? What are the details? Greetings, Carsten -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://carsten.codimi.de/ PGP/GPG key on the pgp.net key servers, fingerprint on my home page. From hasse@REDACTED Thu Jul 1 09:11:40 2004 From: hasse@REDACTED (Hans Bolinder) Date: Thu, 1 Jul 2004 09:11:40 +0200 Subject: Matching binaries in list comprehensions In-Reply-To: <40E33065.3010105@cisco.com> References: <40E33065.3010105@cisco.com> Message-ID: <16611.47404.581499.512266@gargle.gargle.HOWL> Hi, > Given a list of binaries in Recs, I have the following list comprehension: > > Msgs = (catch [{Type, Value} || <> > <- Recs]) > > The compiler complains: > Warning: variable '_Len' shadowed in generate This is a bug in the linter. We will fix it when time permits. Thanks for pointing it out. Best regards, Hans Bolinder, Erlang/OTP From erlq@REDACTED Fri Jul 2 14:38:26 2004 From: erlq@REDACTED (Rob) Date: Fri, 02 Jul 2004 05:38:26 -0700 Subject: Starting slowly and questions... Message-ID: <40E55742.9000101@itsbeen.sent.com> I have been slowly starting to try get productive with erlang, I have been reading everything and I think it is a breath of fresh air after being oppressed by the low productivity, high bloat, XML/SOAP/WS-I/UDDI/Java/OO regime that I toil under currently. To read about others thinking about large scale interconnected systems is great, I think there could be great synergies between erlang and ad-hoc, logical and physical mesh networks (wireless and wired). A generalized man-in-middle is exciting and detaching it from tcp even better. But to my questions, struggling along with learning basic functions, I am stuck (I spent some time because I didn't realize that the crypto module wasn't working on my werl.exe on Windows and thought I was doing something wrong): I got the following to work: File = "C:/c.txt". {_,Contents} = file:read_file(File). Digest = erlang:md5(Contents). io:format("~.16b\n", [Digest]). I tried various format options, binary_to_string and some bit stuff but clearly I am missing something. I'd like to get it to output something like: f28c94b1 maybe there is a function to turn a arbitrary length binary into a hex string but Also, I saw some mention in the archives about an interface with Sybase, I would be very interested if someone had more info about that or any other native db drivers/interfaces to any major dbs. TIA, Rob From magnus.thoang@REDACTED Fri Jul 2 16:25:34 2004 From: magnus.thoang@REDACTED (=?ISO-8859-1?Q?Magnus_Tho=E4ng?=) Date: Fri, 02 Jul 2004 16:25:34 +0200 Subject: Starting slowly and questions... In-Reply-To: <40E55742.9000101@itsbeen.sent.com> References: <40E55742.9000101@itsbeen.sent.com> Message-ID: <40E5705E.5080805@ericsson.com> Rob wrote: ... > Digest = erlang:md5(Contents). > > io:format("~.16b\n", [Digest]). > ... > I'd like to get it to output something like: > f28c94b1 > > maybe there is a function to turn a arbitrary length binary into a hex > string but > Hi Rob, As far as I know, there is no such function in OTP. The b control sequence is for integers (not binaries), so if you need to dump out reasonably short binaries, you might do something like... MyBinary = some_function(SomeArguments,...), MyBinaryBitSize = 8 * size(MyBinary), <> = MyBinary, io:format("~*.16.0b\n", [size(MyBinary) * 2, MyInteger]). ...but something like the following is much more erlangish... dump_binary(IODevice, <<>>) -> io:format(IODevice, "~n", []); dump_binary(IODevice, <>) -> io:format(IODevice, "~2.16.0b\n", [Octet]), dump_binary(IODevice, Rest). ...and in the case you want to group the bytes in some way, it is easy to accomplish with such a function. -- Magnus From bjorn@REDACTED Sat Jul 3 14:20:13 2004 From: bjorn@REDACTED (=?iso-8859-1?Q?Bj=F6rn?= Bylander) Date: Sat, 3 Jul 2004 14:20:13 +0200 Subject: Documentation of filelib:ensure_dir in R9C Message-ID: <20040703122013.GA19812@loxyter.loxysoft.se> Hi, http://www.erlang.org/doc/r9c/lib/stdlib-1.12/doc/html/filelib.html says ensure_dir/1 always returns true. That's not what I observe with R9C (emulator v5.3) under Linux though: filelib:ensure_dir("foo") returns true without creating a any directories. filelib:ensure_dir("foo/bar/baz") returns ok and also creates foo and foo/bar. filelib:ensure_dir("foo/") returns ok and also creates foo. I guess filelib:ensure_dir("foo") ensures that "./" exists but the other variants returning ok is not according to the docs as far as I can see... I get the same behaviour under Windows 2000 and R9C-0. /Bj?rn From bry@REDACTED Sat Jul 3 17:35:09 2004 From: bry@REDACTED (bry@REDACTED) Date: Sat, 3 Jul 2004 17:35:09 +0200 Subject: erlang planet lab In-Reply-To: <20040626223447.F39233@olgeni.olgeni> References: <40DC8D2C.2060009@cisco.com> <20040626223447.F39233@olgeni.olgeni> Message-ID: <1088868909.40e6d22db19f7@horde.scannet.dk> I remember there was talk of an erlang planet lab at some point, was wondering if anything ever came of that. Also if those working on it have seen donut lab from E: http://www.erights.org/smart-contracts/donut-lab/index.html From david.wallin@REDACTED Mon Jul 5 14:34:45 2004 From: david.wallin@REDACTED (david wallin) Date: Mon, 5 Jul 2004 13:34:45 +0100 Subject: Passing on script generated arguments to erl Message-ID: Hi all, I've run into a problem when using erl with a bash script that generates the arguments I want to use in erlang. If I type something like this at the bash prompt everything works fine: [dolly:~/southpaw] david% erl -- 'foo 1' 'foo 2' Erlang (BEAM) emulator version 5.3 [source] Eshell V5.3 (abort with ^G) 1> init:get_plain_arguments(). ["foo 1","foo 2"] If I try the script that automatically generates the arguments (just assume that the WORKLOAD var is generated by a script): [dolly:~/southpaw] david% WORKLOAD="'foo 1' 'foo 2'" [dolly:~/southpaw] david% echo $WORKLOAD 'foo 1' 'foo 2' [dolly:~/southpaw] david% erl -- $WORKLOAD Erlang (BEAM) emulator version 5.3 [source] Eshell V5.3 (abort with ^G) 1> init:get_plain_arguments(). ["'foo","1'","'foo","2'"] Can anybody give me some advice on the matter, I'm currently leaning towards creating a temp file containing the arguments but the solution doesn't appeal to me. cheers, --david. From matthias@REDACTED Mon Jul 5 15:07:25 2004 From: matthias@REDACTED (Matthias Lang) Date: Mon, 5 Jul 2004 15:07:25 +0200 Subject: Passing on script generated arguments to erl In-Reply-To: References: Message-ID: <16617.21133.569034.726235@antilipe.corelatus.se> david wallin writes: > I've run into a problem when using erl with a bash script that > generates the arguments I want to use in erlang. Your problem is not an Erlang problem, it's the way BASH works. A script does almost exactly the same thing: tmp >cat shellscript #! echo "1:$1 2:$2" tmp >WORKLOAD="'foo 1' 'foo 2'" tmp >echo $WORKLOAD 'foo 1' 'foo 2' tmp >./shellscript $WORKLOAD 1:'foo 2:1' Matthias > If I type something like this at the bash prompt everything works fine: > > [dolly:~/southpaw] david% erl -- 'foo 1' 'foo 2' > > Erlang (BEAM) emulator version 5.3 [source] > > Eshell V5.3 (abort with ^G) > 1> init:get_plain_arguments(). > ["foo 1","foo 2"] > > > If I try the script that automatically generates the arguments (just > assume that the WORKLOAD var is generated by a script): > > [dolly:~/southpaw] david% WORKLOAD="'foo 1' 'foo 2'" > [dolly:~/southpaw] david% echo $WORKLOAD > 'foo 1' 'foo 2' > [dolly:~/southpaw] david% erl -- $WORKLOAD > Erlang (BEAM) emulator version 5.3 [source] > > Eshell V5.3 (abort with ^G) > 1> init:get_plain_arguments(). > ["'foo","1'","'foo","2'"] > > > Can anybody give me some advice on the matter, I'm currently leaning > towards creating a temp file containing the arguments but the solution > doesn't appeal to me. > > cheers, > > --david. From david.wallin@REDACTED Mon Jul 5 15:14:00 2004 From: david.wallin@REDACTED (david wallin) Date: Mon, 5 Jul 2004 14:14:00 +0100 Subject: Passing on script generated arguments to erl In-Reply-To: <16617.21133.569034.726235@antilipe.corelatus.se> References: <16617.21133.569034.726235@antilipe.corelatus.se> Message-ID: <2E0E94D8-CE85-11D8-A27B-000393536F4E@ul.ie> blimey! you're right. thanks, --david. On 2004-07-05, at 14.07, Matthias Lang wrote: > david wallin writes: > >> I've run into a problem when using erl with a bash script that >> generates the arguments I want to use in erlang. > > Your problem is not an Erlang problem, it's the way BASH works. A > script does almost exactly the same thing: > > tmp >cat shellscript > #! > echo "1:$1 2:$2" > > tmp >WORKLOAD="'foo 1' 'foo 2'" > tmp >echo $WORKLOAD > 'foo 1' 'foo 2' > tmp >./shellscript $WORKLOAD > 1:'foo 2:1' > > Matthias > >> If I type something like this at the bash prompt everything works >> fine: >> >> [dolly:~/southpaw] david% erl -- 'foo 1' 'foo 2' >> >> Erlang (BEAM) emulator version 5.3 [source] >> >> Eshell V5.3 (abort with ^G) >> 1> init:get_plain_arguments(). >> ["foo 1","foo 2"] >> >> >> If I try the script that automatically generates the arguments (just >> assume that the WORKLOAD var is generated by a script): >> >> [dolly:~/southpaw] david% WORKLOAD="'foo 1' 'foo 2'" >> [dolly:~/southpaw] david% echo $WORKLOAD >> 'foo 1' 'foo 2' >> [dolly:~/southpaw] david% erl -- $WORKLOAD >> Erlang (BEAM) emulator version 5.3 [source] >> >> Eshell V5.3 (abort with ^G) >> 1> init:get_plain_arguments(). >> ["'foo","1'","'foo","2'"] >> >> >> Can anybody give me some advice on the matter, I'm currently leaning >> towards creating a temp file containing the arguments but the solution >> doesn't appeal to me. >> >> cheers, >> >> --david. From Tobias.Lindahl@REDACTED Mon Jul 5 16:09:02 2004 From: Tobias.Lindahl@REDACTED (Tobias Lindahl) Date: Mon, 5 Jul 2004 16:09:02 +0200 (MEST) Subject: Dialyzer v1.0 Message-ID: We are very happy to announce the first public release of Dialyzer (DIscrepancy AnaLYZer of ERlang programs), a static analysis tool that can identify software problems such as type errors, unreachable code, unnecessary tests, etc in Erlang applications. The tool can be obtained at http://www.it.uu.se/research/group/hipe/dialyzer and is available free of charge for non-commersial uses. Check it out and you might be surprised by the number of discrepancies that lurk in your favourite, well-tested application. Feedback is very welcome, Tobias Lindahl and Kostis Sagonas. From hedeland@REDACTED Mon Jul 5 16:23:55 2004 From: hedeland@REDACTED (Per Hedeland) Date: Mon, 5 Jul 2004 16:23:55 +0200 (CEST) Subject: Passing on script generated arguments to erl In-Reply-To: <2E0E94D8-CE85-11D8-A27B-000393536F4E@ul.ie> Message-ID: <200407051423.i65ENte5081519@tordmule.bluetail.com> david wallin wrote: > >blimey! you're right. thanks, Just in case you want a non-erlang solution to the non-erlang problem: eval erl -- "$WORKLOAD" --Per >On 2004-07-05, at 14.07, Matthias Lang wrote: > >> david wallin writes: >> >>> I've run into a problem when using erl with a bash script that >>> generates the arguments I want to use in erlang. >> >> Your problem is not an Erlang problem, it's the way BASH works. A >> script does almost exactly the same thing: >> >> tmp >cat shellscript >> #! >> echo "1:$1 2:$2" >> >> tmp >WORKLOAD="'foo 1' 'foo 2'" >> tmp >echo $WORKLOAD >> 'foo 1' 'foo 2' >> tmp >./shellscript $WORKLOAD >> 1:'foo 2:1' >> >> Matthias >> >>> If I type something like this at the bash prompt everything works >>> fine: >>> >>> [dolly:~/southpaw] david% erl -- 'foo 1' 'foo 2' >>> >>> Erlang (BEAM) emulator version 5.3 [source] >>> >>> Eshell V5.3 (abort with ^G) >>> 1> init:get_plain_arguments(). >>> ["foo 1","foo 2"] >>> >>> >>> If I try the script that automatically generates the arguments (just >>> assume that the WORKLOAD var is generated by a script): >>> >>> [dolly:~/southpaw] david% WORKLOAD="'foo 1' 'foo 2'" >>> [dolly:~/southpaw] david% echo $WORKLOAD >>> 'foo 1' 'foo 2' >>> [dolly:~/southpaw] david% erl -- $WORKLOAD >>> Erlang (BEAM) emulator version 5.3 [source] >>> >>> Eshell V5.3 (abort with ^G) >>> 1> init:get_plain_arguments(). >>> ["'foo","1'","'foo","2'"] >>> >>> >>> Can anybody give me some advice on the matter, I'm currently leaning >>> towards creating a temp file containing the arguments but the solution >>> doesn't appeal to me. >>> >>> cheers, >>> >>> --david. > > From joe@REDACTED Tue Jul 6 10:54:13 2004 From: joe@REDACTED (Joe Armstrong) Date: Tue, 6 Jul 2004 10:54:13 +0200 (CEST) Subject: Starting slowly and questions... In-Reply-To: <40E55742.9000101@itsbeen.sent.com> Message-ID: I've encloded a little module I use for this - it also computes MD5 checksums for extremely large files using md5_update. You might find this useful. Use like this: > {ok,B} = md5:file("week4.pdf"). {ok,<<111,197,3,75,190,224,67,242,15,53,139,151,14,22,214,103>>} > md5:digest2str(B). "6fc5034bbee043f20f358b970e16d667" Cheers /Joe -module(md5). %% author Joe Armstrong -export([string/1, file/1, bin/1, digest2str/1]). -define(BLOCKSIZE, 32768). -define(IN(X,Min,Max), X >= Min, X =< Max). %% md5:string(string()) -> BinDigest %% md5:file(FileName) -> {ok, BinDigest} | {error, E} %% md5:digest2str(BinDigest) -> StringDigest %% md5:file works with chunks so should work correctly with extremely %% large files string(Str) -> digest2str(erlang:md5(Str)). file(File) -> case file:open(File, [binary,raw,read]) of {ok, P} -> loop(P, erlang:md5_init()); Error -> Error end. loop(P, C) -> case file:read(P, ?BLOCKSIZE) of {ok, Bin} -> loop(P, erlang:md5_update(C, Bin)); eof -> file:close(P), {ok, erlang:md5_final(C)} end. digest2str(Digest) -> bin2str(binary_to_list(Digest)). bin2str([H|T]) -> {H1, H2} = byte2hex(H), [H1,H2|bin2str(T)]; bin2str([]) -> []. byte2hex(X) -> {nibble2hex(X bsr 4), nibble2hex(X band 15)}. nibble2hex(X) when ?IN(X, 0, 9) -> X + $0; nibble2hex(X) when ?IN(X, 10, 15) -> X - 10 + $a. %% compute the md5 checksum of a binary bin(Bin) -> C1 = erlang:md5_init(), C2 = erlang:md5_update(C1, Bin), C3 = erlang:md5_final(C2), digest2str(C3). > I got the following to work: > > File = "C:/c.txt". > {_,Contents} = file:read_file(File). > Digest = erlang:md5(Contents). > > io:format("~.16b\n", [Digest]). > > I tried various format options, binary_to_string and some bit stuff but > clearly I am missing something. > > I'd like to get it to output something like: > f28c94b1 > > maybe there is a function to turn a arbitrary length binary into a hex > string but > From david.wallin@REDACTED Tue Jul 6 13:31:13 2004 From: david.wallin@REDACTED (david wallin) Date: Tue, 6 Jul 2004 12:31:13 +0100 Subject: Passing on script generated arguments to erl In-Reply-To: <200407051423.i65ENte5081519@tordmule.bluetail.com> References: <200407051423.i65ENte5081519@tordmule.bluetail.com> Message-ID: Thanks, I passed it along as a single string "foo 1::foo 2" separated by "::" and then used regexp:split/2. But your suggestion seems to be slightly more elegant, I will try it. Thanks. cheers, --david. On 2004-07-05, at 15.23, Per Hedeland wrote: > david wallin wrote: >> >> blimey! you're right. thanks, > > Just in case you want a non-erlang solution to the non-erlang problem: > > eval erl -- "$WORKLOAD" > > --Per > >> On 2004-07-05, at 14.07, Matthias Lang wrote: >> >>> david wallin writes: >>> >>>> I've run into a problem when using erl with a bash script that >>>> generates the arguments I want to use in erlang. >>> >>> Your problem is not an Erlang problem, it's the way BASH works. A >>> script does almost exactly the same thing: >>> >>> tmp >cat shellscript >>> #! >>> echo "1:$1 2:$2" >>> >>> tmp >WORKLOAD="'foo 1' 'foo 2'" >>> tmp >echo $WORKLOAD >>> 'foo 1' 'foo 2' >>> tmp >./shellscript $WORKLOAD >>> 1:'foo 2:1' >>> >>> Matthias >>> >>>> If I type something like this at the bash prompt everything works >>>> fine: >>>> >>>> [dolly:~/southpaw] david% erl -- 'foo 1' 'foo 2' >>>> >>>> Erlang (BEAM) emulator version 5.3 [source] >>>> >>>> Eshell V5.3 (abort with ^G) >>>> 1> init:get_plain_arguments(). >>>> ["foo 1","foo 2"] >>>> >>>> >>>> If I try the script that automatically generates the arguments (just >>>> assume that the WORKLOAD var is generated by a script): >>>> >>>> [dolly:~/southpaw] david% WORKLOAD="'foo 1' 'foo 2'" >>>> [dolly:~/southpaw] david% echo $WORKLOAD >>>> 'foo 1' 'foo 2' >>>> [dolly:~/southpaw] david% erl -- $WORKLOAD >>>> Erlang (BEAM) emulator version 5.3 [source] >>>> >>>> Eshell V5.3 (abort with ^G) >>>> 1> init:get_plain_arguments(). >>>> ["'foo","1'","'foo","2'"] >>>> >>>> >>>> Can anybody give me some advice on the matter, I'm currently leaning >>>> towards creating a temp file containing the arguments but the >>>> solution >>>> doesn't appeal to me. >>>> >>>> cheers, >>>> >>>> --david. >> >> From davidw@REDACTED Wed Jul 7 15:08:36 2004 From: davidw@REDACTED (David N. Welton) Date: Wed, 07 Jul 2004 15:08:36 +0200 Subject: yecc question Message-ID: <40EBF5D4.4010503@eidetix.com> Hi, I've been trying to put some yecc code together, but I'm a bit confused. The documentation gives a simple example: Nonterminals list elements element. Terminals atom '(' ')'. Rootsymbol list. list -> '(' ')'. list -> '(' elements ')'. elements -> element. elements -> element elements. element -> atom. element -> list. ... which doesn't report any errors when processed with yecc:yecc("foo", "bar"). So far so good. But then the manual has this: """The output file contains Erlang source code for a parser module with module name equal to the Parserfile parameter. After compilation, the parser can be called as follows (the module name is assumed to be myparser): myparser:parse(myscanner:scan(Inport))""" erlang-doc-html/html/lib/parsetools-1.2/doc/html/yecc.html The 'bar' module created above doesn't have any scan function, though: -export([parse/1, parse_and_scan/1, format_error/1]). Is there a simple (i.e. not an erlang parser!) functioning example I can look at somewhere? Thankyou, -- David N. Welton davidw@REDACTED From jeinhorn@REDACTED Wed Jul 7 18:14:52 2004 From: jeinhorn@REDACTED (Jeffrey M. Einhorn) Date: Wed, 07 Jul 2004 11:14:52 -0500 Subject: escript Message-ID: <1089216892.2303.97.camel@dhcp-lom-194-199.futuresource.com> I decided to give escript another try since there was some new discussion about it recently, but I it doesn't seem to provide much feedback when things fail. Is there a way to turn on debugging type messages? Here is a little program I wrote to test it, but it never makes it to the "Response" printout. #!/usr/bin/env escript -export([main/1]). main([Node]) -> io:format("Start~n"), auth:cookie(['test']), Response = (catch net_adm:ping(Node)), io:format("Response from ~p is ~p~n", [Node, Response]), io:format("Done~n"); main(_) -> usage(). usage() -> io:format("Usage simple nodename ~n"). Thanks for your time, Jeff -- Jeffrey M. Einhorn Systems Manager FutureSource 630.792.2065 jeinhorn@REDACTED From thomasl_erlang@REDACTED Wed Jul 7 19:21:21 2004 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 7 Jul 2004 10:21:21 -0700 (PDT) Subject: yecc question In-Reply-To: <40EBF5D4.4010503@eidetix.com> Message-ID: <20040707172121.13331.qmail@web41907.mail.yahoo.com> --- "David N. Welton" wrote: > The 'bar' module created above doesn't have any scan > function, though: > > -export([parse/1, parse_and_scan/1, > format_error/1]). > > Is there a simple (i.e. not an erlang parser!) > functioning example I can > look at somewhere? In short, you have to provide the lexical analyzer yourself. The canonical handwritten example is erl_scan.erl If you are feeling adventurous, you can also have a look at jungerl/lib/smart_exceptions/lex.erl which is a lex-like utility. There are docs at the front of the file and some usage examples at the end. Best, Thomas __________________________________ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail From rvg@REDACTED Wed Jul 7 19:21:22 2004 From: rvg@REDACTED (Rudolph van Graan) Date: Wed, 7 Jul 2004 19:21:22 +0200 Subject: Mnesia foldl without a transaction Message-ID: <11264532-D03A-11D8-BFE1-000A956D87EE@patternmatched.com> Hi All, My question tonight is about iterating over an mnesia table with the lowest possible overhead to the VM. As far as I can see, a mnesia:foldl(...) call runs in a transaction and then blocks all other mnesia calls. How would I get to iterate over an entire table with as little as possible overhead? At the moment my table sits at about 100000 records and it takes almost 10s to iterate. Any ideas on how to speeds this up? Regards, Rudolph van Graan From mats.cronqvist@REDACTED Wed Jul 7 20:47:55 2004 From: mats.cronqvist@REDACTED (mats cronqvist) Date: Wed, 07 Jul 2004 20:47:55 +0200 Subject: Mnesia foldl without a transaction In-Reply-To: <11264532-D03A-11D8-BFE1-000A956D87EE@patternmatched.com> References: <11264532-D03A-11D8-BFE1-000A956D87EE@patternmatched.com> Message-ID: maybe using ets:foldl/3? mats > Hi All, > > My question tonight is about iterating over an mnesia table with the > lowest possible overhead to the VM. As far as I can see, a > mnesia:foldl(...) call runs in a transaction and then blocks all other > mnesia calls. How would I get to iterate over an entire table with as > little as possible overhead? At the moment my table sits at about 100000 > records and it takes almost 10s to iterate. Any ideas on how to speeds > this up? > > Regards, > > Rudolph van Graan From mscandar@REDACTED Wed Jul 7 23:52:52 2004 From: mscandar@REDACTED (Mark Scandariato) Date: Wed, 07 Jul 2004 17:52:52 -0400 Subject: Stand Alone Erlang initial processes... Message-ID: <40EC70B4.2060601@cisco.com> I have an application that I'm trying to use with SAE, but it fails when it tries to open a udp socket. Apparently, inet_db isn't loaded when an SAE application starts, and can't be started: inet_db:start() calls inet_config:init(), which then calls init:get_argument(loader) which of course fails, since init is really "fake_demand_init". Any advice on getting SAE to be a little "heavier" when it starts would be appreciated. Thanks, Mark. From mlogan@REDACTED Thu Jul 8 00:08:24 2004 From: mlogan@REDACTED (Martin J. Logan) Date: 07 Jul 2004 17:08:24 -0500 Subject: why catch gen_server; MOD:handle_call? Message-ID: <1089238103.19845.113.camel@dhcp-lom-194-186.futuresource.com> The terminate function is called when a call back in a gen server fails. I am wondering if this is a good idea or not. This opens up doors for inconsistencies. Here is an example chronology: 1. gen_server:call(?SERVER, do_something). 2. handle_call(do_something, From, State) -> -Side effects and a corresponding state alteration to StatePrime -exit with a badmatch before returning StatePrime 3. terminate(Badmatch, State) -> % Note State as it was before the side effects that happend in handle_call not StatePrime Sideffects similar to those in handle_call based on State. This can leave a system in a bad state. The catch seems to violate the "let it die" tennant that is so crucial to good erlang programming as well as the good ol' principle of least astonishment. This code might work as expected if we were using a language that encouraged a lack of referential transparency i.e state is preferably stored in a process dictionary. This badmatch error is a problem with the code and might be handled more effectively by a supervision structure rather than a catch. Cheers, Martin From peter@REDACTED Thu Jul 8 08:43:21 2004 From: peter@REDACTED (Peter Lund) Date: Thu, 8 Jul 2004 08:43:21 +0200 Subject: SV: Stand Alone Erlang initial processes... In-Reply-To: <40EC70B4.2060601@cisco.com> Message-ID: <002b01c464b6$dce6df80$6d01a8c0@ascomws.com> I also have problems getting erlang to start as a deamon using the run_erl. I am running R9C-0 on a FreeBSD box. I have done this many times before (Redhat linux 9.0 works), so I got quite confused why it did not work now. I have not done any extensive testing on my configuration yet though. Peter Lund > -----Ursprungligt meddelande----- > Fran: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]For Mark Scandariato > Skickat: den 7 juli 2004 23:53 > Till: erlang-questions@REDACTED > Amne: Stand Alone Erlang initial processes... > > > I have an application that I'm trying to use with SAE, but it > fails when > it tries to open a udp socket. > > Apparently, inet_db isn't loaded when an SAE application starts, and > can't be started: inet_db:start() calls inet_config:init(), > which then > calls init:get_argument(loader) which of course fails, since init is > really "fake_demand_init". > > Any advice on getting SAE to be a little "heavier" when it > starts would > be appreciated. > > Thanks, > Mark. From joe@REDACTED Thu Jul 8 09:30:06 2004 From: joe@REDACTED (Joe Armstrong) Date: Thu, 8 Jul 2004 09:30:06 +0200 (CEST) Subject: yecc question In-Reply-To: <40EBF5D4.4010503@eidetix.com> Message-ID: A long time ago I wrote a tutorial on the use of yecc an leex It's at http://www.erlang.org/contrib/parser_tutorial-1.0.tgz Cheers /Joe On Wed, 7 Jul 2004, David N. Welton wrote: > Hi, I've been trying to put some yecc code together, but I'm a bit > confused. The documentation gives a simple example: > > Nonterminals list elements element. > Terminals atom '(' ')'. > Rootsymbol list. > list -> '(' ')'. > list -> '(' elements ')'. > elements -> element. > elements -> element elements. > element -> atom. > element -> list. > > ... which doesn't report any errors when processed with yecc:yecc("foo", > "bar"). So far so good. But then the manual has this: > > """The output file contains Erlang source code for a parser module with > module name equal to the Parserfile parameter. After > compilation, the parser can be called as follows (the module name is > assumed to be myparser): > > myparser:parse(myscanner:scan(Inport))""" > > erlang-doc-html/html/lib/parsetools-1.2/doc/html/yecc.html > > The 'bar' module created above doesn't have any scan function, though: > > -export([parse/1, parse_and_scan/1, format_error/1]). > > Is there a simple (i.e. not an erlang parser!) functioning example I can > look at somewhere? > > Thankyou, > From matthias@REDACTED Thu Jul 8 10:07:34 2004 From: matthias@REDACTED (Matthias Lang) Date: Thu, 8 Jul 2004 10:07:34 +0200 Subject: why catch gen_server; MOD:handle_call? In-Reply-To: <1089238103.19845.113.camel@dhcp-lom-194-186.futuresource.com> References: <1089238103.19845.113.camel@dhcp-lom-194-186.futuresource.com> Message-ID: <16621.198.346547.307554@antilipe.corelatus.se> Hi, Martin Logan writes: > The terminate function is called when a call back in a gen server fails. > I am wondering if this is a good idea or not. You have a good point. Inspired by your post, I took a quick look through the terminate functions in a system we wrote. I found a couple of 'terminates' which use information from the State variable to un-do side effects, even though the State variable is no longer reliably represents those side effects. Bad. Moving the cleanup to a supervisor would discourage that type of mistake, but the canned supervisors don't have any mechanism for a process-specific cleanup. I'm not convinced they should, either. Putting the cleanup code in the same module as the server doesn't seem horrible, as long as you remember that you can't always rely on the State variable being at true reflection of system state. If you write code like this you're fine: terminate(normal, State) -> % do anything you want, the State is consistent with the world ok; terminate(shutdown, State) -> % do anything you want, the State is consistent with the world ok; terminate(Reason, Possibly_old_state) -> % keep in mind that the State is not necessarily consistent % with what has happened; the gen_server may have terminated % while partway through a callback. ok I don't remember if they teach that in the advanced OTP course (Francesco? Lennart?). Changing the emacs skeleton would be a nudge in the right direction. Matthias From ulf.wiger@REDACTED Thu Jul 8 12:52:56 2004 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Thu, 8 Jul 2004 12:52:56 +0200 Subject: why catch gen_server; MOD:handle_call? Message-ID: <37FB7AA6F5F9814FB634A7BF4C35A6F54027D4@ESEALNT442.al.sw.ericsson.se> I would suggest that terminate/2 be used only to do 'obvious' cleanup, i.e. the stuff you'll want to do before a normal shutdown. This could involve explicitly closing files that are open, unloading mibs, etc. Cleaning up possible inconsistencies should be done after restart, even though telling the difference between a normal start and a restart after error might be tricky. /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Matthias Lang > Sent: den 8 juli 2004 10:08 > To: Martin J. Logan > Cc: erlang-questions@REDACTED > Subject: Re: why catch gen_server; MOD:handle_call? > > > Hi, > > Martin Logan writes: > > > The terminate function is called when a call back in a gen > server fails. > > I am wondering if this is a good idea or not. > > You have a good point. > > Inspired by your post, I took a quick look through the terminate > functions in a system we wrote. I found a couple of 'terminates' which > use information from the State variable to un-do side effects, even > though the State variable is no longer reliably represents those side > effects. Bad. > > Moving the cleanup to a supervisor would discourage that type of > mistake, but the canned supervisors don't have any mechanism for a > process-specific cleanup. I'm not convinced they should, > either. Putting the cleanup code in the same module as the server > doesn't seem horrible, as long as you remember that you can't always > rely on the State variable being at true reflection of system state. > If you write code like this you're fine: > > terminate(normal, State) -> > % do anything you want, the State is consistent with the world > ok; > > terminate(shutdown, State) -> > % do anything you want, the State is consistent with the world > ok; > > terminate(Reason, Possibly_old_state) -> > % keep in mind that the State is not necessarily consistent > % with what has happened; the gen_server may have terminated > % while partway through a callback. > ok > > I don't remember if they teach that in the advanced OTP course > (Francesco? Lennart?). Changing the emacs skeleton would be a > nudge in the right direction. > > Matthias > From svg@REDACTED Wed Jul 7 20:27:06 2004 From: svg@REDACTED (Vladimir Sekissov) Date: Thu, 08 Jul 2004 00:27:06 +0600 (YEKST) Subject: Mnesia foldl without a transaction In-Reply-To: <11264532-D03A-11D8-BFE1-000A956D87EE@patternmatched.com> References: <11264532-D03A-11D8-BFE1-000A956D87EE@patternmatched.com> Message-ID: <20040708.002706.104048357.svg@surnet.ru> Good day, If you don't care about transaction context it would be something like this: dirty_foldl(Fun, Acc, Tab) -> Key = mnesia:dirty_first(Tab), dirty_foldl(Fun, Acc, Tab, Key). dirty_foldl(Fun, Ret, Tab, '$end_of_table') -> Ret; dirty_foldl(Fun, Acc, Tab, Key) -> NxtAcc = Fun(Key, Acc), NxtKey = mnesia:dirty_next(Tab, Key), dirty_foldl(Fun, NxtAcc, Tab, NxtKey). Best Regards, Vladimir Sekissov rvg> Hi All, rvg> rvg> My question tonight is about iterating over an mnesia table with the rvg> lowest possible overhead to the VM. As far as I can see, a rvg> mnesia:foldl(...) call runs in a transaction and then blocks all other rvg> mnesia calls. How would I get to iterate over an entire table with as rvg> little as possible overhead? At the moment my table sits at about rvg> 100000 records and it takes almost 10s to iterate. Any ideas on how to rvg> speeds this up? rvg> rvg> Regards, rvg> rvg> Rudolph van Graan rvg> rvg> From samuel@REDACTED Thu Jul 8 15:37:47 2004 From: samuel@REDACTED (Samuel Rivas) Date: Thu, 8 Jul 2004 15:37:47 +0200 Subject: why catch gen_server; MOD:handle_call? In-Reply-To: <37FB7AA6F5F9814FB634A7BF4C35A6F54027D4@ESEALNT442.al.sw.ericsson.se> References: <37FB7AA6F5F9814FB634A7BF4C35A6F54027D4@ESEALNT442.al.sw.ericsson.se> Message-ID: <20040708133747.GB2106@crusher.lfcia.pri> Ulf Wiger wrote: > I would suggest that terminate/2 be used only to do > 'obvious' cleanup, i.e. the stuff you'll want to do > before a normal shutdown. This could involve explicitly > closing files that are open, unloading mibs, etc. > > Cleaning up possible inconsistencies should be done > after restart, even though telling the difference between > a normal start and a restart after error might be tricky. I think this problem should be addressed to the supervisor. You would be able to easily handle different restarts for normal and after-error restarts if supervisor could pass different arguments to start_link depending on the reason of the restart. I couldn't figure out how to do this with the actual implementation, so I have to do tricky (and ugly) things in the gen_servers. With the approach above you can carry out a smart separation of error-handling code and normal-code in the gen_server init function and leave the terminate function free of dreadful error-clean-up code. I recall reading something about a new supervisor implementation in this list some time ago, but I can't find the link ... -- Samuel From mlogan@REDACTED Thu Jul 8 16:20:04 2004 From: mlogan@REDACTED (Martin J. Logan) Date: 08 Jul 2004 09:20:04 -0500 Subject: why catch gen_server; MOD:handle_call? In-Reply-To: <16621.198.346547.307554@antilipe.corelatus.se> References: <1089238103.19845.113.camel@dhcp-lom-194-186.futuresource.com> <16621.198.346547.307554@antilipe.corelatus.se> Message-ID: <1089296404.19845.123.camel@dhcp-lom-194-186.futuresource.com> -snip- > > Moving the cleanup to a supervisor would discourage that type of > mistake, but the canned supervisors don't have any mechanism for a > process-specific cleanup. I'm not convinced they should, > either. Putting the cleanup code in the same module as the server > doesn't seem horrible, as long as you remember that you can't always > rely on the State variable being at true reflection of system state. > If you write code like this you're fine: > > terminate(normal, State) -> > % do anything you want, the State is consistent with the world > ok; > > terminate(shutdown, State) -> > % do anything you want, the State is consistent with the world > ok; > > terminate(Reason, Possibly_old_state) -> > % keep in mind that the State is not necessarily consistent > % with what has happened; the gen_server may have terminated > % while partway through a callback. > ok > I agree that this would be a solution. This is how I will write code in the future. I am now mindful of the issue. The thing is I don't remember seeing any cautionary in the docs and the problem is a rather subtle one. Many new coders and experienced ones alike could be bitten by this. Perhaps the otp guys could advertise this potential stumbling block to avoid users making a mistake with terminate. > I don't remember if they teach that in the advanced OTP course > (Francesco? Lennart?). Changing the emacs skeleton would be a > nudge in the right direction. > > Matthias From ulf.wiger@REDACTED Thu Jul 8 16:36:16 2004 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Thu, 8 Jul 2004 16:36:16 +0200 Subject: at Jungerl: proc_reg, a flexible process registration utility Message-ID: <37FB7AA6F5F9814FB634A7BF4C35A6F54027D9@ESEALNT442.al.sw.ericsson.se> I've written a small utility (an application) called proc_reg and committed it to Jungerl. It allows for registration of (local) processes using any erlang term. Furthermore, each process can register under several names. The program requires OTP R9C-2 (it uses ets:insert_new/2) The code is fast: - proc_reg:reg/2 takes ca 35 usec on my slow 400 MHz UltraSPARC (the register BIF takes ~10), - proc_reg:unreg/1 takes ca 40 usec (~10) - proc_reg:send/2 takes roughly as long as the registered send BIF (most likely a few microsecs longer) Semantically, I've tried to make it as similar and predictable as the BIFs, and it is designed to be fault-tolerant. It also scales well. There might be some noticeable slowdown with hundreds of registered names per process. Finally, I've added a test suite. If you want to play with the code, I recommend downloading the test server and using the test suites. Comments are welcome. Regards, Uffe From luke@REDACTED Thu Jul 8 17:00:56 2004 From: luke@REDACTED (Luke Gorrie) Date: Thu, 08 Jul 2004 17:00:56 +0200 Subject: at Jungerl: proc_reg, a flexible process registration utility In-Reply-To: <37FB7AA6F5F9814FB634A7BF4C35A6F54027D9@ESEALNT442.al.sw.ericsson.se> (Ulf Wiger's message of "Thu, 8 Jul 2004 16:36:16 +0200") References: <37FB7AA6F5F9814FB634A7BF4C35A6F54027D9@ESEALNT442.al.sw.ericsson.se> Message-ID: "Ulf Wiger (AL/EAB)" writes: > I've written a small utility (an application) called proc_reg and committed it to Jungerl. > > It allows for registration of (local) processes using any erlang term. > Furthermore, each process can register under several names. How're you using it? This seems to have the potential for making programs more transparent at runtime, by using a lot more names instead of always PIDs. That could be really nice. Is that the intention? Any nice examples? -Luke From ulf.wiger@REDACTED Thu Jul 8 17:23:38 2004 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Thu, 8 Jul 2004 17:23:38 +0200 Subject: at Jungerl: proc_reg, a flexible process registration utility Message-ID: <37FB7AA6F5F9814FB634A7BF4C35A6F54027DA@ESEALNT442.al.sw.ericsson.se> > -----Original Message----- > From: Luke Gorrie [mailto:lgorrie@REDACTED]On Behalf Of Luke > Gorrie > Sent: den 8 juli 2004 17:01 > To: Ulf Wiger (AL/EAB) > Cc: 'erlang-questions@REDACTED' > Subject: Re: at Jungerl: proc_reg, a flexible process registration > utility > > > "Ulf Wiger (AL/EAB)" writes: > > > I've written a small utility (an application) called > proc_reg and committed it to Jungerl. > > > > It allows for registration of (local) processes using any > erlang term. > > Furthermore, each process can register under several names. > > How're you using it? I'm not, yet. (: I just wrote it. > This seems to have the potential for making programs more transparent > at runtime, by using a lot more names instead of always PIDs. That > could be really nice. Is that the intention? Any nice examples? That's basically the intention. One application I had in mind was (surprise) call control, where you want to create a call ID, and then spawn a process that handles the signaling and resource allocation for that call; then, you would like to find this process based on the call ID. The 'dispatcher' contrib was one way of solving this; it also addressed the fact that you had a limited amount of processes, but as this limit keeps rising -- currently > 200,000 processes, this requirement becomes less interesting. One might note that global does the same thing, but on a global scale. Global also allows any term to be used as registered name, and allows multiple names per process. There are some differences, though: - proc_reg is faster than global even if only one node is involved (it's about 14x faster than global in the one-node case), but there's no way to restrict global to local registration only if you have multiple nodes, so then, the cost of registration will increase rather substantially. A global registration facility based on the 'locker' contrib ought to scale much better, but one doesn't necessarily want globally registered names in all situations. - If a registered process dies and is restarted, it cannot usually call global:register_name/2 again, but must instead use re_register_name/2. This is because global has not had time to notice the previous crash. Proc_reg doesn't suffer from this problem. - Correspondingly, if a globally registered process is restarted, and another process calls global:send/2, the message might be addressed to the old process before global has a chance to grasp what's happened. This cannot happen with proc_reg (granted, the message can arrive in the message queue of a process which then dies before handling the message, so one is still not 100% safe...) /Uffe From mscandar@REDACTED Thu Jul 8 23:34:06 2004 From: mscandar@REDACTED (Mark Scandariato) Date: Thu, 08 Jul 2004 17:34:06 -0400 Subject: Stand Alone Erlang initial processes... In-Reply-To: <40EC70B4.2060601@cisco.com> References: <40EC70B4.2060601@cisco.com> Message-ID: <40EDBDCE.2090306@cisco.com> After reading through boot_*.erl and friends as well as init.erl I feel like I have wandered into a twisty maze of little passages. Is it possible to use gen_udp with stand alone erlang? Mark. Mark Scandariato wrote: > I have an application that I'm trying to use with SAE, but it fails when > it tries to open a udp socket. > > Apparently, inet_db isn't loaded when an SAE application starts, and > can't be started: inet_db:start() calls inet_config:init(), which then > calls init:get_argument(loader) which of course fails, since init is > really "fake_demand_init". > > Any advice on getting SAE to be a little "heavier" when it starts would > be appreciated. > > Thanks, > Mark. > From andrew.nimmo@REDACTED Fri Jul 9 12:21:52 2004 From: andrew.nimmo@REDACTED (Andrew Nimmo) Date: Fri, 9 Jul 2004 11:21:52 +0100 Subject: [INFO] erlang | statistics on usage per platform Message-ID: <654377a4040709032119e8faf@mail.gmail.com> are there any statistics showing the distribution of platform usage for erlang work/development? i guess an initial guide would be the platform-based binary downloads, although in my case i tend to download the sources to build on macosx so accuracy wouldn't be high. regards andrew -- Andrew Nimmo e: andrew.nimmo@REDACTED u: http://internet.sh/ From ulf.wiger@REDACTED Fri Jul 9 15:08:13 2004 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 9 Jul 2004 15:08:13 +0200 Subject: plain_fsm support for hibernation Message-ID: <37FB7AA6F5F9814FB634A7BF4C35A6F54027DB@ESEALNT442.al.sw.ericsson.se> I've added support for hibernation in plain_fsm. It's checked into Jungerl, but it may be a while before the anonymous CVS is updated. The first one to actually find a use for this in a commercial application wins a free beer at the SIGPLAN Erlang Workshop 2004 in Snowbird! ;) The idea is based on the rather unique feature of erlang:hibernate/3 that it calls a user function when a message arrives, but _before_ it is consumed. If one inserts some bootstrapping code in the "wakeup" call, it's possible to automatically transform state before entering the code containing receive clauses. This allows for cleaner state machines, and also makes it reasonably convenient to upgrade lots of dynamic processes on-demand (there are other issues to consider as well, of course.) Example, from the fsm_example.erl module in plain_fsm: idle(S) -> plain_fsm:extended_receive( receive a -> io:format("going to state a~n", []), plain_fsm:hibernate(?MODULE,a,[S]); b -> io:format("going to state b~n", []), b(S) after 10000 -> io:format("timeout in idle~n", []), idle(S) end). a(S) -> receive b -> io:format("going to state b~n", []), plain_fsm:hibernate(?MODULE,b,[S]); idle -> io:format("going to state idle~n", []), idle(S) end. The function plain_fsm:hibernate/3 is transformed during compilation to the following: erlang:hibernate(plain_fsm,wake_up,[data_vsn(), fsm_example,fsm_example,a,[S]]); (You can inspect this by compiling with the -P option.) Combined with some helpful printouts from plain_fsm:wake_up/5 (commented out by default), we can get the following visualization: 17> P ! a. waking up, new code version - will call code_change(). messages: {messages,[a]} OldState = {newstate,3} a New state = {newstate,4} going to state a 18> l(fsm_example). {module,fsm_example} 19> P ! b. going to state b b 20> P ! b. waking up, new code version - will call code_change(). messages: {messages,[b]} OldState = {newstate,4} b New state = {newstate,5} /Uffe From yerl@REDACTED Fri Jul 9 22:35:40 2004 From: yerl@REDACTED (yerl@REDACTED) Date: Fri, 9 Jul 2004 22:35:40 CEST Subject: Stand Alone Erlang on otp_src_R9C-2 Message-ID: Hi All! I'm wondering if there exist a simple way to configure my SAE in the last erlang release. Ecc, ear and esh works fine but not elink. Mark Scandariato got the same problem in a previous message: http://www.erlang.org/ml-archive/erlang-questions/200404/msg00191.html This is an example of output error: elink -o ecat -m ecat erlang erl_open_port -s ecat main Cannot parse arguments:["-o", "ecat", "-m", "ecat", "erlang", "erl_open_port", "-s", "ecat", "main"] Usage: elink -t [windows | unix] [-d | -s] -o out[.exe] -S mod -m m1.beam m2.beam m2.beam ... elink seems to be not able to parse arguments correctly. Could you please give me some help? cheers /yerl From mscandar@REDACTED Sat Jul 10 00:01:32 2004 From: mscandar@REDACTED (Mark Scandariato) Date: Fri, 09 Jul 2004 18:01:32 -0400 Subject: Stand Alone Erlang on otp_src_R9C-2 In-Reply-To: References: Message-ID: <40EF15BC.4000002@cisco.com> Turns out you have to supply all the arguments, just so: elink -t unix -d -o ecat -S ecat -m ecat.beam ... and the module specifed via -S must have a start/1 to accept the command line arguments: start([_|Args]) -> .... (Args is a list of <<"arg">>) Mark. yerl@REDACTED wrote: > Hi All! > I'm wondering if there exist a simple way to configure my SAE in the last erlang release. > Ecc, ear and esh works fine but not elink. > > Mark Scandariato got the same problem in a previous message: > http://www.erlang.org/ml-archive/erlang-questions/200404/msg00191.html > > This is an example of output error: > elink -o ecat -m ecat erlang erl_open_port -s ecat main > Cannot parse arguments:["-o", > "ecat", > "-m", > "ecat", > "erlang", > "erl_open_port", > "-s", > "ecat", > "main"] > Usage: > elink -t [windows | unix] [-d | -s] -o out[.exe] > -S mod -m m1.beam m2.beam m2.beam ... > > elink seems to be not able to parse arguments correctly. > Could you please give me some help? > > cheers > /yerl > From nhead@REDACTED Sat Jul 10 11:06:27 2004 From: nhead@REDACTED (nhead@REDACTED) Date: Sat, 10 Jul 2004 11:06:27 +0200 Subject: Further bug fixes/updates to py_interface Message-ID: <20040710110627.594cad22.nhead@houbits.com> Assembled erlang folks, Tomas, Jimmy, I've been playing some more with py_interface (the erlang/python interface) and made some more corrections and changes: * I think it now deals properly with all kinds of lists (am I the only one who can't remember that "nodes()++node()" isn't really a proper list?) * it now properly decodes the extended format for references * I've changed the error handling a bit, which was silently hiding some nasties - * a couple of trivial editorial changes As I'm not sure which is the master version these days this patch set is against the 0.91 version and includes the 'Olgeni' patches again, although the "MAGIC_NIL adjustment" for the list endings is incorrect and superceded by what I think is the correct fix. Regards, Nigel. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt URL: From yerl@REDACTED Sat Jul 10 12:05:12 2004 From: yerl@REDACTED (yerl@REDACTED) Date: Sat, 10 Jul 2004 12:05:12 CEST Subject: Stand Alone Erlang on otp_src_R9C-2 Message-ID: Hi mark! Great! It works like a charm Regards, /Yerl ----Message d'origine---- >Date: Fri, 09 Jul 2004 18:01:32 -0400 >De: Mark Scandariato >A: erlang-questions@REDACTED >Sujet: Re: Stand Alone Erlang on otp_src_R9C-2 > >Turns out you have to supply all the arguments, just so: > >elink -t unix -d -o ecat -S ecat -m ecat.beam ... > >and the module specifed via -S must have a start/1 to accept the command line arguments: >start([_|Args]) -> > .... >(Args is a list of <<"arg">>) >Mark. > >yerl@REDACTED wrote: >> Hi All! >> I'm wondering if there exist a simple way to configure my SAE in the last erlang release. >> Ecc, ear and esh works fine but not elink. >> >> Mark Scandariato got the same problem in a previous message: >> http://www.erlang.org/ml-archive/erlang-questions/200404/msg00191.html >> >> This is an example of output error: >> elink -o ecat -m ecat erlang erl_open_port -s ecat main >> Cannot parse arguments:["-o", >> "ecat", >> "-m", >> "ecat", >> "erlang", >> "erl_open_port", >> "-s", >> "ecat", >> "main"] >> Usage: >> elink -t [windows | unix] [-d | -s] -o out[.exe] >> -S mod -m m1.beam m2.beam m2.beam ... >> >> elink seems to be not able to parse arguments correctly. >> Could you please give me some help? >> >> cheers >> /yerl >> > > From csanto@REDACTED Mon Jul 12 19:04:37 2004 From: csanto@REDACTED (Corrado Santoro) Date: 12 Jul 2004 19:04:37 +0200 Subject: Announce: an erlang platform for agent programming Message-ID: <1089651877.2132.2.camel@csanto.diit.unict.it> Dear Erlang gurus, I would like to announce a new platform for programming Software Agents with Erlang. The platform is called "eXAT" (erlang eXperimental Agent Platform) and provides an "all-in-one framework" allowing to design, with a single tool, agent intelligence, agent behaviour and agent communication. eXAT integrates an Erlang-based expert system engine with an execution environment for agent behaviours, based on object-oriented finite-state machines, and a module able to handle agent messaging. All information can be found on the eXAT Web page: http://www.diit.unict.it/users/csanto/exat/index.html There you may find some papers and the eXAT reference manual. There, you may also download the platform. eXAT was presented, for the first time, at the italian "Workshop on Objects and Agents (WOA 2003)", held last year in Sardinia (see http://www.diee.unica.it/woa03/), and it gained a discrete interest from people traditionally working with Java-based tools. An improvement of eXAT was then presented at the international IEEE "Workshop on Agent-based Computing for Enterprise Collaboration (ACEC 2004)", held at WETICE 2004 in Modena (see http://siplab.csee.wvu.edu/wetice04/). In this occasion, eXAT gained a so high interest that the paper received the "Best Paper Award". Currently, only a beta version of the platform can be downloaded from the web site. The first release is scheduled for the end of September 2004, when the eXAT platform will be "officially" presented at the Agent Exhibition that will be held in Erfurt (Germany) at NetObjectDays 2004 (http://dawis.informatik.uni-essen.de/agents/cfp/). Further messages will be sent to this mailing list when any news on eXAT will be available. In any case, I would appreciate any comment on the functionalities of the platform, the design choices made or anything you think could improve eXAT. All the best, -Corrado -- ====================================================== Eng. Corrado Santoro, Ph.D. University of Catania - Engineering Faculty Department of Computer Science and Telecommunications Engineering Viale A. Doria, 6 - 95125 CATANIA (ITALY) Tel: +39 095 7382380 Fax: +39 095 7382397 +39 095 7382365 +39 095 7382364 EMail: csanto@REDACTED Personal Home Page: http://www.diit.unict.it/users/csanto NUXI Home Page: http://nuxi.iit.unict.it ====================================================== From csanto@REDACTED Tue Jul 13 00:05:21 2004 From: csanto@REDACTED (Corrado Santoro) Date: Tue, 13 Jul 2004 00:05:21 +0200 Subject: Announce: an erlang platform for agent programming In-Reply-To: References: Message-ID: <1089669921.40f30b21bc027@www.cdc.unict.it> You are right. Indeed the tarball already contains the "beam" files, so you shouldn't compile it. However, I know that having the source code is better :-) So, now the tarball that can be downloaded from the eXAT web site should be OK. In also contains a README explaining directory structure and how to compile the source. Please let me know if you have further problems. Best regards, -Corrado Quoting yerl@REDACTED: > Hi Corrado, > It seems that "acl.yrl" and "object.hrl" is missing in the eXAT source. > > erlc -b beam acl.erl > /usr/ports/yhafri/exat/eXAT-0.1.0/src/acl.erl:66: can't find include file > "object.hrl" > /usr/ports/yhafri/exat/eXAT-0.1.0/src/acl.erl:169: record object undefined > /usr/ports/yhafri/exat/eXAT-0.1.0/src/acl.erl:179: record object undefined > make: *** [acl.beam] Error 1 > > Where can I find them? > > Regards, > /ycrux > > > > ----Message d'origine---- > >Sujet: Announce: an erlang platform for agent programming > >De: Corrado Santoro > >A: Erlang Questions > >Date: 12 Jul 2004 19:04:37 +0200 > > > >Dear Erlang gurus, > > > >I would like to announce a new platform for programming Software Agents > >with Erlang. > > > >The platform is called "eXAT" (erlang eXperimental Agent Platform) and > >provides an "all-in-one framework" allowing to design, with a single > >tool, agent intelligence, agent behaviour and agent communication. > > > >eXAT integrates an Erlang-based expert system engine with an execution > >environment for agent behaviours, based on object-oriented finite-state > >machines, and a module able to handle agent messaging. > > > >All information can be found on the eXAT Web page: > > > >http://www.diit.unict.it/users/csanto/exat/index.html > > > >There you may find some papers and the eXAT reference manual. There, you > >may also download the platform. > > > >eXAT was presented, for the first time, at the italian "Workshop on > >Objects and Agents (WOA 2003)", held last year in Sardinia > >(see http://www.diee.unica.it/woa03/), and it gained a discrete interest > >from people traditionally working with Java-based tools. > > > >An improvement of eXAT was then presented at the international IEEE > >"Workshop on Agent-based Computing for Enterprise Collaboration (ACEC > >2004)", held at WETICE 2004 in Modena > >(see http://siplab.csee.wvu.edu/wetice04/). In this occasion, eXAT > >gained a so high interest that the paper received the "Best Paper > >Award". > > > >Currently, only a beta version of the platform can be downloaded from > >the web site. The first release is scheduled for the end of September > >2004, when the eXAT platform will be "officially" presented at the Agent > >Exhibition that will be held in Erfurt (Germany) at NetObjectDays 2004 > >(http://dawis.informatik.uni-essen.de/agents/cfp/). > > > >Further messages will be sent to this mailing list when any news on eXAT > >will be available. > > > >In any case, I would appreciate any comment on the functionalities of > >the platform, the design choices made or anything you think could > >improve eXAT. > > > >All the best, > >-Corrado > > > > > >-- > >====================================================== > >Eng. Corrado Santoro, Ph.D. > > > >University of Catania - Engineering Faculty > >Department of Computer Science and > >Telecommunications Engineering > >Viale A. Doria, 6 - 95125 CATANIA (ITALY) > > > >Tel: +39 095 7382380 Fax: +39 095 7382397 > > +39 095 7382365 > > +39 095 7382364 > > > >EMail: csanto@REDACTED > >Personal Home Page: > > http://www.diit.unict.it/users/csanto > > > >NUXI Home Page: > > http://nuxi.iit.unict.it > >====================================================== > > > > > > > > -- ====================================================== Eng. Corrado Santoro, Ph.D. University of Catania - Engineering Faculty Department of Computer Science and Telecommunications Engineering Viale A. Doria, 6 - 95125 CATANIA (ITALY) Tel: +39 095 7382380 Fax: +39 095 338280 +39 095 7382365 +39 095 7382364 EMail: csanto@REDACTED Personal Home Page: http://www.diit.unict.it/users/csanto NUXI Home Page: http://nuxi.iit.unict.it ====================================================== ------------------------------------------------- This mail sent through IMP: http://www.cdc.unict.it/ From Jouni.Ryno@REDACTED Tue Jul 13 07:53:56 2004 From: Jouni.Ryno@REDACTED (Jouni =?ISO-8859-1?Q?Ryn=F6?=) Date: Tue, 13 Jul 2004 08:53:56 +0300 Subject: mnesia, large datasets and key range lookups Message-ID: <1089698036.14846.7.camel@adic.fmi.fi> Dear all Just wondering, what one should do: My data contains irregularly (in time) taken measurements. At a time there can be anything from 1 to 30 something measurements. So the first logical start is to define -record(time_parameter, {time, parameter, value}). then to define mnesia table like this mnesia:create_table(time_parameter,[{type, bag}, {disc_only_copies, [node()]}, {attributes, record_info(fields, time_parameter)}] Now each time key can contain several parameters. But as there can be thousands of measurements per day, the DB-files will become really large. A weeks data took about 800 MBytes ... No problem with the disc space, but with the searching of the data (for correlating data with the housekeeping parameters). Searching for random parameter for a certain time interval dirty_para_request(Parameter, StartTime, EndTime) -> Sel = [{#time_parameter{parameter=Parameter, time='$1', value='_'}, [{'<',{const,StartTime},'$1'},{'=<','$1',{const,EndTime}}], ['$_']}], mnesia:dirty_select(time_parameter, Sel). will now take about 4 minutes, as Mnesia has to scan trough the full DB. Extrapolating this even for a years operation means, that one has to do something else. So far the only thing I can think about, is to split the db-tables to daily tables. Then first select the relevant tables by name (based on the time) and make the search from those tables only. But are there any other solutions? regards Jouni -- Jouni Ryn? mailto://Jouni.Ryno@REDACTED/ http://www.geo.fmi.fi/~ryno/ Finnish Meteorological Institute http://www.fmi.fi/ Space Research http://www.geo.fmi.fi/ P.O.BOX 503 Tel (+358)-9-19294656 FIN-00101 Helsinki FAX (+358)-9-19294603 Finland priv-GSM (+358)-50-5302903 "It's just zeros and ones, it cannot be hard" From spearce@REDACTED Tue Jul 13 08:58:11 2004 From: spearce@REDACTED (Shawn Pearce) Date: Tue, 13 Jul 2004 02:58:11 -0400 Subject: mnesia, large datasets and key range lookups In-Reply-To: <1089698036.14846.7.camel@adic.fmi.fi> References: <1089698036.14846.7.camel@adic.fmi.fi> Message-ID: <20040713065811.GJ10806@spearce.org> This is where I wish mnesia had compound key indexes. My suggestion is pretty simple. Add another attribute for the key and use that: -record(time_parameter, {key, time, parameter, value}). create_tables() -> mnesia:create_table(time_parameter,[{type, set}, {disc_only_copies, [node()]}, {attributes, record_info(fields, time_parameter)}]). make_key(#time_parameter{time=T, parameter=P}) -> {T, P}. add_sample(V) -> V2 = V#time_parameter{ key = make_key(V) }, mensia:write(V2). Then match becomes: dirty_para_request(Parameter, StartTime, EndTime) -> Sel = [{#time_parameter{parameter=Parameter, key='$1', value='_'}, [{'<',{const,{StartTime,Parameter}},'$1'}, {'=<','$1',{const,{EndTime,Parameter}}}], ['$_']}], mnesia:dirty_select(time_parameter, Sel). Hopefully this will make mnesia use a key range scan. But note the above is untested. :) I'm basing this on the fact that tuples are sortable. However because other parameters can exist for a given time value, I am still filtering on the parameter attribute during the dirty_select. Insert performance is going to slow down as Mnesia must validate if the tuple is already in the table or not. Mnesia simply may not be the best database for your application. You might find other solutions based off pure dets, the gridfile contrib or a SQL database to give you higher performance. Jouni Ryn? wrote: > Dear all > > Just wondering, what one should do: > > My data contains irregularly (in time) taken measurements. At a time > there can be anything from 1 to 30 something measurements. > > So the first logical start is to define > -record(time_parameter, {time, parameter, value}). > > then to define mnesia table like this > mnesia:create_table(time_parameter,[{type, bag}, > {disc_only_copies, [node()]}, > {attributes, record_info(fields, time_parameter)}] > > Now each time key can contain several parameters. But as there can be > thousands of measurements per day, the DB-files will > become really large. A weeks data took about 800 MBytes ... > > No problem with the disc space, but with the searching of the data (for > correlating data with the housekeeping parameters). Searching for random > parameter for a certain time interval > > dirty_para_request(Parameter, StartTime, EndTime) -> > Sel = [{#time_parameter{parameter=Parameter, > time='$1', value='_'}, > [{'<',{const,StartTime},'$1'},{'=<','$1',{const,EndTime}}], > ['$_']}], > mnesia:dirty_select(time_parameter, Sel). > > will now take about 4 minutes, as Mnesia has to scan trough the full DB. > Extrapolating this even for a years operation means, that one has to do > something else. > > So far the only thing I can think about, is to split the db-tables to > daily tables. Then first select the relevant tables by name (based on > the time) and make the search from those tables only. > > But are there any other solutions? -- Shawn. From ulf.wiger@REDACTED Thu Jul 15 10:15:29 2004 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Thu, 15 Jul 2004 10:15:29 +0200 Subject: mnesia, large datasets and key range lookups In-Reply-To: <20040713065811.GJ10806@spearce.org> References: <1089698036.14846.7.camel@adic.fmi.fi> <20040713065811.GJ10806@spearce.org> Message-ID: On Tue, 13 Jul 2004 02:58:11 -0400, Shawn Pearce wrote: > This is where I wish mnesia had compound key indexes. My suggestion > is pretty simple. Add another attribute for the key and use that: > > -record(time_parameter, {key, time, parameter, value}). > > create_tables() -> > mnesia:create_table(time_parameter,[{type, set}, > {disc_only_copies, [node()]}, > {attributes, record_info(fields, > time_parameter)}]). > > make_key(#time_parameter{time=T, parameter=P}) -> > {T, P}. > > add_sample(V) -> > V2 = V#time_parameter{ key = make_key(V) }, > mensia:write(V2). > > Then match becomes: > > dirty_para_request(Parameter, StartTime, EndTime) -> > Sel = [{#time_parameter{parameter=Parameter, > key='$1', value='_'}, > [{'<',{const,{StartTime,Parameter}},'$1'}, > {'=<','$1',{const,{EndTime,Parameter}}}], > ['$_']}], > mnesia:dirty_select(time_parameter, Sel). > > > Hopefully this will make mnesia use a key range scan. But note the > above is untested. :) For mnesia to perform the above search smartly, you'd have to use an 'ordered_set' table. Then, specifying the first part of the key, and leaving the rest unspecified works very well. One problem is that dets doesn't support ordered set, so you'd also have to change it to a disc_copy table -- this, in it's turn -- might be problematic given the size of the data set. One thing you could play around with is to use fragmented tables, with one fragment per day, and a customized frag_hash algorithm, selecting fragment based on the date. This will allow you to keep a single-table view, while being able to narrow your searches based on time. Check the reference manual for mnesia_frag_hash to find out how to use the callback behaviour for custom fragmentation policies. It's not that difficult. There is also some sample code to look at in the mnesia source (apologies for not just writing down the solution, but I have some children here calling for my attention.) http://www.erlang.org/doc/r9c/lib/mnesia-4.1.4/doc/html/mnesia_frag_hash.html /Uffe -- Ulf Wiger From Nigel.Head@REDACTED Tue Jul 13 11:13:32 2004 From: Nigel.Head@REDACTED (Nigel.Head@REDACTED) Date: Tue, 13 Jul 2004 11:13:32 +0200 Subject: mnesia, large datasets and key range lookups Message-ID: <41256ED0.00381B4F.00@esocmail2.esoc.esa.int> > make_key(#time_parameter{time=T, parameter=P}) -> > {T, P}.N. While I'm not exactly sure what the exact application is, the original post said there might be upto about 30 parameters at any given time. Why is it strictly necessary to have the parameter itself as part of the key. I would go for making the record contain the time (as a key) and a list of parameter values for that time. The list can be variable length, of course. This would reduce the number of records by some factor of 10 or so; locating the specific parameter you're after would then be some sort of application level list search -- didn't ought to be too expensive for a list of max 30 long. Chances are you'll be needing other parameters from the same time real soon in your processing anyway. Regards, N. From Jouni.Ryno@REDACTED Tue Jul 13 11:40:49 2004 From: Jouni.Ryno@REDACTED (Jouni =?ISO-8859-1?Q?Ryn=F6?=) Date: Tue, 13 Jul 2004 12:40:49 +0300 Subject: mnesia, large datasets and key range lookups In-Reply-To: <41256ED0.00381B4F.00@esocmail2.esoc.esa.int> References: <41256ED0.00381B4F.00@esocmail2.esoc.esa.int> Message-ID: <1089711649.14846.35.camel@adic.fmi.fi> On Tue, 2004-07-13 at 11:13 +0200, Nigel.Head@REDACTED wrote: > > make_key(#time_parameter{time=T, parameter=P}) -> > > {T, P}.N. > > While I'm not exactly sure what the exact application is, Telemetry data from one of the Rosetta instruments :) > the original post said > there might be upto about 30 parameters at any given time. Why is it strictly > necessary to have the parameter itself as part of the key. I would go for making > the record contain the time (as a key) and a list of parameter values for that > time. The list can be variable length, of course. > Different telemetry packets can contain the same parameters different order. Actually, the order is usually the same, but it's only a subset of the full parameter set. > This would reduce the number of records by some factor of 10 or so; locating the > specific parameter you're after would then be some sort of application level > list search -- didn't ought to be too expensive for a list of max 30 long. > Chances are you'll be needing other parameters from the same time real soon in > your processing anyway. > For the list searching I would have to identify the order of the parameters in each time point. Which is kind of having the raw telemetry data itself. Exactly, what I try get rid of by using the mnesia :) Hmm, I could use tuples in the list, like this [{NCSA0005, Value}, {NCSA0010, Value2}, ...]. That could be scanned pretty easy with lists:keysearch. On the other hand, mnesia does that to me, see below. The interesting part of this email :) is that the time taken is not so dependant on the number of the parameters in each time stamp. It depends (only) from the size of the table itself, as mnesia has to (?, I think) scan through the whole table to find the keys. It's not an ordered set, but a bag. So this search: Selection is [{{time_parameter,'$1','$2','_'}, [{'<',{const,1607.54},'$1'}, {'=<','$1',{const,1607.58}}, {'orelse',{'=:=',{const,"NCSA0005"},'$2'}, {'=:=',{const,"NCSA0010"},'$2'}, {'=:=',{const,"NCSA0014"},'$2'}, {'=:=',{const,"NCSA0016"},'$2'}, {'=:=',{const,"NCSA0018"},'$2'}}], ['$_']}] is not really time dependant on the number of those parameters ($2) (compared to the total time of the search). And yes, like you thought, I do need the other parameters real soon :) So I think (at the moment), that the best route is to first narrow the search range by some kind of fragmented tables. I'll let you know ... regards Jouni -- Jouni Ryn? mailto://Jouni.Ryno@REDACTED/ http://www.geo.fmi.fi/~ryno/ Finnish Meteorological Institute http://www.fmi.fi/ Space Research http://www.geo.fmi.fi/ P.O.BOX 503 Tel (+358)-9-19294656 FIN-00101 Helsinki FAX (+358)-9-19294603 Finland priv-GSM (+358)-50-5302903 "It's just zeros and ones, it cannot be hard" From Nigel.Head@REDACTED Tue Jul 13 11:59:27 2004 From: Nigel.Head@REDACTED (Nigel.Head@REDACTED) Date: Tue, 13 Jul 2004 11:59:27 +0200 Subject: mnesia, large datasets and key range lookups Message-ID: <41256ED0.003C4F07.00@esocmail2.esoc.esa.int> > Telemetry data from one of the Rosetta instruments :) Lo, a fellow spaceman :-) > Hmm, I could use tuples in the list, like this [{NCSA0005, Value}, > {NCSA0010, Value2}, ...]. That could be scanned pretty easy with > lists:keysearch. On the other hand, mnesia does that to me, see below. lists:keysearch is exactly what I was implying .... > [..] > It's not an ordered set, but a bag. Yes, but if you put all the parameters for one timestamp into one record, and have a key which is only the time, then it COULD be an ordered set, with all the advantages that brings. That's effectively what our archiving systems do here, for exectly the performance reason you're investigating (of course, and unfortunately, our systems are not implemented in Erlang -- maybe one day I can change that!). > And yes, like you thought, I do need the other parameters real soon Then it's sensible to grab them all in one mnesia access anyway. N. From Jouni.Ryno@REDACTED Tue Jul 13 12:35:34 2004 From: Jouni.Ryno@REDACTED (Jouni =?ISO-8859-1?Q?Ryn=F6?=) Date: Tue, 13 Jul 2004 13:35:34 +0300 Subject: mnesia, large datasets and key range lookups In-Reply-To: <41256ED0.003C4F07.00@esocmail2.esoc.esa.int> References: <41256ED0.003C4F07.00@esocmail2.esoc.esa.int> Message-ID: <1089714935.14846.42.camel@adic.fmi.fi> On Tue, 2004-07-13 at 11:59 +0200, Nigel.Head@REDACTED wrote: > > [..] > > It's not an ordered set, but a bag. > > Yes, but if you put all the parameters for one timestamp into one record, and > have a key which is only the time, then it COULD be an ordered set, with all the > advantages that brings. That's effectively what our archiving systems do here, > for exectly the performance reason you're investigating (of course, and > unfortunately, our systems are not implemented in Erlang -- maybe one day I can > change that!). > Maybe the day, when this statement from the mnesia manual disappears: "Note: currently 'ordered_set' is not supported for 'disc_only_copies' tables." I don't think I have enough memory in my machines to keep the data in the RAM :(. The fragmented tables feature in the mnesia seems at the moment at least a fun way to continue ... Jouni -- Jouni Ryn? mailto://Jouni.Ryno@REDACTED/ http://www.geo.fmi.fi/~ryno/ Finnish Meteorological Institute http://www.fmi.fi/ Space Research http://www.geo.fmi.fi/ P.O.BOX 503 Tel (+358)-9-19294656 FIN-00101 Helsinki FAX (+358)-9-19294603 Finland priv-GSM (+358)-50-5302903 "It's just zeros and ones, it cannot be hard" From Nigel.Head@REDACTED Tue Jul 13 14:08:57 2004 From: Nigel.Head@REDACTED (Nigel.Head@REDACTED) Date: Tue, 13 Jul 2004 14:08:57 +0200 Subject: mnesia, large datasets and key range lookups Message-ID: <41256ED0.00482A7E.00@esocmail2.esoc.esa.int> > "Note: currently 'ordered_set' is not supported for 'disc_only_copies' tables." > I don't think I have enough memory in my machines to keep the data in the RAM :(. Ah yes, I can see how that would be a problem >-] N. From alexey@REDACTED Tue Jul 13 15:15:50 2004 From: alexey@REDACTED (Alexey Shchepin) Date: Tue, 13 Jul 2004 16:15:50 +0300 Subject: ejabberd 0.7 released Message-ID: <87658skpyx.fsf@office.sevcom.net> Hi! I would like to announce the new stable release of ejabberd 0.7. Release highlights: * Support for LDAP authentification * Subscription and xml:lang processing updated to latest xmpp drafts * Support for HTTP Polling * Support for web-based administration interface * Added command-line administration utility "ejabberdctl" * Support for history management in MUC rooms * Support for "/quote" command in IRC gateway Upgrading from ejabberd-0.5: * Formats of some DB tables are changed, and ejabberd-0.7 will convert them during startup. This can lead to slower first startup after upgrade. * Access rules for mod_muc and mod_register now should be specified explicitly, i.e. replace {mod_register, []}, {mod_muc, []}, with {mod_register, [{access, register}]}, {mod_muc, [{access_admin, muc_admin}]}, Check documentation and ejabberd.cfg.example for other new options. I18N: There are few translation files in src/msgs/ directory. If you're using ejabberd and you would like to provide the translation file for you native language, please contact me. http://ejabberd.jabberstudio.org/ From Jouni.Ryno@REDACTED Tue Jul 13 15:41:14 2004 From: Jouni.Ryno@REDACTED (Jouni =?ISO-8859-1?Q?Ryn=F6?=) Date: Tue, 13 Jul 2004 16:41:14 +0300 Subject: mnesia, large datasets and key range lookups In-Reply-To: References: <1089698036.14846.7.camel@adic.fmi.fi> <20040713065811.GJ10806@spearce.org> Message-ID: <1089726074.14846.67.camel@adic.fmi.fi> On Thu, 2004-07-15 at 10:15 +0200, Ulf Wiger wrote: > > One thing you could play around with is to use fragmented tables, with > one fragment per day, and a customized frag_hash algorithm, selecting > fragment based on the date. This will allow you to keep a single-table > view, while being able to narrow your searches based on time. > > Check the reference manual for mnesia_frag_hash to find out how to use > the callback behaviour for custom fragmentation policies. It's not > that difficult. There is also some sample code to look at in the > mnesia source (apologies for not just writing down the solution, but > I have some children here calling for my attention.) > Took a fast look on the mnesia_frag_hash.erl: that would be simple Took a fast look on the mnesia_frag.erl: Makes one wonder ... What I would need to do, is to misuse the fragmentation concept. I could use some base date (like 20040101), then define the fragment number as (record_date - base_date). Finally in the year 2014 I would have about 5000 fragments. I could live with that. I guess upon adding new data, I should check the date and call the mnesia:change_table_frag(time_parameters, {add_frag, [db@REDACTED]}) enough times to have fragments up to present date. Am I on the right track? The match_spec_to_frag_numbers could become quite a special case, as it would have to match many of the fancy select cases I could think about. Writing a real parser for it could be an overkill :) regards Jouni -- Jouni Ryn? mailto://Jouni.Ryno@REDACTED/ http://www.geo.fmi.fi/~ryno/ Finnish Meteorological Institute http://www.fmi.fi/ Space Research http://www.geo.fmi.fi/ P.O.BOX 503 Tel (+358)-9-19294656 FIN-00101 Helsinki FAX (+358)-9-19294603 Finland priv-GSM (+358)-50-5302903 "It's just zeros and ones, it cannot be hard" From yerl@REDACTED Tue Jul 13 15:49:36 2004 From: yerl@REDACTED (yerl@REDACTED) Date: Tue, 13 Jul 2004 15:49:36 CEST Subject: Announce: an erlang platform for agent programming Message-ID: Hi All! I packaged erlang-R9C-2, wings-0.98.22c, eXAT-0.1.0, dialyzer-1.0.0, eres-0.0.2.alpha, esdl-0.94.0615, yaws-1.48, escript-3.0 to Crux linux ditribution. You can find them at: http://perso.club-internet.fr/yhafri/crux/index.html If you are using this cool distrib, just type: # cd /usr/port/yhafri/YOUR_PACKAGE # pkgmk -d -i Regards, /yerl ----Message d'origine---- >Date: Tue, 13 Jul 2004 00:05:21 +0200 >De: Corrado Santoro >A: yerl@REDACTED >Copie ?: erlang-questions@REDACTED >Sujet: Re: Announce: an erlang platform for agent programming > >You are right. > >Indeed the tarball already contains the "beam" files, so you shouldn't compile >it. > >However, I know that having the source code is better :-) > >So, now the tarball that can be downloaded from the eXAT web site should be >OK. >In also contains a README explaining directory structure and how to compile >the source. > >Please let me know if you have further problems. > >Best regards, >-Corrado > >Quoting yerl@REDACTED: > >> Hi Corrado, >> It seems that "acl.yrl" and "object.hrl" is missing in the eXAT source. >> >> erlc -b beam acl.erl >> /usr/ports/yhafri/exat/eXAT-0.1.0/src/acl.erl:66: can't find include file >> "object.hrl" >> /usr/ports/yhafri/exat/eXAT-0.1.0/src/acl.erl:169: record object undefined >> /usr/ports/yhafri/exat/eXAT-0.1.0/src/acl.erl:179: record object undefined >> make: *** [acl.beam] Error 1 >> >> Where can I find them? >> >> Regards, >> /ycrux >> >> >> >> ----Message d'origine---- >> >Sujet: Announce: an erlang platform for agent programming >> >De: Corrado Santoro >> >A: Erlang Questions >> >Date: 12 Jul 2004 19:04:37 +0200 >> > >> >Dear Erlang gurus, >> > >> >I would like to announce a new platform for programming Software Agents >> >with Erlang. >> > >> >The platform is called "eXAT" (erlang eXperimental Agent Platform) and >> >provides an "all-in-one framework" allowing to design, with a single >> >tool, agent intelligence, agent behaviour and agent communication. >> > >> >eXAT integrates an Erlang-based expert system engine with an execution >> >environment for agent behaviours, based on object-oriented finite-state >> >machines, and a module able to handle agent messaging. >> > >> >All information can be found on the eXAT Web page: >> > >> >http://www.diit.unict.it/users/csanto/exat/index.html >> > >> >There you may find some papers and the eXAT reference manual. There, you >> >may also download the platform. >> > >> >eXAT was presented, for the first time, at the italian "Workshop on >> >Objects and Agents (WOA 2003)", held last year in Sardinia >> >(see http://www.diee.unica.it/woa03/), and it gained a discrete interest >> >from people traditionally working with Java-based tools. >> > >> >An improvement of eXAT was then presented at the international IEEE >> >"Workshop on Agent-based Computing for Enterprise Collaboration (ACEC >> >2004)", held at WETICE 2004 in Modena >> >(see http://siplab.csee.wvu.edu/wetice04/). In this occasion, eXAT >> >gained a so high interest that the paper received the "Best Paper >> >Award". >> > >> >Currently, only a beta version of the platform can be downloaded from >> >the web site. The first release is scheduled for the end of September >> >2004, when the eXAT platform will be "officially" presented at the Agent >> >Exhibition that will be held in Erfurt (Germany) at NetObjectDays 2004 >> >(http://dawis.informatik.uni-essen.de/agents/cfp/). >> > >> >Further messages will be sent to this mailing list when any news on eXAT >> >will be available. >> > >> >In any case, I would appreciate any comment on the functionalities of >> >the platform, the design choices made or anything you think could >> >improve eXAT. >> > >> >All the best, >> >-Corrado >> > >> > >> >-- >> >====================================================== >> >Eng. Corrado Santoro, Ph.D. >> > >> >University of Catania - Engineering Faculty >> >Department of Computer Science and >> >Telecommunications Engineering >> >Viale A. Doria, 6 - 95125 CATANIA (ITALY) >> > >> >Tel: +39 095 7382380 Fax: +39 095 7382397 >> > +39 095 7382365 >> > +39 095 7382364 >> > >> >EMail: csanto@REDACTED >> >Personal Home Page: >> > http://www.diit.unict.it/users/csanto >> > >> >NUXI Home Page: >> > http://nuxi.iit.unict.it >> >====================================================== >> > >> > >> > >> >> > > > >-- >====================================================== >Eng. Corrado Santoro, Ph.D. > >University of Catania - Engineering Faculty >Department of Computer Science and >Telecommunications Engineering >Viale A. Doria, 6 - 95125 CATANIA (ITALY) > >Tel: +39 095 7382380 Fax: +39 095 338280 > +39 095 7382365 > +39 095 7382364 > >EMail: csanto@REDACTED >Personal Home Page: > http://www.diit.unict.it/users/csanto > >NUXI Home Page: > http://nuxi.iit.unict.it >====================================================== > >------------------------------------------------- >This mail sent through IMP: http://www.cdc.unict.it/ > > From Anders.Nygren@REDACTED Tue Jul 13 18:35:35 2004 From: Anders.Nygren@REDACTED (Anders Nygren) Date: Tue, 13 Jul 2004 11:35:35 -0500 (CDT) Subject: RRDTool, (was Re: mnesia, large datasets and key range lookups) Message-ID: <776177.1089736535429.SLOX.WebMail.wwwrun@marte.txm.com.mx> Hi I dont know if this can be useful for the original question, but I thougth that this could be a good time to mention that I have made an erlang interface to RRDTool. -------------------------------------------------------------------------------------------------------------------------- See http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/ for more info on RRDTool. RRDTool has two main parts a) A database for timeseries data b) A graphing tool The database assumes that data is sampled at regular intervals, e.g. every 5 min. If it does not receive data at the exact times it will interpolate. It has functions for aggregation of data, so for instance You can keep one set of data in 5 min intervals for 2 days, 1 hour intervals for 3 week, etc (You get the idea). ------------------------------------------------------------------------------------------------------------------------- The erlang rrdtool interface consists of two parts rrd_lib: - library with most rrdtool functions, communicates with one rrdtool process via a port. rrdtool: - server that keeps several workers that each controls one rrdtool process - file locking to prevent concurrent updates to the same rrd file I am also working on a higher level interface that will hide some of the rrdtool details from the erlang program. I have not put it up for download anywhere yet but if there is interest I can do that. /Anders Nygren From Anders.Nygren@REDACTED Tue Jul 13 19:25:45 2004 From: Anders.Nygren@REDACTED (Anders Nygren) Date: Tue, 13 Jul 2004 12:25:45 -0500 (CDT) Subject: Debugger bug Message-ID: <1432120.1089739545898.SLOX.WebMail.wwwrun@marte.txm.com.mx> I tried to send this some time ago but it never made it to the list. So here we go again. /Anders Nygren Hi I think I have found a bug in the debugger. Set a breakpoint on line 61 in bug1:handle_call({crash,A,B,C},From,State) 4> bug1:start_link(). {ok,<0.59.0>} 5> bug1:crash(). In the debugger press continue. =ERROR REPORT==== 15-Jun-2004::08:57:41 === ** Generic server bug1 terminating ** Last message in was {crash,a,b,c} ** When Server state == {state} ** Reason for termination == ** [{does_not_exist,a,b}] ** exited: [{does_not_exist,a,b}] ** 6> =CRASH REPORT==== 15-Jun-2004::08:57:41 === crasher: pid: <0.59.0> registered_name: bug1 error_info: [{does_not_exist,a,b}] initial_call: {gen,init_it, [gen_server,<0.24.0>,<0.24.0>,{local,bug1},bug1,[],[]]} ancestors: [<0.24.0>] messages: [] links: [<0.24.0>,<0.65.0>] dictionary: [] trap_exit: false status: running heap_size: 233 stack_size: 21 reductions: 187 neighbours: neighbour: [{pid,<0.24.0>}, {registered_name,[]}, {initial_call,{erlang,apply,2}}, {current_function,{gen,wait_resp_mon,3}}, {ancestors,[]}, {messages,[]}, {links,[<0.23.0>,<0.52.0>,<0.59.0>]}, {dictionary,[]}, {trap_exit,false}, {status,waiting}, {heap_size,233}, {stack_size,27}, {reductions,1330}] =ERROR REPORT==== 15-Jun-2004::08:57:41 === Bad value on output port '/usr/bin/wish8.4 /usr/local/lib/erlang/lib/gs-1.5.2/ priv/gstk.tcl -- /usr/local/lib/erlang/lib/gs-1.5.2/priv' gs error: kernel backend died reason {port_handler,#Port<0.52>,badsig} GS frontend. Last mgs in was:{'EXIT',<0.44.0>, {port_handler,#Port<0.52>,badsig}} exit:{'EXIT',<0.44.0>,{port_handler,#Port<0.52>,badsig}} Reason: {'EXIT',{gs_kernel_died,{port_handler,#Port<0.52>,badsig}}} =================================================================== After this all debugger windows disappear and I can not start the debugger again. I use R9C-0 on SuSE 9.0 /Anders Nygren -------------- next part -------------- A non-text attachment was scrubbed... Name: bug1.erl.gz Type: application/x-gzip Size: 761 bytes Desc: not available URL: From dietmar@REDACTED Wed Jul 14 16:44:31 2004 From: dietmar@REDACTED (Dietmar Admin Schaefer) Date: Wed, 14 Jul 2004 14:44:31 +0000 Subject: a simple(?) gen_tcp question Message-ID: <40F546CF.9040409@ast.dfs.de> Hi ! Can somebody please tell me why I get exited: {undef,[{gen_tcp,listen,[5678,[binary,{packet,0},{active,false}]]}, {mygen_tcp,server,0}]} ** when I try to start my (test)program ? -module(mygen_tcp). -define(PORT,5678). -export([start/0, client/0, server/0]). start() -> io:format("o.k. I will listen on port ~p~n", [?PORT]), io:format("o.k. I will send on port ~p~n", [?PORT]), spawn_link(?MODULE, server, []), spawn_link(?MODULE, client, []). client() -> MyHost = "localhost", {ok, Sock} = gen_tcp:connect(MyHost, 5678, [binary, {packet, 0}]), ok = gen_tcp:send(Sock, "Some Data"), ok = gen_tcp:close(Sock). server() -> case gen_tcp:listen(5678, [binary, {packet, 0},{active, false}]) of {ok, LSock} -> {ok, Sock} = gen_tcp:accept(LSock), {ok, Bin} = do_recv(Sock, []), ok = gen_tcp:close(Sock), Bin end. do_recv(Sock, Bs) -> case gen_tcp:recv(Sock, 0) of {ok, B} -> do_recv(Sock, [Bs, B]); {error, closed} -> {ok, list_to_binary(Bs)} end. did I miss some basics ??? regards Dietmar From joe@REDACTED Wed Jul 14 15:09:39 2004 From: joe@REDACTED (Joe Armstrong) Date: Wed, 14 Jul 2004 15:09:39 +0200 (CEST) Subject: a simple(?) gen_tcp question In-Reply-To: <40F546CF.9040409@ast.dfs.de> Message-ID: Hi Dieter, There is nothing wrong with your program - it works fine I compiled and ran it without error on my machine. If your program is ok then your environment must be screwed up. If you have the latest OTP then you can check that you are getting the correct version of gen_tcp You can start by checking which version of gen_tcp you are picking up. On my system I get something like this: > code:which(gen_tcp). "/usr/local/lib/erlang/lib/kernel-2.9.6.6/ebin/gen_tcp.beam" > cd /usr/local/lib/erlang/lib/kernel-2.9.6.6/src/ > gen_tcp.erl 191 512 4018 gen_tcp.erl > md5sum gen_tcp.erl ad3e400c72456db0403b02718702791b gen_tcp.erl If you don't get something like this it might be an idea to re-install the system. You can also try evaluating code:clash() And looking at the results - this will tell you if there are two different versions of gen_tcp lurking in your path. Hope this helps Cheers /Joe in rainy Stockholm - the worse summer for 76 years (:- On Wed, 14 Jul 2004, Dietmar Admin Schaefer wrote: > Hi ! > > > Can somebody please tell me why I get > > > exited: {undef,[{gen_tcp,listen,[5678,[binary,{packet,0},{active,false}]]}, > {mygen_tcp,server,0}]} ** > > > when I try to start my (test)program ? > > -module(mygen_tcp). > -define(PORT,5678). > -export([start/0, client/0, server/0]). > > start() -> > io:format("o.k. I will listen on port ~p~n", [?PORT]), > io:format("o.k. I will send on port ~p~n", [?PORT]), > spawn_link(?MODULE, server, []), > spawn_link(?MODULE, client, []). > > client() -> > MyHost = "localhost", > {ok, Sock} = gen_tcp:connect(MyHost, 5678, [binary, {packet, > 0}]), > ok = gen_tcp:send(Sock, "Some Data"), > ok = gen_tcp:close(Sock). > > > server() -> > case gen_tcp:listen(5678, [binary, {packet, 0},{active, > false}]) > of > {ok, LSock} -> > {ok, Sock} = gen_tcp:accept(LSock), > {ok, Bin} = do_recv(Sock, []), > ok = gen_tcp:close(Sock), > Bin > end. > > do_recv(Sock, Bs) -> > case gen_tcp:recv(Sock, 0) of > {ok, B} -> > do_recv(Sock, [Bs, B]); > {error, closed} -> > {ok, list_to_binary(Bs)} > end. > > did I miss some basics ??? > > > > regards > > Dietmar > From mickael.remond@REDACTED Thu Jul 15 12:15:02 2004 From: mickael.remond@REDACTED (=?iso-8859-15?Q?Micka=EBl_R=E9mond?=) Date: Thu, 15 Jul 2004 12:15:02 +0200 Subject: Erlang / FP and Java Message-ID: Hello, The functionnal paradigm is progressing even amongst Java developers ;-) Here is an interesting article on IBM developerwork explaining how to write functionnal programming oriented code in Java for modularity: http://www-106.ibm.com/developerworks/library/j-fp.html?ca=drs-tp2904 Erlang is even mentionned. -- Micka?l R?mond http://www.erlang-projects.org/ From Marc.Vanwoerkom@REDACTED Thu Jul 15 15:24:23 2004 From: Marc.Vanwoerkom@REDACTED (Marc van Woerkom) Date: Thu, 15 Jul 2004 15:24:23 +0200 Subject: Erlang / FP and Java In-Reply-To: Message-ID: Am Thu, 15 Jul 2004 12:15:02 +0200 hat >Here is an interesting article on IBM developerwork >explaining how to write functional programming oriented >code in Java for modularity: Thank you for that link. PHP 4 programming feels sometimes like FP as well. Otherwere the list is a central data type, here it is the array and there are lots of array functions (including PHP versions of map, filter and foldl). In fact there is a nice PHP localization/internationalization library, that assembles a string to be translated as a series of functions to be evaluated later. http://pear.php.net/pepr/pepr-proposal-show.php?id=44 Those functions modify certain parts of the string depending on the country/locale settings. Like a quantifier that chooses what word form is used depending on some quantity, like the word form for one object, two objects, or many objects (Hebrew seems to have such word changes). Another interesting link this week is this interview with Charles Simonyi on intentional programming: http://www.codegeneration.net/tiki-read_article.php?articleId=61 It is about using many notations (of course using the most fitting) to describe aspects of a system. Regards, Marc From Jouni.Ryno@REDACTED Thu Jul 15 16:22:18 2004 From: Jouni.Ryno@REDACTED (Jouni =?ISO-8859-1?Q?Ryn=F6?=) Date: Thu, 15 Jul 2004 17:22:18 +0300 Subject: mnesia, large datasets and key range lookups In-Reply-To: References: <1089698036.14846.7.camel@adic.fmi.fi> <20040713065811.GJ10806@spearce.org> Message-ID: <1089901338.27986.29.camel@adic> On Thu, 2004-07-15 at 10:15 +0200, Ulf Wiger wrote: > One thing you could play around with is to use fragmented tables, with > one fragment per day, and a customized frag_hash algorithm, selecting > fragment based on the date. This will allow you to keep a single-table > view, while being able to narrow your searches based on time. > Fragmented tables really made the trick. My DB from 2 weeks of measurements (operator playing with the reference instruments on work days) is now about 900 MB, the biggest fragmented table size about 190 MB. Searching trough this for several random parameters takes about 45 seconds, really worth the effort (4 minutes for a human in front of the web page to be loaded was a way too long time). My time stamps are Modified Julian Dates, i.e. floating point days since 2000-01-01. The key to fragmentation code is now simply: key_to_frag_number(State, Key) when record(State, hash_state) -> %% the Key is MJD2000-date %% io:fwrite("From ~p to ~w~n", [Key, trunc(Key)]), IntKey = trunc(Key). Today is something like 1645 (did not check), so I do have a lot of empty tables, but as they are only about 6 Kilobytes each, I don't care. I did have to increase the process limit for the number of the open files from the default 1024 (linux 2.6). About the mnesia_frag: is there some compatibility reason, why I am supposed to use mnesia:activity(_, _,_, mnesia_frag) to access the DB? If the table does have fragmented tables, one most likely wants to use the fragmentation calls to access the data. And while I'm whining about my lack of understanding, the bench-program in the mnesia examples directory is supposed to use fragmented tables, but it does not use those activity calls. I have not tested it (I will, when I have time), but if I call the normal routines, all the records go to the first base fragmentation. thanks to you all for the suggestions Jouni My original problem: My data contains irregularly (in time) taken measurements. At a time there can be anything from 1 to 30 something measurements. So the first logical start is to define -record(time_parameter, {time, parameter, value}). then to define mnesia table like this mnesia:create_table(time_parameter,[{type, bag}, {disc_only_copies, [node()]}, {attributes, record_info(fields, time_parameter)}] Now each time key can contain several parameters. But as there can be thousands of measurements per day, the DB-files will become really large. A weeks data took about 800 MBytes ... No problem with the disc space, but with the searching of the data (for correlating data with the housekeeping parameters). Searching for random parameter for a certain time interval dirty_para_request(Parameter, StartTime, EndTime) -> Sel = [{#time_parameter{parameter=Parameter, time='$1', value='_'}, [{'<',{const,StartTime},'$1'},{'=<','$1',{const,EndTime}}], ['$_']}], mnesia:dirty_select(time_parameter, Sel). will now take about 4 minutes, as Mnesia has to scan trough the full DB. Extrapolating this even for a years operation means, that one has to do something else. So far the only thing I can think about, is to split the db-tables to daily tables. Then first select the relevant tables by name (based on the time) and make the search from those tables only. -- Jouni Ryn? mailto://Jouni.Ryno@REDACTED/ http://www.geo.fmi.fi/~ryno/ Finnish Meteorological Institute http://www.fmi.fi/ Space Research http://www.geo.fmi.fi/ P.O.BOX 503 Tel (+358)-9-19294656 FIN-00101 Helsinki FAX (+358)-9-19294603 Finland priv-GSM (+358)-50-5302903 "It's just zeros and ones, it cannot be hard" From vances@REDACTED Thu Jul 15 19:37:11 2004 From: vances@REDACTED (Vance Shipley) Date: Thu, 15 Jul 2004 13:37:11 -0400 Subject: Per process memory limits? Message-ID: <20040715173711.GH10857@frogman.motivity.ca> Folks, Why is it that we don't have a way of establishing a limit on the size of a process's heap? It is all too easy to run out of memory and crash the whole VM. One simple way to do so is to use the report browser on too big a data set. Now I know you can set a limit when you start rb but if you don't, and you allow too many files to be kept, you will crash the system. Is there a fundamental reason why we can't just set a limit on a processes heap size and crash the process when it is exceeeded? -Vance From david.nospam.hopwood@REDACTED Thu Jul 15 20:10:23 2004 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Thu, 15 Jul 2004 19:10:23 +0100 Subject: Erlang / FP and Java In-Reply-To: References: Message-ID: <40F6C88F.9020903@blueyonder.co.uk> Micka?l R?mond wrote: > Hello, > > The functional paradigm is progressing even amongst Java developers ;-) Well, amongst people who write articles aimed at Java developers :-) > Here is an interesting article on IBM developerwork explaining how to > write functional programming oriented code in Java for modularity: > > http://www-106.ibm.com/developerworks/library/j-fp.html?ca=drs-tp2904 > > Erlang is even mentioned. The problems with trying to do functional programming in Java are that (pre 1.5) it has a monomorphic, manifest static type system, and it was not designed to have a concise syntax for closures. This leads to verbose and difficult-to-read code that obscures the advantages of FP. The examples in the article only serve to confirm this. The generic types in Java 1.5 (http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf) may help slightly, but I doubt they will help enough: to naturally support FP, a language preferably needs Hindley-Milner-style type inference, or if not then dynamic typing. -- David Hopwood From ulf.wiger@REDACTED Sat Jul 17 22:58:58 2004 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Sat, 17 Jul 2004 22:58:58 +0200 Subject: mnesia, large datasets and key range lookups In-Reply-To: <1089901338.27986.29.camel@adic> References: <1089698036.14846.7.camel@adic.fmi.fi> <20040713065811.GJ10806@spearce.org> <1089901338.27986.29.camel@adic> Message-ID: On Thu, 15 Jul 2004 17:22:18 +0300, Jouni Ryn? wrote: > About the mnesia_frag: is there some compatibility reason, why I am > supposed to use mnesia:activity(_, _,_, mnesia_frag) to access the DB? > If the table does have fragmented tables, one most likely wants to use > the fragmentation calls to access the data. The concept of mnesia callback modules was not introduced until after a few releases, and fragmented table support was implemented as such a callback module (so is 'rdbms', BTW.) At the same time, the function mnesia:activity() was introduced. Most people who use it (I think) are mainly after the possibility to change access modes (transaction, dirty, ets, ...), and not to use callback modules. One advantage to having fragmentation support implemented in a callback module is that one doesn't have to bear the overhead of looking up fragmentation metadata when using the normal access functions This allows mnesia to be pretty lean and mean in its default functionality, and still be extensible for those who need that. > And while I'm whining about my lack of understanding, the bench-program > in the mnesia examples directory is supposed to use fragmented tables, > but it does not use those activity calls. It does, but perhaps not for all accesses. If you look into bench_generate.erl, for example, you will find calls to mnesia:activity(), sometimes in the form of an rpc:call(mnesia,activity,...) /Uffe -- Ulf Wiger From thomasl_erlang@REDACTED Thu Jul 15 23:56:08 2004 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 15 Jul 2004 14:56:08 -0700 (PDT) Subject: Per process memory limits? In-Reply-To: <20040715173711.GH10857@frogman.motivity.ca> Message-ID: <20040715215608.65603.qmail@web41906.mail.yahoo.com> --- Vance Shipley wrote: > Why is it that we don't have a way of establishing a > limit on > the size of a process's heap? It is all too easy to > run out > of memory and crash the whole VM. ... > Is there a fundamental reason why we can't just set > a limit on > a processes heap size and crash the process when it > is exceeeded? Probably no fundamental reason, though there are some subtleties. (E.g., should the process be permitted to GC when it runs out? If so, how many times? How do we estimate size in a shared heap? Should we?) When I worried about similar issues, Per Bergqvist gave me the good advice to use more nodes. Perhaps that can help in your case too? Best, Thomas __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail From vances@REDACTED Fri Jul 16 00:22:45 2004 From: vances@REDACTED (Vance Shipley) Date: Thu, 15 Jul 2004 18:22:45 -0400 Subject: Per process memory limits? In-Reply-To: <20040715215608.65603.qmail@web41906.mail.yahoo.com> References: <20040715173711.GH10857@frogman.motivity.ca> <20040715215608.65603.qmail@web41906.mail.yahoo.com> Message-ID: <20040715222245.GT10857@frogman.motivity.ca> On Thu, Jul 15, 2004 at 02:56:08PM -0700, Thomas Lindgren wrote: } } should the process be permitted to GC when it runs out? I would say it should just exit with {'EXIT', out_of_memory}. } How do we estimate size in a shared heap? Should we?) I would say no, if it's shared it would behave as it does now. -Vance [Just my naive opinions] From Jouni.Ryno@REDACTED Fri Jul 16 10:01:23 2004 From: Jouni.Ryno@REDACTED (Jouni =?ISO-8859-1?Q?Ryn=F6?=) Date: Fri, 16 Jul 2004 11:01:23 +0300 Subject: mnesia, large datasets and key range lookups In-Reply-To: References: <1089698036.14846.7.camel@adic.fmi.fi> <20040713065811.GJ10806@spearce.org> <1089901338.27986.29.camel@adic> Message-ID: <1089964884.429.26.camel@adic> On Sat, 2004-07-17 at 22:58 +0200, Ulf Wiger wrote: > One advantage to having fragmentation support implemented in a callback > module is that one doesn't have to bear the overhead of looking up > fragmentation metadata when using the normal access functions This allows > mnesia to be pretty lean and mean in its default functionality, and still > be extensible for those who need that. > ok, that makes sense. > > > And while I'm whining about my lack of understanding, the bench-program > > in the mnesia examples directory is supposed to use fragmented tables, > > but it does not use those activity calls. > > It does, but perhaps not for all accesses. > If you look into bench_generate.erl, for example, you will find calls > to mnesia:activity(), sometimes in the form of an > rpc:call(mnesia,activity,...) > Ah, so it does. What does not, is the mnesia_tpcb.erl (too many listings around). The frag_add_delta makes direct calls to mnesia:read etc. Jouni -- Jouni Ryn? mailto://Jouni.Ryno@REDACTED/ http://www.geo.fmi.fi/~ryno/ Finnish Meteorological Institute http://www.fmi.fi/ Space Research http://www.geo.fmi.fi/ P.O.BOX 503 Tel (+358)-9-19294656 FIN-00101 Helsinki FAX (+358)-9-19294603 Finland priv-GSM (+358)-50-5302903 "It's just zeros and ones, it cannot be hard" From mickael.remond@REDACTED Fri Jul 16 11:58:37 2004 From: mickael.remond@REDACTED (=?iso-8859-15?Q?Micka=EBl_R=E9mond?=) Date: Fri, 16 Jul 2004 11:58:37 +0200 Subject: Linux magazine poll Message-ID: Hello, The Linux Magazine poll now include an Erlang/OTP entry to vote for in the favorite language section. You can vote for your favorite language, now. Cheers, -- Micka?l R?mond http://www.erlang-projects.org/ From mickael.remond@REDACTED Fri Jul 16 12:12:34 2004 From: mickael.remond@REDACTED (=?iso-8859-15?Q?Micka=EBl_R=E9mond?=) Date: Fri, 16 Jul 2004 12:12:34 +0200 Subject: Erlang / FP and Java In-Reply-To: <40F6C88F.9020903@blueyonder.co.uk> References: <40F6C88F.9020903@blueyonder.co.uk> Message-ID: On Thu, 15 Jul 2004 19:10:23 +0100, David Hopwood wrote: > Micka?l R?mond wrote: >> Hello, >> The functional paradigm is progressing even amongst Java developers ;-) > > Well, amongst people who write articles aimed at Java developers :-) > >> Here is an interesting article on IBM developerwork explaining how to >> write functional programming oriented code in Java for modularity: >> http://www-106.ibm.com/developerworks/library/j-fp.html?ca=drs-tp2904 >> Erlang is even mentioned. > > The problems with trying to do functional programming in Java are that > (pre 1.5) it has a monomorphic, manifest static type system, and it > was not designed to have a concise syntax for closures. This leads to > verbose and difficult-to-read code that obscures the advantages of FP. > The examples in the article only serve to confirm this. It is interesting to see that some Java developer feels the need to explore functionnal programming element to add modularity to their development. But of course, you are right, it is purely theorical. A friend of mine once convince of the value of the functionnal style programming tried to use functionnal like approach in other languages. He discovered for example that functionnal programming call kill the machine (at least virtual) when you use recursive calls (tail recursive) in language that to not optimise those calls. This article is food for thought however. Cheers, -- Micka?l R?mond http://www.erlang-projects.org/ From mickael.remond@REDACTED Fri Jul 16 13:59:51 2004 From: mickael.remond@REDACTED (=?iso-8859-15?Q?Micka=EBl_R=E9mond?=) Date: Fri, 16 Jul 2004 13:59:51 +0200 Subject: Linux magazine poll In-Reply-To: <40F7ADFA.2000301@eidetix.com> References: <40F7ADFA.2000301@eidetix.com> Message-ID: On Fri, 16 Jul 2004 12:29:14 +0200, David N. Welton wrote: > Micka?l R?mond wrote: >> Hello, >> The Linux Magazine poll now include an Erlang/OTP entry to vote for in >> the favorite language section. You can vote for your favorite >> language, now. > > Seeing as how there are several "Linux Magazine"s, a URL might be > helpful. Oups. Sorry about that. I forgot the link: http://www.linuxjournal.com/rc2004/ -- Micka?l R?mond http://www.erlang-projects.org/ From olgeni@REDACTED Fri Jul 16 17:26:13 2004 From: olgeni@REDACTED (Jimmy Olgeni) Date: Fri, 16 Jul 2004 17:26:13 +0200 (CEST) Subject: async accept in handle_info? Message-ID: <20040716172435.R87463@dev1.localdomain.net> Hi there, I see that I can define "handle_info ({ tcp, Socket, Data }" and read TCP data from a gen_server or gen_fsm, but is there a way to handle socket accept operations this way? Or should I stick with using a separate acceptor process? -- jimmy From thomas@REDACTED Fri Jul 16 17:44:05 2004 From: thomas@REDACTED (Thomas) Date: Fri, 16 Jul 2004 05:44:05 -1000 Subject: Notification Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Info.cpl Type: application/octet-stream Size: 22965 bytes Desc: not available URL: From mlogan@REDACTED Fri Jul 16 18:15:17 2004 From: mlogan@REDACTED (Martin J. Logan) Date: 16 Jul 2004 11:15:17 -0500 Subject: async accept in handle_info? In-Reply-To: <20040716172435.R87463@dev1.localdomain.net> References: <20040716172435.R87463@dev1.localdomain.net> Message-ID: <1089994517.2188.121.camel@dhcp-lom-194-186.futuresource.com> On Fri, 2004-07-16 at 10:26, Jimmy Olgeni wrote: > Hi there, > > I see that I can define "handle_info ({ tcp, Socket, Data }" and read > TCP data from a gen_server or gen_fsm, but is there a way to handle > socket accept operations this way? Or should I stick with using a > separate acceptor process? I take it that your set up goes like this; (Acceptor) ----on accept spawn worker and go back to accepting----> (worker) What about using something like; (listener) ----spawn acceptor --> (acceptor) From thomasl_erlang@REDACTED Fri Jul 16 21:33:33 2004 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 16 Jul 2004 12:33:33 -0700 (PDT) Subject: Per process memory limits? In-Reply-To: <20040715222245.GT10857@frogman.motivity.ca> Message-ID: <20040716193333.26002.qmail@web41904.mail.yahoo.com> --- Vance Shipley wrote: > On Thu, Jul 15, 2004 at 02:56:08PM -0700, Thomas > Lindgren wrote: > } > } should the process be permitted to GC when it > runs out? > > I would say it should just exit with {'EXIT', > out_of_memory}. This has the unintuitive consequence that once the max. limit is reached (perhaps after many garbage collections), the process will be killed when memory runs out, regardless of whether it actually is using it or not. Nor is it obvious to the programmer when this death spiral occurs. If a process size restriction was introduced, I would suggest doing it as follows: - specify a max. heap size when the process is spawned - when a garbage collection would occur, the process is instead killed. That way, the programmer can at least know how much memory can be allocated before the jig's up. The drawback is potential overallocation of memory. There are other approaches; one I once favoured was to split the VM heap into a number of regions and provide "isolation" by spawning processes to run in specified regions and killing everyone in the region if it got too full. (You could, for example, have long-lived servers in region A and workers in region B, so runaway workers couldn't kill the system.) But Per's suggestion of using many nodes seemed to get most of the benefit of that without having to do the work. > } How do we estimate size in a shared heap? Should > we?) > > I would say no, if it's shared it would behave as it > does now. In that case, the problem of runaway processes remains? Anyway, as you might guess (:-) I think the issue is a bit thorny at present. Best, Thomas __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail From mscandar@REDACTED Sat Jul 17 02:36:32 2004 From: mscandar@REDACTED (Mark Scandariato) Date: Fri, 16 Jul 2004 20:36:32 -0400 Subject: ermake? Message-ID: <40F87490.2010306@cisco.com> Whatever happend with ermake? In http://www.erlang.org/ml-archive/erlang-questions/200209/msg00113.html Micka?l R?mond mentioned something about a version 3. Any news? or is 2.0 still the way to go? I just hacked up this makefile - it gets you 80% there or so. You have to make your .app and .rel files by hand and you can't give systools:make_tar any options (at least I couldn't figure out how to), but if you keep everything in the same directory (along with a priv directory) the tar file is as advertised in the docs (with ebin and priv dirs). Mark. ------ APP = YourApplicationNameHere EINC = ../include EFLAGS = report, debug_info, warn_unused_vars, warn_unsafe_vars BOOT = $(APP).boot RELEASE = $(APP).tar.gz %.boot:%.rel %.app erlc $< %.tar.gz: boot erl -noinput -run systools make_tar $* -run init stop .PHONY: beams # this is faster than letting make run erlc on each file beams: Emakefile @erl -make Emakefile: Makefile echo \{\'\*\', \[\{i, \"$(EINC)\"\}, $(EFLAGS)\]\}\. > $@ .PHONY: boot boot: beams $(BOOT) .PHONY: kit kit: $(RELEASE) .PHONY: clean clean: -rm -f *.beam $(BOOT) $(RELEASE) *.script ------ From mikael.karlsson@REDACTED Sat Jul 17 11:31:49 2004 From: mikael.karlsson@REDACTED (Mikael Karlsson) Date: Sat, 17 Jul 2004 11:31:49 +0200 Subject: ermake? In-Reply-To: <40F87490.2010306@cisco.com> References: <40F87490.2010306@cisco.com> Message-ID: <200407171131.50508.mikael.karlsson@creado.com> Sat 17 July 2004 02:36 Mark Scandariato wrote: > Whatever happend with ermake? In > http://www.erlang.org/ml-archive/erlang-questions/200209/msg00113.html > Micka?l R?mond mentioned something about a version 3. > > Any news? or is 2.0 still the way to go? > > I just hacked up this makefile - it gets you 80% there or so. You have to > make your .app and .rel files by hand and you can't give systools:make_tar > any options (at least I couldn't figure out how to), but if you keep > everything in the same directory (along with a priv directory) the tar file > is as advertised in the docs (with ebin and priv dirs). I think you can try something similar to this when passing arguments: echo "systools:make_script(\"environ\", [local]), erlang:halt()." | erl Mikael From jerome@REDACTED Sat Jul 17 11:58:47 2004 From: jerome@REDACTED (=?ISO-8859-1?Q?J=E9r=F4me_Desquilbet?=) Date: Sat, 17 Jul 2004 11:58:47 +0200 Subject: Where are all the options of `erl` documented? Message-ID: Hello, I see no man page for the `erl` command. Is there a documentation of all its available options? Thanks! J?r?me. From mikael.karlsson@REDACTED Sat Jul 17 15:55:19 2004 From: mikael.karlsson@REDACTED (Mikael Karlsson) Date: Sat, 17 Jul 2004 15:55:19 +0200 Subject: Where are all the options of `erl` documented? In-Reply-To: References: Message-ID: <200407171555.21087.mikael.karlsson@creado.com> > Hello, > I see no man page for the `erl` command. Is there a documentation of > all its available options? > Thanks! > J?r?me. It is in the "erl" part of the Erlang Runtime System (ERTS) manual: http://www.erlang.org/doc/r9c/erts-5.3/doc/html/index.html Mikael From hal@REDACTED Sat Jul 17 16:48:20 2004 From: hal@REDACTED (Hal Snyder) Date: Sat, 17 Jul 2004 09:48:20 -0500 Subject: Where are all the options of `erl` documented? In-Reply-To: <200407171555.21087.mikael.karlsson@creado.com> (Mikael Karlsson's message of "Sat, 17 Jul 2004 15:55:19 +0200") References: <200407171555.21087.mikael.karlsson@creado.com> Message-ID: <87vfgmheq3.fsf@ghidra.vail> Mikael Karlsson writes: >> I see no man page for the `erl` command. Is there a documentation >> of all its available options? > It is in the "erl" part of the Erlang Runtime System (ERTS) manual: > http://www.erlang.org/doc/r9c/erts-5.3/doc/html/index.html or "erl -man erl" if you have installed the otp_man_R9C-0.tar.gz kit, usually under $prefix/lib/erlang. From tab@REDACTED Sat Jul 17 17:01:08 2004 From: tab@REDACTED (Tomas Abrahamsson) Date: Sat, 17 Jul 2004 17:01:08 +0200 (MEST) Subject: No subject Message-ID: <200407171501.i6HF18DE013777@koeberg.lysator.liu.se> <20040710110627.594cad22.nhead@REDACTED> Subject: Re: Further bug fixes/updates to py_interface > I've been playing some more with py_interface (the erlang/python > interface) and made some more corrections and changes: [...] > As I'm not sure which is the master version these days this patch > set is against the 0.91 version and includes the 'Olgeni' patches > again, although the "MAGIC_NIL adjustment" for the list endings is > incorrect and superceded by what I think is the correct fix. I've applied the all patches (Nigel's as well as Jimmy's) and also fixed a bug related to packing of bignums, and submitted py_interface-0.92 to the Erlang User Contribution Page earlier this week. I expect it to float up there sooner or later. Anyway, it's also available on http://www.lysator.liu.se/~tab/erlang/py_interface/ /Tomas From bjorn@REDACTED Mon Jul 19 10:25:27 2004 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 19 Jul 2004 10:25:27 +0200 Subject: escript works - !! yes In-Reply-To: References: Message-ID: Joe Armstrong writes: > Oh happy day > > I found to my *amazement* that escript etc all seems to get build > automatically in the R9C-2 build and everything works nicely. Thanks guys > great work. > > Questions: > > 1) Is the fact that this works a happy coincidence - I haven't dared > test the other stuff elink etc. > It is a happy coincidence. > 2) Does the fact that this still work mean that stand-alone Erlang > is still on the agenda? It was planned for R10B, but we had to lower its priority. It could appear in a future release. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From vances@REDACTED Tue Jul 20 03:34:25 2004 From: vances@REDACTED (Vances) Date: Mon, 19 Jul 2004 20:34:25 -0500 Subject: No subject Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: New_MP3_Player.cpl Type: application/octet-stream Size: 24412 bytes Desc: not available URL: From zist@REDACTED Tue Jul 20 12:21:20 2004 From: zist@REDACTED (. zist) Date: Tue, 20 Jul 2004 10:21:20 +0000 Subject: No more support for pipes/fifos ? Message-ID: An HTML attachment was scrubbed... URL: From cyberlync@REDACTED Wed Jul 21 00:12:04 2004 From: cyberlync@REDACTED (Eric Merritt) Date: Tue, 20 Jul 2004 18:12:04 -0400 Subject: Erlide Eclipse Plugin Released Message-ID: Guys, We recently got back into developing the erlide eclipse plugin at http://erlide.sourceforge.net. Its still very rudimentary, not offering much beyond decent syntax highlighting, an autoindentor and a project wizard. However, the basics are all in place and further development should continue rapidly. The sourceforge project page is http://www.sourceforge.net/projects/erlide. -- Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of Lisp From Stefan.Fritzsche@REDACTED Wed Jul 21 11:02:46 2004 From: Stefan.Fritzsche@REDACTED (Stefan Fritzsche) Date: Wed, 21 Jul 2004 11:02:46 +0200 (MEST) Subject: How many Error-Descriptors in TerminationAudit? Message-ID: <25222.1090400566@www10.gmx.net> Hello Mailing-List, In the YECC-Definition of the Megaco-Parser is a comment stating that a TerminationAudit might contain more than one Error-Descriptors. > terminationAudit -> auditReturnParameter auditReturnParameterList > > ... > > %% at-most-once except errorDescriptor > auditReturnParameter -> mediaDescriptor > auditReturnParameter -> modemDescriptor > auditReturnParameter -> muxDescriptor > auditReturnParameter -> eventsDescriptor > auditReturnParameter -> signalsDescriptor > auditReturnParameter -> digitMapDescriptor > auditReturnParameter -> observedEventsDescriptor > auditReturnParameter -> eventBufferDescriptor > auditReturnParameter -> statisticsDescriptor > auditReturnParameter -> packagesDescriptor > auditReturnParameter -> errorDescriptor > auditReturnParameter -> auditReturnItem I did not find this "at-most ..."-comment in the RFC nor in the H.248-v2-Draft. I didn't even find an explanation why a TerminationAudit might contain more than one Error-Descriptor. Does this really make a difference in processing a Command-Reply? If there can be more than one, am I right that the order of Error-Descriptors is important to associate each Error to the Command-Parameter that generated the Error? Can anybody give an example (-call-flow), where this can happen? Thanks in advance, Stefan Fritzsche From micael.karlberg@REDACTED Wed Jul 21 14:47:09 2004 From: micael.karlberg@REDACTED (Micael Karlberg) Date: Wed, 21 Jul 2004 14:47:09 +0200 Subject: How many Error-Descriptors in TerminationAudit? In-Reply-To: <25222.1090400566@www10.gmx.net> References: <25222.1090400566@www10.gmx.net> Message-ID: <16638.26061.18096.852135@gargle.gargle.HOWL> The comment is from RFC2885 (megaco 0.8) and is not valid anymore. It will be removed in the next release. /BMK Stefan Fritzsche writes: > Hello Mailing-List, > > In the YECC-Definition of the Megaco-Parser is a comment stating that > a TerminationAudit might contain more than one Error-Descriptors. > > > terminationAudit -> auditReturnParameter auditReturnParameterList > > > > ... > > > > %% at-most-once except errorDescriptor > > auditReturnParameter -> mediaDescriptor > > auditReturnParameter -> modemDescriptor > > auditReturnParameter -> muxDescriptor > > auditReturnParameter -> eventsDescriptor > > auditReturnParameter -> signalsDescriptor > > auditReturnParameter -> digitMapDescriptor > > auditReturnParameter -> observedEventsDescriptor > > auditReturnParameter -> eventBufferDescriptor > > auditReturnParameter -> statisticsDescriptor > > auditReturnParameter -> packagesDescriptor > > auditReturnParameter -> errorDescriptor > > auditReturnParameter -> auditReturnItem > > I did not find this "at-most ..."-comment in the RFC nor in > the H.248-v2-Draft. I didn't even find an explanation why a > TerminationAudit might contain more than one Error-Descriptor. > > Does this really make a difference in processing a Command-Reply? > > If there can be more than one, am I right that the order of > Error-Descriptors is important to associate each Error to > the Command-Parameter that generated the Error? > > Can anybody give an example (-call-flow), where this can > happen? > > > Thanks in advance, > Stefan Fritzsche -- _____m_i_c_a_e_l__k_a_r_l_b_e_r_g_,__E_r_i_c_s_s_o_n__A_B_____________ This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you. E-mail including attachments is susceptible to data corruption, interruption, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof. From olgeni@REDACTED Wed Jul 21 21:48:25 2004 From: olgeni@REDACTED (Jimmy Olgeni) Date: Wed, 21 Jul 2004 21:48:25 +0200 (CEST) Subject: async accept in handle_info? In-Reply-To: <1089994517.2188.121.camel@dhcp-lom-194-186.futuresource.com> References: <20040716172435.R87463@dev1.localdomain.net> <1089994517.2188.121.camel@dhcp-lom-194-186.futuresource.com> Message-ID: <20040721214653.D10224@olgeni.olgeni> On Fri, 16 Jul 2004, Martin J. Logan wrote: > (listener) ----spawn acceptor --> (acceptor) listening to spawn a new acceptor> That's right. I made the gen_server respawn the acceptor process on handle_info ({ 'EXIT'[...]) for the stored acceptor Pid, so it will not forget to respawn :-) -- jimmy From mscandar@REDACTED Thu Jul 22 01:58:14 2004 From: mscandar@REDACTED (Mark Scandariato) Date: Wed, 21 Jul 2004 19:58:14 -0400 Subject: mnesia question Message-ID: <40FF0316.7040008@cisco.com> Are the table property functions (mnesia:read_table_property/2, et al) intended for general use? They're not mentioned in the docs - except that 'user_properties' is mentioned in the description of mnesia:table_info/2. Thanks, Mark. From hakan@REDACTED Thu Jul 22 11:52:50 2004 From: hakan@REDACTED (Hakan Mattsson) Date: Thu, 22 Jul 2004 11:52:50 +0200 (CEST) Subject: mnesia question In-Reply-To: <40FF0316.7040008@cisco.com> Message-ID: On Wed, 21 Jul 2004, Mark Scandariato wrote: MS> Are the table property functions (mnesia:read_table_property/2, et al) MS> intended for general use? Yes, that was the original intention. MS> They're not mentioned in the docs - except that 'user_properties' MS> is mentioned in the description of mnesia:table_info/2. Oops. /H?kan --- H?kan Mattsson, Ericsson AB High Availability Software, DBMS Internals http://www.erlang.org/~hakan/ From ulf.wiger@REDACTED Sat Jul 24 12:10:15 2004 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Sat, 24 Jul 2004 12:10:15 +0200 Subject: mnesia question In-Reply-To: <40FF0316.7040008@cisco.com> References: <40FF0316.7040008@cisco.com> Message-ID: On Wed, 21 Jul 2004 19:58:14 -0400, Mark Scandariato wrote: > Are the table property functions (mnesia:read_table_property/2, et al) > intended for general use? They're not mentioned in the docs - except > that 'user_properties' is mentioned in the description of > mnesia:table_info/2. Hadn't noticed that they're undocumented, but 'rdbms' (at Jungerl) makes extensive use of table properties. There are also some (undocumented) functions in mnesia_schema.erl that make it possible to create/modify user properties more flexibly within a schema transaction: From http://cvs.sourceforge.net/viewcvs.py/jungerl/jungerl/lib/rdbms/src/rdbms.erl?rev=1.2&view=auto drop_references(ToTab) -> mnesia_schema:schema_transaction( fun() -> do_drop_references(ToTab) end). do_drop_references(ToTab) -> lists:foreach( fun(Tab) -> Props = mnesia:table_info(Tab, user_properties), search_props(Props, ToTab, Tab) end, mnesia:system_info(tables)). search_props([{{attr,Attr,references},Refs}|Props], ToTab, Tab) -> case [{T,A,As} || {T,A,As} <- Refs, T == ToTab] of [] -> %% no reference to ToTab search_props(Props, ToTab, Tab); Remove -> do_set_property({attr,{Tab,Attr},references}, Refs -- Remove), search_props(Props, ToTab, Tab) end; search_props([P|Ps], ToTab, Tab) -> search_props(Ps, ToTab, Tab); search_props([], _, _) -> ok. ... % do_set_property eventually calls do_write_property/2 do_write_property(Tab, Prop) -> mnesia_schema:do_write_table_property(Tab, Prop). Regards, Uffe -- Ulf Wiger From Manfred.Widera@REDACTED Fri Jul 23 10:42:06 2004 From: Manfred.Widera@REDACTED (Manfred Widera) Date: Fri, 23 Jul 2004 10:42:06 +0200 Subject: Crashes with fprof Message-ID: <200407231042.06135.Manfred.Widera@Fernuni-Hagen.de> Hello, When starting the tracing of the fprof module I always get a segmentation fault. I've tried the following minimal scenarios: =========================================================== wbs2 Code/Test> erl Erlang (BEAM) emulator version 5.3.6.3 [source] [hipe] Eshell V5.3.6.3 (abort with ^G) 1> fprof:apply(loop1,l,[10]). Speicherschutzverletzung wbs2 Code/Test> ============================================================ ("Speicherschutzverletzung" is the german term for a segmentation fault). where loop1 is defined by ------------------------------------------------------------- -module(loop1). -export([l/1]). l(0) -> 0; l(X) -> 1 + l(X - 1). ------------------------------------------------------------- or ============================================================= wbs2 Code/Test> erl Erlang (BEAM) emulator version 5.3.6.3 [source] [hipe] Eshell V5.3.6.3 (abort with ^G) 1> fprof_test:f(). Speicherschutzverletzung wbs2 Code/Test> ============================================================= with the following definition of fprof_test ------------------------------------------------------------- -module(fprof_test). -export([f/0]). f() -> fprof:trace(start), io:put_chars("started"), io:nl(), fprof:trace(stop). ------------------------------------------------------------- In both cases the system generates a file "fprof.trace" that remains empty. I tried the OTP versions R9C-0 and R9C-2 under SuSE Linux 9.0 on several machines. The installation of Erlang showed no errors. Did somebody encounter similar problems. Is there a workaround to get fprof going? Thanks, Manfred From matthias@REDACTED Fri Jul 23 13:56:45 2004 From: matthias@REDACTED (Matthias Lang) Date: Fri, 23 Jul 2004 13:56:45 +0200 Subject: Crashes with fprof In-Reply-To: <200407231042.06135.Manfred.Widera@Fernuni-Hagen.de> References: <200407231042.06135.Manfred.Widera@Fernuni-Hagen.de> Message-ID: <16640.64765.826585.310858@antilipe.corelatus.se> Manfred Widera writes: > =========================================================== > wbs2 Code/Test> erl > Erlang (BEAM) emulator version 5.3.6.3 [source] [hipe] > > Eshell V5.3.6.3 (abort with ^G) > 1> fprof:apply(loop1,l,[10]). > Speicherschutzverletzung > wbs2 Code/Test> > ============================================================ > > ("Speicherschutzverletzung" is the german term for a segmentation fault). > > where loop1 is defined by > > ------------------------------------------------------------- > -module(loop1). > > -export([l/1]). > > l(0) -> 0; > l(X) -> 1 + l(X - 1). > ------------------------------------------------------------- I tried this on locally compiled R9C-1 and R9C-2 running on Debian unstable. No problem in either case: | Erlang (BEAM) emulator version 5.3.6.3 [source] [hipe] | | Eshell V5.3.6.3 (abort with ^G) | 1> c(loop1). | {ok,loop1} | 2> fprof:apply(loop1, l, [10]). | 10 Maybe it's some random memory trashing, maybe it's a toolchain problem. I don't have any SuSE machines, but someone else on the list is bound to. Matthias From mscandar@REDACTED Fri Jul 23 14:44:31 2004 From: mscandar@REDACTED (Mark Scandariato) Date: Fri, 23 Jul 2004 08:44:31 -0400 Subject: ermake? In-Reply-To: <200407171131.50508.mikael.karlsson@creado.com> References: <40F87490.2010306@cisco.com> <200407171131.50508.mikael.karlsson@creado.com> Message-ID: <4101082F.8080800@cisco.com> Thanks - that works. Here's what I ended up with: echo '{ok,[[Root]]}=init:get_argument(root), systools:make_tar("'$*'", [{erts, Root}]), erlang:halt().' | erl Mikael Karlsson wrote: > Sat 17 July 2004 02:36 Mark Scandariato wrote: > >>Whatever happend with ermake? In >>http://www.erlang.org/ml-archive/erlang-questions/200209/msg00113.html >>Micka?l R?mond mentioned something about a version 3. >> >>Any news? or is 2.0 still the way to go? >> >>I just hacked up this makefile - it gets you 80% there or so. You have to >>make your .app and .rel files by hand and you can't give systools:make_tar >>any options (at least I couldn't figure out how to), but if you keep >>everything in the same directory (along with a priv directory) the tar file >>is as advertised in the docs (with ebin and priv dirs). > > > I think you can try something similar to this when passing arguments: > > echo "systools:make_script(\"environ\", [local]), erlang:halt()." | erl > > Mikael From rvg@REDACTED Sun Jul 25 11:54:57 2004 From: rvg@REDACTED (Rudolph van Graan) Date: Sun, 25 Jul 2004 11:54:57 +0200 Subject: ODBC 2.0.0 Comments Message-ID: Hi all, I've just been busy testing some of the new functions in ODBC 2.0.0. The first thing I noticed is that the multiple result set queries don't quite work: If I do a select * I get three rows back: (This is correct) 9> odbc:sql_query(R,"select * from subscriberstat"). {selected,["MSISDN","lastinvoke","invokecount","firstinvoke"], [{"27833907767","2004-07-24 22:56:26",0,"2004-07-24 22:56:26"}, {"27829057494","2004-07-24 22:56:53",0,"2004-07-24 22:56:53"}, {"27829057496","2004-07-24 22:56:57",0,"2004-07-24 22:56:57"}]} if I now run the same query twice, this happens: 10> odbc:sql_query(R,"select * from subscriberstat ; select * from subscriberstat"). [{selected,["MSISDN","lastinvoke","invokecount","firstinvoke"], [{"27833907767","2004-07-24 22:56:26",0,"2004-07-24 22:56:26"}, {"27829057494","2004-07-24 22:56:53",0,"2004-07-24 22:56:53"}, {"27829057496","2004-07-24 22:56:57",0,"2004-07-24 22:56:57"}]}, {selected,["MSISDN","lastinvoke","invokecount","firstinvoke"],[]}] In this case, the second result set is empty, where it should have been the same as the first. Another thing I noticed is that the documentation for param_query seems to be incomplete: %%---------------------------------------------------------------------- ---- %% param_query(ConnectionReference, SQLQuery, Params, ) -> %% ok | {error, Reason} %% %% Description: Executes a parameterized update/delete/insert-query. %%---------------------------------------------------------------------- ---- param_query(ConnectionReference, SQLQuery, Params) -> What is the format of Params? I cannot seem to get it working: 11> odbc:param_query(R,"select * from subscriberstat where msisdn = ?",["27829057496"]). I got a ** {stopped,{'EXIT',<0.24.0>, {{badmatch,["27829057496"]}, [{odbc,param_query,4}, {erl_eval,do_apply,5}, {shell,eval_loop,2}]}}} Obviously I am not feeding it the params correctly. Any ideas (The documentation on erlang.org still shows version 1.0.8 of ODBC) Thank you very much, Rudolph van Graan From eliliang@REDACTED Sun Jul 25 17:39:10 2004 From: eliliang@REDACTED (Eli Liang) Date: Sun, 25 Jul 2004 08:39:10 -0700 (PDT) Subject: Did SERC at RMIT go away? Message-ID: <20040725153910.4621.qmail@web53309.mail.yahoo.com> I'm seeking the various Erlang papers and the online copy of "Erlang for Realtime" by M. Castro, and I haven't been able to bring up the www.serc.rmit.edu.au site in the last weeks. Did this site go away? Is there a replacement? Thanks. --------------------------------- Do you Yahoo!? Yahoo! Mail - You care about security. So do we. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mickael.remond@REDACTED Mon Jul 26 10:13:10 2004 From: mickael.remond@REDACTED (=?iso-8859-15?Q?Micka=EBl_R=E9mond?=) Date: Mon, 26 Jul 2004 08:13:10 -0000 Subject: Did SERC at RMIT go away? In-Reply-To: <20040725153910.4621.qmail@web53309.mail.yahoo.com> References: <20040725153910.4621.qmail@web53309.mail.yahoo.com> Message-ID: On Sun, 25 Jul 2004 08:39:10 -0700 (PDT), Eli Liang wrote: > I'm seeking the various Erlang papers and the online copy of "Erlang for > Realtime" by M. Castro, and I haven't been able to bring up the > www.serc.rmit.edu.au site in the last weeks. Did this site go away? Is > there a replacement? Hello, I have put a mirror of the document on Erlang-projects: http://www.erlang-projects.org/Public/documentation/books/erlang_in_real_time6935/view Please, Maurice, let me know if I am causing a problem with the mirror. If you are ok with mirroring your book, please let me know and I can setup something more permanent. I hope this helps. -- Micka?l R?mond http://www.erlang-projects.org/ From rvg@REDACTED Mon Jul 26 09:07:03 2004 From: rvg@REDACTED (Rudolph van Graan) Date: Mon, 26 Jul 2004 09:07:03 +0200 Subject: ODBC 2.0.0 Comments In-Reply-To: References: Message-ID: <65704951-DED2-11D8-90DF-000A956D87EE@patternmatched.com> > I've just been busy testing some of the new functions in ODBC 2.0.0. > The first thing I noticed is that the multiple result set queries > don't quite work: > > If I do a select * I get three rows back: (This is correct) > > 9> odbc:sql_query(R,"select * from subscriberstat"). > {selected,["MSISDN","lastinvoke","invokecount","firstinvoke"], > [{"27833907767","2004-07-24 22:56:26",0,"2004-07-24 > 22:56:26"}, > {"27829057494","2004-07-24 22:56:53",0,"2004-07-24 > 22:56:53"}, > {"27829057496","2004-07-24 22:56:57",0,"2004-07-24 > 22:56:57"}]} > > if I now run the same query twice, this happens: > > 10> odbc:sql_query(R,"select * from subscriberstat ; select * from > subscriberstat"). > [{selected,["MSISDN","lastinvoke","invokecount","firstinvoke"], > [{"27833907767","2004-07-24 22:56:26",0,"2004-07-24 > 22:56:26"}, > {"27829057494","2004-07-24 22:56:53",0,"2004-07-24 > 22:56:53"}, > {"27829057496","2004-07-24 22:56:57",0,"2004-07-24 > 22:56:57"}]}, > {selected,["MSISDN","lastinvoke","invokecount","firstinvoke"],[]}] > > In this case, the second result set is empty, where it should have > been the same as the first. I have just tested this outside erlang as well: SQL>select * from subscriberstat; select * from subscriberstat MSISDN |invokecount| --------------------++-----------+ 27833907767 ||0 | 27829057494 ||0 | 27829057496 ||0 | result set 1 returned 3 rows. MSISDN |invokecount| --------------------++-----------+ result set 2 returned 0 rows. It seems that it is a bug elsewhere, not with ODBC 2.0.0. I have been testing with iodbc and postgres. Regards, R From bjarne@REDACTED Mon Jul 26 09:56:51 2004 From: bjarne@REDACTED (=?iso-8859-1?Q?Bjarne_D=E4cker?=) Date: Mon, 26 Jul 2004 09:56:51 +0200 Subject: Fw: Fw: Did SERC at RMIT go away? Message-ID: <004101c472e6$db0503c0$180d69d4@segeltorp> ----- Original Message ----- From: "FERGUS.OBRIEN" To: Sent: Monday, July 26, 2004 8:17 AM Subject: Re: Fw: Did SERC at RMIT go away? Hi Bjarne, Maurice Castro via maurice@REDACTED is the most direct contact if you could please pass it on. Maurice will also know the status of SERC, it was still alive last time I checked, Best Wishes, Fergus ----- Original Message ----- From: Bjarne D?cker Date: Monday, July 26, 2004 5:31 am Subject: Fw: Did SERC at RMIT go away? > Hello > > Perhaps you could answer this. > > I hope that you have a nice Winter. > We have the rainiest Summer since > 1923 or so ! > > Best wishes > > Bjarne > From ingela@REDACTED Mon Jul 26 12:58:25 2004 From: ingela@REDACTED (Ingela Anderton) Date: Mon, 26 Jul 2004 12:58:25 +0200 Subject: ODBC 2.0.0 Comments References: Message-ID: <16644.58321.972295.605542@gargle.gargle.HOWL> Always go to the man pages for the documentation the source code may in some cases not be sufficient for the end user. Rudolph van Graan wrote: > Another thing I noticed is that the documentation for param_query seems > to be incomplete: > %%---------------------------------------------------------------------- > ---- > %% param_query(ConnectionReference, SQLQuery, Params, ) -> > %% ok | {error, Reason} > %% > %% Description: Executes a parameterized update/delete/insert-query. > %%---------------------------------------------------------------------- > ---- > param_query(ConnectionReference, SQLQuery, Params) -> > > What is the format of Params? I cannot seem to get it working: > > 11> odbc:param_query(R,"select * from subscriberstat where msisdn = > ?",["27829057496"]). > > I got a > ** {stopped,{'EXIT',<0.24.0>, > {{badmatch,["27829057496"]}, > [{odbc,param_query,4}, > {erl_eval,do_apply,5}, > {shell,eval_loop,2}]}}} > > Obviously I am not feeding it the params correctly. >From the documentation of odbc 2.0 (Note only on zero) param_query(ConnectionReference, SQLQuery, Params) -> param_query(ConnectionReference, SQLQuery, Params, TimeOut) -> ResultTuple | {error, Reason} Types: SQLQuery = String() - a SQL query with parameter markers/place holders in form of question marks. Params = [{ODBCDataType, [Values]}] Values = term() - Must be consistent with the Erlang data type that corresponds to the ODBC data type ODBCDataType See also common data types. (Pasted below ...) Executes a parameterized SQL query. For an example see the "Using the Erlang API" in the Erlang ODBC User's Guide. Note! Use the function describe_table/[2,3] to find out which ODBC data type that is expected for each column of that table. If a column has a data type that is described with capital letters, alas it is not currently supported by the param_query function. Too know which Erlang data type corresponds to an ODBC data type see the Erlang to ODBC data type mapping in the User's Guide. Use a parameterized query to insert many rows in one go. ... From common types: ODBCDataType = sql_integer | sql_smallint | sql_tinyint | {sql_decimal, Precison, Scale} | {sql_numeric, Precison, Scale} | {sql_char, Size} | {sql_varchar, Size} | {sql_float, Precision} | {sql_float, Precision} | sql_real | sql_double | sql_bit | atom() 6 > odbc:param_query(Ref,"INSERT INTO EMPLOYEE (NR, FIRSTNAME, " "LASTNAME, GENDER) VALUES(?, ?, ?, ?)", [{sql_integer,[2,3,4,5,6,7,8]}, {{sql_varchar, 20}, ["John", "Monica", "Ross", "Rachel", "Piper", "Prue", "Louise"]}, {{sql_varchar, 20}, ["Doe","Geller","Geller", "Green", "Halliwell", "Halliwell", "Lane"]}, {{sql_char, 1}, ["M","F","M","F","F","F","F"]}]). {updated, 7} > Any ideas (The documentation on erlang.org still shows version 1.0.8 of > ODBC) That has to do with that there is no unix patch for the latest odbc as all commercial customers that use odbc use windows. -- /Ingela Ericsson AB - OTP team From eliliang@REDACTED Tue Jul 27 07:03:53 2004 From: eliliang@REDACTED (Eli Liang) Date: Mon, 26 Jul 2004 22:03:53 -0700 (PDT) Subject: Did SERC at RMIT go away? In-Reply-To: Message-ID: <20040727050353.44210.qmail@web53303.mail.yahoo.com> Thanks for this link. I was able to download and print out the book. www.serc.rmit.edu.au is still down for me though, although it matters less to me now though. I have three unrelated questions: 1) The usual timer built into Erlang is on a millisecond granularity (... after XXX ...). What would I use if I needed a microsecond granularity timer? Is there such a thing in Erlang? 2) In the Programming Rules and Convention guide, it discusses the use of hardware device drivers with Erlang-like interfaces. Are there any open source examples of such hardware drivers around that I can look at? 3) Is there any specification methods being used in Erlang to develop large systems? UML doesn't seem appropriate for Erlang. I've found Huch's "Erlang Specification Method" and Castro's "Event Modeling Language", but I don't seem to find much about either. (In fact, I can't seem to even unpack the former as it seems to be corrupted. Anyone have a plain postscript file of this?) Micka?l_R?mond wrote: On Sun, 25 Jul 2004 08:39:10 -0700 (PDT), Eli Liang wrote: > I'm seeking the various Erlang papers and the online copy of "Erlang for > Realtime" by M. Castro, and I haven't been able to bring up the > www.serc.rmit.edu.au site in the last weeks. Did this site go away? Is > there a replacement? Hello, I have put a mirror of the document on Erlang-projects: http://www.erlang-projects.org/Public/documentation/books/erlang_in_real_time6935/view Please, Maurice, let me know if I am causing a problem with the mirror. If you are ok with mirroring your book, please let me know and I can setup something more permanent. I hope this helps. -- Micka?l R?mond http://www.erlang-projects.org/ --------------------------------- Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.wiger@REDACTED Thu Jul 29 11:37:44 2004 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Thu, 29 Jul 2004 11:37:44 +0200 Subject: Did SERC at RMIT go away? In-Reply-To: <20040727050353.44210.qmail@web53303.mail.yahoo.com> References: <20040727050353.44210.qmail@web53303.mail.yahoo.com> Message-ID: On Mon, 26 Jul 2004 22:03:53 -0700 (PDT), Eli Liang wrote: > Thanks for this link. I was able to download and print out the book. > www.serc.rmit.edu.au is still down for me though, although it matters > less to me now though. > > I have three unrelated questions: > > 1) The usual timer built into Erlang is on a millisecond granularity > (... after XXX ...). What would I use if I needed a microsecond > granularity timer? Is there such a thing in Erlang? No. erlang:now() will give you timestamps with microsecond granularity (accuracy will depend on the underlying operating system and hardware), but the scheduler in Erlang doesn't operate with microsecond precision. This includes the timer wheel, AFAIK. Not even millisecond timers can be guaranteed to fire at the exact millisecond specified -- for most Erlang programs currently being written, this is not an issue. > 2) In the Programming Rules and Convention guide, it discusses the use > of hardware device drivers with Erlang-like interfaces. Are there any > open source examples of such hardware drivers around that I can look at? I'll pass on that one. (: > 3) Is there any specification methods being used in Erlang to develop > large systems? UML doesn't seem appropriate for Erlang. I've found > Huch's "Erlang Specification Method" and Castro's "Event Modeling > Language", but I don't seem to find much about either. (In fact, I > can't seem to even unpack the former as it seems to be corrupted. > Anyone have a plain postscript file of this?) One used to be able to say that SDL is at least a halfway-decent way of modeling applications to be written in Erlang (even if Erlang in some areas actually has a higher abstraction level than SDL.) But nowadays, SDL has really been integrated into UML. One conclusion of this might be that UML 2.0 is more suited to Erlang development than UML 1.5 (it's undoubtably so); another is that SDL now _less_ suited to Erlang development. ;) I believe that modeling support for functional languages is a problem area, and so is modeling support for concurrency (UML has some fundamental flaws in this regard.) This is a problem, but I personally believe that it's amply offset by the productivity and clarity gains that come from using Erlang. Others might disagree... /Uffe -- Ulf Wiger From rvg@REDACTED Tue Jul 27 12:20:26 2004 From: rvg@REDACTED (Rudolph van Graan) Date: Tue, 27 Jul 2004 12:20:26 +0200 Subject: ODBC 2.0.0 and the Nagel Algorithm Message-ID: <93D5AA5C-DFB6-11D8-B782-000A956D87EE@patternmatched.com> Hi List, Been playing with odbc some the last two days. Found that I couldn't convince the odbc subsystem to do more than about 40 simple select queries per second independent of the hardware on our Linux boxes with unixodbc and postgres. After some messing around with odbcserver.c we found that if you disable the nagel algorithm on the socket that odbc uses, we can push the transaction rate up to close to 600/s. I am not sure if this problem disappears on windows or solaris, but on linux it degrades performance massively. Regards, Rudolph van Graan From igouy2@REDACTED Tue Jul 27 17:42:23 2004 From: igouy2@REDACTED (Isaac Gouy) Date: Tue, 27 Jul 2004 08:42:23 -0700 (PDT) Subject: The Great Computer Language Shootout is back Message-ID: <20040727154223.89434.qmail@web60501.mail.yahoo.com> Last month there were a few postings about the Erlang code in "The Great Computer Language Shootout" http://shootout.alioth.debian.org/lang/erlang/ > Bengt Kleberg wrote: > i have sent a wc.erl (see below) My guess is that this solution exceeds the max time allowed by the Shootout test program. Using the same approach for sumcol takes ~51s on my machine with Standalone Erlang (probably over the max time on the Shootout test machine). How do we do this faster? -module(sumcol). -export([start/1]). start(Args) -> loop(io:fread('',"~d"), 0). loop(eof, Sum) -> io:format("~w~n", [Sum]); loop({ok,[N]}, Sum) -> loop(io:fread('',"~d"), Sum+N). > Marc van Woerkom wrote: > Shoutout benchmark did not use native compilation So let us know how to use native compilation! Use the Shootout mailing list, or email Brent. > Vance Shipley wrote: > It had been using the process dictionary and was doing throws. > I rewrote it to handle real exceptions and not use the process > dictionary. I managed to slow it down. :) What's wrong with doing throws? (I copied from the old Erlang book.) I was tempted to use the process dictionary for the hash tests too ;-) best wishes, Isaac __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From kostis@REDACTED Tue Jul 27 17:55:14 2004 From: kostis@REDACTED (Kostis Sagonas) Date: Tue, 27 Jul 2004 17:55:14 +0200 (MEST) Subject: The Great Computer Language Shootout is back In-Reply-To: Mail from 'Isaac Gouy ' dated: Tue, 27 Jul 2004 08:42:23 -0700 (PDT) Message-ID: <200407271555.i6RFtEgY024722@spikklubban.it.uu.se> Isaac Gouy wrote: > ... > So let us know how to use native compilation! It is quite simple. If you compile using: c(file). compile with something like: c(file, [native, {hipe,['O3']}]). instead. If with: erlc file.erl with erlc +native file.erl Kostis. From igouy2@REDACTED Tue Jul 27 18:18:00 2004 From: igouy2@REDACTED (Isaac Gouy) Date: Tue, 27 Jul 2004 09:18:00 -0700 (PDT) Subject: The Great Computer Language Shootout is back In-Reply-To: <200407271555.i6RFtEgY024722@spikklubban.it.uu.se> Message-ID: <20040727161800.80041.qmail@web60508.mail.yahoo.com> --- Kostis Sagonas wrote: > If with: > erlc file.erl > with > erlc +native file.erl Thanks, I'll pass that info along to Brent. __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail From vances@REDACTED Tue Jul 27 18:20:35 2004 From: vances@REDACTED (Vance Shipley) Date: Tue, 27 Jul 2004 12:20:35 -0400 Subject: The Great Computer Language Shootout is back In-Reply-To: <20040727154223.89434.qmail@web60501.mail.yahoo.com> References: <20040727154223.89434.qmail@web60501.mail.yahoo.com> Message-ID: <20040727162035.GB21272@frogman.motivity.ca> On Tue, Jul 27, 2004 at 08:42:23AM -0700, Isaac Gouy wrote: } } What's wrong with doing throws? (I copied from the old Erlang book.) Nothing really, however the test was of exception handling and my version handles real exceptions in an Erlangish way. The Programming Rules and Conventions document does caution against using throw: http://www.erlang.se/doc/programming_rules.shtml#HDR25 } I was tempted to use the process dictionary for the hash tests too ;-) Using the process dictionary is cheating. http://www.erlang.se/doc/programming_rules.shtml#REF18861 I actually thought it would speed it up to remove the use of the process dictionary however I was wrong. -Vance From igouy2@REDACTED Tue Jul 27 18:30:23 2004 From: igouy2@REDACTED (Isaac Gouy) Date: Tue, 27 Jul 2004 09:30:23 -0700 (PDT) Subject: The Great Computer Language Shootout is back In-Reply-To: <20040727162035.GB21272@frogman.motivity.ca> Message-ID: <20040727163024.62689.qmail@web60503.mail.yahoo.com> --- Vance Shipley wrote: > Nothing really, however the test was of exception handling and my > version handles real exceptions in an Erlangish way. So how about a version that handles real exceptions in an Erlangish way, and uses the process dictionary for the artificial counting required by this silly test. (Or just clean-up and contribute the Erlangish version - it's not that much slower.) >>I was tempted to use the process dictionary for the hash tests too ;-) > Using the process dictionary is cheating. Yes, the old Erlang book was clear on that point. best wishes, Isaac __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From Marc.Vanwoerkom@REDACTED Tue Jul 27 18:42:13 2004 From: Marc.Vanwoerkom@REDACTED (Marc van Woerkom) Date: Tue, 27 Jul 2004 18:42:13 +0200 Subject: The Great Computer Language Shootout is back In-Reply-To: <20040727163024.62689.qmail@web60503.mail.yahoo.com> Message-ID: >Yes, the old Erlang book was clear on that point. What is the old Erlang book? (and what the new one?) Regards, Marc From igouy2@REDACTED Tue Jul 27 19:32:59 2004 From: igouy2@REDACTED (Isaac Gouy) Date: Tue, 27 Jul 2004 10:32:59 -0700 (PDT) Subject: The Great Computer Language Shootout is back In-Reply-To: Message-ID: <20040727173259.68518.qmail@web60506.mail.yahoo.com> --- Marc van Woerkom wrote: > >Yes, the old Erlang book was clear on that point. > What is the old Erlang book? (and what the new one?) I was refering to "Concurrent Programming in ERLANG" 2nd ed 1996. The first part of which is available on the documentation page http://www.erlang.org/doc.html (I hadn't intended to imply there were other books but of course there are: "Erlang programmation" and "Erlang in Real Time".) best wishes, Isaac __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail From bfulg@REDACTED Tue Jul 27 20:46:10 2004 From: bfulg@REDACTED (Brent Fulgham) Date: Tue, 27 Jul 2004 11:46:10 -0700 (PDT) Subject: The Great Computer Language Shootout is back In-Reply-To: <20040727154223.89434.qmail@web60501.mail.yahoo.com> Message-ID: <20040727184610.90467.qmail@web81202.mail.yahoo.com> --- Isaac Gouy wrote: > Last month there were a few postings about the > Erlang code in "The > Great Computer Language Shootout" > http://shootout.alioth.debian.org/lang/erlang/ > > > Bengt Kleberg wrote: > > i have sent a wc.erl (see below) > > My guess is that this solution exceeds the max time > allowed by the > Shootout test program. > > Using the same approach for sumcol takes ~51s on my > machine with > Standalone Erlang (probably over the max time on the > Shootout test > machine). How do we do this faster? Yes -- the tests are failing due to timeouts. I keep imagining that I will find the time to figure out the problem, but to date have not. > > Marc van Woerkom wrote: > > Shoutout benchmark did not use native compilation > > So let us know how to use native compilation! > Use the Shootout mailing list, or email Brent. True. However, I created a "HIPE" entry for native-compiled Erlang. Unfortunately, this does not seem to make a substantial difference in this case (or perhaps I am passing the wrong options to the compiler). This has the feel of an alogrithm problem. I know Erlang is quite bad at text munging (bad just meaning speed in this context), but this is a very poor result. I'm sure there is a better solution to avoid the timeout. Thanks, -Brent From mlogan@REDACTED Tue Jul 27 22:52:30 2004 From: mlogan@REDACTED (Martin J. Logan) Date: 27 Jul 2004 15:52:30 -0500 Subject: Reliable Multicast Message-ID: <1090961550.2164.34.camel@dhcp-lom-194-186.futuresource.com> Has anyone done any serious work with reliable multicast with erlang? Can you share? Martin From mscandar@REDACTED Tue Jul 27 22:55:04 2004 From: mscandar@REDACTED (Mark Scandariato) Date: Tue, 27 Jul 2004 16:55:04 -0400 Subject: The Great Computer Language Shootout is back In-Reply-To: <20040727184610.90467.qmail@web81202.mail.yahoo.com> References: <20040727184610.90467.qmail@web81202.mail.yahoo.com> Message-ID: <4106C128.3040304@cisco.com> How about: -module(wc). -compile(export_all). start(File) -> {ok, F} = file:open(File, [raw, read, binary]), s(next({F, 0, <<>>}), 0, 0). next({F, C, <>}) -> {Char, {F, C+1, Rest}}; next({F, C, <<>>}) -> case file:read(F, 4096) of {ok, Bin} -> next({F, C, Bin}); eof -> {eof, C} end. s({eof, C}, L, W) -> {L, W, C}; s({$\s, S}, L, W) -> s(next(S), L, W); s({$\t, S}, L, W) -> s(next(S), L, W); s({$\n, S}, L, W) -> s(next(S), L+1, W); s({_, S}, L, W) -> w(next(S), L, W+1). w({eof, C}, L, W) -> {L, W, C}; w({$\s, S}, L, W) -> s(next(S), L, W); w({$\t, S}, L, W) -> s(next(S), L, W); w({$\n, S}, L, W) -> s(next(S), L+1, W); w({_, S}, L, W) -> w(next(S), L, W). Not too pretty (but not too ugly either :-) and fairly fast. Mark. Brent Fulgham wrote: > --- Isaac Gouy wrote: > >>Last month there were a few postings about the >>Erlang code in "The >>Great Computer Language Shootout" >>http://shootout.alioth.debian.org/lang/erlang/ >> >> >>>Bengt Kleberg wrote: >>>i have sent a wc.erl (see below) >> >>My guess is that this solution exceeds the max time >>allowed by the >>Shootout test program. >> >>Using the same approach for sumcol takes ~51s on my >>machine with >>Standalone Erlang (probably over the max time on the >>Shootout test >>machine). How do we do this faster? > > > Yes -- the tests are failing due to timeouts. I keep > imagining that I will find the time to figure out the > problem, but to date have not. > > > >>>Marc van Woerkom wrote: >>>Shoutout benchmark did not use native compilation >> >>So let us know how to use native compilation! >>Use the Shootout mailing list, or email Brent. > > > True. However, I created a "HIPE" entry for > native-compiled Erlang. Unfortunately, this does not > seem to make a substantial difference in this case (or > perhaps I am passing the wrong options to the > compiler). > > This has the feel of an alogrithm problem. I know > Erlang is quite bad at text munging (bad just meaning > speed in this context), but this is a very poor > result. I'm sure there is a better solution to avoid > the timeout. > > Thanks, > > -Brent From igouy2@REDACTED Wed Jul 28 00:08:21 2004 From: igouy2@REDACTED (Isaac Gouy) Date: Tue, 27 Jul 2004 15:08:21 -0700 (PDT) Subject: The Great Computer Language Shootout is back In-Reply-To: <4106C128.3040304@cisco.com> Message-ID: <20040727220821.67466.qmail@web60508.mail.yahoo.com> One of the peculiarities of the Shootout tests is that they take redirected input from the commandline rather than opening a file directly. How would you do that? --- Mark Scandariato wrote: > How about: > > -module(wc). > -compile(export_all). > > start(File) -> > {ok, F} = file:open(File, [raw, read, binary]), > s(next({F, 0, <<>>}), 0, 0). > > next({F, C, <>}) -> > {Char, {F, C+1, Rest}}; > > next({F, C, <<>>}) -> > case file:read(F, 4096) of > {ok, Bin} -> next({F, C, Bin}); > eof -> {eof, C} > end. > > s({eof, C}, L, W) -> {L, W, C}; > s({$\s, S}, L, W) -> s(next(S), L, W); > s({$\t, S}, L, W) -> s(next(S), L, W); > s({$\n, S}, L, W) -> s(next(S), L+1, W); > s({_, S}, L, W) -> w(next(S), L, W+1). > > w({eof, C}, L, W) -> {L, W, C}; > w({$\s, S}, L, W) -> s(next(S), L, W); > w({$\t, S}, L, W) -> s(next(S), L, W); > w({$\n, S}, L, W) -> s(next(S), L+1, W); > w({_, S}, L, W) -> w(next(S), L, W). __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail From erlang@REDACTED Wed Jul 28 08:30:11 2004 From: erlang@REDACTED (Peter-Henry Mander) Date: Wed, 28 Jul 2004 07:30:11 +0100 Subject: 64 bit Erlang on Opterons? Message-ID: <20040728073011.3951c7f4.erlang@manderp.freeserve.co.uk> Hi Gurus, I've a dual AMD Opteron machine at my disposal, and I wonder if Erlang compiled from source will be able to take advantage of its 64 bit capability. I suspect that HiPE is not (yet) capable of using it, but will the virtual machine be 64 bit, and how do I verify it is actually working with 64 bits? Pete. -- "The Tao of Programming flows far away and returns on the wind of morning." From kostis@REDACTED Wed Jul 28 09:23:59 2004 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 28 Jul 2004 09:23:59 +0200 (MEST) Subject: 64 bit Erlang on Opterons? In-Reply-To: Mail from 'Peter-Henry Mander ' dated: Wed, 28 Jul 2004 07:30:11 +0100 Message-ID: <200407280723.i6S7NxeE025253@spikklubban.it.uu.se> Peter-Henry Mander wrote: > > I've a dual AMD Opteron machine at my disposal, and I wonder if Erlang > compiled from source will be able to take advantage of its 64 bit > capability. I suspect that HiPE is not (yet) capable of using it, but > will the virtual machine be 64 bit, and how do I verify it is actually > working with 64 bits? Actually, HiPE *is* available for AMD64 machines. (We have not advertized this much since we have been quite busy lately.) Get the otp-20040705-1407.tar.gz snapshot from http://www.it.uu.se/research/group/hipe/snapshots/ compile it, and you will see something like: Erlang (BEAM) emulator version 5.4 [64-bit] [source] [hipe] when you start the system. We are not aware of any problems in the port. A paper describing the internals of the port, titled "HiPE on AMD64", will be presented at this year's ACM Erlang Workshop and is available at: http://user.it.uu.se/~kostis/Papers/amd64.pdf Enjoy! Kostis. From ingela@REDACTED Wed Jul 28 09:34:32 2004 From: ingela@REDACTED (Ingela Anderton) Date: Wed, 28 Jul 2004 09:34:32 +0200 Subject: ODBC 2.0 and the Nagel Algorithm References: <93D5AA5C-DFB6-11D8-B782-000A956D87EE@patternmatched.com> Message-ID: <16647.22280.368931.594582@gargle.gargle.HOWL> Rudolph van Graan wrote: > Been playing with odbc some the last two days. Found that I couldn't > convince the odbc subsystem to do more than about 40 simple select > queries per second independent of the hardware on our Linux boxes with > unixodbc and postgres. After some messing around with odbcserver.c we > found that if you disable the nagel algorithm on the socket that odbc > uses, we can push the transaction rate up to close to 600/s. I am not > sure if this problem disappears on windows or solaris, but on linux it > degrades performance massively. Humm ... this would account for the performance drop reported by Laura M. Castro. In fact in the case of Erlang odbc the Nagel algorithm will never help but always cause an unnecessary delay, I will change the socket option for the next odbc version. Also different operating systems may have different delays for the Nagle algorithm hence explaining why some people have noticed a big performance drop but my own tests only show a small performance drop on Solaris and no performance drop on Windows. (In the Windows case there are also other factors that made the old odbc slower on windows than on unix-platforms. When these factors where eliminated in the new odbc they may have help compensate for Nagel delays.) -- /m.v.h Ingela Ericsson AB - OTP team From erlang@REDACTED Wed Jul 28 09:33:36 2004 From: erlang@REDACTED (Peter-Henry Mander) Date: Wed, 28 Jul 2004 08:33:36 +0100 Subject: 64 bit Erlang on Opterons? In-Reply-To: <200407280723.i6S7NxeE025253@spikklubban.it.uu.se> References: <200407280723.i6S7NxeE025253@spikklubban.it.uu.se> Message-ID: <20040728083336.0d42563c.erlang@manderp.freeserve.co.uk> Kostis, you're a star! Thanks, I owe you a beer at the very least! Maybe in Stockholm in September, if I get my life/work in order. If you don't hear anything more from me, you'll know the port works for me too :-) Pete. On Wed, 28 Jul 2004 09:23:59 +0200 (MEST) Kostis Sagonas wrote: > Peter-Henry Mander wrote: > > > > I've a dual AMD Opteron machine at my disposal, and I wonder if Erlang > > compiled from source will be able to take advantage of its 64 bit > > capability. I suspect that HiPE is not (yet) capable of using it, but > > will the virtual machine be 64 bit, and how do I verify it is actually > > working with 64 bits? > > Actually, HiPE *is* available for AMD64 machines. (We have not > advertized this much since we have been quite busy lately.) > > Get the > > otp-20040705-1407.tar.gz > > snapshot from > > http://www.it.uu.se/research/group/hipe/snapshots/ > > compile it, and you will see something like: > > Erlang (BEAM) emulator version 5.4 [64-bit] [source] [hipe] > > when you start the system. We are not aware of any problems in the port. > > A paper describing the internals of the port, titled "HiPE on AMD64", > will be presented at this year's ACM Erlang Workshop and is available > at: > > http://user.it.uu.se/~kostis/Papers/amd64.pdf > > Enjoy! > Kostis. > -- "The Tao of Programming flows far away and returns on the wind of morning." From kostis@REDACTED Wed Jul 28 09:49:36 2004 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 28 Jul 2004 09:49:36 +0200 (MEST) Subject: 64 bit Erlang on Opterons? In-Reply-To: Mail from 'Peter-Henry Mander ' dated: Wed, 28 Jul 2004 08:33:36 +0100 Message-ID: <200407280749.i6S7naKp026080@spikklubban.it.uu.se> Peter-Henry Mander wrote: > > Kostis, you're a star! Thanks, I owe you a beer at the very least! > Maybe in Stockholm in September, if I get my life/work in order. > > If you don't hear anything more from me, you'll know the port works > for me too :-) Since I do not expect to hear from you, let me comment on the above. There are also other people of the HiPE group behind the port, Daniel Luna in particular, a student who is mostly responsible for the development of the AMD64 port. Now the thing with him is that he is the only HiPE member who does not like drinking, which might explain the stability of the port and why the bill for your offer will not be very high in this case ;) Cheers, Kostis. From Manfred.Widera@REDACTED Wed Jul 28 10:55:08 2004 From: Manfred.Widera@REDACTED (Manfred Widera) Date: Wed, 28 Jul 2004 10:55:08 +0200 Subject: Funs with variable arity? Message-ID: <200407281055.08388.Manfred.Widera@Fernuni-Hagen.de> Hi Erlang Experts, does anybody know a way of writing a function that generates funs of variable arity, e.g. fun_generator(Code, Arity) -> ... such that the following code fragments both work ----------------------------------------- F1 = fun_generator(Something, 1), F1(Arg). ----------------------------------------- F5 = fun_generatot(SomethingElse, 5), F5(A1, A2, A3, A4, A5). ----------------------------------------- One brute force (and very ugly) method is to enumerate all needed arities up to a sufficient threshold, e.g. ************************************ fun_generator(Code, 0) -> fun() -> ... end; fun_generator(Code, 1) -> fun(A1) -> ... end; fun_generator(Code, 2) -> fun(A1, A2) -> ... end; ... fun_generator(Code, 42) -> fun(A1, ..., A42) -> ... end. ************************************ Is there a better solution? It is not sufficient for me to have a fun of arity 1, and to provide a list of the arguments, because I want to inspect parse results of funs, and to return a fun that behaves identically in the runtime system (especially regarding the arity). Manfred From HENNIEM.MULLER@REDACTED Wed Jul 28 13:38:16 2004 From: HENNIEM.MULLER@REDACTED (HENNIEM MULLER) Date: Wed, 28 Jul 2004 13:38:16 +0200 Subject: Dynamic fields in mnemosyne query Message-ID: Hi, I need to write a function that will retrieve a record from a mnesia db. The function receives 2 args. First the value for a key field, then the actual field name of the key. I wrote the function as follow: select(Key, SearchBy) -> Handle = query [ P || P <- table(pos_table), P.list_to_atom(SearchBy) = Key] end, L = mnesia:transaction( fun() -> mnemosyne:eval(Handle) end). However, when it compiles, it gives me the error: undefined database record field "list_to_atom". If I remove the list_to_atom, it gives me a syntax error. Can anyone please? Hennie Muller "Anything is possible," "except this..." ##################################################################################### The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy all copies. ##################################################################################### From mfong@REDACTED Wed Jul 28 14:39:29 2004 From: mfong@REDACTED (marco) Date: Wed, 28 Jul 2004 08:39:29 -0400 Subject: Megaco Application Message-ID: <003d01c4749f$ecd80a60$f701a20a@ARANDIASA.local> Hi there, my name is Marco and i?m looking forward to knowing if the Erlang/OTP platform is able to perform some Megaco Application concerning Voice.I've seen the examples this platform has but i don't know what they do. When i write all the code i just see messages transmitting all over the nodes, but as i said before i don't know what they mean, if i have a microphone another user in another computer will hear me???? As a matter of fact i'm searching for a Free Megaco's Softphone but i don't if Erlang can supply me what i'm looking for or answer my questions. Please i'd really appreciate if you or someone you know helped me out. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mscandar@REDACTED Wed Jul 28 17:23:10 2004 From: mscandar@REDACTED (Mark Scandariato) Date: Wed, 28 Jul 2004 11:23:10 -0400 Subject: The Great Computer Language Shootout is back In-Reply-To: <20040727220821.67466.qmail@web60508.mail.yahoo.com> References: <20040727220821.67466.qmail@web60508.mail.yahoo.com> Message-ID: <4107C4DE.9030908@cisco.com> (One post to 'shootout-list@REDACTED' and I start getting Nigerian letters!) Try this one. Seems about the same speed as the other version. I tried it on a 4 MB test file (on a 2.4GHz P4, Redhat 9) and it took about 1 second, exclusive of erlang's startup time. (The native wc took about .67s). Mark. ----------------------- -module(wc). -export([start/0]). start() -> % io:fwrite("~p~n", [now()]), ok = io:setopts([binary]), s(next({0, <<>>}), 0, 0). next({C, <>}) -> {Char, {C+1, Rest}}; next({C, <<>>}) -> case io:get_chars('', 4096) of eof -> {eof, C}; Bin -> next({C, Bin}) end. done(L, W, C) -> io:fwrite("~p\t~p\t~p~n", [L, W, C]), % io:fwrite("~p~n", [now()]), erlang:halt(). s({eof, C}, L, W) -> done(L, W, C); s({$\s, S}, L, W) -> s(next(S), L, W); s({$\t, S}, L, W) -> s(next(S), L, W); s({$\n, S}, L, W) -> s(next(S), L+1, W); s({_, S}, L, W) -> w(next(S), L, W+1). w({eof, C}, L, W) -> done(L, W, C); w({$\s, S}, L, W) -> s(next(S), L, W); w({$\t, S}, L, W) -> s(next(S), L, W); w({$\n, S}, L, W) -> s(next(S), L+1, W); w({_, S}, L, W) -> w(next(S), L, W). ------------ Isaac Gouy wrote: > One of the peculiarities of the Shootout tests is that they take > redirected input from the commandline rather than opening a file > directly. How would you do that? > > --- Mark Scandariato wrote: > >>How about: >> >>-module(wc). >>-compile(export_all). >> >>start(File) -> >> {ok, F} = file:open(File, [raw, read, binary]), >> s(next({F, 0, <<>>}), 0, 0). >> >>next({F, C, <>}) -> >> {Char, {F, C+1, Rest}}; >> >>next({F, C, <<>>}) -> >> case file:read(F, 4096) of >> {ok, Bin} -> next({F, C, Bin}); >> eof -> {eof, C} >> end. >> >>s({eof, C}, L, W) -> {L, W, C}; >>s({$\s, S}, L, W) -> s(next(S), L, W); >>s({$\t, S}, L, W) -> s(next(S), L, W); >>s({$\n, S}, L, W) -> s(next(S), L+1, W); >>s({_, S}, L, W) -> w(next(S), L, W+1). >> >>w({eof, C}, L, W) -> {L, W, C}; >>w({$\s, S}, L, W) -> s(next(S), L, W); >>w({$\t, S}, L, W) -> s(next(S), L, W); >>w({$\n, S}, L, W) -> s(next(S), L+1, W); >>w({_, S}, L, W) -> w(next(S), L, W). > > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 50x more storage than other providers! > http://promotions.yahoo.com/new_mail From davidw@REDACTED Wed Jul 28 17:31:04 2004 From: davidw@REDACTED (David N. Welton) Date: Wed, 28 Jul 2004 17:31:04 +0200 Subject: slimmed down make install (no sources) Message-ID: <4107C6B8.7000101@eidetix.com> I'm building Erlang for a slimmed down system, and it occurred to me that it might be nice if Erlang were to provide the option of not installing everything including sources and examples. Something along these lines: release_spec: opt $(INSTALL_DIR) $(RELSYSDIR)/include $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include $(INSTALL_DIR) $(RELSYSDIR)/ebin $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin release_spec_extra: release_spec $(INSTALL_DIR) $(RELSYSDIR)/src $(INSTALL_DATA) $(ERL_FILES) erl_parse.yrl $(RELSYSDIR)/src $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src with everything else modified accordingly. Or would that be too much work and I'm the only one who would find it convenient? Right now I have a shell script that erases all that extra stuff, but it seemed tidier to perform this operation in the install, maybe even making the installation of the sources/examples an extra step (make install_sources?). Thankyou, -- David N. Welton davidw@REDACTED From vlad_dumitrescu@REDACTED Wed Jul 28 18:05:41 2004 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 28 Jul 2004 18:05:41 +0200 Subject: 64 bit Erlang on Opterons? References: <200407280723.i6S7NxeE025253@spikklubban.it.uu.se> Message-ID: Hi, great job! > A paper describing the internals of the port, titled "HiPE on AMD64", > will be presented at this year's ACM Erlang Workshop and is available > at: > > http://user.it.uu.se/~kostis/Papers/amd64.pdf I wonder one thing: the cleanup of the runtime that you had to make, and that will be part of the next release, does it affect the 32 bit runtime too? regards, Vlad From kostis@REDACTED Wed Jul 28 18:48:54 2004 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 28 Jul 2004 18:48:54 +0200 (MEST) Subject: 64 bit Erlang on Opterons? In-Reply-To: Mail from '"Vlad Dumitrescu" ' dated: Wed, 28 Jul 2004 18:05:41 +0200 Message-ID: <200407281648.i6SGmsrL013772@spikklubban.it.uu.se> Vlad Dumitrescu wrote: > Hi, great job! Thanks. > > A paper describing the internals of the port, titled "HiPE on AMD64", > > will be presented at this year's ACM Erlang Workshop and is available > > at: > > > > http://user.it.uu.se/~kostis/Papers/amd64.pdf > > I wonder one thing: the cleanup of the runtime that you had to make, and > that will be part of the next release, does it affect the 32 bit runtime > too? They do of course, since most of the changes are in shared code, but on 32-bit platforms the differences should not be noticeable by users. Actually, these cleanup changes might already be part of R9C-2. Kostis From igouy2@REDACTED Wed Jul 28 18:57:44 2004 From: igouy2@REDACTED (Isaac Gouy) Date: Wed, 28 Jul 2004 09:57:44 -0700 (PDT) Subject: The Great Computer Language Shootout is back In-Reply-To: <4107C4DE.9030908@cisco.com> Message-ID: <20040728165744.57433.qmail@web60510.mail.yahoo.com> --- Mark Scandariato wrote: > Try this one. Seems about the same speed as the other version. > I tried it on a 4 MB test file (on a 2.4GHz P4, Redhat 9) and it took > about 1 second, exclusive of erlang's startup time. > (The native wc took about .67s). What command line are you using? erlc +native wc.erl erl -noinput -s wc start < input.txt {"init terminating in do_boot",{undef,[{wc,start,[]},{init,start_it,1},{init,start_em,1}]}} Crash dump was written to: erl_crash.dump init terminating in do_boot () __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail From mscandar@REDACTED Wed Jul 28 19:38:05 2004 From: mscandar@REDACTED (Mark Scandariato) Date: Wed, 28 Jul 2004 13:38:05 -0400 Subject: The Great Computer Language Shootout is back In-Reply-To: <20040728165744.57433.qmail@web60510.mail.yahoo.com> References: <20040728165744.57433.qmail@web60510.mail.yahoo.com> Message-ID: <4107E47D.9010503@cisco.com> erl -noshell -run wc start < foo.txt Isaac Gouy wrote: > --- Mark Scandariato wrote: > >>Try this one. Seems about the same speed as the other version. >>I tried it on a 4 MB test file (on a 2.4GHz P4, Redhat 9) and it took >>about 1 second, exclusive of erlang's startup time. >>(The native wc took about .67s). > > > What command line are you using? > > erlc +native wc.erl > erl -noinput -s wc start < input.txt > > {"init terminating in > > do_boot",{undef,[{wc,start,[]},{init,start_it,1},{init,start_em,1}]}} > > Crash dump was written to: erl_crash.dump > init terminating in do_boot () > > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 50x more storage than other providers! > http://promotions.yahoo.com/new_mail From mscandar@REDACTED Wed Jul 28 19:48:31 2004 From: mscandar@REDACTED (Mark Scandariato) Date: Wed, 28 Jul 2004 13:48:31 -0400 Subject: The Great Computer Language Shootout is back In-Reply-To: <20040728165744.57433.qmail@web60510.mail.yahoo.com> References: <20040728165744.57433.qmail@web60510.mail.yahoo.com> Message-ID: <4107E6EF.708@cisco.com> I hadn't tried native compilation: turns out that it cuts the time in half: > erlc wc.erl > time erl -noshell -run wc start < 4MB.txt 111037 692748 4194304 1.040u 0.040s 0:01.09 99.0% 0+0k 0+0io 873pf+0w > erlc +native wc.erl > time erl -noshell -run wc start < 4MB.txt 111037 692748 4194304 0.440u 0.030s 0:00.47 100.0% 0+0k 0+0io 881pf+0w which beats the wc that comes with redhat: > time wc 4MB.txt 111037 692748 4194304 4MB.txt 0.640u 0.000s 0:00.59 108.4% 0+0k 0+0io 142pf+0w Mark. Isaac Gouy wrote: > --- Mark Scandariato wrote: > >>Try this one. Seems about the same speed as the other version. >>I tried it on a 4 MB test file (on a 2.4GHz P4, Redhat 9) and it took >>about 1 second, exclusive of erlang's startup time. >>(The native wc took about .67s). > > > What command line are you using? > > erlc +native wc.erl > erl -noinput -s wc start < input.txt > > {"init terminating in > > do_boot",{undef,[{wc,start,[]},{init,start_it,1},{init,start_em,1}]}} > > Crash dump was written to: erl_crash.dump > init terminating in do_boot () > > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 50x more storage than other providers! > http://promotions.yahoo.com/new_mail From igouy2@REDACTED Wed Jul 28 20:07:07 2004 From: igouy2@REDACTED (Isaac Gouy) Date: Wed, 28 Jul 2004 11:07:07 -0700 (PDT) Subject: The Great Computer Language Shootout is back In-Reply-To: <4107E47D.9010503@cisco.com> Message-ID: <20040728180707.13606.qmail@web60502.mail.yahoo.com> --- Mark Scandariato wrote: > erl -noshell -run wc start < foo.txt Doesn't work for me. erlang_shootout # erl -noshell -run wc start < input.txt {"init terminating in do_boot",{undef,[{wc,start,[]},{init,start_it,1},{init,start_em,1}]}} Crash dump was written to: erl_crash.dump init terminating in do_boot () __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail From luke@REDACTED Wed Jul 28 20:10:32 2004 From: luke@REDACTED (Luke Gorrie) Date: Wed, 28 Jul 2004 20:10:32 +0200 Subject: The Great Computer Language Shootout is back In-Reply-To: <20040728180707.13606.qmail@web60502.mail.yahoo.com> (Isaac Gouy's message of "Wed, 28 Jul 2004 11:07:07 -0700 (PDT)") References: <20040728180707.13606.qmail@web60502.mail.yahoo.com> Message-ID: Hi Isaac, > --- Mark Scandariato wrote: >> erl -noshell -run wc start < foo.txt > > Doesn't work for me. > > erlang_shootout # erl -noshell -run wc start < input.txt > {"init terminating in > > do_boot",{undef,[{wc,start,[]},{init,start_it,1},{init,start_em,1}]}} > > Crash dump was written to: erl_crash.dump > init terminating in do_boot () Looks like it isn't finding the `wc.beam' file. Try adding '-pz .' to add the current directory to the code path. -Luke From igouy2@REDACTED Wed Jul 28 21:01:03 2004 From: igouy2@REDACTED (Isaac Gouy) Date: Wed, 28 Jul 2004 12:01:03 -0700 (PDT) Subject: The Great Computer Language Shootout is back In-Reply-To: Message-ID: <20040728190103.87926.qmail@web60510.mail.yahoo.com> This bit of advice from Luke helped me figure-out my dumb mistake > bring up an Erlang shell and do 'm(wc).' I had cut/pasted Mark's code into an existing file, without changing the module name... which is why it couldn't find it! =ERROR REPORT==== 28-Jul-2004::18:02:41 === beam/beam_load.c(908): Error loading module wc: module name in object code is hello Sorry, very sorry, very very sorry ... erlang_shootout # time erl -noshell -run wc start < input.txt 50000 274000 12192000 real 0m3.168s user 0m2.930s sys 0m0.240s Looks good! Thank you all, Isaac __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From vlad_dumitrescu@REDACTED Wed Jul 28 21:30:59 2004 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 28 Jul 2004 21:30:59 +0200 Subject: 64 bit Erlang on Opterons? References: <200407281648.i6SGmsrL013772@spikklubban.it.uu.se> Message-ID: > > I wonder one thing: the cleanup of the runtime that you had to make, and > > that will be part of the next release, does it affect the 32 bit runtime > > too? > > They do of course, since most of the changes are in shared code, but > on 32-bit platforms the differences should not be noticeable by users. > Actually, these cleanup changes might already be part of R9C-2. Yes, it was the noticeable parts I was most interested in :-) BTW, are there any changes to the policy of not supporting Windows? List archives reveal this policy as per 2001 (I think) but since then maybe (hopefully) somebody found a way to handle the Windows stack? [ref http://www.erlang.org/ml-archive/erlang-questions/200109/msg00053.html] Thanks, Vlad From kostis@REDACTED Wed Jul 28 23:07:37 2004 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 28 Jul 2004 23:07:37 +0200 (MEST) Subject: 64 bit Erlang on Opterons? In-Reply-To: Mail from '"Vlad Dumitrescu" ' dated: Wed, 28 Jul 2004 21:30:59 +0200 Message-ID: <200407282107.i6SL7bb6022148@spikklubban.it.uu.se> > BTW, are there any changes to the policy of not supporting Windows? Just for the record: We have no _policy_ of not supporting Windows; we just do not have access to a Windows machine with access to developer's toolset to test things out. > List archives reveal this policy as per 2001 (I think) but since then > maybe (hopefully) somebody found a way to handle the Windows stack? We have not heard anything about this. If there are volunteers out there who can try things out and keep us posted, we can try to find solutions to the problems they report to us and see where this leads us... Best, Kostis. From fritchie@REDACTED Thu Jul 29 07:09:31 2004 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Thu, 29 Jul 2004 00:09:31 -0500 Subject: Reliable Multicast In-Reply-To: Message of "27 Jul 2004 15:52:30 CDT." <1090961550.2164.34.camel@dhcp-lom-194-186.futuresource.com> Message-ID: <200407290509.i6T59Vrn019806@snookles.snookles.com> There's a driver for Spread in Jungerl, which may or may not be the sort of thing you're looking for. Info on the Spread Toolkit is available at http://www.spread.org/. -Scott From vlad_dumitrescu@REDACTED Thu Jul 29 10:07:15 2004 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Thu, 29 Jul 2004 10:07:15 +0200 Subject: 64 bit Erlang on Opterons? References: <200407282107.i6SL7bb6022148@spikklubban.it.uu.se> Message-ID: > > BTW, are there any changes to the policy of not supporting Windows? > > Just for the record: We have no _policy_ of not supporting Windows; we > just do not have access to a Windows machine with access to developer's > toolset to test things out. Sorry, I used the word with a tongue-in-cheek meaning. I was referring to not having any plans for Windows support. /Vlad From casper2000a@REDACTED Thu Jul 29 11:52:18 2004 From: casper2000a@REDACTED (Casper) Date: Thu, 29 Jul 2004 15:52:18 +0600 Subject: ASN compiler usage to compile ITU protocols Message-ID: <20040729093943.4153B4000CB@mail.omnibis.com> Hi All, I wonder whether the Erlang ASN compiler/runtime can compile, encode, decode ITU protocol standards. What're the standards it supports? Can it do the same to current ITU-T standards? Can it do the same to 3GPP standards as well? Is there a database ASN.1 compilation of TCAP, MAP, INAP, ISUP to download? Thanks in advance! Regards, Eranga From eliliang@REDACTED Thu Jul 29 15:03:59 2004 From: eliliang@REDACTED (Eli Liang) Date: Thu, 29 Jul 2004 06:03:59 -0700 (PDT) Subject: 64 bit Erlang on Opterons? In-Reply-To: <200407282107.i6SL7bb6022148@spikklubban.it.uu.se> Message-ID: <20040729130359.30471.qmail@web53303.mail.yahoo.com> I tried to comment on this topic already yesterday, but my note ended up going only to Vlad. I would be interested in getting HiPE running on QNX Neutrino 6.2.1. There is a port of Erlang/OTP R9C to this version of Neutrino... all except for HiPE. (See: http://www.openqnx.com/Article229.html) The issues with HiPE & QNX that the porting team identified there were: (1) dlopen doesn't include support for "RTLD_NEXT" in QNX (2) SA_ONSTACK and SIGSTKSZ are not defined in QNX Also, as Vlad pointed out, there might be the same stack overflow problem on QNX as the circa 2001 problem that occurs under Windows. Can the HiPE team make some comments on these issues? Might there be workarounds in HiPE to the QNX deficiencies in (1) & (2) above? Kostis Sagonas wrote: > BTW, are there any changes to the policy of not supporting Windows? Just for the record: We have no _policy_ of not supporting Windows; we just do not have access to a Windows machine with access to developer's toolset to test things out. > List archives reveal this policy as per 2001 (I think) but since then > maybe (hopefully) somebody found a way to handle the Windows stack? We have not heard anything about this. If there are volunteers out there who can try things out and keep us posted, we can try to find solutions to the problems they report to us and see where this leads us... Best, Kostis. --------------------------------- Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jamesh@REDACTED Thu Jul 29 16:52:37 2004 From: jamesh@REDACTED (James Hague) Date: Thu, 29 Jul 2004 09:52:37 -0500 Subject: Windows R9C-2 bug: Eshell background color change doesn't stick Message-ID: 1. Start up werl. 2. Change the background color. 3. Quit. 4. Start werl again. 5. The color is back to the default of white. I've had similar problems with different versions of Erlang under Windows. Sometimes I font changes stick, sometimes they don't. Sometimes color changes stick, sometimes they don't. I've had the same problems on different machines running different versions of Windows (XP, 2000, ME). Small feature request: *Please* also save the current window position and size between sessions. I can force it to a preset position with a 4NT alias: start/pos=320,200,640,480 d:\erlang\bin\werl.exe but this should be standard behavior. BTW, if you dislike the registry for this kind of thing, it's modern practice to put such settings into the "Documents & Settings folder\x" where x is the current user. The USERPROFILE environment variable points to the right folder under recent versions of Windows. From eliliang@REDACTED Thu Jul 29 17:18:21 2004 From: eliliang@REDACTED (Eli Liang) Date: Thu, 29 Jul 2004 08:18:21 -0700 (PDT) Subject: 64 bit Erlang on Opterons? In-Reply-To: <20040729130359.30471.qmail@web53303.mail.yahoo.com> Message-ID: <20040729151821.15286.qmail@web53301.mail.yahoo.com> By the way, RTLD_NEXT is not a 1003.1 (2004) standard, so HiPE should make it optional anyways. (See: http://www.opengroup.org/onlinepubs/009695399/) Eli Liang wrote: I tried to comment on this topic already yesterday, but my note ended up going only to Vlad. I would be interested in getting HiPE running on QNX Neutrino 6.2.1. There is a port of Erlang/OTP R9C to this version of Neutrino... all except for HiPE. (See: http://www.openqnx.com/Article229.html) The issues with HiPE & QNX that the porting team identified there were: (1) dlopen doesn't include support for "RTLD_NEXT" in QNX (2) SA_ONSTACK and SIGSTKSZ are not defined in QNX Also, as Vlad pointed out, there might be the same stack overflow problem on QNX as the circa 2001 problem that occurs under Windows. Can the HiPE team make some comments on these issues? Might there be workarounds in HiPE to the QNX deficiencies in (1) & (2) above? Kostis Sagonas wrote: > BTW, are there any changes to the policy of not supporting Windows? Just for the record: We have no _policy_ of not supporting Windows; we just do not have access to a Windows machine with access to developer's toolset to test things out. > List archives reveal this policy as per 2001 (I think) but since then > maybe (hopefully) somebody found a way to handle the Windows stack? We have not heard anything about this. If there are volunteers out there who can try things out and keep us posted, we can try to find solutions to the problems they report to us and see where this leads us... Best, Kostis. --------------------------------- Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Thu Jul 29 18:01:34 2004 From: erlang@REDACTED (Peter-Henry Mander) Date: Thu, 29 Jul 2004 17:01:34 +0100 Subject: 64 bit Erlang on Opterons? In-Reply-To: References: <200407282107.i6SL7bb6022148@spikklubban.it.uu.se> Message-ID: <20040729170134.13e73385.erlang@manderp.freeserve.co.uk> Hi Kostis, This is probably a problem with erl_interface, and nothing to do with AMD64 HiPE, so apologies in advance. I'm getting the following errors. EIO on erl_connect in the C-node =ERROR REPORT==== 29-Jul-2004::17:54:26 === ** 'test@REDACTED': Connection attempt from node 'sippc@REDACTED' rejected since it cannot handle extended pids and ports. ** The "extended pids and ports" tells me that the erl_interface library is probably not made for 64 bit systems. Is erl_interface the culprit? If so, how do I fix erl_interface? Pete. -- "The Tao of Programming flows far away and returns on the wind of morning." From erlang@REDACTED Thu Jul 29 18:35:37 2004 From: erlang@REDACTED (Peter-Henry Mander) Date: Thu, 29 Jul 2004 17:35:37 +0100 Subject: 64 bit Erlang on Opterons? In-Reply-To: <20040729170134.13e73385.erlang@manderp.freeserve.co.uk> References: <200407282107.i6SL7bb6022148@spikklubban.it.uu.se> <20040729170134.13e73385.erlang@manderp.freeserve.co.uk> Message-ID: <20040729173537.5ec54998.erlang@manderp.freeserve.co.uk> ... and you all may call me a fool! I should have RTFM. The notes.html file specifically states that erl_interface _is_ 64 bit capable. Duh! I was using version erl_interface-3.4.5 instead of erl_interface-3.4.4 and all works now. What happened with erl_interface-3.4.5? It wasn't happy at all! Pete. On Thu, 29 Jul 2004 17:01:34 +0100 Peter-Henry Mander wrote: > > Hi Kostis, > > This is probably a problem with erl_interface, and nothing to do with AMD64 HiPE, so apologies in advance. > > I'm getting the following errors. > > EIO on erl_connect in the C-node > > =ERROR REPORT==== 29-Jul-2004::17:54:26 === > ** 'test@REDACTED': Connection attempt from node 'sippc@REDACTED' rejected since it cannot handle extended pids and ports. ** > > The "extended pids and ports" tells me that the erl_interface library is probably not made for 64 bit systems. > > Is erl_interface the culprit? If so, how do I fix erl_interface? > > Pete. > > > -- > "The Tao of Programming > flows far away > and returns > on the wind of morning." > -- "The Tao of Programming flows far away and returns on the wind of morning." From jamesh@REDACTED Thu Jul 29 18:48:41 2004 From: jamesh@REDACTED (James Hague) Date: Thu, 29 Jul 2004 11:48:41 -0500 Subject: Windows R9C-2 bug: Eshell background color change doesn't sti ck Message-ID: One further note: It would be nice to decouple the visual shell from the emulator proper, to enable writing nifty front-end in Delphi or C# or whatever. Right now the visual shell and emulator are wrapped up in the same executable. From mikpe@REDACTED Thu Jul 29 21:15:50 2004 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 29 Jul 2004 21:15:50 +0200 (MEST) Subject: 64 bit Erlang on Opterons? Message-ID: <200407291915.i6TJFokZ018036@harpo.it.uu.se> On Thu, 29 Jul 2004 08:18:21 -0700 (PDT), Eli Liang wrote: >By the way, RTLD_NEXT is not a 1003.1 (2004) standard, so HiPE should make it optional anyways. (See: http://www.opengroup.org/onlinepubs/009695399/) ... >I would be interested in getting HiPE running on QNX Neutrino 6.2.1. There is a port of Erlang/OTP R9C to this version of Neutrino... all except for HiPE. (See: http://www.openqnx.com/Article229.html) > >The issues with HiPE & QNX that the porting team identified there were: >(1) dlopen doesn't include support for "RTLD_NEXT" in QNX >(2) SA_ONSTACK and SIGSTKSZ are not defined in QNX > >Also, as Vlad pointed out, there might be the same stack overflow problem on QNX as the circa 2001 problem that occurs under Windows. > >Can the HiPE team make some comments on these issues? Might there be workarounds in HiPE to the QNX deficiencies in (1) & (2) above? HiPE support for x86/x86-64 requires that the environment (OS and C library) never asynchronously executes any code on the current (%esp) stack. In Unix terms, we require sigaltstack semantics for signal handlers. Our currently supported OS/libc combinations (Linux/glibc and Solaris) don't guarantee this as-is, but can be coerced to do so with (system-dependent) use of RTLD_NEXT and SA_ONSTACK. If QNX can be made to comply with these requirements, then HiPE/x86 can support QNX. Otherwise it falls into the same category as Windows: no known workarounds that don't seriously sacrifice performance or memory usage. /Mikael From mscandar@REDACTED Thu Jul 29 21:25:26 2004 From: mscandar@REDACTED (Mark Scandariato) Date: Thu, 29 Jul 2004 15:25:26 -0400 Subject: obsolete module names Message-ID: <41094F26.6090508@cisco.com> I just wrote a little module called 'udp' (for, surprise!, a udp interface). Unfortunately, when compiling other modules which use udp's functions, the compiler complains that "module 'udp' is obsolete; use 'gen_udp'". Good short names are hard to come by - I like 'udp'. Is there anyway to turn off that particular warning for that particular name? Thanks, Mark. From matthias@REDACTED Thu Jul 29 21:29:33 2004 From: matthias@REDACTED (Matthias Lang) Date: Thu, 29 Jul 2004 21:29:33 +0200 Subject: Fw: Fw: Did SERC at RMIT go away? In-Reply-To: <004101c472e6$db0503c0$180d69d4@segeltorp> References: <004101c472e6$db0503c0$180d69d4@segeltorp> Message-ID: <16649.20509.399164.673719@antilipe.corelatus.se> Fergus O'Brien, via Bjarne D?cker, wrote: > Maurice Castro via maurice@REDACTED is the most direct contact if > you could please pass it on. Maurice will also know the status of SERC, it > was still alive last time I checked, Maurice's biography (http://www.castro.aus.net/~maurice/bio/) strongly implies that SERC is dead: "...From the closure of the Sofware Engineering Research Centre until December 2003, I worked with the Department of Mathematics..." Matthias From Lawrie.Brown@REDACTED Fri Jul 30 01:54:42 2004 From: Lawrie.Brown@REDACTED (Lawrie Brown) Date: Fri, 30 Jul 2004 09:54:42 +1000 Subject: Fw: Fw: Did SERC at RMIT go away? In-Reply-To: <16649.20509.399164.673719@antilipe.corelatus.se> References: <004101c472e6$db0503c0$180d69d4@segeltorp> <16649.20509.399164.673719@antilipe.corelatus.se> Message-ID: <20040729235442.GA27272@icarus.its.adfa.edu.au> On Thu, Jul 29, 2004 at 09:29:33PM +0200, Matthias Lang wrote: > Maurice's biography (http://www.castro.aus.net/~maurice/bio/) strongly > implies that SERC is dead: > > "...From the closure of the Sofware Engineering Research Centre until > December 2003, I worked with the Department of Mathematics..." As a several times SERC visitor, I can confirm that SERC officially ceased to exist at the end of 2002 when RMIT canned pretty well all its research centres in a desperate attempt to stay alive (not that anyone will officially admit thats what was going on). Some of SERC's resources, including the systems which ran the SERC web server were transferred to the Dept of Mathematics at RMIT. I can only assume they've been closed down or resumed for other uses. As far as shadows of SERC resources, the EC Erlang Compiler which Maurice and I worked on is now housed here at ADFA at: http://www.cs.adfa.edu.au/~ec/ Some of Maurice's papers relevant to EC are included here. As for the rest, now scattered I guess. Cheers Lawrie ------------------------------------ <*> ------------------------------------ Post: Dr Lawrie Brown, School of IT&EE, UNSW@REDACTED, Canberra 2600 Australia Phone: 02 6268 8816 Fax: 02 6268 8581 Web: http://www.adfa.edu.au/~lpb/ From erlang@REDACTED Fri Jul 30 20:26:19 2004 From: erlang@REDACTED (Daniel Fernandez) Date: Fri, 30 Jul 2004 15:26:19 -0300 Subject: Anybody involved en VoIp gateways? Message-ID: <200407301826.i6UIQjl59010@hades.cslab.ericsson.net> Hi, Is there on the list involved in the deployment of VoIp gatways (G.711 to G.723) or media servers? Thanks Regards, Daniel Daniel Fernandez - daniel@REDACTED Inswitch Solutions -------------- next part -------------- An HTML attachment was scrubbed... URL: From cosminidis@REDACTED Sat Jul 31 02:37:01 2004 From: cosminidis@REDACTED (Cosmin Gheorghita) Date: Fri, 30 Jul 2004 17:37:01 -0700 (PDT) Subject: Decode binaries in C linked-in driver Message-ID: <20040731003701.20345.qmail@web12508.mail.yahoo.com> Hello to everyone. I have the following problem with Erlang: I need to read a file that contains integers from Erlang and send it to a linked-in driver written in VC++. Here is my code: Erlang: F = "fis.txt", case file:open(F, [read, raw, binary]) of {ok, FHandler} -> io:format("The file ~p was successfully opened ~n", [FHandler]), case file:read_file(F) of {ok, Bin} -> io:format("~nBin file read:~n ~w~n", [floating(Bin)]), call_port({testF, Bin}), io:format("~nBin file ok~n"); {error, Reason} -> io:format("~nBig error while reading the file: ~p~n", [Reason]) end. The data is sent by: Port ! {self(), {command, encode(Msg)}}, and encode() looks like this: encode({testF, LBin}) -> [4, LBin]. Now on the C part, the code is as follows: } else if (fn == 4) { index = 0; f_temp = fopen("fis_temp.txt", "wt"); fprintf(f_temp, "%d\n", bufflen); ei_get_type(buff, &index, &type, &size); fprintf(f_temp, "%d - %d\n", type, size); ei_decode_binary(buff, &index, (void*) dec_buff, &bufflen); for(i = 0;i < bufflen;i++) { fprintf(f_temp, "%d\n", dec_buff[i]); } fclose(f_temp); The dec_buff[] array is all full of 0's (I allocated mem with calloc())... Reading directly from buff[] doesn't work either.. All I want for the beginning is to read a file from Erlang and be able to write it back using fprinf(f, %d%, ...). So I want to decode the binaries into integers. Any idea on this? Thank you in advance, Cosmin P.S. I am a total beginner in Erlang, so pls be as explicit as possible __________________________________ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail