Re: [racket-users] Re: Retina display for OpenGL

2019-08-06 Thread Kshitij Sachan
It looks like `get-gl-client-size` is meant for canvas objects. Is there a 
parallel function or any other way to get high resolution snips?

On Saturday, August 3, 2019 at 1:44:10 PM UTC-4, Jay McCarthy wrote:
>
> There's two steps to using the hires mode on OS X. 
>
> First, you need the OpenGL configuration to be in hires-mode. 
>
> Second, you need to set the viewport in your OpenGL code to the result 
> of `get-gl-client-size`, not `get-scaled-client-size` or 
> `get-client-size`, which are all very similarly sounding functions. 
>
> -- 
> Jay McCarthy 
> Associate Professor @ CS @ UMass Lowell 
> http://jeapostrophe.github.io 
> Vincit qui se vincit. 
>
>
> -- 
> Jay McCarthy 
> Associate Professor @ CS @ UMass Lowell 
> http://jeapostrophe.github.io 
> Vincit qui se vincit. 
>
>
> On Thu, Aug 1, 2019 at 10:39 AM 'Mark Warren' via Racket Users 
> > wrote: 
> > 
> > That's a shame, I'm afraid I'm out of ideas then. Hopefully someone else 
> will know. 
> > 
> > On Thursday, 1 August 2019 14:36:07 UTC+1, Kshitij Sachan wrote: 
> >> 
> >> I've set up an OpenGL context that is displayed in a snip (I chose a 
> snip because I want to be able to move the camera around and generally 
> respond to user input). However, I've noticed that the OpenGL context in 
> Racket looks considerably worse than when I run the same OpenGL code in C++ 
> (the racket code is actually calling a C library function using the FFI). 
> >> 
> >> I believe this is because the Racket snip isn't able to take advantage 
> of the Retina display on my Mac. Is this the correct reason, and if so, is 
> there any way to fix this and make the quality better? 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/0452ca69-81f7-45e0-9718-3ca95a42ce68%40googlegroups.com.
>  
>
>

-- 
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/e31ae83a-715b-4bd4-bf8e-66ca1b4d3639%40googlegroups.com.


Re: [racket-users] [racket users] module question

2019-08-06 Thread Sorawee Porncharoenwase
You need:

(module B racket
  (require (submod ".." A))
  (printf "X=~a~%" X))


On Tue, Aug 6, 2019 at 3:58 PM Kevin Forchione  wrote:

> Is there a way to define 2 modules within a file and reference them or is
> a file limited to 1 module only (but may have multiple submodules)?
>
> Here’s a small sample:
>
> #lang racket
>
> (module A racket
> ˘  (provide X)
>   (define X 'foo))
>
> (module B racket
>   (require 'A)
>   (printf "X=~a~%" X))
>
> Apparently, as I understand it, I’m already nesting modules within the
> #lang racket. But I’m not sure how to require A from within B in this
> situation.
>
> Kevin
>
> --
> 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/6326DC5D-44D5-4CE9-B2B8-E781A6D51561%40gmail.com
> .
>

-- 
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/CADcuegtEv-i5-j%2BnnKpKANAspGLiVDwrJ_sbBxKhvhBv%3D7oLag%40mail.gmail.com.


[racket-users] [racket users] module question

2019-08-06 Thread Kevin Forchione
Is there a way to define 2 modules within a file and reference them or is a 
file limited to 1 module only (but may have multiple submodules)?

Here’s a small sample: 

#lang racket

(module A racket
˘  (provide X)
  (define X 'foo))

(module B racket
  (require 'A)
  (printf "X=~a~%" X))

Apparently, as I understand it, I’m already nesting modules within the #lang 
racket. But I’m not sure how to require A from within B in this situation. 

Kevin

-- 
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/6326DC5D-44D5-4CE9-B2B8-E781A6D51561%40gmail.com.


Re: [racket-users] Re: gui widgets over canvas

2019-08-06 Thread Neil Van Dyke

Hendrik Boom wrote on 8/6/19 4:03 PM:

Be careful.  You might hit such limits, and your interfaces might behave in 
dangerous ways.


Thanks for the warning.  I've seen a lot of such limits in various GUI 
toolkits, and, when you have a cross-platform layer over it, you have to 
do a combination of both anticipating limits, and then testing on all 
the platforms to see if you missed anything.  That's in addition to 
testing for various non-limit quirks of the platform, which over time 
the cross-platform layer has gotten tweaked for, but you can still run 
into things that haven't already been exercised through the layer.


(Other ones most immediately in mind are any kind of large 
list/table/tree widget -- even if the layer offers some kind of 
model-view linking that looks like it can page in data from the model 
on-demand, the way the layer uses the underlying widget might just be to 
load the entire model into storage controlled by the native widget.  I'm 
also suspicious of letting every native toolkit do a large scrolling 
canvas on its own, and I expect some to have small limits there, and for 
it to also do things like buffering very large pixmaps for the entire 
coordinate system or bounding box, so I'd prefer it just gave me a 
viewport and drawing&scrolling callbacks.  And, of course, perhaps most 
toolkits don't scale well to millions of widgets in a spreadsheet, even 
though there's no reason you couldn't make one that does scale, it was 
almost never a requirement.  We can guess what a lot of the things to 
test will be, and try to avoid them, but still have to test whatever we 
do write, on everything.)


--
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/454e15c6-4aa8-3abe-9803-a8bfd9ba1fd7%40neilvandyke.org.


Re: [racket-users] Re: Do custodians shutdown when Racket exits?

2019-08-06 Thread George Neuner


On 8/6/2019 1:54 PM, Tony Garnock-Jones wrote:

On Tuesday, August 6, 2019 at 6:27:51 PM UTC+1, David Storrs wrote:

I should mention that the reason I'm looking into this is because
I have UDP sockets that are not getting closed.  They are managed
by custodians, but the custodians are not releasing them; I take
this to mean that the custodians are not being run.


How can a UDP socket survive process exit?


Sockets belonging to the crashed program are in a "half-closed" state - 
unable to send, but still able to receive.  If you look in netstat 
you'll find their status is stuck in TIME_WAIT or in SYN or SYN/ACK.  
There is a delay in cleaning up such "half-closed" sockets.  The delay 
is (derived from) a system wide parameter, and typically the wait time 
is on the order of 180 seconds.


For most sockets it doesn't matter, but for a receiving "listen" 
socket,  you need to set the  SO_REUSEADDR  option to be able to reuse 
the same ipaddr:port combination again without waiting for cleanup.  
SO_REUSEADDR  doesn't actually change the system's cleanup behavior - it 
simply says that the system can ignore "already exists" errors when 
trying to create a new socket.



That said ... I thought Racket set  SO_REUSEADDR  automagically when you 
create listen sockets.


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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/c43bb573-9722-5a04-240a-004621ea96a5%40comcast.net.


Re: [racket-users] Re: gui widgets over canvas

2019-08-06 Thread Hendrik Boom
On Tue, Aug 06, 2019 at 02:03:14AM -0400, Neil Van Dyke wrote:
> Thank you, Alex.  I'll take another look at using `panel%` that way.  (I
> wasn't sure that would work well on all platforms, because its own
> implementation has special-cases for its stock subclasses, which conceivably
> might be necessary on some platforms.)
> 
> Regarding scrollbars, I might end up abusing the native ones, to look still
> native but make scrolling less jumpy on all platforms when there's a million
> rows.  We'll see how well it works without tweaking on various platforms in
> practice, and then what the priority is.

A long long time ago I had a scroll region in a gtk app.  However, it 
turned out that the scroll region was limited to something like 32K or 
64K pixels.  Evidently it was limiting pixel counts to 16-bit words.
I could not find this limit in any user documentation.

I have since asked about such limits in newer versions of gtk.  I have 
never received a reply.

Be careful.  You might hit such limits, and your interfaces might 
behave in dangerous ways.

-- hendrik

-- 
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/20190806200309.n25ifemlwh7srbsg%40topoi.pooq.com.


Re: [racket-users] Re: Do custodians shutdown when Racket exits?

2019-08-06 Thread James Platt


On Aug 6, 2019, at 1:54 PM, Tony Garnock-Jones wrote:

> How can a UDP socket survive process exit?
> 

I don't knot but this appears to happen.  On macOS, the open port shows in 
netstat but not lsof.  You can find the process ID with netstat but then, when 
you go to kill it, kill says there is no such process.  The important this is, 
of course, that trying to run another process with that port will fail.


Note that netstat on macOS does not have all the same command flags as the 
Linux version but you can see pids using:
netstat -anv


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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/7EED97D1-B5AF-4DDF-A5D0-5E47314B04DF%40biomantica.com.


[racket-users] Re: Do custodians shutdown when Racket exits?

2019-08-06 Thread Tony Garnock-Jones
On Tuesday, August 6, 2019 at 6:27:51 PM UTC+1, David Storrs wrote:
>
> I should mention that the reason I'm looking into this is because I have 
> UDP sockets that are not getting closed.  They are managed by custodians, 
> but the custodians are not releasing them; I take this to mean that the 
> custodians are not being run.
>

How can a UDP socket survive process exit?

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/82ffed10-0cb5-42e3-ba99-66a25f1429a2%40googlegroups.com.


Re: [racket-users] Re: Do custodians shutdown when Racket exits?

2019-08-06 Thread Sorawee Porncharoenwase
I have a similar question on will executor. It doesn't seem to get run on
program exiting/breaking. Do I need a plumber that calls `collect-garbage`?

On Tue, Aug 6, 2019 at 10:27 AM David Storrs  wrote:

> I should mention that the reason I'm looking into this is because I have
> UDP sockets that are not getting closed.  They are managed by custodians,
> but the custodians are not releasing them; I take this to mean that the
> custodians are not being run.
>
> On Tue, Aug 6, 2019 at 1:06 PM David Storrs 
> wrote:
>
>> A bunch of reading through docs suggests that custodians do not
>> automatically run when Racket exits and that if I want them to then I
>> should either use a plumber (which is not guaranteed to run if there's a
>> segfault) or register the custodian with the ffi/unsafe/custodian module (
>> http://web.mit.edu/racket_v612/amd64_ubuntu1404/racket/doc/foreign/Custodian_Shutdown_Registration.html)
>> Is that right, or is there something I'm missing?
>>
> --
> 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/CAE8gKofYd5Uv4JWCbwjrHnmJuc%3DV%2BjVHWTwRxB9kdF1LsinEKg%40mail.gmail.com
> 
> .
>

-- 
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/CADcuegvhrpb-%2B%2BvJbEqLMOv%2B7Jz1sywkfjkfX9EbXcon7y3RAg%40mail.gmail.com.


[racket-users] Re: Do custodians shutdown when Racket exits?

2019-08-06 Thread David Storrs
I should mention that the reason I'm looking into this is because I have
UDP sockets that are not getting closed.  They are managed by custodians,
but the custodians are not releasing them; I take this to mean that the
custodians are not being run.

On Tue, Aug 6, 2019 at 1:06 PM David Storrs  wrote:

> A bunch of reading through docs suggests that custodians do not
> automatically run when Racket exits and that if I want them to then I
> should either use a plumber (which is not guaranteed to run if there's a
> segfault) or register the custodian with the ffi/unsafe/custodian module (
> http://web.mit.edu/racket_v612/amd64_ubuntu1404/racket/doc/foreign/Custodian_Shutdown_Registration.html)
> Is that right, or is there something I'm missing?
>

-- 
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/CAE8gKofYd5Uv4JWCbwjrHnmJuc%3DV%2BjVHWTwRxB9kdF1LsinEKg%40mail.gmail.com.


Re: [racket-users] [racket users] make-posn question

2019-08-06 Thread Nadeem Abdul Hamid
Probably
(require lang/posn)
--- nadeem


On Tue, Aug 6, 2019 at 1:19 PM Kevin Forchione  wrote:

> Hi guys,
> I love working with the 2htdp/universe and 2htdp/image packages. But
> polygon requires posts (and some of the other functions do too).
> 2htdp/image doesn’t include a definition. What’s the best library to
> require for these? I tried making my own struct and was surprised that the
> function didn’t like it. Apparently it wants a specific post?
>
> Kevin
>
> --
> 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/D69DC921-5529-49DF-9F60-ACA4FC317191%40gmail.com
> .
>

-- 
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/CABB5Xb95bfzX58AwVk6ybj8jGJxe9tohbwkooiTTqTC_AHjHkw%40mail.gmail.com.


[racket-users] [racket users] make-posn question

2019-08-06 Thread Kevin Forchione
Hi guys, 
I love working with the 2htdp/universe and 2htdp/image packages. But polygon 
requires posts (and some of the other functions do too). 2htdp/image doesn’t 
include a definition. What’s the best library to require for these? I tried 
making my own struct and was surprised that the function didn’t like it. 
Apparently it wants a specific post? 

Kevin 

-- 
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/D69DC921-5529-49DF-9F60-ACA4FC317191%40gmail.com.


[racket-users] Re: pict superimpose documentation

2019-08-06 Thread 'Joel Dueck' via Racket Users
The example code using the blue circle and the red rectangle makes it 
pretty clear. Each pict gets covered up by the one to its right in the 
argument list.

On Saturday, August 3, 2019 at 6:14:13 PM UTC-5, Hendrik Boom wrote:
>
> The documentation in 
> https://docs.racket-lang.org/pict/Pict_Combiners.html for the various 
> superpose combiers does not specify with argument picts cover which 
> other argument picts. 
>
> -- hendrik 
>
>

-- 
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/79d32cbf-bf8a-413a-b443-50c7a0c7%40googlegroups.com.


[racket-users] Do custodians shutdown when Racket exits?

2019-08-06 Thread David Storrs
A bunch of reading through docs suggests that custodians do not
automatically run when Racket exits and that if I want them to then I
should either use a plumber (which is not guaranteed to run if there's a
segfault) or register the custodian with the ffi/unsafe/custodian module (
http://web.mit.edu/racket_v612/amd64_ubuntu1404/racket/doc/foreign/Custodian_Shutdown_Registration.html)
Is that right, or is there something I'm missing?

-- 
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/CAE8gKocOt5gjp17pZaVYtq4ZFzYnWhncsm913Wv2RKhnZiNg7Q%40mail.gmail.com.


Re: [racket-users] Re: Alternative UI toolkits

2019-08-06 Thread Aidan Gauland
That would be Electron , for which I think
Racket would be a /really/ awkward fit, but if anyone has a crack at it,
I'd be very interested to see the result.

On 6/08/19 9:06 AM, Stephen De Gabrielle wrote:
> Sorry, I meant whatever is used to make Visual Studio Code, and
> whatever the Mozilla equivalent is.
>
> s.
>
> On Monday, August 5, 2019 at 6:07:34 PM UTC+1, Neil Van Dyke wrote:
>
> XUL itself is deprecated/dead.  There might be an interesting (but
> niche) Racket opportunity with WebExtensions, and you might want
> to wait
> to see how they decide WASM fits into that, and what Racket's WASM
> story
> becomes.
>
> Also, bit of gut-feel speculation... There's some odd
> noises/rumblings
> going on with browser extensions (and PR of same) in recent
> months, and
> a few I noticed in the last week.  Anyone contemplating a new project
> based on browser extensions should consider that the rules might be
> changing soon, more likely than in the past.  (Beyond Chrome
> anti-ad-blocking moves, which also was a gift to Mozilla when they
> needed it.  But possibly other restrictions, such as in what else
> extensions can do, and on who can effectively publish what
> extensions. 
> And maybe an improved or new monetization option.)
>
> -- 
> 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/c22cff90-2db7-401d-8965-4f093921222d%40googlegroups.com
> .

-- 
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/ee6cda7d-5371-b609-bbc7-4bdf31747b37%40fastmail.net.