unchartedworks
2017-8-25 09:19:17

@unchartedworks has joined the channel


leif
2017-8-25 14:18:44

Is it possible to get a conversion from slideshow pixels to your OS+Monitors pixels?


leif
2017-8-25 14:18:58

Like, as a function or just a number.


leif
2017-8-25 14:19:14

I ask because I need to convert a slideshow rect into an interactive rect.


leif
2017-8-25 14:19:22

@mflatt or @robby one of you might know?


leif
2017-8-25 14:20:27

I see size-in-pixels, but that looks like its going the other way


robby
2017-8-25 14:21:33

Interactive’s argument gets a frame. Fill it with a canvas. The canvas will be the right size


robby
2017-8-25 14:21:54

I don’t believe you have to do any conversion.


robby
2017-8-25 14:21:57

At least I don’t.


leif
2017-8-25 14:22:46

Interesting. Do you think that is also true for an opengl canvas?


leif
2017-8-25 14:23:05

(I say that because I’m getting OpenGL contexts of a different sizes.)


leif
2017-8-25 14:23:25

Depending on the pixel density of the monitor I’m using.


leif
2017-8-25 14:24:13

Where a lower pixel density producers a smaller image…


leif
2017-8-25 14:24:28

(Or larger, I forget which way is which, but either way, it is consistent.)


leif
2017-8-25 14:24:42

Ah, higher is smaller.


robby
2017-8-25 14:25:04

I haven’t tried opengl


leif
2017-8-25 14:25:28

Alright, thanks anyway. :slightly_smiling_face:


mflatt
2017-8-25 14:32:30

@leif The canvas% class provides a get-gl-client-size method


mflatt
2017-8-25 14:33:10

You can compare that result to the get-client-size result


leif
2017-8-25 14:37:18

@mflatt Oh cool thanks.


leif
2017-8-25 14:45:08

@mflatt oh ineresting, they appear to be the same numbers.


leif
2017-8-25 14:46:24

Its still kindof odd I only get this problem with slideshow. Like when I use a canvas outside of slideshow it is scaled as expected.


leif
2017-8-25 15:04:39

@mflatt According to both get-gl-client-size and get-client-size, the size of the canvas% is 450x300


leif
2017-8-25 15:05:25

BUT, the actual amount of pixels given ~1.5x as much, at about 600x400


leif
2017-8-25 15:05:49

So it looks like get-client-size is still giving me the scaled amount, rather then the actual physical amount.


leif
2017-8-25 15:09:25

Odd…even get-scaled-client-size returns 450x300.


leif
2017-8-25 15:11:20

@mflatt AH, okay, I got it.


leif
2017-8-25 15:11:41

It looks like the interactive call actually allocates a frame that can have a different resolution than the one you requested.


leif
2017-8-25 15:11:56

And so you should base it off of the given width and height, rather than the one you requested.


leif
2017-8-25 15:12:00

That worked. Thanks.


lexi.lambda
2017-8-25 18:36:38

is there a faster way to read from an input port until a nul byte besides looping with read-byte?


lexi.lambda
2017-8-25 18:37:09

I don’t know if that is slow, per se, but I’m not sure if there is a better way


lexi.lambda
2017-8-25 18:38:56

I guess read-bytes-avail!* could be faster if I really needed maximum speed, but that would make it possible to over-read, while read-line only ever reads up to a newline?


jaz
2017-8-25 18:41:45

Yeah, my recollection is that reading a byte at a time is pretty slow in Racket, comparatively. A fast-as-possible solution (without over-reading) might involve peak-bytes-avail!… maybe… Haven’t tried it.


lexi.lambda
2017-8-25 18:43:14

it probably doesn’t matter much for what I’m working on, since this is just a little script I’m running myself, but it would be nice to shave this yak :)


lexi.lambda
2017-8-25 18:47:55

I think the easiest way to do it, from a programming-effort POV, might actually be to use a regexp.


lexi.lambda
2017-8-25 18:56:08

yes, (regexp-match (byte-pregexp #"^([^\0]*)\0") port) seems to work, and it’s definitely fast enough for my needs :)


asumu
2017-8-25 21:16:31

Is it just me or is the #irc bridge not actually working?


notjack
2017-8-25 21:21:17

@asumu I think it’s been semi-broken for a while, with intermittent spurts of actually working


notjack
2017-8-25 21:21:41

does anyone know who maintains it?


leif
2017-8-26 01:35:42

Is there any way to run code right before a module instance gets collected?


leif
2017-8-26 01:36:21

I don’t care if it doesn’t get run and the program stops, I just want to inform some FFI code that a closure that was once available no longer is.


leif
2017-8-26 01:36:58

About all I got right now is have a will executor attached to a variable in the module, and hope that it will only get collected when the module itself is collected.


samth
2017-8-26 02:02:21

Why can’t you attach the will-executor to the thing you’re concerned about?


leif
2017-8-26 03:48:16

Ah, okay, that should work. :slightly_smiling_face:


kspaans
2017-8-26 05:15:06

@kspaans has joined the channel