[racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread 'Wayne Harris' via Racket Users
I'd like to save database results in memory because my database only changes between long time intervals. By building a minimum application, I see my cache-strategy seems to work per servlet: by opening a new browser, the first request yields a cache-miss. Looking through the documentation, I

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread 'Wayne Harris' via Racket Users
On Tuesday, August 13, 2019 2:17 PM, George Neuner wrote: > On 8/13/2019 11:47 AM, 'Wayne Harris' via Racket Users wrote: > > > I'd like to save database results in memory because my database only > > changes between long time intervals.  By building a minimum > > app

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread 'Wayne Harris' via Racket Users
Is there an example somewhere showing how this could be done? My wish is to have one thing (a thread or something) periodically updating data (say every 30 minutes) and all servlets handling http connections reading. It is perfectly fine for me if while something writes the data, everything

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread 'Wayne Harris' via Racket Users
On Tuesday, August 13, 2019 9:51 PM, Philip McGrath wrote: > The relevant chapter of the reference is "Concurrency and Parallelism" > (https://docs.racket-lang.org/reference/threads.html): > >> All constant-time procedures and operations provided by Racket are >> thread-safe because they are

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread 'Wayne Harris' via Racket Users
Thanks! Here's what I did in shared-model.rkt: (define *db* (box #f)) (define (get-in-memory-results) (let ([in-mem (unbox *db*)]) (if in-mem (begin (displayln "database: cache hit") in-mem) (begin (displayln "database: cache miss")

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-14 Thread 'Wayne Harris' via Racket Users
On Tuesday, August 13, 2019 5:46 PM, George Neuner wrote: > On 8/13/2019 2:24 PM, 'Wayne Harris' via Racket Users wrote: > > > With Chrome, I visited localhost:/main a first time and refreshed it. > > (So I got a cache miss followed by a cache hit.) With Firefox, I did the

[racket-users] does handin-server really need racket/gui/base?

2019-08-16 Thread 'Wayne Harris' via Racket Users
I tried the handin-server on a Windows computer and it worked just fine. Now I'm trying it on a headless UNIX system and, upon first run, I got: $ racket -l handin-server Unable to init server: Could not connect: Connection refused Gtk initialization failed for display ":0" context...:

[racket-users] handin-server: writing a first checker

2019-08-21 Thread 'Wayne Harris' via Racket Users
I haven't been able to write a first checker. I'm always getting map: all lists must have same size in the server's log. The submission always shows this in the log file: [16|2019-08-21T21:12:35] connect from 191.35.15.190 [16|2019-08-21T21:12:39] running 12KB (123MB 133MB)

Re: [racket-users] does handin-server really need racket/gui/base?

2019-08-21 Thread 'Wayne Harris' via Racket Users
On Monday, August 19, 2019 10:40 PM, John Clements wrote: > I’m not looking at the code here, but I believe the issue here is that the > handin-server receives user code in a serialized-could-contain-images-format > that can’t be decoded properly without importing the gui libraries. That

Re: [racket-users] handin-server: writing a first checker

2019-08-23 Thread 'Wayne Harris' via Racket Users
On Friday, August 23, 2019 2:59 PM, Shu-Hung You wrote: > I forgot to CC my reply to the list. The case here is that the user > account data in `users.rktd` only contain one field but the default > `extra-fields` configuration requires 3 extra fields. The error > message probably comes from

Re: [racket-users] Re: drracket: disabling tools in edit -> preferences -> tools

2019-09-21 Thread 'Wayne Harris' via Racket Users
‐‐‐ Original Message ‐‐‐ On Friday, September 20, 2019 3:04 PM, gfb wrote: > Yes, the How To Design Programs (and possibly DeinProgramm ) tool relies > on the Test Engine tool. > > If you have a moment to do so, I'd encourage filing this consequence as an > issue on GitHub. Done.

Re: [racket-users] handin: how to forbid the use of a certain function

2019-09-27 Thread 'Wayne Harris' via Racket Users
‐‐‐ Original Message ‐‐‐ On Thursday, September 26, 2019 9:56 AM, Matthew Flatt wrote: > At Thu, 26 Sep 2019 00:46:23 +, "'Wayne Harris' via Racket Users" wrote: > > > I think my message below neither asked any question nor did it contain the > > adequat

Re: [racket-users] handin: how to forbid the use of a certain function

2019-09-25 Thread 'Wayne Harris' via Racket Users
-server. I'm not in a hurry. My objective is to prepare my tools now. When the time comes, I'll be ready.) Thank you and do please forgive me if my words lacked the proper adequacy. ‐‐‐ Original Message ‐‐‐ On Saturday, September 21, 2019 1:17 PM, 'Wayne Harris' via Racket Users wrote

Re: [racket-users] windows, file-or-directory-modify-seconds, can't find errno set to ENOENT

2019-11-01 Thread 'Wayne Harris' via Racket Users
‐‐‐ Original Message ‐‐‐ On Friday, November 1, 2019 5:46 PM, Matthew Flatt wrote: > Racket uses the native Windows API for filesystem operations, so it > generally creates exceptions with a 'windows value in the `errno` field > instead of a 'posix value. The `UNC_stat` function is also

Re: [racket-users] windows, file-or-directory-modify-seconds, can't find errno set to ENOENT

2019-11-01 Thread 'Wayne Harris' via Racket Users
‐‐‐ Original Message ‐‐‐ On Friday, November 1, 2019 6:40 PM, 'Wayne Harris' via Racket Users wrote: > ‐‐‐ Original Message ‐‐‐ > On Friday, November 1, 2019 5:46 PM, Matthew Flatt mfl...@cs.utah.edu wrote: > > > Racket uses the native Windows API for filesystem

[racket-users] windows, file-or-directory-modify-seconds, can't find errno set to ENOENT

2019-11-01 Thread 'Wayne Harris' via Racket Users
I have a function called ``older-than-days?'' which produces true if a path is older than a number of days. (Source code at the end of the message.) rac...@util.rkt> (older-than-days? 30 "c:/autoexec.bat") #t On Windows, if I give it a non-existent file, I can't seem to get an errno set to

[racket-users] drracket: disabling tools in edit -> preferences -> tools

2019-09-20 Thread 'Wayne Harris' via Racket Users
FWIW, I opened DrRacket (on a Windows system) and disabled some tools in preference -> tools. On restart, I got a dialog with title DrRacket Internal Error saying preferences:get: tired to get a preference but not default set for 'test-engine:enable?'. Pressing okay on the dialog window,

[racket-users] Re: Gtk initialization failed for display ":0"

2020-07-14 Thread 'Wayne Harris' via Racket Users
Matthew Flatt writes: > At Sat, 11 Jul 2020 10:36:33 -0600, Matthew Flatt wrote: >> Following up on Sam's suggestion, I recommend `xfvb-run` as something >> like >> >> xfvb-run racket -l handin-server > > Should be `xvfb-run`. I always have trouble getting those letters in > the right order.

[racket-users] Re: Gtk initialization failed for display ":0"

2020-07-14 Thread 'Wayne Harris' via Racket Users
Matthew Flatt writes: > At Sat, 11 Jul 2020 10:36:33 -0600, Matthew Flatt wrote: >> Following up on Sam's suggestion, I recommend `xfvb-run` as something >> like >> >> xfvb-run racket -l handin-server > > Should be `xvfb-run`. I always have trouble getting those letters in > the right order.

Re: [racket-users] Gtk initialization failed for display ":0"

2020-07-14 Thread 'Wayne Harris' via Racket Users
Matthew Flatt writes: > At Sat, 11 Jul 2020 10:36:33 -0600, Matthew Flatt wrote: >> Following up on Sam's suggestion, I recommend `xfvb-run` as something >> like >> >> xfvb-run racket -l handin-server > > Should be `xvfb-run`. I always have trouble getting those letters in > the right order.

[racket-users] Re: Racket on Corporate Desktop Windows

2021-03-30 Thread 'Wayne Harris' via Racket Users
"Bruce O'Neel" writes: [...] > But no GUI of course. > > Well I had been building on MacOS for years following the instructions > to build a Minimal Racket and then run > > raco pkg install -i main-distribution > > and it finally clicked that the instructions were almost identical for

[racket-users] Re: Understanding recursion in the function normalize-definition form the racket sources

2021-04-20 Thread 'Wayne Harris' via Racket Users
On Sat, 17 Apr 2021 05:02:00 -0700 (PDT) Dan Synek wrote: > I am trying to implement a variation of define. In order to do that I am > trying to understand the source of the define macro in racket. > It calls a function normalize-definition which looks like this: > (define-values

[racket-users] looking for advice on a web background process manager

2021-12-30 Thread 'Wayne Harris' via Racket Users
I'm considering writing a manager for background processes --- such as send a batch of e-mail or other process that takes a while to finish --- for a web system. I see the challenge here as just writing something that will look like a very basic UNIX shell --- so I'll call it ``web-api-shell''