From gupta@REDACTED Thu Nov 1 01:23:45 2001 From: gupta@REDACTED (Dr. Gopal Gupta) Date: Wed, 31 Oct 2001 18:23:45 -0600 Subject: ICLP'01 and CP'01: Final Call for Participation Message-ID: <200111010023.fA10NjW31971@herbrand.utdallas.edu> o Please note that deadline for registering with reduced rates for both ICLP'01 and CP'01 expires Nov. 2nd. ------------------------------------------------------------------------------ FINAL CALL FOR PARTICIPATION!!! FINAL CALL FOR PARTICIPATION!!! INTERNATIONAL CONFERENCE ON LOGIC PROGRAMMING, 2001 (ICLP'01) AND INTERNATIONAL CONFERENCE ON CONSTRAINT PROGRAMMING, 2001 (CP'01) CORAL BEACH HOTEL AND RESORT PAPHOS, CYPRUS Nov 26 - Dec. 1 http://www.cs.ucy.ac.cy/~iclpcp01/ The international conference on logic programming (ICLP'01) and the international conference on constraint programming (CP'01) will be held in the beautiful sea resort of Paphos, Cyprus. A number of postconference workshops are also part of the program. The program also includes excursions to sites around Paphos. More information for both the ICLP'01 and CP'01 can be obtained from the website: http://www.cs.ucy.ac.cy/~iclpcp01/ ------------------------------------------------------------------------------- From hal@REDACTED Thu Nov 1 08:31:22 2001 From: hal@REDACTED (Hal Snyder) Date: 01 Nov 2001 01:31:22 -0600 Subject: netbsd otp package Message-ID: <87pu736j79.fsf@ghidra.vail> FYI- I just submitted initial bits for a NetBSD package for OTP-R8-0. Not that people haven't been using Erlang on NetBSD up to now. This is just to make it easier to get Erlang going on any of the 45 or so architectures supported by NetBSD - at least those big enough to run the kit. One reason for wanting to run it on NetBSD is the platform's aggressive support of IPv6. Unfortunately, although there appears to be code in R8 to deal with IPv6, initial attempts to get two nodes talking over IPv6 with -proto_dist inet6_tcp resulted in all pangs and no pings. :-( Hope to have time to look into this soon... -------------- next part -------------- An embedded message was scrubbed... From: hal@REDACTED Subject: pkg/14416: new package - otp (Erlang) Date: Thu, 1 Nov 2001 01:17:02 -0600 (CST) Size: 2856 URL: From vances@REDACTED Thu Nov 1 18:16:19 2001 From: vances@REDACTED (Vance Shipley) Date: Thu, 1 Nov 2001 12:16:19 -0500 Subject: bug reporting? Message-ID: I know longer see any reference to a bug reporting proceedure on the Open Source Erlang web site. There used to be one didn't there? I no longer see the list of open issues or todo's either. I found a small error in the documentation today and would pass it along so it doesn't come back to bite anyone, including me, again. That is if anyone is accepting these sorts of things. -Vance Files: compile.3, compile.html, epp.3, epp.html, erl_lint.3, erl_lint.html, erl_scan.3, erl_scan.html, io.3, io.html Error Information The ErrorInfo mentioned above is the standard ErrorInfo structure which is returned from all IO modules. It has the following format: {ErrorLine, Module, ErrorDescriptor} A string which describes the error is obtained with the following call: --- apply(Module, format_error, ErrorDescriptor) ^^^^^^^^^^^^^^^ Should be: +++ apply(Module, format_error, [ErrorDescriptor]) ^ ^ -------------- next part -------------- A non-text attachment was scrubbed... Name: ErrorDescriptor.patch Type: application/octet-stream Size: 9139 bytes Desc: not available URL: From bjarne@REDACTED Thu Nov 1 18:18:26 2001 From: bjarne@REDACTED (Bjarne =?iso-8859-1?Q?D=E4cker?=) Date: Thu, 01 Nov 2001 18:18:26 +0100 Subject: Erlang/OTP and the Web Services Universe Message-ID: <3BE183E1.DACE073F@erix.ericsson.se> "Steven H. Rogers" wrote: > - Is there a strategy for promoting Erlang/OTP as a general web services > platform? > > - Are there any initiatives to support .NET and/or J2EE > interoperability? Well, we have sort of thought about those questions but have not got our act together. I think that they are excellent ideas. Best regards Bjarne Computer Science Lab Ericsson Utv AB Box 1505 125 25 ?lvsj? - Stockholm Sweden -------------- next part -------------- An embedded message was scrubbed... From: Mickael Remond Subject: Re: Erlang/OTP and the Web Services Universe Date: Wed, 31 Oct 2001 22:47:56 +0100 Size: 3283 URL: From hal@REDACTED Thu Nov 1 18:53:37 2001 From: hal@REDACTED (Hal Snyder) Date: 01 Nov 2001 11:53:37 -0600 Subject: bug reporting? In-Reply-To: References: Message-ID: <87pu725qe6.fsf@ghidra.vail> "Vance Shipley" writes: > I know longer see any reference to a bug reporting proceedure > on the Open Source Erlang web site. There used to be one didn't > there? I no longer see the list of open issues or todo's either. > > I found a small error in the documentation today and would pass > it along so it doesn't come back to bite anyone, including me, again. > That is if anyone is accepting these sorts of things. I have a couple nits to send in, too. Isn't there an *excellent* trouble ticket system that runs on Erlang? Something like um, btt, no? http://sourceforge.net/projects/btt/ :) From kent@REDACTED Fri Nov 2 05:11:55 2001 From: kent@REDACTED (Kent Boortz) Date: 02 Nov 2001 05:11:55 +0100 Subject: bug reporting? In-Reply-To: Hal Snyder's message of "01 Nov 2001 11:53:37 -0600" References: <87pu725qe6.fsf@ghidra.vail> Message-ID: Hal Snyder writes: > I have a couple nits to send in, too. > > Isn't there an *excellent* trouble ticket system that runs on Erlang? > Something like um, btt, no? http://sourceforge.net/projects/btt/ I think this is an excellent idea. We plan to release snapshots of R9 much sooner than for R8. We want discussions and support questions for OpenSource Erlang/OTP to go to the erlang-questions list but there should be some way to report other things without using this list. We had a maintainers mailing address but it wasn't working very well. The majority of the mails we got should have been sent to commercial support, erlang-questions, webmaster or sales. The mails we got asking for "free support" was also taking us lots of time that we feel we want to spend improving the product, support our paying customers and to support the OpenSource community as a group. But removing the address was an experiment, we may open it again if other solutions turns out to be unpractical. The idea with OpenSource is that we give and we get something back. We can't get something back if we can't be contacted ;-) kent From vladdu@REDACTED Fri Nov 2 07:14:49 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Fri, 02 Nov 2001 07:14:49 +0100 Subject: ESDL Message-ID: Hi good folks, I noticed that ESDL has a newer release (0.9.1201) but I can't go to the ESDL web page, I am redirected to the main CSLab page... what can be wrong? thanks, Vlad _________________________________________________________________ H?mta MSN Explorer kostnadsfritt p? http://explorer.msn.se From mickael.remond@REDACTED Fri Nov 2 07:30:07 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Fri, 2 Nov 2001 07:30:07 +0100 Subject: ESDL In-Reply-To: References: Message-ID: <20011102073007.A1153@erlang-fr.org> Vlad Dumitrescu (vladdu@REDACTED) wrote: > Hi good folks, > > I noticed that ESDL has a newer release (0.9.1201) but I can't go to the > ESDL web page, I am redirected to the main CSLab page... what can be wrong? Hello, I do not know what link you are using but the following is working for me: http://www.ericsson.com/cslab/~dgud/esdl/ Have fun! I have problem with esdl and sdl on my machine and get a segfault from the sdl library when trying to launch board or wings on my Linux machine (Debian sid) :( I will try with other version of SDL. -- Micka?l R?mond http://www.erlang-fr.org/ From thomas@REDACTED Fri Nov 2 09:08:06 2001 From: thomas@REDACTED (Thomas Arts) Date: Fri, 02 Nov 2001 09:08:06 +0100 Subject: ESDL References: <20011102073007.A1153@erlang-fr.org> Message-ID: <3BE25466.57AB795C@cslab.ericsson.se> In order to reach pages of the cslab, want should for the moment use www.ericsson.com instead of ericsson.se. Regards Thomas --- Thomas Arts Ericsson Computer Science Laboratory Mickael Remond wrote: > > Vlad Dumitrescu (vladdu@REDACTED) wrote: > > Hi good folks, > > > > I noticed that ESDL has a newer release (0.9.1201) but I can't go to the > > ESDL web page, I am redirected to the main CSLab page... what can be wrong? > > Hello, > > I do not know what link you are using but the following is working for > me: > http://www.ericsson.com/cslab/~dgud/esdl/ > > Have fun! > > I have problem with esdl and sdl on my machine and get a segfault from > the sdl library when trying to launch board or wings on my Linux > machine (Debian sid) :( > I will try with other version of SDL. > > -- > Micka?l R?mond > http://www.erlang-fr.org/ From willem@REDACTED Fri Nov 2 17:01:34 2001 From: willem@REDACTED (Willem Broekema) Date: Fri, 02 Nov 2001 17:01:34 +0100 Subject: closing a listening socket by port number Message-ID: <3BE2C35E.8060306@pastelhorn.com> I want to close a listening socket by its port number. I have an application that should start a listening socket on a predefined port. Instead of return "{badmatch,{error,eaddrinuse}}", it should exit, or at least close the socket of, that process and take its place. Is it possible? Thanks, - Willem From sam@REDACTED Fri Nov 2 17:07:45 2001 From: sam@REDACTED (Samuel Tardieu) Date: Fri, 2 Nov 2001 17:07:45 +0100 Subject: closing a listening socket by port number In-Reply-To: <3BE2C35E.8060306@pastelhorn.com> References: <3BE2C35E.8060306@pastelhorn.com> Message-ID: <2001-11-02-17-07-45+trackit+sam@inf.enst.fr> On 2/11, Willem Broekema wrote: | I want to close a listening socket by its port number. This does not work this way. | I have an application that should start a listening socket on a | predefined port. Instead of return "{badmatch,{error,eaddrinuse}}", | it should exit, or at least close the socket of, that process and | take its place. | | Is it possible? The TCP/IP stack does not allow that (you have to know the file descriptor to close it; the FD is the only thing that you can manipulate at all). You should use a supervisor (see OTP principles) or at least a linked process: that process would close every socket object opened by the faulty process. From rod@REDACTED Fri Nov 2 17:56:54 2001 From: rod@REDACTED (Rodolphe Duge de Bernonville) Date: Fri, 02 Nov 2001 17:56:54 +0100 Subject: closing a listening socket by port number References: <3BE2C35E.8060306@pastelhorn.com> Message-ID: <3BE2D056.D7770CED@idealx.com> Willem Broekema a ?crit : > > I want to close a listening socket by its port number. > > I have an application that should start a listening socket on a > predefined port. Instead of return "{badmatch,{error,eaddrinuse}}", > it should exit, or at least close the socket of, that process and > take its place. > > Is it possible? > you should also do that in the module that open the socket : setsockopt with SO_REUSEADDR example from different erl files : gen_tcp:listen(Port, [binary, {packet,cdr}, {reuseaddr,true}]) doc : http://www.erlang.org/doc/r8b/lib/kernel-2.7/doc/html/inet.html From rv@REDACTED Sun Nov 4 20:32:08 2001 From: rv@REDACTED (Robert Virding) Date: Sun, 04 Nov 2001 20:32:08 +0100 Subject: I/o frmo binaries Message-ID: <200111041932.fA4JW8A01365@erik.virding.org> Many have requested a module which allows doing i/o to/from binaries. Here is a small module I have fixed which does this. It only preliminary but seems to work ok. The API is: bin_io:open_read(Binary) -> {ok,IoStream} bin_io:open_create() -> {ok,IoStream} bin_io:open_append(Binary) -> {ok,IoStream} bin_io:close(IoStream) -> ok | {ok,Binary} If the binary was opened for write or append then bin_io:close will return the resultant binary, otherwise just ok. After opening the binary you can do normal io calls on the stream. E.g. 9> {ok,F} = bin_io:open_create(). {ok,<0.45.0>} 10> io:fwrite(F, "~p.~n", [{date(),time()}]). ok 11> bin_io:close(F). {ok,<<123,123,50,48,48,49,44,49,49,44,52,125,44,123,50,48,44,49,57,44,53,55,125,125,46,10>>} In this version you can only read *or* write to a binary IoStream depending on how it was opened. Would it be interesting to be able to do the file operations like positioning, reading and writing, etc? As an extra bonus I include a modified epp which can read from an already opened IoStream, like a bin_io. To use is you do: 13> {ok,Bin} = file:read_file("bin_io.erl"). {ok,<<37,37,32,70,105,108,101,32,32,32,32,58,32,98,105,110,95,105,111,46,101,114,108,10,37,37,32,...>>} 14> {ok,B} = bin_io:open_read(Bin). {ok,<0.51.0>} 15> {ok,Epp} = epp:open_io(B, []). {ok,<0.53.0>} 16> epp:parse_erl_form(Epp). {ok,{attribute,1,file,{"iostream",1}}} 17> epp:close(Epp). ok 18> bin_io:close(B). N.B. Epp does not close the IoStream as it did not open it. Please comment, Robert -------------- next part -------------- %% File : bin_io.erl %% Author : Robert Virding %% Purpose : Open a binary for standard i/o requests. -module(bin_io). -export([open_read/1,open_create/0,open_append/1,close/1]). -record(state, {mode,bin,buf}). -define(READ_SIZE, 256). %Bytes per chunk read %% The main interface. open_read(Bin) when binary(Bin) -> {ok,spawn_link(fun () -> server_loop(#state{mode=read,bin=Bin,buf=Bin}) end)}. open_create() -> {ok,spawn_link(fun () -> server_loop(#state{mode=write,bin= <<>>,buf=[]}) end)}. open_append(Bin) when binary(Bin) -> {ok,spawn_link(fun () -> server_loop(#state{mode=write,bin=Bin,buf=[]}) end)}. close(Io) -> Io ! {bin_request,self(),Io,close}, receive {bin_reply,Io,Rep} -> Rep end. %% server_loop(State) -> void(). %% Main server loop. We never return. server_loop(St0) -> receive {bin_request,From,ReplyAs,Req} when pid(From) -> %% Handle bin_io specific requests. case bin_request(Req, St0) of {ok,Rep,St1} -> bin_reply(From, ReplyAs, Rep), server_loop(St1); {error,Rep,St1} -> bin_reply(From, ReplyAs, Rep), server_loop(St1); {stop,Reason,Rep,St1} -> bin_reply(From, ReplyAs, Rep), exit(Reason) end; {io_request,From,ReplyAs,Req} when pid(From) -> %% Handle general io requests. case io_request(Req, St0) of {ok,Rep,St1} -> io_reply(From, ReplyAs, Rep), server_loop(St1); {error,Rep,St1} -> io_reply(From, ReplyAs, Rep), server_loop(St1); {stop,Reason,Rep,St1} -> io_reply(From, ReplyAs, Rep), exit(Reason) end; Unknown -> %% Ignore other unknown messages. server_loop(St0) end. bin_reply(From, ReplyAs, Reply) -> From ! {bin_reply, ReplyAs, Reply}. io_reply(From, ReplyAs, Reply) -> From ! {io_reply, ReplyAs, Reply}. %% bin_request(Request, State) -> %% {ok,Reply,State} | {error,Reply,State} | {stop,Reason,Reply,State}. %% %% Handle bin_io specific requests. bin_request(close, #state{mode=Mode,bin=Bin}=State) -> Rep = case Mode of read -> ok; write -> {ok,list_to_binary(Bin)} end, {stop,normal,Rep,State#state{buf=[]}}; bin_request(Unknown, State) -> Reason = {request,Unknown}, {error,{error,Reason},State}. %% io_request(Request, State) -> %% {ok,Reply,State} | {error,Reply,State} | {stop,Reason,Reply,State}. %% %% Handle general io requests. io_request({put_chars,Chars}, #state{mode=write,bin=Bin}=St) -> case catch list_to_binary(Chars) of {'EXIT',Reason} -> {stop,Reason,{error,Reason},St}; MoreBin -> {ok,ok,St#state{bin=[Bin|MoreBin]}} end; io_request({put_chars,Mod,Func,Args}, #state{mode=write}=St) -> case catch apply(Mod, Func, Args) of Chars when list(Chars) -> io_request({put_chars,Chars}, St); Bin when binary(Bin) -> io_request({put_chars,[Bin]}, St); Other -> {error,{error,Func},St} end; io_request({get_until,Prompt,Mod,Func,ExtraArgs}, #state{mode=read}=St) -> get_until(Mod, Func, ExtraArgs, St); io_request({requests,Reqs}, St) when list(Reqs) -> io_request_loop(Reqs, {ok,ok,St}); io_request(Unknown, State) -> Reason = {error,Unknown}, {error,{error,Reason},State}. %% io_request_loop([Request], Result) -> Result. %% Process list of requests as long as results are ok. io_request_loop([], Res) -> Res; io_request_loop([Req|Reqs], {ok,Rep,St}) -> io_request_loop(Reqs, io_request(Req, St)); io_request_loop([Req|Reqs], Res) -> Res. %% get_until(Module, Func, [ExtraArg], State) -> %% {ok,Reply,State} | {error,Reply,State}. %% Apply the get_until loop scanning the binary until the scan %% function has enough. Buffer any remaining bytes until the next %% call. get_until(Mod, Func, ExtraArgs, #state{buf=[Buf|Bin]}=St) -> get_until_loop(Mod, Func, ExtraArgs, St#state{buf=Bin}, catch apply(Mod, Func, [[],Buf|ExtraArgs])); get_until(Mod, Func, ExtraArgs, #state{buf=Bin}=St) -> get_until_loop(Mod, Func, ExtraArgs, St#state{buf=Bin}, {more,[]}). get_until_loop(M, F, As, #state{buf=Bin}=St, {more,Cont}) -> case size(Bin) of 0 -> get_until_loop(M, F, As, St, catch apply(M, F, [Cont,eof|As])); S when S < ?READ_SIZE -> get_until_loop(M, F, As, St#state{buf= <<>>}, catch apply(M, F, [Cont,binary_to_list(Bin)|As])); S -> {B1,B2} = split_binary(Bin, ?READ_SIZE), get_until_loop(M, F, As, St#state{buf=B2}, catch apply(M, F, [Cont,binary_to_list(B1)|As])) end; get_until_loop(M, F, As, St0, {done,Res,Buf}) -> St1 = if Buf == [] -> St0; true -> St0#state{buf=[Buf|St0#state.buf]} end, {ok,Res,St1}; get_until_loop(M, F, As, St, Other) -> {error,{error,F},St}. -------------- next part -------------- %% ``The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved via the world wide web at http://www.erlang.org/. %% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. %% %% The Initial Developer of the Original Code is Ericsson Utvecklings AB. %% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings %% AB. All Rights Reserved.'' %% %% $Id$ %% -module(epp). %% An Erlang code preprocessor. -export([open/2,open/3,close/1,format_error/1]). -export([open_io/2,open_io/3]). -export([scan_erl_form/1,parse_erl_form/1,macro_defs/1]). -export([parse_file/3]). %% Epp state record. -record(epp, {file, %Current file line=1, %Current line number name="", %Current file name istk=[], %Ifdef stack sstk=[], %State stack macs=dict:new(), %Macros uses=dict:new() %Macro use structure }). %%% Note on representation: as tokens, both {var, Line, Name} and %%% {atom, Line, Name} can occur as macro identifiers. However, keeping %%% this distinction here is done for historical reasons only: previously, %%% ?FOO and ?'FOO' were not the same, but now they are. Removing the %%% distinction in the internal representation would simplify the code %%% a little. %% open(FileName, IncludePath) %% open(FileName, IncludePath, PreDefMacros) %% close(Epp) %% scan_erl_form(Epp) %% parse_erl_form(Epp) %% macro_defs(Epp) open(File, Path) -> open(File, Path, []). open(File, Path, Pdm) -> Self = self(), %The caller's pid Epp = spawn_link(fun () -> file_server(Self, File, Path, Pdm) end), wait_epp_reply(Epp). close(Epp) -> epp_request(Epp, close), wait_epp_reply(Epp). scan_erl_form(Epp) -> epp_request(Epp, scan_erl_form), wait_epp_reply(Epp). parse_erl_form(Epp) -> epp_request(Epp, scan_erl_form), case wait_epp_reply(Epp) of {ok,Toks} -> erl_parse:parse_form(Toks); Other -> Other end. macro_defs(Epp) -> epp_request(Epp, macro_defs), wait_epp_reply(Epp). %% format_error(ErrorDescriptor) -> String %% Return a string describing the error. format_error({bad,W}) -> io_lib:format("badly formed '~s'", [W]); format_error({call,What}) -> io_lib:format("illegal macro call '~s'",[What]); format_error({undefined,M}) -> io_lib:format("undefined macro '~w'", [M]); format_error({depth,What}) -> io_lib:format("~s too deep",[What]); format_error({mismatch,M}) -> io_lib:format("argument mismatch for macro '~w'", [M]); format_error({arg_error,M}) -> io_lib:format("badly formed argument for macro '~w'", [M]); format_error({redefine,M}) -> io_lib:format("redefining macro '~w'", [M]); format_error({circular,M}) -> io_lib:format("circular macro '~w'", [M]); format_error({include,W,F}) -> io_lib:format("can't find include ~s \"~s\"", [W,F]); format_error({illegal,How,What}) -> io_lib:format("~s '-~s'", [How,What]); format_error({'NYI',What}) -> io_lib:format("not yet implemented '~s'", [What]). %% parse_file(FileName, IncludePath, [PreDefMacro]) -> %% {ok,[Form]} | {error,OpenError} parse_file(Ifile, Path, Predefs) -> case open(Ifile, Path, Predefs) of {ok,Epp} -> Forms = parse_file(Epp), close(Epp), {ok,Forms}; {error,E} -> {error,E} end. %% parse_file(Epp) -> %% [Form] parse_file(Epp) -> case parse_erl_form(Epp) of {ok,Form} -> [Form|parse_file(Epp)]; {error,E} -> [{error,E}|parse_file(Epp)]; {eof,Line} -> [{eof,Line}] end. %% open_io(IoStream, IncludePath) %% open_io(IoStream, IncludePath, PredefMacros) open_io(Io, Path) -> open_io(Io, Path, []). open_io(Io, Path, Pdm) -> Self = self(), %The caller's pid Epp = spawn(fun () -> io_server(Self, Io, "iostream", Path, Pdm) end), wait_epp_reply(Epp). %% file_server(StarterPid, FileName, Path, PreDefMacros) %% io_server(StarterPid, IoStream, FileName, Path, PreDefMacros) file_server(Pid, Name, Path, Pdm) -> process_flag(trap_exit, true), case file:open(Name, read) of {ok,File} -> io_server(Pid, File, Name, Path, Pdm); {error,E} -> epp_reply(Pid, {error,E}) end. io_server(Pid, Io, Name, Path, Pdm) -> put(sys_path, Path), put(user_path, Path), Ms0 = predef_macros(Name), case user_predef(Pdm, Ms0) of {ok,Ms1} -> epp_reply(Pid, {ok,self()}), St = #epp{file=Io,name=Name,macs=Ms1}, From = wait_request(St), enter_file_reply(From, Name, 1), wait_req_scan(St); {error,E} -> epp_reply(Pid, {error,E}) end. %% predef_macros(FileName) -> Macrodict %% Initialise the macro dictionary with the default predefined macros, %% FILE, LINE, MODULE as undefined, MACHINE and MACHINE value. predef_macros(File) -> Ms0 = dict:new(), Ms1 = dict:store({atom,'FILE'}, {none,[{string,1,File}]}, Ms0), Ms2 = dict:store({atom,'LINE'}, {none,[{integer,1,1}]}, Ms1), Ms3 = dict:store({atom,'MODULE'}, undefined, Ms2), Ms31 = dict:store({atom,'MODULE_STRING'}, undefined, Ms3), Machine = list_to_atom(erlang:system_info(machine)), Ms4 = dict:store({atom,'MACHINE'}, {none,[{atom,1,Machine}]}, Ms31), dict:store({atom,Machine}, {none,[{atom,1,true}]}, Ms4). %% user_predef(PreDefMacros, Macros) -> %% {ok,MacroDict} | {error,E} %% Add the predefined macros to the macros dictionary. A macro without a %% value gets the value 'true'. user_predef([{M,Val}|Pdm], Ms) when atom(M) -> case dict:find({atom,M}, Ms) of {ok,Def} -> {error,{redefine,M}}; error -> Exp = erl_parse:tokens(erl_parse:abstract(Val)), user_predef(Pdm, dict:store({atom,M}, {none,Exp}, Ms)) end; user_predef([M|Pdm], Ms) when atom(M) -> case dict:find({atom,M}, Ms) of {ok,Def} -> {error,{redefine,M}}; error -> user_predef(Pdm, dict:store({atom,M}, {none,[{atom,1,true}]}, Ms)) end; user_predef([Md|Pdm], Ms) -> {error,{bad,Md}}; user_predef([], Ms) -> {ok,Ms}. %% wait_request(EppState) -> RequestFrom %% wait_req_scan(EppState) %% wait_req_skip(EppState, SkipIstack) %% Handle requests, processing trivial requests directly. Either return %% requestor or scan/skip tokens. wait_request(St) -> receive {epp_request,From,scan_erl_form} -> From; {epp_request,From,macro_defs} -> epp_reply(From, dict:dict_to_list(St#epp.macs)), wait_request(St); {epp_request,From,close} -> epp_reply(From, ok), exit(normal); {'EXIT',_,R} -> exit(R); Other -> io:fwrite("Epp: unknown '~w'\n", [Other]), wait_request(St) end. wait_req_scan(St) -> From = wait_request(St), scan_toks(From, St). wait_req_skip(St, Sis) -> From = wait_request(St), skip_toks(From, St, Sis). %% enter_file(Path, FileName, IncludeLine, From, EppState) %% leave_file(From, EppState) %% Handle antering and leaving included files. Notify caller when the %% current file is changed. Note it is an error to exit a file if we are %% in a conditional. These functions never return. enter_file(Path, NewName, Li, From, St) when length(St#epp.sstk) >= 8 -> epp_reply(From, {error,{Li,epp,{depth,"include"}}}), wait_req_scan(St); enter_file(Path, NewName, Li, From, St) -> case file:path_open(Path, NewName, read) of {ok,NewF,Pname} -> wait_req_scan(enter_file(NewF, Pname, From, St)); {error,E} -> epp_reply(From, {error,{Li,epp,{include,file,NewName}}}), wait_req_scan(St) end. %% enter_file(File, FullName, From, EppState) -> EppState. %% Set epp to use this file and "enter" it. enter_file(NewF, Pname, From, St) -> enter_file_reply(From, Pname, 1), Ms = dict:store({atom,'FILE'}, {none,[{string,1,Pname}]}, St#epp.macs), #epp{file=NewF,name=Pname,sstk=[St|St#epp.sstk],macs=Ms}. enter_file_reply(From, Name, Line) -> Rep = {ok, [{'-',Line},{atom,Line,file},{'(',Line}, {string,Line,file_name(Name)},{',',Line}, {integer,Line,Line},{')',Line},{dot,Line}]}, epp_reply(From, Rep). %% Flatten filename to a string. Must be a valid filename. file_name([C | T]) when integer(C), C > 0, C =< 255 -> [C | file_name(T)]; file_name([H|T]) -> file_name(H) ++ file_name(T); file_name([]) -> []; file_name(N) when atom(N) -> atom_to_list(N). leave_file(From, St) -> case St#epp.istk of [I|Cis] -> epp_reply(From, {error,{St#epp.line,epp, {illegal,"unterminated",I}}}), leave_file(wait_request(St),St#epp{istk=Cis}); [] -> case St#epp.sstk of [OldSt|Sts] -> file:close(St#epp.file), enter_file_reply(From, OldSt#epp.name, OldSt#epp.line), Ms = dict:store({atom,'FILE'}, {none, [{string,OldSt#epp.line,OldSt#epp.name}]}, St#epp.macs), wait_req_scan(OldSt#epp{sstk=Sts,macs=Ms}); [] -> epp_reply(From, {eof,St#epp.line}), wait_req_scan(St) end end. %% scan_toks(From, EppState) %% scan_toks(Tokens, From, EppState) scan_toks(From, St) -> case io:scan_erl_form(St#epp.file, '', St#epp.line) of {ok,Toks,Cl} -> scan_toks(Toks, From, St#epp{line=Cl}); {error,E,Cl} -> epp_reply(From, {error,E}), wait_req_scan(St#epp{line=Cl}); {eof,Cl} -> leave_file(From, St#epp{line=Cl}); {error,E} -> epp_reply(From, {error,E}), true %This serious, just exit! end. scan_toks([{'-',Lh},{atom,Ld,define}|Toks], From, St) -> scan_define(Toks, Ld, From, St); scan_toks([{'-',Lh},{atom,Ld,undef}|Toks], From, St) -> scan_undef(Toks, Ld, From, St); scan_toks([{'-',Lh},{atom,Li,include}|Toks], From, St) -> scan_include(Toks, Li, From, St); scan_toks([{'-',Lh},{atom,Li,include_lib}|Toks], From, St) -> scan_include_lib(Toks, Li, From, St); scan_toks([{'-',Lh},{atom,Li,ifdef}|Toks], From, St) -> scan_ifdef(Toks, Li, From, St); scan_toks([{'-',Lh},{atom,Li,ifndef}|Toks], From, St) -> scan_ifndef(Toks, Li, From, St); scan_toks([{'-',Lh},{atom,Le,else}|Toks], From, St) -> scan_else(Toks, Le, From, St); scan_toks([{'-',Lh},{atom,Le,'if'}|Toks], From, St) -> scan_if(Toks, Le, From, St); scan_toks([{'-',Lh},{atom,Le,elif}|Toks], From, St) -> scan_elif(Toks, Le, From, St); scan_toks([{'-',Lh},{atom,Le,endif}|Toks], From, St) -> scan_endif(Toks, Le, From, St); scan_toks(Toks0, From, St) -> case catch expand_macros(Toks0, {St#epp.macs, St#epp.uses}) of Toks1 when list(Toks1) -> epp_reply(From, {ok,Toks1}), wait_req_scan(St#epp{macs=scan_module(Toks1, St#epp.macs)}); {error,ErrL,What} -> epp_reply(From, {error,{ErrL,epp,What}}), wait_req_scan(St) end. scan_module([{'-',Lh},{atom,Lm,module},{'(',Ll},{atom,Ln,Mod},{')',Lr}|_], Ms) -> Ms1 = dict:store({atom,'MODULE'}, {none,[{atom,Ln,Mod}]}, Ms), dict:store({atom,'MODULE_STRING'}, {none,[{string,Ln,atom_to_list(Mod)}]}, Ms1); scan_module(Ts, Ms) -> Ms. %% scan_define(Tokens, DefineLine, From, EppState) scan_define([{'(',Lp},{atom,Lm,M},{',',Lc}|Toks], Ld, From, St) -> case dict:find({atom,M}, St#epp.macs) of {ok,Def} -> epp_reply(From, {error,{Lm,epp,{redefine,M}}}), wait_req_scan(St); error -> scan_define_cont(From, St, {atom, M}, {none,macro_expansion(Toks)}) end; scan_define([{'(',Lp},{atom,Lm,M},{'(',Lc}|Toks], Ld, From, St) -> case dict:find({atom,M}, St#epp.macs) of {ok,Def} -> epp_reply(From, {error,{Lm,epp,{redefine,M}}}), wait_req_scan(St); error -> case catch macro_pars(Toks, []) of {ok, {As, Me}} -> scan_define_cont(From, St, {atom, M}, {As, Me}); _ -> epp_reply(From, {error,{Ld,epp,{bad,define}}}), wait_req_scan(St) end end; scan_define([{'(',Lp},{var,Lm,M},{',',Lc}|Toks], Ld, From, St) -> case dict:find({atom,M}, St#epp.macs) of {ok,Def} -> epp_reply(From, {error,{Lm,epp,{redefine,M}}}), wait_req_scan(St); error -> scan_define_cont(From, St, {atom, M}, {none,macro_expansion(Toks)}) end; scan_define([{'(',Lp},{var,Lm,M},{'(',Lc}|Toks], Ld, From, St) -> case dict:find({atom,M}, St#epp.macs) of {ok,Def} -> epp_reply(From, {error,{Lm,epp,{redefine,M}}}), wait_req_scan(St); error -> case catch macro_pars(Toks, []) of {ok, {As, Me}} -> scan_define_cont(From, St, {atom, M}, {As, Me}); _ -> epp_reply(From, {error,{Ld,epp,{bad,define}}}), wait_req_scan(St) end end; scan_define(Toks, Ld, From, St) -> epp_reply(From, {error,{Ld,epp,{bad,define}}}), wait_req_scan(St). %%% Detection of circular macro expansions (which would either keep %%% the compiler looping forever, or run out of memory): %%% When a macro is defined, we store the names of other macros it %%% uses in St#epp.uses. If any macro is undef'ed, that information %%% becomes invalid, so we redo it for all remaining macros. %%% The circularity detection itself is done when a macro is expanded: %%% the information from St#epp.uses is traversed, and if a circularity %%% is detected, an error message is thrown. scan_define_cont(F, St, M, Def) -> Ms = dict:store(M, Def, St#epp.macs), U = dict:store(M, macro_uses(Def), St#epp.uses), scan_toks(F, St#epp{uses=U, macs=Ms}). macro_uses({Args, Tokens}) -> Uses0 = macro_ref(Tokens), lists:usort(Uses0). macro_ref([]) -> []; macro_ref([{'?', _}, {atom, _, A} | Rest]) -> [{atom, A} | macro_ref(Rest)]; macro_ref([{'?', _}, {var, _, A} | Rest]) -> [{atom, A} | macro_ref(Rest)]; macro_ref([Token | Rest]) -> macro_ref(Rest). all_macro_uses(D0) -> L = dict:dict_to_list(D0), D = dict:new(), add_macro_uses(L, D). add_macro_uses([], D) -> D; add_macro_uses([{Key, Def} | Rest], D0) -> add_macro_uses(Rest, dict:store(Key, macro_uses(Def), D0)). %% scan_undef(Tokens, UndefLine, From, EppState) scan_undef([{'(',Llp},{atom,Lm,M},{')',Lrp},{dot,Ld}], Lu, From, St) -> scan_toks(From, St#epp{macs=dict:erase({atom,M}, St#epp.macs), uses=all_macro_uses(St#epp.macs)}); scan_undef([{'(',Llp},{var,Lm,M},{')',Lrp},{dot,Ld}], Lu, From,St) -> scan_toks(From, St#epp{macs=dict:erase({atom,M}, St#epp.macs), uses=all_macro_uses(St#epp.macs)}); scan_undef(Toks, Lu, From,St) -> epp_reply(From, {error,{Lu,epp,{bad,undef}}}), wait_req_scan(St). %% scan_include(Tokens, IncludeLine, From, St) scan_include([{'(',Llp},{string,Lf,NewName},{')',Lrp},{dot,Ld}], Li, From, St) -> enter_file(get(user_path), NewName, Li, From, St); scan_include(Toks, Li, From, St) -> epp_reply(From, {error,{Li,epp,{bad,include}}}), wait_req_scan(St). %% scan_include_lib(Tokens, IncludeLine, From, EppState) %% For include_lib we first test if we can find the file through the %% normal search path, if not we assume that the first directory name %% is a library name, find its true directory and try with that. find_lib_dir(NewName) -> Sc = string:chr(NewName, $/), Lib = string:substr(NewName, 1, Sc-1), Rest = string:substr(NewName, Sc+1), {code:lib_dir(Lib), Rest}. scan_include_lib([{'(',Llp},{string,Lf,NewName},{')',Lrp},{dot,Ld}], Li, From, St) -> case file:path_open(get(user_path), NewName, read) of {ok,NewF,Pname} -> wait_req_scan(enter_file(NewF, Pname, From, St)); {error,E1} -> case catch find_lib_dir(NewName) of {LibDir, Rest} when list(LibDir) -> LibName = LibDir ++ "/" ++ Rest, case file:open(LibName, read) of {ok,NewF} -> wait_req_scan(enter_file(NewF, LibName, From, St)); {error,E2} -> epp_reply(From, {error,{Li,epp,{include,lib,NewName}}}), wait_req_scan(St) end; Error -> epp_reply(From, {error,{Li,epp,{include,lib,NewName}}}), wait_req_scan(St) end end; scan_include_lib(Toks, Li, From, St) -> epp_reply(From, {error,{Li,epp,{bad,include_lib}}}), wait_req_scan(St). %% scan_ifdef(Tokens, IfdefLine, From, EppState) %% scan_ifndef(Tokens, IfdefLine, From, EppSate) %% Handle the conditional parsing of a file. %% Report a badly formed if[n]def test and then treat as undefined macro. scan_ifdef([{'(',Llp},{atom,Lm,M},{')',Lrp},{dot,Ld}], Li, From, St) -> case dict:find({atom,M}, St#epp.macs) of {ok,Def} -> scan_toks(From, St#epp{istk=[ifdef|St#epp.istk]}); error -> skip_toks(From, St, [ifdef]) end; scan_ifdef([{'(',Llp},{var,Lm,M},{')',Lrp},{dot,Ld}], Li, From, St) -> case dict:find({atom,M}, St#epp.macs) of {ok,Def} -> scan_toks(From, St#epp{istk=[ifdef|St#epp.istk]}); error -> skip_toks(From, St, [ifdef]) end; scan_ifdef(Toks, Li, From, St) -> epp_reply(From, {error,{Li,epp,{bad,ifdef}}}), wait_req_skip(St, [ifdef]). scan_ifndef([{'(',Llp},{atom,Lm,M},{')',Lrp},{dot,Ld}], Li, From, St) -> case dict:find({atom,M}, St#epp.macs) of {ok,Def} -> skip_toks(From, St, [ifndef]); error -> scan_toks(From, St#epp{istk=[ifndef|St#epp.istk]}) end; scan_ifndef([{'(',Llp},{var,Lm,M},{')',Lrp},{dot,Ld}], Li, From, St) -> case dict:find({atom,M}, St#epp.macs) of {ok,Def} -> skip_toks(From, St, [ifndef]); error -> scan_toks(From, St#epp{istk=[ifndef|St#epp.istk]}) end; scan_ifndef(Toks, Li, From, St) -> epp_reply(From, {error,{Li,epp,{bad,ifndef}}}), wait_req_scan(St). %% scan_else(Tokens, ElseLine, From, EppState) %% If we are in an if body then convert to else and skip, if we are in an %% else or not in anything report an error. scan_else([{dot,Ld}], Le, From, St) -> case St#epp.istk of [else|Cis] -> epp_reply(From, {error,{Le,epp,{illegal,"repeated",else}}}), wait_req_skip(St#epp{istk=Cis}, [else]); [I|Cis] -> skip_toks(From, St#epp{istk=Cis}, [else]); [] -> epp_reply(From, {error,{Le,epp,{illegal,"unbalanced",else}}}), wait_req_scan(St) end; scan_else(Toks, Le, From, St) -> epp_reply(From, {error,{Le,epp,{bad,else}}}), wait_req_scan(St). %% scan_if(Tokens, EndifLine, From, EppState) %% Handle the conditional parsing of a file. %% Report a badly formed if test and then treat as false macro. scan_if(Toks, Le, From, St) -> epp_reply(From, {error,{Le,epp,{'NYI','if'}}}), wait_req_skip(St, ['if']). %% scan_elif(Tokens, EndifLine, From, EppState) %% Handle the conditional parsing of a file. %% Report a badly formed if test and then treat as false macro. scan_elif(Toks, Le, From, St) -> epp_reply(From, {error,{Le,epp,{'NYI','elif'}}}), wait_req_skip(St, ['elif']). %% scan_endif(Tokens, EndifLine, From, EppState) %% If we are in an if body then exit it, else report an error. scan_endif([{dot,Ld}], Le, From, St) -> case St#epp.istk of [I|Cis] -> scan_toks(From, St#epp{istk=Cis}); [] -> epp_reply(From, {error,{Le,epp,{illegal,"unbalanced",endif}}}), wait_req_scan(St) end; scan_endif(Toks, Le, From, St) -> epp_reply(From, {error,{Le,epp,{bad,endif}}}), wait_req_scan(St). %% skip_toks(From, EppState, SkipIstack) %% Skip over forms until current conditional has been exited. Handle %% nested conditionals and repeated 'else's. skip_toks(From, St, [I|Sis]) -> case io:scan_erl_form(St#epp.file, '', St#epp.line) of {ok,[{'-',Lh},{atom,Li,ifdef}|Toks],Cl} -> skip_toks(From, St#epp{line=Cl}, [ifdef,I|Sis]); {ok,[{'-',Lh},{atom,Li,ifndef}|Toks],Cl} -> skip_toks(From, St#epp{line=Cl}, [ifndef,I|Sis]); {ok,[{'-',Lh},{atom,Li,'if'}|Toks],Cl} -> skip_toks(From, St#epp{line=Cl}, ['if',I|Sis]); {ok,[{'-',Lh},{atom,Le,else}|Toks],Cl}-> skip_else(Le, From, St#epp{line=Cl}, [I|Sis]); {ok,[{'-',Lh},{atom,Le,endif}|Toks],Cl} -> skip_toks(From, St#epp{line=Cl}, Sis); {ok,Toks,Cl} -> skip_toks(From, St#epp{line=Cl}, [I|Sis]); {error,E,Cl} -> skip_toks(From, St#epp{line=Cl}, [I|Sis]); {eof,Cl} -> leave_file(From, St#epp{line=Cl,istk=[I|Sis]}); {error,E} -> epp_reply(From, {error,E}), true %This serious, just exit! end; skip_toks(From, St, []) -> scan_toks(From, St). skip_else(Le, From, St, [else|Sis]) -> epp_reply(From, {error,{Le,epp,{illegal,"repeated",else}}}), wait_req_skip(St, [else|Sis]); skip_else(Le, From, St, [I]) -> scan_toks (From, St#epp{istk=[else|St#epp.istk]}); skip_else(Le, From, St, Sis) -> skip_toks(From, St, Sis). %% macro_pars(Tokens, ArgStack) %% macro_expansion(Tokens) %% Extract the macro parameters and the expansion from a macro definition. macro_pars([{')',Lp}, {',',Ld}|Ex], Args) -> {ok, {lists:reverse(Args), macro_expansion(Ex)}}; macro_pars([{var,_,Name}, {')',Lp}, {',',Ld}|Ex], Args) -> false = lists:member(Name, Args), %Prolog is nice {ok, {lists:reverse([Name|Args]), macro_expansion(Ex)}}; macro_pars([{var,L,Name}, {',',_}|Ts], Args) -> false = lists:member(Name, Args), macro_pars(Ts, [Name|Args]). macro_expansion([{')',Lp},{dot,Ld}]) -> []; macro_expansion([{dot,Ld}]) -> []; %Be nice, allow no right paren! macro_expansion([T|Ts]) -> [T|macro_expansion(Ts)]. %% expand_macros(Tokens, Macros) %% expand_macro(Tokens, MacroLine, RestTokens) %% Expand the macros in a list of tokens, making sure that an expansion %% gets the same line number as the macro call. expand_macros(Type, Lm, M, Toks, Ms0) -> %% (Type will always be 'atom') {Ms, U} = Ms0, check_uses([{Type,M}], [], U, Lm), case dict:find({Type,M}, Ms) of {ok,{none,Exp}} -> expand_macros(expand_macro(Exp, Lm, Toks, dict:new()), Ms0); {ok,{As,Exp}} -> {Bs,Toks1} = bind_args(Toks, Lm, M, As, dict:new()), %%io:format("Bound arguments to macro ~w (~w)~n", [M,Bs]), expand_macros(expand_macro(Exp, Lm, Toks1, Bs), Ms0); {ok,undefined} -> throw({error,Lm,{undefined,M}}); error -> throw({error,Lm,{undefined,M}}) end. check_uses([], Anc, U, Lm) -> ok; check_uses([M|Rest], Anc, U, Lm) -> case lists:member(M, Anc) of true -> {_, Name} = M, throw({error,Lm,{circular,Name}}); false -> L = get_macro_uses(M, U), check_uses(L, [M|Anc], U, Lm), check_uses(Rest, Anc, U, Lm) end. get_macro_uses(M, U) -> case dict:find(M, U) of error -> []; {ok, L} -> L end. %% Macro expansion expand_macros([{'?',Lq},{atom,Lm,M}|Toks], Ms) -> expand_macros(atom, Lm, M, Toks, Ms); %% Special macros expand_macros([{'?',Lq},{var,Lm,'LINE'}|Toks], Ms) -> [{integer,Lm,Lm}|expand_macros(Toks, Ms)]; expand_macros([{'?',Lq},{var,Lm,M}|Toks], Ms) -> expand_macros(atom, Lm, M, Toks, Ms); %% Illegal macros expand_macros([{'?',Lq},{Type,Lt}|Toks], Ms) -> throw({error,Lt,{call,[$?|atom_to_list(Type)]}}); expand_macros([{'?',Lq},{Type,Lt,What}|Toks], Ms) -> throw({error,Lt,{call,[$?|io_lib:write(What)]}}); expand_macros([T|Ts], Ms) -> [T|expand_macros(Ts, Ms)]; expand_macros([], Ms) -> []. %% bind_args(Tokens, MacroLine, MacroName, ArgumentVars, Bindings) %% Collect the arguments to a macro call and check for correct number. bind_args([{'(',Llp},{')',Lrp}|Toks], Lm, M, [], Bs) -> {Bs,Toks}; bind_args([{'(',Llp}|Toks0], Lm, M, [A|As], Bs) -> {Arg,Toks1} = macro_arg(Toks0, [], []), macro_args(Toks1, Lm, M, As, dict:store(A, Arg, Bs)); bind_args(Toks, Lm, M, As, Bs) -> throw({error,Lm,{mismatch,M}}). macro_args([{')',Lrp}|Toks], Lm, M, [], Bs) -> {Bs,Toks}; macro_args([{',',Lc}|Toks0], Lm, M, [A|As], Bs) -> {Arg,Toks1} = macro_arg(Toks0, [], []), macro_args(Toks1, Lm, M, As, dict:store(A, Arg, Bs)); macro_args([], Lm, M, As, Bs) -> throw({error,Lm,{arg_error,M}}); macro_args(Toks, Lm, M, As, Bs) -> throw({error,Lm,{mismatch,M}}). %% macro_arg([Tok], [ClosePar], [ArgTok]) -> {[ArgTok],[RestTok]}. %% Collect argument tokens until we hit a ',' or a ')'. We know a %% enough about syntax to recognise "open parentheses" and keep %% scanning until matching "close parenthesis". macro_arg([{',',Lc}|Toks], [], Arg) -> {lists:reverse(Arg),[{',',Lc}|Toks]}; macro_arg([{')',Lrp}|Toks], [], Arg) -> {lists:reverse(Arg),[{')',Lrp}|Toks]}; macro_arg([{'(',Llp}|Toks], E, Arg) -> macro_arg(Toks, [')'|E], [{'(',Llp}|Arg]); macro_arg([{'<<',Lls}|Toks], E, Arg) -> macro_arg(Toks, ['>>'|E], [{'<<',Lls}|Arg]); macro_arg([{'[',Lls}|Toks], E, Arg) -> macro_arg(Toks, [']'|E], [{'[',Lls}|Arg]); macro_arg([{'{',Llc}|Toks], E, Arg) -> macro_arg(Toks, ['}'|E], [{'{',Llc}|Arg]); macro_arg([{'begin',Lb}|Toks], E, Arg) -> macro_arg(Toks, ['end'|E], [{'begin',Lb}|Arg]); macro_arg([{'if',Li}|Toks], E, Arg) -> macro_arg(Toks, ['end'|E], [{'if',Li}|Arg]); macro_arg([{'case',Lc}|Toks], E, Arg) -> macro_arg(Toks, ['end'|E], [{'case',Lc}|Arg]); macro_arg([{'receive',Lr}|Toks], E, Arg) -> macro_arg(Toks, ['end'|E], [{'receive',Lr}|Arg]); macro_arg([{Rb,Lrb}|Toks], [Rb|E], Arg) -> %Found matching close macro_arg(Toks, E, [{Rb,Lrb}|Arg]); macro_arg([T|Toks], E, Arg) -> macro_arg(Toks, E, [T|Arg]); macro_arg([], E, Arg) -> {lists:reverse(Arg),[]}. %% expand_macro(MacroDef, MacroLine, RestTokens, Bindings) %% expand_arg(Argtokens, MacroTokens, MacroLine, RestTokens, Bindings) %% Insert the macro expansion replacing macro parameters with their %% argument values, inserting the line number of first the macro call %% and then the macro arguments, i.e. simulate textual expansion. expand_macro([{var,Lv,V}|Ts], L, Rest, Bs) -> case dict:find(V, Bs) of {ok,Val} -> %% lists:append(Val, expand_macro(Ts, L, Rest, Bs)); expand_arg(Val, Ts, L, Rest, Bs); error -> [{var,L,V}|expand_macro(Ts, L, Rest, Bs)] end; expand_macro([{'?', _}, {'?', _}, {var,Lv,V}|Ts], L, Rest, Bs) -> case dict:find(V, Bs) of {ok,Val} -> %% lists:append(Val, expand_macro(Ts, L, Rest, Bs)); expand_arg(stringify(Val), Ts, L, Rest, Bs); error -> [{var,L,V}|expand_macro(Ts, L, Rest, Bs)] end; expand_macro([T|Ts], L, Rest, Bs) -> [setelement(2, T, L)|expand_macro(Ts, L, Rest, Bs)]; expand_macro([], L, Rest, Bs) -> Rest. expand_arg([A|As], Ts, L, Rest, Bs) -> [A|expand_arg(As, Ts, element(2, A), Rest, Bs)]; expand_arg([], Ts, L, Rest, Bs) -> expand_macro(Ts, L, Rest, Bs). %%% stringify(L) returns a list of one token: a string which when %%% tokenized would yield the token list L. %tst(Str) -> % {ok, T, _} = erl_scan:string(Str), % [{string, _, S}] = stringify(T), % S. token_src({dot, _}) -> "."; token_src({X, _}) when atom(X) -> atom_to_list(X); token_src({var, _, X}) -> atom_to_list(X); token_src({string, _, X}) -> lists:flatten(io_lib:format("~p", [X])); token_src({_, _, X}) -> lists:flatten(io_lib:format("~w", [X])). stringify1([]) -> []; stringify1([T | Tokens]) -> [io_lib:format(" ~s", [token_src(T)]) | stringify1(Tokens)]. stringify(L) -> [$\s | S] = lists:flatten(stringify1(L)), [{string, 1, S}]. %% epp_request(Epp, Request) %% epp_reply(From, Reply) %% wait_epp_reply(Epp) %% Handle communication with the epp. epp_request(Epp, Req) -> Epp ! {epp_request,self(),Req}. epp_reply(From, Rep) -> From ! {epp_reply,self(),Rep}. wait_epp_reply(Epp) -> receive {epp_reply,Epp,Rep} -> Rep end. From eleberg@REDACTED Mon Nov 5 08:17:24 2001 From: eleberg@REDACTED (Bengt Kleberg) Date: Mon, 5 Nov 2001 08:17:24 +0100 (MET) Subject: I/O from binaries Message-ID: <200111050717.IAA29501@etxb.ericsson.se> > Subject: I/o frmo binaries > MIME-Version: 1.0 > Content-ID: <1360.1004902273.0@REDACTED> > Date: Sun, 04 Nov 2001 20:32:08 +0100 > From: Robert Virding > > Many have requested a module which allows doing i/o to/from binaries. > Here is a small module I have fixed which does this. It only > preliminary but seems to work ok. > > The API is: > > bin_io:open_read(Binary) -> {ok,IoStream} > bin_io:open_create() -> {ok,IoStream} > bin_io:open_append(Binary) -> {ok,IoStream} Any reasons to avoid: bin_io:open( Binary, [read] ) etc? > bin_io:close(IoStream) -> ok | {ok,Binary} > > If the binary was opened for write or append then bin_io:close will > return the resultant binary, otherwise just ok. Are there any possibilities of errors? (Not only for close(), but all of them) > In this version you can only read *or* write to a binary IoStream > depending on how it was opened. Would it be interesting to be able to > do the file operations like positioning, reading and writing, etc? Yes. > As an extra bonus I include a modified epp which can read from an > already opened IoStream, like a bin_io. To use is you do: ...deleted > N.B. Epp does not close the IoStream as it did not open it. Good design. bengt From steven.h.rogers@REDACTED Mon Nov 5 17:05:48 2001 From: steven.h.rogers@REDACTED (Steven H. Rogers, Ph.D.) Date: Mon, 05 Nov 2001 10:05:48 -0600 Subject: Web Services Standards Representation Message-ID: <3BE6B8DC.70107@seagate.com> Is there any representation from the Erlang/OTP community on the W3C Web Services Description Language? If not, then someone with a good understanding of the Erlang/OTP architecture might want to consider participating. Dave Winer's "Comments on WSDL" at http://www.soapware.org/stories/storyReader$21 indicate that Microsoft and IBM are busily defining Web Services standards to their own advantage. Regards, Steve From vances@REDACTED Mon Nov 5 20:09:30 2001 From: vances@REDACTED (Vance Shipley) Date: Mon, 5 Nov 2001 14:09:30 -0500 Subject: Triple-DES in crypto? Message-ID: Should I go ahead and hack support for Triple-DES into crypto or has someone else already done it? Could we ever expect to see more in crypto given that the description for the crypto app says: "The purpose of this application is to provide message digest and DES encryption for SMNPv3." -Vance From cpressey@REDACTED Tue Nov 6 00:50:02 2001 From: cpressey@REDACTED (Chris Pressey) Date: Mon, 5 Nov 2001 17:50:02 -0600 Subject: I/O from binaries In-Reply-To: <200111050717.IAA29501@etxb.ericsson.se> References: <200111050717.IAA29501@etxb.ericsson.se> Message-ID: <20011105175002.791df0d7.cpressey@catseye.mb.ca> On Mon, 5 Nov 2001 08:17:24 +0100 (MET) Bengt Kleberg wrote: > > From: Robert Virding > > > > Many have requested a module which allows doing i/o to/from binaries. > > Here is a small module I have fixed which does this. It only > > preliminary but seems to work ok. > > > > The API is: > > > > bin_io:open_read(Binary) -> {ok,IoStream} > > bin_io:open_create() -> {ok,IoStream} > > bin_io:open_append(Binary) -> {ok,IoStream} > > Any reasons to avoid: > > bin_io:open( Binary, [read] ) > > etc? I'll go one step further, and ask: is there any reason both the io module and the bin_io module shouldn't both adhere to an 'io' behaviour? I realize that modules that implement behaviours are intended as callback modules, but I don't see why they couldn't be used just as well to establish an interface for calls of all kinds, not just callbacks. For example, a function in some other module could take an atom as an argument, which would be a module name like io or bin_io (or socket_io, serial_io, etc ad infinitum), and use that module for I/O by calling Module:open(Object, [read]) and so forth. This would allow that function to seamlessly use whatever I/O its caller specifies. I think the real benefit here comes from the new behaviour_info/1 function, so that conformity with an interface can be checked, even at compile time. There are probably other places it could be beneficial, for example in the epop package, where a custom database driver can be specified; it could be required to live up to an epop_db behaviour, or some such. Any thoughts on this would be very welcome :) Chris From fredrik.linder@REDACTED Tue Nov 6 08:23:14 2001 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Tue, 6 Nov 2001 08:23:14 +0100 Subject: I/O from binaries References: <200111050717.IAA29501@etxb.ericsson.se> <20011105175002.791df0d7.cpressey@catseye.mb.ca> Message-ID: <000e01c16693$eb29dee0$cd2511c2@frelin> Just want to add som thoughts to this. Maybe it is a bit "forbidden" to talk about OO here (I don't think it should be), but is not Chris' proposal a bit like inheritance in OO, the good parts of it? One super-class defines an interface which many other sub-classes inherits, so that they all can be accessed in the same way (they all share an interface :-). Does not activation in mnesia implement something like this? Yes, there are both strengths and weaknesess with inheritance. An example of its strength does Chris' give an sample of in his discussion, and an example of its weaknesses is huge class-tree structures (that are hard to maintain). Generally, is Chris' proposal not a good solution? /Fredrik > Bengt Kleberg wrote: > > > > From: Robert Virding > > > > > > Many have requested a module which allows doing i/o to/from binaries. > > > Here is a small module I have fixed which does this. It only > > > preliminary but seems to work ok. > > > > > > The API is: > > > > > > bin_io:open_read(Binary) -> {ok,IoStream} > > > bin_io:open_create() -> {ok,IoStream} > > > bin_io:open_append(Binary) -> {ok,IoStream} > > > > Any reasons to avoid: > > > > bin_io:open( Binary, [read] ) > > > > etc? > > I'll go one step further, and ask: is there any reason both the io module > and the bin_io module shouldn't both adhere to an 'io' behaviour? > > I realize that modules that implement behaviours are intended as callback > modules, but I don't see why they couldn't be used just as well to > establish an interface for calls of all kinds, not just callbacks. > > For example, a function in some other module could take an atom as an > argument, which would be a module name like io or bin_io (or socket_io, > serial_io, etc ad infinitum), and use that module for I/O by calling > Module:open(Object, [read]) and so forth. This would allow that function > to seamlessly use whatever I/O its caller specifies. > > I think the real benefit here comes from the new behaviour_info/1 > function, so that conformity with an interface can be checked, even at > compile time. There are probably other places it could be beneficial, for > example in the epop package, where a custom database driver can be > specified; it could be required to live up to an epop_db behaviour, or > some such. > > Any thoughts on this would be very welcome :) > > Chris > From vladdu@REDACTED Tue Nov 6 09:49:11 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Tue, 06 Nov 2001 09:49:11 +0100 Subject: I/O from binaries Message-ID: >Yes, there are both strengths and weaknesess with inheritance. An example >of >its strength does Chris' give an sample of in his discussion, and an >example >of its weaknesses is huge class-tree structures (that are hard to >maintain). I am thinking in the same paths as Chris, so I think it's a good idea :-) Yes, I think it looks like OO, but at the same time it isn't. It is more like the COM framework, where there are interfaces for objects to implement. The main difference compared to inheritance is that the structure is flat, avoiding the above named weakness. Of course, one could build a deep hierarchy, but the natural way is to use a flat one. Whether this interface definition should use "behaviour" or another name (to avoid misunderstandings) is a question of taste, but I use it in my programs and it should be nice to have a compile-time check enabled. regards, Vlad _________________________________________________________________ H?mta MSN Explorer kostnadsfritt p? http://explorer.msn.se From cpressey@REDACTED Tue Nov 6 09:43:11 2001 From: cpressey@REDACTED (Chris Pressey) Date: Tue, 6 Nov 2001 02:43:11 -0600 Subject: I/O from binaries In-Reply-To: <000e01c16693$eb29dee0$cd2511c2@frelin> References: <200111050717.IAA29501@etxb.ericsson.se> <20011105175002.791df0d7.cpressey@catseye.mb.ca> <000e01c16693$eb29dee0$cd2511c2@frelin> Message-ID: <20011106024311.59c29ca9.cpressey@catseye.mb.ca> On Tue, 6 Nov 2001 08:23:14 +0100 "Fredrik Linder" wrote: > Just want to add som thoughts to this. > > Maybe it is a bit "forbidden" to talk about OO here (I don't think it > should > be), but is not Chris' proposal a bit like inheritance in OO, the good > parts > of it? I would say that inheritance and behaviours are two ways to express a generalization/specialization pattern. A subclass specializes its superclass, and an implementation module specializes a behaviour module. Whether there's a further similarity is questionable. Behaviours are (to me) a bit more like templates for Java-like interfaces, than they are like object classes. Erlang doesn't have any built-in "dispatching" strategy, so any "inheriting" of methods, properties, etc has to be explicitly coded. > Yes, there are both strengths and weaknesess with inheritance. An > example of > its strength does Chris' give an sample of in his discussion, and an > example > of its weaknesses is huge class-tree structures (that are hard to > maintain). Actually, I *don't* think I would propose behaviours which themselves implement behaviours, at this point. In other words, in my mind there is generally a simple, non-hierarchical, two-level relationship, between behaviour and implementation. I would strongly discourage (over)use of hierarchical behaviours of behaviours. If I must impose a hierarchy on it, I would see all behaviours as implementing a single universal meta-behaviour that might be described best as an imaginary Erlang module like so: -module(meta_behaviour). -export([behaviour_info/1]). behaviour_info(callbacks) -> [{behaviour_info, 1}]. Thanks for the thoughts, and the chance to clarify, maybe :) Chris From etxuwig@REDACTED Tue Nov 6 17:33:48 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Tue, 6 Nov 2001 17:33:48 +0100 (MET) Subject: I killed the compiler Message-ID: While compiling with OTP R7B (compiler-3.0.1.2), I received the following internal compiler crash: erlc -I /vobs/AXD30/AXD301/AXD301_AXD30101_1/AXD301_CXA11401/CPS/inc -I /vobs/PROJ/Tools/CCviewer_LXA11934/inc -I /vobs/PROJ/Tools/CCviewer_LXA11934/out -W -pz ../out/dbg +trace -D sys_debug -o /vobs/PROJ/Tools/CCviewer_LXA11934/out/dbg ccv_erl_pp.erl /vobs/PROJ/Tools/CCviewer_LXA11934/src/ccv_erl_pp.erl:none: internal error in v3_core; crash reason: {{case_clause,{'EXIT',{function_clause, [{v3_core, pat_alias, [{c_atom,[],ok}, {c_tuple, [], [{c_var,[],'NewTs'}, {c_var,[],'NewS'}]}]}, {v3_core,expr,2}, {v3_core,exprs,2}, {v3_core,clause,2}, {lists,mapfoldl,3}, {v3_core,expr,2}, {v3_core,exprs,2}, {v3_core,clause,2}| more]}}}, [{compile,'-select_passes/2-fun-2-',2}, {compile,'-internal_comp/4-fun-1-',2}, {compile,fold_comp,3}, {compile,internal_comp,4}, {compile,internal,3}]} I'll admit that the module shouldn't have compiled. It was a bad copy-and-paste on my part: {NewTs, NewS} = ?dbg, case Ts of [H|T] when element(1,H) == comment -> where I inserted the ?dbg macro in the middle of an "assignment" operation. For what it's worth, dbg was defined thus: -define(dbg, ok=io:format("ccv_erl_pp[~w] X=~w~n", [?LINE,X])). /Uffe -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From adam.brett@REDACTED Tue Nov 6 18:24:23 2001 From: adam.brett@REDACTED (adam.brett@REDACTED) Date: Tue, 6 Nov 2001 12:24:23 -0500 (EST) Subject: We are Unable to Reach your Web Page Message-ID: <1584617.1005067463081.JavaMail.promon@pm66> There appears to be a problem in reaching the following Web page from Philadelphia, Pennsylvania: http://www.erlang.org/faq/x65.html Error: Host Not Found This error is most commonly due to an Internet connection problem and does not necessarily indicate that your server is down. As recommended by the robot Guidelines, this email is to explain our research activity and to alert you about the connectivity error we encountered. InternetSeer, the world's largest web site monitoring service, does not store or publish the content of your pages, but rather uses the information to update our ongoing Web Connectivity Study. To learn more about our study results or to request InternetSeer to continue monitoring your Web site in this way, visit: http://scclick.internetseer.com/sitecheck/clickthrough.jsp?I5s57f5i5l5i5f5g52R5sVzI6ghdtIL59wUVxTXNyz5tMwC_HM5dIzL52W5sMPTN5n5e5bUKT5bMwC_HM5dIzL5bD_y5cG5i5i5dMPNS53T5p5e=e3 If you find this information about the availability of your Web site useful, we would appreciate your feedback. Should you prefer not to receive these error notices in the future please let us know by replying to this email and placing "remove" in the subject line. You will be removed from receiving further email error notices. Adam Brett Analyst Manager cs-adam.brett@REDACTED InternetSeer.com "Your Remote Web Site Monitor" http://www.internetseer.com PS. We will send you a courtesy email when we are able to reach your Web page again. ##erlang-questions@REDACTED## -------------- next part -------------- An HTML attachment was scrubbed... URL: From cpressey@REDACTED Wed Nov 7 06:48:14 2001 From: cpressey@REDACTED (Chris Pressey) Date: Tue, 6 Nov 2001 23:48:14 -0600 Subject: I/O from binaries In-Reply-To: References: Message-ID: <20011106234814.265b5671.cpressey@catseye.mb.ca> On Tue, 06 Nov 2001 09:49:11 +0100 "Vlad Dumitrescu" wrote: > I am thinking in the same paths as Chris, so I think it's a good idea > :-) > > Yes, I think it looks like OO, but at the same time it isn't. It is more > like the COM framework, where there are interfaces for objects to > implement. > The main difference compared to inheritance is that the structure is > flat, > avoiding the above named weakness. Of course, one could build a deep > hierarchy, but the natural way is to use a flat one. There might be rare circumstances when a hierarchy might be called for, but I think 'rare' is the important word in that statement. I've put my thoughts on OO on Bluetail's Erlang Wikie (but it doesn't seem to get a lot of traffic, and I don't know what it's future holds) so I'll summarize them here. I think inheritance is one of the more overrated features of OO, and message-passing is one of the more underrated. People tend to overestimate the 'reusability' gain from inheritance, and waste time trying to come up with the 'correct' hierarchy. In my experience, OO successes seem to be more attributable to encapsulation: making sure that objects talk to each other through their interfaces. And Erlang has encapsulation and message-passing in spades, of course! Inheritance has its place, but I think I would limit its use to modules, not behaviours. It would be pretty easy to cook up a parse transform to make inheritance dispatching implicit... hmm... in fact I might experiment with this in the near future :) > Whether this interface definition should use "behaviour" or another name > (to > avoid misunderstandings) is a question of taste, but I use it in my > programs > and it should be nice to have a compile-time check enabled. I can't really think of a better name than "behaviour", and I don't find it that confusing. It's a behaviour with no callback functionality which only defines an interface. Maybe a "null behaviour" or an "interface behaviour"? Chris From vladdu@REDACTED Wed Nov 7 07:16:37 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Wed, 07 Nov 2001 07:16:37 +0100 Subject: Behaviours (was: I/O from binaries) Message-ID: Me again... [If you want to skip my ravings written at 6am, look down for a ***] This discussion is interesting, as it unfolds some different ways of thinking about program & system structure. The hardcore Erlangers seem to disclose OO straight away, while newcomers (like me) do not. It may be a normal phase in the evolution of an Erlanger, or it may be not... To me OO isn't anbout object or inheritance, but about how to grasp the complexity of a system and make it easy to handle. I would like to not use the name "OO". Objects are but one way to think about it. The same things can be accomplished with modules and processes and interfaces - does that sound familiar? :-) [***] One thing that I am working on right now, and I hope to have something to show within two weeks when my parenthood leave ends, is something I am very curious about how it will work. I see it as a very nice way of training in Erlang, testing it's capabilities and maybe stretching some limits, while applying the "module, process, interface" thinking. It is an older idea, a windowing system all in Erlang, with a framework for building GUIs. Each window (including widgets) is a process and there is a top-level one that communicates with the world (input and drawing). The design is layered and one could say there is some kind of "inheritance". Let me see if I can explain nicely without using "forbidden" terms... * A window process is a server (that may be using gen_server or not) that is generic: there are a number of callbacks to be implemented later. * Each widget's functionality is defined in a separate module, implementing those callbacks, and at the same time defining some new generic ones. * In an application, these last callbacks are defined to implement the specific application functionality. * There is also another set of parallel callbacks, that define the look-and-feel of the widget(s). These might be defined for each widget, or globally for each look&feel. It isn't as strange as it looks like. The intention is to separate different categories of functionality, "general widget" from "look & feel" from "application-defined". Each can be changed separately, there are only loosely coupled through interfaces (behaviours). It is kind of a "behaviours on behaviours" as Chris said, but I don't really see some other scheme that will allow this kind of flexibility. And it doesn't seem so complicated that will obfuscate the whole system... Anyway, regular users will only see one behavioural level (the application one). The other is visible only when writing new widgets. I see this project as an interesting research, it might not be fast enough to work in real life. On the other hand, Java is not fast either, while this is something that Erlang is supposed to be best at: many small processes doing little work and not communicating a lot. Anyway, when I will have something to show, I will post it here. If anyone had the strength to read all of this and has comments, I won't mind to get feedback. See you later, Vlad _________________________________________________________________ H?mta MSN Explorer kostnadsfritt p? http://explorer.msn.se From Sean.Hinde@REDACTED Wed Nov 7 13:13:00 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Wed, 7 Nov 2001 12:13:00 -0000 Subject: Some new mnesia benchmarking results Message-ID: <402DD461F109D411977E0008C791C312039F655A@IMP02MBX> Hi all, I just spent some time benchmarking mnesia for huge disk_copies tables with the latest versions. Measurements on a SPARC 400MHz with Veritas FS. Create a table with 1 million rows: R7B-1 with mnesia-3.10.0 310 secs R8B with mnesia-4.0 315 secs R8B with 10 threads 270 secs Beam process size afterwards R7B-1 167M R8B 160M R8B threads 158M Stop mnesia R7B-1 with mnesia-3.10.0 155 secs (and whole node is blocked) R8B with mnesia-4.1 3.7 secs R8B threads 15 secs Start mnesia and wait for 1M row table to be available R7B-1 25 to 50 secs R8B 30 secs R8B threads 56 secs Subsequent stop of mnesia R7B-1 1.9 secs R8B 12 secs R8B threads 25 secs Start up mnesia after CTRL-C CTRL-C stopping node which is writing as fast as possible. (Noting disk log repair of DCL file messages on startup). R7B-1 40 secs maximum. R8B 40 secs R8B threads 61 secs Apart from quite a lot of variability in timer:tc results it would appear that the old behaviour of mnesia where it could potentially take hours to rebuild tables from badly closed dets tables has been completely cured. Perhaps someone could confirm that this is always the case and I have not just been lucky in the timing of my node kills! I wonder also if anyone knows of any other reasons not to use mnesia for large databases now? Very impressive. Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From per@REDACTED Wed Nov 7 13:59:32 2001 From: per@REDACTED (Per Bergqvist) Date: Wed, 07 Nov 2001 13:59:32 +0100 Subject: Some new mnesia benchmarking results References: <402DD461F109D411977E0008C791C312039F655A@IMP02MBX> Message-ID: <3BE93034.A7400ED3@cellpoint.com> Hi Sean, agree that mnesia is now getting ready for prime time as long as you have small records ;-). (Results are even more impressive on my little 1.7 GHz P4 Linux box ) I have a nasty problem that I still haven't resolved. I you have more and larger records than you have available RAM the system will get on its knees. I have tried to use disk_only_copies but it after 1 hour it had only written ~1M records so I aborted it. This should be compared with the 15Krecords/sec i get with disk_copies. Does anyone have a solution on how to store 10Mx2K records with mnesia without buying 20GB RAM ? /Per Sean Hinde wrote: > Hi all, > > I just spent some time benchmarking mnesia for huge disk_copies tables with > the latest versions. Measurements on a SPARC 400MHz with Veritas FS. > > Create a table with 1 million rows: > R7B-1 with mnesia-3.10.0 310 secs > R8B with mnesia-4.0 315 secs > R8B with 10 threads 270 secs > > Beam process size afterwards > R7B-1 167M > R8B 160M > R8B threads 158M > > Stop mnesia > R7B-1 with mnesia-3.10.0 155 secs (and whole node is blocked) > R8B with mnesia-4.1 3.7 secs > R8B threads 15 secs > > Start mnesia and wait for 1M row table to be available > R7B-1 25 to 50 secs > R8B 30 secs > R8B threads 56 secs > > Subsequent stop of mnesia > R7B-1 1.9 secs > R8B 12 secs > R8B threads 25 secs > > Start up mnesia after CTRL-C CTRL-C stopping node which is writing as fast > as possible. (Noting disk log repair of DCL file messages on startup). > R7B-1 40 secs maximum. > R8B 40 secs > R8B threads 61 secs > > Apart from quite a lot of variability in timer:tc results it would appear > that the old behaviour of mnesia where it could potentially take hours to > rebuild tables from badly closed dets tables has been completely cured. > > Perhaps someone could confirm that this is always the case and I have not > just been lucky in the timing of my node kills! > > I wonder also if anyone knows of any other reasons not to use mnesia for > large databases now? > > Very impressive. > > Sean > > NOTICE AND DISCLAIMER: > This email (including attachments) is confidential. If you have received > this email in error please notify the sender immediately and delete this > email from your system without copying or disseminating it or placing any > reliance upon its contents. We cannot accept liability for any breaches of > confidence arising through use of email. Any opinions expressed in this > email (including attachments) are those of the author and do not necessarily > reflect our opinions. We will not accept responsibility for any commitments > made by our employees outside the scope of our business. We do not warrant > the accuracy or completeness of such information. From Sean.Hinde@REDACTED Wed Nov 7 14:23:07 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Wed, 7 Nov 2001 13:23:07 -0000 Subject: Some new mnesia benchmarking results Message-ID: <402DD461F109D411977E0008C791C312039F655E@IMP02MBX> Hi, > agree that mnesia is now getting ready for prime time as long > as you have small > records ;-). > (Results are even more impressive on my little 1.7 GHz P4 Linux box ) Now Linux is a supported platform maybe this is the way to go.. > I have a nasty problem that I still haven't resolved. > I you have more and larger records than you have available > RAM the system will > get on its knees. I guess this is the nature of in memory databases.. The alternative is where the db engine manages caching of regularly used objects in RAM and it dips into disk to get other records. This is getting a long way from mnesia's goals I guess. > Does anyone have a solution on how to store 10Mx2K records > with mnesia without > buying > 20GB RAM ? It's probably worse than this as Erlang can only(!) address 4G of RAM. I see this as the main limit now.. and fixing it is probably not trivial. One for the "feature request" page. Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From etxuwig@REDACTED Wed Nov 7 17:09:45 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 7 Nov 2001 17:09:45 +0100 (MET) Subject: Some new mnesia benchmarking results In-Reply-To: <3BE93034.A7400ED3@cellpoint.com> Message-ID: On Wed, 7 Nov 2001, Per Bergqvist wrote: >I have a nasty problem that I still haven't resolved. I you >have more and larger records than you have available RAM the >system will get on its knees. > >I have tried to use disk_only_copies but it after 1 hour it had >only written ~1M records so I aborted it. This should be >compared with the 15Krecords/sec i get with disk_copies. Which version(s) of mnesia? Do you see any difference in OTP R8, using the new dets implementation? /Uffe (curious) -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From rpettit@REDACTED Wed Nov 7 19:00:34 2001 From: rpettit@REDACTED (Rick Pettit) Date: Wed, 7 Nov 2001 12:00:34 -0600 (CST) Subject: question about "active" option (regarding gen_tcp) Message-ID: I have a concurrent TCP server which spawns a new process every time gen_tcp:accept() returns. I call gen_tcp:listen() and set active to true, such that tcp packets arrive as messages in my mailbox. I had hoped to call gen_tcp:controlling_process() immediately after my call to accept, so that any TCP packets for that connection will be sent to the spawned processes mailbox. I fear that there is a race condition between the call to accept and the call to controlling_process (which means the parent may receive TCP packets in its mailbox instead of the child). Any suggestions? Rick From luke@REDACTED Wed Nov 7 19:24:18 2001 From: luke@REDACTED (Luke Gorrie) Date: 07 Nov 2001 19:24:18 +0100 Subject: question about "active" option (regarding gen_tcp) In-Reply-To: References: Message-ID: Rick Pettit writes: > I have a concurrent TCP server which spawns a new process every time > gen_tcp:accept() returns. I call gen_tcp:listen() and set active to > true, such that tcp packets arrive as messages in my mailbox. > > I had hoped to call gen_tcp:controlling_process() immediately after my > call to accept, so that any TCP packets for that connection will be sent > to the spawned processes mailbox. > > I fear that there is a race condition between the call to accept and the > call to controlling_process (which means the parent may receive TCP > packets in its mailbox instead of the child). You could accept the socket with {active, false}, then call controlling_process, and then signal the child to call inet:setopts(MySocket, [{active, true}]). That should do the trick. Here's an example: -module(atomicsock). -export([go/2, helper/1]). go(IP, Port) -> {ok, S} = gen_tcp:connect(IP, Port, [list, {active, false}]), Helper = spawn_link(?MODULE, helper, [S]), gen_tcp:controlling_process(S, Helper), Helper ! go, dump("Parent"). helper(S) -> receive go -> true end, inet:setopts(S, [{active, true}]), dump("Helper"). dump(Name) -> receive Msg -> io:format("~s got ~p~n", [Name, Msg]), dump(Name) after 1000 -> true end. Cheers, Luke From rpettit@REDACTED Wed Nov 7 19:27:01 2001 From: rpettit@REDACTED (Rick Pettit) Date: Wed, 7 Nov 2001 12:27:01 -0600 (CST) Subject: question about "active" option (regarding gen_tcp) In-Reply-To: Message-ID: > I have a concurrent TCP server which spawns a new process every time > gen_tcp:accept() returns. I call gen_tcp:listen() and set active to > true, such that tcp packets arrive as messages in my mailbox. > > I had hoped to call gen_tcp:controlling_process() immediately after my > call to accept, so that any TCP packets for that connection will be sent > to the spawned processes mailbox. > > I fear that there is a race condition between the call to accept and the > call to controlling_process (which means the parent may receive TCP > packets in its mailbox instead of the child). I must apologize for replying to my own post, but I did some digging and came across inet:tcp_sync_input() which appears to handle this race condition (but I still seek confirmation from the "great ones"). This inet:tcp_sync_input() is called by inet:tcp_controlling_process() which is called by gen_tcp:controlling_process(). It appears as though the call to controlling process() will pull all tcp packets from the previous owner's mailbox and place them in the new owner's mailbox before returning, making the call to controlling_process() atomic from the callers perspective. Thanks again. Rick From pew@REDACTED Wed Nov 7 19:51:52 2001 From: pew@REDACTED (Patrik Winroth) Date: Wed, 7 Nov 2001 19:51:52 +0100 (CET) Subject: question about "active" option (regarding gen_tcp) In-Reply-To: Message-ID: <20011107194127.H9540-100000@mas.algonet.se> On Wed, 7 Nov 2001, Rick Pettit wrote: > > I have a concurrent TCP server which spawns a new process every time > gen_tcp:accept() returns. I call gen_tcp:listen() and set active to > true, such that tcp packets arrive as messages in my mailbox. > > I had hoped to call gen_tcp:controlling_process() immediately after my > call to accept, so that any TCP packets for that connection will be sent > to the spawned processes mailbox. > > I fear that there is a race condition between the call to accept and the > call to controlling_process (which means the parent may receive TCP > packets in its mailbox instead of the child). > > Any suggestions? I think ( :-) ) one of the ways to do this is: 1) Use the option {active, false} when creating the listen socket. 2) When you get an accept socket, spawn a process to handle it, set the spawned process to controlling process for the socket, send a message to the spawned process to get it to use inet:setopts(Accept_socket, [{active,true}]) 3) messages are delivered to your process. Note: If you expect lots of incoming data to your server you should consider using passive sockets instead, see http://www.erlang.org/doc/r8b/lib/kernel-2.7/doc/html/index.html Regards, /Patrik. -- Patrik Winroth Vindaloo AB mbl: 0709-727364 From Sean.Hinde@REDACTED Wed Nov 7 21:13:12 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Wed, 7 Nov 2001 20:13:12 -0000 Subject: question about "active" option (regarding gen_tcp) Message-ID: <402DD461F109D411977E0008C791C312039F656C@IMP02MBX> Hi, > 3) messages are delivered to your process. > > Note: If you expect lots of incoming data to your server you should > consider using passive sockets instead, Or you can use the {active, once} option if you want to keep your packets arriving as messages. You need to ensure you always set it again after receiving a packet or things will go very quiet! Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From rikard.johansson@REDACTED Thu Nov 8 10:35:20 2001 From: rikard.johansson@REDACTED (Rikard Johansson) Date: Thu, 8 Nov 2001 10:35:20 +0100 Subject: Missing erlang mode Message-ID: <200111080937.fA89bXx39038@hades.cslab.ericsson.net> Hello all/someone, It seems the erlang-mode-2.3.tar.gz is missing in the download directory. At least the link from the download page is broken. Regards /Rikard From Bruce@REDACTED Thu Nov 8 10:43:26 2001 From: Bruce@REDACTED (Bruce Fitzsimons) Date: Thu, 8 Nov 2001 22:43:26 +1300 Subject: OtpR8B loops on configure Message-ID: <000b01c16839$d28216d0$4021970a@neolineas.com> Has anyone else seen this? Using Linux RH6.2 (2.2.14) on a Pentium 233MMX (a very minimal system, but still a useful node). On line 4688 of /erts/emulator/configure where it checks for "unreliable floating point execptions" (sic) it runs a conftest program which loops my machine. I will admit to only leaving it for 10mins but the program does not appear to have any loops, and skimming it does not appear to be particularly processor intensive. For the moment I have presumed that I have unreliable floating point exceptions and commented out this test (and left it so it assumes it failed). R7B compiled perfectly on this machine a while ago, albeit with a Pentium 133 cpu. I guess the upgrade could have affected it, but it doesn't loop, crash or do anything else bad for any other compilation tasks. Any ideas would be appreciated, although I have a workaround. Cheers, Bruce From rv@REDACTED Thu Nov 8 10:56:14 2001 From: rv@REDACTED (Robert Virding) Date: Thu, 08 Nov 2001 10:56:14 +0100 Subject: I/O from binaries and an I/O behaviour In-Reply-To: Your message of "Mon, 05 Nov 2001 17:50:02 CST." <20011105175002.791df0d7.cpressey@catseye.mb.ca> Message-ID: <200111080956.fA89uEu01306@erik.virding.org> Chris Pressey writes: >On Mon, 5 Nov 2001 08:17:24 +0100 (MET) > >I'll go one step further, and ask: is there any reason both the io module >and the bin_io module shouldn't both adhere to an 'io' behaviour? > >I realize that modules that implement behaviours are intended as callback >modules, but I don't see why they couldn't be used just as well to >establish an interface for calls of all kinds, not just callbacks. > >For example, a function in some other module could take an atom as an >argument, which would be a module name like io or bin_io (or socket_io, >serial_io, etc ad infinitum), and use that module for I/O by calling >Module:open(Object, [read]) and so forth. This would allow that function >to seamlessly use whatever I/O its caller specifies. > >I think the real benefit here comes from the new behaviour_info/1 >function, so that conformity with an interface can be checked, even at >compile time. There are probably other places it could be beneficial, for >example in the epop package, where a custom database driver can be >specified; it could be required to live up to an epop_db behaviour, or >some such. > >Any thoughts on this would be very welcome :) > >Chris No, real reason. I did look into to it many years ago, long before behaviours in fact, and found that it wasn't trivial. The problem is that such a generic server would need to define a generic way of getting bytes from and putting bytes to some device. Some devices, like files and binaries, work best with an synchronous call method while others like terminals work best with a completely asynchronous method. Another complication is that for things like terminals you really need to be able to interlace input and output requests in a sensible way, like the terminal does now. The best way I then found was to define a simple generic synchronous io server which uses defined get and put handlers. Other more complicated devices like terminals would then need a separate process to do their tricky bits. This went against the current trend, however, towards fewer processes as the BEAM is not really efficient in sending lists (unified heap rules). Actually the basic io protocol is pretty simple so I have not really felt the need to be great. I will look into it, however, when I get the time. Robert From kent@REDACTED Thu Nov 8 11:41:23 2001 From: kent@REDACTED (Kent Boortz) Date: 08 Nov 2001 11:41:23 +0100 Subject: Missing erlang mode In-Reply-To: Rikard Johansson's message of "Thu, 8 Nov 2001 10:35:20 +0100" References: <200111080937.fA89bXx39038@hades.cslab.ericsson.net> Message-ID: Rikard Johansson writes: > It seems the erlang-mode-2.3.tar.gz is missing in the download directory. > At least the link from the download page is broken. I removed it because version 2.4 is included in the otp package. In the source release it is located in otp_src_R8B-0/lib/emacs/ In the binary release it is located in $ERANG_ROOT/misc/emacs/ Is there a need for a separare erlang-mode TAR archive? kent From etxuwig@REDACTED Thu Nov 8 14:14:41 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Thu, 8 Nov 2001 14:14:41 +0100 (MET) Subject: R8B: make install misses some files Message-ID: I noticed that e.g. dets.hrl does not get copied from the original source tree during make install of OTP R8B. This means for example that you cannot recompile stdlib-1.10 in the installed version. I know that strictly speaking, you shouldn't do that anyway, but it also means that not all the source code is available as documentation. I have not checked whether this is also true for other files. /Uffe -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From vances@REDACTED Thu Nov 8 14:51:25 2001 From: vances@REDACTED (Vance Shipley) Date: Thu, 8 Nov 2001 08:51:25 -0500 Subject: OtpR8B loops on configure In-Reply-To: <000b01c16839$d28216d0$4021970a@neolineas.com> Message-ID: Bruce, I just ran into this last night. The weird thing is that I've built on this machine before, I have R8B-0 installed on it. I was just doing configure to change the prefix and install into another directory (embedded user). I was intending to try a fresh source tree today. -Vance Vance Shipley Motivity Telecom Inc. +1 519 579 5816 Bruce Fitzsimons writes: > > Has anyone else seen this? > > Using Linux RH6.2 (2.2.14) on a Pentium 233MMX (a very minimal system, but > still a useful node). > > On line 4688 of /erts/emulator/configure where it checks for "unreliable > floating point execptions" (sic) it runs a conftest program which loops my > machine. I will admit to only leaving it for 10mins but the > program does not appear to have any loops, and skimming it does not appear > to be particularly processor intensive. From vladdu@REDACTED Thu Nov 8 15:00:41 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Thu, 08 Nov 2001 15:00:41 +0100 Subject: messages lost? Message-ID: Hi, I noticed that there are more messages in the online archive than in my mailbox (including one that I sent myself... I did receive later messages, so it can't be just mail delay... An extract from the online listing - I killed the compiler From: Ulf Wiger - We are Unable to Reach your Web Page From: adam.brett@REDACTED - Re: I/O from binaries From: Chris Pressey - Behaviours (was: I/O from binaries) From: "Vlad Dumitrescu" I only got Chris' message... Did anyone get those? What's wrong? regards, Vlad _________________________________________________________________ H?mta MSN Explorer kostnadsfritt p? http://explorer.msn.se From not@REDACTED Thu Nov 8 15:17:26 2001 From: not@REDACTED (Gordon Beaton) Date: 8 Nov 2001 14:17:26 GMT Subject: messages lost? References: Message-ID: <9se45m$e4m$1@news.du.uab.ericsson.se> On 8 Nov 2001 14:00:41 GMT, Vlad Dumitrescu wrote: > I noticed that there are more messages in the online archive than in > my mailbox (including one that I sent myself... I did receive later > messages, so it can't be just mail delay... For a few hours between nov 6 and nov 7 there was a problem with the machine running the mailing list software. During that time some messages did not get sent to subscribers; they did end up in the archive however. /gordon -- [ do not send me private copies of your followups ] g o r d o n . b e a t o n @ e r i c s s o n . c o m From vladdu@REDACTED Thu Nov 8 16:50:35 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Thu, 08 Nov 2001 16:50:35 +0100 Subject: behaviour_info Message-ID: Hi, I must have been hitting a blind spot, but I don't find the documentation about behaviour_info... and because I am on Windows, grep complains about too long lines in almost all .erl files :-) And should anyone feel the need to read my posting that didn't make it through to everyone, please go to http://www.erlang.org/ml-archive/erlang-questions/200111/msg00023.html thanks. Regards, Vlad _________________________________________________________________ H?mta MSN Explorer kostnadsfritt p? http://explorer.msn.se From etxuwig@REDACTED Thu Nov 8 17:05:54 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Thu, 8 Nov 2001 17:05:54 +0100 (MET) Subject: behaviour_info In-Reply-To: Message-ID: I believe that this is the definitive documentation: http://www.erlang.org/ml-archive/erlang-questions/200109/msg00103.html /Uffe ;) On Thu, 8 Nov 2001, Vlad Dumitrescu wrote: >Hi, > >I must have been hitting a blind spot, but I don't find the documentation >about behaviour_info... and because I am on Windows, grep complains about >too long lines in almost all .erl files :-) > >And should anyone feel the need to read my posting that didn't make it >through to everyone, please go to >http://www.erlang.org/ml-archive/erlang-questions/200111/msg00023.html > >thanks. Regards, >Vlad > >_________________________________________________________________ >H?mta MSN Explorer kostnadsfritt p? http://explorer.msn.se > > -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From etxuwig@REDACTED Thu Nov 8 17:03:47 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Thu, 8 Nov 2001 17:03:47 +0100 (MET) Subject: online archive "Top" link Message-ID: Would it be very difficult to add a "Top" (and perhaps a "Search" link to the Date Index and Thread Index pages? While in Date Index, I can switch to Thread Index and vice versa, but I cannot easily switch months, or go to the search page. /Uffe -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From adam.brett@REDACTED Thu Nov 8 21:09:08 2001 From: adam.brett@REDACTED (adam.brett@REDACTED) Date: Thu, 8 Nov 2001 15:09:08 -0500 (EST) Subject: We are Now Able to Reach your Web Page Message-ID: <6016163.1005250148458.JavaMail.promon@pm66> We are please to inform you that we no longer have a problem in reaching your Web page from the Philadelphia area: http://www.erlang.org/faq/x65.html As recommended by the robot Guidelines, this email is to explain our research activity and to alert you about the connectivity error we encountered. InternetSeer, the world's largest web site monitoring service, does not store or publish the content of your pages, but rather uses the information to update our ongoing Web Connectivity Study. To learn more about our study results or request InternetSeer to continue monitoring your Web site and sending you error messages visit http://scclick.internetseer.com/sitecheck/clickthrough.jsp?I5s57f5m5j5h5i5j52R5sVzI6ghktIL59wUVxTXNyz5tMwC_HM5dIzL52W5sMPTN5n5e5bUKT5bMwC_HM5dIzL5bD_y5cG5i5i5dMPNS53T5p5e=e3. If you prefer not to receive these occasional error notices please let us know by replying to this email and placing "remove" in the subject line. You will be removed from receiving further email error notices. Adam Brett Analyst Manager cs-adam.brett@REDACTED InternetSeer.com "Your Remote Web Site Monitor" http://www.internetseer.com ##erlang-questions@REDACTED## -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikpe@REDACTED Thu Nov 8 22:43:21 2001 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 8 Nov 2001 22:43:21 +0100 (MET) Subject: OtpR8B loops on configure Message-ID: <200111082143.WAA06897@harpo.it.uu.se> On Thu, 8 Nov 2001 22:43:26 +1300, Bruce Fitzsimons wrote: >Has anyone else seen this? > >Using Linux RH6.2 (2.2.14) on a Pentium 233MMX (a very minimal system, but >still a useful node). > >On line 4688 of /erts/emulator/configure where it checks for "unreliable >floating point execptions" (sic) it runs a conftest program which loops my >machine. I will admit to only leaving it for 10mins but the program does not >appear to have any loops, and skimming it does not appear to be particularly >processor intensive. > >For the moment I have presumed that I have unreliable floating point >exceptions and commented out this test (and left it so it assumes it failed). > >R7B compiled perfectly on this machine a while ago, albeit with a Pentium 133 >cpu. I guess the upgrade could have affected it, but it doesn't loop, crash or >do anything else bad for any other compilation tasks. I would suspect a hardware or software problem specific to your machine. I have a test box with a similar configuration (233MHz Pentium MMX, RedHat 6.2), and it has no problem with the test for unreliable f.p. exceptions. (They're reliable.) You wrote "2.2.14". That's a pretty old kernel, which makes me wonder if your box is 6.2 vanilla without any of the many recommended updates? You should at least upgrade glibc and the kernel. /Mikael Pettersson (. HiPE developer and author of the x86 f.p. exception support code .) From Bruce@REDACTED Thu Nov 8 23:58:25 2001 From: Bruce@REDACTED (Bruce Fitzsimons) Date: Fri, 9 Nov 2001 11:58:25 +1300 Subject: OtpR8B loops on configure References: <200111082143.WAA06897@harpo.it.uu.se> Message-ID: <025701c168a8$e0b6b7f0$5f00a8c0@SLANT> Thanks Mikael, > I would suspect a hardware or software problem specific to your machine. > I have a test box with a similar configuration (233MHz Pentium MMX, > RedHat 6.2), and it has no problem with the test for unreliable f.p. > exceptions. (They're reliable.) Weird. I will have to think if I have changed anything. Did this FP exception code exist in R7B or is it new with HiPe/R8B? > You wrote "2.2.14". That's a pretty old kernel, which makes me wonder > if your box is 6.2 vanilla without any of the many recommended updates? > You should at least upgrade glibc and the kernel. I am reluctant to do this as I have to interop with the Dialogic linux drivers (closed source, etc etc). They are terrible beasts of things to get working, and not at all tolerant of kernel upgrades. I would have upgraded to RH 7.2 otherwise :-) I will attempt to pull out the code from the script and gdb it to see whats going on, although the asm and signal handlers inside it will probably confuse me a bit. Looping is odd. Cheers, Bruce From vances@REDACTED Fri Nov 9 00:33:08 2001 From: vances@REDACTED (Vance Shipley) Date: Thu, 8 Nov 2001 18:33:08 -0500 Subject: OtpR8B loops on configure (solved) In-Reply-To: <025701c168a8$e0b6b7f0$5f00a8c0@SLANT> Message-ID: Bruce, I was just proving my suspicions by rebooting on an unpatched kernel when your message came in. I'll bet that you have patched your RedHat v.6.2 kernel for larger STREAMS resources haven't you? Running the standard kernel solved the problem here. -Vance Vance Shipley Motivity Telecom Inc. +1 519 579 5816 From vances@REDACTED Fri Nov 9 00:39:22 2001 From: vances@REDACTED (Vance Shipley) Date: Thu, 8 Nov 2001 18:39:22 -0500 Subject: OtpR8B loops on configure (solved) In-Reply-To: Message-ID: Mikael, Any idea why this patch is incompatible with your test? It is used to get over a limitation with the Dialogic drivers where you can only have 300 of their devices open once. -Vance Vance Shipley Motivity Telecom Inc. +1 519 579 5816 --- 2340-p5/mm/slab.c Tue Jan 18 10:48:32 2000 +++ linux/mm/slab.c Tue Jan 18 11:30:17 2000 @@ -299,10 +299,10 @@ #define SLAB_C_MAGIC 0x4F17A36DUL /* maximum size of an obj (in 2^order pages) */ -#define SLAB_OBJ_MAX_ORDER 5 /* 32 pages */ +#define SLAB_OBJ_MAX_ORDER 6 /* 64 pages */ /* maximum num of pages for a slab (prevents large requests to the VM layer) */ -#define SLAB_MAX_GFP_ORDER 5 /* 32 pages */ +#define SLAB_MAX_GFP_ORDER 6 /* 64 pages */ /* the 'preferred' minimum num of objs per slab - maybe less for large objs */ #define SLAB_MIN_OBJS_PER_SLAB 4 @@ -346,6 +346,7 @@ {32768, NULL}, {65536, NULL}, {131072, NULL}, + {262144, NULL}, {0, NULL} }; @@ -368,7 +369,8 @@ "size-16384", "size-32768", "size-65536", - "size-131072" + "size-131072", + "size-262144" }; /* internal cache of cache description objs */ From Bruce@REDACTED Fri Nov 9 01:52:43 2001 From: Bruce@REDACTED (Bruce Fitzsimons) Date: Fri, 9 Nov 2001 13:52:43 +1300 Subject: OtpR8B loops on configure (solved) References: Message-ID: <02a001c168b8$d7b9e540$5f00a8c0@SLANT> Hi Vance, > I was just proving my suspicions by rebooting on an unpatched > kernel when your message came in. I'll bet that you have patched > your RedHat v.6.2 kernel for larger STREAMS resources haven't you? > > Running the standard kernel solved the problem here. I have installed LiS and recompiled my kernel at some point, but I haven't explicitly patched anything - I'm only running dinky analog cards. I will attempt to put the standard kernel back in tonight and see what happens. Thanks for your help Vance. Cheers, Bruce From achrist@REDACTED Fri Nov 9 02:32:59 2001 From: achrist@REDACTED (Al Christians) Date: Thu, 08 Nov 2001 17:32:59 -0800 Subject: OtpR8B loops on configure (solved) Message-ID: <3BEB324B.513C614D@easystreet.com> When I tried to make R8B under Windows NT4 (which I suppose is supposed to not be possible), it hung up at the same spot, IIRC. My machine is dual-processor Pentium Pro 200's. Al From vances@REDACTED Fri Nov 9 02:42:10 2001 From: vances@REDACTED (Vance Shipley) Date: Thu, 8 Nov 2001 20:42:10 -0500 Subject: dets:traverse/2 in R8B Message-ID: I found this behaviour changed from previous releases. It would appear to be a bug. It even says it is. :) -Vance Erlang (BEAM) emulator version 5.1 [source] [hipe] [threads:0] Eshell V5.1 (abort with ^G) 1> dets:open_file(foo, []). {ok,foo} 2> dets:insert(foo, [{1,abc,10},{2,def,11},{3,ghi,12},{4,jkl,13}]). ok 3> dets:traverse(foo, fun(X) -> {continue, X} end). [{3,ghi,12},{1,abc,10},{4,jkl,13},{2,def,11}] 4> dets:close(foo). ok 5> dets:open_file(foo, [{access, read}]). {ok,foo} 6> dets:traverse(foo, fun(X) -> {continue, X} end). =ERROR REPORT==== 8-Nov-2001::16:42:23 === ** dets: Bug was found when accessing table foo, ** dets: operation was {match,<<>>,[{'_',[],['$_']}],default} and reply was 'EXIT'. =ERROR REPORT==== 8-Nov-2001::16:42:23 === Error in process <0.25.0> with exit value: {{{case_clause,{badarg,[{erlang,size,[false]},{dets_utils,all,1},{dets,init_ scan,2},{dets,chunk_begin,3},{dets,fselect,4},{dets,apply_op,4},{dets,open_f ile_loop,2}]}},[{dets,do_trav,4},{dets,do_traverse,4},{erl_eval,expr,... ** exited: {{{case_clause,{badarg,[{erlang,size,[false]}, {dets_utils,all,1}, {dets,init_scan,2}, {dets,chunk_begin,3}, {dets,fselect,4}, {dets,apply_op,4}, {dets,open_file_loop,2}]}}, [{dets,do_trav,4}, {dets,do_traverse,4}, {erl_eval,expr,3}, {erl_eval,exprs,4}, {shell,eval_loop,2}]}, [{dets,do_traverse,4}, {erl_eval,expr,3}, {erl_eval,exprs,4}, {shell,eval_loop,2}]} ** 7> From shrogers@REDACTED Fri Nov 9 03:31:13 2001 From: shrogers@REDACTED (shrogers@REDACTED) Date: Fri, 9 Nov 2001 02:31:13 GMT Subject: R8B and BTT 3.1 Message-ID: <200111090231.UAA03910@ionet.net> Can anyone tell me if BTT 3.1 is compatible with Erlang/OTP R8B? --------------------------------------------- This message was sent using Inter.net Webmail. http://www.us.inter.net/ From mikpe@REDACTED Fri Nov 9 11:08:46 2001 From: mikpe@REDACTED (Mikael Pettersson) Date: Fri, 9 Nov 2001 11:08:46 +0100 Subject: OtpR8B loops on configure In-Reply-To: <025701c168a8$e0b6b7f0$5f00a8c0@SLANT> References: <200111082143.WAA06897@harpo.it.uu.se> <025701c168a8$e0b6b7f0$5f00a8c0@SLANT> Message-ID: <15339.43822.961718.302427@harpo.it.uu.se> Bruce Fitzsimons writes: > Thanks Mikael, > > > I would suspect a hardware or software problem specific to your machine. > > I have a test box with a similar configuration (233MHz Pentium MMX, > > RedHat 6.2), and it has no problem with the test for unreliable f.p. > > exceptions. (They're reliable.) > Weird. I will have to think if I have changed anything. Did this FP > exception code exist in R7B or is it new with HiPe/R8B? It's new in R8. It's used to improve performance for f.p. intensive code by avoiding a large number of usually pointless error checks. If I remember correctly, it gave a 10-20% speedup or so on pseudoknot. /Mikael From Sean.Hinde@REDACTED Fri Nov 9 13:16:13 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 9 Nov 2001 12:16:13 -0000 Subject: R8B and BTT 3.1 Message-ID: <402DD461F109D411977E0008C791C312039F6585@IMP02MBX> > Can anyone tell me if BTT 3.1 is compatible with Erlang/OTP > R8B? I don't know about BTT but we have not found any compatibility problems with R8B in any of our code. One of the nice things about Erlang is the millions of lines of pre-existing Ericsson code which they need to proide backwards compatibility for :) If you do find any problems I'm sure someone here would be able to help out. Rgds, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From eedtag@REDACTED Fri Nov 9 14:05:01 2001 From: eedtag@REDACTED (Tanja Godau) Date: Fri, 9 Nov 2001 14:05:01 +0100 (MET) Subject: http 1.1 Message-ID: <200111091305.OAA09849@granus41.eed.ericsson.se> Hello, I'd like to know if there are Erlang modules/programs available to be able to work with the HTTP 1.1 protocol? Thankyou Tanja Tanja Godau Software Designer Ericsson Eurolab Deutschland GmbH Verification Tool Design Tel: +49 2407 575 310 Fax: +49 2407 575 651 Dect:+49 2407 575 89427 mailto:Tanja.Godau@REDACTED From etxuwig@REDACTED Fri Nov 9 15:28:08 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Fri, 9 Nov 2001 15:28:08 +0100 (MET) Subject: Some new mnesia benchmarking results In-Reply-To: <3BE93034.A7400ED3@cellpoint.com> Message-ID: On Wed, 7 Nov 2001, Per Bergqvist wrote: >Hi Sean, > >agree that mnesia is now getting ready for prime time as long >as you have small records ;-). (Results are even more >impressive on my little 1.7 GHz P4 Linux box ) > >I have a nasty problem that I still haven't resolved. I you >have more and larger records than you have available RAM the >system will get on its knees. > >I have tried to use disk_only_copies but it after 1 hour it had >only written ~1M records so I aborted it. This should be >compared with the 15Krecords/sec i get with disk_copies. > >Does anyone have a solution on how to store 10Mx2K records with >mnesia without buying 20GB RAM ? > >/Per What are your access patterns like? I have some ideas that I'm testing currently. 1. Dan and H?kan have written a module in mnesia called mnesia_frag.erl. It's wholly undocumented, except for the source, but it seems to work really well. The idea is that you can treat a number of regular mnesia tables as fragments of a larger table. Operations on the "base table" access the appropriate fragment based on a hashing function on the key. Fragments are distributed evenly across a pool of processors. 2. I have written (but not tested much yet) a modified mnesia_frag that also supports static distribution of fragments using a callback function to identify each fragment instead of using a hash. 3. One could imagine splitting a very large disc_only table into several smaller fragments, even on a single node system. This wouldn't be of much use if the fragments are replicated, and the application requires the tables to be fully synched before they can be used (I've found this to be a logical way to do things in real systems.) When synching replicas, mnesia will read all objects into memory and pass them to the other node in regular Erlang messages. This is done for one table at a time. 4. Onto my most recent experiment: I've modified mnesia to load a configurable number of tables in parallel. This gave particularly good results on many disc_only_copies (in one test, I reduced the startup time by half.) In combination with (3) above, this might be of some help to you. I also wouldn't mind assistance in verifying that my patch doesn't jeopardize stability. As a side note, disc_only_copies shouldn't be read into memory, but if they are replicated, they are. Mnesia will always copy the entire table (the most current copy) to the other nodes, by traversing the dets file and sending the objects to a receiver on the other node (aggregated into 8K chunks). There is some tremendous optimization potential here (perhaps the next experiment, but it's a non-trivial problem to solve...) /Uffe (These are not official statements of the mnesia team. ;) -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From martin-g@REDACTED Fri Nov 9 15:26:46 2001 From: martin-g@REDACTED (Martin Gustafsson) Date: Fri, 09 Nov 2001 14:26:46 GMT Subject: http 1.1 Message-ID: <1005316006.247martin-g@home.se> Hello Erlang Friends Today the webserver in Erlang/OTP only supports HTTP/1.0, but it is under reconstruction to support HTTP/1.1. Most of the features in HTTP/1.1 is already implemented, but needs some more testing before release. The most interesting part might be the persistent connections that will reduce the work for the server. It will also be possible to send dynamic generated pages in chunks to HTTP/1.1 clients, which will reduce the memory consumption. Best regards Martin Gustafsson Email:marting@REDACTED From etxuwig@REDACTED Fri Nov 9 15:35:13 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Fri, 9 Nov 2001 15:35:13 +0100 (MET) Subject: http 1.1 In-Reply-To: <1005316006.247martin-g@home.se> Message-ID: On Fri, 9 Nov 2001, Martin Gustafsson wrote: >Today the webserver in Erlang/OTP only >supports HTTP/1.0, but it is under >reconstruction to support HTTP/1.1. [...] >It will also be possible to send dynamic >generated pages in chunks to HTTP/1.1 clients, >which will reduce the memory consumption. The CCviewer contrib uses its own web server (a modified version of Joe Armstrongs pico web server), which also supports this particular feature of HTTP/1.1. (Actually, it's not really the web server part, since it allows the application to address the socket directly. I use it for particularly lengthy jobs, where the application also senses "socket closed" and stores the page for later retrieval. /Uffe -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From Chandrashekhar.Mullaparthi@REDACTED Fri Nov 9 15:43:58 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Fri, 9 Nov 2001 14:43:58 -0000 Subject: Some new mnesia benchmarking results Message-ID: <402DD461F109D411977E0008C791C31205E06274@IMP02MBX> > -----Original Message----- > From: Ulf Wiger [mailto:etxuwig@REDACTED] > Sent: 9 November 2001 14:28 > To: Per Bergqvist > Cc: Sean Hinde; 'Erlang Questions' > Subject: Re: Some new mnesia benchmarking results > > [snip] > What are your access patterns like? > > I have some ideas that I'm testing currently. > > 1. Dan and H?kan have written a module in mnesia called > mnesia_frag.erl. It's wholly undocumented, except for the > source, but it seems to work really well. The idea is that > you can treat a number of regular mnesia tables as fragments > of a larger table. Operations on the "base table" access > the appropriate fragment based on a hashing function on > the key. Fragments are distributed evenly across a pool > of processors. It is quite well documented in the mnesia user guide. We use it quite extensively. The recent presentation by Sean in EUC'01 was about an application which, among other things, every hour traverses the entire table and marks some records for deletion. The way it is done is to traverse each fragment independently. Saves our application from being unable to access mnesia for too long. At any one time during the traversal there is a lock on only one fragment. http://www.erlang.org/doc/r8b/lib/mnesia-4.0/doc/html/Mnesia_chap5.html#5.3 cheers, Chandru NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From etxuwig@REDACTED Fri Nov 9 15:50:51 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Fri, 9 Nov 2001 15:50:51 +0100 (MET) Subject: Some new mnesia benchmarking results In-Reply-To: <402DD461F109D411977E0008C791C31205E06274@IMP02MBX> Message-ID: On Fri, 9 Nov 2001, Chandrashekhar Mullaparthi wrote: >> -----Original Message----- >> From: Ulf Wiger [mailto:etxuwig@REDACTED] >> 1. Dan and H?kan have written a module in mnesia called >> mnesia_frag.erl. It's wholly undocumented, except for the >> source > >It is quite well documented in the mnesia user guide. We use it >quite extensively. Oops! Well, I should've checked the user guide. I'm glad to have been proven wrong. (: /Uffe -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From Sean.Hinde@REDACTED Fri Nov 9 16:37:13 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 9 Nov 2001 15:37:13 -0000 Subject: http 1.1 Message-ID: <402DD461F109D411977E0008C791C312039F658C@IMP02MBX> Hi, > Today the webserver in Erlang/OTP only > supports HTTP/1.0, but it is under > reconstruction to support HTTP/1.1. > > Most of the features in HTTP/1.1 is > already implemented, but needs some more > testing before release. > > The most interesting part might be > the persistent connections that will > reduce the work for the server. This is excellent news. There's a new Erlang app we fancy having a go at here but are held back for want of HTTP-1.1 support in Inets. Any idea when there will be a release? Also, the http client in the sowap application on sourceforge from Johan Blom looks like a good start for a HTTP-1.1 client. It doesn't support persistent connections but this probably wouldn't be too hard to add (perhaps some http guru might help Johan out :). Regards, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Sean.Hinde@REDACTED Fri Nov 9 16:46:10 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 9 Nov 2001 15:46:10 -0000 Subject: Some new mnesia benchmarking results Message-ID: <402DD461F109D411977E0008C791C312039F658D@IMP02MBX> Hi, > >Does anyone have a solution on how to store 10Mx2K records with > >mnesia without buying 20GB RAM ? I have one. 64 bit Erlang! (and the big machine - memory is cheap) Seriously, Sun just brought out a cheap Netra server (Netra 20) which takes up to 8G of RAM. This would make a serious erlang/mnesia node but we are limited to 4G per beam process and therefore back to fragmented tables and multiple nodes per machine (I am really desparately trying to avoid using Oracle here!) A 64 bit tagging scheme could be seriously fast as well - no need for all that bit twiddling.. R9? Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Sean.Hinde@REDACTED Fri Nov 9 16:59:45 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 9 Nov 2001 15:59:45 -0000 Subject: Feature Requests Message-ID: <402DD461F109D411977E0008C791C312039F658F@IMP02MBX> All, While we are dreaming here's a few thoughts on what I'd like to see: (A bit early for Christmas I know but here goes anyway) New features in applications: Inets: HTTP-1.1 including persistent connections for httpd (looks like it's on the cards) SOAP server HTTP-1.1 client SOAP client SASL: overload module enhanced to take into account system load as well as the defined throughput (nice telecoms standard adaptive load control mechansim). XML Nice full set of XML libraries Mnemosyne: Use of select syntax to make it even usable :) Mnesia: Nicer way to recover from partitioned networks safely (e.g. option to not startup node until fully meshed network and master node are (re)established) STDLIB: Supervisors with option of delay between restarts Global naming - better recovery from partitioned networks, particularly when used with distributed apps (e.g. it is possible to have two instances of a global app remain running even after re-connection of two nodes). Java Interface: Native support of Java RMI or JMS or EJB. I started to write a streamed Java object decoder in Erlang yesterday - it doesn't look too hard (and why finish the last project when you can start a nice new one!) New language features: Bit syntax with unbound length parameters (allowing nice regexp functionality without the "magic/gobbledegook" problem). Platform issues: 64 bit erlang (remove 4G beam process limit, I guess it would also allow for a more efficient tagging and type validating scheme relying on less bit twiddling) Unified Heap (So we can design Erlang systems like we want to (lots of processes) without the performance penalty. Ensure realtime response) Segmented binaries to reduce memory consumption and copying (and convoluted pogramming style sometimes needed) SCTP distribution (assuming Sun ever get round to implementing it) Fix of time taken to clear ets table (i.e down from 60 seconds or more for a decent sized table - mabe Unified heap does do this) That's probably enough for now :) Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From eusshkx@REDACTED Fri Nov 9 18:35:44 2001 From: eusshkx@REDACTED (Shafia Kausar) Date: Fri, 09 Nov 2001 11:35:44 -0600 Subject: Questions regarding TCP sockets Message-ID: <3BEC13F0.3DD43A85@am1.ericsson.se> Hi, I currently have an active TCP socket which is getting swamped by bursts of short messages sent by the other end resulting in processor overload. I would like to introduce flow control to prevent incoming bursts of data, for which, I understand that I need to change the socket to a passive mode. But I am not sure how to implement the receipt of packets from the socket. More precisely - what is the difference between an active and passive socket? How does a passive socket introduce flow control? What is the purpose of the length parameter in the function call gen_tcp:recv(sock, length). i.e. how is the length related to the receive buffer of TCP So far the only difference in behavior I have seen is that the active socket reads every message it receives and sends it to the application, while a passive socket requires the user to read the socket. I am assuming that reading of the socket at intervals rather than continuously introduces flow control. If my above assumption is correct - how frequent should the read be to introduce an optimum flow control mechanism? How many bytes do we read at a time? Does the length parameter control the size of the receive buffer/advertised receiver window? How much of additional flow control do we achieve by using the timeout parameter in gen_tcp:recv/3 Can I have two different processes interacting with the passive socket - one process reads the socket in a loop while the other sends to the socket? I was thinking about this to free the process which would otherwise be tied to the receive loop. Would this beat the whole purpose of the passive socket? What are the default values of the send/receive buffer in OTP? I understand that these are set by the OS and are also configurable when we define the socket parameters but if this is not defined by the user does OTP override the OS defaults (possibly?) I am sorry about the long list of questions but I have used all resources I could find and have come to a dead end. Hopefully the experts on this list can help me out:)) Also - Is there any documentation which explains in detail the implementation of sockets in OTP (other than the man pages). Especially how flow control and congestion control is implemented. Thanks! regards, Shafia From mickael.remond@REDACTED Fri Nov 9 20:16:24 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Fri, 9 Nov 2001 20:16:24 +0100 Subject: Feature Requests In-Reply-To: <402DD461F109D411977E0008C791C312039F658F@IMP02MBX> References: <402DD461F109D411977E0008C791C312039F658F@IMP02MBX> Message-ID: <20011109201624.A4882@erlang-fr.org> Sean Hinde (Sean.Hinde@REDACTED) wrote: > All, > > While we are dreaming here's a few thoughts on what I'd like to see: (A bit > early for Christmas I know but here goes anyway) > > New features in applications: > > Inets: > SOAP server > SOAP client I am working on a mod_soap, so that we can serve SOAP request in Erlang. The client is also on the way. Still needs a lot of work but is already working. Will the old inets module be compatible with the new ones ? -- Micka?l R?mond From cpressey@REDACTED Sat Nov 10 01:53:22 2001 From: cpressey@REDACTED (Chris Pressey) Date: Fri, 9 Nov 2001 18:53:22 -0600 Subject: Feature Requests In-Reply-To: <402DD461F109D411977E0008C791C312039F658F@IMP02MBX> References: <402DD461F109D411977E0008C791C312039F658F@IMP02MBX> Message-ID: <20011109185322.5d32fb8b.cpressey@catseye.mb.ca> On Fri, 9 Nov 2001 15:59:45 -0000 Sean Hinde wrote: > All, > > While we are dreaming here's a few thoughts on what I'd like to see: (A > bit early for Christmas I know but here goes anyway) > > New features in applications: I would like to add a couple of my own wishes to this list... gs: It would be really nice if gs could allow your code to intercept messages, instead of just reacting to them after they've happened. Or at least, a way to create a window with no close button. parse_tools: leex! :) > New language features: Some kind of 'string' data type, a compromise between list and binary. "Abstract Patterns", or, failing that, a documented internal format and/or a behaviour for parse transforms. Guarded and derived record fields, possibly done with a parse transform, possibly exploiting a recordname == modulename association so that we can pretend we're calling "methods" on "objects" when we're really just calling functions with records. I would be happy to help, esp. with the last two ideas. > Platform issues: Stand Alone Erlang BEAM MPU :) Chris From fredrik.linder@REDACTED Sat Nov 10 19:16:48 2001 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Sat, 10 Nov 2001 19:16:48 +0100 Subject: Feature Requests References: <402DD461F109D411977E0008C791C312039F658F@IMP02MBX> Message-ID: <00bd01c16a13$dd4516e0$c72511c2@frelin> ----- Original Message ----- From: "Sean Hinde" To: "'Erlang Questions'" Sent: Friday, November 09, 2001 4:59 PM Subject: Feature Requests > All, > > While we are dreaming here's a few thoughts on what I'd like to see: (A bit > early for Christmas I know but here goes anyway) [...] > STDLIB: > Supervisors with option of delay between restarts I would also like to add a wish to this list: deep sleep. I am working in a project where we can have 10000+ instances of the same type of process. However, all these processes are very scaresly used, and keeping them as living processes would result in inefficient memory utilization. To solve this, we stored its loopdata in a table, kill the processes whenever it did not have any messages on its way (single access point) and spawn it again when a new message was on its way. A nice feature would be to have a (built in?) function that places a process into a deep sleep, from which it is only woken by an incoming message or signal. During this deep sleep should its RAM usage be turned into a minimum, allowing other processes to use that memory. Suggested interface: erlang:deep_sleep(Pid) -> ok | exit() I was about to implement this as an added feature for supervisors, but realized that I had no control over signals nor usage of pids. Preventing the kill & spawn strategy above. /Fredrik From etxuwig@REDACTED Sat Nov 10 23:10:49 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Sat, 10 Nov 2001 23:10:49 +0100 (MET) Subject: Feature Requests In-Reply-To: <402DD461F109D411977E0008C791C312039F658F@IMP02MBX> Message-ID: On Fri, 9 Nov 2001, Sean Hinde wrote: >STDLIB: >Supervisors with option of delay between restarts I assume that you feel that it's insufficient to insert a sleep in the worker's init function? I can think of two reasons: (1) the process doesn't know if it's the first start or a subsequent one, and (2) you'd like the delay to occur before the process is actually spawned and (most likely) registered. (1) above should definitely be solved. Not being able to tell the difference between a normal start and a looping restart means that restart escalation seldomly works effectively. If you want (2), I'm curious to hear your justification. (: /Uffe -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From shrogers@REDACTED Sun Nov 11 02:30:17 2001 From: shrogers@REDACTED (Steven H. Rogers) Date: Sat, 10 Nov 2001 19:30:17 -0600 Subject: R8B and BTT 3.1 References: <402DD461F109D411977E0008C791C312039F6585@IMP02MBX> Message-ID: <3BEDD4A9.F41A37E8@ionet.net> Sean Hinde wrote: > > > Can anyone tell me if BTT 3.1 is compatible with Erlang/OTP > > R8B? > > I don't know about BTT but we have not found any compatibility problems with > R8B in any of our code. One of the nice things about Erlang is the millions > of lines of pre-existing Ericsson code which they need to proide backwards > compatibility for :) > > If you do find any problems I'm sure someone here would be able to help out. > > Rgds, > Sean > I thought that it should, but upgrading from R7B to R8B on a system with BTT 3.1 pre installed rendered the latter inoperable. I performed a fresh install of BTT 3.1 on a different R8B system, and it seems to work just fine. -- Steven H. Rogers, shrogers@REDACTED -- Remember Flight 93! From shrogers@REDACTED Sun Nov 11 06:07:03 2001 From: shrogers@REDACTED (shrogers@REDACTED) Date: Sun, 11 Nov 2001 00:07:03 -0500 Subject: R8B and BTT 3.1 Message-ID: <200111110507.AAA23709@zcars0mt.> Can anyone tell me if BTT 3.1 is compatible with Erlang/OTP R8B? --------------------------------------------- This message was sent using Inter.net Webmail. http://www.us.inter.net/ From eleberg@REDACTED Sun Nov 11 13:43:13 2001 From: eleberg@REDACTED (Bengt Kleberg) Date: Sun, 11 Nov 2001 13:43:13 +0100 (MET) Subject: Questions regarding TCP sockets Message-ID: <200111111243.NAA02445@etxb.ericsson.se> > I currently have an active TCP socket which is getting swamped by bursts > of short messages sent by the other end resulting in processor overload. > I would like to introduce flow control to prevent incoming bursts of > data, for which, I understand that I need to change the socket to a > passive mode. > > But I am not sure how to implement the receipt of packets from the > socket. More precisely - what is the difference between an active and > passive socket? How does a passive socket introduce flow control? According to the kernel reference manual pages (gen_tcp) at erlang.org: " Packets sent from the peer will be delivered as messages {tcp, Socket, Data} " and " recv(Socket, Length) -> {ok, Packet} | {error, Reason} This function receives a packet from a socket in passive mode. " So, active sockets sends messages to the process that are recived with 'receive', as any other message. Passive sockets do not send messages, instead one has to call gen_tcp:recv/2 (or 3) to get the data. > What is the purpose of the length parameter in the function call > > gen_tcp:recv(sock, length). > > i.e. how is the length related to the receive buffer of TCP " The Length argument is only meaningful when the socket is in raw mode and denotes number of bytes to read. " There is no connection between length and the receive buffer of TCP. (perhaps you would like to explain what you mean by "the receive buffer of TCP" since that might change my answer :-) > So far the only difference in behavior I have seen is that the active > socket reads every message it receives and sends it to the application, > while a passive socket requires the user to read the socket. I am > assuming that reading of the socket at intervals rather than > continuously introduces flow control. Correct. > If my above assumption is correct - how frequent should the read be to > introduce an optimum flow control mechanism? How many bytes do we read > at a time? Does the length parameter control the size of the receive > buffer/advertised receiver window? How much of additional flow control > do we achieve by using the timeout parameter in gen_tcp:recv/3 The optimum flow control depends upon the application. Do you have any data about yours? You should read as many bytes as you want/need. There is no connection between Length and "receive buffer/advertised receiver window". The latter exist in the OS kernel (unless you have a micro-kernel) and a user process can not change them. Some OSs even need a re-compile to change them. > Can I have two different processes interacting with the passive socket > - one process reads the socket in a loop while the other sends to the > socket? I was thinking about this to free the process which would > otherwise be tied to the receive loop. This would work. Have you considered a gen_tcp:recv process that sends suitably tailored messages to a send/receive process? > Would this beat the whole purpose > of the passive socket? No. > What are the default values of the send/receive buffer in OTP? I > understand that these are set by the OS and are also configurable when > we define the socket parameters but if this is not defined by the user > does OTP override the OS defaults (possibly?) No idea (but why should OTP do such a thing?). > I am sorry about the long list of questions but I have used all > resources I could find and have come to a dead end. Hopefully the > experts on this list can help me out:)) Since no experts answered I thought I would give it a try instead. > Also - Is there any documentation which explains in detail the > implementation of sockets in OTP (other than the man pages). Especially > how flow control and congestion control is implemented. Flow control in TCP is best explained by Stevens in his TCP/IP books (book number 1 for this question). Perhaps you are interested in TCP/IP implementation and not TCP/IP usage? Erlang uses TCP/IP in gen_tcp, it does not implemet it. That is left to the OS. bengt From per@REDACTED Sun Nov 11 21:23:00 2001 From: per@REDACTED (per@REDACTED) Date: Sun, 11 Nov 2001 21:23:00 +0100 Subject: erlsnoop patch Message-ID: <3BEEDE24.2EA6C86F@synapse.se> Hi Gordon, Thanks for erlsnoop, funky stuff. Attached is a small patch to build without warnings under RH 7.1 / gcc 3.0.2. Use "patch -p1 show_timestamps) { - show_time(&pkt->ph.ts); + show_time((struct timeval *)&pkt->ph.ts); } show_sr(stream,len); --- erlsnoop-1.0/erlsnoop.c Mon Oct 29 16:22:30 2001 +++ erlsnoop-1.0.per/erlsnoop.c Sun Nov 11 20:48:45 2001 @@ -215,6 +215,7 @@ static void cancel(int signo) { fprintf(conf->out,"\n"); + pcap_close(conf->pcap); done = 1; } --- erlsnoop-1.0/ip.c Wed Aug 1 17:46:33 2001 +++ erlsnoop-1.0.per/ip.c Sun Nov 11 20:54:53 2001 @@ -74,6 +74,8 @@ #endif default: + break; + } return 0; --- erlsnoop-1.0/Makefile Mon Oct 29 15:53:07 2001 +++ erlsnoop-1.0.per/Makefile Sun Nov 11 20:24:13 2001 @@ -1,5 +1,5 @@ CC=gcc -CFLAGS=-O2 -Wall -ggdb +CFLAGS=-O2 -Wall -ggdb -I/usr/include/pcap OSNAME=$(shell uname -s) --- erlsnoop-1.0/utils.c Mon Oct 29 16:18:12 2001 +++ erlsnoop-1.0.per/utils.c Sun Nov 11 20:55:46 2001 @@ -11,6 +11,10 @@ #include #endif +#ifdef LINUX +#include +#endif + #include #include "erlsnoop.h" From Sean.Hinde@REDACTED Sun Nov 11 23:25:53 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Sun, 11 Nov 2001 22:25:53 -0000 Subject: Feature Requests Message-ID: <402DD461F109D411977E0008C791C312039F6593@IMP02MBX> > On Fri, 9 Nov 2001, Sean Hinde wrote: > > >STDLIB: > >Supervisors with option of delay between restarts > > I assume that you feel that it's insufficient to insert a sleep > in the worker's init function? I can think of two reasons: > > (1) the process doesn't know if it's the first start or a > subsequent one, and > > (2) you'd like the delay to occur before the process is actually > spawned and (most likely) registered. > > (1) above should definitely be solved. Not being able to tell the > difference between a normal start and a looping restart means > that restart escalation seldomly works effectively. If you want > (2), I'm curious to hear your justification. (: Err, now you mention it sleeping in init would probably do most of the job :) Though it would, as you say, be better to be able to distinguish restarts from startup. Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From earlyriser@REDACTED Mon Nov 12 00:48:11 2001 From: earlyriser@REDACTED (Sean Hinde) Date: Sun, 11 Nov 2001 23:48:11 +0000 Subject: Compiling R8B under OS X Message-ID: <90B7EB7B-D6FE-11D5-A143-003065B27BB6@mac.com> Hi, I have made some little progress in compiling R8B on my G4 Mac.. changing the lines around 1712 of sys/unix/sys.c to read: > /* Interface function available to driver writers */ > int driver_select(this_port, fd, mode, on) > ErlDrvPort this_port; > ErlDrvEvent fd; > int mode, on; > { gets beam to compile, but I bomb out at: > cc -g -O2 > -I/Users/sean/Desktop/otp_src_R8B-0/erts/powerpc-apple-darwin1.4 > -no-cpp-precomp -Wall -O2 -DDEBUG_DIST -I. -DHAVE_CONFIG_H > -DUSE_DNS -DEPMD_PORT=4369 -c erl_malloc.c -o > /Users/sean/Desktop/otp_src_R8B-0/lib/erl_interface/obj/powerpc-apple-darwin1. > 4/erl_malloc.o > /var/tmp/ccIXdaaa.s:278:Expected comma after segment-name > /var/tmp/ccIXdaaa.s:278:Rest of line ignored. 1st junk character valued > 46 (.). > /var/tmp/ccIXdaaa.s:278:Spurious digit 0. > /var/tmp/ccIXdaaa.s:278:Spurious digit 6. > /var/tmp/ccIXdaaa.s:278:Rest of line ignored. 1st junk character valued > 57 (9). > /var/tmp/ccIXdaaa.s:278:Junk character 40 ((). > /var/tmp/ccIXdaaa.s:278:Rest of line ignored. 1st junk character valued > 48 (0). > make[4]: *** > [/Users/sean/Desktop/otp_src_R8B-0/lib/erl_interface/obj/powerpc-apple-darwin1. > 4/erl_malloc.o] Error 1 > make[3]: *** [opt] Error 2 > make[2]: *** [opt] Error 2 > make[1]: *** [opt] Error 2 > make: *** [libs] Error 2 This is way too heavy for me! Any suggestions anyone? Sean From raimo@REDACTED Mon Nov 12 10:00:48 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Mon, 12 Nov 2001 10:00:48 +0100 Subject: Questions regarding TCP sockets References: <3BEC13F0.3DD43A85@am1.ericsson.se> Message-ID: <3BEF8FC0.7410B72E@erix.ericsson.se> Shafia Kausar wrote: > > Hi, > > I currently have an active TCP socket which is getting swamped by bursts > of short messages sent by the other end resulting in processor overload. > I would like to introduce flow control to prevent incoming bursts of > data, for which, I understand that I need to change the socket to a > passive mode. > > But I am not sure how to implement the receipt of packets from the > socket. More precisely - what is the difference between an active and > passive socket? How does a passive socket introduce flow control? > TCP has got flow control between nodes, so if you create a socket connection and starts sending data in at one end, not reading at the other, the send operations will start to block. A gen_tcp active socket automatically reads data from the socket if there is any available, which might eventually fill the Erlang process receive message queue, if the process does not handle the data fast enough. A gen_tcp passive socket does not read any data from the socket other then when gen_tcp:recv/2 is called, which might fill the TCP internal buffers at both ends and eventually start blocking process doing the gen_tcp:send/2 calls (or corresponding, it does not have to be an Erlang implementation at the other end). This is generally what you want to happen. > What is the purpose of the length parameter in the function call > > gen_tcp:recv(sock, length). > > i.e. how is the length related to the receive buffer of TCP > The 'length' argument becomes the buffer length for the 'recv' system call (unix), and does not relate to TCP's internal receive buffers. The data returned by the call is often less. > So far the only difference in behavior I have seen is that the active > socket reads every message it receives and sends it to the application, > while a passive socket requires the user to read the socket. I am > assuming that reading of the socket at intervals rather than > continuously introduces flow control. > Even if you read continously you will probably not choke the Erlang node by an exploding process message receive queue. > If my above assumption is correct - how frequent should the read be to > introduce an optimum flow control mechanism? How many bytes do we read > at a time? Does the length parameter control the size of the receive > buffer/advertised receiver window? How much of additional flow control > do we achieve by using the timeout parameter in gen_tcp:recv/3 > Very application dependant. The timeout parametar is only needed when you do not need flow control, i.e when you have to wait for incoming data. > Can I have two different processes interacting with the passive socket > - one process reads the socket in a loop while the other sends to the > socket? I was thinking about this to free the process which would > otherwise be tied to the receive loop. Would this beat the whole purpose > of the passive socket? > You can also try the '{active, once}' option. This would only read one message automatically from the socket, not having to get stuck in a gen_tcp:recv/2 call. When you are ready for another message just call inet:setopts(Socket, [{active, once}]), and you will get more data when it arrives. > What are the default values of the send/receive buffer in OTP? I > understand that these are set by the OS and are also configurable when > we define the socket parameters but if this is not defined by the user > does OTP override the OS defaults (possibly?) > I can dig this up if really necessary. / Raimo Niskane, Erlang/OTP, Ericsson UAB From tobbe@REDACTED Mon Nov 12 10:20:58 2001 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 12 Nov 2001 10:20:58 +0100 Subject: R8B and BTT 3.1 In-Reply-To: shrogers@ionet.net's message of "Fri, 9 Nov 2001 02:31:13 GMT" References: <200111090231.UAA03910@ionet.net> Message-ID: > Can anyone tell me if BTT 3.1 is compatible with Erlang/OTP R8B? Yes. Cheers /Tobbe From eedtag@REDACTED Mon Nov 12 13:29:17 2001 From: eedtag@REDACTED (Tanja Godau) Date: Mon, 12 Nov 2001 13:29:17 +0100 (MET) Subject: What is << >> ? Message-ID: <200111121229.NAA13326@granus41.eed.ericsson.se> Hello Erlang Experts, Could someone please explain to me the purpose of <<>> and how of use it? As seen for example in: => io:format(" global code:END (of attribute) from ~p~n",[<>]), ^^ ^^ or => case catch receive_data(Socket,Timeout,Method,<<>>) of ^^^^ Thankyou Tanja Tanja Tanja Godau Software Designer Ericsson Eurolab Deutschland GmbH Verification Tool Design Tel: +49 2407 575 310 Fax: +49 2407 575 651 Dect:+49 2407 575 89427 mailto:Tanja.Godau@REDACTED From etxuwig@REDACTED Mon Nov 12 13:38:43 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Mon, 12 Nov 2001 13:38:43 +0100 (MET) Subject: What is << >> ? In-Reply-To: <200111121229.NAA13326@granus41.eed.ericsson.se> Message-ID: << and >> are used for the "Bit Syntax", which allows for constructing binaries and matching binary patterns. http://www.erlang.org/doc/r8b/doc/extensions/bit_syntax.html The following example from the documentation illustrates how the bit syntax can be used in e.g. protocol programming -- in this case doing pattern matching directly on an incoming IP datagram. -define(IP_VERSION, 4). -define(IP_MIN_HDR_LEN, 5). DgramSize = size(Dgram), case Dgram of <> when HLen >= 5, 4*HLen =< DgramSize -> OptsLen = 4*(HLen - ?IP_MIN_HDR_LEN), <> = RestDgram, ... end. /Uffe On Mon, 12 Nov 2001, Tanja Godau wrote: >Hello Erlang Experts, > >Could someone please explain to me the purpose of <<>> and how >of use it? > >As seen for example in: > >=> io:format(" global code:END (of attribute) from > ~p~n",[<>]), > ^^ ^^ >or > >=> case catch receive_data(Socket,Timeout,Method,<<>>) of > ^^^^ >>Thankyou > >Tanja -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From francesco@REDACTED Tue Nov 13 11:26:13 2001 From: francesco@REDACTED (Francesco Cesarini) Date: Tue, 13 Nov 2001 10:26:13 GMT Subject: Sequential trace in match specification problems.. Message-ID: <1005647173.284francesco@home.se> Hello everyone, I am having problems with sequential tokens. (For those of you who have never used them, take a look at them as it is an excellent addition to the trace capabilities which came out with R7). I have been getting problems/strange behaviours when I try to set tokens in the shell. The major problem, however, seems to set trace tokens with match specifications. The match specification is triggered, (I have printed stuff out, valid trace tokens included), but the trace tokens are not associated with the tokens. sequence:start() spawns three processes, and registers them. When process a receieves a start message, it sends a message to b and c, which in turn send a message to a. sequence:start_tracer() receives messages and prints them out. I have played around with the syntax, but to no avail. Nor have I found any documentatins on restrictions. Help anyone? Thanks! Francesco -- 2> sequential:start_tracer(). false 3> dbg:p(new, [c,m]). {ok,[{matched,0}]} 4> (<0.37.0>) <0.20.0> ! {io_request,<0.37.0>, <0.20.0>, {get_until, {format,"~w> ",[4]}, erl_scan, tokens, [1]}} 4> sequential:start(). (<0.37.0>) << {io_reply,<0.20.0>, {ok,[{atom,1,sequential}, {':',1}, {atom,1,start}, {'(',1}, {')',1}, {dot,1}], 2}} (<0.37.0>) << timeout true 5> (<0.42.0>) <0.20.0> ! {io_request,<0.42.0>, <0.20.0>, {get_until, {format,"~w> ",[5]}, erl_scan, tokens, [1]}} 5> a ! start. (<0.42.0>) << {io_reply,<0.20.0>, {ok,[{atom,1,a},{'!',1}, {atom,1,start},{dot,1}],2}} (<0.42.0>) << timeout start (<0.41.0>) << start 6> (<0.41.0>) b ! start 6> (<0.40.0>) << start 6> (<0.40.0>) c ! init 6> (<0.39.0>) << init 6> (<0.40.0>) d ! init 6> (<0.38.0>) << init 6> (<0.39.0>) a ! ok 6> (<0.41.0>) << ok 6> (<0.38.0>) a ! ok 6> (<0.41.0>) << ok 6> (<0.43.0>) <0.20.0> ! {io_request,<0.43.0>, <0.20.0>, {get_until, {format,"~w> ",[6]}, erl_scan, tokens, [1]}} 6> From eedtag@REDACTED Tue Nov 13 14:28:11 2001 From: eedtag@REDACTED (Tanja Godau) Date: Tue, 13 Nov 2001 14:28:11 +0100 (MET) Subject: sowaputils-0.1.1 Message-ID: <200111131328.OAA14479@granus41.eed.ericsson.se> Hello Erlang Enthusiasts, Does anybody know of documentation relating to the HTTP/1.1 client contained in sowaputils-0.1.1? (part of the SO WAP! project) Has anyone got examples of how to work with the HTTP/1.1 element of this module? yours sincerely Tanja Godau Tanja Godau Software Designer Ericsson Eurolab Deutschland GmbH Verification Tool Design Tel: +49 2407 575 310 Fax: +49 2407 575 651 Dect:+49 2407 575 89427 mailto:Tanja.Godau@REDACTED From Chandrashekhar.Mullaparthi@REDACTED Tue Nov 13 14:32:25 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Tue, 13 Nov 2001 13:32:25 -0000 Subject: help with CosNaming Message-ID: <402DD461F109D411977E0008C791C31205E06281@IMP02MBX> I'm experimenting with Orber/CORBA and need some help with the NameService. I've compiled the example and run it successfully. Now I'm trying to run the stack_client from another erlang node. This is where the problems begin. 1> NS = corba:resolve_initial_references_remote("NameService", ["iiop://tiger:4001"]). works fine, though from a Windows client this call crashes the very first time and then works fine after that. 2> 'CosNaming_NamingContext':list(NS, 10). returns {ok, [], BindingIterator}. But if I execute the same command on the node where the orb is running, I get 5> {ok,[{'CosNaming_Binding',[{'CosNaming_NameComponent',"StackFactory",[]}], nobject}], BindingIterator}. The documentation for CosNaming_NamingContext:bind/3 says: "Creates a binding of a name and an object in the naming context. Naming contexts that are bound using bind() do not participate in name resolution." I don't understand this. How does one bind a name to an object which can be resolved? Can someone please give me a version of the stack example which will work across nodes?? cheers, Chandru NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Chandrashekhar.Mullaparthi@REDACTED Tue Nov 13 14:45:26 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Tue, 13 Nov 2001 13:45:26 -0000 Subject: sowaputils-0.1.1 Message-ID: <402DD461F109D411977E0008C791C31205E06282@IMP02MBX> Read the source!!! I expanded on the comments in the source code after using this. %%request_sync(Method, HTTPReq) %%Method = atom. get/put/post etc. %%HTTPReq = {URL, Headers, ContentType, Body} | {Url, Headers} %% URL = string %% Headers = [{Key, Value} | ...] %% Key = atom | list %% Value = list %% ContentType = list %% Body = list %%request_sync(Method, HTTPReq, Settings) %%Settings = [Setting] %% Setting = timeout | {timeout, Val} %% Val = integer %% If only timeout is specified, the default value of 5000 ms is used. %%request(Ref, Method, HTTPCont, Timeout) %%Ref = any erlang term %%Timeout = integer %% Spawns a process for each HTTP request and sends caller the message: %% {Ref,{Status,Headers,ContentType,Body}} %% whenever the reply comes back from the HTTP server 7> http:request_sync(get, {"http://bruce:4567/index.html", []}). {ok,{200, [{date,"Tue, 13 Nov 2001 13:41:07 GMT"}, {server,"inets/2.5.6"}, {connection,"close"}, {'last-modified',"Fri, 27 Jul 2001 14:10:27 GMT"}, {'content-length',"202"}], "text/html", "\n \n Welcome SMS - O&M\n \n \n \n\t\n\ t\n \n\n"}} It does have support for using a proxy server but I didn't need it so didn't bother digging around. In the Headers field - you can include {Key,Value} pairs for accessing password protected pages by specifying {"Authorization", "Basic: "}. cheers, Chandru > -----Original Message----- > From: Tanja Godau [mailto:eedtag@REDACTED] > Sent: 13 November 2001 13:28 > To: erlang-questions@REDACTED > Cc: eedtag@REDACTED > Subject: sowaputils-0.1.1 > > > Hello Erlang Enthusiasts, > > Does anybody know of documentation relating > to the HTTP/1.1 client contained in sowaputils-0.1.1? > (part of the SO WAP! project) > > Has anyone got examples of how to work with the HTTP/1.1 > element of this module? > > yours sincerely > Tanja Godau > > > Tanja Godau > Software Designer > Ericsson Eurolab Deutschland GmbH > Verification Tool Design > > Tel: +49 2407 575 310 > Fax: +49 2407 575 651 > Dect:+49 2407 575 89427 > mailto:Tanja.Godau@REDACTED > > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Sean.Hinde@REDACTED Tue Nov 13 15:00:18 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 13 Nov 2001 14:00:18 -0000 Subject: sowaputils-0.1.1 Message-ID: <402DD461F109D411977E0008C791C312039F65AF@IMP02MBX> I was having a brief play with this the other day. You can use it something like: http:request_sync(get, {"http://www.erlang.org", []}). to just grab a web page. The other options are useful if you want to post data to the web server or set up other HTTP headers. It is nicely written so some time spent reading the source will reveal much more I'm sure. Rgds, Sean > -----Original Message----- > From: Tanja Godau [mailto:eedtag@REDACTED] > Sent: 13 November 2001 13:28 > To: erlang-questions@REDACTED > Cc: eedtag@REDACTED > Subject: sowaputils-0.1.1 > > > Hello Erlang Enthusiasts, > > Does anybody know of documentation relating > to the HTTP/1.1 client contained in sowaputils-0.1.1? > (part of the SO WAP! project) > > Has anyone got examples of how to work with the HTTP/1.1 > element of this module? > > yours sincerely > Tanja Godau > > > Tanja Godau > Software Designer > Ericsson Eurolab Deutschland GmbH > Verification Tool Design > > Tel: +49 2407 575 310 > Fax: +49 2407 575 651 > Dect:+49 2407 575 89427 > mailto:Tanja.Godau@REDACTED > > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From francesco@REDACTED Tue Nov 13 15:01:06 2001 From: francesco@REDACTED (Francesco Cesarini) Date: Tue, 13 Nov 2001 14:01:06 +0000 Subject: Sequential trace in match specification problems.. References: <1005647173.284francesco@home.se> Message-ID: <3BF127A2.D65186AA@erlang-consulting.com> For those interested, the strange behaviour of the seq_trace in the shell (and in my example) was because of all the internal io messages between the shell and its group leader which were resetting the trace tokens. Using dbg:p(new, [c]) does not reset the token. Another (and obvious solution) is to set the token internally in process a once the initial message has been received. (It might be worth putting a note of the io disturbances in the shell in the documentation.) Thanks everyone. Francesco Francesco Cesarini wrote: > Hello everyone, > I am having problems with sequential tokens. (For those of > you who have never used them, take a look at them as it is > an excellent addition to the trace capabilities which came > out with R7). I have been getting problems/strange > behaviours when I try to set tokens in the shell. The major > problem, however, seems to set trace tokens with match > specifications. The match specification is triggered, (I > have printed stuff out, valid trace tokens included), but > the trace tokens are not associated with the tokens. > > sequence:start() spawns three processes, and registers > them. When process a receieves a start message, it sends a > message to b and c, which in turn send a message to a. > sequence:start_tracer() receives messages and prints them > out. I have played around with the syntax, but to no avail. > Nor have I found any documentatins on restrictions. Help > anyone? > > Thanks! > Francesco > > -- > 2> sequential:start_tracer(). > false > 3> dbg:p(new, [c,m]). > {ok,[{matched,0}]} > 4> (<0.37.0>) <0.20.0> ! {io_request,<0.37.0>, > <0.20.0>, > {get_until, > {format,"~w> ",[4]}, > erl_scan, > tokens, > [1]}} > 4> sequential:start(). > (<0.37.0>) << {io_reply,<0.20.0>, > {ok,[{atom,1,sequential}, > {':',1}, > {atom,1,start}, > {'(',1}, > {')',1}, > {dot,1}], > 2}} > (<0.37.0>) << timeout > true > 5> (<0.42.0>) <0.20.0> ! {io_request,<0.42.0>, > <0.20.0>, > {get_until, > {format,"~w> ",[5]}, > erl_scan, > tokens, > [1]}} > 5> a ! start. > (<0.42.0>) << {io_reply,<0.20.0>, > {ok,[{atom,1,a},{'!',1}, > {atom,1,start},{dot,1}],2}} > (<0.42.0>) << timeout > start > (<0.41.0>) << start > 6> (<0.41.0>) b ! start > 6> (<0.40.0>) << start > 6> (<0.40.0>) c ! init > 6> (<0.39.0>) << init > 6> (<0.40.0>) d ! init > 6> (<0.38.0>) << init > 6> (<0.39.0>) a ! ok > 6> (<0.41.0>) << ok > 6> (<0.38.0>) a ! ok > 6> (<0.41.0>) << ok > 6> (<0.43.0>) <0.20.0> ! {io_request,<0.43.0>, > <0.20.0>, > {get_until, > {format,"~w> ",[6]}, > erl_scan, > tokens, > [1]}} > 6> -- http://www.erlang-consulting.com From nick@REDACTED Tue Nov 13 15:13:19 2001 From: nick@REDACTED (Niclas Eklund) Date: Tue, 13 Nov 2001 15:13:19 +0100 (MET) Subject: help with CosNaming In-Reply-To: <402DD461F109D411977E0008C791C31205E06281@IMP02MBX> Message-ID: Hello! The most probable reason why it fails is that the two Orber-ORB's use the same domain-name (default it is "ORBER"). Easily checked by invoking on both ORB's: erl> orber:info(). Hopefully you are using the latest ORB (at least a R7B-ORB). If so you should use the Interoperable Name Service, especially since it's compatible with other ORB's supporting the same standard (see '9.1.5 Writing a Client in Java' and '7.3 Interoperable Naming Service' in the Orber User's Guide). A few examples, let's start with accessing objects directly from the NameService: "Full version": corba:string_to_object("corbaname:iiop:1.2@REDACTED:4001/NameService#StackFactory"). "Short hand": corba:string_to_object("corbaname::tiger:4001/#StackFactory"). Default is iiop-protocol, IIOP-1.0 and "NameService". But, to be on the safe side I guess it's better to use the full version. If you want to access the local NameService you can write: corba:string_to_object("corbaname:rir:/NameService#StackFactory"). Naturally you can supply a longer path (assuming that the 'kind'-field in the NameComponent == ""; see '7.3.3 corbaname' in the User's Guide): corba:string_to_object("corbaname::tiger:4001/#org/erlang/StackFactory"). You can also just lookup the NameService reference: corba:string_to_object("corbaloc:iiop:1.2@REDACTED:4001/NameService"). Currently Orber only allows "NameService" as key. See also CosNaming_NamingContextExt in the reference manual. Also explore the features which the configuration parameters 'orbInitRef' and 'orbDefaultInitRef' supplies ('5.2 Configuration' in the User's Guide). /Nick On Tue, 13 Nov 2001, Chandrashekhar Mullaparthi wrote: > I'm experimenting with Orber/CORBA and need some help with the NameService. > > I've compiled the example and run it successfully. Now I'm trying to run the > stack_client from another erlang node. This is where the problems begin. > > 1> NS = corba:resolve_initial_references_remote("NameService", > ["iiop://tiger:4001"]). > > works fine, though from a Windows client this call crashes the very first > time and then works fine after that. > > 2> 'CosNaming_NamingContext':list(NS, 10). > returns > {ok, [], BindingIterator}. > > But if I execute the same command on the node where the orb is running, I > get > 5> > {ok,[{'CosNaming_Binding',[{'CosNaming_NameComponent',"StackFactory",[]}], > nobject}], BindingIterator}. > > The documentation for CosNaming_NamingContext:bind/3 says: > > "Creates a binding of a name and an object in the naming context. Naming > contexts that are bound using bind() do not participate in name resolution." > > I don't understand this. How does one bind a name to an object which can be > resolved? Can someone please give me a version of the stack example which > will work across nodes?? > > cheers, > Chandru From cpressey@REDACTED Tue Nov 13 22:52:29 2001 From: cpressey@REDACTED (Chris Pressey) Date: Tue, 13 Nov 2001 15:52:29 -0600 Subject: I/O from binaries and an I/O behaviour In-Reply-To: <200111080956.fA89uEu01306@erik.virding.org> References: <20011105175002.791df0d7.cpressey@catseye.mb.ca> <200111080956.fA89uEu01306@erik.virding.org> Message-ID: <20011113155229.1e5ba96d.cpressey@catseye.mb.ca> On Thu, 08 Nov 2001 10:56:14 +0100 Robert Virding wrote: > Chris Pressey writes: > >On Mon, 5 Nov 2001 08:17:24 +0100 (MET) > > > >I'll go one step further, and ask: is there any reason both the io > >module > >and the bin_io module shouldn't both adhere to an 'io' behaviour? > >[...] > > No, real reason. I did look into to it many years ago, long before > behaviours in fact, and found that it wasn't trivial. The problem is > that such a generic server would need to define a generic way of > getting bytes from and putting bytes to some device. Some devices, > like files and binaries, work best with an synchronous call method > while others like terminals work best with a completely asynchronous > method. > > Another complication is that for things like terminals you really need > to be able to interlace input and output requests in a sensible way, > like the terminal does now. > > The best way I then found was to define a simple generic synchronous > io server which uses defined get and put handlers. Other more > complicated devices like terminals would then need a separate process > to do their tricky bits. This went against the current trend, > however, towards fewer processes as the BEAM is not really efficient > in sending lists (unified heap rules). > > Actually the basic io protocol is pretty simple so I have not really > felt the need to be great. I will look into it, however, when I get > the time. Perhaps I/O isn't the best example, and the word 'behaviour' is perhaps misleading. There are several other examples in the standard libraries of modules which can and do expose the same 'interface' - dict and orddict, for example. What I'm getting at is probably closer to this suggestion from the programming guidelines: "3.9 [...] a consistent system where different modules do things in a similar manner will be much easier to understand than a system where each module does things in a different manner." One way for modules to do things in a similar manner is for these modules to share an interface. I see interfaces as a subset of behaviours. A behaviour specifies common functionality, plus callback points. An interface just specifies callback points *without* providing any common functionality. behaviour_info/1 gives Erlang an automated way to check that a module adheres to an interface. Without it, we resort to manually documenting the interface, for example from the docs for Tobbe's epop: "CHANGING DATABASE If another database or mail storage facility is going to be used together with the epop server, then it has to export the following functions: start/0, get_passwd/1, stat/1, scan_list/1, get_mail/2, lock_maildrop/1, unlock_maildrop/1, delete_mail/3], add_user/2, rm_user/1, change_passwd/2, msg_limit/2, store_mail/3." This "contract between modules" could be expressed in Erlang like so: -module(gen_epop_db_interface). -export([behaviour_info/1]). behaviour_info(callbacks) -> [ {start,0}, {get_passwd,1}, {stat,1}, {scan_list,1}, {get_mail,2}, {lock_maildrop,1}, {unlock_maildrop,1}, {delete_mail,3}, {add_user,2}, {rm_user,1}, {change_passwd,2}, {msg_limit,2}, {store_mail,3} ]. I like the Erlang version better because it's tighter. The compiler and other applications know about the interface, not just the programmer, so it's less error-prone. Chris From vances@REDACTED Tue Nov 13 23:13:45 2001 From: vances@REDACTED (Vance Shipley) Date: Tue, 13 Nov 2001 17:13:45 -0500 Subject: ErlMessage emsg; emsg.type == 0 Message-ID: I'm having trouble with erl_interface on R8B. I'm porting some code written with the erl_interface library, not ei standalone. The examples in the tutorial don't work either. cnode_s.c: ErlMessage emsg; /* Incoming message */ ... got = erl_receive_msg(fd, buf, BUFSIZE, &emsg); if (got == ERL_TICK) { /* ignore */ } else if (got == ERL_ERROR) { loop = 0; } else { if (emsg.type == ERL_REG_SEND) { ... <----- *** NOT REACHED *** } } In all cases (emsg.type == 0). If you ignore this there is in fact a valid message there, the rest of the structure has been filled in approriately, as far as I can tell. typedef struct { int type; ETERM *msg; ETERM *to; ETERM *from; char to_name[MAXREGLEN]; } ErlMessage; -Vance Vance Shipley Motivity Telecom Inc. +1 519 579 5816 From raimo@REDACTED Wed Nov 14 08:52:51 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Wed, 14 Nov 2001 08:52:51 +0100 Subject: Sequential trace in match specification problems.. References: <1005647173.284francesco@home.se>, <3BF127A2.D65186AA@erlang-consulting.com> Message-ID: <3BF222D3.91DABC99@erix.ericsson.se> For those interested, this strange behaviour of seq_trace extends to all code where a message is received from a port, e.g when the shell receives from the ttsl driver, or if you do a file operation, or even worse when some code is not loaded and the code server does a file operation for you. It is in most cases possible to do workarounds. We are nevertheless planning a patch that makes messages received from ports not resetting the trace token, in contrast to all other received messages (that resets the trace token). No promises yet, the consequenses of such a patch might be undesired. / Raimo Niskanen, Erlang/OTP, Ericsson UAB Francesco Cesarini wrote: > > For those interested, the strange behaviour of the seq_trace in the > shell (and in my example) was because of all the internal io messages > between the shell and its group leader which were resetting the trace > tokens. Using dbg:p(new, [c]) does not reset the token. Another (and > obvious solution) is to set the token internally in process a once the > initial message has been received. (It might be worth putting a note of > the io disturbances in the shell in the documentation.) > > Thanks everyone. > > Francesco > > Francesco Cesarini wrote: > > > Hello everyone, > > I am having problems with sequential tokens. (For those of > > you who have never used them, take a look at them as it is > > an excellent addition to the trace capabilities which came > > out with R7). I have been getting problems/strange > > behaviours when I try to set tokens in the shell. The major > > problem, however, seems to set trace tokens with match > > specifications. The match specification is triggered, (I > > have printed stuff out, valid trace tokens included), but > > the trace tokens are not associated with the tokens. > > > > sequence:start() spawns three processes, and registers > > them. When process a receieves a start message, it sends a > > message to b and c, which in turn send a message to a. > > sequence:start_tracer() receives messages and prints them > > out. I have played around with the syntax, but to no avail. > > Nor have I found any documentatins on restrictions. Help > > anyone? > > > > Thanks! > > Francesco > > > > -- > > 2> sequential:start_tracer(). > > false > > 3> dbg:p(new, [c,m]). > > {ok,[{matched,0}]} > > 4> (<0.37.0>) <0.20.0> ! {io_request,<0.37.0>, > > <0.20.0>, > > {get_until, > > {format,"~w> ",[4]}, > > erl_scan, > > tokens, > > [1]}} > > 4> sequential:start(). > > (<0.37.0>) << {io_reply,<0.20.0>, > > {ok,[{atom,1,sequential}, > > {':',1}, > > {atom,1,start}, > > {'(',1}, > > {')',1}, > > {dot,1}], > > 2}} > > (<0.37.0>) << timeout > > true > > 5> (<0.42.0>) <0.20.0> ! {io_request,<0.42.0>, > > <0.20.0>, > > {get_until, > > {format,"~w> ",[5]}, > > erl_scan, > > tokens, > > [1]}} > > 5> a ! start. > > (<0.42.0>) << {io_reply,<0.20.0>, > > {ok,[{atom,1,a},{'!',1}, > > {atom,1,start},{dot,1}],2}} > > (<0.42.0>) << timeout > > start > > (<0.41.0>) << start > > 6> (<0.41.0>) b ! start > > 6> (<0.40.0>) << start > > 6> (<0.40.0>) c ! init > > 6> (<0.39.0>) << init > > 6> (<0.40.0>) d ! init > > 6> (<0.38.0>) << init > > 6> (<0.39.0>) a ! ok > > 6> (<0.41.0>) << ok > > 6> (<0.38.0>) a ! ok > > 6> (<0.41.0>) << ok > > 6> (<0.43.0>) <0.20.0> ! {io_request,<0.43.0>, > > <0.20.0>, > > {get_until, > > {format,"~w> ",[6]}, > > erl_scan, > > tokens, > > [1]}} > > 6> > > -- > http://www.erlang-consulting.com From bjarne@REDACTED Wed Nov 14 09:17:34 2001 From: bjarne@REDACTED (Bjarne =?iso-8859-1?Q?D=E4cker?=) Date: Wed, 14 Nov 2001 09:17:34 +0100 Subject: CFP: EUROMICRO Real-Time Conference, Vienna, Austria, June 2002 Message-ID: <3BF2289E.57E456E3@erix.ericsson.se> -------------- next part -------------- An embedded message was scrubbed... From: em-rt-info-admin@REDACTED Subject: [Em-rt-info] CFP: EUROMICRO Real-Time Conference, Vienna, Austria, June 2002 Date: Tue, 13 Nov 2001 21:59:06 +0100 Size: 9962 URL: From garry@REDACTED Wed Nov 14 19:00:18 2001 From: garry@REDACTED (Garry Hodgson) Date: Wed, 14 Nov 2001 13:00:18 -0500 Subject: how do i read data from a unix command? References: Message-ID: <3BF2B132.5F58DBBF@sage.att.com> is there a way i can read the output of a unix command using something akin to the file:read() functions? i'd like to open a pipe and get back a file that i can do reads from. something like: { ok, FP } = file:open( File, read ) file:read( FP, ?BUFSIZE ) i know about os:cmd(), but that reads the whole thing at once, and the files i'm reading are way too big for that. thanks -- Garry Hodgson One way or another Senior Hacker One way or another Software Innovation Services One way or another AT&T Labs This darkness got to give... garry@REDACTED From garry@REDACTED Wed Nov 14 19:20:28 2001 From: garry@REDACTED (Garry Hodgson) Date: Wed, 14 Nov 2001 13:20:28 -0500 Subject: problem opening file Message-ID: <3BF2B5EC.1277449E@sage.att.com> i'm seeing something weird trying to open a file for reading. i've gt two files in a directory, same permissions, differing by size (and content, of course): $ ls -l *.zone -rw-rw-r-- 1 garry sage 2561435180 Nov 14 13:04 com.zone -rw-rw-r-- 1 garry sage 323447644 Nov 9 11:45 org.zone when i try to open the files, the smaller one works, the larger fails: $ erl Erlang (BEAM) emulator version 5.0.2.4 [source] Eshell V5.0.2.4 (abort with ^G) 1> file:open( "org.zone", read ). {ok,<0.29.0>} 2> file:open( "com.zone", read ). {error,unknown} anybody know why? -- Garry Hodgson One way or another Senior Hacker One way or another Software Innovation Services One way or another AT&T Labs This darkness got to give... garry@REDACTED From garry@REDACTED Wed Nov 14 20:42:55 2001 From: garry@REDACTED (Garry Hodgson) Date: Wed, 14 Nov 2001 14:42:55 -0500 Subject: defining functions in startup file Message-ID: <3BF2C93F.A18D721D@sage.att.com> i'd like to define some simple functions to use while working in the erlang interpreter, like one to edit a module, given its name, and things like that. at the prompt, i can manually type something like: E = fun( Module ) -> os:cmd( "fred " ++ atom_to_list( Module ) ++ ".erl" ) end. and then use: E( foo ). to edit "foo.erl". a small convenience. but if i put the above in my .erlang file, i can't use it once erlang's started. how do i make this work, or is there a better mechanism for customizing my environment? thanks -- Garry Hodgson One way or another Senior Hacker One way or another Software Innovation Services One way or another AT&T Labs This darkness got to give... garry@REDACTED From happi@REDACTED Wed Nov 14 20:57:01 2001 From: happi@REDACTED (Happi) Date: Wed, 14 Nov 2001 20:57:01 +0100 Subject: defining functions in startup file References: <3BF2C93F.A18D721D@sage.att.com> Message-ID: <001101c16d46$87409720$c90b0a0a@LISA> Yes there is a better way of customizing your environment, quoting the documentation of shell_default: http://www.erlang.org/doc/r7b/lib/stdlib-1.9.1/doc/html/application_frame.ht ml To add your own commands to the shell, create a module called user_default and add the commands you want. Then add the following line as the first line in your .erlang file in your home directory. code:load_abs("$PATH/user_default"). /Erik org: Eric Conspiracy Secret Laboratories I'm Happi, you should be happy! ----- Original Message ----- From: "Garry Hodgson" To: "Erlang" Sent: Wednesday, November 14, 2001 8:42 PM Subject: defining functions in startup file > > i'd like to define some simple functions to use while working in > the erlang interpreter, like one to edit a module, given its name, > and things like that. > > at the prompt, i can manually type something like: > > E = fun( Module ) -> > os:cmd( "fred " ++ atom_to_list( Module ) ++ ".erl" ) > end. > > and then use: > > E( foo ). > > to edit "foo.erl". a small convenience. > but if i put the above in my .erlang file, i can't use it once > erlang's started. how do i make this work, or is there a better > mechanism for customizing my environment? > > thanks > > -- > Garry Hodgson One way or another > Senior Hacker One way or another > Software Innovation Services One way or another > AT&T Labs This darkness got to give... > garry@REDACTED > From luke@REDACTED Wed Nov 14 20:53:42 2001 From: luke@REDACTED (Luke Gorrie) Date: 14 Nov 2001 20:53:42 +0100 Subject: how do i read data from a unix command? In-Reply-To: <3BF2B132.5F58DBBF@sage.att.com> References: <3BF2B132.5F58DBBF@sage.att.com> Message-ID: Garry Hodgson writes: > is there a way i can read the output of a unix command using something > akin to the file:read() functions? i'd like to open a pipe and get back > a file > that i can do reads from. something like: > > { ok, FP } = file:open( File, read ) > file:read( FP, ?BUFSIZE ) > > i know about os:cmd(), but that reads the whole thing at once, > and the files i'm reading are way too big for that. Not exactly what you want, but you can use the spawn driver (see 'erlang' module docs for details). e.g.: 7> open_port({spawn, "echo Hello, world"}, [eof]). #Port<0.10> 8> flush(). Shell got {#Port<0.10>,{data,"Hello, world\n"}} Shell got {#Port<0.10>,eof} ok 9> It will send you messages incrementally as output is generated, but as far as I know you can only receive them async and there is no flow control available. But this could be added to sys.c :-) Cheers, Luke From eleberg@REDACTED Thu Nov 15 07:55:01 2001 From: eleberg@REDACTED (Bengt Kleberg) Date: Thu, 15 Nov 2001 07:55:01 +0100 (MET) Subject: problem opening file Message-ID: <200111150655.HAA06217@etxb.ericsson.se> > Date: Wed, 14 Nov 2001 13:20:28 -0500 > From: Garry Hodgson ...deleted > i've gt two files in a directory, same permissions, differing > by size (and content, of course): > > $ ls -l *.zone > -rw-rw-r-- 1 garry sage 2561435180 Nov 14 13:04 com.zone > -rw-rw-r-- 1 garry sage 323447644 Nov 9 11:45 org.zone > > when i try to open the files, the smaller one works, the larger fails: ...deleted > anybody know why? There is nothing in the documentation (apart from the mentioning that Erlang is 32-bit only), but com.zone is larger than 2^31 (2 GB), which used to be 'too large' in the old days. Unless somebody that knows steps in and really explain I conjecture that Erlang uses 31 bit filesizes and you have to split the file before opening it/them. Or use the FFI and have a C program deliver it in pieces. bengt From raimo@REDACTED Thu Nov 15 12:04:08 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Thu, 15 Nov 2001 12:04:08 +0100 Subject: problem opening file References: <200111150655.HAA06217@etxb.ericsson.se> Message-ID: <3BF3A128.6BC491B2@erix.ericsson.se> Bengt Kleberg wrote: > > > Date: Wed, 14 Nov 2001 13:20:28 -0500 > > From: Garry Hodgson > > ...deleted > > > i've gt two files in a directory, same permissions, differing > > by size (and content, of course): > > > > $ ls -l *.zone > > -rw-rw-r-- 1 garry sage 2561435180 Nov 14 13:04 com.zone > > -rw-rw-r-- 1 garry sage 323447644 Nov 9 11:45 org.zone > > > > when i try to open the files, the smaller one works, the larger fails: > > ...deleted > > > anybody know why? > > There is nothing in the documentation (apart from the mentioning that > Erlang is 32-bit only), but com.zone is larger than 2^31 (2 GB), which > used to be 'too large' in the old days. > Unless somebody that knows steps in and really explain I conjecture > that Erlang uses 31 bit filesizes and you have to split the file before > opening it/them. Or use the FFI and have a C program deliver it in pieces. > > bengt That is correct. Erlang cannot handle "large" files i.e 2^31 bytes or more. We are planning to fix it in R9 if we get the time. The error code 'unknown' could perhaps be patched earlier. / Raimo Niskanen, Erlang/OTP, Ericsson UAB From mbj@REDACTED Fri Nov 16 00:02:01 2001 From: mbj@REDACTED (Martin Bjorklund) Date: Fri, 16 Nov 2001 00:02:01 +0100 (CET) Subject: joe's SAE for R8B-0 Message-ID: <20011116.000201.59672837.mbj@bluetail.com> Hi, Has anybody tried to run joe's SAE on R8B-0 on Linux? When I try this, following joe's instructions, ecc hangs when making the examples. Any idea, anyone? /martin From dsolaz@REDACTED Sat Nov 17 03:39:55 2001 From: dsolaz@REDACTED (Daniel Solaz) Date: Sat, 17 Nov 2001 03:39:55 +0100 Subject: fix required for HTML docs? Message-ID: <200111170536.fAH5a1812740@obelix.cmp.es> I'm one of those guys that prefer to have colors "upside down": white foreground, dark background (easier on the eyes etc etc) obviously this is very uncommon since lots of things that look wrong when you turn colors upside down would have been fixed otherwise for example, the Erlang/OTP HTML documentation all pages have BODY tags that set the background color to white but do not define text and link colors, so browser settings are applied producing white text on white background to better understand me (or to understand me at all) see http://www.lepidoptero.com/erlang/snapshot.png the Internet is full of pages that suffer from this defect; as a matter of fact, my own pages did lack full color definition before I swapped colors, too, simply because I hadn't even thought about it the HTML docs are terrific but this flaw is very annoying, so can I request that it be fixed in the next release? thanks in advance -- d s o l a z @ L E P I D O P T E R O . C O M From rprice@REDACTED Sun Nov 18 02:20:06 2001 From: rprice@REDACTED (Roger Price) Date: Sat, 17 Nov 2001 23:20:06 -0200 (GMT+2) Subject: fix required for HTML docs? In-Reply-To: <200111170536.fAH5a1812740@obelix.cmp.es> Message-ID: On Sat, 17 Nov 2001, Daniel Solaz wrote: > I'm one of those guys that prefer to have colors "upside down"... > ..., the Erlang/OTP HTML documentation ... all pages have BODY tags > that set the background color to white but do not define text and link > colors, so browser settings are applied producing white text on white > background The frames in the Erlang documentation currently have body declarations of the form: The correct solution is to remove all cosmetic markup, e.g. elements such as
and , and attributes such as BGCOLOR="#FFFFFF", from the source HTML. The style for the entire documentation could then be specified with one single CSS style sheet. Daniel could change the style sheet locally to get his "upside down" effect, and many others with special needs could also be satisfied. See the W3C Web Accessibility Initiative http://www.w3c.org/WAI/ Using this technique, I control the style of over 100 Mbyte of electronic proceedings of the ACM Multimedia SIG using one small file. See http://woodworm.cs.uml.edu/~rprice/ep/index.html It also helps to check HTML pages using the free service at http://validator.w3.org. It is amazing how much HTML out there is broken. Roger Price From vances@REDACTED Sun Nov 18 00:03:36 2001 From: vances@REDACTED (Vance Shipley) Date: Sat, 17 Nov 2001 18:03:36 -0500 Subject: fix required for HTML docs? In-Reply-To: Message-ID: While we're on about the html, since R8B-0 the toc.html page (which is the frame to the left with the list of sections) has been screwed up for me on my browser (MSIE v5.5). The reason for this seems to be the line-height tag: P { font-family: Verdana, Arial, Helvetica, sans-serif; line-height : 13px } ^^^^^^^^^^^^^^^^^^^^ Removing the indicated section above fixes the problem. My browser seems to have chosen a font which is larger than 13 pixels and thus the lines are overlapped. It is hard to read but also I have to click on the line above the section I actually want. -Vance From joe.armstrong@REDACTED Sun Nov 18 13:50:38 2001 From: joe.armstrong@REDACTED (Joe Armstrong) Date: Sun, 18 Nov 2001 13:50:38 +0100 Subject: joe's SAE for R8B-0 References: <20011116.000201.59672837.mbj@bluetail.com> Message-ID: <3BF7AE9E.1060100@telia.com> Very strange, It works for me :-) Dubugging sae is a little tricky since you can't use any of the standard tools - the best way to find out what's going in is to uncomment the %% erlang:display(...) lines in fake_demand_code.erl etc. and run everything again then you should be able to see where things go wrong. /Joe Martin Bjorklund wrote: >Hi, > >Has anybody tried to run joe's SAE on R8B-0 on Linux? When I try >this, following joe's instructions, ecc hangs when making the >examples. Any idea, anyone? > > >/martin > From hal@REDACTED Mon Nov 19 04:54:40 2001 From: hal@REDACTED (Hal Snyder) Date: 18 Nov 2001 21:54:40 -0600 Subject: OTP R8B emacs mode compile hangs In-Reply-To: (Kent Boortz's message of "04 Sep 2001 01:09:33 +0200") Message-ID: <87r8qvza7z.fsf_-_@cb293842-b.rmdws1.il.home.com> Has anyone seen this - edit foo.erl in Emacs hit C-c C-k to compile ... sit there for 60 seconds, compile times out ... This is with GNU Emacs 21.1.1, R8B release, NetBSD-1.5.2. (BTW paths in .emacs and such have been edited for NetBSD file placement.) Problem is that in inferior-erlang-wait-prompt, line 5245, (beginning-of-line) seems to execute in shell mode, going to the beginning of the line after the prompt instead of to left margin. Changing it to (forward-line 0) fixes the problem. Seems erlang shell mode changed beginning-of-line, or something. Talk about side effects. Elisp ain't Erlang. (EAE) :-0 From vindhyachalsharma@REDACTED Mon Nov 19 08:38:42 2001 From: vindhyachalsharma@REDACTED (vindhyachal sharma) Date: Sun, 18 Nov 2001 23:38:42 -0800 (PST) Subject: Download URL Message-ID: <20011119073842.53005.qmail@web12307.mail.yahoo.com> Dear sir, I want to Download Open Source Erlang 47.4.1 and patch but I don't Know the exact URL Please tell me the Exact URL. Thanks --------------------------------- Do You Yahoo!? Find the one for you at Yahoo! Personals. -------------- next part -------------- An HTML attachment was scrubbed... URL: From christen@REDACTED Mon Nov 19 08:40:08 2001 From: christen@REDACTED (Niels Christensen) Date: Sun, 18 Nov 2001 23:40:08 -0800 (PST) Subject: regexp:first_match Message-ID: Reading the documentation for regexp, I am surprised that 2> regexp:first_match("22-03-03","<.+>"). {match,1,21} 3> I should have thought (and wanted!) the result to be {match,1,6} Anyone know why not? Niels Christensen From rtr@REDACTED Mon Nov 19 13:33:46 2001 From: rtr@REDACTED (Robert Raschke) Date: Mon, 19 Nov 2001 12:33:46 +0000 Subject: regexp:first_match In-Reply-To: Message from Niels Christensen of "Sun, 18 Nov 2001 23:40:08 PST." Message-ID: <3664.1006173226@quadstone.com> Hi, I don't know much about the regexp module in Erlang, but in general all (?) regexp packages try and match the longest sequence. Try regexp:first_match("22-03-03","<[^<]+>"). instead. Robby On Sun, 18 Nov 2001 around 23:40, you wrote: > Reading the documentation for regexp, I am surprised that > > 2> regexp:first_match("22-03-03","<.+>"). > {match,1,21} > 3> > > I should have thought (and wanted!) the result to be > > {match,1,6} > > Anyone know why not? > > Niels Christensen From nico.weling@REDACTED Mon Nov 19 13:37:25 2001 From: nico.weling@REDACTED (Nico Weling) Date: Mon, 19 Nov 2001 13:37:25 +0100 Subject: Problem with dict:new() Message-ID: <3BF8FD05.F4240221@eed.ericsson.se> Hi all, after upgrading to Erlang R8B I've got a lot of badmatch errors due to the 'new' dict module. How is it possible to use the new release without changing my own programms? Eshell V4.9.1 (abort with ^G) 1> D0 = dict:new(). [] Eshell V5.1 (abort with ^G) 1> D0 = dict:new(). {dict,0, 16, 16, 8, 80, 48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}} Thanks in advance, regards Nico. From eleberg@REDACTED Mon Nov 19 13:41:23 2001 From: eleberg@REDACTED (Bengt Kleberg) Date: Mon, 19 Nov 2001 13:41:23 +0100 (MET) Subject: regexp:first_match Message-ID: <200111191241.NAA14058@etxb.ericsson.se> > To: Niels Christensen > cc: erlang-questions@REDACTED > Subject: Re: regexp:first_match > Date: Mon, 19 Nov 2001 12:33:46 +0000 > From: Robert Raschke > > Hi, > > I don't know much about the regexp module in Erlang, but in general > all (?) regexp packages try and match the longest sequence. Try According to the documentation regexp:match() will get thet longest match, exactly as you state. regexp:first_match() is documented as only matching the first match (which should be the one Niels Christensen wanted). bengt From luke@REDACTED Mon Nov 19 13:57:08 2001 From: luke@REDACTED (Luke Gorrie) Date: 19 Nov 2001 13:57:08 +0100 Subject: OTP R8B emacs mode compile hangs In-Reply-To: <87r8qvza7z.fsf_-_@cb293842-b.rmdws1.il.home.com> References: <87r8qvza7z.fsf_-_@cb293842-b.rmdws1.il.home.com> Message-ID: Hal Snyder writes: > Has anyone seen this - > edit foo.erl in Emacs > hit C-c C-k to compile > ... sit there for 60 seconds, compile times out ... > > This is with GNU Emacs 21.1.1, R8B release, NetBSD-1.5.2. > (BTW paths in .emacs and such have been edited for NetBSD file > placement.) > > Problem is that in inferior-erlang-wait-prompt, line 5245, > (beginning-of-line) > seems to execute in shell mode, going to the beginning of the line > after the prompt instead of to left margin. Changing it to > (forward-line 0) > fixes the problem. > > Seems erlang shell mode changed beginning-of-line, or something. > Talk about side effects. Elisp ain't Erlang. (EAE) :-0 Problem is that emacs 21 has some mechinism called "fields" which messes things up. I _suspect_ the idea is to let you be inside a text field or in front of a prompt etc, and for all the normal commands move you around inside the "field" without taking you out of it. So beginning-of-line just goes back to the beginnig of the "field". It's very annoying :-) -Luke From Chandrashekhar.Mullaparthi@REDACTED Mon Nov 19 13:55:34 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Mon, 19 Nov 2001 12:55:34 -0000 Subject: Bit syntax change Message-ID: <402DD461F109D411977E0008C791C31205E062B0@IMP02MBX> I have you noticed this change in behaviour. R7B: 16> <> = <<1,2>>. ** exited: {{badmatch,<<1,2>>},[{erl_eval,expr,3}]} ** R8B: 30> <> = <<1,2>>. <<1,2>> 31> A. 0 32> ARest. {[0,0,0,0,0,0,1], 7, <<2>>} 33> Not reflected anywhere in the documentation. cheers, Chandru NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From sam@REDACTED Mon Nov 19 14:01:30 2001 From: sam@REDACTED (Samuel Tardieu) Date: Mon, 19 Nov 2001 14:01:30 +0100 Subject: Problem with dict:new() In-Reply-To: <3BF8FD05.F4240221@eed.ericsson.se> References: <3BF8FD05.F4240221@eed.ericsson.se> Message-ID: <2001-11-19-14-01-30+trackit+sam@rfc1149.net> On 19/11, Nico Weling wrote: | after upgrading to Erlang R8B I've got a lot of badmatch errors due to the | 'new' dict module. This is your fault :) You should not have assumed anything about the structure of a dict object. | How is it possible to use the new release without changing my own programms? You can't. However, you can rewrite some parts of your code (this should not represent many lines) to use only functions from the dict module when manipulating dictionaries. This way, your new code will work fine with both the old and the new Erlang version. Sam From bjorn@REDACTED Mon Nov 19 14:03:25 2001 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 19 Nov 2001 14:03:25 +0100 Subject: Bit syntax change In-Reply-To: Chandrashekhar Mullaparthi 's message of "Mon, 19 Nov 2001 12:55:34 -0000" References: <402DD461F109D411977E0008C791C31205E062B0@IMP02MBX> Message-ID: This is a bug in the erl_eval module, which is used to evaluate expressions written in the shell. In coompiled code you would get an badmatch. /Bjorn Chandrashekhar Mullaparthi writes: > I have you noticed this change in behaviour. > > R7B: > > 16> <> = <<1,2>>. > ** exited: {{badmatch,<<1,2>>},[{erl_eval,expr,3}]} ** > > R8B: > > 30> <> = <<1,2>>. > <<1,2>> > 31> A. > 0 > 32> ARest. > {[0,0,0,0,0,0,1], > 7, > <<2>>} > 33> > > Not reflected anywhere in the documentation. > > cheers, > Chandru -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From bjorn@REDACTED Mon Nov 19 14:08:04 2001 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 19 Nov 2001 14:08:04 +0100 Subject: Problem with dict:new() In-Reply-To: Nico Weling's message of "Mon, 19 Nov 2001 13:37:25 +0100" References: <3BF8FD05.F4240221@eed.ericsson.se> Message-ID: dict was changed already in R7B. Use the orddict module instead of dict. The orddict module is guaranteed to be implemented as a list. /Bjorn Nico Weling writes: > after upgrading to Erlang R8B I've got a lot of badmatch errors due to the 'new' dict module. > > How is it possible to use the new release without changing my own programms? > > > Eshell V4.9.1 (abort with ^G) > 1> D0 = dict:new(). > [] > > > Eshell V5.1 (abort with ^G) > 1> D0 = dict:new(). > {dict,0, > 16, > 16, > 8, > 80, > 48, > {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, > {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}} > > > Thanks in advance, > > regards Nico. > -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From Sean.Hinde@REDACTED Mon Nov 19 14:16:36 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 19 Nov 2001 13:16:36 -0000 Subject: Problem with dict:new() Message-ID: <402DD461F109D411977E0008C791C312039F65D8@IMP02MBX> In the source (though undocumented) there appears to be a dict:size/1 function which would allow you to match an empty dict. Apart from that I wouldn't have thought it was generally good form to rely on the internal representation of an abstract data type.. Rgds, Sean > -----Original Message----- > From: Nico Weling [mailto:nico.weling@REDACTED] > Sent: 19 November 2001 12:37 > To: erlang-questions@REDACTED > Subject: Problem with dict:new() > > > Hi all, > > after upgrading to Erlang R8B I've got a lot of badmatch > errors due to the 'new' dict module. > > How is it possible to use the new release without changing my > own programms? > > > Eshell V4.9.1 (abort with ^G) > 1> D0 = dict:new(). > [] > > > Eshell V5.1 (abort with ^G) > 1> D0 = dict:new(). > {dict,0, > 16, > 16, > 8, > 80, > 48, > {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, > {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}} > > > Thanks in advance, > > regards Nico. > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From kent@REDACTED Mon Nov 19 15:30:24 2001 From: kent@REDACTED (Kent Boortz) Date: 19 Nov 2001 15:30:24 +0100 Subject: fix required for HTML docs? In-Reply-To: Daniel Solaz's message of "Sat, 17 Nov 2001 03:39:55 +0100" References: <200111170536.fAH5a1812740@obelix.cmp.es> Message-ID: Daniel Solaz writes: > all pages have BODY tags that set the background color to white but do > not define text and link colors, so browser settings are applied > producing white text on white background > > to better understand me (or to understand me at all) see > http://www.lepidoptero.com/erlang/snapshot.png > > the Internet is full of pages that suffer from this defect; as a matter > of fact, my own pages did lack full color definition before I swapped > colors, too, simply because I hadn't even thought about it > > the HTML docs are terrific but this flaw is very annoying, so can I > request that it be fixed in the next release? This is now noted in our internal bug tracking system. (I never understood why some page generating software insist generating the link color definitions. Now I know.) On Sat, 17 Nov 2001 Roger Price wrote: > The correct solution is to remove all cosmetic markup, e.g. elements such > as
and , and attributes such as BGCOLOR="#FFFFFF", from > the source HTML. The style for the entire documentation could then be > specified with one single CSS style sheet. Daniel could change the style > sheet locally to get his "upside down" effect, and many others with > special needs could also be satisfied. See the W3C Web Accessibility > Initiative http://www.w3c.org/WAI/ > > Using this technique, I control the style of over 100 Mbyte of electronic > proceedings of the ACM Multimedia SIG using one small file. See > http://woodworm.cs.uml.edu/~rprice/ep/index.html I want to use CSS but don't find it that easy. The browsers all have various bugs that makes it hard to define the layout with CSS. See http://css.nu/pointers/bugs.html I will look into how easy it would be to change the DocBuilder program to add "class" directives and remove the FONT tags. Maybe you could help creating a usable CSS definition file? On Sat, 17 Nov 2001 Vance Shipley wrote: > While we're on about the html, since R8B-0 the toc.html page > (which is the frame to the left with the list of sections) > has been screwed up for me on my browser (MSIE v5.5). The > reason for this seems to be the line-height tag: > > P { font-family: Verdana, Arial, Helvetica, sans-serif; line-height : > 13px } > ^^^^^^^^^^^^^^^^^^^^ > Removing the indicated section above fixes the problem. I added line-height to avoid vertical scrolling for most users. This bug was found before the release but the fix got lost somehow. This is now noted in our internal bug tracking system and will be corrected. kent From hal@REDACTED Mon Nov 19 16:11:40 2001 From: hal@REDACTED (Hal Snyder) Date: 19 Nov 2001 09:11:40 -0600 Subject: fix required for HTML docs? In-Reply-To: (Kent Boortz's message of "19 Nov 2001 15:30:24 +0100") References: <200111170536.fAH5a1812740@obelix.cmp.es> Message-ID: <87bshyztg3.fsf@cb293842-b.rmdws1.il.home.com> Kent Boortz writes: > This is now noted in our internal bug tracking system. Is there an *external* bug tracking system (yet)? :-) Just wondering, per previous thread, if there is a way for open source users to submit patches and see whether our work was accepted by Erlang Central, besides this list. From kent@REDACTED Mon Nov 19 16:46:34 2001 From: kent@REDACTED (Kent Boortz) Date: 19 Nov 2001 16:46:34 +0100 Subject: fix required for HTML docs? In-Reply-To: Hal Snyder's message of "19 Nov 2001 09:11:40 -0600" References: <200111170536.fAH5a1812740@obelix.cmp.es> <87bshyztg3.fsf@cb293842-b.rmdws1.il.home.com> Message-ID: > Kent Boortz writes: > > This is now noted in our internal bug tracking system. > > Is there an *external* bug tracking system (yet)? :-) Sorry no. And I don't know if and when. We administer a support tracking system for the commercial support requests, an internal bug tracking system and monitor this list. I don't think we have the man power or time at the moment to handle another system in a good way. For various reasons we can't just open up our internal systems for public access. > Just wondering, per previous thread, if there is a way for open source > users to submit patches and see whether our work was accepted by > Erlang Central, besides this list. Maybe not what you want as feedback but we will soon begin releasing snapshots where you can se if they where accepted or not. kent From erikp@REDACTED Mon Nov 19 20:05:18 2001 From: erikp@REDACTED (Erik Pearson) Date: Mon, 19 Nov 2001 11:05:18 -0800 Subject: regexp:first_match Message-ID: <5B2DD696D569D41194E700B0D0498D797E3E77@ctsmail1.celtech.com> I think the documentation could be made much clearer. My experience is that regexp:match selects the longest match when the match can start at *different* positions in the string. Keep in mind, a match at any given position is *always* the longest match. In Niels' case, 2> regexp:first_match("22-03-03","<.+>"). There are two matches in the string: {match,1,21} {match,15,7} But because of greediness there is no match for the first 6 characters; they're consumed in the first match case. To see the difference with match and first_match, try adding an optional pattern to differentiate the longest from the first match. 1> regexp:match("12123", "123?"). {match,3,3} 2> regexp:first_match("12123", "123?"). {match,1,2} --erikp-- -----Original Message----- From: Bengt Kleberg [mailto:eleberg@REDACTED] Subject: Re: regexp:first_match According to the documentation regexp:match() will get thet longest match, exactly as you state. regexp:first_match() is documented as only matching the first match (which should be the one Niels Christensen wanted). bengt From christen@REDACTED Mon Nov 19 20:19:38 2001 From: christen@REDACTED (Niels Christensen) Date: Mon, 19 Nov 2001 11:19:38 -0800 (PST) Subject: regexp:first_match In-Reply-To: <200111191241.NAA14058@etxb.ericsson.se> Message-ID: > According to the documentation > regexp:match() > will get thet longest match, exactly as you state. > > regexp:first_match() > is documented as only matching the first match (which should be the one Niels > Christensen wanted). It is a bit subtle. The somewhat unclear formulation might be supposed to mean "find the first place you can start matching, then match the longest possible sequence starting from there" which is not the "first, longest" matching (because "longest" in the context of regexp:match probably means globally longest (?)). However, first_match is not even consistently greedy. When using the expression "<.+>" in a long SGML file, it sometimes matches just one tag, sometimes matches across several, but not the whole file (as it could have). I cannot find a simple example to illustrate the behaviour, but it seems to prefer ending its match at newlines. Niels From happi@REDACTED Mon Nov 19 21:55:36 2001 From: happi@REDACTED (Happi) Date: Mon, 19 Nov 2001 21:55:36 +0100 Subject: regexp:first_match References: Message-ID: <003701c1713c$8acf4360$c90b0a0a@LISA> ----- Original Message ----- From: "Niels Christensen" [...] > However, first_match is not even consistently greedy. > When using the expression "<.+>" in a long SGML file, > it sometimes matches just one tag, sometimes matches across several, > but not the whole file (as it could have). > I cannot find a simple example to illustrate the behaviour, > but it seems to prefer ending its match at newlines. There seem to be a bug in the manual for regexp, it states that: . matches any character. but in fact "." matches any character but "\n". (Which is the usual definition for "." in regular expression.) >From the source: reg4([$.|S]) -> {{comp_class,"\n"},S}; "." is treated as the complement of "\n" /Erik From Erik.Reitsma@REDACTED Tue Nov 20 15:16:14 2001 From: Erik.Reitsma@REDACTED (Erik Reitsma (ELN)) Date: Tue, 20 Nov 2001 15:16:14 +0100 Subject: Erlang and SOAP Message-ID: Hi all, I am trying to get SOAP to work with Erlang. I have found the idx-esoap package, but it requires xmerl 0.11, which then needs to be patched. I could not get esoap to work with xmerl 0.15 (the current version), at least the test gave an error and no result. I tried to apply the patch manually, but that did not work either. Does anybody know whether idx-esoap should work with xmerl 0.15? Or does anyody have xmerl 0.11 somewhere? Or an xmerl version that works with idx-esoap 0.1.0 (latest version as far as I know)? Any other suggestions? *Erik. From dsolaz@REDACTED Tue Nov 20 15:15:17 2001 From: dsolaz@REDACTED (Daniel Solaz) Date: Tue, 20 Nov 2001 15:15:17 +0100 Subject: fix required for HTML docs? In-Reply-To: References: <200111170536.fAH5a1812740@obelix.cmp.es> Message-ID: <200111201545.fAKFj2L10676@obelix.cmp.es> On Monday 19 November 2001 15:30 Kent Boortz wrote: > I want to use CSS but don't find it that easy. The browsers all have > various bugs that makes it hard to define the layout with CSS. See > http://css.nu/pointers/bugs.html Well, I don't know much about CSS layout, only use CSS for text styling. In my experience there are two ways to work around these bugs: - keep CSS usage as simple as possible - ditch defective browsers The first point may not hold if you're an "artist". However we're talking about technical documentation. I don't see complex layout effects in the Erlang HTML pages. The second one may not be fair for those Solaris users than only have Netscape (currently the most defective browser) around. > I will look into how easy it would be to change the DocBuilder program > to add "class" directives and remove the FONT tags. Maybe you could > help creating a usable CSS definition file? I'd suggest defining classes for every component of the HTML page (big title, small title, function, code snippet, caveat, etc), and hacking the doc generator to add these. Then you could go adding class attributes to your CSS as you see fit. For an R7 documentation page with FONT tags turned into SPAN tags (simple text substitution) and upside-down coloring see: http://www.lepidoptero.com/erlang/otpmain.html -- d s o l a z @ L E P I D O P T E R O . C O M From qtxfklr@REDACTED Tue Nov 20 15:44:23 2001 From: qtxfklr@REDACTED (Fredrik Linder) Date: Tue, 20 Nov 2001 15:44:23 +0100 Subject: Catch Message-ID: <3BFA6C47.40C8F610@tn.etx.ericsson.se> Hi At the Erlang Workshop in Florence did a discussion about separating code for normal execution from code for exception(al?) execution take place. Now I am wondering what the Erlang community think about a proposal that came up. The proposal is to extend where a catch might be placed. Note that the current use of catches could still be valid. Proposal: case of NormalMatch1 -> blabla; NormalMatch2 -> blabla catch {'EXIT', Reason} -> blabla; ExceptionMatch2 -> blabla end If this feels like a good way of doing it, then maybe also extend this to receive statements: receive NormalMatch -> blabla after Time -> blabla catch {'EXIT', Pid, Reason} -> blabla; SignalMatch -> blabla end By introducing an 'EXIT' record could this be extended further: -record('EXIT', {pid, reason}). recieve|case of NormalMatch -> blabla catch #'EXIT'{} -> blabla; #'EXIT'{pid = Pid} -> % In a case statement is Pid == self() blabla; #'EXIT'{reason = Reason} -> blabla end The last suggestion could be implemented as syntactical suger (I guess). /Fredrik From jabba@REDACTED Tue Nov 20 16:11:43 2001 From: jabba@REDACTED (Jani Launonen) Date: Tue, 20 Nov 2001 17:11:43 +0200 (EET) Subject: fix required for HTML docs? Message-ID: <200111201511.fAKFBh826548@ee.oulu.fi> [cut a lot] >The second one may not be fair for those Solaris users than only have >Netscape (currently the most defective browser) around. I've been using Opera 5B1 for Solaris/Sparc for quite long time now (well, at least over a month :-) ) and it naturally works really nicely. I don't have that much use for Netscape any longer. One can found it from www.opera.no and mirrors (listed at download page). >-- >d s o l a z @ L E P I D O P T E R O . C O M > -+-+-+- Jani Launonen From lennart.ohman@REDACTED Tue Nov 20 16:16:05 2001 From: lennart.ohman@REDACTED (Lennart =?iso-8859-1?Q?=D6hman?=) Date: Tue, 20 Nov 2001 16:16:05 +0100 Subject: Catch References: <3BFA6C47.40C8F610@tn.etx.ericsson.se> Message-ID: <3BFA73B5.B9A3356@st.se> Hi Fredrik and all other, my personal experience is that the real problem is not syntactical. (Well it is in some way since catch has two meanings...) It is so called catch-and-throw-driven-programs. Programs where a throw is placed very far away from its (many) matching catches. The problem accelerates from the fact that if a lot of code is encapsulated in a catch-and-throw, there are many potential errors which will then by accident be caught in the catch (corresponding to the throw). /Lennart Fredrik Linder wrote: > > Hi > > At the Erlang Workshop in Florence did a discussion about separating > code for normal execution from code for exception(al?) execution take > place. > > Now I am wondering what the Erlang community think about a proposal that > came up. > > The proposal is to extend where a catch might be placed. Note that the > current use of catches could still be valid. > > Proposal: > > case of > NormalMatch1 -> > blabla; > NormalMatch2 -> > blabla > catch > {'EXIT', Reason} -> > blabla; > ExceptionMatch2 -> > blabla > end > > If this feels like a good way of doing it, then maybe also extend this > to receive statements: > > receive > NormalMatch -> > blabla > after > Time -> > blabla > catch > {'EXIT', Pid, Reason} -> > blabla; > SignalMatch -> > blabla > end > > By introducing an 'EXIT' record could this be extended further: > > -record('EXIT', {pid, reason}). > > recieve|case of > NormalMatch -> > blabla > catch > #'EXIT'{} -> > blabla; > #'EXIT'{pid = Pid} -> % In a case statement is Pid == self() > blabla; > #'EXIT'{reason = Reason} -> > blabla > end > > The last suggestion could be implemented as syntactical suger (I guess). > > /Fredrik -- ------------------------------------------------------------- Lennart Ohman phone : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 6735 Sehlstedtsgatan 6 fax : +46-8-667 8230 SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED From fredrik.linder@REDACTED Tue Nov 20 20:53:22 2001 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Tue, 20 Nov 2001 20:53:22 +0100 Subject: Catch References: <3BFA6C47.40C8F610@tn.etx.ericsson.se> Message-ID: <003701c171fd$02f28f80$d72511c2@frelin> Hi all I forgot to mension why this proposal came up in the first place! In core-erlang do they have a try-statement, and hence would it be attractive to have it also in erlang, so that the compiler would not have to catch everything everytime, but only those exceptions that are explicitly matched. It was my impression that this could slightly speed up the compiled code, or at least simplify translation between erlang and core-erlang. To be able to do so must erlang define a way to differentiate between normal excecution code and exception execution code, and this is not possible in current erlang. With the given proposal could differentiation between normal execution code and exception execution code be made without having to introduce a new statement. An [erlang:]throw/0 could also be introduced to re-throw the current exception, when caught. The last part would also unify the syntax between recieve and case statements. Is it totally wrong to see signals as exceptions between processes? /Fredrik ----- Original Message ----- From: "Fredrik Linder" To: Sent: Tuesday, November 20, 2001 3:44 PM Subject: Catch > Hi > > At the Erlang Workshop in Florence did a discussion about separating > code for normal execution from code for exception(al?) execution take > place. > > Now I am wondering what the Erlang community think about a proposal that > came up. > > The proposal is to extend where a catch might be placed. Note that the > current use of catches could still be valid. > > Proposal: > > case of > NormalMatch1 -> > blabla; > NormalMatch2 -> > blabla > catch > {'EXIT', Reason} -> > blabla; > ExceptionMatch2 -> > blabla > end > > If this feels like a good way of doing it, then maybe also extend this > to receive statements: > > receive > NormalMatch -> > blabla > after > Time -> > blabla > catch > {'EXIT', Pid, Reason} -> > blabla; > SignalMatch -> > blabla > end > > By introducing an 'EXIT' record could this be extended further: > > -record('EXIT', {pid, reason}). > > recieve|case of > NormalMatch -> > blabla > catch > #'EXIT'{} -> > blabla; > #'EXIT'{pid = Pid} -> % In a case statement is Pid == self() > blabla; > #'EXIT'{reason = Reason} -> > blabla > end > > The last suggestion could be implemented as syntactical suger (I guess). > > /Fredrik > From fredrik.linder@REDACTED Tue Nov 20 21:15:16 2001 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Tue, 20 Nov 2001 21:15:16 +0100 Subject: Catch References: <3BFA6C47.40C8F610@tn.etx.ericsson.se> <3BFA73B5.B9A3356@st.se> Message-ID: <003a01c17200$19d5e820$d72511c2@frelin> Hi Lennart and all ----- Original Message ----- From: "Lennart ?hman" > my personal experience is that the real problem is not syntactical. > (Well it is in some way since catch has two meanings...) > It is so called catch-and-throw-driven-programs. Programs where a > throw is placed very far away from its (many) matching catches. Personally I find catch-and-throw programming very clean and good, especially in relation to the alternative - having error-return values. > The problem accelerates from the fact that if a lot of code is > encapsulated in a catch-and-throw, there are many potential errors > which will then by accident be caught in the catch (corresponding > to the throw). I also recognise the problem of having a lot of catch-and-throw encapsulations, however does this problem not arise from the fact that a catch in erlang always catched everything, and there is no way to only catch a particluar exception. One of the benefits of the given proposal is that it would become possible to have such constructs. It would also be possible to have catch-throw encapsulation completely hidden within one module, without any . (By the way, there are far more places to put a throw than a catch in ones code.) Best Regards /Fredrik This construct is probably safe for separating normal execution code from exception execution code, but who programs in this fasion? Ref = make_ref(), case catch case of Match1 -> {Ref, normal_code} end of {Ref, Result} -> Result; Match2 -> exception_code end From mickael.remond@REDACTED Tue Nov 20 21:28:41 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Tue, 20 Nov 2001 21:28:41 +0100 Subject: Erlang and SOAP In-Reply-To: References: Message-ID: <20011120212841.A1238@erlang-fr.org> Erik Reitsma (ELN) (Erik.Reitsma@REDACTED) wrote: > Hi all, > > I am trying to get SOAP to work with Erlang. I have found the idx-esoap package, but it requires xmerl 0.11, which then needs to be patched. > > I could not get esoap to work with xmerl 0.15 (the current version), at least the test gave an error and no result. I tried to apply the patch manually, but that did not work either. > > Does anybody know whether idx-esoap should work with xmerl 0.15? Or does anyody have xmerl 0.11 somewhere? Or an xmerl version that works with idx-esoap 0.1.0 (latest version as far as I know)? Any other suggestions? >From what I remember, the patch is very small (Only one line and can be easily applied to xmerl 0.15). The patch only add a document node, that we found missing in the current implementation. I can send you a ready made prepatched version of xmerl 0.15 if you want to. I am currently rewriting the whole thing from scratch as a module for inets. The new implementation is not yet finished. I still working on it. Sean is also eagerly waiting for it ;-) So I will do my best to package it quickly (My job is taking my days, night and week-end...) Cheers, -- Micka?l R?mond From maurice@REDACTED Tue Nov 20 21:36:50 2001 From: maurice@REDACTED (Maurice Castro) Date: Wed, 21 Nov 2001 07:36:50 +1100 (EST) Subject: Catch In-Reply-To: <003a01c17200$19d5e820$d72511c2@frelin> from Fredrik Linder at "Nov 20, 2001 09:15:16 pm" Message-ID: <200111202036.fAKKaoc27152@parallel.serc.rmit.edu.au> Fredrik writes: > I also recognise the problem of having a lot of catch-and-throw > encapsulations, however does this problem not arise from the fact that a > catch in erlang always catched everything, and there is no way to only catch > a particluar exception. > > One of the benefits of the given proposal is that it would become possible > to have such constructs. It would also be possible to have catch-throw > encapsulation completely hidden within one module, without any . > Personally, I find the fact that catch catches everything to be a desirable feature. This makes the handling of exceptions at a particular catch explicit. When attempting to understand the behaviour of a program which uses exceptions it is particularly desirable that the exceptions not propogate up the call chain. Furthermore, if propogation is required, making it explicit warns the programmer that this is the desired behaviour. Maurice Castro From g-alcolea@REDACTED Wed Nov 21 07:38:12 2001 From: g-alcolea@REDACTED (Gabi) Date: Wed, 21 Nov 2001 07:38:12 +0100 Subject: highlighting source code Message-ID: <5.1.0.14.2.20011120181306.009e5cb0@pop.wanadoo.es> Buenaaas! Someone have the SynEdit Editor profile for Erlang? or a list of reserved words and functions in plain text. Thanks! Gabi. From etxuwig@REDACTED Wed Nov 21 10:14:30 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 21 Nov 2001 10:14:30 +0100 (MET) Subject: highlighting source code In-Reply-To: <5.1.0.14.2.20011120181306.009e5cb0@pop.wanadoo.es> Message-ID: On Wed, 21 Nov 2001, Gabi wrote: >Buenaaas! > >Someone have the SynEdit Editor profile for Erlang? or a list >of reserved words and functions in plain text. I don't know, but one place to start could be $OTP_SRC_ROOT/lib/parsetools/src/esyntax.yrl It contains a grammar for Erlang, and as part of that, a list of terminals for the grammar: Terminals '!' '(' ')' '*' '+' ',' '-' '->' '/' '/=' ':' ';' '<' '=' '=/=' '=:=' '=<' '==' '>' '>=' '[' ']' 'after' 'band' 'begin' 'bnot' 'bor' 'bsl' 'bsr' 'bxor' 'case' 'catch' 'div' 'end' 'if' 'of' 'receive' 'rem' 'when' '{' '|' '}' atom float integer string var. /Uffe -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From martin@REDACTED Wed Nov 21 18:43:29 2001 From: martin@REDACTED (Martin J. Logan) Date: Wed, 21 Nov 2001 11:43:29 -0600 Subject: Reading terms from a file. References: Message-ID: <3BFBE7C1.E2A9FE5F@vailsys.com> Hello, Does anyone have any suggestions on the best way to read erlang terms from a file. I am using io_lib:fread and parsing the data I get. This rather simple meathod has worked well for me in the past because I was only doing simple things with files. I would like to read in complex erlang terms such as those found in the .app and .rel files. The way I do things right now is short but too simple. %% read/2: Reads the commands file %% Arg1: The list of services. %% Arg2: IoDevice - The io device process read([eof|Service], IoDevice) -> Service; read(Service, IoDevice) -> String = io:get_line(IoDevice, ""), Line = normalize(io_lib:fread("~s ~a ~a ~d", String)), read([Line|Service], IoDevice). normalize({ok, Line, LeftOver}) -> ArgList = string:tokens(chop(LeftOver, "\n"), " "), list_to_tuple(lists:append(Line, [ArgList])); normalize({ok, Line}) -> list_to_tuple(lists:append(chop(Line, "\n"), [[]])); normalize(eof) -> eof. This allows me to read the static elements that I have in the beginning of each line and then an abitrary number of leftover elements are put into a list and added to the list of static elements. so I am left with a ["string", atom, atom, digit, [any number of elements]]. This is fine but if I could efficiantly grab erlang terms from the file I could imrove the logic of my application without making it ugly. Thanks, Martin Logan. From happi@REDACTED Wed Nov 21 18:45:32 2001 From: happi@REDACTED (Happi) Date: Wed, 21 Nov 2001 18:45:32 +0100 Subject: Reading terms from a file. References: <3BFBE7C1.E2A9FE5F@vailsys.com> Message-ID: <007101c172b4$5177ccd0$c90b0a0a@LISA> ----- Original Message ----- From: "Martin J. Logan" > Hello, > Does anyone have any suggestions on the best way to read erlang > terms from a file. Why not try file:consult(Filename) Quoting the documentation: Opens file Filename and reads all the Erlang terms in it. Returns one of the following: {ok, TermList} The file was successfully read. {error, Atom} An error occurred when opening the file or reading it. The Atom is a Posix error code. See the description of open/2 for a list of typical error codes. {error, {Line, Mod, Term}} An error occurred when interpreting the Erlang terms in the file. Use the format_error/1 function to convert the three-element tuple to an English description of the error. /Erik > I am using io_lib:fread and parsing the data I get. > This rather simple meathod has worked well for me in the past because I > was only doing simple things with files. I would like to read in > complex erlang terms such as those found in the .app and .rel files. > > The way I do things right now is short but too simple. > > %% read/2: Reads the commands file > %% Arg1: The list of services. > %% Arg2: IoDevice - The io device process > > read([eof|Service], IoDevice) -> > Service; > read(Service, IoDevice) -> > String = io:get_line(IoDevice, ""), > Line = normalize(io_lib:fread("~s ~a ~a ~d", String)), > read([Line|Service], IoDevice). > > normalize({ok, Line, LeftOver}) -> > ArgList = string:tokens(chop(LeftOver, "\n"), " "), > list_to_tuple(lists:append(Line, [ArgList])); > normalize({ok, Line}) -> > list_to_tuple(lists:append(chop(Line, "\n"), [[]])); > normalize(eof) -> > eof. > > This allows me to read the static elements that I have in the beginning > of each line and then an abitrary number of leftover elements are put > into a list and added to the list of static elements. so I am left with > a ["string", atom, atom, digit, [any number of elements]]. This is fine > but if I could efficiantly grab erlang terms from the file I could > imrove the logic of my application without making it ugly. > > > Thanks, > Martin Logan. > > > From etxhste@REDACTED Wed Nov 21 18:45:10 2001 From: etxhste@REDACTED (Hakan Stenholm) Date: Wed, 21 Nov 2001 18:45:10 +0100 (MET) Subject: Reading terms from a file Message-ID: <200111211745.SAA29260@avc240.etxb.ericsson.se> This should do the job: ------------------------------------------------------- file:consult(Filename) Opens file Filename and reads all the Erlang terms in it. Returns one of the following: {ok, TermList} The file was successfully read. {error, Atom} An error occurred when opening the file or reading it. The Atom is a Posix error code. See the description of open/2 for a list of typical error codes. {error, {Line, Mod, Term}} An error occurred when interpreting the Erlang terms in the file. Use the format_error/1 function to convert the three-element tuple to an English description of the error. From vances@REDACTED Wed Nov 21 19:10:28 2001 From: vances@REDACTED (Vance Shipley) Date: Wed, 21 Nov 2001 13:10:28 -0500 Subject: Reading terms from a file. In-Reply-To: <007101c172b4$5177ccd0$c90b0a0a@LISA> Message-ID: > Why not try > file:consult(Filename) That is certainly the definitive answer. We use this to read in our configuration files. It's a simple elegant approach which has the added benefit of consistancy with the native files such as sys.config, appname.app and release.rel. -Vance Vance Shipley Motivity Telecom Inc. +1 519 579 5816 From mickael.remond@REDACTED Thu Nov 22 09:30:47 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Thu, 22 Nov 2001 09:30:47 +0100 Subject: eunit: Unit testing Message-ID: <20011122093047.A9161@erlang-fr.org> Hello, Here is a small tool that I use for my unit testing. http://www.erlang-fr.org/projects/eunit-1.0.tar.gz I release it because I thought it might be useful to someone else. I will improve it in the future. Your suggestions and patches are welcome. Cheers, -- Micka?l R?mond http://www.erlang-fr.org/ From thomas@REDACTED Thu Nov 22 09:53:58 2001 From: thomas@REDACTED (Thomas Arts) Date: Thu, 22 Nov 2001 09:53:58 +0100 Subject: Reading terms from a file. References: <3BFBE7C1.E2A9FE5F@vailsys.com> Message-ID: <3BFCBD26.B3795271@cslab.ericsson.se> The suggestion to read Erlang terms with file:consult is useful, but does not work consistent. Erlang (BEAM) emulator version 5.1 [threads:0] Eshell V5.1 (abort with ^G) 3> {ok,D} = file:open("myterms",[write]). {ok,<0.34.0>} 4> file:write(D,io_lib:format("~w.~n",[{myproc,self()}])). ok 5> file:write(D,io_lib:format("~w.~n",[[1,2,3]])). ok 6> file:close(D). ok 7> file:consult("myterms"). {error,{1,erl_parse,["syntax error before: ",["'<'"]]}} The problem is that the scanner does not recognize process identifiers as such. I am looking myself for a solution to write terms to file in the internal term format, like io:write(Device,Term), but than not in ascii format. I want to write several terms, though. Erlang (BEAM) emulator version 5.1 [threads:0] Eshell V5.1 (abort with ^G) 1> {ok,D} = file:open("myterms",[write]). {ok,<0.30.0>} 2> io:write(D,{myproc,self()}). ok 3> io:write(D,[1,2,3]). ok 4> file:close(D). ok The problem is reading the file. The command io:read is not implemented as the inverse of io:write, which I think is pity. 5> f(D). ok 6> {ok,D} = file:open("myterms",[read]). {ok,<0.36.0>} 7> io:read(D,""). {error,{1,erl_scan,scan}} suggestions? /Thomas "Martin J. Logan" wrote: > > Hello, > Does anyone have any suggestions on the best way to read erlang > terms from a file. I am using io_lib:fread and parsing the data I get. > This rather simple meathod has worked well for me in the past because I > was only doing simple things with files. I would like to read in > complex erlang terms such as those found in the .app and .rel files. > > The way I do things right now is short but too simple. > > %% read/2: Reads the commands file > %% Arg1: The list of services. > %% Arg2: IoDevice - The io device process > > read([eof|Service], IoDevice) -> > Service; > read(Service, IoDevice) -> > String = io:get_line(IoDevice, ""), > Line = normalize(io_lib:fread("~s ~a ~a ~d", String)), > read([Line|Service], IoDevice). > > normalize({ok, Line, LeftOver}) -> > ArgList = string:tokens(chop(LeftOver, "\n"), " "), > list_to_tuple(lists:append(Line, [ArgList])); > normalize({ok, Line}) -> > list_to_tuple(lists:append(chop(Line, "\n"), [[]])); > normalize(eof) -> > eof. > > This allows me to read the static elements that I have in the beginning > of each line and then an abitrary number of leftover elements are put > into a list and added to the list of static elements. so I am left with > a ["string", atom, atom, digit, [any number of elements]]. This is fine > but if I could efficiantly grab erlang terms from the file I could > imrove the logic of my application without making it ugly. > > Thanks, > Martin Logan. From etxuwig@REDACTED Thu Nov 22 10:06:43 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Thu, 22 Nov 2001 10:06:43 +0100 (MET) Subject: Reading terms from a file. In-Reply-To: <3BFCBD26.B3795271@cslab.ericsson.se> Message-ID: On Thu, 22 Nov 2001, Thomas Arts wrote: >I am looking myself for a solution to write terms to file in >the internal term format, like io:write(Device,Term), but than >not in ascii format. I want to write several terms, though. You should probably use disk_log then. It's perfect for that sort of thing. It also gives you the option to use a wrap log, if you're worried about disk space. Terms are read from the file using the disk_log:chunk() function. /Uffe -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From vlad.dumitrescu@REDACTED Thu Nov 22 11:07:59 2001 From: vlad.dumitrescu@REDACTED (Vlad Dumitrescu) Date: Thu, 22 Nov 2001 11:07:59 +0100 Subject: jobs in Stockholm? References: Message-ID: Hi everyone, It doesn't feel very right to ask this question in this forum, but I hope you will bear with me. There are no other ways that I know of to reach everyone with a single message. The Wiki page doesn't seem to be recently updated... I promise I won't repeat this until next year ;-) I am planning to move to Stockholm in March-April 2002 and I would love to be able to work with Erlang. I know that the job situation right now is not the best, but I also know that good people are needed anyway... so I thought that it couldn't hurt to try my luck. So, if anyone could at least point me to the right person to talk to about this, I would be grateful, but I hope that you might also have an idea about whether my wish has chances of success. And also it would be interesting to know whether there are more companies using Erlang except Ericsson, Bluetail, Corelatus. well, I hope this will create some feedback and maybe a job :-) best regards, Vlad From vladdu@REDACTED Thu Nov 22 11:21:19 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Thu, 22 Nov 2001 11:21:19 +0100 Subject: jobs in Stockholm? Message-ID: just a quick note: it is mainly a consultancy assignment I am looking for, not a full-time employment. btw, the reply address in my previous post got mixed-up, so should anyone reply directly to me, and not to the list, please use this address: mailto:vladdu@REDACTED thanks, Vlad From raimo@REDACTED Thu Nov 22 15:11:28 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Thu, 22 Nov 2001 15:11:28 +0100 Subject: Reading terms from a file. References: , <3BFBE7C1.E2A9FE5F@vailsys.com>, <3BFCBD26.B3795271@cslab.ericsson.se> Message-ID: <3BFD0790.AC5A6033@erix.ericsson.se> I encountered Thomas's problem below in a trace tool I am currently writing. The way I will get around it is by using the fact that I only need to get something identifiable for a human when scanned and parsed, so i pass all suspicious terms written to the file through the following function, which converts weird terms into their string representation: %% Converts the parts of a deep term that are not parasable when printed %% with io:format() into their string representation. parsify([]) -> []; parsify([Hd | Tl]) -> [parsify(Hd) | parsify(Tl)]; parsify({A, B}) -> {parsify(A), parsify(B)}; parsify({A, B, C}) -> {parsify(A), parsify(B), parsify(C)}; parsify(Tuple) when tuple(Tuple) -> list_to_tuple(parsify(tuple_to_list(Tuple))); parsify(Pid) when pid(Pid) -> erlang:pid_to_list(Pid); parsify(Port) when port(Port) -> erlang:port_to_list(Port); parsify(Ref) when reference(Ref) -> erlang:ref_to_list(Ref); parsify(Fun) when function(Fun) -> erlang:fun_to_list(Fun); parsify(Term) -> Term. The name should possibly be 'scanify' :-). The 2- and 3-tuple clauses are just optimisations. / Raimo Niskanen, Erlang/OTP, Ericsson UAB Thomas Arts wrote: > > The suggestion to read Erlang terms with file:consult > is useful, but does not work consistent. > > Erlang (BEAM) emulator version 5.1 [threads:0] > > Eshell V5.1 (abort with ^G) > > 3> {ok,D} = file:open("myterms",[write]). > {ok,<0.34.0>} > 4> file:write(D,io_lib:format("~w.~n",[{myproc,self()}])). > ok > 5> file:write(D,io_lib:format("~w.~n",[[1,2,3]])). > ok > 6> file:close(D). > ok > 7> file:consult("myterms"). > {error,{1,erl_parse,["syntax error before: ",["'<'"]]}} > > The problem is that the scanner does not recognize process > identifiers as such. > > I am looking myself for a solution to write terms to file in > the internal term format, like io:write(Device,Term), but than > not in ascii format. I want to write several terms, though. > > Erlang (BEAM) emulator version 5.1 [threads:0] > > Eshell V5.1 (abort with ^G) > 1> {ok,D} = file:open("myterms",[write]). > {ok,<0.30.0>} > 2> io:write(D,{myproc,self()}). > ok > 3> io:write(D,[1,2,3]). > ok > 4> file:close(D). > ok > > The problem is reading the file. The command io:read is > not implemented as the inverse of io:write, which I think > is pity. > > 5> f(D). > ok > 6> {ok,D} = file:open("myterms",[read]). > {ok,<0.36.0>} > 7> io:read(D,""). > {error,{1,erl_scan,scan}} > > suggestions? > > /Thomas > > "Martin J. Logan" wrote: > > > > Hello, > > Does anyone have any suggestions on the best way to read erlang > > terms from a file. I am using io_lib:fread and parsing the data I get. > > This rather simple meathod has worked well for me in the past because I > > was only doing simple things with files. I would like to read in > > complex erlang terms such as those found in the .app and .rel files. > > > > The way I do things right now is short but too simple. > > > > %% read/2: Reads the commands file > > %% Arg1: The list of services. > > %% Arg2: IoDevice - The io device process > > > > read([eof|Service], IoDevice) -> > > Service; > > read(Service, IoDevice) -> > > String = io:get_line(IoDevice, ""), > > Line = normalize(io_lib:fread("~s ~a ~a ~d", String)), > > read([Line|Service], IoDevice). > > > > normalize({ok, Line, LeftOver}) -> > > ArgList = string:tokens(chop(LeftOver, "\n"), " "), > > list_to_tuple(lists:append(Line, [ArgList])); > > normalize({ok, Line}) -> > > list_to_tuple(lists:append(chop(Line, "\n"), [[]])); > > normalize(eof) -> > > eof. > > > > This allows me to read the static elements that I have in the beginning > > of each line and then an abitrary number of leftover elements are put > > into a list and added to the list of static elements. so I am left with > > a ["string", atom, atom, digit, [any number of elements]]. This is fine > > but if I could efficiantly grab erlang terms from the file I could > > imrove the logic of my application without making it ugly. > > > > Thanks, > > Martin Logan. From return@REDACTED Sat Nov 24 09:56:03 2001 From: return@REDACTED (Christine Hall) Date: Sat, 24 Nov 2001 16:56:03 +0800 Subject: WWW.ERLANG.ORG Message-ID: <200111240855.QAA13797@ns4.trafficmagnet.net> An HTML attachment was scrubbed... URL: From dne@REDACTED Sun Nov 25 17:47:22 2001 From: dne@REDACTED (Daniel =?iso-8859-1?q?N=E9ri?=) Date: Sun, 25 Nov 2001 17:47:22 +0100 Subject: Os_mon port to OpenBSD Message-ID: <87itbybxwl.fsf@nowhere.mayonnaise.net> Hello, Below is a patch to make the R8B os_mon application work on OpenBSD (tested on version 2.9). The changes to the memsup port program should work on any BSD (although it's not needed on FreeBSD). Best wishes, --Daniel -------------- next part -------------- A non-text attachment was scrubbed... Name: os_mon.patch Type: text/x-patch Size: 4228 bytes Desc: os_mon patch for OpenBSD URL: -------------- next part -------------- -- Daniel Neri dne@REDACTED From kent@REDACTED Sun Nov 25 18:29:19 2001 From: kent@REDACTED (Kent Boortz) Date: 25 Nov 2001 18:29:19 +0100 Subject: Os_mon port to OpenBSD In-Reply-To: dne@mayonnaise.net's message of "Sun, 25 Nov 2001 17:47:22 +0100" References: <87itbybxwl.fsf@nowhere.mayonnaise.net> Message-ID: dne@REDACTED (Daniel N?ri) writes: > Below is a patch to make the R8B os_mon application work on OpenBSD > (tested on version 2.9). The changes to the memsup port program should > work on any BSD (although it's not needed on FreeBSD). This is integrated into R9, thanks! kent From sheryq@REDACTED Sun Nov 25 21:43:55 2001 From: sheryq@REDACTED (Sheheryar Qadir) Date: Sun, 25 Nov 2001 14:43:55 -0600 Subject: Pros & cons of Erlang single assignment and type checking Message-ID: Being new to Erlang i was reading about the language from whatever source that i could find however i was unable to find essential features of Erlang's non destructive assignment statement plus where can i find up to date information about the work thats been done or is going on to incorporate static type checking in Erlang and the consequences of not accomodating type checking. From etxuwig@REDACTED Sun Nov 25 23:06:45 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Sun, 25 Nov 2001 23:06:45 +0100 (MET) Subject: Pros & cons of Erlang single assignment and type checking In-Reply-To: Message-ID: On Sun, 25 Nov 2001, Sheheryar Qadir wrote: >Being new to Erlang i was reading about the language from >whatever source that i could find however i was unable to find >essential features of Erlang's non destructive assignment >statement - Single assignment and side-effect free functions mean that you can be absolutely certain that once a variable has been given a value, it will maintain that value. This makes it a lot easier to reason about a program. - Single assignment and pattern matching go hand in hand. For example, a pattern like: lookup(Key, [{Key, Value}|_]) -> Value. makes absolute sense if you know that Key, once given a value, will maintain that value. The pattern above will work whether you evaluate it from left or right. The first occurence of Key will result in Key being bound to the corresponding value; the second will succeed iff that value is identical to the first one. This type of programming leads to very concise programs, and it's hard to achieve with destructive assignment. >plus where can i find up to date information about the work >thats been done or is going on to incorporate static type >checking in Erlang and the consequences of not accomodating >type checking. Erlang does have type checking, but it is performed at run-time. Many of the types expressed in Erlang are implicit, as parts of the pattern matching. {ok, Fd} = file:open(File, [read]), asserts that the function file:open/2 must return a tuple of size 2, where the first element is the atom 'ok'. The second element can be anything, and our program doesn't care, as long as the file module recognizes it as a file descriptor in subsequent function calls. The ability to handle 'any type' data with great ease can be a major advantage. Furthermore, changing code in a running system is much easier to accomplish using dynamic type checking. Even when types have changed from one version to the next, we can easily make functions backward compatible with the old types by keeping the old patterns. Many object to dynamic type checking on grounds of efficiency. A good compiler can certainly use static types to produce much more efficient code, since much more of the semantics are known at compile time. I haven't worried too much about this aspect, since I've found (a) that Erlang is fast enough for my purposes, and (b) in the kind of (complex) programs we develop, type checking is hardly ever the reason for poor performance -- it's rather bad choice of algorithms or programs doing lots of stuff they shouldn't be doing. This is not to say that static type checking can't be superior at times. There is a type checker for Erlang that's being developed, and the general idea is that it could be used in areas where static type checking would really add benefit. One obvious such area is an interface module. However, tacking on a static type checker after the fact is difficult, especially if the goal is to keep the basic flavour of the language. Dynamic type checking has its strengths and weaknesses. I don't view Erlang's dynamic types as a defect of the language -- quite the opposite, but I recognize that others are much in favour of static type checking -- and tend to go with languages like Haskell or ML. /Uffe -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From hal@REDACTED Mon Nov 26 00:38:31 2001 From: hal@REDACTED (Hal Snyder) Date: 25 Nov 2001 17:38:31 -0600 Subject: netbsd dns patch Message-ID: <87g0728lqg.fsf@cb293842-b.rmdws1.il.home.com> Here is a patch to allow netbsd nodes to see each other. Without the patch, you need to do ets:insert(inet_db, {res_lookup, [file,dns]}). Have seen the same problem in the past with OpenBSD, but don't know if the problem is still there. -------------- next part -------------- A non-text attachment was scrubbed... Name: patch-ai Type: application/octet-stream Size: 444 bytes Desc: inet_config.erl patch URL: From dne@REDACTED Mon Nov 26 03:08:03 2001 From: dne@REDACTED (Daniel =?iso-8859-1?q?N=E9ri?=) Date: Mon, 26 Nov 2001 03:08:03 +0100 Subject: netbsd dns patch In-Reply-To: <87g0728lqg.fsf@cb293842-b.rmdws1.il.home.com> (Hal Snyder's message of "25 Nov 2001 17:38:31 -0600") References: <87g0728lqg.fsf@cb293842-b.rmdws1.il.home.com> Message-ID: <874rnie130.fsf@nowhere.mayonnaise.net> Hal Snyder writes: > Have seen the same problem in the past with OpenBSD, but don't know > if the problem is still there. Yep, it has been mentioned before[*], and I do believe it's still there. Anyway, although your patch fixes things in your particular case, you would still have the same problem if your nsswitch.conf had no "hosts" line, or the if the file was missing altogether. So I propose the following fix, which of course doesn't invalidate yours (N.B. untested): -------------- next part -------------- A non-text attachment was scrubbed... Name: lookup.patch Type: text/x-patch Size: 1157 bytes Desc: lookup patch URL: -------------- next part -------------- This, IMO, improves things somewhat, but it's still behaving slightly differently to most platforms' resolvers (i.e. the BIND resolver library). Regards, --Daniel [*] http://www.erlang.org/ml-archive/erlang-questions/200009/msg00034.html -- Daniel Neri dne@REDACTED From hal@REDACTED Mon Nov 26 05:53:10 2001 From: hal@REDACTED (Hal Snyder) Date: 25 Nov 2001 22:53:10 -0600 Subject: netbsd (and openbsd?) dns patch In-Reply-To: <874rnie130.fsf@nowhere.mayonnaise.net> (dne@mayonnaise.net's message of "Mon, 26 Nov 2001 03:08:03 +0100") References: <87g0728lqg.fsf@cb293842-b.rmdws1.il.home.com> <874rnie130.fsf@nowhere.mayonnaise.net> Message-ID: <87bshq8761.fsf_-_@cb293842-b.rmdws1.il.home.com> dne@REDACTED (Daniel N?ri) writes: >> Have seen the same problem in the past with OpenBSD, but don't know >> if the problem is still there. BTW, I should have stated that the patch I just sent is for Erlang R8B and NetBSD-1.5.2, tested and in use. We have been using the ets:insert(inet_db,...) workaround on our OpenBSD Erlang nodes for over a year. > Yep, it has been mentioned before[*], and I do believe it's still > there. > Anyway, although your patch fixes things in your particular case, > you would still have the same problem if your nsswitch.conf had no > "hosts" line, or the if the file was missing altogether. NetBSD docs state that the resolver defaults to "hosts files dns" in absence of an nsswitch.conf file or hosts entry in that file. [ferrets about in sources] ...hm... I see what you mean. Erlang seems to use its own resolver, inet_dns.erl, as opposed to the one in libc. Mostly. > So I propose the following fix, which of course doesn't invalidate > yours (N.B. untested): Nice. Will test it asap. Will help with OpenBSD too, no? > This, IMO, improves things somewhat, but it's still behaving > slightly differently to most platforms' resolvers (i.e. the BIND > resolver library). Right. Thanks! From p.caven@REDACTED Mon Nov 26 13:22:14 2001 From: p.caven@REDACTED (Peter Caven) Date: Mon, 26 Nov 2001 07:22:14 -0500 Subject: Comprehending List Comprehensions Message-ID: <000701c17674$fb4fcf00$875e8d18@co778161a> Hello, I am at the early stages of learning Erlang and I've encountered what seems to be strange behaviour in list comprehensions. The expression: [{Token} || {Start, Length} <- [{1,1},{2,2},{4,2}], Token <- string:substr("1+1-2", Start, Length)] returns: [{49},{43},{49},{45},{50}] when I expected it to return: [{"1"},{"+1"},{"-2"}] Can someone please point out where my mistake is? Thanks, Peter. From etxuwig@REDACTED Mon Nov 26 13:28:39 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Mon, 26 Nov 2001 13:28:39 +0100 (MET) Subject: Comprehending List Comprehensions In-Reply-To: <000701c17674$fb4fcf00$875e8d18@co778161a> Message-ID: The following comprehension is probably what you're after: [{string:substr("1+1-2", Start, Length}) || {Start, Length} <- [{1,1}, {2,2}, {4,2}]]. In your example below, Token <- string:substr(...) generates Token from the string output by string:substr/2, essentially setting Token = , for each character in the string. /Uffe On Mon, 26 Nov 2001, Peter Caven wrote: >Hello, >I am at the early stages of learning Erlang and I've encountered what seems >to be strange behaviour in list comprehensions. The expression: > >[{Token} || {Start, Length} <- [{1,1},{2,2},{4,2}], Token <- >string:substr("1+1-2", Start, Length)] > >returns: > >[{49},{43},{49},{45},{50}] > >when I expected it to return: > >[{"1"},{"+1"},{"-2"}] > >Can someone please point out where my mistake is? > >Thanks, >Peter. > > -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson Telecom AB, ATM Multiservice Networks From hakan@REDACTED Mon Nov 26 13:36:17 2001 From: hakan@REDACTED (Hakan Mattsson) Date: Mon, 26 Nov 2001 13:36:17 +0100 (MET) Subject: Comprehending List Comprehensions In-Reply-To: <000701c17674$fb4fcf00$875e8d18@co778161a> Message-ID: On Mon, 26 Nov 2001, Peter Caven wrote: Peter> I am at the early stages of learning Erlang and I've encountered what seems Peter> to be strange behaviour in list comprehensions. The expression: Peter> Peter> [{Token} || {Start, Length} <- [{1,1},{2,2},{4,2}], Token <- Peter> string:substr("1+1-2", Start, Length)] Peter> Peter> returns: Peter> Peter> [{49},{43},{49},{45},{50}] Peter> Peter> when I expected it to return: Peter> Peter> [{"1"},{"+1"},{"-2"}] Peter> Peter> Can someone please point out where my mistake is? The Token generator with contribute with a solution for each element in the list that string:substr/2 returns. See this little example: 5> [Token || Token <- string:substr("1+1-2", 1, 1)]. "1" 6> [{Token} || Token <- string:substr("1+1-2", 1, 1)]. [{49}] 7> [{Token} || Token <- string:substr("1+1-2", 1, 2)]. [{49},{43}] 8> [{Token} || Token <- string:substr("1+1-2", 1, 3)]. [{49},{43},{49}] You problably intended to do this: 9> [{string:substr("1+1-2", Start, Length)} || {Start, Length} <- [{1,1},{2,2},{4,2}]]. [{"1"},{"+1"},{"-2"}] 10> /H?kan --- H?kan Mattsson Ericsson Computer Science Laboratory http://www.ericsson.com/cslab/~hakan/ From vances@REDACTED Mon Nov 26 20:51:35 2001 From: vances@REDACTED (Vance Shipley) Date: Mon, 26 Nov 2001 14:51:35 -0500 Subject: embedded R8B-0 on linux Message-ID: For whatever reason the maintainers limit support for embedded systems to Solaris and VxWorks in the build files. If anyone else wants Linux support for embedded systems the attached patch let's you build and install an embedded system from the R8B-0 distribution. In the build directory (e.g. /usr/local/src/otp_src_r8B-0) do: patch -p0 < embedded_linux.patch Run configure with the prefix set to the target embedded directory: ./configure --prefix=/home/otpuser Build and install the system: make make install In the embedded directory you will want to make the directory lib/erlang/log. If you want to run the default installed embedded system you will need to create a configuration file as lib/erlang/releases/R8B/sys.config. If you don't need any specific changes just use the empty list and a terminating period: []. You can now run lib/erlang/bin/start to start the system running. Connect to it with lib/erlang/bin/to_erl, this will give you a shell on the running node. Use -D to exit without stopping the node. -Vance Vance Shipley Motivity Telecom Inc. +1 519 579 5816 -------------- next part -------------- A non-text attachment was scrubbed... Name: embedded_linux.patch Type: application/octet-stream Size: 2524 bytes Desc: not available URL: From mickael.remond@REDACTED Mon Nov 26 23:15:38 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Mon, 26 Nov 2001 23:15:38 +0100 Subject: Interfacing with C: Performance comparisons ? Message-ID: <20011126231538.A7792@erlang-fr.org> Hello, Do you have any performance comparison on the different way to interface an Erlang programm with a C programm. The communication will involve a lot of data exchange (big file and or lot of small messages). Thank you in advance. -- Micka?l R?mond http://www.erlang-fr.org/ From dne@REDACTED Mon Nov 26 23:53:37 2001 From: dne@REDACTED (Daniel =?iso-8859-1?q?N=E9ri?=) Date: Mon, 26 Nov 2001 23:53:37 +0100 Subject: netbsd (and openbsd?) dns patch In-Reply-To: <87bshq8761.fsf_-_@cb293842-b.rmdws1.il.home.com> (Hal Snyder's message of "25 Nov 2001 22:53:10 -0600") References: <87g0728lqg.fsf@cb293842-b.rmdws1.il.home.com> <874rnie130.fsf@nowhere.mayonnaise.net> <87bshq8761.fsf_-_@cb293842-b.rmdws1.il.home.com> Message-ID: <871yilnnym.fsf@nowhere.mayonnaise.net> Hal Snyder writes: > NetBSD docs state that the resolver defaults to "hosts files dns" in > absence of an nsswitch.conf file or hosts entry in that file. Yeah; on OpenBSD the default is "lookup file" if /etc/resolv.conf does not exist, and "lookup bind file" if the it exists, but contains no "lookup" line. > Nice. Will test it asap. Will help with OpenBSD too, no? Probably, depending on the /etc/resolv.conf situation on your (problematic) OpenBSD nodes. Regards, --Daniel -- Daniel Neri dne@REDACTED From p.caven@REDACTED Tue Nov 27 05:52:57 2001 From: p.caven@REDACTED (Peter Caven) Date: Mon, 26 Nov 2001 23:52:57 -0500 Subject: Comprehending List Comprehensions - Thanks! References: Message-ID: <002701c176ff$61eacb40$875e8d18@co778161a> Many thanks to Uffe and H?kan! I see now that I'll need to be careful about any strings returned from a generator. By the way - Erlang is a very nice language! I get the same kind of liberated feeling with Erlang as I do when programing in Python. -- Peter. ----- Original Message ----- From: "Ulf Wiger" To: "Peter Caven" Cc: Sent: Monday, November 26, 2001 7:28 AM Subject: Re: Comprehending List Comprehensions > > The following comprehension is probably what you're after: > > [{string:substr("1+1-2", Start, Length}) || > {Start, Length} <- [{1,1}, {2,2}, {4,2}]]. > > In your example below, Token <- string:substr(...) generates > Token from the string output by string:substr/2, essentially > setting Token = , for each character in the string. > > /Uffe > > On Mon, 26 Nov 2001, Peter Caven wrote: > > >Hello, > >I am at the early stages of learning Erlang and I've encountered what seems > >to be strange behaviour in list comprehensions. The expression: > > > >[{Token} || {Start, Length} <- [{1,1},{2,2},{4,2}], Token <- > >string:substr("1+1-2", Start, Length)] > > > >returns: > > > >[{49},{43},{49},{45},{50}] > > > >when I expected it to return: > > > >[{"1"},{"+1"},{"-2"}] > > > >Can someone please point out where my mistake is? > > > >Thanks, > >Peter. > > > > > > -- > Ulf Wiger, Senior Specialist, > / / / Architecture & Design of Carrier-Class Software > / / / Strategic Product & System Management > / / / Ericsson Telecom AB, ATM Multiservice Networks > From rv@REDACTED Sun Nov 25 22:04:56 2001 From: rv@REDACTED (Robert Virding) Date: Sun, 25 Nov 2001 22:04:56 +0100 Subject: Problem with dict:new() In-Reply-To: Your message of "Mon, 19 Nov 2001 13:37:25 +0100." <3BF8FD05.F4240221@eed.ericsson.se> Message-ID: <200111252104.fAPL4uf01740@erik.virding.org> Nico Weling writes: >Hi all, > >after upgrading to Erlang R8B I've got a lot of badmatch errors due to the 'new' dict module. > >How is it possible to use the new release without changing my own programms? This is just to confirm what other replies have stated. The internal representation has changed and dict's are now much more efficient. Note that the internal representation was was never defined before! There is a dict:size/1 function which returns the size of the dict, the number of elements. There is also another module orddict which has exactly the API as dict but where the internal representation is defined to be a list of pairs (tuples) ordered on the first element which is the key. Here you could test with [], but it is cleaner to use size/1. I personally find that sometimes it is practical to know that the representation is a list, but with fold/3 I don't need it that often. Perhaps there should also be a foreach/2? Robert From rv@REDACTED Sun Nov 25 22:27:35 2001 From: rv@REDACTED (Robert Virding) Date: Sun, 25 Nov 2001 22:27:35 +0100 Subject: Catch In-Reply-To: Your message of "Tue, 20 Nov 2001 15:44:23 +0100." <3BFA6C47.40C8F610@tn.etx.ericsson.se> Message-ID: <200111252127.fAPLRZ701792@erik.virding.org> My personal view to this is definetely NO NO NO NO! I think it would be a big mistake to try and combine different semantical elements in one syntactic construction. Perhaps I am just getting old but I think it is much cleaner for each construct to do ONE thing. Also much easier to explain to people. And I am pretty certain that you could get some pretty funny cases here. Erlang started out small and clean (yeah, yeah I know) and whatever is added should remain that way. case-catch and receive-catch definitely aren't clean. This said I think that try would be a Good Thing and it is on the way. With the selection method you can easily handle checking for specific errors. Although I agree with Maurice Castro that you should probably be careful it just catching some faults and implicitly passing the rest on. Another problem with try is that all the exit values aren't really defined yet and this would have to be done. This would also entail defining what an exit value looks like and this has not been done yet. Although the system consistenly gives {What,Where}. I think. Robert Fredrik Linder writes: >Hi > >At the Erlang Workshop in Florence did a discussion about separating >code for normal execution from code for exception(al?) execution take >place. > >Now I am wondering what the Erlang community think about a proposal that >came up. > >The proposal is to extend where a catch might be placed. Note that the >current use of catches could still be valid. > >Proposal: > >case of > NormalMatch1 -> > blabla; > NormalMatch2 -> > blabla >catch > {'EXIT', Reason} -> > blabla; > ExceptionMatch2 -> > blabla >end > >If this feels like a good way of doing it, then maybe also extend this >to receive statements: > >receive > NormalMatch -> > blabla >after > Time -> > blabla >catch > {'EXIT', Pid, Reason} -> > blabla; > SignalMatch -> > blabla >end > >By introducing an 'EXIT' record could this be extended further: > >-record('EXIT', {pid, reason}). > >recieve|case of > NormalMatch -> > blabla >catch > #'EXIT'{} -> > blabla; > #'EXIT'{pid = Pid} -> % In a case statement is Pid == self() > blabla; > #'EXIT'{reason = Reason} -> > blabla >end > >The last suggestion could be implemented as syntactical suger (I guess). > >/Fredrik > From rv@REDACTED Sun Nov 25 22:16:37 2001 From: rv@REDACTED (Robert Virding) Date: Sun, 25 Nov 2001 22:16:37 +0100 Subject: regexp:first_match In-Reply-To: Your message of "Sun, 18 Nov 2001 23:40:08 PST." Message-ID: <200111252116.fAPLGbu01766@erik.virding.org> Niels Christensen writes: >Reading the documentation for regexp, I am surprised that > >2> regexp:first_match("22-03-03","<.+>"). >{match,1,21} >3> > >I should have thought (and wanted!) the result to be > >{match,1,6} Here again to combine and confirm the other replies to this question. regexp:match will search the whole string to find the longest match. If there is more than one match with the same length then it will choose the first one. regexp:first_match will choose the first match, but it is also greedy and returns the longest possible match. Which is what you discovered. Originally it just took the first match (as you wanted) but when someone "optimised" the code this behaviour changed. I don't which is better. At least it is now consistently greedy. Perhaps you can say that regexp:match returns the "first longest" while regexp:first_match returns the "longest first". How about a "last shortest"? :-) Yes . is consistent with other regular expressions and matches any character except \n. Robert From thomas.lindgren@REDACTED Wed Nov 28 11:00:08 2001 From: thomas.lindgren@REDACTED (Thomas Lindgren) Date: Wed, 28 Nov 2001 11:00:08 +0100 Subject: Catch In-Reply-To: <200111252127.fAPLRZ701792@erik.virding.org> Message-ID: More structured exceptions would be nice; add the line number where the exception occurred while you're at it. It would also be generally useful to see the actual arguments of the operation that caused the exception as well, rather than 'badarg' or 'badmatch' or whatever. (For pattern matching, showing the entire pattern or clause head would be better than just the failing match.) -- Thomas PS. Pardon my Outlook. From vlad.dumitrescu@REDACTED Wed Nov 28 12:10:49 2001 From: vlad.dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 28 Nov 2001 12:10:49 +0100 Subject: Erlang firewall Message-ID: <007a01c177fd$563723d0$6c05000a@hiq12> Hi good folks, I was thinking about Erlang security aspects, and I wonder if it would be possible to set up an Erlang firewall, that will separate the internal from the external networks, possibly by using different cookies for them, and only allowing for some messages to pass through... seem like not easy and resource demanding, so it might not be practical, but is there at least a theoretical possibility for such a thing to function? thanks. Regards, Vlad From luke@REDACTED Wed Nov 28 12:43:06 2001 From: luke@REDACTED (Luke Gorrie) Date: 28 Nov 2001 12:43:06 +0100 Subject: Erlang firewall In-Reply-To: <007a01c177fd$563723d0$6c05000a@hiq12> References: <007a01c177fd$563723d0$6c05000a@hiq12> Message-ID: "Vlad Dumitrescu" writes: > Hi good folks, > > I was thinking about Erlang security aspects, and I wonder if it > would be possible to set up an Erlang firewall, that will separate > the internal from the external networks, possibly by using different > cookies for them, and only allowing for some messages to pass > through... seem like not easy and resource demanding, so it might > not be practical, but is there at least a theoretical possibility > for such a thing to function? Not quite sure what you mean, but if you want to write a regular firewall in Erlang then I have a hack for you at http://www.bluetail.com/~luke/misc/tunnel-0.1.tar.gz It's a "tunnel device" driver for erlang on Linux. A tunnel device is a faked network device where packets go to and from a program instead of a real network. The program comes totally undocumented but is very simple (3 functions). It does include a tiny example though. If you run erlang as root with something like (note the fully-qualified ebin dir): # erl -pa /home/luke/src/tunnel-0.1/ebin/ Erlang (BEAM) emulator version 5.0.1.1.b2 [source] [threads] Eshell V5.0.1.1.b2 (abort with ^G) 1> tunnel:proxy(). Opening proxy on "tun0" Now the program has a tunnel device opened - it will read any packets from it and then write them straight back. But you have to configure the tunnel's IP address like this: # ifconfig tun0 192.168.43.1 pointopoint 192.168.43.2 Those're just made-up IP addresses. This gives the tunnel the address 192.168.43.1, and says that packets for 192.168.43.2 should go through it (automatically adds the route). Now you can do "ping 192.168.43.2" and you'll see the erlang packet receiving the packets! Some notes if you wanna actually use it: - Use the tcpdump program to see what's going on - You need to have "universal tun/tap" support for your kernel (the module is called "tun"). - If you want to use this as a firewall, you need to decipher the Linux Advanced Routing HOWTO (or ask me - I've got this setup but its a bit tricky). That's all I can think of just now! Cheers, Luke From rvg@REDACTED Wed Nov 28 15:31:33 2001 From: rvg@REDACTED (Rudolph van Graan) Date: Wed, 28 Nov 2001 16:31:33 +0200 Subject: Erlang and Sybase/Oracle on Linux Message-ID: <6CB639EBBEAAD944B178DA06CBE921521A75@BOHR.net.ifoni.com> Hi there, Does anyone know how difficult (if it all possible) to use the ODBC interface of erlang to access a Sybase or Oracle database on linux/x86? Any pointers on how to get this going quickly? Thanks in advance! Rudolph From Laszlo.Varga@REDACTED Wed Nov 28 17:17:45 2001 From: Laszlo.Varga@REDACTED (Laszlo Varga) Date: Wed, 28 Nov 2001 17:17:45 +0100 (MET) Subject: filtering functions in mnemosyne Message-ID: <200111281617.fASGHjV13895@duna273.eth.ericsson.se> Hi Sirs, sorry for this newby question. I'm just playing around with mnesia, and has found something which shurely possible but I couldn't get through. What I want, is to use a function in a query like this (simplified) isTheSame({A,A}) -> true; isTheSame(B) -> false. for cheking the records. What I get: {aborted,{badarg,{ets,lookup,[db_get,[mnemosyne_catalog,{image,foo}]]}}} I have a simple record -record(foo,{this,that}). some simple functions: -module(trial). -include_lib("mnemosyne/include/mnemosyne.hrl"). -include("trial.hrl"). -export([find1/1,find2/1,init/0,isTheSame/1]). add({This,That})-> Fun = fun() -> NetRecord = #foo{this = This, that =That}, mnesia:write(NetRecord) end, mnesia:transaction(Fun). init() -> mnesia:create_table(foo , [{attributes,record_info(fields,foo)}]), add({1, 2}), add({2, 2}), add({3, 3}). isTheSame({A,A}) -> true; isTheSame(B) -> false. find1(Table)-> F = fun() -> Q = query [E || E <- table(Table), E.this = E.that] end, mnemosyne:eval(Q) end, mnesia:transaction(F). find2(Table)-> F = fun() -> Q = query [E || E <- table(Table), isTheSame({E.this,E.that})] end, mnemosyne:eval(Q) end, mnesia:transaction(F). find1 works properly trial:find1(foo). {atomic,[{foo,2,2},{foo,3,3}]} find2 gives trial:find2(foo). {aborted,{badarg,{ets,lookup,[db_get,[mnemosyne_catalog,{image,foo}]]}}} How to do things like this? (I 'm using old 4.3.7 erlang) Thanks Laszlo Varga mailto: ethvala@REDACTED From martin@REDACTED Wed Nov 28 18:03:17 2001 From: martin@REDACTED (Martin J. Logan) Date: Wed, 28 Nov 2001 11:03:17 -0600 Subject: Erlang and Sybase/Oracle on Linux References: <6CB639EBBEAAD944B178DA06CBE921521A75@BOHR.net.ifoni.com> Message-ID: <3C0518D5.D7ECE5BB@vailsys.com> Rudolph van Graan wrote: > Hi there, > > Does anyone know how difficult (if it all possible) to use the ODBC > interface of erlang to access a Sybase or Oracle database on linux/x86? > Any pointers on how to get this going quickly? > > Thanks in advance! > > Rudolph We have gotten ODBC to interface with an oracle DB to work on slackware linux with and Oracle ODBC Driver by easysoft(www.easysoft.org and www.easysoft.com). The process of getting it working is a bit tricky. I am including the make file that I used as well as the .ini files that are crucial to proper installation. These should ideally be placed in your /etc directory and point to the .so files provided by the ODBC driver. I hope this helps. Cheers, Martin -------------- next part -------------- [ODBC Data Sources] dBase=MERANT 3.70 dBase Driver SybaseASE=MERANT 3.70 Sybase ASE Driver Oracle8=MERANT 3.70 Oracle 8 Driver Oracle7=Easysoft Oracle Driver InformixWP=MERANT 3.70 Informix Clientless Driver Text=MERANT 3.70 Text Driver MS_SQLServer7=MERANT SQLServer driver MySQL=MySQL driver Merant=MERANT 3.70 Oracle 8 Driver Easysoft=Easysoft 1.0.0.2 Driver [dBase] Driver=/u1/odbc/lib/ivdbf16.so Description=dBase Database=/u1/odbc/demo [SybaseASE] Driver=/u1/odbc/lib/ivase16.so Description=SybaseASE Database=odbc LogonID=odbc01 Password=odbc01 NetworkAddress=server,port [Oracle7] Driver=/usr/local/easysoft/oracle/libesoracle.so Description=Oracle7 Database=cantest LogonID=vail Password=dragon123 [Easysoft] Driver=/usr/local/easysoft/oracle/libesoracle.so Description=Easysoft Database=cantest LogonID=vail Password=dragon123 [Oracle8] Driver=/u1/odbc/lib/ivor816.so Description=Merant ServerName=CANTEST LogonID=vail Password=dragon123 [InformixWP] Driver=/u1/odbc/lib/ivifcl16.so Description=Informix Clientless Driver Database=odbc LogonID=odbc01 Password=odbc01 HostName=beluga PortNumber=1526 ServerName=beluga914 [Text] Driver=/u1/odbc/lib/ivtxt16.so Description=Text driver Database=/u1/odbc/demo [MS_SQLServer7] Driver=/u1/odbc/lib/ivmsss16.so Description=SQL Server Database= Address= LogonID=odbc01 Password=odbc01 QuotedId=No AnsiNPW=No [MySQL] Driver=/u1/odbc/lib/ivmysql16.so Description=MySQL driver LogonID=login Password=pass Database=test HostName=server [ODBC] Trace=0 TraceFile=odbctrace.out TraceDll=/u1/odbc/lib/odbctrac.so InstallDir=/u1/odbc -------------- next part -------------- [ODBC Drivers] Oracle7 = Installed Merant = Installed Easysoft= Installed [ODBC Connection Pooling] PerfMon = 0 Retry Wait = [Oracle7] Driver = /usr/local/easysoft/oracle/libesoracle.so Setup = /home/sam/.odbc.ini DATABASE = cantest PASSWORD = dragon123 TRACE = ON USER = vail [Easysoft] Driver = /usr/local/easysoft/oracle/libesoracle.so Setup = /home/martin/.odbc.ini DATABASE = cantest PASSWORD = dragon123 TRACE = ON USER = vail [Oracle8] Driver = /u1/odbc/lib/ivor816.so Setup = /home/sam/easysoft/usr/local/lib/.odbc.ini DATABASE = CANTEST PASSWORD = dragon123 TRACE = OFF USER = vail -------------- next part -------------- # # Makefile for Unix # Written for gcc # # Edit these to match your installation # # ODBCROOT - root directory of the ODBC installation # ODBCROOT = /u1/odbc #ODBCROOT = /usr/local/easysoft/unixODBC # You might need to change these # # ODBCLDFLAGS = -L # ODBCLIBS = -l # ODBCINCLUDE = -I # OTPROOT - root directory of the Erlang/OTP installation # #ODBCLDFLAGS = -L$(ODBCROOT)/lib ODBCLDFLAGS = -L$(ODBCROOT)/lib ODBCLIBS = -lodbc -lodbcinst ODBCINCLUDE = -I$(ODBCROOT)/include OTPROOT = /usr/local/src/otp_src_R7B-3 # The rest should be OK. # EMULATOR = %EMU% ICROOT = $(OTPROOT)/lib/ic EIROOT = $(OTPROOT)/lib/erl_interface ERLC = $(OTPROOT)/bin/erlc BINDIR = ../priv/bin OBJDIR = ../priv/obj EBINDIR = ../ebin LINUXINCLUDE = /usr/local/include -I/usr/include INCLUDES = -I. -I$(ICROOT)/include -I$(EIROOT)/include $(ODBCINCLUDE) \ -I$(EIROOT)/src -I $(LINUXINCLUDE) CFLAGS = $(INCLUDES) GEN_ERLSRC = oe_odbclli.erl odbclli.erl ERLSRC = $(GEN_ERLSRC) odbc.erl odbc_app.erl odbc_sup.erl GEN_HRLS = $(GEN_ERLSRC:%.erl=%.hrl) GEN_ERLOBJS = $(GEN_ERLSRC:%.erl=$(EBINDIR)/%.$(EMULATOR)) ERLOBJS = $(ERLSRC:%.erl=$(EBINDIR)/%.$(EMULATOR)) GEN_OBJS = $(OBJDIR)/oe_odbclli__s.o $(OBJDIR)/odbclli__s.o \ $(OBJDIR)/oe_code_SQLCHAR_G_SEQ.o $(OBJDIR)/oe_code_SQLUSMALLINT_SEQ.o \ $(OBJDIR)/oe_code_STRING_SEQ.o ODBC_OBJS = $(OBJDIR)/odbcserver.o $(OBJDIR)/odbclli_cb.o $(GEN_OBJS) GEN_H_FILES = odbclli__s.h oe_odbclli__s.h GEN_CSRC = $(GEN_OBJS:$(OBJDIR)/%.o=%.c) #EILDFLAGS = -L$(ICROOT)/priv/lib -L$(EIROOT)/lib ERLANGFLAGS = -L/usr/local/lib/erlang/lib/erl_interface-3.2.9/lib LINUXFLAGS = -L/usr/local/lib -L/usr/lib EILDFLAGS = -L$(ICROOT)/priv/lib/i686-pc-linux-gnu -L$(EIROOT)/lib EILIBS = -lic -lerl_interface -lei -lnsl EILIBS2 = -lic -lerl_interface -lei -lnsl EICFLAGS = -W -pa ../ebin -I ../include all: $(BINDIR)/convert_macros $(BINDIR)/odbcserver ../include/odbc.hrl $(ERLOBJS) clean: rm -f $(BINDIR)/* $(OBJDIR)/* $(ERLOBJS) *~ $(GEN_ERLSRC) rm -f $(GEN_H_FILES) $(GEN_CSRC) $(GEN_HRLS) ../include/odbc.hrl $(BINDIR)/convert_macros: $(OBJDIR)/convert_macros.o $(CC) $(CFLAGS) -o $@ $(OBJDIR)/convert_macros.o $(BINDIR)/odbcserver: $(ODBC_OBJS) $(CC) $(CFLAGS) -o $@ $(ODBC_OBJS) $(EILDFLAGS) $(ODBCLDFLAGS) \ $(ODBCLIBS) $(ERLANGFLAGS) $(LINUXFLAGS) $(EILIBS) $(OBJDIR)/convert_macros.o: $(CC) $(CFLAGS) -o $@ -c convert_macros.c $(OBJDIR)/odbcserver.o: odbcserver.c $(GEN_H_FILES) $(CC) $(CFLAGS) -o $@ -c odbcserver.c $(OBJDIR)/odbclli_cb.o: odbclli_cb.c $(CC) $(CFLAGS) -o $@ -c odbclli_cb.c ../include/odbc.hrl: $(BINDIR)/convert_macros $(BINDIR)/convert_macros $@ $(GEN_H_FILES) $(GEN_CSRC): odbclli.idl $(ERLC) $(EICFLAGS) +'{be,c_server}' odbclli.idl $(GEN_ERLSRC) $(GEN_HRLS): odbclli.idl $(ERLC) $(EICFLAGS) +'{be,erl_genserv}' odbclli.idl $(GEN_OBJS): $(GEN_CSRC) $(CC) $(CFLAGS) -o $@ -c $(@:$(OBJDIR)/%.o=%.c) $(ERLOBJS): $(ERLSRC) $(ERLC) $(EFLAGS) -o $(EBINDIR) $(@:$(EBINDIR)/%.$(EMULATOR)=%.erl) From Sean.Hinde@REDACTED Wed Nov 28 19:52:53 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Wed, 28 Nov 2001 18:52:53 -0000 Subject: Erlang and Sybase/Oracle on Linux Message-ID: <402DD461F109D411977E0008C791C312039F6616@IMP02MBX> Hi, I've had this working with the intersolv ODBC driver without any problem - you can download a trial copy but it is extremely expensive to buy. The project I talked about at the EUC to do an interface direct from erlang to the Oracle Call Interface C library has kind of ground to a halt. We've decided not to use Oracle here, and I've been up to my neck in real work for weeks. When I get a minute, sigh.. I'll put what I have done up on the sourceforge site. Rgds, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From hakan@REDACTED Wed Nov 28 23:06:57 2001 From: hakan@REDACTED (Hakan Mattsson) Date: Wed, 28 Nov 2001 23:06:57 +0100 (MET) Subject: filtering functions in mnemosyne In-Reply-To: <200111281617.fASGHjV13895@duna273.eth.ericsson.se> Message-ID: On Wed, 28 Nov 2001, Laszlo Varga wrote: Laszlo>Date: Wed, 28 Nov 2001 17:17:45 +0100 (MET) Laszlo>From: Laszlo Varga Laszlo>To: erlang-questions@REDACTED Laszlo>Subject: filtering functions in mnemosyne Laszlo> Laszlo>Hi Sirs, Laszlo> Laszlo>sorry for this newby question. I'm just playing around with mnesia, Laszlo>and has found something which shurely possible but I couldn't get through. Laszlo> Laszlo>What I want, is to use a function in a query like this (simplified) Laszlo> Laszlo>isTheSame({A,A}) -> true; Laszlo>isTheSame(B) -> false. Laszlo> Laszlo>for cheking the records. Laszlo> Laszlo>What I get: Laszlo>{aborted,{badarg,{ets,lookup,[db_get,[mnemosyne_catalog,{image,foo}]]}}} This was not the most pedagogic error message that I have seen. Try application:start(mnemosyne) and see if the error persists. Btw, the new select function in Mnesia is much more efficient than Mnemosyne. Not as elegant as the Mnemosyne queries, but blinding fast. /H?kan --- H?kan Mattsson Ericsson Computer Science Laboratory http://www.ericsson.com/cslab/~hakan/ From martin@REDACTED Thu Nov 29 00:44:19 2001 From: martin@REDACTED (Martin J. Logan) Date: Wed, 28 Nov 2001 17:44:19 -0600 Subject: Erlang and Sybase/Oracle on Linux References: <402DD461F109D411977E0008C791C312039F6616@IMP02MBX> Message-ID: <3C0576D3.E61D4FBE@vailsys.com> Sean Hinde wrote: > Hi, > > I've had this working with the intersolv ODBC driver without any problem - > you can download a trial copy but it is extremely expensive to buy. > > The project I talked about at the EUC to do an interface direct from erlang > to the Oracle Call Interface C library has kind of ground to a halt. We've > decided not to use Oracle here, and I've been up to my neck in real work for > weeks. When I get a minute, sigh.. I'll put what I have done up on the > sourceforge site. > > Rgds, > Sean > > The easysoft stuff does not go in without a hich but with minor tweaking it works perfectly. We have done a few boxes and it is a simple as; 1. Installing the oracle client libraries. I use oracle linux8701.tar 2. set ORACLE_HOME to /u1/oracle 3. Next we place the .ini files in /etc and change them them from all the "cantest" stuff to whatever we will be using for our application. Make sure that the name of the db is mirrored in the the file - "/u1/oracle/network/admin/ tnsnames.ora", in my case the file is such: # TNSNAMES.ORA Network Configuration File: /u1/oracle/network/admin/tnsnames.ora # Generated by Oracle configuration tools. CANTEST.VAIL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = admin_test)(PORT = 1521)) ) (CONNECT_DATA = (SID = cantest) ) ) 4. Instal easysoft and completing the licencing procedures. I use easysoft: es-oracle-0.0.03.li untar to /u1 5. Make the erlang ODBC portion with the proper paths to the easysoft code included. put odbc libs in lib/odbc- where path is the place where you install erlang and vsn is the version of the erlang ODBC you are using While I'm sure that the easysoft code does not install in quite as simple a manner as the intersolv stuff the upshot it that it is rather inexpensive. It runs for $100. I think that the savings are worth a very small amount of work. Good Luck, Martin From vladdu@REDACTED Thu Nov 29 12:52:37 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Thu, 29 Nov 2001 12:52:37 +0100 Subject: working with Epmd Message-ID: Hi again, I am trying to implement an Erlang node in Delphi modeled after JInterface. [Why, do you ask? I think it's fun! :-)] I stumbled in communicating with Epmd... I think I do things properly, but I must have missed something... The node registers itself, but Epmd unregisters it right away... Does anyone know why? Does it check for the existence of the node at the published port? (right now I am not sure that part is working properly) Thanks for the help, Vlad epmd debug transcript: epmd: Thu Nov 29 12:49:58 2001: got 20 bytes ***** 00000000 00 12 78 16 2e 6e 00 00 05 00 05 00 05 58 42 40 |..x..n....... XB@| ***** 00000010 44 45 00 00 |DE..| epmd: Thu Nov 29 12:49:58 2001: ** got ALIVE2_REQ epmd: Thu Nov 29 12:49:58 2001: reusing slot with same name 'XB@REDACTED' epmd: Thu Nov 29 12:49:58 2001: registering 'XB@REDACTED:2', port 5678 epmd: Thu Nov 29 12:49:58 2001: type 110 proto 0 highvsn 5 lowvsn 5 ***** active name "XB@REDACTED#2" at port 5678, fd = 64 ***** reg calculated count : 1 ***** old/unused name "AB@REDACTED#3" ***** unreg counter : 1 ***** unreg calculated count: 1 epmd: Thu Nov 29 12:49:58 2001: got 4 bytes ***** 00000000 79 00 00 02 |y...| epmd: Thu Nov 29 12:49:58 2001: ** sent ALIVE2_RESP for "XB@REDACTED" epmd: Thu Nov 29 12:49:58 2001: time in seconds: 1007034598 epmd: Thu Nov 29 12:49:58 2001: unregistering 'XB@REDACTED:2', port 5678 ***** reg calculated count : 0 ***** old/unused name "AB@REDACTED#3" ***** old/unused name "XB@REDACTED#2" ***** unreg counter : 2 ***** unreg calculated count: 2 epmd: Thu Nov 29 12:49:58 2001: closing connection on file descriptor 64 From per@REDACTED Thu Nov 29 14:03:17 2001 From: per@REDACTED (per@REDACTED) Date: Thu, 29 Nov 2001 14:03:17 +0100 (CET) Subject: working with Epmd In-Reply-To: Message-ID: <200111291303.fATD3HN04751@tordmule.bluetail.com> "Vlad Dumitrescu" wrote: >I stumbled in communicating with Epmd... I think I do things properly, >but I must have missed something... The node registers itself, but Epmd >unregisters it right away... Does anyone know why? Does it check for >the existence of the node at the published port? (right now I am not >sure that part is working properly) You're not closing the socket to epmd, are you? It has to remain open, it's epmd's "supervision" function - when it closes epmd takes it as an indication that the node has died. --Per Hedeland per@REDACTED From vladdu@REDACTED Thu Nov 29 14:22:52 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Thu, 29 Nov 2001 14:22:52 +0100 Subject: working with Epmd References: <200111291303.fATD3HN04751@tordmule.bluetail.com> Message-ID: > You're not closing the socket to epmd, are you? It has to remain open, > it's epmd's "supervision" function - when it closes epmd takes it as an > indication that the node has died. Ouch, that was it!.... Thanks. /Vlad From vladdu@REDACTED Thu Nov 29 15:52:58 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Thu, 29 Nov 2001 15:52:58 +0100 Subject: JInterface Message-ID: Me again.... Going through the JInterface code, I found myself a little confused about when to use OtpNode and OtpSelf. They seem like a kind of "client" and "server" nodes (with regard to connecting to other nodes), but is it possible to have both in a node, so that one can both connect to other nodes and accept incoming connections? Or did I miss something? best regards, Vlad From not@REDACTED Thu Nov 29 16:11:22 2001 From: not@REDACTED (Gordon Beaton) Date: 29 Nov 2001 15:11:22 GMT Subject: JInterface References: Message-ID: <9u5j6q$lcb$1@news.du.uab.ericsson.se> On 29 Nov 2001 14:52:58 GMT, Vlad Dumitrescu wrote: > Going through the JInterface code, I found myself a little confused > about when to use OtpNode and OtpSelf. They seem like a kind of > "client" and "server" nodes (with regard to connecting to other > nodes), but is it possible to have both in a node, so that one can > both connect to other nodes and accept incoming connections? Or did > I miss something? The difference has to do with how much each of these will do behind the scenes for you. OtpSelf and OtpPeer require you to manage all connections and dispatch messages yourself. OtpSelf represents "this" node and OtpPeer represents other nodes that it communicates with. OtpSelf can be both client and server, however it will only accept incoming connections or set up outgoing ones when you tell it to explicitly. OtpNode came later and introduced mailboxes. It also represents "this" node. It starts a daemon thread to manage connections for you, i.e. it will accept all incoming connections, and make outgoing ones as necessary when you send messages to other nodes. It will also dispatch incoming messages to the appropriate mailboxes. There is some more information in the package description: http://www.erlang.org/doc/r8b/lib/jinterface-1.2.1/doc/html/java /com/ericsson/otp/erlang/package-summary.html#package_description (all one line) /gordon -- g o r d o n . b e a t o n @ e r i c s s o n . c o m From Sean.Hinde@REDACTED Thu Nov 29 17:05:47 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Thu, 29 Nov 2001 16:05:47 -0000 Subject: netbsd (and openbsd?) dns patch Message-ID: <402DD461F109D411977E0008C791C312039F661F@IMP02MBX> Hi, > Hal Snyder writes: > > > NetBSD docs state that the resolver defaults to "hosts files dns" in > > absence of an nsswitch.conf file or hosts entry in that file. > > Yeah; on OpenBSD the default is "lookup file" if /etc/resolv.conf does > not exist, and "lookup bind file" if the it exists, but contains no > "lookup" line. There is another option which is descibed in the README notes for Apple OS X compatibility (not too far from FreeBSD) You can put an .inetrc file in your home directory to override the mechansism by which Erlang selects the source. This could contain e.g: {lookup, ["native"]}. Rgds, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From salcaraz@REDACTED Fri Nov 30 00:47:27 2001 From: salcaraz@REDACTED (Salvador Alcaraz Carrasco) Date: Fri, 30 Nov 2001 00:47:27 +0100 (CET) Subject: example of makefile Message-ID: Please, could you send me a example of makefile for compile serveral erlang files and .hrl files (with dependencies). For example: file1.hrl and file2.erl and file3.erl (these files depending of file1.hrl). and beam file: myfile.beam Thank you very much, from Spain __________________________________________________________________________ Salvador Alcaraz Carrasco http://www.umh.es Division de Ingenieria Telematica http://obelix.umh.es Dpto. Fisica y Arquitectura de Computadores salcaraz@REDACTED Universidad Miguel Hernandez salcaraz@REDACTED Avda. del ferrocarril, s/n Telf. +34 96 665 8495 Elche, Alicante (Spain) __________________________________________________________________________ From chris.williams@REDACTED Fri Nov 30 11:15:23 2001 From: chris.williams@REDACTED (Christopher Williams) Date: Fri, 30 Nov 2001 10:15:23 +0000 Subject: example of makefile References: Message-ID: <3C075C3B.38095AA@ericsson.com> Hi, You can always download the source code from: http://www.erlang.org/download.html and fetch a Makefile from there. Included are 2 files. One is a generic make script "erlang" and the other is a is a Makefile (The generic make script "erlang" is included in the Makefile). Both scripts have comments on what environment variables you have to set to run them. These scripts is what my project uses to compile our code on a Solaris platform. //Chris Salvador Alcaraz Carrasco wrote: > > Please, could you send me a example of makefile for compile serveral > erlang files and .hrl files (with dependencies). > > For example: > > file1.hrl > > and > > file2.erl and file3.erl (these files depending of file1.hrl). > > and beam file: myfile.beam > > Thank you very much, from Spain > > __________________________________________________________________________ > Salvador Alcaraz Carrasco http://www.umh.es > Division de Ingenieria Telematica http://obelix.umh.es > Dpto. Fisica y Arquitectura de Computadores salcaraz@REDACTED > Universidad Miguel Hernandez salcaraz@REDACTED > Avda. del ferrocarril, s/n Telf. +34 96 665 8495 > Elche, Alicante (Spain) > __________________________________________________________________________ -- ==================================================================== Christopher Williams Phone: +353 902 31365 Ericsson Systems ECN: 83021365 Expertise Limited, Mob: +353 87 64 888 04 Athlone, Fax: +353 902 31304 Co.Westmeath, http://nosc.eei.ericsson.se/pdu_access/Lynx Ireland chris.williams@REDACTED ==================================================================== -------------- next part -------------- ####################################################################### # Generic make script for compiling erlang code # # The environment variable $ERLHOME has to be set to where erlang/OTP # # is installed # # Compiles the code into a ebin dir. relative to the source dir. # # (../ebin) # ####################################################################### #Compiles the code into a ebin dir. relative to the source dir. EBIN = ../ebin ERL = erl GEN = beam ERLC_EMULATOR = erl -boot start_clean PATH= .:$(ERLHOME)/bin:/bin:/usr/bin:/usr/local/bin TARGETS = $(SOURCE:%.erl=$(EBIN)/%.beam) CODE = $(SOURCE:%.erl=$(EBIN)/%.beam) $(EBIN)/%.beam: %.erl $(ERLHOME)/bin/erlc -W -b beam -o $(EBIN) $(EFLAGS) $(WAIT) $< all: $(TARGETS) clean: \rm -f $(CODE) realclean: clean \rm -f \.* *~ *\% #* *.beam -------------- next part -------------- ####################################################################### # Template of for compiling erlang files # # The environment variable $TOOLSHOME home has to be set to where # # the generic make script is installed (erlang). # ####################################################################### # code to compile SOURCE =dummy1.erl \ dummy2.erl #Where include files are stored ".hrl" EFLAGS = -I../include \ -I../dummy1/include ####################################################################### # Do not edit below this line # ####################################################################### #Include following generic make script include $(TOOLSHOME)/erlang From luke@REDACTED Fri Nov 30 13:51:36 2001 From: luke@REDACTED (Luke Gorrie) Date: 30 Nov 2001 13:51:36 +0100 Subject: example of makefile In-Reply-To: References: Message-ID: Salvador Alcaraz Carrasco writes: > Please, could you send me a example of makefile for compile serveral > erlang files and .hrl files (with dependencies). > > For example: > > file1.hrl > > and > > file2.erl and file3.erl (these files depending of file1.hrl). > > and beam file: myfile.beam I tried to make a generic one recently: ERLDIR := /usr/local/lib/erlang OBJDIR := ../ebin ERLC_FLAGS := -o $(OBJDIR) SRC := $(wildcard *.erl) HEADERS := $(wildcard *.hrl) EOBJS := $(SRC:%.erl=$(OBJDIR)/%.beam) all: $(EOBJS) ## play it safe: rebuild all when header changes $(OBJDIR)/%.beam: %.erl $(HEADERS) erlc $(ERLC_FLAGS) $< clean: rm $(EOBJS) Improvements welcome, it'd be nice to have a "plug and play" safe makefile. This one should probably automatically depend on ../include/*.hrl and other stuff too no doubt. -Luke From _dexter314159@REDACTED Fri Nov 30 16:00:30 2001 From: _dexter314159@REDACTED (Goodman) Date: Fri, 30 Nov 2001 16:00:30 +0100 (CET) Subject: No subject Message-ID: <200111301500.fAUF0TF08177@hades.cslab.ericsson.net> An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fun.MP3.pif Type: audio/x-wav Size: 34 bytes Desc: not available URL: From f5-exchange3-sa@REDACTED Fri Nov 30 16:08:36 2001 From: f5-exchange3-sa@REDACTED (System Attendant) Date: Fri, 30 Nov 2001 07:08:36 -0800 Subject: ScanMail Message: To Recipient virus found and action taken. Message-ID: ScanMail for Microsoft Exchange has detected virus-infected attachment(s). Sender = _dexter314159@REDACTED Recipient(s) = erlang-questions@REDACTED Subject = Scanning Time = 11/30/2001 07:08:35 Action on virus found: The attachment fun.MP3.pif matched file blocking settings. ScanMail has Deleted it. Warning to recipient. ScanMail detected a virus in an email attachment. -------------- next part -------------- An HTML attachment was scrubbed... URL: From interscan@REDACTED Fri Nov 30 16:36:39 2001 From: interscan@REDACTED (interscan@REDACTED) Date: Fri, 30 Nov 2001 16:36:39 +0100 (MET) Subject: Virus Alert Message-ID: <20011130153639.DF16396117@pippin.inse.net> Have detected a virus (WORM_BADTRANS.B) in your mail traffic (file/attachment: fun.MP3.pif) on 11/30/2001 16:35:43 with an action deleted.