From srp@REDACTED Tue Jan 1 09:32:51 2008 From: srp@REDACTED (Scott Parish) Date: Tue, 1 Jan 2008 00:32:51 -0800 Subject: [erlang-questions] proc_lib, throw, and nocatch Message-ID: <2C2EA064-584A-4947-BFE8-F9F2585BEC1F@srparish.net> erlang(3) documents that 'throw(Any)' has a "Failure" condition of 'nocatch' if the throw wasn't caught. sasl's user guide 2.3 suggests that any process exit other then 'normal' and 'shutdown' will have a report generated proc_lib places a "catch" (as opposed to "try/catch") on the stack and then only creates an error report if the returned value matches '{'EXIT', Reason}'. This means if i have a process (that i've spawned with proc_lib so that i get an error report) that does a 'throw()' that isn't caught, it's treated by proc_lib as a 'normal' exit. Nothing gets logged. Links get notified that the process exited 'normal'. Maybe i'm misunderstanding, but this is not the behavior i expected, nor what i understood from having read the documentation. Would it be better if proc_lib were using the try/catch form so that it can distinguish between returned and thrown values and fail 'nocatch' on the thrown ones? Thanks sRp From toby@REDACTED Tue Jan 1 10:14:01 2008 From: toby@REDACTED (Toby Thain) Date: Tue, 1 Jan 2008 07:14:01 -0200 Subject: [erlang-questions] HiPE for Windows? In-Reply-To: <47742B05.40600@pmp.com.au> References: <322365.63299.qm@web25812.mail.ukl.yahoo.com> <18291.39705.604465.105148@harpo.it.uu.se> <47742B05.40600@pmp.com.au> Message-ID: <7A7A4C23-E3C5-4F03-BD0F-57565D41B2D2@smartgames.ca> On 27-Dec-07, at 8:45 PM, Benjamin Tolputt wrote: > Mikael Pettersson wrote: >> There are no plans for a Win32 version of HiPE, due to a >> combination of technical issues and lack of interest. >> HiPE works fine on Linux, Solaris, and at least some of the *BSDs. > Do you know what these problems are and/or where people (such as > myself) > can look at them? I've played with (the code of) JIT compilers on > Windows and haven't come across show-stoppers before. > > I had been under the impression that HiPE was working on Windows :( Why so attached to Windows? --T > > --BJT > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From sgolovan@REDACTED Tue Jan 1 11:57:27 2008 From: sgolovan@REDACTED (Sergei Golovan) Date: Tue, 1 Jan 2008 13:57:27 +0300 Subject: [erlang-questions] Checking for FPE on glibc 2.7 Message-ID: Hi! When building Erlang/OTP R12-B using glibc 2.7 (Debian GNU/Linux on x86 architecture) I've noticed that checking floating point exceptions fails, making HiPE build unavailable. Looking closer at the checking rotines shows the following compile-time error messages: % gcc fpe-test-12.c In file included from /usr/include/asm/sigcontext.h:7, from fpe-test-12.c:268: /usr/include/asm-i386/sigcontext.h:19: error: redefinition of 'struct _fpreg' /usr/include/asm-i386/sigcontext.h:24: error: redefinition of 'struct _fpxreg' /usr/include/asm-i386/sigcontext.h:30: error: redefinition of 'struct _xmmreg' /usr/include/asm-i386/sigcontext.h:34: error: redefinition of 'struct _fpstate' /usr/include/asm-i386/sigcontext.h:58: error: redefinition of 'struct sigcontext' Appears that in glibc 2.7 file /usr/include/bits/sigcontext.h already contains the definitions of these structures. But simple commenting out "#include " in line 268 doesn't help because it leaves X86_FXSR_MAGIC undefined. After replacing it by 0x0000 (its definition from sigcontext.h) all works fine. Moreover, the changed test works in older glibc as well. Could someone look into this problem and help me to resolve this issue properly? Or my changes are acceptable? Cheers! -- Sergei Golovan From bjt@REDACTED Tue Jan 1 10:22:03 2008 From: bjt@REDACTED (Benjamin Tolputt) Date: Tue, 01 Jan 2008 20:22:03 +1100 Subject: [erlang-questions] HiPE for Windows? In-Reply-To: <7A7A4C23-E3C5-4F03-BD0F-57565D41B2D2@smartgames.ca> References: <322365.63299.qm@web25812.mail.ukl.yahoo.com> <18291.39705.604465.105148@harpo.it.uu.se> <47742B05.40600@pmp.com.au> <7A7A4C23-E3C5-4F03-BD0F-57565D41B2D2@smartgames.ca> Message-ID: <477A063B.5040307@pmp.com.au> Toby Thain wrote: > Why so attached to Windows? I work (on & off) with a small indie game development crew. Like it or not, Windows is THE platform for non-console game deployment. There is a small market for Mac OSX & Linux, but it is not enough to support a game development team. I've always been impressed with Wings 3D, and with the move toward highly concurrent architectures that are starting up in games at the moment. I think Erlang is a good fit (witness the ability of Stackless Python in EVE Online for example). --BJT From yoel@REDACTED Tue Jan 1 13:08:49 2008 From: yoel@REDACTED (Yoel Jacobsen) Date: Tue, 01 Jan 2008 14:08:49 +0200 Subject: [erlang-questions] The reason for "no case clause matching" error? Message-ID: <477A2D51.2000709@emet.co.il> Hello, I want to implement some sort of list partitioning in Erlang. The ppar function should work like that: ppar [2,2,3] -> [[[2],[2],[3]], [[2],[2,3]], [[2,2],[3]],[ [2,2,3]]] ppar [2,2,3,4] -> [[[2],[2],[3],[4]], [[2],[2],[3,4]], [[2],[2,3],[4]], [[2],[2,3,4]], [[2,2],[3],[4]], [[2,2],[3,4]], [[2,2,3],[4]], [[2,2,3,4]]] This is the code I have written: -module(ppar). -export([ppar/1]). sp(Lhs, []) -> [[Lhs]]; sp(Lhs, Rhs) -> [lists:append([Lhs], P) || P <- ppar(Rhs)]. ppar([]) -> [[[]]]; ppar([H|[]]) -> [[[H]]]; ppar(Lst) -> [SP || N <- lists:seq(1,length(Lst)), Lhs = lists:sublist(Lst, 1, N), Rhs = lists:sublist(Lst, N+1, length(Lst)), SP <- sp(Lhs, Rhs)]. Yet, when I try it I get an error: 1> ppar:ppar([1,2,3]). ** exception error: no case clause matching [1] in function ppar:'-ppar/1-lc$^0/1-0-'/2 Why is that? Yoel -------------- next part -------------- A non-text attachment was scrubbed... Name: yoel.vcf Type: text/x-vcard Size: 315 bytes Desc: not available URL: From erlang@REDACTED Tue Jan 1 16:03:40 2008 From: erlang@REDACTED (Bruce O'Neel) Date: Tue, 01 Jan 2008 16:03:40 +0100 Subject: [erlang-questions] R12.0B and Sparcs Message-ID: <1199199820-c3f0b83a32ea2a8bfab0e51657fd8e6c@pckswarms.ch> Happy New Year, Here at the home for ancient, disused, and discarded computers we noticed that while R11B-5 built and ran just fine on Sparcs, R12B-0 did not at least on OpenBSD and NetBSD. No, not Ultras, the sparcs that Sun hasn't actually shipped for 10+ years, the old V7 and V8 systems (ie SPARCstation 10s, 20s, 4s, and 5s etc). It turns out that a small change to erts/include/internal/ethread.h allows them to work again. 82a83,85 > /* BEO for SPARC OpenBSD only. Not SPARC64! */ > # define ETHR_DISABLE_NATIVE_IMP > Basically the above define throws away the optimized assembly code in erts/include/internal/sparc32 which is V9 (ie Ultra) specific. Thanks very much for both erlang and the OpenBSD port of it. cheers bruce From fredrik.svahn@REDACTED Tue Jan 1 17:28:38 2008 From: fredrik.svahn@REDACTED (Fredrik Svahn) Date: Tue, 1 Jan 2008 17:28:38 +0100 Subject: [erlang-questions] The reason for "no case clause matching" error? In-Reply-To: <477A2D51.2000709@emet.co.il> References: <477A2D51.2000709@emet.co.il> Message-ID: Hi, I cannot say I fully understand the error message. However the reference manual says: "List comprehensions are written with the following syntax: [Expr || Qualifier1,...,QualifierN] Expr is an arbitrary expression, and each Qualifier is either a generator or a filter. - A *generator* is written as: Pattern <- ListExpr. ListExpr must be an expression which evaluates to a list of terms. - A *filter* is an expression which evaluates to true or false." Some of the Qualifiers you use in your list comprehension (e.g. Lhs = lists:sublist(Lst, 1, N)) are neither generators nor filters since they do not contain "<-" and evaluates to lists rather than true or false. I suggest rewriting the last function clause to: ppar(Lst) -> [SP || N <- lists:seq(1,length(Lst)), SP <- sp(lists:sublist(Lst, 1, N), lists:sublist(Lst, N+1, length(Lst)))]. or (to maintain the variables for clarity) ppar(Lst) -> [SP || N <- lists:seq(1,length(Lst)), SP <- begin Lhs = lists:sublist(Lst, 1, N), Rhs = lists:sublist(Lst, N+1, length(Lst)), sp(Lhs, Rhs) end]. Gives: 2> test4:ppar([2,2,3]). [[[2],[2],[3]],[[2],[2,3]],[[2,2],[3]],[[2,2,3]]] Hope this helps. BR /Fredrik On Jan 1, 2008 1:08 PM, Yoel Jacobsen wrote: > Hello, > > > I want to implement some sort of list partitioning in Erlang. > > > The ppar function should work like that: > > ppar [2,2,3] -> [[[2],[2],[3]], [[2],[2,3]], [[2,2],[3]],[ [2,2,3]]] > ppar [2,2,3,4] -> [[[2],[2],[3],[4]], [[2],[2],[3,4]], [[2],[2,3],[4]], > [[2],[2,3,4]], [[2,2],[3],[4]], [[2,2],[3,4]], [[2,2,3],[4]], [[2,2,3,4]]] > > > This is the code I have written: > > -module(ppar). > -export([ppar/1]). > > > sp(Lhs, []) -> > [[Lhs]]; > sp(Lhs, Rhs) -> > [lists:append([Lhs], P) || P <- ppar(Rhs)]. > > ppar([]) -> > [[[]]]; > ppar([H|[]]) -> > [[[H]]]; > ppar(Lst) -> > [SP || > N <- lists:seq(1,length(Lst)), > Lhs = lists:sublist(Lst, 1, N), > Rhs = lists:sublist(Lst, N+1, length(Lst)), > SP <- sp(Lhs, Rhs)]. > > Yet, when I try it I get an error: > > 1> ppar:ppar([1,2,3]). > ** exception error: no case clause matching [1] > in function ppar:'-ppar/1-lc$^0/1-0-'/2 > > Why is that? > > Yoel > > > > _______________________________________________ > 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 Tue Jan 1 20:53:52 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 1 Jan 2008 20:53:52 +0100 Subject: [erlang-questions] Checking for FPE on glibc 2.7 In-Reply-To: References: Message-ID: <18298.39504.667822.964203@harpo.it.uu.se> Sergei Golovan writes: > Hi! > > When building Erlang/OTP R12-B using glibc 2.7 (Debian GNU/Linux on > x86 architecture) I've noticed that checking floating point exceptions > fails, making HiPE build unavailable. > > Looking closer at the checking rotines shows the following > compile-time error messages: > > % gcc fpe-test-12.c > In file included from /usr/include/asm/sigcontext.h:7, > from fpe-test-12.c:268: > /usr/include/asm-i386/sigcontext.h:19: error: redefinition of 'struct _fpreg' > /usr/include/asm-i386/sigcontext.h:24: error: redefinition of 'struct _fpxreg' > /usr/include/asm-i386/sigcontext.h:30: error: redefinition of 'struct _xmmreg' > /usr/include/asm-i386/sigcontext.h:34: error: redefinition of 'struct _fpstate' > /usr/include/asm-i386/sigcontext.h:58: error: redefinition of 'struct > sigcontext' > > Appears that in glibc 2.7 file /usr/include/bits/sigcontext.h already > contains the definitions of these structures. > > But simple commenting out "#include " in line 268 > doesn't help because it leaves X86_FXSR_MAGIC undefined. After > replacing it by 0x0000 (its definition from sigcontext.h) all works > fine. Moreover, the changed test works in older glibc as well. > > Could someone look into this problem and help me to resolve this issue > properly? Or my changes are acceptable? Something like the patch below perhaps? I've tested it on Linux i386 with glibc-2.3.6 (FC4), glibc-2.4 (FC5), and glibc-2.5 (FC6). In all cases R12B-0 built and worked Ok, and enabled FP exceptions and HiPE. I don't have immediate access to glibc-2.6 or glibc-2.7 systems, but if I get confirmation that R12B-0 plus this patch builds and works on those, and that FP exceptions and HiPE remain enabled, then I'd be inclined to add the patch to R12B-1. To avoid breaking older systems, the #include can be conditional on glibc < 2.4 or so. Is the glibc-2.7 problem Debian specific? I seem to recall seeing reports that R12B-0 works Ok on the glibc-2.7 based F8. /Mikael --- otp_src_R12B-0/erts/configure.in.~1~ 2007-11-28 17:50:44.000000000 +0100 +++ otp_src_R12B-0/erts/configure.in 2008-01-01 20:00:07.000000000 +0100 @@ -2026,7 +2026,10 @@ static __inline__ int check_fpe(double f #if (defined(__linux__) && (defined(__i386__) || defined(__x86_64__) || defined(__sparc__) || defined(__powerpc__))) || (defined(__DARWIN__) && (defined(__i386__) || defined(__x86_64__) || defined(__ppc__))) || (defined(__FreeBSD__) && (defined(__i386__) || defined(__x86_64__))) || (defined(__OpenBSD__) && defined(__x86_64__)) || (defined(__sun__) && defined(__x86_64__)) #if defined(__linux__) && defined(__i386__) -#include +//#include +#if !defined(X86_FXSR_MAGIC) +#define X86_FXSR_MAGIC 0x0000 +#endif #elif defined(__FreeBSD__) && defined(__i386__) #include #include --- otp_src_R12B-0/erts/configure.~1~ 2007-12-04 15:30:08.000000000 +0100 +++ otp_src_R12B-0/erts/configure 2008-01-01 20:00:26.000000000 +0100 @@ -18561,7 +18561,10 @@ static __inline__ int check_fpe(double f #if (defined(__linux__) && (defined(__i386__) || defined(__x86_64__) || defined(__sparc__) || defined(__powerpc__))) || (defined(__DARWIN__) && (defined(__i386__) || defined(__x86_64__) || defined(__ppc__))) || (defined(__FreeBSD__) && (defined(__i386__) || defined(__x86_64__))) || (defined(__OpenBSD__) && defined(__x86_64__)) || (defined(__sun__) && defined(__x86_64__)) #if defined(__linux__) && defined(__i386__) -#include +//#include +#if !defined(X86_FXSR_MAGIC) +#define X86_FXSR_MAGIC 0x0000 +#endif #elif defined(__FreeBSD__) && defined(__i386__) #include #include --- otp_src_R12B-0/erts/emulator/sys/unix/sys_float.c.~1~ 2007-11-26 19:58:57.000000000 +0100 +++ otp_src_R12B-0/erts/emulator/sys/unix/sys_float.c 2008-01-01 20:00:57.000000000 +0100 @@ -463,7 +463,10 @@ static void skip_sse2_insn(erts_mcontext #if (defined(__linux__) && (defined(__i386__) || defined(__x86_64__) || defined(__sparc__) || defined(__powerpc__))) || (defined(__DARWIN__) && (defined(__i386__) || defined(__x86_64__) || defined(__ppc__))) || (defined(__FreeBSD__) && (defined(__x86_64__) || defined(__i386__))) || (defined(__OpenBSD__) && defined(__x86_64__)) || (defined(__sun__) && defined(__x86_64__)) #if defined(__linux__) && defined(__i386__) -#include +//#include +#if !defined(X86_FXSR_MAGIC) +#define X86_FXSR_MAGIC 0x0000 +#endif #elif defined(__FreeBSD__) && defined(__x86_64__) #include #include From sgolovan@REDACTED Tue Jan 1 21:32:36 2008 From: sgolovan@REDACTED (Sergei Golovan) Date: Tue, 1 Jan 2008 23:32:36 +0300 Subject: [erlang-questions] Checking for FPE on glibc 2.7 In-Reply-To: <18298.39504.667822.964203@harpo.it.uu.se> References: <18298.39504.667822.964203@harpo.it.uu.se> Message-ID: On 1/1/08, Mikael Pettersson wrote: > > Something like the patch below perhaps? The patch looks better than which I currently use in Debian unstable (where I'm sure that X86_FXSR_MAGIC is undefined, so I don't check if it's defined). Thanks! > > I've tested it on Linux i386 with glibc-2.3.6 (FC4), glibc-2.4 (FC5), and > glibc-2.5 (FC6). In all cases R12B-0 built and worked Ok, and enabled FP > exceptions and HiPE. I'll try it on Debian sid with glibc 2.7 > > I don't have immediate access to glibc-2.6 or glibc-2.7 systems, but if I > get confirmation that R12B-0 plus this patch builds and works on those, > and that FP exceptions and HiPE remain enabled, then I'd be inclined to > add the patch to R12B-1. To avoid breaking older systems, the > #include can be conditional on glibc < 2.4 or so. asm/sigcontext.h is included via bits/sigcontext.h which is included via signal.h (in Debian etch with glibc 2.3), so it's not necessary to include asm/sigcontext.h for testing FPE. But it's unclear for me if it should be included in sys_float.c (I can't find direct include of signal.h). > > Is the glibc-2.7 problem Debian specific? I seem to recall seeing reports > that R12B-0 works Ok on the glibc-2.7 based F8. It works OK in Debian too. But without HiPE. -- Sergei Golovan From torben.lehoff@REDACTED Tue Jan 1 22:11:02 2008 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Tue, 1 Jan 2008 22:11:02 +0100 Subject: [erlang-questions] graphs and trees In-Reply-To: <1198140688.28499.129.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> References: <1198140688.28499.129.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> Message-ID: On Dec 20, 2007 9:51 AM, mats cronqvist wrote: > so i've made a directad acyclic graph by calling various functions in > the digraph module. i theory, the resulting graph should be a tree. is > there some snazzy graph theory trick to show that the graph is indeed a > tree? > disclaimer; i am by training a physicist, and as such uncomfortable > with all data structures more complicated than the fixed-size array. so > no big words please :> > > mats > Sorry for the late addition to the discussion (vacation clean-up of mailbox), but the Wikipedia article about Trees defines exactly the conditions for when a graph is indeed a tree: http://en.wikipedia.org/wiki/Tree_(graph_theory) Which approach that is the fastest depends on how the digraph module represents grahps - I have not had the courage to peek inside... Cheers, Torben -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Wed Jan 2 12:48:40 2008 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 2 Jan 2008 11:48:40 +0000 Subject: [erlang-questions] Mnesia, versioning and recovering from network splits Message-ID: Folks, I think there's a reasonably straightforward way for Mnesia to recover from network splits. I also think that it would be much faster to merge databases in this scenario than drop a database and reload it form backups. I believe merging databases would require versioning of Mnesia records (simple integer should do) and the addition of a merging mechanism. Record versions would be shipped around and the latest version of the record would then be pulled by the server that has fallen behind. What are the flaws in my thinking? Thanks, Joel -- http://wagerlabs.com From vlm@REDACTED Wed Jan 2 13:14:40 2008 From: vlm@REDACTED (Lev Walkin) Date: Wed, 02 Jan 2008 04:14:40 -0800 Subject: [erlang-questions] Mnesia, versioning and recovering from network splits In-Reply-To: References: Message-ID: <477B8030.4020508@lionet.info> Joel Reymont wrote: > Folks, > > I think there's a reasonably straightforward way for Mnesia to recover > from network splits. I also think that it would be much faster to > merge databases in this scenario than drop a database and reload it > form backups. > > I believe merging databases would require versioning of Mnesia records > (simple integer should do) and the addition of a merging mechanism. > Record versions would be shipped around and the latest version of the > record would then be pulled by the server that has fallen behind. > > What are the flaws in my thinking? Integer (a so-called Lamport clock) won't do, it'd need to have vector clocks, with an integer associated with every participating node in the mnesia distribution network, for each record (see Wikipedia). However, even using vector clocks there is no way to guarantee total consistency. -- Lev Walkin vlm@REDACTED From mikpe@REDACTED Wed Jan 2 14:26:26 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 2 Jan 2008 14:26:26 +0100 Subject: [erlang-questions] R12.0B and Sparcs In-Reply-To: <1199199820-c3f0b83a32ea2a8bfab0e51657fd8e6c@pckswarms.ch> References: <1199199820-c3f0b83a32ea2a8bfab0e51657fd8e6c@pckswarms.ch> Message-ID: <18299.37122.259893.758087@harpo.it.uu.se> Bruce O'Neel writes: > Happy New Year, > > Here at the home for ancient, disused, and discarded computers we noticed that > while R11B-5 built and ran just fine on Sparcs, R12B-0 did not at least on > OpenBSD and NetBSD. What exactly is the failure? Compile-time warning from the assembler on the V9 instructions? Runtime SIGILL? > No, not Ultras, the sparcs that Sun hasn't actually shipped for 10+ years, the old > V7 and V8 systems (ie SPARCstation 10s, 20s, 4s, and 5s etc). > > It turns out that a small change to > > erts/include/internal/ethread.h > > allows them to work again. > > 82a83,85 > > /* BEO for SPARC OpenBSD only. Not SPARC64! */ > > # define ETHR_DISABLE_NATIVE_IMP > > > > Basically the above define throws away the optimized assembly code in > erts/include/internal/sparc32 which is V9 (ie Ultra) specific. The SPARC v9 (actually v8+) code referenced by ethread.h is essentially the same in R11B-5 and R12B-0. I suspect some configuration change is causing your problems. - Did you build R11B-5 with SMP support on SPARC v7/v8? If so, was it autoenabled or did you enable it explicitly. - Does R12B-0 autoenable SMP on BSD/SPARC or do you enable it explicitly? GCC's __sparcv9 macro is unfortunately useless here (it seems to be set if and only if 64-bit code is generated), so to disable the v8+/v9 code automatically we'd have to add a check in erts/configure.in and use that to #define a macro which we then check in ethread.h. /Mikael From ingela@REDACTED Wed Jan 2 14:31:03 2008 From: ingela@REDACTED (Ingela Anderton Andin) Date: Wed, 02 Jan 2008 14:31:03 +0100 Subject: [erlang-questions] ODBC support doesn't work correctly in, Erlang R12B :( In-Reply-To: References: Message-ID: <477B9217.7020901@erix.ericsson.se> > >> Hello. >> >> When I was trying to test my ODBC connection with Erlang R12B I saw >> these strange error message: >> >> ============================================ >> Erlang (BEAM) emulator version 5.6 [source] [async-threads:0] [hipe] >> [kernel-poll:false] >> >> Eshell V5.6 (abort with ^G) >> 1> odbc:connect("DSN=ejabberd;UID=root;PWD=password", >> [{scrollable_cursors, off}]). >> {error,odbc_not_started} >> > > odbc application doesn't start automagically anymore. Read OTP-6984 > item in http://www.erlang.org/download/otp_src_R12B-0.readme. > > It makes me happy that at least some people read the release notes :) Release notes for each application can also be found as part of its documentation for example: http://www.erlang.org/doc/apps/odbc/part_notes_frame.html > To start it use application:start(odbc). > > You may also use the shorthand version: odbc:start() that does exactly that, or odbc:start(Type) that does application:start(odbc, Type). Where Type = permanent | transient | temporary. application:start(App) is equivalent to application:start(App, temporary). For more info see application(3). Regards Ingela -OTP team From bob@REDACTED Thu Jan 3 00:19:36 2008 From: bob@REDACTED (Bob Cowdery) Date: Wed, 02 Jan 2008 23:19:36 +0000 Subject: [erlang-questions] wxErlang Message-ID: <1199315976.5559.38.camel@ubuntu-life-vm> I have a couple of small issues with wxErlang. In general it is working great so far. 1. I can't get any events to fire off a wxToggleButton. As far as I remember this behaves like a check box but neither command_button_clicked nor command_checkbox_clicked fire. Is there some other event I should be looking at. 2. This is a bit obscure and I'm not sure if it's a wxWidgets issue. If I place a checkbox in the first cell of a wxGridSizer the click area appears over the label and not the box, which also has a white band underneath it. Thanks Bob From exta7@REDACTED Thu Jan 3 00:29:25 2008 From: exta7@REDACTED (Zvi) Date: Wed, 2 Jan 2008 15:29:25 -0800 (PST) Subject: [erlang-questions] Exception in xmerl, when pasing XML with non UTF8 character set Message-ID: <14588326.post@talk.nabble.com> 3> { Xml, _Rest } = xmerl_scan:file(ResultIdx). ** exception exit: {bad_character_code, "\n\n\naaa\n\n", 'windows-1252'} in function xmerl_ucs:to_unicode/2 in call from xmerl_scan:scan_document/2 in call from xmerl_scan:file/2 The XML document starts with PI: It works, after changing it to The problem is that this XML document generated by 3rd party SW, so I would like to fix xmerl code, or use some xmerl option. I using R12B on Windows. TIA Zvi -- View this message in context: http://www.nabble.com/Exception-in-xmerl%2C-when-pasing-XML-with-non-UTF8-character-set-tp14588326p14588326.html Sent from the Erlang Questions mailing list archive at Nabble.com. From paul-trapexit@REDACTED Thu Jan 3 01:29:10 2008 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Wed, 2 Jan 2008 16:29:10 -0800 (PST) Subject: [erlang-questions] clarify: mnesia foreign_key Message-ID: hi. the documentation indicates that when foreign_key is used, "Instead of using the record key to determine which fragment to access, the value of the Attr field is used." how does this work with operations that take a key only and not a whole record? -- p Optimism is an essential ingredient of innovation. How else can the individual favor change over security? -- Robert Noyce From sgolovan@REDACTED Thu Jan 3 07:47:49 2008 From: sgolovan@REDACTED (Sergei Golovan) Date: Thu, 3 Jan 2008 09:47:49 +0300 Subject: [erlang-questions] Checking for FPE on glibc 2.7 In-Reply-To: References: <18298.39504.667822.964203@harpo.it.uu.se> Message-ID: On 1/1/08, Sergei Golovan wrote: > On 1/1/08, Mikael Pettersson wrote: > > > > I've tested it on Linux i386 with glibc-2.3.6 (FC4), glibc-2.4 (FC5), and > > glibc-2.5 (FC6). In all cases R12B-0 built and worked Ok, and enabled FP > > exceptions and HiPE. > > I'll try it on Debian sid with glibc 2.7 I've tried the patch on Debian sid (glibc 2.7) and Debian etch (glibc 2.3). It works in both cases. -- Sergei Golovan From exta7@REDACTED Thu Jan 3 13:15:43 2008 From: exta7@REDACTED (Zvi) Date: Thu, 3 Jan 2008 04:15:43 -0800 (PST) Subject: [erlang-questions] The reason for "no case clause matching" error? In-Reply-To: <477A2D51.2000709@emet.co.il> References: <477A2D51.2000709@emet.co.il> Message-ID: <14595941.post@talk.nabble.com> Yoel, just a minor comment: I would use [Lhs|P] or [Lhs]++P instead of lists:append([Lhs], P) :) This is essentially the same as CONS in Lisp. Zvi Yoel Jacobsen-2 wrote: > > Hello, > > > I want to implement some sort of list partitioning in Erlang. > > > The ppar function should work like that: > > ppar [2,2,3] -> [[[2],[2],[3]], [[2],[2,3]], [[2,2],[3]],[ [2,2,3]]] > ppar [2,2,3,4] -> [[[2],[2],[3],[4]], [[2],[2],[3,4]], [[2],[2,3],[4]], > [[2],[2,3,4]], [[2,2],[3],[4]], [[2,2],[3,4]], [[2,2,3],[4]], [[2,2,3,4]]] > > > This is the code I have written: > > -module(ppar). > -export([ppar/1]). > > > sp(Lhs, []) -> > [[Lhs]]; > sp(Lhs, Rhs) -> > [lists:append([Lhs], P) || P <- ppar(Rhs)]. > > ppar([]) -> > [[[]]]; > ppar([H|[]]) -> > [[[H]]]; > ppar(Lst) -> > [SP || > N <- lists:seq(1,length(Lst)), > Lhs = lists:sublist(Lst, 1, N), > Rhs = lists:sublist(Lst, N+1, length(Lst)), > SP <- sp(Lhs, Rhs)]. > > Yet, when I try it I get an error: > > 1> ppar:ppar([1,2,3]). > ** exception error: no case clause matching [1] > in function ppar:'-ppar/1-lc$^0/1-0-'/2 > > Why is that? > > Yoel > > > > begin:vcard > fn:Yoel Jacobsen > n:Jacobsen;Yoel > org:E&M Computing LTD > adr:;;6 Achilazon st.;Ramat-Gan;;52522;ISRAEL > email;internet:yoel@REDACTED > tel;work:+972-3-5766999 > tel;fax:+972-3-7513626 > tel;pager:Skype: yoeljacobsen > tel;cell:+972-54-4770078 > x-mozilla-html:TRUE > url:http://www.emet.co.il > version:2.1 > end:vcard > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- View this message in context: http://www.nabble.com/The-reason-for-%22no-case-clause-matching%22-error--tp14567237p14595941.html Sent from the Erlang Questions mailing list archive at Nabble.com. From andreengels@REDACTED Thu Jan 3 14:32:37 2008 From: andreengels@REDACTED (Andre Engels) Date: Thu, 3 Jan 2008 14:32:37 +0100 Subject: [erlang-questions] The reason for "no case clause matching" error? In-Reply-To: <477A2D51.2000709@emet.co.il> References: <477A2D51.2000709@emet.co.il> Message-ID: <6faf39c90801030532u3482ff40j49fcddcadf157fb8@mail.gmail.com> 2008/1/1, Yoel Jacobsen : > Hello, > > > I want to implement some sort of list partitioning in Erlang. > > > The ppar function should work like that: > > ppar [2,2,3] -> [[[2],[2],[3]], [[2],[2,3]], [[2,2],[3]],[ [2,2,3]]] > ppar [2,2,3,4] -> [[[2],[2],[3],[4]], [[2],[2],[3,4]], [[2],[2,3],[4]], > [[2],[2,3,4]], [[2,2],[3],[4]], [[2,2],[3,4]], [[2,2,3],[4]], [[2,2,3,4]]] > > > This is the code I have written: > > -module(ppar). > -export([ppar/1]). > > > sp(Lhs, []) -> > [[Lhs]]; > sp(Lhs, Rhs) -> > [lists:append([Lhs], P) || P <- ppar(Rhs)]. > > ppar([]) -> > [[[]]]; > ppar([H|[]]) -> > [[[H]]]; > ppar(Lst) -> > [SP || > N <- lists:seq(1,length(Lst)), > Lhs = lists:sublist(Lst, 1, N), > Rhs = lists:sublist(Lst, N+1, length(Lst)), > SP <- sp(Lhs, Rhs)]. > > Yet, when I try it I get an error: > > 1> ppar:ppar([1,2,3]). > ** exception error: no case clause matching [1] > in function ppar:'-ppar/1-lc$^0/1-0-'/2 > > Why is that? You cannot use a pattern matching operator inside a list comprehension (or at least, it does not do what you want it to do, it does not give a syntax error, so apparently it means something, though I do not know what). Thus, Lhs = lists:sublist(Lst, 1, N), is not correct syntax here. Your program will work correctly if you bypass the variables Lhs and Rhs as below: ppar(Lst) -> [SP || N <- lists:seq(1,length(Lst)), SP <- sp(lists:sublist(Lst, 1, N), lists:sublist(Lst, N+1, length(Lst)))]. -- Andre Engels, andreengels@REDACTED ICQ: 6260644 -- Skype: a_engels From rickard.s.green@REDACTED Thu Jan 3 14:45:20 2008 From: rickard.s.green@REDACTED (Rickard Green) Date: Thu, 03 Jan 2008 14:45:20 +0100 Subject: [erlang-questions] R12B-0 patch for SMP emu on *other* hw than x86, x86_64, sparc32, and powerpc32 Message-ID: <477CE6F0.4050908@ericsson.com> OTP-7080 The runtime system with SMP support not using the native atomic integer implementation part of OTP could deadlock when run on a system with more than one logical processor. That is, only the runtime system with SMP support on other hardware platforms than x86, x86_64, sparc32, and powerpc32 are effected by this bug. How to apply the attached patch (gnu tar and gnu patch is needed): $ ls otp_src_R12B-0-osp1.patch otp_src_R12B-0_OTP-7080.patch otp_src_R12B-0.tar.gz $ gtar -zxf otp_src_R12B-0.tar.gz $ gpatch -ZNp0 < otp_src_R12B-0_OTP-7080.patch patching file otp_src_R12B-0/erts/emulator/beam/erl_process_lock.c $ # If you want, also apply the $ # http://www.erlang.org/download/otp_src_R12B-0-osp1.patch $ # patch. $ gpatch -ZNp0 < otp_src_R12B-0-osp1.patch patching file otp_src_R12B-0/configure patching file otp_src_R12B-0/configure.in patching file otp_src_R12B-0/erts/aclocal.m4 patching file otp_src_R12B-0/erts/config.h.in patching file otp_src_R12B-0/erts/configure patching file otp_src_R12B-0/erts/configure.in patching file otp_src_R12B-0/erts/include/internal/ethread.h patching file otp_src_R12B-0/erts/include/internal/ethread_header_config.h.in patching file otp_src_R12B-0/erts/lib_src/common/ethread.c patching file otp_src_R12B-0/lib/compiler/src/v3_codegen.erl patching file otp_src_R12B-0/lib/kernel/src/file.erl $ # configure, make, and make install as usual... BR, Rickard Green, Erlang/OTP, Ericsson AB. PS. Valentin Micic, Ognian Pantov et al: you need both patches. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: otp_src_R12B-0_OTP-7080.patch URL: From erik.reitsma@REDACTED Thu Jan 3 14:58:21 2008 From: erik.reitsma@REDACTED (Erik Reitsma) Date: Thu, 3 Jan 2008 14:58:21 +0100 Subject: [erlang-questions] The reason for "no case clause matching"error? In-Reply-To: <6faf39c90801030532u3482ff40j49fcddcadf157fb8@mail.gmail.com> References: <477A2D51.2000709@emet.co.il> <6faf39c90801030532u3482ff40j49fcddcadf157fb8@mail.gmail.com> Message-ID: <110BA8ACEE682C479D0B008B6BE4AEB1055FE319@esealmw107.eemea.ericsson.se> > 2008/1/1, Yoel Jacobsen : > > Hello, > > > > > > I want to implement some sort of list partitioning in Erlang. > > > > > > The ppar function should work like that: > > > > ppar [2,2,3] -> [[[2],[2],[3]], [[2],[2,3]], [[2,2],[3]],[ > [2,2,3]]] > > ppar [2,2,3,4] -> [[[2],[2],[3],[4]], [[2],[2],[3,4]], > > [[2],[2,3],[4]], [[2],[2,3,4]], [[2,2],[3],[4]], [[2,2],[3,4]], > > [[2,2,3],[4]], [[2,2,3,4]]] > > > > > > This is the code I have written: > > > > -module(ppar). > > -export([ppar/1]). > > > > > > sp(Lhs, []) -> > > [[Lhs]]; > > sp(Lhs, Rhs) -> > > [lists:append([Lhs], P) || P <- ppar(Rhs)]. > > > > ppar([]) -> > > [[[]]]; > > ppar([H|[]]) -> > > [[[H]]]; > > ppar(Lst) -> > > [SP || > > N <- lists:seq(1,length(Lst)), > > Lhs = lists:sublist(Lst, 1, N), > > Rhs = lists:sublist(Lst, N+1, length(Lst)), > > SP <- sp(Lhs, Rhs)]. > > > > Yet, when I try it I get an error: > > > > 1> ppar:ppar([1,2,3]). > > ** exception error: no case clause matching [1] > > in function ppar:'-ppar/1-lc$^0/1-0-'/2 > > > > Why is that? > > You cannot use a pattern matching operator inside a list > comprehension (or at least, it does not do what you want it > to do, it does not give a syntax error, so apparently it > means something, though I do not know what). Thus, > > Lhs = lists:sublist(Lst, 1, N), > > is not correct syntax here. Each qualifier in the comprehension should be a generator or a filter. The pattern matching operator is neither. See http://www.erlang.org/doc/reference_manual/expressions.html#6.22 What you could do, probably, is: ppar(Lst) -> [SP || N <- lists:seq(1,length(Lst)), begin Lhs = lists:sublist(Lst, 1, N), Rhs = lists:sublist(Lst, N+1, length(Lst)), true end, SP <- sp(Lhs, Rhs)]. This way you wrap the matchings into a single expression which returns true, making it into a stupid filter... The following shows that you can do matching in a list comprehensions. Just make sure it evaluates to true or false! 1> [X || X <- [{true,1}, {true,2}, {false,3}], Y=element(1,X)]. [{true,1},{true,2}] Or worse (using the Y): 2> [{X,Z} || X <- [{true,1}, {true,2}, {false,3}], Y=element(1,X), Z <- case Y of true -> [1,2]; false -> [3,4] end]. [{{true,1},1},{{true,1},2},{{true,2},1},{{true,2},2}] Regards, *Erik. From sebastien.becuwe@REDACTED Thu Jan 3 15:23:00 2008 From: sebastien.becuwe@REDACTED (=?ISO-8859-1?Q?s=E9bastien_BECUWE?=) Date: Thu, 03 Jan 2008 15:23:00 +0100 Subject: [erlang-questions] Crash Dump analyse: the sum of each processe memory differs to Processes Memory In-Reply-To: <477CE6F0.4050908@ericsson.com> References: <477CE6F0.4050908@ericsson.com> Message-ID: <477CEFC4.8050607@cellicium.com> Hi, I'm going to analyze some big crash dump and i do not understand why the total amount of processes memory is not equal to the sum of (stack_size+old_heap+heap_unused+old_heap_unused) for each process. I have around 477 Mo for Processes Memory usage and only 186 Mo when I do the sum. Some of you have an idea ?! NB: i use OTP R11B5 and in particular crashdump_viewer. Thanks, S?bastien BECUWE NB: i use OTP R11B5 and in particular crashdump_viewer (diff attached to this e-mail). Example of value: total 537740430 processes 495716554 processes_used 495697778 system 42023876 atom 923009 atom_used 904547 binary 632445 code 6429750 ets 33349820 Sum based on each Process value: stack size: 117665358 old_heap: 2274136 heap_unused: 72610503 old_heap_unused: 2274136 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: crashdump_viewer.patch_sb URL: From vychodil.hynek@REDACTED Thu Jan 3 17:39:30 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Thu, 3 Jan 2008 17:39:30 +0100 Subject: [erlang-questions] The reason for "no case clause matching" error? In-Reply-To: References: <477A2D51.2000709@emet.co.il> Message-ID: <4d08db370801030839j67de1ef9vc8c3b1d1506459e0@mail.gmail.com> A little more efficient version: -module(ppar). -export([ppar/1]). sp(Lhs, []) -> [[Lhs]]; sp(Lhs, Rhs) -> [ [Lhs|P] || P <- ppar(Rhs)]. ppar([]) -> [[[]]]; ppar([H]) -> [[[H]]]; ppar(Lst) -> [SP || N <- lists:seq(1,length(Lst)), SP <- begin {Lhs, Rhs} = lists:split(N, Lst), sp(Lhs, Rhs) end]. On 1/1/08, Fredrik Svahn wrote: > Hi, > > > I cannot say I fully understand the error message. However the reference > manual says: > > "List comprehensions are written with the following syntax: > [Expr || Qualifier1,...,QualifierN] > > > > > Expr is an arbitrary expression, and each Qualifier is either a generator or > a filter. > > > A generator is written as: > Pattern <- ListExpr. > ListExpr must be an expression which evaluates to a list of terms. > A filter is an expression which evaluates to true or false." > Some of the Qualifiers you use in your list comprehension (e.g. Lhs = > lists:sublist(Lst, 1, N)) are neither generators nor filters since they do > not contain "<-" and evaluates to lists rather than true or false. > > I suggest rewriting the last function clause to: > > ppar(Lst) -> > [SP || > N <- lists:seq(1,length(Lst)), > SP <- sp(lists:sublist(Lst, 1, N), lists:sublist(Lst, N+1, > length(Lst)))]. > > or (to maintain the variables for clarity) > > ppar(Lst) -> > [SP || N <- lists:seq(1,length(Lst)), > SP <- begin > Lhs = lists:sublist(Lst, 1, N), > Rhs = lists:sublist(Lst, N+1, length(Lst)), > sp(Lhs, Rhs) > end]. > > > Gives: > > 2> test4:ppar([2,2,3]). > [[[2],[2],[3]],[[2],[2,3]],[[2,2],[3]],[[2,2,3]]] > > Hope this helps. > > BR /Fredrik > > > > On Jan 1, 2008 1:08 PM, Yoel Jacobsen wrote: > > > > Hello, > > > > > > I want to implement some sort of list partitioning in Erlang. > > > > > > The ppar function should work like that: > > > > ppar [2,2,3] -> [[[2],[2],[3]], [[2],[2,3]], [[2,2],[3]],[ [2,2,3]]] > > ppar [2,2,3,4] -> [[[2],[2],[3],[4]], [[2],[2],[3,4]], [[2],[2,3],[4]], > > [[2],[2,3,4]], [[2,2],[3],[4]], [[2,2],[3,4]], [[2,2,3],[4]], [[2,2,3,4]]] > > > > > > This is the code I have written: > > > > -module(ppar). > > -export([ppar/1]). > > > > > > sp(Lhs, []) -> > > [[Lhs]]; > > sp(Lhs, Rhs) -> > > [lists:append([Lhs], P) || P <- ppar(Rhs)]. > > > > ppar([]) -> > > [[[]]]; > > ppar([H|[]]) -> > > [[[H]]]; > > ppar(Lst) -> > > [SP || > > N <- lists:seq(1,length(Lst)), > > Lhs = lists:sublist(Lst, 1, N), > > Rhs = lists:sublist(Lst, N+1, length(Lst)), > > SP <- sp(Lhs, Rhs)]. > > > > Yet, when I try it I get an error: > > > > 1> ppar:ppar([1,2,3]). > > ** exception error: no case clause matching [1] > > in function ppar:'-ppar/1-lc$^0/1-0-'/2 > > > > Why is that? > > > > Yoel > > > > > > > > _______________________________________________ > > 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 From erlang@REDACTED Thu Jan 3 20:46:26 2008 From: erlang@REDACTED (Bruce O'Neel) Date: Thu, 03 Jan 2008 20:46:26 +0100 Subject: [erlang-questions] R12.0B and Sparcs In-Reply-To: <18299.37122.259893.758087@harpo.it.uu.se> Message-ID: <1199389586-59ac9f2def9cae2aa9337b27a2a15181@pckswarms.ch> Hi, Thanks, but it's probably not worth spending hours on this. I suspect that the set of non-Ultra sparc users of erlang is quite small... Anyway, one of the many error messages is: /tmp//ccX10737.s:4437: Error: Architecture mismatch on "cas". /tmp//ccX10737.s:4437: (Requires v9|v9a|v9b; requested architecture is sparclite.) The line in R12B-0 that fails is: gcc -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -g -O3 -I/home/edoneel/tmp/otp_src_R12B-0/erts/sparc-unknown-openbsd4.2 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes -DHAVE_CONFIG_H -I../include -I../include/sparc-unknown-openbsd4.2 -I../include/internal -I../include/internal/sparc-unknown-openbsd4.2 -c common/ethread.c -o obj/sparc-unknown-openbsd4.2/opt/r/ethread.o As you pointed out, the code in erts/include/internal/sparc32 hasn't changed much, but, the R11 code had: #ifdef ETHR_TRY_INLINE_FUNCS around the files. When R11B-5 compiles the line that gets compiled is: gcc -MM -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -g -O3 -I/home/edoneel/tmp/otp_src_R11B-5/erts/sparc-unknown-openbsd4.2 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes -DHAVE_CONFIG_H -I../include -I../include/sparc-unknown-openbsd4.2 -I../include/internal -I../include/internal/sparc-unknown-openbsd4.2 common/ethread.c which looks quite similar. In both cases the configure request was: ./configure --prefix=$HOME/local-`uname -m` I did several runs with turning on and of threads, smp, kernel-poll, and hipe. None made this go away, though, I did not try all possible combinations, rather I tried each one individually. 16 runs of configure would have been days... Would you like some bits of config.log or config.h? Also, the sparc version of OpenBSD is special in that gcc is 2.95.3 rather than some sort of gcc 3.x. Still, my email message was more so that if I ever needed to solve this again and didn't remember, google, with luck, would find it. Also potentially it helps the one other user of Sparc erlang :-) Thanks again! cheers bruce ----- Message d'origine ----- De: Mikael Pettersson Date: Wed, 2 Jan 2008 14:26:26 +0100 Sujet: Re: [erlang-questions] R12.0B and Sparcs ?: "Bruce O'Neel" Cc: erlang-questions@REDACTED, Jon Olsson >Bruce O'Neel writes: > > Happy New Year, > > > > Here at the home for ancient, disused, and discarded computers we noticed that > > while R11B-5 built and ran just fine on Sparcs, R12B-0 did not at least on > > OpenBSD and NetBSD. > >What exactly is the failure? Compile-time warning from the assembler >on the V9 instructions? Runtime SIGILL? > > > No, not Ultras, the sparcs that Sun hasn't actually shipped for 10+ years, the old > > V7 and V8 systems (ie SPARCstation 10s, 20s, 4s, and 5s etc). > > > > It turns out that a small change to > > > > erts/include/internal/ethread.h > > > > allows them to work again. > > > > 82a83,85 > > > /* BEO for SPARC OpenBSD only. Not SPARC64! */ > > > # define ETHR_DISABLE_NATIVE_IMP > > > > > > > Basically the above define throws away the optimized assembly code in > > erts/include/internal/sparc32 which is V9 (ie Ultra) specific. > >The SPARC v9 (actually v8+) code referenced by ethread.h is >essentially the same in R11B-5 and R12B-0. >I suspect some configuration change is causing your problems. > >- Did you build R11B-5 with SMP support on SPARC v7/v8? > If so, was it autoenabled or did you enable it explicitly. >- Does R12B-0 autoenable SMP on BSD/SPARC or do you enable > it explicitly? > >GCC's __sparcv9 macro is unfortunately useless here >(it seems to be set if and only if 64-bit code is generated), >so to disable the v8+/v9 code automatically we'd have to add >a check in erts/configure.in and use that to #define a macro >which we then check in ethread.h. > >/Mikael > From bjt@REDACTED Thu Jan 3 23:02:04 2008 From: bjt@REDACTED (Benjamin Tolputt) Date: Fri, 04 Jan 2008 09:02:04 +1100 Subject: [erlang-questions] SSL Documentation in RB12? In-Reply-To: <476FAC51.8040608@lshift.net> References: <476FA3AB.203@eprometeus.com> <476FAC51.8040608@lshift.net> Message-ID: <477D5B5C.80705@pmp.com.au> While sifting through the "inets" documentation, I noticed (through a bad link) that the "ssl" package's documentation is not included in the R12B package for windows? Is this the same for all the platform releases, or can I obtain it from one of the other archives? In any case, it should be fixed right? Regards, B.J.Tolputt From vances@REDACTED Thu Jan 3 23:08:49 2008 From: vances@REDACTED (Vance Shipley) Date: Thu, 3 Jan 2008 17:08:49 -0500 Subject: [erlang-questions] working with sets Message-ID: <20080103220849.GB11993@Little-Black-Book.local> Can one of you CS wizzes point me at the best way to maintain a set of sets where all elements of all sets must be unique? I don't need a really big data set but rolling my own with the list module feels wrong. For example {{1,2,3},{4,5,6},{7,8,9}} is a valid set. Trying to enter {9,10,11} should fail. -Vance From erlangy@REDACTED Fri Jan 4 00:04:26 2008 From: erlangy@REDACTED (Michael McDaniel) Date: Thu, 3 Jan 2008 15:04:26 -0800 Subject: [erlang-questions] working with sets In-Reply-To: <20080103220849.GB11993@Little-Black-Book.local> References: <20080103220849.GB11993@Little-Black-Book.local> Message-ID: <20080103230426.GK6351@delora.autosys.us> Seems like the sets module could help out. Check if sets:is_element/2 and sets:add_element/2 as needed (following is untested) case sets:is_element(Element, Set) of false -> sets:add_element(Element, Set) ; true -> nop end ~M On Thu, Jan 03, 2008 at 05:08:49PM -0500, Vance Shipley wrote: > Can one of you CS wizzes point me at the best way to > maintain a set of sets where all elements of all sets > must be unique? I don't need a really big data set > but rolling my own with the list module feels wrong. > > For example {{1,2,3},{4,5,6},{7,8,9}} is a valid set. > Trying to enter {9,10,11} should fail. > > -Vance > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- Michael McDaniel Portland, Oregon, USA http://autosys.us +1 503 283 5284 From erlangy@REDACTED Fri Jan 4 00:06:08 2008 From: erlangy@REDACTED (Michael McDaniel) Date: Thu, 3 Jan 2008 15:06:08 -0800 Subject: [erlang-questions] working with sets In-Reply-To: <20080103230426.GK6351@delora.autosys.us> References: <20080103220849.GB11993@Little-Black-Book.local> <20080103230426.GK6351@delora.autosys.us> Message-ID: <20080103230608.GL6351@delora.autosys.us> umm, the false should be ... false -> NewSet = sets:add_element(Element, Set) ; ~M On Thu, Jan 03, 2008 at 03:04:26PM -0800, Michael McDaniel wrote: > > Seems like the sets module could help out. Check if > sets:is_element/2 and sets:add_element/2 as needed > (following is untested) > > case sets:is_element(Element, Set) of > false -> sets:add_element(Element, Set) ; > true -> nop > end > > > ~M > > On Thu, Jan 03, 2008 at 05:08:49PM -0500, Vance Shipley wrote: > > Can one of you CS wizzes point me at the best way to > > maintain a set of sets where all elements of all sets > > must be unique? I don't need a really big data set > > but rolling my own with the list module feels wrong. > > > > For example {{1,2,3},{4,5,6},{7,8,9}} is a valid set. > > Trying to enter {9,10,11} should fail. > > > > -Vance > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- > Michael McDaniel > Portland, Oregon, USA > http://autosys.us > +1 503 283 5284 -- Michael McDaniel Portland, Oregon, USA http://autosys.us +1 503 283 5284 From rvirding@REDACTED Fri Jan 4 01:21:51 2008 From: rvirding@REDACTED (Robert Virding) Date: Fri, 4 Jan 2008 01:21:51 +0100 Subject: [erlang-questions] working with sets In-Reply-To: <20080103230608.GL6351@delora.autosys.us> References: <20080103220849.GB11993@Little-Black-Book.local> <20080103230426.GK6351@delora.autosys.us> <20080103230608.GL6351@delora.autosys.us> Message-ID: <3dbc6d1c0801031621w4ead0a9k82cfcb9c6ab35c5c@mail.gmail.com> I would use ordsets to test with as it is then easy to actually see and understand the sets. Understanding a set from sets is not always trivial. The interface is the same and if the sets are small then maybe it is perfectly alright to use ordsets anyway. Robert On 04/01/2008, Michael McDaniel wrote: > > umm, the false should be ... > > false -> NewSet = sets:add_element(Element, Set) ; > > ~M > > On Thu, Jan 03, 2008 at 03:04:26PM -0800, Michael McDaniel wrote: > > > > Seems like the sets module could help out. Check if > > sets:is_element/2 and sets:add_element/2 as needed > > (following is untested) > > > > case sets:is_element(Element, Set) of > > false -> sets:add_element(Element, Set) ; > > true -> nop > > end > > > > > > ~M > > > > On Thu, Jan 03, 2008 at 05:08:49PM -0500, Vance Shipley wrote: > > > Can one of you CS wizzes point me at the best way to > > > maintain a set of sets where all elements of all sets > > > must be unique? I don't need a really big data set > > > but rolling my own with the list module feels wrong. > > > > > > For example {{1,2,3},{4,5,6},{7,8,9}} is a valid set. > > > Trying to enter {9,10,11} should fail. > > > > > > -Vance > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > -- > > Michael McDaniel > > Portland, Oregon, USA > > http://autosys.us > > +1 503 283 5284 > > -- > Michael McDaniel > Portland, Oregon, USA > http://autosys.us > +1 503 283 5284 > _______________________________________________ > 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 Fri Jan 4 01:38:09 2008 From: vances@REDACTED (Vance Shipley) Date: Thu, 3 Jan 2008 19:38:09 -0500 Subject: [erlang-questions] working with sets In-Reply-To: <20080103230608.GL6351@delora.autosys.us> References: <20080103220849.GB11993@Little-Black-Book.local> <20080103230426.GK6351@delora.autosys.us> <20080103230608.GL6351@delora.autosys.us> Message-ID: <20080104003739.GB12953@h216-235-12-173.host.egate.net> On Thu, Jan 03, 2008 at 03:06:08PM -0800, Michael McDaniel wrote: } Seems like the sets module could help out. I could use the sets module but I have to maintain an array myself. 1> Set1 = sets:from_list([1,2,3]), 1> Set2 = sets:from_list([4,5,6]), 1> Set3 = sets:from_list([7,8,9]), 1> Set = sets:from_list(Set1,Set2,Set3]). 2> sets:is_element(1, Set). false 3> sets:is_element(Set1, Set). true 4> sets:fold(fun(E, false) -> sets:is_element(9, E) end, false, Set). true 5> sets:fold(fun(E, false) -> sets:is_element(10, E) end, false, Set). false So sure, I could manage a set of sets by rolling my own with the sets module however I could do that with lists as well and it would be much smaller than a set(). The sofs module sounds like it's what I should be looking at however I can't see how it helps yet. -Vance I should really get that Okasaki book ... From jwebb@REDACTED Fri Jan 4 01:43:12 2008 From: jwebb@REDACTED (John Webb) Date: Fri, 4 Jan 2008 09:43:12 +0900 Subject: [erlang-questions] wxErlang In-Reply-To: <1199315976.5559.38.camel@ubuntu-life-vm> References: <1199315976.5559.38.camel@ubuntu-life-vm> Message-ID: <7998EA64-00C8-4421-9103-FB3AB8A926FA@gol.com> Hi Bob, On Jan 3, 2008, at 8:19 AM, Bob Cowdery wrote: > I have a couple of small issues with wxErlang. In general it is > working > great so far. > > 1. I can't get any events to fire off a wxToggleButton. As far as I > remember this behaves like a check box but neither > command_button_clicked nor command_checkbox_clicked fire. Is there > some > other event I should be looking at. wxToggleButton generates a wxEVT_COMMAND_TOGGLEBUTTON_CLICKED event when clicked; I haven't looked at wxErlang but I am guessing that there is a command_togglebutton_clicked event somewhere... > > 2. This is a bit obscure and I'm not sure if it's a wxWidgets issue. > If > I place a checkbox in the first cell of a wxGridSizer the click area > appears over the label and not the box, which also has a white band > underneath it. Sorry, No idea about this one. Regards, John From vances@REDACTED Fri Jan 4 02:12:55 2008 From: vances@REDACTED (Vance Shipley) Date: Thu, 3 Jan 2008 20:12:55 -0500 Subject: [erlang-questions] working with sets In-Reply-To: <3dbc6d1c0801031621w4ead0a9k82cfcb9c6ab35c5c@mail.gmail.com> References: <20080103220849.GB11993@Little-Black-Book.local> <20080103230426.GK6351@delora.autosys.us> <20080103230608.GL6351@delora.autosys.us> <3dbc6d1c0801031621w4ead0a9k82cfcb9c6ab35c5c@mail.gmail.com> Message-ID: <20080104011255.GC12953@h216-235-12-173.host.egate.net> On Fri, Jan 04, 2008 at 01:21:51AM +0100, Robert Virding wrote: } I would use ordsets to test with as it is then easy to actually see and } understand the sets. Understanding a set from sets is not always trivial. } The interface is the same and if the sets are small then maybe it is } perfectly alright to use ordsets anyway. Ah yes, that's much simpler. 1> OrdSet1 = ordsets:from_list([1,2,3]). [1,2,3] 2> OrdSet2 = ordsets:from_list([4,5,6]). [4,5,6] 3> OrdSet3 = ordsets:from_list([7,8,9]). [7,8,9] 4> OrdSet = ordsets:from_list([OrdSet1,OrdSet2,OrdSet3]). [[1,2,3],[4,5,6],[7,8,9]] I'll roll up on this. -Vance From jcone@REDACTED Thu Jan 3 03:25:31 2008 From: jcone@REDACTED (James Cone) Date: Thu, 03 Jan 2008 15:25:31 +1300 Subject: [erlang-questions] Mnesia, versioning and recovering from network splits In-Reply-To: References: Message-ID: <477C479B.7090209@eservglobal.com> Hi Joel, You haven't given us a plan about which data you're going to throw away. Suppose one side of the split does a transaction that affects rows A & B, and the other side does a transaction that affects rows B & C. If one side is going to be thrown away, because it's being restored from backup, then one whole transaction will be thrown away. If you go row-by-row, presumably you will keep the changes to both row A and row C, so you have to decide what to do about row B, and making it consistent with both transactions either: - needs application knowledge or - with application knowledge, is still impossible Regards, James. Joel Reymont wrote: > Folks, > > I think there's a reasonably straightforward way for Mnesia to recover > from network splits. I also think that it would be much faster to > merge databases in this scenario than drop a database and reload it > form backups. > > I believe merging databases would require versioning of Mnesia records > (simple integer should do) and the addition of a merging mechanism. > Record versions would be shipped around and the latest version of the > record would then be pulled by the server that has fallen behind. > > What are the flaws in my thinking? > > Thanks, Joel > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From jwebb@REDACTED Fri Jan 4 08:11:28 2008 From: jwebb@REDACTED (John Webb) Date: Fri, 4 Jan 2008 16:11:28 +0900 Subject: [erlang-questions] wxErlang In-Reply-To: <7998EA64-00C8-4421-9103-FB3AB8A926FA@gol.com> References: <1199315976.5559.38.camel@ubuntu-life-vm> <7998EA64-00C8-4421-9103-FB3AB8A926FA@gol.com> Message-ID: <9F2DB736-551B-413D-A2AD-1661681895E2@gol.com> On Jan 4, 2008, at 9:43 AM, John Webb wrote: > Hi Bob, > > On Jan 3, 2008, at 8:19 AM, Bob Cowdery wrote: > >> I have a couple of small issues with wxErlang. In general it is >> working >> great so far. >> >> 1. I can't get any events to fire off a wxToggleButton. As far as I >> remember this behaves like a check box but neither >> command_button_clicked nor command_checkbox_clicked fire. Is there >> some >> other event I should be looking at. > > wxToggleButton generates a wxEVT_COMMAND_TOGGLEBUTTON_CLICKED event > when clicked; I haven't looked at wxErlang but I am guessing that > there is a command_togglebutton_clicked event somewhere... Ah, guessed wrong again... for whatever reason the event is commented out in api_gen/wxapi.conf in the source distribution. Uncommenting the event and regenerating the API might give you the event but I'm guessing again because so far I've not been able to build successfully on my MacBook :( > > > >> >> 2. This is a bit obscure and I'm not sure if it's a wxWidgets issue. >> If >> I place a checkbox in the first cell of a wxGridSizer the click area >> appears over the label and not the box, which also has a white band >> underneath it. > > Sorry, No idea about this one. > > Regards, > John > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From kenneth.lundin@REDACTED Fri Jan 4 08:37:40 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 4 Jan 2008 08:37:40 +0100 Subject: [erlang-questions] SSL Documentation in RB12? In-Reply-To: <477D5B5C.80705@pmp.com.au> References: <476FA3AB.203@eprometeus.com> <476FAC51.8040608@lshift.net> <477D5B5C.80705@pmp.com.au> Message-ID: The ssl and crypto documentation is still missing in the prebuilt package for windows but is present in the online documentation on the erlang.org site and in the separate R12B_doc file which you finde here: http://www.erlang.org/download/otp_doc_html_R12B-0.tar.gz. You can use this as a correction for the Windows version as well. Just unpack it in the directory where you have the Wiindows version installed. /Kenneth On 1/3/08, Benjamin Tolputt wrote: > While sifting through the "inets" documentation, I noticed (through a > bad link) that the "ssl" package's documentation is not included in the > R12B package for windows? > > Is this the same for all the platform releases, or can I obtain it from > one of the other archives? In any case, it should be fixed right? > > Regards, > B.J.Tolputt > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From joelr1@REDACTED Fri Jan 4 11:55:36 2008 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 4 Jan 2008 10:55:36 +0000 Subject: [erlang-questions] Mnesia, versioning and recovering from network splits In-Reply-To: <477C479B.7090209@eservglobal.com> References: <477C479B.7090209@eservglobal.com> Message-ID: I see the error of my ways. On Jan 3, 2008, at 2:25 AM, James Cone wrote: > If you go row-by-row, presumably you will keep the changes to both > row A > and row C, so you have to decide what to do about row B, and making it > consistent with both transactions either: > - needs application knowledge > or > - with application knowledge, is still impossible -- http://wagerlabs.com From ulf@REDACTED Fri Jan 4 12:42:04 2008 From: ulf@REDACTED (Ulf Wiger) Date: Fri, 4 Jan 2008 12:42:04 +0100 Subject: [erlang-questions] working with sets In-Reply-To: <20080103220849.GB11993@Little-Black-Book.local> References: <20080103220849.GB11993@Little-Black-Book.local> Message-ID: <8209f740801040342r6f1d0d04rbe24faf9625eb05b@mail.gmail.com> Have you looked at the sofs module in stdlib? http://www.erlang.org/doc/man/sofs.html sofs = "sets of sets". Just understanding the man page for sofs is a bit of a challenge, though. (: BR, Ulf W 2008/1/3, Vance Shipley : > Can one of you CS wizzes point me at the best way to > maintain a set of sets where all elements of all sets > must be unique? I don't need a really big data set > but rolling my own with the list module feels wrong. > > For example {{1,2,3},{4,5,6},{7,8,9}} is a valid set. > Trying to enter {9,10,11} should fail. > > -Vance > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From richardc@REDACTED Fri Jan 4 12:44:35 2008 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 04 Jan 2008 12:44:35 +0100 Subject: [erlang-questions] working with sets In-Reply-To: <20080103220849.GB11993@Little-Black-Book.local> References: <20080103220849.GB11993@Little-Black-Book.local> Message-ID: <477E1C23.6040701@it.uu.se> Vance Shipley wrote: > Can one of you CS wizzes point me at the best way to > maintain a set of sets where all elements of all sets > must be unique? I don't need a really big data set > but rolling my own with the list module feels wrong. > > For example {{1,2,3},{4,5,6},{7,8,9}} is a valid set. > Trying to enter {9,10,11} should fail. If your elements are really integers within a limited range (or can easily be mapped to/from such integers), the old set-as-bitmap representation can be a good choice. Since Erlang has bignums, your bitmaps are simply integers. This gives you fast intersection tests (A band B). Writing a sets-like interface to bitmaps (for the operations that you neeed) is easy, and lets you switch between implementations later. /Richard From vances@REDACTED Fri Jan 4 13:11:37 2008 From: vances@REDACTED (Vance Shipley) Date: Fri, 4 Jan 2008 07:11:37 -0500 Subject: [erlang-questions] working with sets In-Reply-To: <477E1C23.6040701@it.uu.se> References: <20080103220849.GB11993@Little-Black-Book.local> <477E1C23.6040701@it.uu.se> Message-ID: <20080104121137.GE12953@h216-235-12-173.host.egate.net> On Fri, Jan 04, 2008 at 12:44:35PM +0100, Richard Carlsson wrote: } If your elements are really integers within a limited range They're string()'s in my case. On Fri, Jan 04, 2008 at 12:42:04PM +0100, Ulf Wiger wrote: } Just understanding the man page for sofs is a bit of a } challenge, though. (: It is indeed. It seems that if one were clever sofs would provide a neat solution. In the mean time ... I implemented my sets of sets over ordsets fairly simply. My only dissatisfaction is that I don't have a lazy way to find the first set in the set of sets which contains an element. I'm all about lazy evaluation. -Vance -module(mysofs). -export([new/0, add_set/2]). new() -> ordsets:new(). add_set(List, Set) when is_list(List) -> case is_element_in_sets(List, Set) of false -> Elem = ordsets:from_list(List), ordsets:add_element(Elem, Set); true -> exit(badarg) end. is_element_in_sets([], _) -> false; is_element_in_sets([H|T], Set) when is_list(H) -> F = fun(E, AccIn) -> case ordsets:is_element(H, E) of true -> true; false -> AccIn end end, case ordsets:fold(F, false, Set) of true -> true; false -> is_element_in_sets(T, Set) end; is_element_in_sets(_, _) -> exit(badarg). From erlang@REDACTED Fri Jan 4 13:51:17 2008 From: erlang@REDACTED (Bruce O'Neel) Date: Fri, 04 Jan 2008 13:51:17 +0100 Subject: [erlang-questions] R12.0B and Sparcs In-Reply-To: <1199389586-59ac9f2def9cae2aa9337b27a2a15181@pckswarms.ch> Message-ID: <1199451077-e430093ad053aa7604c0ec7a315ae0a0@pckswarms.ch> Hi, If it helps I've done the following: Untar the source of R11B-5 and R12B-0. run ./configure --prefix=$HOME/local-`uname -m` > config.out 2>&1 in both directories. Run gmake > make.log 2>&1 in both directories. And then tared everything up and put them here: http://www.pckswarms.ch/erlang/otp_src_R11B-5.tar.gz http://www.pckswarms.ch/erlang/otp_src_R12B-0.tar.gz Note, do to a brain glitch the config.out for 11B-5 was produced on a fresh copy because I forgot to do it the first time and the upload is soooo slow. cheers bruce ----- Message d'origine ----- De: "Bruce O'Neel" Date: Thu, 03 Jan 2008 20:46:26 +0100 Sujet: Re: [erlang-questions] R12.0B and Sparcs ?: Mikael Pettersson Cc: Jon Olsson , erlang-questions@REDACTED >Hi, > >Thanks, but it's probably not worth spending hours on this. I suspect that >the set of non-Ultra sparc users of erlang is quite small... > >Anyway, one of the many error messages is: > >/tmp//ccX10737.s:4437: Error: Architecture mismatch on "cas". >/tmp//ccX10737.s:4437: (Requires v9|v9a|v9b; requested architecture is sparclite.) > >The line in R12B-0 that fails is: > >gcc -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -g -O3 -I/home/edoneel/tmp/otp_src_R12B-0/erts/sparc-unknown-openbsd4.2 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes -DHAVE_CONFIG_H -I../include -I../include/sparc-unknown-openbsd4.2 -I../include/internal -I../include/internal/sparc-unknown-openbsd4.2 -c common/ethread.c -o obj/sparc-unknown-openbsd4.2/opt/r/ethread.o > > >As you pointed out, the code in erts/include/internal/sparc32 hasn't changed much, >but, the R11 code had: > >#ifdef ETHR_TRY_INLINE_FUNCS > >around the files. > >When R11B-5 compiles the line that gets compiled is: > >gcc -MM -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -g -O3 -I/home/edoneel/tmp/otp_src_R11B-5/erts/sparc-unknown-openbsd4.2 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes -DHAVE_CONFIG_H >-I../include -I../include/sparc-unknown-openbsd4.2 -I../include/internal -I../include/internal/sparc-unknown-openbsd4.2 common/ethread.c > >which looks quite similar. > >In both cases the configure request was: > >./configure --prefix=$HOME/local-`uname -m` > >I did several runs with turning on and of threads, smp, kernel-poll, and hipe. >None made this go away, though, I did not try all possible combinations, rather >I tried each one individually. 16 runs of configure would have been days... > >Would you like some bits of config.log or config.h? Also, the sparc >version of OpenBSD is special in that gcc is 2.95.3 rather than some sort >of gcc 3.x. > >Still, my email message was more so that if I ever needed to solve this again >and didn't remember, google, with luck, would find it. Also potentially it helps >the one other user of Sparc erlang :-) > >Thanks again! > >cheers > >bruce > >----- Message d'origine ----- >De: Mikael Pettersson >Date: Wed, 2 Jan 2008 14:26:26 +0100 >Sujet: Re: [erlang-questions] R12.0B and Sparcs >?: "Bruce O'Neel" >Cc: erlang-questions@REDACTED, Jon Olsson > >>Bruce O'Neel writes: >> > Happy New Year, >> > >> > Here at the home for ancient, disused, and discarded computers we noticed that >> > while R11B-5 built and ran just fine on Sparcs, R12B-0 did not at least on >> > OpenBSD and NetBSD. >> >>What exactly is the failure? Compile-time warning from the assembler >>on the V9 instructions? Runtime SIGILL? >> >> > No, not Ultras, the sparcs that Sun hasn't actually shipped for 10+ years, the old >> > V7 and V8 systems (ie SPARCstation 10s, 20s, 4s, and 5s etc). >> > >> > It turns out that a small change to >> > >> > erts/include/internal/ethread.h >> > >> > allows them to work again. >> > >> > 82a83,85 >> > > /* BEO for SPARC OpenBSD only. Not SPARC64! */ >> > > # define ETHR_DISABLE_NATIVE_IMP >> > > >> > >> > Basically the above define throws away the optimized assembly code in >> > erts/include/internal/sparc32 which is V9 (ie Ultra) specific. >> >>The SPARC v9 (actually v8+) code referenced by ethread.h is >>essentially the same in R11B-5 and R12B-0. >>I suspect some configuration change is causing your problems. >> >>- Did you build R11B-5 with SMP support on SPARC v7/v8? >> If so, was it autoenabled or did you enable it explicitly. >>- Does R12B-0 autoenable SMP on BSD/SPARC or do you enable >> it explicitly? >> >>GCC's __sparcv9 macro is unfortunately useless here >>(it seems to be set if and only if 64-bit code is generated), >>so to disable the v8+/v9 code automatically we'd have to add >>a check in erts/configure.in and use that to #define a macro >>which we then check in ethread.h. >> >>/Mikael >> >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://www.erlang.org/mailman/listinfo/erlang-questions > > From vances@REDACTED Fri Jan 4 13:52:21 2008 From: vances@REDACTED (Vance Shipley) Date: Fri, 4 Jan 2008 07:52:21 -0500 Subject: [erlang-questions] working with sets In-Reply-To: <20080104121137.GE12953@h216-235-12-173.host.egate.net> References: <20080103220849.GB11993@Little-Black-Book.local> <477E1C23.6040701@it.uu.se> <20080104121137.GE12953@h216-235-12-173.host.egate.net> Message-ID: <20080104125221.GF12953@h216-235-12-173.host.egate.net> On Fri, Jan 04, 2008 at 07:11:37AM -0500, Vance Shipley wrote: } My only dissatisfaction is that I don't have a lazy way } to find the first set in the set of sets which contains } an element. I'm all about lazy evaluation. I can of course do so easily using ordsets 'cause I 'm allowed to know what the representation of the sets are. It's just not portable to other set implementations. get_set(Elem, [H|T]) -> case ordsets:is_element(Elem, H) of true -> ordsets:to_list(H); false -> get_set(Elem, T) end. -Vance From bobcalco@REDACTED Fri Jan 4 14:20:35 2008 From: bobcalco@REDACTED (Bob Calco) Date: Fri, 4 Jan 2008 08:20:35 -0500 Subject: [erlang-questions] APB for APIs Message-ID: <025201c84ed4$973b5360$c5b1fa20$@rr.com> Does anyone know of anyone working on the following APIs for Erlang: - An API to generate PDF files - Alternatively, an API to generate LaTeX output that can be compiled using pdftex on the fly? - Flickr and Facebook integration - Converting to/from cXML (www.cxml.org) These are all needful things I expect to implement on a current project, but thought it wise to ask whether these particular wheels had already been invented. These are all things I know more or less how to do (or find already done) in C++, C#, Ruby and Java, but as I'm growing fonder daily of Erlang and pretty much convinced it's the right tool for a particular job I'm working on, which is fairly tight in the deadline department, but something over which I have total creative control. I am planning to use Yaws as the web server and Adobe Flex/AIR for the UI. The latter was inspired by the Flexible Rails book by Manning that is currently in early access. (Yes I'm a Rails convert.) Any experience anyone has doing that would also be helpful. >From this experience I hope to extend the OTP into the OWT (Open Web Toolkit), an Erlang equivalent to RoR. Incidentally if anyone is willing to help out, with pointers or code, on said APIs I may be in a position to help with some modest compensation beyond a hearty thank-you. Thanks in advance! - Bob From rsaccon@REDACTED Fri Jan 4 15:05:03 2008 From: rsaccon@REDACTED (Roberto Saccon) Date: Fri, 4 Jan 2008 12:05:03 -0200 Subject: [erlang-questions] APB for APIs In-Reply-To: <025201c84ed4$973b5360$c5b1fa20$@rr.com> References: <025201c84ed4$973b5360$c5b1fa20$@rr.com> Message-ID: On Jan 4, 2008 11:20 AM, Bob Calco wrote: > Does anyone know of anyone working on the following APIs for Erlang: > > - An API to generate PDF files Generate from what ? If 2D vector drawing is an input option, than you could sightly extend http://erlycairo.googlecode.com for PDF output. > - Alternatively, an API to generate LaTeX output that can be compiled using > pdftex on the fly? > - Flickr and Facebook integration there exists an erlyweb facebook integration, use google to find it ! > - Converting to/from cXML (www.cxml.org) > > These are all needful things I expect to implement on a current project, but > thought it wise to ask whether these particular wheels had already been > invented. > > These are all things I know more or less how to do (or find already done) in > C++, C#, Ruby and Java, but as I'm growing fonder daily of Erlang and pretty > much convinced it's the right tool for a particular job I'm working on, > which is fairly tight in the deadline department, but something over which I > have total creative control. > > I am planning to use Yaws as the web server and Adobe Flex/AIR for the UI. > The latter was inspired by the Flexible Rails book by Manning that is > currently in early access. (Yes I'm a Rails convert.) Any experience anyone > has doing that would also be helpful. > > >From this experience I hope to extend the OTP into the OWT (Open Web > Toolkit), an Erlang equivalent to RoR. > > Incidentally if anyone is willing to help out, with pointers or code, on > said APIs I may be in a position to help with some modest compensation > beyond a hearty thank-you. > > Thanks in advance! > > - Bob > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- Roberto Saccon http://rsaccon.com From ulf@REDACTED Fri Jan 4 15:07:42 2008 From: ulf@REDACTED (Ulf Wiger) Date: Fri, 4 Jan 2008 15:07:42 +0100 Subject: [erlang-questions] APB for APIs In-Reply-To: <025201c84ed4$973b5360$c5b1fa20$@rr.com> References: <025201c84ed4$973b5360$c5b1fa20$@rr.com> Message-ID: <8209f740801040607n7dec0d7oa3a8dcdb69621211@mail.gmail.com> 2008/1/4, Bob Calco : > Does anyone know of anyone working on the following APIs for Erlang: > > - An API to generate PDF files Take a look at ErlGuten. http://erlguten.googlecode.com > - Alternatively, an API to generate LaTeX output that can be compiled using > pdftex on the fly? > - Flickr and Facebook integration Don't know, although I do recall Facebook being mentioned on the erlyweb group http://code.google.com/p/erlyweb/ There is also this: http://erlang2facebook.googlecode.com (but I know nothing about it). > - Converting to/from cXML (www.cxml.org) cXML is regular XML, right? So xmerl should be able to handle it just fine, including DTD validation. Since cXML DTDs can be cached forever, perhaps this could be done by xmerl eventually...? BR, Ulf W > > These are all needful things I expect to implement on a current project, but > thought it wise to ask whether these particular wheels had already been > invented. > > These are all things I know more or less how to do (or find already done) in > C++, C#, Ruby and Java, but as I'm growing fonder daily of Erlang and pretty > much convinced it's the right tool for a particular job I'm working on, > which is fairly tight in the deadline department, but something over which I > have total creative control. > > I am planning to use Yaws as the web server and Adobe Flex/AIR for the UI. > The latter was inspired by the Flexible Rails book by Manning that is > currently in early access. (Yes I'm a Rails convert.) Any experience anyone > has doing that would also be helpful. > > >From this experience I hope to extend the OTP into the OWT (Open Web > Toolkit), an Erlang equivalent to RoR. > > Incidentally if anyone is willing to help out, with pointers or code, on > said APIs I may be in a position to help with some modest compensation > beyond a hearty thank-you. > > Thanks in advance! > > - Bob > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bfuhrmannek@REDACTED Fri Jan 4 14:30:55 2008 From: bfuhrmannek@REDACTED (Ben Fuhrmannek) Date: Fri, 4 Jan 2008 14:30:55 +0100 Subject: [erlang-questions] Ajax in Erlang, anyone? In-Reply-To: <476FA3AB.203@eprometeus.com> References: <476FA3AB.203@eprometeus.com> Message-ID: On 24 Dec 2007, at 13:18, Michele Sciabarra wrote: > > http://yaws.hyber.org/json_intro.yaws > > Has anyone had experiences and examples about ajax in erlang to share? > Using JSON-RPC with yaws_rpc works perfectly fine for me using "JSON/ XML-RPC Client " as client library. However I would like to point out, that JSON-RPC appears to be not fully implemented in yaws_rpc regarding the json-rpc error reply. For example: A perfectly valid json-rpc reply of the form {"id":6,"error":{"code":23,"message":"this and that"}} can not be handled by yaws_rpc, where replies indicating a success such as {"result":true,"id":2} are being handled just fine. Links: - JSON-RPC Spec: http://json-rpc.org/ - Problem description and patch: http://pentaphase.de/index.php?/ archives/27-yaws-json-rpc-error-reply.html Regards, Ben From bryan.fink@REDACTED Fri Jan 4 15:22:51 2008 From: bryan.fink@REDACTED (Bryan Fink) Date: Fri, 4 Jan 2008 09:22:51 -0500 Subject: [erlang-questions] APB for APIs In-Reply-To: <025201c84ed4$973b5360$c5b1fa20$@rr.com> References: <025201c84ed4$973b5360$c5b1fa20$@rr.com> Message-ID: On Jan 4, 2008 8:20 AM, Bob Calco wrote: > Does anyone know of anyone working on the following APIs for Erlang: > > - Flickr and Facebook integration Facebook integration is ready: http://code.google.com/p/erlang2facebook/ As Roberto pointed out, the demo app that comes with it is written in ErlyWeb. The Facebook stuff itself, though, could easily be used from any Erlang program. Drop me a note if you do end up using it - I love hearing about what that code is up to. -Bryan From rvirding@REDACTED Fri Jan 4 16:30:56 2008 From: rvirding@REDACTED (Robert Virding) Date: Fri, 4 Jan 2008 16:30:56 +0100 Subject: [erlang-questions] Directly matching record fields illegal? In-Reply-To: <20071231021326.GB773@h216-235-12-173.host.egate.net> References: <20071231021326.GB773@h216-235-12-173.host.egate.net> Message-ID: <3dbc6d1c0801040730r6bb55734s10cd15aeef23ac95@mail.gmail.com> The formal answer is, of course, that Foo#foo.ref is an expression and the LHS of '=' must be a pattern. '=' is a pattern matching operator, not assignment. The easiest way to understand this is to view '=' as a shorthand for a case expression. What exactly were you trying to do? Set a field in Foo, or test if the ref fields in Foo and Bar are equal? In the second case it should be '==' instead. If it's the first case then you have hit upon the reason why the syntax to modify a field in a record is the way it is. Trying to come up with a way to use '=' directly just does not work without changing the meaning of '=' or have destructive data structures. So if you would like to change a record field using a syntax like: Foo#foo.ref = 5 what would it mean? - Change the 'ref' field of the 'foo' record in Foo to the value 1, i.e. do a destructive update. - Create a new 'foo' record from the one in Foo with the 'ref' field now has value 1 and put the new record in Foo. I.e. change the value of the variable Foo. - Create a new record from the one in Foo and put the value ... . Well where? I.e. change the meaning of '=' for this special case. You could then do Foo1 = Foo#foo.bar = 1 %%Try explaining this (Which is close to what we have today: Foo1 = Foo#foo{bar=1}) So all this means that you need a syntax for an expression which takes a record and returns it with a field which has a new value. Now I agree that the current syntax might not be very good but I have not seen a better alternative which is consistent with the rest of language. By the way, this is exactly the same reason why there isn't a shorter syntax for accessing a tuple element and using it for setting an element with a '=', for example: Tuple{3} and Tuple{3} = new_value We need a set_element for just this reason. Or perhaps Tuple{3=new_value}. :-) It would be consistent. In retrospect it would probably have been better NOT to use '=' as the match operator but have taken something else. '=' is just too deeply ingrained in most programmers as an assignment so many things look strange from that perspective. Just read the beginner's tutorial bloggs when they try to explain this. Yes, it has ALWAYS been this way. Yes, there should probably be more discussion in the documentation about the implications of non-destructive data structures, variables which aren't and their implication on syntax. Robert On 31/12/2007, Vance Shipley wrote: > > This suprised me, has it always been this way? > > 5> Foo#foo.ref = Bar#bar.ref. > ** 1: illegal pattern ** > > 6> F = Foo#foo.ref. > 1 > 7> B = Bar#bar.ref. > 1 > 8> F = B. > 1 > > -- > -Vance > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From als@REDACTED Fri Jan 4 18:19:57 2008 From: als@REDACTED (Anthony Shipman) Date: Sat, 5 Jan 2008 04:19:57 +1100 Subject: [erlang-questions] what can delay init:stop? Message-ID: <200801050419.57997.als@iinet.net.au> When I use init:stop() to terminate a node I sometimes see the beam process still running after the shutdown. Is it possible that something like a loose process or timer can prevent the final termination? -- Anthony Shipman Mamas don't let your babies als@REDACTED grow up to be outsourced. From als@REDACTED Fri Jan 4 18:17:22 2008 From: als@REDACTED (Anthony Shipman) Date: Sat, 5 Jan 2008 04:17:22 +1100 Subject: [erlang-questions] scope of ets table names? Message-ID: <200801050417.22790.als@iinet.net.au> What is the scope of the name of an ets table. Is it the entire node or just the process that created the table? -- Anthony Shipman Mamas don't let your babies als@REDACTED grow up to be outsourced. From dmitrii@REDACTED Fri Jan 4 19:49:20 2008 From: dmitrii@REDACTED (Dmitrii Dimandt) Date: Fri, 4 Jan 2008 20:49:20 +0200 Subject: [erlang-questions] Directly matching record fields illegal? In-Reply-To: <3dbc6d1c0801040730r6bb55734s10cd15aeef23ac95@mail.gmail.com> References: <20071231021326.GB773@h216-235-12-173.host.egate.net> <3dbc6d1c0801040730r6bb55734s10cd15aeef23ac95@mail.gmail.com> Message-ID: > > Foo1 = Foo#foo.bar = 1 %%Try explaining this > > (Which is close to what we have today: Foo1 = Foo#foo{bar=1}) Well, on a side note something like this is actually possible: http://code.google.com/p/recless/ :) From rvirding@REDACTED Sat Jan 5 00:04:46 2008 From: rvirding@REDACTED (Robert Virding) Date: Sat, 5 Jan 2008 00:04:46 +0100 Subject: [erlang-questions] Directly matching record fields illegal? In-Reply-To: References: <20071231021326.GB773@h216-235-12-173.host.egate.net> <3dbc6d1c0801040730r6bb55734s10cd15aeef23ac95@mail.gmail.com> Message-ID: <3dbc6d1c0801041504q48d8a965k3913a48d203b431d@mail.gmail.com> Nice. However, all the examples in the test file only show accessing record fields, not setting them, and the test records have non-overlapping field names. So the general setting syntax problem is yet unsolved. :-) Robert On 04/01/2008, Dmitrii Dimandt wrote: > > > > > Foo1 = Foo#foo.bar = 1 %%Try explaining this > > > > (Which is close to what we have today: Foo1 = Foo#foo{bar=1}) > > Well, on a side note something like this is actually possible: > http://code.google.com/p/recless/ > > :) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aerialbear@REDACTED Sat Jan 5 14:29:15 2008 From: aerialbear@REDACTED (Jim Cook) Date: Sat, 5 Jan 2008 08:29:15 -0500 Subject: [erlang-questions] badrpc, nodedown - newbie question Message-ID: <69fa20eb0801050529v7c9513efked824a4f8f5b4f61@mail.gmail.com> HI everyone: I'm sorry to ask a newbie question but I have run out of ideas, and just don't know what I'm missing. I'm trying to replicate Joe Armstrong's name server example on page 172 of "Programming Erlang", which is my favorite book at the moment :). I've got two PCs: one is running Fedora 8, the other SuSE 9.3. I've used /etc/hosts to configure their names and I've verified that the names ( kodiak.abcd.home and arcturus.abcd.home) work in both directions by pinging and by accessing their httpds via a browser. I start erl on the fedora box (kodiak) with erl -name gandalf -setcookie abc then I start kvs and store some values just like in the book. Local lookups work fine as described on pages 170-172 of the book. Then I switch to the SuSE box (arcturus) and launch erl like this erl -name joe -setcookie abc Breathless with anticipation (well, nearly) I then run rpc:call(gandalf@REDACTED, kvs, lookup, weather). and I get {badrpc, nodedown} I have tried everything I can think of to get the names working including IP addresses and various name combinations. For example I tried starting erl with fully qualified names on both sides, e.g.: erl -name gandalf@REDACTED -setcookie abc etc. Basically I've decided that I just don't understand how erl is doing its name resolution and before I start wading through the code trying to figure it out, I wanted to see if anybody could straighten me out. Thanks in advance for any suggestions. Best, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevin@REDACTED Sat Jan 5 15:31:13 2008 From: kevin@REDACTED (Kevin A. Smith) Date: Sat, 5 Jan 2008 09:31:13 -0500 Subject: [erlang-questions] badrpc, nodedown - newbie question In-Reply-To: <69fa20eb0801050529v7c9513efked824a4f8f5b4f61@mail.gmail.com> References: <69fa20eb0801050529v7c9513efked824a4f8f5b4f61@mail.gmail.com> Message-ID: Try pinging one node from the other before doing the rpc call. I've found that I need to do that so the nodes can find one another. Any result other than the atom 'pong' indicates that the nodes are unable to see each other. For example, to ping the node running on arcturus from kodiak you'd enter: net_adm:ping(joe@REDACTED). --Kevin On Jan 5, 2008, at 8:29 AM, Jim Cook wrote: > HI everyone: > > I'm sorry to ask a newbie question but I have run out of ideas, and > just don't know what I'm missing. > > I'm trying to replicate Joe Armstrong's name server example on page > 172 of "Programming Erlang", which is my favorite book at the > moment :). > > I've got two PCs: one is running Fedora 8, the other SuSE 9.3. I've > used /etc/hosts to configure their names and I've verified that the > names (kodiak.abcd.home and arcturus.abcd.home) work in both > directions by pinging and by accessing their httpds via a browser. > > I start erl on the fedora box (kodiak) with > > erl -name gandalf -setcookie abc > > then I start kvs and store some values just like in the book. Local > lookups work fine as described on pages 170-172 of the book. > > Then I switch to the SuSE box (arcturus) and launch erl like this > > erl -name joe -setcookie abc > > Breathless with anticipation (well, nearly) I then run > > rpc:call( gandalf@REDACTED, kvs, lookup, weather). > > and I get > > {badrpc, nodedown} > > I have tried everything I can think of to get the names working > including IP addresses and various name combinations. > > For example I tried starting erl with fully qualified names on both > sides, e.g.: > > erl -name gandalf@REDACTED -setcookie abc > > etc. > > Basically I've decided that I just don't understand how erl is doing > its name resolution and before I start wading through the code > trying to figure it out, I wanted to see if anybody could straighten > me out. Thanks in advance for any suggestions. > > Best, > Jim > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From zerthurd@REDACTED Sat Jan 5 15:50:35 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Sat, 5 Jan 2008 20:50:35 +0600 Subject: [erlang-questions] Where is file megaco_user.erl? Message-ID: Hello File lib/megaco/src/engine/megaco_user_default.erl contains line: -behaviour(megaco_user). and documentation describes module megaco_user, but I cannot find file megaco_user.erl anywhere. Can you help me? Maxim From jao@REDACTED Sat Jan 5 16:04:48 2008 From: jao@REDACTED (Jack Orenstein) Date: Sat, 5 Jan 2008 10:04:48 -0500 Subject: [erlang-questions] badrpc, nodedown - newbie question In-Reply-To: <69fa20eb0801050529v7c9513efked824a4f8f5b4f61@mail.gmail.com> References: <69fa20eb0801050529v7c9513efked824a4f8f5b4f61@mail.gmail.com> Message-ID: <83C1671A-77AD-4811-BA1B-6DA82E67303E@geophile.com> On Jan 5, 2008, at 8:29 AM, Jim Cook wrote: > erl -name gandalf -setcookie abc > ... > erl -name joe -setcookie abc > > ... > > rpc:call( gandalf@REDACTED, kvs, lookup, weather). > > and I get > > {badrpc, nodedown} > > I have tried everything I can think of to get the names working > including IP addresses and various name combinations. > > For example I tried starting erl with fully qualified names on both > sides, e.g.: > > erl -name gandalf@REDACTED -setcookie abc On each node, run "node()" to make sure that you are using the correct node name. And as Kevin Smith suggested, try net_adm:ping. Jack Orenstein From aerialbear@REDACTED Sat Jan 5 16:25:04 2008 From: aerialbear@REDACTED (Jim Cook) Date: Sat, 5 Jan 2008 10:25:04 -0500 Subject: [erlang-questions] badrpc, nodedown - newbie question In-Reply-To: References: <69fa20eb0801050529v7c9513efked824a4f8f5b4f61@mail.gmail.com> Message-ID: <69fa20eb0801050725i465bcf74q14bea5d7af1b605a@mail.gmail.com> Kevin, Jack: Thanks for the suggestions. node() returns the expected names on both nodes gandalf@REDACTED joe@REDACTED but the net_adm:ping command returns the atom 'pang' for both nodes. How do I find out what that means? I will search the ref manual, but all suggestions are greatly appreciated. Thanks for the help! Jim On Jan 5, 2008 9:31 AM, Kevin A. Smith wrote: > Try pinging one node from the other before doing the rpc call. I've > found that I need to do that so the nodes can find one another. Any > result other than the atom 'pong' indicates that the nodes are unable > to see each other. > > For example, to ping the node running on arcturus from kodiak you'd > enter: > > net_adm:ping(joe@REDACTED). > > --Kevin > On Jan 5, 2008, at 8:29 AM, Jim Cook wrote: > > > HI everyone: > > > > I'm sorry to ask a newbie question but I have run out of ideas, and > > just don't know what I'm missing. > > > > I'm trying to replicate Joe Armstrong's name server example on page > > 172 of "Programming Erlang", which is my favorite book at the > > moment :). > > > > I've got two PCs: one is running Fedora 8, the other SuSE 9.3. I've > > used /etc/hosts to configure their names and I've verified that the > > names (kodiak.abcd.home and arcturus.abcd.home) work in both > > directions by pinging and by accessing their httpds via a browser. > > > > I start erl on the fedora box (kodiak) with > > > > erl -name gandalf -setcookie abc > > > > then I start kvs and store some values just like in the book. Local > > lookups work fine as described on pages 170-172 of the book. > > > > Then I switch to the SuSE box (arcturus) and launch erl like this > > > > erl -name joe -setcookie abc > > > > Breathless with anticipation (well, nearly) I then run > > > > rpc:call( gandalf@REDACTED, kvs, lookup, weather). > > > > and I get > > > > {badrpc, nodedown} > > > > I have tried everything I can think of to get the names working > > including IP addresses and various name combinations. > > > > For example I tried starting erl with fully qualified names on both > > sides, e.g.: > > > > erl -name gandalf@REDACTED -setcookie abc > > > > etc. > > > > Basically I've decided that I just don't understand how erl is doing > > its name resolution and before I start wading through the code > > trying to figure it out, I wanted to see if anybody could straighten > > me out. Thanks in advance for any suggestions. > > > > Best, > > Jim > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jao@REDACTED Sat Jan 5 16:43:20 2008 From: jao@REDACTED (Jack Orenstein) Date: Sat, 5 Jan 2008 10:43:20 -0500 Subject: [erlang-questions] badrpc, nodedown - newbie question In-Reply-To: <69fa20eb0801050725i465bcf74q14bea5d7af1b605a@mail.gmail.com> References: <69fa20eb0801050529v7c9513efked824a4f8f5b4f61@mail.gmail.com> <69fa20eb0801050725i465bcf74q14bea5d7af1b605a@mail.gmail.com> Message-ID: <15234C36-D390-4FB0-A658-F6188E3F33EC@geophile.com> On Jan 5, 2008, at 10:25 AM, Jim Cook wrote: > Kevin, Jack: > > Thanks for the suggestions. node() returns the expected names on > both nodes > > gandalf@REDACTED > joe@REDACTED > > but the net_adm:ping command returns the atom 'pang' for both > nodes. How do I find out what that means? I will search the ref > manual, but all suggestions are greatly appreciated. Does the ping work if you run both nodes on the same host? Jack From kevin@REDACTED Sat Jan 5 16:53:45 2008 From: kevin@REDACTED (Kevin A. Smith) Date: Sat, 5 Jan 2008 10:53:45 -0500 Subject: [erlang-questions] badrpc, nodedown - newbie question In-Reply-To: <69fa20eb0801050725i465bcf74q14bea5d7af1b605a@mail.gmail.com> References: <69fa20eb0801050529v7c9513efked824a4f8f5b4f61@mail.gmail.com> <69fa20eb0801050725i465bcf74q14bea5d7af1b605a@mail.gmail.com> Message-ID: Can you ping one host from the other using the same host names you use inside the Erlang repl? Whenever I've gotten a 'pang' (which I think is Swedish for bang - ha ha) it means that I've either got the wrong node name or the hosts cannot see each other. --Kevin On Jan 5, 2008, at 10:25 AM, Jim Cook wrote: > Kevin, Jack: > > Thanks for the suggestions. node() returns the expected names on > both nodes > > gandalf@REDACTED > joe@REDACTED > > but the net_adm:ping command returns the atom 'pang' for both nodes. > How do I find out what that means? I will search the ref manual, but > all suggestions are greatly appreciated. > > Thanks for the help! > Jim > > > On Jan 5, 2008 9:31 AM, Kevin A. Smith > wrote: > Try pinging one node from the other before doing the rpc call. I've > found that I need to do that so the nodes can find one another. Any > result other than the atom 'pong' indicates that the nodes are unable > to see each other. > > For example, to ping the node running on arcturus from kodiak you'd > enter: > > net_adm:ping(joe@REDACTED). > > --Kevin > On Jan 5, 2008, at 8:29 AM, Jim Cook wrote: > > > HI everyone: > > > > I'm sorry to ask a newbie question but I have run out of ideas, and > > just don't know what I'm missing. > > > > I'm trying to replicate Joe Armstrong's name server example on page > > 172 of "Programming Erlang", which is my favorite book at the > > moment :). > > > > I've got two PCs: one is running Fedora 8, the other SuSE 9.3. I've > > used /etc/hosts to configure their names and I've verified that the > > names (kodiak.abcd.home and arcturus.abcd.home) work in both > > directions by pinging and by accessing their httpds via a browser. > > > > I start erl on the fedora box (kodiak) with > > > > erl -name gandalf -setcookie abc > > > > then I start kvs and store some values just like in the book. Local > > lookups work fine as described on pages 170-172 of the book. > > > > Then I switch to the SuSE box (arcturus) and launch erl like this > > > > erl -name joe -setcookie abc > > > > Breathless with anticipation (well, nearly) I then run > > > > rpc:call( gandalf@REDACTED, kvs, lookup, weather). > > > > and I get > > > > {badrpc, nodedown} > > > > I have tried everything I can think of to get the names working > > including IP addresses and various name combinations. > > > > For example I tried starting erl with fully qualified names on both > > sides, e.g.: > > > > erl -name gandalf@REDACTED -setcookie abc > > > > etc. > > > > Basically I've decided that I just don't understand how erl is doing > > its name resolution and before I start wading through the code > > trying to figure it out, I wanted to see if anybody could straighten > > me out. Thanks in advance for any suggestions. > > > > Best, > > Jim > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > From aerialbear@REDACTED Sat Jan 5 17:06:56 2008 From: aerialbear@REDACTED (Jim Cook) Date: Sat, 5 Jan 2008 11:06:56 -0500 Subject: [erlang-questions] badrpc, nodedown - newbie question In-Reply-To: References: <69fa20eb0801050529v7c9513efked824a4f8f5b4f61@mail.gmail.com> <69fa20eb0801050725i465bcf74q14bea5d7af1b605a@mail.gmail.com> Message-ID: <69fa20eb0801050806y704f933xca4c58b7499c84d6@mail.gmail.com> Kevin: I'm not sure what you mean by "Erlang repl" - see below... Hack: I can ping from different nodes on the same host but only if I use localhost.localdomain So I set up: erl -name gandalf -setcookie abc erl -name pippin -etcookie abc and I can ping with: net_adm:ping( gandalf@REDACTED). I notice that if I run inet_db:res_option(lookup). I get back [native] also if I run (from kodiak) inet(gethostbyname(arcturus.abcd.home). I get back the correct IP. On Jan 5, 2008 10:53 AM, Kevin A. Smith < kevin@REDACTED> wrote: > Can you ping one host from the other using the same host names you use > inside the Erlang repl? Whenever I've gotten a 'pang' (which I think > is Swedish for bang - ha ha) it means that I've either got the wrong > node name or the hosts cannot see each other. > > --Kevin > On Jan 5, 2008, at 10:25 AM, Jim Cook wrote: > > > Kevin, Jack: > > > > Thanks for the suggestions. node() returns the expected names on > > both nodes > > > > gandalf@REDACTED > > joe@REDACTED > > > > but the net_adm:ping command returns the atom 'pang' for both nodes. > > How do I find out what that means? I will search the ref manual, but > > all suggestions are greatly appreciated. > > > > Thanks for the help! > > Jim > > > > > > On Jan 5, 2008 9:31 AM, Kevin A. Smith < kevin@REDACTED> > > wrote: > > Try pinging one node from the other before doing the rpc call. I've > > found that I need to do that so the nodes can find one another. Any > > result other than the atom 'pong' indicates that the nodes are unable > > to see each other. > > > > For example, to ping the node running on arcturus from kodiak you'd > > enter: > > > > net_adm:ping(joe@REDACTED). > > > > --Kevin > > On Jan 5, 2008, at 8:29 AM, Jim Cook wrote: > > > > > HI everyone: > > > > > > I'm sorry to ask a newbie question but I have run out of ideas, and > > > just don't know what I'm missing. > > > > > > I'm trying to replicate Joe Armstrong's name server example on page > > > 172 of "Programming Erlang", which is my favorite book at the > > > moment :). > > > > > > I've got two PCs: one is running Fedora 8, the other SuSE 9.3. I've > > > used /etc/hosts to configure their names and I've verified that the > > > names ( kodiak.abcd.home and arcturus.abcd.home) work in both > > > directions by pinging and by accessing their httpds via a browser. > > > > > > I start erl on the fedora box (kodiak) with > > > > > > erl -name gandalf -setcookie abc > > > > > > then I start kvs and store some values just like in the book. Local > > > lookups work fine as described on pages 170-172 of the book. > > > > > > Then I switch to the SuSE box (arcturus) and launch erl like this > > > > > > erl -name joe -setcookie abc > > > > > > Breathless with anticipation (well, nearly) I then run > > > > > > rpc:call( gandalf@REDACTED , kvs, lookup, weather). > > > > > > and I get > > > > > > {badrpc, nodedown} > > > > > > I have tried everything I can think of to get the names working > > > including IP addresses and various name combinations. > > > > > > For example I tried starting erl with fully qualified names on both > > > sides, e.g.: > > > > > > erl -name gandalf@REDACTED -setcookie abc > > > > > > etc. > > > > > > Basically I've decided that I just don't understand how erl is doing > > > its name resolution and before I start wading through the code > > > trying to figure it out, I wanted to see if anybody could straighten > > > me out. Thanks in advance for any suggestions. > > > > > > Best, > > > Jim > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david_holz@REDACTED Fri Jan 4 19:10:15 2008 From: david_holz@REDACTED (David Holz) Date: Fri, 4 Jan 2008 18:10:15 +0000 Subject: [erlang-questions] working with sets In-Reply-To: <20080103220849.GB11993@Little-Black-Book.local> References: <20080103220849.GB11993@Little-Black-Book.local> Message-ID: From: vances@REDACTED > Can one of you CS wizzes point me at the best way to > maintain a set of sets where all elements of all sets > must be unique? I don't need a really big data set > but rolling my own with the list module feels wrong. > > For example {{1,2,3},{4,5,6},{7,8,9}} is a valid set. > Trying to enter {9,10,11} should fail. I might base it on a dict, mapping a value to which set number (or name, or whatever) it's in. That way a value only points to a single set at a time. You could also easily query which set a value is in (or if a value is any set) just by dict:find/2. The data above would map to something like this: dict:from_list([{1,1},{2,1},{3,1},{4,2},{5,2},{6,2},{7,3},{8,3},{9,3}]). Adding a new set would require getting the next set ID, then adding each element as a key with the ID as the value. If a key already exists, (like the 9 in adding [9,10,11] (I'd say use lists [] instead of tuples {} for this)) then the insert fails. To retrieve a set by its ID, you could use dict:fold( , [], SetDictThing ). I think it would do everything you want, though there's a lot of iteration in terms of runtime speed. The dict does support your notion of enforcing a single instance per value which is why I thought of this, but it might end up that doing your own list-based checks might be shorter code. It also depends on where you want to optimize your runtime speed. The dict-based one lets you do checks very quickly, but the fetch/store of sets might be slower. _________________________________________________________________ Put your friends on the big screen with Windows Vista? + Windows Live?. http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_012008 From david_holz@REDACTED Sat Jan 5 20:37:39 2008 From: david_holz@REDACTED (David Holz) Date: Sat, 5 Jan 2008 19:37:39 +0000 Subject: [erlang-questions] Wrong link in documentation Message-ID: A quick thing here. In the Erlang Reference Manual on the website, the ToC points chapter 12 (Compilation and Code Loading) to man/code.html instead of reference_manual/code.html. _________________________________________________________________ Share life as it happens with the new Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008 From aerialbear@REDACTED Sun Jan 6 01:10:51 2008 From: aerialbear@REDACTED (Jim Cook) Date: Sat, 5 Jan 2008 19:10:51 -0500 Subject: [erlang-questions] badrpc, nodedown - newbie question In-Reply-To: <69fa20eb0801050806y704f933xca4c58b7499c84d6@mail.gmail.com> References: <69fa20eb0801050529v7c9513efked824a4f8f5b4f61@mail.gmail.com> <69fa20eb0801050725i465bcf74q14bea5d7af1b605a@mail.gmail.com> <69fa20eb0801050806y704f933xca4c58b7499c84d6@mail.gmail.com> Message-ID: <69fa20eb0801051610n633b1a91s66d707b744a8f18f@mail.gmail.com> Kevin, Jack: Thanks - I fixed it. It was an annoying combination of /etc/hosts, /etc/resolv.conf and my firewalls. Nothing to do with erlang really, but your suggestions were key in getting me to see what was going on. :) Best, Jim On Jan 5, 2008 11:06 AM, Jim Cook wrote: > Kevin: I'm not sure what you mean by "Erlang repl" - see below... > > Hack: I can ping from different nodes on the same host but only if I use > localhost.localdomain > > So I set up: > > erl -name gandalf -setcookie abc > erl -name pippin -etcookie abc > > and I can ping with: > > net_adm:ping( gandalf@REDACTED). > > I notice that if I run > > inet_db:res_option(lookup). > > I get back [native] > > also if I run (from kodiak) > > inet(gethostbyname(arcturus.abcd.home). > > I get back the correct IP. > > > > On Jan 5, 2008 10:53 AM, Kevin A. Smith < kevin@REDACTED> > wrote: > > > Can you ping one host from the other using the same host names you use > > inside the Erlang repl? Whenever I've gotten a 'pang' (which I think > > is Swedish for bang - ha ha) it means that I've either got the wrong > > node name or the hosts cannot see each other. > > > > --Kevin > > On Jan 5, 2008, at 10:25 AM, Jim Cook wrote: > > > > > Kevin, Jack: > > > > > > Thanks for the suggestions. node() returns the expected names on > > > both nodes > > > > > > gandalf@REDACTED > > > joe@REDACTED > > > > > > but the net_adm:ping command returns the atom 'pang' for both nodes. > > > How do I find out what that means? I will search the ref manual, but > > > all suggestions are greatly appreciated. > > > > > > Thanks for the help! > > > Jim > > > > > > > > > On Jan 5, 2008 9:31 AM, Kevin A. Smith < kevin@REDACTED> > > > wrote: > > > Try pinging one node from the other before doing the rpc call. I've > > > found that I need to do that so the nodes can find one another. Any > > > result other than the atom 'pong' indicates that the nodes are unable > > > to see each other. > > > > > > For example, to ping the node running on arcturus from kodiak you'd > > > enter: > > > > > > net_adm:ping(joe@REDACTED). > > > > > > --Kevin > > > On Jan 5, 2008, at 8:29 AM, Jim Cook wrote: > > > > > > > HI everyone: > > > > > > > > I'm sorry to ask a newbie question but I have run out of ideas, and > > > > just don't know what I'm missing. > > > > > > > > I'm trying to replicate Joe Armstrong's name server example on page > > > > 172 of "Programming Erlang", which is my favorite book at the > > > > moment :). > > > > > > > > I've got two PCs: one is running Fedora 8, the other SuSE 9.3. I've > > > > used /etc/hosts to configure their names and I've verified that the > > > > names ( kodiak.abcd.home and arcturus.abcd.home) work in both > > > > directions by pinging and by accessing their httpds via a browser. > > > > > > > > I start erl on the fedora box (kodiak) with > > > > > > > > erl -name gandalf -setcookie abc > > > > > > > > then I start kvs and store some values just like in the book. Local > > > > lookups work fine as described on pages 170-172 of the book. > > > > > > > > Then I switch to the SuSE box (arcturus) and launch erl like this > > > > > > > > erl -name joe -setcookie abc > > > > > > > > Breathless with anticipation (well, nearly) I then run > > > > > > > > rpc:call( gandalf@REDACTED , kvs, lookup, weather). > > > > > > > > and I get > > > > > > > > {badrpc, nodedown} > > > > > > > > I have tried everything I can think of to get the names working > > > > including IP addresses and various name combinations. > > > > > > > > For example I tried starting erl with fully qualified names on both > > > > sides, e.g.: > > > > > > > > erl -name gandalf@REDACTED -setcookie abc > > > > > > > > etc. > > > > > > > > Basically I've decided that I just don't understand how erl is doing > > > > its name resolution and before I start wading through the code > > > > trying to figure it out, I wanted to see if anybody could straighten > > > > me out. Thanks in advance for any suggestions. > > > > > > > > Best, > > > > Jim > > > > > > > > _______________________________________________ > > > > erlang-questions mailing list > > > > erlang-questions@REDACTED > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From arturmatos78@REDACTED Sun Jan 6 14:10:07 2008 From: arturmatos78@REDACTED (Artur Matos) Date: Sun, 6 Jan 2008 22:10:07 +0900 Subject: [erlang-questions] How: jinterface nodes cannot connect to epmd in Mac OS X Message-ID: <60CABD1A-61BB-46B6-80ED-2DD99204FA8A@gmail.com> Hi to all, I am currently creating a program made of several Erlang nodes and jinterface nodes, all running on the same machine. I am having some serious issues making them connect to each other, and I was hoping some one could help me. I am using short names, and running Erlang 11b-5-1 on Mac OS X 10.4.11 (client version). In a nutshell, my Erlang and jinterface nodes are able to communicate only when I am not connected to the internet. If I connect to the internet and start the nodes again, they are not able to talk anymore. The Erlang nodes still run and can connect to epmd, but cannot send or receive messages from each other. As for the jinterface nodes, they all crash with a java.IO.Exception, complaining that the nameserver is not responding (e.g, "Nameserver not responding on Mortimer when publishing time"). After some googling, I've found out that Mac OS X changes the host name and domain dynamically according to current "connection" in the machine ("connection" in Mac OS being just a bunch of settings that defines how to connect to the internet - for instance, the DHCP server, username, password and so on). So if I am not connected to the internet, my host name will be Mortimer.local, and all works; but if I connect, my domain name becomes whatever my ISP's DHCP server sends to my machine (for instance Mortimer@REDACTED), and that seems to interfere with Erlang name resolution. I was able to force Mac OS not to change my host name anymore, by editing an entry in /etc/hostconfig. This fixed my Erlang nodes, and now they can talk even if I am connected to the internet. Unfortunately, this didn't fix the jinterface nodes, and they still crash with the same exception whenever I am connected. Does anyone has any idea of how I could fix this? As a reference, this is the Java code I am using to connect: OtpNode node = new OtpNode("time"); OtpMbox mbox = node.createMbox("server"); OtpEpmd.publishPort(node); Thanks, Artur From gamagenuwan2003@REDACTED Sun Jan 6 21:00:02 2008 From: gamagenuwan2003@REDACTED (Nuwan Gamage) Date: Sun, 6 Jan 2008 20:00:02 +0000 (GMT) Subject: [erlang-questions] Real time system Message-ID: <638474.75479.qm@web32702.mail.mud.yahoo.com> Hi, I want to know, how to program real time data processing system no7 signalling process system using "Erlang" How can I begin this pls guide me. (Is there any better interface with "Erlang" to show view above program pls specify how to create interface also) I wish to communicate with you through out my process continuously. Thanks Nuwan Send instant messages to your online friends http://uk.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob@REDACTED Sun Jan 6 22:17:00 2008 From: bob@REDACTED (Bob Cowdery) Date: Sun, 06 Jan 2008 21:17:00 +0000 Subject: [erlang-questions] wxErlang In-Reply-To: <9F2DB736-551B-413D-A2AD-1661681895E2@gol.com> References: <1199315976.5559.38.camel@ubuntu-life-vm> <7998EA64-00C8-4421-9103-FB3AB8A926FA@gol.com> <9F2DB736-551B-413D-A2AD-1661681895E2@gol.com> Message-ID: <1199654220.5542.10.camel@ubuntu-life-vm> Hi John Thanks. I've got around the issue for now by just emulating a toggle button. I have a stopper issue at the moment if you or anyone else can help it would be much appreciated. I can't get wxFont to work at all. If I use: wxFont:new(24, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL). it gives me 'no function clause defined' because weight is actually defined as an integer. If I give it 90 which I believe is wxFONTWEIGHT_NORMAL according to the defs.h I get 'invalid arg'. I get other errors with the other :new functions. None seem to work. Any ideas? Bob On Fri, 2008-01-04 at 16:11 +0900, John Webb wrote: > On Jan 4, 2008, at 9:43 AM, John Webb wrote: > > > Hi Bob, > > > > On Jan 3, 2008, at 8:19 AM, Bob Cowdery wrote: > > > >> I have a couple of small issues with wxErlang. In general it is > >> working > >> great so far. > >> > >> 1. I can't get any events to fire off a wxToggleButton. As far as I > >> remember this behaves like a check box but neither > >> command_button_clicked nor command_checkbox_clicked fire. Is there > >> some > >> other event I should be looking at. > > > > wxToggleButton generates a wxEVT_COMMAND_TOGGLEBUTTON_CLICKED event > > when clicked; I haven't looked at wxErlang but I am guessing that > > there is a command_togglebutton_clicked event somewhere... > > Ah, guessed wrong again... for whatever reason the event is commented > out in api_gen/wxapi.conf in the source distribution. > > Uncommenting the event and regenerating the API might give you the > event but I'm guessing again because so far I've not been able to > build successfully on my MacBook :( > > > > > > > > >> > >> 2. This is a bit obscure and I'm not sure if it's a wxWidgets issue. > >> If > >> I place a checkbox in the first cell of a wxGridSizer the click area > >> appears over the label and not the box, which also has a white band > >> underneath it. > > > > Sorry, No idea about this one. > > > > Regards, > > John > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > From igwan@REDACTED Mon Jan 7 01:41:16 2008 From: igwan@REDACTED (igwan) Date: Mon, 07 Jan 2008 01:41:16 +0100 Subject: [erlang-questions] Real time system In-Reply-To: <638474.75479.qm@web32702.mail.mud.yahoo.com> References: <638474.75479.qm@web32702.mail.mud.yahoo.com> Message-ID: <4781752C.40108@free.fr> Nuwan Gamage a ?crit : > Hi, > I want to know, how to program real time data processing system > > no7 signalling process system using "Erlang" > > How can I begin this pls guide me. > (Is there any better interface with "Erlang" to show view above program > pls specify how to create interface also) > > I wish to communicate with you through out my process continuously. > Thanks > Nuwan Hi, Erlang is a perfect match for telecom signalling, you've come to the right place :) It all depends on what you want to do with these signalling messages. Are you implementing a call server (a switch) ? A SS7 probe ? A gateway ? Regarding interfaces, Erlang does SCTP/IP, so you can process SS7 tunneled into M2UA/M3UA. If you're going to have hardware trunk cards directly into your system, you'll need glue code to communicate with your Erlang node, there is a number of ways to do (ports, C nodes, linked-in drivers), look into the "Interoperability" section of the documentation. Erlang also has a MEGACO/H.248 library for controlling a media gateway. As for the application itself, Erlang is about decomposing your system into processes (truly concurrent activities). For example, in the case of a switch, a call through it would be modelled as one or a group of FSMs (look into the documentation for the gen_fsm behaviour, there's a example of modelling POTS, altough simplistic). You would also have a process for each trunk or termination to manage physical resources... If you're new to Erlang, I advise you read Joe Armstrong's book to get started, then look into OTP behaviours and interoperability. You would then have a better idea where to go from there. -- igwan From travis.jensen@REDACTED Mon Jan 7 07:28:38 2008 From: travis.jensen@REDACTED (Travis Jensen) Date: Sun, 6 Jan 2008 23:28:38 -0700 Subject: [erlang-questions] Securely running code on an untrusted client Message-ID: <3605cb0801062228j5e791b7cme34dc5cc68fb575b@mail.gmail.com> I've been looking around online and haven't seen anything to contradict what I assume to be the case, but I'm unfamiliar enough with Erlang that I figure I should ask. Assuming I have a server on one system and a client on another system that exists out somewhere else in the broad, scary internet. The server is trusted, the client is not. The network connection between the two is not trusted. Is there any way to run trusted code on the client? Now, once you get up from laughing... :) Thanks. tj -- Travis Jensen travis.jensen@REDACTED http://softwaremaven.innerbrain.com/ Software Maven * Philosopher-in-Training * Avenged Nerd -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.wiger@REDACTED Mon Jan 7 08:01:35 2008 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Mon, 07 Jan 2008 08:01:35 +0100 Subject: [erlang-questions] Securely running code on an untrusted client In-Reply-To: <3605cb0801062228j5e791b7cme34dc5cc68fb575b@mail.gmail.com> References: <3605cb0801062228j5e791b7cme34dc5cc68fb575b@mail.gmail.com> Message-ID: <4781CE4F.3060507@ericsson.com> Travis Jensen skrev: > I've been looking around online and haven't seen anything to contradict > what I assume to be the case, but I'm unfamiliar enough with Erlang that > I figure I should ask. > > Assuming I have a server on one system and a client on another system > that exists out somewhere else in the broad, scary internet. The server > is trusted, the client is not. The network connection between the two > is not trusted. > > Is there any way to run trusted code on the client? As far as I know, the closest you will get right now with Erlang is ErlHive. http://erlhive.sourceforge.net/ ErlHive is sort of presented as a web application development framework, but is really mainly a multi-user back-end with safe code execution. It happens to have a front-end application which hooks into Yaws, and enables user authentication via HTTP. ErlHive is able to compile modules from source, or interpret erlang expressions. It forbids operations that are not known to be safe, but also offers safe alternatives to many operations that normally wouldn't be: a virtual file system, process spawning, send & receive, ets tables, etc. All code runs inside mnesia transactions. BR, Ulf W From bertil.karlsson@REDACTED Mon Jan 7 08:43:19 2008 From: bertil.karlsson@REDACTED (Bertil Karlsson) Date: Mon, 07 Jan 2008 08:43:19 +0100 Subject: [erlang-questions] Exception in xmerl, when pasing XML with non UTF8 character set In-Reply-To: <14588326.post@talk.nabble.com> References: <14588326.post@talk.nabble.com> Message-ID: <4781D817.8090203@ericsson.com> If I'm right windows-1252 uses its own conversion table that doesn't exist in xmerl today. Just changing the encoding to something that seems to work may cause trouble when it comes to those characters that differs. It is not difficult to add the changes needed to xmerl, but I cannot promise it into the next release. /Bertil Zvi wrote: > 3> { Xml, _Rest } = xmerl_scan:file(ResultIdx). > ** exception exit: {bad_character_code, > " "http://www.xxx.com/yyy.dtd\">\n\n\naaa\n\n", > 'windows-1252'} > in function xmerl_ucs:to_unicode/2 > in call from xmerl_scan:scan_document/2 > in call from xmerl_scan:file/2 > > The XML document starts with PI: encoding="windows-1252"?> > It works, after changing it to > > > The problem is that this XML document generated by 3rd party SW, so I would > like to fix xmerl code, or use some xmerl option. > > I using R12B on Windows. > > TIA > > Zvi > > From casper2000a@REDACTED Mon Jan 7 10:22:24 2008 From: casper2000a@REDACTED (Eranga Udesh) Date: Mon, 7 Jan 2008 14:52:24 +0530 Subject: [erlang-questions] Hot code load problem in native module In-Reply-To: <4781D817.8090203@ericsson.com> References: <14588326.post@talk.nabble.com> <4781D817.8090203@ericsson.com> Message-ID: <003101c8510e$cffd11c0$6ff73540$@com> Hi, Is there a greater tendency to terminate an OTP complaint running process (eg. gen_server) in Hot code update (code:softpurge/1, code:load_file/1), when compiled natively? I am experiencing this in all the versions of Erlang. BRgds, - Eranga From mats.cronqvist@REDACTED Mon Jan 7 10:31:56 2008 From: mats.cronqvist@REDACTED (mats cronqvist) Date: Mon, 07 Jan 2008 10:31:56 +0100 Subject: [erlang-questions] graphs and trees In-Reply-To: References: <1198140688.28499.129.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> Message-ID: <1199698316.28499.141.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> On Tue, 2008-01-01 at 22:11 +0100, Torben Hoffmann wrote: > > > On Dec 20, 2007 9:51 AM, mats cronqvist > wrote: > is there some snazzy graph theory trick to show that a graph > is indeed a tree? > > > Sorry for the late addition to the discussion (vacation clean-up of > mailbox), but the Wikipedia article about Trees defines exactly the > conditions for when a graph is indeed a tree: > http://en.wikipedia.org/wiki/Tree_(graph_theory) > > Which approach that is the fastest depends on how the digraph module > represents grahps - I have not had the courage to peek inside... wikipedia, eh? the 21st century rtfm... mats From bengt.kleberg@REDACTED Mon Jan 7 10:11:11 2008 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 07 Jan 2008 10:11:11 +0100 Subject: [erlang-questions] scope of ets table names? In-Reply-To: <200801050417.22790.als@iinet.net.au> References: <200801050417.22790.als@iinet.net.au> Message-ID: <4781ECAF.3000208@ericsson.com> greetings, a named ets table is accessible from all processes on the node. bengt Those were the days... EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." On 01/04/08 18:17, Anthony Shipman wrote: > What is the scope of the name of an ets table. Is it the entire node or just > the process that created the table? > From dgud@REDACTED Mon Jan 7 10:28:12 2008 From: dgud@REDACTED (Dan Gudmundsson) Date: Mon, 07 Jan 2008 10:28:12 +0100 Subject: [erlang-questions] wxErlang In-Reply-To: <1199654220.5542.10.camel@ubuntu-life-vm> References: <1199315976.5559.38.camel@ubuntu-life-vm> <7998EA64-00C8-4421-9103-FB3AB8A926FA@gol.com> <9F2DB736-551B-413D-A2AD-1661681895E2@gol.com> <1199654220.5542.10.camel@ubuntu-life-vm> Message-ID: <4781F0AC.5000809@erix.ericsson.se> The last one is fixed on sourceforce, and in the erlang parts so you should be able to check it out and rebuild the beams. It should be wxFont:new(24, ?wxFONTFAMILY_SWISS, ?wxFONTSTYLE_NORMAL, ?wxFONTWEIGHT_NORMAL). But I messed up the guards and documentation sorry. I also messed up colors badly which is also fixed in svn repos. I'll have a look at the toggle button issue, I don't have a clue about checkbox. Thanks for the feedback guys, appreciated. It should build on Mac i.e. it does for me, api generation requires the GTK headers but it you download them and point them out with it should work on the Mac. cd api_gen make WXGTK_DIR=/wxWidgets-2.8.5/include /Dan Bob Cowdery wrote: > Hi John > > Thanks. I've got around the issue for now by just emulating a toggle > button. > > I have a stopper issue at the moment if you or anyone else can help it > would be much appreciated. > > I can't get wxFont to work at all. If I use: > > wxFont:new(24, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, > wxFONTWEIGHT_NORMAL). > > it gives me 'no function clause defined' because weight is actually > defined as an integer. If I give it 90 which I believe is > wxFONTWEIGHT_NORMAL according to the defs.h I get 'invalid arg'. I get > other errors with the other :new functions. None seem to work. > > Any ideas? > > Bob > > > On Fri, 2008-01-04 at 16:11 +0900, John Webb wrote: >> On Jan 4, 2008, at 9:43 AM, John Webb wrote: >> >>> Hi Bob, >>> >>> On Jan 3, 2008, at 8:19 AM, Bob Cowdery wrote: >>> >>>> I have a couple of small issues with wxErlang. In general it is >>>> working >>>> great so far. >>>> >>>> 1. I can't get any events to fire off a wxToggleButton. As far as I >>>> remember this behaves like a check box but neither >>>> command_button_clicked nor command_checkbox_clicked fire. Is there >>>> some >>>> other event I should be looking at. >>> wxToggleButton generates a wxEVT_COMMAND_TOGGLEBUTTON_CLICKED event >>> when clicked; I haven't looked at wxErlang but I am guessing that >>> there is a command_togglebutton_clicked event somewhere... >> Ah, guessed wrong again... for whatever reason the event is commented >> out in api_gen/wxapi.conf in the source distribution. >> >> Uncommenting the event and regenerating the API might give you the >> event but I'm guessing again because so far I've not been able to >> build successfully on my MacBook :( >> >>> >>> >>>> 2. This is a bit obscure and I'm not sure if it's a wxWidgets issue. >>>> If >>>> I place a checkbox in the first cell of a wxGridSizer the click area >>>> appears over the label and not the box, which also has a white band >>>> underneath it. >>> Sorry, No idea about this one. >>> >>> Regards, >>> John >>> >>> _______________________________________________ >>> 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 mats.cronqvist@REDACTED Mon Jan 7 10:59:46 2008 From: mats.cronqvist@REDACTED (mats cronqvist) Date: Mon, 07 Jan 2008 10:59:46 +0100 Subject: [erlang-questions] program: wxWidgets for erlang (again) In-Reply-To: <476A8B5E.8080000@erix.ericsson.se> References: <4684C2D6.7010707@erix.ericsson.se> <4684F78A.9010202@gmail.com> <468504CD.2080506@erix.ericsson.se> <476A8B5E.8080000@erix.ericsson.se> Message-ID: <1199699986.28499.153.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> On Thu, 2007-12-20 at 16:33 +0100, Dan Gudmundsson wrote: > Hi > > I've made a new beta release: see wxerlang.sf.net > > It requires R12B and wxWidgets-2.8. > (which is statically linked in the pre-built version for mac and windows) > > Windows is now working, Solaris-10, Mac and Linux is also working!! > > I've added support for xrc and a demo, which is wxwidgets support for > gui-builders, are you happy now Mats? happy happy joy joy. seriously, xrc looks pretty excellent. i'll try porting some of my gtknode stuff as soon as i get on a sensible machine. are you developing it at sourceforge? mats From dgud@REDACTED Mon Jan 7 11:14:18 2008 From: dgud@REDACTED (Dan Gudmundsson) Date: Mon, 07 Jan 2008 11:14:18 +0100 Subject: [erlang-questions] program: wxWidgets for erlang (again) In-Reply-To: <1199699986.28499.153.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> References: <4684C2D6.7010707@erix.ericsson.se> <4684F78A.9010202@gmail.com> <468504CD.2080506@erix.ericsson.se> <476A8B5E.8080000@erix.ericsson.se> <1199699986.28499.153.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> Message-ID: <4781FB7A.5080506@erix.ericsson.se> mats cronqvist wrote: > On Thu, 2007-12-20 at 16:33 +0100, Dan Gudmundsson wrote: >> Hi >> >> I've made a new beta release: see wxerlang.sf.net >> >> It requires R12B and wxWidgets-2.8. >> (which is statically linked in the pre-built version for mac and windows) >> >> Windows is now working, Solaris-10, Mac and Linux is also working!! >> >> I've added support for xrc and a demo, which is wxwidgets support for >> gui-builders, are you happy now Mats? > > happy happy joy joy. > seriously, xrc looks pretty excellent. i'll try porting some of my > gtknode stuff as soon as i get on a sensible machine. > are you developing it at sourceforge? > I use the svn repositories there, nothing else currently. It was easier for me to use erlang.org as release download site, can't ftp upload releases to sf from inside ericsson where I have access to a mac. The wx gui builders (I guess havn't actually tested) are not in the same league as GTK ones. /Dan > mats > From mats.cronqvist@REDACTED Mon Jan 7 13:04:28 2008 From: mats.cronqvist@REDACTED (mats cronqvist) Date: Mon, 07 Jan 2008 13:04:28 +0100 Subject: [erlang-questions] scope of ets table names? In-Reply-To: <4781ECAF.3000208@ericsson.com> References: <200801050417.22790.als@iinet.net.au> <4781ECAF.3000208@ericsson.com> Message-ID: <1199707468.28499.157.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> On Mon, 2008-01-07 at 10:11 +0100, Bengt Kleberg wrote: > greetings, > > a named ets table is accessible from all processes on the node. no. from the ets manual; new(Name, Options) -> tid() Options = [Option] Option = Type | Access | named_table | {keypos,Pos} Access = public | protected | private * protected The owner process can read and write to the table. Other processes can only read the table. This is the default setting for the access rights. * private Only the owner process can read or write to the table. * public Any process may read or write to the table. mats From ulf.wiger@REDACTED Mon Jan 7 13:20:33 2008 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Mon, 07 Jan 2008 13:20:33 +0100 Subject: [erlang-questions] scope of ets table names? In-Reply-To: <1199707468.28499.157.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> References: <200801050417.22790.als@iinet.net.au> <4781ECAF.3000208@ericsson.com> <1199707468.28499.157.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> Message-ID: <47821911.3070607@ericsson.com> Yes, but the scope of the name is still global (inside the node). Attempts to access the table may give a run-time error depending on its protection settings. BR, Ulf W mats cronqvist skrev: > On Mon, 2008-01-07 at 10:11 +0100, Bengt Kleberg wrote: >> greetings, >> >> a named ets table is accessible from all processes on the node. > > no. > from the ets manual; > > new(Name, Options) -> tid() > > Options = [Option] > Option = Type | Access | named_table | {keypos,Pos} > Access = public | protected | private > > > * protected The owner process can read and write to the table. Other > processes can only read the table. This is the default setting for > the access rights. > * private Only the owner process can read or write to the table. > * public Any process may read or write to the table. > > > mats > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From opendev@REDACTED Mon Jan 7 13:30:17 2008 From: opendev@REDACTED (Joern) Date: Mon, 7 Jan 2008 13:30:17 +0100 Subject: [erlang-questions] scope of ets table names? In-Reply-To: <200801050417.22790.als@iinet.net.au> References: <200801050417.22790.als@iinet.net.au> Message-ID: <9e009ad0801070430l65ff1182gfd4c734a79df5748@mail.gmail.com> On Jan 4, 2008 6:17 PM, Anthony Shipman wrote: > What is the scope of the name of an ets table. Is it the entire node or just > the process that created the table? It's lifetime is bound to the creating process. If it's named (the table, not the process) the effective visibility on the node depends only on the access rights. Otherwise you also need to pass a table id around. rgs/joern -- From sean.hinde@REDACTED Mon Jan 7 13:20:32 2008 From: sean.hinde@REDACTED (Sean Hinde) Date: Mon, 7 Jan 2008 12:20:32 +0000 Subject: [erlang-questions] scope of ets table names? In-Reply-To: <200801050417.22790.als@iinet.net.au> References: <200801050417.22790.als@iinet.net.au> Message-ID: <8A46BDB4-784C-4D08-BA7E-09467FFE893A@gmail.com> The scope of the name (i.e. when the named_table option is supplied) is the whole node. Sean On 4 Jan 2008, at 17:17, Anthony Shipman wrote: > What is the scope of the name of an ets table. Is it the entire node > or just > the process that created the table? > > -- > Anthony Shipman Mamas don't let your babies > als@REDACTED grow up to be outsourced. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From mats.cronqvist@REDACTED Mon Jan 7 14:12:25 2008 From: mats.cronqvist@REDACTED (mats cronqvist) Date: Mon, 07 Jan 2008 14:12:25 +0100 Subject: [erlang-questions] scope of ets table names? In-Reply-To: <47821911.3070607@ericsson.com> References: <200801050417.22790.als@iinet.net.au> <4781ECAF.3000208@ericsson.com> <1199707468.28499.157.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> <47821911.3070607@ericsson.com> Message-ID: <1199711545.28499.162.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> On Mon, 2008-01-07 at 13:20 +0100, Ulf Wiger (TN/EAB) wrote: > Yes, but the scope of the name is still global > (inside the node). Attempts to access the table > may give a run-time error depending on its > protection settings. sure. i just wanted to point out that this; > >> a named ets table is accessible from all processes on the node. is misleading. but i guess i just created more confusion :< mats From fw@REDACTED Mon Jan 7 14:30:10 2008 From: fw@REDACTED (Florian Weimer) Date: Mon, 07 Jan 2008 14:30:10 +0100 Subject: [erlang-questions] Speeding up text file I/O Message-ID: <87hchpg3vh.fsf@mid.deneb.enyo.de> Is there a way to read lines from a text files more quickly than the excerpt below? This runs over 100 times slower than a "wc -l": $ erlc wc.erl $ erl -noshell -s wc process data -s erlang halt I'm using erlang 1:11.b.5dfsg-12 (Debian) in this experiment. -module(wc). -export([process/1]). processLines(File, Count) -> case io:get_line(File, '') of eof -> io:format("~w~n", [Count]); _ -> processLines(File, Count + 1) end. process(Name) -> {ok, S} = file:open(Name, [read]), % ok = io:setopts(S, [binary]), processLines(S, 0). From fw@REDACTED Mon Jan 7 14:36:12 2008 From: fw@REDACTED (Florian Weimer) Date: Mon, 07 Jan 2008 14:36:12 +0100 Subject: [erlang-questions] Speeding up text file I/O In-Reply-To: <87hchpg3vh.fsf@mid.deneb.enyo.de> (Florian Weimer's message of "Mon, 07 Jan 2008 14:30:10 +0100") References: <87hchpg3vh.fsf@mid.deneb.enyo.de> Message-ID: <87lk71ep0z.fsf@mid.deneb.enyo.de> * Florian Weimer: > % ok = io:setopts(S, [binary]), I should have mentioned that this line is commented out because calling io:setops returns {error, terminated}, due to some kind of internal failure I don't understand: =ERROR REPORT==== 7-Jan-2008::14:20:24 === Error in process <0.129.0> with exit value: {{case_clause,{ok,ok,{state,{file_descriptor,prim_file,{#Port<0.172>,7}},<0.122.0>,#Ref<0.0.3.214102>,<<0 bytes>>,binary}}},[{file_io_server,server_loop,1}]} =ERROR REPORT==== 7-Jan-2008::14:20:24 === Error in process <0.122.0> with exit value: {{badmatch,{error,terminated}},[{wc,process,1},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} ** exited: {{badmatch,{error,terminated}}, [{wc,process,1}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** From dmitriid@REDACTED Mon Jan 7 15:20:19 2008 From: dmitriid@REDACTED (Dmitrii 'Mamut' Dimandt) Date: Mon, 07 Jan 2008 16:20:19 +0200 Subject: [erlang-questions] Speeding up text file I/O In-Reply-To: <87hchpg3vh.fsf@mid.deneb.enyo.de> References: <87hchpg3vh.fsf@mid.deneb.enyo.de> Message-ID: <47823523.8070000@gmail.com> Florian Weimer wrote: > Is there a way to read lines from a text files more quickly than the > excerpt below? This runs over 100 times slower than a "wc -l": > > As a matter of fact, there is. It is possible to do up to 20 MB/s using Erlang only. Here's the original post: http://gaperton.livejournal.com/11736.html It's in Russian, so here's a quick recap: You can use the raw option to get access to the file driver directly. And if you use binaries, nothing gets copied/freed/copied/freed etc. So, we are going to use a file in raw mode using block of given length. First we'll write a function that'll search for a symbol in a binary real fast. Here it is: find_8( Buffer, Char ) -> find_8( Buffer, Char, 0 ). find_8( Buffer, Char, Pos ) -> case Buffer of << _:Pos/bytes, Char:8, _/bytes >> -> Pos; << _:Pos/bytes, _:1/bytes, Char:8, _/bytes >> -> Pos + 1; << _:Pos/bytes, _:2/bytes, Char:8, _/bytes >> -> Pos + 2; << _:Pos/bytes, _:3/bytes, Char:8, _/bytes >> -> Pos + 3; << _:Pos/bytes, _:4/bytes, Char:8, _/bytes >> -> Pos + 4; << _:Pos/bytes, _:5/bytes, Char:8, _/bytes >> -> Pos + 5; << _:Pos/bytes, _:6/bytes, Char:8, _/bytes >> -> Pos + 6; << _:Pos/bytes, _:7/bytes, Char:8, _/bytes >> -> Pos + 7; << _:Pos/bytes, _:8/bytes, Char:8, _/bytes >> -> Pos + 8; << _:Pos/bytes, _:9/bytes, Char:8, _/bytes >> -> Pos + 9; << _:Pos/bytes, _:10/bytes, Char:8, _/bytes >> -> Pos + 10; << _:Pos/bytes, _:11/bytes, Char:8, _/bytes >> -> Pos + 11; << _:Pos/bytes, _:12/bytes, Char:8, _/bytes >> -> Pos + 12; << _:Pos/bytes, _:13/bytes, Char:8, _/bytes >> -> Pos + 13; << _:Pos/bytes, _:14/bytes, Char:8, _/bytes >> -> Pos + 14; << _:Pos/bytes, _:15/bytes, Char:8, _/bytes >> -> Pos + 15; << _:Pos/bytes, _:16/bytes, Char:8, _/bytes >> -> Pos + 16; << _:Pos/bytes, _:17/bytes, Char:8, _/bytes >> -> Pos + 17; << _:Pos/bytes, _:18/bytes, Char:8, _/bytes >> -> Pos + 18; << _:Pos/bytes, _:19/bytes, Char:8, _/bytes >> -> Pos + 19; << _:Pos/bytes, _:20/bytes, Char:8, _/bytes >> -> Pos + 20; << _:Pos/bytes, _:21/bytes, Char:8, _/bytes >> -> Pos + 21; << _:Pos/bytes, _:22/bytes, Char:8, _/bytes >> -> Pos + 22; << _:Pos/bytes, _:23/bytes, Char:8, _/bytes >> -> Pos + 23; << _:Pos/bytes, _:24/bytes, Char:8, _/bytes >> -> Pos + 24; << _:Pos/bytes, _:25/bytes, Char:8, _/bytes >> -> Pos + 25; << _:Pos/bytes, _:26/bytes, Char:8, _/bytes >> -> Pos + 26; << _:Pos/bytes, _:27/bytes, Char:8, _/bytes >> -> Pos + 27; << _:Pos/bytes, _:28/bytes, Char:8, _/bytes >> -> Pos + 28; << _:Pos/bytes, _:29/bytes, Char:8, _/bytes >> -> Pos + 29; << _:Pos/bytes, _:30/bytes, Char:8, _/bytes >> -> Pos + 30; << _:Pos/bytes, _:31/bytes, Char:8, _/bytes >> -> Pos + 31; << _:Pos/bytes, _:32/bytes, _/bytes >> -> find_8( Buffer, Char, Pos + 32 ); _ -> not_found end. Scary, huh? I've unwound the loop so that the compiler could generate a long piece of native code, with optimal arranging of the pattern matches. This wotks well with only 8 lines, but for me an extra 10% of performance is a big win. Let us now create a function that splits a binary on a given character: %% split_char( binary(), byte() ) -> { binary(), binary() } | not_found split_char( Buffer, Char ) -> case find_8( Buffer, Char, 0 ) of not_found -> not_found; Pos -> << Before:Pos/bytes, _:8, After/bytes >> = Buffer, { Before, After } end. we're almost ready to go on with implementing a get_lines of our own. It's getting really interesting. Hardcore Erlang: %% file_reader( File, Len ) -> Handle %% Handle = { NextF, binary() } | eof %% NextF = fun() -> Handle file_reader( File, Len ) -> file_reader( File, Len, << >> ). file_reader( File, LenI, BufferB ) -> NextF = fun() -> case file:read( File, LenI ) of { ok, DataB } -> file_reader( File, LenI, DataB ); eof -> eof end end, { NextF, BufferB }. This function returns an "iterator". An iterator to the data blocks (since we are reading our data in blocks). This returns a tuple, whose first element is the current block and first element is a function that takes no args but simply returns the next block when called. Now, here comes our get_line function: get_line( { NextF, BufferB } ) -> case split_char( BufferB, 10 ) of { LineB, RestB } -> { { NextF, RestB }, LineB }; not_found -> case NextF() of eof -> { eof, BufferB }; Handl_1 -> { Handl_2, LineB } = get_line( Handl_1 ), { Handl_2, << BufferB/bytes, LineB/bytes >> } end end. That's it. The funny thing is that the get_line function we got knows nothing about files. It knows that it needs to call the function to get the next block. We can actually plug in any source of data we want. Let's test the function on a 821-megabyte file on a iMac G5 1,9 GHz: tf( Name, Len ) -> { ok, Fl } = file:open( Name, [ read, raw, binary ] ), tf_loop( file_reader( Fl, Len ) ), file:close( Fl ). %% where tf_loop( eof ) -> done; tf_loop( Hnd ) -> { Hnd_2, _ } = get_line( Hnd ), tf_loop( Hnd_2 ). Buffer size (bytes) 256 1024 4096 8192 16384 default 91,3 53,6 44,1 42,1 41,7 read_ahead 60,6 44,9 42,1 41,2 40,9 async 265,2 102,1 59,2 46,9 44,6 async, read_ahead 59,7 45,7 42,6 41,7 40,3 default means no async threads or read ahead. You should use read ahead with async threads when doing active i/o. You should also keep the buffer size above 1 kilobyte. 4 kb should be sufficient for most tasks From chsu79@REDACTED Mon Jan 7 16:04:05 2008 From: chsu79@REDACTED (Christian S) Date: Mon, 7 Jan 2008 16:04:05 +0100 Subject: [erlang-questions] Speeding up text file I/O In-Reply-To: <47823523.8070000@gmail.com> References: <87hchpg3vh.fsf@mid.deneb.enyo.de> <47823523.8070000@gmail.com> Message-ID: Do you know if this has been benchmarked against the more attractive code that R12B makes more efficient? Because those functions make me want to change profession to something where you get to hurt people. On Jan 7, 2008 3:20 PM, Dmitrii 'Mamut' Dimandt wrote: > Florian Weimer wrote: > > Is there a way to read lines from a text files more quickly than the > > excerpt below? This runs over 100 times slower than a "wc -l": > As a matter of fact, there is. It is possible to do up to 20 MB/s using > Erlang only. > From dmitriid@REDACTED Mon Jan 7 16:07:03 2008 From: dmitriid@REDACTED (Dmitrii 'Mamut' Dimandt) Date: Mon, 07 Jan 2008 17:07:03 +0200 Subject: [erlang-questions] Speeding up text file I/O In-Reply-To: References: <87hchpg3vh.fsf@mid.deneb.enyo.de> <47823523.8070000@gmail.com> Message-ID: <47824017.6040309@gmail.com> Christian S wrote: > Do you know if this has been benchmarked against the more attractive code > that R12B makes more efficient? Honestly, I have no idea :) You could try and ask directly in the blog post above. The author speaks English. > Because those functions make me want to > change profession to something where you get to hurt people. > > : )))) I'm still trying to wrap my head around the iterator concept :) From sgolovan@REDACTED Mon Jan 7 16:17:42 2008 From: sgolovan@REDACTED (Sergei Golovan) Date: Mon, 7 Jan 2008 18:17:42 +0300 Subject: [erlang-questions] Erlang (R11B-5 or R12B-0) on UltraSPARC III Message-ID: Hi! Did someone build and run Erlang/OTP on UltraSPARC III hardware? When building it on Debian GNU/Linux erlc routinely dies with bus error. Building on UltraSPARC II is fine. -- Sergei Golovan From per.gustafsson@REDACTED Mon Jan 7 16:52:39 2008 From: per.gustafsson@REDACTED (Per Gustafsson) Date: Mon, 07 Jan 2008 16:52:39 +0100 Subject: [erlang-questions] Speeding up text file I/O In-Reply-To: References: <87hchpg3vh.fsf@mid.deneb.enyo.de> <47823523.8070000@gmail.com> Message-ID: <47824AC7.8000203@it.uu.se> Christian S wrote: > Do you know if this has been benchmarked against the more attractive code > that R12B makes more efficient? Because those functions make me want to > change profession to something where you get to hurt people. > I found that the following function is about 10% faster then the unrolled function when using BEAM R12B: find_8(Buffer, Char, Pos) -> case Buffer of << Char, _/bits >> -> Pos; << _, Rest/bits >> -> find_8(Rest, Char, Pos+1); _ -> not_found end. It might depend a little on the input though and when both functions were native compiled there was no major difference between them. Per From exta7@REDACTED Mon Jan 7 17:22:25 2008 From: exta7@REDACTED (Zvi) Date: Mon, 7 Jan 2008 08:22:25 -0800 (PST) Subject: [erlang-questions] Exception in xmerl, when pasing XML with non UTF8 character set In-Reply-To: <4781D817.8090203@ericsson.com> References: <14588326.post@talk.nabble.com> <4781D817.8090203@ericsson.com> Message-ID: <14669389.post@talk.nabble.com> Bertil, thanks for the reply. Actually the charcter set used is always latin-1, but for some reason 3rd party software call it windows-1252 . So if you can tell me, what I should change in xmerl, so it will threat windows-1252 as Latin-1 . >From Wikipedia: "The ISO-8859-1/Windows-1252 mixup It is very common to mislabel text data with the charset label ISO-8859-1, even though the data is really Windows-1252 encoded. In Windows-1252, codes between 0x80 and 0x9F are used for letters and punctuation, whereas they are control codes in ISO-8859-1. Many web browsers and e-mail clients will interpret ISO-8859-1 control codes as Windows-1252 characters in order to accommodate such mislabeling but it is not a standard behaviour and care should be taken to avoid generating these characters in ISO-8859-1 labeled content." Thanks in advance. Zvi Bertil Karlsson wrote: > > If I'm right windows-1252 uses its own conversion table that doesn't > exist in xmerl today. Just changing the encoding to something that seems > to work may cause trouble when it comes to those characters that differs. > It is not difficult to add the changes needed to xmerl, but I cannot > promise it into the next release. > > /Bertil > > Zvi wrote: >> 3> { Xml, _Rest } = xmerl_scan:file(ResultIdx). >> ** exception exit: {bad_character_code, >> "> "http://www.xxx.com/yyy.dtd\">\n\n\naaa\n\n", >> 'windows-1252'} >> in function xmerl_ucs:to_unicode/2 >> in call from xmerl_scan:scan_document/2 >> in call from xmerl_scan:file/2 >> >> The XML document starts with PI: > encoding="windows-1252"?> >> It works, after changing it to >> >> >> The problem is that this XML document generated by 3rd party SW, so I >> would >> like to fix xmerl code, or use some xmerl option. >> >> I using R12B on Windows. >> >> TIA >> >> Zvi >> >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- View this message in context: http://www.nabble.com/Exception-in-xmerl%2C-when-pasing-XML-with-non-UTF8-character-set-tp14588326p14669389.html Sent from the Erlang Questions mailing list archive at Nabble.com. From chsu79@REDACTED Mon Jan 7 18:29:02 2008 From: chsu79@REDACTED (Christian S) Date: Mon, 7 Jan 2008 18:29:02 +0100 Subject: [erlang-questions] Exception in xmerl, when pasing XML with non UTF8 character set In-Reply-To: <14669389.post@talk.nabble.com> References: <14588326.post@talk.nabble.com> <4781D817.8090203@ericsson.com> <14669389.post@talk.nabble.com> Message-ID: Why not ask yourself how to change your xml so it says iso-8859-1 as you say it should be doing? http://en.wikipedia.org/wiki/Garbage_In,_Garbage_Out On Jan 7, 2008 5:22 PM, Zvi wrote: > > Bertil, > > thanks for the reply. > Actually the charcter set used is always latin-1, but for some reason 3rd > party software call it windows-1252 . So if you can tell me, what I should > change in xmerl, so it will threat windows-1252 as Latin-1 . From bob@REDACTED Mon Jan 7 21:08:44 2008 From: bob@REDACTED (Bob Cowdery) Date: Mon, 07 Jan 2008 20:08:44 +0000 Subject: [erlang-questions] wxErlang In-Reply-To: <4781F0AC.5000809@erix.ericsson.se> References: <1199315976.5559.38.camel@ubuntu-life-vm> <7998EA64-00C8-4421-9103-FB3AB8A926FA@gol.com> <9F2DB736-551B-413D-A2AD-1661681895E2@gol.com> <1199654220.5542.10.camel@ubuntu-life-vm> <4781F0AC.5000809@erix.ericsson.se> Message-ID: <1199736524.5853.12.camel@ubuntu-life-vm> Dan Thank you so much for fixing that. I now have good fonts and colours so I can push on some more. The checkbox issue seems to be that there is some kind of translucent rectangle in the first cell that interferes with any widget placed there. I don't see how it could be anything to do with the bindings. Bob On Mon, 2008-01-07 at 10:28 +0100, Dan Gudmundsson wrote: > The last one is fixed on sourceforce, and in the erlang parts so > you should be able to check it out and rebuild the beams. > > It should be > wxFont:new(24, ?wxFONTFAMILY_SWISS, ?wxFONTSTYLE_NORMAL, > ?wxFONTWEIGHT_NORMAL). > > But I messed up the guards and documentation sorry. > I also messed up colors badly which is also fixed in svn repos. > > I'll have a look at the toggle button issue, I don't have a clue > about checkbox. > > Thanks for the feedback guys, appreciated. > > It should build on Mac i.e. it does for me, api generation > requires the GTK headers but it you download them and point > them out with it should work on the Mac. > > cd api_gen > make WXGTK_DIR=/wxWidgets-2.8.5/include > > /Dan > > Bob Cowdery wrote: > > Hi John > > > > Thanks. I've got around the issue for now by just emulating a toggle > > button. > > > > I have a stopper issue at the moment if you or anyone else can help it > > would be much appreciated. > > > > I can't get wxFont to work at all. If I use: > > > > wxFont:new(24, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, > > wxFONTWEIGHT_NORMAL). > > > > it gives me 'no function clause defined' because weight is actually > > defined as an integer. If I give it 90 which I believe is > > wxFONTWEIGHT_NORMAL according to the defs.h I get 'invalid arg'. I get > > other errors with the other :new functions. None seem to work. > > > > Any ideas? > > > > Bob > > > > > > On Fri, 2008-01-04 at 16:11 +0900, John Webb wrote: > >> On Jan 4, 2008, at 9:43 AM, John Webb wrote: > >> > >>> Hi Bob, > >>> > >>> On Jan 3, 2008, at 8:19 AM, Bob Cowdery wrote: > >>> > >>>> I have a couple of small issues with wxErlang. In general it is > >>>> working > >>>> great so far. > >>>> > >>>> 1. I can't get any events to fire off a wxToggleButton. As far as I > >>>> remember this behaves like a check box but neither > >>>> command_button_clicked nor command_checkbox_clicked fire. Is there > >>>> some > >>>> other event I should be looking at. > >>> wxToggleButton generates a wxEVT_COMMAND_TOGGLEBUTTON_CLICKED event > >>> when clicked; I haven't looked at wxErlang but I am guessing that > >>> there is a command_togglebutton_clicked event somewhere... > >> Ah, guessed wrong again... for whatever reason the event is commented > >> out in api_gen/wxapi.conf in the source distribution. > >> > >> Uncommenting the event and regenerating the API might give you the > >> event but I'm guessing again because so far I've not been able to > >> build successfully on my MacBook :( > >> > >>> > >>> > >>>> 2. This is a bit obscure and I'm not sure if it's a wxWidgets issue. > >>>> If > >>>> I place a checkbox in the first cell of a wxGridSizer the click area > >>>> appears over the label and not the box, which also has a white band > >>>> underneath it. > >>> Sorry, No idea about this one. > >>> > >>> Regards, > >>> John > >>> > >>> _______________________________________________ > >>> 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 travis.jensen@REDACTED Mon Jan 7 20:22:56 2008 From: travis.jensen@REDACTED (Travis Jensen) Date: Mon, 7 Jan 2008 12:22:56 -0700 Subject: [erlang-questions] Securely running code on an untrusted client In-Reply-To: <4781CE4F.3060507@ericsson.com> References: <3605cb0801062228j5e791b7cme34dc5cc68fb575b@mail.gmail.com> <4781CE4F.3060507@ericsson.com> Message-ID: <3605cb0801071122w5d688156if5abaf777a3fe487@mail.gmail.com> Thanks for the reply, Ulf. This seems like the inverse of what I want, if I'm understanding it correctly. This allows the client to run untrusted code on the server, right? What I want is to have the server run trusted code on the client and be able to trust the result. So, let me break it down a little more... - Client connects to server. - Server sends code to client - Client runs process - Clients sends result to server - Server trusts client result In the middle of this is the fact that I don't really trust the client, so I would have to know that the result I get from the client is actually the result of running the process I sent to the client and not the result of some hack. In general, there are two hack concerns: hacking the running process to process differently and hacking the resulting data stream to give a fake result. I realize that this may be wishful thinking, but a month ago, having a system that would scale significantly without introducing unbelievable complexity into my code was also wishful thinking; then I found Erlang. :) tj On Jan 7, 2008 12:01 AM, Ulf Wiger (TN/EAB) wrote: > Travis Jensen skrev: > > I've been looking around online and haven't seen anything to contradict > > what I assume to be the case, but I'm unfamiliar enough with Erlang that > > I figure I should ask. > > > > Assuming I have a server on one system and a client on another system > > that exists out somewhere else in the broad, scary internet. The server > > is trusted, the client is not. The network connection between the two > > is not trusted. > > > > Is there any way to run trusted code on the client? > > As far as I know, the closest you will get right now with > Erlang is ErlHive. > > http://erlhive.sourceforge.net/ > > ErlHive is sort of presented as a web application development > framework, but is really mainly a multi-user back-end with > safe code execution. It happens to have a front-end application > which hooks into Yaws, and enables user authentication via > HTTP. > > ErlHive is able to compile modules from source, or interpret > erlang expressions. It forbids operations that are not known > to be safe, but also offers safe alternatives to many > operations that normally wouldn't be: a virtual file system, > process spawning, send & receive, ets tables, etc. All code > runs inside mnesia transactions. > > BR, > Ulf W > -- Travis Jensen travis.jensen@REDACTED http://cmssphere.blogspot.com/ Software Maven * Philosopher-in-Training * Avenged Nerd -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.wiger@REDACTED Mon Jan 7 20:50:48 2008 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Mon, 07 Jan 2008 20:50:48 +0100 Subject: [erlang-questions] Securely running code on an untrusted client In-Reply-To: <3605cb0801071122w5d688156if5abaf777a3fe487@mail.gmail.com> References: <3605cb0801062228j5e791b7cme34dc5cc68fb575b@mail.gmail.com> <4781CE4F.3060507@ericsson.com> <3605cb0801071122w5d688156if5abaf777a3fe487@mail.gmail.com> Message-ID: <47828298.8020507@ericsson.com> Travis Jensen skrev: > Thanks for the reply, Ulf. This seems like the inverse of what I want, > if I'm understanding it correctly. This allows the client to run > untrusted code on the server, right? What I want is to have the server > run trusted code on the client and be able to trust the result. Ok, sorry for the sloppy interpretation. It seems as if you have to decide upon which level of trust to extend to the client, and then live with that. Unless you know exactly what the result of the computation will be, I think it ought to be extremely difficult to get any guarantees... But if you can run an Erlang VM on the client, you can take some precautions to make sure that the client doesn't easily tamper with it: - maintain a secure connection with the VM, to make sure that it's not shut down and replaced with something else - don't provide a shell (e.g. via to_erl) on the client - don't run distributed Erlang on it, or if you do, try to use a really obscure cookie that you set after erlang is started (this means you must bring up the net kernel manually) - This way, there is no way to start a shell session on the VM, or access the RPC server in order to e.g. load suspicious code. If you then send code and requests along the secure channel, you should be pretty safe. (I'm sure there are variations on the above theme.) BR, Ulf W > > So, let me break it down a little more... > > - Client connects to server. > - Server sends code to client > - Client runs process > - Clients sends result to server > - Server trusts client result > > In the middle of this is the fact that I don't really trust the client, > so I would have to know that the result I get from the client is > actually the result of running the process I sent to the client and not > the result of some hack. In general, there are two hack concerns: > hacking the running process to process differently and hacking the > resulting data stream to give a fake result. > > I realize that this may be wishful thinking, but a month ago, having a > system that would scale significantly without introducing unbelievable > complexity into my code was also wishful thinking; then I found Erlang. :) > > tj > > On Jan 7, 2008 12:01 AM, Ulf Wiger (TN/EAB) > wrote: > > Travis Jensen skrev: > > I've been looking around online and haven't seen anything to > contradict > > what I assume to be the case, but I'm unfamiliar enough with > Erlang that > > I figure I should ask. > > > > Assuming I have a server on one system and a client on another system > > that exists out somewhere else in the broad, scary internet. The > server > > is trusted, the client is not. The network connection between > the two > > is not trusted. > > > > Is there any way to run trusted code on the client? > > As far as I know, the closest you will get right now with > Erlang is ErlHive. > > http://erlhive.sourceforge.net/ > > ErlHive is sort of presented as a web application development > framework, but is really mainly a multi-user back-end with > safe code execution. It happens to have a front-end application > which hooks into Yaws, and enables user authentication via > HTTP. > > ErlHive is able to compile modules from source, or interpret > erlang expressions. It forbids operations that are not known > to be safe, but also offers safe alternatives to many > operations that normally wouldn't be: a virtual file system, > process spawning, send & receive, ets tables, etc. All code > runs inside mnesia transactions. > > BR, > Ulf W > > > > > -- > Travis Jensen > travis.jensen@REDACTED > http://cmssphere.blogspot.com/ > Software Maven * Philosopher-in-Training * Avenged Nerd > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From exta7@REDACTED Mon Jan 7 20:52:00 2008 From: exta7@REDACTED (Zvi) Date: Mon, 7 Jan 2008 11:52:00 -0800 (PST) Subject: [erlang-questions] Exception in xmerl, when pasing XML with non UTF8 character set In-Reply-To: References: <14588326.post@talk.nabble.com> <4781D817.8090203@ericsson.com> <14669389.post@talk.nabble.com> Message-ID: <14674437.post@talk.nabble.com> XML generated by closed-source 3rd party Windows server (if it was generated by me, then it was encoded in utf-8). I asking here questions from Erlang domain, not the obvious & ugly common sence solutions, like reading the entire file into memory, changing the encoding string and only then feeding it into xmerl. (the problem only that this XML can be quite big, like 0.5 MB and more). Maybe xmerl has some option for forcing encoding, other than specified in the PI? Maybe there is some other XML parser like erlsom or expat driver, which supports windows-1252 encoding? Anyway I using xmerl just for prototyping, the long term solution will be to write C++ port, which will be doing all the XML processing and return Erlang terms in either text or binary form, which can be read either by file:consult or binary_to_term on the Erlang side. ZVi Christian S wrote: > > Why not ask yourself how to change your xml so it says iso-8859-1 as you > say > it should be doing? > > http://en.wikipedia.org/wiki/Garbage_In,_Garbage_Out > > On Jan 7, 2008 5:22 PM, Zvi wrote: >> >> Bertil, >> >> thanks for the reply. >> Actually the charcter set used is always latin-1, but for some reason 3rd >> party software call it windows-1252 . So if you can tell me, what I >> should >> change in xmerl, so it will threat windows-1252 as Latin-1 . > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- View this message in context: http://www.nabble.com/Exception-in-xmerl%2C-when-pasing-XML-with-non-UTF8-character-set-tp14588326p14674437.html Sent from the Erlang Questions mailing list archive at Nabble.com. From matthew@REDACTED Mon Jan 7 22:51:30 2008 From: matthew@REDACTED (Matthew Dempsky) Date: Mon, 7 Jan 2008 13:51:30 -0800 Subject: [erlang-questions] Running another erlang.org mirror Message-ID: Who should I contact about possibly setting up another erlang.org mirror? From fw@REDACTED Mon Jan 7 23:03:45 2008 From: fw@REDACTED (Florian Weimer) Date: Mon, 07 Jan 2008 23:03:45 +0100 Subject: [erlang-questions] Speeding up text file I/O In-Reply-To: <47823523.8070000@gmail.com> (Dmitrii Dimandt's message of "Mon, 07 Jan 2008 16:20:19 +0200") References: <87hchpg3vh.fsf@mid.deneb.enyo.de> <47823523.8070000@gmail.com> Message-ID: <87fxx970ou.fsf@mid.deneb.enyo.de> * Dmitrii Dimandt: > As a matter of fact, there is. It is possible to do up to 20 MB/s > using Erlang only. Interesting, I get about ~29 MB/s from that code (with the find_8 variant posted by Per). Unfortunately, changing the handle to { NextF, Buffer, Pos }, where Pos is the current read position in Buffer, does not change running time by much. I assumed this might reduce garbage collection overhead. (I think the toy benchmark is now mostly at the stage where GC peformance is measured.) From bengt.kleberg@REDACTED Tue Jan 8 08:27:19 2008 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 08 Jan 2008 08:27:19 +0100 Subject: [erlang-questions] Securely running code on an untrusted client In-Reply-To: <3605cb0801071122w5d688156if5abaf777a3fe487@mail.gmail.com> References: <3605cb0801062228j5e791b7cme34dc5cc68fb575b@mail.gmail.com> <4781CE4F.3060507@ericsson.com> <3605cb0801071122w5d688156if5abaf777a3fe487@mail.gmail.com> Message-ID: <478325D7.1040605@ericsson.com> travis, if you want to let an untrusted client compute something for you it sounds like SETI@REDACTED this is what they say about the problem: ''We send out each work unit multiple times in order to make sure that the data is processed correctly'' ie you have several untrusted clients (that do not collaborate) that get the same data and then you check their answers. this will not protect you from the client copying your data. bengt Those were the days... EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." On 01/07/08 20:22, Travis Jensen wrote: > Thanks for the reply, Ulf. This seems like the inverse of what I want, > if I'm understanding it correctly. This allows the client to run > untrusted code on the server, right? What I want is to have the server > run trusted code on the client and be able to trust the result. > > So, let me break it down a little more... > > - Client connects to server. > - Server sends code to client > - Client runs process > - Clients sends result to server > - Server trusts client result > > In the middle of this is the fact that I don't really trust the client, > so I would have to know that the result I get from the client is > actually the result of running the process I sent to the client and not > the result of some hack. In general, there are two hack concerns: > hacking the running process to process differently and hacking the > resulting data stream to give a fake result. > > I realize that this may be wishful thinking, but a month ago, having a > system that would scale significantly without introducing unbelievable > complexity into my code was also wishful thinking; then I found Erlang. :) > > tj > > On Jan 7, 2008 12:01 AM, Ulf Wiger (TN/EAB) > wrote: > > Travis Jensen skrev: > > I've been looking around online and haven't seen anything to > contradict > > what I assume to be the case, but I'm unfamiliar enough with > Erlang that > > I figure I should ask. > > > > Assuming I have a server on one system and a client on another system > > that exists out somewhere else in the broad, scary internet. The > server > > is trusted, the client is not. The network connection between > the two > > is not trusted. > > > > Is there any way to run trusted code on the client? > > As far as I know, the closest you will get right now with > Erlang is ErlHive. > > http://erlhive.sourceforge.net/ > > ErlHive is sort of presented as a web application development > framework, but is really mainly a multi-user back-end with > safe code execution. It happens to have a front-end application > which hooks into Yaws, and enables user authentication via > HTTP. > > ErlHive is able to compile modules from source, or interpret > erlang expressions. It forbids operations that are not known > to be safe, but also offers safe alternatives to many > operations that normally wouldn't be: a virtual file system, > process spawning, send & receive, ets tables, etc. All code > runs inside mnesia transactions. > > BR, > Ulf W > > > > > -- > Travis Jensen > travis.jensen@REDACTED > http://cmssphere.blogspot.com/ > Software Maven * Philosopher-in-Training * Avenged Nerd > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From cadr4u@REDACTED Tue Jan 8 08:36:44 2008 From: cadr4u@REDACTED (Jakob Sievers) Date: Tue, 8 Jan 2008 08:36:44 +0100 Subject: [erlang-questions] Securely running code on an untrusted client Message-ID: > Travis Jensen said: [SNIP] > So, let me break it down a little more... > > - Client connects to server. > - Server sends code to client > - Client runs process > - Clients sends result to server > - Server trusts client result > > In the middle of this is the fact that I don't really trust the client, so I > would have to know that the result I get from the client is actually the > result of running the process I sent to the client and not the result of > some hack. In general, there are two hack concerns: hacking the running > process to process differently and hacking the resulting data stream to give > a fake result. [SNIP] Have you looked at how SETI@REDACTED/BOINC accomplishes this? At the very least, I think, you'll want to introduce some redundancy (i.e. sending the same code to several clients and comparing the results), or is this not an option? In any case, some of these papers ought to be of interest: http://boinc.berkeley.edu/trac/wiki/BoincPapers Cheers, Jakob From bertil.karlsson@REDACTED Tue Jan 8 09:00:22 2008 From: bertil.karlsson@REDACTED (Bertil Karlsson) Date: Tue, 08 Jan 2008 09:00:22 +0100 Subject: [erlang-questions] Exception in xmerl, when pasing XML with non UTF8 character set In-Reply-To: <14674437.post@talk.nabble.com> References: <14588326.post@talk.nabble.com> <4781D817.8090203@ericsson.com> <14669389.post@talk.nabble.com> <14674437.post@talk.nabble.com> Message-ID: <47832D96.9010502@ericsson.com> Introducing a bug that accomplish what you want is to add 'windows-1252' in the function guard of to_unicode/2 in xmerl_ucs.erl /Bertil Zvi wrote: > XML generated by closed-source 3rd party Windows server (if it was generated > by me, then it was encoded in utf-8). > I asking here questions from Erlang domain, not the obvious & ugly common > sence solutions, like reading the entire file into memory, changing the > encoding string and only then feeding it into xmerl. (the problem only that > this XML can be quite big, like 0.5 MB and more). > Maybe xmerl has some option for forcing encoding, other than specified in > the PI? > Maybe there is some other XML parser like erlsom or expat driver, which > supports windows-1252 encoding? > Anyway I using xmerl just for prototyping, the long term solution will be to > write C++ port, which will be doing all the XML processing and return Erlang > terms in either text or binary form, which can be read either by > file:consult or binary_to_term on the Erlang side. > > ZVi > > > Christian S wrote: > >> Why not ask yourself how to change your xml so it says iso-8859-1 as you >> say >> it should be doing? >> >> http://en.wikipedia.org/wiki/Garbage_In,_Garbage_Out >> >> On Jan 7, 2008 5:22 PM, Zvi wrote: >> >>> Bertil, >>> >>> thanks for the reply. >>> Actually the charcter set used is always latin-1, but for some reason 3rd >>> party software call it windows-1252 . So if you can tell me, what I >>> should >>> change in xmerl, so it will threat windows-1252 as Latin-1 . >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> >> > > From ulf.wiger@REDACTED Tue Jan 8 09:10:35 2008 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Tue, 08 Jan 2008 09:10:35 +0100 Subject: [erlang-questions] Running another erlang.org mirror In-Reply-To: References: Message-ID: <47832FFB.4020803@ericsson.com> Matthew Dempsky skrev: > Who should I contact about possibly setting up another erlang.org mirror? I had a temporary mirror once. I just created a sub-domain at DreamHost and used rsync to fetch the data. It worked pretty well. BR, Ulf W From vychodil.hynek@REDACTED Tue Jan 8 09:31:05 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 8 Jan 2008 09:31:05 +0100 Subject: [erlang-questions] Securely running code on an untrusted client In-Reply-To: <47828298.8020507@ericsson.com> References: <3605cb0801062228j5e791b7cme34dc5cc68fb575b@mail.gmail.com> <4781CE4F.3060507@ericsson.com> <3605cb0801071122w5d688156if5abaf777a3fe487@mail.gmail.com> <47828298.8020507@ericsson.com> Message-ID: <4d08db370801080031g41cc5085t1b8949dc739e0dda@mail.gmail.com> This is insecure by principle like DRM. It can't work any way really secure. All methods what you can use will be only security by obscurity ant it isn't real security. What if I use tweaked VM? What if I use tweaked network layer. What if I use tweaked kernel. What if I use virtual machine for run hosting OS? You can't solve it! You must trust at least some client even use SETI/Boinc redundant approach. On 1/7/08, Ulf Wiger (TN/EAB) wrote: > Travis Jensen skrev: > > Thanks for the reply, Ulf. This seems like the inverse of what I want, > > if I'm understanding it correctly. This allows the client to run > > untrusted code on the server, right? What I want is to have the server > > run trusted code on the client and be able to trust the result. > > Ok, sorry for the sloppy interpretation. > > It seems as if you have to decide upon which level of trust > to extend to the client, and then live with that. Unless > you know exactly what the result of the computation will > be, I think it ought to be extremely difficult to get any > guarantees... > > But if you can run an Erlang VM on the client, you can take > some precautions to make sure that the client doesn't > easily tamper with it: > > - maintain a secure connection with the VM, to make sure > that it's not shut down and replaced with something > else > - don't provide a shell (e.g. via to_erl) on the client > - don't run distributed Erlang on it, or if you do, > try to use a really obscure cookie that you set after > erlang is started (this means you must bring up the > net kernel manually) > - This way, there is no way to start a shell session > on the VM, or access the RPC server in order to > e.g. load suspicious code. > > If you then send code and requests along the secure > channel, you should be pretty safe. > > (I'm sure there are variations on the above theme.) > > BR, > Ulf W > > > > > So, let me break it down a little more... > > > > - Client connects to server. > > - Server sends code to client > > - Client runs process > > - Clients sends result to server > > - Server trusts client result > > > > In the middle of this is the fact that I don't really trust the client, > > so I would have to know that the result I get from the client is > > actually the result of running the process I sent to the client and not > > the result of some hack. In general, there are two hack concerns: > > hacking the running process to process differently and hacking the > > resulting data stream to give a fake result. > > > > I realize that this may be wishful thinking, but a month ago, having a > > system that would scale significantly without introducing unbelievable > > complexity into my code was also wishful thinking; then I found Erlang. :) > > > > tj > > > > On Jan 7, 2008 12:01 AM, Ulf Wiger (TN/EAB) > > wrote: > > > > Travis Jensen skrev: > > > I've been looking around online and haven't seen anything to > > contradict > > > what I assume to be the case, but I'm unfamiliar enough with > > Erlang that > > > I figure I should ask. > > > > > > Assuming I have a server on one system and a client on another system > > > that exists out somewhere else in the broad, scary internet. The > > server > > > is trusted, the client is not. The network connection between > > the two > > > is not trusted. > > > > > > Is there any way to run trusted code on the client? > > > > As far as I know, the closest you will get right now with > > Erlang is ErlHive. > > > > http://erlhive.sourceforge.net/ > > > > ErlHive is sort of presented as a web application development > > framework, but is really mainly a multi-user back-end with > > safe code execution. It happens to have a front-end application > > which hooks into Yaws, and enables user authentication via > > HTTP. > > > > ErlHive is able to compile modules from source, or interpret > > erlang expressions. It forbids operations that are not known > > to be safe, but also offers safe alternatives to many > > operations that normally wouldn't be: a virtual file system, > > process spawning, send & receive, ets tables, etc. All code > > runs inside mnesia transactions. > > > > BR, > > Ulf W > > > > > > > > > > -- > > Travis Jensen > > travis.jensen@REDACTED > > http://cmssphere.blogspot.com/ > > Software Maven * Philosopher-in-Training * Avenged Nerd > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > 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 From mikpe@REDACTED Tue Jan 8 09:55:48 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 8 Jan 2008 09:55:48 +0100 Subject: [erlang-questions] Erlang (R11B-5 or R12B-0) on UltraSPARC III In-Reply-To: References: Message-ID: <18307.14996.185017.141525@harpo.it.uu.se> Sergei Golovan writes: > Hi! > > Did someone build and run Erlang/OTP on UltraSPARC III hardware? When > building it on Debian GNU/Linux erlc routinely dies with bus error. > > Building on UltraSPARC II is fine. I built it yesterday on a machine with two USIIIi CPUs running Solaris 9. There were no problems. I seem to recall hearing that the Linux kernel has problems on some UltraSPARC models. You should ask around in the sparclinux mailing list. My private SPARC is a U5 w/ a USIIi CPU, and both Linux and Erlang/OTP work flawlessly on it. From dmitriid@REDACTED Tue Jan 8 10:39:25 2008 From: dmitriid@REDACTED (Dmitrii 'Mamut' Dimandt) Date: Tue, 08 Jan 2008 11:39:25 +0200 Subject: [erlang-questions] Speeding up text file I/O In-Reply-To: <47824AC7.8000203@it.uu.se> References: <87hchpg3vh.fsf@mid.deneb.enyo.de> <47823523.8070000@gmail.com> <47824AC7.8000203@it.uu.se> Message-ID: <478344CD.2090601@gmail.com> Per Gustafsson wrote: > Christian S wrote: >> Do you know if this has been benchmarked against the more attractive >> code >> that R12B makes more efficient? Because those functions make me want to >> change profession to something where you get to hurt people. >> > > > > I found that the following function is about 10% faster then the > unrolled function when using BEAM R12B: > > find_8(Buffer, Char, Pos) -> > case Buffer of > << Char, _/bits >> -> Pos; > << _, Rest/bits >> -> > find_8(Rest, Char, Pos+1); > _ -> > not_found > end. > > It might depend a little on the input though and when both functions > were native compiled there was no major difference between them. > > Per Here's the reply: """start quote"" This is incorrect. My unrolled function is twice as fast as the one-liner when it is compiled with the native flag (I didn't translate the flag part - my bad, D.) The number of lines has been carefully measured through various tests. Without the native flag there shouldn't be a significant difference in speed. That's because unrolling only helps the machine code for superpiplined processors. Since the VM isn't superpiplined there's not much point in unrolling the loop The only simplification that can be done for R12 is: find_8( Buffer, Char, Pos ) -> case Buffer of << Char:8, _/bytes >> -> Pos; << _:1/bytes, Char:8, _/bytes >> -> Pos + 1; << _:2/bytes, Char:8, _/bytes >> -> Pos + 2; ... << _:32/bytes, Rest/bytes >> -> find_8( Rest, Char, Pos + 32 ); _ -> not_found end. That's it. """end quote""" Sorry for missing the "compile with the native flag" in my translation From fw@REDACTED Tue Jan 8 11:51:48 2008 From: fw@REDACTED (Florian Weimer) Date: Tue, 08 Jan 2008 11:51:48 +0100 Subject: [erlang-questions] Speeding up text file I/O In-Reply-To: <478344CD.2090601@gmail.com> (Dmitrii Dimandt's message of "Tue, 08 Jan 2008 11:39:25 +0200") References: <87hchpg3vh.fsf@mid.deneb.enyo.de> <47823523.8070000@gmail.com> <47824AC7.8000203@it.uu.se> <478344CD.2090601@gmail.com> Message-ID: <874pdofv3v.fsf@mid.deneb.enyo.de> * Dmitrii Dimandt: > """start quote"" > > This is incorrect. My unrolled function is twice as fast as the > one-liner when it is compiled with the native flag (I didn't translate > the flag part - my bad, D.) The number of lines has been carefully > measured through various tests. Aha. Why is the native flag so underdocumented? Anyway, the original, unrolled find_8 version together with this code (which avoids splitting the buffer unnecessarily) is a tiny bit faster on my machine: %% file_reader( File, Len ) -> Handle %% Handle = { NextF, binary(), Pos } | eof %% NextF = fun() -> Handle file_reader( File, Len ) -> file_reader( File, Len, << >> ). file_reader( File, LenI, BufferB ) -> NextF = fun() -> case file:read( File, LenI ) of { ok, DataB } -> file_reader( File, LenI, DataB ); eof -> eof end end, { NextF, BufferB, 0 }. get_line( { NextF, BufferB, Pos } ) -> case find_8(BufferB, 10, Pos) of not_found -> case BufferB of << _:Pos/bytes, RestB/bytes >> -> case NextF() of eof -> {eof, RestB}; Handl_1 -> { Handl_2, LineB } = get_line( Handl_1 ), { Handl_2, << RestB/bytes, LineB/bytes >> } end end; P -> LineSize = P - Pos, case BufferB of << _:Pos/bytes, LineB:LineSize/bytes, _/bytes >> -> {{ NextF, BufferB, P + 1}, LineB} end end. (This code is only lightly tested, there could be a fatal bug). From travis.jensen@REDACTED Tue Jan 8 17:56:36 2008 From: travis.jensen@REDACTED (Travis Jensen) Date: Tue, 8 Jan 2008 09:56:36 -0700 Subject: [erlang-questions] Securely running code on an untrusted client In-Reply-To: <4d08db370801080031g41cc5085t1b8949dc739e0dda@mail.gmail.com> References: <3605cb0801062228j5e791b7cme34dc5cc68fb575b@mail.gmail.com> <4781CE4F.3060507@ericsson.com> <3605cb0801071122w5d688156if5abaf777a3fe487@mail.gmail.com> <47828298.8020507@ericsson.com> <4d08db370801080031g41cc5085t1b8949dc739e0dda@mail.gmail.com> Message-ID: <3605cb0801080856l52cdff42s82d70cd46e500af7@mail.gmail.com> I'll have to ponder on the SETI/Boinc option. Like I said originally, I didn't think it was possible, but there are a lot of people in this community smarter than me, so I figured it wouldn't hurt to ask. :) tj On Jan 8, 2008 1:31 AM, Hynek Vychodil wrote: > This is insecure by principle like DRM. It can't work any way really > secure. All methods what you can use will be only security by > obscurity ant it isn't real security. > > What if I use tweaked VM? > What if I use tweaked network layer. > What if I use tweaked kernel. > What if I use virtual machine for run hosting OS? > > You can't solve it! You must trust at least some client even use > SETI/Boinc redundant approach. > > On 1/7/08, Ulf Wiger (TN/EAB) wrote: > > Travis Jensen skrev: > > > Thanks for the reply, Ulf. This seems like the inverse of what I > want, > > > if I'm understanding it correctly. This allows the client to run > > > untrusted code on the server, right? What I want is to have the > server > > > run trusted code on the client and be able to trust the result. > > > > Ok, sorry for the sloppy interpretation. > > > > It seems as if you have to decide upon which level of trust > > to extend to the client, and then live with that. Unless > > you know exactly what the result of the computation will > > be, I think it ought to be extremely difficult to get any > > guarantees... > > > > But if you can run an Erlang VM on the client, you can take > > some precautions to make sure that the client doesn't > > easily tamper with it: > > > > - maintain a secure connection with the VM, to make sure > > that it's not shut down and replaced with something > > else > > - don't provide a shell (e.g. via to_erl) on the client > > - don't run distributed Erlang on it, or if you do, > > try to use a really obscure cookie that you set after > > erlang is started (this means you must bring up the > > net kernel manually) > > - This way, there is no way to start a shell session > > on the VM, or access the RPC server in order to > > e.g. load suspicious code. > > > > If you then send code and requests along the secure > > channel, you should be pretty safe. > > > > (I'm sure there are variations on the above theme.) > > > > BR, > > Ulf W > > > > > > > > So, let me break it down a little more... > > > > > > - Client connects to server. > > > - Server sends code to client > > > - Client runs process > > > - Clients sends result to server > > > - Server trusts client result > > > > > > In the middle of this is the fact that I don't really trust the > client, > > > so I would have to know that the result I get from the client is > > > actually the result of running the process I sent to the client and > not > > > the result of some hack. In general, there are two hack concerns: > > > hacking the running process to process differently and hacking the > > > resulting data stream to give a fake result. > > > > > > I realize that this may be wishful thinking, but a month ago, having a > > > system that would scale significantly without introducing unbelievable > > > complexity into my code was also wishful thinking; then I found > Erlang. :) > > > > > > tj > > > > > > On Jan 7, 2008 12:01 AM, Ulf Wiger (TN/EAB) > > > wrote: > > > > > > Travis Jensen skrev: > > > > I've been looking around online and haven't seen anything to > > > contradict > > > > what I assume to be the case, but I'm unfamiliar enough with > > > Erlang that > > > > I figure I should ask. > > > > > > > > Assuming I have a server on one system and a client on another > system > > > > that exists out somewhere else in the broad, scary internet. > The > > > server > > > > is trusted, the client is not. The network connection between > > > the two > > > > is not trusted. > > > > > > > > Is there any way to run trusted code on the client? > > > > > > As far as I know, the closest you will get right now with > > > Erlang is ErlHive. > > > > > > http://erlhive.sourceforge.net/ > > > > > > ErlHive is sort of presented as a web application development > > > framework, but is really mainly a multi-user back-end with > > > safe code execution. It happens to have a front-end application > > > which hooks into Yaws, and enables user authentication via > > > HTTP. > > > > > > ErlHive is able to compile modules from source, or interpret > > > erlang expressions. It forbids operations that are not known > > > to be safe, but also offers safe alternatives to many > > > operations that normally wouldn't be: a virtual file system, > > > process spawning, send & receive, ets tables, etc. All code > > > runs inside mnesia transactions. > > > > > > BR, > > > Ulf W > > > > > > > > > > > > > > > -- > > > Travis Jensen > > > travis.jensen@REDACTED > > > http://cmssphere.blogspot.com/ > > > Software Maven * Philosopher-in-Training * Avenged Nerd > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > 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 > -- Travis Jensen travis.jensen@REDACTED http://softwaremaven.innerbrain.com/ Software Maven * Philosopher-in-Training * Avenged Nerd -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevin@REDACTED Tue Jan 8 19:11:55 2008 From: kevin@REDACTED (Kevin A. Smith) Date: Tue, 8 Jan 2008 13:11:55 -0500 Subject: [erlang-questions] Query string encode/decode Message-ID: Can someone point me at Erlang code which does the equivalent of Java's URLEncoder/Decoder classes? I need to process URL query strings and make sure that the names/values are properly encoded. --Kevin From tsuraan@REDACTED Tue Jan 8 19:12:57 2008 From: tsuraan@REDACTED (tsuraan) Date: Tue, 8 Jan 2008 12:12:57 -0600 Subject: [erlang-questions] Securely running code on an untrusted client In-Reply-To: <4d08db370801080031g41cc5085t1b8949dc739e0dda@mail.gmail.com> References: <3605cb0801062228j5e791b7cme34dc5cc68fb575b@mail.gmail.com> <4781CE4F.3060507@ericsson.com> <3605cb0801071122w5d688156if5abaf777a3fe487@mail.gmail.com> <47828298.8020507@ericsson.com> <4d08db370801080031g41cc5085t1b8949dc739e0dda@mail.gmail.com> Message-ID: <84fb38e30801081012w73b53b4fx1fd4960a0a6c7ddd@mail.gmail.com> > > You can't solve it! You must trust at least some client even use > SETI/Boinc redundant approach. > It does depend somewhat on the problem though; some things are really asymmetric to calculate, and those can be easily verified. For example, if you're setting up a distributed network to crack a sha1 password file, you could send jobs out to millions of potentially untrusted clients. When they return succesful cracks, it's really easy to verify that the client is correct. I'm not sure if this applies to the problem at hand, but there might be some asymmetry to exploit. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevin@REDACTED Tue Jan 8 19:32:20 2008 From: kevin@REDACTED (Kevin A. Smith) Date: Tue, 8 Jan 2008 13:32:20 -0500 Subject: [erlang-questions] Query string encode/decode In-Reply-To: <6a36e7290801081019ib1489bas74b1d2110522a867@mail.gmail.com> References: <6a36e7290801081019ib1489bas74b1d2110522a867@mail.gmail.com> Message-ID: <73A9B1AD-EE38-4D39-98A1-2395F18E4608@hypotheticalabs.com> Exactly what I was looking for. Thanks a bunch! --Kevin On Jan 8, 2008, at 1:19 PM, Bob Ippolito wrote: > http://mochiweb.googlecode.com/svn/trunk/src/mochiweb_util.erl > > On Jan 8, 2008 10:11 AM, Kevin A. Smith > wrote: >> Can someone point me at Erlang code which does the equivalent of >> Java's URLEncoder/Decoder classes? I need to process URL query >> strings >> and make sure that the names/values are properly encoded. >> >> --Kevin >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> From roger.larsson@REDACTED Tue Jan 8 22:24:47 2008 From: roger.larsson@REDACTED (Roger Larsson) Date: Tue, 8 Jan 2008 22:24:47 +0100 Subject: [erlang-questions] Securely running code on an untrusted client In-Reply-To: <84fb38e30801081012w73b53b4fx1fd4960a0a6c7ddd@mail.gmail.com> References: <3605cb0801062228j5e791b7cme34dc5cc68fb575b@mail.gmail.com> <4d08db370801080031g41cc5085t1b8949dc739e0dda@mail.gmail.com> <84fb38e30801081012w73b53b4fx1fd4960a0a6c7ddd@mail.gmail.com> Message-ID: <200801082224.47378.roger.larsson@norran.net> On tisdag 08 januari 2008, tsuraan wrote: > > You can't solve it! You must trust at least some client even use > > SETI/Boinc redundant approach. > > It does depend somewhat on the problem though; some things are really > asymmetric to calculate, and those can be easily verified. For example, if > you're setting up a distributed network to crack a sha1 password file, you > could send jobs out to millions of potentially untrusted clients. When > they return succesful cracks, it's really easy to verify that the client is > correct. I'm not sure if this applies to the problem at hand, but there > might be some asymmetry to exploit. But the ones whose password you try to crack might add hundreds of clients that always return failure (and since they know what to return they can be quite fast about it...) So how many clients do you now have to put each work on? /RogerL From exta7@REDACTED Wed Jan 9 00:45:28 2008 From: exta7@REDACTED (Zvi) Date: Tue, 8 Jan 2008 15:45:28 -0800 (PST) Subject: [erlang-questions] Hungarian notation for Erlang / ETL Message-ID: <14701912.post@talk.nabble.com> Is there some kind of Hungarian notation for Erlang? i.e. prefix or postfix naming convention. As Erlang has dynamic typing and somewhat confuzed about string datatype, I constantly make errors when mixing lists and binary strings. This is reminding me situation when programming C++ for Win32, where you have zero-terminated, STL, MFC, BSTR and other string representations. I saw atleast one .erl sorce code, where the author using "B" postfix for binaries, i.e. Query - is query string list, but QueryB - is query string binary. The other confused datatypes in Erlang is arrays/vectors and dictionaries/maps/hashtables. Another question: is there something like C++ STL in Erlang? I.e. ADTs conforming to the same behavior(s). The behavior should implement all the HOFs and generic algorithms, instead of STL iterators. Thanks Zvi -- View this message in context: http://www.nabble.com/Hungarian-notation-for-Erlang---ETL-tp14701912p14701912.html Sent from the Erlang Questions mailing list archive at Nabble.com. From david_holz@REDACTED Wed Jan 9 02:07:48 2008 From: david_holz@REDACTED (David Holz) Date: Wed, 9 Jan 2008 01:07:48 +0000 Subject: [erlang-questions] Hungarian notation for Erlang / ETL In-Reply-To: <14701912.post@talk.nabble.com> References: <14701912.post@talk.nabble.com> Message-ID: From: exta7@REDACTED > Is there some kind of Hungarian notation for Erlang? i.e. prefix or postfix > naming convention. Hungarian notation is the absolute wrong solution to type confusion (or any other problem). The new type annotations will eventually provide optional type information available to both the compiler and IDEs for keeping things straight. It won't be long before it's an official part of the release; the annotation handling is in there already, just not documented. I would, though, also like to see some sort of actual OO-ish interface to a block of data that can dispatch to the proper behavior for that specific data term. Java's collections and IO streams, while verbose, are incredibly usable implementations of that idea at their core. With Erlang, however, it might mean that your data item is held by its own process, with a well-defined messaging interface, and might want some sort of automatic deferring to a parent process/module for unhandled calls or messages in the receive loop. _________________________________________________________________ Share life as it happens with the new Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008 From bob@REDACTED Tue Jan 8 19:19:59 2008 From: bob@REDACTED (Bob Ippolito) Date: Tue, 8 Jan 2008 10:19:59 -0800 Subject: [erlang-questions] Query string encode/decode In-Reply-To: References: Message-ID: <6a36e7290801081019ib1489bas74b1d2110522a867@mail.gmail.com> http://mochiweb.googlecode.com/svn/trunk/src/mochiweb_util.erl On Jan 8, 2008 10:11 AM, Kevin A. Smith wrote: > Can someone point me at Erlang code which does the equivalent of > Java's URLEncoder/Decoder classes? I need to process URL query strings > and make sure that the names/values are properly encoded. > > --Kevin > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From ft@REDACTED Wed Jan 9 08:29:36 2008 From: ft@REDACTED (Fredrik Thulin) Date: Wed, 09 Jan 2008 08:29:36 +0100 Subject: [erlang-questions] Securely running code on an untrusted client In-Reply-To: <84fb38e30801081012w73b53b4fx1fd4960a0a6c7ddd@mail.gmail.com> References: <3605cb0801062228j5e791b7cme34dc5cc68fb575b@mail.gmail.com> <4781CE4F.3060507@ericsson.com> <3605cb0801071122w5d688156if5abaf777a3fe487@mail.gmail.com> <47828298.8020507@ericsson.com> <4d08db370801080031g41cc5085t1b8949dc739e0dda@mail.gmail.com> <84fb38e30801081012w73b53b4fx1fd4960a0a6c7ddd@mail.gmail.com> Message-ID: <478477E0.3020102@it.su.se> tsuraan wrote: >> You can't solve it! You must trust at least some client even use >> SETI/Boinc redundant approach. >> > > It does depend somewhat on the problem though; some things are really > asymmetric to calculate, and those can be easily verified. For example, if > you're setting up a distributed network to crack a sha1 password file, you > could send jobs out to millions of potentially untrusted clients. When they > return succesful cracks, it's really easy to verify that the client is > correct. I'm not sure if this applies to the problem at hand, but there > might be some asymmetry to exploit. The costly thing in that example is to verify the opposite of a successful crack. If evil-client finds the key, but lies about it and say that "the key is NOT in the block I just checked" then all the other clients will continue searching for the key until the end of time, without any possibility of ever finding it. /Fredrik From erlang@REDACTED Wed Jan 9 12:23:06 2008 From: erlang@REDACTED (Peter Lund) Date: Wed, 09 Jan 2008 12:23:06 +0100 Subject: [erlang-questions] ssh rekeying patch for OTP-R12 Message-ID: <4784AE9A.4070707@lundata.se> This summer we at Synapse got a bug reported from one of our customers. The erlang ssh client implementation fails on the rekeying procedure that often happen after 1GB of transfered data. Since you at OTP changed the name of the ssh_proto.erl file to ssh_transport.erl when importing this feature to OTP-R12, you need to take this into account when reading the attached patch diff. /Peter -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ssh_1GB_fix.patch URL: From klacke@REDACTED Wed Jan 9 13:27:39 2008 From: klacke@REDACTED (Claes Wikstrom) Date: Wed, 09 Jan 2008 13:27:39 +0100 Subject: [erlang-questions] Speeding up text file I/O In-Reply-To: <87hchpg3vh.fsf@mid.deneb.enyo.de> References: <87hchpg3vh.fsf@mid.deneb.enyo.de> Message-ID: <4784BDBB.709@hyber.org> Florian Weimer wrote: > Is there a way to read lines from a text files more quickly than the > excerpt below? This runs over 100 times slower than a "wc -l": > http://yaws.hyber.org/download/bfile-1.0.tgz /klacke From exta7@REDACTED Wed Jan 9 13:36:39 2008 From: exta7@REDACTED (Zvi) Date: Wed, 9 Jan 2008 04:36:39 -0800 (PST) Subject: [erlang-questions] Hungarian notation for Erlang / ETL In-Reply-To: References: <14701912.post@talk.nabble.com> Message-ID: <14710892.post@talk.nabble.com> 1. I also hate Hungarian notation and doesn't use it even in C++ (except m_ prefix), but I still need a solution for current version of Elrang (does it mean that I need always use Dyalizer?). 2. I wasn't talking about implementing object using Erlang processes. I talking about much simpler and functional solution, like providing behaviour, like: -module(collection). -export([behaviour_info/1]). behaviour_info(callbacks) -> [{new,0}, {length,1}, {to_string,1}, {from_string,1}, {map,2}, {foldl,2}, {foldr,2}, {sort,1}, %% etc... ]; behaviour_info(_Other) -> undefined. then each ADT will implement this bahaviour, like: -module(queue). -behaviour(collection). %% ... -module(set). -behaviour(collection). %% ... -module(stack). -behaviour(collection). %% ... etc. Zvi David Holz wrote: > > > From: exta7@REDACTED >> Is there some kind of Hungarian notation for Erlang? i.e. prefix or >> postfix >> naming convention. > > Hungarian notation is the absolute wrong solution to type confusion (or > any other problem). The new type annotations will eventually provide > optional type information available to both the compiler and IDEs for > keeping things straight. It won't be long before it's an official part of > the release; the annotation handling is in there already, just not > documented. > > I would, though, also like to see some sort of actual OO-ish interface to > a block of data that can dispatch to the proper behavior for that specific > data term. Java's collections and IO streams, while verbose, are > incredibly usable implementations of that idea at their core. With > Erlang, however, it might mean that your data item is held by its own > process, with a well-defined messaging interface, and might want some sort > of automatic deferring to a parent process/module for unhandled calls or > messages in the receive loop. > > _________________________________________________________________ > Share life as it happens with the new Windows Live. > http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008 > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- View this message in context: http://www.nabble.com/Hungarian-notation-for-Erlang---ETL-tp14701912p14710892.html Sent from the Erlang Questions mailing list archive at Nabble.com. From erlang@REDACTED Wed Jan 9 15:33:12 2008 From: erlang@REDACTED (Dominic Williams) Date: Wed, 9 Jan 2008 09:33:12 -0500 (EST) Subject: [erlang-questions] Hungarian notation for Erlang / ETL Message-ID: <13480.217.128.75.198.1199889192.squirrel@www.geekisp.com> Hi Zvi, > Is there some kind of Hungarian notation for Erlang? > i.e. prefix or postfix naming convention. As Erlang has > dynamic typing and somewhat confuzed about string datatype, I > constantly make errors when mixing lists and binary strings. To my knowledge there is no conventional hungarian-like notation for Erlang, and I believe that would definitely not be the solution to type confusion. I think the best way to embrace dynamic typing is to use test-driven development. When you only ever write code to a failing test, you will catch type errors immediately. With this as a safety net, type "confusion" can actually be seen as an advantage: call it type "abstraction" and write functions without caring too much about the type. You will end up with many functions that turn out working regardless of whether they are passed a string or a binary (especially functions that operate on heterogenous lists). Less code, and better separation of concerns (functions are algorithms, data is separate). > Another question: is there something like C++ STL in Erlang? > I.e. ADTs conforming to the same behavior(s). The behavior > should implement all the HOFs and generic algorithms, instead > of STL iterators. The equivalent to STL iterators and algorithms is to use lists, list comprehensions and higher-order functions (lists:foreach/2 etc). There are some ADT's in Erlang (check out dict, orddict, set and ordset modules). Regards, Dominic Williams http://dominicwilliams.net ---- From richardc@REDACTED Wed Jan 9 16:56:06 2008 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 09 Jan 2008 16:56:06 +0100 Subject: [erlang-questions] Hungarian notation for Erlang / ETL In-Reply-To: <14701912.post@talk.nabble.com> References: <14701912.post@talk.nabble.com> Message-ID: <4784EE96.3050507@it.uu.se> Zvi wrote: > Is there some kind of Hungarian notation for Erlang? i.e. prefix or postfix > naming convention. > As Erlang has dynamic typing and somewhat confuzed about string datatype, I > constantly make errors when mixing lists and binary strings. This is > reminding me situation when programming C++ for Win32, where you have > zero-terminated, STL, MFC, BSTR and other string representations. > I saw atleast one .erl sorce code, where the author using "B" postfix for > binaries, i.e. Query - is query string list, but QueryB - is query string In general, Hungarian notation is a very bad idea. The reason is that it is actually a *comment*, which tries to remind you about what type of value a variable should be bound to. But as all comments, they rot. So after some time, as representations get changed, a programmer (let's assume it's not you, but someone else, two years from now) either has to rename all variables (not likely), or live with the misleading names (sucks). Basically: never, ever, use names that refer to implementation details which may change, such as types. To reduce confusion, write down your assumptions about types etc. in comments above at least the main functions (preferably, use edoc). However, you might well use conventions for *roles*. For example, in C/C++, people often include a 'p' to indicate a pointer variable. This is not just a type indicator, because with pointers you need to use explicit dereferencing - they have to be handled differently from plain values. Hence, if you change something from a pointer to a nonpointer, you would be rewriting your program anyway, so renaming the variables is not such a big deal. But there seems to be few such naming conventions in Erlang programs. (There are of course conventions, but not very systematic ones; mostly things like including 'Pid' in a name if it is supposed to be a process identifier - this may be motivated by the same reasoning as for pointers in C.) Furthermore, as Dominic noted, when you write your programs using names that do not say too much about what they are supposed to be, you tend to realize much easier that pieces of your code are actually much more general, and can be lifted out to separate, polymorphic functions. I agree that it would be nice with some more general functions for working on "collections" and "strings" in general, similar to the STL, but currently there is no such library (and it would incur some overhead). It is however easy to write an abstraction layer for those datatypes like tables, strings, etc., so that you can change implementations more easily if you think it might become necessary. /Richard From w.a.de.jong@REDACTED Wed Jan 9 17:00:38 2008 From: w.a.de.jong@REDACTED (Willem de Jong) Date: Wed, 9 Jan 2008 17:00:38 +0100 Subject: [erlang-questions] Exception in xmerl, when pasing XML with non UTF8 character set In-Reply-To: <14674437.post@talk.nabble.com> References: <14588326.post@talk.nabble.com> <4781D817.8090203@ericsson.com> <14669389.post@talk.nabble.com> <14674437.post@talk.nabble.com> Message-ID: <407d9ef80801090800q67848043wbc49107b25c2719c@mail.gmail.com> Hi, Similar to what Bertil suggested for Xmerl, you can achieve this in Erlsom by adding a clause "windows-1252" -> 'iso-8859-1'; %% note: this is actually introducing a bug %% in order to work around a problem! to the case statement in encoding_type() in erlsom_lib.erl. I would be interested to know why you think it will be necessary to replace it by a C++ port. It seems to me that it will be complicating things considerably. What are the requirements that make this necessary? What properties should an Erlang XML parser have? Regards, Willem On 1/7/08, Zvi wrote: > > > XML generated by closed-source 3rd party Windows server (if it was > generated > by me, then it was encoded in utf-8). > I asking here questions from Erlang domain, not the obvious & ugly common > sence solutions, like reading the entire file into memory, changing the > encoding string and only then feeding it into xmerl. (the problem only > that > this XML can be quite big, like 0.5 MB and more). > Maybe xmerl has some option for forcing encoding, other than specified in > the PI? > Maybe there is some other XML parser like erlsom or expat driver, which > supports windows-1252 encoding? > Anyway I using xmerl just for prototyping, the long term solution will be > to > write C++ port, which will be doing all the XML processing and return > Erlang > terms in either text or binary form, which can be read either by > file:consult or binary_to_term on the Erlang side. > > ZVi > > > Christian S wrote: > > > > Why not ask yourself how to change your xml so it says iso-8859-1 as you > > say > > it should be doing? > > > > http://en.wikipedia.org/wiki/Garbage_In,_Garbage_Out > > > > On Jan 7, 2008 5:22 PM, Zvi wrote: > >> > >> Bertil, > >> > >> thanks for the reply. > >> Actually the charcter set used is always latin-1, but for some reason > 3rd > >> party software call it windows-1252 . So if you can tell me, what I > >> should > >> change in xmerl, so it will threat windows-1252 as Latin-1 . > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > View this message in context: > http://www.nabble.com/Exception-in-xmerl%2C-when-pasing-XML-with-non-UTF8-character-set-tp14588326p14674437.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 david_holz@REDACTED Wed Jan 9 23:24:06 2008 From: david_holz@REDACTED (David Holz) Date: Wed, 9 Jan 2008 22:24:06 +0000 Subject: [erlang-questions] Hungarian notation for Erlang / ETL In-Reply-To: <14710892.post@talk.nabble.com> References: <14701912.post@talk.nabble.com> <14710892.post@talk.nabble.com> Message-ID: [I really wish reply-to was set to erlang-questions@REDACTED, or maybe hotmail is just stupid. Yet again, I accidentally first replied to the sender instead of the list.] From: exta7@REDACTED > 2. I wasn't talking about implementing object using Erlang processes. I > talking about much simpler and functional solution, like providing > behaviour, like: > > -module(collection). > -export([behaviour_info/1]). > > -module(queue). > -behaviour(collection). > > %% ... > > -module(set). > -behaviour(collection). > > %% ... > > -module(stack). > -behaviour(collection). The shortcoming of that is that there is no dispatch to the correct module for that datatype. You can't just do length(Data), you'd have to explicitly know to call queue:length(Data) or set:length(Data), etc. You can't just pass around a data object because that doesn't indicate which module's functions to use on it. I could see a similar packaging to records being used: Queue module returns {queue, [Data]}, stack module returns {stack, [Data]}, etc and in the collection module it simply dispatches to whatever module is named in the first field: collection:length(A = {Module, _}) -> Module:length(A) end. collection:to_string(A = {Module, _}) -> Module:to_string(A) end. etc Of course, this is exactly what OO implementations do, having a vtable or type identifier embedded in each object to tell what class's methods to call when using the object. _________________________________________________________________ Put your friends on the big screen with Windows Vista? + Windows Live?. http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_012008 From fess-erlang@REDACTED Thu Jan 10 00:11:15 2008 From: fess-erlang@REDACTED (fess) Date: Wed, 9 Jan 2008 15:11:15 -0800 Subject: [erlang-questions] RRDtool? Message-ID: <664288DE-E85B-49E0-9ACE-4A981CCDD9A0@fess.org> Hi, I'm embarking on a project monitor machines and internals of our erlang applications using RRDTool. Is anyone using RRDTool with Erlang? Any recommended libraries already written to help with interfacing with RRDs? Quickly searching I find reference to eRRD http://shdh.org.nz/wiki/ errd which claims to be RRD bindings for erlang however I see nothing actually there. Also I did find a reference on this list, http://www.erlang.org/ pipermail/erlang-questions/2004-July/012745.html in 2004, from Anders Nygren that he had written something, so I'm cc'ing him as well. I also notice that in Pete Kazmier tutorial "Writing an Erlang Port using OTP Principles" [ http://www.trapexit.org/ Writing_an_Erlang_Port_using_OTP_Principles ] He mentions that his motivation for writing a port was to interface with RRDTool. Is there standard/public code to use RRDtool from within erlang, or should I continue and roll my own port? Any advice/guidance is appreciated. Thanks. --fess From jeffm@REDACTED Thu Jan 10 01:02:31 2008 From: jeffm@REDACTED (jm) Date: Thu, 10 Jan 2008 11:02:31 +1100 Subject: [erlang-questions] RRDtool? In-Reply-To: <664288DE-E85B-49E0-9ACE-4A981CCDD9A0@fess.org> References: <664288DE-E85B-49E0-9ACE-4A981CCDD9A0@fess.org> Message-ID: <47856097.3000902@ghostgun.com> fess wrote: > Hi, > > I'm embarking on a project monitor machines and internals of our > erlang applications using RRDTool. Can you elaborate on the project? Is it a stand alone monitor or something which could be rolled into one? I find our current monitoring system nagios somewhat limiting. As such I keep thinking about writing one, but like everyone else should be doing other things. Jeff. From fess-erlang@REDACTED Thu Jan 10 02:05:32 2008 From: fess-erlang@REDACTED (fess) Date: Wed, 9 Jan 2008 17:05:32 -0800 Subject: [erlang-questions] RRDtool? In-Reply-To: <47856097.3000902@ghostgun.com> References: <664288DE-E85B-49E0-9ACE-4A981CCDD9A0@fess.org> <47856097.3000902@ghostgun.com> Message-ID: <89E9C462-8EE8-44EB-A00A-94DD26443F71@fess.org> On Jan 9, 2008, at 4:02 PM, jm wrote: > fess wrote: >> Hi, >> >> I'm embarking on a project to monitor machines and internals of our >> erlang applications using RRDTool. > > Can you elaborate on the project? Is it a stand alone monitor or > something which could be rolled into one? I find our current > monitoring > system nagios somewhat limiting. As such I keep thinking about writing > one, but like everyone else should be doing other things. hmm, my goal is simply to make it easy to collect and view graphs of things. I plan to be able to send "metric" messages from any part of our erlang apps and have them stored to RRDs. [ how many widgets have I processed, how backlogged is my queue, how many errors am I ignoring ] then have a graph browser tool and a graph designer tool, graph designer tool would produce URLS to a REST style interface to RRD graphs. the URLS would be placed wherever needed to make good presentations about the state of the system [ wikis, other tools, etc. ] I also plan to have a gateway for apps external to erlang to feed metrics into the system, so we can add in regular system metrics such as cpu/mem/disk usage, if we want everything in one place. Also, I'm not sure how I want to fit alerting off this data in, but it would be an obvious next step. So, it's kinda orthongal to nagios in that it's more about metric collection, less about custom service monitors. The big goal is that it become as _easy_ as possible to collect and view data. --fess From matthew@REDACTED Thu Jan 10 00:23:54 2008 From: matthew@REDACTED (Matthew Dempsky) Date: Wed, 9 Jan 2008 15:23:54 -0800 Subject: [erlang-questions] Exception in xmerl, when pasing XML with non UTF8 character set In-Reply-To: <14674437.post@talk.nabble.com> References: <14588326.post@talk.nabble.com> <4781D817.8090203@ericsson.com> <14669389.post@talk.nabble.com> <14674437.post@talk.nabble.com> Message-ID: On 1/7/08, Zvi wrote: > I asking here questions from Erlang domain, not the obvious & ugly common > sence solutions, like reading the entire file into memory, changing the > encoding string and only then feeding it into xmerl. (the problem only that > this XML can be quite big, like 0.5 MB and more). Half a megabyte isn't "quite large." Just read it into memory as a binary and hack it up as necessary to substitute the character encoding attribute. Adding contrived code to xmerl to handle broken XML files is the uglier solution. From kosik@REDACTED Thu Jan 10 09:21:58 2008 From: kosik@REDACTED (Matej Kosik) Date: Thu, 10 Jan 2008 09:21:58 +0100 Subject: [erlang-questions] RRDtool? In-Reply-To: <664288DE-E85B-49E0-9ACE-4A981CCDD9A0@fess.org> References: <664288DE-E85B-49E0-9ACE-4A981CCDD9A0@fess.org> Message-ID: <4785D5A6.7040608@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 fess wrote: > Hi, > > I'm embarking on a project monitor machines and internals of our > erlang applications using RRDTool. > > Is anyone using RRDTool with Erlang? Any recommended libraries > already written to help with interfacing with RRDs? > > Quickly searching I find reference to eRRD http://shdh.org.nz/wiki/ > errd which claims to be RRD bindings for erlang however I see > nothing actually there. > Also I did find a reference on this list, http://www.erlang.org/ > pipermail/erlang-questions/2004-July/012745.html in 2004, from Anders > Nygren that > he had written something, so I'm cc'ing him as well. > > I also notice that in Pete Kazmier tutorial "Writing an Erlang Port > using OTP Principles" [ http://www.trapexit.org/ > Writing_an_Erlang_Port_using_OTP_Principles ] He mentions that his > motivation for writing a port was to interface with RRDTool. Is > there standard/public code to use RRDtool from within erlang, or > should I continue and roll my own port? > > > Any advice/guidance is appreciated. Thanks. For our NMS I needed RRD too. Here is my (certainly not the only one) reimplementation. http://altair.sk:60001/uploads/ It was my second Erlang server (so I still enjoined it in that time). It works well for several months. Regards - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHhdWmL+CaXfJI/hgRAkNCAJ9OZdaWvhmvsdrgx3qtG0ft/3hvBgCfaMhN vUJ4dhTcDjk75IxgeqWien4= =1eKW -----END PGP SIGNATURE----- From exta7@REDACTED Thu Jan 10 15:24:43 2008 From: exta7@REDACTED (Zvi) Date: Thu, 10 Jan 2008 06:24:43 -0800 (PST) Subject: [erlang-questions] "processor affinity" for processes In-Reply-To: <95be1d3b0704130047r974f440s77377e0dafedace8@mail.gmail.com> References: <95be1d3b0704120319m4c8a225cjbc86b77a2d8f96a5@mail.gmail.com> <461E2D70.2080306@ericsson.com> <95be1d3b0704130047r974f440s77377e0dafedace8@mail.gmail.com> Message-ID: <14734902.post@talk.nabble.com> Another usefull feature will be specifying CPU Affinity for ports and external processes launched via os:cmd/1 . My current workarround is to launch script whcih temporary changing CPU affinity of the executable. Zvi Vlad Dumitrescu-2 wrote: > > Thanks for the reply! > > regards, > Vlad > > On 4/12/07, Rickard Green wrote: >> Vlad Dumitrescu wrote: >> > Hi all, >> > >> > I can't find anything about this, and I suppose it's because there is >> > no such feature, but I wonder if it's possible to specify a "processor >> > affinity" for processes when run with the SMP VM. >> > >> >> There is no such feature. >> >> > A use-case would be to dedicate one processor/core for trace handlers, >> > loggers and other "peripheral" activities. >> > >> > Or maybe it doesn't matter in practice? >> > >> >> We have been talking about letting the emulator have more control over >> activities on the different cores, but this is still on the todo list. >> As it is today, the emulator creates X number of threads, and leave it >> up to the OS to distribute these threads over available cores. >> >> BR, >> Rickard Green, Erlang/OTP, Ericsson AB. >> >> > 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 > > -- View this message in context: http://www.nabble.com/%22processor-affinity%22-for-processes-tp9956818p14734902.html Sent from the Erlang Questions mailing list archive at Nabble.com. From opendev@REDACTED Thu Jan 10 15:47:16 2008 From: opendev@REDACTED (Joern) Date: Thu, 10 Jan 2008 15:47:16 +0100 Subject: [erlang-questions] RRDtool? In-Reply-To: <89E9C462-8EE8-44EB-A00A-94DD26443F71@fess.org> References: <664288DE-E85B-49E0-9ACE-4A981CCDD9A0@fess.org> <47856097.3000902@ghostgun.com> <89E9C462-8EE8-44EB-A00A-94DD26443F71@fess.org> Message-ID: <9e009ad0801100647n5042c897x652a30987847bc0c@mail.gmail.com> Hi, On 1/10/08, fess wrote: > hmm, my goal is simply to make it easy to collect and view graphs of > things. Have you considered maintaining a statistics table in mnesia and exposing that using snmp? If you can live with writing MIBs that's fairly simple and powerful. rgs/joern -- From lenartlad@REDACTED Thu Jan 10 15:21:46 2008 From: lenartlad@REDACTED (Ladislav Lenart) Date: Thu, 10 Jan 2008 15:21:46 +0100 Subject: [erlang-questions] bug: EPP reply messages fill (shell) mailbox when calling make Message-ID: <478629FA.5060504@volny.cz> Hello, I've just noticed that after calling make:all() from Erlang shell, the shell mailbox gets filled with messages {epp_reply, Pid, ok} and {epp_reply, Pid, {eof, Line}}. These messages are sent by epp during check_includes/3 in make. I think they should be collected from the mailbox by epp API functions (or not sent at all?). Ladislav Lenart From fess-erlang@REDACTED Thu Jan 10 18:38:43 2008 From: fess-erlang@REDACTED (fess) Date: Thu, 10 Jan 2008 09:38:43 -0800 Subject: [erlang-questions] RRDtool? In-Reply-To: <9e009ad0801100647n5042c897x652a30987847bc0c@mail.gmail.com> References: <664288DE-E85B-49E0-9ACE-4A981CCDD9A0@fess.org> <47856097.3000902@ghostgun.com> <89E9C462-8EE8-44EB-A00A-94DD26443F71@fess.org> <9e009ad0801100647n5042c897x652a30987847bc0c@mail.gmail.com> Message-ID: On Jan 10, 2008, at 6:47 AM, Joern wrote: > Hi, > > On 1/10/08, fess wrote: > >> hmm, my goal is simply to make it easy to collect and view graphs of >> things. > > Have you considered maintaining a statistics table in mnesia and > exposing that using snmp? If you can live with writing MIBs that's > fairly simple and powerful. Hmm I did consider storing the stats in mnesia, but I really wanted the graphing power of RRDtool. Didn't really consider exposing stats via snmp though. I have a, likely irrational, dislike of snmp due to various problems in large polling implementations, which I would have to do to get the data back into RRD somewhere. With my current strategy, whenever the application code adds a new statistic it will automatically be collected, I suppose I could have a snmp approach walk an entire leg of some tree on every poll, so that would do the same thing. Thanks for the suggestion, it's worth some thought. --fess From babo.online@REDACTED Thu Jan 10 19:52:39 2008 From: babo.online@REDACTED (Attila Babo) Date: Thu, 10 Jan 2008 20:52:39 +0200 Subject: [erlang-questions] Runtime crash vs. failed internal consistency check Message-ID: <597c69660801101052j20ef514cu502a86daa5f3ebd0@mail.gmail.com> find_9(<<_:16, Buffer/binary>>) -> <>. This silly line of code cause an "Internal consistency check failed" error message in R12B: *find9: function find_9/1+9: Internal consistency check failed - please report this bug. Instruction: {bs_put_integer,{f,0}, {integer,8}, 1, {field_flags,[unsigned,big]}, {x,0}} Error: {match_context,{x,0}}:* This message is a huge improvement, as the same code compiles in R11B6, but causing a runtime crash: *** exited: {badarg,[{find9,find_9,1},{shell,exprs,6},{shell,eval_loop,3}]} ** *Am I correct when suspecting that R12B tries to truncate the binary to a single byte? Attila -------------- next part -------------- An HTML attachment was scrubbed... URL: From dae@REDACTED Thu Jan 10 22:11:42 2008 From: dae@REDACTED (Doug Edmunds) Date: Thu, 10 Jan 2008 13:11:42 -0800 Subject: [erlang-questions] lists:filter/2 Message-ID: <47868A0E.5020104@douglasedmunds.com> Does lists:filter(Pred, List1) -> List2 guarantee to return the filtered items in List2 in the same relative order as unfiltered List1? --dae From masterofquestions@REDACTED Fri Jan 11 01:38:38 2008 From: masterofquestions@REDACTED (Russell King) Date: Thu, 10 Jan 2008 19:38:38 -0500 Subject: [erlang-questions] erlang jungerl make and make lama app failure Message-ID: <1218d6a50801101638i14bafc76o53ebcbb85369974e@mail.gmail.com> Hey guys, I have a few questions to ask about jungerl and erlang in general. Question 1: I am using emakefile, how do I get "erlang make" to move the ./src/some.app file to ebin? My Emakefile: {"./src/*", [debug_info, {outdir, "ebin"}, {i,"include"}]}. This only moves the beam file to ebin. Question 2: I have added "config /absolute/path/to/elog2." after the calling both change directory to another path2 and start_sasl into the file .erlang file. However the log file never get created and erl shell starts up fine with sasl application and it doesn't spit out any errors. If I start the erl shell like: erl -boot start_sasl -config /absolute/path/to/elog2, it does create the file. Question 3: I am trying to install "lama" app in jungerl. I tried making the whole jungerl and just lama app. But it doesn't seem to work. [russ@REDACTED jungerl]$ touch lib/ssh/SKIP [russ@REDACTED jungerl]$ touch lib/rdbms/SKIP [russ@REDACTED jungerl]$ make ./tcp_serv.erl:142: Warning: variable 'Reason' is unused ./tcp_serv.erl:154: Warning: variable 'DebugInfo' is unused ./tcp_serv.erl:154: Warning: variable 'Parent' is unused make[3]: Leaving directory `/home/russ/jungerl/lib/xmlrpc/src' make[2]: Leaving directory `/home/russ/jungerl/lib/xmlrpc' make[1]: Leaving directory `/home/russ/jungerl/lib' I don't get any beam file in ./jungerl/ebin or ./jungerl/lib/app_name/ebin, after I do make. I also tried to compile just one app "lama" that I need . This is not working either. [russ@REDACTED jungerl]$ make conf ./lib/lama (cd config; make) make[1]: Entering directory `/home/russ/jungerl/config' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/russ/jungerl/config' make: Nothing to be done for `lib/lama'. I am running erlang 5.5.5 otp_src_R11B-5.. Checked out the latest jungerl code from sourceforge. Thank you in advance. russ From rvirding@REDACTED Fri Jan 11 02:19:48 2008 From: rvirding@REDACTED (Robert Virding) Date: Fri, 11 Jan 2008 02:19:48 +0100 Subject: [erlang-questions] Erlang concurrency Message-ID: <3dbc6d1c0801101719p2acb348buad3ebc4314dbc0bb@mail.gmail.com> After reading the blogs about how good Erlang's concurrency model is and how we just just made a super implementation of it in XXX I have been led to formulate Virding's First Rule of Programming: Any sufficiently complicated concurrent program in another language contains an ad hoc informally-specified bug-ridden slow implementation of half of Erlang. This is, of course, a mild travesty of Greenspun (*) but I think it is fundamental enough to be my first rule, not the tenth. Robert (*) "Greenspun's Tenth Rule of Programming: any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp." Actually I read that there are no other rules but he thought it sounded better and more important to call it his tenth rule. Lisp, by the way, is a truly wonderful language and I soon will have the solution and can then formulate the one true rule. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikage@REDACTED Fri Jan 11 04:21:04 2008 From: mikage@REDACTED (Mikage Sawatari) Date: Fri, 11 Jan 2008 12:21:04 +0900 Subject: [erlang-questions] process exits while calling gen_tcp:listen Message-ID: <5e448700801101921r48436111vf2efbb266bf95bff@mail.gmail.com> Hello, In some circumstances, calling gen_tcp:listen terminates the process which called it. Conditions are as follows: - Start erl with -s option. - Spawn the process by a process which has been spawned by supervisor. This issue can be produced with the following code. I saw this issue with R12B-0, Linux FedraCore1 (2.4.22) and Linux OpenSUSE 10.2. %% listentest_sup.erl -module(listentest_sup). -behaviour(supervisor). -export([start/0]). -export([init/1]). start() -> io:format("start supervisor~n"), supervisor:start_link({local, listentest}, listentest_sup, []). init(_Args) -> {ok, {{one_for_one, 2, 10}, [ {listentest, {listentest, start, []}, permanent, brutal_kill, worker, [listentest]} ]}}. %% listentest.erl -module(listentest). -export([start/0]). -export([listen/0]). start() -> io:format("spawn listen process~n"), Pid = proc_lib:spawn_link(?MODULE, listen, []), {ok, Pid}. listen() -> io:format("call gen_tcp:listen~n"), Res = gen_tcp:listen(7725, []), io:format("listen: ~p~n", [Res]). %%%% The program is supposed to print "listen: ~p~n" but in the first execution example it doesn't print it. Without supervisor, or without -s option, the process reaches the next line of gen_tcp:listen. ---------------- $ erl -boot start_sasl -s listentest_sup start Erlang (BEAM) emulator version 5.6 [source] [async-threads:0] [hipe] [kernel-poll:false] =PROGRESS REPORT==== 11-Jan-2008::09:57:20 === (snipped) =PROGRESS REPORT==== 11-Jan-2008::09:57:20 === (snipped) =PROGRESS REPORT==== 11-Jan-2008::09:57:20 === (snipped) =PROGRESS REPORT==== 11-Jan-2008::09:57:20 === (snipped) =PROGRESS REPORT==== 11-Jan-2008::09:57:20 === application: sasl started_at: nonode@REDACTED start supervisor spawn listen process call gen_tcp:listen =PROGRESS REPORT==== 11-Jan-2008::09:57:20 === supervisor: {local,listentest} started: [{pid,<0.40.0>}, {name,listentest}, {mfa,{listentest,start,[]}}, {restart_type,permanent}, {shutdown,brutal_kill}, {child_type,worker}] Eshell V5.6 (abort with ^G) 1> ---------------- $ erl -boot start_sasl -s listentest start Erlang (BEAM) emulator version 5.6 [source] [async-threads:0] [hipe] [kernel-poll:false] =PROGRESS REPORT==== 11-Jan-2008::09:58:24 === (snipped) =PROGRESS REPORT==== 11-Jan-2008::09:58:24 === (snipped) =PROGRESS REPORT==== 11-Jan-2008::09:58:24 === (snipped) =PROGRESS REPORT==== 11-Jan-2008::09:58:24 === (snipped) =PROGRESS REPORT==== 11-Jan-2008::09:58:24 === application: sasl started_at: nonode@REDACTED spawn listen process call gen_tcp:listen listen: {ok,#Port<0.96>} Eshell V5.6 (abort with ^G) 1> ---------------- $ erl -boot start_sasl Erlang (BEAM) emulator version 5.6 [source] [async-threads:0] [hipe] [kernel-poll:false] =PROGRESS REPORT==== 11-Jan-2008::09:59:27 === (snipped) =PROGRESS REPORT==== 11-Jan-2008::09:59:27 === (snipped) =PROGRESS REPORT==== 11-Jan-2008::09:59:27 === (snipped) =PROGRESS REPORT==== 11-Jan-2008::09:59:27 === (snipped) =PROGRESS REPORT==== 11-Jan-2008::09:59:27 === application: sasl started_at: nonode@REDACTED Eshell V5.6 (abort with ^G) 1> listentest_sup:start(). start supervisor spawn listen process call gen_tcp:listen =PROGRESS REPORT==== 11-Jan-2008::09:59:37 === supervisor: {local,listentest} started: [{pid,<0.42.0>}, {name,listentest}, {mfa,{listentest,start,[]}}, {restart_type,permanent}, {shutdown,brutal_kill}, {child_type,worker}] {ok,<0.41.0>} listen: {ok,#Port<0.106>} spawn listen process (snipped) -- ----------------------------------------------------------------------- SAWATARI Mikage (SANO Taku) From bcully@REDACTED Fri Jan 11 04:56:38 2008 From: bcully@REDACTED (Brian Cully) Date: Thu, 10 Jan 2008 22:56:38 -0500 Subject: [erlang-questions] process exits while calling gen_tcp:listen In-Reply-To: <5e448700801101921r48436111vf2efbb266bf95bff@mail.gmail.com> References: <5e448700801101921r48436111vf2efbb266bf95bff@mail.gmail.com> Message-ID: You need to accept on this socket in the listentest process, otherwise it exits almost immediately. gen_tcp:listen/2 is only suitable for binding to a port with a set of options. Once you've bound the port, you still need to accept connections on it in order to do anything. -bjc On 10-Jan-2008, at 22:21, Mikage Sawatari wrote: > erl -boot start_sasl -s listentest start From mikage@REDACTED Fri Jan 11 05:28:38 2008 From: mikage@REDACTED (Mikage Sawatari) Date: Fri, 11 Jan 2008 13:28:38 +0900 Subject: [erlang-questions] process exits while calling gen_tcp:listen In-Reply-To: References: <5e448700801101921r48436111vf2efbb266bf95bff@mail.gmail.com> Message-ID: <5e448700801102028i521e7847s82570d4c56eaa3eb@mail.gmail.com> In the original code, accept is called. The sample is an excerpt of only the problem part. The problem is that the succeeding line of gen_tcp:listen is not executed. Thank, you. On 1/11/08, Brian Cully wrote: > You need to accept on this socket in the listentest process, > otherwise it exits almost immediately. gen_tcp:listen/2 is only > suitable for binding to a port with a set of options. Once you've > bound the port, you still need to accept connections on it in order to > do anything. > > -bjc > > On 10-Jan-2008, at 22:21, Mikage Sawatari wrote: > > > erl -boot start_sasl -s listentest start > > -- ----------------------------------------------------------------------- SAWATARI Mikage (SANO Taku) From erlang@REDACTED Fri Jan 11 08:53:28 2008 From: erlang@REDACTED (Dominic Williams) Date: Fri, 11 Jan 2008 08:53:28 +0100 Subject: [erlang-questions] lists:filter/2 In-Reply-To: <47868A0E.5020104@douglasedmunds.com> References: <47868A0E.5020104@douglasedmunds.com> Message-ID: <47872078.1020401@dominicwilliams.net> Hi Doug, > Does lists:filter(Pred, List1) -> List2 > > guarantee to return the filtered items in List2 > in the same relative order as unfiltered List1? If you check the code of lists.erl, you'll find filter/2 is implemented using a list comprehension: filter(Pred, List) when is_function(Pred, 1) -> [ E || E <- List, Pred(E) ]. List comprehensions definitely preserve order. Regards, Dominic Williams http://dominicwilliams.net ---- From andreas.hillqvist@REDACTED Fri Jan 11 08:56:11 2008 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Fri, 11 Jan 2008 08:56:11 +0100 Subject: [erlang-questions] Runtime crash vs. failed internal consistency check In-Reply-To: <597c69660801101052j20ef514cu502a86daa5f3ebd0@mail.gmail.com> References: <597c69660801101052j20ef514cu502a86daa5f3ebd0@mail.gmail.com> Message-ID: <8268eea30801102356o4ada6f0fw5c8afa73d1f3ce1e@mail.gmail.com> >From the Erlang/OTP bit-syntax documentation: Type= integer | float | binarybytes | bitstring | bits The default is integer, bytes is a shorthand for binary and bits is a shorthand for bitstring Erlang assumes that your variable contains an Integer. AFAIK Erlang dose not implicitly convert binarys to integers. I guess it should have been reported as badarg/type mismatch error. The "correct" code should be something like: find_9(<<_:16, Buffer/binary>>) -> Buffer. Or: find_9(<<_:16, Buffer/binary>>) -> <>. Regards Andreas Hillqvist 2008/1/10, Attila Babo : > find_9(<<_:16, Buffer/binary>>) -> <>. > > This silly line of code cause an "Internal consistency check failed" error > message in R12B: > > find9: function find_9/1+9: > Internal consistency check failed - please report this bug. > Instruction: {bs_put_integer,{f,0}, > {integer,8}, > 1, > {field_flags,[unsigned,big]}, > {x,0}} > Error: {match_context,{x,0}}: > > This message is a huge improvement, as the same code compiles in R11B6, but > causing a runtime crash: > > ** exited: > {badarg,[{find9,find_9,1},{shell,exprs,6},{shell,eval_loop,3}]} > ** > > Am I correct when suspecting that R12B tries to truncate the binary to a > single byte? > > Attila > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From dmitriid@REDACTED Fri Jan 11 09:14:42 2008 From: dmitriid@REDACTED (Dmitrii 'Mamut' Dimandt) Date: Fri, 11 Jan 2008 10:14:42 +0200 Subject: [erlang-questions] Erlang concurrency In-Reply-To: <3dbc6d1c0801101719p2acb348buad3ebc4314dbc0bb@mail.gmail.com> References: <3dbc6d1c0801101719p2acb348buad3ebc4314dbc0bb@mail.gmail.com> Message-ID: <47872572.1050403@gmail.com> Robert Virding wrote: > After reading the blogs about how good Erlang's concurrency model is > and how we just just made a super implementation of it in XXX I have > been led to formulate Virding's First Rule of Programming: > > Any sufficiently complicated concurrent program in another language > contains an ad hoc informally-specified bug-ridden slow implementation > of half of Erlang. > Sorry to disappoint you, but this has been done before :) http://www.nabble.com/Erlang-for-desktop-applications--tp5673521p5962663.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn@REDACTED Fri Jan 11 10:52:28 2008 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 11 Jan 2008 10:52:28 +0100 Subject: [erlang-questions] Runtime crash vs. failed internal consistency check In-Reply-To: <597c69660801101052j20ef514cu502a86daa5f3ebd0@mail.gmail.com> References: <597c69660801101052j20ef514cu502a86daa5f3ebd0@mail.gmail.com> Message-ID: "Attila Babo" writes: > find_9(<<_:16, Buffer/binary>>) -> <>. > > This silly line of code cause an "Internal consistency check failed" error > message in R12B: We have fixed this bug in the development version of R12B-1, but we have not released a patch for it. (Not much need for a patch, because the code would fail at run-time anyway.) /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From kosik@REDACTED Fri Jan 11 11:40:53 2008 From: kosik@REDACTED (Matej Kosik) Date: Fri, 11 Jan 2008 11:40:53 +0100 Subject: [erlang-questions] about fun vs. functions schisofrenia Message-ID: <478747B5.6060307@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Friends, What do you think about artificial discrimination between "funs" and functions in Erlang? I came from a language (Pict) where these could be used interchangably. In Erlang, these things cannot be used interchangably and this leads to fun vs. function schisofrenia. You have to define separate functions that requre "funs" and a separate set of functions that require funs. This breaks the code at every corner (or export everything but this is nonsense). How should I call PrintedEntities = rpc:pmap( {?MODULE, print_entity}, [AttributeNames, ExportFunctions, State], SortedEntities ), without being forced to export the `print_entity/4' function? I would really like to keep it "private". And, how could I perform (it must be done in parallel) a similar operation with "funs"? - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHh0e1L+CaXfJI/hgRAp3gAJ4w8f+WJZi/e426YaL/NjT4RmMUHwCgslCp 4WuYMGLEH7cnv4E+/a/jd+o= =EdRN -----END PGP SIGNATURE----- From rvirding@REDACTED Fri Jan 11 11:58:45 2008 From: rvirding@REDACTED (Robert Virding) Date: Fri, 11 Jan 2008 11:58:45 +0100 Subject: [erlang-questions] Erlang concurrency In-Reply-To: <47872572.1050403@gmail.com> References: <3dbc6d1c0801101719p2acb348buad3ebc4314dbc0bb@mail.gmail.com> <47872572.1050403@gmail.com> Message-ID: <3dbc6d1c0801110258m258d2895o2d64846ffa8ff9da@mail.gmail.com> On 11/01/2008, Dmitrii 'Mamut' Dimandt wrote: > > Robert Virding wrote: > > After reading the blogs about how good Erlang's concurrency model is and > how we just just made a super implementation of it in XXX I have been led to > formulate Virding's First Rule of Programming: > > Any sufficiently complicated concurrent program in another language > contains an ad hoc informally-specified bug-ridden slow implementation of > half of Erlang. > > Sorry to disappoint you, but this has been done before :) > > > http://www.nabble.com/Erlang-for-desktop-applications--tp5673521p5962663.html > Ah, but I don't define it as a corrolary! For me it's a new rule. :-) Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsu79@REDACTED Fri Jan 11 12:44:08 2008 From: chsu79@REDACTED (Christian S) Date: Fri, 11 Jan 2008 12:44:08 +0100 Subject: [erlang-questions] about fun vs. functions schisofrenia In-Reply-To: <478747B5.6060307@fiit.stuba.sk> References: <478747B5.6060307@fiit.stuba.sk> Message-ID: > What do you think about artificial discrimination between "funs" and functions in Erlang? I came Maybe I'm alone, but I don't understand what you refer to. Do you want to avoid exporting functions because they really are private, but yet use them as they are exported? Do you want to refer to functions with {M,F} even though using a fun is superior? And even though the function arity is part of the name in erlang? From chsu79@REDACTED Fri Jan 11 12:50:45 2008 From: chsu79@REDACTED (Christian S) Date: Fri, 11 Jan 2008 12:50:45 +0100 Subject: [erlang-questions] about fun vs. functions schisofrenia In-Reply-To: <478747B5.6060307@fiit.stuba.sk> References: <478747B5.6060307@fiit.stuba.sk> Message-ID: Reading your post again, it seems like you really just want to ask how to pmap nicely. Check out this implementation of pmap: http://lukego.livejournal.com/6753.html Even more impressive implementations of pmap might want to limit the number of concurrently executing processes (say if each process would consume 5Mb of ram at peak and the list has 2000 elements). From bekesa@REDACTED Fri Jan 11 12:25:32 2008 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Fri, 11 Jan 2008 12:25:32 +0100 Subject: [erlang-questions] about fun vs. functions schisofrenia In-Reply-To: <478747B5.6060307@fiit.stuba.sk> References: <478747B5.6060307@fiit.stuba.sk> Message-ID: <200801111225.32642.bekesa@sch.bme.hu> I'm not an expert in the topic, but I think I can answer the questions. Correct me if I'm wrong. > What do you think about artificial discrimination between "funs" and > functions in Erlang? There is an important difference: If you have a fun from a module that is purged, the fun is invalidated and therefore your process is killed. However, having a module name and function name is perfectly valid, no matter how many times you upgrade the module, you can call the function any time (if it exists in the current version of the module). > You > have to define separate functions that requre "funs" and a separate > set of functions that require funs. Higher order functions should work with fun's. If you want to store a reference to a function in the long term (surviving module upgrades), store the module and function name. When you want to use it as the argument of a higher-order function, use the expression fun Module:Function/Arity to "convert" your function reference to a fun. > This breaks the code at every > corner (or export everything but this is nonsense). > > How should I call > > PrintedEntities = rpc:pmap( {?MODULE, print_entity}, > [AttributeNames, ExportFunctions, > State], SortedEntities ), > without being forced to export the `print_entity/4' function? I would > really like to keep it "private". This is sad, but it is a problem of this particular higher-order function, not the Erlang language. Unfortunately, there are many higher-order functions accepting funs and many accepting module+function name :-( Georgy From saleyn@REDACTED Fri Jan 11 12:56:04 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Fri, 11 Jan 2008 06:56:04 -0500 Subject: [erlang-questions] Erlang concurrency In-Reply-To: <3dbc6d1c0801110258m258d2895o2d64846ffa8ff9da@mail.gmail.com> References: <3dbc6d1c0801101719p2acb348buad3ebc4314dbc0bb@mail.gmail.com> <47872572.1050403@gmail.com> <3dbc6d1c0801110258m258d2895o2d64846ffa8ff9da@mail.gmail.com> Message-ID: <47875954.1010805@gmail.com> I thought you dropped the word corollary for the nature of its bug-ridden spelling. ;-) Robert Virding wrote: > On 11/01/2008, Dmitrii 'Mamut' Dimandt wrote: >> Robert Virding wrote: >> >> After reading the blogs about how good Erlang's concurrency model is and >> how we just just made a super implementation of it in XXX I have been led to >> formulate Virding's First Rule of Programming: >> >> Any sufficiently complicated concurrent program in another language >> contains an ad hoc informally-specified bug-ridden slow implementation of >> half of Erlang. >> >> Sorry to disappoint you, but this has been done before :) >> >> >> http://www.nabble.com/Erlang-for-desktop-applications--tp5673521p5962663.html >> > > Ah, but I don't define it as a corrolary! For me it's a new rule. :-) > > Robert > > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From richardc@REDACTED Fri Jan 11 12:58:57 2008 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 11 Jan 2008 12:58:57 +0100 Subject: [erlang-questions] about fun vs. functions schisofrenia In-Reply-To: <478747B5.6060307@fiit.stuba.sk> References: <478747B5.6060307@fiit.stuba.sk> Message-ID: <47875A01.5090109@it.uu.se> Matej Kosik wrote: > In Erlang, these things cannot be used > interchangably and this leads to fun vs. function schisofrenia. You have > to define separate functions that requre "funs" and a separate set of > functions that require funs. Don't worry, you have simply misunderstood some things. > How should I call > > PrintedEntities = rpc:pmap( {?MODULE, print_entity}, [AttributeNames, > ExportFunctions, State], SortedEntities ), > > without being forced to export the `print_entity/4' function? I would > really like to keep it "private". It seems that the functions in the rpc module are written in a very old style. Especially the pmap function has a strange interface. Until this is fixed, you could easily implement you own pmap, with a simpler interface: pmap(Fun, List1) -> List2. Then you could simply call it like this: List2 = pmap(fun (X) -> print_entity(X, AttrN, ExpF, St) end, List1) (without exporting print_entity/4). Also, note that most functions in the rpc module are really meant only for _remote_ procedure calls, and in that case, you can only call exported functions anyway (functions in modules on a different node). I think that the existing pmap function in rpc should be deprecated since it is almost useless, and doesn't really belong in that module. /Richard From bjorn@REDACTED Fri Jan 11 13:47:35 2008 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 11 Jan 2008 13:47:35 +0100 Subject: [erlang-questions] about fun vs. functions schisofrenia In-Reply-To: <200801111225.32642.bekesa@sch.bme.hu> References: <478747B5.6060307@fiit.stuba.sk> <200801111225.32642.bekesa@sch.bme.hu> Message-ID: Andras Georgy Bekes writes: > If you want to store a reference to a function in the long term > (surviving module upgrades), store the module and function name. When > you want to use it as the argument of a higher-order function, use the > expression > fun Module:Function/Arity > to "convert" your function reference to a fun. A fun defined as fun Module:Function/Arity *will* survive code reloading. It has a different internal representation than a fun defined as fun Function/Arity. So it is safe to store the fun instead. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From opendev@REDACTED Fri Jan 11 16:00:37 2008 From: opendev@REDACTED (Joern) Date: Fri, 11 Jan 2008 16:00:37 +0100 Subject: [erlang-questions] Webtool: rb / os_mon integration? Message-ID: <9e009ad0801110700g42bcbbb2r6a239904222e9ce2@mail.gmail.com> Hello, has someone written a webtool integration for rb (very useful) and / or os_mon (the environment is probably monitored by something else, e.g. snmp)? Best regards, rgs/joern -- From kosik@REDACTED Fri Jan 11 16:12:21 2008 From: kosik@REDACTED (Matej Kosik) Date: Fri, 11 Jan 2008 16:12:21 +0100 Subject: [erlang-questions] Mnemosyne query problem Message-ID: <47878755.9070302@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Friends, I would like to perform the following query: TableName = circuit, AttributeValue = ipe_od, AttributeName = type, F = fun() -> Q = query [ Entity || Entity <- table(TableName), Entity.AttributeName=AttributeValue ] end, mnemosyne:eval(Q) end, {atomic, Entities} = mnesia:transaction(F). Unfortunatelly, compilator rejects its. I would like to write a code that selects particular entities from a given TableName whose AttributeName has a given AttributeValue. Since Erlang does not accept bound variables here Entity.AttributeName=AttributeValue I must literally hard-wire particular attribute name. For example Entity.od_id=AttributeValue (here `od_id' means id of octal-demodulator). This way I would have to write such code for every kind of Mnesia table and for every attribute name. That is possible but does not makes sense. The immediate hack is to load all entities into the memory and make ordinary list-comprehension. It might work, as long as things fit into memory (and some other things in VM do not overflow). But how to actually write a code that works as the original (non-compilable) piece was supposed to work? Thanks in advance - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHh4dVL+CaXfJI/hgRAisKAKDXDWxoIbO9WP+jDqO5UQMXJiVLhQCgpklI iYolHdgQ/8A3dpAfl0FoNak= =/v97 -----END PGP SIGNATURE----- From rvirding@REDACTED Fri Jan 11 16:15:09 2008 From: rvirding@REDACTED (Robert Virding) Date: Fri, 11 Jan 2008 16:15:09 +0100 Subject: [erlang-questions] Erlang concurrency In-Reply-To: <47875954.1010805@gmail.com> References: <3dbc6d1c0801101719p2acb348buad3ebc4314dbc0bb@mail.gmail.com> <47872572.1050403@gmail.com> <3dbc6d1c0801110258m258d2895o2d64846ffa8ff9da@mail.gmail.com> <47875954.1010805@gmail.com> Message-ID: <3dbc6d1c0801110715r59e89999ie58546889da8ee50@mail.gmail.com> That too, that too. Spelling was never my strong point. That's why I like short simple names and variables in code. It is much more difficult to misspell S than SubsumptionDataWithoutExtraValues. :-) Robert On 11/01/2008, Serge Aleynikov wrote: > > I thought you dropped the word corollary for the nature of its > bug-ridden spelling. ;-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy@REDACTED Fri Jan 11 16:33:23 2008 From: andy@REDACTED (Andy Gross) Date: Fri, 11 Jan 2008 10:33:23 -0500 Subject: [erlang-questions] Mnemosyne query problem In-Reply-To: <47878755.9070302@fiit.stuba.sk> References: <47878755.9070302@fiit.stuba.sk> Message-ID: <1C6840C9-5CE7-4542-AA7C-5AC6E98542A9@andygross.org> Matej, mnemosyne (AFAIK) is deprecated and unmaintained. Check out QLC (query list comprehensions): http://erlang.org/doc/man/qlc.html - Andy On Jan 11, 2008, at 10:12 AM, Matej Kosik wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Friends, > > I would like to perform the following query: > > TableName = circuit, > AttributeValue = ipe_od, > AttributeName = type, > F = fun() -> > Q = query > [ Entity > || Entity <- table(TableName), > Entity.AttributeName=AttributeValue > ] > end, > mnemosyne:eval(Q) > end, > {atomic, Entities} = mnesia:transaction(F). > > Unfortunatelly, compilator rejects its. I would like to write a code > that selects particular > entities from a given TableName whose AttributeName has a given > AttributeValue. > > Since Erlang does not accept bound variables here > > Entity.AttributeName=AttributeValue > > I must literally hard-wire particular attribute name. For example > > Entity.od_id=AttributeValue > > (here `od_id' means id of octal-demodulator). This way I would have > to write such code for every > kind of Mnesia table and for every attribute name. That is possible > but does not makes sense. > > The immediate hack is to load all entities into the memory and make > ordinary list-comprehension. It > might work, as long as things fit into memory (and some other things > in VM do not overflow). But how > to actually write a code that works as the original (non-compilable) > piece was supposed to work? > > Thanks in advance > - -- > Matej Kosik > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHh4dVL+CaXfJI/hgRAisKAKDXDWxoIbO9WP+jDqO5UQMXJiVLhQCgpklI > iYolHdgQ/8A3dpAfl0FoNak= > =/v97 > -----END PGP SIGNATURE----- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From ulf.wiger@REDACTED Fri Jan 11 16:36:09 2008 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Fri, 11 Jan 2008 16:36:09 +0100 Subject: [erlang-questions] Mnemosyne query problem In-Reply-To: <47878755.9070302@fiit.stuba.sk> References: <47878755.9070302@fiit.stuba.sk> Message-ID: <47878CE9.5090808@ericsson.com> One way to do this is to use the exprecs parse transform, http://forum.trapexit.org/viewtopic.php?p=21790#21790 which would allow you to write: Q = query [ Entity || Entity <- table(TableName), [AttributeValue] == M:'#get-'([AttributeName], Entity) ] where M is some module in which you've declared and exported the record definition of Entity. (Not that I've tested this, but I believe it should work. It's been a few years since I played with Mnemosyne queries.) BTW, for this type of query, you should really use QLC instead, since Mnemosyne is no longer supported. BR, Ulf W Matej Kosik skrev: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Friends, > > I would like to perform the following query: > > TableName = circuit, > AttributeValue = ipe_od, > AttributeName = type, > F = fun() -> > Q = query > [ Entity > || Entity <- table(TableName), > Entity.AttributeName=AttributeValue > ] > end, > mnemosyne:eval(Q) > end, > {atomic, Entities} = mnesia:transaction(F). > > Unfortunatelly, compilator rejects its. I would like to write a code that selects particular > entities from a given TableName whose AttributeName has a given AttributeValue. > > Since Erlang does not accept bound variables here > > Entity.AttributeName=AttributeValue > > I must literally hard-wire particular attribute name. For example > > Entity.od_id=AttributeValue From bekesa@REDACTED Fri Jan 11 16:54:03 2008 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Fri, 11 Jan 2008 16:54:03 +0100 Subject: [erlang-questions] about fun vs. functions schisofrenia In-Reply-To: References: <478747B5.6060307@fiit.stuba.sk> <200801111225.32642.bekesa@sch.bme.hu> Message-ID: <200801111654.03590.bekesa@sch.bme.hu> > A fun defined as fun Module:Function/Arity *will* survive code > reloading. It has a different internal representation than a fun > defined as fun Function/Arity. Hmm, good to know! This also means that you can have a fun Module:Function/Arity even before loading Module, you'll have an error only when you call it. 1> (fun a:b/0). #Fun 2> catch (fun a:b/0)(). {'EXIT',{undef,[{a,b,[]},... In this case there is really no reason to use the old {ModuleName,FunctionName} representation. Georgy From masterofquestions@REDACTED Fri Jan 11 17:25:56 2008 From: masterofquestions@REDACTED (Russell King) Date: Fri, 11 Jan 2008 11:25:56 -0500 Subject: [erlang-questions] trying to run line_server and pcount with tbray sample data Message-ID: <1218d6a50801110825p44c80fd5m400e0695a62172cd@mail.gmail.com> I am not at the stage to run with Erlang yet, but crawling day by day. I have ran pcount.erl inside the shell. I am not quite sure about the error. data file I am using: www.tbray.org/tmp/o10k.ap I did a make (erl -make -pa ebin) without -smp since I don't have multicore. The file: o10k.ap has valid rw access to the user and the group and placed in the same directory as the beam files. Error I am getting is "case_clause, <<0 bytes>>": 5> pcount:main("o10k.ap",4). =ERROR REPORT==== 7-Jan-2008::20:47:07 === Error in process <0.39.0> with exit value: {{case_clause,<<0 bytes>>},[]} ** exited: {{case_clause,<<>>},[]} ** =ERROR REPORT==== 7-Jan-2008::20:47:07 === Error in process <0.40.0> with exit value: {{case_clause,<<0 bytes>>},[]} =ERROR REPORT==== 7-Jan-2008::20:47:07 === Error in process <0.41.0> with exit value: {{case_clause,<<0 bytes>>},[]} 6> =ERROR REPORT==== 7-Jan-2008::20:47:07 === Error in process <0.42.0> with exit value: {{case_clause,<<0 bytes>>},[]} thanks, russ From travis.jensen@REDACTED Sat Jan 12 00:12:08 2008 From: travis.jensen@REDACTED (Travis Jensen) Date: Fri, 11 Jan 2008 16:12:08 -0700 Subject: [erlang-questions] Erlang concurrency In-Reply-To: <3dbc6d1c0801110715r59e89999ie58546889da8ee50@mail.gmail.com> References: <3dbc6d1c0801101719p2acb348buad3ebc4314dbc0bb@mail.gmail.com> <47872572.1050403@gmail.com> <3dbc6d1c0801110258m258d2895o2d64846ffa8ff9da@mail.gmail.com> <47875954.1010805@gmail.com> <3dbc6d1c0801110715r59e89999ie58546889da8ee50@mail.gmail.com> Message-ID: Tags and meta-/ FTW! I can have my mispellings and keep them, too. :) tj On Jan 11, 2008, at 8:15 AM, Robert Virding wrote: > That too, that too. Spelling was never my strong point. That's why I > like short simple names and variables in code. It is much more > difficult to misspell S than SubsumptionDataWithoutExtraValues. :-) > > Robert > > On 11/01/2008, Serge Aleynikov wrote: > I thought you dropped the word corollary for the nature of its > bug-ridden spelling. ;-) > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From martinjlogan@REDACTED Sat Jan 12 05:44:59 2008 From: martinjlogan@REDACTED (Martin Logan) Date: Fri, 11 Jan 2008 22:44:59 -0600 Subject: [erlang-questions] Statically link R11B-5? Message-ID: I need to statically link R11B-5, does anyone know how to do it? There appears to be no configuration option to do so or environment variable I can set. Any pointers would be appreciated. Cheers, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From rsaccon@REDACTED Sat Jan 12 20:37:20 2008 From: rsaccon@REDACTED (Roberto Saccon) Date: Sat, 12 Jan 2008 17:37:20 -0200 Subject: [erlang-questions] clarify: export statement in erl_syntax notation Message-ID: whatever I try doesn't get compiled. eg.: -export([foo/0, foo/1]). in abstract erl_syntax notation: neither: erl_syntax:attribute(erl_syntax:atom(export), [erl_syntax:tuple([erl_syntax:atom("foo"), erl_syntax:integer(0)]), erl_syntax:tuple([erl_syntax:atom("foo"), erl_syntax:integer(1)])]), nor: erl_syntax:attribute(erl_syntax:atom(export), [erl_syntax:atom("foo/0"), erl_syntax:atom("foo/1")]), nor: erl_syntax:attribute(erl_syntax:atom(export), [erl_syntax:text("foo/0"), erl_syntax:text("foo/1")]), nor any other "combination" I tried compiles. testing with erl_parse:parse_form/1 I get the following abstract syntax (which still doesn't hep me): {attribute,1,export,[{foo,0},{foo,1}]} Anybody knows ? regards -- Roberto Saccon http://rsaccon.com From martinjlogan@REDACTED Sat Jan 12 20:43:58 2008 From: martinjlogan@REDACTED (Martin Logan) Date: Sat, 12 Jan 2008 13:43:58 -0600 Subject: [erlang-questions] R11B-5 fails to build on FreeBSD 6.2 Message-ID: the build fails with: === Entering application erl_interface gmake[3]: Entering directory `/usr/home/martinjlogan/otp_src_R11B-5/lib/erl_interface/src' gmake -f i386-unknown-freebsd6.2/Makefile TYPE=opt gmake[4]: Entering directory `/usr/home/martinjlogan/otp_src_R11B-5/lib/erl_interface/src' gcc -g -O2 -fPIC -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -fno-strict-aliasing -I. -I../include -Iconnect -Iencode -Idecode -Imisc -Iepmd -Iregistry - Ii386-unknown-freebsd6.2 -D_REENTRANT -D_THREAD_SAFE -DPOSIX_THREADS -c connect/ei_resolve.c -o /home/martinjlogan/otp_src_R11B-5/lib/erl_interface/obj.mt/i386- unknown-freebsd6.2/ei_resolve.o connect/ei_resolve.c: In function `ei_gethostbyname_r': connect/ei_resolve.c:624: warning: passing arg 5 of `gethostbyname_r' from incompatible pointer type connect/ei_resolve.c:624: error: too few arguments to function `gethostbyname_r' connect/ei_resolve.c:624: warning: return makes pointer from integer without a cast gmake[4]: *** [/home/martinjlogan/otp_src_R11B-5/lib/erl_interface/obj.mt/i386- unknown-freebsd6.2/ei_resolve.o] Error 1 gmake[4]: Leaving directory `/usr/home/martinjlogan/otp_src_R11B-5/lib/erl_interface/src' gmake[3]: *** [opt] Error 2 gmake[3]: Leaving directory `/usr/home/martinjlogan/otp_src_R11B-5/lib/erl_interface/src' gmake[2]: *** [opt] Error 2 gmake[2]: Leaving directory `/usr/home/martinjlogan/otp_src_R11B-5/lib/erl_interface' gmake[1]: *** [opt] Error 2 gmake[1]: Leaving directory `/usr/home/martinjlogan/otp_src_R11B-5/lib' gmake: *** [libs] Error 2 Anyone else run into this problem? Cheers, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Sat Jan 12 21:34:00 2008 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Sat, 12 Jan 2008 21:34:00 +0100 Subject: [erlang-questions] clarify: export statement in erl_syntax notation In-Reply-To: References: Message-ID: <95be1d3b0801121234m151720adr2c2e3ac354137e44@mail.gmail.com> Hi, On Jan 12, 2008 8:37 PM, Roberto Saccon wrote: > -export([foo/0, foo/1]). > in abstract erl_syntax notation: Try erl_syntax:attribute( erl_syntax:atom(export), [erl_syntax:list([erl_syntax:arity_qualifier(erl_syntax:atom(foo), erl_syntax:integer(0)), erl_syntax:arity_qualifier(erl_syntax:atom(foo), erl_syntax:integer(1))])]). best reards, Vlad From per@REDACTED Sat Jan 12 21:53:53 2008 From: per@REDACTED (Per Hedeland) Date: Sat, 12 Jan 2008 21:53:53 +0100 (CET) Subject: [erlang-questions] R11B-5 fails to build on FreeBSD 6.2 In-Reply-To: Message-ID: <200801122053.m0CKrrWh005356@pluto.hedeland.org> "Martin Logan" wrote: > >the build fails with: [snip] >connect/ei_resolve.c: In function `ei_gethostbyname_r': >connect/ei_resolve.c:624: warning: passing arg 5 of `gethostbyname_r' from >incompatible pointer type >connect/ei_resolve.c:624: error: too few arguments to function >`gethostbyname_r' >connect/ei_resolve.c:624: warning: return makes pointer from integer without >a cast Do you specifically need R11B-5? Otherwise just use the current port, which has R12B-0 + OSP1 patch. Or, with a bit of creative cvsup'ing you can get the R11B-5 version of the port - from ~ July 4 2007 should be fine. Or, you can apply the patch for this from the current port, it's the same as for R11B-5 (and I dare say it's not the "proper" way to fix it, 'configure' should be taught about the issue, but it should work) - below. There might be some other issues though, I haven't built Erlang from current "virgin" source on FreeBSD for quite a while - I happen to have the erlang-r11b5_1,1 version of the port (that's where it was at when I installed it) installed and running fine on FreeBSD 6.2-STABLE-200709 though... --Per Hedeland $FreeBSD: ports/lang/erlang/files/patch-lib_erl__interface_src_connect_ei__resolve.c,v 1.1 2006/11/25 16:47:07 olgeni Exp $ --- lib/erl_interface/src/connect/ei_resolve.c.orig +++ lib/erl_interface/src/connect/ei_resolve.c @@ -621,7 +621,8 @@ return result; #else - return gethostbyname_r(name,hostp,buffer,buflen,h_errnop); + struct hostent *dummy; + return gethostbyname_r(name,hostp,buffer,buflen,&dummy,h_errnop); #endif #endif #endif From rsaccon@REDACTED Sat Jan 12 22:08:49 2008 From: rsaccon@REDACTED (Roberto Saccon) Date: Sat, 12 Jan 2008 19:08:49 -0200 Subject: [erlang-questions] clarify: export statement in erl_syntax notation In-Reply-To: <95be1d3b0801121234m151720adr2c2e3ac354137e44@mail.gmail.com> References: <95be1d3b0801121234m151720adr2c2e3ac354137e44@mail.gmail.com> Message-ID: Vlad, that worked, thanks a lot On Jan 12, 2008 6:34 PM, Vlad Dumitrescu wrote: > Hi, > > On Jan 12, 2008 8:37 PM, Roberto Saccon wrote: > > -export([foo/0, foo/1]). > > in abstract erl_syntax notation: > > Try > > erl_syntax:attribute( > erl_syntax:atom(export), > [erl_syntax:list([erl_syntax:arity_qualifier(erl_syntax:atom(foo), > > erl_syntax:integer(0)), > erl_syntax:arity_qualifier(erl_syntax:atom(foo), > > erl_syntax:integer(1))])]). > > > best reards, > Vlad > -- Roberto Saccon http://rsaccon.com From bob@REDACTED Sat Jan 12 21:56:23 2008 From: bob@REDACTED (Bob Cowdery) Date: Sat, 12 Jan 2008 20:56:23 +0000 Subject: [erlang-questions] wxErlang Message-ID: <1200171383.5438.20.camel@ubuntu-life-vm> Hi Dan I hope you can help on this one. I have a situation where erlang will spontaneously exit. I thought this was probably one of my linked-in drivers going barmy but I've tracked it down to something in wx. The situation is this. I have several UI processes running, They share nothing and don't need to interact directly as that's all handled by a back-end FSM. I have therefore given them each their own environment and do not pass the environment across. Two of these processes are graphical in that they just draw stuff on the window. One of these draws a real-time graph refreshed every 100ms, the other is a set of digits that scroll and use mouse motion and wheel events. Both use wxBufferedDC to avoid flicker. It seems that there is some interaction between these two widgets. I can see some of the drawing operations on one widget being reproduced on the other. If I play with the scrolling digits I can get erlang to spontaneously exit. I suspect this is a threading issue as I have seen erratic drawing before when attacking the GUI from two different threads. Unfortunately I have so far failed to reproduce this in a simple example but if you don't have any ideas I will keep trying. Great toolkit by the way, keep up the good work. Regards Bob From paul-trapexit@REDACTED Sun Jan 13 09:20:20 2008 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Sun, 13 Jan 2008 00:20:20 -0800 (PST) Subject: [erlang-questions] io:format/3 port interaction? Message-ID: hi. i have a situation where a port i'm writing is hanging, but if i add a call to io:format on the erlang side which executes before i want to get my first Mod:handle_info call, everything works. it has me pretty flummoxed, so any help would be greatly appreciated. the straces look pretty similar in the working and non-working case (see below) which hopefully lends credence to my claims. also erlang is talking to the port program over a pipe, so the VM is isolated. this is complicated and i haven't given alot of information here, plus i've made some bold claims (the only thing different is one io:format call; if true it would suggest a bug in the erlang VM). however fortunately this is an open source project so i can fully expose the details to interested parties. thanks in advance for any insight, -- p some more details. straces are with -etrace=file,desc,process ============== hanging strace excerpt (port driver) ============== ... 1200208485.432326 read(3, "\0\6\0\0\0\0\0\0\0debug\0\35\0\0\0\0\0\0\0mount.tmp"..., 58) = 58 1200208485.435356 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2ae03fe92100) = 21801 1200208485.436781 close(5) = 0 1200208485.447665 close(6) = 0 1200208485.448181 wait4(21801, NULL, 0, NULL) = 21801 1200208485.448683 write(4, "\0\0\0\v", 4) = 4 1200208485.448906 write(4, "\1\2\0\0\0\0\0\0\0ok", 11) = 11 1200208485.449139 write(2, "fuserl_ll_output complete\n", 26) = 26 1200208485.451509 poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN, revents=POLLIN}], 2, -1) = 1 1200208485.451720 write(2, "fuserl_ll_ready_input\n", 22) = 22 1200208485.452589 read(5, "8\0\0\0\32\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 135168) = 56 1200208485.452830 fstat(1, {st_mode=S_IFREG|0644, st_size=24, ...}) = 0 1200208485.453123 write(1, "unique: 1, opcode: INIT (26), no"..., 52) = 52 1200208485.453281 write(1, "INIT: 7.8\nflags=0x00000003\nmax_r"..., 52) = 52 1200208485.453411 write(1, " INIT: 7.8\n flags=0x00000001"..., 85) = 85 1200208485.453744 write(1, " unique: 1, error: 0 (Success)"..., 46) = 46 1200208485.453845 writev(5, [{"(\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0", 16}, {"\7\0\0\0\10\0\0\0\0\0\2\0\1\0\0\0\0\0\0\0\0\0\2\0", 24}], 2) = 40 1200208485.453971 write(2, "fuserl_ll_ready_input complete\n", 31) = 31 1200208485.454627 poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN, revents=POLLIN}], 2, -1) = 1 1200208485.561811 write(2, "fuserl_ll_ready_input\n", 22) = 22 1200208485.565286 read(5, "(\0\0\0\3\0\0\0\2\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 135168) = 40 1200208485.565433 write(1, "unique: 2, opcode: GETATTR (3), "..., 54) = 54 1200208485.565680 write(2, "fuserl_ll_op_getattr start 0x607"..., 36) = 36 1200208485.568906 write(4, "\0\0\0\22", 4) = 4 1200208485.569171 write(4, "\0\2pr`\0\0\0\0\0\1\0\0\0\0\0\0\0", 18) = 18 1200208485.569412 write(2, "fuserl_ll_op_getattr complete 0x"..., 39) = 39 1200208485.573359 write(2, "fuserl_ll_ready_input complete\n", 31) = 31 1200208485.576698 poll( ... ============== the port program is talking 4-byte length prefixed to erlang. after the initial handshake (writev on 10 of 62 bytes and read on 7 of 15 bytes) the port program sends a 22 byte message to erlang (unsolicited; in this situation the port program mostly acts as a client and the erlang VM a server, rather than vice versa; the initial handshake is one exception to this, the other is the shutdown command). in the hanging case, this is never responded to. ============== hanging strace excerpt (erlang VM). ============== ... 1200208480.854839 writev(10, [{"\0\0\0:", 4}, {"\0\6\0\0\0\0\0\0\0debug\0\35\0\0\0\0\0\0\0mount.tmp"..., 58}], 2) = 62 1200208480.855277 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=6, events=POLLIN|POLLRDNORM}, {fd=5, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=7, events=POLLIN|POLLRDNORM, revents=POLLIN|POLLRDNORM}], 5, 4984) = 1 1200208485.449091 read(7, "\0\0\0\v\1\2\0\0\0\0\0\0\0ok", 65536) = 15 1200208485.452534 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=6, events=POLLIN|POLLRDNORM}, {fd=5, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=7, events=POLLIN|POLLRDNORM}], 5, 99) = 0 1200208485.561746 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=6, events=POLLIN|POLLRDNORM}, {fd=5, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=7, events=POLLIN|POLLRDNORM, revents=POLLIN|POLLRDNORM}], 5, 278) = 1 1200208485.569350 read(7, "\0\0\0\22\0\2pr`\0\0\0\0\0\1\0\0\0\0\0\0\0", 65536) = 22 1200208485.576366 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=6, events=POLLIN|POLLRDNORM}, {fd=5, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=7, events=POLLIN|POLLRDNORM}], 5, 266) = 0 1200208485.845472 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=6, events=POLLIN|POLLRDNORM}, {fd=5, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=7, events=POLLIN|POLLRDNORM}], 5, 6044) = 0 1200208491.889132 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=6, events=POLLIN|POLLRDNORM}, {fd=5, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=7, events=POLLIN|POLLRDNORM}], 5, 0) = 0 1200208491.889408 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=6, events=POLLIN|POLLRDNORM}, {fd=5, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=7, events=POLLIN|POLLRDNORM}], 5, 0) = 0 1200208491.889703 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=6, events=POLLIN|POLLRDNORM}, {fd=5, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=7, events=POLLIN|POLLRDNORM}], 5, 0) = 0 1200208491.892669 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=6, events=POLLIN|POLLRDNORM}, {fd=5, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=7, events=POLLIN|POLLRDNORM}], 5, 0) = 0 1200208491.893488 poll( ============== so to investigate i added an io:format call in the Mod:init function of the gen_server owning the port. this resulted in everything magically working. i then moved the io:format call out of my code and into the test generator so that it would be called before my code was even loaded (otherwise, the straces below would be interlaced with concurrent reads on file descriptor 3 corresponding to the loading of io_lib_pretty.beam for the first time from the async thread pool and it notifying the main loop; at first i thought this was unsticking things but when i moved the io:format way early the straces became more identical and the unsticking still happened). ============== working strace excerpt (erlang VM) ============== ... 1200209491.824843 writev(10, [{"\0\0\0:", 4}, {"\0\6\0\0\0\0\0\0\0debug\0\35\0\0\0\0\0\0\0mount.tmp"..., 58}], 2) = 62 1200209491.825303 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=6, events=POLLIN|POLLRDNORM}, {fd=5, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=7, events=POLLIN|POLLRDNORM, revents=POLLIN|POLLRDNORM}], 5, 4981) = 1 1200209496.332997 read(7, "\0\0\0\v\1\2\0\0\0\0\0\0\0ok", 65536) = 15 1200209496.334975 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=6, events=POLLIN|POLLRDNORM}, {fd=5, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=7, events=POLLIN|POLLRDNORM}], 5, 100) = 0 1200209496.438748 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=6, events=POLLIN|POLLRDNORM}, {fd=5, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=7, events=POLLIN|POLLRDNORM, revents=POLLIN|POLLRDNORM}], 5, 368) = 1 1200209496.441124 read(7, "\0\0\0\22\0\2pr`\0\0\0\0\0\1\0\0\0\0\0\0\0", 65536) = 22 1200209496.442634 writev(10, [{"\0\0\0{", 4}, {"\1pr`\0\0\0\0\0\4\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\355"..., 123}], 2) = 127 1200209496.443743 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=6, events=POLLIN|POLLRDNORM}, {fd=5, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=7, events=POLLIN|POLLRDNORM, revents=POLLIN|POLLRDNORM}], 5, 363) = 1 ... ============== ============== working strace excerpt (port driver) ============== ... 1200209496.332515 write(4, "\0\0\0\v", 4) = 4 1200209496.332760 write(4, "\1\2\0\0\0\0\0\0\0ok", 11) = 11 1200209496.333045 write(2, "fuserl_ll_output complete\n", 26) = 26 1200209496.334067 poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN, revents=POLLIN}], 2, -1) = 1 1200209496.334273 write(2, "fuserl_ll_ready_input\n", 22) = 22 1200209496.335027 read(5, "8\0\0\0\32\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 135168) = 56 1200209496.335177 fstat(1, {st_mode=S_IFREG|0644, st_size=42, ...}) = 0 1200209496.335463 write(1, "unique: 1, opcode: INIT (26), no"..., 52) = 52 1200209496.335618 write(1, "INIT: 7.8\nflags=0x00000003\nmax_r"..., 52) = 52 1200209496.335718 write(1, " INIT: 7.8\n flags=0x00000001"..., 85) = 85 1200209496.336155 write(1, " unique: 1, error: 0 (Success)"..., 46) = 46 1200209496.336257 writev(5, [{"(\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0", 16}, {"\7\0\0\0\10\0\0\0\0\0\2\0\1\0\0\0\0\0\0\0\0\0\2\0", 24}], 2) = 40 1200209496.336380 write(2, "fuserl_ll_ready_input complete\n", 31) = 31 1200209496.336943 poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN, revents=POLLIN}], 2, -1) = 1 1200209496.438812 write(2, "fuserl_ll_ready_input\n", 22) = 22 1200209496.439720 read(5, "(\0\0\0\3\0\0\0\2\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 135168) = 40 1200209496.439864 write(1, "unique: 2, opcode: GETATTR (3), "..., 54) = 54 1200209496.440096 write(2, "fuserl_ll_op_getattr start 0x607"..., 36) = 36 1200209496.440679 write(4, "\0\0\0\22", 4) = 4 1200209496.440945 write(4, "\0\2pr`\0\0\0\0\0\1\0\0\0\0\0\0\0", 18) = 18 1200209496.441185 write(2, "fuserl_ll_op_getattr complete 0x"..., 39) = 39 1200209496.442722 write(2, "fuserl_ll_ready_input complete\n", 31) = 31 1200209496.443570 poll([{fd=3, events=POLLIN, revents=POLLIN}, {fd=5, events=POLLIN}], 2, -1) = 1 1200209496.443806 read(3, "\0\0\0{", 4) = 4 1200209496.443927 read(3, "\1pr`\0\0\0\0\0\4\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\355"..., 123) = 123 1200209496.444091 write(2, "fuserl_ll_output\n", 17) = 17 1200209496.444706 write(1, " unique: 2, error: 0 (Success)"..., 47) = 47 ... ============== well alright these straces aren't really shedding light on why things are working, although the messages being exchanged do look identical in both cases. complicating things: * invoking the test from the shell causes it to pass with or without the added io:format. * turning on [ { debug, [ trace ] } ] to the gen_server to see if Mod:handle_info/2 is being called doesn't seem to generate any trace messages when invoked with --noshell --eval '...' Optimism is an essential ingredient of innovation. How else can the individual favor change over security? -- Robert Noyce From alex.arnon@REDACTED Sun Jan 13 09:17:17 2008 From: alex.arnon@REDACTED (Alex Arnon) Date: Sun, 13 Jan 2008 10:17:17 +0200 Subject: [erlang-questions] Erlang concurrency In-Reply-To: <47872572.1050403@gmail.com> References: <3dbc6d1c0801101719p2acb348buad3ebc4314dbc0bb@mail.gmail.com> <47872572.1050403@gmail.com> Message-ID: <944da41d0801130017r1e603021p754caf8af6d0c21d@mail.gmail.com> I have used the corollary several times... but now that we have a choice, when should I use it as a Rule, and when do I quote the Corollary? Conundrum! 2008/1/11 Dmitrii 'Mamut' Dimandt : > Robert Virding wrote: > > After reading the blogs about how good Erlang's concurrency model is and > how we just just made a super implementation of it in XXX I have been led to > formulate Virding's First Rule of Programming: > > Any sufficiently complicated concurrent program in another language > contains an ad hoc informally-specified bug-ridden slow implementation of > half of Erlang. > > Sorry to disappoint you, but this has been done before :) > > > http://www.nabble.com/Erlang-for-desktop-applications--tp5673521p5962663.html > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drcabana@REDACTED Sun Jan 13 21:22:50 2008 From: drcabana@REDACTED (David Cabana) Date: Sun, 13 Jan 2008 15:22:50 -0500 Subject: [erlang-questions] What is the purpose of the fun vs function distinction? Message-ID: <44ed5e0f0801131222i188fbf27vf70b27f69dab15f8@mail.gmail.com> I am trying to understand the purpose of the distinction between funs and functions. For instance, in the module foo let's define double(X) -> 2 * X. Though double is perfectly nice function, the very natural lists:map(double, [1,2,3]) is not valid Erlang, not even inside foo. Instead one has to write lists:map(fun foo:double/1, [1,2,3] Finding this tedious, I try another seemingly natural idea: I'll define my functions as funs. doub = fun(X) -> 2*X end. At first glance this seems to solve my problem, since I can write lists:map(doub, [1,2,3]) and things work as expected. But then I discover that I cannot export doub from foo: it is a fun, not a function. Well, things are what they are. Erlang simply does not have the clean syntax of scheme or Haskell with respect to passing functions as arguments. But why? Is this merely cruft, or does it serve some purpose? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsu79@REDACTED Sun Jan 13 21:55:12 2008 From: chsu79@REDACTED (Christian S) Date: Sun, 13 Jan 2008 21:55:12 +0100 Subject: [erlang-questions] What is the purpose of the fun vs function distinction? In-Reply-To: <44ed5e0f0801131222i188fbf27vf70b27f69dab15f8@mail.gmail.com> References: <44ed5e0f0801131222i188fbf27vf70b27f69dab15f8@mail.gmail.com> Message-ID: 2008/1/13 David Cabana : > is not valid Erlang, not even inside foo. Instead one has to write > lists:map(fun foo:double/1, [1,2,3] If you are inside foo, then "fun double/1" suffices, no need to export it that way. > Finding this tedious, I try another seemingly natural idea: I'll define my > functions as funs. > doub = fun(X) -> 2*X end. That is a bad match, did you mean "Doub = fun(X) -> 2*X end" ? > Well, things are what they are. Erlang simply does not have the clean syntax > of scheme or Haskell with respect to passing functions as arguments. But > why? Is this merely cruft, or does it serve some purpose? Funs were added later on to erlang, that can explain why they do not have more convenient syntax. So "cruft" by your taxonomy I guess. From rvirding@REDACTED Sun Jan 13 23:28:17 2008 From: rvirding@REDACTED (Robert Virding) Date: Sun, 13 Jan 2008 23:28:17 +0100 Subject: [erlang-questions] What is the purpose of the fun vs function distinction? In-Reply-To: References: <44ed5e0f0801131222i188fbf27vf70b27f69dab15f8@mail.gmail.com> Message-ID: <3dbc6d1c0801131428x74a62fd9mf2d291aff22f0274@mail.gmail.com> On 13/01/2008, Christian S wrote: > > 2008/1/13 David Cabana : > > Well, things are what they are. Erlang simply does not have the clean > syntax > > of scheme or Haskell with respect to passing functions as arguments. But > > why? Is this merely cruft, or does it serve some purpose? > > Funs were added later on to erlang, that can explain why they do not have > more > convenient syntax. So "cruft" by your taxonomy I guess. There is one feature of Erlang which seriously screws up the handling of functions compared to Scheme and Haskell, and that is having functions with the same name but with different arities. This means that there is no clear binding function <-> name which you need to be able to write as you can in the other languages. To refer to a function you need both the name and the arity. Period. The same with exported functions, to refer to a function in another module you need the module name, the function name and its arity. That is why you have a construction fun to create a function reference, it contains the arity within it. The "fun name/arity" syntax is really just a short form for: fun (A1, ..., An) -> name/A1, ..., An) end. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Sun Jan 13 23:29:03 2008 From: rvirding@REDACTED (Robert Virding) Date: Sun, 13 Jan 2008 23:29:03 +0100 Subject: [erlang-questions] lists:filter/2 In-Reply-To: <47872078.1020401@dominicwilliams.net> References: <47868A0E.5020104@douglasedmunds.com> <47872078.1020401@dominicwilliams.net> Message-ID: <3dbc6d1c0801131429wf6764beyb4c268e8c20c5d26@mail.gmail.com> Yes, robert On 11/01/2008, Dominic Williams wrote: > > Hi Doug, > > > Does lists:filter(Pred, List1) -> List2 > > > > guarantee to return the filtered items in List2 > > in the same relative order as unfiltered List1? > > If you check the code of lists.erl, you'll find filter/2 is > implemented using a list comprehension: > > filter(Pred, List) when is_function(Pred, 1) -> > [ E || E <- List, Pred(E) ]. > > List comprehensions definitely preserve order. > > Regards, > > Dominic Williams > http://dominicwilliams.net > > ---- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drcabana@REDACTED Mon Jan 14 04:49:59 2008 From: drcabana@REDACTED (David Cabana) Date: Sun, 13 Jan 2008 22:49:59 -0500 Subject: [erlang-questions] What is the purpose of the fun vs function distinction? In-Reply-To: References: <44ed5e0f0801131222i188fbf27vf70b27f69dab15f8@mail.gmail.com> Message-ID: <44ed5e0f0801131949v78faf40fsd58fa9c6b88e7d41@mail.gmail.com> > > > That is a bad match, did you mean "Doub = fun(X) -> 2*X end" ? Yes, I did. I should have run my examples, but instead I just wrote them up. Thanks for the replies. They were enlightening. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dgud@REDACTED Mon Jan 14 09:08:30 2008 From: dgud@REDACTED (Dan Gudmundsson) Date: Mon, 14 Jan 2008 09:08:30 +0100 Subject: [erlang-questions] wxErlang In-Reply-To: <1200171383.5438.20.camel@ubuntu-life-vm> References: <1200171383.5438.20.camel@ubuntu-life-vm> Message-ID: <478B187E.2080108@erix.ericsson.se> Hi I have fixed one bug, involving cleaning pointers when process/application exited, it could cause crashes when memory was reused in other applications. I guess there are more bugs in there, a "working"/crashing example would be great. I'll make a new release soon, I need fix some more things first. /Dan Bob Cowdery wrote: > Hi Dan > > I hope you can help on this one. I have a situation where erlang will > spontaneously exit. I thought this was probably one of my linked-in > drivers going barmy but I've tracked it down to something in wx. > > The situation is this. I have several UI processes running, They share > nothing and don't need to interact directly as that's all handled by a > back-end FSM. I have therefore given them each their own environment and > do not pass the environment across. Two of these processes are graphical > in that they just draw stuff on the window. One of these draws a > real-time graph refreshed every 100ms, the other is a set of digits that > scroll and use mouse motion and wheel events. Both use wxBufferedDC to > avoid flicker. > > It seems that there is some interaction between these two widgets. I can > see some of the drawing operations on one widget being reproduced on the > other. If I play with the scrolling digits I can get erlang to > spontaneously exit. I suspect this is a threading issue as I have seen > erratic drawing before when attacking the GUI from two different > threads. > > Unfortunately I have so far failed to reproduce this in a simple example > but if you don't have any ideas I will keep trying. > > Great toolkit by the way, keep up the good work. > > Regards > Bob > From bjorn@REDACTED Mon Jan 14 09:13:33 2008 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 14 Jan 2008 09:13:33 +0100 Subject: [erlang-questions] about fun vs. functions schisofrenia In-Reply-To: <200801111654.03590.bekesa@sch.bme.hu> References: <478747B5.6060307@fiit.stuba.sk> <200801111225.32642.bekesa@sch.bme.hu> <200801111654.03590.bekesa@sch.bme.hu> Message-ID: Andras Georgy Bekes writes: > In this case there is really no reason to use the old > {ModuleName,FunctionName} representation. Correct. We consider its use deprecated and may not support it in a future release. Dialyzer produces a warning if it detects calls using "tuple funs". /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From waifunlee@REDACTED Mon Jan 14 10:42:59 2008 From: waifunlee@REDACTED (Aaron Lee) Date: Mon, 14 Jan 2008 01:42:59 -0800 Subject: [erlang-questions] Unable to build R12B on Debian Message-ID: <49a6f6bd0801140142w1b5748fas6b1c68f3ea4069dd@mail.gmail.com> Hi there, Is there a binary package which I can install? I tried building it from the source and I got: make[2]: Entering directory `/home/.winkler/aaron08544/software/otp_src_R12B-0/erts/start_scripts' /usr/bin/install -c -d /home/aaron08544/software/otp_src_R12B-0/erts/start_scripts/tmp ( cd /home/aaron08544/software/otp_src_R12B-0/erts/start_scripts/tmp && \ erl -boot start_clean -noinput +B -eval 'release_handler:create_RELEASES("%ERL_ROOT%", "/home/aaron08544/software/otp_src_R12B-0/erts/start_scripts", "/home/aaron08544/software/otp_src_R12B-0/erts/start_scripts/start_sasl.rel", []), halt()') make[2]: *** [RELEASES.src] Error 139 make[2]: Leaving directory `/home/.winkler/aaron08544/software/otp_src_R12B-0/erts/start_scripts' make[1]: *** [local_setup] Error 2 make[1]: Leaving directory `/home/.winkler/aaron08544/software/otp_src_R12B-0/erts' make: *** [local_setup] Error 2 -Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias@REDACTED Mon Jan 14 10:15:35 2008 From: matthias@REDACTED (Matthias Lang) Date: Mon, 14 Jan 2008 10:15:35 +0100 Subject: [erlang-questions] funs and code loading Message-ID: <18315.10295.882008.456569@antilipe.corelatus.se> Hi, I wrote this module to see how funs behave when code is reloaded: -module(reload). -export([go/0, f/0]). -define(VERSION, 1). go() -> E = fun reload:f/0, F = fun() -> f() end, G = fun f/0, H = fun() -> ?VERSION end, spawn(fun() -> loop(E, F, G, H) end). f() -> ?VERSION. loop(E, F, G, H) -> io:fwrite("~p ~p ~p ~p\n", [E(), F(), G(), H()]), timer:sleep(3000), loop(E, F, G, H). This is what it does on R12B-0: ~ >/usr/local/src/otp_src_R12B-0/bin/erl 1> c(reload). {ok,reload} 2> reload:go(). 1 1 1 1 <0.38.0> 3> c(reload). % edited reload.erl to change the VERSION define to 2 {ok,reload} 2 2 2 1 I was expecting to see 2 1 1 1. Is there something I'm missing? (I haven't checked whether or not (some) of the above is another facet of http://erlang.org/pipermail/erlang-bugs/2007-June/000368.html ) Matt From sgolovan@REDACTED Mon Jan 14 11:09:12 2008 From: sgolovan@REDACTED (Sergei Golovan) Date: Mon, 14 Jan 2008 13:09:12 +0300 Subject: [erlang-questions] Unable to build R12B on Debian In-Reply-To: <49a6f6bd0801140142w1b5748fas6b1c68f3ea4069dd@mail.gmail.com> References: <49a6f6bd0801140142w1b5748fas6b1c68f3ea4069dd@mail.gmail.com> Message-ID: On 1/14/08, Aaron Lee wrote: > Hi there, > > Is there a binary package which I can install? Erlang/OTP R12B-0 is in Debian experimental branch: http://packages.debian.org/source/experimental/erlang The binary packages can be installed in testing and unstable. If you're using Debian stable then you can build the packages from the sources. -- Sergei Golovan From mikpe@REDACTED Mon Jan 14 11:20:29 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 14 Jan 2008 11:20:29 +0100 Subject: [erlang-questions] Unable to build R12B on Debian In-Reply-To: <49a6f6bd0801140142w1b5748fas6b1c68f3ea4069dd@mail.gmail.com> References: <49a6f6bd0801140142w1b5748fas6b1c68f3ea4069dd@mail.gmail.com> Message-ID: <18315.14189.219215.219150@harpo.it.uu.se> Aaron Lee writes: > Hi there, > > Is there a binary package which I can install? I tried building it from the > source and I got: > > make[2]: Entering directory > `/home/.winkler/aaron08544/software/otp_src_R12B-0/erts/start_scripts' > /usr/bin/install -c -d > /home/aaron08544/software/otp_src_R12B-0/erts/start_scripts/tmp > ( cd /home/aaron08544/software/otp_src_R12B-0/erts/start_scripts/tmp && \ > erl -boot start_clean -noinput +B -eval > 'release_handler:create_RELEASES("%ERL_ROOT%", > "/home/aaron08544/software/otp_src_R12B-0/erts/start_scripts", > "/home/aaron08544/software/otp_src_R12B-0/erts/start_scripts/start_sasl.rel", > []), halt()') > make[2]: *** [RELEASES.src] Error 139 > make[2]: Leaving directory > `/home/.winkler/aaron08544/software/otp_src_R12B-0/erts/start_scripts' > make[1]: *** [local_setup] Error 2 > make[1]: Leaving directory > `/home/.winkler/aaron08544/software/otp_src_R12B-0/erts' > make: *** [local_setup] Error 2 I suspect an earlier build error in the omitted part of the build log is the root cause of this. Post the entire build log, including the initial ./configure step, if you want help to debug this. From bsayanthan@REDACTED Mon Jan 14 11:34:36 2008 From: bsayanthan@REDACTED (Balathasan Sayanthan) Date: Mon, 14 Jan 2008 16:04:36 +0530 Subject: [erlang-questions] make fails in fc7 Message-ID: <9b2076080801140234o7524e44enea6be8bf0b1dc29d@mail.gmail.com> Hi All, I tried to install erlang [otp_src_R12B-0] on fedora core 7 but when the make command was issued I got the following error. How can I fix it? drivers/common/inet_drv.c: In function 'sctp_parse_async_event': drivers/common/inet_drv.c:3100: error: 'SCTP_ADAPTION_INDICATION' undeclared (first use in this function) drivers/common/inet_drv.c:3100: error: (Each undeclared identifier is reported only once drivers/common/inet_drv.c:3100: error: for each function it appears in.) drivers/common/inet_drv.c:3106: error: 'union sctp_notification' has no member named 'sn_adaption_event' drivers/common/inet_drv.c:3111: error: dereferencing pointer to incomplete type drivers/common/inet_drv.c:3112: error: dereferencing pointer to incomplete type drivers/common/inet_drv.c:3112: warning: left-hand operand of comma expression has no effect drivers/common/inet_drv.c: In function 'sctp_set_opts': drivers/common/inet_drv.c:5323: error: field 'ad' has incomplete type drivers/common/inet_drv.c:5584: error: 'SCTP_ADAPTION_LAYER' undeclared (first use in this function) drivers/common/inet_drv.c:5688: error: 'struct sctp_event_subscribe' has no member named 'sctp_adaption_layer_event' drivers/common/inet_drv.c: In function 'sctp_fill_opts': drivers/common/inet_drv.c:6448: error: storage size of 'ad' isn't known drivers/common/inet_drv.c:6451: error: 'SCTP_ADAPTION_LAYER' undeclared (first use in this function) drivers/common/inet_drv.c:6458: warning: left-hand operand of comma expression has no effect drivers/common/inet_drv.c:6448: warning: unused variable 'ad' drivers/common/inet_drv.c:6586: error: 'struct sctp_event_subscribe' has no member named 'sctp_adaption_layer_event' drivers/common/inet_drv.c:6586: warning: left-hand operand of comma expression has no effect make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] Error 1 thank you. regards -- Sayanthan -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias@REDACTED Mon Jan 14 11:12:45 2008 From: matthias@REDACTED (Matthias Lang) Date: Mon, 14 Jan 2008 11:12:45 +0100 Subject: [erlang-questions] Unable to build R12B on Debian In-Reply-To: <49a6f6bd0801140142w1b5748fas6b1c68f3ea4069dd@mail.gmail.com> References: <49a6f6bd0801140142w1b5748fas6b1c68f3ea4069dd@mail.gmail.com> Message-ID: <18315.13725.737489.277641@antilipe.corelatus.se> Aaron Lee writes: > Is there a binary package which I can install? I tried building it from the > source and I got: R11B is in debian unstable and testing, so you can do: apt-get install erlang But maybe you specifically want the bleeding edge R12B. I'm not aware of a .deb for R12B, so you'll probably have to figure out why the build fails for you. Works fine for me on a debian unstable x86 box. Matthias ---------------------------------------------------------------------- > > make[2]: Entering directory > `/home/.winkler/aaron08544/software/otp_src_R12B-0/erts/start_scripts' > /usr/bin/install -c -d > /home/aaron08544/software/otp_src_R12B-0/erts/start_scripts/tmp > ( cd /home/aaron08544/software/otp_src_R12B-0/erts/start_scripts/tmp && \ > erl -boot start_clean -noinput +B -eval > 'release_handler:create_RELEASES("%ERL_ROOT%", > "/home/aaron08544/software/otp_src_R12B-0/erts/start_scripts", > "/home/aaron08544/software/otp_src_R12B-0/erts/start_scripts/start_sasl.rel", > []), halt()') > make[2]: *** [RELEASES.src] Error 139 > make[2]: Leaving directory > `/home/.winkler/aaron08544/software/otp_src_R12B-0/erts/start_scripts' > make[1]: *** [local_setup] Error 2 > make[1]: Leaving directory > `/home/.winkler/aaron08544/software/otp_src_R12B-0/erts' > make: *** [local_setup] Error 2 > > -Aaron From mikpe@REDACTED Mon Jan 14 14:46:25 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 14 Jan 2008 14:46:25 +0100 Subject: [erlang-questions] Unable to build R12B on Debian In-Reply-To: <49a6f6bd0801140515v74e7d8a6na60dd00e8b9f28e3@mail.gmail.com> References: <49a6f6bd0801140142w1b5748fas6b1c68f3ea4069dd@mail.gmail.com> <18315.14189.219215.219150@harpo.it.uu.se> <49a6f6bd0801140515v74e7d8a6na60dd00e8b9f28e3@mail.gmail.com> Message-ID: <18315.26545.968703.128712@harpo.it.uu.se> Aaron Lee writes: > Here's the complete log, it looks like there were some previous errors > before the last one. > > cd erts/emulator && ERL_TOP=/home/aaron08544/software/otp_src_R12B-0 make > generate depend > make[1]: Entering directory > `/home/.winkler/aaron08544/software/otp_src_R12B-0/erts/emulator' Looks like $HOME is on NFS. > javac -d /home/aaron08544/software/otp_src_R12B-0/lib/jinterface/priv/ > OtpErlangShort.java > make[4]: *** > [/home/aaron08544/software/otp_src_R12B-0/lib/jinterface/priv/com/ericsson/otp/erlang/OtpErlangShort.class] > Killed Oh dear. > CLASSPATH=/home/aaron08544/software/otp_src_R12B-0/lib/jinterface/java_src/ > javac -d /home/aaron08544/software/otp_src_R12B-0/lib/jinterface/priv/ > OtpErlangShort.java > CLASSPATH=/home/aaron08544/software/otp_src_R12B-0/lib/jinterface/java_src/ > javac -d /home/aaron08544/software/otp_src_R12B-0/lib/jinterface/priv/ > OtpErlangUInt.java > CLASSPATH=/home/aaron08544/software/otp_src_R12B-0/lib/jinterface/java_src/ > javac -d /home/aaron08544/software/otp_src_R12B-0/lib/jinterface/priv/ > OtpErlangUShort.java > make[4]: *** > [/home/aaron08544/software/otp_src_R12B-0/lib/jinterface/priv/com/ericsson/otp/erlang/OtpErlangUShort.class] > Killed So javac isn't terminally broken, but sometimes gets killed. > erl -boot start_clean -noinput +B -eval > 'release_handler:create_RELEASES("%ERL_ROOT%", > "/home/aaron08544/software/otp_src_R12B-0/erts/start_scripts", > "/home/aaron08544/software/otp_src_R12B-0/erts/start_scripts/start_sasl.rel", > []), halt()') > make[2]: *** [RELEASES.src] Error 139 > make[2]: Leaving directory > `/home/.winkler/aaron08544/software/otp_src_R12B-0/erts/start_scripts' > make[1]: *** [local_setup] Error 2 > make[1]: Leaving directory > `/home/.winkler/aaron08544/software/otp_src_R12B-0/erts' > make: *** [local_setup] Error 2 I suspect either NFS issues, like the external file system being full, or an overloaded local machine which triggers the kernel's OOM killer. Since lots of people manage to build Erlang on lots of systems, including Debian, I suspect that the problem is with your machine(s), not Erlang/OTP. From kenneth.lundin@REDACTED Mon Jan 14 19:42:28 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Mon, 14 Jan 2008 19:42:28 +0100 Subject: [erlang-questions] "processor affinity" for processes In-Reply-To: <14734902.post@talk.nabble.com> References: <95be1d3b0704120319m4c8a225cjbc86b77a2d8f96a5@mail.gmail.com> <461E2D70.2080306@ericsson.com> <95be1d3b0704130047r974f440s77377e0dafedace8@mail.gmail.com> <14734902.post@talk.nabble.com> Message-ID: See questions below. On Jan 10, 2008 3:24 PM, Zvi wrote: > > Another usefull feature will be specifying CPU Affinity for ports and > external processes launched via os:cmd/1 . This might be a potentially interesting feature, but what knowledge, research or measurements do you have which says that you get better performance with that feature? > > My current workarround is to launch script whcih temporary changing CPU > affinity of the executable. Can you explain more about this? A workaround for what? What do you want to achieve with explicit spec of CPU affinity? Suppose you already use all processor cores or processors inside the Erlang VM, how do you then know if it pays off to specify a specific CPU for the external program? /Kenneth Erlang/OTP team at Ericsson > > Zvi > > > > Vlad Dumitrescu-2 wrote: > > > > Thanks for the reply! > > > > regards, > > Vlad > > > > On 4/12/07, Rickard Green wrote: > >> Vlad Dumitrescu wrote: > >> > Hi all, > >> > > >> > I can't find anything about this, and I suppose it's because there is > >> > no such feature, but I wonder if it's possible to specify a "processor > >> > affinity" for processes when run with the SMP VM. > >> > > >> > >> There is no such feature. > >> > >> > A use-case would be to dedicate one processor/core for trace handlers, > >> > loggers and other "peripheral" activities. > >> > > >> > Or maybe it doesn't matter in practice? > >> > > >> > >> We have been talking about letting the emulator have more control over > >> activities on the different cores, but this is still on the todo list. > >> As it is today, the emulator creates X number of threads, and leave it > >> up to the OS to distribute these threads over available cores. > >> > >> BR, > >> Rickard Green, Erlang/OTP, Ericsson AB. > >> > >> > 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 > > > > > > -- > View this message in context: http://www.nabble.com/%22processor-affinity%22-for-processes-tp9956818p14734902.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 miguelrubinos@REDACTED Mon Jan 14 20:41:14 2008 From: miguelrubinos@REDACTED (Miguel =?ISO-8859-1?Q?Rodr=EDguez?= Rubinos) Date: Mon, 14 Jan 2008 20:41:14 +0100 Subject: [erlang-questions] how: binary from pipe in os:cmd Message-ID: <1200339674.6187.18.camel@bird> Hello all, I'd like to read a binary from 'os:cmd("some_command with_args -")'. This generates a binary that is sent through stdout as result. The problem is that 'os:cmd' seems to stop reading when bytes 0x00 (NULL) or 0x04 (EOT) are found. So, usually, it doesn't return the entire binary. Has anybody idea of how to do this? I would like to read the entire binary, not only the first N characters until 0x00 or 0x04. For example, if you type 33> length(os:cmd("lame --silent bark.wav -")). 135 Tha character at position 135 of resulting mp3 is 0x04. Besides, full mp3 size should be 576 bytes. Thanks in advance. Cheers, Miguel -- Miguel Rodr?guez Rubinos -------------- next part -------------- A non-text attachment was scrubbed... Name: bark.wav Type: audio/x-wav Size: 2411 bytes Desc: not available URL: From exta7@REDACTED Mon Jan 14 21:08:59 2008 From: exta7@REDACTED (Zvi) Date: Mon, 14 Jan 2008 12:08:59 -0800 (PST) Subject: [erlang-questions] "processor affinity" for processes In-Reply-To: References: <95be1d3b0704120319m4c8a225cjbc86b77a2d8f96a5@mail.gmail.com> <461E2D70.2080306@ericsson.com> <95be1d3b0704130047r974f440s77377e0dafedace8@mail.gmail.com> <14734902.post@talk.nabble.com> Message-ID: <14812184.post@talk.nabble.com> Kenneth Lundin wrote: > > See questions below. > > On Jan 10, 2008 3:24 PM, Zvi wrote: >> >> Another usefull feature will be specifying CPU Affinity for ports and >> external processes launched via os:cmd/1 . > > This might be a potentially interesting feature, but what knowledge, > research or measurements do > you have which says that you get better performance with that feature? > Kenneth, I'll post here some snippets from my presentation "Migration to Multi-Core" (I prepared it for one-day seminar, maybe I'll clean it up and put on the web some day): ---------------------------------------- Why mess with CPU Affinity? - Legacy Code Migration Usually OS handles CPU Affinity automatically very good. So why mess with it? * When migrating old applications to multi-core CPU, their performance may start degrading. This happens because OS moving application?s threads and interrupt routines between cores. * By fixing application?s process and threads to CPU #0, application will start behave the same way, as on uniprocessor machine. ---------------------------------------- Why mess with CPU Affinity? - Real-Time and Determinism * By setting CPU affinity for our application?s thread - we get deterministic execution times, needed for Real-Time. * OS will no more move our threads between cores. * For example, let?s say we developing video surveillance system using dual-core CPU. We have two threads: #1 ? receiving video frames from the Matrox Frame Grabber #2 ? transmitting the received frames via TCP/IP to the Server By setting affinity of the receiving thread on CPU #0 and of the transmitting thread on CPU #1 ? we getting deterministic execution times. ------------------------------------------ Why mess with CPU Affinity? - Memory Affinity Cache locality * There are some multi-core CPUs with separate L1 caches (for example: Pentium-D, some Intel?s quad-core CPUs). * If OS moving thread from one core to another, the data is missing on the 2nd core, so it must fetch data from RAM, thus we get performance degradation. NUMA * On the NUMA, each memory bank connect directly to single CPU. When accessing RAM from another CPU it will be slower. * By setting thread?s CPU affinity and allocating memory on the faster RAM bank, we getting performance improvement. Kenneth Lundin wrote: > >> My current workarround is to launch script whcih temporary changing CPU >> affinity of the executable. > > Can you explain more about this? > A workaround for what? > What do you want to achieve with explicit spec of CPU affinity? > > Suppose you already use all processor cores or processors inside the > Erlang VM, how do > you then know if it pays off to specify a specific CPU for the external > program? > There are also need to control number of CPUs/cores Erlang VM using, then the rest we can use for ports or another non-Erlang external processes. for example, I have 8 cores server, when I running Erlang VM it shows smp:8. Now let's say I want Erlang VM only use 1 core and control long-running computations/encoding on the other cores. In Windows I can do it using this command: %% running mp3 encoding on CPU #3 Cmd = "ffmpeg -y -i input.wav output.mp3". AffinityMask = "100".%% this means CPU #3 os:cmd("process.exe -a \""++Cmd++"\" "++AffinityMask). I hope this clear the things. Best Regards, Zvi -- View this message in context: http://www.nabble.com/%22processor-affinity%22-for-processes-tp9956818p14812184.html Sent from the Erlang Questions mailing list archive at Nabble.com. From casper2000a@REDACTED Mon Jan 14 21:37:03 2008 From: casper2000a@REDACTED (Eranga Udesh) Date: Tue, 15 Jan 2008 02:07:03 +0530 Subject: [erlang-questions] Avoiding old and unused Heap In-Reply-To: <18315.26545.968703.128712@harpo.it.uu.se> References: <49a6f6bd0801140142w1b5748fas6b1c68f3ea4069dd@mail.gmail.com> <18315.14189.219215.219150@harpo.it.uu.se> <49a6f6bd0801140515v74e7d8a6na60dd00e8b9f28e3@mail.gmail.com> <18315.26545.968703.128712@harpo.it.uu.se> Message-ID: <001401c856ed$38b038d0$aa10aa70$@com> Hi, In Erlang, is there a way to specify the maximum unused Heap size? What I wants to avoid is in the process long run, to limit the below kind of unused Heap memory growth. Reductions: 16718 Stack+heap: 196418 OldHeap: 317811 Heap unused: 70692 OldHeap unused: 317811 I tried setting fullsweep_after spawn_opt, but it doesn't seems to work. When there's about 30-40k processes in the system, above sort of memory allocation exceeds 2GB memory limit and Erlang crashes. How to fix? BRgds, - Eranga From nem@REDACTED Mon Jan 14 22:03:16 2008 From: nem@REDACTED (Geoff Cant) Date: Tue, 15 Jan 2008 10:03:16 +1300 Subject: [erlang-questions] how: binary from pipe in os:cmd In-Reply-To: <1200339674.6187.18.camel@bird> ("Miguel =?iso-8859-1?Q?Rodr?= =?iso-8859-1?Q?=EDguez?= Rubinos"'s message of "Mon, 14 Jan 2008 20:41:14 +0100") References: <1200339674.6187.18.camel@bird> Message-ID: Miguel Rodr?guez Rubinos writes: > Hello all, > > I'd like to read a binary from 'os:cmd("some_command with_args -")'. > This generates a binary that is sent through stdout as result. > > The problem is that 'os:cmd' seems to stop reading when bytes 0x00 > (NULL) or 0x04 (EOT) are found. So, usually, it doesn't return the > entire binary. > > Has anybody idea of how to do this? I would like to read the entire > binary, not only the first N characters until 0x00 or 0x04. > > For example, if you type > > 33> length(os:cmd("lame --silent bark.wav -")). > 135 > > Tha character at position 135 of resulting mp3 is 0x04. Besides, > full mp3 size should be 576 bytes. > > Thanks in advance. > > Cheers, > > Miguel Hi there - I've just looked at os.erl and it does filter the output of the process though a function that stops on EOT (see os:eot/1) - can't quite figure out why it stops on 0x00 as well. As an alternative, maybe try reading it manually from a port spawn: file:write_file("priv/test.bin", <<"This is a test of file reading.", 4,"Just send end of transmission.", 0,"Just send a null. Now EOF.">>). --> ok os:cmd("cat priv/test.bin"). --> <<"This is a test of file reading.">> Port = open_port({spawn, "cat priv/test.bin"}, [stream, eof, exit_status, binary]). --> <#Port> Data = receive {Port, {data, Bin}} -> Bin after 100 -> timeout end. --> <<"This is a test of file reading."...>> End = receive {Port, {exit_status, Exit}} -> Exit after 100 -> timeout end. --> 0 Data =:= <<"This is a test of file reading.",4,"Just send end of transmission.",0,"Just send a null. Now EOF.">>. --> True Cheers, -- Geoff Cant From helenez@REDACTED Mon Jan 14 21:40:55 2008 From: helenez@REDACTED (Helene Zwijnenberg ) Date: Mon, 14 Jan 2008 12:40:55 -0800 Subject: [erlang-questions] \bjob: Job opportunity - telecommute - Erlang/C/C++/Linux/MySQL/XML Message-ID: For one of my clients in the Boston area, I am looking for a seasoned Senior Network Software Engineer for permanent position working from your home office location. This person will help to build mission critical network services in Erlang on the GNU/Linux platform. The ideal candidate has worked on large scale production environments with thousands of concurrent clients connected to software they have built/deployed. Salary is very competitive. Looking for someone who has: - Experience with Erlang - Expert level network programming experience, preferably in Erlang, C++ and/or C - Strong background in developing for GNU/Linux or Unix-like platforms for mission critical production deployments - Strong understanding of MySQL 4.1-5.x, including database design patterns and large-scale deployments utilizing replications and/or clustering - Experience programming network servers/clients, including knowledge of fundamental protocols such as TCP, UDP, IPv4/6, and SSL/TLS - Knowledge of and experience using XML technologies For more information please contact: Helene Zwijnenberg CIC, Inc. tel: 813-425-4830 email: helenez@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From sysop@REDACTED Mon Jan 14 23:02:16 2008 From: sysop@REDACTED (Matt Stancliff) Date: Mon, 14 Jan 2008 14:02:16 -0800 Subject: [erlang-questions] \bjob: Job opportunity - telecommute - Erlang/C/C++/Linux/MySQL/XML In-Reply-To: References: Message-ID: <0913C2B3-F4F8-4112-A76F-2528094E5FFF@mindspring.com> On Jan 14, 2008, at 12:40, Helene Zwijnenberg wrote: > For one of my clients in the Boston area, I am looking for a > seasoned Senior Network Software Engineer for permanent position > working from your home office location. This person will help to > build mission critical network services in Erlang on the GNU/Linux > platform. The ideal candidate has worked on large scale production > environments with thousands of concurrent clients connected to > software they have built/deployed. Salary is very competitive. > Your client is The Hive/singlesnet.com and a more detailed description is at http://www.thehive.com/current-jobs/senior-network- software-engineer/ I interviewed with them about a month ago. I don't remember them having interest in Erlang at all. Maybe they changed course in a month? You can't hide on the internets. -Matt -- Matt Stancliff sysop@REDACTED AIM: seijimr iPhone: 678-591-9337 "The best way to predict the future is to invent it." --Alan Kay From dizzyd@REDACTED Mon Jan 14 23:47:03 2008 From: dizzyd@REDACTED (Dave Smith) Date: Mon, 14 Jan 2008 15:47:03 -0700 Subject: [erlang-questions] Erlang resumes? In-Reply-To: References: Message-ID: Well, many thanks to all of you who helped me with discussion points as well as resume proof that there are people out there using Erlang (duh!!). Over the holidays I put together a prototype of a project and was able to demonstrate something that ran fast and was surprisingly solid (given the short dev time). Altogether, it made for a solid open/shut case in Erlang's favor. Kudos to Joe Armstrong and rest of the Erlang team who built such a wonderful tool. :) My employer is now quite excited about the possibilities and looking for Erlang people. If you're interested: http://www.thehive.com/current-jobs/senior-network-software-engineer/ It's a pretty nice place to work, if I do say so myself..:) Thanks again. D. On Dec 21, 2007 1:36 PM, Dave Smith wrote: > I'm in the process of building a case for Erlang at my job. We're > building a large scale network service and I'm pretty certain that > using erlang would reduce both time to market and system complexity. > The problem is, when I suggest Erlang people look at me funny (ok, > maybe it's just my hairstyle) and say things like "There aren't any > erlang developers out there!" and "It's an obscure language and we'd > be unable to maintain the system if you got hit by a bus", etc... > > I suspect that there _are_ erlang devs in the US/Canada area who are > competent and would love the chance to work from home with awesome > hardware and develop a large scale Erlang service. If you happen to be > one of them, would you kindly consider sending me your resume as > evidence? I can't promise you a job as a result, but you might > consider it your part in getting the word out on Erlang. :) > > Sincerely, > > Dave Smith > dizzyd at gmail dot com > From ali.yakout@REDACTED Tue Jan 15 08:12:29 2008 From: ali.yakout@REDACTED (Ali Yakout) Date: Tue, 15 Jan 2008 08:12:29 +0100 Subject: [erlang-questions] Why the compiler doesn't complain! Message-ID: Hi, I came across some strange compiler behavior. The compiler should display a warning if some clause can't match because the previous one do. And this is true for the following: -record(state, {name, accountNo, input, pin}). eval(Command, Args) -> io:format("Executing ~p ... ~n", [Command]); eval({quit}, _) -> done. 8> c("me"). me.erl:7: Warning: this clause cannot match because a previous clause at line 5 always matches {ok,me} But, when adding a record to the match clause, it goes ok ! eval2(Command, #state{name = "erl"}) -> io:format("Executing ~p ... ~n", [Command]); eval2({quit}, #state{name = "erl"}) -> done. 9> c("me"). {ok,me} Regards, Ali Yakout -------------- next part -------------- An HTML attachment was scrubbed... URL: From eajam@REDACTED Tue Jan 15 09:44:12 2008 From: eajam@REDACTED (alex alvarez) Date: Tue, 15 Jan 2008 03:44:12 -0500 (EST) Subject: [erlang-questions] concurrency developments Message-ID: <20080115034412.HM.00000000000000I@eajam.bos-mail-wwl1.lycos.com> An HTML attachment was scrubbed... URL: From waifunlee@REDACTED Tue Jan 15 10:56:36 2008 From: waifunlee@REDACTED (Aaron Lee) Date: Tue, 15 Jan 2008 01:56:36 -0800 Subject: [erlang-questions] Unable to build R12B on Debian In-Reply-To: <18315.26545.968703.128712@harpo.it.uu.se> References: <49a6f6bd0801140142w1b5748fas6b1c68f3ea4069dd@mail.gmail.com> <18315.14189.219215.219150@harpo.it.uu.se> <49a6f6bd0801140515v74e7d8a6na60dd00e8b9f28e3@mail.gmail.com> <18315.26545.968703.128712@harpo.it.uu.se> Message-ID: <49a6f6bd0801150156p37e96066ubcdbcd1d2b23bcbf@mail.gmail.com> If I configure with --disable-hipe, I don't seem to get that error. Any idea what may go wrong? -Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsu79@REDACTED Tue Jan 15 11:18:31 2008 From: chsu79@REDACTED (Christian S) Date: Tue, 15 Jan 2008 11:18:31 +0100 Subject: [erlang-questions] concurrency developments In-Reply-To: <20080115034412.HM.00000000000000I@eajam.bos-mail-wwl1.lycos.com> References: <20080115034412.HM.00000000000000I@eajam.bos-mail-wwl1.lycos.com> Message-ID: Where are process links? Where are supervision tree infra-structure? Where is remote-node messaging transparency? > http://www.groovyactors.org/ From mikpe@REDACTED Tue Jan 15 11:22:57 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 15 Jan 2008 11:22:57 +0100 Subject: [erlang-questions] Unable to build R12B on Debian In-Reply-To: <49a6f6bd0801150156p37e96066ubcdbcd1d2b23bcbf@mail.gmail.com> References: <49a6f6bd0801140142w1b5748fas6b1c68f3ea4069dd@mail.gmail.com> <18315.14189.219215.219150@harpo.it.uu.se> <49a6f6bd0801140515v74e7d8a6na60dd00e8b9f28e3@mail.gmail.com> <18315.26545.968703.128712@harpo.it.uu.se> <49a6f6bd0801150156p37e96066ubcdbcd1d2b23bcbf@mail.gmail.com> Message-ID: <18316.35201.406155.173569@harpo.it.uu.se> Aaron Lee writes: > If I configure with --disable-hipe, I don't seem to get that error. Any idea > what may go wrong? The build log you sent me indicates a woefully incomplete build, it didn't even list the build of core erts stuff like beam_emu.o. So I have no information upon which to base any guesses. Nuke the source tree, unpack a fresh one, ./configure and make it, and save the entire build log. From vychodil.hynek@REDACTED Tue Jan 15 11:27:09 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 15 Jan 2008 11:27:09 +0100 Subject: [erlang-questions] concurrency developments In-Reply-To: References: <20080115034412.HM.00000000000000I@eajam.bos-mail-wwl1.lycos.com> Message-ID: <4d08db370801150227l677325daq275fd246a6eb8cf0@mail.gmail.com> ... and where is immutable variables, where is side effect free functional programming? Where is funny declarative (easy readable) syntax? Groovy is death way. On 1/15/08, Christian S wrote: > Where are process links? Where are supervision tree infra-structure? > Where is remote-node messaging transparency? > > > http://www.groovyactors.org/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil From bjorn@REDACTED Tue Jan 15 11:29:08 2008 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 15 Jan 2008 11:29:08 +0100 Subject: [erlang-questions] Why the compiler doesn't complain! In-Reply-To: References: Message-ID: "Ali Yakout" writes: > The compiler should display a warning if some clause can't match because > the previous one do. The compiler does not guarantee that the compiler will display a warning for every clause that cannot be reached. The compiler will only display a warning if it is smart enough to see that the second clause cannot match. > But, when adding a record to the match clause, it goes ok ! > > eval2(Command, #state{name = "erl"}) -> > io:format("Executing ~p ... ~n", [Command]); > eval2({quit}, #state{name = "erl"}) -> > done. The compiler is not smart enough in this case. Dialyzer may handle this better. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From qrilka@REDACTED Tue Jan 15 12:12:18 2008 From: qrilka@REDACTED (Kirill Zaborski) Date: Tue, 15 Jan 2008 14:12:18 +0300 Subject: [erlang-questions] concurrency developments In-Reply-To: <4d08db370801150227l677325daq275fd246a6eb8cf0@mail.gmail.com> References: <20080115034412.HM.00000000000000I@eajam.bos-mail-wwl1.lycos.com> <4d08db370801150227l677325daq275fd246a6eb8cf0@mail.gmail.com> Message-ID: <337538cb0801150312y2f7d1e75yb34125fa7a638599@mail.gmail.com> And also normally better GC performance coming from immutable variables? Not requiring intricate GC options. On Jan 15, 2008 1:27 PM, Hynek Vychodil wrote: > ... and where is immutable variables, where is side effect free > functional programming? Where is funny declarative (easy readable) > syntax? > > Groovy is death way. > > On 1/15/08, Christian S wrote: > > Where are process links? Where are supervision tree infra-structure? > > Where is remote-node messaging transparency? > > > > > http://www.groovyactors.org/ > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > -- > --Hynek (Pichi) Vychodil > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vychodil.hynek@REDACTED Tue Jan 15 12:37:45 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 15 Jan 2008 12:37:45 +0100 Subject: [erlang-questions] concurrency developments In-Reply-To: <337538cb0801150312y2f7d1e75yb34125fa7a638599@mail.gmail.com> References: <20080115034412.HM.00000000000000I@eajam.bos-mail-wwl1.lycos.com> <4d08db370801150227l677325daq275fd246a6eb8cf0@mail.gmail.com> <337538cb0801150312y2f7d1e75yb34125fa7a638599@mail.gmail.com> Message-ID: <4d08db370801150337m6b4c53a6k5b0ea415171ebea2@mail.gmail.com> It isn't matter of performance, it is about security, reliability and bug hunting. On 1/15/08, Kirill Zaborski wrote: > And also normally better GC performance coming from immutable variables? Not > requiring intricate GC options. > > > On Jan 15, 2008 1:27 PM, Hynek Vychodil < vychodil.hynek@REDACTED> wrote: > > > > ... and where is immutable variables, where is side effect free > > functional programming? Where is funny declarative (easy readable) > > syntax? > > > > Groovy is death way. > > > > > > > > > > On 1/15/08, Christian S wrote: > > > Where are process links? Where are supervision tree infra-structure? > > > Where is remote-node messaging transparency? > > > > > > > http://www.groovyactors.org/ > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > -- > > --Hynek (Pichi) Vychodil > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > -- --Hynek (Pichi) Vychodil From qrilka@REDACTED Tue Jan 15 12:47:44 2008 From: qrilka@REDACTED (Kirill Zaborski) Date: Tue, 15 Jan 2008 14:47:44 +0300 Subject: [erlang-questions] concurrency developments In-Reply-To: <4d08db370801150337m6b4c53a6k5b0ea415171ebea2@mail.gmail.com> References: <20080115034412.HM.00000000000000I@eajam.bos-mail-wwl1.lycos.com> <4d08db370801150227l677325daq275fd246a6eb8cf0@mail.gmail.com> <337538cb0801150312y2f7d1e75yb34125fa7a638599@mail.gmail.com> <4d08db370801150337m6b4c53a6k5b0ea415171ebea2@mail.gmail.com> Message-ID: <337538cb0801150347m287c43f3m4dc9ae31f1a52e40@mail.gmail.com> So you say that performance doesn't matter? Somewhat strange statement from engineer. P.S. In some circumstances it can be negligible and I don't deny other benefits from immutalbe variables. Just point to not very rare issues with Java GC which could be solved in GC assuming immutable variables (which make it simpler as far as I understand). Regards, Kirill. On Jan 15, 2008 2:37 PM, Hynek Vychodil wrote: > It isn't matter of performance, it is about security, reliability and > bug hunting. > > On 1/15/08, Kirill Zaborski wrote: > > And also normally better GC performance coming from immutable variables? > Not > > requiring intricate GC options. > > > > > > On Jan 15, 2008 1:27 PM, Hynek Vychodil < vychodil.hynek@REDACTED> > wrote: > > > > > > ... and where is immutable variables, where is side effect free > > > functional programming? Where is funny declarative (easy readable) > > > syntax? > > > > > > Groovy is death way. > > > > > > > > > > > > > > > On 1/15/08, Christian S wrote: > > > > Where are process links? Where are supervision tree infra-structure? > > > > Where is remote-node messaging transparency? > > > > > > > > > http://www.groovyactors.org/ > > > > _______________________________________________ > > > > erlang-questions mailing list > > > > erlang-questions@REDACTED > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > -- > > > --Hynek (Pichi) Vychodil > > > > > > > > > > > > _______________________________________________ > > > 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 listproc@REDACTED Tue Jan 15 12:52:42 2008 From: listproc@REDACTED (Ukyo Virgden) Date: Tue, 15 Jan 2008 13:52:42 +0200 Subject: [erlang-questions] High volume CDR analysis Message-ID: <7A3ACF0B-BD04-4108-A0E0-7E8548B7983B@gencay.net> Hi, I'm working full-time on a system which involves a hundreds of millions of CDR records. Our current setup is a typical ETL infrastructure which NOBODY is happy about. After reading and experimenting with Erlang and Mnesia, wouldn't it be possible to do such ETL with Erlang and Mnesia? Any suggestions? Regards, Ukyo. From vychodil.hynek@REDACTED Tue Jan 15 13:18:56 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 15 Jan 2008 13:18:56 +0100 Subject: [erlang-questions] concurrency developments In-Reply-To: <337538cb0801150347m287c43f3m4dc9ae31f1a52e40@mail.gmail.com> References: <20080115034412.HM.00000000000000I@eajam.bos-mail-wwl1.lycos.com> <4d08db370801150227l677325daq275fd246a6eb8cf0@mail.gmail.com> <337538cb0801150312y2f7d1e75yb34125fa7a638599@mail.gmail.com> <4d08db370801150337m6b4c53a6k5b0ea415171ebea2@mail.gmail.com> <337538cb0801150347m287c43f3m4dc9ae31f1a52e40@mail.gmail.com> Message-ID: <4d08db370801150418i6ed3ab5co79f30e77c617f6e9@mail.gmail.com> I never said that performance doesn't matter! I said that It (immutable variables and side effect free functions) isn't matter of performance, it is about security, reliability and bug hunting. There is very big difference and don't put different sentences to my mouth. If it carry in some GC simplification and performance benefit on multi core systems, thanks for it, but it is good side effect and it isn't biggest benefit for me. On 1/15/08, Kirill Zaborski wrote: > So you say that performance doesn't matter? > Somewhat strange statement from engineer. > > P.S. In some circumstances it can be negligible and I don't deny other > benefits from immutalbe variables. Just point to not very rare issues with > Java GC which could be solved in GC assuming immutable variables (which make > it simpler as far as I understand). > > Regards, > Kirill. > > > On Jan 15, 2008 2:37 PM, Hynek Vychodil wrote: > > It isn't matter of performance, it is about security, reliability and > > bug hunting. > > > > > > > > > > On 1/15/08, Kirill Zaborski wrote: > > > And also normally better GC performance coming from immutable variables? > Not > > > requiring intricate GC options. > > > > > > > > > On Jan 15, 2008 1:27 PM, Hynek Vychodil < vychodil.hynek@REDACTED> > wrote: > > > > > > > > ... and where is immutable variables, where is side effect free > > > > functional programming? Where is funny declarative (easy readable) > > > > syntax? > > > > > > > > Groovy is death way. > > > > > > > > > > > > > > > > > > > > On 1/15/08, Christian S wrote: > > > > > Where are process links? Where are supervision tree infra-structure? > > > > > Where is remote-node messaging transparency? > > > > > > > > > > > http://www.groovyactors.org/ > > > > > _______________________________________________ > > > > > erlang-questions mailing list > > > > > erlang-questions@REDACTED > > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > -- > > > > --Hynek (Pichi) Vychodil > > > > > > > > > > > > > > > > _______________________________________________ > > > > erlang-questions mailing list > > > > erlang-questions@REDACTED > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > -- > > --Hynek (Pichi) Vychodil > > > > -- --Hynek (Pichi) Vychodil From yu_c@REDACTED Tue Jan 15 13:18:08 2008 From: yu_c@REDACTED (Chih - Wei Yu [ MTN - Innovation Centre ]) Date: Tue, 15 Jan 2008 14:18:08 +0200 Subject: [erlang-questions] R12B-0 Compiler questions Message-ID: Hi, I'm having some issues when compiling code in R12B-0. Its reporting internal consistency check failed. I can compile the code in R11B-5. I've provided the code that is reporting the error when compiling. I did see other 'similar' issues raised but would like to raise it again. Thanks. [Code] encode_octet_string( <>, Len ) -> <>; % The compiler reports an error for this line of code encode_octet_string( [H|T], Len ) -> B = list_to_binary( [H|T] ), << B:Len/binary-unit:8>> % However, for this line of code it does not report an error. ; encode_octet_string( _ANY, _ ) -> <<>>. [compiler error] (test@REDACTED)8> c("../../../../projects/src/smpp_types"). smpp_types: function encode_octet_string/2+9: Internal consistency check failed - please report this bug. Instruction: {bs_put_binary,{f,0}, {x,1}, 8, {field_flags,[unsigned,big]}, {x,0}} Error: {match_context,{x,0}}: ------------------------------------------------------------------------ ------------------------------------------------------------- Another piece of code [Code] <> = R7, <> = R8, {C, <<_R10/binary>>} = if A > 0 -> decode_octet_string( A, R9 ); true -> <<_NIL:8, R9x/binary>> = R9, % The compiler reports an error for this line of code {[], <>} end, [Compiler error] Internal consistency check failed - please report this bug. Instruction: {bs_append,{f,0}, {integer,0}, 0,5,8, {x,3}, {field_flags,[]}, {x,5}} Error: {match_context,{x,3}}: Regards, Chih-Wei Yu Regards, Chih-Wei Yu NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 -------------- next part -------------- An HTML attachment was scrubbed... URL: From yu_c@REDACTED Tue Jan 15 14:06:37 2008 From: yu_c@REDACTED (Chih - Wei Yu [ MTN - Innovation Centre ]) Date: Tue, 15 Jan 2008 15:06:37 +0200 Subject: [erlang-questions] R12B-0 Compiler questions In-Reply-To: Message-ID: Hi, It came to realisation by returning R9x instead of <> in the second piece of code, the code did compile. From: <<_NIL:8, R9x/binary>> = R9, {[], <>} To: <<_NIL:8, R9x/binary>> = R9, {[], R9x} Regards, Chih-Wei Yu ________________________________ From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Chih - Wei Yu [ MTN - Innovation Centre ] Sent: Tuesday, January 15, 2008 2:18 PM To: erlang-questions@REDACTED Subject: [erlang-questions] R12B-0 Compiler questions Hi, I'm having some issues when compiling code in R12B-0. Its reporting internal consistency check failed. I can compile the code in R11B-5. I've provided the code that is reporting the error when compiling. I did see other 'similar' issues raised but would like to raise it again. Thanks. [Code] encode_octet_string( <>, Len ) -> <>; % The compiler reports an error for this line of code encode_octet_string( [H|T], Len ) -> B = list_to_binary( [H|T] ), << B:Len/binary-unit:8>> % However, for this line of code it does not report an error. ; encode_octet_string( _ANY, _ ) -> <<>>. [compiler error] (test@REDACTED)8> c("../../../../projects/src/smpp_types"). smpp_types: function encode_octet_string/2+9: Internal consistency check failed - please report this bug. Instruction: {bs_put_binary,{f,0}, {x,1}, 8, {field_flags,[unsigned,big]}, {x,0}} Error: {match_context,{x,0}}: ------------------------------------------------------------------------ ------------------------------------------------------------- Another piece of code [Code] <> = R7, <> = R8, {C, <<_R10/binary>>} = if A > 0 -> decode_octet_string( A, R9 ); true -> <<_NIL:8, R9x/binary>> = R9, % The compiler reports an error for this line of code {[], <>} end, [Compiler error] Internal consistency check failed - please report this bug. Instruction: {bs_append,{f,0}, {integer,0}, 0,5,8, {x,3}, {field_flags,[]}, {x,5}} Error: {match_context,{x,3}}: Regards, Chih-Wei Yu NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahmed.nawras@REDACTED Tue Jan 15 14:31:52 2008 From: ahmed.nawras@REDACTED (Ahmed Ali) Date: Tue, 15 Jan 2008 17:31:52 +0400 Subject: [erlang-questions] question: macro definition Message-ID: Hi, I have a question about macro definitions in Erlang. When I write the following in my .hrl file: [line 10] -define(LOG(X), io:format("~w~n",[X])). [line 11] -define(LOG(X,D), io:format("~w~n",[X,D])). I get the following compile error: ./../include/file.hrl:11: redefining macro ''LOG'' Can someone explain to me what "redefining" means here? Does that mean if I cannot define a macro with the same name even though they have different arity? Best regards, Ahmed Al-Issaei -------------- next part -------------- An HTML attachment was scrubbed... URL: From richardc@REDACTED Tue Jan 15 15:02:40 2008 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 15 Jan 2008 15:02:40 +0100 Subject: [erlang-questions] question: macro definition In-Reply-To: References: Message-ID: <478CBD00.5070106@it.uu.se> Ahmed Ali wrote: > Does that mean > if I cannot define a macro with the same name even though they have > different arity? Yes. Erlang functions can have different arities, but macros are a completely different thing. You cannot have two macros with the same name. /Richard From vychodil.hynek@REDACTED Tue Jan 15 15:05:06 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 15 Jan 2008 15:05:06 +0100 Subject: [erlang-questions] question: macro definition In-Reply-To: References: Message-ID: <4d08db370801150605o1323f96gf05844e810c9d7bf@mail.gmail.com> Macros don't work like erlang functions, they don't have arity so LOG/1 and LOG/2 are same macro LOG. On 1/15/08, Ahmed Ali wrote: > Hi, > > I have a question about macro definitions in Erlang. > > When I write the following in my .hrl file: > > > [line 10] -define(LOG(X), io:format("~w~n",[X])). > [line 11] -define(LOG(X,D), io:format("~w~n",[X,D])). > > > I get the following compile error: > > ./../include/file.hrl:11: redefining macro ''LOG'' > > Can someone explain to me what "redefining" means here? Does that mean if I > cannot define a macro with the same name even though they have different > arity? > > Best regards, > > Ahmed Al-Issaei > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil From ahmed.nawras@REDACTED Tue Jan 15 15:17:27 2008 From: ahmed.nawras@REDACTED (Ahmed Ali) Date: Tue, 15 Jan 2008 18:17:27 +0400 Subject: [erlang-questions] question: macro definition In-Reply-To: <4d08db370801150605o1323f96gf05844e810c9d7bf@mail.gmail.com> References: <4d08db370801150605o1323f96gf05844e810c9d7bf@mail.gmail.com> Message-ID: Hi Richard, Mats, Hynek; Thanks for your fast response. Best regards, Ahmed Al-Issaei On Jan 15, 2008 6:05 PM, Hynek Vychodil wrote: > Macros don't work like erlang functions, they don't have arity so > LOG/1 and LOG/2 are same macro LOG. > > > > > On 1/15/08, Ahmed Ali wrote: > > Hi, > > > > I have a question about macro definitions in Erlang. > > > > When I write the following in my .hrl file: > > > > > > [line 10] -define(LOG(X), io:format("~w~n",[X])). > > [line 11] -define(LOG(X,D), io:format("~w~n",[X,D])). > > > > > > I get the following compile error: > > > > ./../include/file.hrl:11: redefining macro ''LOG'' > > > > Can someone explain to me what "redefining" means here? Does that mean if I > > cannot define a macro with the same name even though they have different > > arity? > > > > Best regards, > > > > Ahmed Al-Issaei > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > -- > --Hynek (Pichi) Vychodil > From bjorn@REDACTED Tue Jan 15 16:25:15 2008 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 15 Jan 2008 16:25:15 +0100 Subject: [erlang-questions] [erlang-bugs] R12B-0 Compiler issues In-Reply-To: References: Message-ID: "Chih - Wei Yu [ MTN - Innovation Centre ]" writes: > I've provided the code that is reporting the error when compiling. I did > see other 'similar' issues raised but would like to raise it again. > [Code] > > encode_octet_string( <>, Len ) -> > <>; % The compiler reports an error for > this line of code > > encode_octet_string( [H|T], Len ) > > -> > > B = list_to_binary( [H|T] ), > > << B:Len/binary-unit:8>> > % However, for this line of code it does not report an error. > > ; > > encode_octet_string( _ANY, _ ) -> <<>>. > Thanks for the new test case. Bjorn's law - "If it isn't tested, it doesn't work" - has again been proved. :-) Your other code example is not complete, so I haven't verified, but it seems to be the same bug that I have already fixed. The attached patch should fix all found bugs in beam_bsm.erl. It should be applied to the unchanged beam_bsm.erl in R12B-0. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB -------------- next part -------------- A non-text attachment was scrubbed... Name: t2 Type: application/octet-stream Size: 2163 bytes Desc: Cumulative patch for beam_bsm.erl URL: From rvirding@REDACTED Tue Jan 15 16:24:29 2008 From: rvirding@REDACTED (Robert Virding) Date: Tue, 15 Jan 2008 16:24:29 +0100 Subject: [erlang-questions] question: macro definition In-Reply-To: References: Message-ID: <3dbc6d1c0801150724v36796f2an8778e2a3f5e6281e@mail.gmail.com> On 15/01/2008, Ahmed Ali wrote: > > > Can someone explain to me what "redefining" means here? Does that mean if > I cannot define a macro with the same name even though they have different > arity? That is exactly what it means. It was a mistake to do it that way. But it could be corrected now if people really want it. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahmed.nawras@REDACTED Tue Jan 15 19:40:23 2008 From: ahmed.nawras@REDACTED (Ahmed Ali) Date: Tue, 15 Jan 2008 22:40:23 +0400 Subject: [erlang-questions] question: macro definition In-Reply-To: <9D5D0FF2FC2E5C47A1A54047C271BE490124DD89@MTNMAIL1.mtn.co.za> References: <9D5D0FF2FC2E5C47A1A54047C271BE490124DD89@MTNMAIL1.mtn.co.za> Message-ID: Thanks Primanathan, This is a smart solution. I wonder how come I didn't think of it. I thought I know how to write functional program :) Best regards, Ahmed Al-Issaei On Jan 15, 2008 7:23 PM, Primanathan Reddy [ MTN - Innovation Centre ] wrote: > > > > > Hi > > > > If you really want to use the same MACRO name you can try this! > > > > -define( LOG( ARGS ), fun( [X] ) -> io:format( "~w~n", [X] ); > > ([X,D]) -> io:format( "~w~w~n", [X,D] ); > > (_) -> void end ). > > > > > > > > Then you can use ?LOG( [TERM1] ) and ?LOG( [TERM1, TERM2] ). > > > > > > > > ________________________________ > > > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Ahmed Ali > Sent: Tuesday, 15 January 2008 03:32 PM > To: Erlang > Subject: [erlang-questions] question: macro definition > > > > > > Hi, > > I have a question about macro definitions in Erlang. > > When I write the following in my .hrl file: > > > [line 10] -define(LOG(X), io:format("~w~n",[X])). > [line 11] -define(LOG(X,D), io:format("~w~n",[X,D])). > > > I get the following compile error: > > ./../include/file.hrl:11: redefining macro ''LOG'' > > Can someone explain to me what "redefining" means here? Does that mean if I > cannot define a macro with the same name even though they have different > arity? > > Best regards, > > Ahmed Al-Issaei NOTE: This e-mail message is subject to the MTN Group > disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 From ahmed.nawras@REDACTED Tue Jan 15 19:42:17 2008 From: ahmed.nawras@REDACTED (Ahmed Ali) Date: Tue, 15 Jan 2008 22:42:17 +0400 Subject: [erlang-questions] High volume CDR analysis In-Reply-To: <7A3ACF0B-BD04-4108-A0E0-7E8548B7983B@gencay.net> References: <7A3ACF0B-BD04-4108-A0E0-7E8548B7983B@gencay.net> Message-ID: Hi Ukyo, Just wondering, what's ETL? Best regards, Ahmed On Jan 15, 2008 3:52 PM, Ukyo Virgden wrote: > Hi, > > I'm working full-time on a system which involves a hundreds of > millions of CDR records. > > Our current setup is a typical ETL infrastructure which NOBODY is > happy about. > > After reading and experimenting with Erlang and Mnesia, wouldn't it > be possible to do such ETL with Erlang and Mnesia? > > Any suggestions? > > Regards, > Ukyo. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From dizzyd@REDACTED Tue Jan 15 19:51:11 2008 From: dizzyd@REDACTED (Dave Smith) Date: Tue, 15 Jan 2008 11:51:11 -0700 Subject: [erlang-questions] gen_fsm and active sockets Message-ID: Greetings, I'm using gen_fsm to manage a socket connection, and have a question about how one SHOULD use gen_fsm for this purpose. I'm specifically using the "active" mode for the socket, so I'm currently receiving events via the handle_info/3 callback. I understand why the socket events arrive there, but I wonder what the best way to pass the event along to the actual FSM is. I see there being 3 possible options: 1. Receive socket events on a dedicated process and pass events into gen_fsm via that process. Upside is that this provides nice separation of socket and fsm logic. Downside there is that I'm doubling the number of processes -- i.e. i had one process per socket, now I have two. That's not a big problem with a couple of thousand connections, but once I'm in the 20k-30k connections realm, I'm not quite sure what the implications of doubling the number of processes is. Is it "normal" in a production system to run 100k+ processes? Note: I'm still recovering from pthreads land, where 100k+ theads is a scary, scary thing -- so maybe this concern over # of processes is a threading world "hangover" :) 2. Receive socket events in handle_info and invoke gen_fsm:send_event() from there. This seems like the "obvious" approach, but it feels wrong -- I'm already in process and don't really want to queue up another event. Again, possibly a "hangover" from non-Erlang land. 3. Receive socket events in handle_info, then do a ?MODULE:StateName({socket_event ...}, State). Avoids (perceived) overhead of approach #3, but...is this a good idea?! Hopefully this isn't a stupid/obvious question -- I'm finding that erlang has a tendency to turn "common sense" on its head (in a good way). Any guidance from the gurus would be happily accepted.. :) D. From chsu79@REDACTED Tue Jan 15 20:20:11 2008 From: chsu79@REDACTED (Christian S) Date: Tue, 15 Jan 2008 20:20:11 +0100 Subject: [erlang-questions] High volume CDR analysis In-Reply-To: References: <7A3ACF0B-BD04-4108-A0E0-7E8548B7983B@gencay.net> Message-ID: I spent some time googling these acronyms, and as far as I could figure out it is: CDR: Caller data record ETL: Extract, transform, load My guess is that Ukyo gets vendor specific report formats from some telecom equipment and need to rectify all to one format that one can use to extract reports from, for billing and homeland insecurity. I'm not sure mnesia is a good fit. But then again I dont know what kind of system Ukyo imagined. I got the feeling he would want to store a hundred million CDRs in mnesia tables, that seems to require that you know how to rewrite the mnesia backend to add a sleepycat db table-type, then not release it because you think it wasnt done right. Having a high-availability cluster where each CDR is reported as-it-happens, updating an account's usage-data, seems quite doable. But having an actual log of transactions for each account is probably important. On Jan 15, 2008 7:42 PM, Ahmed Ali wrote: > Hi Ukyo, > > Just wondering, what's ETL? > > Best regards, > Ahmed > > > On Jan 15, 2008 3:52 PM, Ukyo Virgden wrote: > > Hi, > > > > I'm working full-time on a system which involves a hundreds of > > millions of CDR records. > > > > Our current setup is a typical ETL infrastructure which NOBODY is > > happy about. > > > > After reading and experimenting with Erlang and Mnesia, wouldn't it > > be possible to do such ETL with Erlang and Mnesia? > > > > Any suggestions? > > > > Regards, > > Ukyo. > > > > _______________________________________________ > > 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 igwan@REDACTED Tue Jan 15 20:38:14 2008 From: igwan@REDACTED (igwan) Date: Tue, 15 Jan 2008 20:38:14 +0100 Subject: [erlang-questions] gen_fsm and active sockets In-Reply-To: References: Message-ID: <478D0BA6.4010805@free.fr> Hello, Dave Smith wrote : > Greetings, > > I'm using gen_fsm to manage a socket connection, and have a question > about how one SHOULD use gen_fsm for this purpose. I'm specifically > using the "active" mode for the socket [...] > Using the 'active' mode means you have no way to control the flow of data coming from the network. They will accumulate as messages in your processes' mailboxes if you can't keep up, and severely alter responsivity of the system. So be sure you can handle the full load, especially if you want to do much computation on incoming data. However, in practice it is likely you'll be more limited by the cpu time consumed by the VM just to receive packets than by the actual computation performed by your processes. (was the case in R11B-5, see http://www.nabble.com/gen_tcp-receving-slow-tt12870823.html , haven't checked with R12B yet). > 1. Receive socket events on a dedicated process and pass events into > gen_fsm via that process. Upside is that this provides nice separation > of socket and fsm logic. Downside there is that I'm doubling the > number of processes -- i.e. i had one process per socket, now I have > two. That's not a big problem with a couple of thousand connections, > but once I'm in the 20k-30k connections realm, I'm not quite sure what > the implications of doubling the number of processes is. Is it > "normal" in a production system to run 100k+ processes? Note: I'm > still recovering from pthreads land, where 100k+ theads is a scary, > scary thing -- so maybe this concern over # of processes is a > threading world "hangover" :) > It would not only double the number of process (that's a memory impact), but also the number of messages (a cpu time impact). > 2. Receive socket events in handle_info and invoke > gen_fsm:send_event() from there. This seems like the "obvious" > approach, but it feels wrong -- I'm already in process and don't > really want to queue up another event. Again, possibly a "hangover" > from non-Erlang land. > Doubling the number of message too. > 3. Receive socket events in handle_info, then do a > ?MODULE:StateName({socket_event ...}, State). Avoids (perceived) > overhead of approach #3, but...is this a good idea?! > This is how I would do (and have done for a HTTP server). It has very little overhead (just a function call) and keeps the code readable. But i'll let the gurus give you a definitive advice :) You might want to check-out this tutorial on "non blocking TCP server using OTP principles" http://www.trapexit.org/Building_a_Non-blocking_TCP_server_using_OTP_principles . The author uses option #3. regards, -- igwan From babo.online@REDACTED Tue Jan 15 20:59:52 2008 From: babo.online@REDACTED (Attila Babo) Date: Tue, 15 Jan 2008 21:59:52 +0200 Subject: [erlang-questions] funs and code loading In-Reply-To: <18315.10295.882008.456569@antilipe.corelatus.se> References: <18315.10295.882008.456569@antilipe.corelatus.se> Message-ID: <597c69660801151159p589532bco363fd4c70e0fee6e@mail.gmail.com> Let's simplify your example to mark the difference: loop() -> A = fun f/0, io:fwrite("~p ~p ~p~n", [A(), f(), ?MODULE:f()]), timer:sleep(3000), loop(). This will print "2 1 2" after changing VERSION from 1 to 2, because the A = fun f/0 binding is dynamic at the function scope in run time, while the call to f as f() at the next line is local and bound at compile time. Recursion is through our original loop function, so f() remains the same, while at each call A binds to the latest code. If we do recursion at the last line with a ?MODULE:loop() global call, then the local call of f() will bound to the actual code version and the function will print "2 2 2" after code reloading. In your original example the loop calls itself as loop(E, F, G, H), here all of these variables goes out of scope and bind again to the latest version at that time. This has the same effect as loop(fun ?MODULE:f/0, fun() -> f() end, fun f/0, fun() -> ?VERSION end). As we are calling the original module's loop function the static value of VERSION remains the same while f itself changes, so these print "2 2 2 1" after code change. It has an interesting side effect if we do recursion with a ?MODULE:loop call. Here the first function will print "2 2 2 1" after code change, as the original module's version, but after that this will switch to our latest code so the output changes to "2 2 2 2". As we can have only two versions of the same module after our second change code server purges out the original module, so this example has a limited use, but good for demonstration. I just hope that all these make sense and I'm not making ideology for a bug:-). Please correct me if I was wrong! Attila ----------- -module(reload). -export([go/0, f/0, c/0]). -export([loop/0]). -define(VERSION, 1). -vsn(version_1). go() -> spawn(fun() -> loop() end). f() -> ?VERSION. loop() -> A = fun f/0, io:fwrite("~p ~p ~p~n", [A(), f(), ?MODULE:f()]), timer:sleep(3000), loop(). c() -> code:purge(?MODULE), code:load_abs(?MODULE). From mihai@REDACTED Tue Jan 15 21:16:38 2008 From: mihai@REDACTED (Mihai Balea) Date: Tue, 15 Jan 2008 15:16:38 -0500 Subject: [erlang-questions] gen_fsm and active sockets In-Reply-To: References: Message-ID: Hi Dave, I'm not an Erlang guru, by any stretch of imagination, but here's my take. As far as I know, you can easily have a large number of processes, even in the hundreds of thousands. Each process has a minimal memory overhead, to the tune of a few hundred of bytes. For 500K processes you will need roughly 256-512MB of RAM. If your processes are mostly blocked waiting in their receive loops, the CPU consumption should be constant. This can be easily handled by any semi-decent server grade machine. Now look at it this way: I'm not sure what you are trying to do, but if you're using permanent connections, such as TCP sockets, then it's likely that you will run out of file descriptors before you run out of process capacity. So I would not be so much concerned about doubling the number of processes in a scenario like option #1. On the other hand, with option #1, you increase the number of messages moving in your system, which will up your CPU consumption (extra data copies, extra GC activity). Depending on your application and your setup, this might or might not be a problem. Anyways, that's just my $0.02. It would be great if if anybody with experience in these situations would like to comment Cheers, Mihai On Jan 15, 2008, at 1:51 PM, Dave Smith wrote: > Greetings, > > I'm using gen_fsm to manage a socket connection, and have a question > about how one SHOULD use gen_fsm for this purpose. I'm specifically > using the "active" mode for the socket, so I'm currently receiving > events via the handle_info/3 callback. I understand why the socket > events arrive there, but I wonder what the best way to pass the event > along to the actual FSM is. I see there being 3 possible options: > > 1. Receive socket events on a dedicated process and pass events into > gen_fsm via that process. Upside is that this provides nice separation > of socket and fsm logic. Downside there is that I'm doubling the > number of processes -- i.e. i had one process per socket, now I have > two. That's not a big problem with a couple of thousand connections, > but once I'm in the 20k-30k connections realm, I'm not quite sure what > the implications of doubling the number of processes is. Is it > "normal" in a production system to run 100k+ processes? Note: I'm > still recovering from pthreads land, where 100k+ theads is a scary, > scary thing -- so maybe this concern over # of processes is a > threading world "hangover" :) > > 2. Receive socket events in handle_info and invoke > gen_fsm:send_event() from there. This seems like the "obvious" > approach, but it feels wrong -- I'm already in process and don't > really want to queue up another event. Again, possibly a "hangover" > from non-Erlang land. > > 3. Receive socket events in handle_info, then do a > ?MODULE:StateName({socket_event ...}, State). Avoids (perceived) > overhead of approach #3, but...is this a good idea?! > > Hopefully this isn't a stupid/obvious question -- I'm finding that > erlang has a tendency to turn "common sense" on its head (in a good > way). Any guidance from the gurus would be happily accepted.. :) > > D. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2411 bytes Desc: not available URL: From eajam@REDACTED Tue Jan 15 20:19:31 2008 From: eajam@REDACTED (alex alvarez) Date: Tue, 15 Jan 2008 14:19:31 -0500 (EST) Subject: [erlang-questions] concurrency developments Message-ID: <20080115141931.HM.00000000000000w@eajam.bos-mail-wwl1.lycos.com> An HTML attachment was scrubbed... URL: From ahmed.nawras@REDACTED Tue Jan 15 20:51:55 2008 From: ahmed.nawras@REDACTED (Ahmed Ali) Date: Tue, 15 Jan 2008 23:51:55 +0400 Subject: [erlang-questions] question: gen_event problems with add_sup_handler() and swap_sup_handler() Message-ID: Hi, I've been trying for sometime to find a way to supervise event_handlers in gen_event behaviour with no luck. I found the following article and tried the code in it but it does not appear to be right http://www.trapexit.org/Gen_event_behavior_demystified. Can anyone please explain how add_sup_handler and swap_sup_handler work and how I could get my event_handler to get restarted in case of a crash? Best regards, Ahmed From dizzyd@REDACTED Tue Jan 15 21:46:28 2008 From: dizzyd@REDACTED (Dave Smith) Date: Tue, 15 Jan 2008 13:46:28 -0700 Subject: [erlang-questions] gen_fsm and active sockets In-Reply-To: <478D0BA6.4010805@free.fr> References: <478D0BA6.4010805@free.fr> Message-ID: On Jan 15, 2008 12:38 PM, igwan wrote: > Hello, > > Dave Smith wrote : > Using the 'active' mode means you have no way to control the flow of > data coming from the network. They will accumulate as messages in your > processes' mailboxes if you can't keep up, and severely alter > responsivity of the system. So be sure you can handle the full load, > especially if you want to do much computation on incoming data. However, > in practice it is likely you'll be more limited by the cpu time consumed > by the VM just to receive packets than by the actual computation > performed by your processes. (was the case in R11B-5, see > http://www.nabble.com/gen_tcp-receving-slow-tt12870823.html , haven't > checked with R12B yet). I understand your point -- however, my overall question remains even using {active, once} with the socket. > It would not only double the number of process (that's a memory impact), > but also the number of messages (a cpu time impact). Agreed -- processes and # of messages both grow with approach 1. However, processes and messages are a primary paradigm in Erlang; it would be remiss of me to not consider using them to solve this problem, I think. > > 3. Receive socket events in handle_info, then do a > > ?MODULE:StateName({socket_event ...}, State). Avoids (perceived) > > overhead of approach #3, but...is this a good idea?! > > > This is how I would do (and have done for a HTTP server). It has very > little overhead (just a function call) and keeps the code readable. But > i'll let the gurus give you a definitive advice :) Actually I believe it's more expensive than just a straight function call -- it boils down to a call to "apply" unless I'm mistaken. Not sure how the overhead of invoking apply compares to message passing... Thanks, igwan. D. From Martin.Logan@REDACTED Tue Jan 15 21:24:50 2008 From: Martin.Logan@REDACTED (Logan, Martin) Date: Tue, 15 Jan 2008 14:24:50 -0600 Subject: [erlang-questions] Statically link Beam/Erlexec Message-ID: Anyone know how to get this done? I have searched the configure script and make files and not found a thing. I want an erts package that I can pass to various linux variants and not have to worry about one running glib_c version 2.3 and the other version 2.6 etc... Any tips would be a nice help. Cheers, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From igwan@REDACTED Tue Jan 15 22:27:02 2008 From: igwan@REDACTED (igwan) Date: Tue, 15 Jan 2008 22:27:02 +0100 Subject: [erlang-questions] gen_fsm and active sockets In-Reply-To: References: <478D0BA6.4010805@free.fr> Message-ID: <478D2526.7080509@free.fr> Dave Smith wrote : [...] > Agreed -- processes and # of messages both grow with approach 1. > However, processes and messages are a primary paradigm in Erlang; it > would be remiss of me to not consider using them to solve this > problem, I think. > Well it depends on what additional problem you want to solve when dispatching messages through one process, while you could receive them directly on the processes that needs the data. It's right that processes are cheap in Erlang but "Don't buy too many spades" says the manual. Gen_fsm are also meant to receive plain messages, not only events. It just seems natural to have each one fsm fully handle its own socket. [...] > Actually I believe it's more expensive than just a straight function > call -- it boils down to a call to "apply" unless I'm mistaken. Not > sure how the overhead of invoking apply compares to message passing... > Receiving an event in a gen_fsm is for sure much more slower than a direct "apply". The OTP behaviour does a bunch of things ... before it eventually does an "apply" in your callback module. :) -- igwan From ulf@REDACTED Tue Jan 15 22:33:05 2008 From: ulf@REDACTED (Ulf Wiger) Date: Tue, 15 Jan 2008 22:33:05 +0100 Subject: [erlang-questions] question: gen_event problems with add_sup_handler() and swap_sup_handler() In-Reply-To: References: Message-ID: <8209f740801151333p79eb1ddh120933d3452c542e@mail.gmail.com> That tutorial pretty much explains it, I think, but perhaps it's a bit terse on some points. The whole point is that when the handler crashes, the gen_event process sends a message to the process that called add_sup_handler() in the first place. The supervising process /could/ simply reinstall the handler, but it would then have to be aware of recurring crashes. Since there is already a library that does so, it's better to simply let the supervising process die - it is supervised in its turn, and its supervisor will restart it. When this happens, the handler will be reinstalled. BR, Ulf W 2008/1/15, Ahmed Ali : > Hi, > > I've been trying for sometime to find a way to supervise > event_handlers in gen_event behaviour with no luck. I found the > following article and tried the code in it but it does not appear to > be right http://www.trapexit.org/Gen_event_behavior_demystified. > > Can anyone please explain how add_sup_handler and swap_sup_handler > work and how I could get my event_handler to get restarted in case of > a crash? > > Best regards, > Ahmed > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From fess-erlang@REDACTED Tue Jan 15 23:01:21 2008 From: fess-erlang@REDACTED (fess) Date: Tue, 15 Jan 2008 14:01:21 -0800 Subject: [erlang-questions] What level of bundling is correct for sharing code? Message-ID: <73534CA0-0FFC-4435-94EE-BC0B754F798E@fess.org> Hi, I did end up writing my own Port for rrdtool, and I put it up on google code. http://code.google.com/p/erlrrd/ [comments welcome, http://erlrrd.googlecode.com/svn/trunk/erlrrd/src/erlrrd.erl ] since I'm new to erlang, it has been a good exercise. At the moment it's just a gen_server call back module in a single file, It talks to a single rrdtool unix process. I'm wondering what the right level of bundling should be to share this with the world, Should it be an Application? or a Library Application? or just the single gen_server file that it is? I feel like an Application that actually starts and stops may be presuming too much about how someone wants to use it, they may want to startup several of these Ports and partition the information being sent to them, and in that case they would probably be rolling their own application together, in which case they may want to start the gen_server with their own supervisers etc. I'm curious as to what is more the "erlang way". thanks. --fess From dae@REDACTED Tue Jan 15 22:14:04 2008 From: dae@REDACTED (Doug Edmunds) Date: Tue, 15 Jan 2008 13:14:04 -0800 Subject: [erlang-questions] Case insensitivity - Windows trap or bug? Message-ID: <478D221C.8020206@douglasedmunds.com> The Erlang compiler assumes that filenames are case sensitive. It does not check the existence of a file based on a case-sensitive spelling. But Windows filenames are not case sensitive. This can lead to unexpected results. (I don't have a *nix system to check this on. I assume this is a Windows-only problem.) ------ Assume this scenario: (note the spelling, a capital T in both file name and module). a file named: myTest.erl containing a module: -module(myTest). > compile:file(myTest). produces myTest.beam So far so good. ------ An inadvertent typo can cause unexpected results which are not flagged by the compiler (in Windows): 1. > compile:file(mytest). %% case insensitive input accepted. {ok,myTest} %% note difference between input and output What is the filename just created? 'mytest.beam', not 'myTest.beam' Any errors or warnings? No. ---- 2. Having done step 1, things can become very strange: Remember, the name of the beam file is mytest.beam. There is no myTest.beam. > code:file_load(myTest). {module,myTest} %% loads 3. But this doesn't work: >code:file_load(mytest). =ERROR REPORT==== 15-Jan-2008::09:56:50 === beam/beam_load.c(1035): Error loading module mytest: module name in object code is myTest =ERROR REPORT==== 15-Jan-2008::09:56:50 === Loading of c:/erl_dae2/compile sensitivity bugs/mytest.beam failed: badfile {error,badfile} --------- Running erlc from a DOS shell, has the same problems. erlc ignores case, and compiles a beam file that does not match the internal module name. erlc mytest.erl %% erlc accepts this filename in Windows produces mytest.beam from myTest.erl without any warning. The mytest.beam will have the same usage issues as indicated above (it will contain a module name 'myTest' and will not load. ------------------- I think of these as bugs. Other Erlang functions can capture/retain filename case sensitivity in Windows. (c:ls/0, for example reports myTest.erl). You won't change Windows. The Erlang compiler functions need to test for file existence based on case-sensitivity. Doug Edmunds From ggaliens@REDACTED Tue Jan 15 22:22:40 2008 From: ggaliens@REDACTED (ggaliens@REDACTED) Date: Tue, 15 Jan 2008 16:22:40 -0500 Subject: [erlang-questions] Erlang support for read/extract ZIP/TAR ?? Message-ID: Erlang support for read/extract ZIP/TAR ?? I want to write an installer of sorts in Erlang ... Is there any support for reading and extracting any common archive format which would run on Win32/Linux/OS X ???? I want to unzip a directory tree and move a few parts from this tree into a local tree. Any particular modules I should be looking at ??? From opendev@REDACTED Wed Jan 16 00:04:33 2008 From: opendev@REDACTED (Joern) Date: Wed, 16 Jan 2008 00:04:33 +0100 Subject: [erlang-questions] What level of bundling is correct for sharing code? In-Reply-To: <73534CA0-0FFC-4435-94EE-BC0B754F798E@fess.org> References: <73534CA0-0FFC-4435-94EE-BC0B754F798E@fess.org> Message-ID: <9e009ad0801151504n2ecb4f1asf0d3b730b3642c31@mail.gmail.com> Hi, On Jan 15, 2008 11:01 PM, fess wrote: > Should it be an Application? or a Library Application? or just the > single gen_server file that it is? There is no real difference between an application and what you call a library application. Without having taken a closer look at your code you should probably bundle it as an application, make the behaviour configurable enough and factor the functionality of it out into an api module. This way it should be very easy to integrate it. Only changes you need to make is to pick a prefix, add this to your files and name your application accordingly. And add an .app file if you feel like it or your application has dependencies. rgs/joern -- From travis.jensen@REDACTED Wed Jan 16 01:25:48 2008 From: travis.jensen@REDACTED (Travis Jensen) Date: Tue, 15 Jan 2008 17:25:48 -0700 Subject: [erlang-questions] concurrency developments In-Reply-To: <20080115141931.HM.00000000000000w@eajam.bos-mail-wwl1.lycos.com> References: <20080115141931.HM.00000000000000w@eajam.bos-mail-wwl1.lycos.com> Message-ID: <6E1D2060-65A8-4476-9927-C13FDCE313E5@gmail.com> The answer to that seems to be "start more JVMs" on the Java side and then force the concurrency "issues" into the database. It is going to be difficult to "rebuild" the JVM (and the CLR) in a concurrent fashion because of the depth of penetration they have: the inertia alone will keep it from moving. Too many companies have too much code invested, and Sun and Microsoft have both shown that backwards compatibility is paramount, regardless of future pain caused. The flipside of that coin is something like Python, which has the agility and potentially the community, but has far too many use cases in the non-concurrent realm (basic scripting) to want to make that change. I don't think Ruby has the community to make the change. Scala has some interesting aspects, but because it is tied to the anchor of a JVM, they'll be hard pressed to really make it work (all in my opinion, of course :). Groovy Actors just seems like a very immature Stackless Python, which, while a reasonable model, is limited significantly by its underlying technology. tj On Jan 15, 2008, at 12:19 PM, alex alvarez wrote: > I myself believe that their biggest hurdle is JVM's ability or > inability to scale. Not only internally, but also in terms of > system resources. Given that I work daily with huge frameworks, > like Java and .NET, I'm wondering how their respective companies > intend to move to fully utilization of multi-processor (multi-core) > systems. It's very different when you have a (relatively) lite > system like Erlang, which in itself was built for this work, compare > to systems that huge. Having said that these companies have enough > resources and interest to turn things around. > > > > > > ---------[ Received Mail Content ]---------- > > Subject : Re: [erlang-questions] concurrency developments > > Date : Tue, 15 Jan 2008 14:47:44 +0300 > > From : "Kirill Zaborski" > > To : "Hynek Vychodil" > > Cc : erlang-questions@REDACTED > > > > So you say that performance doesn't matter? > > Somewhat strange statement from engineer. > > > > P.S. In some circumstances it can be negligible and I don't deny other > > benefits from immutalbe variables. Just point to not very rare > issues with > > Java GC which could be solved in GC assuming immutable variables > (which make > > it simpler as far as I understand). > > > > Regards, > > Kirill. > > > > On Jan 15, 2008 2:37 PM, Hy! nek Vychodil wrote: > > > > > It isn't matter of performance, it is about security, reliability > and > > > bug hunting. > > > > > > On 1/15/08, Kirill Zaborski wrote: > > > > And also normally better GC performance coming from immutable > variables? > > > Not > > > > requiring intricate GC options. > > > > > > > > > > > > On Jan 15, 2008 1:27 PM, Hynek Vychodil < > vychodil.hynek@REDACTED> > > > wrote: > > > > > > > > > > ... and where is immutable variables, where is side effect free > > > > > functional programming? Where is funny declarative (easy > readable) > > > > > syntax? > > > > > > > > > > Groovy is death way. > > > > > > > > > > > > > > > > > > > > > > > > > On 1/15/08, Christian S wrot! e: > > > > > > Where are process links? Where are super vision tree infra- > structure? > > > > > > Where is remote-node messaging transparency? > > > > > > > > > > > > > http://www.groovyactors.org/ > > > > > > _______________________________________________ > > > > > > erlang-questions mailing list > > > > > > erlang-questions@REDACTED > > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > -- > > > > > --Hynek (Pichi) Vychodil > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > erlang-questions mailing list > > > > > erlang-questions@REDACTED > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > ! > > > > > -- > > > --Hynek (Pichi) Vychodil > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From david_holz@REDACTED Tue Jan 15 01:01:13 2008 From: david_holz@REDACTED (David Holz) Date: Tue, 15 Jan 2008 00:01:13 +0000 Subject: [erlang-questions] Dynamic pattern matching Message-ID: I was pondering and jotting down some thoughts about dissecting the advantages out of OO-style method dispatch based on data type, and stumbled upon an interesting observation: If the system allowed adding clauses to pattern matching operations at runtime, we'd have Lisp multimethods: -module(bar). [generic function tweak/2]. -module(foo). [add clause]bar:tweak({add,{foo_data,X}}, Data) -> ... -module(baz). [add clause]bar:tweak({add,{baz_data,X}}, Data) -> ... This would need to have some method of handling pattern precedence instead of relying on ordering as currently done, and what happens during code reload would need to be thought through (probably track and remove a module's previously added clauses when a change happens, then re-add the new ones). This also could apply just as well to receive handlers (yay, inherit/extend messaging functionality! (maybe!)) and any other pattern matching places. Also, I don't know of any function that gets called when a module is loaded, but doing multimethod clauses additions could really use those so they could be called either at module load/change time or at any point during runtime. I also rediscovered the idea of -extend(Mod). as I see has already been presented at EUC'07 after googling it, but with a sort of "handle in ?BASE_MODULE" shortcut instead of having to write a final tweak(A,B,C,D,E) -> BASE:tweak(A,B,C,D,E). clause when you only want to extend and not replace a function. Just something to spark new ideas as Erlang moves forward. _________________________________________________________________ Get the power of Windows + Web with the new Windows Live. http://www.windowslive.com?ocid=TXT_TAGHM_Wave2_powerofwindows_012008 From bjt@REDACTED Tue Jan 15 23:05:22 2008 From: bjt@REDACTED (Benjamin Tolputt) Date: Wed, 16 Jan 2008 09:05:22 +1100 Subject: [erlang-questions] question: macro definition In-Reply-To: <3dbc6d1c0801150724v36796f2an8778e2a3f5e6281e@mail.gmail.com> References: <3dbc6d1c0801150724v36796f2an8778e2a3f5e6281e@mail.gmail.com> Message-ID: <478D2E22.9080703@pmp.com.au> Robert Virding wrote: > On 15/01/2008, *Ahmed Ali* > wrote: > > > Does (redefining) mean I cannot define a macro with the same name > even though they have different arity? > > > That is exactly what it means. It was a mistake to do it that way. But > it could be corrected now if people really want it. I would be interested in a quick pros & cons of this. As I understand it C/C++ has the same "uniquely named" macro functionality. As I see it, having macros with arity (i.e. LOG/1 and LOG/2) would be the Erlang equivalent of declaring a function as "inline". What advantages would this have given I technically could have the equivalent of LOG1 & LOG2 macros? Nto arguing one way or the other, but Robert mentioned it as a mistake and I'm curious as to the reasons for and against such a "mistake". Regards, B.J.Tolputt From cyberlync@REDACTED Wed Jan 16 01:55:25 2008 From: cyberlync@REDACTED (Eric Merritt) Date: Tue, 15 Jan 2008 16:55:25 -0800 Subject: [erlang-questions] Erlang support for read/extract ZIP/TAR ?? In-Reply-To: References: Message-ID: We use this heavily in our erlware projects. Both faxien and sinan have to do quite a bit of taring and untaring. You can see examples in sinans dist task. The actually module we use is the erl_tar module included in the distribution and documented here -> http://www.erlang.org/doc/man/erl_tar.html. You can check our code for examples if you need them, though the docs are good. On Jan 15, 2008 1:22 PM, wrote: > Erlang support for read/extract ZIP/TAR ?? > > I want to write an installer of sorts in Erlang ... > > Is there any support for reading and extracting any common archive > format which would run on Win32/Linux/OS X ???? > > I want to unzip a directory tree and move a few parts from this tree > into a local tree. > > Any particular modules I should be looking at ??? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From eajam@REDACTED Wed Jan 16 02:19:53 2008 From: eajam@REDACTED (alex alvarez) Date: Tue, 15 Jan 2008 20:19:53 -0500 (EST) Subject: [erlang-questions] concurrency developments Message-ID: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> An HTML attachment was scrubbed... URL: From david_holz@REDACTED Wed Jan 16 04:56:10 2008 From: david_holz@REDACTED (David Holz) Date: Wed, 16 Jan 2008 03:56:10 +0000 Subject: [erlang-questions] Erlang support for read/extract ZIP/TAR ?? In-Reply-To: References: Message-ID: There's also a zip module in stdlib: http://www.erlang.org/doc/man/zip.html From: cyberlync@REDACTED > We use this heavily in our erlware projects. Both faxien and sinan > have to do quite a bit of taring and untaring. You can see examples in > sinans dist task. The actually module we use is the erl_tar module > included in the distribution and documented here -> > http://www.erlang.org/doc/man/erl_tar.html. You can check our code for > examples if you need them, though the docs are good. > > On Jan 15, 2008 1:22 PM, wrote: >> Erlang support for read/extract ZIP/TAR ?? >> >> I want to write an installer of sorts in Erlang ... >> >> Is there any support for reading and extracting any common archive >> format which would run on Win32/Linux/OS X ???? >> >> I want to unzip a directory tree and move a few parts from this tree >> into a local tree. >> >> Any particular modules I should be looking at ??? _________________________________________________________________ Put your friends on the big screen with Windows Vista? + Windows Live?. http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_012008 From bob@REDACTED Wed Jan 16 08:30:00 2008 From: bob@REDACTED (Bob Ippolito) Date: Tue, 15 Jan 2008 23:30:00 -0800 Subject: [erlang-questions] concurrency developments In-Reply-To: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> Message-ID: <6a36e7290801152330i6667aad0g31ec0eace8dcfe75@mail.gmail.com> 2008/1/15 alex alvarez : > > Well, in the case of CLR, MS is lately putting out so many frameworks and > new stuff that I cannot count them out in this respect. There's no reason > why they could not refurbish the CLR w/ the necessary code and put out a new > framework just to access the new functionality without braking backwards > compatibility. The Sun folks in many respects are a little bit on the > catch up lately with regards to features that first appeared in .NET, but at > the end of all weren't inherently new (ie. generics). > > Now w/ regards to Erlang, which is meant for this type of massive concurrent > work, my feeling is that the biggest problem/hurdle is not the back-end, but > getting into the syntax and (more importantly) to mentally switch to a > totally different format for paradigms. Dr. Joe's book is d! efinitely a > great help, but at least for me is coming slow but steady. Maybe I'm > completely wrong on this, but my feeling is also that Ericsson as a whole is > not that into moving Erlang forward either. You obviously haven't been paying attention. In recent years we've had dialyzer, HiPE, SMP support, bitstr, binary performance enhancements, etc. Obviously nobody is interested in significantly changing the syntax, because frankly that's rather silly, but as far as open source projects go having a release of a language platform every few months is quite forward-moving. The open source ecosystem around Erlang also has changed a lot recently too. -bob From bcully@REDACTED Tue Jan 15 20:15:45 2008 From: bcully@REDACTED (Brian Cully) Date: Tue, 15 Jan 2008 14:15:45 -0500 Subject: [erlang-questions] High volume CDR analysis In-Reply-To: References: <7A3ACF0B-BD04-4108-A0E0-7E8548B7983B@gencay.net> Message-ID: <533E1F1E-71D7-46AE-9F7C-74AAC3348FF5@gmail.com> Extract-Transform-Load It's a common beakdown for high-volume crunching. With the right process breakdown and enough nodes, Erlang and Mnesia should be excellent at high-volume parallel ETL loads. -bjc On 15-Jan-2008, at 13:42, Ahmed Ali wrote: > Hi Ukyo, > > Just wondering, what's ETL? > > Best regards, > Ahmed > > On Jan 15, 2008 3:52 PM, Ukyo Virgden wrote: >> Hi, >> >> I'm working full-time on a system which involves a hundreds of >> millions of CDR records. >> >> Our current setup is a typical ETL infrastructure which NOBODY is >> happy about. >> >> After reading and experimenting with Erlang and Mnesia, wouldn't it >> be possible to do such ETL with Erlang and Mnesia? >> >> Any suggestions? >> >> Regards, >> Ukyo. >> >> _______________________________________________ >> 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 ahmed.nawras@REDACTED Wed Jan 16 09:17:25 2008 From: ahmed.nawras@REDACTED (Ahmed Ali) Date: Wed, 16 Jan 2008 12:17:25 +0400 Subject: [erlang-questions] question: gen_event problems with add_sup_handler() and swap_sup_handler() In-Reply-To: <8209f740801151333p79eb1ddh120933d3452c542e@mail.gmail.com> References: <8209f740801151333p79eb1ddh120933d3452c542e@mail.gmail.com> Message-ID: Hi Ulf, I had this understanding when read the article, but that was not clear at all. If you look at the code in the article, you'll see that gen_event:swap_sup_handler() was called in the my_alarm_handler module not from the guard process. That was confusing for me at least. I'll test it now. Best regards, Ahmed On Jan 16, 2008 1:33 AM, Ulf Wiger wrote: > That tutorial pretty much explains it, I think, but perhaps > it's a bit terse on some points. > > The whole point is that when the handler crashes, > the gen_event process sends a message to the > process that called add_sup_handler() in the first > place. The supervising process /could/ simply > reinstall the handler, but it would then have to > be aware of recurring crashes. Since there is already > a library that does so, it's better to simply let the > supervising process die - it is supervised in its turn, > and its supervisor will restart it. When this happens, > the handler will be reinstalled. > > BR, > Ulf W > > 2008/1/15, Ahmed Ali : > > > Hi, > > > > I've been trying for sometime to find a way to supervise > > event_handlers in gen_event behaviour with no luck. I found the > > following article and tried the code in it but it does not appear to > > be right http://www.trapexit.org/Gen_event_behavior_demystified. > > > > Can anyone please explain how add_sup_handler and swap_sup_handler > > work and how I could get my event_handler to get restarted in case of > > a crash? > > > > Best regards, > > Ahmed > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > From yu_c@REDACTED Wed Jan 16 09:28:59 2008 From: yu_c@REDACTED (Chih - Wei Yu [ MTN - Innovation Centre ]) Date: Wed, 16 Jan 2008 10:28:59 +0200 Subject: [erlang-questions] [erlang-bugs] R12B-0 Compiler issues In-Reply-To: Message-ID: Hi Bjorn, Thank you for your response, I'll try the patch and see I can recompile the modules. Regards, Chih-Wei Yu -----Original Message----- From: erlang-bugs-bounces@REDACTED [mailto:erlang-bugs-bounces@REDACTED] On Behalf Of Bjorn Gustavsson Sent: Tuesday, January 15, 2008 5:25 PM To: erlang-bugs@REDACTED; erlang-questions@REDACTED Subject: Re: [erlang-bugs] R12B-0 Compiler issues "Chih - Wei Yu [ MTN - Innovation Centre ]" writes: > I've provided the code that is reporting the error when compiling. I did > see other 'similar' issues raised but would like to raise it again. > [Code] > > encode_octet_string( <>, Len ) -> > <>; % The compiler reports an error for > this line of code > > encode_octet_string( [H|T], Len ) > > -> > > B = list_to_binary( [H|T] ), > > << B:Len/binary-unit:8>> > % However, for this line of code it does not report an error. > > ; > > encode_octet_string( _ANY, _ ) -> <<>>. > Thanks for the new test case. Bjorn's law - "If it isn't tested, it doesn't work" - has again been proved. :-) Your other code example is not complete, so I haven't verified, but it seems to be the same bug that I have already fixed. The attached patch should fix all found bugs in beam_bsm.erl. It should be applied to the unchanged beam_bsm.erl in R12B-0. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 From eajam@REDACTED Wed Jan 16 09:43:12 2008 From: eajam@REDACTED (alex alvarez) Date: Wed, 16 Jan 2008 03:43:12 -0500 (EST) Subject: [erlang-questions] concurrency developments Message-ID: <20080116034312.HM.000000000000024@eajam.bos-mail-wwl1.lycos.com> An HTML attachment was scrubbed... URL: From eajam@REDACTED Wed Jan 16 10:13:35 2008 From: eajam@REDACTED (alex alvarez) Date: Wed, 16 Jan 2008 04:13:35 -0500 (EST) Subject: [erlang-questions] [RE] Case insensitivity - Windows trap or bug? Message-ID: <20080116041335.HM.000000000000027@eajam.bos-mail-wwl1.lycos.com> An HTML attachment was scrubbed... URL: From rrerlang@REDACTED Wed Jan 16 10:57:29 2008 From: rrerlang@REDACTED (Robert Raschke) Date: Wed, 16 Jan 2008 09:57:29 +0000 Subject: [erlang-questions] High volume CDR analysis In-Reply-To: Message-ID: I'm not sure if Erlang is a good fit for CDR analysis. It depends on what you're trying to achieve. For accepting CDR records and storing them, I wouldn't think mnesia would be that good a fit, due to the sheer volume. But if you were to design a more suitable data structure for CDR record storage, then that might be really quite interesting. You may not need random access and complex queries, maybe something that only allows sequential access (maybe with the ability to filter) and is designed for quick roll-ups would be more suitable. Column based table representations come to mind. If you want to actually analyse (i.e., summarise in some way) in real time, without storing the raw incoming records in between, then Erlang could be a good platform. But even then, you would probably want to investigate in your own data structures for the summary tables, since the incoming data rate would probably mean way too many transactions on your summary data to be really comfortable for mnesia. As far as I know, stuff like this is the forte of systems like K, J and APL. These usually come with nice examples about how they can process enormous amounts of stock market ticker information in real time. That would be closer to the kind of data you get from CDR, I would guess Robby PS. By "real time" in the above, I just mean that roll up of data is done as it appears, not in a btach way later on; it has nothing to do with real time programming. From Dmitri.Girenko@REDACTED Wed Jan 16 10:30:38 2008 From: Dmitri.Girenko@REDACTED (Dmitri Girenko) Date: Wed, 16 Jan 2008 11:30:38 +0200 Subject: [erlang-questions] concurrency developments In-Reply-To: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> Message-ID: <697074A35ED91748882E3850BDCE295EE08FB6@leenu.akumiitti.net> The only problem with a new paradigm usually is that the old one is so familiar and well-known :-) I have been writing java code for ages, so I have something to compare against. Having no exposure to non-C family languages, learning erlang syntax and programming paradigms may seem like trying ot understand Escher drawings - you have to break something in your head to understand it. But once you do, you get great payoffs. The terrible erlang code that I write is about 3-7 times more compact than similar java code I would've written for the same purpose. In fact after I started programming in erlang; my java code became a lot more compact and understandable than it used to be. Speaking about JVM and CLR, there are great developments going in those camps, but those will deliver only after the NEW code will be written. Lots of attention is being paid to the parallelism and concurrency, but the old code performance will not improve automagically. On the contrary, most of the existing erlang code will get performance benefits with more cores. And the key to this is the fact that the fundamental building blocks in erlang are processes, not objects. In some sense one may say that the erlang VM has higher level of abstraction than JVM or CLR. By the way, that brings another interesting question. As far as I understand, good manycore scalability is a side-effect of the VM design. Thus IMHO it is just a coincidence that erlang runtime gets advantage with the new processors. Was this expected back in 1980s? What other jewels may be hidden there? :-) BR Dmitri ________________________________ From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of alex alvarez Sent: 16. tammikuuta 2008 3:20 To: erlang-questions@REDACTED Subject: Re: [erlang-questions] concurrency developments Well, in the case of CLR, MS is lately putting out so many frameworks and new stuff that I cannot count them out in this respect. There's no reason why they could not refurbish the CLR w/ the necessary code and put out a new framework just to access the new functionality without braking backwards compatibility. The Sun folks in many respects are a little bit on the catch up lately with regards to features that first appeared in .NET, but at the end of all weren't inherently new (ie. generics). Now w/ regards to Erlang, which is meant for this type of massive concurrent work, my feeling is that the biggest problem/hurdle is not the back-end, but getting into the syntax and (more importantly) to mentally switch to a totally different format for paradigms. Dr. Joe's book is d! efinitely a great help, but at least for me is coming slow but steady. Maybe I'm completely wrong on this, but my feeling is also that Ericsson as a whole is not that into moving Erlang forward either. BTW, sorry for talking about things that seem outside the Erlang realm, but the truth is that it does not stand alone in a vacuum and hence everything is related nowadays. -Alex ---------[ Received Mail Content ]---------- Subject : Re: [erlang-questions] concurrency developments Date : Tue, 15 Jan 2008 17:25:48 -0700 >From : Travis Jensen To : Erlang Questions The answer to that seems to be "start more JVMs" on the Java side and then force the concurrency "issues" into the database. ! It is going to be difficult to "rebuild" the JVM (and the CLR ) in a concurrent fashion because of the depth of penetration they have: the inertia alone will keep it from moving. Too many companies have too much code invested, and Sun and Microsoft have both shown that backwards compatibility is paramount, regardless of future pain caused. The flipside of that coin is something like Python, which has the agility and potentially the community, but has far too many use cases in the non-concurrent realm (basic scripting) to want to make that change. I don't think Ruby has the community to make the change. Scala has some interesting aspects, but because it is tied to the anchor of a JVM, they'll be hard pressed to really make it work (all in my opinion, of course :). Groovy Actors just seems like a very immature Stackless Python, which, while a reasonable model, is limited significantly by its underlying ! technology. tj On Jan 15, 2008, at 12:19 PM, alex alvarez wrote: > I myself believe that their biggest hurdle is JVM's ability or > inability to scale. Not only internally, but also in terms of > system resources. Given that I work daily with huge frameworks, > like Java and .NET, I'm wondering how their respective companies > intend to move to fully utilization of multi-processor (multi-core) > systems. It's very different when you have a (relatively) lite > system like Erlang, which in itself was built for this work, compare > to systems that huge. Having said that these companies have enough > resources and interest to turn things around. > > > > > > ---------[ Received Mail Content ]---------- > > Subject : Re: [erlang-questions] concurrency ! developments > > Date : Tue, 15 Jan 2008 14:47:44 +0300 > > From : "Kirill Zaborski" > > To : "Hynek Vychodil" > > Cc : erlang-questions@REDACTED > > > > So you say that performance doesn't matter? > > Somewhat strange statement from engineer. > > > > P.S. In some circumstances it can be negligible and I don't deny other > > benefits from immutalbe variables. Just point to not very rare > issues with > > Java GC which could be solved in GC assuming immutable variables > (which make > > it simpler as far as I understand). > > > > Regards, > > Kirill. > > > > On Jan 15, 2008 2:37 PM, Hy! nek Vychodil wrote: > > >! ; > > It isn't matter of performance, it is about security, reliability > and > > > bug hunting. > > > > > > On 1/15/08, Kirill Zaborski wrote: > > > > And also normally better GC performance coming from immutable > variables? > > > Not > > > > requiring intricate GC options. > > > > > > > > > > > > On Jan 15, 2008 1:27 PM, Hynek Vychodil < > vychodil.hynek@REDACTED> > > > wrote: > > > > > > > > > > ... and where is immutable variables, where is side effect free > > > > > functional programming? Where is funny declarative (easy > readable) > > > > > syn! tax? > > > > > > > &g t; > > Groovy is death way. > > > > > > > > > > > > > > > > > > > > > > > > > On 1/15/08, Christian S wrot! e: > > > > > > Where are process links? Where are super vision tree infra- > structure? > > > > > > Where is remote-node messaging transparency? > > > > > > > > > > > > > http://www.groovyactors.org/ > > > > > > _______________________________________________ > > > > > > erlang-questions mailing list > > > > > > erlang-questions@REDACTED > > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > -- > > > > > --Hynek (Pichi) Vychodil > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > erlang-questions mailing list > > > > > erlang-questions@REDACTED > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > ! > > > > > -- > > > --Hynek (Pichi) Vychodil > > > > > _______________________________________________ > erlang-qu! estions mailing list > erlang-questions@REDACTED &g t; http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From bobcalco@REDACTED Wed Jan 16 12:40:26 2008 From: bobcalco@REDACTED (Bob Calco) Date: Wed, 16 Jan 2008 06:40:26 -0500 Subject: [erlang-questions] concurrency developments In-Reply-To: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> Message-ID: <02c301c85834$96e605e0$c4b211a0$@rr.com> With respect to the CLR I note that they have some hard-core Haskellites driving the compiler development, not the least of which being Erik Meijer, who is on a mission to ?democratize the cloud? with VB support for functional programming concepts ? i.e., make middle tier development easy for Everyman. Developments like the CCR (Concurrency and Coordination Runtime), part of MS Robitics Studio, with its Port and PortSet abstractions, are additional major efforts to bring message-passing concurrency to .NET. Also, don?t count the Rubyists out. Matz is building a VM for Ruby as of 2.0, and as I understand it much of the renewed interest in Erlang comes from folks disappointed at RoR?s scaling issues. At least, that?s partly how I rediscovered it. I first heard about Erlang reading the following book about Oz: http://www.amazon.com/Concepts-Techniques-Models-Computer-Programming/dp/0262220695/ There is a whole section of a chapter on concurrency dedicated to comparing Erlang and Oz?one of few languages to get such extensive comparative treatment. I have long been an admirer of Oz, with its ambitious multi-paradigm agenda, and have been convinced for many years that it portends an era in which nanny runtimes embrace more than one computational model. But using it in real programs is hard for lack of library maturity and community support. I think the syntax is simply too foreign for most folks, which is sad. It has a tool called Gump so that you can design your own front end language to it, but I never had time to get into it. Ultimately, such a swiss army knife of a language (complete with the sidewinder missile option and a kitchen sink) is perhaps ?too? versatile. It begs the question about the right way to do something, even as it facilitates every right way to do something. Erlang is far simpler a language, proven in industry, with a runtime platform that is an architect?s wet dream in terms of satisfying rigorous scalability, availability and robustness requirements, given its very focused design goals. I have recently decided to experiment writing a Ruby-like front end to Erlang, code named Emerld, which would generate Erlang code that would then be compiled (at least until I can learn the BEAM file format well enough to generate it directly). It could theoretically be retargeted to .NET or Java when either of the two got their act together for concurrency. That seems to me more a matter of when than if. Until then though I have committed myself to mastering Erlang, because I think it will give me a huge competitive edge in the new multi-core world we live in as a software designer and architect. Another line of thinking I?m pursuing is ?What would be the killer app for Erlang?? in terms of getting wide-spread IT acceptance. Where I currently work, which is a large retail chain in the southeast, I think an ESB solution with built-in health & performance monitoring would be compelling. Also, code generation tools, i.e., software factories, to make rapid development of distributed supply chain systems much simpler, could also hit a sweet spot. If only there was more time in a day! - Bob Calco From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of alex alvarez Sent: Tuesday, January 15, 2008 8:20 PM To: erlang-questions@REDACTED Subject: Re: [erlang-questions] concurrency developments Well, in the case of CLR, MS is lately putting out so many frameworks and new stuff that I cannot count them out in this respect. There's no reason why they could not refurbish the CLR w/ the necessary code and put out a new framework just to access the new functionality without braking backwards compatibility. The Sun folks in many respects are a little bit on the catch up lately with regards to features that first appeared in .NET, but at the end of all weren't inherently new (ie. generics). Now w/ regards to Erlang, which is meant for this type of massive concurrent work, my feeling is that the biggest problem/hurdle is not the back-end, but getting into the syntax and (more importantly) to mentally switch to a totally different format for paradigms. Dr. Joe's book is d! efinitely a great help, but at least for me is coming slow but steady. Maybe I'm completely wrong on this, but my feeling is also that Ericsson as a whole is not that into moving Erlang forward either. BTW, sorry for talking about things that seem outside the Erlang realm, but the truth is that it does not stand alone in a vacuum and hence everything is related nowadays. -Alex ---------[ Received Mail Content ]---------- Subject : Re: [erlang-questions] concurrency developments Date : Tue, 15 Jan 2008 17:25:48 -0700 >From : Travis Jensen To : Erlang Questions The answer to that seems to be "start more JVMs" on the Java side and then force the concurrency "issues" into the database. ! It is going to be difficult to "rebuild" the JVM (and the CLR ) in a concurrent fashion because of the depth of penetration they have: the inertia alone will keep it from moving. Too many companies have too much code invested, and Sun and Microsoft have both shown that backwards compatibility is paramount, regardless of future pain caused. The flipside of that coin is something like Python, which has the agility and potentially the community, but has far too many use cases in the non-concurrent realm (basic scripting) to want to make that change. I don't think Ruby has the community to make the change. Scala has some interesting aspects, but because it is tied to the anchor of a JVM, they'll be hard pressed to really make it work (all in my opinion, of course :). Groovy Actors just seems like a very immature Stackless Python, which, while a reasonable model, is limited significantly by its underlying ! technology. tj On Jan 15, 2008, at 12:19 PM, alex alvarez wrote: > I myself believe that their biggest hurdle is JVM's ability or > inability to scale. Not only internally, but also in terms of > system resources. Given that I work daily with huge frameworks, > like Java and .NET, I'm wondering how their respective companies > intend to move to fully utilization of multi-processor (multi-core) > systems. It's very different when you have a (relatively) lite > system like Erlang, which in itself was built for this work, compare > to systems that huge. Having said that these companies have enough > resources and interest to turn things around. > > > > > > ---------[ Received Mail Content ]---------- > > Subject : Re: [erlang-questions] concurrency ! developments > > Date : Tue, 15 Jan 2008 14:47:44 +0300 > > From : "Kirill Zaborski" > > To : "Hynek Vychodil" > > Cc : erlang-questions@REDACTED > > > > So you say that performance doesn't matter? > > Somewhat strange statement from engineer. > > > > P.S. In some circumstances it can be negligible and I don't deny other > > benefits from immutalbe variables. Just point to not very rare > issues with > > Java GC which could be solved in GC assuming immutable variables > (which make > > it simpler as far as I understand). > > > > Regards, > > Kirill. > > > > On Jan 15, 2008 2:37 PM, Hy! nek Vychodil wrote: > > >! ; > > It isn't matter of performance, it is about security, reliability > and > > > bug hunting. > > > > > > On 1/15/08, Kirill Zaborski wrote: > > > > And also normally better GC performance coming from immutable > variables? > > > Not > > > > requiring intricate GC options. > > > > > > > > > > > > On Jan 15, 2008 1:27 PM, Hynek Vychodil < > vychodil.hynek@REDACTED> > > > wrote: > > > > > > > > > > ... and where is immutable variables, where is side effect free > > > > > functional programming? Where is funny declarative (easy > readable) > > > > > syn! tax? > > > > > > > &g t; > > Groovy is death way. > > > > > > > > > > > > > > > > > > > > > > > > > On 1/15/08, Christian S wrot! e: > > > > > > Where are process links? Where are super vision tree infra- > structure? > > > > > > Where is remote-node messaging transparency? > > > > > > > > > > > > > http://www.groovyactors.org/ > > > > > > _______________________________________________ > > > > > > erlang-questions mailing list > > > > > > erlang-questions@REDACTED > > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > -- > > > > > --Hynek (Pichi) Vychodil > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > erlang-questions mailing list > > > > > erlang-questions@REDACTED > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > ! > > > > > -- > > > --Hynek (Pichi) Vychodil > > > > > _______________________________________________ > erlang-qu! estions mailing list > erlang-questions@REDACTED &g t; http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From qrilka@REDACTED Wed Jan 16 12:59:23 2008 From: qrilka@REDACTED (Kirill Zaborski) Date: Wed, 16 Jan 2008 14:59:23 +0300 Subject: [erlang-questions] concurrency developments In-Reply-To: <02c301c85834$96e605e0$c4b211a0$@rr.com> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <02c301c85834$96e605e0$c4b211a0$@rr.com> Message-ID: <337538cb0801160359l78c74314ofb608f19c03c91c0@mail.gmail.com> I thought J-EAI ( http://www.process-one.net/en/jeai/ ) is somewhat like ESB (ESB is mentioned in J-EAI user guide) solution but had no time to check it. Maybe people from Process One on the list will explain what it is about and its destiny? Regards, Kirill. 2008/1/16 Bob Calco : > With respect to the CLR I note that they have some hard-core Haskellites > driving the compiler development, not the least of which being Erik Meijer, > who is on a mission to "democratize the cloud" with VB support for > functional programming concepts ? i.e., make middle tier development easy > for Everyman. Developments like the CCR (Concurrency and Coordination > Runtime), part of MS Robitics Studio, with its Port and PortSet > abstractions, are additional major efforts to bring message-passing > concurrency to .NET. > > > > Also, don't count the Rubyists out. Matz is building a VM for Ruby as of > 2.0, and as I understand it much of the renewed interest in Erlang comes > from folks disappointed at RoR's scaling issues. At least, that's partly how > I rediscovered it. > > > > I first heard about Erlang reading the following book about Oz: > > > > > http://www.amazon.com/Concepts-Techniques-Models-Computer-Programming/dp/0262220695/ > > > > There is a whole section of a chapter on concurrency dedicated to > comparing Erlang and Oz?one of few languages to get such extensive > comparative treatment. > > > > I have long been an admirer of Oz, with its ambitious multi-paradigm > agenda, and have been convinced for many years that it portends an era in > which nanny runtimes embrace more than one computational model. But using it > in real programs is hard for lack of library maturity and community support. > I think the syntax is simply too foreign for most folks, which is sad. It > has a tool called Gump so that you can design your own front end language to > it, but I never had time to get into it. Ultimately, such a swiss army knife > of a language (complete with the sidewinder missile option and a kitchen > sink) is perhaps "too" versatile. It begs the question about the right way > to do something, even as it facilitates every right way to do something. > > > > Erlang is far simpler a language, proven in industry, with a runtime > platform that is an architect's wet dream in terms of satisfying rigorous > scalability, availability and robustness requirements, given its very > focused design goals. > > > > I have recently decided to experiment writing a Ruby-like front end to > Erlang, code named Emerld, which would generate Erlang code that would then > be compiled (at least until I can learn the BEAM file format well enough to > generate it directly). It could theoretically be retargeted to .NET or Java > when either of the two got their act together for concurrency. That seems to > me more a matter of when than if. Until then though I have committed myself > to mastering Erlang, because I think it will give me a huge competitive edge > in the new multi-core world we live in as a software designer and architect. > > > > > Another line of thinking I'm pursuing is "What would be the killer app for > Erlang?" in terms of getting wide-spread IT acceptance. Where I currently > work, which is a large retail chain in the southeast, I think an ESB > solution with built-in health & performance monitoring would be compelling. > Also, code generation tools, i.e., software factories, to make rapid > development of distributed supply chain systems much simpler, could also hit > a sweet spot. > > > > If only there was more time in a day! > > > > - Bob Calco > > > > > > *From:* erlang-questions-bounces@REDACTED [mailto: > erlang-questions-bounces@REDACTED] *On Behalf Of *alex alvarez > *Sent:* Tuesday, January 15, 2008 8:20 PM > *To:* erlang-questions@REDACTED > *Subject:* Re: [erlang-questions] concurrency developments > > > > Well, in the case of CLR, MS is lately putting out so many frameworks and > new stuff that I cannot count them out in this respect. There's no reason > why they could not refurbish the CLR w/ the necessary code and put out a new > framework just to access the new functionality without braking backwards > compatibility. The Sun folks in many respects are a little bit on the > catch up lately with regards to features that first appeared in .NET, but at > the end of all weren't inherently new (ie. generics). > > Now w/ regards to Erlang, which is meant for this type of massive > concurrent work, my feeling is that the biggest problem/hurdle is not the > back-end, but getting into the syntax and (more importantly) to mentally > switch to a totally different format for paradigms. Dr. Joe's book is d! > efinitely a great help, but at least for me is coming slow but steady. > Maybe I'm completely wrong on this, but my feeling is also that Ericsson as > a whole is not that into moving Erlang forward either. > > BTW, sorry for talking about things that seem outside the Erlang realm, > but the truth is that it does not stand alone in a vacuum and hence > everything is related nowadays. > > -Alex > > > ---------[ Received Mail Content ]---------- > > *Subject : *Re: [erlang-questions] concurrency developments > > *Date : *Tue, 15 Jan 2008 17:25:48 -0700 > > *From : *Travis Jensen > > *To : *Erlang Questions > > > > > > The answer to that seems to be "start more JVMs" on the Java side and > > then force the concurrency "issues" into the database. ! It is going to > > be difficult to "rebuild" the JVM (and the CLR ) in a concurrent > > fashion because of the depth of penetration they have: the inertia > > alone will keep it from moving. Too many companies have too much code > > invested, and Sun and Microsoft have both shown that backwards > > compatibility is paramount, regardless of future pain caused. > > > > The flipside of that coin is something like Python, which has the > > agility and potentially the community, but has far too many use cases > > in the non-concurrent realm (basic scripting) to want to make that > > change. I don't think Ruby has the community to make the change. > > Scala has some interesting aspects, but because it is tied to the > > anchor of a JVM, they'll be hard pressed to really make it work (all > > in my opinion, of course :). > > > > Groovy Actors just seems like a very immature Stackless Python, which, > > while a reasonable model, is limited significantly by its underlying > ! > technology. > > > > tj > > > > On Jan 15, 2008, at 12:19 PM, alex alvarez wrote: > > > > > I myself believe that their biggest hurdle is JVM's ability or > > > inability to scale. Not only internally, but also in terms of > > > system resources. Given that I work daily with huge frameworks, > > > like Java and .NET, I'm wondering how their respective companies > > > intend to move to fully utilization of multi-processor (multi-core) > > > systems. It's very different when you have a (relatively) lite > > > system like Erlang, which in itself was built for this work, compare > > > to systems that huge. Having said that these companies have enough > > > resources and interest to turn things around. > > > > > > > > > > > > > > > > > > ---------[ Received Mail Content ]---------- > > > > > > Subject : Re: [erlang-questions] concurrency ! developments > > > > > > Date : Tue, 15 Jan 2008 14:47:44 +0300 > > > > > > From : "Kirill Zaborski" > > > > > > To : "Hynek Vychodil" > > > > > > Cc : erlang-questions@REDACTED > > > > > > > > > > > > So you say that performance doesn't matter? > > > > > > Somewhat strange statement from engineer. > > > > > > > > > > > > P.S. In some circumstances it can be negligible and I don't deny other > > > > > > benefits from immutalbe variables. Just point to not very rare > > > issues with > > > > > > Java GC which could be solved in GC assuming immutable variables > > > (which make > > > > > > it simpler as far as I understand). > > > > > > > > > > > > Regards, > > > > > > Kirill. > > > > > > > > > > > > On Jan 15, 2008 2:37 PM, Hy! nek Vychodil wrote: > > > > > > > > >! ; > > > > It isn't matter of performance, it is about security, reliability > > > and > > > > > > > bug hunting. > > > > > > > > > > > > > > On 1/15/08, Kirill Zaborski wrote: > > > > > > > > And also normally better GC performance coming from immutable > > > variables? > > > > > > > Not > > > > > > > > requiring intricate GC options. > > > > > > > > > > > > > > > > > > > > > > > > On Jan 15, 2008 1:27 PM, Hynek Vychodil < > > > vychodil.hynek@REDACTED> > > > > > > > wrote: > > > > > > > > > > > > > > > > > > ... and where is immutable variables, where is side effect free > > > > > > > > > functional programming? Where is funny declarative (easy > > > readable) > > > > > > > > > syn! tax? > > > > > > > > > > > > > > > &g t; > > Groovy is death way. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On 1/15/08, Christian S wrot! e: > > > > > > > > > > Where are process links? Where are super vision tree infra- > > > structure? > > > > > > > > > > Where is remote-node messaging transparency? > > > > > > > > > > > > > > > > > > > > > http://www.groovyactors.org/ > > > > > > > > > > _______________________________________________ > > > > > > > > > > erlang-questions mailing list > > > > > > > > > > erlang-questions@REDACTED > > > > > > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > --Hynek (Pichi) Vychodil > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > erlang-questions mailing list > > > > > > > > > erlang-questions@REDACTED > > > > > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ! > > > > > > > > > > > -- > > > > > > > --Hynek (Pichi) Vychodil > > > > > > > > > > > > > _______________________________________________ > > > erlang-qu! estions mailing list > > > erlang-questions@REDACTED > > &g t; 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 mickael.remond@REDACTED Wed Jan 16 14:13:52 2008 From: mickael.remond@REDACTED (=?WINDOWS-1252?Q?Micka=EBl_R=E9mond?=) Date: Wed, 16 Jan 2008 14:13:52 +0100 Subject: [erlang-questions] concurrency developments In-Reply-To: <337538cb0801160359l78c74314ofb608f19c03c91c0@mail.gmail.com> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <02c301c85834$96e605e0$c4b211a0$@rr.com> <337538cb0801160359l78c74314ofb608f19c03c91c0@mail.gmail.com> Message-ID: <9E1A543D-9921-4C92-8F2A-DE3F537DE1C1@process-one.net> Hello, Le 16 janv. 08 ? 12:59, Kirill Zaborski a ?crit : > I thought J-EAI ( http://www.process-one.net/en/jeai/ ) is somewhat > like ESB (ESB is mentioned in J-EAI user guide) solution but had no > time to check it. > Maybe people from Process One on the list will explain what it is > about and its destiny? Most of the work on J-EAI is now part of ejabberd. As such you can setup a good data bus with ejabberd. -- Micka?l R?mond http://www.process-one.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From qrilka@REDACTED Wed Jan 16 14:23:27 2008 From: qrilka@REDACTED (Kirill Zaborski) Date: Wed, 16 Jan 2008 16:23:27 +0300 Subject: [erlang-questions] concurrency developments In-Reply-To: <9E1A543D-9921-4C92-8F2A-DE3F537DE1C1@process-one.net> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <02c301c85834$96e605e0$c4b211a0$@rr.com> <337538cb0801160359l78c74314ofb608f19c03c91c0@mail.gmail.com> <9E1A543D-9921-4C92-8F2A-DE3F537DE1C1@process-one.net> Message-ID: <337538cb0801160523j6b795411vd4e0180d1507d76e@mail.gmail.com> Sounds cool. Are there any big examples of such ejabberd use in enterprise? Maybe some papers/presentations? They could be a good marketing tool for Process One I think. Regards, Kirill. On Jan 16, 2008 4:13 PM, Micka?l R?mond wrote: > Hello, > Le 16 janv. 08 ? 12:59, Kirill Zaborski a ?crit : > > I thought J-EAI ( http://www.process-one.net/en/jeai/ ) is somewhat like > ESB (ESB is mentioned in J-EAI user guide) solution but had no time to check > it. > Maybe people from Process One on the list will explain what it is about > and its destiny? > > > Most of the work on J-EAI is now part of ejabberd. > As such you can setup a good data bus with ejabberd. > > -- > Micka?l R?mond > http://www.process-one.net/ > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bobcalco@REDACTED Wed Jan 16 14:36:52 2008 From: bobcalco@REDACTED (Bob Calco) Date: Wed, 16 Jan 2008 08:36:52 -0500 Subject: [erlang-questions] concurrency developments In-Reply-To: <337538cb0801160359l78c74314ofb608f19c03c91c0@mail.gmail.com> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <02c301c85834$96e605e0$c4b211a0$@rr.com> <337538cb0801160359l78c74314ofb608f19c03c91c0@mail.gmail.com> Message-ID: <02da01c85844$daa7ce70$8ff76b50$@rr.com> What's the J stand for, I wonder? When I stumbled on it awhile back I figured it was Java-based just because of the J. If J-EAI is written in Erlang I will take a new look at it. I am actively looking for ways to bring Erlang in where I work. Thanks for getting me to look at J-EAI again. - Bob From: Kirill Zaborski [mailto:qrilka@REDACTED] Sent: Wednesday, January 16, 2008 6:59 AM To: bobcalco@REDACTED Cc: alex alvarez; erlang-questions@REDACTED Subject: Re: [erlang-questions] concurrency developments I thought J-EAI ( http://www.process-one.net/en/jeai/ ) is somewhat like ESB (ESB is mentioned in J-EAI user guide) solution but had no time to check it. Maybe people from Process One on the list will explain what it is about and its destiny? Regards, Kirill. 2008/1/16 Bob Calco : With respect to the CLR I note that they have some hard-core Haskellites driving the compiler development, not the least of which being Erik Meijer, who is on a mission to "democratize the cloud" with VB support for functional programming concepts - i.e., make middle tier development easy for Everyman. Developments like the CCR (Concurrency and Coordination Runtime), part of MS Robitics Studio, with its Port and PortSet abstractions, are additional major efforts to bring message-passing concurrency to .NET. Also, don't count the Rubyists out. Matz is building a VM for Ruby as of 2.0, and as I understand it much of the renewed interest in Erlang comes from folks disappointed at RoR's scaling issues. At least, that's partly how I rediscovered it. I first heard about Erlang reading the following book about Oz: http://www.amazon.com/Concepts-Techniques-Models-Computer-Programming/dp/026 2220695/ There is a whole section of a chapter on concurrency dedicated to comparing Erlang and Oz-one of few languages to get such extensive comparative treatment. I have long been an admirer of Oz, with its ambitious multi-paradigm agenda, and have been convinced for many years that it portends an era in which nanny runtimes embrace more than one computational model. But using it in real programs is hard for lack of library maturity and community support. I think the syntax is simply too foreign for most folks, which is sad. It has a tool called Gump so that you can design your own front end language to it, but I never had time to get into it. Ultimately, such a swiss army knife of a language (complete with the sidewinder missile option and a kitchen sink) is perhaps "too" versatile. It begs the question about the right way to do something, even as it facilitates every right way to do something. Erlang is far simpler a language, proven in industry, with a runtime platform that is an architect's wet dream in terms of satisfying rigorous scalability, availability and robustness requirements, given its very focused design goals. I have recently decided to experiment writing a Ruby-like front end to Erlang, code named Emerld, which would generate Erlang code that would then be compiled (at least until I can learn the BEAM file format well enough to generate it directly). It could theoretically be retargeted to .NET or Java when either of the two got their act together for concurrency. That seems to me more a matter of when than if. Until then though I have committed myself to mastering Erlang, because I think it will give me a huge competitive edge in the new multi-core world we live in as a software designer and architect. Another line of thinking I'm pursuing is "What would be the killer app for Erlang?" in terms of getting wide-spread IT acceptance. Where I currently work, which is a large retail chain in the southeast, I think an ESB solution with built-in health & performance monitoring would be compelling. Also, code generation tools, i.e., software factories, to make rapid development of distributed supply chain systems much simpler, could also hit a sweet spot. If only there was more time in a day! - Bob Calco From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of alex alvarez Sent: Tuesday, January 15, 2008 8:20 PM To: erlang-questions@REDACTED Subject: Re: [erlang-questions] concurrency developments Well, in the case of CLR, MS is lately putting out so many frameworks and new stuff that I cannot count them out in this respect. There's no reason why they could not refurbish the CLR w/ the necessary code and put out a new framework just to access the new functionality without braking backwards compatibility. The Sun folks in many respects are a little bit on the catch up lately with regards to features that first appeared in .NET, but at the end of all weren't inherently new (ie. generics). Now w/ regards to Erlang, which is meant for this type of massive concurrent work, my feeling is that the biggest problem/hurdle is not the back-end, but getting into the syntax and (more importantly) to mentally switch to a totally different format for paradigms. Dr. Joe's book is d! efinitely a great help, but at least for me is coming slow but steady. Maybe I'm completely wrong on this, but my feeling is also that Ericsson as a whole is not that into moving Erlang forward either. BTW, sorry for talking about things that seem outside the Erlang realm, but the truth is that it does not stand alone in a vacuum and hence everything is related nowadays. -Alex ---------[ Received Mail Content ]---------- Subject : Re: [erlang-questions] concurrency developments Date : Tue, 15 Jan 2008 17:25:48 -0700 >From : Travis Jensen To : Erlang Questions The answer to that seems to be "start more JVMs" on the Java side and then force the concurrency "issues" into the database. ! It is going to be difficult to "rebuild" the JVM (and the CLR ) in a concurrent fashion because of the depth of penetration they have: the inertia alone will keep it from moving. Too many companies have too much code invested, and Sun and Microsoft have both shown that backwards compatibility is paramount, regardless of future pain caused. The flipside of that coin is something like Python, which has the agility and potentially the community, but has far too many use cases in the non-concurrent realm (basic scripting) to want to make that change. I don't think Ruby has the community to make the change. Scala has some interesting aspects, but because it is tied to the anchor of a JVM, they'll be hard pressed to really make it work (all in my opinion, of course :). Groovy Actors just seems like a very immature Stackless Python, which, while a reasonable model, is limited significantly by its underlying ! technology. tj On Jan 15, 2008, at 12:19 PM, alex alvarez wrote: > I myself believe that their biggest hurdle is JVM's ability or > inability to scale. Not only internally, but also in terms of > system resources. Given that I work daily with huge frameworks, > like Java and .NET, I'm wondering how their respective companies > intend to move to fully utilization of multi-processor (multi-core) > systems. It's very different when you have a (relatively) lite > system like Erlang, which in itself was built for this work, compare > to systems that huge. Having said that these companies have enough > resources and interest to turn things around. > > > > > > ---------[ Received Mail Content ]---------- > > Subject : Re: [erlang-questions] concurrency ! developments > > Date : Tue, 15 Jan 2008 14:47:44 +0300 > > From : "Kirill Zaborski" > > To : "Hynek Vychodil" > > Cc : erlang-questions@REDACTED > > > > So you say that performance doesn't matter? > > Somewhat strange statement from engineer. > > > > P.S. In some circumstances it can be negligible and I don't deny other > > benefits from immutalbe variables. Just point to not very rare > issues with > > Java GC which could be solved in GC assuming immutable variables > (which make > > it simpler as far as I understand). > > > > Regards, > > Kirill. > > > > On Jan 15, 2008 2:37 PM, Hy! nek Vychodil wrote: > > >! ; > > It isn't matter of performance, it is about security, reliability > and > > > bug hunting. > > > > > > On 1/15/08, Kirill Zaborski wrote: > > > > And also normally better GC performance coming from immutable > variables? > > > Not > > > > requiring intricate GC options. > > > > > > > > > > > > On Jan 15, 2008 1:27 PM, Hynek Vychodil < > vychodil.hynek@REDACTED> > > > wrote: > > > > > > > > > > ... and where is immutable variables, where is side effect free > > > > > functional programming? Where is funny declarative (easy > readable) > > > > > syn! tax? > > > > > > > &g t; > > Groovy is death way. > > > > > > > > > > > > > > > > > > > > > > > > > On 1/15/08, Christian S wrot! e: > > > > > > Where are process links? Where are super vision tree infra- > structure? > > > > > > Where is remote-node messaging transparency? > > > > > > > > > > > > > http://www.groovyactors.org/ > > > > > > _______________________________________________ > > > > > > erlang-questions mailing list > > > > > > erlang-questions@REDACTED > > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > -- > > > > > --Hynek (Pichi) Vychodil > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > erlang-questions mailing list > > > > > erlang-questions@REDACTED > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > ! > > > > > -- > > > --Hynek (Pichi) Vychodil > > > > > _______________________________________________ > erlang-qu! estions mailing list > erlang-questions@REDACTED &g t; 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 dot@REDACTED Wed Jan 16 15:49:11 2008 From: dot@REDACTED (Tony Finch) Date: Wed, 16 Jan 2008 14:49:11 +0000 Subject: [erlang-questions] concurrency developments In-Reply-To: <02da01c85844$daa7ce70$8ff76b50$@rr.com> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <02c301c85834$96e605e0$c4b211a0$@rr.com> <337538cb0801160359l78c74314ofb608f19c03c91c0@mail.gmail.com> <02da01c85844$daa7ce70$8ff76b50$@rr.com> Message-ID: On Wed, 16 Jan 2008, Bob Calco wrote: > What's the J stand for, I wonder? When I stumbled on it awhile back I > figured it was Java-based just because of the J. If J-EAI is written in > Erlang I will take a new look at it Jabber. Tony. -- f.a.n.finch http://dotat.at/ HUMBER: SOUTHWEST 5 TO 7, OCCASIONALLY GALE 8 AT FIRST. MODERATE OR ROUGH. SHOWERS. MODERATE. From Martin.Logan@REDACTED Wed Jan 16 18:17:38 2008 From: Martin.Logan@REDACTED (Logan, Martin) Date: Wed, 16 Jan 2008 11:17:38 -0600 Subject: [erlang-questions] What level of bundling is correct for sharingcode? In-Reply-To: <73534CA0-0FFC-4435-94EE-BC0B754F798E@fess.org> References: <73534CA0-0FFC-4435-94EE-BC0B754F798E@fess.org> Message-ID: The way to go is definitely to package this as an application. Standalone modules are not useable in the greater otp context of releases without additional work on the part of other developers. Applications should be the smallest unit of public consumption for almost all Erlang code. Cheers, Martin -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of fess Sent: Tuesday, January 15, 2008 4:01 PM To: erlang-questions@REDACTED Subject: [erlang-questions] What level of bundling is correct for sharingcode? Hi, I did end up writing my own Port for rrdtool, and I put it up on google code. http://code.google.com/p/erlrrd/ [comments welcome, http://erlrrd.googlecode.com/svn/trunk/erlrrd/src/erlrrd.erl ] since I'm new to erlang, it has been a good exercise. At the moment it's just a gen_server call back module in a single file, It talks to a single rrdtool unix process. I'm wondering what the right level of bundling should be to share this with the world, Should it be an Application? or a Library Application? or just the single gen_server file that it is? I feel like an Application that actually starts and stops may be presuming too much about how someone wants to use it, they may want to startup several of these Ports and partition the information being sent to them, and in that case they would probably be rolling their own application together, in which case they may want to start the gen_server with their own supervisers etc. I'm curious as to what is more the "erlang way". thanks. --fess _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From eajam@REDACTED Wed Jan 16 19:52:39 2008 From: eajam@REDACTED (alex alvarez) Date: Wed, 16 Jan 2008 13:52:39 -0500 (EST) Subject: [erlang-questions] concurrency developments Message-ID: <20080116135239.HM.00000000000002Q@eajam.bos-mail-wwl1.lycos.com> An HTML attachment was scrubbed... URL: From toby@REDACTED Wed Jan 16 22:19:33 2008 From: toby@REDACTED (Toby Thain) Date: Wed, 16 Jan 2008 19:19:33 -0200 Subject: [erlang-questions] concurrency developments In-Reply-To: <20080116135239.HM.00000000000002Q@eajam.bos-mail-wwl1.lycos.com> References: <20080116135239.HM.00000000000002Q@eajam.bos-mail-wwl1.lycos.com> Message-ID: <0D21B58C-9B9E-4B3A-A819-BCF6EFFF4399@smartgames.ca> On 16-Jan-08, at 4:52 PM, alex alvarez wrote: > Very interesting! Oz is definitely on the wild side. Fumes from > the sixties must still be lingering around in some universities. Universities are often built on top of old hippie burial grounds! ?Toby > > > > > ---------[ Received Mail Content ]---------- > > Subject : RE: [erlang-questions] concurrency developments > > Date : Wed, 16 Jan 2008 06:40:26 -0500 > > From : "Bob Calco" > > To : "'alex alvarez'" , > > > > With respect to the CLR I note that they have some hard-core > Haskellites driving the compiler development, not the least of > which being Erik Meijer, who is on a mission to ?democratize the > cloud! ? with VB support for functional programming concepts ? > i.e., make middle tier development easy for Everyman. Developments > like the CCR (Concurrency and Coordination Runtime), part of MS > Robitics Studio, with its Port and PortSet abstractions, are > additional major efforts to bring message-passing concurrency to .NET. > > > > > > > > Also, don?t count the Rubyists out. Matz is building a VM for Ruby > as of 2.0, and as I understand it much of the renewed interest in > Erlang comes from folks disappointed at RoR?s scaling issues. At > least, that?s partly how I rediscovered it. > > > > > > > > I first heard about Erlang reading the following book about Oz: > > > > > > > > http://www.amazon.com/Concepts-Techniques-Models-Computer- > Programming/dp/0262220695/ > > > > > > > > There is a whole section of a chapter on concurrency dedicated to > comparing Erlang and Oz?one of few languages to get such extensive > compa! rative treatment. > > > > > > > > I have long been an admirer of Oz, with its ambitious multi- > paradigm agenda, and have been convinced for many years that it > portends an era in which nanny runtimes embrace more than one > computational model. But using it in real programs is hard for lack > of library maturity and community support. I think the syntax is > simply too foreign for most folks, which is sad. It has a tool > called Gump so that you can design your own front end language to > it, but I never had time to get into it. Ultimately, such a swiss > army knife of a language (complete with the sidewinder missile > option and a kitchen sink) is perhaps ?too? versatile. It begs the > question about the right way to do something, even as it > facilitates every right way to do something. > > > > > > > > Erlang is far simpler a language, proven in industry, with a > runtime platform that is an architect?s wet dream in terms of > satisfying rigorous scalability, availability and robustness > requirements, given its very focused desi! gn goals. > > > > > > > > I have recently decided to experiment writing a Ruby-like front end > to Erlang, code named Emerld, which would generate Erlang code that > would then be compiled (at least until I can learn the BEAM file > format well enough to generate it directly). It could theoretically > be retargeted to .NET or Java when either of the two got their act > together for concurrency. That seems to me more a matter of when > than if. Until then though I have committed myself to mastering > Erlang, because I think it will give me a huge competitive edge in > the new multi-core world we live in as a software designer and > architect. > > > > > > > > Another line of thinking I?m pursuing is ?What would be the killer > app for Erlang?? in terms of getting wide-spread IT acceptance. > Where I currently work, which is a large retail chain in the > southeast, I think an ESB solution with built-in health & > performance monitoring would be compelling. Als! o, code generation > tools, i.e., software factories, to make rapid deve lopment of > distributed supply chain systems much simpler, could also hit a > sweet spot. > > > > > > > > If only there was more time in a day! > > > > > > > > - Bob Calco > > > > > > > > > > > > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions- > bounces@REDACTED] On Behalf Of alex alvarez > > Sent: Tuesday, January 15, 2008 8:20 PM > > To: erlang-questions@REDACTED > > Subject: Re: [erlang-questions] concurrency developments > > > > > > > > > > Well, in the case of CLR, MS is lately putting out so many > frameworks and new stuff that I cannot count them out in this > respect. There's no reason why they could not refurbish the CLR w/ > the necessary code and put out a new framework just to access the > new functionality without braking backwards compatibility. The Sun > folks in many respects are a little bit on the catch up lately with > regards to features that first appe! ared in .NET, but at the end > of all weren't inherently new (ie. generics). > > > > Now w/ regards to Erlang, which is meant for this type of massive > concurrent work, my feeling is that the biggest problem/hurdle is > not the back-end, but getting into the syntax and (more > importantly) to mentally switch to a totally different format for > paradigms. Dr. Joe's book is d! efinitely a great help, but at > least for me is coming slow but steady. Maybe I'm completely wrong > on this, but my feeling is also that Ericsson as a whole is not > that into moving Erlang forward either. > > > > BTW, sorry for talking about things that seem outside the Erlang > realm, but the truth is that it does not stand alone in a vacuum > and hence everything is related nowadays. > > > > -Alex > > > > > > ---------[ Received Mail Content ]---------- > > > > Subject : Re: [erlang-questions] concurrency developments > > > > Date : Tue, 15 Jan 2008 17:25:48 -0700 > > > From : Travis Jensen > > > To : Erlang Questions > > > > > > > > > > > > The answer to that seems to be "start more JVMs" on the Java side and > > > > then force the concurrency "issues" into the database. ! It is > going to > > > > be difficult to "rebuild" the JVM (and the CLR ) in a concurrent > > > > fashion because of the depth of penetration they have: the inertia > > > > alone will keep it from moving. Too many companies have too much code > > > > invested, and Sun and Microsoft have both shown that backwards > > > > compatibility is paramount, regardless of future pain caused. > > > > > > > > The flipside of that coin is something like Python, which has the > > > > agility and potentially the community, but has far too many use cases > > > > in the non-concurrent realm (basic scripting) to want to make that > > > > change. I don't think Ruby has the commun! ity to make the change. > > > > Scala has some interesting aspects, but because it is tied to the > > > > anchor of a JVM, they'll be hard pressed to really make it work (all > > > > in my opinion, of course :). > > > > > > > > Groovy Actors just seems like a very immature Stackless Python, which, > > > > while a reasonable model, is limited significantly by its underlying > > ! > > technology. > > > > > > > > tj > > > > > > > > On Jan 15, 2008, at 12:19 PM, alex alvarez wrote: > > > > > > > > > I myself believe that their biggest hurdle is JVM's ability or > > > > > inability to scale. Not only internally, but also in terms of > > > > > system resources. Given that I work daily with huge frameworks, > > > > > like Java and .NET, I'm wondering how their respective companies > > > > > intend to move to fully utilization of multi-p! rocessor (multi- > core) > > > > > systems. It's very differen t when you have a (relatively) lite > > > > > system like Erlang, which in itself was built for this work, compare > > > > > to systems that huge. Having said that these companies have enough > > > > > resources and interest to turn things around. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------[ Received Mail Content ]---------- > > > > > > > > > > Subject : Re: [erlang-questions] concurrency ! developments > > > > > > > > > > Date : Tue, 15 Jan 2008 14:47:44 +0300 > > > > > > > > > > From : "Kirill Zaborski" > > > > > > > > > > To : "Hynek Vychodil" > > > > > > > > > > Cc : erlang-questions@REDACTED > > > > > > > > > > > > > > > > > > > > So you say that performance doesn't matter? > > > > > > > > > >! ; Somewhat strange statement from engineer. > > > > > > > > > > > > > > > > > > > > P.S. In some circumstances it can be negligible and I don't deny > other > > > > > > > > > > benefits from immutalbe variables. Just point to not very rare > > > > > issues with > > > > > > > > > > Java GC which could be solved in GC assuming immutable variables > > > > > (which make > > > > > > > > > > it simpler as far as I understand). > > > > > > > > > > > > > > > > > > > > Regards, > > > > > > > > > > Kirill. > > > > > > > > > > > > > > > > > > > > On Jan 15, 2008 2:37 PM, Hy! nek Vychodil wrote: > > > > > > > > > > > > > > >! ; > > > > > > It isn't matter of performance, it is about security, reliability > > > > > an! d > > > > > > > > > > > bug hunting. > > > > > > > > > > > > > > > > > > > > > > On 1/15/08, Kirill Zaborski wrote: > > > > > > > > > > > > And also normally better GC performance coming from immutable > > > > > variables? > > > > > > > > > > > Not > > > > > > > > > > > > requiring intricate GC options. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Jan 15, 2008 1:27 PM, Hynek Vychodil < > > > > > vychodil.hynek@REDACTED> > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > ... and where is immutable variables, where is side effect > free > > > > > > > > > > > > > functional programming? Where is funny declarative (easy > > > > ! > readable) > > > > > > > > > > > > > syn! tax? > > > > > > > > > > > > > > > > > > > > > > > &g t; > > Groovy is death way. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On 1/15/08, Christian S wrot! e: > > > > > > > > > > > > > > Where are process links? Where are super vision tree infra- > > > > > structure? > > > > > > > > > > > > > > Where is remote-node messaging transparency? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://www.groovyactors.org/ > > > > > > > > > > > > >! ; > _______________________________________________ > > > > > > > > > > > > > > erlang-questions mailing list > > > > > > > > > > > > > > erlang-questions@REDACTED > > > > > > > > > > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > > > > --Hynek (Pichi) Vychodil > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > erlang-questions mailing list > > > > > > > > > > > > > er! lang-questions@REDACTED > > > > > > > > > > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ! > > > > > > > > > > > > > > > > > -- > > > > > > > > > > > --Hynek (Pichi) Vychodil > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > erlang-qu! estions mailing list > > > > > erlang-questions@REDACTED > > > > &g t; 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 rvirding@REDACTED Wed Jan 16 23:17:04 2008 From: rvirding@REDACTED (Robert Virding) Date: Wed, 16 Jan 2008 23:17:04 +0100 Subject: [erlang-questions] concurrency developments In-Reply-To: <02c301c85834$96e605e0$c4b211a0$@rr.com> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <02c301c85834$96e605e0$c4b211a0$@rr.com> Message-ID: <3dbc6d1c0801161417j4ce40e05t6e42552a9573fd6@mail.gmail.com> On 16/01/2008, Bob Calco wrote: > > I have recently decided to experiment writing a Ruby-like front end to > Erlang, code named Emerld, which would generate Erlang code that would then > be compiled (at least until I can learn the BEAM file format well enough to > generate it directly). It could theoretically be retargeted to .NET or Java > when either of the two got their act together for concurrency. That seems to > me more a matter of when than if. Until then though I have committed myself > to mastering Erlang, because I think it will give me a huge competitive edge > in the new multi-core world we live in as a software designer and architect. > If you are going to compile down to something other than straight Erlang then the best target is Core erlang. It a pure relatively simple and standard functional language which is used inside the compiler. The AST is defined by a set of records and there are tools to read/check/print it. As far as I know there is nothing *legal* you can do in the BEAM code which you can't do in Core. Also you have the benefit of not being forced to modify your compiler as the BEAM engine is improved. If I remember correctly HIPA also uses Core for one pass in its compiler. Someone who knows can comment. This is what I am doing for my LISP front-end to Erlang. Soon to be ready. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Wed Jan 16 23:33:21 2008 From: rvirding@REDACTED (Robert Virding) Date: Wed, 16 Jan 2008 23:33:21 +0100 Subject: [erlang-questions] question: macro definition In-Reply-To: <478D2E22.9080703@pmp.com.au> References: <3dbc6d1c0801150724v36796f2an8778e2a3f5e6281e@mail.gmail.com> <478D2E22.9080703@pmp.com.au> Message-ID: <3dbc6d1c0801161433x7f78d4edt7ac6824150b58c86@mail.gmail.com> On 15/01/2008, Benjamin Tolputt wrote: > > Robert Virding wrote: > > On 15/01/2008, *Ahmed Ali* > > wrote: > > > > > > Does (redefining) mean I cannot define a macro with the same name > > even though they have different arity? > > > > > > That is exactly what it means. It was a mistake to do it that way. But > > it could be corrected now if people really want it. > I would be interested in a quick pros & cons of this. As I understand it > C/C++ has the same "uniquely named" macro functionality. > > As I see it, having macros with arity (i.e. LOG/1 and LOG/2) would be > the Erlang equivalent of declaring a function as "inline". What > advantages would this have given I technically could have the equivalent > of LOG1 & LOG2 macros? > > Nto arguing one way or the other, but Robert mentioned it as a mistake > and I'm curious as to the reasons for and against such a "mistake". > Easy, when macros were first requested all that was asked for was a way for defining constants. I wasn't too convinced of the benefit of adding them at all so as an added "bonus" (it was a joke) I went the "whole hog" and did a copy of C macros. Almost a complete copy anyway. That's why they don't support same name different arity. It wouldn't really be a problem to add that feature now I don't think it would actually break any code. Except perhaps just to not catch errors. Though I doubt it has high priority. The reason why they work at token level is that this was easier to do and better provided the functionality that was asked for, i.e. constants. You can do much cooler things with LISP-like macros but they are "not trivial" to implement in a language which doesn't have a close connection between code and data like LISP or Prolog. Just ask those who have tried for Erlang. Or tried to make a backquote like functionality. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmercer@REDACTED Thu Jan 17 00:28:46 2008 From: dmercer@REDACTED (David Mercer) Date: Wed, 16 Jan 2008 17:28:46 -0600 Subject: [erlang-questions] concurrency developments In-Reply-To: <3dbc6d1c0801161417j4ce40e05t6e42552a9573fd6@mail.gmail.com> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com><02c301c85834$96e605e0$c4b211a0$@rr.com> <3dbc6d1c0801161417j4ce40e05t6e42552a9573fd6@mail.gmail.com> Message-ID: <006301c85897$8b1033e0$891ea8c0@SSI.CORP> If you are going to compile down to something other than straight Erlang then the best target is Core erlang. What is "core Erlang"? DBM _____ From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Robert Virding Sent: Wednesday, January 16, 2008 16:17 To: bobcalco@REDACTED Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] concurrency developments On 16/01/2008, Bob Calco wrote: I have recently decided to experiment writing a Ruby-like front end to Erlang, code named Emerld, which would generate Erlang code that would then be compiled (at least until I can learn the BEAM file format well enough to generate it directly). It could theoretically be retargeted to .NET or Java when either of the two got their act together for concurrency. That seems to me more a matter of when than if. Until then though I have committed myself to mastering Erlang, because I think it will give me a huge competitive edge in the new multi-core world we live in as a software designer and architect. If you are going to compile down to something other than straight Erlang then the best target is Core erlang. It a pure relatively simple and standard functional language which is used inside the compiler. The AST is defined by a set of records and there are tools to read/check/print it. As far as I know there is nothing *legal* you can do in the BEAM code which you can't do in Core. Also you have the benefit of not being forced to modify your compiler as the BEAM engine is improved. If I remember correctly HIPA also uses Core for one pass in its compiler. Someone who knows can comment. This is what I am doing for my LISP front-end to Erlang. Soon to be ready. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjt@REDACTED Thu Jan 17 01:05:06 2008 From: bjt@REDACTED (Benjamin Tolputt) Date: Thu, 17 Jan 2008 11:05:06 +1100 Subject: [erlang-questions] question: macro definition In-Reply-To: <3dbc6d1c0801161433x7f78d4edt7ac6824150b58c86@mail.gmail.com> References: <3dbc6d1c0801150724v36796f2an8778e2a3f5e6281e@mail.gmail.com> <478D2E22.9080703@pmp.com.au> <3dbc6d1c0801161433x7f78d4edt7ac6824150b58c86@mail.gmail.com> Message-ID: <478E9BB2.7040203@pmp.com.au> Robert Virding wrote: > Easy, when macros were first requested all that was asked for was a > way for defining constants. I wasn't too convinced of the benefit of > adding them at all so as an added "bonus" (it was a joke) I went the > "whole hog" and did a copy of C macros. Almost a complete copy anyway. > That's why they don't support same name different arity. So my hunch about C/C++ similarity was correct. Nice to know I'm not a complete simpleton *grin* > It wouldn't really be a problem to add that feature now I don't think > it would actually break any code. Except perhaps just to not catch > errors. Though I doubt it has high priority. Given that there was a solution to the problem posted shortly after my email (using a fun I believe); combined with the fact one can simply make the macros LOG1, LOG2,...,LOGN - I would have to agree the priority is probably pretty low :) > The reason why they work at token level is that this was easier to do > and better provided the functionality that was asked for, i.e. > constants. You can do much cooler things with LISP-like macros but > they are "not trivial" to implement in a language which doesn't have a > close connection between code and data like LISP or Prolog. Just ask > those who have tried for Erlang. Or tried to make a backquote like > functionality. Hmmm, having never used LISP beyond a simple "teach myself LISP" session a year or so back - I'm not that fussed about missing the backquote functionality. Then again, it's probably incredibly useful for LISP programmers who actually know more than the syntax and basic semantics *shrug* Thanks for the info, Robert. --B.J.Tolputt From matthias@REDACTED Thu Jan 17 01:08:13 2008 From: matthias@REDACTED (Matthias Lang) Date: Thu, 17 Jan 2008 01:08:13 +0100 Subject: [erlang-questions] funs and code loading In-Reply-To: <597c69660801151159p589532bco363fd4c70e0fee6e@mail.gmail.com> References: <18315.10295.882008.456569@antilipe.corelatus.se> <597c69660801151159p589532bco363fd4c70e0fee6e@mail.gmail.com> Message-ID: <18318.40045.548008.175031@antilipe.corelatus.se> Hi, for the record: I think your explanation is confusing and wrong. I expect section 9 of the Barklund draft to apply. It explains how code loading is supposed to work. The changeover from old to new code is only supposed to occur in remote calls. f() is not a remote call. A = fun f/0, A() is not a remote call either. So no changeover should be happening in those cases. Yet it does. Matthias ---------------------------------------------------------------------- Attila Babo writes: > Let's simplify your example to mark the difference: > > loop() -> > A = fun f/0, > io:fwrite("~p ~p ~p~n", [A(), f(), ?MODULE:f()]), > timer:sleep(3000), > loop(). > > This will print "2 1 2" after changing VERSION from 1 to 2, because > the A = fun f/0 binding is dynamic at the function scope in run time, > while the call to f as f() at the next line is local and bound at > compile time. Recursion is through our original loop function, so f() > remains the same, while at each call A binds to the latest code. If we > do recursion at the last line with a ?MODULE:loop() global call, then > the local call of f() will bound to the actual code version and the > function will print "2 2 2" after code reloading. > > In your original example the loop calls itself as loop(E, F, G, H), > here all of these variables goes out of scope and bind again to the > latest version at that time. This has the same effect as > loop(fun ?MODULE:f/0, fun() -> f() end, fun f/0, fun() -> ?VERSION end). > As we are calling the original module's loop function the static value > of VERSION remains the same while f itself changes, so these print "2 > 2 2 1" after code change. > > It has an interesting side effect if we do recursion with a > ?MODULE:loop call. Here the first function will print "2 2 2 1" after > code change, as the original module's version, but after that this > will switch to our latest code so the output changes to "2 2 2 2". > > As we can have only two versions of the same module after our second > change code server purges out the original module, so this example has > a limited use, but good for demonstration. I just hope that all these > make sense and I'm not making ideology for a bug:-). Please correct me > if I was wrong! > > Attila > > ----------- > > -module(reload). > -export([go/0, f/0, c/0]). > -export([loop/0]). > -define(VERSION, 1). > -vsn(version_1). > > go() -> > spawn(fun() -> loop() end). > > f() -> > ?VERSION. > > loop() -> > A = fun f/0, > io:fwrite("~p ~p ~p~n", [A(), f(), ?MODULE:f()]), > timer:sleep(3000), > loop(). > > c() -> > code:purge(?MODULE), > code:load_abs(?MODULE). From mateuszb@REDACTED Thu Jan 17 01:13:34 2008 From: mateuszb@REDACTED (Mateusz Berezecki) Date: Thu, 17 Jan 2008 01:13:34 +0100 Subject: [erlang-questions] question: gen_sctp problems on macosx / linux Message-ID: <2924206F-75B0-4F13-96B1-7C660142E696@gmail.com> Hello list, I'm having problems with gen_sctp module. According to the manual all of the below calls should work just fine, but they apparently do not. These messages come from ubuntu linux but they are exactly the same on Mac OS X Leopard. My ubuntu has SCTP support enabled and loaded into a kernel. I don't know anything about SCTP on leopard. Can somebody please shed some light on these issues I am having? best regards, Mateusz Berezecki 3> gen_sctp:open(). exec: 1: sctp_inet: not found ** exception error: bad argument in function gen_sctp:open/1 called as gen_sctp:open([]) 4> gen_sctp:open(1234). ** exception error: bad argument in function gen_sctp:open/1 called as gen_sctp:open([{port,1234}]) 5> exec: 1: sctp_inet: not found 5> gen_sctp:open([{port,1234}]). ** exception error: bad argument in function gen_sctp:open/1 called as gen_sctp:open([{port,1234}]) 6> exec: 1: sctp_inet: not found From matthias@REDACTED Thu Jan 17 00:59:37 2008 From: matthias@REDACTED (Matthias Lang) Date: Thu, 17 Jan 2008 00:59:37 +0100 Subject: [erlang-questions] funs and code loading In-Reply-To: <18315.10295.882008.456569@antilipe.corelatus.se> References: <18315.10295.882008.456569@antilipe.corelatus.se> Message-ID: <18318.39529.567253.383311@antilipe.corelatus.se> Matthias Lang writes: > (I haven't checked whether or not (some) of the above is another facet of > http://erlang.org/pipermail/erlang-bugs/2007-June/000368.html ) I had a go at fixing the underlying problem with new funs overwriting old funs. The fix involves changing erts/emulator/beam/erl_fun.c. I have attached a patch against R12B-0, but not sent it to erlang-patches because there are two loose ends: 1. I don't understand what HIPE's doing when it messes around with the fun table, so I didn't want to fiddle with it. In short: I have left erl_fun.c:erts_get_fun_entry() broken, but it's only used by hipe/hipe_bif0.c. (Aside: Does hot code loading work with HIPE?) 2. erts/emulator/beam/external.c has support for the old fun format. If someone finds a way to mix old and new funs, i.e. calls both erts_put_fun_entry and erts_put_fun_entry2 with the same fun, then that might not do what it should. Maybe some pathological setup with old and new nodes updating each others' code might be able to do that. I am unsure. One solution is to drop support for the old fun format. I have tested that the patch (a) does the right thing for the test case in the URL above and (b) also does the right thing for the test case I posted a few days ago. No testing beyond that. Matthias -------------- next part -------------- A non-text attachment was scrubbed... Name: fun_hash_patch Type: application/octet-stream Size: 1448 bytes Desc: not available URL: From saleyn@REDACTED Thu Jan 17 03:26:50 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Wed, 16 Jan 2008 21:26:50 -0500 Subject: [erlang-questions] question: gen_sctp problems on macosx / linux In-Reply-To: <2924206F-75B0-4F13-96B1-7C660142E696@gmail.com> References: <2924206F-75B0-4F13-96B1-7C660142E696@gmail.com> Message-ID: <478EBCEA.7050302@gmail.com> SCTP implementation has only been tested on the platforms mentioned in the description section of http://www.erlang.org/doc/man/gen_sctp.html. MacOS is not supported (is there a kernel module for SCTP in MacOS?). If you are trying this on Linux, please make sure you have the kernel 2.6.16.27-0.6 or above and user-level lksctp-tools-1.0.6 package installed. Serge Mateusz Berezecki wrote: > Hello list, > > I'm having problems with gen_sctp module. > According to the manual all of the below calls > should work just fine, but they apparently do not. > > These messages come from ubuntu linux but they > are exactly the same on Mac OS X Leopard. > My ubuntu has SCTP support enabled and loaded > into a kernel. I don't know anything about SCTP > on leopard. Can somebody please shed some light > on these issues I am having? > > best regards, > Mateusz Berezecki > > > > 3> gen_sctp:open(). > exec: 1: sctp_inet: not found > ** exception error: bad argument > in function gen_sctp:open/1 > called as gen_sctp:open([]) > 4> gen_sctp:open(1234). > ** exception error: bad argument > in function gen_sctp:open/1 > called as gen_sctp:open([{port,1234}]) > 5> exec: 1: sctp_inet: not found > > 5> gen_sctp:open([{port,1234}]). > ** exception error: bad argument > in function gen_sctp:open/1 > called as gen_sctp:open([{port,1234}]) > 6> exec: 1: sctp_inet: not found > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From saleyn@REDACTED Thu Jan 17 03:40:50 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Wed, 16 Jan 2008 21:40:50 -0500 Subject: [erlang-questions] question: gen_event problems with add_sup_handler() and swap_sup_handler() In-Reply-To: References: <8209f740801151333p79eb1ddh120933d3452c542e@mail.gmail.com> Message-ID: <478EC032.3080009@gmail.com> Note that gen_event:swap_sup_handler/0 is called from my_alarm_handler:start/1 function *in the context of the calling process* (implemented in the handler_guard module). The handler_guard is attached to the supervisor, and every time my_alarm_handler would crash, handler_guard would receive the {gen_event_EXIT,Handler,Reason} message sent by the event manager and exit, causing the supervisor to restart the handler_guard that would consequently reinstall my_alarm_handler. Serge Ahmed Ali wrote: > Hi Ulf, > > I had this understanding when read the article, but that was not clear > at all. If you look at the code in the article, you'll see that > gen_event:swap_sup_handler() was called in the my_alarm_handler module > not from the guard process. That was confusing for me at least. > > I'll test it now. > > Best regards, > Ahmed > > On Jan 16, 2008 1:33 AM, Ulf Wiger wrote: >> That tutorial pretty much explains it, I think, but perhaps >> it's a bit terse on some points. >> >> The whole point is that when the handler crashes, >> the gen_event process sends a message to the >> process that called add_sup_handler() in the first >> place. The supervising process /could/ simply >> reinstall the handler, but it would then have to >> be aware of recurring crashes. Since there is already >> a library that does so, it's better to simply let the >> supervising process die - it is supervised in its turn, >> and its supervisor will restart it. When this happens, >> the handler will be reinstalled. >> >> BR, >> Ulf W >> >> 2008/1/15, Ahmed Ali : >> >>> Hi, >>> >>> I've been trying for sometime to find a way to supervise >>> event_handlers in gen_event behaviour with no luck. I found the >>> following article and tried the code in it but it does not appear to >>> be right http://www.trapexit.org/Gen_event_behavior_demystified. >>> >>> Can anyone please explain how add_sup_handler and swap_sup_handler >>> work and how I could get my event_handler to get restarted in case of >>> a crash? >>> >>> 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 taj.khattra@REDACTED Thu Jan 17 03:42:45 2008 From: taj.khattra@REDACTED (Taj Khattra) Date: Wed, 16 Jan 2008 18:42:45 -0800 Subject: [erlang-questions] concurrency developments In-Reply-To: <006301c85897$8b1033e0$891ea8c0@SSI.CORP> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <02c301c85834$96e605e0$c4b211a0$@rr.com> <3dbc6d1c0801161417j4ce40e05t6e42552a9573fd6@mail.gmail.com> <006301c85897$8b1033e0$891ea8c0@SSI.CORP> Message-ID: <57a21f730801161842n1cac55b6o54731a66d00209e4@mail.gmail.com> > What is "core Erlang"? 1st hit on google From Dmitri.Girenko@REDACTED Thu Jan 17 08:09:24 2008 From: Dmitri.Girenko@REDACTED (Dmitri Girenko) Date: Thu, 17 Jan 2008 09:09:24 +0200 Subject: [erlang-questions] concurrency developments In-Reply-To: <006301c85897$8b1033e0$891ea8c0@SSI.CORP> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com><02c301c85834$96e605e0$c4b211a0$@rr.com><3dbc6d1c0801161417j4ce40e05t6e42552a9573fd6@mail.gmail.com> <006301c85897$8b1033e0$891ea8c0@SSI.CORP> Message-ID: <697074A35ED91748882E3850BDCE295EE08FD1@leenu.akumiitti.net> > What is "core Erlang"? It's the Hardcore Erlang without the Hard part :-) Just kidding. ________________________________ From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of David Mercer Sent: 17. tammikuuta 2008 1:29 To: 'Robert Virding' Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] concurrency developments If you are going to compile down to something other than straight Erlang then the best target is Core erlang. What is "core Erlang"? DBM ________________________________ From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Robert Virding Sent: Wednesday, January 16, 2008 16:17 To: bobcalco@REDACTED Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] concurrency developments On 16/01/2008, Bob Calco wrote: I have recently decided to experiment writing a Ruby-like front end to Erlang, code named Emerld, which would generate Erlang code that would then be compiled (at least until I can learn the BEAM file format well enough to generate it directly). It could theoretically be retargeted to .NET or Java when either of the two got their act together for concurrency. That seems to me more a matter of when than if. Until then though I have committed myself to mastering Erlang, because I think it will give me a huge competitive edge in the new multi-core world we live in as a software designer and architect. If you are going to compile down to something other than straight Erlang then the best target is Core erlang. It a pure relatively simple and standard functional language which is used inside the compiler. The AST is defined by a set of records and there are tools to read/check/print it. As far as I know there is nothing *legal* you can do in the BEAM code which you can't do in Core. Also you have the benefit of not being forced to modify your compiler as the BEAM engine is improved. If I remember correctly HIPA also uses Core for one pass in its compiler. Someone who knows can comment. This is what I am doing for my LISP front-end to Erlang. Soon to be ready. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From dking@REDACTED Thu Jan 17 09:28:34 2008 From: dking@REDACTED (David King) Date: Thu, 17 Jan 2008 00:28:34 -0800 Subject: [erlang-questions] "processor affinity" for processes In-Reply-To: <14812184.post@talk.nabble.com> References: <95be1d3b0704120319m4c8a225cjbc86b77a2d8f96a5@mail.gmail.com> <461E2D70.2080306@ericsson.com> <95be1d3b0704130047r974f440s77377e0dafedace8@mail.gmail.com> <14734902.post@talk.nabble.com> <14812184.post@talk.nabble.com> Message-ID: <04641306-5FB0-4F07-894B-DD7124BF07D8@ketralnis.com> > There are also need to control number of CPUs/cores Erlang VM using, > then > the rest we can use for ports or another non-Erlang external > processes. You can already do this. ~/Desktop/tmp% erl Erlang (BEAM) emulator version 5.6 [source] [smp:2] ~/Desktop/tmp% erl +S 1 Erlang (BEAM) emulator version 5.6 [source] [smp:1] From the man page: +S Number: Sets the number of scheduler threads to use when SMP support has been enabled. Valid range is 1-1024. If the Erlang runtime system is able to determine the number of processor cores available, the default value will equal the this value; otherwise, the default value will be one. This flag will be ignored if the emulator doesn't have SMP support enabled (see the -smp flag). From ingela@REDACTED Thu Jan 17 09:58:34 2008 From: ingela@REDACTED (Ingela Anderton Andin) Date: Thu, 17 Jan 2008 09:58:34 +0100 Subject: [erlang-questions] gen_fsm and active sockets (Dave Smith) In-Reply-To: References: Message-ID: <478F18BA.4060402@erix.ericsson.se> > I'm using gen_fsm to manage a socket connection, and have a question > about how one SHOULD use gen_fsm for this purpose. I'm specifically > using the "active" mode for the socket, so I'm currently receiving > events via the handle_info/3 callback. You probably want to use active once instead so that you get flow control. > I understand why the socket > events arrive there, but I wonder what the best way to pass the event > along to the actual FSM is. I see there being 3 possible options: The most logical way would be to send an event message to yourself by calling the gen_fsm:send_event/2. > 1. Receive socket events on a dedicated process and pass events into > gen_fsm via that process. I can not see any real gain in doing that. It only creates parallelism where there is non and that makes your program more complex and opens up for crating race-conditions and other problems that really should not be there. > Upside is that this provides nice separation > of socket and fsm logic. You already have that separation in that you handle the socket in handle_info and the events in the state functions. > Downside there is that I'm doubling the > number of processes -- i.e. i had one process per socket, now I have > two. Erlang processes are very light weight but you should only create new processes when you need them. A server will often spawn a new process to handle each request. Each participant in a telephone call can be represented by a process. A good principle when deciding which processes you need is to have one process for each truly parallel activity in the system. > 2. Receive socket events in handle_info and invoke > gen_fsm:send_event() from there. This seems like the "obvious" > approach, Yes like I said earlier this is the logic thing to do. > but it feels wrong -- I'm already in process and don't > really want to queue up another event. Again, possibly a "hangover" > from non-Erlang land. I would not worry about that, I doubt that the overhead of sending a message to yourself is significant. (And yes there is a little overhead in the gen_fsm code also) > 3. Receive socket events in handle_info, then do a > ?MODULE:StateName({socket_event ...}, State). Avoids (perceived) > verhead of approach #3, but...is this a good idea?! This could be a way to optimize if profiling activities conclude that that gen_fsm is a big bottleneck, but from a best practice and easy to maintain view I would rather not do this. Regards Ingela - OTP team From exta7@REDACTED Thu Jan 17 12:26:59 2008 From: exta7@REDACTED (Zvi) Date: Thu, 17 Jan 2008 03:26:59 -0800 (PST) Subject: [erlang-questions] "processor affinity" for processes In-Reply-To: <04641306-5FB0-4F07-894B-DD7124BF07D8@ketralnis.com> References: <95be1d3b0704120319m4c8a225cjbc86b77a2d8f96a5@mail.gmail.com> <461E2D70.2080306@ericsson.com> <95be1d3b0704130047r974f440s77377e0dafedace8@mail.gmail.com> <14734902.post@talk.nabble.com> <14812184.post@talk.nabble.com> <04641306-5FB0-4F07-894B-DD7124BF07D8@ketralnis.com> Message-ID: <14916816.post@talk.nabble.com> Hi David, thanks, but what if I want to run two Erlang nodes on on dual CPU machine? Will commands bellow work? ~/Desktop/tmp% erl -sname cpu1 +S 1 ~/Desktop/tmp% erl -sname cpu2 +S 1 Will each of them grab it's own CPU, or this will be left to the mercy of OS? Zvi David King-6 wrote: > >> There are also need to control number of CPUs/cores Erlang VM using, >> then >> the rest we can use for ports or another non-Erlang external >> processes. > > You can already do this. > > ~/Desktop/tmp% erl > Erlang (BEAM) emulator version 5.6 [source] [smp:2] > > > > ~/Desktop/tmp% erl +S 1 > Erlang (BEAM) emulator version 5.6 [source] [smp:1] > > > From the man page: > > +S Number: > > > Sets the number of scheduler threads to use when SMP > support has been enabled. Valid range is 1-1024. If the Erlang > runtime system is able to determine the number of > processor cores available, the default value will equal the this > value; otherwise, the default value will be one. > > This flag will be ignored if the emulator doesn't have > SMP support enabled (see the -smp flag). > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- View this message in context: http://www.nabble.com/%22processor-affinity%22-for-processes-tp9956818p14916816.html Sent from the Erlang Questions mailing list archive at Nabble.com. From richardc@REDACTED Thu Jan 17 12:38:55 2008 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 17 Jan 2008 12:38:55 +0100 Subject: [erlang-questions] concurrency developments In-Reply-To: <3dbc6d1c0801161417j4ce40e05t6e42552a9573fd6@mail.gmail.com> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <02c301c85834$96e605e0$c4b211a0$@rr.com> <3dbc6d1c0801161417j4ce40e05t6e42552a9573fd6@mail.gmail.com> Message-ID: <478F3E4F.2050504@it.uu.se> This page has the most up-to-date Core Erlang specification, and some info on how to compile to/from Core source code: http://www.it.uu.se/research/group/hipe/cerl/ The Core Erlang representation is an important intermediate step for the BEAM compiler, and the HiPE compiler can generate native code directly from Core Erlang as well as from BEAM. /Richard Robert Virding wrote: > On 16/01/2008, *Bob Calco* > wrote: > > I have recently decided to experiment writing a Ruby-like front end > to Erlang, code named Emerld, which would generate Erlang code that > would then be compiled (at least until I can learn the BEAM file > format well enough to generate it directly). It could theoretically > be retargeted to .NET or Java when either of the two got their act > together for concurrency. That seems to me more a matter of when > than if. Until then though I have committed myself to mastering > Erlang, because I think it will give me a huge competitive edge in > the new multi-core world we live in as a software designer and > architect. > > > If you are going to compile down to something other than straight Erlang > then the best target is Core erlang. It a pure relatively simple and > standard functional language which is used inside the compiler. The AST > is defined by a set of records and there are tools to read/check/print > it. As far as I know there is nothing *legal* you can do in the BEAM > code which you can't do in Core. Also you have the benefit of not being > forced to modify your compiler as the BEAM engine is improved. If I > remember correctly HIPA also uses Core for one pass in its compiler. > Someone who knows can comment. > > This is what I am doing for my LISP front-end to Erlang. Soon to be ready. > > Robert > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From mateuszb@REDACTED Thu Jan 17 12:57:55 2008 From: mateuszb@REDACTED (Mateusz Berezecki) Date: Thu, 17 Jan 2008 12:57:55 +0100 Subject: [erlang-questions] question: gen_sctp problems on macosx / linux In-Reply-To: <478EBCEA.7050302@gmail.com> References: <2924206F-75B0-4F13-96B1-7C660142E696@gmail.com> <478EBCEA.7050302@gmail.com> Message-ID: On Jan 17, 2008, at 3:26 AM, Serge Aleynikov wrote: > SCTP implementation has only been tested on the platforms mentioned > in the description section of http://www.erlang.org/doc/man/gen_sctp.html > . MacOS is not supported (is there a kernel module for SCTP in > MacOS?). If you are trying this on Linux, please make sure you have > the kernel 2.6.16.27-0.6 or above and user-level lksctp-tools-1.0.6 > package installed. > Thank you for the response Serge. There is a kernel extension for MacOS but that's not the kind of a solution I am looking for. Are there any good working user-space implementations for SCTP protocol? I'm looking for a portable SCTP stack which would work with Windows/ Linux/MacOS/etc. Would there be any interest in creating such stack for Erlang ? The only concerns I am having are for performance reasons of such piece of software. Do you have any comments? best regards, Mateusz Berezecki From launoja@REDACTED Thu Jan 17 13:21:42 2008 From: launoja@REDACTED (Jani Launonen) Date: Thu, 17 Jan 2008 14:21:42 +0200 Subject: [erlang-questions] gen_fsm and active sockets In-Reply-To: References: Message-ID: Hello! Good (and well formed!) question from Dave and good aswers in the erlang-questions list! There's one more alternative, namely plain_fsm behaviour by Ulf Wiger, which could be nice fit for the problem. It does away with the "complexities" of gen_fsm but still is suitable for supervision tree. Have a look at: http://tinyurl.com/yu6jha http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/plain_fsm/ Cheers, Jani Launonen Dave Smith kirjoitti 15.1.2008 kello 20.51: > > Greetings, > > I'm using gen_fsm to manage a socket connection, and have a question > about how one SHOULD use gen_fsm for this purpose. I'm specifically > using the "active" mode for the socket, so I'm currently receiving > events via the handle_info/3 callback. I understand why the socket > events arrive there, but I wonder what the best way to pass the event > along to the actual FSM is. I see there being 3 possible options: > > 1. Receive socket events on a dedicated process and pass events into > gen_fsm via that process. Upside is that this provides nice separation > of socket and fsm logic. Downside there is that I'm doubling the > number of processes -- i.e. i had one process per socket, now I have > two. That's not a big problem with a couple of thousand connections, > but once I'm in the 20k-30k connections realm, I'm not quite sure what > the implications of doubling the number of processes is. Is it > "normal" in a production system to run 100k+ processes? Note: I'm > still recovering from pthreads land, where 100k+ theads is a scary, > scary thing -- so maybe this concern over # of processes is a > threading world "hangover" :) > > 2. Receive socket events in handle_info and invoke > gen_fsm:send_event() from there. This seems like the "obvious" > approach, but it feels wrong -- I'm already in process and don't > really want to queue up another event. Again, possibly a "hangover" > from non-Erlang land. > > 3. Receive socket events in handle_info, then do a > ?MODULE:StateName({socket_event ...}, State). Avoids (perceived) > overhead of approach #3, but...is this a good idea?! > > Hopefully this isn't a stupid/obvious question -- I'm finding that > erlang has a tendency to turn "common sense" on its head (in a good > way). Any guidance from the gurus would be happily accepted.. :) > > D. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From david_holz@REDACTED Wed Jan 16 13:58:56 2008 From: david_holz@REDACTED (David Holz) Date: Wed, 16 Jan 2008 12:58:56 +0000 Subject: [erlang-questions] concurrency developments In-Reply-To: <697074A35ED91748882E3850BDCE295EE08FB6@leenu.akumiitti.net> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <697074A35ED91748882E3850BDCE295EE08FB6@leenu.akumiitti.net> Message-ID: From: Dmitri.Girenko@REDACTED > By the way, that brings another interesting > question. As far as I understand, good manycore scalability is a side-effect of > the VM design. Thus IMHO it is just a coincidence that erlang runtime gets > advantage with the new processors. Was this expected back in 1980s? What other > jewels may be hidden there? J According to interviews with Joe Armstrong, processes were cleanly separated to support robustness and partial failures. Parallelism wasn't really a design concern, except if you include redundancy. _________________________________________________________________ Get the power of Windows + Web with the new Windows Live. http://www.windowslive.com?ocid=TXT_TAGHM_Wave2_powerofwindows_012008 From chsu79@REDACTED Thu Jan 17 15:00:40 2008 From: chsu79@REDACTED (Christian S) Date: Thu, 17 Jan 2008 15:00:40 +0100 Subject: [erlang-questions] concurrency developments In-Reply-To: References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <697074A35ED91748882E3850BDCE295EE08FB6@leenu.akumiitti.net> Message-ID: > According to interviews with Joe Armstrong, processes were cleanly separated to support robustness and partial failures. Parallelism wasn't really a design concern, except if you include redundancy. Joe is good at marketing Erlang with parallelism advantages now though. :) From dking@REDACTED Thu Jan 17 18:03:57 2008 From: dking@REDACTED (David King) Date: Thu, 17 Jan 2008 09:03:57 -0800 Subject: [erlang-questions] "processor affinity" for processes In-Reply-To: <14916816.post@talk.nabble.com> References: <95be1d3b0704120319m4c8a225cjbc86b77a2d8f96a5@mail.gmail.com> <461E2D70.2080306@ericsson.com> <95be1d3b0704130047r974f440s77377e0dafedace8@mail.gmail.com> <14734902.post@talk.nabble.com> <14812184.post@talk.nabble.com> <04641306-5FB0-4F07-894B-DD7124BF07D8@ketralnis.com> <14916816.post@talk.nabble.com> Message-ID: > but what if I want to run two Erlang nodes on on dual CPU machine? > Will commands bellow work? > ~/Desktop/tmp% erl -sname cpu1 +S 1 > ~/Desktop/tmp% erl -sname cpu2 +S 1 > Will each of them grab it's own CPU, or this will be left to the > mercy of > OS? They will be left at the mercy of the OS. In reality, that's probably better. The OS knows a whole lot more about what else is running on the machine than Erlang does, and its scheduler is a much better place to put things like cache-locality checking than in every program. From donald.ball@REDACTED Thu Jan 17 21:09:12 2008 From: donald.ball@REDACTED (Donald Ball) Date: Thu, 17 Jan 2008 14:09:12 -0600 Subject: [erlang-questions] win32 gui? In-Reply-To: <1eaa74a80801171148x314afda0n106c648796b1f3e9@mail.gmail.com> References: <1eaa74a80801171148x314afda0n106c648796b1f3e9@mail.gmail.com> Message-ID: <1eaa74a80801171209t5add39dfy704e631e9d666918@mail.gmail.com> Never mind, I found the gs library works nicely for my purposes. Apologies for the newbie spam. - donald From donald.ball@REDACTED Thu Jan 17 20:48:35 2008 From: donald.ball@REDACTED (Donald Ball) Date: Thu, 17 Jan 2008 13:48:35 -0600 Subject: [erlang-questions] win32 gui? Message-ID: <1eaa74a80801171148x314afda0n106c648796b1f3e9@mail.gmail.com> Hi folks, I'm teaching myself Erlang by going through the exercises at: http://erlang.org/course/exercises.html I'm now trying to figure out how to build a simple GUI and am now a bit stymied. Is there an Erlang GUI module for win32 systems? wx seemed promising but doesn't appear to support win32, and everything else seems to target X11 or GTK. Any suggestions? - donald From rvirding@REDACTED Thu Jan 17 22:43:10 2008 From: rvirding@REDACTED (Robert Virding) Date: Thu, 17 Jan 2008 22:43:10 +0100 Subject: [erlang-questions] concurrency developments In-Reply-To: <478F3E4F.2050504@it.uu.se> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <02c301c85834$96e605e0$c4b211a0$@rr.com> <3dbc6d1c0801161417j4ce40e05t6e42552a9573fd6@mail.gmail.com> <478F3E4F.2050504@it.uu.se> Message-ID: <3dbc6d1c0801171343x33db5a9ate772ab7ad42779d4@mail.gmail.com> On 17/01/2008, Richard Carlsson wrote: > > This page has the most up-to-date Core Erlang specification, > and some info on how to compile to/from Core source code: > > http://www.it.uu.se/research/group/hipe/cerl/ > > The Core Erlang representation is an important intermediate > step for the BEAM compiler, and the HiPE compiler can generate > native code directly from Core Erlang as well as from BEAM. Have missed those papers, they're quite readable. The only bit which is missing is a description of the binary/bitstring parts. If you are going to compile to Core then you need the following files as help: /lib/compiler-?.?/src/ core_parse.hrl core_lint.erl core_pp.erl Core_parse.hrl contains the record definitions of the AST of Core and together with appendix C "Syntax tree representation" (in the 1-0-3 paper) give a description of how to build Core code in abstract form. Then it's just core_lint it to be sure and run it in to the back-end of the compiler to generate module. Works really well. The list of annotations are just annotations but some have special meaning, especially a first anno in the list of an integer which is taken to be the line number and used in core_lint error messages. The best way to truly understand how it all fits together is to generate core code "c(foo,[report,to_core])" and stare at it a bit. Most becomes clear then. Guards can be a little tricky. One major benefit of compiling to core, apart from it being a nice little language, is that you get some significant optimisations done for you in the back-end. A major one is the pattern-matching compiler which works on core code. This is a Big Win and while not really hairy code can be tricky to get right. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From eajam@REDACTED Thu Jan 17 22:56:53 2008 From: eajam@REDACTED (alex alvarez) Date: Thu, 17 Jan 2008 16:56:53 -0500 (EST) Subject: [erlang-questions] concurrency developments Message-ID: <20080117165653.HM.000000000000036@eajam.bos-mail-wwl1.lycos.com> An HTML attachment was scrubbed... URL: From richardc@REDACTED Thu Jan 17 23:20:54 2008 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 17 Jan 2008 23:20:54 +0100 Subject: [erlang-questions] concurrency developments In-Reply-To: <3dbc6d1c0801171343x33db5a9ate772ab7ad42779d4@mail.gmail.com> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <02c301c85834$96e605e0$c4b211a0$@rr.com> <3dbc6d1c0801161417j4ce40e05t6e42552a9573fd6@mail.gmail.com> <478F3E4F.2050504@it.uu.se> <3dbc6d1c0801171343x33db5a9ate772ab7ad42779d4@mail.gmail.com> Message-ID: <478FD4C6.9060802@it.uu.se> Robert Virding wrote: > If you are going to compile to Core then you need the following files as > help: > core_parse.hrl > core_lint.erl > core_pp.erl There are some additional files in lib/hipe/cerl, which may be of interest, in particular cerl_prettypr.erl, which is an alternative prettyprinter based on the prettypr library (part of syntax_tools). It does a better job of formatting than the naive core_pp version. > Then it's just core_lint it to be sure and run it in to the back-end of > the compiler to generate module. Works really well. The core_lint pass can simply be enabled by passing the option 'clint' to the compiler, as in c(foo, [from_core,clint]). > The best way to truly understand how it all fits together is to generate > core code "c(foo,[report,to_core])" and stare at it a bit. Most becomes > clear then. Amen. The specification document tries to be precise, but gives you few hints on how it all fits together with the Beam compiler. Looking at some concrete code is the way to go. > One major benefit of compiling to core, apart from it being a nice > little language, is that you get some significant optimisations done for > you in the back-end. A major one is the pattern-matching compiler which > works on core code. Yes. Note that when you compile with the to_core flag, you get the unoptimized translation from plain Erlang, and when you compile with the from_core flag, the compiler will run all the Core level optimizations before moving on down to lower level code. It is also possible to specify -compile({core_transform, Module}) in a module, similar to parse_transforms. (Or just pass {core_transform, Module} as an option.) These transforms are run after the Core level optimizations, so you can rely on being given better code. Pattern matching compilation is done after these transforms however, so the user does not have to worry about doing that himself (and will not be bothered by horrible deeply nested case switches). While I'm at it: primops are only used for quite special stuff on this level (operations that don't officially exist as Erlang functions, but which need to be represented somehow), and you won't see a lot of that. Operators such as '+' are simply represented as calls using their full names: erlang:'+'(A,B). (These are optimized to primitives much later.) So don't be worried about where all the built-in operations are. /Richard From bobcalco@REDACTED Fri Jan 18 03:49:00 2008 From: bobcalco@REDACTED (Bob Calco) Date: Thu, 17 Jan 2008 21:49:00 -0500 Subject: [erlang-questions] concurrency developments In-Reply-To: <3dbc6d1c0801161417j4ce40e05t6e42552a9573fd6@mail.gmail.com> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <02c301c85834$96e605e0$c4b211a0$@rr.com> <3dbc6d1c0801161417j4ce40e05t6e42552a9573fd6@mail.gmail.com> Message-ID: <03e301c8597c$ae006f60$0a014e20$@rr.com> Thanks for the tip. I am definitely going to take this advice! Any more information about this strategy anyone can shed light upon would be greatly appreciated! - Bob From: Robert Virding [mailto:rvirding@REDACTED] Sent: Wednesday, January 16, 2008 5:17 PM To: bobcalco@REDACTED Cc: alex alvarez; erlang-questions@REDACTED Subject: Re: [erlang-questions] concurrency developments On 16/01/2008, Bob Calco wrote: I have recently decided to experiment writing a Ruby-like front end to Erlang, code named Emerld, which would generate Erlang code that would then be compiled (at least until I can learn the BEAM file format well enough to generate it directly). It could theoretically be retargeted to .NET or Java when either of the two got their act together for concurrency. That seems to me more a matter of when than if. Until then though I have committed myself to mastering Erlang, because I think it will give me a huge competitive edge in the new multi-core world we live in as a software designer and architect. If you are going to compile down to something other than straight Erlang then the best target is Core erlang. It a pure relatively simple and standard functional language which is used inside the compiler. The AST is defined by a set of records and there are tools to read/check/print it. As far as I know there is nothing *legal* you can do in the BEAM code which you can't do in Core. Also you have the benefit of not being forced to modify your compiler as the BEAM engine is improved. If I remember correctly HIPA also uses Core for one pass in its compiler. Someone who knows can comment. This is what I am doing for my LISP front-end to Erlang. Soon to be ready. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From bobcalco@REDACTED Fri Jan 18 03:51:17 2008 From: bobcalco@REDACTED (Bob Calco) Date: Thu, 17 Jan 2008 21:51:17 -0500 Subject: [erlang-questions] concurrency developments In-Reply-To: <478F3E4F.2050504@it.uu.se> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <02c301c85834$96e605e0$c4b211a0$@rr.com> <3dbc6d1c0801161417j4ce40e05t6e42552a9573fd6@mail.gmail.com> <478F3E4F.2050504@it.uu.se> Message-ID: <03e901c8597c$ffe47c40$ffad74c0$@rr.com> Awewome, thanks! - Bob > -----Original Message----- > From: Richard Carlsson [mailto:richardc@REDACTED] > Sent: Thursday, January 17, 2008 6:39 AM > To: bobcalco@REDACTED > Cc: Robert Virding; erlang-questions@REDACTED; dmercer@REDACTED > Subject: Re: [erlang-questions] concurrency developments > > This page has the most up-to-date Core Erlang specification, > and some info on how to compile to/from Core source code: > > http://www.it.uu.se/research/group/hipe/cerl/ > > The Core Erlang representation is an important intermediate > step for the BEAM compiler, and the HiPE compiler can generate > native code directly from Core Erlang as well as from BEAM. > > /Richard > > Robert Virding wrote: > > On 16/01/2008, *Bob Calco* > > wrote: > > > > I have recently decided to experiment writing a Ruby-like front > end > > to Erlang, code named Emerld, which would generate Erlang code > that > > would then be compiled (at least until I can learn the BEAM file > > format well enough to generate it directly). It could > theoretically > > be retargeted to .NET or Java when either of the two got their > act > > together for concurrency. That seems to me more a matter of when > > than if. Until then though I have committed myself to mastering > > Erlang, because I think it will give me a huge competitive edge > in > > the new multi-core world we live in as a software designer and > > architect. > > > > > > If you are going to compile down to something other than straight > Erlang > > then the best target is Core erlang. It a pure relatively simple and > > standard functional language which is used inside the compiler. The > AST > > is defined by a set of records and there are tools to > read/check/print > > it. As far as I know there is nothing *legal* you can do in the BEAM > > code which you can't do in Core. Also you have the benefit of not > being > > forced to modify your compiler as the BEAM engine is improved. If I > > remember correctly HIPA also uses Core for one pass in its compiler. > > Someone who knows can comment. > > > > This is what I am doing for my LISP front-end to Erlang. Soon to be > ready. > > > > Robert > > > > > > --------------------------------------------------------------------- > --- > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions From saleyn@REDACTED Fri Jan 18 04:03:03 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Thu, 17 Jan 2008 22:03:03 -0500 Subject: [erlang-questions] "processor affinity" for processes In-Reply-To: <14916816.post@talk.nabble.com> References: <95be1d3b0704120319m4c8a225cjbc86b77a2d8f96a5@mail.gmail.com> <461E2D70.2080306@ericsson.com> <95be1d3b0704130047r974f440s77377e0dafedace8@mail.gmail.com> <14734902.post@talk.nabble.com> <14812184.post@talk.nabble.com> <04641306-5FB0-4F07-894B-DD7124BF07D8@ketralnis.com> <14916816.post@talk.nabble.com> Message-ID: <479016E7.4000907@gmail.com> I don't recall seeing any code in the emulator that would actually set CPU affinity masks. Though it would be a nice feature to have. Serge Zvi wrote: > Hi David, > > thanks, > > but what if I want to run two Erlang nodes on on dual CPU machine? > Will commands bellow work? > > ~/Desktop/tmp% erl -sname cpu1 +S 1 > ~/Desktop/tmp% erl -sname cpu2 +S 1 > > Will each of them grab it's own CPU, or this will be left to the mercy of > OS? > > Zvi > > > David King-6 wrote: >>> There are also need to control number of CPUs/cores Erlang VM using, >>> then >>> the rest we can use for ports or another non-Erlang external >>> processes. >> You can already do this. >> >> ~/Desktop/tmp% erl >> Erlang (BEAM) emulator version 5.6 [source] [smp:2] >> >> >> >> ~/Desktop/tmp% erl +S 1 >> Erlang (BEAM) emulator version 5.6 [source] [smp:1] >> >> >> From the man page: >> >> +S Number: >> >> >> Sets the number of scheduler threads to use when SMP >> support has been enabled. Valid range is 1-1024. If the Erlang >> runtime system is able to determine the number of >> processor cores available, the default value will equal the this >> value; otherwise, the default value will be one. >> >> This flag will be ignored if the emulator doesn't have >> SMP support enabled (see the -smp flag). >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> > From bobcalco@REDACTED Fri Jan 18 04:05:28 2008 From: bobcalco@REDACTED (Bob Calco) Date: Thu, 17 Jan 2008 22:05:28 -0500 Subject: [erlang-questions] concurrency developments In-Reply-To: <478FD4C6.9060802@it.uu.se> References: <20080115201953.HM.00000000000001i@eajam.bos-mail-wwl1.lycos.com> <02c301c85834$96e605e0$c4b211a0$@rr.com> <3dbc6d1c0801161417j4ce40e05t6e42552a9573fd6@mail.gmail.com> <478F3E4F.2050504@it.uu.se> <3dbc6d1c0801171343x33db5a9ate772ab7ad42779d4@mail.gmail.com> <478FD4C6.9060802@it.uu.se> Message-ID: <03f401c8597e$fb33da90$f19b8fb0$@rr.com> Oz also has this concept of a "core" syntax that is a strict subset of the "syntactic sugar" version developers work in, with similar correctness and ease-of-reasoning goals. In any case, this is GREAT stuff... I'm not even more jazzed than I was before about my little pet project. I'm very glad to see so much support for what I'm trying to do already there and ready to be used. It's going to be hard for me to stay focused on the day job now ... :) - Bob > -----Original Message----- > From: Richard Carlsson [mailto:richardc@REDACTED] > Sent: Thursday, January 17, 2008 5:21 PM > To: Robert Virding > Cc: bobcalco@REDACTED; erlang-questions@REDACTED; > dmercer@REDACTED > Subject: Re: [erlang-questions] concurrency developments > > Robert Virding wrote: > > If you are going to compile to Core then you need the following files > as > > help: > > core_parse.hrl > > core_lint.erl > > core_pp.erl > > There are some additional files in lib/hipe/cerl, which may be of > interest, in particular cerl_prettypr.erl, which is an alternative > prettyprinter based on the prettypr library (part of syntax_tools). > It does a better job of formatting than the naive core_pp version. > > > Then it's just core_lint it to be sure and run it in to the back-end > of > > the compiler to generate module. Works really well. > > The core_lint pass can simply be enabled by passing the option 'clint' > to the compiler, as in c(foo, [from_core,clint]). > > > The best way to truly understand how it all fits together is to > generate > > core code "c(foo,[report,to_core])" and stare at it a bit. Most > becomes > > clear then. > > Amen. The specification document tries to be precise, but gives you few > hints on how it all fits together with the Beam compiler. Looking at > some concrete code is the way to go. > > > One major benefit of compiling to core, apart from it being a nice > > little language, is that you get some significant optimisations done > for > > you in the back-end. A major one is the pattern-matching compiler > which > > works on core code. > > Yes. Note that when you compile with the to_core flag, you get the > unoptimized translation from plain Erlang, and when you compile with > the from_core flag, the compiler will run all the Core level > optimizations before moving on down to lower level code. > > It is also possible to specify -compile({core_transform, Module}) > in a module, similar to parse_transforms. (Or just pass > {core_transform, > Module} as an option.) These transforms are run after the Core level > optimizations, so you can rely on being given better code. Pattern > matching compilation is done after these transforms however, so the > user does not have to worry about doing that himself (and will not > be bothered by horrible deeply nested case switches). > > While I'm at it: primops are only used for quite special stuff on this > level (operations that don't officially exist as Erlang functions, but > which need to be represented somehow), and you won't see a lot of that. > Operators such as '+' are simply represented as calls using their full > names: erlang:'+'(A,B). (These are optimized to primitives much later.) > So don't be worried about where all the built-in operations are. > > /Richard From saleyn@REDACTED Fri Jan 18 04:14:57 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Thu, 17 Jan 2008 22:14:57 -0500 Subject: [erlang-questions] question: gen_sctp problems on macosx / linux In-Reply-To: References: <2924206F-75B0-4F13-96B1-7C660142E696@gmail.com> <478EBCEA.7050302@gmail.com> Message-ID: <479019B1.200@gmail.com> There are user-space SCTP implementations, but they are commercial and not open-source (example: IntelliNET). I think it's not that important to have a user-space SCTP stack as it is that the stack complies with the SCTP socket extension API (http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13), which makes SCTP bindings portable. Creating the SCTP stack is a quite time-consuming exercise as this protocol is more complex than TCP, and I don't think any one would be interested in such work since existing implementations provide reasonable performance comparable to TCP. Serge Mateusz Berezecki wrote: > > On Jan 17, 2008, at 3:26 AM, Serge Aleynikov wrote: > >> SCTP implementation has only been tested on the platforms mentioned in >> the description section of >> http://www.erlang.org/doc/man/gen_sctp.html. MacOS is not supported >> (is there a kernel module for SCTP in MacOS?). If you are trying this >> on Linux, please make sure you have the kernel 2.6.16.27-0.6 or above >> and user-level lksctp-tools-1.0.6 package installed. >> > > Thank you for the response Serge. > There is a kernel extension for MacOS but that's not the kind of a solution > I am looking for. > > Are there any good working user-space implementations for SCTP protocol? > I'm looking for a portable SCTP stack which would work with > Windows/Linux/MacOS/etc. > > Would there be any interest in creating such stack for Erlang ? > > The only concerns I am having are for performance reasons of such piece > of software. > > > Do you have any comments? > > > best regards, > Mateusz Berezecki > From francesco@REDACTED Fri Jan 18 10:58:23 2008 From: francesco@REDACTED (Francesco Cesarini) Date: Fri, 18 Jan 2008 09:58:23 +0000 Subject: [erlang-questions] Presentation: How do you test large systems written in Erlang? London 28/1 @ 19.00 Message-ID: <4790783F.4070709@erlang-consulting.com> Hi Erlang Mailing Listers, please note that this is the last public talk we will be posting to the erlang-questions list list. If interested in receiving notifications of future talks, please subscribe to the London Erlang User Group by sending a blank email to erlang-london-subscribe@REDACTED or visit http://uk.groups.yahoo.com/group/erlang-london/ Feel free to pass this on to anyone you believe might be interested. The second meet up of the Erlang User Group will be on Monday 28/1 @ 19.00 in Erlang Training and Consulting's offices in London. The meet up will feature a presentation from Thomas Arts, of Quviq AB and the IT University of Gothenburg. He will talk about testing large Erlang based systems, including formal methods and property based testing. The presentation will be followed by Pizza and drinks. Those still standing at 8pm can then make their way to a quiet pub down the road and continue chatting and networking. This is a free event sponsored by Erlang Training and Consulting and Skills Matter. As we need to let security have your names and need in advance, ensure we have a room big enough (There were 60 of us last meeting!), and most important, know how much Pizza to order, you have to register by sending an email to alison _at_ erlang-consulting.com The event is free and open to every one, as long as you have registered. Abstract: How do you test large systems written in Erlang? With the growth of software complexity we need new technology to ensure quality of the final product. Testing has so far been one of the most used techniques to check the quality of the end product. Since the amount of software configurations is huge for each product, testing all these configurations is impractical. Mathematical techniques under the name of formal methods, address this by tools as Model Checkers and Theorem Provers. Several of these techniques have been developed for Erlang as well as for many other languages. In practice, they are difficult to use and expensive to deploy. Property Based Testing joins the benefits of the formal verification techniques with the ease of testing. Instead of writing test cases, one copies the idea of formal methods to write a property of the software, e.g., "no matter how many ATMs are connected to our bank and no matter in which order the ATMs send their messages, money may not dissapear from the system". Instead of a mathematical prove that this holds, a large amount of test cases is automatically generated from this property and all these tests are checked against the system. Property Based Testing is used small scale today at companies like Ericsson, Erlang Training and Consulting and a few others. The goal of the ProTest project is to introduce more tools and techniques that enable widened use of Property Based Testing. For example by combining it with re-factoring of test cases and properties, by connecting it to trace analysis and audit logs, and by integrating it with model checking techniques. This will result in a very powerful method supported by a good set of integrated tools that make Erlang programmers even more productive. Bio: Thomas Arts Dr Thomas Arts is Associate professor at the IT University of G?teborg in the area of Software Engineering and Management. Thomas is also co-founder and CTO of Quviq, a small company that produced Quick Check, a testing tool for Erlang. He holds a PhD in computer science and has after his PhD been employed at the Ericsson Computer Science Lab (Where they invented Erlang) where he worked on program verification and the development of the Erlang programming language. He has worked in the broad spectrum theoretical computer science, formal methods and industrial case-study research, mainly applying all kind of techniques to systems written in Erlang. He has more than 30 publications in journals and refereed conferences/workshops. He has successfully introduced some new technologies in industry. The latest technology, QuickCheck, is a tool for property based testing and aims to support test driven development. From erlang@REDACTED Fri Jan 18 17:35:46 2008 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 18 Jan 2008 17:35:46 +0100 Subject: [erlang-questions] help: Erlang MIDI driver for MAC OS X Message-ID: <9b08084c0801180835t66de7a49x430fe89f5aa9bd71@mail.gmail.com> Hello, I'm trying to write an Erlang midi driver to connect an external Roland Synthesizer (SH-201) to a MacBook. So far I can receive MIDI events from the synt but not send events. Does anybody have any experience with the Mac OS X CoreAudio Framework in particular with the CoreMIDI routines? /Joe Armstrong From visionary_synthesis@REDACTED Fri Jan 18 16:48:24 2008 From: visionary_synthesis@REDACTED (001001 001011) Date: Fri, 18 Jan 2008 07:48:24 -0800 (PST) Subject: [erlang-questions] inets & EWSAPI Message-ID: <816861.48261.qm@web39506.mail.mud.yahoo.com> Dear Erlang-Community! i have a very basic question regarding the EWSAPI. i was able to start the webserver from the inets-example directory and was served the index-page in the htdocs-folder. i created a link from the login page to my own .html file containing several forms (method=post) that are submitted. and now i'm stuck. what is the best way to create an entry point to the EWSAPI modules in order to handle the request? any suggestions or simple examples to fill my gap? thanx a lot in advance, Theo P. --------------------------------- Looking for last minute shopping deals? Find them fast with Yahoo! Search. -------------- next part -------------- An HTML attachment was scrubbed... URL: From per.gustafsson@REDACTED Fri Jan 18 18:26:06 2008 From: per.gustafsson@REDACTED (Per Gustafsson) Date: Fri, 18 Jan 2008 18:26:06 +0100 Subject: [erlang-questions] Speeding up text file I/O In-Reply-To: <478344CD.2090601@gmail.com> References: <87hchpg3vh.fsf@mid.deneb.enyo.de> <47823523.8070000@gmail.com> <47824AC7.8000203@it.uu.se> <478344CD.2090601@gmail.com> Message-ID: <4790E12E.7010809@it.uu.se> Dmitrii 'Mamut' Dimandt wrote: > Per Gustafsson wrote: >> Christian S wrote: >>> Do you know if this has been benchmarked against the more attractive >>> code >>> that R12B makes more efficient? Because those functions make me want to >>> change profession to something where you get to hurt people. >>> >> >> >> >> I found that the following function is about 10% faster then the >> unrolled function when using BEAM R12B: >> >> find_8(Buffer, Char, Pos) -> >> case Buffer of >> << Char, _/bits >> -> Pos; >> << _, Rest/bits >> -> >> find_8(Rest, Char, Pos+1); >> _ -> >> not_found >> end. >> >> It might depend a little on the input though and when both functions >> were native compiled there was no major difference between them. >> >> Per > > Here's the reply: > > """start quote"" > > This is incorrect. My unrolled function is twice as fast as the > one-liner when it is compiled with the native flag (I didn't translate > the flag part - my bad, D.) The number of lines has been carefully > measured through various tests. > > Without the native flag there shouldn't be a significant difference in > speed. That's because unrolling only helps the machine code for > superpiplined processors. Since the VM isn't superpiplined there's not > much point in unrolling the loop > > The only simplification that can be done for R12 is: > > find_8( Buffer, Char, Pos ) -> > case Buffer of > << Char:8, _/bytes >> -> Pos; > << _:1/bytes, Char:8, _/bytes >> -> Pos + 1; > << _:2/bytes, Char:8, _/bytes >> -> Pos + 2; > ... > << _:32/bytes, Rest/bytes >> -> find_8( Rest, Char, Pos + 32 ); > _ -> not_found > end. > > That's it. > > > """end quote""" > > Sorry for missing the "compile with the native flag" in my translation I've been away for a while so sorry for being so slow to respond. It is true that the unrolled version is faster when compiling with the native flag. It does not however have to do with processor architecture but with a performance problem for the new binary optimizations when compiling to native code. I've fixed this problem in the HiPE-repository and the fix will be included in the next release of Erlang/OTP. With this fix the shorter version of the program is significantly faster than the unrolled one (about 50 % faster in that specific part of the program and the whole program becomes about 20-25 % faster) Per From chandrashekhar.mullaparthi@REDACTED Fri Jan 18 18:17:14 2008 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Fri, 18 Jan 2008 17:17:14 +0000 Subject: [erlang-questions] inets & EWSAP In-Reply-To: <816861.48261.qm@web39506.mail.mud.yahoo.com> References: <816861.48261.qm@web39506.mail.mud.yahoo.com> Message-ID: On 18/01/2008, 001001 001011 wrote: > Dear Erlang-Community! > > i have a very basic question regarding the > EWSAPI. i was able to start the webserver > from the inets-example directory and was > served the index-page in the htdocs-folder. > > i created a link from the login page to my > own .html file containing several forms > (method=post) that are submitted. > > and now i'm stuck. what is the best way to > create an entry point to the EWSAPI modules > in order to handle the request? > In your configuration file for the inets application, include the ErlScriptAlias directive and list all modules which are allowed to be invoked via HTTP. Once that is done, and URL of the form: http://server:port/cgi-bin/erl/Module/Function?args will result in the function Module:Function/2 being invoked. cheers Chandru From dmitriid@REDACTED Sat Jan 19 08:22:30 2008 From: dmitriid@REDACTED (Dmitrii 'Mamut' Dimandt) Date: Sat, 19 Jan 2008 09:22:30 +0200 Subject: [erlang-questions] Speeding up text file I/O In-Reply-To: <4790E12E.7010809@it.uu.se> References: <87hchpg3vh.fsf@mid.deneb.enyo.de> <47823523.8070000@gmail.com> <47824AC7.8000203@it.uu.se> <478344CD.2090601@gmail.com> <4790E12E.7010809@it.uu.se> Message-ID: <4791A536.20807@gmail.com> Per Gustafsson wrote: > Dmitrii 'Mamut' Dimandt wrote: >> Per Gustafsson wrote: >>> Christian S wrote: >>>> Do you know if this has been benchmarked against the more >>>> attractive code >>>> that R12B makes more efficient? Because those functions make me >>>> want to >>>> change profession to something where you get to hurt people. >>>> >>> >>> >>> >>> I found that the following function is about 10% faster then the >>> unrolled function when using BEAM R12B: >>> >>> find_8(Buffer, Char, Pos) -> >>> case Buffer of >>> << Char, _/bits >> -> Pos; >>> << _, Rest/bits >> -> >>> find_8(Rest, Char, Pos+1); >>> _ -> >>> not_found >>> end. >>> >>> It might depend a little on the input though and when both functions >>> were native compiled there was no major difference between them. >>> >>> Per >> >> Here's the reply: >> >> """start quote"" >> >> This is incorrect. My unrolled function is twice as fast as the >> one-liner when it is compiled with the native flag (I didn't >> translate the flag part - my bad, D.) The number of lines has been >> carefully measured through various tests. >> >> Without the native flag there shouldn't be a significant difference >> in speed. That's because unrolling only helps the machine code for >> superpiplined processors. Since the VM isn't superpiplined there's >> not much point in unrolling the loop >> >> The only simplification that can be done for R12 is: >> >> find_8( Buffer, Char, Pos ) -> >> case Buffer of >> << Char:8, _/bytes >> -> Pos; >> << _:1/bytes, Char:8, _/bytes >> -> Pos + 1; >> << _:2/bytes, Char:8, _/bytes >> -> Pos + 2; >> ... >> << _:32/bytes, Rest/bytes >> -> find_8( Rest, Char, Pos + 32 ); >> _ -> not_found >> end. >> >> That's it. >> >> >> """end quote""" >> >> Sorry for missing the "compile with the native flag" in my translation > > I've been away for a while so sorry for being so slow to respond. > > It is true that the unrolled version is faster when compiling with the > native flag. It does not however have to do with processor > architecture but with a performance problem for the new binary > optimizations when compiling to native code. > > I've fixed this problem in the HiPE-repository and the fix will be > included in the next release of Erlang/OTP. With this fix the shorter > version of the program is significantly faster than the unrolled one > (about 50 % faster in that specific part of the program and the whole > program becomes about 20-25 % faster) > > Per > Nice! Actually, the author of the blog post I translated said he's going to propose an EEP that includes both the fast input adn the fast output function that could be included in Erlang. He said that if the functions he's going to propose are included on the low level, you could get even faster read/write speeds. Though 20 MB/s is already fine by me :) From jim.mccoy@REDACTED Sat Jan 19 06:43:37 2008 From: jim.mccoy@REDACTED (Jim McCoy) Date: Fri, 18 Jan 2008 21:43:37 -0800 Subject: [erlang-questions] gen_server equivalent of "after"? Message-ID: In a standard receive loop it is fairly obvious how to set up a timeout within the loop. When using gen_server this becomes opaque to the point that I am wondering if it is even possible. I have a gen_server module set up to handle a task, but I want it to do some action if no messages are received within a certain amount of time. Do I really have to spawn another process just to trigger these events or am I missing something? jim From launoja@REDACTED Sat Jan 19 10:25:29 2008 From: launoja@REDACTED (Jani Launonen) Date: Sat, 19 Jan 2008 11:25:29 +0200 Subject: [erlang-questions] gen_server equivalent of "after"? In-Reply-To: References: Message-ID: <408C5C79-724A-493D-82CF-8397637863CB@omanetti.fi> Hello! Jim McCoy kirjoitti 19.1.2008 kello 7.43: > > In a standard receive loop it is fairly obvious how to set up a > timeout within the loop. When using gen_server this becomes opaque to > the point that I am wondering if it is even possible. I have a > gen_server module set up to handle a task, but I want it to do some > action if no messages are received within a certain amount of time. > Do I really have to spawn another process just to trigger these events > or am I missing something? You should return {reply, Reply, NewState, Timeout} from handle_call (similarly from handle_cast and handle_info if that's what you want) if you expect the next call to happen in Timeout milliseconds. If it does not, handle_info(timeout, State) will be called. Cheers, Jani > > jim > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From rvirding@REDACTED Sat Jan 19 17:27:48 2008 From: rvirding@REDACTED (Robert Virding) Date: Sat, 19 Jan 2008 17:27:48 +0100 Subject: [erlang-questions] Erlounge in San Francisco, 17-22 February Message-ID: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> I will be in San Francisco 17-22 of February (actually from the 16th) for a conference* and if there are any other Erlangers there perhaps we could meet over a beer and have a nice discussion. Let me know and we can arrange something. Robert *Game Developers Conference which until recently has had very little to do with Erlang, they're all C++ weenies. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevin@REDACTED Sat Jan 19 18:10:39 2008 From: kevin@REDACTED (Kevin A. Smith) Date: Sat, 19 Jan 2008 12:10:39 -0500 Subject: [erlang-questions] Erlounge in Chicago Feb 12-14 Message-ID: <591437DF-8ED5-4B09-905F-FD7D50096AA5@hypotheticalabs.com> I'm going to be in Chicago Feb 12 - 14 for the PragProg Erlang Studio. I'd love to meet any fellow Erlangers in the area maybe for a bite of dinner or a couple of pints. Drop me a line and well see what we can arrange. --Kevin From dae@REDACTED Sat Jan 19 18:42:53 2008 From: dae@REDACTED (Doug Edmunds) Date: Sat, 19 Jan 2008 09:42:53 -0800 Subject: [erlang-questions] [RE] Case insensitivity - Windows trap or bug? In-Reply-To: <20080116041335.HM.000000000000027@eajam.bos-mail-wwl1.lycos.com> References: <20080116041335.HM.000000000000027@eajam.bos-mail-wwl1.lycos.com> Message-ID: <4792369D.7040203@douglasedmunds.com> Hi Alex, Erlang-under-Cygwin might not be the cure that you think it is: Go back to my original scenario: A file named myTest.erl. No file named mytest.erl You got this result: > 2> c(mytest). > ** Module name 'myTest' does not match file name 'mytest' ** > {error,badfile} c/1 has two phases, first it compiles the erl file ( creating a beam file), then it tries to load the beam file. The message {error,badfile} is generated during the load phase and doesn't reach the issue. I get the same result using Erlang-under-XP. The focus of the issue is the compile phase. If Erlang-under-Cygwin were trapping 'mytest.erl' as a non- existent file (i.e. in a case sensitive way), it would generate a different error message, something like this: 7> c(badspelling). ./badspelling.erl:none: no such file or directory error But it didn't generate that error. Please put myTest.erl in an empty directory, then using Erlang-under-Cygwin, run c(mytest) with all small letters. Now look in the directory. Did Erlang-under-Cygwin create a beam file? My guess is that it does AND that it is named mytest.erl. -- Doug Edmunds > > I can at least tell you that in Windows via Cygwin (pretty much acting > like a Unix system) does gives out an error, as it should. > > 1> c(myTest). > {ok,myTest} > 2> c(mytest). > ** Module name 'myTest' does not match file name 'mytest' ** > {error,badfile} > > The behavior you're experiencing is Window SOP. The deal with Unix or > Unix-like systems is that you can have file 'test.erl' and also file > 'Test.erl,' but not in Windows, as they would be exactly the same file > (even under Cygwin). Hence, there's no problem! > > Cheers, Alex > > > > ---------[ Received Mail Content ]---------- > > *Subject : *[erlang-questions] Case insensitivity - Window! s trap > or bug? > > *Date : *Tue, 15 Jan 2008 13:14:04 -0800 > > *From : *Doug Edmunds > > *To : *erlang-questions@REDACTED > > > > The Erlang compiler assumes that filenames are > > case sensitive. It does not check the existence > > of a file based on a case-sensitive spelling. > > But Windows filenames are not case sensitive. > > This can lead to unexpected results. > > > > (I don't have a *nix system to check this on. I > > assume this is a Windows-only problem.) > > > > ------ > > Assume this scenario: > > (note the spelling, a capital T in both file name and module). > > > > a file named: myTest.erl > > containing a module: -module(myTest). > > > > > compile:file(myTest). > > produces myTest.beam > > > > So far so good. > > > > ------ > > > > An inadvertent typo can cause unexpected results > > which are not flagged b! y the compiler (in Windows): > > > > 1. > > > > > co mpile:file(mytest). %% case insensitive input accepted. > > {ok,myTest} %% note difference between input and output > > > > What is the filename just created? > > 'mytest.beam', not 'myTest.beam' > > > > Any errors or warnings? No. > > > > > > ---- > > > > 2. Having done step 1, things can become very strange: > > Remember, the name of the beam file is mytest.beam. > > There is no myTest.beam. > > > > > code:file_load(myTest). > > {module,myTest} %% loads > > > > > > 3. But this doesn't work: > > > > >code:file_load(mytest). > > > > =ERROR REPORT==== 15-Jan-2008::09:56:50 === > > beam/beam_load.c(1035): Error loading module mytest: > > module name in object code is myTest > > > > > > =ERROR REPORT==== 15-Jan-2008::09:56:50 === > > Loading of c:/erl_dae2/compile sensitivity bugs/mytest.beam failed: > badfile > > {error,badfile} > > > > --------! - > > > > Running erlc from a DOS shell, has the same problems. > > erlc ignores case, and compiles a beam > > file that does not match the internal module name. > > > > erlc mytest.erl %% erlc accepts this filename in Windows > > > > produces mytest.beam from myTest.erl without any warning. > > The mytest.beam will have the same usage issues as indicated > > above (it will contain a module name 'myTest' and will not load. > > > > ------------------- > > I think of these as bugs. Other Erlang functions > > can capture/retain filename case sensitivity in Windows. > > (c:ls/0, for example reports myTest.erl). You won't change > > Windows. The Erlang compiler functions need to test > > for file existence based on case-sensitivity. > > > > Doug Edmunds > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erl! ang.org/mailman/listinfo/erlang-questions > > < /td> > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From dae@REDACTED Sat Jan 19 19:30:22 2008 From: dae@REDACTED (Doug Edmunds) Date: Sat, 19 Jan 2008 10:30:22 -0800 Subject: [erlang-questions] [RE] Case insensitivity - Windows trap or bug? In-Reply-To: <20080116041335.HM.000000000000027@eajam.bos-mail-wwl1.lycos.com> References: <20080116041335.HM.000000000000027@eajam.bos-mail-wwl1.lycos.com> Message-ID: <479241BE.20702@douglasedmunds.com> Alex: I hit that send button too soon. Re-reading your email, I see you are not advocating Cygwin over XP, instead pointing out the similar results. My apologies. However, I disagree that there is no problem. It seems like Erlang asks Windows: "Do you have a file named mytest.erl?", and Windows being case-insensitive, sees myTest.erl, and says "yes". Since Erlang is going to use that filename in a case-sensitive manner when compiling it, it should check what Windows gave it, and say "Wait, this isn't 'mytest.erl', this is 'myTest.erl'" and generate an error message. - Doug Edmunds From mateuszb@REDACTED Sat Jan 19 22:35:45 2008 From: mateuszb@REDACTED (Mateusz Berezecki) Date: Sat, 19 Jan 2008 22:35:45 +0100 Subject: [erlang-questions] bug: internal error in v3_codegen Message-ID: Hello list, I am both sorry and amused of reporting this error, as I sort of have really unlucky day when it comes to erlang. I don't know if it was reported before or not, but here it is Function: set_bit/2 ./bitmap.erl:none: internal error in v3_codegen; crash reason: {{case_clause, {'EXIT', {function_clause, [{v3_codegen,fetch_reg,[ker1,[]]}, {v3_codegen,move_unsaved,4}, {v3_codegen,cg_call_args,4}, {v3_codegen,cg_setup_call,4}, {v3_codegen,break_cg,5}, {v3_codegen,'-cg_list/5-anonymous-0-',3}, {v3_codegen,flatmapfoldl,3}, {v3_codegen,cg_list,5}]}}}, [{compile,'-select_passes/2-anonymous-2-',2}, {compile,'-internal_comp/4-anonymous-1-',2}, {compile,fold_comp,3}, {compile,internal_comp,4}, {compile,internal,3}]} the code is after the e-mail best regards, Mateusz Berezecki -module (bitmap). -author ('Mateusz Berezecki'). -export ([gen_bit/2, set_bit/2, clr_bit/2]). -export ([intersection/4]). -define (BITMAP_SIZE, 120*8). gen_bit(0, Acc) -> Acc; gen_bit(N, Acc) when is_integer(N), N > 0 -> gen_bit(N-1, <>). intersection(<<>>, <<>>, _, Acc) -> Acc; intersection(<>, <>, K, Acc) -> intersection(Rest1, Rest2, K+1, [K | Acc]); intersection(<>, <>, K, Acc) -> intersection(Rest1, Rest2, K+1, Acc). % sets bit K in the Bitmap set_bit(<>, K) when is_integer(K) andalso bit_size(Bitmap) >= K andalso 0 < K -> Before = K-1, After = bit_size(Bitmap) - K, <> = Bitmap, <>. % clears bit K in the Bitmap clr_bit(<>, K) when is_integer(K) andalso bit_size(Bitmap) >= K andalso 0 < K -> Before = K-1, After = bit_size(Bitmap) - K, <> = Bitmap, <>. %from_list(L) when is_list(L), length(L) <= ?BITMAP_SIZE -> From travis.jensen@REDACTED Sun Jan 20 01:52:00 2008 From: travis.jensen@REDACTED (Travis Jensen) Date: Sat, 19 Jan 2008 17:52:00 -0700 Subject: [erlang-questions] Erlounge in San Francisco, 17-22 February In-Reply-To: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> References: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> Message-ID: On Jan 19, 2008, at 9:27 AM, Robert Virding wrote: > > *Game Developers Conference which until recently has had very little > to do with Erlang, they're all C++ weenies. So this piqued my interested. Does this imply that things are changing in that regard? tj Travis Jensen travis.jensen@REDACTED http://softwaremaven.innerbrane.com/ You should read my blog; it is more interesting than my signature. From bob@REDACTED Sun Jan 20 02:09:49 2008 From: bob@REDACTED (Bob Ippolito) Date: Sat, 19 Jan 2008 17:09:49 -0800 Subject: [erlang-questions] Erlounge in San Francisco, 17-22 February In-Reply-To: References: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> Message-ID: <6a36e7290801191709x2fd24521tdd8442aeb9121a7b@mail.gmail.com> On Jan 19, 2008 4:52 PM, Travis Jensen wrote: > > On Jan 19, 2008, at 9:27 AM, Robert Virding wrote: > > > > > *Game Developers Conference which until recently has had very little > > to do with Erlang, they're all C++ weenies. > > So this piqued my interested. Does this imply that things are > changing in that regard? > Well, there's at least one publicly known game server written in Erlang: Vendetta Online. One is better than zero :) We're using Erlang to run an ad network for Flash games (amongst other things), and some of us will be at GDC as well. -bob From brianorourke@REDACTED Sun Jan 20 02:12:09 2008 From: brianorourke@REDACTED (Brian P O'Rourke) Date: Sat, 19 Jan 2008 17:12:09 -0800 Subject: [erlang-questions] Erlounge in San Francisco, 17-22 February In-Reply-To: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> References: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> Message-ID: <314648e0801191712l6a62bc2ax254357c5f01a9cfa@mail.gmail.com> 2008/1/19 Robert Virding : > I will be in San Francisco 17-22 of February (actually from the 16th) for a > conference* and if there are any other Erlangers there perhaps we could meet > over a beer and have a nice discussion. Let me know and we can arrange > something. I'd be interested. Love to hear what you're doing with games and Erlang as well. There's a Bay Area Erlang group on Google Groups for this sort of thing: http://groups.google.com/group/bay-area-erlangers > > Robert > > *Game Developers Conference which until recently has had very little to do > with Erlang, they're all C++ weenies. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bob@REDACTED Sun Jan 20 02:28:43 2008 From: bob@REDACTED (Bob Ippolito) Date: Sat, 19 Jan 2008 17:28:43 -0800 Subject: [erlang-questions] Erlounge in San Francisco, 17-22 February In-Reply-To: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> References: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> Message-ID: <6a36e7290801191728g5fc87f8clcf67cba8f6420618@mail.gmail.com> 2008/1/19 Robert Virding : > I will be in San Francisco 17-22 of February (actually from the 16th) for a > conference* and if there are any other Erlangers there perhaps we could meet > over a beer and have a nice discussion. Let me know and we can arrange > something. > We could do something at or near the Mochi Media office, which is very close to GDC, so presumably it would be convenient for you. We're also throwing a party for GDC, I'll make sure you get an invite. I'll figure out the details next week when I'm back in the office (not personally part of the party planning committee :) -bob From paulrbrown@REDACTED Sun Jan 20 06:32:45 2008 From: paulrbrown@REDACTED (Paul Brown) Date: Sat, 19 Jan 2008 21:32:45 -0800 Subject: [erlang-questions] VM not able to use available cores Message-ID: <5748B18A-9E5E-4868-B8E4-BF8CEECA7918@gmail.com> EQ -- On a somewhat random lark, I decided to fire up the "big.erl" exerciser on a new box (8 cores, Xeon, Mac OS 10.5, R12B) that replaced an old box (4 cores, PPC G5, Mac OS 10.4, R11B), and the initial returns were surprising -- the 8-core box exhibited more or less equivalent performance to the 4-core... (Pretty graphs, links to big.erl source I used, etc., are here - http://mult.ifario.us/p/use-the-cores-erl A little more digging, and it turned out that the VM was only able to use the equivalent of 3 cores worth of CPU cycles, no matter how many schedulers I ran from the command line. Two VMs does a reasonable job of using all 8 cores worth of cycles, but I'm left with the question of why a single VM couldn't use more cores. Any thoughts? -- Paul From matthias@REDACTED Sun Jan 20 09:16:08 2008 From: matthias@REDACTED (Matthias Lang) Date: Sun, 20 Jan 2008 09:16:08 +0100 Subject: [erlang-questions] VM not able to use available cores In-Reply-To: <5748B18A-9E5E-4868-B8E4-BF8CEECA7918@gmail.com> References: <5748B18A-9E5E-4868-B8E4-BF8CEECA7918@gmail.com> Message-ID: <18323.840.66990.79765@antilipe.corelatus.se> Hi, You're measuring the performance of processes which do no useful work and which all communicate a lot with everything else. Such a set up makes it likely a lock somewhere will dominate. Perhaps there's a lock on each process' message queue and the CPUs spend most of their time fighting over those N locks. If so, then partitioning the problem can be expected to completely change the results. Micro benchmarks such as this one tend to spawn thickets of clueless long-winded speculation. I've tried to keep mine short. Matt ---------------------------------------------------------------------- Paul Brown writes: > > EQ -- > > On a somewhat random lark, I decided to fire up the "big.erl" > exerciser on a new box (8 cores, Xeon, Mac OS 10.5, R12B) that > replaced an old box (4 cores, PPC G5, Mac OS 10.4, R11B), and the > initial returns were surprising -- the 8-core box exhibited more or > less equivalent performance to the 4-core... (Pretty graphs, links to > big.erl source I used, etc., are here - http://mult.ifario.us/p/use-the-cores-erl > > A little more digging, and it turned out that the VM was only able to > use the equivalent of 3 cores worth of CPU cycles, no matter how many > schedulers I ran from the command line. Two VMs does a reasonable job > of using all 8 cores worth of cycles, but I'm left with the question > of why a single VM couldn't use more cores. > > Any thoughts? > > -- Paul > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bjorn@REDACTED Sun Jan 20 11:00:56 2008 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 20 Jan 2008 11:00:56 +0100 Subject: [erlang-questions] bug: internal error in v3_codegen In-Reply-To: References: Message-ID: Mateusz Berezecki writes: > Hello list, > > I am both sorry and amused of reporting this error, as I sort of have > really > unlucky day when it comes to erlang. I don't know if it was reported > before or not, > but here it is Thanks for bug report. I sure am lucky to have received so many good bug reports for the compiler after R12B-0 release. :-) I hope that the rest of your day was more lucky when it came to Erlang. :-) I'll start working on fixing the bug tomorrow. If the fix isn't too complicated, I will probably post a patch. A workaround for the particular problem is to replace 'andalso' with ','. As far as I understand (without running the code), in this particular case the result should be exactly the same. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From Dmitri.Girenko@REDACTED Sun Jan 20 12:19:55 2008 From: Dmitri.Girenko@REDACTED (Dmitri Girenko) Date: Sun, 20 Jan 2008 13:19:55 +0200 Subject: [erlang-questions] clarify: qlc, mnesia and unique_all Message-ID: <697074A35ED91748882E3850BDCE295E06C58A@leenu.akumiitti.net> Hi all, I am having strange problems with qlc's unique_all option. Here is the test code: -module(test). -export([test/0]). -include_lib("stdlib/include/qlc.hrl"). test()-> mnesia:start(), mnesia:create_table(t,[]), [mnesia:dirty_write({t, I, I div 2}) || I <- lists:seq(1,10)], Q1=qlc:q([element(3,T) || T <- mnesia:table(t)]), exec(fun() -> qlc:e(Q1) end), exec(fun() -> qlc:e(Q1, unique_all) end), exec(fun() -> qlc:e(qlc:sort(Q1), unique_all) end), exec(fun() -> qlc:e(qlc:sort(qlc:e(Q1)), unique_all) end). exec(F)-> {atomic, R} = mnesia:transaction(F), io:format("~p~n", [ R ]). And here is the outpit: [0,5,1,1,4,2,2,3,3,4] [0,5,1,1,4,2,2,3,3,4] [0,1,1,2,2,3,3,4,4,5] [0,1,2,3,4,5] So it looks like if the argument to qlc:sort is a mnesia query handle, then all the elements are returned. If it's a list, then only unique value are returned. Does the {unique, true} flag concern only records, but no the result values? runtime version is R11B-5 Best regards, Dmitri From mateuszb@REDACTED Sun Jan 20 17:19:12 2008 From: mateuszb@REDACTED (Mateusz Berezecki) Date: Sun, 20 Jan 2008 17:19:12 +0100 Subject: [erlang-questions] bug: internal error in v3_codegen In-Reply-To: References: Message-ID: <666B9BFE-EE39-4CEA-A0B2-DCFBBA90F07F@gmail.com> On Jan 20, 2008, at 11:00 AM, Bjorn Gustavsson wrote: > Mateusz Berezecki writes: > >> Hello list, >> >> I am both sorry and amused of reporting this error, as I sort of have >> really >> unlucky day when it comes to erlang. I don't know if it was reported >> before or not, >> but here it is > > Thanks for bug report. I sure am lucky to have received so many > good bug reports for the compiler after R12B-0 release. :-) > I hope that the rest of your day was more lucky when it came to > Erlang. :-) Sort of :-) That's the another bug I had encountered during that day. I just did not note it down so had to "reinvent" it again. test: function test/1+11: Internal consistency check failed - please report this bug. Instruction: {bs_append,{f,0}, {integer,0}, 0,1,1, {x,0}, {field_flags,[]}, {x,1}} Error: {match_context,{x,0}}: ./test.erl:7: Warning: variable 'Bin' is unused the smallest test case I managed to make is -module(test). -export([test/1]). test(<<>>) -> ok; test(<>) -> test(<>). And yes, I know how to work around this bug but still reporting it :) best regards, Mateusz Berezecki From roger.larsson@REDACTED Sun Jan 20 21:43:42 2008 From: roger.larsson@REDACTED (Roger Larsson) Date: Sun, 20 Jan 2008 21:43:42 +0100 Subject: [erlang-questions] VM not able to use available cores In-Reply-To: <5748B18A-9E5E-4868-B8E4-BF8CEECA7918@gmail.com> References: <5748B18A-9E5E-4868-B8E4-BF8CEECA7918@gmail.com> Message-ID: <200801202143.42868.roger.larsson@e-gatan.se> On s?ndag 20 januari 2008, Paul Brown wrote: > EQ -- > > - - - > Any thoughts? No yet, more data is needed. Do you have 'vmstat 2' output (or equivalent) Ohh, and what does Erlang reply when you start it from the command line? Any hints there? /RogerL From archevis@REDACTED Mon Jan 21 00:32:23 2008 From: archevis@REDACTED (John M. Nordgaard) Date: Mon, 21 Jan 2008 00:32:23 +0100 (CET) Subject: [erlang-questions] driver_output works, driver_output_term doesn't Message-ID: <3797.192.168.2.11.1200871943.squirrel@www.cyber.no> Hi all, I have written a small linked-in driver which needs to return some fairly complex data. So I'd like to use driver_output_term for the job. However, I cannot get it to work. More precisely, I never receive a response from the C code, even when running this simple example: ErlDrvTermData t[] = { ERL_DRV_ATOM, driver_mk_atom("unknown") }; driver_output_term(dd->port, t, size(t) / size(t[0])); On the Erlang side 'receive' simply hangs. Strange thing is, replacing the above with the following code I do in fact receive a response of [0]: char res = 0; driver_output(dd->port, &res, 1); It would seem that dd->port as such should be off the hook at this point, given that it works for 'driver_output'. Question is, am I wrong? Or is there any other reason why 'driver_output_term' would not work, perhaps a missing control flag or some other form of setting? My system is Gentoo Linux amd64, running 12B-0 with hipe. All suggestions appreciated! :-) - john. From yarivsadan@REDACTED Mon Jan 21 00:35:27 2008 From: yarivsadan@REDACTED (Yariv Sadan) Date: Sun, 20 Jan 2008 15:35:27 -0800 Subject: [erlang-questions] Erlounge in San Francisco, 17-22 February In-Reply-To: <6a36e7290801191728g5fc87f8clcf67cba8f6420618@mail.gmail.com> References: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> <6a36e7290801191728g5fc87f8clcf67cba8f6420618@mail.gmail.com> Message-ID: <17244f480801201535t791b24cfi3ac7f83056a2263d@mail.gmail.com> Count me in! Yariv On Jan 19, 2008 5:28 PM, Bob Ippolito wrote: > 2008/1/19 Robert Virding : > > I will be in San Francisco 17-22 of February (actually from the 16th) for a > > conference* and if there are any other Erlangers there perhaps we could meet > > over a beer and have a nice discussion. Let me know and we can arrange > > something. > > > > We could do something at or near the Mochi Media office, which is very > close to GDC, so presumably it would be convenient for you. > > We're also throwing a party for GDC, I'll make sure you get an invite. > I'll figure out the details next week when I'm back in the office (not > personally part of the party planning committee :) > > -bob > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From jay@REDACTED Mon Jan 21 01:21:17 2008 From: jay@REDACTED (Jay Nelson) Date: Sun, 20 Jan 2008 16:21:17 -0800 Subject: [erlang-questions] Erlounge in San Francisco, 17-22 February Message-ID: Monday, Feb 18 is a holiday (President's Day) at our office and I am already planning to take Friday, Feb 15 off. If you guys get together Sat, Sun or Monday, I'll drive up from Los Angeles with my family for a weekend vacation. So that's a vote for earlier in the week, rather than later. jay From paulrbrown@REDACTED Mon Jan 21 08:01:56 2008 From: paulrbrown@REDACTED (Paul Brown) Date: Sun, 20 Jan 2008 23:01:56 -0800 Subject: [erlang-questions] VM not able to use available cores In-Reply-To: <200801202143.42868.roger.larsson@e-gatan.se> References: <5748B18A-9E5E-4868-B8E4-BF8CEECA7918@gmail.com> <200801202143.42868.roger.larsson@e-gatan.se> Message-ID: <2CD53121-F132-44F0-8DF3-8FD7BE80E39B@gmail.com> On Jan 20, 2008, at 12:43 PM, Roger Larsson wrote: > On s?ndag 20 januari 2008, Paul Brown wrote: >> EQ -- >> >> - - - >> Any thoughts? > No yet, more data is needed. > Do you have 'vmstat 2' output (or equivalent) I used top a bit during the run, and there's a screenshot of the Mac OS X system monitoring GUI application at the previously posted URL. Both show a 60-70% idle CPU with no paging or other issues. (The machine has a substantial amount of RAM.) > Ohh, and what does Erlang reply when you start it > from the command line? Any hints there? I don't think anything is out of line: $ erl Erlang (BEAM) emulator version 5.6 [source] [smp:8] [async-threads:0] [hipe] [kernel-poll:false] I did try some different build configurations without getting significantly different results. -- Paul From amritpal.singh@REDACTED Mon Jan 21 08:52:46 2008 From: amritpal.singh@REDACTED (Amritpal Singh) Date: Mon, 21 Jan 2008 13:22:46 +0530 Subject: [erlang-questions] How to use Mnesia Database from C/C++/Java ? Message-ID: <003d01c85c02$9cc008e0$d6401aa0$@singh@cellebrum.com> Dear All, I am completely novice to Erlang, though have been working into telecom domain for quite some time. I have some of my applications like SMSC and others which need temporary data-storage written in C. Till date, i have been using relational databases like 'MySQL/Oracle' for temporary storage purpose. Because of performance constraints i need to shift this temporary storage to some in-memory database. >From initial overview, 'MNESIA' seems to be perfect replacement for my scenario. Have installed the same and tried to access the same from 'Erlang' , thankfully , have got the success in doing the same. Now, my problem is , i don't want to change the core of my application which is already encoded in 'C' , so need to access 'Mnesia DB' from 'C'. As per my findings, there are no ODBC drivers available for Mnesia. So, think need to have some kind of external interface to 'Erlang' like 'Erl_Interface' which i can use from 'C' program to interact with 'Mnesia DB'. I just want to know if someone has worked on such kind of architecture ? If yes, can u please share your valuable experiences ? If no, how feasible and reliable does it seem to you ? Waiting for your valuable inputs. Thanks and Regards, Amritpal Singh ________________________________ This message and its attachments contain confidential information and may also contain legally privileged information. This message is intended solely for the named addressee. If you are not the addressee indicated in this message (or authorized to receive for addressee), you may not copy or deliver any part of this message or its attachments to anyone or use any part of this message or its attachments. Rather, you should permanently delete this message and its attachments (and all copies) from your system and kindly notify the sender by reply e-mail. Any content of this message and its attachments that does not relate to the official business of Cellebrum.com Pvt Ltd or its affiliates and/or subsidiaries must be taken not to have been sent or endorsed by any of them. Opinions and information in this email that do not relate to the official business of Cellebrum.com Pvt Ltd, shall be understood as neither given nor endorsed by Cellebrum.com Pvt Ltd. Any action/proceeding/opportunity upon the contents of this email taken by not intended addressee shall attract liabilities both criminal and civil against such addressee. Email communications are not private and no warranty is made that e-mail communications are timely, secure or free from computer virus or other defect. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rapsey@REDACTED Mon Jan 21 09:53:40 2008 From: rapsey@REDACTED (Rapsey) Date: Mon, 21 Jan 2008 09:53:40 +0100 Subject: [erlang-questions] should be a parallel tcp server, but can't connect to more than 1 client Message-ID: <97619b170801210053r1f7f30e7geee0d3be6edf56d8@mail.gmail.com> All this program does is listen on a socket, spawn a new process on every connection and send a never ending stream of numbers to each client that connects to it. The problem is that once 1 client is connected, no one else can connect, even though a new acceptor process has been spawned. start() -> case gen_tcp:listen(6002, [binary, {packet, 0}, {active, true}, {reuseaddr, true}]) of {ok, Sock} -> spawn(fun() -> accept_conn(Sock) end); {error, Reason} -> {error, Reason} end. accept_conn(LSock) -> case gen_tcp:accept(LSock) of {ok, Sock} -> spawn(fun() -> accept_conn(LSock) end), handle_conn(Sock); _ -> true end. % wait for http request from browser handle_conn(Sock) -> receive {tcp, RecSock, Data} -> send_stream(RecSock, 0); {tcp_closed, _} -> true end. send_stream(Sock, N) when N == 0 -> gen_tcp:send(Sock, "HTTP/1.1 200 OK\r\nContent-type: text/html\r\n\r\nWOHOO
"), send_stream(Sock, N + 1); send_stream(Sock, N) -> case gen_tcp:send(Sock, integer_to_list(N)) of ok -> timer:sleep(1000), send_stream(Sock, N + 1); Any -> true end. thank you, Sergej -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Mon Jan 21 10:36:38 2008 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 21 Jan 2008 10:36:38 +0100 Subject: [erlang-questions] should be a parallel tcp server, but can't connect to more than 1 client In-Reply-To: <97619b170801210053r1f7f30e7geee0d3be6edf56d8@mail.gmail.com> References: <97619b170801210053r1f7f30e7geee0d3be6edf56d8@mail.gmail.com> Message-ID: <479467A6.6050202@ericsson.com> Greetings, When run on Solaris9/Erts5.5.5.5 your program works for at least 2 clients. Example: In xterm 1 ws67042> telnet localhost 6011 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. asd HTTP/1.1 200 OK Content-type: text/html WOHOO
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 In xterm 2 ws67042> telnet localhost 6011 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. asd HTTP/1.1 200 OK Content-type: text/html WOHOO
123456789101112131415161718192021222324252627 bengt Those were the days... EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." On 01/21/08 09:53, Rapsey wrote: > All this program does is listen on a socket, spawn a new process on > every connection and send a never ending stream of numbers to each > client that connects to it. The problem is that once 1 client is > connected, no one else can connect, even though a new acceptor process > has been spawned. > > > start() -> > case gen_tcp:listen(6002, [binary, {packet, 0}, {active, true}, > {reuseaddr, true}]) of > {ok, Sock} -> > spawn(fun() -> accept_conn(Sock) end); > {error, Reason} -> {error, Reason} > end. > > > accept_conn(LSock) -> > case gen_tcp:accept(LSock) of > {ok, Sock} -> > spawn(fun() -> accept_conn(LSock) end), > handle_conn(Sock); > _ -> > true > end. > > % wait for http request from browser > handle_conn(Sock) -> > receive > {tcp, RecSock, Data} -> > send_stream(RecSock, 0); > {tcp_closed, _} -> > true > end. > > send_stream(Sock, N) when N == 0 -> > gen_tcp:send(Sock, "HTTP/1.1 200 OK\r\nContent-type: > text/html\r\n\r\nWOHOO
"), > send_stream(Sock, N + 1); > send_stream(Sock, N) -> > case gen_tcp:send(Sock, integer_to_list(N)) of > ok -> > timer:sleep(1000), > send_stream(Sock, N + 1); > Any -> > true > end. > > > thank you, > Sergej > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From rapsey@REDACTED Mon Jan 21 10:43:14 2008 From: rapsey@REDACTED (Rapsey) Date: Mon, 21 Jan 2008 10:43:14 +0100 Subject: [erlang-questions] should be a parallel tcp server, but can't connect to more than 1 client In-Reply-To: <479467A6.6050202@ericsson.com> References: <97619b170801210053r1f7f30e7geee0d3be6edf56d8@mail.gmail.com> <479467A6.6050202@ericsson.com> Message-ID: <97619b170801210143q3709a18cg42e3c19f5b60f17f@mail.gmail.com> oh strange. It does work with telnet. Stupid me, I was trying it in a web browser. Thank you for your help. On Jan 21, 2008 10:36 AM, Bengt Kleberg wrote: > Greetings, > > When run on Solaris9/Erts5.5.5.5 your program works for at least 2 > clients. Example: > > In xterm 1 > ws67042> telnet localhost 6011 > Trying 127.0.0.1... > Connected to localhost. > Escape character is '^]'. > asd > HTTP/1.1 200 OK > Content-type: text/html > > > WOHOO
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 > > In xterm 2 > ws67042> telnet localhost 6011 > Trying 127.0.0.1... > Connected to localhost. > Escape character is '^]'. > asd > HTTP/1.1 200 OK > Content-type: text/html > > > WOHOO
123456789101112131415161718192021222324252627 > > > bengt > Those were the days... > EPO guidelines 1978: "If the contribution to the known art resides > solely in a computer program then the subject matter is not > patentable in whatever manner it may be presented in the claims." > > > On 01/21/08 09:53, Rapsey wrote: > > All this program does is listen on a socket, spawn a new process on > > every connection and send a never ending stream of numbers to each > > client that connects to it. The problem is that once 1 client is > > connected, no one else can connect, even though a new acceptor process > > has been spawned. > > > > > > start() -> > > case gen_tcp:listen(6002, [binary, {packet, 0}, {active, true}, > > {reuseaddr, true}]) of > > {ok, Sock} -> > > spawn(fun() -> accept_conn(Sock) end); > > {error, Reason} -> {error, Reason} > > end. > > > > > > accept_conn(LSock) -> > > case gen_tcp:accept(LSock) of > > {ok, Sock} -> > > spawn(fun() -> accept_conn(LSock) end), > > handle_conn(Sock); > > _ -> > > true > > end. > > > > % wait for http request from browser > > handle_conn(Sock) -> > > receive > > {tcp, RecSock, Data} -> > > send_stream(RecSock, 0); > > {tcp_closed, _} -> > > true > > end. > > > > send_stream(Sock, N) when N == 0 -> > > gen_tcp:send(Sock, "HTTP/1.1 200 OK\r\nContent-type: > > text/html\r\n\r\nWOHOO
"), > > send_stream(Sock, N + 1); > > send_stream(Sock, N) -> > > case gen_tcp:send(Sock, integer_to_list(N)) of > > ok -> > > timer:sleep(1000), > > send_stream(Sock, N + 1); > > Any -> > > true > > end. > > > > > > thank you, > > Sergej > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > 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 erlang@REDACTED Mon Jan 21 10:54:42 2008 From: erlang@REDACTED (Joe Armstrong) Date: Mon, 21 Jan 2008 10:54:42 +0100 Subject: [erlang-questions] should be a parallel tcp server, but can't connect to more than 1 client In-Reply-To: <97619b170801210053r1f7f30e7geee0d3be6edf56d8@mail.gmail.com> References: <97619b170801210053r1f7f30e7geee0d3be6edf56d8@mail.gmail.com> Message-ID: <9b08084c0801210154q2e240c2ex8c17cc2489f9e2a5@mail.gmail.com> What might have happened here is that the process owning the listening socket has died. Sockets are owned by the process that creates the socket. if the owning process dies the socket is closed. If you evaluate start() in the shell then the owning process is the shell command interpreter, which usually does not die. If you evaluate start() in some other process then it might have died in which case the listening socket will be closed. If you change accept_con to print an error you should see this: accept_conn(LSock) -> case gen_tcp:accept(LSock) of {ok, Sock} -> spawn(fun() -> accept_conn(LSock) end), handle_conn(Sock); X -> io:format("OOps:pn", [X]) true end. The way I'd write accept_con (the way in the Erlang book) is like this: accept_conn(LSock) -> {ok, Sock} = case gen_tcp:accept(LSock), spawn(fun() -> accept_conn(LSock) end), handle_conn(Sock). The way you write things is to silently swallow up the error return with no warnings, which make things difficult to debug since you get no indication of error. The Erlang way is to crash hard and early. If the process owning the listen socket has died then you need to make sure it lives forever. I'd add a sleep(infinity) to the code, like this: start() -> case gen_tcp:listen(6002, [binary, {packet, 0}, {active, true}, {reuseaddr, true}]) of {ok, Sock} -> spawn(fun() -> accept_conn(Sock) end), sleep(infinity); {error, Reason} -> {error, Reason} end. where sleep(T) -> receive after T -> void end. This version of start can be happily spawned - in the original version you must ensure that the process evaluating start() does not die. Hope this helps /Joe Armstrong 2008/1/21 Rapsey : > All this program does is listen on a socket, spawn a new process on every > connection and send a never ending stream of numbers to each client that > connects to it. The problem is that once 1 client is connected, no one else > can connect, even though a new acceptor process has been spawned. > > > start() -> > case gen_tcp:listen(6002, [binary, {packet, 0}, {active, true}, > {reuseaddr, true}]) of > {ok, Sock} -> > spawn(fun() -> accept_conn(Sock) end); > {error, Reason} -> {error, Reason} > end. > > > accept_conn(LSock) -> > case gen_tcp:accept(LSock) of > {ok, Sock} -> > spawn(fun() -> accept_conn(LSock) end), > handle_conn(Sock); > _ -> > true > end. > > % wait for http request from browser > handle_conn(Sock) -> > receive > {tcp, RecSock, Data} -> > send_stream(RecSock, 0); > {tcp_closed, _} -> > true > end. > > send_stream(Sock, N) when N == 0 -> > gen_tcp:send(Sock, "HTTP/1.1 200 OK\r\nContent-type: > text/html\r\n\r\nWOHOO
"), > send_stream(Sock, N + 1); > send_stream(Sock, N) -> > case gen_tcp:send(Sock, integer_to_list(N)) of > ok -> > timer:sleep(1000), > send_stream(Sock, N + 1); > Any -> > true > end. > > > thank you, > Sergej > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bjorn@REDACTED Mon Jan 21 11:01:21 2008 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 21 Jan 2008 11:01:21 +0100 Subject: [erlang-questions] bug: internal error in v3_codegen In-Reply-To: <666B9BFE-EE39-4CEA-A0B2-DCFBBA90F07F@gmail.com> References: <666B9BFE-EE39-4CEA-A0B2-DCFBBA90F07F@gmail.com> Message-ID: Mateusz Berezecki writes: > On Jan 20, 2008, at 11:00 AM, Bjorn Gustavsson wrote: > > Sort of :-) That's the another bug I had encountered during that day. > I just did not note it down so had to "reinvent" it again. A patch that fixes that and similar bugs can be found here: http://www.erlang.org/pipermail/erlang-bugs/2008-January/000604.html /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From sh@REDACTED Mon Jan 21 11:28:31 2008 From: sh@REDACTED (=?iso-8859-1?Q?S=F8ren_Hilmer?=) Date: Mon, 21 Jan 2008 11:28:31 +0100 (CET) Subject: [erlang-questions] How to use Mnesia Database from C/C++/Java ? In-Reply-To: <003d01c85c02$9cc008e0$d6401aa0$@singh@cellebrum.com> References: <003d01c85c02$9cc008e0$d6401aa0$@singh@cellebrum.com> Message-ID: <41030.193.3.142.122.1200911311.squirrel@www.widetrail.dk> There is/used to be, something called Mnesia Session for doing exactly this. I do not however see the documentation for it in the latest release, tehre is something here http://www.erlang.org/documentation/doc-5.0.1/lib/mnesia_session-1.1.3/doc/html/part_frame.html But if that is the latest I am not sure. --S?ren -- S?ren Hilmer, M.Sc., M.Crypt. wideTrail Phone: +45 25481225 Pilev?nget 41 Email: sh@REDACTED DK-8961 Alling?bro Web: www.widetrail.dk On Mon, January 21, 2008 08:52, Amritpal Singh wrote: > Dear All, > > I am completely novice to Erlang, though have been working into telecom > domain for quite some time. > I have some of my applications like SMSC and others which need temporary > data-storage written in C. > Till date, i have been using relational databases like 'MySQL/Oracle' for > temporary storage purpose. Because of performance constraints i need to > shift this temporary storage to some in-memory database. >>From initial overview, 'MNESIA' seems to be perfect replacement for my >> scenario. > Have installed the same and tried to access the same from 'Erlang' , > thankfully , have got the success in doing the same. > > Now, my problem is , i don't want to change the core of my application > which is already encoded in 'C' , so need to access 'Mnesia DB' from 'C'. > As per my findings, there are no ODBC drivers available for Mnesia. > So, think need to have some kind of external interface to 'Erlang' like > 'Erl_Interface' which i can use from 'C' program to interact with 'Mnesia > DB'. > > I just want to know if someone has worked on such kind of architecture ? > If yes, can u please share your valuable experiences ? > If no, how feasible and reliable does it seem to you ? > > Waiting for your valuable inputs. > > Thanks and Regards, > Amritpal Singh > > ________________________________ > This message and its attachments contain confidential information and may > also contain legally privileged information. This message is intended > solely for the named addressee. If you are not the addressee indicated in > this message (or authorized to receive for addressee), you may not copy or > deliver any part of this message or its attachments to anyone or use any > part of this message or its attachments. Rather, you should permanently > delete this message and its attachments (and all copies) from your system > and kindly notify the sender by reply e-mail. Any content of this message > and its attachments that does not relate to the official business of > Cellebrum.com Pvt Ltd or its affiliates and/or subsidiaries must be taken > not to have been sent or endorsed by any of them. Opinions and information > in this email that do not relate to the official business of Cellebrum.com > Pvt Ltd, shall be understood as neither given nor endorsed by > Cellebrum.com Pvt Ltd. Any action/proceeding/opportunity upon the contents > of this email taken by not intended addressee shall attract liabilities > both criminal and civil against such addressee. > > Email communications are not private and no warranty is made that e-mail > communications are timely, secure or free from computer virus or other > defect. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From chsu79@REDACTED Mon Jan 21 11:44:23 2008 From: chsu79@REDACTED (Christian S) Date: Mon, 21 Jan 2008 11:44:23 +0100 Subject: [erlang-questions] should be a parallel tcp server, but can't connect to more than 1 client In-Reply-To: <9b08084c0801210154q2e240c2ex8c17cc2489f9e2a5@mail.gmail.com> References: <97619b170801210053r1f7f30e7geee0d3be6edf56d8@mail.gmail.com> <9b08084c0801210154q2e240c2ex8c17cc2489f9e2a5@mail.gmail.com> Message-ID: > The way I'd write accept_con (the way in the Erlang book) is like this: > > accept_conn(LSock) -> > {ok, Sock} = case gen_tcp:accept(LSock), > spawn(fun() -> accept_conn(LSock) end), > handle_conn(Sock). > > The way you write things is to silently swallow up the error return > with no warnings, which make things difficult > to debug since you get no indication of error. The Erlang way is to > crash hard and early. The phrase "programming for the successful case" describes this style well. The only objection I have is that sometimes the bad_match exceptions are not as informative as an explicitly-written crash reason. I recently had to motivate why I liked erlang to some java-only people, and mentioning "crash early" does not vibe with them well. I think it is because they dont have automatic restarting as an established approach in their gofy pattern-books. I have to go into a longer discussion about windows machines, where all problems, be it the machine being slow or a service on it not responding or software upgrade etc, are resolved by control-alt-delete. And 2-3 minutes later things work better again. Then getting them to admit they have solved server problems like this for longer periods (everyone has). Then go on and explain how erlang takes this to a micro-scale. Where restarts is the way to handle all errors. Since the costly thing is not the crash in itself, but the time the service is done. This is my standard approach, using the insights i got from your thesis. It makes them stop asking more questions, but I dont know if it is because they are convinced or because it is so different that their brains stop. If anyone have another approach to share, please tell. Anyway, what I also wanted to say: The 'iserve' webserver does things slightly different, the server process is the only one that spawns new acceptors, this requires acceptors to report back to it when they have a connection so the server can spawn the next one. I like this approach better. From dmitriid@REDACTED Mon Jan 21 13:08:43 2008 From: dmitriid@REDACTED (Dmitrii 'Mamut' Dimandt) Date: Mon, 21 Jan 2008 14:08:43 +0200 Subject: [erlang-questions] Whatever happened to trapexit? Message-ID: <47948B4B.3060506@gmail.com> Whois data returns: domain expired And the site is no longer online... From tobbe@REDACTED Mon Jan 21 13:28:10 2008 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Mon, 21 Jan 2008 13:28:10 +0100 Subject: [erlang-questions] Whatever happened to trapexit? In-Reply-To: <47948B4B.3060506@gmail.com> References: <47948B4B.3060506@gmail.com> Message-ID: Dmitrii 'Mamut' Dimandt wrote: > Whois data returns: domain expired > > And the site is no longer online... Just some ordinary f*up, sorry... We are working on getting it restored. --Tobbe From dmitriid@REDACTED Mon Jan 21 13:36:56 2008 From: dmitriid@REDACTED (Dmitrii 'Mamut' Dimandt) Date: Mon, 21 Jan 2008 14:36:56 +0200 Subject: [erlang-questions] Whatever happened to trapexit? In-Reply-To: References: <47948B4B.3060506@gmail.com> Message-ID: <479491E8.7070301@gmail.com> Torbjorn Tornkvist wrote: > Dmitrii 'Mamut' Dimandt wrote: > >> Whois data returns: domain expired >> >> And the site is no longer online... >> > > Just some ordinary f*up, sorry... > We are working on getting it restored. > > --Tobbe > > It's ok :) As long as the information is intact, it's ok :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gebi@REDACTED Mon Jan 21 10:55:17 2008 From: gebi@REDACTED (Michael Gebetsroither) Date: Mon, 21 Jan 2008 10:55:17 +0100 Subject: [erlang-questions] How to use Mnesia Database from C/C++/Java ? References: <3543.48750920526$1200902264@news.gmane.org> Message-ID: * Amritpal Singh wrote: > Now, my problem is , i don't want to change the core of my application whic= > h is already encoded in 'C' , so need to access 'Mnesia DB' from 'C'. > As per my findings, there are no ODBC drivers available for Mnesia. > So, think need to have some kind of external interface to 'Erlang' like 'Er= > l_Interface' which i can use from 'C' program to interact with 'Mnesia DB'. If you have used sql before to store your temporary data, whats about sqlite? Just open an sqlite db with name ":memory:" and it creates an complete in-memory db easily accessible from your c program. cu, michael -- It's already too late! From kg9020@REDACTED Mon Jan 21 14:10:44 2008 From: kg9020@REDACTED (kg9) Date: Mon, 21 Jan 2008 05:10:44 -0800 (PST) Subject: [erlang-questions] Erlounge in San Francisco, 17-22 February In-Reply-To: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> References: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> Message-ID: <14997180.post@talk.nabble.com> Hello I will be in San Jose from Feb 10 till Feb 17 for training would also like to meet any other Erlangers there Arthur *Vendor Wireless training Robert Virding-2 wrote: > > I will be in San Francisco 17-22 of February (actually from the 16th) for > a > conference* and if there are any other Erlangers there perhaps we could > meet > over a beer and have a nice discussion. Let me know and we can arrange > something. > > Robert > > *Game Developers Conference which until recently has had very little to do > with Erlang, they're all C++ weenies. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- View this message in context: http://www.nabble.com/Erlounge-in-San-Francisco%2C-17-22-February-tp14972084p14997180.html Sent from the Erlang Questions mailing list archive at Nabble.com. From matthias@REDACTED Mon Jan 21 13:29:57 2008 From: matthias@REDACTED (Matthias Lang) Date: Mon, 21 Jan 2008 13:29:57 +0100 Subject: [erlang-questions] Whatever happened to trapexit? In-Reply-To: <47948B4B.3060506@gmail.com> References: <47948B4B.3060506@gmail.com> Message-ID: <18324.36933.464127.369691@antilipe.corelatus.se> Dmitrii 'Mamut' Dimandt writes: > Whois data returns: domain expired > > And the site is no longer online... And the email address in the whois data is invalid. You can still use trapexit if you know the IP address: http://213.171.204.166/ Matthias From hans.bolinder@REDACTED Mon Jan 21 14:52:30 2008 From: hans.bolinder@REDACTED (Hans Bolinder) Date: Mon, 21 Jan 2008 14:52:30 +0100 Subject: [erlang-questions] clarify: qlc, mnesia and unique_all In-Reply-To: <697074A35ED91748882E3850BDCE295E06C58A@leenu.akumiitti.net> References: <697074A35ED91748882E3850BDCE295E06C58A@leenu.akumiitti.net> Message-ID: <18324.41886.220873.848210@gargle.gargle.HOWL> [Dmitri Girenko:] > I am having strange problems with qlc's unique_all option. > ... Thanks for the bug report. The patch below should fix the problem: Best regards, Hans Bolinder, Erlang/OTP team *** /usr/local/otp/releases/otp_beam_solaris8_r11b_patched/lib/stdlib-1.14.5.3/src/qlc.erl Wed Sep 19 16:58:25 2007 --- qlc.erl Mon Jan 21 14:16:51 2008 *************** *** 1335,1341 **** Prep = Prep0#prepared{qh = LE0#qlc_table{lu_vals = LuV}}, {skip, SkipFils, LU, Prep}; #qlc_table{trav_MS = true} when MS =/= no_match_spec -> ! Prep = Prep0#prepared{qh = LE0#qlc_table{ms = MS}}, {replace, Fs, false, may_create_simple(Opt, Prep)}; #qlc_list{l = []} -> % unique and cached {replace, Fs, false, Prep0}; --- 1335,1342 ---- Prep = Prep0#prepared{qh = LE0#qlc_table{lu_vals = LuV}}, {skip, SkipFils, LU, Prep}; #qlc_table{trav_MS = true} when MS =/= no_match_spec -> ! Prep = Prep0#prepared{qh = LE0#qlc_table{ms = MS}, ! is_unique_objects = false}, {replace, Fs, false, may_create_simple(Opt, Prep)}; #qlc_list{l = []} -> % unique and cached {replace, Fs, false, Prep0}; From Dmitri.Girenko@REDACTED Mon Jan 21 15:02:45 2008 From: Dmitri.Girenko@REDACTED (Dmitri Girenko) Date: Mon, 21 Jan 2008 16:02:45 +0200 Subject: [erlang-questions] clarify: qlc, mnesia and unique_all In-Reply-To: <18324.41886.220873.848210@gargle.gargle.HOWL> References: <697074A35ED91748882E3850BDCE295E06C58A@leenu.akumiitti.net> <18324.41886.220873.848210@gargle.gargle.HOWL> Message-ID: <697074A35ED91748882E3850BDCE295EE09036@leenu.akumiitti.net> Wow, how swiftly! Thanks a lot. > -----Original Message----- > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions- > bounces@REDACTED] On Behalf Of Hans Bolinder > Sent: 21. tammikuuta 2008 15:53 > To: erlang-questions@REDACTED > Subject: Re: [erlang-questions] clarify: qlc, mnesia and unique_all > > [Dmitri Girenko:] > > I am having strange problems with qlc's unique_all option. > > ... > > Thanks for the bug report. The patch below should fix the problem: > > Best regards, > > Hans Bolinder, Erlang/OTP team > > *** /usr/local/otp/releases/otp_beam_solaris8_r11b_patched/lib/stdlib- > 1.14.5.3/src/qlc.erl Wed Sep 19 16:58:25 2007 > --- qlc.erl Mon Jan 21 14:16:51 2008 > *************** > *** 1335,1341 **** > Prep = Prep0#prepared{qh = LE0#qlc_table{lu_vals = LuV}}, > {skip, SkipFils, LU, Prep}; > #qlc_table{trav_MS = true} when MS =/= no_match_spec -> > ! Prep = Prep0#prepared{qh = LE0#qlc_table{ms = MS}}, > {replace, Fs, false, may_create_simple(Opt, Prep)}; > #qlc_list{l = []} -> % unique and cached > {replace, Fs, false, Prep0}; > --- 1335,1342 ---- > Prep = Prep0#prepared{qh = LE0#qlc_table{lu_vals = LuV}}, > {skip, SkipFils, LU, Prep}; > #qlc_table{trav_MS = true} when MS =/= no_match_spec -> > ! Prep = Prep0#prepared{qh = LE0#qlc_table{ms = MS}, > ! is_unique_objects = false}, > {replace, Fs, false, may_create_simple(Opt, Prep)}; > #qlc_list{l = []} -> % unique and cached > {replace, Fs, false, Prep0}; > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From erlang@REDACTED Mon Jan 21 15:29:37 2008 From: erlang@REDACTED (Joe Armstrong) Date: Mon, 21 Jan 2008 15:29:37 +0100 Subject: [erlang-questions] help: Erlang MIDI driver for MAC OS X In-Reply-To: <400A6F0E-01D7-4D1D-9D38-9CDAE51F4B11@gmail.com> References: <400A6F0E-01D7-4D1D-9D38-9CDAE51F4B11@gmail.com> Message-ID: <9b08084c0801210629g5185a512kdd1eb3d243c5a22f@mail.gmail.com> Thanks - I'd discovered this :-) I have actually made great progress after about 9 hours of searching and messing around suddenly things bust into life. I have now made a primitive OS-X midi driver - so now I can both send and receive real-time midi events and make horrible noises. The interesting thing is that this really does bring home to me how appallingly difficult it is to write even simple code today. According to the midi spec I can play a middle C (midi8 note number 60) by sending three bytes to my midi device - I just send something like 144,60,75 (144 means "note on channel 1", 60 is a pitch (middle C) and 75 a "velocity" - how loud to play the note) Easy you might think: 1) open /dev/midi 2) write three bytes A trivial exercise in any programming language - but NO - there is no /dev/midi - instead there is an incredible mess of API routines to open a midi first open a midi client - then create a midi input and output port and connect it to the client then get a midi device ref (for the correct device) then setup a callback routine for reading midi events - connect the sources the devices and generally mess around. The documents to aim in my understanding of this are 1) an API definition that defines the types of the function arguments (but without any *definitions* of what things *mean*) and a number of example programs - which don't do what I want - fortunately there is Google - a lot of Googling and some inspired guess work saves the day. Now all of this mess with APIs strikes me as a total waste of time - the old unix way of opening a device and writing three bytes to it is a) easy to understand b) language neutral (ie does not favor a particular programming language) and c) easy to use - so why why why^10 is this not the standard way of interfacing things together? In the last twenty years all we seem to have done is make simple problems almost impossibly difficult - the Unix model (everything is a file) and to do things you just read and write bytes to these files is simple, beautiful and easy to understand - the Erlang model is even better - everything is a process - To connect things you pipe the outputs of one program into the inputs of the next - no messing around. Once I'd made my simple driver things fell into place - no more idiotic callback routines, type casts and memory allocations. When I play notes the midi synthesiser sends me Erlang messages {note, on|off, Pitch, Velcoity} to make it play things I sent it noteon and noteoff messages. This seems very natural to me - If anybody else is interested in real-time midi control and Erlang programming please contact me. Cheers /Joe Armstrong On Jan 21, 2008 2:52 PM, G Bulmer wrote: > > > Date: Fri, 18 Jan 2008 17:35:46 +0100 > > From: "Joe Armstrong" > > Subject: [erlang-questions] help: Erlang MIDI driver for MAC OS X > ... > > > Hello, > > > > I'm trying to write an Erlang midi driver to connect an external > > Roland Synthesizer (SH-201) to > > a MacBook. > > > > So far I can receive MIDI events from the synt but not send events. > > > > Does anybody have any experience with the Mac OS X CoreAudio Framework > > in particular with the CoreMIDI routines? > > > > I have no experience, but I have been subscribing to Apple Developer > for years, and I found some old (2004) links which led to these: > (I assume you have them, but better to be safe than sorry !-) > http://developer.apple.com/audio/ > http://developer.apple.com/audio/pdf/coreaudio.pdf > http://developer.apple.com/qa/qa2004/qa1374.html > http://www.audiosynth.com/sinewavedemo.html > > HTH > G Bulmer > > PS: I thought Apples mailing list UI was unbelievably unfriendly. I > clicked on "Mailing List Archives" and it looked empty! I had to > really dig. UI guidelines? Horrid! > PPS: I couldn't find the coreaudio swiki, but this may be why: http:// > lists.apple.com/archives/coreaudio-api/2006/Jan/msg00223.html > > > From michael.campbell@REDACTED Mon Jan 21 16:05:49 2008 From: michael.campbell@REDACTED (Michael Campbell) Date: Mon, 21 Jan 2008 10:05:49 -0500 Subject: [erlang-questions] help: Erlang MIDI driver for MAC OS X In-Reply-To: <9b08084c0801210629g5185a512kdd1eb3d243c5a22f@mail.gmail.com> References: <400A6F0E-01D7-4D1D-9D38-9CDAE51F4B11@gmail.com> <9b08084c0801210629g5185a512kdd1eb3d243c5a22f@mail.gmail.com> Message-ID: <811f2f1c0801210705q4aea1bc4lf2a0f1206fb861df@mail.gmail.com> On Jan 21, 2008 9:29 AM, Joe Armstrong wrote: > ... so why why why^10 is this not the standard way of interfacing > things together? > > In the last twenty years all we seem to have done is make simple > problems almost impossibly difficult Joe, unfortunately I can't help you with your issue, but your post made me think of a favorite quote: "Those who don't understand UNIX are doomed to reinvent it, poorly." --Henry Spencer From icfp.publicity@REDACTED Mon Jan 21 16:52:54 2008 From: icfp.publicity@REDACTED (Matthew Fluet (ICFP Publicity Chair)) Date: Mon, 21 Jan 2008 09:52:54 -0600 Subject: [erlang-questions] ICFP2008 Call for Papers Message-ID: <53ff55480801210752u734ba372ga932cfefbf88ba6d@mail.gmail.com> Call for Papers ICFP 2008: International Conference on Functional Programming Victoria, BC, Canada, 22-24 September 2008 http://www.icfpconference.org/icfp2008 Submission deadline: 2 April 2008 ICFP 2008 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 and concurrency. Particular topics of interest include * Applications and Domain-Specific Languages: systems programming; scientific and numerical computing; symbolic computing; artificial intelligence; databases; graphical user interfaces; multimedia programming; scripting; system administration; distributed-systems and web programming; XML processing; security * Foundations: formal semantics; lambda calculus; type theory; monads; continuations; control; state; effects * Design: algorithms and data structures; modules; type systems; concurrency and distribution; components and composition; relations to object-oriented or logic programming * Implementation: abstract machines; compile-time and run-time optimization; just-in-time compilers; memory management; parallel hardware; interfaces to foreign functions, services, components or low-level machine resources * Transformation and Analysis: abstract interpretation; partial evaluation; program transformation * Software-development Techniques: design patterns; specification; verification; validation; debugging; test generation; tracing; profiling * Functional Pearls: elegant, instructive, and fun essays on functional programming * Practice and Experience: novel results drawn from experience in education or industry. Experience Reports are also solicited, which are short papers (2-4 pages) that provide evidence that functional programming really works or describe obstacles that have kept it from working in a particular application. 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. What's different this year? ~~~~~~~~~~~~~~~~~~~~~~~~~~~ * No double blind reviewing. Instructions for authors ~~~~~~~~~~~~~~~~~~~~~~~~ By Wednesday, 2 April 2008, 09:00 AM Apia time, 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 not meeting the page limits are summarily rejected. Authors have the option to attach supplementary material to a submission, on the understanding that reviewers are not expected to read 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. 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. They may have the option to have their presentation videotaped and published along with the conference proceedings in the ACM Digital Library. Video recordings will only be released at the consent of the presenter, which is expressed by signing an additional copyright release/permission form. 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; the submission page is not yet ready. The deadline is set at Samoan time, so if your submission is in by 09:00 AM Wednesday according to your local time, wherever you are, the submission will be on time. The world clock (http://www.timeanddate.com/worldclock/fixedtime.html?month=4&day=2&year=2008&hour=9&min=0&sec=0&p1=282) can give you the equivalent in your local time, e.g.,1:00 PM Wednesday in Seattle, 4:00 PM Wednesday in New York, and 9:00 PM Wednesday in London. 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. Author response ~~~~~~~~~~~~~~~ You will have a 48-hour period, starting at 09:00 on 21 May 2008 Apia time, 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. A pearl 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. Some advice from Richard Bird: * Throw away the rule book for writing research papers. * Get in quick; get out quick. * Be self-contained; don't go deep into related work, with lengthy references. * You are telling a story, so some element of surprise is welcome. * Above all, be engaging. * Give a talk on the pearl to non-specialists, your students, or your department. If you changed the order of presentation for the talk, consider using the new order in the next draft. * Put the pearl away for a while, then take it out and polish it again. Experience Reports ~~~~~~~~~~~~~~~~~~ ICFP has long solicited submissions on the practice and experience of functional programming. But reports of experience are inherently different from research papers, and when judged by the criteria of scientific merit, novelty, or research contribution, they have not competed well against traditional ICFP submissions. Yet we believe that the functional-programming community would benefit from being able to draw on and cite the experience of others. For this reason, we have introduced the ICFP Experience Report. Unlike a normal ICFP paper, the purpose of an Experience Report is not to add to the body of knowledge of the functional-programming community. Rather, 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. 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. * 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 present 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. 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 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 ~~~~~~~~~~~~~~~~ James Hook (Portland State University) Program Chair ~~~~~~~~~~~~~ Peter Thiemann Albert-Ludwigs-Universit?t Georges-K?hler-Allee 079 79110 Freiburg, Germany Email: icfp08@REDACTED Phone: +49 761 203 8051 Fax: +49 761 203 8052 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 and reverse the charges. Program Committee ~~~~~~~~~~~~~~~~~ Derek Dreyer (Max Planck Institute for Software Systems) Robert Ennals (Intel Research) Kathleen Fisher (AT&T Research) Zhenjiang Hu (University of Tokyo) Frank Huch (University of Kiel) Andrew Kennedy (Microsoft Research) Kevin Millikin (Google) Henrik Nilsson (University of Nottingham) Chris Okasaki (United States Military Academy) Brigitte Pientka (McGill University) Rinus Plasmeijer (University of Nijmegen) Alan Schmitt (INRIA) Chung-chieh Shan (Rutgers) Mitchell Wand (Northeastern University) Stephen Weeks (Jane Street Capital) Important Dates (at 09:00 Apia time, UTC-11) ~~~~~~~~~~~~~~~ Submission: 2 April 2008 Author response: 21 May 2008 Notification: 16 June 2008 Final papers due: 7 July 2008 ICFP 2008 Web Site ~~~~~~~~~~~~~~~~~~ http://www.icfpconference.org/icfp2008/ Special Journal Issue ~~~~~~~~~~~~~~~~~~~~~ There will be a special journal issue with papers from ICFP 2008. The program committee will invite the authors of select accepted papers to submit a journal version to this issue. From rrerlang@REDACTED Mon Jan 21 16:37:53 2008 From: rrerlang@REDACTED (Robert Raschke) Date: Mon, 21 Jan 2008 15:37:53 +0000 Subject: [erlang-questions] OT: Re: help: Erlang MIDI driver for MAC OS X In-Reply-To: <811f2f1c0801210705q4aea1bc4lf2a0f1206fb861df@mail.gmail.com> Message-ID: <1cb611377d89b49e102eac92a4f2bd46@tombob.com> > On Jan 21, 2008 9:29 AM, Joe Armstrong wrote: >> ... so why why why^10 is this not the standard way of interfacing >> things together? >> >> In the last twenty years all we seem to have done is make simple >> problems almost impossibly difficult > > Joe, unfortunately I can't help you with your issue, but your post > made me think of a favorite quote: > > "Those who don't understand UNIX are doomed to reinvent it, poorly." > --Henry Spencer Has anyone ever looked into porting Erlang to Plan 9? Or potentially, is someone maybe looking into support for writing 9P file servers? These two are high on my list, if I ever had any energy left after the day job. Robby From listproc@REDACTED Mon Jan 21 17:53:10 2008 From: listproc@REDACTED (Ukyo Virgden) Date: Mon, 21 Jan 2008 18:53:10 +0200 Subject: [erlang-questions] High volume CDR analysis In-Reply-To: References: <7A3ACF0B-BD04-4108-A0E0-7E8548B7983B@gencay.net> Message-ID: <34A79AA2-19B4-4276-AAD9-151332248068@gencay.net> Hi Christian, You're right. What I'm imagining is to collect call detail records from several telco equipment and periodically create reports. At this moment I'm not thinking about real-time (by realtime I mean as-it- happens) reports. So this basically means, collect input data in parallel, apply some transformation, store in mnesia and run a job to create reports. Therefore, the only data I need to store is for only one period, which is 100-300 million records of input. Any suggestions? I suppose there is a storage limit of 2gig for mnesia per node right? Thanks in advance, Ukyo. On 15.Oca.2008, at 21:20, Christian S wrote: > I spent some time googling these acronyms, and as far as I could > figure out it is: > > CDR: Caller data record > ETL: Extract, transform, load > > My guess is that Ukyo gets vendor specific report formats from some > telecom equipment > and need to rectify all to one format that one can use to extract > reports from, for billing > and homeland insecurity. > > I'm not sure mnesia is a good fit. But then again I dont know what > kind of system Ukyo > imagined. I got the feeling he would want to store a hundred million > CDRs in mnesia > tables, that seems to require that you know how to rewrite the mnesia > backend to add a > sleepycat db table-type, then not release it because you think it > wasnt done right. > > Having a high-availability cluster where each CDR is reported > as-it-happens, updating > an account's usage-data, seems quite doable. But having an actual log > of transactions > for each account is probably important. > > On Jan 15, 2008 7:42 PM, Ahmed Ali wrote: >> Hi Ukyo, >> >> Just wondering, what's ETL? >> >> Best regards, >> Ahmed >> >> >> On Jan 15, 2008 3:52 PM, Ukyo Virgden wrote: >>> Hi, >>> >>> I'm working full-time on a system which involves a hundreds of >>> millions of CDR records. >>> >>> Our current setup is a typical ETL infrastructure which NOBODY is >>> happy about. >>> >>> After reading and experimenting with Erlang and Mnesia, wouldn't it >>> be possible to do such ETL with Erlang and Mnesia? >>> >>> Any suggestions? >>> >>> Regards, >>> Ukyo. >>> >>> _______________________________________________ >>> 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 listproc@REDACTED Mon Jan 21 17:56:30 2008 From: listproc@REDACTED (Ukyo Virgden) Date: Mon, 21 Jan 2008 18:56:30 +0200 Subject: [erlang-questions] High volume CDR analysis In-Reply-To: References: Message-ID: Hi Robert, Actually, I'd image general queries that will run for sometime maybe in batch and generate reports from CDR data. So therefore, no as-it- happens What do you mean by column based table representation? Thanks in advance, Ukyo, On 16.Oca.2008, at 11:57, Robert Raschke wrote: > I'm not sure if Erlang is a good fit for CDR analysis. It depends on > what you're trying to achieve. For accepting CDR records and storing > them, I wouldn't think mnesia would be that good a fit, due to the > sheer volume. But if you were to design a more suitable data > structure for CDR record storage, then that might be really quite > interesting. You may not need random access and complex queries, > maybe something that only allows sequential access (maybe with the > ability to filter) and is designed for quick roll-ups would be more > suitable. Column based table representations come to mind. > > If you want to actually analyse (i.e., summarise in some way) in real > time, without storing the raw incoming records in between, then Erlang > could be a good platform. But even then, you would probably want to > investigate in your own data structures for the summary tables, since > the incoming data rate would probably mean way too many > transactions on > your summary data to be really comfortable for mnesia. > > As far as I know, stuff like this is the forte of systems like K, J > and APL. These usually come with nice examples about how they can > process enormous amounts of stock market ticker information in real > time. That would be closer to the kind of data you get from CDR, I > would guess > > Robby > > PS. By "real time" in the above, I just mean that roll up of data is > done as it appears, not in a btach way later on; it has nothing to do > with real time programming. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From francesco@REDACTED Mon Jan 21 18:30:41 2008 From: francesco@REDACTED (Francesco Cesarini) Date: Mon, 21 Jan 2008 17:30:41 +0000 Subject: [erlang-questions] Whatever happened to trapexit? In-Reply-To: <18324.36933.464127.369691@antilipe.corelatus.se> References: <47948B4B.3060506@gmail.com> <18324.36933.464127.369691@antilipe.corelatus.se> Message-ID: <4794D6C1.4010208@erlang-consulting.com> Sorry about the disruption. Emails to renew the domain were going to one of Tobbe's extinct email addresses. We should have it up and running again soon. Regards, Francesco Matthias Lang wrote: > Dmitrii 'Mamut' Dimandt writes: > > Whois data returns: domain expired > > > > And the site is no longer online... > > And the email address in the whois data is invalid. > > You can still use trapexit if you know the IP address: > > http://213.171.204.166/ > > Matthias > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > From bob@REDACTED Mon Jan 21 18:37:02 2008 From: bob@REDACTED (Bob Ippolito) Date: Mon, 21 Jan 2008 09:37:02 -0800 Subject: [erlang-questions] help: Erlang MIDI driver for MAC OS X In-Reply-To: <9b08084c0801210629g5185a512kdd1eb3d243c5a22f@mail.gmail.com> References: <400A6F0E-01D7-4D1D-9D38-9CDAE51F4B11@gmail.com> <9b08084c0801210629g5185a512kdd1eb3d243c5a22f@mail.gmail.com> Message-ID: <6a36e7290801210937n2d1849f8i8fce91a9018048a0@mail.gmail.com> On Jan 21, 2008 6:29 AM, Joe Armstrong wrote: > Thanks - I'd discovered this :-) > > I have actually made great progress after about 9 hours of searching > and messing around suddenly things > bust into life. > > I have now made a primitive OS-X midi driver - so now I can both send > and receive real-time midi events > and make horrible noises. > > The interesting thing is that this really does bring home to me how > appallingly difficult it is to write even simple > code today. Well, the reason Apple's CoreAudio APIs look like that are because they're designed to have *very* precise timing, where you wouldn't be able to do that properly over a file-like device. The APIs are a pain in the ass and it sucks when you don't need that but that's why it's designed that way. I think that the CoreAudio stuff lives in the real-time parts of the kernel so when you get a callback it's at a very high priority and you're not even supposed to allocate memory or anything that might interrupt. -bob From mordue@REDACTED Mon Jan 21 18:52:25 2008 From: mordue@REDACTED (Michael Mordue) Date: Mon, 21 Jan 2008 09:52:25 -0800 Subject: [erlang-questions] Position announcement Software Development Engineer - Erlang Message-ID: Work from home, no need to relocate. This Company is building (from virtual locations) the next generation office environment. They are building the tools to empower a rich collaborative team software development experience: always available video conferencing, VOIP, IM, presence, and virtual white boarding, all connected through smart self-managing project tools. Seeking an adept software engineer to join their team to help build mission critical network services in Erlang on the GNU/Linux platform. These services will form the core of new product and service offerings. The ideal candidate for this position has worked on large scale production environments with thousands of concurrent clients connected to software they have built/deployed. Requirements * Must have experience with Erlang * Must have expert level network programming experience, preferably in Erlang, C++ and/or C * Strong background in developing for GNU/Linux or Unix-like platforms for missioncritical production deployments * Strong understanding of MySQL 4.1-5.x, including database design patterns and large-scale deployments utilizing replications and/or clustering * Experience programming network servers/clients, including knowledge of fundamental protocols such as TCP, UDP, IPv4/6, and SSL/TLS * Knowledge of and experience using XML technologies Keywords: Erlang, MySQL, Linux, XML, Network, Scalable Plusses: * High-availability and scalable network service development * Experience with Erlang/OTP (Open Telecom Platform) and the associated design patterns * Experience with functional programming * Experience with multi-master clustering and other high availability techniques * Proficiency in an industry-recognized scripting language such as Ruby, Perl, Python, or PHP * GNU/Linux optimization, security and network administration * Experience with VoIP and/or libevent * Experience with distributed architecture, design, implementation * Secure coding practices * BS/MS in a related field Work Environment * Work from anywhere * Structured 8 hour day lets you have a life outside of work * High-end Mac desktops and laptops with dual 30` cinema displays * Executive desk with your choice of ergonomic chair * Full benefits and six figure salary * Work with some of the brightest and best minds in the industry Please respond by email with resume and brief cover letter to: Michael J Mordue MORDUE ALLEN ROBERTS BONNEY LTD Search & Placement Consultants PO Box 450 Gig Harbor WA 98335 Tel 253 851 5355 Fax 253 851 7969 email: mordue@REDACTED Partner offices in Australia, Japan, China, Hong Kong, Singapore, S. Korea, UK, Europe, Canada and the USA -------------- next part -------------- An HTML attachment was scrubbed... URL: From babo.online@REDACTED Mon Jan 21 19:40:21 2008 From: babo.online@REDACTED (Attila Babo) Date: Mon, 21 Jan 2008 20:40:21 +0200 Subject: [erlang-questions] funs and code loading In-Reply-To: <18318.40045.548008.175031@antilipe.corelatus.se> References: <18315.10295.882008.456569@antilipe.corelatus.se> <597c69660801151159p589532bco363fd4c70e0fee6e@mail.gmail.com> <18318.40045.548008.175031@antilipe.corelatus.se> Message-ID: <597c69660801211040w4e6e1f2eqc7fd2150d42ffb54@mail.gmail.com> On Jan 17, 2008 2:08 AM, Matthias Lang wrote: > for the record: I think your explanation is confusing and wrong. You are absolutely right, I reviewed my explanation, this is simply a bug what your patch fixes nicely. Just for record, if you switch code during sleep this code will happily use new versions for F() and G(), while f() and g() are intact. F = fun f/0, G = fun() -> f() end, io:fwrite("l: ~p ~p ~p ~p~n", [f(), g(), F(), G()]), timer:sleep(60000), io:fwrite("l: ~p ~p ~p ~p~n", [f(), g(), F(), G()]), Thanks for the clarification! Attila From kevin@REDACTED Mon Jan 21 20:22:30 2008 From: kevin@REDACTED (Kevin A. Smith) Date: Mon, 21 Jan 2008 14:22:30 -0500 Subject: [erlang-questions] Position announcement Software Development Engineer - Erlang In-Reply-To: References: Message-ID: I believe this is the same position: http://www.thehive.com/current-jobs/senior-network-software-engineer/ We've already seen this posting a few times on this list. --Kevin On Jan 21, 2008, at 12:52 PM, Michael Mordue wrote: > Work from home, no need to relocate. > > This Company is building (from virtual locations) the next > generation office environment. They are building the tools to > empower a rich collaborative team software development experience: > always available video conferencing, VOIP, IM, presence, and virtual > white boarding, all connected through smart self-managing project > tools. > > Seeking an adept software engineer to join their team to help build > mission critical network services in Erlang on the GNU/Linux > platform. These services will form the core of new product and > service offerings. The ideal candidate for this position has worked > on large scale production environments with thousands of concurrent > clients connected to software they have built/deployed. > > Requirements > * Must have experience with Erlang > * Must have expert level network programming experience, > preferably in Erlang, C++ and/or C > * Strong background in developing for GNU/Linux or Unix-like > platforms for missioncritical production deployments > * Strong understanding of MySQL 4.1-5.x, including database design > patterns and large-scale deployments utilizing replications and/or > clustering > * Experience programming network servers/clients, including > knowledge of fundamental protocols such as TCP, UDP, IPv4/6, and SSL/ > TLS > * Knowledge of and experience using XML technologies > > Keywords: Erlang, MySQL, Linux, XML, Network, Scalable > > Plusses: > * High-availability and scalable network service development > * Experience with Erlang/OTP (Open Telecom Platform) and the > associated design patterns > * Experience with functional programming > * Experience with multi-master clustering and other high > availability techniques > * Proficiency in an industry-recognized scripting language such as > Ruby, Perl, Python, or PHP > * GNU/Linux optimization, security and network administration > * Experience with VoIP and/or libevent > * Experience with distributed architecture, design, implementation > * Secure coding practices > * BS/MS in a related field > > Work Environment > * Work from anywhere > * Structured 8 hour day lets you have a life outside of work > * High-end Mac desktops and laptops with dual 30` cinema displays > * Executive desk with your choice of ergonomic chair > * Full benefits and six figure salary > * Work with some of the brightest and best minds in the industry > > Please respond by email with resume and brief cover letter to: > > > Michael J Mordue > MORDUE ALLEN ROBERTS BONNEY LTD > Search & Placement Consultants > PO Box 450 Gig Harbor WA 98335 > Tel 253 851 5355 Fax 253 851 7969 > email: mordue@REDACTED > > Partner offices in Australia, Japan, > China, Hong Kong, Singapore, S. Korea, > UK, Europe, Canada and the USA > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From dizzyd@REDACTED Mon Jan 21 20:49:44 2008 From: dizzyd@REDACTED (Dave Smith) Date: Mon, 21 Jan 2008 12:49:44 -0700 Subject: [erlang-questions] driver_output works, driver_output_term doesn't In-Reply-To: <3797.192.168.2.11.1200871943.squirrel@www.cyber.no> References: <3797.192.168.2.11.1200871943.squirrel@www.cyber.no> Message-ID: So I wrestled with this recently...things that you might want to check: * Make sure you're opening the port with binary flag (in erlang) * Make sure you initialize the port to be binary output (set_port_control_flags() in the C code) * The other really important thing is to make sure the tuples/lists are properly constructed -- if you terminate them incorrectly, the only way to know is that driver_send_term will fail -- I spent time digging through the VM source to figure out I was not sending tuples properly. :) Those are the big things that stick out in my head... :) Hopefully it helps. D. On Jan 20, 2008 4:32 PM, John M. Nordgaard wrote: > Hi all, > > I have written a small linked-in driver which needs to return some fairly > complex data. So I'd like to use driver_output_term for the job. > > However, I cannot get it to work. More precisely, I never receive a > response from the C code, even when running this simple example: > > ErlDrvTermData t[] = { ERL_DRV_ATOM, driver_mk_atom("unknown") }; > driver_output_term(dd->port, t, size(t) / size(t[0])); > > On the Erlang side 'receive' simply hangs. Strange thing is, replacing the > above with the following code I do in fact receive a response of [0]: > > char res = 0; > driver_output(dd->port, &res, 1); > > It would seem that dd->port as such should be off the hook at this point, > given that it works for 'driver_output'. Question is, am I wrong? Or is > there any other reason why 'driver_output_term' would not work, perhaps a > missing control flag or some other form of setting? > > My system is Gentoo Linux amd64, running 12B-0 with hipe. > > All suggestions appreciated! :-) > > - john. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From rapsey@REDACTED Mon Jan 21 21:03:19 2008 From: rapsey@REDACTED (Rapsey) Date: Mon, 21 Jan 2008 21:03:19 +0100 Subject: [erlang-questions] should be a parallel tcp server, but can't connect to more than 1 client In-Reply-To: <9b08084c0801210154q2e240c2ex8c17cc2489f9e2a5@mail.gmail.com> References: <97619b170801210053r1f7f30e7geee0d3be6edf56d8@mail.gmail.com> <9b08084c0801210154q2e240c2ex8c17cc2489f9e2a5@mail.gmail.com> Message-ID: <97619b170801211203j7d938d6amcb933686a17057e3@mail.gmail.com> Thanks for the help. I guess I still have some C++ habits to forget :) Sergej On Jan 21, 2008 10:54 AM, Joe Armstrong wrote: > What might have happened here is that the process owning the listening > socket has died. > Sockets are owned by the process that creates the socket. if the > owning process dies the > socket is closed. > > If you evaluate start() in the shell then the owning process is the > shell command interpreter, > which usually does not die. If you evaluate start() in some other > process then it might have died in which case > the listening socket will be closed. > > If you change accept_con to print an error you should see this: > > accept_conn(LSock) -> > case gen_tcp:accept(LSock) of > {ok, Sock} -> > spawn(fun() -> accept_conn(LSock) end), > handle_conn(Sock); > X -> > io:format("OOps:pn", [X]) > true > end. > > The way I'd write accept_con (the way in the Erlang book) is like this: > > accept_conn(LSock) -> > {ok, Sock} = case gen_tcp:accept(LSock), > spawn(fun() -> accept_conn(LSock) end), > handle_conn(Sock). > > The way you write things is to silently swallow up the error return > with no warnings, which make things difficult > to debug since you get no indication of error. The Erlang way is to > crash hard and early. > > If the process owning the listen socket has died then you need to make > sure it lives > forever. I'd add a sleep(infinity) to the code, like this: > > start() -> > case gen_tcp:listen(6002, [binary, {packet, 0}, {active, true}, > {reuseaddr, true}]) of > {ok, Sock} -> > spawn(fun() -> accept_conn(Sock) end), sleep(infinity); > {error, Reason} -> {error, Reason} > end. > > where > > sleep(T) -> receive after T -> void end. > > > This version of start can be happily spawned - in the original version > you must ensure that the process evaluating > start() does not die. > > Hope this helps > > /Joe Armstrong > > > > 2008/1/21 Rapsey : > > All this program does is listen on a socket, spawn a new process on > every > > connection and send a never ending stream of numbers to each client that > > connects to it. The problem is that once 1 client is connected, no one > else > > can connect, even though a new acceptor process has been spawned. > > > > > > start() -> > > case gen_tcp:listen(6002, [binary, {packet, 0}, {active, true}, > > {reuseaddr, true}]) of > > {ok, Sock} -> > > spawn(fun() -> accept_conn(Sock) end); > > {error, Reason} -> {error, Reason} > > end. > > > > > > accept_conn(LSock) -> > > case gen_tcp:accept(LSock) of > > {ok, Sock} -> > > spawn(fun() -> accept_conn(LSock) end), > > handle_conn(Sock); > > _ -> > > true > > end. > > > > % wait for http request from browser > > handle_conn(Sock) -> > > receive > > {tcp, RecSock, Data} -> > > send_stream(RecSock, 0); > > {tcp_closed, _} -> > > true > > end. > > > > send_stream(Sock, N) when N == 0 -> > > gen_tcp:send(Sock, "HTTP/1.1 200 OK\r\nContent-type: > > text/html\r\n\r\nWOHOO
"), > > send_stream(Sock, N + 1); > > send_stream(Sock, N) -> > > case gen_tcp:send(Sock, integer_to_list(N)) of > > ok -> > > timer:sleep(1000), > > send_stream(Sock, N + 1); > > Any -> > > true > > end. > > > > > > thank you, > > Sergej > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From launoja@REDACTED Mon Jan 21 21:17:31 2008 From: launoja@REDACTED (Jani Launonen) Date: Mon, 21 Jan 2008 22:17:31 +0200 Subject: [erlang-questions] program: Bloom filter (probabilistic lookup table) --- performance figures needed Message-ID: Hello all, I've implemented Bloom filter (http://en.wikipedia.org/wiki/ Bloom_filter) as a little excercise on R12B's bitstrings. I made few versions to see how to make them perform and how to not get warnings about unoptimised bitstring usage (ok, inserting key gives warning, but that's not that interesting, looking up keys is). My compliments for the new Erlang Efficiency Guide and for the bitstring syntax support to all involved parties! I made some tests to see how Bloom filter performs when compared against ets in looking up inserted keys. I've got Mac Mini Core Duo so I can't see how native compiled Bloom filter would do compared to ets. With interpreted code Bloom filter is mostly slower with more than 1 hash (k > 1). Unfortunately the false positive rate is rather high (depending on key population and number of bits in array, of course) in that case. So if native compilation would boost hash calculation (seems to be the bottleneck) several times BloomIER filter could be usable for example doing number analyser (if false positives are taken into account --- see wikipedia article). Changing erlang:phash2 to a more specific set of hash functions could also make difference. Or dynamically generate and compile code to match all bits at a time (would require sorting offsets and calculating their intervals --- perhaps slower). Anyways, if somebody with platform supporting native compilation could report some numbers, I'd be grateful. The test reports the size of the bit array (M), number of keys inserted (N), number of hashes (bits) per key (K), false positives (FP) --- also in percentages, inserting keys into Bloom filter in microseconds (IB), inserting keys into ets table (IE), looking up keys from Bloom filter (LB) and finally looking up keys from ets table (LE). Times in microseconds. The generated test sets could be memoized for better testing performance but I couldn't bother. Here's some number I got: M=2048 N=256 K=1 FP 10537/89744 (11.74%) IB 600 IE 545 LB 134 LE 162 M=8192 N=256 K=4 FP 17/89744 (0.02%) IB 6149 IE 486 LB 386 LE 156 M=8192 N=1024 K=8 FP 2413/88976 (2.71%) IB 50451 IE 1069 LB 2636 LE 622 M=65536 N=4096 K=2 FP 1165/85904 (1.36%) IB 354567 IE 4950 LB 3460 LE 2792 M=65536 N=8192 K=8 FP 2112/81808 (2.58%) IB 2124279 IE 9471 LB 21683 LE 5429 M=131072 N=8192 K=2 FP 1147/81808 (1.40%) IB 1090229 IE 9164 LB 6729 LE 5413 M=131072 N=8192 K=10 FP 75/81808 (0.09%) IB 5092386 IE 9710 LB 26914 LE 5566 Here's the code (public domain --- do what you wish): -------------- next part -------------- A non-text attachment was scrubbed... Name: test_bloom_filter.erl Type: application/octet-stream Size: 3392 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: bloom_filter2.erl Type: application/octet-stream Size: 3853 bytes Desc: not available URL: -------------- next part -------------- Cheers, Jani L. From rvirding@REDACTED Mon Jan 21 23:36:04 2008 From: rvirding@REDACTED (Robert Virding) Date: Mon, 21 Jan 2008 23:36:04 +0100 Subject: [erlang-questions] Erlounge in San Francisco, 17-22 February In-Reply-To: <6a36e7290801191709x2fd24521tdd8442aeb9121a7b@mail.gmail.com> References: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> <6a36e7290801191709x2fd24521tdd8442aeb9121a7b@mail.gmail.com> Message-ID: <3dbc6d1c0801211436l7947056fudb7524200368be95@mail.gmail.com> On 20/01/2008, Bob Ippolito wrote: > > On Jan 19, 2008 4:52 PM, Travis Jensen wrote: > > > > On Jan 19, 2008, at 9:27 AM, Robert Virding wrote: > > > > > > > > *Game Developers Conference which until recently has had very little > > > to do with Erlang, they're all C++ weenies. > > > > So this piqued my interested. Does this imply that things are > > changing in that regard? > > > > Well, there's at least one publicly known game server written in > Erlang: Vendetta Online. One is better than zero :) That's the one I meant, and one is definitely better than zero. :-) Unfortunately, though I work with games I am not in a position to either write them or really influence in what they are written. I work with military procurement, mainly keeping track of the (serious and military) side of the games industry. While we have done some development it has not been scratch but modding existing games engines (Unreal Tournament). Look at http://youtube.com/watch?v=3vfm7hyj-xg for a short film of it. Or search for "foreign ground". Also unfortunately we don't do the work ourselves, it's procurement so we order from industry and someone else has all the fun. :-) We're using Erlang to run an ad network for Flash games (amongst other > things), and some of us will be at GDC as well. Definitely hope to meet you there. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From wglozer@REDACTED Mon Jan 21 23:49:05 2008 From: wglozer@REDACTED (Will) Date: Mon, 21 Jan 2008 14:49:05 -0800 Subject: [erlang-questions] Erlounge in San Francisco, 17-22 February In-Reply-To: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> References: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> Message-ID: Awesome, count me in! I live in the city, so not picky about times or places =) 2008/1/19 Robert Virding : > I will be in San Francisco 17-22 of February (actually from the 16th) for a > conference* and if there are any other Erlangers there perhaps we could meet > over a beer and have a nice discussion. Let me know and we can arrange > something. From dreid@REDACTED Tue Jan 22 00:02:39 2008 From: dreid@REDACTED (David Reid) Date: Mon, 21 Jan 2008 15:02:39 -0800 Subject: [erlang-questions] Erlounge in San Francisco, 17-22 February In-Reply-To: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> References: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> Message-ID: Hi Robert, On Jan 19, 2008, at 8:27 AM, Robert Virding wrote: > I will be in San Francisco 17-22 of February (actually from the > 16th) for a conference* and if there are any other Erlangers there > perhaps we could meet over a beer and have a nice discussion. Let me > know and we can arrange something. Totally in. -David Reid From fritchie@REDACTED Tue Jan 22 00:19:23 2008 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Mon, 21 Jan 2008 17:19:23 -0600 Subject: [erlang-questions] How to use Mnesia Database from C/C++/Java ? In-Reply-To: Message of "Mon\, 21 Jan 2008 11\:28\:31 +0100." <41030.193.3.142.122.1200911311.squirrel@www.widetrail.dk> Message-ID: <991.1200957563@snookles.snookles.com> S?ren Hilmer wrote: sh> There is/used to be, something called Mnesia Session for doing sh> exactly this. I think it's been deprecated. The bad news Amritpal will have to implement an interface from scrach. The good news is that it isn't difficult, and there are plenty of protocols to choose from. Mnesia Session used CORBA, which I wouldn't recommend. You could do also the same structured-data things as the old Mnesia Session CORBA via the Sun RPC library that's in Jungerl. Using a simple/RESTful GET/POST/DELETE interface using HTTP is quite simple. Using SOAP wouldn't be much harder, though why you'd want to get XML involved is an excellent question. Also, I've seen least one "memcached" server implementation in Erlang (I forget the author's name but not the language: Japanese). Even easier would be to have your C code use the Erlang term format (see http://www.erlang.org/doc/apps/erl_interface/part_erl_interface_frame.html). At my current employer, the whole Erlang "thing" was new enough that the client team didn't want to use an Erlang-specific wire format, in the event the Erlang experiment failed. So we rolled our own little text, TCP-based protocol. {shrug} I don't know if this list posting contains anything new, but if it's helpful, great. http://www.nabble.com/Mnesia-td10106072.html -Scott From travis.jensen@REDACTED Tue Jan 22 00:27:07 2008 From: travis.jensen@REDACTED (Travis Jensen) Date: Mon, 21 Jan 2008 16:27:07 -0700 Subject: [erlang-questions] Erlounge in San Francisco, 17-22 February In-Reply-To: <3dbc6d1c0801211436l7947056fudb7524200368be95@mail.gmail.com> References: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> <6a36e7290801191709x2fd24521tdd8442aeb9121a7b@mail.gmail.com> <3dbc6d1c0801211436l7947056fudb7524200368be95@mail.gmail.com> Message-ID: <193703E8-E412-46F4-BC7E-9CBFFD13EF82@gmail.com> Man, I wish I could get there. Maybe I can talk my boss into it, as an R&D effort (I'm in the Salt Lake City area, myself). I'm currently incubating an idea for a massively-multiplayer game/ company. As I've evaluated technologies, I'm convinced that Erlang is my platform; now it is a matter of getting enough of the idea put together (both in code and in business plan) to attract some funding. Of course, that means I have to learn, learn, and learn some more. :) tj On Jan 21, 2008, at 3:36 PM, Robert Virding wrote: > On 20/01/2008, Bob Ippolito wrote: > On Jan 19, 2008 4:52 PM, Travis Jensen > wrote: > > > > On Jan 19, 2008, at 9:27 AM, Robert Virding wrote: > > > > > > > > *Game Developers Conference which until recently has had very > little > > > to do with Erlang, they're all C++ weenies. > > > > So this piqued my interested. Does this imply that things are > > changing in that regard? > > > > Well, there's at least one publicly known game server written in > Erlang: Vendetta Online. One is better than zero :) > > That's the one I meant, and one is definitely better than zero. :-) > > Unfortunately, though I work with games I am not in a position to > either write them or really influence in what they are written. I > work with military procurement, mainly keeping track of the (serious > and military) side of the games industry. While we have done some > development it has not been scratch but modding existing games > engines (Unreal Tournament). Look at http://youtube.com/watch?v=3vfm7hyj-xg > for a short film of it. Or search for "foreign ground". Also > unfortunately we don't do the work ourselves, it's procurement so we > order from industry and someone else has all the fun. :-) > > We're using Erlang to run an ad network for Flash games (amongst other > things), and some of us will be at GDC as well. > > Definitely hope to meet you there. > > Robert > Travis Jensen travis.jensen@REDACTED http://softwaremaven.innerbrane.com/ You should read my blog; it is more interesting than my signature. -------------- next part -------------- An HTML attachment was scrubbed... URL: From masterofquestions@REDACTED Tue Jan 22 03:39:08 2008 From: masterofquestions@REDACTED (Russell King) Date: Mon, 21 Jan 2008 21:39:08 -0500 Subject: [erlang-questions] Murdering Erlang: Interrupting Erlang Processes Message-ID: <1218d6a50801211839q1758eeb8i4b210aee14dbd979@mail.gmail.com> Erl Shell ctrl + c option to view the process info: =proc:<0.56.0> State: Waiting Spawned as: erlang:apply/2 Spawned by: <0.24.0> Started: Mon Jan 21 16:09:16 2008 Message queue length: 0 Number of heap fragments: 0 Heap fragment data: 0 Link list: [<0.24.0>] Reductions: 8 Stack+heap: 233 OldHeap: 0 Heap unused: 214 OldHeap unused: 0 Stack dump: Program counter: 0x005002e8 (shell:eval_loop/3 + 44) CP: 0x081c2e38 () arity = 0 0x00231b7c Return addr 0x081c2e38 () y(0) [] y(1) [] y(2) 15 y(3) [] y(4) <0.24.0> (k)ill (n)ext (r)eturn: Can someone tell me what is y(0),y(1)..,y(4), heap fragment data, number of heap fragments, link list, reductions, stack+heap? "Heap unused" and "OldHeap unused" relates to memory allowed for each processes? How do you interpret the data displayed by erl shell, when you do ctrl+c and choose a erlang process? thank you! Hoping Erlang Mailing list isn't a black hole ;) -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave@REDACTED Tue Jan 22 04:07:18 2008 From: dave@REDACTED (Dave Peticolas) Date: Mon, 21 Jan 2008 19:07:18 -0800 Subject: [erlang-questions] Erlounge in San Francisco, 17-22 February In-Reply-To: References: <3dbc6d1c0801190827l11ac1050yae37415a0e565270@mail.gmail.com> Message-ID: <47955DE6.8060807@krondo.com> David Reid wrote: > Hi Robert, > On Jan 19, 2008, at 8:27 AM, Robert Virding wrote: > >> I will be in San Francisco 17-22 of February (actually from the >> 16th) for a conference* and if there are any other Erlangers there >> perhaps we could meet over a beer and have a nice discussion. Let me >> know and we can arrange something. > > Totally in. > > -David Reid > ___________ I would love to join as well, I'm brand new to Erlang. dave From bbmaj7@REDACTED Tue Jan 22 03:34:08 2008 From: bbmaj7@REDACTED (Richard Andrews) Date: Tue, 22 Jan 2008 13:34:08 +1100 (EST) Subject: [erlang-questions] Seeking snmp_pdus examples Message-ID: <500439.88931.qm@web52012.mail.re2.yahoo.com> I have a need to build SNMP PDUs directly but the documentation is a bit thin on this point. Can anyone provide examples of constructing a snmpv2-trap PDU using this interface? -- Rich Make the switch to the world's best email. Get the new Yahoo!7 Mail now. www.yahoo7.com.au/worldsbestemail From lcoquelle@REDACTED Tue Jan 22 06:28:46 2008 From: lcoquelle@REDACTED (Ludovic Coquelle) Date: Tue, 22 Jan 2008 13:28:46 +0800 Subject: [erlang-questions] How to use Mnesia Database from C/C++/Java ? In-Reply-To: References: <3543.48750920526$1200902264@news.gmane.org> Message-ID: On Jan 21, 2008 5:55 PM, Michael Gebetsroither wrote: > * Amritpal Singh wrote: > > > Now, my problem is , i don't want to change the core of my application > whic= > > h is already encoded in 'C' , so need to access 'Mnesia DB' from 'C'. > > As per my findings, there are no ODBC drivers available for Mnesia. > > So, think need to have some kind of external interface to 'Erlang' like > 'Er= > > l_Interface' which i can use from 'C' program to interact with 'Mnesia > DB'. > > If you have used sql before to store your temporary data, whats about > sqlite? Just open an sqlite db with name ":memory:" and it creates an > complete in-memory db easily accessible from your c program. Indeed SQLite usage would be very close to MySQL. Also BerkeleyDB storage (or memcacheddb) would be very close to mnesia (I have no clue at all on BDB distribution capabilities). Could someone explain where a C binding to Mnesia is really different? is it in for distribution aspect? thanks ludo > > > cu, > michael > -- > It's already too late! > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsu79@REDACTED Tue Jan 22 08:39:56 2008 From: chsu79@REDACTED (Christian S) Date: Tue, 22 Jan 2008 08:39:56 +0100 Subject: [erlang-questions] High volume CDR analysis In-Reply-To: <34A79AA2-19B4-4276-AAD9-151332248068@gencay.net> References: <7A3ACF0B-BD04-4108-A0E0-7E8548B7983B@gencay.net> <34A79AA2-19B4-4276-AAD9-151332248068@gencay.net> Message-ID: On Jan 21, 2008 5:53 PM, Ukyo Virgden wrote: > Hi Christian, > > You're right. What I'm imagining is to collect call detail records > from several telco equipment and periodically create reports. At this > moment I'm not thinking about real-time (by realtime I mean as-it- > happens) reports. > > So this basically means, collect input data in parallel, apply some > transformation, store in mnesia and run a job to create reports. > > Therefore, the only data I need to store is for only one period, > which is 100-300 million records of input. > > Any suggestions? I suppose there is a storage limit of 2gig for > mnesia per node right? There is a storage limit per disk table. I.e. you could create and direct logging to a new table before the current one has time to grow full. I believe you would be better off recording these CDRs to flat files, perhaps using the disk_log library which can give you copies on multiple nodes. The later would be a very primitive form of column-based table representation. From ingela@REDACTED Tue Jan 22 08:49:26 2008 From: ingela@REDACTED (Ingela Anderton Andin) Date: Tue, 22 Jan 2008 08:49:26 +0100 Subject: [erlang-questions] inets & EWSAPI (001001 001011) In-Reply-To: References: Message-ID: <4795A006.5050001@erix.ericsson.se> > On 18/01/2008, 001001 001011 wrote: > >> Dear Erlang-Community! >> >> i have a very basic question regarding the >> EWSAPI. i was able to start the webserver >> from the inets-example directory and was >> served the index-page in the htdocs-folder. >> >> i created a link from the login page to my >> own .html file containing several forms >> (method=post) that are submitted. >> >> and now i'm stuck. what is the best way to >> create an entry point to the EWSAPI modules >> in order to handle the request? The modules referred to as EWSAPI modules are the modules that implement part of the webserver as mod_get, mod_log, mod_esi etc and it is possible to replace mod_* modules with your own variant or extend with new mod_* modules. Which mod_* modules that are used when processing a request is determined by the modules property equvialent to the Apche like directive"Modules". A mod_* module should implement the callbacks documented in the httpd man page. http://www.erlang.org/doc/apps/inets/ref_man_frame.html >> In your configuration file for the inets application, include the >> ErlScriptAlias directive and list all modules which are allowed to be >> invoked via HTTP. Once that is done, and URL of the form: >> >> http://server:port/cgi-bin/erl/Module/Function?args >> >> will result in the function Module:Function/2 being invoked. >> >> cheers >> Chandru >> You can also read about this in Inets Users Guide in the section "Dynamic Web Pages" http://www.erlang.org/doc/apps/inets/part_frame.html and "ErlScriptAlias" and other properties of the web server are documented in the httpd manualpage. (Note: The above format is if you use Apache-style configuration files for the HTTP server, from inets-5.0, R12B it is also possible to use erlang-style property-lists both directly and stored in a file to start a HTTP server. Also note that there are more default values since R12B) http://www.erlang.org/doc/apps/inets/ref_man_frame.html Regards Ingela - OTP team From jeffm@REDACTED Tue Jan 22 08:58:16 2008 From: jeffm@REDACTED (jm) Date: Tue, 22 Jan 2008 18:58:16 +1100 Subject: [erlang-questions] erlang-mysql-driver timeout Message-ID: <4795A218.8060105@ghostgun.com> This is not exactly an erlyweb problem, but this seems to be the most appropriate list for it seeing as yariv had a hand in the module. I downloaded the erlang-mysql-driver via svn and have a small program querying a mysql table with 6638930 rows. A pool of connects are set up, I've tried 1 to about 6, and select queries run against the database. Small numbers of queries work but after about eight queries are logged on the console. This happens ** exception exit: {timeout,{gen_server,call, [mysql_dispatcher, {fetch,p1, << The select string removed ...>>}]}} in function gen_server:call/2 in call from cust_speeds:'-process_files/3-fun-0-'/4 in call from lists:foldl/3 in call from cust_speeds:process_files/3 I've run some of the queries manually in the mysql client and no more than about 40 rows are ever returned and the processing is never slow. Does anyone have any suggestions? The other question is how do I stop the mysql driver process started with mysql:start_link(...) ? Jeff. From erlang@REDACTED Tue Jan 22 09:39:41 2008 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 22 Jan 2008 09:39:41 +0100 Subject: [erlang-questions] High volume CDR analysis In-Reply-To: References: <7A3ACF0B-BD04-4108-A0E0-7E8548B7983B@gencay.net> <34A79AA2-19B4-4276-AAD9-151332248068@gencay.net> Message-ID: <9b08084c0801220039tb271216o91f3441425fd53a5@mail.gmail.com> What you also need to tell us is how independent the data is. Do you need access to all data in the same name space in order to analyze it? Suppose, for example, I wanted to keep a records of billing data, where the key is a persons name. This data is independent - ie Joe's bills don't depend upon Ukyo's bills. This kind of computation is easily distributed and scales nicely. If I have N machines then I could keep my billing data on machine K, where K = md5("joe armstrong") mod N, for fault tolerance I might keep a replica on machine (K + N/2) mod N. For partitionable data nothing fancy is required - distributed Erlang on a cluster would be fine. The key to scaling your solution depends upon how well you can partition your problem into independent tasks that can be performed in parallel - it's got nothing to do with programming language - it's *easier* to implement a distributed system in Erlang (since you get all the plumbing for free) - but Erlang won't save you from a bad architecture - "put everything in a huge database" is often a very bad idea - much better is to think about what data you need and where you will place it and try to make sure you can move the data and access it in a reasonably efficient way. /Joe Armstrong On Jan 22, 2008 8:39 AM, Christian S wrote: > On Jan 21, 2008 5:53 PM, Ukyo Virgden wrote: > > Hi Christian, > > > > You're right. What I'm imagining is to collect call detail records > > from several telco equipment and periodically create reports. At this > > moment I'm not thinking about real-time (by realtime I mean as-it- > > happens) reports. > > > > So this basically means, collect input data in parallel, apply some > > transformation, store in mnesia and run a job to create reports. > > > > Therefore, the only data I need to store is for only one period, > > which is 100-300 million records of input. > > > > Any suggestions? I suppose there is a storage limit of 2gig for > > mnesia per node right? > > There is a storage limit per disk table. I.e. you could create and > direct logging > to a new table before the current one has time to grow full. > > I believe you would be better off recording these CDRs to flat files, > perhaps using > the disk_log library which can give you copies on multiple nodes. > > The later would be a very primitive form of column-based table representation. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bjorn@REDACTED Tue Jan 22 09:43:31 2008 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 22 Jan 2008 09:43:31 +0100 Subject: [erlang-questions] Murdering Erlang: Interrupting Erlang Processes In-Reply-To: <1218d6a50801211839q1758eeb8i4b210aee14dbd979@mail.gmail.com> References: <1218d6a50801211839q1758eeb8i4b210aee14dbd979@mail.gmail.com> Message-ID: "Russell King" writes: > Can someone tell me what is y(0),y(1)..,y(4), heap fragment data, number of > heap fragments, link list, reductions, stack+heap? y(0) and so on are locations on the stack frame. Each location contain a value that need to survive a function call. Heap fragment data is Erlang terms allocated outside the heap for the process by BIFs because there was insufficient room left on the heap. In R12B, heap fragments are garbage-collected away as soon as the BIF is done, so it is unlikely that the value would ever be non-zero. Number of heap fragments - see above, likely to always be zero in R12B. Link list - all processes or ports that this process is linked to. Reductions - a counter that is incremented for every function call (and by some BIFs too). There will be a context switch when the number of reductions reaches a certain value (currently 2000). Stack+heap - the size of the memory block allocated for the heap and stack for the Erlang process. The stack and heap grow towards each other. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From nick@REDACTED Tue Jan 22 10:02:38 2008 From: nick@REDACTED (Niclas Eklund) Date: Tue, 22 Jan 2008 10:02:38 +0100 (MET) Subject: [erlang-questions] How to use Mnesia Database from C/C++/Java ? In-Reply-To: <991.1200957563@snookles.snookles.com> Message-ID: Hello! Yes, Mnesia Session is no longer supported (R12B). Since Mnesia Session was based on dirty operations, you're better of defining an API that maps to the data model. A step by step example you can find here: http://www.erlang.org/doc/apps/orber/ch_idl_to_erlang_mapping.html#6 Or you can use Jinterface and/or Erl_interface, but CORBA makes it easy to hook in another backend due to the number of available language bindings: http://www.puder.org/corba/matrix/ As mentioned there are more alternatives (HTTP, SNMP etc), which is why it's hard to tell which solution would be the best choice for you. /Niclas On Mon, 21 Jan 2008, Scott Lystig Fritchie wrote: > S?ren Hilmer wrote: > > sh> There is/used to be, something called Mnesia Session for doing > sh> exactly this. > > I think it's been deprecated. > > The bad news Amritpal will have to implement an interface from scrach. > The good news is that it isn't difficult, and there are plenty of > protocols to choose from. Mnesia Session used CORBA, which I wouldn't > recommend. You could do also the same structured-data things as the old > Mnesia Session CORBA via the Sun RPC library that's in Jungerl. > > Using a simple/RESTful GET/POST/DELETE interface using HTTP is quite > simple. Using SOAP wouldn't be much harder, though why you'd want to > get XML involved is an excellent question. Also, I've seen least one > "memcached" server implementation in Erlang (I forget the author's name > but not the language: Japanese). > > Even easier would be to have your C code use the Erlang term format (see > http://www.erlang.org/doc/apps/erl_interface/part_erl_interface_frame.html). > At my current employer, the whole Erlang "thing" was new enough that the > client team didn't want to use an Erlang-specific wire format, in the > event the Erlang experiment failed. So we rolled our own little text, > TCP-based protocol. {shrug} > > I don't know if this list posting contains anything new, but if it's > helpful, great. http://www.nabble.com/Mnesia-td10106072.html > > -Scott > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From amritpal.singh@REDACTED Tue Jan 22 10:30:56 2008 From: amritpal.singh@REDACTED (Amritpal Singh) Date: Tue, 22 Jan 2008 15:00:56 +0530 Subject: [erlang-questions] How to use Mnesia Database from C/C++/Java ? In-Reply-To: References: <991.1200957563@snookles.snookles.com> Message-ID: <007201c85cd9$7e1b0de0$7a5129a0$@singh@cellebrum.com> Dear All, Thanks a lot for sharing your valuable inputs, would decide on this further and discuss with you all. Regards, Amritpal Singh -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Niclas Eklund Sent: 22 January 2008 14:33 To: Scott Lystig Fritchie Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] How to use Mnesia Database from C/C++/Java ? Hello! Yes, Mnesia Session is no longer supported (R12B). Since Mnesia Session was based on dirty operations, you're better of defining an API that maps to the data model. A step by step example you can find here: http://www.erlang.org/doc/apps/orber/ch_idl_to_erlang_mapping.html#6 Or you can use Jinterface and/or Erl_interface, but CORBA makes it easy to hook in another backend due to the number of available language bindings: http://www.puder.org/corba/matrix/ As mentioned there are more alternatives (HTTP, SNMP etc), which is why it's hard to tell which solution would be the best choice for you. /Niclas On Mon, 21 Jan 2008, Scott Lystig Fritchie wrote: > S?ren Hilmer wrote: > > sh> There is/used to be, something called Mnesia Session for doing > sh> exactly this. > > I think it's been deprecated. > > The bad news Amritpal will have to implement an interface from scrach. > The good news is that it isn't difficult, and there are plenty of > protocols to choose from. Mnesia Session used CORBA, which I wouldn't > recommend. You could do also the same structured-data things as the old > Mnesia Session CORBA via the Sun RPC library that's in Jungerl. > > Using a simple/RESTful GET/POST/DELETE interface using HTTP is quite > simple. Using SOAP wouldn't be much harder, though why you'd want to > get XML involved is an excellent question. Also, I've seen least one > "memcached" server implementation in Erlang (I forget the author's name > but not the language: Japanese). > > Even easier would be to have your C code use the Erlang term format (see > http://www.erlang.org/doc/apps/erl_interface/part_erl_interface_frame.html). > At my current employer, the whole Erlang "thing" was new enough that the > client team didn't want to use an Erlang-specific wire format, in the > event the Erlang experiment failed. So we rolled our own little text, > TCP-based protocol. {shrug} > > I don't know if this list posting contains anything new, but if it's > helpful, great. http://www.nabble.com/Mnesia-td10106072.html > > -Scott > _______________________________________________ > 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 This message and its attachments contain confidential information and may also contain legally privileged information. This message is intended solely for the named addressee. If you are not the addressee indicated in this message (or authorized to receive for addressee), you may not copy or deliver any part of this message or its attachments to anyone or use any part of this message or its attachments. Rather, you should permanently delete this message and its attachments (and all copies) from your system and kindly notify the sender by reply e-mail. Any content of this message and its attachments that does not relate to the official business of Cellebrum.com Pvt Ltd or its affiliates and/or subsidiaries must be taken not to have been sent or endorsed by any of them. Opinions and information in this email that do not relate to the official business of Cellebrum.com Pvt Ltd, shall be understood as neither given nor endorsed by Cellebrum.com Pvt Ltd. Any action/proceeding/opportunity upon the contents of this email taken by not intended addressee shall attract liabilities both criminal and civil against such addressee. Email communications are not private and no warranty is made that e-mail communications are timely, secure or free from computer virus or other defect. From chandrashekhar.mullaparthi@REDACTED Tue Jan 22 10:52:56 2008 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Tue, 22 Jan 2008 09:52:56 +0000 Subject: [erlang-questions] High volume CDR analysis In-Reply-To: <34A79AA2-19B4-4276-AAD9-151332248068@gencay.net> References: <7A3ACF0B-BD04-4108-A0E0-7E8548B7983B@gencay.net> <34A79AA2-19B4-4276-AAD9-151332248068@gencay.net> Message-ID: On 21/01/2008, Ukyo Virgden wrote: > > Any suggestions? I suppose there is a storage limit of 2gig for > mnesia per node right? > There is a limit of 2GB per dets file table. Mnesia's disc_copies tables and disc_only_copies tables are stored on disk in dets file. That doesn't stop you from having multiple tables each with about 2GB of data. If you use 32 bit erlang, you can address 4GB of memory. If you use 64 bit erlang, you can address more memory than you will need to but will hit other design limitations in mnesia. A mix of fragmented mnesia tables and 64 bit erlang will go a long way. For 300 million records, at 1KB a record, you will roughly need 300GB of storage. Since a machine with that much RAM is out of the question for most people/organisations, you will have to process them incrementally. That is where Joe's mail comes in about partitioning your problem. cheers Chandru From visionary_synthesis@REDACTED Tue Jan 22 17:42:49 2008 From: visionary_synthesis@REDACTED (001001 001011) Date: Tue, 22 Jan 2008 08:42:49 -0800 (PST) Subject: [erlang-questions] inets & EWSAP Message-ID: <352927.91507.qm@web39501.mail.mud.yahoo.com> Dear Erlang-community! Thanks a lot for your eye- opening response, especially to Ingela & Chandru. My WS is now up 'n running and it's great fun to dive into the API and see the results.. cheers, Theo --------------------------------- Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Logan@REDACTED Tue Jan 22 19:01:44 2008 From: Martin.Logan@REDACTED (Logan, Martin) Date: Tue, 22 Jan 2008 12:01:44 -0600 Subject: [erlang-questions] Erlounge in Chicago Feb 12-14 In-Reply-To: <591437DF-8ED5-4B09-905F-FD7D50096AA5@hypotheticalabs.com> References: <591437DF-8ED5-4B09-905F-FD7D50096AA5@hypotheticalabs.com> Message-ID: Sounds like a good plan. I will work on getting a location and inviting a bunch of other erlangers. Cheers, Martin -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Kevin A. Smith Sent: Saturday, January 19, 2008 11:11 AM To: erlang-questions@REDACTED Subject: [erlang-questions] Erlounge in Chicago Feb 12-14 I'm going to be in Chicago Feb 12 - 14 for the PragProg Erlang Studio. I'd love to meet any fellow Erlangers in the area maybe for a bite of dinner or a couple of pints. Drop me a line and well see what we can arrange. --Kevin _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From Martin.Logan@REDACTED Tue Jan 22 19:05:14 2008 From: Martin.Logan@REDACTED (Logan, Martin) Date: Tue, 22 Jan 2008 12:05:14 -0600 Subject: [erlang-questions] determining what erts version a .beam was compiled with Message-ID: Does anyone know whether it is possible to tell by inspecting some .beam object code what erts vsn it was compiled on? Cheers, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From simonpeterchappell@REDACTED Tue Jan 22 22:05:56 2008 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Tue, 22 Jan 2008 15:05:56 -0600 Subject: [erlang-questions] Erlounge in Chicago Feb 12-14 In-Reply-To: References: <591437DF-8ED5-4B09-905F-FD7D50096AA5@hypotheticalabs.com> Message-ID: <8ed733900801221305jb544be8rcfd2a8cc6912ce8b@mail.gmail.com> Close but just too far for me. Are there any Erlangers near Madison, Wisconsin? On Jan 22, 2008 12:01 PM, Logan, Martin wrote: > > Sounds like a good plan. I will work on getting a location and > inviting a bunch of other erlangers. > > Cheers, > Martin > > > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Kevin A. Smith > Sent: Saturday, January 19, 2008 11:11 AM > To: erlang-questions@REDACTED > Subject: [erlang-questions] Erlounge in Chicago Feb 12-14 > > I'm going to be in Chicago Feb 12 - 14 for the PragProg Erlang Studio. > I'd love to meet any fellow Erlangers in the area maybe for a bite of > dinner or a couple of pints. Drop me a line and well see what we can > arrange. > > --Kevin > _______________________________________________ > 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 > -- simonpeter.org | simonpeter.com | newlife-upc.org | wisconsindistrictnews.org From valentin@REDACTED Tue Jan 22 20:11:11 2008 From: valentin@REDACTED (Valentin Micic) Date: Tue, 22 Jan 2008 21:11:11 +0200 Subject: [erlang-questions] Crypto module Message-ID: <003801c85d2a$903f8270$6401a8c0@moneymaker2> Hi all, I do not see any reference in documentation for R12 regarding crypto library, thus, I would really appreciate if anyone could answer this question: Is SHA-2 supported (a.k.a 256-bit SHA) supported? V. PS Apologies if similar question has been asked, but am not in a position to search through archives... From fess-erlang@REDACTED Tue Jan 22 22:44:43 2008 From: fess-erlang@REDACTED (fess) Date: Tue, 22 Jan 2008 13:44:43 -0800 Subject: [erlang-questions] What level of bundling is correct for sharing code? In-Reply-To: <73534CA0-0FFC-4435-94EE-BC0B754F798E@fess.org> References: <73534CA0-0FFC-4435-94EE-BC0B754F798E@fess.org> Message-ID: <57C643AE-3255-4E88-B7AA-A77B9F1244FD@fess.org> As a follow up, now that I better understand things, What I was trying to ask how to bundle my rrdtool port, such that someone who wanted to run more than one per node could reuse the existing modules w/out the application start interface forcing a particular way of running things on the user. I believe that the answer to that is to make an application such that application:start/1 starts up the simple case of one single Port, anyone wanting to extend this application can choose not to start via the application, and instead include it in their own application which just starts the supervisor itself. All this of course would require the supervisor, and all the call interfaces to support multiple copies, such that they didn't rely on a single registered name, which they don't. So for now I opted to keep it simple, and I've re-released the whole thing as a simple application which will startup one rrdtool Port. Then if I or someone else needs more rrd concurency than that, it can be added later, when I hopefully have an even better understanding of the erlang environment. --fess On Jan 15, 2008, at 2:01 PM, fess wrote: > Hi, > > I did end up writing my own Port for rrdtool, and I put it up on > google code. http://code.google.com/p/erlrrd/ [comments welcome, > http://erlrrd.googlecode.com/svn/trunk/erlrrd/src/erlrrd.erl ] since > I'm new to erlang, it has been a good exercise. > > At the moment it's just a gen_server call back module in a single > file, It talks to a single rrdtool unix process. > > I'm wondering what the right level of bundling should be to share > this with the world, From Lennart.Ohman@REDACTED Wed Jan 23 00:18:00 2008 From: Lennart.Ohman@REDACTED (=?iso-8859-1?Q?Lennart_=D6hman?=) Date: Wed, 23 Jan 2008 00:18:00 +0100 Subject: [erlang-questions] determining what erts version a .beam was compiled with In-Reply-To: References: Message-ID: I believe there is a version attribute in the module_info tag 'compile' telling at least the version of the compiler application used. I guess this is actually more accurate since it must be for which beam object code has been generated that is of interest. Not necessarily which runtime system was used when compiling. But I further guess that you must inspect this information using some beam_lib function, because otherwise you must call the module_info function and that means you have to load the module. But if it is incompatible (younger than) to your runtime system at hand, that can be difficult. Best Regards Lennart --------------------------------------------------------------------------- Lennart ?hman phone : +46-8-587 623 27 Sj?land & Thyselius Telecom AB cellular: +46-70-552 6735 H?lsingegatan 43, 10th floor fax : +46-8-667 8230 SE-113 31 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED ________________________________________ From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Logan, Martin Sent: den 22 januari 2008 19:05 To: erlang-questions@REDACTED Subject: [erlang-questions] determining what erts version a .beam was compiled with Does anyone know whether it is possible to tell by inspecting some .beam object code what erts vsn it was compiled on? Cheers, Martin From helmick@REDACTED Wed Jan 23 01:03:23 2008 From: helmick@REDACTED (Helmick, Mike) Date: Tue, 22 Jan 2008 16:03:23 -0800 Subject: [erlang-questions] escript with module dependencies Message-ID: <61C12C3539B0524D9A0F76A7F148CC0E01ADC3C511@EX-SEA5-C.ant.amazon.com> Hello - I'm looking to run several scripts that depend on the same modules. I have several questions/issues related to this. 1) Is there are way to compile the .erl files to beams when the escript is invoked? - thus eliminating the need for a build step. 2) Is there a way to signal escript to look for beams in a different directory than the current runtime? thanks, mike helmick From masterofquestions@REDACTED Tue Jan 22 15:27:02 2008 From: masterofquestions@REDACTED (Russell King) Date: Tue, 22 Jan 2008 09:27:02 -0500 Subject: [erlang-questions] Murdering Erlang: Interrupting Erlang Processes In-Reply-To: References: <1218d6a50801211839q1758eeb8i4b210aee14dbd979@mail.gmail.com> Message-ID: <1218d6a50801220627j7d51cb0w4adac1f83a90a6e2@mail.gmail.com> Thanks. Actually, this information is in ERTS manual section 1.2.10. You always find the answer to your question after you have posted the email. By the way, great documentation. For whatever reason, google search didn't give me anything. Funny thing is that I was reading the document 1 day before and my brain automatically ignored it as irrelevant due to information overload. Once I start playing around it in the shell this does seem a valuable info. Thank you. russ On 22 Jan 2008 09:43:31 +0100, Bjorn Gustavsson wrote: > "Russell King" writes: > > > Can someone tell me what is y(0),y(1)..,y(4), heap fragment data, number > of > > heap fragments, link list, reductions, stack+heap? > > y(0) and so on are locations on the stack frame. Each location > contain a value that need to survive a function call. > > Heap fragment data is Erlang terms allocated outside the heap for the > process by BIFs because there was insufficient room left on the heap. > In R12B, heap fragments are garbage-collected away as soon as the BIF > is done, so it is unlikely that the value would ever be non-zero. > > Number of heap fragments - see above, likely to always be zero in R12B. > > Link list - all processes or ports that this process is linked to. > > Reductions - a counter that is incremented for every function call (and > by some BIFs too). There will be a context switch when the number of > reductions > reaches a certain value (currently 2000). > > Stack+heap - the size of the memory block allocated for the heap and > stack for the Erlang process. The stack and heap grow towards each other. > > /Bjorn > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robi123@REDACTED Wed Jan 23 04:48:33 2008 From: robi123@REDACTED (Robin) Date: Tue, 22 Jan 2008 19:48:33 -0800 (PST) Subject: [erlang-questions] escript with module dependencies In-Reply-To: <61C12C3539B0524D9A0F76A7F148CC0E01ADC3C511@EX-SEA5-C.ant.amazon.com> References: <61C12C3539B0524D9A0F76A7F148CC0E01ADC3C511@EX-SEA5-C.ant.amazon.com> Message-ID: <7957f5e9-1282-40aa-a1a5-61e5ad10cb83@q77g2000hsh.googlegroups.com> This is the header to compile an Escript: #!/usr/bin/env escript -mode(compile). To include a search path see: code:add_patha/1 code:add_pathz/1 Robin On Jan 22, 6:03 pm, "Helmick, Mike" wrote: > Hello - > > I'm looking to run several scripts that depend on the same modules. > > I have several questions/issues related to this. > > 1) Is there are way to compile the .erl files to beams when the escript is invoked? > - thus eliminating the need for a build step. > > 2) Is there a way to signal escript to look for beams in a different directory than the current runtime? > > thanks, > mike helmick > _______________________________________________ > erlang-questions mailing list > erlang-questi...@REDACTED://www.erlang.org/mailman/listinfo/erlang-questionscode:add_patha/1 to append From bengt.kleberg@REDACTED Wed Jan 23 08:02:26 2008 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 23 Jan 2008 08:02:26 +0100 Subject: [erlang-questions] determining what erts version a .beam was compiled with In-Reply-To: References: Message-ID: <4796E682.4050008@ericsson.com> beam_lib:chunks/2 works for me: 3> ls(). be_lib.beam ok 4> beam_lib:chunks( "be_lib.beam", [compile_info]). {ok,{be_lib, [{compile_info, [{options, [{cwd,"/home/dev_patches"}, {outdir,"/home/dev_patches"}]}, {version,"4.3.7"}, {time,{2005,8,22,15,2,36}}, {source,"/home/dev_patches/be_lib.erl"}]}]}} 5> bengt Those were the days... EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." On 01/23/08 00:18, Lennart ?hman wrote: > I believe there is a version attribute in the module_info tag 'compile' > telling at least the version of the compiler application used. I guess > this is actually more accurate since it must be for which beam object > code has been generated that is of interest. Not necessarily which > runtime system was used when compiling. > But I further guess that you must inspect this information using some > beam_lib function, because otherwise you must call the module_info > function and that means you have to load the module. But if it is > incompatible (younger than) to your runtime system at hand, that can > be difficult. > > Best Regards > Lennart > > --------------------------------------------------------------------------- > Lennart ?hman phone : +46-8-587 623 27 > Sj?land & Thyselius Telecom AB cellular: +46-70-552 6735 > H?lsingegatan 43, 10th floor fax : +46-8-667 8230 > SE-113 31 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > ________________________________________ > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Logan, Martin > Sent: den 22 januari 2008 19:05 > To: erlang-questions@REDACTED > Subject: [erlang-questions] determining what erts version a .beam was compiled with > > Does anyone know whether it is possible to tell by inspecting some .beam object code what erts vsn it was compiled on? > > Cheers, > Martin > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From mukul.j@REDACTED Wed Jan 23 10:14:17 2008 From: mukul.j@REDACTED (Mukul J) Date: Wed, 23 Jan 2008 14:44:17 +0530 Subject: [erlang-questions] make fails in fc7 Message-ID: Hi, I tried to install erlang [otp_src_R12B-0] on fedora core 8 but when the make command was issued I got the following error. How can I fix it? drivers/common/inet_drv.c: In function ?sctp_parse_async_event?: drivers/common/inet_drv.c:3100: error: ?SCTP_ADAPTION_INDICATION? undeclared (first use in this function) drivers/common/inet_drv.c:3100: error: (Each undeclared identifier is reported only once drivers/common/inet_drv.c:3100: error: for each function it appears in.) drivers/common/inet_drv.c:3106: error: ?union sctp_notification? has no member named ?sn_adaption_event? drivers/common/inet_drv.c:3111: error: dereferencing pointer to incomplete type drivers/common/inet_drv.c:3112: error: dereferencing pointer to incomplete type drivers/common/inet_drv.c:3112: warning: left-hand operand of comma expression has no effect drivers/common/inet_drv.c: In function ?sctp_set_opts?: drivers/common/inet_drv.c:5323: error: field ?ad? has incomplete type drivers/common/inet_drv.c:5584: error: ?SCTP_ADAPTION_LAYER? undeclared (first use in this function) drivers/common/inet_drv.c:5688: error: ?struct sctp_event_subscribe? has no member named ?sctp_adaption_layer_event? drivers/common/inet_drv.c: In function ?sctp_fill_opts?: drivers/common/inet_drv.c:6448: error: storage size of ?ad? isn?t known drivers/common/inet_drv.c:6451: error: ?SCTP_ADAPTION_LAYER? undeclared (first use in this function) drivers/common/inet_drv.c:6458: warning: left-hand operand of comma expression has no effect drivers/common/inet_drv.c:6448: warning: unused variable ?ad? drivers/common/inet_drv.c:6586: error: ?struct sctp_event_subscribe? has no member named ?sctp_adaption_layer_event? drivers/common/inet_drv.c:6586: warning: left-hand operand of comma expression has no effect make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] Error 1 make[3]: Leaving directory `/home/a.parkash/Download/otp_src_R12B-0/erts/emulator' make[2]: *** [opt] Error 2 make[2]: Leaving directory `/home/a.parkash/Download/otp_src_R12B-0/erts/emulator' make[1]: *** [smp] Error 2 make[1]: Leaving directory `/home/a.parkash/Download/otp_src_R12B-0/erts' make: *** [emulator] Error 2 Regards, Mukul Jain =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From mukul.j@REDACTED Wed Jan 23 10:19:58 2008 From: mukul.j@REDACTED (Mukul Jain) Date: Wed, 23 Jan 2008 01:19:58 -0800 (PST) Subject: [erlang-questions] make fails in fc7 In-Reply-To: <9b2076080801140234o7524e44enea6be8bf0b1dc29d@mail.gmail.com> References: <9b2076080801140234o7524e44enea6be8bf0b1dc29d@mail.gmail.com> Message-ID: <15037718.post@talk.nabble.com> Hi, I am getting the same error while executing make after ./configure. I tried to install erlang [otp_src_R12B-0] on fedora core 8 but when the make command was issued I got the following error. How can I fix it? drivers/common/inet_drv.c: In function ?sctp_parse_async_event?: drivers/common/inet_drv.c:3100: error: ?SCTP_ADAPTION_INDICATION? undeclared (first use in this function) drivers/common/inet_drv.c:3100: error: (Each undeclared identifier is reported only once drivers/common/inet_drv.c:3100: error: for each function it appears in.) drivers/common/inet_drv.c:3106: error: ?union sctp_notification? has no member named ?sn_adaption_event? drivers/common/inet_drv.c:3111: error: dereferencing pointer to incomplete type drivers/common/inet_drv.c:3112: error: dereferencing pointer to incomplete type drivers/common/inet_drv.c:3112: warning: left-hand operand of comma expression has no effect drivers/common/inet_drv.c: In function ?sctp_set_opts?: drivers/common/inet_drv.c:5323: error: field ?ad? has incomplete type drivers/common/inet_drv.c:5584: error: ?SCTP_ADAPTION_LAYER? undeclared (first use in this function) drivers/common/inet_drv.c:5688: error: ?struct sctp_event_subscribe? has no member named ?sctp_adaption_layer_event? drivers/common/inet_drv.c: In function ?sctp_fill_opts?: drivers/common/inet_drv.c:6448: error: storage size of ?ad? isn?t known drivers/common/inet_drv.c:6451: error: ?SCTP_ADAPTION_LAYER? undeclared (first use in this function) drivers/common/inet_drv.c:6458: warning: left-hand operand of comma expression has no effect drivers/common/inet_drv.c:6448: warning: unused variable ?ad? drivers/common/inet_drv.c:6586: error: ?struct sctp_event_subscribe? has no member named ?sctp_adaption_layer_event? drivers/common/inet_drv.c:6586: warning: left-hand operand of comma expression has no effect make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] Error 1 make[3]: Leaving directory `/home/a.parkash/Download/otp_src_R12B-0/erts/emulator' make[2]: *** [opt] Error 2 make[2]: Leaving directory `/home/a.parkash/Download/otp_src_R12B-0/erts/emulator' make[1]: *** [smp] Error 2 make[1]: Leaving directory `/home/a.parkash/Download/otp_src_R12B-0/erts' make: *** [emulator] Error 2 Please let me know solutions if they exists. Regards, Mukul Balathasan Sayanthan wrote: > > Hi All, > > I tried to install erlang [otp_src_R12B-0] on fedora core 7 but when the > make command was issued I got the following error. > > How can I fix it? > > drivers/common/inet_drv.c: In function 'sctp_parse_async_event': > drivers/common/inet_drv.c:3100: error: 'SCTP_ADAPTION_INDICATION' > undeclared > (first use in this function) > drivers/common/inet_drv.c:3100: error: (Each undeclared identifier is > reported only once > drivers/common/inet_drv.c:3100: error: for each function it appears in.) > drivers/common/inet_drv.c:3106: error: 'union sctp_notification' has no > member named 'sn_adaption_event' > drivers/common/inet_drv.c:3111: error: dereferencing pointer to incomplete > type > drivers/common/inet_drv.c:3112: error: dereferencing pointer to incomplete > type > drivers/common/inet_drv.c:3112: warning: left-hand operand of comma > expression has no effect > drivers/common/inet_drv.c: In function 'sctp_set_opts': > drivers/common/inet_drv.c:5323: error: field 'ad' has incomplete type > drivers/common/inet_drv.c:5584: error: 'SCTP_ADAPTION_LAYER' undeclared > (first use in this function) > drivers/common/inet_drv.c:5688: error: 'struct sctp_event_subscribe' has > no > member named 'sctp_adaption_layer_event' > drivers/common/inet_drv.c: In function 'sctp_fill_opts': > drivers/common/inet_drv.c:6448: error: storage size of 'ad' isn't known > drivers/common/inet_drv.c:6451: error: 'SCTP_ADAPTION_LAYER' undeclared > (first use in this function) > drivers/common/inet_drv.c:6458: warning: left-hand operand of comma > expression has no effect > drivers/common/inet_drv.c:6448: warning: unused variable 'ad' > drivers/common/inet_drv.c:6586: error: 'struct sctp_event_subscribe' has > no > member named 'sctp_adaption_layer_event' > drivers/common/inet_drv.c:6586: warning: left-hand operand of comma > expression has no effect > make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] Error 1 > > thank you. > > regards > > > -- > Sayanthan > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- View this message in context: http://www.nabble.com/make-fails-in-fc7-tp14799447p15037718.html Sent from the Erlang Questions mailing list archive at Nabble.com. From j.bhanot@REDACTED Wed Jan 23 11:27:24 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Wed, 23 Jan 2008 15:57:24 +0530 Subject: [erlang-questions] OTP Stack building problems Message-ID: Hi, I am trying to build the OTP stack on Fedora Core 8... I am using fllowing stack otp_src_R12B-0 ./configure works ok without throwing errors but during make all, it gives the following errors drivers/common/inet_drv.c: In function ?sctp_parse_async_event?: drivers/common/inet_drv.c:3100: error: ?SCTP_ADAPTION_INDICATION? undeclared (first use in thi s function) drivers/common/inet_drv.c:3100: error: (Each undeclared identifier is reported only once drivers/common/inet_drv.c:3100: error: for each function it appears in.) drivers/common/inet_drv.c:3106: error: ?union sctp_notification? has no member named ?sn_adapt ion_event? drivers/common/inet_drv.c:3111: error: dereferencing pointer to incomplete type drivers/common/inet_drv.c:3112: error: dereferencing pointer to incomplete type drivers/common/inet_drv.c:3112: warning: left-hand operand of comma expression has no effect drivers/common/inet_drv.c: In function ?sctp_set_opts?: drivers/common/inet_drv.c:5323: error: field ?ad? has incomplete type drivers/common/inet_drv.c:5584: error: ?SCTP_ADAPTION_LAYER? undeclared (first use in this fun ction) drivers/common/inet_drv.c:5688: error: ?struct sctp_event_subscribe? has no member named ?sctp _adaption_layer_event? drivers/common/inet_drv.c: In function ?sctp_fill_opts?: drivers/common/inet_drv.c:6448: error: storage size of ?ad? isn?t known drivers/common/inet_drv.c:6451: error: ?SCTP_ADAPTION_LAYER? undeclared (first use in this fun ction) drivers/common/inet_drv.c:6458: warning: left-hand operand of comma expression has no effect drivers/common/inet_drv.c:6448: warning: unused variable ?ad? drivers/common/inet_drv.c:6586: error: ?struct sctp_event_subscribe? has no member named ?sctp _adaption_layer_event? drivers/common/inet_drv.c:6586: warning: left-hand operand of comma expression has no effect make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] Error 1 make[3]: Leaving directory `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' make[2]: *** [opt] Error 2 make[2]: Leaving directory `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' make[1]: *** [smp] Error 2 make[1]: Leaving directory `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts' make: *** [emulator] Error 2 Kindly help... Thanks, jb ____________________________________________ =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias@REDACTED Wed Jan 23 11:45:56 2008 From: matthias@REDACTED (Matthias Lang) Date: Wed, 23 Jan 2008 11:45:56 +0100 Subject: [erlang-questions] OTP Stack building problems In-Reply-To: References: Message-ID: <18327.6884.961936.597518@antilipe.corelatus.se> I don't use Fedora, so I am just guessing, but one thing to look at is whether this is related: http://www.nabble.com/Patch-to-fix-crypto-and-SCTP-support-on-FreeBSD-to11474612.html#a11474612 one way to do that would be to take a look at your system's sctp.h and see why SCTP_ADAPTION_INDICATION isn't defined. I.e. is it called SCTP_ADAPTATIN_INDICATION instead. Assuming you're not specifically interested in SCTP, a likely quick fix is to run configure with --disable-sctp Matthias ---------------------------------------------------------------------- J Bhanot writes: > Hi, > > I am trying to build the OTP stack on Fedora Core 8... > > I am using fllowing stack > > otp_src_R12B-0 > > ./configure works ok without throwing errors > > but during make all, it gives the following errors > > drivers/common/inet_drv.c: In function ?sctp_parse_async_event?: > drivers/common/inet_drv.c:3100: error: ?SCTP_ADAPTION_INDICATION? > undeclared (first use in thi > s function) > drivers/common/inet_drv.c:3100: error: (Each undeclared identifier is > reported only once > drivers/common/inet_drv.c:3100: error: for each function it appears in.) > drivers/common/inet_drv.c:3106: error: ?union sctp_notification? has no > member named ?sn_adapt > ion_event? > drivers/common/inet_drv.c:3111: error: dereferencing pointer to incomplete > type > drivers/common/inet_drv.c:3112: error: dereferencing pointer to incomplete > type > drivers/common/inet_drv.c:3112: warning: left-hand operand of comma > expression has no effect > drivers/common/inet_drv.c: In function ?sctp_set_opts?: > drivers/common/inet_drv.c:5323: error: field ?ad? has incomplete type > drivers/common/inet_drv.c:5584: error: ?SCTP_ADAPTION_LAYER? undeclared > (first use in this fun > ction) > drivers/common/inet_drv.c:5688: error: ?struct sctp_event_subscribe? has > no member named ?sctp > _adaption_layer_event? > drivers/common/inet_drv.c: In function ?sctp_fill_opts?: > drivers/common/inet_drv.c:6448: error: storage size of ?ad? isn?t known > drivers/common/inet_drv.c:6451: error: ?SCTP_ADAPTION_LAYER? undeclared > (first use in this fun > ction) > drivers/common/inet_drv.c:6458: warning: left-hand operand of comma > expression has no effect > drivers/common/inet_drv.c:6448: warning: unused variable ?ad? > drivers/common/inet_drv.c:6586: error: ?struct sctp_event_subscribe? has > no member named ?sctp > _adaption_layer_event? > drivers/common/inet_drv.c:6586: warning: left-hand operand of comma > expression has no effect > make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] Error 1 > make[3]: Leaving directory > `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' > make[2]: *** [opt] Error 2 > make[2]: Leaving directory > `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' > make[1]: *** [smp] Error 2 > make[1]: Leaving directory > `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts' > make: *** [emulator] Error 2 > > Kindly help... > > Thanks, > > jb > ____________________________________________ > =====-----=====-----===== > Notice: The information contained in this e-mail > message and/or attachments to it may contain > confidential or privileged information. If you are > not the intended recipient, any dissemination, use, > review, distribution, printing or copying of the > information contained in this e-mail message > and/or attachments to it are strictly prohibited. If > you have received this communication in error, > please notify us by reply e-mail or telephone and > immediately and permanently delete the message > and any attachments. Thank you > > > >
Hi, >
>
I am trying to build the OTP stack on > Fedora Core 8... >
>
I am using fllowing stack >
>
otp_src_R12B-0 >
>
./configure works ok without throwing > errors >
>
but during make all, it gives the following > errors >
>
drivers/common/inet_drv.c: In function > ?sctp_parse_async_event?: >
drivers/common/inet_drv.c:3100: error: > ?SCTP_ADAPTION_INDICATION? undeclared (first use in thi >
s function) >
drivers/common/inet_drv.c:3100: error: > (Each undeclared identifier is reported only once >
drivers/common/inet_drv.c:3100: error: > for each function it appears in.) >
drivers/common/inet_drv.c:3106: error: > ?union sctp_notification? has no member named ?sn_adapt >
ion_event? >
drivers/common/inet_drv.c:3111: error: > dereferencing pointer to incomplete type >
drivers/common/inet_drv.c:3112: error: > dereferencing pointer to incomplete type >
drivers/common/inet_drv.c:3112: warning: > left-hand operand of comma expression has no effect >
drivers/common/inet_drv.c: In function > ?sctp_set_opts?: >
drivers/common/inet_drv.c:5323: error: > field ?ad? has incomplete type >
drivers/common/inet_drv.c:5584: error: > ?SCTP_ADAPTION_LAYER? undeclared (first use in this fun >
ction) >
drivers/common/inet_drv.c:5688: error: > ?struct sctp_event_subscribe? has no member named ?sctp >
_adaption_layer_event? >
drivers/common/inet_drv.c: In function > ?sctp_fill_opts?: >
drivers/common/inet_drv.c:6448: error: > storage size of ?ad? isn?t known >
drivers/common/inet_drv.c:6451: error: > ?SCTP_ADAPTION_LAYER? undeclared (first use in this fun >
ction) >
drivers/common/inet_drv.c:6458: warning: > left-hand operand of comma expression has no effect >
drivers/common/inet_drv.c:6448: warning: > unused variable ?ad? >
drivers/common/inet_drv.c:6586: error: > ?struct sctp_event_subscribe? has no member named ?sctp >
_adaption_layer_event? >
drivers/common/inet_drv.c:6586: warning: > left-hand operand of comma expression has no effect >
make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] > Error 1 >
make[3]: Leaving directory `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' >
make[2]: *** [opt] Error 2 >
make[2]: Leaving directory `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' >
make[1]: *** [smp] Error 2 >
make[1]: Leaving directory `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts' >
make: *** [emulator] Error 2 >
>
Kindly help... >
>
Thanks, >
>
jb >
____________________________________________
=====-----=====-----=====
 > Notice: The information contained in this e-mail
 > message and/or attachments to it may contain 
 > confidential or privileged information. If you are 
 > not the intended recipient, any dissemination, use, 
 > review, distribution, printing or copying of the 
 > information contained in this e-mail message 
 > and/or attachments to it are strictly prohibited. If 
 > you have received this communication in error, 
 > please notify us by reply e-mail or telephone and 
 > immediately and permanently delete the message 
 > and any attachments. Thank you
 > 
 > 
 > 
_______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From kenneth.lundin@REDACTED Wed Jan 23 12:09:23 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Wed, 23 Jan 2008 12:09:23 +0100 Subject: [erlang-questions] determining what erts version a .beam was compiled with In-Reply-To: <4796E682.4050008@ericsson.com> References: <4796E682.4050008@ericsson.com> Message-ID: Hi, The interesting version info is the compiler version and that is what you get in the example below. You can also get the same info by loading the module and calling M:module_info(). /Kenneth Erlang/OTP team Ericsson On 1/23/08, Bengt Kleberg wrote: > beam_lib:chunks/2 works for me: > > 3> ls(). > be_lib.beam > ok > 4> beam_lib:chunks( "be_lib.beam", [compile_info]). > {ok,{be_lib, > [{compile_info, > [{options, > [{cwd,"/home/dev_patches"}, > {outdir,"/home/dev_patches"}]}, > {version,"4.3.7"}, > {time,{2005,8,22,15,2,36}}, > {source,"/home/dev_patches/be_lib.erl"}]}]}} > 5> > > > bengt > Those were the days... > EPO guidelines 1978: "If the contribution to the known art resides > solely in a computer program then the subject matter is not > patentable in whatever manner it may be presented in the claims." > > > On 01/23/08 00:18, Lennart ?hman wrote: > > I believe there is a version attribute in the module_info tag 'compile' > > telling at least the version of the compiler application used. I guess > > this is actually more accurate since it must be for which beam object > > code has been generated that is of interest. Not necessarily which > > runtime system was used when compiling. > > But I further guess that you must inspect this information using some > > beam_lib function, because otherwise you must call the module_info > > function and that means you have to load the module. But if it is > > incompatible (younger than) to your runtime system at hand, that can > > be difficult. > > > > Best Regards > > Lennart > > > > --------------------------------------------------------------------------- > > Lennart ?hman phone : +46-8-587 623 27 > > Sj?land & Thyselius Telecom AB cellular: +46-70-552 6735 > > H?lsingegatan 43, 10th floor fax : +46-8-667 8230 > > SE-113 31 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > > ________________________________________ > > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Logan, Martin > > Sent: den 22 januari 2008 19:05 > > To: erlang-questions@REDACTED > > Subject: [erlang-questions] determining what erts version a .beam was compiled with > > > > Does anyone know whether it is possible to tell by inspecting some .beam object code what erts vsn it was compiled on? > > > > Cheers, > > Martin > > _______________________________________________ > > 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 mogorman@REDACTED Wed Jan 23 15:39:23 2008 From: mogorman@REDACTED (mog) Date: Wed, 23 Jan 2008 08:39:23 -0600 Subject: [erlang-questions] OTP Stack building problems In-Reply-To: References: Message-ID: <4797519B.8060301@astjab.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 J Bhanot wrote: > > Hi, > > I am trying to build the OTP stack on Fedora Core 8... > > I am using fllowing stack > > otp_src_R12B-0 > > ./configure works ok without throwing errors > > but during make all, it gives the following errors > > drivers/common/inet_drv.c: In function ?sctp_parse_async_event?: > drivers/common/inet_drv.c:3100: error: ?SCTP_ADAPTION_INDICATION? > undeclared (first use in thi > s function) > drivers/common/inet_drv.c:3100: error: (Each undeclared identifier is > reported only once > drivers/common/inet_drv.c:3100: error: for each function it appears in.) > drivers/common/inet_drv.c:3106: error: ?union sctp_notification? has no > member named ?sn_adapt > ion_event? > drivers/common/inet_drv.c:3111: error: dereferencing pointer to > incomplete type > drivers/common/inet_drv.c:3112: error: dereferencing pointer to > incomplete type > drivers/common/inet_drv.c:3112: warning: left-hand operand of comma > expression has no effect > drivers/common/inet_drv.c: In function ?sctp_set_opts?: > drivers/common/inet_drv.c:5323: error: field ?ad? has incomplete type > drivers/common/inet_drv.c:5584: error: ?SCTP_ADAPTION_LAYER? undeclared > (first use in this fun > ction) > drivers/common/inet_drv.c:5688: error: ?struct sctp_event_subscribe? has > no member named ?sctp > _adaption_layer_event? > drivers/common/inet_drv.c: In function ?sctp_fill_opts?: > drivers/common/inet_drv.c:6448: error: storage size of ?ad? isn?t known > drivers/common/inet_drv.c:6451: error: ?SCTP_ADAPTION_LAYER? undeclared > (first use in this fun > ction) > drivers/common/inet_drv.c:6458: warning: left-hand operand of comma > expression has no effect > drivers/common/inet_drv.c:6448: warning: unused variable ?ad? > drivers/common/inet_drv.c:6586: error: ?struct sctp_event_subscribe? has > no member named ?sctp > _adaption_layer_event? > drivers/common/inet_drv.c:6586: warning: left-hand operand of comma > expression has no effect > make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] Error 1 > make[3]: Leaving directory > `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' > make[2]: *** [opt] Error 2 > make[2]: Leaving directory > `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' > make[1]: *** [smp] Error 2 > make[1]: Leaving directory > `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts' > make: *** [emulator] Error 2 > I to have found this problem and submitted a patch to fix it for later versions of Gnu/Linux and friends but haven't heard any response back. here is a link http://erlang.org/pipermail/erlang-bugs/2008-January/000612.html Mog -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHl1GapCttrJGOY6gRAi9tAJ9+7lc4t6yxT4mEBC+JD6oxB+zdQgCfSMU4 RAQpo9Nz2by1wixJCAkkeFw= =3uhI -----END PGP SIGNATURE----- From mogorman@REDACTED Wed Jan 23 15:41:11 2008 From: mogorman@REDACTED (mog) Date: Wed, 23 Jan 2008 08:41:11 -0600 Subject: [erlang-questions] make fails in fc7 In-Reply-To: References: Message-ID: <47975207.4030904@astjab.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mukul J wrote: > > Hi, > > I tried to install erlang [otp_src_R12B-0] on fedora core 8 but when the > make command was issued I got the following error. > > How can I fix it? > > drivers/common/inet_drv.c: In function ?sctp_parse_async_event?: > drivers/common/inet_drv.c:3100: error: ?SCTP_ADAPTION_INDICATION? > undeclared (first use in this function) > drivers/common/inet_drv.c:3100: error: (Each undeclared identifier is > reported only once > drivers/common/inet_drv.c:3100: error: for each function it appears in.) > drivers/common/inet_drv.c:3106: error: ?union sctp_notification? has no > member named ?sn_adaption_event? > drivers/common/inet_drv.c:3111: error: dereferencing pointer to > incomplete type > drivers/common/inet_drv.c:3112: error: dereferencing pointer to > incomplete type > drivers/common/inet_drv.c:3112: warning: left-hand operand of comma > expression has no effect > drivers/common/inet_drv.c: In function ?sctp_set_opts?: > drivers/common/inet_drv.c:5323: error: field ?ad? has incomplete type > drivers/common/inet_drv.c:5584: error: ?SCTP_ADAPTION_LAYER? undeclared > (first use in this function) > drivers/common/inet_drv.c:5688: error: ?struct sctp_event_subscribe? has > no member named ?sctp_adaption_layer_event? > drivers/common/inet_drv.c: In function ?sctp_fill_opts?: > drivers/common/inet_drv.c:6448: error: storage size of ?ad? isn?t known > drivers/common/inet_drv.c:6451: error: ?SCTP_ADAPTION_LAYER? undeclared > (first use in this function) > drivers/common/inet_drv.c:6458: warning: left-hand operand of comma > expression has no effect > drivers/common/inet_drv.c:6448: warning: unused variable ?ad? > drivers/common/inet_drv.c:6586: error: ?struct sctp_event_subscribe? has > no member named ?sctp_adaption_layer_event? > drivers/common/inet_drv.c:6586: warning: left-hand operand of comma > expression has no effect > make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] Error 1 > make[3]: Leaving directory > `/home/a.parkash/Download/otp_src_R12B-0/erts/emulator' > make[2]: *** [opt] Error 2 > make[2]: Leaving directory > `/home/a.parkash/Download/otp_src_R12B-0/erts/emulator' > make[1]: *** [smp] Error 2 > make[1]: Leaving directory `/home/a.parkash/Download/otp_src_R12B-0/erts' > make: *** [emulator] Error 2 > > This is the same problem as the "OTP Stack building problems" directly before you, it is a bug in the sctp stack as the api changed, here is a link to a patch that solves the problem http://erlang.org/pipermail/erlang-bugs/2008-January/000612.html mog -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHl1IHpCttrJGOY6gRAg0UAKCXVPlgIz8Zj8iejnQVeNyFdXSpDgCgu0sb olqEAqw72Rdt7VzI4+hN/Z8= =Mmm/ -----END PGP SIGNATURE----- From rec@REDACTED Wed Jan 23 19:27:35 2008 From: rec@REDACTED (Roger Critchlow) Date: Wed, 23 Jan 2008 11:27:35 -0700 Subject: [erlang-questions] simple ets question Message-ID: <66d1c98f0801231027k57f5ab34v8de4e2cedc964f67@mail.gmail.com> Good day all -- Can anyone explain the following to me? This is using a copy of otp_src_R12B-0 that I compiled under Ubuntu yesterday. I expected statement #2 to return the same value as statement #3. The actual problem arises using another ets: function that specifies a Tid | atom as the ets table identifier, and it throws a bad argument error. Many thanks, -- rec -- -------- Erlang (BEAM) emulator version 5.6 [source] [smp:2] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.6 (abort with ^G) 1> Tid = ets:new(test,[]). 15 2> ets:info(test). undefined 3> ets:info(Tid). [{memory,288}, {owner,<0.31.0>}, {name,test}, {size,0}, {node,nonode@REDACTED}, {named_table,false}, {type,set}, {keypos,1}, {protection,protected}] 4> From tty.erlang@REDACTED Wed Jan 23 20:38:07 2008 From: tty.erlang@REDACTED (t ty) Date: Wed, 23 Jan 2008 14:38:07 -0500 Subject: [erlang-questions] simple ets question In-Reply-To: <66d1c98f0801231027k57f5ab34v8de4e2cedc964f67@mail.gmail.com> References: <66d1c98f0801231027k57f5ab34v8de4e2cedc964f67@mail.gmail.com> Message-ID: <290b3ba10801231138v6180cea9t273e61fdd90a3c0e@mail.gmail.com> To be able to use the name 'test' you need to pass in 'named_table' as one of the options. 1> Tid = ets:new(test,[named_table]). Regards t On Jan 23, 2008 1:27 PM, Roger Critchlow wrote: > Good day all -- > > Can anyone explain the following to me? This is using a copy of > otp_src_R12B-0 that I compiled under Ubuntu yesterday. > > I expected statement #2 to return the same value as statement #3. > > The actual problem arises using another ets: function that specifies a > Tid | atom as the ets table identifier, and it throws a bad argument > error. > > Many thanks, > > -- rec -- > > > -------- > > Erlang (BEAM) emulator version 5.6 [source] [smp:2] [async-threads:0] > [hipe] [kernel-poll:false] > > Eshell V5.6 (abort with ^G) > 1> Tid = ets:new(test,[]). > 15 > 2> ets:info(test). > undefined > 3> ets:info(Tid). > [{memory,288}, > {owner,<0.31.0>}, > {name,test}, > {size,0}, > {node,nonode@REDACTED}, > {named_table,false}, > {type,set}, > {keypos,1}, > {protection,protected}] > 4> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From Martin.Logan@REDACTED Thu Jan 24 00:21:01 2008 From: Martin.Logan@REDACTED (Logan, Martin) Date: Wed, 23 Jan 2008 17:21:01 -0600 Subject: [erlang-questions] determining what erts version a .beam was compiled with In-Reply-To: <4796E682.4050008@ericsson.com> References: <4796E682.4050008@ericsson.com> Message-ID: Interesting - I see the point about the compiler version being more salient than the erts vsn. The problem is other parts of my system depend on the erts vsn - perhaps in error. I need to think about this. Thanks for the info. Cheers, Martin -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Bengt Kleberg Sent: Wednesday, January 23, 2008 1:02 AM Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] determining what erts version a .beam was compiled with beam_lib:chunks/2 works for me: 3> ls(). be_lib.beam ok 4> beam_lib:chunks( "be_lib.beam", [compile_info]). {ok,{be_lib, [{compile_info, [{options, [{cwd,"/home/dev_patches"}, {outdir,"/home/dev_patches"}]}, {version,"4.3.7"}, {time,{2005,8,22,15,2,36}}, {source,"/home/dev_patches/be_lib.erl"}]}]}} 5> bengt Those were the days... EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." On 01/23/08 00:18, Lennart ?hman wrote: > I believe there is a version attribute in the module_info tag 'compile' > telling at least the version of the compiler application used. I guess > this is actually more accurate since it must be for which beam object > code has been generated that is of interest. Not necessarily which > runtime system was used when compiling. > But I further guess that you must inspect this information using some > beam_lib function, because otherwise you must call the module_info > function and that means you have to load the module. But if it is > incompatible (younger than) to your runtime system at hand, that can > be difficult. > > Best Regards > Lennart > > --------------------------------------------------------------------------- > Lennart ?hman phone : +46-8-587 623 27 > Sj?land & Thyselius Telecom AB cellular: +46-70-552 6735 > H?lsingegatan 43, 10th floor fax : +46-8-667 8230 > SE-113 31 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > ________________________________________ > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Logan, Martin > Sent: den 22 januari 2008 19:05 > To: erlang-questions@REDACTED > Subject: [erlang-questions] determining what erts version a .beam was compiled with > > Does anyone know whether it is possible to tell by inspecting some .beam object code what erts vsn it was compiled on? > > Cheers, > Martin > _______________________________________________ > 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 Martin.Logan@REDACTED Thu Jan 24 00:30:12 2008 From: Martin.Logan@REDACTED (Logan, Martin) Date: Wed, 23 Jan 2008 17:30:12 -0600 Subject: [erlang-questions] determining what erts version a .beam wascompiled with In-Reply-To: References: <4796E682.4050008@ericsson.com> Message-ID: How accessible is this; if I am running R10B-x will I be able to run beam_lib:chunks on a beam file compiled for R11B-x in most cases? -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Kenneth Lundin Sent: Wednesday, January 23, 2008 5:09 AM To: Bengt Kleberg Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] determining what erts version a .beam wascompiled with Hi, The interesting version info is the compiler version and that is what you get in the example below. You can also get the same info by loading the module and calling M:module_info(). /Kenneth Erlang/OTP team Ericsson On 1/23/08, Bengt Kleberg wrote: > beam_lib:chunks/2 works for me: > > 3> ls(). > be_lib.beam > ok > 4> beam_lib:chunks( "be_lib.beam", [compile_info]). > {ok,{be_lib, > [{compile_info, > [{options, > [{cwd,"/home/dev_patches"}, > {outdir,"/home/dev_patches"}]}, > {version,"4.3.7"}, > {time,{2005,8,22,15,2,36}}, > {source,"/home/dev_patches/be_lib.erl"}]}]}} > 5> > > > bengt > Those were the days... > EPO guidelines 1978: "If the contribution to the known art resides > solely in a computer program then the subject matter is not > patentable in whatever manner it may be presented in the claims." > > > On 01/23/08 00:18, Lennart ?hman wrote: > > I believe there is a version attribute in the module_info tag 'compile' > > telling at least the version of the compiler application used. I guess > > this is actually more accurate since it must be for which beam object > > code has been generated that is of interest. Not necessarily which > > runtime system was used when compiling. > > But I further guess that you must inspect this information using some > > beam_lib function, because otherwise you must call the module_info > > function and that means you have to load the module. But if it is > > incompatible (younger than) to your runtime system at hand, that can > > be difficult. > > > > Best Regards > > Lennart > > > > --------------------------------------------------------------------------- > > Lennart ?hman phone : +46-8-587 623 27 > > Sj?land & Thyselius Telecom AB cellular: +46-70-552 6735 > > H?lsingegatan 43, 10th floor fax : +46-8-667 8230 > > SE-113 31 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > > ________________________________________ > > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Logan, Martin > > Sent: den 22 januari 2008 19:05 > > To: erlang-questions@REDACTED > > Subject: [erlang-questions] determining what erts version a .beam was compiled with > > > > Does anyone know whether it is possible to tell by inspecting some .beam object code what erts vsn it was compiled on? > > > > Cheers, > > Martin > > _______________________________________________ > > 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 j.bhanot@REDACTED Thu Jan 24 07:03:56 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Thu, 24 Jan 2008 11:33:56 +0530 Subject: [erlang-questions] Building Megaco as a separate stack Message-ID: Hi All, Is there a way in which i can build stack as Megaco specific only... As we know, OTP is a huge stack....and it takes considerable time to build...it's been 10 minutes now...its still building .... i did following : ./configure --disable-sctp make all I want the functionality of just Megaco (Media Gateway and Media Gateway Controller)...is it possible to do that without building the whole stack... Thanks, jb =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From arturmatos78@REDACTED Thu Jan 24 07:46:11 2008 From: arturmatos78@REDACTED (Artur Matos) Date: Thu, 24 Jan 2008 15:46:11 +0900 Subject: [erlang-questions] Shouldn't Mnesia be fully initialized after mnesia:start()? Message-ID: Hi to all, I have started studying Mnesia recently, and as a test I've wrote the following simple program: -module(mnesiatest). -compile([export_all]). -include_lib("stdlib/include/qlc.hrl"). -record(registered_symbol, {symbol, date}). test_no_wait() -> mnesia:start(), Fun = fun() -> Q = qlc:q([E || E <- mnesia:table(registered_symbol)]), qlc:e(Q) end, mnesia:transaction(Fun). So test_no_wait() basically starts Mnesia and does a query of all the records registered in the registered_symbol table. Now if I run this program, I get the following error (using Erlang R12B on Mac OS X 10.4, PPC): 10> mnesiatest:test_no_wait(). {aborted,{no_exists,registered_symbol}} Although the record registered_symbol is defined in the source code. But if I change test_no_wait() to include a slight delay between mnesia:start() and the querying: test_wait() -> mnesia:start(), %% Blocks for 10 seconds receive after 10000 -> true end, Fun = fun() -> Q = qlc:q([E || E <- mnesia:table(registered_symbol)]), qlc:e(Q) end, mnesia:transaction(Fun). and run this version: 11> mnesia:stop(). =INFO REPORT==== 20-Jan-2008::17:27:16 === application: mnesia exited: stopped type: temporary stopped 12> mnesiatest:test_wait(). {atomic,[{registered_symbol,"IBM",{2008,1,20}}]}13> then my query works, but I find this behavior a bit strange. It looks like some Mnesia initialization is still going on after my call to mnesia:start(), but shouldn't mnesia:start() block until Mnesia is fully initialized? or shouldn't at least mnesia:transaction(Fun) do this? Or is there any command that I should be calling that blocks until everything is initialized? In case it helps, this is the call I am using to define my database: init() -> mnesia:create_table(registered_symbol, [{disc_copies, [node()]}, {attributes, record_info(fields, registered_symbol)}]). Thanks for the help, Artur. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.hillqvist@REDACTED Thu Jan 24 08:17:29 2008 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Thu, 24 Jan 2008 08:17:29 +0100 Subject: [erlang-questions] Shouldn't Mnesia be fully initialized after mnesia:start()? In-Reply-To: References: Message-ID: <8268eea30801232317u45105cf1nd3d86a3bbb48f525@mail.gmail.com> I belive you are looking for: mnesia:wait_for_tables/2 Try: test_no_wait() -> mnesia:start(), ok = mnesia:wait_for_tables([registered_symbol], 1000), Fun = fun() -> Q = qlc:q([E || E <- mnesia:table(registered_symbol)]), qlc:e(Q) end, mnesia:transaction(Fun). Regards Andreas Hillqvist 2008/1/24, Artur Matos : > Hi to all, > > I have started studying Mnesia recently, and as a test I've wrote the > following simple program: > > -module(mnesiatest). > -compile([export_all]). > > -include_lib("stdlib/include/qlc.hrl"). > > -record(registered_symbol, {symbol, date}). > > test_no_wait() -> > mnesia:start(), > Fun = fun() -> > Q = qlc:q([E || E <- > mnesia:table(registered_symbol)]), > qlc:e(Q) > end, > mnesia:transaction(Fun). > > So test_no_wait() basically starts Mnesia and does a query of > all the records registered in the registered_symbol table. Now if I run this > program, > I get the following error (using Erlang R12B on Mac OS X 10.4, PPC): > > > 10> mnesiatest:test_no_wait(). > {aborted,{no_exists,registered_symbol}} > > Although the record registered_symbol is defined in the source code. But if > I > change test_no_wait() to include a slight delay between mnesia:start() and > the > querying: > > test_wait() -> > mnesia:start(), %% Blocks for 10 seconds > receive > after 10000 -> > true > end, > Fun = fun() -> > Q = qlc:q([E || E <- > mnesia:table(registered_symbol)]), > qlc:e(Q) > end, > mnesia:transaction(Fun). > > and run this version: > > 11> mnesia:stop(). > > =INFO REPORT==== 20-Jan-2008::17:27:16 === > application: mnesia > exited: stopped > type: temporary > stopped > 12> mnesiatest:test_wait(). > {atomic,[{registered_symbol,"IBM",{2008,1,20}}]} > 13> > > then my query works, but I find this behavior a bit strange. It looks like > some Mnesia initialization is still going on after my call to > mnesia:start(), but shouldn't mnesia:start() block until Mnesia is fully > initialized? or shouldn't at least mnesia:transaction(Fun) do this? Or is > there any command that I should be calling that blocks until everything > is initialized? > > In case it helps, this is the call I am using to define my database: > > init() -> > mnesia:create_table(registered_symbol, > [{disc_copies, [node()]}, {attributes, record_info(fields, > registered_symbol)}]). > Thanks for the help, > > Artur. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From eajam@REDACTED Thu Jan 24 09:14:15 2008 From: eajam@REDACTED (alex alvarez) Date: Thu, 24 Jan 2008 03:14:15 -0500 (EST) Subject: [erlang-questions] [RE] Case insensitivity - Windows trap or bug? Message-ID: <20080124031415.HM.00000000000006K@eajam.bos-mail-wwl1.lycos.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- Doug, I understand your point, although it's important to keep in mind Erlang was developed to work on Unix systems where this is not an issue. What I was trying to point out is the fact the same problem could be said about many other apps running in Windows. This is just part of its DOS legacy, and it's SOP in Windows. Maybe Erlang should do more about this, as well as other things, but in the mean time I would recommend standarizing on lower-case names. Using Cygwin and/or MSys doesn't hurt either! Cheers, Alex ---------[ Received Mail Content ]---------- Subject : Re: [erlang-questions] [RE] Case insensitivity - Windows trap or bug? Date : Sat, 19 Jan 2008 10:30:22 -0800 >From : Doug Edmunds To : alex alvarez , erlang-questions@REDACTED Alex: I hit that send button too soon. Re-reading your email, I see you are not advocating Cygwin over XP, instead pointing out the similar results. My apologies. However, I disagree that there is no problem. It seems like Erlang asks Windows: "Do you have a file named mytest.erl?", and Windows being case-insensitive, sees myTest.erl, and says "yes". Since Erlang is going to use that filename in a case-sensitive manner when compiling it, it should check what Windows gave it, and say "Wait, this isn't 'mytest.erl', this is 'myTest.erl'" and generate an error message. - Doug Edmunds From bjorn@REDACTED Thu Jan 24 09:44:05 2008 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 24 Jan 2008 09:44:05 +0100 Subject: [erlang-questions] determining what erts version a .beam wascompiled with In-Reply-To: References: <4796E682.4050008@ericsson.com> Message-ID: "Logan, Martin" writes: > How accessible is this; if I am running R10B-x will I be able to run beam_lib:chunks on a beam file compiled for R11B-x in most cases? Yes, it works fine. The beam file format has not been changed in a long time. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Thu Jan 24 09:47:04 2008 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 24 Jan 2008 09:47:04 +0100 Subject: [erlang-questions] : OTP Stack building problems In-Reply-To: <4797519B.8060301@astjab.org> References: <4797519B.8060301@astjab.org> Message-ID: <20080124084704.GA6686@erix.ericsson.se> Sorry about the lack of response on the erlang-bugs mailing list. We have downprioritized this since we felt SCTP was only for the ones that had a specific need. But now it seems new Linux:es ship both header files and libraries for SCTP, with a too fresh version for our standard build. So, now this is a reeally annoying problem that I am currently working on. We hope it will be fixed in R12B-1; I have a dirty #ifdefing solution that works for lksctp-tools-1.0.7 but have not made regression tests against the older version yet. So I will polish on the #ifdefs before being happy. Any hints on how SCTP header files differ between different OS:es are greatly appreciated, esp. if struct sctp_event_subscribe.sctp_adaptation_layer_event does not exist on FreeBSD, can one then count on struct sctp_event_subscribe.sctp_adaption_layer_even existing instead. (Ther is a patch on http://www.nabble.com/Patch-to-fix-crypto-and-SCTP-support-on-FreeBSD-to11474612.html#a11474612 that tests for the "adaptation" spelled variant and if it does not exist assumes there is no such field instead of falling back to the "adaption" spelling. And we have no FreeBSD machine to test on... On Wed, Jan 23, 2008 at 08:39:23AM -0600, mog wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > J Bhanot wrote: > > > > Hi, > > > > I am trying to build the OTP stack on Fedora Core 8... > > > > I am using fllowing stack > > > > otp_src_R12B-0 > > > > ./configure works ok without throwing errors > > > > but during make all, it gives the following errors > > > > drivers/common/inet_drv.c: In function ?sctp_parse_async_event?: > > drivers/common/inet_drv.c:3100: error: ?SCTP_ADAPTION_INDICATION? > > undeclared (first use in thi > > s function) > > drivers/common/inet_drv.c:3100: error: (Each undeclared identifier is > > reported only once > > drivers/common/inet_drv.c:3100: error: for each function it appears in.) > > drivers/common/inet_drv.c:3106: error: ?union sctp_notification? has no > > member named ?sn_adapt > > ion_event? > > drivers/common/inet_drv.c:3111: error: dereferencing pointer to > > incomplete type > > drivers/common/inet_drv.c:3112: error: dereferencing pointer to > > incomplete type > > drivers/common/inet_drv.c:3112: warning: left-hand operand of comma > > expression has no effect > > drivers/common/inet_drv.c: In function ?sctp_set_opts?: > > drivers/common/inet_drv.c:5323: error: field ?ad? has incomplete type > > drivers/common/inet_drv.c:5584: error: ?SCTP_ADAPTION_LAYER? undeclared > > (first use in this fun > > ction) > > drivers/common/inet_drv.c:5688: error: ?struct sctp_event_subscribe? has > > no member named ?sctp > > _adaption_layer_event? > > drivers/common/inet_drv.c: In function ?sctp_fill_opts?: > > drivers/common/inet_drv.c:6448: error: storage size of ?ad? isn?t known > > drivers/common/inet_drv.c:6451: error: ?SCTP_ADAPTION_LAYER? undeclared > > (first use in this fun > > ction) > > drivers/common/inet_drv.c:6458: warning: left-hand operand of comma > > expression has no effect > > drivers/common/inet_drv.c:6448: warning: unused variable ?ad? > > drivers/common/inet_drv.c:6586: error: ?struct sctp_event_subscribe? has > > no member named ?sctp > > _adaption_layer_event? > > drivers/common/inet_drv.c:6586: warning: left-hand operand of comma > > expression has no effect > > make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] Error 1 > > make[3]: Leaving directory > > `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' > > make[2]: *** [opt] Error 2 > > make[2]: Leaving directory > > `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' > > make[1]: *** [smp] Error 2 > > make[1]: Leaving directory > > `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts' > > make: *** [emulator] Error 2 > > > I to have found this problem and submitted a patch to fix it for later > versions of Gnu/Linux and friends but haven't heard any response back. > here is a link > http://erlang.org/pipermail/erlang-bugs/2008-January/000612.html > > Mog > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHl1GapCttrJGOY6gRAi9tAJ9+7lc4t6yxT4mEBC+JD6oxB+zdQgCfSMU4 > RAQpo9Nz2by1wixJCAkkeFw= > =3uhI > -----END PGP SIGNATURE----- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From zerthurd@REDACTED Thu Jan 24 10:32:27 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Thu, 24 Jan 2008 15:32:27 +0600 Subject: [erlang-questions] Building Megaco as a separate stack In-Reply-To: References: Message-ID: Megaco library in OTP is not standalone application, it just library. Ordinary you need not to build it many times, just during installation of whole OTP on your workstation. Btw, if you want to build megaco library separately, you can make something like: cd otp_src_R12B-0 && export ERL_TOP=`pwd` && cd lib/megaco After this you can change source files of library (are you sure?) and build only megaco by make command. --- Maxim 'Zert' Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.bhanot@REDACTED Thu Jan 24 10:47:04 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Thu, 24 Jan 2008 15:17:04 +0530 Subject: [erlang-questions] running sample progs for MGC and MG Message-ID: Hi All, I built the stack doing following in FC 8 : ./configure --disable -sctp make all make install Now i want to test MGC and MG running examples at follwoing location /home/j.bhanot/Download/H.248/otp_src_R12B-0/lib/megaco/examples/simple i tried to execute megaco_simple_mgc.erl following these commands: erl -pa ../../../megaco/ebin -s megaco_filter -s megaco %% megaco_simple_mgc:start(). but getting the error : 1> Application initialization failed: no display name and no $DISPLAY environment variable Error in startup script: no display name and no $DISPLAY environment variable Question1 : what should the value with which env value DISPLAY be set Question2: these sample applications are made in erlang...is it possible to use c/c++ or some other language to use APIs/Functionalities of Megaco stack Many Thanks, jb Jagmohan Bhanot Tata Consultancy Services Mailto: j.bhanot@REDACTED Website: http://www.tcs.com ____________________________________________ Experience certainty. IT Services Business Solutions Outsourcing ____________________________________________ =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From laurent@REDACTED Thu Jan 24 10:49:04 2008 From: laurent@REDACTED (laurent@REDACTED) Date: Thu, 24 Jan 2008 09:49:04 -0000 (UTC) Subject: [erlang-questions] simple ets question In-Reply-To: <66d1c98f0801231027k57f5ab34v8de4e2cedc964f67@mail.gmail.com> References: <66d1c98f0801231027k57f5ab34v8de4e2cedc964f67@mail.gmail.com> Message-ID: <33131.213.41.242.251.1201168144.squirrel@mail.erlangsystems.com> Hello, > Good day all -- > > Can anyone explain the following to me? This is using a copy of > otp_src_R12B-0 that I compiled under Ubuntu yesterday. > > I expected statement #2 to return the same value as statement #3. [...] > Eshell V5.6 (abort with ^G) > 1> Tid = ets:new(test,[]). > 15 > 2> ets:info(test). > undefined > 3> ets:info(Tid). Use ets:new(test, [named_table]) to get the same result in 2> and 3> From zerthurd@REDACTED Thu Jan 24 11:20:16 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Thu, 24 Jan 2008 16:20:16 +0600 Subject: [erlang-questions] running sample progs for MGC and MG In-Reply-To: References: Message-ID: On 24/01/2008, J Bhanot wrote: > > > Hi All, > > I built the stack doing following in FC 8 : > > ./configure --disable -sctp > > make all > > make install > > Now i want to test MGC and MG running examples at follwoing location > > /home/j.bhanot/Download/H.248/otp_src_R12B-0/lib/megaco/examples/simple > > i tried to execute megaco_simple_mgc.erl > > following these commands: > > erl -pa ../../../megaco/ebin -s megaco_filter -s megaco > %% megaco_simple_mgc:start(). > > but getting the error : > > 1> Application initialization failed: no display name and no $DISPLAY > environment variable > Error in startup script: no display name and no $DISPLAY environment > variable > > Question1 : what should the value with which env value DISPLAY be set DISPLAY is environment variable, which contains address and display number of your X server. Megaco sample progs have some GUI to trace megaco messages. It seems that you ran stack not in X environment, or under another user. Question2: these sample applications are made in erlang...is it possible to > use c/c++ or some other language to use APIs/Functionalities of Megaco stack There is erl_interface library to interact between erlang node and C/C++ applications, but it is necessary to run one erlang node for this. --- Maxim 'Zert' Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.bhanot@REDACTED Thu Jan 24 11:36:49 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Thu, 24 Jan 2008 16:06:49 +0530 Subject: [erlang-questions] running sample progs for MGC and MG In-Reply-To: Message-ID: Hi Maxim, I was using putty from my local windows machine to connect to linux server and then running this sample application..... but when i ran this script from linux sever itself (FC8)....it did show MGC GUI... now it want to display GUI from my local windows machine running this appl on putty...for this i am trying to download an interface b/w linux and windows i.e ReflectionX hoping that it would open the GUI from my local windows m/c.... Second question is that - I am looking into erl_interface library now when you say atleast one erlang node should be running ...do you mean that anyways i will have to use Erlang in building some application ( Start Media Gateway Controller) and then if i want to start Media Gateway ....i can use my C application to start it and then making MG communicate with MGW via erl_interface library using C.... Actually, i am bit hazy about this at this moment... Could you kindly throw more light on that... Appreciate your help... Many Thanks, jb "Maxim Treskin" 01/24/2008 03:50 PM To "J Bhanot" cc erlang-questions@REDACTED, megaco@REDACTED Subject Re: [erlang-questions] running sample progs for MGC and MG On 24/01/2008, J Bhanot wrote: Hi All, I built the stack doing following in FC 8 : ./configure --disable -sctp make all make install Now i want to test MGC and MG running examples at follwoing location /home/j.bhanot/Download/H.248/otp_src_R12B-0/lib/megaco/examples/simple i tried to execute megaco_simple_mgc.erl following these commands: erl -pa ../../../megaco/ebin -s megaco_filter -s megaco %% megaco_simple_mgc:start(). but getting the error : 1> Application initialization failed: no display name and no $DISPLAY environment variable Error in startup script: no display name and no $DISPLAY environment variable Question1 : what should the value with which env value DISPLAY be set DISPLAY is environment variable, which contains address and display number of your X server. Megaco sample progs have some GUI to trace megaco messages. It seems that you ran stack not in X environment, or under another user. Question2: these sample applications are made in erlang...is it possible to use c/c++ or some other language to use APIs/Functionalities of Megaco stack There is erl_interface library to interact between erlang node and C/C++ applications, but it is necessary to run one erlang node for this. --- Maxim 'Zert' Treskin ForwardSourceID:NT0000DC1E =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From zerthurd@REDACTED Thu Jan 24 11:55:33 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Thu, 24 Jan 2008 16:55:33 +0600 Subject: [erlang-questions] running sample progs for MGC and MG In-Reply-To: References: Message-ID: On 24/01/2008, J Bhanot wrote: > > > Hi Maxim, > > I was using putty from my local windows machine to connect to linux server > and then running this sample application..... > > but when i ran this script from linux sever itself (FC8)....it did show > MGC GUI... > > now it want to display GUI from my local windows machine running this appl > on putty...for this i am trying to download an interface b/w linux and > windows i.e > > ReflectionX > > hoping that it would open the GUI from my local windows m/c.... You have two way: 1) Install X server on your windows machine, start it, then set DISPLAY variable on linux station to "your_windows_addr:x_display", where your_windows_addr is network address of machine and x_display is display number of X server 2) Do not run megaco_filter process. In this case you can see megaco messages on console, not in GUI. Second question is that - I am looking into erl_interface library > > now when you say atleast one erlang node should be running ...do you mean > that anyways i will have to use Erlang in building some application ( Start > Media Gateway Controller) and then if i want to start Media Gateway ....i > can use my C application to start it and then making MG communicate with MGW > via erl_interface library using C.... At least one erlang node should be started for MGC and one node for each MG. Also you must write pice of code in erlang to handle megaco messages. The easiest way is learn Erlang OTP, and write whole application on this platform. You can write low-level part of application on C/C++, but it is impossible to write high-level part, megaco messaging, on other language, not Erlang. Actually, i am bit hazy about this at this moment... > > Could you kindly throw more light on that... > > Appreciate your help... > > Many Thanks, > jb > --- Maxim 'Zert' Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Thu Jan 24 12:31:50 2008 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 24 Jan 2008 11:31:50 +0000 (UTC) Subject: [erlang-questions] =?utf-8?q?erl=5Fdriver=2Eh_vs_erl=5Fsys=5Fdriv?= =?utf-8?q?er=2Eh?= Message-ID: What is the purpose of erts/emulator/beam/erl_sys_driver.h? The note in the header file says it's for erlang driver writers but according to everything else it's erl_driver.h that should be included. Thanks, Joel From mogorman@REDACTED Thu Jan 24 15:30:50 2008 From: mogorman@REDACTED (mog) Date: Thu, 24 Jan 2008 08:30:50 -0600 Subject: [erlang-questions] : OTP Stack building problems In-Reply-To: <20080124084704.GA6686@erix.ericsson.se> References: <4797519B.8060301@astjab.org> <20080124084704.GA6686@erix.ericsson.se> Message-ID: <4798A11A.7020201@astjab.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Raimo Niskanen wrote: > Sorry about the lack of response on the erlang-bugs > mailing list. We have downprioritized this since > we felt SCTP was only for the ones that had a > specific need. But now it seems new Linux:es ship > both header files and libraries for SCTP, with > a too fresh version for our standard build. > > So, now this is a reeally annoying problem that > I am currently working on. We hope it will be > fixed in R12B-1; I have a dirty #ifdefing > solution that works for lksctp-tools-1.0.7 > but have not made regression tests against > the older version yet. So I will polish > on the #ifdefs before being happy. > > Any hints on how SCTP header files differ between > different OS:es are greatly appreciated, esp. > if struct sctp_event_subscribe.sctp_adaptation_layer_event > does not exist on FreeBSD, can one then count on > struct sctp_event_subscribe.sctp_adaption_layer_even > existing instead. (Ther is a patch on > http://www.nabble.com/Patch-to-fix-crypto-and-SCTP-support-on-FreeBSD-to11474612.html#a11474612 > that tests for the "adaptation" spelled variant and if it does > not exist assumes there is no such field instead of > falling back to the "adaption" spelling. > And we have no FreeBSD machine to test on... I can not say for certain that is the only change but, I would say it is highly probable that the only changes are those included in the patch I provided. It has worked on freebsd and debian boxes I tried it on. Mog _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHmKEapCttrJGOY6gRAg9OAKCEqh06VKBwKkgHUfA5+zN9HMYqxgCeIer9 gLOsDVhc6O4lciQxgTHokAA= =mW4u -----END PGP SIGNATURE----- From gbulmer@REDACTED Mon Jan 21 14:52:16 2008 From: gbulmer@REDACTED (G Bulmer) Date: Mon, 21 Jan 2008 13:52:16 +0000 Subject: [erlang-questions] help: Erlang MIDI driver for MAC OS X Message-ID: <400A6F0E-01D7-4D1D-9D38-9CDAE51F4B11@gmail.com> > Date: Fri, 18 Jan 2008 17:35:46 +0100 > From: "Joe Armstrong" > Subject: [erlang-questions] help: Erlang MIDI driver for MAC OS X ... > Hello, > > I'm trying to write an Erlang midi driver to connect an external > Roland Synthesizer (SH-201) to > a MacBook. > > So far I can receive MIDI events from the synt but not send events. > > Does anybody have any experience with the Mac OS X CoreAudio Framework > in particular with the CoreMIDI routines? > I have no experience, but I have been subscribing to Apple Developer for years, and I found some old (2004) links which led to these: (I assume you have them, but better to be safe than sorry !-) http://developer.apple.com/audio/ http://developer.apple.com/audio/pdf/coreaudio.pdf http://developer.apple.com/qa/qa2004/qa1374.html http://www.audiosynth.com/sinewavedemo.html HTH G Bulmer PS: I thought Apples mailing list UI was unbelievably unfriendly. I clicked on "Mailing List Archives" and it looked empty! I had to really dig. UI guidelines? Horrid! PPS: I couldn't find the coreaudio swiki, but this may be why: http:// lists.apple.com/archives/coreaudio-api/2006/Jan/msg00223.html From Martin.Logan@REDACTED Thu Jan 24 19:02:48 2008 From: Martin.Logan@REDACTED (Logan, Martin) Date: Thu, 24 Jan 2008 12:02:48 -0600 Subject: [erlang-questions] determining what erts version a .beamwascompiled with In-Reply-To: References: <4796E682.4050008@ericsson.com> Message-ID: Brilliant :) Thank you. -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Bjorn Gustavsson Sent: Thursday, January 24, 2008 2:44 AM To: erlang-questions@REDACTED Subject: Re: [erlang-questions] determining what erts version a .beamwascompiled with "Logan, Martin" writes: > How accessible is this; if I am running R10B-x will I be able to run beam_lib:chunks on a beam file compiled for R11B-x in most cases? Yes, it works fine. The beam file format has not been changed in a long time. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From david_holz@REDACTED Thu Jan 24 19:17:21 2008 From: david_holz@REDACTED (David Holz) Date: Thu, 24 Jan 2008 18:17:21 +0000 Subject: [erlang-questions] running sample progs for MGC and MG In-Reply-To: References: Message-ID: From: zerthurd@REDACTED > You have two way: > 1) Install X server on your windows machine, start it, then set DISPLAY variable on linux station to > "your_windows_addr:x_display", where your_windows_addr is network address of machine and x_display is display > number of X server > > 2) Do not run megaco_filter process. In this case you can see megaco messages on console, not in GUI. 3) Instead of 1), run an X server on windows (cygwin comes with one) and in Putty's configuration, check Connection -> SSH -> X11 -> Enable X11 forwarding. Then the DISPLAY and all that will be set up to pipe everything through your SSH into Windows. _________________________________________________________________ Shed those extra pounds with MSN and The Biggest Loser! http://biggestloser.msn.com/ From michael.campbell@REDACTED Thu Jan 24 19:47:12 2008 From: michael.campbell@REDACTED (Michael Campbell) Date: Thu, 24 Jan 2008 13:47:12 -0500 Subject: [erlang-questions] running sample progs for MGC and MG In-Reply-To: <4798DCA2.9050006@unixgeek.com> References: <4798DCA2.9050006@unixgeek.com> Message-ID: <4798DD30.6000005@unixgeek.com> David Holz wrote: > From: zerthurd@REDACTED >> You have two way: >> 1) Install X server on your windows machine, start it, then set >> DISPLAY variable on linux station to >> "your_windows_addr:x_display", where your_windows_addr is network >> address of machine and x_display is display >> number of X server >> >> 2) Do not run megaco_filter process. In this case you can see megaco >> messages on console, not in GUI. > > 3) Instead of 1), run an X server on windows (cygwin comes with one) > and in Putty's configuration, check Connection -> SSH -> X11 -> Enable > X11 forwarding. Then the DISPLAY and all that will be set up to pipe > everything through your SSH into Windows. This does indeed work fine, but it should be noted to the OP that cygwin's X server does NOT come by default; one must select the "X" package to download it. From lemenkov@REDACTED Thu Jan 24 20:03:26 2008 From: lemenkov@REDACTED (Peter Lemenkov) Date: Thu, 24 Jan 2008 22:03:26 +0300 Subject: [erlang-questions] running sample progs for MGC and MG In-Reply-To: <4798DD30.6000005@unixgeek.com> References: <4798DCA2.9050006@unixgeek.com> <4798DD30.6000005@unixgeek.com> Message-ID: 2008/1/24, Michael Campbell : > > This does indeed work fine, but it should be noted to the OP that > cygwin's X server does NOT come by default; one must select the "X" > package to download it. Xming is better choice for X-server for MS Windows systems. Based on X/Cygwin also. -- With best regards! From rec@REDACTED Thu Jan 24 18:58:26 2008 From: rec@REDACTED (Roger Critchlow) Date: Thu, 24 Jan 2008 10:58:26 -0700 Subject: [erlang-questions] simple ets question In-Reply-To: <33131.213.41.242.251.1201168144.squirrel@mail.erlangsystems.com> References: <66d1c98f0801231027k57f5ab34v8de4e2cedc964f67@mail.gmail.com> <33131.213.41.242.251.1201168144.squirrel@mail.erlangsystems.com> Message-ID: <66d1c98f0801240958q740a9f70xac75d4b43a7f7279@mail.gmail.com> Ah, much simpler than I thought. Thank you both. -- rec -- On Jan 24, 2008 2:49 AM, wrote: > Use ets:new(test, [named_table]) to get the same result in 2> and 3> From matthew@REDACTED Thu Jan 24 20:32:06 2008 From: matthew@REDACTED (Matthew Dempsky) Date: Thu, 24 Jan 2008 11:32:06 -0800 Subject: [erlang-questions] Crypto module In-Reply-To: <003801c85d2a$903f8270$6401a8c0@moneymaker2> References: <003801c85d2a$903f8270$6401a8c0@moneymaker2> Message-ID: On 1/22/08, Valentin Micic wrote: > I do not see any reference in documentation for R12 regarding crypto > library, thus, I would really appreciate if anyone could answer this > question: You can run "erl -man crypto" or go to http://www.erlang.org/doc/man/crypto.html. > Is SHA-2 supported (a.k.a 256-bit SHA) supported? No. From dietmar-s@REDACTED Thu Jan 24 16:43:23 2008 From: dietmar-s@REDACTED (Dietmar Schaefer) Date: Thu, 24 Jan 2008 16:43:23 +0100 Subject: [erlang-questions] : OTP Stack building problems Message-ID: <4798B21B.7020801@online.de> Hi ! I have just tried to configure and to compile otp_R12B-0 under fedora 8 and haven't had any problems. I installed all updates to fedora 8. regards Dietmar From kip.macy@REDACTED Thu Jan 24 22:01:51 2008 From: kip.macy@REDACTED (Kip Macy) Date: Thu, 24 Jan 2008 13:01:51 -0800 Subject: [erlang-questions] : OTP Stack building problems In-Reply-To: <20080124084704.GA6686@erix.ericsson.se> References: <4797519B.8060301@astjab.org> <20080124084704.GA6686@erix.ericsson.se> Message-ID: "adaptation" was initially spelled wrong in the RFC. The linux stack continued to use the wrong spelling for some time after it was fixed in the BSD stack that most other operating systems use. -Kip On Jan 24, 2008 12:47 AM, Raimo Niskanen wrote: > Sorry about the lack of response on the erlang-bugs > mailing list. We have downprioritized this since > we felt SCTP was only for the ones that had a > specific need. But now it seems new Linux:es ship > both header files and libraries for SCTP, with > a too fresh version for our standard build. > > So, now this is a reeally annoying problem that > I am currently working on. We hope it will be > fixed in R12B-1; I have a dirty #ifdefing > solution that works for lksctp-tools-1.0.7 > but have not made regression tests against > the older version yet. So I will polish > on the #ifdefs before being happy. > > Any hints on how SCTP header files differ between > different OS:es are greatly appreciated, esp. > if struct sctp_event_subscribe.sctp_adaptation_layer_event > does not exist on FreeBSD, can one then count on > struct sctp_event_subscribe.sctp_adaption_layer_even > existing instead. (Ther is a patch on > http://www.nabble.com/Patch-to-fix-crypto-and-SCTP-support-on-FreeBSD-to11474612.html#a11474612 > that tests for the "adaptation" spelled variant and if it does > not exist assumes there is no such field instead of > falling back to the "adaption" spelling. > And we have no FreeBSD machine to test on... > > > > On Wed, Jan 23, 2008 at 08:39:23AM -0600, mog wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > J Bhanot wrote: > > > > > > Hi, > > > > > > I am trying to build the OTP stack on Fedora Core 8... > > > > > > I am using fllowing stack > > > > > > otp_src_R12B-0 > > > > > > ./configure works ok without throwing errors > > > > > > but during make all, it gives the following errors > > > > > > drivers/common/inet_drv.c: In function ?sctp_parse_async_event?: > > > drivers/common/inet_drv.c:3100: error: ?SCTP_ADAPTION_INDICATION? > > > undeclared (first use in thi > > > s function) > > > drivers/common/inet_drv.c:3100: error: (Each undeclared identifier is > > > reported only once > > > drivers/common/inet_drv.c:3100: error: for each function it appears in.) > > > drivers/common/inet_drv.c:3106: error: ?union sctp_notification? has no > > > member named ?sn_adapt > > > ion_event? > > > drivers/common/inet_drv.c:3111: error: dereferencing pointer to > > > incomplete type > > > drivers/common/inet_drv.c:3112: error: dereferencing pointer to > > > incomplete type > > > drivers/common/inet_drv.c:3112: warning: left-hand operand of comma > > > expression has no effect > > > drivers/common/inet_drv.c: In function ?sctp_set_opts?: > > > drivers/common/inet_drv.c:5323: error: field ?ad? has incomplete type > > > drivers/common/inet_drv.c:5584: error: ?SCTP_ADAPTION_LAYER? undeclared > > > (first use in this fun > > > ction) > > > drivers/common/inet_drv.c:5688: error: ?struct sctp_event_subscribe? has > > > no member named ?sctp > > > _adaption_layer_event? > > > drivers/common/inet_drv.c: In function ?sctp_fill_opts?: > > > drivers/common/inet_drv.c:6448: error: storage size of ?ad? isn?t known > > > drivers/common/inet_drv.c:6451: error: ?SCTP_ADAPTION_LAYER? undeclared > > > (first use in this fun > > > ction) > > > drivers/common/inet_drv.c:6458: warning: left-hand operand of comma > > > expression has no effect > > > drivers/common/inet_drv.c:6448: warning: unused variable ?ad? > > > drivers/common/inet_drv.c:6586: error: ?struct sctp_event_subscribe? has > > > no member named ?sctp > > > _adaption_layer_event? > > > drivers/common/inet_drv.c:6586: warning: left-hand operand of comma > > > expression has no effect > > > make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] Error 1 > > > make[3]: Leaving directory > > > `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' > > > make[2]: *** [opt] Error 2 > > > make[2]: Leaving directory > > > `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' > > > make[1]: *** [smp] Error 2 > > > make[1]: Leaving directory > > > `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts' > > > make: *** [emulator] Error 2 > > > > > I to have found this problem and submitted a patch to fix it for later > > versions of Gnu/Linux and friends but haven't heard any response back. > > here is a link > > http://erlang.org/pipermail/erlang-bugs/2008-January/000612.html > > > > Mog > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.4.6 (GNU/Linux) > > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > > > iD8DBQFHl1GapCttrJGOY6gRAi9tAJ9+7lc4t6yxT4mEBC+JD6oxB+zdQgCfSMU4 > > RAQpo9Nz2by1wixJCAkkeFw= > > =3uhI > > -----END PGP SIGNATURE----- > > _______________________________________________ > > 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 masterofquestions@REDACTED Thu Jan 24 15:01:22 2008 From: masterofquestions@REDACTED (Russell King) Date: Thu, 24 Jan 2008 09:01:22 -0500 Subject: [erlang-questions] Erlang Debugging Problems Message-ID: <1218d6a50801240601x376b18acr78f7e13f95adc600@mail.gmail.com> 1) when you compile modules with debug_info & smart_exceptions together, smart_exceptions doesn't work. Why is that? My emakefile: %smart_exceptions works when I don't inlcude debug_info {"./*", [{parse_transform,smart_exceptions}, {outdir, "ebin"}]}. %smart_exceptons doesn't work when you include debug_info %{"./*", [{debug_info,parse_transform,smart_exceptions}, {outdir, "ebin"}]}. 2) Is there a way to turn off error messages appearing in erl shell? At the moment, I have error messages going to syslog and erl shell. I just want to turn off errors appearing in the shell. Is there a way to do this? 3) I have been using erlang debugger trace and contents get dumped to a file. But you get into situation where your application hangs and in that case I don't see the contents in the debugger trace dump file. Is there a way to force flush the buffer on an time interval, on every call to a function(module/line), or decrease the buffer size, so that when the buffer is full, it get flushed? thanks, debugging erlang is frustrating. Waiting for Eclipse Debugger. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.wiger@REDACTED Thu Jan 24 23:14:21 2008 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Thu, 24 Jan 2008 23:14:21 +0100 Subject: [erlang-questions] : OTP Stack building problems In-Reply-To: References: <4797519B.8060301@astjab.org> <20080124084704.GA6686@erix.ericsson.se> Message-ID: <47990DBD.70506@ericsson.com> Kip Macy skrev: > "adaptation" was initially spelled wrong in the RFC. The linux stack > continued to use the wrong spelling for some time after it was fixed > in the BSD stack that most other operating systems use. > > -Kip To be fair, both spellings are correct, so the actual bug is of course not being consistent about it. ;-) "Adaptation" is the most common form. According to Webster, it dates back to 1610. The synonym "adaption" appeared in 1704, but hasn't yet achieved the same level of popularity. Given a few more centuries, perhaps it will... BR, Ulf W > > On Jan 24, 2008 12:47 AM, Raimo Niskanen > wrote: >> Sorry about the lack of response on the erlang-bugs >> mailing list. We have downprioritized this since >> we felt SCTP was only for the ones that had a >> specific need. But now it seems new Linux:es ship >> both header files and libraries for SCTP, with >> a too fresh version for our standard build. >> >> So, now this is a reeally annoying problem that >> I am currently working on. We hope it will be >> fixed in R12B-1; I have a dirty #ifdefing >> solution that works for lksctp-tools-1.0.7 >> but have not made regression tests against >> the older version yet. So I will polish >> on the #ifdefs before being happy. >> >> Any hints on how SCTP header files differ between >> different OS:es are greatly appreciated, esp. >> if struct sctp_event_subscribe.sctp_adaptation_layer_event >> does not exist on FreeBSD, can one then count on >> struct sctp_event_subscribe.sctp_adaption_layer_even >> existing instead. (Ther is a patch on >> http://www.nabble.com/Patch-to-fix-crypto-and-SCTP-support-on-FreeBSD-to11474612.html#a11474612 >> that tests for the "adaptation" spelled variant and if it does >> not exist assumes there is no such field instead of >> falling back to the "adaption" spelling. >> And we have no FreeBSD machine to test on... >> >> >> >> On Wed, Jan 23, 2008 at 08:39:23AM -0600, mog wrote: >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA1 >>> >>> J Bhanot wrote: >>>> Hi, >>>> >>>> I am trying to build the OTP stack on Fedora Core 8... >>>> >>>> I am using fllowing stack >>>> >>>> otp_src_R12B-0 >>>> >>>> ./configure works ok without throwing errors >>>> >>>> but during make all, it gives the following errors >>>> >>>> drivers/common/inet_drv.c: In function ?sctp_parse_async_event?: >>>> drivers/common/inet_drv.c:3100: error: ?SCTP_ADAPTION_INDICATION? >>>> undeclared (first use in thi >>>> s function) >>>> drivers/common/inet_drv.c:3100: error: (Each undeclared identifier is >>>> reported only once >>>> drivers/common/inet_drv.c:3100: error: for each function it appears in.) >>>> drivers/common/inet_drv.c:3106: error: ?union sctp_notification? has no >>>> member named ?sn_adapt >>>> ion_event? >>>> drivers/common/inet_drv.c:3111: error: dereferencing pointer to >>>> incomplete type >>>> drivers/common/inet_drv.c:3112: error: dereferencing pointer to >>>> incomplete type >>>> drivers/common/inet_drv.c:3112: warning: left-hand operand of comma >>>> expression has no effect >>>> drivers/common/inet_drv.c: In function ?sctp_set_opts?: >>>> drivers/common/inet_drv.c:5323: error: field ?ad? has incomplete type >>>> drivers/common/inet_drv.c:5584: error: ?SCTP_ADAPTION_LAYER? undeclared >>>> (first use in this fun >>>> ction) >>>> drivers/common/inet_drv.c:5688: error: ?struct sctp_event_subscribe? has >>>> no member named ?sctp >>>> _adaption_layer_event? >>>> drivers/common/inet_drv.c: In function ?sctp_fill_opts?: >>>> drivers/common/inet_drv.c:6448: error: storage size of ?ad? isn?t known >>>> drivers/common/inet_drv.c:6451: error: ?SCTP_ADAPTION_LAYER? undeclared >>>> (first use in this fun >>>> ction) >>>> drivers/common/inet_drv.c:6458: warning: left-hand operand of comma >>>> expression has no effect >>>> drivers/common/inet_drv.c:6448: warning: unused variable ?ad? >>>> drivers/common/inet_drv.c:6586: error: ?struct sctp_event_subscribe? has >>>> no member named ?sctp >>>> _adaption_layer_event? >>>> drivers/common/inet_drv.c:6586: warning: left-hand operand of comma >>>> expression has no effect >>>> make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] Error 1 >>>> make[3]: Leaving directory >>>> `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' >>>> make[2]: *** [opt] Error 2 >>>> make[2]: Leaving directory >>>> `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts/emulator' >>>> make[1]: *** [smp] Error 2 >>>> make[1]: Leaving directory >>>> `/home/j.bhanot/Download/H.248/otp_src_R12B-0/erts' >>>> make: *** [emulator] Error 2 >>>> >>> I to have found this problem and submitted a patch to fix it for later >>> versions of Gnu/Linux and friends but haven't heard any response back. >>> here is a link >>> http://erlang.org/pipermail/erlang-bugs/2008-January/000612.html >>> >>> Mog >>> -----BEGIN PGP SIGNATURE----- >>> Version: GnuPG v1.4.6 (GNU/Linux) >>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >>> >>> iD8DBQFHl1GapCttrJGOY6gRAi9tAJ9+7lc4t6yxT4mEBC+JD6oxB+zdQgCfSMU4 >>> RAQpo9Nz2by1wixJCAkkeFw= >>> =3uhI >>> -----END PGP SIGNATURE----- >>> _______________________________________________ >>> 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 From daniel.goertzen@REDACTED Thu Jan 24 23:43:46 2008 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Thu, 24 Jan 2008 16:43:46 -0600 Subject: [erlang-questions] disk_log:chunk_step() complexity? Message-ID: What is the big O complexity of disk_log:chunk_step() ? My situation is that I will have a very large log that is to be displayed in a window with a scrollbar. I want to step to the Nth record very quickly and then read the next 50 records or so for display in my window. Thanks, Dan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tty.erlang@REDACTED Thu Jan 24 23:59:35 2008 From: tty.erlang@REDACTED (t ty) Date: Thu, 24 Jan 2008 17:59:35 -0500 Subject: [erlang-questions] Call For Paper: 7th ACM SIGPLAN Erlang Workshop 2008 Message-ID: <290b3ba10801241459k4d6bae0bwa391b5802210c9b0@mail.gmail.com> Posted on behalf of Zoltan Horvath (PC Chair of Erlang Workshop) ----------------------------------------------------- First Call for papers Seventh ACM SIGPLAN Erlang Workshop Victoria, British Columbia, Canada, September, 2008 http://www.erlang.org/workshop/2008/ Satellite event of ACM SIGPLAN International Conference on Functional Programming, September 22-24, 2008 The Erlang workshop will take place during one day in connection with ICFP'08 (see http://www.icfpconference.org/icfp2008/) Important Dates Submission deadline - Midnight GMT June 10 Author notification - Midnight GMT June 30 Final submission - Midnight GMT July 14 Erlang is a concurrent, distributed functional programming language aimed at systems with requirements on massive concurrency, soft real time response, fault tolerance, and high availability. It has been available as open source for several years creating a community that actively contributes to its already existing rich set of libraries and applications. Originally created for telecom applications, its usage has spread to other domains including e-commerce, banking, and computer telephony. Erlang programs are today among the largest applications written in any functional programming language. These applications offer new opportunities to evaluate functional programming and functional programming methods on a very large scale and suggest new problems for the research community to solve. This workshop will bring together the open source, academic, and industrial programming communities of Erlang. It will enable participants to familiarize themselves with recent developments on new techniques and tools tailored to Erlang, novel applications, draw lessons from users' experiences and identify research problems and common areas relevant to the practice of Erlang and functional programming. Submission and publication information The workshop will have printed proceedings which will be distributed to the participants at the time of the workshop. Subsequently, the papers will be included in the ACM Digital Library. Authors are therefore advised to use the Author Information for SIGPLAN Conferences when preparing their submissions. Authors should submit provisional full papers. Submissions will be accepted electronically; the submission page is not yet ready. The length should be restricted to 12 pages in standard ACM format. In previous workshops we have had a mix of papers representing academic research and industrial experiences with Erlang. We particularly welcome papers describing new and novel application of Erlang - if you have any doubts about the suitability of a paper please feel free to contact the Program Chair for advice. Authors should submit their papers using the submission website. In case of technical problems, please contact erlangws08@REDACTED Workshop Chair Tee Teoh, Canadian Bank Note, Ottawa, Canada Program Chair Zolt?n Horv?th, Department of Programming Languages and Programming, Faculty of Informatics, E?tv?s Lor?nd University, Budapest, Hungary Program Committee Thomas Arts, IT University, G?teborg, Sweden Francesco Cesarini, Erlang Training and Consulting, London, UK Clara Benac Earle, University Carlos III, Madrid, Spain John Hughes, Chalmers University of Technology, G?teborg, Sweden Erik Stenman, Kreditor, Stockholm, Sweden Zolt?n Theisz, Ericsson, Ireland Simon Thompson, University of Kent,Canterbury, UK Rex Page, University of Oklahoma, USA For Venue and registration, please see the ICFP web site Related Links Erlang Workshop web site: http://www.erlang.org/workshop/2008/ ICFP 2008 web site: http://www.icfpconference.org/icfp2008/ Past ACM SIGPLAN Erlang workshops http://www.erlang.se/workshop From bsayanthan@REDACTED Fri Jan 25 03:44:07 2008 From: bsayanthan@REDACTED (Balathasan Sayanthan) Date: Fri, 25 Jan 2008 08:14:07 +0530 Subject: [erlang-questions] make fails in fc7 In-Reply-To: <15037718.post@talk.nabble.com> References: <9b2076080801140234o7524e44enea6be8bf0b1dc29d@mail.gmail.com> <15037718.post@talk.nabble.com> Message-ID: <9b2076080801241844q5078c43bp77952bf89479b68a@mail.gmail.com> Hi Mukul, I removed my sctp.h file from includes and then tried the ./configure and then it worked. I think you will be able to find the file at /usr/include/netinet/sctp.h regards, Sayanthan On Jan 23, 2008 2:49 PM, Mukul Jain wrote: > > Hi, > I am getting the same error while executing make after ./configure. > > I tried to install erlang [otp_src_R12B-0] on fedora core 8 but when the > make command was issued I got the following error. > > How can I fix it? > > drivers/common/inet_drv.c: In function ?sctp_parse_async_event?: > drivers/common/inet_drv.c:3100: error: ?SCTP_ADAPTION_INDICATION? > undeclared > (first use in this function) > drivers/common/inet_drv.c:3100: error: (Each undeclared identifier is > reported only once > drivers/common/inet_drv.c:3100: error: for each function it appears in.) > drivers/common/inet_drv.c:3106: error: ?union sctp_notification? has no > member named ?sn_adaption_event? > drivers/common/inet_drv.c:3111: error: dereferencing pointer to incomplete > type > drivers/common/inet_drv.c:3112: error: dereferencing pointer to incomplete > type > drivers/common/inet_drv.c:3112: warning: left-hand operand of comma > expression has no effect > drivers/common/inet_drv.c: In function ?sctp_set_opts?: > drivers/common/inet_drv.c:5323: error: field ?ad? has incomplete type > drivers/common/inet_drv.c:5584: error: ?SCTP_ADAPTION_LAYER? undeclared > (first use in this function) > drivers/common/inet_drv.c:5688: error: ?struct sctp_event_subscribe? has > no > member named ?sctp_adaption_layer_event? > drivers/common/inet_drv.c: In function ?sctp_fill_opts?: > drivers/common/inet_drv.c:6448: error: storage size of ?ad? isn?t known > drivers/common/inet_drv.c:6451: error: ?SCTP_ADAPTION_LAYER? undeclared > (first use in this function) > drivers/common/inet_drv.c:6458: warning: left-hand operand of comma > expression has no effect > drivers/common/inet_drv.c:6448: warning: unused variable ?ad? > drivers/common/inet_drv.c:6586: error: ?struct sctp_event_subscribe? has > no > member named ?sctp_adaption_layer_event? > drivers/common/inet_drv.c:6586: warning: left-hand operand of comma > expression has no effect > make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] Error 1 > make[3]: Leaving directory > `/home/a.parkash/Download/otp_src_R12B-0/erts/emulator' > make[2]: *** [opt] Error 2 > make[2]: Leaving directory > `/home/a.parkash/Download/otp_src_R12B-0/erts/emulator' > make[1]: *** [smp] Error 2 > make[1]: Leaving directory `/home/a.parkash/Download/otp_src_R12B-0/erts' > make: *** [emulator] Error 2 > > Please let me know solutions if they exists. > > Regards, > Mukul > > > > > Balathasan Sayanthan wrote: > > > > Hi All, > > > > I tried to install erlang [otp_src_R12B-0] on fedora core 7 but when the > > make command was issued I got the following error. > > > > How can I fix it? > > > > drivers/common/inet_drv.c: In function 'sctp_parse_async_event': > > drivers/common/inet_drv.c:3100: error: 'SCTP_ADAPTION_INDICATION' > > undeclared > > (first use in this function) > > drivers/common/inet_drv.c:3100: error: (Each undeclared identifier is > > reported only once > > drivers/common/inet_drv.c:3100: error: for each function it appears in.) > > drivers/common/inet_drv.c:3106: error: 'union sctp_notification' has no > > member named 'sn_adaption_event' > > drivers/common/inet_drv.c:3111: error: dereferencing pointer to > incomplete > > type > > drivers/common/inet_drv.c:3112: error: dereferencing pointer to > incomplete > > type > > drivers/common/inet_drv.c:3112: warning: left-hand operand of comma > > expression has no effect > > drivers/common/inet_drv.c: In function 'sctp_set_opts': > > drivers/common/inet_drv.c:5323: error: field 'ad' has incomplete type > > drivers/common/inet_drv.c:5584: error: 'SCTP_ADAPTION_LAYER' undeclared > > (first use in this function) > > drivers/common/inet_drv.c:5688: error: 'struct sctp_event_subscribe' has > > no > > member named 'sctp_adaption_layer_event' > > drivers/common/inet_drv.c: In function 'sctp_fill_opts': > > drivers/common/inet_drv.c:6448: error: storage size of 'ad' isn't known > > drivers/common/inet_drv.c:6451: error: 'SCTP_ADAPTION_LAYER' undeclared > > (first use in this function) > > drivers/common/inet_drv.c:6458: warning: left-hand operand of comma > > expression has no effect > > drivers/common/inet_drv.c:6448: warning: unused variable 'ad' > > drivers/common/inet_drv.c:6586: error: 'struct sctp_event_subscribe' has > > no > > member named 'sctp_adaption_layer_event' > > drivers/common/inet_drv.c:6586: warning: left-hand operand of comma > > expression has no effect > > make[3]: *** [obj/i686-pc-linux-gnu/opt/smp/inet_drv.o] Error 1 > > > > thank you. > > > > regards > > > > > > -- > > Sayanthan > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > -- > View this message in context: > http://www.nabble.com/make-fails-in-fc7-tp14799447p15037718.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 -- Balathasan Sayanthan -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.bhanot@REDACTED Fri Jan 25 07:18:33 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Fri, 25 Jan 2008 11:48:33 +0530 Subject: [erlang-questions] running sample progs for MGC and MG In-Reply-To: Message-ID: Hi , I am having some startup trouble here understanding the exact way this stack works... Few queries that I have : 1. Does this stack gives the functionality/instance of MGC and MG or I would need it separately (think satck will be providing that) 2. In the user guide for Megaco, in order to prepare MGC to recieve messages follwoing needs to ne done Start the Megaco application. (how to do that -- configure-build-install the OTP stack then run follwoing command - erl -pa ../../../megaco/ebin -s megaco_filter -s megaco)....am just in the process of learning Erlang as well (don't understand the erlang syntax as of now but will learn :-)......another question - how to make megaco_filter off so that megaco messages can be seen on console) Start the MGC user. This may either be done explicitly with megaco:start_user/2 or implicitly by providing the -megaco users configuration parameter. (how to do that - once I run the above command, i get erlang shell - 1>...then type megaco:start_user/2.....that should make my MGC up and running ..listeniing at some port) Initiate the transport service and provide it with a receive handle obtained from megaco:user_info/2.(How to do that)... Please correct me if my understanding is correct.. Please forgive me if my quesetions appear to be a bit too novice.. Thanking in anticipation... Cheers, jb "Maxim Treskin" 01/24/2008 04:25 PM To "J Bhanot" cc erlang-questions@REDACTED, megaco@REDACTED Subject Re: [erlang-questions] running sample progs for MGC and MG On 24/01/2008, J Bhanot wrote: Hi Maxim, I was using putty from my local windows machine to connect to linux server and then running this sample application..... but when i ran this script from linux sever itself (FC8)....it did show MGC GUI... now it want to display GUI from my local windows machine running this appl on putty...for this i am trying to download an interface b/w linux and windows i.e ReflectionX hoping that it would open the GUI from my local windows m/c.... You have two way: 1) Install X server on your windows machine, start it, then set DISPLAY variable on linux station to "your_windows_addr:x_display", where your_windows_addr is network address of machine and x_display is display number of X server 2) Do not run megaco_filter process. In this case you can see megaco messages on console, not in GUI. Second question is that - I am looking into erl_interface library now when you say atleast one erlang node should be running ...do you mean that anyways i will have to use Erlang in building some application ( Start Media Gateway Controller) and then if i want to start Media Gateway ....i can use my C application to start it and then making MG communicate with MGW via erl_interface library using C.... At least one erlang node should be started for MGC and one node for each MG. Also you must write pice of code in erlang to handle megaco messages. The easiest way is learn Erlang OTP, and write whole application on this platform. You can write low-level part of application on C/C++, but it is impossible to write high-level part, megaco messaging, on other language, not Erlang. Actually, i am bit hazy about this at this moment... Could you kindly throw more light on that... Appreciate your help... Many Thanks, jb --- Maxim 'Zert' Treskin ForwardSourceID:NT0000DC3A =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From zerthurd@REDACTED Fri Jan 25 07:49:40 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Fri, 25 Jan 2008 12:49:40 +0600 Subject: [erlang-questions] running sample progs for MGC and MG In-Reply-To: References: Message-ID: You can off megaco_filter by removing -s megaco_filter out of your startup line. --- Maxim 'Zert' Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Fri Jan 25 09:07:54 2008 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 25 Jan 2008 09:07:54 +0100 Subject: [erlang-questions] SCTP incompatible change vote Message-ID: <20080125080754.GA14072@erix.ericsson.se> Regarding the 'adaption' -> 'adaptation' spelling change in the lksctp API: I will change the inet driver's use of the lksctp API to cope with both spellings, but what to do with the gen_sctp API in Erlang? Either: 1) I change all spellings of 'adaption' to 'adaptation' in the Erlang API while I am at it, that is in R12B-1, or in R12B-2 if I do not make the deadline. The sooner such a change is made the better before too many users are stuck with the old spelling. or 2) I keep the Erlang API until the next major release (R13B) because such large changes should not happen in a minor release. or perhaps 3) I never change the Erlang API, just to confuse SCTP users and to be backwards compatible. I really do not believe 3) is a serious alternative. But what do you (the users) want, 1) or 2) ? Or 4) (own suggestion) ? -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Fri Jan 25 09:46:20 2008 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 25 Jan 2008 09:46:20 +0100 Subject: [erlang-questions] : : OTP Stack building problems In-Reply-To: <4798A11A.7020201@astjab.org> References: <4797519B.8060301@astjab.org> <20080124084704.GA6686@erix.ericsson.se> <4798A11A.7020201@astjab.org> Message-ID: <20080125084620.GA8565@erix.ericsson.se> On Thu, Jan 24, 2008 at 08:30:50AM -0600, mog wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Raimo Niskanen wrote: : > > Any hints on how SCTP header files differ between > > different OS:es are greatly appreciated, esp. > > if struct sctp_event_subscribe.sctp_adaptation_layer_event > > does not exist on FreeBSD, can one then count on > > struct sctp_event_subscribe.sctp_adaption_layer_even > > existing instead. (Ther is a patch on > > http://www.nabble.com/Patch-to-fix-crypto-and-SCTP-support-on-FreeBSD-to11474612.html#a11474612 > > that tests for the "adaptation" spelled variant and if it does > > not exist assumes there is no such field instead of > > falling back to the "adaption" spelling. > > And we have no FreeBSD machine to test on... > > I can not say for certain that is the only change but, I would say it is > highly probable that the only changes are those included in the patch I > provided. It has worked on freebsd and debian boxes I tried it on. > > Mog > A more specific question then, about your patch: Is there a reason to test separately for struct sctp_event_subscribe.sctp_adaptation_layer_event and if it is not defined exclude the field from the sctp_event_subscribe return record? Or in other words: are there BSD:s that have SCTP but do not have struct sctp_event_subscribe.sctp_adaptation_layer_event and also do not have struct sctp_event_subscribe.sctp_adaption_layer_event but have struct sctp_event_subscribe ? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHmKEapCttrJGOY6gRAg9OAKCEqh06VKBwKkgHUfA5+zN9HMYqxgCeIer9 > gLOsDVhc6O4lciQxgTHokAA= > =mW4u > -----END PGP SIGNATURE----- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From kenneth.lundin@REDACTED Fri Jan 25 10:05:37 2008 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 25 Jan 2008 10:05:37 +0100 Subject: [erlang-questions] SCTP incompatible change vote In-Reply-To: <20080125080754.GA14072@erix.ericsson.se> References: <20080125080754.GA14072@erix.ericsson.se> Message-ID: Alternative 1 naturligtvis. Eftersom vi inte har n?gra skarpa kunder ?nnu. /mvh Kenneth On 1/25/08, Raimo Niskanen wrote: > Regarding the 'adaption' -> 'adaptation' spelling change > in the lksctp API: > > I will change the inet driver's use of the lksctp API to > cope with both spellings, but what to do with the > gen_sctp API in Erlang? Either: > 1) I change all spellings of 'adaption' to 'adaptation' > in the Erlang API while I am at it, that is in R12B-1, > or in R12B-2 if I do not make the deadline. The sooner > such a change is made the better before too many > users are stuck with the old spelling. > or > 2) I keep the Erlang API until the next major release > (R13B) because such large changes should not happen > in a minor release. > or perhaps > 3) I never change the Erlang API, just to confuse > SCTP users and to be backwards compatible. > > I really do not believe 3) is a serious alternative. > But what do you (the users) want, 1) or 2) ? > Or 4) (own suggestion) ? > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From thomasl_erlang@REDACTED Fri Jan 25 09:50:21 2008 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 25 Jan 2008 00:50:21 -0800 (PST) Subject: [erlang-questions] Erlang Debugging Problems In-Reply-To: <1218d6a50801240601x376b18acr78f7e13f95adc600@mail.gmail.com> Message-ID: <138434.21018.qm@web38808.mail.mud.yahoo.com> --- Russell King wrote: > 1) > when you compile modules with debug_info & > smart_exceptions together, > smart_exceptions doesn't work. Why is that? > > My emakefile: > %smart_exceptions works when I don't inlcude > debug_info > {"./*", [{parse_transform,smart_exceptions}, > {outdir, "ebin"}]}. > %smart_exceptons doesn't work when you include > debug_info > %{"./*", > [{debug_info,parse_transform,smart_exceptions}, > {outdir, "ebin"}]}. Shouldn't that be [debug_info, {parse_transform, ...},...]? Anyway, do note that smart_exceptions are getting a bit long in the tooth. I haven't had the opportunity to port it to more recent releases yet, alas. Best, Thomas ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From thomasl_erlang@REDACTED Fri Jan 25 10:01:01 2008 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 25 Jan 2008 01:01:01 -0800 (PST) Subject: [erlang-questions] SCTP incompatible change vote In-Reply-To: <20080125080754.GA14072@erix.ericsson.se> Message-ID: <197377.71870.qm@web38812.mail.mud.yahoo.com> --- Raimo Niskanen wrote: > Regarding the 'adaption' -> 'adaptation' spelling > change > in the lksctp API: > > I will change the inet driver's use of the lksctp > API to > cope with both spellings, but what to do with the > gen_sctp API in Erlang? Either: > 1) I change all spellings of 'adaption' to > 'adaptation' > in the Erlang API while I am at it, that is in > R12B-1, > or in R12B-2 if I do not make the deadline. The > sooner > such a change is made the better before too many > users are stuck with the old spelling. > or > 2) I keep the Erlang API until the next major > release > (R13B) because such large changes should not > happen > in a minor release. > or perhaps > 3) I never change the Erlang API, just to confuse > SCTP users and to be backwards compatible. > > I really do not believe 3) is a serious alternative. > But what do you (the users) want, 1) or 2) ? > Or 4) (own suggestion) ? You could also 4) detect and rewrite uses of 'adaption' into 'adaptation' and issue warnings, of course. However, I'd be okay with 1). Change it ASAP before the API turns to stone :-) Best, Thomas ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From saleyn@REDACTED Fri Jan 25 14:55:06 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Fri, 25 Jan 2008 08:55:06 -0500 Subject: [erlang-questions] SCTP incompatible change vote In-Reply-To: References: <20080125080754.GA14072@erix.ericsson.se> Message-ID: <4799EA3A.1090402@gmail.com> Kenneth Lundin wrote: > Alternative 1 naturligtvis. Eftersom vi inte har n?gra skarpa kunder ?nnu. Excuse my English ;-) but I was thinking of another argument in favor of #1. SCTP support has never been announced to be "production-ready". It was included in R11B-5 in beta status, so you would be welcome to change API reasonably without worrying too much about backward compatibility until you remove the "beta" status. Serge > /mvh Kenneth > > On 1/25/08, Raimo Niskanen wrote: >> Regarding the 'adaption' -> 'adaptation' spelling change >> in the lksctp API: >> >> I will change the inet driver's use of the lksctp API to >> cope with both spellings, but what to do with the >> gen_sctp API in Erlang? Either: >> 1) I change all spellings of 'adaption' to 'adaptation' >> in the Erlang API while I am at it, that is in R12B-1, >> or in R12B-2 if I do not make the deadline. The sooner >> such a change is made the better before too many >> users are stuck with the old spelling. >> or >> 2) I keep the Erlang API until the next major release >> (R13B) because such large changes should not happen >> in a minor release. >> or perhaps >> 3) I never change the Erlang API, just to confuse >> SCTP users and to be backwards compatible. >> >> I really do not believe 3) is a serious alternative. >> But what do you (the users) want, 1) or 2) ? >> Or 4) (own suggestion) ? >> >> -- >> >> / Raimo Niskanen, Erlang/OTP, Ericsson AB From saleyn@REDACTED Fri Jan 25 15:17:00 2008 From: saleyn@REDACTED (Serge Aleynikov) Date: Fri, 25 Jan 2008 09:17:00 -0500 Subject: [erlang-questions] Erlang on RTEMS Message-ID: <4799EF5C.8070206@gmail.com> Did anyone try to build/use Erlang on RTEMS? Serge From vinoski@REDACTED Fri Jan 25 15:26:04 2008 From: vinoski@REDACTED (Steve Vinoski) Date: Fri, 25 Jan 2008 09:26:04 -0500 Subject: [erlang-questions] SCTP incompatible change vote In-Reply-To: <4799EA3A.1090402@gmail.com> References: <20080125080754.GA14072@erix.ericsson.se> <4799EA3A.1090402@gmail.com> Message-ID: <65b2728e0801250626j277fe595pa87609c31f866d0@mail.gmail.com> On 1/25/08, Serge Aleynikov wrote: > Kenneth Lundin wrote: > > Alternative 1 naturligtvis. Eftersom vi inte har n?gra skarpa kunder ?nnu. > > Excuse my English ;-) but I was thinking of another argument in favor of > #1. SCTP support has never been announced to be "production-ready". It > was included in R11B-5 in beta status, so you would be welcome to change > API reasonably without worrying too much about backward compatibility > until you remove the "beta" status. +1 to what Serge says. Changing it now will be easier than changing it later. --steve From vychodil.hynek@REDACTED Fri Jan 25 15:35:40 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Fri, 25 Jan 2008 15:35:40 +0100 Subject: [erlang-questions] SCTP incompatible change vote In-Reply-To: <4799EA3A.1090402@gmail.com> References: <20080125080754.GA14072@erix.ericsson.se> <4799EA3A.1090402@gmail.com> Message-ID: <4d08db370801250635v6467620cuc17399d165f421ad@mail.gmail.com> +1 Good point. On Jan 25, 2008 2:55 PM, Serge Aleynikov wrote: > Kenneth Lundin wrote: > > Alternative 1 naturligtvis. Eftersom vi inte har n?gra skarpa kunder ?nnu. > > Excuse my English ;-) but I was thinking of another argument in favor of > #1. SCTP support has never been announced to be "production-ready". It > was included in R11B-5 in beta status, so you would be welcome to change > API reasonably without worrying too much about backward compatibility > until you remove the "beta" status. > > Serge > > > > /mvh Kenneth > > > > On 1/25/08, Raimo Niskanen wrote: > >> Regarding the 'adaption' -> 'adaptation' spelling change > >> in the lksctp API: > >> > >> I will change the inet driver's use of the lksctp API to > >> cope with both spellings, but what to do with the > >> gen_sctp API in Erlang? Either: > >> 1) I change all spellings of 'adaption' to 'adaptation' > >> in the Erlang API while I am at it, that is in R12B-1, > >> or in R12B-2 if I do not make the deadline. The sooner > >> such a change is made the better before too many > >> users are stuck with the old spelling. > >> or > >> 2) I keep the Erlang API until the next major release > >> (R13B) because such large changes should not happen > >> in a minor release. > >> or perhaps > >> 3) I never change the Erlang API, just to confuse > >> SCTP users and to be backwards compatible. > >> > >> I really do not believe 3) is a serious alternative. > >> But what do you (the users) want, 1) or 2) ? > >> Or 4) (own suggestion) ? > >> > >> -- > >> > >> / Raimo Niskanen, Erlang/OTP, Ericsson AB > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil From francesco@REDACTED Fri Jan 25 15:50:08 2008 From: francesco@REDACTED (Francesco Cesarini) Date: Fri, 25 Jan 2008 14:50:08 +0000 Subject: [erlang-questions] Trapexit Is Up Message-ID: <4799F720.1080400@erlang-consulting.com> Hi All, a note to say that trapexit.org is now up and running again. Sorry for the interlude, it was a result of us managing and hosting the site but not the domain, who remained in the hands of the founders of the site (with renewal reminders sent to an unused email address). We are now moving the domain over to us to ensure this does not happen. For those of you who have not visited recently, there are new howtos on measuring function execution time http://www.trapexit.org/Measuring_Function_Execution_Time have been added to the dozens of other articles and howtos. On the contributions page http://www.trapexit.org/Special:UserContributions the following projects have been uploaded: * erlangport, an Erlang port coded in python * erltunnel, ap tunnel for TCP connections over http. * neuron, a spiking neuron in Erlang * eresye, an Erlang inference engine * posregex, posix regular expression interface And last but not least, the most popular section of the site, http://planet.trapexit.org which aggregates Erlang related RSS feeds. You can add your own articles and tutorials on the wiki as well as upload contributions just by registering. Have a great weekend, Francesco -- http://www.erlang-consulting.com From raimo+erlang-questions@REDACTED Fri Jan 25 15:52:04 2008 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 25 Jan 2008 15:52:04 +0100 Subject: [erlang-questions] SCTP incompatible change vote In-Reply-To: <20080125080754.GA14072@erix.ericsson.se> References: <20080125080754.GA14072@erix.ericsson.se> Message-ID: <20080125145204.GA27805@erix.ericsson.se> OK then, 1) it will be! On Fri, Jan 25, 2008 at 09:07:54AM +0100, Raimo Niskanen wrote: > Regarding the 'adaption' -> 'adaptation' spelling change > in the lksctp API: > > I will change the inet driver's use of the lksctp API to > cope with both spellings, but what to do with the > gen_sctp API in Erlang? Either: > 1) I change all spellings of 'adaption' to 'adaptation' > in the Erlang API while I am at it, that is in R12B-1, > or in R12B-2 if I do not make the deadline. The sooner > such a change is made the better before too many > users are stuck with the old spelling. > or > 2) I keep the Erlang API until the next major release > (R13B) because such large changes should not happen > in a minor release. > or perhaps > 3) I never change the Erlang API, just to confuse > SCTP users and to be backwards compatible. > > I really do not believe 3) is a serious alternative. > But what do you (the users) want, 1) or 2) ? > Or 4) (own suggestion) ? > > -- > > / 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 eajam@REDACTED Sat Jan 26 02:38:35 2008 From: eajam@REDACTED (alex alvarez) Date: Fri, 25 Jan 2008 20:38:35 -0500 (EST) Subject: [erlang-questions] SCTP incompatible change vote Message-ID: <20080125203835.HM.00000000000007O@eajam.bos-mail-wwl1.lycos.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- Ditto! ...This is the problem with natural languages. Wouldn't you just wish it could be mostly symbols instead?... ---------[ Received Mail Content ]---------- Subject : Re: [erlang-questions] SCTP incompatible change vote Date : Fri, 25 Jan 2008 15:52:04 +0100 >From : Raimo Niskanen To : erlang-questions@REDACTED OK then, 1) it will be! On Fri, Jan 25, 2008 at 09:07:54AM +0100, Raimo Niskanen wrote: > Regarding the 'adaption' -> 'adaptation' spelling change > in the lksctp API: > > I will change the inet driver's use of the lksctp API to > cope with both spellings, but what to do with the > gen_sctp API in Erlang? Either: > 1) I change all spellings of 'adaption' to 'adaptation' > in the Erlang API while I am at it, that is in R12B-1, > or in R12B-2 if I do not make the deadline. The sooner > such a change is made the better before too many > users are stuck with the old spelling. > or > 2) I keep the Erlang API until the next major release > (R13B) because such large changes should not happen > in a minor release. > or perhaps > 3) I never change the Erlang API, just to confuse > SCTP users and to be backwards compatible. > > I really do not believe 3) is a serious alternative. > But what do you (the users) want, 1) or 2) ? > Or 4) (own suggestion) ? > > -- > > / 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 Bruce@REDACTED Sat Jan 26 03:07:13 2008 From: Bruce@REDACTED (Bruce Fitzsimons) Date: Sat, 26 Jan 2008 15:07:13 +1300 Subject: [erlang-questions] SCTP incompatible change vote In-Reply-To: <20080125080754.GA14072@erix.ericsson.se> References: <20080125080754.GA14072@erix.ericsson.se> Message-ID: <479A95D1.9080003@Fitzsimons.org> Raimo Niskanen wrote: > Regarding the 'adaption' -> 'adaptation' spelling change > in the lksctp API: > > I vote for option 1, although can we also have the author of the api change hung, drawn, and quartered? Please? The original spelling wasn't wrong, and the ripple of consequences is more like a tidal wave when cross-version compatibility is taken into account. This inconsistency, rather than the "misspelling", is going to permeate the SCTP world for years to come. Grrr. I may have done similar on codebases under my control once (a real spelling mistake), but I'd never do it again :-( Raimo, thanks for taking the time to clean it up for Erlang. Regards, Bruce From kip.macy@REDACTED Sat Jan 26 03:19:10 2008 From: kip.macy@REDACTED (Kip Macy) Date: Fri, 25 Jan 2008 18:19:10 -0800 Subject: [erlang-questions] SCTP incompatible change vote In-Reply-To: <479A95D1.9080003@Fitzsimons.org> References: <20080125080754.GA14072@erix.ericsson.se> <479A95D1.9080003@Fitzsimons.org> Message-ID: As far as I can tell it was fixed long long ago in the primary SCTP stack used by most other operating systems. Probably before Erlang even had SCTP support. This is only coming up now as a result of Erlang's primary platform being Linux. I wasn't even aware that adpation had ever been used until I tried unsuccessfully to compile Erlang on FreeBSD after Joe's book came out. -Kip On Jan 25, 2008 6:07 PM, Bruce Fitzsimons wrote: > Raimo Niskanen wrote: > > Regarding the 'adaption' -> 'adaptation' spelling change > > in the lksctp API: > > > > > I vote for option 1, although can we also have the author of the api > change hung, drawn, and quartered? Please? > > > The original spelling wasn't wrong, and the ripple of consequences is > more like a tidal wave when cross-version compatibility is taken into > account. This inconsistency, rather than the "misspelling", is going to > permeate the SCTP world for years to come. > > Grrr. I may have done similar on codebases under my control once (a real > spelling mistake), but I'd never do it again :-( > > > Raimo, thanks for taking the time to clean it up for Erlang. > > Regards, > Bruce > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From jeffm@REDACTED Sat Jan 26 03:35:43 2008 From: jeffm@REDACTED (jm) Date: Sat, 26 Jan 2008 13:35:43 +1100 Subject: [erlang-questions] include path Message-ID: <479A9C7F.8090604@ghostgun.com> What's the best way to set the include path to search for hrl files? Jeff. From jeffm@REDACTED Sat Jan 26 03:40:28 2008 From: jeffm@REDACTED (jm) Date: Sat, 26 Jan 2008 13:40:28 +1100 Subject: [erlang-questions] include path In-Reply-To: <479A9C7F.8090604@ghostgun.com> References: <479A9C7F.8090604@ghostgun.com> Message-ID: <479A9D9C.6010607@ghostgun.com> Please ignore. This was meant for the erlyweb list. Second time I've mistyped the address. Damn autocomplete addresses. Jeff. jm wrote: > What's the best way to set the include path to search for hrl files? > From anthony.hw.kong@REDACTED Sat Jan 26 03:57:27 2008 From: anthony.hw.kong@REDACTED (Anthony Kong) Date: Sat, 26 Jan 2008 13:57:27 +1100 Subject: [erlang-questions] newbie: why this code caused function_clause exception? Message-ID: Hi, all, I have written a very simple script: ========================== -module(p2). -export([getfib/1, main/0]). start() -> spawn(fun() -> fib(1, 2) end). fib(N, M) -> receive {Pid, next} -> Pid ! {self(), N + M}, fib(M, N+ M) end. getfib(Pid) -> Pid ! {self(), next}, receive {_, N} -> %% io:format("~p~n", [N]) N end. %%% %%% Program main() %%% main() -> Pid = start(), [X || X <- getfib(Pid)]. %% getfib(Pid). ========================== When I tried to run the p2:main(), I got the following error: 2> p2:main(). =ERROR REPORT==== 26-Jan-2008::13:27:42 === Error in process <0.87.0> with exit value: {function_clause,[{p2,'-main/0-lc$^0/1-0-',[3]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} ** exited: {function_clause,[{p2,'-main/0-lc$^0/1-0-',[3]}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** My questions: 1) Why the list comprehension in the p2:main() caused the function_clause exception? 2) In the stack trace, what does '-main/0-lc$^0/1-0-' mean? I am using $ erl -version Erlang (ASYNC_THREADS) (BEAM) emulator version 5.5.2 on Ubuntu. Cheers, Anthony -- /*--*/ Don't EVER make the mistake that you can design something better than what you get from ruthless massively parallel trial-and-error with a feedback cycle. That's giving your intelligence _much_ too much credit. - Linus Torvalds From mogorman@REDACTED Sat Jan 26 04:18:39 2008 From: mogorman@REDACTED (mog) Date: Fri, 25 Jan 2008 21:18:39 -0600 Subject: [erlang-questions] SCTP incompatible change vote In-Reply-To: References: <20080125080754.GA14072@erix.ericsson.se> <479A95D1.9080003@Fitzsimons.org> Message-ID: <479AA68F.6090309@astjab.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kip Macy wrote: > As far as I can tell it was fixed long long ago in the primary SCTP > stack used by most other operating systems. Probably before Erlang > even had SCTP support. This is only coming up now as a result of > Erlang's primary platform being Linux. I wasn't even aware that > adpation had ever been used until I tried unsuccessfully to compile > Erlang on FreeBSD after Joe's book came out. > > -Kip > > On Jan 25, 2008 6:07 PM, Bruce Fitzsimons wrote: >> Raimo Niskanen wrote: >>> Regarding the 'adaption' -> 'adaptation' spelling change >>> in the lksctp API: >>> >>> >> I vote for option 1, although can we also have the author of the api >> change hung, drawn, and quartered? Please? >> >> >> The original spelling wasn't wrong, and the ripple of consequences is >> more like a tidal wave when cross-version compatibility is taken into >> account. This inconsistency, rather than the "misspelling", is going to >> permeate the SCTP world for years to come. >> >> Grrr. I may have done similar on codebases under my control once (a real >> spelling mistake), but I'd never do it again :-( >> >> >> Raimo, thanks for taking the time to clean it up for Erlang. >> >> Regards, >> Bruce >> >> _______________________________________________ >> 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 The configure script should set sctp to off its under version 1.0.7 i believe Mog -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHmqaPpCttrJGOY6gRAm6UAKCG8bAhMcEQSZN1R7d2yofP5Dz7tgCcDKw3 nde3DbaKNdSwh3fxFmznppA= =DSzP -----END PGP SIGNATURE----- From mihai@REDACTED Sat Jan 26 05:07:46 2008 From: mihai@REDACTED (Mihai Balea) Date: Fri, 25 Jan 2008 23:07:46 -0500 Subject: [erlang-questions] newbie: why this code caused function_clause exception? In-Reply-To: References: Message-ID: On Jan 25, 2008, at 9:57 PM, Anthony Kong wrote: > 1) Why the list comprehension in the p2:main() caused the > function_clause exception? My guess is that your getfib function returns an integer and not a list, which is why your list comprehension fails. You might want to upgrade to R12 (5.6), it has much better (more helpful) error messages. Mihai -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2411 bytes Desc: not available URL: From pablosan@REDACTED Sun Jan 27 03:24:04 2008 From: pablosan@REDACTED (Paul Nelson) Date: Sat, 26 Jan 2008 20:24:04 -0600 Subject: [erlang-questions] clarify: R12B-0 on mac: which libgd for installing percept ? In-Reply-To: References: <3a344bc70712050939x464c4bf6k75346ec3f7ba9cd1@mail.gmail.com> Message-ID: So, my problem is similar... only different: I'm on a Macbook Pro (Intel) running Leopard (10.5.1). I downloaded R12B, downloaded the patch, applied the patch and then tried the following: ./configure --enable-smp-support --enable-darwin-64bit At the end of the run I get the following: ********************************************************************* ********************** APPLICATIONS DISABLED ********************** ********************************************************************* percept : libgd not working ********************************************************************* libgd is installed and seems to be working (after installing, I ran "gdtest test/gdtest.png" and got the expected results). I think I may have two different versions of libgd installed: one in /usr/local/lib and one in /opt/local/lib. I have checked the configure.in file and even changed the order of the paths on the "for dir in" line so that the /opt/local directory is checked first. Nothing seems to make a difference. So, from the error message it seems that it is finding libgd but it is not working as configure expects? Any help is greatly appreciated. -Pablosan On Dec 6, 2007 11:44 AM, Roberto Saccon wrote: > that seems to do the trick, thanks very much > > On 05 Dec 2007 21:38:43 +0100, Bjorn Gustavsson > wrote: > > "Roberto Saccon" writes: > > > > > bringing the discussion back to the list (it happens that people just > > > to reply to the sender): > > > > > > Of course I also tried with --prefix=/opt/local, unfortunately it > > > still doesn't find that libgd > > > > --prefix specifies where you want Erlang/OTP installed; it is not > > used searching for libs. > > > > The configure script has an option specifying where gd is located; > > if gd really is install in /opt/local you could try this option: > > > > --with-gd=/opt/local > > > > (I have not actually tested it; only looked in erts/configure.) > > > > /Bjorn > > > > -- > > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > Roberto Saccon > http://rsaccon.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 rec@REDACTED Sun Jan 27 04:51:27 2008 From: rec@REDACTED (Roger Critchlow) Date: Sat, 26 Jan 2008 20:51:27 -0700 Subject: [erlang-questions] clarify: R12B-0 on mac: which libgd for installing percept ? In-Reply-To: References: <3a344bc70712050939x464c4bf6k75346ec3f7ba9cd1@mail.gmail.com> Message-ID: <66d1c98f0801261951m4b2c3eah88d70b3bd5eccda7@mail.gmail.com> Try supplying --with-gd=PATH specify location of libgd include and lib as an additional option to configure, substituting one or another of your libgd directories for PATH. Running ./configure --help will generally list these kinds of options. -- rec -- 2008/1/26 Paul Nelson : > So, my problem is similar... only different: I'm on a Macbook Pro (Intel) > running Leopard (10.5.1). I downloaded R12B, downloaded the patch, applied > the patch and then tried the following: > > ./configure --enable-smp-support --enable-darwin-64bit > > At the end of the run I get the following: > > ********************************************************************* > ********************** APPLICATIONS DISABLED ********************** > ********************************************************************* > > percept : libgd not working > > ********************************************************************* > > libgd is installed and seems to be working (after installing, I ran "gdtest > test/gdtest.png" and got the expected results). > > I think I may have two different versions of libgd installed: one in > /usr/local/lib and one in /opt/local/lib. > > I have checked the configure.in file and even changed the order of the paths > on the "for dir in" line so that the /opt/local directory is checked first. > Nothing seems to make a difference. > > So, from the error message it seems that it is finding libgd but it is not > working as configure expects? > > Any help is greatly appreciated. > > -Pablosan > > On Dec 6, 2007 11:44 AM, Roberto Saccon wrote: > > > that seems to do the trick, thanks very much > > > > > > > > > > On 05 Dec 2007 21:38:43 +0100, Bjorn Gustavsson > wrote: > > > "Roberto Saccon" writes: > > > > > > > bringing the discussion back to the list (it happens that people just > > > > to reply to the sender): > > > > > > > > Of course I also tried with --prefix=/opt/local, unfortunately it > > > > still doesn't find that libgd > > > > > > --prefix specifies where you want Erlang/OTP installed; it is not > > > used searching for libs. > > > > > > The configure script has an option specifying where gd is located; > > > if gd really is install in /opt/local you could try this option: > > > > > > --with-gd=/opt/local > > > > > > (I have not actually tested it; only looked in erts/configure.) > > > > > > /Bjorn > > > > > > -- > > > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > -- > > > > Roberto Saccon > > http://rsaccon.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 pablosan@REDACTED Sun Jan 27 17:28:20 2008 From: pablosan@REDACTED (Paul Nelson) Date: Sun, 27 Jan 2008 10:28:20 -0600 Subject: [erlang-questions] clarify: R12B-0 on mac: which libgd for installing percept ? In-Reply-To: <66d1c98f0801261951m4b2c3eah88d70b3bd5eccda7@mail.gmail.com> References: <3a344bc70712050939x464c4bf6k75346ec3f7ba9cd1@mail.gmail.com> <66d1c98f0801261951m4b2c3eah88d70b3bd5eccda7@mail.gmail.com> Message-ID: Thank you! The correct path ended up being /opt/local. So --with-gd=/opt/local did the trick. I'm not sure why I didn't see that in the help... Maybe it was due to working late at night when very tired... nah... couldn't be! ;-) On Jan 26, 2008 9:51 PM, Roger Critchlow wrote: > Try supplying > > --with-gd=PATH specify location of libgd include and lib > > as an additional option to configure, substituting one or another of > your libgd directories for PATH. > > Running > > ./configure --help > > will generally list these kinds of options. > > -- rec -- > > 2008/1/26 Paul Nelson : > > So, my problem is similar... only different: I'm on a Macbook Pro > (Intel) > > running Leopard (10.5.1). I downloaded R12B, downloaded the patch, > applied > > the patch and then tried the following: > > > > ./configure --enable-smp-support --enable-darwin-64bit > > > > At the end of the run I get the following: > > > > ********************************************************************* > > ********************** APPLICATIONS DISABLED ********************** > > ********************************************************************* > > > > percept : libgd not working > > > > ********************************************************************* > > > > libgd is installed and seems to be working (after installing, I ran > "gdtest > > test/gdtest.png" and got the expected results). > > > > I think I may have two different versions of libgd installed: one in > > /usr/local/lib and one in /opt/local/lib. > > > > I have checked the configure.in file and even changed the order of the > paths > > on the "for dir in" line so that the /opt/local directory is checked > first. > > Nothing seems to make a difference. > > > > So, from the error message it seems that it is finding libgd but it is > not > > working as configure expects? > > > > Any help is greatly appreciated. > > > > -Pablosan > > > > On Dec 6, 2007 11:44 AM, Roberto Saccon wrote: > > > > > that seems to do the trick, thanks very much > > > > > > > > > > > > > > > On 05 Dec 2007 21:38:43 +0100, Bjorn Gustavsson < > bjorn@REDACTED> > > wrote: > > > > "Roberto Saccon" writes: > > > > > > > > > bringing the discussion back to the list (it happens that people > just > > > > > to reply to the sender): > > > > > > > > > > Of course I also tried with --prefix=/opt/local, unfortunately it > > > > > still doesn't find that libgd > > > > > > > > --prefix specifies where you want Erlang/OTP installed; it is not > > > > used searching for libs. > > > > > > > > The configure script has an option specifying where gd is located; > > > > if gd really is install in /opt/local you could try this option: > > > > > > > > --with-gd=/opt/local > > > > > > > > (I have not actually tested it; only looked in erts/configure.) > > > > > > > > /Bjorn > > > > > > > > -- > > > > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > > > > _______________________________________________ > > > > erlang-questions mailing list > > > > erlang-questions@REDACTED > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > -- > > > > > > Roberto Saccon > > > http://rsaccon.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 rvirding@REDACTED Sun Jan 27 20:07:44 2008 From: rvirding@REDACTED (Robert Virding) Date: Sun, 27 Jan 2008 20:07:44 +0100 Subject: [erlang-questions] newbie: why this code caused function_clause exception? In-Reply-To: References: Message-ID: <3dbc6d1c0801271107xbbb2859ob138f34264eed539@mail.gmail.com> On 26/01/2008, Anthony Kong wrote: > > > When I tried to run the p2:main(), I got the following error: > > 2> p2:main(). > > =ERROR REPORT==== 26-Jan-2008::13:27:42 === > Error in process <0.87.0> with exit value: > > {function_clause,[{p2,'-main/0-lc$^0/1-0-',[3]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > ** exited: {function_clause,[{p2,'-main/0-lc$^0/1-0-',[3]}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > > My questions: > > 1) Why the list comprehension in the p2:main() caused the > function_clause exception? > 2) In the stack trace, what does '-main/0-lc$^0/1-0-' mean? *List* comprehensions work on lists selecting values from a list or lists, you function getfib returns an integer. If you need a function which works by selecting messages from received from a process then you will have to write one yourself. This is the name of an internal function generated by the compiler, in this case the recursive function which "is" the list comprehension. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From ash@REDACTED Sun Jan 27 22:34:14 2008 From: ash@REDACTED (Alex Chateau) Date: Sun, 27 Jan 2008 23:34:14 +0200 Subject: [erlang-questions] Terminal control codes Message-ID: <20080127213414.GF7748@tsi.lv> Seeking for a way to clear terminal for several hours... No success so far... So, could anyone tell ho do I do ^L from erlang program (escript actually)? -- Alex Chateau From hasan.veldstra@REDACTED Mon Jan 28 00:26:10 2008 From: hasan.veldstra@REDACTED (Hasan Veldstra) Date: Sun, 27 Jan 2008 23:26:10 +0000 Subject: [erlang-questions] Terminal control codes In-Reply-To: <20080127213414.GF7748@tsi.lv> References: <20080127213414.GF7748@tsi.lv> Message-ID: <697B9C4E-B3BF-4B20-8E55-E89FA91A5796@gmail.com> This will work on terminals that support ANSI escape sequences: io:format("\e[H\e[J") On Windows, os:cmd("cls") should work. > Seeking for a way to clear terminal for several hours... No success > so far... > So, could anyone tell ho do I do ^L from erlang program (escript > actually)? From anthony.hw.kong@REDACTED Mon Jan 28 13:54:14 2008 From: anthony.hw.kong@REDACTED (Anthony Kong) Date: Mon, 28 Jan 2008 23:54:14 +1100 Subject: [erlang-questions] newbie: how to clear a mailbox of a process? Message-ID: Hi, all, Sorry, I don't think the subject line makes much sense. Hopefully if you read on, the example may speak for itself. I have again written a simple script: ======= -module(p3). -export([isprime/1, test_if_divisible/2]). isprime(2) -> true; isprime(N) when N > 2 -> C = lists:seq(2, N - 1), process_flag(trap_exit, true), lists:map(fun(Div) -> spawn_link(fun() -> test_if_divisible(N, Div) end) end, C), isprime_poll(length(C)). isprime_poll(0) -> true; isprime_poll(NumVote) -> receive {'EXIT', _Pid, nondivisible} -> isprime_poll(NumVote - 1); {'EXIT', _Pid, divisible} -> false end. test_if_divisible(N, Div) -> case N rem Div of 0 -> exit(divisible); _ -> exit(nondivisible) end. ======= The idea of this script are 1) in order to check if a number, says N, is a prime or not, the script will fire a process to test divisibility by each possible divisor (in the range of 2 to N - 1) 2) these processes are 'voting': if all these processes vote that N is not divisible, then N is a prime 3) I want to short circuit the voting process by looking for 'non-divisible' exit message. If I got one, the isprime_poll/1 will abort the tail-recursion and return false So, if I run the following tests, they produces results as expected, *provided* that I do not run them in one go: 2> p3:isprime(6). false ... (abort... then start erl again) ... 2> p3:isprime(7). true If I run like these 2 statements in the same shell, however, then what I got is a wrong answer for 7. 1> l(p3). {module,p3} 2> p3:isprime(6). false 3> p3:isprime(7). false 4> p3:isprime(7). true I believe it is because that while I make isprime_poll/1 return false on first 'nondivisible' message, those remaining messages sent from other processes are still in the mailbox. So if I immedately run isprime(7) after isprime(6), it'll take in these messages from last session and hence make a wrong conclusion. So, here is my questions: 1) Is it possible to force clearance of a process's mailbox? 2) What is the usual 'pattern' for implementation of a voting/committee algorithm? 3) For testing I want to run the script noninteractively using command line e.g. "/opt/erlang/otp-R12B-0/bin/erl -run p3 isprime 7 -s init stop -noshell" but I cannot get it to work. (I am getting badarith exception and core dump. Did I miss some parameters in the command line? 4) If I made some obvious programming mistakes, please feel free to point out Cheers, Anthony -- /*--*/ Don't EVER make the mistake that you can design something better than what you get from ruthless massively parallel trial-and-error with a feedback cycle. That's giving your intelligence _much_ too much credit. - Linus Torvalds From matthias@REDACTED Mon Jan 28 14:17:13 2008 From: matthias@REDACTED (Matthias Lang) Date: Mon, 28 Jan 2008 14:17:13 +0100 Subject: [erlang-questions] newbie: how to clear a mailbox of a process? In-Reply-To: References: Message-ID: <18333.54745.416790.622897@antilipe.corelatus.se> Anthony Kong writes: > Sorry, I don't think the subject line makes much sense. Hopefully if > you read on, the example may speak for itself. It's hard to know which parts of your example are intentionally pointless, so I'll stick to the question in the subject line. I can think of two ways to clear a process' mailbox. Either, you kill the process, or you consume the messages. One way to kill a process is suicide, perhaps preceeded by a message. Matt ---------------------------------------------------------------------- > > I have again written a simple script: > > ======= > > -module(p3). > -export([isprime/1, test_if_divisible/2]). > > isprime(2) -> > true; > > isprime(N) when N > 2 -> > C = lists:seq(2, N - 1), > process_flag(trap_exit, true), > lists:map(fun(Div) -> spawn_link(fun() -> test_if_divisible(N, Div) > end) end, C), > isprime_poll(length(C)). > > > isprime_poll(0) -> > true; > isprime_poll(NumVote) -> > receive > {'EXIT', _Pid, nondivisible} -> > isprime_poll(NumVote - 1); > {'EXIT', _Pid, divisible} -> > false > end. > > > test_if_divisible(N, Div) -> > case N rem Div of > 0 -> exit(divisible); > _ -> exit(nondivisible) > end. > ======= > > The idea of this script are > 1) in order to check if a number, says N, is a prime or not, the > script will fire a process to test divisibility by each possible > divisor (in the range of 2 to N - 1) > 2) these processes are 'voting': if all these processes vote that N is > not divisible, then N is a prime > 3) I want to short circuit the voting process by looking for > 'non-divisible' exit message. If I got one, the isprime_poll/1 will > abort the tail-recursion and return false > > So, if I run the following tests, they produces results as expected, > *provided* that I do not run them in one go: > > 2> p3:isprime(6). > false > ... > (abort... then start erl again) > ... > 2> p3:isprime(7). > true > > > If I run like these 2 statements in the same shell, however, then what > I got is a wrong answer for 7. > > 1> l(p3). > {module,p3} > 2> p3:isprime(6). > false > 3> p3:isprime(7). > false > 4> p3:isprime(7). > true > > I believe it is because that while I make isprime_poll/1 return false > on first 'nondivisible' message, those remaining messages sent from > other processes are still in the mailbox. So if I immedately run > isprime(7) after isprime(6), it'll take in these messages from last > session and hence make a wrong conclusion. > > So, here is my questions: > > 1) Is it possible to force clearance of a process's mailbox? > 2) What is the usual 'pattern' for implementation of a > voting/committee algorithm? > 3) For testing I want to run the script noninteractively using command > line e.g. "/opt/erlang/otp-R12B-0/bin/erl -run p3 isprime 7 -s init > stop -noshell" but I cannot get it to work. (I am getting badarith > exception and core dump. Did I miss some parameters in the command > line? > 4) If I made some obvious programming mistakes, please feel free to point out > > Cheers, > > Anthony > > > > > > -- > /*--*/ > Don't EVER make the mistake that you can design something better than > what you get from ruthless massively parallel trial-and-error with a > feedback cycle. That's giving your intelligence _much_ too much > credit. > > - Linus Torvalds > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bengt.kleberg@REDACTED Mon Jan 28 15:25:26 2008 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 28 Jan 2008 15:25:26 +0100 Subject: [erlang-questions] newbie: how to clear a mailbox of a process? In-Reply-To: References: Message-ID: <1201530326.12589.7.camel@seasc0625.dyn.rnd.as.sw.ericsson.se> Greetings, If you call a module with -run the argument will be a list of the arguments as strings. In your example isprime/1 will be called with a list of the string "7" (["7"]). To make calculations you need to remove the list and turn the string into a number. bengt On Mon, 2008-01-28 at 23:54 +1100, Anthony Kong wrote: > Hi, all, > > Sorry, I don't think the subject line makes much sense. Hopefully if > you read on, the example may speak for itself. > > I have again written a simple script: > > ======= > > -module(p3). > -export([isprime/1, test_if_divisible/2]). > > isprime(2) -> > true; > > isprime(N) when N > 2 -> > C = lists:seq(2, N - 1), > process_flag(trap_exit, true), > lists:map(fun(Div) -> spawn_link(fun() -> test_if_divisible(N, Div) > end) end, C), > isprime_poll(length(C)). > > > isprime_poll(0) -> > true; > isprime_poll(NumVote) -> > receive > {'EXIT', _Pid, nondivisible} -> > isprime_poll(NumVote - 1); > {'EXIT', _Pid, divisible} -> > false > end. > > > test_if_divisible(N, Div) -> > case N rem Div of > 0 -> exit(divisible); > _ -> exit(nondivisible) > end. > ======= > > The idea of this script are > 1) in order to check if a number, says N, is a prime or not, the > script will fire a process to test divisibility by each possible > divisor (in the range of 2 to N - 1) > 2) these processes are 'voting': if all these processes vote that N is > not divisible, then N is a prime > 3) I want to short circuit the voting process by looking for > 'non-divisible' exit message. If I got one, the isprime_poll/1 will > abort the tail-recursion and return false > > So, if I run the following tests, they produces results as expected, > *provided* that I do not run them in one go: > > 2> p3:isprime(6). > false > ... > (abort... then start erl again) > ... > 2> p3:isprime(7). > true > > > If I run like these 2 statements in the same shell, however, then what > I got is a wrong answer for 7. > > 1> l(p3). > {module,p3} > 2> p3:isprime(6). > false > 3> p3:isprime(7). > false > 4> p3:isprime(7). > true > > I believe it is because that while I make isprime_poll/1 return false > on first 'nondivisible' message, those remaining messages sent from > other processes are still in the mailbox. So if I immedately run > isprime(7) after isprime(6), it'll take in these messages from last > session and hence make a wrong conclusion. > > So, here is my questions: > > 1) Is it possible to force clearance of a process's mailbox? > 2) What is the usual 'pattern' for implementation of a > voting/committee algorithm? > 3) For testing I want to run the script noninteractively using command > line e.g. "/opt/erlang/otp-R12B-0/bin/erl -run p3 isprime 7 -s init > stop -noshell" but I cannot get it to work. (I am getting badarith > exception and core dump. Did I miss some parameters in the command > line? > 4) If I made some obvious programming mistakes, please feel free to point out > > Cheers, > > Anthony > > > > > From sebastian.bello@REDACTED Mon Jan 28 16:26:58 2008 From: sebastian.bello@REDACTED (Sebastian Bello) Date: Mon, 28 Jan 2008 13:26:58 -0200 Subject: [erlang-questions] Loading sentences from a file Message-ID: <479DF442.5010202@inswitch.us> Hi all, I apologize if this question has already been aswered: is there a way to load a sentence from a file, from a console (a sort of "Erlang batch file", without compilation)? Regards, Sebastian- From sebastian.bello@REDACTED Mon Jan 28 16:27:46 2008 From: sebastian.bello@REDACTED (Sebastian Bello) Date: Mon, 28 Jan 2008 13:27:46 -0200 Subject: [erlang-questions] Passing parameters to a port driver Message-ID: <479DF472.9010208@inswitch.us> Hi list, is there a way to pass parameters (maybe in the form of an Erlang term) to a port driver while creating it (open_port)? My understanding is that open_port launches the function static ErlDrvData driver_start(ErlDrvPort port, char *buff) on the port; what does "char *buff" contain? Thanks, Sebastian- From adam@REDACTED Mon Jan 28 14:49:49 2008 From: adam@REDACTED (Adam Lindberg) Date: Mon, 28 Jan 2008 14:49:49 +0100 Subject: [erlang-questions] newbie: how to clear a mailbox of a process? In-Reply-To: References: Message-ID: <6344005f0801280549j4fa4ca30w68f2547f74c2d557@mail.gmail.com> Hi, My answers to your questions are: 1) Is it possible to force clearance of a process's mailbox? Well, force is maybe the wrong word, because you do it manually. The way to clear the process mailbox is to run a receive loop which throws away all existing messages: clear_mailbox() -> receive _Any -> clear_mailbox() after 0 -> ok end. 2) What is the usual 'pattern' for implementation of a voting/committee algorithm? I don't know if there's any usual pattern, but I think your approach is fine. What you could do is to spawn one new process which in turn spawn all the voters. This way you can just kill that process once one negative vote has come in so that you don't have to empty the mailbox. 3) For testing I want to run the script noninteractively using command line e.g. "/opt/erlang/otp-R12B-0/bin/erl -run p3 isprime 7 -s init stop -noshell" but I cannot get it to work. (I am getting badarith exception and core dump. Did I miss some parameters in the command line? The number seven provided on the command line is most likely the string "7". You need to provide a function header which can take strings as arguments if you want that to work. For example: isprime(S) when is_list(S) -> isprime(string:to_integer(S)). 4) If I made some obvious programming mistakes, please feel free to point out If you would find a divider before you spawned all the voter processes, they would still continue spawning. It's kind of pointless for large numbers to spawn all the voters even if one of them fail. You should partition your execution so that you can stop as soon as you found a negative. One other thing one can question is the use of exits as messages. The usual way to do it is to spawn a process that sends a message back to its creator. This way, trapping exits and all, you obscure any real errors that could occur. It is better to spawn the processes with the arguments Parent (where Parent is a pid), N and Div and then instead of "exit(...)" do "Parent ! divisible | non_divisible". For example: ... lists:map( fun(Div) -> spawn_link( fun() -> test_if_divisible(self(), N, Div) end) end, C), ... test_if_divisible(Parent, N, Div) -> case N rem Div of 0 -> Parent ! divisible; _ -> Parent ! nondivisible end. Cheers! Adam On Jan 28, 2008 1:54 PM, Anthony Kong wrote: > Hi, all, > > Sorry, I don't think the subject line makes much sense. Hopefully if > you read on, the example may speak for itself. > > I have again written a simple script: > > ======= > > -module(p3). > -export([isprime/1, test_if_divisible/2]). > > isprime(2) -> > true; > > isprime(N) when N > 2 -> > C = lists:seq(2, N - 1), > process_flag(trap_exit, true), > lists:map(fun(Div) -> spawn_link(fun() -> test_if_divisible(N, Div) > end) end, C), > isprime_poll(length(C)). > > > isprime_poll(0) -> > true; > isprime_poll(NumVote) -> > receive > {'EXIT', _Pid, nondivisible} -> > isprime_poll(NumVote - 1); > {'EXIT', _Pid, divisible} -> > false > end. > > > test_if_divisible(N, Div) -> > case N rem Div of > 0 -> exit(divisible); > _ -> exit(nondivisible) > end. > ======= > > The idea of this script are > 1) in order to check if a number, says N, is a prime or not, the > script will fire a process to test divisibility by each possible > divisor (in the range of 2 to N - 1) > 2) these processes are 'voting': if all these processes vote that N is > not divisible, then N is a prime > 3) I want to short circuit the voting process by looking for > 'non-divisible' exit message. If I got one, the isprime_poll/1 will > abort the tail-recursion and return false > > So, if I run the following tests, they produces results as expected, > *provided* that I do not run them in one go: > > 2> p3:isprime(6). > false > ... > (abort... then start erl again) > ... > 2> p3:isprime(7). > true > > > If I run like these 2 statements in the same shell, however, then what > I got is a wrong answer for 7. > > 1> l(p3). > {module,p3} > 2> p3:isprime(6). > false > 3> p3:isprime(7). > false > 4> p3:isprime(7). > true > > I believe it is because that while I make isprime_poll/1 return false > on first 'nondivisible' message, those remaining messages sent from > other processes are still in the mailbox. So if I immedately run > isprime(7) after isprime(6), it'll take in these messages from last > session and hence make a wrong conclusion. > > So, here is my questions: > > 1) Is it possible to force clearance of a process's mailbox? > 2) What is the usual 'pattern' for implementation of a > voting/committee algorithm? > 3) For testing I want to run the script noninteractively using command > line e.g. "/opt/erlang/otp-R12B-0/bin/erl -run p3 isprime 7 -s init > stop -noshell" but I cannot get it to work. (I am getting badarith > exception and core dump. Did I miss some parameters in the command > line? > 4) If I made some obvious programming mistakes, please feel free to point > out > > Cheers, > > Anthony > > > > > > -- > /*--*/ > Don't EVER make the mistake that you can design something better than > what you get from ruthless massively parallel trial-and-error with a > feedback cycle. That's giving your intelligence _much_ too much > credit. > > - Linus Torvalds > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jelee2@REDACTED Mon Jan 28 21:08:19 2008 From: jelee2@REDACTED (Jacob Lee) Date: Mon, 28 Jan 2008 14:08:19 -0600 Subject: [erlang-questions] Concurrency-related optimizations Message-ID: <8e3f205b0801281208s459d7ee2qef297f8c006765e2@mail.gmail.com> Greetings, I am trying to do an undergraduate thesis on concurrency-related optimizations as applied to a practical language. This is under the supervision of Prof. Gul Agha, whose research area is the actor model of computation (his 1986 book "Actors: a model of concurrent computation in distributed systems" is a standard on the subject). So, this semester I have lots of time to devote to trying to make Erlang faster :-). My question for the general Erlang community is: are there any optimizations that have been considered or suggested for Erlang but not yet implemented? My focus is on concurrency-related optimization: e.g., those related to scheduling or message passing. As a start, I've been reading through the HiPE code and the papers published by that team. There are also some general actor optimizations in the literature that have not yet have been applied to Erlang; I'll be looking to see if any of them are compatible with Erlang's semantics. But if anyone has particular ideas that perhaps haven't been tried for lack of time, I am very interested in learning about them. -- Jacob Lee artdent@REDACTED From anthony.hw.kong@REDACTED Mon Jan 28 21:50:29 2008 From: anthony.hw.kong@REDACTED (Anthony Kong) Date: Tue, 29 Jan 2008 07:50:29 +1100 Subject: [erlang-questions] newbie: how to clear a mailbox of a process? In-Reply-To: <1201530326.12589.7.camel@seasc0625.dyn.rnd.as.sw.ericsson.se> References: <1201530326.12589.7.camel@seasc0625.dyn.rnd.as.sw.ericsson.se> Message-ID: Thanks very much for the great answers! Cheers, Anthony From anthony.hw.kong@REDACTED Mon Jan 28 21:51:49 2008 From: anthony.hw.kong@REDACTED (Anthony Kong) Date: Tue, 29 Jan 2008 07:51:49 +1100 Subject: [erlang-questions] newbie: why this code caused function_clause exception? In-Reply-To: <3dbc6d1c0801271107xbbb2859ob138f34264eed539@mail.gmail.com> References: <3dbc6d1c0801271107xbbb2859ob138f34264eed539@mail.gmail.com> Message-ID: Oops, the cause of the problem is so obvious now :-) Thanks very much for the answers Cheers, Anthony From erlang@REDACTED Mon Jan 28 22:16:37 2008 From: erlang@REDACTED (Dominic Williams) Date: Mon, 28 Jan 2008 22:16:37 +0100 Subject: [erlang-questions] Concurrency-related optimizations In-Reply-To: <8e3f205b0801281208s459d7ee2qef297f8c006765e2@mail.gmail.com> References: <8e3f205b0801281208s459d7ee2qef297f8c006765e2@mail.gmail.com> Message-ID: <479E4635.5020707@dominicwilliams.net> Hi Jacob, > So, this semester I have lots of time to devote to trying to make > Erlang faster :-). My question for the general Erlang community is: > are there any optimizations that have been considered or suggested for > Erlang but not yet implemented? My focus is on concurrency-related > optimization: e.g., those related to scheduling or message passing. Great! The first thing to come to my mind is an improvement to the selective receive mechanism that has often been mentioned. See the following posts from the archive for a bit of background: http://www.erlang.org/ml-archive/erlang-questions/200511/msg00154.html http://erlang.org/pipermail/erlang-questions/2006-November/023999.html http://erlang.org/pipermail/erlang-questions/2006-November/023969.html http://erlang.org/pipermail/erlang-questions/2006-November/023979.html Regards, Dominic Williams http://dominicwilliams.net -- From jwebb@REDACTED Tue Jan 29 05:56:53 2008 From: jwebb@REDACTED (jwebb@REDACTED) Date: Tue, 29 Jan 2008 13:56:53 +0900 Subject: [erlang-questions] wxErlang: wxApp behaviour? Message-ID: <6zvdlnbi.1201582613.1420140.jwebb@gol.com> Hi Dan, I finally found some time to take a closer look at wxErlang. And I got thoroughly distracted ;) The attached patch (well, more of a suggestion, really) is a rough cut attempt to implement the wx server as a behaviour. The programmer declares wx_app behaviour and a couple of callback functions e.g.) -module(basic). -behaviour(wx_app). -export([on_init/2, on_event/2,...]). then, in the spirit of wxWidgets, performs widget initialization in the on_init/2 callback on_init(AppContext, AppArgs) -> ..., {ok, State}. and handles unconnected events in the on_event/2 callback on_event(Event,State) -> ..., {ok,NewState}. The application can can be started by calling the wx_app module's start or start_link functions wx_app:start(Mod, Args, Opts) -> {ok,Pid} | {error, Reason} Abstracting out the subsystem start up and event loop plus getting all that OTP goodness [almost] for free might be one way to go. I've only dabbled with the basic.erl example but you can try something like > {ok,Pid} = wx_app:start(basic, [], [{debug,[trace]}]). Anyway, just a thought... Best Regards John -------------- next part -------------- A non-text attachment was scrubbed... Name: wxerlang.patch Type: application/octet-stream Size: 14260 bytes Desc: not available URL: From matthias@REDACTED Tue Jan 29 07:00:00 2008 From: matthias@REDACTED (Matthias Lang) Date: Tue, 29 Jan 2008 07:00:00 +0100 Subject: [erlang-questions] Concurrency-related optimizations In-Reply-To: <8e3f205b0801281208s459d7ee2qef297f8c006765e2@mail.gmail.com> References: <8e3f205b0801281208s459d7ee2qef297f8c006765e2@mail.gmail.com> Message-ID: <18334.49376.755689.230771@antilipe.corelatus.se> You may already have come across this one. It's the only explicitly "concurrency-oriented optimisation in Erlang" paper I can recall: http://www.erlang.se/workshop/2002/Stenman.pdf Matthias ---------------------------------------------------------------------- Jacob Lee writes: > Greetings, > > I am trying to do an undergraduate thesis on concurrency-related > optimizations as applied to a practical language. This is under the > supervision of Prof. Gul Agha, whose research area is the actor model > of computation (his 1986 book "Actors: a model of concurrent > computation in distributed systems" is a standard on the subject). > > So, this semester I have lots of time to devote to trying to make > Erlang faster :-). My question for the general Erlang community is: > are there any optimizations that have been considered or suggested for > Erlang but not yet implemented? My focus is on concurrency-related > optimization: e.g., those related to scheduling or message passing. > > As a start, I've been reading through the HiPE code and the papers > published by that team. There are also some general actor > optimizations in the literature that have not yet have been applied to > Erlang; I'll be looking to see if any of them are compatible with > Erlang's semantics. But if anyone has particular ideas that perhaps > haven't been tried for lack of time, I am very interested in learning > about them. > > -- > Jacob Lee > artdent@REDACTED > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bengt.kleberg@REDACTED Tue Jan 29 08:07:51 2008 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 29 Jan 2008 08:07:51 +0100 Subject: [erlang-questions] Loading sentences from a file In-Reply-To: <479DF442.5010202@inswitch.us> References: <479DF442.5010202@inswitch.us> Message-ID: <1201590471.12589.14.camel@seasc0625.dyn.rnd.as.sw.ericsson.se> Greetings, Your use of the word ''sentence'' makes me slightly confused. So when I suggest that you look at the file module (http://erlang.org/doc/man/file.html) and the function consult/1 it might not be what you want. But please take a look in the documentation and get back if that is not what you need. bengt On Mon, 2008-01-28 at 13:26 -0200, Sebastian Bello wrote: > Hi all, > > I apologize if this question has already been aswered: is there a way to > load a sentence from a file, from a console (a sort of "Erlang batch > file", without compilation)? > Regards, > Sebastian- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From masterofquestions@REDACTED Tue Jan 29 05:37:45 2008 From: masterofquestions@REDACTED (db) Date: Mon, 28 Jan 2008 23:37:45 -0500 Subject: [erlang-questions] Mnesia Erlang OTP Application sharing Schema/tables Message-ID: <1218d6a50801282037j40fbfdees54232fa485300da8@mail.gmail.com> Hello, My scenario is as follows: mnesia is distributed and table fragmented(on nd1, nd2). Now, when application started on ndA 1st and on ndB 2nd. App on ndA,ndB will access same mnesia schema/tables. I create the schema and table when application is started ndA. Now, I start same application on ndB and have it not create the schema/tables. App on ndA, ndB are not distributed but two of the same app running on both nodes (ndA, ndB). e.g similar to two web app instances, on two different machine, connecting to mysql cluster. if app on ndA or ndB crash and then restared, how do I make the Application so that it does not try to recreate the schema/tables. Is there a way to check if schema/tables are there, so you don't do any schema/table recreation? In erlang otp design, you start the 1st app on ndA which creates the schema and table, now you take this same code and run it on ndB. Now app on ndB will try to create the schema/table. How to stop this nonsense? I don't want to cluster app on ndA and ndB together. app on each node reads a slightly different config file, but access the same schema/tables. thanks, russ -------------- next part -------------- An HTML attachment was scrubbed... URL: From avbalu@REDACTED Tue Jan 29 09:16:06 2008 From: avbalu@REDACTED (Balu Balasubramanian) Date: Tue, 29 Jan 2008 08:16:06 +0000 Subject: [erlang-questions] Question on Diagraph module Message-ID: Hi, I am new to Erlang! Can some one explain why I am getting the last error message (badarith) that I get with digraph module in stdlib. Erlang (BEAM) emulator version 5.5.4 [source] [64-bit] [async-threads:0] [kernel -poll:false] Eshell V5.5.4 (abort with ^G) 1> G=digraph:new(). {graph,14,15,16,true} 2> digraph:info(G). [{cyclicity,cyclic},{memory,847},{protection,protected}] 3> digraph:info(). =ERROR REPORT==== 8-Jan-2008::22:02:06 === Error in process with exit value: {undef,[{digraph,info,[]},{erl_eval,d o_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} ** exited: {undef,[{digraph,info,[]}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** % the above error is obvious as digraph:info/0 is udnefined. But now, 4> digraph:info(G). =ERROR REPORT==== 8-Jan-2008::22:02:08 === Error in process with exit value: {badarith,[{digraph,info,1},{erl_eval ,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} ** exited: {badarith,[{digraph,info,1}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** % Can some one please explain the above badarith error? Are there known issues with the digraph module? 5> init:script_id(). {"OTP APN 181 01","R11B"} 6> Thanks Balu _________________________________________________________________ Connect and share in new ways with Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008 From avbalu@REDACTED Tue Jan 29 09:27:47 2008 From: avbalu@REDACTED (Balu Balasubramanian) Date: Tue, 29 Jan 2008 08:27:47 +0000 Subject: [erlang-questions] gregexp module question Message-ID: Hi, I wanto match 0 or multiple instances of any character INCLUDING the new line character \n. 1) I do not like (.|\n)* because it messes up groupings, as i n 51> init:script_id(). {"OTP APN 181 01","R11B"} 52> gregexp:groups(S,"^HTTP\\(.|\n\\)*\\(Server:\\(.*\\)\\)?\r\n"). {match,["h","j","g","\r","\n","g","h","o"," Apache","Server: Apache"]} 53> S. "HTTPhjg\r\nghoServer: Apache\r\n" 54> 2) There seems to be no option to tell the (g)regexp module to modify the meaning of "." to include "\n". 3) stuff like [\s\S]* or [.\n]*do not seem to work. 55> gregexp:groups(S,"^HTTP[\s\S]*\\(Server:\\(.*\\)\\)?\r\n"). nomatch 56> gregexp:groups(S,"^HTTP[.\n]*\\(Server:\\(.*\\)\\)?\r\n"). nomatch 57> May be I am doing something wrong? Is there any other way of doing this ? Thanks for any help. Balu _________________________________________________________________ Shed those extra pounds with MSN and The Biggest Loser! http://biggestloser.msn.com/ From bengt.kleberg@REDACTED Tue Jan 29 09:52:55 2008 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 29 Jan 2008 09:52:55 +0100 Subject: [erlang-questions] Question on Diagraph module In-Reply-To: References: Message-ID: <1201596775.12589.22.camel@seasc0625.dyn.rnd.as.sw.ericsson.se> Greeteings, Presumably you are getting the error because G is gone. I have never used digraphs but the manual page (http://erlang.org/doc/man/digraph.html) says: "The digraph will, however, be deleted if the process that created the digraph terminates." Your shell process, that created G, has just crashed. bengt On Tue, 2008-01-29 at 08:16 +0000, Balu Balasubramanian wrote: > Hi, > > I am new to Erlang! > > Can some one explain why I am getting the last error message (badarith) that I get with digraph module in stdlib. > > Erlang (BEAM) emulator version 5.5.4 [source] [64-bit] [async-threads:0] [kernel -poll:false] > > Eshell V5.5.4 (abort with ^G) > 1> G=digraph:new(). > {graph,14,15,16,true} > 2> digraph:info(G). > [{cyclicity,cyclic},{memory,847},{protection,protected}] > 3> digraph:info(). > > =ERROR REPORT==== 8-Jan-2008::22:02:06 === > Error in process with exit value: {undef,[{digraph,info,[]},{erl_eval,d o_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > ** exited: {undef,[{digraph,info,[]}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > % the above error is obvious as digraph:info/0 is udnefined. But now, > > 4> digraph:info(G). > > =ERROR REPORT==== 8-Jan-2008::22:02:08 === > Error in process with exit value: {badarith,[{digraph,info,1},{erl_eval ,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > ** exited: {badarith,[{digraph,info,1}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > % Can some one please explain the above badarith error? Are there known issues with the digraph module? > > 5> init:script_id(). > {"OTP APN 181 01","R11B"} > 6> > > > Thanks > Balu > > > _________________________________________________________________ > Connect and share in new ways with Windows Live. > http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008 > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From chandrashekhar.mullaparthi@REDACTED Tue Jan 29 10:03:11 2008 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Tue, 29 Jan 2008 09:03:11 +0000 Subject: [erlang-questions] Mnesia Erlang OTP Application sharing Schema/tables In-Reply-To: <1218d6a50801282037j40fbfdees54232fa485300da8@mail.gmail.com> References: <1218d6a50801282037j40fbfdees54232fa485300da8@mail.gmail.com> Message-ID: On 29/01/2008, db wrote: > Hello, > > if app on ndA or ndB crash and then restared, how do I make the Application > so that it does not try to recreate the schema/tables. Is there a way to > check if schema/tables are there, so you don't do any schema/table > recreation? You can use the mnesia:system_info and mnesia:table_info functions to check for existence of tables. Chandru From sh@REDACTED Tue Jan 29 11:33:45 2008 From: sh@REDACTED (=?iso-8859-1?Q?S=F8ren_Hilmer?=) Date: Tue, 29 Jan 2008 11:33:45 +0100 (CET) Subject: [erlang-questions] Question on Diagraph module In-Reply-To: <1201596775.12589.22.camel@seasc0625.dyn.rnd.as.sw.ericsson.se> References: <1201596775.12589.22.camel@seasc0625.dyn.rnd.as.sw.ericsson.se> Message-ID: <16655.193.3.141.124.1201602825.squirrel@www.widetrail.dk> Well I do not think that is the problem Balu is facing. Just tried his example (same result btw). And doing a G. after the badarith, still shows G, and the shell is fine. --S?ren -- S?ren Hilmer, M.Sc., M.Crypt. wideTrail Phone: +45 25481225 Pilev?nget 41 Email: sh@REDACTED DK-8961 Alling?bro Web: www.widetrail.dk On Tue, January 29, 2008 09:52, Bengt Kleberg wrote: > Greeteings, > > Presumably you are getting the error because G is gone. > > I have never used digraphs but the manual page > (http://erlang.org/doc/man/digraph.html) says: > > "The digraph will, however, be deleted if the process that created the > digraph terminates." > > Your shell process, that created G, has just crashed. > > > bengt > > On Tue, 2008-01-29 at 08:16 +0000, Balu Balasubramanian wrote: >> Hi, >> >> I am new to Erlang! >> >> Can some one explain why I am getting the last error message (badarith) >> that I get with digraph module in stdlib. >> >> Erlang (BEAM) emulator version 5.5.4 [source] [64-bit] [async-threads:0] >> [kernel -poll:false] >> >> Eshell V5.5.4 (abort with ^G) >> 1> G=digraph:new(). >> {graph,14,15,16,true} >> 2> digraph:info(G). >> [{cyclicity,cyclic},{memory,847},{protection,protected}] >> 3> digraph:info(). >> >> =ERROR REPORT==== 8-Jan-2008::22:02:06 === >> Error in process with exit value: {undef,[{digraph,info,[]},{erl_eval,d >> o_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} >> >> ** exited: {undef,[{digraph,info,[]}, >> {erl_eval,do_apply,5}, >> {shell,exprs,6}, >> {shell,eval_loop,3}]} ** >> >> % the above error is obvious as digraph:info/0 is udnefined. But now, >> >> 4> digraph:info(G). >> >> =ERROR REPORT==== 8-Jan-2008::22:02:08 === >> Error in process with exit value: {badarith,[{digraph,info,1},{erl_eval >> ,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} >> >> ** exited: {badarith,[{digraph,info,1}, >> {erl_eval,do_apply,5}, >> {shell,exprs,6}, >> {shell,eval_loop,3}]} ** >> >> % Can some one please explain the above badarith error? Are there known >> issues with the digraph module? >> >> 5> init:script_id(). >> {"OTP APN 181 01","R11B"} >> 6> >> >> >> Thanks >> Balu >> >> >> _________________________________________________________________ >> Connect and share in new ways with Windows Live. >> http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008 >> _______________________________________________ >> 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 ulf.wiger@REDACTED Tue Jan 29 11:23:11 2008 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Tue, 29 Jan 2008 11:23:11 +0100 Subject: [erlang-questions] Mnesia Erlang OTP Application sharing Schema/tables In-Reply-To: <1218d6a50801282037j40fbfdees54232fa485300da8@mail.gmail.com> References: <1218d6a50801282037j40fbfdees54232fa485300da8@mail.gmail.com> Message-ID: <479EFE8F.2090406@ericsson.com> My preference is to have an explicit 'install' phase, where the schema and tables are created. The 'builder'(*) tool offers a simple way to do this, in that it creates a start script with the start commands removed for all apps except kernel and stdlib (it then slaps a .load extension on it). This way, you can get all the paths and environment variables set correctly, and then create the schema and tables safely. The main point is that the applications should be able to expect that the tables have been created in advance, and not engage in complex decision-making logic to try to figure out why they're not there. BR, Ulf W (*) This was a tool that I built long ago to test the idea of incrementally building boot scripts for each application, as the system grew. It's in jungerl. db skrev: > Hello, > > My scenario is as follows: > > mnesia is distributed and table fragmented(on nd1, nd2). Now, when > application started on ndA 1st and on ndB 2nd. App on ndA,ndB will > access same mnesia schema/tables. I create the schema and table when > application is started ndA. Now, I start same application on ndB and > have it not create the schema/tables. > > App on ndA, ndB are not distributed but two of the same app running on > both nodes (ndA, ndB). > > e.g similar to two web app instances, on two different machine, > connecting to mysql cluster. > > if app on ndA or ndB crash and then restared, how do I make the > Application so that it does not try to recreate the schema/tables. Is > there a way to check if schema/tables are there, so you don't do any > schema/table recreation? > > In erlang otp design, you start the 1st app on ndA which creates the > schema and table, now you take this same code and run it on ndB. Now > app on ndB will try to create the schema/table. How to stop this nonsense? > > I don't want to cluster app on ndA and ndB together. app on each node > reads a slightly different config file, but access the same schema/tables. > > thanks, > russ > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From vladdu55@REDACTED Tue Jan 29 11:28:44 2008 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 29 Jan 2008 11:28:44 +0100 Subject: [erlang-questions] Question on Diagraph module In-Reply-To: <16655.193.3.141.124.1201602825.squirrel@www.widetrail.dk> References: <1201596775.12589.22.camel@seasc0625.dyn.rnd.as.sw.ericsson.se> <16655.193.3.141.124.1201602825.squirrel@www.widetrail.dk> Message-ID: <95be1d3b0801290228t336b27fbk57c2dd5366788be@mail.gmail.com> Hi, On Jan 29, 2008 11:33 AM, S?ren Hilmer wrote: > Well I do not think that is the problem Balu is facing. Just tried his > example (same result btw). > And doing a G. after the badarith, still shows G, and the shell is fine. G only is a record and the numbers in it (14, 15, 16) are handles to ets tables containing the graph data. These are owned by the shell process and disappear when that process crashes and dies. When calling digraph:info/1 again, it queries the inexistent tables for their size and they return "undefined" instead of a size and there's a badarith exception when trying to add those 'undefined' atoms... A better error message would be very useful in this case, I think. best regards, Vlad From thomasl_erlang@REDACTED Tue Jan 29 11:16:41 2008 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 29 Jan 2008 02:16:41 -0800 (PST) Subject: [erlang-questions] Concurrency-related optimizations In-Reply-To: <8e3f205b0801281208s459d7ee2qef297f8c006765e2@mail.gmail.com> Message-ID: <315563.11395.qm@web38804.mail.mud.yahoo.com> --- Jacob Lee wrote: > My question for the general > Erlang community is: > are there any optimizations that have been > considered or suggested for > Erlang but not yet implemented? My focus is on > concurrency-related > optimization: e.g., those related to scheduling or > message passing. Some input from actors researchers sounds great. Apart from the 'Hippo' paper mentioned before, I seem to remember hearing about some experiments at Ericsson CSlab to schedule the receiver right after the sender when a message was sent. There was no significant performance benefit at that time. (Though I think that was done for the far slower JAM virtual machine.) The hybrid and shared heap VMs reduce message passing costs by avoiding copying. Gains for real apps seem inconclusive so far. As mentioned by another poster, receive statements can perform badly. This has been documented, um, somewhere on this mailing list, I seem to recall. (Sorry.) There hasn't been much published about scheduling. The old-timers usually just shudder and change the subject when anything beyond the existing heuristic scheduler with high/medium/low priorities is mentioned :-) Actually, there seems to be some OTP experimentation behind the scenes (process prio based on message queue length?), but little has been published. While Erlang processes are pretty lightweight, they still are much heavier than the dataflow-style 'actors' we looked at in the 80s and 90s. Maybe something could be done there. Best, Thomas ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From j.bhanot@REDACTED Tue Jan 29 13:13:45 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Tue, 29 Jan 2008 17:43:45 +0530 Subject: [erlang-questions] running sample progs for MGC and MG In-Reply-To: Message-ID: Hi Maxim, I am now trying to run it from local machine having no xterm server using this command erl -pa ../../../megaco/ebin -s megaco megaco application is up without any errors but when on erl shell when i try to execute sample script megaco_simple_mgc.erl using follwoing command : megaco_simple_mgc:start(). I get the following errors: {ok,[{{error, {megaco_tcp_listen, {could_not_start_listener,{gen_tcp_listen,eaddrinuse}}}}, 2944, {megaco_receive_handle, {deviceName,"controller"}, megaco_pretty_text_encoder,[],megaco_tcp,dynamic}}, {ok,2944, {megaco_receive_handle, {deviceName,"controller"}, megaco_pretty_text_encoder,[],megaco_udp,dynamic}}, {{error, {megaco_tcp_listen, {could_not_start_listener,{gen_tcp_listen,eaddrinuse}}}}, 2945, {megaco_receive_handle, {deviceName,"controller"}, megaco_binary_encoder,[],megaco_tcp,dynamic}}, {ok,2945, {megaco_receive_handle, {deviceName,"controller"}, megaco_binary_encoder,[],megaco_udp,dynamic}}]} any ideas on that.. Regards, jb "Maxim Treskin" 01/24/2008 03:50 PM To "J Bhanot" cc erlang-questions@REDACTED, megaco@REDACTED Subject Re: [erlang-questions] running sample progs for MGC and MG On 24/01/2008, J Bhanot wrote: Hi All, I built the stack doing following in FC 8 : ./configure --disable -sctp make all make install Now i want to test MGC and MG running examples at follwoing location /home/j.bhanot/Download/H.248/otp_src_R12B-0/lib/megaco/examples/simple i tried to execute megaco_simple_mgc.erl following these commands: erl -pa ../../../megaco/ebin -s megaco_filter -s megaco %% megaco_simple_mgc:start(). but getting the error : 1> Application initialization failed: no display name and no $DISPLAY environment variable Error in startup script: no display name and no $DISPLAY environment variable Question1 : what should the value with which env value DISPLAY be set DISPLAY is environment variable, which contains address and display number of your X server. Megaco sample progs have some GUI to trace megaco messages. It seems that you ran stack not in X environment, or under another user. Question2: these sample applications are made in erlang...is it possible to use c/c++ or some other language to use APIs/Functionalities of Megaco stack There is erl_interface library to interact between erlang node and C/C++ applications, but it is necessary to run one erlang node for this. --- Maxim 'Zert' Treskin ForwardSourceID:NT0000DC1E =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From zerthurd@REDACTED Tue Jan 29 13:20:23 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Tue, 29 Jan 2008 18:20:23 +0600 Subject: [erlang-questions] running sample progs for MGC and MG In-Reply-To: References: Message-ID: It seems you have another running mgc on this machine. Run 'ps aux' and kill unused erlang nodes. -- Maxim Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastian.bello@REDACTED Tue Jan 29 14:15:13 2008 From: sebastian.bello@REDACTED (Sebastian Bello) Date: Tue, 29 Jan 2008 11:15:13 -0200 Subject: [erlang-questions] Loading sentences from a file In-Reply-To: <1201590471.12589.14.camel@seasc0625.dyn.rnd.as.sw.ericsson.se> References: <479DF442.5010202@inswitch.us> <1201590471.12589.14.camel@seasc0625.dyn.rnd.as.sw.ericsson.se> Message-ID: <479F26E1.5040000@inswitch.us> Bengt, yes, that's what I was looking for (maybe I should have said "term" instead of "sentence"); more precisely, file:script. Thanks, Sebastian- Bengt Kleberg escribi?: > Greetings, > > Your use of the word ''sentence'' makes me slightly confused. So when I > suggest that you look at the file module > (http://erlang.org/doc/man/file.html) and the function consult/1 it > might not be what you want. But please take a look in the documentation > and get back if that is not what you need. > > > bengt > On Mon, 2008-01-28 at 13:26 -0200, Sebastian Bello wrote: > >> Hi all, >> >> I apologize if this question has already been aswered: is there a way to >> load a sentence from a file, from a console (a sort of "Erlang batch >> file", without compilation)? >> Regards, >> Sebastian- >> _______________________________________________ >> 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 > > __________ NOD32 2830 (20080129) Information __________ > > This message was checked by NOD32 antivirus system. > http://www.eset.com > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.bhanot@REDACTED Tue Jan 29 16:06:04 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Tue, 29 Jan 2008 20:36:04 +0530 Subject: [erlang-questions] Problems with Erlang C interface Message-ID: Hi, I was just trying to connect to already running erlang node via C program and while going through the documentation of erl_interface, came across following lines When linking, you will need to specify the path to liberl interface.a and libei.a with -L$OTPROOT/lib/erl interface-3.2.3/lib, and you will need to specify the name of the libraries with -lerl interface -lei. You can do this on the command line or by adding the flags to the LDFLAGS definition in your Makefile. $ ld -L/usr/local/otp/lib/erl_interface-3.2.3/ lib myprog.o -lerl_interface -lei -o myprog I have following path : /home/j.bhanot/Download/H.248/otp_src_R12B-0/lib/erl_interface even if I substitute erl_interface-3.2.3 with erl_interface - I don't get any lib folder after that and not able to find libraries lerl_interface and lei.. is there something wrong that i am doing. Regards, jb ____________________________________________ =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.bhanot@REDACTED Tue Jan 29 16:14:15 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Tue, 29 Jan 2008 20:44:15 +0530 Subject: [erlang-questions] Problems with Erlang C interface In-Reply-To: Message-ID: Hi, just came across that erl_interface library is specfic to OTP release... I am using otp_src_R12B-0...where can i find erl_interface library for this release of OTP. Thanks, jb =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.bhanot@REDACTED Tue Jan 29 16:15:19 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Tue, 29 Jan 2008 20:45:19 +0530 Subject: [erlang-questions] Problems with Erlang C interface In-Reply-To: Message-ID: apologies ..i meant erl_interface library guide/manuals/refernces Thanks, jb J Bhanot/DEL/TCS 01/29/2008 08:44 PM To J Bhanot/DEL/TCS@REDACTED cc erlang-questions@REDACTED, megaco@REDACTED Subject Re: Problems with Erlang C interface Hi, just came across that erl_interface library is specfic to OTP release... I am using otp_src_R12B-0...where can i find erl_interface library for this release of OTP. Thanks, jb ForwardSourceID:NT0000DF76 =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From jbamsterdam@REDACTED Tue Jan 29 19:16:53 2008 From: jbamsterdam@REDACTED (Jonathan Amsterdam) Date: Tue, 29 Jan 2008 13:16:53 -0500 Subject: [erlang-questions] effect of destructive updates on GC implementation Message-ID: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> I read a lot on this list and elsewhere about how destructive updates would complicate Erlang's garbage collector. I want to argue that if you have controlled destructive updates, the added GC complexity is small. My larger goal is to understand the issues involved in introducing destructive updates into Erlang in a harmonious way. (As opposed to something like ets tables, which have a number of limitations and quirks that seem to follow from the difficulty of integrating them with the GC.) I'll proceed from a basic starting point, to flush out any bugs in my understanding and to bring newbies up to speed. In a generational GC like Erlang's, you have (at least) two generations of objects, young and old. Since most garbage is young, you speed up GC by collecting only the young generation. Only when that fails to give you enough space do you need to do a full GC of young and old. The crucial observation that allows you to examine only the young generation when collecting it is that there are no pointers from old objects to young. Thus you need not fear that a young object, seemingly garbage from your examination of all and only the young objects, is in fact referenced by some old object. A purely functional language guarantees this no-old-to-young property, because (a) it is a fact of logic that a newly created object can only contain pointers to objects older than itself, and (b) you can't update, so you can't change that invariant. My understanding is that though Erlang is not purely functional, it is from the point of view of its GC, because destructive updates (to ets tables and process dictionaries) occur outside of the GCable heap. It is possible to modify a generational GC to handle updates, by doing two things. First, you must examine all updates to see if they introduce an old-to-young pointer. This is called a *write barrier*. Second, you must keep track of all old-to-young pointers, so you can add them to your root set when GCing the young generation. In general, the first of these is by far the more difficult, because you must efficiently examine every destructive pointer update to determine if it introduces an old-to-young relationship. But write barriers are only difficult because they have to be very efficient, and that is because standard imperative languages have many updates. If there were relatively few updates, there would be no need for a complex write barrier. For instance, consider a feature like ML references. A reference is a single updatable memory cell, with its own special update operation. If the update operation compiles into its own VM instruction, then the write barrier is just a simple check in the implementation of that instruction. Since references are cumbersome, the language encourages a purely functional style; destructive updates are clearly marked syntactically, so they are ugly and hence rare. By making an updatable cell its own object (by which I just mean data structure), we simplify the second required GC modification, keeping track of the old-to-new pointers. A simple implementation can doubly link the old-to-new cells, enabling quick scanning for GC and constant-time removal from the list when the cell itself becomes garbage. (Of course, more space-efficient implementations are possible.) I neglected to mention one other thing you need, a quick way to tell the generation of an object. In a copying GC, you can dedicate each heap page to a generation, and either keep bits on the page or have a map from page addresses to generations. The high-order bits of an object's address give you its page. I haven't looked at the code for the Erlang GC, so I don't know how amenable it is to these changes. I just wanted to dispel some of the fear I imagine I hear when people intone "write barrier." Or maybe I am missing something, in which case I would appreciate being educated. From chsu79@REDACTED Tue Jan 29 21:16:42 2008 From: chsu79@REDACTED (Christian S) Date: Tue, 29 Jan 2008 21:16:42 +0100 Subject: [erlang-questions] effect of destructive updates on GC implementation In-Reply-To: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> References: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> Message-ID: Did you see the set of destructive-updatable "containers" in hipe? They're limited to immediate values, but for the situations where a destructively updateable array makes a huge difference in performance over the standard functional approach, the limitation is typically not a problem. On Jan 29, 2008 7:16 PM, Jonathan Amsterdam wrote: > I read a lot on this list and elsewhere about how destructive updates From mikpe@REDACTED Tue Jan 29 22:21:01 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 29 Jan 2008 22:21:01 +0100 Subject: [erlang-questions] effect of destructive updates on GC implementation In-Reply-To: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> References: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> Message-ID: <18335.39101.66579.372519@alkaid.it.uu.se> Jonathan Amsterdam writes: ... [GC 101 omitted] ... > I haven't looked at the code for the Erlang GC, so I don't know how > amenable it is to these changes. I just wanted to dispel some of the > fear I imagine I hear when people intone "write barrier." Or maybe I > am missing something, in which case I would appreciate being educated. The core Erlang developers are well aware of the techniques needed to support destructive updates in GC:d heaps. There are however several other issues to consider: 1. Adding write-barriers/remembered-sets or their equivalent to the GC would complicate an already complicated and delicate part of the runtime system, which is not always a win if you're aiming for five-nines robustness. The runtime cost of the write-barrier is a non-issue, since writes can be expected to be rare. Erlang is not Java, thankfully. 2. As soon as destructive updates are supported, people will use them. From what I've heard from Ericsson folks, the lack of destructive updates is actually a positive thing for them, presumably due to program reliability and programmer productivity. 3. The combination of message passing and mutable data breaks the semantics of Erlang, or that of mutable data, and limits the choices the Erlang implementors can make. Suppose P1 sends a term T to P2. P2 inspects it. Later, P1 updates some part of T. Should P2 observe that change? - if yes, the semantics of Erlang is now fundamentally altered, - if no, the semantics of mutable data is severely restricted. Furthermore, each choice creates new hard constraints on how the runtime system may implement process heaps and message passing. So the real question is not whether adding updateable terms to Erlang is possible (several people could do it, myself included), but whether it's desirable. And on the whole, I think Erlang is better off without them. From per@REDACTED Tue Jan 29 22:40:10 2008 From: per@REDACTED (Per Hedeland) Date: Tue, 29 Jan 2008 22:40:10 +0100 (CET) Subject: [erlang-questions] Passing parameters to a port driver In-Reply-To: <479DF472.9010208@inswitch.us> Message-ID: <200801292140.m0TLeAd0025665@pluto.hedeland.org> Sebastian Bello wrote: > >is there a way to pass parameters (maybe in the form of an Erlang term) >to a port driver while creating it (open_port)? My understanding is that >open_port launches the function > static ErlDrvData driver_start(ErlDrvPort port, char *buff) > >on the port; what does "char *buff" contain? It's the complete Command string from open_port({spawn, Command}, ...) - i.e. you can give that as "my_drv param1 param2" and the my_drv driver will have its start() function invoked with that exact string as its second argument (in C form of course:-). If you look at the driver_entry(3) man page, the argument is called 'command', which perhaps makes this a bit more obvious. --Per Hedeland From ulf.wiger@REDACTED Tue Jan 29 22:41:59 2008 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Tue, 29 Jan 2008 22:41:59 +0100 Subject: [erlang-questions] effect of destructive updates on GC implementation In-Reply-To: <18335.39101.66579.372519@alkaid.it.uu.se> References: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> <18335.39101.66579.372519@alkaid.it.uu.se> Message-ID: <479F9DA7.1090108@ericsson.com> Mikael Pettersson skrev: > The runtime cost of the write-barrier is a non-issue, > since writes can be expected to be rare. Erlang is not > Java, thankfully. Well, rare overall, but isn't it reasonable to assume that, in the places where destructive updates are used, they might used with high frequency and high demands on performance? > 2. As soon as destructive updates are supported, people > will use them. From what I've heard from Ericsson folks, > the lack of destructive updates is actually a positive > thing for them, presumably due to program reliability and > programmer productivity. Yes. I would much rather see a development where higher-order constructs can be optimized to either use destructive updates under the covers, or even transformations like e.g. removing unnecessary reverse() calls, or whatever. (*) The latest improvements in bit syntax are exactly the kind of optimizations that I like the best - making the most preferred style of programming also be the most efficient! BR, Ulf W (*) Just an example. I don't know if that particular optimization would give very much. From vychodil.hynek@REDACTED Tue Jan 29 22:42:19 2008 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 29 Jan 2008 22:42:19 +0100 Subject: [erlang-questions] effect of destructive updates on GC implementation In-Reply-To: <18335.39101.66579.372519@alkaid.it.uu.se> References: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> <18335.39101.66579.372519@alkaid.it.uu.se> Message-ID: <4d08db370801291342m65e5578dyc5790d4574f28e0c@mail.gmail.com> On Jan 29, 2008 10:21 PM, Mikael Pettersson wrote: > Jonathan Amsterdam writes: > ... > [GC 101 omitted] > ... > > I haven't looked at the code for the Erlang GC, so I don't know how > > amenable it is to these changes. I just wanted to dispel some of the > > fear I imagine I hear when people intone "write barrier." Or maybe I > > am missing something, in which case I would appreciate being educated. > > The core Erlang developers are well aware of the techniques > needed to support destructive updates in GC:d heaps. > There are however several other issues to consider: > 1. Adding write-barriers/remembered-sets or their equivalent > to the GC would complicate an already complicated and > delicate part of the runtime system, which is not always > a win if you're aiming for five-nines robustness. > The runtime cost of the write-barrier is a non-issue, > since writes can be expected to be rare. Erlang is not > Java, thankfully. > 2. As soon as destructive updates are supported, people > will use them. From what I've heard from Ericsson folks, > the lack of destructive updates is actually a positive > thing for them, presumably due to program reliability and > programmer productivity. > 3. The combination of message passing and mutable data breaks > the semantics of Erlang, or that of mutable data, and limits > the choices the Erlang implementors can make. Suppose P1 > sends a term T to P2. P2 inspects it. Later, P1 updates > some part of T. Should P2 observe that change? > - if yes, the semantics of Erlang is now fundamentally altered, > - if no, the semantics of mutable data is severely restricted. > Furthermore, each choice creates new hard constraints on how > the runtime system may implement process heaps and message > passing. > > So the real question is not whether adding updateable terms to > Erlang is possible (several people could do it, myself included), > but whether it's desirable. And on the whole, I think Erlang is > better off without them. > +1 robustness, reliability, programmer productivity - It is why I like Erlang without destructive updates. Performance is on second place. -- --Hynek (Pichi) Vychodil -------------- next part -------------- An HTML attachment was scrubbed... URL: From jbamsterdam@REDACTED Tue Jan 29 23:02:44 2008 From: jbamsterdam@REDACTED (Jonathan Amsterdam) Date: Tue, 29 Jan 2008 17:02:44 -0500 Subject: [erlang-questions] effect of destructive updates on GC implementation In-Reply-To: <18335.39101.66579.372519@alkaid.it.uu.se> References: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> <18335.39101.66579.372519@alkaid.it.uu.se> Message-ID: <31c6fe8f0801291402hec65c5cob670e39a845039a2@mail.gmail.com> > The core Erlang developers are well aware of the techniques > needed to support destructive updates in GC:d heaps. Apologies if my tone came across as patronizing. I just wanted to explain my position without assuming anything. > 2. As soon as destructive updates are supported, people > will use them. From what I've heard from Ericsson folks, > the lack of destructive updates is actually a positive > thing for them, presumably due to program reliability and > programmer productivity. This is something I've wondered about. Are there any production-quality, scalable programs that do not use mnesia, d/ets tables or process dictionaries? That would be cool, but it seems to me that when you're dealing with huge amounts of real-world data that can change, the copying involved in purely functional data structures would kill you. > 3. The combination of message passing and mutable data breaks > the semantics of Erlang, or that of mutable data, and limits > the choices the Erlang implementors can make. Suppose P1 > sends a term T to P2. P2 inspects it. Later, P1 updates > some part of T. Should P2 observe that change? > - if yes, the semantics of Erlang is now fundamentally altered, > - if no, the semantics of mutable data is severely restricted. > Furthermore, each choice creates new hard constraints on how > the runtime system may implement process heaps and message > passing. > This is the most compelling reason, for me. From jbamsterdam@REDACTED Tue Jan 29 23:11:09 2008 From: jbamsterdam@REDACTED (Jonathan Amsterdam) Date: Tue, 29 Jan 2008 17:11:09 -0500 Subject: [erlang-questions] effect of destructive updates on GC implementation In-Reply-To: <479F9DA7.1090108@ericsson.com> References: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> <18335.39101.66579.372519@alkaid.it.uu.se> <479F9DA7.1090108@ericsson.com> Message-ID: <31c6fe8f0801291411w3bdf6cfo31c5b9eb1cafc975@mail.gmail.com> > Yes. I would much rather see a development where higher-order > constructs can be optimized to either use destructive updates > under the covers, or even transformations like e.g. removing > unnecessary reverse() calls, or whatever. (*) How about promises with memoization? That is, a no-argument fun whose result is cached the first time it is called. This would let you implement lazy lists, and get the performance bounds of the Okasaki data structures. E.g. queues with worst-case (not amortized) O(1) behavior. From mihai@REDACTED Wed Jan 30 00:14:57 2008 From: mihai@REDACTED (Mihai Balea) Date: Tue, 29 Jan 2008 18:14:57 -0500 Subject: [erlang-questions] effect of destructive updates on GC implementation In-Reply-To: <31c6fe8f0801291411w3bdf6cfo31c5b9eb1cafc975@mail.gmail.com> References: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> <18335.39101.66579.372519@alkaid.it.uu.se> <479F9DA7.1090108@ericsson.com> <31c6fe8f0801291411w3bdf6cfo31c5b9eb1cafc975@mail.gmail.com> Message-ID: <9B7FD4AA-825C-4A12-8501-E9C50628B78F@hates.ms> On Jan 29, 2008, at 5:11 PM, Jonathan Amsterdam wrote: > How about promises with memoization? That is, a no-argument fun whose > result is cached the first time it is called. This would let you > implement lazy lists, and get the performance bounds of the Okasaki > data structures. E.g. queues with worst-case (not amortized) O(1) > behavior. That wouldn't work with funs that have side effects, such as I/O. Maybe the compiler/VM would be able to recognize a fun that has side effects and avoid this optimization... Or maybe I'm missing something? Mihai -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2411 bytes Desc: not available URL: From jbamsterdam@REDACTED Wed Jan 30 01:20:14 2008 From: jbamsterdam@REDACTED (Jonathan Amsterdam) Date: Tue, 29 Jan 2008 19:20:14 -0500 Subject: [erlang-questions] effect of destructive updates on GC implementation In-Reply-To: <9B7FD4AA-825C-4A12-8501-E9C50628B78F@hates.ms> References: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> <18335.39101.66579.372519@alkaid.it.uu.se> <479F9DA7.1090108@ericsson.com> <31c6fe8f0801291411w3bdf6cfo31c5b9eb1cafc975@mail.gmail.com> <9B7FD4AA-825C-4A12-8501-E9C50628B78F@hates.ms> Message-ID: <31c6fe8f0801291620l2868f54fuae712804f18f0766@mail.gmail.com> I'm not suggesting that all funs be so optimized. There would be a specific syntax, and you have to understand the semantics and know what you're doing. 2008/1/29 Mihai Balea : > > On Jan 29, 2008, at 5:11 PM, Jonathan Amsterdam wrote: > > How about promises with memoization? That is, a no-argument fun whose > > result is cached the first time it is called. This would let you > > implement lazy lists, and get the performance bounds of the Okasaki > > data structures. E.g. queues with worst-case (not amortized) O(1) > > behavior. > > That wouldn't work with funs that have side effects, such as I/O. > Maybe the compiler/VM would be able to recognize a fun that has side > effects and avoid this optimization... > Or maybe I'm missing something? > > Mihai > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From dizzyd@REDACTED Wed Jan 30 02:50:10 2008 From: dizzyd@REDACTED (Dave Smith) Date: Tue, 29 Jan 2008 18:50:10 -0700 Subject: [erlang-questions] effect of destructive updates on GC implementation In-Reply-To: <4d08db370801291342m65e5578dyc5790d4574f28e0c@mail.gmail.com> References: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> <18335.39101.66579.372519@alkaid.it.uu.se> <4d08db370801291342m65e5578dyc5790d4574f28e0c@mail.gmail.com> Message-ID: 2008/1/29 Hynek Vychodil : > +1 > robustness, reliability, programmer productivity - It is why I like Erlang > without destructive updates. Performance is on second place. +1 as well on no destructive updates. I'm just a newbie (relative to others on the forum) when it comes to building large systems with Erlang, but I've written enough production code to be pleased with the stability that comes from not inadvertently updating something on one process that was generated elsewhere. In my humble (and perhaps naive) opinion, what would changing this foundational property of Erlang buy us? Are there real world problems where Erlang is too slow AND this is the only way to fix it? I'm with Ulf -- the best performance enhancements are those that make a preferred (or desired) way of working faster -- the new bit syntax has been amazing in that regard. I've yet to encounter a programming problem in Erlang where I _wanted_ to edit a value in place. Put another way -- if it ain't broke, don't fix it... D. From nm@REDACTED Wed Jan 30 02:43:29 2008 From: nm@REDACTED (Gaspar Chilingarov) Date: Wed, 30 Jan 2008 05:43:29 +0400 Subject: [erlang-questions] [BUG] hidden, totally undocumented bug :) in ssl module -- ssl:accept/1 Message-ID: <479FD641.7070406@web.am> Hi there ! Some time ago I've reported on the list some problems with ssl module. This was related to accepting incoming ssl connections and handling them. We have software, which runs on FreeBSD 6.x OS and which deals with ssl connections -- accepting connections from clients, checking client certificates and allowing or denying access depending on certificate check. We had seen a large number of connections stuck in CLOSE_WAIT state. After some investigation it turned out that client initiates tcp connection, then sends some part of it's certificate to the server (70 bytes payload) and we see connection in ESTABLISHED state Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp4 70 0 1.1.1.1.443 2.2.2.1.12345 ESTABLISHED We have some data waiting to be received on the socket. At that moment applications is blocked in ssl:accept(Socket) call. Then we will see more data coming from client to the socket, say Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp4 102 0 1.1.1.1.443 2.2.2.1.12345 ESTABLISHED But without any luck -- connection does not accepted and no client socket are created for it. After some timeout client disconnects and we get CLOSED_WAIT socket state. Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp4 102 0 1.1.1.1.443 2.2.2.1.12345 CLOSE_WAIT In this state it can hand around forever, until the erlang emulator will be restarted. One of the causes is that connecting clients sometimes have huge rtt time and huge packet loss, which makes impossible to data over tcp. In same time I've observed interesting fact, that yaws server embedded in same application and running with exactly same config (certificates, validation level, timeouts) worked without any problem and we had never seen any stuck connections on its SSL port. After tracing ALL calls to ssl module I've found that the single difference between us and yaws was the connection accepting logic. In our part of application we have called ssl:accept(Socket) and waited forever for incoming ssl connection as opposed to yaws, which called ssl:accept(Socket, 10000). If there was no incoming connection in 10 seconds, ssl:accept will timeout and then yaws just calls ssl:accept/2 again. After adding some dirty hack to your listen/accept scheme the issue was solved completely. Now it accepts or drops connections from remote clients nicely. All stuck connections go from ESTABLISHED to FIN_WAIT_1 state as expected and are closed by OS after some timeout. Conclusion: There is a housekeeping work, which does ssl module inside ssl:accept call before actually accepting connections (especially related to cleaning up old tcp connections, which are dropped from client side). If you use just ssl:accept with infinity timeout this cleaning up never occurs, thus filling connection table with CLOSE_WAIT sockets. This bug exists at least from 10b9 release and it's not ever documented or somehow fixed all that time. (It exists in 12r0 release, which I've tested a few days before). We had a long time fighting this issue and finally found the source of that bug :) So I'm kindly begging erlang team to put a few words into the documentation or fix it -- which is easier to do :) With best regards, Gaspar -- Gaspar Chilingarov System Administrator, Network security consulting t +37493 419763 (mob) i 63174784 e nm@REDACTED w http://gasparchilingarov.com/ From jelee2@REDACTED Wed Jan 30 08:04:07 2008 From: jelee2@REDACTED (Jacob Lee) Date: Wed, 30 Jan 2008 01:04:07 -0600 Subject: [erlang-questions] Concurrency-related optimizations In-Reply-To: <315563.11395.qm@web38804.mail.mud.yahoo.com> References: <8e3f205b0801281208s459d7ee2qef297f8c006765e2@mail.gmail.com> <315563.11395.qm@web38804.mail.mud.yahoo.com> Message-ID: <8e3f205b0801292304m4eba2547r243c3a4b16224d95@mail.gmail.com> On Tue, Jan 29, 2008 at 4:16 AM, Thomas Lindgren wrote: > > --- Jacob Lee wrote: > > > My question for the general > > Erlang community is: > > are there any optimizations that have been > > considered or suggested for > > Erlang but not yet implemented? My focus is on > > concurrency-related > > optimization: e.g., those related to scheduling or > > message passing. > > Some input from actors researchers sounds great. > > Apart from the 'Hippo' paper mentioned before, I seem > to remember hearing about some experiments at Ericsson > CSlab to schedule the receiver right after the sender > when a message was sent. There was no significant > performance benefit at that time. (Though I think that > was done for the far slower JAM virtual machine.) > Chapter 6 from "Efficient Implementation of Concurrent Programming Languages" - http://citeseer.ist.psu.edu/705309.html - contains information from the Hippo project and also talks about rescheduling send. It seems to only have benchmarks for all of HiPE, though, not specific optimizations. > The hybrid and shared heap VMs reduce message passing > costs by avoiding copying. Gains for real apps seem > inconclusive so far. > > As mentioned by another poster, receive statements can > perform badly. This has been documented, um, somewhere > on this mailing list, I seem to recall. (Sorry.) > > There hasn't been much published about scheduling. The > old-timers usually just shudder and change the subject > when anything beyond the existing heuristic scheduler > with high/medium/low priorities is mentioned :-) > Actually, there seems to be some OTP experimentation > behind the scenes (process prio based on message queue > length?), but little has been published. > That would indeed be interesting to look at. The challenge is that any alternate implementations must be as fair as the current scheduler -- or at least fair enough to avoid priority inversion, starvation, etc. (I'm not sure if Erlang has any requirements here more formal than "every process must get scheduled eventually" and "existing programs should not break"). It might tie in to fiddling with the message queue, as well. > While Erlang processes are pretty lightweight, they > still are much heavier than the dataflow-style > 'actors' we looked at in the 80s and 90s. Maybe > something could be done there. > > Best, > Thomas > It's an interesting comparison to make. One theoretical idea from the actor model is to have "actors all the way down", though in the real world this is obviously curtailed (e.g. using actual integers instead of actors that reply with a constant... etc.). Many common patterns in this model involve spawning anonymous actors all over the place to maximize concurrency. For example, there's a join continuation transformation -- http://osl.cs.uiuc.edu/docs/hpc96/hipc-kim.pdf -- that allows RPC to be written in the intuitive manner (as if it were a blocking call) but allows computations not dependent on the result of the RPC to continue in parallel. The constraint in doing all this in Erlang is that this type of transformation might break the original program in subtle ways. Thanks for the suggestions! -- Jacob Lee artdent@REDACTED From j.bhanot@REDACTED Wed Jan 30 07:01:47 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Wed, 30 Jan 2008 11:31:47 +0530 Subject: [erlang-questions] Problems with C Erlang interface Message-ID: Hi, I created a C file test.c {code} #include "erl_interface.h" #include "ei.h" #include main() { int i=2; erl_init(NULL,0); } {/code} Compiled it as follows : cc -c -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include test.c No errors in compiling Tried to link it as follows: ld -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib test.o -lerl_interface -lei -o test but during liking, I got tons of errrs Sample error : =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2008.01.30 11:29:02 =~=~=~=~=~=~=~=~=~=~=~= ld -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib test.o -lerl_interface -lei -o test ld: warning: cannot find entry symbol _start; defaulting to 080480a0 /usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib/liberl_interface.a(erl_eterm.o): In function `erl_print_term': /home/j.bhanot/Download/H.248/otp_src_R12B-0/lib/erl_interface/src/legacy/erl_eterm.c:860: undefined reference to `__ctype_b_loc' /home/j.bhanot/Download/H.248/otp_src_R12B-0/lib/erl_interface/src/legacy/erl_eterm.c:870: undefined reference to `_IO_putc' /home/j.bhanot/Download/H.248/otp_src_R12B-0/lib/erl_interface/src/legacy/erl_eterm.c:873: undefined reference to `fputs' /home/j.bhanot/Download/H.248/otp_src_R12B-0/lib/erl_interface/src/legacy/erl_eterm.c:876: undefined reference to `_IO_putc' /home/j.bhanot/Download/H.248/otp_src_R12B-0/lib/erl_interface/src/legacy/erl_eterm.c:962: undefined reference to `fprintf' Please find the attched complete error log: Would appreciate any help Thanks, jb ____________________________________________ =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: error.txt URL: From tomas.pihl@REDACTED Wed Jan 30 10:02:34 2008 From: tomas.pihl@REDACTED (Tomas Pihl) Date: Wed, 30 Jan 2008 10:02:34 +0100 Subject: [erlang-questions] Problems with C Erlang interface In-Reply-To: References: Message-ID: <20080130090234.GD13191@seasc0391.rnd.as.sw.ericsson.se> * J Bhanot [2008-01-30 11:31:47 +0530]: > Hi, > > I created a C file test.c > > {code} > > #include "erl_interface.h" > #include "ei.h" > #include > > main() > { > int i=2; > erl_init(NULL,0); > } > > {/code} > > > Compiled it as follows : > cc -c -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include test.c > No errors in compiling > > Tried to link it as follows: > ld -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib test.o > -lerl_interface -lei -o test > but during liking, I got tons of errrs > Try cc -o test -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include \ -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib -lerl_interface \ -lei test.c /topi From richardc@REDACTED Wed Jan 30 10:21:37 2008 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 30 Jan 2008 10:21:37 +0100 Subject: [erlang-questions] Concurrency-related optimizations In-Reply-To: <315563.11395.qm@web38804.mail.mud.yahoo.com> References: <315563.11395.qm@web38804.mail.mud.yahoo.com> Message-ID: <47A041A1.6080406@it.uu.se> Thomas Lindgren wrote: > There hasn't been much published about scheduling. The > old-timers usually just shudder and change the subject > when anything beyond the existing heuristic scheduler > with high/medium/low priorities is mentioned :-) > Actually, there seems to be some OTP experimentation > behind the scenes (process prio based on message queue > length?), but little has been published. Actually, there was the "Towards Hard Real-Time Erlang" paper at the Erlang Workshop 2007 in Freiburg. Fairly interesting stuff. (http://www.erlang.se/workshop/2007/) /Richard From mikpe@REDACTED Wed Jan 30 10:40:42 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 30 Jan 2008 10:40:42 +0100 Subject: [erlang-questions] effect of destructive updates on GC implementation In-Reply-To: <31c6fe8f0801291411w3bdf6cfo31c5b9eb1cafc975@mail.gmail.com> References: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> <18335.39101.66579.372519@alkaid.it.uu.se> <479F9DA7.1090108@ericsson.com> <31c6fe8f0801291411w3bdf6cfo31c5b9eb1cafc975@mail.gmail.com> Message-ID: <18336.17946.384268.202947@harpo.it.uu.se> Jonathan Amsterdam writes: > > Yes. I would much rather see a development where higher-order > > constructs can be optimized to either use destructive updates > > under the covers, or even transformations like e.g. removing > > unnecessary reverse() calls, or whatever. (*) > > How about promises with memoization? That is, a no-argument fun whose > result is cached the first time it is called. This would let you > implement lazy lists, and get the performance bounds of the Okasaki > data structures. E.g. queues with worst-case (not amortized) O(1) > behavior. In the context of this thread (GC in the presence of destructive updates), memoization solves no problems. By the time the thunk is forced, the thunk may have migrated to an older generation, and the memoization part (making the thunk refer to the value) may create a wrong-way pointer, just as ordinary updates can. Furthermore, sending thunks between processes raises semantic issues similar to the ones raised for other mutable data, only worse because forcing a thunk also involves running code that can have "normal" side-effects (I/O, ets, send/receive, etc). (These features could be supportable had they been present in Erlang from day one. But it's too late now. Scheme + threads might be what you/we want.) From ayman_abolfadl@REDACTED Wed Jan 30 12:05:52 2008 From: ayman_abolfadl@REDACTED (ayman abolfadl) Date: Wed, 30 Jan 2008 03:05:52 -0800 (PST) Subject: [erlang-questions] deleting records from a ram_copies table in mnesia Message-ID: <653769.11660.qm@web53108.mail.re2.yahoo.com> Hi, I would like to delete some records froma ram_copies table in mnesia, but the mnesia:delete({Tab,Key}) fails as the table doesn't exist on the disc...Is there any workaround to use the ram table in mnesia and delete the table or its records. Thanks in advance. Ayman Abolfadl --------------------------------- Looking for last minute shopping deals? Find them fast with Yahoo! Search. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.bhanot@REDACTED Wed Jan 30 13:09:43 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Wed, 30 Jan 2008 17:39:43 +0530 Subject: [erlang-questions] Problems with C Erlang interface In-Reply-To: <20080130090234.GD13191@seasc0391.rnd.as.sw.ericsson.se> Message-ID: Hi Tomas, I tried following: [root@REDACTED otp_src_R12B-0]# cc -o test -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib -lerl_interface -lei test.c got the following error - /tmp/ccAvr8jd.o: In function `main': test.c:(.text+0x28): undefined reference to `erl_init' collect2: ld returned 1 exit status [root@REDACTED otp_src_R12B-0]# then i tried: [root@REDACTED otp_src_R12B-0]# cc -o test -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib -lerl_interface -lei test.c /topi got the following error: cc: /topi: No such file or directory [root@REDACTED otp_src_R12B-0]# Also, i tried [root@REDACTED otp_src_R12B-0]# ld -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib test.o -lerl_interface -lei -lpthread -o test ld: warning: cannot find entry symbol _start; defaulting to 08049220 [root@REDACTED otp_src_R12B-0]# only a warning during that but when i execute the executable [root@REDACTED otp_src_R12B-0]# ./test bash: ./test: /usr/lib/libc.so.1: bad ELF interpreter: No such file or directory [root@REDACTED otp_src_R12B-0]# Any ideas on that... Thanks, jb Tomas Pihl 01/30/2008 02:32 PM To J Bhanot cc erlang-questions@REDACTED Subject Re: [erlang-questions] Problems with C Erlang interface * J Bhanot [2008-01-30 11:31:47 +0530]: > Hi, > > I created a C file test.c > > {code} > > #include "erl_interface.h" > #include "ei.h" > #include > > main() > { > int i=2; > erl_init(NULL,0); > } > > {/code} > > > Compiled it as follows : > cc -c -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include test.c > No errors in compiling > > Tried to link it as follows: > ld -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib test.o > -lerl_interface -lei -o test > but during liking, I got tons of errrs > Try cc -o test -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include \ -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib -lerl_interface \ -lei test.c /topi ForwardSourceID:NT0000DFBE =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Wed Jan 30 12:36:21 2008 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 30 Jan 2008 03:36:21 -0800 (PST) Subject: [erlang-questions] Concurrency-related optimizations In-Reply-To: <8e3f205b0801292304m4eba2547r243c3a4b16224d95@mail.gmail.com> Message-ID: <42229.45031.qm@web38811.mail.mud.yahoo.com> --- Jacob Lee wrote: > On Tue, Jan 29, 2008 at 4:16 AM, Thomas Lindgren > Chapter 6 from "Efficient Implementation of > Concurrent Programming > Languages" - > http://citeseer.ist.psu.edu/705309.html - contains > information from the Hippo project and also talks > about rescheduling > send. It seems to only have benchmarks for all of > HiPE, though, not > specific optimizations. As I understood it, that was very preliminary work which hasn't been followed up (at least not in the literature). And there ought to be more ways to approach the subject as well. IMO there's plenty of freedom here (as well as in the Erlang concurrency optimization field in general). > That would indeed be interesting to look at. The > challenge is that any > alternate implementations must be as fair as the > current scheduler -- > or at least fair enough to avoid priority inversion, > starvation, etc. > (I'm not sure if Erlang has any requirements here > more formal than > "every process must get scheduled eventually" and > "existing programs > should not break"). It might tie in to fiddling with > the message > queue, as well. There are no formal requirements that I know of. Normally, users are discouraged from messing with scheduling as well, so things should be fairly free to improve. Thus, if a new scheduler or scheduling API turned out to be a big improvement, I don't think it would be a huge user effort to switch. (And those who do care are probably the first to go ahead :-) Getting it into the OTP distro might be quite a bit harder, but all the relevant people read this list ... Best, Thomas ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs From jachym.holecek@REDACTED Wed Jan 30 14:09:12 2008 From: jachym.holecek@REDACTED (Jachym Holecek) Date: Wed, 30 Jan 2008 14:09:12 +0100 Subject: [erlang-questions] Problems with C Erlang interface In-Reply-To: References: Message-ID: On Wed, 30 Jan 2008 13:09:43 +0100, J Bhanot wrote: > [root@REDACTED otp_src_R12B-0]# cc -o test > -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include > -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib -lerl_interface > -lei > test.c > > got the following error - > > /tmp/ccAvr8jd.o: In function `main': > test.c:(.text+0x28): undefined reference to `erl_init' > collect2: ld returned 1 exit status > [root@REDACTED otp_src_R12B-0]# To quote gcc(1): [explanation of '-l' option] It makes a difference where in the command you write this option; the linker searches and processes libraries and object files in the order they are specified. Thus, foo.o -lz bar.o searches library z after file foo.o but before bar.o. If bar.o refers to functions in z, those functions may not be loaded. So you might try to put the arguments in different order: [root@REDACTED otp_src_R12B-0]# cc -o test \ -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include \ -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib \ test.c \ -lerl_interface \ -lei (FWIW the 'erl_init' symbol is defined in liberl_interface.a) > Also, i tried > > [root@REDACTED otp_src_R12B-0]# ld > -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib test.o > -lerl_interface -lei -lpthread -o test Using ld(1) requires you to know exactly what you're doing. Normally, you want to let [g]cc(1) compile & link your program (it will invoke ld(1) internally with the correct options). HTH, -- Jachym From j.bhanot@REDACTED Wed Jan 30 14:26:10 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Wed, 30 Jan 2008 18:56:10 +0530 Subject: [erlang-questions] Problems with C Erlang interface In-Reply-To: Message-ID: Hi, Got the solution : to compile : gcc -c -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include test.c to link : gcc -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib/ test.o -lerl_interface -lei -lpthread -o test' to execute : ./test :-) Thanks, jb ____________________________________________ "Jachym Holecek" 01/30/2008 06:39 PM To "J Bhanot" , "Tomas Pihl" cc erlang-questions@REDACTED Subject Re: [erlang-questions] Problems with C Erlang interface On Wed, 30 Jan 2008 13:09:43 +0100, J Bhanot wrote: > [root@REDACTED otp_src_R12B-0]# cc -o test > -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include > -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib -lerl_interface > -lei > test.c > > got the following error - > > /tmp/ccAvr8jd.o: In function `main': > test.c:(.text+0x28): undefined reference to `erl_init' > collect2: ld returned 1 exit status > [root@REDACTED otp_src_R12B-0]# To quote gcc(1): [explanation of '-l' option] It makes a difference where in the command you write this option; the linker searches and processes libraries and object files in the order they are specified. Thus, foo.o -lz bar.o searches library z after file foo.o but before bar.o. If bar.o refers to functions in z, those functions may not be loaded. So you might try to put the arguments in different order: [root@REDACTED otp_src_R12B-0]# cc -o test \ -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include \ -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib \ test.c \ -lerl_interface \ -lei (FWIW the 'erl_init' symbol is defined in liberl_interface.a) > Also, i tried > > [root@REDACTED otp_src_R12B-0]# ld > -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib test.o > -lerl_interface -lei -lpthread -o test Using ld(1) requires you to know exactly what you're doing. Normally, you want to let [g]cc(1) compile & link your program (it will invoke ld(1) internally with the correct options). HTH, -- Jachym ForwardSourceID:NT0000DFFE =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.bhanot@REDACTED Wed Jan 30 15:16:40 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Wed, 30 Jan 2008 19:46:40 +0530 Subject: [erlang-questions] Node name for erl_connect(nodename) Message-ID: Hi, I am using putty to connect to my linux server....am also runnig MGC (sample application in Megaco) which is listening on the port of linux server... Now i have written a small program in C which uses erl_interface... [code] #include //#include #include #include main() { printf("Heloo World\n"); erl_init(NULL,0); //int identification_number = 99; //int creation=1; //char *cookie="a secret cookie string"; /* An example */ if (!erl_connect_init(17, "samplecookiestring...", 0)) erl_err_quit(" when initializing !"); int sockfd; char *nodename="c17@REDACTED"; /* An example */ //char *nodename="127.0.0.1"; /* An example */ if ((sockfd = erl_connect(nodename)) < 0) { printf("in\n"); erl_err_quit("ERROR: erl_connect failed"); } else { printf("got the conn"); } } [/code] I am trying to connect to erlang node i.e. running MGC using this....(i hope my understanding is right here) but i am really confused about the node name to be given in erl_connect(nodename) I have tried given it 127.0.0.1....also 127.0.0.1...also 127.0.01:2944(port on which MGC is listeniing) but not able to connect it and getting the error ERROR: erl_connect failed Any clues on that.. Thanks, jb ____________________________________________ =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.becuwe@REDACTED Wed Jan 30 17:48:22 2008 From: sebastien.becuwe@REDACTED (=?ISO-8859-1?Q?s=E9bastien_BECUWE?=) Date: Wed, 30 Jan 2008 17:48:22 +0100 Subject: [erlang-questions] Fragmented mnesia table: access to local fragment Message-ID: <47A0AA56.70404@cellicium.com> Hi, I would like to access only on local data. Is there a way to do that ? I have configured a fragmented table on a cluster and each node has two fragment. I would to create a process which check data integrity and for improving performance i will prefer to do it on each node and only on local fragment. Can anyone help me ? Thanks, S?bastien BECUWE. From paul-trapexit@REDACTED Wed Jan 30 19:04:33 2008 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Wed, 30 Jan 2008 10:04:33 -0800 (PST) Subject: [erlang-questions] Fragmented mnesia table: access to local fragment In-Reply-To: <47A0AA56.70404@cellicium.com> References: <47A0AA56.70404@cellicium.com> Message-ID: Sebastien, I have done things of this flavor. What I did was: 1. Find out the number of fragments from mnesia. ---------- num_fragments (Tablename) -> { value, { n_fragments, N } } = lists:keysearch (n_fragments, 1, mnesia:table_info (Tablename, frag_properties)), N. ---------- 2. Construct the fragment table names. ---------- frag_table_name (Tab, 1) -> Tab; frag_table_name (Tab, N) -> list_to_atom (atom_to_list (Tab) ++ "_frag" ++ integer_to_list (N)). ---------- 3. Find out if a fragment is local. ---------- is_local (TableName) -> lists:member (node (), mnesia:table_info (TableName, disc_copies)) orelse lists:member (node (), mnesia:table_info (TableName, disc_only_copies)) orelse lists:member (node (), mnesia:table_info (TableName, ram_copies)). ---------- You can put all this together in a list comprehension: ---------- local_fragments (TableName) -> [ F || N <- lists:seq (1, num_fragments (TableName)), F <- [ frag_table_name (TableName, N) ], is_local (F) ]. ---------- Once you have the list of local fragments, do what you will on each of them, but *without* using the mnesia_frag access context. -- p On Wed, 30 Jan 2008, [ISO-8859-1] s?bastien BECUWE wrote: > Hi, > > I would like to access only on local data. Is there a way to do that ? > I have configured a fragmented table on a cluster and each node has > two fragment. I would to create a process which check data integrity > and for improving performance i will prefer to do it on each node and > only on local fragment. > > Can anyone help me ? > > Thanks, > > S?bastien BECUWE. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > Optimism is an essential ingredient of innovation. How else can the individual favor change over security? -- Robert Noyce From rpettit@REDACTED Wed Jan 30 20:47:26 2008 From: rpettit@REDACTED (Rick Pettit) Date: Wed, 30 Jan 2008 13:47:26 -0600 Subject: [erlang-questions] deleting records from a ram_copies table in mnesia In-Reply-To: <653769.11660.qm@web53108.mail.re2.yahoo.com> References: <653769.11660.qm@web53108.mail.re2.yahoo.com> Message-ID: <20080130194726.GE28231@vailsys.com> On Wed, Jan 30, 2008 at 03:05:52AM -0800, ayman abolfadl wrote: > Hi, > > I would like to delete some records froma ram_copies table in mnesia, but the mnesia:delete({Tab,Key}) fails as the table doesn't exist on the disc...Is there any workaround to use the ram table in mnesia and delete the table or its records. Are you sure the table exists on the node you are calling mnesia:delete/1 on? I suspect it doesn't exist on disc or in ram if you are getting a no_exists error. -Rick From jbamsterdam@REDACTED Wed Jan 30 22:23:01 2008 From: jbamsterdam@REDACTED (Jonathan Amsterdam) Date: Wed, 30 Jan 2008 16:23:01 -0500 Subject: [erlang-questions] effect of destructive updates on GC implementation In-Reply-To: <18336.17946.384268.202947@harpo.it.uu.se> References: <31c6fe8f0801291016p1aae6e36o5e7f040378d770bf@mail.gmail.com> <18335.39101.66579.372519@alkaid.it.uu.se> <479F9DA7.1090108@ericsson.com> <31c6fe8f0801291411w3bdf6cfo31c5b9eb1cafc975@mail.gmail.com> <18336.17946.384268.202947@harpo.it.uu.se> Message-ID: <31c6fe8f0801301323v55de5fdfrf7f7d1ec46bf6b1f@mail.gmail.com> On Jan 30, 2008 4:40 AM, Mikael Pettersson wrote: > > Jonathan Amsterdam writes: > > > Yes. I would much rather see a development where higher-order > > > constructs can be optimized to either use destructive updates > > > under the covers, or even transformations like e.g. removing > > > unnecessary reverse() calls, or whatever. (*) > > > > How about promises with memoization? That is, a no-argument fun whose > > result is cached the first time it is called. This would let you > > implement lazy lists, and get the performance bounds of the Okasaki > > data structures. E.g. queues with worst-case (not amortized) O(1) > > behavior. > > In the context of this thread (GC in the presence of destructive > updates), memoization solves no problems. By the time the thunk > is forced, the thunk may have migrated to an older generation, > and the memoization part (making the thunk refer to the value) > may create a wrong-way pointer, just as ordinary updates can. Yes. I was just giving an interesting example of "destructive updates under the covers." > Furthermore, sending thunks between processes raises semantic > issues similar to the ones raised for other mutable data, only > worse because forcing a thunk also involves running code that > can have "normal" side-effects (I/O, ets, send/receive, etc). I disagree. You tell people that the function in the promise must be idempotent or the results are undefined. The spec would say something like, the implementation makes a best effort to run the function at most once, but that is not guaranteed. Contrast with the case of updatable cells, where as you pointed out, there is no way to reconcile the semantics of updating with that of copying. > (These features could be supportable had they been present in > Erlang from day one. But it's too late now. Scheme + threads > might be what you/we want.) But it is fun to dream. From metebalci@REDACTED Thu Jan 31 00:24:11 2008 From: metebalci@REDACTED (Mete BALCI) Date: Thu, 31 Jan 2008 01:24:11 +0200 Subject: [erlang-questions] vm Message-ID: <30347F2B-5B66-4FC7-B31B-ED29AD4B2880@gmail.com> Hello, Can someone point me a documentation or specification about erlang virtual machine ? I am looking for something like java vm spec. Mete From fess-erlang@REDACTED Thu Jan 31 01:53:42 2008 From: fess-erlang@REDACTED (fess) Date: Wed, 30 Jan 2008 16:53:42 -0800 Subject: [erlang-questions] Eunit multinode test help. Message-ID: Where is the best place for questions about eunit? I can't find any hints of mailing lists or forums [ except a comments trail http:// support.process-one.net/doc/display/CONTRIBS/EUnit which looks inappropriate. ] Running the following test: start_node_fixture_test_() -> { Node, Host } = split_node(node()), S = Node ++ "_slave", RN = erlang:list_to_atom( S ++ "@" ++ Host), { node, RN, { setup, { spawn, RN }, fun start_node_test_setup/0, fun start_node_test_cleanup/1, [ % w/out the list eunit doesn't run test_1 on remote node? fun start_node_test_1/0 ] }}. I get the following error: *unexpected termination of test process* ::{badarg,[{erlang,atom_to_list,[[]]}, {eunit_lib,fun_parent,1}, {eunit_data,parse_function,1}, {eunit_data,next,1}, {eunit_data,iter_next,1}, {eunit_data,iter_do,3}, {eunit_proc,tests_inorder,3}, {eunit_proc,with_timeout,3}]} and I'm at a loss. Any help is greatly appreciated. The full code and output follow. erl -sname $$ -pa ../src -boot start_sasl [...] (24078@REDACTED)1> c(eunit_node_test). {ok,eunit_node_test} (24078@REDACTED)2> eunit_node_test:test(). =PROGRESS REPORT==== 30-Jan-2008::16:34:32 === supervisor: {local,inet_gethost_native_sup} started: [{pid,<0.62.0>},{mfa,{inet_gethost_native,init, [[]]}}] =PROGRESS REPORT==== 30-Jan-2008::16:34:32 === supervisor: {local,kernel_safe_sup} started: [{pid,<0.61.0>}, {name,inet_gethost_native_sup}, {mfa,{inet_gethost_native,start_link,[]}}, {restart_type,temporary}, {shutdown,1000}, {child_type,worker}] setup is on: '24078@REDACTED' cleanup is on: '24078@REDACTED' *unexpected termination of test process* ::{badarg,[{erlang,atom_to_list,[[]]}, {eunit_lib,fun_parent,1}, {eunit_data,parse_function,1}, {eunit_data,next,1}, {eunit_data,iter_next,1}, {eunit_data,iter_do,3}, {eunit_proc,tests_inorder,3}, {eunit_proc,with_timeout,3}]} ======================================================= Failed: 0. Aborted: 0. Skipped: 1. Succeeded: 0. error the code follows: ---- BEGIN eunit_node_test.erl --- -module(eunit_node_test). -include_lib ("eunit/include/eunit.hrl"). start_node_fixture_test_() -> { Node, Host } = split_node(node()), S = Node ++ "_slave", RN = erlang:list_to_atom( S ++ "@" ++ Host), { node, RN, { setup, { spawn, RN }, fun start_node_test_setup/0, fun start_node_test_cleanup/1, [ % w/out the list eunit doesn't even try to run test_1 on remote node? weird. fun start_node_test_1/0 ] }}. start_node_test_setup() -> io:format(user, "setup is on: ~p~n", [ node() ]). start_node_test_cleanup(_) -> io:format(user, "cleanup is on: ~p~n", [ node() ]). start_node_test_1() -> io:format(user, "Where does this go: ~p~n", [ node() ]). split_node(Node) when is_atom(Node) -> split_node(atom_to_list(Node), []). split_node([], UseAsHost ) -> { [], UseAsHost }; split_node([ $@ | T ], Node ) -> { Node, T }; split_node([ H | T ], Node ) -> split_node(T, Node ++ [H] ). ---- END eunit_node_test.erl --- From mukul.j@REDACTED Thu Jan 31 06:35:31 2008 From: mukul.j@REDACTED (Mukul J) Date: Thu, 31 Jan 2008 11:05:31 +0530 Subject: [erlang-questions] Node name for erl_connect(nodename) In-Reply-To: Message-ID: Hi, I am doing the same thing with the below mentioed code. #include "erl_interface.h" #include "ei.h" int main() { extern const char *erl_thisnodename(void); extern short erl_thiscreation(void); #define SELF(fd) erl_mk_pid(erl_thisnodename(),fd,0,erl_thiscreation()) ETERM *arr[2], *emsg; int sockfd, creation=1; int i; char buf[BUFSIZ]; erl_init(NULL,0); arr[0] = SELF(sockfd); arr[1] = erl_mk_atom("Hello world"); emsg = erl_mk_tuple(arr, 2); i = erl_encode(emsg , buf); erl_reg_send(sockfd, "my_server", emsg); erl_free_term(emsg); } I am getting some different error. ERROR: Segmentation fault Please advise where i am doing wrong. Regards, Mukul Jain J Bhanot Sent by: erlang-questions-bounces@REDACTED 01/30/2008 07:46 PM To erlang-questions@REDACTED cc Subject [erlang-questions] Node name for erl_connect(nodename) Hi, I am using putty to connect to my linux server....am also runnig MGC (sample application in Megaco) which is listening on the port of linux server... Now i have written a small program in C which uses erl_interface... [code] #include //#include #include #include main() { printf("Heloo World\n"); erl_init(NULL,0); //int identification_number = 99; //int creation=1; //char *cookie="a secret cookie string"; /* An example */ if (!erl_connect_init(17, "samplecookiestring...", 0)) erl_err_quit(" when initializing !"); int sockfd; char *nodename="c17@REDACTED"; /* An example */ //char *nodename="127.0.0.1"; /* An example */ if ((sockfd = erl_connect(nodename)) < 0) { printf("in\n"); erl_err_quit("ERROR: erl_connect failed"); } else { printf("got the conn"); } } [/code] I am trying to connect to erlang node i.e. running MGC using this....(i hope my understanding is right here) but i am really confused about the node name to be given in erl_connect(nodename) I have tried given it 127.0.0.1....also 127.0.0.1...also 127.0.01:2944(port on which MGC is listeniing) but not able to connect it and getting the error ERROR: erl_connect failed Any clues on that.. Thanks, jb ____________________________________________ =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions ForwardSourceID:NT000184D6 =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From zerthurd@REDACTED Thu Jan 31 06:59:30 2008 From: zerthurd@REDACTED (Maxim Treskin) Date: Thu, 31 Jan 2008 11:59:30 +0600 Subject: [erlang-questions] Node name for erl_connect(nodename) In-Reply-To: References: Message-ID: Try to use GDB to find you problem issue. On 31/01/2008, Mukul J wrote: > > > Hi, > > I am doing the same thing with the below mentioed code. > > #include "erl_interface.h" > #include "ei.h" > > int main() > { > extern const char *erl_thisnodename(void); > extern short erl_thiscreation(void); > > #define SELF(fd) > erl_mk_pid(erl_thisnodename(),fd,0,erl_thiscreation()) > > ETERM *arr[2], *emsg; > int sockfd, creation=1; > int i; > char buf[BUFSIZ]; > > erl_init(NULL,0); > arr[0] = SELF(sockfd); > arr[1] = erl_mk_atom("Hello world"); > emsg = erl_mk_tuple(arr, 2); > i = erl_encode(emsg , buf); > > erl_reg_send(sockfd, "my_server", emsg); > erl_free_term(emsg); > } > > I am getting some different error. > > ERROR: Segmentation fault > > Please advise where i am doing wrong. > > Regards, > Mukul Jain > > > *J Bhanot * > Sent by: erlang-questions-bounces@REDACTED > > 01/30/2008 07:46 PM > To > erlang-questions@REDACTED cc > > Subject > [erlang-questions] Node name for erl_connect(nodename) > > > > > > > > Hi, > > I am using putty to connect to my linux server....am also runnig MGC > (sample application in Megaco) which is listening on the port of linux > server... > > Now i have written a small program in C which uses erl_interface... > > [code] > > #include > //#include > #include > #include > > > main() > { > printf("Heloo World\n"); > > erl_init(NULL,0); > > //int identification_number = 99; > //int creation=1; > //char *cookie="a secret cookie string"; /* An example */ > > if (!erl_connect_init(17, "samplecookiestring...", 0)) > erl_err_quit(" when initializing !"); > > int sockfd; > char *nodename="c17@REDACTED"; /* An example */ > //char *nodename="127.0.0.1"; /* An example */ > if ((sockfd = erl_connect(nodename)) < 0) > { > > printf("in\n"); > erl_err_quit("ERROR: erl_connect failed"); > } > else > { > printf("got the conn"); > } > } > > [/code] > > I am trying to connect to erlang node i.e. running MGC using this....(i > hope my understanding is right here) > > but i am really confused about the node name to be given in > erl_connect(nodename) > > I have tried given it 127.0.0.1....also 127.0.0.1...also 127.0.01:2944(port > on which MGC is listeniing) > > but not able to connect it and getting the error > > ERROR: erl_connect failed > > Any clues on that.. > > Thanks, > jb > ____________________________________________ > =====-----=====-----===== > Notice: The information contained in this e-mail > message and/or attachments to it may contain > confidential or privileged information. If you are > not the intended recipient, any dissemination, use, > review, distribution, printing or copying of the > information contained in this e-mail message > and/or attachments to it are strictly prohibited. If > you have received this communication in error, > please notify us by reply e-mail or telephone and > immediately and permanently delete the message > and any attachments. Thank you > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > ForwardSourceID:NT000184D6 > > =====-----=====-----===== > Notice: The information contained in this e-mail > message and/or attachments to it may contain > confidential or privileged information. If you are > not the intended recipient, any dissemination, use, > review, distribution, printing or copying of the > information contained in this e-mail message > and/or attachments to it are strictly prohibited. If > you have received this communication in error, > please notify us by reply e-mail or telephone and > immediately and permanently delete the message > and any attachments. Thank you > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- Maxim Treskin -------------- next part -------------- An HTML attachment was scrubbed... URL: From richardc@REDACTED Thu Jan 31 11:07:22 2008 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 31 Jan 2008 11:07:22 +0100 Subject: [erlang-questions] Eunit multinode test help. In-Reply-To: References: Message-ID: <47A19DDA.3060103@it.uu.se> fess wrote: > Where is the best place for questions about eunit? I can't find any > hints of mailing lists or forums [ except a comments trail http:// > support.process-one.net/doc/display/CONTRIBS/EUnit which looks > inappropriate. ] There is no separate list, so this one is probably the best place. I'll try to look at this as soon as I can. It looks like an internal error. It might be that the fun-name mangling has changed in R12. /Richard From jahakala@REDACTED Thu Jan 31 10:40:57 2008 From: jahakala@REDACTED (Jani Hakala) Date: Thu, 31 Jan 2008 11:40:57 +0200 Subject: [erlang-questions] Node name for erl_connect(nodename) In-Reply-To: (J. Bhanot's message of "Wed\, 30 Jan 2008 19\:46\:40 +0530") References: Message-ID: <87lk662uza.fsf@pingviini.kortex.jyu.fi> J Bhanot writes: > Hi, > > I am using putty to connect to my linux server....am also runnig MGC > (sample application in Megaco) which is listening on the port of linux > server... > If the listening port is a regular TCP or UDP port, then you can not use erl_connect and related functions. erl_connect is used to connect to a erlang node. You are trying to use erl_interface, which is depracated in favor of ei (man ei and man ei_connect) Jani Hakala From kettlgruber@REDACTED Thu Jan 31 14:36:33 2008 From: kettlgruber@REDACTED (Gerald Kettlgruber) Date: Thu, 31 Jan 2008 14:36:33 +0100 Subject: [erlang-questions] Newbie: Problem TCP connection erlang-python Message-ID: <200801311436.33405.kettlgruber@gmail.com> Hello, I have a problem concerning a tcp connection between an erlang server and a python client. The problem is, that on the server I receive the message, but the format doesn't match. I tried to specify the bits, but this doesn't worked either. This is what the server looks like: start(Port, Id) -> {ok, Listen} = gen_tcp:listen (Port, [binary, {active,true}, {reuseaddr,true}]), accept(Listen, Id). accept(Listen, Id)-> {ok, Socket} = gen_tcp:accept(Listen), gwe_server:start_agent(tcp_agent, accept, [Listen]), loop(Socket, Id). loop(Socket, Id) -> receive {tcp, Socket, Bin} -> <> = Bin, loop(Socket, Id); end. Python Client looks like this: I pack the data with: data = [1,2,3,4,5] format= ">iiiii" msg = struct.pack(format,*data) size = struct.calcsize(format) and then send it with sent = self.sock.send(msg[totalsent:]) Would be nice if anyone can help me. Thanks, Gerald Kettlgruber From daniel.kwiecinski@REDACTED Thu Jan 31 14:06:02 2008 From: daniel.kwiecinski@REDACTED (Daniel Kwiecinski) Date: Thu, 31 Jan 2008 13:06:02 +0000 Subject: [erlang-questions] Dealing with public/private keys stored in *.pem files Message-ID: Hi, As far as I know the crypto module (app) handles rsa's private keys as a list of two binaries (exponent and modulus). How can I obtain these from base64 encoded *.pem files? -- Kind Regards, Daniel Kwiecinski -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.hillqvist@REDACTED Thu Jan 31 14:08:53 2008 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Thu, 31 Jan 2008 14:08:53 +0100 Subject: [erlang-questions] Newbie: Problem TCP connection erlang-python In-Reply-To: <200801311436.33405.kettlgruber@gmail.com> References: <200801311436.33405.kettlgruber@gmail.com> Message-ID: <8268eea30801310508s47b04eaay275b54e67019e5e5@mail.gmail.com> Could it be the options? You could try using {packet, raw}: Opts = [binary, {active,true}, {packet, raw}, {reuseaddr,true}], {ok, Listen} = gen_tcp:listen (Port, Opts), See: http://www.erlang.org/doc/man/inet.html#setopts/2 Just some speculation from me. ;-) Regards, Andreas Hillqvist 2008/1/31, Gerald Kettlgruber : > Hello, > I have a problem concerning a tcp connection between an erlang server and a > python client. > The problem is, that on the server I receive the message, but the format > doesn't match. I tried to specify the bits, but this doesn't worked either. > > This is what the server looks like: > start(Port, Id) -> > {ok, Listen} = gen_tcp:listen (Port, [binary, {active,true}, > {reuseaddr,true}]), > accept(Listen, Id). > accept(Listen, Id)-> > {ok, Socket} = gen_tcp:accept(Listen), > gwe_server:start_agent(tcp_agent, accept, [Listen]), > loop(Socket, Id). > loop(Socket, Id) -> > receive > {tcp, Socket, Bin} -> > <> = Bin, > loop(Socket, Id); > end. > > Python Client looks like this: > > I pack the data with: > data = [1,2,3,4,5] > format= ">iiiii" > msg = struct.pack(format,*data) > size = struct.calcsize(format) > > and then send it with > sent = self.sock.send(msg[totalsent:]) > > Would be nice if anyone can help me. > Thanks, > Gerald Kettlgruber > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From jakob@REDACTED Thu Jan 31 14:42:36 2008 From: jakob@REDACTED (Jakob Cederlund) Date: Thu, 31 Jan 2008 14:42:36 +0100 Subject: [erlang-questions] Dealing with public/private keys stored in *.pem files In-Reply-To: References: Message-ID: <47A1D04C.2090705@erix.ericsson.se> Hi, there is not yet a public api for this in OTP. However, the undocumented, unsupported function ssl_pkix:decode_rsa_keyfile/2 does just this. It reads a .pem keyfile and returns a record with exponent and modulus, and other fields. It is unsupported, so it might be moved (or even removed) in future releases of OTP. /Jakob Daniel Kwiecinski wrote: > Hi, > > As far as I know the crypto module (app) handles rsa's private keys > as a list of two binaries (exponent and modulus). How can I obtain > these from base64 encoded *.pem files? > > -- > Kind Regards, > Daniel Kwiecinski > > ------------------------------------------------------------------------ > > _______________________________________________ > 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.kwiecinski@REDACTED Thu Jan 31 15:12:22 2008 From: daniel.kwiecinski@REDACTED (Daniel Kwiecinski) Date: Thu, 31 Jan 2008 14:12:22 +0000 Subject: [erlang-questions] Dealing with public/private keys stored in *.pem files In-Reply-To: <47A1D04C.2090705@erix.ericsson.se> References: <47A1D04C.2090705@erix.ericsson.se> Message-ID: Eshell V5.5.5 (abort with ^G) 1> ssl_pkix:decode_rsa_keyfile("public.pem"). ** exited: {undef,[{ssl_pkix,decode_rsa_keyfile,["public.pem"]}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** =ERROR REPORT==== 31-Jan-2008::14:11:10 === Error in process <0.31.0> with exit value: {undef,[{ssl_pkix,decode_rsa_keyfile,["public.pem "]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} 2> ssl_pkix:decode_cert_file("public.pem", [pem]). =ERROR REPORT==== 31-Jan-2008::14:11:22 === Error in process <0.33.0> with exit value: {{badmatch,{ok,[]}},[{ssl_pkix,decode_cert_file,2},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} ** exited: {{badmatch,{ok,[]}}, [{ssl_pkix,decode_cert_file,2}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** :-( 2008/1/31, Jakob Cederlund : > > Hi, > there is not yet a public api for this in OTP. However, the undocumented, > unsupported function ssl_pkix:decode_rsa_keyfile/2 does just this. It reads > a .pem keyfile and returns a record with exponent and modulus, and other > fields. It is unsupported, so it might be moved (or even removed) in future > releases of OTP. > /Jakob > > > Daniel Kwiecinski wrote: > > Hi, > > As far as I know the crypto module (app) handles rsa's private keys as > a list of two binaries (exponent and modulus). How can I obtain these from > base64 encoded *.pem files? > > -- > Kind Regards, > Daniel Kwiecinski > > ------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED://www.erlang.org/mailman/listinfo/erlang-questions > > > -- Kind Regards, Daniel Kwiecinski m: 0 7852745975 e: daniel.kwiecinski@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.bhanot@REDACTED Thu Jan 31 16:22:38 2008 From: j.bhanot@REDACTED (J Bhanot) Date: Thu, 31 Jan 2008 20:52:38 +0530 Subject: [erlang-questions] Erlang C Communication - process completes but nodes are not connected Message-ID: Hi, I am using C node as client [] #include #include #include #include #include #include #include #include "erl_interface.h" #include "ei.h" #define PORT 6666 int sockfd, epmdfd; main() { struct in_addr addr; erl_init(NULL, 0); printf("Initializing ..."); if(!erl_connect_init(69, "SFEWRG34AFDSGAFG35235", 0)) { printf("\nerror in initialisation"); erl_err_sys("erl_connect_init"); printf("\nafter error in init"); } printf(" done.\n"); printf("node=%s, host=%s, alive=%s, creation=%d\n ", erl_thisnodename(), erl_thishostname(), erl_thisalivename(), erl_thiscreation()); /*This is the short host name outgoing connect routine */ printf("Connecting ..."); usleep(5000); getchar(); //for checking if((sockfd = erl_connect("node1@REDACTED")) < 0) // if((sockfd = erl_connect("")) < 0) { printf("in error"); erl_err_sys("erl_connect"); } printf("\nsock = %d\n", sockfd); erl_err_sys("erl_connect"); printf(" done.\n"); } [/code] and Erlang node as server 'node1@REDACTED' Steps to run Erlang node : erl -setcookie SFEWRG34AFDSGAFG35235 -name node1 Created a file named $HOME/.hosts.erlang having contents as 'node1@REDACTED'. 'c69@REDACTED'. The output for c file upon execution is [root@REDACTED otp_src_R12B-0]# ./mytest Initializing ... done. node=c69@REDACTED, host=localhost, alive=c69, creation=0 Connecting ... sock = 3 erl_connect: Success but at erlang node when i execute the command : (node1@REDACTED)8> net_adm:world(). i get the output as : [] similalry (node1@REDACTED)9> nodes(). [] (node1@REDACTED)10> That is no node is connected to it.... Now the point is C node has successfully connected .... Why Erlang node is not showing it as connected.... Do we need to register the C node with EPMD even when it is acting as a client... Do we need to register Erlang node with EPMD as well and if yes the how do we do that.. Note : I am using putty to connect to single linux server (FC8). Appreciate your help... Many Thanks, jb ____________________________________________ =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.hillqvist@REDACTED Thu Jan 31 16:30:02 2008 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Thu, 31 Jan 2008 16:30:02 +0100 Subject: [erlang-questions] Proposal: Addition to lists module - shuffle/randomize list Message-ID: <8268eea30801310730h3e5ffe05t41d5549ed4b6a0ad@mail.gmail.com> Is their any interest of a shuffle/randomize function in the list module? Something like: shuffle(List0) -> List1 = [{random:uniform(), X} || X <- List0], List2 = lists:keysort(1, List1), [X || {_, X} <- List2]. And: shuffle(List0, Fun, Seed0) -> {List1, Seed1} = random_key(List0, Fun, Seed0, []), List2 = lists:keysort(1, List1), {[X || {_, X} <- List2], Seed1}. random_key([], _Fun, Seed0, Acc) -> {Acc, Seed0}; random_key([X | List], Fun, Seed0, Acc) -> {Random, Seed1} = Fun(Seed0), random_key(List, Fun, Seed1, [{Random, X} | Acc]). And would be called like: > lists:shuffle([1,2,3,4,5,6,7,8,9,19]). [1,6,2,19,5,7,9,3,8,4] > shuffle_list:shuffle([1,2,3,4,5,6,7,8,9,19], fun random:uniform_s/1, random:seed()). {[19,2,5,3,7,9,8,6,1,4],{28186,30068,19371}} I do not believe that it is a "must have function", just a suggestion. I propose a fun for the random function, to able to provide a other pseudo-random number generator (PRNG) then the random module. For example a cryptographically secure pseudo-random number generator (CSPRNG) Regards Andreas Hillqvist From Woolla_T@REDACTED Thu Jan 31 15:51:08 2008 From: Woolla_T@REDACTED (Trevor Woollacott [ MTN - Innovation Centre ]) Date: Thu, 31 Jan 2008 16:51:08 +0200 Subject: [erlang-questions] Dealing with public/private keys stored in*.pem files In-Reply-To: References: <47A1D04C.2090705@erix.ericsson.se> Message-ID: <70D00C33FCD1FD4A860DEAC228277C0C0309A311@MTNMAIL1.mtn.co.za> Hi, Ssl_pkix:decode_rsa_keyfile is returning undefined because it requires two parameters, namely Key File and Password Trevor ________________________________ From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Daniel Kwiecinski Sent: Thursday, 31 January 2008 04:12 PM To: Jakob Cederlund Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] Dealing with public/private keys stored in*.pem files Eshell V5.5.5 (abort with ^G) 1> ssl_pkix:decode_rsa_keyfile("public.pem"). ** exited: {undef,[{ssl_pkix,decode_rsa_keyfile,["public.pem"]}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** =ERROR REPORT==== 31-Jan-2008::14:11:10 === Error in process <0.31.0> with exit value: {undef,[{ssl_pkix,decode_rsa_keyfile,["public.pem"]},{erl_eval,do_apply, 5},{shell,exprs,6},{shell,eval_loop,3}]} 2> ssl_pkix:decode_cert_file("public.pem", [pem]). =ERROR REPORT==== 31-Jan-2008::14:11:22 === Error in process <0.33.0> with exit value: {{badmatch,{ok,[]}},[{ssl_pkix,decode_cert_file,2},{erl_eval,do_apply,5} ,{shell,exprs,6},{shell,eval_loop,3}]} ** exited: {{badmatch,{ok,[]}}, [{ssl_pkix,decode_cert_file,2}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** :-( 2008/1/31, Jakob Cederlund : Hi, there is not yet a public api for this in OTP. However, the undocumented, unsupported function ssl_pkix:decode_rsa_keyfile/2 does just this. It reads a .pem keyfile and returns a record with exponent and modulus, and other fields. It is unsupported, so it might be moved (or even removed) in future releases of OTP. /Jakob Daniel Kwiecinski wrote: Hi, As far as I know the crypto module (app) handles rsa's private keys as a list of two binaries (exponent and modulus). How can I obtain these from base64 encoded *.pem files? -- Kind Regards, Daniel Kwiecinski ________________________________ _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions -- Kind Regards, Daniel Kwiecinski m: 0 7852745975 e: daniel.kwiecinski@REDACTED NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.kwiecinski@REDACTED Thu Jan 31 17:05:55 2008 From: daniel.kwiecinski@REDACTED (Daniel Kwiecinski) Date: Thu, 31 Jan 2008 16:05:55 +0000 Subject: [erlang-questions] Dealing with public/private keys stored in*.pem files ( resending as plain text ) Message-ID: > > > >Hi, > > > > > > > > As far as I know the crypto module (app) handles rsa's private keys as a list of two binaries (exponent and modulus). How can I obtain these from base64 encoded *.pem files? > > > > > > > > -- > > > > Kind Regards, > > > > Daniel Kwiecinski > > >Hi, > > > there is not yet a public api for this in OTP. However, the undocumented, unsupported function ssl_pkix:decode_rsa_keyfile/2 does just this. It reads a .pem keyfile and returns a record with exponent and modulus, and other fields. It is unsupported, so it might be moved (or even removed) in future releases of OTP. > > > /Jakob > > Eshell V5.5.5 (abort with ^G) > > 1> ssl_pkix:decode_rsa_keyfile("public.pem"). > > ** exited: {undef,[{ssl_pkix,decode_rsa_keyfile,["public.pem"]}, > > {erl_eval,do_apply,5}, > > {shell,exprs,6}, > > {shell,eval_loop,3}]} ** > > > > =ERROR REPORT==== 31-Jan-2008::14:11:10 === > > Error in process <0.31.0> with exit value: {undef,[{ssl_pkix,decode_rsa_keyfile,["public.pem"]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > > > 2> ssl_pkix:decode_cert_file("public.pem", [pem]). > > > > =ERROR REPORT==== 31-Jan-2008::14:11:22 === > > Error in process <0.33.0> with exit value: {{badmatch,{ok,[]}},[{ssl_pkix,decode_cert_file,2},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > > > ** exited: {{badmatch,{ok,[]}}, > > [{ssl_pkix,decode_cert_file,2}, > > {erl_eval,do_apply,5}, > > {shell,exprs,6}, > > {shell,eval_loop,3}]} ** > > > > :-( Daniel > Hi, > > > > Ssl_pkix:decode_rsa_keyfile is returning undefined because it requires two parameters, namely Key File and Password > > > > Trevor There is no such function 'decode_rsa_keyfile' at all in 'ssl_pkix' module in erts v5.5.5 Eshell V5.5.5 (abort with ^G) 1> m(ssl_pkix). Module ssl_pkix compiled: Date: June 11 2007, Time: 17.57 Compiler options: [{d,'VSN',"3.1.1.1"}, {cwd,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/ssl/src"}, {outdir,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/ssl/src/../ebin"}, {i,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/kernel/src"}, {i,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/ssl/src/../include"}, warn_unused_vars, debug_info] Object file: /sw/lib/erlang/lib/ssl-3.1.1.1/ebin/ssl_pkix.beam Exports: decode_cert/1 decode_cert/2 decode_cert_file/1 decode_cert_file/2 module_info/0 module_info/1 ok :-( Daniel From launoja@REDACTED Thu Jan 31 14:07:45 2008 From: launoja@REDACTED (Jani Launonen) Date: Thu, 31 Jan 2008 15:07:45 +0200 Subject: [erlang-questions] Newbie: Problem TCP connection erlang-python In-Reply-To: <200801311436.33405.kettlgruber@gmail.com> References: <200801311436.33405.kettlgruber@gmail.com> Message-ID: Should there be socket option {packet, 0} --- i.e. there's no header bytes. ----- Alkuper?inen viesti ----- L?hett?j?: Gerald Kettlgruber P?iv?ys: torstai, tammikuu 31, 2008 2:58 pm Aihe: [erlang-questions] Newbie: Problem TCP connection erlang-python Vastaanottaja: erlang-questions@REDACTED > > Hello, > I have a problem concerning a tcp connection between an erlang > server and a > python client. > The problem is, that on the server I receive the message, but > the format > doesn't match. I tried to specify the bits, but this doesn't > worked either. > > This is what the server looks like: > start(Port, Id) -> > ??? {ok, Listen} = gen_tcp:listen (Port, [binary, > {active,true},{reuseaddr,true}]), > ??? accept(Listen, Id). > accept(Listen, Id)-> > ??? {ok, Socket} = gen_tcp:accept(Listen), > ??? gwe_server:start_agent(tcp_agent, accept, > [Listen]),??? loop(Socket, Id). > loop(Socket, Id) -> > ??? receive > {tcp, Socket, Bin} -> > ??????????? <> = Bin, > ??????????? loop(Socket, Id); > end. > > Python Client looks like this: > > I pack the data with: > data = [1,2,3,4,5] > format= ">iiiii" > msg = struct.pack(format,*data) > size = struct.calcsize(format) > > and then send it with > sent = self.sock.send(msg[totalsent:]) > > Would be nice if anyone can help me. > Thanks, > Gerald Kettlgruber > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tty.erlang@REDACTED Thu Jan 31 16:58:34 2008 From: tty.erlang@REDACTED (t ty) Date: Thu, 31 Jan 2008 10:58:34 -0500 Subject: [erlang-questions] Proposal: Addition to lists module - shuffle/randomize list In-Reply-To: <8268eea30801310730h3e5ffe05t41d5549ed4b6a0ad@mail.gmail.com> References: <8268eea30801310730h3e5ffe05t41d5549ed4b6a0ad@mail.gmail.com> Message-ID: <290b3ba10801310758p6188cef5mb86e4a9493d42d38@mail.gmail.com> Hello, See also http://www.erlang.org/pipermail/erlang-questions/2007-June/027158.html and http://www.erlang.org/pipermail/erlang-patches/2007-June/000180.html for previous work. t On Jan 31, 2008 10:30 AM, Andreas Hillqvist wrote: > Is their any interest of a shuffle/randomize function in the list module? > > Something like: > shuffle(List0) -> > List1 = [{random:uniform(), X} || X <- List0], > List2 = lists:keysort(1, List1), > [X || {_, X} <- List2]. > > And: > shuffle(List0, Fun, Seed0) -> > {List1, Seed1} = random_key(List0, Fun, Seed0, []), > List2 = lists:keysort(1, List1), > {[X || {_, X} <- List2], Seed1}. > > random_key([], _Fun, Seed0, Acc) -> > {Acc, Seed0}; > random_key([X | List], Fun, Seed0, Acc) -> > {Random, Seed1} = Fun(Seed0), > random_key(List, Fun, Seed1, [{Random, X} | Acc]). > > And would be called like: > > lists:shuffle([1,2,3,4,5,6,7,8,9,19]). > [1,6,2,19,5,7,9,3,8,4] > > > shuffle_list:shuffle([1,2,3,4,5,6,7,8,9,19], fun > random:uniform_s/1, random:seed()). > {[19,2,5,3,7,9,8,6,1,4],{28186,30068,19371}} > > I do not believe that it is a "must have function", just a suggestion. > > I propose a fun for the random function, to able to provide a other > pseudo-random number generator (PRNG) then the random module. > For example a cryptographically secure pseudo-random number generator (CSPRNG) > > > Regards > Andreas Hillqvist > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From nick@REDACTED Thu Jan 31 17:28:41 2008 From: nick@REDACTED (Niclas Eklund) Date: Thu, 31 Jan 2008 17:28:41 +0100 (MET) Subject: [erlang-questions] Dealing with public/private keys stored in*.pem files ( resending as plain text ) In-Reply-To: Message-ID: > There is no such function 'decode_rsa_keyfile' at all in 'ssl_pkix' > module in erts v5.5.5 > > Eshell V5.5.5 (abort with ^G) > 1> m(ssl_pkix). > Module ssl_pkix compiled: Date: June 11 2007, Time: 17.57 > Compiler options: [{d,'VSN',"3.1.1.1"}, > > {cwd,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/ssl/src"}, > > {outdir,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/ssl/src/../ebin"}, > > {i,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/kernel/src"}, > > {i,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/ssl/src/../include"}, > warn_unused_vars, > debug_info] > Object file: /sw/lib/erlang/lib/ssl-3.1.1.1/ebin/ssl_pkix.beam > Exports: > decode_cert/1 > decode_cert/2 > decode_cert_file/1 > decode_cert_file/2 > module_info/0 > module_info/1 > ok > > :-( Daniel You need to upgrade. /Niclas Eshell V5.6 (abort with ^G) 1> m(ssl_pkix). Module ssl_pkix compiled: Date: December 4 2007, Time: 15.04 Compiler options: [{d,'VSN',"3.9"}, {cwd,"/ldisk/daily_build/otp_prebuild_r12b.2007-12-04_15/otp_src_R12B-0/lib/ssl/src"}, {outdir,"/ldisk/daily_build/otp_prebuild_r12b.2007-12-04_15/otp_src_R12B-0/lib/ssl/src/../ebin"}, {i,"/ldisk/daily_build/otp_prebuild_r12b.2007-12-04_15/otp_src_R12B-0/lib/kernel/src"}, {i,"/ldisk/daily_build/otp_prebuild_r12b.2007-12-04_15/otp_src_R12B-0/lib/ssl/src/../include"}, warn_unused_vars,debug_info] Object file: /usr/local/otp/releases/otp_beam_solaris8_r12b_patched/lib/ssl-3.9/ebin/ssl_pkix.beam Exports: decode_cert/1 decode_cert/2 decode_cert_file/1 decode_cert_file/2 decode_rsa_keyfile/2 encode_cert/1 encoded_tbs_cert/1 module_info/0 module_info/1 signature_digest/1 ok From daniel.kwiecinski@REDACTED Thu Jan 31 16:30:55 2008 From: daniel.kwiecinski@REDACTED (Daniel Kwiecinski) Date: Thu, 31 Jan 2008 15:30:55 +0000 Subject: [erlang-questions] Dealing with public/private keys stored in*.pem files In-Reply-To: <70D00C33FCD1FD4A860DEAC228277C0C0309A311@MTNMAIL1.mtn.co.za> References: <47A1D04C.2090705@erix.ericsson.se> <70D00C33FCD1FD4A860DEAC228277C0C0309A311@MTNMAIL1.mtn.co.za> Message-ID: There is no such function 'decode_rsa_keyfile' at all in 'ssl_pkix' module in erts v5.5.5 Eshell V5.5.5 (abort with ^G) 1> m(ssl_pkix). Module ssl_pkix compiled: Date: June 11 2007, Time: 17.57 Compiler options: [{d,'VSN',"3.1.1.1"}, {cwd,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/ssl/src"}, {outdir,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/ssl/src/../ebin"}, {i,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/kernel/src"}, {i,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/ssl/src/../include"}, warn_unused_vars, debug_info] Object file: /sw/lib/erlang/lib/ssl-3.1.1.1/ebin/ssl_pkix.beam Exports: decode_cert/1 decode_cert/2 decode_cert_file/1 decode_cert_file/2 module_info/0 module_info/1 ok :-( Daniel 2008/1/31, Trevor Woollacott [ MTN - Innovation Centre ] : > > Hi, > > > > Ssl_pkix:decode_rsa_keyfile is returning undefined because it requires two > parameters, namely Key File and Password > > > > Trevor > > > ------------------------------ > > *From:* erlang-questions-bounces@REDACTED [mailto: > erlang-questions-bounces@REDACTED] *On Behalf Of *Daniel Kwiecinski > *Sent:* Thursday, 31 January 2008 04:12 PM > *To:* Jakob Cederlund > *Cc:* erlang-questions@REDACTED > *Subject:* Re: [erlang-questions] Dealing with public/private keys stored > in*.pem files > > > > Eshell V5.5.5 (abort with ^G) > 1> ssl_pkix:decode_rsa_keyfile("public.pem"). > ** exited: {undef,[{ssl_pkix,decode_rsa_keyfile,["public.pem"]}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > =ERROR REPORT==== 31-Jan-2008::14:11:10 === > Error in process <0.31.0> with exit value: > {undef,[{ssl_pkix,decode_rsa_keyfile,["public.pem > "]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > 2> ssl_pkix:decode_cert_file("public.pem", [pem]). > > =ERROR REPORT==== 31-Jan-2008::14:11:22 === > Error in process <0.33.0> with exit value: > {{badmatch,{ok,[]}},[{ssl_pkix,decode_cert_file,2},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > ** exited: {{badmatch,{ok,[]}}, > [{ssl_pkix,decode_cert_file,2}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > :-( > > 2008/1/31, Jakob Cederlund : > > Hi, > there is not yet a public api for this in OTP. However, the undocumented, > unsupported function ssl_pkix:decode_rsa_keyfile/2 does just this. It reads > a .pem keyfile and returns a record with exponent and modulus, and other > fields. It is unsupported, so it might be moved (or even removed) in future > releases of OTP. > /Jakob > > > Daniel Kwiecinski wrote: > > Hi, > > As far as I know the crypto module (app) handles rsa's private keys as > a list of two binaries (exponent and modulus). How can I obtain these from > base64 encoded *.pem files? > > -- > Kind Regards, > Daniel Kwiecinski > > > > ------------------------------ > > > > _______________________________________________ > > erlang-questions mailing list > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > NOTE: This e-mail message is subject to the MTN Group disclaimer see > http://www.mtn.co.za/default.aspx?pid=34411 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.hillqvist@REDACTED Thu Jan 31 17:28:53 2008 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Thu, 31 Jan 2008 17:28:53 +0100 Subject: [erlang-questions] Proposal: Addition to lists module - shuffle/randomize list In-Reply-To: <290b3ba10801310758p6188cef5mb86e4a9493d42d38@mail.gmail.com> References: <8268eea30801310730h3e5ffe05t41d5549ed4b6a0ad@mail.gmail.com> <290b3ba10801310758p6188cef5mb86e4a9493d42d38@mail.gmail.com> Message-ID: <8268eea30801310828l2805ad4fve2398e62e5b7a547@mail.gmail.com> Thank you for your feedback. I had missed those. ;-) Regards Andreas Hillqvist 2008/1/31, t ty : > Hello, > > See also > > http://www.erlang.org/pipermail/erlang-questions/2007-June/027158.html > > and > > http://www.erlang.org/pipermail/erlang-patches/2007-June/000180.html > > for previous work. > > t > > On Jan 31, 2008 10:30 AM, Andreas Hillqvist wrote: > > Is their any interest of a shuffle/randomize function in the list module? > > > > Something like: > > shuffle(List0) -> > > List1 = [{random:uniform(), X} || X <- List0], > > List2 = lists:keysort(1, List1), > > [X || {_, X} <- List2]. > > > > And: > > shuffle(List0, Fun, Seed0) -> > > {List1, Seed1} = random_key(List0, Fun, Seed0, []), > > List2 = lists:keysort(1, List1), > > {[X || {_, X} <- List2], Seed1}. > > > > random_key([], _Fun, Seed0, Acc) -> > > {Acc, Seed0}; > > random_key([X | List], Fun, Seed0, Acc) -> > > {Random, Seed1} = Fun(Seed0), > > random_key(List, Fun, Seed1, [{Random, X} | Acc]). > > > > And would be called like: > > > lists:shuffle([1,2,3,4,5,6,7,8,9,19]). > > [1,6,2,19,5,7,9,3,8,4] > > > > > shuffle_list:shuffle([1,2,3,4,5,6,7,8,9,19], fun > > random:uniform_s/1, random:seed()). > > {[19,2,5,3,7,9,8,6,1,4],{28186,30068,19371}} > > > > I do not believe that it is a "must have function", just a suggestion. > > > > I propose a fun for the random function, to able to provide a other > > pseudo-random number generator (PRNG) then the random module. > > For example a cryptographically secure pseudo-random number generator (CSPRNG) > > > > > > Regards > > Andreas Hillqvist > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > From andreas.hillqvist@REDACTED Thu Jan 31 17:35:59 2008 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Thu, 31 Jan 2008 17:35:59 +0100 Subject: [erlang-questions] Newbie: Problem TCP connection erlang-python In-Reply-To: References: <200801311436.33405.kettlgruber@gmail.com> Message-ID: <8268eea30801310835q6af87136p2d4d52e906d6cc31@mail.gmail.com> Just a small note: Both raw and 0 stand for that no packaging is done. So there should be no difference between: {packet, 0} or {packet, raw} Regards Andreas Hillqvist 2008/1/31, Jani Launonen : > Should there be socket option {packet, 0} --- i.e. there's no header bytes. > > ----- Alkuper?inen viesti ----- > L?hett?j?: Gerald Kettlgruber > P?iv?ys: torstai, tammikuu 31, 2008 2:58 pm > Aihe: [erlang-questions] Newbie: Problem TCP connection erlang-python > Vastaanottaja: erlang-questions@REDACTED > > > > > > Hello, > > I have a problem concerning a tcp connection between an erlang > > server and a > > python client. > > The problem is, that on the server I receive the message, but > > the format > > doesn't match. I tried to specify the bits, but this doesn't > > worked either. > > > > This is what the server looks like: > > start(Port, Id) -> > > {ok, Listen} = gen_tcp:listen (Port, [binary, > > {active,true},{reuseaddr,true}]), > > accept(Listen, Id). > > accept(Listen, Id)-> > > {ok, Socket} = gen_tcp:accept(Listen), > > gwe_server:start_agent(tcp_agent, accept, > > [Listen]), loop(Socket, Id). > > loop(Socket, Id) -> > > receive > > {tcp, Socket, Bin} -> > > <> = > Bin, > > loop(Socket, Id); > > end. > > > > Python Client looks like this: > > > > I pack the data with: > > data = [1,2,3,4,5] > > format= ">iiiii" > > msg = struct.pack(format,*data) > > size = struct.calcsize(format) > > > > and then send it with > > sent = self.sock.send(msg[totalsent:]) > > > > Would be nice if anyone can help me. > > Thanks, > > Gerald Kettlgruber > > _______________________________________________ > > 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 kettlgruber@REDACTED Thu Jan 31 19:10:09 2008 From: kettlgruber@REDACTED (Gerald Kettlgruber) Date: Thu, 31 Jan 2008 19:10:09 +0100 Subject: [erlang-questions] Newbie: Problem TCP connection erlang-python In-Reply-To: <8268eea30801310835q6af87136p2d4d52e906d6cc31@mail.gmail.com> References: <200801311436.33405.kettlgruber@gmail.com> <8268eea30801310835q6af87136p2d4d52e906d6cc31@mail.gmail.com> Message-ID: <200801311910.09930.kettlgruber@gmail.com> Thx, I found out, that the problem is on the python side, where packaging is done. Regards Gerald Kettlgruber Am Donnerstag, 31. Januar 2008 17:35:59 schrieb Andreas Hillqvist: > Just a small note: > Both raw and 0 stand for that no packaging is done. > So there should be no difference between: > {packet, 0} or {packet, raw} > > > Regards > Andreas Hillqvist > > 2008/1/31, Jani Launonen : > > Should there be socket option {packet, 0} --- i.e. there's no header > > bytes. > > > > ----- Alkuper?inen viesti ----- > > L?hett?j?: Gerald Kettlgruber > > P?iv?ys: torstai, tammikuu 31, 2008 2:58 pm > > Aihe: [erlang-questions] Newbie: Problem TCP connection erlang-python > > Vastaanottaja: erlang-questions@REDACTED > > > > > Hello, > > > I have a problem concerning a tcp connection between an erlang > > > server and a > > > python client. > > > The problem is, that on the server I receive the message, but > > > the format > > > doesn't match. I tried to specify the bits, but this doesn't > > > worked either. > > > > > > This is what the server looks like: > > > start(Port, Id) -> > > > {ok, Listen} = gen_tcp:listen (Port, [binary, > > > {active,true},{reuseaddr,true}]), > > > accept(Listen, Id). > > > accept(Listen, Id)-> > > > {ok, Socket} = gen_tcp:accept(Listen), > > > gwe_server:start_agent(tcp_agent, accept, > > > [Listen]), loop(Socket, Id). > > > loop(Socket, Id) -> > > > receive > > > {tcp, Socket, Bin} -> > > > <> = > > > > Bin, > > > > > loop(Socket, Id); > > > end. > > > > > > Python Client looks like this: > > > > > > I pack the data with: > > > data = [1,2,3,4,5] > > > format= ">iiiii" > > > msg = struct.pack(format,*data) > > > size = struct.calcsize(format) > > > > > > and then send it with > > > sent = self.sock.send(msg[totalsent:]) > > > > > > Would be nice if anyone can help me. > > > Thanks, > > > Gerald Kettlgruber > > > _______________________________________________ > > > 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 per@REDACTED Thu Jan 31 18:37:43 2008 From: per@REDACTED (Per Hedeland) Date: Thu, 31 Jan 2008 18:37:43 +0100 (CET) Subject: [erlang-questions] Newbie: Problem TCP connection erlang-python In-Reply-To: <8268eea30801310835q6af87136p2d4d52e906d6cc31@mail.gmail.com> Message-ID: <200801311737.m0VHbhCq079947@pluto.hedeland.org> "Andreas Hillqvist" wrote: > >Just a small note: >Both raw and 0 stand for that no packaging is done. >So there should be no difference between: >{packet, 0} or {packet, raw} And furthermore it's the default anyway (what else would it be?:-). However, to Gerald, that type of code won't work in the general case - you have no guarantee that a chunk of data you send down a TCP socket comes out as one chunk at the other end => use one of the {packet, N} (N /= 0) options (with the equivalent change at the Python side, of course). --Per Hedeland From fess-erlang@REDACTED Thu Jan 31 18:53:39 2008 From: fess-erlang@REDACTED (fess) Date: Thu, 31 Jan 2008 09:53:39 -0800 Subject: [erlang-questions] Eunit multinode test help. In-Reply-To: <47A19DDA.3060103@it.uu.se> References: <47A19DDA.3060103@it.uu.se> Message-ID: On Jan 31, 2008, at 2:07 AM, Richard Carlsson wrote: > fess wrote: >> Where is the best place for questions about eunit? I can't find >> any hints of mailing lists or forums [ except a comments trail >> http:// support.process-one.net/doc/display/CONTRIBS/EUnit which >> looks inappropriate. ] > > There is no separate list, so this one is probably the best place. > > I'll try to look at this as soon as I can. It looks like an internal > error. It might be that the fun-name mangling has changed in R12. Looks like I'm using 11b-5-1. also, just making remote calls in my tests myself seems to work. (see below) Let me know if you need any other info. --fess remote_apply_test_() -> { _, _, RN } = get_rnode_atoms(), { node, RN, { setup, fun start_node_test_setup/0, fun start_node_test_cleanup/1, ?_assert(remote_apply(RN, fun() -> true end)) }}. remote_apply(Node, Fun) -> remote_apply(Node, Fun, []). remote_apply(Node, Fun, Args) -> rpc:call(Node, erlang, apply, [ Fun, Args ], 5000). From gleber.p@REDACTED Thu Jan 31 19:31:49 2008 From: gleber.p@REDACTED (Gleber) Date: Thu, 31 Jan 2008 19:31:49 +0100 Subject: [erlang-questions] Erlang C Communication - process completes but nodes are not connected In-Reply-To: References: Message-ID: <14f0e3620801311031y7705ba76l81776d4803222f02@mail.gmail.com> Hello. This is my first post to this list, so i'm sorry for any mistakes :) IIRC, C nodes are hidden nodes, hence net_adm:world() will not show them. Use nodes(hidden). to list hidden nodes. Regards, Gleb Peregud On 1/31/08, J Bhanot wrote: > Hi, > > I am using C node as client > [] > > #include > #include > #include > #include > #include > #include > #include > > #include "erl_interface.h" > #include "ei.h" > > #define PORT 6666 > > int sockfd, epmdfd; > > main() > { > > struct in_addr addr; > erl_init(NULL, 0); > > printf("Initializing ..."); > if(!erl_connect_init(69, "SFEWRG34AFDSGAFG35235", 0)) > { > printf("\nerror in initialisation"); > erl_err_sys("erl_connect_init"); > printf("\nafter error in init"); > } > printf(" done.\n"); > printf("node=%s, host=%s, alive=%s, creation=%d\n ", > erl_thisnodename(), erl_thishostname(), > erl_thisalivename(), erl_thiscreation()); > > > > > /*This is the short host name outgoing connect routine */ > printf("Connecting ..."); > usleep(5000); > getchar(); //for checking > if((sockfd = erl_connect("node1@REDACTED")) < 0) > > // if((sockfd = erl_connect("")) < 0) > { > printf("in error"); > erl_err_sys("erl_connect"); > } > printf("\nsock = %d\n", sockfd); > erl_err_sys("erl_connect"); > printf(" done.\n"); > > } > > [/code] > > and Erlang node as server 'node1@REDACTED' > > Steps to run Erlang node : > > > erl -setcookie SFEWRG34AFDSGAFG35235 -name node1 > Created a file named $HOME/.hosts.erlang having contents as > 'node1@REDACTED'. > 'c69@REDACTED'. > > > The output for c file upon execution is > > [root@REDACTED otp_src_R12B-0]# ./mytest > Initializing ... done. > node=c69@REDACTED, host=localhost, alive=c69, creation=0 > Connecting ... > sock = 3 > erl_connect: Success > > > but at erlang node when i execute the command : > (node1@REDACTED)8> net_adm:world(). > > i get the output as : > [] > > similalry > > (node1@REDACTED)9> nodes(). > [] > (node1@REDACTED)10> > > > That is no node is connected to it.... > > Now the point is C node has successfully connected .... > > Why Erlang node is not showing it as connected.... > > Do we need to register the C node with EPMD even when it is acting as a > client... > > Do we need to register Erlang node with EPMD as well and if yes the how do > we do that.. > > Note : I am using putty to connect to single linux server (FC8). > > Appreciate your help... > > Many Thanks, > > jb > > > > > > ____________________________________________ > =====-----=====-----===== > Notice: The information contained in this e-mail > message and/or attachments to it may contain > confidential or privileged information. If you are > not the intended recipient, any dissemination, use, > review, distribution, printing or copying of the > information contained in this e-mail message > and/or attachments to it are strictly prohibited. If > you have received this communication in error, > please notify us by reply e-mail or telephone and > immediately and permanently delete the message > and any attachments. Thank you > > > -- Gleb Peregud http://gleber.pl/ "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." -- Albert Einstein