[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 quick fix is to 
tell them that they should go to page xyz.com. But I don't know how I can 
easily change this error message to add a link. Anyone?

I'm about to leave for travel or else I would have done some digging around.

Cheers,
Marc

PS: For some reason I keep hitting these errors faster than in the past - 
as in, within a few minutes. Any idea why that might be and how to increase 
the time? I can crank up the RAM of the machine too, anything that cuts 
down on developer time really. I'll be back in the new year to actually fix 
this, but not now.

-- 
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/31aed0b4-c9df-4ccb-9e10-92df3dd3952c%40googlegroups.com.


[racket-users] Third call for draft papers for TFPIE 2020 (Trends in Functional Programming in Education)

2019-12-20 Thread Jurriaan Hage
Hello,

Please, find below the third call for draft papers for TFPIE 2020.
Please forward these to anyone you think may be interested.
Apologies for any duplicates you may receive.

best regards,
Jurriaan Hage
Chair of TFPIE 2020




TFPIE 2020 Call for papers


http://www.staff.science.uu.nl/~hage0101/tfpie2020/index.html

February 12th 2020, Krakow, Poland
(co-located with TFP 2020 and Lambda Days)


*NEW* Invited Speaker

We are happy to announce the invited speaker for TFPIE 2020, Thorsten
Altenkirch, who also speaks at Lambda Days. At TFPIE 2020 he shall be
talking
about his new book, Conceptual Programming With Python.

*NEW* Registration

This year TFPIE takes place outside of the Lambda Days/TFP organisation,
although it takes place near their location. This means you do need to
register
separately for TFPIE; it also means you can register for TFPIE without
registering for TFP/LambdaDays, and vice versa.

Registration is mandatory for at least one author of every paper that is
presented at the workshop. Only papers that have been presented at TFPIE
may be
submitted to the post-reviewing process. Registration is 25 euro per
person.


TFPIE 2020 welcomes submissions describing techniques used in the classroom,
tools used in and/or developed for the classroom and any creative use of
functional programming (FP) to aid education in or outside Computer Science.
Topics of interest include, but are not limited to:

  FP and beginning CS students
  FP and Computational Thinking
  FP and Artificial Intelligence
  FP in Robotics
  FP and Music
  Advanced FP for undergraduates
  FP in graduate education
  Engaging students in research using FP
  FP in Programming Languages
  FP in the high school curriculum
  FP as a stepping stone to other CS topics
  FP and Philosophy
  The pedagogy of teaching FP
  FP and e-learning: MOOCs, automated assessment etc.
  Best Lectures - more details below

In addition to papers, we are requesting best lecture presentations. What's
your
best lecture topic in an FP related course? Do you have a fun way to
present FP
concepts to novices or perhaps an especially interesting presentation of a
difficult topic? In either case, please consider sharing it. Best lecture
topics
will be selected for presentation based on a short abstract describing the
lecture and its interest to TFPIE attendees. The length of the presentation
should be comparable to that of a paper. On top of the lecture itself,
the presentation can also provide commentary on the lecture.

Submissions
Potential presenters are invited to submit an extended abstract (4-6 pages)
or a
draft paper (up to 20 pages) in EPTCS style. The authors of accepted
presentations will have their preprints and their slides made available on
the
workshop's website. Papers and abstracts can be submitted via easychair at
the
following link: https://easychair.org/conferences/?conf=tfpie2020 . After
the
workshop, presenters will be invited to submit (a revised version of) their
article for review. The PC will select the best articles that will be
published in the Electronic Proceedings in Theoretical Computer Science
(EPTCS).
Articles rejected for presentation and extended abstracts will not be
formally
reviewed by the PC.

Dates
  Submission deadline: January 14th 2020, Anywhere on Earth.
  Notification: January 17th 2020
  TFPIE Registration Deadline: January 20th 2020
  Workshop: February 12th 2020
  Submission for formal review: April 19th 2020, Anywhere on Earth.
  Notification of full article: June 6th 2020
  Camera ready: July 1st 2020

Program Committee
  Olaf Chitil - University of Kent
  Youyou Cong - Tokyo Institute of Technology
  Marko van Eekelen - Open University of the Netherlands and Radboud
University Nijmegen
  Jurriaan Hage (Chair) - Utrecht University
  Marco T. Morazan - Seton Hall University, USA
  Sharon Tuttle - Humboldt State University, USA
  Janis Voigtlaender - University of Duisburg-Essen
  Viktoria Zsok - Eotvos Lorand University

Note: information on TFP is available at
http://www.cse.chalmers.se/~rjmh/tfp/

-- 
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/CAKVFE6V4KG-tSqNCaeUh4PGdHpawQDSCs2LFA0wU%2BuJH-0Vjvg%40mail.gmail.com.


[racket-users] file-position in Win32 not working beyond 1 GB

2019-12-20 Thread Dmitry Pavlov

Hello,

On a fresh 32-bit Racket 7.5 install on 32-bit Windows 7,
(file-position port number) does not work when number
is more that 1 GB.

I can not now say exactly what the error message was,
because I am away from that system, but IIUC it
was something about the position being "too large".

The size of the file, though, is definitely large enough
to have that position, and (file-position port number)
on it worked fine until the number grew beyond
the said limit.

On 64-bit Linux, everything is fine.

Can I work this problem around somehow?

Best regards

Dmitry

--
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/22f36172-daf8-7e6f-5f55-9e1c562b8b61%40iaaras.ru.


Re: [racket-users] file-position in Win32 not working beyond 1 GB

2019-12-20 Thread George Neuner



On 12/20/2019 9:39 AM, Dmitry Pavlov wrote:


On a fresh 32-bit Racket 7.5 install on 32-bit Windows 7,
(file-position port number) does not work when number
is more that 1 GB.


On 32-bit machines, the largest fixnum is 2^30  which is 1GB.  I suspect 
that /file-position/  really wants a fixnum rather than a 
non-negative-integer as is documented.




Can I work this problem around somehow?


I don't believe there's a way within Racket.  Potentially you could use 
FFI and drop into Windows own file functions - the 32-bit API contains 
an extended seek function which works with 64 bit offsets.



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/35fa32ff-2c3a-de2b-c06f-fb09208069e2%40comcast.net.


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

2019-12-20 Thread George Neuner



On 12/20/2019 8:45 AM, Marc Kaufmann wrote:
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 quick fix is to tell them that they 
should go to page xyz.com. But I don't know how I can easily change 
this error message to add a link. Anyone?


I'm about to leave for travel or else I would have done some digging 
around.


PS: For some reason I keep hitting these errors faster than in the 
past - as in, within a few minutes. Any idea why that might be and how 
to increase the time? I can crank up the RAM of the machine too, 
anything that cuts down on developer time really. I'll be back in the 
new year to actually fix this, but not now.


Did you perhaps change the continuation manager - or its setup?
https://docs.racket-lang.org/web-server/servlet.html?q=ffi#%28part._managers%29

As to where to put your message: you can install a custom "expiration" 
handler in the continuation manager.  Unfortunately I haven't done this 
in a very long time, so I can't guide you through it.  Perhaps someone 
(Jay?) knows exactly what to do.


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/85246bf7-7ba3-1d21-e6d0-17846a9bd498%40comcast.net.


Re: [racket-users] file-position in Win32 not working beyond 1 GB

2019-12-20 Thread Dmitry Pavlov





On a fresh 32-bit Racket 7.5 install on 32-bit Windows 7,
(file-position port number) does not work when number
is more that 1 GB.


On 32-bit machines, the largest fixnum is 2^30  which is 1GB.  I 
suspect that /file-position/  really wants a fixnum rather than a 
non-negative-integer as is documented.


That would be sad because it essentially renders my program non-runnable 
on 32-bit Windows.


To those who know about how (file-position) works: has it always been 
that way?
I know that 32-bit systems are not cool nowadays, but they are still in 
use on some of my colleagues' machines.


Also, I do not quite buy the 1 GB limit even on a 32-bit system.
I would have understood maximum the limit of maximum signed integer 2^31 
= 2 GB (and my program would be fine with 2 GB limit).


Best regards,

Dmitry

--
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/7fe1b7ce-3fa4-cdef-c5bf-310250fcf4fd%40iaaras.ru.


Re: [racket-users] file-position in Win32 not working beyond 1 GB

2019-12-20 Thread Dmitry Pavlov



I would have understood maximum the limit of maximum signed integer 
2^31 = 2 GB (and my program would be fine with 2 GB limit).
meant to be "I would have understood the limit of maximum signed integer 
..."


--
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/5227f059-20fa-13de-8c3e-d765f14215eb%40iaaras.ru.


Re: [racket-users] file-position in Win32 not working beyond 1 GB

2019-12-20 Thread Matthew Flatt
The Racket-imposed limit should be 64 bits (more than enough) on all
platforms. I can try to replicate the problem later today, but more
information on the error message would be helpful.

At Fri, 20 Dec 2019 17:39:37 +0300, Dmitry Pavlov wrote:
> Hello,
> 
> On a fresh 32-bit Racket 7.5 install on 32-bit Windows 7,
> (file-position port number) does not work when number
> is more that 1 GB.
> 
> I can not now say exactly what the error message was,
> because I am away from that system, but IIUC it
> was something about the position being "too large".
> 
> The size of the file, though, is definitely large enough
> to have that position, and (file-position port number)
> on it worked fine until the number grew beyond
> the said limit.
> 
> On 64-bit Linux, everything is fine.
> 
> Can I work this problem around somehow?
> 
> Best regards
> 
> Dmitry
> 
> -- 
> 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/22f36172-daf8-7e6f-5f55-9e1c562b
> 8b61%40iaaras.ru.

-- 
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/5dfd2879.1c69fb81.2bbe.ad80SMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: [racket-users] file-position in Win32 not working beyond 1 GB

2019-12-20 Thread Shu-Hung You
Could it be that the Racket layer importing rktio C code directly uses
get-ffi-obj and does not convert scheme_bignum_type to _int64?

@Dmitry: I guess Racket uses 1 bit for type tagging, leaving only
30+sign (or 62+sign) bits for the actual value.

On Fri, Dec 20, 2019 at 2:01 PM Matthew Flatt  wrote:
>
> The Racket-imposed limit should be 64 bits (more than enough) on all
> platforms. I can try to replicate the problem later today, but more
> information on the error message would be helpful.
>
> At Fri, 20 Dec 2019 17:39:37 +0300, Dmitry Pavlov wrote:
> > Hello,
> >
> > On a fresh 32-bit Racket 7.5 install on 32-bit Windows 7,
> > (file-position port number) does not work when number
> > is more that 1 GB.
> >
> > I can not now say exactly what the error message was,
> > because I am away from that system, but IIUC it
> > was something about the position being "too large".
> >
> > The size of the file, though, is definitely large enough
> > to have that position, and (file-position port number)
> > on it worked fine until the number grew beyond
> > the said limit.
> >
> > On 64-bit Linux, everything is fine.
> >
> > Can I work this problem around somehow?
> >
> > Best regards
> >
> > Dmitry
> >
> > --
> > 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/22f36172-daf8-7e6f-5f55-9e1c562b
> > 8b61%40iaaras.ru.
>
> --
> 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/5dfd2879.1c69fb81.2bbe.ad80SMTPIN_ADDED_MISSING%40gmr-mx.google.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/CAMTzy%2BbxJw-tGzmnpWGkvpab_1zW9QM%2BAgJBftJncAHSFrEz4g%40mail.gmail.com.


Re: [racket-users] file-position in Win32 not working beyond 1 GB

2019-12-20 Thread Shu-Hung You
On Fri, Dec 20, 2019 at 2:05 PM Shu-Hung You
 wrote:
>
> Could it be that the Racket layer importing rktio C code directly uses
> get-ffi-obj and does not convert scheme_bignum_type to _int64?
>

Never mind this -- I got the FFI part wrong.

> On Fri, Dec 20, 2019 at 2:01 PM Matthew Flatt  wrote:
> >
> > The Racket-imposed limit should be 64 bits (more than enough) on all
> > platforms. I can try to replicate the problem later today, but more
> > information on the error message would be helpful.
> >
> > At Fri, 20 Dec 2019 17:39:37 +0300, Dmitry Pavlov wrote:
> > > Hello,
> > >
> > > On a fresh 32-bit Racket 7.5 install on 32-bit Windows 7,
> > > (file-position port number) does not work when number
> > > is more that 1 GB.
> > >
> > > I can not now say exactly what the error message was,
> > > because I am away from that system, but IIUC it
> > > was something about the position being "too large".
> > >
> > > The size of the file, though, is definitely large enough
> > > to have that position, and (file-position port number)
> > > on it worked fine until the number grew beyond
> > > the said limit.
> > >
> > > On 64-bit Linux, everything is fine.
> > >
> > > Can I work this problem around somehow?
> > >
> > > Best regards
> > >
> > > Dmitry
> > >
> > > --
> > > 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/22f36172-daf8-7e6f-5f55-9e1c562b
> > > 8b61%40iaaras.ru.
> >
> > --
> > 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/5dfd2879.1c69fb81.2bbe.ad80SMTPIN_ADDED_MISSING%40gmr-mx.google.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/CAMTzy%2BZq5tyFGM23yZ3zVcgSCwt_QUPN6XtSL0SppkZj8hKaFw%40mail.gmail.com.


Re: [racket-users] file-position in Win32 not working beyond 1 GB

2019-12-20 Thread Dmitry Pavlov





The Racket-imposed limit should be 64 bits (more than enough) on all
platforms. I can try to replicate the problem later today, but more
information on the error message would be helpful.

I do not have access to that Windows 7 machine until Monday.
I managed to reproduce the problem, though, on a 32-bit Windows XP with 
Racket 7.1.


file-position: new position is too large
  port: #
  position: 1122398240

Best regards,

Dmitry

--
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/141a6202-4853-e189-afd9-8f09b4687507%40iaaras.ru.


Re: [racket-users] file-position in Win32 not working beyond 1 GB

2019-12-20 Thread George Neuner



On 12/20/2019 2:49 PM, Dmitry Pavlov wrote:
I would have understood maximum the limit of maximum signed integer 
2^31 = 2 GB (and my program would be fine with 2 GB limit).
meant to be "I would have understood the limit of maximum signed 
integer ..."




The fixnum tag is just 1 bit, but you are forgetting about the sign.  32 
- 1 (tag) - 1 (sign) = 30.


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/8725ca1a-460c-f7bd-cd9d-b6e608783676%40comcast.net.


Re: [racket-users] file-position in Win32 not working beyond 1 GB

2019-12-20 Thread Matthew Flatt
At Fri, 20 Dec 2019 23:39:30 +0300, Dmitry Pavlov wrote:
> > The Racket-imposed limit should be 64 bits (more than enough) on all
> > platforms. I can try to replicate the problem later today, but more
> > information on the error message would be helpful.
>
> I do not have access to that Windows 7 machine until Monday.
> I managed to reproduce the problem, though, on a 32-bit Windows XP with 
> Racket 7.1.
> 
> file-position: new position is too large
>    port: #
>    position: 1122398240

I'm not able to replicate the error on a fresh(!) 32-bit Windows 7
installation using v7.1 or v7.5. I also don't think it should happen
based on the implementation. So, I'm missing something.

That error string only appears here:

 https://github.com/racket/racket/blob/master/racket/src/racket/src/port.c#L4093

There could be something wrong with `scheme_get_long_long_val`, but
it's surprising that it could go wrong in a machine-specific way.

Does the error happen for you even in a very short program that tries
to set the file position to 1122398240, or does it only happen in your
full program?

Matthew

-- 
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/5dfd6067.1c69fb81.8e70.772dSMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: [racket-users] file-position in Win32 not working beyond 1 GB

2019-12-20 Thread George Neuner



On 12/20/2019 6:59 PM, Matthew Flatt wrote:

At Fri, 20 Dec 2019 23:39:30 +0300, Dmitry Pavlov wrote:
> > The Racket-imposed limit should be 64 bits (more than enough) on all
> > platforms. I can try to replicate the problem later today, but more
> > information on the error message would be helpful.
>
> I do not have access to that Windows 7 machine until Monday.
> I managed to reproduce the problem, though, on a 32-bit Windows XP with 
> Racket 7.1.
> 
> file-position: new position is too large

>    port: #
>    position: 1122398240

I'm not able to replicate the error on a fresh(!) 32-bit Windows 7
installation using v7.1 or v7.5. I also don't think it should happen
based on the implementation. So, I'm missing something.


I tried with 32-bit  7.3, but I also could not create a ~1GB file 
position size error.



One strange thing I did notice though:
My 32-bit Racket happens to be on a 64-bit Win10 host.  I dashed off the 
little test program below, then compiled it to a (13MB) distribution 
executable for the 32-bit Win7 machine (which does not have Racket 
available).  When I tried it, I was quite surprised that it took over a 
minute to run.  I deleted the data file and ran it again, this time 
monitoring the file size in Explorer.  The file began small and steadily 
increased in size until the program ended. Being curious, I then tried 
the executable on the 64-bit Win10 machine and got the similar results - 
it ran faster, but still took much longer than I expected.


Is Racket really writing billions of zeroes rather than creating a 
sparse file?  It seems to me that this file should only create 2 actual 
data blocks, and (modulo JIT) the program should finish almost 
instantly.  What am I missing?


George

  -
#lang racket

(define (fout) (current-output-port))

(with-output-to-file "test.dat"
  (lambda ()
    (write "hello")
    (file-position (fout) (* 3 1024 1024 1024))
    (write "there")
    )
  #:mode   'binary
  #:exists 'can-update
  )

--
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/c27936fd-441d-2f0d-7ae6-9ea4701e9ae1%40comcast.net.