From marco.atzeri at gmail.com Thu Jan 6 19:44:33 2011 From: marco.atzeri at gmail.com (marco atzeri) Date: Thu, 6 Jan 2011 20:44:33 +0100 Subject: [slang-users] patch for building modules Message-ID: Hi John, when building modules the SLANG_LIB_FOR_MODULES='-L$(ELFDIR) -lslang' need ELFDIR defined in the Makefile, otherwise the link on cygwin fails Regards Marco -------------- next part -------------- A non-text attachment was scrubbed... Name: slang-2.2.3-1.src.patch Type: application/octet-stream Size: 511 bytes Desc: not available Url : http://mailman.jedsoft.org/pipermail/slang-users-l/attachments/20110106/1369327b/attachment.obj From vsu at altlinux.ru Sun Jan 9 20:42:18 2011 From: vsu at altlinux.ru (Sergey Vlasov) Date: Sun, 9 Jan 2011 23:42:18 +0300 Subject: [slang-users] [PATCH] Fix SLang_TT_Baud_Rate setting with faster baud rates Message-ID: <20110109204218.GA2260@atlas.home> The baud rate constant list used for setting the SLang_TT_Baud_Rate variable contains baud rates only up to 230400; any faster baud rate is not properly detected, and SLang_TT_Baud_Rate is left as 0. This caused problems at least with the Midnight Commander: https://www.midnight-commander.org/ticket/2452 (recent versions of rxvt-unicode set speed 4000000 for the pty (and there is no configurable option for this), and mc then considers such terminal as "slow" due to SLang_TT_Baud_Rate == 0 and turns off some useful UI options). This patch adds missing values to the Baud_Rates array in src/slutty.c, which fixes the baud rate detection problem. It also brings this array in sync with Baudrate_Map in modules/termios-module.c, where those higher baud rates were already present for some time. --- slang-2.2.3/src/slutty.c.alt-baud-rates 2010-12-15 13:56:48.000000000 +0300 +++ slang-2.2.3/src/slutty.c 2011-01-09 22:34:59.911000008 +0300 @@ -170,6 +170,42 @@ static Baud_Rate_Type Baud_Rates [] = #ifdef B230400 {B230400, 230400}, #endif +#ifdef B460800 + {B460800, 460800}, +#endif +#ifdef B500000 + {B500000, 500000}, +#endif +#ifdef B576000 + {B576000, 576000}, +#endif +#ifdef B921600 + {B921600, 921600}, +#endif +#ifdef B1000000 + {B1000000, 1000000}, +#endif +#ifdef B1152000 + {B1152000, 1152000}, +#endif +#ifdef B1500000 + {B1500000, 1500000}, +#endif +#ifdef B2000000 + {B2000000, 2000000}, +#endif +#ifdef B2500000 + {B2500000, 2500000}, +#endif +#ifdef B3000000 + {B3000000, 3000000}, +#endif +#ifdef B3500000 + {B3500000, 3500000}, +#endif +#ifdef B4000000 + {B4000000, 4000000}, +#endif {0, 0} }; -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature Url : http://mailman.jedsoft.org/pipermail/slang-users-l/attachments/20110109/e7ee0440/attachment.bin From ian.langworth at gmail.com Mon Jan 17 02:30:11 2011 From: ian.langworth at gmail.com (Ian Langworth) Date: Sun, 16 Jan 2011 18:30:11 -0800 Subject: [slang-users] Welcome to the "slang-users-l" mailing list In-Reply-To: References: Message-ID: Hi, I'm attempting to print a UTF-8 encoded character to the screen in a Unicode-capable terminal: #include #include int main(int argc, char* argv[]) { SLtt_get_terminfo(); SLang_init_tty(-1, 1, 0); SLsmg_init_smg(); SLutf8_enable(-1); SLsmg_cls(); SLsmg_gotorc(0, 0); SLsmg_write_string("?\n"); SLsmg_write_nchars("?", 1); SLsmg_gotorc(5, 0); SLsmg_refresh(); SLang_getkey(); SLsmg_reset_smg(); SLang_reset_tty(); return 0; } Instead of printing two ? characters separated by a newline, all I see is: ??<91>? The bytes written to the screen are: 0x c3a9 c2bb 3c39 313e c3a9 My terminal, Terminal.app on Mac OS X, definitely supports unicode, and other applications (Emacs, Vim) have no trouble. The source code is UTF-8 encoded and xxd confirms it. I've tried replacing the string with "\xe9\xbb\x91" and I've tried changing my TERM and LC_ALL env variables. I've tried changing the parameter of SLutf8_enable(). I've tried setting SLsmg_Display_Eight_Bit to 128, but that simply prints "???". By default, SLsmg_Display_Eight_Bit is 160. Any help would be appreciated. From davis at space.mit.edu Mon Jan 17 16:55:21 2011 From: davis at space.mit.edu (John E. Davis) Date: Mon, 17 Jan 2011 11:55:21 -0500 Subject: [slang-users] Welcome to the "slang-users-l" mailing list In-Reply-To: References: Message-ID: <201101171655.p0HGtLan028339@aluche.mit.edu> Ian Langworth wrote: > I'm attempting to print a UTF-8 encoded character to the screen in a > Unicode-capable terminal: There are a couple of things wrong: > > #include > #include > > int main(int argc, char* argv[]) { > SLtt_get_terminfo(); > SLang_init_tty(-1, 1, 0); > SLsmg_init_smg(); > > SLutf8_enable(-1); SLutf8_enable has to be called first before any of the other functions. I should document this requirement. > SLsmg_cls(); > SLsmg_gotorc(0, 0); > SLsmg_write_string("?\n"); > SLsmg_write_nchars("?", 1); SLsmg_write_nchars predates slang's UTF-8 support. It should more properly be called SLsmg_write_nbytes. As such, yiu are writing the first byte of the string to the display. You need to use strlen here to write all the bytes. Here is a corrected version that should work for you. Thanks, --John #include #include #include int main(int argc, char* argv[]) { char *str = "?"; SLutf8_enable(-1); SLtt_get_terminfo(); SLang_init_tty(-1, 1, 0); SLsmg_init_smg(); SLsmg_cls(); SLsmg_gotorc(0, 0); SLsmg_write_string("?\n"); SLsmg_write_nchars (str, strlen(str)); SLsmg_gotorc(5, 0); SLsmg_refresh(); SLang_getkey(); SLsmg_reset_smg(); SLang_reset_tty(); return 0; } From ian.langworth at gmail.com Mon Jan 17 18:12:35 2011 From: ian.langworth at gmail.com (Ian Langworth) Date: Mon, 17 Jan 2011 10:12:35 -0800 Subject: [slang-users] Welcome to the "slang-users-l" mailing list In-Reply-To: <201101171655.p0HGtLan028339@aluche.mit.edu> References: <201101171655.p0HGtLan028339@aluche.mit.edu> Message-ID: Perfect. Thanks, John! On Mon, Jan 17, 2011 at 08:55, John E. Davis wrote: > Ian Langworth wrote: >> I'm attempting to print a UTF-8 encoded character to the screen in a >> Unicode-capable terminal: > > There are a couple of things wrong: >> >> ? ? #include >> ? ? #include >> >> ? ? int main(int argc, char* argv[]) { >> ? ? ? SLtt_get_terminfo(); >> ? ? ? SLang_init_tty(-1, 1, 0); >> ? ? ? SLsmg_init_smg(); >> >> ? ? ? SLutf8_enable(-1); > > ?SLutf8_enable has to be called first before any of the other > ?functions. ?I should document this requirement. > >> ? ? ? SLsmg_cls(); >> ? ? ? SLsmg_gotorc(0, 0); >> ? ? ? SLsmg_write_string("?\n"); >> ? ? ? SLsmg_write_nchars("?", 1); > > ?SLsmg_write_nchars predates slang's UTF-8 support. ?It should more > ?properly be called SLsmg_write_nbytes. ?As such, yiu are writing the > ?first byte of the string to the display. ?You need to use strlen > ?here to write all the bytes. > > ?Here is a corrected version that should work for you. ?Thanks, --John > > #include > #include > #include > > int main(int argc, char* argv[]) > { > ? char *str = "?"; > > ? SLutf8_enable(-1); > > ? SLtt_get_terminfo(); > ? SLang_init_tty(-1, 1, 0); > ? SLsmg_init_smg(); > > ? SLsmg_cls(); > ? SLsmg_gotorc(0, 0); > ? SLsmg_write_string("?\n"); > ? SLsmg_write_nchars (str, strlen(str)); > ? SLsmg_gotorc(5, 0); > ? SLsmg_refresh(); > ? SLang_getkey(); > > ? SLsmg_reset_smg(); > ? SLang_reset_tty(); > ? return 0; > } > From marcel at telka.sk Mon Jan 31 17:13:08 2011 From: marcel at telka.sk (Marcel Telka) Date: Mon, 31 Jan 2011 18:13:08 +0100 Subject: [slang-users] Typo: occurance vs. occurrence Message-ID: <20110131171308.GB2129@tortuga.telka.sk> Hi, I found several places in the sources where the invalid word "occurance" is used: $ find slang-2.2.3 -type f |xargs grep occurance | wc -l 47 $ The correct word used there should be "occurrence" (please note double-R and E). Please fix this minor issue. Thanks. -- +-------------------------------------------+ | Marcel Telka e-mail: marcel at telka.sk | | homepage: http://telka.sk/ | | jabber: marcel at jabber.sk | +-------------------------------------------+ From p.boekholt at gmail.com Fri Apr 8 18:40:05 2011 From: p.boekholt at gmail.com (Paul Boekholt) Date: Fri, 8 Apr 2011 20:40:05 +0200 Subject: [slang-users] mysqlclient library Message-ID: Hi, I'm working on a pure S-Lang mysql client. Version 0.0.1 is now available on http://www.cheesit.com/downloads/slang/mysqlclient.html. This is a beta version, please report any bugs. Paul From davis at space.mit.edu Mon Apr 11 03:59:25 2011 From: davis at space.mit.edu (John E. Davis) Date: Sun, 10 Apr 2011 23:59:25 -0400 Subject: [slang-users] slang 2.2.4 released Message-ID: <201104110359.p3B3xTD0019313@aluche.mit.edu> Version 2.2.4 of the slang library has been released. This is a bug-fix release with no new features and should be the last of the 2.2 series. This version is binary compatible with previous version 2 releases. See for downloading options. It may take a day or so for the mirror sites to pick up the latest version. Changes since 2.2.3 1. src/slpack.c: Typo affecting 64 bit integers ('q' & 'Q') (Paul Boekholt). 2. src/Makefile.in: Make libslang.so a symlink to libslang.so.2 instead of libslang.so.2.2.4 (Miroslav Lichvar) 3. modules/Makefile.in: Cygwin needs ELFDIR defined (Marco Atzeri). 4. src/slutty.c: Added additional baud rate values (Sergey Vlasov) 5. autoconf/configure.ac: Check for socket and socketpair in -lsocket if it is not in libc. 6. *.tm, src/slstrops.c, src/slbstr.c: Changed occurances to occurrences (Marcel Telka). 7. src/slparse.c: Increment the _boseos_info value for qualifier expressions. 8. src/sltoken.c,slparse.c: The semantics of the _boseos_info variable changed such that bos/eos callbacks are not generated for preprocessor #ifeval statements unless bit 0x100 is set. 9. slsh/scripts/slstkchk: a new script used for running the stack-check debugger. 10. documentation updates/tweaks (Manfred Hanke). 11. slsh/lib/rline/histsrch.sl: When building history search completions, use most recent history first. 12. src/slarray.c: Detect integer overflows for multi-dimensional arrays. 13. Updated year from 2010 to 2011 14. src/slcommon.c: Added _slcalloc, _slrecalloc memory allocation functions that check for unsigned integer wrapping. A number of vulnerable calls to SLmalloc were modified to use these functions. (Fixes an issue reported by Pablo Cassatella). 15. src/slarray.c: Detect attempts to create a 0 dimensional array. 16. modules/csv.sl: Float and double NaNs were reversed. When normalizing columns names, _ characters were not being properly treated. 17. doc/tm/rtl/time.tm: Added documentation for timegm (Manfred Hanke). 18. doc/tm/crtl/slsmg.tm: Corrected prototype for SLsmg_read_raw (Manfred Hanke). 19. Tweaked doc macros and rebuilt docs. 20. src/slarray.c: Added a check for too small of a range array increment. Enjoy, --John From p.boekholt at gmail.com Wed Apr 27 19:54:13 2011 From: p.boekholt at gmail.com (Paul Boekholt) Date: Wed, 27 Apr 2011 21:54:13 +0200 Subject: [slang-users] mysqlclient 0.0.2 Message-ID: Hi, The second beta of the mysqlclient library is out. This version fixes a few bugs in the handling of datetime fields. You can get it from http://www.cheesit.com/downloads/slang/mysqlclient.html Paul From p.boekholt at gmail.com Thu Jun 30 18:11:23 2011 From: p.boekholt at gmail.com (Paul Boekholt) Date: Thu, 30 Jun 2011 20:11:23 +0200 Subject: [slang-users] mysqlclient 0.0.3 Message-ID: Hi, The third beta of the mysqlclient library is out. This version has a few improvements: - added some custom exceptions - use the UTF-8 character set if S-Lang is in UTF-8 mode - added an execute_list_of_list function You can get it from http://www.cheesit.com/downloads/slang/mysqlclient.html Paul From B.Schoenhammer at bit-field.de Mon Jul 25 20:32:34 2011 From: B.Schoenhammer at bit-field.de (=?ISO-8859-15?Q?Bernhard_Sch=F6nhammer?=) Date: Mon, 25 Jul 2011 22:32:34 +0200 Subject: [slang-users] module gettext Message-ID: <4E2DD2E2.8010707@bit-field.de> Hello slang users, I am using: slsh version 0.8.4-1; S-Lang version: 2.2.2 and the gettext module. Everything works fine so far, but now I came across this: variable val1 = 8563; variable tmp_level = val1 /10.; () = printf("%f\n", tmp_level); require("gettext"); tmp_level = val1 /10.; () = printf("%f\n", tmp_level); When I run this script, I get: 856.300000 INF When I delete the second line: tmp_level = val1 /10.; I get: 856.300000 856.300000 as expected. What is gettext doing to my variables? Thanks in advance for any help. Bernhard [second shot - other email address] From p.boekholt at gmail.com Tue Jul 26 06:35:19 2011 From: p.boekholt at gmail.com (Paul Boekholt) Date: Tue, 26 Jul 2011 08:35:19 +0200 Subject: [slang-users] module gettext In-Reply-To: <4E2DD2E2.8010707@bit-field.de> References: <4E2DD2E2.8010707@bit-field.de> Message-ID: Hello Bernhard, 2011/7/25 Bernhard Sch?nhammer : > What is gettext doing to my variables? Looks like S-Lang's float parser isn't locale agnostic. This bug must have been present for ages, I will fix. You can work around it by adding a line setlocale(LC_NUMERIC, "C"); Actually I think this may be a problem in S-Lang. Since it's an embeddable language, it shouldn't rely on the locale setting. See also http://www.python.org/dev/peps/pep-0331/ and https://bugs.php.net/bug.php?id=17815 for discussions of similar problems in python and php. Paul From B.Schoenhammer at bit-field.de Tue Jul 26 07:17:21 2011 From: B.Schoenhammer at bit-field.de (=?ISO-8859-1?Q?Bernhard_Sch=F6nhammer?=) Date: Tue, 26 Jul 2011 09:17:21 +0200 Subject: [slang-users] module gettext In-Reply-To: References: <4E2DD2E2.8010707@bit-field.de> Message-ID: <4E2E6A01.80705@bit-field.de> Am 26.07.2011 08:35, schrieb Paul Boekholt: > setlocale(LC_NUMERIC, "C"); Hello Paul, thanks very much for the quick answer and the work around. Bernhard From p.boekholt at gmail.com Sun Jul 31 09:54:47 2011 From: p.boekholt at gmail.com (Paul Boekholt) Date: Sun, 31 Jul 2011 11:54:47 +0200 Subject: [slang-users] slgettext 0.2.0 Message-ID: Hi, Version 0.2.0 of the gettext module is out. This version fixes the floating point bug reported by Bernhard Sch?nhammer this week. You can get it from http://www.cheesit.com/downloads/slang/slgettext.html Paul From zhtx10 at gmail.com Sun Oct 2 04:08:44 2011 From: zhtx10 at gmail.com (=?UTF-8?B?57q15qiq5aSp5LiL?=) Date: Sun, 2 Oct 2011 12:08:44 +0800 Subject: [slang-users] freer license? In-Reply-To: References: Message-ID: I'm interested in slang, and would like to make my app extensible with slang. My app is always under the terms of BSD license. However,slang is under GPL! Well, why don't choose a freer license? Sorry for my poor english. Best regards, Mike. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.jedsoft.org/pipermail/slang-users-l/attachments/20111002/93da2476/attachment.html From g.esp at free.fr Tue Oct 11 18:08:54 2011 From: g.esp at free.fr (Gilles Espinasse) Date: Tue, 11 Oct 2011 20:08:54 +0200 Subject: [slang-users] [PATCH] Fix detection of wide version of ncurses config program Message-ID: <1318356534-3955-1-git-send-email-g.esp@free.fr> Name is ncursesw5-config, not ncurses5w-config, even cross-LFS made that same error (but not LFS) Seen with ncurses-5.8 and 5.9, probably true since the beginning as google hits count for the first is 60 times more than the second. Signed-off-by: Gilles Espinasse --- autoconf/aclocal.m4 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/autoconf/aclocal.m4 b/autoconf/aclocal.m4 index d5eb3f2..fdca9cb 100644 --- a/autoconf/aclocal.m4 +++ b/autoconf/aclocal.m4 @@ -469,7 +469,7 @@ AC_DEFUN([JD_TERMCAP], dnl#{{{ AC_PATH_PROG(nc5config, ncurses5-config, no) if test "$nc5config" = "no" then - AC_PATH_PROG(nc5config, ncurses5w-config, no) + AC_PATH_PROG(nc5config, ncursesw5-config, no) fi AC_MSG_CHECKING(for terminfo) if test "$nc5config" != "no" -- 1.5.6.5 From thomas.dauser at sternwarte.uni-erlangen.de Thu Nov 10 09:34:53 2011 From: thomas.dauser at sternwarte.uni-erlangen.de (Thomas Dauser) Date: Thu, 10 Nov 2011 10:34:53 +0100 Subject: [slang-users] fork with shared memory Message-ID: <4EBB9ABD.2050402@sternwarte.uni-erlangen.de> Dear users of slang, I'm want to create two processes, which exchange information. Using fork(), a simple test program, would look like this: % ---------------------------------------- % variable pid = fork(); variable test = 0; % change variable in the child process if (pid == 0) { test = 1; _exit(1); } vmessage("Test variable: %d", test ); % ---------------------------------------- % Clearly, in this case no information is exchanged, as no memory is shared, hence the result is "0". Now my question: Is there any possibility to do this with shared memory, such that the child process changes the value of the "test"-variable? I found things like shmget() and vfork() for other programming languages, but I did not find any slang-function, which can solve this issue. Cheers, Thomas From davis at space.mit.edu Thu Nov 10 18:45:52 2011 From: davis at space.mit.edu (John E. Davis) Date: Thu, 10 Nov 2011 13:45:52 -0500 Subject: [slang-users] fork with shared memory In-Reply-To: <4EBB9ABD.2050402@sternwarte.uni-erlangen.de> References: <4EBB9ABD.2050402@sternwarte.uni-erlangen.de> Message-ID: <201111101845.pAAIjqEF020231@aluche.mit.edu> Thomas Dauser wrote: [...] > Now my question: Is there any possibility to do this with shared memory, > such that the child process changes the value of the "test"-variable? > I found things like shmget() and vfork() for other programming > languages, but I did not find any slang-function, which can solve this > issue. As far as I know, vfork is mainly used to call one of the exec functions; it is unclear to me from your example if that is what you want. As you discovered, slang has no shared memory module. I have not written one because I never saw the utility of such a generic module for a dynamically-typed interpreter where the memory attached to a variable changes over time. Rather I think that it is better to use a message-based system to communicate between interpreter processes, e.g., via a socket. Even if slang were to have a shared memory module, there would still be the need to synchronize read/writes to a memory segment through the use of semaphores, etc. That is, the processes would still need some form of communication to properly share the memory. Below is a simple example slsh script that creates a process to ROT13 a character string and send the encoded string back to the parent process. Although it does not define any explicit message interface, it should give you an idea of what is involved at the lowest level. A much higher level interface exists in the isis source code in a file called fork_socket.sl. This file is not isis-specific and should run in any slang interpreter. It is used to perform parallel processing on a multicore CPU. I hope this helps. Thanks, --John ------------------------------------------------------------------------ require ("fork"); require ("socket"); private define create_process_info (s, pid) { variable p = struct { fp = fdopen (s, "w+"), pid = pid, s = s, }; % turn off buffering of stdio streams for robust signal handling () = setvbuf (p.fp, _IONBF, 0); return p; } private define create_child (taskfunc, arglist) { variable s1, s2, pid, p; (s1, s2) = socketpair (PF_UNIX, SOCK_STREAM, 0); pid = fork (); if (pid > 0) { () = close (s2); return create_process_info (s1, pid); } % child code signal (SIGINT, SIG_DFL); signal (SIGCHLD, SIG_DFL); () = setpgid (0, 0); () = close (s1); p = create_process_info (s2, pid); _exit ((@taskfunc)(p, __push_list (arglist))); } private define do_rot13 (p) { variable line; while (-1 != fgets (&line, p.fp)) { line = strtrans (line, "a-mn-zA-MN-Z", "n-za-mN-ZA-M"); () = fputs (line, p.fp); } () = fclose (p.fp); return 0; } private variable Sigchld_Received = 0; private define sigchld_handler (sig) { Sigchld_Received++; } define slsh_main () { signal (SIGCHLD, &sigchld_handler); variable p = create_child (&do_rot13, {}); variable rline = slsh_readline_new ("demo"); while (Sigchld_Received == 0) { variable line; try { line = slsh_readline (rline, "demo> "); } catch UserBreakError: line = NULL; if (line == NULL) break; if ((-1 == fprintf (p.fp, "---> %s\n", line)) || (-1 == fgets (&line, p.fp))) break; () = fprintf (stdout, "%s", line); } () = kill (p.pid, SIGTERM); () = waitpid (p.pid, 0); } From thomas.dauser at sternwarte.uni-erlangen.de Tue Nov 15 16:01:32 2011 From: thomas.dauser at sternwarte.uni-erlangen.de (Thomas Dauser) Date: Tue, 15 Nov 2011 17:01:32 +0100 Subject: [slang-users] fork with shared memory In-Reply-To: <201111101845.pAAIjqEF020231@aluche.mit.edu> References: <4EBB9ABD.2050402@sternwarte.uni-erlangen.de> <201111101845.pAAIjqEF020231@aluche.mit.edu> Message-ID: <4EC28CDC.2060909@sternwarte.uni-erlangen.de> Hi again, I managed to send information between different processes using the isis functions in fork_socket.sl. However, one more question remains unsolved to me: Is there a possibility to create something like a "probe_obj" function, such that I only "recveive" an object if it was acutally sent to me? Functions for receiving objects like fread (and the according higher level functions) always wait until something is actually received. Below is a small example, which should illustrate how the function "probe_obj" should work: ------------------------------- require("fork_socket.sl"); () = new_slave_list(); slv = fork_slave(&function_eventually_sends_an_object); tic; forever { if (probe_obj(slv)) { variable obj = recv_obj(slv); message("Object successfully received!"); break; } if (toc > 100.) { message("Process timed out ..."); break; } sleep(0.1); } ------------------------------- Cheers, Thomas On 11/10/2011 07:45 PM, John E. Davis wrote: > Thomas Dauser wrote: > [...] >> Now my question: Is there any possibility to do this with shared memory, >> such that the child process changes the value of the "test"-variable? >> I found things like shmget() and vfork() for other programming >> languages, but I did not find any slang-function, which can solve this >> issue. > [...] > Below is a simple example slsh script that creates a process to ROT13 > a character string and send the encoded string back to the parent > process. Although it does not define any explicit message interface, > it should give you an idea of what is involved at the lowest level. A > much higher level interface exists in the isis > source code in a file called > fork_socket.sl. This file is not isis-specific and should run in any > slang interpreter. It is used to perform parallel processing on a > multicore CPU. From kristen.eisenberg at yahoo.com Tue Nov 15 17:57:08 2011 From: kristen.eisenberg at yahoo.com (Kristen Eisenberg) Date: Tue, 15 Nov 2011 09:57:08 -0800 (PST) Subject: [slang-users] Color Settings .. Message-ID: <1321379828.89739.YahooMailNeo@web122307.mail.ne1.yahoo.com> Happy New year all ... I was wondering if S-Lang supports 256 Color combo of which the xterm program can now support as well as the Frame Buffer console settings. If not, what would be be required to make it so? ? Kristen Eisenberg Billige Fl?ge Marketing GmbH Emanuelstr. 3, 10317 Berlin Deutschland Telefon: +49 (33) 5310967 Email: utebachmeier at gmail.com Site: http://flug.airego.de - Billige Fl?ge vergleichen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.jedsoft.org/pipermail/slang-users-l/attachments/20111115/15d452a4/attachment.html From davis at space.mit.edu Wed Nov 16 04:10:31 2011 From: davis at space.mit.edu (John E. Davis) Date: Tue, 15 Nov 2011 23:10:31 -0500 Subject: [slang-users] fork with shared memory In-Reply-To: <4EC28CDC.2060909@sternwarte.uni-erlangen.de> References: <4EBB9ABD.2050402@sternwarte.uni-erlangen.de> <201111101845.pAAIjqEF020231@aluche.mit.edu> <4EC28CDC.2060909@sternwarte.uni-erlangen.de> Message-ID: <201111160410.pAG4AVs1005816@aluche.mit.edu> Thomas Dauser wrote: > I managed to send information between different processes using the isis > functions in fork_socket.sl. > However, one more question remains unsolved to me: Is there a > possibility to create something like a "probe_obj" function, such that I > only "recveive" an object if it was acutally sent to me? Functions for > receiving objects like fread (and the according higher level functions) > always wait until something is actually received. The isis fork_socket code was written to facilitate function minimization over multiple CPUs for rapidly producing confidence maps, etc. As such it is lacking some of the more generic features that you have in mind. Nevertheless, it can be "tricked" into doing what you want, as the example code below shows. If you would like to see additional functionality added to fork_socket, then I suggest that you bring this up on the isis mailing list . Good luck, --John require ("fork_socket"); private define slave_task (s) { % perform a big computation sleep (10); variable result = [1:10]; send_msg (s, SLAVE_RESULT); send_objs (s, result); send_msg (s, SLAVE_EXITING); return 0; } private define message_handler (s, msg) { switch (msg.type) { case SLAVE_RESULT: s.data = 1; @(qualifier("num_results")) += 1; } } private define one_shot () { variable x = qualifier ("v"); if (@x == 0) return 0; @x = 0; return 1; } private define check_messages (slist) { foreach (slist) { variable s = (); variable status = select (s.sock, NULL, NULL, 0); if ((status == NULL) || status.nready) break; } then return 0; variable x = 1, num_results = 0; manage_slaves (slist, &message_handler ; while_=&one_shot, v=&x, num_results = &num_results); return num_results; } define slsh_main () { variable slist = new_slave_list (); list_append (slist, fork_slave (&slave_task)); while (0 == check_messages (slist)) { () = fputs (".", stdout); () = fflush (stdout); sleep (1); } foreach (slist) { variable s = (); if (s.data == 1) { variable obj = recv_objs (s); print (obj); } } manage_slaves (slist, NULL); } From davis at space.mit.edu Wed Nov 16 04:17:36 2011 From: davis at space.mit.edu (John E. Davis) Date: Tue, 15 Nov 2011 23:17:36 -0500 Subject: [slang-users] Color Settings .. In-Reply-To: <1321379828.89739.YahooMailNeo@web122307.mail.ne1.yahoo.com> References: <1321379828.89739.YahooMailNeo@web122307.mail.ne1.yahoo.com> Message-ID: <201111160417.pAG4Hao5005875@aluche.mit.edu> Hi Kristen, > Happy New year all ...I was wondering if S-Lang supports 256 Color > combo of which the xterm program can now support as well as the It has had 256 color support for a number of years. See for a similar question. Thanks, --John From p.boekholt at gmail.com Thu Dec 22 16:16:56 2011 From: p.boekholt at gmail.com (Paul Boekholt) Date: Thu, 22 Dec 2011 17:16:56 +0100 Subject: [slang-users] mysqlclient 0.0.4 Message-ID: Hi, The fourth beta of the mysqlclient library is out. This version uses the chksum module in S-Lang 2.3 and higher and has some new functions: - affected_rows - insert_id - escape I've also added some unit tests. You can get it from http://www.cheesit.com/downloads/slang/mysqlclient.html Paul