Re: [Jprogramming] getline

2018-06-21 Thread Raul Miller
Actually... thinking about this a bit more, there were some error cases where I wouldn't properly cleanup after. Here's a better approach: cfgets=:3 :0 y=. {.y,999 NB. max line length r=. '' libc=. (' ',~unxlib'c') 2 :'(m,n)&cd' err=. [:echo],' error: ',1{::cderx bind'' fd=. 'dup >i i'libc 0

Re: [Jprogramming] getline

2018-06-21 Thread Raul Miller
And here's a version of Xiao-Yong Jin's implementation that cleans up after itself (and checks for errors (though that might be overkill): cfgets=:3 :0 y=. {.y,999 NB. max line length libc=. (' ',~unxlib'c') 2 :'(m,n)&cd' fd=. 'dup >i i'libc 0 if. 0>fd do. echo 'dup error: ',1{::cderx'' el

Re: [Jprogramming] restarting JQt

2018-06-21 Thread Ian Clark
Thanks, Chris and Bill. If that's the only serious way to do it, I'll experiment along those lines. I have a system-macro writer called Keyboard Maestro which I guess can be turned to the purpose. On Thu, Jun 21, 2018 at 2:02 PM, chris burke wrote: > Close down and restart is needed to get a cl

Re: [Jprogramming] getline

2018-06-21 Thread Raul Miller
Ah, never mind - this works fine in jconsole: l=.({.~i.&LF)memr b,0,s[(c,' fgets *c *c i *')cd( i i',~c=.unxlib'c');1 1$'r' (Though repeated use should split that between setup and the actual line read, and of course, you would want a larger value for s if you wanted to read longer lines.) Thank

Re: [Jprogramming] getline

2018-06-21 Thread Raul Miller
Oddly, that doesn't work on my machine. It looks plausible, though. Thanks, -- Raul On Thu, Jun 21, 2018 at 3:09 AM Xiao-Yong Jin wrote: > > You can also call c library functions. > >l=.({.~i.&LF)memr b,0,s[(c,' fgets *c *c i *')cd( s);(s=.256); i > i',~c=.unxlib'c');1 1$'r' > hello read

Re: [Jprogramming] wiki maintenance

2018-06-21 Thread chris burke
The move should be done now, and you are free to edit the wiki again. The only visible change should be the use of https rather than http in the url. Also, the version page at code.jsoftware.com/wiki/Special:Version should show 1.31.0 . The old wiki will still be available at oldcode.jsoftware.co

Re: [Jprogramming] wiki maintenance

2018-06-21 Thread chris burke
I will work on this now. To start with, the old wiki will be made read only. On Tue, Jun 19, 2018 at 6:01 PM, chris burke wrote: > The wiki will be moved to a new server on Thursday, likely around noon > GMT. It will have the latest mediawiki version 1.31 and use https. > Otherwise the look and

Re: [Jprogramming] restarting JQt

2018-06-21 Thread chris burke
Close down and restart is needed to get a clean system. I have several shortcuts that start J in various ways. So I manually close J (for me by pressing Esc) and then click a shortcut. However, restart can be done with something like the following (in Linux): exit 2!:0 '~/j8/jqt.sh &' This s

Re: [Jprogramming] restarting JQt

2018-06-21 Thread bill lam
I don't booting up J is idempotent. May be you can try write a script which kill the current process and then start a new J. (untested) On Thu, Jun 21, 2018, 6:17 PM Ian Clark wrote: > Am I the only person with a need to reliably restart JQt (running on OS X) > with a choice of (diagnostic) star

Re: [Jprogramming] wiki maintenance

2018-06-21 Thread Linda Alvord
Get Outlook for Android From: Programming on behalf of chris burke Sent: Wednesday, June 20, 2018 10:47:09 AM To: Programming forum Subject: Re: [Jprogramming] wiki maintenance > Is this just a server change? Will the wiki syntax be un

[Jprogramming] restarting JQt

2018-06-21 Thread Ian Clark
Am I the only person with a need to reliably restart JQt (running on OS X) with a choice of (diagnostic) startup scripts? If not, what do other people do? Simply loading '~system/util/boot.ijs' requires garbage to be first identified and erased. Erasing all locales doesn't work, because boot.ijs

Re: [Jprogramming] getline

2018-06-21 Thread Xiao-Yong Jin
You can also call c library functions. l=.({.~i.&LF)memr b,0,s[(c,' fgets *c *c i *')cd( i i',~c=.unxlib'c');1 1$'r' hello read line (;$)l ┌───┬──┐ │hello read line│15│ └───┴──┘ (c,' fclose i *')cd On Jun 19, 2018, at 8:13 PM, Raul Miller wrote: > > Actually, th