From qiulang@REDACTED Mon Dec 1 01:17:27 2008 From: qiulang@REDACTED (lang qiu) Date: Mon, 1 Dec 2008 08:17:27 +0800 Subject: [erlang-questions] Why we need to use make_ref in pmap ? In-Reply-To: <20081130222448.GB8320@h216-235-12-168.host.egate.net> References: <20081130222448.GB8320@h216-235-12-168.host.egate.net> Message-ID: Thanks! I understand what you were saying. But can we just use a simple atom for it instead of make_ref() ? Qiulang On Mon, Dec 1, 2008 at 6:24 AM, Vance Shipley wrote: > Qiulang, > > The reference() value is passed with the query to be included > in the response so that you may distinguish the answers from > each other and from other messages which might have the same > pattern. > > -Vance > > On Sun, Nov 30, 2008 at 11:50:48PM +0800, lang qiu wrote: > } Why we need to use make_ref/0 in pmap ? To be exact, why we need to use > } make_ref in the gather/2, > } > } gather([Pid|T], Ref) -> > } receive > } {Pid, Ref, Ret} -> [Ret|gather(T, Ref)] > } end; > } > } Can't we just use gather/1, > } > } gather([Pid|T]) -> > } receive > } {Pid, Ret} -> [Ret|gather(T)] > } end; > -------------- next part -------------- An HTML attachment was scrubbed... URL: From qiulang@REDACTED Mon Dec 1 07:08:03 2008 From: qiulang@REDACTED (lang qiu) Date: Mon, 1 Dec 2008 14:08:03 +0800 Subject: [erlang-questions] Why we need to use make_ref in pmap ? In-Reply-To: References: <20081130222448.GB8320@h216-235-12-168.host.egate.net> Message-ID: I mean can' t we just use a simple atom, say pmap, so the implementation will look like following, *do_f(Parent, pmap, F, I) -> Parent ! {self(), pmap, (catch F(I))}.* *gather([Pid|T], pmap) -> receive {Pid, pmap, Ret} -> [Ret|gather(T, pmap)] end;* But I understand your point and I guess because it is the system function, it has to make sure absolutely that it won't receive something else. If it were not the system function, I guess a simple atom should be enough. Do you agree ? On Mon, Dec 1, 2008 at 11:33 AM, Matthew Dempsky wrote: > 2008/11/30 lang qiu : > > I understand what you were saying. But can we just use a simple atom for > it > > instead of make_ref() ? > > Why? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew@REDACTED Mon Dec 1 04:33:16 2008 From: matthew@REDACTED (Matthew Dempsky) Date: Sun, 30 Nov 2008 19:33:16 -0800 Subject: [erlang-questions] Why we need to use make_ref in pmap ? In-Reply-To: References: <20081130222448.GB8320@h216-235-12-168.host.egate.net> Message-ID: 2008/11/30 lang qiu : > I understand what you were saying. But can we just use a simple atom for it > instead of make_ref() ? Why? From zerthurd@REDACTED Mon Dec 1 13:33:07 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Mon, 1 Dec 2008 18:33:07 +0600 Subject: [erlang-questions] [erlang-quiestions] Documentation bug or not? Message-ID: Hello I found strange descriptions in man-files for gen_server and gen_fsm (possible in some other manuals). ---- start_link(Module, Args, Options) -> Result start_link(FsmName, Module, Args, Options) -> Result Types FsmName = {local, Name} | {global, GlobalName} Name = atom() GlobalName = term() ---- Name and GlobalName have different types: atom() and term(). Is it right? Can I use any possible erlang term as name identifier? -- Maxim Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From jlprasantha@REDACTED Mon Dec 1 13:50:37 2008 From: jlprasantha@REDACTED (prasantha kumara) Date: Mon, 1 Dec 2008 18:20:37 +0530 Subject: [erlang-questions] ussd application using erlang Message-ID: Hi i am trying to develop a ussd application using erlang and NMS400tx board.i want to get the ussd massage from the TCAP layer.can any one help me to proceed.(any documents). -------------- next part -------------- An HTML attachment was scrubbed... URL: From esobchenko@REDACTED Mon Dec 1 13:56:10 2008 From: esobchenko@REDACTED (Eugen Sobchenko) Date: Mon, 1 Dec 2008 14:56:10 +0200 Subject: [erlang-questions] erlang:universal_to_localtime/1 issue on Mac OS X 10.4.11 In-Reply-To: <23b409ab0812010309o2b423cf3h6ee6996173112156@mail.gmail.com> References: <23b409ab0812010309o2b423cf3h6ee6996173112156@mail.gmail.com> Message-ID: <23b409ab0812010456tf16a025w3163e7f388e000b3@mail.gmail.com> Greetings, I'm getting the following exception on "httpd_util:rfc1123_date({{2008,11,28},{17,25,48}}).": 3> httpd_util:rfc1123_date({{2008,11,28},{17,25,48}}). ** exception error: bad argument in function erlang:universaltime_to_localtime/1 called as erlang:universaltime_to_localtime({{1969,12,31},{23,59,59}}) in call from calendar:local_time_to_universal_time_dst/1 in call from httpd_util:rfc1123_date/1 Actually I use mochiweb and have exactly the same problem as described in the following thread: http://groups.google.com/group/mochiweb/browse_thread/thread/d46e71d2293641dd/d3ae98bec483392e?#d3ae98bec483392e I'm running Erlang R12B5 on Mac OS X 10.4.11. How can I solve this issue? Any help appreciated. Thanks, Eugen -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenji.rikitake@REDACTED Mon Dec 1 14:53:07 2008 From: kenji.rikitake@REDACTED (Kenji Rikitake) Date: Mon, 1 Dec 2008 22:53:07 +0900 Subject: [erlang-questions] erlang:universal_to_localtime/1 issue on Mac OS X 10.4.11 In-Reply-To: <23b409ab0812010456tf16a025w3163e7f388e000b3@mail.gmail.com> References: <23b409ab0812010309o2b423cf3h6ee6996173112156@mail.gmail.com> <23b409ab0812010456tf16a025w3163e7f388e000b3@mail.gmail.com> Message-ID: <20081201135307.GA5818@k2r.org> See http://www.erlang.org/pipermail/erlang-bugs/2008-November/001077.html for Paul Guyot's analysis on the following issue on R12B4. (I have no idea whether it is also applicable to MacOS) Note that the patch attached with the above article is also applicable to R12B5. Kenji Rikitake In the message <23b409ab0812010456tf16a025w3163e7f388e000b3@REDACTED> dated Mon, Dec 01, 2008 at 02:55:47PM +0200, Eugen Sobchenko writes: > Greetings, > > I'm getting the following exception on > "httpd_util:rfc1123_date({{2008,11,28},{17,25,48}}).": > > 3> httpd_util:rfc1123_date({{2008,11,28},{17,25,48}}). > ** exception error: bad argument > in function erlang:universaltime_to_localtime/1 > called as > erlang:universaltime_to_localtime({{1969,12,31},{23,59,59}}) > in call from calendar:local_time_to_universal_time_dst/1 > in call from httpd_util:rfc1123_date/1 > > > Actually I use mochiweb and have exactly the same problem as described in > the following thread: > http://groups.google.com/group/mochiweb/browse_thread/thread/d46e71d2293641dd/d3ae98bec483392e?#d3ae98bec483392e > > I'm running Erlang R12B5 on Mac OS X 10.4.11. > > How can I solve this issue? Any help appreciated. > > Thanks, > Eugen From esobchenko@REDACTED Mon Dec 1 15:33:26 2008 From: esobchenko@REDACTED (Eugen Sobchenko) Date: Mon, 1 Dec 2008 16:33:26 +0200 Subject: [erlang-questions] erlang:universal_to_localtime/1 issue on Mac OS X 10.4.11 In-Reply-To: <20081201135307.GA5818@k2r.org> References: <23b409ab0812010309o2b423cf3h6ee6996173112156@mail.gmail.com> <23b409ab0812010456tf16a025w3163e7f388e000b3@mail.gmail.com> <20081201135307.GA5818@k2r.org> Message-ID: <23b409ab0812010633j5d89e484g5d7d16bac19f990c@mail.gmail.com> Thanks for your answer! I tried this patch and it solves the problem. I hope they will fix this issue in future releases of Erlang. -Eugen On Mon, Dec 1, 2008 at 3:53 PM, Kenji Rikitake wrote: > See > http://www.erlang.org/pipermail/erlang-bugs/2008-November/001077.html > for Paul Guyot's analysis on the following issue on R12B4. > (I have no idea whether it is also applicable to MacOS) > > Note that the patch attached with the above article is also applicable > to R12B5. > > Kenji Rikitake > > In the message <23b409ab0812010456tf16a025w3163e7f388e000b3@REDACTED > > > dated Mon, Dec 01, 2008 at 02:55:47PM +0200, > Eugen Sobchenko writes: > > Greetings, > > > > I'm getting the following exception on > > "httpd_util:rfc1123_date({{2008,11,28},{17,25,48}}).": > > > > 3> httpd_util:rfc1123_date({{2008,11,28},{17,25,48}}). > > ** exception error: bad argument > > in function erlang:universaltime_to_localtime/1 > > called as > > erlang:universaltime_to_localtime({{1969,12,31},{23,59,59}}) > > in call from calendar:local_time_to_universal_time_dst/1 > > in call from httpd_util:rfc1123_date/1 > > > > > > Actually I use mochiweb and have exactly the same problem as described in > > the following thread: > > > http://groups.google.com/group/mochiweb/browse_thread/thread/d46e71d2293641dd/d3ae98bec483392e?#d3ae98bec483392e > > > > I'm running Erlang R12B5 on Mac OS X 10.4.11. > > > > How can I solve this issue? Any help appreciated. > > > > Thanks, > > Eugen > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From florz@REDACTED Mon Dec 1 20:04:00 2008 From: florz@REDACTED (Florian Zumbiehl) Date: Mon, 1 Dec 2008 20:04:00 +0100 Subject: [erlang-questions] gen_tcp/inet/flow control/misc In-Reply-To: <20081114211334.GA8809@contorpis.lisalinda.com> References: <20081114035810.GE12805@florz.florz.dyndns.org> <20081114211334.GA8809@contorpis.lisalinda.com> Message-ID: <20081201190400.GA8711@florz.florz.dyndns.org> Hi, sorry, somehow your mail didn't end up in any of my mail folders, and I only now discovered it in the mailing list's web archive ... [...] > After command 32, the window was full. Same for 33. I then turned on > the receiver again and ran 34. The receiver got all the data from > 30--34. Erlang must be buffering it. I'm not curious enough to know > where exactly. Thanks so far, that made things quite a bit clearer :-) [...] > > So, the question basically condenses down to: What buffers are > > there in between the fd and the gen_tcp API, once again, and > > how do they interact with the various options? > > I think there's only really one. If you don't use send_delay, it's > conceptually not there. ... unless there is a send_timeout specified and the socket doesn't accept all the data before the timeout expires, in which case there actually seems to be a buffer, probably just as unlimited as the send_delay one? That's what I would conclude from your explanation. > > And how would I implement flow control at the write side? > > Avoid the problem: use a protocol with flow control. > > The engineer's solution: use {send_timeout, N} and resign yourself to > not being able to know when a blocked socket becomes unblocked, at least > not without sending it more data. > > The "pure Erlang" solution: don't use {send_timeout, N}. Instead, use > multiple (Erlang) processes to keep track of whether the socket is > blocked or not. As far as that question is concerned, I was actually only looking for a way to "sense the backpressure" in order to be able to propagate it through the system to some external data source. For that purpose, the blocking of gen_tcp:send without a send_timeout would probably do in many (most?) cases. What's missing, then, is the mechanism for actually propagating the information through a pipeline of erlang processes, without making them all work synchronously - which the "use a protocol with flow control" would probably imply!? > (I know, you asked more questions. Maybe someone else can pick up > where I left off, otherwise, maybe next week. Or read the source and > experiment.) Maybe ... now? ;-) Florian From mrad-direct-erlang@REDACTED Mon Dec 1 21:26:37 2008 From: mrad-direct-erlang@REDACTED (Michael Radford) Date: Mon, 1 Dec 2008 12:26:37 -0800 Subject: [erlang-questions] Upgrades and application environment In-Reply-To: <20081125182907.GA17403@herbie> References: <6c2563b20811241927t208e2d2dy27e710b61e6ca897@mail.gmail.com> <20081125182907.GA17403@herbie> Message-ID: <20081201202637.GA22583@herbie> This issue bit us again today: someone added an application environment variable and wrote a code_change handler that (indirectly) read it, causing the upgrade to crash. So I'm curious, what strategies do people use in practice for adding new configuration variables to running systems (at Ericsson, or elsewhere)? Do they: * not use application environment variables at all (keeping configuration somewhere else)? * stop and start the whole application on every upgrade? * use some trick like I outlined below to wait for config_change? Mike I wrote: > A related question.... This is an issue that often makes me resort to > stopping and starting my applictions on upgrade, even when it should be > easy to avoid. > > It seems that release_handler:eval_appup_script/4 first evaluates the > upgrade script directives (reloads modules, calls code_change handlers, > etc.), and then afterward changes the application configuration and > calls config_change. Perhaps there's a good reason for this order. > > But in any case, this means that if you add a new application > environment variable controlling some new behavior of a server, it won't > be available when the server's code_change hander is called. So the > obvious way of doing things (in code_change, read the value of the new > variable and use it to transform the state) will crash. > > Is there an easy way to work around this? > > My only idea was to have code_change put the server into a temporary > state where it's waiting for the application's config_change handler to > be called, and then Application:config_change somehow knows about a list > of gen_servers (etc.) to call with the new configuration. > > Maybe this could be handled generically by an extension to gen_server. > It would be nice to be able to write > code_change (OldVersion, EnvChanged, EnvNew, EnvRemoved, State, Extra) > and do all the transformations in one place. > > Mike From bbmaj7@REDACTED Mon Dec 1 23:06:02 2008 From: bbmaj7@REDACTED (Richard Andrews) Date: Mon, 1 Dec 2008 14:06:02 -0800 (PST) Subject: [erlang-questions] ussd application using erlang References: Message-ID: <247304.60406.qm@web65510.mail.ac4.yahoo.com> Forget erlang for now. First you will need a C program to interface to the NMS driver libraries. Read the NMS documentation for interfacing to the relevant SS7 part. The NMS library install has historically come with a large number of C demo programs. See if you can find one that works for USSD. Once you have a working C program, you can link eg. erl_interface into the C program to allow it to be started as a port and communicate with an erlang node. ________________________________ From: prasantha kumara To: erlang-questions@REDACTED Sent: Monday, 1 December, 2008 11:50:37 PM Subject: [erlang-questions] ussd application using erlang Hi i am trying to develop a ussd application using erlang and NMS400tx board.i want to get the ussd massage from the TCAP layer.can any one help me to proceed.(any documents). Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang-questions_efine@REDACTED Tue Dec 2 05:11:20 2008 From: erlang-questions_efine@REDACTED (Edwin Fine) Date: Mon, 1 Dec 2008 23:11:20 -0500 Subject: [erlang-questions] Use of application environment In-Reply-To: <492BCC01.60805@erlang-consulting.com> References: <6c2563b20811241927t208e2d2dy27e710b61e6ca897@mail.gmail.com> <492BA39D.7070107@erlang-consulting.com> <492BCC01.60805@erlang-consulting.com> Message-ID: <6c2563b20812012011l1617b3afnfa35f2afd8181f06@mail.gmail.com> On Tue, Nov 25, 2008 at 4:57 AM, Mazen Harake < mazen.harake@REDACTED> wrote: > Resending... > > /Mazen > > Mazen Harake wrote: > > Personally I think in terms of isolation and how long the worker is > > going to live. > > > > If the worker is short lived and doesn't depend on that the app env is > > the same in several places... then I tend to use application:get_env. > > If the worker is a more heavy worker and depends on more rigid values > > then I tend to copy the configuration to the state so that I can > > control when a good time to update it is.. > > > > Magically updating all the workers is not always a good thing... and > > yes, applicationg:get_env is the same as using global variables. > > > Hi Mazen, I was holding off from replying and hoping to receive more opinions and thank everyone at once, but I guess no more are forthcoming. Many thanks to you and wde for your input. Regards, Edwin Fine > > /Mazen > > > > Edwin Fine wrote: > >> Hi all, > >> > >> Is it considered bad practice to use application environment > >> variables (i.e. application:get_env/2,3) in workers, as opposed to > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ixmatus@REDACTED Tue Dec 2 07:47:36 2008 From: ixmatus@REDACTED (Parnell Springmeyer) Date: Mon, 01 Dec 2008 22:47:36 -0800 Subject: [erlang-questions] RDF libraries/modules? Message-ID: <4934DA08.1010606@gmail.com> Has anyone begun or even completed a module for parsing RDF? --- Parnell Springmeyer From ulises.cervino@REDACTED Tue Dec 2 08:04:37 2008 From: ulises.cervino@REDACTED (Ulises) Date: Tue, 2 Dec 2008 07:04:37 +0000 Subject: [erlang-questions] Fwd: RDF libraries/modules? In-Reply-To: <226d73360812012304vc77ee9dt3bea51ed77f9c234@mail.gmail.com> References: <4934DA08.1010606@gmail.com> <226d73360812012304vc77ee9dt3bea51ed77f9c234@mail.gmail.com> Message-ID: <226d73360812012304u2da1d7bqd9aa7b79b407ad7b@mail.gmail.com> forgot to hit the 'reply-all' button ... ---------- Forwarded message ---------- From: Ulises Date: 2008/12/2 Subject: Re: [erlang-questions] RDF libraries/modules? To: Parnell Springmeyer > Has anyone begun or even completed a module for parsing RDF? I'm also on the look for this to the point where I'm considering writing one myself. Any pointers on where to begin? U From ixmatus@REDACTED Tue Dec 2 10:40:48 2008 From: ixmatus@REDACTED (Parnell Springmeyer) Date: Tue, 02 Dec 2008 01:40:48 -0800 Subject: [erlang-questions] Fwd: RDF libraries/modules? In-Reply-To: <226d73360812012304u2da1d7bqd9aa7b79b407ad7b@mail.gmail.com> References: <4934DA08.1010606@gmail.com> <226d73360812012304vc77ee9dt3bea51ed77f9c234@mail.gmail.com> <226d73360812012304u2da1d7bqd9aa7b79b407ad7b@mail.gmail.com> Message-ID: <493502A0.6010405@gmail.com> Ulises wrote: > forgot to hit the 'reply-all' button ... > > > ---------- Forwarded message ---------- > From: Ulises > Date: 2008/12/2 > Subject: Re: [erlang-questions] RDF libraries/modules? > To: Parnell Springmeyer > > > >> Has anyone begun or even completed a module for parsing RDF? >> > > I'm also on the look for this to the point where I'm considering > writing one myself. Any pointers on where to begin? > > U > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > Ulises, I am also considering writing one myself - I am soon going to begin building an RDF Triple Store in Erlang - maybe we should make a google code project? Either way RDF parsers are not all that difficult to build - parsers with SPARQL support, forward chaining reasoning support, and triple store backend support are another story entirely. At this point I'm only interested in a proof-of-concept for my own triple store project and would only be looking at a module that can parse an RDF graph and serialize to an RDF graph. --- Parnell Springmeyer From ulises.cervino@REDACTED Tue Dec 2 10:44:06 2008 From: ulises.cervino@REDACTED (Ulises) Date: Tue, 2 Dec 2008 09:44:06 +0000 Subject: [erlang-questions] Fwd: RDF libraries/modules? In-Reply-To: <493502A0.6010405@gmail.com> References: <4934DA08.1010606@gmail.com> <226d73360812012304vc77ee9dt3bea51ed77f9c234@mail.gmail.com> <226d73360812012304u2da1d7bqd9aa7b79b407ad7b@mail.gmail.com> <493502A0.6010405@gmail.com> Message-ID: <226d73360812020144m5fc8bc57n93d2e2546d083628@mail.gmail.com> > I am also considering writing one myself - I am soon going to begin building > an RDF Triple Store in Erlang - maybe we should make a google code project? Sure, why not? > Either way RDF parsers are not all that difficult to build - parsers with > SPARQL support, forward chaining reasoning support, and triple store backend > support are another story entirely. At this point I'm only interested in a > proof-of-concept for my own triple store project and would only be looking > at a module that can parse an RDF graph and serialize to an RDF graph. That sounds like a good starting point anyway, surely we could add more and more as needed ... all projects begin small I believe, got any code yet? U From rvg@REDACTED Tue Dec 2 10:45:24 2008 From: rvg@REDACTED (Rudolph van Graan) Date: Tue, 2 Dec 2008 11:45:24 +0200 Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December 2008) Message-ID: <8474074A-8F5A-452C-905E-52A1D320AF4E@patternmatched.com> Hi, Anybody up for an Erlounge somewhere in New York next week? I will be in town from Wednesday. Rudolph van Graan Pattern Matched Technologies E-Mail: rvg@REDACTED Tel: 086 1000 700 (SA Only) Mobile: +27 83 390 7767 Fax: +27 12 665 9566 Web: www.patternmatched.com From cthulahoops@REDACTED Tue Dec 2 12:36:19 2008 From: cthulahoops@REDACTED (Adam Kelly) Date: Tue, 2 Dec 2008 11:36:19 +0000 Subject: [erlang-questions] Use of application environment In-Reply-To: <6c2563b20812012011l1617b3afnfa35f2afd8181f06@mail.gmail.com> References: <6c2563b20811241927t208e2d2dy27e710b61e6ca897@mail.gmail.com> <492BA39D.7070107@erlang-consulting.com> <492BCC01.60805@erlang-consulting.com> <6c2563b20812012011l1617b3afnfa35f2afd8181f06@mail.gmail.com> Message-ID: <8d1798e90812020336v1bc6a261x619593f692154e06@mail.gmail.com> 2008/12/2 Edwin Fine : > I was holding off from replying and hoping to receive more opinions and > thank everyone at once, but I guess no more are forthcoming. Many thanks to > you and wde for your input. I took the decision early in my Erlang learning that individual servers shouldn't know whether or not they are part of a supervision tree or an application in order to avoid cyclic dependencies. Therefore, I call application:get_all_env/1 from my application module, pass the resulting list to the top level supervisor which passes the relevant configuration information to each part as needed. The upside is that this really help with testing as I can easily test individual gen_servers with different configuration settings. On the other hand, it makes changes to configuration settings at runtime very difficult. For the one application that needs to be reconfigured regularly, I've implemented a reconfigure command which rereads the configuration file and sends messages to the relevant workers informing them of the new settings. I'm not sure if this is the best solution in general, particularly when it comes to core parts of the system that can't really be run in isolation for testing anyway and it always creates the risk of accidentally running with old cached configuration info. As regards upgrades, I tend to assume significant upgrades will cause crashes, and rely on the self-healing property to do the right thing. The system is designed to crash without interruption to service so I let it do just that. I'm also very interested as to what approach others take to this issue. Adam. From mazen.harake@REDACTED Tue Dec 2 12:47:11 2008 From: mazen.harake@REDACTED (Mazen Harake) Date: Tue, 02 Dec 2008 13:47:11 +0200 Subject: [erlang-questions] Use of application environment In-Reply-To: <8d1798e90812020336v1bc6a261x619593f692154e06@mail.gmail.com> References: <6c2563b20811241927t208e2d2dy27e710b61e6ca897@mail.gmail.com> <492BA39D.7070107@erlang-consulting.com> <492BCC01.60805@erlang-consulting.com> <6c2563b20812012011l1617b3afnfa35f2afd8181f06@mail.gmail.com> <8d1798e90812020336v1bc6a261x619593f692154e06@mail.gmail.com> Message-ID: <4935203F.1050502@erlang-consulting.com> Personally from experience I always end up thinking of design that allows the system to be gradually upgraded. (Some of our projects do just this). Actually this is a really good thing because you can treat the nodes you are upgrading as being "down". E.g. if you have a cluster of several frontend and backend nodes etc... then you should be able to split it up, upgrading a few of each... then test your upgrade went fine... transfer the traffic... then upgrade the other part and enable traffic on all again. Has worked nice so far. As for the update of configuration, It is probably Always best for heavy long lived processes to be able to decide when a good time to update the configuration is specially if the process has a state which has been based on configuration. You don't want to mix configuration :) /Mazen Adam Kelly wrote: > 2008/12/2 Edwin Fine : > >> I was holding off from replying and hoping to receive more opinions and >> thank everyone at once, but I guess no more are forthcoming. Many thanks to >> you and wde for your input. >> > > I took the decision early in my Erlang learning that individual > servers shouldn't know whether or not they are part of a supervision > tree or an application in order to avoid cyclic dependencies. > Therefore, I call application:get_all_env/1 from my application > module, pass the resulting list to the top level supervisor which > passes the relevant configuration information to each part as needed. > The upside is that this really help with testing as I can easily test > individual gen_servers with different configuration settings. On the > other hand, it makes changes to configuration settings at runtime very > difficult. > > For the one application that needs to be reconfigured regularly, I've > implemented a reconfigure command which rereads the configuration file > and sends messages to the relevant workers informing them of the new > settings. > > I'm not sure if this is the best solution in general, particularly > when it comes to core parts of the system that can't really be run in > isolation for testing anyway and it always creates the risk of > accidentally running with old cached configuration info. > > As regards upgrades, I tend to assume significant upgrades will cause > crashes, and rely on the self-healing property to do the right thing. > The system is designed to crash without interruption to service so I > let it do just that. > > I'm also very interested as to what approach others take to this issue. > > Adam. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From chsu79@REDACTED Tue Dec 2 12:51:01 2008 From: chsu79@REDACTED (Christian) Date: Tue, 2 Dec 2008 12:51:01 +0100 Subject: [erlang-questions] Use of application environment In-Reply-To: <8d1798e90812020336v1bc6a261x619593f692154e06@mail.gmail.com> References: <6c2563b20811241927t208e2d2dy27e710b61e6ca897@mail.gmail.com> <492BA39D.7070107@erlang-consulting.com> <492BCC01.60805@erlang-consulting.com> <6c2563b20812012011l1617b3afnfa35f2afd8181f06@mail.gmail.com> <8d1798e90812020336v1bc6a261x619593f692154e06@mail.gmail.com> Message-ID: On Tue, Dec 2, 2008 at 12:36, Adam Kelly wrote: > I took the decision early in my Erlang learning that individual > servers shouldn't know whether or not they are part of a supervision > I'm also very interested as to what approach others take to this issue. I let my supervisors extract the app configuration items that are needed, they are so simple and uninteresting to test. I never let workers, gen_servers and other proc_lib:ish, access the app configuration. From joelr1@REDACTED Tue Dec 2 18:04:34 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 2 Dec 2008 17:04:34 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split Message-ID: What about keeping a version counter on each mnesia node in the cluster and adding a version number to every record? Alternatively, the version counter could be kept per table or a timestamp could be used instead. The version number would be bumped on every insert or update and the node or table with the highest vnum would be chosen as the master after nodes rejoin. The goal is to pick the latest record as the true one. What do you think? Sent from my iPhone From alustenberg@REDACTED Tue Dec 2 18:18:40 2008 From: alustenberg@REDACTED (Alex) Date: Tue, 2 Dec 2008 12:18:40 -0500 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: References: Message-ID: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> what happens when you have multiple updates to both sides of the split? if you just pick the highest vnum, you lose all the transactions from the other side of the split when it rejoins. On Tue, Dec 2, 2008 at 12:04 PM, Joel Reymont wrote: > What about keeping a version counter on each mnesia node in the > cluster and adding a version number to every record? > > Alternatively, the version counter could be kept per table or a > timestamp could be used instead. > > The version number would be bumped on every insert or update and the > node or table with the highest vnum would be chosen as the master > after nodes rejoin. > > The goal is to pick the latest record as the true one. > > What do you think? > > Sent from my iPhone > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ixmatus@REDACTED Tue Dec 2 18:53:56 2008 From: ixmatus@REDACTED (Parnell Springmeyer) Date: Tue, 2 Dec 2008 09:53:56 -0800 Subject: [erlang-questions] Fwd: RDF libraries/modules? In-Reply-To: <226d73360812020144m5fc8bc57n93d2e2546d083628@mail.gmail.com> References: <4934DA08.1010606@gmail.com> <226d73360812012304vc77ee9dt3bea51ed77f9c234@mail.gmail.com> <226d73360812012304u2da1d7bqd9aa7b79b407ad7b@mail.gmail.com> <493502A0.6010405@gmail.com> <226d73360812020144m5fc8bc57n93d2e2546d083628@mail.gmail.com> Message-ID: No, I do not - tonight I'll have some time to setup a project and hammer out some code. On Tue, Dec 2, 2008 at 1:44 AM, Ulises wrote: > > I am also considering writing one myself - I am soon going to begin > building > > an RDF Triple Store in Erlang - maybe we should make a google code > project? > > Sure, why not? > > > Either way RDF parsers are not all that difficult to build - parsers with > > SPARQL support, forward chaining reasoning support, and triple store > backend > > support are another story entirely. At this point I'm only interested in > a > > proof-of-concept for my own triple store project and would only be > looking > > at a module that can parse an RDF graph and serialize to an RDF graph. > > That sounds like a good starting point anyway, surely we could add > more and more as needed ... all projects begin small I believe, got > any code yet? > > U > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang-questions_efine@REDACTED Tue Dec 2 19:02:10 2008 From: erlang-questions_efine@REDACTED (Edwin Fine) Date: Tue, 2 Dec 2008 13:02:10 -0500 Subject: [erlang-questions] Use of application environment In-Reply-To: References: <6c2563b20811241927t208e2d2dy27e710b61e6ca897@mail.gmail.com> <492BA39D.7070107@erlang-consulting.com> <492BCC01.60805@erlang-consulting.com> <6c2563b20812012011l1617b3afnfa35f2afd8181f06@mail.gmail.com> <8d1798e90812020336v1bc6a261x619593f692154e06@mail.gmail.com> Message-ID: <6c2563b20812021002y7efef1e4k869c9acf05a1b3c8@mail.gmail.com> On Tue, Dec 2, 2008 at 6:51 AM, Christian wrote: > On Tue, Dec 2, 2008 at 12:36, Adam Kelly wrote: > > I took the decision early in my Erlang learning that individual > > servers shouldn't know whether or not they are part of a supervision > > > I'm also very interested as to what approach others take to this issue. > > I let my supervisors extract the app configuration items that are > needed, they are so simple and uninteresting to test. I never let > workers, gen_servers and other proc_lib:ish, access the app > configuration. Christian, How do you propagate real-time configuration updates to a running worker? For example, let's say it is trying to connect to a URL, and that URL is not working. You get given (by the URL owner) an alternate URL to use and must now let the worker(s) know. AFAICS you can't shut down the supervision tree to get new app configuration values (because other workers are running just fine and you don't want to kill them for nothing), and killing the worker in question won't help because the supervisor will have the old app configuration values. Edwin > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From machinshin2002@REDACTED Tue Dec 2 18:41:33 2008 From: machinshin2002@REDACTED (Vat Raghavan) Date: Tue, 2 Dec 2008 09:41:33 -0800 (PST) Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December 2008) References: <8474074A-8F5A-452C-905E-52A1D320AF4E@patternmatched.com> Message-ID: <449398.6638.qm@web31504.mail.mud.yahoo.com> Thought would be great!?I recently moved to?New York and i've love to meet local?Erlang-ers :) --vat ? ----.signature---- Without the hope that things will get better, ?that our inheritors will know a world that is fuller and richer than our own, life is pointless, and evolution is vastly overrated -- Delenn ----- Original Message ---- From: Rudolph van Graan To: Erlang Questions Sent: Tuesday, December 2, 2008 4:45:24 AM Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December 2008) Hi, Anybody up for an Erlounge somewhere in New York next week? I will be? in town from Wednesday. Rudolph van Graan Pattern Matched Technologies E-Mail:? rvg@REDACTED Tel:? ? 086 1000 700 (SA Only) Mobile:? +27 83 390 7767 Fax:? ? +27 12 665 9566 Web:? ? www.patternmatched.com _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From mihai@REDACTED Tue Dec 2 20:32:26 2008 From: mihai@REDACTED (Mihai Balea) Date: Tue, 2 Dec 2008 14:32:26 -0500 Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December 2008) In-Reply-To: <8474074A-8F5A-452C-905E-52A1D320AF4E@patternmatched.com> References: <8474074A-8F5A-452C-905E-52A1D320AF4E@patternmatched.com> Message-ID: I'm in NJ, reasonably close to Manhattan, and I'd be glad to join a NYC Erlounge. BTW, there's a (small and inactive) NYC Erlang User group at http://groups.google.com/group/nycerlang Mihai On Dec 2, 2008, at 4:45 AM, Rudolph van Graan wrote: > Hi, > > Anybody up for an Erlounge somewhere in New York next week? I will be > in town from Wednesday. > > Rudolph van Graan > > Pattern Matched Technologies > > E-Mail: rvg@REDACTED > Tel: 086 1000 700 (SA Only) > Mobile: +27 83 390 7767 > Fax: +27 12 665 9566 > Web: www.patternmatched.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From mcpherson@REDACTED Tue Dec 2 21:02:08 2008 From: mcpherson@REDACTED (Allen McPherson) Date: Tue, 2 Dec 2008 13:02:08 -0700 Subject: [erlang-questions] Any canonical bandwidth benchmarks for clusters? Message-ID: I'm testing some code that is showing terrible bandwidth on our 40+ node Infiniband cluster (7 MB/sec for a ring benchmark!). This code is using the IP over IB interface and send big (1+ MB) messages around (binaries and non-binaries). MPI code runs at good rates on this cluster. Before I post my code I thought I'd see if there were existing bandwidth benchmarks for distributed Erlang on a locally connected cluster. Haven't been able to find any via Google. Does anyone know of, or have, code that I might use to test. Lacking other tests I'll put together a longer post with my code included and maybe someone else with a similar cluster could run it? Thanks -- Allen McPherson Los Alamos National Laboratory From joelr1@REDACTED Tue Dec 2 21:03:51 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 2 Dec 2008 20:03:51 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> Message-ID: <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> Alex, On Dec 2, 2008, at 5:18 PM, Alex wrote: > what happens when you have multiple updates to both sides of the > split? if you just pick the highest vnum, you lose all the > transactions from the other side of the split when it rejoins. You can pick up new (inserted) records by doing a diff of primary keys for each table. You cannot do anything about deleted records, I think, so you'll just have to delete those again somehow. You could assume that the table replica with the latest timestamp is the right one and just delete the extra records from the other table. Imagine a bank account that's distributed across the split nodes, where a customer deposits money a 2 times and the deposits are split across the nodes. You'll pick up the latest deposit on one node and miss the other deposit. I think you can overcome this programmatically, with a timestamp _and_ a version number. You can have a version table per node with three columns: table name, vnum and timestamp. The rest of the tables would have just the vnum in their records. When updating table T, you will first update the version table by storing the current time and bumping the vnum for the key T. You will then store the vnum in the record of table T that you are updating. You will be able to find the split time by looking at the version tables and figuring out when the vnums started to diverge. You can then invoke a merge function that figures out, for example, how to merge a bunch of bank deposit transactions into a single balance. You will know the vnum at split time and will only need to consider the transactions that happened after. Shouldn't be a lot of transactions for a short split time. What do you think? -- http://twitter.com/wagerlabs From chsu79@REDACTED Tue Dec 2 21:09:42 2008 From: chsu79@REDACTED (Christian) Date: Tue, 2 Dec 2008 21:09:42 +0100 Subject: [erlang-questions] Use of application environment In-Reply-To: <6c2563b20812021002y7efef1e4k869c9acf05a1b3c8@mail.gmail.com> References: <6c2563b20811241927t208e2d2dy27e710b61e6ca897@mail.gmail.com> <492BA39D.7070107@erlang-consulting.com> <492BCC01.60805@erlang-consulting.com> <6c2563b20812012011l1617b3afnfa35f2afd8181f06@mail.gmail.com> <8d1798e90812020336v1bc6a261x619593f692154e06@mail.gmail.com> <6c2563b20812021002y7efef1e4k869c9acf05a1b3c8@mail.gmail.com> Message-ID: On Tue, Dec 2, 2008 at 19:02, Edwin Fine wrote: > How do you propagate real-time configuration updates to a running worker? The widest solution I have found for that situation is to make the setting of such values explicit (as in using a handle_call clause for it) and use the application behaviour's Module:start_phase/3 callback to make sure it is set once at startup. Then one can use that interface to change it at any time later. It is quite convenient most of the time. PS. Documentation wise I'm quite confused how start phases are supposed to work with included applications. Could someone have a go at explaining it differently from the documentation? From dmercer@REDACTED Tue Dec 2 21:24:18 2008 From: dmercer@REDACTED (David Mercer) Date: Tue, 2 Dec 2008 14:24:18 -0600 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> Message-ID: <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> On Tuesday, December 02, 2008, Joel Reymont wrote: > Imagine a bank account that's distributed across the split nodes, > where a customer deposits money a 2 times and the deposits are split > across the nodes. You'll pick up the latest deposit on one node and > miss the other deposit. > > I think you can overcome this programmatically, with a timestamp _and_ > a version number. You can have a version table per node with three > columns: table name, vnum and timestamp. The rest of the tables would > have just the vnum in their records. > > When updating table T, you will first update the version table by > storing the current time and bumping the vnum for the key T. You will > then store the vnum in the record of table T that you are updating. > > You will be able to find the split time by looking at the version > tables and figuring out when the vnums started to diverge. You can > then invoke a merge function that figures out, for example, how to > merge a bunch of bank deposit transactions into a single balance. > > You will know the vnum at split time and will only need to consider > the transactions that happened after. Shouldn't be a lot of > transactions for a short split time. > > What do you think? How do you handle unsynched clocks on the two nodes? How about two different transactions that occur at the same time on the two nodes right after the split? And if an account with balance x before the split on one node has a balance of x + d1 after a deposit, while the other node has balance x + d2 after another deposit, all you have during the merge is the balances x + d1 and x + d2, and no way to identify d1 and d2 without knowing x. Isn't this what databases use transaction logs for, and if so, can we learn anything from how they handle this situation? Anyone have that expertise? Cheers, David From rpettit@REDACTED Tue Dec 2 21:30:05 2008 From: rpettit@REDACTED (Rick Pettit) Date: Tue, 2 Dec 2008 14:30:05 -0600 (CST) Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> Message-ID: <65022.192.168.129.36.1228249805.squirrel@squirrelmail.vail> On Tue, December 2, 2008 2:03 pm, Joel Reymont wrote: > Alex, > > On Dec 2, 2008, at 5:18 PM, Alex wrote: > >> what happens when you have multiple updates to both sides of the >> split? if you just pick the highest vnum, you lose all the >> transactions from the other side of the split when it rejoins. > > > You can pick up new (inserted) records by doing a diff of primary keys > for each table. > > You cannot do anything about deleted records, I think, so you'll just > have to delete those again somehow. You could assume that the table > replica with the latest timestamp is the right one and just delete the > extra records from the other table. > > Imagine a bank account that's distributed across the split nodes, > where a customer deposits money a 2 times and the deposits are split > across the nodes. You'll pick up the latest deposit on one node and > miss the other deposit. > > I think you can overcome this programmatically, with a timestamp _and_ > a version number. You can have a version table per node with three > columns: table name, vnum and timestamp. The rest of the tables would > have just the vnum in their records. > > When updating table T, you will first update the version table by > storing the current time and bumping the vnum for the key T. You will > then store the vnum in the record of table T that you are updating. > > You will be able to find the split time by looking at the version > tables and figuring out when the vnums started to diverge. You can > then invoke a merge function that figures out, for example, how to > merge a bunch of bank deposit transactions into a single balance. > > You will know the vnum at split time and will only need to consider > the transactions that happened after. Shouldn't be a lot of > transactions for a short split time. > > What do you think? The ideas are interesting, though I pray my bank never adopts such software. I don't think bank software can continue to allow transactions like deposit and withdrawal during a network partition--I just don't see how that can be made to work while maintaining a consistent view of the various accounts across disconnected nodes (e.g. how can a bank ATM allow me to withdraw funds if it cannot reach its peer node(s) at my bank to determine the availability of such funds?). Most systems I work with implement a recovery procedure similar to what Ulf has posted in the past on this list. This works in my _special case_ because I am tracking real-time telephony stats used to route calls (vs. manage bank account information). Because the systems I am referring to require high-availability over 100% data consistency, this is perfectly ok (and works quite well). With issues like telecom "glare" I couldn't be 100% accurate all the time anyway. So, to recover from a partition it is enough to pick any functioning node as the new "master" and have others restart and/or force load tables from it. The entire time clients keep pushing new stats into the system, so everything "converges on reality" in the end following a recovery attempt anyway. This system works extremely well, but again I wouldn't dream of using it to implement ATM software for managing bank accounts. -Rick From joelr1@REDACTED Tue Dec 2 21:34:02 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 2 Dec 2008 20:34:02 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> Message-ID: <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> On Dec 2, 2008, at 8:24 PM, David Mercer wrote: > How do you handle unsynched clocks on the two nodes? I don't know. Should they go out of sync during the split if the split is short? > How about two different transactions that occur at the same time on > the two > nodes right after the split? That would be a transaction that 1) happens at the same time, down to a microsecond in Erlang, 2) updates the same table, 3) updates the same primary key of said table, 4) whilst no other transactions have happened so that they version number is the same. I think all of the above is highly unlikely. > And if an account with balance x before the split on one node has a > balance > of x + d1 after a deposit, while the other node has balance x + d2 > after > another deposit, all you have during the merge is the balances x + > d1 and x > + d2, and no way to identify d1 and d2 without knowing x. You would code defensively, obviously, and would have a separate ledger for deposits and withdrawals that you could always reconcile to arrive at the proper balance. -- http://twitter.com/wagerlabs From rick.richardson@REDACTED Tue Dec 2 21:39:48 2008 From: rick.richardson@REDACTED (Rick R) Date: Tue, 2 Dec 2008 15:39:48 -0500 Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December 2008) In-Reply-To: <449398.6638.qm@web31504.mail.mud.yahoo.com> References: <8474074A-8F5A-452C-905E-52A1D320AF4E@patternmatched.com> <449398.6638.qm@web31504.mail.mud.yahoo.com> Message-ID: <9810b81b0812021239i6d634b0bke9b48367873fdb34@mail.gmail.com> I'm very interested. On Tue, Dec 2, 2008 at 12:41 PM, Vat Raghavan wrote: > Thought would be great! I recently moved to New York and i've love to meet > local Erlang-ers :) > > --vat > > > ----.signature---- > Without the hope that things will get better, > that our inheritors will know a world that is fuller and richer than our > own, > life is pointless, and evolution is vastly overrated > -- Delenn > > > > ----- Original Message ---- > From: Rudolph van Graan > To: Erlang Questions > Sent: Tuesday, December 2, 2008 4:45:24 AM > Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December > 2008) > > Hi, > > Anybody up for an Erlounge somewhere in New York next week? I will be > in town from Wednesday. > > Rudolph van Graan > > Pattern Matched Technologies > > E-Mail: rvg@REDACTED > Tel: 086 1000 700 (SA Only) > Mobile: +27 83 390 7767 > Fax: +27 12 665 9566 > Web: www.patternmatched.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Tue Dec 2 21:40:13 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 2 Dec 2008 20:40:13 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <65022.192.168.129.36.1228249805.squirrel@squirrelmail.vail> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <65022.192.168.129.36.1228249805.squirrel@squirrelmail.vail> Message-ID: Rick, On Dec 2, 2008, at 8:30 PM, Rick Pettit wrote: > (e.g. how can a bank ATM allow > me to withdraw funds if it cannot reach its peer node(s) at my bank to > determine the availability of such funds?). In my scenario a bank ATM would have an internal Mnesia table with the balance :-). The ATM would clearly be part of a cluster of ATM, replicating their transactions and balances to all other ATMS in the cluster. > Most systems I work with implement a recovery procedure similar to > what > Ulf has posted in the past on this list. Would you kindly post a link to that procedure in this thread, for easier reference? > Because the systems I am referring to require high-availability over > 100% > data consistency, this is perfectly ok (and works quite well). With > issues > like telecom "glare" I couldn't be 100% accurate all the time anyway. What's telecom glare? > So, to recover from a partition it is enough to pick any functioning > node > as the new "master" and have others restart and/or force load tables > from > it. The entire time clients keep pushing new stats into the system, so > everything "converges on reality" in the end following a recovery > attempt > anyway. I understand that Mnesia was designed for telco ops but I want to run my social network on top of it. I did a search before and all the solutions were along the lines of "I'm dealing with telco stuff or I can just throw that data out". I don't have such luxury and don't want to throw Mnesia out in favor of PostgreSQL until I absolutely have to. Thanks, Joel -- http://twitter.com/wagerlabs From dmercer@REDACTED Tue Dec 2 21:45:18 2008 From: dmercer@REDACTED (David Mercer) Date: Tue, 2 Dec 2008 14:45:18 -0600 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <65022.192.168.129.36.1228249805.squirrel@squirrelmail.vail> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com><2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <65022.192.168.129.36.1228249805.squirrel@squirrelmail.vail> Message-ID: <62CDD21CBD764551B8D1683F658CDDFC@SSI.CORP> On Tuesday, December 02, 2008, Rick Pettit wrote: > The ideas are interesting, though I pray my bank never adopts such > software. > > I don't think bank software can continue to allow transactions like > deposit and withdrawal during a network partition--I just don't see how > that can be made to work while maintaining a consistent view of the > various accounts across disconnected nodes (e.g. how can a bank ATM allow > me to withdraw funds if it cannot reach its peer node(s) at my bank to > determine the availability of such funds?). I was thinking the opposite. I would presume banks would have to continue to function through network problems, so these must be solved problems, backed by good solid theory. (Now, I doubt banks just record account balances, since they also need transaction details, so the master balance of an account is not the 'account_balances' table but the sum of all transactions pertaining to that account. (In practice, I imagine they reconcile the transactions into a balance summary periodically.) Therefore, all transactions are inserts, and balances are updated asynchronously.) > With issues > like telecom "glare" I couldn't be 100% accurate all the time anyway. What is telecom "glare"? Cheers, David > -----Original Message----- > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions- > bounces@REDACTED] On Behalf Of > Sent: 14:30 > To: Joel Reymont > Cc: Erlang Questions > Subject: Re: [erlang-questions] auto-syncing mnesia after a network split > > On Tue, December 2, 2008 2:03 pm, Joel Reymont wrote: > > Alex, > > > > On Dec 2, 2008, at 5:18 PM, Alex wrote: > > > >> what happens when you have multiple updates to both sides of the > >> split? if you just pick the highest vnum, you lose all the > >> transactions from the other side of the split when it rejoins. > > > > > > You can pick up new (inserted) records by doing a diff of primary keys > > for each table. > > > > You cannot do anything about deleted records, I think, so you'll just > > have to delete those again somehow. You could assume that the table > > replica with the latest timestamp is the right one and just delete the > > extra records from the other table. > > > > Imagine a bank account that's distributed across the split nodes, > > where a customer deposits money a 2 times and the deposits are split > > across the nodes. You'll pick up the latest deposit on one node and > > miss the other deposit. > > > > I think you can overcome this programmatically, with a timestamp _and_ > > a version number. You can have a version table per node with three > > columns: table name, vnum and timestamp. The rest of the tables would > > have just the vnum in their records. > > > > When updating table T, you will first update the version table by > > storing the current time and bumping the vnum for the key T. You will > > then store the vnum in the record of table T that you are updating. > > > > You will be able to find the split time by looking at the version > > tables and figuring out when the vnums started to diverge. You can > > then invoke a merge function that figures out, for example, how to > > merge a bunch of bank deposit transactions into a single balance. > > > > You will know the vnum at split time and will only need to consider > > the transactions that happened after. Shouldn't be a lot of > > transactions for a short split time. > > > > What do you think? > > The ideas are interesting, though I pray my bank never adopts such > software. > > I don't think bank software can continue to allow transactions like > deposit and withdrawal during a network partition--I just don't see how > that can be made to work while maintaining a consistent view of the > various accounts across disconnected nodes (e.g. how can a bank ATM allow > me to withdraw funds if it cannot reach its peer node(s) at my bank to > determine the availability of such funds?). > > Most systems I work with implement a recovery procedure similar to what > Ulf has posted in the past on this list. This works in my _special case_ > because I am tracking real-time telephony stats used to route calls (vs. > manage bank account information). > > Because the systems I am referring to require high-availability over 100% > data consistency, this is perfectly ok (and works quite well). With issues > like telecom "glare" I couldn't be 100% accurate all the time anyway. > > So, to recover from a partition it is enough to pick any functioning node > as the new "master" and have others restart and/or force load tables from > it. The entire time clients keep pushing new stats into the system, so > everything "converges on reality" in the end following a recovery attempt > anyway. > > This system works extremely well, but again I wouldn't dream of using it > to implement ATM software for managing bank accounts. > > -Rick > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From joelr1@REDACTED Tue Dec 2 21:49:19 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 2 Dec 2008 20:49:19 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> Message-ID: <21740266-7428-4F59-AEEA-5D9B96D49EAC@gmail.com> On Dec 2, 2008, at 8:24 PM, David Mercer wrote: > Isn't this what > databases use transaction logs for, and if so, can we learn anything > from > how they handle this situation? Anyone have that expertise? Hell, yes! You could add timestamps and version numbers to Mnesia logs. Then you could autosync for real! -- http://twitter.com/wagerlabs From tbaldridge@REDACTED Tue Dec 2 21:59:32 2008 From: tbaldridge@REDACTED (Timothy Baldridge) Date: Tue, 2 Dec 2008 14:59:32 -0600 Subject: [erlang-questions] Any canonical bandwidth benchmarks for clusters? In-Reply-To: References: Message-ID: > I'm testing some code that is showing terrible bandwidth > on our 40+ node Infiniband cluster (7 MB/sec for a ring benchmark!). > This code is using the IP over IB interface and send big (1+ MB) > messages around (binaries and non-binaries). MPI code runs > at good rates on this cluster. This is probably a really stupid question, but how are you measuring the bandwidth? The ring benchmark is only going to measure the bandwidth of one node to another node at any given time. What you may want is a mesh network where each node receives a single message and then passes that off to another random node. This way half the nodes can be talking to the other half and your bandwidth should go through the roof. It just seems that a ring benchmark is the wrong benchmark to use. But I'm no Erlang guru. Timothy From armstrong.whit@REDACTED Tue Dec 2 22:06:33 2008 From: armstrong.whit@REDACTED (Whit Armstrong) Date: Tue, 2 Dec 2008 16:06:33 -0500 Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December 2008) In-Reply-To: <9810b81b0812021239i6d634b0bke9b48367873fdb34@mail.gmail.com> References: <8474074A-8F5A-452C-905E-52A1D320AF4E@patternmatched.com> <449398.6638.qm@web31504.mail.mud.yahoo.com> <9810b81b0812021239i6d634b0bke9b48367873fdb34@mail.gmail.com> Message-ID: <8ec76080812021306l6d965c4ao4716224b606ab628@mail.gmail.com> count me in as long as it's somewhere close to mid-town. -Whit 2008/12/2 Rick R : > I'm very interested. > > On Tue, Dec 2, 2008 at 12:41 PM, Vat Raghavan > wrote: >> >> Thought would be great! I recently moved to New York and i've love to meet >> local Erlang-ers :) >> >> --vat >> >> >> ----.signature---- >> Without the hope that things will get better, >> that our inheritors will know a world that is fuller and richer than our >> own, >> life is pointless, and evolution is vastly overrated >> -- Delenn >> >> >> >> ----- Original Message ---- >> From: Rudolph van Graan >> To: Erlang Questions >> Sent: Tuesday, December 2, 2008 4:45:24 AM >> Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December >> 2008) >> >> Hi, >> >> Anybody up for an Erlounge somewhere in New York next week? I will be >> in town from Wednesday. >> >> Rudolph van Graan >> >> Pattern Matched Technologies >> >> E-Mail: rvg@REDACTED >> Tel: 086 1000 700 (SA Only) >> Mobile: +27 83 390 7767 >> Fax: +27 12 665 9566 >> Web: www.patternmatched.com >> >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From rpettit@REDACTED Tue Dec 2 22:09:27 2008 From: rpettit@REDACTED (Rick Pettit) Date: Tue, 2 Dec 2008 15:09:27 -0600 (CST) Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <65022.192.168.129.36.1228249805.squirrel@squirrelmail.vail> Message-ID: <65226.192.168.129.36.1228252167.squirrel@squirrelmail.vail> On Tue, December 2, 2008 2:40 pm, Joel Reymont wrote: > Rick, > > On Dec 2, 2008, at 8:30 PM, Rick Pettit wrote: > >> (e.g. how can a bank ATM allow >> me to withdraw funds if it cannot reach its peer node(s) at my bank to >> determine the availability of such funds?). > > In my scenario a bank ATM would have an internal Mnesia table with the > balance :-). The ATM would clearly be part of a cluster of ATM, > replicating their transactions and balances to all other ATMS in the > cluster. Supposing there were 2 ATM machines in my neighborhood, each with a table containing bank account balances, mine included. Now suppose the first ATM became disconnected from its cluster, which included the second ATM. Suppose I visit the first ATM and withdraw all the funds from my account. The first ATM records this in a transaction log but cannot replicate the transaction due to the network partition. So I make my way down the street to the second ATM, which also has a record of my balance _before_ I made the withdrawal at the first ATM. So I again withdraw all my funds. I am in this particular case quite happy, though I suspect my bank might not be when they work to mend the network partition. And no, they can't have their, er, my money back :-) >> Most systems I work with implement a recovery procedure similar to >> what >> Ulf has posted in the past on this list. > > Would you kindly post a link to that procedure in this thread, for > easier reference? No problem: http://www.erlang.org/pipermail/erlang-questions/2001-January/002484.html http://www.erlang.org/pipermail/erlang-questions/2006-February/019092.html http://www.erlang.org/pipermail/erlang-questions/2007-January/024716.html >> Because the systems I am referring to require high-availability over >> 100% >> data consistency, this is perfectly ok (and works quite well). With >> issues >> like telecom "glare" I couldn't be 100% accurate all the time anyway. > > What's telecom glare? A quick google search turned up the following: glare telecom definition The condition that arises when a telephone line or trunk is seized at both ends for different reasons, perhaps causing the collision between an incoming call and an outgoing call, for example. Glare is a phenomenon associated with loop start signaling used to support single-line telephones, multi-line telephones, and key telephone systems (KTSs).When the handset of the telephone is lifted, the electrical loop is completed and current flows across the circuit.The central office switch detects that fact and returns dial tone for an outgoing call, or connects an incoming call, as appropriate. If the user picks up the handset to place an outgoing call at the same time that the central office switch is attempting to connect an incoming call, a collision, or glare condition, occurs. See also ground start, loop, and loop start. === This affects my software in that there is the chance of sending a call out a trunk (during periods of peak call volume) which may actually be in use by the time the call lands there. The system has a means of detecting and handling this outside of any mnesia code (call retries, etc). >> So, to recover from a partition it is enough to pick any functioning >> node >> as the new "master" and have others restart and/or force load tables >> from >> it. The entire time clients keep pushing new stats into the system, so >> everything "converges on reality" in the end following a recovery >> attempt >> anyway. > > > I understand that Mnesia was designed for telco ops but I want to run > my social network on top of it. I did a search before and all the > solutions were along the lines of "I'm dealing with telco stuff or I > can just throw that data out". I don't have such luxury and don't want > to throw Mnesia out in favor of PostgreSQL until I absolutely have to. Agreed. This is a really tough problem to solve for sure. If I didn't have the luxury to potentially lose transactions my solution would not work. I'll continue to follow the thread and add anything I think might be useful if it comes to me. -Rick From joelr1@REDACTED Tue Dec 2 22:18:20 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 2 Dec 2008 21:18:20 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> Message-ID: <9ADEDD63-4132-40C8-A0A5-388E374F7823@gmail.com> On Dec 2, 2008, at 8:24 PM, David Mercer wrote: > How do you handle unsynched clocks on the two nodes? > ... > Isn't this what > databases use transaction logs for, and if so, can we learn anything > from > how they handle this situation? Anyone have that expertise? I think the only problem to solve here is that of keeping clocks in sync. If the clocks are in sync _and_ the Mnesia transaction log is timestamped, then you can auto-sync by applying transactions in order once the nodes rejoin. Right? -- http://twitter.com/wagerlabs From dmercer@REDACTED Tue Dec 2 22:30:36 2008 From: dmercer@REDACTED (David Mercer) Date: Tue, 2 Dec 2008 15:30:36 -0600 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> Message-ID: On Tuesday, December 02, 2008, Joel Reymont wrote: > On Dec 2, 2008, at 8:24 PM, David Mercer wrote: > > > How do you handle unsynched clocks on the two nodes? > > I don't know. Should they go out of sync during the split if the split > is short? Aren't clocks always out of synch? I thought it was impossible to perfectly synch clocks due to signal transmission times, at least over a standard network. Even if the clocks were precisely in-synch, same problem if the same transaction is received by the two nodes a microsecond apart: they'll have different timestamps. I wonder if adding some sort of GUID would solve the problem... Maybe a client-generated ID. Another thought is that two transactions can be received by different nodes in different order, resulting in different vnums for the same transactions on different nodes. Cheers, David. From martin.logan@REDACTED Tue Dec 2 21:54:48 2008 From: martin.logan@REDACTED (Martin Logan) Date: Tue, 02 Dec 2008 14:54:48 -0600 Subject: [erlang-questions] Use of application environment In-Reply-To: <6c2563b20811241927t208e2d2dy27e710b61e6ca897@mail.gmail.com> Message-ID: I have been doing the same for years, I find it works better. Though I try to keep calls to config fairly isolated choosing to pass config through as function args whenever possible. I wrapped config with another application called GAS ( http://erlware.org/lib/5.6.3/gas-6.1.1/) that I find works nicely in that I can set config at run time and have it reflected ultimately in my config file if I so choose. I have also added the ability to use config file overriding, though only one level deep. Chers, Martin On 11/24/08 9:27 PM, "Edwin Fine" wrote: > Hi all, > > Is it considered bad practice to use application environment variables (i.e. > application:get_env/2,3) in workers, as opposed to only passing config > information via the start()/init() calls? I am finding it tedious as I add > more configuration data to the sys.config file, to get_env() the data in a > supervisor and then parcel it out to the workers. Also, it becomes a pain to > change the values at runtime, whereas if I put a function like this in an > affected worker > > my_foo_val() -> > application:get_env(my_app, my_foo_val, ?SOME_SANE_DEFAULT). > > then runtime changes can be made immediately using set_env(), and it becomes > much easier to add new config data, but I feel uneasy, almost as if I'm using > global variables. From a load point of view, I only do this in places where > the value is not used at a high rate. > > What is the preferred or recommended (or even most common) practice? > > Regards, > Edwin Fine > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions If you are not the intended recipient of this e-mail message, please notify the sender and delete all copies immediately. The sender believes this message and any attachments were sent free of any virus, worm, Trojan horse, and other forms of malicious code. This message and its attachments could have been infected during transmission. The recipient opens any attachments at the recipient's own risk, and in so doing, the recipient accepts full responsibility for such actions and agrees to take protective and remedial action relating to any malicious code. Travelport is not liable for any loss or damage arising from this message or its attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcpherson@REDACTED Tue Dec 2 22:39:20 2008 From: mcpherson@REDACTED (Allen McPherson) Date: Tue, 2 Dec 2008 14:39:20 -0700 Subject: [erlang-questions] Any canonical bandwidth benchmarks for clusters? In-Reply-To: References: Message-ID: >> I'm testing some code that is showing terrible bandwidth >> on our 40+ node Infiniband cluster (7 MB/sec for a ring benchmark!). >> This code is using the IP over IB interface and send big (1+ MB) >> messages around (binaries and non-binaries). MPI code runs >> at good rates on this cluster. > > This is probably a really stupid question, but how are you measuring > the bandwidth? The ring benchmark is only going to measure the > bandwidth of one node to another node at any given time. What you may > want is a mesh network where each node receives a single message and > then passes that off to another random node. This way half the nodes > can be talking to the other half and your bandwidth should go through > the roof. > > It just seems that a ring benchmark is the wrong benchmark to use. But > I'm no Erlang guru. > > Timothy Thanks for the reply, Timothy. I measure the total time around the ring and total payload as the number of hops times the message size. So, this accounts for receive buffering and actually touching the message. It's synchronous but should show decent bandwidth (it's essentially point-to-point a bunch of times synchronously). In fact, a 2-node ring is a ping-pong benchmark. I also have some other benchmarks (all-pairs, all-to-all) that also perform slowly but aren't sufficiently clean to post. And you are correct, the ring is probably the least representative of the messaging patterns we use. It's just what I had laying around that was debugged and worked. It's possible that we have a system problem with the Erlang run-time interface to the OS that we don't know how to debug. We are pretty sure that the OS is doing the right thing with the IP over IB drivers and the IB NIC, but we really need to confirm that the right things are happening. -- Allen McPherson Los Alamos National Laboratory From florz@REDACTED Tue Dec 2 22:42:48 2008 From: florz@REDACTED (Florian Zumbiehl) Date: Tue, 2 Dec 2008 22:42:48 +0100 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <9ADEDD63-4132-40C8-A0A5-388E374F7823@gmail.com> References: <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <9ADEDD63-4132-40C8-A0A5-388E374F7823@gmail.com> Message-ID: <20081202214248.GB8711@florz.florz.dyndns.org> Hi, > I think the only problem to solve here is that of keeping clocks in > sync. What does that mean in this context? Florian From fhamilton@REDACTED Tue Dec 2 22:47:19 2008 From: fhamilton@REDACTED (Felix Hamilton) Date: Tue, 2 Dec 2008 13:47:19 -0800 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> Message-ID: I have used NTP (the Network Time Protocol) quite effectively to sync timestamps in widely distributed systems with a fairly high degree of accuracy. It may be that using an NTP server and clients to provide time syncing for Mnesia may be a valuable addition - NTP resolution can get quite high (read way more than you need) if you have redundant servers. Is there an NTP project for Erlang as yet? If not, that might be a project that would provide quite a few benefits to the community ... /Felix On Tue, Dec 2, 2008 at 1:30 PM, David Mercer wrote: > On Tuesday, December 02, 2008, Joel Reymont wrote: > >> On Dec 2, 2008, at 8:24 PM, David Mercer wrote: >> >> > How do you handle unsynched clocks on the two nodes? >> >> I don't know. Should they go out of sync during the split if the split >> is short? > > Aren't clocks always out of synch? I thought it was impossible to perfectly > synch clocks due to signal transmission times, at least over a standard > network. Even if the clocks were precisely in-synch, same problem if the > same transaction is received by the two nodes a microsecond apart: they'll > have different timestamps. I wonder if adding some sort of GUID would solve > the problem... Maybe a client-generated ID. > > Another thought is that two transactions can be received by different nodes > in different order, resulting in different vnums for the same transactions > on different nodes. > > Cheers, > > David. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From joelr1@REDACTED Tue Dec 2 22:52:27 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 2 Dec 2008 21:52:27 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> Message-ID: On Dec 2, 2008, at 9:47 PM, Felix Hamilton wrote: > Is there an NTP project for Erlang as yet? If not, that might be a > project that would provide quite a few benefits to the community ... I thought that so long as the system clock is in sync then the Erlang clock would be in sync. Isn't it a matter of running NTP side by side with Erlang? -- http://twitter.com/wagerlabs From joelr1@REDACTED Tue Dec 2 22:53:39 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 2 Dec 2008 21:53:39 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <20081202214248.GB8711@florz.florz.dyndns.org> References: <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <9ADEDD63-4132-40C8-A0A5-388E374F7823@gmail.com> <20081202214248.GB8711@florz.florz.dyndns.org> Message-ID: <18714E21-6E89-460B-9D9F-F5C47DEDA29D@gmail.com> On Dec 2, 2008, at 9:42 PM, Florian Zumbiehl wrote: > Hi, > >> I think the only problem to solve here is that of keeping clocks in >> sync. > > What does that mean in this context? I meant to say that if the clocks are synchronized and Mnesia transaction logs are timestamped, then it's possible to apply transactions in proper order on each node once the cluster rejoins. Is this a better explanation? -- http://twitter.com/wagerlabs From fhamilton@REDACTED Tue Dec 2 22:56:25 2008 From: fhamilton@REDACTED (Felix Hamilton) Date: Tue, 2 Dec 2008 13:56:25 -0800 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> Message-ID: Certainly that is what i have done previously. But in this context it might make sense to implement a NTP server / client within Erlang so as to minimize interaction with the host node operating system. As soon as your deployed application starts requiring operating system customization it becomes significantly more painful. It would nice to be able to use NTP with an Erlang app without having to deal with anything at the OS level. And my suspicion is that Erlang may be quite suited for a robust distributed NTP implementation in any case ... /Felix On Tue, Dec 2, 2008 at 1:52 PM, Joel Reymont wrote: > > On Dec 2, 2008, at 9:47 PM, Felix Hamilton wrote: > >> Is there an NTP project for Erlang as yet? If not, that might be a >> project that would provide quite a few benefits to the community ... > > > I thought that so long as the system clock is in sync then the Erlang clock > would be in sync. Isn't it a matter of running NTP side by side with Erlang? > > -- > http://twitter.com/wagerlabs > > > > > From joelr1@REDACTED Tue Dec 2 22:59:20 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 2 Dec 2008 21:59:20 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> Message-ID: <72B4310E-5558-440E-A772-332EC2858FCE@gmail.com> On Dec 2, 2008, at 9:56 PM, Felix Hamilton wrote: > It would nice to > be able to use NTP with an Erlang app without having to deal with > anything at the OS level. I don't understand. My Mac runs the NTP demon just fine, keeping my clock synchronized with europe.apple.com or something like that. I don't see the benefit of implementing NTP in Erlang since the two are completely orthogonal. Am I missing something? -- http://twitter.com/wagerlabs From mihai@REDACTED Tue Dec 2 23:13:24 2008 From: mihai@REDACTED (Mihai Balea) Date: Tue, 2 Dec 2008 17:13:24 -0500 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> Message-ID: <3D5FA870-AAC8-41AE-AC7A-AF9EDA084FED@hates.ms> On Dec 2, 2008, at 3:24 PM, David Mercer wrote: > How do you handle unsynched clocks on the two nodes? > > How about two different transactions that occur at the same time on > the two > nodes right after the split? > > And if an account with balance x before the split on one node has a > balance > of x + d1 after a deposit, while the other node has balance x + d2 > after > another deposit, all you have during the merge is the balances x + > d1 and x > + d2, and no way to identify d1 and d2 without knowing x. Isn't > this what > databases use transaction logs for, and if so, can we learn anything > from > how they handle this situation? Anyone have that expertise? How about Vector Clocks (http://en.wikipedia.org/wiki/Vector_clocks)? Mihai From fhamilton@REDACTED Tue Dec 2 23:22:12 2008 From: fhamilton@REDACTED (Felix Hamilton) Date: Tue, 2 Dec 2008 14:22:12 -0800 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <72B4310E-5558-440E-A772-332EC2858FCE@gmail.com> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> <72B4310E-5558-440E-A772-332EC2858FCE@gmail.com> Message-ID: Well, it depends. If you have complete control over the OS used by each node in your distributed system and can insure that they are all using the same NTP hosts and have sync, sure, relying on an existing NTP daemon and using the system time to generate your timestamps works fine. Basically as accurate as you need it to be. If not, and timestamp accuracy is important, you want to make sure that you keep an 'internal' application clock that is separate from (though of course related to) the OS clock on each of your nodes. Otherwise, you rely on the folks that have OS level control of your nodes to a) have an NTP daemon running and properly configured, b) not make manual changes to their system time that override NTP sync, and c) maintain their NTP config correctly. I have found that these tend to be unwarranted assumptions. ;-) An Erlang NTP implementation might be one way to maintain an internal application clock on a widely distributed system of nodes that avoids reliance on system time. This is the first time i have considered the prospect of embedding an NTP implementation in an Erlang application, however, so take it for what its worth. I will say that maintaining NTP on large distributed systems can be quite a pain even when you control things at the OS level. Vector Clocks do look interesting tho, but it is not clear that partial ordering would be enough in some cases. /Felix On Tue, Dec 2, 2008 at 1:59 PM, Joel Reymont wrote: > > On Dec 2, 2008, at 9:56 PM, Felix Hamilton wrote: > >> It would nice to >> be able to use NTP with an Erlang app without having to deal with >> anything at the OS level. > > > I don't understand. My Mac runs the NTP demon just fine, keeping my clock > synchronized with europe.apple.com or something like that. > > I don't see the benefit of implementing NTP in Erlang since the two are > completely orthogonal. Am I missing something? > > -- > http://twitter.com/wagerlabs > > > > > From rvirding@REDACTED Tue Dec 2 23:26:51 2008 From: rvirding@REDACTED (Robert Virding) Date: Tue, 2 Dec 2008 23:26:51 +0100 Subject: [erlang-questions] [erlang-quiestions] Documentation bug or not? In-Reply-To: References: Message-ID: <3dbc6d1c0812021426o65fa64fcwbe6559bbdbfdcdd3@mail.gmail.com> Hi, IIRC it is because 'local' uses register, which can only take an atom for a name, while 'global' uses the global registration module global which can take any term for a name. Robert 2008/12/1 Maxim Treskin > Hello > > I found strange descriptions in man-files for gen_server and gen_fsm > (possible in some other manuals). > > ---- > start_link(Module, Args, Options) -> Result > start_link(FsmName, Module, Args, Options) -> Result > > Types FsmName = {local, Name} | {global, GlobalName} > Name = atom() > GlobalName = term() > ---- > > Name and GlobalName have different types: atom() and term(). > Is it right? Can I use any possible erlang term as name identifier? > > > -- > Maxim Treskin > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang-questions_efine@REDACTED Tue Dec 2 23:29:19 2008 From: erlang-questions_efine@REDACTED (Edwin Fine) Date: Tue, 2 Dec 2008 17:29:19 -0500 Subject: [erlang-questions] Use of application environment In-Reply-To: References: <6c2563b20811241927t208e2d2dy27e710b61e6ca897@mail.gmail.com> Message-ID: <6c2563b20812021429x69742d42p86be22f3456e9322@mail.gmail.com> To everyone that responded this time round, thanks SO MUCH for your input. It all made sense. Contradictions in approaches that I saw only reflect different design decisions and tradeoffs; all approaches are valid. The approach I am thinking of is a bit ambitious, or maybe a bad idea, but here goes the background. In operating systems like Linux and Solaris, and certainly at one point this was true, there are parameters that can be changed dynamically, and those which require a restart of the operating system. In the early days, many parameter changes required a kernel recompile, although I imagine there are much fewer of those today. I am old enough to remember vaguely the joys (not) of VAX/VMS AUTOGEN and SYSGEN. Moving on to something like WebLogic, it has parameters that you can change via its admin server. Some parameter changes are reflected immediately in the run-time environemnt, others require a restart of the application server. It is reasonable to say, therefore, that there are two main categories of parameters: static and dynamic. Changes to static parameters will often require some thing(s) in the application tree to be killed so they can reload their state (and hence get the changed parameters). Alternatively, I suppose one could use the OTP facilities to do a code_change, but I have zero knowledge or experience of this, so I won't comment further, other than to say that my understanding of this is that some Erlang/OTP users prefer to just restart the application (if their circumstances/SLA allow it) and avoid the reported complexities. My concern is with dynamic parameters. Static parameters can be changed in the config file, either via something like Erlware's GAS application or using a trusty editor. As for dynamic parameters, I am not a fan of polling for changes. I prefer event-driven approaches. My approach for this is as follows: - Have a config server that loads all parameters from the application environment (so far, like GAS); - All workers that wish to be notified of config changes subscribe to a set of events with the registered config server (observer pattern). It's possible and probably desirable that the config server could monitor subscribing processes and remove them from the subscription list if they exit. - These workers implement handle_info clauses that detect an incoming event, say, {config_event, {evt_change, proplist()}}. - Dynamic changes are made by using the interface to the config server (or maybe changing the sys.config file - see later for discussion). Whenever something changes, the config server sends to the appropriate subscribers messages that contain subscriber-specific changes. - When a subscriber gets the message, it changes its configuration (e.g. its #state{} record) if needed and takes appropriate actions in response to the changed value(s). - The config server could have an API call to persist the configuration back to the original config file. There are challenges inherent in such a design. - *What happens if the config server crashes?* All the dynamic changes are lost, as is knowledge of the processes which had earlier subscribed. - One possibility could be to persist the config server's state, and when reloading it check to see if there's a crash state, load the latest application environment settings, and merge the crash state into that. Thereafter one could check to see if the processes are still alive and remove them from the subscription list. This seems very messy and error prone. - Another possibility could be to link to (rather than monitor) the subscribing processes. If the config server goes down, the subscribers will receive an EXIT signal and can then periodically try to resubscribe. This unfortunately means that all subscribers have to handle that EXIT signal. - *When changes are made to a config value using the API of the config server, how does one ensure that the new value has the correct data structure?* For example, if the value was originally stored in the config file as an integer(), and someone changes the value via the API to a list, this may crash a server. - This suggests that the config server has to know the type of data stored. How does it do that? I suppose it could test that the new value coming in is the same type as the existing one. But my (limited) understanding of Erlang is that there's no way to write T = type_of(Var), only a set of tests, such as is_integer(), is_list() , and so on, which is cumbersome to use to test types. But it could be done for simple types. And if the type is a complex (i.e. composite one), such as a list of terms, how does one ensure that the structure is not wrongly changed? Now one has to write some sort of schema definition language and schema validator. Unless there is an easier way? I suppose one could ban any non-simple configuration values, but that's not acceptable. - One could mandate that changes are only allowed to the standard Erlang config file, which the config server picks up (as in GAS). This, however, does not guarantee that the Erlang config file is even syntactically correct, let alone that the values therein have the correct representation. - Which brings me to this: *Has anyone ever written an Erlang config file validator* (other than Erlang itself, I mean)? I would really like something that allows me to validate a config file - both syntactically and schema - before putting it in place. The errors that occur due to a syntactically incorrect config file are often hard to find (for me, anyway). Again, to do this correctly implies the need for a config file schema language and a schema validator. That was longer than I expected. If you made it this far, you are either very interested, very bored, or very determined :) Any thoughts on this matter? Who knows, maybe someone has already done this (unsure if GAS does all this) and it's on some Open Source repository somewhere. I did search, but I might have missed it. Regards, Edwin Fine > > On 11/24/08 9:27 PM, "Edwin Fine" wrote: > > Hi all, > > Is it considered bad practice to use application environment variables > (i.e. application:get_env/2,3) in workers, as opposed to only passing config > information via the start()/init() calls? I am finding it tedious as I add > more configuration data to the sys.config file, to get_env() the data in a > supervisor and then parcel it out to the workers. Also, it becomes a pain to > change the values at runtime, whereas if I put a function like this in an > affected worker > > my_foo_val() -> > application:get_env(my_app, my_foo_val, ?SOME_SANE_DEFAULT). > > then runtime changes can be made immediately using set_env(), and it > becomes much easier to add new config data, but I feel uneasy, almost as if > I'm using global variables. From a load point of view, I only do this in > places where the value is not used at a high rate. > > What is the preferred or recommended (or even most common) practice? > > Regards, > Edwin Fine > > ------------------------------ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From masse@REDACTED Tue Dec 2 23:33:26 2008 From: masse@REDACTED (mats cronqvist) Date: Tue, 02 Dec 2008 23:33:26 +0100 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: (Felix Hamilton's message of "Tue\, 2 Dec 2008 13\:47\:19 -0800") References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> Message-ID: <87skp69phl.fsf@sterlett.hq.kred> "Felix Hamilton" writes: > I have used NTP (the Network Time Protocol) quite effectively to sync > timestamps in widely distributed systems with a fairly high degree of > accuracy. i personally would not bet a dirty sock on ordering events by time stamps (in a distributed system). and for once Leslie Lamport seems to agreewith me. http://en.wikipedia.org/wiki/Lamport_timestamps From fhamilton@REDACTED Tue Dec 2 23:49:25 2008 From: fhamilton@REDACTED (Felix Hamilton) Date: Tue, 2 Dec 2008 14:49:25 -0800 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <87skp69phl.fsf@sterlett.hq.kred> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> <87skp69phl.fsf@sterlett.hq.kred> Message-ID: Actually in the distributed system to which I am referring we used a combination of 'real' time based on NTP and a type of logical operation ordering, then discarded and demanded repetition of those operations which we could not reconcile based on our two ordering systems. And this was a very large scale distributed archival system with *no* margin for commit errors. So in some sense it depends on what you are doing. But I suggest that having some type of relatively consistent 'real' time is still useful. /Felix On Tue, Dec 2, 2008 at 2:33 PM, mats cronqvist wrote: > "Felix Hamilton" writes: > >> I have used NTP (the Network Time Protocol) quite effectively to sync >> timestamps in widely distributed systems with a fairly high degree of >> accuracy. > > i personally would not bet a dirty sock on ordering events by time > stamps (in a distributed system). and for once Leslie Lamport seems > to agreewith me. > > http://en.wikipedia.org/wiki/Lamport_timestamps > From joelr1@REDACTED Tue Dec 2 23:53:50 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 2 Dec 2008 22:53:50 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <87skp69phl.fsf@sterlett.hq.kred> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> <87skp69phl.fsf@sterlett.hq.kred> Message-ID: <885B1351-C915-4540-B868-221F6FF92CA9@gmail.com> On Dec 2, 2008, at 10:33 PM, mats cronqvist wrote: > i personally would not bet a dirty sock on ordering events by time > stamps (in a distributed system). and for once Leslie Lamport seems > to agreewith me. > > http://en.wikipedia.org/wiki/Lamport_timestamps Would implementing vector clocks or lamport timestamps for Mnesia solve the problem of ordering events? Has anyone attempted this previously? -- http://twitter.com/wagerlabs From ok@REDACTED Wed Dec 3 01:09:50 2008 From: ok@REDACTED (Richard O'Keefe) Date: Wed, 3 Dec 2008 13:09:50 +1300 Subject: [erlang-questions] PDCAT '08 In-Reply-To: <8d1798e90812020336v1bc6a261x619593f692154e06@mail.gmail.com> References: <6c2563b20811241927t208e2d2dy27e710b61e6ca897@mail.gmail.com> <492BA39D.7070107@erlang-consulting.com> <492BCC01.60805@erlang-consulting.com> <6c2563b20812012011l1617b3afnfa35f2afd8181f06@mail.gmail.com> <8d1798e90812020336v1bc6a261x619593f692154e06@mail.gmail.com> Message-ID: <67672AF9-4F0A-445B-AE16-F3EA4313F31A@cs.otago.ac.nz> So here I am at PDCAT '08 (the ninth International Conference on Parallel and Distributed Computing, Applications and Technologies) wondering where the papers on Erlang are. Next year, PDCAT '09 is in Hiroshima. Let's get some Erlang papers in there. For example, the guy who runs the Blue Gene centre at ANL gave a keynote speech. He didn't know much about Erlang, and certainly didn't know about the "matlab in Erlang" thingy. Come to think of it, let's get some Erlang users at this conference. In the formal methods session, the entire audience was me. From abhay@REDACTED Wed Dec 3 02:24:02 2008 From: abhay@REDACTED (Abhay Kumar) Date: Tue, 2 Dec 2008 17:24:02 -0800 Subject: [erlang-questions] Erlang/OTP, eunit and the LGPL Message-ID: <882453cd0812021724p79cb7f07td41fa3afca4fbd71@mail.gmail.com> I wish I paid a little more attention to the erlang-announce or I would have probably raised this alarm earlier. I was wondering if it would be possible to bundle eunit into the otp set of libraries under the terms of a secondary less ambiguous license. Unfortunately for me and many other entrenched coders, lawyers don't seem to have a clear understanding of the language of the license and therefore categorize it with other GPL licenses when determining policy. This is definitely the case at Microsoft, my employer, and I know is also a common policy in other large companies. Because of this, LGPL code either gets quarantined or never used in such environments. By bundling eunit in the OTP set of libraries, we open a door for ambiguity and start restricting the adoption of Erlang in some larger companies. The easiest option that I see would be if the ProcessOne folks decided to grant the Erlang community use of the library under the EPL or other comparable license, either by dual licensing it or just changing the license terms. Until then, Folks in my position are unable to upgrade erlang past R12B-4. I don't intend this message to start a philosophical war over licenses. I just am pointing out the practical implications that this change has for me and possibly for others in similar situations. (Don't take Erlang away from me! Heh.) - Abhay P.S. I'm not a lawyer. -- Abhay Kumar http://opensynapse.net/ This email address is: [ ] public [x] ask first [ ] private From zerthurd@REDACTED Wed Dec 3 05:07:40 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Wed, 3 Dec 2008 10:07:40 +0600 Subject: [erlang-questions] [erlang-quiestions] Documentation bug or not? In-Reply-To: <3dbc6d1c0812021426o65fa64fcwbe6559bbdbfdcdd3@mail.gmail.com> References: <3dbc6d1c0812021426o65fa64fcwbe6559bbdbfdcdd3@mail.gmail.com> Message-ID: > > >> Name and GlobalName have different types: atom() and term(). >> Is it right? Can I use any possible erlang term as name identifier? >> >> Thank you for clarification -- Maxim Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From saleyn@REDACTED Wed Dec 3 05:08:24 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Tue, 02 Dec 2008 23:08:24 -0500 Subject: [erlang-questions] Use of application environment In-Reply-To: <6c2563b20812021429x69742d42p86be22f3456e9322@mail.gmail.com> References: <6c2563b20811241927t208e2d2dy27e710b61e6ca897@mail.gmail.com> <6c2563b20812021429x69742d42p86be22f3456e9322@mail.gmail.com> Message-ID: <49360638.2000108@gmail.com> Note that there's already a config_change callback in the OTP application behavior that can be used as a notification mechanism. This post illustrates a way to reload the application's configuration and trigger the config_change callback so that the application can perform dynamic reconfiguration without restarting: http://www.erlang.org/pipermail/erlang-questions/2006-July/021543.html This is a simplistic approach that doesn't involve configuration validation. Actually this was a part of a configuration management framework that we developed at my former employer that included a configuration server that maintained the versioned configuration repository that also performed syntax verification based on the application's metadata deployed with each app that included all needed parameters for each environment type (e.g. prod/dev/qa/etc), parameter types, defaults, update actions (such as reload environment, restart application, restart node, etc.), parameter documentation. The server would perform configuration validation based on this metadata and reject unconformable input. Each node would run a configuration client that upon startup would query the configuration server and rebuild the local configuration file if there were any parameter changes. It would then use that configuration file in starting a release. Regards, Serge Edwin Fine wrote: > To everyone that responded this time round, thanks SO MUCH for your input. > It all made sense. Contradictions in approaches that I saw only reflect > different design decisions and tradeoffs; all approaches are valid. > > The approach I am thinking of is a bit ambitious, or maybe a bad idea, but > here goes the background. > > In operating systems like Linux and Solaris, and certainly at one point this > was true, there are parameters that can be changed dynamically, and those > which require a restart of the operating system. In the early days, many > parameter changes required a kernel recompile, although I imagine there are > much fewer of those today. I am old enough to remember vaguely the joys > (not) of VAX/VMS AUTOGEN and SYSGEN. > > Moving on to something like WebLogic, it has parameters that you can change > via its admin server. Some parameter changes are reflected immediately in > the run-time environemnt, others require a restart of the application > server. > > It is reasonable to say, therefore, that there are two main categories of > parameters: static and dynamic. Changes to static parameters will often > require some thing(s) in the application tree to be killed so they can > reload their state (and hence get the changed parameters). Alternatively, I > suppose one could use the OTP facilities to do a code_change, but I have > zero knowledge or experience of this, so I won't comment further, other than > to say that my understanding of this is that some Erlang/OTP users prefer to > just restart the application (if their circumstances/SLA allow it) and avoid > the reported complexities. > > My concern is with dynamic parameters. Static parameters can be changed in > the config file, either via something like Erlware's GAS application or > using a trusty editor. > > As for dynamic parameters, I am not a fan of polling for changes. I prefer > event-driven approaches. My approach for this is as follows: > > - Have a config server that loads all parameters from the application > environment (so far, like GAS); > - All workers that wish to be notified of config changes subscribe to a > set of events with the registered config server (observer pattern). It's > possible and probably desirable that the config server could monitor > subscribing processes and remove them from the subscription list if they > exit. > - These workers implement handle_info clauses that detect an incoming > event, say, {config_event, {evt_change, proplist()}}. > - Dynamic changes are made by using the interface to the config server > (or maybe changing the sys.config file - see later for discussion). Whenever > something changes, the config server sends to the appropriate subscribers > messages that contain subscriber-specific changes. > - When a subscriber gets the message, it changes its configuration (e.g. > its #state{} record) if needed and takes appropriate actions in response to > the changed value(s). > - The config server could have an API call to persist the configuration > back to the original config file. > > There are challenges inherent in such a design. > > - *What happens if the config server crashes?* All the dynamic changes > are lost, as is knowledge of the processes which had earlier subscribed. > - One possibility could be to persist the config server's state, and > when reloading it check to see if there's a crash state, load the latest > application environment settings, and merge the crash state into that. > Thereafter one could check to see if the processes are still alive and > remove them from the subscription list. This seems very messy and error > prone. > - Another possibility could be to link to (rather than monitor) the > subscribing processes. If the config server goes down, the > subscribers will > receive an EXIT signal and can then periodically try to resubscribe. This > unfortunately means that all subscribers have to handle that EXIT signal. > - *When changes are made to a config value using the API of the config > server, how does one ensure that the new value has the correct data > structure?* For example, if the value was originally stored in the config > file as an integer(), and someone changes the value via the API to a list, > this may crash a server. > - This suggests that the config server has to know the type of data > stored. How does it do that? I suppose it could test that the new value > coming in is the same type as the existing one. But my (limited) > understanding of Erlang is that there's no way to write T = type_of(Var), > only a set of tests, such as is_integer(), is_list() , and so > on, which is > cumbersome to use to test types. But it could be done for simple > types. And > if the type is a complex (i.e. composite one), such as a list of > terms, how > does one ensure that the structure is not wrongly changed? Now one has to > write some sort of schema definition language and schema > validator. Unless > there is an easier way? I suppose one could ban any non-simple > configuration > values, but that's not acceptable. > - One could mandate that changes are only allowed to the standard > Erlang config file, which the config server picks up (as in GAS). This, > however, does not guarantee that the Erlang config file is even > syntactically correct, let alone that the values therein have the correct > representation. > - Which brings me to this: *Has anyone ever written an Erlang config > file validator* (other than Erlang itself, I mean)? I would really > like something that allows me to validate a config file - both > syntactically > and schema - before putting it in place. The errors that occur due to a > syntactically incorrect config file are often hard to find (for > me, anyway). > Again, to do this correctly implies the need for a config file schema > language and a schema validator. > > That was longer than I expected. If you made it this far, you are either > very interested, very bored, or very determined :) > > Any thoughts on this matter? Who knows, maybe someone has already done this > (unsure if GAS does all this) and it's on some Open Source repository > somewhere. I did search, but I might have missed it. > > Regards, > Edwin Fine > > >> On 11/24/08 9:27 PM, "Edwin Fine" wrote: >> >> Hi all, >> >> Is it considered bad practice to use application environment variables >> (i.e. application:get_env/2,3) in workers, as opposed to only passing config >> information via the start()/init() calls? I am finding it tedious as I add >> more configuration data to the sys.config file, to get_env() the data in a >> supervisor and then parcel it out to the workers. Also, it becomes a pain to >> change the values at runtime, whereas if I put a function like this in an >> affected worker >> >> my_foo_val() -> >> application:get_env(my_app, my_foo_val, ?SOME_SANE_DEFAULT). >> >> then runtime changes can be made immediately using set_env(), and it >> becomes much easier to add new config data, but I feel uneasy, almost as if >> I'm using global variables. From a load point of view, I only do this in >> places where the value is not used at a high rate. >> >> What is the preferred or recommended (or even most common) practice? >> >> Regards, >> Edwin Fine >> >> ------------------------------ >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From erlang-questions_efine@REDACTED Wed Dec 3 05:29:41 2008 From: erlang-questions_efine@REDACTED (Edwin Fine) Date: Tue, 2 Dec 2008 23:29:41 -0500 Subject: [erlang-questions] Use of application environment In-Reply-To: <49360638.2000108@gmail.com> References: <6c2563b20811241927t208e2d2dy27e710b61e6ca897@mail.gmail.com> <6c2563b20812021429x69742d42p86be22f3456e9322@mail.gmail.com> <49360638.2000108@gmail.com> Message-ID: <6c2563b20812022029o1f20f729yde55b4d4a755cb23@mail.gmail.com> Serge, Thanks for your reply. On Tue, Dec 2, 2008 at 11:08 PM, Serge Aleynikov wrote: > Note that there's already a config_change callback in the OTP application > behavior that can be used as a notification mechanism. > > This post illustrates a way to reload the application's configuration and > trigger the config_change callback so that the application can perform > dynamic reconfiguration without restarting: > > http://www.erlang.org/pipermail/erlang-questions/2006-July/021543.html > That's very interesting. I had seen config_change before while looking for something else in the application module, but I seem to develop a kind of "tunnel vision" that focuses on what I need to know right NOW and skips over other details, so I hadn't paid it much attention and frankly forgot about it until now. There's SO much to remember in Erlang (and any major environment like it). Something that would have put me off track is the documentation that states "This function is called by an application after a code replacement, if there are any changes to the configuration parameters." I would have thought a code replacement was necessary, so your insight is very welcome. I assume, reading the code you linked to, that one still needs to include in the config_change callback something to propagate the changes to the various workers and supervisors. Do you think that the subscribe/notify mechanism I described is workable? > This is a simplistic approach that doesn't involve configuration > validation. Actually this was a part of a configuration management > framework that we developed at my former employer that included a > configuration server that maintained the versioned configuration repository > that also performed syntax verification based on the application's metadata > deployed with each app that included all needed parameters for each > environment type (e.g. prod/dev/qa/etc), parameter types, defaults, update > actions (such as reload environment, restart application, restart node, > etc.), parameter documentation. The server would perform configuration > validation based on this metadata and reject unconformable input. Each node > would run a configuration client that upon startup would query the > configuration server and rebuild the local configuration file if there were > any parameter changes. It would then use that configuration file in > starting a release. That's pretty sophisticated and along the lines of what I had envisioned. It's a pity I don't have the time to write something like that. Your former employer was evidently unlucky to lose you :) Do you by any chance remember if the metadata was able to describe complex terms involving nested lists and tuples? Also, do you know of something like type_of(Term) (besides is_integer/1 and the others) available somewhere in Erlang? > Regards, > > Serge > -------------- next part -------------- An HTML attachment was scrubbed... URL: From saleyn@REDACTED Wed Dec 3 04:02:30 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Tue, 02 Dec 2008 22:02:30 -0500 Subject: [erlang-questions] Any canonical bandwidth benchmarks for clusters? In-Reply-To: References: Message-ID: <4935F6C6.8090703@gmail.com> First of all you would always expect IP over IB to be significantly slower than the MPI/IB interface, because the later uses RDMA and bypasses the OS's TCP/IP stack. I my experience with IP/IB, sending large messages degrades throughput quite noticeably. Try to split messages in smaller chunks and redo the benchmark for different message sizes. Serge Allen McPherson wrote: > I'm testing some code that is showing terrible bandwidth > on our 40+ node Infiniband cluster (7 MB/sec for a ring benchmark!). > This code is using the IP over IB interface and send big (1+ MB) > messages around (binaries and non-binaries). MPI code runs > at good rates on this cluster. > > Before I post my code I thought I'd see if there were > existing bandwidth benchmarks for distributed Erlang > on a locally connected cluster. Haven't been able to > find any via Google. Does anyone know of, or have, code > that I might use to test. > > Lacking other tests I'll put together a longer post with > my code included and maybe someone else with a similar > cluster could run it? > > Thanks > -- > Allen McPherson > Los Alamos National Laboratory > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From holger@REDACTED Wed Dec 3 06:53:17 2008 From: holger@REDACTED (=?ISO-8859-1?Q?Holger_Hoffst=E4tte?=) Date: Wed, 03 Dec 2008 06:53:17 +0100 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <885B1351-C915-4540-B868-221F6FF92CA9@gmail.com> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> <87skp69phl.fsf@sterlett.hq.kred> <885B1351-C915-4540-B868-221F6FF92CA9@gmail.com> Message-ID: <49361ECC.9080706@wizards.de> Joel Reymont wrote: > On Dec 2, 2008, at 10:33 PM, mats cronqvist wrote: > >> i personally would not bet a dirty sock on ordering events by time >> stamps (in a distributed system). and for once Leslie Lamport seems >> to agreewith me. >> >> http://en.wikipedia.org/wiki/Lamport_timestamps +1 Reliance on physical clocks is long known to be at best unreliable. HW clock skew and DST (daylight saving time) back/forward warp does the rest. > Would implementing vector clocks or lamport timestamps for Mnesia > solve the problem of ordering events? > > Has anyone attempted this previously? http://code.google.com/p/distributerl/ -h From xbmodder@REDACTED Wed Dec 3 11:15:13 2008 From: xbmodder@REDACTED (Sargun Dhillon) Date: Wed, 3 Dec 2008 02:15:13 -0800 Subject: [erlang-questions] Jason In-Reply-To: <3dbc6d1c0811231115y565a6670p173226976c5dd150@mail.gmail.com> References: <3dbc6d1c0811231115y565a6670p173226976c5dd150@mail.gmail.com> Message-ID: <7c9d57ea0812030215t4967da39p7b13e71482dde952@mail.gmail.com> What are the chances it won't be accepted? Enrico, you're still going to work on the project correct? Additionally, do you have a working repository? 2008/11/23 Robert Virding : > I can assure you that no one will complain if you implement the EEP. :-) > > You are aware, however, that the EEP is still just a suWggestion and may not > be accepted in the form it is now? It might even never be accepted, although > I think it unlikely that some JSON EEP is not accepted. > > Robert > > 2008/11/23 Enrico Thierbach >> >> Hi everyone, >> >> as CouchDb needs a more performant JSON implementation I volunteered >> for implementing EEP 0018 (http://www.erlang.org/eeps/eep-0018.html) >> during the next few weeks. >> >> That is, unless someone else is already on that task, that is :) >> >> /eno >> >> -- >> ==================================================================== >> A wee piece of ruby every monday: http://1rad.wordpress.com/ >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From kenneth.lundin@REDACTED Wed Dec 3 13:39:08 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Wed, 3 Dec 2008 13:39:08 +0100 Subject: [erlang-questions] Erlang/OTP, eunit and the LGPL In-Reply-To: <882453cd0812021724p79cb7f07td41fa3afca4fbd71@mail.gmail.com> References: <882453cd0812021724p79cb7f07td41fa3afca4fbd71@mail.gmail.com> Message-ID: > > The easiest option that I see would be if the ProcessOne folks decided > to grant the Erlang community use of the library under the EPL or > other comparable license, either by dual licensing it or just changing > the license terms. Until then, Folks in my position are unable to > upgrade erlang past R12B-4. I don't intend this message to start a > philosophical war over licenses. I just am pointing out the practical > implications that this change has for me and possibly for others in > similar situations. (Don't take Erlang away from me! Heh.) > We will try and most probably succeed to change the license for eunit to EPL, but I don't really understand how the LGPL on Eunit could be be a problem for using the rest of Erlang/OTP? /Kenneth Erlang/OTP Ericsson > - Abhay > > P.S. I'm not a lawyer. > > -- > Abhay Kumar > http://opensynapse.net/ > > This email address is: [ ] public [x] ask first [ ] private > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From saleyn@REDACTED Wed Dec 3 14:01:17 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Wed, 03 Dec 2008 08:01:17 -0500 Subject: [erlang-questions] Use of application environment In-Reply-To: <6c2563b20812022029o1f20f729yde55b4d4a755cb23@mail.gmail.com> References: <6c2563b20811241927t208e2d2dy27e710b61e6ca897@mail.gmail.com> <6c2563b20812021429x69742d42p86be22f3456e9322@mail.gmail.com> <49360638.2000108@gmail.com> <6c2563b20812022029o1f20f729yde55b4d4a755cb23@mail.gmail.com> Message-ID: <4936831D.4000207@gmail.com> Edwin Fine wrote: > I assume, reading the code you linked to, that one still needs to include in > the config_change callback something to propagate the changes to the various > workers and supervisors. Do you think that the subscribe/notify mechanism I > described is workable? Frankly, I think this is a bit over-engineered, as you'd need to deal with re-subscription in every worker. Since the config_change event gives you a reactivity callback to configuration changes, the rest that you need is a "standard" way to expose configuration change requests in every worker. One other approach would be to implement the following two functions in each worker process: options() -> [Param::atom()]. reconfig(AddedOptions, ChangedOptions, DeletedOptions) -> Result Result = ok | {error, Reason} AddedOptions = ChangedOptions = DeletedOptions = [{Param::atom(), Value}] or perhaps, just: options() -> [Param::atom()]. reconfig(Options) -> ok | {error, Reason} Options = [{Param::atom(), Value}] Then the application's config_change/3 callback would just go through the list of modules in the app and do: Options = ..., Modules = ..., lists:foreach(fun(M) -> Opts = [O || O <- Options, lists:member(O, M:options())], M:reconfig(Opts) end, Modules). > >> This is a simplistic approach that doesn't involve configuration >> validation. Actually this was a part of a configuration management >> framework that we developed at my former employer that included a >> configuration server that maintained the versioned configuration repository >> that also performed syntax verification based on the application's metadata >> deployed with each app that included all needed parameters for each >> environment type (e.g. prod/dev/qa/etc), parameter types, defaults, update >> actions (such as reload environment, restart application, restart node, >> etc.), parameter documentation. The server would perform configuration >> validation based on this metadata and reject unconformable input. Each node >> would run a configuration client that upon startup would query the >> configuration server and rebuild the local configuration file if there were >> any parameter changes. It would then use that configuration file in >> starting a release. > > That's pretty sophisticated and along the lines of what I had envisioned. > It's a pity I don't have the time to write something like that. Your former > employer was evidently unlucky to lose you :) Given the need to support a family of three kids and the state of telecom at a time the switch to financial industry was quite indispensable... ;-) > Do you by any chance remember if the metadata was able to describe complex > terms involving nested lists and tuples? Also, do you know of something like > type_of(Term) (besides is_integer/1 and the others) available somewhere in > Erlang? Yes, the meta parameter info was in the form: %%% @type param_spec() = ParamSpec %%% ParamSpec = {Param,Desc,TypeSpec,Default,Required,Restart} %%% Param = atom() %%% Desc = string() %%% TypeSpec = expected_type() %%% Default = term() %%% Required = true | false %%% Restart = reload | application | restart | reboot And specification language for expected_type() was something like (incomplete): %%% @type expected_type() = ExpectedType %%% ExpectedType = atom | {value, ValidItems::list()} | %%% tuple | boolean |string |ip_address |ip_port |ip_tuple | %%% integer | {integer, Min::integer(), Max::integer()} | %%% float | {float, Min::float(), Max::float()} | %%% list | {list, ValidItems::list()} | {list_of, Type} | %%% {func, FunStr::string()} | %%% {func, TypeDescBin::binary(), FunStr::string()} %%% Type = integer | float | atom | list | tuple | ip_address | %%% ip_port | number | string | ValidItems | node | %%% TupleType %%% TupleType = { ExpectedType } %%% Fun = (Opt, Value) -> ok | %%% throw({error, {bad_config, {Key, Val}, Reason}}) %%% ValidItems = list() So an example of meta parameter definition would be: [{param1, <<"Docs for param1">>, {integer, 0, 100}, 0, true, reload}, {param2, <<"Docs for param2">> , string, "", true, reload}, {param3, <<"Docs for param3">> , {list, [one,two,three]}, [one], true, reload}, {param4, <<"Name/Val List">>, {list_of, [{{value, [one]}, string}, {{value, [two]}, integer}]}, [], true, reload}], Note that the param3 can take a value of 'one', 'two' or 'three'. And the param4 can take a list of name/value pairs, such as: [{one, "example"}, {two, 2}] Regards, Serge From ahmed.nawras@REDACTED Wed Dec 3 14:41:20 2008 From: ahmed.nawras@REDACTED (Ahmed Ali) Date: Wed, 3 Dec 2008 17:41:20 +0400 Subject: [erlang-questions] Restricting number of executions per second Message-ID: Hi All, I want to run a function in not more than a specific numbers of times per second (e.g. 3 times per second). The function is part of a gen_server process (i.e. called using gen_server:call/2). What's the best way to do this? The funny thing is that the first idea I got for a solution is locking n semaphores to serialize the execution. I guess I'm still locked in the mainstream paradigm :) Best regards, Ahmed From bengt.kleberg@REDACTED Wed Dec 3 15:13:25 2008 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 03 Dec 2008 15:13:25 +0100 Subject: [erlang-questions] Restricting number of executions per second In-Reply-To: References: Message-ID: <1228313605.6669.69.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> Greetings, One way to do it could be to add the frequency of calls to the server state. Too high frequency => do not call the function. bengt On Wed, 2008-12-03 at 17:41 +0400, Ahmed Ali wrote: > Hi All, > > I want to run a function in not more than a specific numbers of times > per second (e.g. 3 times per second). The function is part of a > gen_server process (i.e. called using gen_server:call/2). What's the > best way to do this? > > The funny thing is that the first idea I got for a solution is locking > n semaphores to serialize the execution. I guess I'm still locked in > the mainstream paradigm :) > > Best regards, > > Ahmed > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From masse@REDACTED Wed Dec 3 15:20:32 2008 From: masse@REDACTED (mats cronqvist) Date: Wed, 03 Dec 2008 15:20:32 +0100 Subject: [erlang-questions] Restricting number of executions per second In-Reply-To: (Ahmed Ali's message of "Wed\, 3 Dec 2008 17\:41\:20 +0400") References: Message-ID: <87oczt9w7j.fsf@sterlett.hq.kred> "Ahmed Ali" writes: > Hi All, > > I want to run a function in not more than a specific numbers of times > per second (e.g. 3 times per second). The function is part of a > gen_server process (i.e. called using gen_server:call/2). What's the > best way to do this? this ought to be pretty effective. it's just pseudo-code of course. loop(Sec,Count) -> case Count < 3 of true -> func(); false-> ok end, case now() of {_,Sec,_} -> loop(Sec,Count+1); {_,NSec,_}-> loop(NSec,0) end. From joshuajnoble@REDACTED Wed Dec 3 16:07:27 2008 From: joshuajnoble@REDACTED (joshuajnoble) Date: Wed, 3 Dec 2008 07:07:27 -0800 (PST) Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December 2008) In-Reply-To: <8ec76080812021306l6d965c4ao4716224b606ab628@mail.gmail.com> References: <8474074A-8F5A-452C-905E-52A1D320AF4E@patternmatched.com> <449398.6638.qm@web31504.mail.mud.yahoo.com> <9810b81b0812021239i6d634b0bke9b48367873fdb34@mail.gmail.com> <8ec76080812021306l6d965c4ao4716224b606ab628@mail.gmail.com> Message-ID: I'd be interested as well, as long as it's mid-town/downtown-ish. I guess that puts us at ~6 attendees. On Dec 2, 4:06?pm, "Whit Armstrong" wrote: > count me in as long as it's somewhere close to mid-town. > > -Whit > > 2008/12/2 Rick R : > > > I'm very interested. > > > On Tue, Dec 2, 2008 at 12:41 PM, Vat Raghavan > > wrote: > > >> Thought would be great! I recently moved to New York and i've love to meet > >> local Erlang-ers :) > > >> --vat > > >> ----.signature---- > >> Without the hope that things will get better, > >> ?that our inheritors will know a world that is fuller and richer than our > >> own, > >> life is pointless, and evolution is vastly overrated > >> -- Delenn > > >> ----- Original Message ---- > >> From: Rudolph van Graan > >> To: Erlang Questions > >> Sent: Tuesday, December 2, 2008 4:45:24 AM > >> Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December > >> 2008) > > >> Hi, > > >> Anybody up for an Erlounge somewhere in New York next week? I will be > >> in town from Wednesday. > > >> Rudolph van Graan > > >> Pattern Matched Technologies > > >> E-Mail: ?r...@REDACTED > >> Tel: ? ?086 1000 700 (SA Only) > >> Mobile: ?+27 83 390 7767 > >> Fax: ? ?+27 12 665 9566 > >> Web: ? ?www.patternmatched.com > > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questi...@REDACTED > >>http://www.erlang.org/mailman/listinfo/erlang-questions > > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questi...@REDACTED > >>http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questi...@REDACTED > >http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questi...@REDACTED://www.erlang.org/mailman/listinfo/erlang-questions From ahmed.nawras@REDACTED Wed Dec 3 16:53:18 2008 From: ahmed.nawras@REDACTED (Ahmed Ali) Date: Wed, 3 Dec 2008 19:53:18 +0400 Subject: [erlang-questions] Restricting number of executions per second In-Reply-To: <1228313605.6669.69.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> References: <1228313605.6669.69.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> Message-ID: Hi, Thanks both for your prompt answer. Actually, it turned out, the transactions takes almost the same time to complete, so a simple timer:sleep(1000/n) before calling the function suffice. However, this is an interesting question. Sometimes, we need to restrict throughtput (e.g. QoS) and I'd like to know how people solve similar actions. I didn't have to think about this before. The solution that I can think of now is to have a process (pool of processes?) to control access a channel. The entry point is something like the pseudo-function send_msg/1 below (assuming asyc type messages). I'm sure this has been discussed before so if someone can provide me with a link, I'd appreciate it. send_msg(Msg) -> case is_free() of go_ahead -> gen_server:cast(?MODULE, Msg); _ -> add_msg_to_queue(Msg) end. handle_cast(Msg, From, State) -> State2 = do_something(Msg), %% spawn so that function returns spawn(fun send_msg_from_queue/0), {reply, ok, State2). send_msg_from_queue() -> Msg = remove_from_queue(), gen_server:cast(?MODULE, Msg). Best regards, Ahmed On Wed, Dec 3, 2008 at 6:13 PM, Bengt Kleberg wrote: > Greetings, > > One way to do it could be to add the frequency of calls to the server > state. Too high frequency => do not call the function. > > > bengt > On Wed, 2008-12-03 at 17:41 +0400, Ahmed Ali wrote: >> Hi All, >> >> I want to run a function in not more than a specific numbers of times >> per second (e.g. 3 times per second). The function is part of a >> gen_server process (i.e. called using gen_server:call/2). What's the >> best way to do this? >> >> The funny thing is that the first idea I got for a solution is locking >> n semaphores to serialize the execution. I guess I'm still locked in >> the mainstream paradigm :) >> >> Best regards, >> >> Ahmed >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From abhay@REDACTED Wed Dec 3 17:53:44 2008 From: abhay@REDACTED (Abhay Kumar) Date: Wed, 3 Dec 2008 08:53:44 -0800 Subject: [erlang-questions] Erlang/OTP, eunit and the LGPL In-Reply-To: References: <882453cd0812021724p79cb7f07td41fa3afca4fbd71@mail.gmail.com> Message-ID: <882453cd0812030853t9c71b02m704ab49c16174029@mail.gmail.com> > We will try and most probably succeed to change the license for eunit > to EPL, but I don't really understand > how the LGPL on Eunit could be be a problem for using the rest of Erlang/OTP? Our policy, as I understand it, is to err on the side of restriction when dealing with GPL and LGPL licenses. Although it's perfectly alright to use any binaries produced from this code for code that is not released in the LGPL, it's painstakingly hard to get approval to do so and it requires that no source files are available on both developer machines and production environments. Since the Erlang/OTP distribution is in source form (and not in binary from) for certain development environments, this essentially blocks folks from even downloading the src tarball and building it on their system. Usually what happens in this case is that after all the legal hoops are jumped, someone who is 'quarantined' from corporate code is allowed to download and build the binaries, remove all the source files and then provide that package to others to install on their machines. These packages would be severely limiting since I can't even count how many times I look into code:lib_dir() to solve my questions as it is often provides a more comprehensive answer than documentation alone. The analogy in the LGPL is really very specific to C and linked-in drivers and the lawyers seem to have the biggest problem with the ambiguity of the language. I think this came up in the Java community a little while ago. -- Abhay Kumar http://opensynapse.net/ This email address is: [ ] public [x] ask first [ ] private From mcpherson@REDACTED Wed Dec 3 19:06:08 2008 From: mcpherson@REDACTED (Allen McPherson) Date: Wed, 3 Dec 2008 11:06:08 -0700 Subject: [erlang-questions] Any canonical bandwidth benchmarks for clusters? In-Reply-To: References: Message-ID: Depends on how you define significantly. We have MPI benchmarks that use the IP over IB interface that run at 700MB/sec. Mine is 1% of that. I would expect better. In any case I will be working on the benchmark to test different message sizes. We have MPI benchmarks that run qt 1.5GB/sec over the IB DDR NIC. I would not expect to achieve that because Erlang would not interleave over the two IB interfaces. -- Al > First of all you would always expect IP over IB to be significantly > slower than the MPI/IB interface, because the later uses RDMA and > bypasses the OS's TCP/IP stack. I my experience with IP/IB, sending > large messages degrades throughput quite noticeably. Try to split > messages in smaller chunks and redo the benchmark for different > message > sizes. > > Serge > > Allen McPherson wrote: >> I'm testing some code that is showing terrible bandwidth >> on our 40+ node Infiniband cluster (7 MB/sec for a ring benchmark!). >> This code is using the IP over IB interface and send big (1+ MB) >> messages around (binaries and non-binaries). MPI code runs >> at good rates on this cluster. >> >> Before I post my code I thought I'd see if there were >> existing bandwidth benchmarks for distributed Erlang >> on a locally connected cluster. Haven't been able to >> find any via Google. Does anyone know of, or have, code >> that I might use to test. >> >> Lacking other tests I'll put together a longer post with >> my code included and maybe someone else with a similar >> cluster could run it? >> >> Thanks >> -- >> Allen McPherson >> Los Alamos National Laboratory >> _______________________________________________ From hmg_u@REDACTED Wed Dec 3 22:27:49 2008 From: hmg_u@REDACTED (haynes george) Date: Wed, 3 Dec 2008 21:27:49 +0000 (GMT) Subject: [erlang-questions] Ericsson Open Telecom Platform Message-ID: <896602.1391.qm@web7604.mail.in.yahoo.com> Hi, I am a student at UC Irvine and I am looking for the document on Open Telecom Platform by S. Torstendahl. Open Telecom Platform. Ericsson Review 94 1 (1997), pp. 14?23. The list of documents on erlang.org links to the archives at ericsson.com/review but unfortunately they keep documents for the last 10 years only. Therefore this document is no more available on ericsson.com. Can somebody help me out? Regards, Haynes Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ From taj.khattra@REDACTED Thu Dec 4 00:30:38 2008 From: taj.khattra@REDACTED (Taj Khattra) Date: Wed, 3 Dec 2008 15:30:38 -0800 Subject: [erlang-questions] Ericsson Open Telecom Platform In-Reply-To: <896602.1391.qm@web7604.mail.in.yahoo.com> References: <896602.1391.qm@web7604.mail.in.yahoo.com> Message-ID: <57a21f730812031530x6bc70ee7j223f31a2ae74033c@mail.gmail.com> > Can somebody help me out? google to the rescue: http://pcs.pcs-ag.com/pubwww/shse/technologies/functional_programming/erlang/docs/OTPintro.pdf From jongretar@REDACTED Thu Dec 4 00:37:27 2008 From: jongretar@REDACTED (Jon Gretar Borgthorsson) Date: Wed, 3 Dec 2008 23:37:27 +0000 Subject: [erlang-questions] Ericsson Open Telecom Platform In-Reply-To: <896602.1391.qm@web7604.mail.in.yahoo.com> References: <896602.1391.qm@web7604.mail.in.yahoo.com> Message-ID: <4ecde87b0812031537h391d66cfqe8f77db7ca57b935@mail.gmail.com> Why not simply ask them for it? http://www.ericsson.com/ericsson/corpinfo/publications/review/contacts.shtml On Wed, Dec 3, 2008 at 9:27 PM, haynes george wrote: > Hi, > > I am a student at UC Irvine and I am looking for the > document on Open Telecom Platform by S. Torstendahl. > > Open Telecom Platform. Ericsson Review 94 1 (1997), > pp. 14?23. > > The list of documents on erlang.org links to the > archives at ericsson.com/review but unfortunately they > keep documents for the last 10 years only. Therefore > this document is no more available on ericsson.com. > > Can somebody help me out? > > Regards, > Haynes > > > > Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From rklophaus@REDACTED Thu Dec 4 09:22:35 2008 From: rklophaus@REDACTED (Rusty Klophaus) Date: Thu, 4 Dec 2008 03:22:35 -0500 Subject: [erlang-questions] New screencast of latest Nitrogen features (Web Framework for Erlang) Message-ID: <57170AAC-CA41-4566-8760-6CB138F9B18F@gmail.com> Good evening/morning, Just sending out notice of a new screencast I put together to show off some of Nitrogen's latest features, including: - Form Validation - Google Chart API integration - Drag and Drop support - Sorting support - Databinding - Continuations (browser polls for long running functions to finish) Other recent enhancements not explicitly shown in the video are: - Switched from Prototype/Scriptaculous to JQuery/JQuery UI - Full support for Mochiweb, Yaws, and Inets See it at http://nitrogen-erlang.tumblr.com Get the code at http://github.com/rklophaus/nitrogen Best, Rusty rklophaus on twitter -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeedward@REDACTED Thu Dec 4 11:46:23 2008 From: jeedward@REDACTED (John Edward) Date: Thu, 4 Dec 2008 02:46:23 -0800 (PST) Subject: [erlang-questions] MULTICONF-09 call for papers Message-ID: <794672.30387.qm@web45911.mail.sp1.yahoo.com> ? MULTICONF-09 call for papers ? The 2009 Multi Conference in Computer Science, Information Technology and Control systems and Computational Science and Computer Engineering (MULTICONF-09) (website: http://www.PromoteResearch.org) will be held during July 13-16 2009 in Orlando, FL, USA. We invite draft paper submissions. The event consists of the following conferences: ????????? International Conference on Artificial Intelligence and Pattern Recognition (AIPR-09) ????????? International Conference on Automation, Robotics and Control Systems (ARCS-09) ????????? International Conference on Bioinformatics, Computational Biology, Genomics and Chemoinformatics (BCBGC-09) ????????? International Conference on Enterprise Information Systems and Web Technologies (EISWT-09) ????????? International Conference on High Performance Computing, Networking and Communication Systems (HPCNCS-09) ????????? International Conference on Information Security and Privacy (ISP-09) ????????? International Conference on Recent Advances in Information Technology and Applications (RAITA-09) ????????? International Conference on Software Engineering Theory and Practice (SETP-09) ????????? International Conference on Theory and Applications of Computational Science (TACS-09) ????????? International Conference on Theoretical and Mathematical Foundations of Computer Science (TMFCS-09) ? The website http://www.PromoteResearch.org? contains more details. ? Sincerely John Edward Publicity committee ? ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From francesca.gangemi@REDACTED Thu Dec 4 18:16:22 2008 From: francesca.gangemi@REDACTED (Francesca Gangemi) Date: Thu, 04 Dec 2008 18:16:22 +0100 Subject: [erlang-questions] Upgrading gen_tcp socket to ssl In-Reply-To: <49114933.5090405@erix.ericsson.se> References: <49114933.5090405@erix.ericsson.se> Message-ID: <49381066.7060404@erlang-consulting.com> Hi, Ingela Anderton Andin wrote: >> But when I try ssl:connect(Gen_tcp_socket,[{verify,0}]), I get >> {eoptions,{cacertfile,[]}}. >> The Gen_tcp_socket is a socket created using gen_tcp:connect/3. >> >> Since {verify,0}, why is a cacertfile required. >> >> > > Verify options was one of the things that was not fully implemented. > > Ssl-3.10 will soon be out in R12B-5 and then the new ssl-implementation > will be much more complete but still there are a few limitations left > before it can completely replace the old ssl. You are welcome to try it > and we are of course interested in any feedback that you might have. > I'm using ssl-3.10 and I still see the same problem: "cacertfile" is required even if {verify,0} is explicitly specified as option . As example ssl:connect("zimbra.erlangsystems.com", 443, [{verify,0},{ssl_imp,new}]). {error,{eoptions,{cacertfile,[]}}} ssl:connect("zimbra.erlangsystems.com", 443, [{verify,0}]). {ok,{sslsocket,5,<0.1664.0>}} Trying to upgrade a tcp socket I put as cacertfile the filename of a certificate I have on my machine and I've got the following error report ssl:connect(#Port<0.3428>,[{certfile,"certs/mycert.pem"}, {keyfile,"certs/mycert.key"}, {cacertfile,"certs/vsign.pem"}, {verify,0}, {ssl_imp, new}]) =ERROR REPORT==== 4-Dec-2008::17:57:05 === SSL: hello: ./ssl_record.erl:291:Fatal error: record_overflow Btw, is it written anywhere in the doc that ssl needs public_key? I thought crypto was the only required application... Kind regards Francesca -- Francesca Gangemi, francesca@REDACTED Erlang Training and Consulting http://www.erlang-consulting.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From richardc@REDACTED Thu Dec 4 19:45:58 2008 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 04 Dec 2008 19:45:58 +0100 Subject: [erlang-questions] When does ERLC provide minmal feedback? In-Reply-To: <20081129142257.2XMHQ.93203.root@cdptpa-web27-z01> References: <20081129142257.2XMHQ.93203.root@cdptpa-web27-z01> Message-ID: <49382566.90701@it.uu.se> ggaliens@REDACTED wrote: > OK ... here's the info I should have provided last time around. > ERLC is crashing in odd ways when I run one of the main makefiles from a commandline as follows ... > > markw@REDACTED /cygdrive/c/WingsSVN/src > $ make > make TYPE=opt common > make[1]: Entering directory `/cygdrive/c/WingsSVN/src' > erlc -pa ../../esdl-0.96.0626/ebin -I ../../esdl-0.96.0626/esdl/include -I ../../esdl-0.96.0626 -I ../e3d -W +debug_info '-Dwi > ngs_version="0.99.52"' -pa ../intl_tools -o../ebin wings_lang.erl > erlc -pa ../../esdl-0.96.0626/ebin -I ../../esdl-0.96.0626/esdl/include -I ../../esdl-0.96.0626 -I ../e3d -W +debug_info '-Dwi > ngs_version="0.99.52"' -pa ../intl_tools -o../ebin user_default.erl > erlc -pa ../../esdl-0.96.0626/ebin -I ../../esdl-0.96.0626/esdl/include -I ../../esdl-0.96.0626 -I ../e3d -W +debug_info '-Dwi > ngs_version="0.99.52"' -pa ../intl_tools -o../ebin wings.erl > > > The odd thing is that this works in a slightly older code base tree (two years old). > > The compile appears to HANG when compiling wings.erl Sorry, but I can't repeat your problem. Using Wings from svn and esdl-0.96.0626 (the precompiled Windows zip file), under cygwin, the same build simply works, for me. Try to isolate it down to a single source file (not counting includes), and a single command that you can run without the makefile. But first of all you might want to run something like dos2unix on all source files, to ensure they all follow the same eol-style (in case you might have gotten them fouled up somehow). /Richard From jarrod@REDACTED Thu Dec 4 20:34:13 2008 From: jarrod@REDACTED (Jarrod Roberson) Date: Thu, 4 Dec 2008 14:34:13 -0500 Subject: [erlang-questions] gen_tcp and gen_server Message-ID: How can I put a TCP interface on top of gen_server code that I have written. I am just finally getting my head around OTP, but I need to have a TCP interface on my server. I have searched Google and haven't really found anything useful. Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alustenberg@REDACTED Thu Dec 4 21:05:47 2008 From: alustenberg@REDACTED (Alex) Date: Thu, 4 Dec 2008 15:05:47 -0500 Subject: [erlang-questions] gen_tcp and gen_server In-Reply-To: References: Message-ID: <915e7e1d0812041205t64e7657k523ce38fd53caa21@mail.gmail.com> check out http://www.trapexit.org/Building_a_Non-blocking_TCP_server_using_OTP_principles its a very good intro on how to setup a tcp server inside of a OTP supervisor tree. 2008/12/4 Jarrod Roberson > How can I put a TCP interface on top of gen_server code that I have > written. > I am just finally getting my head around OTP, but I need to have a TCP > interface on my server. > I have searched Google and haven't really found anything useful. > Thanks in advance. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter@REDACTED Thu Dec 4 21:34:42 2008 From: peter@REDACTED (Peter Sabaini) Date: Thu, 4 Dec 2008 21:34:42 +0100 Subject: [erlang-questions] Noob alert: tuple to record? Message-ID: <200812042134.42242.peter@sabaini.at> Hello list, Please forgive the noobness: if I have a list of {Name, Value} pairs corresponding to names defined in a record, is there a way to set those values in a record automatically? Thanks, peter. -- Peter Sabaini http://sabaini.at/ From torben.lehoff@REDACTED Thu Dec 4 23:19:39 2008 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Thu, 4 Dec 2008 23:19:39 +0100 Subject: [erlang-questions] Noob alert: tuple to record? In-Reply-To: <200812042134.42242.peter@sabaini.at> References: <200812042134.42242.peter@sabaini.at> Message-ID: Hi Peter, This is a painful area. Sadly, you cannot do this automatically. You can do various tricks with the internal representation of the records - see http://www.erlang.org/doc/reference_manual/records.html#8.7 - but it will never be beautiful. A possible solution: use Fields=record_info(fields,) to get the list of fields in the record and then for each {Name,Value} pair you find out the position of the Name in the Fields list and the do a nasty setelement(Position,Record,Value) to set the value. Another question before you dive in: you have a nice list of {Name,Value} which matches with the proplists module, perhaps you do not need to put the things into a record? Could you tell us a bit more about what problem you are trying to solve on the level above your particular question? Cheers, Torben On Thu, Dec 4, 2008 at 9:34 PM, Peter Sabaini wrote: > Hello list, > > Please forgive the noobness: if I have a list of {Name, Value} pairs > corresponding to names defined in a record, is there a way to set those > values > in a record automatically? > > Thanks, > peter. > -- > Peter Sabaini > http://sabaini.at/ > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter@REDACTED Thu Dec 4 22:46:43 2008 From: peter@REDACTED (Peter Sabaini) Date: Thu, 4 Dec 2008 22:46:43 +0100 Subject: [erlang-questions] Noob alert: tuple to record? In-Reply-To: <200812042134.42242.peter@sabaini.at> References: <200812042134.42242.peter@sabaini.at> Message-ID: <200812042246.43894.peter@sabaini.at> Disregard that message, I just figured it out. For other noobs: simply put the record name as the first element in a tuple, and its a record of that type. Sorry for the noise... peter. On Thursday 04 December 2008 21:34:42 you wrote: > Hello list, > > Please forgive the noobness: if I have a list of {Name, Value} pairs > corresponding to names defined in a record, is there a way to set those > values in a record automatically? > > Thanks, > peter. -- Peter Sabaini http://sabaini.at/ From peter@REDACTED Fri Dec 5 00:36:11 2008 From: peter@REDACTED (Peter Sabaini) Date: Fri, 5 Dec 2008 00:36:11 +0100 Subject: [erlang-questions] Noob alert: tuple to record? In-Reply-To: References: <200812042134.42242.peter@sabaini.at> Message-ID: <200812050036.11480.peter@sabaini.at> On Thursday 04 December 2008 23:19:39 Torben Hoffmann wrote: > Hi Peter, > > This is a painful area. I gathered as much -- records seem a bit like an afterthought ;-) Fortunately, for my problem I've got a solution now > Sadly, you cannot do this automatically. You can do various tricks with the > internal representation of the records - see > http://www.erlang.org/doc/reference_manual/records.html#8.7 - but it will > never be beautiful. > > A possible solution: > use Fields=record_info(fields,) to get the list of fields > in the record and then for each {Name,Value} pair you find out the position > of the Name in the Fields list and the do a nasty > setelement(Position,Record,Value) to set the value. > > Another question before you dive in: you have a nice list of {Name,Value} > which matches with the proplists module, perhaps you do not need to put the > things into a record? Oh, another module to check out! Joy of learning a new language :-) I've now butchered something together involving record_info() and the dict module, so I'm all set. Basically I create an orddict with all possible field values from a record, create a second dict with the actual values, update the first with the second and fetch the values; together with the rectype atom I've got my record. On the other hand I now begin to wonder if I should bother with records at all and instead use dicts or proplists for my data? Thanks! peter. > Could you tell us a bit more about what problem you are trying to solve on > the level above your particular question? > > Cheers, > Torben > > On Thu, Dec 4, 2008 at 9:34 PM, Peter Sabaini wrote: > > Hello list, > > > > Please forgive the noobness: if I have a list of {Name, Value} pairs > > corresponding to names defined in a record, is there a way to set those > > values > > in a record automatically? > > > > Thanks, > > peter. > > -- > > Peter Sabaini > > http://sabaini.at/ > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions -- Peter Sabaini http://sabaini.at/ From masse@REDACTED Fri Dec 5 08:01:18 2008 From: masse@REDACTED (mats cronqvist) Date: Fri, 05 Dec 2008 08:01:18 +0100 Subject: [erlang-questions] Noob alert: tuple to record? In-Reply-To: <200812050036.11480.peter@sabaini.at> (Peter Sabaini's message of "Fri\, 5 Dec 2008 00\:36\:11 +0100") References: <200812042134.42242.peter@sabaini.at> <200812050036.11480.peter@sabaini.at> Message-ID: <87fxl39kch.fsf@sterlett.hq.kred> Peter Sabaini writes: > On the other hand I now begin to wonder if I should bother with > records at all and instead use dicts or proplists for my data? records are useful if a) the CPU cost of using dicts is too high (rarely true) or b) you want to pattern match on the fields, e.g. like f(#foo{bla=ok}) -> ok. otherwise i recommend dicts. mats From kenneth.lundin@REDACTED Fri Dec 5 09:27:23 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 5 Dec 2008 09:27:23 +0100 Subject: [erlang-questions] Ericsson Open Telecom Platform In-Reply-To: <4ecde87b0812031537h391d66cfqe8f77db7ca57b935@mail.gmail.com> References: <896602.1391.qm@web7604.mail.in.yahoo.com> <4ecde87b0812031537h391d66cfqe8f77db7ca57b935@mail.gmail.com> Message-ID: Hi, I have now installed the missing Ericsson Review documents where I have control over them , the links from erlang.org is adjusted and should work now. /Kenneth Erlang/OTP, Ericsson On Thu, Dec 4, 2008 at 12:37 AM, Jon Gretar Borgthorsson wrote: > Why not simply ask them for it? > > http://www.ericsson.com/ericsson/corpinfo/publications/review/contacts.shtml > > > On Wed, Dec 3, 2008 at 9:27 PM, haynes george wrote: >> Hi, >> >> I am a student at UC Irvine and I am looking for the >> document on Open Telecom Platform by S. Torstendahl. >> >> Open Telecom Platform. Ericsson Review 94 1 (1997), >> pp. 14?23. >> >> The list of documents on erlang.org links to the >> archives at ericsson.com/review but unfortunately they >> keep documents for the last 10 years only. Therefore >> this document is no more available on ericsson.com. >> >> Can somebody help me out? >> >> Regards, >> Haynes >> >> >> >> Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From ingela@REDACTED Fri Dec 5 09:28:27 2008 From: ingela@REDACTED (Ingela Anderton Andin) Date: Fri, 05 Dec 2008 09:28:27 +0100 Subject: [erlang-questions] Upgrading gen_tcp socket to ssl In-Reply-To: References: Message-ID: <4938E62B.4030205@erix.ericsson.se> Hi Thank you for the feedback :) > Ingela Anderton Andin wrote: > >>> But when I try ssl:connect(Gen_tcp_socket,[{verify,0}]), I get >>> {eoptions,{cacertfile,[]}}. >>> The Gen_tcp_socket is a socket created using gen_tcp:connect/3. >>> >>> Since {verify,0}, why is a cacertfile required. >>> >>> >>> >> Verify options was one of the things that was not fully implemented. >> >> Ssl-3.10 will soon be out in R12B-5 and then the new ssl-implementation >> will be much more complete but still there are a few limitations left >> before it can completely replace the old ssl. You are welcome to try it >> and we are of course interested in any feedback that you might have. >> >> > > I'm using ssl-3.10 and I still see the same problem: > "cacertfile" is required even if {verify,0} is explicitly specified as > option . > > As example > > ssl:connect("zimbra.erlangsystems.com", 443, [{verify,0},{ssl_imp,new}]). > {error,{eoptions,{cacertfile,[]}}} > > ssl:connect("zimbra.erlangsystems.com", 443, [{verify,0}]). > {ok,{sslsocket,5,<0.1664.0>}} > > > Sorry that was our mistake we forgot to remove the restriction in the "option list handling" it will be removed for the next release. > Trying to upgrade a tcp socket I put as cacertfile the filename of a > certificate I have on my machine and I've got the following error report > > ssl:connect(#Port<0.3428>,[{certfile,"certs/mycert.pem"}, > {keyfile,"certs/mycert.key"}, > {cacertfile,"certs/vsign.pem"}, > {verify,0}, {ssl_imp, new}]) > > =ERROR REPORT==== 4-Dec-2008::17:57:05 === > SSL: hello: ./ssl_record.erl:291:Fatal error: record_overflow > > Humm .. we have test-cases for upgrade that works fine we do something along the lines of: Server process: {ok, ListenSocket} = gen_tcp:listen(9999, [binary,{reuseaddr,true}]) {ok, AcceptSocket} = gen_tcp:accept(ListenSocket) Client process: {ok, Socket} = gen_tcp:connect("armed", 9999, [binary,{reuseaddr,true}]) Server process: ssl:ssl_accept(AcceptSocket, [{ssl_imp,new}, {reuseaddr,true}, {cacertfile, "server/cacerts.pem"}, {certfile, "server/cert.pem"}, {keyfile, "server/key.pem"}]) Client process: ssl:connect(Socket, [{cacertfile, "client/cacerts.pem"}, {certfile, "client/cert.pem"}, {keyfile, "client/key.pem"}, {ssl_imp,new}]) Is it possible for you to provide us with more information so we can repeat your senario? I do not know what server end you use, but you have to agree with the server end to make the upgrade prior to calling ssl:connect. > Btw, is it written anywhere in the doc that ssl needs public_key? I > thought crypto was the only required application... > > If no where else, it stated in the release notes. public_key is a library application that will be used by more applications in the future and that is why we broke the code out from ssl. (Crypto is no library application it has its own processes). Both public_key and ssl uses crypto. Regards Ingela Erlang/OTP - Ericsson From steven.charles.davis@REDACTED Fri Dec 5 10:52:01 2008 From: steven.charles.davis@REDACTED (Steve Davis) Date: Fri, 5 Dec 2008 01:52:01 -0800 (PST) Subject: [erlang-questions] New screencast of latest Nitrogen features (Web Framework for Erlang) In-Reply-To: <57170AAC-CA41-4566-8760-6CB138F9B18F@gmail.com> References: <57170AAC-CA41-4566-8760-6CB138F9B18F@gmail.com> Message-ID: <08dd24b0-7fb5-4b3f-b274-36781c1f6659@j35g2000yqh.googlegroups.com> On Dec 4, 2:22?am, Rusty Klophaus wrote: > - Switched from Prototype/Scriptaculous to JQuery/JQuery UI I really like this decision. /s From ulises.cervino@REDACTED Fri Dec 5 11:01:02 2008 From: ulises.cervino@REDACTED (Ulises) Date: Fri, 5 Dec 2008 10:01:02 +0000 Subject: [erlang-questions] New screencast of latest Nitrogen features (Web Framework for Erlang) In-Reply-To: <08dd24b0-7fb5-4b3f-b274-36781c1f6659@j35g2000yqh.googlegroups.com> References: <57170AAC-CA41-4566-8760-6CB138F9B18F@gmail.com> <08dd24b0-7fb5-4b3f-b274-36781c1f6659@j35g2000yqh.googlegroups.com> Message-ID: <226d73360812050201t3aecc9c8vd1cb7c47a354449e@mail.gmail.com> >> - Switched from Prototype/Scriptaculous to JQuery/JQuery UI > > I really like this decision. A bit OT, however, why the decision to couple it with a JS framework? U From vladdu55@REDACTED Fri Dec 5 11:12:28 2008 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 5 Dec 2008 11:12:28 +0100 Subject: [erlang-questions] string:substr/2 gives confusing error message Message-ID: <95be1d3b0812050212k15a36c81s91df8f6bb178cd54@mail.gmail.com> Hi! Calling string:substr/2 with erroneous arguments gives a non-informative error message (w@REDACTED)1> string:substr([], 2). ** exception error: no function clause matching string:substr2([],2) Shouldn't it be badarg instead, or something similar? Also, the strings module documentation doesn't mention what are the cases when the function will fail. (A quick glance shows that there are other functions in the same situation). best regards, Vlad From vychodil.hynek@REDACTED Fri Dec 5 12:12:27 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Fri, 5 Dec 2008 12:12:27 +0100 Subject: [erlang-questions] string:substr/2 gives confusing error message In-Reply-To: <95be1d3b0812050212k15a36c81s91df8f6bb178cd54@mail.gmail.com> References: <95be1d3b0812050212k15a36c81s91df8f6bb178cd54@mail.gmail.com> Message-ID: <20081205111228.AAD7124062@relay.gooddata.com> I think it is worthless work add exception raise as last clause on each function when this error occurred in same function. Different thing is when bad argument raise exception in some subtle internal function and worse when it is other type than function_clause. function_clause means there is not any clause which match to your parameters and is synonymous to badarg for me. Adding exception raise in this case is typical defensive programming and it is not good practice in Erlang except pattern match with tagging. On Fri, Dec 5, 2008 at 11:12 AM, Vlad Dumitrescu wrote: > Hi! > > Calling string:substr/2 with erroneous arguments gives a > non-informative error message > > (w@REDACTED)1> string:substr([], 2). > ** exception error: no function clause matching string:substr2([],2) > > Shouldn't it be badarg instead, or something similar? > > Also, the strings module documentation doesn't mention what are the > cases when the function will fail. (A quick glance shows that there > are other functions in the same situation). > > best regards, > Vlad > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Fri Dec 5 12:17:45 2008 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 5 Dec 2008 12:17:45 +0100 Subject: [erlang-questions] string:substr/2 gives confusing error message In-Reply-To: <20081205111228.B2DFC24063@relay.gooddata.com> References: <95be1d3b0812050212k15a36c81s91df8f6bb178cd54@mail.gmail.com> <20081205111228.B2DFC24063@relay.gooddata.com> Message-ID: <95be1d3b0812050317o7d5c0c41h6891ebe938ea322c@mail.gmail.com> On Fri, Dec 5, 2008 at 12:12, Hynek Vychodil wrote: > I think it is worthless work add exception raise as last clause on each > function when this error occurred in same function. >> (w@REDACTED)1> string:substr([], 2). >> ** exception error: no function clause matching string:substr2([],2) Except it's not the same function: notice the error refers to string2, not to string. Yes, it's relatively easy to check the code and see what's going wrong, but then any documentation is redundant, as one could check the code... In any case, badarg is the standard exception thrown in similar cases, so why not be consistent? regards, Vlad From vychodil.hynek@REDACTED Fri Dec 5 12:27:37 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Fri, 5 Dec 2008 12:27:37 +0100 Subject: [erlang-questions] string:substr/2 gives confusing error message In-Reply-To: <95be1d3b0812050317o7d5c0c41h6891ebe938ea322c@mail.gmail.com> References: <95be1d3b0812050212k15a36c81s91df8f6bb178cd54@mail.gmail.com> <20081205111228.B2DFC24063@relay.gooddata.com> <95be1d3b0812050317o7d5c0c41h6891ebe938ea322c@mail.gmail.com> Message-ID: <20081205112738.6389324022@relay.gooddata.com> Because: Adding exception raise in this case is typical defensive programming and it is not good practice in Erlang except pattern match with tagging. On Fri, Dec 5, 2008 at 12:17 PM, Vlad Dumitrescu wrote: > On Fri, Dec 5, 2008 at 12:12, Hynek Vychodil > wrote: > > I think it is worthless work add exception raise as last clause on each > > function when this error occurred in same function. > > >> (w@REDACTED)1> string:substr([], 2). > >> ** exception error: no function clause matching string:substr2([],2) > > Except it's not the same function: notice the error refers to string2, > not to string. > > Yes, it's relatively easy to check the code and see what's going > wrong, but then any documentation is redundant, as one could check the > code... > > In any case, badarg is the standard exception thrown in similar cases, > so why not be consistent? > > regards, > Vlad > -- --Hynek (Pichi) Vychodil -------------- next part -------------- An HTML attachment was scrubbed... URL: From v@REDACTED Fri Dec 5 12:32:30 2008 From: v@REDACTED (Valentin Micic) Date: Fri, 5 Dec 2008 13:32:30 +0200 Subject: [erlang-questions] string:substr/2 gives confusing error message In-Reply-To: <95be1d3b0812050212k15a36c81s91df8f6bb178cd54@mail.gmail.com> Message-ID: <200812051131.mB5BVDKn028934@mail.pharos-avantgard.com> I think that depends how you want to look at it... One may argue that string:substr([], 2 ) does not make much sense as a statement, but then, I'd say that: string:substr("1", 2 ) does not make to much sense either, and yet it returns []. IMO, both functions should behave the same way, and to be pragmatic, return an empty list (not a badarg exception). V. -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Vlad Dumitrescu Sent: 05 December 2008 12:12 PM To: erlang-questions Subject: [erlang-questions] string:substr/2 gives confusing error message Hi! Calling string:substr/2 with erroneous arguments gives a non-informative error message (w@REDACTED)1> string:substr([], 2). ** exception error: no function clause matching string:substr2([],2) Shouldn't it be badarg instead, or something similar? Also, the strings module documentation doesn't mention what are the cases when the function will fail. (A quick glance shows that there are other functions in the same situation). best regards, Vlad _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From masse@REDACTED Fri Dec 5 14:11:03 2008 From: masse@REDACTED (mats cronqvist) Date: Fri, 05 Dec 2008 14:11:03 +0100 Subject: [erlang-questions] string:substr/2 gives confusing error message In-Reply-To: <20081205112738.6389324022@relay.gooddata.com> (Hynek Vychodil's message of "Fri\, 5 Dec 2008 12\:27\:37 +0100") References: <95be1d3b0812050212k15a36c81s91df8f6bb178cd54@mail.gmail.com> <20081205111228.B2DFC24063@relay.gooddata.com> <95be1d3b0812050317o7d5c0c41h6891ebe938ea322c@mail.gmail.com> <20081205112738.6389324022@relay.gooddata.com> Message-ID: <87bpvqahso.fsf@sterlett.hq.kred> "Hynek Vychodil" writes: > Because: > > Adding exception raise in this case is typical defensive programming > and it is not good practice in Erlang except pattern match with > tagging. so, a function raising an exception when given bad data is not good practice in Erlang? what gave you that impression? I'd say that the opposite is true. "The erlang way", as i was taught it, is to fail early and let the supervisor sort it out. also, the way i interpret "defensive programming" is when a function continues despite being given bad data. a typical example would be; string:substr("a",2) -> [] The fact that string:substr("a",2) and string:substr("",2) behaves differently is is just silly. the best would be is they both failed with badarg. second best if they both returned []. mats From vychodil.hynek@REDACTED Fri Dec 5 14:27:38 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Fri, 5 Dec 2008 14:27:38 +0100 Subject: [erlang-questions] string:substr/2 gives confusing error message In-Reply-To: <200812051131.mB5BVDKn028934@mail.pharos-avantgard.com> References: <95be1d3b0812050212k15a36c81s91df8f6bb178cd54@mail.gmail.com> <200812051131.mB5BVDKn028934@mail.pharos-avantgard.com> Message-ID: <20081205132739.048F824062@relay.gooddata.com> You are right, but it means not change behavior from raise function_clause to raise badarg but change from raise function_clause to return empty list. It is worth decision but you change API with all consequents. I think you agree that change to raise badarg is not solution :-) On Fri, Dec 5, 2008 at 12:32 PM, Valentin Micic wrote: > I think that depends how you want to look at it... > One may argue that > string:substr([], 2 ) > does not make much sense as a statement, but then, I'd say that: > string:substr("1", 2 ) > does not make to much sense either, and yet it returns []. > IMO, both functions should behave the same way, and to be pragmatic, return > an empty list (not a badarg exception). > > V. > > > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Vlad Dumitrescu > Sent: 05 December 2008 12:12 PM > To: erlang-questions > Subject: [erlang-questions] string:substr/2 gives confusing error message > > Hi! > > Calling string:substr/2 with erroneous arguments gives a > non-informative error message > > (w@REDACTED)1> string:substr([], 2). > ** exception error: no function clause matching string:substr2([],2) > > Shouldn't it be badarg instead, or something similar? > > Also, the strings module documentation doesn't mention what are the > cases when the function will fail. (A quick glance shows that there > are other functions in the same situation). > > best regards, > Vlad > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil -------------- next part -------------- An HTML attachment was scrubbed... URL: From vychodil.hynek@REDACTED Fri Dec 5 14:35:23 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Fri, 5 Dec 2008 14:35:23 +0100 Subject: [erlang-questions] string:substr/2 gives confusing error message In-Reply-To: <87bpvqahso.fsf@sterlett.hq.kred> References: <95be1d3b0812050212k15a36c81s91df8f6bb178cd54@mail.gmail.com> <20081205111228.B2DFC24063@relay.gooddata.com> <95be1d3b0812050317o7d5c0c41h6891ebe938ea322c@mail.gmail.com> <20081205112738.6389324022@relay.gooddata.com> <87bpvqahso.fsf@sterlett.hq.kred> Message-ID: <20081205133524.2A56124022@relay.gooddata.com> On Fri, Dec 5, 2008 at 2:11 PM, mats cronqvist wrote: > "Hynek Vychodil" writes: > > > Because: > > > > Adding exception raise in this case is typical defensive programming > > and it is not good practice in Erlang except pattern match with > > tagging. > > so, a function raising an exception when given bad data is not good > practice in Erlang? Yes, absolutely. When you don't know what to do, die. see [1] As you wrote below, now you think you know what to do, but in this case just do what to do. Raise different exception is not solution. That's all. > what gave you that impression? I'd say that the > opposite is true. "The erlang way", as i was taught it, is to fail > early and let the supervisor sort it out. > > also, the way i interpret "defensive programming" is when a function > continues despite being given bad data. a typical example would be; > > string:substr("a",2) -> [] > > The fact that > > string:substr("a",2) > > and > > string:substr("",2) > > behaves differently is is just silly. the best would be is they both > failed with badarg. second best if they both returned []. > > mats You found matter of the problem. But I think both could return empty list. [1] http://www.sics.se/~joe/thesis/armstrong_thesis_2003.pdf -- --Hynek (Pichi) Vychodil -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Fri Dec 5 14:50:42 2008 From: rvirding@REDACTED (Robert Virding) Date: Fri, 5 Dec 2008 14:50:42 +0100 Subject: [erlang-questions] string:substr/2 gives confusing error message In-Reply-To: <200812051131.mB5BVDKn028934@mail.pharos-avantgard.com> References: <95be1d3b0812050212k15a36c81s91df8f6bb178cd54@mail.gmail.com> <200812051131.mB5BVDKn028934@mail.pharos-avantgard.com> Message-ID: <3dbc6d1c0812050550n26ea1f3q3667d4af8bca7f6@mail.gmail.com> I think in cases like this you will find that the person who wrote the module (me most likely) was just trying to be kind and return something "sensible" if the arguments are of the right type and not too crazy. Like asking for more characters from a list than exists. I have now thought this over and come to the conclusion that you probably shouldn't be kind but generate an error in these situations. Being kind will often come back and bite you later in an unpleasant way. I personally don't see any problem with a function_clause error as these means that there was a bad argument. It could be helpful if the error came from the function which is called, but as long as it comes from a function which is cleary related to the call, as in this case, I don't worry about it. How to return errors is a difficult problem. If you catch them at a higher level how do you then return a helpful error? And helpful fo whom? Robert 2008/12/5 Valentin Micic > I think that depends how you want to look at it... > One may argue that > string:substr([], 2 ) > does not make much sense as a statement, but then, I'd say that: > string:substr("1", 2 ) > does not make to much sense either, and yet it returns []. > IMO, both functions should behave the same way, and to be pragmatic, return > an empty list (not a badarg exception). > > V. > > > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Vlad Dumitrescu > Sent: 05 December 2008 12:12 PM > To: erlang-questions > Subject: [erlang-questions] string:substr/2 gives confusing error message > > Hi! > > Calling string:substr/2 with erroneous arguments gives a > non-informative error message > > (w@REDACTED)1> string:substr([], 2). > ** exception error: no function clause matching string:substr2([],2) > > Shouldn't it be badarg instead, or something similar? > > Also, the strings module documentation doesn't mention what are the > cases when the function will fail. (A quick glance shows that there > are other functions in the same situation). > > best regards, > Vlad > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rklophaus@REDACTED Fri Dec 5 15:21:41 2008 From: rklophaus@REDACTED (Rusty) Date: Fri, 5 Dec 2008 06:21:41 -0800 (PST) Subject: [erlang-questions] New screencast of latest Nitrogen features (Web Framework for Erlang) In-Reply-To: <226d73360812050201t3aecc9c8vd1cb7c47a354449e@mail.gmail.com> References: <57170AAC-CA41-4566-8760-6CB138F9B18F@gmail.com> <08dd24b0-7fb5-4b3f-b274-36781c1f6659@j35g2000yqh.googlegroups.com> <226d73360812050201t3aecc9c8vd1cb7c47a354449e@mail.gmail.com> Message-ID: <05a9953d-a614-4674-9c0e-5cc9135db55d@x14g2000yqk.googlegroups.com> Hi U, Nitrogen makes heavy use of Ajax postbacks and Ajax effects, and that's all Javascript powered. On the upside, there are just a small number of places where Javascript is generated. (I don't want anyone getting the idea that the code is crawling with Javascript.) In the future, it may be possible to decouple it and let you swap in Prototype, JQuery, Mootools, or whatever else you need (the same way you can run Nitrogen in Yaws, Mochiweb, or Inets now), but there are more important (and interesting) things to tackle first. Best, Rusty On Dec 5, 5:01?am, Ulises wrote: > >> - Switched from Prototype/Scriptaculous to JQuery/JQuery UI > > > I really like this decision. > > A bit OT, however, why the decision to couple it with a JS framework? > > U > _______________________________________________ > erlang-questions mailing list > erlang-questi...@REDACTED://www.erlang.org/mailman/listinfo/erlang-questions From v@REDACTED Fri Dec 5 15:36:37 2008 From: v@REDACTED (Valentin Micic) Date: Fri, 5 Dec 2008 16:36:37 +0200 Subject: [erlang-questions] string:substr/2 gives confusing error message In-Reply-To: <3dbc6d1c0812050550n26ea1f3q3667d4af8bca7f6@mail.gmail.com> Message-ID: <200812051435.mB5EZHKn029649@mail.pharos-avantgard.com> The way I see it, you're doing a right thing - returning an empty string. It is just a matter of covering another pattern: substr( [], N ) -> []. Unless you want to argue that 0 div N = 0 is an error? :-) V. _____ From: Robert Virding [mailto:rvirding@REDACTED] Sent: 05 December 2008 03:51 PM To: Valentin Micic Cc: Vlad Dumitrescu; erlang-questions Subject: Re: [erlang-questions] string:substr/2 gives confusing error message I think in cases like this you will find that the person who wrote the module (me most likely) was just trying to be kind and return something "sensible" if the arguments are of the right type and not too crazy. Like asking for more characters from a list than exists. I have now thought this over and come to the conclusion that you probably shouldn't be kind but generate an error in these situations. Being kind will often come back and bite you later in an unpleasant way. I personally don't see any problem with a function_clause error as these means that there was a bad argument. It could be helpful if the error came from the function which is called, but as long as it comes from a function which is cleary related to the call, as in this case, I don't worry about it. How to return errors is a difficult problem. If you catch them at a higher level how do you then return a helpful error? And helpful fo whom? Robert 2008/12/5 Valentin Micic I think that depends how you want to look at it... One may argue that string:substr([], 2 ) does not make much sense as a statement, but then, I'd say that: string:substr("1", 2 ) does not make to much sense either, and yet it returns []. IMO, both functions should behave the same way, and to be pragmatic, return an empty list (not a badarg exception). V. -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Vlad Dumitrescu Sent: 05 December 2008 12:12 PM To: erlang-questions Subject: [erlang-questions] string:substr/2 gives confusing error message Hi! Calling string:substr/2 with erroneous arguments gives a non-informative error message (w@REDACTED)1> string:substr([], 2). ** exception error: no function clause matching string:substr2([],2) Shouldn't it be badarg instead, or something similar? Also, the strings module documentation doesn't mention what are the cases when the function will fail. (A quick glance shows that there are other functions in the same situation). best regards, Vlad _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Fri Dec 5 15:51:57 2008 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Fri, 05 Dec 2008 15:51:57 +0100 Subject: [erlang-questions] string:substr/2 gives confusing error message In-Reply-To: <200812051435.mB5EZHKn029649@mail.pharos-avantgard.com> References: <200812051435.mB5EZHKn029649@mail.pharos-avantgard.com> Message-ID: <1228488717.24134.1.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> Greetings, Is not ``0 div N = 0'' an error for N equal to 0? bengt On Fri, 2008-12-05 at 16:36 +0200, Valentin Micic wrote: > The way I see it, you?re doing a right thing ? returning an empty > string. It is just a matter of covering another pattern: substr( [], > N ) -> []. Unless you want to argue that 0 div N = 0 is an error? J > > > > V. > > > > > ______________________________________________________________________ > From: Robert Virding [mailto:rvirding@REDACTED] > Sent: 05 December 2008 03:51 PM > To: Valentin Micic > Cc: Vlad Dumitrescu; erlang-questions > Subject: Re: [erlang-questions] string:substr/2 gives confusing error > message > > > > > I think in cases like this you will find that the person who wrote the > module (me most likely) was just trying to be kind and return > something "sensible" if the arguments are of the right type and not > too crazy. Like asking for more characters from a list than exists. > > I have now thought this over and come to the conclusion that you > probably shouldn't be kind but generate an error in these situations. > Being kind will often come back and bite you later in an unpleasant > way. > > I personally don't see any problem with a function_clause error as > these means that there was a bad argument. It could be helpful if the > error came from the function which is called, but as long as it comes > from a function which is cleary related to the call, as in this case, > I don't worry about it. > > How to return errors is a difficult problem. If you catch them at a > higher level how do you then return a helpful error? And helpful fo > whom? > > Robert > > 2008/12/5 Valentin Micic > > I think that depends how you want to look at it... > One may argue that > string:substr([], 2 ) > does not make much sense as a statement, but then, I'd say that: > string:substr("1", 2 ) > does not make to much sense either, and yet it returns []. > IMO, both functions should behave the same way, and to be pragmatic, > return > an empty list (not a badarg exception). > > V. > > > > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Vlad > Dumitrescu > Sent: 05 December 2008 12:12 PM > To: erlang-questions > Subject: [erlang-questions] string:substr/2 gives confusing error > message > > Hi! > > Calling string:substr/2 with erroneous arguments gives a > non-informative error message > > (w@REDACTED)1> string:substr([], 2). > ** exception error: no function clause matching string:substr2([],2) > > Shouldn't it be badarg instead, or something similar? > > Also, the strings module documentation doesn't mention what are the > cases when the function will fail. (A quick glance shows that there > are other functions in the same situation). > > best regards, > Vlad > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From rvirding@REDACTED Fri Dec 5 16:18:33 2008 From: rvirding@REDACTED (Robert Virding) Date: Fri, 5 Dec 2008 16:18:33 +0100 Subject: [erlang-questions] string:substr/2 gives confusing error message In-Reply-To: <200812051435.mB5EZHKn029649@mail.pharos-avantgard.com> References: <3dbc6d1c0812050550n26ea1f3q3667d4af8bca7f6@mail.gmail.com> <200812051435.mB5EZHKn029649@mail.pharos-avantgard.com> Message-ID: <3dbc6d1c0812050718l577885bekf735b9f1010e17fa@mail.gmail.com> Thinking some more and checking the code. Now substr/2 is defined as substr(String, StartPos) -> String. so substr returns the rest of string starting at StartPos. Logically this would mean that string:substr("a",2) -> [] is perfectly ok while string:substr("",2) should generate an error as there is no string starting at the second element in the string. Looking at substr/3 which is defined as substr(String, StartPos, Length) -> String. then it should have the same error returns for StartPos as for substr/2. The remaining question is then how it should handle strings which are too short, i.e. where there is no rest of length Length. The hard line would be to bomb, but I see in the code that this is where I was nice and just returned what there was if there wasn't enough. If this is the best I don't know. But I do think that string:substr("",2) -> [] is being to kind and should generate an error. There's a bug in the code which I would fix. Of course who knows how amny apps will break because of this. :-) Robert 2008/12/5 Valentin Micic > The way I see it, you're doing a right thing ? returning an empty string. > It is just a matter of covering another pattern: substr( [], N ) -> []. > Unless you want to argue that 0 div N = 0 is an error? J > > > > V. > > > ------------------------------ > > *From:* Robert Virding [mailto:rvirding@REDACTED] > *Sent:* 05 December 2008 03:51 PM > *To:* Valentin Micic > *Cc:* Vlad Dumitrescu; erlang-questions > *Subject:* Re: [erlang-questions] string:substr/2 gives confusing error > message > > > > I think in cases like this you will find that the person who wrote the > module (me most likely) was just trying to be kind and return something > "sensible" if the arguments are of the right type and not too crazy. Like > asking for more characters from a list than exists. > > I have now thought this over and come to the conclusion that you probably > shouldn't be kind but generate an error in these situations. Being kind will > often come back and bite you later in an unpleasant way. > > I personally don't see any problem with a function_clause error as these > means that there was a bad argument. It could be helpful if the error came > from the function which is called, but as long as it comes from a function > which is cleary related to the call, as in this case, I don't worry about > it. > > How to return errors is a difficult problem. If you catch them at a higher > level how do you then return a helpful error? And helpful fo whom? > > Robert > > 2008/12/5 Valentin Micic > > I think that depends how you want to look at it... > One may argue that > string:substr([], 2 ) > does not make much sense as a statement, but then, I'd say that: > string:substr("1", 2 ) > does not make to much sense either, and yet it returns []. > IMO, both functions should behave the same way, and to be pragmatic, return > an empty list (not a badarg exception). > > V. > > > > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Vlad Dumitrescu > Sent: 05 December 2008 12:12 PM > To: erlang-questions > Subject: [erlang-questions] string:substr/2 gives confusing error message > > Hi! > > Calling string:substr/2 with erroneous arguments gives a > non-informative error message > > (w@REDACTED)1> string:substr([], 2). > ** exception error: no function clause matching string:substr2([],2) > > Shouldn't it be badarg instead, or something similar? > > Also, the strings module documentation doesn't mention what are the > cases when the function will fail. (A quick glance shows that there > are other functions in the same situation). > > best regards, > Vlad > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From valentin@REDACTED Fri Dec 5 17:12:43 2008 From: valentin@REDACTED (Valentin Micic) Date: Fri, 5 Dec 2008 18:12:43 +0200 Subject: [erlang-questions] string:substr/2 gives confusing error message References: <200812051435.mB5EZHKn029649@mail.pharos-avantgard.com> <1228488717.24134.1.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> Message-ID: <2C4433DF8D4C465082F5B12FC94B4855@moneymaker2> Not for high enough value of 0 ;-))). V. ----- Original Message ----- From: "Bengt Kleberg" Cc: "''erlang-questions'" Sent: Friday, December 05, 2008 4:51 PM Subject: Re: [erlang-questions] string:substr/2 gives confusing error message > Greetings, > > Is not ``0 div N = 0'' an error for N equal to 0? > > > bengt > > On Fri, 2008-12-05 at 16:36 +0200, Valentin Micic wrote: >> The way I see it, you?re doing a right thing ? returning an empty >> string. It is just a matter of covering another pattern: substr( [], >> N ) -> []. Unless you want to argue that 0 div N = 0 is an error? J >> >> >> >> V. >> >> >> >> >> ______________________________________________________________________ >> From: Robert Virding [mailto:rvirding@REDACTED] >> Sent: 05 December 2008 03:51 PM >> To: Valentin Micic >> Cc: Vlad Dumitrescu; erlang-questions >> Subject: Re: [erlang-questions] string:substr/2 gives confusing error >> message >> >> >> >> >> I think in cases like this you will find that the person who wrote the >> module (me most likely) was just trying to be kind and return >> something "sensible" if the arguments are of the right type and not >> too crazy. Like asking for more characters from a list than exists. >> >> I have now thought this over and come to the conclusion that you >> probably shouldn't be kind but generate an error in these situations. >> Being kind will often come back and bite you later in an unpleasant >> way. >> >> I personally don't see any problem with a function_clause error as >> these means that there was a bad argument. It could be helpful if the >> error came from the function which is called, but as long as it comes >> from a function which is cleary related to the call, as in this case, >> I don't worry about it. >> >> How to return errors is a difficult problem. If you catch them at a >> higher level how do you then return a helpful error? And helpful fo >> whom? >> >> Robert >> >> 2008/12/5 Valentin Micic >> >> I think that depends how you want to look at it... >> One may argue that >> string:substr([], 2 ) >> does not make much sense as a statement, but then, I'd say that: >> string:substr("1", 2 ) >> does not make to much sense either, and yet it returns []. >> IMO, both functions should behave the same way, and to be pragmatic, >> return >> an empty list (not a badarg exception). >> >> V. >> >> >> >> -----Original Message----- >> From: erlang-questions-bounces@REDACTED >> [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Vlad >> Dumitrescu >> Sent: 05 December 2008 12:12 PM >> To: erlang-questions >> Subject: [erlang-questions] string:substr/2 gives confusing error >> message >> >> Hi! >> >> Calling string:substr/2 with erroneous arguments gives a >> non-informative error message >> >> (w@REDACTED)1> string:substr([], 2). >> ** exception error: no function clause matching string:substr2([],2) >> >> Shouldn't it be badarg instead, or something similar? >> >> Also, the strings module documentation doesn't mention what are the >> cases when the function will fail. (A quick glance shows that there >> are other functions in the same situation). >> >> best regards, >> Vlad >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From enrico.thierbach@REDACTED Fri Dec 5 18:55:59 2008 From: enrico.thierbach@REDACTED (Enrico Thierbach) Date: Fri, 5 Dec 2008 18:55:59 +0100 Subject: [erlang-questions] Jason In-Reply-To: <7c9d57ea0812030215t4967da39p7b13e71482dde952@mail.gmail.com> References: <3dbc6d1c0811231115y565a6670p173226976c5dd150@mail.gmail.com> <7c9d57ea0812030215t4967da39p7b13e71482dde952@mail.gmail.com> Message-ID: Hey sargun, short answers: - I don't know - yes - no, not yet. However, the situation on the third point is likely to improve over the weekend. I will post updates on my status here. And if you want to help: you are very much welcome :) /eno (PS: The quckest way to reach me is not at my googlemail address, but at eno@REDACTED) ==================================================================== A wee piece of ruby every monday: http://1rad.wordpress.com/ From marcsugiyama@REDACTED Fri Dec 5 20:26:26 2008 From: marcsugiyama@REDACTED (Marc Sugiyama) Date: Fri, 5 Dec 2008 11:26:26 -0800 Subject: [erlang-questions] initial target system, code:is_module_native() says false for native modules Message-ID: I'm trying to figure out if my code is running in native mode (hipe). I've compiled the .erls using -smp +native. When I load the modules manually in the erl shell with l(), or start the application from the shell using application:start(), code:is_module_native() for a module in the application returns true. If I build an initial target system for my application using the same .beam files and start it, code:is_module_native() on modules in the application returns false. If I manually load the same modules with l() in initial target system, code:is_module_native() then returns true. >From my performance benchmarks, I'm pretty sure that the application running in the initial target system is using native mode code on initial startup, but I'd feel more assured if code:is_module_native() also returned true. This would certainly make it easier to tell if the build was done properly. Is there something special I should be doing when I create the initial target system with native .beam files? Is code:is_module_native() returning the wrong value for initial target systems? From ahmed.nawras@REDACTED Sat Dec 6 15:31:56 2008 From: ahmed.nawras@REDACTED (Ahmed Ali) Date: Sat, 6 Dec 2008 18:31:56 +0400 Subject: [erlang-questions] Current time in milliseconds Message-ID: Hi List, I'd like to get the current time in milliseconds. I've been looking around but couldn't find a way to do this in Erlang. Can anyone please help? Best regards, Ahmed From stonecypher@REDACTED Sat Dec 6 22:01:02 2008 From: stonecypher@REDACTED (John Haugeland) Date: Sat, 6 Dec 2008 14:01:02 -0700 Subject: [erlang-questions] EEP18 Considered Harmful, With Examples: An opinion rejecting EEP 18 Message-ID: <8f24f4b10812061301l5ea91c5ck9084a29bde18daf7@mail.gmail.com> I apologize for not moving faster. I thought I had more time. It is my strong belief that EEP 18 is for many reasons critically flawed, and must not be introduced into the language as BIFs. I have been working on a contrary approach library, called scjson, because I was going to submit an EEP when I had actually implemented something and thus understood the various problems involved. Erlang and JSON offer different fundamental datatypes, and attempting to represent one as the other is significantly dangerous. This should also serve as an exposition of my opinion that EEPs should not be accepted prior to an existing implementation. An implementation of EEP18 would have exposed what I believe are serious flaws in its design. It is my belief that things like this should _always_ be a module first, if not just permanently - we are able to replace, for example, the regular expression system without violating backwards compatability because it is a module. If this was being done as a module, then the other JSON author and I could engage in healthy competition the way that YAWS does with Mochiweb. Introducing this into the language takes the early position that the first approach we've considered is correct enough to be the permanent, irreplaceable default. I suspect many here would agree that it's a good thing that regular expressions were not approached as BIFs. At this time I have not yet sufficiently documented my beliefs regarding the problems with 18. However, here is a quick overview: 1) http://sc.tri-bit.com/outgoing/scjson%20parser%20halp.html 2) http://fullof.bs/prototype-eep-18-considered-harmful-the-problems-with-erlang-to-json-term-translation There is one primary branch of concern which I have not yet come to in either of those documents: JSON explicitly requires, and frequently relies on in the wild, unicode support. Unicode in turn requires UTF-8 support. There is a way to attack the parser halp document by artificially restricting all strings to being binary strings, and assuming all lists to not be strings ever (something which would have painful consequences to application design and interoperability). Taking this approach means that a supporting Erlang implementation would have to support UTF-8, with its varying width characters, in binaries, which would have a significant impact on available efficient approaches to string parsing. It is a performance nightmare in the making. Artificially discarding Erlang's primary string type to resolve some of the ambiguities makes the problem worse, not better. Unfortunately I have not had time to add that (or several other serious concerns) to the document. That one could undermine those documents, so I'm getting it out now; the rest will come with examples, since they're standalone concerns. I have been creating a library which uses an annotated representation which has an optional lossy downconversion, rather than pursuing what I see as the folly of native re-representation, but since I've been focussing on documenting scutil, it looks like I've fallen behind. The lossy downconversion is equally convenient to proposed BIFs, offers several configurability advantages, and most importantly, does not impede the unambiguous representation of every JSON term in full unicode. Please very seriously consider those two documents before proceeding with making EEP18 a permanent part of the language. It is quite possible that I'm wrong; if so I will of course apologize. However, I believe there are serious, dangerous, unnecessary issues here which can be resolved with a simple annotated representation, rather than trying to present JSON as native erlang terms. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahmed.nawras@REDACTED Sat Dec 6 15:46:01 2008 From: ahmed.nawras@REDACTED (Ahmed Ali) Date: Sat, 6 Dec 2008 18:46:01 +0400 Subject: [erlang-questions] Current time in milliseconds In-Reply-To: References: Message-ID: Hi, I found now() function which returns {MegaSecs, Secs, Microsecs}. Now the next question is what is MegaSecs? and is Microsecs value is the number of microseconds in this second or is it also since zero hour (00:00 GMT, January 1, 1970)? Best regards, Ahmed On Sat, Dec 6, 2008 at 6:31 PM, Ahmed Ali wrote: > Hi List, > > I'd like to get the current time in milliseconds. I've been looking > around but couldn't find a way to do this in Erlang. Can anyone please > help? > > Best regards, > > Ahmed > From me@REDACTED Sun Dec 7 10:25:01 2008 From: me@REDACTED (Essien Ita Essien) Date: Sun, 07 Dec 2008 10:25:01 +0100 Subject: [erlang-questions] Current time in milliseconds In-Reply-To: References: Message-ID: <493B966D.1020904@essienitaessien.com> Ahmed Ali wrote: > Hi, > > I found now() function which returns {MegaSecs, Secs, Microsecs}. Now > the next question is what is MegaSecs? and is Microsecs value is the > number of microseconds in this second or is it also since zero hour > (00:00 GMT, January 1, 1970)? You're correct, erlang:now() calculates the time from the epoch (00:00 GMT, January 1, 1970). The result {Megasecs, Secs, Microsecs} is just a fractional representation for convenience, and can be converted to seconds by: SecondsSinceEpoch = (Megasecs * 1000000) + Secs + (Microsecs / 1000000) Hope that helps. cheers, Essien > > Best regards, > Ahmed > > On Sat, Dec 6, 2008 at 6:31 PM, Ahmed Ali wrote: >> Hi List, >> >> I'd like to get the current time in milliseconds. I've been looking >> around but couldn't find a way to do this in Erlang. Can anyone please >> help? >> >> Best regards, >> >> Ahmed >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From tony@REDACTED Sun Dec 7 11:04:00 2008 From: tony@REDACTED (Tony Rogvall) Date: Sun, 7 Dec 2008 11:04:00 +0100 Subject: [erlang-questions] Current time in milliseconds In-Reply-To: References: Message-ID: erlang:now() returns number of micro seconds since Jan 1970 but it's encoded into a 3-tuple. MegaSes is seconds*100000. When the first Erlang system was built we had no bignums so we had to encode the data using 28 bit integers. That is the reason why we had to use the Mega seconds part. This is of course not the reason why we still keep the erlang:now function as it has always been ;-) To convert a now "stamp" into micro seconds you could do: now_us({MegaSecs,Secs,MicroSecs}) -> (MegaSecs*1000000 + Secs)*1000000 + MicroSecs. /Tony On 6 dec 2008, at 15.46, Ahmed Ali wrote: > Hi, > > I found now() function which returns {MegaSecs, Secs, Microsecs}. Now > the next question is what is MegaSecs? and is Microsecs value is the > number of microseconds in this second or is it also since zero hour > (00:00 GMT, January 1, 1970)? > > Best regards, > Ahmed > > On Sat, Dec 6, 2008 at 6:31 PM, Ahmed Ali > wrote: >> Hi List, >> >> I'd like to get the current time in milliseconds. I've been looking >> around but couldn't find a way to do this in Erlang. Can anyone >> please >> help? >> >> Best regards, >> >> Ahmed >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From mazen.harake@REDACTED Sun Dec 7 11:14:09 2008 From: mazen.harake@REDACTED (Mazen Harake) Date: Sun, 07 Dec 2008 12:14:09 +0200 Subject: [erlang-questions] Current time in milliseconds In-Reply-To: References: Message-ID: <493BA1F1.1070703@erlang-consulting.com> All three fields represent 1 single time down to Microsecs precision, this means that Microsecs shows how many microseconds in the current second and how many seconds into megaseconds... megasecond is just a way to say 1,000,000 seconds. /Mazen Ahmed Ali wrote: > Hi, > > I found now() function which returns {MegaSecs, Secs, Microsecs}. Now > the next question is what is MegaSecs? and is Microsecs value is the > number of microseconds in this second or is it also since zero hour > (00:00 GMT, January 1, 1970)? > > Best regards, > Ahmed > > On Sat, Dec 6, 2008 at 6:31 PM, Ahmed Ali wrote: > >> Hi List, >> >> I'd like to get the current time in milliseconds. I've been looking >> around but couldn't find a way to do this in Erlang. Can anyone please >> help? >> >> Best regards, >> >> Ahmed >> >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From rvirding@REDACTED Sun Dec 7 17:02:22 2008 From: rvirding@REDACTED (Robert Virding) Date: Sun, 7 Dec 2008 17:02:22 +0100 Subject: [erlang-questions] Current time in milliseconds In-Reply-To: References: Message-ID: <3dbc6d1c0812070802q607568bbpe70f8d72d295ef35@mail.gmail.com> Basically Megasecs*1000000 + Secs is the number of seconds from 1/1/1970. So just now I got 1> now(). {1228,665491,453000} 2> (1228*1000000+655491)/(60*60*24*365). 38.960410039320145 which gives us 38.9 yrs from 1/1/1970. Microsecs is, of course, the number of micro secs in this seconds. Robert 2008/12/6 Ahmed Ali > Hi, > > I found now() function which returns {MegaSecs, Secs, Microsecs}. Now > the next question is what is MegaSecs? and is Microsecs value is the > number of microseconds in this second or is it also since zero hour > (00:00 GMT, January 1, 1970)? > > Best regards, > Ahmed > > On Sat, Dec 6, 2008 at 6:31 PM, Ahmed Ali wrote: > > Hi List, > > > > I'd like to get the current time in milliseconds. I've been looking > > around but couldn't find a way to do this in Erlang. Can anyone please > > help? > > > > Best regards, > > > > Ahmed > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From klacke@REDACTED Sun Dec 7 23:57:29 2008 From: klacke@REDACTED (=?ISO-8859-1?Q?Claes_Wikstr=F6m?=) Date: Sun, 07 Dec 2008 23:57:29 +0100 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <87skp69phl.fsf@sterlett.hq.kred> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> <87skp69phl.fsf@sterlett.hq.kred> Message-ID: <493C54D9.8020008@hyber.org> mats cronqvist wrote: > "Felix Hamilton" writes: > >> I have used NTP (the Network Time Protocol) quite effectively to sync >> timestamps in widely distributed systems with a fairly high degree of >> accuracy. > > i personally would not bet a dirty sock on ordering events by time > stamps (in a distributed system). and for once Leslie Lamport seems > to agreewith me. > I think I would. In retrospect I think the worst part of mnesia (apart from the sucky dets module I once wrote) is how we chose to deal with partitioned networks. We should have chosen to rely on the system clock. For example if all nodes make a persistent note of when they lost contact with other nodes. Once they reunite they could compare timestamps, and also compare timestamps on the last committed transaction. In a vast majority of cases it would be possible to automatically chose a winner. Assuming the clocks on all involved hosts are sufficiently synchronized by NTP that is. Furthermore - since this only affects recovery after partitioning - this can still be added. /klacke From ok@REDACTED Mon Dec 8 00:14:36 2008 From: ok@REDACTED (Richard O'Keefe) Date: Mon, 8 Dec 2008 12:14:36 +1300 Subject: [erlang-questions] string:substr/2 gives confusing error message In-Reply-To: <3dbc6d1c0812050718l577885bekf735b9f1010e17fa@mail.gmail.com> References: <3dbc6d1c0812050550n26ea1f3q3667d4af8bca7f6@mail.gmail.com> <200812051435.mB5EZHKn029649@mail.pharos-avantgard.com> <3dbc6d1c0812050718l577885bekf735b9f1010e17fa@mail.gmail.com> Message-ID: On 6 Dec 2008, at 4:18 am, Robert Virding wrote: > Thinking some more and checking the code. Now substr/2 is defined as > > substr(String, StartPos) -> String. > > so substr returns the rest of string starting at StartPos. It's all in the way you say it. Something I did while I was a Masters student was to work through a complete APL-inspired algebra of sequences. It was typed up but never published, and I no longer have a copy. I can remember some of the basic ideas, one of which was that a *good* algebra of sequence would satisfy as many "intuitive" laws as exceptionlessly as possible. One such law is n .take s ++ n .drop s = s for ALL strings s and for ALL natural numbers n. You can't make it work quite this easily for negative n, though. Here .take is the APL up arrow and .drop is the APL down arrow. There are also laws m .take (n .take s) = min(m,n) .take s m .drop (n .drop s) = (m+n) .drop s for ALL strings s and for ALL non-negative m and n. I see substr(String, StartPos) as a painfully clumsy way to write (StartPos - 1) .drop String which means that it should be regarded as defined for ALL integers StartPos >= 1. > Logically this would mean that > > string:substr("a",2) -> [] > > is perfectly ok while > > string:substr("",2) > > should generate an error as there is no string starting at the > second element in the string. But substr/2 isn't talking about ELEMENTS at all; it is talking about SEGMENTS of strings, rather clumsily. The fact that there is no second element is quite irrelevant to the fact that 1 .drop "" is perfectly well defined. > Looking at substr/3 which is defined as > > substr(String, StartPos, Length) -> String. And this is just Length .take (StartPos-1) .drop String It's not just perfectly meaningful for all non-negative integers Length, all positive integers StartPos, and all lists String, it's much much easier to work with the algebra if you don't have strange exception cases all over the place. It's bad enough that the library should be using a way of identifying segments that couldn't have been better designed to induce off-by-one-errors; there's no call for making it even harder to reason about. > But I do think that > > string:substr("",2) -> [] > > is being to kind and should generate an error. Nope. This is the unique right answer. drop(0, L) when is_list(L) -> L; drop(N, []) when is_integer(N), N > 0 -> []; drop(N, [H|T]) when is_integer(N), N > 0 -> drop(N-1, T). take(0, L) when is_list(L) -> []; take(N, []) when is_integer(N), N > 0 -> []; take(N, [H|T]) when is_integer(N), N > 0 -> [H | take(N-1, T)]; substr(L, I) -> drop(I-1, L). substr(L, I, N) -> take(N, drop(I-1, L)). (The original unpublished paper defined strings basically as functions, with take and drop being restriction combined with shifting. In effect, n .take s = s .restricted-to [1,n] and n .drop s = s .shifted n .restricted-to [1,infinity].) From bernie@REDACTED Mon Dec 8 04:13:57 2008 From: bernie@REDACTED (Bernard Duggan) Date: Mon, 08 Dec 2008 14:13:57 +1100 Subject: [erlang-questions] qlc join query results Message-ID: <493C90F5.6070408@m5net.com> Hi all, I'm hoping someone will be able to explain some interesting results we're getting when using qlc. Essentially, when we try to do what looks like a relatively simple "join" style operation, we're getting different results depending on the ordering of our generator terms, and we don't understand why. Here's some sample code that demonstrates the issue: ------------------------ post.erl ---------------------------- -module(post). -export([start/0]). -import(lists, [seq/2, map/2]). -import(io, [fwrite/1, fwrite/2]). -include_lib("stdlib/include/qlc.hrl"). -record(r1, {a, b}). -record(r2, {c, d}). start() -> % Start up mnesia and set up two tables, one for each record type ok = mnesia:start(), {atomic, ok} = mnesia:create_table(r1 , [{attributes, record_info(fields, r1)}]), {atomic, ok} = mnesia:create_table(r2 , [{attributes, record_info(fields, r2)}]), % Populate tables with mnesia:dirty_write(r1, #r1{a=1, b=1}), map( fun (N) -> ok = mnesia:dirty_write(r2, #r2{c=N, d=1}) end , lists:seq(1, 100) ), Query = fun(N, Q) -> case mnesia:transaction(fun() -> qlc:e(Q) end) of {atomic, L} -> fwrite("~s result = ~p entries\n", [N, length(L)]); Error -> fwrite("~s error: ~p\n", [N, Error]) end end,sam Query("join by field r1, r2" , qlc:q([ {X#r1.b, A#r2.d} || X <- mnesia:table(r1) , A <- mnesia:table(r2) , X#r1.b == A#r2.d ])), Query("join by field r2, r1" , qlc:q([ {X#r1.b, A#r2.d} || A <- mnesia:table(r2) , X <- mnesia:table(r1) , X#r1.b == A#r2.d ])), Query("join by field r1, r2 nested" , qlc:q([ {X#r1.b, A#r2.d} || X <- mnesia:table(r1) , A <- mnesia:table(r2) , X#r1.b == A#r2.d ], {join, nested_loop})), ok. ---------------------------------------------------------------- This produces the following output: join by field r1, r2 result = 2 entries join by field r2, r1 result = 100 entries join by field r1, r2 nested result = 100 entries The second and third lines are what we'd expect to get - the question is, why do we get two results from the first query? What exactly is it about that ordering of generators that causes qlc to choose a different join method and, in a more general sense, how can we predict which method will be chosen? Also, why exactly 2 results? I can understand 1 or 100, but 2? Thanks in advance, Bernard From bernie@REDACTED Mon Dec 8 05:40:12 2008 From: bernie@REDACTED (Bernard Duggan) Date: Mon, 08 Dec 2008 15:40:12 +1100 Subject: [erlang-questions] qlc join query results In-Reply-To: <493C90F5.6070408@m5net.com> References: <493C90F5.6070408@m5net.com> Message-ID: <493CA52C.9000205@m5net.com> Bernard Duggan wrote: > What exactly is it > about that ordering of generators that causes qlc to choose a different > join method and, in a more general sense, how can we predict which > method will be chosen? Whoops - on inspection of the results of qlc:info(), it appears both the first and second queries use the 'merge' join method. So my question above should in fact read "why does the 'merge' join method produce different results depending on the order of the generators?". Cheers, Bernard From masse@REDACTED Mon Dec 8 13:47:32 2008 From: masse@REDACTED (mats cronqvist) Date: Mon, 08 Dec 2008 13:47:32 +0100 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <493C54D9.8020008@hyber.org> ("Claes =?iso-8859-1?Q?Wikstr=F6?= =?iso-8859-1?Q?m=22's?= message of "Sun\, 07 Dec 2008 23\:57\:29 +0100") References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> Message-ID: <877i6aal5n.fsf@sterlett.hq.kred> Claes Wikstr?m writes: > mats cronqvist wrote: >> "Felix Hamilton" writes: >> >>> I have used NTP (the Network Time Protocol) quite effectively to sync >>> timestamps in widely distributed systems with a fairly high degree of >>> accuracy. >> >> i personally would not bet a dirty sock on ordering events by time >> stamps (in a distributed system). and for once Leslie Lamport seems >> to agreewith me. >> > > I think I would. In retrospect I think the worst part of mnesia (apart > from the sucky dets module I once wrote) is how we chose to deal with > partitioned networks. > > We should have chosen to rely on the system clock. For example if > all nodes make a persistent note of when they lost contact with other > nodes. Once they reunite they could compare timestamps, and also compare > timestamps on the last committed transaction. > In a vast majority of cases it would be possible to automatically chose > a winner. and what would happen in the small minority of cases? > Assuming the clocks on all involved hosts are sufficiently synchronized > by NTP that is. > > Furthermore - since this only affects recovery after partitioning - this > can still be added. > > > /klacke From chandrashekhar.mullaparthi@REDACTED Mon Dec 8 13:52:13 2008 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Mon, 8 Dec 2008 12:52:13 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <877i6aal5n.fsf@sterlett.hq.kred> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> <877i6aal5n.fsf@sterlett.hq.kred> Message-ID: 2008/12/8 mats cronqvist : > Claes Wikstr?m writes: > >> mats cronqvist wrote: >>> "Felix Hamilton" writes: >>> >>>> I have used NTP (the Network Time Protocol) quite effectively to sync >>>> timestamps in widely distributed systems with a fairly high degree of >>>> accuracy. >>> >>> i personally would not bet a dirty sock on ordering events by time >>> stamps (in a distributed system). and for once Leslie Lamport seems >>> to agreewith me. >>> >> >> I think I would. In retrospect I think the worst part of mnesia (apart >> from the sucky dets module I once wrote) is how we chose to deal with >> partitioned networks. >> >> We should have chosen to rely on the system clock. For example if >> all nodes make a persistent note of when they lost contact with other >> nodes. Once they reunite they could compare timestamps, and also compare >> timestamps on the last committed transaction. >> In a vast majority of cases it would be possible to automatically chose >> a winner. > > and what would happen in the small minority of cases? I presume it would be whatever happens today -- nothing. Chandru From bengt.kleberg@REDACTED Mon Dec 8 14:42:39 2008 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 08 Dec 2008 14:42:39 +0100 Subject: [erlang-questions] Current time in milliseconds In-Reply-To: References: Message-ID: <1228743759.21800.20.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> Greetings, Please take a look at the calendar module (). Especially local_time/0 and datetime_to_gregorian_seconds/1 bengt On Sat, 2008-12-06 at 18:31 +0400, Ahmed Ali wrote: > Hi List, > > I'd like to get the current time in milliseconds. I've been looking > around but couldn't find a way to do this in Erlang. Can anyone please > help? > > Best regards, > > Ahmed > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From Rainer.Hansen@REDACTED Mon Dec 8 15:22:30 2008 From: Rainer.Hansen@REDACTED (Rainer Hansen) Date: Mon, 08 Dec 2008 15:22:30 +0100 Subject: [erlang-questions] Aachen-Euskirchen-Bonn (Germany) Erlounge on Wednesday Message-ID: <20081208142230.262940@gmx.net> Welcome to the Aachen-Euskirchen-Bonn Erlounge taking place in the Parkhotel in Euskirchen. We meet at 19:00 o'clock on December 10th, 2008. All Erlang developers and users are welcome to meet each other and talk about what you are doing. One special topic will be the Erlang User Conference that took place in November. Homepage of Parkhotel Euskirchen: http://www.parkhotel-euskirchen.com/ You can get driving instructions by just typing Parkhotel Euskirchen into the Google search bar. The Parkhotel is very good to reach by public transport because it is opposite to the bus and train station in Euskirchen. Don't hesitate to contact me if you've got any questions or comments. Rainer Hansen -- Sensationsangebot verl?ngert: GMX FreeDSL - Telefonanschluss + DSL f?r nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a From fdeserres@REDACTED Mon Dec 8 15:25:12 2008 From: fdeserres@REDACTED (Francois De Serres) Date: Mon, 08 Dec 2008 15:25:12 +0100 Subject: [erlang-questions] Build failing on Ubuntu 8.10 In-Reply-To: <1228743759.21800.20.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> References: <1228743759.21800.20.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> Message-ID: <20081208142512.58190@gmx.net> Hi there, I am trying to build the latest release on Ubuntu 8.10, using a --prefix=/home/... ./configure fails with the error below. I tried to install more ncurses libs but it did not help. Can someone please advise? Thanks, -- Fran?ois [...] checking whether the child waiter thread should be enabled... yes on SMP build, but not on non-SMP build checking for tgetent in -lncurses... no checking for tgetent in -lcurses... no checking for tgetent in -ltermcap... no checking for tgetent in -ltermlib... no configure: error: No curses library functions found configure: error: /bin/bash '/home/fdeserres/tmp/otp_src_R12B-5/erts/configure' failed for erts -- Psssst! Schon vom neuen GMX MultiMessenger geh?rt? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger From gleber.p@REDACTED Mon Dec 8 15:33:13 2008 From: gleber.p@REDACTED (Gleb Peregud) Date: Mon, 8 Dec 2008 15:33:13 +0100 Subject: [erlang-questions] Build failing on Ubuntu 8.10 In-Reply-To: <20081208142512.58190@gmx.net> References: <1228743759.21800.20.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> <20081208142512.58190@gmx.net> Message-ID: <14f0e3620812080633j3e35a0a5y16713b79651cb636@mail.gmail.com> Your system is missing curses library. Probably sudo apt-get install libncurses5-dev will fix this Gleb Peregud http://gleber.pl/ Every minute is to be grasped. Time waits for nobody. -- Inscription on a Zen Gong On Mon, Dec 8, 2008 at 3:25 PM, Francois De Serres wrote: > Hi there, > > I am trying to build the latest release on Ubuntu 8.10, using a --prefix=/home/... > ./configure fails with the error below. > I tried to install more ncurses libs but it did not help. > > Can someone please advise? > > Thanks, > -- > Fran?ois > > [...] > checking whether the child waiter thread should be enabled... yes on SMP build, but not on non-SMP build > checking for tgetent in -lncurses... no > checking for tgetent in -lcurses... no > checking for tgetent in -ltermcap... no > checking for tgetent in -ltermlib... no > configure: error: No curses library functions found > configure: error: /bin/bash '/home/fdeserres/tmp/otp_src_R12B-5/erts/configure' failed for erts > > -- > Psssst! Schon vom neuen GMX MultiMessenger geh?rt? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From raimo+erlang-questions@REDACTED Mon Dec 8 15:42:27 2008 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Mon, 8 Dec 2008 15:42:27 +0100 Subject: [erlang-questions] Build failing on Ubuntu 8.10 In-Reply-To: <20081208142512.58190@gmx.net> References: <1228743759.21800.20.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> <20081208142512.58190@gmx.net> Message-ID: <20081208144227.GA12885@erix.ericsson.se> On Mon, Dec 08, 2008 at 03:25:12PM +0100, Francois De Serres wrote: > Hi there, > > I am trying to build the latest release on Ubuntu 8.10, using a --prefix=/home/... > ./configure fails with the error below. > I tried to install more ncurses libs but it did not help. Have you tried ncurses-devel? > > Can someone please advise? > > Thanks, > -- > Fran?ois > > [...] > checking whether the child waiter thread should be enabled... yes on SMP build, but not on non-SMP build > checking for tgetent in -lncurses... no > checking for tgetent in -lcurses... no > checking for tgetent in -ltermcap... no > checking for tgetent in -ltermlib... no > configure: error: No curses library functions found > configure: error: /bin/bash '/home/fdeserres/tmp/otp_src_R12B-5/erts/configure' failed for erts > > -- > Psssst! Schon vom neuen GMX MultiMessenger geh?rt? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From sverker@REDACTED Mon Dec 8 15:46:32 2008 From: sverker@REDACTED (Sverker Eriksson) Date: Mon, 08 Dec 2008 15:46:32 +0100 Subject: [erlang-questions] Build failing on Ubuntu 8.10 In-Reply-To: <20081208142512.58190@gmx.net> References: <1228743759.21800.20.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> <20081208142512.58190@gmx.net> Message-ID: <493D3348.3070107@erix.ericsson.se> Francois De Serres wrote: > I am trying to build the latest release on Ubuntu 8.10, using a --prefix=/home/... > ./configure fails with the error below. : > checking for tgetent in -lncurses... no > checking for tgetent in -lcurses... no > checking for tgetent in -ltermcap... no > checking for tgetent in -ltermlib... no > configure: error: No curses library functions found > There is a configure option --without-termcap, if you want to try without that feature. It will give you a more primitive shell interaction. /Sverker, Erlang/OTP From masse@REDACTED Mon Dec 8 15:47:30 2008 From: masse@REDACTED (mats cronqvist) Date: Mon, 08 Dec 2008 15:47:30 +0100 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: (Chandru's message of "Mon\, 8 Dec 2008 12\:52\:13 +0000") References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> <877i6aal5n.fsf@sterlett.hq.kred> Message-ID: <87ljuqoha5.fsf@sterlett.hq.kred> Chandru writes: > 2008/12/8 mats cronqvist : >> Claes Wikstr?m writes: >> >>> mats cronqvist wrote: >>>> "Felix Hamilton" writes: >>>> >>>>> I have used NTP (the Network Time Protocol) quite effectively to sync >>>>> timestamps in widely distributed systems with a fairly high degree of >>>>> accuracy. >>>> >>>> i personally would not bet a dirty sock on ordering events by time >>>> stamps (in a distributed system). and for once Leslie Lamport seems >>>> to agreewith me. >>>> >>> >>> I think I would. In retrospect I think the worst part of mnesia (apart >>> from the sucky dets module I once wrote) is how we chose to deal with >>> partitioned networks. >>> >>> We should have chosen to rely on the system clock. For example if >>> all nodes make a persistent note of when they lost contact with other >>> nodes. Once they reunite they could compare timestamps, and also compare >>> timestamps on the last committed transaction. >>> In a vast majority of cases it would be possible to automatically chose >>> a winner. >> >> and what would happen in the small minority of cases? > > I presume it would be whatever happens today -- nothing. that would be nice. but i was kind of assuming that everyone would reach the same conclusion as I; we pick the wrong winner. From mikpe@REDACTED Mon Dec 8 15:50:25 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 8 Dec 2008 15:50:25 +0100 Subject: [erlang-questions] Build failing on Ubuntu 8.10 In-Reply-To: <20081208142512.58190@gmx.net> References: <1228743759.21800.20.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> <20081208142512.58190@gmx.net> Message-ID: <18749.13361.797587.863358@harpo.it.uu.se> Francois De Serres writes: > Hi there, > > I am trying to build the latest release on Ubuntu 8.10, using a --prefix=/home/... > ./configure fails with the error below. > I tried to install more ncurses libs but it did not help. > > Can someone please advise? > > Thanks, > -- > Fran?ois > > [...] > checking whether the child waiter thread should be enabled... yes on SMP build, but not on non-SMP build > checking for tgetent in -lncurses... no > checking for tgetent in -lcurses... no > checking for tgetent in -ltermcap... no > checking for tgetent in -ltermlib... no > configure: error: No curses library functions found > configure: error: /bin/bash '/home/fdeserres/tmp/otp_src_R12B-5/erts/configure' failed for erts Presumably you only installed the ncurses runtime libraries? To build Erlang you also need the development libraries. (No I don't know what they're called on Ubuntu. ncurses-devel perhaps?) From joelr1@REDACTED Mon Dec 8 15:55:48 2008 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 8 Dec 2008 14:55:48 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <493C54D9.8020008@hyber.org> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> Message-ID: <45F80B9D-6F93-430D-B64E-895EEAE453B2@gmail.com> On Dec 7, 2008, at 10:57 PM, Claes Wikstr?m wrote: > Assuming the clocks on all involved hosts are sufficiently > synchronized > by NTP that is. Does this matter if all the nodes are aware of the clocks of all the other nodes? -- http://wagerlabs.com From harveyd@REDACTED Mon Dec 8 16:00:06 2008 From: harveyd@REDACTED (Dale Harvey) Date: Mon, 8 Dec 2008 15:00:06 +0000 Subject: [erlang-questions] Build failing on Ubuntu 8.10 In-Reply-To: <18749.13361.797587.863358@harpo.it.uu.se> References: <1228743759.21800.20.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> <20081208142512.58190@gmx.net> <18749.13361.797587.863358@harpo.it.uu.se> Message-ID: $sudo apt-get build-dep erlang $sudo apt-get install tk That will get all the dependancies for you 2008/12/8 Mikael Pettersson > Francois De Serres writes: > > Hi there, > > > > I am trying to build the latest release on Ubuntu 8.10, using a > --prefix=/home/... > > ./configure fails with the error below. > > I tried to install more ncurses libs but it did not help. > > > > Can someone please advise? > > > > Thanks, > > -- > > Fran?ois > > > > [...] > > checking whether the child waiter thread should be enabled... yes on SMP > build, but not on non-SMP build > > checking for tgetent in -lncurses... no > > checking for tgetent in -lcurses... no > > checking for tgetent in -ltermcap... no > > checking for tgetent in -ltermlib... no > > configure: error: No curses library functions found > > configure: error: /bin/bash > '/home/fdeserres/tmp/otp_src_R12B-5/erts/configure' failed for erts > > Presumably you only installed the ncurses runtime libraries? > To build Erlang you also need the development libraries. > (No I don't know what they're called on Ubuntu. ncurses-devel perhaps?) > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fdeserres@REDACTED Mon Dec 8 16:08:09 2008 From: fdeserres@REDACTED (Francois De Serres) Date: Mon, 08 Dec 2008 16:08:09 +0100 Subject: [erlang-questions] Fixed: Build failing on Ubuntu 8.10 In-Reply-To: References: <1228743759.21800.20.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> <20081208142512.58190@gmx.net> <18749.13361.797587.863358@harpo.it.uu.se> Message-ID: <20081208150809.58210@gmx.net> Thank you Mikael, it helped. Thanks to all, -- Fran?ois > $sudo apt-get build-dep erlang > $sudo apt-get install tk > > That will get all the dependancies for you > > 2008/12/8 Mikael Pettersson > > > Francois De Serres writes: > > > Hi there, > > > > > > I am trying to build the latest release on Ubuntu 8.10, using a > > --prefix=/home/... > > > ./configure fails with the error below. > > > I tried to install more ncurses libs but it did not help. > > > > > > Can someone please advise? > > > > > > Thanks, > > > -- > > > Fran?ois > > > > > > [...] > > > checking whether the child waiter thread should be enabled... yes on > SMP > > build, but not on non-SMP build > > > checking for tgetent in -lncurses... no > > > checking for tgetent in -lcurses... no > > > checking for tgetent in -ltermcap... no > > > checking for tgetent in -ltermlib... no > > > configure: error: No curses library functions found > > > configure: error: /bin/bash > > '/home/fdeserres/tmp/otp_src_R12B-5/erts/configure' failed for erts > > > > Presumably you only installed the ncurses runtime libraries? > > To build Erlang you also need the development libraries. > > (No I don't know what they're called on Ubuntu. ncurses-devel perhaps?) > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- Psssst! Schon vom neuen GMX MultiMessenger geh?rt? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger From joelr1@REDACTED Mon Dec 8 16:27:38 2008 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 8 Dec 2008 15:27:38 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <874p1evggh.fsf@sterlett.hq.kred> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> <45F80B9D-6F93-430D-B64E-895EEAE453B2@gmail.com> <874p1evggh.fsf@sterlett.hq.kred> Message-ID: <539A1985-F49C-4433-98B7-3890FC9326C0@gmail.com> On Dec 8, 2008, at 3:23 PM, mats cronqvist wrote: >> Does this matter if all the nodes are aware of the clocks of all the >> other nodes? > > isn't that the same thing as saying that network partitioning is > not a problem as long as the network is not partitioned? I mean to say that if I am node A and I know what the clock is on nodes B, C and D then it doesn't matter if our clocks aren't perfectly synchronized by NTP. I will know the skew and once node D splits off and rejoins, I'll be able to compare the timestamp on my transactions vs those on node D using that skew. -- http://wagerlabs.com From klacke@REDACTED Mon Dec 8 16:30:20 2008 From: klacke@REDACTED (Claes Wikstrom) Date: Mon, 08 Dec 2008 16:30:20 +0100 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <877i6aal5n.fsf@sterlett.hq.kred> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> <877i6aal5n.fsf@sterlett.hq.kred> Message-ID: <493D3D8C.1010807@hyber.org> mats cronqvist wrote: > and what would happen in the small minority of cases? > If the clocks are sufficiently close - the minority would be so small so that it can be ignored. What will your HA computer system do if suddenly both HA components in your HA system fails. Or all three. /klacke From klacke@REDACTED Mon Dec 8 16:31:57 2008 From: klacke@REDACTED (Claes Wikstrom) Date: Mon, 08 Dec 2008 16:31:57 +0100 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <539A1985-F49C-4433-98B7-3890FC9326C0@gmail.com> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> <45F80B9D-6F93-430D-B64E-895EEAE453B2@gmail.com> <874p1evggh.fsf@sterlett.hq.kred> <539A1985-F49C-4433-98B7-3890FC9326C0@gmail.com> Message-ID: <493D3DED.4060504@hyber.org> Joel Reymont wrote: > > > I mean to say that if I am node A and I know what the clock is on nodes > B, C and D then it doesn't matter if our clocks aren't perfectly > synchronized by NTP. I will know the skew and once node D splits off and > rejoins, I'll be able to compare the timestamp on my transactions vs > those on node D using that skew. > No, /klacke From joelr1@REDACTED Mon Dec 8 16:36:04 2008 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 8 Dec 2008 15:36:04 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <493D3DED.4060504@hyber.org> References: <915e7e1d0812020918h65094cd6wf6b0df084daab02a@mail.gmail.com> <2D37D6D7-0E95-4586-A9DD-8AEFB9E69B9B@gmail.com> <4F6DF5534F9C41E4B74F9993517D7068@SSI.CORP> <215E9A69-57D9-44C2-A8D6-457253550400@gmail.com> <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> <45F80B9D-6F93-430D-B64E-895EEAE453B2@gmail.com> <874p1evggh.fsf@sterlett.hq.kred> <539A1985-F49C-4433-98B7-3890FC9326C0@gmail.com> <493D3DED.4060504@hyber.org> Message-ID: On Dec 8, 2008, at 3:31 PM, Claes Wikstrom wrote: > Joel Reymont wrote: >> >> I mean to say that if I am node A and I know what the clock is on >> nodes B, C and D then it doesn't matter if our clocks aren't >> perfectly synchronized by NTP. I will know the skew and once node D >> splits off and rejoins, I'll be able to compare the timestamp on my >> transactions vs those on node D using that skew. > > No, Why? -- http://wagerlabs.com From rick.richardson@REDACTED Mon Dec 8 17:41:15 2008 From: rick.richardson@REDACTED (Rick R) Date: Mon, 8 Dec 2008 11:41:15 -0500 Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December 2008) In-Reply-To: References: <8474074A-8F5A-452C-905E-52A1D320AF4E@patternmatched.com> <449398.6638.qm@web31504.mail.mud.yahoo.com> <9810b81b0812021239i6d634b0bke9b48367873fdb34@mail.gmail.com> <8ec76080812021306l6d965c4ao4716224b606ab628@mail.gmail.com> Message-ID: <9810b81b0812080841u5983a347u5a07c337ba8b9eed@mail.gmail.com> There are a few people from the NYC:Erlang group that have expressed interest. (which may or may not have responded in this forum) Does anyone have an idea for a location? Suspenders [ http://www.yelp.com/biz/suspenders-bar-and-restaurant-new-york ] was mentioned since they have a backroom with a video projector. Anyone else have suggestions for a venue? If not I will will try to track down a place. On Wed, Dec 3, 2008 at 10:07 AM, joshuajnoble wrote: > > I'd be interested as well, as long as it's mid-town/downtown-ish. I > guess that puts us at ~6 attendees. > > On Dec 2, 4:06 pm, "Whit Armstrong" wrote: > > count me in as long as it's somewhere close to mid-town. > > > > -Whit > > > > 2008/12/2 Rick R : > > > > > I'm very interested. > > > > > On Tue, Dec 2, 2008 at 12:41 PM, Vat Raghavan < > machinshin2...@REDACTED> > > > wrote: > > > > >> Thought would be great! I recently moved to New York and i've love to > meet > > >> local Erlang-ers :) > > > > >> --vat > > > > >> ----.signature---- > > >> Without the hope that things will get better, > > >> that our inheritors will know a world that is fuller and richer than > our > > >> own, > > >> life is pointless, and evolution is vastly overrated > > >> -- Delenn > > > > >> ----- Original Message ---- > > >> From: Rudolph van Graan > > >> To: Erlang Questions > > >> Sent: Tuesday, December 2, 2008 4:45:24 AM > > >> Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December > > >> 2008) > > > > >> Hi, > > > > >> Anybody up for an Erlounge somewhere in New York next week? I will be > > >> in town from Wednesday. > > > > >> Rudolph van Graan > > > > >> Pattern Matched Technologies > > > > >> E-Mail: r...@REDACTED > > >> Tel: 086 1000 700 (SA Only) > > >> Mobile: +27 83 390 7767 > > >> Fax: +27 12 665 9566 > > >> Web: www.patternmatched.com > > > > >> _______________________________________________ > > >> erlang-questions mailing list > > >> erlang-questi...@REDACTED > > >>http://www.erlang.org/mailman/listinfo/erlang-questions > > > > >> _______________________________________________ > > >> erlang-questions mailing list > > >> erlang-questi...@REDACTED > > >>http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questi...@REDACTED > > >http://www.erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questi...@REDACTED:// > www.erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From atomly-erl@REDACTED Mon Dec 8 18:15:59 2008 From: atomly-erl@REDACTED (atomly) Date: Mon, 8 Dec 2008 12:15:59 -0500 Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December 2008) In-Reply-To: <9810b81b0812080841u5983a347u5a07c337ba8b9eed@mail.gmail.com> References: <8474074A-8F5A-452C-905E-52A1D320AF4E@patternmatched.com> <449398.6638.qm@web31504.mail.mud.yahoo.com> <9810b81b0812021239i6d634b0bke9b48367873fdb34@mail.gmail.com> <8ec76080812021306l6d965c4ao4716224b606ab628@mail.gmail.com> <9810b81b0812080841u5983a347u5a07c337ba8b9eed@mail.gmail.com> Message-ID: <20081208171559.GN2448@atomly.com> I'm definitely interested... Please keep us posted on details and I'll try my hardest to make it. [Rick R ] > > There are a few people from the NYC:Erlang group that have expressed > interest. (which may or may not have responded in this forum) > Does anyone have an idea for a location? Suspenders > [ [1]http://www.yelp.com/biz/suspenders-bar-and-restaurant-new-york > ] > > [2]was mentioned since they have a backroom with a video projector. > Anyone else have suggestions for a venue? If not I will will try to > track down a place. > On Wed, Dec 3, 2008 at 10:07 AM, joshuajnoble > <[3]joshuajnoble@REDACTED> wrote: > > I'd be interested as well, as long as it's mid-town/downtown-ish. I > guess that puts us at ~6 attendees. > > On Dec 2, 4:06 pm, "Whit Armstrong" <[4]armstrong.w...@REDACTED> > wrote: > > count me in as long as it's somewhere close to mid-town. > > > > -Whit > > > > > 2008/12/2 Rick R <[5]rick.richard...@REDACTED>: > > > > > I'm very interested. > > > > > On Tue, Dec 2, 2008 at 12:41 PM, Vat Raghavan > <[6]machinshin2...@REDACTED> > > > > wrote: > > > > >> Thought would be great! I recently moved to New York and i've > love to meet > > >> local Erlang-ers :) > > > > >> --vat > > > > >> ----.signature---- > > >> Without the hope that things will get better, > > >> that our inheritors will know a world that is fuller and richer > than our > > >> own, > > >> life is pointless, and evolution is vastly overrated > > >> -- Delenn > > > > >> ----- Original Message ---- > > > >> From: Rudolph van Graan <[7]r...@REDACTED> > > >> To: Erlang Questions <[8]erlang-questi...@REDACTED> > > >> Sent: Tuesday, December 2, 2008 4:45:24 AM > > >> Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 > December > > >> 2008) > > > > >> Hi, > > > > >> Anybody up for an Erlounge somewhere in New York next week? I > will be > > >> in town from Wednesday. > > > > >> Rudolph van Graan > > > > >> Pattern Matched Technologies > > > > > >> E-Mail: [9]r...@REDACTED > > > >> Tel: 086 1000 700 (SA Only) > > >> Mobile: +27 83 390 7767 > > >> Fax: +27 12 665 9566 > > >> Web: [10]www.patternmatched.com > > > > >> _______________________________________________ > > >> erlang-questions mailing list > > > >> [11]erlang-questi...@REDACTED > > > >>[12]http://www.erlang.org/mailman/listinfo/erlang-questions > > > > >> _______________________________________________ > > >> erlang-questions mailing list > > > >> [13]erlang-questi...@REDACTED > > > >>[14]http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > > > erlang-questions mailing list > > > > [15]erlang-questi...@REDACTED > > > >[16]http://www.erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > > erlang-questions mailing list > > > > erlang-questi...@REDACTED://[17]www.erlang.org/mailman/listin > fo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > [18]erlang-questions@REDACTED > [19]http://www.erlang.org/mailman/listinfo/erlang-questions > > References > > Visible links > 1. http://www.yelp.com/biz/suspenders-bar-and-restaurant-new-york > 2. http://www.yelp.com/biz/suspenders-bar-and-restaurant-new-york > 3. mailto:joshuajnoble@REDACTED > 4. mailto:armstrong.w...@REDACTED > 5. mailto:rick.richard...@REDACTED > 6. mailto:machinshin2...@REDACTED > 7. mailto:r...@REDACTED > 8. mailto:erlang-questi...@REDACTED > 9. mailto:r...@REDACTED > 10. http://www.patternmatched.com/ > 11. mailto:erlang-questi...@REDACTED > 12. http://www.erlang.org/mailman/listinfo/erlang-questions > 13. mailto:erlang-questi...@REDACTED > 14. http://www.erlang.org/mailman/listinfo/erlang-questions > 15. mailto:erlang-questi...@REDACTED > 16. http://www.erlang.org/mailman/listinfo/erlang-questions > 17. http://www.erlang.org/mailman/listinfo/erlang-questions > 18. mailto:erlang-questions@REDACTED > 19. http://www.erlang.org/mailman/listinfo/erlang-questions > > Hidden links: > 20. http://www.yelp.com/biz/suspenders-bar-and-restaurant-new-york > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- :: atomly :: [ atomly@REDACTED : www.atomly.com ... [ atomiq records : new york city : +1.917.442.9450 ... [ e-mail atomly-news-subscribe@REDACTED for atomly info and updates ... From jim.mccoy@REDACTED Mon Dec 8 18:19:42 2008 From: jim.mccoy@REDACTED (Jim McCoy) Date: Mon, 8 Dec 2008 09:19:42 -0800 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: References: <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> <45F80B9D-6F93-430D-B64E-895EEAE453B2@gmail.com> <874p1evggh.fsf@sterlett.hq.kred> <539A1985-F49C-4433-98B7-3890FC9326C0@gmail.com> <493D3DED.4060504@hyber.org> Message-ID: Vector clocks don't really work that way, you can only update the vectors at the point where messages pass between nodes. Using your example, if D splits off, reboots and has its clock reset slightly, records a few local transactions using this new clock, and then rejoins you will need to figure out how to order the local transactions with the state of the rest of the nodes. Consistence, availability, partition-tolerance: pick two. Simiarly, Claes is incorrect in assuming that you could use the system clock for anything other than printing a nice little display on the screen to remind the user that they have a meeting scheduled for some point in the near future. There is _a lot_ of literature out there on distributed transaction fault-tolerance and it gets pretty complex in a hurry. To maintain the current properties of mnesia I believe the only option would be to add some complexity on the mechanics of the join mechanism (e.g. a quorum system like paxos to decide membership and agreement among the nodes as to the minimum quorum below which a partitioned subset is read-only) and a bit of work to change a minority subset into read-only mode when a partition is discovered. On Mon, Dec 8, 2008 at 7:36 AM, Joel Reymont wrote: > > On Dec 8, 2008, at 3:31 PM, Claes Wikstrom wrote: > >> Joel Reymont wrote: >>> >>> I mean to say that if I am node A and I know what the clock is on >>> nodes B, C and D then it doesn't matter if our clocks aren't >>> perfectly synchronized by NTP. I will know the skew and once node D >>> splits off and rejoins, I'll be able to compare the timestamp on my >>> transactions vs those on node D using that skew. >> >> No, > > > Why? > > -- > http://wagerlabs.com > > > > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From joelr1@REDACTED Mon Dec 8 18:37:44 2008 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 8 Dec 2008 17:37:44 +0000 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: References: <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> <45F80B9D-6F93-430D-B64E-895EEAE453B2@gmail.com> <874p1evggh.fsf@sterlett.hq.kred> <539A1985-F49C-4433-98B7-3890FC9326C0@gmail.com> <493D3DED.4060504@hyber.org> Message-ID: <2FD56C1A-F362-4753-ABB8-47380A90F1D7@gmail.com> On Dec 8, 2008, at 5:19 PM, Jim McCoy wrote: > To maintain the current properties of mnesia I believe the only option > would be to add some complexity on the mechanics of the join mechanism > (e.g. a quorum system like paxos to decide membership and agreement > among the nodes as to the minimum quorum below which a partitioned > subset is read-only) and a bit of work to change a minority subset > into read-only mode when a partition is discovered. I'm willing to take a shot at the work, with proper instruction and guidance. I really really want a fix for this issue. I don't see how Mnesia can be used as the backend for an internet site otherwise. It's currently impossible to run an ecommerce or other internet site on top of Mnesia because of the split/rejoin issue. Please show me where I am mistaken. My understanding is that this issue can be dealt with in the telecom industry due to the transient nature of the data. I'm guessing that really important data always goes into Oracle, PostgreSQL, etc. Yes, I can use PostgreSQL or MySQL instead of Mnesia but then I have to deal with replication issues on that end. Does anyone know how other databases deal with network splits in a multi-master scenario? Thanks, Joel -- http://wagerlabs.com From bcully@REDACTED Mon Dec 8 20:14:49 2008 From: bcully@REDACTED (Brian Cully) Date: Mon, 8 Dec 2008 14:14:49 -0500 Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December 2008) In-Reply-To: <9810b81b0812080841u5983a347u5a07c337ba8b9eed@mail.gmail.com> References: <8474074A-8F5A-452C-905E-52A1D320AF4E@patternmatched.com> <449398.6638.qm@web31504.mail.mud.yahoo.com> <9810b81b0812021239i6d634b0bke9b48367873fdb34@mail.gmail.com> <8ec76080812021306l6d965c4ao4716224b606ab628@mail.gmail.com> <9810b81b0812080841u5983a347u5a07c337ba8b9eed@mail.gmail.com> Message-ID: <4081F020-F4CD-4FDE-ACED-56288118DA9F@gmail.com> Suspenders works for me. I attend NYCBUG meetings there every month or so, and the back room can accommodate a good 20 people comfortably. They do have a projector and power, too. Anything from the financial district to midtown is pretty reachable for me, as well, if Suspenders doesn't work out. -bjc On 8-Dec-2008, at 11:41, Rick R wrote: > There are a few people from the NYC:Erlang group that have expressed > interest. (which may or may not have responded in this forum) > Does anyone have an idea for a location? Suspenders [ http://www.yelp.com/biz/suspenders-bar-and-restaurant-new-york > ] > was mentioned since they have a backroom with a video projector. > Anyone else have suggestions for a venue? If not I will will try to > track down a place. > > On Wed, Dec 3, 2008 at 10:07 AM, joshuajnoble > wrote: > > I'd be interested as well, as long as it's mid-town/downtown-ish. I > guess that puts us at ~6 attendees. > > On Dec 2, 4:06 pm, "Whit Armstrong" wrote: > > count me in as long as it's somewhere close to mid-town. > > > > -Whit > > > > 2008/12/2 Rick R : > > > > > I'm very interested. > > > > > On Tue, Dec 2, 2008 at 12:41 PM, Vat Raghavan > > > > wrote: > > > > >> Thought would be great! I recently moved to New York and i've > love to meet > > >> local Erlang-ers :) > > > > >> --vat > > > > >> ----.signature---- > > >> Without the hope that things will get better, > > >> that our inheritors will know a world that is fuller and > richer than our > > >> own, > > >> life is pointless, and evolution is vastly overrated > > >> -- Delenn > > > > >> ----- Original Message ---- > > >> From: Rudolph van Graan > > >> To: Erlang Questions > > >> Sent: Tuesday, December 2, 2008 4:45:24 AM > > >> Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 > December > > >> 2008) > > > > >> Hi, > > > > >> Anybody up for an Erlounge somewhere in New York next week? I > will be > > >> in town from Wednesday. > > > > >> Rudolph van Graan > > > > >> Pattern Matched Technologies > > > > >> E-Mail: r...@REDACTED > > >> Tel: 086 1000 700 (SA Only) > > >> Mobile: +27 83 390 7767 > > >> Fax: +27 12 665 9566 > > >> Web: www.patternmatched.com > > > > >> _______________________________________________ > > >> erlang-questions mailing list > > >> erlang-questi...@REDACTED > > >>http://www.erlang.org/mailman/listinfo/erlang-questions > > > > >> _______________________________________________ > > >> erlang-questions mailing list > > >> erlang-questi...@REDACTED > > >>http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questi...@REDACTED > > >http://www.erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questi...@REDACTED://www.erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From rick.richardson@REDACTED Mon Dec 8 20:49:28 2008 From: rick.richardson@REDACTED (Rick R) Date: Mon, 8 Dec 2008 14:49:28 -0500 Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December 2008) In-Reply-To: <4081F020-F4CD-4FDE-ACED-56288118DA9F@gmail.com> References: <8474074A-8F5A-452C-905E-52A1D320AF4E@patternmatched.com> <449398.6638.qm@web31504.mail.mud.yahoo.com> <9810b81b0812021239i6d634b0bke9b48367873fdb34@mail.gmail.com> <8ec76080812021306l6d965c4ao4716224b606ab628@mail.gmail.com> <9810b81b0812080841u5983a347u5a07c337ba8b9eed@mail.gmail.com> <4081F020-F4CD-4FDE-ACED-56288118DA9F@gmail.com> Message-ID: <9810b81b0812081149l5646178dxb83e7121bb1430d2@mail.gmail.com> I tried to book Suspenders for Wednesday or Thursday but it was not available. I doubt the weekend will work given the proliferation of Holiday parties around that time. I have been trying in vain to find a similar venue. Anyone have any other ideas? On Mon, Dec 8, 2008 at 2:14 PM, Brian Cully wrote: > Suspenders works for me. I attend NYCBUG meetings there every month or so, > and the back room can accommodate a good 20 people comfortably. They do have > a projector and power, too. > Anything from the financial district to midtown is pretty reachable for me, > as well, if Suspenders doesn't work out. > -bjc > > On 8-Dec-2008, at 11:41, Rick R wrote: > > There are a few people from the NYC:Erlang group that have expressed > interest. (which may or may not have responded in this forum) > Does anyone have an idea for a location? Suspenders [ http://www.yelp.com/biz/suspenders-bar-and-restaurant-new-york > ] was > mentioned since they have a backroom with a video projector. Anyone else > have suggestions for a venue? If > not I will will try to track down a place. > On Wed, Dec 3, 2008 at 10:07 AM, joshuajnoble wrote: > >> >> I'd be interested as well, as long as it's mid-town/downtown-ish. I >> guess that puts us at ~6 attendees. >> >> On Dec 2, 4:06 pm, "Whit Armstrong" wrote: >> > count me in as long as it's somewhere close to mid-town. >> > >> > -Whit >> > >> > 2008/12/2 Rick R : >> > >> > > I'm very interested. >> > >> > > On Tue, Dec 2, 2008 at 12:41 PM, Vat Raghavan < >> machinshin2...@REDACTED> >> > > wrote: >> > >> > >> Thought would be great! I recently moved to New York and i've love to >> meet >> > >> local Erlang-ers :) >> > >> > >> --vat >> > >> > >> ----.signature---- >> > >> Without the hope that things will get better, >> > >> that our inheritors will know a world that is fuller and richer than >> our >> > >> own, >> > >> life is pointless, and evolution is vastly overrated >> > >> -- Delenn >> > >> > >> ----- Original Message ---- >> > >> From: Rudolph van Graan >> > >> To: Erlang Questions >> > >> Sent: Tuesday, December 2, 2008 4:45:24 AM >> > >> Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 >> December >> > >> 2008) >> > >> > >> Hi, >> > >> > >> Anybody up for an Erlounge somewhere in New York next week? I will be >> > >> in town from Wednesday. >> > >> > >> Rudolph van Graan >> > >> > >> Pattern Matched Technologies >> > >> > >> E-Mail: r...@REDACTED >> > >> Tel: 086 1000 700 (SA Only) >> > >> Mobile: +27 83 390 7767 >> > >> Fax: +27 12 665 9566 >> > >> Web: www.patternmatched.com >> > >> > >> _______________________________________________ >> > >> erlang-questions mailing list >> > >> erlang-questi...@REDACTED >> > >>http://www.erlang.org/mailman/listinfo/erlang-questions >> > >> > >> _______________________________________________ >> > >> erlang-questions mailing list >> > >> erlang-questi...@REDACTED >> > >>http://www.erlang.org/mailman/listinfo/erlang-questions >> > >> > > _______________________________________________ >> > > erlang-questions mailing list >> > > erlang-questi...@REDACTED >> > >http://www.erlang.org/mailman/listinfo/erlang-questions >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questi...@REDACTED:// >> www.erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stondage123@REDACTED Mon Dec 8 20:00:14 2008 From: stondage123@REDACTED (Andrew Stone) Date: Mon, 8 Dec 2008 11:00:14 -0800 (PST) Subject: [erlang-questions] auto-syncing mnesia after a network split References: <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> <45F80B9D-6F93-430D-B64E-895EEAE453B2@gmail.com> <874p1evggh.fsf@sterlett.hq.kred> <539A1985-F49C-4433-98B7-3890FC9326C0@gmail.com> <493D3DED.4060504@hyber.org> <2FD56C1A-F362-4753-ABB8-47380A90F1D7@gmail.com> Message-ID: <753412.85377.qm@web35907.mail.mud.yahoo.com> Another question to ask is whether you actually need a relational DB at all for your internet site. CouchDB seems to have solved the replication issue quite elegantly. -Andrew ----- Original Message ---- From: Joel Reymont To: Jim McCoy Cc: Erlang Questions Sent: Monday, December 8, 2008 12:37:44 PM Subject: Re: [erlang-questions] auto-syncing mnesia after a network split On Dec 8, 2008, at 5:19 PM, Jim McCoy wrote: > To maintain the current properties of mnesia I believe the only option > would be to add some complexity on the mechanics of the join mechanism > (e.g. a quorum system like paxos to decide membership and agreement > among the nodes as to the minimum quorum below which a partitioned > subset is read-only) and a bit of work to change a minority subset > into read-only mode when a partition is discovered. I'm willing to take a shot at the work, with proper instruction and guidance. I really really want a fix for this issue. I don't see how Mnesia can be used as the backend for an internet site otherwise. It's currently impossible to run an ecommerce or other internet site on top of Mnesia because of the split/rejoin issue. Please show me where I am mistaken. My understanding is that this issue can be dealt with in the telecom industry due to the transient nature of the data. I'm guessing that really important data always goes into Oracle, PostgreSQL, etc. Yes, I can use PostgreSQL or MySQL instead of Mnesia but then I have to deal with replication issues on that end. Does anyone know how other databases deal with network splits in a multi-master scenario? Thanks, Joel -- http://wagerlabs.com _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From peter@REDACTED Mon Dec 8 21:38:59 2008 From: peter@REDACTED (Peter Sabaini) Date: Mon, 8 Dec 2008 21:38:59 +0100 Subject: [erlang-questions] xmerl scan stream Message-ID: <200812082138.59380.peter@sabaini.at> Hi list, I am trying to get xmerl to parse a stream of data coming in via a TCP socket. The goal would be for xmerl to return xmlRecords as soon as one is complete. I use the continuation function option of xmerl and so far that works ok; unfortunately I only get an xmlRecord as soon as the next xml element starts. Is there a way to tell xmerl to "evaluate eagerly"? Below is the test code I used; any help much appreciated. Is this even possible? Or am I completely on the wrong track and should use a SAX model instead? -- snip -- -module(ap). -compile(export_all). start_server() -> {ok, Listen} = gen_tcp:listen(2345, [binary, {packet, raw}, {reuseaddr, true}, {active, true}]), spawn(fun() -> par_connect(Listen) end). par_connect(Listen) -> {ok, _Socket} = gen_tcp:accept(Listen), spawn(fun() -> par_connect(Listen) end), io:format("par_c ~n", []), X = xmerl_scan:string("", [{continuation_fun, fun continue/3}]), io:format("X: ~p ~n", [X]). continue(Continue, Exception, GlobalState) -> io:format("entered continue/3 ~n", []), receive {tcp, _Socket, Bin} -> Str = binary_to_list(Bin), io:format("got Str ~p ~n", [Str]), Continue(Str, GlobalState); {tcp_closed, _} -> io:format("Server socket closed~n" ), Exception(GlobalState) end. main() -> start_server(). -- snip -- -- Peter Sabaini http://sabaini.at/ From dizzyd@REDACTED Mon Dec 8 22:46:16 2008 From: dizzyd@REDACTED (Dave Smith) Date: Mon, 8 Dec 2008 14:46:16 -0700 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <2FD56C1A-F362-4753-ABB8-47380A90F1D7@gmail.com> References: <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> <45F80B9D-6F93-430D-B64E-895EEAE453B2@gmail.com> <874p1evggh.fsf@sterlett.hq.kred> <539A1985-F49C-4433-98B7-3890FC9326C0@gmail.com> <493D3DED.4060504@hyber.org> <2FD56C1A-F362-4753-ABB8-47380A90F1D7@gmail.com> Message-ID: On Mon, Dec 8, 2008 at 10:37 AM, Joel Reymont wrote: > > On Dec 8, 2008, at 5:19 PM, Jim McCoy wrote: > >> To maintain the current properties of mnesia I believe the only option >> would be to add some complexity on the mechanics of the join mechanism >> (e.g. a quorum system like paxos to decide membership and agreement >> among the nodes as to the minimum quorum below which a partitioned >> subset is read-only) and a bit of work to change a minority subset >> into read-only mode when a partition is discovered. > > > I'm willing to take a shot at the work, with proper instruction and > guidance. > > I really really want a fix for this issue. I don't see how Mnesia can > be used as the backend for an internet site otherwise. It's currently > impossible to run an ecommerce or other internet site on top of Mnesia > because of the split/rejoin issue. Please show me where I am mistaken. > > My understanding is that this issue can be dealt with in the telecom > industry due to the transient nature of the data. I'm guessing that > really important data always goes into Oracle, PostgreSQL, etc. > > Yes, I can use PostgreSQL or MySQL instead of Mnesia but then I have > to deal with replication issues on that end. Does anyone know how > other databases deal with network splits in a multi-master scenario? I _strongly_ suggest reading some of the research literature on this subject, particularly the work done by Amazon with their Dynamo system. That's one of the most practical papers I've read on these topics. With a little elbow grease, you could probably even implement such a system based on that paper... :) D. From klacke@REDACTED Mon Dec 8 22:07:52 2008 From: klacke@REDACTED (=?ISO-8859-1?Q?Claes_Wikstr=F6m?=) Date: Mon, 08 Dec 2008 22:07:52 +0100 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: References: <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> <45F80B9D-6F93-430D-B64E-895EEAE453B2@gmail.com> <874p1evggh.fsf@sterlett.hq.kred> <539A1985-F49C-4433-98B7-3890FC9326C0@gmail.com> <493D3DED.4060504@hyber.org> Message-ID: <493D8CA8.1030208@hyber.org> Jim McCoy wrote: > > Consistence, availability, partition-tolerance: pick two. > > Simiarly, Claes is incorrect in assuming that you could use the system > clock for anything other than printing a nice little display on the > screen to remind the user that they have a meeting scheduled for some > point in the near future. There is _a lot_ of literature out there on > distributed transaction fault-tolerance and it gets pretty complex in > a hurry. I'm not wrong if instead of choosing Consistence, availability I choose availability, partition-tolerance I.e sacrifice Consistence. NTP works sufficiently well IMHO. If system clocks are synchronized - how big are the chances of picking the wrong new master. Sufficiently slim I'd say. > > To maintain the current properties of mnesia I believe the only option I never said that - I suggested the properties were wrongly chosen. I/We should have sacrificed consistency - 10 years ago. > would be to add some complexity on the mechanics of the join mechanism > (e.g. a quorum system like paxos to decide membership and agreement A lot of the mnesia clusters only have 2 nodes - thus making quorums a no-goer. typical HA telcoms chassis systems have exactly two management blades. /klacke From ulf@REDACTED Mon Dec 8 23:09:39 2008 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 8 Dec 2008 23:09:39 +0100 Subject: [erlang-questions] xmerl scan stream In-Reply-To: <200812082138.59380.peter@sabaini.at> References: <200812082138.59380.peter@sabaini.at> Message-ID: <8209f740812081409p533af3e8v2bb73fe3e3e0cf6f@mail.gmail.com> Hi Peter, Have you looked at the module xmerl_eventp in xmerl? You might even be able to use it directly. BR, Ulf W 2008/12/8 Peter Sabaini : > Hi list, > > I am trying to get xmerl to parse a stream of data coming in via a TCP socket. > The goal would be for xmerl to return xmlRecords as soon as one is complete. > > I use the continuation function option of xmerl and so far that works ok; > unfortunately I only get an xmlRecord as soon as the next xml element starts. > Is there a way to tell xmerl to "evaluate eagerly"? > > Below is the test code I used; any help much appreciated. Is this even > possible? Or am I completely on the wrong track and should use a SAX model > instead? > > -- snip -- > > -module(ap). > -compile(export_all). > > start_server() -> > {ok, Listen} = gen_tcp:listen(2345, [binary, {packet, raw}, > {reuseaddr, true}, > {active, true}]), > spawn(fun() -> par_connect(Listen) end). > > par_connect(Listen) -> > {ok, _Socket} = gen_tcp:accept(Listen), > spawn(fun() -> par_connect(Listen) end), > io:format("par_c ~n", []), > X = xmerl_scan:string("", [{continuation_fun, fun continue/3}]), > io:format("X: ~p ~n", [X]). > > continue(Continue, Exception, GlobalState) -> > io:format("entered continue/3 ~n", []), > receive > {tcp, _Socket, Bin} -> > Str = binary_to_list(Bin), > io:format("got Str ~p ~n", [Str]), > Continue(Str, GlobalState); > {tcp_closed, _} -> > io:format("Server socket closed~n" ), > Exception(GlobalState) > end. > > main() -> > start_server(). > > > -- snip -- > > -- > Peter Sabaini > http://sabaini.at/ > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From sten@REDACTED Mon Dec 8 23:11:13 2008 From: sten@REDACTED (Sten Kvamme) Date: Mon, 08 Dec 2008 23:11:13 +0100 Subject: [erlang-questions] nl(module) in -eval Message-ID: <1228774273.6794.6.camel@bautasten> Hi, Trying to use hot code loading from command line, but nl() does not seem to work in eval, or what am I doing wrong? erl -setcookie SFEWRG34AFDSGAFG35235 -name moko2@REDACTED -eval "net_adm:ping('neo@REDACTED'),nl(antenna)." And this is the error printout: {"init terminating in do_boot",{undef,[{erl_eval,nl,1},{erl_eval,expr,3}]}} Thanks, Sten Kvamme -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: Detta ?r en digitalt signerad meddelandedel URL: From richardc@REDACTED Mon Dec 8 23:33:39 2008 From: richardc@REDACTED (Richard Carlsson) Date: Mon, 08 Dec 2008 23:33:39 +0100 Subject: [erlang-questions] nl(module) in -eval In-Reply-To: <1228774273.6794.6.camel@bautasten> References: <1228774273.6794.6.camel@bautasten> Message-ID: <493DA0C3.7080601@it.uu.se> Sten Kvamme wrote: > Hi, > Trying to use hot code loading from command line, but nl() does not seem > to work in eval, or what am I doing wrong? > > erl -setcookie SFEWRG34AFDSGAFG35235 -name moko2@REDACTED -eval > "net_adm:ping('neo@REDACTED'),nl(antenna)." > > And this is the error printout: > {"init terminating in > do_boot",{undef,[{erl_eval,nl,1},{erl_eval,expr,3}]}} The -eval flag does not use the Erlang shell to execute the commands (it uses erl_eval directly), so it knows nothing about shell builtins such as nl(Mod). However, those functions can be found in the module shell_default, so shell_default:nl(Mod) should work for you. /Richard From peter@REDACTED Mon Dec 8 23:38:25 2008 From: peter@REDACTED (Peter Sabaini) Date: Mon, 8 Dec 2008 23:38:25 +0100 Subject: [erlang-questions] xmerl scan stream In-Reply-To: <8209f740812081409p533af3e8v2bb73fe3e3e0cf6f@mail.gmail.com> References: <200812082138.59380.peter@sabaini.at> <8209f740812081409p533af3e8v2bb73fe3e3e0cf6f@mail.gmail.com> Message-ID: <200812082338.25567.peter@sabaini.at> On Monday 08 December 2008 23:09:39 Ulf Wiger wrote: > Hi Peter, > > Have you looked at the module xmerl_eventp in xmerl? > > You might even be able to use it directly. Yes, I suspected that this module might do what I need -- unfortunately, being the thick-skulled newbie that I am, I haven't been able to figure out how... The docs here http://www.erlang.org/doc/man/xmerl_eventp.html are pretty succinct. Aren't the functions in xmerl_eventp for scanning files? Or could I use those also with a TCP socket? Thanks, peter. > BR, > Ulf W > > 2008/12/8 Peter Sabaini : > > Hi list, > > > > I am trying to get xmerl to parse a stream of data coming in via a TCP > > socket. The goal would be for xmerl to return xmlRecords as soon as one > > is complete. > > > > I use the continuation function option of xmerl and so far that works ok; > > unfortunately I only get an xmlRecord as soon as the next xml element > > starts. Is there a way to tell xmerl to "evaluate eagerly"? > > > > Below is the test code I used; any help much appreciated. Is this even > > possible? Or am I completely on the wrong track and should use a SAX > > model instead? > > > > -- snip -- > > > > -module(ap). > > -compile(export_all). > > > > start_server() -> > > {ok, Listen} = gen_tcp:listen(2345, [binary, {packet, raw}, > > {reuseaddr, true}, > > {active, true}]), > > spawn(fun() -> par_connect(Listen) end). > > > > par_connect(Listen) -> > > {ok, _Socket} = gen_tcp:accept(Listen), > > spawn(fun() -> par_connect(Listen) end), > > io:format("par_c ~n", []), > > X = xmerl_scan:string("", [{continuation_fun, fun continue/3}]), > > io:format("X: ~p ~n", [X]). > > > > continue(Continue, Exception, GlobalState) -> > > io:format("entered continue/3 ~n", []), > > receive > > {tcp, _Socket, Bin} -> > > Str = binary_to_list(Bin), > > io:format("got Str ~p ~n", [Str]), > > Continue(Str, GlobalState); > > {tcp_closed, _} -> > > io:format("Server socket closed~n" ), > > Exception(GlobalState) > > end. > > > > main() -> > > start_server(). > > > > > > -- snip -- > > > > -- > > Peter Sabaini > > http://sabaini.at/ > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions -- Peter Sabaini http://sabaini.at/ From ulf@REDACTED Mon Dec 8 23:40:08 2008 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 8 Dec 2008 23:40:08 +0100 Subject: [erlang-questions] nl(module) in -eval In-Reply-To: <1228774273.6794.6.camel@bautasten> References: <1228774273.6794.6.camel@bautasten> Message-ID: <8209f740812081440r3aaf3b8w41ab59024b6a9db@mail.gmail.com> Try c:nl(antenna). The nl/1 function is "auto-imported" in the shell. In reality, it's defined in the module c.erl. http://www.erlang.org/doc/man/c.html BR, Ulf W 2008/12/8 Sten Kvamme : > Hi, > Trying to use hot code loading from command line, but nl() does not seem > to work in eval, or what am I doing wrong? > > erl -setcookie SFEWRG34AFDSGAFG35235 -name moko2@REDACTED -eval > "net_adm:ping('neo@REDACTED'),nl(antenna)." > > And this is the error printout: > {"init terminating in > do_boot",{undef,[{erl_eval,nl,1},{erl_eval,expr,3}]}} > > Thanks, > Sten Kvamme > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From ulf@REDACTED Mon Dec 8 23:53:59 2008 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 8 Dec 2008 23:53:59 +0100 Subject: [erlang-questions] xmerl scan stream In-Reply-To: <200812082338.25567.peter@sabaini.at> References: <200812082138.59380.peter@sabaini.at> <8209f740812081409p533af3e8v2bb73fe3e3e0cf6f@mail.gmail.com> <200812082338.25567.peter@sabaini.at> Message-ID: <8209f740812081453q64bb21ebubb4eec12af77360c@mail.gmail.com> True, you can't really use it directly, but you can copy the code. Basically, the read_chunk/2 function should be replaced by something along the lines of: read_chunk(Sofar) -> receive {tcp, _Socket, Bin} -> {ok, iolist_to_binary([Sofar, Bin])}; {tcp, closed, _} -> eof end. (View this as pseudo code.) You should probably use gen_tcp:recv() instead, or at least an {active, once} socket. But you need to rewrite xmerl_eventp:stream/2 slightly. The complication, when you get down to it, is that the stream continuation fun must take care not to break up the stream in the wrong place. This is because xmerl doesn't use a proper tokenizer, but does a one-pass parse which relies rather heavily on pattern matching. This is what the find_good_split() function is for. BR, Ulf W 2008/12/8 Peter Sabaini : > On Monday 08 December 2008 23:09:39 Ulf Wiger wrote: >> Hi Peter, >> >> Have you looked at the module xmerl_eventp in xmerl? >> >> You might even be able to use it directly. > > Yes, I suspected that this module might do what I need -- unfortunately, being > the thick-skulled newbie that I am, I haven't been able to figure out how... > The docs here http://www.erlang.org/doc/man/xmerl_eventp.html are pretty > succinct. Aren't the functions in xmerl_eventp for scanning files? Or could I > use those also with a TCP socket? > > Thanks, > peter. > >> BR, >> Ulf W >> >> 2008/12/8 Peter Sabaini : >> > Hi list, >> > >> > I am trying to get xmerl to parse a stream of data coming in via a TCP >> > socket. The goal would be for xmerl to return xmlRecords as soon as one >> > is complete. >> > >> > I use the continuation function option of xmerl and so far that works ok; >> > unfortunately I only get an xmlRecord as soon as the next xml element >> > starts. Is there a way to tell xmerl to "evaluate eagerly"? >> > >> > Below is the test code I used; any help much appreciated. Is this even >> > possible? Or am I completely on the wrong track and should use a SAX >> > model instead? >> > >> > -- snip -- >> > >> > -module(ap). >> > -compile(export_all). >> > >> > start_server() -> >> > {ok, Listen} = gen_tcp:listen(2345, [binary, {packet, raw}, >> > {reuseaddr, true}, >> > {active, true}]), >> > spawn(fun() -> par_connect(Listen) end). >> > >> > par_connect(Listen) -> >> > {ok, _Socket} = gen_tcp:accept(Listen), >> > spawn(fun() -> par_connect(Listen) end), >> > io:format("par_c ~n", []), >> > X = xmerl_scan:string("", [{continuation_fun, fun continue/3}]), >> > io:format("X: ~p ~n", [X]). >> > >> > continue(Continue, Exception, GlobalState) -> >> > io:format("entered continue/3 ~n", []), >> > receive >> > {tcp, _Socket, Bin} -> >> > Str = binary_to_list(Bin), >> > io:format("got Str ~p ~n", [Str]), >> > Continue(Str, GlobalState); >> > {tcp_closed, _} -> >> > io:format("Server socket closed~n" ), >> > Exception(GlobalState) >> > end. >> > >> > main() -> >> > start_server(). >> > >> > >> > -- snip -- >> > >> > -- >> > Peter Sabaini >> > http://sabaini.at/ >> > >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- > Peter Sabaini > http://sabaini.at/ > > > From peter@REDACTED Tue Dec 9 00:30:42 2008 From: peter@REDACTED (Peter Sabaini) Date: Tue, 9 Dec 2008 00:30:42 +0100 Subject: [erlang-questions] xmerl scan stream In-Reply-To: <8209f740812081453q64bb21ebubb4eec12af77360c@mail.gmail.com> References: <200812082138.59380.peter@sabaini.at> <200812082338.25567.peter@sabaini.at> <8209f740812081453q64bb21ebubb4eec12af77360c@mail.gmail.com> Message-ID: <200812090030.42954.peter@sabaini.at> On Monday 08 December 2008 23:53:59 Ulf Wiger wrote: > True, you can't really use it directly, but you can copy > the code. Basically, the read_chunk/2 function should > be replaced by something along the lines of: > > read_chunk(Sofar) -> > receive > {tcp, _Socket, Bin} -> > {ok, iolist_to_binary([Sofar, Bin])}; > {tcp, closed, _} -> > eof > end. Ok... > (View this as pseudo code.) > > You should probably use gen_tcp:recv() instead, or > at least an {active, once} socket. At the moment, this is for "trusted" clients only, so I can code this rather liberally, without fear that somebody could abuse that -- is that what you meant? > But you need to > rewrite xmerl_eventp:stream/2 slightly. Ok, I'll try that and report any outcome, maybe other people find this useful too. Thanks, peter. > The complication, when you get down to it, is that the > stream continuation fun must take care not to break > up the stream in the wrong place. This is because xmerl > doesn't use a proper tokenizer, but does a one-pass > parse which relies rather heavily on pattern matching. > > This is what the find_good_split() function is for. > > BR, > Ulf W > > 2008/12/8 Peter Sabaini : > > On Monday 08 December 2008 23:09:39 Ulf Wiger wrote: > >> Hi Peter, > >> > >> Have you looked at the module xmerl_eventp in xmerl? > >> > >> You might even be able to use it directly. > > > > Yes, I suspected that this module might do what I need -- unfortunately, > > being the thick-skulled newbie that I am, I haven't been able to figure > > out how... The docs here http://www.erlang.org/doc/man/xmerl_eventp.html > > are pretty succinct. Aren't the functions in xmerl_eventp for scanning > > files? Or could I use those also with a TCP socket? > > > > Thanks, > > peter. > > > >> BR, > >> Ulf W > >> > >> 2008/12/8 Peter Sabaini : > >> > Hi list, > >> > > >> > I am trying to get xmerl to parse a stream of data coming in via a TCP > >> > socket. The goal would be for xmerl to return xmlRecords as soon as > >> > one is complete. > >> > > >> > I use the continuation function option of xmerl and so far that works > >> > ok; unfortunately I only get an xmlRecord as soon as the next xml > >> > element starts. Is there a way to tell xmerl to "evaluate eagerly"? > >> > > >> > Below is the test code I used; any help much appreciated. Is this even > >> > possible? Or am I completely on the wrong track and should use a SAX > >> > model instead? > >> > > >> > -- snip -- > >> > > >> > -module(ap). > >> > -compile(export_all). > >> > > >> > start_server() -> > >> > {ok, Listen} = gen_tcp:listen(2345, [binary, {packet, raw}, > >> > {reuseaddr, true}, > >> > {active, true}]), > >> > spawn(fun() -> par_connect(Listen) end). > >> > > >> > par_connect(Listen) -> > >> > {ok, _Socket} = gen_tcp:accept(Listen), > >> > spawn(fun() -> par_connect(Listen) end), > >> > io:format("par_c ~n", []), > >> > X = xmerl_scan:string("", [{continuation_fun, fun continue/3}]), > >> > io:format("X: ~p ~n", [X]). > >> > > >> > continue(Continue, Exception, GlobalState) -> > >> > io:format("entered continue/3 ~n", []), > >> > receive > >> > {tcp, _Socket, Bin} -> > >> > Str = binary_to_list(Bin), > >> > io:format("got Str ~p ~n", [Str]), > >> > Continue(Str, GlobalState); > >> > {tcp_closed, _} -> > >> > io:format("Server socket closed~n" ), > >> > Exception(GlobalState) > >> > end. > >> > > >> > main() -> > >> > start_server(). > >> > > >> > > >> > -- snip -- > >> > > >> > -- > >> > Peter Sabaini > >> > http://sabaini.at/ > >> > > >> > > >> > _______________________________________________ > >> > erlang-questions mailing list > >> > erlang-questions@REDACTED > >> > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > -- > > Peter Sabaini > > http://sabaini.at/ -- Peter Sabaini http://sabaini.at/ From jim.mccoy@REDACTED Tue Dec 9 00:39:52 2008 From: jim.mccoy@REDACTED (Jim McCoy) Date: Mon, 8 Dec 2008 15:39:52 -0800 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <493D8CA8.1030208@hyber.org> References: <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> <45F80B9D-6F93-430D-B64E-895EEAE453B2@gmail.com> <874p1evggh.fsf@sterlett.hq.kred> <539A1985-F49C-4433-98B7-3890FC9326C0@gmail.com> <493D3DED.4060504@hyber.org> <493D8CA8.1030208@hyber.org> Message-ID: On Mon, Dec 8, 2008 at 1:07 PM, Claes Wikstr?m wrote: > Jim McCoy wrote: > >> >> Consistence, availability, partition-tolerance: pick two. >>[...] > > I'm not wrong if instead of choosing Consistence, availability > I choose availability, partition-tolerance My bad. I had probably missed a point and sort of assumed we were talking about maintaining the current set of properties. I am a big fan of eventual consistency, but it seems to me that this pushes a lot of the responsibility for conflict resolution back to the DB client -- not necessarily bad, but something that probably would have probably made mnesia even less accessible than it currently is to the casual programmer. >> would be to add some complexity on the mechanics of the join mechanism >> (e.g. a quorum system like paxos to decide membership and agreement > > > A lot of the mnesia clusters only have 2 nodes - thus making > quorums a no-goer. typical HA telcoms chassis systems have exactly > two management blades. Two is just a special-case of N. If you wanted a practical solution for 2 nodes or any even number of nodes you could elect a leader at each membership change (systems like paxos require the existence of such a leader even if they do nothing more than initiate the voting protocol) and declare that a partition with half the nodes that included the previous leader could continue writing. jim From peter@REDACTED Tue Dec 9 01:10:11 2008 From: peter@REDACTED (Peter Sabaini) Date: Tue, 9 Dec 2008 01:10:11 +0100 Subject: [erlang-questions] xmerl scan stream In-Reply-To: <200812090030.42954.peter@sabaini.at> References: <200812082138.59380.peter@sabaini.at> <8209f740812081453q64bb21ebubb4eec12af77360c@mail.gmail.com> <200812090030.42954.peter@sabaini.at> Message-ID: <200812090110.11644.peter@sabaini.at> Hm, as an afterthought -- this still doesn't solve the original problem, does it? Say I have this on my input stream: % telnet localhost 2345 Trying 127.0.0.1... Connected to localhost.local. Escape character is '^]'. a ----- then I only get the a structure back as soon as is entered, correct? Thanks, peter. On Tuesday 09 December 2008 00:30:42 Peter Sabaini wrote: > On Monday 08 December 2008 23:53:59 Ulf Wiger wrote: > > True, you can't really use it directly, but you can copy > > the code. Basically, the read_chunk/2 function should > > be replaced by something along the lines of: > > > > read_chunk(Sofar) -> > > receive > > {tcp, _Socket, Bin} -> > > {ok, iolist_to_binary([Sofar, Bin])}; > > {tcp, closed, _} -> > > eof > > end. > > Ok... > > > (View this as pseudo code.) > > > > You should probably use gen_tcp:recv() instead, or > > at least an {active, once} socket. > > At the moment, this is for "trusted" clients only, so I can code this > rather liberally, without fear that somebody could abuse that -- is that > what you meant? > > > But you need to > > rewrite xmerl_eventp:stream/2 slightly. > > Ok, I'll try that and report any outcome, maybe other people find this > useful too. > > Thanks, > peter. > > > The complication, when you get down to it, is that the > > stream continuation fun must take care not to break > > up the stream in the wrong place. This is because xmerl > > doesn't use a proper tokenizer, but does a one-pass > > parse which relies rather heavily on pattern matching. > > > > This is what the find_good_split() function is for. > > > > BR, > > Ulf W > > > > 2008/12/8 Peter Sabaini : > > > On Monday 08 December 2008 23:09:39 Ulf Wiger wrote: > > >> Hi Peter, > > >> > > >> Have you looked at the module xmerl_eventp in xmerl? > > >> > > >> You might even be able to use it directly. > > > > > > Yes, I suspected that this module might do what I need -- > > > unfortunately, being the thick-skulled newbie that I am, I haven't been > > > able to figure out how... The docs here > > > http://www.erlang.org/doc/man/xmerl_eventp.html are pretty succinct. > > > Aren't the functions in xmerl_eventp for scanning files? Or could I use > > > those also with a TCP socket? > > > > > > Thanks, > > > peter. > > > > > >> BR, > > >> Ulf W > > >> > > >> 2008/12/8 Peter Sabaini : > > >> > Hi list, > > >> > > > >> > I am trying to get xmerl to parse a stream of data coming in via a > > >> > TCP socket. The goal would be for xmerl to return xmlRecords as soon > > >> > as one is complete. > > >> > > > >> > I use the continuation function option of xmerl and so far that > > >> > works ok; unfortunately I only get an xmlRecord as soon as the next > > >> > xml element starts. Is there a way to tell xmerl to "evaluate > > >> > eagerly"? > > >> > > > >> > Below is the test code I used; any help much appreciated. Is this > > >> > even possible? Or am I completely on the wrong track and should use > > >> > a SAX model instead? > > >> > > > >> > -- snip -- > > >> > > > >> > -module(ap). > > >> > -compile(export_all). > > >> > > > >> > start_server() -> > > >> > {ok, Listen} = gen_tcp:listen(2345, [binary, {packet, raw}, > > >> > {reuseaddr, true}, > > >> > {active, true}]), > > >> > spawn(fun() -> par_connect(Listen) end). > > >> > > > >> > par_connect(Listen) -> > > >> > {ok, _Socket} = gen_tcp:accept(Listen), > > >> > spawn(fun() -> par_connect(Listen) end), > > >> > io:format("par_c ~n", []), > > >> > X = xmerl_scan:string("", [{continuation_fun, fun continue/3}]), > > >> > io:format("X: ~p ~n", [X]). > > >> > > > >> > continue(Continue, Exception, GlobalState) -> > > >> > io:format("entered continue/3 ~n", []), > > >> > receive > > >> > {tcp, _Socket, Bin} -> > > >> > Str = binary_to_list(Bin), > > >> > io:format("got Str ~p ~n", [Str]), > > >> > Continue(Str, GlobalState); > > >> > {tcp_closed, _} -> > > >> > io:format("Server socket closed~n" ), > > >> > Exception(GlobalState) > > >> > end. > > >> > > > >> > main() -> > > >> > start_server(). > > >> > > > >> > > > >> > -- snip -- > > >> > > > >> > -- > > >> > Peter Sabaini > > >> > http://sabaini.at/ > > >> > > > >> > > > >> > _______________________________________________ > > >> > erlang-questions mailing list > > >> > erlang-questions@REDACTED > > >> > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > > > Peter Sabaini > > > http://sabaini.at/ -- Peter Sabaini http://sabaini.at/ From rec@REDACTED Tue Dec 9 01:56:14 2008 From: rec@REDACTED (Roger Critchlow) Date: Mon, 8 Dec 2008 17:56:14 -0700 Subject: [erlang-questions] unhelpful backtrace truncation Message-ID: <66d1c98f0812081656n68d6cb45ob701c175afe569d0@mail.gmail.com> This kind of truncated stack backtrace, generated by erl -boot start_sasl: ** Reason for termination == ** {{key_exists,"7b181d15cebb4c86a6ad7fed3dbf30ce2223b4c5"}, [{gb_trees,insert_1,4}, {gb_trees,insert_1,4}, {gb_trees,insert_1,4}, {gb_trees,insert_1,4}, {gb_trees,insert_1,4}, {gb_trees,insert_1,4}, {gb_trees,insert_1,4}, {gb_trees,insert_1,4}]} is not very helpful. It is especially galling since I had to page past a 4000 line print out of the server's state to reach it. Is there some option to start_sasl which would print the entire stack backtrace? -- rec -- From chris@REDACTED Tue Dec 9 02:29:02 2008 From: chris@REDACTED (Christian Hergert) Date: Mon, 08 Dec 2008 17:29:02 -0800 Subject: [erlang-questions] SNMP Client Message-ID: Hi, After reading Joe's fantastic book, I decided to write a distributed SNMP poller to record statistics from all of my switching gear. However, I've found the snmp client examples[1] to be incredibly confusing. Has anyone put together a short sample, or willing to be cohersed to create such a sample? The particularly confusing part is the configuration requirements. A previous post to the mailing list[2] might be of interest. I too am interested in a snmpget like function. [1] http://www.trapexit.org/docs/howto/snmp_howto.html [2] http://www.erlang.org/pipermail/erlang-questions/2006-February/019089.html Thanks! -- Christian Hergert From saleyn@REDACTED Tue Dec 9 03:01:05 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Mon, 08 Dec 2008 21:01:05 -0500 Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 December 2008) In-Reply-To: <4081F020-F4CD-4FDE-ACED-56288118DA9F@gmail.com> References: <8474074A-8F5A-452C-905E-52A1D320AF4E@patternmatched.com> <449398.6638.qm@web31504.mail.mud.yahoo.com> <9810b81b0812021239i6d634b0bke9b48367873fdb34@mail.gmail.com> <8ec76080812021306l6d965c4ao4716224b606ab628@mail.gmail.com> <9810b81b0812080841u5983a347u5a07c337ba8b9eed@mail.gmail.com> <4081F020-F4CD-4FDE-ACED-56288118DA9F@gmail.com> Message-ID: <493DD161.8070001@gmail.com> I'll be able to join if this meeting is in the WTC vicinity on Wed or Fri. Serge Brian Cully wrote: > Suspenders works for me. I attend NYCBUG meetings there every month > or so, and the back room can accommodate a good 20 people comfortably. > They do have a projector and power, too. > > Anything from the financial district to midtown is pretty reachable > for me, as well, if Suspenders doesn't work out. > > -bjc > > On 8-Dec-2008, at 11:41, Rick R wrote: > >> There are a few people from the NYC:Erlang group that have expressed >> interest. (which may or may not have responded in this forum) >> Does anyone have an idea for a location? Suspenders [ >> http://www.yelp.com/biz/suspenders-bar-and-restaurant-new-york ] >> was mentioned since they have a backroom with a video projector. >> Anyone else have suggestions for a venue? If not I will will try to >> track down a place. >> >> On Wed, Dec 3, 2008 at 10:07 AM, joshuajnoble >> wrote: >> >> I'd be interested as well, as long as it's mid-town/downtown-ish. I >> guess that puts us at ~6 attendees. >> >> On Dec 2, 4:06 pm, "Whit Armstrong" wrote: >> > count me in as long as it's somewhere close to mid-town. >> > >> > -Whit >> > >> > 2008/12/2 Rick R : >> > >> > > I'm very interested. >> > >> > > On Tue, Dec 2, 2008 at 12:41 PM, Vat Raghavan >> >> > > wrote: >> > >> > >> Thought would be great! I recently moved to New York and i've >> love to meet >> > >> local Erlang-ers :) >> > >> > >> --vat >> > >> > >> ----.signature---- >> > >> Without the hope that things will get better, >> > >> that our inheritors will know a world that is fuller and richer >> than our >> > >> own, >> > >> life is pointless, and evolution is vastly overrated >> > >> -- Delenn >> > >> > >> ----- Original Message ---- >> > >> From: Rudolph van Graan >> > >> To: Erlang Questions >> > >> Sent: Tuesday, December 2, 2008 4:45:24 AM >> > >> Subject: [erlang-questions] NYC Erlounge next week? (10 to 13 >> December >> > >> 2008) >> > >> > >> Hi, >> > >> > >> Anybody up for an Erlounge somewhere in New York next week? I >> will be >> > >> in town from Wednesday. >> > >> > >> Rudolph van Graan >> > >> > >> Pattern Matched Technologies >> > >> > >> E-Mail: r...@REDACTED >> > >> Tel: 086 1000 700 (SA Only) >> > >> Mobile: +27 83 390 7767 >> > >> Fax: +27 12 665 9566 >> > >> Web: www.patternmatched.com >> > >> > >> _______________________________________________ >> > >> erlang-questions mailing list >> > >> erlang-questi...@REDACTED >> > >>http://www.erlang.org/mailman/listinfo/erlang-questions >> > >> > >> _______________________________________________ >> > >> erlang-questions mailing list >> > >> erlang-questi...@REDACTED >> > >>http://www.erlang.org/mailman/listinfo/erlang-questions >> > >> > > _______________________________________________ >> > > erlang-questions mailing list >> > > erlang-questi...@REDACTED >> > >http://www.erlang.org/mailman/listinfo/erlang-questions >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > >> erlang-questi...@REDACTED://www.erlang.org/mailman/listinfo/erlang-questions >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From careo@REDACTED Tue Dec 9 02:29:09 2008 From: careo@REDACTED (Dane Jensen) Date: Mon, 8 Dec 2008 17:29:09 -0800 Subject: [erlang-questions] Problem using short names in OS X Leopard Message-ID: <68FE80CB-F07E-4F27-A605-8874014D9331@fastmail.fm> Hi All- I'm running into problems using distributed Erlang with short names (- sname) in R12-B5 installed through MacPorts in Leopard that I'm hoping someone can help me sort out. The gist of it is that they just don't work... at all. Except, the names show up in epmd -names, and I do get a conflict if I start two nodes with the same name. So Erlang at least *knows* there's another node with that name out there, but just can't connect to it. Nothing changes if I delete my ~/.erlang.cookie, or specify a cookie on the command line for that matter. Nothing also seems to change if I set my hostname to "odin" or "odin.local". If I switch to using full names, it all works though. I'm completely stumped, but I have a suspicion that I'm missing something right in front of my face. I'd greatly appreciate any pointers to what could be going on. Thanks, -Dane From saleyn@REDACTED Tue Dec 9 03:19:49 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Mon, 08 Dec 2008 21:19:49 -0500 Subject: [erlang-questions] SNMP Client In-Reply-To: References: Message-ID: <493DD5C5.1010409@gmail.com> Did you read the SNMP Quick Start tutorial? http://www.trapexit.org/SNMP_Quick_Start Serge Christian Hergert wrote: > Hi, > > After reading Joe's fantastic book, I decided to write a distributed SNMP poller to record statistics from all of my switching gear. However, I've found the snmp client examples[1] to be incredibly confusing. > > Has anyone put together a short sample, or willing to be cohersed to create such a sample? The particularly confusing part is the configuration requirements. > > A previous post to the mailing list[2] might be of interest. I too am interested in a snmpget like function. > > [1] http://www.trapexit.org/docs/howto/snmp_howto.html > [2] http://www.erlang.org/pipermail/erlang-questions/2006-February/019089.html > > Thanks! From chris@REDACTED Tue Dec 9 03:24:34 2008 From: chris@REDACTED (Christian Hergert) Date: Mon, 08 Dec 2008 18:24:34 -0800 Subject: [erlang-questions] SNMP Client In-Reply-To: <493DD5C5.1010409@gmail.com> References: <493DD5C5.1010409@gmail.com> Message-ID: On Mon, 08 Dec 2008 18:19:49 -0800, Serge Aleynikov wrote: > Did you read the SNMP Quick Start tutorial? > http://www.trapexit.org/SNMP_Quick_Start Indeed I have. It seems very much centered around manager configuration's though. Is this required? I'm strictly concerned with retreiving values, not publishing them. Thanks! -- Christian Hergert From dbudworth@REDACTED Tue Dec 9 03:35:43 2008 From: dbudworth@REDACTED (David Budworth) Date: Mon, 8 Dec 2008 20:35:43 -0600 Subject: [erlang-questions] xmerl scan stream In-Reply-To: <200812090110.11644.peter@sabaini.at> References: <200812082138.59380.peter@sabaini.at> <8209f740812081453q64bb21ebubb4eec12af77360c@mail.gmail.com> <200812090030.42954.peter@sabaini.at> <200812090110.11644.peter@sabaini.at> Message-ID: <2e23d1d20812081835o4ea806c9sefcb9e131b5ddb83@mail.gmail.com> For what it's worth, i ended up going with erlsom for xml parsing due to speed and ease of streaming parses. I would just loop over my buffer with: erlsom:parse_simple(Buffer) which returns {xmlstruct,Remainder} or if there isn't a complete doc in the buffer, it raises {error,"Malformed:..."}, so basically I had stream_loop(Data) -> case catch elrsom:simple_form(Data) of {ok,Xml,Rest} -> server ! {newXML,Xml}, stream_loop(Rest); {error,"Malformed"++_} -> server ! {needMore,Data} end. (note: not real code, just an example) This may be possible with xmerl as well, I know I had both working with just simple straight parsing, but I don't recall the "return struct + left over bytes" as being a feature of the parser. in my testing, i think for my sample xml (smallish, 399 bytes), I was getting 90uSec / msg with erlsom and 125uSec / msg with xmerl. (running on dual quad 3ghz 8gb ram box, not that that matters for a single threaded test like this) both perfectly speedy (and faster than any java parser I've used), but for this particular app (xml router) speed is king. plus, I found erlsom's "simple form" to be a bit easier to deal with at the time. Not sure why I thought that now though. It does solve you problem in that you get your xml doc(s) as soon as you receive the bytes. hope that helps, -David On Mon, Dec 8, 2008 at 6:10 PM, Peter Sabaini wrote: > Hm, as an afterthought -- this still doesn't solve the original problem, > does > it? > > Say I have this on my input stream: > > % telnet localhost 2345 > Trying 127.0.0.1... > Connected to localhost.local. > Escape character is '^]'. > > a > > > > ----- > > then I only get the a structure back as soon as is > entered, > correct? > > Thanks, > peter. > > > > On Tuesday 09 December 2008 00:30:42 Peter Sabaini wrote: > > On Monday 08 December 2008 23:53:59 Ulf Wiger wrote: > > > True, you can't really use it directly, but you can copy > > > the code. Basically, the read_chunk/2 function should > > > be replaced by something along the lines of: > > > > > > read_chunk(Sofar) -> > > > receive > > > {tcp, _Socket, Bin} -> > > > {ok, iolist_to_binary([Sofar, Bin])}; > > > {tcp, closed, _} -> > > > eof > > > end. > > > > Ok... > > > > > (View this as pseudo code.) > > > > > > You should probably use gen_tcp:recv() instead, or > > > at least an {active, once} socket. > > > > At the moment, this is for "trusted" clients only, so I can code this > > rather liberally, without fear that somebody could abuse that -- is that > > what you meant? > > > > > But you need to > > > rewrite xmerl_eventp:stream/2 slightly. > > > > Ok, I'll try that and report any outcome, maybe other people find this > > useful too. > > > > Thanks, > > peter. > > > > > The complication, when you get down to it, is that the > > > stream continuation fun must take care not to break > > > up the stream in the wrong place. This is because xmerl > > > doesn't use a proper tokenizer, but does a one-pass > > > parse which relies rather heavily on pattern matching. > > > > > > This is what the find_good_split() function is for. > > > > > > BR, > > > Ulf W > > > > > > 2008/12/8 Peter Sabaini : > > > > On Monday 08 December 2008 23:09:39 Ulf Wiger wrote: > > > >> Hi Peter, > > > >> > > > >> Have you looked at the module xmerl_eventp in xmerl? > > > >> > > > >> You might even be able to use it directly. > > > > > > > > Yes, I suspected that this module might do what I need -- > > > > unfortunately, being the thick-skulled newbie that I am, I haven't > been > > > > able to figure out how... The docs here > > > > http://www.erlang.org/doc/man/xmerl_eventp.html are pretty succinct. > > > > Aren't the functions in xmerl_eventp for scanning files? Or could I > use > > > > those also with a TCP socket? > > > > > > > > Thanks, > > > > peter. > > > > > > > >> BR, > > > >> Ulf W > > > >> > > > >> 2008/12/8 Peter Sabaini : > > > >> > Hi list, > > > >> > > > > >> > I am trying to get xmerl to parse a stream of data coming in via a > > > >> > TCP socket. The goal would be for xmerl to return xmlRecords as > soon > > > >> > as one is complete. > > > >> > > > > >> > I use the continuation function option of xmerl and so far that > > > >> > works ok; unfortunately I only get an xmlRecord as soon as the > next > > > >> > xml element starts. Is there a way to tell xmerl to "evaluate > > > >> > eagerly"? > > > >> > > > > >> > Below is the test code I used; any help much appreciated. Is this > > > >> > even possible? Or am I completely on the wrong track and should > use > > > >> > a SAX model instead? > > > >> > > > > >> > -- snip -- > > > >> > > > > >> > -module(ap). > > > >> > -compile(export_all). > > > >> > > > > >> > start_server() -> > > > >> > {ok, Listen} = gen_tcp:listen(2345, [binary, {packet, raw}, > > > >> > {reuseaddr, true}, > > > >> > {active, true}]), > > > >> > spawn(fun() -> par_connect(Listen) end). > > > >> > > > > >> > par_connect(Listen) -> > > > >> > {ok, _Socket} = gen_tcp:accept(Listen), > > > >> > spawn(fun() -> par_connect(Listen) end), > > > >> > io:format("par_c ~n", []), > > > >> > X = xmerl_scan:string("", [{continuation_fun, fun > continue/3}]), > > > >> > io:format("X: ~p ~n", [X]). > > > >> > > > > >> > continue(Continue, Exception, GlobalState) -> > > > >> > io:format("entered continue/3 ~n", []), > > > >> > receive > > > >> > {tcp, _Socket, Bin} -> > > > >> > Str = binary_to_list(Bin), > > > >> > io:format("got Str ~p ~n", [Str]), > > > >> > Continue(Str, GlobalState); > > > >> > {tcp_closed, _} -> > > > >> > io:format("Server socket closed~n" ), > > > >> > Exception(GlobalState) > > > >> > end. > > > >> > > > > >> > main() -> > > > >> > start_server(). > > > >> > > > > >> > > > > >> > -- snip -- > > > >> > > > > >> > -- > > > >> > Peter Sabaini > > > >> > http://sabaini.at/ > > > >> > > > > >> > > > > >> > _______________________________________________ > > > >> > erlang-questions mailing list > > > >> > erlang-questions@REDACTED > > > >> > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > -- > > > > Peter Sabaini > > > > http://sabaini.at/ > > -- > Peter Sabaini > http://sabaini.at/ > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From saleyn@REDACTED Tue Dec 9 03:58:33 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Mon, 08 Dec 2008 21:58:33 -0500 Subject: [erlang-questions] SNMP Client In-Reply-To: References: <493DD5C5.1010409@gmail.com> Message-ID: <493DDED9.7030909@gmail.com> Unfortunately you can't avoid having SNMP manager at least minimally configured before running it. This isn't really dependent on whether you want to do get or set operations on SNMP agents. Serge Christian Hergert wrote: > On Mon, 08 Dec 2008 18:19:49 -0800, Serge Aleynikov > wrote: > >> Did you read the SNMP Quick Start tutorial? >> http://www.trapexit.org/SNMP_Quick_Start > > Indeed I have. It seems very much centered around manager > configuration's though. Is this required? I'm strictly concerned with > retreiving values, not publishing them. > > Thanks! > -- > Christian Hergert > From sandeepkampati@REDACTED Tue Dec 9 05:24:44 2008 From: sandeepkampati@REDACTED (sandeep_k) Date: Mon, 8 Dec 2008 20:24:44 -0800 (PST) Subject: [erlang-questions] query about FILE_BUFSIZE in ftp.erl Message-ID: <20908591.post@talk.nabble.com> Hi, In erlang source code (ftp.erl) there is -define(FILE_BUFSIZE, 4096). can I know the reason why the FILE_BUFSIZE is specified as 4096? what will happen if I increase value FILE_BUFSIZE? -- View this message in context: http://www.nabble.com/query-about-FILE_BUFSIZE-in-ftp.erl-tp20908591p20908591.html Sent from the Erlang Questions mailing list archive at Nabble.com. From jao@REDACTED Tue Dec 9 05:30:58 2008 From: jao@REDACTED (Jack Orenstein) Date: Mon, 8 Dec 2008 23:30:58 -0500 Subject: [erlang-questions] Sending a message to a process that no longer exists Message-ID: Please excuse a very basic question. How can an Erlang process avoid hanging when sending a message to a process that no longer exists, (as in the code below)? I understand that using the send operator (!) directly is pretty uncommon, and that applications would normally use OTP, but how does OTP deal with the problem? Jack -module(test). -export([main/0]). -define(DUMP(X), io:format("~p:~p - ~p = ~p~n", [?MODULE, ?LINE, ??X, X])). main() -> P = spawn(fun() -> loop() end), send_and_receive(P, hello), send(P, exit), send_and_receive(P, hello). send(Server, Request) -> ?DUMP({send, Request}), Server ! {self(), Request}. send_and_receive(Server, Request) -> ?DUMP({send_and_receive, send, Request}), Server ! {self(), Request}, receive {Server, Response} -> ?DUMP({send_and_receive, received, Response}), Response end. loop() -> receive {From, hello} -> ?DUMP(hello), From ! {self(), hi}, loop(); {_From, exit} -> ?DUMP(exit), void end. From dbtleonia@REDACTED Tue Dec 9 06:42:43 2008 From: dbtleonia@REDACTED (David Tucker) Date: Mon, 8 Dec 2008 21:42:43 -0800 Subject: [erlang-questions] {badarg, [{code_server, call, 2}, {error_handler, undefined_function, 3}]} Message-ID: <77ac51d70812082142w2244b06fne0e728e3487e14f3@mail.gmail.com> Hi folks, My simple program below gives an error on exit. Any idea what is wrong? Thanks. Dave --- $ cat inp.erl -module(inp). -compile(export_all). start() -> spawn(fun() -> one_line() end). one_line() -> case io:get_line("") of Str -> lib:nonl(Str) end. $ erlc inp.erl $ erl -noshell -s inp start -s init stop {error_logger,{{2008,12,8},{21,39,50}},"~s~n",["Error in process <0.28.0> with exit value: {badarg,[{code_server,call,2},{error_handler,undefined_function,3}]}\n"]} $ port info erlang | head -1 erlang R12B-5, lang/erlang (Variants: universal, smp, ssl, hipe, i386) -------------- next part -------------- An HTML attachment was scrubbed... URL: From rapsey@REDACTED Tue Dec 9 06:58:17 2008 From: rapsey@REDACTED (Rapsey) Date: Tue, 9 Dec 2008 06:58:17 +0100 Subject: [erlang-questions] Sending a message to a process that no longer exists In-Reply-To: References: Message-ID: <97619b170812082158r72999d55i6b8e0c8a04a57d38@mail.gmail.com> Using the send operator is very common. To avoid endless waiting in a receive statement you can use after: receive {Server, Response} -> ?DUMP({send_and_receive, received, Response}), Response after 1000 -> void end. On Tue, Dec 9, 2008 at 5:30 AM, Jack Orenstein wrote: > Please excuse a very basic question. > > How can an Erlang process avoid hanging when sending a message to a > process that no longer exists, (as in the code below)? I understand > that using the send operator (!) directly is pretty uncommon, and > that applications would normally use OTP, but how does OTP deal with > the problem? > > Jack > > > -module(test). > > -export([main/0]). > > -define(DUMP(X), io:format("~p:~p - ~p = ~p~n", [?MODULE, ?LINE, ??X, > X])). > > main() -> > P = spawn(fun() -> loop() end), > send_and_receive(P, hello), > send(P, exit), > send_and_receive(P, hello). > > send(Server, Request) -> > ?DUMP({send, Request}), > Server ! {self(), Request}. > > send_and_receive(Server, Request) -> > ?DUMP({send_and_receive, send, Request}), > Server ! {self(), Request}, > receive > {Server, Response} -> > ?DUMP({send_and_receive, received, Response}), > Response > end. > > loop() -> > receive > {From, hello} -> > ?DUMP(hello), > From ! {self(), hi}, > loop(); > {_From, exit} -> > ?DUMP(exit), > void > end. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernie@REDACTED Tue Dec 9 07:08:15 2008 From: bernie@REDACTED (Bernard Duggan) Date: Tue, 09 Dec 2008 17:08:15 +1100 Subject: [erlang-questions] {badarg, [{code_server, call, 2}, {error_handler, undefined_function, 3}]} In-Reply-To: <77ac51d70812082142w2244b06fne0e728e3487e14f3@mail.gmail.com> References: <77ac51d70812082142w2244b06fne0e728e3487e14f3@mail.gmail.com> Message-ID: <493E0B4F.5010207@m5net.com> While someone else can probably explain exactly why you're getting that particular message (I could guess, but I'd probably get it wrong), I can at least tell you why your test isn't working :) The use of "-s init stop" tells the erts to execute "init:stop" as soon as the previous function ("inp:start") returns. The problem you're having is that inp:start spawns a thread and returns straight away. The erts then calls init:stop, killing off the whole elang vm (and, presumably, creating some kind of error condition in the remaining thread which is the output you're seeing). You need to either have inp:start wait until its child process has completed (perhaps with a 'receive' block), or not tell the vm to shut down using "-s init stop". Hope that's some help. Cheers, Bernard David Tucker wrote: > Hi folks, > > My simple program below gives an error on exit. Any idea what is > wrong? Thanks. > > Dave > > --- > > $ cat inp.erl > -module(inp). > -compile(export_all). > > start() -> > spawn(fun() -> one_line() end). > > one_line() -> > case io:get_line("") of > Str -> lib:nonl(Str) > end. > $ erlc inp.erl > $ erl -noshell -s inp start -s init stop > {error_logger,{{2008,12,8},{21,39,50}},"~s~n",["Error in process > <0.28.0> with exit value: > {badarg,[{code_server,call,2},{error_handler,undefined_function,3}]}\n"]} > $ port info erlang | head -1 > erlang R12B-5, lang/erlang (Variants: universal, smp, ssl, hipe, i386) > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From jao@REDACTED Tue Dec 9 07:09:45 2008 From: jao@REDACTED (Jack Orenstein) Date: Tue, 9 Dec 2008 01:09:45 -0500 Subject: [erlang-questions] Sending a message to a process that no longer exists In-Reply-To: <97619b170812082158r72999d55i6b8e0c8a04a57d38@mail.gmail.com> References: <97619b170812082158r72999d55i6b8e0c8a04a57d38@mail.gmail.com> Message-ID: <446DFEC3-3250-4EC8-8F0F-512501B20359@geophile.com> On Dec 9, 2008, at 12:58 AM, Rapsey wrote: > Using the send operator is very common. To avoid endless waiting in > a receive statement you can use after: > > receive > {Server, Response} -> > ?DUMP({send_and_receive, received, Response}), > Response > after 1000 -> > void > end. But this won't distinguish a dead process from a slow one. Jack From dbtleonia@REDACTED Tue Dec 9 07:10:24 2008 From: dbtleonia@REDACTED (David Tucker) Date: Mon, 8 Dec 2008 22:10:24 -0800 Subject: [erlang-questions] {badarg, [{code_server, call, 2}, {error_handler, undefined_function, 3}]} In-Reply-To: <493E0B4F.5010207@m5net.com> References: <77ac51d70812082142w2244b06fne0e728e3487e14f3@mail.gmail.com> <493E0B4F.5010207@m5net.com> Message-ID: <77ac51d70812082210y429f831awe6a2752a9cf5f15a@mail.gmail.com> Thanks for the info. Is there a clean way to shut down a process that is blocking on io:get_line()? Dave On Mon, Dec 8, 2008 at 10:08 PM, Bernard Duggan wrote: > While someone else can probably explain exactly why you're getting that > particular message (I could guess, but I'd probably get it wrong), I can > at least tell you why your test isn't working :) > The use of "-s init stop" tells the erts to execute "init:stop" as soon > as the previous function ("inp:start") returns. The problem you're > having is that inp:start spawns a thread and returns straight away. The > erts then calls init:stop, killing off the whole elang vm (and, > presumably, creating some kind of error condition in the remaining > thread which is the output you're seeing). > You need to either have inp:start wait until its child process has > completed (perhaps with a 'receive' block), or not tell the vm to shut > down using "-s init stop". > > Hope that's some help. > > Cheers, > > Bernard > > David Tucker wrote: > > Hi folks, > > > > My simple program below gives an error on exit. Any idea what is > > wrong? Thanks. > > > > Dave > > > > --- > > > > $ cat inp.erl > > -module(inp). > > -compile(export_all). > > > > start() -> > > spawn(fun() -> one_line() end). > > > > one_line() -> > > case io:get_line("") of > > Str -> lib:nonl(Str) > > end. > > $ erlc inp.erl > > $ erl -noshell -s inp start -s init stop > > {error_logger,{{2008,12,8},{21,39,50}},"~s~n",["Error in process > > <0.28.0> with exit value: > > {badarg,[{code_server,call,2},{error_handler,undefined_function,3}]}\n"]} > > $ port info erlang | head -1 > > erlang R12B-5, lang/erlang (Variants: universal, smp, ssl, hipe, i386) > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernie@REDACTED Tue Dec 9 07:18:58 2008 From: bernie@REDACTED (Bernard Duggan) Date: Tue, 09 Dec 2008 17:18:58 +1100 Subject: [erlang-questions] {badarg, [{code_server, call, 2}, {error_handler, undefined_function, 3}]} In-Reply-To: <77ac51d70812082210y429f831awe6a2752a9cf5f15a@mail.gmail.com> References: <77ac51d70812082142w2244b06fne0e728e3487e14f3@mail.gmail.com> <493E0B4F.5010207@m5net.com> <77ac51d70812082210y429f831awe6a2752a9cf5f15a@mail.gmail.com> Message-ID: <493E0DD2.3030706@m5net.com> Two ways spring to mind. The first is to create it as a linked process using spawn_link() rather than spawn() (or by subsequently calling link()). Then, when the process that spawned it dies, it will die too. Of course, the reverse is also true (the spawning process will die if the spawned one exists) unless it has trap_exit enabled. The other is to call exit(SpawnedPid, Reason) where 'Reason' is something other than 'normal'. There's probably other ways too that I can't think of right now (besides just shutting down the whole vm of course). Cheers, Bernard David Tucker wrote: > Thanks for the info. Is there a clean way to shut down a process that > is blocking on io:get_line()? > > Dave > > > On Mon, Dec 8, 2008 at 10:08 PM, Bernard Duggan > wrote: > > While someone else can probably explain exactly why you're getting > that > particular message (I could guess, but I'd probably get it wrong), > I can > at least tell you why your test isn't working :) > The use of "-s init stop" tells the erts to execute "init:stop" as > soon > as the previous function ("inp:start") returns. The problem you're > having is that inp:start spawns a thread and returns straight > away. The > erts then calls init:stop, killing off the whole elang vm (and, > presumably, creating some kind of error condition in the remaining > thread which is the output you're seeing). > You need to either have inp:start wait until its child process has > completed (perhaps with a 'receive' block), or not tell the vm to shut > down using "-s init stop". > > Hope that's some help. > > Cheers, > > Bernard > > David Tucker wrote: > > Hi folks, > > > > My simple program below gives an error on exit. Any idea what is > > wrong? Thanks. > > > > Dave > > > > --- > > > > $ cat inp.erl > > -module(inp). > > -compile(export_all). > > > > start() -> > > spawn(fun() -> one_line() end). > > > > one_line() -> > > case io:get_line("") of > > Str -> lib:nonl(Str) > > end. > > $ erlc inp.erl > > $ erl -noshell -s inp start -s init stop > > {error_logger,{{2008,12,8},{21,39,50}},"~s~n",["Error in process > > <0.28.0> with exit value: > > > {badarg,[{code_server,call,2},{error_handler,undefined_function,3}]}\n"]} > > $ port info erlang | head -1 > > erlang R12B-5, lang/erlang (Variants: universal, smp, ssl, hipe, > i386) > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > From dbtleonia@REDACTED Tue Dec 9 07:27:23 2008 From: dbtleonia@REDACTED (David Tucker) Date: Mon, 8 Dec 2008 22:27:23 -0800 Subject: [erlang-questions] {badarg, [{code_server, call, 2}, {error_handler, undefined_function, 3}]} In-Reply-To: <493E0DD2.3030706@m5net.com> References: <77ac51d70812082142w2244b06fne0e728e3487e14f3@mail.gmail.com> <493E0B4F.5010207@m5net.com> <77ac51d70812082210y429f831awe6a2752a9cf5f15a@mail.gmail.com> <493E0DD2.3030706@m5net.com> Message-ID: <77ac51d70812082227n937e819pac79ef77708c02d2@mail.gmail.com> Calling exit() on that pid seemed to do the trick. Thanks for the help! Dave On Mon, Dec 8, 2008 at 10:18 PM, Bernard Duggan wrote: > Two ways spring to mind. > > The first is to create it as a linked process using spawn_link() rather > than spawn() (or by subsequently calling link()). Then, when the > process that spawned it dies, it will die too. Of course, the reverse > is also true (the spawning process will die if the spawned one exists) > unless it has trap_exit enabled. > > The other is to call exit(SpawnedPid, Reason) where 'Reason' is > something other than 'normal'. > > There's probably other ways too that I can't think of right now (besides > just shutting down the whole vm of course). > > Cheers, > > Bernard > > David Tucker wrote: > > Thanks for the info. Is there a clean way to shut down a process that > > is blocking on io:get_line()? > > > > Dave > > > > > > On Mon, Dec 8, 2008 at 10:08 PM, Bernard Duggan > > wrote: > > > > While someone else can probably explain exactly why you're getting > > that > > particular message (I could guess, but I'd probably get it wrong), > > I can > > at least tell you why your test isn't working :) > > The use of "-s init stop" tells the erts to execute "init:stop" as > > soon > > as the previous function ("inp:start") returns. The problem you're > > having is that inp:start spawns a thread and returns straight > > away. The > > erts then calls init:stop, killing off the whole elang vm (and, > > presumably, creating some kind of error condition in the remaining > > thread which is the output you're seeing). > > You need to either have inp:start wait until its child process has > > completed (perhaps with a 'receive' block), or not tell the vm to > shut > > down using "-s init stop". > > > > Hope that's some help. > > > > Cheers, > > > > Bernard > > > > David Tucker wrote: > > > Hi folks, > > > > > > My simple program below gives an error on exit. Any idea what is > > > wrong? Thanks. > > > > > > Dave > > > > > > --- > > > > > > $ cat inp.erl > > > -module(inp). > > > -compile(export_all). > > > > > > start() -> > > > spawn(fun() -> one_line() end). > > > > > > one_line() -> > > > case io:get_line("") of > > > Str -> lib:nonl(Str) > > > end. > > > $ erlc inp.erl > > > $ erl -noshell -s inp start -s init stop > > > {error_logger,{{2008,12,8},{21,39,50}},"~s~n",["Error in process > > > <0.28.0> with exit value: > > > > > > {badarg,[{code_server,call,2},{error_handler,undefined_function,3}]}\n"]} > > > $ port info erlang | head -1 > > > erlang R12B-5, lang/erlang (Variants: universal, smp, ssl, hipe, > > i386) > > > > > > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernie@REDACTED Tue Dec 9 07:40:13 2008 From: bernie@REDACTED (Bernard Duggan) Date: Tue, 09 Dec 2008 17:40:13 +1100 Subject: [erlang-questions] Sending a message to a process that no longer exists In-Reply-To: <446DFEC3-3250-4EC8-8F0F-512501B20359@geophile.com> References: <97619b170812082158r72999d55i6b8e0c8a04a57d38@mail.gmail.com> <446DFEC3-3250-4EC8-8F0F-512501B20359@geophile.com> Message-ID: <493E12CD.6090807@m5net.com> Jack Orenstein wrote: > On Dec 9, 2008, at 12:58 AM, Rapsey wrote: > > >> Using the send operator is very common. To avoid endless waiting in >> a receive statement you can use after: >> >> receive >> {Server, Response} -> >> ?DUMP({send_and_receive, received, Response}), >> Response >> after 1000 -> >> void >> end. >> > > But this won't distinguish a dead process from a slow one. > If you want to ensure the process is running, you can use process_flag(trap_exit, true), and then spawn_link(), instead of spawn() to create the server process. Then, in your receive block above add a pattern {'EXIT', Server, Reason} This will be sent to you when the server process exits for whatever reason. Cheers, Bernard From taavi@REDACTED Tue Dec 9 08:13:38 2008 From: taavi@REDACTED (Taavi Talvik) Date: Tue, 9 Dec 2008 09:13:38 +0200 Subject: [erlang-questions] xmerl scan stream In-Reply-To: <200812090110.11644.peter@sabaini.at> References: <200812082138.59380.peter@sabaini.at> <8209f740812081453q64bb21ebubb4eec12af77360c@mail.gmail.com> <200812090030.42954.peter@sabaini.at> <200812090110.11644.peter@sabaini.at> Message-ID: On Dec 9, 2008, at 2:10 AM, Peter Sabaini wrote: > Hm, as an afterthought -- this still doesn't solve the original > problem, does > it? > > Say I have this on my input stream: > > % telnet localhost 2345 > Trying 127.0.0.1... > Connected to localhost.local. > Escape character is '^]'. > > a > > > > ----- > > then I only get the a structure back as soon as > is entered, > correct? I used following continuation functions: {Xml, _Rest} = xmerl_scan:string(Data, [ {continuation_fun, fun get_more_data/3, {started,State#state.socket}}, {event_fun, fun elisa_xml_event/2}]) ... %% function to fetch more data %% When entity is ended (set in event function), no more data is returned %% When we are in middle of entiry, then wait for more data get_more_data(ContinueF, ExceptionF, GlobalState) -> {Phase,Socket} = xmerl_scan:cont_state(GlobalState), case gen_tcp:recv(Socket, 0, ?DATA_TIMEOUT) of {ok, Data} -> ContinueF(binary_to_list(Data), GlobalState); {error, timeout} -> % if we have somthing started, we need more data % if ended, nothing more is needed case Phase of started -> ContinueF([], GlobalState); ended -> ExceptionF(GlobalState) end; _Other -> ExceptionF(GlobalState) end. %% %% @doc elisa_xml Event function which sets started|ended flags for continuation function. elisa_xml_event(#xmerl_event{event=started}, State) -> {_Phase,Socket} = xmerl_scan:cont_state(State), xmerl_scan:cont_state({started,Socket}, State); elisa_xml_event(#xmerl_event{event=ended}, State) -> {_Phase,Socket} = xmerl_scan:cont_state(State), xmerl_scan:cont_state({ended,Socket}, State); elisa_xml_event(_E, State) -> State. best regards, taavi From w.a.de.jong@REDACTED Tue Dec 9 08:14:47 2008 From: w.a.de.jong@REDACTED (Willem de Jong) Date: Tue, 9 Dec 2008 08:14:47 +0100 Subject: [erlang-questions] xmerl scan stream In-Reply-To: <2e23d1d20812081835o4ea806c9sefcb9e131b5ddb83@mail.gmail.com> References: <200812082138.59380.peter@sabaini.at> <8209f740812081453q64bb21ebubb4eec12af77360c@mail.gmail.com> <200812090030.42954.peter@sabaini.at> <200812090110.11644.peter@sabaini.at> <2e23d1d20812081835o4ea806c9sefcb9e131b5ddb83@mail.gmail.com> Message-ID: <407d9ef80812082314k405630fes41a788d1ac40799a@mail.gmail.com> Hi, I also think erlsom might be a good fit. I wouldn't do it the way David describes, but it may be that David found a way to use erlsom that I hadn't thought of. I would use the erlsom sax parser with a continuation function. Personally I am a big fan of the sax model, but it may take some time to get used to it. There are some examples provided with the code (you can find it on sourceforge). In any case you have to make sure that you don't run into trouble if the stream is quite long (or even endless). It is my impression that xmerl will build a structure in memory that will continue to grow as long as you are receiveing data (but I may be wrong - I never managed to understand the xmerl documentation). Regards, Willem 2008/12/9 David Budworth > For what it's worth, i ended up going with erlsom for xml parsing due to > speed and ease of streaming parses. > > I would just loop over my buffer with: > erlsom:parse_simple(Buffer) > > which returns > {xmlstruct,Remainder} > > or if there isn't a complete doc in the buffer, it raises > {error,"Malformed:..."}, so basically I had > > stream_loop(Data) -> > case catch elrsom:simple_form(Data) of > {ok,Xml,Rest} -> server ! {newXML,Xml}, stream_loop(Rest); > {error,"Malformed"++_} -> server ! {needMore,Data} > end. > > (note: not real code, just an example) > > This may be possible with xmerl as well, I know I had both working with > just simple straight parsing, but I don't recall the "return struct + left > over bytes" as being a feature of the parser. > > in my testing, i think for my sample xml (smallish, 399 bytes), I was > getting 90uSec / msg with erlsom and 125uSec / msg with xmerl. (running on > dual quad 3ghz 8gb ram box, not that that matters for a single threaded test > like this) > > both perfectly speedy (and faster than any java parser I've used), but for > this particular app (xml router) speed is king. > > plus, I found erlsom's "simple form" to be a bit easier to deal with at the > time. Not sure why I thought that now though. > > It does solve you problem in that you get your xml doc(s) as soon as you > receive the bytes. > > hope that helps, > > -David > > > > On Mon, Dec 8, 2008 at 6:10 PM, Peter Sabaini wrote: > >> Hm, as an afterthought -- this still doesn't solve the original problem, >> does >> it? >> >> Say I have this on my input stream: >> >> % telnet localhost 2345 >> Trying 127.0.0.1... >> Connected to localhost.local. >> Escape character is '^]'. >> >> a >> >> >> >> ----- >> >> then I only get the a structure back as soon as is >> entered, >> correct? >> >> Thanks, >> peter. >> >> >> >> On Tuesday 09 December 2008 00:30:42 Peter Sabaini wrote: >> > On Monday 08 December 2008 23:53:59 Ulf Wiger wrote: >> > > True, you can't really use it directly, but you can copy >> > > the code. Basically, the read_chunk/2 function should >> > > be replaced by something along the lines of: >> > > >> > > read_chunk(Sofar) -> >> > > receive >> > > {tcp, _Socket, Bin} -> >> > > {ok, iolist_to_binary([Sofar, Bin])}; >> > > {tcp, closed, _} -> >> > > eof >> > > end. >> > >> > Ok... >> > >> > > (View this as pseudo code.) >> > > >> > > You should probably use gen_tcp:recv() instead, or >> > > at least an {active, once} socket. >> > >> > At the moment, this is for "trusted" clients only, so I can code this >> > rather liberally, without fear that somebody could abuse that -- is that >> > what you meant? >> > >> > > But you need to >> > > rewrite xmerl_eventp:stream/2 slightly. >> > >> > Ok, I'll try that and report any outcome, maybe other people find this >> > useful too. >> > >> > Thanks, >> > peter. >> > >> > > The complication, when you get down to it, is that the >> > > stream continuation fun must take care not to break >> > > up the stream in the wrong place. This is because xmerl >> > > doesn't use a proper tokenizer, but does a one-pass >> > > parse which relies rather heavily on pattern matching. >> > > >> > > This is what the find_good_split() function is for. >> > > >> > > BR, >> > > Ulf W >> > > >> > > 2008/12/8 Peter Sabaini : >> > > > On Monday 08 December 2008 23:09:39 Ulf Wiger wrote: >> > > >> Hi Peter, >> > > >> >> > > >> Have you looked at the module xmerl_eventp in xmerl? >> > > >> >> > > >> You might even be able to use it directly. >> > > > >> > > > Yes, I suspected that this module might do what I need -- >> > > > unfortunately, being the thick-skulled newbie that I am, I haven't >> been >> > > > able to figure out how... The docs here >> > > > http://www.erlang.org/doc/man/xmerl_eventp.html are pretty >> succinct. >> > > > Aren't the functions in xmerl_eventp for scanning files? Or could I >> use >> > > > those also with a TCP socket? >> > > > >> > > > Thanks, >> > > > peter. >> > > > >> > > >> BR, >> > > >> Ulf W >> > > >> >> > > >> 2008/12/8 Peter Sabaini : >> > > >> > Hi list, >> > > >> > >> > > >> > I am trying to get xmerl to parse a stream of data coming in via >> a >> > > >> > TCP socket. The goal would be for xmerl to return xmlRecords as >> soon >> > > >> > as one is complete. >> > > >> > >> > > >> > I use the continuation function option of xmerl and so far that >> > > >> > works ok; unfortunately I only get an xmlRecord as soon as the >> next >> > > >> > xml element starts. Is there a way to tell xmerl to "evaluate >> > > >> > eagerly"? >> > > >> > >> > > >> > Below is the test code I used; any help much appreciated. Is this >> > > >> > even possible? Or am I completely on the wrong track and should >> use >> > > >> > a SAX model instead? >> > > >> > >> > > >> > -- snip -- >> > > >> > >> > > >> > -module(ap). >> > > >> > -compile(export_all). >> > > >> > >> > > >> > start_server() -> >> > > >> > {ok, Listen} = gen_tcp:listen(2345, [binary, {packet, raw}, >> > > >> > {reuseaddr, true}, >> > > >> > {active, true}]), >> > > >> > spawn(fun() -> par_connect(Listen) end). >> > > >> > >> > > >> > par_connect(Listen) -> >> > > >> > {ok, _Socket} = gen_tcp:accept(Listen), >> > > >> > spawn(fun() -> par_connect(Listen) end), >> > > >> > io:format("par_c ~n", []), >> > > >> > X = xmerl_scan:string("", [{continuation_fun, fun >> continue/3}]), >> > > >> > io:format("X: ~p ~n", [X]). >> > > >> > >> > > >> > continue(Continue, Exception, GlobalState) -> >> > > >> > io:format("entered continue/3 ~n", []), >> > > >> > receive >> > > >> > {tcp, _Socket, Bin} -> >> > > >> > Str = binary_to_list(Bin), >> > > >> > io:format("got Str ~p ~n", [Str]), >> > > >> > Continue(Str, GlobalState); >> > > >> > {tcp_closed, _} -> >> > > >> > io:format("Server socket closed~n" ), >> > > >> > Exception(GlobalState) >> > > >> > end. >> > > >> > >> > > >> > main() -> >> > > >> > start_server(). >> > > >> > >> > > >> > >> > > >> > -- snip -- >> > > >> > >> > > >> > -- >> > > >> > Peter Sabaini >> > > >> > http://sabaini.at/ >> > > >> > >> > > >> > >> > > >> > _______________________________________________ >> > > >> > erlang-questions mailing list >> > > >> > erlang-questions@REDACTED >> > > >> > http://www.erlang.org/mailman/listinfo/erlang-questions >> > > > >> > > > -- >> > > > Peter Sabaini >> > > > http://sabaini.at/ >> >> -- >> Peter Sabaini >> http://sabaini.at/ >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rapsey@REDACTED Tue Dec 9 10:09:47 2008 From: rapsey@REDACTED (Rapsey) Date: Tue, 9 Dec 2008 10:09:47 +0100 Subject: [erlang-questions] Sending a message to a process that no longer exists In-Reply-To: <493E12CD.6090807@m5net.com> References: <97619b170812082158r72999d55i6b8e0c8a04a57d38@mail.gmail.com> <446DFEC3-3250-4EC8-8F0F-512501B20359@geophile.com> <493E12CD.6090807@m5net.com> Message-ID: <97619b170812090109k129560e7mdcae94f77ee8f680@mail.gmail.com> Or you can use a monitor (erlang:monitor/2), to receive a message when a process dies. Or you can check if a proces is alive with: erlang:is_process_alive(PID) Sergej On Tue, Dec 9, 2008 at 7:40 AM, Bernard Duggan wrote: > Jack Orenstein wrote: > > On Dec 9, 2008, at 12:58 AM, Rapsey wrote: > > > > > >> Using the send operator is very common. To avoid endless waiting in > >> a receive statement you can use after: > >> > >> receive > >> {Server, Response} -> > >> ?DUMP({send_and_receive, received, Response}), > >> Response > >> after 1000 -> > >> void > >> end. > >> > > > > But this won't distinguish a dead process from a slow one. > > > If you want to ensure the process is running, you can use > process_flag(trap_exit, true), > and then spawn_link(), instead of spawn() to create the server process. > Then, in your receive block above add a pattern > > {'EXIT', Server, Reason} > > This will be sent to you when the server process exits for whatever reason. > > Cheers, > > Bernard > -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter@REDACTED Tue Dec 9 10:26:47 2008 From: peter@REDACTED (Peter Sabaini) Date: Tue, 9 Dec 2008 10:26:47 +0100 Subject: [erlang-questions] xmerl scan stream In-Reply-To: References: <200812082138.59380.peter@sabaini.at> <200812090110.11644.peter@sabaini.at> Message-ID: <200812091026.47642.peter@sabaini.at> On Tuesday 09 December 2008 08:13:38 Taavi Talvik wrote: > On Dec 9, 2008, at 2:10 AM, Peter Sabaini wrote: > > Hm, as an afterthought -- this still doesn't solve the original > > problem, does > > it? > > > > Say I have this on my input stream: > > > > % telnet localhost 2345 > > Trying 127.0.0.1... > > Connected to localhost.local. > > Escape character is '^]'. > > > > a > > > > > > > > ----- > > > > then I only get the a structure back as soon as > > is entered, > > correct? > > I used following continuation functions: Hi Taavi, thanks for the code, unfortunately I still have problems -- I can see when an XML parse has ended (#xmerl_event), but the scanner still only returns the xmlRecord after the next element started? Thanks, peter. > {Xml, _Rest} = > xmerl_scan:string(Data, > [ > {continuation_fun, fun get_more_data/3, > {started,State#state.socket}}, > {event_fun, fun elisa_xml_event/2}]) > ... > > %% function to fetch more data > %% When entity is ended (set in event function), no more data is > returned > %% When we are in middle of entiry, then wait for more data > get_more_data(ContinueF, ExceptionF, GlobalState) -> > {Phase,Socket} = xmerl_scan:cont_state(GlobalState), > case gen_tcp:recv(Socket, 0, ?DATA_TIMEOUT) of > {ok, Data} -> > ContinueF(binary_to_list(Data), GlobalState); > {error, timeout} -> > % if we have somthing started, we need more data > % if ended, nothing more is needed > case Phase of > started -> > ContinueF([], GlobalState); > ended -> > ExceptionF(GlobalState) > end; > _Other -> > ExceptionF(GlobalState) > end. > > %% > %% @doc elisa_xml Event function which sets started|ended flags for > continuation function. > elisa_xml_event(#xmerl_event{event=started}, State) -> > {_Phase,Socket} = xmerl_scan:cont_state(State), > xmerl_scan:cont_state({started,Socket}, State); > elisa_xml_event(#xmerl_event{event=ended}, State) -> > {_Phase,Socket} = xmerl_scan:cont_state(State), > xmerl_scan:cont_state({ended,Socket}, State); > elisa_xml_event(_E, State) -> > State. > > > best regards, > taavi -- Peter Sabaini http://sabaini.at/ From francesca.gangemi@REDACTED Tue Dec 9 10:30:22 2008 From: francesca.gangemi@REDACTED (Francesca Gangemi) Date: Tue, 09 Dec 2008 10:30:22 +0100 Subject: [erlang-questions] Upgrading gen_tcp socket to ssl In-Reply-To: <4938E62B.4030205@erix.ericsson.se> References: <4938E62B.4030205@erix.ericsson.se> Message-ID: <493E3AAE.8070509@erlang-consulting.com> Ingela Anderton Andin wrote: > >> I'm using ssl-3.10 and I still see the same problem: >> "cacertfile" is required even if {verify,0} is explicitly specified as >> option . >> >> As example >> >> ssl:connect("zimbra.erlangsystems.com", 443, [{verify,0},{ssl_imp,new}]). >> {error,{eoptions,{cacertfile,[]}}} >> >> ssl:connect("zimbra.erlangsystems.com", 443, [{verify,0}]). >> {ok,{sslsocket,5,<0.1664.0>}} >> >> > Sorry that was our mistake we forgot to remove the restriction in the > "option list handling" it will be removed for the next release. > Ok, I'll wait :-) >> Trying to upgrade a tcp socket I put as cacertfile the filename of a >> certificate I have on my machine and I've got the following error report >> >> ssl:connect(#Port<0.3428>,[{certfile,"certs/mycert.pem"}, >> {keyfile,"certs/mycert.key"}, >> {cacertfile,"certs/vsign.pem"}, >> {verify,0}, {ssl_imp, new}]) >> >> =ERROR REPORT==== 4-Dec-2008::17:57:05 === >> SSL: hello: ./ssl_record.erl:291:Fatal error: record_overflow >> >> > Is it possible for you to provide us with more information so we can > repeat your > senario? > I'm sorry I can't reproduce it anymore, maybe I did something wrong. Thanks for your support. Kind regards Francesca From rtrlists@REDACTED Tue Dec 9 10:54:22 2008 From: rtrlists@REDACTED (Robert Raschke) Date: Tue, 9 Dec 2008 09:54:22 +0000 Subject: [erlang-questions] jinterface List vs. String Message-ID: <6a3ae47e0812090154n2c197e0al495f75fc93e0820d@mail.gmail.com> Hi, does anyone have a good idea on how I can distinguish between a list and a string in jinterface? Or, in other words, if jinterface has decided to receive an OtpErlangString (from a sent list like [1, 2, 3], for example), is there an easy way to convert it to an OtpErlangList? I know I can do it by hand, but that's ever so slightly icky. Thanks, Robby From rvirding@REDACTED Tue Dec 9 11:04:50 2008 From: rvirding@REDACTED (Robert Virding) Date: Tue, 9 Dec 2008 11:04:50 +0100 Subject: [erlang-questions] Sending a message to a process that no longer exists In-Reply-To: <97619b170812090109k129560e7mdcae94f77ee8f680@mail.gmail.com> References: <97619b170812082158r72999d55i6b8e0c8a04a57d38@mail.gmail.com> <446DFEC3-3250-4EC8-8F0F-512501B20359@geophile.com> <493E12CD.6090807@m5net.com> <97619b170812090109k129560e7mdcae94f77ee8f680@mail.gmail.com> Message-ID: <3dbc6d1c0812090204j5ac10d6at824e5f9d1ae9aa03@mail.gmail.com> Using erlang:monitor/2 is better as the process could die after you check it is alive but before it replies. Do you know that it will alwys reply? Check the module io.erl in stdlib which uses erlang:monitor/2 to make sure that io servers are alive long enough to reply to an io request. There is a bit of trickery needed when removing the monitor with erlang:demonitor/1 to make sure no 'DOWN' messages are left in the mailbox. N.B. monitoring stacks so you have to be careful to remove as many as you add. If you are going to send many requests in one go to the process it would be better to wrap the whole "transaction" with monitor/demonitor. Robert 2008/12/9 Rapsey > Or you can use a monitor (erlang:monitor/2), to receive a message when a > process dies. > Or you can check if a proces is alive with: erlang:is_process_alive(PID) > > > Sergej > > > On Tue, Dec 9, 2008 at 7:40 AM, Bernard Duggan wrote: > >> Jack Orenstein wrote: >> > On Dec 9, 2008, at 12:58 AM, Rapsey wrote: >> > >> > >> >> Using the send operator is very common. To avoid endless waiting in >> >> a receive statement you can use after: >> >> >> >> receive >> >> {Server, Response} -> >> >> ?DUMP({send_and_receive, received, Response}), >> >> Response >> >> after 1000 -> >> >> void >> >> end. >> >> >> > >> > But this won't distinguish a dead process from a slow one. >> > >> If you want to ensure the process is running, you can use >> process_flag(trap_exit, true), >> and then spawn_link(), instead of spawn() to create the server process. >> Then, in your receive block above add a pattern >> >> {'EXIT', Server, Reason} >> >> This will be sent to you when the server process exits for whatever >> reason. >> >> Cheers, >> >> Bernard >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From enrico.thierbach@REDACTED Tue Dec 9 11:07:23 2008 From: enrico.thierbach@REDACTED (Enrico Thierbach) Date: Tue, 9 Dec 2008 11:07:23 +0100 Subject: [erlang-questions] JSON/EEP/critical discussion Message-ID: Hi list, as someone pointed out (http://fullof.bs/prototype-eep-18-considered-harmful-the-problems-with-erlang-to-json-term-translation#more-402 and http://sc.tri-bit.com/outgoing/scjson%20parser%20halp.html) some people seem to have issues with EEP0018's current state. Despite that I will continue working on a native JSON<->Erlang implementation. However, my original intention is to support couchdb with such a thing. Chris was kind enoug to point me towards the EEP, which I believe to be an excellent help for the implementation. However, I don't care much about whether or not what I am doing will end up in the Erlang distribution. I will still try to stick to the EEP for most design decisions, so that my code might be turned into a part of OTP at some point. I will try to be flexible enough with what conversions occur at what point: if need arises we should be able to change such things pretty quickly. Most issues pointed out in the above text relate to roundtrip conversions (i.e. take some term, convert it to json, convert it back, and please get an equivalent term). In difference to that post I don't feel the necessity of supporting feature complete round trip conversion for all kind of terms. After all JSON is not and was never intended to be a format for the representation of all kind of data; it is intended as a lightweight human readable and editable format for interchange of structured data. As such it only supports a limited wealth of data types, and it must do so - otherwise it would limit the # of environments that can be able to fully support JSON. (Or how should a C JSON reader deal w/a Erlang function?) In that light I second the notion that the naming (term_to_json, son_to_term) might be misleading. Users *might* expect a feature complete conversion. Of course if a user needs a complete conversion for transmission purposes he/she should just use term <-> binary conversions. But of course choosing different function names might surprise less (json:from_json/1,2 and json:to_json/1,2 come to mind). So long, I will keep you posted re/the implementation progress. /eno PS: Talking of round trip conversions: http://sc.tri-bit.com/outgoing does some weird things with spaces in the URL, ending up with an illegal URL in the browser's URL line. Is that behaviour intended? -- ==================================================================== A wee piece of ruby every monday: http://1rad.wordpress.com/ From vladdu55@REDACTED Tue Dec 9 11:15:46 2008 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 9 Dec 2008 11:15:46 +0100 Subject: [erlang-questions] jinterface List vs. String In-Reply-To: <6a3ae47e0812090154n2c197e0al495f75fc93e0820d@mail.gmail.com> References: <6a3ae47e0812090154n2c197e0al495f75fc93e0820d@mail.gmail.com> Message-ID: <95be1d3b0812090215v1416d752qb3c1586ab1166427@mail.gmail.com> Hi, On Tue, Dec 9, 2008 at 10:54, Robert Raschke wrote: > does anyone have a good idea on how I can distinguish between a list > and a string in jinterface? The short answer is that you can't without traversing the list/string. Since there is no string datatype in Erlang, the two are only differentiated by their contents. > Or, in other words, if jinterface has decided to receive an > OtpErlangString (from a sent list like [1, 2, 3], for example), is > there an easy way to convert it to an OtpErlangList? I know I can do > it by hand, but that's ever so slightly icky. Actually, it is Erlang that decides to encode a list as a STRING_EXTor as a LIST_EXT, as an optimization. The way to handle that is by expecting either a list or a string and convert from each of them to the Java class you're going to use. Slightly icky, as you say... Maybe OtpErlangString should have inherited from OtpErlangList? best regards, Vlad From rtrlists@REDACTED Tue Dec 9 11:37:32 2008 From: rtrlists@REDACTED (Robert Raschke) Date: Tue, 9 Dec 2008 10:37:32 +0000 Subject: [erlang-questions] jinterface List vs. String In-Reply-To: <95be1d3b0812090215v1416d752qb3c1586ab1166427@mail.gmail.com> References: <6a3ae47e0812090154n2c197e0al495f75fc93e0820d@mail.gmail.com> <95be1d3b0812090215v1416d752qb3c1586ab1166427@mail.gmail.com> Message-ID: <6a3ae47e0812090237x43f93d74u1e9bd75c31fe0447@mail.gmail.com> Hi Vlad, thanks for the info. On Tue, Dec 9, 2008 at 10:15 AM, Vlad Dumitrescu wrote: > Hi, > > On Tue, Dec 9, 2008 at 10:54, Robert Raschke wrote: >> does anyone have a good idea on how I can distinguish between a list >> and a string in jinterface? > > The short answer is that you can't without traversing the list/string. > Since there is no string datatype in Erlang, the two are only > differentiated by their contents. > >> Or, in other words, if jinterface has decided to receive an >> OtpErlangString (from a sent list like [1, 2, 3], for example), is >> there an easy way to convert it to an OtpErlangList? I know I can do >> it by hand, but that's ever so slightly icky. > > Actually, it is Erlang that decides to encode a list as a STRING_EXTor > as a LIST_EXT, as an optimization. > > The way to handle that is by expecting either a list or a string and > convert from each of them to the Java class you're going to use. > Slightly icky, as you say... > > Maybe OtpErlangString should have inherited from OtpErlangList? > > best regards, > Vlad > Maybe something like the following could be added to the OtpErlangString class? /** * Get this Erlang string as an Erlang list of Erlang bytes. * * @return the list of bytes contained in this string. **/ public OtpErlangList asOtpErlangList() { byte[] b = str.getBytes(); OtpErlangByte[] eb = new OtpErlangByte[b.length]; for (int i = 0; i < b.length; i++) eb[i] = new OtpErlangByte(b[i]); return new OtpErlangList(eb); } I haven't done Java in a while, maybe there's a way to "overload" the cast operator? That would be another way. Robby From ed.stow@REDACTED Tue Dec 9 12:02:02 2008 From: ed.stow@REDACTED (Edward Stow) Date: Tue, 9 Dec 2008 22:02:02 +1100 Subject: [erlang-questions] Eunit installation Message-ID: Hi, I am a total noob wrt Erlang having just started with the language and cannot get eunit installed. I have installed erlang on Ubuntu 8.10 with aptitude. The versions for Erlang I guess are in the RELEASES file. $ cat /usr/lib/erlang/releases/RELEASES [{release,"OTP APN 181 01","R12B","5.6.3", [{kernel,"2.12.3","/usr/lib/erlang/lib/kernel-2.12.3"}, {stdlib,"1.15.3","/usr/lib/erlang/lib/stdlib-1.15.3"}, {sasl,"2.1.5.3","/usr/lib/erlang/lib/sasl-2.1.5.3"}], permanent}]. eunit is not included in the /usr/lib/erlang/lib directory. The instructions at the download page state that "[the] easiest way to correct the problem is to manually copy the eunit.hrl file to the installation directory." What is the installation directory? /usr/lib/erlang ? I tried to make eunit from source: $sudo svn export http://svn.process-one.net/contribs/trunk/eunit eunit $cd eunit $sudo make but have the following messages and errors edward@REDACTED:~/eunit$ sudo make make[1]: Entering directory `/home/edward/eunit/src' erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -o../ebin eunit_autoexport.erl erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -o../ebin eunit_striptests.erl erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -o../ebin eunit.erl erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -o../ebin eunit_tests.erl erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -o../ebin eunit_server.erl erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -o../ebin eunit_proc.erl erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -o../ebin eunit_serial.erl erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -o../ebin eunit_test.erl erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -o../ebin eunit_lib.erl erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -o../ebin eunit_data.erl erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -o../ebin eunit_tty.erl erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -o../ebin code_monitor.erl erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars +warn_unused_import -o../ebin file_monitor.erl ./file_monitor.erl:39: can't find include lib "eunit/include/eunit.hrl" make[1]: *** [../ebin/file_monitor.beam] Error 1 make[1]: Leaving directory `/home/edward/eunit/src' make: *** [subdirs] Error 2 Thanks -- Edward From vychodil.hynek@REDACTED Tue Dec 9 12:09:13 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 9 Dec 2008 12:09:13 +0100 Subject: [erlang-questions] Sending a message to a process that no longer exists In-Reply-To: <3dbc6d1c0812090204j5ac10d6at824e5f9d1ae9aa03@mail.gmail.com> References: <97619b170812082158r72999d55i6b8e0c8a04a57d38@mail.gmail.com> <446DFEC3-3250-4EC8-8F0F-512501B20359@geophile.com> <493E12CD.6090807@m5net.com> <97619b170812090109k129560e7mdcae94f77ee8f680@mail.gmail.com> <3dbc6d1c0812090204j5ac10d6at824e5f9d1ae9aa03@mail.gmail.com> Message-ID: <20081209110914.6895F24064@relay.gooddata.com> or also look at do_call/4 and wait_resp_mon/3 in gen.erl 2008/12/9 Robert Virding > Using erlang:monitor/2 is better as the process could die after you check > it is alive but before it replies. > > Do you know that it will alwys reply? > > Check the module io.erl in stdlib which uses erlang:monitor/2 to make sure > that io servers are alive long enough to reply to an io request. There is a > bit of trickery needed when removing the monitor with erlang:demonitor/1 to > make sure no 'DOWN' messages are left in the mailbox. N.B. monitoring stacks > so you have to be careful to remove as many as you add. > > If you are going to send many requests in one go to the process it would be > better to wrap the whole "transaction" with monitor/demonitor. > > Robert > > 2008/12/9 Rapsey > >> Or you can use a monitor (erlang:monitor/2), to receive a message when a >> process dies. >> Or you can check if a proces is alive with: erlang:is_process_alive(PID) >> >> >> Sergej >> >> >> On Tue, Dec 9, 2008 at 7:40 AM, Bernard Duggan wrote: >> >>> Jack Orenstein wrote: >>> > On Dec 9, 2008, at 12:58 AM, Rapsey wrote: >>> > >>> > >>> >> Using the send operator is very common. To avoid endless waiting in >>> >> a receive statement you can use after: >>> >> >>> >> receive >>> >> {Server, Response} -> >>> >> ?DUMP({send_and_receive, received, Response}), >>> >> Response >>> >> after 1000 -> >>> >> void >>> >> end. >>> >> >>> > >>> > But this won't distinguish a dead process from a slow one. >>> > >>> If you want to ensure the process is running, you can use >>> process_flag(trap_exit, true), >>> and then spawn_link(), instead of spawn() to create the server process. >>> Then, in your receive block above add a pattern >>> >>> {'EXIT', Server, Reason} >>> >>> This will be sent to you when the server process exits for whatever >>> reason. >>> >>> Cheers, >>> >>> Bernard >>> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil -------------- next part -------------- An HTML attachment was scrubbed... URL: From ed.stow@REDACTED Tue Dec 9 12:25:38 2008 From: ed.stow@REDACTED (Edward Stow) Date: Tue, 9 Dec 2008 22:25:38 +1100 Subject: [erlang-questions] Noob questions: Searching a tree Message-ID: Hi Is this a friendly place to ask very simple questions about Erlang and functional programming. I'm learning both at the same time. For example I want to search for a value in the nodes of a tree structure. The tree is simply nested lists. For example 6> tut1:search(a, [b, [a]]). true 7> tut1:search(a, [b, [c]]). false 8> tut1:search(a, [ [a], b]). true My implementation is: Is this implementation OK or how else would it be performed. -module(tut1). -export([search/2]). %% Search for an element in tree (nested lists) search(_, []) -> false; search(A, [A|_]) -> true; search(A, [H|T]) when list(H), length(H) > 0 -> [H1|T1] = H, search(A, [H1 | [T1 | T]]); search (A, [_|T]) -> search(A, T). Question: I'm not really sure of the semantics of the comma operator in the function when clause: search(A, [H|T]) when list(H), length(H) > 0 -> Can somebody point me towards some relevant documentation. Thanks -- Edward Stow From richardc@REDACTED Tue Dec 9 12:47:55 2008 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 09 Dec 2008 12:47:55 +0100 Subject: [erlang-questions] Eunit installation In-Reply-To: References: Message-ID: <493E5AEB.8050507@it.uu.se> Edward Stow wrote: > I have installed erlang on Ubuntu 8.10 with aptitude. > > The versions for Erlang I guess are in the RELEASES file. > > $ cat /usr/lib/erlang/releases/RELEASES > [{release,"OTP APN 181 01","R12B","5.6.3", > [{kernel,"2.12.3","/usr/lib/erlang/lib/kernel-2.12.3"}, > {stdlib,"1.15.3","/usr/lib/erlang/lib/stdlib-1.15.3"}, > {sasl,"2.1.5.3","/usr/lib/erlang/lib/sasl-2.1.5.3"}], > permanent}]. > > eunit is not included in the /usr/lib/erlang/lib directory. No, the version you get with aptitude predates R12B-5, which is when eunit was first incluced with the OTP distribution. > The instructions at the download page state that "[the] easiest way to > correct the problem is to manually copy the eunit.hrl file to the > installation directory." What is the installation directory? > /usr/lib/erlang ? This doesn't apply to you since you didn't dowload the R12B-5 source distribution which for the first few days contained a bug in 'make install'. The tarball that you can download now has been fixed. If your Ubuntu package installed at /usr/lib/erlang/, you should copy the entire eunit application to /usr/lib/erlang/lib/eunit, and the system will then automatically add its modules to the path (but you have to build them first). > I tried to make eunit from source: > /usr/lib/erlang/ > $sudo svn export http://svn.process-one.net/contribs/trunk/eunit eunit > $cd eunit > $sudo make > > but have the following messages and errors > > edward@REDACTED:~/eunit$ sudo make > make[1]: Entering directory `/home/edward/eunit/src' > erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars > +warn_unused_import -o../ebin file_monitor.erl > ./file_monitor.erl:39: can't find include lib "eunit/include/eunit.hrl" > make[1]: *** [../ebin/file_monitor.beam] Error 1 > make[1]: Leaving directory `/home/edward/eunit/src' > make: *** [subdirs] Error 2 Sorry for that - I've been working on that file recently, and didn't realize I'd broken the build for people who didn't already have eunit in the path. I just checked in a fix. /Richard From vladdu55@REDACTED Tue Dec 9 12:52:19 2008 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 9 Dec 2008 12:52:19 +0100 Subject: [erlang-questions] jinterface List vs. String In-Reply-To: <6a3ae47e0812090237x43f93d74u1e9bd75c31fe0447@mail.gmail.com> References: <6a3ae47e0812090154n2c197e0al495f75fc93e0820d@mail.gmail.com> <95be1d3b0812090215v1416d752qb3c1586ab1166427@mail.gmail.com> <6a3ae47e0812090237x43f93d74u1e9bd75c31fe0447@mail.gmail.com> Message-ID: <95be1d3b0812090352s5b210ffah1d6c45593d7a0950@mail.gmail.com> > Maybe something like the following could be added to the OtpErlangString class? > > /** > * Get this Erlang string as an Erlang list of Erlang bytes. > * > * @return the list of bytes contained in this string. > **/ > public OtpErlangList asOtpErlangList() { > byte[] b = str.getBytes(); > OtpErlangByte[] eb = new OtpErlangByte[b.length]; > for (int i = 0; i < b.length; i++) > eb[i] = new OtpErlangByte(b[i]); > return new OtpErlangList(eb); > } Yes, that would work. It is useful if you're going to keep your data as OtpErlangObjects, if you're going to convert it to Java String or List or whatever, then you can just as well do it directly. > I haven't done Java in a while, maybe there's a way to "overload" the > cast operator? That would be another way. No, that isn't possible. regards, Vlad From vychodil.hynek@REDACTED Tue Dec 9 13:07:43 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 9 Dec 2008 13:07:43 +0100 Subject: [erlang-questions] Noob questions: Searching a tree In-Reply-To: References: Message-ID: <20081209120744.B143424063@relay.gooddata.com> Look at http://www.erlang.org/doc/reference_manual/expressions.html#guards comma works as andalso - lazy and semicolon works as orelse - lazy or On Tue, Dec 9, 2008 at 12:25 PM, Edward Stow wrote: > Hi > > Is this a friendly place to ask very simple questions about Erlang and > functional programming. I'm learning both at the same time. For > example I want to search for a value in the nodes of a tree structure. > The tree is simply nested lists. For example > > 6> tut1:search(a, [b, [a]]). > true > 7> tut1:search(a, [b, [c]]). > false > 8> tut1:search(a, [ [a], b]). > true > > My implementation is: Is this implementation OK or how else would it > be performed. > > -module(tut1). > -export([search/2]). > > %% Search for an element in tree (nested lists) > > search(_, []) -> > false; > > search(A, [A|_]) -> > true; > > search(A, [H|T]) when list(H), length(H) > 0 -> > [H1|T1] = H, > search(A, [H1 | [T1 | T]]); > > search (A, [_|T]) -> > search(A, T). > > Question: I'm not really sure of the semantics of the comma operator > in the function when clause: > search(A, [H|T]) when list(H), length(H) > 0 -> > Can somebody point me towards some relevant documentation. > > Thanks > -- > > Edward Stow > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Tue Dec 9 13:25:18 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 9 Dec 2008 12:25:18 +0000 Subject: [erlang-questions] Problem using short names in OS X Leopard In-Reply-To: <68FE80CB-F07E-4F27-A605-8874014D9331@fastmail.fm> References: <68FE80CB-F07E-4F27-A605-8874014D9331@fastmail.fm> Message-ID: <1F351FC0-B6EE-47AB-A7D6-3076484A4ED6@gmail.com> On Dec 9, 2008, at 1:29 AM, Dane Jensen wrote: > Hi All- > > I'm running into problems using distributed Erlang with short names (- > sname) in R12-B5 installed through MacPorts in Leopard that I'm hoping > someone can help me sort out. > > The gist of it is that they just don't work... at all. bigdaddy:~ joelr$ uname -a Darwin bigdaddy.local 9.5.0 Darwin Kernel Version 9.5.0: Wed Sep 3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386 i386 bigdaddy:~ joelr$ erl -sname foo Erlang (BEAM) emulator version 5.6.5 [source] [async-threads:0] [kernel-poll:false] Works for me and always has. It does ask whether I want to grant beam permission to connect, though, at least the first time around. -- http://wagerlabs.com From bernie@REDACTED Tue Dec 9 12:59:45 2008 From: bernie@REDACTED (Bernard Duggan) Date: Tue, 09 Dec 2008 22:59:45 +1100 Subject: [erlang-questions] Noob questions: Searching a tree In-Reply-To: References: Message-ID: <493E5DB1.8010300@m5net.com> Edward Stow wrote: > Is this a friendly place to ask very simple questions about Erlang and > functional programming. I hope so - I've only been here a couple of days myself - since I couldn't find any specific guidelines, I'm just going to assume it is :) > [snip] > > search(A, [H|T]) when list(H), length(H) > 0 -> > [H1|T1] = H, > search(A, [H1 | [T1 | T]]); > > [snip] > Looks like a pretty neat implementation to me. Of course, trees are usually used for ordered data, meaning the search can be done faster than O(n). What you have here will do a straight linear search, which would make me wonder what the point of having a tree at all is :) For unordered data like you will presumably have, you could do the whole thing with something like: search(A, T) -> lists:any(fun(E) -> A =:= E end, lists:flatten(T)). (Unless what you're looking for is itself a list...) > Question: I'm not really sure of the semantics of the comma operator > in the function when clause: > search(A, [H|T]) when list(H), length(H) > 0 -> > Can somebody point me towards some relevant documentation. The comma operator in guards acts as an 'and' operation so what you have is equivalent to "list(H) and length(H) > 0". As a side note, I believe the newer is_list() is preferred these days :) The full reference manual is at http://erlang.org/doc/reference_manual/part_frame.html - look at the section on Guard Sequences. Also, you could simplify that middle block a bit by changing the signature to: search(A, [[H1|T1]|T]) -> Which does away with the need for both the guard and the assignment on the first line. Hope that helps - what I say should be taken with a grain of salt - I've been tinkering with erlang for over a year now, but I'm kind of new at giving advice or having anyone who knows what they're talking about look at my work :) Cheers, Bernard From joelr1@REDACTED Tue Dec 9 14:40:30 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 9 Dec 2008 13:40:30 +0000 Subject: [erlang-questions] ideas for an iphone app Message-ID: <363C5F8C-9515-4CA8-9B9C-AF4020AB482B@gmail.com> What would be a good iPhone app to showcase the capabilities of Erlang? Thanks, Joel -- http://wagerlabs.com From ms@REDACTED Tue Dec 9 15:13:39 2008 From: ms@REDACTED (Martin Scholl) Date: Tue, 09 Dec 2008 15:13:39 +0100 Subject: [erlang-questions] ideas for an iphone app In-Reply-To: <363C5F8C-9515-4CA8-9B9C-AF4020AB482B@gmail.com> References: <363C5F8C-9515-4CA8-9B9C-AF4020AB482B@gmail.com> Message-ID: <493E7D13.5070901@diskware.net> Hello Joel, a browser with a Flash engine :-p Martin From joseph.stewart@REDACTED Tue Dec 9 15:16:58 2008 From: joseph.stewart@REDACTED (Joseph Stewart) Date: Tue, 9 Dec 2008 09:16:58 -0500 Subject: [erlang-questions] ideas for an iphone app In-Reply-To: <363C5F8C-9515-4CA8-9B9C-AF4020AB482B@gmail.com> References: <363C5F8C-9515-4CA8-9B9C-AF4020AB482B@gmail.com> Message-ID: <2781f020812090616j1be65d65w90fa5de39c0db000@mail.gmail.com> Joel, If high concurrency is what Erlang is good at, I'm not sure the iPhone is the best target... but it does bring up something that has been brewing (heretically) in my mind for a few days. Has anyone considered Inferno -> Erlang interoperability? Inferno has demonstrated an ability to run in low-end, memory constrained devices. And while Limbo doesn't look much like Erlang, they do share a bit of philosophy about concurrency being part of the core language. I'd propose a server-side game server in Erlang with a client-side in Limbo. I'm pretty flame-retardant (or just lame and retarded), so bring it on... -joe On Tue, Dec 9, 2008 at 8:40 AM, Joel Reymont wrote: > What would be a good iPhone app to showcase the capabilities of Erlang? > > Thanks, Joel > > -- > http://wagerlabs.com > > > > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ms@REDACTED Tue Dec 9 15:22:15 2008 From: ms@REDACTED (Martin Scholl) Date: Tue, 09 Dec 2008 15:22:15 +0100 Subject: [erlang-questions] Wiesbaden, Frankfurt, Kassel: Erlounge? Message-ID: <493E7F17.1040400@diskware.net> Hello all, anybody near Wiesbaden, Frankfurt, Kassel interested in founding an erlounge? Martin From joelr1@REDACTED Tue Dec 9 15:53:09 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 9 Dec 2008 14:53:09 +0000 Subject: [erlang-questions] ideas for an iphone app In-Reply-To: References: <363C5F8C-9515-4CA8-9B9C-AF4020AB482B@gmail.com> Message-ID: <800DAB8F-1B53-4AB7-A014-41CF3BE8CF5B@gmail.com> On Dec 9, 2008, at 2:17 PM, Dave Bryson wrote: > What about a iPhone UI to Openpoker? Then you can gamble anywhere! One big problem: http://www.techcrunch.com/2008/11/13/zyngas-full-house-puts-its-online-iphone-poker-on-top/ How would my app be different?! -- http://wagerlabs.com From hans.bolinder@REDACTED Tue Dec 9 16:23:31 2008 From: hans.bolinder@REDACTED (Hans Bolinder) Date: Tue, 9 Dec 2008 16:23:31 +0100 Subject: [erlang-questions] qlc join query results In-Reply-To: <493CA52C.9000205@m5net.com> References: <493C90F5.6070408@m5net.com> <493CA52C.9000205@m5net.com> Message-ID: <18750.36211.602712.866086@ornendil.du.uab.ericsson.se> [Bernard Duggan:] > > What exactly is it about that ordering of generators that causes > > qlc to choose a different join method and, in a more general > > sense, how can we predict which method will be chosen? > Whoops - on inspection of the results of qlc:info(), it appears both the > first and second queries use the 'merge' join method. So my question > above should in fact read "why does the 'merge' join method produce > different results depending on the order of the generators?". It's a bug. Thanks for reporting it. Best regards, Hans Bolinder, Erlang/OTP, Ericsson *** /usr/local/otp/releases/otp_beam_linux_sles10_x64_r12b_patched/lib/stdlib-1.15.5/src/qlc.erl Thu Nov 6 12:10:06 2008 --- /clearcase/otp/erts/lib/stdlib/src/qlc.erl Tue Dec 9 16:00:15 2008 *************** *** 2978,2985 **** end. %% element(C2, E2_0) == K1, element(C2, E2) == K1_0 ! same_keys1(E1_0, _K1_0, [], _C1, E2, _C2, E2_0, _L2, M) -> ! end_merge_join([?JWRAP(E1_0, E2_0), ?JWRAP(E1_0, E2)], M); same_keys1(E1_0, K1_0, [E1 | _]=L1, C1, E2, C2, E2_0, L2, M) -> K1 = element(C1, E1), if --- 2978,2986 ---- end. %% element(C2, E2_0) == K1, element(C2, E2) == K1_0 ! same_keys1(E1_0, K1_0, []=L1, C1, E2, C2, E2_0, L2, M) -> ! [?JWRAP(E1_0, E2_0), ?JWRAP(E1_0, E2) | ! fun() -> same_keys(K1_0, E1_0, L1, C1, L2, C2, M) end]; same_keys1(E1_0, K1_0, [E1 | _]=L1, C1, E2, C2, E2_0, L2, M) -> K1 = element(C1, E1), if From alustenberg@REDACTED Tue Dec 9 16:32:33 2008 From: alustenberg@REDACTED (Alex) Date: Tue, 9 Dec 2008 10:32:33 -0500 Subject: [erlang-questions] query about FILE_BUFSIZE in ftp.erl In-Reply-To: <20908591.post@talk.nabble.com> References: <20908591.post@talk.nabble.com> Message-ID: <915e7e1d0812090732t134771b5h5a5e2e702fec54af@mail.gmail.com> 4096 is a common buffer size, as it fits in a single page of memory. increasing it will increase runtime memory usage and thats pretty much it, AFAIK. On Mon, Dec 8, 2008 at 11:24 PM, sandeep_k wrote: > > Hi, > In erlang source code (ftp.erl) there is -define(FILE_BUFSIZE, > 4096). > can I know the reason why the FILE_BUFSIZE is specified as 4096? > what will happen if I increase value FILE_BUFSIZE? > > > -- > View this message in context: http://www.nabble.com/query-about-FILE_BUFSIZE-in-ftp.erl-tp20908591p20908591.html > Sent from the Erlang Questions mailing list archive at Nabble.com. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From exta7@REDACTED Tue Dec 9 18:00:10 2008 From: exta7@REDACTED (Zvi) Date: Tue, 9 Dec 2008 09:00:10 -0800 (PST) Subject: [erlang-questions] Geographical distribution of Erlang programmers Message-ID: <20918802.post@talk.nabble.com> Hi, I want to know the geographical distribution of Erlang programmers. In other words: "If you going to open Erlang shop, where is the best place to do it?". Thanks in Advance, Zvi -- View this message in context: http://www.nabble.com/Geographical-distribution-of-Erlang-programmers-tp20918802p20918802.html Sent from the Erlang Questions mailing list archive at Nabble.com. From peter@REDACTED Tue Dec 9 19:02:06 2008 From: peter@REDACTED (Peter Sabaini) Date: Tue, 9 Dec 2008 19:02:06 +0100 Subject: [erlang-questions] xmerl scan stream In-Reply-To: <2e23d1d20812081835o4ea806c9sefcb9e131b5ddb83@mail.gmail.com> References: <200812082138.59380.peter@sabaini.at> <200812090110.11644.peter@sabaini.at> <2e23d1d20812081835o4ea806c9sefcb9e131b5ddb83@mail.gmail.com> Message-ID: <200812091902.06485.peter@sabaini.at> Hi list, thanks for all the suggestions -- I've got something that works for me now. In case anyone finds it useful (the docs are often a bit sparse), I've written down what I did here: http://sabaini.at/blog/erlang/learning-erlang-stream-xml.html Thanks again! peter. On Tuesday 09 December 2008 03:35:43 David Budworth wrote: > For what it's worth, i ended up going with erlsom for xml parsing due to > speed and ease of streaming parses. > > I would just loop over my buffer with: > erlsom:parse_simple(Buffer) > > which returns > {xmlstruct,Remainder} > > or if there isn't a complete doc in the buffer, it raises > {error,"Malformed:..."}, so basically I had > > stream_loop(Data) -> > case catch elrsom:simple_form(Data) of > {ok,Xml,Rest} -> server ! {newXML,Xml}, stream_loop(Rest); > {error,"Malformed"++_} -> server ! {needMore,Data} > end. > > (note: not real code, just an example) > > This may be possible with xmerl as well, I know I had both working with > just simple straight parsing, but I don't recall the "return struct + left > over bytes" as being a feature of the parser. > > in my testing, i think for my sample xml (smallish, 399 bytes), I was > getting 90uSec / msg with erlsom and 125uSec / msg with xmerl. (running on > dual quad 3ghz 8gb ram box, not that that matters for a single threaded > test like this) > > both perfectly speedy (and faster than any java parser I've used), but for > this particular app (xml router) speed is king. > > plus, I found erlsom's "simple form" to be a bit easier to deal with at the > time. Not sure why I thought that now though. > > It does solve you problem in that you get your xml doc(s) as soon as you > receive the bytes. > > hope that helps, > > -David > > On Mon, Dec 8, 2008 at 6:10 PM, Peter Sabaini wrote: > > Hm, as an afterthought -- this still doesn't solve the original problem, > > does > > it? > > > > Say I have this on my input stream: > > > > % telnet localhost 2345 > > Trying 127.0.0.1... > > Connected to localhost.local. > > Escape character is '^]'. > > > > a > > > > > > > > ----- > > > > then I only get the a structure back as soon as is > > entered, > > correct? > > > > Thanks, > > peter. > > > > On Tuesday 09 December 2008 00:30:42 Peter Sabaini wrote: > > > On Monday 08 December 2008 23:53:59 Ulf Wiger wrote: > > > > True, you can't really use it directly, but you can copy > > > > the code. Basically, the read_chunk/2 function should > > > > be replaced by something along the lines of: > > > > > > > > read_chunk(Sofar) -> > > > > receive > > > > {tcp, _Socket, Bin} -> > > > > {ok, iolist_to_binary([Sofar, Bin])}; > > > > {tcp, closed, _} -> > > > > eof > > > > end. > > > > > > Ok... > > > > > > > (View this as pseudo code.) > > > > > > > > You should probably use gen_tcp:recv() instead, or > > > > at least an {active, once} socket. > > > > > > At the moment, this is for "trusted" clients only, so I can code this > > > rather liberally, without fear that somebody could abuse that -- is > > > that what you meant? > > > > > > > But you need to > > > > rewrite xmerl_eventp:stream/2 slightly. > > > > > > Ok, I'll try that and report any outcome, maybe other people find this > > > useful too. > > > > > > Thanks, > > > peter. > > > > > > > The complication, when you get down to it, is that the > > > > stream continuation fun must take care not to break > > > > up the stream in the wrong place. This is because xmerl > > > > doesn't use a proper tokenizer, but does a one-pass > > > > parse which relies rather heavily on pattern matching. > > > > > > > > This is what the find_good_split() function is for. > > > > > > > > BR, > > > > Ulf W > > > > > > > > 2008/12/8 Peter Sabaini : > > > > > On Monday 08 December 2008 23:09:39 Ulf Wiger wrote: > > > > >> Hi Peter, > > > > >> > > > > >> Have you looked at the module xmerl_eventp in xmerl? > > > > >> > > > > >> You might even be able to use it directly. > > > > > > > > > > Yes, I suspected that this module might do what I need -- > > > > > unfortunately, being the thick-skulled newbie that I am, I haven't > > > > been > > > > > > > able to figure out how... The docs here > > > > > http://www.erlang.org/doc/man/xmerl_eventp.html are pretty > > > > > succinct. Aren't the functions in xmerl_eventp for scanning files? > > > > > Or could I > > > > use > > > > > > > those also with a TCP socket? > > > > > > > > > > Thanks, > > > > > peter. > > > > > > > > > >> BR, > > > > >> Ulf W > > > > >> > > > > >> 2008/12/8 Peter Sabaini : > > > > >> > Hi list, > > > > >> > > > > > >> > I am trying to get xmerl to parse a stream of data coming in via > > > > >> > a TCP socket. The goal would be for xmerl to return xmlRecords > > > > >> > as > > > > soon > > > > > > >> > as one is complete. > > > > >> > > > > > >> > I use the continuation function option of xmerl and so far that > > > > >> > works ok; unfortunately I only get an xmlRecord as soon as the > > > > next > > > > > > >> > xml element starts. Is there a way to tell xmerl to "evaluate > > > > >> > eagerly"? > > > > >> > > > > > >> > Below is the test code I used; any help much appreciated. Is > > > > >> > this even possible? Or am I completely on the wrong track and > > > > >> > should > > > > use > > > > > > >> > a SAX model instead? > > > > >> > > > > > >> > -- snip -- > > > > >> > > > > > >> > -module(ap). > > > > >> > -compile(export_all). > > > > >> > > > > > >> > start_server() -> > > > > >> > {ok, Listen} = gen_tcp:listen(2345, [binary, {packet, raw}, > > > > >> > {reuseaddr, true}, > > > > >> > {active, true}]), > > > > >> > spawn(fun() -> par_connect(Listen) end). > > > > >> > > > > > >> > par_connect(Listen) -> > > > > >> > {ok, _Socket} = gen_tcp:accept(Listen), > > > > >> > spawn(fun() -> par_connect(Listen) end), > > > > >> > io:format("par_c ~n", []), > > > > >> > X = xmerl_scan:string("", [{continuation_fun, fun > > > > continue/3}]), > > > > > > >> > io:format("X: ~p ~n", [X]). > > > > >> > > > > > >> > continue(Continue, Exception, GlobalState) -> > > > > >> > io:format("entered continue/3 ~n", []), > > > > >> > receive > > > > >> > {tcp, _Socket, Bin} -> > > > > >> > Str = binary_to_list(Bin), > > > > >> > io:format("got Str ~p ~n", [Str]), > > > > >> > Continue(Str, GlobalState); > > > > >> > {tcp_closed, _} -> > > > > >> > io:format("Server socket closed~n" ), > > > > >> > Exception(GlobalState) > > > > >> > end. > > > > >> > > > > > >> > main() -> > > > > >> > start_server(). > > > > >> > > > > > >> > > > > > >> > -- snip -- > > > > >> > > > > > >> > -- > > > > >> > Peter Sabaini > > > > >> > http://sabaini.at/ > > > > >> > > > > > >> > > > > > >> > _______________________________________________ > > > > >> > erlang-questions mailing list > > > > >> > erlang-questions@REDACTED > > > > >> > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > -- > > > > > Peter Sabaini > > > > > http://sabaini.at/ > > > > -- > > Peter Sabaini > > http://sabaini.at/ > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions -- Peter Sabaini http://sabaini.at/ From joelr1@REDACTED Tue Dec 9 19:43:05 2008 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 9 Dec 2008 18:43:05 +0000 Subject: [erlang-questions] better profiler for erlang / ways to troubleshoot a running system Message-ID: <1B264F23-B53D-4EDC-A5E8-9DF2E8EF3F5C@gmail.com> I had a terrible bout with the Erlang profiler recently and a very poor experience trying to understand the bottlenecks and issues while scaling OpenPoker. I'm wondering, how much of a market is there for a commercial Erlang profiler or tool that lets you peer into a running system, trace packets end to end, etc. For example, I badly wanted to tag a certain packet incoming over a socket and then timestamp it as it goes through the system, until a reply packet is returned to the socket. I wanted to measure the time it took my packet to go from function to function but couldn't. I envision loading a trace message dump into triple store, gigabytes of it, and then querying the data in various ways to better understand the behavior of my system. A triple store holds subject/predicate/ object triples which map well to source pid/message/destination pid. A good triple store should hold gigabytes of data with no trouble. Thoughts? -- http://wagerlabs.com From mihai@REDACTED Tue Dec 9 19:57:20 2008 From: mihai@REDACTED (Mihai Balea) Date: Tue, 9 Dec 2008 13:57:20 -0500 Subject: [erlang-questions] Geographical distribution of Erlang programmers In-Reply-To: <20918802.post@talk.nabble.com> References: <20918802.post@talk.nabble.com> Message-ID: On Dec 9, 2008, at 12:00 PM, Zvi wrote: > > Hi, > > I want to know the geographical distribution of Erlang programmers. > In other words: "If you going to open Erlang shop, where is the best > place > to do it?". The office building across the street from my house. They have some vacancies. Seriously speaking, Sweden is probably your best bet :) Even more seriously, why does it have to be in any specific place? Do it remotely, over the internet. Mihai PS: FWIW, I'm in Central New Jersey, USA From kenneth.lundin@REDACTED Tue Dec 9 21:55:56 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Tue, 9 Dec 2008 21:55:56 +0100 Subject: [erlang-questions] better profiler for erlang / ways to troubleshoot a running system In-Reply-To: <1B264F23-B53D-4EDC-A5E8-9DF2E8EF3F5C@gmail.com> References: <1B264F23-B53D-4EDC-A5E8-9DF2E8EF3F5C@gmail.com> Message-ID: There is already support for following a "forlopp" of messages originating from a certain point. Take a look at the seq_trace module. The sequential tracing can be activated by code that you prepare yourself in your app or by use of match specifications see http://www.erlang.org/doc/apps/erts/match_spec.html#1 and here http://www.erlang.org/doc/man/dbg.html#advanced where you se an example of how to activate sequential tracing without preparation of your application code. Just trace on something suitable where you can activate the sequential trace. Note it is Erlang messages that creates the sequence going from Erlang process to Erlang process. /Kenneth Erlang/OTP, Ericsson On Tue, Dec 9, 2008 at 7:43 PM, Joel Reymont wrote: > I had a terrible bout with the Erlang profiler recently and a very > poor experience trying to understand the bottlenecks and issues while > scaling OpenPoker. > > I'm wondering, how much of a market is there for a commercial Erlang > profiler or tool that lets you peer into a running system, trace > packets end to end, etc. > > For example, I badly wanted to tag a certain packet incoming over a > socket and then timestamp it as it goes through the system, until a > reply packet is returned to the socket. I wanted to measure the time > it took my packet to go from function to function but couldn't. > > I envision loading a trace message dump into triple store, gigabytes > of it, and then querying the data in various ways to better understand > the behavior of my system. A triple store holds subject/predicate/ > object triples which map well to source pid/message/destination pid. A > good triple store should hold gigabytes of data with no trouble. > > Thoughts? > > -- > http://wagerlabs.com > > > > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From masse@REDACTED Tue Dec 9 21:59:07 2008 From: masse@REDACTED (mats cronqvist) Date: Tue, 09 Dec 2008 21:59:07 +0100 Subject: [erlang-questions] auto-syncing mnesia after a network split In-Reply-To: <493D8CA8.1030208@hyber.org> ("Claes =?iso-8859-1?Q?Wikstr=F6?= =?iso-8859-1?Q?m=22's?= message of "Mon\, 08 Dec 2008 22\:07\:52 +0100") References: <87skp69phl.fsf@sterlett.hq.kred> <493C54D9.8020008@hyber.org> <45F80B9D-6F93-430D-B64E-895EEAE453B2@gmail.com> <874p1evggh.fsf@sterlett.hq.kred> <539A1985-F49C-4433-98B7-3890FC9326C0@gmail.com> <493D3DED.4060504@hyber.org> <493D8CA8.1030208@hyber.org> Message-ID: <87iqptt690.fsf@sterlett.hq.kred> Claes Wikstr?m writes: > Jim McCoy wrote: > >> would be to add some complexity on the mechanics of the join mechanism >> (e.g. a quorum system like paxos to decide membership and agreement > > > A lot of the mnesia clusters only have 2 nodes - thus making > quorums a no-goer. typical HA telcoms chassis systems have exactly > two management blades. i find it quite humorous that the telecoms industry is paying thousands of people to work on solving this problem (how to reliably rejoin a partitioned network consisting of two nodes); a problem that has been proven (over 30 years ago) to have no solution. 30,000 man-years... that a chunk of change(*). certainly a lot more expensive than adding a third node. it's less humourous (at least to me) that i personally spent a few of those man-years, when all I had to do was google on "leslie lamport." mats (*) yes, i made that figure up. but i do believe it's the right magnitude. From chris.newcombe@REDACTED Wed Dec 10 00:04:49 2008 From: chris.newcombe@REDACTED (Chris Newcombe) Date: Tue, 9 Dec 2008 15:04:49 -0800 Subject: [erlang-questions] Book: "Robust Communications Software: Extreme Availability, Reliability and Scalability for Carrier-Grade Systems" Message-ID: <781dd98c0812091504h577fb81bu370ed788ff14f67d@mail.gmail.com> Has anyone (particularly AXD301/ENGINE/OTP folks) read the following book? "Robust Communications Software: Extreme Availability, Reliability and Scalability for Carrier-Grade Systems" by Greg Utas http://www.amazon.com/Robust-Communications-Software-Availability-Carrier-Grade/dp/0470854340 Is it any good? thanks, Chris Extract from product summary: Carrier-grade software must satisfy the stringent quality requirements of network operators whose systems provide mission-critical communications services. This book describes proven carrier-grade software techniques used in flagship products designed by industry leaders such as Lucent, Nortel, and Ericsson. In the age of 24/7, software robustness is a competitive advantage. This authoritative guide for software engineers, managers, and testers of products that face carrier-grade requirements helps you to develop state-of-the-art software that will give you an edge in today's marketplace. Robust Communications Software: Extreme Availability, Reliability and Scalability for Carrier-Grade Systems * offers advice on choosing the right technologies for building reliable software * incorporates real-world examples and design rationales when describing how to construct robust, embedded software for communications systems * presents a comprehensive set of carrier-grade design patterns that help you to meet extreme availability, reliability, scalability, and capacity requirements * gives advice on how to protect against and recover from software faults * discusses system installation, operability, maintenance, and on-site debugging Greg Utas has over 20 years of development experience in carrier-grade systems, including Chief Software Architect roles at Nortel Networks (GSM core networks) and Sonim Technologies (wireless push-to-talk services). He is currently a consultant specializing in the design of carrier-grade software. From bernie@REDACTED Wed Dec 10 00:22:39 2008 From: bernie@REDACTED (Bernard Duggan) Date: Wed, 10 Dec 2008 10:22:39 +1100 Subject: [erlang-questions] qlc join query results In-Reply-To: <18750.36211.602712.866086@ornendil.du.uab.ericsson.se> References: <493C90F5.6070408@m5net.com> <493CA52C.9000205@m5net.com> <18750.36211.602712.866086@ornendil.du.uab.ericsson.se> Message-ID: <493EFDBF.9030807@m5net.com> Hans Bolinder wrote: > [Bernard Duggan:] > >> Whoops - on inspection of the results of qlc:info(), it appears both the >> first and second queries use the 'merge' join method. So my question >> above should in fact read "why does the 'merge' join method produce >> different results depending on the order of the generators?". >> > > It's a bug. Thanks for reporting it. > No problem - thanks very much for the quick response and patch - worked a treat :) Cheers, Bernard From michael.truog@REDACTED Wed Dec 10 00:45:23 2008 From: michael.truog@REDACTED (michael.truog@REDACTED) Date: Tue, 9 Dec 2008 17:45:23 -0600 Subject: [erlang-questions] unhelpful backtrace truncation In-Reply-To: <66d1c98f0812081656n68d6cb45ob701c175afe569d0@mail.gmail.com> References: <66d1c98f0812081656n68d6cb45ob701c175afe569d0@mail.gmail.com> Message-ID: <43C605CCEBDDB044B5F39608E515DFBA02AB801C@daebe104.NOE.Nokia.com> Wouldn't the function call "erlang:system_flag(bracktrace_depth, Depth)" provide you more information here? -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of ext Roger Critchlow Sent: Monday, December 08, 2008 4:56 PM To: Erlang-Questions (E-mail) Subject: [erlang-questions] unhelpful backtrace truncation This kind of truncated stack backtrace, generated by erl -boot start_sasl: ** Reason for termination == ** {{key_exists,"7b181d15cebb4c86a6ad7fed3dbf30ce2223b4c5"}, [{gb_trees,insert_1,4}, {gb_trees,insert_1,4}, {gb_trees,insert_1,4}, {gb_trees,insert_1,4}, {gb_trees,insert_1,4}, {gb_trees,insert_1,4}, {gb_trees,insert_1,4}, {gb_trees,insert_1,4}]} is not very helpful. It is especially galling since I had to page past a 4000 line print out of the server's state to reach it. Is there some option to start_sasl which would print the entire stack backtrace? -- rec -- _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From rpettit@REDACTED Wed Dec 10 04:16:31 2008 From: rpettit@REDACTED (Rick Pettit) Date: Tue, 9 Dec 2008 21:16:31 -0600 (CST) Subject: [erlang-questions] accessing a local_content mnesia table from a remote node Message-ID: <54643.192.168.34.18.1228878991.squirrel@squirrelmail.vail> I am trying to access a local_content mnesia table on a remote node by way of something like: Fun=fun() -> ...mnesia read/write ops here... end, rpc:call(Node,mnesia,sync_transaction,[Fun]), and am getting an error about an undefined Fun being called from within the mnesia transaction. This is the first time I've tried using local_content mnesia tables (and the first time I've fought the mnesia API in which the location of the table(s) is always transparent to the caller). Is there a way to access a remote local_content mnesia table without having special code loaded on the remote node for accessing the table? In this case Node is a general purpose disc node which contains a number of tables for various applications, but no application-specific code (e.g. funs for passing to mnesia API for accessing the tables). -Rick From rec@REDACTED Wed Dec 10 04:16:56 2008 From: rec@REDACTED (Roger Critchlow) Date: Tue, 9 Dec 2008 20:16:56 -0700 Subject: [erlang-questions] unhelpful backtrace truncation In-Reply-To: <43C605CCEBDDB044B5F39608E515DFBA02AB801C@daebe104.NOE.Nokia.com> References: <66d1c98f0812081656n68d6cb45ob701c175afe569d0@mail.gmail.com> <43C605CCEBDDB044B5F39608E515DFBA02AB801C@daebe104.NOE.Nokia.com> Message-ID: <66d1c98f0812091916m538b46d9j6d3a8d23e80fdee0@mail.gmail.com> No, I get the same backtrace with erlang:system_flag(backtrace_depth, 100) as I did before. Thanks for the suggestion. -- rec -- On Tue, Dec 9, 2008 at 4:45 PM, wrote: > Wouldn't the function call "erlang:system_flag(bracktrace_depth, Depth)" > provide you more information here? > > > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of ext Roger > Critchlow > Sent: Monday, December 08, 2008 4:56 PM > To: Erlang-Questions (E-mail) > Subject: [erlang-questions] unhelpful backtrace truncation > > This kind of truncated stack backtrace, generated by erl -boot > start_sasl: > > ** Reason for termination == > ** {{key_exists,"7b181d15cebb4c86a6ad7fed3dbf30ce2223b4c5"}, > [{gb_trees,insert_1,4}, > {gb_trees,insert_1,4}, > {gb_trees,insert_1,4}, > {gb_trees,insert_1,4}, > {gb_trees,insert_1,4}, > {gb_trees,insert_1,4}, > {gb_trees,insert_1,4}, > {gb_trees,insert_1,4}]} > > is not very helpful. > > It is especially galling since I had to page past a 4000 line print out > of the server's state to reach it. > > Is there some option to start_sasl which would print the entire stack > backtrace? > > -- rec -- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From nick@REDACTED Wed Dec 10 04:39:32 2008 From: nick@REDACTED (Nick Gerakines) Date: Tue, 9 Dec 2008 19:39:32 -0800 Subject: [erlang-questions] SF Erlounge? Message-ID: I'm looking into hosting a SF Erlounge in mid January. Trying to get an early head count of those who would be interested. I'm shooting for the 14th or 15th (Wednesday or Thursday) from 7:00 pm to 8:00 pm with dinner/drinks located elsewhere afterward. The venue would be in San Francisco at 2nd and Harrison, a few blocks south of Market street. # Nick Gerakines From jao@REDACTED Wed Dec 10 05:29:30 2008 From: jao@REDACTED (Jack Orenstein) Date: Tue, 9 Dec 2008 23:29:30 -0500 Subject: [erlang-questions] Sending a message to a process that no longer exists In-Reply-To: <20081209110914.6895F24064@relay.gooddata.com> References: <97619b170812082158r72999d55i6b8e0c8a04a57d38@mail.gmail.com> <446DFEC3-3250-4EC8-8F0F-512501B20359@geophile.com> <493E12CD.6090807@m5net.com> <97619b170812090109k129560e7mdcae94f77ee8f680@mail.gmail.com> <3dbc6d1c0812090204j5ac10d6at824e5f9d1ae9aa03@mail.gmail.com> <20081209110914.6895F24064@relay.gooddata.com> Message-ID: <5F7C74B0-5978-4242-B806-1AF38763440A@geophile.com> Thanks for all the responses. Becoming a system process (suggested by Bernard Duggan) and catching 'EXIT' works. Monitoring (suggested by Rapsey) works and provides a bit more information than catching 'EXIT', e.g. noconnection. (Or will the 'EXIT' message do this too?) erlang:is_process_alive works, but only for local processes. Also, (as pointed out by Robert Virding), monitor/2 sends a 'DOWN' message instead of a boolean result that is immediately stale, (a problem if the process dies just after the send). Hynek Vychodil pointed me at gen:do_call/4, which is elaborate but looks foolproof. I tried some timings. For local processes, the extra work done by do_call is substantial, lowering message speed by a factor of 3 (on a MacBook Pro). For messages to other nodes, the difference is only about 10%. Jack From ulf@REDACTED Wed Dec 10 08:58:24 2008 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 10 Dec 2008 08:58:24 +0100 Subject: [erlang-questions] Book: "Robust Communications Software: Extreme Availability, Reliability and Scalability for Carrier-Grade Systems" In-Reply-To: <781dd98c0812091504h577fb81bu370ed788ff14f67d@mail.gmail.com> References: <781dd98c0812091504h577fb81bu370ed788ff14f67d@mail.gmail.com> Message-ID: <8209f740812092358i6355382am3560ac4984f92223@mail.gmail.com> I haven't read it. There's one customer review. Here's an extract: "It points out that many aspects of a modern computer system (pre-emptive multi-tasking, virtual memory, many short-lived processes/threads to handle task execution and dynamic garbage collection) are actually detrimental to the design of a carrier-grade system. " "[the developer team] shouldn't be put off by the C++ code in the early chapters." You can read parts of the book on-line via books.google.com, and from a quick perusal, I'd say that it's a pretty good book if you want an introduction into how to best write a carrier-class system in C++. From what he writes, you can extrapolate that Erlang is "dead wrong" for carrier-class systems(*). But then one needs to remember that his frame of reference is /mainstream/ programming technology. If you have the time, it might be useful to read the book, then read Joe's book, and meditate over the differences in approach. (*) This would be the superficial conclusion based on the fact that he dismisses dynamic processes (because POSIX threads are un- suitable for such programming), preemptive scheduling (because it forces you to use semaphores everywhere), and dynamic garbage collection (because it's very difficult to write a dynamic garbage collector yourself that doesn't cause long pauses). If your starting point is that there is no realistic alternative to C++ for real industrial work, I'd say this kind of book is a must. BR, Ulf W 2008/12/10 Chris Newcombe : > Has anyone (particularly AXD301/ENGINE/OTP folks) read the following book? > > "Robust Communications Software: Extreme Availability, Reliability > and Scalability for Carrier-Grade Systems" > by Greg Utas > > http://www.amazon.com/Robust-Communications-Software-Availability-Carrier-Grade/dp/0470854340 > > Is it any good? > > thanks, > > Chris > > Extract from product summary: > > Carrier-grade software must satisfy the stringent quality requirements > of network operators whose systems provide mission-critical > communications services. This book describes proven carrier-grade > software techniques used in flagship products designed by industry > leaders such as Lucent, Nortel, and Ericsson. > > In the age of 24/7, software robustness is a competitive advantage. > This authoritative guide for software engineers, managers, and testers > of products that face carrier-grade requirements helps you to develop > state-of-the-art software that will give you an edge in today's > marketplace. > > Robust Communications Software: Extreme Availability, Reliability and > Scalability for Carrier-Grade Systems > > * offers advice on choosing the right technologies for building > reliable software > * incorporates real-world examples and design rationales when > describing how to construct robust, embedded software for > communications systems > * presents a comprehensive set of carrier-grade design patterns > that help you to meet extreme availability, reliability, scalability, > and capacity requirements > * gives advice on how to protect against and recover from software faults > * discusses system installation, operability, maintenance, and > on-site debugging > > Greg Utas has over 20 years of development experience in carrier-grade > systems, including Chief Software Architect roles at Nortel Networks > (GSM core networks) and Sonim Technologies (wireless push-to-talk > services). He is currently a consultant specializing in the design of > carrier-grade software. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From hakan@REDACTED Wed Dec 10 10:10:35 2008 From: hakan@REDACTED (Hakan Mattsson) Date: Wed, 10 Dec 2008 10:10:35 +0100 (CET) Subject: [erlang-questions] accessing a local_content mnesia table from a remote node In-Reply-To: <54643.192.168.34.18.1228878991.squirrel@squirrelmail.vail> References: <54643.192.168.34.18.1228878991.squirrel@squirrelmail.vail> Message-ID: On Tue, 9 Dec 2008, Rick Pettit wrote: > Is there a way to access a remote local_content mnesia table without > having special code loaded on the remote node for accessing the table? No, there is no such support for access within transactions. You need to use the mnesia:dirty* functions. /H?kan From rasmussen.bryan@REDACTED Wed Dec 10 11:36:43 2008 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Wed, 10 Dec 2008 11:36:43 +0100 Subject: [erlang-questions] ideas for an iphone app In-Reply-To: <363C5F8C-9515-4CA8-9B9C-AF4020AB482B@gmail.com> References: <363C5F8C-9515-4CA8-9B9C-AF4020AB482B@gmail.com> Message-ID: <3bb44c6e0812100236n11e7d2c3p95e11dd377233196@mail.gmail.com> Well I guess this means an erlang app running in erlang compiled for the iphone right. Maybe... something Jabber related. maybe something that shows how well erlang handles failures - iphones are nodes, I keep thinking some sort of distributed application for large teams responding in crisis situations or maybe warfare situations. Best Regards, Bryan Rasmussen On Tue, Dec 9, 2008 at 2:40 PM, Joel Reymont wrote: > What would be a good iPhone app to showcase the capabilities of Erlang? > > Thanks, Joel > > -- > http://wagerlabs.com > > > > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From joelr1@REDACTED Wed Dec 10 12:01:47 2008 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 10 Dec 2008 11:01:47 +0000 Subject: [erlang-questions] ideas for an iphone app In-Reply-To: <3bb44c6e0812100236n11e7d2c3p95e11dd377233196@mail.gmail.com> References: <363C5F8C-9515-4CA8-9B9C-AF4020AB482B@gmail.com> <3bb44c6e0812100236n11e7d2c3p95e11dd377233196@mail.gmail.com> Message-ID: <2A6154FD-BF3A-453F-8B99-58BFD3763529@gmail.com> On Dec 10, 2008, at 10:36 AM, bryan rasmussen wrote: > Well I guess this means an erlang app running in erlang compiled for > the iphone right. Native iphone app running on the iphone and connecting to a backend written in Erlang. I don't believe you can run Erlang apps on the iPhone. -- http://wagerlabs.com From rasmussen.bryan@REDACTED Wed Dec 10 12:30:40 2008 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Wed, 10 Dec 2008 12:30:40 +0100 Subject: [erlang-questions] ideas for an iphone app In-Reply-To: <2A6154FD-BF3A-453F-8B99-58BFD3763529@gmail.com> References: <363C5F8C-9515-4CA8-9B9C-AF4020AB482B@gmail.com> <3bb44c6e0812100236n11e7d2c3p95e11dd377233196@mail.gmail.com> <2A6154FD-BF3A-453F-8B99-58BFD3763529@gmail.com> Message-ID: <3bb44c6e0812100330n7af340e1m8b636d2f450276ba@mail.gmail.com> Well there have been a number of posts recently that talks about compiling erlang for the iphone, so that's why I ask, although as I understand it you run into licensing/warranty problems then. Cheers, Bryan Rasmussen On Wed, Dec 10, 2008 at 12:01 PM, Joel Reymont wrote: > > On Dec 10, 2008, at 10:36 AM, bryan rasmussen wrote: > >> Well I guess this means an erlang app running in erlang compiled for >> the iphone right. > > > Native iphone app running on the iphone and connecting to a backend written > in Erlang. I don't believe you can run Erlang apps on the iPhone. > > -- > http://wagerlabs.com > > > > > > > > > > From twoggle@REDACTED Wed Dec 10 12:40:46 2008 From: twoggle@REDACTED (Tim Fletcher) Date: Wed, 10 Dec 2008 03:40:46 -0800 (PST) Subject: [erlang-questions] Geographical distribution of Erlang programmers In-Reply-To: <20918802.post@talk.nabble.com> References: <20918802.post@talk.nabble.com> Message-ID: > I want to know the geographical distribution of Erlang programmers. > In other words: "If you going to open Erlang shop, where is the best place > to do it?". This is far from answering the question, but i was curious. There are about 430 members on the erlang-questions google group, 100 of which have specified a location in their profile. List of the unique locations here: http://gist.github.com/raw/34309/195aa70c0303c84f7ac52a39c9f0a5cc711a8861 From bengt.kleberg@REDACTED Wed Dec 10 12:51:46 2008 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 10 Dec 2008 12:51:46 +0100 Subject: [erlang-questions] ideas for an iphone app In-Reply-To: <2A6154FD-BF3A-453F-8B99-58BFD3763529@gmail.com> References: <363C5F8C-9515-4CA8-9B9C-AF4020AB482B@gmail.com> <3bb44c6e0812100236n11e7d2c3p95e11dd377233196@mail.gmail.com> <2A6154FD-BF3A-453F-8B99-58BFD3763529@gmail.com> Message-ID: <1228909906.21800.54.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> Greetings, Until Apple includes an Erlang VM it is not possible to run Erlang apps on the iPhone. Quoting from Apple Insider (http://www.appleinsider.com/articles/08/03/11/iphone_sdk_may_block_firefox_java_background_apps.html): "No interpreted code may be downloaded and used in an Application except for code that is interpreted and run by Apple?s Published APIs and builtin interpreter(s)," Apple says in the agreement. bengt On Wed, 2008-12-10 at 11:01 +0000, Joel Reymont wrote: > On Dec 10, 2008, at 10:36 AM, bryan rasmussen wrote: > > > Well I guess this means an erlang app running in erlang compiled for > > the iphone right. > > > Native iphone app running on the iphone and connecting to a backend > written in Erlang. I don't believe you can run Erlang apps on the > iPhone. > > -- > http://wagerlabs.com > > > > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From ulf@REDACTED Wed Dec 10 14:31:07 2008 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 10 Dec 2008 14:31:07 +0100 Subject: [erlang-questions] problems building r11b-3 Message-ID: <8209f740812100531k4b324bd8k5b9ef20b0280f51b@mail.gmail.com> Does anyone know why r11b-3 and r11b-5 fail to build on a fresh Ubuntu 8.10, whereas r12b-5 builds just fine? BR, Ulf W obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.o: In function `nbif_handle_fp_exception': /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.S:269: undefined reference to `erts_restore_fpu' obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_signal.o: In function `my_sigaction': /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:220: undefined reference to `INIT' /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:230: undefined reference to `__next_sigaction' obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_signal.o: In function `hipe_signal_init': /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:305: undefined reference to `INIT' obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_signal.o: In function `my_sigaction': /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:220: undefined reference to `INIT' /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:230: undefined reference to `__next_sigaction' /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:220: undefined reference to `INIT' /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:230: undefined reference to `__next_sigaction' collect2: ld returned 1 exit status make[3]: *** [/home/uwiger/src/otp/otp_src_R11B-3/bin/i686-pc-linux-gnu/beam.hybrid] Error 1 make[3]: Leaving directory `/home/uwiger/src/otp/otp_src_R11B-3/erts/emulator' make[2]: *** [opt] Error 2 make[2]: Leaving directory `/home/uwiger/src/otp/otp_src_R11B-3/erts/emulator' make[1]: *** [hybrid] Error 2 make[1]: Leaving directory `/home/uwiger/src/otp/otp_src_R11B-3/erts' make: *** [emulator] Error 2 From kostis@REDACTED Wed Dec 10 14:59:06 2008 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 10 Dec 2008 15:59:06 +0200 Subject: [erlang-questions] problems building r11b-3 In-Reply-To: <8209f740812100531k4b324bd8k5b9ef20b0280f51b@mail.gmail.com> References: <8209f740812100531k4b324bd8k5b9ef20b0280f51b@mail.gmail.com> Message-ID: <493FCB2A.1040903@cs.ntua.gr> Ulf Wiger wrote: > Does anyone know why r11b-3 and r11b-5 fail to build on > a fresh Ubuntu 8.10, whereas r12b-5 builds just fine? Most probably, the answer is: because, like Ubuntu 8.10, R12B-5 is more recent. So, it has been modified to include the proper ifdefs for glibc. Check what the values of __GLIBC__ and __GLIBC_MINOR__ are and modify file: erts/emulator/hipe/hipe_x86_signal.c appropriately. Kostis From mikpe@REDACTED Wed Dec 10 15:07:17 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 10 Dec 2008 15:07:17 +0100 Subject: [erlang-questions] problems building r11b-3 In-Reply-To: <8209f740812100531k4b324bd8k5b9ef20b0280f51b@mail.gmail.com> References: <8209f740812100531k4b324bd8k5b9ef20b0280f51b@mail.gmail.com> Message-ID: <18751.52501.911202.93657@harpo.it.uu.se> Ulf Wiger writes: > Does anyone know why r11b-3 and r11b-5 fail to build on > a fresh Ubuntu 8.10, whereas r12b-5 builds just fine? > > BR, > Ulf W > > obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.o: In function > `nbif_handle_fp_exception': > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.S:269: > undefined reference to `erts_restore_fpu' > obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_signal.o: In function `my_sigaction': > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:220: > undefined reference to `INIT' > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:230: > undefined reference to `__next_sigaction' > obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_signal.o: In function > `hipe_signal_init': > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:305: > undefined reference to `INIT' > obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_signal.o: In function `my_sigaction': > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:220: > undefined reference to `INIT' > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:230: > undefined reference to `__next_sigaction' > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:220: > undefined reference to `INIT' > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:230: > undefined reference to `__next_sigaction' > collect2: ld returned 1 exit status Yes. If you 'diff -u' hipe_x86_signal.c between r11b-whatever and r12b-5 you'll find that a glibc version check has been changed. Apply that change to r11b-whatever and you should be fine. From dmercer@REDACTED Wed Dec 10 15:51:53 2008 From: dmercer@REDACTED (David Mercer) Date: Wed, 10 Dec 2008 08:51:53 -0600 Subject: [erlang-questions] Geographical distribution of Erlangprogrammers In-Reply-To: References: <20918802.post@talk.nabble.com> Message-ID: <2A44D336C4484767A50628E2DA672416@SSI.CORP> I didn't even know about the Google group. How does it differ from this email list? DBM > -----Original Message----- > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions- > bounces@REDACTED] On Behalf Of Tim Fletcher > Sent: Wednesday, December 10, 2008 05:41 > To: erlang-questions@REDACTED > Subject: Re: [erlang-questions] Geographical distribution of > Erlangprogrammers > > > I want to know the geographical distribution of Erlang programmers. > > In other words: "If you going to open Erlang shop, where is the best > place > > to do it?". > > This is far from answering the question, but i was curious. There are > about 430 members on the erlang-questions google group, 100 of which > have specified a location in their profile. List of the unique > locations here: > > http://gist.github.com/raw/34309/195aa70c0303c84f7ac52a39c9f0a5cc711a8861 > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From ulf@REDACTED Wed Dec 10 16:15:16 2008 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 10 Dec 2008 16:15:16 +0100 Subject: [erlang-questions] problems building r11b-3 In-Reply-To: <18751.52501.911202.93657@harpo.it.uu.se> References: <8209f740812100531k4b324bd8k5b9ef20b0280f51b@mail.gmail.com> <18751.52501.911202.93657@harpo.it.uu.se> Message-ID: <8209f740812100715o69648664n4167dab2acef7772@mail.gmail.com> Thanks, That got me further: gcc -g -O3 -I/home/uwiger/src/otp/otp_src_R11B-3/erts/i686-pc-linux-gnu -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS -DHYBRID -DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS -Ibeam -Isys/unix -Isys/common -Ii686-pc-linux-gnu/opt/hybrid -Ii686-pc-linux-gnu -Izlib -Ihipe -I../include/internal -I../include/internal/i686-pc-linux-gnu -c hipe/hipe_x86_signal.c -o obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_signal.o gcc -o /home/uwiger/src/otp/otp_src_R11B-3/bin/i686-pc-linux-gnu/beam.hybrid \ -Wl,-export-dynamic obj/i686-pc-linux-gnu/opt/hybrid/erl_main.o obj/i686-pc-linux-gnu/opt/hybrid/preload.o obj/i686-pc-linux-gnu/opt/hybrid/erl_pbifs.o obj/i686-pc-linux-gnu/opt/hybrid/benchmark.o obj/i686-pc-linux-gnu/opt/hybrid/erl_alloc.o obj/i686-pc-linux-gnu/opt/hybrid/erl_mtrace.o obj/i686-pc-linux-gnu/opt/hybrid/erl_alloc_util.o obj/i686-pc-linux-gnu/opt/hybrid/erl_goodfit_alloc.o obj/i686-pc-linux-gnu/opt/hybrid/erl_bestfit_alloc.o obj/i686-pc-linux-gnu/opt/hybrid/erl_afit_alloc.o obj/i686-pc-linux-gnu/opt/hybrid/erl_instrument.o obj/i686-pc-linux-gnu/opt/hybrid/erl_init.o obj/i686-pc-linux-gnu/opt/hybrid/erl_atom_table.o obj/i686-pc-linux-gnu/opt/hybrid/erl_bif_table.o obj/i686-pc-linux-gnu/opt/hybrid/erl_bif_ddll.o obj/i686-pc-linux-gnu/opt/hybrid/erl_bif_guard.o obj/i686-pc-linux-gnu/opt/hybrid/erl_bif_info.o obj/i686-pc-linux-gnu/opt/hybrid/erl_bif_op.o obj/i686-pc-linux-gnu/opt/hybrid/erl_bif_os.o obj/i686-pc-linux-gnu/opt/hybrid/erl_bif_lists.o obj/i686-pc-linux-gnu/opt/hybrid/erl_bif_trace.o obj/i686-pc-linux-gnu/opt/hybrid/erl_bif_wrap.o obj/i686-pc-linux-gnu/opt/hybrid/erl_trace.o obj/i686-pc-linux-gnu/opt/hybrid/copy.o obj/i686-pc-linux-gnu/opt/hybrid/utils.oobj/i686-pc-linux-gnu/opt/hybrid/bif.o obj/i686-pc-linux-gnu/opt/hybrid/io.o obj/i686-pc-linux-gnu/opt/hybrid/erl_printf_term.o obj/i686-pc-linux-gnu/opt/hybrid/erl_debug.o obj/i686-pc-linux-gnu/opt/hybrid/erl_md5.o obj/i686-pc-linux-gnu/opt/hybrid/erl_message.o obj/i686-pc-linux-gnu/opt/hybrid/erl_process.o obj/i686-pc-linux-gnu/opt/hybrid/erl_process_dict.o obj/i686-pc-linux-gnu/opt/hybrid/erl_arith.o obj/i686-pc-linux-gnu/opt/hybrid/time.o obj/i686-pc-linux-gnu/opt/hybrid/erl_time_sup.o obj/i686-pc-linux-gnu/opt/hybrid/external.o obj/i686-pc-linux-gnu/opt/hybrid/dist.o obj/i686-pc-linux-gnu/opt/hybrid/binary.o obj/i686-pc-linux-gnu/opt/hybrid/erl_db.o obj/i686-pc-linux-gnu/opt/hybrid/erl_db_util.o obj/i686-pc-linux-gnu/opt/hybrid/erl_db_hash.o obj/i686-pc-linux-gnu/opt/hybrid/erl_db_tree.o obj/i686-pc-linux-gnu/opt/hybrid/fix_alloc.o obj/i686-pc-linux-gnu/opt/hybrid/big.o obj/i686-pc-linux-gnu/opt/hybrid/hash.o obj/i686-pc-linux-gnu/opt/hybrid/index.o obj/i686-pc-linux-gnu/opt/hybrid/atom.o obj/i686-pc-linux-gnu/opt/hybrid/module.o obj/i686-pc-linux-gnu/opt/hybrid/export.o obj/i686-pc-linux-gnu/opt/hybrid/register.o obj/i686-pc-linux-gnu/opt/hybrid/break.o obj/i686-pc-linux-gnu/opt/hybrid/erl_async.o obj/i686-pc-linux-gnu/opt/hybrid/erl_lock_check.o obj/i686-pc-linux-gnu/opt/hybrid/ggc.o obj/i686-pc-linux-gnu/opt/hybrid/erl_gc.o obj/i686-pc-linux-gnu/opt/hybrid/erl_nmgc.o obj/i686-pc-linux-gnu/opt/hybrid/erl_posix_str.o obj/i686-pc-linux-gnu/opt/hybrid/erl_bits.o obj/i686-pc-linux-gnu/opt/hybrid/erl_math.o obj/i686-pc-linux-gnu/opt/hybrid/erl_fun.o obj/i686-pc-linux-gnu/opt/hybrid/erl_bif_port.o obj/i686-pc-linux-gnu/opt/hybrid/erl_term.o obj/i686-pc-linux-gnu/opt/hybrid/erl_node_tables.o obj/i686-pc-linux-gnu/opt/hybrid/erl_monitors.o obj/i686-pc-linux-gnu/opt/hybrid/erl_process_dump.o obj/i686-pc-linux-gnu/opt/hybrid/erl_obsolete.o obj/i686-pc-linux-gnu/opt/hybrid/erl_bif_timer.o obj/i686-pc-linux-gnu/opt/hybrid/erl_port_task.o obj/i686-pc-linux-gnu/opt/hybrid/beam_emu.o obj/i686-pc-linux-gnu/opt/hybrid/beam_opcodes.o obj/i686-pc-linux-gnu/opt/hybrid/beam_load.o obj/i686-pc-linux-gnu/opt/hybrid/beam_bif_load.o obj/i686-pc-linux-gnu/opt/hybrid/beam_debug.o obj/i686-pc-linux-gnu/opt/hybrid/beam_bp.o obj/i686-pc-linux-gnu/opt/hybrid/beam_catches.o obj/i686-pc-linux-gnu/opt/hybrid/sys.o obj/i686-pc-linux-gnu/opt/hybrid/driver_tab.o obj/i686-pc-linux-gnu/opt/hybrid/unix_efile.o obj/i686-pc-linux-gnu/opt/hybrid/gzio.o obj/i686-pc-linux-gnu/opt/hybrid/elib_malloc.o obj/i686-pc-linux-gnu/opt/hybrid/elib_memmove.o obj/i686-pc-linux-gnu/opt/hybrid/sys_float.o obj/i686-pc-linux-gnu/opt/hybrid/sys_time.o obj/i686-pc-linux-gnu/opt/hybrid/erl_poll.kp.o obj/i686-pc-linux-gnu/opt/hybrid/erl_check_io.kp.o obj/i686-pc-linux-gnu/opt/hybrid/erl_poll.nkp.o obj/i686-pc-linux-gnu/opt/hybrid/erl_check_io.nkp.o obj/i686-pc-linux-gnu/opt/hybrid/erl_mseg.o obj/i686-pc-linux-gnu/opt/hybrid/erl_unix_sys_ddll.o obj/i686-pc-linux-gnu/opt/hybrid/erl_mtrace_sys_wrap.o obj/i686-pc-linux-gnu/opt/hybrid/hipe_bif0.o obj/i686-pc-linux-gnu/opt/hybrid/hipe_bif1.o obj/i686-pc-linux-gnu/opt/hybrid/hipe_bif2.o obj/i686-pc-linux-gnu/opt/hybrid/hipe_debug.o obj/i686-pc-linux-gnu/opt/hybrid/hipe_gc.o obj/i686-pc-linux-gnu/opt/hybrid/hipe_mode_switch.o obj/i686-pc-linux-gnu/opt/hybrid/hipe_native_bif.o obj/i686-pc-linux-gnu/opt/hybrid/hipe_stack.o obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86.o obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_glue.o obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.o obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_signal.o obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_stack.o obj/i686-pc-linux-gnu/opt/hybrid/efile_drv.o obj/i686-pc-linux-gnu/opt/hybrid/inet_drv.o obj/i686-pc-linux-gnu/opt/hybrid/zlib_drv.o obj/i686-pc-linux-gnu/opt/hybrid/ram_file_drv.o obj/i686-pc-linux-gnu/opt/hybrid/ttsl_drv.o -lutil -ldl -lm -lpthread -lncurses -L../lib/internal/i686-pc-linux-gnu /home/uwiger/src/otp/otp_src_R11B-3/erts/obj/i686-pc-linux-gnu/libz.a -lethread -lpthread -lerts_internal_r -lrt obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.o: In function `nbif_handle_fp_exception': /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.S:269: undefined reference to `erts_restore_fpu' collect2: ld returned 1 exit status make[3]: *** [/home/uwiger/src/otp/otp_src_R11B-3/bin/i686-pc-linux-gnu/beam.hybrid] Error 1 make[3]: Leaving directory `/home/uwiger/src/otp/otp_src_R11B-3/erts/emulator' make[2]: *** [opt] Error 2 make[2]: Leaving directory `/home/uwiger/src/otp/otp_src_R11B-3/erts/emulator' make[1]: *** [hybrid] Error 2 make[1]: Leaving directory `/home/uwiger/src/otp/otp_src_R11B-3/erts' make: *** [emulator] Error 2 2008/12/10 Mikael Pettersson : > Ulf Wiger writes: > > Does anyone know why r11b-3 and r11b-5 fail to build on > > a fresh Ubuntu 8.10, whereas r12b-5 builds just fine? > > > > BR, > > Ulf W > > > > obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.o: In function > > `nbif_handle_fp_exception': > > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.S:269: > > undefined reference to `erts_restore_fpu' > > obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_signal.o: In function `my_sigaction': > > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:220: > > undefined reference to `INIT' > > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:230: > > undefined reference to `__next_sigaction' > > obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_signal.o: In function > > `hipe_signal_init': > > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:305: > > undefined reference to `INIT' > > obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_signal.o: In function `my_sigaction': > > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:220: > > undefined reference to `INIT' > > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:230: > > undefined reference to `__next_sigaction' > > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:220: > > undefined reference to `INIT' > > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/hipe/hipe_x86_signal.c:230: > > undefined reference to `__next_sigaction' > > collect2: ld returned 1 exit status > > Yes. > > If you 'diff -u' hipe_x86_signal.c between r11b-whatever and > r12b-5 you'll find that a glibc version check has been changed. > Apply that change to r11b-whatever and you should be fine. > From joelr1@REDACTED Wed Dec 10 16:26:31 2008 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 10 Dec 2008 15:26:31 +0000 Subject: [erlang-questions] Geographical distribution of Erlangprogrammers In-Reply-To: <2A44D336C4484767A50628E2DA672416@SSI.CORP> References: <20918802.post@talk.nabble.com> <2A44D336C4484767A50628E2DA672416@SSI.CORP> Message-ID: <8219EC2B-B375-4054-8DD5-F6B6E3E1D792@gmail.com> It's read-only. Sent from my iPhone On 10/12/2008, at 14:51, "David Mercer" wrote: > I didn't even know about the Google group. How does it differ from > this > email list? > > DBM > >> -----Original Message----- >> From: erlang-questions-bounces@REDACTED [mailto:erlang-questions- >> bounces@REDACTED] On Behalf Of Tim Fletcher >> Sent: Wednesday, December 10, 2008 05:41 >> To: erlang-questions@REDACTED >> Subject: Re: [erlang-questions] Geographical distribution of >> Erlangprogrammers >> >>> I want to know the geographical distribution of Erlang programmers. >>> In other words: "If you going to open Erlang shop, where is the best >> place >>> to do it?". >> >> This is far from answering the question, but i was curious. There are >> about 430 members on the erlang-questions google group, 100 of which >> have specified a location in their profile. List of the unique >> locations here: >> >> http://gist.github.com/raw/34309/195aa70c0303c84f7ac52a39c9f0a5cc711a8861 >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From weaveinator@REDACTED Wed Dec 10 16:34:41 2008 From: weaveinator@REDACTED (Steve Weaver) Date: Wed, 10 Dec 2008 07:34:41 -0800 Subject: [erlang-questions] Installing Erlang R12B-4 problem Message-ID: Hi - I'm trying to get Erlang installed on a Redhat Enterprise 5 machine and the configure fails with 'No curses library functions found' and something to do with a problem creating the erts/emulator. I have all the requirements installed according to the README. I'm new to linux and Erlang so sorry if this is a noob mistake but I followed the installation instructions. Any help would be greatly appreciated! Thanks Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikpe@REDACTED Wed Dec 10 16:42:35 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 10 Dec 2008 16:42:35 +0100 Subject: [erlang-questions] problems building r11b-3 In-Reply-To: <8209f740812100715o69648664n4167dab2acef7772@mail.gmail.com> References: <8209f740812100531k4b324bd8k5b9ef20b0280f51b@mail.gmail.com> <18751.52501.911202.93657@harpo.it.uu.se> <8209f740812100715o69648664n4167dab2acef7772@mail.gmail.com> Message-ID: <18751.58219.611844.252922@harpo.it.uu.se> Ulf Wiger writes: > Thanks, That got me further: [snip] > obj/i686-pc-linux-gnu/opt/hybrid/ttsl_drv.o -lutil -ldl -lm > -lpthread -lncurses -L../lib/internal/i686-pc-linux-gnu > /home/uwiger/src/otp/otp_src_R11B-3/erts/obj/i686-pc-linux-gnu/libz.a > -lethread -lpthread -lerts_internal_r -lrt > obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.o: In function > `nbif_handle_fp_exception': > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.S:269: > undefined reference to `erts_restore_fpu' > collect2: ld returned 1 exit status > make[3]: *** [/home/uwiger/src/otp/otp_src_R11B-3/bin/i686-pc-linux-gnu/beam.hybrid] > Error 1 Looks like erts/configure didn't detect working FP exceptions on this box, which since it's an x86 most likely is a compile problem with the fpe-test.c program embedded in erts/configure.in. Without FP exceptions you can't have HiPE (except on ARM which assumes no HW FPU). I believe there are now (R12) explicit checks in erts/configure to disable HiPE on x86/powerpc/sparc if FP exceptions don't work, perhaps those checks don't exist in R11. Either run erts/configure again and look for messages about reliable floating- point exceptions not working, or look in erts/i686-pc-linux-gnu/config.h for a #define NO_FPE_SIGNALS. If you can't resolve the lack of FP exception support, you'll have to reconfigure with --disable-hipe. From lemenkov@REDACTED Wed Dec 10 16:43:21 2008 From: lemenkov@REDACTED (Peter Lemenkov) Date: Wed, 10 Dec 2008 18:43:21 +0300 Subject: [erlang-questions] Installing Erlang R12B-4 problem In-Reply-To: References: Message-ID: Hello! 2008/12/10 Steve Weaver : > Hi - > I'm trying to get Erlang installed on a Redhat Enterprise 5 machine and the > configure fails with 'No curses library functions found' and something to do > with a problem creating the erts/emulator. I have all the requirements > installed according to the README. I'm new to linux and Erlang so sorry if > this is a noob mistake but I followed the installation instructions. Why not to try prebuilt binary, shipped in EPEL, first? $ sudo yum install erlang -- With best regards! From colm.dougan@REDACTED Wed Dec 10 16:49:54 2008 From: colm.dougan@REDACTED (Colm Dougan) Date: Wed, 10 Dec 2008 15:49:54 +0000 Subject: [erlang-questions] Installing Erlang R12B-4 problem In-Reply-To: References: Message-ID: <24d4f39c0812100749l2d7b29ffke6a735a0ef7a61c3@mail.gmail.com> 2008/12/10 Steve Weaver : > Hi - > I'm trying to get Erlang installed on a Redhat Enterprise 5 machine and the > configure fails with 'No curses library functions found' and something to do > with a problem creating the erts/emulator. I have all the requirements > installed according to the README. I'm new to linux and Erlang so sorry if > this is a noob mistake but I followed the installation instructions. You need to install the ncurses-devel package (or whatever it is called in RHE). If you have any more issues, check out this recent thread : http://www.erlang.org/pipermail/erlang-questions/2008-December/040378.html It is Ubuntu specific but the same principles apply. Colm From valentin@REDACTED Wed Dec 10 17:06:41 2008 From: valentin@REDACTED (Valentin Micic) Date: Wed, 10 Dec 2008 18:06:41 +0200 Subject: [erlang-questions] NET_KERNEL "blocking" Message-ID: Any idea what can cause net_kernel to stop processing messages? AFAIK, net_kernel is responsible for servicing socket which is bound to the listening port registered with EPMD, and as such should never enter any kind of deadlock. However, what we saw is that net_kernel's process message queue was increasing with each new connection request, but never flushed, and never changing reduction count -- hence indicating a deadlock of some kind (*). The effect of this was that the node was "locked" -- whichever remote node had a connection establihsed at the time this happened, was able to carry on, however, no new connections were allowed. We're ysing R11B... cannot remember, but I think the last bug-fix release for R11. Any feedback is wellcome. V. (*) It appears that net_kernel blocked while busy infomring client about acceptance of the connection, in other words -- not while waiting for a new connection request (ok...indication, if you wish (-;). From kaiduanx@REDACTED Wed Dec 10 17:13:13 2008 From: kaiduanx@REDACTED (Kaiduan Xie) Date: Wed, 10 Dec 2008 11:13:13 -0500 Subject: [erlang-questions] Book: "Robust Communications Software: Extreme Availability, Reliability and Scalability for Carrier-Grade Systems" In-Reply-To: <8209f740812092358i6355382am3560ac4984f92223@mail.gmail.com> References: <781dd98c0812091504h577fb81bu370ed788ff14f67d@mail.gmail.com> <8209f740812092358i6355382am3560ac4984f92223@mail.gmail.com> Message-ID: I have this book, and have read it several times. In my ex-company, we used C++ to build high performance VoIP server. We found that book is quite useful. It explains WHAT you need to consider to build a carrier-grade system, and HOW to do that. Generally it is a very good book, but it does not provide working examples. For example, it says, for hot code upgrade, you need to use incremental link, but it does not explain how to do with gcc. I just hope the book also provides a framework/toolset to build carrier-grade software in C++. Kudos to Ericsson for making Erlang/OTP open source! Hope someone, like Joe or Ulf can write a book on how to use Erlang/OTP to build robust communication software. Thanks, kaiduan On 12/10/08, Ulf Wiger wrote: > > I haven't read it. > > There's one customer review. Here's an extract: > > "It points out that many aspects of a modern computer > system (pre-emptive multi-tasking, virtual memory, many > short-lived processes/threads to handle task execution and > dynamic garbage collection) are actually detrimental to the > design of a carrier-grade system. " > > "[the developer team] shouldn't be put off by the C++ code > in the early chapters." > > You can read parts of the book on-line via books.google.com, > and from a quick perusal, I'd say that it's a pretty good book > if you want an introduction into how to best write a carrier-class > system in C++. From what he writes, you can extrapolate that > Erlang is "dead wrong" for carrier-class systems(*). But then one > needs to remember that his frame of reference is /mainstream/ > programming technology. If you have the time, it might be useful > to read the book, then read Joe's book, and meditate over the > differences in approach. > > (*) This would be the superficial conclusion based on the fact that > he dismisses dynamic processes (because POSIX threads are un- > suitable for such programming), preemptive scheduling (because > it forces you to use semaphores everywhere), and dynamic > garbage collection (because it's very difficult to write a dynamic > garbage collector yourself that doesn't cause long pauses). > > If your starting point is that there is no realistic alternative to > C++ for real industrial work, I'd say this kind of book is a must. > > BR, > Ulf W > > 2008/12/10 Chris Newcombe : > > Has anyone (particularly AXD301/ENGINE/OTP folks) read the following > book? > > > > "Robust Communications Software: Extreme Availability, Reliability > > and Scalability for Carrier-Grade Systems" > > by Greg Utas > > > > > http://www.amazon.com/Robust-Communications-Software-Availability-Carrier-Grade/dp/0470854340 > > > > Is it any good? > > > > thanks, > > > > Chris > > > > Extract from product summary: > > > > Carrier-grade software must satisfy the stringent quality requirements > > of network operators whose systems provide mission-critical > > communications services. This book describes proven carrier-grade > > software techniques used in flagship products designed by industry > > leaders such as Lucent, Nortel, and Ericsson. > > > > In the age of 24/7, software robustness is a competitive advantage. > > This authoritative guide for software engineers, managers, and testers > > of products that face carrier-grade requirements helps you to develop > > state-of-the-art software that will give you an edge in today's > > marketplace. > > > > Robust Communications Software: Extreme Availability, Reliability and > > Scalability for Carrier-Grade Systems > > > > * offers advice on choosing the right technologies for building > > reliable software > > * incorporates real-world examples and design rationales when > > describing how to construct robust, embedded software for > > communications systems > > * presents a comprehensive set of carrier-grade design patterns > > that help you to meet extreme availability, reliability, scalability, > > and capacity requirements > > * gives advice on how to protect against and recover from software > faults > > * discusses system installation, operability, maintenance, and > > on-site debugging > > > > Greg Utas has over 20 years of development experience in carrier-grade > > systems, including Chief Software Architect roles at Nortel Networks > > (GSM core networks) and Sonim Technologies (wireless push-to-talk > > services). He is currently a consultant specializing in the design of > > carrier-grade software. > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony@REDACTED Wed Dec 10 17:24:13 2008 From: tony@REDACTED (Tony Rogvall) Date: Wed, 10 Dec 2008 17:24:13 +0100 Subject: [erlang-questions] ideas for an iphone app In-Reply-To: <1228909906.21800.54.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> References: <363C5F8C-9515-4CA8-9B9C-AF4020AB482B@gmail.com> <3bb44c6e0812100236n11e7d2c3p95e11dd377233196@mail.gmail.com> <2A6154FD-BF3A-453F-8B99-58BFD3763529@gmail.com> <1228909906.21800.54.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> Message-ID: <34BDB262-29A8-4C17-B982-44FC1063B7D1@rogvall.se> Well, I had the Erlang vm running on the iPhone. Some minor build and cross-compiler stuff but otherwise no problem. But you have to supply the vm with every app you want to run so this will not be a real option. I think it's possible to install a dummy app with the erlang vm and then send applications that only contains some kind of launcher together with erang code. Or even better use pawnage tool and do what ever you want with the phone. (It's a simple processes, but do not support the unlock of the iPhone3G yet) /Tony On 10 dec 2008, at 12.51, Bengt Kleberg wrote: > Greetings, > > Until Apple includes an Erlang VM it is not possible to run Erlang > apps > on the iPhone. > > Quoting from Apple Insider > (http://www.appleinsider.com/articles/08/03/11/iphone_sdk_may_block_firefox_java_background_apps.html > ): > > "No interpreted code may be downloaded and used in an Application > except > for code that is interpreted and run by Apple?s Published APIs and > builtin interpreter(s)," Apple says in the agreement. > > > bengt > > On Wed, 2008-12-10 at 11:01 +0000, Joel Reymont wrote: >> On Dec 10, 2008, at 10:36 AM, bryan rasmussen wrote: >> >>> Well I guess this means an erlang app running in erlang compiled for >>> the iphone right. >> >> >> Native iphone app running on the iphone and connecting to a backend >> written in Erlang. I don't believe you can run Erlang apps on the >> iPhone. >> >> -- >> http://wagerlabs.com >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemenkov@REDACTED Wed Dec 10 17:32:13 2008 From: lemenkov@REDACTED (Peter Lemenkov) Date: Wed, 10 Dec 2008 19:32:13 +0300 Subject: [erlang-questions] Installing Erlang R12B-4 problem In-Reply-To: References: Message-ID: 2008/12/10 Steve Weaver : > Hi Peter - > Thanks for the quick response. Where would I find the prebuilt binary? > Didn't see it on the Erlang site. http://fedoraproject.org/wiki/EPEL http://fedoraproject.org/wiki/EPEL/FAQ#howtouse -- With best regards! From king+erlangques@REDACTED Wed Dec 10 17:42:26 2008 From: king+erlangques@REDACTED (Benjamin King) Date: Wed, 10 Dec 2008 11:42:26 -0500 Subject: [erlang-questions] Job Opportunity: Erlang developers Message-ID: Innovus is a healthcare communications stat-up company located in Sarasota, FL. We are looking for full-time Erlang developers with the following experience: + OTP programming + XML/String parsing + Mnesia + ejabberd (XMPP server in erlang) - creating a plug-in Nice to have: - LDAP - VoIP/SIP If you are interested or know anyone that might be interested, please send your resume and contact information to: careers -at- innovushealth.com In your email, please identify your experiences listed above. Thank you very much. -- Benjamin King --------------------- Innovus Healthcare Systems Chief Technology Officer king@REDACTED 407.242.2219 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Wed Dec 10 17:50:04 2008 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 10 Dec 2008 17:50:04 +0100 Subject: [erlang-questions] problems building r11b-3 In-Reply-To: <18751.58219.611844.252922@harpo.it.uu.se> References: <8209f740812100531k4b324bd8k5b9ef20b0280f51b@mail.gmail.com> <18751.52501.911202.93657@harpo.it.uu.se> <8209f740812100715o69648664n4167dab2acef7772@mail.gmail.com> <18751.58219.611844.252922@harpo.it.uu.se> Message-ID: <8209f740812100850n481e06b1yf0b794d5cf6fb5aa@mail.gmail.com> Thanks. Indeed it said that floating point exceptions were unreliable. I think I'll just disable hipe, since I have a good R12B install already. BR, Ulf W 2008/12/10 Mikael Pettersson : > Ulf Wiger writes: > > Thanks, That got me further: > [snip] > > obj/i686-pc-linux-gnu/opt/hybrid/ttsl_drv.o -lutil -ldl -lm > > -lpthread -lncurses -L../lib/internal/i686-pc-linux-gnu > > /home/uwiger/src/otp/otp_src_R11B-3/erts/obj/i686-pc-linux-gnu/libz.a > > -lethread -lpthread -lerts_internal_r -lrt > > obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.o: In function > > `nbif_handle_fp_exception': > > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.S:269: > > undefined reference to `erts_restore_fpu' > > collect2: ld returned 1 exit status > > make[3]: *** [/home/uwiger/src/otp/otp_src_R11B-3/bin/i686-pc-linux-gnu/beam.hybrid] > > Error 1 > > Looks like erts/configure didn't detect working FP exceptions on this box, > which since it's an x86 most likely is a compile problem with the fpe-test.c > program embedded in erts/configure.in. Without FP exceptions you can't have > HiPE (except on ARM which assumes no HW FPU). > > I believe there are now (R12) explicit checks in erts/configure to disable > HiPE on x86/powerpc/sparc if FP exceptions don't work, perhaps those checks > don't exist in R11. > > Either run erts/configure again and look for messages about reliable floating- > point exceptions not working, or look in erts/i686-pc-linux-gnu/config.h for > a #define NO_FPE_SIGNALS. > > If you can't resolve the lack of FP exception support, you'll have to > reconfigure with --disable-hipe. > From ulf@REDACTED Wed Dec 10 17:54:21 2008 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 10 Dec 2008 17:54:21 +0100 Subject: [erlang-questions] problems building r11b-3 In-Reply-To: <8209f740812100850n481e06b1yf0b794d5cf6fb5aa@mail.gmail.com> References: <8209f740812100531k4b324bd8k5b9ef20b0280f51b@mail.gmail.com> <18751.52501.911202.93657@harpo.it.uu.se> <8209f740812100715o69648664n4167dab2acef7772@mail.gmail.com> <18751.58219.611844.252922@harpo.it.uu.se> <8209f740812100850n481e06b1yf0b794d5cf6fb5aa@mail.gmail.com> Message-ID: <8209f740812100854x24e0655dlfe448bc70af721b3@mail.gmail.com> ...except that failed too. :( /U 2008/12/10 Ulf Wiger : > Thanks. Indeed it said that floating point exceptions were > unreliable. I think I'll just disable hipe, since I have a good > R12B install already. > > BR, > Ulf W > > 2008/12/10 Mikael Pettersson : >> Ulf Wiger writes: >> > Thanks, That got me further: >> [snip] >> > obj/i686-pc-linux-gnu/opt/hybrid/ttsl_drv.o -lutil -ldl -lm >> > -lpthread -lncurses -L../lib/internal/i686-pc-linux-gnu >> > /home/uwiger/src/otp/otp_src_R11B-3/erts/obj/i686-pc-linux-gnu/libz.a >> > -lethread -lpthread -lerts_internal_r -lrt >> > obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.o: In function >> > `nbif_handle_fp_exception': >> > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.S:269: >> > undefined reference to `erts_restore_fpu' >> > collect2: ld returned 1 exit status >> > make[3]: *** [/home/uwiger/src/otp/otp_src_R11B-3/bin/i686-pc-linux-gnu/beam.hybrid] >> > Error 1 >> >> Looks like erts/configure didn't detect working FP exceptions on this box, >> which since it's an x86 most likely is a compile problem with the fpe-test.c >> program embedded in erts/configure.in. Without FP exceptions you can't have >> HiPE (except on ARM which assumes no HW FPU). >> >> I believe there are now (R12) explicit checks in erts/configure to disable >> HiPE on x86/powerpc/sparc if FP exceptions don't work, perhaps those checks >> don't exist in R11. >> >> Either run erts/configure again and look for messages about reliable floating- >> point exceptions not working, or look in erts/i686-pc-linux-gnu/config.h for >> a #define NO_FPE_SIGNALS. >> >> If you can't resolve the lack of FP exception support, you'll have to >> reconfigure with --disable-hipe. >> > From twoggle@REDACTED Wed Dec 10 18:08:41 2008 From: twoggle@REDACTED (Tim Fletcher) Date: Wed, 10 Dec 2008 09:08:41 -0800 (PST) Subject: [erlang-questions] Geographical distribution of Erlangprogrammers In-Reply-To: <8219EC2B-B375-4054-8DD5-F6B6E3E1D792@gmail.com> References: <20918802.post@talk.nabble.com> <2A44D336C4484767A50628E2DA672416@SSI.CORP> <8219EC2B-B375-4054-8DD5-F6B6E3E1D792@gmail.com> Message-ID: <8cf9e370-097c-4427-8c5c-f4a1e086feed@w1g2000prk.googlegroups.com> > It's read-only. Except if you are subscribed to erlang-questions proper with the same e-mail address. From rick.richardson@REDACTED Wed Dec 10 18:14:05 2008 From: rick.richardson@REDACTED (Rick R) Date: Wed, 10 Dec 2008 12:14:05 -0500 Subject: [erlang-questions] NYC Erlounge - Thursday the 11th at the Golden Unicorn Message-ID: <9810b81b0812100914x99196f7t2513a613131b5b06@mail.gmail.com> Forgive me if this is a repost, I attempted to send this earlier but there was complaint that it wasn't sent and I couldn't find it in my sent folder. Okay. I've managed to find a quiet restaurant with meeting space that has availability this week. The venue is The Golden Unicorn in Chinatown. http://www.yelp.com/biz/golden-unicorn-new-york The guy told me that it is on the 3rd floor. I'm not sure if the entire restaurant is on the 3rd floor, or just our spot. The time is 7:30pm Thursday I hope to see everyone there. It will be nice to finally put faces to some of these names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ixmatus@REDACTED Wed Dec 10 18:26:49 2008 From: ixmatus@REDACTED (Parnell Springmeyer) Date: Wed, 10 Dec 2008 09:26:49 -0800 Subject: [erlang-questions] Geographical distribution of Erlangprogrammers In-Reply-To: <8cf9e370-097c-4427-8c5c-f4a1e086feed@w1g2000prk.googlegroups.com> References: <20918802.post@talk.nabble.com> <2A44D336C4484767A50628E2DA672416@SSI.CORP> <8219EC2B-B375-4054-8DD5-F6B6E3E1D792@gmail.com> <8cf9e370-097c-4427-8c5c-f4a1e086feed@w1g2000prk.googlegroups.com> Message-ID: That link provides an interesting view into the few number of USA based Erlang programmers subscribed to the list... Anybody hiding out in Las Vegas, Nevada, USA ??? On Wed, Dec 10, 2008 at 9:08 AM, Tim Fletcher wrote: > > It's read-only. > > Except if you are subscribed to erlang-questions proper with the same > e-mail address. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xbmodder@REDACTED Wed Dec 10 18:30:37 2008 From: xbmodder@REDACTED (Sargun Dhillon) Date: Wed, 10 Dec 2008 09:30:37 -0800 Subject: [erlang-questions] Geographical distribution of Erlangprogrammers In-Reply-To: <8cf9e370-097c-4427-8c5c-f4a1e086feed@w1g2000prk.googlegroups.com> References: <20918802.post@talk.nabble.com> <2A44D336C4484767A50628E2DA672416@SSI.CORP> <8219EC2B-B375-4054-8DD5-F6B6E3E1D792@gmail.com> <8cf9e370-097c-4427-8c5c-f4a1e086feed@w1g2000prk.googlegroups.com> Message-ID: <7c9d57ea0812100930m37fa6d0dl7044c726e1536af8@mail.gmail.com> Erlang concentration would probably be higher where companies like ERIC, Nortel, and other Erlang users are based. I know I'm stating the obvious, but it answers your question... On Wed, Dec 10, 2008 at 9:08 AM, Tim Fletcher wrote: >> It's read-only. > > Except if you are subscribed to erlang-questions proper with the same > e-mail address. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From jwecker@REDACTED Wed Dec 10 19:47:46 2008 From: jwecker@REDACTED (Joseph Wecker) Date: Wed, 10 Dec 2008 11:47:46 -0700 (MST) Subject: [erlang-questions] Geographical distribution of Erlangprogrammers In-Reply-To: Message-ID: I know there's a few of us in Salt Lake. That's close... On 12/10/2008, "Parnell Springmeyer" wrote: >That link provides an interesting view into the few number of USA based >Erlang programmers subscribed to the list... > >Anybody hiding out in Las Vegas, Nevada, USA ??? > >On Wed, Dec 10, 2008 at 9:08 AM, Tim Fletcher wrote: > >> > It's read-only. >> >> Except if you are subscribed to erlang-questions proper with the same >> e-mail address. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> From joelr1@REDACTED Wed Dec 10 20:13:20 2008 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 10 Dec 2008 11:13:20 -0800 (PST) Subject: [erlang-questions] Geographical distribution of Erlangprogrammers In-Reply-To: <8cf9e370-097c-4427-8c5c-f4a1e086feed@w1g2000prk.googlegroups.com> References: <20918802.post@talk.nabble.com> <2A44D336C4484767A50628E2DA672416@SSI.CORP> <8219EC2B-B375-4054-8DD5-F6B6E3E1D792@gmail.com> <8cf9e370-097c-4427-8c5c-f4a1e086feed@w1g2000prk.googlegroups.com> Message-ID: <1bbee0e9-d112-493a-ad8e-4f6e65b98c5f@v39g2000pro.googlegroups.com> Here's my reply from the Google Group. Will it make it through? On Dec 10, 5:08?pm, Tim Fletcher wrote: > > It's read-only. > > Except if you are subscribed to erlang-questions proper with the same > e-mail address. > _______________________________________________ > erlang-questions mailing list > erlang-questi...@REDACTED://www.erlang.org/mailman/listinfo/erlang-questions From kenneth.lundin@REDACTED Wed Dec 10 21:39:59 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Wed, 10 Dec 2008 21:39:59 +0100 Subject: [erlang-questions] Geographical distribution of Erlang programmers In-Reply-To: <20918802.post@talk.nabble.com> References: <20918802.post@talk.nabble.com> Message-ID: Hi, The statistics from erlang.org for the last month regarding number of visits and their geographic location shows the following in percent: An interesting note is that China is increasing its percentage for each month. US 24,60255624 Sweden 11,4947864 China 10,99083268 UK 4,930126154 Russia 3,610563135 Germany 3,323773685 Canada 3,148052981 Japan 2,876183214 France 2,834739652 India 2,615917643 All Others 29,57246821 /Kenneth Erlang/OTP, Ericsson On Tue, Dec 9, 2008 at 6:00 PM, Zvi wrote: > > Hi, > > I want to know the geographical distribution of Erlang programmers. > In other words: "If you going to open Erlang shop, where is the best place > to do it?". > > Thanks in Advance, > Zvi > -- > View this message in context: http://www.nabble.com/Geographical-distribution-of-Erlang-programmers-tp20918802p20918802.html > Sent from the Erlang Questions mailing list archive at Nabble.com. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From machinshin2002@REDACTED Wed Dec 10 22:12:11 2008 From: machinshin2002@REDACTED (Vat Raghavan) Date: Wed, 10 Dec 2008 13:12:11 -0800 (PST) Subject: [erlang-questions] NYC Erlounge - Thursday the 11th at the Golden Unicorn References: <9810b81b0812100914x99196f7t2513a613131b5b06@mail.gmail.com> Message-ID: <926488.39164.qm@web31504.mail.mud.yahoo.com> wonderful! Can't wait to meet everyone there! ----.signature---- Without the hope that things will get better, that our inheritors will know a world that is fuller and richer than our own, life is pointless, and evolution is vastly overrated -- Delenn ________________________________ From: Rick R To: Erlang Questions Sent: Wednesday, December 10, 2008 12:14:05 PM Subject: [erlang-questions] NYC Erlounge - Thursday the 11th at the Golden Unicorn Forgive me if this is a repost, I attempted to send this earlier but there was complaint that it wasn't sent and I couldn't find it in my sent folder. Okay. I've managed to find a quiet restaurant with meeting space that has availability this week. The venue is The Golden Unicorn in Chinatown. http://www.yelp.com/biz/golden-unicorn-new-york The guy told me that it is on the 3rd floor. I'm not sure if the entire restaurant is on the 3rd floor, or just our spot. The time is 7:30pm Thursday I hope to see everyone there. It will be nice to finally put faces to some of these names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From p-news@REDACTED Thu Dec 11 00:20:58 2008 From: p-news@REDACTED (P) Date: Thu, 11 Dec 2008 00:20:58 +0100 Subject: [erlang-questions] problems building r11b-3 In-Reply-To: <8209f740812100854x24e0655dlfe448bc70af721b3@mail.gmail.com> References: <8209f740812100531k4b324bd8k5b9ef20b0280f51b@mail.gmail.com> <8209f740812100850n481e06b1yf0b794d5cf6fb5aa@mail.gmail.com> <8209f740812100854x24e0655dlfe448bc70af721b3@mail.gmail.com> Message-ID: <200812110020.59098.p-news@telia.com> Hej Ulf ! It's not that the different builds are keept "on top" of each others (and built in some specific order)? I've remember I had some strange results from time to time resolved by viping out the previously builds entirely and then rebuilding the latest again. Regards Per Einar ------------------------------------------------------------------------------ Per Einar ------------------------------------------------------------------------------ s onsdag 10 december 2008 17:54 skrev Ulf Wiger: > ...except that failed too. :( > > /U > > 2008/12/10 Ulf Wiger : > > Thanks. Indeed it said that floating point exceptions were > > unreliable. I think I'll just disable hipe, since I have a good > > R12B install already. > > > > BR, > > Ulf W > > > > 2008/12/10 Mikael Pettersson : > >> Ulf Wiger writes: > >> > Thanks, That got me further: > >> [snip] > >> > obj/i686-pc-linux-gnu/opt/hybrid/ttsl_drv.o -lutil -ldl -lm > >> > -lpthread -lncurses -L../lib/internal/i686-pc-linux-gnu > >> > /home/uwiger/src/otp/otp_src_R11B-3/erts/obj/i686-pc-linux-gnu/libz.a > >> > -lethread -lpthread -lerts_internal_r -lrt > >> > obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.o: In function > >> > `nbif_handle_fp_exception': > >> > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.S:269: > >> > undefined reference to `erts_restore_fpu' > >> > collect2: ld returned 1 exit status > >> > make[3]: *** [/home/uwiger/src/otp/otp_src_R11B-3/bin/i686-pc-linux-gnu/beam.hybrid] > >> > Error 1 > >> > >> Looks like erts/configure didn't detect working FP exceptions on this box, > >> which since it's an x86 most likely is a compile problem with the fpe-test.c > >> program embedded in erts/configure.in. Without FP exceptions you can't have > >> HiPE (except on ARM which assumes no HW FPU). > >> > >> I believe there are now (R12) explicit checks in erts/configure to disable > >> HiPE on x86/powerpc/sparc if FP exceptions don't work, perhaps those checks > >> don't exist in R11. > >> > >> Either run erts/configure again and look for messages about reliable floating- > >> point exceptions not working, or look in erts/i686-pc-linux-gnu/config.h for > >> a #define NO_FPE_SIGNALS. > >> > >> If you can't resolve the lack of FP exception support, you'll have to > >> reconfigure with --disable-hipe. > >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From Thomas.Rackwitz@REDACTED Thu Dec 11 00:11:13 2008 From: Thomas.Rackwitz@REDACTED (Delta37) Date: Wed, 10 Dec 2008 15:11:13 -0800 (PST) Subject: [erlang-questions] yet another noob here In-Reply-To: <20930779.post@talk.nabble.com> References: <20930779.post@talk.nabble.com> Message-ID: <20946184.post@talk.nabble.com> Hello , you need to export proc/0 too also -xports([sart/0,proc/0]). maxoid wrote: > > Hi, All, I am new to Erlang. Missing something obvious in the code below > > -module(test). > -export([start/0]). > > proc() -> > true > . > > start() -> > spawn(?MODULE, proc, []) > . > > the session goes like this > > 136> c("e:/developer/scripts/test.erl"). > e:/developer/scripts/test.erl:4: Warning: function proc/0 is unused > {ok,test} > 137> test:start(). > > =ERROR REPORT==== 10-Dec-2008::01:16:03 === > Error in process <0.3557.0> with exit value: > {undef,[{test,proc,[]},{error_handler,crash,1}]} > > <0.3557.0> > 138> > > The questions I have are > > 1. Why it's crashing? > 2. Why does it produce a warning that 'proc/0' is unused? > > I'm running 12B-5 on a single CPU Windows XP. Keeps me awake:) > > Any ideas? > Thanks > > > > -- View this message in context: http://www.nabble.com/yet-another-noob-here-tp20930779p20946184.html Sent from the Erlang Questions mailing list archive at Nabble.com. From dan.milstein@REDACTED Thu Dec 11 00:46:34 2008 From: dan.milstein@REDACTED (Dan Milstein) Date: Wed, 10 Dec 2008 18:46:34 -0500 Subject: [erlang-questions] Running rb with detached/remsh Message-ID: <57D708E9-86D4-43CB-9B65-CED6F88BB26E@appingo.com> I'm starting up a long-running app with (stripping out a few options): > erl -boot start_sasl -detached -sname NODENAME And with configs to do rotating logs: {errlog_type, error}, {error_logger_mf_dir,"log"}, I'd like to return to that machine, attach to the node, and read the logs with rb(). I'm trying that via: > erl -sname test -remsh NODENAME@REDACTED And then running rb:start() / rb:list() from the erlang prompt. But no matter what I do, rb doesn't show any log activity (even though I know there's plenty there, and can see it in the filesystem). Any ideas on what I'm doing wrong? (Or, any ideas on better ways to start up long-running erlang apps and monitor their logs -- is the above The Right Way?). -Dan Milstein From ok@REDACTED Thu Dec 11 05:12:53 2008 From: ok@REDACTED (Richard O'Keefe) Date: Thu, 11 Dec 2008 17:12:53 +1300 Subject: [erlang-questions] Noob questions: Searching a tree In-Reply-To: References: Message-ID: <3A1D5300-DC6F-48B5-B99F-2D135E67B3C2@cs.otago.ac.nz> On 10 Dec 2008, at 12:25 am, Edward Stow wrote: > Hi > > Is this a friendly place to ask very simple questions about Erlang and > functional programming. I'm learning both at the same time. For > example I want to search for a value in the nodes of a tree structure. > The tree is simply nested lists. For example > > 6> tut1:search(a, [b, [a]]). > true > 7> tut1:search(a, [b, [c]]). > false > 8> tut1:search(a, [ [a], b]). > true The starting point is a question: "What do you *mean* 'the tree is simply nested lists'?" Can a "value" ever be a list itself? If so, does the "value" [a,b] occur in the list [c,a,b]? Haskell programmers talk about "rose trees" where a rose tree is a node that has a value and 0 or more subtrees. is_rose_tree({Value,Children}) -> is_rose_tree_list(Children); is_rose_tree(_) -> false. is_rose_tree_list([Tree|Trees]) -> case is_rose_tree(Tree) of true -> is_rose_tree_list(Trees) ; false -> false end; is_rose_tree_list([]) -> true; is_rose_tree_list(_) -> false. The nice thing about starting by writing down a recogniser for a recursive data structure is that computations on it are often straightforward edits of the recogniser. So member_rose_tree(X, {X,_}) -> true; member_rose_tree(X, {_,L}) -> member_rose_tree_list(X, L). member_rose_tree_list(X, [T|Ts]) -> case member_rose_tree_list(X, T) of true -> true ; false -> member_rose_tree_list(X, Ts) end; member_rose_tree_list(_, []) -> false. Note that with this representation a rose tree CAN be a value in a rose tree, and there is never any doubt about which bits are values held in the tree and which are substructure. Of course this is prettier in Haskell: data Rose_Tree t = Rose_Tree t [Rose_Tree t] x `elem` (Rose_Tree y ts) = x == y || any [x `elem` t | t <- ts] but the Erlang version is also straightforward. > > > My implementation is: Is this implementation OK or how else would it > be performed. > > -module(tut1). > -export([search/2]). > > %% Search for an element in tree (nested lists) > > search(_, []) -> > false; > > search(A, [A|_]) -> > true; > > search(A, [H|T]) when list(H), length(H) > 0 -> > [H1|T1] = H, > search(A, [H1 | [T1 | T]]); > > search (A, [_|T]) -> > search(A, T). length/1 is an order N operation. In this context, you simply don't need it. Your third rule could just be search(A, [[H1|T1]|T]) -> search(A, [H1|[T1|T]]); From your definition, you ARE willing to accept a list as a value in a nested list, and you are even willing to accept [a,b] as one of the values in [c,a,b] --- I would NOT be --- so you could simplify the whole thing to search(A, A) -> true; search(A, [H|T]) -> case search(A, H) of true -> true ; false -> search(A, T) end; search(A, _) -> false. It's not quite the same, but close enough for government work. I do think that a clearer separation between "payload" and "structure" would be a good idea, as in the "rose tree" datatype described above. > > > Question: I'm not really sure of the semantics of the comma operator > in the function when clause: > search(A, [H|T]) when list(H), length(H) > 0 -> It means "AND". > > Can somebody point me towards some relevant documentation. Either the old Erlang book or Joe's new Erlang book. The on-line reference manual, which is at http://www.erlang.org/doc/reference_manual/part_frame.html describes guards in "6.24 Guard Sequences", which you can reach from the navigation bar on the left. From art_den@REDACTED Thu Dec 11 05:21:24 2008 From: art_den@REDACTED (=?koi8-r?Q?=E4=C5=CE=C9=D3_=E1=D2=D4=A3=CD=CF=D7?=) Date: Thu, 11 Dec 2008 07:21:24 +0300 Subject: [erlang-questions] =?koi8-r?b?U05NUCBsaWJyYXJ5OiBJcyBpdCBwb3Nz?= =?koi8-r?b?aWJsZSB0byBmaW5kIG91dCBFbmdpbmVJZCBvZiByZW1vdGUgU05N?= =?koi8-r?b?UCBhZ2VudCB0aHJvdWdoIFNOTVB2MyBwcm90b2NvbD8=?= Message-ID: I want to find out the EngineId of remote SNMP agent from SNMP manager. I know that EngineId is included into each PDU packet from remote SNMP agent after any request from SNMP manager (even if there is no correct auth or priv info in the request). But I don't know how to extract it from PDU packet. Is it possible with Erlang's SNMP library? From michael@REDACTED Thu Dec 11 06:05:25 2008 From: michael@REDACTED (Michael Ossareh) Date: Wed, 10 Dec 2008 21:05:25 -0800 Subject: [erlang-questions] jinterface List vs. String In-Reply-To: <6a3ae47e0812090154n2c197e0al495f75fc93e0820d@mail.gmail.com> References: <6a3ae47e0812090154n2c197e0al495f75fc93e0820d@mail.gmail.com> Message-ID: Hi Robert, On Tue, Dec 9, 2008 at 1:54 AM, Robert Raschke wrote: > Hi, > > does anyone have a good idea on how I can distinguish between a list > and a string in jinterface? We've just written a jinterface layer to a jabber fsm we created, much work in this space! > > Or, in other words, if jinterface has decided to receive an > OtpErlangString (from a sent list like [1, 2, 3], for example), is > there an easy way to convert it to an OtpErlangList? I know I can do > it by hand, but that's ever so slightly icky. The most awkward thing I've found is that a piece of data in our erlang code that should be a string is a list when it has zero length. This is where 90% of the errors we had with jinterface came from. The simple test is if ( sData instanceof OtpErlangString) { its a string } else { its a string with 0 length || list } In our case we do not care for lists so just leave the java.lang.String that it would be assigned to null. So, to summarize, im my experience thus far most of time you just have to know what to expect. Check that it is the data type that you are expecting (instanceof) and then provide a cleaner abstraction in layers above. > > Thanks, > Robby > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- god loves atheists, Fact: http://www.mrwiggleslovesyou.com/comics/rehab477.jpg From dave.smith.to@REDACTED Thu Dec 11 07:38:44 2008 From: dave.smith.to@REDACTED (Dave Smith) Date: Thu, 11 Dec 2008 01:38:44 -0500 Subject: [erlang-questions] Geographical distribution of Erlang programmers In-Reply-To: References: <20918802.post@talk.nabble.com> Message-ID: <5ea453f90812102238w32f9afebs92da30a9e5ebf144@mail.gmail.com> I thought it'd be interesting to see how the countries in your list rank per capita. Using Sweden as the unit, here are the weighed measures... Sweden 11,49 1,0000 Canada 3,15 0,0746 US 24,60 0,0637 UK 4,93 0,0637 France 2,83 0,0348 Germany 3,32 0,0317 Russia 3,61 0,0202 Japan 2,88 0,0178 China 10,99 0,0065 India 2,62 0,0018 All Others 29,57 0,0068 2008/12/10 Kenneth Lundin > Hi, > > The statistics from erlang.org for the last month regarding number of > visits and their geographic location shows the following in percent: > An interesting note is that China is increasing its percentage for each > month. > > US 24,60255624 > Sweden 11,4947864 > China 10,99083268 > UK 4,930126154 > Russia 3,610563135 > Germany 3,323773685 > Canada 3,148052981 > Japan 2,876183214 > France 2,834739652 > India 2,615917643 > All Others 29,57246821 > > /Kenneth Erlang/OTP, Ericsson > > > On Tue, Dec 9, 2008 at 6:00 PM, Zvi wrote: > > > > Hi, > > > > I want to know the geographical distribution of Erlang programmers. > > In other words: "If you going to open Erlang shop, where is the best > place > > to do it?". > > > > Thanks in Advance, > > Zvi > > -- > > View this message in context: > http://www.nabble.com/Geographical-distribution-of-Erlang-programmers-tp20918802p20918802.html > > Sent from the Erlang Questions mailing list archive at Nabble.com. > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikpe@REDACTED Thu Dec 11 09:54:16 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 11 Dec 2008 09:54:16 +0100 Subject: [erlang-questions] problems building r11b-3 In-Reply-To: <8209f740812100854x24e0655dlfe448bc70af721b3@mail.gmail.com> References: <8209f740812100531k4b324bd8k5b9ef20b0280f51b@mail.gmail.com> <18751.52501.911202.93657@harpo.it.uu.se> <8209f740812100715o69648664n4167dab2acef7772@mail.gmail.com> <18751.58219.611844.252922@harpo.it.uu.se> <8209f740812100850n481e06b1yf0b794d5cf6fb5aa@mail.gmail.com> <8209f740812100854x24e0655dlfe448bc70af721b3@mail.gmail.com> Message-ID: <18752.54584.621855.868017@harpo.it.uu.se> Ulf Wiger writes: > ...except that failed too. :( Without details of that failure there's not much I can suggest. You did do the `./configure --disable-hipe; make` in a clean directory from a freshly unpacked tarball, right? Or at least you did a `make eclean` before the re-configure? > > /U > > 2008/12/10 Ulf Wiger : > > Thanks. Indeed it said that floating point exceptions were > > unreliable. I think I'll just disable hipe, since I have a good > > R12B install already. > > > > BR, > > Ulf W > > > > 2008/12/10 Mikael Pettersson : > >> Ulf Wiger writes: > >> > Thanks, That got me further: > >> [snip] > >> > obj/i686-pc-linux-gnu/opt/hybrid/ttsl_drv.o -lutil -ldl -lm > >> > -lpthread -lncurses -L../lib/internal/i686-pc-linux-gnu > >> > /home/uwiger/src/otp/otp_src_R11B-3/erts/obj/i686-pc-linux-gnu/libz.a > >> > -lethread -lpthread -lerts_internal_r -lrt > >> > obj/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.o: In function > >> > `nbif_handle_fp_exception': > >> > /home/uwiger/src/otp/otp_src_R11B-3/erts/emulator/i686-pc-linux-gnu/opt/hybrid/hipe_x86_bifs.S:269: > >> > undefined reference to `erts_restore_fpu' > >> > collect2: ld returned 1 exit status > >> > make[3]: *** [/home/uwiger/src/otp/otp_src_R11B-3/bin/i686-pc-linux-gnu/beam.hybrid] > >> > Error 1 > >> > >> Looks like erts/configure didn't detect working FP exceptions on this box, > >> which since it's an x86 most likely is a compile problem with the fpe-test.c > >> program embedded in erts/configure.in. Without FP exceptions you can't have > >> HiPE (except on ARM which assumes no HW FPU). > >> > >> I believe there are now (R12) explicit checks in erts/configure to disable > >> HiPE on x86/powerpc/sparc if FP exceptions don't work, perhaps those checks > >> don't exist in R11. > >> > >> Either run erts/configure again and look for messages about reliable floating- > >> point exceptions not working, or look in erts/i686-pc-linux-gnu/config.h for > >> a #define NO_FPE_SIGNALS. > >> > >> If you can't resolve the lack of FP exception support, you'll have to > >> reconfigure with --disable-hipe. > >> > > > From attila.rajmund.nohl@REDACTED Thu Dec 11 10:14:45 2008 From: attila.rajmund.nohl@REDACTED (attila.rajmund.nohl@REDACTED) Date: Thu, 11 Dec 2008 10:14:45 +0100 (CET) Subject: [erlang-questions] Geographical distribution of Erlang programmers In-Reply-To: <5ea453f90812102238w32f9afebs92da30a9e5ebf144@mail.gmail.com> References: <20918802.post@talk.nabble.com> <5ea453f90812102238w32f9afebs92da30a9e5ebf144@mail.gmail.com> Message-ID: On Thu, 11 Dec 2008, Dave Smith wrote: > I thought it'd be interesting to see how the countries in your list rank per > capita. Using Sweden as the unit, here are the weighed measures... > > Sweden 11,49 1,0000 > Canada 3,15 0,0746 > US 24,60 0,0637 > UK 4,93 0,0637 > France 2,83 0,0348 > Germany 3,32 0,0317 > Russia 3,61 0,0202 > Japan 2,88 0,0178 > China 10,99 0,0065 > India 2,62 0,0018 > All Others 29,57 0,0068 On the other hand I'm pretty sure that most Ericsson employees are counted in the Sweden line even though they may be located thousands of miles from Sweden (they are going out through the same proxy), so I don't know how useful is this statistics... Bye,NAR -- "Beware of bugs in the above code; I have only proved it correct, not tried it." From jlprasantha@REDACTED Thu Dec 11 10:45:18 2008 From: jlprasantha@REDACTED (prasantha kumara) Date: Thu, 11 Dec 2008 15:15:18 +0530 Subject: [erlang-questions] string handling in erlang Message-ID: hi All, i am dealing with a erlang programme.in that programme i need to tokenize the atom by "*".can anybody how to solve this matter thanks prasantha -------------- next part -------------- An HTML attachment was scrubbed... URL: From torben.lehoff@REDACTED Thu Dec 11 11:27:22 2008 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Thu, 11 Dec 2008 11:27:22 +0100 Subject: [erlang-questions] string handling in erlang In-Reply-To: References: Message-ID: http://www.erlang.org/doc/man/string.html tokens(String, SeparatorList) -> Tokens Types: String = SeparatorList = string() Tokens = [string()] Returns a list of tokens in String, separated by the characters in SeparatorList. For example: > tokens("abc defxxghix jkl", "x "). ["abc", "def", "ghi", "jkl"] http://www.erlang.org/doc/ should be one of your most used links when you start Erlang programming. Cheers, Torben 2008/12/11 prasantha kumara > hi All, > i am dealing with a erlang programme.in that programme i need to tokenize > the atom by "*".can anybody how to solve this matter > thanks > prasantha > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rtrlists@REDACTED Thu Dec 11 13:00:30 2008 From: rtrlists@REDACTED (Robert Raschke) Date: Thu, 11 Dec 2008 12:00:30 +0000 Subject: [erlang-questions] Webtool to show wrap disk logs? Message-ID: <6a3ae47e0812110400m2ab4583fh2038b3ab9d2b0f75@mail.gmail.com> Hi, before embarking on making one, does anyone have a webtool like thingy to show a disk_log and/or SASL error_logger_mf_dir report? I don't need anything fancy, just a reasonably easy way to look at a log in a paged way. Doesn't sound hard, but I thought, if there's prior art, well then ... Thanks, Robby From zerthurd@REDACTED Thu Dec 11 14:18:09 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Thu, 11 Dec 2008 19:18:09 +0600 Subject: [erlang-questions] Strange ets:select behaviour Message-ID: Hello I have error with ets:select when I use MatchSpec with tuple matching. It is my table: (n1@REDACTED)2> ets:i(controllers). <1 > {{{192,168,138,73},37100,2},<0.61.0>} EOT (q)uit (p)Digits (k)ill /Regexp -->q quit it contains IPv4 address, port and assoc_id as key and process Pid. So, when I select with following two MatchSpecs, I have no problems: (n1@REDACTED)5> ets:select(controllers, [{{{'$1', '$2', '$3'}, '$4'}, [{'==', '$3', 2}, {is_pid, '$4'}], ['$4']}]). [<0.61.0>] (n1@REDACTED)6> ets:select(controllers, [{{{'$1', '$2', '$3'}, '$4'}, [{'==', '$2', 37100}, {is_pid, '$4'}], ['$4']}]). [<0.61.0>] (see on {'==', $...}) But with this MatchSpec I have error: (n1@REDACTED)7> ets:select(controllers, [{{{'$1', '$2', '$3'}, '$4'}, [{'==', '$1', {192,168,138,73}}, {is_pid, '$4'}], ['$4']}]). ** exception error: bad argument in function ets:select/2 called as ets:select(controllers, [{{{'$1','$2','$3'},'$4'}, [{'==','$1',{192,168,138,73}},{is_pid,'$4'}], ['$4']}]) Is it means that impossible to use tuples in MatchSpec guards? My OTP is R12B-5. Thank you. -- Maxim Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From ext@REDACTED Thu Dec 11 14:26:25 2008 From: ext@REDACTED (David Sveningsson) Date: Thu, 11 Dec 2008 14:26:25 +0100 Subject: [erlang-questions] Autogenerating node names Message-ID: <49411501.50007@sidvind.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I am trying to autogenerate names for nodes if they aren't given one with -sname or -name. I've got it (partial) working with the following code: Name = foo:generate_name(), case net_kernel:start([Name, shortnames]) of {ok, _Pid} -> init(); {error, Reason} -> io:format("Node isn't alive and failed to autogenerate a name:~n~p~n", [Reason]) end; Now, this works as long as epmd has already been started. If not it fails with: {shutdown,{child,undefined,net_sup_dynamic, {erl_distribution,start_link, [['Node_B184E4E0@REDACTED',shortnames]]}, permanent,1000,supervisor, [erl_distribution]}} =INFO REPORT==== 4-Dec-2008::10:17:46 === Protocol: "inet_tcp": register error: {{badmatch,{error,econnrefused}}, [{inet_tcp_dist,listen,1}, {net_kernel,start_protos,4}, {net_kernel,start_protos,3}, {net_kernel,init_node,2}, {net_kernel,init,1}, {gen_server,init_it,6}, {proc_lib,init_p_do_apply,3}]} Is there a simpler way to autogenerate names or is there a way to start epmd automatically (as it does when using -sname or -name)? -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAklBFQEACgkQ6pa1H/H5pqX3dQCfSrw8nSxLoXv81NIpsjzRTCK4 URIAniqKYl2xiJ4rg+IN4MT9BZwUmGaD =vLAk -----END PGP SIGNATURE----- From exta7@REDACTED Thu Dec 11 14:42:23 2008 From: exta7@REDACTED (Zvi) Date: Thu, 11 Dec 2008 05:42:23 -0800 (PST) Subject: [erlang-questions] Autogenerating node names In-Reply-To: <49411501.50007@sidvind.com> References: <49411501.50007@sidvind.com> Message-ID: <20955645.post@talk.nabble.com> Hi David, This is the code I using: start_node(NodeName, Cookie) -> _Pid = spawn(os,cmd,[os:find_executable("epmd")++" -daemon"]), %% TODO: find something better than sleeep, to wait until epmd is up timer:sleep(1000), {ok, _} = net_kernel:start([to_atom(NodeName), shortnames]), true = erlang:set_cookie(node(), to_atom(Cookie)). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% convert any sensible input argument to atom: %% i.e, atom, binary, list string, deeplist / IO-list %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% to_atom(S) when is_atom(S) -> S; to_atom(S) when is_binary(S) -> list_to_atom(binary_to_list(S)); to_atom(S) when is_list(S) -> try list_to_atom(S) of Val -> Val catch error : _ -> list_to_atom(binary_to_list(erlang:iolist_to_binary(S))) end. -- View this message in context: http://www.nabble.com/Autogenerating-node-names-tp20955536p20955645.html Sent from the Erlang Questions mailing list archive at Nabble.com. From mkurkov@REDACTED Thu Dec 11 15:09:27 2008 From: mkurkov@REDACTED (Mikl Kurkov) Date: Thu, 11 Dec 2008 06:09:27 -0800 (PST) Subject: [erlang-questions] Strange "query" keyword in erlang.el sources Message-ID: <20956089.post@talk.nabble.com> Hello! I see strange "query" keyword in the emacs integration sources. It makes indentation of functions with name "query" incorrect. Does Erlang really have "query" keyword or it can be removed from the emacs integration sources? -- Mikl -- View this message in context: http://www.nabble.com/Strange-%22query%22-keyword-in-erlang.el-sources-tp20956089p20956089.html Sent from the Erlang Questions mailing list archive at Nabble.com. From ext@REDACTED Thu Dec 11 15:39:21 2008 From: ext@REDACTED (David Sveningsson) Date: Thu, 11 Dec 2008 15:39:21 +0100 Subject: [erlang-questions] Autogenerating node names In-Reply-To: <20955645.post@talk.nabble.com> References: <49411501.50007@sidvind.com> <20955645.post@talk.nabble.com> Message-ID: <49412619.9030306@sidvind.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Zvi wrote: > Hi David, > > This is the code I using: > > > start_node(NodeName, Cookie) -> > _Pid = spawn(os,cmd,[os:find_executable("epmd")++" -daemon"]), > %% TODO: find something better than sleeep, to wait until epmd is up > timer:sleep(1000), > {ok, _} = net_kernel:start([to_atom(NodeName), shortnames]), > true = erlang:set_cookie(node(), to_atom(Cookie)). > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > %% convert any sensible input argument to atom: > %% i.e, atom, binary, list string, deeplist / IO-list > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > to_atom(S) when is_atom(S) -> S; > to_atom(S) when is_binary(S) -> list_to_atom(binary_to_list(S)); > to_atom(S) when is_list(S) -> > try list_to_atom(S) of > Val -> Val > catch > error : _ -> list_to_atom(binary_to_list(erlang:iolist_to_binary(S))) > end. > > Thanks, but I was hoping to be able to skip the timer part. Does anyone know when epmd forks? Before or after its initialization? Let me rephrase that, is epmd ready when "epmd -daemon" returns or must one wait an unspecified time while it is starting? -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAklBJhkACgkQ6pa1H/H5pqVijgCeN+wQOgZHwTjMYyZuWfpuIbe1 noAAnRj4Ct5wnOyx/Wo95MZY6IZnV6oQ =UBmC -----END PGP SIGNATURE----- From vladdu55@REDACTED Thu Dec 11 15:46:03 2008 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 11 Dec 2008 15:46:03 +0100 Subject: [erlang-questions] Autogenerating node names In-Reply-To: <49412619.9030306@sidvind.com> References: <49411501.50007@sidvind.com> <20955645.post@talk.nabble.com> <49412619.9030306@sidvind.com> Message-ID: <95be1d3b0812110646u7ac8cd98oaf64736dee4bb11d@mail.gmail.com> > Thanks, but I was hoping to be able to skip the timer part. Does anyone > know when epmd forks? Before or after its initialization? > > Let me rephrase that, is epmd ready when "epmd -daemon" returns or must > one wait an unspecified time while it is starting? Hi, I suppose you can try to open a socket to the epmd port until it succeeds. That's what I do from Java. regards, Vlad From magnus@REDACTED Thu Dec 11 15:59:16 2008 From: magnus@REDACTED (Magnus Henoch) Date: Thu, 11 Dec 2008 14:59:16 +0000 Subject: [erlang-questions] Strange ets:select behaviour References: Message-ID: <848wqmpxkr.fsf@linux-b2a3.site> "Maxim Treskin" writes: > But with this MatchSpec I have error: > > (n1@REDACTED)7> ets:select(controllers, [{{{'$1', '$2', '$3'}, '$4'}, [{'==', '$1', > {192,168,138,73}}, {is_pid, '$4'}], ['$4']}]). > ** exception error: bad argument > in function ets:select/2 > called as ets:select(controllers, > [{{{'$1','$2','$3'},'$4'}, > [{'==','$1',{192,168,138,73}},{is_pid,'$4'}], > ['$4']}]) > > > Is it means that impossible to use tuples in MatchSpec guards? Not impossible, but you have to write it as either {{192,168,138,73}} (a nested tuple) or {const, {192,168,138,73}}. From "Match specifications in Erlang", http://www.erlang.org/doc/apps/erts/match_spec.html#1.3 : In the MatchHead part, all literals (except the variables noted above) are interpreted as is. In the MatchCondition/MatchBody parts, however, the interpretation is in some ways different. Literals in the MatchCondition/MatchBody can either be written as is, which works for all literals except tuples, or by using the special form {const, T}, where T is any Erlang term. For tuple literals in the match_spec, one can also use double tuple parentheses, i.e., construct them as a tuple of arity one containing a single tuple, which is the one to be constructed. The "double tuple parenthesis" syntax is useful to construct tuples from already bound variables, like in {{'$1', [a,b,'$2']}}. You might find it easier not to write match specifications manually, instead using ets:fun2ms/1. -- Magnus Henoch, magnus@REDACTED Erlang Training and Consulting http://www.erlang-consulting.com/ From erlang@REDACTED Thu Dec 11 16:40:17 2008 From: erlang@REDACTED (Dominic Williams) Date: Thu, 11 Dec 2008 10:40:17 -0500 (EST) Subject: [erlang-questions] Strange "query" keyword in erlang.el sources In-Reply-To: <20956089.post@talk.nabble.com> References: <20956089.post@talk.nabble.com> Message-ID: <9105d05bfab2094d9d45f1f7e0e4ed9d.squirrel@www.geekisp.com> Hello Mikl, > I see strange "query" keyword in the emacs integration sources. > It makes indentation of functions with name "query" incorrect. > > Does Erlang really have "query" keyword or it can be removed from the > emacs integration sources? Erlang really has a query keyword (cf. deprecated mnemosyne module). Regards, Dominic Williams http://dominicwilliams.net ---- From dawsdesign@REDACTED Thu Dec 11 16:57:54 2008 From: dawsdesign@REDACTED (Matt Williamson) Date: Thu, 11 Dec 2008 10:57:54 -0500 Subject: [erlang-questions] NYC Erlounge - Thursday the 11th at the Golden Unicorn In-Reply-To: <926488.39164.qm@web31504.mail.mud.yahoo.com> References: <9810b81b0812100914x99196f7t2513a613131b5b06@mail.gmail.com> <926488.39164.qm@web31504.mail.mud.yahoo.com> Message-ID: I'm sorry that I won't make it. It's too late in the day for me :( 2008/12/10 Vat Raghavan > wonderful! > > Can't wait to meet everyone there! > > > ----.signature---- > Without the hope that things will get better, that our inheritors will know > a world that is fuller and richer than our own, > life is pointless, and evolution is vastly overrated > -- Delenn > > ------------------------------ > *From:* Rick R > *To:* Erlang Questions > *Sent:* Wednesday, December 10, 2008 12:14:05 PM > *Subject:* [erlang-questions] NYC Erlounge - Thursday the 11th at the > Golden Unicorn > > Forgive me if this is a repost, I attempted to send this earlier but there > was complaint that it wasn't sent and I couldn't find it in my sent folder. > > Okay. I've managed to find a quiet restaurant with meeting space that > has availability this week. > > The venue is The Golden Unicorn in Chinatown. > http://www.yelp.com/biz/golden-unicorn-new-york > > The guy told me that it is on the 3rd floor. I'm not sure if the > entire restaurant is on the 3rd floor, or just our spot. > > The time is 7:30pm Thursday > > I hope to see everyone there. It will be nice to finally put faces to > some of these names. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zerthurd@REDACTED Thu Dec 11 17:22:07 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Thu, 11 Dec 2008 22:22:07 +0600 Subject: [erlang-questions] Strange ets:select behaviour In-Reply-To: <848wqmpxkr.fsf@linux-b2a3.site> References: <848wqmpxkr.fsf@linux-b2a3.site> Message-ID: Thank you very much, Magnus! It works :) -- Maxim Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From weaveinator@REDACTED Thu Dec 11 18:16:32 2008 From: weaveinator@REDACTED (Steve Weaver) Date: Thu, 11 Dec 2008 09:16:32 -0800 Subject: [erlang-questions] How to interpet erl_crash.dump file Message-ID: Hi - Having problems with Rabbitmq starting for the first time. It uses Erlang which crashes on startup and creates the erl_crash.dump file. I'm thinking it could be permissions problems but would like to check this file out as I have checked everything I can think of. Dies running as root as well as user. I read that you can use Erlang Enterprize to read the dump file - is there a utility that I can use to do this? Thanks for any help! -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangy@REDACTED Thu Dec 11 18:50:40 2008 From: erlangy@REDACTED (Michael McDaniel) Date: Thu, 11 Dec 2008 09:50:40 -0800 Subject: [erlang-questions] How to interpet erl_crash.dump file In-Reply-To: References: Message-ID: <20081211175040.GG10121@delora.autosys.us> $ erl ... 1> webtool:start(). On Thu, Dec 11, 2008 at 09:16:32AM -0800, Steve Weaver wrote: > Hi - > Having problems with Rabbitmq starting for the first time. It uses > Erlang which crashes on startup and creates the erl_crash.dump file. > I'm thinking it could be permissions problems but would like to check > this file out as I have checked everything I can think of. Dies > running as root as well as user. I read that you can use Erlang > Enterprize to read the dump file - is there a utility that I can use to > do this? > Thanks for any help! > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- Michael McDaniel Portland, Oregon, USA http://autosys.us From exta7@REDACTED Thu Dec 11 19:01:32 2008 From: exta7@REDACTED (Zvi) Date: Thu, 11 Dec 2008 10:01:32 -0800 (PST) Subject: [erlang-questions] Autogenerating node names In-Reply-To: <95be1d3b0812110646u7ac8cd98oaf64736dee4bb11d@mail.gmail.com> References: <49411501.50007@sidvind.com> <20955645.post@talk.nabble.com> <49412619.9030306@sidvind.com> <95be1d3b0812110646u7ac8cd98oaf64736dee4bb11d@mail.gmail.com> Message-ID: <20961014.post@talk.nabble.com> Vlad, do you know how to programmatically get the range of epmd ports? Thanks, Zvi Vlad Dumitrescu-2 wrote: > >> Thanks, but I was hoping to be able to skip the timer part. Does anyone >> know when epmd forks? Before or after its initialization? >> >> Let me rephrase that, is epmd ready when "epmd -daemon" returns or must >> one wait an unspecified time while it is starting? > > Hi, > > I suppose you can try to open a socket to the epmd port until it > succeeds. That's what I do from Java. > > regards, > Vlad > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- View this message in context: http://www.nabble.com/Autogenerating-node-names-tp20955536p20961014.html Sent from the Erlang Questions mailing list archive at Nabble.com. From vladdu55@REDACTED Thu Dec 11 19:43:43 2008 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 11 Dec 2008 19:43:43 +0100 Subject: [erlang-questions] Autogenerating node names In-Reply-To: <20961014.post@talk.nabble.com> References: <49411501.50007@sidvind.com> <20955645.post@talk.nabble.com> <49412619.9030306@sidvind.com> <95be1d3b0812110646u7ac8cd98oaf64736dee4bb11d@mail.gmail.com> <20961014.post@talk.nabble.com> Message-ID: <95be1d3b0812111043l6ec8fae5ma77f89f98e83c92d@mail.gmail.com> On Thu, Dec 11, 2008 at 19:01, Zvi wrote: > > do you know how to programmatically get the range of epmd ports? No, sorry, I assume the default port 4369. regards, Vlad From harveyd@REDACTED Thu Dec 11 20:11:09 2008 From: harveyd@REDACTED (Dale Harvey) Date: Thu, 11 Dec 2008 19:11:09 +0000 Subject: [erlang-questions] How to interpet erl_crash.dump file In-Reply-To: <20081211175040.GG10121@delora.autosys.us> References: <20081211175040.GG10121@delora.autosys.us> Message-ID: just to point out that the 'upload' in crashdumpviewer wont work on most recent browsers, can get round it by doing crashdump_viewer:read_file(junk,"path=/path/to/erl_crash.dump"). after starting the application, then browsing to the site as normal 2008/12/11 Michael McDaniel > $ erl > > ... > > 1> webtool:start(). > > > On Thu, Dec 11, 2008 at 09:16:32AM -0800, Steve Weaver wrote: > > Hi - > > Having problems with Rabbitmq starting for the first time. It uses > > Erlang which crashes on startup and creates the erl_crash.dump file. > > I'm thinking it could be permissions problems but would like to check > > this file out as I have checked everything I can think of. Dies > > running as root as well as user. I read that you can use Erlang > > Enterprize to read the dump file - is there a utility that I can use > to > > do this? > > Thanks for any help! > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- > Michael McDaniel > Portland, Oregon, USA > http://autosys.us > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From per@REDACTED Fri Dec 12 00:24:18 2008 From: per@REDACTED (Per Hedeland) Date: Fri, 12 Dec 2008 00:24:18 +0100 (CET) Subject: [erlang-questions] Autogenerating node names In-Reply-To: <49412619.9030306@sidvind.com> Message-ID: <200812112324.mBBNOIQc064017@pluto.hedeland.org> David Sveningsson wrote: > >Thanks, but I was hoping to be able to skip the timer part. Does anyone >know when epmd forks? Before or after its initialization? > >Let me rephrase that, is epmd ready when "epmd -daemon" returns or must >one wait an unspecified time while it is starting? I'd rephrase it as a suggestion, because it's a very nice way to start up a daemon, but epmd doesn't do that - it forks first (read the source:-). You can use erl_epmd:names/0 to check on its presence/readiness though, e.g. something like this: start_epmd() -> start_epmd(0, 10). start_epmd(N, N) -> {error, too_many_tries}; start_epmd(M, N) -> case erl_epmd:names() of {ok, _} -> ok; _ when M == 0 -> os:cmd("epmd -daemon"), start_epmd(M+1, N); _ -> timer:sleep(1), start_epmd(M+1, N) end. Adjust "10" and "1" to taste, when I tried it I never managed to get to the sleep... --Per Hedeland From per@REDACTED Fri Dec 12 00:29:55 2008 From: per@REDACTED (Per Hedeland) Date: Fri, 12 Dec 2008 00:29:55 +0100 (CET) Subject: [erlang-questions] Autogenerating node names In-Reply-To: <95be1d3b0812111043l6ec8fae5ma77f89f98e83c92d@mail.gmail.com> Message-ID: <200812112329.mBBNTt1e064221@pluto.hedeland.org> "Vlad Dumitrescu" wrote: > >On Thu, Dec 11, 2008 at 19:01, Zvi wrote: >> >> do you know how to programmatically get the range of epmd ports? > >No, sorry, I assume the default port 4369. That's the only one. $ grep epmd /etc/services epmd 4369/tcp # Erlang Port Mapper Daemon epmd 4369/udp # Erlang Port Mapper Daemon --Per From saleyn@REDACTED Fri Dec 12 03:54:41 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Thu, 11 Dec 2008 21:54:41 -0500 Subject: [erlang-questions] NYC Erlounge - Thursday the 11th at the Golden Unicorn In-Reply-To: <9810b81b0812100914x99196f7t2513a613131b5b06@mail.gmail.com> References: <9810b81b0812100914x99196f7t2513a613131b5b06@mail.gmail.com> Message-ID: <4941D271.90405@gmail.com> Unfortunately I couldn't make it today, but if there are others interested in meeting next or the following week in Suspenders we can have another Erlounge. Rick R wrote: > Forgive me if this is a repost, I attempted to send this earlier but there > was complaint that it wasn't sent and I couldn't find it in my sent folder. > > Okay. I've managed to find a quiet restaurant with meeting space that > has availability this week. > > The venue is The Golden Unicorn in Chinatown. > http://www.yelp.com/biz/golden-unicorn-new-york > > The guy told me that it is on the 3rd floor. I'm not sure if the > entire restaurant is on the 3rd floor, or just our spot. > > The time is 7:30pm Thursday > > I hope to see everyone there. It will be nice to finally put faces to > some of these names. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From me@REDACTED Fri Dec 12 04:22:35 2008 From: me@REDACTED (Essien Ita Essien) Date: Fri, 12 Dec 2008 04:22:35 +0100 Subject: [erlang-questions] Asynchrous Ssl Listen/Accept Message-ID: <4941D8FB.7090800@essienitaessien.com> Hi all, I'm investigating the possibility of having asynchronous ssl accept'ing in an application. (Prefarably using new_ssl, though if old is what I need, then I have no prolems using it) Basically, something akin to the prim_inet:async_accept/1 trick for tcp listeners. I'm a few months old in erlang, so trying to peruse the ssl source code gave me more than a few bouts of migrane, and I'm not helped by not groking the ssl protocol flow really. Is there any where I should look to find this, maybe a pointer in the right direction. What's throwing me off, is I can't seem to find the division b/w the new_ssl and the old ssl implementation. I have traced as far as ssl_connection:accept, but from there, i get very lost, very fast. Any help, much appreciated. cheers, Essien From vladdu55@REDACTED Fri Dec 12 09:27:35 2008 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 12 Dec 2008 09:27:35 +0100 Subject: [erlang-questions] Autogenerating node names In-Reply-To: <03C23BE0-8FC3-4742-95B8-053DD0BE9BC5@rogvall.se> References: <200812112329.mBBNTt1e064221@pluto.hedeland.org> <03C23BE0-8FC3-4742-95B8-053DD0BE9BC5@rogvall.se> Message-ID: <95be1d3b0812120027g103f5682x3813e5a715a737af@mail.gmail.com> On Fri, Dec 12, 2008 at 09:24, Tony Rogvall wrote: > [tony@REDACTED src]$ grep epmd /etc/services > epmd 4369/tcp # Erlang Port Mapper Daemon > epmd 4369/udp # Erlang Port Mapper Daemon > > Cool. When did this happend? I guess it's been there for a while? Since about exactly 4 years ago. regards, Vlad From tony@REDACTED Fri Dec 12 09:24:29 2008 From: tony@REDACTED (Tony Rogvall) Date: Fri, 12 Dec 2008 09:24:29 +0100 Subject: [erlang-questions] Autogenerating node names In-Reply-To: <200812112329.mBBNTt1e064221@pluto.hedeland.org> References: <200812112329.mBBNTt1e064221@pluto.hedeland.org> Message-ID: <03C23BE0-8FC3-4742-95B8-053DD0BE9BC5@rogvall.se> I just did the command on my mac and it says: [tony@REDACTED src]$ grep epmd /etc/services epmd 4369/tcp # Erlang Port Mapper Daemon epmd 4369/udp # Erlang Port Mapper Daemon Cool. When did this happend? I guess it's been there for a while? /Tony On 12 dec 2008, at 00.29, Per Hedeland wrote: > "Vlad Dumitrescu" wrote: >> >> On Thu, Dec 11, 2008 at 19:01, Zvi wrote: >>> >>> do you know how to programmatically get the range of epmd ports? >> >> No, sorry, I assume the default port 4369. > > That's the only one. > > $ grep epmd /etc/services > epmd 4369/tcp # Erlang Port Mapper > Daemon > epmd 4369/udp # Erlang Port Mapper > Daemon > > > --Per > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From ext@REDACTED Fri Dec 12 10:31:42 2008 From: ext@REDACTED (David Sveningsson) Date: Fri, 12 Dec 2008 10:31:42 +0100 Subject: [erlang-questions] Autogenerating node names In-Reply-To: <200812112324.mBBNOIQc064017@pluto.hedeland.org> References: <200812112324.mBBNOIQc064017@pluto.hedeland.org> Message-ID: <49422F7E.30303@sidvind.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Per Hedeland wrote: > David Sveningsson wrote: >> Thanks, but I was hoping to be able to skip the timer part. Does anyone >> know when epmd forks? Before or after its initialization? >> >> Let me rephrase that, is epmd ready when "epmd -daemon" returns or must >> one wait an unspecified time while it is starting? > > I'd rephrase it as a suggestion, because it's a very nice way to > start up a daemon, but epmd doesn't do that - it forks first > (read the source:-). You can use erl_epmd:names/0 to check on > its presence/readiness though, e.g. something like this: You're right, I should have read the source. =) > > start_epmd() -> > start_epmd(0, 10). > > start_epmd(N, N) -> > {error, too_many_tries}; > start_epmd(M, N) -> > case erl_epmd:names() of > {ok, _} -> > ok; > _ when M == 0 -> > os:cmd("epmd -daemon"), > start_epmd(M+1, N); > _ -> > timer:sleep(1), > start_epmd(M+1, N) > end. > > Adjust "10" and "1" to taste, when I tried it I never managed to > get to the sleep... > > --Per Hedeland > > Thanks, this works excellent! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAklCL34ACgkQ6pa1H/H5pqXDMwCg3HOQTvIeFngIoGjI6eotl1Xk /AUAoNo4QMdn7haAVVjA5kUsrgPax2RL =8U1V -----END PGP SIGNATURE----- From dgud@REDACTED Fri Dec 12 12:21:17 2008 From: dgud@REDACTED (Dan Gudmundsson) Date: Fri, 12 Dec 2008 12:21:17 +0100 Subject: [erlang-questions] wxErlang release Message-ID: <4942492D.4060909@erix.ericsson.se> I've put up a new release. See http://wxerlang.sf.net Windows and Mac users can use the pre-built version, download and unpack wx-0.97.1212.built.tar.gz. Linux users have to grab the source and build it. It now includes a short test-suite, please test and expand it! /Dan From per@REDACTED Fri Dec 12 12:44:50 2008 From: per@REDACTED (Per Hedeland) Date: Fri, 12 Dec 2008 12:44:50 +0100 (CET) Subject: [erlang-questions] Autogenerating node names In-Reply-To: <95be1d3b0812120027g103f5682x3813e5a715a737af@mail.gmail.com> Message-ID: <200812121144.mBCBioEG088053@pluto.hedeland.org> Vlad Dumitrescu wrote: >On Fri, Dec 12, 2008 at 09:24, Tony Rogvall wrote: >>[tony@REDACTED src]$ grep epmd /etc/services >>epmd 4369/tcp # Erlang Port Mapper Daemon >>epmd 4369/udp # Erlang Port Mapper Daemon >> >>Cool. When did this happend? I guess it's been there for a while? > >Since about exactly 4 years ago. Right, see http://www.iana.org/assignments/port-numbers - though we don't know how long it's been in /etc/services on your mac.:-) (Sadly it's not there in a recent FreeBSD version, seems they don't add ports above 1024 anymore.) --Per From ulf.wiger@REDACTED Fri Dec 12 15:09:36 2008 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Fri, 12 Dec 2008 15:09:36 +0100 Subject: [erlang-questions] problems building r11b-3 In-Reply-To: <18752.54584.621855.868017@harpo.it.uu.se> References: <8209f740812100531k4b324bd8k5b9ef20b0280f51b@mail.gmail.com> <18751.52501.911202.93657@harpo.it.uu.se> <8209f740812100715o69648664n4167dab2acef7772@mail.gmail.com> <18751.58219.611844.252922@harpo.it.uu.se> <8209f740812100850n481e06b1yf0b794d5cf6fb5aa@mail.gmail.com> <8209f740812100854x24e0655dlfe448bc70af721b3@mail.gmail.com> <18752.54584.621855.868017@harpo.it.uu.se> Message-ID: <494270A0.7060907@ericsson.com> Mikael Pettersson skrev: > Ulf Wiger writes: > > ...except that failed too. :( > > Without details of that failure there's not much I can suggest. > > You did do the `./configure --disable-hipe; make` in a clean > directory from a freshly unpacked tarball, right? Why of course. ;-) And it worked, too. Thanks, Ulf W From daveb@REDACTED Fri Dec 12 18:14:08 2008 From: daveb@REDACTED (Dave Bryson) Date: Fri, 12 Dec 2008 11:14:08 -0600 Subject: [erlang-questions] BeepBeep: a rails like web framework for Mochiweb Message-ID: <25290050-9778-4CF8-83DA-13ABE4703FB3@miceda.org> Sorry for the slightly off topic post, but I wanted to share a little project I've been working on: BeepBeep is a "Rails" like web framework for building apps with the fabulous Mochiweb. It's very alpha but it does work :-). You can find it here: http://github.com/davebryson/beepbeep/tree/master/README Features: - A script to generate a new web application (based on mochiweb's approach) - Session Server to store your application state - Before filter on your controllers for things like authentication - Django templates for the view It's built around Mochiweb (of course) and erlyDTL for the templates Dave From dawsdesign@REDACTED Fri Dec 12 18:43:45 2008 From: dawsdesign@REDACTED (Matt Williamson) Date: Fri, 12 Dec 2008 12:43:45 -0500 Subject: [erlang-questions] NYC Erlounge - Thursday the 11th at the Golden Unicorn In-Reply-To: <4941D271.90405@gmail.com> References: <9810b81b0812100914x99196f7t2513a613131b5b06@mail.gmail.com> <4941D271.90405@gmail.com> Message-ID: How did it go guys? I'd like to hear some details :) On Thu, Dec 11, 2008 at 9:54 PM, Serge Aleynikov wrote: > Unfortunately I couldn't make it today, but if there are others > interested in meeting next or the following week in Suspenders we can > have another Erlounge. > > Rick R wrote: > > Forgive me if this is a repost, I attempted to send this earlier but > there > > was complaint that it wasn't sent and I couldn't find it in my sent > folder. > > > > Okay. I've managed to find a quiet restaurant with meeting space that > > has availability this week. > > > > The venue is The Golden Unicorn in Chinatown. > > http://www.yelp.com/biz/golden-unicorn-new-york > > > > The guy told me that it is on the 3rd floor. I'm not sure if the > > entire restaurant is on the 3rd floor, or just our spot. > > > > The time is 7:30pm Thursday > > > > I hope to see everyone there. It will be nice to finally put faces to > > some of these names. > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rick.richardson@REDACTED Fri Dec 12 19:42:32 2008 From: rick.richardson@REDACTED (Rick R) Date: Fri, 12 Dec 2008 13:42:32 -0500 Subject: [erlang-questions] NYC Erlounge - Thursday the 11th at the Golden Unicorn In-Reply-To: References: <9810b81b0812100914x99196f7t2513a613131b5b06@mail.gmail.com> <4941D271.90405@gmail.com> Message-ID: <9810b81b0812121042m5ced01dem607a67e416f1e0de@mail.gmail.com> Well... Apparently our reservation was double booked with a party for the Office of the Mayor. When I got there, they had no idea that I was expected, I finally found the guy that made the reservation and he said that our table would be ready in 10 minutes. He said this every 5 minutes for about 30 minutes. Also, the office of the mayor didn't want us loitering in their space while we waited so we were forced to camp out in the stairwell. At about 8pm, we decided to leave. Took a cab to Marks St. and found a sushi joint, where we had a pleasant conversation over sushi and beer until about 10:15. Most of the conversation revolved around some alternatives to mnesia for the Amie Street guys, and Mihai's mysterious employer, and beer. In general the evening was nice, though not a successful Erlounge. Everyone is hopeful that we can, with better weather and planning, organize a regular meeting. I believe Suspenders said that they have Mondays and Tuesdays free. I'll try to ping NYC:Erlang for preferred times. Did I miss anything? On Fri, Dec 12, 2008 at 12:43 PM, Matt Williamson wrote: > How did it go guys? I'd like to hear some details :) > > > On Thu, Dec 11, 2008 at 9:54 PM, Serge Aleynikov wrote: > >> Unfortunately I couldn't make it today, but if there are others >> interested in meeting next or the following week in Suspenders we can >> have another Erlounge. >> >> Rick R wrote: >> > Forgive me if this is a repost, I attempted to send this earlier but >> there >> > was complaint that it wasn't sent and I couldn't find it in my sent >> folder. >> > >> > Okay. I've managed to find a quiet restaurant with meeting space that >> > has availability this week. >> > >> > The venue is The Golden Unicorn in Chinatown. >> > http://www.yelp.com/biz/golden-unicorn-new-york >> > >> > The guy told me that it is on the 3rd floor. I'm not sure if the >> > entire restaurant is on the 3rd floor, or just our spot. >> > >> > The time is 7:30pm Thursday >> > >> > I hope to see everyone there. It will be nice to finally put faces to >> > some of these names. >> > >> > >> > >> > ------------------------------------------------------------------------ >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://www.erlang.org/mailman/listinfo/erlang-questions >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Fri Dec 12 20:34:04 2008 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 12 Dec 2008 11:34:04 -0800 (PST) Subject: [erlang-questions] NYC Erlounge - Thursday the 11th at the Golden Unicorn In-Reply-To: <9810b81b0812121042m5ced01dem607a67e416f1e0de@mail.gmail.com> Message-ID: <828382.17582.qm@web111406.mail.gq1.yahoo.com> --- On Fri, 12/12/08, Rick R wrote: > Well... Apparently our reservation was double booked with a > party for the > Office of the Mayor. > When I got there, they had no idea that I was expected, I > finally found the > guy that made the reservation and he said that our table > would be ready in > 10 minutes. He said this every 5 minutes for about 30 > minutes. Also, the > office of the mayor didn't want us loitering in their > space while we waited > so we were forced to camp out in the stairwell. At about > 8pm, we decided to > leave. Took a cab to Marks St. and found a sushi joint, > where we had a > pleasant conversation over sushi and beer until about > 10:15. > > Most of the conversation revolved around some alternatives > to mnesia for the > Amie Street guys, and Mihai's mysterious employer, and > beer. In general the > evening was nice, though not a successful Erlounge. Compared to the first Erlounge, where by chance basically everybody who turned up had just been terminated at Ericsson or elsewhere -- this happened at a particularly exciting moment of the tech crash -- it actually sounds fairly mellow :-) Best, Thomas From erlang@REDACTED Fri Dec 12 20:36:12 2008 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 12 Dec 2008 20:36:12 +0100 Subject: [erlang-questions] Build failing on Ubuntu 8.10 In-Reply-To: <14f0e3620812080633j3e35a0a5y16713b79651cb636@mail.gmail.com> References: <1228743759.21800.20.camel@seasc1137.dyn.rnd.as.sw.ericsson.se> <20081208142512.58190@gmx.net> <14f0e3620812080633j3e35a0a5y16713b79651cb636@mail.gmail.com> Message-ID: <9b08084c0812121136k255555bn9b052bec058eb67a@mail.gmail.com> I did an Erlang install on ubuntu 8.10 last week - two extra packages must be installed. ncurses-dev (or whatever it's called) and M4 Once you've installed the ncurses dev configure will pass the basic tests (it will probably complain about ssl etc - but ignore this, or install open ssl) When you run make it will probably fail because m4 is missing (it did for me) do $sudu apt-get install m4 then $make clean $./configure $make The make clean is important /Joe Armstrong On Mon, Dec 8, 2008 at 3:33 PM, Gleb Peregud wrote: > Your system is missing curses library. Probably > > sudo apt-get install libncurses5-dev > > will fix this > > Gleb Peregud > http://gleber.pl/ > > Every minute is to be grasped. > Time waits for nobody. > -- Inscription on a Zen Gong > > > > On Mon, Dec 8, 2008 at 3:25 PM, Francois De Serres wrote: >> Hi there, >> >> I am trying to build the latest release on Ubuntu 8.10, using a --prefix=/home/... >> ./configure fails with the error below. >> I tried to install more ncurses libs but it did not help. >> >> Can someone please advise? >> >> Thanks, >> -- >> Fran?ois >> >> [...] >> checking whether the child waiter thread should be enabled... yes on SMP build, but not on non-SMP build >> checking for tgetent in -lncurses... no >> checking for tgetent in -lcurses... no >> checking for tgetent in -ltermcap... no >> checking for tgetent in -ltermlib... no >> configure: error: No curses library functions found >> configure: error: /bin/bash '/home/fdeserres/tmp/otp_src_R12B-5/erts/configure' failed for erts >> >> -- >> Psssst! Schon vom neuen GMX MultiMessenger geh?rt? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From ama08r@REDACTED Fri Dec 12 20:43:12 2008 From: ama08r@REDACTED (Austin Anderson) Date: Fri, 12 Dec 2008 19:43:12 +0000 Subject: [erlang-questions] semantics hot code swapping in Erlang Message-ID: Heya, I'm wanting to get into researching hot code swapping and was wondering if there was a (formal) semantics for Erlang's behaviour with respects to hot code swapping. I have read the Erlang 4.7.3 Reference Manual which I found through the website, which gives a semi-formal specification, but if there exists either in Erlang or in one of its spin off statically typed versions a formal specification as to how the system behaves with respects to hot code swapping I would appreciate being pointed in its direction. Regards, Austin -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick@REDACTED Fri Dec 12 21:04:16 2008 From: nick@REDACTED (Nick Gerakines) Date: Fri, 12 Dec 2008 12:04:16 -0800 Subject: [erlang-questions] SF Erlounge, January 15th at EA/Rupture Message-ID: Last week I announced that Rupture/EA is interested in hosting SF Erlounge in January. The response was good and I'd like to set the date to January 15th at 7:00 pm. This event is open to the public with drinks and light snacks provided. This is a great chance to meet other Erlang hackers and spectators and present your ideas. Rupture/EA is happy to host this until 8:00 pm where we will probably migrate to get drinks and dinner afterward. We are located at Harrison St & 2nd St, just a few blocks north of South Park, south of Market St. Our office is a comfortable 10 minute walk from the Caltrain station for anyone in the south-bay who would like to attend. 400 2nd Street, Suite 350 San Francisco, CA 94107 Please contact me if you have any questions or concerns. My mobile is +1 (415) 963-1165. # Nick Gerakines From vances@REDACTED Fri Dec 12 21:13:05 2008 From: vances@REDACTED (Vance Shipley) Date: Fri, 12 Dec 2008 15:13:05 -0500 Subject: [erlang-questions] Running rb with detached/remsh In-Reply-To: <57D708E9-86D4-43CB-9B65-CED6F88BB26E@appingo.com> References: <57D708E9-86D4-43CB-9B65-CED6F88BB26E@appingo.com> Message-ID: <20081212201305.GB262@h216-235-12-168.host.egate.net> Dan, I created a patch for that problem a number of years ago: http://www.erlang.org/pipermail/erlang-patches/2004-April/000099.html -Vance On Wed, Dec 10, 2008 at 06:46:34PM -0500, Dan Milstein wrote: } I'm starting up a long-running app with (stripping out a few options): } } > erl -boot start_sasl -detached -sname NODENAME } } And with configs to do rotating logs: } } {errlog_type, error}, } {error_logger_mf_dir,"log"}, } } I'd like to return to that machine, attach to the node, and read the } logs with rb(). I'm trying that via: } } > erl -sname test -remsh NODENAME@REDACTED } } And then running rb:start() / rb:list() from the erlang prompt. } } But no matter what I do, rb doesn't show any log activity (even though } I know there's plenty there, and can see it in the filesystem). } } Any ideas on what I'm doing wrong? (Or, any ideas on better ways to } start up long-running erlang apps and monitor their logs -- is the } above The Right Way?). } } -Dan Milstein From richardc@REDACTED Fri Dec 12 22:02:12 2008 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 12 Dec 2008 22:02:12 +0100 Subject: [erlang-questions] semantics hot code swapping in Erlang In-Reply-To: References: Message-ID: <4942D154.3040102@it.uu.se> Austin Anderson wrote: > I'm wanting to get into researching hot code swapping and was wondering > if there was a (formal) semantics for Erlang's behaviour with respects > to hot code swapping. I have read the Erlang 4.7.3 Reference Manual > which I found through the website, which gives a semi-formal > specification, but if there exists either in Erlang or in one of its > spin off statically typed versions a formal specification as to how the > system behaves with respects to hot code swapping I would appreciate > being pointed in its direction. No, I don't think anyone has written such a document. E.g., Lars-?ke Fredlund did not include the module system in the semantics in his thesis ("A Framework for Reasoning about Erlang Code", 2001). However, the rules are actually rather simple, and it should be straighforward for someone who knows his formal semantics to model the hot code swapping in a convincing way, given the informal specification you have already read. Basically: - A module has a name, some attributes (a map from atoms to terms), and some exported functions (a map from atom+arity pairs to funs); see also the Core Erlang specification for comparison. - There can be at most two loaded versions of a module: the current and the old version. - A remote call M:F(...), or a call to one of the variants of the apply and spawn BIFs, always uses the current module to map the module name to the actual function to be called. (In practice, the linker does most of the job at load time, so there is no lookup overhead at run time for M:F(...) calls.) - It is possible to find the set of processes that refer to the old version of a module, so that they can be forced to terminate before purging the old code (in preparation for loading yet another version). /Richard From anton.krasovsky@REDACTED Fri Dec 12 22:37:45 2008 From: anton.krasovsky@REDACTED (Anton Krasovsky) Date: Fri, 12 Dec 2008 21:37:45 +0000 Subject: [erlang-questions] Looking for XMPP client Message-ID: <46167e6a0812121337l46352921o8f5c47a20ab3d2a6@mail.gmail.com> Hi, I'm looking for Erlang XMPP client. I've found Jabberlang which seems to be unusable at the moment, and some code in tsung (though it's documentation says "jabber plugin does not parse XML"). Is there anything else I've missed? Regards, Anton Krasovsky From rvirding@REDACTED Sat Dec 13 00:19:40 2008 From: rvirding@REDACTED (Robert Virding) Date: Sat, 13 Dec 2008 00:19:40 +0100 Subject: [erlang-questions] Autogenerating node names In-Reply-To: <200812121144.mBCBioEG088053@pluto.hedeland.org> References: <95be1d3b0812120027g103f5682x3813e5a715a737af@mail.gmail.com> <200812121144.mBCBioEG088053@pluto.hedeland.org> Message-ID: <3dbc6d1c0812121519k619933c1x41c4cb9ce61b61ec@mail.gmail.com> 2008/12/12 Per Hedeland > Vlad Dumitrescu wrote: > >On Fri, Dec 12, 2008 at 09:24, Tony Rogvall wrote: > >>[tony@REDACTED src]$ grep epmd /etc/services > >>epmd 4369/tcp # Erlang Port Mapper Daemon > >>epmd 4369/udp # Erlang Port Mapper Daemon > >> > >>Cool. When did this happend? I guess it's been there for a while? > > > >Since about exactly 4 years ago. > > Right, see http://www.iana.org/assignments/port-numbers - though we > don't know how long it's been in /etc/services on your mac.:-) (Sadly > it's not there in a recent FreeBSD version, seems they don't add ports > above 1024 anymore.) It's not here in Ubuntu 8.10 either. :-( Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From raould@REDACTED Sat Dec 13 02:12:16 2008 From: raould@REDACTED (Raoul Duke) Date: Fri, 12 Dec 2008 17:12:16 -0800 Subject: [erlang-questions] newbie LFE question Message-ID: <91a2ba3e0812121712r6bdf8a79tc58b2bdf5caf1574@mail.gmail.com> hello, i'm seeking help understanding how to use lfe_comp in the shell. apologies for my cluelessness. when using the erl shell, it seems to let me redefine (replace) a function by recompiling the file. however, lfe_comp:file/1 doesn't seem to do that; the function is, as far as i can tell, retaining its old behaviour. (also, if i have test.lfe with foo/1 and test.erl with foo/1 then lfe_comp:file(test) won't result in foo/1 being from test.lfe, but will still be from test.erl.) thanks for any insights. sincerely. From rvirding@REDACTED Sat Dec 13 05:41:41 2008 From: rvirding@REDACTED (Robert Virding) Date: Sat, 13 Dec 2008 05:41:41 +0100 Subject: [erlang-questions] newbie LFE question In-Reply-To: <91a2ba3e0812121712r6bdf8a79tc58b2bdf5caf1574@mail.gmail.com> References: <91a2ba3e0812121712r6bdf8a79tc58b2bdf5caf1574@mail.gmail.com> Message-ID: <3dbc6d1c0812122041m3db95d49rad9165ed3d904077@mail.gmail.com> When you compile a file in the shell you are actually doing two separate operations: compile the source file to a beam file, and then load the beam file into the system. The erlang shell built-in function c(ModName) does these operations using the vanilla erlang compiler. There is no such special support in the erlang shell for LFE. This means that you have to explicitly do the two separate steps. First compile the LFE file using lfe_comp:file/1 and then load in the beam file using the shell built-in function l(ModName). So for test.lfe you would do: 21> lfe_comp:file("test.lfe"). {ok,test} 22> l(test). {module,test} The lfe compiler understands if you give the file without the .lfe extension so you can write lfe_comp:file(test). In the LFE shell the builtin shell function (c 'test) compiles and loads an LFE file. To compile vanilla erlang files there is the builtin shell function (ec 'test). Please let me know how you get on with LFE. Robert 2008/12/13 Raoul Duke > hello, > > i'm seeking help understanding how to use lfe_comp in the shell. > apologies for my cluelessness. when using the erl shell, it seems to > let me redefine (replace) a function by recompiling the file. however, > lfe_comp:file/1 doesn't seem to do that; the function is, as far as i > can tell, retaining its old behaviour. (also, if i have test.lfe with > foo/1 and test.erl with foo/1 then lfe_comp:file(test) won't result in > foo/1 being from test.lfe, but will still be from test.erl.) > > thanks for any insights. > sincerely. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From me@REDACTED Sat Dec 13 08:56:50 2008 From: me@REDACTED (Essien Ita Essien) Date: Sat, 13 Dec 2008 08:56:50 +0100 Subject: [erlang-questions] Asynchrous Ssl Listen/Accept In-Reply-To: <4941D8FB.7090800@essienitaessien.com> References: <4941D8FB.7090800@essienitaessien.com> Message-ID: <49436AC2.2020408@essienitaessien.com> I've continued *staring* at code and also trying to achieve asynchronous recv as well, and the following are what I've found. I want to sort of just run my finding through list and pick up the collective wisdom. (all code from ssl-3.9) First asynchronous recv. The main clause for ssl_prim:recv is defined as: ssl_prim:recv(St, Length, Timeout) when record(St, st), St#st.status =:= open -> inet_tcp:recv(St#st.proxysock, Length, Timeout) Can I then safely assume that after all the ssl handshake is done, I can call the St#st.proxysock directly to get decrypted data? Also, I notice that only inet_ssl_dist consumes ssl_prim. Anything I should be wary of there? (And ssl_prim still uses the broker for some things, transport_accept and ssl_accept for example). On the async accept side of things, I traced and finally found out that the PORT actually sends us async notifications of the form: {Port, {data, Binary}} And ssl_server pulls out the opcode (i'm guessing SSL Protocol OpCode) from the Binary and does a case based action depending on the opcode. I'm guessing that right now then, the current implementation doesn't have any way for me to intercept the various operations then. If maybe instead of the case, ssl_server had notified another layer, then maybe I could conceivable intercept it *cleanly*. Any clarifications, any additional thoughts? For my application, I'm beginning to think I should create my own async layer atop the exposed ssl layer, using a spawned process to do blocking accept and recv and notifying my main process asynchronously. Why I initially wanted to hook into the under-belly, was to prevent myself from adding yet *another* abstraction layer onto what's already existing, which could potentially affect performance, not to mention add needless code if the functionality I want already exists. cheers, Essien Essien Ita Essien wrote: > Hi all, > > I'm investigating the possibility of having asynchronous ssl accept'ing > in an application. (Prefarably using new_ssl, though if old is what I > need, then I have no prolems using it) > > Basically, something akin to the prim_inet:async_accept/1 trick for tcp > listeners. > > I'm a few months old in erlang, so trying to peruse the ssl source code > gave me more than a few bouts of migrane, and I'm not helped by not > groking the ssl protocol flow really. > > Is there any where I should look to find this, maybe a pointer in the > right direction. What's throwing me off, is I can't seem to find the > division b/w the new_ssl and the old ssl implementation. I have traced > as far as ssl_connection:accept, but from there, i get very lost, very fast. > > Any help, much appreciated. > > cheers, > Essien > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From per@REDACTED Sat Dec 13 11:17:50 2008 From: per@REDACTED (Per Hedeland) Date: Sat, 13 Dec 2008 11:17:50 +0100 (CET) Subject: [erlang-questions] Autogenerating node names In-Reply-To: <3dbc6d1c0812121519k619933c1x41c4cb9ce61b61ec@mail.gmail.com> Message-ID: <200812131017.mBDAHo0R017949@pluto.hedeland.org> "Robert Virding" wrote: > >2008/12/12 Per Hedeland > >> Vlad Dumitrescu wrote: >> >On Fri, Dec 12, 2008 at 09:24, Tony Rogvall wrote: >> >>[tony@REDACTED src]$ grep epmd /etc/services >> >>epmd 4369/tcp # Erlang Port Mapper Daemon >> >>epmd 4369/udp # Erlang Port Mapper Daemon >> >> >> >>Cool. When did this happend? I guess it's been there for a while? >> > >> >Since about exactly 4 years ago. >> >> Right, see http://www.iana.org/assignments/port-numbers - though we >> don't know how long it's been in /etc/services on your mac.:-) (Sadly >> it's not there in a recent FreeBSD version, seems they don't add ports >> above 1024 anymore.) > > >It's not here in Ubuntu 8.10 either. :-( FWIW, my successful grep was on a FC 5 system, i.e. almost 3 years old: $ ls -l /etc/services -rw-r--r-- 1 root root 362031 Feb 23 2006 /etc/services Yeah I know, "Linux is just the kernel" and Ubuntu and Fedora are two *completely* different OSes...:-) --Per From sean@REDACTED Sat Dec 13 16:44:22 2008 From: sean@REDACTED (Sean Rasmussen) Date: Sat, 13 Dec 2008 10:44:22 -0500 Subject: [erlang-questions] gen_tcp and gen_server In-Reply-To: <915e7e1d0812041205t64e7657k523ce38fd53caa21@mail.gmail.com> References: <915e7e1d0812041205t64e7657k523ce38fd53caa21@mail.gmail.com> Message-ID: Agreed: in fact I used that example as one of the resources for building my own (modest) web app server. I had built it as part of teaching myself Erlang; I also wanted it to be a good resource for beginners like myself, so I tried to make the code especially clear. Maybe it will be of some use to you, Jarrod: http://code.google.com/p/pranayama/ Besides that, the Armstrong chapter is especially good. Regards, Sean On 4-Dec-08, at 3:05 PM, Alex wrote: > check out http://www.trapexit.org/Building_a_Non- > blocking_TCP_server_using_OTP_principles > > its a very good intro on how to setup a tcp server inside of a OTP > supervisor tree. > > 2008/12/4 Jarrod Roberson > How can I put a TCP interface on top of gen_server code that I have > written. > I am just finally getting my head around OTP, but I need to have a > TCP interface on my server. > I have searched Google and haven't really found anything useful. > Thanks in advance. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From klacke@REDACTED Sat Dec 13 18:22:17 2008 From: klacke@REDACTED (=?ISO-8859-1?Q?Claes_Wikstr=F6m?=) Date: Sat, 13 Dec 2008 18:22:17 +0100 Subject: [erlang-questions] Asynchrous Ssl Listen/Accept In-Reply-To: <4941D8FB.7090800@essienitaessien.com> References: <4941D8FB.7090800@essienitaessien.com> Message-ID: <4943EF49.5030201@hyber.org> Essien Ita Essien wrote: > Hi all, > > I'm investigating the possibility of having asynchronous ssl accept'ing > in an application. (Prefarably using new_ssl, though if old is what I > need, then I have no prolems using it) Use a new process for each call to accept() - that way you can get all the asynchronicity you want. /klacke From me@REDACTED Sat Dec 13 19:38:18 2008 From: me@REDACTED (Essien Ita Essien) Date: Sat, 13 Dec 2008 19:38:18 +0100 Subject: [erlang-questions] Asynchrous Ssl Listen/Accept In-Reply-To: <49436AC2.2020408@essienitaessien.com> References: <4941D8FB.7090800@essienitaessien.com> <49436AC2.2020408@essienitaessien.com> Message-ID: <4944011A.1060700@essienitaessien.com> Essien Ita Essien wrote: > I've continued *staring* at code and also trying to achieve asynchronous > recv as well, and the following are what I've found. I want to sort of > just run my finding through list and pick up the collective wisdom. > > (all code from ssl-3.9) > > First asynchronous recv. > > The main clause for ssl_prim:recv is defined as: > > ssl_prim:recv(St, Length, Timeout) when record(St, st), St#st.status =:= > open -> > inet_tcp:recv(St#st.proxysock, Length, Timeout) > > Can I then safely assume that after all the ssl handshake is done, I can > call the St#st.proxysock directly to get decrypted data? > > Also, I notice that only inet_ssl_dist consumes ssl_prim. Anything I > should be wary of there? (And ssl_prim still uses the broker for some > things, transport_accept and ssl_accept for example). > > On the async accept side of things, I traced and finally found out that > the PORT actually sends us async notifications of the form: > > {Port, {data, Binary}} > > And ssl_server pulls out the opcode (i'm guessing SSL Protocol OpCode) > from the Binary and does a case based action depending on the opcode. > > I'm guessing that right now then, the current implementation doesn't > have any way for me to intercept the various operations then. If maybe > instead of the case, ssl_server had notified another layer, then maybe I > could conceivable intercept it *cleanly*. > > Any clarifications, any additional thoughts? > > For my application, I'm beginning to think I should create my own async > layer atop the exposed ssl layer, using a spawned process to do blocking > accept and recv and notifying my main process asynchronously. > > Why I initially wanted to hook into the under-belly, was to prevent > myself from adding yet *another* abstraction layer onto what's already > existing, which could potentially affect performance, not to mention add > needless code if the functionality I want already exists. > > cheers, > Essien > > > Essien Ita Essien wrote: >> Hi all, >> >> I'm investigating the possibility of having asynchronous ssl accept'ing >> in an application. (Prefarably using new_ssl, though if old is what I >> need, then I have no prolems using it) >> >> Basically, something akin to the prim_inet:async_accept/1 trick for tcp >> listeners. >> >> I'm a few months old in erlang, so trying to peruse the ssl source code >> gave me more than a few bouts of migrane, and I'm not helped by not >> groking the ssl protocol flow really. >> >> Is there any where I should look to find this, maybe a pointer in the >> right direction. What's throwing me off, is I can't seem to find the >> division b/w the new_ssl and the old ssl implementation. I have traced >> as far as ssl_connection:accept, but from there, i get very lost, very fast. >> >> Any help, much appreciated. >> >> cheers, >> Essien I've made lots or progress after experimenting lots. I can now do full asynchronous accept using new_ssl implementation, and upgrading the connection on both sides. First, I follow a recipe similar to: http://www.trapexit.org/Building_a_Non-blocking_TCP_server_using_OTP_principles And when i recieve: {inet_async, ListenSock, Ref, {ok, ClientSock}, I proceed to upgrade ClientSock like: ssl:ssl_accept(ClientSock, [{verify, 0}, {cacertfile, "/path/to/cacert.pem"}, {certfile, "/path/to/cert.pem"}, {keyfile, "/path/to/key.pem"}). This works allright for async ssl accept. My intial test with prim_inet:async_recv on the original ClientSock, after upgrading the connection gives me data which i assume to be the ssl protocol envelope, i'm still playing around hoping for success on async recv as well. When all is done, I'll post some code incase someone else wants to do this. cheers, Essien >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From mighty.fine@REDACTED Sun Dec 14 11:50:35 2008 From: mighty.fine@REDACTED (mighty) Date: Sun, 14 Dec 2008 02:50:35 -0800 Subject: [erlang-questions] start_child() on simple_one_for_one supervisor -> {error, {already_started, ...}} ??? Message-ID: I have a basic simple_one_for_one supervisor that I cannot start multiple children from -- the first call to start_child() works, the second call to start_child() returns {error,{already_started,<0.38.0>}}. My supervisor is simple_one_for_one, so I'd expect to hit the ?is_simple() handling of start_child in supervisor.erl, which should go through supervisor:do_start_child_i() without any fuss, and definitely not return {error, {already_started, ...}} out of supervisor:handle_start_child(). TIA for helping me figure out what I'm messing up and keeping the rest of the hair on my head! ############################################################################ Console output: Erlang (BEAM) emulator version 5.6.5 [source] [smp:2] [async-threads:0] [kernel-poll:false] Eshell V5.6.5 (abort with ^G) 1> application:start(my). =INFO REPORT==== 14-Dec-2008::02:29:03 === [my_app,start,normal,[]] =INFO REPORT==== 14-Dec-2008::02:29:03 === [my_sup,start_link] ok 2> my_node:start(99). =INFO REPORT==== 14-Dec-2008::02:29:13 === [my_node,start_link,99,<0.36.0>] {ok,<0.38.0>} 3> my_node:start(11). =INFO REPORT==== 14-Dec-2008::02:29:20 === [my_node,start_link,11,<0.36.0>] {error,{already_started,<0.38.0>}} 4> ############################################################################ my.app: {application, my, [{description, "My Stuff"}, {vsn, "0.1"}, {modules, [my_app, my_sup, my_node]}, {registered, []}, {mod, {my_app, []}}, {applications, [kernel, stdlib]}]}. ############################################################################ my_app.erl: -module(my_app). -behaviour(application). -export([start/2, stop/1]). start(_Type, _StartArgs) -> error_logger:info_report([[my_app, start, _Type, _StartArgs]]), my_sup:start_link(). stop(_State) -> error_logger:info_report([[my_app, stop, _State]]), ok. ############################################################################ my_sup.erl: -module(my_sup). -behaviour(supervisor). -export([start_link/0, init/1]). start_link() -> error_logger:info_report([[my_sup, start_link]]), supervisor:start_link({local, ?MODULE}, ?MODULE, []). init([]) -> Node = {my_node, {my_node, start_link, []}, permanent, brutal_kill, worker, [my_node]}, {ok, {{simple_one_for_one, 10, 1}, [Node]}}. ############################################################################ my_node.erl -module(my_node). -behaviour(gen_server). -export([start/1, start_link/1]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). -record(state, {}). start(Instance) -> supervisor:start_child(my_sup, [Instance]). start_link(Instance) -> error_logger:info_report([[my_node, start_link, Instance, self()]]), gen_server:start_link({local, ?MODULE}, ?MODULE, [], []). init([]) -> {ok, #state{}}. handle_call(_Request, _From, State) -> Reply = ok, {reply, Reply, State}. handle_cast(_Msg, State) -> {noreply, State}. handle_info(_Info, State) -> {noreply, State}. terminate(_Reason, _State) -> ok. code_change(_OldVsn, State, _Extra) -> {ok, State}. From nc@REDACTED Sun Dec 14 12:19:29 2008 From: nc@REDACTED (Nicolas Charpentier) Date: Sun, 14 Dec 2008 12:19:29 +0100 Subject: [erlang-questions] start_child() on simple_one_for_one supervisor -> {error, {already_started, ...}} ??? In-Reply-To: References: Message-ID: <4944EBC1.2080600@charpi.net> Hi, mighty wrote: > I have a basic simple_one_for_one supervisor that I cannot start > multiple children from -- the first call to start_child() works, the > second call to start_child() returns > {error,{already_started,<0.38.0>}}. My supervisor is > simple_one_for_one, so I'd expect to hit the ?is_simple() handling of > start_child in supervisor.erl, which should go through > supervisor:do_start_child_i() without any fuss, and definitely not > return {error, {already_started, ...}} out of > supervisor:handle_start_child(). > In your case {error, {already_started, _}} is returned by gen_server:start_link/4 (and then returned by supervisor:start_child/2. gen_server:start_link/4 returns an error because you are trying to register 2 processes with the same name (my_node). Replace the function my_node:start_link/1 with: start_link(Instance) when is_integer(Instance)-> error_logger:info_report([[my_node,start_link,Instance,self()]]), Name = atom_to_list(?MODULE) ++ "_" ++ integer_to_list(Instance), gen_server:start_link({local, list_to_atom(Name)},?MODULE,[],[]). Regards, ---- Nicolas Charpentier http://charpi.net From erlang@REDACTED Sun Dec 14 12:25:14 2008 From: erlang@REDACTED (Dominic Williams) Date: Sun, 14 Dec 2008 12:25:14 +0100 Subject: [erlang-questions] start_child() on simple_one_for_one supervisor -> {error, {already_started, ...}} ??? In-Reply-To: References: Message-ID: <4944ED1A.9010308@dominicwilliams.net> Hi mighty, mighty a ?crit : > I have a basic simple_one_for_one supervisor that I cannot start > multiple children from -- the first call to start_child() works, the > second call to start_child() returns > {error,{already_started,<0.38.0>}}. My supervisor is > simple_one_for_one, so I'd expect to hit the ?is_simple() handling of > start_child in supervisor.erl, which should go through > supervisor:do_start_child_i() without any fuss, and definitely not > return {error, {already_started, ...}} out of > supervisor:handle_start_child(). > [snipped...] The problem is that you use the same name to register each gen_server. Doing this in your my_node.erl works: start_link(Instance) -> % ... Instance_s = integer_to_list(Instance), Name_s = ?MODULE_STRING ++ Instance_s, Name = list_to_atom (Name_s), gen_server:start_link({local, Name}, ?MODULE, [], []). Regards, Dominic Williams http://dominicwilliams.net From mark.fine@REDACTED Sun Dec 14 12:53:12 2008 From: mark.fine@REDACTED (Mark Fine) Date: Sun, 14 Dec 2008 03:53:12 -0800 Subject: [erlang-questions] start_child() on simple_one_for_one supervisor -> {error, {already_started, ...}} ??? In-Reply-To: <4944EBC1.2080600@charpi.net> References: <4944EBC1.2080600@charpi.net> Message-ID: Thanks Nicolas and Dominic! On Sun, Dec 14, 2008 at 3:19 AM, Nicolas Charpentier wrote: > Hi, > > mighty wrote: >> I have a basic simple_one_for_one supervisor that I cannot start >> multiple children from -- the first call to start_child() works, the >> second call to start_child() returns >> {error,{already_started,<0.38.0>}}. My supervisor is >> simple_one_for_one, so I'd expect to hit the ?is_simple() handling of >> start_child in supervisor.erl, which should go through >> supervisor:do_start_child_i() without any fuss, and definitely not >> return {error, {already_started, ...}} out of >> supervisor:handle_start_child(). >> > > In your case {error, {already_started, _}} is returned by > gen_server:start_link/4 (and then returned by supervisor:start_child/2. > > gen_server:start_link/4 returns an error because you are trying to > register 2 processes with the same name (my_node). > Replace the function my_node:start_link/1 with: > > start_link(Instance) when is_integer(Instance)-> > error_logger:info_report([[my_node,start_link,Instance,self()]]), > Name = atom_to_list(?MODULE) ++ "_" ++ integer_to_list(Instance), > gen_server:start_link({local, list_to_atom(Name)},?MODULE,[],[]). > > > > Regards, > > ---- > Nicolas Charpentier > http://charpi.net > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From ama08r@REDACTED Sun Dec 14 15:36:19 2008 From: ama08r@REDACTED (Austin Anderson) Date: Sun, 14 Dec 2008 14:36:19 +0000 Subject: [erlang-questions] semantics hot code swapping in Erlang In-Reply-To: <4942D154.3040102@it.uu.se> References: <4942D154.3040102@it.uu.se> Message-ID: *"It is possible to find the set of processes that refer to the old version of a module, so that they can be forced to terminate before purging the old code"* Does the system automatically terminate processes using the old version if that old version is removed? Or does it have to be done 'manually' by the programmer? 2008/12/12 Richard Carlsson > Austin Anderson wrote: > >> I'm wanting to get into researching hot code swapping and was wondering if >> there was a (formal) semantics for Erlang's behaviour with respects to hot >> code swapping. I have read the Erlang 4.7.3 Reference Manual which I found >> through the website, which gives a semi-formal specification, but if there >> exists either in Erlang or in one of its spin off statically typed versions >> a formal specification as to how the system behaves with respects to hot >> code swapping I would appreciate being pointed in its direction. >> > > No, I don't think anyone has written such a document. E.g., Lars-?ke > Fredlund did not include the module system in the semantics in his > thesis ("A Framework for Reasoning about Erlang Code", 2001). > > However, the rules are actually rather simple, and it should be > straighforward for someone who knows his formal semantics to model > the hot code swapping in a convincing way, given the informal > specification you have already read. > > Basically: > > - A module has a name, some attributes (a map from atoms to terms), > and some exported functions (a map from atom+arity pairs to funs); > see also the Core Erlang specification for comparison. > > - There can be at most two loaded versions of a module: the current > and the old version. > > - A remote call M:F(...), or a call to one of the variants of the > apply and spawn BIFs, always uses the current module to map the > module name to the actual function to be called. (In practice, > the linker does most of the job at load time, so there is no > lookup overhead at run time for M:F(...) calls.) > > - It is possible to find the set of processes that refer to the > old version of a module, so that they can be forced to terminate > before purging the old code (in preparation for loading yet another > version). > > /Richard > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gleber.p@REDACTED Sun Dec 14 16:07:48 2008 From: gleber.p@REDACTED (Gleb Peregud) Date: Sun, 14 Dec 2008 16:07:48 +0100 Subject: [erlang-questions] semantics hot code swapping in Erlang In-Reply-To: References: <4942D154.3040102@it.uu.se> Message-ID: <14f0e3620812140707u27fa566ch57f2e9bc48d5a90c@mail.gmail.com> Yes, system automatically kills all the processes using the old version of code when it is removed from the system On 12/14/08, Austin Anderson wrote: > *"It is possible to find the set of processes that refer to the old version > of a module, so that they can be forced to terminate before purging the old > code"* > Does the system automatically terminate processes using the old version if > that old version is removed? Or does it have to be done 'manually' by the > programmer? > > 2008/12/12 Richard Carlsson > >> Austin Anderson wrote: >> >>> I'm wanting to get into researching hot code swapping and was wondering >>> if >>> there was a (formal) semantics for Erlang's behaviour with respects to >>> hot >>> code swapping. I have read the Erlang 4.7.3 Reference Manual which I >>> found >>> through the website, which gives a semi-formal specification, but if >>> there >>> exists either in Erlang or in one of its spin off statically typed >>> versions >>> a formal specification as to how the system behaves with respects to hot >>> code swapping I would appreciate being pointed in its direction. >>> >> >> No, I don't think anyone has written such a document. E.g., Lars-?ke >> Fredlund did not include the module system in the semantics in his >> thesis ("A Framework for Reasoning about Erlang Code", 2001). >> >> However, the rules are actually rather simple, and it should be >> straighforward for someone who knows his formal semantics to model >> the hot code swapping in a convincing way, given the informal >> specification you have already read. >> >> Basically: >> >> - A module has a name, some attributes (a map from atoms to terms), >> and some exported functions (a map from atom+arity pairs to funs); >> see also the Core Erlang specification for comparison. >> >> - There can be at most two loaded versions of a module: the current >> and the old version. >> >> - A remote call M:F(...), or a call to one of the variants of the >> apply and spawn BIFs, always uses the current module to map the >> module name to the actual function to be called. (In practice, >> the linker does most of the job at load time, so there is no >> lookup overhead at run time for M:F(...) calls.) >> >> - It is possible to find the set of processes that refer to the >> old version of a module, so that they can be forced to terminate >> before purging the old code (in preparation for loading yet another >> version). >> >> /Richard >> > -- Gleb Peregud http://gleber.pl/ Every minute is to be grasped. Time waits for nobody. -- Inscription on a Zen Gong From ad.sergey@REDACTED Sun Dec 14 21:41:39 2008 From: ad.sergey@REDACTED (Sergey S) Date: Sun, 14 Dec 2008 12:41:39 -0800 Subject: [erlang-questions] Running rb with detached/remsh Message-ID: > I created a patch for that problem a number of years ago: I'm wondering why so useful patch isn't in main development branch yet... It will be very nice if we could use just another erl shell to see logs of working system without copying logs to another machine or smth like that. -------------- next part -------------- An HTML attachment was scrubbed... URL: From raould@REDACTED Sun Dec 14 22:23:51 2008 From: raould@REDACTED (Raoul Duke) Date: Sun, 14 Dec 2008 13:23:51 -0800 Subject: [erlang-questions] newbie LFE question In-Reply-To: <3dbc6d1c0812122041m3db95d49rad9165ed3d904077@mail.gmail.com> References: <91a2ba3e0812121712r6bdf8a79tc58b2bdf5caf1574@mail.gmail.com> <3dbc6d1c0812122041m3db95d49rad9165ed3d904077@mail.gmail.com> Message-ID: <91a2ba3e0812141323n3e6fb218rcd0adf99a49de599@mail.gmail.com> > compile the LFE file using lfe_comp:file/1 and then load in the beam file capice, thank you. > In the LFE shell the builtin shell function (c 'test) compiles and loads an > LFE file. To compile vanilla erlang files there is the builtin shell > function (ec 'test). ja, i was looking forward to getting to try the lfe shell next thing :) sincerely. From david.koch@REDACTED Sun Dec 14 20:29:47 2008 From: david.koch@REDACTED (David KOCH) Date: Sun, 14 Dec 2008 20:29:47 +0100 Subject: [erlang-questions] REF: native pointer size query (URGENT) Message-ID: I'm looking forward a way to know, erlang side, the size and type of a pointer. Understand if running on a 32 bits big endian machine, have a macro that gives me the correct size of the pointer : -ifdef(32BITS). -define(_PTR, 32/unsigned-native). -else. -define(_PTR, 64/unsigned-native). -endif. http://www.erlang.org/documentation/doc-5.6/doc/programming_examples/bit_syntax.html The endianness can be set to 'native', resolved at load time, but I also need to know the size of the data. Thanks... -- KOCH David - http://www.kochise.com/ From cooldaemon@REDACTED Mon Dec 15 02:49:25 2008 From: cooldaemon@REDACTED (masahito ikuta) Date: Mon, 15 Dec 2008 10:49:25 +0900 Subject: [erlang-questions] gen_tcp and gen_server In-Reply-To: References: <915e7e1d0812041205t64e7657k523ce38fd53caa21@mail.gmail.com> Message-ID: > I am just finally getting my head around OTP, but I need to have a TCP interface on my server. I recommend you the "kai_tcp_server". It has the following features: - Makes it easy to implement concurrent TCP servers, - Provides typical TCP server behaviours, listen, accept, and so forth, - Handles multiple requests concurrently by maintaining process pool, - Supports active as well as passive mode of gen_tcp, - Based on OTP principles. A few explanations of it are in the following link. http://d.hatena.ne.jp/cooldaemon/20081205/1228451785 Sincerely, Masahito Ikuta 2008/12/14 Sean Rasmussen : > > Agreed: in fact I used that example as one of the resources for building my > own (modest) web app server. > I had built it as part of teaching myself Erlang; I also wanted it to be a > good resource > for beginners like myself, so I tried to make the code especially clear. > Maybe it will be of some use to you, Jarrod: > http://code.google.com/p/pranayama/ > Besides that, the Armstrong chapter is especially good. > Regards, > Sean > On 4-Dec-08, at 3:05 PM, Alex wrote: > > check out > http://www.trapexit.org/Building_a_Non-blocking_TCP_server_using_OTP_principles > > its a very good intro on how to setup a tcp server inside of a OTP > supervisor tree. > > 2008/12/4 Jarrod Roberson >> >> How can I put a TCP interface on top of gen_server code that I have >> written. >> I am just finally getting my head around OTP, but I need to have a TCP >> interface on my server. >> I have searched Google and haven't really found anything useful. >> Thanks in advance. >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From kenneth.lundin@REDACTED Mon Dec 15 09:09:24 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Mon, 15 Dec 2008 09:09:24 +0100 Subject: [erlang-questions] REF: native pointer size query (URGENT) In-Reply-To: References: Message-ID: You can call erlang:system_info(wordsize) which gives you the wordsize in bytes. The wordsize is the same as the pointer size. /Kenneth Erlang/OTP Ericsson On Sun, Dec 14, 2008 at 8:29 PM, David KOCH wrote: > I'm looking forward a way to know, erlang side, > the size and type of a pointer. Understand if > running on a 32 bits big endian machine, have > a macro that gives me the correct size of the > pointer : > > -ifdef(32BITS). > -define(_PTR, 32/unsigned-native). > -else. > -define(_PTR, 64/unsigned-native). > -endif. > > http://www.erlang.org/documentation/doc-5.6/doc/programming_examples/bit_syntax.html > > The endianness can be set to 'native', resolved > at load time, but I also need to know the size > of the data. > > Thanks... > > -- > KOCH David - http://www.kochise.com/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From kirk.bateman@REDACTED Mon Dec 15 10:50:54 2008 From: kirk.bateman@REDACTED (Kirk Bateman) Date: Mon, 15 Dec 2008 09:50:54 +0000 Subject: [erlang-questions] Looking for XMPP client Message-ID: <2bee4fc40812150150n5679ab39s82ecf7aea2231b04@mail.gmail.com> Anton, The Jabberlang stuff is actually usable, it needs a few modifications but nothing major, I think it was just to do with the connect stuff. I knocked up a quick bot using it some time ago and that worked fine, I would post my mods, but I seem to have lost them (sorry). But it really didn't take long to get it working (a matter of hours rather than days). Cheers Kirk Bateman > ---------- Forwarded message ---------- > From: "Anton Krasovsky" > To: erlang-questions > Date: Fri, 12 Dec 2008 21:37:45 +0000 > Subject: [erlang-questions] Looking for XMPP client > Hi, > > I'm looking for Erlang XMPP client. > > I've found Jabberlang which seems to be unusable at the moment, and > some code in tsung (though it's documentation says "jabber plugin does > not parse XML"). > > Is there anything else I've missed? > > Regards, > Anton Krasovsky > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xbmodder@REDACTED Mon Dec 15 10:58:00 2008 From: xbmodder@REDACTED (Sargun Dhillon) Date: Mon, 15 Dec 2008 01:58:00 -0800 Subject: [erlang-questions] Looking for XMPP client In-Reply-To: <2bee4fc40812150150n5679ab39s82ecf7aea2231b04@mail.gmail.com> References: <2bee4fc40812150150n5679ab39s82ecf7aea2231b04@mail.gmail.com> Message-ID: <7c9d57ea0812150158w1645a428q3b2ce3650d20b15e@mail.gmail.com> Jabberlang actually works! Link: http://ciarang.com/posts/adventures-in-jabberlang 2008/12/15 Kirk Bateman : > Anton, > > The Jabberlang stuff is actually usable, it needs a few modifications but > nothing major, I think it was just to do with the connect stuff. > > I knocked up a quick bot using it some time ago and that worked fine, I > would post my mods, but I seem to have lost them (sorry). But it really > didn't take long to get it working (a matter of hours rather than days). > > Cheers > > Kirk Bateman > >> >> ---------- Forwarded message ---------- >> From: "Anton Krasovsky" >> To: erlang-questions >> Date: Fri, 12 Dec 2008 21:37:45 +0000 >> Subject: [erlang-questions] Looking for XMPP client >> Hi, >> >> I'm looking for Erlang XMPP client. >> >> I've found Jabberlang which seems to be unusable at the moment, and >> some code in tsung (though it's documentation says "jabber plugin does >> not parse XML"). >> >> Is there anything else I've missed? >> >> Regards, >> Anton Krasovsky >> >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From kirk.bateman@REDACTED Mon Dec 15 11:10:14 2008 From: kirk.bateman@REDACTED (Kirk Bateman) Date: Mon, 15 Dec 2008 10:10:14 +0000 Subject: [erlang-questions] Looking for XMPP client In-Reply-To: <7c9d57ea0812150158w1645a428q3b2ce3650d20b15e@mail.gmail.com> References: <2bee4fc40812150150n5679ab39s82ecf7aea2231b04@mail.gmail.com> <7c9d57ea0812150158w1645a428q3b2ce3650d20b15e@mail.gmail.com> Message-ID: <2bee4fc40812150210y61389b6eq193af087cde1d3ee@mail.gmail.com> Sargun, I think I used that when I was looking at Jabberlang. If I remember correctly the only real issue I had was to do with getting my Jabberlang bot to connect to gmail chat servers, which was probably what I had to mess about with it for (but it didn't take long). Cheers Kirk 2008/12/15 Sargun Dhillon > Jabberlang actually works! Link: > http://ciarang.com/posts/adventures-in-jabberlang > > 2008/12/15 Kirk Bateman : > > Anton, > > > > The Jabberlang stuff is actually usable, it needs a few modifications but > > nothing major, I think it was just to do with the connect stuff. > > > > I knocked up a quick bot using it some time ago and that worked fine, I > > would post my mods, but I seem to have lost them (sorry). But it really > > didn't take long to get it working (a matter of hours rather than days). > > > > Cheers > > > > Kirk Bateman > > > >> > >> ---------- Forwarded message ---------- > >> From: "Anton Krasovsky" > >> To: erlang-questions > >> Date: Fri, 12 Dec 2008 21:37:45 +0000 > >> Subject: [erlang-questions] Looking for XMPP client > >> Hi, > >> > >> I'm looking for Erlang XMPP client. > >> > >> I've found Jabberlang which seems to be unusable at the moment, and > >> some code in tsung (though it's documentation says "jabber plugin does > >> not parse XML"). > >> > >> Is there anything else I've missed? > >> > >> Regards, > >> Anton Krasovsky > >> > >> > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anton.krasovsky@REDACTED Mon Dec 15 12:09:50 2008 From: anton.krasovsky@REDACTED (Anton Krasovsky) Date: Mon, 15 Dec 2008 11:09:50 +0000 Subject: [erlang-questions] Looking for XMPP client In-Reply-To: <2bee4fc40812150150n5679ab39s82ecf7aea2231b04@mail.gmail.com> References: <2bee4fc40812150150n5679ab39s82ecf7aea2231b04@mail.gmail.com> Message-ID: <46167e6a0812150309y298b7b7bxd60c25a30fcd4619@mail.gmail.com> Thanks guys! It looks like Jabberlang might have worked after all. But for now I've built a simple ejabberd component, and considering this post: http://metajack.wordpress.com/2008/08/04/thoughts-on-scalable-xmpp-bots/ I think I'm going to keep it this way. Regards, Anton 2008/12/15 Kirk Bateman : > Anton, > > The Jabberlang stuff is actually usable, it needs a few modifications but > nothing major, I think it was just to do with the connect stuff. [...] From kirk.bateman@REDACTED Mon Dec 15 12:20:52 2008 From: kirk.bateman@REDACTED (Kirk Bateman) Date: Mon, 15 Dec 2008 11:20:52 +0000 Subject: [erlang-questions] Looking for XMPP client In-Reply-To: <46167e6a0812150309y298b7b7bxd60c25a30fcd4619@mail.gmail.com> References: <2bee4fc40812150150n5679ab39s82ecf7aea2231b04@mail.gmail.com> <46167e6a0812150309y298b7b7bxd60c25a30fcd4619@mail.gmail.com> Message-ID: <2bee4fc40812150320l32afc547v30760ceeb2af16ed@mail.gmail.com> Exactly the same decisions I took :) Components are shockingly easy to write, so thats what I ended up with. It seems you can also benefit from the automatic round robin component stuff for scalability, although I've not really looked into that yet. Cheers Kirk 2008/12/15 Anton Krasovsky > Thanks guys! It looks like Jabberlang might have worked after all. > But for now I've built a simple ejabberd component, and considering this > post: > > http://metajack.wordpress.com/2008/08/04/thoughts-on-scalable-xmpp-bots/ > > I think I'm going to keep it this way. > > Regards, > Anton > > 2008/12/15 Kirk Bateman : > > Anton, > > > > The Jabberlang stuff is actually usable, it needs a few modifications but > > nothing major, I think it was just to do with the connect stuff. > [...] > -------------- next part -------------- An HTML attachment was scrubbed... URL: From icfp.publicity@REDACTED Mon Dec 15 18:51:50 2008 From: icfp.publicity@REDACTED (Matthew Fluet (ICFP Publicity Chair)) Date: Mon, 15 Dec 2008 11:51:50 -0600 Subject: [erlang-questions] ICFP09 Call for Papers Message-ID: <53ff55480812150951t38b92e2byaff33d05eb9ea312@mail.gmail.com> Call for Papers ICFP 2009: International Conference on Functional Programming Edinburgh, Scotland, 31 August - 2 September 2009 http://www.cs.nott.ac.uk/~gmh/icfp09.html ** Submission deadline: 2 March 2009 ** (submission deadline is earlier than usual) ICFP 2009 seeks original papers on the art and science of functional programming. Submissions are invited on all topics from principles to practice, from foundations to features, from abstraction to application. The scope includes all languages that encourage functional programming, including both purely applicative and imperative languages, as well as languages with objects or concurrency. Particular topics of interest include * Language Design: type systems; concurrency and distribution; modules; components and composition; metaprogramming; relations to object-oriented or logic programming; interoperability * Implementation: abstract machines; compilation; compile-time and run-time optimization; memory management; multi-threading; exploiting parallel hardware; interfaces to foreign functions, services, components or low-level machine resources * Software-Development Techniques: algorithms and data structures; design patterns; specification; verification; validation; proof assistants; debugging; testing; tracing; profiling * Foundations: formal semantics; lambda calculus; rewriting; type theory; monads; continuations; control; state; effects * Transformation and Analysis: abstract interpretation; partial evaluation; program transformation; program calculation; program proof * Applications and Domain-Specific Languages: symbolic computing; formal-methods tools; artificial intelligence; systems programming; distributed-systems and web programming; hardware design; databases; XML processing; scientific and numerical computing; graphical user interfaces; multimedia programming; scripting; system administration; security; education * Functional Pearls: elegant, instructive, and fun essays on functional programming The conference also solicits Experience Reports, which are short papers that provide evidence that functional programming really works or describe obstacles that have kept it from working in a particular application. What's different this year? ~~~~~~~~~~~~~~~~~~~~~~~~~~~ * The conference dates and the submission deadline are about one month earlier than usual. * Special 'Call for Experience Reports' page, suitable as a target for posts on blogs and social networks to reach practitioners who wouldn't normally think about submitting to a conference. If you have a blog, etc., please help by pointing your readers to: http://web.cecs.pdx.edu/~apt/icfp09_cfer.html Instructions for authors ~~~~~~~~~~~~~~~~~~~~~~~~ By Monday, 2 March 2009, 20:00 UTC, submit an abstract of at most 300 words and a full paper of at most 12 pages (4 pages for an Experience Report), including bibliography and figures. The deadline will be strictly enforced and papers exceeding the page limits will be summarily rejected. Authors have the option to attach supplementary material to a submission, on the understanding that reviewers may choose not to look at it. A submission will be evaluated according to its relevance, correctness, significance, originality, and clarity. It should explain its contributions in both general and technical terms, clearly identifying what has been accomplished, explaining why it is significant, and comparing it with previous work. The technical content should be accessible to a broad audience. Functional Pearls and Experience Reports are separate categories of papers that need not report original research results and must be marked as such at the time of submission. Detailed guidelines on both categories are below. Each submission must adhere to SIGPLAN's republication policy, as explained on the web. Violation risks summary rejection of the offending submission. Proceedings will be published by ACM Press. Authors of accepted submissions are expected to transfer the copyright to ACM. Presentations will be videotaped and released online if the presenter consents by signing an additional permission form at the time of the presentation. Released videos will be included along with the conference proceedings in the ACM Digital Library and may also be placed on a host such as YouTube or Google Video. Formatting: ~~~~~~~~~~~ Submissions must be in PDF format printable in black and white on US Letter sized paper and interpretable by Ghostscript. If this requirement is a hardship, make contact with the program chair at least one week before the deadline. ICFP proceedings are printed in black and white. It is permissible to include color in a submission, but you risk annoying reviewers who will have to decide if your final paper will be understandable without it. Papers must adhere to the standard ACM conference format: two columns, nine-point font on a ten-point baseline, with columns 20pc (3.33in) wide and 54pc (9in) tall, with a column gutter of 2pc (0.33in). A suitable document template for LaTeX is available from SIGPLAN. Submission: ~~~~~~~~~~~ Submissions will be accepted electronically at a URL to be named later. The deadline is set in Coordinated Universal Time. The world clock (http://www.timeanddate.com/worldclock/fixedtime.html?month=3&day=2&year=2009&hour=20&min=0&sec=0&p1=0) can give you the equivalent in your local time, e.g., Noon Monday in Seattle, 3:00 PM Monday in New York, 8:00 PM Monday in London, 5:00 AM Tuesday in Tokyo. Citation: ~~~~~~~~~ We recommend (but do not require) that you put your citations into author-date form. This procedure makes your paper easier to review. For example, if you cite a result on testing as ``(Claessen and Hughes 2000)'', many reviewers will recognize the result instantly. On the other hand, if you cite it as ``[4]'', even the best-informed reviewer has to page through your paper to find the reference. By using author-date form, you enable a knowledgeable reviewer to focus on content, not arbitrary numbering of references. LaTeX users can simply use the natbib package along with the plainnat bibliography style. In practice, this means putting \usepackage{natbib} \bibpunct();A{}, \let\cite=\citep in your LaTeX preamble, and \bibliographystyle{plainnat} in your document. For most citations you will use the \cite command; if you want a citation like ``Claessen and Hughes (2000) showed that...'' you should use something like ``\citet{claessen:quickcheck} showed...'' Alternatively, the McBride bibliography style, which adheres to the Chicago manual of style ``Documentation Two'' specifications and which fixes some perceived deficiencies of natbib, may be used. The style file along with instructions for using it is available on the McBride web site. Author response: ~~~~~~~~~~~~~~~~ Authors will have a 48-hour period, starting at 20:00 UTC on 21 April 2009, to read and respond to reviews. Special categories of papers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In addition to research papers, ICFP solicits two kinds of papers that do not require original research contributions: Functional Pearls, which are full papers, and Experience Reports, which are limited to four pages. Authors submitting such papers may wish to consider the following advice. Functional Pearls ~~~~~~~~~~~~~~~~~ A Functional Pearl is an elegant essay about something related to functional programming. It might offer: * a new and thought-provoking way of looking at an old idea * an instructive example of program calculation or proof * a nifty presentation of an old or new data structure * an interesting application of functional programming techniques * a novel use or exposition of functional programming in the classroom Functional Pearls are not restricted to the above varieties, however. While pearls often demonstrate an idea through the development of a short program, there is no requirement or expectation that they do so. Thus, they encompass the notions of theoretical and educational pearls. Functional Pearls are valued as highly and judged as rigorously as ordinary papers, but using somewhat different criteria. In particular, a pearl is not required to report original research. However, it should be concise, instructive, and entertaining. Your pearl is likely to be rejected if your readers get bored, if the material gets too complicated, if too much specialized knowledge is needed, or if the writing is inelegant. The key to writing a good pearl is polishing. A submission you wish to have treated as a pearl must be marked as such on the submission web page, and should contain the words ``Functional Pearl'' somewhere in its title or subtitle. These steps will alert reviewers to use the appropriate evaluation criteria. However, pearls will be combined with ordinary papers for the purpose of computing the conference's acceptance rate. Experience Reports ~~~~~~~~~~~~~~~~~~ The purpose of an Experience Report is to help create a body of published, refereed, citable evidence that functional programming really works---or to describe what obstacles prevent it from working. Possible topics for an Experience Report include, but are not limited to: * insights gained from real-world projects using functional programming * comparison of functional programming with conventional programming in the context of an industrial project or a university curriculum * project-management, business, or legal issues encountered when using functional programming in a real-world project * curricular issues encountered when using functional programming in education * real-world constraints that created special challenges for an implementation of a functional language or for functional programming in general An Experience Report is distinguished from a normal ICFP paper by its title, by its length, and by the criteria used to evaluate it. * Both in the proceedings and in any citations, the title of each accepted Experience Report must begin with the words ``Experience Report'' followed by a colon. The acceptance rate for Experience Reports will be computed and reported separately from the rate for ordinary papers. * An Experience Report is at most 4 pages long. Each accepted Experience Report will be presented at the conference, but depending on the number of Experience Reports and regular papers accepted, authors of Experience reports may be asked to give shorter talks. * Because the purpose of Experience Reports is to enable our community to accumulate a body of evidence about the efficacy of functional programming, an acceptable Experience Report need not add to the body of knowledge of the functional-programming community by presenting novel results or conclusions. It is sufficient if the Report states a clear thesis and provides supporting evidence. The thesis must be relevant to ICFP, but it need not be novel. The program committee will accept or reject Experience Reports based on whether they judge the evidence to be convincing. Anecdotal evidence will be acceptable provided it is well argued and the author explains what efforts were made to gather as much evidence as possible. Typically, more convincing evidence is obtained from papers which show how functional programming was used than from papers which only say that functional programming was used. The most convincing evidence often includes comparisons of situations before and after the introduction or discontinuation of functional programming. Evidence drawn from a single person's experience may be sufficient, but more weight will be given to evidence drawn from the experience of groups of people. An Experience Report should be short and to the point: make a claim about how well functional programming worked on your project and why, and produce evidence to substantiate your claim. If functional programming worked for you in the same ways it has worked for others, you need only to summarize the results---the main part of your paper should discuss how well it worked and in what context. Most readers will not want to know all the details of your project and its implementation, but please characterize your project and its context well enough so that readers can judge to what degree your experience is relevant to their own projects. Be especially careful to highlight any unusual aspects of your project. Also keep in mind that specifics about your project are more valuable than generalities about functional programming; for example, it is more valuable to say that your team delivered its software a month ahead of schedule than it is to say that functional programming made your team more productive. If your paper not only describes experience but also presents new technical results, or if your experience refutes cherished beliefs of the functional-programming community, you may be better off submitting it as a full paper, which will be judged by the usual criteria of novelty, originality, and relevance. If you are unsure in which category to submit, the program chair will be happy to help you decide. Other information ~~~~~~~~~~~~~~~~~ Conference Chair ~~~~~~~~~~~~~~~~ Graham Hutton (University of Nottingham) Program Chair ~~~~~~~~~~~~~ Andrew Tolmach Department of Computer Science Portland State University P.O. Box 751, Portland, OR 97207 USA Email: apt@REDACTED Phone: +1 503 725 5492 Fax: +1 503 725 3211 Mail sent to the address above is filtered for spam. If you send mail and do not receive a prompt response, particularly if the deadline is looming, feel free to telephone. Program Committee ~~~~~~~~~~~~~~~~~ Amal Ahmed (Toyota Technological Institute, Chicago) Maria Alpuente (Technical University of Valencia (UPV)) Lennart Augustsson (Standard Chartered Bank) Lars Birkedal (IT University of Copenhagen) Manuel Chakravarty (University of New South Wales) Koen Claessen (Chalmers University of Technology) Marc Feeley (Universite de Montreal) Andrzej Filinski (University of Copenhagen) Daan Leijen (Microsoft Research) Xavier Leroy (INRIA Paris-Rocquencourt) Conor McBride (University of Strathclyde) Matthew Might (University of Utah) Shin-Cheng Mu (Academia Sinica) Atsushi Ohori (Tohoku University) Kristoffer Rose (IBM Thomas J. Watson Research Center) Important Dates (at 20:00 UTC) ~~~~~~~~~~~~~~~ Submission: 2 March 2009 Author response: 21-23 April 2009 Notification: 5 May 2009 Final papers due: 8 June 2009 ICFP 2009 Web Site ~~~~~~~~~~~~~~~~~~ http://www.cs.nott.ac.uk/~gmh/icfp09.html Special Journal Issue ~~~~~~~~~~~~~~~~~~~~~ There will be a special issue of the Journal of Functional Programming with papers from ICFP 2009. The program committee will invite the authors of select accepted papers to submit a journal version to this issue. From watson.timothy@REDACTED Tue Dec 16 01:16:41 2008 From: watson.timothy@REDACTED (Tim Watson) Date: Tue, 16 Dec 2008 00:16:41 +0000 Subject: [erlang-questions] ct_cover broken when using packages Message-ID: <8fa878b90812151616s4bb2a9bby94c5c2d4a43f7492@mail.gmail.com> Hi all, I've noticed that the cover tool seems to break when using packages. It appears that the cover tool inserts executable code into your functions such as this: myfunction() -> %% do something ets:, %% inserted by cover %% etc This would be fine except that in a module module 1 contained within a package package1, the atom ets is resolved to 'package1.module1.ets' which doesn't exist (hopefully!). The correct behaviour would be to insert '.ets' or to dynamically add an "-import(ets)." to the module so that 'ets' resolves to '.ets' instead. Has anyone else come across this? Is there a planned fix? Many thanks, Tim Watson From raould@REDACTED Tue Dec 16 07:40:52 2008 From: raould@REDACTED (Raoul Duke) Date: Mon, 15 Dec 2008 22:40:52 -0800 Subject: [erlang-questions] lfe shell via lfe_boot Message-ID: <91a2ba3e0812152240x5449b970lb3b6390333edc2c@mail.gmail.com> hi, still a newbie, here, malheuresement. i have lfe under erl5.6.5./lib/lfe and am trying to use the lfe shell & haven't figured it out yet. i'm on winxp+cygwin. i can fire up erl and use lfe_comp:file() just dandy, but: bash-3.2$ bin/erl -noshell -noinput -s lfe_boot start =ERROR REPORT==== 15-Dec-2008::22:33:13 === Error in process <0.27.0> with exit value: {badarg,[{erlang,register,[user,<0.28.0>]},{user,start_port,1}]} i also, cargo-cult-pattern-matching-esque, tried "bin/erl -noshell -noinput -pa lib/life/src -s lfe_boot start", and got the same badarg. might anybody have an idea of what i'm doing wrong / need to do instead? thank you! From mighty.fine@REDACTED Tue Dec 16 09:22:46 2008 From: mighty.fine@REDACTED (mighty) Date: Tue, 16 Dec 2008 00:22:46 -0800 Subject: [erlang-questions] start_child() on simple_one_for_one supervisor -> {error, {already_started, ...}} ??? In-Reply-To: <4944EBC1.2080600@charpi.net> References: <4944EBC1.2080600@charpi.net> Message-ID: P.S. How scalable is registering processes? E.g., Is registering 64K processes not going to scale, as well as potentially impact others using registered names? It seems like there's a hash table for registered processes in register.c that starts off pretty small. On Sun, Dec 14, 2008 at 3:19 AM, Nicolas Charpentier wrote: > Hi, > > mighty wrote: >> >> I have a basic simple_one_for_one supervisor that I cannot start >> multiple children from -- the first call to start_child() works, the >> second call to start_child() returns >> {error,{already_started,<0.38.0>}}. My supervisor is >> simple_one_for_one, so I'd expect to hit the ?is_simple() handling of >> start_child in supervisor.erl, which should go through >> supervisor:do_start_child_i() without any fuss, and definitely not >> return {error, {already_started, ...}} out of >> supervisor:handle_start_child(). >> > > In your case {error, {already_started, _}} is returned by > gen_server:start_link/4 (and then returned by supervisor:start_child/2. > > gen_server:start_link/4 returns an error because you are trying to register > 2 processes with the same name (my_node). > Replace the function my_node:start_link/1 with: > > start_link(Instance) when is_integer(Instance)-> > error_logger:info_report([[my_node,start_link,Instance,self()]]), > Name = atom_to_list(?MODULE) ++ "_" ++ integer_to_list(Instance), > gen_server:start_link({local, list_to_atom(Name)},?MODULE,[],[]). > > > > Regards, > > ---- > Nicolas Charpentier > http://charpi.net > From erlang@REDACTED Tue Dec 16 10:58:25 2008 From: erlang@REDACTED (Andreas Stenius) Date: Tue, 16 Dec 2008 10:58:25 +0100 Subject: [erlang-questions] Fw: ct_cover broken when using packages Message-ID: <22300994.11229421506314.JavaMail.Andreas@HP-slim> Ops, was sent with wrong account... ----- Original Message ----- From: "Andreas Stenius" To: "Tim Watson" ; Sent: Tuesday, December 16, 2008 9:47 AM Subject: Re: [erlang-questions] ct_cover broken when using packages > Hi, > > I've run into similar problems when using packages, when including for > instance the eunit.hrl file, which has defines that will run into the same > problem of referring to global packages without the needed leading dot. > > In my opinion, the package system is broken, in that code is dependent on > the package layout for accessing the global scope, so I dropped it. > Doesn't look like the Erlang/OTP distro uses the package functionality at > all any way.. > > But I'd rather like seeing this issue addressed and fixed, since now all > my modules resides in only one dir, and with quite extensive names, which > should rather be a path.. > > Sorry, no help here, just want to add my view to let out that we're more > with similiar issues. > > Best regards, > Andreas Stenius > > ----- Original Message ----- > From: "Tim Watson" > To: > Sent: Tuesday, December 16, 2008 1:16 AM > Subject: Re: [erlang-questions] ct_cover broken when using packages > > >> Hi all, >> >> I've noticed that the cover tool seems to break when using packages. >> It appears that the cover tool inserts executable code into your >> functions such as this: >> >> myfunction() -> >> %% do something >> ets:, %% inserted by cover >> %% etc >> >> This would be fine except that in a module module 1 contained within a >> package package1, the atom ets is resolved to 'package1.module1.ets' >> which doesn't exist (hopefully!). The correct behaviour would be to >> insert '.ets' or to dynamically add an "-import(ets)." to the module >> so that 'ets' resolves to '.ets' instead. >> >> Has anyone else come across this? Is there a planned fix? >> >> Many thanks, >> >> Tim Watson >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > From peter@REDACTED Tue Dec 16 10:59:02 2008 From: peter@REDACTED (Peter Sabaini) Date: Tue, 16 Dec 2008 10:59:02 +0100 Subject: [erlang-questions] distel completion? Message-ID: <200812161059.09337.peter@sabaini.at> Hi, any distel users here? I'm new to distel and like it, one question though -- it seems distel only does completion on built-in libraries, is that correct? Is there a way to get it to complete my own code also? Thanks, peter. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part. URL: From watson.timothy@REDACTED Tue Dec 16 14:33:42 2008 From: watson.timothy@REDACTED (Tim Watson) Date: Tue, 16 Dec 2008 13:33:42 +0000 Subject: [erlang-questions] ct_cover broken when using packages In-Reply-To: References: <8fa878b90812151616s4bb2a9bby94c5c2d4a43f7492@mail.gmail.com> Message-ID: <8fa878b90812160533u767d1e7eqcac4e6ff42895b62@mail.gmail.com> Hi Andreas, Yeah the package system implementation isn't ideal - not even make:all will work unless you write (or generate) an Emakefile which specifies each of the source directories explicitly. You shouldn't have to do this sort of thing, it should "just work" imho. We do use packages, because our applications are packaged (and released) both as discrete Erlang/OTP releases and as components (depending on the needs of the target environment in question), so we would end up with names like 'bss_billing_dispatch_control_routing_server' which is something I'm just not willing to type! :) The work around is to include an import for 'ets' in your modules, which if you're averse to including in the production code (although it doesn't really matter in reality), can be stripped out using cpp or the like: -module(a.module.with.a.long.package.name). %% some *real* imports/directives/etc -import(ets). %% hack to keep cover happy This works, but I'd like to see it fixed nonetheless. On 16/12/2008, Andreas Stenius wrote: > Hi, > > I've run into similar problems when using packages, when including for > instance the eunit.hrl file, which has defines that will run into the same > problem of referring to global packages without the needed leading dot. > > In my opinion, the package system is broken, in that code is dependent on > the package layout for accessing the global scope, so I dropped it. Doesn't > look like the Erlang/OTP distro uses the package functionality at all any > way.. > > But I'd rather like seeing this issue addressed and fixed, since now all my > modules resides in only one dir, and with quite extensive names, which > should rather be a path.. > > Sorry, no help here, just want to add my view to let out that we're more > with similiar issues. > > Best regards, > Andreas Stenius > > ----- Original Message ----- > From: "Tim Watson" > To: > Sent: Tuesday, December 16, 2008 1:16 AM > Subject: Re: [erlang-questions] ct_cover broken when using packages > > >> Hi all, >> >> I've noticed that the cover tool seems to break when using packages. >> It appears that the cover tool inserts executable code into your >> functions such as this: >> >> myfunction() -> >> %% do something >> ets:, %% inserted by cover >> %% etc >> >> This would be fine except that in a module module 1 contained within a >> package package1, the atom ets is resolved to 'package1.module1.ets' >> which doesn't exist (hopefully!). The correct behaviour would be to >> insert '.ets' or to dynamically add an "-import(ets)." to the module >> so that 'ets' resolves to '.ets' instead. >> >> Has anyone else come across this? Is there a planned fix? >> >> Many thanks, >> >> Tim Watson >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > > > From peter@REDACTED Tue Dec 16 14:36:52 2008 From: peter@REDACTED (Peter Sabaini) Date: Tue, 16 Dec 2008 14:36:52 +0100 Subject: [erlang-questions] distel completion? In-Reply-To: <6CF9613D-E375-45E3-A55E-544A5AEE78FA@gmail.com> References: <200812161059.09337.peter@sabaini.at> <6CF9613D-E375-45E3-A55E-544A5AEE78FA@gmail.com> Message-ID: <200812161436.58497.peter@sabaini.at> On Tuesday 16 December 2008 13:55:28 you wrote: > In your .erlang file add your project's code path and it should work. I've got sth like this in my .erlang: code:add_patha("/home/sabaini/src/myproject"). -- ie. where my sources are. I get this error message at the erl shell when trying to complete one of my modules' start_link() fun: =ERROR REPORT==== 16-Dec-2008::14:24:33 === ** Generic server otp_doc terminating ** Last message in was {funcs,"delivery","start",[]} ** When Server state == {state,"/usr/lib/erlang",file,"-"} ** Reason for termination == ** {bad_return_value,no_data} As a variation I used add_pathz() instead, but no observable change. Should this work? Thanks, peter. > I also find flymake very helpful. Distel rocks! > > On Dec 16, 2008, at 4:59 AM, Peter Sabaini wrote: > > Hi, any distel users here? > > > > I'm new to distel and like it, one question though -- it seems > > distel only > > does completion on built-in libraries, is that correct? Is there a > > way to get > > it to complete my own code also? > > > > Thanks, > > peter. > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part. URL: From ahmed.nawras@REDACTED Tue Dec 16 16:08:58 2008 From: ahmed.nawras@REDACTED (Ahmed Ali) Date: Tue, 16 Dec 2008 19:08:58 +0400 Subject: [erlang-questions] distel completion? In-Reply-To: <200812161436.58497.peter@sabaini.at> References: <200812161059.09337.peter@sabaini.at> <6CF9613D-E375-45E3-A55E-544A5AEE78FA@gmail.com> <200812161436.58497.peter@sabaini.at> Message-ID: 2008/12/16 Peter Sabaini : > On Tuesday 16 December 2008 13:55:28 you wrote: >> In your .erlang file add your project's code path and it should work. > > I've got sth like this in my .erlang: > > code:add_patha("/home/sabaini/src/myproject"). I think you need to add distel's ebin code path here. For me, completion works with all modules. > > -- ie. where my sources are. > > I get this error message at the erl shell when trying to complete one of my > modules' start_link() fun: > > =ERROR REPORT==== 16-Dec-2008::14:24:33 === > ** Generic server otp_doc terminating > ** Last message in was {funcs,"delivery","start",[]} > ** When Server state == {state,"/usr/lib/erlang",file,"-"} > ** Reason for termination == > ** {bad_return_value,no_data} > > As a variation I used add_pathz() instead, but no observable change. > > Should this work? > > Thanks, > peter. > > > >> I also find flymake very helpful. Distel rocks! >> >> On Dec 16, 2008, at 4:59 AM, Peter Sabaini wrote: >> > Hi, any distel users here? >> > >> > I'm new to distel and like it, one question though -- it seems >> > distel only >> > does completion on built-in libraries, is that correct? Is there a >> > way to get >> > it to complete my own code also? >> > >> > Thanks, >> > peter. >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From subopt@REDACTED Tue Dec 16 16:27:42 2008 From: subopt@REDACTED (Eric Holbrook) Date: Tue, 16 Dec 2008 09:27:42 -0600 Subject: [erlang-questions] io:format problem within a process, but not in the shell Message-ID: <4947C8EE.8070007@gmail.com> Why doesn't *all* of my io:format code work w/in the context of my process? setMgr( Set ) -> receive {repr} -> io:format("Set elements: ~n"), [io:format(" ~p~n", [Elem]) || Elem <- sets:to_list(Set)], setMgr(Set); {other various blocks to add/modify my internal set 'Set'} -> ... end. When i send the {repr} msg to a 'setMgr' process, i get the 'Set elements' output, but somehow the list comprehension part doesn't show up in STDOUT. However, if i create a set named Set in the shell, and execute the list comprehension line, it works fine. tia, Eric From subopt@REDACTED Tue Dec 16 16:54:38 2008 From: subopt@REDACTED (Eric Holbrook) Date: Tue, 16 Dec 2008 09:54:38 -0600 Subject: [erlang-questions] io:format problem within a process, but not in the shell In-Reply-To: References: <4947C8EE.8070007@gmail.com> Message-ID: <4947CF3E.6050705@gmail.com> If you are right, then why does the list comprehension line work in the shell, but not within the context of the process? I don't understand how the context determines the validity or behavior of that particular syntax. thanks, Eric tuscland@REDACTED wrote: > Maybe I'm not correct but I think, this because you are creating a > list as a second statement instead of printing the list in the first > io:format statement. > > > On 12/16/08, Eric Holbrook wrote: > >> Why doesn't *all* of my io:format code work w/in the context of my >> process? >> >> >> >> >> setMgr( Set ) -> >> receive >> {repr} -> >> io:format("Set elements: ~n"), >> [io:format(" ~p~n", [Elem]) || Elem <- sets:to_list(Set)], >> setMgr(Set); >> {other various blocks to add/modify my internal set 'Set'} -> >> ... >> end. >> >> >> >> When i send the {repr} msg to a 'setMgr' process, i get the 'Set >> elements' output, but somehow the list comprehension part doesn't show >> up in STDOUT. >> >> However, if i create a set named Set in the shell, and execute the >> list comprehension line, it works fine. >> >> tia, >> Eric >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> > > From nc@REDACTED Tue Dec 16 17:24:24 2008 From: nc@REDACTED (Nicolas Charpentier) Date: Tue, 16 Dec 2008 17:24:24 +0100 Subject: [erlang-questions] io:format problem within a process, but not in the shell In-Reply-To: <4947C8EE.8070007@gmail.com> References: <4947C8EE.8070007@gmail.com> Message-ID: <4947D638.60809@charpi.net> Hi, With the few information you gave I might have some suppositions: 1)- the Set might not be a set when your process receive the message repr. 2)- Your erlang WM might be stopped *before* all io events be treated. Regards, Eric Holbrook wrote: > Why doesn't *all* of my io:format code work w/in the context of my > process? > > > > > setMgr( Set ) -> > receive > {repr} -> > io:format("Set elements: ~n"), > [io:format(" ~p~n", [Elem]) || Elem <- sets:to_list(Set)], > setMgr(Set); > {other various blocks to add/modify my internal set 'Set'} -> > ... > end. > > > > When i send the {repr} msg to a 'setMgr' process, i get the 'Set > elements' output, but somehow the list comprehension part doesn't show > up in STDOUT. > > However, if i create a set named Set in the shell, and execute the > list comprehension line, it works fine. > > tia, > Eric ---- Nicolas Charpentier http://charpi.net From raould@REDACTED Tue Dec 16 18:24:38 2008 From: raould@REDACTED (Raoul Duke) Date: Tue, 16 Dec 2008 09:24:38 -0800 Subject: [erlang-questions] "-define" in lfe? Message-ID: <91a2ba3e0812160924r3f443cb0r53a02ddeb551d240@mail.gmail.com> hi, lfe seems to be quite rich when it comes to macro forms; might anybody know which one should i use to duplicate erl-style "-define()"? i tried (define (foo1 "foo2")) and some variations but get {n,lfe_lint,unknown_form}. thank you. From erlang@REDACTED Tue Dec 16 20:50:43 2008 From: erlang@REDACTED (Dominic Williams) Date: Tue, 16 Dec 2008 20:50:43 +0100 Subject: [erlang-questions] start_child() on simple_one_for_one supervisor -> {error, {already_started, ...}} ??? In-Reply-To: References: <4944EBC1.2080600@charpi.net> Message-ID: <49480693.6030401@dominicwilliams.net> Hi mighty, mighty a ?crit : > P.S. How scalable is registering processes? E.g., Is > registering 64K processes not going to scale, as well as > potentially impact others using registered names? It > seems like there's a hash table for registered processes > in register.c that starts off pretty small. I don't know the answer to your question. However, I do think that registering processes is not a particularly good idea in general, and is especially wrong in your case, when the processes will be created dynamically. The only point of registering a process is to be able to call it later, by its name. This is bad enough (it's really like having a global variable, it's hell to test, etc). If the names are dynamic, then that also defeats the purpose: you can't actually call dynamic names without having some sort of previous knowledge of which names have been created (in which case you might as well store the pids). It is perfectly possible to create a gen_server without registering it. Having it restarted by a supervisor is a bit more challenging (because the pid can change), but is still manageable in many cases. Just a thought which seemed worth pointing out in your situation. Regards, Dominic Williams http://dominicwilliams.net ---- From rvirding@REDACTED Tue Dec 16 22:23:30 2008 From: rvirding@REDACTED (Robert Virding) Date: Tue, 16 Dec 2008 22:23:30 +0100 Subject: [erlang-questions] lfe shell via lfe_boot In-Reply-To: <91a2ba3e0812152240x5449b970lb3b6390333edc2c@mail.gmail.com> References: <91a2ba3e0812152240x5449b970lb3b6390333edc2c@mail.gmail.com> Message-ID: <3dbc6d1c0812161323w52af7d89j4af09063d164ee3d@mail.gmail.com> Hi, Hmm. The magical incantation you are using is right erl -noshell -noinput -s lfe_boot start What I am wondering is how you have set your paths so it can find all the files? I assume that as you have no problems running the compiler they are set up right, but if you are having having problems this may be the cause. Let me know. Note that the lfe shell doesn't have as many built-in commands as the vanilla shell but you can use many of them by directly calling the corresponding function in the module 'c'. This is what the vanilla shell does. So for example you want the help info then you would do: > (: c help) LFE is progressing and I intend to work more on it soon. It depends on what input I get. Let me know how it goes and if you find any bugs, Robert 2008/12/16 Raoul Duke > hi, > > still a newbie, here, malheuresement. i have lfe under > erl5.6.5./lib/lfe and am trying to use the lfe shell & haven't figured > it out yet. i'm on winxp+cygwin. i can fire up erl and use > lfe_comp:file() just dandy, but: > > bash-3.2$ bin/erl -noshell -noinput -s lfe_boot start > =ERROR REPORT==== 15-Dec-2008::22:33:13 === > Error in process <0.27.0> with exit value: > {badarg,[{erlang,register,[user,<0.28.0>]},{user,start_port,1}]} > > i also, cargo-cult-pattern-matching-esque, tried "bin/erl -noshell > -noinput -pa lib/life/src -s lfe_boot start", and got the same badarg. > > might anybody have an idea of what i'm doing wrong / need to do instead? > thank you! > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raould@REDACTED Tue Dec 16 22:29:15 2008 From: raould@REDACTED (Raoul Duke) Date: Tue, 16 Dec 2008 13:29:15 -0800 Subject: [erlang-questions] lfe shell via lfe_boot In-Reply-To: <3dbc6d1c0812161323w52af7d89j4af09063d164ee3d@mail.gmail.com> References: <91a2ba3e0812152240x5449b970lb3b6390333edc2c@mail.gmail.com> <3dbc6d1c0812161323w52af7d89j4af09063d164ee3d@mail.gmail.com> Message-ID: <91a2ba3e0812161329i2eba15fcqe2bd6c10b452931a@mail.gmail.com> > LFE is progressing and I intend to work more on it soon. It depends on what > input I get. Let me know how it goes and if you find any bugs, i find it exciting! so far the main stumbling blocks for this newbie might perhaps be summarized as: 1) the install is too error prone for me i think, presumably since i don't know enough about erlang. if there were some way to make the install more fool proof, that could be good. e.g. directions about where exactly to install it relative to erl, and what, if anything, to modify to make it all go. if you were able to make it go on linux, winxp + mac, and have transcripts thereof on some wiki so people could annotate/correct/amend, that would perhaps help a bit. 2) i think the lfe documentation could stand to: (a) more explicitly say/show erl -> lfe mappings. (b) more clearly differentiate the nuances e.g. all the different kinds of macros w/in lfe. again, i'm personally at least very interested in lfe, thank you for all your work on it! to everybody else: what is preventing YOU from using lfe? would you be willing to start talking about using it? would you be willing to contribute to a wiki about it? etc. i think there needs to be some actual critical mass to make it really go somewhere -- it seems to me like i'm the only person on earth trying to use it, judging from google search results!? sincerely. From raould@REDACTED Tue Dec 16 22:30:53 2008 From: raould@REDACTED (Raoul Duke) Date: Tue, 16 Dec 2008 13:30:53 -0800 Subject: [erlang-questions] lfe shell via lfe_boot In-Reply-To: <91a2ba3e0812161329i2eba15fcqe2bd6c10b452931a@mail.gmail.com> References: <91a2ba3e0812152240x5449b970lb3b6390333edc2c@mail.gmail.com> <3dbc6d1c0812161323w52af7d89j4af09063d164ee3d@mail.gmail.com> <91a2ba3e0812161329i2eba15fcqe2bd6c10b452931a@mail.gmail.com> Message-ID: <91a2ba3e0812161330h65c864gc8c39bfaf88980dc@mail.gmail.com> > 2) i think the lfe documentation could stand to: (a) more explicitly > say/show erl -> lfe mappings. (b) more clearly differentiate the > nuances e.g. all the different kinds of macros w/in lfe. p.s. if anybody were to start a wiki of LFE tutorials, i would *gladly* be a guinea pig / mine canary who tries them out and offers feedback / edits in the hopes of helping future 7 generations. From rvirding@REDACTED Tue Dec 16 22:42:33 2008 From: rvirding@REDACTED (Robert Virding) Date: Tue, 16 Dec 2008 22:42:33 +0100 Subject: [erlang-questions] "-define" in lfe? In-Reply-To: <91a2ba3e0812160924r3f443cb0r53a02ddeb551d240@mail.gmail.com> References: <91a2ba3e0812160924r3f443cb0r53a02ddeb551d240@mail.gmail.com> Message-ID: <3dbc6d1c0812161342y4ff2849dwc2599bc6d80e004e@mail.gmail.com> Hi Raoul, As yet there are symbol macros in lfe, i.e. you cannot do the same as with -define() and define an atom to expand into an expression as for example: -define(foo, "foo bar"). As yet you can only define macro forms: (defmacro foo () '"foo bar") which you would call by (foo). Note that you can use macros anywhere, even in patterns. If being able to define symbol macros is important for you I will consider adding them. There are two sets of defining macros in LFE: an older scheme inspired set which is not supported any more and will be phased out; and a newer CL inspired set. The CL based set does include a scheme inspired syntax-rule macro definer, called defsyntax, as this is practical for simple expansion macros. The User Guide describes (briefly) the CL inspired defining macro set. Robert 2008/12/16 Raoul Duke > hi, > > lfe seems to be quite rich when it comes to macro forms; might anybody > know which one should i use to duplicate erl-style "-define()"? i > tried (define (foo1 "foo2")) and some variations but get > {n,lfe_lint,unknown_form}. > > thank you. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vances@REDACTED Tue Dec 16 23:02:11 2008 From: vances@REDACTED (Vance Shipley) Date: Tue, 16 Dec 2008 17:02:11 -0500 Subject: [erlang-questions] start_child() on simple_one_for_one supervisor -> {error, {already_started, ...}} ??? In-Reply-To: <49480693.6030401@dominicwilliams.net> References: <4944EBC1.2080600@charpi.net> <49480693.6030401@dominicwilliams.net> Message-ID: <20081216220207.GA333@h216-235-12-168.host.egate.net> On Tue, Dec 16, 2008 at 08:50:43PM +0100, Dominic Williams wrote: } The only point of registering a process is to be able to } call it later, by its name. This is bad enough (it's really } like having a global variable, it's hell to test, etc). Agreed. One alternative which I use is to pass the supervisor's process ID as an argument to the child and later inspect the children with supervisor:which_children/1. -module(foo_sup). -export([init/1]). -behaviour(supervisor). init(_) -> FsmStartMod = foo_server, FsmStartArgs = [self()], FsmStartFunc = {gen_fsm, start_link, [FsmStartMod, FsmStartArgs, []]}, SrvStartMod = foo_server, SrvStartFunc = {gen_server, start_link, [SrvStartMod, [], []]}, ChildSpecs = [{FsmStartMod, FsmStartFunc, permanent, 4000, worker, [FsmStartMod]}, {SrvStartMod, SrvStartFunc, permanent, 4000, worker, [SrvStartMod]}], {ok, {{one_for_one, 10, 60}, ChildSpecs}}. -module(foo_fsm). -export([init/1, idle/2]). -behaviour(gen_fsm). -record(state, {sup}}). init([SupRef]) -> {ok, idle, #state{sup = SupRef}}. idle(Event, StateData) -> ... Children = supervisor:which_children(StateData#state.sup), {value, {_, Pid, _, _}} = lists:keysearch(foo_server, 1, Children), Foo = gen_server:call(Pid, foo), ... Often the child process I am looking for shares a common ancestor supervisor in which case the SupRef was passed down the chain of children. This is funbctional programing, if you need to know something in a function you pass it as an argument to the function. -Vance From masse@REDACTED Tue Dec 16 23:26:48 2008 From: masse@REDACTED (mats cronqvist) Date: Tue, 16 Dec 2008 23:26:48 +0100 Subject: [erlang-questions] distel completion? In-Reply-To: <200812161059.09337.peter@sabaini.at> (Peter Sabaini's message of "Tue\, 16 Dec 2008 10\:59\:02 +0100") References: <200812161059.09337.peter@sabaini.at> Message-ID: <87prjr92on.fsf@sterlett.hq.kred> Peter Sabaini writes: > I'm new to distel and like it, one question though -- it seems distel only > does completion on built-in libraries, is that correct? Is there a way to get > it to complete my own code also? Where did you get the distel from? A version number would be good, if only distel came with such luxuries... mats From masse@REDACTED Tue Dec 16 23:31:36 2008 From: masse@REDACTED (mats cronqvist) Date: Tue, 16 Dec 2008 23:31:36 +0100 Subject: [erlang-questions] io:format problem within a process, but not in the shell In-Reply-To: <4947C8EE.8070007@gmail.com> (Eric Holbrook's message of "Tue\, 16 Dec 2008 09\:27\:42 -0600") References: <4947C8EE.8070007@gmail.com> Message-ID: <87ljuf92gn.fsf@sterlett.hq.kred> Eric Holbrook writes: > Why doesn't *all* of my io:format code work w/in the context of my > process? > > > > > setMgr( Set ) -> > receive > {repr} -> > io:format("Set elements: ~n"), > [io:format(" ~p~n", [Elem]) || Elem <- sets:to_list(Set)], > setMgr(Set); > {other various blocks to add/modify my internal set 'Set'} -> > ... > end. > > > > When i send the {repr} msg to a 'setMgr' process, i get the 'Set > elements' output, but somehow the list comprehension part doesn't show > up in STDOUT. pardon me for pointing out the obvious, but are you sure that sets:to_list(Set) =/= [] ? From john.hughes@REDACTED Wed Dec 17 00:01:28 2008 From: john.hughes@REDACTED (John Hughes) Date: Wed, 17 Dec 2008 00:01:28 +0100 Subject: [erlang-questions] io:format problem within a process, but not in the shell In-Reply-To: References: Message-ID: <5DC0140337AB45F2B284477D1160CA6A@HallDesktop> > From: Eric Holbrook > Subject: > To: erlang-questions@REDACTED > Message-ID: <4947C8EE.8070007@REDACTED> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Why doesn't *all* of my io:format code work w/in the context of my > process? > > > > > setMgr( Set ) -> > receive > {repr} -> > io:format("Set elements: ~n"), > [io:format(" ~p~n", [Elem]) || Elem <- sets:to_list(Set)], > setMgr(Set); > {other various blocks to add/modify my internal set 'Set'} -> > ... > end. > > > > When i send the {repr} msg to a 'setMgr' process, i get the 'Set > elements' output, but somehow the list comprehension part doesn't show > up in STDOUT. > > However, if i create a set named Set in the shell, and execute the > list comprehension line, it works fine. > Most likely reasons: * the set is actually empty, so sets:to_list(Set) is the empty list [], and the list comprehension does nothing, or * the set is not a set, and the sets:to_list(Set) raises a {badrecord,sets} exception, crashing the setMgr process. If you started the process with spawn_link, then you'll see the crash (the spawning process will receive an exit signal, and if it's the shell, print an error message). But if you started the process with spawn, then it will silently die at this point, giving the impression that your list comprehension did nothing. Compare: 13> spawn_link(fun()->exit({badrecord,sets}) end). ** exception exit: {badrecord,sets} 14> spawn(fun()->exit({badrecord,sets}) end). <0.59.0> Check to see whether your process is still alive after the comprehension. - use is_process_alive(Pid) on its pid, or - send it another {repr} message and see if it prints "Set elements:" again, or - add another io:format AFTER the list comprehension, and see if it is executed. Hope that helps! John From tony.hobbins@REDACTED Wed Dec 17 00:27:11 2008 From: tony.hobbins@REDACTED (Tony Hobbins) Date: Wed, 17 Dec 2008 10:27:11 +1100 Subject: [erlang-questions] Interfacing Erlang to Oracle Message-ID: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> Hi all, Can anyone shed any light on best practice for interfacing Erlang to an Oracle DBMS? Specifically I only need query access to a legacy database (mnesia is not an option unfortunately). I seem to recall many years ago that work on an OCI interface was proposed. I am not sure of the state of any erlang-JDBC ports. Any advice or pointers in the right direction would be greatly appreciated! Tony Hobbins From dbudworth@REDACTED Wed Dec 17 00:52:58 2008 From: dbudworth@REDACTED (David Budworth) Date: Tue, 16 Dec 2008 17:52:58 -0600 Subject: [erlang-questions] Interfacing Erlang to Oracle In-Reply-To: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> References: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> Message-ID: <2e23d1d20812161552w1b315516xb6c3694f4a91d372@mail.gmail.com> erlang odbc support works, but I always hated odbc on unix due to poor support. one thing we thought of doing was adding a java bridge to the database using jinterface for communications. weird way to do it, but shouldn't be too big of a pain. Especially since jdbc is a pretty darn solid database connector. definitely not going to be your highest speed option though, since you'll take multiple marshaling hits while transferring data back and fourth. On Tue, Dec 16, 2008 at 5:27 PM, Tony Hobbins wrote: > Hi all, > > Can anyone shed any light on best practice for interfacing Erlang to > an Oracle DBMS? > > Specifically I only need query access to a legacy database (mnesia is > not an option unfortunately). > I seem to recall many years ago that work on an OCI interface was > proposed. > I am not sure of the state of any erlang-JDBC ports. > > Any advice or pointers in the right direction would be greatly > appreciated! > > Tony Hobbins > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.cer@REDACTED Wed Dec 17 01:07:49 2008 From: daniel.cer@REDACTED (Daniel Cer) Date: Tue, 16 Dec 2008 16:07:49 -0800 Subject: [erlang-questions] What websites/webapps use Erlang? Message-ID: I'm building a wiki that documents what languages, frameworks, and libraries are being used by various websites & webapps. One of the big goals of the project is to highlight the diverse set of languages and other components that people use to power their sites. Right now, I'm in the process of searching out and adding Erlang webapps. So far, I've found about half a dozen apps (since it might be of interest to some people here, the Erlang sites I've found are posted at the bottom of this e-mail). Does anyone here have an Erlang powered website or webapp? If you do, would you mind sharing the URL and what other support components you're using (e.g, ErlyWeb, Erlang-Web, MochiWeb, Mnesia, etc.)? Thanks, Dan The current list of Erlang powered sites: Beer Riot - Community beer review and enthusiast site. http://beerriot.com/ Vimagi - Social/collaborative painting site http://vimagi.com/ Twoorl - A twitter like micro-blogging service http://twoorl.com/ MochiBot ? Flash tracking and monitoring service http://www.mochibot.com/ Mochiads ? Flash game advertising and distribution service http://www.mochiads.com/ DayFindr - Collaborative scheduling webapp http://www.dayfindr.com/ From erlangy@REDACTED Wed Dec 17 01:11:52 2008 From: erlangy@REDACTED (Michael McDaniel) Date: Tue, 16 Dec 2008 16:11:52 -0800 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: References: Message-ID: <20081217001152.GH10079@delora.autosys.us> On Tue, Dec 16, 2008 at 04:07:49PM -0800, Daniel Cer wrote: > I'm building a wiki that documents what languages, frameworks, and > libraries are being used by various websites & webapps. One of the big > goals of the project is to highlight the diverse set of languages and > other components that people use to power their sites. > > Right now, I'm in the process of searching out and adding Erlang > webapps. So far, I've found about half a dozen apps (since it might be > of interest to some people here, the Erlang sites I've found are > posted at the bottom of this e-mail). > > Does anyone here have an Erlang powered website or webapp? If you do, > would you mind sharing the URL and what other support components > you're using (e.g, ErlyWeb, Erlang-Web, MochiWeb, Mnesia, etc.)? > > Thanks, Dan > > The current list of Erlang powered sites: > > Beer Riot - Community beer review and enthusiast site. > http://beerriot.com/ > > Vimagi - Social/collaborative painting site > http://vimagi.com/ > > Twoorl - A twitter like micro-blogging service > http://twoorl.com/ > > MochiBot ? Flash tracking and monitoring service > http://www.mochibot.com/ > > Mochiads ? Flash game advertising and distribution service > http://www.mochiads.com/ > > DayFindr - Collaborative scheduling webapp > http://www.dayfindr.com/ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ http://xqldap.xquad.com:8080/start Written with Erlang-Web (erlang-web.org), a picture gallery of a trip I took. The thumbnails are quick, full-size pictures download slow. I need to resize them to be a bit smaller. ~Michael > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- Michael McDaniel Portland, Oregon, USA http://autosys.us From raould@REDACTED Wed Dec 17 01:21:18 2008 From: raould@REDACTED (Raoul Duke) Date: Tue, 16 Dec 2008 16:21:18 -0800 Subject: [erlang-questions] lfe shell via lfe_boot In-Reply-To: <3dbc6d1c0812161323w52af7d89j4af09063d164ee3d@mail.gmail.com> References: <91a2ba3e0812152240x5449b970lb3b6390333edc2c@mail.gmail.com> <3dbc6d1c0812161323w52af7d89j4af09063d164ee3d@mail.gmail.com> Message-ID: <91a2ba3e0812161621h35499432y9362f6f00626ee63@mail.gmail.com> > erl -noshell -noinput -s lfe_boot start > What I am wondering is how you have set your paths so it can find all the > files? I assume that as you have no problems running the compiler they are > set up right, but if you are having having problems this may be the cause. > Let me know. i'm using cygwin on winxp, running bash in emacs. the bash path includes erl5.6.5/bin but nothing else erl or lfe related. when i run just erl (i run it from the erl5.6.5 directory) i can use lfe_comp:file/1 no problem. but when i try the lfe shell i get the badarg error (below). is there anybody else using winxp who can get the lfe shell working? what is your setup, if you can? how about winxp+cygwin? Error in process <0.27.0> with exit value: {badarg,[{erlang,register,[user,<0.28.0>]},{user,start_port,1}]} thanks! From raould@REDACTED Wed Dec 17 01:24:21 2008 From: raould@REDACTED (Raoul Duke) Date: Tue, 16 Dec 2008 16:24:21 -0800 Subject: [erlang-questions] lfe shell via lfe_boot In-Reply-To: <91a2ba3e0812161621h35499432y9362f6f00626ee63@mail.gmail.com> References: <91a2ba3e0812152240x5449b970lb3b6390333edc2c@mail.gmail.com> <3dbc6d1c0812161323w52af7d89j4af09063d164ee3d@mail.gmail.com> <91a2ba3e0812161621h35499432y9362f6f00626ee63@mail.gmail.com> Message-ID: <91a2ba3e0812161624h56f09c31jd3c3de3e36bc0bca@mail.gmail.com> P.S.: i currently have lfe extracted as erl5.6.5/lib/lfe/{doc,ebin,examples,src,test,etc.}; before i had extracted as erl5.6.5/lfe/{doc,...} and then copied over ebin as erl5.6.5/lib/lfe/*.beam, and was getting the same error/issue with the shell i believe. From cg@REDACTED Wed Dec 17 01:44:33 2008 From: cg@REDACTED (Chris Goffinet) Date: Tue, 16 Dec 2008 16:44:33 -0800 Subject: [erlang-questions] Question about Distributed Applications Message-ID: <2C947648-FCD7-4C94-874D-D0F83F73B350@chrisgoffinet.com> Hi I was reading over: http://www.erlang.org/doc/design_principles/distributed_applications.html And saw that if you had 3 nodes (A,B,C), and A failed, B would take over. If A came back, B would eventually shutdown and A would take over. Is it possible at all to disable the takeover? So if A comes back, as long as B is still running, nothing changes? -Chris From sean@REDACTED Wed Dec 17 03:03:04 2008 From: sean@REDACTED (Sean Rasmussen) Date: Tue, 16 Dec 2008 21:03:04 -0500 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: <20081217001152.GH10079@delora.autosys.us> References: <20081217001152.GH10079@delora.autosys.us> Message-ID: Hi Dan, Another suggestion (admittedly my own creation): ======================================= The Mock Exchange: A Stock Market Simulation http://www.themockexchange.com/ ======================================= Laszlo front-end exchanging XML with an Erlang server via a Rest API, using Mnesia; for example: http://www.themockexchange.com: 8888/tmx/traders. It's using my own webserver - Pranayama (http://code.google.com/p/ pranayama/). tMX is hosted on a 1/4 Gb virtual server running Fedora 7 so you might find it a bit pokey. Looking forward to that wiki. /Sean On 16-Dec-08, at 7:11 PM, Michael McDaniel wrote: > > On Tue, Dec 16, 2008 at 04:07:49PM -0800, Daniel Cer wrote: >> I'm building a wiki that documents what languages, frameworks, and >> libraries are being used by various websites & webapps. One of the >> big >> goals of the project is to highlight the diverse set of languages and >> other components that people use to power their sites. >> >> Right now, I'm in the process of searching out and adding Erlang >> webapps. So far, I've found about half a dozen apps (since it >> might be >> of interest to some people here, the Erlang sites I've found are >> posted at the bottom of this e-mail). >> >> Does anyone here have an Erlang powered website or webapp? If you do, >> would you mind sharing the URL and what other support components >> you're using (e.g, ErlyWeb, Erlang-Web, MochiWeb, Mnesia, etc.)? >> >> Thanks, Dan >> >> The current list of Erlang powered sites: >> >> Beer Riot - Community beer review and enthusiast site. >> http://beerriot.com/ >> >> Vimagi - Social/collaborative painting site >> http://vimagi.com/ >> >> Twoorl - A twitter like micro-blogging service >> http://twoorl.com/ >> >> MochiBot ? Flash tracking and monitoring service >> http://www.mochibot.com/ >> >> Mochiads ? Flash game advertising and distribution service >> http://www.mochiads.com/ >> >> DayFindr - Collaborative scheduling webapp >> http://www.dayfindr.com/ > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > http://xqldap.xquad.com:8080/start > > Written with Erlang-Web (erlang-web.org), a picture gallery of a trip > I took. > > The thumbnails are quick, full-size pictures download slow. I > need to > resize them to be a bit smaller. > > ~Michael > >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > -- > Michael McDaniel > Portland, Oregon, USA > http://autosys.us > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From raould@REDACTED Wed Dec 17 07:37:47 2008 From: raould@REDACTED (Raoul Duke) Date: Tue, 16 Dec 2008 22:37:47 -0800 Subject: [erlang-questions] "-define" in lfe? In-Reply-To: <3dbc6d1c0812161342y4ff2849dwc2599bc6d80e004e@mail.gmail.com> References: <91a2ba3e0812160924r3f443cb0r53a02ddeb551d240@mail.gmail.com> <3dbc6d1c0812161342y4ff2849dwc2599bc6d80e004e@mail.gmail.com> Message-ID: <91a2ba3e0812162237g1b20bedbtba7375da065b15b2@mail.gmail.com> hi, > If being able to define symbol macros is important for you I > will consider adding them. i don't know enough to be able to say what named things are important, unfortunately. my particular use case is that there's some erl code i wish to translate to lfe, and the erl version used "-define(...)", so i'd like to use whatever is appropriate in lfe to do the same thing. sincerely, the n00b. From raould@REDACTED Wed Dec 17 08:09:55 2008 From: raould@REDACTED (Raoul Duke) Date: Tue, 16 Dec 2008 23:09:55 -0800 Subject: [erlang-questions] "-define" in lfe? In-Reply-To: References: <91a2ba3e0812160924r3f443cb0r53a02ddeb551d240@mail.gmail.com> <3dbc6d1c0812161342y4ff2849dwc2599bc6d80e004e@mail.gmail.com> <91a2ba3e0812162237g1b20bedbtba7375da065b15b2@mail.gmail.com> Message-ID: <91a2ba3e0812162309p197a479dh8b84ddb4e6cf5058@mail.gmail.com> > Sounds like you'll be fine using defsyntax in LFE. See the comparisons > below for reference. defsyntax lets you avoid backquote for simple > replacements. many thanks for the examples! i'll try to get them to sink into my thicker-than-most-people's head... From raould@REDACTED Wed Dec 17 08:15:07 2008 From: raould@REDACTED (Raoul Duke) Date: Tue, 16 Dec 2008 23:15:07 -0800 Subject: [erlang-questions] "-define" in lfe? In-Reply-To: <91a2ba3e0812162237g1b20bedbtba7375da065b15b2@mail.gmail.com> References: <91a2ba3e0812160924r3f443cb0r53a02ddeb551d240@mail.gmail.com> <3dbc6d1c0812161342y4ff2849dwc2599bc6d80e004e@mail.gmail.com> <91a2ba3e0812162237g1b20bedbtba7375da065b15b2@mail.gmail.com> Message-ID: <91a2ba3e0812162315p37d8921bif94d02f24c78c58@mail.gmail.com> > i don't know enough to be able to say what named things are important, > unfortunately. my particular use case is that there's some erl code i > wish to translate to lfe, and the erl version used "-define(...)", so > i'd like to use whatever is appropriate in lfe to do the same thing. p.s.: also, related maybe?, how would one do the equivalent of erl ?MODULE:loop() in lfe to allow for hot-swapping? thank you. From johan.munk@REDACTED Wed Dec 17 08:37:53 2008 From: johan.munk@REDACTED (Johan Munk) Date: Wed, 17 Dec 2008 08:37:53 +0100 Subject: [erlang-questions] process priorities Message-ID: <4948AC51.2060404@arcticlake.com> My post didn't seem to get through. Retry: Hi list, I want to know how your experience is with fiddling with process priorities (i.e. use of process_flag(priority, )). I know the doc discourage the use of 'max' and 'high' but that does not mean this handle is not used in real world applications. thanks, -- Johan Munk From rvirding@REDACTED Wed Dec 17 08:41:30 2008 From: rvirding@REDACTED (Robert Virding) Date: Wed, 17 Dec 2008 08:41:30 +0100 Subject: [erlang-questions] "-define" in lfe? In-Reply-To: <91a2ba3e0812162315p37d8921bif94d02f24c78c58@mail.gmail.com> References: <91a2ba3e0812160924r3f443cb0r53a02ddeb551d240@mail.gmail.com> <3dbc6d1c0812161342y4ff2849dwc2599bc6d80e004e@mail.gmail.com> <91a2ba3e0812162237g1b20bedbtba7375da065b15b2@mail.gmail.com> <91a2ba3e0812162315p37d8921bif94d02f24c78c58@mail.gmail.com> Message-ID: <3dbc6d1c0812162341x6d598211tac587edd27ba956a@mail.gmail.com> There is no predefined module macro at the moment. Can add one though to the next release. Did you get starting lfe working ok by the way? Robert 2008/12/17 Raoul Duke > > i don't know enough to be able to say what named things are important, > > unfortunately. my particular use case is that there's some erl code i > > wish to translate to lfe, and the erl version used "-define(...)", so > > i'd like to use whatever is appropriate in lfe to do the same thing. > > p.s.: also, related maybe?, how would one do the equivalent of erl > ?MODULE:loop() in lfe to allow for hot-swapping? thank you. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raould@REDACTED Wed Dec 17 08:47:52 2008 From: raould@REDACTED (Raoul Duke) Date: Tue, 16 Dec 2008 23:47:52 -0800 Subject: [erlang-questions] "-define" in lfe? In-Reply-To: <3dbc6d1c0812162341x6d598211tac587edd27ba956a@mail.gmail.com> References: <91a2ba3e0812160924r3f443cb0r53a02ddeb551d240@mail.gmail.com> <3dbc6d1c0812161342y4ff2849dwc2599bc6d80e004e@mail.gmail.com> <91a2ba3e0812162237g1b20bedbtba7375da065b15b2@mail.gmail.com> <91a2ba3e0812162315p37d8921bif94d02f24c78c58@mail.gmail.com> <3dbc6d1c0812162341x6d598211tac587edd27ba956a@mail.gmail.com> Message-ID: <91a2ba3e0812162347w50bcd755p7b2bee5269a09eda@mail.gmail.com> hi, > There is no predefined module macro at the moment. Can add one though to the > next release. Did you get starting lfe working ok by the way? i haven't had any insights into getting the lfe shell working, but using lfe_comp:file() in the erl shell works just fine :-) From johan.munk@REDACTED Wed Dec 17 09:11:17 2008 From: johan.munk@REDACTED (Johan Munk) Date: Wed, 17 Dec 2008 09:11:17 +0100 Subject: [erlang-questions] process priorities In-Reply-To: <4948AC51.2060404@arcticlake.com> References: <4948AC51.2060404@arcticlake.com> Message-ID: <4948B425.10600@arcticlake.com> My post didn't seem to get through. Retry: Johan Munk wrote: > > Hi list, > > I want to know how your experience is with fiddling with process > priorities (i.e. use of process_flag(priority, )). > > I know the doc discourage the use of 'max' and 'high' but that does > not mean this handle is not used in real world applications. > > thanks, > -- Johan Munk From peter@REDACTED Wed Dec 17 10:39:23 2008 From: peter@REDACTED (Peter Sabaini) Date: Wed, 17 Dec 2008 10:39:23 +0100 Subject: [erlang-questions] distel completion? In-Reply-To: <87prjr92on.fsf@sterlett.hq.kred> References: <200812161059.09337.peter@sabaini.at> <87prjr92on.fsf@sterlett.hq.kred> Message-ID: <200812171039.29509.peter@sabaini.at> On Tuesday 16 December 2008 23:26:48 you wrote: > Peter Sabaini writes: > > I'm new to distel and like it, one question though -- it seems distel > > only does completion on built-in libraries, is that correct? Is there a > > way to get it to complete my own code also? > > Where did you get the distel from? A version number would be good, > if only distel came with such luxuries... Oh, there's absolutely no shortage of version numbers -- I got distel from googlecode ( http://code.google.com/p/distel/ ), and first tried the released version 4.0, then the HEAD from svn (Rev. 76). Some other versions: * GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.14.3) * Erlang + erlang-mode: R12B-3 * flymake 0.3 cheers, peter. > mats -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part. URL: From ulf.wiger@REDACTED Wed Dec 17 10:29:06 2008 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Wed, 17 Dec 2008 10:29:06 +0100 Subject: [erlang-questions] Question about Distributed Applications In-Reply-To: <2C947648-FCD7-4C94-874D-D0F83F73B350@chrisgoffinet.com> References: <2C947648-FCD7-4C94-874D-D0F83F73B350@chrisgoffinet.com> Message-ID: <4948C662.2020305@ericsson.com> Chris Goffinet skrev: > Hi > > I was reading over: > > http://www.erlang.org/doc/design_principles/distributed_applications.html > > And saw that if you had 3 nodes (A,B,C), and A failed, B would take > over. If A came back, B would eventually shutdown and A would take > over. Is it possible at all to disable the takeover? So if A comes > back, as long as B is still running, nothing changes? It is possible, but not exactly easy. (: You can use application:permit(App, false) on A to tell the application controller that you don't want it to start App there. Of course, you'd have to do this early on, and you'd likely end up writing your own simple cluster controller of sorts. One way to do this would be to store a configuration in a mnesia table, and then start a process early that checks the configuration and calls permit() accordingly. It sounds simple enough, but the devil's in the details, as usual. Another way to go about it is to in fact write your own distributed application controller. To know how to do this, you pretty much need to read the comments in application_controller.erl One key function is application_controller:control_application(App). This can only be called once per app (there is no un_control()), so you need to make sure that the dist_ac is not used at the same time. A /very/ good idea is to spawn a process per app that becomes the controlling process, and then send that process simple commands like run/dont_run. The message passing interface to the OTP application controller is described in the comments. This second alternative is of course /very/ advanced. I'd personally recommend using gen_leader for a cluster controller (that was partly the original purpose for gen_leader). In fact, I and a few others are slowly working on such a cluster controller component. Don't hold your breath, though. BR, Ulf W From rtrlists@REDACTED Wed Dec 17 10:51:41 2008 From: rtrlists@REDACTED (Robert Raschke) Date: Wed, 17 Dec 2008 09:51:41 +0000 Subject: [erlang-questions] Interfacing Erlang to Oracle In-Reply-To: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> References: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> Message-ID: <6a3ae47e0812170151l3792f163u30c3c6ea6ebc765b@mail.gmail.com> On Tue, Dec 16, 2008 at 11:27 PM, Tony Hobbins wrote: > Can anyone shed any light on best practice for interfacing Erlang to > an Oracle DBMS? I would second the ODBC suggestion. On Windows, that's pretty much a no-brainer. Linux is slightly more work on the setup front. Most Oracle ODBC libs I've come across do not support scrollable cursors, so ensure you start your connection by supplying the {scrollable_cursors, off} option to odbc:connect/2. Robby From lemenkov@REDACTED Wed Dec 17 12:18:19 2008 From: lemenkov@REDACTED (Peter Lemenkov) Date: Wed, 17 Dec 2008 14:18:19 +0300 Subject: [erlang-questions] Interfacing Erlang to Oracle In-Reply-To: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> References: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> Message-ID: Hello! 2008/12/17 Tony Hobbins : > Hi all, > > Can anyone shed any light on best practice for interfacing Erlang to > an Oracle DBMS? ODBC works for me. -- With best regards! From anton.krasovsky@REDACTED Wed Dec 17 15:19:06 2008 From: anton.krasovsky@REDACTED (Anton Krasovsky) Date: Wed, 17 Dec 2008 14:19:06 +0000 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: References: Message-ID: <46167e6a0812170619o14c0227ifa0dca0dd9687b9a@mail.gmail.com> Hi Dan, the project I'm working on: http://monimi.net - a website monitoring service The web interface is in Python/Javascript communicating with Erlang backend with py_interface and mysql. Anton On Wed, Dec 17, 2008 at 12:07 AM, Daniel Cer wrote: [...] > > Does anyone here have an Erlang powered website or webapp? If you do, > would you mind sharing the URL and what other support components > you're using (e.g, ErlyWeb, Erlang-Web, MochiWeb, Mnesia, etc.)? > [...] From pablo.platt@REDACTED Wed Dec 17 15:00:01 2008 From: pablo.platt@REDACTED (Pablo Platt) Date: Wed, 17 Dec 2008 06:00:01 -0800 (PST) Subject: [erlang-questions] compile a module against a different otp minor version References: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> Message-ID: <925837.57030.qm@web110009.mail.gq1.yahoo.com> Hi, Is it possible to compile a module against a different minor otp version that the one the module is going to run in? For example, if I have R12B-3 can I run a module compiled using R12B-5? How can I find out the minor version of the OTP? I've tried both: erlang:system_info(otp_release). init:script_id(). but they only reveal R12B. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From nc@REDACTED Wed Dec 17 15:33:40 2008 From: nc@REDACTED (Nicolas Charpentier) Date: Wed, 17 Dec 2008 15:33:40 +0100 Subject: [erlang-questions] compile a module against a different otp minor version In-Reply-To: <925837.57030.qm@web110009.mail.gq1.yahoo.com> References: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> <925837.57030.qm@web110009.mail.gq1.yahoo.com> Message-ID: <49490DC4.5070401@charpi.net> Hi, Pablo Platt wrote: > Hi, > > Is it possible to compile a module against a different minor otp version > that the one the module is going to run in? > For example, if I have R12B-3 can I run a module compiled using R12B-5? > As long as you are using API that are present in R12B-3, I think that your beam will be compatible, but I never tried it. > How can I find out the minor version of the OTP? erlang:system_info(version). "Y.X". with Y is the major version (5.5 for R11B and 5.6 for R12B) and X is the minor version (after the '-'). Regards, ----- Nicolas Charpentier http://charpi.net From anton.krasovsky@REDACTED Wed Dec 17 16:16:17 2008 From: anton.krasovsky@REDACTED (Anton Krasovsky) Date: Wed, 17 Dec 2008 15:16:17 +0000 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: <46167e6a0812170619o14c0227ifa0dca0dd9687b9a@mail.gmail.com> References: <46167e6a0812170619o14c0227ifa0dca0dd9687b9a@mail.gmail.com> Message-ID: <46167e6a0812170716t28838e50o7fbbc9f72f82a84e@mail.gmail.com> Sorry, I missed the part about what components are being used. I'm using: ejabberd (for IM gateway), erlmail (smtp client code), log4erl and sgte and erlang-mysql-driver anton On Wed, Dec 17, 2008 at 2:19 PM, Anton Krasovsky wrote: > Hi Dan, > > the project I'm working on: > > http://monimi.net - a website monitoring service > > The web interface is in Python/Javascript communicating with Erlang > backend with py_interface and mysql. > > Anton > > On Wed, Dec 17, 2008 at 12:07 AM, Daniel Cer wrote: > [...] >> >> Does anyone here have an Erlang powered website or webapp? If you do, >> would you mind sharing the URL and what other support components >> you're using (e.g, ErlyWeb, Erlang-Web, MochiWeb, Mnesia, etc.)? >> > [...] > From kenneth.lundin@REDACTED Wed Dec 17 17:26:12 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Wed, 17 Dec 2008 17:26:12 +0100 Subject: [erlang-questions] compile a module against a different otp minor version In-Reply-To: <925837.57030.qm@web110009.mail.gq1.yahoo.com> References: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> <925837.57030.qm@web110009.mail.gq1.yahoo.com> Message-ID: Hi, Here is a repetition of an answer I gave about a year ago. The safe assumption that we design and test for as good we can is that a .beam file compiled with the release including erts-5.5.3 will run on all forthcoming 5.5.x (x > 3) releases and even on 5.6.x releases if we don't explicitly state otherwise. But note, that even if a .beam file produced with an erts-5.5.x (R11B something) system works on a erts-5.6.x (R12B something) system it might not run as efficient as the same .beam file produced with an erts-5.6 system. Because of this I would recommend that you build new .beam files when there is a new major release. It is actually both the erts version and the compiler version that is importan when it comes to compatibility. Even if it works in most cases I would not say that is a 100% safe assumption to say that a .beam file produced with a newer release will run without problems on an older release. It may hold for one module but maybe not for another depending on the contents of the module. Our strategy is to be compatible with at least one older major version. R11B can run code from R9C and R10B within a major release like R11B .beam files produced by a release say R11B-0 can always be run by systems R11B-1 and newer. /Kenneth (Erlang/OTP team at Ericsson) 2008/12/17 Pablo Platt : > Hi, > > Is it possible to compile a module against a different minor otp version > that the one the module is going to run in? > For example, if I have R12B-3 can I run a module compiled using R12B-5? > > How can I find out the minor version of the OTP? > I've tried both: > erlang:system_info(otp_release). > init:script_id(). > > but they only reveal R12B. > > Thanks > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From cg@REDACTED Wed Dec 17 19:10:53 2008 From: cg@REDACTED (Chris Goffinet) Date: Wed, 17 Dec 2008 10:10:53 -0800 Subject: [erlang-questions] Question about Distributed Applications In-Reply-To: <4948C662.2020305@ericsson.com> References: <2C947648-FCD7-4C94-874D-D0F83F73B350@chrisgoffinet.com> <4948C662.2020305@ericsson.com> Message-ID: <0F1A262B-4991-4B18-8A26-FFEEEDB19CC6@chrisgoffinet.com> Hi Ulf: I was messing around with the distributed config last night: Sample config from documentation page: [{kernel, [{distributed, [{myapp, 5000, [cp1@REDACTED, {cp2@REDACTED}]}]}, {sync_nodes_mandatory, [cp2@REDACTED]}, {sync_nodes_timeout, 5000} ] } ]. I changed the sample config to this: [{kernel, [{distributed, [{myapp, 5000, [{cp1@REDACTED, cp2@REDACTED}]}]}, {sync_nodes_mandatory, [cp2@REDACTED]}, {sync_nodes_timeout, 5000} ] } ]. It did exactly what I was looking for. Did I find a fluke? On Dec 17, 2008, at 1:29 AM, Ulf Wiger (TN/EAB) wrote: > Chris Goffinet skrev: >> Hi >> I was reading over: >> http://www.erlang.org/doc/design_principles/distributed_applications.html >> And saw that if you had 3 nodes (A,B,C), and A failed, B would >> take over. If A came back, B would eventually shutdown and A would >> take over. Is it possible at all to disable the takeover? So if A >> comes back, as long as B is still running, nothing changes? > > It is possible, but not exactly easy. (: > > You can use application:permit(App, false) on A to tell the > application > controller that you don't want it to start App there. Of course, you'd > have to do this early on, and you'd likely end up writing your own > simple cluster controller of sorts. One way to do this would be to > store a configuration in a mnesia table, and then start a process > early that checks the configuration and calls permit() accordingly. > It sounds simple enough, but the devil's in the details, as usual. > > Another way to go about it is to in fact write your own distributed > application controller. To know how to do this, you pretty much > need to read the comments in application_controller.erl > One key function is application_controller:control_application(App). > This can only be called once per app (there is no un_control()), > so you need to make sure that the dist_ac is not used at the same > time. > > A /very/ good idea is to spawn a process per app that becomes the > controlling process, and then send that process simple commands > like run/dont_run. The message passing interface to the OTP > application controller is described in the comments. > > This second alternative is of course /very/ advanced. I'd personally > recommend using gen_leader for a cluster controller (that was partly > the original purpose for gen_leader). In fact, I and a few others are > slowly working on such a cluster controller component. Don't hold your > breath, though. > > BR, > Ulf W From nick@REDACTED Wed Dec 17 19:20:07 2008 From: nick@REDACTED (Nick Gerakines) Date: Wed, 17 Dec 2008 10:20:07 -0800 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: <46167e6a0812170716t28838e50o7fbbc9f72f82a84e@mail.gmail.com> References: <46167e6a0812170619o14c0227ifa0dca0dd9687b9a@mail.gmail.com> <46167e6a0812170716t28838e50o7fbbc9f72f82a84e@mail.gmail.com> Message-ID: I Play WoW -- http://www.facebook.com/apps/application.php?id=2359644980 Completely powered by MochiWeb, Erltl (ErlyWeb templating module), a lot of home built stuff (most of which is open source on GitHub) and CouchDB. # Nick Gerakines On Wed, Dec 17, 2008 at 7:16 AM, Anton Krasovsky wrote: > Sorry, I missed the part about what components are being used. I'm using: > > ejabberd (for IM gateway), erlmail (smtp client code), log4erl and > sgte and erlang-mysql-driver > > anton > > On Wed, Dec 17, 2008 at 2:19 PM, Anton Krasovsky > wrote: >> Hi Dan, >> >> the project I'm working on: >> >> http://monimi.net - a website monitoring service >> >> The web interface is in Python/Javascript communicating with Erlang >> backend with py_interface and mysql. >> >> Anton >> >> On Wed, Dec 17, 2008 at 12:07 AM, Daniel Cer wrote: >> [...] >>> >>> Does anyone here have an Erlang powered website or webapp? If you do, >>> would you mind sharing the URL and what other support components >>> you're using (e.g, ErlyWeb, Erlang-Web, MochiWeb, Mnesia, etc.)? >>> >> [...] >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From ulf@REDACTED Wed Dec 17 20:24:33 2008 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 17 Dec 2008 20:24:33 +0100 Subject: [erlang-questions] Question about Distributed Applications In-Reply-To: <0F1A262B-4991-4B18-8A26-FFEEEDB19CC6@chrisgoffinet.com> References: <2C947648-FCD7-4C94-874D-D0F83F73B350@chrisgoffinet.com> <4948C662.2020305@ericsson.com> <0F1A262B-4991-4B18-8A26-FFEEEDB19CC6@chrisgoffinet.com> Message-ID: <8209f740812171124s257dea77wa5a4bc4336c8a856@mail.gmail.com> No, you're right. That would avoid the unnecessary takeover, since the two nodes are configured as equals. BR, Ulf W 2008/12/17 Chris Goffinet : > Hi Ulf: > > I was messing around with the distributed config last night: > > Sample config from documentation page: > > [{kernel, > [{distributed, [{myapp, 5000, [cp1@REDACTED, {cp2@REDACTED}]}]}, > {sync_nodes_mandatory, [cp2@REDACTED]}, > {sync_nodes_timeout, 5000} > ] > } > ]. > > > I changed the sample config to this: > > [{kernel, > [{distributed, [{myapp, 5000, [{cp1@REDACTED, cp2@REDACTED}]}]}, > {sync_nodes_mandatory, [cp2@REDACTED]}, > {sync_nodes_timeout, 5000} > ] > } > ]. > > It did exactly what I was looking for. Did I find a fluke? > > > On Dec 17, 2008, at 1:29 AM, Ulf Wiger (TN/EAB) wrote: > >> Chris Goffinet skrev: >>> Hi >>> I was reading over: >>> http://www.erlang.org/doc/design_principles/distributed_applications.html >>> And saw that if you had 3 nodes (A,B,C), and A failed, B would >>> take over. If A came back, B would eventually shutdown and A would >>> take over. Is it possible at all to disable the takeover? So if A >>> comes back, as long as B is still running, nothing changes? >> >> It is possible, but not exactly easy. (: >> >> You can use application:permit(App, false) on A to tell the >> application >> controller that you don't want it to start App there. Of course, you'd >> have to do this early on, and you'd likely end up writing your own >> simple cluster controller of sorts. One way to do this would be to >> store a configuration in a mnesia table, and then start a process >> early that checks the configuration and calls permit() accordingly. >> It sounds simple enough, but the devil's in the details, as usual. >> >> Another way to go about it is to in fact write your own distributed >> application controller. To know how to do this, you pretty much >> need to read the comments in application_controller.erl >> One key function is application_controller:control_application(App). >> This can only be called once per app (there is no un_control()), >> so you need to make sure that the dist_ac is not used at the same >> time. >> >> A /very/ good idea is to spawn a process per app that becomes the >> controlling process, and then send that process simple commands >> like run/dont_run. The message passing interface to the OTP >> application controller is described in the comments. >> >> This second alternative is of course /very/ advanced. I'd personally >> recommend using gen_leader for a cluster controller (that was partly >> the original purpose for gen_leader). In fact, I and a few others are >> slowly working on such a cluster controller component. Don't hold your >> breath, though. >> >> BR, >> Ulf W > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From klacke@REDACTED Wed Dec 17 23:16:49 2008 From: klacke@REDACTED (Claes Wikstrom) Date: Wed, 17 Dec 2008 23:16:49 +0100 Subject: [erlang-questions] We are all hinduists Message-ID: <49497A51.90603@hyber.org> Erlang mentioned in the brilliant blog post http://www.aegisub.net/2008/12/if-programming-languages-were-religions.html referenced from slashdot http://entertainment.slashdot.org/article.pl?sid=08%2F12%2F17%2F1329209&from=rss /klacke From per.melin@REDACTED Wed Dec 17 23:19:52 2008 From: per.melin@REDACTED (Per Melin) Date: Wed, 17 Dec 2008 23:19:52 +0100 Subject: [erlang-questions] Interfacing Erlang to Oracle In-Reply-To: References: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> Message-ID: >> Can anyone shed any light on best practice for interfacing Erlang to >> an Oracle DBMS? > > ODBC works for me. I tried to get Erlang + Linux + ODBC + Oracle to work about six months ago, but it acted extremely flaky and I eventually gave up. It seemed like there was only one possible error message I could get: {error,"No SQL-driver information available."} I'd get that if any of a hundred different things in my conf was not perfect, or even if I was connected but had a syntax error in an SQL statement, or sometimes it would just show up randomly. For example would I sometimes get that error as the result of an insert, even when the insert was actually successful. From peter@REDACTED Tue Dec 16 19:20:54 2008 From: peter@REDACTED (Peter Sabaini) Date: Tue, 16 Dec 2008 19:20:54 +0100 Subject: [erlang-questions] distel completion? In-Reply-To: References: <200812161059.09337.peter@sabaini.at> <200812161436.58497.peter@sabaini.at> Message-ID: <200812161921.02130.peter@sabaini.at> On Tuesday 16 December 2008 16:08:58 Ahmed Ali wrote: > 2008/12/16 Peter Sabaini : > > On Tuesday 16 December 2008 13:55:28 you wrote: > >> In your .erlang file add your project's code path and it should work. > > > > I've got sth like this in my .erlang: > > > > code:add_patha("/home/sabaini/src/myproject"). > > I think you need to add distel's ebin code path here. For me, > completion works with all modules. Nope, still only works with built-in modules. Maybe I should add that I don't run the newest Erlang -- I've been lazy and just installed the one that is packaged for Ubuntu 8.10, R12B-3; don't know if it makes a difference. Thx, peter. > > -- ie. where my sources are. > > > > I get this error message at the erl shell when trying to complete one of > > my modules' start_link() fun: > > > > =ERROR REPORT==== 16-Dec-2008::14:24:33 === > > ** Generic server otp_doc terminating > > ** Last message in was {funcs,"delivery","start",[]} > > ** When Server state == {state,"/usr/lib/erlang",file,"-"} > > ** Reason for termination == > > ** {bad_return_value,no_data} > > > > As a variation I used add_pathz() instead, but no observable change. > > > > Should this work? > > > > Thanks, > > peter. > > > >> I also find flymake very helpful. Distel rocks! > >> > >> On Dec 16, 2008, at 4:59 AM, Peter Sabaini wrote: > >> > Hi, any distel users here? > >> > > >> > I'm new to distel and like it, one question though -- it seems > >> > distel only > >> > does completion on built-in libraries, is that correct? Is there a > >> > way to get > >> > it to complete my own code also? > >> > > >> > Thanks, > >> > peter. > >> > > >> > _______________________________________________ > >> > erlang-questions mailing list > >> > erlang-questions@REDACTED > >> > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part. URL: From mats.westin@REDACTED Wed Dec 17 23:40:06 2008 From: mats.westin@REDACTED (Mats Westin) Date: Wed, 17 Dec 2008 23:40:06 +0100 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: References: Message-ID: http://www.streamfile.com - File sharing, think http://rapidshare.com, http://tinyurl.com and streaming. Using Yaws 1.68. /Mats On Wed, Dec 17, 2008 at 1:07 AM, Daniel Cer wrote: > I'm building a wiki that documents what languages, frameworks, and > libraries are being used by various websites & webapps. One of the big > goals of the project is to highlight the diverse set of languages and > other components that people use to power their sites. > > Right now, I'm in the process of searching out and adding Erlang > webapps. So far, I've found about half a dozen apps (since it might be > of interest to some people here, the Erlang sites I've found are > posted at the bottom of this e-mail). > > Does anyone here have an Erlang powered website or webapp? If you do, > would you mind sharing the URL and what other support components > you're using (e.g, ErlyWeb, Erlang-Web, MochiWeb, Mnesia, etc.)? > > Thanks, Dan > > The current list of Erlang powered sites: > > Beer Riot - Community beer review and enthusiast site. > http://beerriot.com/ > > Vimagi - Social/collaborative painting site > http://vimagi.com/ > > Twoorl - A twitter like micro-blogging service > http://twoorl.com/ > > MochiBot ? Flash tracking and monitoring service > http://www.mochibot.com/ > > Mochiads ? Flash game advertising and distribution service > http://www.mochiads.com/ > > DayFindr - Collaborative scheduling webapp > http://www.dayfindr.com/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- http://www.linkedin.com/in/matswestin -------------- next part -------------- An HTML attachment was scrubbed... URL: From stondage123@REDACTED Wed Dec 17 23:44:34 2008 From: stondage123@REDACTED (Andrew Stone) Date: Wed, 17 Dec 2008 14:44:34 -0800 (PST) Subject: [erlang-questions] Interfacing Erlang to Oracle References: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> Message-ID: <143488.27693.qm@web35908.mail.mud.yahoo.com> Same here. I had very weird issues. Sadly, I ended up using C++ code as a port. -Andrew ----- Original Message ---- From: Per Melin To: erlang-questions@REDACTED Sent: Wednesday, December 17, 2008 5:19:52 PM Subject: Re: [erlang-questions] Interfacing Erlang to Oracle >> Can anyone shed any light on best practice for interfacing Erlang to >> an Oracle DBMS? > > ODBC works for me. I tried to get Erlang + Linux + ODBC + Oracle to work about six months ago, but it acted extremely flaky and I eventually gave up. It seemed like there was only one possible error message I could get: {error,"No SQL-driver information available."} I'd get that if any of a hundred different things in my conf was not perfect, or even if I was connected but had a syntax error in an SQL statement, or sometimes it would just show up randomly. For example would I sometimes get that error as the result of an insert, even when the insert was actually successful. _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From michael.regen@REDACTED Thu Dec 18 00:03:48 2008 From: michael.regen@REDACTED (Michael Regen) Date: Thu, 18 Dec 2008 00:03:48 +0100 Subject: [erlang-questions] Interfacing Erlang to Oracle In-Reply-To: <143488.27693.qm@web35908.mail.mud.yahoo.com> References: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> <143488.27693.qm@web35908.mail.mud.yahoo.com> Message-ID: <9b59d0270812171503i101d2c48q5c62c1ab258a2149@mail.gmail.com> I wished we had edbc. ODBC is barbarism. -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseph.stewart@REDACTED Thu Dec 18 01:05:09 2008 From: joseph.stewart@REDACTED (Joseph Stewart) Date: Wed, 17 Dec 2008 19:05:09 -0500 Subject: [erlang-questions] Interfacing Erlang to Oracle In-Reply-To: <9b59d0270812171503i101d2c48q5c62c1ab258a2149@mail.gmail.com> References: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> <143488.27693.qm@web35908.mail.mud.yahoo.com> <9b59d0270812171503i101d2c48q5c62c1ab258a2149@mail.gmail.com> Message-ID: <2781f020812171605u14be353m32b208a63bd13532@mail.gmail.com> I'll broach the topic again... The project "sql relay" might be decent middleware to target. It gives a consistent interface to the following databases: - Oracle - MySQL - mSQL - PostgreSQL - Sybase - MS SQL Server - IBM DB2 - Interbase - Sybase - SQLite - ODBC - MS Access In addition, it provides an API to access any of the about databases using a drop-in replacement library in the style of either MySQL or PostgreSQL. Is there any interest in pursuing this instead of ODBC? -joe 2008/12/17 Michael Regen > I wished we had edbc. ODBC is barbarism. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ossareh@REDACTED Thu Dec 18 01:56:02 2008 From: ossareh@REDACTED (Michael Ossareh) Date: Wed, 17 Dec 2008 16:56:02 -0800 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: References: Message-ID: heysan use erlang! ejabberd gateways to MSN / AIM / Yahoo / GTalk (we didn't do s2s here) / MySpace / ICQ we're also converting our jabber client (currently java) to use erlang for the jabber coms part and use java for the in memory storage of our users sessions (ongoing conversations, etc). We're using jinterface to make java an erlang node. 2008/12/17 Mats Westin : > http://www.streamfile.com - File sharing, think http://rapidshare.com, > http://tinyurl.com and streaming. > > Using Yaws 1.68. > > /Mats > > On Wed, Dec 17, 2008 at 1:07 AM, Daniel Cer wrote: >> >> I'm building a wiki that documents what languages, frameworks, and >> libraries are being used by various websites & webapps. One of the big >> goals of the project is to highlight the diverse set of languages and >> other components that people use to power their sites. >> >> Right now, I'm in the process of searching out and adding Erlang >> webapps. So far, I've found about half a dozen apps (since it might be >> of interest to some people here, the Erlang sites I've found are >> posted at the bottom of this e-mail). >> >> Does anyone here have an Erlang powered website or webapp? If you do, >> would you mind sharing the URL and what other support components >> you're using (e.g, ErlyWeb, Erlang-Web, MochiWeb, Mnesia, etc.)? >> >> Thanks, Dan >> >> The current list of Erlang powered sites: >> >> Beer Riot - Community beer review and enthusiast site. >> http://beerriot.com/ >> >> Vimagi - Social/collaborative painting site >> http://vimagi.com/ >> >> Twoorl - A twitter like micro-blogging service >> http://twoorl.com/ >> >> MochiBot ? Flash tracking and monitoring service >> http://www.mochibot.com/ >> >> Mochiads ? Flash game advertising and distribution service >> http://www.mochiads.com/ >> >> DayFindr - Collaborative scheduling webapp >> http://www.dayfindr.com/ >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > > -- > http://www.linkedin.com/in/matswestin > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- god loves atheists, Fact: http://www.mrwiggleslovesyou.com/comics/rehab477.jpg From rvirding@REDACTED Thu Dec 18 02:46:31 2008 From: rvirding@REDACTED (Robert Virding) Date: Thu, 18 Dec 2008 02:46:31 +0100 Subject: [erlang-questions] "-define" in lfe? In-Reply-To: <91a2ba3e0812162347w50bcd755p7b2bee5269a09eda@mail.gmail.com> References: <91a2ba3e0812160924r3f443cb0r53a02ddeb551d240@mail.gmail.com> <3dbc6d1c0812161342y4ff2849dwc2599bc6d80e004e@mail.gmail.com> <91a2ba3e0812162237g1b20bedbtba7375da065b15b2@mail.gmail.com> <91a2ba3e0812162315p37d8921bif94d02f24c78c58@mail.gmail.com> <3dbc6d1c0812162341x6d598211tac587edd27ba956a@mail.gmail.com> <91a2ba3e0812162347w50bcd755p7b2bee5269a09eda@mail.gmail.com> Message-ID: <3dbc6d1c0812171746x714a6ca2x85a58ec6796f9d42@mail.gmail.com> Hello, 2008/12/17 Raoul Duke > > i haven't had any insights into getting the lfe shell working, but > using lfe_comp:file() in the erl shell works just fine :-) > That's weird. I have a private erlang library for my stuff in ~/erlang/lib with directories: ~/erlang/lib/lfe/ebin ~/erlang/lib/erlog/ebin ~/erlang/lib/leex/ebin ~/erlang/lib/leex/include and I point the environment variable ERL_LIBS to it by export ERL_LIBS=~/erlang/lib and everything works. I think it is strange that it can find erl_comp but not erl_boot. I hope you can have some with it in spite of this. :-) Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From monch1962@REDACTED Thu Dec 18 03:33:58 2008 From: monch1962@REDACTED (David Mitchell) Date: Thu, 18 Dec 2008 13:33:58 +1100 Subject: [erlang-questions] Interfacing Erlang to Oracle In-Reply-To: <2781f020812171605u14be353m32b208a63bd13532@mail.gmail.com> References: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> <143488.27693.qm@web35908.mail.mud.yahoo.com> <9b59d0270812171503i101d2c48q5c62c1ab258a2149@mail.gmail.com> <2781f020812171605u14be353m32b208a63bd13532@mail.gmail.com> Message-ID: I'm interested in the idea of "sql relay", but have never dug into the guts of database interfaces before and probably don't have a lot of time to devote to it. However, if I can help out in some way (maybe documentation?), I'm in. Regards Dave M. 2008/12/18 Joseph Stewart : > I'll broach the topic again... > The project "sql relay" might be decent middleware to target. > It gives a consistent interface to the following databases: > > Oracle > MySQL > mSQL > PostgreSQL > > Sybase > MS SQL Server > IBM DB2 > Interbase > > Sybase > SQLite > ODBC > > MS Access > > In addition, it provides an API to access any of the about databases using a > drop-in replacement library in the style of either MySQL or PostgreSQL. > Is there any interest in pursuing this instead of ODBC? > -joe > 2008/12/17 Michael Regen >> >> I wished we had edbc. ODBC is barbarism. >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From jed@REDACTED Thu Dec 18 03:57:23 2008 From: jed@REDACTED (Jed McCaleb) Date: Wed, 17 Dec 2008 21:57:23 -0500 Subject: [erlang-questions] ODBC library - link check failed Message-ID: Hi I'm trying to install erlang on CentOS cat /proc/version Linux version 2.6.18-92.1.17.el5 (mockbuild@REDACTED) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)) #1 SMP . I get: ********************************************************************* ********************** APPLICATIONS DISABLED ********************** ********************************************************************* jinterface : No Java compiler found odbc : ODBC library - link check failed ********************************************************************* after I run ./configure ODBC is installed on the system and isql connects to my DB fine. Any idea what I can do to get odbc to work? Thanks, Jed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.cer@REDACTED Thu Dec 18 04:34:56 2008 From: daniel.cer@REDACTED (Daniel Cer) Date: Wed, 17 Dec 2008 19:34:56 -0800 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: References: Message-ID: On Tue, Dec 16, 2008 at 4:07 PM, Daniel Cer wrote: > > Does anyone here have an Erlang powered website or webapp? If you do, > would you mind sharing the URL and what other support components > you're using (e.g, ErlyWeb, Erlang-Web, MochiWeb, Mnesia, etc.)? > > Thanks. The responses so far have been great. Any other sites that could be listed? It doesn't have to be anything big, small personal projects are just fine. Also, would anybody mind if I listed their name with their site? This would just be your name (e.g., 'Michael McDaniel'), and not your e-mail address. -Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt@REDACTED Thu Dec 18 08:19:09 2008 From: pablo.platt@REDACTED (Pablo Platt) Date: Wed, 17 Dec 2008 23:19:09 -0800 (PST) Subject: [erlang-questions] compile a module against a different otp minor version References: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> <925837.57030.qm@web110009.mail.gq1.yahoo.com> Message-ID: <900757.4250.qm@web110006.mail.gq1.yahoo.com> Thank you both for the answers. ________________________________ From: Kenneth Lundin To: Pablo Platt Cc: erlang-questions@REDACTED Sent: Wednesday, December 17, 2008 6:26:12 PM Subject: Re: [erlang-questions] compile a module against a different otp minor version Hi, Here is a repetition of an answer I gave about a year ago. The safe assumption that we design and test for as good we can is that a .beam file compiled with the release including erts-5.5.3 will run on all forthcoming 5.5.x (x > 3) releases and even on 5.6.x releases if we don't explicitly state otherwise. But note, that even if a .beam file produced with an erts-5.5.x (R11B something) system works on a erts-5.6.x (R12B something) system it might not run as efficient as the same .beam file produced with an erts-5.6 system. Because of this I would recommend that you build new .beam files when there is a new major release. It is actually both the erts version and the compiler version that is importan when it comes to compatibility. Even if it works in most cases I would not say that is a 100% safe assumption to say that a .beam file produced with a newer release will run without problems on an older release. It may hold for one module but maybe not for another depending on the contents of the module. Our strategy is to be compatible with at least one older major version. R11B can run code from R9C and R10B within a major release like R11B .beam files produced by a release say R11B-0 can always be run by systems R11B-1 and newer. /Kenneth (Erlang/OTP team at Ericsson) 2008/12/17 Pablo Platt : > Hi, > > Is it possible to compile a module against a different minor otp version > that the one the module is going to run in? > For example, if I have R12B-3 can I run a module compiled using R12B-5? > > How can I find out the minor version of the OTP? > I've tried both: > erlang:system_info(otp_release). > init:script_id(). > > but they only reveal R12B. > > Thanks > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemenkov@REDACTED Thu Dec 18 08:48:28 2008 From: lemenkov@REDACTED (Peter Lemenkov) Date: Thu, 18 Dec 2008 10:48:28 +0300 Subject: [erlang-questions] ODBC library - link check failed In-Reply-To: References: Message-ID: Hello! 2008/12/18 Jed McCaleb : > Hi I'm trying to install erlang on CentOS Why not to try precompiled package from EPEL? -- With best regards! From rvirding@REDACTED Thu Dec 18 10:54:00 2008 From: rvirding@REDACTED (Robert Virding) Date: Thu, 18 Dec 2008 10:54:00 +0100 Subject: [erlang-questions] "-define" in lfe? In-Reply-To: <3dbc6d1c0812171746x714a6ca2x85a58ec6796f9d42@mail.gmail.com> References: <91a2ba3e0812160924r3f443cb0r53a02ddeb551d240@mail.gmail.com> <3dbc6d1c0812161342y4ff2849dwc2599bc6d80e004e@mail.gmail.com> <91a2ba3e0812162237g1b20bedbtba7375da065b15b2@mail.gmail.com> <91a2ba3e0812162315p37d8921bif94d02f24c78c58@mail.gmail.com> <3dbc6d1c0812162341x6d598211tac587edd27ba956a@mail.gmail.com> <91a2ba3e0812162347w50bcd755p7b2bee5269a09eda@mail.gmail.com> <3dbc6d1c0812171746x714a6ca2x85a58ec6796f9d42@mail.gmail.com> Message-ID: <3dbc6d1c0812180154rb348b40g89020b03f2e32afc@mail.gmail.com> 2008/12/18 Robert Virding > and everything works. I think it is strange that it can find erl_comp but > not erl_boot. > I hope you can have some with it in spite of this. :-) "Have some *fun* with it" I meant to write. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela@REDACTED Thu Dec 18 11:49:18 2008 From: ingela@REDACTED (Ingela Anderton Andin) Date: Thu, 18 Dec 2008 11:49:18 +0100 Subject: [erlang-questions] Interfacing Erlang to Oracle In-Reply-To: References: Message-ID: <494A2AAE.2060806@erix.ericsson.se> >>> Can anyone shed any light on best practice for interfacing Erlang to >>> an Oracle DBMS? >>> >> ODBC works for me. >> > > I tried to get Erlang + Linux + ODBC + Oracle to work about six months > ago, but it acted extremely flaky and I eventually gave up. > > It seemed like there was only one possible error message I could get: > {error,"No SQL-driver information available."} > > I'd get that if any of a hundred different things in my conf was not > perfect, or even if I was connected but had a syntax error in an SQL > statement, or sometimes it would just show up randomly. For example > would I sometimes get that error as the result of an insert, even when > the insert was actually successful. > > Erlang odbc will return the message {error,"No SQL-driver information available."} when ever a call to the odbc-driver fails or returns something unexpected and the driver is not polite enough to provide any information to what might have gone wrong. So how often you get that depends very much on your driver. The odbc standard will also some times be a little vague leaving room for different drivers to behave differently in the same situation this has caused some problems where an error message has been returned even though all is well. Alas we do not have the time or financing to test all available odbc-drivers. The best driver in my experience is Microsofts driver for sql-server, no big surprise as odbc is a Microsoft standard. We mainly use unixodbc for testing on linux/unix and it works well for us. Also in my experience many odbc-drivers for linux are based on an old version of the standard and because of that you have to disable scrollable cursors if you want to make it work. If anybody finds an issue with there driver and a solution for it they are welcome to submit a patch-suggestion. Regards Ingela Erlang/OTP - Ericsson From peter@REDACTED Thu Dec 18 12:13:12 2008 From: peter@REDACTED (Peter Sabaini) Date: Thu, 18 Dec 2008 12:13:12 +0100 Subject: [erlang-questions] distel completion? In-Reply-To: References: <200812161059.09337.peter@sabaini.at> <200812161921.02130.peter@sabaini.at> Message-ID: <200812181213.18768.peter@sabaini.at> Hi, mats has fixed a bug yesterday that triggered the symptoms I described, works great now. Its in distels' svn HEAD. Thanks for all the help! peter. On Thursday 18 December 2008 02:07:46 Robert Dionne wrote: > sorry I'm just getting to this again. > > Here's what I have in my .erlang: > > code:add_pathz("/Users/bitdiddle/emacs/site-lisp/distel/ebin") > > so erlang knows about distel. One then adds other paths as needed. I > typically run erlang in an emacs shell (OS X 10.4, Aquamacs) and pass > in "-sname foo" so that I can connect distel to a named node. This > part must be working if you're seeing some completion. > > Oh and I also ran into a nasty issue getting the symbolic debugger > working. I ended up pulling a specific version of distel to address > this: > > svn co -r {2007-07-01} http://distel.googlecode.com/svn/trunk/ distel > > Well that's all I know. When you solve it post it so I can add it to > my bits file > > On Dec 16, 2008, at 1:20 PM, Peter Sabaini wrote: > > On Tuesday 16 December 2008 16:08:58 Ahmed Ali wrote: > >> 2008/12/16 Peter Sabaini : > >>> On Tuesday 16 December 2008 13:55:28 you wrote: > >>>> In your .erlang file add your project's code path and it should > >>>> work. > >>> > >>> I've got sth like this in my .erlang: > >>> > >>> code:add_patha("/home/sabaini/src/myproject"). > >> > >> I think you need to add distel's ebin code path here. For me, > >> completion works with all modules. > > > > Nope, still only works with built-in modules. > > > > Maybe I should add that I don't run the newest Erlang -- I've been > > lazy and > > just installed the one that is packaged for Ubuntu 8.10, R12B-3; > > don't know if > > it makes a difference. > > > > Thx, > > peter. > > > >>> -- ie. where my sources are. > >>> > >>> I get this error message at the erl shell when trying to complete > >>> one of > >>> my modules' start_link() fun: > >>> > >>> =ERROR REPORT==== 16-Dec-2008::14:24:33 === > >>> ** Generic server otp_doc terminating > >>> ** Last message in was {funcs,"delivery","start",[]} > >>> ** When Server state == {state,"/usr/lib/erlang",file,"-"} > >>> ** Reason for termination == > >>> ** {bad_return_value,no_data} > >>> > >>> As a variation I used add_pathz() instead, but no observable change. > >>> > >>> Should this work? > >>> > >>> Thanks, > >>> peter. > >>> > >>>> I also find flymake very helpful. Distel rocks! > >>>> > >>>> On Dec 16, 2008, at 4:59 AM, Peter Sabaini wrote: > >>>>> Hi, any distel users here? > >>>>> > >>>>> I'm new to distel and like it, one question though -- it seems > >>>>> distel only > >>>>> does completion on built-in libraries, is that correct? Is there a > >>>>> way to get > >>>>> it to complete my own code also? > >>>>> > >>>>> Thanks, > >>>>> peter. > >>>>> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part. URL: From erik.reitsma@REDACTED Thu Dec 18 12:45:17 2008 From: erik.reitsma@REDACTED (Erik Reitsma) Date: Thu, 18 Dec 2008 12:45:17 +0100 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: References: Message-ID: <110BA8ACEE682C479D0B008B6BE4AEB107A7A9C2@esealmw107.eemea.ericsson.se> I have witten an interactive website, called DEM-DISC in english, www.dementiewijzer.nl in dutch. It is off-line now, and not available to the public. It provides personalized information for informal carers for people with dementia. An english abstract of a paper about DEM-DISC can be found here: http://conferences.icmcc.org/?p=1843 It has been used in a trial with informal carers. The server uses Yaws, the client is written in Javascript with DoJo. It uses Ajax with long-lived requests. *Erik. ________________________________ From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Daniel Cer Sent: Thursday, December 18, 2008 4:35 AM To: erlang-questions@REDACTED Subject: Re: [erlang-questions] What websites/webapps use Erlang? On Tue, Dec 16, 2008 at 4:07 PM, Daniel Cer wrote: Does anyone here have an Erlang powered website or webapp? If you do, would you mind sharing the URL and what other support components you're using (e.g, ErlyWeb, Erlang-Web, MochiWeb, Mnesia, etc.)? Thanks. The responses so far have been great. Any other sites that could be listed? It doesn't have to be anything big, small personal projects are just fine. Also, would anybody mind if I listed their name with their site? This would just be your name (e.g., 'Michael McDaniel'), and not your e-mail address. -Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From atulindore2@REDACTED Thu Dec 18 13:34:03 2008 From: atulindore2@REDACTED (atul goyal) Date: Thu, 18 Dec 2008 18:04:03 +0530 Subject: [erlang-questions] curious Message-ID: hi ppl ive been learning erlang for some time now. I was wondering how to access oracle from erlang using the OCI library. I found that it requires drivers. So i made port drivers in 'c'. With my driver i was able to get some definite speed of transactions. Is it really possible to increase the speed of transactions if multiple instances of this port driver are used. As far as i understand open_port will instantiate the driver. and shud i use multi threading inside the C driver itself? thanks a lottttttt atul goyal pyro -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Thu Dec 18 13:42:35 2008 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 18 Dec 2008 12:42:35 +0000 Subject: [erlang-questions] wrapping ss7 in a linked-in driver Message-ID: <7B2386E2-D77C-4058-B93F-7351C6CA64DA@gmail.com> Has anyone wrapped SS7 (MAP ETSI) in a linked-in driver? Any issues to watch out for? I'm actually looking to write a code generator to do this auto- magically. Thanks, Joel -- http://wagerlabs.com From nc@REDACTED Thu Dec 18 14:12:53 2008 From: nc@REDACTED (Nicolas Charpentier) Date: Thu, 18 Dec 2008 14:12:53 +0100 Subject: [erlang-questions] curious In-Reply-To: References: Message-ID: <494A4C55.2000409@charpi.net> atul goyal wrote: > hi ppl > ive been learning erlang for some time now. I was wondering how to > access oracle from erlang using the OCI library. I found that it > requires drivers. So i made port drivers in 'c'. With my driver i was > able to get some definite speed of transactions. Is it really possible > to increase the speed of transactions if multiple instances of this port > driver are used. As far as i understand open_port will instantiate the > driver. and shud i use multi threading inside the C driver itself? > thanks a lottttttt Hi, you can call open_port several times and get several 'driver instances'. open_port returns the pid of the driver and you only have to send messages to that pid to use port. Regards ---- Nicolas Charpentier http://charpi.net From pfisher@REDACTED Thu Dec 18 13:41:31 2008 From: pfisher@REDACTED (Paul Fisher) Date: Thu, 18 Dec 2008 06:41:31 -0600 Subject: [erlang-questions] : driver_entry stop() and driver_async() interaction In-Reply-To: <20081107104759.GA1287@erix.ericsson.se> References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> Message-ID: <494A44FB.5030309@alertlogic.net> Any word on this? Raimo Niskanen wrote: > On Thu, Nov 06, 2008 at 12:22:45PM -0600, Paul Fisher wrote: >> Can anyone comment on this question i sent a few weeks ago? >> >> When the port owner terminates and there are driver_async() requests >> scheduled and not yet executed, I am seeing them outstanding at the time >> of the stop() callback. > > We will take a look at it and make it clear in some > documentation and give you an answer. It will take a bit of > code review to be certain... > >> >> Paul Fisher wrote: >>> Question about work scheduled on async threads via driver_async() and >>> still pending (i.e. they are still on the queue to be executed,) when >>> the stop() callback is invoked. Specifically, assuming smp w/async >>> thread pool and the driver marked ERL_DRV_FLAG_USE_PORT_LOCKING. >>> >>> Is it the responsibility of the code in the stop() callback to call >>> driver_async_cancel() on each outstanding async work item, or will this >>> be done automatically by the emulator before the call to stop()? >>> >>> If this is the responsibility of the code in stop(), is it guaranteed >>> that no async work item will be executing or scheduled during the call >>> to the stop() callback? >>> >>> If no guarantee is made, is holding the PDL necessary and sufficient to >>> guarantee this? >> >> -- >> paul >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > From ppolv@REDACTED Thu Dec 18 15:24:16 2008 From: ppolv@REDACTED (Pablo Polvorin) Date: Thu, 18 Dec 2008 11:24:16 -0300 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: <110BA8ACEE682C479D0B008B6BE4AEB107A7A9C2@esealmw107.eemea.ericsson.se> References: <110BA8ACEE682C479D0B008B6BE4AEB107A7A9C2@esealmw107.eemea.ericsson.se> Message-ID: <1ffe809c0812180624x74ab8d42k6c26de36b1d97363@mail.gmail.com> we built www.imtrends.com using erlang for both the web interface and the crawler engine backend. yaws + sgte + ejabberd + postgresql. From dizzyd@REDACTED Thu Dec 18 15:36:34 2008 From: dizzyd@REDACTED (Dave Smith) Date: Thu, 18 Dec 2008 07:36:34 -0700 Subject: [erlang-questions] : driver_entry stop() and driver_async() interaction In-Reply-To: <494A44FB.5030309@alertlogic.net> References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> <494A44FB.5030309@alertlogic.net> Message-ID: >>>> Is it the responsibility of the code in the stop() callback to call >>>> driver_async_cancel() on each outstanding async work item, or will this >>>> be done automatically by the emulator before the call to stop()? Yes, it is up to the driver to cancel outstanding items. In wrestling with this recently, I found that the best approach was to cancel all the items and then queue up a sentinel callback that triggers a condition variable. I then wait for that cv to get signaled and know at that point that the driver is clear to shutdown. This approach seemed to work quite well on a 8 proc box with reasonable load -- YMMV. :) >>>> If this is the responsibility of the code in stop(), is it guaranteed >>>> that no async work item will be executing or scheduled during the call >>>> to the stop() callback? >>>> >>>> If no guarantee is made, is holding the PDL necessary and sufficient to >>>> guarantee this? I researched this, and I believe that the answer is "no". Scheduling the async work item does increment the PDL ref count when the item is _inserted_ into the queue. Once the item is in the queue, all bets are off -- the only guarantee you have is that the PDL won't disappear (i.e. you can safely lock/unlock it). The PDL says nothing about whether or not the async work item is executing during stop(). It seems to be the responsibility of the driver author to sort out these intricate timing issues. erts/emulator/beam/erl_async.c is where all the code of interest resides. It's entirely possible that I have made gross errors in my reading of the emulator code and would happily receive instruction from one of the core VM team. :) D. From dmitrii@REDACTED Thu Dec 18 16:06:10 2008 From: dmitrii@REDACTED (Dmitrii Dimandt) Date: Thu, 18 Dec 2008 17:06:10 +0200 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: References: Message-ID: --On December 16, 2008 4:07:49 PM -0800 Daniel Cer wrote: > I'm building a wiki that documents what languages, frameworks, and > libraries are being used by various websites & webapps. One of the big > goals of the project is to highlight the diverse set of languages and > other components that people use to power their sites. > Not a site per se, but I use it for internal/personal note-keeping: http://noe.dmitriid.com/ Yaws+ErlyWeb+MySQL From dizzyd@REDACTED Thu Dec 18 16:08:06 2008 From: dizzyd@REDACTED (Dave Smith) Date: Thu, 18 Dec 2008 08:08:06 -0700 Subject: [erlang-questions] : driver_entry stop() and driver_async() interaction In-Reply-To: References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> <494A44FB.5030309@alertlogic.net> Message-ID: One other note...I eventually wrote my own thread pool/queue for load balancing purposes. async_* can cause the load to be very spiky if you can not predict the amount of time a queued operation might take (which is usually the point of using threads...). I think it would be _great_ if the VM/driver interface provided a more traditional thread pool/queue API in addition to the existing async functionality. I know of several Erlang drivers that have had to write their own and it can be a very challenging problem to get right. :) D. On Thu, Dec 18, 2008 at 7:36 AM, Dave Smith wrote: >>>>> Is it the responsibility of the code in the stop() callback to call >>>>> driver_async_cancel() on each outstanding async work item, or will this >>>>> be done automatically by the emulator before the call to stop()? > > Yes, it is up to the driver to cancel outstanding items. In wrestling > with this recently, I found that the best approach was to cancel all > the items and then queue up a sentinel callback that triggers a > condition variable. I then wait for that cv to get signaled and know > at that point that the driver is clear to shutdown. This approach > seemed to work quite well on a 8 proc box with reasonable load -- > YMMV. :) > >>>>> If this is the responsibility of the code in stop(), is it guaranteed >>>>> that no async work item will be executing or scheduled during the call >>>>> to the stop() callback? >>>>> >>>>> If no guarantee is made, is holding the PDL necessary and sufficient to >>>>> guarantee this? > > I researched this, and I believe that the answer is "no". Scheduling > the async work item does increment the PDL ref count when the item is > _inserted_ into the queue. Once the item is in the queue, all bets are > off -- the only guarantee you have is that the PDL won't disappear > (i.e. you can safely lock/unlock it). The PDL says nothing about > whether or not the async work item is executing during stop(). It > seems to be the responsibility of the driver author to sort out these > intricate timing issues. > > erts/emulator/beam/erl_async.c is where all the code of interest resides. > > It's entirely possible that I have made gross errors in my reading of > the emulator code and would happily receive instruction from one of > the core VM team. :) > > D. > From raimo+erlang-questions@REDACTED Thu Dec 18 16:54:26 2008 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 18 Dec 2008 16:54:26 +0100 Subject: [erlang-questions] : : driver_entry stop() and driver_async() interaction In-Reply-To: <494A44FB.5030309@alertlogic.net> References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> <494A44FB.5030309@alertlogic.net> Message-ID: <20081218155426.GC23981@erix.ericsson.se> On Thu, Dec 18, 2008 at 06:41:31AM -0600, Paul Fisher wrote: > Any word on this? Sorry, no. I will try to summon an internal meeting about this... > > > Raimo Niskanen wrote: > > On Thu, Nov 06, 2008 at 12:22:45PM -0600, Paul Fisher wrote: > >> Can anyone comment on this question i sent a few weeks ago? > >> > >> When the port owner terminates and there are driver_async() requests > >> scheduled and not yet executed, I am seeing them outstanding at the time > >> of the stop() callback. > > > > We will take a look at it and make it clear in some > > documentation and give you an answer. It will take a bit of > > code review to be certain... > > > >> > >> Paul Fisher wrote: > >>> Question about work scheduled on async threads via driver_async() and > >>> still pending (i.e. they are still on the queue to be executed,) when > >>> the stop() callback is invoked. Specifically, assuming smp w/async > >>> thread pool and the driver marked ERL_DRV_FLAG_USE_PORT_LOCKING. > >>> > >>> Is it the responsibility of the code in the stop() callback to call > >>> driver_async_cancel() on each outstanding async work item, or will this > >>> be done automatically by the emulator before the call to stop()? > >>> > >>> If this is the responsibility of the code in stop(), is it guaranteed > >>> that no async work item will be executing or scheduled during the call > >>> to the stop() callback? > >>> > >>> If no guarantee is made, is holding the PDL necessary and sufficient to > >>> guarantee this? > >> > >> -- > >> paul > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Thu Dec 18 16:55:58 2008 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 18 Dec 2008 16:55:58 +0100 Subject: [erlang-questions] : : driver_entry stop() and driver_async() interaction In-Reply-To: References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> <494A44FB.5030309@alertlogic.net> Message-ID: <20081218155558.GD23981@erix.ericsson.se> On Thu, Dec 18, 2008 at 08:08:06AM -0700, Dave Smith wrote: > One other note...I eventually wrote my own thread pool/queue for load > balancing purposes. async_* can cause the load to be very spiky if you > can not predict the amount of time a queued operation might take > (which is usually the point of using threads...). I think it would be > _great_ if the VM/driver interface provided a more traditional thread > pool/queue API in addition to the existing async functionality. I know > of several Erlang drivers that have had to write their own and it can > be a very challenging problem to get right. :) Aggreed. It has been on the Future Plans list forever. Using async thread for e.g prime number calculations will today block random file operations... > > D. > > On Thu, Dec 18, 2008 at 7:36 AM, Dave Smith wrote: > >>>>> Is it the responsibility of the code in the stop() callback to call > >>>>> driver_async_cancel() on each outstanding async work item, or will this > >>>>> be done automatically by the emulator before the call to stop()? > > > > Yes, it is up to the driver to cancel outstanding items. In wrestling > > with this recently, I found that the best approach was to cancel all > > the items and then queue up a sentinel callback that triggers a > > condition variable. I then wait for that cv to get signaled and know > > at that point that the driver is clear to shutdown. This approach > > seemed to work quite well on a 8 proc box with reasonable load -- > > YMMV. :) > > > >>>>> If this is the responsibility of the code in stop(), is it guaranteed > >>>>> that no async work item will be executing or scheduled during the call > >>>>> to the stop() callback? > >>>>> > >>>>> If no guarantee is made, is holding the PDL necessary and sufficient to > >>>>> guarantee this? > > > > I researched this, and I believe that the answer is "no". Scheduling > > the async work item does increment the PDL ref count when the item is > > _inserted_ into the queue. Once the item is in the queue, all bets are > > off -- the only guarantee you have is that the PDL won't disappear > > (i.e. you can safely lock/unlock it). The PDL says nothing about > > whether or not the async work item is executing during stop(). It > > seems to be the responsibility of the driver author to sort out these > > intricate timing issues. > > > > erts/emulator/beam/erl_async.c is where all the code of interest resides. > > > > It's entirely possible that I have made gross errors in my reading of > > the emulator code and would happily receive instruction from one of > > the core VM team. :) > > > > D. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From justin@REDACTED Thu Dec 18 17:22:10 2008 From: justin@REDACTED (Justin Sheehy) Date: Thu, 18 Dec 2008 11:22:10 -0500 Subject: [erlang-questions] Geographical distribution of Erlang programmers In-Reply-To: <20918802.post@talk.nabble.com> Message-ID: Cambridge MA has worked out pretty well so far. -Justin On 12/9/08 12:00 PM, "Zvi" wrote: > I want to know the geographical distribution of Erlang programmers. > In other words: "If you going to open Erlang shop, where is the best place > to do it?". From jed@REDACTED Thu Dec 18 17:34:53 2008 From: jed@REDACTED (Jed McCaleb) Date: Thu, 18 Dec 2008 11:34:53 -0500 Subject: [erlang-questions] ODBC library - link check failed In-Reply-To: References: Message-ID: Well that installs erlang fine but odbc still wont load. 7> odbc:start(). ** exception error: undefined function odbc:start/0 8> application:load(odbc). {error,{"no such file or directory","odbc.app"}} odbc.app is there at: /usr/lib/erlang/lib/odbc-2.10.2/ebin/odbc.app any ideas? Thanks, Jed. On Thu, Dec 18, 2008 at 2:48 AM, Peter Lemenkov wrote: > Hello! > > 2008/12/18 Jed McCaleb : > > Hi I'm trying to install erlang on CentOS > > Why not to try precompiled package from EPEL? > -- > With best regards! > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alustenberg@REDACTED Thu Dec 18 18:09:36 2008 From: alustenberg@REDACTED (Alex) Date: Thu, 18 Dec 2008 12:09:36 -0500 Subject: [erlang-questions] curious In-Reply-To: References: Message-ID: <915e7e1d0812180909m6affd04cp9b886035e5d64b0d@mail.gmail.com> As Mr Charpentier mentioned, you can open multiple instances of a C driver for connection concurrency. Introducing threading into an Erlang port is sort of like taking a step forward (using erlang) and 3 steps back (using pthreads..). KISS, and let Erlang handle all the messy parts. 2008/12/18 atul goyal : > and shud i use multi > threading inside the C driver itself? > thanks a lottttttt > atul goyal > pyro From raould@REDACTED Thu Dec 18 19:21:17 2008 From: raould@REDACTED (Raoul Duke) Date: Thu, 18 Dec 2008 10:21:17 -0800 Subject: [erlang-questions] added LFE wiki page Message-ID: <91a2ba3e0812181021m1de9ff7ex2cd87bfbc9390e04@mail.gmail.com> hi, i just added http://www.trapexit.org/Lisp_Flavoured_Erlang please feel free to dive in and add / fix :-) sincerely. From erlang@REDACTED Thu Dec 18 19:23:55 2008 From: erlang@REDACTED (Andreas Stenius) Date: Thu, 18 Dec 2008 19:23:55 +0100 Subject: [erlang-questions] ct_cover broken when using packages In-Reply-To: <8fa878b90812160533u767d1e7eqcac4e6ff42895b62@mail.gmail.com> References: <8fa878b90812151616s4bb2a9bby94c5c2d4a43f7492@mail.gmail.com> <8fa878b90812160533u767d1e7eqcac4e6ff42895b62@mail.gmail.com> Message-ID: <29425027.31229624637574.JavaMail.Andreas@HP-slim> Hi Tim, Thanks for the tip of using import in this case, for some reason I hadn't thought of it.. Best regards, Andreas ----- Original Message ----- From: "Tim Watson" To: "Andreas Stenius" Cc: Sent: Tuesday, December 16, 2008 2:33 PM Subject: Re: [erlang-questions] ct_cover broken when using packages > Hi Andreas, > > Yeah the package system implementation isn't ideal - not even make:all > will work unless you write (or generate) an Emakefile which specifies > each of the source directories explicitly. You shouldn't have to do > this sort of thing, it should "just work" imho. > > We do use packages, because our applications are packaged (and > released) both as discrete Erlang/OTP releases and as components > (depending on the needs of the target environment in question), so we > would end up with names like > 'bss_billing_dispatch_control_routing_server' which is something I'm > just not willing to type! :) > > The work around is to include an import for 'ets' in your modules, > which if you're averse to including in the production code (although > it doesn't really matter in reality), can be stripped out using cpp or > the like: > > -module(a.module.with.a.long.package.name). > %% some *real* imports/directives/etc > > -import(ets). %% hack to keep cover happy > > This works, but I'd like to see it fixed nonetheless. > > > On 16/12/2008, Andreas Stenius wrote: >> Hi, >> >> I've run into similar problems when using packages, when including for >> instance the eunit.hrl file, which has defines that will run into the >> same >> problem of referring to global packages without the needed leading dot. >> >> In my opinion, the package system is broken, in that code is dependent on >> the package layout for accessing the global scope, so I dropped it. >> Doesn't >> look like the Erlang/OTP distro uses the package functionality at all any >> way.. >> >> But I'd rather like seeing this issue addressed and fixed, since now all >> my >> modules resides in only one dir, and with quite extensive names, which >> should rather be a path.. >> >> Sorry, no help here, just want to add my view to let out that we're more >> with similiar issues. >> >> Best regards, >> Andreas Stenius >> >> ----- Original Message ----- >> From: "Tim Watson" >> To: >> Sent: Tuesday, December 16, 2008 1:16 AM >> Subject: Re: [erlang-questions] ct_cover broken when using packages >> >> >>> Hi all, >>> >>> I've noticed that the cover tool seems to break when using packages. >>> It appears that the cover tool inserts executable code into your >>> functions such as this: >>> >>> myfunction() -> >>> %% do something >>> ets:, %% inserted by cover >>> %% etc >>> >>> This would be fine except that in a module module 1 contained within a >>> package package1, the atom ets is resolved to 'package1.module1.ets' >>> which doesn't exist (hopefully!). The correct behaviour would be to >>> insert '.ets' or to dynamically add an "-import(ets)." to the module >>> so that 'ets' resolves to '.ets' instead. >>> >>> Has anyone else come across this? Is there a planned fix? >>> >>> Many thanks, >>> >>> Tim Watson >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://www.erlang.org/mailman/listinfo/erlang-questions >>> >> >> >> > From masse@REDACTED Thu Dec 18 19:49:58 2008 From: masse@REDACTED (mats cronqvist) Date: Thu, 18 Dec 2008 19:49:58 +0100 Subject: [erlang-questions] distel completion? In-Reply-To: <200812181213.18768.peter@sabaini.at> (Peter Sabaini's message of "Thu\, 18 Dec 2008 12\:13\:12 +0100") References: <200812161059.09337.peter@sabaini.at> <200812161921.02130.peter@sabaini.at> <200812181213.18768.peter@sabaini.at> Message-ID: <877i5xl3mx.fsf@dixie.cronqvi.st> Peter Sabaini writes: > Hi, > > Mats has fixed a bug yesterday that triggered the symptoms I described, works > great now. Its in distels' svn HEAD. > > Thanks for all the help! for all emacs pinkies out there, brand spanking new distel tarball available at distel.googlecode.com. Quite possibly with fewer bugs and more verbose documentation. mats From kenneth.lundin@REDACTED Thu Dec 18 19:55:37 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Thu, 18 Dec 2008 19:55:37 +0100 Subject: [erlang-questions] process priorities In-Reply-To: <4948B425.10600@arcticlake.com> References: <4948AC51.2060404@arcticlake.com> <4948B425.10600@arcticlake.com> Message-ID: Hi, The experience is that one should avoid fiddling with process priorities. It is very rarely done and you can probably solve the problem in another way. In the whole Erlang/OTP distribution it is only used in a couple of places which have with the distribution protocol to do (I have not searched the code recently so this is not the exact truth but almost). /Kenneth Erlang/OTP Ericsson On Wed, Dec 17, 2008 at 9:11 AM, Johan Munk wrote: > My post didn't seem to get through. Retry: > Johan Munk wrote: >> >> Hi list, >> >> I want to know how your experience is with fiddling with process >> priorities (i.e. use of process_flag(priority, )). >> >> I know the doc discourage the use of 'max' and 'high' but that does >> not mean this handle is not used in real world applications. >> >> thanks, >> > -- > Johan Munk > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From klacke@REDACTED Thu Dec 18 21:35:42 2008 From: klacke@REDACTED (Claes Wikstrom) Date: Thu, 18 Dec 2008 21:35:42 +0100 Subject: [erlang-questions] Priviliged ports and effective UID In-Reply-To: References: <9893-51893@sneakemail.com> <20081029081727.GA31386@erix.ericsson.se> Message-ID: <494AB41E.10800@hyber.org> Decker, Nils wrote: > Hello, > > I am using a small tool named authbind [1] in my project without any problems. > It is a LD_PRELOAD wrapper and a setuid root binary. The right to open specific ports > can be controlled in /etc/. Brilliant. There also an equivalent program call privbind that does the same thing. This is precisely what is needed for, for example Yaws on Linux system Perfect. /klacke From mrad-direct-erlang@REDACTED Thu Dec 18 21:57:19 2008 From: mrad-direct-erlang@REDACTED (Michael Radford) Date: Thu, 18 Dec 2008 12:57:19 -0800 Subject: [erlang-questions] Priviliged ports and effective UID In-Reply-To: <494AB41E.10800@hyber.org> References: <9893-51893@sneakemail.com> <20081029081727.GA31386@erix.ericsson.se> <494AB41E.10800@hyber.org> Message-ID: <20081218205719.GA26958@herbie> In Linux, it's also extremely easy to forward, say, port 80 to port 8080 using iptables. Then no setuid programs are needed at all. Mike Claes Wikstrom writes: > Decker, Nils wrote: > > Hello, > > > > I am using a small tool named authbind [1] in my project without any problems. > > It is a LD_PRELOAD wrapper and a setuid root binary. The right to open specific ports > > can be controlled in /etc/. > > Brilliant. There also an equivalent program call privbind that does > the same thing. > > This is precisely what is needed for, for example Yaws on Linux system > Perfect. > > > /klacke > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From vances@REDACTED Thu Dec 18 22:28:07 2008 From: vances@REDACTED (Vance Shipley) Date: Thu, 18 Dec 2008 16:28:07 -0500 Subject: [erlang-questions] wrapping ss7 in a linked-in driver In-Reply-To: <7B2386E2-D77C-4058-B93F-7351C6CA64DA@gmail.com> References: <7B2386E2-D77C-4058-B93F-7351C6CA64DA@gmail.com> Message-ID: <20081218212806.GC651@h216-235-12-168.host.egate.net> Joel, I'm not clear what exactly you are thinking, the asn1 module does what you describe; code generation and a linked in driver. Plenty of folks kicking around here, myself included, have run SS7 protocols such as MAP through Erlang systems. I implemented ANSI and ETSI MAP and TCAP layers on top of a linked in driver for an SCCP stack embedded on a card. -Vance On Thu, Dec 18, 2008 at 12:42:35PM +0000, Joel Reymont wrote: } Has anyone wrapped SS7 (MAP ETSI) in a linked-in driver? } } Any issues to watch out for? } } I'm actually looking to write a code generator to do this auto- } magically. } } Thanks, Joel From joelr1@REDACTED Thu Dec 18 22:33:42 2008 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 18 Dec 2008 21:33:42 +0000 Subject: [erlang-questions] wrapping ss7 in a linked-in driver In-Reply-To: <20081218212806.GC651@h216-235-12-168.host.egate.net> References: <7B2386E2-D77C-4058-B93F-7351C6CA64DA@gmail.com> <20081218212806.GC651@h216-235-12-168.host.egate.net> Message-ID: On Dec 18, 2008, at 9:28 PM, Vance Shipley wrote: > I'm not clear what exactly you are thinking, the asn1 module > does what you describe; code generation and a linked in driver. I meant generating linked-in driver code, C and Erlang, by parsing C header files. > I implemented > ANSI and ETSI MAP and TCAP layers on top of a linked in driver > for an SCCP stack embedded on a card. ETSI MAP is what I'm thinking about. Any issues to be aware of? Thanks, Joel -- http://wagerlabs.com From chris.newcombe@REDACTED Thu Dec 18 22:52:10 2008 From: chris.newcombe@REDACTED (Chris Newcombe) Date: Thu, 18 Dec 2008 13:52:10 -0800 Subject: [erlang-questions] : : driver_entry stop() and driver_async() interaction In-Reply-To: <20081218155558.GD23981@erix.ericsson.se> References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> <494A44FB.5030309@alertlogic.net> <20081218155558.GD23981@erix.ericsson.se> Message-ID: <781dd98c0812181352n2e9b6474n28d7ff9f8cf30d76@mail.gmail.com> >> I think it would be _great_ if the VM/driver interface provided a more traditional thread >> pool/queue API in addition to the existing async functionality. Agreed. Some libraries even need more than one thread pool. If you use the latest version of the Erlang Driver Toolkit http://www.snookles.com/erlang/edtk/ ... it allows the driver to use an arbitrary number of private thread-pools (e.g. the Berkeley DB driver required 5 separate thread pools to avoid potential thread-level deadlock). Also, for full runtime visibility and control, the EDTK thread-pools can be examined and re-sized at runtime (i.e. increase the number of threads independently, per thread pool). You can also set the stack size for the threads, and set a limit on the length of the command-queue for each thread pool (important for flow control). EDTK now provides these features for all generated drivers -- it is trivial to set up. See the declarations at top of examples/berkeley_db/berkeley_db.xml for an example. If the Erlang VM does ever provide a better threadpool facility, it would be great if it had these same features flexibility (you could adapt the code from EDTK, as it is BSD-licensed and has been well tested). The fact that the BerkeleyDB driver needed these features is an existance-proof of their value. Chris Example snippets from the berkeley_db driver test suite: ok = ?BDB:set_threadpool_params(BdbPort, ?BDB_THREADPOOL_ID_WORKERS, 5, 64*1024, 2000), [{edtk_threadpool_id, ?BDB_THREADPOOL_ID_WORKERS}, {curr_queue_len, 0}, {curr_idle_threads, 30}, {num_threads, 30}, {curr_enqueued_poison_pills, 0}, {queue_len_limit, 1000}] = ?BDB:get_threadpool_info(BdbPort, ?BDB_THREADPOOL_ID_WORKERS), Chris On Thu, Dec 18, 2008 at 7:55 AM, Raimo Niskanen wrote: > On Thu, Dec 18, 2008 at 08:08:06AM -0700, Dave Smith wrote: >> One other note...I eventually wrote my own thread pool/queue for load >> balancing purposes. async_* can cause the load to be very spiky if you >> can not predict the amount of time a queued operation might take >> (which is usually the point of using threads...). I think it would be >> _great_ if the VM/driver interface provided a more traditional thread >> pool/queue API in addition to the existing async functionality. I know >> of several Erlang drivers that have had to write their own and it can >> be a very challenging problem to get right. :) > > Aggreed. It has been on the Future Plans list forever. > Using async thread for e.g prime number calculations > will today block random file operations... > >> >> D. >> >> On Thu, Dec 18, 2008 at 7:36 AM, Dave Smith wrote: >> >>>>> Is it the responsibility of the code in the stop() callback to call >> >>>>> driver_async_cancel() on each outstanding async work item, or will this >> >>>>> be done automatically by the emulator before the call to stop()? >> > >> > Yes, it is up to the driver to cancel outstanding items. In wrestling >> > with this recently, I found that the best approach was to cancel all >> > the items and then queue up a sentinel callback that triggers a >> > condition variable. I then wait for that cv to get signaled and know >> > at that point that the driver is clear to shutdown. This approach >> > seemed to work quite well on a 8 proc box with reasonable load -- >> > YMMV. :) >> > >> >>>>> If this is the responsibility of the code in stop(), is it guaranteed >> >>>>> that no async work item will be executing or scheduled during the call >> >>>>> to the stop() callback? >> >>>>> >> >>>>> If no guarantee is made, is holding the PDL necessary and sufficient to >> >>>>> guarantee this? >> > >> > I researched this, and I believe that the answer is "no". Scheduling >> > the async work item does increment the PDL ref count when the item is >> > _inserted_ into the queue. Once the item is in the queue, all bets are >> > off -- the only guarantee you have is that the PDL won't disappear >> > (i.e. you can safely lock/unlock it). The PDL says nothing about >> > whether or not the async work item is executing during stop(). It >> > seems to be the responsibility of the driver author to sort out these >> > intricate timing issues. >> > >> > erts/emulator/beam/erl_async.c is where all the code of interest resides. >> > >> > It's entirely possible that I have made gross errors in my reading of >> > the emulator code and would happily receive instruction from one of >> > the core VM team. :) >> > >> > D. >> > >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From vances@REDACTED Thu Dec 18 22:53:10 2008 From: vances@REDACTED (Vance Shipley) Date: Thu, 18 Dec 2008 16:53:10 -0500 Subject: [erlang-questions] wrapping ss7 in a linked-in driver In-Reply-To: References: <7B2386E2-D77C-4058-B93F-7351C6CA64DA@gmail.com> <20081218212806.GC651@h216-235-12-168.host.egate.net> Message-ID: <20081218215309.GD651@h216-235-12-168.host.egate.net> On Thu, Dec 18, 2008 at 09:33:42PM +0000, Joel Reymont wrote: > I meant generating linked-in driver code, C and Erlang, by > parsing C header files. What API is implemented in C? > ETSI MAP is what I'm thinking about. Do you have in mind interfacing to a MAP implemented in C? Or implementing a MAP layer in Erlang on top of a C TCAP? > Any issues to be aware of? I had the whole stack available from NMS but found that it made more sense for me to implement the MAP and TCAP in Erlang. Running the stacks embedded didn't seem a good fit for an Erlang system. I was happy with the portability I achieved using autotools targetting sparc and x86 in both 32 and 64 bits. One build system handled them all. An example is in this project: http://netaccess-erldrv.googlecode.com -Vance From raould@REDACTED Thu Dec 18 23:04:00 2008 From: raould@REDACTED (Raoul Duke) Date: Thu, 18 Dec 2008 14:04:00 -0800 Subject: [erlang-questions] i think i ran into an old erl/distel bug Message-ID: <91a2ba3e0812181404p176e8ec9tef7e4e0d739cb61c@mail.gmail.com> http://www.nabble.com/Re%3A-distel-mode-with-*.beam-files-separate-from%09source-p17556634.html since Erlang is open source, does that mean Somebody Who Knows What They Are Doing (Not Me) could submit a patch? :-) From harveyd@REDACTED Thu Dec 18 23:08:06 2008 From: harveyd@REDACTED (Dale Harvey) Date: Thu, 18 Dec 2008 22:08:06 +0000 Subject: [erlang-questions] Priviliged ports and effective UID In-Reply-To: <20081218205719.GA26958@herbie> References: <9893-51893@sneakemail.com> <20081029081727.GA31386@erix.ericsson.se> <494AB41E.10800@hyber.org> <20081218205719.GA26958@herbie> Message-ID: Its not ideal for every situation but running nginx on 80 to reverse proxy works pretty well, it means you can serve the static files with it and forward the dynamic requests to yaws / mochiweb 2008/12/18 Michael Radford > In Linux, it's also extremely easy to forward, say, port 80 to port 8080 > using iptables. Then no setuid programs are needed at all. > > Mike > > Claes Wikstrom writes: > > Decker, Nils wrote: > > > Hello, > > > > > > I am using a small tool named authbind [1] in my project without any > problems. > > > It is a LD_PRELOAD wrapper and a setuid root binary. The right to open > specific ports > > > can be controlled in /etc/. > > > > Brilliant. There also an equivalent program call privbind that does > > the same thing. > > > > This is precisely what is needed for, for example Yaws on Linux system > > Perfect. > > > > > > /klacke > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alustenberg@REDACTED Fri Dec 19 02:16:16 2008 From: alustenberg@REDACTED (Alex) Date: Thu, 18 Dec 2008 20:16:16 -0500 Subject: [erlang-questions] sqlrelay, was Re: Interfacing Erlang to Oracle Message-ID: <915e7e1d0812181716g1f6b8ef9k55057afc0a0badc0@mail.gmail.com> if one is to go through all the trouble of interfacing, might as well do it correctly, and skip the mysql and postgresql drop in libs, and code against their API directly. One could use the argument that odbc is the standard and should be adhered to... still doesnt make it less of a pain to work with. Sqlrelay is a nice middleware to hook into, provides good value out of the box, supports most databases users would be interested in, and its problem domain is a good match against Erlang's. The pdf located over at http://www.snookles.com/erlang/edtk/ that was recently mentioned on list, has a lot of good insight, and explain pitfalls that are likely to be encountered in an undertaking of creating a sqlrelay driver. I found the section on addressing transactions via multiple thread pools very insightful. Anyway, If someone wants to start up a project on this, I can contribute some time. 2008/12/17 Joseph Stewart : > I'll broach the topic again... > The project "sql relay" might be decent middleware to target. -- "Every normal man must be tempted at times to spit on his hands, hoist the black flag, and begin to slit throats." --H.L. Mencken From atulindore2@REDACTED Fri Dec 19 05:54:36 2008 From: atulindore2@REDACTED (atul goyal) Date: Fri, 19 Dec 2008 10:24:36 +0530 Subject: [erlang-questions] curious In-Reply-To: <494A4C55.2000409@charpi.net> References: <494A4C55.2000409@charpi.net> Message-ID: well quite true... and erlang does a nice job when it comes to concurrency. Now when i have made the changes let me test out the actual thruput of the entire system...i will mail the results soon. thankeeeee atul pyro -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Fri Dec 19 09:07:45 2008 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 19 Dec 2008 09:07:45 +0100 Subject: [erlang-questions] : : : driver_entry stop() and driver_async() interaction In-Reply-To: <781dd98c0812181352n2e9b6474n28d7ff9f8cf30d76@mail.gmail.com> References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> <494A44FB.5030309@alertlogic.net> <20081218155558.GD23981@erix.ericsson.se> <781dd98c0812181352n2e9b6474n28d7ff9f8cf30d76@mail.gmail.com> Message-ID: <20081219080745.GA8747@erix.ericsson.se> On Thu, Dec 18, 2008 at 01:52:10PM -0800, Chris Newcombe wrote: > >> I think it would be _great_ if the VM/driver interface provided a more traditional thread > >> pool/queue API in addition to the existing async functionality. > > Agreed. Some libraries even need more than one thread pool. > > If you use the latest version of the Erlang Driver Toolkit > > http://www.snookles.com/erlang/edtk/ > > ... it allows the driver to use an arbitrary number of private > thread-pools (e.g. the Berkeley DB driver required 5 separate thread > pools to avoid potential thread-level deadlock). > > Also, for full runtime visibility and control, the EDTK thread-pools > can be examined and re-sized at runtime (i.e. increase the number of > threads independently, per thread pool). You can also set the stack > size for the threads, and set a limit on the length of the > command-queue for each thread pool (important for flow control). > > EDTK now provides these features for all generated drivers -- it is > trivial to set up. See the declarations at top of > examples/berkeley_db/berkeley_db.xml for an example. > > If the Erlang VM does ever provide a better threadpool facility, it > would be great if it had these same features flexibility (you could > adapt the code from EDTK, as it is BSD-licensed and has been well > tested). The fact that the BerkeleyDB driver needed these features > is an existance-proof of their value. Very interesting. We will certainly have a look at this. Does it work on Windows too? What I had in mind to add was a thinner layer on pthreads or whatever the emulator is using, so drivers could manage threads on their own. > > Chris > > Example snippets from the berkeley_db driver test suite: > > ok = ?BDB:set_threadpool_params(BdbPort, > ?BDB_THREADPOOL_ID_WORKERS, 5, 64*1024, 2000), > > [{edtk_threadpool_id, ?BDB_THREADPOOL_ID_WORKERS}, > {curr_queue_len, 0}, > {curr_idle_threads, 30}, > {num_threads, 30}, > {curr_enqueued_poison_pills, 0}, > {queue_len_limit, 1000}] = > ?BDB:get_threadpool_info(BdbPort, ?BDB_THREADPOOL_ID_WORKERS), > > Chris > > > On Thu, Dec 18, 2008 at 7:55 AM, Raimo Niskanen > wrote: > > On Thu, Dec 18, 2008 at 08:08:06AM -0700, Dave Smith wrote: > >> One other note...I eventually wrote my own thread pool/queue for load > >> balancing purposes. async_* can cause the load to be very spiky if you > >> can not predict the amount of time a queued operation might take > >> (which is usually the point of using threads...). I think it would be > >> _great_ if the VM/driver interface provided a more traditional thread > >> pool/queue API in addition to the existing async functionality. I know > >> of several Erlang drivers that have had to write their own and it can > >> be a very challenging problem to get right. :) > > > > Aggreed. It has been on the Future Plans list forever. > > Using async thread for e.g prime number calculations > > will today block random file operations... > > > >> > >> D. > >> > >> On Thu, Dec 18, 2008 at 7:36 AM, Dave Smith wrote: > >> >>>>> Is it the responsibility of the code in the stop() callback to call > >> >>>>> driver_async_cancel() on each outstanding async work item, or will this > >> >>>>> be done automatically by the emulator before the call to stop()? > >> > > >> > Yes, it is up to the driver to cancel outstanding items. In wrestling > >> > with this recently, I found that the best approach was to cancel all > >> > the items and then queue up a sentinel callback that triggers a > >> > condition variable. I then wait for that cv to get signaled and know > >> > at that point that the driver is clear to shutdown. This approach > >> > seemed to work quite well on a 8 proc box with reasonable load -- > >> > YMMV. :) > >> > > >> >>>>> If this is the responsibility of the code in stop(), is it guaranteed > >> >>>>> that no async work item will be executing or scheduled during the call > >> >>>>> to the stop() callback? > >> >>>>> > >> >>>>> If no guarantee is made, is holding the PDL necessary and sufficient to > >> >>>>> guarantee this? > >> > > >> > I researched this, and I believe that the answer is "no". Scheduling > >> > the async work item does increment the PDL ref count when the item is > >> > _inserted_ into the queue. Once the item is in the queue, all bets are > >> > off -- the only guarantee you have is that the PDL won't disappear > >> > (i.e. you can safely lock/unlock it). The PDL says nothing about > >> > whether or not the async work item is executing during stop(). It > >> > seems to be the responsibility of the driver author to sort out these > >> > intricate timing issues. > >> > > >> > erts/emulator/beam/erl_async.c is where all the code of interest resides. > >> > > >> > It's entirely possible that I have made gross errors in my reading of > >> > the emulator code and would happily receive instruction from one of > >> > the core VM team. :) > >> > > >> > D. > >> > > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > > -- > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From masse@REDACTED Fri Dec 19 09:49:28 2008 From: masse@REDACTED (mats cronqvist) Date: Fri, 19 Dec 2008 09:49:28 +0100 Subject: [erlang-questions] i think i ran into an old erl/distel bug In-Reply-To: <91a2ba3e0812181404p176e8ec9tef7e4e0d739cb61c@mail.gmail.com> (Raoul Duke's message of "Thu\, 18 Dec 2008 14\:04\:00 -0800") References: <91a2ba3e0812181404p176e8ec9tef7e4e0d739cb61c@mail.gmail.com> Message-ID: <87hc504kiv.fsf@sterlett.hq.kred> "Raoul Duke" writes: > http://www.nabble.com/Re%3A-distel-mode-with-*.beam-files-separate-from%09source-p17556634.html > > since Erlang is open source, does that mean Somebody Who Knows What > They Are Doing (Not Me) could submit a patch? :-) yes. From raimo+erlang-questions@REDACTED Fri Dec 19 11:53:54 2008 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 19 Dec 2008 11:53:54 +0100 Subject: [erlang-questions] : : : : driver_entry stop() and driver_async() interaction In-Reply-To: <20081219080745.GA8747@erix.ericsson.se> References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> <494A44FB.5030309@alertlogic.net> <20081218155558.GD23981@erix.ericsson.se> <781dd98c0812181352n2e9b6474n28d7ff9f8cf30d76@mail.gmail.com> <20081219080745.GA8747@erix.ericsson.se> Message-ID: <20081219105354.GA10968@erix.ericsson.se> On Fri, Dec 19, 2008 at 09:07:45AM +0100, Raimo Niskanen wrote: > On Thu, Dec 18, 2008 at 01:52:10PM -0800, Chris Newcombe wrote: > > >> I think it would be _great_ if the VM/driver interface provided a more traditional thread > > >> pool/queue API in addition to the existing async functionality. > > > > Agreed. Some libraries even need more than one thread pool. > > > > If you use the latest version of the Erlang Driver Toolkit > > > > http://www.snookles.com/erlang/edtk/ > > > > ... it allows the driver to use an arbitrary number of private > > thread-pools (e.g. the Berkeley DB driver required 5 separate thread > > pools to avoid potential thread-level deadlock). > > > > Also, for full runtime visibility and control, the EDTK thread-pools > > can be examined and re-sized at runtime (i.e. increase the number of > > threads independently, per thread pool). You can also set the stack > > size for the threads, and set a limit on the length of the > > command-queue for each thread pool (important for flow control). > > > > EDTK now provides these features for all generated drivers -- it is > > trivial to set up. See the declarations at top of > > examples/berkeley_db/berkeley_db.xml for an example. > > > > If the Erlang VM does ever provide a better threadpool facility, it > > would be great if it had these same features flexibility (you could > > adapt the code from EDTK, as it is BSD-licensed and has been well > > tested). The fact that the BerkeleyDB driver needed these features > > is an existance-proof of their value. > > Very interesting. We will certainly have a look at this. > Does it work on Windows too? > > What I had in mind to add was a thinner layer on pthreads > or whatever the emulator is using, so drivers could manage > threads on their own. It seems that had already been done while I was busy doing other things (for quite a while now). No, what I think I actually ment was to extend the existing driver_async API with the possibility to allocate private threads not colliding with the file driver, and control of which thread to use for a specific job. > > > > > > Chris > > > > Example snippets from the berkeley_db driver test suite: > > > > ok = ?BDB:set_threadpool_params(BdbPort, > > ?BDB_THREADPOOL_ID_WORKERS, 5, 64*1024, 2000), > > > > [{edtk_threadpool_id, ?BDB_THREADPOOL_ID_WORKERS}, > > {curr_queue_len, 0}, > > {curr_idle_threads, 30}, > > {num_threads, 30}, > > {curr_enqueued_poison_pills, 0}, > > {queue_len_limit, 1000}] = > > ?BDB:get_threadpool_info(BdbPort, ?BDB_THREADPOOL_ID_WORKERS), > > > > Chris > > > > > > On Thu, Dec 18, 2008 at 7:55 AM, Raimo Niskanen > > wrote: > > > On Thu, Dec 18, 2008 at 08:08:06AM -0700, Dave Smith wrote: > > >> One other note...I eventually wrote my own thread pool/queue for load > > >> balancing purposes. async_* can cause the load to be very spiky if you > > >> can not predict the amount of time a queued operation might take > > >> (which is usually the point of using threads...). I think it would be > > >> _great_ if the VM/driver interface provided a more traditional thread > > >> pool/queue API in addition to the existing async functionality. I know > > >> of several Erlang drivers that have had to write their own and it can > > >> be a very challenging problem to get right. :) > > > > > > Aggreed. It has been on the Future Plans list forever. > > > Using async thread for e.g prime number calculations > > > will today block random file operations... > > > > > >> > > >> D. > > >> > > >> On Thu, Dec 18, 2008 at 7:36 AM, Dave Smith wrote: > > >> >>>>> Is it the responsibility of the code in the stop() callback to call > > >> >>>>> driver_async_cancel() on each outstanding async work item, or will this > > >> >>>>> be done automatically by the emulator before the call to stop()? > > >> > > > >> > Yes, it is up to the driver to cancel outstanding items. In wrestling > > >> > with this recently, I found that the best approach was to cancel all > > >> > the items and then queue up a sentinel callback that triggers a > > >> > condition variable. I then wait for that cv to get signaled and know > > >> > at that point that the driver is clear to shutdown. This approach > > >> > seemed to work quite well on a 8 proc box with reasonable load -- > > >> > YMMV. :) > > >> > > > >> >>>>> If this is the responsibility of the code in stop(), is it guaranteed > > >> >>>>> that no async work item will be executing or scheduled during the call > > >> >>>>> to the stop() callback? > > >> >>>>> > > >> >>>>> If no guarantee is made, is holding the PDL necessary and sufficient to > > >> >>>>> guarantee this? > > >> > > > >> > I researched this, and I believe that the answer is "no". Scheduling > > >> > the async work item does increment the PDL ref count when the item is > > >> > _inserted_ into the queue. Once the item is in the queue, all bets are > > >> > off -- the only guarantee you have is that the PDL won't disappear > > >> > (i.e. you can safely lock/unlock it). The PDL says nothing about > > >> > whether or not the async work item is executing during stop(). It > > >> > seems to be the responsibility of the driver author to sort out these > > >> > intricate timing issues. > > >> > > > >> > erts/emulator/beam/erl_async.c is where all the code of interest resides. > > >> > > > >> > It's entirely possible that I have made gross errors in my reading of > > >> > the emulator code and would happily receive instruction from one of > > >> > the core VM team. :) > > >> > > > >> > D. > > >> > > > >> _______________________________________________ > > >> erlang-questions mailing list > > >> erlang-questions@REDACTED > > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > > > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From juanjo@REDACTED Fri Dec 19 13:04:42 2008 From: juanjo@REDACTED (Juan Jose Comellas) Date: Fri, 19 Dec 2008 10:04:42 -0200 Subject: [erlang-questions] distel completion? In-Reply-To: <877i5xl3mx.fsf@dixie.cronqvi.st> References: <200812161059.09337.peter@sabaini.at> <200812161921.02130.peter@sabaini.at> <200812181213.18768.peter@sabaini.at> <877i5xl3mx.fsf@dixie.cronqvi.st> Message-ID: <1c3be50f0812190404w6c8199acm35ef53bc61f51be@mail.gmail.com> Thanks for Distel. I started using it a few days ago and I'm loving it. I applied this patch to get the latest Distel revision from SVN to compile. I don't know if it's correct, but that's what I managed to do after a 5 minute look at the file. diff --git a/src/otp_doc.erl b/src/otp_doc.erl index 2b0285e..d5c4105 100644 --- a/src/otp_doc.erl +++ b/src/otp_doc.erl @@ -209,7 +209,7 @@ which_a(M,F,A) -> %% store name of html file in {Mod,file} html_index(file,Dir) -> FN = filename:join([Dir,"doc","man_index.html"]), - fold_file(curry(fun lines/3,Dir),[],). + fold_file(curry(fun lines/3,Dir),[],FN). lines(Line,_,Dir) -> case string:tokens(Line, "<> \"") of On Thu, Dec 18, 2008 at 4:49 PM, mats cronqvist wrote: > Peter Sabaini writes: > >> Hi, >> >> Mats has fixed a bug yesterday that triggered the symptoms I described, works >> great now. Its in distels' svn HEAD. >> >> Thanks for all the help! > > > for all emacs pinkies out there, brand spanking new distel tarball > available at distel.googlecode.com. Quite possibly with fewer bugs > and more verbose documentation. > > mats > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From masse@REDACTED Fri Dec 19 14:15:27 2008 From: masse@REDACTED (mats cronqvist) Date: Fri, 19 Dec 2008 14:15:27 +0100 Subject: [erlang-questions] distel completion? In-Reply-To: <1c3be50f0812190404w6c8199acm35ef53bc61f51be@mail.gmail.com> (Juan Jose Comellas's message of "Fri\, 19 Dec 2008 10\:04\:42 -0200") References: <200812161059.09337.peter@sabaini.at> <200812161921.02130.peter@sabaini.at> <200812181213.18768.peter@sabaini.at> <877i5xl3mx.fsf@dixie.cronqvi.st> <1c3be50f0812190404w6c8199acm35ef53bc61f51be@mail.gmail.com> Message-ID: <874p10487k.fsf@sterlett.hq.kred> "Juan Jose Comellas" writes: > Thanks for Distel. I started using it a few days ago and I'm loving it. > > I applied this patch to get the latest Distel revision from SVN to > compile. I don't know if it's correct, but that's what I managed to do > after a 5 minute look at the file. i was in the middle of applying a patchset... it should be OK now. From atulindore2@REDACTED Fri Dec 19 14:23:12 2008 From: atulindore2@REDACTED (atul goyal) Date: Fri, 19 Dec 2008 18:53:12 +0530 Subject: [erlang-questions] curious In-Reply-To: References: <494A4C55.2000409@charpi.net> Message-ID: hi...i got the results... it seems that instantiating the driver multiple times and concurrently sending the messages is not improving the speed at all. I think that since im using no async threads on OS level ,my performance wont increase. And it wud be the same weather i use seuqential or concurrent techniques as long as the erts is running on a single OS thread....well On Fri, Dec 19, 2008 at 10:24 AM, atul goyal wrote: > > well quite true... and erlang does a nice job when it comes to concurrency. > Now when i have made the changes let me test out the actual thruput of the > entire system...i will mail the results soon. > thankeeeee > atul > pyro > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth.lundin@REDACTED Fri Dec 19 14:25:36 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 19 Dec 2008 14:25:36 +0100 Subject: [erlang-questions] Request for comments on EEP-25 "Unnesting cases" Message-ID: I would like you to submit comments regarding EEP-25 on the eeps@REDACTED mailing list. Deadline for comments is 2009-01-16 and after that we will make a decision about the EEP. Here is a link to the EEP: http://www.erlang.org/eeps/eep-0025.html The reason for taking this EEP before other EEPs that was submitted earlier is that we we think it is an interesting improvement that is compatible and it is relatively easy to implement. NOTE AGAIN! WE WANT THE COMMENTS on the eeps@REDACTED mailing list only (NOT on erlang-questions). This is the common procedure for EEPS, i.e. that we announce request for comments on erlang-questions with a deadline and then receive and discuss the comments on the eeps mailing lists before we make a decision which we will announce on both mailing lists. /Regards Kenneth Erlang/OTP team, Ericsson From raimo+erlang-questions@REDACTED Fri Dec 19 14:52:20 2008 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 19 Dec 2008 14:52:20 +0100 Subject: [erlang-questions] : : : driver_entry stop() and driver_async() interaction In-Reply-To: <20081218155426.GC23981@erix.ericsson.se> References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> <494A44FB.5030309@alertlogic.net> <20081218155426.GC23981@erix.ericsson.se> Message-ID: <20081219135220.GB10968@erix.ericsson.se> Here are the results from the internal meeting... On Thu, Dec 18, 2008 at 04:54:26PM +0100, Raimo Niskanen wrote: > On Thu, Dec 18, 2008 at 06:41:31AM -0600, Paul Fisher wrote: > > Any word on this? > > Sorry, no. I will try to summon an internal meeting about this... > > > > > > > Raimo Niskanen wrote: > > > On Thu, Nov 06, 2008 at 12:22:45PM -0600, Paul Fisher wrote: > > >> Can anyone comment on this question i sent a few weeks ago? > > >> > > >> When the port owner terminates and there are driver_async() requests > > >> scheduled and not yet executed, I am seeing them outstanding at the time > > >> of the stop() callback. > > > > > > We will take a look at it and make it clear in some > > > documentation and give you an answer. It will take a bit of > > > code review to be certain... > > > > > >> > > >> Paul Fisher wrote: > > >>> Question about work scheduled on async threads via driver_async() and > > >>> still pending (i.e. they are still on the queue to be executed,) when > > >>> the stop() callback is invoked. Specifically, assuming smp w/async > > >>> thread pool and the driver marked ERL_DRV_FLAG_USE_PORT_LOCKING. > > >>> > > >>> Is it the responsibility of the code in the stop() callback to call > > >>> driver_async_cancel() on each outstanding async work item, or will this > > >>> be done automatically by the emulator before the call to stop()? The emulator will not cancel the jobs. You may cancel async jobs from the stop() callback, but running jobs will keep on running and fail to be cancelled. The trick Dave Smith described in another post works (apparently). In the stop() callback, cancel all async jobs. Some may not cancel since they are already running. Then start a new special async job that on invocation triggers a condition variable that the stop() callback waits for after starting that special async job. In that way stop() finishes after all async jobs are done, and when stop() exits the port dies. Period. This of course blocks the scheduler thread executing stop() until all async jobs are done. But leaving async jobs behind after stop() has exited is not supposed to be wrong. After the async job is done either the async_ready() callback is executed if it exists, or the async_free() async callback is executed. The async_free() async callback is also executed if the async job is cancelled. Unfortunately there is currently a bug so the async_free() async callback is not executed if the port dies before async_ready() is supposed to be executed causing a memory leak in this case. After this bug has been fixed you may (supposedly) just leave the async jobs around after stop() callback and their async_free() async callback will be executed to free their allocated memory, if this is fine with your application. Another trick is to keep data in the IO queue. If there is data in the IO queue when the port is killed, the flush() callback is executed to try to force data out of the queue. The flush() callback does not have to succeed in flushing the data. It is more or less an informative callback. When the last data in the IO queue is consumed through driver_deq(), the stop() callback will be executed. If you use the IO queue to communicate with the async jobs you can make it so they automatically will have to be done before the stop() callback is executed. For some applications this is natural and for others it is a hack. > > >>> > > >>> If this is the responsibility of the code in stop(), is it guaranteed > > >>> that no async work item will be executing or scheduled during the call > > >>> to the stop() callback? There are no such guarantees. Async jobs are supposed to go in parallell with other port callbacks. If you use the IO queue from other threads than the scheduler threads (regular callbacks), e.g from async jobs, you must protect accesses to it using the port data lock (PDL). Just as if you use other data common to the async thread and the driver callbacks it must also be lock protected. You can use the PDL for this or a lock of your own. > > >>> > > >>> If no guarantee is made, is holding the PDL necessary and sufficient to > > >>> guarantee this? No, holding the PDL only synchronises accesses of the IO queue. There may come other emulator port data that also will be protected by this lock. > > >> > > >> -- > > >> paul > > >> _______________________________________________ > > >> erlang-questions mailing list > > >> erlang-questions@REDACTED > > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From ittay.dror@REDACTED Fri Dec 19 14:59:58 2008 From: ittay.dror@REDACTED (Ittay Dror) Date: Fri, 19 Dec 2008 05:59:58 -0800 (PST) Subject: [erlang-questions] extending function clauses Message-ID: <21091060.post@talk.nabble.com> Hi, Is it possible to add clauses to a function that is defined in another module? More elaborately: say a 3rd party module 'geometry' defines a function 'area', for each shape (shapes are defined as tuples where the first element is an atom naming the shape) there is a clause (so there is a clause for 'circle', 'square' etc.). Now, I have a new shape. Can I extend 'geometry:area' so it can handle my new shape (by adding a new clause). I cannot change the original module's file. 'geometry:area' is used by other functions to do more sophisticated stuff (so defining my own area function is not effective). If not, what is the erlang way of handling this situation? Thank you, Ittay -- View this message in context: http://www.nabble.com/extending-function-clauses-tp21091060p21091060.html Sent from the Erlang Questions mailing list archive at Nabble.com. From chris.newcombe@REDACTED Fri Dec 19 15:35:41 2008 From: chris.newcombe@REDACTED (Chris Newcombe) Date: Fri, 19 Dec 2008 06:35:41 -0800 Subject: [erlang-questions] : : : driver_entry stop() and driver_async() interaction In-Reply-To: <20081219080745.GA8747@erix.ericsson.se> References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> <494A44FB.5030309@alertlogic.net> <20081218155558.GD23981@erix.ericsson.se> <781dd98c0812181352n2e9b6474n28d7ff9f8cf30d76@mail.gmail.com> <20081219080745.GA8747@erix.ericsson.se> Message-ID: <781dd98c0812190635l17969b33kcc50c1870aaf6125@mail.gmail.com> > Very interesting. We will certainly have a look at this. > Does it work on Windows too? Alas not yet, but I think it should be easy to do. - it uses pthreads calls directly (but you now provide an abstraction, so increasing portability should be fairly straight-forward, although I won't be doing it myself) - it uses driver_select with pipe file-descriptors, so would need a minor change to use a Windows event handle. Basically the EDTK thread-pool code looks a lot like a generalization of the existing Erlang VM async threads code. The main difference is that every thread-pool has exactly one producer-consumer queue (rather than having one such queue per individual thread, as the existing 'async' pool does). Plus the EDTK implementation has the other features that I've already mentioned. (All of those features have real-world motivations; e.g. setting the stack size is vital if you want even a moderate number of threads but cannot affort the default 1 MB+ (virtual-memory) stack space per thread that many OSes give you by default.) The main thing that the EDTK implementation does not currently do is allow dynamic creation of entirely new thread-pools (for a given driver instance) at runtime. That's because the choice of which thread-pool to use to execute which (wrapped) library call is entirely static in the current EDTK implementation. I haven't yet seen a use-case for allowing Erlang code to dynamically choose which thread-pool to use. In fact, as the particular pattern of thread-pool use is often critical to avoiding resource starvation or several classes of deadlock, I think it would probably be quite dangerous to expose that level of control to applications (certainly that's true for the berkeley_db driver). Chris On Fri, Dec 19, 2008 at 12:07 AM, Raimo Niskanen wrote: > On Thu, Dec 18, 2008 at 01:52:10PM -0800, Chris Newcombe wrote: >> >> I think it would be _great_ if the VM/driver interface provided a more traditional thread >> >> pool/queue API in addition to the existing async functionality. >> >> Agreed. Some libraries even need more than one thread pool. >> >> If you use the latest version of the Erlang Driver Toolkit >> >> http://www.snookles.com/erlang/edtk/ >> >> ... it allows the driver to use an arbitrary number of private >> thread-pools (e.g. the Berkeley DB driver required 5 separate thread >> pools to avoid potential thread-level deadlock). >> >> Also, for full runtime visibility and control, the EDTK thread-pools >> can be examined and re-sized at runtime (i.e. increase the number of >> threads independently, per thread pool). You can also set the stack >> size for the threads, and set a limit on the length of the >> command-queue for each thread pool (important for flow control). >> >> EDTK now provides these features for all generated drivers -- it is >> trivial to set up. See the declarations at top of >> examples/berkeley_db/berkeley_db.xml for an example. >> >> If the Erlang VM does ever provide a better threadpool facility, it >> would be great if it had these same features flexibility (you could >> adapt the code from EDTK, as it is BSD-licensed and has been well >> tested). The fact that the BerkeleyDB driver needed these features >> is an existance-proof of their value. > > Very interesting. We will certainly have a look at this. > Does it work on Windows too? > > What I had in mind to add was a thinner layer on pthreads > or whatever the emulator is using, so drivers could manage > threads on their own. > > >> >> Chris >> >> Example snippets from the berkeley_db driver test suite: >> >> ok = ?BDB:set_threadpool_params(BdbPort, >> ?BDB_THREADPOOL_ID_WORKERS, 5, 64*1024, 2000), >> >> [{edtk_threadpool_id, ?BDB_THREADPOOL_ID_WORKERS}, >> {curr_queue_len, 0}, >> {curr_idle_threads, 30}, >> {num_threads, 30}, >> {curr_enqueued_poison_pills, 0}, >> {queue_len_limit, 1000}] = >> ?BDB:get_threadpool_info(BdbPort, ?BDB_THREADPOOL_ID_WORKERS), >> >> Chris >> >> >> On Thu, Dec 18, 2008 at 7:55 AM, Raimo Niskanen >> wrote: >> > On Thu, Dec 18, 2008 at 08:08:06AM -0700, Dave Smith wrote: >> >> One other note...I eventually wrote my own thread pool/queue for load >> >> balancing purposes. async_* can cause the load to be very spiky if you >> >> can not predict the amount of time a queued operation might take >> >> (which is usually the point of using threads...). I think it would be >> >> _great_ if the VM/driver interface provided a more traditional thread >> >> pool/queue API in addition to the existing async functionality. I know >> >> of several Erlang drivers that have had to write their own and it can >> >> be a very challenging problem to get right. :) >> > >> > Aggreed. It has been on the Future Plans list forever. >> > Using async thread for e.g prime number calculations >> > will today block random file operations... >> > >> >> >> >> D. >> >> >> >> On Thu, Dec 18, 2008 at 7:36 AM, Dave Smith wrote: >> >> >>>>> Is it the responsibility of the code in the stop() callback to call >> >> >>>>> driver_async_cancel() on each outstanding async work item, or will this >> >> >>>>> be done automatically by the emulator before the call to stop()? >> >> > >> >> > Yes, it is up to the driver to cancel outstanding items. In wrestling >> >> > with this recently, I found that the best approach was to cancel all >> >> > the items and then queue up a sentinel callback that triggers a >> >> > condition variable. I then wait for that cv to get signaled and know >> >> > at that point that the driver is clear to shutdown. This approach >> >> > seemed to work quite well on a 8 proc box with reasonable load -- >> >> > YMMV. :) >> >> > >> >> >>>>> If this is the responsibility of the code in stop(), is it guaranteed >> >> >>>>> that no async work item will be executing or scheduled during the call >> >> >>>>> to the stop() callback? >> >> >>>>> >> >> >>>>> If no guarantee is made, is holding the PDL necessary and sufficient to >> >> >>>>> guarantee this? >> >> > >> >> > I researched this, and I believe that the answer is "no". Scheduling >> >> > the async work item does increment the PDL ref count when the item is >> >> > _inserted_ into the queue. Once the item is in the queue, all bets are >> >> > off -- the only guarantee you have is that the PDL won't disappear >> >> > (i.e. you can safely lock/unlock it). The PDL says nothing about >> >> > whether or not the async work item is executing during stop(). It >> >> > seems to be the responsibility of the driver author to sort out these >> >> > intricate timing issues. >> >> > >> >> > erts/emulator/beam/erl_async.c is where all the code of interest resides. >> >> > >> >> > It's entirely possible that I have made gross errors in my reading of >> >> > the emulator code and would happily receive instruction from one of >> >> > the core VM team. :) >> >> > >> >> > D. >> >> > >> >> _______________________________________________ >> >> erlang-questions mailing list >> >> erlang-questions@REDACTED >> >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > >> > -- >> > >> > / Raimo Niskanen, Erlang/OTP, Ericsson AB >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://www.erlang.org/mailman/listinfo/erlang-questions >> > >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > From raimo+erlang-questions@REDACTED Fri Dec 19 15:36:20 2008 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 19 Dec 2008 15:36:20 +0100 Subject: [erlang-questions] : : : : driver_entry stop() and driver_async() interaction In-Reply-To: <20081219135220.GB10968@erix.ericsson.se> References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> <494A44FB.5030309@alertlogic.net> <20081218155426.GC23981@erix.ericsson.se> <20081219135220.GB10968@erix.ericsson.se> Message-ID: <20081219143620.GA13337@erix.ericsson.se> Update. We plan while fixing the bug with async_free() mentioned below to introduce a reference counter of async jobs so it will be guaranteed that stop() is not called until all async jobs are done. While we are at it we plan to introduce a driver flag indicating that the driver wants to be called on flush() if there are pending async jobs (as well as today if the IO queue is not empty). Hopefully for R13. On Fri, Dec 19, 2008 at 02:52:20PM +0100, Raimo Niskanen wrote: > Here are the results from the internal meeting... > > On Thu, Dec 18, 2008 at 04:54:26PM +0100, Raimo Niskanen wrote: > > On Thu, Dec 18, 2008 at 06:41:31AM -0600, Paul Fisher wrote: > > > Any word on this? > > > > Sorry, no. I will try to summon an internal meeting about this... > > > > > > > > > > > Raimo Niskanen wrote: > > > > On Thu, Nov 06, 2008 at 12:22:45PM -0600, Paul Fisher wrote: > > > >> Can anyone comment on this question i sent a few weeks ago? > > > >> > > > >> When the port owner terminates and there are driver_async() requests > > > >> scheduled and not yet executed, I am seeing them outstanding at the time > > > >> of the stop() callback. > > > > > > > > We will take a look at it and make it clear in some > > > > documentation and give you an answer. It will take a bit of > > > > code review to be certain... > > > > > > > >> > > > >> Paul Fisher wrote: > > > >>> Question about work scheduled on async threads via driver_async() and > > > >>> still pending (i.e. they are still on the queue to be executed,) when > > > >>> the stop() callback is invoked. Specifically, assuming smp w/async > > > >>> thread pool and the driver marked ERL_DRV_FLAG_USE_PORT_LOCKING. > > > >>> > > > >>> Is it the responsibility of the code in the stop() callback to call > > > >>> driver_async_cancel() on each outstanding async work item, or will this > > > >>> be done automatically by the emulator before the call to stop()? > > The emulator will not cancel the jobs. You may cancel > async jobs from the stop() callback, but running > jobs will keep on running and fail to be cancelled. > > The trick Dave Smith described in another post works (apparently). > In the stop() callback, cancel all async jobs. Some may not > cancel since they are already running. Then start a new > special async job that on invocation triggers a condition > variable that the stop() callback waits for after starting > that special async job. In that way stop() finishes after > all async jobs are done, and when stop() exits the port > dies. Period. This of course blocks the scheduler thread > executing stop() until all async jobs are done. > > But leaving async jobs behind after stop() has exited is > not supposed to be wrong. After the async job is done > either the async_ready() callback is executed if it > exists, or the async_free() async callback is executed. > The async_free() async callback is also executed > if the async job is cancelled. Unfortunately there is > currently a bug so the async_free() async callback > is not executed if the port dies before async_ready() > is supposed to be executed causing a memory leak in > this case. > > After this bug has been fixed you may (supposedly) just > leave the async jobs around after stop() callback and > their async_free() async callback will be executed > to free their allocated memory, if this is fine > with your application. > > Another trick is to keep data in the IO queue. If there > is data in the IO queue when the port is killed, the > flush() callback is executed to try to force data > out of the queue. The flush() callback does not have > to succeed in flushing the data. It is more or less > an informative callback. When the last data in > the IO queue is consumed through driver_deq(), > the stop() callback will be executed. If you use > the IO queue to communicate with the async jobs > you can make it so they automatically will have to > be done before the stop() callback is executed. > For some applications this is natural and for > others it is a hack. > > > > >>> > > > >>> If this is the responsibility of the code in stop(), is it guaranteed > > > >>> that no async work item will be executing or scheduled during the call > > > >>> to the stop() callback? > > There are no such guarantees. Async jobs are supposed to go > in parallell with other port callbacks. If you use the > IO queue from other threads than the scheduler threads > (regular callbacks), e.g from async jobs, you must protect > accesses to it using the port data lock (PDL). Just as if you use > other data common to the async thread and the driver callbacks > it must also be lock protected. You can use the PDL for this > or a lock of your own. > > > > >>> > > > >>> If no guarantee is made, is holding the PDL necessary and sufficient to > > > >>> guarantee this? > > No, holding the PDL only synchronises accesses of the IO queue. > There may come other emulator port data that also will be > protected by this lock. > > > > >> > > > >> -- > > > >> paul > > > >> _______________________________________________ > > > >> erlang-questions mailing list > > > >> erlang-questions@REDACTED > > > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > -- > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From pfisher@REDACTED Fri Dec 19 15:36:18 2008 From: pfisher@REDACTED (Paul Fisher) Date: Fri, 19 Dec 2008 08:36:18 -0600 Subject: [erlang-questions] : : : driver_entry stop() and driver_async() interaction In-Reply-To: <20081219135220.GB10968@erix.ericsson.se> References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> <494A44FB.5030309@alertlogic.net> <20081218155426.GC23981@erix.ericsson.se> <20081219135220.GB10968@erix.ericsson.se> Message-ID: <494BB162.9090308@alertlogic.net> Thank you very much for the clarification. I can work with this, now that I know the rules. Hopefully, some of this information can be put into the driver doc in the next release so that the processing model and responsibilities are clear. Raimo Niskanen wrote: > Here are the results from the internal meeting... -- paul From mark@REDACTED Fri Dec 19 16:07:29 2008 From: mark@REDACTED (Mark Scandariato) Date: Fri, 19 Dec 2008 10:07:29 -0500 Subject: [erlang-questions] Yet another cross-compilation question Message-ID: Hi all, I'm trying to cross-compile Erlang (R12B-5) for BlueCat Linux on a Xilinx Microblaze. Configuration was pretty simple (posted here for posterity and possible ridicule): $ export ac_cv_func_getaddrinfo=no $ ./configure --disable-hipe --without-java --without-ssl --build=i686-pc-cygwin --host=microblaze-linux --prefix=/tmp/erlang But the build choked on beam_emu.c: beam/beam_emu.c: In function 'process_main': beam/beam_emu.c:4875: internal compiler error: in redirect_branch_edge, at cfgrtl.c:942 gcc is version 4.1.1 Any suggestions (other than get a newer/older compiler)? Is this a known problem with gcc 4.1.1? Thanks, Mark Scandariato. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.newcombe@REDACTED Fri Dec 19 16:08:11 2008 From: chris.newcombe@REDACTED (Chris Newcombe) Date: Fri, 19 Dec 2008 07:08:11 -0800 Subject: [erlang-questions] : : : : driver_entry stop() and driver_async() interaction In-Reply-To: <20081219143620.GA13337@erix.ericsson.se> References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> <494A44FB.5030309@alertlogic.net> <20081218155426.GC23981@erix.ericsson.se> <20081219135220.GB10968@erix.ericsson.se> <20081219143620.GA13337@erix.ericsson.se> Message-ID: <781dd98c0812190708y66eb7fb0pd48c7fbc0f9870d8@mail.gmail.com> > We plan while fixing the bug with async_free() mentioned below > to introduce a reference counter of async jobs so it will be > guaranteed that stop() is not called until all async jobs are done. Excellent. But please could you provide APIs to increment and decrement that reference count, so that drivers that implement their own private thread-pools can achieve the same behaviour? Also, I hate to cause feature creep, but if you do implement the above reference count/delayed 'stop', please could you also add an optional "prepare to stop" callback, which the VM calls when the Erlang code closes the port (e.g. the port owner process dies, or something explicitly closes the port)? Some drivers often have fairly long-running operations (seconds/minutes) running in their own threads, and would like timely notification that they should force such jobs to terminate, to allow "stop" to be called as soon as possible (the berkeley_db driver has to do this). i.e. It's not always the case that running async jobs should be left to complete in their own sweet time. (Note that this is different from 'cancelling' pending-but-not-yet-started jobs.) Rationale: It does actually matter a lot to some drivers that "stop" is called as quickly as possible (and completes as quickly as possible) after the Erlang side closes the port. Very often, the driver is being stopped because the port-owner is being restarted by a supervisor, so another driver instance will be created almost immediately. If the driver uses external resources (e.g. files) that it requires exclusive access to, then the driver has internal syncrhonization on those resources. e.g. The berkeley_db library obviously uses Berkeley DB files on disk, and the driver uses flock() to meet the serialization requirements imposed by Berkeley DB when opening those files and running the "transactional recovery" process. So without a "prepare to stop" mechanism, stop() might not be called for significant time after the Erlang side closes the port, but a supervisor on the Erlang side will very likely (and quickly) spawn another child process which will attempt to open another instance of the driver. The driver's internal synchronization code (flock) will be forced to block the initialization of the new driver instance until stop() is finally called and completed on the old driver instance. Many thanks, Chris On Fri, Dec 19, 2008 at 6:36 AM, Raimo Niskanen wrote: > Update. > > We plan while fixing the bug with async_free() mentioned below > to introduce a reference counter of async jobs so it will be > guaranteed that stop() is not called until all async jobs are done. > > While we are at it we plan to introduce a driver flag > indicating that the driver wants to be called on > flush() if there are pending async jobs (as well as > today if the IO queue is not empty). > > Hopefully for R13. > > > > On Fri, Dec 19, 2008 at 02:52:20PM +0100, Raimo Niskanen wrote: >> Here are the results from the internal meeting... >> >> On Thu, Dec 18, 2008 at 04:54:26PM +0100, Raimo Niskanen wrote: >> > On Thu, Dec 18, 2008 at 06:41:31AM -0600, Paul Fisher wrote: >> > > Any word on this? >> > >> > Sorry, no. I will try to summon an internal meeting about this... >> > >> > > >> > > >> > > Raimo Niskanen wrote: >> > > > On Thu, Nov 06, 2008 at 12:22:45PM -0600, Paul Fisher wrote: >> > > >> Can anyone comment on this question i sent a few weeks ago? >> > > >> >> > > >> When the port owner terminates and there are driver_async() requests >> > > >> scheduled and not yet executed, I am seeing them outstanding at the time >> > > >> of the stop() callback. >> > > > >> > > > We will take a look at it and make it clear in some >> > > > documentation and give you an answer. It will take a bit of >> > > > code review to be certain... >> > > > >> > > >> >> > > >> Paul Fisher wrote: >> > > >>> Question about work scheduled on async threads via driver_async() and >> > > >>> still pending (i.e. they are still on the queue to be executed,) when >> > > >>> the stop() callback is invoked. Specifically, assuming smp w/async >> > > >>> thread pool and the driver marked ERL_DRV_FLAG_USE_PORT_LOCKING. >> > > >>> >> > > >>> Is it the responsibility of the code in the stop() callback to call >> > > >>> driver_async_cancel() on each outstanding async work item, or will this >> > > >>> be done automatically by the emulator before the call to stop()? >> >> The emulator will not cancel the jobs. You may cancel >> async jobs from the stop() callback, but running >> jobs will keep on running and fail to be cancelled. >> >> The trick Dave Smith described in another post works (apparently). >> In the stop() callback, cancel all async jobs. Some may not >> cancel since they are already running. Then start a new >> special async job that on invocation triggers a condition >> variable that the stop() callback waits for after starting >> that special async job. In that way stop() finishes after >> all async jobs are done, and when stop() exits the port >> dies. Period. This of course blocks the scheduler thread >> executing stop() until all async jobs are done. >> >> But leaving async jobs behind after stop() has exited is >> not supposed to be wrong. After the async job is done >> either the async_ready() callback is executed if it >> exists, or the async_free() async callback is executed. >> The async_free() async callback is also executed >> if the async job is cancelled. Unfortunately there is >> currently a bug so the async_free() async callback >> is not executed if the port dies before async_ready() >> is supposed to be executed causing a memory leak in >> this case. >> >> After this bug has been fixed you may (supposedly) just >> leave the async jobs around after stop() callback and >> their async_free() async callback will be executed >> to free their allocated memory, if this is fine >> with your application. >> >> Another trick is to keep data in the IO queue. If there >> is data in the IO queue when the port is killed, the >> flush() callback is executed to try to force data >> out of the queue. The flush() callback does not have >> to succeed in flushing the data. It is more or less >> an informative callback. When the last data in >> the IO queue is consumed through driver_deq(), >> the stop() callback will be executed. If you use >> the IO queue to communicate with the async jobs >> you can make it so they automatically will have to >> be done before the stop() callback is executed. >> For some applications this is natural and for >> others it is a hack. >> >> > > >>> >> > > >>> If this is the responsibility of the code in stop(), is it guaranteed >> > > >>> that no async work item will be executing or scheduled during the call >> > > >>> to the stop() callback? >> >> There are no such guarantees. Async jobs are supposed to go >> in parallell with other port callbacks. If you use the >> IO queue from other threads than the scheduler threads >> (regular callbacks), e.g from async jobs, you must protect >> accesses to it using the port data lock (PDL). Just as if you use >> other data common to the async thread and the driver callbacks >> it must also be lock protected. You can use the PDL for this >> or a lock of your own. >> >> > > >>> >> > > >>> If no guarantee is made, is holding the PDL necessary and sufficient to >> > > >>> guarantee this? >> >> No, holding the PDL only synchronises accesses of the IO queue. >> There may come other emulator port data that also will be >> protected by this lock. >> >> > > >> >> > > >> -- >> > > >> paul >> > > >> _______________________________________________ >> > > >> erlang-questions mailing list >> > > >> erlang-questions@REDACTED >> > > >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > > > >> > > >> > > _______________________________________________ >> > > erlang-questions mailing list >> > > erlang-questions@REDACTED >> > > http://www.erlang.org/mailman/listinfo/erlang-questions >> > >> > -- >> > >> > / Raimo Niskanen, Erlang/OTP, Ericsson AB >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://www.erlang.org/mailman/listinfo/erlang-questions >> >> -- >> >> / Raimo Niskanen, Erlang/OTP, Ericsson AB >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From koushik.list@REDACTED Fri Dec 19 16:16:42 2008 From: koushik.list@REDACTED (Koushik Narayanan) Date: Fri, 19 Dec 2008 20:46:42 +0530 Subject: [erlang-questions] extending function clauses In-Reply-To: <21091060.post@talk.nabble.com> References: <21091060.post@talk.nabble.com> Message-ID: <20081219151642.GA22321@bsd.top> Hi, On Fri, Dec 19, 2008 at 05:59:58AM -0800, Ittay Dror wrote: > > Hi, > > Is it possible to add clauses to a function that is defined in another > module? AFAIK No. > > More elaborately: say a 3rd party module 'geometry' defines a function > 'area', for each shape (shapes are defined as tuples where the first element > is an atom naming the shape) there is a clause (so there is a clause for > 'circle', 'square' etc.). Now, I have a new shape. Can I extend > 'geometry:area' so it can handle my new shape (by adding a new clause). I > cannot change the original module's file. 'geometry:area' is used by other > functions to do more sophisticated stuff (so defining my own area function > is not effective). If not, what is the erlang way of handling this > situation? For such a problem you could define a new module say geometry_new whos shape function handles the new clause alone, and for other clauses calles geometry:shape like shape({new_shape,..}) -> do_the_new_stuff; shape(Anything_else) -> geometry:shape(Anthing_else). HTH, Koushik Narayanan From christophe.romain@REDACTED Thu Dec 18 09:32:18 2008 From: christophe.romain@REDACTED (Christophe Romain) Date: Thu, 18 Dec 2008 09:32:18 +0100 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: References: Message-ID: <20081218083218.GA3358@localhost> cean.process-one.net yaws-1.73 and mnesia powered. From dave.smith.to@REDACTED Fri Dec 19 18:03:02 2008 From: dave.smith.to@REDACTED (Dave Smith) Date: Fri, 19 Dec 2008 12:03:02 -0500 Subject: [erlang-questions] curious In-Reply-To: References: <494A4C55.2000409@charpi.net> Message-ID: <5ea453f90812190903p4c46addg98f147aeecc23613@mail.gmail.com> How may schedulers are running??? You will get a notification when starting the shell... # erl Erlang (BEAM) emulator version 5.6.1 [source] [smp:2] [async-threads:0] [kernel-poll:false] A good example of writing linked-in drivers with multiple opened ports is in the crypto library. 2008/12/19 atul goyal > hi...i got the results... it seems that instantiating the driver multiple > times and concurrently sending the messages is not improving the speed at > all. I think that since im using no async threads on OS level ,my > performance wont increase. And it wud be the same weather i use seuqential > or concurrent techniques as long as the erts is running on a single OS > thread....well > > > On Fri, Dec 19, 2008 at 10:24 AM, atul goyal wrote: > >> >> well quite true... and erlang does a nice job when it comes to >> concurrency. Now when i have made the changes let me test out the actual >> thruput of the entire system...i will mail the results soon. >> thankeeeee >> atul >> pyro >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pfisher@REDACTED Fri Dec 19 16:31:38 2008 From: pfisher@REDACTED (Paul Fisher) Date: Fri, 19 Dec 2008 09:31:38 -0600 Subject: [erlang-questions] : : : : driver_entry stop() and driver_async() interaction In-Reply-To: <781dd98c0812190708y66eb7fb0pd48c7fbc0f9870d8@mail.gmail.com> References: <48F75F09.7020108@alertlogic.net> <491335F5.3060602@alertlogic.net> <20081107104759.GA1287@erix.ericsson.se> <494A44FB.5030309@alertlogic.net> <20081218155426.GC23981@erix.ericsson.se> <20081219135220.GB10968@erix.ericsson.se> <20081219143620.GA13337@erix.ericsson.se> <781dd98c0812190708y66eb7fb0pd48c7fbc0f9870d8@mail.gmail.com> Message-ID: <494BBE5A.5080403@alertlogic.net> Chris Newcombe wrote: >> We plan while fixing the bug with async_free() mentioned below >> to introduce a reference counter of async jobs so it will be >> guaranteed that stop() is not called until all async jobs are done. Having this as the default model is the right thing to do, since it is the safest. Thank you for including this in the R13 plan. > Excellent. But please could you provide APIs to increment and > decrement that reference count, so that drivers that implement their > own private thread-pools can achieve the same behaviour? > > Also, I hate to cause feature creep, but if you do implement the above > reference count/delayed 'stop', please could you also add an optional > "prepare to stop" callback, which the VM calls when the Erlang code > closes the port (e.g. the port owner process dies, or something > explicitly closes the port)? Some drivers often have fairly > long-running operations (seconds/minutes) running in their own > threads, and would like timely notification that they should force > such jobs to terminate, to allow "stop" to be called as soon as > possible (the berkeley_db driver has to do this). i.e. It's not > always the case that running async jobs should be left to complete in > their own sweet time. (Note that this is different from 'cancelling' > pending-but-not-yet-started jobs.) > > Rationale: It does actually matter a lot to some drivers that "stop" > is called as quickly as possible (and completes as quickly as > possible) after the Erlang side closes the port. Very often, the > driver is being stopped because the port-owner is being restarted by a > supervisor, so another driver instance will be created almost > immediately. I would second this. We have long-running work that could be shutdown if we had a signal of termination intent. -- paul From mikpe@REDACTED Fri Dec 19 18:14:52 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Fri, 19 Dec 2008 18:14:52 +0100 Subject: [erlang-questions] Yet another cross-compilation question In-Reply-To: References: Message-ID: <18763.54924.635628.105363@harpo.it.uu.se> Mark Scandariato writes: > Hi all, > > I'm trying to cross-compile Erlang (R12B-5) for BlueCat Linux on a Xilinx > Microblaze. > > Configuration was pretty simple (posted here for posterity and possible > ridicule): > > $ export ac_cv_func_getaddrinfo=no > $ ./configure --disable-hipe --without-java --without-ssl > --build=i686-pc-cygwin --host=microblaze-linux --prefix=/tmp/erlang > > But the build choked on beam_emu.c: > > beam/beam_emu.c: In function 'process_main': > beam/beam_emu.c:4875: internal compiler error: in redirect_branch_edge, at > cfgrtl.c:942 > > gcc is version 4.1.1 > > Any suggestions (other than get a newer/older compiler)? Is this a known > problem with gcc 4.1.1? This very clearly is a gcc bug. gcc-4.1.1 is fairly old, you should try something newer. I don't recall seeing anything like this problem on any other platform, so chances are it's a Microblaze-specific bug. From mark@REDACTED Fri Dec 19 18:26:34 2008 From: mark@REDACTED (Mark Scandariato) Date: Fri, 19 Dec 2008 12:26:34 -0500 Subject: [erlang-questions] Yet another cross-compilation question In-Reply-To: <18763.54924.635628.105363@harpo.it.uu.se> References: <18763.54924.635628.105363@harpo.it.uu.se> Message-ID: On Fri, Dec 19, 2008 at 12:14 PM, Mikael Pettersson wrote: > Mark Scandariato writes: > > Hi all, > > > > I'm trying to cross-compile Erlang (R12B-5) for BlueCat Linux on a > Xilinx > > Microblaze. > > > > Configuration was pretty simple (posted here for posterity and possible > > ridicule): > > > > $ export ac_cv_func_getaddrinfo=no > > $ ./configure --disable-hipe --without-java --without-ssl > > --build=i686-pc-cygwin --host=microblaze-linux --prefix=/tmp/erlang > > > > But the build choked on beam_emu.c: > > > > beam/beam_emu.c: In function 'process_main': > > beam/beam_emu.c:4875: internal compiler error: in redirect_branch_edge, > at > > cfgrtl.c:942 > > > > gcc is version 4.1.1 > > > > Any suggestions (other than get a newer/older compiler)? Is this a known > > problem with gcc 4.1.1? > > This very clearly is a gcc bug. gcc-4.1.1 is fairly old, you should try > something newer. I don't recall seeing anything like this problem on any > other platform, so chances are it's a Microblaze-specific bug. > That's what I figured - thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.smith.to@REDACTED Fri Dec 19 18:44:18 2008 From: dave.smith.to@REDACTED (Dave Smith) Date: Fri, 19 Dec 2008 12:44:18 -0500 Subject: [erlang-questions] extending function clauses In-Reply-To: <21091060.post@talk.nabble.com> References: <21091060.post@talk.nabble.com> Message-ID: <5ea453f90812190944h25e940fre4b52f25a41d1a@mail.gmail.com> In Erlang, one might write a geometry server that allows you to register another module with a callback to calculate area. If you come from an OO background, it's sometimes helpful to consider how objects map to Erlang processes instead of modules. 2008/12/19 Ittay Dror > > Hi, > > Is it possible to add clauses to a function that is defined in another > module? > > More elaborately: say a 3rd party module 'geometry' defines a function > 'area', for each shape (shapes are defined as tuples where the first > element > is an atom naming the shape) there is a clause (so there is a clause for > 'circle', 'square' etc.). Now, I have a new shape. Can I extend > 'geometry:area' so it can handle my new shape (by adding a new clause). I > cannot change the original module's file. 'geometry:area' is used by other > functions to do more sophisticated stuff (so defining my own area function > is not effective). If not, what is the erlang way of handling this > situation? > > Thank you, > Ittay > -- > View this message in context: > http://www.nabble.com/extending-function-clauses-tp21091060p21091060.html > Sent from the Erlang Questions mailing list archive at Nabble.com. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe@REDACTED Fri Dec 19 19:04:12 2008 From: joe@REDACTED (Joe Williams) Date: Fri, 19 Dec 2008 10:04:12 -0800 Subject: [erlang-questions] Seattle Erlounge Message-ID: <494BE21C.3070406@joetify.com> I have seen posts in the past regarding Seattle Erlounge's. I recently moved to Seattle and wondered if anyone has any current information. Thanks. -Joe -- Name: Joseph A. Williams Email: joe@REDACTED Blog: http://www.joeandmotorboat.com/ From aconbere@REDACTED Fri Dec 19 19:49:05 2008 From: aconbere@REDACTED (anders conbere) Date: Fri, 19 Dec 2008 10:49:05 -0800 Subject: [erlang-questions] Seattle Erlounge In-Reply-To: <494BE21C.3070406@joetify.com> References: <494BE21C.3070406@joetify.com> Message-ID: <8ca3fbe80812191049o4d67cacaxa2263c2bcbeffd50@mail.gmail.com> On Fri, Dec 19, 2008 at 10:04 AM, Joe Williams wrote: > I have seen posts in the past regarding Seattle Erlounge's. I recently > moved to Seattle and wondered if anyone has any current information. We had a nice meetup when Lennart Ohman was in town. Very informal, not sure if there is anything regular in the works. There's definitely a few of us out here, and I know I'm down to meet some people and talk about some problems I'm trying to solve. ~ Anders > > Thanks. > -Joe > > -- > Name: Joseph A. Williams > Email: joe@REDACTED > Blog: http://www.joeandmotorboat.com/ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From joe@REDACTED Fri Dec 19 20:52:30 2008 From: joe@REDACTED (Joe Williams) Date: Fri, 19 Dec 2008 11:52:30 -0800 Subject: [erlang-questions] Seattle Erlounge In-Reply-To: <8ca3fbe80812191049o4d67cacaxa2263c2bcbeffd50@mail.gmail.com> References: <494BE21C.3070406@joetify.com> <8ca3fbe80812191049o4d67cacaxa2263c2bcbeffd50@mail.gmail.com> Message-ID: <494BFB7E.8030802@joetify.com> Sounds good to me. Anyone else up for meeting some time in the next couple weeks? -Joe On 12/19/2008 10:49 AM, anders conbere wrote: > On Fri, Dec 19, 2008 at 10:04 AM, Joe Williams wrote: > >> I have seen posts in the past regarding Seattle Erlounge's. I recently >> moved to Seattle and wondered if anyone has any current information. >> > > We had a nice meetup when Lennart Ohman was in town. Very informal, > not sure if there is anything regular in the works. There's definitely > a few of us out here, and I know I'm down to meet some people and talk > about some problems I'm trying to solve. > > ~ Anders > > >> Thanks. >> -Joe >> >> -- >> Name: Joseph A. Williams >> Email: joe@REDACTED >> Blog: http://www.joeandmotorboat.com/ >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> -- Name: Joseph A. Williams Email: joe@REDACTED Blog: http://www.joeandmotorboat.com/ From roger.larsson@REDACTED Sat Dec 20 01:11:13 2008 From: roger.larsson@REDACTED (Roger Larsson) Date: Sat, 20 Dec 2008 01:11:13 +0100 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: References: Message-ID: <200812200111.13645.roger.larsson@e-gatan.se> I remember reading that Amazon uses Erlang for some Web services. Using Google I found several references - like this one. http://yarivsblog.com/articles/2007/12/14/amazon-simpledb-runs-on-erlang/ /RogerL On Wednesday 17 December 2008, Daniel Cer wrote: > I'm building a wiki that documents what languages, frameworks, and > libraries are being used by various websites & webapps. One of the big > goals of the project is to highlight the diverse set of languages and > other components that people use to power their sites. > > Right now, I'm in the process of searching out and adding Erlang > webapps. So far, I've found about half a dozen apps (since it might be > of interest to some people here, the Erlang sites I've found are > posted at the bottom of this e-mail). > > Does anyone here have an Erlang powered website or webapp? If you do, > would you mind sharing the URL and what other support components > you're using (e.g, ErlyWeb, Erlang-Web, MochiWeb, Mnesia, etc.)? > > Thanks, Dan > > The current list of Erlang powered sites: > > Beer Riot - Community beer review and enthusiast site. > http://beerriot.com/ > > Vimagi - Social/collaborative painting site > http://vimagi.com/ > > Twoorl - A twitter like micro-blogging service > http://twoorl.com/ > > MochiBot ? Flash tracking and monitoring service > http://www.mochibot.com/ > > Mochiads ? Flash game advertising and distribution service > http://www.mochiads.com/ > > DayFindr - Collaborative scheduling webapp > http://www.dayfindr.com/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From exta7@REDACTED Sat Dec 20 02:42:49 2008 From: exta7@REDACTED (Zvi) Date: Fri, 19 Dec 2008 17:42:49 -0800 (PST) Subject: [erlang-questions] extending function clauses In-Reply-To: <21091060.post@talk.nabble.com> References: <21091060.post@talk.nabble.com> Message-ID: <21100978.post@talk.nabble.com> Hi Ittay, Function caluses in Erlang are just syntactic shugar for case, i.e. f(Pattern1) -> E1; f(Pattern2) -> E2; ... f(PatternN) -> EN. is equivalent to: f(X) -> case X of f(Pattern1) -> E1; f(Pattern2) -> E2; ... f(PatternN) -> EN end. The function clauses must be defined in consequtive order in the same source file. here the textbook shapes example I wrote, to show how to program in Erlang in OOP style: ========= gen_shape.erl ======= -module(gen_shape). -export([behaviour_info/1]). behaviour_info(callbacks) -> [{area, 1}]; behaviour_info(_Other) -> undefined. ========= geometry.erl ======= -module(geometry). -behaviour(gen_shape). -export([area/1]). area({Module, Shape}) -> Module:area(Shape). ========= rectangle.erl ======= -module(rectangle). -behaviour(gen_shape). -export([new/2, area/1]). new(Width,Height) when is_number(Width), is_number(Height) -> {?MODULE, {Width,Height}}. area({Width, Height}) -> Width*Height. ========= square.erl ======= -module(square). -behaviour(gen_shape). -export([new/1, area/1]). new(Size) when is_number(Size) -> {?MODULE, Size}. area(Size) when is_number(Size) -> Size*Size. ========= circle.erl ======= -module(circle). -behaviour(gen_shape). -export([new/1, area/1]). new(Radius) when is_number(Radius) -> {?MODULE, Radius}. area(Radius) when is_number(Radius) -> math:pi()*Radius*Radius. ======= END ============ Example of usage: 19> Shape1 = rectangle:new(5,7). {rectangle,{5,7}} 20> geometry:area(Shape1). 35 21> Shape2 = circle:new(10). {circle,10} 22> geometry:area(Shape2). 314.1592653589793 23> 23> Shape3 = square:new(5). {square,5} 24> geometry:area(Shape3). 25 25> 25> Shape4 = {pentagon,7}. {pentagon,7} 26> geometry:area(Shape4). ** exception error: undefined function pentagon:area/1 Two easy modifications for this example: 1. It's possible to change this code to use both generic and specific area/1 function (change representation of each shape to be tuple {ModuleName, ShapeData} and geometry:area/1 to: area({Module, Shape}) -> Module:area({Module, Shape}). 2. Let's say, we want to derive square from rectange, so in rectange.erl: new(Size) when is_number(Size) -> new:rectangle(Size, Size). %% still need to define area/1 b/c it's in behaviour area(_) -> erlang:error({should,never,be,called}). Hope this helps, Zvi -- View this message in context: http://www.nabble.com/extending-function-clauses-tp21091060p21100978.html Sent from the Erlang Questions mailing list archive at Nabble.com. From daniel.cer@REDACTED Sat Dec 20 02:47:01 2008 From: daniel.cer@REDACTED (Daniel Cer) Date: Fri, 19 Dec 2008 17:47:01 -0800 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: References: Message-ID: >> Does anyone here have an Erlang powered website or webapp? If you do, >> would you mind sharing the URL and what other support components >> you're using (e.g, ErlyWeb, Erlang-Web, MochiWeb, Mnesia, etc.)? >> > > Thanks. The responses so far have been great. > > Any other sites that could be listed? It doesn't have to be anything big, small personal projects are just fine. > > Also, would anybody mind if I listed their name with their site? This would just be your name (e.g., 'Michael McDaniel'), and not your e-mail address. > Sorry, for the delay. I went ahead and entered all of the submitted sites except dementiewijzer.nl since it's been taken offline. You can see the complete list at: http://www.appliedstacks.com/PoweredBy/Erlang Hopefully, I haven't done injustice to anybody's site. If I have, you can edit the entries by clicking on them and then pressing the edit button. Or, just e-mail me, and I'll make the changes. The main wiki is very structured. But, just in case you have anything else you want to add and that doesn't fit in the provided fields, each entry also has an unstructured 'Resource Notebook' page associated with it backed by MediaWiki. Just look for the text/link, "See also the resource notebook entry for Site_Name_(website)". Let me know, if you have any suggestions or feature requests. Even though the site is just being run as a hobby, I would really like to make it a useful and valuable a resource for the community. -Dan From exta7@REDACTED Sat Dec 20 02:53:05 2008 From: exta7@REDACTED (Zvi) Date: Fri, 19 Dec 2008 17:53:05 -0800 (PST) Subject: [erlang-questions] extending function clauses In-Reply-To: <21100978.post@talk.nabble.com> References: <21091060.post@talk.nabble.com> <21100978.post@talk.nabble.com> Message-ID: <21101029.post@talk.nabble.com> Zvi wrote: > > Two easy modifications for this example: > > 1. It's possible to change this code to use both generic and specific > area/1 function (change representation of each shape to be tuple > {ModuleName, ShapeData} and geometry:area/1 to: > > area({Module, Shape}) -> Module:area({Module, Shape}). > > 2. Let's say, we want to derive square from rectange, so in rectange.erl: > oops. I mean in square.erl Zvi wrote: > > new(Size) when is_number(Size) > -> new:rectangle(Size, Size). > > %% still need to define area/1 b/c it's in behaviour > area(_) -> erlang:error({should,never,be,called}). > > > Hope this helps, > Zvi > -- View this message in context: http://www.nabble.com/extending-function-clauses-tp21091060p21101029.html Sent from the Erlang Questions mailing list archive at Nabble.com. From exta7@REDACTED Sat Dec 20 03:14:41 2008 From: exta7@REDACTED (Zvi) Date: Fri, 19 Dec 2008 18:14:41 -0800 (PST) Subject: [erlang-questions] extending function clauses In-Reply-To: <21100978.post@talk.nabble.com> References: <21091060.post@talk.nabble.com> <21100978.post@talk.nabble.com> Message-ID: <21101155.post@talk.nabble.com> fixed another typo: Zvi wrote: > > Function caluses in Erlang are just syntactic shugar for case, i.e. > > f(Pattern1) -> E1; > f(Pattern2) -> E2; > ... > f(PatternN) -> EN. > > is equivalent to: > f(X) -> case X of Pattern1 -> E1; Pattern2 -> E2; ... PatternN -> EN end. -- View this message in context: http://www.nabble.com/extending-function-clauses-tp21091060p21101155.html Sent from the Erlang Questions mailing list archive at Nabble.com. From saleyn@REDACTED Sat Dec 20 05:10:15 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Fri, 19 Dec 2008 23:10:15 -0500 Subject: [erlang-questions] Interfacing Erlang to Oracle In-Reply-To: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> References: <12F4FC70-3C13-4016-A7EB-D75491808313@gmail.com> Message-ID: <494C7027.6060900@gmail.com> I just placed a project here that implements an Oracle port program for Erlang. It uses OCCI C++ interface and works with Oracle 10g and later. http://code.google.com/p/erlora/ It's been a while since I last used it but if memory serves execution of DML queries, and DDL plsql blocks worked fine. I was developed with R11B-0, so it may require little updating for R12B-x, but if there are volunteers to resurrect the project, I can grant commit access to repository. Serge Tony Hobbins wrote: > Hi all, > > Can anyone shed any light on best practice for interfacing Erlang to > an Oracle DBMS? > > Specifically I only need query access to a legacy database (mnesia is > not an option unfortunately). > I seem to recall many years ago that work on an OCI interface was > proposed. > I am not sure of the state of any erlang-JDBC ports. > > Any advice or pointers in the right direction would be greatly > appreciated! > > Tony Hobbins > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From jed@REDACTED Sat Dec 20 07:31:11 2008 From: jed@REDACTED (Jed McCaleb) Date: Sat, 20 Dec 2008 01:31:11 -0500 Subject: [erlang-questions] trouble getting application to load Message-ID: So I installed erlang from EPEL on a centos machine. I can't seem to get odbc to work on it though. I get: 12> application:start(odbc). {error,{"no such file or directory","odbc.app"}} but # locate odbc.app /usr/lib/erlang/lib/odbc-2.10.2/ebin/odbc.app and other applications load fine 1> application:load(mnesia). ok 2> application:load(xmerl). ok I don't understand how application:load works. How does it know where to look for these .app files? Thanks for any help, Jed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuscland@REDACTED Sat Dec 20 11:30:25 2008 From: tuscland@REDACTED (Camille Troillard) Date: Sat, 20 Dec 2008 11:30:25 +0100 Subject: [erlang-questions] extending function clauses In-Reply-To: <21101155.post@talk.nabble.com> References: <21091060.post@talk.nabble.com> <21100978.post@talk.nabble.com> <21101155.post@talk.nabble.com> Message-ID: Great tutorial, thanks ! On Sat, Dec 20, 2008 at 3:14 AM, Zvi wrote: > > fixed another typo: > > > Zvi wrote: > > > > Function caluses in Erlang are just syntactic shugar for case, i.e. > > > > f(Pattern1) -> E1; > > f(Pattern2) -> E2; > > ... > > f(PatternN) -> EN. > > > > is equivalent to: > > > > f(X) -> > case X of > Pattern1 -> E1; > Pattern2 -> E2; > ... > PatternN -> EN > end. > > -- > View this message in context: > http://www.nabble.com/extending-function-clauses-tp21091060p21101155.html > Sent from the Erlang Questions mailing list archive at Nabble.com. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuscland@REDACTED Sat Dec 20 14:03:56 2008 From: tuscland@REDACTED (Camille Troillard) Date: Sat, 20 Dec 2008 14:03:56 +0100 Subject: [erlang-questions] Padding a binary to a multiple of 4 bytes Message-ID: Hi ! I am new to Erlang, and would like to ask experienced users some advices on best practices I should adopt. Right now, I would like to know what is the best way of padding a binary to a multiple of 4 bytes. I have written a function like this: pad_to4 (Bin) -> case (size(Bin) rem 4) of 0 -> Bin; Pad -> <> end. I don't find it very elegant, and guess there is a better way of doing this. Perhaps using binary comprehensions? What is your suggestion? Also, I was wondering why the "/binary" suffix was needed if I want to append to the Bin variable. Intuitively, I have written <>, but it doesn't work. Thanks in advance for your help! Best, Camille -------------- next part -------------- An HTML attachment was scrubbed... URL: From nc@REDACTED Sat Dec 20 15:38:19 2008 From: nc@REDACTED (Nicolas Charpentier) Date: Sat, 20 Dec 2008 15:38:19 +0100 Subject: [erlang-questions] trouble getting application to load In-Reply-To: References: Message-ID: <494D035B.1010705@charpi.net> Jed McCaleb wrote: > So I installed erlang from EPEL on a centos machine. I can't seem to get > odbc to work on it though. I get: > 12> application:start(odbc). > {error,{"no such file or directory","odbc.app"}} > > but > # locate odbc.app > /usr/lib/erlang/lib/odbc-2.10.2/ebin/odbc.app > >... > I don't understand how application:load works. How does it know where to > look for these .app files? > Thanks for any help, > Jed. > Hi, application:load/1 uses the code path to find the app file. in your erlang shell type: 1> code:add_path("/usr/lib/erlang/lib/odbc-2.10.2/ebin/"). true 2> application:load(odbc). ok 3> I never compiled odbc on my computer but I think that you have something strange with your erlang installation. Usually all code paths are set by the start.boot file. How did you install the odbc application ? Regards ---- Nicolas Charpentier http://charpi.net From klacke@REDACTED Sat Dec 20 15:49:08 2008 From: klacke@REDACTED (=?ISO-8859-1?Q?Claes_Wikstr=F6m?=) Date: Sat, 20 Dec 2008 15:49:08 +0100 Subject: [erlang-questions] Priviliged ports and effective UID In-Reply-To: <20081218205719.GA26958@herbie> References: <9893-51893@sneakemail.com> <20081029081727.GA31386@erix.ericsson.se> <494AB41E.10800@hyber.org> <20081218205719.GA26958@herbie> Message-ID: <494D05E4.9040703@hyber.org> Michael Radford wrote: > In Linux, it's also extremely easy to forward, say, port 80 to port 8080 > using iptables. Then no setuid programs are needed at all. > Yes, I agree easy, but it's not the same thing. Especially not for virt webservers. The Host: header cannot then be used to uniquely id the right virt server. /klacke From jed@REDACTED Sat Dec 20 16:22:40 2008 From: jed@REDACTED (Jed McCaleb) Date: Sat, 20 Dec 2008 10:22:40 -0500 Subject: [erlang-questions] trouble getting application to load In-Reply-To: <494D035B.1010705@charpi.net> References: <494D035B.1010705@charpi.net> Message-ID: On Sat, Dec 20, 2008 at 9:38 AM, Nicolas Charpentier < nc-dated-1234967906.3da55a@REDACTED> wrote: > Jed McCaleb wrote: > >> So I installed erlang from EPEL on a centos machine. I can't seem to get >> odbc to work on it though. I get: >> 12> application:start(odbc). >> {error,{"no such file or directory","odbc.app"}} >> >> but >> # locate odbc.app >> /usr/lib/erlang/lib/odbc-2.10.2/ebin/odbc.app >> >> ... >> I don't understand how application:load works. How does it know where to >> look for these .app files? >> Thanks for any help, >> Jed. >> >> > > > Hi, > > application:load/1 uses the code path to find the app file. > in your erlang shell type: > > 1> code:add_path("/usr/lib/erlang/lib/odbc-2.10.2/ebin/"). > true > 2> application:load(odbc). > ok > 3> > > I never compiled odbc on my computer but I think that you have something > strange with your erlang installation. Usually all code paths are set by > the start.boot file. > How did you install the odbc application ? Ah thanks that works. And after code:root_dir(). I realized what was going wrong was it was running the erl that I had installed from source. -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangy@REDACTED Sat Dec 20 22:19:01 2008 From: erlangy@REDACTED (Michael McDaniel) Date: Sat, 20 Dec 2008 13:19:01 -0800 Subject: [erlang-questions] What websites/webapps use Erlang? In-Reply-To: References: Message-ID: <20081220211901.GJ10079@delora.autosys.us> Thanks for putting the list together, Daniel. On Fri, Dec 19, 2008 at 05:47:01PM -0800, Daniel Cer wrote: > >> Does anyone here have an Erlang powered website or webapp? If you do, > >> would you mind sharing the URL and what other support components > >> you're using (e.g, ErlyWeb, Erlang-Web, MochiWeb, Mnesia, etc.)? > >> > > > > Thanks. The responses so far have been great. > > > > Any other sites that could be listed? It doesn't have to be anything big, small personal projects are just fine. > > > > Also, would anybody mind if I listed their name with their site? This would just be your name (e.g., 'Michael McDaniel'), and not your e-mail address. > > > > Sorry, for the delay. I went ahead and entered all of the submitted > sites except dementiewijzer.nl since it's been taken offline. > > You can see the complete list at: > > http://www.appliedstacks.com/PoweredBy/Erlang > > Hopefully, I haven't done injustice to anybody's site. If I have, you > can edit the entries by clicking on them and then pressing the edit > button. Or, just e-mail me, and I'll make the changes. > > The main wiki is very structured. But, just in case you have anything > else you want to add and that doesn't fit in the provided fields, each > entry also has an unstructured 'Resource Notebook' page associated > with it backed by MediaWiki. Just look for the text/link, "See also > the resource notebook entry for Site_Name_(website)". > > Let me know, if you have any suggestions or feature requests. Even > though the site is just being run as a hobby, I would really like to > make it a useful and valuable a resource for the community. > > -Dan > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- Michael McDaniel Portland, Oregon, USA From pfisher@REDACTED Sun Dec 21 02:29:29 2008 From: pfisher@REDACTED (Paul Fisher) Date: Sat, 20 Dec 2008 19:29:29 -0600 Subject: [erlang-questions] SIGSEGV - hipe_fill_stacktrace (p=0x2aaaace19970, depth=8, trace=0x2aaaafd010f8), Message-ID: <494D9BF9.8040509@alertlogic.net> Does this ring any bells, or does anyone have any hints about tracking this down? Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1125775712 (LWP 32326)] hipe_fill_stacktrace (p=0x2aaaace19970, depth=8, trace=0x2aaaafd010f8) at hipe/hipe_stack.h:74 74 hipe/hipe_stack.h: No such file or directory. in hipe/hipe_stack.h (gdb) where #0 hipe_fill_stacktrace (p=0x2aaaace19970, depth=8, trace=0x2aaaafd010f8) at hipe/hipe_stack.h:74 #1 0x000000000050aaa4 in hipe_handle_exception (c_p=0x2aaaace19970) at hipe/hipe_native_bif.c:185 #2 0x000000000050ba67 in .nbif_simple_exception () at hipe/hipe_amd64_glue.S:369 #3 0x00002aaaace19970 in ?? () #4 0x00002aaaaab4bd68 in ?? () #5 0x00002aaaace19be8 in ?? () #6 0x00002aaaaaaf49e8 in ?? () #7 0x00002aaaafcffc40 in ?? () #8 0x00002aaab000a7b8 in ?? () #9 0x00002aaaafcfa988 in ?? () #10 0x0000000000509b60 in hipe_mode_switch (p=0x2aaaace19970, cmd=16383, reg=0x2aaaaaaf49e8) at hipe/hipe_x86_glue.h:196 #11 0x00000000004dd76b in process_main () at beam/beam_emu.c:4681 #12 0x00000000004813af in sched_thread_func (vesdp=) at beam/erl_process.c:740 #13 0x0000000000549d14 in thr_wrapper (vtwd=) at common/ethread.c:474 #14 0x00002ba934318f1a in start_thread () from /lib/libpthread.so.0 #15 0x00002ba9345fb5d2 in clone () from /lib/libc.so.6 #16 0x0000000000000000 in ?? () (gdb) up #1 0x000000000050aaa4 in hipe_handle_exception (c_p=0x2aaaace19970) at hipe/hipe_native_bif.c:185 185 hipe/hipe_native_bif.c: No such file or directory. in hipe/hipe_native_bif.c (gdb) up #2 0x000000000050ba67 in .nbif_simple_exception () at hipe/hipe_amd64_glue.S:369 369 hipe/hipe_amd64_glue.S: No such file or directory. in hipe/hipe_amd64_glue.S Current language: auto; currently asm (gdb) i threads 10 Thread 1082132832 (LWP 32318) 0x00002ba93431e1bf in __read_nocancel () from /lib/libpthread.so.0 9 Thread 1090525536 (LWP 32319) 0x00002ba93431bb3a in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 8 Thread 1091352928 (LWP 32320) 0x00002ba93431bb3a in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 7 Thread 1092180320 (LWP 32321) 0x00002ba93431bb3a in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 * 6 Thread 1092204896 (LWP 32322) 0x00002ba93431f00f in waitpid () from /lib/libpthread.so.0 5 Thread 1100597600 (LWP 32323) 0x00002ba9345fb9ac in epoll_wait () from /lib/libc.so.6 4 Thread 1108990304 (LWP 32324) 0x00002ba9345a590d in memset () from /lib/libc.so.6 3 Thread 1117383008 (LWP 32325) 0x00000000431e1cce in ?? () 2 Thread 1125775712 (LWP 32326) hipe_fill_stacktrace (p=0x2aaaace19970, depth=8, trace=0x2aaaafd010f8) at hipe/hipe_stack.h:74 1 Thread 48005729680768 (LWP 32311) 0x00002ba9345f4a96 in select () from /lib/libc.so.6 Current language: auto; currently c (gdb) t 1 [Switching to thread 1 (Thread 48005729680768 (LWP 32311))]#0 0x00002ba9345f4a96 in select () from /lib/libc.so.6 (gdb) where #0 0x00002ba9345f4a96 in select () from /lib/libc.so.6 #1 0x00000000004f41a0 in erts_sys_main_thread () at sys/unix/sys.c:2885 #2 0x00000000004433d0 in erl_start (argc=53, argv=) at beam/erl_init.c:1061 #3 0x000000000042c729 in main (argc=0, argv=0x0) at sys/unix/erl_main.c:28 (gdb) t 2 [Switching to thread 2 (Thread 1125775712 (LWP 32326))]#0 hipe_fill_stacktrace (p=0x2aaaace19970, depth=8, trace=0x2aaaafd010f8) at hipe/hipe_stack.h:74 74 hipe/hipe_stack.h: No such file or directory. in hipe/hipe_stack.h (gdb) where #0 hipe_fill_stacktrace (p=0x2aaaace19970, depth=8, trace=0x2aaaafd010f8) at hipe/hipe_stack.h:74 #1 0x000000000050aaa4 in hipe_handle_exception (c_p=0x2aaaace19970) at hipe/hipe_native_bif.c:185 #2 0x000000000050ba67 in .nbif_simple_exception () at hipe/hipe_amd64_glue.S:369 #3 0x00002aaaace19970 in ?? () #4 0x00002aaaaab4bd68 in ?? () #5 0x00002aaaace19be8 in ?? () #6 0x00002aaaaaaf49e8 in ?? () #7 0x00002aaaafcffc40 in ?? () #8 0x00002aaab000a7b8 in ?? () #9 0x00002aaaafcfa988 in ?? () #10 0x0000000000509b60 in hipe_mode_switch (p=0x2aaaace19970, cmd=16383, reg=0x2aaaaaaf49e8) at hipe/hipe_x86_glue.h:196 #11 0x00000000004dd76b in process_main () at beam/beam_emu.c:4681 #12 0x00000000004813af in sched_thread_func (vesdp=) at beam/erl_process.c:740 #13 0x0000000000549d14 in thr_wrapper (vtwd=) at common/ethread.c:474 #14 0x00002ba934318f1a in start_thread () from /lib/libpthread.so.0 #15 0x00002ba9345fb5d2 in clone () from /lib/libc.so.6 #16 0x0000000000000000 in ?? () (gdb) t 3 [Switching to thread 3 (Thread 1117383008 (LWP 32325))]#0 0x00000000431e1cce in ?? () (gdb) where #0 0x00000000431e1cce in ?? () #1 0x00002aaab12caff1 in ?? () #2 0xfffffffffffffffb in ?? () #3 0x00002aaab12caa51 in ?? () #4 0x000000000000067f in ?? () #5 0x00000000431e3c2d in ?? () #6 0x00002aaab12cad41 in ?? () #7 0x00002aaab000b232 in ?? () #8 0x00000000431e2697 in ?? () #9 0x00002aaab000b232 in ?? () #10 0x0000000000009aef in ?? () #11 0x00002aaab12ca5c1 in ?? () #12 0xfffffffffffffffb in ?? () #13 0xfffffffffffffffb in ?? () #14 0x00002aaab000b3a1 in ?? () #15 0x00002aaab117baba in ?? () #16 0x00000000431e28db in ?? () #17 0x0000000000009aef in ?? () #18 0x00002aaab000b232 in ?? () #19 0x00002aaab000b341 in ?? () #20 0x00002aaab117be09 in ?? () #21 0x0000000000009aef in ?? () #22 0x00002aaab117b991 in ?? () #23 0x00002aaab12ca371 in ?? () #24 0x00000000431e2aad in ?? () #25 0x0000000000008eaf in ?? () #26 0x00002aaab000b232 in ?? () #27 0x00002aaab000b341 in ?? () #28 0x00002aaab0013102 in ?? () #29 0x00002aaab1108b11 in ?? () #30 0x0000000000008eaf in ?? () #31 0x00002aaab0013011 in ?? () #32 0x00002aaab11b2ba2 in ?? () #33 0x00000000431e2e37 in ?? () #34 0x000000000000000f in ?? () #35 0x00002aaab000b232 in ?? () #36 0x00002aaab000f78a in ?? () #37 0x000000000000001f in ?? () #38 0x00002aaab0011689 in ?? () #39 0x00002aaab000f361 in ?? () #40 0x0000000000001733 in ?? () #41 0x000000000001f25f in ?? () #42 0x00000000001b52ff in ?? () #43 0x00002aaab00130ea in ?? () #44 0x00002aaab00130d9 in ?? () #45 0x00000000431e35cd in ?? () #46 0x00002aaab000b232 in ?? () #47 0x00002aaab000b341 in ?? () #48 0x00002aaab000f372 in ?? () #49 0x0000000000001733 in ?? () #50 0x000000000000001f in ?? () #51 0x00002aaab000f361 in ?? () #52 0x00002aaab000b341 in ?? () #53 0x00002aaab000b232 in ?? () #54 0x00002aaab000f78a in ?? () #55 0x000000000050b82f in x86_call_to_native () at hipe/hipe_amd64_glue.S:55 #56 0x0000000000000000 in ?? () (gdb) t 4 [Switching to thread 4 (Thread 1108990304 (LWP 32324))]#0 0x00002ba9345a590d in memset () from /lib/libc.so.6 (gdb) where #0 0x00002ba9345a590d in memset () from /lib/libc.so.6 #1 0x000000000050b3a5 in hipe_put_sdesc (sdesc=0x2aaab1a0cab0) at hipe/hipe_stack.c:31 #2 0x000000000050534b in hipe_bifs_enter_sdesc_1 (A__p=0x2aaaaae29ec0, A_1=) at hipe/hipe_bif0.c:743 #3 0x00000000004dd557 in process_main () at beam/beam_emu.c:2030 #4 0x00000000004813af in sched_thread_func (vesdp=) at beam/erl_process.c:740 #5 0x0000000000549d14 in thr_wrapper (vtwd=) at common/ethread.c:474 #6 0x00002ba934318f1a in start_thread () from /lib/libpthread.so.0 #7 0x00002ba9345fb5d2 in clone () from /lib/libc.so.6 #8 0x0000000000000000 in ?? () (gdb) t 5 [Switching to thread 5 (Thread 1100597600 (LWP 32323))]#0 0x00002ba9345fb9ac in epoll_wait () from /lib/libc.so.6 (gdb) where #0 0x00002ba9345fb9ac in epoll_wait () from /lib/libc.so.6 #1 0x00000000004fa3f0 in erts_poll_wait_kp (ps=0x2ba93479c3d8, pr=0x4199b6a0, len=0x4199bebc, utvp=) at sys/common/erl_poll.c:1893 #2 0x00000000004fc72a in erts_check_io_kp (do_wait=1) at sys/common/erl_check_io.c:946 #3 0x0000000000483f1e in schedule (p=, calls=) at beam/erl_process.c:2026 #4 0x00000000004d9e7c in process_main () at beam/beam_emu.c:1129 #5 0x00000000004813af in sched_thread_func (vesdp=) at beam/erl_process.c:740 #6 0x0000000000549d14 in thr_wrapper (vtwd=) at common/ethread.c:474 #7 0x00002ba934318f1a in start_thread () from /lib/libpthread.so.0 #8 0x00002ba9345fb5d2 in clone () from /lib/libc.so.6 #9 0x0000000000000000 in ?? () (gdb) t 6 [Switching to thread 6 (Thread 1092204896 (LWP 32322))]#0 0x00002ba93431f00f in waitpid () from /lib/libpthread.so.0 (gdb) where #0 0x00002ba93431f00f in waitpid () from /lib/libpthread.so.0 #1 0x00000000004f568e in child_waiter (unused=) at sys/unix/sys.c:2694 #2 0x0000000000549d14 in thr_wrapper (vtwd=) at common/ethread.c:474 #3 0x00002ba934318f1a in start_thread () from /lib/libpthread.so.0 #4 0x00002ba9345fb5d2 in clone () from /lib/libc.so.6 #5 0x0000000000000000 in ?? () (gdb) t 7 [Switching to thread 7 (Thread 1092180320 (LWP 32321))]#0 0x00002ba93431bb3a in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 (gdb) where #0 0x00002ba93431bb3a in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 #1 0x00000000004bdfb5 in async_main (arg=) at beam/erl_threads.h:580 #2 0x0000000000549d14 in thr_wrapper (vtwd=) at common/ethread.c:474 #3 0x00002ba934318f1a in start_thread () from /lib/libpthread.so.0 #4 0x00002ba9345fb5d2 in clone () from /lib/libc.so.6 #5 0x0000000000000000 in ?? () (gdb) t 8 [Switching to thread 8 (Thread 1091352928 (LWP 32320))]#0 0x00002ba93431bb3a in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 (gdb) where #0 0x00002ba93431bb3a in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 #1 0x00000000004bdfb5 in async_main (arg=) at beam/erl_threads.h:580 #2 0x0000000000549d14 in thr_wrapper (vtwd=) at common/ethread.c:474 #3 0x00002ba934318f1a in start_thread () from /lib/libpthread.so.0 #4 0x00002ba9345fb5d2 in clone () from /lib/libc.so.6 #5 0x0000000000000000 in ?? () (gdb) t 9 [Switching to thread 9 (Thread 1090525536 (LWP 32319))]#0 0x00002ba93431bb3a in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 (gdb) where #0 0x00002ba93431bb3a in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 #1 0x000000000045faaf in sys_msg_dispatcher_func ( unused=) at beam/erl_threads.h:580 #2 0x0000000000549d14 in thr_wrapper (vtwd=) at common/ethread.c:474 #3 0x00002ba934318f1a in start_thread () from /lib/libpthread.so.0 #4 0x00002ba9345fb5d2 in clone () from /lib/libc.so.6 #5 0x0000000000000000 in ?? () (gdb) t 10 [Switching to thread 10 (Thread 1082132832 (LWP 32318))]#0 0x00002ba93431e1bf in __read_nocancel () from /lib/libpthread.so.0 (gdb) where #0 0x00002ba93431e1bf in __read_nocancel () from /lib/libpthread.so.0 #1 0x00000000004f4ddd in signal_dispatcher_thread_func ( unused=) at sys/unix/sys.c:2779 #2 0x0000000000549d14 in thr_wrapper (vtwd=) at common/ethread.c:474 #3 0x00002ba934318f1a in start_thread () from /lib/libpthread.so.0 #4 0x00002ba9345fb5d2 in clone () from /lib/libc.so.6 #5 0x0000000000000000 in ?? () (gdb) From matthew@REDACTED Sun Dec 21 04:24:34 2008 From: matthew@REDACTED (Matthew Dempsky) Date: Sat, 20 Dec 2008 19:24:34 -0800 Subject: [erlang-questions] Padding a binary to a multiple of 4 bytes In-Reply-To: References: Message-ID: 2008/12/20 Camille Troillard : > I don't find it very elegant, and guess there is a better way of doing this. Your solution looks fine to me. > Also, I was wondering why the "/binary" suffix was needed if I want to > append to the Bin variable. Intuitively, I have written <>, > but it doesn't work. If you omit a type specifier on a variable in a binary expression, it defaults to a single byte. The expression is statically typed at compile time, so if you write <>, the compiler writes code that assumes Bin is an integer value. At run-time, when it detects it's a binary instead, a type error is raised. From nc@REDACTED Sun Dec 21 09:04:38 2008 From: nc@REDACTED (Nicolas Charpentier) Date: Sun, 21 Dec 2008 09:04:38 +0100 Subject: [erlang-questions] Padding a binary to a multiple of 4 bytes In-Reply-To: References: Message-ID: <494DF896.207@charpi.net> Camille Troillard wrote: > Hi ! > > I am new to Erlang, and would like to ask experienced users some advices > on best practices I should adopt. > > Right now, I would like to know what is the best way of padding a binary > to a multiple of 4 bytes. > I have written a function like this: > > pad_to4 (Bin) -> > case (size(Bin) rem 4) of > 0 -> Bin; > Pad -> <> > end. > > I don't find it very elegant, and guess there is a better way of doing > this. Perhaps using binary comprehensions? What is your suggestion? > pad_to4 (Bin) -> Padding_bits = (4 - (size(Bin) rem 4)) * 8, <>. ---- Nicolas Charpentier http://charpi.net From bernie@REDACTED Sun Dec 21 12:58:28 2008 From: bernie@REDACTED (Bernard Duggan) Date: Sun, 21 Dec 2008 22:58:28 +1100 Subject: [erlang-questions] Padding a binary to a multiple of 4 bytes In-Reply-To: References: Message-ID: <494E2F64.30006@m5net.com> Camille Troillard wrote: > pad_to4 (Bin) -> > case (size(Bin) rem 4) of > 0 -> Bin; > Pad -> <> > end. You can simplify this a little, making use of the fact that it's valid to specify a size of 0 for part of a binary: pad_to4(Bin) -> Pad = size(Bin) rem 4, <>. Or this if you're trying to keep your line count down :) pad_to4(Bin) -> <>. I don't think you can get it too much shorter than that though (but I'm happy to be corrected). Still not brilliantly elegant, but a bit simpler. Cheers, Beranrd From tuscland@REDACTED Sun Dec 21 13:24:15 2008 From: tuscland@REDACTED (Camille Troillard) Date: Sun, 21 Dec 2008 13:24:15 +0100 Subject: [erlang-questions] Padding a binary to a multiple of 4 bytes In-Reply-To: References: Message-ID: Thank you Matthew and everybody who responded for all these suggestions. On Sun, Dec 21, 2008 at 4:24 AM, Matthew Dempsky wrote: > 2008/12/20 Camille Troillard : > > I don't find it very elegant, and guess there is a better way of doing > this. > > Your solution looks fine to me. > > > Also, I was wondering why the "/binary" suffix was needed if I want to > > append to the Bin variable. Intuitively, I have written <>, > > but it doesn't work. > > If you omit a type specifier on a variable in a binary expression, it > defaults to a single byte. The expression is statically typed at > compile time, so if you write <>, the compiler writes code that > assumes Bin is an integer value. At run-time, when it detects it's a > binary instead, a type error is raised. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony@REDACTED Sun Dec 21 13:38:12 2008 From: tony@REDACTED (Tony Rogvall) Date: Sun, 21 Dec 2008 13:38:12 +0100 Subject: [erlang-questions] Padding a binary to a multiple of 4 bytes In-Reply-To: <494DF896.207@charpi.net> References: <494DF896.207@charpi.net> Message-ID: <2360F366-44FF-47CF-9D86-0C44453475AD@rogvall.se> On 21 dec 2008, at 09.04, Nicolas Charpentier wrote: > Camille Troillard wrote: >> Hi ! >> >> I am new to Erlang, and would like to ask experienced users some >> advices >> on best practices I should adopt. >> >> Right now, I would like to know what is the best way of padding a >> binary >> to a multiple of 4 bytes. >> I have written a function like this: >> >> pad_to4 (Bin) -> >> case (size(Bin) rem 4) of >> 0 -> Bin; >> Pad -> <> >> end. >> >> I don't find it very elegant, and guess there is a better way of >> doing >> this. Perhaps using binary comprehensions? What is your suggestion? >> > > pad_to4 (Bin) -> > Padding_bits = (4 - (size(Bin) rem 4)) * 8, > <>. > You need an extra rem to cover the case, size(Bin) rem 4 = 0! pad_to4(Bin) -> Padding_bits = ((4 - (size(Bin) rem 4)) rem 4)*8, <>. Again but using unit:8 and band pad_to4(Bin) -> <>. /Tony > > > ---- > Nicolas Charpentier > http://charpi.net > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From mark@REDACTED Sun Dec 21 23:17:32 2008 From: mark@REDACTED (Mark Scandariato) Date: Sun, 21 Dec 2008 17:17:32 -0500 Subject: [erlang-questions] Yet another cross-compilation question In-Reply-To: <18763.54924.635628.105363@harpo.it.uu.se> References: <18763.54924.635628.105363@harpo.it.uu.se> Message-ID: On Fri, Dec 19, 2008 at 12:14 PM, Mikael Pettersson wrote: > Mark Scandariato writes: > > Hi all, > > > > I'm trying to cross-compile Erlang (R12B-5) for BlueCat Linux on a > Xilinx > > Microblaze. > > > > Configuration was pretty simple (posted here for posterity and possible > > ridicule): > > > > $ export ac_cv_func_getaddrinfo=no > > $ ./configure --disable-hipe --without-java --without-ssl > > --build=i686-pc-cygwin --host=microblaze-linux --prefix=/tmp/erlang > > > > But the build choked on beam_emu.c: > > > > beam/beam_emu.c: In function 'process_main': > > beam/beam_emu.c:4875: internal compiler error: in redirect_branch_edge, > at > > cfgrtl.c:942 > > > > gcc is version 4.1.1 > > > > Any suggestions (other than get a newer/older compiler)? Is this a known > > problem with gcc 4.1.1? > > This very clearly is a gcc bug. gcc-4.1.1 is fairly old, you should try > something newer. I don't recall seeing anything like this problem on any > other platform, so chances are it's a Microblaze-specific bug. Until (if?) I can get a newer version of gcc for microblaze, how horrible would it be to compile beam_emu.c without any optimization? (It does compile without optimization.) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikpe@REDACTED Mon Dec 22 00:26:28 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 22 Dec 2008 00:26:28 +0100 Subject: [erlang-questions] Yet another cross-compilation question In-Reply-To: References: <18763.54924.635628.105363@harpo.it.uu.se> Message-ID: <18766.53412.211422.904181@harpo.it.uu.se> Mark Scandariato writes: > > > beam/beam_emu.c: In function 'process_main': > > > beam/beam_emu.c:4875: internal compiler error: in redirect_branch_edge, > > at > > > cfgrtl.c:942 > > > > > > gcc is version 4.1.1 > > > > > > Any suggestions (other than get a newer/older compiler)? Is this a known > > > problem with gcc 4.1.1? > > > > This very clearly is a gcc bug. gcc-4.1.1 is fairly old, you should try > > something newer. I don't recall seeing anything like this problem on any > > other platform, so chances are it's a Microblaze-specific bug. > > > Until (if?) I can get a newer version of gcc for microblaze, how horrible > would it be to compile beam_emu.c without any optimization? (It does compile > without optimization.) It would be quite horrible. beam_emu.c is the central interpreter for the BEAM virtual machine code that Erlang compiles to. And unless your application code is simple glue around expensive BIFs (like ets tables or message sends) you're going to spend most of your time in the interpreter. (There's also a native code compiler for Erlang but it's not an option for you since it doesn't support Microblaze.) From ok@REDACTED Mon Dec 22 03:47:51 2008 From: ok@REDACTED (Richard O'Keefe) Date: Mon, 22 Dec 2008 15:47:51 +1300 Subject: [erlang-questions] Padding a binary to a multiple of 4 bytes In-Reply-To: References: Message-ID: <967CF137-CFAD-482B-96DB-BB918EC818EA@cs.otago.ac.nz> On 21 Dec 2008, at 2:03 am, Camille Troillard wrote: > Hi ! > > I am new to Erlang, and would like to ask experienced users some > advices on best practices I should adopt. > > Right now, I would like to know what is the best way of padding a > binary to a multiple of 4 bytes. > I have written a function like this: > > pad_to4 (Bin) -> > case (size(Bin) rem 4) of > 0 -> Bin; > Pad -> <> > end. > > I don't find it very elegant, I don't either, because of the excess parentheses around "size(Bin) rem 4", and because "Pad" is *not* the amount of padding required, but the amount of padding NOT required. Also, "to4" is rather ugly. Treat "4" as a word here. How about pad_to_4(Binary) -> case (4 - size(Binary) rem 4) rem 4 of 0 -> Binary ; N -> <> end. Tested, works, doesn't copy unless it has to. From ok@REDACTED Mon Dec 22 04:51:15 2008 From: ok@REDACTED (Richard O'Keefe) Date: Mon, 22 Dec 2008 16:51:15 +1300 Subject: [erlang-questions] Padding a binary to a multiple of 4 bytes In-Reply-To: <967CF137-CFAD-482B-96DB-BB918EC818EA@cs.otago.ac.nz> References: <967CF137-CFAD-482B-96DB-BB918EC818EA@cs.otago.ac.nz> Message-ID: > How about > pad_to_4(Binary) -> > case (4 - size(Binary) rem 4) rem 4 > of 0 -> Binary > ; N -> <> > end. > > Tested, works, doesn't copy unless it has to. While we're at it, let's generalise: pad_to(Width, Binary) -> case (Width - size(Binary) rem Width) rem Width of 0 -> Binary ; N -> <> end. Now that 64-bit machines are so very common, padding to 8 makes a lot of sense too. From mikpe@REDACTED Mon Dec 22 11:51:48 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 22 Dec 2008 11:51:48 +0100 Subject: [erlang-questions] SIGSEGV - hipe_fill_stacktrace (p=0x2aaaace19970, depth=8, trace=0x2aaaafd010f8), In-Reply-To: <494D9BF9.8040509@alertlogic.net> References: <494D9BF9.8040509@alertlogic.net> Message-ID: <18767.28996.837328.945222@harpo.it.uu.se> Paul Fisher writes: > Does this ring any bells, or does anyone have any hints about tracking > this down? > > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread 1125775712 (LWP 32326)] > hipe_fill_stacktrace (p=0x2aaaace19970, depth=8, trace=0x2aaaafd010f8) > at hipe/hipe_stack.h:74 > 74 hipe/hipe_stack.h: No such file or directory. > in hipe/hipe_stack.h > (gdb) where > #0 hipe_fill_stacktrace (p=0x2aaaace19970, depth=8, trace=0x2aaaafd010f8) > at hipe/hipe_stack.h:74 No bells, but this is hipe_find_sdesc() getting a NULL dereference while trying to look up the "stack descriptor" associated with a native return address just loaded from the native stack. Obviously that error is not supposed to happen. It could be a logic error or a memory corruption elsewhere that's tripping us up here. A test case would help greatly. From atulindore2@REDACTED Mon Dec 22 13:54:46 2008 From: atulindore2@REDACTED (atul goyal) Date: Mon, 22 Dec 2008 18:24:46 +0530 Subject: [erlang-questions] curious In-Reply-To: <5ea453f90812190903p4c46addg98f147aeecc23613@mail.gmail.com> References: <494A4C55.2000409@charpi.net> <5ea453f90812190903p4c46addg98f147aeecc23613@mail.gmail.com> Message-ID: hi ppl As Dave asked... How may schedulers are running??? It seems as if there was only one scheduler earlier. after enabling the smp support there was an [smp:2] notification in the startup . After testing; the system's thruput was ,like almost the same as before. I tried with various number in SMP options. however it crashed the VM each time. Maybe i shud use thread 'safe' functions as described in the erl_ddll man page. Also I have used port level locking in the 'C' driver. will it be wise to use [asynch-threads].???? A good example of writing linked-in drivers with multiple opened ports is in the crypto library. yes sure... i went thru it ..in fact i saw it refferred in earlier posts.. well for a newbei such examples are quite helpful and informative...thnax for that atul pyro. -------------- next part -------------- An HTML attachment was scrubbed... URL: From qiulang@REDACTED Mon Dec 22 16:45:27 2008 From: qiulang@REDACTED (lang qiu) Date: Mon, 22 Dec 2008 23:45:27 +0800 Subject: [erlang-questions] Is it better to use tuple to send the message or list or it just does not matter ? Message-ID: Hi all, When sending message by *Pid ! Message*, is it better to use *tuple *or *list *or it just does *not *matter ? For example (the area_server0 example in "programming erlang"), -module(area_server0). -export([loop/0]). loop() -> receive *{rectangle, Width, Ht}* -> % tuple here io:format("Area of rectangle is ~p~n" ,[Width * Ht]), loop(); {circle, R} -> io:format("Area of circle is ~p~n" , [3.14159 * R * R]), loop(); Other -> io:format("I don't know what the area of a ~p is ~n" ,[Other]), loop() end. Here we uses tuples to send/receive messages, but when I change them to list, the codes still work. loop() -> receive *[rectangle, Width, Ht]* -> ... % Still works as long as we agree to use list to send the message. So I was wondering does this mean either tuple or list is ok or there is still some difference between them ? Thanks! Qiulang -------------- next part -------------- An HTML attachment was scrubbed... URL: From discipleofranok@REDACTED Mon Dec 22 16:56:13 2008 From: discipleofranok@REDACTED (Jacob Torrey) Date: Mon, 22 Dec 2008 10:56:13 -0500 Subject: [erlang-questions] Is it better to use tuple to send the message or list or it just does not matter ? In-Reply-To: References: Message-ID: <494FB89D.9050300@gmail.com> I would recommend using tuples, since the messages are of a fixed length and format. Only use lists when you are send variable length data, like a list of users for example. Jacob lang qiu wrote: > Hi all, > When sending message by *Pid ! Message*, is it better to use *tuple *or > *list *or it just does *not *matter ? > > For example (the area_server0 example in "programming erlang"), > > -module(area_server0). > -export([loop/0]). > > loop() -> > receive > *{rectangle, Width, Ht}* -> % tuple here > io:format("Area of rectangle is ~p~n" ,[Width * Ht]), > loop(); > {circle, R} -> > io:format("Area of circle is ~p~n" , [3.14159 * R * R]), > loop(); > Other -> > io:format("I don't know what the area of a ~p is ~n" ,[Other]), > loop() > end. > > Here we uses tuples to send/receive messages, but when I change them to > list, the codes still work. > > loop() -> > receive > *[rectangle, Width, Ht]* -> > ... % Still works as long as we agree to use list to send the message. > > So I was wondering does this mean either tuple or list is ok or there is > still some difference between them ? > > Thanks! > > Qiulang > > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From rvirding@REDACTED Mon Dec 22 20:22:47 2008 From: rvirding@REDACTED (Robert Virding) Date: Mon, 22 Dec 2008 20:22:47 +0100 Subject: [erlang-questions] Is it better to use tuple to send the message or list or it just does not matter ? In-Reply-To: References: Message-ID: <3dbc6d1c0812221122k6b27a8c0s6e1d5ebd70eed33d@mail.gmail.com> As you mentioned both alternatives work, you can send and receive anything, and as Jacob was alluding to is the general rule that you use a tuple when the size is known and fixed and use a list for dynamic collections. Also for this type of usage a tuple is more efficient both in speed and memory size. Robert 2008/12/22 lang qiu > Hi all, > When sending message by *Pid ! Message*, is it better to use *tuple *or *list > *or it just does *not *matter ? > > For example (the area_server0 example in "programming erlang"), > > -module(area_server0). > -export([loop/0]). > > loop() -> > receive > *{rectangle, Width, Ht}* -> % tuple here > io:format("Area of rectangle is ~p~n" ,[Width * Ht]), > loop(); > {circle, R} -> > io:format("Area of circle is ~p~n" , [3.14159 * R * R]), > loop(); > Other -> > io:format("I don't know what the area of a ~p is ~n" ,[Other]), > loop() > end. > > Here we uses tuples to send/receive messages, but when I change them to > list, the codes still work. > > loop() -> > receive > *[rectangle, Width, Ht]* -> > ... % Still works as long as we agree to use list to send the > message. > > So I was wondering does this mean either tuple or list is ok or there is > still some difference between them ? > > Thanks! > > Qiulang > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From charleswthompsonIII@REDACTED Mon Dec 22 23:21:26 2008 From: charleswthompsonIII@REDACTED (charleswthompsonIII@REDACTED) Date: Mon, 22 Dec 2008 22:21:26 +0000 Subject: [erlang-questions] Seattle Erlounge Message-ID: <0016364c5a63612a30045eaa14cd@google.com> Joe, Let's make something happen. I coordinated the last Seattle Erlounge. The venue sucked big time. Would do many things different next time. Shoot me an email offline at charleswthompsoniii@REDACTED if your interested in planning something out. I'd be more than happy to help. Thanks, Charles On Dec 19, 2008 11:52am, Joe Williams wrote: > Sounds good to me. Anyone else up for meeting some time in the next > > couple weeks? > > > > -Joe > > > > > > On 12/19/2008 10:49 AM, anders conbere wrote: > > > On Fri, Dec 19, 2008 at 10:04 AM, Joe Williamsjoe@REDACTED> wrote: > > > > > >> I have seen posts in the past regarding Seattle Erlounge's. I recently > > >> moved to Seattle and wondered if anyone has any current information. > > >> > > > > > > We had a nice meetup when Lennart Ohman was in town. Very informal, > > > not sure if there is anything regular in the works. There's definitely > > > a few of us out here, and I know I'm down to meet some people and talk > > > about some problems I'm trying to solve. > > > > > > ~ Anders > > > > > > > > >> Thanks. > > >> -Joe > > >> > > >> -- > > >> Name: Joseph A. Williams > > >> Email: joe@REDACTED > > >> Blog: http://www.joeandmotorboat.com/ > > >> > > >> _______________________________________________ > > >> erlang-questions mailing list > > >> erlang-questions@REDACTED > > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > >> > > >> > > > > -- > > Name: Joseph A. Williams > > Email: joe@REDACTED > > Blog: http://www.joeandmotorboat.com/ > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ciprian.craciun@REDACTED Tue Dec 23 12:35:53 2008 From: ciprian.craciun@REDACTED (Ciprian Dorin, Craciun) Date: Tue, 23 Dec 2008 13:35:53 +0200 Subject: [erlang-questions] gen module documentation availability Message-ID: <8e04b5820812230335ne58cc91o2344f4a2e2ef902e@mail.gmail.com> Hello all! I've seen that gen_server, gen_fsm and gen_event, are all based on the module gen... Now I've also seen that this module is not specified in the official documentation... My questions are: * can I use this module without fear that it could (one day) be modified in an incompatible way? (I want to build a custom servlet-like process framework, and I would have used it directly without passing through gen_server); * is it documented anywhere more than the source code? (I mean are there some examples?); Thanks, Ciprian Craciun. From zerthurd@REDACTED Tue Dec 23 12:38:41 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Tue, 23 Dec 2008 17:38:41 +0600 Subject: [erlang-questions] missing function Message-ID: Hello I can't find standard function which returns position of element in list like: num(El, List) -> num(El, List, 1). num(_, [], _) -> {error, not_found}; num(El, [H|T], Acc) -> case H of El -> Acc; _ -> num(El, T, Acc+1) end. I think it strange. Can you clarify this point? Thank you. -- Maxim Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Tue Dec 23 13:12:42 2008 From: rvirding@REDACTED (Robert Virding) Date: Tue, 23 Dec 2008 13:12:42 +0100 Subject: [erlang-questions] missing function In-Reply-To: References: Message-ID: <3dbc6d1c0812230412l798be17dpb1e68ba81e52a0fb@mail.gmail.com> There are two points about your question: 1. It is not strange that you cannot find such a function, it does not exist in the libraries. :-) 2. It may also be strange that one does not exist, but so far no one has seen a need to add it to lists where it would belong. Robert 2008/12/23 Maxim Treskin > Hello > > I can't find standard function which returns position of element in list > like: > > num(El, List) -> > num(El, List, 1). > > num(_, [], _) -> {error, not_found}; > num(El, [H|T], Acc) -> > case H of > El -> Acc; > _ -> num(El, T, Acc+1) > end. > > I think it strange. Can you clarify this point? > > Thank you. > > -- > Maxim Treskin > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From saleyn@REDACTED Tue Dec 23 13:39:07 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Tue, 23 Dec 2008 07:39:07 -0500 Subject: [erlang-questions] missing function In-Reply-To: <3dbc6d1c0812230412l798be17dpb1e68ba81e52a0fb@mail.gmail.com> References: <3dbc6d1c0812230412l798be17dpb1e68ba81e52a0fb@mail.gmail.com> Message-ID: <4950DBEB.4060600@gmail.com> There's been a discussion about very same subject in this thread: http://www.erlang.org/pipermail/erlang-questions/2008-November/040189.html I also hope OTP folks can include it in the lists module. Serge Robert Virding wrote: > There are two points about your question: > > 1. It is not strange that you cannot find such a function, it does not exist > in the libraries. :-) > > 2. It may also be strange that one does not exist, but so far no one has > seen a need to add it to lists where it would belong. > > Robert > > 2008/12/23 Maxim Treskin > >> Hello >> >> I can't find standard function which returns position of element in list >> like: >> >> num(El, List) -> >> num(El, List, 1). >> >> num(_, [], _) -> {error, not_found}; >> num(El, [H|T], Acc) -> >> case H of >> El -> Acc; >> _ -> num(El, T, Acc+1) >> end. >> >> I think it strange. Can you clarify this point? >> >> Thank you. >> >> -- >> Maxim Treskin >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From zerthurd@REDACTED Tue Dec 23 13:54:16 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Tue, 23 Dec 2008 18:54:16 +0600 Subject: [erlang-questions] missing function In-Reply-To: References: Message-ID: > However, since a string is basically just a list, you can probably use > string:str/2 > > > > For example: > > > string:str([10,23,54,234,52], [54]). > > 3 > In string.erl: -spec str(string(), string()) -> non_neg_integer(). There is very large number of list elements types, not only non_neg_integer() May be better way is include new function in lists.erl and call it from string.erl -- Maxim Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From Mike.French@REDACTED Tue Dec 23 14:00:14 2008 From: Mike.French@REDACTED (French, Mike) Date: Tue, 23 Dec 2008 13:00:14 -0000 Subject: [erlang-questions] missing function Message-ID: string:chr ? Mike > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED]On Behalf Of > Serge Aleynikov > Sent: 23 December 2008 12:39 > To: Robert Virding > Cc: erlang-questions@REDACTED > Subject: Re: [erlang-questions] missing function > > > There's been a discussion about very same subject in this thread: > > http://www.erlang.org/pipermail/erlang-questions/2008-November > /040189.html > > I also hope OTP folks can include it in the lists module. > > Serge > > Robert Virding wrote: > > There are two points about your question: > > > > 1. It is not strange that you cannot find such a function, > it does not exist > > in the libraries. :-) > > > > 2. It may also be strange that one does not exist, but so > far no one has > > seen a need to add it to lists where it would belong. > > > > Robert > > > > 2008/12/23 Maxim Treskin > > > >> Hello > >> > >> I can't find standard function which returns position of > element in list > >> like: > >> > >> num(El, List) -> > >> num(El, List, 1). > >> > >> num(_, [], _) -> {error, not_found}; > >> num(El, [H|T], Acc) -> > >> case H of > >> El -> Acc; > >> _ -> num(El, T, Acc+1) > >> end. > >> > >> I think it strange. Can you clarify this point? > >> > >> Thank you. > >> > >> -- > >> Maxim Treskin > >> > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://www.erlang.org/mailman/listinfo/erlang-questions > >> > > > > > > > -------------------------------------------------------------- > ---------- > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > Thales UK Ltd (Wells) DISCLAIMER: The information contained in this e-mail is confidential. It may also be legally privileged. It is intended only for the stated addressee(s) and access to it by any other person is unauthorised. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this e-mail. Such unauthorised use may be unlawful. We may monitor all e-mail communications through our networks. If you have received this e-mail in error, please inform us immediately on sender's telephone number above and delete it and all copies from your system. We accept no responsibility for changes to any e-mail which occur after it has been sent. Attachments to this e-mail may contain software viruses which could damage your system. We therefore recommend you virus-check all attachments before opening. Thales UK Ltd. Registered Office: 2 Dashwood Lang Road, The Bourne Business Park, Addlestone, Weybridge, Surrey KT15 2NX Registered in England No. 868273 From zerthurd@REDACTED Tue Dec 23 14:26:45 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Tue, 23 Dec 2008 19:26:45 +0600 Subject: [erlang-questions] missing function In-Reply-To: References: Message-ID: 2008/12/23 Trevor Woollacott [ MTN - Innovation Centre ] > Non_neg_integer() is the type returned. i.e. the position of the element. > Yes, I'm sorry, it is my temporary mistake :) > However, I agree it would be much better to have a new function in > lists.erl, especially for matching a single element. > Since it change in stdlib, is it possible to add new EEP? Or EEPs not covers stdlib? -- Maxim Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From james.hague@REDACTED Tue Dec 23 18:01:41 2008 From: james.hague@REDACTED (James Hague) Date: Tue, 23 Dec 2008 11:01:41 -0600 Subject: [erlang-questions] max and min functions Message-ID: I've written helper functions to determine the max and min of two values at least a dozen times now, so I'd like to propose they be added to the standard libraries. lists:max/1 and list:min/1 give the largest and smallest value in a list, but I'm talking about something simpler: max(1,10) ==> 10 min(1, 10) ==> 1 Along the same lines, I've also found myself writing "cap" (which caps a value to be within two limits): cap(5, 1, 10) ==> 5 cap(0, 1, 10) ==> 1 cap(20, 1, 10) ==> 10 cap(N, Low, High) is the same as min(max(N, Low), High). "limit" may make more sense. From raould@REDACTED Tue Dec 23 19:34:04 2008 From: raould@REDACTED (Raoul Duke) Date: Tue, 23 Dec 2008 10:34:04 -0800 Subject: [erlang-questions] dialyzer plt question / help sought Message-ID: <91a2ba3e0812231034gd76254fl9b557066f5b812c9@mail.gmail.com> hi, newbie here. didn't find an answer to this via googling / man pages just yet. i built a plt and it supposedly has gen_tcp in it: bash-3.2$ bin/dialyzer.exe --add_to_plt -r lib/kernel-2.12.5/ebin/gen_tcp.beam yes done (passed successfully) then i run dialyzer on a file which uses gen_tcp:send/1, and which does have a -import(gen_tcp). line, and which does compile just fine, and i get a warning: Call to missing or unexported function gen_tcp:send/1 ?! From raould@REDACTED Tue Dec 23 19:42:25 2008 From: raould@REDACTED (Raoul Duke) Date: Tue, 23 Dec 2008 10:42:25 -0800 Subject: [erlang-questions] dialyzer plt question / help sought In-Reply-To: <91a2ba3e0812231034gd76254fl9b557066f5b812c9@mail.gmail.com> References: <91a2ba3e0812231034gd76254fl9b557066f5b812c9@mail.gmail.com> Message-ID: <91a2ba3e0812231042n74c45e7dq38049956a6856153@mail.gmail.com> ah hah!!! it is gen_tcp:send/2 :-) On Tue, Dec 23, 2008 at 10:34 AM, Raoul Duke wrote: > hi, > > newbie here. didn't find an answer to this via googling / man pages just yet. > > i built a plt and it supposedly has gen_tcp in it: > > bash-3.2$ bin/dialyzer.exe --add_to_plt -r lib/kernel-2.12.5/ebin/gen_tcp.beam > yes > done (passed successfully) > > then i run dialyzer on a file which uses gen_tcp:send/1, and which > does have a -import(gen_tcp). line, and which does compile just fine, > and i get a warning: > > Call to missing or unexported function gen_tcp:send/1 > > ?! > From ed.stow@REDACTED Tue Dec 23 20:09:48 2008 From: ed.stow@REDACTED (Edward Stow) Date: Wed, 24 Dec 2008 06:09:48 +1100 Subject: [erlang-questions] missing function In-Reply-To: References: Message-ID: 2008/12/23 Maxim Treskin : > Hello > > I can't find standard function which returns position of element in list > like: > > num(El, List) -> > num(El, List, 1). > > num(_, [], _) -> {error, not_found}; > num(El, [H|T], Acc) -> > case H of > El -> Acc; > _ -> num(El, T, Acc+1) > end. Hi, I'm new to Erlang and FP and would like to ask why or when you would prefer to use case expressions rather than function pattern matching such as indexOf(_,[],_) -> {error, not_found}; indexOf(El, [El | _], Index) -> Index; indexOf(El, [_| T], Index) -> indexOf(El, T, Index + 1). Intuitively I prefer the separate pattern matches as each match is dealing with one case. Does an idiom guide exist for Erlang / FP along the lines of Kent Beck's 'Smalltalk Best Practice Patterns' ? Thanks -- Edward Stow From stonecypher@REDACTED Tue Dec 23 20:27:28 2008 From: stonecypher@REDACTED (John Haugeland) Date: Tue, 23 Dec 2008 12:27:28 -0700 Subject: [erlang-questions] erlang-questions Digest, Vol 17, Issue 126 In-Reply-To: References: Message-ID: <8f24f4b10812231127y158c4be9pcb3f4269f8d17e46@mail.gmail.com> Just catching up on the mailing list. Doesn't look like anyone ever answered this. (An aside: Joe Armstrong and I were wondering back at Erlang eXchange > in July: maybe this is a dumb question but how do you actually > pronounce "mochiweb" -- is it "mo-chee-web" or "mo-key-web" or > "mock-key-web" or ...?) > It's "moe chee". They're named for a kind of Japanese rice cake. http://en.wikipedia.org/wiki/Mochi -------------- next part -------------- An HTML attachment was scrubbed... URL: From raould@REDACTED Tue Dec 23 21:28:22 2008 From: raould@REDACTED (Raoul Duke) Date: Tue, 23 Dec 2008 12:28:22 -0800 Subject: [erlang-questions] newbie tail call / dialyzer warning question Message-ID: <91a2ba3e0812231228m6c82aee6n21941609ad3d0b@mail.gmail.com> hi, i get the "function X has no local return" message from dialyzer, and i don't grok what it means. e.g. http://www.erlang.org/pipermail/erlang-questions/2007-August/028766.html does it mean that tail calls are only optimized when it is a self-call, and i'm going to blow out the stack otherwise? (i just did some experimenting with a ping pong situation and didn't hit a stack overflow.) From mikpe@REDACTED Tue Dec 23 22:29:24 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 23 Dec 2008 22:29:24 +0100 Subject: [erlang-questions] newbie tail call / dialyzer warning question In-Reply-To: <91a2ba3e0812231228m6c82aee6n21941609ad3d0b@mail.gmail.com> References: <91a2ba3e0812231228m6c82aee6n21941609ad3d0b@mail.gmail.com> Message-ID: <18769.22580.556897.115227@harpo.it.uu.se> Raoul Duke writes: > hi, > > i get the "function X has no local return" message from dialyzer, and > i don't grok what it means. > > e.g. http://www.erlang.org/pipermail/erlang-questions/2007-August/028766.html > > does it mean that tail calls are only optimized when it is a > self-call, and i'm going to blow out the stack otherwise? No, general tail calls are optimised as they should be. From wde@REDACTED Tue Dec 23 23:55:45 2008 From: wde@REDACTED (wde) Date: Tue, 23 Dec 2008 23:55:45 +0100 Subject: [erlang-questions] packages and imports forgotten Message-ID: <200812232255.mBNMtmGI001831@morgoth.cslab.ericsson.net> Hello, just for people who forgot to import some modules in packages (like me), this old but usable patch works fine for me (thanks to Mr Ulf Wiger). http://www.erlang.org/pipermail/erlang-patches/2003-April/000040.html I don't know if there is a better way today to handle this kind of problem. Bye wde From ed.stow@REDACTED Wed Dec 24 02:03:42 2008 From: ed.stow@REDACTED (Edward Stow) Date: Wed, 24 Dec 2008 12:03:42 +1100 Subject: [erlang-questions] [Erlyaws-list] Yaws Error Message on start In-Reply-To: <65b2728e0812231619j3976b88apf26bd84ab9c08a26@mail.gmail.com> References: <65b2728e0812231619j3976b88apf26bd84ab9c08a26@mail.gmail.com> Message-ID: 2008/12/24 Steve Vinoski : > On 12/23/08, Edward Stow wrote: >> Hi, >> >> This is my first attempt at getting yaws running. >> >> Using Ubuntu 8.10 and erlang & yaws installed by aptitude. On >> restarting yaws the following error message is displayed. >> >> --- console messages --- >> edward@REDACTED:/etc/init.d$ sudo ./yaws restart >> >> Restarting yaws: You failed to read the ctlfile >> /var/cache/yaws/.yaws/yaws/debian_yaws/CTL >> error was: >> specify by <-I id> which yaws system you want to control >> --- end console messages --- >> >> The CTL file does not exist. > > Hi Ed, I don't have a debian machine, but I fixed some problems in the > RH control scripts awhile back that perhaps also reside in the debian > scripts. I have traced an error in my yaws config file /etc/yaws/conf.avail/localhost.conf The docroot option was pointing to a directory that does not exist. > > --steve > -- Edward Stow From ali.yakout@REDACTED Wed Dec 24 04:22:11 2008 From: ali.yakout@REDACTED (Ali Yakout) Date: Wed, 24 Dec 2008 04:22:11 +0100 Subject: [erlang-questions] io format badarg! Message-ID: Hi, I got this error and I don't know its reason! I found that this error was reported as a bug in http://www.erlang.org/pipermail/erlang-bugs/2007-February/000311.html 86 =ERROR REPORT==== 24-Dec-2008::04:06:52 ===^M 87 ** Generic server sms_monitor_log terminating ^M 88 ** Last message in was {'$gen_cast',{tryf,"send_flash:\"20187336005\""}}^M 89 ** When Server state == {state,<0.113.0>,<0.114.0>}^M 90 ** Reason for termination == ^M 91 ** {badarg,[{io,format,^M 92 [<0.113.0>,"~p ~p:~p~n",^M 93 [{2008,12,24},{4,6,52},"send_flash:\"20187336005\""]]},^M 94 {sms_monitor_log,handle_cast,2},^M 95 {gen_server,handle_msg,5},^M 96 {proc_lib,init_p,5}]}^M /Ali -------------- next part -------------- An HTML attachment was scrubbed... URL: From zerthurd@REDACTED Wed Dec 24 05:59:59 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Wed, 24 Dec 2008 10:59:59 +0600 Subject: [erlang-questions] io format badarg! In-Reply-To: References: Message-ID: What is your OTP version? I tried to eval it in OTP-R12B-5, it works ok: Erlang (BEAM) emulator version 5.6.5 [source] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.6.5 (abort with ^G) 1> io:format("~p ~p:~p~n", [{2008,12,24},{4,6,52},"send_flash:\"20187336005\""]). {2008,12,24} {4,6,52}:"send_flash:\"20187336005\"" ok 2> Can you show your source code with this error? -- Maxim Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From ali.yakout@REDACTED Wed Dec 24 07:27:39 2008 From: ali.yakout@REDACTED (Ali Yakout) Date: Wed, 24 Dec 2008 07:27:39 +0100 Subject: [erlang-questions] io format BUG? In-Reply-To: References: Message-ID: Hi, My Erlang version is V5.6.3, and the io:format works fine with it, but at some point it crashed and stopped the running release. Here is my error report 86 =ERROR REPORT==== 24-Dec-2008::04:06:52 ===^M 87 ** Generic server sms_monitor_log terminating ^M 88 ** Last message in was {'$gen_cast',{tryf,"send_flash:\"20187336005\""}}^M 89 ** When Server state == {state,<0.113.0>,<0.114.0>}^M 90 ** Reason for termination == ^M 91 ** {badarg,[{io,format,^M 92 [<0.113.0>,"~p ~p:~p~n",^M 93 [{2008,12,24},{4,6,52},"send_flash:\"20187336005\""]]},^M 94 {sms_monitor_log,handle_cast,2},^M 95 {gen_server,handle_msg,5},^M 96 {proc_lib,init_p,5}]}^M And the part of my code that calls the io:format to write in a log file. handle_cast({tryf,Msg}, State) -> io:format(State#state.tryf,"~p ~p:~p~n",[date(),time(),Msg]), {noreply, State}; I can't reproduce the error and I don't know why it happened in the first place! I was wondering if this is a bug, I found that it was reported in V5.5.3 http://www.erlang.org/pipermail/erlang-bugs/2007-February/000311.html /Ali ________________________________ From: Maxim Treskin [mailto:zerthurd@REDACTED] Sent: Wednesday, December 24, 2008 7:00 AM To: Ali Yakout Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] io format badarg! What is your OTP version? I tried to eval it in OTP-R12B-5, it works ok: Erlang (BEAM) emulator version 5.6.5 [source] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.6.5 (abort with ^G) 1> io:format("~p ~p:~p~n", [{2008,12,24},{4,6,52},"send_flash:\"20187336005\""]). {2008,12,24} {4,6,52}:"send_flash:\"20187336005\"" ok 2> Can you show your source code with this error? -- Maxim Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahmed.nawras@REDACTED Wed Dec 24 09:09:36 2008 From: ahmed.nawras@REDACTED (Ahmed Ali) Date: Wed, 24 Dec 2008 12:09:36 +0400 Subject: [erlang-questions] gen module documentation availability In-Reply-To: <8e04b5820812230335ne58cc91o2344f4a2e2ef902e@mail.gmail.com> References: <8e04b5820812230335ne58cc91o2344f4a2e2ef902e@mail.gmail.com> Message-ID: +1 Ahmed On Tue, Dec 23, 2008 at 3:35 PM, Ciprian Dorin, Craciun wrote: > Hello all! > > I've seen that gen_server, gen_fsm and gen_event, are all based on > the module gen... Now I've also seen that this module is not specified > in the official documentation... > > My questions are: > * can I use this module without fear that it could (one day) be > modified in an incompatible way? (I want to build a custom > servlet-like process framework, and I would have used it directly > without passing through gen_server); > * is it documented anywhere more than the source code? (I mean are > there some examples?); > > Thanks, > Ciprian Craciun. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From jlprasantha@REDACTED Wed Dec 24 09:15:28 2008 From: jlprasantha@REDACTED (prasantha kumara) Date: Wed, 24 Dec 2008 13:45:28 +0530 Subject: [erlang-questions] send c structure from c node to erlang Message-ID: Hi all i am trying to send a c structure from the c node to erlang console.can anyine help me to achieve this goal? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From zerthurd@REDACTED Wed Dec 24 09:25:30 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Wed, 24 Dec 2008 14:25:30 +0600 Subject: [erlang-questions] io format BUG? In-Reply-To: References: Message-ID: > > And the part of my code that calls the io:format to write in a log file. > > handle_cast({tryf,Msg}, State) -> > io:format(State#state.tryf,"~p ~p:~p~n",[date(),time(),Msg]), > {noreply, State}; > > It is possible that State#state.tryf not an io_device() -- Maxim Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From stonecypher@REDACTED Thu Dec 25 05:05:33 2008 From: stonecypher@REDACTED (John Haugeland) Date: Wed, 24 Dec 2008 21:05:33 -0700 Subject: [erlang-questions] A possible inconsistency in the DETS interface Message-ID: <8f24f4b10812242005l2526cfbtf23e98987766a78@mail.gmail.com> Why is it that dets:open_file/2 creates a non-extant table on request, but dets:open_file/1 doesn't (instead one gets enoent) ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From stonecypher@REDACTED Thu Dec 25 05:07:24 2008 From: stonecypher@REDACTED (John Haugeland) Date: Wed, 24 Dec 2008 21:07:24 -0700 Subject: [erlang-questions] Nevermind the last mail. Message-ID: <8f24f4b10812242007m47c0da49ua39656bd28d08538@mail.gmail.com> It's because I'm an idiot and make mistakes in my test sets. Nevermind what I just said, please. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stondage123@REDACTED Thu Dec 25 09:18:27 2008 From: stondage123@REDACTED (Andrew Stone) Date: Thu, 25 Dec 2008 00:18:27 -0800 (PST) Subject: [erlang-questions] tcp keepalive option Message-ID: <351260.98674.qm@web35903.mail.mud.yahoo.com> Hi, I'm currently trying to test code that sets the sockopt {keepalive, true} along with {active, true} in gen_tcp:listen, which is inherited by the connected socket. However, after much searching I am unable to figure out what happens when the actual connection times out. If a TCP keepalive timeout occurs, does the erlang process receive a {tcp_error, Sock, Reason} message or does it receive a {tcp_closed, Sock} message. Thanks, Andrew From francesco@REDACTED Thu Dec 25 14:17:38 2008 From: francesco@REDACTED (Francesco Cesarini (Erlang Training and Consulting)) Date: Thu, 25 Dec 2008 13:17:38 +0000 Subject: [erlang-questions] A possible inconsistency in the DETS interface In-Reply-To: <8f24f4b10812242005l2526cfbtf23e98987766a78@mail.gmail.com> References: <8f24f4b10812242005l2526cfbtf23e98987766a78@mail.gmail.com> Message-ID: <495387F2.1090207@erlang-consulting.com> Heh, just sent the chapter on DETS and ETS to our reviewers yesterday :-) open_file/1 is meant for debugging purposes and will only operate on existing files which were created with open_file/2. Francesco -- http://www.erlang-consulting.com John Haugeland wrote: > Why is it that dets:open_file/2 creates a non-extant table on request, > but dets:open_file/1 doesn't (instead one gets enoent) ? > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From stonecypher@REDACTED Thu Dec 25 18:37:14 2008 From: stonecypher@REDACTED (John Haugeland) Date: Thu, 25 Dec 2008 10:37:14 -0700 Subject: [erlang-questions] Merry christmas! Have a library. Message-ID: <8f24f4b10812250937i1b7cc29ds557d935e69a46921@mail.gmail.com> Merry Christmas to all. (If you aren't Christian, Catholic or Capitalist, the three religions that celebrate Christmas, substitute Channukah, Holi, Hajj, Bodhi Day, Zarathosht Diso, Abdu'l-Baha's Ascension, Huge Freaking Beef Roast Eve, Ashura, Yule, Litha, Gantan-Sai, Diwali, Night of the Seven DVDs, Maghi, the Blessing of the Animals, the Feast of the Theophany, Vasant Panchami or even just Those Couple of Days Off before The End of the Tax Year. I just picked today because most Erlangers are in Capitalist or Christian parts of the world, so it seemed like a winning statistical gambit.) In observance of whatever random thing you celebrate (yay beef roast eve!), I'm releasing my utility library to the public. It's even mostly documented. http://scutil.com/ http://scutil.com/docs/ I hope you all have a happy, healthy and safe {?MODULE,?HOLIDAY}. Remember to share with the less fortunate. - Uncle Fatty -------------- next part -------------- An HTML attachment was scrubbed... URL: From wde@REDACTED Thu Dec 25 20:45:06 2008 From: wde@REDACTED (wde) Date: Thu, 25 Dec 2008 20:45:06 +0100 Subject: [erlang-questions] Merry christmas! Have a library. Message-ID: <200812251955.mBPJtMsW032357@morgoth.cslab.ericsson.net> :+) thank you for sharing your code, I found some interesting functions. and merry christmas :p wde Merry Christmas to all. (If you aren't Christian, Catholic or Capitalist, the three religions that celebrate Christmas, substitute Channukah, Holi, Hajj, Bodhi Day, Zarathosht Diso, Abdu'l-Baha's Ascension, Huge Freaking Beef Roast Eve, Ashura, Yule, Litha, Gantan-Sai, Diwali, Night of the Seven DVDs, Maghi, the Blessing of the Animals, the Feast of the Theophany, Vasant Panchami or even just Those Couple of Days Off before The End of the Tax Year. I just picked today because most Erlangers are in Capitalist or Christian parts of the world, so it seemed like a winning statistical gambit.) In observance of whatever random thing you celebrate (yay beef roast eve!), I'm releasing my utility library to the public. It's even mostly documented. http://scutil.com/ http://scutil.com/docs/ I hope you all have a happy, healthy and safe {?MODULE,?HOLIDAY}. Remember to share with the less fortunate. - Uncle Fatty -------------- next part -------------- An HTML attachment was scrubbed... URL: From sedinin@REDACTED Fri Dec 26 00:47:44 2008 From: sedinin@REDACTED (=?KOI8-R?B?4c7E0sXKIPPFxMnOyc4=?=) Date: Fri, 26 Dec 2008 01:47:44 +0200 Subject: [erlang-questions] Problem with XML validation using xmerl_xsd:validate(). Message-ID: <42EC95E4-C48C-453C-80F5-2A0EC7901B4E@gmail.com> Hello Please help to sort it out: trying to validate XML using: {ok, State } = xmerl_xsd:process_schema("test.xsd"), {Entity ,_} = xmerl_scan:file("test.xml"), xmerl_xsd:validate(Entity, State). XSD content: and receive next error: XML content: Got an error: {error,[{[],xmerl_xsd, {empty_content_not_allowed,[{enumeration,"Valid"}, {enumeration,"Invalid"}, {enumeration,[]}]}}]} I think it is valid markup for this schema. The same opinion has some other validating parsers. How do you think? -- Sedinin From tuscland@REDACTED Fri Dec 26 01:17:35 2008 From: tuscland@REDACTED (Camille Troillard) Date: Fri, 26 Dec 2008 01:17:35 +0100 Subject: [erlang-questions] Function clause question Message-ID: Dear list, I have a simple best practices question: Is it better to write: skip ([_H | _T] = Arg, Bin) -> skip_count (length (Arg) + 1, Bin); skip (<>, Bin) -> skip_count (size (Arg), Bin). or skip (Arg, Bin) when is_list (Arg) -> skip_count (length (Arg) + 1, Bin); skip (Arg, Bin) when is_binary (Arg) -> skip_count (size (Arg), Bin). I would be in favor or the second case, but I wonder if the use of guards in this case is a very good idea. Best, Cam -------------- next part -------------- An HTML attachment was scrubbed... URL: From hayeah@REDACTED Fri Dec 26 03:53:25 2008 From: hayeah@REDACTED (Howard Yeh) Date: Thu, 25 Dec 2008 18:53:25 -0800 Subject: [erlang-questions] port gotchas? (pegged CPU and sent machine to swap) Message-ID: Hi, I am learning how to use port. What I am trying to do (for now) is to spawn a script that reads from stdin and echoes back to stdout. I read here [http://www.kazmier.com/computer/port-howto] that the echo script should flush stdout, otherwise the spawning erlang process would never hear back. But since I intend to use the script asynchronously, I thought I'd just wait for the script's runtime (ruby) to decide when it wants to flush. So by my design, i should be able to: (1) fire off requests to the subprocess asynchronously (2) get results back as messages when the script decides to flush its IO. This is the script, while true if input = $stdin.readline i = Integer(input) $stdout.puts i+1 end end But for some reason, after port_command is called, and waiting for response, receive % for now, just assume we can get the whole line {Port,{data,{eol,Result}}} -> io:format("response: ~p~n",[Result]), Result; ... end This process goes to sleep, something else wakes up, pegs the CPU, and sends my machine to swap. Presumably the port? If I be a good boy and flush after each write to the pipe, it works fine, while true if input = $stdin.readline i = Integer(input) $stdout.puts i+1 $stdout.flush end end I am curious why that is... Is there a port tracer to see what it's doing? please help? Howard From ulf@REDACTED Fri Dec 26 08:53:46 2008 From: ulf@REDACTED (Ulf Wiger) Date: Fri, 26 Dec 2008 08:53:46 +0100 Subject: [erlang-questions] Function clause question In-Reply-To: References: Message-ID: <8209f740812252353x7e667ff6wcce2c913d193cdb5@mail.gmail.com> It's basically a matter of taste, but in your specific example, there is also a semantic difference: [_H | _T] matches only if the list is non-empty, whereas (Arg, Bin) when is_list(Arg) also matches empty lists. <> does match the empty binary, though. BR, Ulf W 2008/12/26 Camille Troillard : > Dear list, > I have a simple best practices question: > Is it better to write: > > skip ([_H | _T] = Arg, Bin) -> > skip_count (length (Arg) + 1, Bin); > skip (<>, Bin) -> > skip_count (size (Arg), Bin). > or > skip (Arg, Bin) when is_list (Arg) -> > skip_count (length (Arg) + 1, Bin); > skip (Arg, Bin) when is_binary (Arg) -> > skip_count (size (Arg), Bin). > I would be in favor or the second case, but I wonder if the use of guards in > this case is a very good idea. > > Best, > Cam > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From kenneth.lundin@REDACTED Fri Dec 26 10:44:23 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 26 Dec 2008 10:44:23 +0100 Subject: [erlang-questions] gen module documentation availability In-Reply-To: <8e04b5820812230335ne58cc91o2344f4a2e2ef902e@mail.gmail.com> References: <8e04b5820812230335ne58cc91o2344f4a2e2ef902e@mail.gmail.com> Message-ID: Hi The gen module is not documented because it is not an official API. The gen module is an implementation which happens to be shared by gen_server, gen_event and gen_fsm. The interface towards the gen module might be changed at anytime while at the same time the API's towards gen_server, gen_event and gen_fsm will remain untouched or backwards compatible. The gen module might even be removed or split into several modules. The principle we have is that what's documented is the official API's that will be kept stable and compatible. I still think there is a minor risk for you in reusing the gen module we have no immediate plans to change it. And you can always copy the entire contents of the gen module into your implementation if you want to be on the safe side. /Kenneth Erlang/OTP Ericsson On Tue, Dec 23, 2008 at 12:35 PM, Ciprian Dorin, Craciun wrote: > Hello all! > > I've seen that gen_server, gen_fsm and gen_event, are all based on > the module gen... Now I've also seen that this module is not specified > in the official documentation... > > My questions are: > * can I use this module without fear that it could (one day) be > modified in an incompatible way? (I want to build a custom > servlet-like process framework, and I would have used it directly > without passing through gen_server); > * is it documented anywhere more than the source code? (I mean are > there some examples?); > > Thanks, > Ciprian Craciun. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From jed@REDACTED Fri Dec 26 19:32:21 2008 From: jed@REDACTED (Jed McCaleb) Date: Fri, 26 Dec 2008 13:32:21 -0500 Subject: [erlang-questions] odbc unsigned values Message-ID: Hi, I'm trying to port my erlang app to linux. It works fine on windows but I'm having trouble with odbc on linux. Basically anytime I do something like this: SQL="Select BigInt from Table", odbc:sql_query(DBRef, SQL). If BigInt is over 2147483647 it will just return 2147483647. in mysql BigInt is of type: int(10) unsigned it works fine from isql I'm using odbc-2.10.2 Is this a known problem? Any ideas how to fix? Thanks for any help, Jed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pirj@REDACTED Fri Dec 26 23:50:13 2008 From: pirj@REDACTED (Phil Pirozhkov) Date: Sat, 27 Dec 2008 01:50:13 +0300 Subject: [erlang-questions] yecc subpattern issue Message-ID: Hi! Having issues with yecc (leex works 100% fine) For a l the following rules doesn't work, and they work perfectly fine for {for a in b}{a}{a}{end} https://github.com/pirj/ryan/tree/master/src/retem/retem_parse.yrl I expect a single for_block -> '{' for identifier in identifier '}' blocks end : {for, remove_id('$3'), '$5', ['$7']}. is enough, but this rule doesn't seem to work at all. for_block -> '{' for identifier in identifier '}' block end : {for, remove_id('$3'), '$5', ['$7']}. works fine Is there a need for an additional level of abstraction in this case? leex output for "{for a in b}{a}{a}{end}" is: [{'{'}, {for}, {identifier,a}, {in}, {identifier,b}, {'}'}, {'{'}, {identifier,a}, {'}'}, {'{'}, {identifier,a}, {'}'}, {'{'}, {endc}, {'}'}] a single occurency of {'{'}, {identifier,a}, {'}'}, is treated as 'block' by yecc, and the whole sequence results in [{for,a,{identifier,b},{identifier,a}}] but {'{'}, {identifier,a}, {'}'}, {'{'}, {identifier,a}, {'}'}, isn't parsed as 'blocks', and results in exception: exception error: no match of right hand side value {error,{a,retem_parse, ["syntax error before: ",["identifier"]]}} Why? Is there a cure? Cheers, Phil From pirj@REDACTED Fri Dec 26 23:57:18 2008 From: pirj@REDACTED (Phil Pirozhkov) Date: Sat, 27 Dec 2008 01:57:18 +0300 Subject: [erlang-questions] yecc subpattern issue Message-ID: Hi! Having issues with yecc (leex works 100% fine) For a l the following rules doesn't work, and they work perfectly fine for {for a in b}{a}{a}{end} https://github.com/pirj/ryan/tree/master/src/retem/retem_parse.yrl I expect a single for_block -> '{' for identifier in identifier '}' blocks end : {for, remove_id('$3'), '$5', ['$7']}. is enough, but this rule doesn't seem to work at all. for_block -> '{' for identifier in identifier '}' block end : {for, remove_id('$3'), '$5', ['$7']}. works fine Is there a need for an additional level of abstraction in this case? leex output for "{for a in b}{a}{a}{end}" is: [{'{'}, {for}, {identifier,a}, {in}, {identifier,b}, {'}'}, {'{'}, {identifier,a}, {'}'}, {'{'}, {identifier,a}, {'}'}, {'{'}, {endc}, {'}'}] a single occurency of {'{'}, {identifier,a}, {'}'}, is treated as 'block' by yecc, and the whole sequence results in [{for,a,{identifier,b},{identifier,a}}] but {'{'}, {identifier,a}, {'}'}, {'{'}, {identifier,a}, {'}'}, isn't parsed as 'blocks', and results in exception: exception error: no match of right hand side value {error,{a,retem_parse, ["syntax error before: ",["identifier"]]}} Why? Is there a cure? Cheers, Phil From rvirding@REDACTED Sat Dec 27 00:35:16 2008 From: rvirding@REDACTED (Robert Virding) Date: Sat, 27 Dec 2008 00:35:16 +0100 Subject: [erlang-questions] yecc subpattern issue In-Reply-To: References: Message-ID: <3dbc6d1c0812261535l1ffeaa7dk2a768f152f6618b9@mail.gmail.com> A quick comment without really studying everything in detail: yecc generated grammers expect the tokens to have the format: {Type,TokenLine} or {Type,TokenLine,TokenValue} So for example some erlang tokens would be {':-', 53}, {atom,46,name} and {var,32,'Name'}. >From what I could see in the .xrl file the tokens you returned don't have that format. This may be the cause of your errors. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From zerthurd@REDACTED Sat Dec 27 07:41:30 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Sat, 27 Dec 2008 12:41:30 +0600 Subject: [erlang-questions] Where is mnemosyne? BUG or not? Message-ID: Hello I cannot find mnemosyne module in OTP-R12B-5. There is only lib/mnesia/include/mnemosyne.hrl which contains directive: -compile({parse_transform,mnemosyne}). but module mnemosyne which exports parse_transform is absent. When I compile module with included this header file I have error: src/ssw_conf.erl:none: error in parse transform 'mnemosyne': {undef, [{mnemosyne,parse_transform, [....... ....... and many tons of AST output. Is this bug or not? Thank you. -- Maxim Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From harveyd@REDACTED Sat Dec 27 09:16:18 2008 From: harveyd@REDACTED (Dale Harvey) Date: Sat, 27 Dec 2008 08:16:18 +0000 Subject: [erlang-questions] Where is mnemosyne? BUG or not? In-Reply-To: References: Message-ID: no, mnemosyne has been removed since r12b-0 http://erlang.org/download/otp_src_R12B-0.readme OTP-6846 The mnemosyne and mnesia_session applications have been removed. Use qlc instead of mnemosyne. 2008/12/27 Maxim Treskin > Hello > > I cannot find mnemosyne module in OTP-R12B-5. There is only > lib/mnesia/include/mnemosyne.hrl which contains directive: > > -compile({parse_transform,mnemosyne}). > > but module mnemosyne which exports parse_transform is absent. > > When I compile module with included this header file I have error: > > src/ssw_conf.erl:none: error in parse transform 'mnemosyne': {undef, > [{mnemosyne,parse_transform, > [....... > ....... > > and many tons of AST output. > > > Is this bug or not? > > Thank you. > > -- > Maxim Treskin > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kostis@REDACTED Sat Dec 27 11:44:20 2008 From: kostis@REDACTED (Kostis Sagonas) Date: Sat, 27 Dec 2008 12:44:20 +0200 Subject: [erlang-questions] Where is mnemosyne? BUG or not? In-Reply-To: References: Message-ID: <49560704.60100@cs.ntua.gr> Maxim Treskin wrote: > Hello > > I cannot find mnemosyne module in OTP-R12B-5. There is only > lib/mnesia/include/mnemosyne.hrl which contains directive: The 'mnemosyne' application has been taken out from the Erlang/OTP system many releases ago. The reason why this header file still exists in the system is unknown to me. Probably due to an oversight. Kostis From koushik.list@REDACTED Sat Dec 27 15:01:19 2008 From: koushik.list@REDACTED (Koushik Narayanan) Date: Sat, 27 Dec 2008 19:31:19 +0530 Subject: [erlang-questions] Dialyzer and gen_tcp:listen Message-ID: <20081227140119.GA2541@bsd.top> Hi All, The gen_tcp:listen function returns an {ok,ListenSocket} or {error,Reason} immediately. But somehow for code like this: init([Config_record]) -> case inet:gethostbyname(Config_record#config.hostname) of {ok, {hostent, _HostName,_Unused,inet,_Ver,[IP]}} -> HTTP_IP = IP; _ -> HTTP_IP = {127,0,0,1} end, {ok,Listen} = gen_tcp:listen(Config_record#config.port,[list, {ip,HTTP_IP}, {packet,http}, {active, false}, {reuseaddr,true}]), do_accept(Listen), %% returns immediately {ok,none}. The dialyzer says init/1 has no local return. Why so? The same code using ssl:listen though passes the dialyzer. What am I missing here? Regards, Koushik Narayanan From kostis@REDACTED Sat Dec 27 17:29:24 2008 From: kostis@REDACTED (Kostis Sagonas) Date: Sat, 27 Dec 2008 18:29:24 +0200 Subject: [erlang-questions] Dialyzer and gen_tcp:listen In-Reply-To: <20081227140119.GA2541@bsd.top> References: <20081227140119.GA2541@bsd.top> Message-ID: <495657E4.9040804@cs.ntua.gr> Koushik Narayanan wrote: > Hi All, > > The gen_tcp:listen function returns an {ok,ListenSocket} or {error,Reason} immediately. > > But somehow for code like this: > > init([Config_record]) -> > case inet:gethostbyname(Config_record#config.hostname) of > {ok, {hostent, _HostName,_Unused,inet,_Ver,[IP]}} -> > HTTP_IP = IP; > _ -> > HTTP_IP = {127,0,0,1} > end, > {ok,Listen} = gen_tcp:listen(Config_record#config.port,[list, > {ip,HTTP_IP}, > {packet,http}, > {active, false}, > {reuseaddr,true}]), > do_accept(Listen), %% returns immediately > {ok,none}. > > > The dialyzer says init/1 has no local return. > > Why so? Do yourself a favor and submit a proper bug report. Some code that when you run dialyzer on it (btw, which Erlang/OTP version is this?), then it shows the behavior you claim dialyzer has on your code (and possibly any other warnings you may get). With the information you have provided us, I cannot reproduce your problem. I put the above in a file: ------------------------------------------------------ -module(q). -export([init/1]). -record(config, {hostname, port}). init([Config_record]) -> case inet:gethostbyname(Config_record#config.hostname) of {ok, {hostent, _HostName,_Unused,inet,_Ver,[IP]}} -> HTTP_IP = IP; _ -> HTTP_IP = {127,0,0,1} end, {ok,Listen} = gen_tcp:listen(Config_record#config.port,[list, {ip,HTTP_IP}, {packet,http}, {active, false}, {reuseaddr,true}]), do_accept(Listen), %% returns immediately {ok,none}. do_accept(_) -> ok. ------------------------------------------------------ and run dialyzer on it and got: dialyzer -c q.erl Checking whether the PLT /home/kostis/.dialyzer_plt is up-to-date... yes Proceeding with analysis... done in 0m0.59s done (passed successfully) Kostis From jeedward@REDACTED Sat Dec 27 21:58:52 2008 From: jeedward@REDACTED (Ed) Date: Sat, 27 Dec 2008 12:58:52 -0800 (PST) Subject: [erlang-questions] MULTICONF-09 call for papers Message-ID: <815630.77980.qm@web45906.mail.sp1.yahoo.com> MULTICONF-09 call for papers ? The 2009 Multi Conference in Computer Science, Information Technology and Control systems and Computational Science and Computer Engineering (MULTICONF-09) (website: http://www.PromoteResearch.org) will be held during July 13-16 2009 in Orlando, FL, USA. We invite draft paper submissions. The event consists of the following conferences: ????????? International Conference on Artificial Intelligence and Pattern Recognition (AIPR-09) ????????? International Conference on Automation, Robotics and Control Systems (ARCS-09) ????????? International Conference on Bioinformatics, Computational Biology, Genomics and Chemoinformatics (BCBGC-09) ????????? International Conference on Enterprise Information Systems and Web Technologies (EISWT-09) ????????? International Conference on High Performance Computing, Networking and Communication Systems (HPCNCS-09) ????????? International Conference on Information Security and Privacy (ISP-09) ????????? International Conference on Recent Advances in Information Technology and Applications (RAITA-09) ????????? International Conference on Software Engineering Theory and Practice (SETP-09) ????????? International Conference on Theory and Applications of Computational Science (TACS-09) ????????? International Conference on Theoretical and Mathematical Foundations of Computer Science (TMFCS-09) ? The website http://www.PromoteResearch.org? contains more details. ? Sincerely John Edward Publicity committee ? ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From pirj@REDACTED Sun Dec 28 00:26:49 2008 From: pirj@REDACTED (Phil Pirozhkov) Date: Sun, 28 Dec 2008 02:26:49 +0300 Subject: [erlang-questions] =?koi8-r?b?eWVjYyBzdWJwYXR0ZXJuIGlzc3Vl?= Message-ID: Thank you for helping me out again, Robert! The point was that adding elements to matched list doesn't work. This one works fine: blocks -> blocks block : '$1' ++ ['$2']. And this one (i used before): blocks -> block blocks : ['$1' | '$2']. (yes, blocks and block reverted here compared to the first example, because of $2 (blocks) should be a list, and $1 (block) - a value). This is odd, because [H|T] seems to be more erlang'ish (and more optimal i suggest?) than ++. Just rolled back TokenLine changes, they doesn't affect parser at all, i.e. it works perfectly fine with leex provided tuples of the following format: [{'{'},{forc},{identifier,a},{in},{identifier,b},{'}'},{'{'}, {identifier,a},{'}'},{text," kg"},{'{'},{endc},{'}'}]. Just to notice, '$end' is not required too, works fine without it. Maybe line numbers and '$end' should be marked as optional in yecc docs. I agree that line numbers are very helpful when it comes to seek for issues in the data provided to parser, but this only eats up memory when is not required. > A quick comment without really studying everything in detail: yecc generated > grammers expect the tokens to have the format: > > {Type,TokenLine} or {Type,TokenLine,TokenValue} > > So for example some erlang tokens would be {':-', 53}, {atom,46,name} and > {var,32,'Name'}. > > From what I could see in the .xrl file the tokens you returned don't have > that format. This may be the cause of your errors. Cheers, Phil From hayeah@REDACTED Sun Dec 28 02:47:24 2008 From: hayeah@REDACTED (Howard Yeh) Date: Sat, 27 Dec 2008 17:47:24 -0800 Subject: [erlang-questions] rlwrap not working with erlang shell?? Message-ID: Is ^R bounded to something in erlang shell? For some reason i can't get history search to work... rlwrap works with another non-readline shell though... From wglozer@REDACTED Sun Dec 28 09:11:44 2008 From: wglozer@REDACTED (Will) Date: Sun, 28 Dec 2008 00:11:44 -0800 Subject: [erlang-questions] announce: yet-another-PostgreSQL driver Message-ID: Hello, I've written a pure Erlang PostgreSQL driver, available here: hg clone http://glozer.net/src/epgsql Some highlights are: a simple interface, common db types returned as native Erlang types, and binary format used for common types. -Will -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Sun Dec 28 10:56:35 2008 From: joelr1@REDACTED (Joel Reymont) Date: Sun, 28 Dec 2008 09:56:35 +0000 Subject: [erlang-questions] cheap low-power boards Message-ID: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> Is anyone running Erlang on a cheap low-power board? ARM, Atom, PowerPC is what I'm interested in. Can you please share your experience, privately if you want? I'm looking for 2-5W or less of power consumption. Thanks in advance, Joel -- http://wagerlabs.com From csanto@REDACTED Sun Dec 28 13:32:32 2008 From: csanto@REDACTED (Corrado Santoro) Date: Sun, 28 Dec 2008 13:32:32 +0100 (CET) Subject: [erlang-questions] cheap low-power boards In-Reply-To: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> References: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> Message-ID: <41154.87.7.166.157.1230467552.squirrel@webmail.cdc.unict.it> Hi Joel, I've successful *compiled* Erlang on a ARM9 board. The shell runs. But I've tried to executed a complex Erlang app... even if running the shell implies that the whole erlang runtime system is working well! --Corrado From joelr1@REDACTED Sun Dec 28 14:19:09 2008 From: joelr1@REDACTED (Joel Reymont) Date: Sun, 28 Dec 2008 13:19:09 +0000 Subject: [erlang-questions] cheap low-power boards In-Reply-To: <41154.87.7.166.157.1230467552.squirrel@webmail.cdc.unict.it> References: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> <41154.87.7.166.157.1230467552.squirrel@webmail.cdc.unict.it> Message-ID: <64C64801-50ED-4B94-A5E7-4F14536C7E07@gmail.com> On Dec 28, 2008, at 12:32 PM, Corrado Santoro wrote: > I've successful *compiled* Erlang on a ARM9 board. The shell runs. But > I've tried to executed a complex Erlang app... even if running the > shell > implies that the whole erlang runtime system is working well! Do you mean that you _have not_ tried to execute a complex Erlang app? What kind of board was that? Did it have an LCD controller? I'm thinking of using Erlang with marine electronics. Thanks, Joel -- http://wagerlabs.com From csanto@REDACTED Sun Dec 28 14:25:16 2008 From: csanto@REDACTED (Corrado Santoro) Date: Sun, 28 Dec 2008 14:25:16 +0100 (CET) Subject: [erlang-questions] cheap low-power boards In-Reply-To: <64C64801-50ED-4B94-A5E7-4F14536C7E07@gmail.com> References: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> <41154.87.7.166.157.1230467552.squirrel@webmail.cdc.unict.it> <64C64801-50ED-4B94-A5E7-4F14536C7E07@gmail.com> Message-ID: <50720.87.7.166.157.1230470716.squirrel@webmail.cdc.unict.it> Hi Joel, > Do you mean that you _have not_ tried to execute a complex Erlang app? Yes.. sorry typo :-) > What kind of board was that? Did it have an LCD controller? Look at the link: http://www.calao-systems.com/articles.php?lng=en&pg=5748 The board is USB-A9260-C02. The micro is ATMEL, with an ARM9 core. > I'm thinking of using Erlang with marine electronics. :-) --Corrado From ms@REDACTED Sun Dec 28 15:01:40 2008 From: ms@REDACTED (Martin Scholl) Date: Sun, 28 Dec 2008 15:01:40 +0100 Subject: [erlang-questions] cheap low-power boards In-Reply-To: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> References: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> Message-ID: <495786C4.5090805@diskware.net> Hello Joel, erlang runs on ATOM-based boards. A candidate for what you plan to do is this board: http://kontron.com/nanoETXexpress-SP They claim < 5w idle power consumption. For starting hacking I recommend buying one of Intels' atom reference boards which are quite cheap (typically ~50eur - a complete system typically costs less than 120eur). Martin Joel Reymont wrote: > Is anyone running Erlang on a cheap low-power board? > > ARM, Atom, PowerPC is what I'm interested in. > > Can you please share your experience, privately if you want? > > I'm looking for 2-5W or less of power consumption. > > Thanks in advance, Joel > > -- > http://wagerlabs.com > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From mail@REDACTED Mon Dec 29 01:01:06 2008 From: mail@REDACTED (Sriram Krishnan) Date: Sun, 28 Dec 2008 16:01:06 -0800 Subject: [erlang-questions] SHA256 support in crypto Message-ID: <90E71B9E-207B-4718-86EC-DF6B3ED5DA22@sriramkrishnan.com> Are there plans to add sha256 support to the crypto module? I see a patch at http://www.erlang.org/pipermail/erlang-patches/2007-June/000177.html - will that be added to the official crypto module? -- Sriram Krishnan www.sriramkrishnan.com From c.romain@REDACTED Mon Dec 29 03:14:42 2008 From: c.romain@REDACTED (cyril Romain) Date: Mon, 29 Dec 2008 03:14:42 +0100 Subject: [erlang-questions] Are packaged modules the way to go ? Message-ID: <49583292.8040903@laposte.net> Hi, This mail is about packaged modules (module with namespace), aimed to extend Erlang with structured module packages [1]. You can find a quick introduction [2] and the packages module documentation [3]. Using packaged modules or not has little impact on code but quite big impact on: - project file structure and naming - tools analyzing Erlang files or project file structure (such as debugger, dialyzer, Emakefile, etc.). - and consequently on package structure (I mean Erlang software packaging here, such as done by CEAN [4]). The support for packaged module has been introduced in Erlang/OTP before 2003 for evaluation purpose [5], but its adoption (or the intent of adoption) seems still unclear today. So my question is: for the sake of Erlang software consistency, should Erlang developers - be it core developers or developers using Erlang - adopt packaged modules ? Does it need improvement before official adoption ? Should packaged modules be ignored (or even removed from Erlang?) instead ? Best regards, Cyril [1] http://www.it.uu.se/research/publications/reports/2000-001/ [2] http://www.erlang.se/publications/packages.html [3] http://erlang.org/doc/man/packages.html ; For some reason exported methods are not documented. [4] http://cean.process-one.net/ [5] http://www.erlang.org/pipermail/erlang-questions/2003-April/008575.html From koushik.list@REDACTED Mon Dec 29 06:29:45 2008 From: koushik.list@REDACTED (Koushik Narayanan) Date: Mon, 29 Dec 2008 10:59:45 +0530 Subject: [erlang-questions] Dialyzer and gen_tcp:listen In-Reply-To: <495657E4.9040804@cs.ntua.gr> References: <20081227140119.GA2541@bsd.top> <495657E4.9040804@cs.ntua.gr> Message-ID: <20081229052945.GA28425@bsd.top> On Sat, Dec 27, 2008 at 06:29:24PM +0200, Kostis Sagonas wrote: > Do yourself a favor and submit a proper bug report. Some code that when > you run dialyzer on it (btw, which Erlang/OTP version is this?), then it > shows the behavior you claim dialyzer has on your code (and possibly any > other warnings you may get). Ok this occurs only in R12B3 (dialyzer version 1.8.1). It is fine on R12B4 (dialyzer version 1.8.2). Sorry for the trouble. Regards, Koushik Narayanan From rvirding@REDACTED Mon Dec 29 11:46:17 2008 From: rvirding@REDACTED (Robert Virding) Date: Mon, 29 Dec 2008 11:46:17 +0100 Subject: [erlang-questions] yecc subpattern issue In-Reply-To: References: Message-ID: <3dbc6d1c0812290246q744eabc7o74c83455de1fa43d@mail.gmail.com> 2008/12/28 Phil Pirozhkov > Thank you for helping me out again, Robert! > > The point was that adding elements to matched list doesn't work. > > This one works fine: > blocks -> blocks block : '$1' ++ ['$2']. > > And this one (i used before): > blocks -> block blocks : ['$1' | '$2']. > (yes, blocks and block reverted here compared to the first example, > because of $2 (blocks) should be a list, and $1 (block) - a value). > > This is odd, because [H|T] seems to be more erlang'ish (and more optimal i > suggest?) > than ++. These two are basically equivalent. If I remember correctly then the first one is more efficient from a yecc/LALR(1) point of view , while the second is more erlangy. I would personally use the second style. Just rolled back TokenLine changes, they doesn't affect parser at all, i.e. > it works perfectly fine with leex provided tuples of the following format: > > [{'{'},{forc},{identifier,a},{in},{identifier,b},{'}'},{'{'}, > {identifier,a},{'}'},{text," kg"},{'{'},{endc},{'}'}]. Yes, this will work as long as you don't get any parse errors. Yecc assumes all tokens are tuples where the first element is the type and the second element is the line number. It will access the the second element to get the line number when it detects an error. Yecc ignores other elements in the token tuple so you are free to put data in extra elements which can then be accessed in the productions. That is the reason for giving the format of tokens as {Type,TokenLine} or {Type,TokenLine,TokenValue} You can of course have more values if necessary. It is not wise not to follow the "standard" token formats. > Just to notice, '$end' is not required too, works fine without it. > Maybe line numbers and '$end' should be marked as optional in yecc docs. > I agree that line numbers are very helpful when it comes to seek for issues > in the data provided to parser, but this only eats up memory when is not > required. Yecc is kind and adds a '$end' token, so it is optional. As I explained above the line numbers are not optional and yecc assumes that they are there. The amount of extra memory needed for the line numbers is small and I wouldn't worry about. Also they are so easy to generate from leex or a hand-written scanner that there is really no reason not to put them in. Even in LFE where I can't use yecc I still have the line numbers to give better error reporting. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.thilani@REDACTED Mon Dec 29 12:03:57 2008 From: a.thilani@REDACTED (Thilani Abeysinghe) Date: Mon, 29 Dec 2008 16:33:57 +0530 Subject: [erlang-questions] spawn_link Message-ID: I have a problem of how to get the return value of a function when spawn_link(Fun) ->pid() is used. Im going to use above function in following manner. init([]) -> ChildPid = erlang:spawn_link(?MODULE, connect_to_server, [Ip,Port, ConId, self(),State]). connect_to_server(Ip, Port, ConId, ParentPid,State) -> case Result= gen_tcp:connect(Ip, Port, [binary, {packet, 0}]) of {ok, Socket} -> io:format("Socket Received:~w~n",[Socket]), ok =(catch gen_server:call(g_srv, {add_conn, self(), ConId, Socket})), NewState = State#state{socket= Socket}; {error, Reason} -> io:format("connection error host Ip:~w Port: ~w ~w ~n", [Ip,Port,Reason]) , connect_to_server(Ip, Port, ConId, ParentPid,State) end. I want to get the return value of connect_to_server function. How can I do that. Regards Thilani -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandrashekhar.mullaparthi@REDACTED Mon Dec 29 12:10:23 2008 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Mon, 29 Dec 2008 11:10:23 +0000 Subject: [erlang-questions] spawn_link In-Reply-To: References: Message-ID: 2008/12/29 Thilani Abeysinghe : > I have a problem of how to get the return value of a function when > > spawn_link(Fun) ->pid() is used. > > Im going to use above function in following manner. > > init([]) -> > > ChildPid = erlang:spawn_link(?MODULE, connect_to_server, [Ip,Port, ConId, > self(),State]). > > connect_to_server(Ip, Port, ConId, ParentPid,State) -> > case Result= gen_tcp:connect(Ip, Port, > [binary, {packet, 0}]) of > {ok, Socket} -> > io:format("Socket Received:~w~n",[Socket]), > ok =(catch gen_server:call(g_srv, {add_conn, self(), ConId, > Socket})), > NewState = State#state{socket= Socket}; > {error, Reason} -> > io:format("connection error host Ip:~w Port: ~w ~w ~n", > [Ip,Port,Reason]) , > connect_to_server(Ip, Port, ConId, ParentPid,State) > end. > > I want to get the return value of connect_to_server function. How can I do > that. > I'm assuming you want to send intermediate results, as connect_to_server seems to be part of a process which is long lived. In such cases, send a message to the parent process from the spawned process. cheers Chandru From a.thilani@REDACTED Mon Dec 29 12:16:28 2008 From: a.thilani@REDACTED (Thilani Abeysinghe) Date: Mon, 29 Dec 2008 16:46:28 +0530 Subject: [erlang-questions] spawn_link In-Reply-To: References: Message-ID: Thanks for quick reply.:) function connect_to_server method tries to connect to a server, when it connects sucessfull it returns {ok,Socket}. so I want to get that socket and send messages to the server. So here I'm trieng to save the socket value in state of gen_server. regards Thilani On Mon, Dec 29, 2008 at 4:40 PM, Chandru < chandrashekhar.mullaparthi@REDACTED> wrote: > 2008/12/29 Thilani Abeysinghe : > > I have a problem of how to get the return value of a function when > > > > spawn_link(Fun) ->pid() is used. > > > > Im going to use above function in following manner. > > > > init([]) -> > > > > ChildPid = erlang:spawn_link(?MODULE, connect_to_server, [Ip,Port, ConId, > > self(),State]). > > > > connect_to_server(Ip, Port, ConId, ParentPid,State) -> > > case Result= gen_tcp:connect(Ip, Port, > > [binary, {packet, 0}]) of > > {ok, Socket} -> > > io:format("Socket Received:~w~n",[Socket]), > > ok =(catch gen_server:call(g_srv, {add_conn, self(), ConId, > > Socket})), > > NewState = State#state{socket= Socket}; > > {error, Reason} -> > > io:format("connection error host Ip:~w Port: ~w ~w ~n", > > [Ip,Port,Reason]) , > > connect_to_server(Ip, Port, ConId, ParentPid,State) > > end. > > > > I want to get the return value of connect_to_server function. How can I > do > > that. > > > > I'm assuming you want to send intermediate results, as > connect_to_server seems to be part of a process which is long lived. > In such cases, send a message to the parent process from the spawned > process. > > cheers > Chandru > -------------- next part -------------- An HTML attachment was scrubbed... URL: From 0x6e6562@REDACTED Mon Dec 29 12:42:55 2008 From: 0x6e6562@REDACTED (Ben Hood) Date: Mon, 29 Dec 2008 11:42:55 +0000 Subject: [erlang-questions] cheap low-power boards In-Reply-To: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> References: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> Message-ID: <269388e30812290342v1cc8aa01y8e9c16624a5d64a3@mail.gmail.com> Joel, On Sun, Dec 28, 2008 at 9:56 AM, Joel Reymont wrote: > Is anyone running Erlang on a cheap low-power board? > > ARM, Atom, PowerPC is what I'm interested in. We're running running a Rabbit cluster on a bunch of Linksys NSLU2 SLUGs. Don't know too much more than that off the top of my head, I'm afraid. HTH, Ben From 0x6e6562@REDACTED Mon Dec 29 13:59:46 2008 From: 0x6e6562@REDACTED (Ben Hood) Date: Mon, 29 Dec 2008 12:59:46 +0000 Subject: [erlang-questions] cheap low-power boards In-Reply-To: <4958BD11.3020809@diskware.net> References: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> <269388e30812290342v1cc8aa01y8e9c16624a5d64a3@mail.gmail.com> <4958BD11.3020809@diskware.net> Message-ID: <269388e30812290459l48d38a41p8e3a6b69a3e66d47@mail.gmail.com> Martin, On Mon, Dec 29, 2008 at 12:05 PM, Martin Scholl wrote: > nice idea! Have you done some benchmarking to compare the performance of > these devices with standard pc hardware? Would be interesting to know > the performance/watt ratio for this kind of deployment. Not really because we haven't spent too much time benchmarking the server at all. Obviously there are some standard benchmarks such as throughput and latency, but these are generally used to compare different releases against each other. Defining what constitutes a benchmark is to an extent a subjective task and hence will depend on what your use case is. There are not same types of well defined independent benchmarks for messaging systems as there are for SQL databases, for example. Having said this, our benchmarks are part of our standard client library and you could easily install a Rabbit cluster on both sets of hardware and run them yourself. HTH, Ben From rhythm.mail@REDACTED Mon Dec 29 14:56:27 2008 From: rhythm.mail@REDACTED (Lian Cheng) Date: Mon, 29 Dec 2008 21:56:27 +0800 Subject: [erlang-questions] Problem with XML validation using xmerl_xsd:validate(). In-Reply-To: <42EC95E4-C48C-453C-80F5-2A0EC7901B4E@gmail.com> References: <42EC95E4-C48C-453C-80F5-2A0EC7901B4E@gmail.com> Message-ID: Hi, Your schema suggests that the "status" element should have a text value among "Valid", "Invalid" and "", while in your XML snippet, the "status" element has no text value, rather than have a text value of an empty string. I think that the difference between and just like, in the C language, the difference between: char* p = NULL; and char* p = ""; In a word, is not equivalent to in your situation, although I'm not quite sure about my opinion :-) Cheers Cheng ?????? ??????? ??: > Hello > > Please help to sort it out: > > trying to validate XML using: > > {ok, State } = xmerl_xsd:process_schema("test.xsd"), > {Entity ,_} = xmerl_scan:file("test.xml"), > xmerl_xsd:validate(Entity, State). > > > XSD content: > > > > elementFormDefault="qualified" attributeFormDefault="unqualified"> > > > > > > > > > > > > > > > > > and receive next error: > > XML content: > > > > > > Got an error: > > {error,[{[],xmerl_xsd, > {empty_content_not_allowed,[{enumeration,"Valid"}, > {enumeration,"Invalid"}, > {enumeration,[]}]}}]} > > > I think it is valid markup for this schema. The same opinion has some > other validating parsers. > > How do you think? > > -- > Sedinin > > > From 0x6e6562@REDACTED Mon Dec 29 15:43:50 2008 From: 0x6e6562@REDACTED (Ben Hood) Date: Mon, 29 Dec 2008 14:43:50 +0000 Subject: [erlang-questions] cheap low-power boards In-Reply-To: <54897A25-72C6-47A1-AAC0-D56E74D5AD4B@gmail.com> References: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> <269388e30812290342v1cc8aa01y8e9c16624a5d64a3@mail.gmail.com> <54897A25-72C6-47A1-AAC0-D56E74D5AD4B@gmail.com> Message-ID: <269388e30812290643j59674818q84f1af951948f513@mail.gmail.com> Hi Joel, On Mon, Dec 29, 2008 at 12:57 PM, Joel Reymont wrote: >> We're running running a Rabbit cluster on a bunch of Linksys NSLU2 >> SLUGs. Don't know too much more than that off the top of my head, I'm >> afraid. > > > Hi Ben! Can you tell me more about this application? > > Also, I was told that the WD Mybook has the same architecture, i.e. runs on > ARM and Linux, etc. Basically it is just a RabbitMQ cluster running on 8 x NSLU2 devices, I think 3 of which are running as disk nodes and 5 as RAM nodes. This is the circulum vitae of each node: * 100baseT ethernet port * 2 USB 2.0 ports * 133Mhz ARM9 * 32Mb RAM Each SLUG is running the ARM port of etch. It's as not as special as it sounds - we mainly use it as a cost effective way to test clustering (being a pennyless open source outfit). And for demonstration purposes - you can take it with you to demonstrate clustering at a talk, for example. And also to show that you can run Rabbit on resource constained hardware. The set up is just plain jane OTP clustering - see here for details: http://www.rabbitmq.com/clustering.html HTH, Ben From rec@REDACTED Mon Dec 29 16:16:41 2008 From: rec@REDACTED (Roger Critchlow) Date: Mon, 29 Dec 2008 10:16:41 -0500 Subject: [erlang-questions] cheap low-power boards In-Reply-To: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> References: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> Message-ID: <66d1c98f0812290716r2936306fy4fb7654b84f6148b@mail.gmail.com> I ended up with an Intel D201GLY2A which is a low power celeron and I needed to reduce the number of nodes that it ran relative to the pentiums and c2ds in the network or it would get overwhelmed. It's going for $70 a piece, $637 for a lot of 10. My expectation is that if they'll sell you linux running on the board, you'll be fine until you run out of memory. But I did pick an x86 rather than test that expectation. -- rec -- On Sun, Dec 28, 2008 at 4:56 AM, Joel Reymont wrote: > Is anyone running Erlang on a cheap low-power board? > > ARM, Atom, PowerPC is what I'm interested in. > > Can you please share your experience, privately if you want? > > I'm looking for 2-5W or less of power consumption. > > Thanks in advance, Joel > > -- > http://wagerlabs.com > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From 0x6e6562@REDACTED Mon Dec 29 16:30:09 2008 From: 0x6e6562@REDACTED (Ben Hood) Date: Mon, 29 Dec 2008 15:30:09 +0000 Subject: [erlang-questions] cheap low-power boards In-Reply-To: <4958D05A.2020209@diskware.net> References: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> <269388e30812290342v1cc8aa01y8e9c16624a5d64a3@mail.gmail.com> <4958BD11.3020809@diskware.net> <269388e30812290459l48d38a41p8e3a6b69a3e66d47@mail.gmail.com> <4958D05A.2020209@diskware.net> Message-ID: <269388e30812290730i1d8c1db6xb9dbb9dce49e92ef@mail.gmail.com> Martin, On Mon, Dec 29, 2008 at 1:27 PM, Martin Scholl wrote: > Ben Hood wrote: > [snip] >> Obviously there are some standard benchmarks such as throughput and >> latency, but these are generally used to compare different releases >> against each other. > I think, latency is more interesting than throughput. I am not really > familiar with RabbitMQ and its distributed capabilities -- imho it would > be particularly interesting to see how RabbitMQ scales on these kind of > embedded stuff (comparing performance/watt with standard hardware). Sure, but if I was really worried about latency, I don't know if would go down the embedded route. > Our results are quite promising: > >> >> Defining what constitutes a benchmark is to an extent a subjective >> task and hence will depend on what your use case is. > I am interested in "green computing" and especially results of > performance / watt ratios of real world scenarios. This is my motivation > behind all this. Maybe you could look at an application that does not constantly stress the middleware - hence having something light weight would not cost much when it's not doing anything and hence been *greener*. Having said this, I think this may be a question of how long is a piece of string - for example, you could also compare bang for for energy buck by running virtualized machines. >> There are not same types of well defined independent benchmarks for >> messaging systems as there are for SQL databases, for example. >> >> Having said this, our benchmarks are part of our standard client >> library and you could easily install a Rabbit cluster on both sets of >> hardware and run them yourself. > Sadly, I do not have the money to buy a NSLU2 just to do the > benchmarking - therefore I asked you if you have some results at hand. > I can access e.g. an ATOM board and will happily benchmark and share the > results, if you could tell me more details on the benchmarking > methodology you propose. This is getting a bit more rabbitty (maybe this question should migrate to the rabbit discussion list? I've cross-posted just in case). In the Rabbit client library there is a utility called MulticastMain, which, if you run it the --help flag, will tell you about all of the configuration options you have to test latency and throughput from a client perspective. HTH, Ben From ms@REDACTED Mon Dec 29 16:59:54 2008 From: ms@REDACTED (Martin Scholl) Date: Mon, 29 Dec 2008 16:59:54 +0100 Subject: [erlang-questions] cheap low-power boards In-Reply-To: <269388e30812290730i1d8c1db6xb9dbb9dce49e92ef@mail.gmail.com> References: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> <269388e30812290342v1cc8aa01y8e9c16624a5d64a3@mail.gmail.com> <4958BD11.3020809@diskware.net> <269388e30812290459l48d38a41p8e3a6b69a3e66d47@mail.gmail.com> <4958D05A.2020209@diskware.net> <269388e30812290730i1d8c1db6xb9dbb9dce49e92ef@mail.gmail.com> Message-ID: <4958F3FA.4000403@diskware.net> Hello all, [hoping this is still interesting for the ppl at erlang-questions@, rabbitmq-discuss@] Ben Hood wrote: > Martin, > > On Mon, Dec 29, 2008 at 1:27 PM, Martin Scholl wrote: >> Ben Hood wrote: >> [snip] >>> Obviously there are some standard benchmarks such as throughput and >>> latency, but these are generally used to compare different releases >>> against each other. >> I think, latency is more interesting than throughput. I am not really >> familiar with RabbitMQ and its distributed capabilities -- imho it would >> be particularly interesting to see how RabbitMQ scales on these kind of >> embedded stuff (comparing performance/watt with standard hardware). > > Sure, but if I was really worried about latency, I don't know if would > go down the embedded route. [I am not an eco activist and I don't want to evangelize, and no, I am not paid by Intel for doing this:] Some numbers: compiling erlang on an ATOM 330@REDACTED takes about 2/3 times longer than on an Intel E2160 @ 1.8ghz -- but the atom requires just about ~10% of the power of the E2160 ==> The Atom "outperformes" the E2160 clearly regarding performance / watt. In other words: it is worth considering to replace servers with (several) ATOM-based systems as long as you deploy a software that can handle this. For the stuff we have tested, I can say: there are not many applications which definitely demand a non-atom processor. I am clearly not an expert in all things RabbitMq. I guess, RabbitMq's performance is dominated by the network technology used and not the hosts' cpus. Therefore, RabbitMq is a candidate for atom-based systems. > >> Our results are quite promising: >> >>> Defining what constitutes a benchmark is to an extent a subjective >>> task and hence will depend on what your use case is. >> I am interested in "green computing" and especially results of >> performance / watt ratios of real world scenarios. This is my motivation >> behind all this. > > Maybe you could look at an application that does not constantly stress > the middleware - hence having something light weight would not cost > much when it's not doing anything and hence been *greener*. Having > said this, I think this may be a question of how long is a piece of > string - for example, you could also compare bang for for energy buck > by running virtualized machines. Just to be sure: I don't want to evangelize. Having played with the ATOM processor I am quite sure, there is more room for it than just the embedded world. That is all I like to research. [snip] > In the Rabbit client library there is a utility called MulticastMain, > which, if you run it the --help flag, will tell you about all of the > configuration options you have to test latency and throughput from a > client perspective. Ok, will post some numbers soon. Martin From armstrong.whit@REDACTED Mon Dec 29 17:23:44 2008 From: armstrong.whit@REDACTED (Whit Armstrong) Date: Mon, 29 Dec 2008 11:23:44 -0500 Subject: [erlang-questions] anyone have an example of pmap/mapreduce for multiple nodes? Message-ID: <8ec76080812290823o6d05bc21rdbba3a7c40a715@mail.gmail.com> we just set up a small cluster of 5 workstations and are experimenting w/ running some distributed jobs in R using slurm and Rmpi (openMPI). I'd like to show the rest of the team here what erlang is capable of by running a small demo. I've looked at the pmap examples in Joe Armstrong's book, but I thought I would ask here before attempting to port that version of pmap or mapreduce to multiple nodes. Thanks in advance, Whit From 0x6e6562@REDACTED Mon Dec 29 17:38:10 2008 From: 0x6e6562@REDACTED (Ben Hood) Date: Mon, 29 Dec 2008 16:38:10 +0000 Subject: [erlang-questions] cheap low-power boards In-Reply-To: <4958F3FA.4000403@diskware.net> References: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> <269388e30812290342v1cc8aa01y8e9c16624a5d64a3@mail.gmail.com> <4958BD11.3020809@diskware.net> <269388e30812290459l48d38a41p8e3a6b69a3e66d47@mail.gmail.com> <4958D05A.2020209@diskware.net> <269388e30812290730i1d8c1db6xb9dbb9dce49e92ef@mail.gmail.com> <4958F3FA.4000403@diskware.net> Message-ID: <269388e30812290838t4a988a8bx17c896e599a75c0@mail.gmail.com> Martin, On Mon, Dec 29, 2008 at 3:59 PM, Martin Scholl wrote: > [I am not an eco activist and I don't want to evangelize, and no, I am > not paid by Intel for doing this:] Sure, I didn't take you as such :-) > For the stuff we have tested, I can say: there are not many applications > which definitely demand a non-atom processor. I am clearly not an expert > in all things RabbitMq. I guess, RabbitMq's performance is dominated by > the network technology used and not the hosts' cpus. Therefore, RabbitMq > is a candidate for atom-based systems. Yes, maybe, but I think that disk IO may also play a part (when journalling messages, for example). >> In the Rabbit client library there is a utility called MulticastMain, >> which, if you run it the --help flag, will tell you about all of the >> configuration options you have to test latency and throughput from a >> client perspective. > Ok, will post some numbers soon. Cool! Ben From john.hughes@REDACTED Mon Dec 29 17:39:21 2008 From: john.hughes@REDACTED (John Hughes) Date: Mon, 29 Dec 2008 17:39:21 +0100 Subject: [erlang-questions] spawn_link In-Reply-To: References: Message-ID: Hi Thilani, As Chandru said, you just send the result back to the parent process as a message. Here's some code: spawn_call(M,F,As) -> Parent = self(), Child = spawn_link(fun() -> Parent ! {self(),apply(M,F,As)} end), receive {Child,X} -> X end. Note the receive matches on the child's pid, so can't be confused by any other messages in the parent's mailbox. Sample call: 76> foo:spawn_call(lists,reverse,[[1,2,3]]). [3,2,1] John > From: "Thilani Abeysinghe" > Subject: [erlang-questions] spawn_link > To: erlang-questions@REDACTED > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > I have a problem of how to get the return value of a function when > > spawn_link(Fun) ->pid() is used. > > Im going to use above function in following manner. > > init([]) -> > > ChildPid = erlang:spawn_link(?MODULE, connect_to_server, [Ip,Port, ConId, > self(),State]). > > connect_to_server(Ip, Port, ConId, ParentPid,State) -> > case Result= gen_tcp:connect(Ip, Port, > [binary, {packet, 0}]) of > {ok, Socket} -> > io:format("Socket Received:~w~n",[Socket]), > ok =(catch gen_server:call(g_srv, {add_conn, self(), ConId, > Socket})), > NewState = State#state{socket= Socket}; > {error, Reason} -> > io:format("connection error host Ip:~w Port: ~w ~w ~n", > [Ip,Port,Reason]) , > connect_to_server(Ip, Port, ConId, ParentPid,State) > end. > > I want to get the return value of connect_to_server function. How can I do > that. > > Regards > > Thilani From jesper@REDACTED Mon Dec 29 20:04:09 2008 From: jesper@REDACTED (Jesper Eskilson) Date: Mon, 29 Dec 2008 20:04:09 +0100 Subject: [erlang-questions] wxErlang release In-Reply-To: <4942492D.4060909@erix.ericsson.se> References: <4942492D.4060909@erix.ericsson.se> Message-ID: On Fri, Dec 12, 2008 at 12:21 PM, Dan Gudmundsson wrote: > I've put up a new release. > > See http://wxerlang.sf.net > > Windows and Mac users can use the pre-built version, download and unpack > wx-0.97.1212.built.tar.gz. How do I run this on Windows when I get "WX ERROR: SMP emulator required" and there is no SMP support for Windows yet? (or is there?) -- /Jesper From kenneth.lundin@REDACTED Mon Dec 29 23:16:07 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Mon, 29 Dec 2008 23:16:07 +0100 Subject: [erlang-questions] wxErlang release In-Reply-To: References: <4942492D.4060909@erix.ericsson.se> Message-ID: There is SMP support for Windows (has been there since R12B-0, released in December 2007) /Kenneth Erlang/OTP Ericsson On Mon, Dec 29, 2008 at 8:04 PM, Jesper Eskilson wrote: > On Fri, Dec 12, 2008 at 12:21 PM, Dan Gudmundsson wrote: >> I've put up a new release. >> >> See http://wxerlang.sf.net >> >> Windows and Mac users can use the pre-built version, download and unpack >> wx-0.97.1212.built.tar.gz. > > How do I run this on Windows when I get > > "WX ERROR: SMP emulator required" > > and there is no SMP support for Windows yet? (or is there?) > > -- > /Jesper > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From 0x6e6562@REDACTED Tue Dec 30 01:08:02 2008 From: 0x6e6562@REDACTED (Ben Hood) Date: Tue, 30 Dec 2008 00:08:02 +0000 Subject: [erlang-questions] SNMP n00b problem Message-ID: <269388e30812291608p2261fef9kf64b22153c6efd7b@mail.gmail.com> Hi, I'm just following the basic instructions to implement a SNMP agent (as outlined here: http://www.erlang.org/doc/apps/snmp/part_frame.html) I've generated all of the the config files, but when I boot the SNMP app, I get the following issue: * Configuration error: [USER-BASED-SM-MIB]: reconfigure failed: {failed_check, "/Users/0x6e6562/workspace/snmp-test/usm.conf", 1,10, {invalid_user, {"0x6e6562's engine", "foobar", "initial", usmNoAuthProtocol, [], usmNoAuthProtocol, []}}} Looks like a simple config issue, but there are not too many clues as what the missing item or reference could be. I had a brief look in the snmp_user_based_sm_mib module to get to the root cause of this, but the issue was not immediately apparent. Before I debug this, I wanted to know if I am doing something obviously wrong, and/or if there is any easy way to bypass USM if I just want to boot a plain jane agent with any auth/privs. FTR this is using R12B-5 on OS X 10.5.6 Thx, Ben From jesper@REDACTED Tue Dec 30 10:09:23 2008 From: jesper@REDACTED (Jesper Eskilson) Date: Tue, 30 Dec 2008 10:09:23 +0100 Subject: [erlang-questions] wxErlang release In-Reply-To: References: <4942492D.4060909@erix.ericsson.se> Message-ID: On Mon, Dec 29, 2008 at 11:16 PM, Kenneth Lundin wrote: > There is SMP support for Windows (has been there since R12B-0, > released in December 2007) My bad. Brain miswired. (I think I misremembered by inquiry about Hipe on Windows. Or too much gl?gg. :-)) -- /Jesper From sedinin@REDACTED Tue Dec 30 13:32:35 2008 From: sedinin@REDACTED (Andrey Sedinin) Date: Tue, 30 Dec 2008 04:32:35 -0800 (PST) Subject: [erlang-questions] Problem with XML validation using xmerl_xsd:validate(). In-Reply-To: References: <42EC95E4-C48C-453C-80F5-2A0EC7901B4E@gmail.com> Message-ID: Hi Of course i have tested this case: It does not work too (or it work with the same result :). But in XML it is equivalent: =:= But any way -- thank you for your guessing. Regards. On 29 ???, 15:56, Lian Cheng wrote: > Hi, > > Your schema suggests that the "status" element should have a text value > among "Valid", "Invalid" and "", while in your XML snippet, the "status" > element has no text value, rather than have a text value of an empty > string. I think that the difference between and > just like, in the C language, the difference between: > > char* p = NULL; > > and > > char* p = ""; > > In a word, is not equivalent to in your > situation, although I'm not quite sure about my opinion :-) > > Cheers > Cheng From rtrlists@REDACTED Tue Dec 30 14:15:59 2008 From: rtrlists@REDACTED (Robert Raschke) Date: Tue, 30 Dec 2008 13:15:59 +0000 Subject: [erlang-questions] Problem with XML validation using xmerl_xsd:validate(). In-Reply-To: References: <42EC95E4-C48C-453C-80F5-2A0EC7901B4E@gmail.com> Message-ID: <6a3ae47e0812300515u62b671e0pa08d063fc74bfcaa@mail.gmail.com> 2008/12/30 Andrey Sedinin : > Hi > > Of course i have tested this case: > > > > It does not work too (or it work with the same result :). > > But in XML it is equivalent: > > =:= > > But any way -- thank you for your guessing. I don't know very much about XML and schemas, but is it actually possible to distinguish an empty text content from a non-existant one (that would be kind of like "" == NULL)? I mean the text, not the presence of the node itself. If empty == non-existant then I don't think you can easily represent that in a schema. But, as I say, I am not an expert. Do schemas not allow you to state that text content of a node is optional? Robby From erlang-questions_efine@REDACTED Tue Dec 30 14:47:02 2008 From: erlang-questions_efine@REDACTED (Edwin Fine) Date: Tue, 30 Dec 2008 08:47:02 -0500 Subject: [erlang-questions] SNMP n00b problem In-Reply-To: <269388e30812291608p2261fef9kf64b22153c6efd7b@mail.gmail.com> References: <269388e30812291608p2261fef9kf64b22153c6efd7b@mail.gmail.com> Message-ID: <6c2563b20812300547v52b58964u2995c91f39907d0e@mail.gmail.com> Hi Ben, The only information I have found that helped me in a practical way with Erlang SNMP is here: http://www.trapexit.org/SNMP_Quick_Start Have you checked that out? I actually managed to get a prototype working, but then had to move on to other things. Regards, Ed On Mon, Dec 29, 2008 at 7:08 PM, Ben Hood <0x6e6562@REDACTED> wrote: > Hi, > > I'm just following the basic instructions to implement a SNMP agent > (as outlined here: > http://www.erlang.org/doc/apps/snmp/part_frame.html) > > I've generated all of the the config files, but when I boot the SNMP > app, I get the following issue: > > * Configuration error: [USER-BASED-SM-MIB]: reconfigure failed: > {failed_check, > > "/Users/0x6e6562/workspace/snmp-test/usm.conf", > 1,10, > > {invalid_user, > > {"0x6e6562's engine", > > "foobar", > > "initial", > > usmNoAuthProtocol, > [], > > usmNoAuthProtocol, > []}}} > > Looks like a simple config issue, but there are not too many clues as > what the missing item or reference could be. > > I had a brief look in the snmp_user_based_sm_mib module to get to the > root cause of this, but the issue was not immediately apparent. > > Before I debug this, I wanted to know if I am doing something > obviously wrong, and/or if there is any easy way to bypass USM if I > just want to boot a plain jane agent with any auth/privs. > > FTR this is using R12B-5 on OS X 10.5.6 > > Thx, > > Ben > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From 0x6e6562@REDACTED Tue Dec 30 15:14:34 2008 From: 0x6e6562@REDACTED (Ben Hood) Date: Tue, 30 Dec 2008 14:14:34 +0000 Subject: [erlang-questions] SNMP n00b problem In-Reply-To: <6c2563b20812300547v52b58964u2995c91f39907d0e@mail.gmail.com> References: <269388e30812291608p2261fef9kf64b22153c6efd7b@mail.gmail.com> <6c2563b20812300547v52b58964u2995c91f39907d0e@mail.gmail.com> Message-ID: <269388e30812300614g76aeedf9v445e8f91f000985c@mail.gmail.com> Ed, On Tue, Dec 30, 2008 at 1:47 PM, Edwin Fine wrote: > The only information I have found that helped me in a practical way with > Erlang SNMP is here: http://www.trapexit.org/SNMP_Quick_Start > Have you checked that out? I actually managed to get a prototype working, > but then had to move on to other things. No I haven't, I check it out. Thanks for the tip :-) Ben From stondage123@REDACTED Tue Dec 30 17:47:23 2008 From: stondage123@REDACTED (AndrewJStone) Date: Tue, 30 Dec 2008 08:47:23 -0800 (PST) Subject: [erlang-questions] tcp keepalive option In-Reply-To: <351260.98674.qm@web35903.mail.mud.yahoo.com> References: <351260.98674.qm@web35903.mail.mud.yahoo.com> Message-ID: <0ca08dc0-8a60-488e-a347-15eee2b6a7fe@u14g2000yqg.googlegroups.com> So, Once again I have to answer my own question... In case anyone is curious the answer is that when a TCP keepalive timeout occurs you get a tcp_error message with Reason "etimedout" -Andrew On Dec 25, 3:18?am, Andrew Stone wrote: > Hi, > > I'm currently trying to test code that sets the sockopt {keepalive, true} along with {active, true} in gen_tcp:listen, which is inherited by the connected socket. However, after much searching I am unable to figure out what happens when the actual connection times out. > > If a TCP keepalive timeout occurs, does the erlang process receive a {tcp_error, Sock, Reason} message or does it receive a {tcp_closed, Sock} message. > > Thanks, > Andrew > > _______________________________________________ > erlang-questions mailing list > erlang-questi...@REDACTED://www.erlang.org/mailman/listinfo/erlang-questions From christophe.romain@REDACTED Tue Dec 30 23:00:35 2008 From: christophe.romain@REDACTED (Christophe Romain) Date: Tue, 30 Dec 2008 23:00:35 +0100 Subject: [erlang-questions] cheap low-power boards In-Reply-To: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> References: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> Message-ID: <20081230220035.GD3482@localhost> Running ejabberd server on Zaurus SL6000 PXA255 400MHz 64Mb ~2W stressed up to 400 concurent users. From 0x6e6562@REDACTED Wed Dec 31 00:40:39 2008 From: 0x6e6562@REDACTED (Ben Hood) Date: Tue, 30 Dec 2008 23:40:39 +0000 Subject: [erlang-questions] SNMP n00b problem In-Reply-To: <6c2563b20812300547v52b58964u2995c91f39907d0e@mail.gmail.com> References: <269388e30812291608p2261fef9kf64b22153c6efd7b@mail.gmail.com> <6c2563b20812300547v52b58964u2995c91f39907d0e@mail.gmail.com> Message-ID: <269388e30812301540u20023fddgd48cf0492142ed6e@mail.gmail.com> Ed, On Tue, Dec 30, 2008 at 1:47 PM, Edwin Fine wrote: > The only information I have found that helped me in a practical way with > Erlang SNMP is here: http://www.trapexit.org/SNMP_Quick_Start > Have you checked that out? I actually managed to get a prototype working, > but then had to move on to other things. Thanks for the tip, I can recommend it as a first port of call. Thanks also to Vance, Serge and of course to Baron von Trapp :-) Ben From yubao.liu@REDACTED Wed Dec 31 04:01:22 2008 From: yubao.liu@REDACTED (Liu Yubao) Date: Wed, 31 Dec 2008 11:01:22 +0800 Subject: [erlang-questions] openssl s_client hangs when accessing https service in inets application Message-ID: <495AE082.1050502@gmail.com> Hi, The https services in inets application doesn't work, I guess I got something wrong. Below is the steps to recur: a. use gen-cert.sh to generate server.pem; (All scripts and configuration are provided at http://jff.googlecode.com/files/inets-https-test.tar ) b. execute runerl.sh and input these clauses in the erlang shell: application:start(ssl). application:start(inets). c. execute `openssl s_client -connect localhost:8443 -debug -msg`, you can see openssl hangs after sending a CLIENT-HELLO message, the TCP connection is established successfully but https server doesn't response to the CLIENT-HELLO message. I tested "ssl:listen" in erlang shell and succeed to communication between openssl and erlang shell: application:start(ssl). {ok, S} = ssl:listen(8443, [{certfile, "server.pem"}, {active, false}]). {ok, S2} = ssl:accept(S). # execute in another bash: openssl s_client -connect localhost:8443 ssl:send(S2, <<"hello world\n">>). # "openssl s_client" can receive this greeting. I tested against the latest erlang 5.6.5 under Windows XP and 5.6.3 under Debian Lenny. I'm looking forward your help! Best regards, Liu Yubao From mickael.remond@REDACTED Wed Dec 31 11:07:35 2008 From: mickael.remond@REDACTED (=?UTF-8?Q?Micka=C3=ABl_R=C3=A9mond?=) Date: Wed, 31 Dec 2008 11:07:35 +0100 Subject: [erlang-questions] Planet Erlang relaunch Message-ID: <492777F6-684F-46D9-8CFF-DAD46FC10EF2@process-one.net> Hello, We have put online a new version of the news / blog post aggregator for Erlang: http://www.planeterlang.org/ It should be more readable and more useful. We now index the content and also provide an integrated search engine, so that it will become overtime a major tool to find Erlang resources. Please, drop me a mail with the URL to access the Erlang related feed from your blog and I will add you to the site. Comments and suggestion improvements are welcome :) Happy new year ! -- Micka?l R?mond http://www.process-one.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jlprasantha@REDACTED Wed Dec 31 14:23:18 2008 From: jlprasantha@REDACTED (prasantha kumara) Date: Wed, 31 Dec 2008 18:53:18 +0530 Subject: [erlang-questions] send c structure from c node to erlang using IDL and IC Message-ID: Hi all!. I am currently working on erlang with IC.I am trying to send a c structure to the erlang node using IC. i have im[plemented a c server. i have written the following erlang code to access to the c server -module(client). -author('prasantha@REDACTED'). -export([produce/0,init/3]). -define(SERVER,{rmod_random_impl,'prasantha'}). -define(CLIENTMOD,'rmod_random'). produce() -> io:format("this outputs from produce : ~w ~w~n", [hello, world]). ?CLIENTMOD:produce(?SERVER). init(Seed1, Seed2, Seed3) -> ?CLIENTMOD:init([{erlang,list_to_existing_atom,["babbis@REDACTED "]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]). first i ran the client:init(1,2,3). it s properly working but when i tryid to run the client:produce(). in erlang shell it gives the following error. =ERROR REPORT==== 31-Dec-2008::18:41:09 === Error in process <0.49.0> on node 'client@REDACTED' with exit value: {badarg,[{erlang,list_to_existing_atom,["babbis@REDACTED "]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]} ** exception exit: {{nodedown,babbis@REDACTED}, {gen_server,call, [{rmod_random_impl,babbis@REDACTED}, rmod_random_produce,infinity]}} in function gen_server:call/3 i tryied to start a erl node using as follow erl -sname client -setcookie flash but it cannot be done .becouse my server node is run as babbis therefore that node is active can any body tell me why this error occured? thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony@REDACTED Wed Dec 31 16:59:15 2008 From: tony@REDACTED (Tony Rogvall) Date: Wed, 31 Dec 2008 16:59:15 +0100 Subject: [erlang-questions] tcp keepalive option In-Reply-To: <0ca08dc0-8a60-488e-a347-15eee2b6a7fe@u14g2000yqg.googlegroups.com> References: <351260.98674.qm@web35903.mail.mud.yahoo.com> <0ca08dc0-8a60-488e-a347-15eee2b6a7fe@u14g2000yqg.googlegroups.com> Message-ID: <1491E2C4-5A50-456A-ABE8-3CA7031643E9@rogvall.se> And now you can regard your self as the TCP keepalive expert and help out answer questions about this topic. /Tony On 30 dec 2008, at 17.47, AndrewJStone wrote: > So, > Once again I have to answer my own question... > > In case anyone is curious the answer is that when a TCP keepalive > timeout occurs you get a tcp_error message with Reason "etimedout" > > -Andrew > > On Dec 25, 3:18 am, Andrew Stone wrote: >> Hi, >> >> I'm currently trying to test code that sets the sockopt {keepalive, >> true} along with {active, true} in gen_tcp:listen, which is >> inherited by the connected socket. However, after much searching I >> am unable to figure out what happens when the actual connection >> times out. >> >> If a TCP keepalive timeout occurs, does the erlang process receive >> a {tcp_error, Sock, Reason} message or does it receive a >> {tcp_closed, Sock} message. >> >> Thanks, >> Andrew >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questi...@REDACTED://www.erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From b88zhou@REDACTED Wed Dec 31 21:11:53 2008 From: b88zhou@REDACTED (Brian Zhou) Date: Wed, 31 Dec 2008 12:11:53 -0800 Subject: [erlang-questions] cheap low-power boards In-Reply-To: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> References: <33CFEAE2-CDB6-41BA-9AB6-ED48E38EDFA6@gmail.com> Message-ID: <859e91e70812311211r3b859de6q36b4d3370ea56627@mail.gmail.com> I've been maintaining Erlang cross compilation recipe for several years. http://ipkg.nslu2-linux.org/feeds/optware/ Most ipkg feeds above contain R12B5 ipk's. A partial list of supported devices can be found at http://www.nslu2-linux.org/wiki/Optware/Platforms Cheers, -Brian On Sun, Dec 28, 2008 at 1:56 AM, Joel Reymont wrote: > Is anyone running Erlang on a cheap low-power board? > > ARM, Atom, PowerPC is what I'm interested in. > > Can you please share your experience, privately if you want? > > I'm looking for 2-5W or less of power consumption. > > Thanks in advance, Joel > > -- > http://wagerlabs.com > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From vincent.dephily@REDACTED Tue Dec 30 23:42:12 2008 From: vincent.dephily@REDACTED (Vincent de Phily) Date: Tue, 30 Dec 2008 23:42:12 +0100 Subject: [erlang-questions] Problematic error: code server called the unloaded module `init' Message-ID: <200812302342.13039.vincent.dephily@mobile-devices.fr> Hi list, here's an error I can't quite figure out and started getting on some of my servers, as far as I can tell without code change or environement modifications : > $ erlexec -name foo@REDACTED -config foo.config +W w > > Crash dump was written to: erl_crash.dump > The code server called the unloaded module `init' When I look at the crash dump, I do have 'init' in my modules list, along with lots of standard modules (but none of my own modules) : > =loaded_modules > Current code: 1064029 > Old code: 0 > =mod:otp_ring0 > Current size: 620 > =mod:init > Current size: 31160 > =mod:prim_inet > Current size: 50792 > ... and an 'init' process : > =proc:<0.0.0> > State: Waiting > Name: init > Spawned as: otp_ring0:start/2 > Spawned by: [] > Started: Tue Dec 30 23:25:05 2008 > Message queue length: 0 > Number of heap fragments: 0 > Heap fragment data: 0 > Link list: [<0.1.0>, <0.5.0>, <0.4.0>, <0.2.0>] > Reductions: 4938 > Stack+heap: 377 > OldHeap: 0 > Heap unused: 229 > OldHeap unused: 0 > Program counter: 0xb4b7a250 (init:boot_loop/2 + 32) > CP: 0x081f4340 () > arity = 0 (I can provide more of the dump if desired) I don't know where to begin with this one; google only picked up a seemingly-irrelevant thread on this mailinglist. This is a recent erlang version. Any ideas ? -- Vincent de Phily