From dne@REDACTED Sun Jul 1 02:01:29 2001 From: dne@REDACTED (Daniel =?iso-8859-1?q?N=E9ri?=) Date: 01 Jul 2001 02:01:29 +0200 Subject: Launch and executable file inside an Erlang Program In-Reply-To: <200106301642.f5UGgUm01782@d1o1.telia.com> =?iso-8859-1?q?(H=E5kan?= Stenholm's message of "Sat, 30 Jun 2001 18:44:01 +0200") References: <200106301642.f5UGgUm01782@d1o1.telia.com> Message-ID: <874rsxtt46.fsf@nowhere.mayonnaise.net> H?kan Stenholm writes: > Why not use os:cmd/1, this will run a.out or any other > command/application in unix. While on the subject, apparently os:cmd/1 still has problems with binary output (on Unix), as I noted some time ago[*]. Regards, --Daniel [*] http://www.erlang.org/ml-archive/erlang-questions/200101/msg00127.html -- Daniel Neri dne@REDACTED From salcaraz@REDACTED Sun Jul 1 11:48:20 2001 From: salcaraz@REDACTED (Salvador Alcaraz) Date: Sun, 1 Jul 2001 11:48:20 +0200 (CEST) Subject: Launch and executable file inside an Erlang Program In-Reply-To: Message-ID: I think that Daniel Neri is right: "...apparently os:cmd/1 still has problems with binary output (on Unix)". because, what does happen if execute an application with E/S display instructions?? For example: 1> os:cmd("pine"). Thank you in advance salva On Sat, 30 Jun 2001, Vance Shipley wrote: > > I need that the command/application opens a new shell, execute its > > instrucctions and when finish, it close the shell and return to Erlang > > program. > > Which is exactly what os:cmd/1 does. From the Kernel Refernce Manual > in the section on the os module: > ------------------------------------------------------------------------ > cmd(Command) -> string() > > Types: > Command = string() | atom() > > Executes Command in a command shell of the target OS and returns > the result as a string. > ------------------------------------------------------------------------ > > The emulator will spawn an operating system shell in a new process and > feed it the commands you gave it: > > 1> os:cmd("pwd; times; echo $SHELL"). > "/export/home/vances\n0m0s 0m0s\n/bin/ksh\n" > > -Vance > > Vance Shipley > Motivity Telecom Inc. > +1 519 579 5816 > From matthias@REDACTED Sun Jul 1 23:15:51 2001 From: matthias@REDACTED (matthias@REDACTED) Date: Sun, 1 Jul 2001 23:15:51 +0200 Subject: Launch and executable file inside an Erlang Program In-Reply-To: References: Message-ID: <15167.37639.229368.775685@corelatus.com> Salvador Alcaraz writes: > > I think that Daniel Neri is right: > > "...apparently os:cmd/1 still has problems with > binary output (on Unix)". > > because, what does happen if execute an application with E/S display > instructions?? > > For example: > > 1> os:cmd("pine"). What should erlang do in this situation? Return the escape sequences as a string when 'pine' exits. Not terribly useful. What you probably want it to do is to take over the terminal and run 'pine' until the user quits pine. This seems fraught with problems. A cheesy (or clean, depending on your point of view) way to avoid the problem on X is 2> os:cmd("xterm -e pine"). Messing around with open_port({spawn, "pine"}, ...) and taking care of the io seems impossibly hairy. Trying to get the sub-process to take over the terminal (using {fd, 0, 1}) might be an option if you can live without ^G and ^C and IO for other erlang processes, but I can't figure out the details of getting this to fly (-noshell doesn't seem to be enough). Matthias From jakob@REDACTED Mon Jul 2 15:34:30 2001 From: jakob@REDACTED (Jakob Cederlund =?iso-8859-1?Q?på?= UAB) Date: Mon, 02 Jul 2001 15:34:30 +0200 Subject: Oracle ODBC stored procedure invocation. In-Reply-To: <3B3CF224.D8A748D8@vailsys.com> References: <200106290719.f5T7J1f11082@ms.uab.ericsson.se.> Message-ID: <5.0.2.1.0.20010702152921.00b9eb60@mail> At 16:24 2001-06-29 -0500, you wrote: > > Hello All, > > I am as many of you may know by now working on a project that incolve >ODBC through erlang. Progress is finnaly being made. It turns out though that >we need not execute standard SQL statements but must instead invoke a stored >procedure. I searched the documentation and found nothing mentioned about >this operation. Does anyone know how to execute this operation. Sample code >would be the most helpful to me. > Thanks, > Martin Logan > Software Engineer, Vail Systems. Hi there! To execute a stored procedure in ODBC you have to options: either use a normal SQLExecute or use a special SQL-something for running the procedure (the name has slipped my memory). You usually use the former, and in the case of Erlang ODBC, you have to. How the procedure is invoked depends on whether your using Oracle or SQL Server (or something else). It's simpler on SQL Server (as is everything): Just do "execute my_stored_procedure", and the result is delivered in a result set, returned as it should be by the server. On Oracle, you have provide for the results in other ways. I'll check with the Erlang ODBC programmer whether this is currently done. You use "begin my_package.my_stored_procedure(...); end;" and execute this. How the result is delivered depends on the ODBC driver. It is my belief that Oracle's ODBC driver returns out array parameters in a result set, but I'm out on a limb here. Hope this helps. /Jakob From arndt@REDACTED Wed Jul 4 14:06:02 2001 From: arndt@REDACTED (Arndt Jonasson) Date: 4 Jul 2001 12:06:02 GMT Subject: Security of binary_to_term ? References: <15161.49225.526286.218186@pcg.localdomain> Message-ID: <9hv0ra$s2t$1@news.du.uab.ericsson.se> In article <15161.49225.526286.218186@REDACTED>, Pascal Brisset wrote: >erlang:binary_to_term/1 generally exits with 'badarg' when applied to >invalid inputs. Is this behaviour guaranteed ? In other words, is it >safe to decode untrusted data with binary_to_term ? > >The purpose is to send data between untrusted nodes with >term_to_binary and binary_to_term over TCP, rather than with the >erlang distribution protocol. Note that 'binary_to_term' silently accepts garbage lying after the encoded term: 1> binary_to_term(<<131,104,2,97,1,97,2>>). {1,2} 2> binary_to_term(<<131,104,2,97,1,97,2,47,11>>). {1,2} This has been the case since R6B, and is the intended behaviour. -- Arndt Jonasson arndt@REDACTED From nicolas.niclausse@REDACTED Wed Jul 4 14:46:58 2001 From: nicolas.niclausse@REDACTED (Nicolas Niclausse) Date: Wed, 4 Jul 2001 14:46:58 +0200 Subject: building R7B-3 on Linux S/390 Message-ID: <15171.4162.9109.321759@schultze.ird.idealx.com> Hi, I had some troubles compiling Erlang/OTP R7B-3 on a linux IBM S/390 box. I resolve the problem with the following patch : --- erts/autoconf/config.guess.old Tue May 29 14:14:18 2001 +++ erts/autoconf/config.guess Tue Jul 3 18:13:18 2001 @@ -865,7 +865,7 @@ echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu -- Nicolas NICLAUSSE http://IDEALX.com/ From etxhste@REDACTED Fri Jul 6 17:33:00 2001 From: etxhste@REDACTED (Hakan Stenholm) Date: Fri, 6 Jul 2001 17:33:00 +0200 (MET DST) Subject: Arrays and tuple write (setelement) optimization Message-ID: <200107061533.RAA24576@avc240.etxb.ericsson.se> I've spent a bit of time recently testing the read/write performance of different erlang data types: Test Machine: Apple G4 tower Mac (400 Mhz, MacOsX) ETS : about 500,000 reads or writes per second (at any ets table size) Tuples (read) : about 4,500,000 reads (at any tuple size) Tuples (write): slower than ets when tuple size > 100 number of writes = c/TupleSize (where c is some constant) Tested sizes = 1 - 100,000 Note: old (R5 ?) OTP had performance problems with large lists because they where converted to lists. Some problems like matrix multiplication or rescaling bitmap pictures are very simple to do if one got an array like data type (read and write O(1)) ets has array like behaviour but a rather large overhead compared to things like a tuple. Acording to my tests tuples and lists are about the fastest data types in Erlang so I started to think if it was possible to increase tuple write speed: * A destructive update rather than creating a copy of the pointer array that keeps track of the elements of the tuple should be similar in perfromance to a tuple read operation * Destructive updates are problematic if several processes keep the same tuple, this is not the case each one keeps its own copy - so there is only one GC memory heap to consider. * Execution in a single process is sequential i.e. functions are run in the order they are written, this means that it should be risk free to destructivly update a tuple if the old version of it will not be used later in the same clause. It can easily be determined at runtime if a destructive update can be used or if it must be a copy update. * It seams reasonable to assume that we could get about 4,500,000 tuple write operations as well useing such a optimization. So I'm wondering if someone has considered adding such a optimization to the erlang compiler/VM or are there any problems I forgot about ? From Sean.Hinde@REDACTED Fri Jul 6 20:22:03 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 6 Jul 2001 19:22:03 +0100 Subject: Arrays and tuple write (setelement) optimization Message-ID: <402DD461F109D411977E0008C791C312039F6107@imp02mbx.one2one.co.uk> > So I'm wondering if someone has considered adding such a > optimization to the > erlang compiler/VM or are there any problems I forgot about ? There was a posting about this some time back: http://www.erlang.org/ml-archive/erlang-questions/200010/msg00112.html As I understand it the problem with what you suggest (which is the same for vectors) is that the current garbage collector relies on the unidirectional nature of erlang and doesn't have any way to go back and deal with destrctively updated stuff. Or something like that. There was some stuff about this in the thread: http://www.erlang.org/ml-archive/erlang-questions/200105/msg00003.html Rgds, - Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From matt@REDACTED Sat Jul 7 00:05:18 2001 From: matt@REDACTED (The RagasReport) Date: 6 Jul 2001 22:05:18 -0000 Subject: THE RAGAS REPORT - Learning Real Lessons From the eFront Message-ID: <994457118.94726.qmail@ech> "Now Read by Over 25,000 Next Economy Architects Weekly" Friday, July 6, 2001 By Editor: Matt Ragas IN THIS ISSUE============================================== ENTER TO WIN A FREE PALM VIIx! - www.LessonseFront.com Download the free Introduction to Lessons From the eFront, the new e-business battle guide by RagasReport editor Matt Ragas and enter to win a free Palm VIIx handheld. It's the book that no Next Economy leader should be without! Learn the secrets to e-business success now by visiting and sharing the link below: http://www.lessonsefront.com/webpage/download.htm THIS WEEK'S COMMENTARY===================================== An Insider's Look at the Next Economy Editor's Note: I hope that everyone had a great 4th of July with their families. Due to the holiday shortened week, the RagasReport decided to take a short nap this week and enjoy some of the beautiful sunshine here in Florida. Of course, the report will return next Friday with its regular dose of insider commentary and analysis of the tech sector. In the meantime, I thought I'd share with you some of the great endorsements that my new book - Lessons From the eFront - has recently received. Don't forget to visit the new website for Lessons From the eFront and enter to win a FREE Palm VIIx handheld. You can also download the Introduction to the book from the site. The future is now. The Next Economy is now - read about it! Buzz About Lessons From the E-Front "During a time when plenty of painful lessons are being learned, Lessons from the E-Front could become a battle guide for the walking wounded. It's a must-read for anyone who wants to profit from tech veterans' wins and losses." -Thom Calandra, Editor-in-Chief, CBS MarketWatch "A great book for people in the trenches." -Guy Kawasaki, CEO, Garage.com, and author of Rules for Revolutionaries "Matt Ragas captures the entrepreneurial spirit with real-life lessons and stories, but without the jargon and grand academic theory. His insightful analysis cuts to the core of running a business in a time of rapid technological change and market volatility." -Bill Martin, Founder, Raging Bull Inc. "Valuable reading for all would-be entrepreneurs as well as seasoned veterans." -David Bohnett, Founder, GeoCities "An excellent guide for entrepreneurs, full of thoughtful pragmatism." -Gary Rieschel, Executive Managing Director, Softbank Venture Capital "Reading Lessons from the E-Front won't make you rich, but it might help you figure out the next step. At the very least, you'll get a glimpse into the minds of ecommerce pioneers-the ones destined to make it and the ones with the arrows in their backs." -Larry Magid, Syndicated Columnist, Los Angeles Times "No longer will a cool idea and a PowerPoint presentation be enough to get your business off the ground. If you want to build a real business that lasts, read this book." -Tom Taulli, Internet Stock Analyst, Internet.com "The dot-com boom may be over, but the lessons from it endure. Lessons from the E-Front is full of valuable advice. Anybody looking to start a company should read this book." -Andy Wang, founder, Ironminds.com, and features editor, GEAR magazine "Anyone who thinks high-tech business operates on a wing and a prayer, with glib leaders and ephemeral business plans, will be enlightened by this book. Open it to any page, and you're certain to glean a diamond-cut nugget of hard-won insight." -Brad Hill, author of thirteen books including - Getting Started in Online Personal Finance "Matt Ragas was one of the first investment writers to realize that the New Economy is about more than just technology -- it's about how companies use technology, whatever their business." -Spencer Reiss, Vice President - Gilder Publishing and Editor of New Economy Watch p.s. Free is good, right? Well, then take the next thirty seconds or so to visit the website for Lessons From the eFront and enter to win a FREE PalmVIIx at: http://www.lessonsefront.com *********************************************************** Please feel free to share this free newsletter with a friend or colleague! Pass it on! Sign up instructions are below! *********************************************************** SUBSCRIPTION INFORMATION: Share this report with your friends, associates and colleagues. The subscription to the report is always FREE so pass it on or signup below! TO SUBSCRIBE - Please sign-up by visiting: http://www.ragasreport.com and entering your email. TO UNSUBSCRIBE- Please click on the unsubscribe link that can be found at the end of this report. =========================================================== FOR ADVERTISING INFORMATION - Want to reach the movers and shakers of Web St. and Wall St. all in one place? Thousands of Next Economy leaders read our report weekly. Get your marketing message in front of leaders- not followers! For advertising information please contact: AdRates@REDACTED Comments? Questions? Agree or disagree with our ramblings? In dire need of real e-strategy services? Email Matt Ragas (matt@REDACTED), President and Chief Analyst, Matthew Ragas & Associates. About Matthew W. Ragas: Ragas is President and Chief Analyst of Matthew Ragas & Associates, an Orlando, FL based strategic advisory and venture development firm. He was previously the founding editor of Raging Bull and is the author of the new e-business book Lessons From the E-Front from Prima Publishing. Disclaimer: Matthew Ragas & Associates and The Ragas Report is not a registered Investment Adviser or a Broker/Dealer. Readers are advised that the report is issued solely for informational purposes and is not to be construed as an offer to sell or the solicitation of an offer to buy. The opinions and analyses included herein are based from sources believed to be reliable and written in good faith, but no representation or warranty, expressed or implied is made as to their accuracy, completeness or correctness. Owners, employees and writers may have positions in the securities that are discussed in the newsletter. Please note that we are taking no compensation of any kind and will never take any compensation from any companies that we mention in this report. Copyright(c) 2000-2001, Matthew Ragas & Associates. (http://www.ragasreport.com) All Rights Reserved. _______________________________________________________________________ Powered by List Builder To unsubscribe follow the link: http://lb.bcentral.com/ex/manage/subscriberprefs?customerid=7979&subid=11BF12B3FFE00C82&msgnum=171 -------------- next part -------------- An HTML attachment was scrubbed... URL: From rv@REDACTED Sat Jul 7 01:37:54 2001 From: rv@REDACTED (Robert Virding) Date: Sat, 07 Jul 2001 01:37:54 +0200 Subject: Arrays and tuple write (setelement) optimization In-Reply-To: Your message of "Fri, 06 Jul 2001 17:33:00 +0200." <200107061533.RAA24576@avc240.etxb.ericsson.se> Message-ID: <200107062337.f66Nbsl22381@duva.bluetail.com> Hakan Stenholm writes: > >So I'm wondering if someone has considered adding such a optimization to the >erlang compiler/VM or are there any problems I forgot about ? This has been in two different forms: 1. The first, from before ETS, was nukeable arrays. The write operation was destructive and returned a new reference to the array while the old reference was "nuked". This ensured that the destructive operation preserved non-destructive semantics by maintaining uniqueness at runtime. A runtime version of uniqueness types. 2. The second, which exists in the current inplementation though not reachable, are vectors. The write operation is also destructive and returns a new reference while the old reference is updated with enough info so that it still looks the same as before. It preserves non-destructive semantics but prioritizes using the modified references. One problem is that it is very sensitive to keeping old references around, the update operations can become quite costly in both time and space. Bj?rn tested my dict implementation, which tries to be smart by heavily reusing tuples, and it apparently went slower with vectors. The first is more efficient, but the second preserves Erlang semantics for terms. A datatype like this would be useful, I suppose it is just a matter of deciding what you want. Having both would a Bad Thing! Robert From tony@REDACTED Sun Jul 8 01:23:30 2001 From: tony@REDACTED (Tony Rogvall) Date: Sun, 08 Jul 2001 01:23:30 +0200 Subject: Security of binary_to_term ? References: <15161.49225.526286.218186@pcg.localdomain> <20010627141957.C24445@bluetail.com> <15161.57584.399333.200453@pcg.localdomain> Message-ID: <3B4799F2.9E46F7E1@bluetail.com> Lon Willett wrote: > This stuff looks like it's down my alley, so I'll add my $0.02. > > Pascal Brisset writes: > > > An aside note: If you get the data over TCP, why should it be > > > invalid. TCP ensures the data is non corrupted.... or maybe you > > > are worrying over rogue nodes ??? > > > > Well this is what security is about, isn't it ? :) Actually I stumbled > > on one of those pathological cases, and I was wondering whether it was > > just a bug or whether additional checks were required anyway. > > > > $ erl > > Erlang (BEAM) emulator version 5.0.2.4 [source] > > > > Eshell V5.0.2.4 (abort with ^G) > > 1> binary_to_term(<<131,111,255,0,0,0>>). > > zsh: 30198 segmentation fault ./bin/erl > > Ugh! Crashing the emulator is a bad sign. > Yes! extremely bad. > > I wouldn't worry overmuch about the crash per se, since all an > attacker could use that for would be a denial-of-service attack (DOS). > IMO, preventing DOS attacks is probably impossible (although one > shouldn't make them _too_ easy). This must be fixed of course (and will, right bj?rn?) > > > What is a concern is that the segfault indicates that there might be a > buffer overflow problem, and this possibly would allow an attacker to > execute arbitrary code on your machine. > > Even if you fix "binary_to_term" so that it is safe, I would advise > caution anyway. While it (term_to_binary+binary_to_term) is a > convenient and easy way to define a data format, it is just too > powerful. An attacker could provide all kinds of funny data (pids, > refs, funs, very large ints, etc), so even when the binary is validly > formatted, you still need to be very sure that the contents of the > resulting erlang term are fully validated (or are only used in "safe" > ways). This required validation is very easy to overlook, especially > when the contents of the term are broken down and passed around to > different modules, some of which may not have been written to handle > maliciously formatted data (e.g. consider perl's "taint" mechanism, > meant to help deal with this same problem). > > Despite its dangers, I would be interested in what exactly the > problems with binary_to_term are. So if anyone has the time to look > at it (or already knows), I'd appreciate seeing the results. > This bug is kind of fun, the case is covered (in thought at least, but not in action). When the binary is converted into a term a function decode_size2 gets called to calculate the number of words needed on the heap. The <<131,111,255,0,0,0>> is interpreted as a big integer number (the 111) the length (in bytes) should be LEN=(2^24)*255 (a really big number) but there is none. The code then check, if when adding LEN to the current pointer the current pointer exceeds the end of buffer pointer. The answer is NO it has wrapped around the address space. The SKIP and CHKSIZE (external.c) macros need to be reworked to cover this case! one way could be to store the initial pointer and test that the resulting pointer is between the initial and the end pointer. something like this: #define SKIP(sz) do { \ char* start= *ext; \ *ext += (sz); \ if (((*ext) > endp) || ((*ext) < start)) { return *okp = 0; } \ } while(0) /Tony From Sean.Hinde@REDACTED Mon Jul 9 00:40:15 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Sun, 8 Jul 2001 23:40:15 +0100 Subject: Arrays and tuple write (setelement) optimization Message-ID: <402DD461F109D411977E0008C791C312039F6108@imp02mbx.one2one.co.uk> > One problem is that it is very sensitive to keeping old references > around, the update operations can become quite costly in both time and > space. Bj?rn tested my dict implementation, which tries to be smart > by heavily reusing tuples, and it apparently went slower with vectors. But I seem to remember reading that this slowness was more due to the fullsweep garbage collection which is currently done along with every update rather than anything fundamental about vectors. > The first is more efficient, but the second preserves Erlang semantics > for terms. > > A datatype like this would be useful, I suppose it is just a matter of > deciding what you want. Having both would a Bad Thing! Definitely agreed it would be useful. My vote would be for Vectors on the basis that they would make dealing with catch/exception situations much easier and cleaner than totally destructive updates.. but if this is at the cost of significantly slowing down the whole runtime with slower garbage collection or some other side effect then I guess destructive updates would be fine. People are used to ets destructive semantics after all. - Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Sean.Hinde@REDACTED Mon Jul 9 14:20:39 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 9 Jul 2001 13:20:39 +0100 Subject: gen_fsm:send_after | start_timer Message-ID: <402DD461F109D411977E0008C791C312039F6119@imp02mbx.one2one.co.uk> Hi, Anyone else think it would be useful to extend gen_fsm to have it's own state aware timer functionality? At the moment all timers sent with erlang:send_after or erlang:start_timer arrive in handle_info rather than in the callback for the current state. I find that handle_info becomes very large and unwieldy with more than a couple of timers running and 4 or more states.. Usage would be something like: %%---------------------------------------------------------------------- %% Func: init/1 %% Returns: {ok, StateName, StateData} | %% {ok, StateName, StateData, Timeout} | %% ignore | %% {stop, StopReason} %%---------------------------------------------------------------------- init([]) -> gen_fsm:start_timer(2000, "Hello from init"), {ok, state1, #state{}}. %%---------------------------------------------------------------------- %% Func: StateName/2 %% Returns: {next_state, NextStateName, NextStateData} | %% {next_state, NextStateName, NextStateData, Timeout} | %% {stop, Reason, NewStateData} %%---------------------------------------------------------------------- state1(Event, StateData) -> gen_fsm:start_timer(2000, "Hello from state 1"), io:format("SH:~p~n",[Event]), {next_state, state2, StateData}. state2(Event, StateData) -> io:format("SH:~p~n",[Event]), gen_fsm:send_after(2000, "Hello from state 2"), {next_state, state1, StateData}. Possible implementation follows as a diff -c: *** /opt/rcs/5.0.2.5/lib/stdlib-1.9.4/src/gen_fsm.erl Thu Jun 7 15:04:40 2001 --- gen_fsm.erl Mon Jul 9 13:14:09 2001 *************** *** 110,115 **** --- 110,117 ---- sync_send_all_state_event/2, sync_send_all_state_event/3, reply/2]). + -export([start_timer/2, send_after/2]). + %% Internal exports -export([init_it/6, print_event/3, system_continue/3, *************** *** 199,204 **** --- 201,217 ---- [Name, Event, Timeout]}}) end. + %% Designed to be only callable within one of the callbacks + %% hence using the self() of this instance of the process. + %% This is to ensure that timers don't go astray in global + %% e.g. when straddling a failover, or turn up in a restarted + %% instance of the process. + start_timer(Time, Msg) -> + erlang:start_timer(Time, self(), {'$gen_fsm_timer', Msg}). + + send_after(Time, Msg) -> + erlang:send_after(Time, self(), {'$gen_fsm_timer', Msg}). + %%% --------------------------------------------------- %%% Initiate the new process. %%% Register the name using the Rfunc function *************** *** 288,293 **** --- 301,314 ---- io:format(Dev, "*DBG* ~p got all_state_event ~p in state ~w~n", [Name, Event, StateName]); + {'$gen_fsm_timer', Msg} -> + io:format(Dev, + "*DBG* ~p got timer ~p in state ~w~n", + [Name, Msg, StateName]); + {timeout, Ref, {'$gen_fsm_timer', Msg}} -> + io:format(Dev, + "*DBG* ~p got timer ~p in state ~w~n", + [Name, {timeout, Ref, Msg}, StateName]); _ -> io:format(Dev, "*DBG* ~p got ~p in state ~w~n", [Name, Msg, StateName]) *************** *** 367,372 **** --- 388,397 ---- dispatch({'$gen_sync_all_state_event', From, Event}, Mod, StateName, StateData) -> apply(Mod, handle_sync_event, [Event, From, StateName, StateData]); + dispatch({'$gen_fsm_timer', Msg}, Mod, StateName, StateData) -> + apply(Mod, StateName, [Msg, StateData]); + dispatch({timeout, Ref, {'$gen_fsm_timer', Msg}}, Mod, StateName, StateData) - > + apply(Mod, StateName, [{timeout, Ref, Msg}, StateData]); dispatch(Info, Mod, StateName, StateData) -> apply(Mod, handle_info, [Info, StateName, StateData]). *************** *** 423,428 **** --- 448,457 ---- "** Last event in was ~p (for all states)~n"; get_msg_str({'$gen_sync_all_state_event', Event}) -> "** Last sync event in was ~p (for all states)~n"; + get_msg_str({'$gen_fsm_timer', Msg}) -> + "** Last timer event in was ~p~n"; + get_msg_str({timeout, Ref, {'$gen_fsm_timer', Msg}}) -> + "** Last timer event in was ~p~n"; get_msg_str(Msg) -> "** Last message in was ~p~n". *************** *** 430,435 **** --- 459,466 ---- get_msg({'$gen_sync_event', Event}) -> Event; get_msg({'$gen_all_state_event', Event}) -> Event; get_msg({'$gen_sync_all_state_event', Event}) -> Event; + get_msg({'$gen_fsm_timer', Msg}) -> Msg; + get_msg({timeout, Ref, {'$gen_fsm_timer', Msg}}) -> {timeout, Ref, Msg}; get_msg(Msg) -> Msg. %%----------------------------------------------------------------- - Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Sean.Hinde@REDACTED Mon Jul 9 14:36:47 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 9 Jul 2001 13:36:47 +0100 Subject: gen_fsm:send_after | start_timer Message-ID: <402DD461F109D411977E0008C791C312039F611B@imp02mbx.one2one.co.uk> Hmm, that didn't come out too well. Here is the diff as an attachment. - Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. -------------- next part -------------- A non-text attachment was scrubbed... Name: gen_fsm_timer.diff Type: application/octet-stream Size: 3114 bytes Desc: not available URL: From francesco@REDACTED Mon Jul 9 18:11:03 2001 From: francesco@REDACTED (Francesco Cesarini) Date: Mon, 09 Jul 2001 17:11:03 +0100 Subject: gen_fsm:send_after | start_timer References: <402DD461F109D411977E0008C791C312039F6119@imp02mbx.one2one.co.uk> Message-ID: <3B49D797.C8BFAEBE@erlang-consulting.com> Hi Sean, why don't you use timer:apply_after/4 and create your own timeout events? %% Called when you set the timer. timer(Ms) -> timer:apply_after(Ms, ?MODULE, timeout, [self()]). %% Call back function timeout(GenFsg) -> gen_fsm:send_event(GenFSM, timeout). Regards, Francesco -- http://www.erlang-consulting.com Sean Hinde wrote: > Hi, > > Anyone else think it would be useful to extend gen_fsm to have it's own > state aware timer functionality? > > At the moment all timers sent with erlang:send_after or erlang:start_timer > arrive in handle_info rather than in the callback for the current state. I > find that handle_info becomes very large and unwieldy with more than a > couple of timers running and 4 or more states.. > > Usage would be something like: > > %%---------------------------------------------------------------------- > %% Func: init/1 > %% Returns: {ok, StateName, StateData} | > %% {ok, StateName, StateData, Timeout} | > %% ignore | > %% {stop, StopReason} > %%---------------------------------------------------------------------- > init([]) -> > gen_fsm:start_timer(2000, "Hello from init"), > {ok, state1, #state{}}. > > %%---------------------------------------------------------------------- > %% Func: StateName/2 > %% Returns: {next_state, NextStateName, NextStateData} | > %% {next_state, NextStateName, NextStateData, Timeout} | > %% {stop, Reason, NewStateData} > %%---------------------------------------------------------------------- > state1(Event, StateData) -> > gen_fsm:start_timer(2000, "Hello from state 1"), > io:format("SH:~p~n",[Event]), > {next_state, state2, StateData}. > > state2(Event, StateData) -> > io:format("SH:~p~n",[Event]), > gen_fsm:send_after(2000, "Hello from state 2"), > {next_state, state1, StateData}. > > Possible implementation follows as a diff -c: > > *** /opt/rcs/5.0.2.5/lib/stdlib-1.9.4/src/gen_fsm.erl Thu Jun 7 15:04:40 > 2001 > --- gen_fsm.erl Mon Jul 9 13:14:09 2001 > > *************** > > *** 110,115 **** > > --- 110,117 ---- > > sync_send_all_state_event/2, sync_send_all_state_event/3, > > reply/2]). > > > > + -export([start_timer/2, send_after/2]). > > + > > %% Internal exports > > -export([init_it/6, print_event/3, > > system_continue/3, > > *************** > > *** 199,204 **** > > --- 201,217 ---- > > [Name, Event, Timeout]}}) > > end. > > > > + %% Designed to be only callable within one of the callbacks > > + %% hence using the self() of this instance of the process. > > + %% This is to ensure that timers don't go astray in global > > + %% e.g. when straddling a failover, or turn up in a restarted > > + %% instance of the process. > > + start_timer(Time, Msg) -> > > + erlang:start_timer(Time, self(), {'$gen_fsm_timer', Msg}). > > + > > + send_after(Time, Msg) -> > > + erlang:send_after(Time, self(), {'$gen_fsm_timer', Msg}). > > + > > %%% --------------------------------------------------- > > %%% Initiate the new process. > > %%% Register the name using the Rfunc function > > *************** > > *** 288,293 **** > > --- 301,314 ---- > > io:format(Dev, > > "*DBG* ~p got all_state_event ~p in state ~w~n", > > [Name, Event, StateName]); > > + {'$gen_fsm_timer', Msg} -> > > + io:format(Dev, > > + "*DBG* ~p got timer ~p in state ~w~n", > > + [Name, Msg, StateName]); > > + {timeout, Ref, {'$gen_fsm_timer', Msg}} -> > > + io:format(Dev, > > + "*DBG* ~p got timer ~p in state ~w~n", > > + [Name, {timeout, Ref, Msg}, StateName]); > > _ -> > > io:format(Dev, "*DBG* ~p got ~p in state ~w~n", > > [Name, Msg, StateName]) > > *************** > > *** 367,372 **** > > --- 388,397 ---- > > dispatch({'$gen_sync_all_state_event', From, Event}, > > Mod, StateName, StateData) -> > > apply(Mod, handle_sync_event, [Event, From, StateName, StateData]); > > + dispatch({'$gen_fsm_timer', Msg}, Mod, StateName, StateData) -> > > + apply(Mod, StateName, [Msg, StateData]); > > + dispatch({timeout, Ref, {'$gen_fsm_timer', Msg}}, Mod, StateName, > StateData) - > > > > + apply(Mod, StateName, [{timeout, Ref, Msg}, StateData]); > > dispatch(Info, Mod, StateName, StateData) -> > > apply(Mod, handle_info, [Info, StateName, StateData]). > > > > *************** > > *** 423,428 **** > > --- 448,457 ---- > > "** Last event in was ~p (for all states)~n"; > > get_msg_str({'$gen_sync_all_state_event', Event}) -> > > "** Last sync event in was ~p (for all states)~n"; > > + get_msg_str({'$gen_fsm_timer', Msg}) -> > > + "** Last timer event in was ~p~n"; > > + get_msg_str({timeout, Ref, {'$gen_fsm_timer', Msg}}) -> > > + "** Last timer event in was ~p~n"; > > get_msg_str(Msg) -> > > "** Last message in was ~p~n". > > > > *************** > > *** 430,435 **** > > --- 459,466 ---- > > get_msg({'$gen_sync_event', Event}) -> Event; > > get_msg({'$gen_all_state_event', Event}) -> Event; > > get_msg({'$gen_sync_all_state_event', Event}) -> Event; > > + get_msg({'$gen_fsm_timer', Msg}) -> Msg; > > + get_msg({timeout, Ref, {'$gen_fsm_timer', Msg}}) -> {timeout, Ref, Msg}; > > get_msg(Msg) -> Msg. > > > > %%----------------------------------------------------------------- > > > > - Sean > > NOTICE AND DISCLAIMER: > This email (including attachments) is confidential. If you have received > this email in error please notify the sender immediately and delete this > email from your system without copying or disseminating it or placing any > reliance upon its contents. We cannot accept liability for any breaches of > confidence arising through use of email. Any opinions expressed in this > email (including attachments) are those of the author and do not necessarily > reflect our opinions. We will not accept responsibility for any commitments > made by our employees outside the scope of our business. We do not warrant > the accuracy or completeness of such information. -------------- next part -------------- A non-text attachment was scrubbed... Name: francesco.vcf Type: text/x-vcard Size: 352 bytes Desc: Card for Francesco Cesarini URL: From Sean.Hinde@REDACTED Mon Jul 9 18:14:24 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 9 Jul 2001 17:14:24 +0100 Subject: gen_fsm:send_after | start_timer Message-ID: <402DD461F109D411977E0008C791C312039F6122@imp02mbx.one2one.co.uk> > Hi Sean, > why don't you use timer:apply_after/4 and create your own > timeout events? Mainly because timer:apply_after/4 is implemented in a pretty unbelievably degenerate way if there are more than a small number of timers running. I remember reading that use of timer module is banned in AXD for this reason. - Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From francesco@REDACTED Mon Jul 9 18:43:32 2001 From: francesco@REDACTED (Francesco Cesarini) Date: Mon, 09 Jul 2001 17:43:32 +0100 Subject: gen_fsm:send_after | start_timer References: <402DD461F109D411977E0008C791C312039F6122@imp02mbx.one2one.co.uk> Message-ID: <3B49DF34.BE9C9D0F@erlang-consulting.com> Hi, I do not have a decent work environment to do any tests right, but I believe that an attempt at cleaning up the timer module has been made. The design rule in the AXD is from 1996, and a lot has changed since then. I do not think the ban is in the updated design rules. I notice that the timers are still inserted in lists using insertion sort, so if timing is still a problem (How many timers will you have running at any one time?), I would personally rewrite the timer module instead of complicating the FSMs. Cheers, Francesco -- http://www.erlang-consulting.com Sean Hinde wrote: > > Hi Sean, > > why don't you use timer:apply_after/4 and create your own > > timeout events? > > Mainly because timer:apply_after/4 is implemented in a pretty unbelievably > degenerate way if there are more than a small number of timers running. I > remember reading that use of timer module is banned in AXD for this reason. > > - Sean > > NOTICE AND DISCLAIMER: > This email (including attachments) is confidential. If you have received > this email in error please notify the sender immediately and delete this > email from your system without copying or disseminating it or placing any > reliance upon its contents. We cannot accept liability for any breaches of > confidence arising through use of email. Any opinions expressed in this > email (including attachments) are those of the author and do not necessarily > reflect our opinions. We will not accept responsibility for any commitments > made by our employees outside the scope of our business. We do not warrant > the accuracy or completeness of such information. -------------- next part -------------- A non-text attachment was scrubbed... Name: francesco.vcf Type: text/x-vcard Size: 352 bytes Desc: Card for Francesco Cesarini URL: From Sean.Hinde@REDACTED Mon Jul 9 19:01:43 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 9 Jul 2001 18:01:43 +0100 Subject: gen_fsm:send_after | start_timer Message-ID: <402DD461F109D411977E0008C791C312039F6123@imp02mbx.one2one.co.uk> > Hi, > I do not have a decent work environment to do any tests > right, but I believe > that an attempt at cleaning up the timer module has been > made. The design rule > in the AXD is from 1996, and a lot has changed since then. I > do not think the > ban is in the updated design rules. > > I notice that the timers are still inserted in lists using > insertion sort, so if > timing is still a problem (How many timers will you have > running at any one > time?), I would personally rewrite the timer module instead > of complicating the > FSMs. Yes, I thought some more since your last post and also decided fixing timer would be more in line with the general ethos.. Yet I just spent the last couple of hours getting my head around a particularly complex gen_fsm and have grown to really like my addition.. I had a big itch to scratch in doing that change and it has helped enormously. On a more definite note timer:apply_after/4 loses the nice property of erlang:start_timer/3 that the timer ref is included in the sent message. This is impossible using timer:apply_after because you don't know the ref until after the message is sent(!) Also my solution is much cleaner for users of gen_fsm because it does not require a whole raft of exported functions just to wrap the timers. And my solution is just about as efficient as timers get with only 1 message sent - the actual timer. So, I think that timer should be fixed, And I will keep my change, rely on it making my head hurt less, enjoy the fact that it makes my code more maintainable (IMHO), and hope others like it :) Cheers, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From willem@REDACTED Mon Jul 9 21:14:50 2001 From: willem@REDACTED (Willem Broekema) Date: Mon, 09 Jul 2001 21:14:50 +0200 Subject: gen_tcp:send undefined? Message-ID: <3B4A02AA.4010101@pastelhorn.com> In a file sockprocess.erl in function handle_socket I have the following statement: ... receive {tcp, Sock, BData} -> ok = get_tcp:send(Sock, "test"), ... which will cause the node to exit: {'EXIT', <0.339.0>, {undef,[{get_tcp,send,[#Port<0.102>,[]]},{sockprocess,handle_socket,2}]}} I wonder what could be causing this error, as I use other functions in the gen_tcp module (like gen_tcp:accept) before this happens, and I have not changed the gen_tcp file, and send/2 is indeed in the module. Thanks for your help. - Willem From luke@REDACTED Mon Jul 9 21:20:40 2001 From: luke@REDACTED (Luke Gorrie) Date: 09 Jul 2001 21:20:40 +0200 Subject: gen_tcp:send undefined? In-Reply-To: <3B4A02AA.4010101@pastelhorn.com> References: <3B4A02AA.4010101@pastelhorn.com> Message-ID: Willem Broekema writes: > ok = get_tcp:send(Sock, "test"), ^^^ s/get_tcp/gen_tcp/ :-) Cheers, Luke From etxuwig@REDACTED Tue Jul 10 15:19:10 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Tue, 10 Jul 2001 15:19:10 +0200 (MET DST) Subject: gen_fsm:send_after | start_timer In-Reply-To: <3B49DF34.BE9C9D0F@erlang-consulting.com> Message-ID: On Mon, 9 Jul 2001, Francesco Cesarini wrote: >Hi, >I do not have a decent work environment to do any tests right, >but I believe that an attempt at cleaning up the timer module >has been made. The design rule in the AXD is from 1996, and a >lot has changed since then. I do not think the ban is in the >updated design rules. The design rule is still there, and the rule is to use the AXD 301 sysTimer.erl module for all timers. Whenever there is an efficient OTP method to execute the corresponding timer, we rewrite the sysTimer.erl module to use that function. That was done when erlang:start_timer/3 was introduced. timer:apply_after/4 still does all sorts of things that we don't want: - a gen_server:call(), which in itself is more expensive than erlang:start_timer/3. - a call to timer:system_time(), which essentially creates a bignum out of the system time, and adds the ordered time interval (which is never a bignum). Bignum arithmetics are expensive. - performs a sorted insert. Apart from this, it will land in a receive ... after once per timer, which is unavoidable, and then spawns a process to execute {M,F,A}, which is desireable. sysTimer:apply_after/4 does this: apply_after(Time, M, F, A) when integer(Time) -> spawn_link(sysTimer, do_apply_after, [Time, M, F, A, self()]); apply_after(Name, M, F, A) -> spawn_link(sysTimer, do_apply_after, [get_value(Name), M, F, A, self()]). do_apply_after(Time, M, F, A, LinkedPid) -> put(arguments, [Time, M, F, A, LinkedPid]), sleep(Time), apply(M, F, A), unlink(LinkedPid). The call to put(arguments, ...) is to facilitate debugging, and this version of apply_after/4 also supports named timers, which is very useful for protocol programming, as the standard timers must often be customizable. I will not present sleep(), because I just found that it has been inefficiently (re-)implemented since the last time I looked. ): Its efficient implementation is trivial. The method of timer.erl to use a sorted list in order to offload the timer wheel in the emulator is a sub-optimization. We've verified that the timer wheel (timeout queue) in BEAM shows hardly no degradation at all even with 20,000 concurrent timers. An erlang implementation simply cannot compete with the built-in timeout support, and apply_after should basically only do the required extra of spawning a process to give the function an execution context. Everything else is just garnish. sysTimer.erl does have some of that, for example repeating timers which compensate for the drift in time, and specified timers that work around the 32-bit limitation of the timeout queue, as well as handle daylight savings time. /Uffe >> degenerate way if there are more than a small number of timers running. I >> remember reading that use of timer module is banned in AXD for this reason. >> >> - Sean >> >> NOTICE AND DISCLAIMER: >> This email (including attachments) is confidential. If you have received >> this email in error please notify the sender immediately and delete this >> email from your system without copying or disseminating it or placing any >> reliance upon its contents. We cannot accept liability for any breaches of >> confidence arising through use of email. Any opinions expressed in this >> email (including attachments) are those of the author and do not necessarily >> reflect our opinions. We will not accept responsibility for any commitments >> made by our employees outside the scope of our business. We do not warrant >> the accuracy or completeness of such information. > -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From Sean.Hinde@REDACTED Tue Jul 10 15:53:51 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 10 Jul 2001 14:53:51 +0100 Subject: gen_fsm:send_after | start_timer Message-ID: <402DD461F109D411977E0008C791C312039F6136@imp02mbx.one2one.co.uk> > sysTimer:apply_after/4 does this: > > apply_after(Time, M, F, A) when integer(Time) -> > spawn_link(sysTimer, do_apply_after, > [Time, M, F, A, self()]); > apply_after(Name, M, F, A) -> > spawn_link(sysTimer, do_apply_after, > [get_value(Name), M, F, A, self()]). > > do_apply_after(Time, M, F, A, LinkedPid) -> > put(arguments, [Time, M, F, A, LinkedPid]), > sleep(Time), > apply(M, F, A), > unlink(LinkedPid). > > > and this version of apply_after/4 also supports named timers, > which is very useful for protocol programming, as the standard > timers must often be customizable. This sounds like a nice feature. I just implemented a bunch of callbacks to be able to change the timer values in my protocol module.. > I will not present sleep(), because I just found that it has been > inefficiently (re-)implemented since the last time I looked. ): > Its efficient implementation is trivial. In the latest stdlib I have access to (1.9.4) it is: sleep(T) -> receive after T -> ok end. This looks reasonably trivial :) > The method of timer.erl to use a sorted list in order to offload > the timer wheel in the emulator is a sub-optimization. We've > verified that the timer wheel (timeout queue) in BEAM shows > hardly no degradation at all even with 20,000 concurrent timers. Nice to know. > An erlang implementation simply cannot compete with the built-in > timeout support, and apply_after should basically only do the > required extra of spawning a process to give the function an > execution context. Everything else is just garnish. What about the performance difference between your apply_after and erlang:start_timer? Do you know if receive loops use the same timer wheel? How about: apply_after(T, M, F, A) -> erlang:start_timer(T, timer, {apply, M, F, A}). %% Permanent loop registered as {local, timer}: loop() -> receive {timeout, Ref, {apply, M, F, A}} -> spawn_link(?MODULE, do, [M, F, A, self()]), loop(). do(M, F, A, Pid) -> apply(M, F, A). unlink(Pid). This avoids having lots of extra processes lying around (but the timer isn't linked to the requesting process). - Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From martin@REDACTED Tue Jul 10 20:16:19 2001 From: martin@REDACTED (Martin Logan) Date: Tue, 10 Jul 2001 13:16:19 -0500 Subject: Supervisor Strategy References: <402DD461F109D411977E0008C791C312039F6136@imp02mbx.one2one.co.uk> Message-ID: <3B4B4673.6176304B@vailsys.com> Hello, I have a project under development that consists of 2 supervisors and 4 supervised processes. S / / \ W W \ S / \ W W This is my current supervision tree. I have one more process in this scheme, it is an extremly temporary process. Thousands of them can be spawned and killed in an hour. The process is spawned in response to a packet recieved by one of the workers. My question to the list is this; is it proper form to spawn the process via the worker directly with a spawn( I really don't care about it after I spawn it so I would not be inclined to use a link) or should I use the supervisors ability to dynamically spawn children with supervisor:start_child? What is more efficiant/robust/proper? Thanks, Martin Logan From garry@REDACTED Tue Jul 10 20:57:43 2001 From: garry@REDACTED (Garry Hodgson) Date: Tue, 10 Jul 2001 14:57:43 -0400 Subject: silly question: erlang pronunciation References: <402DD461F109D411977E0008C791C312039F6119@imp02mbx.one2one.co.uk> Message-ID: <3B4B5027.1FF88BC7@sage.att.com> i'm giving a talk soon on our use of erlang, and it occurred to me that i'm not sure how it is pronounced. is it prounounced like "air-lang", or "ir-lang"? i've heard both. thanks -- Garry Hodgson sometimes we ride on your horses Senior Hacker sometimes we walk alone Software Innovation Services sometimes the songs that we hear AT&T Labs are just songs of our own garry@REDACTED From matthias@REDACTED Tue Jul 10 23:30:19 2001 From: matthias@REDACTED (matthias@REDACTED) Date: Tue, 10 Jul 2001 23:30:19 +0200 Subject: silly question: erlang pronunciation In-Reply-To: <3B4B5027.1FF88BC7@sage.att.com> References: <402DD461F109D411977E0008C791C312039F6119@imp02mbx.one2one.co.uk> <3B4B5027.1FF88BC7@sage.att.com> Message-ID: <15179.29675.32905.347451@corelatus.com> > i'm giving a talk soon on our use of erlang, and it occurred to me > that i'm not sure how it is pronounced. is it prounounced like > "air-lang", or "ir-lang"? i've heard both. Native English speakers tend to call it "ir-lang" (i.e. sounds like 'herlang' said by someone 'oo drops 'is aitches) whereas the Swedes make it sound more like "air-lang", especially when they're speaking Swedish. Matt From luke@REDACTED Tue Jul 10 23:40:35 2001 From: luke@REDACTED (Luke Gorrie) Date: 10 Jul 2001 23:40:35 +0200 Subject: silly question: erlang pronunciation In-Reply-To: <15179.29675.32905.347451@corelatus.com> References: <402DD461F109D411977E0008C791C312039F6119@imp02mbx.one2one.co.uk> <3B4B5027.1FF88BC7@sage.att.com> <15179.29675.32905.347451@corelatus.com> Message-ID: matthias@REDACTED writes: > > i'm giving a talk soon on our use of erlang, and it occurred to me > > that i'm not sure how it is pronounced. is it prounounced like > > "air-lang", or "ir-lang"? i've heard both. > > Native English speakers tend to call it "ir-lang" (i.e. sounds like > 'herlang' said by someone 'oo drops 'is aitches) whereas the Swedes > make it sound more like "air-lang", especially when they're speaking > Swedish. To avoid confusion, maybe it should be renamed ?rlang ;-) Cheers, Luke From kramer@REDACTED Wed Jul 11 07:54:25 2001 From: kramer@REDACTED (Reto Kramer) Date: Tue, 10 Jul 2001 22:54:25 -0700 Subject: Erlang and Model Checker "Spin" Message-ID: I was wondering if anyone is aware of model checking work done in the context of Erlang. It seems that "Spin", the protocol model checker that Gerard Holzmann build at the Bell Labs allows for very relatively easy transformation from/to Erlang due to the similar communication models. Any pointer to previous work in this area is greatly appreciated. cheers, - Reto From etxuwig@REDACTED Wed Jul 11 14:41:23 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 11 Jul 2001 14:41:23 +0200 (MET DST) Subject: gen_fsm:send_after | start_timer In-Reply-To: <402DD461F109D411977E0008C791C312039F6136@imp02mbx.one2one.co.uk> Message-ID: On Tue, 10 Jul 2001, Sean Hinde wrote: >> An erlang implementation simply cannot compete with the built-in >> timeout support, and apply_after should basically only do the >> required extra of spawning a process to give the function an >> execution context. Everything else is just garnish. > >What about the performance difference between your apply_after and >erlang:start_timer? It's somewhere in the neighbourhood of 5x more overhead: erlang:start_timer/3 clocks in at about 20-25 us. Spawning a process costs a bit more. Our apply_after was less than 100 us overhead last time I checked (which was a while ago on a 36MHz SuperSPARC.) >Do you know if receive loops use the same timer wheel? Yes, they do. >How about: > >apply_after(T, M, F, A) -> > erlang:start_timer(T, timer, {apply, M, F, A}). > >%% Permanent loop registered as {local, timer}: > >loop() -> > receive > {timeout, Ref, {apply, M, F, A}} -> > spawn_link(?MODULE, do, [M, F, A, self()]), > loop(). > >do(M, F, A, Pid) -> > apply(M, F, A). > unlink(Pid). You will reduce the overhead, but add latency since all the timer functions must be serialized. This will force the requirement on the user of the timer to keep the function very short, which is sometimes inconvenient. Also, I'd put a catch around the apply. ;) >This avoids having lots of extra processes lying around (but the timer isn't >linked to the requesting process). Yes, but Erlang handles lots of extra processes exceedingly well. I wouldn't worry about the performance aspect, but memory could sometimes be a factor. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From Sean.Hinde@REDACTED Wed Jul 11 17:29:57 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Wed, 11 Jul 2001 16:29:57 +0100 Subject: gen_fsm:send_after | start_timer Message-ID: <402DD461F109D411977E0008C791C312039F6139@imp02mbx.one2one.co.uk> > >apply_after(T, M, F, A) -> > > erlang:start_timer(T, timer, {apply, M, F, A}). > > > >%% Permanent loop registered as {local, timer}: > > > >loop() -> > > receive > > {timeout, Ref, {apply, M, F, A}} -> > > spawn_link(?MODULE, do, [M, F, A, self()]), > > loop(). > > > >do(M, F, A, Pid) -> > > apply(M, F, A). > > unlink(Pid). > > You will reduce the overhead, but add latency since all the > timer functions must be serialized. This will force the > requirement on the user of the timer to keep the function very > short, which is sometimes inconvenient. No, they are still spawned in their own process > Also, I'd put a catch around the apply. ;) Good point! > Yes, but Erlang handles lots of extra processes exceedingly well. > I wouldn't worry about the performance aspect, but memory could > sometimes be a factor. Hmm, OK. I still like extending gen_fsm with timers. Timers are pretty key to most protocol FSMs and this makes them extremely neat and safe for protocol implementers, as well as giving maximum efficiency. The attached new version of my patch adds a gen_fsm:cancel_timer which is guaranteed to remove the timer even if already in the message queue (for both send_after and start_timer, which is not possible with the normal erlang:send_after/3). It also tidies up the sys:trace wording. - Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. -------------- next part -------------- A non-text attachment was scrubbed... Name: gen_fsm_timer2.diff Type: application/octet-stream Size: 3436 bytes Desc: not available URL: From garry@REDACTED Wed Jul 11 20:29:47 2001 From: garry@REDACTED (Garry Hodgson) Date: Wed, 11 Jul 2001 14:29:47 -0400 Subject: silly question: erlang pronunciation References: <402DD461F109D411977E0008C791C312039F6119@imp02mbx.one2one.co.uk> <3B4B5027.1FF88BC7@sage.att.com> <15179.29675.32905.347451@corelatus.com> Message-ID: <3B4C9B1B.F46A04CB@sage.att.com> matthias@REDACTED wrote: > > > i'm giving a talk soon on our use of erlang, and it occurred to me > > that i'm not sure how it is pronounced. is it prounounced like > > "air-lang", or "ir-lang"? i've heard both. > > Native English speakers tend to call it "ir-lang" (i.e. sounds like > 'herlang' said by someone 'oo drops 'is aitches) whereas the Swedes > make it sound more like "air-lang", especially when they're speaking > Swedish. i expect i'll keep calling it "air-lang" then, in deference to my swedish great grandmother. thanks to all who replied. -- Garry Hodgson sometimes we ride on your horses Senior Hacker sometimes we walk alone Software Innovation Services sometimes the songs that we hear AT&T Labs are just songs of our own garry@REDACTED From rv@REDACTED Thu Jul 12 01:09:31 2001 From: rv@REDACTED (Robert Virding) Date: Thu, 12 Jul 2001 01:09:31 +0200 Subject: silly question: erlang pronunciation In-Reply-To: Your message of "10 Jul 2001 23:40:35 +0200." Message-ID: <200107112309.f6BN9Vl14083@duva.bluetail.com> Luke Gorrie writes: >matthias@REDACTED writes: > >> > i'm giving a talk soon on our use of erlang, and it occurred to me >> > that i'm not sure how it is pronounced. is it prounounced like >> > "air-lang", or "ir-lang"? i've heard both. >> >> Native English speakers tend to call it "ir-lang" (i.e. sounds like >> 'herlang' said by someone 'oo drops 'is aitches) whereas the Swedes >> make it sound more like "air-lang", especially when they're speaking >> Swedish. > >To avoid confusion, maybe it should be renamed ?rlang ;-) Great! Then we can have .?rl files. :-) Robert From thomas@REDACTED Thu Jul 12 11:12:26 2001 From: thomas@REDACTED (Thomas Arts) Date: Thu, 12 Jul 2001 11:12:26 +0200 Subject: Erlang and Model Checker "Spin" References: Message-ID: <3B4D69FA.B7A856E@cslab.ericsson.se> Reto Kramer wrote: > > I was wondering if anyone is aware of model checking work done in the > context of Erlang. > It seems that "Spin", the protocol model checker that Gerard Holzmann build > at the Bell Labs allows for very relatively easy transformation from/to > Erlang due to the similar communication models. > > Any pointer to previous work in this area is greatly appreciated. Dear Reto We have experimented with a translation of Erlang into Promela and checking Promela bij SPIN. This is reported upon in a master thesis (http://www.ericsson.com/cslab/~thomas/Xjobb/christian.ps). The main outcome of the experiment was that Promela (and hence SPIN) are too far away from Erlang to really use them together. It is a little like using C to specify an Erlang program in. We searched for a better specification language and found that in mCRL, provided by CWI in Amsterdam (http://www.cwi.nl/~mcrl). At first we used this language to manually specify Erlang programs in and used the CADP model checker to verify properties (http://www.ericsson.com/cslab/~thomas/papers/ifl2000.pdf and http://www.ericsson.com/cslab/~thomas/Reports/sen9910.ps). The CADP toolset is really great and offers almost the same as SPIN (http://www.inrialpes.fr/vasy/cadp). The user interface is very intuitive and there are more features than we have used yet. Using a specification language is always a little drawback, because it takes you lots of extra work. The work may pay of in the end, but often it is just tedious, since the Erlang program can be seen as a specification as well. We wrote a program to translate Erlang to mCRL for at least a subset of Erlang large enough to look at an interesting case study: http://www.ericsson.com/cslab/~thomas/papers/fmics2001.pdf) I attached a few Erlang models to give you an impression on what we can verify automatically by using model checking. Please feel free to contact me for further questions Thomas --- Thomas Arts Ericsson Computer Science Lab http://www.ericsson.com/cslab/~thomas/ -------------- next part -------------- A non-text attachment was scrubbed... Name: verifiedlocker-0.3.tgz Type: application/octet-stream Size: 6700 bytes Desc: not available URL: From ltaesch@REDACTED Thu Jul 12 12:23:06 2001 From: ltaesch@REDACTED (taesch) Date: Thu, 12 Jul 2001 06:23:06 -0400 Subject: cookies and internet Message-ID: <3B8DD831@MailAndNews.com> if the erlang model would be used over the internet, how would the security model do with that ? is the cookie good enough ? how do u pass it first hand ? generally, have any study made in this area ? mail postst ? paper ? thanks Luc ------------------------------------------------------------ Get your FREE web-based e-mail and newsgroup access at: http://MailAndNews.com Create a new mailbox, or access your existing IMAP4 or POP3 mailbox from anywhere with just a web browser. ------------------------------------------------------------ From jouni.ryno@REDACTED Thu Jul 12 16:44:52 2001 From: jouni.ryno@REDACTED (Jouni Ryno) Date: Thu, 12 Jul 2001 17:44:52 +0300 Subject: io:format and integers Message-ID: While I was again formatting my outputs I started to wonder: What's the reason, that io:format does not contain integer (a'la %d/%i in C) formats ? I need it so often, that I must be missing something totally obvious ... io:fwrite("~2..0s", [integer_to_list(7)]) works to write 07, but having a sign is a bit more complicated :-) As I already asked for hex (~h, ~H as they might be), could there be ~d also ? With regards Jouni Jouni Ryn? mailto://Jouni.Ryno@REDACTED/ http://www.geo.fmi.fi/~ryno/ Finnish Meteorological Institute http://www.fmi.fi/ Geophysical Research http://www.geo.fmi.fi/ P.O.BOX 503 Tel (+358)-9-19294656 FIN-00101 Helsinki FAX (+358)-9-19294603 Finland priv-GSM (+358)-50-5302903 "It's just zeros and ones, it cannot be hard" From Lon.Willett@REDACTED Thu Jul 12 17:11:50 2001 From: Lon.Willett@REDACTED (Lon Willett) Date: Thu, 12 Jul 2001 16:11:50 +0100 Subject: cookies and internet In-Reply-To: <3B8DD831@MailAndNews.com> Message-ID: <5.1.0.14.0.20010712152859.00b0e0b0@emile.sse.ie> At 11:23 12/07/01, taesch wrote: >if the erlang model would be used over the internet, how would the security >model do with that ? Not very well. The current Erlang/OTP implementation pretty much assumes that the transport layer is secure. >is the cookie good enough ? Probably not. It's not really meant to provide anything more than a very simple authentication method that assumes the underlying transport mechanism is secure. And, BTW, the default cookie generation is very broken. This probably doesn't matter, since the mechanism isn't meant to be cryptographically strong anyway. But if you decide to implement a mechanism that is, for example one that uses the cookie as a key to encrypt and MAC the erlang messages, then you will need to be sure that the cookie is generated using a good crypto (P)RNG. >how do u pass it first hand ? Carefully. ;-) But really, if I understand what you're asking, then the answer is that, by design, this is outside the scope of what Erlang/OTP specifies. And with the current Erlang/OTP communications model (where the cookie is sent in the clear anyway), one needn't be too careful with it, but shouldn't be careless either (e.g. ftp is probably fine for transporting it, but be sure that the file protection is set appropriately on the systems where it is stored). >generally, have any study made in this area ? mail postst ? paper ? You can check out the Safe Erlang project at http://www.ericsson.se/cslab/~dan/proj/safeerlang . This is an ambitious attempt to add capabilities based access-control and secure communications to erlang, but I believe that it is still experimental at this time. I also seem to recall hearing rumours that someone made the erlang communications run over SSL, but this might be mistaken. I've been intending to implement a simple version of cryptographically secured communications for Erlang/OTP, but haven't found the time. If someone else is working on this (or wants to), then I'd be happy to share my ideas. There are some subtle problems involved in setting up such a scheme. I hope this helps. /Lon From TXMANYG@REDACTED Thu Jul 12 19:15:04 2001 From: TXMANYG@REDACTED (Anders Nygren (TXM)) Date: Thu, 12 Jul 2001 12:15:04 -0500 Subject: ordered_set in mnesia Message-ID: <2BAC8A0CFC6AD311A0E900508B0904F9273FE6@eamstnt700.txm.ericsson.se> Hi I am wondering about the table_type ordered_set in Mnesia, the documentation mentions that You can create a table with type ordered set but I can not really find any operations to access it. The only operations I can find are dirty_first and dirty_next which is not what I want. Are there no clean first and next operations? What I want to do is to have a persistent queue implemented in Mnesia, any suggestions on how to do it without ordered set? I need the transaction support in mnesia, and the distribution could be useful to in the future. /Anders Nygren -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony@REDACTED Thu Jul 12 20:04:36 2001 From: tony@REDACTED (tony@REDACTED) Date: Thu, 12 Jul 2001 20:04:36 +0200 Subject: cookies and internet References: <5.1.0.14.0.20010712152859.00b0e0b0@emile.sse.ie> Message-ID: <3B4DE6B4.2040100@bluetail.com> Lon Willett wrote: > At 11:23 12/07/01, taesch wrote: > > > But really, if I understand what you're asking, then the answer is > that, by design, this is outside the scope of what Erlang/OTP > specifies. And with the current Erlang/OTP communications model > (where the cookie is sent in the clear anyway), one needn't be too > careful with it, but shouldn't be careless either (e.g. ftp is > probably fine for transporting it, but be sure that the file > protection is set appropriately on the systems where it is stored). The cookie is not sent in the clear! Not since open source erlang anyway. The cookie may be generated or pasted in by hand either in the .erlang.cookie file or from the command line -setcookie When a node connectes with another node, a challenge is sent from the node connected. Then it expects the challenge+cookie md5 sum as return (i.e not in the clear). After that the connection is ready to be hijacked ;-) > >> generally, have any study made in this area ? mail postst ? paper ? > > > You can check out the Safe Erlang project at > http://www.ericsson.se/cslab/~dan/proj/safeerlang . This is an > ambitious attempt to add capabilities based access-control and secure > communications to erlang, but I believe that it is still experimental > at this time. I also seem to recall hearing rumours that someone made > the erlang communications run over SSL, but this might be mistaken. I hope we soon can run distribution over SSL. > > I've been intending to implement a simple version of cryptographically > secured communications for Erlang/OTP, but haven't found the time. If > someone else is working on this (or wants to), then I'd be happy to > share my ideas. There are some subtle problems involved in setting up > such a scheme. > > I hope this helps. I think SSL is the simple way forward. /Tony From Sean.Hinde@REDACTED Thu Jul 12 20:19:05 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Thu, 12 Jul 2001 19:19:05 +0100 Subject: ordered_set in mnesia Message-ID: <402DD461F109D411977E0008C791C312039F6141@imp02mbx.one2one.co.uk> Hi I am wondering about the table_type ordered_set in Mnesia, the documentation mentions that You can create a table with type ordered set but I can not really find any operations to access it. The table is accessed by all the same operations used for set and bag tables. (read, write etc). The only operations I can find are dirty_first and dirty_next which is not what I want. Are there no clean first and next operations? As I understand it there is no difference between dirty_first and what would be a first command. dirty_read and dirty_next are perfectly safe to use in transactions (dirty_write isn't but that is to be expected). What I want to do is to have a persistent queue implemented in Mnesia, any suggestions on how to do it without ordered set? I need the transaction support in mnesia, and the distribution could be useful to in the future. I reimplemented the timer module as a contrib on www.erlang.org which used an mnesia ordered set as the timer queue and also used transactions. (This was before I discovered erlang:start_timer and erlang:send_after ;) ). You might find something of interest in there.. Rgds, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Lon.Willett@REDACTED Thu Jul 12 20:53:29 2001 From: Lon.Willett@REDACTED (Lon Willett) Date: Thu, 12 Jul 2001 19:53:29 +0100 Subject: cookies and internet In-Reply-To: <3B4DE6B4.2040100@bluetail.com> References: <5.1.0.14.0.20010712152859.00b0e0b0@emile.sse.ie> Message-ID: <5.1.0.14.0.20010712192804.04681680@emile.sse.ie> At 19:04 12/07/01, tony@REDACTED wrote: >The cookie is not sent in the clear! >Not since open source erlang anyway. The cookie may be generated or pasted in >by hand either in the .erlang.cookie file or from the command line >-setcookie > >When a node connectes with another node, a challenge is sent from the node >connected. >Then it expects the challenge+cookie md5 sum as return (i.e not in the clear). >After that the connection is ready to be hijacked ;-) Oops. I should have looked more closely. That's good to hear (theoretically, one ought to use a proper MAC, but in this case, a keyed hash should serve well enough). Is the cookie generation also fixed? Last I saw, it was pretty ridiculously weak (although one could always generate it oneself, outside of erlang), but again, I didn't delve into the details, and certainly not recently. >I hope we soon can run distribution over SSL. Is there such a version of erlang available? I'd be interested. >>I've been intending to implement a simple version of cryptographically >>secured communications for Erlang/OTP, but haven't found the time. If >>someone else is working on this (or wants to), then I'd be happy to share >>my ideas. There are some subtle problems involved in setting up such a scheme. >> >>I hope this helps. > >I think SSL is the simple way forward. Maybe. The SSL code is widely available, and the protocol is well analysed. These are definite pluses. The minuses are that SSL is horrendously complex (and early versions of the protocol were flawed, for that very reason), and it is easy to misconfigure, and it usually requires an expensive setup (perhaps overly expensive for something like erlang, where a node coming up may want to make connections to a large number of other nodes at the same time). Note that since erlang nodes only talk to other compatible erlang nodes via their distribution mechanism, there is no requirement that the distribution mechanism be "standards compliant"; thus it would be reasonable to use a simpler protocol. >/Tony Thanks, and sorry about the misinformation, /Lon From Bruce@REDACTED Fri Jul 13 10:34:14 2001 From: Bruce@REDACTED (Bruce Fitzsimons) Date: Fri, 13 Jul 2001 20:34:14 +1200 Subject: Q: Adding nodes to an Mnesia db - the best way? Message-ID: <011201c10b76$99e28410$0221970a@neolineas.com> Hi, I have been playing with adding and deleting nodes on an Mnesia db. Every single time I manage to stuff it up in some way and have Mnesia dump on me. All I want to be able to do is to extend the schema onto a remote db, and then add the tables to the remote db. There appears to be some omissions from the current docs about the schema - the R7B-3 code explicitly limits mnesia:add_table_copy to ram_copies for the schema table. I'm not sure why. Any explanation would be welcome, I am presuming that there is some dependency issue that caused this design. Anyway, the code: rpc:call(Node, mnesia, stop, []), mnesia:add_table_copy(schema, Node, ram_copies), io:format("Created Schema (ram copy)"), rpc:call(Node, mnesia, start, []), %% Wait for Mnesia to start up receive _ -> true after 3000 -> ok end, io:format("Changing schema to disc_copies~n~n"), mnesia:change_table_copy_type(schema, Node, disc_copies), io:format("schema changed - adding tables~n"), mnesia:add_table_copy(worker, Node, disc_copies). I have a local node with everything and a remote node with nothing. There is another node, but that was turned off. I have many weird errors with this code (eg "table schema does not exist" from the change_table_copy_type), but the final situation I got myself into was the local node believing that the remote node was sharing the schema, but the remote node thought that it just had a ram_copies schema of its own. Very weird. I could not delete the table copy because the remote node "wasn't active", and I couldn't get the remote node to realise its place in the world and get the schema copy. A third node that was previously sharing the schema crashed when I started it because the schemas could not be merged. I ended up removing all copies of the database and starting afresh (create_schema(all_three_nodes)). Its not too big a deal at this stage, but it would be nice to know the definitive way of doing this - I am envisaging building a nice screen or two that will let me add/delete nodes at will. Any hints or suggestions about the correct way to add and remove new nodes would be appreciated. Cheers, Bruce From nick@REDACTED Fri Jul 13 15:27:06 2001 From: nick@REDACTED (Niclas Eklund) Date: Fri, 13 Jul 2001 15:27:06 +0200 (MEST) Subject: Q: Adding nodes to an Mnesia db - the best way? In-Reply-To: <011201c10b76$99e28410$0221970a@neolineas.com> Message-ID: Hello! You do not mention that you start the new node (the one you intend to add) using extra_db_nodes: shell> erl -mnesia extra_db_nodes NodeList -name/-sname XX Might this be your problem?! /Nick Example (you can run this from any node in the mnesia-domain): -define(MyTableList, [person, company, ..]). add_node(Node, StorageType) when atom(Node), atom(StorageType) -> case rpc:call(Node, mnesia, system_info, [is_running]) of {badrpc, Reason} -> %% To avoid users doing something they shouldn't ;-) exit("Target node not available"); yes -> copy_tables(?MyTableList, Node, StorageType); no -> exit("Mnesia not started on target node") end. copy_tables([], _, _) -> ok; copy_tables([T|Trest], Node, StorageType) -> case mnesia:add_table_copy(T, Node, StorageType) of {atomic, ok} -> copy_tables(Trest, Node, StorageType); _ -> exit("Unable to copy table(s).") end. On Fri, 13 Jul 2001, Bruce Fitzsimons wrote: > Hi, > > I have been playing with adding and deleting nodes on an Mnesia db. Every > single time I manage to stuff it up in some way and have Mnesia dump on me. > > All I want to be able to do is to extend the schema onto a remote db, and > then add the tables to the remote db. > > There appears to be some omissions from the current docs about the schema - > the R7B-3 code explicitly limits mnesia:add_table_copy to ram_copies for the > schema table. I'm not sure why. Any explanation would be welcome, I am > presuming that there is some dependency issue that caused this design. > > Anyway, the code: > > rpc:call(Node, mnesia, stop, []), > mnesia:add_table_copy(schema, Node, ram_copies), > io:format("Created Schema (ram copy)"), > rpc:call(Node, mnesia, start, []), > %% Wait for Mnesia to start up > receive > _ -> > true > after 3000 -> > ok > end, > io:format("Changing schema to disc_copies~n~n"), > mnesia:change_table_copy_type(schema, Node, disc_copies), > io:format("schema changed - adding tables~n"), > mnesia:add_table_copy(worker, Node, disc_copies). > > I have a local node with everything and a remote node with nothing. There is > another node, but that was turned off. > > I have many weird errors with this code (eg "table schema does not exist" > from the change_table_copy_type), but the final situation I got myself into > was the local node believing that the remote node was sharing the schema, > but the remote node thought that it just had a ram_copies schema of its own. > Very weird. I could not delete the table copy because the remote node > "wasn't active", and I couldn't get the remote node to realise its place in > the world and get the schema copy. A third node that was previously sharing > the schema crashed when I started it because the schemas could not be > merged. > > I ended up removing all copies of the database and starting afresh > (create_schema(all_three_nodes)). Its not too big a deal at this stage, but > it would be nice to know the definitive way of doing this - I am envisaging > building a nice screen or two that will let me add/delete nodes at will. > > Any hints or suggestions about the correct way to add and remove new nodes > would be appreciated. > > Cheers, > Bruce > From vladdu@REDACTED Fri Jul 13 17:12:04 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Fri, 13 Jul 2001 17:12:04 +0200 Subject: "Cleaning" the message queue Message-ID: Hi all, I have an application where processes get messages posted quite often, in a periodical fashion. Sometimes they don't have time to finish processing one message before another drops in, so the message queue grows longer and longer. What I'd want is that in case there are several such messages waiting, only the latest shall be processed, while the rest shall be dumped. (The messages are "virtual clock ticks") I tried some schemes of setting up things, but none worked. It may be supposed that there will only be one kind of messages in the queue. What am I missing? Maybe there is another way to assure many processes get common virtual time information? Where should I look? Thanks in advance, Vlad _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. From vladdu@REDACTED Fri Jul 13 17:12:28 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Fri, 13 Jul 2001 17:12:28 +0200 Subject: "Cleaning" the message queue Message-ID: Hi all, I have an application where processes get messages posted quite often, in a periodical fashion. Sometimes they don't have time to finish processing one message before another drops in, so the message queue grows longer and longer. What I'd want is that in case there are several such messages waiting, only the latest shall be processed, while the rest shall be dumped. (The messages are "virtual clock ticks") I tried some schemes of setting up things, but none worked. It may be supposed that there will only be one kind of messages in the queue. What am I missing? Maybe there is another way to assure many processes get common virtual time information? Where should I look? Thanks in advance, Vlad _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. From vladdu@REDACTED Fri Jul 13 17:12:32 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Fri, 13 Jul 2001 17:12:32 +0200 Subject: "Cleaning" the message queue Message-ID: Hi all, I have an application where processes get messages posted quite often, in a periodical fashion. Sometimes they don't have time to finish processing one message before another drops in, so the message queue grows longer and longer. What I'd want is that in case there are several such messages waiting, only the latest shall be processed, while the rest shall be dumped. (The messages are "virtual clock ticks") I tried some schemes of setting up things, but none worked. It may be supposed that there will only be one kind of messages in the queue. What am I missing? Maybe there is another way to assure many processes get common virtual time information? Where should I look? Thanks in advance, Vlad _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. From luke@REDACTED Fri Jul 13 17:32:50 2001 From: luke@REDACTED (Luke Gorrie) Date: 13 Jul 2001 17:32:50 +0200 Subject: "Cleaning" the message queue In-Reply-To: References: Message-ID: "Vlad Dumitrescu" writes: > Hi all, > > I have an application where processes get messages posted quite often, > in a periodical fashion. Sometimes they don't have time to finish > processing one message before another drops in, so the message queue > grows longer and longer. > > What I'd want is that in case there are several such messages waiting, > only the latest shall be processed, while the rest shall be > dumped. (The messages are "virtual clock ticks") Here's an example program with a "receiver" process that gets 'go' messages, and discards duplicates that pile up on its message queue. Hopefully its pretty similar to your situation. Since I have no information in my "go" messages I'm not actually using the "latest" one, but that'd be an easy change. --- SNIP --- -module(receive_one). -export([test/0]). -export([receiver/0]). % internal %% Test: We create a "receiver" process that will handle some 'go' %% messages. We expect it to only actually handle two of them and %% discard the rest, due to the timings! %% %% So we expect the string "Going!" should be io:format'd just twice. test() -> Receiver = spawn_link(?MODULE, receiver, []), Receiver ! go, %% After this wait, the receiver will be busy processing the first %% 'go', allowing the next ones to accumulate in its message queue wait(5), Receiver ! go, Receiver ! go, Receiver ! go, Receiver ! go. receiver() -> receive_go(), process(), receiver(). %% Process a 'go' message. This takes some time. process() -> io:format("Going!~n"), %% We spend 500ms "processing" each message, so that there's time %% for new ones to accumulate on our message queue. wait(500). %% Wait to receive a 'go' message, and flush any extra ones. receive_go() -> receive go -> flush_go_msgs(), ok end. flush_go_msgs() -> %% Receive/discard go messages until we timeout with 'after 0' - %% i.e. until no go messages are left on message queue receive go -> flush_go_msgs() after 0 -> no_more_gos end. wait(Time) -> receive i_never_get_this -> exit(impossible) after Time -> ok end. From willem@REDACTED Fri Jul 13 18:01:33 2001 From: willem@REDACTED (Willem Broekema) Date: Fri, 13 Jul 2001 18:01:33 +0200 Subject: "Cleaning" the message queue References: Message-ID: <3B4F1B5D.6050802@pastelhorn.com> Heh, this looks like a nice way to compensate for my DOH get_tcp/gen_tcp typo question. ;-) Vlad Dumitrescu wrote: > What I'd want is that in case there are several such messages waiting, > only the latest shall be processed, while the rest shall be dumped. > (The messages are "virtual clock ticks") I came up with the following simple solution: -module(getlatest). -export([start/0]). start() -> loop(). loop() -> receive {From, get_latest} -> From ! get_latest(), loop() end. get_latest() -> get_latest(queue_was_empty). get_latest(LastUntilNow) -> %% if there's no new message in the queue, return 'LastUntilNow' receive Newer -> get_latest(Newer) after 0 -> LastUntilNow end. And works like: 23> S = spawn_link(getlatest, start, []). <0.65.0> 24> S ! first. first 25> S ! second. second 26> S ! last. last 27> S ! {self(), get_latest}. {<0.41.0>,get_latest} 28> flush(). Shell got last ok 29> HTH - Willem From Sean.Hinde@REDACTED Fri Jul 13 19:13:57 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 13 Jul 2001 18:13:57 +0100 Subject: Q: Adding nodes to an Mnesia db - the best way? Message-ID: <402DD461F109D411977E0008C791C312039F6148@imp02mbx.one2one.co.uk> > Hello! > > You do not mention that you start the new node (the one you > intend to add) > using extra_db_nodes: > > shell> erl -mnesia extra_db_nodes NodeList -name/-sname XX This can also be done with: 1. Start mnesia on new node with mnesia:start(). Thus creating a ram schema. 2. On the same new node do mnesia:change_config(extra_db_nodes, [any_existing_node@REDACTED]). This should return {ok, [any_existing_node@REDACTED]} if successful. 3. Again on the new node do mnesia:change_table_copy_type(schema, node(), disc_copies). Rgds, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From gupta@REDACTED Sat Jul 14 14:17:22 2001 From: gupta@REDACTED (Gopal Gupta) Date: Sat, 14 Jul 2001 07:17:22 -0500 Subject: PADL'02: Call for papers Message-ID: <200107141217.f6ECHMH29427@herbrand.utdallas.edu> [- Apologies for multiple messages; - Pls note that the deadline for submission, Aug 10, is very near; - PADL'02 proceedings will be published as Springer Verlag LNCS, past proceedings can be found in LNCS 1551, 1753 and 1990. ] CALL FOR PAPERS!!! CALL FOR PAPERS!!! CALL FOR PAPERS!!! Fourth International Symposium on Practical Aspects of Declarative Languages http://www.cs.sunysb.edu/~padl2002 (PADL '02) Portland, Oregon, USA Jan 19-20, 2002 Co-located with POPL 2002 Declarative languages build on sound theoretical bases to provide attractive frameworks for application development. These languages have been successfully applied to vastly different real-world situations, ranging from data base management to active networks to software engineering to decision support systems. New developments in theory and implementation have opened up new application areas. At the same time, applications of declarative languages to novel problems raises numerous interesting research issues. Well-known questions include designing for scalability, language extensions for application deployment, and programming environments. Thus, applications drive the progress in the theory and implementation of declarative systems, and benefit from this progress as well. PADL provides a forum for researchers, practitioners, and implementors of declarative languages to exchange ideas on current and novel application areas and on the requirements for effective deployment of declarative systems. We invite papers dealing with practical applications of newly discovered results and techniques in logic, constraint, and functional programming. Papers dealing with practical applications of theoretical results, new techniques of implementation with considerable impact on an application, or innovative applications are particularly welcome. Position papers as well as papers that present works in progress are also welcome. The scope of PADL includes, but is not limited to: o Innovative applications of declarative languages o Declarative domain-specific languages and applications o New developments in declarative languages and their impact on applications o Practical experiences o Evaluation of implementation techniques on practical applications o Novel uses of declarative languages in the classroom The papers should highlight the practical contribution of the work and the relevance of declarative languages to achieve that end. PADL 2002 will co-locate with ACM POPL 2002, in Portland, Oregon. Previous PADLs were held in San Antonio (1999), Boston (2000), and Las Vegas (2001). Important Dates: o Paper Submission: Aug. 10, 2001 o Notification: Oct. 8, 2001 o Camera Ready: Nov. 5, 2001 o Symposium: Jan. 19-20, 2002 Paper Submission: Authors should submit an electronic copy of the full paper (written in English) in Postscript (Level 2) or PDF. Papers must be no longer than 15 pages, written in 11-point font and with single spacing. Since the final proceedings will be published as Lecture Notes in Computer Science by Springer Verlag, authors are strongly encouraged to use the LNCS paper formatting guidelines for their submission. Each submission must include, on its 1st page, the paper title; authors and their affiliations; contact author's email and postal addresses, telephone and fax numbers, abstract, and three to four keywords. The keywords will be used to assist us in selecting appropriate reviewers for the paper. If electronic submission is impossible, please contact the program co-chairs for information on how to submit hard copies. Program Committee: o Sergio Antoy, Portland State University, USA o Gopal Gupta, UT Dallas (Organizer) o Joxan Jaffar, National University of Singapore o Fergus Henderson, University of Melbourne, Australia o Shriram Krishnamurthi, Brown University, USA (Program Co-chair) o Andrew Kennedy, Microsoft Research, UK o Michael Leuschel, University of Southampton, UK o Kim Marriott, Monash University, Australia o John Peterson, Yale University, USA o Andreas Podelski, MPI, Germany o Enrico Pontelli, New Mexico State University, USA o C.R. Ramakrishnan, SUNY, Stony Brook, USA (Program Co-chair) o John Reppy, Bell Labs Lucent Technologies o Manuel Serrano, Universit'e de Nice, France o Olin Shivers, Georgia Tech, USA o Paul Tarau, University of North Texas, USA For more Information, please contact C.R. Ramakrishnan Computer Science Department SUNY at Stony Brook Stony Brook, NY 11794-4400 USA email: cram@REDACTED From julian@REDACTED Mon Jul 16 06:04:46 2001 From: julian@REDACTED (julian@REDACTED) Date: Mon, 16 Jul 2001 04:04:46 -0000 Subject: Lists of records Message-ID: <17dd01c10dac$73d10a20$3c6f10ac@pcm> Hi All, I'm new to Erlang, and I'm still trying to get familiar with lists and records. I have a (small) list containing records (all of the same type) and I'm trying to write a function to return a record when supplied with a field name and value. I'm happy to assume the field name chosen happens to contain unique values for now. I've tried a few things, including the idea below.. but I'm not having much luck. Is there a way to do something like this without hardcoding the Fieldname? Are there any other docs and/or examples on the subject of records apart from the "Erlang Extensions Since 4.4" doc? find_record(Fieldname,Searchvalue,[H|T]) -> case H of #recordtype1{Fieldname=Searchvalue} -> H; _ -> find_record(Fieldname,Searchvalue,T) end; find_record(Fieldname,Searchvalue,[]) -> not_found. The above seems to compile & work only if Fieldname is replaced with an atom. I had also hoped to extend this so that the recordtype isn't hardcoded.. any ideas? Thanks & Regards, Julian Noble From etxhste@REDACTED Mon Jul 16 11:03:55 2001 From: etxhste@REDACTED (Hakan Stenholm) Date: Mon, 16 Jul 2001 11:03:55 +0200 (MET DST) Subject: erlang-questions@erlang.org Message-ID: <200107160903.LAA09806@avc240.etxb.ericsson.se> You can use lists:keysearch/3 like this %% The internal representation of a record is a tuple, it is therefore %% possible to use all functions that work on tuples on records as well %% use the #RecordName.FieldName construct rather than hardcoding the value %% this ensures that it will still work if you change the record, i.e. you %% don't need to know anything about a record is represented as a tuple find_record(RecordName,Fieldname,Searchvalue,List) -> Pos = #myrecord.myfieldname, %% this is the records field %% pos in the tuple case lists:keysearch(Searchvalue,Pos,List) of {value,Rec} -> Rec; _ -> not_found end. In #RecordName.FieldName the field name must be a atom (acording to the documentation) this is most likely due to that records are simply syntactic suger that is converted to element/2 and setelement/3 during the preprocessor phase in the compiler. See the text below (copied from the documentation), it might be possible to use record_info(fields, Rec) to get the position of each field (pos_in_list +1): 1.9 Internal Representation of Records It is often desirable to write generic functions which will work on any record, not just a record of a particular type. For this reason, records are represented internally as tuples and the ordering of the fields in the tuple is strictly defined. For example, the record -record(person, {name, phone, address}). is represented internally by the tuple {person, X,Y, Z}. The arity of the tuple is one more than the number of fields in the tuple. The first element of the tuple is the name of the record, and the elements of the tuple are the fields in the record. The variables X, Y and Z will store the data contained in the record fields. The following two functions determine the indices in the tuple which refer to the named fields in the record: * record_info(fields, Rec) -> [Names]. This function returns the names of the fields in the record Rec. For example,record_info(fields, person) evaluates to [name, address, phone]. * record_info(size, Rec) -> Size. This function returns the size of the record Rec when represented as a tuple, which is one more than the number of fields. For example, record_info(size, person) returns 4. In addition, #Rec.Name returns the index in the tuple representation of Name of the record Rec. ->>> Name must be an atom. For example, the following test function test() might return the result shown: test() -> {record_info(fields, person), record_info(size, person), #person.name}. > Mod:test(). {[name,address,phone],4,2} The order in which records map onto tuples is implementation dependent. ->>> record_info is a pseudo-function which cannot be exported from the module where it occurs. From etxhste@REDACTED Mon Jul 16 12:07:24 2001 From: etxhste@REDACTED (Hakan Stenholm) Date: Mon, 16 Jul 2001 12:07:24 +0200 (MET DST) Subject: Lists of records Message-ID: <200107161007.MAA09868@avc240.etxb.ericsson.se> You can use lists:keysearch/3 like this %% The internal representation of a record is a tuple, it is therefore %% possible to use all functions that work on tuples on records as well %% use the #RecordName.FieldName construct rather than hardcoding the value %% this ensures that it will still work if you change the record, i.e. you %% don't need to know anything about a record is represented as a tuple find_record(RecordName,Fieldname,Searchvalue,List) -> Pos = #myrecord.myfieldname, %% this is the records field %% pos in the tuple case lists:keysearch(Searchvalue,Pos,List) of {value,Rec} -> Rec; _ -> not_found end. In #RecordName.FieldName the field name must be a atom (acording to the documentation) this is most likely due to that records are simply syntactic suger that is converted to element/2 and setelement/3 during the preprocessor phase in the compiler. See the text below (copied from the documentation), it might be possible to use record_info(fields, Rec) to get the position of each field (pos_in_list +1): 1.9 Internal Representation of Records It is often desirable to write generic functions which will work on any record, not just a record of a particular type. For this reason, records are represented internally as tuples and the ordering of the fields in the tuple is strictly defined. For example, the record -record(person, {name, phone, address}). is represented internally by the tuple {person, X,Y, Z}. The arity of the tuple is one more than the number of fields in the tuple. The first element of the tuple is the name of the record, and the elements of the tuple are the fields in the record. The variables X, Y and Z will store the data contained in the record fields. The following two functions determine the indices in the tuple which refer to the named fields in the record: * record_info(fields, Rec) -> [Names]. This function returns the names of the fields in the record Rec. For example,record_info(fields, person) evaluates to [name, address, phone]. * record_info(size, Rec) -> Size. This function returns the size of the record Rec when represented as a tuple, which is one more than the number of fields. For example, record_info(size, person) returns 4. In addition, #Rec.Name returns the index in the tuple representation of Name of the record Rec. ->>> Name must be an atom. For example, the following test function test() might return the result shown: test() -> {record_info(fields, person), record_info(size, person), #person.name}. > Mod:test(). {[name,address,phone],4,2} The order in which records map onto tuples is implementation dependent. ->>> record_info is a pseudo-function which cannot be exported from the module where it occurs. From nico.weling@REDACTED Mon Jul 16 13:59:38 2001 From: nico.weling@REDACTED (Nico Weling) Date: Mon, 16 Jul 2001 13:59:38 +0200 Subject: HowTo increase FTP-Open timeout (ehost error) Message-ID: <3B52D72A.8EB400D5@eed.ericsson.se> Hi, I'm using the FTP-Module to open 32 ftp conections with 32 mobiles. Sometimes I see an "ehost" error when I try to open a connection. The problem is that it takes sometimes more than 60secs to open a connection. Does somebody know how to increase the timer for this ehost-error? Thanks in advance, best regagds, Nico Weling. From Sean.Hinde@REDACTED Mon Jul 16 14:13:03 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 16 Jul 2001 13:13:03 +0100 Subject: HowTo increase FTP-Open timeout (ehost error) Message-ID: <402DD461F109D411977E0008C791C312039F615A@imp02mbx.one2one.co.uk> Hi, > I'm using the FTP-Module to open 32 ftp conections with 32 > mobiles. Sometimes I see an "ehost" error when I try to open > a connection. The problem is that it takes sometimes more > than 60secs to open a connection. > > Does somebody know how to increase the timer for this ehost-error? The short answer is that it is not possible. It appears to be hard coded as -define(OPEN_TIMEOUT,60*1000). in ftp.erl This is used directly in the gen_tcp:connect/4 call so it is not configurable at runtime. Your options are: * Change the -define and recompile * Modify ftp.erl to make it a configureable parameter.. * Ask Ericsson to change it in the next patch release. If you fancy having a go at making it configurable you always have the option to send it to erlang-maintainers@REDACTED requesting that they include your changes. Rgds, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From nico.weling@REDACTED Mon Jul 16 15:24:50 2001 From: nico.weling@REDACTED (Nico Weling) Date: Mon, 16 Jul 2001 15:24:50 +0200 Subject: HowTo recompile erlang source code? References: <402DD461F109D411977E0008C791C312039F615A@imp02mbx.one2one.co.uk> Message-ID: <3B52EB22.991EBD60@eed.ericsson.se> Hi Sean, thanks for your fast reply! I've changed the ftp.erl file that was very easy, but how do I recompile the Erlang source code? Is ./Install in erl_root_directory enough? It seems me not. > Your options are: > > * Change the -define and recompile > From Sean.Hinde@REDACTED Mon Jul 16 15:40:44 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 16 Jul 2001 14:40:44 +0100 Subject: HowTo recompile erlang source code? Message-ID: <402DD461F109D411977E0008C791C312039F6164@imp02mbx.one2one.co.uk> > I've changed the ftp.erl file that was very easy, but how do > I recompile the > Erlang source code? The quick and dirty way is use: erlc ftp.erl at the unix prompt where you have your new ftp.erl. This gives you the ftp.beam file you need. Then if you just copy this into erlang/lib/inets-x.x.x/ebin wherever you have installed Erlang you will get the new version next time you start it up. Or you could put it somewhere which comes before inets in your code path: If you add something like: code:add_patha("/home/nico/patches"). in your .erlang file then the erlang runtime will look here for the ftp.erl file before anywhere else. You may run in to trouble with sticky directories (the shell tries to stop you re-loading core erlang modules as a kind of basic protection against user messups) so this is probably not the best way forward. Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Sean.Hinde@REDACTED Mon Jul 16 15:42:39 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 16 Jul 2001 14:42:39 +0100 Subject: HowTo recompile erlang source code? Message-ID: <402DD461F109D411977E0008C791C312039F6165@imp02mbx.one2one.co.uk> > I've changed the ftp.erl file that was very easy, but how do > I recompile the > Erlang source code? I should probably add to my last reply that in general modifying the built in libraries is not a good idea as there may be all sorts of unforseen consequences. (not least for any support agreements you might have!) - Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From per@REDACTED Mon Jul 16 23:10:34 2001 From: per@REDACTED (per@REDACTED) Date: Mon, 16 Jul 2001 23:10:34 +0200 (CEST) Subject: HowTo increase FTP-Open timeout (ehost error) In-Reply-To: <402DD461F109D411977E0008C791C312039F615A@imp02mbx.one2one.co.uk> Message-ID: <200107162110.f6GLAYo98408@tordmule.bluetail.com> Sean Hinde wrote: > >> I'm using the FTP-Module to open 32 ftp conections with 32 >> mobiles. Sometimes I see an "ehost" error when I try to open >> a connection. The problem is that it takes sometimes more >> than 60secs to open a connection. >> >> Does somebody know how to increase the timer for this ehost-error? > >The short answer is that it is not possible. It appears to be hard coded as > >-define(OPEN_TIMEOUT,60*1000). in ftp.erl > >This is used directly in the gen_tcp:connect/4 call so it is not >configurable at runtime. > >Your options are: > >* Change the -define and recompile > >* Modify ftp.erl to make it a configureable parameter.. > >* Ask Ericsson to change it in the next patch release. It may be the case that neither of those will help a whole lot though - the TCP/IP stack in the kernel of most OSes will impose its own timeout on TCP connection attempts, and changing the argument to gen_tcp:connect() can't *raise* that timeout. A typical value on Unices is ~ 75 seconds, which (like the 60 seconds of ftp.erl) is very "generous" for "normal" situations, but not much higher than 60. I think Nico will need to code for the possibility of connection timeouts and do explicit retries. --Per Hedeland per@REDACTED From bjarne@REDACTED Tue Jul 17 14:01:03 2001 From: bjarne@REDACTED (Bjarne =?iso-8859-1?Q?D=E4cker?=) Date: Tue, 17 Jul 2001 14:01:03 +0200 Subject: PADL'02: Call for papers Message-ID: <3B5428FF.9CA78D02@erix.ericsson.se> -------------- next part -------------- An embedded message was scrubbed... From: Gopal Gupta Subject: PADL'02: Call for papers Date: Sat, 14 Jul 2001 07:17:22 -0500 Size: 6487 URL: From nico.weling@REDACTED Wed Jul 18 15:33:03 2001 From: nico.weling@REDACTED (Nico Weling) Date: Wed, 18 Jul 2001 15:33:03 +0200 Subject: HowTo increase the EPATH timeout? Message-ID: <3B55900F.D6F7AE7D@eed.ericsson.se> Hi Erlang-Freaks, last week I've increased the timer for ftp:open (ehost). Thanks to Sean for the information where to change it. But now I need to increase the timer for the epath error which occurs when the transmission of the ftp data is interrupted for more than some minutes. Thanks in advance, best regards, Nico. -- Nico Weling Software Designer Ericsson Eurolab Deutschland GmbH Verification Tool Design mailto:Nico.Weling@REDACTED From vances@REDACTED Wed Jul 18 16:06:12 2001 From: vances@REDACTED (Vance Shipley) Date: Wed, 18 Jul 2001 10:06:12 -0400 Subject: HowTo increase the EPATH timeout? In-Reply-To: <3B55900F.D6F7AE7D@eed.ericsson.se> Message-ID: Nico, I would presume that this occurs when TCP gives up the ghost 'cause it's not getting any response from the distant end. You'd need to change your kernel parameters to make TCP more patient. -Vance > last week I've increased the timer for ftp:open (ehost). Thanks > to Sean for the information where to change it. But now I need to > increase the timer for the epath error which occurs when the > transmission of the ftp data is interrupted for more than some minutes. > > Thanks in advance, > > best regards, > > Nico. From willem@REDACTED Wed Jul 18 20:59:32 2001 From: willem@REDACTED (Willem Broekema) Date: Wed, 18 Jul 2001 20:59:32 +0200 Subject: multiple waiting gen_tcp:accepts Message-ID: <3B55DC94.8080404@pastelhorn.com> Is there a reason why there can not be two waiting gen_tcp:accept()'s at the same time? In the code below, when "start()" is called, the *second* spawned do_accept will write "{error, einval}" as soon as it is started, while I would expect this to behave as: - A1 and A2 are put in a queue waiting for incoming connections - A1 gets the first incoming one - A2 gets the second start() -> {ok, LSock} = gen_tcp:listen(5568, [binary, {packet, 0}, {active, true}, {reuseaddr, true}]), A1 = spawn_link(?MODULE, do_accept, [LSock, 1]), A2 = spawn_link(?MODULE, do_accept, [LSock, 2]), ready. do_accept(LSock, N) -> io:write( gen_tcp:accept(LSock) ). Another question: "get_func()" below returns a function. Immediatly calling "get_func()(3)" gives a syntax error, while "A = get_func(), A(3)" behaves ok. What's the reason for that? I guess it has to do with that funs are a late addition to Erlang, and the syntax parser didn't have to deal with double brackets - "...(..)(..)" - before that? triple(X) -> 3*X. get_func() -> fun triple/1. exec_func() -> %% this gives an error: % get_func()(3). %% while this works: A = get_func(), A(3). TIA - Willem From pugliese@REDACTED Thu Jul 19 12:03:45 2001 From: pugliese@REDACTED (Rosario Pugliese) Date: Thu, 19 Jul 2001 12:03:45 +0200 Subject: PLI2001: Early Registration Deadline is approaching Message-ID: <3B56B081.BC532126@dsi.unifi.it> [Apologies for multiple copies] ---------------------------------------------------------------- EARLY REGISTRATION DEADLINE IS APPROACHING PLI 2001 Principles, Logics, and Implementations of high-level programming languages Firenze, ITALY September 2 - 8, 2001 http://music.dsi.unifi.it/pli01/ The colloquium on Principles, Logics, and Implementations of high- level programming languages is a collection of events aimed at the advancement of high-level programming languages. PLI 2001 includes the following conferences and workshops: ACM Sponsored Conferences: ICFP (September 3-5) Int. Conf. on Functional Programming General chair: Benjamin Pierce (Univ. Pennsylvania) Program chair: Xavier Leroy (INRIA Rocquencourt) Invited speakers: To be announced PPDP (September 5-7) Int. Conf. on Principles and Practice of Declarative Programming Conference chair: Rocco De Nicola (Univ. Firenze) Program chair: Harald S??ndergaard (Univ. Melbourne) Invited speakers: J. Esparza, A. Gordon, and D.A. Schmidt. ACM Sponsored Workshops: ? BABEL (Multi-language Infrastructure and Interoperability) ? HASKELL ? QAPL (Quantitative Aspects of Programming Languages) ? RULE (Rule-Based Programming) ? SAIG (Semantics, Applications, and Implementation of Program Generation) ? SCHEME (Scheme and Functional Programming) ? VCL (Verification and Computational Logic) Co-located Workshops: ? ERLANG ? FICS (Fixed Points in Computer Science) A detailed presentation of PLI2001, including schedule of events, travel, logistic and tourist information, is available at http://music.dsi.unifi.it/pli01/. Registration and accommodation information and forms are available at http://music.dsi.unifi.it/pli01/registration/ Early registration rates apply until July 25. For informations about hotels please contact (mentioning PLI 2001) Giubbi Jet di Volo Viaggi Piazza San Jacopino, 34/r - 50144 Firenze Telephone: +39 055 3249074 - +39 055 350577 Fax: +39 055 366807 E-mail: incoming@REDACTED For all other informations mail to pli-org@REDACTED ------------------------------------------------------------------- Firenze is packed in September; do book accommodation as soon as possible. ------------------------------------------------------------------- From kjetilrossavik@REDACTED Thu Jul 19 18:20:47 2001 From: kjetilrossavik@REDACTED (Kjetil Rossavik) Date: Thu, 19 Jul 2001 17:20:47 +0100 Subject: Fwd: Erlang: orber problem Message-ID: <3B5708DF.C6A265CC@yahoo.com> Luke@REDACTED pointed me to this mailing list. Greatful for any pointers. Thanks, KJ. Hi, I am experimenting with R7B (probably R7B-2 - how do I check?) orber on Windows2000 client communicating with Orbix 3.0.1 on Solaris server. I can communicate with the server, but in some instances I am getting the following exception: {'EXCEPTION',{'MARSHAL',[],107,'COMPLETED_MAYBE'}} 1. Is this a client (Erlang/Win2K) or server (Orbix/Solaris) marshalling failure? 2. Where can I find explanations for these error codes 3. (long shot) Is this a known problem, e.g. fixed in OTP R7B-3 (readme lists lots of orber fixes) I will provide more information as required, thought I would start off nice and simple. Thanks, KJ. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com From nick@REDACTED Fri Jul 20 09:53:46 2001 From: nick@REDACTED (Niclas Eklund) Date: Fri, 20 Jul 2001 09:53:46 +0200 (MEST) Subject: Fwd: Erlang: orber problem In-Reply-To: <3B5708DF.C6A265CC@yahoo.com> Message-ID: On Thu, 19 Jul 2001, Kjetil Rossavik wrote: > I am experimenting with R7B (probably R7B-2 - how do I check?) orber on > Windows2000 client communicating with Orbix 3.0.1 on Solaris server. A simple way to check which Orber-version you are using is: erl> m(orber). > I can communicate with the server, but in some instances I am getting > the following exception: > {'EXCEPTION',{'MARSHAL',[],107,'COMPLETED_MAYBE'}} > > 1. Is this a client (Erlang/Win2K) or server (Orbix/Solaris) marshalling > failure? If you don't run Orber as lightweight the exception above is thrown when Orber attempts to decode a message (e.g. Reply, Request). > 2. Where can I find explanations for these error codes. I'm afraid their assigned values are not documented. > 3. (long shot) Is this a known problem, e.g. fixed in OTP R7B-3 (readme > lists lots of orber fixes) Probably not. However, the Orbix IIOP implementation was buggy prior to Orbix-3.3 (patch 20); sends garbage on the wire in some cases. Consult: http://www2.iona.com/MinervaRoot/index.jsp?action=article&catId=_0&articleURL=/support/articles/2874.192.xml Most of the changes in R7B-3 was to reduce overhead and adding new features. The bug-fixes shouldn't have any impact on your application. > I will provide more information as required, thought I would start off > nice and simple. Even though it's not documented (prior to 3.2.5) you can set the configuration parameter 'orber_debug_level' which will generate printouts when something abnormal occurs (NOTE, not always errors). Usage: shell> erl -orber orber_debug_level 10 Please supply all printouts and the exact Orber-version. The most common mistake is that the IDL-specs isn't registered in the IFR. When compiling your IDL-file(s) erl-module(s) (named 'oe_XXX.erl') is generated and contains the function oe_register(). If this doen's solve your problem please e-mail again. /Nick From kjr@REDACTED Fri Jul 20 18:33:41 2001 From: kjr@REDACTED (Kjetil Rossavik) Date: Fri, 20 Jul 2001 17:33:41 +0100 Subject: Fwd: Erlang: orber problem Message-ID: <4.3.2.7.2.20010720172658.00b99748@glasgow.cisco.com> Thanks a lot for your response. You were right about not having registered my types - didn't realise you should, the tutorial example is not clear on that. My stupidity was worse than that, I'm afraid, I had forgotten to compile my ic:gen() generates. I am trying that out now, but compiling the generated code has been running for 1 hour 25 now... > > I can communicate with the server, but in some instances I am getting > > the following exception: > > {'EXCEPTION',{'MARSHAL',[],107,'COMPLETED_MAYBE'}} > > > > 1. Is this a client (Erlang/Win2K) or server (Orbix/Solaris) marshalling > > failure? > > If you don't run Orber as lightweight the exception above is thrown when > Orber attempts to decode a message (e.g. Reply, Request). Should I be running as lightweight? D:\temp\erl>erl -orber lightweight [\"marketing-u10:1570\"] -orber domain "ORBER_LIGHT" Eshell V5.0.2 (abort with ^G) 1> orber:start_lightweight(). {error,{bad_environment_value,"\"[\"marketing-u10:1570\"]\""}} =ERROR REPORT==== 20-Jul-2001::17:04:11 === application_controller: syntax error before: marketing: "["marketing-u10:1570"]" Thanks, KJ. From tony@REDACTED Sat Jul 21 01:02:08 2001 From: tony@REDACTED (Tony Rogvall) Date: Sat, 21 Jul 2001 01:02:08 +0200 Subject: multiple waiting gen_tcp:accepts References: <3B55DC94.8080404@pastelhorn.com> Message-ID: <3B58B870.3010308@bluetail.com> Willem Broekema wrote: > Is there a reason why there can not be two waiting gen_tcp:accept()'s > at the same time? In the code below, when "start()" is called, the > *second* spawned do_accept will write "{error, einval}" as soon as it > is started, while I would expect this to behave as: The simple answer is that the driver (erlang-c interface) is not coded to handle multiple accepts on the the same listen socket. Of course this should be possible, but first there must be yet an other iteration over the inet_drv implementation. The next inet_drv/gen_tcp implementation will hopefully handle this. The more complicated answer is that the problem is that with non-blocking IO you have to listen/poll on the listen file descriptor to see when you can do the accept without blocking the entire erlang node. This means that the inet_drv driver must handle the accept queue it self, and this is what is missing (or the queue length is max 1). > > - A1 and A2 are put in a queue waiting for incoming connections > - A1 gets the first incoming one > - A2 gets the second > > start() -> > {ok, LSock} = gen_tcp:listen(5568, > [binary, {packet, 0}, {active, true}, {reuseaddr, true}]), > A1 = spawn_link(?MODULE, do_accept, [LSock, 1]), > A2 = spawn_link(?MODULE, do_accept, [LSock, 2]), > ready. I would not bet on A1 getting the first and A2 getting the second, but may be it does not make any difference in this case ? > > do_accept(LSock, N) -> > io:write( gen_tcp:accept(LSock) ). > > > Another question: > > "get_func()" below returns a function. Immediatly calling > "get_func()(3)" gives a syntax error, while "A = get_func(), A(3)" > behaves ok. What's the reason for that? I guess it has to do with that > funs are a late addition to Erlang, and the syntax parser didn't have > to deal with double brackets - "...(..)(..)" - before that? > > triple(X) -> 3*X. > > get_func() -> > fun triple/1. > > exec_func() -> > %% this gives an error: Try this: (get_func())(3). > > % get_func()(3). > > %% while this works: > A = get_func(), > A(3). > > > TIA > > - Willem /Tony From matthias@REDACTED Sat Jul 21 22:12:08 2001 From: matthias@REDACTED (matthias@REDACTED) Date: Sat, 21 Jul 2001 22:12:08 +0200 Subject: multiple waiting gen_tcp:accepts In-Reply-To: <3B55DC94.8080404@pastelhorn.com> References: <3B55DC94.8080404@pastelhorn.com> Message-ID: <15193.57880.886897.39144@corelatus.com> > "get_func()" below returns a function. Immediatly calling > "get_func()(3)" gives a syntax error, while "A = get_func(), A(3)" > behaves ok. What's the reason for that? I guess it has to do with that > funs are a late addition to Erlang, and the syntax parser didn't have to > deal with double brackets - "...(..)(..)" - before that? The grammar (see E2 in http://www.erlang.org/download/erl_spec47.ps.gz) does allow (get_func())(3) so at least the grammar agrees with reality. As to why it's that way, I don't know. Maybe it's a bit like asking 'why isn't there any currying'. There just isn't. Matthias From tony@REDACTED Mon Jul 23 02:44:07 2001 From: tony@REDACTED (Tony Rogvall) Date: Mon, 23 Jul 2001 02:44:07 +0200 Subject: Erlang/Gtk Message-ID: <3B5B7357.3060804@bluetail.com> Finally I made a first TEST release of erlgtk (0.9.2) This release will at least work for linux, a windows release is running, but still a bit hard to compile (and assemble :-) Developers are welcome to the sourceforge to give me a hand. Features in this release: - Gtk/Gdk support. - Glade/XML support (glade2erl both compile and view) - Basic gnome gui support (more will be added) - Inital GtkGL support (opengl) - Examples. Still many small things missing. - Collision with gs (gs has an internal module called gtk). I have already got a promise that the gs (gtk) module will be renamed to make room for the gtk module. This means that gtk and gs will not run very good together. I think that I will add a patch for this later. - A controversial thing, the arity of fun's. The Erlang/Gtk binding will be more beautiful if fun's can have arbitrary arity (as in C) where extra arguments are just discarded. erlang:fun_info(Fun, arity) could fix this. Now the Gtk callback must have the correct number of arguments, even though in Erlang (with closure) there is seldom need for the arguments at all. Please look in the examples direcory, and learn some Gtk before ask a lot of questions ;-) Gtk is easy to learn, and produce nice output (I think) download it from: http://prdownloads.sourceforge.net/erlgtk/erlgtk-0.9.2.tar.gz Have fun /Tony From garry@REDACTED Mon Jul 23 02:56:51 2001 From: garry@REDACTED (Garrett G. Hodgson) Date: Sun, 22 Jul 2001 20:56:51 -0400 (EDT) Subject: how to kill a port's external process? Message-ID: <200107230056.UAA64560@sprache.sage.att.com> i'm building a little gui wrapper around a command line audio player. i've got an erlang process that calls open_port() to spawn the external player, but it doesn't actually send/receive anything to it over stdio. when i send the controlling process a stop message, it sends a { self(), close } message to the port, then receives the {Port, closed} reply and exits. but the external player doesn't stop playing. if i kill it from another window before sending the stop, the controlling process gets the proper exit_status message, so i know they're connected. i can even exit erlang entirely, and it keeps playing until i kill it. so, is there a clean way to kill this beast? i can think of some kludgey ways, like gathering the output of ps and constructing a unix command to kill it. but it seems like there ought to be a better way? can someone point me in the right direction? thanks. Garry Hodgson And when they offer Senior Hacker golden apples garry@REDACTED are you sure you'll refuse? Software Innovation Services Heaven help the fool. AT&T Labs From nick@REDACTED Mon Jul 23 10:49:02 2001 From: nick@REDACTED (Niclas Eklund) Date: Mon, 23 Jul 2001 10:49:02 +0200 (MEST) Subject: Fwd: Erlang: orber problem In-Reply-To: <4.3.2.7.2.20010720172658.00b99748@glasgow.cisco.com> Message-ID: On Fri, 20 Jul 2001, Kjetil Rossavik wrote: > You were right about not having registered my types - didn't realise you > should, the tutorial example is not clear on that. My stupidity was worse > than that, I'm afraid, I had forgotten to compile my ic:gen() generates. I > am trying that out now, but compiling the generated code has been running > for 1 hour 25 now... The compile-time depends on your IDL-files. Make sure you use separate files for separate IDL module-definitions. I do recommend that you upgrade to the latest Orber-version since the IIOP-overhead have been reduced significantly and a new version is on its way which improve the performance even more! > Should I be running as lightweight? If you start Orber as lightweight it can only act as client-side. To be able to reduce possible error-reasons I had to ask that question. Usually the best option is to start Orber as non-lightweight (even a must in most cases). /Nick From Sean.Hinde@REDACTED Mon Jul 23 17:53:41 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 23 Jul 2001 16:53:41 +0100 Subject: Multithreaded Drivers Message-ID: <402DD461F109D411977E0008C791C312039F61A5@imp02mbx.one2one.co.uk> All, I'm digging through the existing drivers trying to figure out how they work.. Particularly with regard to multithreaded drivers. So far I have figured out from studying efile_drv that: The start function should return a pointer to the struct which holds all the state for the thread. This is so that each call to open_port will generate it's own state which is passed to whichever thread happens to be used to process the call. This pointer is cast to a long to keep the type system happy :) Q. Can I use the new erl_driver.h functions with multithreaded drivers (I notice that not all the functions in driver.h are included in the new one, particularly driver_async)? Q. I presume if so I can just cast the pointer to my state into a ErlDrvData? The start function in efile_drv uses the function sys_alloc_from(200, sizeof(file_descriptor_state_struct)). I can't figure out the point of the 200, or how to decide what it should be in my case. As far as I can make out it only has an effect in an instrumented system (from looking at the def in sys.h). Q. What is the approved way to assign and clear memory in this case and in drivers in general? Q. Under what circumstances is the free function passed to driver_async called (I couldn't find any from a quick look)? Q. What is the key parameter intended for and do I ever need to worry about it? I've got the hang of the idea that the main function driven by port_command/2 should just schedule the work to be done in a thread sometime later with the driver_async function, and that when the thread has done it's work for this time it puts itself into the queue to call the async_ready callback which sends the result back to erlang. This looks fine.. Q. What happens if I send another port_command/2 to the port before the result of the possibly time consuming last operation has returned? Q. I wonder if I can use this to call the driver_cancel function sometime later to abort the operation? Q. What is the best way to timeout the operation which is being carried out in a thread so I can return the resource to useful state (in case it is in an endless loop, or the far end of some link has died leaving the thread waiting forever..)? My head is gradually turning to jelly here.. All comments on my understanding (or answer to my questions) are welcome! Cheers, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From bista@REDACTED Mon Jul 23 19:22:42 2001 From: bista@REDACTED (Stefano Bistarelli) Date: Mon, 23 Jul 2001 19:22:42 +0200 Subject: SAC '02 - 2002 ACM SYMPOSIUM ON APPLIED COMPUTING - Call for Message-ID: <3B5C5D62.73D0F18A@di.unipi.it> [Apologies for multiple copies] CALL FOR PAPERS SAC '02 - 2002 ACM SYMPOSIUM ON APPLIED COMPUTING Special Track on Artificial Intelligence and Computational Logic http://lovelace.spsu.edu/chung/sacai02.htm March 10 - 13, 2002 Madrid, Spain SAC '02 Over the past sixteen years, the ACM Symposium on Applied Computing has become a primary forum for applied computer scientists, computer engineers, software engineers, and application developers from around the world to interact and present their work. SAC 2002 is sponsored by the ACM Special Interest Group on Applied Computing (SIGAPP). Authors are invited to contribute original papers in all areas of experimental computing and application development for the technical sessions. For additional information, please check the SAC web page: http://www.acm.org/conferences/sac/sac2002 ARTIFICIAL INTELLIGENCE AND COMPUTATIONAL LOGIC TRACK A special track on Artificial Intelligence and Computational Logic will be held at SAC '02. It will be a forum for engineers, researchers and practitioners throughout the world to share technical ideas and experiences relating to implementation and application of Artificial Intelligence. Original papers, tutorial (half or full day), and panel proposals are invited in all areas of Artificial Intelligence. Topics of interest include, but are not limited to: -Applications of Artificial Intelligence -Artificial Intelligence -Artificial Immune Systems -Computational Logic -Constraint Solving and Programming -Image Analysis -Image Segmentation and Classification -Intelligent Embedded Systems -Knowledge-based Systems -Knowledge Representation -Machine Learning -Neural Networks -Search Techniques -Simulation of Swarm Intelligence GUIDELINES FOR SUBMISSION Original papers from the above-mentioned areas will be considered. This includes three categories of submissions: 1) Original and unpublished research 2) Reports of innovative artificial intelligence applications in the arts, sciences, engineering, business, government, education and industry 3) Reports of successful technology transfer to new problem domains Each category of submissions will be reviewed by peer groups appropriate to that category. Accepted papers in all categories will be published in the symposium proceedings. Expanded versions of selected papers from all categories will be considered for publication in the ACM/SIGAPP quarterly Applied Computing Review or one of the other participating SIGs' publications. Submission guidelines must be strictly followed: 1) Submit four (4) copies of original manuscripts to one of the following co-chairs: S. Bistarelli Dipartimento di Informatica Corso Italia, 40 I 56100 Pisa ITALY Tel: +39-050-2212768 Fax: +39-050-2212726 Email: bista@REDACTED http://www.di.unipi.it/~bista C. C. HungComputer Science Department 1100 South Marietta Parkway Southern Polytechnic State Univ. Marietta, GA 30060 USA Tel: (770) 528-3574 Fax: (770) 528-5511 E-mail: chung@REDACTED A. Rosa Systems and Robotics Institute LaSEEB - ISR - IST Av. Rovisco Pais, 1 - Torre Norte 6.21 1049-001 Lisboa Portugal Tel: +351-21-8418276/7 Fax: +351-21-8418291 E-mail:acrosa@REDACTED http://laseeb.ist.utl.pt 2) An electronic submission via e-mail is also recommended. The file format should be either PS or PDF. 3) The author(s) name(s)and address(es) must not appear in the body of the paper, and self-reference should be in the third person. This is to facilitate blind review. 4) The body of paper should not exceed 4,000 words (approximately 15 pages, double-spaced). 5) A separate cover sheet attached to each copy should show the title of the paper, the author(s) name(s) and affiliation(s), and the address (including e-mail, telephone, and FAX) to which correspondence should be sent. A few key words should be provided. IMPORTANT DATES September 1, 2001: Paper and Tutorial Submissions Due October 15, 2001: Author Notification November 1, 2001: Camera-Ready Paper Due From nico.weling@REDACTED Tue Jul 24 13:27:30 2001 From: nico.weling@REDACTED (Nico Weling) Date: Tue, 24 Jul 2001 13:27:30 +0200 Subject: Does whoami exists in Erlang? Message-ID: <3B5D5BA2.DA6B60DC@eed.ericsson.se> Hi, I like to write a configfile into the users-home directory, but therefore I need to know the current username. Does in Erlang something like "whoami" exists like in unix? Thanks in advance, BR, Nico. From heinz@REDACTED Wed Jul 25 01:38:55 2001 From: heinz@REDACTED (Heinz Eriksson) Date: Tue, 24 Jul 2001 16:38:55 -0700 Subject: named pipe as port? Message-ID: <3b5e070f.19a.0@flashmail.com> I open a named pipe/fifo, created with mkfifo, as a port and that seems to work ok. Fifo = open_port(fifo, [eof]). It is also works to open more than one fifo as port and handle receive from them in parallel. However, documentation for open_port tells me: "Atom This use of open_port() is obsolete and will be removed in a future version of Erlang. Use the file module instead." But if I try to open the fifo with Fifo = file:open("fifo",[]) I get {error,eisdir} Is there a correct way to connect to a fifo? /hz ______________________________________________________ Get Your FREE FlashMail Address now at http://www.flashmail.com It's Free, Easy, & Fun !!! From Sean.Hinde@REDACTED Tue Jul 24 13:44:04 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 24 Jul 2001 12:44:04 +0100 Subject: Does whoami exists in Erlang? Message-ID: <402DD461F109D411977E0008C791C312039F61AA@imp02mbx.one2one.co.uk> > Hi, > > I like to write a configfile into the users-home directory, > but therefore > I need to know the current username. Does in Erlang something > like "whoami" exists like in unix? You can always use: 1>os:cmd("whoami"). "sean/n" 2> or even: 2>os:cmd("echo $HOME"). "/export/home/sean/n" 3> which will give you the home directory of the user who started the beam process (barring no doubt some determined effort by the user to hide this..) Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From jb@REDACTED Tue Jul 24 13:35:56 2001 From: jb@REDACTED (Johan Blom) Date: Tue, 24 Jul 2001 13:35:56 +0200 Subject: Announce: SO WAP! - Erlang based WAP utils. Message-ID: <3B5D5D9C.6A2059E1@cellpt.com> Hi, have finally put myself together and released SO WAP!, a number of OTP Erlang modules to support various WAP standards. Developers are most welcome (http://sourceforge.net/projects/sowap/) to give me a hand! Features: - Client and Server WAP stacks (WDP/UDP, WTP, WSP) - HTTP 1.1 client (not complete) - WBXML encoding/decoding of WML 1.1 documents, using xmerl for XML parsing - Character set translation, using ucs Note that currently (among other things) the following WAP functionality is not supported - WMLScript - WTLS The work is currently organised into several (more or less) independent packages: -sowapstack (0.9.1) -sowaputils (0.1.1) -xmerl (0.16) (maintained by Ulf Wiger, but available in cvs repository) -ucs (0.2) (maintained by Lon Willet, but available in cvs repository) In addition I have released jngateway-0.9, that includes everything needed to set up a WAP Gateway You will find it all at http://sowap.sourceforge.net/ Regards Johan -- Johan Blom jb@REDACTED Home: Standardisation Manager http://www.docs.uu.se/~johan Johan Blom CellPoint Europe AB +44 (0)1932 895310 (work) 60 Heathside +44 (0)7788 713608 (mobile) Weybridge, Surrey, UK From luke@REDACTED Tue Jul 24 14:51:32 2001 From: luke@REDACTED (Luke Gorrie) Date: 24 Jul 2001 14:51:32 +0200 Subject: Does whoami exists in Erlang? In-Reply-To: <402DD461F109D411977E0008C791C312039F61AA@imp02mbx.one2one.co.uk> References: <402DD461F109D411977E0008C791C312039F61AA@imp02mbx.one2one.co.uk> Message-ID: Sean Hinde writes: > > Hi, > > > > I like to write a configfile into the users-home directory, > > but therefore > > I need to know the current username. Does in Erlang something > > like "whoami" exists like in unix? > > You can always use: > > 1>os:cmd("whoami"). > "sean/n" > 2> > > or even: > > 2>os:cmd("echo $HOME"). > "/export/home/sean/n" > 3> > And yet another is 1> os:getenv("HOME"). "/home/luke" Cheers, Luke From kjr@REDACTED Wed Jul 25 17:21:56 2001 From: kjr@REDACTED (Kjetil Rossavik) Date: Wed, 25 Jul 2001 16:21:56 +0100 Subject: Fwd: Erlang: orber problem In-Reply-To: References: <4.3.2.7.2.20010720172658.00b99748@glasgow.cisco.com> Message-ID: <4.3.2.7.2.20010725161511.01b49180@glasgow.cisco.com> Thanks again for your replies. I am now doing some "viral marketing" of Erlang here in Cisco. After your successful infiltration of Nortel (through the acquisition of Bluetail), it is time to attack the real enemy (of Ericsson). It certainly has had the desired effect on Nortel... :-) >The compile-time depends on your IDL-files. Make sure you use separate >files for separate IDL module-definitions. As I am interfacing with an existing system, I cannot influence the IDL, I'm afraid. >I do recommend that you upgrade to the latest Orber-version since the >IIOP-overhead have been reduced significantly and a new version is on its >way which improve the performance even more! As I am only prototyping at this stage, I can afford to wait for the Win-build of OTP R8A, unless I run into any problems. One issue I have come across is that the IDL I am using has hex numbers (0x10, etc), and also hex numbers bitwise shifted (0x10 << 10). ic:gen() does not seem to support this. Is this non-standard IDL, or is it an unsupported feature in ic:gen? (So far I have circumvented the issue by substituting in the base10 numbers). KJ. From luke@REDACTED Wed Jul 25 17:47:46 2001 From: luke@REDACTED (Luke Gorrie) Date: 25 Jul 2001 17:47:46 +0200 Subject: ICFP Programming Contest Message-ID: G'day, FYI - there is a 3-day functional programming contest starting tomorrow (thursday) at 4pm swedish time. I don't think it's had any Erlang entries in the past. It looks like a lot of fun, and with very stiff competition. Details at http://pauillac.inria.fr/cristal/ICFP2001/prog-contest/ Cheers, Luke From hakanm@REDACTED Wed Jul 25 18:01:01 2001 From: hakanm@REDACTED (Hakan Millroth) Date: Wed, 25 Jul 2001 09:01:01 -0700 Subject: Fwd: Erlang: orber problem References: <4.3.2.7.2.20010720172658.00b99748@glasgow.cisco.com> <4.3.2.7.2.20010725161511.01b49180@glasgow.cisco.com> Message-ID: <3B5EED3D.E3818661@nortelnetworks.com> > It certainly has had the desired effect on Nortel... :-) Good luck in getting CSCO to join us down here in single-digit land :-) -- Hakan From cpressey@REDACTED Thu Jul 26 09:13:43 2001 From: cpressey@REDACTED (Chris Pressey) Date: Thu, 26 Jul 2001 02:13:43 -0500 Subject: how to kill a port's external process? References: <200107230056.UAA64560@sprache.sage.att.com> Message-ID: <3B5FC327.3D2E2EBD@catseye.mb.ca> "Garrett G. Hodgson" wrote: > i'm building a little gui wrapper around a command line audio player. > i've got an erlang process that calls open_port() to spawn the external > player, but it doesn't actually send/receive anything to it over stdio. I don't think the port mechanism was ever intended to be used that way :) The Interoperability Tutorial says: | 4.1 Erlang Program | First of al,l communication between Erlang and C must be | established by creating the port. The Erlang process which | creates a port is said to be the connected process of the port. All | communication to and from the port should go via the connected | process. If the connected process terminates, so will the port | (and the external program, if it is written correctly). ^^^^^^^^^^^^^^^^^^^^^^^^^^ Further down on that page there is example C source: /* port.c */ typedef unsigned char byte; int main() { int fn, arg, res; byte buf[100]; while (read_cmd(buf) > 0) { fn = buf[0]; arg = buf[1]; if (fn == 1) { res = foo(arg); } else if (buf[0] == 2) { res = bar(arg); } buf[0] = res; write_cmd(buf, 1); } } So the port terminates when the read_cmd() function detects end-of-file from the Erlang side of things (AFAICT.) Do you have the source to the external program? It might help to rewrite the main body to listen to the Erlang ports mechanism, even if there's no established interface. > so, is there a clean way to kill this beast? i can think of some kludgey > ways, like gathering the output of ps and constructing a unix command to > kill it. but it seems like there ought to be a better way? can someone > point me in the right direction? This goes beyond Erlang, but... killing a process based on the name of a program is always dodgy at best, given that a program can change what it shows up as in 'ps'. A better way is to use DJB's daemontools, which, IIRC, opens up one pipe per process, giving you a truly unique handle to it. > Garry Hodgson And when they offer > Senior Hacker golden apples > garry@REDACTED are you sure you'll refuse? > Software Innovation Services Heaven help the fool. > AT&T Labs Kallisti :) Chris -- This sentence is false. From nick@REDACTED Thu Jul 26 09:46:43 2001 From: nick@REDACTED (Niclas Eklund) Date: Thu, 26 Jul 2001 09:46:43 +0200 (MEST) Subject: Fwd: Erlang: orber problem In-Reply-To: <4.3.2.7.2.20010725161511.01b49180@glasgow.cisco.com> Message-ID: On Wed, 25 Jul 2001, Kjetil Rossavik wrote: > Thanks again for your replies. I am now doing some "viral marketing" of > Erlang here in Cisco. After your successful infiltration of Nortel (through > the acquisition of Bluetail), it is time to attack the real enemy (of > Ericsson). It certainly has had the desired effect on Nortel... :-) > > >The compile-time depends on your IDL-files. Make sure you use separate > >files for separate IDL module-definitions. > > As I am interfacing with an existing system, I cannot influence the IDL, > I'm afraid. Perhaps I should rephrase my first comment. If you have module foo { ... }; module bar { ... }; You can put both in one IDL-file (e.g. AllModules.idl). That is what you should avoid. My suggestion is that you instead divide the module definitions into two files (e.g. foo.idl and bar.idl). The result will be the same and will not affect interoperability. The drawback is that if you, for example, edit the 'foo'-module you have to edit the AllModules.idl (used on the Orbix-side) and foo.idl. However, this will only reduce stubs/skeleton compilation time which do rather seldom. Hence, this change isn't very important. :-) > >I do recommend that you upgrade to the latest Orber-version since the > >IIOP-overhead have been reduced significantly and a new version is on its > >way which improve the performance even more! > > As I am only prototyping at this stage, I can afford to wait for the > Win-build of OTP R8A, unless I run into any problems. Orber-3.2.7 will be a part of the next open-source release (R7B). The result of the latest benchmarking tests (one open-source user's and my own tests) shows very good results! > One issue I have come across is that the IDL I am using has hex numbers > (0x10, etc), and also hex numbers bitwise shifted (0x10 << 10). ic:gen() > does not seem to support this. Is this non-standard IDL, or is it an > unsupported feature in ic:gen? (So far I have circumvented the issue by > substituting in the base10 numbers). It is a part of the OMG standard. I've tested it and got an error-message. For now I'm afraid you have to stick with your "workaround". Best Regards Nick From per@REDACTED Thu Jul 26 12:18:52 2001 From: per@REDACTED (per@REDACTED) Date: Thu, 26 Jul 2001 12:18:52 +0200 (CEST) Subject: how to kill a port's external process? In-Reply-To: <3B5FC327.3D2E2EBD@catseye.mb.ca> Message-ID: <200107261018.f6QAIq219324@tordmule.bluetail.com> Chris Pressey wrote: > >"Garrett G. Hodgson" wrote: >> i'm building a little gui wrapper around a command line audio player. >> i've got an erlang process that calls open_port() to spawn the external >> player, but it doesn't actually send/receive anything to it over stdio. > >I don't think the port mechanism was ever intended to be used that way >:) True.:-) Well, at least if you intended to control the external program in *any* way - e.g. firing up an independent daemon or whatever with os:cmd() (that uses the port mechanim of course) is a reasonable thing to do. >Do you have the source to the external program? It might help to >rewrite the main body to listen to the Erlang ports mechanism, even if >there's no established interface. Actually, it could be done with a "wrapper", perhaps even something as simple as: #!/bin/sh program & pid=$! while read dummy; do :; done kill $pid exit 0 But of course one has to wonder what the Erlang-based GUI is for if it can't communicate with the program...:-) --Per Hedeland per@REDACTED From ranjeet@REDACTED Mon Jul 30 14:38:38 2001 From: ranjeet@REDACTED (Ranjeet Sonone) Date: Mon, 30 Jul 2001 18:08:38 +0530 Subject: LDAP V3 server in erlang? Message-ID: I read few messages in the archive regarding LDAP server and client implementation based on mnesia. Some more "input/progress info/code" on the same would he really helpful. I am willing to contribute to the effort if proves helpful. thanks and regards, -ranjeet From matthias@REDACTED Fri Jul 27 16:02:10 2001 From: matthias@REDACTED (matthias@REDACTED) Date: Fri, 27 Jul 2001 16:02:10 +0200 Subject: how to kill a port's external process? In-Reply-To: <200107261018.f6QAIq219324@tordmule.bluetail.com> References: <3B5FC327.3D2E2EBD@catseye.mb.ca> <200107261018.f6QAIq219324@tordmule.bluetail.com> Message-ID: <15201.29794.99181.540124@antilipe.corelatus.se> >"Garrett G. Hodgson" wrote: >> i'm building a little gui wrapper around a command line audio player. >> i've got an erlang process that calls open_port() to spawn the external >> player, but it doesn't actually send/receive anything to it over stdio. The bit which surprised me was that sending a kill to a port started with open_port({spawn, ...}, [...]) doesn't necessarily kill the unix process. It merely closes the file file descriptors. This is a problem when the external process gets stuck in a loop somewhere and thus stops caring about stdin/stdout. It's surprising because the Erlang book (9.4) says that the goal is for ports to look just like Erlang processes from the erlang program's point of view. I can think of three ways around this. No doubt there are more. 1. A variant of Per's approach. Wrap the external program so that it reports its pid on startup. That way you can nuke it by using os:cmd("kill .."), or whatever the windows equivalent is. The wrapper could be something like #! echo "my pid is $$" exec $* You might then use it as 1> erlang:open_port({spawn, "./wrap.sh sleep 5000"}, []). #Port<0.8> 2> flush(). Shell got {#Port<0.8>,{data,"my pid is 2097\n"}} ok 3> os:cmd("kill -9 2097"). It can get more complicated if the child forks. 2. If you're using heart (or some variant), it may be better to report the process IDs to the heart process in some way, for instance via a socket. 3. Hack erlang so that erlang:port_info/2 returns the port's unix process ID. I did this but abandoned it in favour of #2 because it didn't solve the problem of processes left lying around if erlang was killed. Matthias From infcar00@REDACTED Tue Jul 31 12:00:05 2001 From: infcar00@REDACTED (Carlos Abalde Ramiro) Date: Tue, 31 Jul 2001 12:00:05 +0200 (MET DST) Subject: inets & SSL Message-ID: <200107311000.MAA20081@ucv.udc.es> Hi, I'm using the inets HTTP server with SSL to desing a secure server. Actually the server works using the config directives SSLCertificateFile, SSLCertificateKeyFile and SSLVerifyClient. The problem: wath about other parameters like the password of the private key file, the list of ciphers or the path to file containing PEM encoded CA certificates? I know that this parameters are accepted by the SSL application, but seems that the inets HTTP server can't handle them. Thanks, Carlos. Return-Path: Received: (from majordom@REDACTED) by hades.cslab.ericsson.net (8.10.0/8.10.0/hades-1.2) id f6UDmbv27220 for erlang-questions-outgoing; Mon, 30 Jul 2001 15:48:37 +0200 (CEST) Received: from mail.bluetail.com (mail.bluetail.com [195.149.129.26]) by hades.cslab.ericsson.net (8.10.0/8.10.0/hades-1.2) with ESMTP id f6UDmYi27215 for ; Mon, 30 Jul 2001 15:48:34 +0200 (CEST) Received: from kiwi.bluetail.com (kiwi.bluetail.com [192.168.128.51]) by duva.bluetail.com (BLUETAIL Mail Robustifier 2.2.2) with ESMTP id 976850.500908.996duva-s0 for ; Mon, 30 Jul 2001 15:48:28 +0200 Received: (qmail 96475 invoked by uid 515); 30 Jul 2001 13:50:03 -0000 Reply-To: tobbe@REDACTED Organization: Alteon Web Systems To: "Ranjeet Sonone" Cc: Subject: Re: LDAP V3 server in erlang? References: From: Torbjorn Tornkvist Date: 30 Jul 2001 15:50:03 +0200 In-Reply-To: "Ranjeet Sonone"'s message of "Mon, 30 Jul 2001 18:08:38 +0530" Message-ID: Lines: 13 User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-erlang-questions@REDACTED Precedence: bulk I implemented an LDAPv3 client package, which later Sean Hinde started to transformed into a gen_fsm form. However, some of my intentions was lost in the trasnformation so my plan was to modify the the gen_fsm version to my liking. Haven't had the time to do that yet though... Anyway, you'll find the current code here: http://www.bluetail.com/~tobbe/eldap.tgz Cheers /Tobbe From tobbe@REDACTED Mon Jul 30 15:50:03 2001 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 30 Jul 2001 15:50:03 +0200 Subject: LDAP V3 server in erlang? In-Reply-To: "Ranjeet Sonone"'s message of "Mon, 30 Jul 2001 18:08:38 +0530" References: Message-ID: I implemented an LDAPv3 client package, which later Sean Hinde started to transformed into a gen_fsm form. However, some of my intentions was lost in the trasnformation so my plan was to modify the the gen_fsm version to my liking. Haven't had the time to do that yet though... Anyway, you'll find the current code here: http://www.bluetail.com/~tobbe/eldap.tgz Cheers /Tobbe >From Sean.Hinde@REDACTED Mon 30 Jul 16:35:27 2001 Return-Path: Received: (from majordom@REDACTED) by hades.cslab.ericsson.net (8.10.0/8.10.0/hades-1.2) id f6UEcQ127593 for erlang-questions-outgoing; Mon, 30 Jul 2001 16:38:26 +0200 (CEST) Received: from o2ogate.one2one.co.uk (o2ogate.one2one.co.uk [193.131.126.162]) by hades.cslab.ericsson.net (8.10.0/8.10.0/hades-1.2) with ESMTP id f6UEcKi27588 for ; Mon, 30 Jul 2001 16:38:21 +0200 (CEST) Received: from kitts.one2one.co.uk (kitts.one2one.co.uk [149.254.74.217]) by o2ogate.one2one.co.uk (8.9.3/8.9.3) with ESMTP id PAA11771; Mon, 30 Jul 2001 15:37:55 +0100 (BST) Received: from mailhost.one2one.co.uk (localhost [127.0.0.1]) by kitts.one2one.co.uk (8.9.3/8.9.3) with ESMTP id PAA22991; Mon, 30 Jul 2001 15:37:55 +0100 (BST) Received: from imp01ims.One2One.co.uk (imp01ims [149.254.72.7]) by mailhost.one2one.co.uk (8.9.3/8.9.3) with ESMTP id PAA25388; Mon, 30 Jul 2001 15:37:47 +0100 (BST) Received: by imp01ims.one2one.co.uk with Internet Mail Service (5.5.2448.0) id <3W3KN930>; Mon, 30 Jul 2001 15:35:34 +0100 Message-ID: <402DD461F109D411977E0008C791C312039F61FC@REDACTED> From: Sean Hinde To: Ranjeet Sonone , "'tobbe@REDACTED'" Cc: erlang-questions@REDACTED Subject: RE: LDAP V3 server in erlang? Date: Mon, 30 Jul 2001 15:35:27 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-erlang-questions@REDACTED Precedence: bulk Hi, Since then I've split up my gen_fsm tcp/ip client thingy into a generic part which looks after sockets, timers etc, and provides callbacks for the protocol implementation. I think it fixes most of your concerns but I haven't ported the eldap stuff over yet. I'll try to have a go this week and release it.. (BTW Ranjeet, the reason to turn it into a gen_fsm was to be able to have many threads query over the same LDAP socket connection and have some stuff to maintain the link - retries and so on) Rgds, Sean > I implemented an LDAPv3 client package, which later > Sean Hinde started to transformed into a gen_fsm form. > However, some of my intentions was lost in the trasnformation > so my plan was to modify the the gen_fsm version to > my liking. Haven't had the time to do that yet though... > > Anyway, you'll find the current code here: > > http://www.bluetail.com/~tobbe/eldap.tgz > > Cheers /Tobbe > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Sean.Hinde@REDACTED Mon Jul 30 16:35:27 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 30 Jul 2001 15:35:27 +0100 Subject: LDAP V3 server in erlang? Message-ID: <402DD461F109D411977E0008C791C312039F61FC@imp02mbx.one2one.co.uk> Hi, Since then I've split up my gen_fsm tcp/ip client thingy into a generic part which looks after sockets, timers etc, and provides callbacks for the protocol implementation. I think it fixes most of your concerns but I haven't ported the eldap stuff over yet. I'll try to have a go this week and release it.. (BTW Ranjeet, the reason to turn it into a gen_fsm was to be able to have many threads query over the same LDAP socket connection and have some stuff to maintain the link - retries and so on) Rgds, Sean > I implemented an LDAPv3 client package, which later > Sean Hinde started to transformed into a gen_fsm form. > However, some of my intentions was lost in the trasnformation > so my plan was to modify the the gen_fsm version to > my liking. Haven't had the time to do that yet though... > > Anyway, you'll find the current code here: > > http://www.bluetail.com/~tobbe/eldap.tgz > > Cheers /Tobbe > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From tonyp@REDACTED Tue Jul 31 14:49:12 2001 From: tonyp@REDACTED (Tony Pedley) Date: Tue, 31 Jul 2001 13:49:12 +0100 Subject: erlang:universaltime() Message-ID: <3B66A948.4E3B9E39@terminus.ericsson.se> Does anyone know where I can get the sources for erlang:universaltime() . I have been getting a crash since it kept on returning {{2001,7,32},{5,0,0}} for todays date and when this is input into calendar:localtime_to_universaltime it crashes for hopefully obvious reasons.(Hint how many days in July) I know its a BIF, but I don't know where/if you can get the source and I would be interested to know what it does. Tony ______________________________________________________________________ Tony Pedley mailto:tonyp@REDACTED Ericsson Intracom Ltd. Intranet : http://intracom.ericsson.se 1 Bede Island Internet : http://www.ericsson.co.uk/datacom/index.htm Leicester memoID : ECOM.CBERAM England Tel : +44 (0)116 2 542 400 LE2 7EU Fax : +44 (0)116 2 046 111 ______________________________________________________________________ From Sean.Hinde@REDACTED Tue Jul 31 15:06:10 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 31 Jul 2001 14:06:10 +0100 Subject: erlang:universaltime() Message-ID: <402DD461F109D411977E0008C791C312039F6215@imp02mbx.one2one.co.uk> > Does anyone know where I can get the sources for > erlang:universaltime() Sources are available from www.erlang.org. bifs are defined in the file bif.c in erts/emulator/beam > I have been getting a crash since it kept on returning > > {{2001,7,32},{5,0,0}} > > for todays date Works OK for me on my NT and Solaris machines. What OS you are running? - Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From tonyp@REDACTED Tue Jul 31 15:52:40 2001 From: tonyp@REDACTED (Tony Pedley) Date: Tue, 31 Jul 2001 14:52:40 +0100 Subject: erlang:universaltime() References: <402DD461F109D411977E0008C791C312039F6215@imp02mbx.one2one.co.uk> Message-ID: <3B66B828.8D0AAD7F@terminus.ericsson.se> My Apologies, I have gone back over the source in question and its not the erlang:universaltime function which is causing the problem. Still its useful to know where the bifs source are (I couldn't find it during my first search). I also know now that erlang:localtime_to_universaltime({{2001,7,32},{5,0,0}}) causes a bif error. Thanks Tony Sean Hinde wrote: > > Does anyone know where I can get the sources for > > erlang:universaltime() > > Sources are available from www.erlang.org. > > bifs are defined in the file bif.c in erts/emulator/beam > > > I have been getting a crash since it kept on returning > > > > {{2001,7,32},{5,0,0}} > > > > for todays date > > Works OK for me on my NT and Solaris machines. What OS you are running? > > - Sean > > NOTICE AND DISCLAIMER: > This email (including attachments) is confidential. If you have received > this email in error please notify the sender immediately and delete this > email from your system without copying or disseminating it or placing any > reliance upon its contents. We cannot accept liability for any breaches of > confidence arising through use of email. Any opinions expressed in this > email (including attachments) are those of the author and do not necessarily > reflect our opinions. We will not accept responsibility for any commitments > made by our employees outside the scope of our business. We do not warrant > the accuracy or completeness of such information. - ______________________________________________________________________ Tony Pedley mailto:tonyp@REDACTED Ericsson Intracom Ltd. Intranet : http://intracom.ericsson.se 1 Bede Island Internet : http://www.ericsson.co.uk/datacom/index.htm Leicester memoID : ECOM.CBERAM England Tel : +44 (0)116 2 542 400 LE2 7EU Fax : +44 (0)116 2 046 111 ______________________________________________________________________