Re: [racket-users] Re: Boot To Racket

2017-07-11 Thread jukka . tuominen


I've been following this discussion with keen interest. Although my 
Liitin.org project is far from minimal in size (viable sized by design), 
it does have some common objectives. Racket is used as "the native 
language" that is meant to be able to control all areas of the 
cloud-based, native Linux environment. I'm very GUI-oriented myself, but 
will do my best to provide convenient command-line tools as well.


br, jukka


Lehi Toskin:
"I have this idea, this vision. I wish to create a small system that 
would more or less only be to turn on the machine (probably an RPi) and 
then you'd immediately be inside a Racket REPL..."


William G Hatch:
"I would love to see a Racket unikernel, and be able to essentially run 
a

modern Lisp machine..."

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Order of argument conventions, or ... conventions of argument ordering

2016-04-22 Thread Jukka Tuominen
Not to give an excuse to design the argument order poorly... it would be great 
if DrRacket could display named place-holders for each argument dynamically. 
Then you wouldn't need to guess or try to remember illogical set of parameter 
orders. The argument name could be taken dynamically from the internal argument 
name. I hope you get the idea...

br, jukka

Sent from my iPhone

> On 22.4.2016, at 2.45, Eugene Wallingford  wrote:
> 
> 
>> Eugene Wallingford wrote on 04/21/2016 11:18 AM:
>>> This also reminds me fondly of Smalltalk's separable message
>>> names.  They always felt more natural to me than more typical
>>> keyword arguments.
>> 
>> On a tangent, Smalltalk-like names weren't hard to implement just now, with
>> `syntax-parse` and the modern `#lang` support:
> 
> Nice!  Thanks, Neil.  My students may appreciate this almost
> as much as I do.
> 
>  Eugene
> 
>> #lang rase
>> 
>> (define:: (displayLabel: label withValue: val)
>>  (display: label)
>>  (display: " = ")
>>  (display: val)
>>  (newline))
>> 
>> (displayLabel: "Puppies" withValue: (add: 3 to: 39))
>> ;;=output=> Puppies = 42
>> 
>> 
>> Neil V.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Custodian problems/ IoT service

2015-12-13 Thread jukka . tuominen


The previous code was messy all over the place. This one seems to work, 
although I'm not sure whether it can keep the services securely 
sandboxed as intented and won't run out of memory at some point.

Revised code:
-

#lang racket
; tested in Linux
(define target-mode #f); #f/ "service-1"/ "service-2"

(define (service-switcher)
  (define current-mode #f)
  (define cust (make-custodian))
  (define (system/output command)
(define (system/exit-code+output command)
  (let* ([out (open-output-string)]
 [control (process/ports out #f #f command)]
 [p (list-ref control 4)])
(p 'wait)
(values (p 'exit-code)
(get-output-string out
(let-values ([(e out) (system/exit-code+output command)])
  out))
  (define (switch-mode)
(set! cust (make-custodian))
(parameterize ((current-custodian cust)
   (current-namespace (make-base-namespace)))
  (current-subprocess-custodian-mode 'kill)
  (subprocess-group-enabled #t)
  (cond ((equal? target-mode #f)
 (begin (custodian-shutdown-all cust)
(set! current-mode #f)
(newline)(display "Service disabled")(newline)))
((and (equal? target-mode "service-1"))
 (begin (set! current-mode "service-1")
(newline)(display "Service mode changed to 
Service-1")(newline)

(thread (lambda () (system/output "gedit")
((and (equal? target-mode "service-2"))
 (begin (newline)(display "Service mode changed to 
Service-2")(newline)

(set! current-mode "service-2")
(thread (lambda () (system/output 
"gcalctool"

  (define (loop)
(if (equal? current-mode target-mode)
(begin (display ".")
   (sleep 1)
   (loop))
(begin (custodian-shutdown-all cust)
   (switch-mode)
   (loop
   (thread (lambda () (loop)))
  (display "Service switcher started.")(newline))


;; TESTING

(service-switcher)

(define awhile 5)

(sleep awhile)
(set! target-mode "service-1")
(sleep awhile)
(set! target-mode #f)
(sleep awhile)
(set! target-mode "service-2")
(sleep awhile)
(set! target-mode "service-1")
(sleep awhile)
(set! target-mode #f)
(sleep awhile)
(newline)(display "Test finished (server still running on the 
background. Press CTRL+K to stop it)")(newline)


--


jukka.tuomi...@finndesign.fi kirjoitti 2015-12-12 11:40:

Hi all,

I want to make a custodian-protected, remotely-controlled service
switcher but there's something wrong with my code. The behaviour isn't
reliable and it leaves traces behind filling the memory eventually.
I've included the code below.

TBH, I may have a less optimal approach to it in the first place, so
I'd appreciate any better suggestions.
A little background: As part of Liitin (liitin.org) IoT development
and dog-fooding, I've decided to make my personal A.I. project running
on a remotely-controllable Liitin node as a "Iot Service". Any nodes
fired up will be automagically visible on my Liitin desktop. Any A.I.
node or the user node can be behind different firewalls without open
ports. Neither do they need to know each other's whereabouts. One A.I.
node is to work as an interactive service whereas the rest will take
part in incubating higher intelligence through genetic programming. I
have a simple IoT communication channel in place, but now I want a
reliable means to switch the service mode remotely. I don't want any
ill-behaved A.I. processes running wild either, so I want to make sure
I can shut down the processes remotely when I want to, so the services
will need to be sandboxed. Foremost this is an IoT dog-fooding
excercise, trying to make any Liitin SW or HW node as easy and secure
to use as possible for the basic users, now only taking it to one
extreme.

Finally to the switcher source code...

br, jukka

---


--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Custodian problems/ IoT service

2015-12-12 Thread jukka . tuominen


Hi all,

I want to make a custodian-protected, remotely-controlled service 
switcher but there's something wrong with my code. The behaviour isn't 
reliable and it leaves traces behind filling the memory eventually. I've 
included the code below.


TBH, I may have a less optimal approach to it in the first place, so I'd 
appreciate any better suggestions.
A little background: As part of Liitin (liitin.org) IoT development and 
dog-fooding, I've decided to make my personal A.I. project running on a 
remotely-controllable Liitin node as a "Iot Service". Any nodes fired up 
will be automagically visible on my Liitin desktop. Any A.I. node or the 
user node can be behind different firewalls without open ports. Neither 
do they need to know each other's whereabouts. One A.I. node is to work 
as an interactive service whereas the rest will take part in incubating 
higher intelligence through genetic programming. I have a simple IoT 
communication channel in place, but now I want a reliable means to 
switch the service mode remotely. I don't want any ill-behaved A.I. 
processes running wild either, so I want to make sure I can shut down 
the processes remotely when I want to, so the services will need to be 
sandboxed. Foremost this is an IoT dog-fooding excercise, trying to make 
any Liitin SW or HW node as easy and secure to use as possible for the 
basic users, now only taking it to one extreme.


Finally to the switcher source code...

br, jukka

---
;;; tested in linux. Otherwise the test program needs to be changed
#lang racket

;; The user only needs to change the target mode
(define target-mode #f); #f/ "service-1"/ "service-2"

(define (service-switcher)

  (define current-mode #f)
  (define reset-needed? #f); custodian-shutdown-all

  (define loop
(lambda ()
  (define cust (make-custodian))
  (parameterize ((current-custodian cust)
 (current-namespace (make-base-namespace)))
(thread (lambda ()
  (current-subprocess-custodian-mode 'kill)
  (subprocess-group-enabled #t)
  (display 1)
  (cond ((equal? current-mode target-mode)
 (begin (display 2)
(sleep 3)
(loop)))
((and (equal? current-mode #f)
  (equal? target-mode "service-1"))
 (begin (display 3)
(system "gedit")
(set! current-mode "service-1")
(sleep 5)
(loop)))
((and (equal? current-mode #f)
  (equal? target-mode "service-2"))
 (begin (display 4)
(system "gedit")
(set! current-mode "service-2")
(sleep 5)
(loop)))
  (display 5)
  (sleep 10)
  (when (not (equal? current-mode target-mode))
(begin (display 6)
   (custodian-shutdown-all cust)
   (sleep 5)
   (set! current-mode #f)
   (loop)))
  (display 7)(newline)
  (sleep 5)
  (loop)))

  (thread (lambda () (loop)))
  (display "Service switcher started")(newline))

;; testing

(service-switcher)

(sleep 10)
(set! target-mode "service-1")
(sleep 10)
(set! target-mode #f)
(sleep 10)
(set! target-mode "service-2")
(sleep 10)
(set! target-mode #f)

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Anybody done some "Internet of Things" stuff with Racket?

2015-11-10 Thread Jukka Tuominen
I'm currently experimenting with Tony's racket/stomp package that you might 
want to check out, too. 

The idea is to provide more generic messaging services for liitin.org project, 
not just IoT but also between people, software services, cloud computing and 
such. Initial target is an easy-to-use higher lever pub/sub and RPC messaging, 
but eventually allowing developers to exploit more of the RabbitMQ's 
capabilities, including MQTT without needing to waste effort on the 
infrastructure, authentication and such. 

There's a lot to be done but advancing little by little :)

br, jukka

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Time-limited evaluation

2015-11-07 Thread jukka . tuominen


Hehe, I think I need a faster computer, because that was the intention. 
Anyhow, I'm glad it's working.


I think what happened was that initially I didn't have it right and 
lowered the number to make debugging faster. Then tested with another 
function and got confused.


Thank you Matthew for the help once again.

br, jukka



Matthew Flatt kirjoitti 2015-11-08 02:48:

Did you mean to create a bigger computation than `(factorial 2)`?
It takes only about 5 msec on my machine, but adding a couple of extra
zeros makes it time out.

Converting the result of `(factorial 2)` to a string takes a bit
longer than the arithmetic, and printing out the result in DrRacket
takes much longer than 2 seconds --- due to scrolling while parts of
the number print out --- but all of that happens outside the sandbox.

At Sun, 08 Nov 2015 00:35:09 +0200, jukka.tuomi...@finndesign.fi wrote:


Hi all,

I'm probably doing something wrong here, but for some reason
"custodian-shutdown-all" doesn't always interrupt the execution as the
last test case below shows. It continues execution until finished.

Any ideas how to get this working?

br, jukka


---

#lang racket/load

(require math/number-theory)


(define (when-works-in-given-seconds time-limit thunk)
   (define start-time 0)
   (define output "initial-state")
   (define main-cust (make-custodian))
   (define thread:thunk "")
   (define (loop delay)
 (cond ((not (equal? "initial-state" output))
(begin (custodian-shutdown-all main-cust)
   output))
   ((> (- (current-seconds) start-time) time-limit)
(begin (custodian-shutdown-all main-cust)
   "Time-limit exceeded!"))
   (else (begin (- (current-seconds) start-time)
(sleep delay)
(loop delay) 
   (set! start-time (current-seconds))
   (thread (lambda ()  (parameterize ((current-custodian main-cust))
 (thread (lambda () (with-handlers ((exn:fail?
(lambda (exn) (set! output "Execution failed!"  (set! output (eval
thunk
   (loop 0.1))


;test cases

(print (when-works-in-given-seconds 2 '(/ 5 5)))
(newline)(sleep 2)

(print (when-works-in-given-seconds 2 '(/ 5 0)))
(newline)(sleep 2)

(print (when-works-in-given-seconds 2 '(sleep 10)))
(newline)(sleep 2)

(print (when-works-in-given-seconds 2 '(factorial 2)))


--
You received this message because you are subscribed to the Google 
Groups

"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an

email to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Time-limited evaluation

2015-11-07 Thread jukka . tuominen


Hi all,

I'm probably doing something wrong here, but for some reason 
"custodian-shutdown-all" doesn't always interrupt the execution as the 
last test case below shows. It continues execution until finished.


Any ideas how to get this working?

br, jukka


---

#lang racket/load

(require math/number-theory)


(define (when-works-in-given-seconds time-limit thunk)
  (define start-time 0)
  (define output "initial-state")
  (define main-cust (make-custodian))
  (define thread:thunk "")
  (define (loop delay)
(cond ((not (equal? "initial-state" output))
   (begin (custodian-shutdown-all main-cust)
  output))
  ((> (- (current-seconds) start-time) time-limit)
   (begin (custodian-shutdown-all main-cust)
  "Time-limit exceeded!"))
  (else (begin (- (current-seconds) start-time)
   (sleep delay)
   (loop delay) 
  (set! start-time (current-seconds))
  (thread (lambda ()  (parameterize ((current-custodian main-cust))
(thread (lambda () (with-handlers ((exn:fail? 
(lambda (exn) (set! output "Execution failed!"  (set! output (eval 
thunk

  (loop 0.1))


;test cases

(print (when-works-in-given-seconds 2 '(/ 5 5)))
(newline)(sleep 2)

(print (when-works-in-given-seconds 2 '(/ 5 0)))
(newline)(sleep 2)

(print (when-works-in-given-seconds 2 '(sleep 10)))
(newline)(sleep 2)

(print (when-works-in-given-seconds 2 '(factorial 2)))


--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] racket users fight for their right to colon keywords

2015-10-14 Thread Jukka Tuominen
Yoda like that would, but to me it looks backwards. How about...?
key: value

br, jukka
UX Manager :)

Sent from my iPhone

> On 14.10.2015, at 18.50, Neil Van Dyke  wrote:
> 
> We are conducting a highly scientific poll.
> 
> The question we want to answer is whether people would like for the Racket 
> standard languages to have symbols that begin with the colon character 
> (except for the symbol `:`) to read the same has keywords that begin with 
> pound-colon.
> 
> That is, when this glorious colon-keywords support is added, instead of 
> having to type and look at:
> 
>(foo #:abc 1 #:xyx 42)
> 
> you can choose to bask in the beauty of:
> 
>(foo :abc 1 :xyx 42)
> 
> Then you would be free to use the gorgeous colon-keywords everywhere in 
> Racket, including in quick one-line examples in email list posts.
> 
> All people of great aesthetic sense, intellect, and good moral fiber, who 
> would naturally like everyone to have the right to use either colon-keywords 
> or (eww) pound-colon keywords (in unity, and without unnecessary `#lang` 
> schisms!), should answer the quick poll:
> 
>http://goo.gl/forms/Kwl3uZVMsb
> 
> (When the poll question asks "Is it worth changing?", read it is as "You are 
> a good person, and you naturally think Racket should support both 
> colon-keywords and pound-colon keywords, right?")
> 
> I call upon all freedom-loving Racketeers to stand up and fight for the 
> righteous cause of colon-keywords.  The moment to answer this highly 
> scientific poll is now.
> 
> Neil V.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Racket education & activities in greater Helsinki area?

2015-10-14 Thread jukka . tuominen

Hi all racketeers in Helsinki or nearby,

I wonder if there are any Racket courses or other Racket-related 
activities available in Helsinki or the surrounding areas? I'm mainly 
interested in open university type-of CS lessons, or Internet of Things 
kind-of hobby activities, but anything really. Others around the area 
might be interested in hearing what's available too.


Also, programming will be part of the generic education in comprehensive 
schools in Finland, and higher levels thereafter, so I'm curious to hear 
if any schools will use Racket. I know Tampere is being active there, at 
least.


br, jukka


--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Eval namespace revisited ...again

2015-09-26 Thread Jukka Tuominen

Thank you Jens, that's a very helpful example.

br, jukka


> An alternative to racket/load if you need something easier to control:
>
> #lang racket
>
> ;; Make a new namespace
> (define custom-namespace (make-base-empty-namespace))
>
> ;; Fill it with relevant bindings
> (parameterize ([current-namespace custom-namespace])
>   (namespace-require ''#%kernel)
>   (namespace-require 'racket/base)
>   (namespace-require/copy 'racket/list))
>
> ;; Use it in eval
> (define (custom-eval expr)
>   (eval expr custom-namespace))
>
> ;; Test it
> (custom-eval '(+ 1 2 3))
>
>
> 2015-09-26 13:56 GMT+02:00 Jukka Tuominen :
>
>>
>> In case it should be of help to anyone, using #lang racket/load solved
>> the
>> problems and things run smoothly now.
>>
>> br, jukka
>>
>>
>> > Hi all,
>> >
>> > I'm working on a generic solution to distributed computing/ IoT/ M2M/
>> > scheduled task handling etc. basing on messaging. The emphasis is on
>> > usability so it is essential to allow running functions identically
>> > despite of where they are run. The obvious thing to expect is that
>> when
>> > sending an expression like '(+ 1 2 3) to a remote computer, it will be
>> > evaluated something like (eval '(+ 1 2 3) custom-namespace) in the
>> > background and returns the expected "6".
>> >
>> > I've seen the numerous discussions warning about namespace conflicts,
>> but
>> > as far as I understand it should be safe in Liitin environment, where
>> I
>> > intend to use it ( liitin.org ). That is, the special environment is
>> > initiated always with identical start-up definitions. No new top-level
>> > definitions are allowed because of Liitin's own way of dealing with
>> > dynamic objects. Internal definitions, however, are allowed (say,
>> internal
>> > define's within lambda expressions), but those should be safe, right?
>> >
>> > Instead of some standard base namespace, I need to use a custom one.
>> > I'v tried the following, but it doesn't seem to work:
>> >
>> > (define namespace (current-namespace))
>> > (parameterize ((current-namespace namespace))
>> >  ...
>> > (eval expression namespace))
>> >
>> > Any suggestions on how to make this work?
>> >
>> > br, jukka
>> >
>> >
>> >
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> --
> Jens Axel Søgaard
>


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: Eval namespace revisited ...again

2015-09-26 Thread Jukka Tuominen

In case it should be of help to anyone, using #lang racket/load solved the
problems and things run smoothly now.

br, jukka


> Hi all,
>
> I'm working on a generic solution to distributed computing/ IoT/ M2M/
> scheduled task handling etc. basing on messaging. The emphasis is on
> usability so it is essential to allow running functions identically
> despite of where they are run. The obvious thing to expect is that when
> sending an expression like '(+ 1 2 3) to a remote computer, it will be
> evaluated something like (eval '(+ 1 2 3) custom-namespace) in the
> background and returns the expected "6".
>
> I've seen the numerous discussions warning about namespace conflicts, but
> as far as I understand it should be safe in Liitin environment, where I
> intend to use it ( liitin.org ). That is, the special environment is
> initiated always with identical start-up definitions. No new top-level
> definitions are allowed because of Liitin's own way of dealing with
> dynamic objects. Internal definitions, however, are allowed (say, internal
> define's within lambda expressions), but those should be safe, right?
>
> Instead of some standard base namespace, I need to use a custom one.
> I'v tried the following, but it doesn't seem to work:
>
> (define namespace (current-namespace))
> (parameterize ((current-namespace namespace))
>  ...
> (eval expression namespace))
>
> Any suggestions on how to make this work?
>
> br, jukka
>
>
>


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Eval namespace revisited ...again

2015-09-19 Thread Jukka Tuominen
Hi all,

I'm working on a generic solution to distributed computing/ IoT/ M2M/
scheduled task handling etc. basing on messaging. The emphasis is on
usability so it is essential to allow running functions identically
despite of where they are run. The obvious thing to expect is that when
sending an expression like '(+ 1 2 3) to a remote computer, it will be
evaluated something like (eval '(+ 1 2 3) custom-namespace) in the
background and returns the expected "6".

I've seen the numerous discussions warning about namespace conflicts, but
as far as I understand it should be safe in Liitin environment, where I
intend to use it ( liitin.org ). That is, the special environment is
initiated always with identical start-up definitions. No new top-level
definitions are allowed because of Liitin's own way of dealing with
dynamic objects. Internal definitions, however, are allowed (say, internal
define's within lambda expressions), but those should be safe, right?

Instead of some standard base namespace, I need to use a custom one.
I'v tried the following, but it doesn't seem to work:

(define namespace (current-namespace))
(parameterize ((current-namespace namespace))
 ...
(eval expression namespace))

Any suggestions on how to make this work?

br, jukka



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] RCP over racket-stomp

2015-08-07 Thread Jukka Tuominen

For testing purposes, I changed the permissions to "^.*" ".*" "'*" which
got rid of the error messages. However, there is still no reply eventhough
the message is received by the target computer. Hmmm, in this case both
SUB and PUB are device7 should it matter.

br, jukka


> On 08/07/2015 03:19 PM, Jukka Tuominen wrote:
>> =ERROR REPORT 7-Aug-2015::22:00:25 ===
>> Channel error on connection <0.5764.4> ([client-ip]:59326 ->
>> [server-ip]:61613, vhost: '/', user: 'device7'), channel 1:
>> {amqp_error,access_refused,
>> "access to queue 'amq.gen--sUYfl-1_IbdAXhs8LwoUA' in vhost
>> '/'
>> refused for user 'device7'",
>> 'basic.consume'}
>
> Based on this, I think a productive line of investigation would be to
> see if using the permissions-configuration stuff from rabbitmqctl might
> help. The server is claiming that user "device7" is not permitted to
> read from queues with server-generated names.
>
> Since I haven't managed to get even basic STOMP messaging working
> myself, I'm not the best person to ask about exactly how to do this, of
> course :-) but https://www.rabbitmq.com/access-control.html might get
> you started...
>
> Tony
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] RCP over racket-stomp

2015-08-07 Thread Jukka Tuominen



> On 08/07/2015 12:43 PM, Jukka Tuominen wrote:
>> "Disconnected before receipt "R14642" was received"
>
> What shows up in the RabbitMQ logs around the time that the
> disconnection happens? Often a bunch of detail is logged that is not
> passed on to the connected client.
>
> Tony


I found this:

=INFO REPORT 7-Aug-2015::22:00:21 ===
accepting STOMP connection <0.5761.4> ([client-ip]:59326 ->
[server-ip]:61613)

=ERROR REPORT 7-Aug-2015::22:00:25 ===
Channel error on connection <0.5764.4> ([client-ip]:59326 ->
[server-ip]:61613, vhost: '/', user: 'device7'), channel 1:
{amqp_error,access_refused,
"access to queue 'amq.gen--sUYfl-1_IbdAXhs8LwoUA' in vhost '/'
refused for user 'device7'",
'basic.consume'}

=ERROR REPORT 7-Aug-2015::22:00:25 ===
STOMP error frame sent:
Message: access_refused
Detail: "ACCESS_REFUSED - access to queue 'amq.gen--sUYfl-1_IbdAXhs8LwoUA'
in vhost '/' refused for user 'device7'\n"
Server private detail: none

=INFO REPORT 7-Aug-2015::22:00:25 ===
closing STOMP connection <0.5761.4> ([client-ip]:59326 -> [server-ip]:61613)


>
> PS. I tried to get RabbitMQ+STOMP running yesterday and failed to get it
> to go, full stop! Surprising permissions errors. Which was, uh,
> *unexpected*, considering. I'll have another try over the weekend, if I
> get a chance.
>

Hehe, comforting but scary at the same time to hear that it can happen to
you too :)

br, jukka

> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] RCP over racket-stomp

2015-08-07 Thread Jukka Tuominen

Tony,

having experimented with your code to catch `exn:stomp` exception, this is
what I got first:

"Disconnected before receipt "R14642" was received"

There are two "sends" in the code, and it is actually the second call that
causes the error. With a single send, no error is signalled but nothing is
retuned either. Taking away "(receipt ,receipt)" from send had no effect.

br, jukka


> On 08/06/2015 02:03 PM, Jukka Tuominen wrote:
>> From a generic STOMP documentation I’ve understood that I should send a
>> ”reply-to” header item with a temporary queue value, but I’m not sure
>> about the format I should use in racket-stomp. I tried...
>> #:headers `((receipt ,receipt)(persistent "true")(reply-to
>> "/temp-queue/foo"))
>> ... which returned  ”Received ERROR” without further information.
>
> You need to catch the `exn:stomp` exception, which includes the error
> frame; untested example code:
>
>   (with-handlers [(exn:stomp? (lambda (e)
>  (log-error "STOMP error ~v"
> (exn:stomp-frame e]
> ...)
>
> Also, it is a good idea to check the logs of whichever broker you are
> using.
>
>> Also, even though the target computer is able to receive the message,
>> I’m
>> not sure how to make it to respond with a value.
>
> Which broker are you using?
>
> Cheers,
>   Tony
>


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] RCP over racket-stomp

2015-08-06 Thread Jukka Tuominen
er only for now. Sign and encrypt also before
placing open air.
(define secured-message4 "(device-settings device-x from-device7)");
place-holder only for now. Sign and encrypt also before placing open air.


(sleep 3)
(send-default-message "device7" secured-message1);This goes open air - be
sure to secure the message before sending it!
(sleep 5)
(send-default-message "device7" secured-message2)
(sleep 5)


(stomp-disconnect credientials)

;XX END XX


br, jukka


> On 08/06/2015 02:03 PM, Jukka Tuominen wrote:
>> From a generic STOMP documentation I’ve understood that I should send a
>> ”reply-to” header item with a temporary queue value, but I’m not sure
>> about the format I should use in racket-stomp. I tried...
>> #:headers `((receipt ,receipt)(persistent "true")(reply-to
>> "/temp-queue/foo"))
>> ... which returned  ”Received ERROR” without further information.
>
> You need to catch the `exn:stomp` exception, which includes the error
> frame; untested example code:
>
>   (with-handlers [(exn:stomp? (lambda (e)
>  (log-error "STOMP error ~v"
> (exn:stomp-frame e]
> ...)
>
> Also, it is a good idea to check the logs of whichever broker you are
> using.
>
>> Also, even though the target computer is able to receive the message,
>> I’m
>> not sure how to make it to respond with a value.
>
> Which broker are you using?
>
> Cheers,
>   Tony
>


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] RCP over racket-stomp

2015-08-06 Thread Jukka Tuominen

Hi,

I’m trying to set up RCP communication by using racket-stomp messaging,
but I can’t seem to find neither documentation nor a sample code that
would show how to accomplish this.

For example, I’d like to send a target computer a message containing a
quoted function, say ’(+ 1 2 3) and I should receive the remotely
evaluated value 6.

>From a generic STOMP documentation I’ve understood that I should send a
”reply-to” header item with a temporary queue value, but I’m not sure
about the format I should use in racket-stomp. I tried...
#:headers `((receipt ,receipt)(persistent "true")(reply-to
"/temp-queue/foo"))
... which returned  ”Received ERROR” without further information.

Also, even though the target computer is able to receive the message, I’m
not sure how to make it to respond with a value.
I would appreciate any help or pointers.

br, jukka


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket] Initial environment

2015-03-01 Thread Jukka Tuominen

I've been planning to create #lang liitin at some point, although I'm a
bit hesitant whether this makes sense outside Liitin account. In addition
to having the environment all set up for you, the idea is to make sure
that the code is compatible between users and endures time. There are just
too many things moving in their own directions in the conventional
operating systems and even within Racket alone. What it could do though,
is to allow access to the permanent storage and remote computation and
such.

And yes, the problem with the initial interactions window remains.

br, jukka


> I agree that the best method to do this in DrRacket is to create a new
> language. Once you have the language, you can configure the initial
> "Automatic" language in the Language/Choose_Language menu.
>
> My problem is that DrRacket doesn't run the first program automatically,
> so if I
> 1) Open DrRacket
> 2) Type (+ 1 2) in the interactions window
> 3) Press Enter
>
> I get an error:
> ---
> Welcome to DrRacket, version 6.1.1 [3m].
> Language: racket [custom].
>> (+ 1 2)
> [error icon] #%top-interaction: unbound identifier;
>  also, no #%app syntax transformer is bound in: #%top-interaction
>>
> ---
>
> I have to run the main program once to be able to use the interaction
> windows.
>
> This first run can be automatic. But some languages are slow or weird,
> so I think it's better to be able to select if I want to run the
> automatic program at start. Another problem is consistency, because it
> would be different of what DrRacket does when you load a rkt file or
> open it with double-click in a folder.
>
> An easier and safer possibility is to replace the initial prompt with
> a message "Interactions disable! Press the RUN button!" (or a
> friendlier version) like when you run #lang racket/kernel
>
> Gustavo
>
> On Sun, Mar 1, 2015 at 6:52 PM, Robby Findler
>  wrote:
>> You might also consider making a new language along the lines of #lang
>> racket/gui that includes the extra stuff you want.
>>
>> Robby
>>
>> On Sun, Mar 1, 2015 at 3:00 PM, Jukka Tuominen
>>  wrote:
>>>
>>> Thank you Eric,
>>>
>>> I appreciate the principle. I got it working now without violations.
>>>
>>> br, jukka
>>>
>>>
>>>> I do not think it is possible. DrRacket is designed so that the
>>>> interaction
>>>> window has the namespace of exactly the file you are writing. That is,
>>>> what
>>>> you type in the interactions window should behave similarly to if you
>>>> appended it into the file. And running the file should have the same
>>>> behavior as running it with the command-line racket. Having DrRacket
>>>> insert
>>>> requires silently would violate this.
>>>>
>>>> On Sun, Mar 1, 2015 at 1:55 AM, Jukka Tuominen
>>>> >>>> wrote:
>>>>
>>>>>
>>>>> Just to clarify my previous message...
>>>>>
>>>>> Say, I want to include 2htdp/image and 2htdp/universe libraries so
>>>>> that
>>>>> once I start DrRacket, I can type "circle" in the interactions pane
>>>>> even
>>>>> before pressing the "run" button. The same libraries should be
>>>>> available
>>>>> directly for racket and gracket, as well.
>>>>>
>>>>> What would be the safest way to achieve this?
>>>>>
>>>>> br, jukka
>>>>>
>>>>>
>>>>> >
>>>>> > If I want to ensure that certain libraries get automatically
>>>>> included
>>>>> > (required) in the initial racket/gracket/drracket environments,
>>>>> where
>>>>> > should I add them?
>>>>> >
>>>>> > I tried /racket/collects/init.rkt but that didn't seem to work. I
>>>>> didn't
>>>>> > remove the .zo file though...
>>>>> >
>>>>> > br, jukka
>>>>> >
>>>>> >
>>>>> >
>>>>> > 
>>>>> >   Racket Users list:
>>>>> >   http://lists.racket-lang.org/users
>>>>> >
>>>>>
>>>>>
>>>>> 
>>>>>   Racket Users list:
>>>>>   http://lists.racket-lang.org/users
>>>>>
>>>>
>>>
>>>
>>> 
>>>   Racket Users list:
>>>   http://lists.racket-lang.org/users
>> 
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
>



  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Initial environment

2015-03-01 Thread Jukka Tuominen

Thank you Eric,

I appreciate the principle. I got it working now without violations.

br, jukka


> I do not think it is possible. DrRacket is designed so that the
> interaction
> window has the namespace of exactly the file you are writing. That is,
> what
> you type in the interactions window should behave similarly to if you
> appended it into the file. And running the file should have the same
> behavior as running it with the command-line racket. Having DrRacket
> insert
> requires silently would violate this.
>
> On Sun, Mar 1, 2015 at 1:55 AM, Jukka Tuominen
> > wrote:
>
>>
>> Just to clarify my previous message...
>>
>> Say, I want to include 2htdp/image and 2htdp/universe libraries so that
>> once I start DrRacket, I can type "circle" in the interactions pane even
>> before pressing the "run" button. The same libraries should be available
>> directly for racket and gracket, as well.
>>
>> What would be the safest way to achieve this?
>>
>> br, jukka
>>
>>
>> >
>> > If I want to ensure that certain libraries get automatically included
>> > (required) in the initial racket/gracket/drracket environments, where
>> > should I add them?
>> >
>> > I tried /racket/collects/init.rkt but that didn't seem to work. I
>> didn't
>> > remove the .zo file though...
>> >
>> > br, jukka
>> >
>> >
>> >
>> > 
>> >   Racket Users list:
>> >   http://lists.racket-lang.org/users
>> >
>>
>>
>> 
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
>>
>



  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Initial environment

2015-02-28 Thread Jukka Tuominen

Just to clarify my previous message...

Say, I want to include 2htdp/image and 2htdp/universe libraries so that
once I start DrRacket, I can type "circle" in the interactions pane even
before pressing the "run" button. The same libraries should be available
directly for racket and gracket, as well.

What would be the safest way to achieve this?

br, jukka


>
> If I want to ensure that certain libraries get automatically included
> (required) in the initial racket/gracket/drracket environments, where
> should I add them?
>
> I tried /racket/collects/init.rkt but that didn't seem to work. I didn't
> remove the .zo file though...
>
> br, jukka
>
>
>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>



  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Initial environment

2015-02-28 Thread Jukka Tuominen

If I want to ensure that certain libraries get automatically included
(required) in the initial racket/gracket/drracket environments, where
should I add them?

I tried /racket/collects/init.rkt but that didn't seem to work. I didn't
remove the .zo file though...

br, jukka




  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] try-racket alternative

2015-02-26 Thread Jukka Tuominen

Since the topic is expanding further away from "try", I may also add that
even though native Linux, Liitin also has an html5 web interface. It
provides a personal cloud desktop and storage with Racket integration, and
you can also share Racket code easily.

See the web login page at https://liitin.org:8448/

br, jukka


>
> Floyd Arguello wrote on 02/26/2015 05:58 PM:
>>
>> I like the idea of saving programs through a Google account,
>
> That might be fine for particular users of this particular app... but,
> as a general comment, for people doing other Web-based apps, using "the
> cloud" in this way is actually a really bad direction for privacy in
> most cases.
>
> (This is a serious and huge topic, which is mostly outside the scope of
> Racket, and I doubt any of us want to get into the topic here by
> building up from first principles.  I just think that that kind of cloud
> use shouldn't be mentioned in an impressionability-heavy venue like
> this, without someone pointing out that it's not necessarily a good
> general approach.)
>
> If anyone just wants quick&dirty storage for a Web app (online or
> offline), the easiest thing to consider first is
> "http://mozilla.github.io/localForage/";.  You can look at the
> implications from there, but it's one of the easiest and best starting
> points for most Web app casual storage purposes at the moment.
>
> Neil
>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>



  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Search & wrap

2015-02-24 Thread Jukka Tuominen


For example, if I had definitions spread across two files like follows...

File1:

(require file2)

(define (times2 x)
  (* 2 x))


(define (my-times2power3+5 x)
  (+ 5 (times2 (power3 x



File2:

(define (power3 x)
  (* x x x))


---


Now calling the function (search&wrap 'my-times2power3+5) would output

(define (my-times2power3+5 x)
  (define (power3 x)
(* x x x))
  (define (times2 x)
(* 2 x))
  (+ 5 (power3 (times2 x


So, now id have all the definitions that my-times2power3+5 needs within it
as local definitions

I understand that in many cases this might grow up to be unpractical or
otherwise problematic, but in some cases it would be a great timesaver.

I hope this explains it a bit better(?)

br, jukka


> You say "wrap" but in your example you replace the call of function b with
> another function.
>
> Without a specific use-case I'm not sure about the use of speculating on
> your meaning.
>
> Would you be satisfied with
> (search&wrap function-b
>(define (function-a ...) ...))
> or
> (define (function-a ...)
>(with-function-wrapper ([function-b ...]) ...))
> ?
>
> Otherwise it seems like you are asking for something that precludes
> separate compilation and has effects that cross module boundaries...
> sounds
> unpleasant if not terrible.
>
>
> Andrew Mauer-Oats
> Mathematics Ph.D.
> Chicago Public Schools: Whitney Young
>
> On Tue, Feb 24, 2015 at 6:52 AM, Jukka Tuominen <
> jukka.tuomi...@finndesign.fi> wrote:
>
>>
>> This is something I've been wondering for years and always ended up
>> doing
>> it manually. So, why not ask it out loud...
>>
>> I wonder whether it would be possible to search and wrap all definitions
>> that reside outside a specified function, other than those contained in
>> #lang racket?
>>
>> Say, (search&wrap 'function-a)  would start in the situation like
>>
>> (define (function-a x y z)
>>(function-b x y z))
>>
>> It would then search the definition for 'function-b and would output
>> something like
>>
>> (define (function-a x y z)
>>(define function-b +)
>>(function-b x y z))
>>
>> It does not have to search through unintroduced library files (though it
>> would be even cooler), only starting in a situation where all the needed
>> definitions can be found within the same level or 'required' from other
>> files.
>>
>> It should also work recursively, so that eventually no library calls
>> would
>> be needed to run the function-a.
>>
>> Any idea whether this is feasible?
>>
>> br, jukka
>>
>>
>>
>> 
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
>>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>



  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Search & wrap

2015-02-24 Thread Jukka Tuominen

This is something I've been wondering for years and always ended up doing
it manually. So, why not ask it out loud...

I wonder whether it would be possible to search and wrap all definitions
that reside outside a specified function, other than those contained in
#lang racket?

Say, (search&wrap 'function-a)  would start in the situation like

(define (function-a x y z)
   (function-b x y z))

It would then search the definition for 'function-b and would output
something like

(define (function-a x y z)
   (define function-b +)
   (function-b x y z))

It does not have to search through unintroduced library files (though it
would be even cooler), only starting in a situation where all the needed
definitions can be found within the same level or 'required' from other
files.

It should also work recursively, so that eventually no library calls would
be needed to run the function-a.

Any idea whether this is feasible?

br, jukka




  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Updated Liitin project page

2015-02-09 Thread Jukka Tuominen

Based on the feedback, I have added a little screen capture strip
explaining how this Liitin storage works from the user's perspective. It
shows each step starting from boot, how to run a stored object (Racket
program: Eliza), view its source code, and how you could modify it to your
liking. Not really much harder than using the Notepad App, what do you
think?

You can find it at the end of the Racket section or directly from this link:

http://liitin.org/wp-content/uploads/2015/02/eliza-source-code.png

BTW, these are full-sized, actual screen captures, and depending on your
browser, you may have to zoom it in to see them in correct size.


br, jukka


>
> Dear Racketeers,
>
>
> for those interested in Liitin development, the project home page has just
> been updated.
>
> "Liitin is a profoundly new approach to computing aiming to make the
> Future Internet more useful by means of improved compatibility of software
> and hardware and providing permanent data storage, but most of all, making
> it all much easier and fun to use."
>
> Racket plays a key role in Liitin, probably best described as "mother
> tongue". Liitin is a operating-system level design concept, and all
> aspects of it are to be controllable with Racket. Racket is directly
> connected to a permanent object storage, and
> creating/viewing/modifying/sharing objects is really simple and quick.
> Objects can be data, functions or even GUI apps.
>
> There are now some additional information for Racket developers. Please,
> see...
>
> http://liitin.org
>
> Even though Liitin has been functional in proof-of-concept level for some
> time now, full deployment still needs a lot of work and investments. So,
> I'd be interested  in hearing your opinion about possible crowdfunding and
> crowdsourcing approach? It's all technically feasible and it would be so
> much more useful if everybody could have access to it.
>
> All comments about the project are highly appreciated.
>
>
> br, jukka
>
>



  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Updated Liitin project page

2015-02-01 Thread Jukka Tuominen

Dear Racketeers,


for those interested in Liitin development, the project home page has just
been updated.

"Liitin is a profoundly new approach to computing aiming to make the
Future Internet more useful by means of improved compatibility of software
and hardware and providing permanent data storage, but most of all, making
it all much easier and fun to use."

Racket plays a key role in Liitin, probably best described as "mother
tongue". Liitin is a operating-system level design concept, and all
aspects of it are to be controllable with Racket. Racket is directly
connected to a permanent object storage, and
creating/viewing/modifying/sharing objects is really simple and quick.
Objects can be data, functions or even GUI apps.

There are now some additional information for Racket developers. Please,
see...

http://liitin.org

Even though Liitin has been functional in proof-of-concept level for some
time now, full deployment still needs a lot of work and investments. So,
I'd be interested  in hearing your opinion about possible crowdfunding and
crowdsourcing approach? It's all technically feasible and it would be so
much more useful if everybody could have access to it.

All comments about the project are highly appreciated.


br, jukka



  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Racket & OpenStack/ Swift

2014-10-24 Thread Jukka Tuominen

Hi all,

I wonder if anyone has experience in or pointers to using Racket with
OpenStack? Particularly, I'm currently interested in client-side object
storage (Swift) interfacing and server-side middleware scripting.

E.g. I'm trying to figure out the most efficient way to PUT/GET Racket
objects such as "string" or '(lambda () (+ 1 2 3)) straight from memory to
storage and back to memory without writing them down as files in between.

I prefer native Linux interface over web, but any starting points are
appreciated.

br, Jukka


  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Internet of Things

2014-02-15 Thread Jukka Tuominen

Took a while to get back to this. Happened so far:

I gave up on zeromq, since the sub client kept crashing every time.
Rabbitmq/stomp examples worked over a public server with a guest user, so I set 
up a server of my own. Once a basic pub-sub messaging in place, I created a 
simple message handler, that can recognize racket expressions
and evaluate them (or do what ever). I even got it to evaluate liitin
expressions.

I got really excited, since having thought about it a bit further, not
only is it suitable for device or other service control, but one could
even make it a generic way for messaging between liitin accounts. For example, 
since each liitin account has a protected namespace, this kind of messaging 
allows creating "pull-requests" to update liitin objects across namespaces. You 
can accept them either manually or automatically based on your message handler.

But I'm only starting to get familiar with rabbitmq and stomp, and to
achieve what I want, I need a full control of both client and server
sides. I planning to use racket also for creating the needed server-side
shell commands dynamically, and mix them with higher-level functionality.

Now I'm stuck. As mentioned earlier, everything works nicely with the
built-in "guest" user, but once trying to create a "messaging channel" for
a new liitin account (user/device/service) I'm obviously missing something.

I use the following shell commands on the server side:

rabbitmqctl add_vhost /device5
rabbitmqctl add_user user device5 password
rabbitmqctl set_permissions -p /device5 ".*" ".*" ".*"

And based on the racket/stomp pub example,
http://planet.racket-lang.org/package-source/tonyg/stomp.plt/2/1/planet-docs/manual/index.html
chapter 2.2
... I send a message (no error).


But based on the sub example (chapter 2.3), when I try to receive it, a plain 
"error" is signaled highlighting
"stomp-next-message s "my-subscription"

I'm propably missing a level or two on top of the vhost, or the subscription 
definition on the client side is somehow invalid.

Any idea what I'm doing wrong?

Br, jukka



> On 18.11.2013, at 20.42, Jukka Tuominen 
wrote:
> 
> Hi Tony,
> 
> 
>> On 18.11.2013, at 16.13, Tony Garnock-Jones  wrote:
>> 
>> Hi Jukka,
>> 
>>> On 2013-11-16 1:48 AM, Jukka Tuominen wrote:
>>> I was happy to hear about the package Marketplace [...], and I wonder
>>> if it could be used as a starting point?
>> 
>> Marketplace is still in flux. It could be useful as a way of forcing
>> yourself to really *commit* to the idea of pub/sub-all-the-way-down ;-)
>> but it might not be the best choice to build a production system on top
>> just yet.
> 
> Ok, good to know. As far as I can see, an off-the-shelf pub-sub system
is propably enough for this purpose, and I'm not really planning on
studying the pub-sub itself, but rather how to utilize it.
> I'd very much like to choose a system that is robust and can scale up,
eventhough at this phase and in my hands, a p-o-c is the level that I'm
targetting.
>> 
>> Marketplace was inspired by, and can be seen as a generalization of,
>> ordinary pub/sub and queueing middleware like STOMP servers and RabbitMQ.
>> 
>>> Another option is to choose some generic open-source pub-sub server,
>>> and make the user and device ends speak racket.
>> 
>> I suggest looking into the STOMP protocol support for RabbitMQ. I wrote
>> a Racket STOMP client [1, 2] a while back that might do what you need.
> 
> I'll look into those, thanks!
> 
>> One of the things I've been meaning to do is write a simple *server* in
>> Racket to go along with it, but for now using RabbitMQ or similar is
>> probably a good bet.
> 
> I'm hoping to have the environment ready to use for a basic user, and
familiar for a developer as if dealing with any software objects. I have
a clear picture in my mind...
>> 
>> (Regarding Arduino: RabbitMQ also has experimental UDP support [3] which
>> might be of interest in this connection.)
> 
> Sounds very good! So far, I try to restrain myself from moving to even
more foreign terrain until I get the architecture easy enough for me and
others to use.
> 
> Br, jukka
> 
> 
>> 
>> Regards,
>> Tony
>> 
>> [1] http://planet.racket-lang.org/display.ss?package=stomp.plt&owner=tonyg
>> [2]https://github.com/tonyg/racket-stomp
>> [3] https://github.com/tonyg/udp-exchange
> 
> 
> Racket Users list:
> http://lists.racket-lang.org/users


  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Internet of Things/ Marketplace

2013-11-29 Thread Jukka Tuominen
Thanks Jay,

These are the ones I tried, as well. They seem like perfect starting points as 
soon I get them working in my environment.  I need to study it further or build 
a different test environment as a VM. 

Br, jukka

Sent from my iPhone

> On 29.11.2013, at 15.47, Jay McCarthy  wrote:
> 
> Sorry, email weirdness:
> 
> https://github.com/jeapostrophe/zguide/tree/master/examples/Racket
> 
> 
> 
>> On Fri, Nov 29, 2013 at 6:47 AM, Jay McCarthy  wrote:
>> Hi Jukka,
>> 
>> These are the examples that I test with:
>> 
>> 
>> On Wed, Nov 27, 2013 at 11:49 AM, Jukka Tuominen
>>  wrote:
>>> 
>>> Having just mentioned the bundled examples, I just realised that the only
>>> examples I've found are the ones from the zguide. These may not be
>>> compatible with the planet zeromq packages 1.0 and 2.0 that seem to
>>> otherwise behave with the racket 5.1 (unlike 2.1). ... not that I could
>>> get the examples working with the racket 5.3.6 & zeromq 4.0 either. My
>>> windows just crashed, so it's propably just me... sigh
>>> 
>>> I wonder if anyone has some code made for these planet versions 1.0 or 2..0
>>> that you are willing to share?
>>> 
>>> br, jukka
>>> 
>>> 
>>>> 
>>>> 
>>>>> On Wed, Nov 27, 2013 at 10:02 AM, Jukka Tuominen
>>>>>  wrote:
>>>>>> Jay,
>>>>>> 
>>>>>> I've tried numerous version combinations of Racket/zeromq/your API on
>>>>>> ubuntu 10.04 but can't get any to work. These are the versions I've
>>>>>> tried:


  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Internet of Things/ Marketplace

2013-11-27 Thread Jukka Tuominen

Having just mentioned the bundled examples, I just realised that the only
examples I've found are the ones from the zguide. These may not be
compatible with the planet zeromq packages 1.0 and 2.0 that seem to
otherwise behave with the racket 5.1 (unlike 2.1). ... not that I could
get the examples working with the racket 5.3.6 & zeromq 4.0 either. My
windows just crashed, so it's propably just me... sigh

I wonder if anyone has some code made for these planet versions 1.0 or 2.0
that you are willing to share?

br, jukka


>
>
>> On Wed, Nov 27, 2013 at 10:02 AM, Jukka Tuominen
>>  wrote:
>>> Jay,
>>>
>>> I've tried numerous version combinations of Racket/zeromq/your API on
>>> ubuntu 10.04 but can't get any to work. These are the versions I've
>>> tried:
>>>
>>> Racket 5.1 - 5.3.6
>>> Zeromq 2.2 - 4.x
>>> API planet 1.0 - latest pkg
>>> (Several but not every racket versions)
>>>
>>> At best, the server gets started (by running either xserver.rkt in
>>> drracket) but soon becomes unresponsive. The client crashes immediately
>>> taking the drracket along. Neither one is capable of presenting error
>>> messages.
>>>
>>> I'm propably doing something seriously wrong, but AFAIU the zeromq is
>>> correctly compiled and installed now, and your API downloaded to
>>> racket.
>>>
>>> To create the proof-of-concept on Liitin, the last versions of each are
>>> not necessary. Ideally, I would use ubuntu 10.04 and racket 5.1 and
>>> pick
>>> working versions of zeromq and your API to go with. Would you, by any
>>> chance, remember which versions should work in this setting, if any?
>>>
>>> Any other combination you know to work in ubuntu, if any?
>>
>> I don't know what you mean by "API planet 1.0".
>
> Sorry, I was on the move and didn't know how to call it. These are the
> ones I meant:
> http://planet.racket-lang.org/display.ss?package=zeromq.plt&owner=jaymccarthy
>
>
> The Planet package is
>> not supported by me. It was developed on Ubuntu with the latest
>> release of everything when it was posted.
>
> Great, I'll try to trace the combination at that time. It's good to know
> that ubuntu was used.
>
>>
>> Today, I use archlinux, with Racket 6, with zeromq 4.0.1 and the
>> zeromq Racket package I've linked before (available on
>> pkgs.racket-lang.org). All the Racket examples from the zguide work
>> fine. If you were to send me the program you're trying, we could see
>> what is going wrong.
>
> I'm trying to get the bundled examples working first, so I know the
> environment is OK.
>
> thanks,
> jukka
>
>>
>> Jay
>>
>>> Br, jukka
>>>
>>> Sent from my iPhone
>>>
>>>> On 17.11.2013, at 17.12, Jay McCarthy  wrote:
>>>>
>>>> Now that the new package system, most people are not maintaining their
>>>> old Planet packages. The zeromq package has had a lot of change in
>>>> particular and perhaps this has gone away for you:
>>>>
>>>> http://pkgs.racket-lang.org/#[zeromq]
>>>>
>>>> But also make sure that your library loading environment variables are
>>>> set up right
>>>>
>>>> Jay
>>>>
>>>> On Sun, Nov 17, 2013 at 8:07 AM, Jukka Tuominen
>>>>  wrote:
>>>>>
>>>>> There's also Jay's port to zeromq, which is looking very promising.
>>>>> However, when I try to run it (racket 5.3.5/ Ubuntu 10.04) by...
>>>>>
>>>>> #lang racket
>>>>>
>>>>> (require (planet "main.rkt" ("jaymccarthy" "zeromq.plt" 2 1)))
>>>>>
>>>>> ... it displays the following error:
>>>>>
>>>>> ffi-lib: couldn't open "libzmq.so" (libzmq.so: cannot open shared
>>>>> object
>>>>> file: No such file or directory)
>>>>>
>>>>> ...eventhough there is one in /usr/local/lib/libzmq.so
>>>>>
>>>>> Any idea of how to get it working?
>>>>>
>>>>> br, jukka
>>>>>
>>>>>
>>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> some time ago I built a simple client/server proof-of-concept for
>>>>>> the
>>>>>> Liitin project ( www.liitin.org )
&

Re: [racket] Internet of Things/ Marketplace

2013-11-27 Thread Jukka Tuominen


> On Wed, Nov 27, 2013 at 10:02 AM, Jukka Tuominen
>  wrote:
>> Jay,
>>
>> I've tried numerous version combinations of Racket/zeromq/your API on
>> ubuntu 10.04 but can't get any to work. These are the versions I've
>> tried:
>>
>> Racket 5.1 - 5.3.6
>> Zeromq 2.2 - 4.x
>> API planet 1.0 - latest pkg
>> (Several but not every racket versions)
>>
>> At best, the server gets started (by running either xserver.rkt in
>> drracket) but soon becomes unresponsive. The client crashes immediately
>> taking the drracket along. Neither one is capable of presenting error
>> messages.
>>
>> I'm propably doing something seriously wrong, but AFAIU the zeromq is
>> correctly compiled and installed now, and your API downloaded to racket.
>>
>> To create the proof-of-concept on Liitin, the last versions of each are
>> not necessary. Ideally, I would use ubuntu 10.04 and racket 5.1 and pick
>> working versions of zeromq and your API to go with. Would you, by any
>> chance, remember which versions should work in this setting, if any?
>>
>> Any other combination you know to work in ubuntu, if any?
>
> I don't know what you mean by "API planet 1.0".

Sorry, I was on the move and didn't know how to call it. These are the
ones I meant:
http://planet.racket-lang.org/display.ss?package=zeromq.plt&owner=jaymccarthy


The Planet package is
> not supported by me. It was developed on Ubuntu with the latest
> release of everything when it was posted.

Great, I'll try to trace the combination at that time. It's good to know
that ubuntu was used.

>
> Today, I use archlinux, with Racket 6, with zeromq 4.0.1 and the
> zeromq Racket package I've linked before (available on
> pkgs.racket-lang.org). All the Racket examples from the zguide work
> fine. If you were to send me the program you're trying, we could see
> what is going wrong.

I'm trying to get the bundled examples working first, so I know the
environment is OK.

thanks,
jukka

>
> Jay
>
>> Br, jukka
>>
>> Sent from my iPhone
>>
>>> On 17.11.2013, at 17.12, Jay McCarthy  wrote:
>>>
>>> Now that the new package system, most people are not maintaining their
>>> old Planet packages. The zeromq package has had a lot of change in
>>> particular and perhaps this has gone away for you:
>>>
>>> http://pkgs.racket-lang.org/#[zeromq]
>>>
>>> But also make sure that your library loading environment variables are
>>> set up right
>>>
>>> Jay
>>>
>>> On Sun, Nov 17, 2013 at 8:07 AM, Jukka Tuominen
>>>  wrote:
>>>>
>>>> There's also Jay's port to zeromq, which is looking very promising.
>>>> However, when I try to run it (racket 5.3.5/ Ubuntu 10.04) by...
>>>>
>>>> #lang racket
>>>>
>>>> (require (planet "main.rkt" ("jaymccarthy" "zeromq.plt" 2 1)))
>>>>
>>>> ... it displays the following error:
>>>>
>>>> ffi-lib: couldn't open "libzmq.so" (libzmq.so: cannot open shared
>>>> object
>>>> file: No such file or directory)
>>>>
>>>> ...eventhough there is one in /usr/local/lib/libzmq.so
>>>>
>>>> Any idea of how to get it working?
>>>>
>>>> br, jukka
>>>>
>>>>
>>>>>
>>>>> Hi all,
>>>>>
>>>>> some time ago I built a simple client/server proof-of-concept for the
>>>>> Liitin project ( www.liitin.org )
>>>>> http://lists.racket-lang.org/users/archive/2011-June/046372.html
>>>>>
>>>>> Although this is still valid for a direct, one-way device/service
>>>>> communication, I now have a more generic and UX-oriented p-o-c in
>>>>> mind to
>>>>> follow the Liitin philosophy. Here’s my Internet of Things vision in
>>>>> brief:
>>>>>
>>>>>
>>>>> - A publish/ subscribe server that both users and devices can access
>>>>> through firewalls. Only the server requires a static, public IP. This
>>>>> will
>>>>> be available for Liitin users by default.
>>>>>
>>>>> - Once a device is turned on, it automatically connects to the
>>>>> pub/sub
>>>>> server as a publisher to provide a two-way communication channel:
>>>>> pushing
>>>>> event notificati

Re: [racket] Internet of Things/ Marketplace

2013-11-27 Thread Jukka Tuominen
Jay, 

I've tried numerous version combinations of Racket/zeromq/your API on ubuntu 
10.04 but can't get any to work. These are the versions I've tried:

Racket 5.1 - 5.3.6
Zeromq 2.2 - 4.x
API planet 1.0 - latest pkg
(Several but not every racket versions)

At best, the server gets started (by running either xserver.rkt in drracket) 
but soon becomes unresponsive. The client crashes immediately taking the 
drracket along. Neither one is capable of presenting error messages.

I'm propably doing something seriously wrong, but AFAIU the zeromq is correctly 
compiled and installed now, and your API downloaded to racket. 

To create the proof-of-concept on Liitin, the last versions of each are not 
necessary. Ideally, I would use ubuntu 10.04 and racket 5.1 and pick working 
versions of zeromq and your API to go with. Would you, by any chance, remember 
which versions should work in this setting, if any?

Any other combination you know to work in ubuntu, if any?

Br, jukka

Sent from my iPhone

> On 17.11.2013, at 17.12, Jay McCarthy  wrote:
> 
> Now that the new package system, most people are not maintaining their
> old Planet packages. The zeromq package has had a lot of change in
> particular and perhaps this has gone away for you:
> 
> http://pkgs.racket-lang.org/#[zeromq]
> 
> But also make sure that your library loading environment variables are
> set up right
> 
> Jay
> 
> On Sun, Nov 17, 2013 at 8:07 AM, Jukka Tuominen
>  wrote:
>> 
>> There's also Jay's port to zeromq, which is looking very promising.
>> However, when I try to run it (racket 5.3.5/ Ubuntu 10.04) by...
>> 
>> #lang racket
>> 
>> (require (planet "main.rkt" ("jaymccarthy" "zeromq.plt" 2 1)))
>> 
>> ... it displays the following error:
>> 
>> ffi-lib: couldn't open "libzmq.so" (libzmq.so: cannot open shared object
>> file: No such file or directory)
>> 
>> ...eventhough there is one in /usr/local/lib/libzmq.so
>> 
>> Any idea of how to get it working?
>> 
>> br, jukka
>> 
>> 
>>> 
>>> Hi all,
>>> 
>>> some time ago I built a simple client/server proof-of-concept for the
>>> Liitin project ( www.liitin.org )
>>> http://lists.racket-lang.org/users/archive/2011-June/046372.html
>>> 
>>> Although this is still valid for a direct, one-way device/service
>>> communication, I now have a more generic and UX-oriented p-o-c in mind to
>>> follow the Liitin philosophy. Here’s my Internet of Things vision in
>>> brief:
>>> 
>>> 
>>> - A publish/ subscribe server that both users and devices can access
>>> through firewalls. Only the server requires a static, public IP. This will
>>> be available for Liitin users by default.
>>> 
>>> - Once a device is turned on, it automatically connects to the pub/sub
>>> server as a publisher to provide a two-way communication channel: pushing
>>> event notifications to subscribers and acting on subscribers’ commands. SW
>>> services may use the same method.
>>> 
>>> - Once the user has signed onto his/her (Liitin) account, a daemon is
>>> automatically launched to connect to the pub/sub server as a subscriber to
>>> both receive push notifications and allowing to send commands to the
>>> device.
>>> 
>>> - There’s a Device Manager GUI to add and manage devices. The devices only
>>> contain primitive functions in Racket syntax and all the higher-level
>>> programming is handled by Racket on the client side and stored as Liitin
>>> Objects. In effect, you can freely combine functionality from different
>>> devices and between users when shared. E.g.
>>> (when (below-zero? thermometer-x)(turn-on! heater-y))
>>> The event stream can be parsed e.g. for notifications and direct
>>> reactions, or be integrated into various GUI applications.
>>> 
>>> 
>>> I was happy to hear about the package Marketplace for Racket (
>>> http://blog.racket-lang.org/2013/05/marketplace-language-for-network-aware.html
>>> ), and I wonder if it could be used as a starting point? It would be
>>> native Racket all the way through. Another option is to choose some
>>> generic open-source pub-sub server, and make the user and device ends
>>> speak racket.
>>> 
>>> I’m still speaking of a p-o-c, so it’s more important at this phase to be
>>> able to have the ends communicate with each other and to manage multi-user
>>> and multi-device traffic than to make the implementation robust and

Re: [racket] Internet of Things/ Marketplace

2013-11-18 Thread Jukka Tuominen
Hi Tony,


> On 18.11.2013, at 16.13, Tony Garnock-Jones  wrote:
> 
> Hi Jukka,
> 
>> On 2013-11-16 1:48 AM, Jukka Tuominen wrote:
>> I was happy to hear about the package Marketplace [...], and I wonder
>> if it could be used as a starting point?
> 
> Marketplace is still in flux. It could be useful as a way of forcing
> yourself to really *commit* to the idea of pub/sub-all-the-way-down ;-)
> but it might not be the best choice to build a production system on top
> just yet.

Ok, good to know. As far as I can see, an off-the-shelf pub-sub system is 
propably enough for this purpose, and I'm not really planning on studying the 
pub-sub itself, but rather how to utilize it. 
I'd very much like to choose a system that is robust and can scale up, 
eventhough at this phase and in my hands, a p-o-c is the level that I'm 
targetting. 
> 
> Marketplace was inspired by, and can be seen as a generalization of,
> ordinary pub/sub and queueing middleware like STOMP servers and RabbitMQ.
> 
>> Another option is to choose some generic open-source pub-sub server, 
>> and make the user and device ends speak racket.
> 
> I suggest looking into the STOMP protocol support for RabbitMQ. I wrote
> a Racket STOMP client [1, 2] a while back that might do what you need.

I'll look into those, thanks!

> One of the things I've been meaning to do is write a simple *server* in
> Racket to go along with it, but for now using RabbitMQ or similar is
> probably a good bet.

I'm hoping to have the environment ready to use for a basic user, and familiar 
for a developer as if dealing with any software objects. I have a clear picture 
in my mind...
> 
> (Regarding Arduino: RabbitMQ also has experimental UDP support [3] which
> might be of interest in this connection.)

Sounds very good! So far, I try to restrain myself from moving to even more 
foreign terrain until I get the architecture easy enough for me and others to 
use. 

Br, jukka


> 
> Regards,
>  Tony
> 
> [1] http://planet.racket-lang.org/display.ss?package=stomp.plt&owner=tonyg
> [2] https://github.com/tonyg/racket-stomp
> [3] https://github.com/tonyg/udp-exchange


  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Internet of Things/ Marketplace

2013-11-17 Thread Jukka Tuominen
Thanks Jay for the prompt response, I'll check those things

Br, jukka

Sent from my iPhone

> On 17.11.2013, at 17.12, Jay McCarthy  wrote:
> 
> Now that the new package system, most people are not maintaining their
> old Planet packages. The zeromq package has had a lot of change in
> particular and perhaps this has gone away for you:
> 
> http://pkgs.racket-lang.org/#[zeromq]
> 
> But also make sure that your library loading environment variables are
> set up right
> 
> Jay
> 
> On Sun, Nov 17, 2013 at 8:07 AM, Jukka Tuominen
>  wrote:
>> 
>> There's also Jay's port to zeromq, which is looking very promising.
>> However, when I try to run it (racket 5.3.5/ Ubuntu 10.04) by...
>> 
>> #lang racket
>> 
>> (require (planet "main.rkt" ("jaymccarthy" "zeromq.plt" 2 1)))
>> 
>> ... it displays the following error:
>> 
>> ffi-lib: couldn't open "libzmq.so" (libzmq.so: cannot open shared object
>> file: No such file or directory)
>> 
>> ...eventhough there is one in /usr/local/lib/libzmq.so
>> 
>> Any idea of how to get it working?
>> 
>> br, jukka
>> 
>> 
>>> 
>>> Hi all,
>>> 
>>> some time ago I built a simple client/server proof-of-concept for the
>>> Liitin project ( www.liitin.org )
>>> http://lists.racket-lang.org/users/archive/2011-June/046372.html
>>> 
>>> Although this is still valid for a direct, one-way device/service
>>> communication, I now have a more generic and UX-oriented p-o-c in mind to
>>> follow the Liitin philosophy. Here’s my Internet of Things vision in
>>> brief:
>>> 
>>> 
>>> - A publish/ subscribe server that both users and devices can access
>>> through firewalls. Only the server requires a static, public IP. This will
>>> be available for Liitin users by default.
>>> 
>>> - Once a device is turned on, it automatically connects to the pub/sub
>>> server as a publisher to provide a two-way communication channel: pushing
>>> event notifications to subscribers and acting on subscribers’ commands. SW
>>> services may use the same method.
>>> 
>>> - Once the user has signed onto his/her (Liitin) account, a daemon is
>>> automatically launched to connect to the pub/sub server as a subscriber to
>>> both receive push notifications and allowing to send commands to the
>>> device.
>>> 
>>> - There’s a Device Manager GUI to add and manage devices. The devices only
>>> contain primitive functions in Racket syntax and all the higher-level
>>> programming is handled by Racket on the client side and stored as Liitin
>>> Objects. In effect, you can freely combine functionality from different
>>> devices and between users when shared. E.g.
>>> (when (below-zero? thermometer-x)(turn-on! heater-y))
>>> The event stream can be parsed e.g. for notifications and direct
>>> reactions, or be integrated into various GUI applications.
>>> 
>>> 
>>> I was happy to hear about the package Marketplace for Racket (
>>> http://blog.racket-lang.org/2013/05/marketplace-language-for-network-aware.html
>>> ), and I wonder if it could be used as a starting point? It would be
>>> native Racket all the way through. Another option is to choose some
>>> generic open-source pub-sub server, and make the user and device ends
>>> speak racket.
>>> 
>>> I’m still speaking of a p-o-c, so it’s more important at this phase to be
>>> able to have the ends communicate with each other and to manage multi-user
>>> and multi-device traffic than to make the implementation robust and
>>> secure. Those come later.
>>> 
>>> I will use virtual machines for the pub/sub server and device clients to
>>> begin with. The user clients will be integrated into Liitin accounts. It
>>> would be great to add Arduino support at some point.
>>> 
>>> What do you think, would the Marketplace be a good starting point or do
>>> you recommend some other approach? Any pointers and comments regarding
>>> either the concept or the implementation are greatly appreciated.
>>> 
>>> 
>>> br, jukka
>>> 
>>> 
>>> 
>>> 
>>>  Racket Users list:
>>>  http://lists.racket-lang.org/users
>> 
>> 
>> 
>>  Racket Users list:
>>  http://lists.racket-lang.org/users
> 
> 
> 
> -- 
> Jay McCarthy 
> Assistant Professor / Brigham Young University
> http://faculty.cs.byu.edu/~jay
> 
> "The glory of God is Intelligence" - D&C 93


  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Internet of Things/ Marketplace

2013-11-17 Thread Jukka Tuominen

There's also Jay's port to zeromq, which is looking very promising.
However, when I try to run it (racket 5.3.5/ Ubuntu 10.04) by...

#lang racket

(require (planet "main.rkt" ("jaymccarthy" "zeromq.plt" 2 1)))

... it displays the following error:

ffi-lib: couldn't open "libzmq.so" (libzmq.so: cannot open shared object
file: No such file or directory)

...eventhough there is one in /usr/local/lib/libzmq.so

Any idea of how to get it working?

br, jukka


>
> Hi all,
>
> some time ago I built a simple client/server proof-of-concept for the
> Liitin project ( www.liitin.org )
> http://lists.racket-lang.org/users/archive/2011-June/046372.html
>
> Although this is still valid for a direct, one-way device/service
> communication, I now have a more generic and UX-oriented p-o-c in mind to
> follow the Liitin philosophy. Here’s my Internet of Things vision in
> brief:
>
>
> - A publish/ subscribe server that both users and devices can access
> through firewalls. Only the server requires a static, public IP. This will
> be available for Liitin users by default.
>
> - Once a device is turned on, it automatically connects to the pub/sub
> server as a publisher to provide a two-way communication channel: pushing
> event notifications to subscribers and acting on subscribers’ commands. SW
> services may use the same method.
>
> - Once the user has signed onto his/her (Liitin) account, a daemon is
> automatically launched to connect to the pub/sub server as a subscriber to
> both receive push notifications and allowing to send commands to the
> device.
>
> - There’s a Device Manager GUI to add and manage devices. The devices only
> contain primitive functions in Racket syntax and all the higher-level
> programming is handled by Racket on the client side and stored as Liitin
> Objects. In effect, you can freely combine functionality from different
> devices and between users when shared. E.g.
> (when (below-zero? thermometer-x)(turn-on! heater-y))
> The event stream can be parsed e.g. for notifications and direct
> reactions, or be integrated into various GUI applications.
>
>
> I was happy to hear about the package Marketplace for Racket (
> http://blog.racket-lang.org/2013/05/marketplace-language-for-network-aware.html
> ), and I wonder if it could be used as a starting point? It would be
> native Racket all the way through. Another option is to choose some
> generic open-source pub-sub server, and make the user and device ends
> speak racket.
>
> I’m still speaking of a p-o-c, so it’s more important at this phase to be
> able to have the ends communicate with each other and to manage multi-user
> and multi-device traffic than to make the implementation robust and
> secure. Those come later.
>
> I will use virtual machines for the pub/sub server and device clients to
> begin with. The user clients will be integrated into Liitin accounts. It
> would be great to add Arduino support at some point.
>
> What do you think, would the Marketplace be a good starting point or do
> you recommend some other approach? Any pointers and comments regarding
> either the concept or the implementation are greatly appreciated.
>
>
> br, jukka
>
>
>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>



  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Internet of Things/ Marketplace

2013-11-15 Thread Jukka Tuominen

Hi all,

some time ago I built a simple client/server proof-of-concept for the
Liitin project ( www.liitin.org )
http://lists.racket-lang.org/users/archive/2011-June/046372.html

Although this is still valid for a direct, one-way device/service
communication, I now have a more generic and UX-oriented p-o-c in mind to
follow the Liitin philosophy. Here’s my Internet of Things vision in
brief:


- A publish/ subscribe server that both users and devices can access
through firewalls. Only the server requires a static, public IP. This will
be available for Liitin users by default.

- Once a device is turned on, it automatically connects to the pub/sub
server as a publisher to provide a two-way communication channel: pushing
event notifications to subscribers and acting on subscribers’ commands. SW
services may use the same method.

- Once the user has signed onto his/her (Liitin) account, a daemon is
automatically launched to connect to the pub/sub server as a subscriber to
both receive push notifications and allowing to send commands to the
device.

- There’s a Device Manager GUI to add and manage devices. The devices only
contain primitive functions in Racket syntax and all the higher-level
programming is handled by Racket on the client side and stored as Liitin
Objects. In effect, you can freely combine functionality from different
devices and between users when shared. E.g.
(when (below-zero? thermometer-x)(turn-on! heater-y))
The event stream can be parsed e.g. for notifications and direct
reactions, or be integrated into various GUI applications.


I was happy to hear about the package Marketplace for Racket (
http://blog.racket-lang.org/2013/05/marketplace-language-for-network-aware.html
), and I wonder if it could be used as a starting point? It would be
native Racket all the way through. Another option is to choose some 
generic open-source pub-sub server, and make the user and device ends
speak racket.

I’m still speaking of a p-o-c, so it’s more important at this phase to be
able to have the ends communicate with each other and to manage multi-user
and multi-device traffic than to make the implementation robust and
secure. Those come later.

I will use virtual machines for the pub/sub server and device clients to
begin with. The user clients will be integrated into Liitin accounts. It
would be great to add Arduino support at some point.

What do you think, would the Marketplace be a good starting point or do
you recommend some other approach? Any pointers and comments regarding
either the concept or the implementation are greatly appreciated.


br, jukka




  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Save/open MrEd Designer project

2013-02-02 Thread jukka . tuominen

... no luck with the github version either :(

br, jukka


>
> Hi Laurent,
>
> please, see the .med attached. I actually tried a few different, but
> pretty similar in content.
>
> Here is also the error message from the DrRacket:
>
> ---
> ..\..\..\..\Program
> Files\Racket\collects\racket\contract\private\blame.rkt:89:0: dict-ref:
> contract violation
>  expected: d:dict?
>  given: '(list (cons 'name "project-11668") (cons 'parent-class #f) (cons
> 'med-version (list 3 9)) (cons 'code (lambda (parent-12427) (let*
> ((code-12429 parent-12427) (code-12431 (new prop:atom% (value
> 'project-11668))) (code-12430 (new prop:field-id% (va...
>  in: the d argument of
>   (->i
>((d d:dict?) (k (d) ...))
>((default any/c))
>any)
>  contract from: /racket/dict.rkt
>  blaming:
>   /orseau/mred-designer.plt/3/9/templates.ss
>  at: /racket/dict.rkt:143.2
>
> ---
>
> I try to figure out how to test the github version... :)
>
> br, jukka
>
>
>
>> Hi Jukka,
>>
>> That's strange. Can you send me your .med file?
>>
>> Also, can you try with the head in the git repo, to see if that makes a
>> difference?
>> https://github.com/Metaxal/MrEd-Designer
>>
>> Cheers,
>> Laurent
>>
>>
>> On Sat, Feb 2, 2013 at 1:15 PM, Jukka Tuominen
>> >> wrote:
>>
>>> Hi,
>>>
>>> I was going to experiment with the latest MrEd Designer and made a
>>> quick
>>> test GUI. I then saved the project (.med), but couldn't open it again
>>> from the file.
>>>
>>> I tried with Racket 5.1 and 5.3.2, Linux and Windows, but without luck.
>>>
>>> Are others experiencing the same problem? Any ideas how to get it
>>> working?
>>>
>>> br, jukka
>>>
>>> 
>>>   Racket Users list:
>>>   http://lists.racket-lang.org/users
>>>
>>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>



  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Save/open MrEd Designer project

2013-02-02 Thread Jukka Tuominen
Hi,

I was going to experiment with the latest MrEd Designer and made a quick
test GUI. I then saved the project (.med), but couldn't open it again
from the file.

I tried with Racket 5.1 and 5.3.2, Linux and Windows, but without luck.

Are others experiencing the same problem? Any ideas how to get it
working?

br, jukka


  Racket Users list:
  http://lists.racket-lang.org/users


[racket] System-wide keyboard shortcuts

2012-07-21 Thread Jukka Tuominen

Hi all,

I'm trying to figure out how to capture keyboard events system-wide. I
tried searching the documentation, but AFAIU the events are limited to
the window in focus. Does this require talking with the system below
(Linux/Ubuntu/Gnome), or is there a direct way from Racket? Any help or
pointers appreciated.

Background: I think it would be nice to have Liitin Home Object
providing shortcuts to preferred liitin objects at all times.

br, jukka


 |  J U K K A   T U O M I N E N
 |  m a n a g i n g   d i r e c t o r  M. A.
 |
 |  Finndesign  Kauppiaankatu 9 B 13, FI-00160 Helsinki, Finland
 | mobile +358 50 5666290  jukka.tuomi...@finndesign.fi
 | www.finndesign.fi



  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Redefinition of initial bindings/ Resessive genes in GP

2012-07-08 Thread jukka . tuominen

Not that I would understand any of this, but it works perfectly!

Thank you so much Jens, Danny and Eli!

br, jukka



> 2012/7/8  :
>>
>> I came across this "mutable-define" by Eli (3+ years back)...
>>
>> ;; http://paste.lisp.org/display/67203
>> ;; this is a PLT version, translate as necessary
>>
>> (define-syntax-rule (define-mutable name expr)
>>   (begin (define b (box expr))
>>  (define-syntax name
>>(syntax-id-rules (set!)
>>  [(set! name new) (set-box! b new)]
>>  [(name . xs) ((unbox b) . xs)]
>>  [name (unbox b)]
>>
>> ;(define x 1)
>> ;(define x 2)
>>
>>
>> ...which seems beautifully concise for the job. The only problem is that
>> it only seems to work in the interactions window in drracket. Is there a
>> way to have it working inside a module? ... hopefully so that all the
>> tweaks would take place inside the very module, rather than "required"
>> from elsewhere (that would keep it an GP individual's property/"gene").
>>
>> This is obviously what Danny is trying to explain me - "...language
>> variant of Racket where "define" acts like redefinition at the module
>> toplevel..." - but once again, I seem to be reaching out things before
>> understanding them.
>
> Combining Dannys def and Eli's define-mutable I get this:
>
>
> #lang racket
>
> ;; Returns true if stx is an identifier that's been lexically bound.
> (define-for-syntax (lexically-bound? stx)
>   (let ([expanded (local-expand stx (syntax-local-context) #f)])
> (not (and (identifier? expanded)
>   (eq? #f (identifier-binding expanded))
>
> (define-syntax (defm stx)
>   (syntax-case stx ()
> [(_ name expr)
>  (and (identifier? #'name) (lexically-bound? #'name))
>  (syntax/loc stx (set! name expr))]
> [(_ name expr)
>  (identifier? #'name)
>  (syntax/loc stx
>(begin
>  (define b (box expr))
>  (define-syntax name
>(make-set!-transformer
> (lambda (stx)
>   (syntax-case stx (set!)
> [(set! name new) #'(set-box! b new)]
> [(name . xs) #'((unbox b) . xs)]
> [name#'(unbox b)]))]))
>
> ;;; Testing
>
> (defm x 1)
> x
> (list (+ x 40))
> (defm x 2)
> x
> (list (+ x 40))
> (set! x 3)
> x
>
>
> (defm y 4)
> y
> (list (+ y 40))
> (defm y 5)
> y
> (list (+ y 40))
> (set! y 6)
> y
>
>
> ; The output is
>
> 1
> '(41)
> 2
> '(42)
> 3
> 4
> '(44)
> 5
> '(45)
> 6
>
>
> --
> Jens Axel Søgaard
>



  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Redefinition of initial bindings/ Resessive genes in GP

2012-07-08 Thread jukka . tuominen

I came across this "mutable-define" by Eli (3+ years back)...

;; http://paste.lisp.org/display/67203
;; this is a PLT version, translate as necessary

(define-syntax-rule (define-mutable name expr)
  (begin (define b (box expr))
 (define-syntax name
   (syntax-id-rules (set!)
 [(set! name new) (set-box! b new)]
 [(name . xs) ((unbox b) . xs)]
 [name (unbox b)]

;(define x 1)
;(define x 2)


...which seems beautifully concise for the job. The only problem is that
it only seems to work in the interactions window in drracket. Is there a
way to have it working inside a module? ... hopefully so that all the
tweaks would take place inside the very module, rather than "required"
from elsewhere (that would keep it an GP individual's property/"gene").

This is obviously what Danny is trying to explain me - "...language
variant of Racket where "define" acts like redefinition at the module
toplevel..." - but once again, I seem to be reaching out things before
understanding them.

br, jukka

>
>
>>> The offspring is basically a module source code. Due to GP's crossover
>>> and
>>> mutation functions, the offsprings source code can suggest function
>>> redefinitions in (atleast) two ways. For example
>>
>> You might consider a customized module language that's more amendable
>> to the kinds of code mutations you're considering.  That is, it's
>> possible to have a language variant of Racket where "define" acts like
>> redefinition at the module toplevel.  I have an example of something
>> like this in my Arctangent toy language (Refernce: see the definition
>> of 'def' in
>> https://github.com/dyoo/arctangent/blob/master/language.rkt)
>>
>
> Thanks Danny, I got lots of new ideas from this. A customized language is
> a great possibility. However, there's quite a lot of existing "creatures"
> which I'd rather keep valid and intact. What I'm now thinking, is either..
>
> A) "Inject" the kind of def/arctangent definition to a
> individual/population and see if it takes off.
>
> B) Allow individuals to use the new "def" function if they ever come
> across it (by crossover/mutation e.g.). This would be a part of the
> initial environment "require".
>
> C) Try to find a way to replace the original "define" definition with the
> "def". This would be the fastest way to deploy it, but I'd need to be
> careful not to break the earlier work.
>
> Propably a combination of A and B might be the best bet. The initial
> environment is expanded to cover a new function def1 (as a primitive, but
> not the source), and some individuals could be injected with def2
> including the source. Having the source included, exposes it to
> evolutionary changes. So, you would end up having three variants (define,
> def1 def2) available to choose from. If these were interchangeable,
> mutation could easily handle it. And new variants could evolve faster than
> spontaniously (who knows if there is something like that already in the
> population :)
>
> And I may end up creating a new #lang in the end, if necessary.
>
>
>>
>>
>> I don't think redefinition should be the default, given that standard
>> Racket's approach is to generally make mutation an explicitly
>> represented feature.  That is, if I want to see that something stays
>> the same, I grep for 'set!' in my code, and if I don't see it, I can
>> assume that I don't mutate my toplevel.
>>
>
> Makes sense, I agree. But if there was a commandline option like
>
> $ racket -allow-redefinitions ...
>
> available, that would be great. Or if you could somehow enable it by code.
>
>
> br, jukka
>
>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>



  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Redefinition of initial bindings/ Resessive genes in GP

2012-07-06 Thread jukka . tuominen


>> The offspring is basically a module source code. Due to GP's crossover
>> and
>> mutation functions, the offsprings source code can suggest function
>> redefinitions in (atleast) two ways. For example
>
> You might consider a customized module language that's more amendable
> to the kinds of code mutations you're considering.  That is, it's
> possible to have a language variant of Racket where "define" acts like
> redefinition at the module toplevel.  I have an example of something
> like this in my Arctangent toy language (Refernce: see the definition
> of 'def' in
> https://github.com/dyoo/arctangent/blob/master/language.rkt)
>

Thanks Danny, I got lots of new ideas from this. A customized language is
a great possibility. However, there's quite a lot of existing "creatures"
which I'd rather keep valid and intact. What I'm now thinking, is either..

A) "Inject" the kind of def/arctangent definition to a
individual/population and see if it takes off.

B) Allow individuals to use the new "def" function if they ever come
across it (by crossover/mutation e.g.). This would be a part of the
initial environment "require".

C) Try to find a way to replace the original "define" definition with the
"def". This would be the fastest way to deploy it, but I'd need to be
careful not to break the earlier work.

Propably a combination of A and B might be the best bet. The initial
environment is expanded to cover a new function def1 (as a primitive, but
not the source), and some individuals could be injected with def2
including the source. Having the source included, exposes it to
evolutionary changes. So, you would end up having three variants (define,
def1 def2) available to choose from. If these were interchangeable,
mutation could easily handle it. And new variants could evolve faster than
spontaniously (who knows if there is something like that already in the
population :)

And I may end up creating a new #lang in the end, if necessary.


>
>
> I don't think redefinition should be the default, given that standard
> Racket's approach is to generally make mutation an explicitly
> represented feature.  That is, if I want to see that something stays
> the same, I grep for 'set!' in my code, and if I don't see it, I can
> assume that I don't mutate my toplevel.
>

Makes sense, I agree. But if there was a commandline option like

$ racket -allow-redefinitions ...

available, that would be great. Or if you could somehow enable it by code.


br, jukka



  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] What math do you want to do in Racket?

2012-07-01 Thread jukka . tuominen

Slightly off-topic propably, but to be able to create generic math user
interfaces easily (for non-racketeers), infix->prefix and prefix->infix
helpers would be great.

Infix->prefix should be tolerant to expected human-input variations (e.g.
white space usage, math-symbol variants), and the output in both should be
"the recommended way".

I know some converters exist, but IIRC these only go half ways in some
aspects.

br, jukka




  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Redefinition of initial bindings/ Resessive genes in GP

2012-06-30 Thread jukka . tuominen

Dear list,

regarding my Genetic Programming hobby, I have a question about
redefinitions in the source code.

Just briefly, the process goes so that a GP individual is given a chance
to reproduce an offspring by executing its function X. At another point of
time the offspring is given a change to run the fittness test by executing
its function Y.

The offspring is basically a module source code. Due to GP's crossover and
mutation functions, the offsprings source code can suggest function
redefinitions in (atleast) two ways. For example

(define a 3)
(define a 7)
(set! a (+ 1 2))
(define a b)
(set! a (+ b c))

Now, when the offspring function "a" is called, will it return error or
one of the definitions above? If latter, then which one will it pick and
why? I mostly run the process from a shell commandline/ racket. If racket
doesn't allow redefinitions by default, how could I change it?

This may seem silly, but actually by having the redefitions allowed can
have positive benefits, I think:

- You can have "resessive" alternatives to functions that increase
diversity in the population (many possible answers).

- You can preserve a "once useful" definition in the population that may
become useful once again after a long time (~like resistence to a serious
disease)

- Giving the evolution the time and space needed to "work out" more
complex redefinitions. When unactivated (resessive), the redefinition can
use many generations of crossover and mutations to come up with a
radically different solution (and also bypass the local optima obstacle).
Then, all you need is to remove the prominant definition to active the
new, resessive definition. Crossover or mutation will handle the removal
easily in the future generations.

All this allows hidden evolution to take place, while the prominant
functionality is always the fittest known (fenotype).

Now, I could be wrong there... Comments?


br, jukka




  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] `def' ?

2012-05-11 Thread jukka . tuominen

My point was not so much about def in particular, or any single change.
Rather, one's personal or even collective development should not lead to
making the language gradually more difficult to beginners IMO.

br, jukka


> Asserting that the keyword "def" would confuse beginners is a red herring.
> Scheme is AFAIK the only language whose variable binding form is _not_
> some
> kind of an abbreviation. C#/JavaScript use "var". Heck, D and C++11 use
> "auto", which is truly bizzare. "def" is a very common keyword to use for
> this purpose (Clojure, Scala, Groovy, Java, Ruby - the list goes on).
>
> There are valid arguments against introducing the syntax - Scheme
> tradition, the abundance of other forms that all include "define",
> avoiding
> redundancy, the fact that languages in general do not have a bunch of
> equivalent keywords for binding variables. But
> readability/familiarity/understandability is not one of them. I would be
> flabbergasted if the words {"let", "var", "val", "def", ...} were
> confusing
> to any beginner.
>
> On Fri, May 11, 2012 at 4:27 PM, Jukka Tuominen <
> jukka.tuomi...@finndesign.fi> wrote:
>
>>
>> I can't say I like the idea for usability and compatibility reasons.
>>
>> Usability:
>>  - Try this idea exaggerated: def lmbd cwcc cdr cond tgt gg param ...
>>   Maybe for hard core pros, but this doesn't make the language
>>   very approachable for the beginners. I made a few new ones so
>>   even the pros could have a taste of it :)
>>
>> Compatibility:
>>  - What if I'd like to run the code with a Racket a few
>>   versions back? Or even dare to try it with another dialect of scheme?
>>
>> What about using key shortcuts, auto completion, personal mappings
>> or other IDE means to end up having in all above cases identical and
>> therefore compatible source code?
>>
>> br, jukka
>>
>> 
>>  Racket Users list:
>>  http://lists.racket-lang.org/users
>>
>



  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] `def' ?

2012-05-11 Thread Jukka Tuominen

I can't say I like the idea for usability and compatibility reasons.

Usability:
 - Try this idea exaggerated: def lmbd cwcc cdr cond tgt gg param ...
   Maybe for hard core pros, but this doesn't make the language 
   very approachable for the beginners. I made a few new ones so 
   even the pros could have a taste of it :) 

Compatibility:
 - What if I'd like to run the code with a Racket a few 
   versions back? Or even dare to try it with another dialect of scheme?

What about using key shortcuts, auto completion, personal mappings 
or other IDE means to end up having in all above cases identical and
therefore compatible source code?

br, jukka


  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] REPL "Organism" <=> The Borg?

2012-05-02 Thread Jukka Tuominen

Hi Olwe,

Liitin (liitin.finndesign.fi) wasn't originally designed to assimilate
humankind, but now that you mention it, it seems like a perfect means to
it. Feeding new data and functionality and distributing them is made
easy, versatile networking and parallel computation are also built-in.
There is quite a lot to it, so you may want to check the above project
page.

Another, AI-related project of mine, however is likely to get there
first. It is based on genetic programming and it evolves by
itself/herself/themselves - even as we speak - but you can also feed it
new skills. It uses those skills as black-box functionality, however it
may freely expand their usage in new situations or challenge them with
its own solutions. It pretty much does what it wants, really. I merely
gave it a starting point.

Either way, resistance is futile. Borg enough for you? :)

Both projects are Racket-based and lean heavily on dynamic evaluation
and efficient re-use of existing work. I'm doomed to be a permanent
beginner, so if I can do this, anyone can. Good luck and keep us
informed on your progress!   

br, jukka



On Tue, 2012-05-01 at 16:33 -0400, Eli Barzilay wrote:
> 30 minutes ago, Olwe Melwasul wrote:
> > 
> > Is anyone thinking along these lines? It seems like an environment
> > like Lisp/ Scheme with so much blurring of data and code, with
> > homoiconicity (why live without it?), with a REPL able to take new
> > code on the fly would be getting there. [...]
> 
> Sounds like you should look into Liitin.
> 
> 
> > But then I've heard people from PLT/Racket downplaying the whole
> > dynamic feeding of a REPL.
> 
> (Not really.)
> 



  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] DrRacket needs work

2011-11-14 Thread Jukka Tuominen

Hi all,

I wish I had more time for this thread topic at the moment since it's extremely 
interesting to me because usability and visual GUI design is my daily work and 
passion, but also because I'd also like to improve the Racket IDE and hopefully 
even see a GUI builder integrated into it eventually. I'm sure to come back to 
this later on, but for now, I hope I can contribute at least a little.

The easier part. To get rid of some of the 80's/shareware/non-native looks a 
few generic things could be improved without being a professional graphics 
designer.
- Get rid of all the hard-coded colour and font definitions on the GUI 
framework, and use OS-specific mappings instead. To verify them afterwards, 
test the results on different OS'es, different themes on each, with different 
system font sizes applied.
- Get rid of all the self-made widgets (GUI controls), and use native OS 
controls instead (GTK mappings to native OS?).
- More professional help is needed for refined look and feel on layout details, 
illustrations, and icon design (metaphors and looks). Also, the font and colour 
definitions on the definitions/interaction panes could use a professional touch 
for more stylistic and legible defaults (atleast to get rid of the odd default 
font size and 16 colour palette). 

The more difficult part. To improve the usability, more precise information is 
needed, and especially, prioritising of it to be able to then apply it to 
actual GUI design. Eventhough there is a lot of expertise, experience, 
opinions, passion, and desires in the air, it all seem unstructured and partly 
contradicting, and therefore difficult to turn into concrete and reasoned GUI 
design. So, a perfectly normal starting point :)
Here are some issues usually needed for a good concept design brief, useful 
also to later validate the concept proposals (the product validity and 
usefulness for its knowingly selected target groups, rather than verifying the 
correctness of functionality, for example. Verification comes later). 

Who are the precise, targetted product stakeholders? Usually usability is 
considered as something concerning end users only. Overly generic target groups 
aren't very useful either. I'm starting with an educated guess. Feel free to 
add and correct as necessary, and arrange to prioritised order (the most 
important one on top)
- People new to programming
- CS teachers
- Professional, semi-professional Scheme/Racket users
- People with more or less experience with other programming languages 
evaluating Racket as something potentially useful/interesting to them.
- Self-learners

The most important, frequent, or otherwise essential use cases _for_each_ 
target group, prioritised. 

More base information and guidelines for the concept design. A FAQ for each 
group could be useful; what issues are raised most often? Other requirements, 
needs, and desires for each group?. Examples where the use cases are best 
handled or ideas for good solutions. Anything else relevant?

Profiling against other similar products? How would you like Racket to be 
differentiated from others, what should it be known of? Guessing again...
- Easily approachable for people new to programming, or Scheme.
- Easily teachable
- The language for creating languages
- Powerful and practical beyond others

All of this, could then be used to determine what is present foremost in the 
GUI and how, and what is buried deeper for less frequent or more advanced use. 
Where single, well-thought solution is better, where user-specific flexibility 
is required?Actual use cases can be tested against the GUI proposals to choose 
the most fit approach and optimise details even further (e.g. less phases for 
the most frequent tasks, shortcuts added where needed to support advanced use, 
and so on).

I hope you find this useful.


br, jukka


|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290 
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi 



_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


[racket] More interfaces to/from Liitin

2011-10-27 Thread Jukka Tuominen

Hi,

I wonder if there is anybody with Liitin account and access to a x-server
enabled client that could test the following shell command: (OSX in
particular haven't been tested, Ubuntu should work)

ssh -X -l USERNAME liitin.finndesign.fi
/afs/finndesign.fi/service/liitin/racket/bin/gracket -f
/afs/finndesign.fi/service/liitin/my-home-view.scm

(all on one line, replace USERNAME with your Liitin username. Icon attached
if you want to create a launcher)

When executed, it should ask for a confirmation to contact the server (first
time only) followed by a Liitin password query.

If everything goes well, you should have your Liitin home object opening on
your desktop (app launcher by default). From there on, you will have full
access to all public and private Liitin objects, personal home directory on
global AFS tree, Linux apps and commands etc.
For example, try: Script-manager > Random script > Run
Or, (jtu100:drracket) run from Sript manager should open DrRacket with
Liitin environment.

For those interested in Liitin progress, more information below.

br, jukka

---

I earlier mentioned that it is possible to run Liitin client either on bare
metal, as a virtual machine or remotely over VNC. Some time later, a RCP
client/server was tried for providing a read-only connection to Liitin
objects.

Now there are a few more possibilities.

- You can boot Liitin client from a USB stick. It acts as if a read-only
Live CD, except that instead of starting from scratch each time, you can
access your full personal account. If you loose the stick, there's no trace
of your data. However, trasparently working and encrypted AFS cache survives
reboots reducing traffic over WAN. Soon you'll be able to deploy new Liitin
clients with it, or on a "headless" or otherwise unconfortable computer you
can just boot it as a node you can control from another Liitin client.

- On a X-client (Linux, OSX?, Win/Cyg-win or Xming?), you can "bring over"
your Liitin Home object (SSH/X-forward) to start it in a new window within
your current OS. From there on, you can execute further Liitin objects -
even private ones, launch new windows (e.g. DrRacket even if you haven't
installed it locally), access home directory etc. I personally prefer to do
it the other way around though; i.e. view external OS applications within
Liitin. Even most Windows applications are accessible through Wine. OSX
haven't been tried. Of course, you can do it between Liitin clients, as
well. Being able to create and manage virtual machines without leaving your
personal desktop is pretty nice as well (X-forwarded GUI).

- From Liitin, you can access other computers through SSH; execute commands,
transfer files and previously mentioned GUI applications. You can also
script mounting and unmounting remote resources, and for example sync
between two remote resources as if both local. I've done it from DrRacket.
According to the Liitin filosophy, there's no separate administrator or sudo
user. You can, however, ssh computers as root. All is handled from your
personal desktop and all computers have a similar interface, remote and
local.

- In addition to launching the Home object through X-forwarding, you can use
a SSH script to launch any other Liitin object directly as well, Linux apps,
or just execute and/or return a object to be further used in an external
system. The overhead to make connection, initiate gracket and liitin
environment is substantial atleast for now, however. Again, this is done
through your own Liitin account, so you have access also to your private
Liitin objects and home directory. Having different PLT-Scheme and Racket
versions also available soon hopefully, you should be able to have an older
code run on a specific version and return the results on an external
computer, for example. And since it is a uniform and common environment to
all Liitin users, you can save the script as a Liitin object and share with
others, instead of merely instructing how it can be done.

Depending on the source and target computers, the SSH authentication can be
either interactice password, passwordless SSH key (scripts to create and
transfer key to a remote computer exist), or single-sign-on kerberos
delegation among trusted hosts. The last one should allow distributing
execution transparently among several, uniform Liitin clients.

Drawback: Currently, Liitin is utilizing less than 1/10 of the WAN bandwidth
which we are hoping to fix at some point. Before Moore will fix it, I hope.



|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi

<>_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Re: [racket] Serving multiple, read-only Racket versions?

2011-10-24 Thread Jukka Tuominen

Sorry, meant to reply to the list, also :)

-Original Message-
From: Jukka Tuominen [mailto:jukka.tuomi...@finndesign.fi]
Sent: 24 October 2011 22:52
To: Neil Van Dyke
Subject: RE: [racket] Serving multiple, read-only Racket versions?



> -Original Message-
> From: Neil Van Dyke [mailto:n...@neilvandyke.org]
> Sent: 24 October 2011 20:06
> To: Jukka Tuominen
> Cc: users@racket-lang.org
> Subject: Re: [racket] Serving multiple, read-only Racket versions?
>
>
> Jukka Tuominen wrote at 10/24/2011 12:06 PM:
> > I wonder if it's possible to place multiple, read-only Racket
> versions on a
> > server and have users executing them directly without needing to install
> > them individually? I think this is possible, but I'd like to
> know for sure
> > that it won't cause any unexpected problems.
>
> Yes, I have been doing this for years, including on production servers,
> by building with the "--prefix" argument to "configure".

Great, I'll look into that. I'll propably build them locally first and then
move to AFS tree to prevent any large scale suprises.

For example,
> on this laptop, at the moment, I have:
>
> ls -ld /usr/local/racket-*
> drwxr-sr-x 6 root staff 4096 Sep 29 08:55 /usr/local/racket-5.1.2
> drwxr-sr-x 6 root staff 4096 Sep 25 06:21 /usr/local/racket-5.1.3
> drwxr-sr-x 6 root staff 4096 Sep 26 18:32 /usr/local/racket-5.1.3.10
> drwxr-sr-x 6 root staff 4096 Oct 10 23:56
> /usr/local/racket-5.2.0.1-nightly

Neat and tidy :) It seems that PLT/Racket folks have given this much more
thought than an average project.

>
> (Eli has a somewhat different way of accomplishing this same thing; you
> might prefer to search the mail archive for his way.  This has come up
> multiple times before.)

Will do, thanks

>
> > Does this sound feasible? I understand that initial PLaneT libraries may
> > take time to download and are placed into home directory
> (version handled?).
>
> My understanding is... Yes, the PLaneT libraries are installed in the
> user's home directory.  Each such PLaneT package's installation is
> specific to the Racket version by which it was installed, and multiple
> such versions can be installed simultaneously.  Note that these Racket
> version numbers are the official Racket version numbers, not any other
> version number you might use in directory names in "/usr/local".

Good to know. I think this is less of a problem/inconvenience, since this is
automatic and hidden from a basic user. As long as you can trust it to deal
with itself.

>
> > One possible threat is to manipulate source code with a newer program
> > version and make it inaccessible thereafter for the older versions?
>
> You will have to look closely at security.  Depending on the nature of
> your system, the current version of PLaneT might not be secure enough
> as-is.  If it's not secure enough, but you still desire to use it in
> some way, you could layer your own security atop it.  You could also
> talk with PLT people and me about how the next big version of PLaneT
> could address the specific issues you see.
>
> --
> http://www.neilvandyke.org/

So far, I have no idea what the new PLaneT will be like, but I'll keep that
in mind. Apart from the core Liitin engine and consistent interface, I'd
rather provide both Racket and PLaneT libraries "as intented by the author",
which is the policy with other software within Liitin as well.

br, jukka


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


[racket] Serving multiple, read-only Racket versions?

2011-10-24 Thread Jukka Tuominen

Dear list,

I wonder if it's possible to place multiple, read-only Racket versions on a
server and have users executing them directly without needing to install
them individually? I think this is possible, but I'd like to know for sure
that it won't cause any unexpected problems.

The idea is to provide Liitin users access to various future/past software
binaries yet keeping the client environment and Liitin engine uniform and
static, and relatively compact. To have it functional and
secure/confidential it should conform to the following characteristics:
- Content on the server is read-only. E.g.
.../racket/version-a
  /version-b
  /version-c
  ...
(Version names are likely to be publishing dates to have uniform structure
in all provided software, and to allow common scripts to find the latest
version, for example)
- Client computer (Liitin UVM) is allowed to create temporary data during
execution as long as it doesn't compromise security of reveal confidental
information among users. All of this will be wiped away at the next reboot
at latest. Future use must not rely on this data.
- User's home directory can be used to store data and configuration
information between reboots and among several simultanenous user sessions.
Sessions can be on the same client or/and different clients. (Some programs
don't like multiple sessions accessing the same data).

Does this sound feasible? I understand that initial PLaneT libraries may
take time to download and are placed into home directory (version handled?).
Also, personal, user space installation is possible but less desirable in
this case, I think.

One possible threat is to manipulate source code with a newer program
version and make it inaccessible thereafter for the older versions?

Anything else?

Of course, this is not the recommended way to use Liitin, on the contrary
really, but it could be helpful to have wider range of tools available.

br, jukka


|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Concurrent execution

2011-10-03 Thread Jukka Tuominen

Beautiful!

the results are much clearer this way, and it's good to know why. I noticed 
(googled) that you have had this figured out long ago :) This was a great 
learning excercise, and I'm glad I was on the right track.

br, jukka

> -Original Message-
> From: Eli Barzilay [mailto:e...@barzilay.org]
> Sent: 03 October 2011 22:57
> To: jukka.tuomi...@finndesign.fi
> Cc: Sam Tobin-Hochstadt; Racket mailing list; Robby Findler; Ivanyi
> Peter
> Subject: Re: [racket] Concurrent execution
> 
> 
> Four hours ago, jukka.tuomi...@finndesign.fi wrote:
> > 
> > Wow, that's great Sam!
> > 
> > I tried to create a simple test around it (below), but it's 
> hard to find a
> > pattern in the results. A few notes, though:
> > 
> > - The results vary a great deal from run to run
> > - 'Plain map' seems to do things in parallel itself!?
> >   (by looking at the System Monitor during the test run)
> >   This may paralyze secondary parallelizing :)
> > - Plain map does usually better with short lists. No wonder.
> > - The amount of distribution should be related to the available
> >   number of HW processors; not the more the merrier, obviously.
> 
> Using factorial to measure speed is not a good idea -- since with
> bigger numbers much of the time is spent on GC work for the bignums.
> Also, it looks like you were timing the printouts too, and with big
> numbers that can take a considerable amount of time too.
> 
> Here's a short test using a factorial -- note that pmap takes a bit
> more overall cpu time, but the real time is much shorter.
> 
> -> (define (pmap f xs)
>  (map touch (map (λ (x) (future (lambda () (f x xs)))
> -> (define (fib n) (if (<= n 1) n (+ (fib (- n 1)) (fib (- n 2)
> -> (time (map fib '(35 36 37 38)))
> cpu time: 5088 real time: 5098 gc time: 0
> '(9227465 14930352 24157817 39088169)
> -> (time (pmap fib '(35 36 37 38)))
> cpu time: 5106 real time: 2292 gc time: 0
> '(9227465 14930352 24157817 39088169)
> 
> -- 
>   ((lambda (x) (x x)) (lambda (x) (x x)))  Eli Barzilay:
> http://barzilay.org/   Maze is Life!
> 


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Re: [racket] Concurrent execution

2011-10-03 Thread jukka . tuominen

Wow, that's great Sam!

I tried to create a simple test around it (below), but it's hard to find a
pattern in the results. A few notes, though:

- The results vary a great deal from run to run
- 'Plain map' seems to do things in parallel itself!?
  (by looking at the System Monitor during the test run)
  This may paralyze secondary parallelizing :)
- Plain map does usually better with short lists. No wonder.
- The amount of distribution should be related to the available number of
  HW processors; not the more the merrier, obviously.

---
#lang racket

(require racket/future)

(define (my-factorial x)
  (cond
[(= x 0) 1]
[else (* x (my-factorial (- x 1)))]
))

(define (par-map f l)
  (define fs (for/list ([elem (in-list l)]) (future (lambda () (f elem)
  (map touch fs))

(define lst1 '(12345 12345))
(define lst2 '(12345 12345 12345 12345 12345 12345))
(define lst3 '(12345 12345 12345 12345 12345 12345 12345 12345 12345 12345
12345 12345 12345 12345 12345 12345 12345 12345))
(define lst4 '(12345 12345 12345 12345 12345 12345 12345 12345 12345 12345
12345 12345 12345 12345 12345 12345 12345 12345
 12345 12345 12345 12345 12345 12345 12345 12345 12345
12345 12345 12345 12345 12345 12345 12345 12345
12345))


(define (test)
  (define start-time 0)
  (begin (display "First round - par-map first")(newline)(newline)
 (begin (set! start-time (current-seconds))(par-map my-factorial
lst1)(display "par-map1:  ")(display (- (current-seconds)
start-time))(newline))
 (begin (set! start-time (current-seconds))(map my-factorial
lst1)(display "map1:  ")(display (- (current-seconds)
start-time))(newline)(newline))
 (begin (set! start-time (current-seconds))(par-map my-factorial
lst2)(display "par-map2:  ")(display (- (current-seconds)
start-time))(newline))
 (begin (set! start-time (current-seconds))(map my-factorial
lst2)(display "map2:  ")(display (- (current-seconds)
start-time))(newline)(newline))
 (begin (set! start-time (current-seconds))(par-map my-factorial
lst3)(display "par-map3:  ")(display (- (current-seconds)
start-time))(newline))
 (begin (set! start-time (current-seconds))(map my-factorial
lst3)(display "map3:  ")(display (- (current-seconds)
start-time))(newline)(newline))
 (begin (set! start-time (current-seconds))(par-map my-factorial
lst4)(display "par-map4:  ")(display (- (current-seconds)
start-time))(newline))
 (begin (set! start-time (current-seconds))(map my-factorial
lst4)(display "map4:  ")(display (- (current-seconds)
start-time))(newline)(newline)(newline))
 (display "Second round - map first")(newline)(newline)
 (begin (set! start-time (current-seconds))(map my-factorial
lst1)(display "map1:  ")(display (- (current-seconds)
start-time))(newline))
 (begin (set! start-time (current-seconds))(par-map my-factorial
lst1)(display "par-map1:  ")(display (- (current-seconds)
start-time))(newline)(newline))
 (begin (set! start-time (current-seconds))(map my-factorial
lst2)(display "map2:  ")(display (- (current-seconds)
start-time))(newline))
 (begin (set! start-time (current-seconds))(par-map my-factorial
lst2)(display "par-map2:  ")(display (- (current-seconds)
start-time))(newline)(newline))
 (begin (set! start-time (current-seconds))(map my-factorial
lst3)(display "map3:  ")(display (- (current-seconds)
start-time))(newline))
 (begin (set! start-time (current-seconds))(par-map my-factorial
lst3)(display "par-map3:  ")(display (- (current-seconds)
start-time))(newline)(newline))
 (begin (set! start-time (current-seconds))(map my-factorial
lst4)(display "map4:  ")(display (- (current-seconds)
start-time))(newline))
     (begin (set! start-time (current-seconds))(par-map my-factorial
lst4)(display "par-map4:  ")(display (- (current-seconds)
start-time))(newline))
 ))

(test)
---

> On Mon, Oct 3, 2011 at 2:25 AM, Jukka Tuominen
>  wrote:
>>
>> Sorry for thinking aload again, but I'm learning these issues myself in
>> the background, and I wonder if something like the following might work?
>>
>> Concurrent List Processing -idea
>>
>> Two phase process
>>
>> 1) Distribution phase
>> Create a recursive procedure combining cons and threads so that each
>> item in the original list will be replaced by a named thread. Sending
>> out new threads won't wait for individual threads to return in this
>> phase. The result of this phase is a list of named threads.
>>
>> 2) Collection phase
>> This phase is again a recursive cons process, but this time sequential.
>> It st

Re: [racket] Concurrent execution

2011-10-02 Thread Jukka Tuominen

Sorry for thinking aload again, but I'm learning these issues myself in the 
background, and I wonder if something like the following might work?

Concurrent List Processing -idea

Two phase process

1) Distribution phase
Create a recursive procedure combining cons and threads so that each item in 
the original list will be replaced by a named thread. Sending out new threads 
won't wait for individual threads to return in this phase. The result of this 
phase is a list of named threads.

2) Collection phase
This phase is again a recursive cons process, but this time sequential. It 
starts from the beginning of the named-thread list, and as soon as the first 
thread returns its value, it moves on. The process goes on until the end of the 
list is reached. The resulting list is the return value.

A few extra considerations

- I earlier thought that the plain 'thread' procedure was actually doing things 
truly in parallel and utilising multiple processors as smart as possible where 
available. I still wish it were so, because at least the way I use sequential 
and concurrent processing, could be accomblish from the (naive )user's point of 
view, just by using 'begin' and 'thread'. The way 'thread' could work would be 
transparent to the user, combining and balancing between 'virtual Racket 
multiprocessing' within a single OS thread and multiple OS threads among one or 
more HW processors where available. At the moment, simple 'thread' won't do the 
trick IIUC.

- If the original list to be processed is very long, then the construction of 
the second phase list shouldn't wait for bottle neck items to cons the list 
elsewhere where possible. The speed gain wouldn't be substantial though, since 
it is just building a list, and you cannot finish it until the last item is 
available, anyway.

Does this sound even remotely feasible?

br, jukka


> -Original Message-
> From: users-boun...@racket-lang.org
> [mailto:users-boun...@racket-lang.org]On Behalf Of Robby Findler
> Sent: 01 October 2011 06:02
> To: Ivanyi Peter
> Cc: Racket mailing list
> Subject: Re: [racket] Concurrent execution
> 
> 
> Futures will let you share data, but you'd have to try to avoid
> allocation in the futures (not completely, just mostly) for good
> performance (so you'd probably want to build vectors to save the
> results into). For places, you cannot share the database, you'd have
> to send if over a place channel to be able to use it in multiple cores
> at once.
> 
> It is hard to say which is going to be better for your task; probably
> futures will be easier to try, so you might start there. They are more
> limited, tho, so you might end up switching to places.
> 
> Have you read the section on performance in the Guide? That provides
> an overview that you might find helpful.
> 
> Robby
> 
> 2011/9/30 Ivanyi Peter :
> > Hi All,
> >
> > I would like to ask for some advice.
> > I have a problem in which I have several lists containing some 
> data. These
> > lists are created by one
> > "process" and this part should be sequential. Then these lists should be
> > checked against some
> > large "database", list or hash table, and as a result some new 
> lists must be
> > built, which at the end must
> > be merged. I would like to do this later processing 
> concurrently on several
> > cores.
> > I am a little unsure which method to use: futures, places, threads,
> > processes???
> > (I am kind of familiar with parallel programming in C and MPI, 
> but not this
> > fine grained level.)
> >
> > I am not sure a couple of things here:
> > - how to "distribute" the several lists to the "processes" ? (I 
> do not want
> > to use files for this) Is it possible?
> > - how to merge the resulting lists at the end? Is it possible?
> > - how to share, if it is possible at all, the common "database", list or
> > hash table? If this is not really
> > possible, it is not a problem I can "load" it in on each "process". (At
> > least I hope.)
> >
> > Any suggestions?
> >
> > Thanks in advance,
> >
> > Peter Ivanyi
> > _
> >  For list-related administrative tasks:
> >  http://lists.racket-lang.org/listinfo/users
> >
> 
> _
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/users
> 


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Poll: Does anybody besides Doug use 'plot'?

2011-10-02 Thread jukka . tuominen

I wasn't going to press the send button, but now that Neil brought it
up... (read: Neil's fault!)

...


> First, I apologize. I play "catch up" on the weekends with this list, and
> sometimes find myself responding to threads that have long ago gone far
> afield...
>
> Second, sarcasm is used far to little in this field.
>
> Instead of "plot/compat", call it "plot/old". When "plot3000" comes along,
> then the geezers like me still using the old old plot should have to ask
> for
> "plot/old/really-dude?", and at some point,
> "plot/old/really-dude?/you-have-been-warned".
> _
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/users


>>
>> On Oct 2, 2011, at 12:07 AM, Neil Toronto wrote:
>>
>>
>>
>>> A tad more seriously, if we had a death date for the old one, I could
>>> put it in the library name. You'd have to put
>>>
>>> (require plot/supported-until-2013-01-01)
>>>
>> I really like this one a lot. -- Matthias
>>

This works nicely up-hill as well (atleast in folder naming). Say...

new, new2...new13, latest, latest2... and then find these after decades.

Or, if you're really clever, you could keep renaming the module like...

module/no-changes-here.update-all-your-code-to-reflect-this-none-change
module/still-no-changes

Another note-worthy detail: I think the functions (libraries) should be
left as if the development was never ended. This leaves the door open to
actually have somebody publishing an update later on; either by the same
or a different author, no matter how weird it may feel at the time. Those
using the function simply benefit from that, without needing to make yet
another change in the 'require'.

plot/back-in-business

But as Grant pointed out, these are (presumed) best practices for
repository type of functions/libraries. In Liitin, however, functions are
always this type and they are treated individually rather than as
libraries.

br, jukka


>
>
> So long as nobody thinks that this is necessarily a best practice
> for breaking API in the future, IMHO.
>
> In the case of "plot", the API breaks at the time users have to change
> their "require" form to include this expiration date (and then the API
> may break a *second* time, on or after that date).
>
> I'd see this as not a best practice, but a one-time deal: for the
> special case of the "plot" library that few people use, and which
> library we really want to get rid of because of the C code, combined
> with a desire to steal the old API's "(require plot)" for the new API.
>
> In the future, we all will have had the benefit of the "plot"
> experience, which teaches us that API breakage will cause a huge amount
> of discussion, which costs the developers time/energy/morale before we
> even get to what API breakage costs users.  So we will consider breaking
> API only when the win is so big that we are willing to endure
> discussion.  I love that discussion can be used not only for
> collaborative design and problem-solving, but also as itself a painful
> stick to discourage misbehavior.
>
> By all means, just move forward on getting the new "plot" goodness to
> the users, however the API migration is done.  Learning experience has
> been achieved.
>
> --
> http://www.neilvandyke.org/
> _
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/users
>


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Poll: Does anybody besides Doug use 'plot'?

2011-10-01 Thread jukka . tuominen

Hi,

sorry for adding more noice. My message concerns the "meta" side of the
discussion, i.e. whether to preserve functional compatibility or the
original name. This is a central issue in Liitin (
http://liitin.finndesign.fi ), so I've given a lot of thought about it,
but this topic/noise served as an excellent opportunity to study this
aspect even deeper. Thanks everyone contributing!

The thinking process was extremely fruitful, so I thought I'd better
document it somehow, and maybe sharing it could benefit others as well,
regardless whether agreeing or disagreeing with it. These thoughts are
mainly common-sense reasoning and usability related, and Liitin centered
in places.
( http://en.wikipedia.org/wiki/Law_of_the_instrument :)
I'm likely to be wrong in many places so please correct me. Thoughts so far:


I've often found it very useful method to exaggerate things when trying to
extract the essence out of too vague or too close situations. In this
subject, rather than
thinking about a few people needing to update near-history programs, think
about a million people needing to update a hundred years old programs. The
referred code,
again has been changed 1000 times during the hundred years.

Which approach feels more comfortable and enduring; keeping the old name,
but changing it whenever some other approach feels better, or stick to
strict
compatibility and occasionally create renamed variants, if it would break
compatibility otherwise (e.g. change the order of arguments, add remove
arguments,
change the format of arguments...)?

Both are inconveniences, but in a different ways. However, adding new
variants and finding them seems to stay as an inconvenience, whereas
braking the compatibility
soon escallate problems until unmanageable.

Side note:
Any improvements (such as little tweaks, optimisation, bug fixes, total
rewrite) no matter how small or grand, fall into category 'update' as long
as there are no
changes in the interface that would break the compatibility.

Of course, these are just recommendations which anybody could either
follow or not. The good thing with Liitin, however, is that even in cases
that the recommendations
are not followed (the interface changes under a single name), you can
easily deal with it by simply ignoring dynamic changes ('latest') and use
timestamped versions
instead.
E.g. (function-x arg1 arg2 arg3) > (function-x arg3 arg1 arg5)
>> (function-x:timestamp-a arg1 arg2 arg3) (function-x:timestamp-b arg3
arg1 arg5).

Eventhough still inconvenience, it is way smaller than needing to change
your or somebody else's code(s). And on the next abstration level it
doesn't really matter;
it's already hidden.

Or, you could use your own namespace to give new names to objects, yet
referring to other's code, either timestamped or allowing dynamic, future
updates from the
original author.

Keeping the name as well as the interface as intuitive and practical as
possible is very important, so I'd rather see evolutionary variants as
needed, rather than
strictly stick to the originals (say, car & cdr). Eventually, best
practices will settle down. None ot the code versions (within the same
name) or variants (similar
functions under different names) are ever lost in Liitin, but there's a
need for especially good search mechanisms.

Experimentation should by no means be limited by these measures, on the
contrary. Codes and names should evolve, but being ably to safely harness
both wider and
time-wise deeper range of others' work, will allow much greater level of
abstraction to experiment with.

To apply this to case 'Plot':
If the compatibility cannot be preserved, pick a new name for the new
variant (intuitive for a new-comer rather than resembling the old one),
and be especially careful not to break compatibility with the existing
code base (retrospectively). And of course, inform about the existence of
the new variant.

Now it is easy to see the pointers in the discussions, but in the
beginning it was quite blurry. To me, at least.


br, jukka


 |  J U K K A   T U O M I N E N
 |  m a n a g i n g   d i r e c t o r  M. A.
 |
 |  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
 | mobile +358 50 5666290  jukka.tuomi...@finndesign.fi
 | www.finndesign.fi





_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


[racket] FW: Seamless Prolog integration

2011-09-20 Thread Jukka Tuominen
(Sorry, meant to reply to the list, also)


Thanks, great information and sounds overall feasible, too.

>
> -Original Message-
> From: w...@dualtech.com.pl [mailto:w...@dualtech.com.pl]On Behalf Of
Wojciech
> Kaczmarek
> Sent: 19 September 2011 18:06
> To: Jukka Tuominen
> Subject: Re: [racket] Seamless Prolog integration
>
>
> Hi.
>
>
> I can shed some light on this from my little experience with Racklog and
a
> bit broader with using/integrating various Prologs.

Excellent :) I could hardly scratch the surface by myself.

>
>
> On Mon, Sep 19, 2011 at 13:22, Jukka Tuominen
> 
> wrote:
>
>
>   Hi,
>
>   inspired by the Datalog discussion, I'd like to understand better what
> kind
>   of challenges I could expect when trying to create a proof-of-concept
> about
>   integrating prolog-type-of functionality to Liitin. This would also
> serve
> as
>   an example/ stepping stone for others to create something more useful.
> Since
>   Prolog is a bit out of this world, I would propably ask wrong
questions,
> so
>   I hope the following will give enough information to understand the
objectives.
>
>   1) Prolog (type-of) functions should be used as hidden subroutines and
> you
>   could call them as racket functions (~ #lang racket notation)
>
>
>
> Once you load your querying predicates & facts, you can wrap typical
queries
> in regular Racket functions.

Great. So, predicates are like racket expressions? ...

>
>   2) No particular prolog engine should be running and waiting for
prolog-specific interactions. If such engine is needed (beyond plain
functions), it should be initiated and terminated automatically to
meet
> 1)
>
>
>
> The initialization you need is just loading your predicates. Also see
answer
> for q. 4.
>
>
>
>   3) The knowledge need to be stored as static/persistent objects
(Liitin
>   objects). Again, rather than keeping them in memory, you could call
them
> as
>   needed.
>
>
>
> This is common and very practical requirement, but well, most Prologs
provide reasoning engine but don't include storage engine, so you're on
your
> own. Datalog & Racklog seem to be in this category as well. There are
couple
> of solutions here. The most obvious idea for Racklog is that you don't
put
> your concrete data in facts, but you code your predicates so they pull your
> data from SQL, serialized Racket structures or whatever. The other solution
> is that you initially convert your data from external format into calls
of
> %assert! which build up your Racklog database. You can do the latter for
Datalog as well.

... and facts are like input you give to the expression, right?
Such as (predicate facts) ?

If this is the case, then Liitin should suit perfectly to store both. For
example expression ns:sqr could be saved into db as:
(lambda (x)
 (* x x))

and ns:data could be saved as:
5

so (ns:sqr ns:data) evaluates to 25. All db operations are handled
transparently (thanks to Eli's help).

Could you, by any chance, give me some simplest examples of the predicate
and fact definitions so I could understand the basic format of each and
even try to test them in practice?

I've looked at Jay's Datalog documentation and eventhough it seems within 
reach, I can't quite capture the possible adaptation to Liitin. Now, having 
looked at the Racklog, it appears more Racket- and Scheme-like, which seems 
more suitable for the 'top-level Scheme' objective. That is, being able to call 
(and share) data and functions in common Scheme, eventhough underlaying 
implementions may vary. Hmm, should I call it Common Scheme :)


>
>
>   4) It should be possible to have several, independent knowledge bases
> saved
>   in the same (Liitin) database.
>
>
> I can't speak for the Racklog & Datalog authors, but AFAIK there's no
such
> separation of knowledge bases. You should just make sure that your
predicates don't refere to each other.

There should be no problem, then. And even better; if you do want to mix
them, that sounds easy, too.

>
>
>
>
> There's also completely different possibility: having someone with
Prolog
> skills you could build querying service on the top of a standalone
Prolog
> implementation. Free SWI-Prolog has production-quality embedded web server.
> I used it once to host a service answering specific queries via
JSON-like
> interface from a Python application. Still you have a task as in q. 3:
how
> to feed the stored data into Prolog. We used SWI's ODBC library to
dynamically get what we needed from existing data warehouse; it was fine
enough.
>
>
> Of course it is multiplying the technologies, but well, sometimes the power
> of Prolo

[racket] Seamless Prolog integration

2011-09-19 Thread Jukka Tuominen

Hi,

inspired by the Datalog discussion, I'd like to understand better what kind
of challenges I could expect when trying to create a proof-of-concept about
integrating prolog-type-of functionality to Liitin. This would also serve as
an example/ stepping stone for others to create something more useful. Since
Prolog is a bit out of this world, I would propably ask wrong questions, so
I hope the following will give enough information to understand the
objectives.

1) Prolog (type-of) functions should be used as hidden subroutines and you
could call them as racket functions (~ #lang racket notation)

2) No particular prolog engine should be running and waiting for
prolog-specific interactions. If such engine is needed (beyond plain
functions), it should be initiated and terminated automatically to meet 1)

3) The knowledge need to be stored as static/persistent objects (Liitin
objects). Again, rather than keeping them in memory, you could call them as
needed.

4) It should be possible to have several, independent knowledge bases saved
in the same (Liitin) database.

You could end-up having functions like:
 (namespace:relationship ns:person-a ns:person-b)
 (ns:can-fly? ns:a-cat)
 (ns:capital-city ns:australia)

ns: prefix refers to Liitin objects rather than local definitions.

I'd appreciate any feedback on A) if each issue is feasible, and 2)
directions on how to achieve this. Feel free to refer to any prolog
extension (or plain racket).


br, jukka



|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Code compiled for version ~a, not ~a

2011-09-17 Thread Jukka Tuominen
I think I have had similar errors, but these were outside drracket. I can't 
recall exactly, but I think they were either commandline raco compilations or 
commanline gracket executions. I had to remove all compiled directoried 
manually an rerun the command to bypass the situation. That I recall clearly :)

So, either automatic recompilation, being able to force recompilaton, or 
interactive question which way to go, would have been nicer. The last option 
shouldn't be the only one, since human presence cannot be guaranteed.

br, jukka
  -Original Message-
  From: users-boun...@racket-lang.org [mailto:users-boun...@racket-lang.org]On 
Behalf Of Robby Findler
  Sent: 18 September 2011 04:40
  To: Guillaume Marceau
  Cc: users@racket-lang.org
  Subject: Re: [racket] Code compiled for version ~a, not ~a


  There could definitely be a bug where something is not comparing paths 
properly somehow. If you can give me more help to reproduce the bug that would 
be a big help. 

  To start I think just sending me the logging tool directory (and saying where 
it was (collects, link?)) would probably help me make progress with the 
specific thing below. 

  Robby

  On Saturday, September 17, 2011, Guillaume Marceau  wrote:
  >> Are these files in the collects tree or elsewhere?
  >
  > I have separate collects trees for each version.
  >
  > Occasionally, I do get the error in the collect tree for my git repo.
  >
  > Earlier today I did,
  >
  >  git pull
  >  
  >  ./raco setup -D
  >  ./DrRacket
  >
  > and received the version error for
  > collects/planet/private/compiled/resolver.zo, which suggests there
  > might be a bug in raco.
  >
  >
  >> drracket should be taking care of this for you (unless you turn off the
  >> automatic compilation option).
  >
  > Sounds like the behavior I see is a bug then.
  >
  > Could it be the code that checks whether a directory is a subdirectory
  > of another breaks under Windows?
  >
  > There is a different bug under Window I meant to report that might be
  > related. If I set PLTCOLLECTS with forward slashes, a directory
  > inclusion test somewhere returns #f instead of #t and I get the error:
  >
  >$ echo $PLTCOLLECTS
  >c:\documents\collects;
  >$ export PLTCOLLECTS='c:/documents/collects;'
  >$ /c/Program\ Files/Racket-5.1.3/raco setup -l logging-tool
  >omitted-paths: given directory path is not in any collection root:
  > #
  >
  > If I use backslashes, the error goes away. DrRacket is not affected.
  > It boots correctly with either forward or backslashes.
  > _
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

[racket] returning values in #lang racket/load

2011-09-13 Thread Jukka Tuominen

Hi,

I wonder if there's a way to return values in #lang racket/load other than
specifically printing them out?

I noticed that side effects (like print, display, GUI) work as usual, but
there's no actual return value.

e.g. (in definitions pane)

(+ 1 2 3) >> _

(display (+ 1 2 3)) >> 6 (purple rather than blue)


br, jukka



|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Locating substring with reserved characters

2011-09-03 Thread Jukka Tuominen

That's it, thanks!

#lang racket

(regexp-match-positions* (regexp-quote "5 (+ 1 2 3)") "((named-lambda (plus
x y) (+ x y)) 5 (+ 1 2 3))")
;>> '((35 . 46))


br, jukka


> -Original Message-
> From: Neil Van Dyke [mailto:n...@neilvandyke.org]
> Sent: 03 September 2011 11:03
> To: Jukka Tuominen
> Cc: users@racket-lang.org
> Subject: Re: [racket] Locating substring with reserved characters
>
>
> Jukka Tuominen wrote at 09/03/2011 03:56 AM:
> > I'm trying to locate a substring that I want to be treated just
> as a string
> > rather than regexpr notation.
>
> I think you want "regexp-quote".
>
> (regexp (regexp-quote "5 (+ 1 2 3)"))
> ;;==> #rx"5 \\(\\+ 1 2 3\\)"
>
> --
> http://www.neilvandyke.org/

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


[racket] Locating substring with reserved characters

2011-09-03 Thread Jukka Tuominen

Hi all,

I'm trying to locate a substring that I want to be treated just as a string
rather than regexpr notation. The used strings are dynamic and there's no
control over their content. This is propably something simple, but I can't
seem to get it right.

Any ideas?


#lang racket

(regexp-match-positions* (pregexp "5 (+ 1 2 3)") "((named-lambda (plus x y)
(+ x y)) 5 (+ 1 2 3))")
;>> error: regexp: `+' follows nothing in pattern


br, jukka

|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] doubly linked list lib

2011-09-02 Thread Jukka Tuominen
Exactly. The fastest way is to

1) Add a link to the 'announcements' section like this [[name]](before
adding the actual article)
2) click on the newly created link, and paste your code there with 
code here tags

br, jukka

  -Original Message-
  From: Laurent [mailto:laurent.ors...@gmail.com]
  Sent: 02 September 2011 13:25
  To: Marijn; Jukka Tuominen
  Cc: Vincent St-Amour; users@racket-lang.org
  Subject: Re: [racket] doubly linked list lib


  On Fri, Sep 2, 2011 at 12:16, Marijn  wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Vincent,


On 08/31/11 17:50, Vincent St-Amour wrote:
> Are you planning to put this on PLaneT?
>
> Vincent


I wasn't. This code has seen very little testing and has so far only
been used in toy/throw-away code. The Gambit community has a
no-expectation-of-quality place to dump code, appropriately called the
Dumping Grounds[1]. If this was the gambit mailing list I would have
said "sure I'll dump it", but I don't think I am ready to inflict it
on Planet. Maybe my expectations of code on Planet is off, or maybe
racket also needs a Dumping Grounds...


  I think this is what Jukka is has in mind:
  http://www.mail-archive.com/users@racket-lang.org/msg07569.html

  Laurent


Marijn

[1]:http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Dumping_Ground
s


> At Wed, 31 Aug 2011 11:46:34 +0200, Marijn wrote:
>>
>> [1  ] [1.1  ]
>> [1.1.1  ] Hi Laurent,
>>
>> On 08/30/11 09:18, Laurent wrote:
>>> Thank you very much for this nice intermediate solution, though
>>> I need constant-time append, split, insert, remove, + pointers
>>> to items, etc. Mutation does seem unavoidable, right.
>>
>> I implemented a doubly-linked list, not so long ago, connected to
>> a GUI that can insert and delete items and saw no way to make the
>> list functional with multiple simultaneous editors in the GUI.
>> The implementation is as a straightforward cyclical doubly-linked
>> list. I toyed with the idea of having a separate handle object to
>> represent the list versus just the nodes, and there are some
>> rudiments of that left in the code, but in the end the user code
>> uses a special 'top element to indicate where the cyclical list
>> is supposed to start.
>>
>> Good luck,
>>
>> Marijn

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5grQsACgkQp/VmCx0OL2yB7ACfVmnT7S7y0pvTvUa7mtkRg8EN
GRwAn0DHnPxrnT/+we0gIuvufQRMv3SF
=fD70
-END PGP SIGNATURE-

_
 For list-related administrative tasks:
 http://lists.racket-lang.org/listinfo/users


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Re: [racket] Neophyte Alert

2011-08-31 Thread Jukka Tuominen

>
> A few minutes ago, Neil Van Dyke wrote:
> > Josh Tilles wrote at 08/31/2011 01:03 PM:
> > > -- Is there any sort of general practice or prevailing taste in when
> > > to use (for example) *null* vs *empty* vs *(list)*? What about *(let
> > > ([...]))* vs *(local (define ...))*?
> >
> > I think most people do "'()" when they want a literal null list.
> > Don't use "(list)", since that's a procedure call.
>
> Two quick notes: (list) would be optimized the same, I think; and at
> least in the Racket sources I think that `null' is the more popular
> choice.  (With `empty' winning in the more HtDP-oriented side.)
>

#lang racket a.k.a. default language seems to be clear on this one when
evaluated

(list) >>  '()  didn't know this one myself
empty  >>  '()
null   >>  '()
'()>>  '()

Then what is the 'correct' predicate to go with?

empty?
null?

anything else?


br, jukka






_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Mediawiki dedicated to Liitin/Racket/Scheme code + more

2011-08-27 Thread Jukka Tuominen

I believe I've visited it a few times in the past. Very nice, and has many
things i'd like to achieve, some characteristics that I'm trying avoid, but
most of all a bit different in profile. I'm hoping to bring something new
and complementory, not just another copy.

Being accessible to all and having a zero-threshold to contribute are key
characteristics, but the ultimate goal is to help people do something that
they otherwise couldn't. Being able to skip parts that you are not familiar
with and be able to contribute in your own strongest field could create some
useful and cool things. For me, Scheme has been a great enabler. I can
concentrate on the things that I'd like to do. There has always been a way
to do it in Scheme once I know what I want, even with my limited skills. For
example, while doing my personal AI project, I spend most of my time reading
and watching lectures of evolution biology, neurology, cognitive science,
etc. Not just learning Scheme.

I'd love to see what happends if things were even more approachable. The
'For inspiration' section is meant to encourage people to get started, and
keep going (I always get boost from videos like that), and the wiki is to
trying to offer good starting points.

br, jukka



> -Original Message-
> From: Daniel Silva [mailto:dan...@danielsilva.org]
> Sent: 27 August 2011 07:02
> To: Jukka Tuominen
> Cc: users@racket-lang.org
> Subject: Re: [racket] Mediawiki dedicated to Liitin/Racket/Scheme code +
> more
>
>
> Have you looked at http://schemecookbook.org/ ?
>
> On Thu, Aug 25, 2011 at 6:34 PM, Jukka Tuominen
>  wrote:
> >
> > Hi all,
> >
> > I have just founded a new mediawiki page as an attempt to offer a
> > light-weight forum to share free (LGPL) Liitin/Racket/Scheme
> content. You
> > can contribute anonymously and no Liitin account is required.
> >
> > It doesn't matter if a new topic starts messy or incomplete.
> The threshold
> > to place something on this wiki should be extremely low. If you find
> > something even remotely useful or interesting even for your own purpose,
> > just go ahead and submit it - it is likely to be useful to many
> others, too.
> > If in doubt, submit it. If the work is old and propably not
> compatible with
> > the current Racket, or even made in some other dialect, or the
> > code/documentation is left unfinished, it could still offer a useful
> > starting point for others.
> >
> > There can even be more generic subjects of interest like sound, GUI,
> > robotics, AI etc. with useful information and pointers added gradually.
> >
> > Sure, there are other places to find snippets, but somehow they
> always seem
> > somehow remote or you feel a bit 'reserved' whether your stuff
> is 'worthy'
> > of 'publishing' to them. Also, this is not intended to compete with more
> > established forums like PLaneT, RFI and such. If anything, this could
> > precede them as a messy, zero-threshold test bench.
> >
> > Since the shape for this kind of forum is largely open, feel
> free to suggest
> > even structural changes (or just make them where feasible).
> >
> > Please, visit http://liitin.finndesign.fi/site/index.php/wiki and make
> > yourself at home!
> >
> >
> > br, jukka
> >
> >
> >
> > |  J U K K A   T U O M I N E N
> > |  m a n a g i n g   d i r e c t o r  M. A.
> > |
> > |  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
> > |  mobile +358 50 5666290
> > |  jukka.tuomi...@finndesign.fi  www.finndesign.fi
> >
> >
> > _
> >  For list-related administrative tasks:
> >  http://lists.racket-lang.org/listinfo/users
> >

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


[racket] Mediawiki dedicated to Liitin/Racket/Scheme code + more

2011-08-25 Thread Jukka Tuominen

Hi all,

I have just founded a new mediawiki page as an attempt to offer a
light-weight forum to share free (LGPL) Liitin/Racket/Scheme content. You
can contribute anonymously and no Liitin account is required.

It doesn't matter if a new topic starts messy or incomplete. The threshold
to place something on this wiki should be extremely low. If you find
something even remotely useful or interesting even for your own purpose,
just go ahead and submit it - it is likely to be useful to many others, too.
If in doubt, submit it. If the work is old and propably not compatible with
the current Racket, or even made in some other dialect, or the
code/documentation is left unfinished, it could still offer a useful
starting point for others.

There can even be more generic subjects of interest like sound, GUI,
robotics, AI etc. with useful information and pointers added gradually.

Sure, there are other places to find snippets, but somehow they always seem
somehow remote or you feel a bit 'reserved' whether your stuff is 'worthy'
of 'publishing' to them. Also, this is not intended to compete with more
established forums like PLaneT, RFI and such. If anything, this could
precede them as a messy, zero-threshold test bench.

Since the shape for this kind of forum is largely open, feel free to suggest
even structural changes (or just make them where feasible).

Please, visit http://liitin.finndesign.fi/site/index.php/wiki and make
yourself at home!


br, jukka



|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Additional GUI components?

2011-08-19 Thread Jukka Tuominen
Moro Tomppa,

I second the desire for more GUI components. I hacked earlier a DIY version
of the accordian panel, but I'd rather use a single container rather than
construct it from many components.

The GUI behaviour seems to work through Ext Liitin connection, unlike the
functions that call some Liitin-specific primitives. To try it, run the
following command:
(liitin:script-manager)

or to display the source code, run the following:
(display (l-get 'liitin:script-manager)); display for restoring the original
indentation

I'd even like to see some GUI building tool integrated to DrRacket some day,
MrEd Designer for example :)

br, jukka
  -Original Message-
  From: users-boun...@racket-lang.org
[mailto:users-boun...@racket-lang.org]On Behalf Of Tomi Neste
  Sent: 19 August 2011 13:09
  To: users@racket-lang.org
  Subject: [racket] Additional GUI components?


  I was wondering if there are currently any plans in adding more components
to the GUI toolbox? Things like tree views, property lists, accordion
panels, resizable panels (DrRacket seems to have this in its editor/repl
panel but I don't think it's documented or available?).


  I can probably do a semi-functional implementation of those myself but if
there are already plans about adding those in the toolkit in the near future
I'd rather spare the effort.



  --
  tomppa


liitin-lib.rkt
Description: Binary data


liitin.rkt
Description: Binary data
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Re: [racket] About modes (was: match in Advanced Student?)

2011-08-19 Thread Jukka Tuominen
"
1. Is the mode determinable before the user takes action?
2. Is it hard for the user to ignore feedback about the mode?
3. Does the user actively maintain the mode?
"

What bothers me in this example, is that the need for modes in the first
place is bypassed and the emphasis is on how to make it tolerable or how to
make the best out of it. I have no idea what were these modes. But if you
think for example a "landing mode" that you only need for a short period
during flights. You could reserve a physical area for meters and functions
dedicated for that 'phase' or in GUI terms, have a menu category dedicated
for it. If you need consulting over the phone, you cannot miss it.

Sometimes we have encountered situation where the GUI can be modified
excessively, considered as a good feature towards clients. Think about the
same flight situation but so that each airline company have their knobs and
meters customised for positions, alarm colours and even error messages.
Because of some company legacy reason or just because it feels better. Try
to help them over the phone; "Is the button on the left blinking purple?"

br, jukka
  -Original Message-
  From: Rodolfo Carvalho [mailto:rhcarva...@gmail.com]
  Sent: 19 August 2011 06:15
  To: Jukka Tuominen
  Cc: users@racket-lang.org
  Subject: Re: [racket] About modes (was: match in Advanced Student?)


  Hello Jukka,


  I don't know to which extend my contribution is useful to the list, but I
remembered about a post from Aza Raskin about modes:


  http://humanized.com/weblog/2006/12/07/is_visual_feedback_enough_why_modes
_kill/


  There might also be writings from Donald Norman on this subject.




  Still, I don't feel Racket's student languages (*SL) suffer from modes (as
the examples described in the post above).


  []'s

  Rodolfo Carvalho



  On Thu, Aug 18, 2011 at 22:11, Jukka Tuominen
 wrote:


Hi,

About language/UI modes. Since my contribution to CS is thin due to lack
of
CS education, I hope I can contribute in usability instead, with some
more
background.

I see you use heavily different language modes for teaching in different
phases. Usability-wise it's usually worth being careful with modes since
they may be tricky for the users. I couldn't find much detailed
information
from Wikipedia other than "Heavy use of modes often reduces the
usability of
a user interface, as the user must expend effort to remember current
mode
states, and switch between mode states as necessary." at
http://en.wikipedia.org/wiki/User_interface#Modalities_and_modes
Propably deleted for not being a noticeable issue.

So, instead here are some rules of thumb out of my head that I have
found
useful. I appreciate that these are the best practices for building an
application rather than lession structures which I know very little
about,
but I hope you still find them useful.

Modes are reasonable for example in cases where there are different
types of
users, (say, basic user, administrator, developer..) where for example
users
never get to use certain functionality, i.e. it's a question of access
rights rather than level of experience. So in user mode, you could hide
these functions but leave the basic UI otherwise similar if there isn't
a
strong reason not to. Sometimes the same people may need to switch
between
modes or if possible have the range of functionality for the roles one
has
rights to. It's not a good idea forcing to learn many different ways to
do
the same thing. Especially difficult are the cases when the change is
very
subtle, so that seemingly things are the same but not quite.

Modes are often used for levels of advancement, too, which I find often
problematic. For example, you can sometimes see menu items, other times
not.
Sometimes the functionality is there, another times it isn't.

I've found another approach more practical. Take a drawing tool for
example.
To begin with, you have a visual toolbox for the most often used
functionality. You can start learning quite easily and manage to do
basic
things. Excessive, visual complexity is hidden (unlike MS Word
toolbars).
Once you master that level, you can find more advanced functionality
from
menus. You don't need to know things by heart, they are all listed
logically. If a menu item is sometimes unavailable, it is left in place
but
disabled, so you can still see its existence and on the other hand,
navigation is easier when items have fixed places (position memory).
After a
while you notice yourself doing certain things repeatedly, so you check
either the toolbox tooltips or menu tooltips for visual hints about
keyboard
shortcuts (or add a button on the toolbar). On top of that you may learn
new
tricks from the online help, colle

Re: [racket] About modes

2011-08-19 Thread Jukka Tuominen
I think what is rather exceptional in student language mode thinking, is
that you are trying/ being able to create a  kind of
laboratory environment where each learning step can be controlled. Hard to
say whether it is a good idea or not per se, but the problems seem to raise
when you try to step off the lane. It is a unique situation to be able to do
that.

If new features are introduced as you move further (gaining new skills in
games :) but never go back, then it should be mostly OK, except that it may
make the of-the-lane learning more challanging. I could think of two
situations like that
 - Wanting to create a new lane of learning for a special purpose or
experimenting whether some other order might be more optimal
 - Learning through colleages outside the lane ("ok, you don't have that
feature available, yet... What I usually do in these situations...")

The drawing tool was just an example, and programming languages propably
need a slightly different approach in some areas. Where is has proven
usefull in our experience are GUI building tools, for example. Placing all
the commands in the menus is likely to be a bad idea (and even dynamically
expanding according to new definitions).

Since you are using this kind of methods, it is likely that the pros are
higher than cons. I'm not even suggesting any radical changes, I'm just glad
that it's all conscious decisions.

br, jukka
  -Original Message-
  From: Stephen Bloch [mailto:sbl...@adelphi.edu]
  Sent: 19 August 2011 04:32
  To: Jukka Tuominen
  Cc: users@racket-lang.org
  Subject: Re: [racket] About modes




  On Aug 18, 2011, at 9:11 PM, Jukka Tuominen wrote:


I see you use heavily different language modes for teaching in different
phases. Usability-wise it's usually worth being careful with modes since
they may be tricky for the users. I couldn't find much detailed
information
from Wikipedia other than "Heavy use of modes often reduces the
usability of
a user interface, as the user must expend effort to remember current
mode
states, and switch between mode states as necessary."


  Yes, there are a lot of usability problems with modes.  I would argue that
the series of student languages in DrRacket avoids most of these problems
because
  (a) nobody is expected to switch "modes" often -- my students won't switch
out of Beginning Student for a month or two, and
  (b) each "mode" is a SUBSET of the next one, so anything you learned how
to do in the first week of the class will still work in the last week of the
class.


  The only things you lose by going to a more advanced language are training
wheels: if you learned to depend on DrRacket catching a particular mistake
of yours, it may no longer do that in a subsequent, more permissive
language.


Modes are often used for levels of advancement, too, which I find often
problematic. For example, you can sometimes see menu items, other times
not.
Sometimes the functionality is there, another times it isn't.


  Is this really a problem when the "advancement" is one-directional --
almost nobody ever switches back to an earlier mode?


I've found another approach more practical. Take a drawing tool for
example.
To begin with, you have a visual toolbox for the most often used
functionality. You can start learning quite easily and manage to do
basic
things. Excessive, visual complexity is hidden (unlike MS Word
toolbars).
Once you master that level, you can find more advanced functionality
from
menus


  Toolbox and menu user interfaces are great when there's a small number of
possible operations -- small enough to fit into a menu, or at most a
two-level menu, which gives you an effective limit of about a hundred.  Most
programming languages have FAR more possible operations than this, so it's
not clear how this UI guideline can be applied to programming.  The BYOB and
Alice people have tried, by restricting the language to a few dozen
operations so they can drag-n-drop them; this gives those languages high
points for "discoverability" and "not overloading human memory", but low
points for extensibility and scalability.





  Stephen Bloch
  sbl...@adelphi.edu





_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

[racket] About modes (was: match in Advanced Student?)

2011-08-18 Thread Jukka Tuominen

Hi,

About language/UI modes. Since my contribution to CS is thin due to lack of
CS education, I hope I can contribute in usability instead, with some more
background.

I see you use heavily different language modes for teaching in different
phases. Usability-wise it's usually worth being careful with modes since
they may be tricky for the users. I couldn't find much detailed information
from Wikipedia other than "Heavy use of modes often reduces the usability of
a user interface, as the user must expend effort to remember current mode
states, and switch between mode states as necessary." at
http://en.wikipedia.org/wiki/User_interface#Modalities_and_modes
Propably deleted for not being a noticeable issue.

So, instead here are some rules of thumb out of my head that I have found
useful. I appreciate that these are the best practices for building an
application rather than lession structures which I know very little about,
but I hope you still find them useful.

Modes are reasonable for example in cases where there are different types of
users, (say, basic user, administrator, developer..) where for example users
never get to use certain functionality, i.e. it's a question of access
rights rather than level of experience. So in user mode, you could hide
these functions but leave the basic UI otherwise similar if there isn't a
strong reason not to. Sometimes the same people may need to switch between
modes or if possible have the range of functionality for the roles one has
rights to. It's not a good idea forcing to learn many different ways to do
the same thing. Especially difficult are the cases when the change is very
subtle, so that seemingly things are the same but not quite.

Modes are often used for levels of advancement, too, which I find often
problematic. For example, you can sometimes see menu items, other times not.
Sometimes the functionality is there, another times it isn't.

I've found another approach more practical. Take a drawing tool for example.
To begin with, you have a visual toolbox for the most often used
functionality. You can start learning quite easily and manage to do basic
things. Excessive, visual complexity is hidden (unlike MS Word toolbars).
Once you master that level, you can find more advanced functionality from
menus. You don't need to know things by heart, they are all listed
logically. If a menu item is sometimes unavailable, it is left in place but
disabled, so you can still see its existence and on the other hand,
navigation is easier when items have fixed places (position memory). After a
while you notice yourself doing certain things repeatedly, so you check
either the toolbox tooltips or menu tooltips for visual hints about keyboard
shortcuts (or add a button on the toolbar). On top of that you may learn new
tricks from the online help, colleages, Internet etc.

What is important in the latter case, is that the full functionality is
there all the time, unchanged. In this way, all learned is valid ever after,
and there is never need for unlearling things. It also gives flexibility to
learn things in a different order, if necessary. Additionally, it is a
question of personal preference who wants to use mouse instead of shortcuts
and in what situations. I've seen some high level professionals using mouse
only where possible.


br, jukka


|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] pretty-big->#lang (was: External connectiontoFinndesign Liitin)

2011-08-11 Thread Jukka Tuominen

Hi Matthew,

thank you for taking the time to explain it in such detail. I believe I'm 
atleast closer to grasp the consepts of module and eval now. I've already 
understood earlier that the top level namespace is a potential place for 
collisions, and I can see it better now why it is so. I will still find the 
practice a challange, I'm afraid. 

I'd like to bring in two sides to this learning story.

One is my personal and humble journey to learn new concepts in Racket and 
improve my skills to create fancier programs. In this case, I'll keep on 
reading and experimenting, usually tweak examples to better understand the 
moving parts, until some day I understand enough to create things from scratch. 
As many others have pointed out, I also find the examples very important.

Another side is my professional, usability perspective to these kind of issues. 
It goes very differently. It is a very bad thing for a usability expert to 
'learn over' difficult parts, or start to tolerate strange or difficult 
characteristics.

Normally the way around is not to change the architecture, which usually is - 
as in this case very convincingly and passionately - good if not genious and 
the hard-core developers can understand and use it well. The problem usually is 
how to explain it to basic users without such a steep learning curve, often 
steep enough to make people give up or find a competitive system instead. We 
(Finndesign) try to solve these kind of issues through better user interfaces 
often involving graphical interfaces, which tend to bring it accessible and 
atractive to even much broader audience. So, I would try to make the concepts 
and individual functions more usable, or in some cases create illustrative 
tools to understand and use them. Sometimes these tools may be temporary, or 
sometimes they become daily tools.

In the case of eval/namespace, for example, I could imagine the following 
scenario:

Whenever you use eval command, a drop-down menu is provided to offer a list of 
existing namespaces to choose from (a choice is usually much more practical and 
usable than an empty space to figure out what is possible and in what format 
should I enter it). Even if you choose wrong the first time, you can easily 
correct it, and eventually grasp the right practise.

Additionally, you could expand the namespaces into a new window clearly listing 
out each namespace's definitions, and possibly even allow interaction with each 
of the namespaces.

BTW, I'm not planning to give up on my personal journey, I enjoy it too much. I 
just thought I would try to bring in a new aspect from a field more familiar to 
me. If you like the idea and find it possibly useful and feasible, I could try 
to draw a non-function GUI a la (jtu100:calculator~) to explain better what I 
mean. If seen desirable, it could be fleshed-out and integrated with DrRacket 
the same way as the Program Contour or Module Browser, for example.

br, jukka




> -Original Message-
> From: Matthew Flatt [mailto:mfl...@cs.utah.edu]
> Sent: 11 August 2011 07:12
> To: Jukka Tuominen
> Cc: users@racket-lang.org
> Subject: Re: [racket] pretty-big->#lang (was: External
> connectiontoFinndesign Liitin)
> 
> 
> At Wed, 10 Aug 2011 17:58:44 +0300, "Jukka Tuominen" warote:
> > 
> > I noticed that once the environment is evaluated first, pasting 
> and running
> > all the tests in a row in the DrRacket interaction window works without
> > problems. The same behaviour with or without (require (for-syntax
> > racket/base)).
> > 
> > In a way, it's an inconvenience rather than an error, but it 
> still would be
> > nice to find a solution or atleast an explanation of what is going on.
> 
> As Matthias says, you seem to be tripping over the difference between
> the environment of an expression within a module and the namespace that
> `eval' uses.
> 
> Maybe you've already seen this chapter in the guide about namespaces:
> 
>   http://docs.racket-lang.org/guide/reflection.html
> 
> If not, that may be a good place to start. Meanwhile, I've been
> thinking about how we can explain better what's going on and why.
> Below is an attempt.
> 
> 
> Here's a program in English prose:
> 
>  Assume that your favorite color is red. Now imagine a balloon that is
>  your favorite color. Paint a canvas the same color as the balloon.
> 
> As English goes, that's a fairly clear program with a fairly well
> defined result. When I read those instructions, at least, I will always
> produce a red canvas (assuming that I have a canvas and some red paint,
> but a potential lack of art supplies is not the point here).
> 
> I would come up with a red canvas even if I read the instructions when
> surrounded by people who speak

Re: [racket] pretty-big->#lang (was: External connection toFinndesign Liitin)

2011-08-10 Thread Jukka Tuominen

I noticed that once the environment is evaluated first, pasting and running
all the tests in a row in the DrRacket interaction window works without
problems. The same behaviour with or without (require (for-syntax
racket/base)).

In a way, it's an inconvenience rather than an error, but it still would be
nice to find a solution or atleast an explanation of what is going on.

br, jukka


> -Original Message-
> From: Matthias Felleisen [mailto:matth...@ccs.neu.edu]
> Sent: 10 August 2011 17:24
> To: Jukka Tuominen
> Subject: Re: [racket] pretty-big->#lang (was: External connection
> toFinndesign Liitin)
>
>
>
> Did you import the libraries for the proper phase?
>
> It sounds like you need to (require (for-syntax racket/base)) or
> something like that.
>
>
> On Aug 10, 2011, at 10:20 AM, Jukka Tuominen wrote:
>
> >
> > Having experimenting with the code some more...
> >
> > I bypassed the symbolize definition temporarily like this
> >
> >(define (symbolize smbl)
> >  smbl)
> >
> > and received another error instead:
> >
> > "compile: unbound identifier (and no #%app syntax transformer
> is bound) in:
> > named-lambda"
> >
> > I tried to move named-lambda definition earlier in the lib file
> (in case it
> > matters), without effect. Why is it unbound?
> >
> > br, jukka
> >
> >
> >> -Original Message-
> >> From: users-boun...@racket-lang.org
> >> [mailto:users-boun...@racket-lang.org]On Behalf Of Jukka Tuominen
> >> Sent: 10 August 2011 17:03
> >> To: Matthias Felleisen
> >> Cc: users@racket-lang.org
> >> Subject: Re: [racket] pretty-big->#lang (was: External connection
> >> toFinndesign Liitin)
> >>
> >>
> >>
> >> Try to spell that over the phone :)
> >>
> >> Almost there now. It works half ways the examples in a row,
> which is even
> >> weirder if possible!?
> >>
> >> It still signals the same error, so I assume the cause of the
> problem is
> >> another eval-string in the following, equally strange helper:
> >>
> >>(define (symbolize id-candidate)
> >>  (eval-string (string-append "'" (symbol->string id-candidate
> >>
> >> The purpose of this function is to verify that the inputted
> >> symbol is really
> >> interpreted as a symbol. It seems that the namespace devider ':' causes
> >> sometimes problems and 'symbolize' have corrected the
> situation... until
> >> now. It doesn't explain how it manages to get half ways, though...
> >>
> >> Do you have any exotic dots left for this situation :)
> >>
> >> br, jukka
> >>
> >>
> >>> -Original Message-
> >>> From: Matthias Felleisen [mailto:matth...@ccs.neu.edu]
> >>> Sent: 10 August 2011 15:31
> >>> To: Jukka Tuominen
> >>> Subject: Re: [racket] pretty-big->#lang (was: External connection to
> >>> Finndesign Liitin)
> >>>
> >>>
> >>>
> >>> On Aug 10, 2011, at 4:00 AM, Jukka Tuominen wrote:
> >>>
> >>>>
> >>>> Second question: Is there a better procedure doing quotify's
> >> job without
> >>>> causing the error? I assume that this is yet again the
> >>> top-level namespace
> >>>> issue caused by the 'eval-string'?
> >>>
> >>>
> >>> Do you mean this:
> >>>
> >>> (define (quotify x) `',x)
> >>
> >> _
> >>  For list-related administrative tasks:
> >>  http://lists.racket-lang.org/listinfo/users
> >
>

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] pretty-big->#lang (was: External connection toFinndesign Liitin)

2011-08-10 Thread Jukka Tuominen

Having experimenting with the code some more...

I bypassed the symbolize definition temporarily like this

(define (symbolize smbl)
  smbl)

and received another error instead:

"compile: unbound identifier (and no #%app syntax transformer is bound) in:
named-lambda"

I tried to move named-lambda definition earlier in the lib file (in case it
matters), without effect. Why is it unbound?

br, jukka


> -Original Message-
> From: users-boun...@racket-lang.org
> [mailto:users-boun...@racket-lang.org]On Behalf Of Jukka Tuominen
> Sent: 10 August 2011 17:03
> To: Matthias Felleisen
> Cc: users@racket-lang.org
> Subject: Re: [racket] pretty-big->#lang (was: External connection
> toFinndesign Liitin)
>
>
>
> Try to spell that over the phone :)
>
> Almost there now. It works half ways the examples in a row, which is even
> weirder if possible!?
>
> It still signals the same error, so I assume the cause of the problem is
> another eval-string in the following, equally strange helper:
>
> (define (symbolize id-candidate)
>   (eval-string (string-append "'" (symbol->string id-candidate
>
> The purpose of this function is to verify that the inputted
> symbol is really
> interpreted as a symbol. It seems that the namespace devider ':' causes
> sometimes problems and 'symbolize' have corrected the situation... until
> now. It doesn't explain how it manages to get half ways, though...
>
> Do you have any exotic dots left for this situation :)
>
> br, jukka
>
>
> > -Original Message-
> > From: Matthias Felleisen [mailto:matth...@ccs.neu.edu]
> > Sent: 10 August 2011 15:31
> > To: Jukka Tuominen
> > Subject: Re: [racket] pretty-big->#lang (was: External connection to
> > Finndesign Liitin)
> >
> >
> >
> > On Aug 10, 2011, at 4:00 AM, Jukka Tuominen wrote:
> >
> > >
> > > Second question: Is there a better procedure doing quotify's
> job without
> > > causing the error? I assume that this is yet again the
> > top-level namespace
> > > issue caused by the 'eval-string'?
> >
> >
> > Do you mean this:
> >
> > (define (quotify x) `',x)
>
> _
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/users

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] pretty-big->#lang (was: External connection to Finndesign Liitin)

2011-08-10 Thread Jukka Tuominen

Try to spell that over the phone :)

Almost there now. It works half ways the examples in a row, which is even
weirder if possible!?

It still signals the same error, so I assume the cause of the problem is
another eval-string in the following, equally strange helper:

(define (symbolize id-candidate)
  (eval-string (string-append "'" (symbol->string id-candidate

The purpose of this function is to verify that the inputted symbol is really
interpreted as a symbol. It seems that the namespace devider ':' causes
sometimes problems and 'symbolize' have corrected the situation... until
now. It doesn't explain how it manages to get half ways, though...

Do you have any exotic dots left for this situation :)

br, jukka


> -Original Message-
> From: Matthias Felleisen [mailto:matth...@ccs.neu.edu]
> Sent: 10 August 2011 15:31
> To: Jukka Tuominen
> Subject: Re: [racket] pretty-big->#lang (was: External connection to
> Finndesign Liitin)
>
>
>
> On Aug 10, 2011, at 4:00 AM, Jukka Tuominen wrote:
>
> >
> > Second question: Is there a better procedure doing quotify's job without
> > causing the error? I assume that this is yet again the
> top-level namespace
> > issue caused by the 'eval-string'?
>
>
> Do you mean this:
>
> (define (quotify x) `',x)

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Adding raw string syntax

2011-08-10 Thread Jukka Tuominen

Not much of an analogy, but I've always found the following thought
inspiring:

"People that are busy trying to convince something cannot be done, mustn't
disturb the ones that are already doing it!"
(Sorry, could't find who's quote it is).

Racket seems to be the tool for the doers - the threashold to DIY is very
low, as we have seen many times.

br, jukka

> -Original Message-
> From: users-boun...@racket-lang.org
> [mailto:users-boun...@racket-lang.org]On Behalf Of Joan Arnaldich
> Sent: 10 August 2011 10:35
> To: users@racket-lang.org
> Subject: Re: [racket] Adding raw string syntax
>
>
> > > The @ syntax originally designed for Scribble is very helpful for
> > > this sort of thing.
> >
> > A concrete example for using it as a raw string:
> >
> >   #lang at-exp racket
> >   (define r string-append)
> >   (display @r{...nearly free text here...})
> >
> Aha! So there it was! Thanks a lot for the pointer! Ignorance is
> always ignorance, but... I can't help thinking that if I had known
> that I would have missed a lot of fun ;)
>
>
>
>
> _
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/users

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


[racket] pretty-big->#lang (was: External connection to Finndesign Liitin)

2011-08-10 Thread Jukka Tuominen

Hi,

coming back to pretty-big->#lang issue. I just noticed a weird thing. Once I
changed the external connection source files to '#lang racket' format
(updates attached), this is what happens:

1) Just evaluate the environment i.e. just [Run] the liitin.rkt without
   any example procedures (or [Check Syntax])
  >> Everything OK

2) Run any single example
  >> Everything OK

3) Run two or more examples in row
  >> error: "compile: unbound identifier (and no #%app syntax
transformer is bound) in: quote"

First question: I wonder what causes Pretty big and #lang racket behave
differently?

The error seems to point to my strange 'quotify' helper (can't blame, really
:)

(define (quotify var) (eval-string (string-append "''" (symbol->string
var

The purpose of this helper, is to take a variable and 'double quote' it so
that once the next procedure evaluates it, one quote layer still remains.
Also, the var content has to be changeable:

e.g.

  (define (l-get liitin-object)
(eval-in-server server-name server-port (list
'fetch-public-object-contents (quotify liitin-object

(l-get 'namespace:object)

>> '(public-object-exists? 'namespace:object) instead of
'(public-object-exists? 'liitin-object) or having the liitin-object expanded
immediately.

Second question: Is there a better procedure doing quotify's job without
causing the error? I assume that this is yet again the top-level namespace
issue caused by the 'eval-string'?

Or - since the error only occurs in the 'demo mode' running multiple
examples instead of the normal case's single procedure - is this rather a
feature than an error? :) Anyway, two procedures cannot see each other,
unless they either come from a module or the customized liitin lookup. If
I've understood correctly...?

br, jukka

...
>Now, I
quess it would be better to turn to #lang era.
...
...
>> Why are you using Pretty Big? It's usually not a good idea.
...


liitin-lib.rkt
Description: Binary data


liitin.rkt
Description: Binary data
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Re: [racket] FW: External connection to Finndesign Liitin

2011-08-04 Thread Jukka Tuominen
Great ideas, thanks! Defenitely need a human browsable repository and an API
to automate and extent searches. Nice examples, also. BTW, liitin namespace
can be abbreviated as plain ":" i.e. liitin:object-name equals to
:object-name.

I've also thought about Mediawiki engine that might be able to handle
atleast some of the mentioned requirements.

br, jukka

 -Original Message-
From: Rodolfo Carvalho [mailto:rhcarva...@gmail.com]
Sent: 04 August 2011 19:54
To: Jukka Tuominen
Cc: users@racket-lang.org
Subject: Re: [racket] FW: External connection to Finndesign Liitin


  On Thu, Aug 4, 2011 at 06:26, Jukka Tuominen
 wrote:

Hi Rodolfo,

I'm glad you liked it :)




  I've been following your announcements. Your ideal is interesting.




Unfortunately there's not yet a decent way to find out what's available.
I've noticed the same need while 'dog-fooding' on the system, and have
planned to approach it in two ways:

- Provide an internal/external channel for people to make announcements
(= web and/or posting list)
- Add a search functionality atleast with free-text search on object
name and content, and 'my history' options.




  Maybe some kind of indexed and searchable repository would be nice. Then
this repository could provide an API to search for things.
  For example one can do an "apt-cache search ..." to search APT
repositories from the console, as well as use a GUI like Synaptic to perform
a similar task.


  > (take 2 (liitin:search "calculator"))
  ...


  > (length (liitin:category "games"))
  42






  []'s


  Rodolfo Carvalho
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Re: [racket] FW: External connection to Finndesign Liitin

2011-08-04 Thread Jukka Tuominen
Hi Rodolfo,

I'm glad you liked it :)

Unfortunately there's not yet a decent way to find out what's available.
I've noticed the same need while 'dog-fooding' on the system, and have
planned to approach it in two ways:

- Provide an internal/external channel for people to make announcements (=
web and/or posting list)
- Add a search functionality atleast with free-text search on object name
and content, and 'my history' options.

Since many invisible Liitin engine issues still occupy most of our time,
there isn't much content yet in store and only a hand-full of account
owners. I'm not sure if they've published anything, yet. So, if anybody is
willing to provide more content, they are more than welcome. Any content
really for either public or personal use, but Liitin development-wise it
would great to have three types of content, in particular (in no particular
preference order)
- Small, useful, smart-phone-type-of GUI utils, such as calculator, virtual
keyboard, clock...
- Cool stuff to draw attention, e.g. games, A.I., the unexpected...
- Expansion to new terratories, giving examples, inspiration and
stepping-stones for others to explore things further.

Also, IDE and GUI tools require lots of work to ease bringing in more
content. Both pro and Scratch-type of approaches.

br, jukka
  -Original Message-
  From: Rodolfo Carvalho [mailto:rhcarva...@gmail.com]
  Sent: 04 August 2011 05:13
  To: Jukka Tuominen
  Cc: users@racket-lang.org
  Subject: Re: [racket] FW: External connection to Finndesign Liitin


  I was able to run the examples successfully after manually setting the
language to Pretty Big.
  It went reasonably fast, I enjoyed :D




  Question: is it possible today to find out what other users and/or
definitions are available within Liitin?





  []'s

  Rodolfo Carvalho



  On Wed, Aug 3, 2011 at 19:37, Jukka Tuominen
 wrote:


If I remember correctly, there was some time ago discussion about a
clear
default language missing from Racket. I agree. Once I started with PLT
Scheme many years ago, I picked the version that suited best at that
time.
And have been using that ever since mostly for compatibility reasons.
Now, I
quess it would be better to turn to #lang era. It propably won't happen
to
Liitin backend, but if anyone can instruct how to convert these ext
files to
#lang format, I'd be happy to update them. I just tried it but also
received
the errors that Jon mentioned.

Also, I wonder if case sensivity and redefinition settings can somehow
be
included so that the user wouldn't need to worry about them either?

br, jukka



> -Original Message-
> From: Vincent St-Amour [mailto:stamo...@ccs.neu.edu]
> Sent: 04 August 2011 01:03
> To: Jukka Tuominen
> Cc: users@racket-lang.org
> Subject: Re: [racket] FW: External connection to Finndesign Liitin
>
>
> At Wed, 3 Aug 2011 21:51:22 +0300,
> Jukka Tuominen wrote:
> > Did you set DrRacket's language to Pretty Big (Not default, I
guess)?
> >
> >  From liitin-lib.rkt:
> >   ;; You may additionally want to set the DrRacket language
> level to 'Pretty
> > Big', uncheck case sensivity,
> >   ;; and uncheck 'Disallow redefinition of initial bindings' to
further
> > improve compatibility.
>
> Why are you using Pretty Big? It's usually not a good idea.
>
> Vincent

_
 For list-related administrative tasks:
 http://lists.racket-lang.org/listinfo/users


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Re: [racket] FW: External connection to Finndesign Liitin

2011-08-03 Thread Jukka Tuominen

If I remember correctly, there was some time ago discussion about a clear
default language missing from Racket. I agree. Once I started with PLT
Scheme many years ago, I picked the version that suited best at that time.
And have been using that ever since mostly for compatibility reasons. Now, I
quess it would be better to turn to #lang era. It propably won't happen to
Liitin backend, but if anyone can instruct how to convert these ext files to
#lang format, I'd be happy to update them. I just tried it but also received
the errors that Jon mentioned.

Also, I wonder if case sensivity and redefinition settings can somehow be
included so that the user wouldn't need to worry about them either?

br, jukka


> -Original Message-
> From: Vincent St-Amour [mailto:stamo...@ccs.neu.edu]
> Sent: 04 August 2011 01:03
> To: Jukka Tuominen
> Cc: users@racket-lang.org
> Subject: Re: [racket] FW: External connection to Finndesign Liitin
>
>
> At Wed, 3 Aug 2011 21:51:22 +0300,
> Jukka Tuominen wrote:
> > Did you set DrRacket's language to Pretty Big (Not default, I guess)?
> >
> >  From liitin-lib.rkt:
> >   ;; You may additionally want to set the DrRacket language
> level to 'Pretty
> > Big', uncheck case sensivity,
> >   ;; and uncheck 'Disallow redefinition of initial bindings' to further
> > improve compatibility.
>
> Why are you using Pretty Big? It's usually not a good idea.
>
> Vincent

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


[racket] FW: External connection to Finndesign Liitin

2011-08-03 Thread Jukka Tuominen
Sorry, I meant to reply to the mailing list, also.

br, jukka

-Original Message-
From: Jukka Tuominen [mailto:jukka.tuomi...@finndesign.fi]
Sent: 03 August 2011 21:43
To: rafk...@cs.utah.edu
Subject: RE: [racket] External connection to Finndesign Liitin


Did you set DrRacket's language to Pretty Big (Not default, I guess)?

 From liitin-lib.rkt:
  ;; You may additionally want to set the DrRacket language level to 'Pretty
Big', uncheck case sensivity,
  ;; and uncheck 'Disallow redefinition of initial bindings' to further
improve compatibility.

br, jukka
  -Original Message-
  From: users-boun...@racket-lang.org
[mailto:users-boun...@racket-lang.org]On Behalf Of Jon Rafkind
  Sent: 03 August 2011 21:27
  To: users@racket-lang.org
  Subject: Re: [racket] External connection to Finndesign Liitin


  If I run liitin.rkt (either on the command line or in drracket) it
complains there is no #lang line. When I add one I get this error

  compile: unbound identifier (and no #%app syntax transformer is bound) at:
quote in: (quote (quote gaia:fibonacci:2011-01-01T12:00:00))

  On 08/03/2011 04:36 AM, Jukka Tuominen wrote:
Hi all,

I would just like to inform you that you can now make a read-only connection
to public Liitin objects even if you don't have a Liitin account. We have
tested this with Windows XP and Ubuntu 10.04 with R 5.1 so far, but
hopefully it works with many other systems, as well. I'd appreciate any
feedback on both successes and failures.

Just place the attached files within the same folder and run the liitin.rkt
in DrRacket. Both files contain quite a lot information and examples, but
just shortly:

You can call Liitin objects as if local definitions, e.g.
(gaia:fibonacci 10)
(mirko:eliza "i can't play piano")
(map gaia:fibonacci '(1 2 3 4 5 6 7 8 9 10)); combine freely with local
primitives (map in this case)
(jtu100:calculator~); GUI example (functionality not implemented)

The connection speed is not yet optimised in any way, but then again, how
much time would it normally take to find, install, look for updates, run,
and uninstall a native application? :)

Just a small, real-life example: I noticed that the above mentioned
calculator sketch (jtu100:calculator~) had the default title-bar name
"Frame", so I looked-up the object (within Liitin account), changed the name
to "Calculator" and pressed the "Save update" button (see Liitin tutorial in
Youtube). It took less than a minute to find, correct and publish the new
version coming into effect immediately for users globally. Racket's
JIT-compiler makes wonders!

To create new Liitin objects, you need a Liitin account. You can connect to
Liitin account from most operating systems by VNC.

Eventhough the provided examples are function and Racket oriented, the
objects can be of any type. Just anything that you would like to access any
time later or something that could benefit from the built-in version control
or publishing channel.

Obvious places for trouble when using the external connection:
- Object calling a private Liitin object
- Object calling a Liitin-internal primitive
- Object calling an OS or HW specific function

Any feedback highly appreciated!


br, jukka

ps, if anyone wants to place content to Liitin, just let me know. Or, if you
already have an account, you can just help yourself :)


|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi




_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

[racket] External connection to Finndesign Liitin

2011-08-03 Thread Jukka Tuominen

Hi all,

I would just like to inform you that you can now make a read-only connection
to public Liitin objects even if you don't have a Liitin account. We have
tested this with Windows XP and Ubuntu 10.04 with R 5.1 so far, but
hopefully it works with many other systems, as well. I'd appreciate any
feedback on both successes and failures.

Just place the attached files within the same folder and run the liitin.rkt
in DrRacket. Both files contain quite a lot information and examples, but
just shortly:

You can call Liitin objects as if local definitions, e.g.
(gaia:fibonacci 10)
(mirko:eliza "i can't play piano")
(map gaia:fibonacci '(1 2 3 4 5 6 7 8 9 10)); combine freely with local
primitives (map in this case)
(jtu100:calculator~); GUI example (functionality not implemented)

The connection speed is not yet optimised in any way, but then again, how
much time would it normally take to find, install, look for updates, run,
and uninstall a native application? :)

Just a small, real-life example: I noticed that the above mentioned
calculator sketch (jtu100:calculator~) had the default title-bar name
"Frame", so I looked-up the object (within Liitin account), changed the name
to "Calculator" and pressed the "Save update" button (see Liitin tutorial in
Youtube). It took less than a minute to find, correct and publish the new
version coming into effect immediately for users globally. Racket's
JIT-compiler makes wonders!

To create new Liitin objects, you need a Liitin account. You can connect to
Liitin account from most operating systems by VNC.

Eventhough the provided examples are function and Racket oriented, the
objects can be of any type. Just anything that you would like to access any
time later or something that could benefit from the built-in version control
or publishing channel.

Obvious places for trouble when using the external connection:
- Object calling a private Liitin object
- Object calling a Liitin-internal primitive
- Object calling an OS or HW specific function

Any feedback highly appreciated!


br, jukka

ps, if anyone wants to place content to Liitin, just let me know. Or, if you
already have an account, you can just help yourself :)


|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi



liitin-lib.rkt
Description: Binary data


liitin.rkt
Description: Binary data
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

[racket] RPC client/server (was: Limiting net-repl provided functions)

2011-06-29 Thread Jukka Tuominen

To setup a RPC client/server system, I ended up tweaking Matthew's example
from "More: Systems Programming with Racket", now that I understood better
what was needed.

http://docs.racket-lang.org/pdf/more.pdf


Below is the actual code, in case somebody else finds it useful (tested in
Linux env. only). To filter out illegal functions, I'll propably create a
list predicates and test them one by one against the rpc candidate. Overall,
this seems promising for building further Liitin proof-of-concepts. Please,
let me know if you find anything critical or a place for improvement in the
code.

Once again, thank you everyone for all the help!!

br, jukka


|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi


-
#lang racket

;XXX  SERVER SIDE XXX

(define server-name "localhost")
(define server-port 9877)
(define max-allow-wait 20); max concurrent clients waiting for turn
(define reuse? #f)
(define time-limit 10); secs for each rpc request

(define (allowed? expr);; Filter out illegal requests here
  #t)

(define (run-rpc-server)
  (define (accept-and-handle listener)
(define cust (make-custodian))
(custodian-limit-memory cust (* 50 1024 1024))
(parameterize ((current-custodian cust))
  (define expr "")
  (define-values (client->me me->client) (tcp-accept listener))
  (thread (lambda ()
(set! expr (read client->me))
(if (allowed? expr)
(write (eval expr) me->client)
(error "Illegal procedure call!" me->client))
(close-output-port me->client)
(close-input-port client->me
(thread (lambda () ;; Watcher thread
  (sleep time-limit)
  (custodian-shutdown-all cust
  (define main-cust (make-custodian))
  (parameterize ((current-custodian main-cust))
(define listener (tcp-listen server-port max-allow-wait reuse? #f))
(define (loop)
  (accept-and-handle listener)
  (loop))
(thread loop))
  (lambda ()
(custodian-shutdown-all main-cust)))

;XXX  CLIENT SIDE  XXX

;(define server-name "localhost")
;(define server-port 9877)

(define (rpc server-name expr); using default port
  (let-values (((server->me me->server)
(tcp-connect server-name server-port)))
(write expr me->server)-
(close-output-port me->server)
(let ((response (read server->me)))
  (close-input-port server->me)
  response)))

;XXX TEST RUN XXX

(run-rpc-server)

(rpc "localhost" '(+ 1 2 3))
(+ 5 (rpc "localhost" '(+ 1 2 3)) ); combine local with remote



_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Limiting net-repl provided functions

2011-06-28 Thread Jukka Tuominen


> -Original Message-
> From: Eli Barzilay [mailto:e...@barzilay.org]
> Sent: 28 June 2011 13:56
> To: Jukka Tuominen
> Cc: Sam Tobin-Hochstadt; users@racket-lang.org
> Subject: RE: [racket] Limiting net-repl provided functions
>
>
> Three hours ago, Jukka Tuominen wrote:
> >
> > Thanks Eli, much appreciated!
> >
> > By means of just limiting provided functions, the latter approach
> > seems bullet-proof (although lacking sandbox characteristics that
> > net-repl partly does already AFAIU).
> >
> > If however, I would choose the sandbox approach, can you think of
> > any way to break into the system by utilizing some 'invisible'
> > features? Is this also bullet-proof?
>
> The sandbox is more proof in a sense that it requires explicit
> permission for things like FS access or taking too long, or using a
> lot of memory.  For example, if your `f1' handler happens to consume
> too much memory, running it inside the sandbox will lead to an
> exception rather than to crashing the server.  Worse, your handlers
> might be open to code injection that you didn't anticipate.  So it can
> basically protect you against bugs in your own code.
>
> But if you trust your code to be safe, then the explicit dispatching
> is overall simpler to deal with.

Ok, I see. In a way both are needed but for different purposes... which of
cource adds to the number of moving parts. At the moment, I'm advancing with
the sandbox approach.

>
>
> An hour and a half ago, Jukka Tuominen wrote:
> >
> > this works nicely in Linux (where intented), but when tested inside
> > Win XP/ Racket 5.1., it gives the following error:
> >
> > file-exists?: `exists' access denied for C:\Program
> > Files\Racket\lib\libeay32.dll
>
> A sandbox requires explicit permission to access any file (and with
> different kind of access).
>
> But the default should allow reading files in the racket tree, so this
> might be a bug.

After adding some more modules to the test case, also Linux/ R 5.1 gave the
same error, except for the path:

/usr/lib/racket/libcrypto.so

br, jukka

>
> --
>   ((lambda (x) (x x)) (lambda (x) (x x)))  Eli Barzilay:
> http://barzilay.org/   Maze is Life!

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Limiting net-repl provided functions

2011-06-28 Thread Jukka Tuominen

FYI,

this works nicely in Linux (where intented), but when tested inside Win XP/
Racket 5.1., it gives the following error:

file-exists?: `exists' access denied for C:\Program
Files\Racket\lib\libeay32.dll

br, jukka

>
>    limited.rkt ---
>   #lang racket/base
>   (provide
>;; special things
>#%app #%module-begin #%datum #%top #%top-interaction
>;; visible primitives
>+ - quote length
>;; additional functions
>f1)
>   ;; definitions for the additional functions
>   (define (f1 l) (length l))
>
> and then:
>
>   > (require racket/sandbox)
>   > (define e (make-evaluator "limited.rkt"))
>   > (e '(+ 1 2))
>   3
>   > (e '(- (f1 '(x y z)) 1))
>   2
> http://barzilay.org/   Maze is Life!

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Limiting net-repl provided functions

2011-06-28 Thread Jukka Tuominen

Thanks Eli, much appreciated!

By means of just limiting provided functions, the latter approach seems
bullet-proof (although lacking sandbox characteristics that net-repl partly
does already AFAIU).

If however, I would choose the sandbox approach, can you think of any way to
break into the system by utilizing some 'invisible' features? Is this also
bullet-proof?

br, jukka


> -Original Message-
> From: Eli Barzilay [mailto:e...@barzilay.org]
> Sent: 28 June 2011 10:33
> To: Jukka Tuominen
> Cc: Sam Tobin-Hochstadt; users@racket-lang.org
> Subject: RE: [racket] Limiting net-repl provided functions
>
>
> 10 minutes ago, Jukka Tuominen wrote:
> >
> > > -Original Message-
> > > From: Eli Barzilay [mailto:e...@barzilay.org]
> > > Sent: 28 June 2011 09:45
> > > To: Jukka Tuominen
> > > Cc: Sam Tobin-Hochstadt; users@racket-lang.org
> > > Subject: RE: [racket] Limiting net-repl provided functions
> > >
> > >
> > > About a minute ago, Jukka Tuominen wrote:
> > > >
> > > > > The sandbox is working in an isolated world (by design, of
> > > > > course), so you need to do the (require "sb-functions.rkt") inside
> > > > > the sandbox.  For example, just use (sb-eval '(require ...)).
> > > >
> > > > Wouldn't that mean that the sb-evaluator has to be first initiated
> > > > to understand 'require' plus many other primitives, not just the
> > > > intented f1, f2, f3?
> > >
> > > Yes.
> > >
> > >
> > > > Is this even possible?
> > >
> > > Yes.  You can get that with
> > >
> > >   (make-evaluator 'racket/base)
> >
> > Sorry, I meant to say that is it possible to have only the f1,
> f2, and f3
> > provided, but not even 'require'...
> > >
> > > If you want a limited language, then you can make up a language with
> > > `require' and the limited set of bindings you want in.  If you also
> > > don't want `require' in the language, you can make the language itself
> > > provide the functions that you want to make public, but not `require'
> > > itself.  Yet another option is to use `call-in-sandbox-context' with
> > > `namespace-require'.
> >
> > yes, I want to have a more limited language, yet without leaving the
> > comfort of Racket, meaning that on the server side you have all the
> > familiar tools to create new 'primitives', and on the client side,
> > use these primitives just like any other, no matter how and where
> > they take place.
>
> So that's what you need to do.  Here's an example:
>
>    limited.rkt ---
>   #lang racket/base
>   (provide
>;; special things
>#%app #%module-begin #%datum #%top #%top-interaction
>;; visible primitives
>+ - quote length
>;; additional functions
>f1)
>   ;; definitions for the additional functions
>   (define (f1 l) (length l))
>
> and then:
>
>   > (require racket/sandbox)
>   > (define e (make-evaluator "limited.rkt"))
>   > (e '(+ 1 2))
>   3
>   > (e '(- (f1 '(x y z)) 1))
>   2
>
> and not much else works...  Specifically, `require' is not there:
>
>   > (e '(require racket))
>   reference to an identifier before its definition: require in module:
>   "program"
>
>
> > > (All of this is much more complicated then what Matthias
> > > originally hinted at: if you know the set of functions that you
> > > want to expose, then you can just dispatch on the input symbols
> > > and call the corresponding function.)
> >
> > I wish I was just pretending not to see the obvious (sigh)...  Yes
> > please, I would very much like the obvious and simple solution! :)
> > Not just for me, but also for the ones that hopefully will end up
> > creating these new services eventually. Even the hint 2 isn't enough
> > for me unfortunately (sigh 2)...
>
> Just something like this:
>
>   (require "server-functions.rkt")
>   (define request (read from-client))
>   (unless (and (list? request) (pair? request) (symbol? (car request)))
>   ;; or use `match' instead
> (throw-error-to-port to-client "bad request"))
>   (apply (case (car request)
>[(f1) f1]
>[(f2) f2]
>... more here ...)
>  (cdr request))
>
> --
>   ((lambda (x) (x x)) (lambda (x) (x x)))  Eli Barzilay:
> http://barzilay.org/   Maze is Life!

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Limiting net-repl provided functions

2011-06-28 Thread Jukka Tuominen


> -Original Message-
> From: Eli Barzilay [mailto:e...@barzilay.org]
> Sent: 28 June 2011 09:45
> To: Jukka Tuominen
> Cc: Sam Tobin-Hochstadt; users@racket-lang.org
> Subject: RE: [racket] Limiting net-repl provided functions
>
>
> About a minute ago, Jukka Tuominen wrote:
> >
> > > The sandbox is working in an isolated world (by design, of
> > > course), so you need to do the (require "sb-functions.rkt") inside
> > > the sandbox.  For example, just use (sb-eval '(require ...)).
> >
> > Wouldn't that mean that the sb-evaluator has to be first initiated
> > to understand 'require' plus many other primitives, not just the
> > intented f1, f2, f3?
>
> Yes.
>
>
> > Is this even possible?
>
> Yes.  You can get that with
>
>   (make-evaluator 'racket/base)

Sorry, I meant to say that is it possible to have only the f1, f2, and f3
provided, but not even 'require'...
>
> If you want a limited language, then you can make up a language with
> `require' and the limited set of bindings you want in.  If you also
> don't want `require' in the language, you can make the language itself
> provide the functions that you want to make public, but not `require'
> itself.  Yet another option is to use `call-in-sandbox-context' with
> `namespace-require'.

yes, I want to have a more limited language, yet without leaving the comfort
of Racket, meaning that on the server side you have all the familiar tools
to create new 'primitives', and on the client side, use these primitives
just like any other, no matter how and where they take place.

>
> (All of this is much more complicated then what Matthias originally
> hinted at: if you know the set of functions that you want to expose,
> then you can just dispatch on the input symbols and call the
> corresponding function.)

I wish I was just pretending not to see the obvious (sigh)...
Yes please, I would very much like the obvious and simple solution! :) Not
just for me, but also for the ones that hopefully will end up creating these
new services eventually. Even the hint 2 isn't enough for me unfortunately
(sigh 2)...

Anyhow, thanks for the patience everyone! :)

br, jukka

>
> --
>   ((lambda (x) (x x)) (lambda (x) (x x)))  Eli Barzilay:
> http://barzilay.org/   Maze is Life!

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Limiting net-repl provided functions

2011-06-27 Thread Jukka Tuominen

>
> The sandbox is working in an isolated world (by design, of course), so
> you need to do the (require "sb-functions.rkt") inside the sandbox.
> For example, just use (sb-eval '(require ...)).
>
> --
>   ((lambda (x) (x x)) (lambda (x) (x x)))  Eli Barzilay:
> http://barzilay.org/   Maze is Life!

Wouldn't that mean that the sb-evaluator has to be first initiated to
understand 'require' plus many other primitives, not just the intented f1,
f2, f3? Is this even possible?

br, jukka

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Limiting net-repl provided functions

2011-06-27 Thread Jukka Tuominen

I made a simplified test case (below), even left out the net-repl part in
belief that replacing the eval with sb-eval will do the trick in the end. I
have the module structure as intended, but still can't figure out how to
give it as an input to the sandbox evaluator. The documentation is there,
but a few more examples could make it easier to comprehend, especially when
not using built-in modules.

br, jukka

---

;XXX sb-test.rkt XXX
#lang racket

(require racket/sandbox)
(require "sb-functions.rkt")


;(define sb-eval (make-evaluator 'racket/base))
(define sb-eval (make-evaluator ... "sb-functions.rkt" ... ));?

;; these are ok
;(f1) ;bound
;(f2) ;bound
;(f3) ;bound
;(f4) ;unbound
;(f5) ;unbound
;(f6) ;unbound

;; intented sandbox bindings
;(sb-eval 'f1) ;bound
;(sb-eval 'f2) ;bound
;(sb-eval 'f3) ;bound
;(sb-eval 'f4) ;unbound
;(sb-eval 'f5) ;unbound
;(sb-eval 'f6) ;unbound
;(sb-eval 'cdr) ;unbound


;XXX sb-functions.rkt XXX

(module sb-functions scheme

  (require "sb-functions-extra.rkt")
  (provide f1 f2 f3)

  (define f1 (lambda () "F-one"))
  (define f2 (lambda () "F-two"))
  (define f3 f5); f5 from sb-functions-extra.rkt
  (define f4 (lambda () "F-four"));not provided!
  )


;XXX sb-functions-extra.rkt XXX

(module sb-functions-extra scheme

  (provide f5)

  (define f5 (lambda () "F-five"))
  (define f6 (lambda () "F-six")); not provided
  )

---

> -Original Message-----
> From: sam...@gmail.com [mailto:sam...@gmail.com]On Behalf Of Sam
> Tobin-Hochstadt
> Sent: 27 June 2011 17:40
> To: Jukka Tuominen
> Cc: users@racket-lang.org
> Subject: Re: [racket] Limiting net-repl provided functions
>
>
> On Mon, Jun 27, 2011 at 10:08 AM, Jukka Tuominen
>  wrote:
> >
> > So, once I hopefully have it working locally, how do I apply it into the
> > net-repl server? I think the following is the correct definition to be
> > tweaked (non-modified from net-repl). Do I add the
> sandbox-environment to
> > evals or something?
> >
> >  (define net-repl-eval
> >    (let ([eval (current-eval)])
>
> You'll want to construct a sandboxed evaluator here, perhaps using
> `current-eval'.  But more likely, you don't need `current-eval' at
> all.  To create a sandbox, do something like this:
>
> (require racket/sandbox)
> (make-evaluator 'racket/base)
>
> That produces a procedure that works like `eval', but in a new sandbox
> that only has access to `racket/base'.
>
> >      (lambda (exit)
> >        (lambda (expr)
> >          (if (equal?
> >               (if (syntax? expr)
> >                   (syntax-object->datum expr)
> >                   expr)
> >               '(#%top-interaction close))
> >              (exit)
> >              (eval expr))
> >
> >
> > br, jukka
> >
> >
> >> -Original Message-
> >> From: sam...@gmail.com [mailto:sam...@gmail.com]On Behalf Of Sam
> >> Tobin-Hochstadt
> >> Sent: 27 June 2011 16:53
> >> To: Jukka Tuominen
> >> Cc: users@racket-lang.org
> >> Subject: Re: [racket] Limiting net-repl provided functions
> >>
> >>
> >> On Mon, Jun 27, 2011 at 9:48 AM, Jukka Tuominen
> >>  wrote:
> >> > BTW, 'secure' in this context may mean allowing even critical
> >> system calls
> >> > (say format harddisk), if so specified. But the user should not
> >> be able to
> >> > do anything else than specified.
> >>
> >> The `sandbox' infrastructure is fairly flexible.  Just by constructing
> >> a namespace and doing the `eval' in that namespace, you'll be able to
> >> restrict which identifiers the remote user can refer to.  If those are
> >> very limited, that might be enough for security.
> >>
> >> >> -Original Message-
> >> >> From: sam...@gmail.com [mailto:sam...@gmail.com]On Behalf Of Sam
> >> >> Tobin-Hochstadt
> >> >> Sent: 27 June 2011 16:10
> >> >> To: Jukka Tuominen
> >> >> Cc: users@racket-lang.org
> >> >> Subject: Re: [racket] Limiting net-repl provided functions
> >> >>
> >> >>
> >> >> On Mon, Jun 27, 2011 at 8:48 AM, Jukka Tuominen
> >> >>  wrote:
> >> >> >
> >> >> > The basic client/server functionality is already working, but
> >> >> it's too big a
> >> >> > security risk outside LAN use. It seems to be easier to add
> >> >

Re: [racket] Limiting net-repl provided functions

2011-06-27 Thread jukka . tuominen

Thanks Eric, that sounds very interesting.

br, jukka


> My IRC bot uses sandboxes to securely evaluate racket code; take a
> look at https://github.com/offby1/rudybot/blob/master/sandboxes.rkt
>
> On Mon, Jun 27, 2011 at 6:10 AM, Sam Tobin-Hochstadt 
> wrote:
>> On Mon, Jun 27, 2011 at 8:48 AM, Jukka Tuominen
>>  wrote:
>>>
>>> The basic client/server functionality is already working, but it's too
>>> big a
>>> security risk outside LAN use. It seems to be easier to add
>>> functionality
>>> than ripping them off. Perhaps creating a custom #%top definition to
>>> interfere with the default symbol lookup...?
>>
>> The right place to look is at sandboxes:
>>  http://docs.racket-lang.org/reference/Sandboxed_Evaluation.html
>> and namespaces:
>>  http://docs.racket-lang.org/guide/mk-namespace.html
>>
>> --
>> sam th
>> sa...@ccs.neu.edu
>> _
>>  For list-related administrative tasks:
>>  http://lists.racket-lang.org/listinfo/users
>>
>


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Re: [racket] Limiting net-repl provided functions

2011-06-27 Thread Jukka Tuominen

Great, thanks again! It will take a while to digest and try this out in
practise.

br, jukka


> -Original Message-
> From: sam...@gmail.com [mailto:sam...@gmail.com]On Behalf Of Sam
> Tobin-Hochstadt
> Sent: 27 June 2011 17:40
> To: Jukka Tuominen
> Cc: users@racket-lang.org
> Subject: Re: [racket] Limiting net-repl provided functions
>
>
> On Mon, Jun 27, 2011 at 10:08 AM, Jukka Tuominen
>  wrote:
> >
> > So, once I hopefully have it working locally, how do I apply it into the
> > net-repl server? I think the following is the correct definition to be
> > tweaked (non-modified from net-repl). Do I add the
> sandbox-environment to
> > evals or something?
> >
> >  (define net-repl-eval
> >    (let ([eval (current-eval)])
>
> You'll want to construct a sandboxed evaluator here, perhaps using
> `current-eval'.  But more likely, you don't need `current-eval' at
> all.  To create a sandbox, do something like this:
>
> (require racket/sandbox)
> (make-evaluator 'racket/base)
>
> That produces a procedure that works like `eval', but in a new sandbox
> that only has access to `racket/base'.
>
> >      (lambda (exit)
> >        (lambda (expr)
> >          (if (equal?
> >               (if (syntax? expr)
> >                   (syntax-object->datum expr)
> >                   expr)
> >               '(#%top-interaction close))
> >              (exit)
> >              (eval expr))
> >
> >
> > br, jukka
> >
> >
> >> -Original Message-
> >> From: sam...@gmail.com [mailto:sam...@gmail.com]On Behalf Of Sam
> >> Tobin-Hochstadt
> >> Sent: 27 June 2011 16:53
> >> To: Jukka Tuominen
> >> Cc: users@racket-lang.org
> >> Subject: Re: [racket] Limiting net-repl provided functions
> >>
> >>
> >> On Mon, Jun 27, 2011 at 9:48 AM, Jukka Tuominen
> >>  wrote:
> >> > BTW, 'secure' in this context may mean allowing even critical
> >> system calls
> >> > (say format harddisk), if so specified. But the user should not
> >> be able to
> >> > do anything else than specified.
> >>
> >> The `sandbox' infrastructure is fairly flexible.  Just by constructing
> >> a namespace and doing the `eval' in that namespace, you'll be able to
> >> restrict which identifiers the remote user can refer to.  If those are
> >> very limited, that might be enough for security.
> >>
> >> >> -Original Message-
> >> >> From: sam...@gmail.com [mailto:sam...@gmail.com]On Behalf Of Sam
> >> >> Tobin-Hochstadt
> >> >> Sent: 27 June 2011 16:10
> >> >> To: Jukka Tuominen
> >> >> Cc: users@racket-lang.org
> >> >> Subject: Re: [racket] Limiting net-repl provided functions
> >> >>
> >> >>
> >> >> On Mon, Jun 27, 2011 at 8:48 AM, Jukka Tuominen
> >> >>  wrote:
> >> >> >
> >> >> > The basic client/server functionality is already working, but
> >> >> it's too big a
> >> >> > security risk outside LAN use. It seems to be easier to add
> >> >> functionality
> >> >> > than ripping them off. Perhaps creating a custom #%top
> definition to
> >> >> > interfere with the default symbol lookup...?
> >> >>
> >> >> The right place to look is at sandboxes:
> >> >>   http://docs.racket-lang.org/reference/Sandboxed_Evaluation.html
> >> >> and namespaces:
> >> >>   http://docs.racket-lang.org/guide/mk-namespace.html
> >> >>
> >> >> --
> >> >> sam th
> >> >> sa...@ccs.neu.edu
> >> >
> >> > _
> >> >  For list-related administrative tasks:
> >> >  http://lists.racket-lang.org/listinfo/users
> >> >
> >>
> >>
> >>
> >> --
> >> sam th
> >> sa...@ccs.neu.edu
> >
> > _
> >  For list-related administrative tasks:
> >  http://lists.racket-lang.org/listinfo/users
> >
>
>
>
> --
> sam th
> sa...@ccs.neu.edu

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Limiting net-repl provided functions

2011-06-27 Thread Jukka Tuominen

So, once I hopefully have it working locally, how do I apply it into the
net-repl server? I think the following is the correct definition to be
tweaked (non-modified from net-repl). Do I add the sandbox-environment to
evals or something?

 (define net-repl-eval
(let ([eval (current-eval)])
  (lambda (exit)
(lambda (expr)
  (if (equal?
   (if (syntax? expr)
   (syntax-object->datum expr)
   expr)
   '(#%top-interaction close))
  (exit)
  (eval expr))


br, jukka


> -Original Message-
> From: sam...@gmail.com [mailto:sam...@gmail.com]On Behalf Of Sam
> Tobin-Hochstadt
> Sent: 27 June 2011 16:53
> To: Jukka Tuominen
> Cc: users@racket-lang.org
> Subject: Re: [racket] Limiting net-repl provided functions
>
>
> On Mon, Jun 27, 2011 at 9:48 AM, Jukka Tuominen
>  wrote:
> > BTW, 'secure' in this context may mean allowing even critical
> system calls
> > (say format harddisk), if so specified. But the user should not
> be able to
> > do anything else than specified.
>
> The `sandbox' infrastructure is fairly flexible.  Just by constructing
> a namespace and doing the `eval' in that namespace, you'll be able to
> restrict which identifiers the remote user can refer to.  If those are
> very limited, that might be enough for security.
>
> >> -Original Message-
> >> From: sam...@gmail.com [mailto:sam...@gmail.com]On Behalf Of Sam
> >> Tobin-Hochstadt
> >> Sent: 27 June 2011 16:10
> >> To: Jukka Tuominen
> >> Cc: users@racket-lang.org
> >> Subject: Re: [racket] Limiting net-repl provided functions
> >>
> >>
> >> On Mon, Jun 27, 2011 at 8:48 AM, Jukka Tuominen
> >>  wrote:
> >> >
> >> > The basic client/server functionality is already working, but
> >> it's too big a
> >> > security risk outside LAN use. It seems to be easier to add
> >> functionality
> >> > than ripping them off. Perhaps creating a custom #%top definition to
> >> > interfere with the default symbol lookup...?
> >>
> >> The right place to look is at sandboxes:
> >>   http://docs.racket-lang.org/reference/Sandboxed_Evaluation.html
> >> and namespaces:
> >>   http://docs.racket-lang.org/guide/mk-namespace.html
> >>
> >> --
> >> sam th
> >> sa...@ccs.neu.edu
> >
> > _
> >  For list-related administrative tasks:
> >  http://lists.racket-lang.org/listinfo/users
> >
>
>
>
> --
> sam th
> sa...@ccs.neu.edu

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Limiting net-repl provided functions

2011-06-27 Thread Jukka Tuominen

Thanks Sam,

I'll take (yet) another look at those.

BTW, 'secure' in this context may mean allowing even critical system calls
(say format harddisk), if so specified. But the user should not be able to
do anything else than specified.

br, jukka


> -Original Message-
> From: sam...@gmail.com [mailto:sam...@gmail.com]On Behalf Of Sam
> Tobin-Hochstadt
> Sent: 27 June 2011 16:10
> To: Jukka Tuominen
> Cc: users@racket-lang.org
> Subject: Re: [racket] Limiting net-repl provided functions
>
>
> On Mon, Jun 27, 2011 at 8:48 AM, Jukka Tuominen
>  wrote:
> >
> > The basic client/server functionality is already working, but
> it's too big a
> > security risk outside LAN use. It seems to be easier to add
> functionality
> > than ripping them off. Perhaps creating a custom #%top definition to
> > interfere with the default symbol lookup...?
>
> The right place to look is at sandboxes:
>   http://docs.racket-lang.org/reference/Sandboxed_Evaluation.html
> and namespaces:
>   http://docs.racket-lang.org/guide/mk-namespace.html
>
> --
> sam th
> sa...@ccs.neu.edu

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Limiting net-repl provided functions

2011-06-27 Thread Jukka Tuominen

Haa, so you know Matthias but won't tell!? :)

The problem is not to make it work (since it works already), but to restrict
what it provided over TCP.

br, jukka


> -Original Message-
> From: Matthias Felleisen [mailto:matth...@ccs.neu.edu]
> Sent: 27 June 2011 16:04
> To: Jukka Tuominen
> Cc: users@racket-lang.org
> Subject: Re: [racket] Limiting net-repl provided functions
>
>
>
> Since the server translates the symbol from the wire into a
> function call, I think this should be straightforward. -- Matthias
>
>
> On Jun 27, 2011, at 8:48 AM, Jukka Tuominen wrote:
>
> >
> > Hi,
> >
> > if I was to provide public NET-REPL servers (available at
> PLaneT), I wonder
> > if there's an easy and secure way to limit the provided functions per
> > server?
> >
> > Say, I have defined functions f1, f2, and f3, and would only
> like to provide
> > them over a TCP connection, but nothing else. Not even the
> basic primitives
> > (e.g. car, define, require, lambda...) or the net-repl service
> itself (to
> > prevent someone else starting a new service). Another server
> could provide a
> > different set of functions.
> >
> > The idea is to provide various Racket-powered Internet servers
> that could be
> > utilized remotely. E.g. by calling (eval-in-server [server]
> [port] [proc]),
> > you could operate on servers like...
> > - read-only access to public Liitin objects that you can fetch
> and evaluate
> > locally
> > - unified Liitin unit to be used for multiprocessing or choose where
> > processing makes most sense
> > - external SW/HW control, e.g. an embedded device control (pour-coffee,
> > water-temperature, water-left...)
> >
> > The basic client/server functionality is already working, but
> it's too big a
> > security risk outside LAN use. It seems to be easier to add
> functionality
> > than ripping them off. Perhaps creating a custom #%top definition to
> > interfere with the default symbol lookup...?
> >
> > Any help appreciated!
> >
> > br, jukka
> >
> >
> > |  J U K K A   T U O M I N E N
> > |  m a n a g i n g   d i r e c t o r  M. A.
> > |
> > |  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
> > |  mobile +358 50 5666290
> > |  jukka.tuomi...@finndesign.fi  www.finndesign.fi
> >
> >
> > _
> >  For list-related administrative tasks:
> >  http://lists.racket-lang.org/listinfo/users
>

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


[racket] Limiting net-repl provided functions

2011-06-27 Thread Jukka Tuominen

Hi,

if I was to provide public NET-REPL servers (available at PLaneT), I wonder
if there's an easy and secure way to limit the provided functions per
server?

Say, I have defined functions f1, f2, and f3, and would only like to provide
them over a TCP connection, but nothing else. Not even the basic primitives
(e.g. car, define, require, lambda...) or the net-repl service itself (to
prevent someone else starting a new service). Another server could provide a
different set of functions.

The idea is to provide various Racket-powered Internet servers that could be
utilized remotely. E.g. by calling (eval-in-server [server] [port] [proc]),
you could operate on servers like...
- read-only access to public Liitin objects that you can fetch and evaluate
locally
- unified Liitin unit to be used for multiprocessing or choose where
processing makes most sense
- external SW/HW control, e.g. an embedded device control (pour-coffee,
water-temperature, water-left...)

The basic client/server functionality is already working, but it's too big a
security risk outside LAN use. It seems to be easier to add functionality
than ripping them off. Perhaps creating a custom #%top definition to
interfere with the default symbol lookup...?

Any help appreciated!

br, jukka


|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Gambit Scheme for the iPhone and iPad

2011-06-05 Thread Jukka Tuominen

...
> 
> Next what Marc Feely's app needs is some sort of community, like 
> Scratch, so people can share their wizardry, but for that the 
> ability to organize and modularize scripts would need to be 
> improved.  The downside is if people get too clever, Apple could 
> get hyperparental and pull the plug.  So an Android app could be 
> useful too.
> 
> Geoffrey S. Knauth
> http://knauth.org/gsk
> 
... 

This is what Liitin (liitin.finndesign.fi) is trying to deliver - except that 
it uses Racket instead of Gambit :)

For the time being, there's only a native client for PC (bare metal + virtual 
machines like VirtualBox and VMWare), but through VNC it's accessible by 
virtually any terminal. In most cases it also proves to be a better approach 
since the computing power is elsewhere + faster network. The VNC resolution can 
be adjusted to any size, but usually the input method is the critical issue. 
For example, I can log into my Liitin account using my iPhone, but the 
resolution is small and 1/3 is taken by the virtual keyboard.

You can, however, access all the personal and public data and tools. And you 
could design an app optimized for mobile use. Everything produced in the mobile 
is also automatically available in all the other Liitin terminals (and vice 
versa). 

br, jukka


|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290 
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi 



_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


[racket] Modified #%top and namespaces

2011-04-13 Thread Jukka Tuominen

Hi,

as part of a visual programming study, I have a piece of code that generates
some GUI controls dynamically based on the number of arguments a procedure
takes. You can input a new procedure, and it will transform the GUI
on-the-fly accordingly.

The problem I have, is that the code works fine without #%top modification,
but with it, the statically and dynamically generated GUI objects cannot see
each other. I assume it's as a namespace issue. I have tried to direct
dynamic evals to current-namespace, but either I do something wrong or the
problem is elsewhere (or several places). AFAIU, the objective is to have
everything happen in a single namespace.

Some relevant parts/examples of the source code:

(define ns (current-namespace))

(define module-arguments-title; created one time only
(new
 vertical-panel%
 (parent module-arguments)
 (style '())
 (enabled #t)
 (vert-margin 0)
 (horiz-margin 0)
 (border 0)
 (spacing 0)
 (alignment (list 'center 'top))
 (min-width 0)
 (min-height 0)
 (stretchable-width #t)
 (stretchable-height #f)))

(define (name stem argument); helper to give names to dynamic gui objects
  (eval-string (string-append "'" stem "-" argument)))

(define (column3 argument); creates objects dynamically n times
(eval
 (list 'define (name "horizontal-argument-bar-column3" argument)
   (list
'new
'vertical-panel%
(list 'parent (name "horizontal-argument-bar" argument)); helper
used here
'(style '())
'(enabled #t)
'(vert-margin 0)
'(horiz-margin 0)
'(border 0)
'(spacing 0)
'(alignment (list 'center 'top))
'(min-width 0)
'(min-height 0)
'(stretchable-width #f)
'(stretchable-height #t)))
   ns))


Full source code: (for those with Liitin account)
(liitin:object-properties 'jtu100:object-properties-with-arguments~)

Once working, executing
(jtu100:object-properties-with-arguments~ " ")
and pressing [random content] button repeatedly will generate different
looking argument panel according to the content.

Any ideas how to solve the problem?


br, jukka


|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


[racket] Modifying source code, keeping comments and formatting intact

2011-04-04 Thread Jukka Tuominen

Hi,

I seem to be coming back to this problem repeatedly. I need to modify source
code by code so that the outcome is the modified  source code with the
original formatting and comments. For example...

BEFORE:
";; comment1
(list 'a ;comment2
  'b ;comment3 mentions 'a
  )"

>> (a b)

~TWEAK~ (add/remove/replace)

AFTER:
";; comment1
(list 'a ;comment2
  'b ;comment3 mentions 'a
  'c
  )"

>> (a b c)

So far I haven't been able to find any clever way to do this or seen how
others have done it. I was thinking about starting to solve the problem by
locating the position of interest with 'regexp-match-positions' or similar,
devide the source code into three parts: 'beginning, 'old-target, 'end and
after modifications reconstruct: 'beginning, 'modified-target, 'end.

Does this seem like a rational way to go forward, or is there a better way
to do it? I wonder how the DrRackect's 'rename' functionality is
implemented, for example (target inside correct scope, not part of comment)?

It would be great to have generic functions like source-car, source-cdr and
source-cons that would work as expected, but preserving the comments and
formatting :)

br, jukka


|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] Metadata idea

2011-03-31 Thread Jukka Tuominen

Second thought - to avoid any special system definitions, you could achieve
the same results as follows...

(define meta '((tooltip "This is a tooltip"); plain text
  (manual (fetch-manual-chapter 'object-x)); Rich-text format
  (self-test 'object-x); associated test cases to assure
   ...  ; bugfree and compatible updates
   ))

Then the helpers could do all the work needed.

br, jukka


> -Original Message-
> From: users-boun...@racket-lang.org
> [mailto:users-boun...@racket-lang.org]On Behalf Of Jukka Tuominen
> Sent: 31 March 2011 14:03
> To: users@racket-lang.org
> Subject: [racket] Metadata idea
>
>
>
> Hi,
>
> I've been thinking of adding the following metadata 'feature' to
> Liitin, but
> I wonder if this could be of more generic use. What do you think about the
> idea?
>
> (meta ((tooltip "This is a tooltip"); plain text
>(manual (fetch-manual-chapter 'object-x)); Rich-text format
>(self-test 'object-x); associated test cases to assure
>...  ; bugfree and compatible updates
>))
>
> e.g.
>
> (define (function-x args)
>   (define ...)
>   (meta ( ()()() ) )
>   (begin ...))
>
> Helpers:
> (meta-exist? object-source meta-type) >> true/false
> (get-meta object-source meta-type) >> meta-content
> (put-meta! object-source meta-type meta-content) >> modified object source
>
> - Object-source can be either provided as source code or as a reference
>   where to fetch it (incl. comments, formatting etc.)
>
>
> Features/ reasoning:
> - Object internal metadata information.
> - Self-contained, not requiring a special infrastructure.
> - Return actual metadata content rather than human navigated link.
> - Can refer to external objects to keep the main object compact,
>   and allow separate development for each metadata.
> - Could return localized versions (up to metadata provider).
> - Applications can utilize the metadata on-the-spot, without opening
>   external viewers or requiring human interaction (e.g. displaying tooltip
>   when hovering on top of a function, or offering extra functionality on
>   context menu).
> - 'define' level declaration.
> - Different object versions/variants are free to use common metadata.
>
> br, jukka
>
>
> |  J U K K A   T U O M I N E N
> |  m a n a g i n g   d i r e c t o r  M. A.
> |
> |  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
> |  mobile +358 50 5666290
> |  jukka.tuomi...@finndesign.fi  www.finndesign.fi
>
>
>
> _
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/users

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


[racket] Metadata idea

2011-03-31 Thread Jukka Tuominen

Hi,

I've been thinking of adding the following metadata 'feature' to Liitin, but
I wonder if this could be of more generic use. What do you think about the
idea?

(meta ((tooltip "This is a tooltip"); plain text
   (manual (fetch-manual-chapter 'object-x)); Rich-text format
   (self-test 'object-x); associated test cases to assure
   ...  ; bugfree and compatible updates
   ))

e.g.

(define (function-x args)
  (define ...)
  (meta ( ()()() ) )
  (begin ...))

Helpers:
(meta-exist? object-source meta-type) >> true/false
(get-meta object-source meta-type) >> meta-content
(put-meta! object-source meta-type meta-content) >> modified object source

- Object-source can be either provided as source code or as a reference
  where to fetch it (incl. comments, formatting etc.)


Features/ reasoning:
- Object internal metadata information.
- Self-contained, not requiring a special infrastructure.
- Return actual metadata content rather than human navigated link.
- Can refer to external objects to keep the main object compact,
  and allow separate development for each metadata.
- Could return localized versions (up to metadata provider).
- Applications can utilize the metadata on-the-spot, without opening
  external viewers or requiring human interaction (e.g. displaying tooltip
  when hovering on top of a function, or offering extra functionality on
  context menu).
- 'define' level declaration.
- Different object versions/variants are free to use common metadata.

br, jukka


|  J U K K A   T U O M I N E N
|  m a n a g i n g   d i r e c t o r  M. A.
|
|  Finndesign  Kauppiaankatu 13, FI-00160 Helsinki, Finland
|  mobile +358 50 5666290
|  jukka.tuomi...@finndesign.fi  www.finndesign.fi



_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


Re: [racket] racket and OS threads

2011-03-19 Thread Jukka Tuominen

Excellent, that did it. Thank you for the _instant_ support, Matthew!

One thing I noticed, is that when pressing the stop button in DrRacket, the OS 
process survived. I can't tell whether that's good or bad, just an observation.

Thanks again!
br, jukka

> -Original Message-
> From: Matthew Flatt [mailto:mfl...@cs.utah.edu]
> Sent: 19 March 2011 23:43
> To: Jukka Tuominen
> Cc: users@racket-lang.org
> Subject: Re: [racket] racket and OS threads
> 
> 
> That works for me in Mac OS X. For Linux, though, I have to enable
> subprocess groups with `(subprocess-group-enabled #t)'. I guess its a
> difference in how shells work.
> 
> At Sat, 19 Mar 2011 23:27:15 +0200, "Jukka Tuominen" wrote:
> > 
> > Still can't end the OS process. I wasn't sure where to place the
> > (current-subprocess-custodian-mode 'kill), but none (1-4) 
> worked. Is there
> > still hope to have it done from gracket?
> > 
> > Here's what I have tried:
> > 
> > ;(current-subprocess-custodian-mode 'kill);1
> > 
> > (define loop
> >   (lambda ()
> > (define cust (make-custodian))
> > (begin ;(current-subprocess-custodian-mode 'kill);2
> >(parameterize ((current-custodian cust)
> >   ;(current-subprocess-custodian-mode 'kill);3
> >   )
> >  (thread (lambda ()
> >(current-subprocess-custodian-mode 'kill);4
> >(system "gracket -f \"...rkt\""
> >(display "start")(newline)
> >(sleep 45)
> >(custodian-shutdown-all cust)
> >    (display "end")(newline)
> >(sleep 10)
> >(loop)
> >)))
> > 
> > br, jukka
> > 
> > >
> > >
> > > > -Original Message-
> > > > From: Matthew Flatt [mailto:mfl...@cs.utah.edu]
> > > > Sent: 18 March 2011 15:24
> > > > To: Jukka Tuominen
> > > > Cc: users@racket-lang.org
> > > > Subject: Re: [racket] racket and OS threads
> > > >
> > > >
> > > > Oh, you need to create a custodian, make it the current 
> custodian when
> > > > creating the thread (with `parameterize' and 
> `current-custodian'), and
> > > > then shut down with `custodian-shutdown-all' instead of 
> `kill-thread'.
> > > >
> > > > At Fri, 18 Mar 2011 15:17:30 +0200, "Jukka Tuominen" wrote:
> > > > >
> > > > > I tried first the original "system" procedure having
> > > > > (current-subprocess-custodian-mode 'kill) mode applied. But
> > > > that didn't have
> > > > > any effect on kill-thread, and for subprocess-kill I 
> should know the
> > > > > subprocess id, I guess?
> > > > >
> > > > > What am I missing here...?
> > > > >
> > > > > br, jukka
> > > > >
> > > > >
> > > > >
> > > > > > -Original Message-
> > > > > > From: Matthew Flatt [mailto:mfl...@cs.utah.edu]
> > > > > > Sent: 18 March 2011 15:02
> > > > > > To: Jukka Tuominen
> > > > > > Cc: users@racket-lang.org
> > > > > > Subject: Re: [racket] racket and OS threads
> > > > > >
> > > > > >
> > > > > > At Fri, 18 Mar 2011 14:57:34 +0200, "Jukka Tuominen" wrote:
> > > > > > > now the problem moved to converting the simple "system"
> > > > procedure to
> > > > > > > not-so-simple "subprocess" procedure.
> > > > > >
> > > > > > To use `current-subprocess-custodian-mode'? The 
> parameter applies to
> > > > > > `system', too.
> > > > > >
> > > > >
> > > > >
> > > > > _
> > > > >   For list-related administrative tasks:
> > > > >   http://lists.racket-lang.org/listinfo/users
> > > >
> > >
> > >
> > > _
> > >   For list-related administrative tasks:
> > >   http://lists.racket-lang.org/listinfo/users
> > 
> > _
> >   For list-related administrative tasks:
> >   http://lists.racket-lang.org/listinfo/users
> 


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


  1   2   >