From james@REDACTED Thu Jan 1 00:05:29 2004 From: james@REDACTED (James Hague) Date: Wed, 31 Dec 2003 17:05:29 -0600 Subject: Small poll Message-ID: <3FF301D9.25204.172BFE@localhost> Joachim Durchholz wrote: >Warnings are useful for those things that >newbies often fall trap to: these should be >warnings. Or at least warnings that can be >switched on using a compiler option. I agree in principle, but then you see newbies making errors that you can't check for: second([x,y|t]) -> y. Where x, y, and t were intended to be variables, not atoms. Or using "/" instead of "div". Or the more common case of calling an external function with the wrong number of parameters, or simply a non- existant external function (which, I admit, would be nice to check for, though not so simple). It's a slippery slope to try to fix all of these at compile time, and it isn't clear that an overly pedantic compiler is a worthy goal. There should at least be consistent principles for what is warned about and what isn't. That said, I still like the new warning for "This statement will never match," maybe just because I've seen similar warnings in ML- like languages. From joachim.durchholz@REDACTED Thu Jan 1 14:06:58 2004 From: joachim.durchholz@REDACTED (Joachim Durchholz) Date: Thu, 01 Jan 2004 14:06:58 +0100 Subject: Small poll In-Reply-To: <3FF301D9.25204.172BFE@localhost> References: <3FF301D9.25204.172BFE@localhost> Message-ID: <3FF41B72.8030201@web.de> James Hague wrote: > Joachim Durchholz wrote: > >>Warnings are useful for those things that >>newbies often fall trap to: these should be >>warnings. Or at least warnings that can be >>switched on using a compiler option. > > I agree in principle, but then you see newbies making errors that you > can't check for: Right. It's impossible to flag all newbie errors anyway. But every error that gets flagged will make the learning curve less steep, which is generally a Good Thing IMHO. Once people get used to the issues (iow as soon as the warnings become more annoying than helpful), they'll turn warnings off. Just my 2c, back to lurk mode :-) Regards, Jo From thomas@REDACTED Thu Jan 1 15:18:24 2004 From: thomas@REDACTED (Thomas Lange) Date: Thu, 01 Jan 2004 15:18:24 +0100 Subject: trailing a growing file In-Reply-To: <20031231013755.GA30880@spearce.org> References: <001401c3cefc$f89439d0$1474010a@raphael> <20031231013755.GA30880@spearce.org> Message-ID: <3FF42C30.6040101@corelatus.se> Debian Linux has "fam - file alteration monitor" From manual: "fam is informed of filesystem changes as they happen by the kernel through the DNotify fcntl available in current 2.4.x kernels." /Thomas Shawn Pearce wrote: > tail -f just does the same thing you are doing by reading the log, > hitting EOF, and waiting a short while. > > Classic UNIX/POSIX doesn't have a way to get new data from a file, or > to find out when a file/directory is modified - applications just have > to poll. > > FreeBSD and IRIX (that I know of) have methods where an application > can open a directory or file, and tell the OS it is interested in > being notified when a change is made. Then you read from it and > carry on. Under IRIX this is called FAM (File Activity Monitor). I > don't know what FreeBSD calls it; and to my knowledge Linux does not > have support for this. > > If the log writer is another Erlang node I would suggest just sending > the log data to the target node, as well as write it to disk. If the > log writer is an external process, well, you are stuck. If it is a > syslogd maintained file, perhaps you could put an Erlang node into the > list of targets syslogd will write the logs to. > > If the log writer is anything else, you'll need to either patch the > application (example would be with Apache build or reuse a mod_* that > can send the logs over the network to an Erlang node), or just poll > the log file... > > If it was me, I'd be polling from within Erlang using a raw file (so > no extra process is started) rather than using a port to tail -f. > > > Raphael Bellec wrote: > >> >>Hello, >>I am actually working on a multi-log multi-host monitoring (and >>reacting) system, made in erlang and I need some advice: >> >>I would like to read logs file as soon as data is written to them. I >>actually have found 2 ways for this purpose: >>- With Io module, pooling (each time I get an eof, I wait a small time >>then try again). >>- With ports, spawning "tail -f -n 1 /path/to/file", which is the method >>I currently use. >> >>Is there a other way to "receive" news lines as they are written in the >>file without pooling or using an external application? I read few >>messages saying that there was no blocking IO in erlang, but I think >>this was mainly from a VM perspective. (I will have few hundreds logs to >>monitor) >> >>I currently use the port solution and I sometimes have a "broken pipe" >>error, I think this is because of the "in" parameter in open_port, but I >>hat it sometime without this parameter, anybody have a more detailed >>explanation of what could happen ? >> >>Regards. >> >>Rapha?l. >> >>Ps: the subject is directly taken from a point in the erlang PLEAC which >>is still empty. > > From erlang@REDACTED Sat Jan 3 01:20:59 2004 From: erlang@REDACTED (Inswitch Solutions - Erlang Evaluation) Date: Fri, 2 Jan 2004 21:20:59 -0300 Subject: Tariff Table - Tuple Key Pattern Matching Message-ID: <004a01c3d18f$7aa68dd0$0c00a8c0@daniel> Hi, I hope someone can give as some help about this issue. We are trying to optimize mnesia access time, to phone tariff tables. This tariff tables, have about 4000 entries each. The index is a tuple key as follows: {"Tariff_Table_Name","Prefix"} where Tariff_Table_Name, is the name of the Tariff plan that applies to the subscriber And Prefix, is a string, the first digits of the called number. So our queries are (Tariff Table Name="TARIFF"): MatchHead = #tarifftable{tarifftablekey='$1', _='_'}, Guard = [{'==',{element,1,'$1'}, "TARIFF"}], Result = '$1', Select = fun() -> mnesia:select(tarifftable,[{MatchHead, Guard, [Result]}]) end, {atomic, Res} = mnesia:transaction(Select), Res. So, as a result, it brings 4000 tuples, of the form "{"Tariff_Table_Name","Prefix"} Later the application searches for the "prefix" that better martches the called number (the prefix is a substring of the called number). My question is, instead of bringing all 4000 tuples, can I bring just the most similar "Prefix", like the one which have an specific first caracter? So instead of bringing 4000 tuples, I may bring just the most similar ones (the prefixes which are more similar to the destination number?) Best Regards, daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandrashekhar.mullaparthi@REDACTED Mon Jan 5 11:50:36 2004 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Mon, 05 Jan 2004 10:50:36 +0000 Subject: Mnesia data capabilities In-Reply-To: <00ca01c3ce71$f9eab240$0f00a8c0@daniel> Message-ID: Hi Daniel, We store about 15 million records in mnesia. This is how it is. The whole table is split across two nodes. The customer table is split into 128 fragments, and there are 64 fragments in each node. To minimise the effect of partitioned networks, both nodes reside on the same physical hardware. Mnesia on these two nodes is replicated to two nodes on another machine. Each node takes up about 1.5GB physical memory. It has been quite stable - it has been up and running since February last year. cheers Chandru On 30/12/03 1:12 am, "Inswitch Solutions - Erlang Evaluation" wrote: > Hi, > > I would appreciate if anybody can give us some advice about mnesia, as we have > seen certain limitations, in terms of mnesia tables and data size, which we > can not precisely know. So, we wonder if there is an optimum relationship > among the number of tables and the size of each table for a certain amount of > records, of a certain size to be saved. > > Let me describe you our situation: we would like to migrate 10.000.000 > records, from a file server to a mnesia database: > > The information on the file server, is in text format, (each line is a record > of 100 bytes) as follows: > > It contains a complex directory structure, with 100.000 files, and each of the > files has 100 lines of 100 bytes each. As I mentioned, each line is one > ?record? with phone user data. Initially, all we want to do is to remove the > file server, so we are not creating a set of fields for each record. Instead, > we are considering each record as a single piece of information. > > So, my question is how to build/distribute a set of tables in a ?mnesia safe > structure? that could hold this amount of records (10.000.000 records) in an > optimum configuration > > We have initially considered the following alternatives: > > 1) Creating 1000 tables, with 10.000 records each. Tables have been > created, but it crashes with ?mnesia info?, with the tables empty > 2) 100 tables, with 100.000 records each > 3) One huge table (10.000.000 records) partitioned > > > Best Regards, > > daniel > > From rvg@REDACTED Mon Jan 5 07:52:41 2004 From: rvg@REDACTED (Rudolph van Graan) Date: Mon, 5 Jan 2004 08:52:41 +0200 Subject: Tariff Table - Tuple Key Pattern Matching In-Reply-To: <004a01c3d18f$7aa68dd0$0c00a8c0@daniel> References: <004a01c3d18f$7aa68dd0$0c00a8c0@daniel> Message-ID: Hi Daniel, Why don't you use mnemosyne for this? I haven't compiled this fragment, so you might find some bugs here. The general idea is to use match clauses for the tests. In this case, if a clause doesn't match, the record is not returned. You can modify this to have more intelligent tests that not only tests for a first char match. find_tariffs(TableName,Tariff) -> Handle = query [ T || T <- table(tarifftable), {TariffTable,TariffValue} = T. tarifftablekey, %Extract the two values from the key [FirstChar|Rest] = TariffValue, %Extract the first char from the Tariff value [FirstChar|RestOfTariff] = Tariff ] %Test the input tariff against the input tariff end, QuerySetup = mnemosyne:setup_query(Handle), R = mnesia:transaction( fun() -> Cursor = mnemosyne:init_query(QuerySetup), mnemosyne:all_answers(Cursor) end). Regards, Rudolph On Jan 3, 2004, at 2:20 AM, Inswitch Solutions - Erlang Evaluation wrote: > Hi, > > I hope someone can give as some help about this issue. We are trying > to optimizemnesiaaccess time, to phone tariff tables. > This tariff tables, have about 4000 entries each. > > ?The index is a tuplekey as follows: > > {?Tariff_Table_Name?,?Prefix?} > > where > > Tariff_Table_Name, is the name of the Tariff plan that applies to the > subscriber > And > Prefix, is a string, the first digits of the called number. > > So our queries are (Tariff Table Name=?TARIFF?): > > MatchHead= #tarifftable{tarifftablekey='$1', _='_'}, > ?Guard = [{'==',{element,1,'$1'}, "TARIFF"}], > ?Result = '$1', > ?Select =fun() -> > ????????? ????mnesia:select(tarifftable,[{MatchHead, Guard, [Result]}]) > ???????? ? end, > > ?{atomic,Res} =mnesia:transaction(Select), > ?Res. > > So, as a result, it brings 4000tuples, of the form > ?{?Tariff_Table_Name?,?Prefix?} > > Later the application searches for the ?prefix? that bettermartchesthe > called number (the prefix is a substring of the called number). My > question is, instead of bringing all 4000tuples, can I bring just the > most similar ?Prefix?, like the one which have anspecific > firstcaracter? So instead of bringing 4000tuples, I may bring just the > most similar ones (the prefixes which are more similar to the > destination number?) > > > Best Regards, > > daniel > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4317 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2112 bytes Desc: not available URL: From Nigel.Head@REDACTED Mon Jan 5 12:49:57 2004 From: Nigel.Head@REDACTED (Nigel.Head@REDACTED) Date: Mon, 5 Jan 2004 12:49:57 +0100 Subject: Mnesia remote read behaviour ? Message-ID: <41256E12.0041EC0A.00@esocmail2.esoc.esa.int> I'm considering some basic architecture for a large networked system, which would use mnesia heavily ... Looking into network traffic issues prompts me to ask whether anyone can explain to me how mnesia chooses which node to use for a remote table read, assuming that I might have several replicas scattered around, some disc_copies, some ram_copies, some disc_only_copies, but none on the current node. What I am hoping for is to find out that that remote reads might be sent to other nodes on the same host in preference to creating external network traffic .... or if this isn't the case by default how I might organise that it happen that way? Additionally, choosing a ram or disc copy over a disc_only copy would be nice ..... BTW: I've been plunging around the mnesia source but I can't seem to find the right place to figure this for myself so a pointer into the source would help reduce the level of future dumb queries :-) Thanks, Nigel. From micke@REDACTED Mon Jan 5 19:53:41 2004 From: micke@REDACTED (Michael Fogeborg) Date: Mon, 05 Jan 2004 19:53:41 +0100 Subject: does erlang work with linux-bios ? Message-ID: <5.1.0.14.1.20040105195246.00baa8c0@online.no> does erlang work with linux-bios ? ... anyone here tried it ? From enano@REDACTED Mon Jan 5 20:04:19 2004 From: enano@REDACTED (Miguel Barreiro) Date: Mon, 5 Jan 2004 20:04:19 +0100 (CET) Subject: does erlang work with linux-bios ? In-Reply-To: <5.1.0.14.1.20040105195246.00baa8c0@online.no> References: <5.1.0.14.1.20040105195246.00baa8c0@online.no> Message-ID: > does erlang work with linux-bios ? > ... anyone here tried it ? Never tried, but can't think of any reason why it shouldn't. From sean.hinde@REDACTED Mon Jan 5 22:41:41 2004 From: sean.hinde@REDACTED (Sean Hinde) Date: Mon, 5 Jan 2004 21:41:41 +0000 Subject: Tariff Table - Tuple Key Pattern Matching In-Reply-To: <004a01c3d18f$7aa68dd0$0c00a8c0@daniel> References: <004a01c3d18f$7aa68dd0$0c00a8c0@daniel> Message-ID: On 3 Jan 2004, at 00:20, Inswitch Solutions - Erlang Evaluation wrote: > > > I hope someone can give as some help about this issue. We are trying > to optimizemnesiaaccess time, to phone tariff tables. > > This tariff tables, have about 4000 entries each. > > ?The index is a tuplekey as follows: > {?Tariff_Table_Name?,?Prefix?} Hi, We use an enhanced version of the contrib by Klacke for such digit analysis. I make no apology for the beauty (or absence of such ..) of my enhancements, but it is pretty fast and had the benefit of different types of digit search and analysis. We have ended up with two modules which do this - one is derived from the other, but the more generic (num_anal) has a problem with deleting parts of analysis trees which I fixed in bw_list.erl. If you successfully port the delete fixes from bw_list.erl to num_anal.erl perhaps you might let me have the results :) And there is actually some basic documentation - wow was I keen that day! Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: num_anal.erl Type: application/octet-stream Size: 7407 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: bw_list.erl Type: application/octet-stream Size: 10315 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- From vances@REDACTED Tue Jan 6 08:56:30 2004 From: vances@REDACTED (Vance Shipley) Date: Tue, 6 Jan 2004 02:56:30 -0500 Subject: MMS Erlang tools? Message-ID: <20040106075630.GA72050@frogman.motivity.ca> Are there any tools available for formatting 3GPP MMS available in Erlang? I'd like to create MMS messages to send my cool new camera phone. :) -Vance From seungbong_han@REDACTED Tue Jan 6 13:28:23 2004 From: seungbong_han@REDACTED (SEUNG BONG HAN) Date: Tue, 6 Jan 2004 04:28:23 -0800 (PST) Subject: leex newbie question Message-ID: <20040106122823.19963.qmail@web10101.mail.yahoo.com> Hi. I just started to learn leex and I have a hard time figure out how to write the scanner. Here is my simple test lex grammar : test1.xrl : Definitions. D = [0-9] H = [0-9a-fA-F] WS = [\000-\040] A = [a-zA-Z@REDACTED] Rules. {D}+\.{D}+((E|e)(\+|\-)?{D}+)? : {token,{float,YYline,YYtext}}. {D}+ : {token, {integer, YYline, YYtext}}. 0[xX]{H}+ : {token, {hex, YYline, YYtext}}. ([a-z]({A}*)) : {token, {word, YYline, YYtext}}. [!?/;:,.*+#()[\]|<>={}-] : {token,{list_to_atom(YYtext),YYline}}. {WS}+ : . After generate the scanner and execute the function test1:string("hello") I expected to see {ok, [{word, 1, "hello"}],1}. However, I got {error, {1,test1, {illegal, "hello"}. What did I do wrong? regards. --------------------------------- Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes -------------- next part -------------- An HTML attachment was scrubbed... URL: From Stefan.Fritzsche@REDACTED Tue Jan 6 18:15:16 2004 From: Stefan.Fritzsche@REDACTED (Stefan Fritzsche) Date: Tue, 6 Jan 2004 18:15:16 +0100 (MET) Subject: Megaco-Parser and IPv6-addresses Message-ID: <17874.1073409316@www57.gmx.net> Hello Dear Mailing-List, I did take a look at the Erlang-Megaco-Parser and wonder if the Megaco-Parser correctly parses IPv6-addresses. In the RFC 3525 chapter 15.2 IPv6-Addresses are defined as following: domainAddress = "[" (IPv4address / IPv6address) "]" IPv6address = hexpart [ ":" IPv4address ] hexpart = hexseq "::" [ hexseq ] / "::" [ hexseq ] / hexseq hexseq = hex4 *( ":" hex4) hex4 = 1*4HEXDIG This means that an IPv6-Address might contain one ore more colons (":"). In contrast to that, the Erlang-Text-Parser defines domain-addresses as a "safeToken" in square-brackets (without to differentiate between IPv4- and IPv6- Addresses), whereas a "safeToken" cannot contain any colon!? because: - 'safeToken' is derived from 'SafeChars' - 'SafeChars' is derived from ({safechar})+ - and 'safechar' is defined as: ({digit}|{alpha}|[\+\-\&\!\_\/\'\?\@\^\`\~\*\$\\\(\)\%\|\.]) ... no colon for IPv6-Addresses It might might be, that I'm totally wrong. I didn't try this, because I do not have any experience with erlang. But as far as I can see IPv6-addresses can't get parsed correctly. So ... am I wrong? Best Regards and Thanks in Advance, Stefan Fritzsche -- +++ GMX - die erste Adresse f?r Mail, Message, More +++ Neu: Preissenkung f?r MMS und FreeMMS! http://www.gmx.net From dgud@REDACTED Wed Jan 7 10:37:59 2004 From: dgud@REDACTED (Dan Gudmundsson) Date: Wed, 7 Jan 2004 10:37:59 +0100 Subject: Mnesia remote read behaviour ? In-Reply-To: <41256E12.0041EC0A.00@esocmail2.esoc.esa.int> References: <41256E12.0041EC0A.00@esocmail2.esoc.esa.int> Message-ID: <16379.54135.289286.596391@rian.du.uab.ericsson.se> Nigel.Head@REDACTED writes: > What I am hoping for is to find out that that remote reads might be sent to > other nodes on the same host in preference to creating external network traffic > .... or if this isn't the case by default how I might organise that it happen > that way? > > Additionally, choosing a ram or disc copy over a disc_only copy would be nice > ..... > > BTW: I've been plunging around the mnesia source but I can't seem to find the > right place to figure this for myself so a pointer into the source would help > reduce the level of future dumb queries :-) > > Thanks, > Nigel. > It picks the first node from a list :-) And it prefers nodes which are ram_copies or disc_copies. The specific code is here: mnesia_lib:set_remote_where_to_read/2 /Dan -- Dan Gudmundsson Project: Mnesia, Erlang/OTP Ericsson Utvecklings AB Phone: +46 8 727 5762 UAB/F/P Mobile: +46 70 519 9469 S-125 25 Stockholm Visit addr: Armborstv 1 From bjorn@REDACTED Wed Jan 7 13:38:58 2004 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 07 Jan 2004 13:38:58 +0100 Subject: Small poll In-Reply-To: <004101c3cf2d$bc8f6d20$8300a8c0@virding.org> References: <200312220358.hBM3wiRA164239@atlas.otago.ac.nz> <004101c3cf2d$bc8f6d20$8300a8c0@virding.org> Message-ID: "Robert Virding" writes: > This discussion just goes on :-) > > I still have not seen any good reasons to change my viewpoint, in fact I have got a few to become even more restrictive: > > 1. a+42, 1=2, etc are all legal expressions even if they generate errors when evaluated. As errors have meaning in Erlang then you can't just forbid them. I agree. > 2. Many of the warnings generated by the compiler have been chosen in an extremely ad hoc fashion, they were deemed useful by someone and easy to implement. There is really no clear policy for what is checked and what is not. I mean why check the arguments to io:format and not a host of other common library functions. Especially considering that io:format is easy to guard against. Richard O'Keefe wrote some good stuff about the problems of getting the right level of checking. I disagree. The warnings for io:format were implemented because many users often DID make mistakes. Furthermore, io:formats in error handling might not have been properly tested, so the first time the error handling code was actually executed it crashed. Also, it was not particularily easy to add the io:format code. We have had quite a bit work keeping the checks correct. So that is bad example of something we added because it was easy. > > 3. With this in mind then Bjorn's new checks are probably a bad idea, the warnings become even more ad hoc and difficult to understand. I wonder if maybe some of the existing warnings should be removed. I still say that many of the warnings give very little and some are a right pain.*** In old versions of OTP, there were warnings for imports that you didn't use and for exporting variables out of case statements. We have turned off those warnings by default. > > 4. You cannot have the option of forbidding legal code, no matter how stupid it may seem. The compiler must handle all legal code. Trying to guess and saying that 90% of the time the user wrote this then they made an error is not good enough. This is similat to the syntax change suggestion concerning =<< made earlier. > I agree. We don't forbid legal code, we just warn about it. > 5. I wonder if it is good for the compiler to try and use warnings to enforce a certain programming style? > > *** Two warnings that really anoy me are unused vars and unused functions. > > I seldom use '_', the anonymous variable, but prefer to give all variables names so I know what they are, even if I don't use them later. I DON'T LIKE the _Varname convention so why should the compiler try and enforce. Even if YOU don't like the _Varname convention, other people love it. Since we started to use the warn_unused_vars option, we have found many minor bugs in the OTP code. I have also found several bugs in Wings. That was in WORKING code; in the OTP code we also have extensive test suites. When I write new code, the warnings immediately inform me about a bug that otherwise could have taken me some time to find by testing. > Of course the alternative would be to ALWAYS use it. That would teach the compiler to mind its own business. :-) > You can also use the nowarn_unused_vars option. > When I define a data structure and its access functions I always define full range of access functions, even those which are not used. I think the structure and how it is intended to be used becomes clearer then. Having the compiler burn me with warnings is irritating to say the least. Yes I can wrap the unused ones in comments but then I don't get any checking. There should really be a way to turn off the warnings for unused functions. We might add a mechanism in R10 for doing that. > This has been done to me in the compiler code. As we don't want to see the warning in our daily builds, we had to comment out the functions. > Anyway what is wrong with defining unused functions? They don't hurt anyone and the compiler removes them from the code anyway. When maintaining other people's code (I am NOT talking about the compiler here), you often find stray functions that are left from a previous version of the module, but is no longer used. To summarize: IMO, every warning that helps you to find more bugs are useful. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bjorn@REDACTED Wed Jan 7 14:01:23 2004 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 07 Jan 2004 14:01:23 +0100 Subject: Small poll In-Reply-To: <3FF2AE01.22648.24A12D@localhost> References: <3FF2AE01.22648.24A12D@localhost> Message-ID: "James Hague" writes: > Robert Virding wrote: > >2. Many of the warnings generated by the > >compiler have been chosen in an extremely > >ad hoc fashion, they were deemed useful by > >someone and easy to implement. There is > >really no clear policy for what is checked > >and what is not. I mean why check the > >arguments to io:format and not a host of > >other common library functions. > > I tried to make this point in an earlier message, though I may not > have succeeded. I don't really want to see the compiler cluttered up > with a lot of checks for things that may or may not be errors, > especially when: > > 1. There are many more things that are not checked (for example, any > place where a newbie types "x" instead of "X"). Trying to catch them > all seems like a long and unproductive road to go down. (Okay, I > once complained about list comprehensions without generators being > quietly compiled, but I'd argue that's invalid Erlang.) Our intention is not to try to catch all possible errors. The new warnings I've added are emitted by the optimization passes. Instead of silently removing a clause that cannot possible match, a warning is produced. Thus, there is not a lot of extra code in the compiler. There were many warnings in the OTP code for clauses that could not match. Most of them harmless, of course, since the code is working, but the redundant clauses are confusing for anyone reading the code. I found a few redundant clauses in the compiler itself. > > 2. Simple, interactive testing catches all of these errors anyway, > even the ones that aren't warned about. > IMO, everything that help you find more bug is useful. When working against a tight dead-line, most people forget to do the simple test, to "save time". > Additionally, I think Erlang--both the language and implementation-- > are on the verge of becoming too complicated. I think both could use > some streamlining. Adding ad hoc warnings is a step in the other > direction. I see your point, but I consider the new warnings to be useful, and they did not add much complexity to the compiler. Maybe reduced the complexity, as I could clean up part of the code at the same time. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From micael.karlberg@REDACTED Wed Jan 7 17:48:56 2004 From: micael.karlberg@REDACTED (Micael Karlberg) Date: Wed, 7 Jan 2004 17:48:56 +0100 Subject: Megaco-Parser and IPv6-addresses In-Reply-To: <17874.1073409316@www57.gmx.net> References: <17874.1073409316@www57.gmx.net> Message-ID: <16380.14456.662475.91030@gargle.gargle.HOWL> Hi Stefan, You are not wrong. We only support IPv4 at the moment :( Thank's for pointing this out. We had forgotten all about it... An updated version will be released ASAP (see www.erlang.org/project/megaco) Regards, /BMK Stefan Fritzsche writes: > Hello Dear Mailing-List, > > I did take a look at the Erlang-Megaco-Parser and wonder > if the Megaco-Parser correctly parses IPv6-addresses. > > In the RFC 3525 chapter 15.2 IPv6-Addresses are defined > as following: > > domainAddress = "[" (IPv4address / IPv6address) "]" > IPv6address = hexpart [ ":" IPv4address ] > hexpart = hexseq "::" [ hexseq ] / "::" [ hexseq ] / hexseq > hexseq = hex4 *( ":" hex4) > hex4 = 1*4HEXDIG > > This means that an IPv6-Address might contain one ore > more colons (":"). > In contrast to that, the Erlang-Text-Parser defines > domain-addresses as a "safeToken" in square-brackets > (without to differentiate between IPv4- and IPv6- > Addresses), whereas a "safeToken" cannot contain > any colon!? > > because: > - 'safeToken' is derived from 'SafeChars' > - 'SafeChars' is derived from ({safechar})+ > - and 'safechar' is defined as: > ({digit}|{alpha}|[\+\-\&\!\_\/\'\?\@\^\`\~\*\$\\\(\)\%\|\.]) > > ... no colon for IPv6-Addresses > > It might might be, that I'm totally wrong. I didn't try > this, because I do not have any experience with erlang. > But as far as I can see IPv6-addresses can't get parsed > correctly. > > So ... am I wrong? > > > Best Regards and Thanks in Advance, > Stefan Fritzsche > > -- > +++ GMX - die erste Adresse f?r Mail, Message, More +++ > Neu: Preissenkung f?r MMS und FreeMMS! http://www.gmx.net -- Micael Karlberg Ericsson AB, ?lvsj? Sweden Tel: +46 8 727 5668 EAB/UHK/KD - OTP Product Development ECN: 851 5668 Mail: micael.karlberg@REDACTED Fax: +46 8 727 5775 From franck@REDACTED Wed Jan 7 18:20:40 2004 From: franck@REDACTED (Franck Arnaud) Date: Wed, 7 Jan 2004 17:20:40 +0000 (UTC) Subject: Bug in Erlang SMTP client? Message-ID: This is a long shot, sorry if I'm not in the right place. I'm running an SMTP email server and I've got sessions with franklin.telenor.se, which fail because this server is not standards-compliant and tries this: MAIL FROM: which is illegal, see RFC 2821 or 821, compared to the correct: MAIL FROM: All other senders I've seen implement this are spammers (who don't read RFCs), so not being tolerant helps a lot in reducing spam. I suspect the offending software is written in erlang (so maybe the author reading this list or known by someone from this list) because while franklin.telenor.se does not accept incoming SMTP, the MXs for the addresses (@beta.telenordia.se) reply with: 220 mailgw.tninet.se ESMTP BMR ErlangTM/OTP (3.1/3.3) [0s24906861zack]; 220 planb.telenor.se ESMTP BMR ErlangTM/OTP (3.1/3.3) [0s3542782lennier]; I've downloaded OTP from erlang.org and cannot find an SMTP implementation in there, although http://www.erlang.org/contrib/smtp_client-1.0.tgz seems to have the issue if I believe this: smtp_fsm.erl> Msg = ["mail from: ", Address, "\r\n"], but franklin.telenor.se uses uppercase (lowercase is standards compliant) so it may not be using this. From taj.khattra@REDACTED Thu Jan 8 04:17:37 2004 From: taj.khattra@REDACTED (Taj Khattra) Date: Wed, 7 Jan 2004 19:17:37 -0800 Subject: Bug in Erlang SMTP client? In-Reply-To: References: Message-ID: <20040108031737.GA23240@localhost.localdomain> On Wed, Jan 07, 2004 at 05:20:40PM +0000, Franck Arnaud wrote: > 220 mailgw.tninet.se ESMTP BMR ErlangTM/OTP (3.1/3.3) [0s24906861zack]; > 220 planb.telenor.se ESMTP BMR ErlangTM/OTP (3.1/3.3) [0s3542782lennier]; i think BMR == Bluetail Mail Robustifier, so you'll probably not find this in Erlang/OTP. -taj From kramer@REDACTED Thu Jan 8 08:41:50 2004 From: kramer@REDACTED (Reto Kramer) Date: Wed, 7 Jan 2004 23:41:50 -0800 Subject: long ping delay after network partition/process suspension Message-ID: <1E8E2BE9-41AE-11D8-9AF3-000393B64312@acm.org> I've written a simple test that measures the time an erlang ping takes among a set of nodes [using timer:tc(net_adm:ping())]. My test setup either suspends a beam process (^Z), or disconnect the network to that node. I see the ping hang until the net_tick timeout hits and the connection is removed due to the timeout. This is all great of course. However, even after the connection is removed =ERROR REPORT==== 7-Jan-2004::23:23:28 === ** Node a@REDACTED not responding ** ** Removing (timedout) connection ** I continue to see huge ping round trip times to a failed node (some 7 seconds). My expectation is that I should receive a "pang" really quickly (i.e. a few dozen millis max). Tuning the net_tick time down to e.g. 4s (rather than the default 60s) does not help. Note that my nodes do not use DNS names, so there's lag in some attempt to resolve names either. I've suspected epmd, but it seems that's not the culprit (tuned the packet_timeout to no effect, don't see any hanging resolution attempts with -d flag). Originally I hit this issue with a multi_call that includes nodes that can get partitioned away for some time. In that case, the timeout on the gen_server:multi_call is not getting honored and the call only seems to return after some half a dozend seconds in case a connection timed out. Further multi_calls with the same node set continue to return only after seconds despite the timed out connection. Looking at the source I can only suspect that {reg_name, node} ! Msg hangs for a long time if it tries to send on a timed out connection, but I refuse to belive this is so ;-) If this is so anyway, can I tell erl to not wait for the socket connection too long (i.e. <7s)? Can someone enlighten me how to work around this issue (what parameters to tune)? Thanks, - Reto From Reddy_P@REDACTED Thu Jan 8 12:26:52 2004 From: Reddy_P@REDACTED (Primanathan Reddy [ MTN - Innovation Centre ]) Date: Thu, 8 Jan 2004 13:26:52 +0200 Subject: time syncronization in erlang cluster Message-ID: <2451E2A019F0894BA7AF29CAD415A99109A57C@SDHMAIL.mtn.co.za> Hi! I have a cluster of erlang nodes setup, and wish to synchronize the time on the nodes in the cluster, i.e i want to sync the values returned by now() on each node without having to restart the erlang runtime. Any ideas if this can be done? Alternatively, Is it possible to re-sync now() with the system time? Thanks in advance Primanathan Reddy NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/email_disclaimer.asp From erlang@REDACTED Thu Jan 8 13:39:58 2004 From: erlang@REDACTED (Peter-Henry Mander) Date: Thu, 8 Jan 2004 12:39:58 +0000 Subject: time syncronization in erlang cluster In-Reply-To: <2451E2A019F0894BA7AF29CAD415A99109A57C@SDHMAIL.mtn.co.za> References: <2451E2A019F0894BA7AF29CAD415A99109A57C@SDHMAIL.mtn.co.za> Message-ID: <20040108123958.027e4794.erlang@manderp.freeserve.co.uk> Hi, What is the platform? If you're using a flavour of UNIX, you may wish to use NTP (network time protocol RFC 1305) and bypass Erlang for synchronisation. I imagine there are NTP clients and servers implemented for most platforms. Pete. On Thu, 8 Jan 2004 13:26:52 +0200 "Primanathan Reddy [ MTN - Innovation Centre ]" wrote: > Hi! > > I have a cluster of erlang nodes setup, and wish to synchronize the time on the nodes in the cluster, > i.e i want to sync the values returned by now() on each node without having to restart the erlang runtime. > > Any ideas if this can be done? > > Alternatively, Is it possible to re-sync now() with the system time? > > Thanks in advance > Primanathan Reddy > > > > NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/email_disclaimer.asp > -- "The Tao of Programming flows far away and returns on the wind of morning." From D.WILLIAMS@REDACTED Thu Jan 8 14:05:55 2004 From: D.WILLIAMS@REDACTED (WILLIAMS Dominic) Date: Thu, 8 Jan 2004 14:05:55 +0100 Subject: time syncronization in erlang cluster Message-ID: > I have a cluster of erlang nodes setup, and wish to synchronize the > time on the nodes in the cluster, i.e i want to sync the values > returned by now() on each node without having to restart the erlang > runtime. > > Any ideas if this can be done? > > Alternatively, Is it possible to re-sync now() with the system time? Intersting question. I wonder how that could be achieved without breaking the requirement that two subsequent calls to now() will never return the same value... I am also curious to hear how Erlang/OTP can help with this issue. In the meantime, here is my advice borne from my experience with real-time distributed systems in my pre-Erlang days: 1) If possible (in particular if its availability can be guaranteed), make all applications use the time provided by a time server (which you develop). This server should be the only place in your code where you access system time. Apart from synchronisation, this approach has the nice feature that when testing your application, you can cheat, and make the server provide a false time, which allows you to test various interesting situations (e.g. time changes, leap years... and brutal synchronisations!) and also lets you accelerate time very easily... 2) Use NTP to synchronize all the machines on your network. The real NTP protocol (though not Microsoft's SNTP...) has nice features such as millisecond precision, and actually adjusting the physical frequency of the system clock devices, so that even in the event of a network partition and thus temporary absence of synchronisation, individual clocks do not drift as much as they used to... In fact, NTP could help with the dilemna of resynchronising erlang:now() with the system clock without allowing for two subsequent calls returning the same thing, because NTP tries not to brutally resynchronize system clocks: it tends to slow them down or speed them up until they catch up, and then re-adjusts the frequency to keep them in sync... Hope this helps, Dominic Williams. From D.WILLIAMS@REDACTED Thu Jan 8 14:19:46 2004 From: D.WILLIAMS@REDACTED (WILLIAMS Dominic) Date: Thu, 8 Jan 2004 14:19:46 +0100 Subject: time syncronization in erlang cluster Message-ID: Hi Pete, > What is the platform? If you're using a flavour of UNIX, you > may wish to use NTP (network time protocol RFC 1305) and > bypass Erlang for synchronisation. I imagine there are NTP > clients and servers implemented for most platforms. Indeed, including Windows (just don't use Microsoft's built-in version, which is simplified, if you want the features I described in my previous post). However, this doesn't work, at least for Erlang systems running uninterruptedly, if the Erlang runtime only gets the system time at start-up... So I am interested in hearing more about that. Dominic Williams. From Nigel.Head@REDACTED Thu Jan 8 15:13:25 2004 From: Nigel.Head@REDACTED (Nigel.Head@REDACTED) Date: Thu, 8 Jan 2004 15:13:25 +0100 Subject: ASN.1 help please Message-ID: <41256E15.004F092B.00@esocmail2.esoc.esa.int> I'm attempting to compile a largeish chunk of an ASN.1 spec and am running into problems. The spec apparently compiles OK with other compilers (although I don't have any around to prove this to myself, so it's only hearsay). I've managed to reproduce the problem with a toy source file; as I'm an ASN.1 utter beginner I'd appreciate help as to what is wrong with this so that I can make the corrections to the real thing (which is a bit large to bother you all with !!). =================== source file ================= TEST DEFINITIONS ::= BEGIN Thing ::= INTEGER { fred (0) , fred2 (1) , fred3 (2) } AnotherThing ::= Thing ( fred | fred2 ) END =================== error message ============== (N1@REDACTED)5> asn1ct:compile('TEST'). Erlang ASN.1 version "1.4.2" compiling "TEST.asn1" Compiler Options: [] asn1error:10:'TEST':'AnotherThing' {asn1,{undefined_type_or_value,fred}} {error,{asn1,[{error,{type,10, 'TEST', 'AnotherThing', {asn1,{undefined_type_or_value,fred}}}}]}} N. From luke@REDACTED Thu Jan 8 16:07:49 2004 From: luke@REDACTED (Luke Gorrie) Date: 08 Jan 2004 16:07:49 +0100 Subject: Bug in Erlang SMTP client? In-Reply-To: References: Message-ID: Franck Arnaud writes: > This is a long shot, sorry if I'm not in the right place. Ever thought of opening a detective agency? :-) > I'm running an SMTP email server and I've got sessions with > franklin.telenor.se, which fail because this server is not > standards-compliant and tries this: > > MAIL FROM: > > which is illegal, see RFC 2821 or 821, compared to the correct: > > MAIL FROM: > > All other senders I've seen implement this are spammers (who > don't read RFCs), so not being tolerant helps a lot in > reducing spam. Nice catch, here's a patch. --- smtp_format.erl.~1.8.~ 1999-10-20 16:04:52.000000000 +0200 +++ smtp_format.erl 2004-01-08 16:00:24.000000000 +0100 @@ -13,10 +13,10 @@ -export([xtext_decode/1, xtext_encode/1]). from(Path) when record(Path, path) -> - "FROM: " ++ path(Path) ++ params(Path). + "FROM:" ++ path(Path) ++ params(Path). to(Path) when record(Path, path) -> - "TO: " ++ path(Path) ++ params(Path). + "TO:" ++ path(Path) ++ params(Path). %% Format thingies scanned with smtp_scan:path path(Path) when record(Path, path) -> Helpful eh? ;-) But seriously, sadly Bluetail doesn't support this product anymore. Possibly the current caretaker at Telenordia is reading this list and can make a fix though! Cheers, Bluetail Support -- Patches From Beyond the Grave From Michael.Bradford@REDACTED Thu Jan 8 16:43:17 2004 From: Michael.Bradford@REDACTED (Michael Bradford) Date: Thu, 8 Jan 2004 15:43:17 -0000 Subject: Bug in Erlang SMTP client? Message-ID: better late than never, here's a patch for the smtp_client-1.0 contribution as well. diff smtp_client-1.0/smtp_fsm.erl smtp_client-1.1/smtp_fsm.erl 15a16,17 > %% 1.1 fixes mail from & rcpt to bugs where they weren't > %% strictly standards compliant 55c57 < -vsn('v1.0'). --- > -vsn('v1.1'). 335c337 < Msg = ["mail from: ", Address, "\r\n"], --- > Msg = ["mail from:", Address, "\r\n"], 346c348 < Msg = ["rcpt to: ", Address, "\r\n"], --- > Msg = ["rcpt to:", Address, "\r\n"], I've also sent the new version (smtp_client-1.1) of the complete application to Erlang Contributions. cheers Mike NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From ulf.wiger@REDACTED Thu Jan 8 19:08:30 2004 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Thu, 08 Jan 2004 19:08:30 +0100 Subject: time syncronization in erlang cluster In-Reply-To: References: Message-ID: On Thu, 8 Jan 2004 14:19:46 +0100, WILLIAMS Dominic wrote: > Hi Pete, > >> What is the platform? If you're using a flavour of UNIX, you >> may wish to use NTP (network time protocol RFC 1305) and >> bypass Erlang for synchronisation. I imagine there are NTP >> clients and servers implemented for most platforms. > > Indeed, including Windows (just don't use Microsoft's built-in > version, which is simplified, if you want the features I > described in my previous post). > > However, this doesn't work, at least for Erlang systems running > uninterruptedly, if the Erlang runtime only gets the system time > at start-up... This is how erlang:now() works. At startup, it samples the system time, and then it starts running loosely coupled to the system time. That is, it periodically samples the system time and makes small adjustments (+/- 1%) so that it will eventually converge with the actual system time ("eventually" may be an arbitrarily long time, depending on what happens to the system time.) So to answer your initial question: you cannot synchronize erlang:now(), since it is designed to adjust itself to e.g. NTP, while preserving the property that subsequent calls to erlang:now() should always return unique values in increasing order. /Uffe -- Ulf Wiger From enewhuis@REDACTED Thu Jan 8 21:42:47 2004 From: enewhuis@REDACTED (Eric Newhuis) Date: Thu, 8 Jan 2004 14:42:47 -0600 Subject: gen_tcp buffering Message-ID: <379115C0-421B-11D8-AA33-000A95D9A520@wideopenwest.com> Does gen_tcp do any "user level" buffering of packets/binaries? And if it does then is there any way to report the number/size buffered? For both send and receive? From vlad_dumitrescu@REDACTED Fri Jan 9 08:37:59 2004 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 9 Jan 2004 08:37:59 +0100 Subject: How to automatically start an Erlang node at Emacs startup? Message-ID: Hi, Title says it all :-) I use this in my .emacs file (was posted by a kind person here, but I can't find the original): ;; let's start an erlang node just for distel (setq inferior-erlang-machine-options '("-sname" "emacs")) (save-window-excursion (erlang-shell) ) The problem is that after starting, there is no *erlang* buffer... Of course, running the command by hand works fine. I have a feeling that it used to work, but haven't been needing this lately. Anyone has a clue as for what is wrong? regards, Vlad From D.WILLIAMS@REDACTED Fri Jan 9 08:47:07 2004 From: D.WILLIAMS@REDACTED (WILLIAMS Dominic) Date: Fri, 9 Jan 2004 08:47:07 +0100 Subject: time syncronization in erlang cluster Message-ID: > This is how erlang:now() works. > [...] Peachy. Once again, I am struck by how elegantly and powerfully Erlang solves the common headaches of soft realtime distributed systems. You people have obviously "been there" ! Congratulations, and thanks for the information. Dominic Williams. From vlad_dumitrescu@REDACTED Fri Jan 9 08:51:47 2004 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 9 Jan 2004 08:51:47 +0100 Subject: Fw: How to automatically start an Erlang node at Emacs startup? Message-ID: A correction: the Erlang shell gets started, but gets terminated directly... If I insert a (sit-for 20), the shell can be seen. How can I find out what's happening? And also I am running Emacs 21.3 on Windows. /Vlad From Reddy_P@REDACTED Fri Jan 9 09:51:07 2004 From: Reddy_P@REDACTED (Primanathan Reddy [ MTN - Innovation Centre ]) Date: Fri, 9 Jan 2004 10:51:07 +0200 Subject: time syncronization in erlang cluster Message-ID: <2451E2A019F0894BA7AF29CAD415A991096A31@SDHMAIL.mtn.co.za> Hi Thanks for the helpful info on now(). I'm going to try NTP. Will keep the list updated on how it turns out. >:) Reddy.P[Prima] -----Original Message----- From: Ulf Wiger [mailto:ulf.wiger@REDACTED] Sent: Thursday, 08 January 2004 8:09 PM To: WILLIAMS Dominic; Erlang (E-mail) Subject: Re: time syncronization in erlang cluster On Thu, 8 Jan 2004 14:19:46 +0100, WILLIAMS Dominic wrote: > Hi Pete, > >> What is the platform? If you're using a flavour of UNIX, you >> may wish to use NTP (network time protocol RFC 1305) and >> bypass Erlang for synchronisation. I imagine there are NTP >> clients and servers implemented for most platforms. > > Indeed, including Windows (just don't use Microsoft's built-in > version, which is simplified, if you want the features I > described in my previous post). > > However, this doesn't work, at least for Erlang systems running > uninterruptedly, if the Erlang runtime only gets the system time > at start-up... This is how erlang:now() works. At startup, it samples the system time, and then it starts running loosely coupled to the system time. That is, it periodically samples the system time and makes small adjustments (+/- 1%) so that it will eventually converge with the actual system time ("eventually" may be an arbitrarily long time, depending on what happens to the system time.) So to answer your initial question: you cannot synchronize erlang:now(), since it is designed to adjust itself to e.g. NTP, while preserving the property that subsequent calls to erlang:now() should always return unique values in increasing order. /Uffe -- Ulf Wiger NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/email_disclaimer.asp From Robert.Feldt@REDACTED Fri Jan 9 10:32:19 2004 From: Robert.Feldt@REDACTED (Robert Feldt) Date: Fri, 09 Jan 2004 10:32:19 +0100 Subject: Any BEAM docs? Message-ID: <3FFE7523.50501@htu.se> Hi, I'm interested in understanding BEAM, especially the concurrency-related parts. Checking the FAQ the only docs seems to be for an older version on Bogdans home page at Ericsson. The link supplied in the FAQ is dead though. Searching the archives for this list it seems there is no docs for BEAM. Reading the source itself seems a bit intimidating (with around 80KLOC). Is there any overview description of BEAM? Or at least some hints on the structure of the BEAM source code? BEAM is said to be based on WAM. Are there any descriptions of the differences? Thanks in advance, Robert Feldt Robert.Feldt@REDACTED From kramer@REDACTED Fri Jan 9 03:53:15 2004 From: kramer@REDACTED (Reto Kramer) Date: Thu, 8 Jan 2004 18:53:15 -0800 Subject: Request for next net_kernel release: new switch "net_setuptime_millis" Message-ID: I found where the 7s ping/net_connect delay I was seeing if I was pinging (or multi_call'ing) a node who's connection had timeout comes from (see net_kernel excerpt below). I'm glad it's configurable (thanks for the foresight, whoever did it!), however I need it smaller than 1s, which is the current minimum I can set. Is there any chance that in the next release of the net_kernel we could add a new (equally undocumented, i.e. unsupported) switch: net_setuptime_millis? I suggest the net_setuptime switch dominates if present to maintain backwards compatibly. Funny enough, when the node in question (say c) never started in the first place, then a multi_call to [a,b,c] does not suffer from the connection setup delay, it's only because a connection (that timed out) had been setup initially that I see the kernel setuptime timeout/delay. Perhaps someone could educate me here - it seems that perhaps not all the data structures associated with the timed out connection are cleaned up (i.e. behavior is different from when the connection has never been created in the first place). Thanks, - Reto PS: in the meantime, I'll resort to removing the failed node from the nodeset I multicall to, and then re-add it using a multicast based discovery protocol (the latter I have anyway). It would be nice if my app could be naive about all that and just blindly multi_call to a node set. --------- net_kernel: --------- [...] %% Default connection setup timeout in milliseconds. %% This timeout is set for every distributed action during %% the connection setup. -define(SETUPTIME, 7000). [...] connecttime() -> case application:get_env(kernel, net_setuptime) of {ok, Time} when integer(Time), Time > 0, Time < 120 -> Time * 1000; _ -> ?SETUPTIME end. [...] --------- net_kernel: --------- ______________________ An engineer can do for a dime what any fool can do for a dollar. -- unknown -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2066 bytes Desc: not available URL: From ulf.wiger@REDACTED Fri Jan 9 13:33:48 2004 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Fri, 09 Jan 2004 13:33:48 +0100 Subject: time syncronization in erlang cluster In-Reply-To: <2451E2A019F0894BA7AF29CAD415A991096A31@SDHMAIL.mtn.co.za> References: <2451E2A019F0894BA7AF29CAD415A991096A31@SDHMAIL.mtn.co.za> Message-ID: Of course there's a catch: If the computer running the Erlang node is set for any other timezone than Universal Time (UDT), the system clock will make jumps that erlang:now() will not be able to adjust to within reasonable time. On Unix systems, one creative way of getting around this (if, for any reason, you can't run the whole system in UDT) is to use os:setenv/2 and set the TZ environment variable to UDT inside the Erlang node. Also, it's probably a good idea to have a background process sampling erlang:now() and time(), comparing the two. If the difference is too great (pick your definition of "too great"), it might be wise to restart the node. This is only really relevant if erlang:now() is ever used to sample time, which it shouldn't be. But if hi-res time is needed within Erlang, there is really no convenient option other than erlang:now(). A flaw, in my opinion. /Uffe On Fri, 9 Jan 2004 10:51:07 +0200, Primanathan Reddy [ MTN - Innovation Centre ] wrote: > Hi > > Thanks for the helpful info on now(). > > I'm going to try NTP. > > Will keep the list updated on how it turns out. > >> :) > Reddy.P[Prima] > > > -----Original Message----- > From: Ulf Wiger [mailto:ulf.wiger@REDACTED] > Sent: Thursday, 08 January 2004 8:09 PM > To: WILLIAMS Dominic; Erlang (E-mail) > Subject: Re: time syncronization in erlang cluster > > > On Thu, 8 Jan 2004 14:19:46 +0100, WILLIAMS Dominic > wrote: > >> Hi Pete, >> >>> What is the platform? If you're using a flavour of UNIX, you >>> may wish to use NTP (network time protocol RFC 1305) and >>> bypass Erlang for synchronisation. I imagine there are NTP >>> clients and servers implemented for most platforms. >> >> Indeed, including Windows (just don't use Microsoft's built-in >> version, which is simplified, if you want the features I >> described in my previous post). >> >> However, this doesn't work, at least for Erlang systems running >> uninterruptedly, if the Erlang runtime only gets the system time >> at start-up... > > This is how erlang:now() works. > > At startup, it samples the system time, and then it starts running > loosely coupled to the system time. That is, it periodically samples > the system time and makes small adjustments (+/- 1%) so that it > will eventually converge with the actual system time ("eventually" > may be an arbitrarily long time, depending on what happens to the > system time.) > > So to answer your initial question: you cannot synchronize erlang:now(), > since it is designed to adjust itself to e.g. NTP, while preserving the > property that subsequent calls to erlang:now() should always return > unique values in increasing order. > > /Uffe -- Ulf Wiger From sean.hinde@REDACTED Fri Jan 9 15:11:00 2004 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 9 Jan 2004 14:11:00 +0000 Subject: gen_tcp buffering In-Reply-To: <379115C0-421B-11D8-AA33-000A95D9A520@wideopenwest.com> References: <379115C0-421B-11D8-AA33-000A95D9A520@wideopenwest.com> Message-ID: On 8 Jan 2004, at 20:42, Eric Newhuis wrote: > Does gen_tcp do any "user level" buffering of packets/binaries? And > if it does then is there any way to report the number/size buffered? > For both send and receive? > > There is a socket option called 'buffer' which allows you to control the size of this for receiving data - the driver will accumulate this much before passing it into erlang. you should be able to get the value using inet:getopts(Sock, [buffer]). I have played with this option and it does seem to behave like this. Erlang also does buffering on the output side. I seem to recall from a previous post that if the socket would block the driver buffers data up to a certain amount, after which the sending erlang process blocks until something gives! The socket options high_watermark and low_watermark seem to be the things that control this, though at this point we are running into my ability to understand inet_drv.c rather than actual experimentation. Hope this helps. Sean From sean.hinde@REDACTED Fri Jan 9 15:55:32 2004 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 9 Jan 2004 14:55:32 +0000 Subject: gen_tcp buffering In-Reply-To: References: <379115C0-421B-11D8-AA33-000A95D9A520@wideopenwest.com> Message-ID: On 9 Jan 2004, at 14:11, Sean Hinde wrote: > The socket options high_watermark and low_watermark seem to be the > things that control this, though at this point we are running into my > ability to understand inet_drv.c rather than actual experimentation. Or indeed documentation ! Sean From thomasl_erlang@REDACTED Fri Jan 9 15:56:56 2004 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 9 Jan 2004 06:56:56 -0800 (PST) Subject: Any BEAM docs? In-Reply-To: <3FFE7523.50501@htu.se> Message-ID: <20040109145656.76315.qmail@web41903.mail.yahoo.com> --- Robert Feldt wrote: > BEAM is said to be based on WAM. Are there any > descriptions of the differences? My impression is that the instruction set is somewhat similar, but the actual engine is far less subtle than a WAM: BEAM has no unification, and no deep backtracking. A fairly easy way to understand BEAM basics is to compile some programs as "erlc -S foo.erl" and read the listings in foo.S. Best, Thomas __________________________________ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus From pan@REDACTED Fri Jan 9 16:03:14 2004 From: pan@REDACTED (Patrik Nyblom) Date: Fri, 09 Jan 2004 16:03:14 +0100 Subject: Request for next net_kernel release: new switch "net_setuptime_millis" References: Message-ID: <3FFEC2B2.1010202@erix.ericsson.se> Hi, Well, the reason for the 7s delay is simply that a suspended erlang node is still in some sense "alive". The listen socket is still listening and it's still registered with it's local epmd. On the other hand, if the node is completely halted, epmd has it unregistered and connection attempts fail instantly. What happens is for a suspended node (suspended node named b@REDACTED, connected from a@REDACTED): a@REDACTED issues a request for b@REDACTED to epmd on host2. The request gets answered immediately, a portnumber is the answer. a@REDACTED connects to the given port (which succeeds as TCP/IP and the socket interface works that way). a@REDACTED sends the initial handshake string a@REDACTED waits the stipulated timeout for the answer. -> pang after 7 s If the network cable is cut to host2, we would instead get: a@REDACTED tries to connect to epmd on host2. The connection attempt fails after the stipulated timeout. -> pang after 7 s On the other hand, if the node has never been alive: a@REDACTED issues a request to epmd which immediately answers that there is no such host. -> pang after a few millis. So, it's not that the distribution in node A keeps any data, it's simply that we have a timeout situation when a node is suspended, regardless if we have known the node before or not. TCP/IP is unfortunately not a protocol made for realtime applications... That's what all this long timeout hazzle comes from. A better network protocol would make things much funnier for Erlang, no ticking, no timeouting etc... A reliable protocol that monitors the links... a protocol designed not for web browsing but for telecom... Sigh... Timeouts shorter than 1 s could be useful though. I agree. I'll add the possibility to define fractions of seconds to the configuration. Cheers, /Patrik Reto Kramer wrote: > I found where the 7s ping/net_connect delay I was seeing if I was > pinging (or multi_call'ing) a node who's connection had timeout comes > from (see net_kernel excerpt below). > > I'm glad it's configurable (thanks for the foresight, whoever did > it!), however I need it smaller than 1s, which is the current minimum > I can set. > > Is there any chance that in the next release of the net_kernel we > could add a new (equally undocumented, i.e. unsupported) switch: > net_setuptime_millis? I suggest the net_setuptime switch dominates if > present to maintain backwards compatibly. > > Funny enough, when the node in question (say c) never started in the > first place, then a multi_call to [a,b,c] does not suffer from the > connection setup delay, it's only because a connection (that timed > out) had been setup initially that I see the kernel setuptime > timeout/delay. > > Perhaps someone could educate me here - it seems that perhaps not all > the data structures associated with the timed out connection are > cleaned up (i.e. behavior is different from when the connection has > never been created in the first place). > > Thanks, > - Reto > > PS: in the meantime, I'll resort to removing the failed node from the > nodeset I multicall to, and then re-add it using a multicast based > discovery protocol (the latter I have anyway). It would be nice if my > app could be naive about all that and just blindly multi_call to a > node set. > > --------- net_kernel: --------- > [...] > %% Default connection setup timeout in milliseconds. > %% This timeout is set for every distributed action during > %% the connection setup. > -define(SETUPTIME, 7000). > [...] > connecttime() -> > case application:get_env(kernel, net_setuptime) of > {ok, Time} when integer(Time), Time > 0, Time < 120 -> > Time * 1000; > _ -> > ?SETUPTIME > end. > [...] > --------- net_kernel: --------- > > ______________________ > An engineer can do for a dime what any fool can do for a dollar. > -- unknown From D.WILLIAMS@REDACTED Fri Jan 9 16:54:17 2004 From: D.WILLIAMS@REDACTED (WILLIAMS Dominic) Date: Fri, 9 Jan 2004 16:54:17 +0100 Subject: Request for next net_kernel release: new switch "net_setuptime_millis" Message-ID: Patrik Nyblom wrote: > TCP/IP is unfortunately not a protocol made for realtime > applications... That's what all this long timeout hazzle comes from. > [...] Absolutely. My advice is not, under any circumstances, to reduce those timeouts. Unfortunately, you must design your applications on the assumption that it is not possible to detect their absence any faster. I have played with those timers under various breeds of middleware, lastly CORBA, and got bitten every time. I think that over TCP/IP, it is even a mistake to try and design the software to adapt to network faults and partitions. Design the network itself to be more available than you need your software to be (using redundant channels, AFT and such things) and just design the software on the assumtion that the network works (i.e. let it fail when the network doesn't work, don't try anything smart, then give up and wait for the network to come back up. Regards, Dominic Williams. From luke@REDACTED Fri Jan 9 17:01:14 2004 From: luke@REDACTED (Luke Gorrie) Date: 09 Jan 2004 17:01:14 +0100 Subject: Request for next net_kernel release: new switch "net_setuptime_millis" In-Reply-To: References: Message-ID: "WILLIAMS Dominic" writes: > I think that over TCP/IP, it is even a mistake to try and design the > software to adapt to network faults and partitions. Design the network > itself to be more available than you need your software to be (using > redundant channels, AFT and such things) and just design the software > on the assumtion that the network works (i.e. let it fail when the > network doesn't work, don't try anything smart, then give up and wait > for the network to come back up. Interestingly this view is pretty much the opposite of the "end to end principle" (http://www.reed.com/Papers/EndtoEnd.html) that TCP/IP is founded on, which suggests putting all the smarts in the endpoints. -Luke (breaking end-to-end principle for a living :-) From richardc@REDACTED Fri Jan 9 17:04:58 2004 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 9 Jan 2004 17:04:58 +0100 (MET) Subject: Any BEAM docs? In-Reply-To: <3FFE7523.50501@htu.se> References: <3FFE7523.50501@htu.se> Message-ID: On Fri, 9 Jan 2004, Robert Feldt wrote: > Is there any overview description of BEAM? Or at least some hints on > the structure of the BEAM source code? Note that there is a difference between the external BEAM transport format (the code in *.beam files) and the internal instruction set used by the BEAM emulator (see the file beam_emu.c). The loader - a very complicated beast - rewrites the code to the internal form The external format used to be described by a document on Bj?rn Gustavsson's page, but that link seems to be dead now. (Bj?rn?) Studying the file lib/compiler/src/beam_disasm.erl might help. To understand the internal instruction set, beam_emu.c is your only source, I think. /Richard Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://user.it.uu.se/~richardc/ "Having users is like optimization: the wise course is to delay it." -- Paul Graham From Alves_V@REDACTED Fri Jan 9 17:03:15 2004 From: Alves_V@REDACTED (Victor Alves [ MTN - Innovation Centre ]) Date: Fri, 9 Jan 2004 18:03:15 +0200 Subject: Compiler Hangs Message-ID: <4213C2B0C178C7418BC0E6174AD240E75064CD@SDHMAIL.mtn.co.za> In Erlang 9c, when placing a comment (without a carriage return) at the end of a module the compiler hangs Regards Victor NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/email_disclaimer.asp -------------- next part -------------- An HTML attachment was scrubbed... URL: From richardc@REDACTED Fri Jan 9 17:17:17 2004 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 9 Jan 2004 17:17:17 +0100 (MET) Subject: Request for next net_kernel release: new switch"net_setuptime_millis" Message-ID: Luke Gorrie wrote: > Interestingly this view is pretty much the opposite of the "end to end > principle" (http://www.reed.com/Papers/EndtoEnd.html) that TCP/IP is > founded on, which suggests putting all the smarts in the endpoints. Also read this (same author, same site): http://www.reed.com/dprframeweb/dprframe.asp?section=paper&fn=endofendtoend.html /Richard Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://user.it.uu.se/~richardc/ "Having users is like optimization: the wise course is to delay it." -- Paul Graham From sean.hinde@REDACTED Fri Jan 9 17:20:19 2004 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 9 Jan 2004 16:20:19 +0000 Subject: Request for next net_kernel release: new switch "net_setuptime_millis" In-Reply-To: <3FFEC2B2.1010202@erix.ericsson.se> References: <3FFEC2B2.1010202@erix.ericsson.se> Message-ID: On 9 Jan 2004, at 15:03, Patrik Nyblom wrote: > TCP/IP is unfortunately not a protocol made for realtime > applications... That's what all this long timeout hazzle comes from. A > better network protocol would make things much funnier for Erlang, no > ticking, no timeouting etc... A reliable protocol that monitors the > links... a protocol designed not for web browsing but for telecom... > Sigh... Timeouts shorter than 1 s could be useful though. I agree. > I'll add the possibility to define fractions of seconds to the > configuration. sctp is supported natively in the 2.6.x Linux kernels. Yay! Sean From sean.hinde@REDACTED Fri Jan 9 17:35:56 2004 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 9 Jan 2004 16:35:56 +0000 Subject: Compiler Hangs In-Reply-To: <4213C2B0C178C7418BC0E6174AD240E75064CD@SDHMAIL.mtn.co.za> References: <4213C2B0C178C7418BC0E6174AD240E75064CD@SDHMAIL.mtn.co.za> Message-ID: On 9 Jan 2004, at 16:03, Victor Alves [ MTN - Innovation Centre ] wrote: > In Erlang9c, when placing a comment (without a carriage return) at the > end of a module the compiler hangs > > This is already fixed by a patch from the supported version download area :-) Support is truly excellent if you can get someone to pay for it (it is pretty reasonable) Sean (Not related to Ericsson in any way) From bjorn@REDACTED Fri Jan 9 18:49:42 2004 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 09 Jan 2004 18:49:42 +0100 Subject: Any BEAM docs? In-Reply-To: References: <3FFE7523.50501@htu.se> Message-ID: Richard Carlsson writes: > > The external format used to be described by a document on Bj?rn > Gustavsson's page, but that link seems to be dead now. (Bj?rn?) > My home page now has the following URL: http://www.erlang.se/~bjorn/ The file format document only describes the file format; not the instruction set for Beam. Some other useful files in OTP: beam_lib.erl (in stdlib): utilities for reading and writing beam files. genop.tab (in the compiler): number, name, and number of operands for all instructions + some comments. To disassemble a loaded module to the instructions that are actually executed, use erts_debug:df(Mod) (a disassembly file will be generated). /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From erlang@REDACTED Fri Jan 9 19:21:46 2004 From: erlang@REDACTED (Inswitch Solutions - Erlang Evaluation) Date: Fri, 9 Jan 2004 15:21:46 -0300 Subject: Request for next net_kernel release: new switch "net_setuptime_millis" References: <3FFEC2B2.1010202@erix.ericsson.se> Message-ID: <00e701c3d6dd$73ef6090$1e00a8c0@design> Hi Sean, Are you using sctp in Erlang-node communication? thanks, Eduardo Figoli INSwitch Solutions ----- Original Message ----- From: "Sean Hinde" To: "Patrik Nyblom" Cc: Sent: Friday, January 09, 2004 1:20 PM Subject: Re: Request for next net_kernel release: new switch "net_setuptime_millis" > > On 9 Jan 2004, at 15:03, Patrik Nyblom wrote: > > TCP/IP is unfortunately not a protocol made for realtime > > applications... That's what all this long timeout hazzle comes from. A > > better network protocol would make things much funnier for Erlang, no > > ticking, no timeouting etc... A reliable protocol that monitors the > > links... a protocol designed not for web browsing but for telecom... > > Sigh... Timeouts shorter than 1 s could be useful though. I agree. > > I'll add the possibility to define fractions of seconds to the > > configuration. > > sctp is supported natively in the 2.6.x Linux kernels. Yay! > > Sean > From hedeland@REDACTED Fri Jan 9 20:58:44 2004 From: hedeland@REDACTED (Per Hedeland) Date: Fri, 9 Jan 2004 20:58:44 +0100 (CET) Subject: time syncronization in erlang cluster In-Reply-To: Message-ID: <200401091958.i09Jwidu073551@tordmule.bluetail.com> Ulf Wiger wrote: > >Of course there's a catch: > >If the computer running the Erlang node is set for >any other timezone than Universal Time (UDT), the >system clock will make jumps that erlang:now() will >not be able to adjust to within reasonable time. Hmm?? On a sensible OS (e.g. Unix or derivatives) there are no jumps, since the system clock (and erlang:now()) always runs on UTC/GMT. The time zone, including Daylight Savings Time changes (I assume those are the jumps you're thinking of) is just a matter of how applications display time to the user. Indeed, each user can have his own time zone setting. I don't know what erlang:now() does on Windows, but if it gives UTC there too, it shouldn't be a problem that Windows stupidly runs the system clock on local time and jumps it around on DST changes. >On Unix systems, one creative way of getting around >this (if, for any reason, you can't run the whole system >in UDT) is to use os:setenv/2 and set the TZ environment >variable to UDT inside the Erlang node. And on Unix there is no need for it... However if you do run the system on the local time zone, it's nice if e.g. time stamps in logs written by Erlang change if the time zone setting is changed, and then you can use the os:putenv trick to set TZ to the new value (assuming, of course, that you have some way of knowing that it was changed and what the new value is:-) instead of having to restart the Erlang node. >Also, it's probably a good idea to have a background >process sampling erlang:now() and time(), comparing the >two. If the difference is too great (pick your definition >of "too great"), it might be wise to restart the node. Yes - what you potentially do need to be concerned with is a user making a "big" change in the time "outside" the Erlang system. Whether this is possible/"supported" depends on your application of course - if it's an "appliance" or "embedded system" it's not unreasonable to require that this only be done *through* Erlang (i.e. via the user interface of your application), but if you have something that runs as an application among others on a general-purpose OS, you may need to do some checking like the above. >On Fri, 9 Jan 2004 10:51:07 +0200, Primanathan Reddy [ MTN - Innovation >Centre ] wrote: > >> I'm going to try NTP. And to get even more off-topic:-), I'll write a few words about how we use NTP in Nortel's Erlang-based products. These run on Linux, but are definitely in the "appliance" category - there is a custom CLI for management (including all aspects of time), and if the user logs in as root and messes about, the warranty is voided.:-) These products can be clustered with up to 255 hosts in a cluster, and have the concept of a "Management IP" (MIP) which migrates as needed when hosts go down or are removed from the cluster, such that the user can always reach the CLI by connecting to the MIP. This management is all in Erlang of course. For NTP, we "overload" the MIP concept insofar as the "MIP owner" is always also the "NTP master". This means that all other hosts in the cluster have a trivial NTP config, basically "server ". The MIP owner is instead by default configured with its own local clock (127.127.1.0 in NTP parlance) as a high-stratum (10 or more) "server". This alone means that the hosts in the cluster are always synced to the same time, and when the MIP migrates, only the new MIP-owner needs to have its NTP config updated (the old MIP-owner is by definition not there anymore). We brutally restart the NTP server (ntpd) on the new MIP-owner at that point, but if you have high requirements on "smooth" timekeeping, there are other possibilities with the tools included in the reference NTP implementation. In addition to this, the user can optionally configure one or more "real" (external to the cluster) NTP servers. These are only added to the MIP-owner config, keeping the config trivial on the other hosts and reducing the traffic from the cluster to these servers. Since they have a substantially lower stratum than that configured for the local clock, ntpd on the MIP-owner will prefer them and instead correct its local clock - but if the "real" servers become unavailable, it will fall back to its (now time- and frequency-adjusted) local clock, and the cluster will stay synced to a common time. --Per Hedeland From Bruce@REDACTED Fri Jan 9 22:00:20 2004 From: Bruce@REDACTED (Bruce Fitzsimons) Date: Sat, 10 Jan 2004 10:00:20 +1300 Subject: Request for next net_kernel release: new switch "net_setuptime_millis" In-Reply-To: References: <3FFEC2B2.1010202@erix.ericsson.se> Message-ID: <3FFF1664.40001@Fitzsimons.org> Sean Hinde wrote: > On 9 Jan 2004, at 15:03, Patrik Nyblom wrote: > >> TCP/IP is unfortunately not a protocol made for realtime >> applications... That's what all this long timeout hazzle comes from. >> A better network protocol would make things much funnier for Erlang, >> no ticking, no timeouting etc... A reliable protocol that monitors >> the links... a protocol designed not for web browsing but for >> telecom... Sigh... Timeouts shorter than 1 s could be useful though. >> I agree. I'll add the possibility to define fractions of seconds to >> the configuration. > > > sctp is supported natively in the 2.6.x Linux kernels. Yay! > Its also rumoured to be in Solaris 10, although I haven't yet downloaded or installed the beta to check. Double yay. Hopefully with the new (err...old) poll/select type interface. /Bruce From ulf.wiger@REDACTED Sat Jan 10 01:20:41 2004 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Sat, 10 Jan 2004 01:20:41 +0100 Subject: time syncronization in erlang cluster In-Reply-To: <200401091958.i09Jwidu073551@tordmule.bluetail.com> References: <200401091958.i09Jwidu073551@tordmule.bluetail.com> Message-ID: On Fri, 9 Jan 2004 20:58:44 +0100 (CET), Per Hedeland wrote: > Ulf Wiger wrote: >> >> Of course there's a catch: >> >> If the computer running the Erlang node is set for >> any other timezone than Universal Time (UDT), the >> system clock will make jumps that erlang:now() will >> not be able to adjust to within reasonable time. > > Hmm?? On a sensible OS (e.g. Unix or derivatives) there are no jumps, > since the system clock (and erlang:now()) always runs on UTC/GMT. The > time zone, including Daylight Savings Time changes (I assume those are > the jumps you're thinking of) is just a matter of how applications > display time to the user. Indeed, each user can have his own time zone > setting. My fingers ran ahead of my brain there. There was a wholly different reason why we started messing with the TZ variable: keeping an up-to-date timezone file when delivering to all corners of the world, and doing it with Solaris patches, is simply not feasible. We chose to let the operator define the desired timezone through a web page, and then use os:getenv/2 (more or less - our solution predates setenv). Thus, only the erlang node knows the correct local time -- everything else is in universal time. Checking for discrepancies between the system clock and erlang:now() is more to protect against e.g. handling errors; stuff that shouldn't happen but invariably does. /Uffe -- Ulf Wiger From vances@REDACTED Sat Jan 10 07:34:24 2004 From: vances@REDACTED (Vance Shipley) Date: Sat, 10 Jan 2004 01:34:24 -0500 Subject: Supervision Restart Strategies Message-ID: <20040110063424.GB84387@frogman.motivity.ca> I would like to support a restart strategy which doesn't seem to be supported in current OTP. A supervisor will exit when the maximum restart frequency has been reached. Given a restart strategy of {one_for_one, 10, 60} effectively once there have been 10 exceptions within 60 seconds the supervisor will exit. I say this because they are permanent processes and so they will never exit normally. If they needed to be restarted it's because there was an exception. This is a handy mechanism as once you start to get too many errors you can fail a larger portion of the system and restart it further up. This can continue until you have rebooted the OS of the node. If the supervisor has transient children it will also exit if there are too many exceptions. This restart type allows processes to come into existance and exit normally. Only if they do not exit normally are they restarted. Temporary children are never restarted. What is missing is a stategy to restart the supervisor when there have been too many exceptions without actually restarting a dynamic process. I would like to have a {simple_one_for_one, 10, 60} restart strategy where I start temporary children with supervisor:start_child/2. As long as all children exit normally they simply stop. If they exit abnormally it counts as a restart in the restart strategy however the child should not be restarted. -Vance From mickael.remond@REDACTED Sat Jan 10 13:12:48 2004 From: mickael.remond@REDACTED (Mickael Remond) Date: Sat, 10 Jan 2004 12:12:48 +0000 Subject: Erlang-projects booth during Paris Linux solutions 2004 Message-ID: <20040110121248.GA3257@erlang.dyndns.org> Hello, I just wanted to let you know that Erlang-projects will run a booth during the next Linux Solutions expo in Paris. We will be presenting the principles of the Erlang programmning language. We will also demonstrate several Erlang applications (Rei, Nebula Erlang, Yaws, BTT, EJabberd, Tsunami, Eddieware, Manderlbot, and many more...). I will also give an introduction conference on Erlang during the "High-availability and clusters" conference. This conference takes place on Thursday February 05, 2004, from 9:30 am to 12:30 am. The whole event is at CNIT Paris La Defense from february 2004, the 3rd to February 2004 the 5th. -- Micka?l R?mond http://www.erlang-projects.org/ From hedeland@REDACTED Sat Jan 10 23:54:12 2004 From: hedeland@REDACTED (Per Hedeland) Date: Sat, 10 Jan 2004 23:54:12 +0100 (CET) Subject: time syncronization in erlang cluster In-Reply-To: Message-ID: <200401102254.i0AMsCl9059013@tordmule.bluetail.com> Ulf Wiger wrote: > >My fingers ran ahead of my brain there. There was a wholly different >reason why we started messing with the TZ variable: keeping an up-to-date >timezone file when delivering to all corners of the world, and doing >it with Solaris patches, is simply not feasible. "Works for us" (minus Solaris patches:-). The zone files don't change all that much these days I think, and you just might do new releases anyway and be able to slip updates in. Of course one file isn't enough, you need a whole bunch of them... > We chose to let the >operator define the desired timezone through a web page, Just curious: Do they get to define it in "useful" terms like "DST starts on the last Sunday in March at 02:00", or via actual dates? (The latter meaning that they need a calendar handy and have to change it every year.:-) Maybe better reply off-list since this is now *way* off-topic. --Per Hedeland From lps@REDACTED Sat Jan 10 19:31:25 2004 From: lps@REDACTED (Leon Smith) Date: Sat, 10 Jan 2004 13:31:25 -0500 Subject: Mnesia table changelog Message-ID: <400044FD.4070600@cwru.edu> I want to be able to set up a Mnesia table so that it has CVS-like functionality. I want to be able to go back and see what the table looked like at any point in time. I need fast access only to the recent past, I don't need fast access to arbitrary points in time. Also, for auditing purposes I'd like to be able to associate other pieces of information about the change, such as who made the change. I saw the checkpointing feature, but it doesn't sound appropriate to what I want to do. What would work well would be a changelog that records the old and new values for each change to the database. I could do this on an ad-hoc basis at the application layer, but I'm curious if Mnesia already has functionality I could leverage. best, leon From nhead@REDACTED Sun Jan 11 11:19:25 2004 From: nhead@REDACTED (nhead@REDACTED) Date: Sun, 11 Jan 2004 11:19:25 +0100 Subject: Mnesia table changelog In-Reply-To: <400044FD.4070600@cwru.edu> References: <400044FD.4070600@cwru.edu> Message-ID: <20040111111925.45ac5487.nhead@houbits.com> On Sat, 10 Jan 2004 13:31:25 -0500 Leon Smith wrote: > ... but I'm curious if > Mnesia already has functionality I could leverage. mnesia table events (see Mnesia User Guide, section 5.7.2) get you the ability to trap and process every record update, with old and new record data provided. The only slight issue I have with this is that transaction boundaries don't show as seperate events; for my application (echoing changes to a derived copy of a table) means that I'm now looking at doing this in application instead. Regards, Nigel. From jch@REDACTED Sun Jan 11 13:38:05 2004 From: jch@REDACTED (Jenny Dybedahl) Date: Sun, 11 Jan 2004 13:38:05 +0100 Subject: Bug in Erlang SMTP client? In-Reply-To: (Franck Arnaud's message of "Wed, 7 Jan 2004 17:20:40 +0000 (UTC)") References: Message-ID: Franck Arnaud writes: > This is a long shot, sorry if I'm not in the right place. > > I'm running an SMTP email server and I've got sessions with > franklin.telenor.se, which fail because this server is not > standards-compliant and tries this: > > MAIL FROM: > > which is illegal, see RFC 2821 or 821, compared to the correct: > > MAIL FROM: As far as I can see, you are completely correct in your reading of the RFC - I can't imagine why I haven't noticed this earlier... > I suspect the offending software is written in erlang (so maybe > the author reading this list or known by someone from this list) > because while franklin.telenor.se does not accept incoming SMTP, > the MXs for the addresses (@beta.telenordia.se) reply with: > > 220 mailgw.tninet.se ESMTP BMR ErlangTM/OTP (3.1/3.3) [0s24906861zack]; > 220 planb.telenor.se ESMTP BMR ErlangTM/OTP (3.1/3.3) [0s3542782lennier]; Again, you're correct - I believe several of the people who have been involved with the BMR system in the past are on this list, and at least one person who's still involved with it is here as well. Nevertheless, may I suggest that it would probably be quicker to send an email to postmaster at the domain in question? That mail should be forwarded to the sysadmin who's currently responsible for the email system. (15 months ago that would have been me; now it's one of my colleagues...) I'll check with that person if he's heard of it; otherwise I'll make sure the fix gets done by our current support partner. (While do some hobby programming in Erlang, which is why I'm on this list, I'm not experienced enough to work with a system of this complexity. Also I'm employed as a sysadmin, not a programmer...) Should you see any further problems with these servers, please feel free to let me know. -- "I live in the heart of the machine. We are one." From pan@REDACTED Mon Jan 12 11:15:19 2004 From: pan@REDACTED (Patrik Nyblom) Date: Mon, 12 Jan 2004 11:15:19 +0100 Subject: Request for next net_kernel release: new switch "net_setuptime_millis" References: Message-ID: <400273B7.7000305@erix.ericsson.se> Hi again, Here's a patch to make it possible to reduce the setuptime by using fractions of seconds (like 'erl -sname x -kernel net_setuptime 0.25'). Please observe, the result might be that, on a slow network, perfectly reachable nodes give connection failures if this parameter is set to low. It all depends on your network, so use with care :-) ------------------------------------------------- *** net_kernel.erl.orig Mon Jan 12 09:56:49 2004 --- net_kernel.erl Mon Jan 12 11:02:47 2004 *************** *** 1336,1343 **** connecttime() -> case application:get_env(kernel, net_setuptime) of ! {ok, Time} when integer(Time), Time > 0, Time < 120 -> Time * 1000; _ -> ?SETUPTIME end. --- 1336,1345 ---- connecttime() -> case application:get_env(kernel, net_setuptime) of ! {ok, Time} when is_integer(Time), Time > 0, Time < 120 -> Time * 1000; + {ok, Time} when is_float(Time), Time > 0, Time < 120 -> + round(Time * 1000); _ -> ?SETUPTIME end. ----------------------------------------------------------------------- The code is commited for R9C-1. Cheers, /Patrik Reto Kramer wrote: > I found where the 7s ping/net_connect delay I was seeing if I was > pinging (or multi_call'ing) a node who's connection had timeout comes > from (see net_kernel excerpt below). > > I'm glad it's configurable (thanks for the foresight, whoever did > it!), however I need it smaller than 1s, which is the current minimum > I can set. > > Is there any chance that in the next release of the net_kernel we > could add a new (equally undocumented, i.e. unsupported) switch: > net_setuptime_millis? I suggest the net_setuptime switch dominates if > present to maintain backwards compatibly. > > Funny enough, when the node in question (say c) never started in the > first place, then a multi_call to [a,b,c] does not suffer from the > connection setup delay, it's only because a connection (that timed > out) had been setup initially that I see the kernel setuptime > timeout/delay. > > Perhaps someone could educate me here - it seems that perhaps not all > the data structures associated with the timed out connection are > cleaned up (i.e. behavior is different from when the connection has > never been created in the first place). > > Thanks, > - Reto > > PS: in the meantime, I'll resort to removing the failed node from the > nodeset I multicall to, and then re-add it using a multicast based > discovery protocol (the latter I have anyway). It would be nice if my > app could be naive about all that and just blindly multi_call to a > node set. > > --------- net_kernel: --------- > [...] > %% Default connection setup timeout in milliseconds. > %% This timeout is set for every distributed action during > %% the connection setup. > -define(SETUPTIME, 7000). > [...] > connecttime() -> > case application:get_env(kernel, net_setuptime) of > {ok, Time} when integer(Time), Time > 0, Time < 120 -> > Time * 1000; > _ -> > ?SETUPTIME > end. > [...] > --------- net_kernel: --------- > > ______________________ > An engineer can do for a dime what any fool can do for a dollar. > -- unknown From joe@REDACTED Mon Jan 12 12:00:21 2004 From: joe@REDACTED (Joe Armstrong) Date: Mon, 12 Jan 2004 12:00:21 +0100 (CET) Subject: ANNOUNCE - graphics package Message-ID: ex11 This is to announce that a pre-alpha release of ex11 is now available. ex11 is a 100% pure Erlang graphics package, which works only with X-windows. ex11 talks *directly* to the X-server, no C is linked in. The ex11 release contains a library to talk to the server (This is similar to XLib) and a widget set. The widget set is very powerful and very simple. ex11 with programming examples and screen shots can be found at. http://www.sics.se/~joe/ex11 At this stage I'd ask as many people as possible to test this release and report any bugs or problems encountered in starting the system. Later I'd like volunteers to write new widgets and tools. I will support the widget infrastructure and the low level X library. Have fun /Joe PS - Thanks to Tobbe (who started this long ago) - and Vlad and Tony who have also hacked this at various times in the past. From vlad_dumitrescu@REDACTED Mon Jan 12 13:39:38 2004 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Mon, 12 Jan 2004 13:39:38 +0100 Subject: ANNOUNCE - graphics package References: Message-ID: Excellent!! I've tested it and it works now, even for me :-) I'm glad you managed to implement the "widget = process" in what seems to be a very nice way. I've been struggling with this issue for long, and couldn't find enough inspiration and spare time at the same time. best regards, Vlad From joe@REDACTED Mon Jan 12 14:45:19 2004 From: joe@REDACTED (Joe Armstrong) Date: Mon, 12 Jan 2004 14:45:19 +0100 (CET) Subject: ANNOUNCE - graphics package In-Reply-To: <20040112131425.7a4b15fd.pmander@newport-networks.com> Message-ID: This should not be necessary - I'd really like to know those cases where the start procedure fails. If authentication fails it is because ex11_lib_driver:get_cookie Has not been able to figure out what cookie to use If authentication fails then give the commands > xauth list To see what cookies you have, then stare at the code in ex11_lib_driver and ex11_lib_xauth to figure out what when wrong. /Joe On Mon, 12 Jan 2004, Peter-Henry Mander wrote: > > For those who may have difficulties with X11, do the following after make all: > > xhost +localhost > erl -pa ./lib -pa ./widget. > > Pete. > > P.s. thanks Joe :-) > > > On Mon, 12 Jan 2004 13:39:38 +0100 > "Vlad Dumitrescu" wrote: > > > Excellent!! > > > > I've tested it and it works now, even for me :-) > > > > I'm glad you managed to implement the "widget = process" in what seems to be a > > very nice way. I've been struggling with this issue for long, and couldn't find > > enough inspiration and spare time at the same time. > > > > best regards, > > Vlad > > > > > From bertil@REDACTED Mon Jan 12 15:00:54 2004 From: bertil@REDACTED (Bertil Karlsson) Date: Mon, 12 Jan 2004 15:00:54 +0100 Subject: ASN.1 help please References: <41256E15.004F092B.00@esocmail2.esoc.esa.int> Message-ID: <4002A896.609@erix.ericsson.se> You have found an asn1 subtype construct that there is no support of in the asn1 compiler yet. It is not hard for us to implement but I cannot promise support of it before R10. If you use BER encoding the easiest way to fix the problem is to comment the constraint in the type AnotherThing like: AnotherThing ::= Thing -- ( fred -- | fred2 -- ) If you use PER you have to change the identifiers fred and fred2 into their integer values. /Bertil Karlsson Nigel.Head@REDACTED wrote: > I'm attempting to compile a largeish chunk of an ASN.1 spec and am running into > problems. The spec apparently compiles OK with other compilers (although I don't > have any around to prove this to myself, so it's only hearsay). > > I've managed to reproduce the problem with a toy source file; as I'm an ASN.1 > utter beginner I'd appreciate help as to what is wrong with this so that I can > make the corrections to the real thing (which is a bit large to bother you all > with !!). > > > =================== source file ================= > > TEST > DEFINITIONS > ::= BEGIN > > Thing ::= INTEGER > { fred (0) > , fred2 (1) > , fred3 (2) > } > > AnotherThing ::= Thing > ( fred > | fred2 > ) > > > END > > =================== error message ============== > > (N1@REDACTED)5> asn1ct:compile('TEST'). > Erlang ASN.1 version "1.4.2" compiling "TEST.asn1" > Compiler Options: [] > asn1error:10:'TEST':'AnotherThing' {asn1,{undefined_type_or_value,fred}} > {error,{asn1,[{error,{type,10, > 'TEST', > 'AnotherThing', > {asn1,{undefined_type_or_value,fred}}}}]}} > > > N. > > > -- / Bertil Karlsson From vlad_dumitrescu@REDACTED Mon Jan 12 15:21:36 2004 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Mon, 12 Jan 2004 15:21:36 +0100 Subject: ANNOUNCE - graphics package References: Message-ID: > I will support the widget infrastructure and the low level X library. It's quite soon to ask this, but I wonder: do your plans include adding functionality for X extensions? From what I saw in the code, it's not so easy to extend in a modular way, but I may be jumping to conclusions. What I had in mind was the Render extension, and also support for Xft. This goes a bit beyond "Erlang only talks to X server", but I guess you would be also interested in high quality output, TrueType fonts, antialiasing, transparency and so on ;-) regards, Vlad From joe@REDACTED Mon Jan 12 15:26:55 2004 From: joe@REDACTED (Joe Armstrong) Date: Mon, 12 Jan 2004 15:26:55 +0100 (CET) Subject: ANNOUNCE - graphics package In-Reply-To: Message-ID: On Mon, 12 Jan 2004, Vlad Dumitrescu wrote: > > I will support the widget infrastructure and the low level X library. > > It's quite soon to ask this, but I wonder: do your plans include adding > functionality for X extensions? From what I saw in the code, it's not so easy to > extend in a modular way, but I may be jumping to conclusions. > > What I had in mind was the Render extension, and also support for Xft. This goes > a bit beyond "Erlang only talks to X server", but I guess you would be also > interested in high quality output, TrueType fonts, antialiasing, transparency > and so on ;-) > Yes indeed - but this is running before we can walk - text widgets for variable width fonts etc is not entirely trivial. I'm beginnging to wonder about extension this - now do I do alpha blending for example?? /Joe > regards, > Vlad > From vlad_dumitrescu@REDACTED Mon Jan 12 15:36:24 2004 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Mon, 12 Jan 2004 15:36:24 +0100 Subject: ANNOUNCE - graphics package References: Message-ID: > I'm beginnging to wonder about extension this - now do I do alpha > blending for example?? I used to have a link to documentation for most X protocols (core and extensions) but I lost it. Maybe I will find it at home. Otherwise, I think the best way to learn about Render is from the sources that come with XFree86. /Vlad From joe@REDACTED Mon Jan 12 15:40:40 2004 From: joe@REDACTED (Joe Armstrong) Date: Mon, 12 Jan 2004 15:40:40 +0100 (CET) Subject: ANNOUNCE - graphics package In-Reply-To: Message-ID: On Mon, 12 Jan 2004, Vlad Dumitrescu wrote: > > I will support the widget infrastructure and the low level X library. > > It's quite soon to ask this, but I wonder: do your plans include adding > functionality for X extensions? From what I saw in the code, it's not so easy to > extend in a modular way, but I may be jumping to conclusions. On the contrary it is *very* easy - If I have not misunderstood. In my code most commands boil down to things like (for example) xDo(Display, ePolyFillRectangle(DrawCursor, GC0, [mkRectangle(0,0,?CursorWidth, ?CursorHt)])), All names like ex11_lib:eXXXXX Are primitive protocol messages. To add support for (say) a rendering extension one could make a new protocol conversion module and write: xDo(Display, render:eSomeProtocolMessage(.....)) etc. /Joe > > What I had in mind was the Render extension, and also support for Xft. This goes > a bit beyond "Erlang only talks to X server", but I guess you would be also > interested in high quality output, TrueType fonts, antialiasing, transparency > and so on ;-) > > regards, > Vlad > From vlad_dumitrescu@REDACTED Mon Jan 12 15:53:28 2004 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Mon, 12 Jan 2004 15:53:28 +0100 Subject: ANNOUNCE - graphics package References: Message-ID: > To add support for (say) a rendering extension one could make a new > protocol conversion module and write: > > xDo(Display, render:eSomeProtocolMessage(.....)) > > etc. Oh, yes! :-) The replies are a little more tricky (i.e. one has to know which module to ask to decode the data) but not much, and what I was thinking was to have the extensions in mind so that it will be easy to add them after the core functionality runs smoothly. Just to check if I didn't miss this one: the image functionality isn't complete, is it? /Vlad From pmander@REDACTED Mon Jan 12 14:14:25 2004 From: pmander@REDACTED (Peter-Henry Mander) Date: Mon, 12 Jan 2004 13:14:25 +0000 Subject: ANNOUNCE - graphics package In-Reply-To: References: Message-ID: <20040112131425.7a4b15fd.pmander@newport-networks.com> For those who may have difficulties with X11, do the following after make all: xhost +localhost erl -pa ./lib -pa ./widget. Pete. P.s. thanks Joe :-) On Mon, 12 Jan 2004 13:39:38 +0100 "Vlad Dumitrescu" wrote: > Excellent!! > > I've tested it and it works now, even for me :-) > > I'm glad you managed to implement the "widget = process" in what seems to be a > very nice way. I've been struggling with this issue for long, and couldn't find > enough inspiration and spare time at the same time. > > best regards, > Vlad > -- Peter-Henry Mander BSc hons. Comp Sci & Cyb Software Engineer Newport Networks Limited Tel: + 44 (0) 1494 470 681 From zeke_bachholz@REDACTED Mon Jan 12 14:59:27 2004 From: zeke_bachholz@REDACTED (Zeke Bachholz) Date: Mon, 12 Jan 2004 13:59:27 +0000 Subject: Why do I need to be explicit about binary Message-ID: Hi, Can anyone explain why 11> does not work but 12> does? A is assigned a binary value, so why do I need to be explicit about it. 10> A = <<2:8>>. <<2>> 11> B = <<1:8, A, 3:8>>. ** exited: {badarg,[{erl_eval,expr,3}]} ** 12> B = <<1:8, A/binary, 3:8>>. <<1,2,3>> Best Regards Zeke _________________________________________________________________ Schlu? mit Spam - MSN hilft Ihnen hier weiter. From joe@REDACTED Mon Jan 12 16:35:42 2004 From: joe@REDACTED (Joe Armstrong) Date: Mon, 12 Jan 2004 16:35:42 +0100 (CET) Subject: ANNOUNCE - graphics package In-Reply-To: Message-ID: On Mon, 12 Jan 2004, Vlad Dumitrescu wrote: > > To add support for (say) a rendering extension one could make a new > > protocol conversion module and write: > > > > xDo(Display, render:eSomeProtocolMessage(.....)) > > > > etc. > > Oh, yes! :-) > > The replies are a little more tricky (i.e. one has to know which module to ask > to decode the data) but not much, and what I was thinking was to have the > extensions in mind so that it will be easy to add them after the core > functionality runs smoothly. This is also easy :-) Primitives end up by calling either req or call like this: ePutImage(Draw, GC, Width, Ht, X, Y, Pad, Depth, Data) -> req(72, 2, <>). PutImage has no reply eQueryFont(Id) -> call(47, <>, eQueryFont). ********** Query font has a reply. Here eQueryFont is the name of the parser to be called when the command returns Then when later the command returns this code gets called: ... pReply1(eQueryFont, <<_:64, MinBounds:12/binary, % note the units of binary % are inbytes _:32, MaxBounds:12/binary, _:32, MinByte2:16, MaxByte2:16, DefaultChar:16, NFontProps:16, DrawDirection:8, MinByte1:8, MaxByte1:8, AllCharsExist:8, FontAscent:?INT16, FontDescent:?INT16, NCharInfos:32, ... > Just to check if I didn't miss this one: the image functionality isn't complete, > is it? No. I have included the code to read and display a Jpeg - but I removed it from the examples when I found that it didn't work on all machines. You can try it if you like The example only works if you have "true color" (I think its called this) The code works if you have a modern graphics card but fails if you have to map the colors. I have written the code for this but still get weird colors on my machine at work. /Joe > > /Vlad > From Nigel.Head@REDACTED Mon Jan 12 16:54:08 2004 From: Nigel.Head@REDACTED (Nigel.Head@REDACTED) Date: Mon, 12 Jan 2004 16:54:08 +0100 Subject: ASN.1 help please Message-ID: <41256E19.00583E83.00@esocmail2.esoc.esa.int> Thanks for the tip ... I was just about to start plunging around in the ASN.1 book I have and see hopw to fix it myself, having come to the conclusion that the nested type declartions might be the cause of the problem. You've just saved me a bunch of work ...... :-) N. From meetegriot@REDACTED Mon Jan 12 17:00:08 2004 From: meetegriot@REDACTED (R.) Date: Mon, 12 Jan 2004 17:00:08 +0100 Subject: trailing a growing file In-Reply-To: <20031231013755.GA30880@spearce.org> Message-ID: <001801c3d925$29e385e0$1474010a@raphael> Thanks for your answers, I may write what you gave me to the Erlang PLEAC if no one has something against that. Regards. Raphael. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.558 / Virus Database: 350 - Release Date: 02/01/2004 From mikael.karlsson@REDACTED Mon Jan 12 17:40:56 2004 From: mikael.karlsson@REDACTED (Mikael Karlsson) Date: Mon, 12 Jan 2004 17:40:56 +0100 Subject: ANNOUNCE - graphics package In-Reply-To: References: Message-ID: <200401121740.56135.mikael.karlsson@creado.com> Oh yes! could I add some support for PDF like primitives to the wishlist, so one could have an ErlGuten like interface. See: http://www.cairographics.org/ There are actually two X11 libraries under jungerl: ex11 and x11, is "ex11" the one to choose? Regards Mikael. m?ndag 12 januari 2004 15:26 skrev Joe Armstrong: > On Mon, 12 Jan 2004, Vlad Dumitrescu wrote: > > > I will support the widget infrastructure and the low level X library. > > > > It's quite soon to ask this, but I wonder: do your plans include adding > > functionality for X extensions? From what I saw in the code, it's not so > > easy to extend in a modular way, but I may be jumping to conclusions. > > > > What I had in mind was the Render extension, and also support for Xft. > > This goes a bit beyond "Erlang only talks to X server", but I guess you > > would be also interested in high quality output, TrueType fonts, > > antialiasing, transparency and so on ;-) > > Yes indeed - but this is running before we can walk - text widgets > for variable width fonts etc is not entirely trivial. > > I'm beginnging to wonder about extension this - now do I do alpha > blending for example?? > > /Joe > > > regards, > > Vlad From vlad_dumitrescu@REDACTED Mon Jan 12 19:43:00 2004 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Mon, 12 Jan 2004 19:43:00 +0100 Subject: ANNOUNCE - graphics package References: <200401121740.56135.mikael.karlsson@creado.com> Message-ID: From: "Mikael Karlsson" >could I add some support for PDF like primitives to the wishlist, so >one could have an ErlGuten like interface. >See: http://www.cairographics.org/ And slightly related, on the To Do list ahould probably be a gs emulation layer, so that existing graphics applications can be ported smoothly. /Vlad From vlad_dumitrescu@REDACTED Mon Jan 12 19:45:15 2004 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Mon, 12 Jan 2004 19:45:15 +0100 Subject: ANNOUNCE - graphics package References: Message-ID: > > The replies are a little more tricky > This is also easy :-) > eQueryFont(Id) -> > call(47, <>, eQueryFont). > ********** > Then when later the command returns this code gets called: ... > > pReply1(eQueryFont, <<_:64, > MinBounds:12/binary, % note the units of binary Great! I couldn't figure that out in the short time I had. /Vlad From pmander@REDACTED Mon Jan 12 17:23:31 2004 From: pmander@REDACTED (Peter-Henry Mander) Date: Mon, 12 Jan 2004 16:23:31 +0000 Subject: ANNOUNCE - graphics package In-Reply-To: References: <20040112131425.7a4b15fd.pmander@newport-networks.com> Message-ID: <20040112162331.0df98e19.pmander@newport-networks.com> Hi Joe, In my case with SuSE 8.2 the .Xauthority list simply doesn't contain localhost. There's 127.0.0.2, and the actual hostname too, but not localhost. I'm not sure how or why it's become like this. Using xhost or xauth as a remedy does work. It's no fault of ex11, although the demo does fail silently, there's no supervisor to catch the exit value of sw_driver:wConnect/2. Pete. On Mon, 12 Jan 2004 14:45:19 +0100 (CET) Joe Armstrong wrote: > This should not be necessary - I'd really like to know those cases > where the start procedure fails. > > If authentication fails it is because > > ex11_lib_driver:get_cookie > > Has not been able to figure out what cookie to use > > If authentication fails then give the commands > > > xauth > list > > To see what cookies you have, then stare at the code in ex11_lib_driver > and ex11_lib_xauth to figure out what when wrong. > > /Joe > > > > > On Mon, 12 Jan 2004, Peter-Henry Mander wrote: > > > > > > > For those who may have difficulties with X11, do the following after make all: > > > > xhost +localhost > > erl -pa ./lib -pa ./widget. > > > > Pete. > > > > P.s. thanks Joe :-) > > > > > > On Mon, 12 Jan 2004 13:39:38 +0100 > > "Vlad Dumitrescu" wrote: > > > > > Excellent!! > > > > > > I've tested it and it works now, even for me :-) > > > > > > I'm glad you managed to implement the "widget = process" in what seems to be a > > > very nice way. I've been struggling with this issue for long, and couldn't find > > > enough inspiration and spare time at the same time. > > > > > > best regards, > > > Vlad > > > > > > > > > > > -- Peter-Henry Mander BSc hons. Comp Sci & Cyb Software Engineer Newport Networks Limited Tel: + 44 (0) 1494 470 681 From mats.cronqvist@REDACTED Tue Jan 13 10:57:31 2004 From: mats.cronqvist@REDACTED (mats cronqvist) Date: Tue, 13 Jan 2004 10:57:31 +0100 Subject: ANNOUNCE - graphics package In-Reply-To: References: Message-ID: thought i try ex11, but then i saw this; "!! is an infix RPC operator. This needs a ONE LINE change to erl_parse.yrl which makes a new version of erl_parse.erl" so only people that willing/able to rebuild erl_parse can try ex11. i for one am not (willing, that is). but maybe a sed script or something can convert the code to erlang? mats From joe@REDACTED Tue Jan 13 11:25:39 2004 From: joe@REDACTED (Joe Armstrong) Date: Tue, 13 Jan 2004 11:25:39 +0100 (CET) Subject: Bang Bang In-Reply-To: Message-ID: Oh dear, sorry it's not *pure* erlang :-) If the great maintainers add the following line to erl_parse.yrl ----- expr_100 -> expr_150 '!' '!' expr_100: {call, line('$1'), {remote, line('$1'), {atom, line('$1'),sysd}, {atom, line('$1'),rpc}}, ['$1', '$4']}. ----- then it would be standard Erlang :-) Users would be free to define their own sysd:rpc ((possibly even better is to exapand this into ?MODULE:rpc/2)) The change is purely *local* - if you "make" everything a new versions of erl_parse.erl{.beam} are put into the /widgets subdirectory. Pid !! X is just expanded into sysd:rpc(Pid, X). This make the code (IMHO) very pretty The code to swap the values in two entries, is thus ... Entry1 = Win !! mkEntry(....) Entry2 = Win !! mkEntry(...) Button = Win !! mkButton(....) ... Swap = fun(_) -> Str1 = Entry1 !! read, Str2 = Entry2 !! read, Entry1 ! {set, Str1}, Entry2 ! {set, Str2} end, Button ! {onClick, Swap} ... To my mind this code is very clear and beautiful. We could even see at a glance that Entry !! read is a possible error (ie it should be) Var = Entry !! read ie why do an rpc and NOT store the value - if you *wanted* to read the value but not get a return value you could write Entry ! read Instead .... Converting this to rpc(Entry, read) etc is a lot uglier. <