[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


[Factor-talk] Factor arm port

2011-08-21 Thread Jon Harper
Hi list,
I saw on the irc logs some talks about reviving the factor arm port.
Are there people working (or willing to work) on this ? I'd be
interested in participating.

Also, I have recently bought an ARM laptop and I could set up a remote
access if needed.
Cheers,
Jon

--
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-21 Thread otoburb
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:

: todo-website-server ( -- threaded-server )
http-server
!todo-secure-config 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 martin.sau...@bluewin.ch 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


[Factor-talk] sequences and the stack

2011-08-21 Thread Andrew Pennebaker
The stack contains a sequence of number pairs:

{ { x1 y1 } { x2 y2 } { x3 y3 } ... }

I want to map over the pairs, accessing xi and yi.

[
   ! stack = { xi yi }

   ! ...

   ! stack = xi yi
] map

What's the code that goes in !... ?

Other than using nth, how can I do this? Is there a word that pops the
elements of a sequence onto the stack?

Cheers,

Andrew Pennebaker
www.yellosoft.us
--
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] sequences and the stack

2011-08-21 Thread Alexander J. Vondrak
first2: http://docs.factorcode.org/content/word-first2,sequences.html

In general, firstn: 
http://docs.factorcode.org/content/word-firstn,sequences.generalizations.html

Regards,
--Alex Vondrak

From: Andrew Pennebaker [andrew.penneba...@gmail.com]
Sent: Sunday, August 21, 2011 11:20 AM
To: Factor
Subject: [Factor-talk] sequences and the stack

The stack contains a sequence of number pairs:

{ { x1 y1 } { x2 y2 } { x3 y3 } ... }

I want to map over the pairs, accessing xi and yi.

[
   ! stack = { xi yi }

   ! ...

   ! stack = xi yi
] map

What's the code that goes in !... ?

Other than using nth, how can I do this? Is there a word that pops the elements 
of a sequence onto the stack?

Cheers,

Andrew Pennebaker
www.yellosoft.ushttp://www.yellosoft.us

--
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] sequences and the stack

2011-08-21 Thread John Benediktsson
Also, for your case a sequence of two elements can be treated a bit like a map 
of key/value pairs.  You can use the assocs vocabulary to manipulate your 
sequence (called an association list or 'alist' in the documentation).

Try:

( scratchpad ) USE: assocs
( scratchpad ) \ assoc-map help
( scratchpad ) \ assoc-each help




On Aug 21, 2011, at 11:26 AM, Alexander J. Vondrak ajvond...@csupomona.edu 
wrote:

 first2: http://docs.factorcode.org/content/word-first2,sequences.html
 
 In general, firstn: 
 http://docs.factorcode.org/content/word-firstn,sequences.generalizations.html
 
 Regards,
 --Alex Vondrak
 
 From: Andrew Pennebaker [andrew.penneba...@gmail.com]
 Sent: Sunday, August 21, 2011 11:20 AM
 To: Factor
 Subject: [Factor-talk] sequences and the stack
 
 The stack contains a sequence of number pairs:
 
 { { x1 y1 } { x2 y2 } { x3 y3 } ... }
 
 I want to map over the pairs, accessing xi and yi.
 
 [
   ! stack = { xi yi }
 
   ! ...
 
   ! stack = xi yi
 ] map
 
 What's the code that goes in !... ?
 
 Other than using nth, how can I do this? Is there a word that pops the 
 elements of a sequence onto the stack?
 
 Cheers,
 
 Andrew Pennebaker
 www.yellosoft.ushttp://www.yellosoft.us
 
 --
 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


[Factor-talk] traslation

2011-08-21 Thread Arkady Rost
Hi! I'm looking for a more elegant solution of the following task.

for i in rangeA {
for j in rangeB {
foo(param, i, j);
}
bar();
}

I need to translate this to factor.

foo(param, y, x) = x y param foo

I have a solution:
rangeA rangeB param [ foo ] curry [ swapd [ call ] 2curry each bar ] 2curry
each

For example,
rangeA = { a b c }
rangeB = { 1 2 3 }
param =  
foo = append append write ;
bar =  print ;

{ a b c } { 1 2 3 }[ append append write ] curry [ swapd [
call ] 2curry each  print ] 2curry each

Result is :
1a 2a 3a
1b 2b 3b
1c 2c 3c

I think my solution is bloated with partial applications. Maybe someone can
provide a better way to solve this task.

Cheers,
Ark. Rost
--
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] traslation

2011-08-21 Thread John Benediktsson
This works for your particular task:

{ 1 2 3 } [
{ a b c } [ append ] with map   join print
] each


On Sun, Aug 21, 2011 at 12:49 PM, Arkady Rost arkr...@gmail.com wrote:

 Hi! I'm looking for a more elegant solution of the following task.

 for i in rangeA {
 for j in rangeB {
 foo(param, i, j);
 }
 bar();
 }

 I need to translate this to factor.

 foo(param, y, x) = x y param foo

 I have a solution:
 rangeA rangeB param [ foo ] curry [ swapd [ call ] 2curry each bar ] 2curry
 each

 For example,
 rangeA = { a b c }
 rangeB = { 1 2 3 }
 param =  
 foo = append append write ;
 bar =  print ;

 { a b c } { 1 2 3 }[ append append write ] curry [ swapd
 [ call ] 2curry each  print ] 2curry each

 Result is :
 1a 2a 3a
 1b 2b 3b
 1c 2c 3c

 I think my solution is bloated with partial applications. Maybe someone can
 provide a better way to solve this task.

 Cheers,
 Ark. Rost


 --
 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


Re: [Factor-talk] traslation

2011-08-21 Thread Arkady Rost
The original task is more complicated that's why I've used foo and bar in
definition of the problem. Thanks for attention but I'm looking for a better
solution in the general case.
--
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] traslation

2011-08-21 Thread Rupert Swarbrick
John Benediktsson mrj...@gmail.com
writes:
 On Sun, Aug 21, 2011 at 12:49 PM, Arkady Rost arkr...@gmail.com wrote:
 for i in rangeA {
 for j in rangeB {
 foo(param, i, j);
 }
 bar();
 }
 This works for your particular task:

 { 1 2 3 } [
 { a b c } [ append ] with map   join print
 ] each

Just in case you don't really need to do the bar() bit each loop, you
might also consider product-each from sequences.product. The first three
words below are equivalent to what John wrote (but have worse
names). The last word is slightly different, but might be much simpler
if you don't really need to run bar() *between* each iteration across
rangeB.

Rupert



USING: sequences sequences.product io ;

: with-second ( seq sec -- )
[   append append write ] curry each nl ;

: do-all ( seq1 seq2 -- )
[ with-second ] with each ;

: example-1 ( -- )
{ a b c } { 1 2 3 } do-all ;

: example-2 ( -- )
{ { a b c } { 1 2 3 } }
[ first2 append print ] product-each ;

Gives:

( scratchpad ) example-2
a1
b1
c1
a2
b2
c2
a3
b3
c3


pgpbidWwJDrDe.pgp
Description: PGP signature
--
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] traslation

2011-08-21 Thread Philipp Brüschweiler
On Sun, 21 Aug 2011 23:49:10 +0400
Arkady Rost arkr...@gmail.com wrote:
 Hi! I'm looking for a more elegant solution of the following task.
 
 for i in rangeA {
 for j in rangeB {
 foo(param, i, j);
 }
 bar();
 }
 
 I need to translate this to factor.
 
 foo(param, y, x) = x y param foo
 
 I have a solution:
 rangeA rangeB param [ foo ] curry [ swapd [ call ] 2curry each bar ]
 2curry each
 
 For example,
 rangeA = { a b c }
 rangeB = { 1 2 3 }
 param =  
 foo = append append write ;
 bar =  print ;
 
 { a b c } { 1 2 3 }[ append append write ] curry
 [ swapd [ call ] 2curry each  print ] 2curry each
 
 Result is :
 1a 2a 3a
 1b 2b 3b
 1c 2c 3c
 
 I think my solution is bloated with partial applications. Maybe
 someone can provide a better way to solve this task.
 
 Cheers,
 Ark. Rost

Hi Arkady

This should work:

: blob ( ys xs param quot: ( y x param -- ) -- )
'[ _ [ _ _ call ] with each bar ] each ; inline

example usage (assuming : bar ( -- ) abc print ;)

( scratchpad ) { 1 2 3 } { 4 5 6 } 7 [ 3array . ] blob

{ 1 4 7 }
{ 1 5 7 }
{ 1 6 7 }
abc
{ 2 4 7 }
{ 2 5 7 }
{ 2 6 7 }
abc
{ 3 4 7 }
{ 3 5 7 }
{ 3 6 7 }
abc

--
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] traslation

2011-08-21 Thread John Benediktsson
Well, here's three versions for inspiration.

1) Given a 'foo' quotation that takes elements from each and prints it out:

: foo ( a b foo: ( x y -- z ) -- )
[ with map   join print ] 2curry each ; inline

( scratchpad ) { 1 2 3 } { a b c }
   [ append ] foo

2) Given a 'foo' and a 'bar' that acts on the resulting sequence from
'foo'ing:

: bar ( a b foo: ( x y -- z ) bar: ( z -- ) -- )
[ [ with map ] 2curry ] dip compose each ; inline

( scratchpad ) { 1 2 3 } { a b c }
   [ append ] [   join print ] bar

3) Taking version #2 and rewriting with fry quotations:

USE: fry

: bar ( a b foo: ( x y -- z ) bar: ( z -- ) -- )
'[ _ with map @ ] curry each ; inline



On Sun, Aug 21, 2011 at 1:13 PM, Arkady Rost arkr...@gmail.com wrote:

 The original task is more complicated that's why I've used foo and bar in
 definition of the problem. Thanks for attention but I'm looking for a better
 solution in the general case.


 --
 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


Re: [Factor-talk] traslation

2011-08-21 Thread Arkady Rost
Thanks for all ideas. They are really helpful. Now I have a lot of things to
think about.
--
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