Re: [Factor-talk] A bug ?

2015-10-01 Thread Björn Lindqvist
2015-10-01 8:47 GMT+02:00 HP Wei : > Thanks for suggesting to look at the source of (directory-entries) > > I see that the iterator over a directory is the word: with-unix-directory > and (directory-entries) uses produce to collect the entries into a sequence. > > I did not find

Re: [Factor-talk] Fwd: how to error trapping 'link-info'

2015-10-01 Thread John Benediktsson
The equivalent would be: [ link-info dup symbolic-link? [ drop ] [ size>> + ] if ] [ drop ] recover On Thu, Oct 1, 2015 at 6:54 AM, HP wei wrote: > Just want to elaborate on what I meant by 'error trapping' link-info. > > [ link-info dup symbolic-link? [ drop ] [

[Factor-talk] how to error trapping 'link-info'

2015-10-01 Thread HP wei
As suggested by John, I test out the following action to get the total file sizes of a disk volume. 0 "a_path_to_big_folder" [ link-info dup symbolic-link? [ drop ] [ size>> + ] if ] each-file Our big-folder is on a netapp server shared by tens of people. Many small files get updated every

[Factor-talk] Fwd: how to error trapping 'link-info'

2015-10-01 Thread HP wei
Just want to elaborate on what I meant by 'error trapping' link-info. [ link-info dup symbolic-link? [ drop ] [ size>> + ] In python's syntax, I would write the above quot as something like: try: file_info = link_info(dir_entry) if not is_symbolic_link(file_info): total_size +=

[Factor-talk] remote listener over tcp

2015-10-01 Thread HP wei
The objective: we have several linux machines that I need to check on certain status (--- disks, update-jobs etc). My plan is, if feasible, to run a remote factor-listener on each of those machines and run a 'master' factor on a machine that collects all info and presents

Re: [Factor-talk] remote listener over tcp

2015-10-01 Thread John Benediktsson
We have support for that in our FUEL package for emacs. Probably it could be factored (ahem) out, but this is how you can do it, starting on port 9000: IN: scratchpad USE: fuel.remote IN: scratchpad 9000 fuel-start-remote-listener Then somewhere else: $ telnet machine 9000 On

Re: [Factor-talk] potential memory issue --- Fwd: how to error trapping 'link-info'

2015-10-01 Thread John Benediktsson
Maybe you can debug a little if you see that happen again? Perhaps something like this to get the largest number of instances, if there is a per-file leak: IN: scratchpad all-instances [ class-of ] histogram-by sort-values reverse 10 head . Some other words for

[Factor-talk] potential memory issue --- Fwd: how to error trapping 'link-info'

2015-10-01 Thread HP wei
Well, I just checked the running factor session that failed the task overnight that I mentioned in below email. >From the linux system command 'top', I see that this particular factor is using VIRT 4.0g RES 2.0g %MEM 26% I clicked on the restart listener button and the numbers remain the

Re: [Factor-talk] potential memory issue --- Fwd: how to error trapping 'link-info'

2015-10-01 Thread HP wei
Yes, I could find out a bit more about the memory issue. I tried it again this afternoon. After 50 minutes into the action 0 "path" t [ link-info ... ] each-file the system 'top' shows RES rises above 1.2GB and %MEM becomes 15.7% and they continue to rise. It blacks out the gui window of

Re: [Factor-talk] potential memory issue --- Fwd: how to error trapping 'link-info'

2015-10-01 Thread Doug Coleman
You can run your code in the leaks combinator and it will show you what leaked. I suspect that you're just using a lot of memory though. [ { 1 2 3 } [ malloc drop ] each ] leaks members . { ~malloc-ptr~ ~malloc-ptr~ ~malloc-ptr~ } On Thu, Oct 1, 2015 at 12:31 PM, HP wei

Re: [Factor-talk] Ctrl+Break

2015-10-01 Thread Alexander Ilin
Hello! 01.10.2015, 22:33, "HP wei" : > I try to hit Control-C but it continues to run. > *** How to exit a running words ? HP wei raises a very good point. Is there a way to interrupt an infinite loop or a long-running word? If such a mechanism is not there in Factor UI,

Re: [Factor-talk] Ctrl+Break

2015-10-01 Thread Alexander Ilin
Hello! You could have that as a library function, not necessarily written in Factor. The Listener already catches and handles all exceptions raised by running user code, am I right? 02.10.2015, 00:19, "John Benediktsson" : > you can open another listener and suspend the

Re: [Factor-talk] A bug ?

2015-10-01 Thread HP Wei
Thanks for suggesting to look at the source of (directory-entries) I see that the iterator over a directory is the word: with-unix-directory and (directory-entries) uses produce to collect the entries into a sequence. I did not find a word in sequences that is similar to produce but does a

Re: [Factor-talk] Factor on OS X El Capitan broken?

2015-10-01 Thread Sankaranarayanan Viswanathan
I tried re-downloading factor-macosx-x86-64-0.97.dmg from the factorcode.org site, but that shows the same problem. I then tried the development release links for OS X, but those links seem broken. I have yet to attempt to build from source..

[Factor-talk] Factor on OS X El Capitan broken?

2015-10-01 Thread Sankaranarayanan Viswanathan
Hello, I just upgraded my macbook to El Capitan today, and the opening the factor help browser seems broken. I get the message: An error occurred while drawing the world T{ world f ~array~ ~array~ f f ~vector~ ~array~ ~debugger~ t t f This world has been deactivated to prevent cascading

Re: [Factor-talk] Factor on OS X El Capitan broken?

2015-10-01 Thread Doug Coleman
Try the latest one. On Thu, Oct 1, 2015, 19:30 Sankaranarayanan Viswanathan < rationalrev...@gmail.com> wrote: > Hello, > > I just upgraded my macbook to El Capitan today, and the opening the > factor help browser seems broken. I get the message: > > An error occurred while drawing the world T{

Re: [Factor-talk] Factor on OS X El Capitan broken?

2015-10-01 Thread Doug Coleman
I'm not sure why the permissions got broken. It should work now though. On Thu, Oct 1, 2015 at 9:08 PM, John Benediktsson wrote: > Sorry, looks like a permissions error on the downloads server. > > Hopefully we can get that resolved soon. > > El Capitan introduced a GL Error

Re: [Factor-talk] Factor on OS X El Capitan broken?

2015-10-01 Thread John Benediktsson
Sorry, looks like a permissions error on the downloads server. Hopefully we can get that resolved soon. El Capitan introduced a GL Error that was not on previous OS X versions. We have patched the latest code, but if you'd like to get your 0.97 working, you can apply this fix: