Re: [racket-users] Re: stumped

2017-12-13 Thread Stephen De Gabrielle
Thanks Alex,
Much appreciated!
Stephen
On Thu, 14 Dec 2017 at 04:50, Alex Harsanyi  wrote:

> I built a similar control, although it does not represent directory paths,
> just labels which are stacked vertically. I ended up defining a structure
> to hold the text and width + height of each label and keep these structures
> in a list. In my case, all labels have the same size so converting a mouse
> coordinate to a list index is just arithmetic, but it could be extended to
> support variable width labels and just search the list in linear time to
> convert a mouse coordinate to a list index. The number of items in the
> control should be small enough that linear search should not be a
> disadvantage.
>
> You can find the definition of the control here:
>
> https://github.com/alex-hhh/ActivityLog2/blob/master/rkt/widgets.rkt#L1910
>
> To convert it to variable width labels, the `hover-candiate` function
> would have to be changed (third `cond` option) to do a linear search on the
> label widths. `label-box-dimensions` would also have to change to report
> the actual label width and height for all labels (currently all labels have
> the dimensions of the largest one).
>
> Best Regards,
> Alex.
>
> --
> 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.
>
-- 
Kind regards,
Stephen
--
Ealing (London), UK

-- 
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: stumped

2017-12-13 Thread Alex Harsanyi
I built a similar control, although it does not represent directory paths, 
just labels which are stacked vertically. I ended up defining a structure 
to hold the text and width + height of each label and keep these structures 
in a list. In my case, all labels have the same size so converting a mouse 
coordinate to a list index is just arithmetic, but it could be extended to 
support variable width labels and just search the list in linear time to 
convert a mouse coordinate to a list index. The number of items in the 
control should be small enough that linear search should not be a 
disadvantage.

You can find the definition of the control here:

https://github.com/alex-hhh/ActivityLog2/blob/master/rkt/widgets.rkt#L1910

To convert it to variable width labels, the `hover-candiate` function would 
have to be changed (third `cond` option) to do a linear search on the label 
widths. `label-box-dimensions` would also have to change to report the 
actual label width and height for all labels (currently all labels have the 
dimensions of the largest one).

Best Regards,
Alex.

-- 
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: Best way to deploy to the package server if the module relies on a DB?

2017-12-13 Thread Jack Firth
In my fixture  package I'm 
attempting to (hopefully) make this sort of thing easier for RackUnit-based 
tests (see this github issue 
), so if you're 
using RackUnit I'm interested in seeing what your tests look like and how 
you go about setting up a database for them.

-- 
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] Best way to deploy to the package server if the module relies on a DB?

2017-12-13 Thread David Storrs
Great, thanks.

On Wed, Dec 13, 2017 at 6:24 PM, Sam Tobin-Hochstadt
 wrote:
> I recommend the techniques described here:
> http://pkg-build.racket-lang.org/about.html under "dealing with test
> failures".
>
> Sam
>
> On Wed, Dec 13, 2017 at 6:21 PM, David Storrs  wrote:
>> I have some code that I'd like to release that relies on having a
>> database available.  I know that the package server regularly runs
>> tests for the packages, and presumably there won't be a writable DB
>> available on the package server.  What is the best way to handle this?
>>
>> --
>> 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] Best way to deploy to the package server if the module relies on a DB?

2017-12-13 Thread Sam Tobin-Hochstadt
I recommend the techniques described here:
http://pkg-build.racket-lang.org/about.html under "dealing with test
failures".

Sam

On Wed, Dec 13, 2017 at 6:21 PM, David Storrs  wrote:
> I have some code that I'd like to release that relies on having a
> database available.  I know that the package server regularly runs
> tests for the packages, and presumably there won't be a writable DB
> available on the package server.  What is the best way to handle this?
>
> --
> 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] Best way to deploy to the package server if the module relies on a DB?

2017-12-13 Thread David Storrs
I have some code that I'd like to release that relies on having a
database available.  I know that the package server regularly runs
tests for the packages, and presumably there won't be a writable DB
available on the package server.  What is the best way to handle this?

-- 
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] stumped

2017-12-13 Thread Stephen De Gabrielle
Hi,

I'm working on a 'directory' like you would find in VScode, xcode, or clion*
https://github.com/spdegabrielle/dir-control/blob/master/dir-control.rkt

I's pretty enough, but 'm not sure how to best to store the values against
the respective parts of the control, so they can be passed via a callback.

I'd appreciate any suggestions!

* https://www.jetbrains.com/help/clion/navigation-bar.html

Kind regards,

Stephen

​

-- 
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: Confirming when garbage collection runs

2017-12-13 Thread David Storrs
Sorry, bumped 'send' by mistake

Imagine I do this:

(struct fruit (num))
(define (foo) (make-list 1 (fruit 7)))
(define (bar) (map (compose add1 fruit-num) (foo)))

(submit-job! (thunk (bar)))

I think that the above is roughly equivalent to doing this:

(thread (thunk (bar) (sleep )))

If I'm understanding things correctly, the structs that were created
in (foo) will be up for garbage collection when (bar) exits, even
though the worker thread continues to run.  Is that right?

-- 
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] Confirming when garbage collection runs

2017-12-13 Thread David Storrs
I'm using the job-queue module
(https://docs.racket-lang.org/job-queue/index.html) and want to
confirm that I understand the memory management implications

Imagine I do this:

 (struct fruit (num))
 (define (foo) (make-list 1 (fruit 7)))
 (define (bar) (map (compose add1 fruit-num) (foo)))

(

-- 
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] Not a rant at all!

2017-12-13 Thread Gregor Kopp
Hi!
I just wanted to say that the whole racket system (including dr. racket) is 
by far my most liked programming system I've ever tried.
I'm a hobby programmer and the glitchless ide combined with the very huge 
documentation makes me wonder why I'm not using it since ever ;)
Sometimes I'm in trouble to understand some concepts, but it gets better 
with every small project I'm doing.

Thank you for this awesome package!

Gregor

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