From vances@REDACTED Sun May 1 05:51:15 2005 From: vances@REDACTED (Vance Shipley) Date: Sat, 30 Apr 2005 23:51:15 -0400 Subject: Cascading Behaviours Message-ID: <20050501035115.GC15228@blank.motivity.ca> I wrote a HowTo for the trapexit site on tailoring behaviours by creating new behaviours which behave to those behaviours. It's at http://www.trapexit.org/docs/howto/cascading_behaviours.html. -Vance I also made an SNMP quick start HowTo. From ulf.wiger@REDACTED Sun May 1 08:42:31 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Sun, 1 May 2005 08:42:31 +0200 Subject: inets: request error on Windows XP Message-ID: Anders Nygren wrote: > This looks like a problem I have had too. > See, > http://www.erlang.org/ml-archive/erlang-questions/200503/msg00014.html > http://www.erlang.org/ml-archive/erlang-questions/200503/msg00045.html > > I never got any response to those, and I never found the problem. > I am happy to see that it works with a name instead of IP address. Following the second link, I found: > or from the shell > 7>Port=erlang:open_port({spawn,tcp_inet},[binary]). > #Port<0.36> > 8>erlang:port_control(Port,1,[2]). > [0,101,105,110,118,97,108] > > The funny thing is that I can set up a tcp connection > from the windows machine to the linux machine. But > not from the windows machine to the internet. The way it looks like (to me, who don't know the inet driver), is that you're trying to open an IPv6 socket, and your system doesn't support it (or, perhaps, Erlang on Windows wasn't built with IPv6 support enabled). I believe Windows XP has v6 support starting with SP1. Going from your windows machine to Internet, why would you want to run IPv6? /Uffe From rvg@REDACTED Mon May 2 11:02:28 2005 From: rvg@REDACTED (Rudolph van Graan) Date: Mon, 2 May 2005 11:02:28 +0200 Subject: Building R10B-3 on Mac OS X Tiger In-Reply-To: References: Message-ID: <2CE52832-2052-4240-9EB2-75D9FBD153E6@patternmatched.com> Hey all, I tried building Erlang from darwinports on Tiger last night and I am getting this problem: port install erlang .... make -f powerpc-apple-darwin8.0.0/Makefile TYPE=opt erl -noinput -pa ebin -run make_certs all /usr/bin/openssl \ -s erlang halt Generating a 1024 bit RSA private key .......++++++ .......++++++ writing new private key to '/opt/local/var/db/dports/build/ file._opt_local_var_db_dports_sources_rsync.rsync.opendarwin.org_dpupdat e_dports_lang_erlang/work/erlang-R10B-3/lib/ssl/examples/certs/etc/ erlangCA/private/key.pem' ----- =ERROR REPORT==== 2-May-2005::10:59:31 === Bad input fd in poll()! fd,port,driver,name: 18,53,spawn,/usr/bin/ openssl req -new -x509 -config /opt/local/var/db/dports/build/ file._opt_local_var_db_dports_sources_rsync.rsync.opendarwin.org_dpupdat e_dports_lang_erlang/work/erlang-R10B-3/lib/ssl/examples/certs/etc/ erlangCA/req.cnf -keyout /opt/local/var/db/dports/build/ file._opt_local_var_db_dports_sources_rsync.rsync.opendarwin.org_dpupdat e_dports_lang_erlang/work/erlang-R10B-3/lib/ssl/examples/certs/etc/ erlangCA/private/key.pem -out /opt/local/var/db/dports/build/ file._opt_local_var_db_dports_sources_rsync.rsync.opendarwin.org_dpupdat e_dports_lang_erlang/work/erlang-R10B-3/lib/ssl/examples/certs/etc/ erlangCA/cert.pem Any ideas? Regards, Rudolph van Graan Pattern Matched Technologies Mobile: +27 83 390 7767 Fax: +27 12 667 5342 Web: www.patternmatched.com On 01 May 2005, at 8:42 AM, Ulf Wiger ((AL/EAB)) wrote: > > Anders Nygren wrote: > > >> This looks like a problem I have had too. >> See, >> http://www.erlang.org/ml-archive/erlang-questions/200503/ >> msg00014.html >> http://www.erlang.org/ml-archive/erlang-questions/200503/ >> msg00045.html >> >> I never got any response to those, and I never found the problem. >> I am happy to see that it works with a name instead of IP address. >> > > Following the second link, I found: > > >> or from the shell >> 7>Port=erlang:open_port({spawn,tcp_inet},[binary]). >> #Port<0.36> >> 8>erlang:port_control(Port,1,[2]). >> [0,101,105,110,118,97,108] >> >> The funny thing is that I can set up a tcp connection >> from the windows machine to the linux machine. But >> not from the windows machine to the internet. >> > > The way it looks like (to me, who don't know the inet driver), > is that you're trying to open an IPv6 socket, and your > system doesn't support it (or, perhaps, Erlang on Windows > wasn't built with IPv6 support enabled). > > I believe Windows XP has v6 support starting with SP1. > > Going from your windows machine to Internet, why would > you want to run IPv6? > > /Uffe > > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2373 bytes Desc: not available URL: From joelr1@REDACTED Mon May 2 11:44:46 2005 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 2 May 2005 12:44:46 +0300 Subject: Automatic node discovery Message-ID: <20050502104446.7293@smtp.gmail.com> Folks, Is there a way for a new node coming up on a local network to broadcast its availability? I need a way to automatically add nodes to my cluster when they come up on a local network. I understand that I can send packets to a broadcast IP address but I'm not sure how to receive these packets. Thanks, Joel -- http://wagerlabs.com/tech From ingela@REDACTED Mon May 2 11:59:53 2005 From: ingela@REDACTED (Ingela Anderton) Date: Mon, 2 May 2005 11:59:53 +0200 Subject: inets: request error on Windows XP References: Message-ID: <17013.64025.369511.67913@gargle.gargle.HOWL> Ulf Wiger \(AL/EAB\) wrote: > > Anders Nygren wrote: > > > This looks like a problem I have had too. > > See, > > http://www.erlang.org/ml-archive/erlang-questions/200503/msg00014.html > > http://www.erlang.org/ml-archive/erlang-questions/200503/msg00045.html > > > > I never got any response to those, and I never found the problem. > > I am happy to see that it works with a name instead of IP address. > > Following the second link, I found: > > > or from the shell > > 7>Port=erlang:open_port({spawn,tcp_inet},[binary]). > > #Port<0.36> > > 8>erlang:port_control(Port,1,[2]). > > [0,101,105,110,118,97,108] > > > > The funny thing is that I can set up a tcp connection > > from the windows machine to the linux machine. But > > not from the windows machine to the internet. > > The way it looks like (to me, who don't know the inet driver), > is that you're trying to open an IPv6 socket, and your > system doesn't support it (or, perhaps, Erlang on Windows > wasn't built with IPv6 support enabled). > > I believe Windows XP has v6 support starting with SP1. > > Going from your windows machine to Internet, why would > you want to run IPv6? Looks like this problem could be releated to the inet-driver! On my unix machine: inet:getaddr("66.102.7.147", inet6). {ok,{0,0,0,0,0,65535,16998,1939}} On my windows machine: inet:getaddr("66.102.7.147", inet6). {ok,{66,102,7,147}} The reason why the http client will always try to use ipv6 is that it can not know in all situations if the server is using ipv6 or not. When trying to use ipv6 for a ipv4 host the address should be translated to an ipv4 address on ipv6 format and everything should run smoothly. Of course it would be possible to work around this problem in the connect function in http_transport.erl -- /Ingela - OTP team From flaig@REDACTED Mon May 2 12:11:51 2005 From: flaig@REDACTED (flaig@REDACTED) Date: Mon, 2 May 2005 12:11:51 +0200 Subject: Building R10B-3 on Mac OS X Tiger Message-ID: <200505021011.j42ABpBG014118@ger5.wwwserver.net> Am Montag, den 02.05.2005, 11:02 +0200 schrieb Rudolph van Graan: Hey all, > > I tried building Erlang from darwinports on Tiger last night and I am > getting this problem: > > port install erlang > > .... > > > make -f powerpc-apple-darwin8.0.0/Makefile TYPE=opt > erl -noinput -pa ebin -run make_certs all /usr/bin/openssl \ > -s erlang halt > Generating a 1024 bit RSA private key > .......++++++ > .......++++++ > writing new private key to '/opt/local/var/db/dports/build/ > file._opt_local_var_db_dports_sources_rsync.rsync.opendarwin.org_dpupdat > e_dports_lang_erlang/work/erlang-R10B-3/lib/ssl/examples/certs/etc/ > erlangCA/private/key.pem' > ----- > > =ERROR REPORT==== 2-May-2005::10:59:31 === [snip] > > Any ideas? > > Regards, > > Rudolph van Graan > > Pattern Matched Technologies > > Mobile: +27 83 390 7767 Fax: +27 12 667 5342 > Web: www.patternmatched.com > Hi Rudolph and who else has the problem, I ran into the same problem first with 10.2 and then with 10.3 ... by now I have dumped Apple's felines in favour of Yellow Dog :-P but I expect that this will be feasible for 10.4 too: - get the current version of the gcc suite from Apple (free download, though you have to register) - get the Erlang source code package - unpack it (via command line tools -- NOT StuffIt, that won't work!) - start the usual .configure/make/sudo make install dance - come back a few hours later and enjoy That did it, at least for me. Hope that helps! -- R??diger Marcus === Chevalier Dr. Dr. Ruediger Marcus Flaig | Germany -- where politicians are still real men Institute for Immunology | and sheep are scared. University of Heidelberg | Im Neuenheimer Feld 305 | Occam's Razor: Never opt for a complex theory D-69120 Heidelberg | if a simple one provides a sufficient explanation. Germany | Gibbon's Addendum: Never opt for a complex theory | if base motifs provide a sufficient explanation. -- Diese E-Mail wurde mit http://www.mail-inspector.de verschickt Mail Inspector ist ein kostenloser Service von http://www.is-fun.net Der Absender dieser E-Mail hatte die IP: 129.206.124.135 From joelr1@REDACTED Mon May 2 12:50:42 2005 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 2 May 2005 13:50:42 +0300 Subject: Automatic node discovery In-Reply-To: <20050502104446.7293@smtp.gmail.com> References: <20050502104446.7293@smtp.gmail.com> Message-ID: <20050502115042.29702@smtp.gmail.com> > Joel Reymont wrote: >Is there a way for a new node coming up on a local network to broadcast >its availability? I need a way to automatically add nodes to my cluster >when they come up on a local network. More precisely... If a new node broadcasts a particular UDP packet that other nodes are listening to and those nodes make contact with the new node would that be sufficient? I found this message from Ulf: http://www.erlang.org/ml-archive/erlang- questions/200007/msg00025.html but I do not want to use a configuration file and want things to be totally automated. Thanks, Joel -- http://wagerlabs.com/tech From joelr1@REDACTED Mon May 2 13:47:54 2005 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 2 May 2005 14:47:54 +0300 Subject: Automatic node discovery In-Reply-To: <427611EB.8030404@itsbeen.sent.com> References: <427611EB.8030404@itsbeen.sent.com> Message-ID: <20050502124754.20131@smtp.gmail.com> > erlq@REDACTED wrote: >Why not have a service that the nodes register with when they come up? >That way you could have servers anywhere and not worry about whether the >broadcast packets are being blocked by some >router/switch/iptables/netmask setting. How would this work in practice? That is how would a new box brought up on the network know what IP address the registration service is at? I would like to treat my poker server as a home appliace, a web- configurable router of sorts. It would seem that for the registration idea to work I would need to ask the user to enter the IP address of the box where the registration service is running. Correct me if I'm wrong. Thanks, Joel -- http://wagerlabs.com/tech From rvg@REDACTED Mon May 2 13:54:37 2005 From: rvg@REDACTED (Rudolph van Graan) Date: Mon, 2 May 2005 13:54:37 +0200 Subject: Building R10B-3 on Mac OS X Tiger In-Reply-To: <200505021011.j42ABpBG014118@ger5.wwwserver.net> References: <200505021011.j42ABpBG014118@ger5.wwwserver.net> Message-ID: To get past this specific error, I removed the examples/certs examples/src targets from /opt/local/var/db/dports/build/ file._opt_local_var_db_dports_sources_rsync.rsync.opendarwin.org_dpupdat e_dports_lang_erlang/work/erlang-R10B-3/lib/ssl/MakeFile and then continued by port -v install erlang The process when past the previous point now. Rudolph van Graan Pattern Matched Technologies Mobile: +27 83 390 7767 Fax: +27 12 667 5342 Web: www.patternmatched.com On 02 May 2005, at 12:11 PM, flaig@REDACTED wrote: > > Am Montag, den 02.05.2005, 11:02 +0200 schrieb Rudolph van Graan: > Hey all, > >> >> I tried building Erlang from darwinports on Tiger last night and I am >> getting this problem: >> >> port install erlang >> >> .... >> >> >> make -f powerpc-apple-darwin8.0.0/Makefile TYPE=opt >> erl -noinput -pa ebin -run make_certs all /usr/bin/openssl \ >> -s erlang halt >> Generating a 1024 bit RSA private key >> .......++++++ >> .......++++++ >> writing new private key to '/opt/local/var/db/dports/build/ >> file._opt_local_var_db_dports_sources_rsync.rsync.opendarwin.org_dpup >> dat >> e_dports_lang_erlang/work/erlang-R10B-3/lib/ssl/examples/certs/etc/ >> erlangCA/private/key.pem' >> ----- >> >> =ERROR REPORT==== 2-May-2005::10:59:31 === >> > [snip] > >> >> Any ideas? >> >> Regards, >> >> Rudolph van Graan >> >> Pattern Matched Technologies >> >> Mobile: +27 83 390 7767 >> > Fax: +27 12 667 5342 > >> Web: www.patternmatched.com >> >> > > > Hi Rudolph and who else has the problem, > > I ran into the same problem first with 10.2 and then with 10.3 ... > by now I have dumped Apple's felines in favour of Yellow Dog :-P > but I expect that this will be feasible for 10.4 too: > - get the current version of the gcc suite from Apple (free > download, though you have to register) > - get the Erlang source code package > - unpack it (via command line tools -- NOT StuffIt, that won't work!) > - start the usual .configure/make/sudo make install dance > - come back a few hours later and enjoy > That did it, at least for me. > Hope that helps! > > -- R?diger Marcus > > > > === > Chevalier Dr. Dr. Ruediger Marcus Flaig | Germany -- where > politicians are still real men > Institute for Immunology | and sheep are scared. > University of Heidelberg | > Im Neuenheimer Feld 305 | Occam's Razor: Never opt > for a complex theory > D-69120 Heidelberg | if a simple one > provides a sufficient explanation. > Germany | Gibbon's Addendum: Never > opt for a complex theory > | if base motifs provide > a sufficient explanation. > > > -- > Diese E-Mail wurde mit http://www.mail-inspector.de verschickt > Mail Inspector ist ein kostenloser Service von http://www.is-fun.net > Der Absender dieser E-Mail hatte die IP: 129.206.124.135 > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2373 bytes Desc: not available URL: From bertil@REDACTED Mon May 2 13:58:18 2005 From: bertil@REDACTED (Bertil Karlsson) Date: Mon, 02 May 2005 13:58:18 +0200 Subject: xmerl_scan {validation, true} In-Reply-To: <20050425060923.GM9417@fangora.autosys.us> References: <20050425060923.GM9417@fangora.autosys.us> Message-ID: <427615DA.1040308@erix.ericsson.se> This was a bug in xmerl, that now is corrected and probably will be part of the next open source release. /Bertil Michael McDaniel wrote: > using this DTD... > --------------------- > > > > > testListings (%listings;) #REQUIRED > > --------------------- > > results in > (m1@REDACTED)90> xmerl_scan:file("test.xml", [{validation,true}, {doctype_DTD, "foo.dtd"}]). > 2775- fatal: {invalid_nmtoken,"%listi"} > ** exited: {fatal,{{invalid_nmtoken,"%listi"},"./foo.dtd",7,20}} ** > > > although using this one works... > --------------------- > > > testListings (Rup | Bog | BoR) #REQUIRED > > --------------------- > > > QUESTION: > 1) is something incorrect with the first DTD or is it a bug in xmerl_scan using validation? > > > thanks, > > ~Michael > > From ulf.wiger@REDACTED Mon May 2 14:03:27 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 2 May 2005 14:03:27 +0200 Subject: Automatic node discovery Message-ID: One way to achieve this, if you're going to use mnesia anyway, is to have all nodes use this in their sys.config: [{mnesia, [{extra_db_nodes, MasterMnesiaNodes}]}]. where MasterMnesiaNodes are the (perhaps 2 or 3) nodes that have the disk-based database schema. All other nodes become diskless mnesia nodes, and can access the tables defined in the database (no matter where the physical tables reside). As a bonus, all nodes become aware of each other. The diskless nodes do not have to be known to mnesia in advance. /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Joel Reymont > Sent: den 2 maj 2005 13:48 > To: erlq@REDACTED > Cc: Erlang Users' List > Subject: Re: Automatic node discovery > > > > erlq@REDACTED wrote: > > >Why not have a service that the nodes register with when > they come up? > >That way you could have servers anywhere and not worry about > whether the > >broadcast packets are being blocked by some > >router/switch/iptables/netmask setting. > > How would this work in practice? That is how would a new box > brought up > on the network know what IP address the registration service is at? > > I would like to treat my poker server as a home appliace, a web- > configurable router of sorts. It would seem that for the registration > idea to work I would need to ask the user to enter the IP > address of the > box where the registration service is running. Correct me if > I'm wrong. > > Thanks, Joel > > -- > http://wagerlabs.com/tech > > > From rvg@REDACTED Mon May 2 14:28:07 2005 From: rvg@REDACTED (Rudolph van Graan) Date: Mon, 2 May 2005 14:28:07 +0200 Subject: Building R10B-3 on Mac OS X Tiger In-Reply-To: References: <200505021011.j42ABpBG014118@ger5.wwwserver.net> Message-ID: <7C71E521-51A4-431E-9B4D-665B6CCB97C2@patternmatched.com> Now erlang has installed. However, running it: wyemac:~ root# erl {error_logger,{{2005,5,2},{14,12,10}},'~s~n',['Bad input fd in poll ()! fd,port,driver,name: 0,59,tty_sl,tty_sl -c -e\n']} Erlang (BEAM) emulator version 5.4.4 [source] [hipe] =ERROR REPORT==== 2-May-2005::14:12:10 === Bad input fd in poll()! fd,port,driver,name: 0,59,tty_sl,tty_sl -c -e Eshell V5.4.4 (abort with ^G) 1> Ideas? Rudolph van Graan Pattern Matched Technologies Mobile: +27 83 390 7767 Fax: +27 12 667 5342 Web: www.patternmatched.com On 02 May 2005, at 1:54 PM, Rudolph van Graan wrote: > To get past this specific error, I removed the > > examples/certs > examples/src > > targets from > > /opt/local/var/db/dports/build/ > file._opt_local_var_db_dports_sources_rsync.rsync.opendarwin.org_dpupd > ate_dports_lang_erlang/work/erlang-R10B-3/lib/ssl/MakeFile > > and then continued by > > port -v install erlang > > The process when past the previous point now. > > Rudolph van Graan > > Pattern Matched Technologies > > Mobile: +27 83 390 7767 > Fax: +27 12 667 5342 > Web: www.patternmatched.com > > > On 02 May 2005, at 12:11 PM, flaig@REDACTED wrote: > > >> >> Am Montag, den 02.05.2005, 11:02 +0200 schrieb Rudolph van Graan: >> Hey all, >> >> >>> >>> I tried building Erlang from darwinports on Tiger last night and >>> I am >>> getting this problem: >>> >>> port install erlang >>> >>> .... >>> >>> >>> make -f powerpc-apple-darwin8.0.0/Makefile TYPE=opt >>> erl -noinput -pa ebin -run make_certs all /usr/bin/openssl \ >>> -s erlang halt >>> Generating a 1024 bit RSA private key >>> .......++++++ >>> .......++++++ >>> writing new private key to '/opt/local/var/db/dports/build/ >>> file._opt_local_var_db_dports_sources_rsync.rsync.opendarwin.org_dpu >>> pdat >>> e_dports_lang_erlang/work/erlang-R10B-3/lib/ssl/examples/certs/etc/ >>> erlangCA/private/key.pem' >>> ----- >>> >>> =ERROR REPORT==== 2-May-2005::10:59:31 === >>> >>> >> [snip] >> >> >>> >>> Any ideas? >>> >>> Regards, >>> >>> Rudolph van Graan >>> >>> Pattern Matched Technologies >>> >>> Mobile: +27 83 390 7767 >>> >>> >> Fax: +27 12 667 5342 >> >> >>> Web: www.patternmatched.com >>> >>> >>> >> >> >> Hi Rudolph and who else has the problem, >> >> I ran into the same problem first with 10.2 and then with 10.3 ... >> by now I have dumped Apple's felines in favour of Yellow Dog :-P >> but I expect that this will be feasible for 10.4 too: >> - get the current version of the gcc suite from Apple (free >> download, though you have to register) >> - get the Erlang source code package >> - unpack it (via command line tools -- NOT StuffIt, that won't work!) >> - start the usual .configure/make/sudo make install dance >> - come back a few hours later and enjoy >> That did it, at least for me. >> Hope that helps! >> >> -- R?diger Marcus >> >> >> >> === >> Chevalier Dr. Dr. Ruediger Marcus Flaig | Germany -- where >> politicians are still real men >> Institute for Immunology | and sheep are scared. >> University of Heidelberg | >> Im Neuenheimer Feld 305 | Occam's Razor: Never >> opt for a complex theory >> D-69120 Heidelberg | if a simple one >> provides a sufficient explanation. >> Germany | Gibbon's Addendum: >> Never opt for a complex theory >> | if base motifs provide >> a sufficient explanation. >> >> >> -- >> Diese E-Mail wurde mit http://www.mail-inspector.de verschickt >> Mail Inspector ist ein kostenloser Service von http://www.is-fun.net >> Der Absender dieser E-Mail hatte die IP: 129.206.124.135 >> >> >> >> > > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2373 bytes Desc: not available URL: From joelr1@REDACTED Mon May 2 14:38:02 2005 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 2 May 2005 15:38:02 +0300 Subject: Automatic node discovery In-Reply-To: References: Message-ID: <20050502133802.20962@smtp.gmail.com> > Ulf Wiger (AL/EAB) wrote: >One way to achieve this, if you're going to use mnesia >anyway, is to have all nodes use this in their sys.config: > >[{mnesia, [{extra_db_nodes, MasterMnesiaNodes}]}]. Is there a way to modify this configuration dynamically or even not use the sys.config file at all? Initially there will be one node in the cluster. When adding a new box (running Erlang of course) the user will need to tell it the IP address of the existing node. This works for Luke and his company's line of clusterable appliances so it should work for me :-). How would I make the new node a Mnesia master without editing sys.config, though? Thanks, Joel -- http://wagerlabs.com/tech From joelr1@REDACTED Mon May 2 14:42:42 2005 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 2 May 2005 15:42:42 +0300 Subject: Automatic node discovery In-Reply-To: References: Message-ID: <20050502134242.32477@smtp.gmail.com> > Ulf Wiger (AL/EAB) wrote: >One way to achieve this, if you're going to use mnesia >anyway, is to have all nodes use this in their sys.config: > >[{mnesia, [{extra_db_nodes, MasterMnesiaNodes}]}]. Maybe editing the sys.config file is unavoidable but I should simply generate to it from Erlang. Otherwise the user would have to reconfigure the nodes when they crash. Am I going in the right direction? Thanks, Joel -- http://wagerlabs.com/tech From bjorn@REDACTED Mon May 2 15:28:59 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 02 May 2005 15:28:59 +0200 Subject: Windows missing registry entries? In-Reply-To: References: Message-ID: I have not checked this, but I think that the bug is in start_erl. The Erlang emulator no longer uses the registry, so start_erl shouldn't look there. /Bjorn Anders Nygren writes: > Hi > I am have been trying to get Erlang to run in embedded mode on windows and > noticed that start_erl looks for two registry entries > software/Ericsson/Erlang/vsn/Bindir > software/Ericsson/Erlang/vsn/Rootdir > > These entries are not added by the default windows installation for > R10B-3 and 4. > Is that a bug in the installation or the documentation? > > /Anders > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From francesco@REDACTED Mon May 2 16:10:22 2005 From: francesco@REDACTED (Francesco Cesarini (Erlang Training & Consulting)) Date: Mon, 02 May 2005 15:10:22 +0100 Subject: RA and PhD positions available In-Reply-To: <200504291341.j3TDf0HO007276@holly.dcs.shef.ac.uk> References: <200504291341.j3TDf0HO007276@holly.dcs.shef.ac.uk> Message-ID: <427634CE.4090508@erlang-consulting.com> John, I would add that these positions are based on an EPSRC grant, which in plain English means that the UK Government is now funding Erlang research! I think this is great news and something to be proud of. Well done! If some of you are curious over the line the research will take, more information is available at http://gow.epsrc.ac.uk/ViewGrant.aspx?Mode=Latest&Grant=EP/C524969/1 Best regards, Francesco -- http://www.erlang-consulting.com John Derrick wrote: > (Apologies if you get duplicates of this message). > > We have a 3-year PostDoc position at Sheffield for work on verification of > Erlang programs. Please pass on to anyone who may be interested. > Further details at: > > http://www.dcs.shef.ac.uk/research/job_opp/pr3650.html > > > We also have a PhD Studentship for work on developing testing techniques > applicable to Erlang code. Please pass on to anyone who may be interested. > Further details at: > > http://www.dcs.shef.ac.uk/research/phd_opp/jd_phd.htm > > Best, > John > > > From ulf.wiger@REDACTED Mon May 2 16:16:59 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 2 May 2005 16:16:59 +0200 Subject: Automatic node discovery Message-ID: On May 2, Joel Reymont wrote: > > > Ulf Wiger (AL/EAB) wrote: > >One way to achieve this, if you're going to use mnesia > >anyway, is to have all nodes use this in their sys.config: > > > >[{mnesia, [{extra_db_nodes, MasterMnesiaNodes}]}]. > > Is there a way to modify this configuration dynamically or > even not use > the sys.config file at all? erl -mnesia extra_db_nodes \[foo@REDACTED,bar@REDACTED\] The backslashes are needed for the Unix shell. Furthermore, you cannot put any spaces after commas, and such -- the usual stuff. You can also set this from within Erlang, but not in any way that isn't frowned upon, I think. Look e.g. at application:set_env/3, and observe well the warning. (: You'd need to first load mnesia, then set the env variable, then start mnesia, but if you want to use a boot script that starts it all, you'd have to tweak it in order to get it working (e.g. by inserting an {apply,application, set_env,...} in the boot script before start of mnesia.) Not a good idea. /Uffe From bertil@REDACTED Mon May 2 16:55:33 2005 From: bertil@REDACTED (Bertil Karlsson) Date: Mon, 02 May 2005 16:55:33 +0200 Subject: xmerl_scan {validation, true} In-Reply-To: <427615DA.1040308@erix.ericsson.se> References: <20050425060923.GM9417@fangora.autosys.us> <427615DA.1040308@erix.ericsson.se> Message-ID: <42763F65.8060608@erix.ericsson.se> The content of the fix is as follows: diff xmerl_scan.erl@@/main/xmerl/90 xmerl_scan.erl@@/main/xmerl/89 2785,2790d2784 < scan_nmtoken("%"++T, S0=#xmerl_scanner{environment={external,_}}) -> < ?bump_col(1), < {PERefName, T1, S1} = scan_pe_reference(T, S), < ExpRef = expand_pe_reference(PERefName, S1,as_PE), < {_,T2,S2} = strip(ExpRef ++ T1,S1), < scan_nmtoken(T2,S2); /Bertil Bertil Karlsson wrote: > This was a bug in xmerl, that now is corrected and probably will be part > of the next open source release. > /Bertil > > Michael McDaniel wrote: > >> using this DTD... >> --------------------- >> >> >> >> >> > testListings (%listings;) #REQUIRED >> >> --------------------- >> >> results in >> (m1@REDACTED)90> xmerl_scan:file("test.xml", >> [{validation,true}, {doctype_DTD, "foo.dtd"}]). >> 2775- fatal: {invalid_nmtoken,"%listi"} >> ** exited: {fatal,{{invalid_nmtoken,"%listi"},"./foo.dtd",7,20}} ** >> >> >> although using this one works... >> --------------------- >> >> >> > testListings (Rup | Bog | BoR) #REQUIRED >> >> --------------------- >> >> >> QUESTION: 1) is something incorrect with the first DTD or is it a bug >> in xmerl_scan using validation? >> >> >> thanks, >> >> ~Michael >> >> > > From james.hague@REDACTED Mon May 2 18:43:38 2005 From: james.hague@REDACTED (James Hague) Date: Mon, 2 May 2005 11:43:38 -0500 Subject: Line number of file:consult errors? Message-ID: A typo in the middle of a 100 line file gives the cold error message "syntax error before: '{'" or somesuch, but no line number at all. Is there a way to get line number information for these errors? James From dietmar@REDACTED Tue May 3 12:53:07 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Tue, 03 May 2005 12:53:07 +0200 Subject: compiler bug Message-ID: <42775813.4050400@ast.dfs.de> On the 02/14/05 mbj reported the following compiler bug ! I just got some quite simillar error ! Has this bug been fixed for R10B-4 Dietmar Thanks! We'll try to fix the bugs for R10B-4. /Bjorn mbj@REDACTED writes: >> Hi, >> >> I've found a bug in the compiler, same in R10B-2 and 3. Seems to work >> fine in R9. >> >> Run xx:y() and you'll get >> >> ** exited: {{badrecord,bar}, >> [{xx,x,1}, >> >> If e.g. the call to noop is removed it works fine. >> >> >> While trying to isolate this error into a small example module, I >> found another bug. Compiling zz.erl gives: >> >> zz: function x/1+25: >> Internal consistency check failed - please report this bug. >> Instruction: {get_tuple_element,{y,2},2,{x,0}} >> Error: {bad_type,{needed,{tuple_element,3}},{actual,{tuple,[2]}}}: >> >> >> >> I'm running on linux, normal erlang installation. >> >> >> >> /martin >> -module(zz). >> -compile(export_all). >> >> -record(bar, {status, vs = []}). >> >> y() -> >> x({foo, 1, []}). >> >> get_bar() -> >> #bar{status = 1}. >> >> x(Trans) -> >> {foo, Barno, _} = Trans, >> case get_bar() of >> Bar when Bar#bar.status /= 2 -> >> if 1 == 1 -> >> mnesia:dirty_delete({bar, Barno}), >> Vs = [1,2] ++ Bar#bar.vs, >> Bar33 = Bar#bar{status = 1}, >> Bar1 = Bar#bar{status = 3, >> vs = Vs}, >> [{payment, Barno}]; >> true -> >> Barno >> end; >> _ -> >> Trans >> end. >> >> -module(xx). >> -compile(export_all). >> >> -record(bar, {status}). >> >> y() -> >> x({foo, 1}). >> >> get_bar() -> >> #bar{status = 1}. >> >> x(Trans) -> >> {foo, Barno} = Trans, >> case get_bar() of >> Bar when Bar#bar.status == 1 -> >> noop(Bar), >> Bar33 = Bar#bar{status = 1}, >> {ok, Bar33, Barno}; >> _ -> >> Trans >> end. >> >> noop(_) -> >> ok. > > From bjorn@REDACTED Tue May 3 14:15:11 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 03 May 2005 14:15:11 +0200 Subject: compiler bug In-Reply-To: <42775813.4050400@ast.dfs.de> References: <42775813.4050400@ast.dfs.de> Message-ID: Yes, it was corrected in R10B-4. But there will be some more bug fixes in R10B-5. The internal validation pass (beam_validator) in R10B-4 can in some case cause an internal error when in the fact the generated code was correct. /Bjorn Dietmar Schaefer writes: > On the 02/14/05 mbj reported the following compiler bug ! > > I just got some quite simillar error ! > > > Has this bug been fixed for R10B-4 > > Dietmar > > > > Thanks! > > We'll try to fix the bugs for R10B-4. > > /Bjorn > > mbj@REDACTED writes: > > > >> Hi, > >> I've found a bug in the compiler, same in R10B-2 and 3. Seems to > >> work > >> fine in R9. > >> Run xx:y() and you'll get ** exited: {{badrecord,bar}, > >> [{xx,x,1}, > >> If e.g. the call to noop is removed it works fine. > >> While trying to isolate this error into a small example module, I > >> found another bug. Compiling zz.erl gives: > >> zz: function x/1+25: > >> Internal consistency check failed - please report this bug. > >> Instruction: {get_tuple_element,{y,2},2,{x,0}} > >> Error: {bad_type,{needed,{tuple_element,3}},{actual,{tuple,[2]}}}: > >> I'm running on linux, normal erlang installation. > >> /martin > >> -module(zz). > >> -compile(export_all). > >> -record(bar, {status, vs = []}). > >> y() -> > >> x({foo, 1, []}). > >> get_bar() -> > >> #bar{status = 1}. > >> x(Trans) -> > >> {foo, Barno, _} = Trans, > >> case get_bar() of > >> Bar when Bar#bar.status /= 2 -> > >> if 1 == 1 -> > >> mnesia:dirty_delete({bar, Barno}), > >> Vs = [1,2] ++ Bar#bar.vs, > >> Bar33 = Bar#bar{status = 1}, > >> Bar1 = Bar#bar{status = 3, > >> vs = Vs}, > >> [{payment, Barno}]; > >> true -> > >> Barno > >> end; > >> _ -> > >> Trans > >> end. > >> -module(xx). > >> -compile(export_all). > >> -record(bar, {status}). > >> y() -> > >> x({foo, 1}). > >> get_bar() -> > >> #bar{status = 1}. > >> x(Trans) -> > >> {foo, Barno} = Trans, > >> case get_bar() of > >> Bar when Bar#bar.status == 1 -> > >> noop(Bar), > >> Bar33 = Bar#bar{status = 1}, > >> {ok, Bar33, Barno}; > >> _ -> > >> Trans > >> end. > >> noop(_) -> > >> ok. > > > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From mikael.karlsson@REDACTED Tue May 3 17:28:15 2005 From: mikael.karlsson@REDACTED (Mikael Karlsson) Date: Tue, 3 May 2005 17:28:15 +0200 Subject: xmerl_scan {validation, true} In-Reply-To: <42763F65.8060608@erix.ericsson.se> References: <20050425060923.GM9417@fangora.autosys.us> <427615DA.1040308@erix.ericsson.se> <42763F65.8060608@erix.ericsson.se> Message-ID: <200505031728.15760.mikael.karlsson@creado.com> I have similar problem (OTB R10B-3) Something with a page break, like: seems to give me 3326- fatal: unexpected_end === reason={error,{fatal,{unexpected_end,"./mp.dtd",131,156}}} Regards Mikael m?ndag 02 maj 2005 16:55 skrev Bertil Karlsson: > The content of the fix is as follows: > diff xmerl_scan.erl@@/main/xmerl/90 xmerl_scan.erl@@/main/xmerl/89 > 2785,2790d2784 > < scan_nmtoken("%"++T, S0=#xmerl_scanner{environment={external,_}}) -> > < ?bump_col(1), > < {PERefName, T1, S1} = scan_pe_reference(T, S), > < ExpRef = expand_pe_reference(PERefName, S1,as_PE), > < {_,T2,S2} = strip(ExpRef ++ T1,S1), > < scan_nmtoken(T2,S2); > > > /Bertil > > Bertil Karlsson wrote: > > This was a bug in xmerl, that now is corrected and probably will be part > > of the next open source release. > > /Bertil > > > > Michael McDaniel wrote: > >> using this DTD... > >> --------------------- > >> > >> > >> > >> > >> >> testListings (%listings;) #REQUIRED > >> > >> --------------------- > >> > >> results in > >> (m1@REDACTED)90> xmerl_scan:file("test.xml", > >> [{validation,true}, {doctype_DTD, "foo.dtd"}]). > >> 2775- fatal: {invalid_nmtoken,"%listi"} > >> ** exited: {fatal,{{invalid_nmtoken,"%listi"},"./foo.dtd",7,20}} ** > >> > >> > >> although using this one works... > >> --------------------- > >> > >> > >> >> testListings (Rup | Bog | BoR) #REQUIRED > >> > >> --------------------- > >> > >> > >> QUESTION: 1) is something incorrect with the first DTD or is it a bug > >> in xmerl_scan using validation? > >> > >> > >> thanks, > >> > >> ~Michael From kenneth.lundin@REDACTED Tue May 3 17:50:20 2005 From: kenneth.lundin@REDACTED (Kenneth) Date: Tue, 3 May 2005 17:50:20 +0200 Subject: .config file bug on Windows References: Message-ID: <20050503155020.2857B469E4@bang.trapexit.org> Hi, The problem you have encountered is not at all Windows specific, the same error will happen on all platforms when there are no characters after the ending dot. For example a config file containing the following string will give the effect described below: "[{kernel,[{envvar,1}]}]." % this causes problems "[{kernel,[{envvar,1}]}]. " % this is no problem (extra space after dot) I have a vague memory that this is a known problem in erl_scan:tokens/3 but I have to check. Anyway there is an easy workaround until this gets corrected. /Kenneth anders_n wrote: Hi On Windows it is necessary for a .config file to end with an empty line. If not the emulator will crash with {error_logger,{{2005,4,29},{18,17,8}},'"./sys.config": none: not foundn',[]} /Anders Post generated using Mail2Forum (http://m2f.sourceforge.net) (end of quote) _________________________________________________________ Sent using Mail2Forum (http://m2f.sourceforge.net) From luke@REDACTED Tue May 3 20:05:22 2005 From: luke@REDACTED (Luke Gorrie) Date: 03 May 2005 20:05:22 +0200 Subject: New record type? Message-ID: Howdy, Can we have that better record type in Erlang soon, please? From kostis@REDACTED Tue May 3 20:20:37 2005 From: kostis@REDACTED (Kostis Sagonas) Date: Tue, 3 May 2005 20:20:37 +0200 (MEST) Subject: New record type? In-Reply-To: Mail from 'Luke Gorrie ' dated: 03 May 2005 20:05:22 +0200 Message-ID: <200505031820.j43IKbNl007361@spikklubban.it.uu.se> Luke Gorrie wrote: > Can we have that better record type in Erlang soon, please? Depends... do you _really_ want to have types? ;) Kostis From anders.nygren@REDACTED Wed May 4 00:15:51 2005 From: anders.nygren@REDACTED (Anders Nygren) Date: Tue, 3 May 2005 17:15:51 -0500 Subject: .config file bug on Windows In-Reply-To: <20050503155020.2857B469E4@bang.trapexit.org> References: <20050503155020.2857B469E4@bang.trapexit.org> Message-ID: On 5/3/05, Kenneth wrote: > > Hi, > > The problem you have encountered is not at all Windows specific, > > the same error will happen on all platforms when there are no > > characters after the ending dot. That is not true, on Linux it works with R10B-4, Look here. anders@REDACTED:~/src/test> uname -a Linux linux 2.6.8-24.14-default #1 Tue Mar 29 09:27:43 UTC 2005 i686 i686 i386 GNU/Linux Case 1, nothing after . anders@REDACTED:~/src/test> cat sys.config [{mnesia,[{dir,"path"}]}]. anders@REDACTED:~/src/test> erl -config sys.config Erlang (BEAM) emulator version 5.4.5 [source] [hipe] Eshell V5.4.5 (abort with ^G) 1> case 2, Comment immediately after . anders@REDACTED:~/src/test> cat sys.config [{mnesia,[{dir,"path"}]}].%test anders@REDACTED:~/src/test> erl -config sys.config Erlang (BEAM) emulator version 5.4.5 [source] [hipe] Eshell V5.4.5 (abort with ^G) 1> But on windows, if I dont have a newline, (I havn't tested with space after the .) it fails. > I have a vague memory that this is a known problem in erl_scan:tokens/3 > > but I have to check. Similar things have been reported earlier, but apparently it is not fixed everywhere. /Anders From anders.nygren@REDACTED Wed May 4 02:20:16 2005 From: anders.nygren@REDACTED (Anders Nygren) Date: Tue, 3 May 2005 19:20:16 -0500 Subject: .config file bug (probably not Windows specific) In-Reply-To: <17016.1310.849166.359480@antilipe.corelatus.se> References: <20050503155020.2857B469E4@bang.trapexit.org> <17016.1310.849166.359480@antilipe.corelatus.se> Message-ID: On 5/3/05, Matthias Lang wrote: > Anders Nygren writes: > > > That is not true, on Linux it works with R10B-4, > > Are you sure? > > > Case 1, nothing after . > > Are you really sure? > > > anders@REDACTED:~/src/test> cat sys.config > > [{mnesia,[{dir,"path"}]}]. > > anders@REDACTED:~/src/test> erl -config sys.config > > Your 'sys.config' file probably contains an 0x0a after the '.'. If > there really was nothing at all after the '.', then the prompt after > the 'cat' command would not be on its own line. anders@REDACTED:~/src/test> wc sys.config 1 1 32 sys.config And vi only shows one line with text, like this [{mnesia,[{dir,"path"}]}].%test ~ ~ So to me it looks like it is only one line, but maybe I am mistaken. > > Here's what happens on my system when I use a config file which > doesn't contain anything after the '.'. > > otp_src_R10B-4 >hexdump -C /tmp/sys.config > 00000 5b 7b 6d 6e 65 73 69 61 2c 5b 7b 64 69 72 2c 22 |[{mnesia,[{dir,"| > 00010 70 61 74 68 22 7d 5d 7d 5d 2e |path"}]}].| > 0001a > otp_src_R10B-4 >bin/erl -config /tmp/sys.config > {error_logger,{{2005,5,4},{1,0,15}},'"/tmp/sys.config": none: > not found\n',[]} > ... > > Looks a lot like the behaviour you're claiming is windows-specific. > > Do you have a test case which behaves differently on Windows and Linux? > I dont have access to the windows machine right now, I try to do it tomorrow. /Anders From matthias@REDACTED Wed May 4 01:11:26 2005 From: matthias@REDACTED (Matthias Lang) Date: Wed, 4 May 2005 01:11:26 +0200 Subject: .config file bug (probably not Windows specific) In-Reply-To: References: <20050503155020.2857B469E4@bang.trapexit.org> Message-ID: <17016.1310.849166.359480@antilipe.corelatus.se> Anders Nygren writes: > That is not true, on Linux it works with R10B-4, Are you sure? > Case 1, nothing after . Are you really sure? > anders@REDACTED:~/src/test> cat sys.config > [{mnesia,[{dir,"path"}]}]. > anders@REDACTED:~/src/test> erl -config sys.config Your 'sys.config' file probably contains an 0x0a after the '.'. If there really was nothing at all after the '.', then the prompt after the 'cat' command would not be on its own line. Here's what happens on my system when I use a config file which doesn't contain anything after the '.'. otp_src_R10B-4 >hexdump -C /tmp/sys.config 00000 5b 7b 6d 6e 65 73 69 61 2c 5b 7b 64 69 72 2c 22 |[{mnesia,[{dir,"| 00010 70 61 74 68 22 7d 5d 7d 5d 2e |path"}]}].| 0001a otp_src_R10B-4 >bin/erl -config /tmp/sys.config {error_logger,{{2005,5,4},{1,0,15}},'"/tmp/sys.config": none: not found\n',[]} ... Looks a lot like the behaviour you're claiming is windows-specific. Do you have a test case which behaves differently on Windows and Linux? Matthias From bjorn@REDACTED Wed May 4 10:19:32 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 04 May 2005 10:19:32 +0200 Subject: .config file bug (probably not Windows specific) In-Reply-To: References: <20050503155020.2857B469E4@bang.trapexit.org> <17016.1310.849166.359480@antilipe.corelatus.se> Message-ID: We will probably fix the bug in R10B-6. And for the record, I can also reproduce the bug on my Solaris machine: strider 81> erl -config sys.config {error_logger,{{2005,5,4},{10,11,12}},'"./sys.config": none: not found\n',[]} {"could not start kernel pid",application_controller,{error,config_error}} ... Also: strider 85> wc sys.config 0 1 26 sys.config /Bjorn Anders Nygren writes: > On 5/3/05, Matthias Lang wrote: > > Anders Nygren writes: > > > > > That is not true, on Linux it works with R10B-4, > > > > Are you sure? > > > > > Case 1, nothing after . > > > > Are you really sure? > > > > > anders@REDACTED:~/src/test> cat sys.config > > > [{mnesia,[{dir,"path"}]}]. > > > anders@REDACTED:~/src/test> erl -config sys.config > > > > Your 'sys.config' file probably contains an 0x0a after the '.'. If > > there really was nothing at all after the '.', then the prompt after > > the 'cat' command would not be on its own line. > > anders@REDACTED:~/src/test> wc sys.config > 1 1 32 sys.config > > And vi only shows one line with text, like this > > [{mnesia,[{dir,"path"}]}].%test > ~ > ~ > > So to me it looks like it is only one line, but maybe I am mistaken. > > > > > Here's what happens on my system when I use a config file which > > doesn't contain anything after the '.'. > > > > otp_src_R10B-4 >hexdump -C /tmp/sys.config > > 00000 5b 7b 6d 6e 65 73 69 61 2c 5b 7b 64 69 72 2c 22 |[{mnesia,[{dir,"| > > 00010 70 61 74 68 22 7d 5d 7d 5d 2e |path"}]}].| > > 0001a > > otp_src_R10B-4 >bin/erl -config /tmp/sys.config > > {error_logger,{{2005,5,4},{1,0,15}},'"/tmp/sys.config": none: > > not found\n',[]} > > ... > > > > Looks a lot like the behaviour you're claiming is windows-specific. > > > > Do you have a test case which behaves differently on Windows and Linux? > > > > I dont have access to the windows machine right now, I try to do it tomorrow. > > /Anders > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From erlang@REDACTED Wed May 4 11:29:59 2005 From: erlang@REDACTED (Peter Lund) Date: Wed, 04 May 2005 11:29:59 +0200 Subject: Stack traces R10B-4 on windows ? Message-ID: <42789617.8070601@lundata.se> I have upgraded to R10B-4 on my windows XP computer. Suddenly, I do not seem to get the normal stack trace print-outs when my gen_server craches. I only get my own io:format printout when it restarts... Has this changed in any way since R9? /Peter From matthias@REDACTED Wed May 4 12:08:02 2005 From: matthias@REDACTED (Matthias Lang) Date: Wed, 4 May 2005 12:08:02 +0200 Subject: Stack traces R10B-4 on windows ? In-Reply-To: <42789617.8070601@lundata.se> References: <42789617.8070601@lundata.se> Message-ID: <17016.40706.597683.252580@antilipe.corelatus.se> Peter Lund writes: > I have upgraded to R10B-4 on my windows XP boat anchor. Suddenly, > I do not seem to get the normal stack trace print-outs > when my gen_server crashes. I only get my own io:format > printout when it restarts... > > Has this changed in any way since R9? It's probably using a boot script other than the one which starts SASL. Does it work if you start erlang like this: erl -boot start_sasl -sasl errlog_type error Matthias From maruthavanan_s@REDACTED Wed May 4 12:08:36 2005 From: maruthavanan_s@REDACTED (maruthavanan s) Date: Wed, 04 May 2005 10:08:36 +0000 Subject: Background exe not exiting Message-ID: Hi, I am using erlang interface to communicate with c exe and erlang node.in windows enviroment I have used the same concept used in samples of erlang interface.... I am using os:cmd(name of the exe) to execute the c exe. I am able to pass messages to and fro between erlang and C exe. when i close the program my C exe is not exiting....but my C exe is closing when i try without using os:cmd()....i.e i am opening the erlang node and then running my c exe..when the connection is established i close the erlang node..this time exe closes by it self... What could be wrong...? can any one please help me in this regard... Thanks maruthavanan.S _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From esbjorn@REDACTED Wed May 4 13:01:29 2005 From: esbjorn@REDACTED (=?ISO-8859-1?Q?Esbj=F6rn_K=F6hler?=) Date: Wed, 4 May 2005 13:01:29 +0200 Subject: compile OTP without ncurses? Message-ID: <20050504130129.774d22e3@localhost> I want to build OTP R10-B4 on a linux system without curses, but configure does not seem to let me. Is there a way to skip that dependency? /esbj?rn From mickael.remond@REDACTED Thu May 5 19:43:51 2005 From: mickael.remond@REDACTED (=?ISO-8859-1?Q?Micka=EBl_R=E9mond?=) Date: Thu, 5 May 2005 19:43:51 +0200 Subject: MacOSX 10.4 Erlang problem Message-ID: <6ED456A9-16DD-4712-83FA-D8DA03F9C35D@erlang-fr.org> Hello, I am currently trying to make Erlang run on MacOSX (Tiger) version, and I encountered several problems: - I first try to run the Erlang REPOS version that is reported to run on the previous version of MacOSX (10.3), but I get the following error: -=-=-=- louxor-erlang-fr-org:/Volumes/REPOS mremond$ ./start.sh {error_logger,{{2005,5,5},{19,26,22}},'~s~n',['Bad input fd in poll ()! fd,port,driver,name: 0,85,tty_sl,tty_sl -c -e\n']} Erlang (BEAM) emulator version 5.4.4 [source] [threads:0] =ERROR REPORT==== 5-May-2005::19:26:22 === Bad input fd in poll()! fd,port,driver,name: 0,85,tty_sl,tty_sl -c -e -=-=-=- The user process cannot start, from what I understand, so I cannot type anything from the console (Only Ctrl-c to switch to break mode, and leave). Erlang seems to be working otherwise (for example, erlc is working fine). When I try to compile Erlang, I end up with the same problem. I encounter a small minor problem when compile the ssl application. I had to disable the example certificate generation, as openssl does not like the .cnf file that are used as configuration file (and thus lead to a port crash and hang forever). I will investigate further, but in the mean time, if you have any idea on how to solve the problem, it will probably be a valuable help. Cheers, -- Micka?l R?mond From chas@REDACTED Thu May 5 19:58:27 2005 From: chas@REDACTED (Charles Blair) Date: Thu, 5 May 2005 12:58:27 -0500 Subject: Building R10B-3 on Mac OS X Tiger In-Reply-To: <7C71E521-51A4-431E-9B4D-665B6CCB97C2@patternmatched.com> References: <200505021011.j42ABpBG014118@ger5.wwwserver.net> <7C71E521-51A4-431E-9B4D-665B6CCB97C2@patternmatched.com> Message-ID: <20050505175827.GH5066@jump.lib.uchicago.edu> > {error_logger,{{2005,5,2},{14,12,10}},'~s~n',['Bad input fd in poll > ()! fd,port,driver,name: 0,59,tty_sl,tty_sl -c -e\n']} this worked for me (R10B-4): move /usr/include/poll.h and /usr/include/sys/poll.h out of the way, then configure and make as usual. From mickael.remond@REDACTED Fri May 6 01:50:14 2005 From: mickael.remond@REDACTED (=?ISO-8859-1?Q?Micka=EBl_R=E9mond?=) Date: Fri, 6 May 2005 01:50:14 +0200 Subject: Building R10B-3 on Mac OS X Tiger In-Reply-To: <20050505175827.GH5066@jump.lib.uchicago.edu> References: <200505021011.j42ABpBG014118@ger5.wwwserver.net> <7C71E521-51A4-431E-9B4D-665B6CCB97C2@patternmatched.com> <20050505175827.GH5066@jump.lib.uchicago.edu> Message-ID: <87171855-2FD8-4DCD-B875-23B77E92CAAC@erlang-fr.org> Le 5 mai 05 ? 19:58, Charles Blair a ?crit : >> {error_logger,{{2005,5,2},{14,12,10}},'~s~n',['Bad input fd in poll >> ()! fd,port,driver,name: 0,59,tty_sl,tty_sl -c -e\n']} >> > > this worked for me (R10B-4): > > move /usr/include/poll.h and /usr/include/sys/poll.h out of the way, > then configure and make as usual. Please excuse my previous mail on Erlang compilation on MacOSX 10.4. I opened a new thread and did not realize that the same problem was already being discussed. I will try to recompile Erlang while renaming the poll.h file as you suggest. Thank you ! -- Micka?l R?mond From chandrashekhar.mullaparthi@REDACTED Fri May 6 02:10:06 2005 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Fri, 6 May 2005 01:10:06 +0100 Subject: ANNOUNCE: ibrowse Message-ID: <52e7a1c785b8252d655ab262810a9750@t-mobile.co.uk> Hi, This is to announce ibrowse. ibrowse is a HTTP client written in erlang. Here is an extract from the README. ibrowse is a HTTP client. The following are a list of features. - RFC2616 compliant (AFAIK) - supports GET, POST, OPTIONS, HEAD, PUT, DELETE, TRACE only - Understands HTTP/0.9, HTTP/1.0 and HTTP/1.1 - Understands chunked encoding - Named pools of connections to each webserver - Pipelining support - Download to file - Asynchronous requests. Responses are streamed to a process - Basic authentication - Supports proxy authentication - Can talk to Secure webservers using SSL - any other features in the code not listed here :) Get it from http://jungerl.sourceforge.net/ or just use the attached tar ball. It comes with documentation as well (which will come as a surprise to everyone who knows me :-) Comments are very much welcome. cheers, Chandru -------------- next part -------------- A non-text attachment was scrubbed... Name: ibrowse.tgz Type: application/x-gzip Size: 27350 bytes Desc: not available URL: From mickael.remond@REDACTED Fri May 6 02:27:46 2005 From: mickael.remond@REDACTED (=?ISO-8859-1?Q?Micka=EBl_R=E9mond?=) Date: Fri, 6 May 2005 02:27:46 +0200 Subject: Building R10B-3 on Mac OS X Tiger In-Reply-To: <87171855-2FD8-4DCD-B875-23B77E92CAAC@erlang-fr.org> References: <200505021011.j42ABpBG014118@ger5.wwwserver.net> <7C71E521-51A4-431E-9B4D-665B6CCB97C2@patternmatched.com> <20050505175827.GH5066@jump.lib.uchicago.edu> <87171855-2FD8-4DCD-B875-23B77E92CAAC@erlang-fr.org> Message-ID: <398A2E04-90CF-4D77-B62C-65EAE26A62DF@erlang-fr.org> Le 6 mai 05 ? 01:50, Micka?l R?mond a ?crit : > Le 5 mai 05 ? 19:58, Charles Blair a ?crit : > > >>> {error_logger,{{2005,5,2},{14,12,10}},'~s~n',['Bad input fd in poll >>> ()! fd,port,driver,name: 0,59,tty_sl,tty_sl -c -e\n']} >>> >>> >> >> this worked for me (R10B-4): >> >> move /usr/include/poll.h and /usr/include/sys/poll.h out of the way, >> then configure and make as usual. I did not look what is triggered at compilation by this file, and I do not understand why poll.h is a problem, but it works for me. Thank you ! -- Micka?l R?mond From chas@REDACTED Fri May 6 03:53:14 2005 From: chas@REDACTED (Charles Blair) Date: Thu, 5 May 2005 20:53:14 -0500 Subject: Building R10B-3 on Mac OS X Tiger In-Reply-To: <398A2E04-90CF-4D77-B62C-65EAE26A62DF@erlang-fr.org> References: <200505021011.j42ABpBG014118@ger5.wwwserver.net> <7C71E521-51A4-431E-9B4D-665B6CCB97C2@patternmatched.com> <20050505175827.GH5066@jump.lib.uchicago.edu> <87171855-2FD8-4DCD-B875-23B77E92CAAC@erlang-fr.org> <398A2E04-90CF-4D77-B62C-65EAE26A62DF@erlang-fr.org> Message-ID: <20050506015314.GV5066@jump.lib.uchicago.edu> On Fri, May 06, 2005 at 02:27:46AM +0200, Micka?l R?mond wrote: > I did not look what is triggered at compilation by this file, and I > do not understand why poll.h is a problem, but it works for me. i was led down the route i followed by the following apple technical note: poll This API is not supported in Mac OS X, instead, the function select is used. [etc.] http://developer.apple.com/technotes/tn2002/tn2071.html i am not an os x expert, but it's possible that the implementation finally caught up with the documentation in os x 10.4, since R10B-4 compiled fine under 10.3. From gerd@REDACTED Fri May 6 12:01:31 2005 From: gerd@REDACTED (Gerd Flaig) Date: Fri, 06 May 2005 12:01:31 +0200 Subject: Startup phase design Message-ID: Hi, the service module foo in my application is implemented as a set of functions calling a gen_server, like this: frob() -> gen_server:call(frobserv, frobnicate). Frobserv is started during node startup via an application supervisor. Java nodes regularly connect and call foo:frob(). The problem is, those Java nodes also connect when the gen_server is not yet fully started, causing noproc crashes. Three solutions come to my mind: 1. Don't use Erlang distribution between the Java and Erlang nodes. Communicate over a specialized protocol over TCP, open the listening port only when the application is ready. This solution seems to be the most clean one to me but would require the most effort. 2. Signal a temporary failure to the caller but don't crash. 3. Block calls until frobserv is up. What do you think? Is there another, maybe better way? I am not sure what would be the best way to implement 2. or 3. if I don't get permission to implement solution 1. Goodbyte, Gerd. -- Gerd Flaig Technik gerd@REDACTED Bei Schlund + Partner AG Brauerstra?e 48 D-76135 Karlsruhe Physics is like sex: sure, it may give some practical results, but that's not why we do it. -- Richard Feynman From stock16@REDACTED Sat May 7 05:39:18 2005 From: stock16@REDACTED (jim min) Date: Sat, 07 May 2005 03:39:18 +0000 Subject: Port of VB Point of Sale to Distributed ErLang Message-ID: Hello ALL, I appreciate your thoughts and directions for a new Erlang developer. I've just recently come across erlang and have become really intrigued by it and its abilities. I've read alot of Docs and some of the post on the mailinglist here.... there is alot to comprehend and take in. Coming from a C/C++ and VB background, it a little different to fully understand and comprehend and overview of erlang. I'm going straight away to Joe Armstrongs pdf to read more. While learning and building on my previous knowledge, I'd still like to make strides forward with my current programming efforts. Unfortunately, I'm not in a position to totally stop all forward progress on issues. What I want to do is Port a server application to Erlang, while still keeping my Internet/Network Clients on their current VB Apps. I have a Point of sale that I would like to expand to take advantage of Erlangs distributed and fault tolerant features......I also have a game server that Erlang would work well with too. Is it possible to keep some of the POS Server application in VB and enhance it with Erlang process to do some of the back end processes. Any way for this to work to increase the thru put and increase max # of client connections? Any pointers would be appreciated. Thanks Jim From neumann@REDACTED Sun May 8 23:21:12 2005 From: neumann@REDACTED (=?iso-8859-1?q?Fran=E7ois-Denis_Gonthier?=) Date: Sun, 8 May 2005 17:21:12 -0400 Subject: New Debian packages for 10.b.4 Message-ID: <200505081721.16022.neumann@lostwebsite.net> Hello all, The Debian package for Erlang was recently orphaned. I filled the ITA for main packages. They are nearly but I would like you people to test them if possible. The .debs are at: http://neutronic.mine.nu/unstable/, or you can use the site as an apt repository with those sources.list lines: deb http://neutronic.mine.nu/unstable/ ./ deb-src http://neutronic.mine.nu/unstable/ ./ Please report any problems here. The package have builded fine on Sarge and Sid but on i386 only. I *might* be able to get this package uploaded to Sarge in time for it's release but I need help and feedbacks as I'm not an official Debian Developer and thus lack some experience. Fran?ois-Denis G. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From joe.armstrong@REDACTED Mon May 9 08:46:10 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Mon, 9 May 2005 08:46:10 +0200 Subject: Port of VB Point of Sale to Distributed ErLang Message-ID: > > Hello ALL, > What I want to do is Port a server application to Erlang, while still > keeping my Internet/Network Clients on their current VB Apps. > I have a Point > of sale that I would like to expand to take advantage of > Erlangs distributed > and fault tolerant features......I also have a game server > that Erlang would > work well with too. > > Is it possible to keep some of the POS Server application in > VB and enhance > it with Erlang process to do some of the back end processes. > Any way for this to work to increase the thru put and > increase max # of > client connections? > Well yes - I guess it would be possible, but it might not be a good idea. Whether this is a good ideas depends upon the granularity of the tasks that you wish to perform. Splitting an application into different servers in different languages involves a severe penalty every time you cross the language boundary - it's far better to stay in one server and do a large amount of computation, then go to the other server and do a large chunk of computation than to flip backwards and forwards between the different servers. I would try to stick to server in Erlang client in VB - use the languages for what they are good at. Erlang is good at concurrency - it will happily handle thousands of simultaneous sessions, and the sessions will be protected from each other (ie a software error in one will not crash the others) VB is good for making GUIs and doing user interactions. Keep the components well isolated by sockets and use a well defined protocol between the components (the very act of isolating the components and writing down the protocols between the components should clarify the design :-) Then program the different components in the best language for the job. Cheers /Joe > Any pointers would be appreciated. > Thanks Jim > > > From bjorn@REDACTED Mon May 9 09:35:51 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 09 May 2005 09:35:51 +0200 Subject: Building R10B-3 on Mac OS X Tiger In-Reply-To: <20050506015314.GV5066@jump.lib.uchicago.edu> References: <200505021011.j42ABpBG014118@ger5.wwwserver.net> <7C71E521-51A4-431E-9B4D-665B6CCB97C2@patternmatched.com> <20050505175827.GH5066@jump.lib.uchicago.edu> <87171855-2FD8-4DCD-B875-23B77E92CAAC@erlang-fr.org> <398A2E04-90CF-4D77-B62C-65EAE26A62DF@erlang-fr.org> <20050506015314.GV5066@jump.lib.uchicago.edu> Message-ID: Thanks for the workaround and the information. However, the tech note is from Sep 2003. poll() actually exists and works in Panther. It does seems to exist in Tiger, too. We'll try to fix the problem in OTP R10B-6 (it's too late for R10B-5). Regarding the workaround: Instead of removing system header files, I suggest the following patch to erts/configure. I have not actually tested it on Tiger, but it does force the emulator to use select() instead of poll(). --- erts/configure.ORIG Mon May 9 09:28:58 2005 +++ erts/configure Mon May 9 09:29:23 2005 @@ -3691,7 +3691,7 @@ for ac_hdr in fcntl.h limits.h unistd.h syslog.h dlfcn.h ieeefp.h \ - poll.h sys/stropts.h \ + sys/stropts.h \ sys/ioctl.h sys/time.h sys/uio.h sys/sockio.h sys/socketio.h \ net/errno.h malloc.h mach-o/dyld.h arpa/nameser.h do @@ -4866,7 +4866,7 @@ for ac_func in ieee_handler fpsetmask finite isnan isinf res_gethostbyname dlopen \ - poll pread pwrite writev memmove strerror strerror_r strncasecmp \ + pread pwrite writev memmove strerror strerror_r strncasecmp \ gethrtime localtime_r gmtime_r mremap memcpy mallopt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 /Bjorn Charles Blair writes: > On Fri, May 06, 2005 at 02:27:46AM +0200, Micka?l R?mond wrote: > > I did not look what is triggered at compilation by this file, and I > > do not understand why poll.h is a problem, but it works for me. > > i was led down the route i followed by the following apple technical > note: > > poll > This API is not supported in Mac OS X, instead, the function select is > used. [etc.] > http://developer.apple.com/technotes/tn2002/tn2071.html > > i am not an os x expert, but it's possible that the implementation > finally caught up with the documentation in os x 10.4, since R10B-4 > compiled fine under 10.3. > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From chas@REDACTED Mon May 9 16:55:20 2005 From: chas@REDACTED (Charles Blair) Date: Mon, 9 May 2005 09:55:20 -0500 Subject: Building R10B-3 on Mac OS X Tiger In-Reply-To: References: <200505021011.j42ABpBG014118@ger5.wwwserver.net> <7C71E521-51A4-431E-9B4D-665B6CCB97C2@patternmatched.com> <20050505175827.GH5066@jump.lib.uchicago.edu> <87171855-2FD8-4DCD-B875-23B77E92CAAC@erlang-fr.org> <398A2E04-90CF-4D77-B62C-65EAE26A62DF@erlang-fr.org> <20050506015314.GV5066@jump.lib.uchicago.edu> Message-ID: <20050509145520.GL5066@jump.lib.uchicago.edu> On Mon, May 09, 2005 at 09:35:51AM +0200, Bjorn Gustavsson wrote: > Instead of removing system header files, I suggest the following patch > to erts/configure. I have not actually tested it on Tiger, but it does > force the emulator to use select() instead of poll(). i just tested it and it works. thanks. > --- erts/configure.ORIG Mon May 9 09:28:58 2005 > +++ erts/configure Mon May 9 09:29:23 2005 > for ac_hdr in fcntl.h limits.h unistd.h syslog.h dlfcn.h ieeefp.h \ > - poll.h sys/stropts.h \ > + sys/stropts.h \ > for ac_func in ieee_handler fpsetmask finite isnan isinf res_gethostbyname dlopen \ > - poll pread pwrite writev memmove strerror strerror_r strncasecmp \ > + pread pwrite writev memmove strerror strerror_r strncasecmp \ From neumann@REDACTED Mon May 9 19:40:43 2005 From: neumann@REDACTED (=?iso-8859-1?q?Fran=E7ois-Denis_Gonthier?=) Date: Mon, 9 May 2005 13:40:43 -0400 Subject: Debian package for Erlang 10.b.4 (take two) Message-ID: <200505091340.44015.neumann@lostwebsite.net> Hi all, I *cough*forgot*cough* to unlock port 80 on my firewall. The packages are still available at the same address: http://neutronic.mine.nu/unstable and this time they will actually be reachable. yay. I need feedback on those package please: do they (un)install well? do they run well? ... upgrade well?, etc. F-D From serge@REDACTED Mon May 9 22:49:38 2005 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 09 May 2005 16:49:38 -0400 Subject: ets question Message-ID: <427FCCE2.5050906@hq.idt.net> Hi All, I have the following question about ets:select_delete(). What do you think this function t() should return? -include_lib("stdlib/include/ms_transform.hrl"). t() -> a = ets:new(a, [named_table]), true = ets:insert(a, {1,2}), M = ets:fun2ms(fun({1,2}) -> object() end), [{1,2}] = ets:select(a, M), ets:select_delete(a, M). I would expect it to return 1, yet it returns 0. What am I missing? Thanks. Serge From chandrashekhar.mullaparthi@REDACTED Tue May 10 05:38:12 2005 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Tue, 10 May 2005 04:38:12 +0100 Subject: ets question In-Reply-To: <427FCCE2.5050906@hq.idt.net> References: <427FCCE2.5050906@hq.idt.net> Message-ID: <549d0790501c7daf49a0adc6a392fa60@t-mobile.co.uk> Serge, The MatchSpec should be slightly different for select_delete to work. Instead of [{{1,2},[],['$_']}] which is the result of the ets:fun2ms/1 call you have, the MatchSpec should look like this: [{{1,2},[],[true]}] 12> ets:new(a, [named_table]). a 13> true = ets:insert(a, {1,2}). true 14> ets:select_delete(a, [{{1,2},[],[true]}]). 1 cheers Chandru On 9 May 2005, at 21:49, Serge Aleynikov wrote: > Hi All, > > I have the following question about ets:select_delete(). What do you > think this function t() should return? > > -include_lib("stdlib/include/ms_transform.hrl"). > > t() -> > a = ets:new(a, [named_table]), > true = ets:insert(a, {1,2}), > M = ets:fun2ms(fun({1,2}) -> object() end), > [{1,2}] = ets:select(a, M), > ets:select_delete(a, M). > > I would expect it to return 1, yet it returns 0. What am I missing? > > Thanks. > > Serge > From erlang@REDACTED Tue May 10 11:19:46 2005 From: erlang@REDACTED (Peter-Henry Mander) Date: Tue, 10 May 2005 10:19:46 +0100 Subject: ex11 widget standardization In-Reply-To: References: Message-ID: <20050510101946.2fd7e709.erlang@manderp.freeserve.co.uk> Hi Joe, Another (potential) ex11 user here. I wonder what happened to ex11 since the day you mentioned a wish back-end? I'm having trouble getting the latest snapshot I have (ex11-latest-snapshot-2004-09-09.tgz) working on an AMD64 laptop. It works well on a i386 platform with Kostis' HiPE snapshot (otp-20050202-1824.tar.gz). Admittedly the AMD64 machine has some niggles, SuSE 9.2 on AMD64 doesn't seem to be well tested. I get the following output ... Eshell V5.4.3 (abort with ^G) 1> erl -pa '../lib' -pa '../unixdom-0.1/ebin/' -s example0 start Erlang (BEAM) emulator version 5.4.3 [64-bit] [source] [hipe] Trying Host=unix Display=0 Screen=0 Connecting to unix domain socket:0 Eshell V5.4.3 (abort with ^G) 1> Port opened sending cookie: Trying Host={ip,"localhost"} Display=0 Screen=0 Connecting to tcp port:6000 cannot connect reason:econnrefused Trying Host={ip,"localhost"} Display=0 Screen=0 Connecting to tcp port:6000 cannot connect reason:econnrefused Trying Host=unix Display=0 Screen=0 Connecting to unix domain socket:0 Port opened sending cookie: ... at which point it just sits completely still. I noticed this was described before on erlang-questions. Was there a work-around? Pete. On Thu, 3 Feb 2005 13:26:08 +0100 "Joe Armstrong (AL/EAB)" wrote: > > Wow - a user :-) > > Overall strategy: > > 1) Fix a reasonably intuitive way of programming GUIs > 2) Prototype it > 3a) *Define* a graphics GUI protocol > 3a) *Define* a look-and-feel > 4) Implement it > 1) > > For many years I didn't really know how graphics should be programmed > Callbacks suck - in early attempts I made > > One window = One processes > > With "if the process dies the widow dies and vice versa" semantics. > > This is wrong. > > EX11 convinced me that the correct model is > > One process per object in a hierarchical tree > Expose protocols towards the objects and NOT APIs > > So in ex11 *everything* is a process buttons, sliders, entries, ... > all are processes. > > All obey a generic protocol and a private protocol. > > So all objects can be moved with an Obj ! {move,X,Y} message > > Active objects (buttons etc) can be sent functions > > Button ! {onClick, Fun} > > Meaning evaluate F() when you click on the button > > etc. > > Irrespective of the underlying model (wish, gtk, X11) the Erlang programmer > should perceive a GUI as a collection of communicating processes. > > IMHO this makes for a highly intuitive and easy to program way of making GUIS. > > << It's rather like the OO way of programming a GUI where EVERY control is > an object - here every control is a process>> > > 2) > > Ex11 works reasonably well but not out-of-the-box on all > makes and flavours of X11 and displays (in particular > color handling on non 24 bit color displays) > > > 3a) The protocol should be something like this > This is a summary of some of http://www.sics.se/~joe/ex11/widgets/ex11.html > > Win !! {makeButton, X, Y, Width, Ht, Color, Str) => Button > Button ! {onClick, Fun/1} - Evaluate F(X) when clicked. X is the mouse position. > Button ! {set, Str} Change the text in the button > > Win !! {makeDragBox, X, Y, Width, Height, Border, Color) => DragBox > DragBox ! {onDrag, F/2} evaluate F(X,Y) when dragged to X,Y > > Win !! {makeEntry, X, Y, Width, Str) => Entry > Entry ! {onReturn, Fun/1} - Evaluate F(Str) when return is pressed in the entry. > Entry ! {set, Str} Set the entry > Entry !! read => Str Read the entry > > ... > > Win Button Entry DragBox etc are all processes > > !! is an infix RPC. A !! B => C is short for C = rpc(A, B) > > 3b) Needs help from a graphics designer > > 4) > EX11 is non portable to windows (ie based on X11) and has certain problems > in starting up (ie handling non 24 bit color displays) > > I started three days ago (by coincidence) seeing if I could use a wish > backend to ex11 - this works very nicely, I am half way through the widgets > and have managed to retain ex11 programming model. > > 5) Volunteers > > I would like volunteers for the following: > > a) test my new graphics stuff and help with > TCL widget programming (any TCL buffs out there) > b) test run my new stuff on windows and package with > freewrap > c) Discuss and help maintain the widget protocol spec > d) Provide inputs for graphics look-and-feel > e) implement the entire protocols with *different* > back-ends (ie GTK/xwwidgets etc.) > > Anybody who is interested please mail me > > (Oh and there is also a sub-project) The Erlang desktop (like smalltalk) > > /Joe > > -- "The Tao of Programming flows far away and returns on the wind of morning." From sebastian@REDACTED Tue May 10 15:00:54 2005 From: sebastian@REDACTED (Sebastian Bello) Date: Tue, 10 May 2005 10:00:54 -0300 Subject: Image library Message-ID: <006301c55560$4d7546c0$3000a8c0@INSWITCH244> Hi list, is there a library to handle images (for example convert images)? Thanks, Sebastian- Prepaid Expertise - Programmable Switches Powered by Ericsson Licensed Technology Sebasti?n Bello - Engineer - Development Center - IN Switch Solutions Inc. Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 IN SWITCH EMEA Phone: +33 0 6 0335 9427 - Fax: +33 0 4 93655773 / emea@REDACTED IN SWITCH ASIA Phone: +92 51 2800397/8- Fax: +92 51 2800399/ inswasia@REDACTED e-mail: sebastian@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1429 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: logoparafondo.gif Type: image/gif Size: 16886 bytes Desc: not available URL: From sebastian@REDACTED Tue May 10 15:02:00 2005 From: sebastian@REDACTED (Sebastian Bello) Date: Tue, 10 May 2005 10:02:00 -0300 Subject: Text user interfaces Message-ID: <006c01c55560$74efef70$3000a8c0@INSWITCH244> Hi list, is there a library to create textual user interfaces (for example something like curses)? Thanks, Sebastian- Prepaid Expertise - Programmable Switches Powered by Ericsson Licensed Technology Sebasti?n Bello - Engineer - Development Center - IN Switch Solutions Inc. Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 IN SWITCH EMEA Phone: +33 0 6 0335 9427 - Fax: +33 0 4 93655773 / emea@REDACTED IN SWITCH ASIA Phone: +92 51 2800397/8- Fax: +92 51 2800399/ inswasia@REDACTED e-mail: sebastian@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1429 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: logoparafondo.gif Type: image/gif Size: 16886 bytes Desc: not available URL: From serge@REDACTED Tue May 10 16:06:38 2005 From: serge@REDACTED (Serge Aleynikov) Date: Tue, 10 May 2005 10:06:38 -0400 Subject: ets question In-Reply-To: <549d0790501c7daf49a0adc6a392fa60@t-mobile.co.uk> References: <427FCCE2.5050906@hq.idt.net> <549d0790501c7daf49a0adc6a392fa60@t-mobile.co.uk> Message-ID: <4280BFEE.7090202@hq.idt.net> Chandrashekhar, Thank you. I just re-read the definition of ets:select_delete/2, and indeed, it said: "If the match_spec returns the atom true for an object, that object is removed from the table. For any other result from the match_spec the object is retained." So, as you correctly pointed out the proper use of the transform therefore should be: ets:select_delete(a, ets:fun2ms(fun({1,2}) -> true end)). Serge Chandrashekhar Mullaparthi wrote: > Serge, > > The MatchSpec should be slightly different for select_delete to work. > Instead of > > [{{1,2},[],['$_']}] > > which is the result of the ets:fun2ms/1 call you have, the MatchSpec > should look like this: > > [{{1,2},[],[true]}] > > 12> ets:new(a, [named_table]). > a > 13> true = ets:insert(a, {1,2}). > true > 14> ets:select_delete(a, [{{1,2},[],[true]}]). > 1 > > cheers > Chandru > > On 9 May 2005, at 21:49, Serge Aleynikov wrote: > >> Hi All, >> >> I have the following question about ets:select_delete(). What do you >> think this function t() should return? >> >> -include_lib("stdlib/include/ms_transform.hrl"). >> >> t() -> >> a = ets:new(a, [named_table]), >> true = ets:insert(a, {1,2}), >> M = ets:fun2ms(fun({1,2}) -> object() end), >> [{1,2}] = ets:select(a, M), >> ets:select_delete(a, M). >> >> I would expect it to return 1, yet it returns 0. What am I missing? >> >> Thanks. >> >> Serge From yerl@REDACTED Tue May 10 17:45:32 2005 From: yerl@REDACTED (yerl@REDACTED) Date: Tue, 10 May 2005 17:45:32 +0200 Subject: ex11 widget standardization Message-ID: See how to install it here: http://yhafri.club.fr/crux/ex11/Pkgfile /yerl ----Message d'origine---- >Date: Tue, 10 May 2005 10:19:46 +0100 >De: Peter-Henry Mander >A: "Joe Armstrong (AL/EAB)" >Copie ?: erlang-questions@REDACTED >Sujet: Re: ex11 widget standardization > >Hi Joe, > >Another (potential) ex11 user here. I wonder what happened to ex11 since >the day you mentioned a wish back-end? > >I'm having trouble getting the latest snapshot I have >(ex11-latest-snapshot-2004-09-09.tgz) working on an AMD64 laptop. It >works well on a i386 platform with Kostis' HiPE snapshot >(otp-20050202-1824.tar.gz). > >Admittedly the AMD64 machine has some niggles, SuSE 9.2 on AMD64 doesn't >seem to be well tested. > >I get the following output ... > >Eshell V5.4.3 (abort with ^G) >1> erl -pa '../lib' -pa '../unixdom-0.1/ebin/' -s example0 start >Erlang (BEAM) emulator version 5.4.3 [64-bit] [source] [hipe] > >Trying Host=unix Display=0 Screen=0 >Connecting to unix domain socket:0 >Eshell V5.4.3 (abort with ^G) >1> Port opened sending cookie: >Trying Host={ip,"localhost"} Display=0 Screen=0 >Connecting to tcp port:6000 >cannot connect reason:econnrefused >Trying Host={ip,"localhost"} Display=0 Screen=0 >Connecting to tcp port:6000 >cannot connect reason:econnrefused >Trying Host=unix Display=0 Screen=0 >Connecting to unix domain socket:0 >Port opened sending cookie: > >.... at which point it just sits completely still. > >I noticed this was described before on erlang-questions. Was there a >work-around? > >Pete. > > >On Thu, 3 Feb 2005 13:26:08 +0100 >"Joe Armstrong (AL/EAB)" wrote: > >> >> Wow - a user :-) >> >> Overall strategy: >> >> 1) Fix a reasonably intuitive way of programming GUIs >> 2) Prototype it >> 3a) *Define* a graphics GUI protocol >> 3a) *Define* a look-and-feel >> 4) Implement it >> 1) >> >> For many years I didn't really know how graphics should be programmed >> Callbacks suck - in early attempts I made >> >> One window = One processes >> >> With "if the process dies the widow dies and vice versa" semantics. >> >> This is wrong. >> >> EX11 convinced me that the correct model is >> >> One process per object in a hierarchical tree >> Expose protocols towards the objects and NOT APIs >> >> So in ex11 *everything* is a process buttons, sliders, entries, ... >> all are processes. >> >> All obey a generic protocol and a private protocol. >> >> So all objects can be moved with an Obj ! {move,X,Y} message >> >> Active objects (buttons etc) can be sent functions >> >> Button ! {onClick, Fun} >> >> Meaning evaluate F() when you click on the button >> >> etc. >> >> Irrespective of the underlying model (wish, gtk, X11) the Erlang programmer >> should perceive a GUI as a collection of communicating processes. >> >> IMHO this makes for a highly intuitive and easy to program way of making GUIS. >> >> << It's rather like the OO way of programming a GUI where EVERY control is >> an object - here every control is a process>> >> >> 2) >> >> Ex11 works reasonably well but not out-of-the-box on all >> makes and flavours of X11 and displays (in particular >> color handling on non 24 bit color displays) >> >> >> 3a) The protocol should be something like this >> This is a summary of some of http://www.sics.se/~joe/ex11/widgets/ex11.html >> >> Win !! {makeButton, X, Y, Width, Ht, Color, Str) => Button >> Button ! {onClick, Fun/1} - Evaluate F(X) when clicked. X is the mouse position. >> Button ! {set, Str} Change the text in the button >> >> Win !! {makeDragBox, X, Y, Width, Height, Border, Color) => DragBox >> DragBox ! {onDrag, F/2} evaluate F(X,Y) when dragged to X,Y >> >> Win !! {makeEntry, X, Y, Width, Str) => Entry >> Entry ! {onReturn, Fun/1} - Evaluate F(Str) when return is pressed in the entry. >> Entry ! {set, Str} Set the entry >> Entry !! read => Str Read the entry >> >> ... >> >> Win Button Entry DragBox etc are all processes >> >> !! is an infix RPC. A !! B => C is short for C = rpc(A, B) >> >> 3b) Needs help from a graphics designer >> >> 4) >> EX11 is non portable to windows (ie based on X11) and has certain problems >> in starting up (ie handling non 24 bit color displays) >> >> I started three days ago (by coincidence) seeing if I could use a wish >> backend to ex11 - this works very nicely, I am half way through the widgets >> and have managed to retain ex11 programming model. >> >> 5) Volunteers >> >> I would like volunteers for the following: >> >> a) test my new graphics stuff and help with >> TCL widget programming (any TCL buffs out there) >> b) test run my new stuff on windows and package with >> freewrap >> c) Discuss and help maintain the widget protocol spec >> d) Provide inputs for graphics look-and-feel >> e) implement the entire protocols with *different* >> back-ends (ie GTK/xwwidgets etc.) >> >> Anybody who is interested please mail me >> >> (Oh and there is also a sub-project) The Erlang desktop (like smalltalk) >> >> /Joe >> >> >-- >"The Tao of Programming > flows far away > and returns > on the wind of morning." > > From aserebre@REDACTED Tue May 10 15:44:48 2005 From: aserebre@REDACTED (A Serebrenik) Date: Tue, 10 May 2005 15:44:48 +0200 (CEST) Subject: Call For Papers: Workshop on Logic-based methods in Programming Environments (in conjunction with ICLP'05) Message-ID: The 15th Workshop on Logic-based methods in Programming Environments October 5, 2005 Sitges (Barcelona), Spain The 15th Workshop on Logic-based methods in Programming Environments will take place in Sitges (Barcelona), Spain as a satellite workshop of the 21th International Conference on Logic Programming (ICLP 2005). This workshop continues the series of successful international workshops on logic programming environments held in Ohio, USA (1989), Eilat, Israel (1990), Paris, France (1991), Washington, USA (1992), Vancouver, Canada (1993), Santa Margherita Ligure, Italy (1994), Portland, USA (1995), Leuven, Belgium and Port Jefferson, USA (1997), Las Cruces, USA (1999), Paphos, Cyprus (2001), Copenhagen, Denmark (2002), Mumbai, India (2003) and Saint Malo, France (2004). The workshop aims at providing an informal meeting for the researchers working on logic-based tools for development and analysis of programs. This year we want to emphasize two aspects: on one hand we want to discuss the presentation, pragmatics and experiences of such tools; on the other one, we want to shift the traditional focus on environment tools for logic programming to logic-based environmental tools for programming in general. Specific topic areas relevant to the workshop include, but not limited to, are: tools for debugging and testing, tools for static and dynamic analysis, systems for program verification and validation, code generation from specifications, termination and non-termination analysers, reasoners on occurs-check freeness and determinacy, profilers and performance analysers, systems for types and modes analyses, module systems, optimization tools. Workshop organisers: * Susana Mu?oz Hern?ndez (Universidad Polit?cnica de Madrid, Spain) * Alexander Serebrenik (coordinator, Technische Universiteit Eindhoven, The Netherlands) Program Committee * Mireille Ducass? (INSA/IRISA, Rennes, France), * Moreno Falaschi (Universit? di Siena), * Maria Garc?a de la Banda (Monash University, Australia), * Jos? Manuel G?mez P?rez (ISOCO, Spain), * Gopal Gupta (University of Texas at Dallas, U.S.A), * Pat Hill (University of Leeds, U.K.), * Fred Mesnard (Universit? de La R?union, France), * Kostis Sagonas (Uppsala Univeristy, Sweden) * Jan-Georg Smaus (Universit?t Freiburg, Germany), * Peter Szeredi (Budapest University of Technology and Economics, Hungary), * Wim Vanhoof (University of Namur, Belgium) Submissions: Length of papers can range from 2 to 15 A4-pages. Informal proceedings will be published locally and distributed at the workshop. Authors are requested to email an electronic copy of a paper in standard ps or pdf format to: Alexander Serebrenik (A.Serebrenik@REDACTED, phone: +31 40 247 3595) Important dates: Submission: July 1,2005 Notification: July 25, 2005 Camera-ready: August 24, 2005 Workshop: October 5, 2005 (one half-day) Additional information can be obtained from the workshop coordinator. Event's Web homepage: http://lml.ls.fi.upm.es/~susana/Conferences/WLPE05/index.html From stock16@REDACTED Tue May 10 20:48:21 2005 From: stock16@REDACTED (jim min) Date: Tue, 10 May 2005 18:48:21 +0000 Subject: Newbee questions about using, compiling and running Erlang module Message-ID: Hello.... Thanks for looking and hopefully helping me understand Erlang more. I've looked thru the Threads, Tutorials and Docs and I am still a little lost. I am running Windows 2003 and have installed Erlang on it. Have Duplicated the Banking Server and Clients but do not understand how to run them or test them on the system. I typed the Banking server and clients in thru notepad and saved them as .erl modules. Do I need to compile them first? Is there an IDE to use to compile and debug with? Is there a Document available that will help me to do a simple project from start to finish and see it run.....do tests on it...debug it? I've looked at the 4 day course and the "Tutorial number 1 Thank you From yerl@REDACTED Wed May 11 00:02:04 2005 From: yerl@REDACTED (yerl) Date: Wed, 11 May 2005 00:02:04 +0200 Subject: Newbee questions about using, compiling and running Erlang module In-Reply-To: References: Message-ID: <42812F5C.2000601@club-internet.fr> Hi Jim! There is a plenty of good tutorials on the web. 1) The best IDE is emacs in my opinion (there is an erlang mode for emacs). But any text editor is ok. 2) You can start with simple examples from here: http://www.erlang.org/examples.html 3) A lot of books and tutorial in english and a very good book in french: http://www.erlang-projects.org/Public/documentation/books/view 4) After that, have a look to some cool advanced stuffs at: http://www.sics.se/~joe/erlang http://www.trapexit.org/ http://www.erlang.org/user.html (learn a lot by reading the code of others) Of course, you need to compile your .erl before (erl -make). But escript module allows you to exec your code like any shell|perl|awk script. good luck /yerl jim min a ?crit : > > Hello.... > Thanks for looking and hopefully helping me understand Erlang more. > I've looked thru the Threads, Tutorials and Docs and I am still a > little lost. > > I am running Windows 2003 and have installed Erlang on it. Have > Duplicated the Banking Server and Clients but do not understand how to > run them or test them on the system. > > I typed the Banking server and clients in thru notepad and saved them > as ..erl modules. > > Do I need to compile them first? Is there an IDE to use to compile > and debug with? > > Is there a Document available that will help me to do a simple project > from start to finish and see it run.....do tests on it...debug it? > > I've looked at the 4 day course and the "Tutorial number 1 > > Thank you > > From bjorn@REDACTED Wed May 11 11:17:43 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 11 May 2005 11:17:43 +0200 Subject: Erlang/OTP R10B-5 has been released Message-ID: Bug fix release : otp_src_R10B-5 Build date : 2005-05-11 This is a bug fix release 5 for the R10B release. You can download the full source distribution from http://www.erlang.org/download/otp_src_R10B-5.tar.gz http://www.erlang.org/download/otp_src_R10B-5.readme (this file) Note: To unpack the TAR archive you need a GNU TAR compatible program. For instance, on MacOS X you need to use the 'gnutar' command; you can't use the 'tar' command or StuffIt to unpack the sources. Note: This release does not build on Mac OS X 10.4 "Tiger". We plan to provide a separate patch to fix that problem soon after the release of R10B-5. For installation instructions please read the README that is part of the distribution. The Windows binary distribution can be downloaded from http://www.erlang.org/download/otp_win32_R10B-5.exe The documentation at http://www.erlang.org will be updated. You can also download the complete HTML documentation or the Unix manual files http://www.erlang.org/download/otp_doc_html_R10B-5.tar.gz http://www.erlang.org/download/otp_doc_man_R10B-5.tar.gz For some OTP applications there are more detailed release notes in the HTML documentation. We also want to thank those that sent us patches, suggestions and bug reports, The OTP Team -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bjorn@REDACTED Wed May 11 11:35:51 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 11 May 2005 11:35:51 +0200 Subject: Patch for R10B-5 on Mac OS 10.4 ("Tiger") Message-ID: I think I have figured out why building of Erlang/OTP fails on Mac OS X 10.4 ("Tiger"). The problem is that the poll() function exists on Tiger but is only partially implemented. It does not handle file descriptors for devices. Therefore, it is useless for Erlang/OTP. Mac OS X 10.3 ("Panther") also has a poll() function, but it actually uses the select() call. It works, but using select() directly is faster. Below is a simple patch that forces the use of select(). (I have not actually tested it on Tiger, but I am pretty sure that it should work.) We plan a more elaborate update to erts/configure in R10B-6, so that it will actually test for a working poll(). It will probably also disable poll() if its emulated using select() (as on Panther). /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB *** erts/configure.ORIG Wed May 11 11:21:48 2005 --- erts/configure Wed May 11 11:22:01 2005 *************** *** 3692,3698 **** for ac_hdr in fcntl.h limits.h unistd.h syslog.h dlfcn.h ieeefp.h \ ! poll.h sys/stropts.h \ sys/ioctl.h sys/time.h sys/uio.h sys/sockio.h sys/socketio.h \ net/errno.h malloc.h mach-o/dyld.h arpa/nameser.h do --- 3692,3698 ---- for ac_hdr in fcntl.h limits.h unistd.h syslog.h dlfcn.h ieeefp.h \ ! sys/stropts.h \ sys/ioctl.h sys/time.h sys/uio.h sys/sockio.h sys/socketio.h \ net/errno.h malloc.h mach-o/dyld.h arpa/nameser.h do *************** *** 4867,4873 **** for ac_func in ieee_handler fpsetmask finite isnan isinf res_gethostbyname dlopen \ ! poll pread pwrite writev memmove strerror strerror_r strncasecmp \ gethrtime localtime_r gmtime_r mremap memcpy mallopt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --- 4867,4873 ---- for ac_func in ieee_handler fpsetmask finite isnan isinf res_gethostbyname dlopen \ ! pread pwrite writev memmove strerror strerror_r strncasecmp \ gethrtime localtime_r gmtime_r mremap memcpy mallopt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 From bjorn@REDACTED Wed May 11 12:34:34 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 11 May 2005 12:34:34 +0200 Subject: Erlang/OTP R10B-5 has been released Message-ID: Bug fix release : otp_src_R10B-5 Build date : 2005-05-11 This is a bug fix release 5 for the R10B release. You can download the full source distribution from http://www.erlang.org/download/otp_src_R10B-5.tar.gz http://www.erlang.org/download/otp_src_R10B-5.readme (this file) Note: To unpack the TAR archive you need a GNU TAR compatible program. For instance, on MacOS X you need to use the 'gnutar' command; you can't use the 'tar' command or StuffIt to unpack the sources. Note: This release does not build on Mac OS X 10.4 "Tiger". We plan to provide a separate patch to fix that problem soon after the release of R10B-5. For installation instructions please read the README that is part of the distribution. The Windows binary distribution can be downloaded from http://www.erlang.org/download/otp_win32_R10B-5.exe The documentation at http://www.erlang.org will be updated. You can also download the complete HTML documentation or the Unix manual files http://www.erlang.org/download/otp_doc_html_R10B-5.tar.gz http://www.erlang.org/download/otp_doc_man_R10B-5.tar.gz For some OTP applications there are more detailed release notes in the HTML documentation. We also want to thank those that sent us patches, suggestions and bug reports, The OTP Team -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From simonpeterchappell@REDACTED Wed May 11 18:51:02 2005 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Wed, 11 May 2005 11:51:02 -0500 Subject: Newbee questions about using, compiling and running Erlang module In-Reply-To: References: Message-ID: <8ed7339005051109516eb22b01@mail.gmail.com> Jim, > Hello.... Hello and welcome to the interesting world of Erlang. > Thanks for looking and hopefully helping me understand Erlang more. I've > looked thru the Threads, Tutorials and Docs and I am still a little lost. Understood. I'm not that much further ahead than you, but have gotten past the initial confusion stage. I guess that means that I'm confused at a higher level now!? :-) > I am running Windows 2003 and have installed Erlang on it. Have Duplicated > the Banking Server and Clients but do not understand how to run them or test > them on the system. Great tutorials. > I typed the Banking server and clients in thru notepad and saved them as > .erl modules. > > Do I need to compile them first? Is there an IDE to use to compile and > debug with? There is no Erlang IDE, and emacs doesn't count either. (An operating system masquerading as a text editor, if you ask me! ;-) The way I see it is: Erlang is a compiled language (escript excepted, but let's not go there at this time). The practical upshot of that is that you need to put source code in plain text files with a .erl suffix and then compile them into an intermediate form (p-code/bytecode?) for the language runner. The best way to start any language is, of course, the veritable hello world program. So, for your edification, I present a version of hello world that works for me. I make no claims that it's the greatest, but it does work and I can show you the steps to create, compile and run it from the command-line. (I like being able to run and test things from the command-line, so all of the examples that start from the Erlang shell were a hinderance for me.) I will then be delighted for the higher-order thinkers on the list to offer feedback as to how it could be improved. 1. Type in the following code to a text editor, save it as "hello.erl" and be sure that you get the periods/full stops in the right place. This gets you a source code version of hello world. %% %% hello.erl %% -module(hello). -export([start/0]). start() -> io:fwrite("hello, world\n"). 2. To compile hello.erl, type the following command while in the same directory as the file: erlc hello.erl 3. Now let's see what we got. Take a look in the directory and you should see a file called "hello.beam" if all has gone well. 4. Now, we need to run this file and enjoy the fruits of our labour. Type the following command: erl -noshell -s hello -s init stop 5. You should be staring at the words "hello, world" on a line on your console at this point. A couple of points to note: * If you're familiar with C, the start/0 is the equivalent of main(). * The "-noshell" tells Erlang that you want this to run without the Erlang REPL shell. * The "-s init stop" makes sure that Erlang performs appropriate startup and shutdown activities before and after it executes your masterpiece. > Is there a Document available that will help me to do a simple project from > start to finish and see it run.....do tests on it...debug it? > > I've looked at the 4 day course and the "Tutorial number 1 > > Thank you I hope that this helps. I must admit that it took quite a bit of digging and lurking on the mailing list before I got that figured out myself. I'm glad to share. I needed this information for my personal open-source project that I'm working on. It's a multi-language test runner and I was trying to add Erlang to the list of languages it understands. It explicitly needs to be able to compile and run programs from the command-line and also to capture their standard out. http://simonpeter.com/technology/software/zadok/ Simon From kramer@REDACTED Wed May 11 19:35:08 2005 From: kramer@REDACTED (Reto Kramer) Date: Wed, 11 May 2005 10:35:08 -0700 Subject: timer:tc - accuracy/granularity Message-ID: <1c6758fa6ee9b08471cc38567126ca34@acm.org> I was unable to find a statement in the timer:tc documentation around the granularity guarantees provided on different platforms. Can someone help me out? Can someone point me at what the OS level calls used are, so I can check for guarantees on those on the platforms I care (Sol/x86/AMD, Linux/RH3/x86, MacOSX)? What is your experience measuring latency in the range of 100 to 500 usec using timer:tc? Thanks, - Reto -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 453 bytes Desc: not available URL: From vlad_dumitrescu@REDACTED Wed May 11 20:50:58 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 11 May 2005 20:50:58 +0200 Subject: math module bug Message-ID: Hi, The documentation for the math module states that the error functions erf/1 and erfc/1 are available, but (at least in the Windows version) they aren't implemented. Calling them throws an undef exception. m(math) lists the functions, so I suppose the C library doesn't have them or something. regards, Vlad From jilani.khaldi1@REDACTED Wed May 11 22:57:01 2005 From: jilani.khaldi1@REDACTED (Jilani Khaldi) Date: Wed, 11 May 2005 22:57:01 +0200 Subject: Calling a C function inside a DLL Message-ID: <4282719D.2050802@virgilio.it> Hi All, I need to call some C functions inside a DLL from my erlang application, but I have found only vague information. Could somebody point me where to look for it? Thanks! jk -- // Jilani KHALDI *** K-Book Interactive Pubblications http://jkhaldi.oltrelinux.com From tty@REDACTED Wed May 11 23:22:53 2005 From: tty@REDACTED (tty@REDACTED) Date: Wed, 11 May 2005 17:22:53 -0400 Subject: application question Message-ID: Hello folks, My application ch3_app.app file has the following definition: {included_applications, [modem_app]}, {applications, [kernel, stdlib, sasl, mnesia, mnemosyne]}, How do I get sasl, mnesia, mnemosyne and modem_app to start automatically after I do an application:start(ch3_app) ? Is defining them here soley for systools ? Thanks Tee From alexey@REDACTED Thu May 12 02:48:34 2005 From: alexey@REDACTED (Alexey Shchepin) Date: Thu, 12 May 2005 03:48:34 +0300 Subject: Erlang/OTP R10B-5 has been released In-Reply-To: (Bjorn Gustavsson's message of "11 May 2005 11:17:43 +0200") References: Message-ID: <87r7gdqnfh.fsf@alex.sevcom.net> Hello, Bjorn! On 11 May 2005 11:17:43 +0200, you said: BG> This is a bug fix release 5 for the R10B release. Is this bug fixed in R10B-5? http://article.gmane.org/gmane.comp.lang.erlang.patches/108 From erlang@REDACTED Thu May 12 03:46:25 2005 From: erlang@REDACTED (Michael McDaniel) Date: Wed, 11 May 2005 18:46:25 -0700 Subject: Erlang R10B-5 Message-ID: <20050512014625.GJ12016@fangora.autosys.us> Thank you for the recent release! And, Ingela, the odbc is simple on SuSE Linux! Just "make and go"! my build on SuSE release 9.1 and 9.2 ... $ cd /opt/src/otp_src_R10B-5 $ cd lib/ssl/c_src $ mkdir RCS $ ci -l esock.c $ emacs esock.c FROM: #define RWBUFLEN 4096 TO: #define RWBUFLEN (32*1024) $ cd - $ ./configure --with-odbc --x-includes=/usr/local/include --x-libraries=/usr/lib --with-ssl $ make # cd /usr/local/lib/ # mv erlang erlang-R10B-4 # cd - # make install I don't have applications dependent on the previous versions of libs (at least, not enough that I can't manually change whatever needs it) so I just rename the old erlang directory. Thank you all. ~Michael From matthias@REDACTED Thu May 12 06:56:47 2005 From: matthias@REDACTED (Matthias Lang) Date: Thu, 12 May 2005 06:56:47 +0200 Subject: Erlang/OTP R10B-5 has been released In-Reply-To: <87r7gdqnfh.fsf@alex.sevcom.net> References: <87r7gdqnfh.fsf@alex.sevcom.net> Message-ID: <17026.57871.141957.206423@antilipe.corelatus.se> Alexey Shchepin writes: > Is this bug fixed in R10B-5? > > http://article.gmane.org/gmane.comp.lang.erlang.patches/108 I downloaded R10B-5. The file inet_db.erl has not changed, so your patch hasn't been applied. I can't determine whether the problem has been fixed some other way or not because I can't reproduce your problem on R10B-4 and R9C R9C: ~ >erl -name test Erlang (BEAM) emulator version 5.3.6.3 [source] [hipe] Eshell V5.3.6.3 (abort with ^G) (test@REDACTED)1> inet_res:getbyname("_xmpp-server._tcp.centova.net", srv). {error,nxdomain} R10B-4: otp_src_R10B-4 >bin/erl -name test Erlang (BEAM) emulator version 5.4.5 [source] [hipe] Eshell V5.4.5 (abort with ^G) (test@REDACTED)1> inet_res:getbyname("_xmpp-server._tcp.centova.net", srv). {error,nxdomain} Matthias From ulf@REDACTED Thu May 12 07:37:02 2005 From: ulf@REDACTED (Ulf Wiger) Date: Thu, 12 May 2005 07:37:02 +0200 Subject: application question In-Reply-To: References: Message-ID: Den 2005-05-11 23:22:53 skrev : > Hello folks, > > My application ch3_app.app file has the following definition: > > {included_applications, [modem_app]}, > {applications, [kernel, stdlib, sasl, mnesia, > mnemosyne]}, > > How do I get sasl, mnesia, mnemosyne and modem_app to start > automatically after I do an application:start(ch3_app) ? Is defining > them here soley for systools ? No, it's also for the application_controller, which is the process starting the applications. It will check the list of application dependencies, and refuse to start your application if the required applications are not already running. If the applications have been started, the application_controller will wait until they are running before starting your application. To get those applications started automatically, you need to use systools, or one of the tools that build on it (e.g. builder.) /Uffe From thantos@REDACTED Thu May 12 08:46:35 2005 From: thantos@REDACTED (Alexander Williams) Date: Thu, 12 May 2005 02:46:35 -0400 Subject: OTP: erlang:list_to_float Message-ID: <1972632954.20050512024635@speedfactory.net> erlang-questions: I really hate to seem like a newbie, because, honestly, I'm not. I've been building things with Erlang on my own servers for a couple years now, but I don't think I've run head-first into this one before, which seems odd: Is it really INTENDED that erlang:list_to_float("3") blows up with a badarg? I mean, yes, in theory I could go looking through for a period before passing data in, but that seems a little ... complicated for something that's not truly a bad argument. Thoughts, or is this one just on my head? -- Alexander Williams (thantos@REDACTED) The Squid's Redoubt: http//chancel.org:8000/Redoubt Currently Playing: Tom Lehrer - Poisoning Pigeons In The Park Album: Songs & More Songs By Tom Lehrer From klacke@REDACTED Thu May 12 09:17:38 2005 From: klacke@REDACTED (klacke@REDACTED) Date: Thu, 12 May 2005 09:17:38 +0200 Subject: Erlang R10B-5 In-Reply-To: <20050512014625.GJ12016@fangora.autosys.us> References: <20050512014625.GJ12016@fangora.autosys.us> Message-ID: <20050512071738.GB14708@hyber.org> On Wed, May 11, 2005 at 06:46:25PM -0700, Michael McDaniel wrote: > > Thank you for the recent release! > FROM: #define RWBUFLEN 4096 > TO: #define RWBUFLEN (32*1024) And this fix (which has been reported to the list a couple of times) should go into the regular code since https POSTs doesn't work without it. (If the post is > 4096 bytes) /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control From bjorn@REDACTED Thu May 12 09:24:05 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 12 May 2005 09:24:05 +0200 Subject: math module bug In-Reply-To: References: Message-ID: These functions are only available if the corresponding functions exist in the C library. /Bjorn "Vlad Dumitrescu" writes: > Hi, > > The documentation for the math module states that the error functions > erf/1 and erfc/1 are available, but (at least in the Windows version) > they aren't implemented. Calling them throws an undef exception. > > m(math) lists the functions, so I suppose the C library doesn't have > them or something. > > regards, > Vlad > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From ft@REDACTED Thu May 12 09:36:46 2005 From: ft@REDACTED (Fredrik Thulin) Date: Thu, 12 May 2005 09:36:46 +0200 Subject: R10B-5 compiler bug with two try/catch Message-ID: <200505120936.46656.ft@it.su.se> Hi This bug is not fixed in R10B-5, posting to erlang-questions too as it did not result in any feedback on the erlang-bugs list. $ /pkg/erlang/R10B-5/bin/erlc sipparse_util.erl sipparse_util: function test/0+34: Internal consistency check failed - please report this bug. Instruction: {try_end,{y,0}} Error: unknown_catch_try_state: $ /Fredrik PS. The documented return value of timer:now_diff/2 has an obvious copy/paste error : now_diff(T2, T1) -> {Time, Value} ---------- Forwarded Message ---------- Subject: R10B-4 compiler bug with two try/catch Date: Friday 15 April 2005 11.10 From: Fredrik Thulin To: erlang-bugs@REDACTED Hi The attached file cause the following error on R10B-4 : $ /pkg/erlang/R10B-4/bin/erlc sipparse_util.erl sipparse_util: function test/0+34: Internal consistency check failed - please report this bug. Instruction: {try_end,{y,0}} Error: unknown_catch_try_state: $ /Fredrik ------------------------------------------------------- -------------- next part -------------- -module(sipparse_util). %%-compile(export_all). -export([test/0]). split_quoted_string([34 | _Rest]) -> %% 34 is '"' ok. test() -> %% does not start with quote io:format("test: split_quoted_string/1 - 5~n"), try split_quoted_string("foo \"bar\"") of SQS_Res5 -> throw({error, test_case_failed, SQS_Res5}) catch error: does_not_start_with_quote -> ok end, %% no ending quote io:format("test: split_quoted_string/1 - 6~n"), try split_quoted_string("\"foo ") of SQS_Res6 -> throw({error, test_case_failed, SQS_Res6}) catch error: no_end_quote -> ok end, ok. From bengt.kleberg@REDACTED Thu May 12 10:12:20 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 12 May 2005 10:12:20 +0200 Subject: timer:tc - accuracy/granularity In-Reply-To: <1c6758fa6ee9b08471cc38567126ca34@acm.org> References: <1c6758fa6ee9b08471cc38567126ca34@acm.org> Message-ID: <42830FE4.6050800@ericsson.com> Reto Kramer wrote: ...deleted > > What is your experience measuring latency in the range of 100 to 500 > usec using timer:tc? this is not timer:tc(), but might be useful anyway. i have made some measurements on erlang:statistics(runtime). on my machine SunOS ws12490 5.8 Generic_117350-12 sun4u sparc SUNW,Sun-Blade-1500 i get a granularity of 10 milliseconds. bengt From bengt.kleberg@REDACTED Thu May 12 10:46:51 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 12 May 2005 10:46:51 +0200 Subject: OTP: erlang:list_to_float In-Reply-To: <1972632954.20050512024635@speedfactory.net> References: <1972632954.20050512024635@speedfactory.net> Message-ID: <428317FB.6060802@ericsson.com> Alexander Williams wrote: > erlang-questions: ...deleted > Is it really INTENDED that erlang:list_to_float("3") blows up with a > badarg? I mean, yes, in theory I could go looking through for a > period before passing data in, but that seems a little ... > complicated for something that's not truly a bad argument. perhaps you could use ''catch'' to guard against the exception? and use erlang:list_to_integer/1 incase of a problem? alternativly you have io_lib:fread/2 . bengt From vlad.xx.dumitrescu@REDACTED Thu May 12 11:14:19 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Thu, 12 May 2005 11:14:19 +0200 Subject: math module bug Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE525@esealmw105.eemea.ericsson.se> >These functions are only available if the corresponding >functions exist in the C library. Yes, I understand that, but should m(math) list those who don't exist? The documentation should probably mention this too (it only says something about any bugs that are present). /Vlad From matthias@REDACTED Thu May 12 11:26:47 2005 From: matthias@REDACTED (Matthias Lang) Date: Thu, 12 May 2005 11:26:47 +0200 Subject: OTP: erlang:list_to_float In-Reply-To: <1972632954.20050512024635@speedfactory.net> References: <1972632954.20050512024635@speedfactory.net> Message-ID: <17027.8535.48895.816755@antilipe.corelatus.se> Alexander Williams writes: > Is it really INTENDED that erlang:list_to_float("3") blows up with a > badarg? I mean, yes, in theory I could go looking through for a > period before passing data in, but that seems a little ... > complicated for something that's not truly a bad argument. According to the draft erlang spec, "3" is not a valid representation of a float literal. See section 3.12 of http://www.erlang.org/download/erl_spec47.ps.gz I'm guessing that float_to_list/1 follows the same rules, and that doesn't seem so odd. I was a bit surprised that io_lib:fread("~f", "3") doesn't give me the float 3.0000, though. While on the subject of punctuation, you're missing the ':' after 'http' in your sig: > The Squid's Redoubt: http//chancel.org:8000/Redoubt Matt From thantos@REDACTED Thu May 12 11:34:27 2005 From: thantos@REDACTED (Alexander Williams) Date: Thu, 12 May 2005 05:34:27 -0400 Subject: OTP: erlang:list_to_float In-Reply-To: <17027.8535.48895.816755@antilipe.corelatus.se> References: <1972632954.20050512024635@speedfactory.net> <17027.8535.48895.816755@antilipe.corelatus.se> Message-ID: <5310235469.20050512053427@speedfactory.net> Matthias: Thursday, May 12, 2005, 5:26:47 AM: ML> According to the draft erlang spec, "3" is not a valid ML> representation of a float literal. See section 3.12 of ML> http://www.erlang.org/download/erl_spec47.ps.gz ML> I'm guessing that float_to_list/1 follows the same rules, and that ML> doesn't seem so odd. I was a bit surprised that io_lib:fread("~f", ML> "3") doesn't give me the float 3.0000, though. Rather annoying to run into purely unexpectedly when in the midst of hacking of some Yaws processing of data back from MySQL. ("Er, "3" is a badarg? Excuse me?") Nothing I couldn't hack around by simply searching the string for a "." and then appending ".0" if one wasn't found, but it was vaguely annoying to have to do so. It almost makes one long for a list_to_number generalized function that returns a float or int as appropriate to what it's handed, when you don't care about the result. ML> While on the subject of punctuation, you're missing the ':' after ML> 'http' in your sig: >> The Squid's Redoubt: http//chancel.org:8000/Redoubt You are absolutely correct, sir, and the amusing bit is it must've been like that for a good 6mo now with me not noticing. [facepalm] Despite it being at the bottom of every email I send. There you go. Your good deed for the month. :) -- Alexander Williams (thantos@REDACTED) The Squid's Redoubt: http://chancel.org:8000/Redoubt Currently Playing: They Might Be Giants - Birdhouse In Your Soul Album: Flood From joelr1@REDACTED Thu May 12 11:48:18 2005 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 12 May 2005 12:48:18 +0300 Subject: Poker engine completed Message-ID: <20050512104818.6428@smtp.gmail.com> Folks, I'm happy to report that I finished my Erlang poker engine. It took me about 6 weeks to write it. I had a Lisp engine done already but I mainly used the test cases generated from that one. Details are here: http://wagerlabs.com/2005/05/27000-games.html One of the biggest problems with poker these days is building a site that's big enough. I was thinking of building a world-wide network of smaller sites, a huge cluster of sorts. I don't know how to get their from the business end but at least I have a technical solution :-). Cheers, Joel -- http://wagerlabs.com/tech From bjorn@REDACTED Thu May 12 11:52:37 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 12 May 2005 11:52:37 +0200 Subject: R10B-5 compiler bug with two try/catch In-Reply-To: <200505120936.46656.ft@it.su.se> References: <200505120936.46656.ft@it.su.se> Message-ID: I can't seem to find your previous email. When did you send it? Anyway, I have written a ticket about the problem and expect to fix it in R10B-6. /Bj?rn Fredrik Thulin writes: > Hi > > This bug is not fixed in R10B-5, posting to erlang-questions too as it > did not result in any feedback on the erlang-bugs list. > > $ /pkg/erlang/R10B-5/bin/erlc sipparse_util.erl > sipparse_util: function test/0+34: > Internal consistency check failed - please report this bug. > Instruction: {try_end,{y,0}} > Error: unknown_catch_try_state: > > $ > > /Fredrik > > PS. The documented return value of timer:now_diff/2 has an obvious > copy/paste error : > > now_diff(T2, T1) -> {Time, Value} > > > > > ---------- Forwarded Message ---------- > > Subject: R10B-4 compiler bug with two try/catch > Date: Friday 15 April 2005 11.10 > From: Fredrik Thulin > To: erlang-bugs@REDACTED > > Hi > > The attached file cause the following error on R10B-4 : > > $ /pkg/erlang/R10B-4/bin/erlc sipparse_util.erl > sipparse_util: function test/0+34: > Internal consistency check failed - please report this bug. > Instruction: {try_end,{y,0}} > Error: unknown_catch_try_state: > > $ > > /Fredrik > > ------------------------------------------------------- > > -module(sipparse_util). > %%-compile(export_all). > > -export([test/0]). > > split_quoted_string([34 | _Rest]) -> %% 34 is '"' > ok. > > test() -> > %% does not start with quote > io:format("test: split_quoted_string/1 - 5~n"), > try split_quoted_string("foo \"bar\"") of > SQS_Res5 -> throw({error, test_case_failed, SQS_Res5}) > catch > error: does_not_start_with_quote -> ok > end, > > %% no ending quote > io:format("test: split_quoted_string/1 - 6~n"), > try split_quoted_string("\"foo ") of > SQS_Res6 -> throw({error, test_case_failed, SQS_Res6}) > catch > error: no_end_quote -> ok > end, > > ok. > > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From joelr1@REDACTED Thu May 12 13:11:55 2005 From: joelr1@REDACTED (joel reymont) Date: Thu, 12 May 2005 14:11:55 +0300 Subject: Efficiently accepting TCP connections Message-ID: I promise I'll go and read through all the gen_tcp threads as soon as I'm done sending this message but... Is there an efficient idiom for handling gen_tcp connections on the server side? I already proxy outgoing requests as my poker player processes are Joe's "middlemen". I think I can launch up to 135,000 of these middlemen in my 27,000 simultaneous games test (over 400K processes overall). I think I can increase the number of open sockets per process to unlimited with Mac OSX (as root). I wouldn't normally keep so many connections on a single process but I'm interested in seeing how it will work out. All that having been said, what's the efficient way of accepting a new connection with gen_tcp? I know there are variations and this is why I'm asking. Thanks, Joel -- http://wagerlabs.com/tech From joelr1@REDACTED Thu May 12 14:17:49 2005 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 12 May 2005 15:17:49 +0300 Subject: Efficiently accepting new TCP connections In-Reply-To: <20050512121110.28032@smtp.gmail.com> References: <20050512121110.28032@smtp.gmail.com> Message-ID: <20050512131749.20188@smtp.gmail.com> > Joel Reymont wrote: >I promise I'll go and read through all the gen_tcp threads as soon as I'm >done sending this message but... I found my answer here: http://www.erlang.org/ml-archive/erlang-questions/200302/msg00727.html Joel -- http://wagerlabs.com/tech From bjorn@REDACTED Thu May 12 14:34:54 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 12 May 2005 14:34:54 +0200 Subject: math module bug In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE525@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE525@esealmw105.eemea.ericsson.se> Message-ID: Agreed. m(math) really shouldn't list functions that are missing. I have added a note in the documentation. /Bjorn "Vlad Dumitrescu XX \(LN/EAB\)" writes: > >These functions are only available if the corresponding > >functions exist in the C library. > > Yes, I understand that, but should m(math) list those who don't exist? The documentation should probably mention this too (it only says something about any bugs that are present). > > /Vlad > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From ft@REDACTED Thu May 12 15:10:17 2005 From: ft@REDACTED (Fredrik Thulin) Date: Thu, 12 May 2005 15:10:17 +0200 Subject: R10B-5 compiler bug with two try/catch In-Reply-To: References: <200505120936.46656.ft@it.su.se> Message-ID: <200505121510.17306.ft@it.su.se> On Thursday 12 May 2005 11.52, Bjorn Gustavsson wrote: > I can't seem to find your previous email. When did you send it? As you can see in the text below : Date: Friday 15 April 2005 11.10 To help you find out if there is a problem with erlang-bugs delivery, here is the message id your mail-server responded with (time is in UTC) : Apr 15 09:10:10 smtp3.su.se/syslog.su.se postfix/smtp[13166]: D343D37EB6: to=, relay=erlang.org[193.180.168.23], delay=1, status=sent (250 2.0.0 j3F9AAv24469 Message accepted for delivery) > Anyway, I have written a ticket about the problem and expect to fix > it in R10B-6. Thanks! /Fredrik > > ---------- Forwarded Message ---------- > > > > Subject: R10B-4 compiler bug with two try/catch > > Date: Friday 15 April 2005 11.10 > > From: Fredrik Thulin > > To: erlang-bugs@REDACTED ... From alexey@REDACTED Thu May 12 15:52:37 2005 From: alexey@REDACTED (Alexey Shchepin) Date: Thu, 12 May 2005 16:52:37 +0300 Subject: Erlang/OTP R10B-5 has been released In-Reply-To: <17026.57871.141957.206423@antilipe.corelatus.se> (Matthias Lang's message of "Thu, 12 May 2005 06:56:47 +0200") References: <87r7gdqnfh.fsf@alex.sevcom.net> <17026.57871.141957.206423@antilipe.corelatus.se> Message-ID: <87fywsft5m.fsf@ns.sevcom.net> Hello, Matthias! On Thu, 12 May 2005 06:56:47 +0200, you said: ML> Alexey Shchepin writes: >> Is this bug fixed in R10B-5? >> >> http://article.gmane.org/gmane.comp.lang.erlang.patches/108 ML> I downloaded R10B-5. The file inet_db.erl has not changed, so your patch ML> hasn't been applied. I can't determine whether the problem has been fixed ML> some other way or not because I can't reproduce your problem on R10B-4 and ML> R9C [...] ML> inet_res:getbyname("_xmpp-server._tcp.centova.net", srv). ML> {error,nxdomain} This domain is no longer have CNAME refer to itself, but I've just created cname-cycle.sevcom.net domain, so this bug can be reproduced using it: $ erl -name test Erlang (BEAM) emulator version 5.4.6 [source] [hipe] Eshell V5.4.6 (abort with ^G) (test@REDACTED)1> inet_res:getbyname("cname-cycle.sevcom.net", a). (CRASH) $ host cname-cycle.sevcom.net cname-cycle.sevcom.net is an alias for cname-cycle.sevcom.net. From simonpeterchappell@REDACTED Thu May 12 16:15:32 2005 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Thu, 12 May 2005 09:15:32 -0500 Subject: Fwd: Newbee questions about using, compiling and running Erlang module In-Reply-To: <42831659.7020206@ericsson.com> References: <8ed7339005051109516eb22b01@mail.gmail.com> <42831659.7020206@ericsson.com> Message-ID: <8ed733900505120715417bcf0c@mail.gmail.com> Forgot to reply all. Sorry. ---------- Forwarded message ---------- From: Bengt Kleberg Date: May 12, 2005 3:39 AM Subject: Re: Newbee questions about using, compiling and running Erlang module To: Simon Chappell Simon Chappell wrote: ...deleted > I needed this information for my personal open-source project that I'm > working on. It's a multi-language test runner and I was trying to add > Erlang to the list of languages it understands. It explicitly needs to > be able to compile and run programs from the command-line and also to > capture their standard out. > > http://simonpeter.com/technology/software/zadok/ > > Simon greetings, since the subject matter of zadok is one that i am very intertested in (or rather was, since time no longer permits...) i had a look. in zadok.sh i ofuund the following: erlVersionOutput=`erl -s init stop > erl.version.txt` erlVersion=`cat erl.version.txt | head -1 | cut -f 2 -d " "` have you considered replacing ''erl -s init stop'' with something like this: ''erl -version'' also, since the user you where helping is not trying to test existing code it might be slightly clearer to write hello like this: -module(hello). -export([main/0]). main() -> io:fwrite("hello, world\n"). init:stop(). and run it with: erl -noshell -s hello main (have you tested your command line: erl -noshell -s hello -s init stop i would think that is should have been: erl -noshell -s hello start -s init stop) i admit that ''-s init stop'' on the command line is very useful, but perhaps it is better tought at a slightly later stage? bengt From csanto@REDACTED Thu May 12 16:22:26 2005 From: csanto@REDACTED (Corrado Santoro) Date: Thu, 12 May 2005 16:22:26 +0200 Subject: Efficiently accepting TCP connections In-Reply-To: References: Message-ID: <428366A2.2020101@diit.unict.it> joel reymont wrote: > Is there an efficient idiom for handling gen_tcp connections on the server side? One possibility is to use thread pools. The "leader-follower" object-oriented design pattern by Doug Schmidt et al. has been proposed for this purpose. Ciao, --C. -- ====================================================== Eng. Corrado Santoro, Ph.D. University of Catania - Engineering Faculty Department of Computer Science and Telecommunications Engineering Viale A. Doria, 6 - 95125 CATANIA (ITALY) Tel: +39 095 7382144 Int. (5) 8035 +39 095 7382380 +39 095 7382365 +39 095 7382364 VoIP: sip:8035@REDACTED Fax: +39 095 7382397 EMail: csanto@REDACTED Personal Home Page: http://www.diit.unict.it/users/csanto NUXI Home Page: http://nuxi.iit.unict.it ====================================================== From ryazanov@REDACTED Thu May 12 16:22:53 2005 From: ryazanov@REDACTED (Maxim Ryazanov) Date: Thu, 12 May 2005 18:22:53 +0400 Subject: Erlang/OTP R10B-5 has been released In-Reply-To: <17026.57871.141957.206423@antilipe.corelatus.se> References: <87r7gdqnfh.fsf@alex.sevcom.net> <17026.57871.141957.206423@antilipe.corelatus.se> Message-ID: <724875712.20050512182253@gmail.com> On Thursday, 12 May 2005 06:56 [+0200], Matthias Lang wrote: [..] ML> I downloaded R10B-5. The file inet_db.erl has not changed, so your ML> patch hasn't been applied. I can't determine whether the problem has ML> been fixed some other way or not because I can't reproduce your ML> problem on R10B-4 and R9C dns record for _xmpp-server._tcp.centova.net was changed, so check with this test host instead: inet_res:getbyname("cname-cycle.sevcom.net", a). -- / xmpp:ryazanov@REDACTED From rich.neswold@REDACTED Thu May 12 16:34:15 2005 From: rich.neswold@REDACTED (Rich Neswold) Date: Thu, 12 May 2005 09:34:15 -0500 Subject: OTP: erlang:list_to_float In-Reply-To: <5310235469.20050512053427@speedfactory.net> References: <1972632954.20050512024635@speedfactory.net> <17027.8535.48895.816755@antilipe.corelatus.se> <5310235469.20050512053427@speedfactory.net> Message-ID: <14cf844b0505120734225ace89@mail.gmail.com> On 5/12/05, Alexander Williams wrote: > Rather annoying to run into purely unexpectedly when in the midst of > hacking of some Yaws processing of data back from MySQL. ("Er, "3" > is a badarg? Excuse me?") Nothing I couldn't hack around by simply > searching the string for a "." and then appending ".0" if one wasn't > found, but it was vaguely annoying to have to do so. I haven't used MySQL in a while, but isn't there a way to have the query format the data so it always has the decimal point? Granted, this means you're converting the result to a string in order to format it. But it looks as though you're converting a string anyways. -- Rich AIM : rnezzy ICQ : 174908475 From sean.hinde@REDACTED Thu May 12 22:07:25 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Thu, 12 May 2005 21:07:25 +0100 Subject: Efficiently accepting TCP connections In-Reply-To: <428366A2.2020101@diit.unict.it> References: <428366A2.2020101@diit.unict.it> Message-ID: On 12 May 2005, at 15:22, Corrado Santoro wrote: > joel reymont wrote: >> Is there an efficient idiom for handling gen_tcp connections on the >> server side? > One possibility is to use thread pools. The "leader-follower" > object-oriented design pattern by Doug Schmidt et al. has been > proposed for this purpose. From a quick look at one paper on this subject it appears to be an attempt to solve the problem where there are more connections than the language will allow you to have threads. Erlang suffers from the opposite effect - it can have many more threads than the OS will support IO handles ! I suggest you scrap such thinking (be it object oriented or "thread pools") and go with the Erlang way (one process for every concurrent activity). Sean From csanto@REDACTED Thu May 12 22:20:07 2005 From: csanto@REDACTED (Corrado Santoro) Date: Thu, 12 May 2005 22:20:07 +0200 Subject: Efficiently accepting TCP connections In-Reply-To: References: <428366A2.2020101@diit.unict.it> Message-ID: <4283BA77.1070704@diit.unict.it> Sean Hinde wrote: > From a quick look at one paper on this subject it appears to be an > attempt to solve the problem where there are more connections than the > language will allow you to have threads. On one hand. But on the other hand, the main contribution of the leader-follower is to overcome the overhead introduced by creating threads "on-the-fly" for each incoming connection. > Erlang suffers from the opposite effect - it can have many more threads > than the OS will support IO handles ! OK. So you could create, say 1000 or 10000, sleeping Erlang processes, placing them in a pool, and then pick one process at time for each new connection, passing the connected socket. This avoids latency in connection handling because you don't need to create the process on-the-fly. Then, when processing of the connection is completed, the process can be returned to the pool and made available for a new connection. > I suggest you scrap such thinking (be it object oriented or "thread > pools") and go with the Erlang way (one process for every concurrent > activity). If you have an adequate number of processes in the pool, the behaviour of the overall system is the same as having one process for every concurrent activity. I think. Object orientation is not necessary, it is only a matter of C++/Java implementation of the leader-follower pattern. But its principle holds also in a non OO environment. Ciao, --Corrado -- ====================================================== Eng. Corrado Santoro, Ph.D. University of Catania - Engineering Faculty Department of Computer Science and Telecommunications Engineering Viale A. Doria, 6 - 95125 CATANIA (ITALY) Tel: +39 095 7382144 Int. (5) 8035 +39 095 7382380 +39 095 7382365 +39 095 7382364 VoIP: sip:8035@REDACTED Fax: +39 095 7382397 EMail: csanto@REDACTED Personal Home Page: http://www.diit.unict.it/users/csanto NUXI Home Page: http://nuxi.iit.unict.it ====================================================== From klacke@REDACTED Thu May 12 22:59:08 2005 From: klacke@REDACTED (klacke@REDACTED) Date: Thu, 12 May 2005 22:59:08 +0200 Subject: Efficiently accepting TCP connections In-Reply-To: References: Message-ID: <20050512205908.GA19734@hyber.org> On Thu, May 12, 2005 at 02:11:55PM +0300, joel reymont wrote: > I promise I'll go and read through all the gen_tcp threads as soon as > I'm done sending this message but... > > Is there an efficient idiom for handling gen_tcp connections on the server side? > I increased the performance of yaws sufficently much so that I went ahead with the following scheme: I spawn the acceptor sockets, but when an acceptor socket is done with it's job. instead of terminating, it goes into idle loop and await an new job. This pretty much just saves the process creation overhead but increased performance. Otherwise the normal best practice is to loop with the listen socket like this: listenloop(LS) -> S = self(), spawn(fun() -> A = accept(LS), S ! next, handle_session(A) end), receive next -> ok end, listenloop(LS). But as I said, keeping the acceptor process around for some time can increase performance. Another thing that majorly can increase performance is to utilize the socketoptions [{packet, X}] in such a way so that all buffering is done in the inet_drv.c and you can be certain in your erlang code that you get "full messages" /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control LsockLsock)[ From ok@REDACTED Fri May 13 00:20:39 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 13 May 2005 10:20:39 +1200 (NZST) Subject: math module bug Message-ID: <200505122220.j4CMKdrl092236@atlas.otago.ac.nz> From thantos@REDACTED Thu May 12 23:53:11 2005 From: thantos@REDACTED (Alexander Williams) Date: Thu, 12 May 2005 17:53:11 -0400 Subject: OTP: erlang:list_to_float In-Reply-To: <14cf844b0505120734225ace89@mail.gmail.com> References: <1972632954.20050512024635@speedfactory.net> <17027.8535.48895.816755@antilipe.corelatus.se> <5310235469.20050512053427@speedfactory.net> <14cf844b0505120734225ace89@mail.gmail.com> Message-ID: <1145184835.20050512175311@speedfactory.net> Rich: RN> I haven't used MySQL in a while, but isn't there a way to have the RN> query format the data so it always has the decimal point? Granted, RN> this means you're converting the result to a string in order to RN> format it. But it looks as though you're converting a string RN> anyways. The way the mysql module for Erlang I'm using hands back data puts all data into strings. The value we're talking about here is declared as a float in the SQL, but, apparently, it thinks "3" is a perfectly valid form for a float to be in (and by its spec, very well could be right). Just one of those things that violate the very rule-of-thumb Theory of Least Surprise ("Things shouldn't leave you scratching your head a moment saying, 'Huh.'"). Not a rarity in Erlang, but not a game-breaker, either. As I said to Joe Armstrong off-list, it probably wouldn't hurt for the string module to have a to_number func that took a string of either flavour and returned a float/int appropriately when you just don't care about the difference. Not that its hard to write, but it can be a tiny annoyance. -- Alexander Williams (thantos@REDACTED) The Squid's Redoubt: http://chancel.org:8000/Redoubt Currently Playing: B-52s, The - There's a Moon in the Sky (Called the Moon) Album: The B-52's From ok@REDACTED Fri May 13 00:24:57 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 13 May 2005 10:24:57 +1200 (NZST) Subject: math module bug Message-ID: <200505122224.j4CMOvSu092579@atlas.otago.ac.nz> Why not provide default implementations of the missing functions? Link them after libm, and you get the libm versions if they exist or the default ones if they don't. Fortran versions of erf() and erfc() can be found at http://www.netlib.org/specfun/erf http://www.netlib.org/specfun/readme does not mention any special licence conditions; my understanding is that you can just use this stuff. From sean.hinde@REDACTED Fri May 13 06:15:47 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 13 May 2005 05:15:47 +0100 Subject: Efficiently accepting TCP connections In-Reply-To: <4283BA77.1070704@diit.unict.it> References: <428366A2.2020101@diit.unict.it> <4283BA77.1070704@diit.unict.it> Message-ID: Hi, On 12 May 2005, at 21:20, Corrado Santoro wrote: > Sean Hinde wrote: >> From a quick look at one paper on this subject it appears to be an >> attempt to solve the problem where there are more connections than >> the language will allow you to have threads. > On one hand. But on the other hand, the main contribution of the > leader-follower is to overcome the overhead introduced by creating > threads "on-the-fly" for each incoming connection. OK, same effect. The point is that managing thread pools is much more complicated than just creating a new one every time. You have to track which ones are in use, and ensure that there is no leakage under all finishing cases. > >> Erlang suffers from the opposite effect - it can have many more >> threads than the OS will support IO handles ! > OK. So you could create, say 1000 or 10000, sleeping Erlang processes, > placing them in a pool, and then pick one process at time for each new > connection, passing the connected socket. This avoids latency in > connection handling because you don't need to create the process > on-the-fly. Then, when processing of the connection is completed, the > process can be returned to the pool and made available for a new > connection. You could indeed. And you might gain a small few percent if your aim is to make the fastest web server on the planet. The point about Erlang though is that process creation is such a lightweight operation that efforts to optimise it away are almost always misdirected. > > >> I suggest you scrap such thinking (be it object oriented or "thread >> pools") and go with the Erlang way (one process for every concurrent >> activity). > If you have an adequate number of processes in the pool, the behaviour > of the overall system is the same as having one process for every > concurrent activity. I think. Yes, but unnecessary and much more complex. > > Object orientation is not necessary, it is only a matter of C++/Java > implementation of the leader-follower pattern. But its principle holds > also in a non OO environment. Agreed. Sean From vlad.xx.dumitrescu@REDACTED Fri May 13 08:37:50 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Fri, 13 May 2005 08:37:50 +0200 Subject: math module bug Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE527@esealmw105.eemea.ericsson.se> Hi, From: Richard A. O'Keefe >Why not provide default implementations of the missing functions? >Link them after libm, and you get the libm versions if they exist >or the default ones if they don't. I didn't need a very exact implementation, nor a fast one, so I ended implementing them in Erlang, using linear interpolation. A C implementation can be found at http://www.ks.uiuc.edu/Research/namd/doxygen/erf_8C-source.html, if the Sun copyright notice is kept. regards, Vlad From joe.armstrong@REDACTED Fri May 13 09:09:33 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Fri, 13 May 2005 09:09:33 +0200 Subject: Erlang conference Call for Papers Reminder Message-ID: Just to remind everybody. The Fourth ACM SIGPLAN Erlang Workshop will be held in Tallinn on 25 September. Papers for this conference must be submitted by 6 June. The details can be found at http://www.erlang.se/workshop/2005/ I hope many of the people on this list will be sending in papers You've asked questions, had arguments, and told us what you're doing so now is the time to immortalise your ideas on paper - write the paper send it in and come to the workshop. I can tell you - these workshops are jolly good fun Get your pens out and send your papers to the program chairman (me) /Joe > From joe.armstrong@REDACTED Fri May 13 09:26:57 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Fri, 13 May 2005 09:26:57 +0200 Subject: Efficiently accepting TCP connections Message-ID: > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Corrado Santoro > Sent: den 12 maj 2005 16:22 > To: joel reymont > Cc: erlang-questions@REDACTED > Subject: Re: Efficiently accepting TCP connections > > > joel reymont wrote: > > Is there an efficient idiom for handling gen_tcp > connections on the server side? Yes I always use http://www.sics.se/~joe/tutorials/web_server/tcp_server.erl To see how it's used read http://www.sics.se/~joe/tutorials/web_server/web_server.html I have used this simple bit of code many many times for building web servers rpc servers, telnet servers etc. /Joe > One possibility is to use thread pools. The "leader-follower" > object-oriented design pattern by Doug Schmidt et al. has > been proposed > for this purpose. > > Ciao, > --C. > > -- > ====================================================== > Eng. Corrado Santoro, Ph.D. > > University of Catania - Engineering Faculty > Department of Computer Science and > Telecommunications Engineering > Viale A. Doria, 6 - 95125 CATANIA (ITALY) > > Tel: +39 095 7382144 Int. (5) 8035 > +39 095 7382380 > +39 095 7382365 > +39 095 7382364 > > VoIP: sip:8035@REDACTED > > Fax: +39 095 7382397 > > EMail: csanto@REDACTED > Personal Home Page: > http://www.diit.unict.it/users/csanto > > NUXI Home Page: > http://nuxi.iit.unict.it > ====================================================== > > From thomas.xa.johnsson@REDACTED Fri May 13 09:53:10 2005 From: thomas.xa.johnsson@REDACTED (Thomas Johnsson XA (LN/EAB)) Date: Fri, 13 May 2005 09:53:10 +0200 Subject: Problem with leaking file descriptors Message-ID: <44D1EB33A5E44D4BBAFD4FB9E8CCCB4719EB7E@esealmw107.eemea.ericsson.se> Hi, we have a problem where the erlang process is slowly consuming all the available file descriptors (takes days). And there are many ways to open an fd: open file, tcp, dets/mnesia, open_port,... could of course try to trace relevant ops, like file:open, file:close, etc. Are there any other better ideas out there on how to tackle this problem? Ideally, one could wish for a file descriptor table inside otp, keeping track of how/where fd's were opened... Any hints / ideas on this would be much appreciated! -- Thomas From bjorn@REDACTED Fri May 13 10:08:53 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 13 May 2005 10:08:53 +0200 Subject: math module bug In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE527@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE527@esealmw105.eemea.ericsson.se> Message-ID: Yes, providing our own implementation is indeed the cleanest thing to do. We might do that. But one question first. What are the functions used for? I have alwayws wondered why they were included in Erlang. (Joe?) /Bjorn "Vlad Dumitrescu XX \(LN/EAB\)" writes: > Hi, > > From: Richard A. O'Keefe > >Why not provide default implementations of the missing functions? > >Link them after libm, and you get the libm versions if they exist > >or the default ones if they don't. > > I didn't need a very exact implementation, nor a fast one, so I ended implementing them in Erlang, using linear interpolation. > > A C implementation can be found at http://www.ks.uiuc.edu/Research/namd/doxygen/erf_8C-source.html, if the Sun copyright notice is kept. > > regards, > Vlad > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From vlad.xx.dumitrescu@REDACTED Fri May 13 10:18:53 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Fri, 13 May 2005 10:18:53 +0200 Subject: math module bug Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE528@esealmw105.eemea.ericsson.se> > But one question first. What are the functions used for? They are mostly used in statistics, erf(x) is related to the cumulated normal distribution function, which in turn is the probability to get a value <= x for a random variable with normal distribution. See http://mathworld.wolfram.com/Erf.html if interested in more details. > I have alwayws wondered why they were included in Erlang. (Joe?) My guess is that they are there because they were in the C library, and why leave them out? :-) regards, Vlad From matthias@REDACTED Fri May 13 10:47:05 2005 From: matthias@REDACTED (Matthias Lang) Date: Fri, 13 May 2005 10:47:05 +0200 Subject: math module bug In-Reply-To: References: <11498CB7D3FCB54897058DE63BE3897C4BE527@esealmw105.eemea.ericsson.se> Message-ID: <17028.27017.181238.318893@antilipe.corelatus.se> > > From: Richard A. O'Keefe > > >Why not provide default implementations of the missing functions? > > >Link them after libm, and you get the libm versions if they exist > > >or the default ones if they don't. The linux manpage suggests that erf and erfc are required by C99. So does http://www.schweikhardt.net/identifiers.html Are erf and erfc missing from all windows variants or just some? (gcc isn't perfect either: http://gcc.gnu.org/gcc-4.0/c99status.html) Matt From vlad.xx.dumitrescu@REDACTED Fri May 13 11:00:17 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Fri, 13 May 2005 11:00:17 +0200 Subject: math module bug Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE529@esealmw105.eemea.ericsson.se> -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED]On Behalf Of Matthias Lang >Are erf and erfc missing from all windows variants or just some? Checking on MSDN, the MS C runtime library reference doesn't mention any erf or erfc function, so I suppose they don't exist and probably never did. /Vlad From simon@REDACTED Fri May 13 11:13:22 2005 From: simon@REDACTED (Simon Aurell) Date: Fri, 13 May 2005 10:13:22 +0100 Subject: Remote controlling using instant messaging Message-ID: <004c01c5579c$0371c6f0$c800a8c0@ituniv237> Hello everyone, I am currently working on my bachelor's project, which is Erlang based and might interest you. The project is about remote controlling devices in your home, e.g. from a mobile phone or pda, using instant messaging. I am building an Erlang based solution, with an ejabberd server and a sort of gateway, also in Erlang, which is capable of talking and listening to home automation devices. For now only the X10 protocol (low-end technology using the mains wiring) is supported. The idea is also to use a kind of 'agent' concept to add a layer of intelligence to the devices. This means that agents connect to the server (using Micka?l R?mond's jabberlang library), handle the dialogue with the user and decide what to do. If anyone has done something similar, has any ideas or is just interested, please drop me a line.. Regards, Simon -- http://www.erlang-consulting.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From csanto@REDACTED Fri May 13 12:42:46 2005 From: csanto@REDACTED (Corrado Santoro) Date: Fri, 13 May 2005 12:42:46 +0200 Subject: Efficiently accepting TCP connections In-Reply-To: References: <428366A2.2020101@diit.unict.it> <4283BA77.1070704@diit.unict.it> Message-ID: <428484A6.1000902@diit.unict.it> Sean Hinde wrote: > You could indeed. And you might gain a small few percent if your aim is > to make the fastest web server on the planet. The point about Erlang > though is that process creation is such a lightweight operation that > efforts to optimise it away are almost always misdirected. Fine! I didn't know this. So, if it is a so lightweight operation, you're right: create the process and go ahead! Ciao, --C. -- ====================================================== Eng. Corrado Santoro, Ph.D. University of Catania - Engineering Faculty Department of Computer Science and Telecommunications Engineering Viale A. Doria, 6 - 95125 CATANIA (ITALY) Tel: +39 095 7382144 Int. (5) 8035 +39 095 7382380 +39 095 7382365 +39 095 7382364 VoIP: sip:8035@REDACTED Fax: +39 095 7382397 EMail: csanto@REDACTED Personal Home Page: http://www.diit.unict.it/users/csanto NUXI Home Page: http://nuxi.iit.unict.it ====================================================== From joe.armstrong@REDACTED Fri May 13 14:03:29 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Fri, 13 May 2005 14:03:29 +0200 Subject: math module bug Message-ID: > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Bjorn > Gustavsson > Sent: den 13 maj 2005 10:09 > To: erlang-questions@REDACTED > Subject: Re: math module bug > > > Yes, providing our own implementation is indeed the cleanest > thing to do. > We might do that. > > But one question first. What are the functions used for? > I have alwayws wondered why they were included in Erlang. (Joe?) > I've no idea :-) If I recall math was added when we needed a sine or cosine or something so we quickly added an inteface to the C libraries and interfaced the functions we needed without thinking much. Then we added functions when we needed them. Floats were added so that I could generate fractal trees and draw pretty pictures of them. /Joe > /Bjorn > > "Vlad Dumitrescu XX \(LN/EAB\)" > writes: > > > Hi, > > > > From: Richard A. O'Keefe > > >Why not provide default implementations of the missing functions? > > >Link them after libm, and you get the libm versions if they exist > > >or the default ones if they don't. > > > > I didn't need a very exact implementation, nor a fast one, > so I ended implementing them in Erlang, using linear interpolation. > > > > A C implementation can be found at > http://www.ks.uiuc.edu/Research/namd/doxygen/erf_8C-source.htm l, if the Sun copyright notice is kept. > > regards, > Vlad > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From serge@REDACTED Fri May 13 15:48:24 2005 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 13 May 2005 09:48:24 -0400 Subject: Problem with leaking file descriptors In-Reply-To: <44D1EB33A5E44D4BBAFD4FB9E8CCCB4719EB7E@esealmw107.eemea.ericsson.se> References: <44D1EB33A5E44D4BBAFD4FB9E8CCCB4719EB7E@esealmw107.eemea.ericsson.se> Message-ID: <4284B028.5070302@hq.idt.net> I am not sure whether such a file descriptor table exists inside otp, but you can use the "lsof" os tool (on Linux: /usr/sbin/lsof) to show all file descriptors (of all types: file/socket/pipe/etc) open by the beam, and then try to deduce which files are left open from your application running by the run-time, and which ones are not. Serge Thomas Johnsson XA (LN/EAB) wrote: > Hi, > we have a problem where the erlang process is slowly consuming all the available file > descriptors (takes days). And there are many ways to open an fd: open file, tcp, dets/mnesia, open_port,... could of course try to trace relevant ops, like file:open, file:close, etc. > Are there any other better ideas out there on how to tackle this problem? > > Ideally, one could wish for a file descriptor table inside otp, keeping track of > how/where fd's were opened... > > Any hints / ideas on this would be much appreciated! > > -- Thomas From rich.neswold@REDACTED Fri May 13 16:16:12 2005 From: rich.neswold@REDACTED (Rich Neswold) Date: Fri, 13 May 2005 09:16:12 -0500 Subject: Remote controlling using instant messaging In-Reply-To: <004c01c5579c$0371c6f0$c800a8c0@ituniv237> References: <004c01c5579c$0371c6f0$c800a8c0@ituniv237> Message-ID: <14cf844b05051307163ad7b15b@mail.gmail.com> On 5/13/05, Simon Aurell wrote: > I am currently working on my bachelor's project, which is Erlang based and > might interest you. > > The project is about remote controlling devices in your home, e.g. from a > mobile phone or pda, using instant messaging. I am building an Erlang based > solution, with an ejabberd server and a sort of gateway, also in Erlang, > which is capable of talking and listening to home automation devices. For > now only the X10 protocol (low-end technology using the mains wiring) is > supported. > The idea is also to use a kind of 'agent' concept to add a layer of > intelligence to the devices. This means that agents connect to the server > (using Micka?l R?mond's jabberlang library), handle the dialogue with the > user and decide what to do. > > If anyone has done something similar, has any ideas or is just interested, > please drop me a line.. I've been planning out a similar system. I have a port driver written for the CM11A (an RS-232C to X-10 interface). I wanted to interface my home control system via Jabber and also through a web interface. Since I've recently learned Erlang, I'm still having problems getting ejabberd installed. Anyways, I'd be happy to share ideas with you so that this system can get done sooner than later. -- Rich AIM : rnezzy ICQ : 174908475 From mccratch@REDACTED Fri May 13 17:15:33 2005 From: mccratch@REDACTED (Matthias Kretschmer) Date: Fri, 13 May 2005 17:15:33 +0200 Subject: Erlang R10B-5 Message-ID: <20050513151531.GB27335@thrakhath.kilrathi.lcn> On 2005-05-12 at 09:17:38 (+0200), klacke@REDACTED wrote: > On Wed, May 11, 2005 at 06:46:25PM -0700, Michael McDaniel wrote: > > > > Thank you for the recent release! > > > FROM: #define RWBUFLEN 4096 > > TO: #define RWBUFLEN (32*1024) > > > And this fix (which has been reported to the list a couple > of times) should go into the regular code since https POSTs > doesn't work without it. (If the post is > 4096 bytes) but wouldn't the fix above limit is to posts =< 32*1024 bytes? can you elaborate on this? -- Matthias Kretschmer From klacke@REDACTED Fri May 13 17:51:20 2005 From: klacke@REDACTED (klacke@REDACTED) Date: Fri, 13 May 2005 17:51:20 +0200 Subject: Erlang R10B-5 In-Reply-To: <20050513151531.GB27335@thrakhath.kilrathi.lcn> References: <20050513151531.GB27335@thrakhath.kilrathi.lcn> Message-ID: <20050513155120.GA32670@hyber.org> On Fri, May 13, 2005 at 05:15:33PM +0200, Matthias Kretschmer wrote: > On 2005-05-12 at 09:17:38 (+0200), klacke@REDACTED wrote: > > On Wed, May 11, 2005 at 06:46:25PM -0700, Michael McDaniel wrote: > > > > > > Thank you for the recent release! > > > > > FROM: #define RWBUFLEN 4096 > > > TO: #define RWBUFLEN (32*1024) > > > > > > And this fix (which has been reported to the list a couple > > of times) should go into the regular code since https POSTs > > doesn't work without it. (If the post is > 4096 bytes) > > but wouldn't the fix above limit is to posts =< 32*1024 bytes? > can you elaborate on this? > Maybe, maybe not. Need to study the code hard to understand this exactly. Anyway, with the patch applied, POSTS larger than (32*1024) also works. Without the patch only POSTS < 4096 work. It may have to do something with the way SSL protocol clumps data together into SSL records, it may also have something to do with how the writer creates those SSL records. Needs lots of deep codeinspection into libssl code to answer satisfactory. Sorry, /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control From stock16@REDACTED Fri May 13 23:20:09 2005 From: stock16@REDACTED (jim min) Date: Fri, 13 May 2005 21:20:09 +0000 Subject: Using MS SQL 7.0 and Mnesia Message-ID: I've read thru alot of the thread and have not yet found a mention about using SQL 7.0 and Mnesia together. I know that there is the ODBC that allows erlang to use ODBC connections. Is there a previous Question or info about using Mnesia nodes for the grunt work of database processing....but using SQL to do the permanent record keeping. I'm looking to upload Parts of a SQL DB into Mnesia for processing by the services...... and periodically dump records back to the SQL Database on Disk for updating....and viser-versa. I am trying to do something similar to the "Banking Example" by Joe Armstrong....but using Erlang as sort of an ATM Machine. I want Erlang to upload the banking records from SQL to Mnesia and do deposits and withdrawls. I also need it to process "Outside" Deposits and Withdrawls that will be held in the SQL database as "Pending Withdrawls" and "New Deposits" At the end of the Day, I want it to Dump its account information back to the SQL Disk Database. Anything like this been mentioned.... or any tips on where I can get info to Implement this. Thanks Jim From mccratch@REDACTED Sat May 14 09:40:32 2005 From: mccratch@REDACTED (mccratch@REDACTED) Date: Sat, 14 May 2005 09:40:32 +0200 Subject: dialyzer; non-existing functions in other modules Message-ID: <20050514074031.GA2494@localhost.localdomain> Hello, I was just wondering, why Dialyzer doesn't report unexported/missing functions if used by another module. like: -module(test). -export([test/0]). test() -> ok. -module(test2). -export([test/0]). test() -> test:test(ok). I would expect that dialyzer tells me that test:test/1 isn't defined or exported, but the run passes silently. I am running R10B-5 with dialyzer 1.3.0 -- Matthias Kretschmer From kostis@REDACTED Sat May 14 11:49:36 2005 From: kostis@REDACTED (Kostis Sagonas) Date: Sat, 14 May 2005 11:49:36 +0200 (MEST) Subject: dialyzer; non-existing functions in other modules In-Reply-To: Mail from 'mccratch@gmx.net' dated: Sat, 14 May 2005 09:40:32 +0200 Message-ID: <200505140949.j4E9na5a019466@spikklubban.it.uu.se> Matthias Kretschmer asked: > > I was just wondering, why Dialyzer doesn't report unexported/missing > functions if used by another module. > ... [example skipped] ... > I would expect that dialyzer tells me that test:test/1 isn't defined or > exported, but the run passes silently. Currently, Dialyzer has no 'closed-world' mode. It accepts a set of modules and finds discrepancies in them but makes no assumptions that the set of functions it dialyzes is a complete application (or even that each module is complete on its own, for that matter). Therefore, it does not do what you ask. Tobias and I have discussed about adding such a `closed-world' mode to Dialyzer, which indeed will be useful because it will allow for more discrepancies to be identified, but it is not very high on our TODO list because we are working on extending Dialyzer's functionality in more exciting ways. Among the reasons why what you want is not very high on our TODO list is because Erlang/OTP already provides ways of achieving what you want: take a look at 'xref'. (And duplicating functionality which is already available is not among Dialyzer's top priorities.) Best, Kostis From mccratch@REDACTED Sat May 14 12:34:25 2005 From: mccratch@REDACTED (mccratch@REDACTED) Date: Sat, 14 May 2005 12:34:25 +0200 Subject: dialyzer; non-existing functions in other modules In-Reply-To: <200505140949.j4E9na5a019466@spikklubban.it.uu.se> References: <200505140949.j4E9na5a019466@spikklubban.it.uu.se> Message-ID: <20050514103425.GB2494@localhost.localdomain> On 2005-05-14 at 11:49:36 (+0200), Kostis Sagonas wrote: > Among the reasons why what you want is not very high on our TODO list > is because Erlang/OTP already provides ways of achieving what you want: > take a look at 'xref'. (And duplicating functionality which is already > available is not among Dialyzer's top priorities.) ah thanks - I didn't know about xref - knowing xref now I am very happy -- Matthias Kretschmer From neumann@REDACTED Sat May 14 23:31:52 2005 From: neumann@REDACTED (=?iso-8859-1?q?Fran=E7ois-Denis_Gonthier?=) Date: Sat, 14 May 2005 17:31:52 -0400 Subject: Debian Erlang package upgraded to 10.b.5 Message-ID: <200505141731.54865.neumann@lostwebsite.net> Hello all, I have upgraded my Debian package to 10.B.5. Comments are welcome The package is at http://neutronic.mine.nu/unstable Fran?ois-Denis Gonthier -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From rvg@REDACTED Mon May 16 08:24:05 2005 From: rvg@REDACTED (Rudolph van Graan) Date: Mon, 16 May 2005 08:24:05 +0200 Subject: Priority Queues Message-ID: <99FC7AD2-13F0-40A8-8CF0-230248FBC66E@patternmatched.com> Hi All, I am currently thinking about the implementation of priority queues in erlang. Specifically, what do you guys suggest as an efficient way to achieve the following: 1. A queue with a definitive head and tail (i.e. first and last records) 2. The items in the queue need to be sorted according to some criteria that will always allow you to identify an entry as the "first" or "next" one 3. The queue length can be massive (100's of thousands or millions of records) 4. Insertion time should be constant 5. The queue must be persistent (i.e. mnesia or dets) 6. Once the first/head entry has been processed, it will no longer be in the queue. Any suggestions? Rudolph van Graan -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2373 bytes Desc: not available URL: From m.gomard@REDACTED Mon May 16 09:55:02 2005 From: m.gomard@REDACTED (Miguel Gomard) Date: Mon, 16 May 2005 09:55:02 +0200 Subject: jabberlang Message-ID: hi all, Anyone has status about jabber library implemented in erlang ? is there release ? where i can donwload it ? Thanks From joelr1@REDACTED Mon May 16 10:24:57 2005 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 16 May 2005 11:24:57 +0300 Subject: Off-topic (contact# in Stockholm) Message-ID: <20050516092457.29779@smtp.gmail.com> Folks, Would someone kindly send me their contact info in Stockholm (privately)? I'll be there tomorrow or the day after and might need to ask questions :-). Thanks, Joel -- http://wagerlabs.com/tech From olivier.sambourg@REDACTED Mon May 16 10:35:51 2005 From: olivier.sambourg@REDACTED (Olivier Sambourg) Date: Mon, 16 May 2005 10:35:51 +0200 Subject: jabberlang In-Reply-To: References: Message-ID: If this can encourage Michael to release it, I'm eagerly waiting for it too :) -- Olivier 2005/5/16, Miguel Gomard : > > hi all, > > Anyone has status about jabber library implemented in erlang ? > is there release ? where i can donwload it ? > > Thanks > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.arnon@REDACTED Mon May 16 12:41:02 2005 From: alex.arnon@REDACTED (Alex Arnon) Date: Mon, 16 May 2005 13:41:02 +0300 Subject: Strange 'receive' from socket. Message-ID: <944da41d050516034173c6919c@mail.gmail.com> Hi All, I have started playing around with sockets, and have encountered the following problem: - I open a read socket (e.g. to 'chargen' port (19) for testing). - Perform a receive on either {tcp, Socket, Data} or Other (as sink). - Even when I _always_ get a message {tcp, _, _}, sometimes the 'receive' acts on the sink branch. So, from the program below I receive either: ---------------------------------------------- 32> client_test:go("10.10.10.8", 19, 3). Opened #Port<0.145> #Port<0.145> => <<32,33,34,35,36,...,10>> #Port<0.145> => <<33,34,35,36,37,...,105,106,107>> #Port<0.145> => <<108,109,110,111,...,122,123,13,10>> #Port<0.145> [closing] ok 33> ----------------------------------------------- or ----------------------------------------------- 31> client_test:go("10.10.10.8", 19, 3). Opened #Port<0.144> #Port<0.144> [unknown] : {tcp,#Port<0.143>,<<53,54,55,56,...,123,124,125,126,32>>} ok ------------------------------------------------ I have witnessed this behaviour on both Win2K and OpenBSD. The program: ------------------------------------------------ -module(client_test). -export([go/3]). %% %% %% go (Server, Port, Iterations) when list(Server), integer(Port), integer(Iterations), Iterations > 0 -> case gen_tcp:connect(Server, Port, [binary, {packet, 0}]) of {ok, Socket} -> io:format("Opened ~w~n", [Socket]), do_read(Socket, Iterations), gen_tcp:shutdown(Socket, read_write), gen_tcp:close(Socket), ok; _ -> error end. do_read (Socket, Iterations) when Iterations > 0 -> receive {tcp, Socket, Data} -> io:format("~w => ~w~n", [Socket, Data]), do_read(Socket, Iterations-1); Other -> io:format("~w [unknown] : ~w~n", [Socket, Other]), error after 5000 -> io:format("~w [timeout]~n", [Socket]), error end; do_read (Socket, _Iterations) when _Iterations == 0 -> io:format("~w [closing]~n", [Socket]), ok. ---------------------------------------------- P.S. Apologies for style :) From vlad.xx.dumitrescu@REDACTED Mon May 16 13:00:40 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Mon, 16 May 2005 13:00:40 +0200 Subject: Strange 'receive' from socket. Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE52F@esealmw105.eemea.ericsson.se> Hi, Looking at this output, 31> client_test:go("10.10.10.8", 19, 3). Opened #Port<0.144> #Port<0.144> [unknown] : {tcp,#Port<0.143>,<<53,54,55,56,...,123,124,125,126,32>>} ok we can see that the opened socket is #Port<0.144>, while the received message is from #Port<0.143>. Thus the behaviour is corect, since the message isn't from the right socket. I interpret this as being the result of running several tests in the same receiver process, and the previous socket did have some data already sent when it was closed. So the message was already in the receiver process' queue, where it was picked by the next run. In order to not get this effect, you can either call go in a separate process, or flush the message queue between runs. flush() -> receive _ -> flush() after 0 -> ok end. best regards, Vlad From alex.arnon@REDACTED Mon May 16 13:08:04 2005 From: alex.arnon@REDACTED (Alex Arnon) Date: Mon, 16 May 2005 14:08:04 +0300 Subject: Strange 'receive' from socket. In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE52F@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE52F@esealmw105.eemea.ericsson.se> Message-ID: <944da41d0505160408f1d2667@mail.gmail.com> Oh, I hadn't noticed that!! Thank you! On 5/16/05, Vlad Dumitrescu XX (LN/EAB) wrote: > Hi, > > Looking at this output, > > 31> client_test:go("10.10.10.8", 19, 3). > Opened #Port<0.144> > #Port<0.144> [unknown] : > {tcp,#Port<0.143>,<<53,54,55,56,...,123,124,125,126,32>>} > ok > > we can see that the opened socket is #Port<0.144>, while the received message is from #Port<0.143>. Thus the behaviour is corect, since the message isn't from the right socket. > > I interpret this as being the result of running several tests in the same receiver process, and the previous socket did have some data already sent when it was closed. So the message was already in the receiver process' queue, where it was picked by the next run. > > In order to not get this effect, you can either call go in a separate process, or flush the message queue between runs. > > flush() -> > receive > _ -> > flush() > after 0 -> > ok > end. > > best regards, > Vlad > > From vlad_dumitrescu@REDACTED Mon May 16 13:33:58 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Mon, 16 May 2005 13:33:58 +0200 Subject: Evaluating code snippets Message-ID: Hi, I have a need to evaluate code snippets, kind of a scripting language, and I'm not sure what is the best way to do it. The snippets are defining and using common variables, but I need to keep them separate (as opposed to compiling the whole file into a module, like for example .yaws files). I see two alternatives: - save the source and evaluate it using erl_eval, and keeping the variable bindings global - "bake" them inside a template function that will take care of the bindings. I would prefer the second approach, because the snippets will be called many times, but I have a problem: is there a way to retrieve the set of current bindings? I couldn't find anything, and I 'm not even sure it is possible to add such a BIF without confusing the compiler, but I thought I'd ask anyway because maybe some other idea might come up. Thanks in advance! Regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.wiger@REDACTED Mon May 16 14:03:31 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 16 May 2005 14:03:31 +0200 Subject: dialyzer; non-existing functions in other modules Message-ID: I would still like to see Dialyzer optionally report which functions/modules were "out of scope" for the analysis -- either because they were not part of the set of modules being analysed, or because they weren't in the PLT. If nothing else, this will serve as an indication of how trustworthy the analysis is, and let the user know that a better result would be possible if the scope of the analysis were increased. Regards, Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Kostis Sagonas > Sent: den 14 maj 2005 11:50 > To: mccratch@REDACTED; erlang-questions@REDACTED > Cc: tobiasl@REDACTED; kostis@REDACTED > Subject: Re: dialyzer; non-existing functions in other modules > > > Matthias Kretschmer asked: > > > > I was just wondering, why Dialyzer doesn't report > unexported/missing > > functions if used by another module. > > ... [example skipped] ... > > I would expect that dialyzer tells me that test:test/1 > isn't defined or > > exported, but the run passes silently. > > Currently, Dialyzer has no 'closed-world' mode. It accepts a set of > modules and finds discrepancies in them but makes no assumptions that > the set of functions it dialyzes is a complete application (or even > that each module is complete on its own, for that matter). Therefore, > it does not do what you ask. > > Tobias and I have discussed about adding such a `closed-world' mode to > Dialyzer, which indeed will be useful because it will allow for more > discrepancies to be identified, but it is not very high on our TODO > list because we are working on extending Dialyzer's functionality in > more exciting ways. > > Among the reasons why what you want is not very high on our TODO list > is because Erlang/OTP already provides ways of achieving what > you want: > take a look at 'xref'. (And duplicating functionality which > is already > available is not among Dialyzer's top priorities.) > > Best, > Kostis > > From kostis@REDACTED Mon May 16 14:15:21 2005 From: kostis@REDACTED (Kostis Sagonas) Date: Mon, 16 May 2005 14:15:21 +0200 (MEST) Subject: dialyzer; non-existing functions in other modules In-Reply-To: Mail from '"Ulf Wiger \(AL/EAB\)" ' dated: Mon, 16 May 2005 14:03:31 +0200 Message-ID: <200505161215.j4GCFLQq027712@spikklubban.it.uu.se> Ulf Wiger wrote: > I would still like to see Dialyzer optionally report which > functions/modules were "out of scope" for the analysis -- > either because they were not part of the set of modules being > analysed, or because they weren't in the PLT. Yes. This is indeed the case in Dialyzer, in fact in the one you are using ;), albeit only in its GUI version which probably explains why you have not noticed this... Cheers, Kostis PS. The reason why it does not happen in the command-line version is that we did not want to pollute the outcome with auxilliary info (but we might conside adding a --verbo option or similar). From ulf.wiger@REDACTED Mon May 16 14:29:46 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 16 May 2005 14:29:46 +0200 Subject: Priority Queues Message-ID: You can do this (almost) using an ordered_set disc_copy table in mnesia. The object key could be e.g. {Priority, erlang:now()} for prioritized FIFO, or {Priority, negative(erlang:now())} for prioritized LIFO, where negative({MSec, Sec, MuSec}) -> {-MSec, -Sec, -MySec}. 1) Using dirty_first(Tab) and dirty_last(Tab), you can get to the first and last entries respectively. 2) The structure of the key determines the ordering. See above. 3) Not a big problem, but the entries will all be in RAM (and logged to disk periodically) 4) Not constant time, but close enough (logN) 5) Persistence is taken care of by mnesia 6) To make this thread-safe, you need to either serialize the operation using a server, or use mnesia transactions. The transaction can for example return the next value for processing like so: mnesia:activity( dirty, fun() -> case mnesia:dirty_first(prio_queue) of '$end_of_table' -> queue_empty; Key -> [Result] = mnesia:read(prio_queue, Key, write), mnesia:delete(prio_queue, Key) Result end end). It's a little trickier if you want full atomicity, since there is no mnesia:first/1. You can still do it like described above, since you get synchronization on the read, and thus avoid the risk of race conditions or lost updates. However, you can get aborted transactions instead of proper serialization. It's possible to use mnesia:select(Tab, Pattern, 1, write), which will, on an ordered_set, return the first object in the table matching Pattern, but it will be slightly more expensive (esp. if this operation is called as a nested transaction, since the select() call has to scan the transaction store.) Of course, the overhead of using transactions will be significant, but mnesia:activity(dirty, ...) is not so bad. It's a very handy way of packaging dirty operations. /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of > Rudolph van Graan > Sent: den 16 maj 2005 08:24 > To: Erlang Questions > Subject: Priority Queues > > > Hi All, > > I am currently thinking about the implementation of priority queues > in erlang. Specifically, what do you guys suggest as an > efficient way > to achieve the following: > > 1. A queue with a definitive head and tail (i.e. first and > last records) > 2. The items in the queue need to be sorted according to some > criteria that will always allow you to identify an entry as the > "first" or "next" one > 3. The queue length can be massive (100's of thousands or > millions of > records) > 4. Insertion time should be constant > 5. The queue must be persistent (i.e. mnesia or dets) > 6. Once the first/head entry has been processed, it will no > longer be > in the queue. > > Any suggestions? > > Rudolph van Graan > > From ulf.wiger@REDACTED Mon May 16 14:58:17 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 16 May 2005 14:58:17 +0200 Subject: Evaluating code snippets Message-ID: I don't know what your performance requirements are, but you could consider using file:script/2 The file:script/2 function is like file:eval/2, but it returns the result of the last expression evaluated, rather than 'ok', which is what you get back from file:eval/2. The syntax is file:script(FileName, Bindings). You could either specify a library function through which the scripts can create new variable bindings, or use a convention such that the scripts return e.g. {Result, NewBindings}. /Uffe -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED]On Behalf Of Vlad Dumitrescu Sent: den 16 maj 2005 13:34 To: erlang-questions@REDACTED Subject: Evaluating code snippets Hi, I have a need to evaluate code snippets, kind of a scripting language, and I'm not sure what is the best way to do it. The snippets are defining and using common variables, but I need to keep them separate (as opposed to compiling the whole file into a module, like for example .yaws files). I see two alternatives: - save the source and evaluate it using erl_eval, and keeping the variable bindings global - "bake" them inside a template function that will take care of the bindings. I would prefer the second approach, because the snippets will be called many times, but I have a problem: is there a way to retrieve the set of current bindings? I couldn't find anything, and I 'm not even sure it is possible to add such a BIF without confusing the compiler, but I thought I'd ask anyway because maybe some other idea might come up. Thanks in advance! Regards, Vlad From ulf.wiger@REDACTED Mon May 16 15:03:24 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 16 May 2005 15:03:24 +0200 Subject: dialyzer; non-existing functions in other modules Message-ID: Kostis Sagonas wrote: > Ulf Wiger wrote: > > > I would still like to see Dialyzer optionally report which > > functions/modules were "out of scope" for the analysis -- > > either because they were not part of the set of modules being > > analysed, or because they weren't in the PLT. > > Yes. This is indeed the case in Dialyzer, in fact in the one you > are using ;), albeit only in its GUI version which probably explains > why you have not noticed this... FWIW, I did notice, since someone ran the GUI version and told me about this feature. (: > PS. The reason why it does not happen in the command-line version is > that we did not want to pollute the outcome with auxilliary info > (but we might conside adding a --verbo option or similar). One of the things we do in telecoms is to introduce summary alarms. That is, you can issue one warning stating that there were unknowns, suggesting that the analysis should be re-run with more detailed output. /Uffe From vlad_dumitrescu@REDACTED Mon May 16 15:20:13 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Mon, 16 May 2005 15:20:13 +0200 Subject: Evaluating code snippets References: Message-ID: Hi, >I don't know what your performance requirements are, >but you could consider using file:script/2 That's an interesting idea, I had missed that one, but it would probably be too slow. I have a file with embedded Erlang code, and that code consists mainly of simple matches (X=something, Y=M:F()). Almost like yaws. This file will be compiled into a module, and that I know how to handle, but I also want to be able to "execute" it in interpreted mode. Mostly because I'd like to test the ideas before getting my hands dirty with the code generating engine. Thanks, Vlad From chandrashekhar.mullaparthi@REDACTED Mon May 16 15:49:03 2005 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Mon, 16 May 2005 14:49:03 +0100 Subject: Priority Queues In-Reply-To: <99FC7AD2-13F0-40A8-8CF0-230248FBC66E@patternmatched.com> References: <99FC7AD2-13F0-40A8-8CF0-230248FBC66E@patternmatched.com> Message-ID: We've implemented such queues using mnesia ordered_set tables. But we limit queue size to about 100,000 entries. But there is no reason why you can't have a bigger queue. We had a single process handling each queue so (6) below wasn't a problem. The only performance problem which you might encounter with very big queues is when the contents of the queue are changing very fast. Mnesia periodically dumps the entire table from RAM to disk and for large tables you will see that whenever mnesia does this, your queue processing will slow down. cheers Chandru On 16 May 2005, at 07:24, Rudolph van Graan wrote: > Hi All, > > I am currently thinking about the implementation of priority queues in > erlang. Specifically, what do you guys suggest as an efficient way to > achieve the following: > > 1. A queue with a definitive head and tail (i.e. first and last > records) > 2. The items in the queue need to be sorted according to some criteria > that will always allow you to identify an entry as the "first" or > "next" one > 3. The queue length can be massive (100's of thousands or millions of > records) > 4. Insertion time should be constant > 5. The queue must be persistent (i.e. mnesia or dets) > 6. Once the first/head entry has been processed, it will no longer be > in the queue. > > Any suggestions? > > Rudolph van Graan > From robert.balogh@REDACTED Mon May 16 16:37:03 2005 From: robert.balogh@REDACTED (=?iso-8859-1?Q?R=F3bert_Balogh_=28IJ/ETH=29?=) Date: Mon, 16 May 2005 16:37:03 +0200 Subject: erlang DBG question Message-ID: Hej dbg experts, I'm a beginner on tracing erlang, and I have a small problem. None the less that I read the ERTS user's doc about Match specification I don't understand how can I build a match specification if I have a module:function where the function has 2 input parameter like A, and B and I'd like to see that "trace messages" when the A is equal 2. Could anybody help me about it? Here is my first step: [{'_',[],[{message,{process_dump}},{return_trace}]}] thanks a lot, /Robi From ulf.wiger@REDACTED Mon May 16 23:27:06 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 16 May 2005 23:27:06 +0200 Subject: call for testers: compound indexes in mnesia Message-ID: I mentioned earlier about my hack to add more flexible indexes to mnesia (http://www.erlang.org/ml-archive/erlang-questions/200502/msg00233.html) I've now come up with a solution that I'm fairly happy with myself, and even though there are some finishing touches left, I'd like to solicit some beta testers. This is what works: - Indexes are now first-class tables, although flagged so that they can't be accidentally written to. - You can have multiple, named, indexes on the same attribute, or indexes on the whole object. One unnamed index is allowed per attribute (compatible with the old indexes). - Indexes can be ordered or unordered. Ordered disc_only indexes are obviously not allowed. - For each index, a callback function is specified. This function is called with either the attribute value, or the whole object. It returns a list of index values, and must be entirely side-effect free. This means you can have case-insensitive word or word stem indexes, or index on combinations of different attributes ("compound indexes" -- extremely useful). - All updates to indexes are visible during the transaction in which they were written, but not outside of it, until committed. This is how it works today as well, but the current solution didn't work for the more flexible indexes. - Index tables inherit attributes from the main table by default: a disc_copy table gets disc_copy indexes with the same replication pattern, etc. A fragmented table gets fragmented indexes, with the same number of fragments (but hashed on index value) An indexed read on a fragmented table will try to pick the right index fragment, fetch the keys from the index, and then perform a multicall to the nodes that have fragments containing keys of interest. (Some optimizations could be done, but this should be a *huge* improvement compared to the existing solution) - It's possible to specify individual table properties for each index table. For example, you can specify a centralized index table for a fragmented main table. This could work if the index is much smaller than the main table, in terms of memory useage. I've tested: - table loads in various configurations - transaction writes and index_reads - dirty writes and index_reads - index_match_object, index_first, index_last, index_fold - reads and writes on fragmented table with a fragmented index - reads and writes on a table where table and index reside on different nodes. Things that remain: - Some more sanity checks when creating tables and indexes - Conversion of existing databases to the new format and support for things like transform_table - The remaining functions in mnesia_frag - Looking at the snmp connection, which should become an ordered index on the whole object. This should allow for more flexible snmp mappings and also allow snmp mappings toward fragmented tables (not possible today) - Writing a library of useful index callbacks. - (It's basically possible now to have indexed indexes, but why would one want to? Forbid, or detect loops?) - Cleaning up the code. I think this change actually simplifies the handling of indexes in mnesia. - Double-check -- triple-check -- that table loading is done right. Mnesia's table loading code is a scary place for a weekend hacker. - Run the whole mnesia test suite Let me know if you want to help shake out the bugs. /Uffe From b88zhou@REDACTED Tue May 17 05:46:49 2005 From: b88zhou@REDACTED (Brian Zhou) Date: Mon, 16 May 2005 20:46:49 -0700 Subject: [announce] Erlang ported to linksys nslu2 Message-ID: Hi all, I'm pleased to announce that the latest erlang R10B-5 has been ported to run on linksys nslu2, complete with SAE and openssl support, but with HiPE disabled. For those unfamiliar with this device, see the following links: http://www.linksys.com/products/product.asp?grid=35&scid=43&prid=640 http://www.nslu2-linux.org http://www.nslu2-linux.org/wiki/Info/CPUOverview It's basically a tiny XSCALE based network appliance (266MHz CPU, 32M RAM) that allows you attach USB devices, with very low power consumption and completely silent. I'd think it's a perfect little node for Erlang. The packaging erlang.mk and associated patches are checked in http://cvs.sourceforge.net/viewcvs.py/nslu/unslung/ and binary ipkg will be available as soon as it's built on the official build machine. The next step is try to get it cross build as the complete native compilation took about 10 hours. Does anyone know what it takes to port HiPE to ARM? And how much performance gain can one expect? Cheers, -Brian Zhou From bengt.kleberg@REDACTED Tue May 17 08:39:37 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 17 May 2005 08:39:37 +0200 Subject: erlang DBG question In-Reply-To: References: Message-ID: <428991A9.3050106@ericsson.com> R?bert Balogh (IJ/ETH) wrote: > Hej dbg experts, > > I'm a beginner on tracing erlang, and I have a small problem. None > the less that I read the ERTS user's doc about Match specification I > don't understand how can I build a match specification if I have a > module:function where the function has 2 input parameter like A, and > B and I'd like to see that "trace messages" when the A is equal 2. > Could anybody help me about it? the following has been tested with lists:nth/2. dbg:tpl( Module, Function, [{['$1', '_'], [{'==', '$1', 2}], []}] ). i have started dbg with the ''magical'' dbg:tracer(). dbg:p( all, [call] ). which may, or may not, be of significance. bengt From mikpe@REDACTED Tue May 17 10:06:56 2005 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 17 May 2005 10:06:56 +0200 Subject: [announce] Erlang ported to linksys nslu2 In-Reply-To: References: Message-ID: <17033.42528.23914.310205@alkaid.it.uu.se> Brian Zhou writes: > The next step is try to get it cross build as the complete native > compilation took about 10 hours. Erlang/OTP isn't set up for cross-compilation. You may be in for a world of pain... > Does anyone know what it takes to port HiPE to ARM? Easy, provide us with the HW :-) Seriously, any 32-bit CPU sensible enough to be able to run Linux and the gcc toolchain, and which is already running Erlang's BEAM interpreter, should be "supportable". I haven't studied the ARM ISA so I can't comment on whether generating native code would be easy or hard. > And how much performance > gain can one expect? That depends on many factors, but as a rough cut, say a factor of 2-4 for computational code. For I/O or BIF-bound server style applications, native code won't bring much benefit. /Mikael From robert.balogh@REDACTED Tue May 17 10:24:53 2005 From: robert.balogh@REDACTED (=?iso-8859-1?Q?R=F3bert_Balogh_=28IJ/ETH=29?=) Date: Tue, 17 May 2005 10:24:53 +0200 Subject: erlang DBG question Message-ID: Hej, Thanks a lot for everyone who responded to me. br, /Robi -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] Sent: Tuesday, May 17, 2005 8:40 AM To: erlang-questions@REDACTED Subject: Re: erlang DBG question R?bert Balogh (IJ/ETH) wrote: > Hej dbg experts, > > I'm a beginner on tracing erlang, and I have a small problem. None > the less that I read the ERTS user's doc about Match specification I > don't understand how can I build a match specification if I have a > module:function where the function has 2 input parameter like A, and > B and I'd like to see that "trace messages" when the A is equal 2. > Could anybody help me about it? the following has been tested with lists:nth/2. dbg:tpl( Module, Function, [{['$1', '_'], [{'==', '$1', 2}], []}] ). i have started dbg with the ''magical'' dbg:tracer(). dbg:p( all, [call] ). which may, or may not, be of significance. bengt From dietmar@REDACTED Tue May 17 13:01:15 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Tue, 17 May 2005 13:01:15 +0200 Subject: newbie question Message-ID: <4289CEFB.7020805@ast.dfs.de> Hi ! Isn't that supposed to work ? if cmmc_db:getProcState(Key,Name) /= State -> instead I have to write ProcState = cmmc_db:getProcState(Key,Name), if ProcState /= State -> regards Dietmar From bengt.kleberg@REDACTED Tue May 17 13:12:09 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 17 May 2005 13:12:09 +0200 Subject: newbie question In-Reply-To: <4289CEFB.7020805@ast.dfs.de> References: <4289CEFB.7020805@ast.dfs.de> Message-ID: <4289D189.8040207@ericsson.com> Dietmar Schaefer wrote: > Hi ! > > Isn't that supposed to work ? > > > if cmmc_db:getProcState(Key,Name) /= State -> > instead I have to write > > ProcState = cmmc_db:getProcState(Key,Name), > > if ProcState /= State -> ''if'' is limited in what it can handle. use ''case'' if you want to avoid the ''ProcState'' variable. bengt From ulf.wiger@REDACTED Tue May 17 13:14:53 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Tue, 17 May 2005 13:14:53 +0200 Subject: newbie question Message-ID: Dietmar Schaefer wrote: > Hi ! > > Isn't that supposed to work ? > > > if cmmc_db:getProcState(Key,Name) /= State -> No. Only guard expressions are allowed in if clauses. > instead I have to write > > ProcState = cmmc_db:getProcState(Key,Name), > > if ProcState /= State -> or case cmmc_db:getProcState(Key,Name) of S when S /= State -> ... end or case cmmc_db:getProcState(Key,Name) /= State of true -> ... end. /Uffe From keymon@REDACTED Tue May 17 13:17:13 2005 From: keymon@REDACTED (=?ISO-8859-1?Q?H=E9ctor_Rivas_G=E1ndara?=) Date: Tue, 17 May 2005 13:17:13 +0200 Subject: SCons builder for erlang Message-ID: Hi, I send the definition of a SCons[1] builder for Erlang beams. SCons its a great tool for project building and a good replacement for make: -- 8< ------ 8< --- --- 8< ------ 8< ------ import os env = Environment(ENV = os.environ) ####################################################################### # Erlang Builder #ERLANG_BIN = "" #ERLC = os.path.join(ERLANG_BIN, 'erlc') ERLC = 'erlc' beam_builder = Builder( generator = lambda source, target, env, for_signature: ERLC + # Append include entries reduce(lambda acum, path: acum+' -I'+str(path), [""] + env.get('ERLINCLUDE', [])) + # Append path entries reduce(lambda acum, path: acum+' -pa'+str(path), [""] + env.get('ERLPATH', [])) + ' -o $TARGET $SOURCES' , suffix = '.beam', src_suffix = '.erl') env.Append(BUILDERS = {'Beam': beam_builder}) ####################################################################### # Example use env.Append(ERLINCLUDE = [Dir("."), Dir("./subsystem")]) env.Append(ERLPATH = [Dir("/path/to/any/library"), Dir("/path/to/other/library")]) erlang_sources = Split(""" asource.erl othersource.erl """) beams = [] for erlang_source in erlang_sources: beam = env.Beam(erlang_source) beams.append(beam) DIST_BEANS="./dist/bin" install_beans = Install(DIST_BEANS, beams) Alias('install', install_beans) -- 8< ------ 8< --- --- 8< ------ 8< ------ -- [1] http://www.scons.org -- Saudos Keymon From matthias@REDACTED Tue May 17 13:19:52 2005 From: matthias@REDACTED (Matthias Lang) Date: Tue, 17 May 2005 13:19:52 +0200 Subject: newbie question In-Reply-To: <4289CEFB.7020805@ast.dfs.de> References: <4289CEFB.7020805@ast.dfs.de> Message-ID: <17033.54104.458519.915486@antilipe.corelatus.se> >From the FAQ: | 9.4. Why can't I call arbitrary functions in a guard? | | If that was allowed, there would be no guarantee that guards were side-effect free. | | Also, it is convenient to be able to program as though guards do not consume any significant amount of execution time. There's a list of BIFs which can be called from within guards in the Erlang book and the standard Erlang spec, some examples are size(), length(), integer(), record(). | | The "problem" often crops up when using if: | | issue_warning() -> | if (os:type() == {win32, windows}) -> %% illegal guard | ok = io:fwrite("this computer may crash at any time\n"); | true -> | ok = io:fwrite("no problem\n") | end. | | | The solution is usually to use case instead. Case is used much more frequently than if in most Erlang programs: | | issue_warning() -> | case os:type() of | {win32, windows} -> ok = io:fwrite("crash soon\n"); | _ -> ok = io:fwrite("no problem\n") | end. | Matthias Dietmar Schaefer writes: > Hi ! > > Isn't that supposed to work ? > > > if cmmc_db:getProcState(Key,Name) /= State -> > > instead I have to write > > ProcState = cmmc_db:getProcState(Key,Name), > > if ProcState /= State -> > > > > regards > > > Dietmar From thomas.xa.johnsson@REDACTED Tue May 17 13:37:49 2005 From: thomas.xa.johnsson@REDACTED (Thomas Johnsson XA (LN/EAB)) Date: Tue, 17 May 2005 13:37:49 +0200 Subject: newbie question Message-ID: <44D1EB33A5E44D4BBAFD4FB9E8CCCB4719EB90@esealmw107.eemea.ericsson.se> There are situations where it is important that guards are fast and side effect-free (in receive, for example). Conditions in if-expressions is *not* one of those places, IMHO. (Except for the usual good reasons to to program as 'functionally' as possible). Ie, there is no reason that I can see why the if-condition has to be a guard syntactically rather than an expression. I just forces the programmer to write something more clumsy. Or is there some light I haven't yet seen? -- Thomas -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED]On Behalf Of Matthias Lang Sent: den 17 maj 2005 13:20 To: Dietmar Schaefer Cc: erlang-questions@REDACTED Subject: Re: newbie question >From the FAQ: | 9.4. Why can't I call arbitrary functions in a guard? | | If that was allowed, there would be no guarantee that guards were side-effect free. | | Also, it is convenient to be able to program as though guards do not consume any significant amount of execution time. There's a list of BIFs which can be called from within guards in the Erlang book and the standard Erlang spec, some examples are size(), length(), integer(), record(). | | The "problem" often crops up when using if: | | issue_warning() -> | if (os:type() == {win32, windows}) -> %% illegal guard | ok = io:fwrite("this computer may crash at any time\n"); | true -> | ok = io:fwrite("no problem\n") | end. | | | The solution is usually to use case instead. Case is used much more frequently than if in most Erlang programs: | | issue_warning() -> | case os:type() of | {win32, windows} -> ok = io:fwrite("crash soon\n"); | _ -> ok = io:fwrite("no problem\n") | end. | Matthias Dietmar Schaefer writes: > Hi ! > > Isn't that supposed to work ? > > > if cmmc_db:getProcState(Key,Name) /= State -> > > instead I have to write > > ProcState = cmmc_db:getProcState(Key,Name), > > if ProcState /= State -> > > > > regards > > > Dietmar From Lennart.Ohman@REDACTED Tue May 17 13:57:07 2005 From: Lennart.Ohman@REDACTED (=?iso-8859-1?Q?Lennart_=D6hman?=) Date: Tue, 17 May 2005 13:57:07 +0200 Subject: SV: newbie question Message-ID: One significant difference when it comes to side-effects is that in 'case' you will *always* pass through that single "thing" causing a side effect. In ifs, in contrast, you may execute one or several if-clauses depending on if and when an if-clause turns true. Making the latter much more difficult to follow. Best Regards Lennart case function_having_side_effects(X) of foo -> ....; bar -> .... end, if one_function_having_side_effect(X)==foo -> .... another_function_with_side_effects(X)/=dog -> .... even_more_sideeffects(X)>10 -> ....; true -> i_have_done_all_side_effects end. ------------------------------------------------------------- Lennart Ohman phone : +46-8-587 623 27 Sj?land & Thyselius Telecom AB cellular: +46-70-552 6735 Sehlstedtsgatan 6 fax : +46-8-667 8230 SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED ________________________________ Fr?n: owner-erlang-questions@REDACTED genom Thomas Johnsson XA (LN/EAB) Skickat: ti 2005-05-17 13:37 Till: erlang-questions@REDACTED ?mne: RE: newbie question There are situations where it is important that guards are fast and side effect-free (in receive, for example). Conditions in if-expressions is *not* one of those places, IMHO. (Except for the usual good reasons to to program as 'functionally' as possible). Ie, there is no reason that I can see why the if-condition has to be a guard syntactically rather than an expression. I just forces the programmer to write something more clumsy. Or is there some light I haven't yet seen? -- Thomas -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED]On Behalf Of Matthias Lang Sent: den 17 maj 2005 13:20 To: Dietmar Schaefer Cc: erlang-questions@REDACTED Subject: Re: newbie question >From the FAQ: | 9.4. Why can't I call arbitrary functions in a guard? | | If that was allowed, there would be no guarantee that guards were side-effect free. | | Also, it is convenient to be able to program as though guards do not consume any significant amount of execution time. There's a list of BIFs which can be called from within guards in the Erlang book and the standard Erlang spec, some examples are size(), length(), integer(), record(). | | The "problem" often crops up when using if: | | issue_warning() -> | if (os:type() == {win32, windows}) -> %% illegal guard | ok = io:fwrite("this computer may crash at any time\n"); | true -> | ok = io:fwrite("no problem\n") | end. | | | The solution is usually to use case instead. Case is used much more frequently than if in most Erlang programs: | | issue_warning() -> | case os:type() of | {win32, windows} -> ok = io:fwrite("crash soon\n"); | _ -> ok = io:fwrite("no problem\n") | end. | Matthias Dietmar Schaefer writes: > Hi ! > > Isn't that supposed to work ? > > > if cmmc_db:getProcState(Key,Name) /= State -> > > instead I have to write > > ProcState = cmmc_db:getProcState(Key,Name), > > if ProcState /= State -> > > > > regards > > > Dietmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias@REDACTED Tue May 17 14:01:40 2005 From: matthias@REDACTED (Matthias Lang) Date: Tue, 17 May 2005 14:01:40 +0200 Subject: newbie question In-Reply-To: <44D1EB33A5E44D4BBAFD4FB9E8CCCB4719EB90@esealmw107.eemea.ericsson.se> References: <44D1EB33A5E44D4BBAFD4FB9E8CCCB4719EB90@esealmw107.eemea.ericsson.se> Message-ID: <17033.56612.842570.555989@antilipe.corelatus.se> Thomas Johnsson XA \(LN/EAB\) writes: > There are situations where it is important that guards are fast > and side effect-free (in receive, for example). > Conditions in if-expressions is *not* one of those places, IMHO. > (Except for the usual good reasons to to program as 'functionally' > as possible). Ie, there is no reason that I can see why the > if-condition has to be a guard syntactically rather than an expression. > I just forces the programmer to write something more clumsy. > Or is there some light I haven't yet seen? It's nice and simple to say "No side effects in guards" whereas it's rather painful to say "No side effects in guards, unless it wouldn't be messy to have them, for instance if there aren't very many clauses in the guard, especially if it's part of an if statement, but possibly also in a case and maybe even in a receive with for instance only four clauses but definitely not in an 'if' with three clauses if they're complicated and hard to read, because that would be clumsy." and even more painful to explain to the compiler and optimiser. Matthias From simon@REDACTED Tue May 17 14:15:32 2005 From: simon@REDACTED (Simon Aurell) Date: Tue, 17 May 2005 13:15:32 +0100 Subject: jabberlang Message-ID: <00b601c55ada$1f7ca540$7339fea9@ituniv237> Micka?l R?mond was kind enough to send me the current version of the jabberlang library. I'm using it for my thesis project for remote controlling home automation devices using instant messaging (as I've mentioned previously on this list). Connecting and sending/receiving messages works fine, as does subscriptions. Status does not seem to be working yet, I might try to fix that. Right now there is also a dependency to ejabberd which I will probably remove for my project. Micka?l mentioned he had a lot of ideas for improvements. It's a good library and I really hope Micka?l finds the time to finish it. I believe a lot of people are eagerly awaiting it... including myself :) Simon -- http://www.erlang-consulting.com > ----- Original Message ----- > From: "Miguel Gomard" > To: "Erlang Questions" > Sent: Monday, May 16, 2005 8:55 AM > Subject: jabberlang > > > > hi all, > > > > > > Anyone has status about jabber library implemented in erlang ? > > is there release ? where i can donwload it ? > > > > Thanks > > > > > > > > > From matthias@REDACTED Tue May 17 14:19:33 2005 From: matthias@REDACTED (Matthias Lang) Date: Tue, 17 May 2005 14:19:33 +0200 Subject: [announce] Erlang ported to linksys nslu2 In-Reply-To: <17033.42528.23914.310205@alkaid.it.uu.se> References: <17033.42528.23914.310205@alkaid.it.uu.se> Message-ID: <17033.57685.866023.288217@antilipe.corelatus.se> Mikael Pettersson writes: > Brian Zhou writes: > > The next step is try to get it cross build as the complete native > > compilation took about 10 hours. > Erlang/OTP isn't set up for cross-compilation. > You may be in for a world of pain... As someone who _does_ cross-compile Erlang (on an x86 host running linux, for an embedded PPC target also running linux), using a fairly ugly bag of tricks, I tend to agree with Mikael---if you can native compile it, be happy and stop there. Matt From ok@REDACTED Wed May 18 04:50:42 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 18 May 2005 14:50:42 +1200 (NZST) Subject: [announce] Erlang ported to linksys nslu2 Message-ID: <200505180250.j4I2ogWn144616@atlas.otago.ac.nz> Mikael Pettersson wrote: > Does anyone know what it takes to port HiPE to ARM? Easy, provide us with the HW :-) Seriously, any 32-bit CPU sensible enough to be able to run Linux and the gcc toolchain, and which is already running Erlang's BEAM interpreter, should be "supportable". I haven't studied the ARM ISA so I can't comment on whether generating native code would be easy or hard. ARM chips support the "ARM" instruction set. They may also support the "Thumb" instruction set, and/or the JVM. ARM is basically a 32-bit RISC with 16 registers, of which R15 is the PC, R14 is the return address, and R13 is SP. Arithmetic and logical instructions are 3-operand and may include a condition (instruction executed if condition true, so no Bcc needed) and one source operand may include a shift. Loads, stores, and branches are also conditional. There's a condition code register with N, Z, C, V flags. Depending on the model, there may be a Vector Floating Point coprocessor providing IEEE arithmetic (on single numbers or short vectors). The one thing it seems to be missing is an integer divide instruction (the assembler manual has unsigned division as an example of a macro). ARM instructions are 32 bits wide; Thumb instructions are mostly 16 bits wide, and only let you access registers R0..R7 directly. (Thumb2 is more powerful.) The point of Thumb is to save code space without sacrificing performance. I should think that ARM would be a pretty nice target for native compilation of Erlang. From rvg@REDACTED Wed May 18 06:54:29 2005 From: rvg@REDACTED (Rudolph van Graan) Date: Wed, 18 May 2005 06:54:29 +0200 Subject: Priority Queues In-Reply-To: References: Message-ID: <77B94C87-69D9-4F9C-84BF-644383C2AFAF@patternmatched.com> Hi Ulf, Thank you for the information below. I have tested code similar to yours below and for the moment I'm happy. Regards, Rudolph On 16 May 2005, at 2:29 PM, Ulf Wiger ((AL/EAB)) wrote: > > You can do this (almost) using an ordered_set disc_copy > table in mnesia. The object key could be e.g. > {Priority, erlang:now()} for prioritized FIFO, or > {Priority, negative(erlang:now())} for prioritized LIFO, > where > > negative({MSec, Sec, MuSec}) -> > {-MSec, -Sec, -MySec}. > > > 1) Using dirty_first(Tab) and dirty_last(Tab), you can > get to the first and last entries respectively. > > 2) The structure of the key determines the ordering. > See above. > > 3) Not a big problem, but the entries will all be in > RAM (and logged to disk periodically) > > 4) Not constant time, but close enough (logN) > > 5) Persistence is taken care of by mnesia > > 6) To make this thread-safe, you need to either > serialize the operation using a server, or use > mnesia transactions. The transaction can for example > return the next value for processing like so: > > mnesia:activity( > dirty, > fun() -> > case mnesia:dirty_first(prio_queue) of > '$end_of_table' -> queue_empty; > Key -> > [Result] = mnesia:read(prio_queue, Key, write), > mnesia:delete(prio_queue, Key) > Result > end > end). > > It's a little trickier if you want full atomicity, since there > is no mnesia:first/1. You can still do it like described above, > since you get synchronization on the read, and thus avoid the > risk of race conditions or lost updates. However, you can get > aborted transactions instead of proper serialization. > > It's possible to use mnesia:select(Tab, Pattern, 1, write), > which will, on an ordered_set, return the first object in the > table matching Pattern, but it will be slightly more expensive > (esp. if this operation is called as a nested transaction, since > the select() call has to scan the transaction store.) > > Of course, the overhead of using transactions will be significant, > but mnesia:activity(dirty, ...) is not so bad. It's a very handy > way of packaging dirty operations. > > /Uffe > > >> -----Original Message----- >> From: owner-erlang-questions@REDACTED >> [mailto:owner-erlang-questions@REDACTED]On Behalf Of >> Rudolph van Graan >> Sent: den 16 maj 2005 08:24 >> To: Erlang Questions >> Subject: Priority Queues >> >> >> Hi All, >> >> I am currently thinking about the implementation of priority queues >> in erlang. Specifically, what do you guys suggest as an >> efficient way >> to achieve the following: >> >> 1. A queue with a definitive head and tail (i.e. first and >> last records) >> 2. The items in the queue need to be sorted according to some >> criteria that will always allow you to identify an entry as the >> "first" or "next" one >> 3. The queue length can be massive (100's of thousands or >> millions of >> records) >> 4. Insertion time should be constant >> 5. The queue must be persistent (i.e. mnesia or dets) >> 6. Once the first/head entry has been processed, it will no >> longer be >> in the queue. >> >> Any suggestions? >> >> Rudolph van Graan >> >> >> > > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2373 bytes Desc: not available URL: From dietmar@REDACTED Wed May 18 07:44:37 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Wed, 18 May 2005 07:44:37 +0200 Subject: insert a record Message-ID: <428AD645.8060905@ast.dfs.de> Hi ! Is there a way of inserting a record into a database without specifying the index ? What I have is : mnesia:create_table(centerDisplayProcessesList, [{snmp, [{key, integer}]}, {attributes, record_info(fields, centerDisplayProcessesList)}, {disc_copies, Nodes}]) of So I have a integer (snmp) index. Now I would be able to just insert a new record for which I do not care about the index. Index must be in the range (1..40) but should be supplied automatically ! regards Dietmar From bengt.kleberg@REDACTED Wed May 18 07:58:32 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 18 May 2005 07:58:32 +0200 Subject: insert a record In-Reply-To: <428AD645.8060905@ast.dfs.de> References: <428AD645.8060905@ast.dfs.de> Message-ID: <428AD988.5020203@ericsson.com> Dietmar Schaefer wrote: > Hi ! > > Is there a way of inserting a record into a database without specifying > the index ? ...deleted > Index must be in the range (1..40) but should be supplied automatically ! i do not know of such a thing. my knowledge is very limited and there might be one. however, i would suggest that you do this manually. have an insert function that takes the members of #centerDisplayProcessesList{}, and another insert function that takes all members minus the index. the latter function could find out the correct index (if there is one) or just randomise one. and then call the first insert function. bengt From matthias@REDACTED Wed May 18 08:01:36 2005 From: matthias@REDACTED (Matthias Lang) Date: Wed, 18 May 2005 08:01:36 +0200 Subject: [announce] Erlang ported to linksys nslu2 In-Reply-To: References: <17033.42528.23914.310205@alkaid.it.uu.se> <17033.57685.866023.288217@antilipe.corelatus.se> Message-ID: <17034.55872.803249.606120@antilipe.corelatus.se> Nigel Head writes: > Any chance (whenever you have some spare time :->) of posting some > pointers as to how you do this ?? >From the FAQ: | 8.8. Can Erlang be cross compiled? | | Not out of the box. While the VxWorks version of Erlang is cross | compiled, the build system for this is a one-off. The whole build | system wasn't written with cross compilation in mind. There have been | murmurs from volunteers to fix this, but no result (yet). | | Patrik Nyblom posted a step-by-step VxWorks cross-compiling guide to | the mailing list. | | There's a step-by-step example of what was needed to cross-compile | Erlang R7B for Linux on a PPC860 based embedded system. The links in the text are http://www.erlang.org/faq/t1.html (the FAQ itself) http://www.erlang.org/ml-archive/erlang-questions/200003/msg00013.html http://www.corelatus.com/~matthias/erlang_on_860.html The example is for R7B. With a few modifications, the same tricks work for R9C. I haven't gotten to R10 yet. Matthias From techieyang@REDACTED Wed May 18 08:37:51 2005 From: techieyang@REDACTED (techie) Date: Wed, 18 May 2005 14:37:51 +0800 Subject: =?gb2312?B?tPC4tDogW2Fubm91bmNlXSBFcmxhbmcgcG9ydGVkIHRvIGxpbmtzeQ==?= =?gb2312?B?cyBuc2x1Mg==?= In-Reply-To: <17034.55872.803249.606120@antilipe.corelatus.se> Message-ID: <200505180638.j4I6clg60128@hades.cslab.ericsson.net> Sure, almost the same trick works for the R10B. Best Regards Chuang -----????----- ???: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] ?? Matthias Lang ????: 2005?5?18? 14:02 ???: Nigel Head ??: Erlang Questions ??: Re: [announce] Erlang ported to linksys nslu2 Nigel Head writes: > Any chance (whenever you have some spare time :->) of posting some > pointers as to how you do this ?? >From the FAQ: | 8.8. Can Erlang be cross compiled? | | Not out of the box. While the VxWorks version of Erlang is cross | compiled, the build system for this is a one-off. The whole build | system wasn't written with cross compilation in mind. There have been | murmurs from volunteers to fix this, but no result (yet). | | Patrik Nyblom posted a step-by-step VxWorks cross-compiling guide to | the mailing list. | | There's a step-by-step example of what was needed to cross-compile | Erlang R7B for Linux on a PPC860 based embedded system. The links in the text are http://www.erlang.org/faq/t1.html (the FAQ itself) http://www.erlang.org/ml-archive/erlang-questions/200003/msg00013.html http://www.corelatus.com/~matthias/erlang_on_860.html The example is for R7B. With a few modifications, the same tricks work for R9C. I haven't gotten to R10 yet. Matthias From tpatro@REDACTED Wed May 18 09:16:35 2005 From: tpatro@REDACTED (Tamas Patrovics) Date: Wed, 18 May 2005 09:16:35 +0200 Subject: ESense - Erlang "IntelliSense" for Emacs Message-ID: Hi, It seems I'll spend some time with Erlang in the future, so I made an Emacs extension to make my life easier when working with Erlang. ESense (ErlangSense) is a minor mode which provides features similar to IntelliSense or CodeSense in other editors. It can be enabled in an Erlang buffer or in the Erlang Shell buffer. What it can do: - complete module names, exported functions from modules (module:function), record names, record fields, macros - show popup documentation for the above elements - go to the definition or documentation - jump to a header file from an -include line I made this to scratch my own itch, but if there is an interest I'll post some code too. Here are some screenshots: http://img271.echo.cx/img271/1921/shot13lr.jpg http://img271.echo.cx/img271/6364/shot24dq.jpg http://img271.echo.cx/img271/220/shot30cd.jpg http://img271.echo.cx/img271/193/shot42oi.jpg http://img271.echo.cx/img271/7518/shot51kz.jpg /Tamas From vlad.xx.dumitrescu@REDACTED Wed May 18 09:18:44 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Wed, 18 May 2005 09:18:44 +0200 Subject: ESense - Erlang "IntelliSense" for Emacs Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE540@esealmw105.eemea.ericsson.se> Cool, but does it work with normal emacs too? (i.e. not XEmacs) /Vlad -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED]On Behalf Of Tamas Patrovics Sent: Wednesday, May 18, 2005 9:17 AM To: erlang-questions@REDACTED Subject: ESense - Erlang "IntelliSense" for Emacs Hi, It seems I'll spend some time with Erlang in the future, so I made an Emacs extension to make my life easier when working with Erlang. ESense (ErlangSense) is a minor mode which provides features similar to IntelliSense or CodeSense in other editors. It can be enabled in an Erlang buffer or in the Erlang Shell buffer. What it can do: - complete module names, exported functions from modules (module:function), record names, record fields, macros - show popup documentation for the above elements - go to the definition or documentation - jump to a header file from an -include line I made this to scratch my own itch, but if there is an interest I'll post some code too. Here are some screenshots: http://img271.echo.cx/img271/1921/shot13lr.jpg http://img271.echo.cx/img271/6364/shot24dq.jpg http://img271.echo.cx/img271/220/shot30cd.jpg http://img271.echo.cx/img271/193/shot42oi.jpg http://img271.echo.cx/img271/7518/shot51kz.jpg /Tamas From tpatro@REDACTED Wed May 18 09:28:36 2005 From: tpatro@REDACTED (Tamas Patrovics) Date: Wed, 18 May 2005 09:28:36 +0200 Subject: ESense - Erlang "IntelliSense" for Emacs In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE540@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE540@esealmw105.eemea.ericsson.se> Message-ID: On 5/18/05, Vlad Dumitrescu XX (LN/EAB) wrote: > Cool, but does it work with normal emacs too? (i.e. not XEmacs) It was developed and tested only on GNU Emacs 21.3.1. I've never used XEmacs, but I think with some tweaking it could work on XEmacs too. /Tamas From leigh.fiddes@REDACTED Wed May 18 09:42:53 2005 From: leigh.fiddes@REDACTED (Leigh Fiddes) Date: Wed, 18 May 2005 17:42:53 +1000 Subject: Megaco text encoding problem with embedded Signal Message-ID: <428AF1FD.5050106@nec.com.au> Hi, I am experimenting with the Erlang Megaco stack (3.0.1) and I am having a problem encoding an embedded Signal within an Event. The erlang code I am using is: SRE1 = #'SecondRequestedEvent'{ pkgdName = "al/on", evParList = [] }, SED = #'SecondEventsDescriptor'{ requestID = 2, eventList = [ SRE1 ] }, SIG = { signal, #'Signal'{ signalName = "cg/dt", sigParList = [] } }, RA = #'RequestedActions'{ secondEvent = SED, signalsDescriptor = [ SIG ] }, RE = #'RequestedEvent'{ pkgdName = "al/of", eventAction = RA, evParList = [] }, EV = #'EventsDescriptor'{ requestID = 1, eventList = [ RE ] }, TermID = {megaco_term_id, true, [[$*]] }, AMMR = #'AmmRequest'{ terminationID = [ TermID ], descriptors = [ { eventsDescriptor, EV } ] }, CR = #'CommandRequest'{command = {modReq, AMMR}}, AR = #'ActionRequest'{contextId = ?megaco_null_context_id, commandRequests = [CR]}, but the megaco message produced is: Context = - { Modify = * { Events = 1 { al/of { Embed { Events = 2 { al/on } }, Signals { cg/dt } } } } } whereas my reading of H.248.1 say that the correct syntax for this should be: Context = - { Modify = * { Events = 1 { al/of { Embed { Signals { cg/dt }, Events = 2 { al/on } } } } } } Is my interpretation or method incorrect or is the pretty text encoder incorrect? Regards, Leigh -- ============================================================ Leigh Fiddes email: Leigh.Fiddes@REDACTED Software Development Manager Phone: +61 3 9264 3864 Broadband Network Technology Division Fax: +61 3 9264 3892 NEC Australia From dietmar@REDACTED Wed May 18 10:40:05 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Wed, 18 May 2005 10:40:05 +0200 Subject: tv question Message-ID: <428AFF65.4080802@ast.dfs.de> Hi ! I read the users guide on tv but could not find if there is a way to: - adjust a poll interval shorter than 20 seconds. - to pass arguments to tv:start() for example to switch to mnesia tables, to order elements etc. regards Dietmar From thomas.xa.johnsson@REDACTED Wed May 18 10:47:15 2005 From: thomas.xa.johnsson@REDACTED (Thomas Johnsson XA (LN/EAB)) Date: Wed, 18 May 2005 10:47:15 +0200 Subject: pretty printing depth in the erlang shell Message-ID: <44D1EB33A5E44D4BBAFD4FB9E8CCCB4719EB94@esealmw107.eemea.ericsson.se> Is there a way to increase the pretty printing depth in the erlang shell? It is rather tedious to have to write eg io:format("~p",[ ..whatever...]). to see it all.... -- Thomas From mickael.remond@REDACTED Wed May 18 10:59:34 2005 From: mickael.remond@REDACTED (Mickael Remond) Date: Wed, 18 May 2005 10:59:34 +0200 Subject: ESense - Erlang "IntelliSense" for Emacs In-Reply-To: References: Message-ID: <428B03F6.1070305@erlang-fr.org> Tamas Patrovics wrote: > Hi, > > It seems I'll spend some time with Erlang in the future, so I made an > Emacs extension to make my life easier when working with Erlang. > > ESense (ErlangSense) is a minor mode which provides features similar > to IntelliSense or CodeSense in other editors. It can be enabled in an > Erlang buffer or in the Erlang Shell buffer. > > I made this to scratch my own itch, but if there is an interest I'll > post some code too. Yes, sure there is an interest :-) If you could post the code, it would be nice. The popup feature looks very cool :-) -- Micka?l R?mond http://www.erlang-projects.org/ From tpatro@REDACTED Wed May 18 11:01:28 2005 From: tpatro@REDACTED (Tamas Patrovics) Date: Wed, 18 May 2005 11:01:28 +0200 Subject: ESense - Erlang "IntelliSense" for Emacs In-Reply-To: <428B03F6.1070305@erlang-fr.org> References: <428B03F6.1070305@erlang-fr.org> Message-ID: On 5/18/05, Mickael Remond wrote: > If you could post the code, it would be nice. I've registered a new project on SourceForge. As soon as they approve the registration I'll post a link to the code. /Tamas From richardc@REDACTED Wed May 18 11:06:50 2005 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 18 May 2005 11:06:50 +0200 Subject: pretty printing depth in the erlang shell In-Reply-To: <44D1EB33A5E44D4BBAFD4FB9E8CCCB4719EB94@esealmw107.eemea.ericsson.se> References: <44D1EB33A5E44D4BBAFD4FB9E8CCCB4719EB94@esealmw107.eemea.ericsson.se> Message-ID: <428B05AA.6040809@csd.uu.se> Thomas Johnsson XA (LN/EAB) wrote: > Is there a way to increase the pretty printing depth in the erlang shell? > It is rather tedious to have to write eg > io:format("~p",[ ..whatever...]). > to see it all.... Write a utility function and put in your user_default.erl. E.g.: -module(user_default). -compile(export_all). ... fmt(Term, Depth) -> io:format("~P\n", [Term, Depth]). fmp(Term) -> fmt(Term, 20). ... (code not tested; adjust default depth to your preference). Then you can use it in the shell; e.g.: 1> fmt(BigTerm). /Richard From flaig@REDACTED Wed May 18 11:57:27 2005 From: flaig@REDACTED (flaig@REDACTED) Date: Wed, 18 May 2005 11:57:27 +0200 Subject: [announce] Erlang ported to linksys nslu2 Message-ID: <200505180957.j4I9vRjR027860@ger5.wwwserver.net> Am Mittwoch, den 18.05.2005, 14:50 +1200 schrieb Richard A. O'Keefe: Mikael Pettersson wrote: > > Does anyone know what it takes to port HiPE to ARM? > > Easy, provide us with the HW :-) Seriously, any 32-bit CPU > sensible enough to be able to run Linux and the gcc toolchain, > and which is already running Erlang's BEAM interpreter, should > be "supportable". I haven't studied the ARM ISA so I can't > comment on whether generating native code would be easy or hard. > > ARM chips support the "ARM" instruction set. > They may also support the "Thumb" instruction set, and/or the JVM. > ARM is basically a 32-bit RISC with 16 registers, > of which R15 is the PC, R14 is the return address, and R13 is SP. > Arithmetic and logical instructions are 3-operand and > may include a condition (instruction executed if condition true, > so no Bcc needed) and one source operand may include a shift. > Loads, stores, and branches are also conditional. > There's a condition code register with N, Z, C, V flags. > Depending on the model, there may be a Vector Floating Point coprocessor > providing IEEE arithmetic (on single numbers or short vectors). > The one thing it seems to be missing is an integer divide instruction > (the assembler manual has unsigned division as an example of a macro). > > ARM instructions are 32 bits wide; Thumb instructions are mostly 16 bits > wide, and only let you access registers R0..R7 directly. (Thumb2 is > more powerful.) The point of Thumb is to save code space without > sacrificing performance. > > I should think that ARM would be a pretty nice target for native compilation > of Erlang. > Definitely it is, considering ARM's dominance on the market for all kinds of embedded devices! I am not working in this field but I think this would be the way to drastically increase Erlang's acceptance. Please, *please* do it! (BTW: What are you using for embedded devices nowadays? Java, I guess, and Ada, if it's mission-critical 8-@ ?) -- Ruediger Marcus === Chevalier Dr. Dr. Don Ruediger Marcus FLAIG MSc ScD PhD KCHT KSR CSM KEL MLJ MOC Institute for Immunology University of Heidelberg Im Neuenheimer Feld 305 Occam's Razor: Never opt for a complex theory D-69120 Heidelberg if a simple one provides a sufficient explanation. Germany Gibbon's Addendum: Never opt for a complex theory if base motifs provide a sufficient explanation. -- Diese E-Mail wurde mit http://www.mail-inspector.de verschickt Mail Inspector ist ein kostenloser Service von http://www.is-fun.net Der Absender dieser E-Mail hatte die IP: 129.206.124.135 From ulf.wiger@REDACTED Wed May 18 14:19:26 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 18 May 2005 14:19:26 +0200 Subject: insert a record Message-ID: Hi! The index is transparent to insert operations. Mnesia maintains the indexes behind the scenes, and you never have to specify indexes except (a) when you create the table and (b) when you specifically want to use the index to locate data in your table. Put another way, there is no way you CAN specify the index during insert. You are not allowed to mess with the updating of indexes, since this can lead to inconsistencies(*). /Uffe (*) Well, there is one way: you can do an (d)ets:insert directly into the physical table, or use mnesia:activity(ets, fun() ...). If you do this on a table that has indexes specified, you are practically guaranteed to mess up your database! The same thing goes for replicated tables. > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of > Dietmar Schaefer > Sent: den 18 maj 2005 07:45 > To: Erlang Questions > Subject: insert a record > > > Hi ! > > Is there a way of inserting a record into a database without > specifying > the index ? > > What I have is : > > mnesia:create_table(centerDisplayProcessesList, [{snmp, > [{key, integer}]}, > {attributes, record_info(fields, > centerDisplayProcessesList)}, > {disc_copies, Nodes}]) of > > So I have a integer (snmp) index. > > Now I would be able to just insert a new record for which I > do not care > about the > index. > > Index must be in the range (1..40) but should be supplied > automatically ! > > > regards > > > Dietmar > > > From micael.karlberg@REDACTED Wed May 18 14:59:17 2005 From: micael.karlberg@REDACTED (Micael Karlberg) Date: Wed, 18 May 2005 14:59:17 +0200 Subject: Megaco text encoding problem with embedded Signal (fwd) Message-ID: <17035.15397.72642.663562@gargle.gargle.HOWL> Hi, Judging from the comment in the standard (below), it seems that you are correct. That is, since both embedWithSig and embedNoSig cannot be present and since there have a signal, then embedWithSig should be used! ; at-most-once each of KeepActiveToken , eventDM and eventStream ; at most one of either embedWithSig or embedNoSig but not both ; KeepActiveToken and embedWithSig must not both be present eventParameter = ( embedWithSig / embedNoSig / KeepActiveToken / eventDM / eventStream / eventOther ) Thanks, /BMK Leigh Fiddes writes: > Hi, > > I am experimenting with the Erlang Megaco stack (3.0.1) and I am having a > problem encoding an > embedded Signal within an Event. > > The erlang code I am using is: > > SRE1 = #'SecondRequestedEvent'{ pkgdName = "al/on", > evParList = [] }, > > SED = #'SecondEventsDescriptor'{ requestID = 2, > eventList = [ SRE1 ] }, > > SIG = { signal, #'Signal'{ signalName = "cg/dt", > sigParList = [] } }, > > RA = #'RequestedActions'{ secondEvent = SED, > signalsDescriptor = [ SIG ] }, > > RE = #'RequestedEvent'{ pkgdName = "al/of", > eventAction = RA, > evParList = [] }, > > EV = #'EventsDescriptor'{ requestID = 1, eventList = [ RE ] }, > > TermID = {megaco_term_id, true, [[$*]] }, > > AMMR = #'AmmRequest'{ terminationID = [ TermID ], > descriptors = [ { eventsDescriptor, EV } ] }, > > CR = #'CommandRequest'{command = {modReq, AMMR}}, > > AR = #'ActionRequest'{contextId = ?megaco_null_context_id, > commandRequests = [CR]}, > > but the megaco message produced is: > Context = - { > Modify = * { > Events = 1 { > al/of { > Embed { > Events = 2 { > al/on > } > }, > Signals { > cg/dt > } > } > } > } > } > whereas my reading of H.248.1 say that the correct syntax for this should be: > > Context = - { > Modify = * { > Events = 1 { > al/of { > Embed { > Signals { > cg/dt > }, > Events = 2 { > al/on > } > } > } > } > } > } > > Is my interpretation or method incorrect or is the pretty text encoder > incorrect? > > Regards, > Leigh > -- > ============================================================ > Leigh Fiddes email: Leigh.Fiddes@REDACTED > Software Development Manager Phone: +61 3 9264 3864 > Broadband Network Technology Division Fax: +61 3 9264 3892 > NEC Australia From b88zhou@REDACTED Wed May 18 18:20:17 2005 From: b88zhou@REDACTED (Brian Zhou) Date: Wed, 18 May 2005 09:20:17 -0700 Subject: [announce] Erlang ported to linksys nslu2 References: Message-ID: The erlang_R10B5-2_armeb.ipk package is now available in official unslung-native feed. ipkg install unslung-feed ipkg update ipkg install erlang To see what other packages are available on this $80 device, see http://ipkg.nslu2-linux.org/ipkg/Packages Cheers, -Brian Zhou From matthias@REDACTED Wed May 18 23:59:21 2005 From: matthias@REDACTED (Matthias Lang) Date: Wed, 18 May 2005 23:59:21 +0200 Subject: pretty printing depth in the erlang shell In-Reply-To: <44D1EB33A5E44D4BBAFD4FB9E8CCCB4719EB94@esealmw107.eemea.ericsson.se> References: <44D1EB33A5E44D4BBAFD4FB9E8CCCB4719EB94@esealmw107.eemea.ericsson.se> Message-ID: <17035.47801.895315.101906@antilipe.corelatus.se> Thomas Johnsson XA \(LN/EAB\) writes: > Is there a way to increase the pretty printing depth in the erlang shell? > It is rather tedious to have to write eg > io:format("~p",[ ..whatever...]). > to see it all.... The depth is controlled by a macro in 'shell.erl', LINEMAX. One way to change it is to edit the macro and recompile. You may need to use code:unstick_mod/1. Another way is to patch shell.erl with the appended patch. Then you can change the depth on the fly: 1> lists:seq(1,30). [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29|...] 2> application:set_env(stdlib, shell_depth, 5). ok 3> lists:seq(1,30). [1,2,3,4|...] Matt --- /usr/local/src/otp_src_R10B-4/lib/stdlib/src/shell.erl 2005-03-22 15:09:40.000000000 +0100 +++ shell.erl 2005-05-18 23:52:15.548943280 +0200 @@ -21,7 +21,7 @@ -export([whereis_evaluator/0, whereis_evaluator/1]). -export([start_restricted/1, stop_restricted/0]). --define(LINEMAX, 30). +-define(LINEMAX, get_env(shell_depth, 30)). -define(DEF_HISTORY, 20). -define(DEF_RESULTS, 20). From leigh.fiddes@REDACTED Thu May 19 02:59:14 2005 From: leigh.fiddes@REDACTED (Leigh Fiddes) Date: Thu, 19 May 2005 10:59:14 +1000 Subject: Megaco text encoding problem with embedded Events Message-ID: <428BE4E2.2020303@nec.com.au> Hi, I am experimenting with the Erlang Megaco stack (3.0.1) and I am having a problem encoding an embedded Events within an Event. The erlang code I am using is: SRE1 = #'SecondRequestedEvent'{ pkgdName = "al/on", evParList = [] }, SRA = #'SecondRequestedActions'{ eventDM = { digitMapName, "DialPlan0" }}, SRE2 = #'SecondRequestedEvent'{ pkgdName = "dd/ce", eventAction = SRA, evParList = [] }, SED = #'SecondEventsDescriptor'{ requestID = 2, eventList = [ SRE1, SRE2 ] }, RA = #'RequestedActions'{ secondEvent = SED }, RE = #'RequestedEvent'{ pkgdName = "al/of", eventAction = RA, evParList = [] }, EV = #'EventsDescriptor'{ requestID = 1, eventList = [ RE ] }, TermID = {megaco_term_id, true, [[$*]] }, AMMR = #'AmmRequest'{ terminationID = [ TermID ], descriptors = [{ eventsDescriptor, EV }]}, CR = #'CommandRequest'{command = {modReq, AMMR}}, AR = #'ActionRequest'{contextId = ?megaco_null_context_id, commandRequests = [CR]}, but the megaco message produced is: Context = - { Modify = * { Events = 1 { al/of { Embed { Events = 2 { al/on }, Events = 2 { dd/ce { DigitMap = DialPlan0 } } } } } } } whereas my reading of H.248.1 says that the correct syntax for this should be: Context = - { Modify = * { Events = 1 { al/of { Embed { Events = 2 { al/on, dd/ce { DigitMap = DialPlan0 } } } } } } } according to the standard: embedNoSig = EmbedToken LBRKT embedFirst RBRKT ; at-most-once of each embedFirst = EventsToken [ EQUAL RequestID LBRKT secondRequestedEvent *(COMMA secondRequestedEvent) RBRKT ] secondRequestedEvent = pkgdName [ LBRKT secondEventParameter *( COMMA secondEventParameter ) RBRKT ] Is my interpretation or method incorrect or is the pretty text encoder incorrect? Regards, Leigh -- ============================================================ Leigh Fiddes email: Leigh.Fiddes@REDACTED Software Development Manager Phone: +61 3 9264 3864 Broadband Network Technology Division Fax: +61 3 9264 3892 NEC Australia From tpatro@REDACTED Thu May 19 07:45:32 2005 From: tpatro@REDACTED (Tamas Patrovics) Date: Thu, 19 May 2005 07:45:32 +0200 Subject: ESense - Erlang "IntelliSense" for Emacs In-Reply-To: References: <428B03F6.1070305@erlang-fr.org> Message-ID: On 5/18/05, Tamas Patrovics wrote: > On 5/18/05, Mickael Remond wrote: > > If you could post the code, it would be nice. > > I've registered a new project on SourceForge. As soon as they approve > the registration I'll post a link to the code. The good folks on SourceForge kindly rejected my project submission, so until I feel like dealing with them again I uploaded the code to a free hosting provider: http://esense.uw.hu/ The indexer part was my first Erlang program longer than 20 lines, so please bear with me. I know there is a lot of room for improvement. /Tamas From vlad.xx.dumitrescu@REDACTED Thu May 19 08:15:10 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Thu, 19 May 2005 08:15:10 +0200 Subject: ESense - Erlang "IntelliSense" for Emacs Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE547@esealmw105.eemea.ericsson.se> Hi, A suggestion: wouldn't this make a nice addition to Distel? regards, Vlad From mats.cronqvist@REDACTED Thu May 19 10:27:56 2005 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Thu, 19 May 2005 10:27:56 +0200 Subject: ESense - Erlang "IntelliSense" for Emacs In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE547@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE547@esealmw105.eemea.ericsson.se> Message-ID: <428C4E0C.7070308@ericsson.com> Vlad Dumitrescu XX (LN/EAB) wrote: > Hi, > > A suggestion: wouldn't this make a nice addition to Distel? > > regards, > Vlad > i'm running both esense and distel. i don't really see the point in integrating them. it would be nice if tamas could stick esense in jungerl though. mats From vlad_dumitrescu@REDACTED Thu May 19 10:52:16 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Thu, 19 May 2005 10:52:16 +0200 Subject: ESense - Erlang "IntelliSense" for Emacs References: <11498CB7D3FCB54897058DE63BE3897C4BE547@esealmw105.eemea.ericsson.se> <428C4E0C.7070308@ericsson.com> Message-ID: > i'm running both esense and distel. i don't really see the point in > integrating them. Hi, I thought that since there is some overlapping functionality, it might be worth it. Now I have to remember if I should use Alt-. or Ctrl-F1 to go to the definition of a function... regards, Vlad From A.BETIS@REDACTED Thu May 19 11:06:31 2005 From: A.BETIS@REDACTED (BETIS Alexandre) Date: Thu, 19 May 2005 11:06:31 +0200 Subject: REAL type not supported by ASN1 compiler? Message-ID: Hi, Tried the following message definition, in file Test.asn1 --------------------- Test DEFINITIONS ::= BEGIN Msg ::= CHOICE { aReal [1] REAL } END --------------------- When we do a erlc Test.asn1: ----------------------------------------------------------------------- $ erlc Test.asn1 $ Erlang ASN.1 version "1.4.4.4" compiling "/home/betis/tmp/Test.asn1" $ Compiler Options: [ber, report_errors, {cwd,"/home/betis/tmp"}, {outdir,"/home/betis/tmp"}] $ asn1error:7:'Test':'Msg' {internal_error,{'cant check','REAL'}} ----------------------------------------------------------------------- If REAL is replaced with INTEGER, works fine. A quick check in the distrib source coude for asn1ct, module asn1ct_check.erl, function check_type() reveals a big case statement there, where all types are handled but not 'REAL'. Patch needed? ;) -- Alex " Ce message et ses pi?ces jointes sont confidentiels et exclusivement r?serv?s ? leurs destinataires qui s'assureront de l'absence de virus. CSEE Transport n'assume aucune responsabilit? au titre de ce message s'il est alt?r?, d?form?, falsifi?, ind?ment utilis? par des tiers ou encore s'il a caus? des dommages ou pertes de toute nature. This e-mail and any attached files are confidential and exclusively intended for its addressees who will conduct appropriate virus checks. CSEE Transport shall not be liable for the message if altered, changed, falsified, unduly used by third parties nor for any damage or loss." From micael.karlberg@REDACTED Fri May 20 09:02:47 2005 From: micael.karlberg@REDACTED (Micael Karlberg) Date: Fri, 20 May 2005 09:02:47 +0200 Subject: snmpm: documentation bug Message-ID: <17037.35735.566457.820818@gargle.gargle.HOWL> Hi, Anders Nygren writes: > Hi > I just noticed some errors in the snmp manager documentation, in R10B-4. > > snmpm: gb/5,6,7,8 (get bulk) is not documented. > (Another thing, is there any special reason that there are no async > get bulk functions?) > It is not documented because it is not properly implemented (a call only returnes {error, {not_supported, sync_get_bulk}}). > snmpm_user: handle_error/3 is not documented. Strange. According to our clearcase db it was added snmp-4.0.4, which was included in R10B-1. This is cut from the documentation: handle_error(ReqId, Reason, UserData) -> Reply Types: ReqId = integer() Reason = term() UserData = term() Reply = ignore This function is called when the manager failes to sent a asynchroneous message. I.e. encoding error. > > /Anders /BMK From maruthavanan_s@REDACTED Fri May 20 11:02:10 2005 From: maruthavanan_s@REDACTED (maruthavanan s) Date: Fri, 20 May 2005 09:02:10 +0000 Subject: memory leakage problem in erl_format Message-ID: hi! I am using erl_interface in windows enviroment with otp R10B-2. i am using the following function to send messages from c exe to erlang node. void send_5to_enode(int e1,int e2,int e3,int e4, int e5) { ETERM *t1; int Result; HANDLE mutex=NULL; DWORD result=0; mutex=CreateMutex(NULL,FALSE,"erlang3"); result=WaitForSingleObject(mutex,INFINITE); t1=erl_format("{~i,~i,~i,~i,~i}",e1,e2,e3,e4,e5); Result=erl_reg_send(sockfd, "enodereceiver", t1); erl_free_compound(t1); erl_eterm_release(); ReleaseMutex(mutex); CloseHandle(mutex); } If the load is heavy then this function is rapidly called and at certain times we get a error saying unhandled exception. Later we debug and found that when erl_format is called that internally calls some memory alloc function and we get error in this point, we used function erl_eterm_statistics() to find the allocated and freed memory blocks and some times it shows that allocated block as -1. Anything to be changed on the above code? Please help. regards, Maruthavanan.S _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfee? Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From maruthavanan_s@REDACTED Fri May 20 11:29:19 2005 From: maruthavanan_s@REDACTED (maruthavanan s) Date: Fri, 20 May 2005 09:29:19 +0000 Subject: memory leakage problem in erl_format Message-ID: hi! I am using erl_interface in windows enviroment with otp R10B-2. i am using the following function to send messages from c exe to erlang node. void send_5to_enode(int e1,int e2,int e3,int e4, int e5) { ETERM *t1; int Result; HANDLE mutex=NULL; DWORD result=0; mutex=CreateMutex(NULL,FALSE,"erlang3"); result=WaitForSingleObject(mutex,INFINITE); t1=erl_format("{~i,~i,~i,~i,~i}",e1,e2,e3,e4,e5); Result=erl_reg_send(sockfd, "enodereceiver", t1); erl_free_compound(t1); erl_eterm_release(); ReleaseMutex(mutex); CloseHandle(mutex); } If the load is heavy then this function is rapidly called and at certain times we get a error saying unhandled exception. Later we debug and found that when erl_format is called that internally calls some memory alloc function and we get error in this point, also some times we get error exception in erl_reg_send(). we used function erl_eterm_statistics() to find the allocated and freed memory blocks and some times it shows that allocated block as -1. Anything to be changed on the above code? Please help. regards, Maruthavanan.S _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From raimo@REDACTED Fri May 20 11:32:58 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 20 May 2005 11:32:58 +0200 Subject: Web Server Upgrading Message-ID: We are upgrading our web servers, if all goes well you should not notice anything. But just in case you might need to know that during the upgrade there will be servers `www', `www1' and `www2' for the current, old and new web server. Analoguously for `ftp'. Both for the `erlang.org' and `erlang.se' domains. The mailing lists will for now run on the old server and the mailing archives will be rsynced to the new web server, so there will be an update delay of max 1 hour for the mailing list archive. If we would happen to completely configure ourselves off the Internet so the mailing lists die - hollor to Trapexit -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From serge@REDACTED Fri May 20 15:20:23 2005 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 20 May 2005 09:20:23 -0400 Subject: memory leakage problem in erl_format In-Reply-To: References: Message-ID: <428DE417.2080501@hq.idt.net> I am not quite clear on your use of CreateMutex() and CloseHandle(). If the intent is to protect the call to erl_* functions to make send_5to_enode() thread-safe, I would suggest you to create/destroy the mutex outside of this function, and pass it as a parameter (or use a global variable), such as: HANDLE mutex=NULL; int initialize() { mutex=CreateMutex(NULL,FALSE,"erlang3"); return (mutex != NULL); } void finalize() { if (mutex != NULL) { CloseHandle(mutex); mutex = NULL; } } Here's the snippet from MSDN about the name collisions in the mutex names (lpName): "If lpName matches the name of an existing event, semaphore, waitable timer, job, or file-mapping object, the function fails and the GetLastError function returns ERROR_INVALID_HANDLE. This occurs because these objects share the same name space." http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createmutex.asp This might be contributing to the problem you are seeing. Serge maruthavanan s wrote: > hi! > > I am using erl_interface in windows enviroment with otp R10B-2. i am > using the following function to send messages from c exe to erlang node. > > void send_5to_enode(int e1,int e2,int e3,int e4, int e5) > { > ETERM *t1; > int Result; > HANDLE mutex=NULL; > DWORD result=0; > mutex=CreateMutex(NULL,FALSE,"erlang3"); > result=WaitForSingleObject(mutex,INFINITE); > t1=erl_format("{~i,~i,~i,~i,~i}",e1,e2,e3,e4,e5); > Result=erl_reg_send(sockfd, "enodereceiver", t1); > erl_free_compound(t1); > erl_eterm_release(); > ReleaseMutex(mutex); > CloseHandle(mutex); > } > > If the load is heavy then this function is rapidly called and at certain > times we get a error saying unhandled exception. Later we debug and > found that when erl_format is called that internally calls some memory > alloc function and we get error in this point, also some times we get > error exception in erl_reg_send(). we used function > erl_eterm_statistics() to find the allocated and freed memory blocks and > some times it shows that allocated block as -1. > > Anything to be changed on the above code? > Please help. > > regards, > Maruthavanan.S From maruthavanan_s@REDACTED Fri May 20 14:25:21 2005 From: maruthavanan_s@REDACTED (maruthavanan s) Date: Fri, 20 May 2005 12:25:21 +0000 Subject: memory leakage problem in erl_format in windows enviroment Message-ID: hi! I am using erl_interface in windows enviroment with otp R10B-2. i am using the following function to send messages from c exe to erlang node. void send_5to_enode(int e1,int e2,int e3,int e4, int e5) { ETERM *t1; int Result; HANDLE mutex=NULL; DWORD result=0; mutex=CreateMutex(NULL,FALSE,"erlang3"); result=WaitForSingleObject(mutex,INFINITE); t1=erl_format("{~i,~i,~i,~i,~i}",e1,e2,e3,e4,e5); Result=erl_reg_send(sockfd, "enodereceiver", t1); erl_free_compound(t1); erl_eterm_release(); ReleaseMutex(mutex); CloseHandle(mutex); } If the load is heavy then this function is rapidly called and at certain times we get a error saying unhandled exception. Later we debug and found that when erl_format is called that internally calls some memory alloc function and we get error in this point, also some times we get error exception in erl_reg_send(). we used function erl_eterm_statistics() to find the allocated and freed memory blocks and some times it shows that allocated block as -1. the attached image contains the call stack and watch values... during the debug.. Anything to be changed on the above code? Please help. regards, Maruthavanan.S _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfee? Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -------------- next part -------------- A non-text attachment was scrubbed... Name: error.GIF Type: image/gif Size: 46190 bytes Desc: not available URL: From nm@REDACTED Fri May 20 17:23:22 2005 From: nm@REDACTED (Gaspar Chilingarov) Date: Fri, 20 May 2005 20:23:22 +0500 Subject: addressing a lot of processes Message-ID: <428E00EA.2070106@web.am> Hello, all! Can you give an advice, which is more efficient in erlang in following situation: I have s progmar, which should process information about a lot of IP's (8000-16000). I've implemented logic associated with each IP in separate process - so, for each IP I've to process I spawn separate process. For now, I've implemented sample manager, which maps IP(string) to PID using gb_trees. In another hand, I've seen sample in some erlang sources, to register process under unique name say ip_127.0.0.1, ip_127.0.0.2 etc. This leads to generating the new atoms in runtime, and I'm conscious that erlang's GC will not clean them if they are unused. Am I right? -- Gaspar Chilingarov System Administrator t +37491 419763 w www.web.am e nm@REDACTED From chandrashekhar.mullaparthi@REDACTED Fri May 20 18:50:29 2005 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Fri, 20 May 2005 17:50:29 +0100 Subject: addressing a lot of processes In-Reply-To: <428E00EA.2070106@web.am> References: <428E00EA.2070106@web.am> Message-ID: That is right. atoms are not garbage collected. For the number of processes you are talking about, you really don't need to worry about performance. The lookup table from IP->PID should perform well enough. The basic rule of programming in erlang is not to worry about performance first, but to implement a solution to your problem in the most intuitive way. Then you test it and only then think about rewriting if your performance requirements are not met. cheers Chandru On 20 May 2005, at 16:23, Gaspar Chilingarov wrote: > Hello, all! > > Can you give an advice, which is more efficient in erlang in following > situation: > > I have s progmar, which should process information about a lot of IP's > (8000-16000). > > I've implemented logic associated with each IP in separate process - > so, > for each IP I've to process I spawn separate process. > For now, I've implemented sample manager, which maps IP(string) to PID > using gb_trees. In another hand, I've seen sample in some erlang > sources, to register process under unique name say ip_127.0.0.1, > ip_127.0.0.2 etc. > > This leads to generating the new atoms in runtime, and I'm conscious > that erlang's GC will not clean them if they are unused. Am I right? > > > -- > Gaspar Chilingarov > System Administrator > > t +37491 419763 > w www.web.am > e nm@REDACTED > From matthias@REDACTED Fri May 20 19:44:28 2005 From: matthias@REDACTED (Matthias Lang) Date: Fri, 20 May 2005 19:44:28 +0200 Subject: addressing a lot of processes In-Reply-To: References: <428E00EA.2070106@web.am> Message-ID: <17038.8700.60204.145175@beladrome.corelatus.se> > On 20 May 2005, at 16:23, Gaspar Chilingarov wrote: > > For now, I've implemented sample manager, which maps IP(string) to PID > > using gb_trees. In another hand, I've seen sample in some erlang > > sources, to register process under unique name say ip_127.0.0.1, > > ip_127.0.0.2 etc. > > > > This leads to generating the new atoms in runtime, and I'm conscious > > that erlang's GC will not clean them if they are unused. Am I right? IP(string) and IP(atom) aren't the only representations. In this case, IP(tuple) would also make sense, and the conversion is easy: {ok, Tuple} = inet:getaddr(String, inet) IP(integer) is another possibility, i.e. {ok, {A,B,C,D}} = inet:getaddr(String, inet), Integer = (A bsl 24) + (B bsl 16) + (C bsl 8) + D. Then you don't have to worry about the atom table _and_ you have a useful representation. Matthias From nm@REDACTED Sat May 21 14:02:38 2005 From: nm@REDACTED (Gaspar Chilingarov) Date: Sat, 21 May 2005 17:02:38 +0500 Subject: addressing a lot of processes In-Reply-To: <17038.8700.60204.145175@beladrome.corelatus.se> References: <428E00EA.2070106@web.am> <17038.8700.60204.145175@beladrome.corelatus.se> Message-ID: <428F235E.9000903@web.am> Matthias Lang wrote: > > On 20 May 2005, at 16:23, Gaspar Chilingarov wrote: > > > > For now, I've implemented sample manager, which maps IP(string) to PID > > > using gb_trees. In another hand, I've seen sample in some erlang > > > sources, to register process under unique name say ip_127.0.0.1, > > > ip_127.0.0.2 etc. > > > > > > This leads to generating the new atoms in runtime, and I'm conscious > > > that erlang's GC will not clean them if they are unused. Am I right? > > IP(string) and IP(atom) aren't the only representations. In this case, > IP(tuple) would also make sense, and the conversion is easy: > > {ok, Tuple} = inet:getaddr(String, inet) > > IP(integer) is another possibility, i.e. > > {ok, {A,B,C,D}} = inet:getaddr(String, inet), > Integer = (A bsl 24) + (B bsl 16) + (C bsl 8) + D. > > Then you don't have to worry about the atom table _and_ you have a > useful representation. > > Matthias > in case if I use atoms I can write smthing like this try ip_127_0_0_1 ! { processNewData, SomeData } catch Any -> createAndRegisterNewProcess(127_0_0_1) ip_127_0_0_1 ! { processNewData, SomeData } end This will perform lookup not in Erlang data structure - gb_tree in my case, but in erlangs internal table, which should be faster. In case that ~ have limited set of ip's which should be processed, I think I can avoid trashing of atoms table. -- Gaspar Chilingarov System Administrator t +37491 419763 w www.web.am e nm@REDACTED From sean.hinde@REDACTED Sun May 22 00:35:22 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Sat, 21 May 2005 23:35:22 +0100 Subject: addressing a lot of processes In-Reply-To: <428F235E.9000903@web.am> References: <428E00EA.2070106@web.am> <17038.8700.60204.145175@beladrome.corelatus.se> <428F235E.9000903@web.am> Message-ID: <3A51370B-D189-4F50-BEE1-2917727EDFE4@mac.com> On 21 May 2005, at 13:02, Gaspar Chilingarov wrote: > Matthias Lang wrote: > >> > On 20 May 2005, at 16:23, Gaspar Chilingarov wrote: >> > > For now, I've implemented sample manager, which maps IP >> (string) to PID >> > > using gb_trees. In another hand, I've seen sample in some erlang >> > > sources, to register process under unique name say ip_127.0.0.1, >> > > ip_127.0.0.2 etc. >> > > >> > > This leads to generating the new atoms in runtime, and I'm >> conscious > > that erlang's GC will not clean them if they are >> unused. Am I right? >> IP(string) and IP(atom) aren't the only representations. In this >> case, >> IP(tuple) would also make sense, and the conversion is easy: >> {ok, Tuple} = inet:getaddr(String, inet) >> IP(integer) is another possibility, i.e. >> {ok, {A,B,C,D}} = inet:getaddr(String, inet), >> Integer = (A bsl 24) + (B bsl 16) + (C bsl 8) + D. >> Then you don't have to worry about the atom table _and_ you have a >> useful representation. >> Matthias >> > > > in case if I use atoms I can write smthing like this > > try > ip_127_0_0_1 ! { processNewData, SomeData } > catch > Any -> > createAndRegisterNewProcess(127_0_0_1) > ip_127_0_0_1 ! { processNewData, SomeData } > end > > > This will perform lookup not in Erlang data structure - gb_tree in > my case, but in erlangs internal table, which should be faster. > In case that ~ have limited set of ip's which should be processed, > I think I can avoid trashing of atoms table. > One common solution is to maintain a named protected ets table of IP Addr -> Pid. Looking up in an ets table is pretty much the same as looking up in an "erlang internal table", and the calling process can do it directly: case ets:lookup(mapper, {127,0,0,1}) of [{_, Pid}] -> Pid ! { processNewData, SomeData }; [] -> Pid = createAndRegisterNewProcess({127,0,0,1}), %% This should make a call to the ets table owning process to insert the new entry Pid ! { processNewData, SomeData } end OTOH if you know you will have a bounded set of IP addresses then your atom scheme is OK also Sean From ulf@REDACTED Sun May 22 10:55:06 2005 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 22 May 2005 10:55:06 +0200 Subject: addressing a lot of processes In-Reply-To: <3A51370B-D189-4F50-BEE1-2917727EDFE4@mac.com> References: <428E00EA.2070106@web.am> <17038.8700.60204.145175@beladrome.corelatus.se> <428F235E.9000903@web.am> <3A51370B-D189-4F50-BEE1-2917727EDFE4@mac.com> Message-ID: Den 2005-05-22 00:35:22 skrev Sean Hinde : > One common solution is to maintain a named protected ets table of IP > Addr -> Pid. Looking up in an ets table is pretty much the same as > looking up in an "erlang internal table", and the calling process can do > it directly: > > case ets:lookup(mapper, {127,0,0,1}) of > [{_, Pid}] -> > Pid ! { processNewData, SomeData }; > [] -> > Pid = createAndRegisterNewProcess({127,0,0,1}), %% This > should make a call to the ets table owning process to insert the new > entry > Pid ! { processNewData, SomeData } > end > > OTOH if you know you will have a bounded set of IP addresses then your > atom scheme is OK also > > Sean In a previous post: http://forums.trapexit.org:81/phpBB/viewtopic.php?t=3572 I mentioned a process registry that's available in Jungerl. It allows you to register any erlang term to a process, have multiple registered names for a single process, and also register shared names, e.g. in order to address process as a group. There are also functions to fold over a set of registered processes. Performance is quite good, and I think you'd need to have some pretty heavy performance requirements not to afford it, esp. considering the advantages it brings in debugging and programming ease. /Uffe From nm@REDACTED Sun May 22 23:20:57 2005 From: nm@REDACTED (Gaspar Chilingarov) Date: Mon, 23 May 2005 02:20:57 +0500 (AMST) Subject: performance issues Message-ID: <51509.217.113.1.123.1116796857.squirrel@webmail.web.am> Hi all! I've tried to rewrite my code using gen_server behaviour (the one module which do the manager's job - keeping track of child processes, lookup by key, sending broadcast to all children, and the one module with processes which do real job -- collecting statistics and process it). Imformation is coming to the system periodically (once a minute), some dispatcher process parses string lines and passes tokens to corresponding children. For the same set of input data i got 5-10 times slower performance, what can be a problem and how should I profile this application ? profiler manual is a little bit messy (for a newcomer :). Thanks in advance :) -- Gaspar Chilingarov System Administrator t +37491 419763 w www.web.am e nm@REDACTED From svg@REDACTED Mon May 23 00:15:16 2005 From: svg@REDACTED (Vladimir Sekissov) Date: Mon, 23 May 2005 04:15:16 +0600 (YEKST) Subject: performance issues In-Reply-To: <51509.217.113.1.123.1116796857.squirrel@webmail.web.am> References: <51509.217.113.1.123.1116796857.squirrel@webmail.web.am> Message-ID: <20050523.041516.91319790.svg@surnet.ru> Good day, nm> For the same set of input data i got 5-10 times slower performance, what can nm> be a problem and how should I profile this application ? profiler manual is a nm> little bit messy (for a newcomer :). Try _fprof_. It is very easy to use and has very understandable output. 1> fprof:trace(start). 2> start_my_app_here(). 3> fprof:trace(stop). 4> fprof:profile(). 5> fprof:analyse([]). It is all you need in most cases. Best Regards, Vladimir Sekissov nm> Hi all! nm> nm> I've tried to rewrite my code using gen_server behaviour (the one module which nm> do the manager's job - keeping track of child processes, lookup by key, nm> sending broadcast to all children, and the one module with processes which do nm> real job -- collecting statistics and process it). nm> nm> Imformation is coming to the system periodically (once a minute), some nm> dispatcher process parses string lines and passes tokens to corresponding nm> children. nm> nm> nm> For the same set of input data i got 5-10 times slower performance, what can nm> be a problem and how should I profile this application ? profiler manual is a nm> little bit messy (for a newcomer :). nm> nm> Thanks in advance :) nm> nm> nm> -- nm> Gaspar Chilingarov nm> System Administrator nm> nm> t +37491 419763 nm> w www.web.am nm> e nm@REDACTED nm> From hakan@REDACTED Mon May 23 10:22:17 2005 From: hakan@REDACTED (Hakan Mattsson) Date: Mon, 23 May 2005 10:22:17 +0200 (CEST) Subject: insert a record In-Reply-To: References: Message-ID: On Wed, 18 May 2005, Ulf Wiger (AL/EAB) wrote: Uffe> The index is transparent to insert operations. Uffe> Mnesia maintains the indexes behind the scenes, and you Uffe> never have to specify indexes except (a) when you create Uffe> the table and (b) when you specifically want to use the Uffe> index to locate data in your table. This is true, but in order to avoid mis-understandings it may be worth to point out that (b) is not needed when using Mnesia's functions for match_object and select. ... Dietmar> What I have is : Dietmar> Dietmar> mnesia:create_table(centerDisplayProcessesList, [{snmp, Dietmar> [{key, integer}]}, Dietmar> {attributes, record_info(fields, Dietmar> centerDisplayProcessesList)}, Dietmar> {disc_copies, Nodes}]) of Dietmar> Dietmar> So I have a integer (snmp) index. Dietmar> Dietmar> Now I would be able to just insert a new record for which I Dietmar> do not care about the index. Nowdays, when tables in Mnesia may be ordered, you do not need to use a separate SNMP index in Mnesia. A more efficient approach is to select the table keys so the main table automatically gets sorted according to the SNMP rules. In your case when the key is a plain integer the separate SNMP index is totally superfluous. /H?kan From dietmar@REDACTED Mon May 23 14:03:03 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Mon, 23 May 2005 14:03:03 +0200 Subject: systools:make_script Message-ID: <4291C677.6040704@ast.dfs.de> Hi ! For my release I have the following directory structure : BTW: Yes I read http://www.trapexit.org/docs/howto/release_handling_tutorial.html but I do not get it :-( /tmp/ ----| |---- releases/1.0/cmmc.rel |---- lib/cmmc-1.0 --| |-- src |-- ebin/cmmc.app which - as far as I can see should be ok. (?) cmmc.rel: {release, {"cmmc","1.0"}, {erts,"5.4.3"}, [{kernel,"2.10.6"}, {stdlib,"1.13.5"}, {sasl, "2.0.1"}, {mnesia,"4.2.1"}, {snmp,"4.1.2"}, {cmmc,"1.0"}]}. cmmc.app: {application, cmmc, [{description, "CMMC module for 4dp"}, {vsn,"1.0"}, {modules,[cmmc_4d.erl,cmmc_com.erl,cmmc_snmp.erl,cmmc_util.erl,cmmc_4dp.erl,cmmc_config.erl]}, {registered,[comDecode,sendProc,cmmc_config]}, {applications,[kernel,mnesia,stdlib,sasl,snmp]} ]}. calling systools:make_script("cmmc",[{path,["/tmp/lib/cmmc-1.0/ebin"]}]). I get: {{module_not_found,cmmc,'cmmc_4d.erl'}, {'cmmc_4d.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} {{module_not_found,cmmc,'cmmc_com.erl'}, {'cmmc_com.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} {{module_not_found,cmmc,'cmmc_snmp.erl'}, {'cmmc_snmp.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} {{module_not_found,cmmc,'cmmc_util.erl'}, {'cmmc_util.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} {{module_not_found,cmmc,'cmmc_4dp.erl'}, {'cmmc_4dp.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} {{module_not_found,cmmc,'cmmc_config.erl'}, {'cmmc_config.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} error Can someone please (!) give me some advice ? regards Dietmar From ulf.wiger@REDACTED Mon May 23 15:05:46 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 23 May 2005 15:05:46 +0200 Subject: systools:make_script Message-ID: I haven't looked closely at the rest, but try removing the .erl extension in the 'modules' list in the .app file. /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of > Dietmar Schaefer > Sent: den 23 maj 2005 14:03 > To: Erlang Questions > Subject: systools:make_script > > > Hi ! > > For my release I have the following directory structure : > > BTW: Yes I read > http://www.trapexit.org/docs/howto/release_handling_tutorial.html > but I do not get it :-( > > > > > /tmp/ ----| > |---- releases/1.0/cmmc.rel > |---- lib/cmmc-1.0 --| > |-- src > |-- ebin/cmmc.app > > > which - as far as I can see should be ok. (?) > > > cmmc.rel: > > {release, {"cmmc","1.0"}, {erts,"5.4.3"}, > [{kernel,"2.10.6"}, > {stdlib,"1.13.5"}, > {sasl, "2.0.1"}, > {mnesia,"4.2.1"}, > {snmp,"4.1.2"}, > {cmmc,"1.0"}]}. > > > cmmc.app: > > {application, cmmc, > [{description, "CMMC module for 4dp"}, > {vsn,"1.0"}, > > {modules,[cmmc_4d.erl,cmmc_com.erl,cmmc_snmp.erl,cmmc_util.erl > ,cmmc_4dp.erl,cmmc_config.erl]}, > {registered,[comDecode,sendProc,cmmc_config]}, > {applications,[kernel,mnesia,stdlib,sasl,snmp]} > ]}. > > > > calling > systools:make_script("cmmc",[{path,["/tmp/lib/cmmc-1.0/ebin"]}]). > > I get: > > {{module_not_found,cmmc,'cmmc_4d.erl'}, > {'cmmc_4d.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} > {{module_not_found,cmmc,'cmmc_com.erl'}, > {'cmmc_com.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} > {{module_not_found,cmmc,'cmmc_snmp.erl'}, > {'cmmc_snmp.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} > {{module_not_found,cmmc,'cmmc_util.erl'}, > {'cmmc_util.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} > {{module_not_found,cmmc,'cmmc_4dp.erl'}, > {'cmmc_4dp.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} > {{module_not_found,cmmc,'cmmc_config.erl'}, > {'cmmc_config.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} > error > > > > Can someone please (!) give me some advice ? > > > regards > > > Dietmar > From chandrashekhar.mullaparthi@REDACTED Mon May 23 15:15:59 2005 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Mon, 23 May 2005 14:15:59 +0100 Subject: systools:make_script In-Reply-To: <4291C677.6040704@ast.dfs.de> References: <4291C677.6040704@ast.dfs.de> Message-ID: <06dbc8560c35823b42602ac67ce2565b@t-mobile.co.uk> Hi, In your app file, you must list the modules without the .erl extension I think. see below. {application, cmmc, [{description, "CMMC module for 4dp"}, {vsn,"1.0"}, {modules,[cmmc_4d,cmmc_com,cmmc_snmp,cmmc_util,cmmc_4dp,cmmc_config]}, {registered,[comDecode,sendProc,cmmc_config]}, {applications,[kernel,mnesia,stdlib,sasl,snmp]} ]}. cheers Chandru On 23 May 2005, at 13:03, Dietmar Schaefer wrote: > Hi ! > > For my release I have the following directory structure : > > BTW: Yes I read > http://www.trapexit.org/docs/howto/release_handling_tutorial.html > but I do not get it :-( > > > > > /tmp/ ----| > |---- releases/1.0/cmmc.rel > |---- lib/cmmc-1.0 --| > |-- src > |-- ebin/cmmc.app > > > which - as far as I can see should be ok. (?) > > > cmmc.rel: > > {release, {"cmmc","1.0"}, {erts,"5.4.3"}, > [{kernel,"2.10.6"}, > {stdlib,"1.13.5"}, > {sasl, "2.0.1"}, > {mnesia,"4.2.1"}, > {snmp,"4.1.2"}, > {cmmc,"1.0"}]}. > > > cmmc.app: > > {application, cmmc, > [{description, "CMMC module for 4dp"}, > {vsn,"1.0"}, > > {modules,[cmmc_4d.erl,cmmc_com.erl,cmmc_snmp.erl,cmmc_util.erl,cmmc_4dp > .erl,cmmc_config.erl]}, > {registered,[comDecode,sendProc,cmmc_config]}, > {applications,[kernel,mnesia,stdlib,sasl,snmp]} > ]}. > > > > calling > systools:make_script("cmmc",[{path,["/tmp/lib/cmmc-1.0/ebin"]}]). > > I get: > > {{module_not_found,cmmc,'cmmc_4d.erl'}, > {'cmmc_4d.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} > {{module_not_found,cmmc,'cmmc_com.erl'}, > {'cmmc_com.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} > {{module_not_found,cmmc,'cmmc_snmp.erl'}, > {'cmmc_snmp.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} > {{module_not_found,cmmc,'cmmc_util.erl'}, > {'cmmc_util.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} > {{module_not_found,cmmc,'cmmc_4dp.erl'}, > {'cmmc_4dp.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} > {{module_not_found,cmmc,'cmmc_config.erl'}, > {'cmmc_config.erl','$$ignore$$',cmmc,"1.0","/tmp/lib/cmmc-1.0/ebin"}} > error > > > > Can someone please (!) give me some advice ? > > > regards > > > Dietmar > From thomasl_erlang@REDACTED Mon May 23 16:05:08 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Mon, 23 May 2005 07:05:08 -0700 (PDT) Subject: newbie question In-Reply-To: 6667 Message-ID: <20050523140508.53180.qmail@web41904.mail.yahoo.com> --- "Thomas Johnsson XA (LN/EAB)" wrote: > There are situations where it is important that > guards are fast and side effect-free (in receive, > for example). > Conditions in if-expressions is *not* one of those > places, IMHO. (Except for the usual good reasons to > to program as 'functionally' as possible). > Ie, there is no reason that I can see why the > if-condition has to be a guard syntactically rather > than an expression. > I just forces the programmer to write something more > clumsy. > > Or is there some light I haven't yet seen? For what it's worth, I nowadays tend to agree with you. (Also, as an aside, it might be worth noting that a 'cond' expression was floated some time ago, which as far as I could tell was more lenient. But perhaps we can for once use Occam's razor and not multiply entities without necessity.) As far as I can tell, there are three problems with arbitrary guards: 1. Guards should run quickly. Since there are non-constant time guards already, this does not seem to be a big issue in practice. It may be related to point 2. 2. Suspending a process inside a guard is/can be messy. But this seems to be essentially an implementation restriction. From the compiler PoV, there is no real problem. (The system can suspend inside the case-expression we were forced to write instead, after all, though receives will need some attention.) 3. Side-effects inside guards are difficult to reason about. There are two solutions I can see: (cheap and cheerful) leave it up to the programmer (motivated below), or (nicer) check a flag before doing a side effect. If the flag is set, fail/throw an exception. Manage the flag appropriately when doing function calls in a guard. (As a historical note, the concurrent logic programming languages contemporary with Erlang's design also had problems with guards, and restricted them to "flat", simple tests; but those problems were related to concurrency and are really not applicable to Erlang, as far as I can see.) In summary, my main gripe with guards echoes yours: if keeping guards restricted means we have to write convoluted case-expressions instead of guards, what have we gained? The case expression can behave however it wants, so the guard restriction has not helped. The root problem, I suspect, is that we want to write modular, abstracted code, and restrictive guards merely guide us away from using them. So, IMO, guards could instead be generalized to syntactic sugar for real expressions with no loss to the language. Best, Thomas Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html From richardc@REDACTED Mon May 23 16:25:24 2005 From: richardc@REDACTED (Richard Carlsson) Date: Mon, 23 May 2005 16:25:24 +0200 Subject: newbie question In-Reply-To: <20050523140508.53180.qmail@web41904.mail.yahoo.com> References: <20050523140508.53180.qmail@web41904.mail.yahoo.com> Message-ID: <4291E7D4.7070805@csd.uu.se> Thomas Lindgren wrote: > (Also, as an aside, it might be worth noting that a > 'cond' expression was floated some time ago, which as > far as I could tell was more lenient. But perhaps we > can for once use Occam's razor and not multiply > entities without necessity.) I thought I fixed this along with 'try': Erlang (BEAM) emulator version 5.5 [source] [hipe] Eshell V5.5 (abort with ^G) 1> cond lists:reverse("foo") == "oof" -> yes; true -> no end. yes But it seems like it has not been documented... /Richard From nm@REDACTED Mon May 23 20:20:36 2005 From: nm@REDACTED (Gaspar Chilingarov) Date: Mon, 23 May 2005 23:20:36 +0500 Subject: fprof - crashing in profile() (was: performance issues) In-Reply-To: <20050523.041516.91319790.svg@surnet.ru> References: <51509.217.113.1.123.1116796857.squirrel@webmail.web.am> <20050523.041516.91319790.svg@surnet.ru> Message-ID: <42921EF4.3030804@web.am> Vladimir Sekissov wrote: > Good day, > > nm> For the same set of input data i got 5-10 times slower performance, what can > nm> be a problem and how should I profile this application ? profiler manual is a > nm> little bit messy (for a newcomer :). > > Try _fprof_. It is very easy to use and has very understandable > output. > > 1> fprof:trace(start). > > 2> start_my_app_here(). > > 3> fprof:trace(stop). > 4> fprof:profile(). > 5> fprof:analyse([]). > I got the following error, when tried to process trace file. fprof:trace(start) and trace(stop) both return ok. There is enough space on the hard drive to hold whole dump. <0.41.0> is a pid of my manager process .............. End of erroneous trace! {error,{inconsistent_trace_data,fprof, 2055, [<0.41.0>, undefined, {1116,870978,912617}, [[{suspend,{1116,870978,912617}}], [{{gen_server,loop,6},{1116,870978,911532}}, {{gen_server,handle_msg,6}, {1116,870978,257240}}, {{gen_server,loop,6},{1116,870978,257169}}, {{gen_server,init_it,6}, {1116,870978,217601}}, {{gen,init_it2,7},{1116,870978,214418}}, {{gen,init_it,7},{1116,870978,214410}}], [{{proc_lib,init_p,5},{1116,870978,214343}}]]]}} Any ideas why can it crash? -- Gaspar Chilingarov System Administrator t +37491 419763 w www.web.am e nm@REDACTED From tpatro@REDACTED Tue May 24 08:33:51 2005 From: tpatro@REDACTED (Tamas Patrovics) Date: Tue, 24 May 2005 08:33:51 +0200 Subject: ESense 1.1 released Message-ID: A few bugfixes and minor improvements. http://esense.sourceforge.net/ /Tamas From bjorn@REDACTED Tue May 24 09:17:55 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 24 May 2005 09:17:55 +0200 Subject: newbie question In-Reply-To: <4291E7D4.7070805@csd.uu.se> References: <20050523140508.53180.qmail@web41904.mail.yahoo.com> <4291E7D4.7070805@csd.uu.se> Message-ID: It has not been documented yet because V5.5 (R11B) have not been released yet. Also there still a compiler issues regarding cond that needs to be fixed. /Bjorn Richard Carlsson writes: > Thomas Lindgren wrote: > > (Also, as an aside, it might be worth noting that a > > 'cond' expression was floated some time ago, which as > > far as I could tell was more lenient. But perhaps we > > can for once use Occam's razor and not multiply > > entities without necessity.) > > I thought I fixed this along with 'try': > > Erlang (BEAM) emulator version 5.5 [source] [hipe] > > Eshell V5.5 (abort with ^G) > 1> cond lists:reverse("foo") == "oof" -> yes; true -> no end. > yes > > But it seems like it has not been documented... > > /Richard > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From mickael.remond@REDACTED Tue May 24 09:27:33 2005 From: mickael.remond@REDACTED (=?ISO-8859-1?Q?Micka=EBl_R=E9mond?=) Date: Tue, 24 May 2005 09:27:33 +0200 Subject: ejabberd 0.9.1 has been released Message-ID: Hello, ejabberd 0.9.1, a new release of ejabberd has been published. ejabberd is a clustered, scalable, robust and full featured XMPP server (developed in Erlang). This release contains several improvements and bugfixes. Improvements are mainly related to: - Groupchat (Multi-user chat and IRC) improvements - Web interface - Publish and subscribe - Translations This release is hosted on Process-one website (http://www.process-one.net/). The community site is at: http://ejabberd.jabber.ru/ ejabberd 0.9.1 can be downloaded from: http://www.process-one.net/en/projects/ejabberd/download.html For more information, you should have a look at the release notes: http://www.process-one.net/en/projects/ejabberd/releases/ release_0.9.1.html The complete Changelog file is at: http://www.process-one.net/en/projects/ejabberd/changelogs.html Have fun, -- The ejabberd team From raimo@REDACTED Tue May 24 09:58:12 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 24 May 2005 09:58:12 +0200 Subject: fprof - crashing in profile() (was: performance issues) References: <51509.217.113.1.123.1116796857.squirrel@webmail.web.am>, <20050523.041516.91319790.svg@surnet.ru>, <42921EF4.3030804@web.am> Message-ID: I am afraid you have ran into a bug in fprof. It has got a hard time figuring out the call stack from the trace data, and on some rare occasions it bugs out. If you could try fprof:analyse() from the latest version (R10B-5, if you have not already done that), it might work better. Otherwise try eprof. It does not record the call stack - just the time within each function not including called functions; the fprof 'own' time, but it might be sufficient for your problem. 1> eprof:start(). 2> eprof:start_profiling([self()]). 3> start_my_app_here(). 4> eprof:stop_profiling(). 5> eprof:analyse(). There is also cprof. It gives just the call count of every function, but it has the lowest runtime impact of the available tools. nm@REDACTED (Gaspar Chilingarov) writes: > Vladimir Sekissov wrote: > > Good day, > > nm> For the same set of input data i got 5-10 times slower > > performance, what can > > nm> be a problem and how should I profile this application ? profiler manual is a > > nm> little bit messy (for a newcomer :). > > Try _fprof_. It is very easy to use and has very understandable > > output. > > 1> fprof:trace(start). > > 2> start_my_app_here(). > > 3> fprof:trace(stop). > > 4> fprof:profile(). > > 5> fprof:analyse([]). > > I got the following error, when tried to process trace file. > fprof:trace(start) and trace(stop) both return ok. There is enough > space on the hard drive to hold whole dump. > <0.41.0> is a pid of my manager process > > > .............. > End of erroneous trace! > {error,{inconsistent_trace_data,fprof, > 2055, > [<0.41.0>, > undefined, > {1116,870978,912617}, > [[{suspend,{1116,870978,912617}}], > [{{gen_server,loop,6},{1116,870978,911532}}, > {{gen_server,handle_msg,6}, > {1116,870978,257240}}, > {{gen_server,loop,6},{1116,870978,257169}}, > {{gen_server,init_it,6}, > {1116,870978,217601}}, > {{gen,init_it2,7},{1116,870978,214418}}, > {{gen,init_it,7},{1116,870978,214410}}], > [{{proc_lib,init_p,5},{1116,870978,214343}}]]]}} > > > Any ideas why can it crash? > > > > -- > Gaspar Chilingarov > System Administrator > > t +37491 419763 > w www.web.am > e nm@REDACTED -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From dietmar@REDACTED Tue May 24 10:29:19 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Tue, 24 May 2005 10:29:19 +0200 Subject: systools:make_script - nearly works Message-ID: <4292E5DF.5030008@ast.dfs.de> Thank you ! It nearly works! systools:make_script just complains about not finding code and about Object code (cmmc_config) out of date systools:make_script("cmmc",[{path,["/tmp/lib/cmmc-1.0/ebin"]}]). *WARNING* snmp: Source code not found: snmp.erl *WARNING* snmp: Source code not found: snmp_app.erl *WARNING* snmp: Source code not found: snmp_app_sup.erl . . . WARNING* cmmc: Object code (cmmc_d4) out of date *WARNING* cmmc: Object code (cmmc_com) out of date *WARNING* cmmc: Object code (cmmc_snmp) out of date *WARNING* cmmc: Object code (cmmc_util) out of date *WARNING* cmmc: Object code (cmmc_4dp) out of date *WARNING* cmmc: Object code (cmmc_config) out of date ok despite the fact that I just compiled everything Is this somothing I should worry about ? Dietmar From mike@REDACTED Tue May 24 11:00:18 2005 From: mike@REDACTED (Michael Williams) Date: 24 May 2005 09:00:18 GMT Subject: Programming bookshelf Message-ID: I notice that Erlang is mentioned in http://en.wikibooks.org/wiki/Programming_languages_bookshelf but the entry is empty. Does anyone have some suitable text to put in? /mike From ulf.wiger@REDACTED Tue May 24 11:47:34 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Tue, 24 May 2005 11:47:34 +0200 Subject: systools:make_script - nearly works Message-ID: The algorithm used by systools_make to try to guess where the source might be (Ebin/../src/ or Ebin/../src/e_src) doesn't work on snmp: ws12858> ls $OTP_ROOT/lib/snmp-4.1.4/src/ agent/ app/ compiler/ manager/ misc/ Regarding the "Object code... out of date", I get that sometimes, but tend to ignore it. (: systools_make checks the modification timestamps on the .erl and .beam files (if it can find the source) and complains if the .erl file seems to be newer than the .beam file. /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of > Dietmar Schaefer > Sent: den 24 maj 2005 10:29 > To: erlang-questions@REDACTED > Subject: systools:make_script - nearly works > > > Thank you ! > > > It nearly works! > > > systools:make_script just complains about not finding code and about > Object code (cmmc_config) out of date > > > > systools:make_script("cmmc",[{path,["/tmp/lib/cmmc-1.0/ebin"]}]). > *WARNING* snmp: Source code not found: snmp.erl > *WARNING* snmp: Source code not found: snmp_app.erl > *WARNING* snmp: Source code not found: snmp_app_sup.erl > . > . > . > WARNING* cmmc: Object code (cmmc_d4) out of date > *WARNING* cmmc: Object code (cmmc_com) out of date > *WARNING* cmmc: Object code (cmmc_snmp) out of date > *WARNING* cmmc: Object code (cmmc_util) out of date > *WARNING* cmmc: Object code (cmmc_4dp) out of date > *WARNING* cmmc: Object code (cmmc_config) out of date > ok > > > despite the fact that I just compiled everything > > > Is this somothing I should worry about ? > > > > Dietmar > > > From erlang-list@REDACTED Tue May 24 14:08:12 2005 From: erlang-list@REDACTED (Dominic Williams) Date: Tue, 24 May 2005 14:08:12 +0200 Subject: Programming bookshelf In-Reply-To: References: Message-ID: <4293192C.206@dominicwilliams.net> Michael Williams wrote: > I notice that Erlang is mentioned in > http://en.wikibooks.org/wiki/Programming_languages_bookshelf > but the entry is empty. Does anyone have some suitable > text to put in? My last contribution to that sort of exercise is here: http://c2.com/cgi/wiki?ErlangLanguage Regards, Dominic Williams http://www.dominicwilliams.net ---- From ulf.wiger@REDACTED Tue May 24 14:14:52 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Tue, 24 May 2005 14:14:52 +0200 Subject: pretty-printing through the shell Message-ID: I thought I'd try a small hack to the shell: > diff shell.erl $OTP_ROOT/lib/stdlib-1.13.6/src/shell.erl 23d22 < -export([format/1]). 44,47d42 < format(Term) -> < io_lib_pretty:print(Term, ?LINEMAX, record_print_fun(?RECORDS)). < < 169c164 < RT = ets:new(?RECORDS, [public,named_table,ordered_set]), --- > RT = ets:new(?RECORDS, [public,ordered_set]), Now, given the following test function: -include("dialyzer.hrl"). ... print() -> S = shell:format(#options{}), io:format("Output: ~s~n", [S]). 1> test:print(). Output: {options,[],[],cerl_typean,[],byte_code,[],undefined,[],none,false,none,batch} ok 2> rr("dialyzer.hrl"). [analysis,options] 3> test:print(). Output: #options{files = [], files_rec = [], core_transform = cerl_typean, defines = [], from = byte_code, include_dirs = [], legal_warnings = undefined, output_file = [], init_plt = none, update_plt = false, new_plt = none, cl_mode = batch} ok Wouldn't this be rather handy for debugging printouts? (not that we ever use debugging printouts anymore...;) /Uffe From kostis@REDACTED Tue May 24 14:27:26 2005 From: kostis@REDACTED (Kostis Sagonas) Date: Tue, 24 May 2005 14:27:26 +0200 (MEST) Subject: erl_eval.erl : Mucho weirdness Message-ID: <200505241227.j4OCRQ0E026127@spikklubban.it.uu.se> In stdlib/src/erl_eval.erl one finds the following beauty: ------------------------------------------------------------------------- do_apply({M,F}=Func, As, Bs0, Ef, RBs) when is_tuple(M), size(M) >= 1, is_atom(element(1, M)), is_atom(F) -> case Ef of none when RBs == value -> %% Make tail recursive calls when possible. apply(M, F, As); none -> ret_expr(apply(M, F, As), Bs0, RBs); ... [SNIP] ... ------------------------------------------------------------------------- Can somebody explain to me the intention of the guards ? Kostis From vlad.xx.dumitrescu@REDACTED Tue May 24 14:35:23 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Tue, 24 May 2005 14:35:23 +0200 Subject: pretty-printing through the shell Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE55C@esealmw105.eemea.ericsson.se> -----Original Message----- From: Ulf Wiger (AL/EAB) >Wouldn't this be rather handy for debugging printouts? (not that we ever use debugging printouts anymore...;) Yes, but what if anyone want to easily pretty print records from a program? *gasp* A suggestion is to use my little contribution to jungerl (lib/msc/src/record_info.erl) to convert the record to a list of key/value pairs, and then printing it so that it still looks like a record should be trivial. If time permits, I might add printing to the file myself. regards, Vlad From ok@REDACTED Tue May 24 04:33:08 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 24 May 2005 14:33:08 +1200 (NZST) Subject: newbie question Message-ID: <200505240233.j4O2X8vt208100@atlas.otago.ac.nz> Thomas Lindgren wrote: As far as I can tell, there are three problems with arbitrary guards: 1. Guards should run quickly. Since there are non-constant time guards already, this does not seem to be a big issue in practice. It may be related to point 2. It is not a big problem in practice because at least some of us carefully *avoid* the non-constant-time guards. Is there a compiler option I have missed to ask for warnings about them? In summary, my main gripe with guards echoes yours: if keeping guards restricted means we have to write convoluted case-expressions instead of guards, what have we gained? The opportunity to look at our code and see that it can be rewritten more cleanly without EITHER using nasty guards OR convoluted case- expressions, perhaps? In order words, I deny the "HAVE TO" part of your "if". So, IMO, guards could instead be generalized to syntactic sugar for real expressions with no loss to the language. Really, there are two quite separate things here. (1) Should "if" expressions be able to use general expressions? (Since "case" expressions can, perhaps the answer is yes.) (2) Should guards be able to use general expressions? These are two quite separate things because there is no reason why "if" expressions *have* to use guard syntax at all. We could simply define if E11 then E12 elif E21 then E22 ... else En end to mean case E11 of true -> E12 ; false -> case E21 of true -> E22 ; false -> ... En end .... end end in which case there would be no direct connection between "if" and guards at all. I suggest it is better to do that than to change guards. From nm@REDACTED Tue May 24 16:06:03 2005 From: nm@REDACTED (Gaspar Chilingarov) Date: Tue, 24 May 2005 19:06:03 +0500 Subject: gen_server:start - performance Message-ID: <429334CB.3060004@web.am> Hmm, after doing some measurements, I've found that spawning processes with gen_server:start and stopping them takes several times much time that with spawn. The only way to get around this was to leave some processes alive, cleaning their status, but not stopping them. I need rate of about 2500 proc/second starting for a some time range - say bursts 10 seconds long with such spawn rate -- Gaspar Chilingarov System Administrator t +37491 419763 w www.web.am e nm@REDACTED From thomasl_erlang@REDACTED Tue May 24 15:43:18 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 24 May 2005 06:43:18 -0700 (PDT) Subject: newbie question In-Reply-To: 6667 Message-ID: <20050524134318.61323.qmail@web41904.mail.yahoo.com> --- "Richard A. O'Keefe" wrote: > Thomas Lindgren wrote: > > /.../ > ... at least > some of us > carefully *avoid* the non-constant-time guards. Is > there a compiler > option I have missed to ask for warnings about them? Not as far as I know. > In summary, my main gripe with guards echoes yours: > if > keeping guards restricted means we have to write > convoluted case-expressions instead of guards, what > have we gained? > > The opportunity to look at our code and see that it > can be rewritten > more cleanly without EITHER using nasty guards OR > convoluted case- > expressions, perhaps? In order words, I deny the > "HAVE TO" part of > your "if". Ah, that "HAVE TO" wasn't meant to be quite so universal. Still, assuming that we want to encapsulate and abstract, we seem to be stuck with avoiding guards for that sort of code. Um, I'm running out of time so that has to be it for now. It seems 'cond' will provide a replacement for some uses of if (similar to what you suggest subsequently), so perhaps the issue is growing moot. Best, Thomas __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail From svg@REDACTED Tue May 24 16:45:53 2005 From: svg@REDACTED (Vladimir Sekissov) Date: Tue, 24 May 2005 20:45:53 +0600 (YEKST) Subject: gen_server:start - performance In-Reply-To: <429334CB.3060004@web.am> References: <429334CB.3060004@web.am> Message-ID: <20050524.204553.73228745.svg@surnet.ru> Good day, nm> Hmm, after doing some measurements, I've found that nm> spawning processes with gen_server:start and stopping nm> them takes several times much time that with spawn. You don't need write simple short living workers as gen_server's. If you need OTP support for them look at _plain_fsm_ module at Jungerl(http://jungerl.sourceforge.net/). You can convert simple spawn+loop FSMs with it easily to obey OTP system protocols. It seems that _proc_reg_ module could be useful too for your application. Best Regards, Vladimir Sekissov nm> Hmm, after doing some measurements, I've found that nm> spawning processes with gen_server:start and stopping nm> them takes several times much time that with spawn. nm> nm> The only way to get around this was to leave some processes alive, nm> cleaning their status, but not stopping them. nm> nm> I need rate of about 2500 proc/second starting for a some time range - nm> say bursts 10 seconds long with such spawn rate nm> nm> nm> nm> nm> -- nm> Gaspar Chilingarov nm> System Administrator nm> nm> t +37491 419763 nm> w www.web.am nm> e nm@REDACTED nm> From vlad_dumitrescu@REDACTED Tue May 24 20:21:59 2005 From: vlad_dumitrescu@REDACTED (vladdu) Date: Tue, 24 May 2005 20:21:59 +0200 Subject: erl_eval.erl : Mucho weirdness References: Message-ID: <20050524182200.1DBCE46A8A@bang.trapexit.org> Hi, I'd venture to guess that those guards are trying to assert that M is an abstract module, which is represented as a tuple, with the module's name in the first position. So now we have not only {M, F} calls, but also {{M, ...}, F}... Makes me yearn for dedicated types... regards, Vlad _________________________________________________________ Sent using Mail2Forum (http://m2f.sourceforge.net) From neumann@REDACTED Wed May 25 00:19:01 2005 From: neumann@REDACTED (=?iso-8859-1?q?Fran=E7ois-Denis_Gonthier?=) Date: Tue, 24 May 2005 18:19:01 -0400 Subject: ESense 1.1 released In-Reply-To: References: Message-ID: <200505241819.02287.neumann@lostwebsite.net> On May 24, 2005 02:33 am, Tamas Patrovics wrote: > A few bugfixes and minor improvements. > > http://esense.sourceforge.net/ > > /Tamas MAN! For Eclipse-addicts, this tool is a MUST. I've used it, like, 20 seconds and I feel I already can't live without it. It's too bad there ain't that much good auto-complete tools for Emacs. Thank you! From csanto@REDACTED Wed May 25 09:10:45 2005 From: csanto@REDACTED (Corrado Santoro) Date: Wed, 25 May 2005 09:10:45 +0200 Subject: Error in http client Message-ID: <429424F5.6090605@diit.unict.it> Hi all, I'm using the http client module of inets to realise an http proxy. When I invoke "http:request" I often receive the result: {error,session_remotly_closed} It seems that the remote site has closed the connection, but the strange thing is that I receive such a reply when I issue a request to Google. Could someone explain the exact meaning of such a message. Ciao, --Corrado -- ====================================================== Eng. Corrado Santoro, Ph.D. University of Catania - Engineering Faculty Department of Computer Science and Telecommunications Engineering Viale A. Doria, 6 - 95125 CATANIA (ITALY) Tel: +39 095 7382144 Int. (5) 8035 +39 095 7382380 +39 095 7382365 +39 095 7382364 VoIP: sip:8035@REDACTED Fax: +39 095 7382397 EMail: csanto@REDACTED Personal Home Page: http://www.diit.unict.it/users/csanto NUXI Home Page: http://nuxi.iit.unict.it ====================================================== From bjorn@REDACTED Wed May 25 10:10:05 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 25 May 2005 10:10:05 +0200 Subject: erl_eval.erl : Mucho weirdness In-Reply-To: <20050524182200.1DBCE46A8A@bang.trapexit.org> References: <20050524182200.1DBCE46A8A@bang.trapexit.org> Message-ID: "vladdu" writes: > Hi, > > I'd venture to guess that those guards are trying to assert that M is an abstract module, which is represented as a tuple, with the module's name in the first position. > That's correct. > So now we have not only {M, F} calls, but also {{M, ...}, F}... Makes me yearn for dedicated types... > The abstract modules are so far an experimental feature (they are neither documented nor supported). If we'll keep them (which does seem likely), there will probably be a new type instead of a tuple. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From sean.hinde@REDACTED Wed May 25 11:35:01 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Wed, 25 May 2005 10:35:01 +0100 Subject: Abstract Modules (was Re: erl_eval.erl : Mucho weirdness) In-Reply-To: References: <20050524182200.1DBCE46A8A@bang.trapexit.org> Message-ID: > > The abstract modules are so far an experimental feature (they are > neither > documented nor supported). > > If we'll keep them (which does seem likely), there will probably be > a new type > instead of a tuple. I have been starting to find uses for abstract modules, but they don't quite do what I want them to do. It is still a requirement to pass the reference to the abstract module to everywhere which wishes to call it. In many cases it would not be much more onerous to simply carry round the initialisation parameters. I would like to see the introduction of a "Named Abstract Module". This could be as simple as an abstract module which once initialised can only be called by its normal name. This could usefully have "qssign once" semantics - once initialised it would be illegal (throw exception) to re-initialise it. The particular situation I am thinking of is where a large codebase must be switchable between different products, and it is not desirable to litter the code with ifdefs. Sean From vlad_dumitrescu@REDACTED Wed May 25 13:36:08 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 25 May 2005 13:36:08 +0200 Subject: Abstract Modules (was Re: erl_eval.erl : Mucho weirdness) References: <20050524182200.1DBCE46A8A@bang.trapexit.org> Message-ID: ----- Original Message ----- From: "Sean Hinde" > I would like to see the introduction of a "Named Abstract Module". > This could be as simple as an abstract module which once initialised > can only be called by its normal name. This could usefully have > "qssign once" semantics - once initialised it would be illegal (throw > exception) to re-initialise it. This can easily be implemented like for any data that needs to be accessible by name from anywhere: store {Name, Data} in a global ets table. Or do you mean that there should be a way to use the name (atom) as a regular module name in function calls, and the name-to-module translation should be done behind the scenes? regards, Vlad From sean.hinde@REDACTED Wed May 25 13:46:58 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Wed, 25 May 2005 12:46:58 +0100 Subject: Abstract Modules (was Re: erl_eval.erl : Mucho weirdness) In-Reply-To: References: <20050524182200.1DBCE46A8A@bang.trapexit.org> Message-ID: <3E91CCAD-3185-46AE-86FC-C44704962137@mac.com> On 25 May 2005, at 12:36, Vlad Dumitrescu wrote: > ----- Original Message ----- > From: "Sean Hinde" > >> I would like to see the introduction of a "Named Abstract Module". >> This could be as simple as an abstract module which once initialised >> can only be called by its normal name. This could usefully have >> "qssign once" semantics - once initialised it would be illegal (throw >> exception) to re-initialise it. >> > > This can easily be implemented like for any data that needs to be > accessible > by name from anywhere: store {Name, Data} in a global ets table. > > Or do you mean that there should be a way to use the name (atom) as a > regular module name in function calls, and the name-to-module > translation > should be done behind the scenes? Yes, this is what I meant, only much less elegantly put :) Sean From vlad_dumitrescu@REDACTED Wed May 25 14:04:38 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 25 May 2005 14:04:38 +0200 Subject: Abstract Modules (was Re: erl_eval.erl : Mucho weirdness) References: <20050524182200.1DBCE46A8A@bang.trapexit.org> <3E91CCAD-3185-46AE-86FC-C44704962137@mac.com> Message-ID: From: "Sean Hinde" > > Or do you mean that there should be a way to use the name (atom) as a > > regular module name in function calls, and the name-to-module > > translation should be done behind the scenes? > > Yes, this is what I meant, only much less elegantly put :) Oh, I see :-) I can see a problem with this: the client module makes calls to what looks like a regular module, but in fact is something else. Maybe the biggest problem will be finding the source code for that module, but I feel it's not proper... Not to mention the possibility of getting name clashes: if a regular module with same name exists, which one should be called? A clean way to handle this would be to make the client modules abstract too, with the original abstract module as a parameter. This would recursively force all modules that make external calls to become abstract, and then why not make modules a data type and skip the "abstractness"? ;-) regards, Vlad From ingela@REDACTED Wed May 25 14:56:08 2005 From: ingela@REDACTED (Ingela Anderton) Date: Wed, 25 May 2005 14:56:08 +0200 Subject: Error in http client References: <429424F5.6090605@diit.unict.it> Message-ID: <17044.30184.826068.378890@gargle.gargle.HOWL> Corrado Santoro wrote: > Hi all, > > I'm using the http client module of inets to realise an http proxy. When > I invoke "http:request" I often receive the result: > {error,session_remotly_closed} > > It seems that the remote site has closed the connection, but the strange > thing is that I receive such a reply when I issue a request to Google. Which version of inets are you using? Both http:request(get, {"http://www.google.com", []}, [], []). and http:request(get, {"http://www.google.se", []}, [], []). works fine for me on the latest version, that is inets-4.4.1. However I do not think this version made it to open source yet! > Could someone explain the exact meaning of such a message. It means that the socket was closed by the server and that this was not expected. In some situations the server will close the socket to indicate that that all data has been sent instead of using a length header or chunked-encoding. (In that situation you will not get an error, as then, it is expected that the socket can be closed.) Google sends a length header: 7> http:request(get, {"http://www.google.com", []}, [], []). {ok,{{"HTTP/1.1",200,"OK"}, [{"connection","Keep-Alive"}, {"date","Wed, 25 May 2005 12:32:01 GMT"}, {"server","GWS/2.1"}, {"content-length","5170"}, {"content-type","text/html"}, {"cache-control","private"}, {"set-cookie", "PREF=ID=4ab7f9cf7a993 .... -- /Ingela - OTP team From csanto@REDACTED Wed May 25 15:32:33 2005 From: csanto@REDACTED (Corrado Santoro) Date: Wed, 25 May 2005 15:32:33 +0200 Subject: Error in http client In-Reply-To: <17044.30184.826068.378890@gargle.gargle.HOWL> References: <429424F5.6090605@diit.unict.it> <17044.30184.826068.378890@gargle.gargle.HOWL> Message-ID: <42947E71.5000104@diit.unict.it> Ingela Anderton wrote: > Both > > http:request(get, {"http://www.google.com", []}, [], []). > > and > > http:request(get, {"http://www.google.se", []}, [], []). > > works fine for me on the latest version, that is inets-4.4.1. However I do > not think this version made it to open source yet! Well, if I issue the call from the Erlang shell, it works. So I think the problem is with the integration with my program. For this purpose, I'm spawining several Erlang processes each one making its own 'http:request' call. Is it a problem for the http module? I mean, is 'http:request' process-safe? Thanks, --Corrado -- ====================================================== Eng. Corrado Santoro, Ph.D. University of Catania - Engineering Faculty Department of Computer Science and Telecommunications Engineering Viale A. Doria, 6 - 95125 CATANIA (ITALY) Tel: +39 095 7382144 Int. (5) 8035 +39 095 7382380 +39 095 7382365 +39 095 7382364 VoIP: sip:8035@REDACTED Fax: +39 095 7382397 EMail: csanto@REDACTED Personal Home Page: http://www.diit.unict.it/users/csanto NUXI Home Page: http://nuxi.iit.unict.it ====================================================== From vlad_dumitrescu@REDACTED Wed May 25 15:50:27 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 25 May 2005 15:50:27 +0200 Subject: Traversing graphs Message-ID: Hi all, I just hit a problem where I clearly see how simple it would be with lazy evaluation. But since we don't have that, I wonder if anyone could point me to some non-lazy algorithms. I have a graph described by a list of nodes. The nodes refer to other nodes by name. I need to traverse the graph and do stuff on each node, without traversing a node more than once. Of course, the 'stuff' done above is recursive (the value for a node depends on the values of its linked nodes), so visiting a node results in visiting all linked ones. All references I found about doing this in a functional language are Haskell ones, and they use lazyness. Does anyone know about where to look for hints on how to solve this in a strict language? I have partial solutions, but I seem to be missing something, and such a problem can't be something new in computer science. Thanks in advance! best regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.xa.johnsson@REDACTED Wed May 25 16:09:22 2005 From: thomas.xa.johnsson@REDACTED (Thomas Johnsson XA (LN/EAB)) Date: Wed, 25 May 2005 16:09:22 +0200 Subject: Traversing graphs Message-ID: <44D1EB33A5E44D4BBAFD4FB9E8CCCB4719EBBE@esealmw107.eemea.ericsson.se> You don't give any details on what you really want to do with the graph, eg what sort of traversal (depth first? breath first? ...), but the first idea that comes to mind is to use a set or an ets table to mark already visited nodes. In any case, since Erlang is an imperative language (yeah yeah no flames please, I mean in the sense of allowing side effects :-), standard textbook algorithms should be 'easily' transliterated. -- Thomas -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED]On Behalf Of Vlad Dumitrescu Sent: den 25 maj 2005 15:50 To: erlang-questions@REDACTED Subject: Traversing graphs Hi all, I just hit a problem where I clearly see how simple it would be with lazy evaluation. But since we don't have that, I wonder if anyone could point me to some non-lazy algorithms. I have a graph described by a list of nodes. The nodes refer to other nodes by name. I need to traverse the graph and do stuff on each node, without traversing a node more than once. Of course, the 'stuff' done above is recursive (the value for a node depends on the values of its linked nodes), so visiting a node results in visiting all linked ones. All references I found about doing this in a functional language are Haskell ones, and they use lazyness. Does anyone know about where to look for hints on how to solve this in a strict language? I have partial solutions, but I seem to be missing something, and such a problem can't be something new in computer science. Thanks in advance! best regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.hinde@REDACTED Wed May 25 16:27:35 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Wed, 25 May 2005 15:27:35 +0100 Subject: Abstract Modules (was Re: erl_eval.erl : Mucho weirdness) In-Reply-To: References: <20050524182200.1DBCE46A8A@bang.trapexit.org> <3E91CCAD-3185-46AE-86FC-C44704962137@mac.com> Message-ID: <460C9ADA-E116-4533-B0AE-2F3CE9232C18@mac.com> On 25 May 2005, at 13:04, Vlad Dumitrescu wrote: > From: "Sean Hinde" > >>> Or do you mean that there should be a way to use the name (atom) >>> as a >>> regular module name in function calls, and the name-to-module >>> translation should be done behind the scenes? >>> >> >> Yes, this is what I meant, only much less elegantly put :) >> > > Oh, I see :-) > > I can see a problem with this: the client module makes calls to > what looks > like a regular module, but in fact is something else. Maybe the > biggest > problem will be finding the source code for that module, but I feel > it's not > proper... It is not very pure certainly. It would still be useful however if it was restricted to a single named instance with the same name as the module name in the source code. There would be no difficulty with finding the source code, and it would be normally be initialised sometime during system startup. > > Not to mention the possibility of getting name clashes: if a > regular module > with same name exists, which one should be called? Indeed. Restricting to one instance with the name of the module would solve this with some loss of flexibility. > > > A clean way to handle this would be to make the client modules > abstract too, > with the original abstract module as a parameter. > This would recursively force all modules that make external calls > to become > abstract, and then why not make modules a data type and skip the > "abstractness"? > ;-) > Yes, this would also probably do, but could end up an even worse maintenance nightmare - not to mention the increased probability of introducing circular dependencies. So, In conclusion I would restrict such a thing to a single instance named after the abstract module. A new kind of new() call could be added to initilaise this variant, maybe: mod:named_new([Param1, Param2]). Sean From mikael.karlsson@REDACTED Wed May 25 16:55:33 2005 From: mikael.karlsson@REDACTED (Mikael Karlsson) Date: Wed, 25 May 2005 16:55:33 +0200 Subject: Traversing graphs In-Reply-To: References: Message-ID: <200505251655.34060.mikael.karlsson@creado.com> Hi Vlad, are not the digraph and digraph_utils modules in stdlib useful to you? /Mikael onsdag 25 maj 2005 15:50 skrev Vlad Dumitrescu: > Hi all, > > I just hit a problem where I clearly see how simple it would be with lazy > evaluation. But since we don't have that, I wonder if anyone could point me > to some non-lazy algorithms. > > I have a graph described by a list of nodes. The nodes refer to other nodes > by name. I need to traverse the graph and do stuff on each node, without > traversing a node more than once. Of course, the 'stuff' done above is > recursive (the value for a node depends on the values of its linked nodes), > so visiting a node results in visiting all linked ones. > > All references I found about doing this in a functional language are > Haskell ones, and they use lazyness. Does anyone know about where to look > for hints on how to solve this in a strict language? > > I have partial solutions, but I seem to be missing something, and such a > problem can't be something new in computer science. > > Thanks in advance! best regards, > Vlad From nm@REDACTED Wed May 25 19:35:07 2005 From: nm@REDACTED (Gaspar Chilingarov) Date: Wed, 25 May 2005 22:35:07 +0500 Subject: gen_server:start - performance In-Reply-To: <20050524.204553.73228745.svg@surnet.ru> References: <429334CB.3060004@web.am> <20050524.204553.73228745.svg@surnet.ru> Message-ID: <4294B74B.3010305@web.am> Vladimir Sekissov wrote: > Good day, > > nm> Hmm, after doing some measurements, I've found that > nm> spawning processes with gen_server:start and stopping > nm> them takes several times much time that with spawn. > > You don't need write simple short living workers as gen_server's. > > If you need OTP support for them look at _plain_fsm_ module at > Jungerl(http://jungerl.sourceforge.net/). You can convert simple > spawn+loop FSMs with it easily to obey OTP system protocols. > > It seems that _proc_reg_ module could be useful too for your > application. > > Best Regards, > Vladimir Sekissov ok, so it's better to write something like plain_server, which will provide same interface as gen_server, but implement less functionality than gen_server. > > nm> Hmm, after doing some measurements, I've found that > nm> spawning processes with gen_server:start and stopping > nm> them takes several times much time that with spawn. > nm> > nm> The only way to get around this was to leave some processes alive, > nm> cleaning their status, but not stopping them. > nm> > nm> I need rate of about 2500 proc/second starting for a some time range - > nm> say bursts 10 seconds long with such spawn rate > nm> > nm> > nm> > nm> > nm> -- > nm> Gaspar Chilingarov > nm> System Administrator > nm> > nm> t +37491 419763 > nm> w www.web.am > nm> e nm@REDACTED > nm> > -- Gaspar Chilingarov System Administrator t +37491 419763 w www.web.am e nm@REDACTED From nm@REDACTED Wed May 25 19:39:25 2005 From: nm@REDACTED (Gaspar Chilingarov) Date: Wed, 25 May 2005 22:39:25 +0500 Subject: removing last element from the list Message-ID: <4294B84D.3030505@web.am> Hi all! are there any really fast ways to remove last element from list? list size is 5-15 elements, but it's not known at compile time. I need to implement something like FIFO, new elements inserted in list push old elements out. now it looks line NewList = [ Elem | lists:sublist(List, N-1)] which probably is not the best way. -- Gaspar Chilingarov System Administrator t +37491 419763 w www.web.am e nm@REDACTED From vlad_dumitrescu@REDACTED Wed May 25 19:55:49 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 25 May 2005 19:55:49 +0200 Subject: Traversing graphs References: <200505251655.34060.mikael.karlsson@creado.com> Message-ID: From: Thomas Johnsson XA (LN/EAB) >the first idea that comes to mind is to use a set or an ets table to mark >already visited nodes. From: "Mikael Karlsson" > are not the digraph and digraph_utils modules in stdlib useful to you? Unfortunately, no. I have my graph in a different format, and converting isn't so easy. To explain in more detail, I am working on a parser. The graph's nodes are the grammar productions, and by referring to another nonterminal they are linking to another production. What I want to do is process the grammar in different ways: for example, simplifying it or eliminating unreferenced productions. Most of the times, it's easy to traverse everything, but there are some special cases, where I have to propagate production attributes "upwards". Using ets as Thomas suggested is probably easiest, and another easy to implement solution is to repeatedly traversing all nodes until there are no more changes. I think I didn't see those before because I was locked on finding a completely functional solution. It should be possible and now it has become an intellectual chalenge. Thanks for the answers! Vlad From vlad_dumitrescu@REDACTED Wed May 25 20:02:04 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 25 May 2005 20:02:04 +0200 Subject: removing last element from the list References: <4294B84D.3030505@web.am> Message-ID: ----- Original Message ----- From: "Gaspar Chilingarov" > I need to implement something like FIFO, new elements inserted in list > push old elements out. Try the queue module, it does what you want and it's interesting to look at the implementation. /Vlad From tony@REDACTED Wed May 25 20:09:38 2005 From: tony@REDACTED (Tony Rogvall) Date: Wed, 25 May 2005 20:09:38 +0200 Subject: Traversing graphs In-Reply-To: References: Message-ID: 25 maj 2005 kl. 15.50 skrev Vlad Dumitrescu: > Hi all, > > I just hit a problem where I clearly see how simple it would be > with lazy evaluation. But since we don't have that, I wonder if > anyone could point me to some non-lazy algorithms. > By working a bit, lazy evaluation can be done... (WARNING do not use in real apps ;-) For example using the macros: -define(delay(X), fun() -> (X) end). -define(force(X), force((X))). force(F) when function(F) -> F(); force(V) -> V. You can define a lazy algorithms (can of course only be used in this context) zeros() -> [0 | ?delay(zeros())]. ones() -> [1 | ?delay(ones())]. twos() -> [2 | ?delay(ones())]. seq(Start) -> [Start | ?delay(seq(Start+1))]. sieve1(L, P) -> [N | T1] = ?force(L), case N rem P of 0 -> sieve1(T1,P); _ -> sieve([N | ?delay(sieve1(T1,P))]) end. sieve(L) -> [P | X] = ?force(L), [P | ?delay(sieve1(X, P))]. primes() -> sieve(seq(2)). Regards /Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Wed May 25 20:13:46 2005 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 25 May 2005 14:13:46 -0400 Subject: removing last element from the list In-Reply-To: <4294B84D.3030505@web.am> References: <4294B84D.3030505@web.am> Message-ID: <4294C05A.1010102@hq.idt.net> You can either use the stdlib's queue module or look at the user's contribution of double ended queues: http://erlang.org/user.html#deque-1.0 Serge Gaspar Chilingarov wrote: > Hi all! > > are there any really fast ways to remove last element from list? > > list size is 5-15 elements, but it's not known at compile time. > > I need to implement something like FIFO, new elements inserted in list > push old elements out. > > now it looks line > NewList = [ Elem | lists:sublist(List, N-1)] > > which probably is not the best way. From svg@REDACTED Wed May 25 20:15:34 2005 From: svg@REDACTED (Vladimir Sekissov) Date: Thu, 26 May 2005 00:15:34 +0600 (YEKST) Subject: removing last element from the list In-Reply-To: <4294B84D.3030505@web.am> References: <4294B84D.3030505@web.am> Message-ID: <20050526.001534.226777740.svg@surnet.ru> Good day, nm> are there any really fast ways to remove last element from list? nm> nm> list size is 5-15 elements, but it's not known at compile time. nm> nm> I need to implement something like FIFO, new elements inserted in list nm> push old elements out. Look at _queue_ module in standard distribution. Best Regards, Vladimir Sekissov nm> Hi all! nm> nm> are there any really fast ways to remove last element from list? nm> nm> list size is 5-15 elements, but it's not known at compile time. nm> nm> I need to implement something like FIFO, new elements inserted in list nm> push old elements out. nm> nm> now it looks line nm> NewList = [ Elem | lists:sublist(List, N-1)] nm> nm> which probably is not the best way. nm> nm> -- nm> Gaspar Chilingarov nm> System Administrator nm> nm> t +37491 419763 nm> w www.web.am nm> e nm@REDACTED nm> From thomas@REDACTED Wed May 25 22:12:29 2005 From: thomas@REDACTED (Thomas Johnsson) Date: Wed, 25 May 2005 22:12:29 +0200 Subject: Traversing graphs In-Reply-To: References: Message-ID: <4294DC2D.4060800@skri.net> To be precise, this is call-by-name, and not call-by-need (perhaps that is what Tony meant by WARNING?) In call-by-name, a shared delay() value is evaluated every time its value is needed. In call-by-need, the same shared value is evaluated at most once: the first time its value is needed, the shared delay() is updated with the value so that all other usages benefit from that first evaluation. Would be nice to have some basic mechanism in Erlang so that call-by-need could be implemented. It would have to be light weight, updateable, and GC-able. Would probably a disaster to let loose on the unsuspecting Erlang programming community, though (:-) The sieve example works nicely because it needs only call-by-name. In other cases, complexity can easily become exponential when you'd otherwise expect linear time, canonical example here is a tabulated fibonacci: fiblist = [ fib(I) || I <- [0..] ] . fibt(N) -> nth(fiblist,N). fib(0) -> 1 fib(1) -> 1 fib(N) -> fibt(N-1)+fibt(N-2). -- Thomas Tony Rogvall wrote: > > 25 maj 2005 kl. 15.50 skrev Vlad Dumitrescu: > >> Hi all, >> >> I just hit a problem where I clearly see how simple it would be with >> lazy evaluation. But since we don't have that, I wonder if anyone >> could point me to some non-lazy algorithms. >> > > > By working a bit, lazy evaluation can be done... (WARNING do not use > in real apps ;-) > > For example using the macros: > > -define(delay(X), fun() -> (X) end). > > -define(force(X), force((X))). > > force(F) when function(F) -> F(); > force(V) -> V. > > > You can define a lazy algorithms (can of course only be used in this > context) > > zeros() -> > [0 | ?delay(zeros())]. > > ones() -> > [1 | ?delay(ones())]. > > twos() -> > [2 | ?delay(ones())]. > > seq(Start) -> > [Start | ?delay(seq(Start+1))]. > > > sieve1(L, P) -> > [N | T1] = ?force(L), > case N rem P of > 0 -> sieve1(T1,P); > _ -> sieve([N | ?delay(sieve1(T1,P))]) > end. > > sieve(L) -> > [P | X] = ?force(L), > [P | ?delay(sieve1(X, P))]. > > primes() -> > sieve(seq(2)). > > Regards > > /Tony > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From svg@REDACTED Wed May 25 22:16:22 2005 From: svg@REDACTED (Vladimir Sekissov) Date: Thu, 26 May 2005 02:16:22 +0600 (YEKST) Subject: Traversing graphs In-Reply-To: References: <200505251655.34060.mikael.karlsson@creado.com> Message-ID: <20050526.021622.71107671.svg@surnet.ru> Good day, vlad_dumitrescu> What I want to do is process the grammar in different ways: for example, vlad_dumitrescu> simplifying it or eliminating unreferenced productions. Most of the times, vlad_dumitrescu> it's easy to traverse everything, but there are some special cases, where I vlad_dumitrescu> have to propagate production attributes "upwards". vlad_dumitrescu> I think I didn't see those before because I was locked on vlad_dumitrescu> finding a completely functional solution. It should be possible and now it vlad_dumitrescu> has become an intellectual chalenge. May be it could be easier with continuation-passing style because you don't know every time at upper level would you have some productions to propagate later or not. Something like this(in pseudocode): traverse_node({Node, Content}, UpperCont) -> PartResult = make_what_I_can_at_this_moment(Node), CurrentCont = fun (V) -> compute_node(V, UpperCont, PartResult) end, traverse_content(Content, CurrentCont, []). traverse_content([], NodeCont, Acc) -> NodeCont({nomore, lists:reverse(Acc)}); traverse_content([TreeNode|Rest], NodeCont, Acc) -> Cont = fun (V) -> compute_content_node(V, NodeCont, Rest, Acc) end, traverse_node(TreeNode, Cont). %% node traversing finished compute_content_node({nomore, Result}, UpperCont, Rest, Acc) -> %% continue with rest of nodes traverse_content(Rest, UpperCont, [Result|Acc]); %% it is the intermediate result, feed it to upper level and return %% new continuation to the current compute_content_node(Other, UpperCont, Rest, Acc) -> NxtUpperCont = UpperCont(Other), fun (V) -> compute_content_node(V, NxtUpperCont, Rest, Acc) end. compute_node(V, UpperCont, PartResult) -> case V of %% lower level finished, we too {nomore, Result} -> finish_computation(Result, PartResult), UpperCont({nomore, finish_computation(Result, PartResult)}); %% do intermidiate computation, return next continuation ForMe -> NxtResult = part_computation(ForMe, PartResult), fun (NxtV) -> compute_node(NxtV, UpperCont, NxtResult) end; %% propogate information to upper level, return next continuation ForYou -> NxtUpperCont = UpperCont(ForYou), fun (NxtV) -> compute_node(NxtV, NxtUpperCont, PartResult) end end. Best Regards, Vladimir Sekissov From ok@REDACTED Thu May 26 08:44:41 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 26 May 2005 18:44:41 +1200 (NZST) Subject: removing last element from the list Message-ID: <200505260644.j4Q6ifWZ231993@atlas.otago.ac.nz> Gaspar Chilingarov wrote: are there any really fast ways to remove last element from list? No. However, there _is_ the standard "functional" representation for queues: hi_add(X, {L,R}) -> {[X|L],R}. hi_rem({[X|L],R}) -> {X, {L,R}}; hi_rem({[],[X|R]} -> hi_rem(reverse([X|R])). lo_add(X, {L,R}) -> {L,[X|R]}. lo_rem({L,[X|R]}) -> {X, {L,R}}; lo_rem({[X|L],[]}) -> lo_rem(reverse([X|L])). q_len({L,R}) -> length(L) + length(R). q_empty({[],[]}) -> true; q_empty(_) -> false. I need to implement something like FIFO, new elements inserted in list push old elements out. Use the data structure above. Use lo_add/2 to add new elements Q1 = lo_add(Elem, Q0) and hi_rem/2 to remove old elements {Elem, Q1} = hi_rem(Q0) Or of course you could use hi_add/2 to add and lo_rem/2 to remove. This isn't constant time, but it is constant _average_ time when used as a queue. You do O(1) work to add an element and O(1) work *per element* to reverse the list, although the peak cost per removal is O(|q_len|). From ok@REDACTED Thu May 26 09:25:50 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 26 May 2005 19:25:50 +1200 (NZST) Subject: removing last element from the list Message-ID: <200505260725.j4Q7Powj233969@atlas.otago.ac.nz> Whoops. hi_rem({[X|L],R}) -> {X, {L,R}}; hi_rem({[],[X|R]} -> hi_rem(reverse([X|R])). should be hi_rem({[X|L],R}) -> {X, {L,R}}; hi_rem({[],[X|R]} -> hi_rem({reverse([X|R]),[]}). and lo_rem({L,[X|R]}) -> {X, {L,R}}; lo_rem({[X|L],[]}) -> lo_rem(reverse([X|L])). should be lo_rem({L,[X|R]}) -> {X, {L,R}}; lo_rem({[X|L],[]}) -> lo_rem({[], reverse([X|L])}). Untested code, OK? I hope the idea was clear anyway. From raimo@REDACTED Thu May 26 09:28:19 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 26 May 2005 09:28:19 +0200 Subject: removing last element from the list References: <4294B84D.3030505@web.am>, <4294C05A.1010102@hq.idt.net> Message-ID: The functionality from deque-1.0 has been incorporated in the queue module since R9C, except that to keep the data structure backwards compatible; the length data field had to be left out. So e.g the queue:len() operation runs in O(N) instead of O(1). Maybe some other odd operations also are affected by this missing field. serge@REDACTED (Serge Aleynikov) writes: > You can either use the stdlib's queue module or look at the user's > contribution of double ended queues: > > http://erlang.org/user.html#deque-1.0 > > Serge > > Gaspar Chilingarov wrote: > > Hi all! > > are there any really fast ways to remove last element from list? > > list size is 5-15 elements, but it's not known at compile time. > > I need to implement something like FIFO, new elements inserted in > > list push old elements out. > > now it looks line > > NewList = [ Elem | lists:sublist(List, N-1)] > > which probably is not the best way. > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo@REDACTED Thu May 26 09:55:27 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 26 May 2005 09:55:27 +0200 Subject: removing last element from the list References: <200505260644.j4Q6ifWZ231993@atlas.otago.ac.nz> Message-ID: That is a good implementation of a fifo queue. In fact it is the one the queue module in Erlang/OTP uses :-) ok@REDACTED (Richard A. O'Keefe) writes: > Gaspar Chilingarov wrote: > are there any really fast ways to remove last element from list? > > No. However, there _is_ the standard "functional" representation for > queues: > > hi_add(X, {L,R}) -> {[X|L],R}. > > hi_rem({[X|L],R}) -> {X, {L,R}}; > hi_rem({[],[X|R]} -> hi_rem(reverse([X|R])). > > lo_add(X, {L,R}) -> {L,[X|R]}. > > lo_rem({L,[X|R]}) -> {X, {L,R}}; > lo_rem({[X|L],[]}) -> lo_rem(reverse([X|L])). > > q_len({L,R}) -> length(L) + length(R). > > q_empty({[],[]}) -> true; > q_empty(_) -> false. > > I need to implement something like FIFO, > new elements inserted in list push old elements out. > > Use the data structure above. Use lo_add/2 to add new elements > Q1 = lo_add(Elem, Q0) > and hi_rem/2 to remove old elements > {Elem, Q1} = hi_rem(Q0) > Or of course you could use hi_add/2 to add and lo_rem/2 to remove. > > This isn't constant time, but it is constant _average_ time when used > as a queue. You do O(1) work to add an element and O(1) work *per element* > to reverse the list, although the peak cost per removal is O(|q_len|). > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From klacke@REDACTED Thu May 26 12:36:54 2005 From: klacke@REDACTED (klacke@REDACTED) Date: Thu, 26 May 2005 12:36:54 +0200 Subject: removing last element from the list In-Reply-To: References: <200505260644.j4Q6ifWZ231993@atlas.otago.ac.nz> Message-ID: <20050526103654.GA9350@hyber.org> On Thu, May 26, 2005 at 09:55:27AM +0200, Raimo Niskanen wrote: > That is a good implementation of a fifo queue. In fact it is > the one the queue module in Erlang/OTP uses :-) It is good. The technique if amortizing the cost of an operation such as removing the last item of a queue and sort of "remember the previous work" can be used on many datastructures. Chris Okasaki wrote an entire book on that topic. http://www.amazon.co.uk/exec/obidos/ASIN/0521663504/qid=1117104079/sr=1-1/ref=sr_1_0_1/026-4716218-1856429 Most of the code in the Okasaki book amortize the cost of reversal of lists. The same idea can sometimes be applied to integer arithmetcs as well. Look at user contrib http://www.erlang.org/user.html#anal-1.0 /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control From vlad_dumitrescu@REDACTED Thu May 26 15:40:55 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Thu, 26 May 2005 15:40:55 +0200 Subject: Traversing graphs References: <200505251655.34060.mikael.karlsson@creado.com> <20050526.021622.71107671.svg@surnet.ru> Message-ID: From: "Vladimir Sekissov" > May be it could be easier with continuation-passing style Yes, that's a good idea. I will look at it. Maybe my main problem is that I try to wite a general mapfold-like function, when it would be easier to do it in several steps. For example first mark some nodes with attributes, then transform the graph according to the markings. Thanks again! /Vlad From raimo@REDACTED Thu May 26 09:28:19 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 26 May 2005 09:28:19 +0200 Subject: removing last element from the list References: <4294B84D.3030505@web.am>, <4294C05A.1010102@hq.idt.net> Message-ID: The functionality from deque-1.0 has been incorporated in the queue module since R9C, except that to keep the data structure backwards compatible; the length data field had to be left out. So e.g the queue:len() operation runs in O(N) instead of O(1). Maybe some other odd operations also are affected by this missing field. serge@REDACTED (Serge Aleynikov) writes: > You can either use the stdlib's queue module or look at the user's > contribution of double ended queues: > > http://erlang.org/user.html#deque-1.0 > > Serge > > Gaspar Chilingarov wrote: > > Hi all! > > are there any really fast ways to remove last element from list? > > list size is 5-15 elements, but it's not known at compile time. > > I need to implement something like FIFO, new elements inserted in > > list push old elements out. > > now it looks line > > NewList = [ Elem | lists:sublist(List, N-1)] > > which probably is not the best way. > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From ok@REDACTED Thu May 26 08:44:41 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 26 May 2005 18:44:41 +1200 (NZST) Subject: removing last element from the list Message-ID: <200505260644.j4Q6ifWZ231993@atlas.otago.ac.nz> Gaspar Chilingarov wrote: are there any really fast ways to remove last element from list? No. However, there _is_ the standard "functional" representation for queues: hi_add(X, {L,R}) -> {[X|L],R}. hi_rem({[X|L],R}) -> {X, {L,R}}; hi_rem({[],[X|R]} -> hi_rem(reverse([X|R])). lo_add(X, {L,R}) -> {L,[X|R]}. lo_rem({L,[X|R]}) -> {X, {L,R}}; lo_rem({[X|L],[]}) -> lo_rem(reverse([X|L])). q_len({L,R}) -> length(L) + length(R). q_empty({[],[]}) -> true; q_empty(_) -> false. I need to implement something like FIFO, new elements inserted in list push old elements out. Use the data structure above. Use lo_add/2 to add new elements Q1 = lo_add(Elem, Q0) and hi_rem/2 to remove old elements {Elem, Q1} = hi_rem(Q0) Or of course you could use hi_add/2 to add and lo_rem/2 to remove. This isn't constant time, but it is constant _average_ time when used as a queue. You do O(1) work to add an element and O(1) work *per element* to reverse the list, although the peak cost per removal is O(|q_len|). From ok@REDACTED Thu May 26 09:25:50 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 26 May 2005 19:25:50 +1200 (NZST) Subject: removing last element from the list Message-ID: <200505260725.j4Q7Powj233969@atlas.otago.ac.nz> Whoops. hi_rem({[X|L],R}) -> {X, {L,R}}; hi_rem({[],[X|R]} -> hi_rem(reverse([X|R])). should be hi_rem({[X|L],R}) -> {X, {L,R}}; hi_rem({[],[X|R]} -> hi_rem({reverse([X|R]),[]}). and lo_rem({L,[X|R]}) -> {X, {L,R}}; lo_rem({[X|L],[]}) -> lo_rem(reverse([X|L])). should be lo_rem({L,[X|R]}) -> {X, {L,R}}; lo_rem({[X|L],[]}) -> lo_rem({[], reverse([X|L])}). Untested code, OK? I hope the idea was clear anyway. From raimo@REDACTED Thu May 26 09:55:27 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 26 May 2005 09:55:27 +0200 Subject: removing last element from the list References: <200505260644.j4Q6ifWZ231993@atlas.otago.ac.nz> Message-ID: That is a good implementation of a fifo queue. In fact it is the one the queue module in Erlang/OTP uses :-) ok@REDACTED (Richard A. O'Keefe) writes: > Gaspar Chilingarov wrote: > are there any really fast ways to remove last element from list? > > No. However, there _is_ the standard "functional" representation for > queues: > > hi_add(X, {L,R}) -> {[X|L],R}. > > hi_rem({[X|L],R}) -> {X, {L,R}}; > hi_rem({[],[X|R]} -> hi_rem(reverse([X|R])). > > lo_add(X, {L,R}) -> {L,[X|R]}. > > lo_rem({L,[X|R]}) -> {X, {L,R}}; > lo_rem({[X|L],[]}) -> lo_rem(reverse([X|L])). > > q_len({L,R}) -> length(L) + length(R). > > q_empty({[],[]}) -> true; > q_empty(_) -> false. > > I need to implement something like FIFO, > new elements inserted in list push old elements out. > > Use the data structure above. Use lo_add/2 to add new elements > Q1 = lo_add(Elem, Q0) > and hi_rem/2 to remove old elements > {Elem, Q1} = hi_rem(Q0) > Or of course you could use hi_add/2 to add and lo_rem/2 to remove. > > This isn't constant time, but it is constant _average_ time when used > as a queue. You do O(1) work to add an element and O(1) work *per element* > to reverse the list, although the peak cost per removal is O(|q_len|). > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From csanto@REDACTED Thu May 26 19:20:58 2005 From: csanto@REDACTED (Corrado Santoro) Date: Thu, 26 May 2005 19:20:58 +0200 Subject: Error in http client Message-ID: <4296057A.1010303@diit.unict.it> Corrado Santoro wrote: > Ingela Anderton wrote: > > Both > > > > http:request(get, {"http://www.google.com", []}, [], []). > > > > and > > > > http:request(get, {"http://www.google.se", []}, [], []). > > > > works fine for me on the latest version, that is inets-4.4.1. However I do > > not think this version made it to open source yet! > Well, if I issue the call from the Erlang shell, it works. So I think > the problem is with the integration with my program. For this purpose, > I'm spawining several Erlang processes each one making its own > 'http:request' call. Is it a problem for the http module? I mean, is > 'http:request' process-safe? No that is not a problem for the http-client! If you have only one processes making asynchronous http-requests or many processes making synchronous request will not make a difference. Of course to be able to handle the pipelining concept all request have to go through the manager process which will spawn a request handling process for each request unless it is pipelined and then handled by a previously spawned process. In the current implementation there is no user profiles which could make the manager process a little of a bottleneck. (When you have user profiles you would get one manager per profile). The code however is written to be easy to extend with user profiles and that is a thing we most probably will add in future release of inets. I am not a 100 % sure but I think that your problem could be related to a pipeline bug that we fixed just recently. The bug manifested itself by returning {error, session_remotly_closed} for a request that the manager wrongly tried to pipeline. -- /Ingela - OTP team From nm@REDACTED Thu May 26 19:55:21 2005 From: nm@REDACTED (Gaspar Chilingarov) Date: Thu, 26 May 2005 22:55:21 +0500 Subject: removing last element from the list In-Reply-To: References: <4294B84D.3030505@web.am>, <4294C05A.1010102@hq.idt.net> Message-ID: <42960D89.4040104@web.am> Thanks to all. I got the point and it was the same what I suspect - there is no way to avoiding reversing list :) -- Gaspar Chilingarov System Administrator t +37491 419763 w www.web.am e nm@REDACTED From heinrich@REDACTED Fri May 27 14:35:40 2005 From: heinrich@REDACTED (Heinrich Venter) Date: Fri, 27 May 2005 14:35:40 +0200 Subject: Orber server and client test Message-ID: Hi I am busy writing an application that eventually will use CORBA to communicate with a server hosted by an external orginisation. In order to test my application I am writing a simple server simulator. I have run into the following oddity. I start the server and create an object. I retreive the IOR of this object with corba:object_to_tring(Obj), since this is the way I will interface with the external server. I then use this IOR to create an object in my application. When I use this object in my application, I get an exception: {'OBJECT_NOT_EXIST',[],1163001856,'COMPLETED_NO'} On my client side, the result of corba_object:is_remote(Obj) is false, which is not correct if I understand things correctly. To creat the object I simply to Obj = corba:string_to_object(IOR). When I do the corresponding 'RAB_Manger':executeTransaction(Obj, Request) I get the exception mentioned before. Am I doing something obvious wrong or missing a step? -]-[ Alt = iFind ? Visit our website here http://asp1.rocketseed.com/RocketSeed/mail/433a32353a313332363937383a33303639373a2d323a353137 Launchpad - View our website here http://asp1.rocketseed.com/RocketSeed/mail/433a32353a313332363937383a33303639373a2d323a333738 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MTk2LjMwLjc5LjE1NQ== Type: image/gif Size: 15658 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MTk2LjMwLjc5LjE1NQ== Type: image/gif Size: 620 bytes Desc: not available URL: From thomasl_erlang@REDACTED Fri May 27 15:41:03 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 27 May 2005 06:41:03 -0700 (PDT) Subject: Traversing graphs In-Reply-To: 6667 Message-ID: <20050527134104.55979.qmail@web41905.mail.yahoo.com> --- Vlad Dumitrescu wrote: > From: "Vladimir Sekissov" > > May be it could be easier with > continuation-passing style > > Yes, that's a good idea. I will look at it. > > Maybe my main problem is that I try to wite a > general mapfold-like function, > when it would be easier to do it in several steps. > For example first mark > some nodes with attributes, then transform the graph > according to the > markings. That is, in my experience, often a good idea. (You can usually mangle the code later if it turns out to be costly.) When working with graphs, the primary problem is representation IMO. I work with small or medium-sized graphs (usually 100-1000 nodes or so) and like using functional representations (no ets tables), so it's usually dictionaries mapping (NodeName -> [Successor]) or the equivalent. When speed is desired, using a tuple with node name = argument position can be fast enough. (This is essentially just representing the graph as a vector. You can split the vector into several ones too, e.g., one vector for predecessors, one for successors, one for content.) (Note that element/2 on a tuple should be faster than doing an ets hash lookup too.) Writing graph programs: - consider writing higher-order functions on graphs - if using a functional representation, batch requests and rebuild the graph afterwards. For sane debugging, it might be a good idea regardless of representation :-) - you will usually need a set of "already-visited" nodes when doing a traversal; pass this as a parameter. Here is a depth-first traversal that transforms a state as it goes along: traverse(Node, State, Visited, Graph) -> case visited(Node, Visited) of true -> {State, Visited}; false -> Ns = successors(Node, Graph), NewVisited = visit(Node, Visited), NewState = transform_state(Node, Graph, State), traverse_all(Ns, NewState, NewVisited, Graph) end. assuming appropriate implementations of the operations. - I have also found the following to be a practical idiom: have functions to list the graph nodes in useful orders, then use that list to fold some operation over the graph. - encapsulate the graph representation as an ADT, so that you can at least somewhat easily change representations. (I haven't found a useful "generic" ADT for graphs, since some representations need more managing than others, but you can at least reduce the pain.) Best, Thomas __________________________________ Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html From ulf.wiger@REDACTED Fri May 27 15:42:51 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 27 May 2005 15:42:51 +0200 Subject: implementation of suffix Message-ID: The implementation of lists:suffix/2 is as follows: suffix(Suffix, Suffix) -> true; suffix(Suffix, [_|Tail]) -> suffix(Suffix, Tail); suffix(_, []) -> false. The programming style in lists.erl seems to be to be very conservative about using type guards. One objection to this could be that it makes it more difficult for Dialyzer to derive good type information from one of the most frequently used modules, but in the case of suffix/2, I would say that it also violates the Principle of Least Astonishment: (n@REDACTED)13> lists:suffix(a,[1,2,3|a]). true (n@REDACTED)14> lists:suffix(b,[1,2,3|a]). ** exited: {function_clause,[{lists,suffix,[b,a]}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** =ERROR REPORT==== 27-May-2005::15:36:23 === Error in process <0.95.0> on node 'n@REDACTED' with exit value: {function_clause,[{lists,suffix,[b,a]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} Bug or feature? /Uffe From vlad_dumitrescu@REDACTED Fri May 27 19:55:34 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 27 May 2005 19:55:34 +0200 Subject: Traversing graphs References: <20050527134104.55979.qmail@web41905.mail.yahoo.com> Message-ID: ----- Original Message ----- From: "Thomas Lindgren" > Writing graph programs: > [...snipped lots of good advice...] Thanks! Very useful! /Vlad From nick@REDACTED Fri May 27 22:00:16 2005 From: nick@REDACTED (Niclas Eklund) Date: Fri, 27 May 2005 22:00:16 +0200 (MEST) Subject: Orber server and client test In-Reply-To: Message-ID: Hello Heinrich! To begin with, Orber support several ways of debugging user applications. You can set the following configuration parameters: * orber_debug_level 10 * interceptors {native, [orber_iiop_tracer_silent]} You can read more about these parameters via: http://www.erlang.se/doc/doc-5.4.3/lib/orber-3.5.3/doc/html/ch_install.html#5 http://www.erlang.se/doc/doc-5.4.3/lib/orber-3.5.3/doc/html/ch_debugging.html#14 The latter also include a FAQ section about common mistakes. The way you described the problem, I guess that your currently using Orber<->Orber communication with the same 'domain' variable set (default is "ORBER")?! The easiest way to find out the current configuration is to invoke orber:info(). /Nick PS This link will probably also come in handy: http://www.erlang.org/ml-archive/erlang-questions/200302/msg00437.html You should also consider using Orber Light IFR (see Orber Environment Flags) and the IC compile option {light_ifr, true} to reduce compile time and memory usage. DS > Hi > > I am busy writing an application that eventually will use CORBA to > communicate with a server hosted by an external orginisation. In order > to test my application I am writing a simple server simulator. I have > run into the following oddity. > > I start the server and create an object. I retreive the IOR of this > object with corba:object_to_tring(Obj), since this is the way I will > interface with the external server. > I then use this IOR to create an object in my application. When I use > this object in my application, I get an exception: > {'OBJECT_NOT_EXIST',[],1163001856,'COMPLETED_NO'} > > On my client side, the result of corba_object:is_remote(Obj) is false, > which is not correct if I understand things correctly. > > To creat the object I simply to Obj = corba:string_to_object(IOR). > When I do the corresponding 'RAB_Manger':executeTransaction(Obj, > Request) I get the exception mentioned before. > > Am I doing something obvious wrong or missing a step? > > -]-[ > > > Alt = iFind ? Visit our website here > http://asp1.rocketseed.com/RocketSeed/mail/433a32353a313332363937383a33303639373a2d323a353137 > > Launchpad - View our website here > http://asp1.rocketseed.com/RocketSeed/mail/433a32353a313332363937383a33303639373a2d323a333738 > _________________________________________________________________ We Are The ORBs. Resistance Is Futile. Prepare To Be Assimilated! _________________________________________________________________ This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you. E-mail including attachments is susceptible to data corruption, interruption, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof. _________________________________________________________________ From raimo@REDACTED Mon May 30 00:49:24 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 30 May 2005 00:49:24 +0200 Subject: Webserver up again Message-ID: The www.erlang.org and www.erlang.se webservers are now up and running again. They were down from May 28 04:30 to May 30 00:30 (local time) due to misconfigation that made restart after automatic log rotation fail. (webserver upgrade...) Sorry for any inconvenience. -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From tpatro@REDACTED Mon May 30 10:15:42 2005 From: tpatro@REDACTED (Tamas Patrovics) Date: Mon, 30 May 2005 10:15:42 +0200 Subject: ESense 1.2 released Message-ID: Changes https://sourceforge.net/forum/forum.php?forum_id=469818 Files https://sourceforge.net/projects/esense/ Homepage http://esense.sourceforge.net/ Thanks to the contributions of Andrey Grigoriev this release of ESense also works on Windows (tested with GNU Emacs 22). You can contact him if you have Windows-related problems with ESense. His address is in the CC header. If someone manages to make ESense work with XEmacs he/she can send me patches like Andrey did for Windows and I'll include it in the official version. /Tamas From dietmar@REDACTED Mon May 30 15:38:18 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Mon, 30 May 2005 15:38:18 +0200 Subject: tv Message-ID: <429B174A.5030600@ast.dfs.de> Hi ! Trying to resize the table viewer window I got: =ERROR REPORT==== 30-May-2005::13:35:01 === Error in process <0.276.0> on node 'cmmc@REDACTED' with exit value: {function_clause,[{lists,nthtail,[2,[]]},{tv_pg_gridfcns,resize_grid,3},{tv_pg,loop,1}]} Internal error... restarting. message received transaction setFlightInfo transaction setFlightInfo completet which was repeatable (cmmc@REDACTED)3> =ERROR REPORT==== 30-May-2005::13:36:00 === Error in process <0.573.0> on node 'cmmc@REDACTED' with exit value: {function_clause,[{lists,nthtail,[2,[]]},{tv_pg_gridfcns,resize_grid,3},{tv_pg,loop,1}]} Internal error... restarting. regards Dietmar From ft@REDACTED Mon May 30 15:39:29 2005 From: ft@REDACTED (Fredrik Thulin) Date: Mon, 30 May 2005 15:39:29 +0200 Subject: distributed Erlang connect fails Message-ID: <200505301539.29284.ft@it.su.se> Hi I'm writing a command-line control tool for my application. I get into problems if I execute my control-tool rapidly (like pressing up-arrow and then enter in the UNIX shell). I've traced this down to the dist_util module, where the running node does not know that the control-tool-node has terminated, so when the control-tool-node connects the second time, the running node enters wait_pending/1, but most oftenly never returns from there because the timer fires first (the "Connection setup timeout timer" timer, started by dist_util:start_timer/1). What is the problem here? a) that the running node is not notified when the control-tool-node exits - should I do something for this to happen? I've tried erlang:disconnect_node(RunningNode) before terminating, as well as stopping the control-tool-node through init:stop() instead of erlang:halt/1. Doesn't help. b) the problem is that the timer fires. When I first enabled tracing by defining dist_trace and dist_debug in dist_util.hrl it started working every time (although it could take quite a few seconds for the nodes to connect). This turned out to be because when dist_trace is defined, the timer's timeout is multiplied by eight. Running R10B-5 and -proto_dist inet_ssl on Linux 2.4. /Fredrik From A.BETIS@REDACTED Mon May 30 17:47:39 2005 From: A.BETIS@REDACTED (BETIS Alexandre) Date: Mon, 30 May 2005 17:47:39 +0200 Subject: ASN1: vicious bug when using recursive message definitions Message-ID: Hi all, I have encountered a bug in the asn1rt:decode() function when using 'recursive' message definition. Like this: ----------------------------- Bug DEFINITIONS ::= BEGIN Msg ::= SEQUENCE { header INTEGER, body Body } Body ::= CHOICE { anInt [0] INTEGER, aSubBody [1] ASubBody, aNull [2] NULL } ASubBody ::= SEQUENCE { body Body, anInt INTEGER } END ------------------------------ Body appears in the subBody. It is quite useful for "reply" messages (we can include the initial message in the body of the reply message). This is encoded fine, but the decode function fails when the subbody is NULL, and it seems only in this case. Here is a sample code: ------------------------------ -module(bug). -export([test/0]). -include("Bug.hrl"). test() -> Msg0 = #'Msg'{header = 1, body = {aSubBody, #'ASubBody'{body = {anInt, 1}, anInt = 3}}}, {ok, Bytes0} = asn1rt:encode('Bug', 'Msg', Msg0), {ok, Msg0} = asn1rt:decode('Bug', 'Msg', Bytes0), %% ok Msg2 = #'Msg'{header = 1, body = {aSubBody, #'ASubBody'{body = {aNull, 'NULL'}, anInt = 3}}}, {ok, Bytes1} = asn1rt:encode('Bug', 'Msg', Msg2), Msg2 = asn1rt:decode('Bug', 'Msg', Bytes1), %%%%%%%%%%%%%%%%%%%% FAILS!!! ok. ------------------------------- Sample session: Erlang (BEAM) emulator version 5.4.4 [source] [hipe] Eshell V5.4.4 (abort with ^G) 1> c(bug). {ok,bug} 2> bug:test(). =ERROR REPORT==== 30-May-2005::16:46:42 === Error in process <0.30.0> with exit value: {{badmatch,{error,{asn1,{unexpected,<<3 bytes>>}}}}, [{bug,test,0},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} ** exited: {{badmatch,{error,{asn1,{unexpected, <<2,1,3>>}}}}, [{bug,test,0}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** 3> Apparently, this has something to do with the size of Null being 0, but I have yet to identify where the problem is in the code. Has anybody ever encountered this problem? In the meantime, we will forget about NULL... Thanks! -- Alex " Ce message et ses pi?ces jointes sont confidentiels et exclusivement r?serv?s ? leurs destinataires qui s'assureront de l'absence de virus. CSEE Transport n'assume aucune responsabilit? au titre de ce message s'il est alt?r?, d?form?, falsifi?, ind?ment utilis? par des tiers ou encore s'il a caus? des dommages ou pertes de toute nature. This e-mail and any attached files are confidential and exclusively intended for its addressees who will conduct appropriate virus checks. CSEE Transport shall not be liable for the message if altered, changed, falsified, unduly used by third parties nor for any damage or loss." From enriirne@REDACTED Tue May 31 10:23:41 2005 From: enriirne@REDACTED (Enri Enri) Date: Tue, 31 May 2005 10:23:41 +0200 (CEST) Subject: Questions about records Message-ID: <20050531082341.33118.qmail@web25608.mail.ukl.yahoo.com> Hello, in the Erlang Documentation there is this sentence: "Therefore, record expressions are not understood by the shell unless special actions are taken. See shell(3) for details" Where is "shell(3)"? I presume there is explained how to import record definition into the shell, right? Also, is there an updated grammar? I'm using the bnf grammar on Joe's book, but perhaps it's old. See this: 15 function_call := "atom" "(" parameter_list ")" But this also works: {erlang,round}(3.4) while this doesn't: -record(t, {x}). f1() -> R = #t{x={erlang,round}}, R#t.x(3.4). with parens works: ... (R#t.x)(3.4). Friendly, Enri ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it From matthias@REDACTED Tue May 31 10:40:54 2005 From: matthias@REDACTED (Matthias Lang) Date: Tue, 31 May 2005 10:40:54 +0200 Subject: Questions about records In-Reply-To: <20050531082341.33118.qmail@web25608.mail.ukl.yahoo.com> References: <20050531082341.33118.qmail@web25608.mail.ukl.yahoo.com> Message-ID: <17052.8982.553532.371636@antilipe.corelatus.se> Enri Enri writes: > in the Erlang Documentation there is this sentence: > "Therefore, record expressions are not understood by > the shell unless special actions are taken. See > shell(3) for details" > Where is "shell(3)"? same place as all the other man pages: http://www.erlang.se/doc/doc-5.4.3/lib/stdlib-1.13.3/doc/html/shell.html some people find this page useful for finding specific modules: http://www.corelatus.com/~matthias/modules.html others prefer to use mouse-menus: http://www.trapexit.org/docs/man_page.yaws?page=man_R10B-2/man3/shell.3 Matthias From bengt.kleberg@REDACTED Tue May 31 10:42:51 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 31 May 2005 10:42:51 +0200 Subject: Questions about records In-Reply-To: <20050531082341.33118.qmail@web25608.mail.ukl.yahoo.com> References: <20050531082341.33118.qmail@web25608.mail.ukl.yahoo.com> Message-ID: <429C238B.9010204@ericsson.com> On 2005-05-31 10:23, Enri Enri wrote: > Hello, > > in the Erlang Documentation there is this sentence: > "Therefore, record expressions are not understood by > the shell unless special actions are taken. See > shell(3) for details" > Where is "shell(3)"? I presume there is explained how > to import record definition into the shell, right? shell(3) means the 3;rd chapter of the man pages, the entry for 'shell'. see http://www.trapexit.org/docs/ (to the left) for 'man pages' and follow the expanding menues via 'man3' to 'shell'. > Also, is there an updated grammar? I'm using the bnf > grammar on Joe's book, but perhaps it's old. See this: > > 15 function_call := "atom" "(" parameter_list ")" > > But this also works: > {erlang,round}(3.4) i think most people on this list tries very hard to forget the latter works. :-) > while this doesn't: > -record(t, {x}). > f1() -> > R = #t{x={erlang,round}}, > R#t.x(3.4). > > with parens works: > ... > (R#t.x)(3.4). presumably the '.' binds looser than '('. ie 'R#t.x(3.4).' is R#t.(x(3.4)). bengt From ke.han@REDACTED Tue May 31 12:13:59 2005 From: ke.han@REDACTED (ke.han) Date: Tue, 31 May 2005 18:13:59 +0800 Subject: gs context menu Message-ID: <429C38E7.60907@redstarling.com> Hello, I am looking to build a new erlang tool and would like to know if the gs menu object can be used as a pop-up (context menu) for example from a list or an edit control. thanks, Jon From ke.han@REDACTED Tue May 31 12:32:33 2005 From: ke.han@REDACTED (ke.han) Date: Tue, 31 May 2005 18:32:33 +0800 Subject: debug tips? Message-ID: <429C3D41.6080207@redstarling.com> I spent about two hours last night debugging a call into mnesia. I finally found my error but it took a very long time to step..step..step through many lines before I found exactly what triggered the mnesia:abort(). The call into mnesia was: mnesia:create_table/2 The problem of course is the return result was simply: {aborted,{bad_type,iserve_callback,disc_copies,'jon1@REDACTED'}} No stack trace...just a return from the shell process. By putting a breakpoint in mnesia_schema and stepping through for a very long time, I was finally able to catch the code which called mnesia:abort(). (There are many places in mnesia_schema where the mnesia:abort() is called). I feel like there must have been a better way to close in on the error than what I did. For example, is there a way to get a report when another process "throws" an error. What if I have no idea, as in this case, how the error was generated..the "error" tuple was simply passed back to the Client process. Any suggestions? thanks, ke han From dietmar@REDACTED Tue May 31 12:51:04 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Tue, 31 May 2005 12:51:04 +0200 Subject: receive after Message-ID: <429C4198.9040803@ast.dfs.de> Hi ! I am just reading http://www.erlang.se/doc/doc-5.4/doc/reference_manual/part_frame.html Using a slight modified version from chapter 6.10 Receive %%%------------------------------------------------------------------- %%% File : test.erl %%% Author : %%% Description : %%% %%% Created : 31 May 2005 by %%%------------------------------------------------------------------- -module(test). -export([test/0]). test() -> receive onhook -> io:format("onhook~n"); {connect, B} -> io:format("connect~n"); <----- after 60000 -> io:format("timeout ~n") end. Trying to compile I get erlc -W +warn_unused_vars +nowarn_shadow_vars +warn_unused_import +debug_info -o../ebin test.erl ./test.erl:19: syntax error before: 'after' ./test.erl:9: function test/0 undefined removing the ; before after it works. regards Dietmar From vlad.xx.dumitrescu@REDACTED Tue May 31 12:57:41 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Tue, 31 May 2005 12:57:41 +0200 Subject: receive after Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE56A@esealmw105.eemea.ericsson.se> From: Dietmar Schaefer >I am just reading http://www.erlang.se/doc/doc-5.4/doc/reference_manual/part_frame.html Hello, There is a type in the documentation, the last clause in a receive or in a case must not have any semicolons after them. BTW, is there a compelling reason why that is so? Why not let all clauses end with semicolon? It's much easier to reorder them by simply copy-and-paste :-) I think I already can guess the answer - the parser would need larger lookahead to understand what's going on... Is it so? regards, Vlad From bjorn@REDACTED Tue May 31 13:15:50 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 31 May 2005 13:15:50 +0200 Subject: receive after In-Reply-To: <429C4198.9040803@ast.dfs.de> References: <429C4198.9040803@ast.dfs.de> Message-ID: Thanks! The example will be corrected in R10B-6. /Bjorn Dietmar Schaefer writes: > Hi ! > > I am just reading > http://www.erlang.se/doc/doc-5.4/doc/reference_manual/part_frame.html > > Using a slight modified version from chapter > > > 6.10 Receive > > > > %%%------------------------------------------------------------------- > %%% File : test.erl > %%% Author : > %%% Description : > %%% > %%% Created : 31 May 2005 by > %%%------------------------------------------------------------------- > -module(test). > -export([test/0]). > > > test() -> > receive > onhook -> > io:format("onhook~n"); > {connect, B} -> > io:format("connect~n"); <----- > after > 60000 -> > io:format("timeout ~n") end. > > > Trying to compile I get > erlc -W +warn_unused_vars +nowarn_shadow_vars +warn_unused_import > +debug_info -o../ebin test.erl > ./test.erl:19: syntax error before: 'after' > ./test.erl:9: function test/0 undefined > > > removing the ; before after it works. > > > > regards > > > Dietmar > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From vlad.xx.dumitrescu@REDACTED Tue May 31 13:17:42 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Tue, 31 May 2005 13:17:42 +0200 Subject: receive after Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE56B@esealmw105.eemea.ericsson.se> > There is a type in the documentation, Of course, I meant a typo... /Vlad From keymon@REDACTED Tue May 31 13:56:37 2005 From: keymon@REDACTED (=?ISO-8859-1?Q?H=E9ctor_Rivas_G=E1ndara?=) Date: Tue, 31 May 2005 13:56:37 +0200 Subject: Reentrant gen_server Message-ID: <23fbe28b71722cf4834a9c4ba96bf7e8@wanadoo.es> Hi, I'm developting a behaviour that implements objects as process. It is based on gen_server, but I want to hide the gen_server API. This object will be eventually called reentrat: the object calls a function passing the This reference as parameter and the funcion calls the object. The problem is that the object is a gen_server so it do not process incoming messages if its handling a call. So: I need to build a server that can be reentrat, I mean, a gen_server that will call himself using gen_server:call. I could use the {noreply, ...} gen_server:reply() solution, but I think that is too complex and ugly take care of call the gen_server:reply. And the worst, sometimes the reentrant call perform changes in the state of the object that are needed before send the reply. So I propose this solution: - Spawn a caller process that really executes the call - Spawn a fake server proccess that will run the server loop using gen_server:enter_loop(), - The server process will redirect all incoming messages to fake server until the caller process does not return. Suggestion? ideas? posible problems? You can test it with the following code: 1> recurrent:start(). {ok,<0.31.0>} 2> recurrent:do_something(recurrent). Received: {something,1,2,3}, From: {<0.29.0>,#Ref<0.0.0.33>}, State: {recurrent, 1, 2} ok 3> recurrent:do_something_concurrent(recurrent). entering loop <0.34.0> <0.35.0> Doing something... calling server...redirecting {'$gen_call',{<0.34.0>,#Ref<0.0.0.41>},{otherthing,1,2,3}} entering loop <0.34.0> <0.35.0> Received: {otherthing,1,2,3}, From: {<0.34.0>,#Ref<0.0.0.41>}, State: {recurrent, 1, 2} server called. ok 4> recurrent:do_something(recurrent). Received: {something,1,2,3}, From: {<0.29.0>,#Ref<0.0.0.50>}, State: {recurrent, 1, 2} ok 5> recurrent:do_something(recurrent). Received: {something,1,2,3}, From: {<0.29.0>,#Ref<0.0.0.55>}, State: {recurrent, 1, 2} ok 6> Code: ----- 8< ------- 8< ------- 8< ------- 8< ------- 8< ------- 8< ------- 8< ------- 8< ------- 8< ------- -module(recurrent). -behaviour(gen_server). %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ % genserver exports -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). % Public exports -export([start/0, do_something/1, do_otherthing/1, do_something_concurrent/1, a_function_with_callback/1]). -record(?MODULE, { value1 = 1, value2 = 2 }). start() -> gen_server:start({local, ?MODULE}, ?MODULE, [], []). do_something_concurrent(Server) -> gen_server:call(Server, {something_concurrent, 1, 2, 3}, 1000). do_something(Server) -> gen_server:call(Server, {something, 1, 2, 3}, 1000). do_otherthing(Server) -> gen_server:call(Server, {otherthing, 1, 2, 3}, 1000). % This function gets the server pid and executes something on it... a_function_with_callback(Server) -> io:format("Doing something... calling server...",[]), % recurrent call do_otherthing(Server), io:format("server called.~n", []). %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ % private API | %~~~~~~~~~~~~~' % Here is the magic. This function spawns a process which will execute the real call noblocking_apply(Module, Function, Arguments, State) -> ServerPid = self(), % Function executed by the process that really will call ConcurrentCall = fun() -> % Execute the function Reply = (catch apply(Module, Function, Arguments)), % send reply to server pid ServerPid!{return_concurrent, self(), Reply} end, ConcurrentPid = spawn_link(ConcurrentCall), % Launch a fake server where redirect all incoming messages FakeServerPid = proc_lib:spawn_link(gen_server, enter_loop, [?MODULE, [], State]), % Redirect all incoming messagees noblocking_loop(ConcurrentPid, FakeServerPid). % This loop will redirect all incoming messages until return_concurrent message is received. noblocking_loop(ConcurrentPid, FakeServerPid) -> io:format("entering loop ~p ~p~n", [ConcurrentPid, FakeServerPid]), receive {return_concurrent, ConcurrentPid, Reply} -> {Reply, gen_server:call(FakeServerPid, return_concurrent)}; Other -> io:format("redirecting ~p~n", [Other]), FakeServerPid!Other, noblocking_loop(ConcurrentPid, FakeServerPid) end. %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ % gen_server callbacks | %~~~~~~~~~~~~~~~~~~~~~~' init(_) -> {ok, #?MODULE{}}. % The concurrent call returned, stop this loop and return state handle_call(return_concurrent, _From, State) -> {stop, normal, State, State}; handle_call({something_concurrent, _X, _Y, _Z}, _From, State) -> {Reply, NewState} = noblocking_apply(?MODULE, a_function_with_callback, [self()], State), {reply, Reply, NewState}; handle_call(Msg, From, State) -> io:format("Received: ~p, From: ~p, State: ~p~n", [Msg, From, State]), {reply, ok, State}. handle_cast(_, State) -> {noreply, State}. terminate(Reason, _) -> Reason. handle_info(_, State) -> {noreply, State}. code_change(_, State, _) -> {ok, State}. ----- 8< ------- 8< ------- 8< ------- 8< ------- 8< ------- 8< ------- 8< ------- 8< ------- 8< ------- -- Greets Keymon From ulf.wiger@REDACTED Tue May 31 14:50:57 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Tue, 31 May 2005 14:50:57 +0200 Subject: Reentrant gen_server Message-ID: Why do you want to make the gen_server reentrant in the first place? You can implement objects in different ways in Erlang, but which way to go depends on what type of object you're dealing with. One of the main benefits you get from using a server process is _exactly_ the behaviour you're currently trying to get around -- namely that it serializes calls, and thereby solves many concurrency problems. Another way to implement objects is to provide a module with a set of APIs that operate on an abstract data type. The 'queue' module is a good example of this. Such a module is reentrant by nature. The thing that makes this safe and efficient is that there is no shared data. Shared data can be nicely abstracted using processes, but then those processes should be designed so that they serialize accesses, rather than being reentrant. Regards, Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of H?ctor Rivas > G?ndara > Sent: den 31 maj 2005 13:57 > To: 'erlang-questions@REDACTED' > Subject: Reentrant gen_server > > > Hi, > > I'm developting a behaviour that implements objects as > process. It is > based on gen_server, but I want to hide the gen_server API. > > This object will be eventually called reentrat: the object calls a > function passing the This reference as parameter and the > funcion calls > the object. The problem is that the object is a gen_server so > it do not > process incoming messages if its handling a call. > > So: I need to build a server that can be reentrat, I mean, a > gen_server > that will call himself using gen_server:call. > > I could use the {noreply, ...} gen_server:reply() solution, > but I think > that is too complex and ugly take care of call the gen_server:reply. > And the worst, sometimes the reentrant call perform changes in the > state of the object that are needed before send the reply. > > So I propose this solution: > - Spawn a caller process that really executes the call > - Spawn a fake server proccess that will run the server > loop using > gen_server:enter_loop(), > - The server process will redirect all incoming > messages to fake > server until the caller process does not return. > > Suggestion? ideas? posible problems? > > You can test it with the following code: > > 1> recurrent:start(). > {ok,<0.31.0>} > 2> recurrent:do_something(recurrent). > Received: {something,1,2,3}, From: {<0.29.0>,#Ref<0.0.0.33>}, State: > {recurrent, > > > 1, > > > 2} > ok > 3> recurrent:do_something_concurrent(recurrent). > entering loop <0.34.0> <0.35.0> > Doing something... calling server...redirecting > {'$gen_call',{<0.34.0>,#Ref<0.0.0.41>},{otherthing,1,2,3}} > entering loop <0.34.0> <0.35.0> > Received: {otherthing,1,2,3}, From: > {<0.34.0>,#Ref<0.0.0.41>}, State: > {recurrent, > > > 1, > > > 2} > server called. > ok > 4> recurrent:do_something(recurrent). > Received: {something,1,2,3}, From: {<0.29.0>,#Ref<0.0.0.50>}, State: > {recurrent, > > > 1, > > > 2} > ok > 5> recurrent:do_something(recurrent). > Received: {something,1,2,3}, From: {<0.29.0>,#Ref<0.0.0.55>}, State: > {recurrent, > > > 1, > > > 2} > ok > 6> > > Code: > > ----- 8< ------- 8< ------- 8< ------- 8< ------- 8< ------- > 8< ------- > 8< ------- 8< ------- 8< ------- > > -module(recurrent). > -behaviour(gen_server). > > %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~~~~~~~~ > ~~~~~~~ > % genserver exports > -export([init/1, handle_call/3, handle_cast/2, > handle_info/2, terminate/2, code_change/3]). > > % Public exports > -export([start/0, do_something/1, do_otherthing/1, > do_something_concurrent/1, a_function_with_callback/1]). > > -record(?MODULE, { > value1 = 1, > value2 = 2 > }). > > start() -> > gen_server:start({local, ?MODULE}, ?MODULE, [], []). > > do_something_concurrent(Server) -> > gen_server:call(Server, {something_concurrent, 1, 2, 3}, 1000). > do_something(Server) -> > gen_server:call(Server, {something, 1, 2, 3}, 1000). > do_otherthing(Server) -> > gen_server:call(Server, {otherthing, 1, 2, 3}, 1000). > > % This function gets the server pid and executes something on it... > a_function_with_callback(Server) -> > io:format("Doing something... calling server...",[]), > % recurrent call > do_otherthing(Server), > io:format("server called.~n", []). > > > %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~~~~~~~~ > ~~~~~~~ > % private API | > %~~~~~~~~~~~~~' > > % Here is the magic. This function spawns a process which > will execute > the real call > noblocking_apply(Module, Function, Arguments, State) -> > ServerPid = self(), > > % Function executed by the process that really will call > ConcurrentCall = fun() -> > % Execute the function > Reply = (catch apply(Module, Function, Arguments)), > % send reply to server pid > ServerPid!{return_concurrent, self(), Reply} > end, > > ConcurrentPid = spawn_link(ConcurrentCall), > > % Launch a fake server where redirect all incoming messages > FakeServerPid = proc_lib:spawn_link(gen_server, > enter_loop, [?MODULE, > [], State]), > > % Redirect all incoming messagees > noblocking_loop(ConcurrentPid, FakeServerPid). > > % This loop will redirect all incoming messages until > return_concurrent > message is received. > noblocking_loop(ConcurrentPid, FakeServerPid) -> > io:format("entering loop ~p ~p~n", [ConcurrentPid, > FakeServerPid]), > receive > {return_concurrent, ConcurrentPid, Reply} -> > {Reply, gen_server:call(FakeServerPid, > return_concurrent)}; > Other -> > io:format("redirecting ~p~n", [Other]), > FakeServerPid!Other, > noblocking_loop(ConcurrentPid, FakeServerPid) > end. > > > > %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~~~~~~~~ > ~~~~~~~ > % gen_server callbacks | > %~~~~~~~~~~~~~~~~~~~~~~' > > init(_) -> > {ok, #?MODULE{}}. > > % The concurrent call returned, stop this loop and return state > handle_call(return_concurrent, _From, State) -> > {stop, normal, State, State}; > > handle_call({something_concurrent, _X, _Y, _Z}, _From, State) -> > {Reply, NewState} = noblocking_apply(?MODULE, > a_function_with_callback, [self()], State), > {reply, Reply, NewState}; > > handle_call(Msg, From, State) -> > io:format("Received: ~p, From: ~p, State: ~p~n", [Msg, > From, State]), > {reply, ok, State}. > > handle_cast(_, State) -> {noreply, State}. > > terminate(Reason, _) -> Reason. > > handle_info(_, State) -> {noreply, State}. > > code_change(_, State, _) -> {ok, State}. > > ----- 8< ------- 8< ------- 8< ------- 8< ------- 8< ------- > 8< ------- > 8< ------- 8< ------- 8< ------- > > > -- > Greets > Keymon > > From olivier@REDACTED Tue May 31 15:23:08 2005 From: olivier@REDACTED (olivier) Date: Tue, 31 May 2005 15:23:08 +0200 Subject: Mnesia storage question Message-ID: <429C653C.9020405@dolphian.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I'm playing with Mnesia to see if i could use it for one of our projects, and have a performance/storage related question. The key to the table will be a fixed structure of N bytes, and i'm wondering which would be the best term for the key: A tuple of size N or a binary ? Thanks for your hints, - -- Olivier -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCnGU7pqVXaJzJYNIRAiYBAKCClymEoeRE4iKWRdFVBDNiNwPfyQCdEhoF ntU1P68bVBYexBudCVmiiL0= =l69u -----END PGP SIGNATURE----- From gerd@REDACTED Tue May 31 16:47:37 2005 From: gerd@REDACTED (Gerd Flaig) Date: Tue, 31 May 2005 16:47:37 +0200 Subject: distributed Erlang connect fails In-Reply-To: <200505301539.29284.ft@it.su.se> (Fredrik Thulin's message of "Mon, 30 May 2005 15:39:29 +0200") References: <200505301539.29284.ft@it.su.se> Message-ID: Fredrik Thulin writes: > I'm writing a command-line control tool for my application. I get > into problems if I execute my control-tool rapidly (like pressing > up-arrow and then enter in the UNIX shell). you could try to assign a unique name to each control tool instance, like in $ erl -name control$$ -hidden -remsh incomingproxy@`hostname -f` That way, you also get the advantage that multiple instances of the control tool can be active at the same time. Goodbyte, Gerd. -- Gerd Flaig Technik gerd@REDACTED Bei Schlund + Partner AG Brauerstra?e 48 D-76135 Karlsruhe Physics is like sex: sure, it may give some practical results, but that's not why we do it. -- Richard Feynman From sebastian@REDACTED Tue May 31 17:17:12 2005 From: sebastian@REDACTED (Sebastian Bello) Date: Tue, 31 May 2005 12:17:12 -0300 Subject: SSL on Windows Message-ID: <00b701c565f3$d36224d0$3000a8c0@INSWITCH244> Hi all, I'm trying to setup SSL with yaws on a Windows box and need some help; I asked at the yaws list, but it seems I need some general guidelines which should be asked here. I downloaded and installed Win32 OpenSSL from Shining Light Productions (http://www.slproweb.com/products/Win32OpenSSL.html) I'm getting a {error,esslerrssl}.What other configuration issues should I take into account? Thanks, Sebastian- Prepaid Expertise - Programmable Switches Powered by Ericsson Licensed Technology Sebasti?n Bello - Engineer - Development Center - IN Switch Solutions Inc. Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 IN SWITCH EMEA Phone: +33 0 6 0335 9427 - Fax: +33 0 4 93655773 / emea@REDACTED IN SWITCH ASIA Phone: +92 51 2800397/8- Fax: +92 51 2800399/ inswasia@REDACTED e-mail: sebastian@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1429 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: logoparafondo.gif Type: image/gif Size: 16886 bytes Desc: not available URL: From tty@REDACTED Tue May 31 21:56:49 2005 From: tty@REDACTED (tty@REDACTED) Date: Tue, 31 May 2005 15:56:49 -0400 Subject: Erlang socket client Message-ID: Hello, I have a remote server (not in Erlang) controlling a hardware device. This server takes plain text commands and echo the command and device responses back. I can connect to it using a simple telnet and interact with the hardware. However when I tried writting an Erlang client all I receive is the echoed command. Even if my client is set to {active, false} and I do the gen_tcp:recv myself I do not obtain the device response. Does anyone have a sample Erlang telnet client or have ideas on how I can go about interacting with this server. Environment: Server is a Python 2.4 server on Windows interacting with a serial modem. Erlang client on a Linux box. BEAM 5.4.4. I'll even consider Erlang interacting with the device directly if need be. Thanks tee From klacke@REDACTED Tue May 31 22:32:58 2005 From: klacke@REDACTED (klacke@REDACTED) Date: Tue, 31 May 2005 22:32:58 +0200 Subject: Erlang socket client In-Reply-To: References: Message-ID: <20050531203258.GA17521@hyber.org> On Tue, May 31, 2005 at 03:56:49PM -0400, tty@REDACTED wrote: > Hello, > > I have a remote server (not in Erlang) controlling a hardware device. This server takes plain text commands and echo the command and device responses back. I can connect to it using a simple telnet and interact with the hardware. > > However when I tried writting an Erlang client all I receive is the echoed command. Even if my client is set to {active, false} and I do the gen_tcp:recv myself I do not obtain the device response. > > Does anyone have a sample Erlang telnet client or have ideas on how I can go about interacting with this server. > If you can interact with the server using telnet, you can surely and easily interact with it using regular erlang gen_tcp:connect(). You're probably doing some simple mistake, maybe the server expects \r\n terminated lines ?? or someuch ?? All {active, X} modes will work just fine. Give us an example of a good telnet session and an example of a bad gen_tcp:connect() session from the erlang shell. /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control From sean.hinde@REDACTED Tue May 31 22:50:27 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Tue, 31 May 2005 21:50:27 +0100 Subject: Erlang socket client In-Reply-To: References: Message-ID: <2BA88D14-2AB9-416A-8ADC-8F1D2BC35897@mac.com> On 31 May 2005, at 20:56, tty@REDACTED wrote: > Hello, > > I have a remote server (not in Erlang) controlling a hardware > device. This server takes plain text commands and echo the command > and device responses back. I can connect to it using a simple > telnet and interact with the hardware. > > However when I tried writting an Erlang client all I receive is the > echoed command. Even if my client is set to {active, false} and I > do the gen_tcp:recv myself I do not obtain the device response. > > Does anyone have a sample Erlang telnet client or have ideas on how > I can go about interacting with this server. This should work. Erlang is pretty good at networking :) Are you sure that you are receiving everything - maybe another recv after the echo is received is in order. Alternatively, and this is my usual preference, you could use {active, true}, or {active, once} if you are concerned about being flooded. This fits very nicely into the erlang non-blocking process model. > > Environment: > > Server is a Python 2.4 server on Windows interacting with a serial > modem. > > Erlang client on a Linux box. BEAM 5.4.4. > > I'll even consider Erlang interacting with the device directly if > need be. There is a serial client (sl) in the jungerl project on sourceforge, so if you get the Erlang bug and want to re-write the Python part then the tools are there. Sean From keymon@REDACTED Tue May 31 17:21:34 2005 From: keymon@REDACTED (=?ISO-8859-1?Q?H=E9ctor_Rivas_G=E1ndara?=) Date: Tue, 31 May 2005 17:21:34 +0200 Subject: =?ISO-8859-1?Q?Implementing_XPCOM_objects_in_Erlang.__=28Modific?= =?ISO-8859-1?Q?ado_por_H=E9ctor_Rivas_G=E1ndara=29?= Message-ID: <175b6abab905bfbec99bcd3a33afd735@wanadoo.es> El 31/05/2005, a las 14:50, Ulf Wiger (AL/EAB) escribi?: > Why do you want to make the gen_server reentrant > in the first place? I'm developing the Erlang XPCOM binding. XPCOM is component tecnology similar to COM used in Mozilla internals. A lot of interfaces of mozilla receives an object as parameter and execute callbacks on it. My first option was implement the component instances as processes. > Another way to implement objects is to provide a module > with a set of APIs that operate on an abstract data type. That's the other option. If the object is readonly or it will be accesed only by the C++ side (the C++ will never do concurrent calls), there is no problem, but there are some otherwise: - The object will occasionally be passed to the XPCOM side (in C++). - so a reference to it must be created and the object will be stored in an ORB to allow the C++ side reference it. - I can't known when the C++ side (or even a local process) will call the object and change the object state. I mean, I can't control the object access to follow the single assignment rules. One solution can be create an "object dictionary" with entries like ObjectReference-ObjectState. But this have more problems: - the object support concurrent access (from C++, from Erlang processes) and - must allow reentrant calls. To solve the first I could add some logic to the Object Dictionary to allow lock the object state until a running method does not returns (simulate synchronized methods). But then it is not reentrant, so I should use a monitored lock (the actual process can do reentrant calls). But now I have other problem: If I use a monitored lock the XPCOM-Erlang binding must offer thread consistency (there is a call from Erlang to C++ and back to erlang again, the process must be the same) ... Too complex all. :-/ Anyway, I probably would allow the two options by setting an option in the object creation function. The programmer can choose: - use process objects if the object is not readonly and will be accesed by C++ and Erlang - use record objects if the object is readonly or only accesed by the C++ side. I've implemented my behaviour with callbacks like: method(MethodName, InParams, From, State) -> {Reply, NewState} Reply = {ok, OutParams} | noreply | {error, Reason}. The objects implemented with this callbacks could be easily run with records by simply change the behaviour code: I only need a dictionary that could translate ObjectRefence -> {data, ObjectData} | {process, ObjectPid}. Please, comments / suggestions? -- Greets