Re: [Factor-talk] Conditionally execute words in .factor-rc

2016-05-29 Thread Martin Saurer
Hi John

 

I tried to do this using lookup-word earlier, but with no success.

 

The execute( word was exactly what I was looking for.

Now everything work as expected.

 

Thanks for putting me in the right direction.

 

Best

 

Martin

 

Von: John Benediktsson [mailto:mrj...@gmail.com] 
Gesendet: Dienstag, 24. Mai 2016 23:53
An: factor-talk@lists.sourceforge.net
Betreff: Re: [Factor-talk] Conditionally execute words in .factor-rc

 

Yes, a few different ways:

 

1) The entire file is parsed so if you have a word that is available in 0.98 
but not in 0.97, you either have to call it dynamically:

 

"vm-version" "system" lookup-word execute( -- string )

 

or

 

2) Make separate files for 0.97 and 0.98, unfortunately we don't have good 
version words prior to 0.98, but you could do something like this:

 

   "vm-version" "system" lookup-word [
execute( -- string ) ".factor-rc-" prepend run-file

] [

".factor-rc-0.97" run-file

    ] if*

 

 

 

On Tue, May 24, 2016 at 12:19 PM, Martin Saurer  
wrote:

Dear all,

Is there a way to conditionally execute words?

For example: In one image "fuel" is loaded. In another image "fuel" is not 
loaded.
Or: In Factor 0.98 there is a word "vm-version". In Factor 0.97 there is no 
such word.

Is it possible to write a .factor-rc startup file that handles different 
environments and/or
Factor versions?

In Python I'm doing this the following way:

if sys.version_info[0] == 2:
  from BaseHTTPServer import BaseHTTPRequestHandler
  from BaseHTTPServer import HTTPServer
else:
  from http.serverimport BaseHTTPRequestHandler
  from http.serverimport HTTPServer

Many thanks in advance.

Martin



--
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

 

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Conditionally execute words in .factor-rc

2016-05-24 Thread Martin Saurer
Dear all,

Is there a way to conditionally execute words?

For example: In one image "fuel" is loaded. In another image "fuel" is not 
loaded.
Or: In Factor 0.98 there is a word "vm-version". In Factor 0.97 there is no 
such word.

Is it possible to write a .factor-rc startup file that handles different 
environments and/or
Factor versions?

In Python I'm doing this the following way:

if sys.version_info[0] == 2:
  from BaseHTTPServer import BaseHTTPRequestHandler
  from BaseHTTPServer import HTTPServer
else:
  from http.serverimport BaseHTTPRequestHandler
  from http.serverimport HTTPServer

Many thanks in advance.

Martin



--
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Ubuntu 15.04

2015-10-25 Thread Martin Saurer
Have you tried compiling factor from source, then load the boot image?

On my Ubuntu 15.10 both 0.97 and latest from git work nice.

Best

Martin

-Ursprüngliche Nachricht-
Von: Andrea Ferretti [mailto:ferrettiand...@gmail.com] 
Gesendet: Freitag, 23. Oktober 2015 15:07
An: factor-talk@lists.sourceforge.net
Betreff: Re: [Factor-talk] Ubuntu 15.04

Unfortunately, still getting the error on devel

2015-10-23 15:00 GMT+02:00 Andrea Ferretti :
> Ok, it seems it depends on my Nvidia drivers. Launching 0.97 with the 
> gtk.ffi fix gave a more detailed explanation of the error
>
> Thank you!
>
> 2015-10-23 14:44 GMT+02:00 John Benediktsson :
>> Sorry, it is:
>>
>>"gtk.ffi" reload save
>>
>>
>>> On Oct 23, 2015, at 5:40 AM, John Benediktsson  wrote:
>>>
>>> For 0.97, can you try:
>>>
>>>$ ./factor -run=listener
>>>IN: scratchpad "gtk" reload save
>>>
>>> Then quit and try the UI again?
>>>
>>> We will have to investigate the error with latest git master.
>>>
>>>
 On Oct 23, 2015, at 2:27 AM, Andrea Ferretti 
wrote:

 I have tried, without chance, to run factor on Ubuntu 15.04 (and I 
 will move to 15.10 soon).

 The 0.97 version fails with

 Cannot resolve C library function
 Library: DLL" /usr/lib/libgtk-x11-2.0.so.0"
 Symbol: gtk_init


 On the dev version I get a memory error:

 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 errors.
 Memory protection fault at address 7f920fce6360

 Is there anyone using Factor on latest Ubuntu?

 ---
 --- ___
 Factor-talk mailing list
 Factor-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/factor-talk
>>
>> -
>> - ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk


--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] webapps.todo

2011-08-22 Thread Martin Saurer
Hi Slava,

Here the output, when I try to start factor.com after building it,
using "factor.cmd latest".

   C:\Home\Program\C\Factor> factor.com
   Error in thread 23 (UI update, [ self ui-thread set-global update-ui-loop
]):

   Quotation's stack effect does not match call site
   quot  [ yield ]
   call-site (( callback -- ))

   (O) Word: ( callback )
   (O) Word: wrong-values
   (O) Method: M\ object throw
   (U) Quotation: [
   63 special-object error-thread set-global
   continuation -> error-continuation set-global
   [ original-error set-global ] [ rethrow ] bi
   ]

BTW: To successfully build factor under VS2005 using factor.cmd, I have had
to
change Nmakefile:
#CL_FLAGS = /nologo /O2 /WX /W3 /D_CRT_SECURE_NO_WARNINGS
CL_FLAGS = /nologo /O2 /W3 /D_CRT_SECURE_NO_WARNINGS

I have also made changes in factor.cmd:
rem cscript /nologo build-support\http-get.vbs
http://factorcode.org/images/%_bootimage_path%/%_bootimage% %_bootimage%
cscript /nologo build-support\http-get.vbs
http://downloads.factorcode.org/images/%_bootimage_path%/%_bootimage%
%_bootimage%


Kind Regards
Martin

-Ursprüngliche Nachricht-
Von: Slava Pestov [mailto:sl...@factorcode.org] 
Gesendet: Montag, 22. August 2011 21:58
An: factor-talk@lists.sourceforge.net
Betreff: Re: [Factor-talk] webapps.todo

Hi Martin,

On Mon, Aug 22, 2011 at 11:56 AM, Martin Saurer
 wrote:
> I tried it with the factor 0.94 build from factorcode.org => no success
> I tried it with an own clean build of 0.94 => no success
> When I build the latest version using "factor.cmd latest", I end up
> with a factor environment that cannot start the GUI.

Can you share the error message?

Slava


--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] webapps.todo

2011-08-22 Thread Martin Saurer
Hi Dave,

Many thanks for your response.

What I don't understand is that it seems that  is called
during compile/load time.
That's why I fully commented out .

Reloading webapps.todo, stopping factor, starting it again,
load webapps.todo in a "clean" factor environment ...
Nothing helps :-(

Trying the same on my Mac, everything is working.

My Windows environment is a Vista 32Bit / Business.

I tried it with the factor 0.94 build from factorcode.org => no success
I tried it with an own clean build of 0.94 => no success
When I build the latest version using "factor.cmd latest", I end up
with a factor environment that cannot start the GUI.

So, you see, I'm somewhat confused ...

Anyway, thanks again.
I'm going to make a few more tests, tomorrow.

Kind Regards

Martin


Sent from my iPad

On 22.08.2011, at 20:11, otoburb  wrote:

> Hi Martin,
> 
> The error message that you are seeing indicates that 
> is being called somewhere. This should only be called or used if the
> io.sockets.secure vocabulary is being used, which should not be the
> case for Windows because we agreed that we disabled/commented those
> lines in the webapps/todo.factor file.
> 
> Did you reload the webapps.todo file after you modified it? You can do
> this with:
> (scratchpad) "webapps.todo" reload
> 
> Then you can try running webapps.todo again to see if this worked.
> 
> By the way -- I tried this on Windows Vista, 32-bit Home Premium
> Edition with the latest git build. Did you use the versions downloaded
> from the factorcode.org site, or did you build the latest git version?
> 
> 
> Regards,
> Dave
> 
> On Mon, Aug 22, 2011 at 2:10 AM, Martin Saurer  
> wrote:
>> Dave,
>> 
>> Thanks for your hints.
>> 
>> When I exactly do what you describe, I get the following error:
>> 
>>   Generic word  does not define a method for the POSTPONE:
>> f class.
>> 
>> when executing the statement:
>> 
>>   "webapps.todo" run
>> 
>> 
>> I have had to comment out the whole  word, to make
>> the server start.
>> 
>> The server starts, and I can connect, but get the error described
>> in my first email in the web server log file.
>> 
>> I'm getting crazy ...
>> 
>> Kind Regards
>> Martin
>> 
>> 
>> 
>> -Ursprüngliche Nachricht-
>> Von: otoburb [mailto:otob...@gmail.com]
>> Gesendet: Sonntag, 21. August 2011 19:49
>> An: factor-talk@lists.sourceforge.net
>> Betreff: Re: [Factor-talk] webapps.todo
>> 
>> Hi Martin,
>> 
>> I just ran the webapps.todo application and registered, logged in and
>> created a sample todo list.
>> Here's what I did.
>> 
>> 1) As you said, modify the webapps.todo (under Windows) so that it
>> "disables" the secure configuration. This is done by commenting out
>> line 158 and 160, and adding a semi-colon to the end of line 159. The
>> relevant code snippet below:
>> 
>> :  ( -- threaded-server )
>>
>> ! >>secure-config
>>8080 >>insecure ;
>> !8431 >>secure ;
>> 
>> 
>> 2) In the Factor listener, I typed:
>> 
>> (scratchpad) USE: webapps.todo
>> (scratchpad) "webapps.todo" run
>> 
>> 3) http://localhost:8080
>> 
>> I am using Windows Vista.
>> 
>> 
>> 
>> Regards,
>> Dave
>> 
>> 
>> On Sun, Aug 21, 2011 at 6:34 AM, Martin Saurer 
>> wrote:
>>> Dear all,
>>> 
>>> 
>>> 
>>> Has anybody successfully setup and run the webapps.todo application
>>> 
>>> under Windows?
>>> 
>>> 
>>> 
>>> I know, there seems to be no factor-compatible openssl implementation
>>> 
>>> for Windows.
>>> 
>>> So I modified the todo.factor to "disable" the secure configuration
>>> 
>>> and run the webapp on the insecure port 8080 only.
>>> 
>>> 
>>> 
>>> But when I try to connect to this webapp, a server error is reported in
>>> 
>>> the browser, and the server logfile says:
>>> 
>>> 
>>> 
>>> [2011-08-21T11:29:56+02:00] NOTICE handle-client: { T{ duplex-stream f
>>> ~decoder~ ~encoder~ } T{ inet6 f "0:0:0:0:0:0:0:1" 49764 } T{ inet6 f
>>> "0:0:0:0:0:0:0:0" 8080 } }
>>> 
>>> [2011-08-21T11:29:56+02:00] NOTICE accepted-connection: remote:
>>> 0:0:0:0:0:0:0:1:49764, local: 0:0:0:0:0:0:0:0:8080
>>> 
>>> [

Re: [Factor-talk] webapps.todo

2011-08-21 Thread Martin Saurer
Dave,

Thanks for your hints.

When I exactly do what you describe, I get the following error:

   Generic word  does not define a method for the POSTPONE:
f class.

when executing the statement:

   "webapps.todo" run


I have had to comment out the whole  word, to make
the server start.

The server starts, and I can connect, but get the error described
in my first email in the web server log file.

I'm getting crazy ...

Kind Regards
Martin



-Ursprüngliche Nachricht-
Von: otoburb [mailto:otob...@gmail.com] 
Gesendet: Sonntag, 21. August 2011 19:49
An: factor-talk@lists.sourceforge.net
Betreff: Re: [Factor-talk] webapps.todo

Hi Martin,

I just ran the webapps.todo application and registered, logged in and
created a sample todo list.
Here's what I did.

1) As you said, modify the webapps.todo (under Windows) so that it
"disables" the secure configuration. This is done by commenting out
line 158 and 160, and adding a semi-colon to the end of line 159. The
relevant code snippet below:

:  ( -- threaded-server )

! >>secure-config
8080 >>insecure ;
!8431 >>secure ;


2) In the Factor listener, I typed:

(scratchpad) USE: webapps.todo
(scratchpad) "webapps.todo" run

3) http://localhost:8080

I am using Windows Vista.



Regards,
Dave


On Sun, Aug 21, 2011 at 6:34 AM, Martin Saurer 
wrote:
> Dear all,
>
>
>
> Has anybody successfully setup and run the webapps.todo application
>
> under Windows?
>
>
>
> I know, there seems to be no factor-compatible openssl implementation
>
> for Windows.
>
> So I modified the todo.factor to "disable" the secure configuration
>
> and run the webapp on the insecure port 8080 only.
>
>
>
> But when I try to connect to this webapp, a server error is reported in
>
> the browser, and the server logfile says:
>
>
>
> [2011-08-21T11:29:56+02:00] NOTICE handle-client: { T{ duplex-stream f
> ~decoder~ ~encoder~ } T{ inet6 f "0:0:0:0:0:0:0:1" 49764 } T{ inet6 f
> "0:0:0:0:0:0:0:0" 8080 } }
>
> [2011-08-21T11:29:56+02:00] NOTICE accepted-connection: remote:
> 0:0:0:0:0:0:0:1:49764, local: 0:0:0:0:0:0:0:0:8080
>
> [2011-08-21T11:29:56+02:00] NOTICE handle-client: { T{ duplex-stream f
> ~decoder~ ~encoder~ } T{ inet6 f "0:0:0:0:0:0:0:1" 49765 } T{ inet6 f
> "0:0:0:0:0:0:0:0" 8080 } }
>
> [2011-08-21T11:29:56+02:00] NOTICE accepted-connection: remote:
> 0:0:0:0:0:0:0:1:49765, local: 0:0:0:0:0:0:0:0:8080
>
> [2011-08-21T11:29:56+02:00] NOTICE httpd-hit: { "GET" URL"
> http://localhost:8080/"; }
>
> [2011-08-21T11:29:56+02:00] NOTICE httpd-header: { "user-agent"
"Mozilla/5.0
> (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)" }
>
> [2011-08-21T11:29:56+02:00] NOTICE httpd-header: { "x-forwarded-for" f }
>
> [2011-08-21T11:29:56+02:00] DEBUG init-user: f
>
> [2011-08-21T11:29:56+02:00] ERROR do-request: Generic word port>> does not
> define a method for the POSTPONE: f class.
>
> [] ERROR do-request: Dispatching on object: f
>
>
>
> What am I missing ???
>
>
>
> Many thanks in advance.
>
>
>
> Martin
>
>
>
>
>
>

--
> Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
> user administration capabilities and model configuration. Take
> the hassle out of deploying and managing Subversion and the
> tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>


--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] webapps.todo

2011-08-21 Thread Martin Saurer
Dear all,
 
Has anybody successfully setup and run the webapps.todo application
under Windows?
 
I know, there seems to be no factor-compatible openssl implementation
for Windows.
So I modified the todo.factor to "disable" the secure configuration
and run the webapp on the insecure port 8080 only.
 
But when I try to connect to this webapp, a server error is reported in
the browser, and the server logfile says:
 
[2011-08-21T11:29:56+02:00] NOTICE handle-client: { T{ duplex-stream f
~decoder~ ~encoder~ } T{ inet6 f "0:0:0:0:0:0:0:1" 49764 } T{ inet6 f
"0:0:0:0:0:0:0:0" 8080 } }
[2011-08-21T11:29:56+02:00] NOTICE accepted-connection: remote:
0:0:0:0:0:0:0:1:49764, local: 0:0:0:0:0:0:0:0:8080
[2011-08-21T11:29:56+02:00] NOTICE handle-client: { T{ duplex-stream f
~decoder~ ~encoder~ } T{ inet6 f "0:0:0:0:0:0:0:1" 49765 } T{ inet6 f
"0:0:0:0:0:0:0:0" 8080 } }
[2011-08-21T11:29:56+02:00] NOTICE accepted-connection: remote:
0:0:0:0:0:0:0:1:49765, local: 0:0:0:0:0:0:0:0:8080
[2011-08-21T11:29:56+02:00] NOTICE httpd-hit: { "GET" URL"
http://localhost:8080/"; }
[2011-08-21T11:29:56+02:00] NOTICE httpd-header: { "user-agent" "Mozilla/5.0
(compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)" }
[2011-08-21T11:29:56+02:00] NOTICE httpd-header: { "x-forwarded-for" f }
[2011-08-21T11:29:56+02:00] DEBUG init-user: f
[2011-08-21T11:29:56+02:00] ERROR do-request: Generic word port>> does not
define a method for the POSTPONE: f class.
[] ERROR do-request: Dispatching on object: f
 
What am I missing ???
 
Many thanks in advance.
 
Martin
 
 
--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk