[racket-users] Re: “If you could have a wish granted, what would you like to see next in Racket?”

2020-07-25 Thread Marc Kaufmann
1. More how-to guides/good practice guides and discussions of some Racket specific features: continuations (especially for the web); Typed Racket; parameters/dynamic scope. Maybe macros, but I don't use them, so can't comment on whether I'd miss how-tos for it. I like "the 4 types of

Re: [racket-users] Gradual Typed Racket?

2020-04-17 Thread Marc Kaufmann
Fantastic, thanks for the clarification Ben. I'll start using it to see what it does, as I have a few functions that occasionally throw errors through contracts - which I should call 'blame' - yet I can't figure out much from it. On Fri, Apr 17, 2020 at 6:09 PM Ben Greenman wrote: > On 4/17/20,

Re: [racket-users] Gradual Typed Racket?

2020-04-17 Thread Marc Kaufmann
Hi Ben, you wrote (snip): For contracts, though, (provide (contract-out ...)) gives better error > messages than define/contract. > In what sense is this the case, and where can I read more about the differences, as well as how to improve errors of contracts? Is it related to this part of

Re: [racket-users] Switch off type checking via typed/racket/no-check fails on typed big-bang

2020-04-01 Thread Marc Kaufmann
Thanks Ben. On Tue, Mar 31, 2020 at 4:41 AM Ben Greenman wrote: > On 3/25/20, Marc Kaufmann wrote: > > Hi, > > > > I am trying to switch off type checking on a file so that I can prototype > > faster without the wait for the type checker. However, my code also us

Re: [racket-users] How to find source file loaded by/relevant for (require )?

2020-03-29 Thread Marc Kaufmann
s > > On Mar 27, 2020, at 03:56, Marc Kaufmann > wrote: > > Hi, > > I am trying to set up vim such that it jumps to the correct source file > when I see a `(require some-module)`. With packages that I have installed > myself, I have managed to do so (80% solution), since t

[racket-users] How to find source file loaded by/relevant for (require )?

2020-03-27 Thread Marc Kaufmann
Hi, I am trying to set up vim such that it jumps to the correct source file when I see a `(require some-module)`. With packages that I have installed myself, I have managed to do so (80% solution), since they get installed in $HOME/.racket//pkgs. However, I can't quite figure out where all

[racket-users] Switch off type checking via typed/racket/no-check fails on typed big-bang

2020-03-25 Thread Marc Kaufmann
Hi, I am trying to switch off type checking on a file so that I can prototype faster without the wait for the type checker. However, my code also uses typed/2htdp/universe and typed/2htdp/image, and I get an error on `big-bang`: > Type Checker: Macro big-bang from typed module used in untyped

Re: [racket-users] Types for formlets

2020-03-09 Thread Marc Kaufmann
er/blob/master/web-server-lib/web-server/formlets/unsafe/lib.rkt>—in > Typed Racket and writing a typed version of the `formlet` macro that > expands to them. You could still use the library formlets by importing them > with `require/typed` at some concrete type. > > I'm happy

[racket-users] Types for formlets

2020-02-24 Thread Marc Kaufmann
Hi all, I wonder what the best way is to integrate formlets into typed programs. I simply `require/typed` formlet-display as type (-> Any Any), which is not illuminating, but the display part is rarely the problem. formlet-process is tricky. The earliest point at which I 'know' the type of

Re: [racket-users] TR dependent types cannot check equality of symbols

2020-02-24 Thread Marc Kaufmann
Very nice, adding (: get-user-var (case-> ...)) indeed does the trick. So I can use `case->` to do overloading (if that's what it is called), by defining different functions for different type signatures, and then put them together into a single function via a cond. E.g.: (: int-add (->

[racket-users] TR dependent types cannot check equality of symbols

2020-02-22 Thread Marc Kaufmann
Hi, I worked my way through the blog posts on refinement types (https://blog.racket-lang.org/2017/11/adding-refinement-types.html) and through the docs

Re: [racket-users] How do I just run the type checker?

2020-02-21 Thread Marc Kaufmann
ter the next time since it won't have to re-compile. > > Sam > > On Fri, Feb 21, 2020 at 12:13 PM Marc Kaufmann > > wrote: > > > > Hi, > > > > the way I currently check my web server is by simply running `racket > server.rkt` on the command line. Howe

[racket-users] Re: xrepl ,require-reloadable and ,require

2020-02-21 Thread Marc Kaufmann
ot; Step 2: > ,r "code.rkt" dance even for standard Racket? Or what workflow do people use to reload files quickly (that does not depend on Emacs/Racket-mode)? Cheers, Marc On Tuesday, October 8, 2019 at 1:32:20 PM UTC+2, Marc Kaufmann wrote: > > Hi, > > according to the

[racket-users] How do I just run the type checker?

2020-02-21 Thread Marc Kaufmann
Hi, the way I currently check my web server is by simply running `racket server.rkt` on the command line. However, this also launches the server, which I usually do want to, but not always. So is there a way to run just the type checker -- plus all the compile-time stuff that needs to happen

Re: [racket-users] Change error message of web server continuations from "Sorry, this page has expired. Please go back."

2019-12-23 Thread Marc Kaufmann
ponse?` function instead. > > On Mon, Dec 23, 2019 at 6:55 AM Marc Kaufmann > wrote: > > > > In order to do everything as I do now - where I have been blissfully > unaware of the managers - I do > > > > ``` > > (define the-manager-with-threshold (m

Re: [racket-users] Change error message of web server continuations from "Sorry, this page has expired. Please go back."

2019-12-23 Thread Marc Kaufmann
on my server. Good to know. On Mon, Dec 23, 2019 at 1:24 PM George Neuner wrote: > > On 12/23/2019 6:54 AM, Marc Kaufmann wrote: > > By the way, where does it say that the default is 130MB? > > In the docs for serve/servlet. > > > Can I set the instance-expiration-

Re: [racket-users] Change error message of web server continuations from "Sorry, this page has expired. Please go back."

2019-12-23 Thread Marc Kaufmann
gt; > -Philip > > On Sat, Dec 21, 2019 at 3:31 PM George Neuner > wrote: > >> >> On 12/21/2019 4:38 AM, Marc Kaufmann wrote: >> >> >> Did you perhaps change the continuation manager - or its setup? >>> >>> https://docs.racket-lang.org

Re: [racket-users] Can I somehow connect to and update values in a specific hash table used by a running web server?

2019-12-22 Thread Marc Kaufmann
#:listen-ip "0.0.0.0"))) > (thread (λ () > (serve/servlet tweaker > #:servlet-path "" > #:servlet-regexp #rx"" > #:port 9090 >

[racket-users] Can I somehow connect to and update values in a specific hash table used by a running web server?

2019-12-21 Thread Marc Kaufmann
Hi all, one useful feature of the Django web framework is that it is easy to access the database and change it on the fly. I am not using a DB, but a hash inside of Racket for various reasons. I understand that it would be easy to connect to a database in any language, and getting the hash is

Re: [racket-users] Change error message of web server continuations from "Sorry, this page has expired. Please go back."

2019-12-21 Thread Marc Kaufmann
> Did you perhaps change the continuation manager - or its setup? > > https://docs.racket-lang.org/web-server/servlet.html?q=ffi#%28part._managers%29 > > > No, not really. I simply import send/suspend/dispatch etc and use them without doing anything in particular. I am requiring them within

[racket-users] Change error message of web server continuations from "Sorry, this page has expired. Please go back."

2019-12-20 Thread Marc Kaufmann
Hi all, reading a past thread started by me, I realize that I should have learned how to implement Philip's advice on using stateless continuations, but well I didn't. So I still use vanilla `send/suspend/dispatch` and hence my users hit the "Sorry, this page has expired. Please go back." The

Re: [racket-users] Typed Racket: 'Unable to protect opaque value passed as `Any`' with interesting behavior

2019-12-16 Thread Marc Kaufmann
t I really don't know how to type (it has formlets in it). Do I have to change the return value of the function? Write a wrapper function that does the type checking inside of the typed module? Are there any best practices? Cheers, Marc On Wednesday, December 11, 2019 at 5:05:08 PM UTC+1, Mar

Re: [racket-users] How to use dates (especially gregor) with Typed Racket?

2019-12-11 Thread Marc Kaufmann
On Saturday, December 7, 2019 at 3:04:25 PM UTC+1, Ben Greenman wrote: > > On 12/7/19, Marc Kaufmann > wrote: > > Thanks Ben and Jon, that did the trick. > > > > I realized when following the code that the structure wasn't exported - > but > > > >

Re: [racket-users] Typed Racket: 'Unable to protect opaque value passed as `Any`' with interesting behavior

2019-12-11 Thread Marc Kaufmann
way that information for something that > you provide to untyped parts of your program, you've thrown away the > information Typed Racket needed to generate a more useful contract. So > instead, Typed Racket generates the best contract it can, which is as > described above. > &g

[racket-users] Using typed racket with web server continuations `(send/suspend/dispatch ...)`

2019-12-11 Thread Marc Kaufmann
Hi, if possible, I'd like to use web server continuations with `(send/suspend/dispatch...)`. However, currently I need to return something of type `response?`, but when send/suspend/dispatch (and friends) don't return a response - they send it to the client and return `Any` (or other types).

[racket-users] Re: Typed Racket: 'Unable to protect opaque value passed as `Any`' with interesting behavior

2019-12-11 Thread Marc Kaufmann
And I forgot: What is the cryptic error message 'any-wrap/c: Unable to protect opaque value passed as `Any`' telling me? That response is opaque and ... what? Cheers, Marc On Wednesday, December 11, 2019 at 2:31:37 PM UTC+1, Marc Kaufmann wrote: > > Hello, > > I have one file

[racket-users] Typed Racket: 'Unable to protect opaque value passed as `Any`' with interesting behavior

2019-12-11 Thread Marc Kaufmann
Hello, I have one file called `type-test.rkt` with the following (notice that I discovered that there is a typed version of the web-server/http module, which solves another of my issues): ``` #lang typed/racket (require (only-in typed/web-server/http response/xexpr response)) (provide f1 f2

[racket-users] How can I tell Typed Racket that xexpressions are xexpressions?

2019-12-10 Thread Marc Kaufmann
Welcome to this week's edition of "Confusing myself with Typed Racket".* I want to import `response/xexpr-wrap` -- a version of `response/xexpr` that does some additional styling -- in a typed/racket file. So thanks to Ben and Jon in another thread, I now do ``` (require/typed xml [#:opaque

Re: [racket-users] How to use dates (especially gregor) with Typed Racket?

2019-12-07 Thread Marc Kaufmann
I meant `require/typed` obviously, not `require-typed`. On Saturday, December 7, 2019 at 11:17:00 AM UTC+1, Marc Kaufmann wrote: > > Thanks Ben and Jon, that did the trick. > > I realized when following the code that the structure wasn't exported - > but I didn't know how to work

Re: [racket-users] How to use dates (especially gregor) with Typed Racket?

2019-12-07 Thread Marc Kaufmann
Thanks Ben and Jon, that did the trick. I realized when following the code that the structure wasn't exported - but I didn't know how to work around that. I now also checked the documentation, and the only thing I found on opaque types is

[racket-users] How to use dates (especially gregor) with Typed Racket?

2019-12-03 Thread Marc Kaufmann
Hi, this is hopefully easier, but I can't figure out how to `(require/typed gregor)` inside a typed racket file. Here are my failed attempts (I want time to work, hence I try to import gregor/time): ``` #lang typed/racket ; Try to get time struct from gregor/time (require/typed gregor/time

Re: [racket-users] Typed Racket needs annotation to realize (Mutable-HashTable Symbol Symbol) is of a more general type

2019-11-06 Thread Marc Kaufmann
as to why it fails. Cheers, Marc On Wed, Nov 6, 2019 at 2:05 PM Ben Greenman wrote: > On 11/6/19, Marc Kaufmann wrote: > > I assumed it was something to do with mutability, but I don't understand > > what you mean when you say there is a two-way channel. The reference in >

Re: [racket-users] Typed Racket needs annotation to realize (Mutable-HashTable Symbol Symbol) is of a more general type

2019-11-05 Thread Marc Kaufmann
e)))`. > > Sam > > > On Tue, Nov 5, 2019 at 6:39 AM Marc Kaufmann > wrote: > > > > Hi, > > > > in order to put some discipline on my code (and formalize to myself what > I'm passing around), I started using typed racket. I have definitely hit my > sh

[racket-users] Typed Racket needs annotation to realize (Mutable-HashTable Symbol Symbol) is of a more general type

2019-11-05 Thread Marc Kaufmann
Hi, in order to put some discipline on my code (and formalize to myself what I'm passing around), I started using typed racket. I have definitely hit my share of gotchas that make me scratch my head, but I kind of start to understand how things work and adding `(ann this-is ThatType)`

Re: [racket-users] Re: General ways and concrete examples of approaching web dev

2019-10-09 Thread Marc Kaufmann
eadlines, but I'll have a look. And see, I didn't even know such things existed (and am still not quite sure what part of the work they are for, but we'll see). Cheers, Marc On Wed, Oct 9, 2019 at 9:30 AM George Neuner wrote: > > Rearranged a bit for continuity ... > > > On Tue

Re: [racket-users] General ways and concrete examples of approaching web dev

2019-10-08 Thread Marc Kaufmann
ideas to the web server. Thanks for the reply and the tutorial, I'll have a look. Cheers, Marc On Mon, Sep 30, 2019 at 2:48 PM Jens Axel Søgaard wrote: > Hi Marc, > > Den tir. 24. sep. 2019 kl. 21.28 skrev Marc Kaufmann < > marc.kaufman...@gmail.com>: > >> TL

[racket-users] xrepl ,require-reloadable and ,require

2019-10-08 Thread Marc Kaufmann
Hi, according to the docs (https://docs.racket-lang.org/xrepl/index.html#%28xrepl._require-reloadable%29) I would have assumed that when I do > ,require-reloadable "code.rkt" that I can use whatever "code.rkt" provides, the same way as when I do > ,require "code.rkt" However, when I do

[racket-users] Does Racket have something similar to IPython.embed() for debugging?

2019-10-04 Thread Marc Kaufmann
Hi, a friend who uses Python mentioned that how he debugs is via `embed()`, which launches an IPython console at the point it is called with all the variables that exist at that point being defined, so you can inspect a bunch without sprinkling prints everywhere. ```{python} from IPython

Re: [racket-users] Testing Servlets: exceptions not raised/passed through; how to pass extra arguments to tested servlet

2019-09-26 Thread Marc Kaufmann
PM Jay McCarthy wrote: > On Thu, Sep 26, 2019 at 5:46 AM Marc Kaufmann > wrote: > > > > Thanks for clearing this up. If I understand correctly, the following > happens: > > > > - the servlet raises an exception > > - this is caught by the default exceptio

Re: [racket-users] Testing Servlets: exceptions not raised/passed through; how to pass extra arguments to tested servlet

2019-09-26 Thread Marc Kaufmann
ufficient test of what you want to check that no exception is > thrown, you want to make sure a desirable page is returned. > > Jay > > -- > Jay McCarthy > Associate Professor @ CS @ UMass Lowell > http://jeapostrophe.github.io > Vincit qui se vincit. > > >

[racket-users] General ways and concrete examples of approaching web dev

2019-09-24 Thread Marc Kaufmann
Hi all, TL;DR: What are some patterns/approaches for web sites for which Racket is particularly suited *and* for which you can point at decently written up examples in Racket or other languages that share such features? Much longer me: I spent much of summer implementing online web sites with

[racket-users] Testing Servlets: exceptions not raised/passed through; how to pass extra arguments to tested servlet

2019-09-24 Thread Marc Kaufmann
Hi all, I have gone through https://docs.racket-lang.org/web-server/test.html to finally stop manually checking whether I didn't introduce new bugs in one of my servlets. I think that I have figured out most of the wrinkles for this, except one. I run my tests via `raco test server.rkt`, and

Re: [racket-users] How to disable back button in web application

2019-09-21 Thread Marc Kaufmann
, but will check later. (I actually don't know how clear-continuations-table! could delete only continuations of the current user, since it can't know about users - so my guess is that this will not work.) On Sat, Sep 21, 2019 at 10:05 AM Marc Kaufmann wrote: > Could I use the send/forward to essentia

Re: [racket-users] How to disable back button in web application

2019-09-21 Thread Marc Kaufmann
gracefully failing. I'm not going to win any design contests that way, but solve a problem without dealing with any database interactions. On Fri, Sep 20, 2019 at 2:03 PM Jens Axel Søgaard wrote: > Den fre. 20. sep. 2019 kl. 13.51 skrev Marc Kaufmann < > marc.kaufman...@gmail.com>:

Re: [racket-users] How to disable back button in web application

2019-09-20 Thread Marc Kaufmann
art._.The_.Double_.Submit_.Error%29 > > The whole Continue tutorial is worth the time spent. > > s. > > > On Fri, Sep 20, 2019 at 12:32 PM Jens Axel Søgaard > wrote: > >> Is `send/forward` what you need? >> >> Den fre. 20. sep. 2019 kl. 11.43 skr

[racket-users] How to disable back button in web application

2019-09-20 Thread Marc Kaufmann
Hi all, disclaimer: I am guessing that my current design simply doesn't allow me (easily) what I want, but there may be a solution I am unaware of. In my Racket-powered website I want to disable the back button or keep people from using the back button to resubmit (with different data) a

Re: [racket-users] What is a (the?) way to track requirements for a web or app with Racket?

2019-09-16 Thread Marc Kaufmann
So the easiest to do is to create such an info.rkt file and call `raco pkg install app-name/` -- and that should work even if I don't do the `raco exe` and `raco distribute`? On Mon, Sep 16, 2019 at 11:04 AM Bogdan Popa wrote: > > Marc Kaufmann writes: > > > this is surely ans

[racket-users] What is a (the?) way to track requirements for a web or app with Racket?

2019-09-16 Thread Marc Kaufmann
Hi, this is surely answered somewhere, but I have not made much progress. If you know python, what I want to do is essentially $ pip install requirements.txt where requirements.txt has a list (one per line) of packages and their versions to install (usually installed into a virtual

Re: [racket-users] vi-mode for racket cli

2019-09-13 Thread Marc Kaufmann
e and you have vi-mode with jj letting you escape into command mode. On Monday, April 15, 2019 at 10:55:04 AM UTC+2, Marc Kaufmann wrote: > > Fantastic, that was faster and easier than I thought! So nice to not > constantly mess up all my commands any more... A good start to a new week

[racket-users] Amazon Mechanical Turk library/package in racket

2019-09-11 Thread Marc Kaufmann
Hi all, I was wondering if there is a Racket library that makes it easy to interface with Amazon's Mechanical Turk interface (https://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/Welcome.html) and if anyone has some code lying around on how to do so? I know that there is the aws package

Re: [racket-users] vi-mode for racket cli

2019-04-15 Thread Marc Kaufmann
Fantastic, that was faster and easier than I thought! So nice to not constantly mess up all my commands any more... A good start to a new week. :-) Cheers, Marc On Mon, Apr 15, 2019 at 10:51 AM Marc Kaufmann wrote: > Ha, thanks. I should have searched the docs for readline, not for vi-m

Re: [racket-users] vi-mode for racket cli

2019-04-15 Thread Marc Kaufmann
>, with an additional > note that `racket -il xrepl` is another way to start racket with readline > support (once you have readline-gpl installed). Best! > Tom > > > On Mon, Apr 15, 2019 at 1:20 AM Marc Kaufmann > wrote: > >> Hi all, >> >> I use vi-mode i

[racket-users] vi-mode for racket cli

2019-04-15 Thread Marc Kaufmann
Hi all, I use vi-mode in the cli and in all the repls that use readline. Racket's repl does not use readline for reading. Is there a way to get vi-mode going anyway, either by wrapping readline around first or something else? And if it's possible, would this require switching off something

Re: [racket-users] Struct subtype with default/fixed value of super-type

2019-03-18 Thread Marc Kaufmann
pt I guess if you pass through different phase levels, it becomes a > bit more complicated because you have a syntax attached at compile-time to > the identifier. But that's another issue. > Correct me if I'm wrong. > > On Monday, March 18, 2019 at 2:11:46 PM UTC+1, Marc Kaufmann wrote:

Re: [racket-users] Struct subtype with default/fixed value of super-type

2019-03-18 Thread Marc Kaufmann
Yes, I saw that, the problem is that I want to be able to set a (potentially different) default value for the sub-type shark than for the sub-type guppy. So if I set the value to 'big for all `fish`, then I can't do that. Essentially, I'd need an #:auto for every sub-type, but the #:auto refers to

Re: [racket-users] How to launch image display from racket REPL?

2019-03-16 Thread Marc Kaufmann
not available" error. That seems like it > might be a bug.) > > -Philip > > > On Sat, Mar 16, 2019 at 10:48 AM Marc Kaufmann > wrote: > >> Hi, >> >> I am playing around with big-bang in 2htdp/universe and images in >> 2htdp/image. When

[racket-users] How to launch image display from racket REPL?

2019-03-16 Thread Marc Kaufmann
Hi, I am playing around with big-bang in 2htdp/universe and images in 2htdp/image. When I launch big-bang from racket on the cli (not DrRacket), it does somehow call a window and display the images with my render function. However, when I want to test the render functions, I want to run them

[racket-users] Struct subtype with default/fixed value of super-type

2019-03-15 Thread Marc Kaufmann
Hi all, suppose I have a struct `(struct fish (size name) #:transparent)` and a sub-type `(struct shark fish (scares-people?) #:transparent)`. What if I want all sharks to have size 'large by default whenever I create one, so that I create them via: (define white-shark (shark "The big white"

Re: [racket-users] How to fix typos in documentation?

2019-03-09 Thread Marc Kaufmann
I agree with Greg that such a feature would be neat - so it's great that Ben and Kieran are on it already. (Thanks!) The CONTRIBUTING.md is a good idea (and I David's version). The 'Edit on Github' button would solve the first stumbling block I hit, while the contribution.md file helps later in

Re: [racket-users] How to fix typos in documentation?

2019-03-08 Thread Marc Kaufmann
, the above at least tells you how you can submit that PR, another Issue, leading to another PR... turtles all the way down. Cheers, Marc PS: This was so utterly painful to write up. If someone knows of tools to record workflows online, that would be really nice. Writing isn't really the right interfa

Re: [racket-users] How to fix typos in documentation?

2019-03-07 Thread Marc Kaufmann
Ergh, of course I forgot to do that part. Thanks for catching that. On Thu, Mar 7, 2019 at 1:59 PM Paulo Matos wrote: > > > On 07/03/2019 13:40, Marc Kaufmann wrote: > > Thanks Paulo, this is way better than the workflow I used the only other > > time I made a PR. The o

Re: [racket-users] How to fix typos in documentation?

2019-03-07 Thread Marc Kaufmann
by the way. Cheers, Marc On Thu, Mar 7, 2019 at 12:02 PM 'Paulo Matos' via Racket Users < racket-users@googlegroups.com> wrote: > > > On 07/03/2019 11:55, Marc Kaufmann wrote: > > Hi, > > > > I just came across a typo in the documentation and was about to move

[racket-users] How to fix typos in documentation?

2019-03-07 Thread Marc Kaufmann
Hi, I just came across a typo in the documentation and was about to move on simply because I couldn't be bothered to figure out how/where to change it. I couldn't find the docs in the github repo (I searched for doc, and looked under racket-lang-org without success). Also, is there a guide

[racket-users] How do you make students submit programming assignments online for automatic tests?

2019-02-20 Thread Marc Kaufmann
Hi all, I will be teaching a course on data analysis in R next year (September), and may at some point add some Racketeering to my other courses (maybe), and I was wondering how those of you who teach programming classes deal with programming assignments. Are there somewhat

Re: [racket-users] web-server/http documentation: "You are unlikely to need to construct a request struct." Why?

2019-02-20 Thread Marc Kaufmann
OK, so there is no reason for me to leave the racket world for that type of tests. Thanks. On Wed, Feb 20, 2019 at 4:25 PM Jay McCarthy wrote: > On Wed, Feb 20, 2019 at 10:23 AM Marc Kaufmann > wrote: > > I came across this statement regarding structure request in the > docu

[racket-users] web-server/http documentation: "You are unlikely to need to construct a request struct." Why?

2019-02-20 Thread Marc Kaufmann
Hi all, I came across this statement regarding structure request in the documentation: "You are unlikely to need to construct a request struct." (See here .) Why does it

Re: [racket-users] Re: How To Design Classes text not available?

2019-02-04 Thread Marc Kaufmann
Thanks for that nifty tip for quick bookmarking Neil. Quick Searches: > > Name: [SEARCH] DUCKDUCKGO > Location: https://start.duckduckgo.com/?q=%s=hb=-2=web > Keyword: d > > For anyone else who might want it (but not quite know how): the way I got it going was 1. Go do some search with

Re: [racket-users] side by side; scribble

2019-01-30 Thread Marc Kaufmann
pecific commands and use them, as appropriate. > > Robby > > On Wed, Jan 30, 2019 at 1:57 AM Marc Kaufmann > wrote: > >> Since you say that it requires dropping to the latex level, does it mean >> that doing a synchronization of scribble and other output (say, HTML or >&g

Re: [racket-users] side by side; scribble

2019-01-29 Thread Marc Kaufmann
Since you say that it requires dropping to the latex level, does it mean that doing a synchronization of scribble and other output (say, HTML or something else that doesn't require anything from outside scribble and racket) can be done directly? Essentially: ``` @title{Synchronize this!} Can

Re: [racket-users] Web server hits "Sorry, this page has expired. Please go back."

2018-10-13 Thread Marc Kaufmann
ay that big-bang in HTDP/2e does it. That was a real missing-the-forest-for-the-trees moment for me. The benefits of stateless servlets are mostly just the benefits of not > using server-side state in general. The main disadvantage is that you need > to ensure data structures that will b

Re: [racket-users] Web server hits "Sorry, this page has expired. Please go back."

2018-10-13 Thread Marc Kaufmann
Hi George, thanks, this is incredibly helpful. On Sat, Oct 13, 2018 at 9:11 PM George Neuner wrote: > Hi Marc, > > On 10/13/2018 12:17 PM, Marc Kaufmann wrote: > > > On Sat, Oct 13, 2018 at 5:49 PM George Neuner > wrote: > >> >> When the program i

Re: [racket-users] Web server hits "Sorry, this page has expired. Please go back."

2018-10-13 Thread Marc Kaufmann
On Sat, Oct 13, 2018 at 5:49 PM George Neuner wrote: > Hi Marc, > > On 10/13/2018 10:42 AM, Marc Kaufmann wrote: > > Thanks George and Philip. > > George, while I am sure that in some places I allow using continuations > after a delay, that's not what I meant.

Re: [racket-users] Web server hits "Sorry, this page has expired. Please go back."

2018-10-13 Thread Marc Kaufmann
given to your servlet's manager, rather than using the default from > `serve/servlet` or equivalent. > > Stateless servlets avoid this issue by making continuations serializable, > so they can be saved on the client, in a database, etc. > > -Philip > > > On Sat, Oct 13,

[racket-users] Web server hits "Sorry, this page has expired. Please go back."

2018-10-13 Thread Marc Kaufmann
Hi all, I am running the Racket web server with continuations and I keep getting "Sorry, this page has expired. Please go back." rather sporadically. I can't seem to figure out why and when this happens. I get it more on my local server running on localhost. A few patterns that I believe are

[racket-users] Re: Using ctags and vim with Racket

2018-09-14 Thread Marc Kaufmann
: > > > > On Thursday, September 13, 2018 at 10:19:37 PM UTC+8, Marc Kaufmann wrote: >> >> Hi all, >> >> for the first time I wanted to use ctags today, which generates a bunch >> of tags so that one can jump to and from function definitions and the like >>

[racket-users] Using ctags and vim with Racket

2018-09-13 Thread Marc Kaufmann
Hi all, for the first time I wanted to use ctags today, which generates a bunch of tags so that one can jump to and from function definitions and the like in vim. However, the program generates no tags whatsoever for Racket, which wasn't too surprising. I am using the vim-racket plugin. Does

Re: [racket-users] What does `raco test file.rkt` do by default if no `test` submodule?

2018-09-07 Thread Marc Kaufmann
> Scribble so you'll need to actually look in the code. I keep meaning to > Scribbleify it but haven't found the tuits. I also have chosen not to have > a handy/main.rkt that would pull in all the pieces of handy, since I feel > like it's better to be explicit about what you want. I

[racket-users] What does `raco test file.rkt` do by default if no `test` submodule?

2018-09-06 Thread Marc Kaufmann
Hi, I am starting to use raco test for testing, and found out that in a file without (module test ...), it may run some kind of test on the file. But for some files, raco test reports that it ran a test, for others however no test is run. Right now I am now adding a (module test racket/base)

Re: [racket-users] European Racketeers and conferences

2017-08-24 Thread Marc Kaufmann
I'm in Hungary, but regularly (3 times or more per year) travelling to Germany/Benelux. I am more likely to make a meetup if it falls in an academic holiday and is arranged at least 6 months in advance, given that I am unlikely to travel that distance for just one meetup (even if it is,

Re: [racket-users] How to build new formlets that allow passing default values (such as hidden)?

2017-08-23 Thread Marc Kaufmann
at `formlet-processing` doesn't? Any working example with embed-formlet is appreciate, even if it is not the same as mine. Thanks, Marc On Thu, Mar 16, 2017 at 2:11 PM, Marc Kaufmann <marc.kaufman...@gmail.com> wrote: > Thanks Philip. I checked out the links, but I fear that it's over

Re: [racket-users] Strange (to me) error in 'query-exec for io:read-le-intN

2017-04-05 Thread Marc Kaufmann
On 4/5/2017 2:56 PM, David Storrs wrote: > >> On Wed, Apr 5, 2017 at 1:39 PM, Marc Kaufmann <marc.kaufman...@gmail.com> >> wrote: >> > Thanks David, that makes a little sense also because it often happens >> after >> > there has been no activit

Re: [racket-users] Strange (to me) error in 'query-exec for io:read-le-intN

2017-04-05 Thread Marc Kaufmann
e > string-append: > > (query-exec > dbc > "INSERT INTO participant (subscribed, next_matrix, > completion_code, comprehension_incorrect, comprehension_question) > VALUES (1, 1, ?, 0, 0)" > (random 100)) > > > Hope this helps, &g

[racket-users] Strange (to me) error in 'query-exec for io:read-le-intN

2017-04-05 Thread Marc Kaufmann
Hi all, I have the following code that occasionally throws an error when called, but definitely not always: " (define (study-add-participant! a-study) (displayln-date) (define dbc (study-db a-study)) (displayln "Inserting new participant...") (query-exec dbc (string-join

Re: [racket-users] nginx with Racket web server

2017-04-01 Thread Marc Kaufmann
Ergh... Indeed, that did the trick. Thanks Daniel. On Sat, Apr 1, 2017 at 5:34 PM, Daniel Brunner <dan...@dbrunner.de> wrote: > Hi Marc, > > I used this setup several times. > > Marc Kaufmann <marc.kaufman...@gmail.com> hat am 1. April 2017 um 23:01 > geschrieb

[racket-users] nginx with Racket web server

2017-04-01 Thread Marc Kaufmann
Hi all, this should be simple, but I couldn't get it working, so I am here. I am using nginx on my server since I have multiple domains. I am trying to pass all the requests to this particular instance to the Racket server, which according to the docs works like this for Apache: RewriteEngine

Re: [racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread Marc Kaufmann
wrote: > > On 3/21/2017 8:36 PM, Marc Kaufmann wrote: > > Thanks. But I have to turn it into a string before storing it in the > database; when I tried to store a serialized list in it (in a VARCHAR > field), it complained that it expected a string. That's where all the > troub

Re: [racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread Marc Kaufmann
ot; > > (with-input-from-string "((3) 0 () 0 () () (q (0 1) (1 0)))" > read) > '((3) 0 () 0 () () (q (0 1) (1 0))) > > (deserialize '((3) 0 () 0 () () (q (0 1) (1 0 > '((0 1) (1 0)) > > On Tue, Mar 21, 2017 at 6:53 PM Marc Kaufmann <marc.kaufman...@

Re: [racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread Marc Kaufmann
Regarding not using deserialize directly: I may be using deserialize in the wrong way, but the following doesn't work (and I had tried that before posting): > (define-values (in out) (make-pipe)) > (write (~a (serialize '((0 1) (1 0) "((3) 0 () 0 () () (q (0 1) (1 0)))" > (write (~a

[racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread Marc Kaufmann
Hi, I want to store matrices of the following form (but larger) in a database: (define m '((0 1) (1 0))) Currently I manage to store them by turning them into strings first via: (~a (serialize m)); Or just drop the serialize, but I figured I might benefit from it later. The problem is that

Re: [racket-users] How to build new formlets that allow passing default values (such as hidden)?

2017-03-16 Thread Marc Kaufmann
b-server%2Flang%2Fwe#%28mod-path._web-server%2Flang%2Fweb-param%29). > > > > -Philip > > > > On Tue, Mar 14, 2017 at 1:48 PM, Marc Kaufmann <marc.ka...@gmail.com> wrote: > > > > Thanks for the detailed answer Philip! Some of it is definitely over my

Re: [racket-users] Require the same file repeatedly for debugging on command line

2017-03-15 Thread Marc Kaufmann
15, 2017 at 10:35 AM, Greg Hendershott < greghendersh...@gmail.com> wrote: > Have you tried using XREPL -- perhaps its ,enter command or > ,require-reloadable? > > https://docs.racket-lang.org/xrepl/index.html > > On Mon, Mar 13, 2017 at 9:44 PM, Marc Kaufmann > <marc.kaufm

Re: [racket-users] How to build new formlets that allow passing default values (such as hidden)?

2017-03-14 Thread Marc Kaufmann
nput ([type "submit"])))) >> user-id) > > and then define matrix-submission as > >> (define (matrix-submission req user-id) >> (define number-of-ones >> (formlet-process matrix-formlet req)) >> ...) > > > -P

Re: [racket-users] Why does 1 count as numeric in xexpr, but 0 does not?

2017-03-14 Thread Marc Kaufmann
Fair enough if that's the specification, even if it is unexpected (to me at least). Thanks, Marc On Tuesday, March 14, 2017 at 10:41:02 AM UTC-4, Jay McCarthy wrote: > Hi Marc, > > libxml2 only allows numeric entity references in this range: > > * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF]

[racket-users] How to build new formlets that allow passing default values (such as hidden)?

2017-03-14 Thread Marc Kaufmann
Hi, I have created a formlet like so: (define (matrix-formlet id) (formlet (#%# ,{input-string . => . ones} ,{(to-string (required (hidden id))) . => . user-id} ) (values ones user-id))) I display this as follows: `(form ((action

Re: [racket-users] Why does 1 count as numeric in xexpr, but 0 does not?

2017-03-14 Thread Marc Kaufmann
49. > > > > -Philip > > > > On Mon, Mar 13, 2017 at 8:38 PM, Marc Kaufmann <marc.ka...@gmail.com> wrote: > Hi, > > > > I am creating matrices of 0s and 1s that I display in HTML-tables and > somewhat surprisingly I found out that 0s ar

[racket-users] Require the same file repeatedly for debugging on command line

2017-03-13 Thread Marc Kaufmann
Hi all, while trying to debug, I often change the code in the text file and then want to do a (require "file-with-code.rkt") on the command line to test the new code. This never works, because I cannot redefine imported modules. Thus I always use Dr Racket for this, where I can hit the "Run"

[racket-users] Why does 1 count as numeric in xexpr, but 0 does not?

2017-03-13 Thread Marc Kaufmann
Hi, I am creating matrices of 0s and 1s that I display in HTML-tables and somewhat surprisingly I found out that 0s are not permissible in X-expressions, while 1s are: (require web-server/http) (response/xexpr '(html 1)) ; Fine, no trouble. (response/xexpr '(html 0)) ; Blow-up. The specific

[racket-users] Re: Plot with text annotation inside the graph

2016-10-16 Thread Marc Kaufmann
abel (lambda (x) (* (sin x) 0.2)) -1.8 "sin(x)" > #:point-size 0)) > #:x-min -2 #:x-max 2) > > Alex. > > On Saturday, October 15, 2016 at 10:29:07 AM UTC+8, Marc Kaufmann wrote: > > Hi all, > > > > I am creating some graphs where I

[racket-users] Plot with text annotation inside the graph

2016-10-14 Thread Marc Kaufmann
Hi all, I am creating some graphs where I want to label various regions as region A, B, C, and so on. Currently I am doing this by coloring the regions differently and having the labels in legend: (plot-file (list (axes) (function-interval (lambda (x) 0) MD 0 E_x #:label

Re: [racket-users] Include link in email: what headers to use?

2016-03-27 Thread Marc Kaufmann
them all in a single string, you'd need to > separate them with an \r\n sequence, not with semicolons. So pass two > separate strings as the last two arguments: > > "Return-Path: <mkaufm...@g.harvard.edu>" > "Content-Type: text/html; charset=iso-8859-1&quo

  1   2   >