Re: [racket-users] Differences running HtDP programs from DrRacket IDE vs racket command line

2020-10-06 Thread Nick Lee
Thanks again Robby! I will create issues on the drracket github issues page.

On Tuesday, October 6, 2020 at 9:23:49 AM UTC-4 Robby Findler wrote:

> On Tue, Oct 6, 2020 at 1:50 AM Nick Lee  wrote:
>
>> Thank you very much Robby for the quick reply! I should have mentioned 
>> that our students are using Beginning Student by setting the Language to 
>> that, rather than adding #lang htdp/bsl. 
>>
>
> Right, I got that. I merely meant to say that those are likely to be the 
> same bug.
>  
>
>> It appears this makes a difference. So the whole file looks like:
>>
>> ;; The first three lines of this file were inserted by DrRacket. They 
>> record metadata
>> ;; about the language level of this file in a form that our tools can 
>> easily process.
>> #reader(lib "htdp-beginner-reader.ss" "lang")((modname file) 
>> (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor 
>> repeating-decimal #f #t none #f () #f)))
>> (define (quasiquote x) x)
>> (define (f x) 123)
>> `(f 888)
>>
>> Running this file in command line with "racket file.rkt" doesn't show any 
>> errors for me. I'm using DrRacket 7.8 if it matters.
>>
>>
> Ah, oops. I had mistakenly tested with BSL+. I see this error too, now.
>
> Robby
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/f86ec3c9-e0c3-4616-b242-cc419ef33059n%40googlegroups.com.


Re: [racket-users] Differences running HtDP programs from DrRacket IDE vs racket command line

2020-10-06 Thread Nick Lee
Thank you very much Robby for the quick reply! I should have mentioned that 
our students are using Beginning Student by setting the Language to that, 
rather than adding #lang htdp/bsl. It appears this makes a difference. So 
the whole file looks like:

;; The first three lines of this file were inserted by DrRacket. They 
record metadata
;; about the language level of this file in a form that our tools can 
easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname file) 
(read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor 
repeating-decimal #f #t none #f () #f)))
(define (quasiquote x) x)
(define (f x) 123)
`(f 888)

Running this file in command line with "racket file.rkt" doesn't show any 
errors for me. I'm using DrRacket 7.8 if it matters.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/2b067e72-f364-4f20-a3b7-b0f2e5cc6513n%40googlegroups.com.


[racket-users] Differences running HtDP programs from DrRacket IDE vs racket command line

2020-10-05 Thread Nick Lee

Hello,
I noticed there are differences when I run HtDP programs in DrRacket IDE vs 
the "racket" command line.

For example, the following program's test passes in DrRacket IDE:

;; file.rkt - Set to Beginning Student
(check-expect (exact? (string->number "1.0")) true)

But when I run "raco test file.rkt", the test fails.

As another example, the follow Beginning Student program generates an error 
when run in DrRacket IDE (the error being read-syntax: illegal use of ```):

;; file.rkt - Set to Beginning Student
(define (quasiquote x) x)
(define (f x) 123)
`(f 888)

But when I run "racket file.rkt", no error is generated, and 123 is printed.

Is there a way I can run HtDP programs from the command-line and get 
behavior that's the same as when I click "Run" button in the IDE?

Thanks


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/21fffb90-1fb8-46bc-a772-121cb92da5cdn%40googlegroups.com.


Re: [racket-users] interactive window in slideshow

2016-06-11 Thread Nick
Just updated to 6.5 on Ubuntu, but I can't get a control to focus. My issue is 
similar to http://lists.racket-lang.org/users/archive/2011-May/045317.html, I 
have a dialog with a choice% in it, and no matter when or how I (send choice 
focus), the choice will never focus without me having to type tab first. I've 
tried focus'ing before show'ing the dialog, and tried focus'ing in the dialog's 
on-activate, to no avail. Is there a workaround? Is there at least a way to 
fake a Tab key-event to the dialog to achieve the same effect? For my project 
I'm really hoping to have fast, seamless keyboard input.

On Monday, March 28, 2016 at 5:06:24 PM UTC-7, Byron Davies wrote:
> Thanks for looking into it.  No great hurry.
> 
> For now,  I just tell the kindergartners to click twice the first time 
> around, but  it will be a lot clearer once the  fix happens.
> 
> > On Mar 28, 2016, at 4:34 PM, Matthew Flatt  wrote:
> > 
> > At Mon, 28 Mar 2016 11:53:38 -0700, Byron Davies wrote:
> >> I have a single interactive pasteboard on a slideshow slide.  For a 
> >> learning 
> >> task, the user needs to click on objects on the pasteboard.  There’s a 
> >> little 
> >> glitch, however.  The user must first click on the pasteboard to make it 
> >> the 
> >> focus, and then click on the objects.  Is there a way to make the 
> >> pasteboard 
> >> become the focus when the mouse moves into it?
> > 
> > You should be able to use the `focus` method on the canvas after its
> > frame is shown (via `on-superwindow-show`) or when a mouse event is
> > received (via `on-event`). See below for an example.
> > 
> > But I see that `focus` doesn't work right for a canvas in a floating
> > frame, like the one used by `interactive`, so the example below doesn't
> > work with the current release or snapshot. I've pushed a repair to
> > `focus` for the next snapshot build. I don't have a workaround for the
> > current version, but I might be able to find one if that's needed.
> > 
> > 
> > 
> > #lang slideshow
> > (require racket/gui/base)
> > 
> > (define (make-pasteboard f)
> >  (define c%
> >(class editor-canvas%
> >  (super-new)
> >  (inherit focus)
> >  (define/override (on-superwindow-show on?)
> >(when on?
> >  (focus))
> >(super on-superwindow-show on?
> >  (define pb (new pasteboard%))
> >  (send pb insert-box) ; to demonstrate focus
> >  (new c% [parent f] [editor pb])
> >  void)
> > 
> > (slide)
> > 
> > (slide
> > #:title "Example"
> > (interactive (blank 500 500)
> >  make-pasteboard))
> >

-- 
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's UDP Behavior

2016-04-12 Thread Nick Gordon
On Monday, April 11, 2016 at 1:41:57 PM UTC-5, Tony Garnock-Jones wrote:
> On 04/11/2016 01:52 PM, Nick Gordon wrote:
> > I'm building reliable data transfer onto Racket's UDP suite for a
> > term project, and I need to know what Racket does with corrupt
> > datagrams. Since the Racket docs don't mention the word checksum for
> > the UDP segment, I need to know some things:
> 
> The kernel discards corrupt UDP datagrams, so Racket doesn't see them.
> 
> There is certainly *no* automatic retransmission involved.
> 
> > I can't build reliable data transfer until I can be sure I'm not
> > losing datagrams in the ether, and I don't know how to accomplish
> > this. Is there a preferred workaround for this (as in continued
> > retransmission until the datagram successfully reaches its
> > destination)?
> 
> Yes, effectively this. I recommend reading up on protocols for achieving
> "reliable" delivery on unreliable networks. For example, look into how
> TCP works. (Bear in mind that UDP is basically the same thing as IP.)
> 
> One of your first tasks will be to decide what "reliable" means in your
> context. If you haven't seen it before, check out the
> Fischer-Lynch-Patterson Impossibility Result:
> http://the-paper-trail.org/blog/a-brief-tour-of-flp-impossibility/
> 
> Also, look into the Byzantine Generals problem:
> https://en.wikipedia.org/wiki/Byzantine_fault_tolerance
> 
> Once you understand why the Byzantine Generals problem has no solution,
> you can start to work toward making a decision about how your "reliable"
> system should behave in corner cases.
> 
> Tony

I haven't had the time to look up those theoretical results, but I definitely 
have taken your advice into account. It deviates slightly from the "ideal" 
design specification, but since we aren't actually rewriting the 
transport-level driver for our OS, we have to sort of "emulate" the system.
Thus, I am compensating for not being able to interact with corrupt datagrams 
by having each side of the program resend them whenever they detect a loss.

Thank you much!

-- 
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's UDP Behavior

2016-04-11 Thread Nick Gordon
I'm building reliable data transfer onto Racket's UDP suite for a term project, 
and I need to know what Racket does with corrupt datagrams. Since the Racket 
docs don't mention the word checksum for the UDP segment, I need to know some 
things:

* Does Racket just throw away corrupt datagrams?
** Does it then notify the program that's running (udp-receive!)?
* When it detects a corrupt datagram, does it do something as radical as 
contact the sender for retransmission? 

I can't build reliable data transfer until I can be sure I'm not losing 
datagrams in the ether, and I don't know how to accomplish this. Is there a 
preferred workaround for this (as in continued retransmission until the 
datagram successfully reaches its destination)?

Thanks,
Nick

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