[racket-users] Re: raco docs only sometimes installed?

2021-10-20 Thread schle...@gmail.com
I am not sure what your intent is with 2 exactly.
Is it to install the package you have checked out with git?
If that's the case change the sequence to:

git clone https://github.com/rebcabin/bleir-sandbox.git
cd bleir-sandbox
git checkout master
raco pkg install
raco setup bleir-sandbox
raco test bleir-sandbox
raco docs bleir-sandbox

`raco setup bleir-sandbox` shouldn't be necessary because raco pkg install 
would already do that after linking the local package source, but you can 
use that in case you modify the source locally to regenerate the docs.
`raco pkg install` installs/links the folder where you are at as a package 
(usually for development of packages).
While `raco pkg install bleir-sandbox` installs the package from the 
package index and `cd ..` followed by `raco pkg install ./bleir-sandbox` 
would install the local subdirectory as a linked package.

Lastly if creating a local checkout for development is your intent you can 
shorten it to:
raco pkg install --clone https://github.com/rebcabin/bleir-sandbox.git
raco test bleir-sandbox
raco docs bleir-sandbox

This uses the collection names for test and docs commands because they 
automatically point towards the installed package.
If you install a local directory with `raco pkg install 
` or `raco pkg install` 
within a folder, you can also do `raco test ./bleir-sandbox` or `raco test 
.` respectively.

For the packages where the docs don't work, can you execute `raco setup 
collection-name` and see/post whether that command outputs any errors?

I have had the case where racket was installed in a way that `raco setup` 
was unable to write to the directories where it tries to generate its docs 
occasionally, but that is highly dependent on the linux distribution and 
how its racket installation is setup. If the default racket install on 
ubuntu doesn't work for some reason you could always try to install racket 
locally somewhere in your home directory an test whether it works with that 
racket version, if it works with the local one, but not the ubuntu one, 
then I am not sure what is going on.
Because I was assuming the ubuntu package should be setup correctly.
Maybe it is setup in a way where raco setup requires sudo / root, in that 
case I might try to change the permissions so that root is not required, 
but I am not on ubuntu, so you should get tips from somebody else for that, 
probably. 
You can do a local install by downloading racket from the website, using 
the installer and choosing local install.

Hope this wasn't confusing and helped you.
Anyways I think for development of packages --clone is the way to go, see 
the docs at: 
https://docs.racket-lang.org/pkg/cmdline.html#%28part._raco-pkg-install%29

Simon

bc.be...@gmail.com schrieb am Mittwoch, 20. Oktober 2021 um 02:09:24 UTC+2:

> I am having problems installing raco docs, meaning I want 
>
> raco docs foo-pkg
>
> to work no matter how I installed the package. To give you an example of a 
> failure, I created a racket package and put it up on the raco pkg server:
>
> https://pkgd.racket-lang.org/pkgn/package/bleir-sandbox
>
> which refers to a github repo
>
> https://github.com/rebcabin/bleir-sandbox
>
> I then created two, fresh, Ubuntu 18.04 virtual machines via Virtual Box. 
> On both machines, I installed racket 8.2 as follows:
>
> sudo apt install racket
> sudo add-apt-repository ppa:plt/racket
> sudo apt update
> sudo apt upgrade
>
> On machine 1, I did
>
> raco pkg install bleir-sandbox
> raco test .local/share/racket/8.2/pkgs/bleir-sanbox  # all copacetic
> raco docs bleir-sandbox
>
> WORKS! Scribble docs show up in Firefox
>
> On machine 2, I did
>
> git clone https://github.com/rebcabin/bleir-sandbox.git
> cd bleir-sandbox
> git checkout master
> cd ..
> raco pkg install bleir-sandbox
> raco test .local/share/racket/8.2/pkgs/bleir-sandbox  # everything 
> copacetic
> raco docs bleir-sandbox
>
> NO MATCHES FOUND! Raco docs show no entries found for bleir-sandbox
>
> Worse yet, if I try on machine 2 to do it the working way, it doesn't 
> work, and it fails forever more.
>
> raco pkg remove bleir-sandbox
> raco pkg install bleir-sandbox
> raco test .local/share/racket/8.2/pkgs/bleir-sanbox  # all copacetic
> raco docs bleir-sandbox
>
> NO MATCHES FOUND!, NEVER EVER AGAIN
>
> I flushed Firefox cache, I did sudo racket setup for everything, and more 
> trial-and-error.
>
> Incidentally, some packages installed from the cloud also don't install 
> docs. For example, 
>
> raco pkg install beautiful-racket  # the package works great
> raco docs beautiful-racket  # NOT FOUND!
>
> I have similar problems on Ubuntu 21, but racket doesn't install things in 
> .local/share/racket/8.2. In fact, I've been unable to find out where racket 
> is installing packages on Ubuntu 21 (i.e., in what directories), even thoug
>
> raco pkg show
>
> shows all the packages I expect to see, and they 

Re: [racket-users] Rationale for package structure

2021-10-19 Thread schle...@gmail.com
But you can also define two single collection packages that use the same 
`(define collection "...")` within the info.rkt.
And that allows you to add modules with single collection packages.
Only tested locally but seems to work.

ded...@gmail.com schrieb am Donnerstag, 14. Oktober 2021 um 21:45:15 UTC+2:

> It's been a while since I created a new package, but as of ~1 year ago, 
> another advantage (or perhaps the same, from a different angle) of the 
> multi-collection format was that it allowed third parties to add modules to 
> the collections I defined.
>
> Eric
>
>
> On Sat, Oct 9, 2021, 1:58 PM 'Joel Dueck' via Racket Users <
> racket...@googlegroups.com> wrote:
>
>> I’ve always used the single collection format [1] in my packages.
>>
>> However, I see a lot of package authors will use a multi-collection 
>> format and split the library, documentation and maybe tests out into 
>> separate collections.
>>
>> What are the benefits of splitting the main library and its documentation 
>> into separate collections?
>>
>> [1]: 
>> https://docs.racket-lang.org/pkg/Package_Concepts.html#%28part._concept~3amulti-collection%29
>>
>> -- 
>>
> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/6ea9f50e-0d4f-4800-bc17-d31979a614cfn%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/f5b0fb1d-d26f-4eda-9915-72143b5f48e4n%40googlegroups.com.


[racket-users] Re: Racket web-server question

2021-07-08 Thread schle...@gmail.com
That is strange, I haven't had that problem.
I assume you are using a sqlite db that is stored in a file? (not an in 
memory one because that would be reset everytime?)
Are you sure you aren't doing your updates in some kind of transaction that 
remains unfinished for some reason for a long time?

Not really sure how to help you, without more information.
Things you could try:
different/newer sqlite versions, e.g. by using bogdan's 
https://pkgs.racket-lang.org/package/libsqlite3
try the `#:use-place #t` parameter in the `sqlite3-connect` function and 
see if that changes anything.
maybe try to create a minimal example and see if that still has that 
problem and share that code, so we can try to reproduce the problem

Whats your racket and sqlite version?
What OS / architecture are you on?
Have you tried a crud with only racket scripts and sqlite? (trying without 
the webserver to make the test simpler and know that that part can be 
ignored by bug analysis)

I am not sure whether there exists any verbose logging that could be 
enabled for db interactions.
This issue suggests there is a bit of logging, that could need better 
documentation: https://github.com/racket/db/issues/10

Simon
rohanpo...@gmail.com schrieb am Dienstag, 6. Juli 2021 um 09:53:41 UTC+2:

> Good morning everyone,
>
> Sorry, this is a bit of a noob question, but this is my first Racket 
> program :-)
> I build a CRUD in Racket web-server, everything seems to work well but my 
> Sqlite database does not update the data until I restart the server. I 
> tried a few things, but all in vain. 
>
> Any suggestions?
>
> Kind regards
> Rohan
>

-- 
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/461a8ab0-9f72-47ef-a44e-0640ab73f681n%40googlegroups.com.


[racket-users] Re: Is it possible to specify a hierarchy of menu-item options in racket/gui more than 2 deep?

2021-06-26 Thread schle...@gmail.com
Here is an example in a gist: 
https://gist.github.com/SimonLSchlee/e496830a7872e224b7afbd4fa6ef5fd8

You can't create a hierarchy of menu-items%, because menu-items are always 
leaf nodes (a "terminating" node in the hierarchy).
But you can have many nested menu% elements which can have menu-item% as 
children wherever you want to be a clickable item, instead of another sub 
menu.

infodeve...@gmail.com schrieb am Samstag, 26. Juni 2021 um 03:10:41 UTC+2:

> Is it possible to specify a hierarchy of menu-item options in racket/gui 
> more than 2 deep?
>
> In other words, I am able to define menu-item options such that I do get a 
> menu-bar with options that present sub options and I can call functions 
> using 'callback' from those suboptions, but I have thus far not been 
> successful at creating a deeper hierarchy of subsuboptions.
>
>

-- 
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/d03125b7-c3e8-442e-bfa2-9f55a8f80703n%40googlegroups.com.


[racket-users] Re: Trying to specify resize-border for instance of dialog

2021-06-26 Thread schle...@gmail.com
The docs say
style: (listof (or/c 'no-caption 'resize-border 'no-sheet 'close-button)) = 
null

so either (style (list 'resize-border)) or (style '(resize-border))

-- 
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/d5ab28a4-cfd3-4751-81c1-1484339ae22cn%40googlegroups.com.


Re: [racket-users] DrRacket complete word more convenient setting

2021-06-17 Thread schle...@gmail.com

>
> In fact, Emacs suits me very well, but for working with images I would 
> like to use DrRaket.
>

I wonder what about images makes you want to leave emacs, when you run 
`racket-run` (racket mode) from a racket module file in emacs it executes 
(and enters) that module and then opens a split with the interactions-repl.
That repl also allows you to evaluate expression that result in images, 
displaying them. 

Is there some particular image functionality that drracket has, that isn't 
supported in racket mode?

-- 
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/b2c1a8ee-5da0-464d-8ed0-06582cfb5fc9n%40googlegroups.com.


[racket-users] Re: Embedded Racket reimplementation for constrained hardware?

2021-06-06 Thread schle...@gmail.com
I think in such an environment I would like to control memory usage myself, 
or maybe have a #lang that allows very fine grained and low level control 
over resources. (outputting lowerlevel code than racket/base). 
If you need persistent data-structures they are nice, but often times you 
don't need them. 
Basically I would use a smaller language and build only the things I really 
need, instead of starting with racket and stripping away everything I don't 
need. 
(although if you manage to create a tool that accomplishes this in a very 
radical manner that could be cool as well, I just don't think that is easy)

That would boil down to partially evaluating racket specializing it to the 
target program, I don't think tools like `raco exe`, `raco distribute` etc. 
go so far that they would try to eliminate
base language features, which probably aren't "unused" anyway in any 
reasonably complex program.

Said another way: I think in a lot of cases it is easier to start creating 
a program with a language with less features, than trying to get rid of 
certain features after the program was already written using these 
features. If you start out without the features it is easier to reason 
about what features are worth implementing, for the particular program and 
what is over-engineered for the use-case.
That is just my perspective, I think there are many approaches to this, 
depending on the circumstances and concrete goals.

Simon

gneuner2 schrieb am Samstag, 5. Juni 2021 um 19:13:21 UTC+2:

> On Sat, 5 Jun 2021 06:45:44 -0700 (PDT), dbohdan
>  wrote:
>
> >Has anyone tried making a small embedded implementation of Racket? I mean 
> >"embedded" not in the sense of 8-bit microcontrollers but more powerful 
> yet 
> >still constrained devices, like routers with 64 MB RAM running Linux or 
> the 
> >PlayStation 2. I think you don't have to work from scratch to make one. 
> >You can implement Racket on top of an embedded Scheme like Chibi-Scheme 
> >. It doesn't need to be a full, 
> >maximally compatible port of Racket like Racket CS, just a large subset. 
> >For example, you can skip futures and places.
> >
> >What features do you need to implement natively in the interpreter rather 
> >than in Scheme? You can implement delimited continuations in terms of 
> >call/cc. The concurrency primitives (threads, boxes, etc.) and the FFI? 
> >You may be able to, but don't have to, optimize the interpreter for 
> >immutable conses.
> >
> >This is just something I have been musing about. If no project like this 
> >exists, I am not starting one soon.
>
> Racket can run in less than 64MB, but severely limited memory
> typically results in a lot of GC churn.
>
> 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/5d5f3114-ddaa-4e4b-af6b-e7f82a2fc670n%40googlegroups.com.


Re: [racket-users] canvas% mouse event handling difference in Racket CS?

2021-05-22 Thread schle...@gmail.com
Actually the flag version does not work for me.
(I thought it did because on-paint was fast enough not to be noticed that 
it was sequentially processing every mouse event with a paint call)

#(struct:v2 109 80) ;; mouse pos
draw  ;; beginning of draw
cpu time: 8 real time: 8 gc time: 0  ;; duration / end of draw
#(struct:v2 110 66)
draw
cpu time: 9 real time: 9 gc time: 0
#(struct:v2 110 64)
draw
cpu time: 8 real time: 8 gc time: 0
#(struct:v2 110 62)
draw
cpu time: 8 real time: 8 gc time: 0
#(struct:v2 112 61)
draw
cpu time: 9 real time: 9 gc time: 0
#(struct:v2 126 42)
draw
cpu time: 8 real time: 8 gc time: 0
...

The debounce works because it creates a time-window in which on-paint isn't 
running allowing all mouse events that arrive in that window to be 
processed before on-paint blocks processing of on-event.

#(struct:v2 51 371)
#(struct:v2 49 364)
#(struct:v2 44 346)
#(struct:v2 44 344)
#(struct:v2 44 343)
#(struct:v2 44 341)
#(struct:v2 42 340)
#(struct:v2 42 338)
#(struct:v2 42 336)
#(struct:v2 42 334)
draw
cpu time: 8 real time: 8 gc time: 0
#(struct:v2 42 329)
#(struct:v2 42 324)
#(struct:v2 42 319)
#(struct:v2 42 298)
#(struct:v2 42 297)
#(struct:v2 42 295)
#(struct:v2 42 294)
#(struct:v2 44 292)
#(struct:v2 44 290)
draw
cpu time: 8 real time: 8 gc time: 0
#(struct:v2 44 285)
#(struct:v2 45 282)
#(struct:v2 47 279)
#(struct:v2 50 270)
#(struct:v2 51 270)
draw
cpu time: 8 real time: 8 gc time: 0
#(struct:v2 51 269)
#(struct:v2 52 268)
draw
cpu time: 8 real time: 8 gc time: 0
...

[sidenote: the difference to yesterdays timings is that more other stuff 
was running on my box, I think]
The debounce makes it work somewhat similar to a "traditional single 
threaded game-eventloop", the difference being that the game-loop would 
process the queue of n events that arrived for that frame until it is empty 
and then do other calculations and finish the frame by rendering, while the 
debounce just specifies a fixed time for event and other processing before 
rendering takes place.

The mouse event can't run while on-paint runs and the window event priority 
ensures that on-paint always has a higher prio than mouse-events, this 
means that we can only process multiple mouse-events in one batch when they 
don't immediately add a on-paint/refresh event: 
https://docs.racket-lang.org/gui/windowing-overview.html?q=eventspace#%28part._.Event_.Types_and_.Priorities%29

I constructed a minimal example, while playing around with it I found a 
variant of flag that works for me:
Instead of resetting the flag at the end of on-paint, I use queue-callback 
to add a low priority callback that resets it,
because of event-handling priorities this means that the mouse events can 
be processed before the flag is reset. (I think this my new favorite 
solution for a lot of mouse move cases)
https://gist.github.com/SimonLSchlee/1a748b5a93b86aea2fc15045cad2be50

The example lets you switch between the 3 modes I have currently added, it 
is a canvas that changes the color of a grid of rounded rectangles based on 
mouse position,
it also prints mouse position and draw timings to the console.
Simon

-- 
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/6914ecce-66f2-4221-9290-355c9ebcc78bn%40googlegroups.com.


[racket-users] Re: canvas% mouse event handling difference in Racket CS?

2021-05-22 Thread schle...@gmail.com
I tried your flag version too, I like it, it works without delay and is 
simple.
But theoretically you can have situations where the drawn output doesn't 
fully represent the current state (if some things were already done and the 
data was changed afterwards).
Unless I misunderstand your solution.
Practically that is often not an issue.

I think for my use case I prefer the timer solution, because although it 
has delay, that delay can be tweaked as a tradeoff between delay and cpu 
use.
And I can tweak it so that it feels snappy and racket doesn't go to 100% 
cpu use, drawing frames I don't perceive.
It also always does a full redraw eventually after things have changed.
(not really relevant for that mouse event case though, but if I were to 
draw background color based on mouse position it might be)

The timer code is based on other old autosave code:
I think initially I reused the timer, but then needed another flag to know 
whether the timer is already running.
Also I didn't want the timer to hang around for a bunch of text fields 
which get modified rarely and its existence doubles as flag whether it is 
running.
Actually for autosave textfields that part is very important that always 
the latest version is saved.

So many different tradeoffs possible ;)

Thank you, for your perspective!

Simon

alexha...@gmail.com schrieb am Samstag, 22. Mai 2021 um 08:03:30 UTC+2:

> On Saturday, May 22, 2021 at 12:42:30 PM UTC+8 schle...@gmail.com wrote:
>
>> Maybe someone has a clever solution to collapse the calls to refresh less 
>> manually.
>>
>
> I experienced a similar problem as you, where I have to refresh a canvas 
> on a mouse event and the paint method is somewhat slow (it does have a lot 
> of drawing to do in my case, so I expect it to be slow).  I am not sure if 
> this is a regression in the draw performance, but it seems that the canvas% 
> will un `on-paint` for each `refresh` call it receives (unless I am missing 
> something).  This means that sending a refresh on mouse events will result 
> in many unnecessary redraws of the canvas.
>
> Not sure if my solution is "clever", but it involves setting a flag on the 
> first refresh and only clearing after the draw operation is completed.  The 
> internal state is still updated for each mouse event, but refresh is only 
> called on the canvas if the flag is not set (that is if there is no 
> outstanding refresh call).  This way, there is no unnecessary delay for the 
> refresh, and the on-paint always draws the latest version of the internal 
> state, which may have been updated several times between the time refresh 
> was initially called.
>
> Also, if you choose to use a timer% object, you don't need to create one 
> each time, they can be reused.
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/ac9c8d9e-9381-4e01-acdd-f38091cbed2cn%40googlegroups.com.


[racket-users] Re: canvas% mouse event handling difference in Racket CS?

2021-05-22 Thread schle...@gmail.com
The difference between 23ms and 50ms was that the memoization wasn't doing 
its job.
I removed some calls to get-brush and set-brush, only calling set-brush 
when the color changes. (only writing the value not reading it)
Specialized a function that returned an ignored argument, to not calculate 
that argument.
With that I got to 10-19 ms, together with the debounce it now is very 
snappy again, so I am satisfied.
The debounce often collapses 10-30 mouse-events/on-paint calls into one.

The code could be changed to precompute more stuff (needing more memory) or 
only redraw the region close to the cursor, but that would take to much 
programmer time for now.

schle...@gmail.com schrieb am Samstag, 22. Mai 2021 um 06:42:30 UTC+2:

> I tested with Racket v7.8 bc and it was also slow.
> I also tested it with a year old version of my code and added similar 
> `time` calls around the drawing code
> and it behaved like the recent version redrawing for all the mouse events, 
> only difference is that the on-paint takes around 23ms instead of 50ms.
> So the older code takes half the time.
> So maybe the debounce is the right solution, because I can't find a 
> version where something similar happens automatically.
>
> I also wonder why the drawing has gotten so slow, maybe the memoization in 
> the app fails somewhere and it repeatedly tries to load data from the 
> sqlite db.
> Is the debounce the "right" way to do this?
> Maybe someone has a clever solution to collapse the calls to refresh less 
> manually.
> I was under the impression refresh was doing that automatically but maybe 
> at a different granularity that isn't working for my app/wanted performance.
>
> Now I also tested old app code with new racket and the draw is around 23ms 
> there too.
> So the extra slowness seems to be a problem in the application logic 
> introduced in the new code.
> And it seems that it just made it slow enough to make me notice that a 
> debounce is useful for snappier user-feedback.
>
> So the next step for me is to look at the differences between the old and 
> new code.
>
> schle...@gmail.com schrieb am Samstag, 22. Mai 2021 um 05:37:32 UTC+2:
>
>> I have a racket gui app that uses a canvas% with overridden on-event and 
>> on-paint methods.
>> When the user hovers over drawn elements the on-paint is called via (send 
>> this refresh)
>> to display the element under the cursor with a selection/outline.
>>
>> Recently I noticed that this has gotten extremely slow.
>> It seems to me this might be a difference between BC and CS, but I 
>> haven't checked with different versions in depth yet. (just from the 
>> behavior/performance I remember it had in the past)
>>
>> In the past a call to (send this refresh) seemed to be processed 
>> concurrently in regard to on-event.
>> Now it seems like the first (send this refresh) eagerly triggers the 
>> on-paint and this on-paint somehow blocks the processing of on-event until 
>> the on-paint is finished, after that 1 more mouse event is processed 
>> re-triggering the on-paint.
>> Effectively redrawing for every mouse event, causing the app to draw old 
>> uninteresting frames (because the mouse events aren't processed fast enough 
>> and only the last position is interesting for me).
>>
>> Currently I have implemented a workaround:
>> (define (oneoff-timer interval thk)
>>   (new timer%
>>[notify-callback thk]
>>[interval interval]
>>[just-once? #t]))
>>
>> (define (debounce interval thk)
>>   (define timer #f)
>>   (define (fire)
>> (set! timer #f)
>> (thk))
>>   (define (trigger)
>> (unless timer
>>   (set! timer (oneoff-timer interval fire
>>   trigger)
>>
>> ;; within the canvas impl
>> (define dirty! (debounce 50 (thunk (send this refresh
>> ;; within on-event calling (dirty!) instead of (send this refresh) 
>> directly
>> ;; this effectively waits at least 50 ms before trying to refresh thus 
>> allowing most on-event
>> ;; calls to complete before on-paint is executed the first/next time, 
>> thus only drawing the last frame or a few in-between frames if the mouse is 
>> moved for a long time
>>
>> I may try to construct a minimal example, but wanted to put the info out 
>> there, because the behavior seems so different from before.
>>
>> Tested version: Racket v8.1 [cs] linux
>>
>> Simon
>>
>

-- 
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/24a60d43-227f-4988-9eb6-5841e7ab9bc3n%40googlegroups.com.


[racket-users] Re: canvas% mouse event handling difference in Racket CS?

2021-05-21 Thread schle...@gmail.com
I tested with Racket v7.8 bc and it was also slow.
I also tested it with a year old version of my code and added similar 
`time` calls around the drawing code
and it behaved like the recent version redrawing for all the mouse events, 
only difference is that the on-paint takes around 23ms instead of 50ms.
So the older code takes half the time.
So maybe the debounce is the right solution, because I can't find a version 
where something similar happens automatically.

I also wonder why the drawing has gotten so slow, maybe the memoization in 
the app fails somewhere and it repeatedly tries to load data from the 
sqlite db.
Is the debounce the "right" way to do this?
Maybe someone has a clever solution to collapse the calls to refresh less 
manually.
I was under the impression refresh was doing that automatically but maybe 
at a different granularity that isn't working for my app/wanted performance.

Now I also tested old app code with new racket and the draw is around 23ms 
there too.
So the extra slowness seems to be a problem in the application logic 
introduced in the new code.
And it seems that it just made it slow enough to make me notice that a 
debounce is useful for snappier user-feedback.

So the next step for me is to look at the differences between the old and 
new code.

schle...@gmail.com schrieb am Samstag, 22. Mai 2021 um 05:37:32 UTC+2:

> I have a racket gui app that uses a canvas% with overridden on-event and 
> on-paint methods.
> When the user hovers over drawn elements the on-paint is called via (send 
> this refresh)
> to display the element under the cursor with a selection/outline.
>
> Recently I noticed that this has gotten extremely slow.
> It seems to me this might be a difference between BC and CS, but I haven't 
> checked with different versions in depth yet. (just from the 
> behavior/performance I remember it had in the past)
>
> In the past a call to (send this refresh) seemed to be processed 
> concurrently in regard to on-event.
> Now it seems like the first (send this refresh) eagerly triggers the 
> on-paint and this on-paint somehow blocks the processing of on-event until 
> the on-paint is finished, after that 1 more mouse event is processed 
> re-triggering the on-paint.
> Effectively redrawing for every mouse event, causing the app to draw old 
> uninteresting frames (because the mouse events aren't processed fast enough 
> and only the last position is interesting for me).
>
> Currently I have implemented a workaround:
> (define (oneoff-timer interval thk)
>   (new timer%
>[notify-callback thk]
>[interval interval]
>[just-once? #t]))
>
> (define (debounce interval thk)
>   (define timer #f)
>   (define (fire)
> (set! timer #f)
> (thk))
>   (define (trigger)
> (unless timer
>   (set! timer (oneoff-timer interval fire
>   trigger)
>
> ;; within the canvas impl
> (define dirty! (debounce 50 (thunk (send this refresh
> ;; within on-event calling (dirty!) instead of (send this refresh) directly
> ;; this effectively waits at least 50 ms before trying to refresh thus 
> allowing most on-event
> ;; calls to complete before on-paint is executed the first/next time, thus 
> only drawing the last frame or a few in-between frames if the mouse is 
> moved for a long time
>
> I may try to construct a minimal example, but wanted to put the info out 
> there, because the behavior seems so different from before.
>
> Tested version: Racket v8.1 [cs] linux
>
> Simon
>

-- 
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/81fd2264-4806-4e93-8424-f63deb114e1en%40googlegroups.com.


[racket-users] canvas% mouse event handling difference in Racket CS?

2021-05-21 Thread schle...@gmail.com
I have a racket gui app that uses a canvas% with overridden on-event and 
on-paint methods.
When the user hovers over drawn elements the on-paint is called via (send 
this refresh)
to display the element under the cursor with a selection/outline.

Recently I noticed that this has gotten extremely slow.
It seems to me this might be a difference between BC and CS, but I haven't 
checked with different versions in depth yet. (just from the 
behavior/performance I remember it had in the past)

In the past a call to (send this refresh) seemed to be processed 
concurrently in regard to on-event.
Now it seems like the first (send this refresh) eagerly triggers the 
on-paint and this on-paint somehow blocks the processing of on-event until 
the on-paint is finished, after that 1 more mouse event is processed 
re-triggering the on-paint.
Effectively redrawing for every mouse event, causing the app to draw old 
uninteresting frames (because the mouse events aren't processed fast enough 
and only the last position is interesting for me).

Currently I have implemented a workaround:
(define (oneoff-timer interval thk)
  (new timer%
   [notify-callback thk]
   [interval interval]
   [just-once? #t]))

(define (debounce interval thk)
  (define timer #f)
  (define (fire)
(set! timer #f)
(thk))
  (define (trigger)
(unless timer
  (set! timer (oneoff-timer interval fire
  trigger)

;; within the canvas impl
(define dirty! (debounce 50 (thunk (send this refresh
;; within on-event calling (dirty!) instead of (send this refresh) directly
;; this effectively waits at least 50 ms before trying to refresh thus 
allowing most on-event
;; calls to complete before on-paint is executed the first/next time, thus 
only drawing the last frame or a few in-between frames if the mouse is 
moved for a long time

I may try to construct a minimal example, but wanted to put the info out 
there, because the behavior seems so different from before.

Tested version: Racket v8.1 [cs] linux

Simon

-- 
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/9298249c-3d3d-4f1f-a18d-945ea7d1e34en%40googlegroups.com.


[racket-users] Re: preview of a cross-compilation tool

2021-05-14 Thread schle...@gmail.com
This is like being a child, waking up and realizing its christmas (and 
easter at the same time), 
thank you for working on this, I will test out this shiny new toy/gift 
(meant in the best possible way).

Because I am on linux, I will try to cross compile to windows (time to dust 
off my windows vm for testing ;))

Matthew Flatt schrieb am Donnerstag, 13. Mai 2021 um 17:54:40 UTC+2:

> While `raco exe` in v8.1 very nearly supports cross-builds of Racket
> executables[*], it's not easy to pass the right flags and set up the
> needed target-platform distributions.
>
> The `raco cross` command provided by the new "raco-cross" package wraps
> Racket tools to simplify all of that management. For example,
>
> raco cross --target x86_64-linux --vm bc exe example.rkt
>
> is like running
>
> raco exe example.rkt
>
> but it cross-builds for x86_64 Linux. That build process involves
> downloading a minimal racket tarball for the target platform,
> installing "compiler-lib" there, downloading a matching minimal build
> of Racket for the host platform, and then running the host Racket in
> cross-build mode with installed target distribution --- but, again,
> `raco cross` takes care of all that.
>
> Just like using `raco exe` on Linux, the generated executable won't
> actually work on other machines until you package it in a distribution
> using `raco dist`:
>
> raco cross --target x86_64-linux --vm bc dist example-dist example
>
> Naturally, this second invocation of `raco cross` for the same target
> uses the installations prepared by the first `raco cross`, so it's
> relatively fast.
>
>
> I expect that `raco cross` will become more useful after the v8.2
> release, which will repair cross-compilation for CS executables and
> executables with native libraries (like GUI executables). Meanwhile,
> it's possible to use `raco cross` with snapshot builds, but you have to
> point it at a snapshot site; see the documentation for more
> information.
>
>
> Because juggling multiple installations and versions is a lot of the
> work for cross-compilation, `raco cross` can also be a way to get to a
> different version of Racket in minimal form. For example,
>
> raco cross --version 8.0 racket
>
> starts a Racket v8.0 prompt. (The `racket` command is treated specially
> by `raco cross`. All other commands are prefixed by `raco`.)
>
>
> For more information see
>
> https://docs.racket-lang.org/raco-cross/index.html
>
>
> [*] Running a cross-built CS executable fails at the very last step of
> startup, and that's due to an expander bug for handling top-level
> `begin` forms compiled in machine-independent form. We didn't
> detect this problem before, because it wasn't part of Bogdan's use
> case for cross builds, and because cross-compilation was painful
> enough that we didn't actually try other cases.
>

-- 
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/d3bc9cde-14fe-4b59-b426-ea12a49ead89n%40googlegroups.com.


Re: [racket-users] Add Link to the racket Discord to the racket website?

2021-04-20 Thread schle...@gmail.com
@Adam What I see with your link is a giant wall of text, It is quite 
overwhelming to get greeted by huge correspondence like that.
This thread was simply about helping somebody who wants to find help with 
basic racket problems find a place where there are people who can help in 
an interactive manner that is an alternative to the mailing list.

@Yury nobody has to use discord, it is simply an option for those who 
accept the cons of using a service like that, because it works for them.

Yury Bulka schrieb am Dienstag, 20. April 2021 um 10:46:01 UTC+2:

> Just my 5 cents...
>
> Recently I had to register on a discord "server" to ask a question
> within another community - and the experience was of a high barrier of
> entry. I needed to provide my age, confirm my email, then (that might be
> an issue of that particular "server" - I'm not sure) I was forced to
> wait 5 minutes before I could interact. Also I notice now that discord
> sends me email notifications that contain third-party tracking.
>
> Another walled garden trying to make me an addict of their service.
>
> The only thing I want to do now is delete any of my presence on discord.
>
> The IRC + Matrix combination is much more open and inclusive I think.
>
> And there is a question of transparency of governance and moderation of
> course.
>
> --
> Yury Bulka
> https://mamot.fr/@setthemfree
> #NotOnFacebook
>
>
>
> Adam Golding  writes:
>
> > I'm not so sure now: 
> https://groups.google.com/g/racket-users/c/SkJAKkQhlgw
> >
> >
> > On Mon, 19 Apr 2021 at 03:39, Adam Golding  wrote:
> >
> >> seconded
> >>
> >> On Sun, 18 Apr 2021 at 14:56, schle...@gmail.com 
> >> wrote:
> >>
> >>>
> >>> The racket discord is managed quite well, I think it should be added to
> >>> the racket website so that newcomers can find it easier, just a 
> thought.
> >>>
> >>> Maybe below the link to slack?
> >>>
> >>> --
> >>> 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...@googlegroups.com.
> >>> To view this discussion on the web visit
> >>> 
> https://groups.google.com/d/msgid/racket-users/a8e865db-f585-477d-b397-fceaa7cb3131n%40googlegroups.com
> >>> <
> https://groups.google.com/d/msgid/racket-users/a8e865db-f585-477d-b397-fceaa7cb3131n%40googlegroups.com?utm_medium=email_source=footer
> >
> >>> .
> >>>
> >>
>
>

-- 
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/ced9d8f6-2a69-43da-9305-2d4af8aded25n%40googlegroups.com.


[racket-users] Add Link to the racket Discord to the racket website?

2021-04-18 Thread schle...@gmail.com

The racket discord is managed quite well, I think it should be added to the 
racket website so that newcomers can find it easier, just a thought.

Maybe below the link to slack?

-- 
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/a8e865db-f585-477d-b397-fceaa7cb3131n%40googlegroups.com.


Re: [racket-users] Why are there seemingly unnecessary if expressions shown by the Macro stepper?

2021-03-21 Thread schle...@gmail.com
Ahh ok, thank you that makes sense. 
I didn't know about PLT_LINKLET_SHOW_CP0 before that is a nice look behind 
the scene.

sorawe...@gmail.com schrieb am Sonntag, 21. März 2021 um 19:47:03 UTC+1:

> That’s not the job of the macro expander. And the Racket optimizer does 
> reduce (if '#t (#%app not '#f) '#f) — in fact to #t.
>
> If you use Racket CS, try running:
>
> PLT_LINKLET_SHOW_CP0=1 racket file.rkt
>
> where file.rkt is 
>
> #lang racket
> (displayln (if #t (not #f) #f))
>
> Here’s the optimized program:
>
> ;; cp0 -
> (lambda (instance-variable-reference .get-syntax-literal!1
>  .set-transformer!2 displayln3 print-values4)
>   (call-with-module-prompt
> (lambda ()
>   (#%call-with-values
> (lambda () (displayln3 #t))
> print-values4)))
>   (#2%void))
>
>
> On Mon, Mar 22, 2021 at 1:28 AM schle...@gmail.com  
> wrote:
>
>> The [WordCount] thread caused me to play around with the solutions to see 
>> whether I could see anything else that can be tweaked, I tried a few things 
>> but they didn't improve performance, but it was fun anyway.
>>
>> Then I though I could try the macro stepper and look at the expansion of 
>> [crowdsourced].
>> I disabled macro hiding and stepped to the end.
>> There I saw if statements with a condition that is `(quote #t)` with a 
>> little lock symbol before it.
>>
>> I would like to understand why those terms aren't reduced further.
>> Are they placeholders and are replaced and resolved at a later time?
>>
>> terms copied (without the lock symbol) from the macro stepper
>> (if (if '#t (#%app not '#f) '#f)
>>   (#%app for-loop (#%app unsafe-fx+ '1 pos))
>>   (#%app values))
>>
>> From a naive standpoint I would expect it to be simplified:
>> (if '#t (#%app not '#f) '#f) -> (#%app not '#f)
>>
>> (if (#%app not '#f)
>>   (#%app for-loop (#%app unsafe-fx+ '1 pos))
>>   (#%app values))
>>
>> So expressed another way: why isn't the if with boolean literal as 
>> condition reduced to the corresponding branch? Or does this happen, just 
>> isn't shown in the macro stepper? 
>> What am I misunderstanding here?
>>
>> If there aren't simplifications like that, what is preventing them or 
>> making them not worthwhile?
>>
>>
>> [WordCount] 
>> https://groups.google.com/g/racket-users/c/lGA60P6jboY/m/2ZLDAunBBgAJ
>> [crowdsourced] 
>> https://gist.github.com/Bogdanp/b9256e1a91de9083830cb616b3659ff8
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/fce863fe-85d7-44a6-a2ba-5778df40e6bfn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/racket-users/fce863fe-85d7-44a6-a2ba-5778df40e6bfn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/cd4f9860-e57d-4ce2-bef8-6598a28ddfafn%40googlegroups.com.


[racket-users] Why are there seemingly unnecessary if expressions shown by the Macro stepper?

2021-03-21 Thread schle...@gmail.com
The [WordCount] thread caused me to play around with the solutions to see 
whether I could see anything else that can be tweaked, I tried a few things 
but they didn't improve performance, but it was fun anyway.

Then I though I could try the macro stepper and look at the expansion of 
[crowdsourced].
I disabled macro hiding and stepped to the end.
There I saw if statements with a condition that is `(quote #t)` with a 
little lock symbol before it.

I would like to understand why those terms aren't reduced further.
Are they placeholders and are replaced and resolved at a later time?

terms copied (without the lock symbol) from the macro stepper
(if (if '#t (#%app not '#f) '#f)
  (#%app for-loop (#%app unsafe-fx+ '1 pos))
  (#%app values))

>From a naive standpoint I would expect it to be simplified:
(if '#t (#%app not '#f) '#f) -> (#%app not '#f)

(if (#%app not '#f)
  (#%app for-loop (#%app unsafe-fx+ '1 pos))
  (#%app values))

So expressed another way: why isn't the if with boolean literal as 
condition reduced to the corresponding branch? Or does this happen, just 
isn't shown in the macro stepper? 
What am I misunderstanding here?

If there aren't simplifications like that, what is preventing them or 
making them not worthwhile?


[WordCount] 
https://groups.google.com/g/racket-users/c/lGA60P6jboY/m/2ZLDAunBBgAJ
[crowdsourced] 
https://gist.github.com/Bogdanp/b9256e1a91de9083830cb616b3659ff8

-- 
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/fce863fe-85d7-44a6-a2ba-5778df40e6bfn%40googlegroups.com.


Re: [racket-users] fluent: unix style pipes and lambda shorthand to make your code more readable

2021-03-12 Thread schle...@gmail.com
I am not sure about the technical details, but would it be possible to 
rename those identifiers with?: (require (rename-in fluent [→ ~>] [→→ 
~~>])) 
I think if you define those arrows as syntax parameters they could be 
renamed, but I don't know whether that is the "right" way to do it in 
racket.
https://docs.racket-lang.org/reference/stxparam.html?q=syntax-parameter

I like the ~> and ~~> arrows they are quite distinct, seems like a good 
default to me.
I think the rackety way would be to have one default name and make them 
rename-able.
Then fluent/unicode would not be necessary, but I also would not be 
bothered by it.

On a technical level I would prefer a solution that does not result in more 
and more code generation for every renamed variant.
Roger Keays schrieb am Donnerstag, 11. März 2021 um 19:44:28 UTC+1:

> > > > It might be nice to use ~> and ~>> (or |> and |>> or choose your 
> own) as infix
> > > > to avoid clashing with >.
>
> I'm thinking about changing the default operators to ~> and ~~> and making 
> the unicode versions available using (require fluent/unicode). I actually 
> prefer the long arrow for thread-last to the current syntax (>>).
>
> Any thoughts?
>
> On Wed, Mar 10, 2021 at 07:31:08PM -0500, Hendrik Boom wrote:
> > On Wed, Mar 10, 2021 at 08:23:46PM +0700, Roger Keays wrote:
> > > > I've been using the Clojure-like threading package for a while now 
> and this has
> > > > some nice advantages that are mentioned in the docs, like blending 
> the first
> > > > arg > and last arg >> variants easily in a sequence.
> > > > 
> > > > How does fluent manage this infixing from a (require ...) rather 
> than a #lang?
> > > 
> > > It provides a custom #%app macro which rearranges the code into 
> regular s-expressions. I was surprised by how much flexibility this feature 
> of racket gives you. It would have taken months to build this from scratch 
> in any other language. The racket version is 25 lines of code. [1]
> > > 
> > > > It might be nice to use ~> and ~>> (or |> and |>> or choose your 
> own) as infix
> > > > to avoid clashing with >.
> > > 
> > > I wanted a single character because I use it so often. I suppose with 
> the unicode (→) option, there is less need for a single-character solution. 
> Need to think about this...
> > 
> > Only if your keyboard has a convenient single key to type it with.
> > 
> > -- hendrik
> > 
> > > 
> > > 
> > > [1] https://github.com/rogerkeays/racket-fluent/blob/main/main.rkt
> > > > 
> > > > 
> > > > Dan
> > > > 
> > > > --
> > > > 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...@googlegroups.com.
> > > > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/
> > > > racket-users/
> > > > CAFKxZVVBV1sP%2BKk%2B%2Bdw7k7a_TcEsL-yz6%2BLKDLZOa2Wfc1RAYw%
> 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...@googlegroups.com.
> > > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/sigid.0703ba7d55.20210310132341.GA3081%40papaya.papaya
> .
> > 
> > -- 
> > 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...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20210311003108.qjqsrn4kd6nbwtd5%40topoi.pooq.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/79e3eb5f-90cb-49fb-824b-92e5b184053en%40googlegroups.com.


[racket-users] Re: key combos at the command line

2021-03-12 Thread schle...@gmail.com
There is also the possibility to do these other things outside of your 
terminal application. If you are on linux you could just ctrl-z to send 
your terminal app to the background (suspend it) and get back to your 
normal terminal execute some rsync command or something to send your file, 
"jobs" command then lists background processes, "fg" brings back the most 
recent one (your terminal app). Thats the simplified description see the 
manpages or google for more info on that.
But I have the impression that you want to do all these things within your 
application?
schle...@gmail.com schrieb am Freitag, 12. März 2021 um 12:49:22 UTC+1:

> I don't really understand what you want to do exactly.
> I think mostly you have to implement it yourself, possibly by using 
> something like https://docs.racket-lang.org/charterm/index.html or maybe 
> https://docs.racket-lang.org/lux-charterm/index.html
>
> https://pkgd.racket-lang.org/pkgn/search?tags=terminal
>
> I would guess that the rmacs package could contain quite a few useful 
> tricks, but haven't looked at it in depth.
> I also tried a few emacs-style key-combos in the racket repl only one, 
> that I always use in terminals, worked: ctrl-r for reverse history search
> It allows you to quickly eval a previously entered expression in the repl, 
> to me it seems that this is implemented in racket somewhere,
> but I am not sure whether it is in the default repl, or whether it has 
> something to do with xrepl. 
> https://docs.racket-lang.org/xrepl/index.html?q=xrepl
>
> That said you could have a prefix for commands like : or / for just typing 
> static commands, or something more interactive by managing the terminal 
> buffer yourself with something like charterm.
> I think lux with the lux-charterm might be a good way to build your 
> terminal application from many little pieces that are combined to form the 
> full application,
> but I haven't used it so far, would be nice to find a medium sized example 
> for a lux terminal application.
>
> James Platt schrieb am Mittwoch, 10. März 2021 um 19:41:18 UTC+1:
>
>> I am working on an example command line chat client in Racket and I need 
>> a method to switch from text chat to commands for things like sending a 
>> binary file or executing a utility to check the network connection. I am 
>> thinking of something like control key combinations. What is the easiest 
>> way to do something like this in Racket?
>
>

-- 
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/25087fb2-9035-49dd-af08-a65d4004e573n%40googlegroups.com.


[racket-users] Re: key combos at the command line

2021-03-12 Thread schle...@gmail.com
I don't really understand what you want to do exactly.
I think mostly you have to implement it yourself, possibly by using 
something like https://docs.racket-lang.org/charterm/index.html or maybe 
https://docs.racket-lang.org/lux-charterm/index.html

https://pkgd.racket-lang.org/pkgn/search?tags=terminal

I would guess that the rmacs package could contain quite a few useful 
tricks, but haven't looked at it in depth.
I also tried a few emacs-style key-combos in the racket repl only one, that 
I always use in terminals, worked: ctrl-r for reverse history search
It allows you to quickly eval a previously entered expression in the repl, 
to me it seems that this is implemented in racket somewhere,
but I am not sure whether it is in the default repl, or whether it has 
something to do with xrepl. 
https://docs.racket-lang.org/xrepl/index.html?q=xrepl

That said you could have a prefix for commands like : or / for just typing 
static commands, or something more interactive by managing the terminal 
buffer yourself with something like charterm.
I think lux with the lux-charterm might be a good way to build your 
terminal application from many little pieces that are combined to form the 
full application,
but I haven't used it so far, would be nice to find a medium sized example 
for a lux terminal application.

James Platt schrieb am Mittwoch, 10. März 2021 um 19:41:18 UTC+1:

> I am working on an example command line chat client in Racket and I need a 
> method to switch from text chat to commands for things like sending a 
> binary file or executing a utility to check the network connection. I am 
> thinking of something like control key combinations. What is the easiest 
> way to do something like this in Racket?

-- 
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/13b4eb86-e5f1-4e2f-8297-dfa1847358f6n%40googlegroups.com.


[racket-users] Re: Permutations ind Racket

2020-12-16 Thread schle...@gmail.com
Stepping through the code with the drracket debugger and inspecting the 
values on the way may also be a good way to identify areas where your code 
doesn't work like you had expected.
Maybe write some more testcases / example applications of your function and 
see which inputs already work and which ones do not, thus narrowing down / 
getting an idea where the problem is within the code.

You already mentioned recursion, recursion can be used to solve problems 
that are self similar like how the *Sierpiński* *triangle *contains 3 
simpler versions of itself.
Instead of thinking how you can create all permutations and then somehow 
create code for that. How could you create one permutation and then do that 
multiple times.
Maybe go through the problem yourself manually with 3 different items in 
physical space, pen and paper, think about what you are doing and what 
steps you do repeatedly.

If you have more specific questions ask them, I am sure a lot of people on 
this list will be interested in helping you, if you get specific.
This seems like homework with the purpose of deepening your understanding, 
so I can't really do much without ruining your learning experience.
I also don't want to confuse or distract you with too many different 
perspectives of looking at the problem, you have to find a way of looking 
at it that works for you.

That said I am self taught and have not a lot of teaching experience, so 
maybe others have better help or advice for you.

Simon

kiel@gmail.com schrieb am Dienstag, 15. Dezember 2020 um 14:12:25 UTC+1:

> I study programming and have to do permutations in Racket without 
> something like map , foldr, remove, remq, sort! or begin. So now i have a 
> code but it doesn't show me every Permutation and some dopple. I can't find 
> the issue or how to fix and program it right only using recursion. Maybe 
> some of you know how to help me and find my logical or programming issue.  
> Here you can find a github link to my code.
> https://gist.github.com/KiraBen/fd70ea1063dfcdadfea0332343e37558
>
> Thank you for your help. 
>
> With greetings Kira Bender
>

-- 
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/337aa729-0cab-4277-bc80-7a47910c00acn%40googlegroups.com.


Re: [racket-users] Automated method for making racket package installs consistent?

2020-10-12 Thread schle...@gmail.com
This is just a suggestion, that does not help with your current dilemma, a 
strategy how you could prevent it in the future:

Create or expand your personal dotfile repository, within that repository 
create a folder my-racket-packages, within that folder create a info.rkt:
#lang info
(define collection "my-racket-packages")
(define deps
  (list "lens"
"opengl"
"gregor"
"add your own packages here"))

This way you can create a personal package that lists all of the packages 
that you play around with explicitly.
https://docs.racket-lang.org/pkg/metadata.html
You can then just use drracket or raco to install that package locally.
Within the directory:
raco pkg install

to install the package.
When the dotfiles have changed, within the my-racket-packages directory:
raco pkg update --auto

I know this solution requires you to update the package manually, but if 
you install a package via raco pkg install , you might as 
well add it to the info.rkt instead.
This way you have a single source of truth, instead of having to sync 
multiple different installations.

Instead of my-racket-packages you also could name it my-racket-experiments 
and save your experiment sessions with scripts along with the dependencies.
You never have to publish that package if you don't want to.



primer schrieb am Sonntag, 11. Oktober 2020 um 17:03:02 UTC+2:

> On Sunday, October 11, 2020 at 1:35:24 AM UTC-7 William J. Bowman wrote:
>
>> I'm not sure what you're asking: is your question equivalent to figuring 
>> out which packages are explicitly installed? 
>>
>
> That's part of the problem.  I have several computers, each with racket 
> installed.  I'd like to get them on the same page in terms of the 
> explicitly installed packages, which are currently different on each 
> machine depending on what I played with at the time.
>
> So I imagine the workflow to be something like this:
> 1.  On machine A, do something that generates a list of explicitly 
> installed packages
> 2.  Do something on machine B to bring in that list of packages and 
> automatically install them, while not disturbing any explicit packages 
> already installed on B
> 3. Repeat steps 1 and 2 starting with the now updated B.  After this A and 
> B should be in sync.
>
>

-- 
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/9857bd34-9022-44a0-a9a2-34c6d63e7446n%40googlegroups.com.