Re: [racket-users] Menu bar won't show

2017-08-14 Thread James

> I suspect the confusion is that on Mac OS, the menu-bar% is drawn at the top 
> of the screen (the same as DrRacket's "File" menu etc.), not inside the 
> window itself. This code is working for me with Racket 6.9 on Mac OS 10.12.5.
> 
> -Philip

Yes.  Thanks.  You're exactly correct.  It is actually a good thing that it 
puts the menus in the correct OS specific context except that part of the 
confusion here is that the left most menu still says "DrRacket" ( or "racket" 
if run from the terminal) when this normally identifies the running program.  
Is there a simple way to give my program a name which will display there?

James

-- 
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] Menu bar won't show

2017-08-14 Thread Philip McGrath
I suspect the confusion is that on Mac OS, the menu-bar% is drawn at the
top of the screen (the same as DrRacket's "File" menu etc.), not inside the
window itself. This code is working for me with Racket 6.9 on Mac OS
10.12.5.

-Philip

On Mon, Aug 14, 2017 at 7:09 PM, James  wrote:

> I'm having trouble getting a simple example of a menu bar to work.  The
> window appears with the correct frame size but no menus.  This happens
> whether I follow the example on the Stack Overflow page below or the
> example code I have shown below.  Is this a bug or do I need to do
> something more to make the menu bar show?  I am using DrRacket 6.10 macOS
> 10.11.6 "El Capitan."  To be on the safe side, I also tried it on an older
> machine with Racket 6.6 and Mac OS X 10.6.8 "Snow Leopard" but I got the
> same result.
>
> https://stackoverflow.com/questions/37583997/basic-code-
> editor-functionality-in-racket
>
> ;Example code:
>
> #lang racket
>
> (require racket/gui)
>
> (define frame (new frame%
>  [label "Example"]
>  [width 600]
>  [height 300]))
>
>
> (define menu-bar (new menu-bar%
>   (parent frame)))
> (define file-menu (new menu%
>  (label "")
>  (parent menu-bar)))
>
> (define edit-menu (new menu%
>  (label "")
>  (parent menu-bar)))
>
> (define help-menu (new menu%
>  (label "")
>  (parent menu-bar)))
>
> (new menu-item%
>  (label "Foo")
>  (parent file-menu)
>  (callback (lambda (x y) x)))
>
> ;(send menu-bar enable #t)
> (send frame show #t)
>
> --
> 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] Menu bar won't show

2017-08-14 Thread James
I'm having trouble getting a simple example of a menu bar to work.  The window 
appears with the correct frame size but no menus.  This happens whether I 
follow the example on the Stack Overflow page below or the example code I have 
shown below.  Is this a bug or do I need to do something more to make the menu 
bar show?  I am using DrRacket 6.10 macOS 10.11.6 "El Capitan."  To be on the 
safe side, I also tried it on an older machine with Racket 6.6 and Mac OS X 
10.6.8 "Snow Leopard" but I got the same result. 

https://stackoverflow.com/questions/37583997/basic-code-editor-functionality-in-racket

;Example code:

#lang racket

(require racket/gui)

(define frame (new frame%
 [label "Example"]
 [width 600]
 [height 300]))


(define menu-bar (new menu-bar%
  (parent frame)))
(define file-menu (new menu%
 (label "")
 (parent menu-bar)))

(define edit-menu (new menu%
 (label "")
 (parent menu-bar)))

(define help-menu (new menu%
 (label "")
 (parent menu-bar)))

(new menu-item%
 (label "Foo")
 (parent file-menu)
 (callback (lambda (x y) x)))

;(send menu-bar enable #t)
(send frame show #t)

-- 
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: Need help with parallelizing a procedure

2017-08-14 Thread George Neuner
On Mon, 14 Aug 2017 13:04:36 -0700 (PDT), Zelphir Kaltstahl
 wrote:

>I tried with feature-visualizer, but did not save screenshots of 
>the result. Would it help showing them? I was not able to figure
>out the problem, even when clicking the red dots to see what is
>blocking. It made no sense to me, that those operations were
>blocking.

Believe me, I don't understand it very much better.  I rarely use
futures ... a long time ago I came to the conclusion that pretty much
anything other than pure arithmetic or logic is suspect.

>However, I tried a lot of things and don't remember what procedures
>were blocking in which case. I remember, that I once tried to use
>flonum operations and that even they were shown to be blocking,
>while they solved the problem in the guide for parallelization in Racket.

One thing you can try is using 'would-be-future' instead of 'future'.
https://docs.racket-lang.org/reference/futures.html?q=would-be-futures#%28def._%28%28lib._racket%2Ffuture..rkt%29._would-be-future%29%29

'would-be-future' is a debugging form - it creates a pseudo future
that won't be executed in parallel, but when evaluated it logs unsafe
operations that might cause it to block if the evaluation _were_ done
in parallel.
[As long as you don't force [touch] it ... to get the logging you have
to let it be evaluated by the future mechanism AS IF it were a real
future.]

George

-- 
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: Need help with parallelizing a procedure

2017-08-14 Thread Zelphir Kaltstahl
Thanks for the example code, I'll try it soon!

The whole code is on my repository at:

  https://github.com/ZelphirKaltstahl/racket-ml/blob/master/decision-tree.rkt

I tried with feature-visualizer, but did not save screenshots of the result. 
Would it help showing them? I was not able to figure out the problem, even when 
clicking the red dots to see what is blocking. It made no sense to me, that 
those operations were blocking. However, I tried a lot of things and don't 
remember what procedures were blocking in which case. I remember, that I once 
tried to use flonum operations and that even they were shown to be blocking, 
while they solved the problem in the guide for parallelization in Racket.

When I ran my whole decision tree program with some example data and the 
statistical profiler package, I found that the algorithm spent most time as 
follows (for the code in the repository, possibly dev branch):

- data-majority-prediction = 15084(32.4%)
- calc-proportion  = 15656(33.6%)
- get-best-split   = 4304(9.2%)
- gini-index   = ??? (but is part of get-best-split)

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