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

2019-09-20 Thread gfb
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.

-- 
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/02e1397f-7e64-41a2-97a5-81ef7779a207%40googlegroups.com.


[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, just closed it.  A black-console window 
stayed open, but DrRacket wouldn't start.  I opened racket-prefs.rktd and 
removed the line

 (((lib "test-engine") ("test-tool.scm")) skip)

and restarted it.  It came back alive.

I then disabled all tools and restarted.  That worked.  So maybe I disabled a 
tool that another one needed.

-- 
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/5LnFNGMZEjOuiF1v1ej53jN1fmbVwzieTgcSP9cDY40T4Go2ufM_b-fKW7AwMML09bwibSspRDv9Z_5xg75LWlUoyxinVBCKwnwXy3FJCqs%3D%40protonmail.com.


Re: [racket-users] Is there a webview for Racket?

2019-09-20 Thread Andre Garzia

Neil,

Thanks a lot for the detailed response. I am new to Racket, FFI and 
everything else but I decided to take a shot at it today. I've managed 
to create a web-view% GUI class that can display web pages on macOS. It 
is wrapping around WKWebView which is the current way of doing things. I 
haven't programmed in Objective-C in 16 years, so I a bit over my head here.


I've uploaded it to:

  https://github.com/soapdog/racket-web-view

I don't yet feel that it is ready for the package catalog. I need to fix 
many things and I'd really welcome help from people who know the current 
Objective-C way of doing things. WKWebView relies a lot in properties 
and I can't find a way to deal with them. For example the "delegate" in 
the code in the repo is not working, nor is the retrieval of the current 
URL (which in Objective-C should be as simple as "webView.URL")


Anyway, it is a first step towards a real Web View for Racket GUI. It 
can already load pages and navigate, so it is not completely broken. 
This is my first FFI project and also my first Racket code after doing 
Beautiful Racket, it is all brand new to me. Sorry if I'm not idiomatic.


I'd really like feedback, advise and help with this. All programming 
ecosystems benefit from having Web Views. I hope this becomes my first 
contribution to Racket.


I also need to do Windows and Linux, but one lion at a time...

Cheers

andre

On 14/09/2019 23:39, Neil Van Dyke wrote:
Hi, Andre.  For your RSS reader, you're only displaying the RSS items 
themselves, not browsing to arbitrary other Web pages within the same 
Racket window, right?


For very plain HTML, one thing I would hesitate to use is the *very 
old* and *possibly insecure* GUI thing, but it might work for your 
purpose (be sure to sanitize any untrusted input HTML): 
https://docs.racket-lang.org/browser/index.html


You might be better off using one of the heavier text components of 
the Racket GUI library (maybe 
"https://docs.racket-lang.org/framework/Editor.html;, unless it's 
overkill?).  This isn't an HTML/CSS/JS/DOM engine, but I'd think you 
could do an RSS item or feed view in it.


Another option, and maybe often the usual way, is to use the user's 
own Web browser (or a standalone one you provide), and you only 
provide the HTTPS server.


A final option, which could be a ton of work to support 
cross-platform, but might be viable if you're targeting a single 
platform and willing to support it, is to do FFI with one of the big 
off-the-shelf Web browser engines, like WebKit (such as through 
WebKitGtk).  There's recent work on Guile bindings for something like 
that, but Racket has a lot of other stuff that Guile doesn't yet have.


Separately, for navigating from an RSS reader running as a Racket GUI 
program, to view arbitrary Web pages in the user's main Web browser, 
see: 
https://docs.racket-lang.org/browser/index.html#(mod-path._browser%2Fexternal)


(I'm pleasantly surprised that people are still interested in Web 
"syndication", despite some browsers and various commercial forces 
moving away from that, for various reasons.  If you're making a 
general-purpose RSS reader, an additional protocol to consider also 
supporting is "https://en.wikipedia.org/wiki/Atom_(Web_standard)". If 
you later want to be even more general-purpose, look at how 
"https://en.wikipedia.org/wiki/Gnus; used the power of a Lisp to 
provide a sophisticated unified view from various 
messaging/syndication/etc. formats, including from Web-scraping. In 
addition to threading features, it also had powerful scoring/ranking 
interfaces (both crafted rulesets and ad hoc). Early research in 
automated collaborative filtering (what today we know as things like 
likes/upvotes, and perhaps recommendation systems) was also done atop 
Gnus. I'd say Gnus is probably still more powerful than any UI we're 
using today to access the same or analogous kinds of data sources, and 
it works on behalf of the user.  I don't know how much Gnu is 
developed lately, but it's worth looking at for ideas of what you can 
build, even better.)




--
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/89008146-3d42-3f6d-8a77-04e783a0e1c7%40andregarzia.com.


[racket-users] Web View for Racket

2019-09-20 Thread Andre Garzia

Neil,

Thanks a lot for the detailed response. I am new to Racket, FFI and 
everything else but I decided to take a shot at it today. I've managed 
to create a web-view% GUI class that can display web pages on macOS. It 
is wrapping around WKWebView which is the current way of doing things. I 
haven't programmed in Objective-C in 16 years, so I a bit over my head 
here.


I've uploaded it to:

https://github.com/soapdog/racket-web-view

I don't yet feel that it is ready for the package catalog. I need to fix 
many things and I'd really welcome help from people who know the current 
Objective-C way of doing things. WKWebView relies a lot in properties 
and I can't find a way to deal with them. For example the "delegate" in 
the code in the repo is not working, nor is the retrieval of the current 
URL (which in Objective-C should be as simple as "webView.URL")


Anyway, it is a first step towards a real Web View for Racket GUI. It 
can already load pages and navigate, so it is not completely broken. 
This is my first FFI project and also my first Racket code after doing 
Beautiful Racket, it is all brand new to me. Sorry if I'm not idiomatic.


I'd really like feedback, advise and help with this. All programming 
ecosystems benefit from having Web Views. I hope this becomes my first 
contribution to Racket.


I also need to do Windows and Linux, but one lion at a time...

Cheers

andre

--
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/d780dc58-d6ac-2dec-4704-0bd655a482d9%40andregarzia.com.


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

2019-09-20 Thread Jens Axel Søgaard
Den fre. 20. sep. 2019 kl. 13.51 skrev Marc Kaufmann <
marc.kaufman...@gmail.com>:

> Thanks Jens, yes the send/forward seems to at least address a few of the
> cases that I have - not sure if it disallows the forms unless I use
> continuations in the forms (right now I am not, mostly just sending the
> request to the current URL. I'll have to see.
>
> Yes, I worked through and read the Continue tutorial a few times and use
> redirect/get to work around the double submit error. But -- I think -- the
> redirect/get only avoids something like refreshing the page from leading to
> a new submit, although I may be wrong. I thought I used it in some places
> where I was able to go back and resubmit. I should double check, since I am
> not using redirect/get everywhere, so that may be the issue.
>

Yes, the redirect trick only prevents the same data (as the result of a
"submit" action) being sent twice.
If the user goes back to the form, fills in the form again and the click
submit again, a new set
of data is sent.

If you need to prevent the same form being filled in twice, you could
associate a key as
a hidden form value (say the md5 of a counter) and keep track in a database
of which keys
have already been used.

To prevent the key table from getting too large, you can flip it around:
keep the non-used keys in the
database, then on submission remove the key. If you also store the age of
the key, you can
from time to time delete old keys.

/Jens Axel

-- 
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/CABefVgzZw%2BpkRuP9t6axMJcmpvCKPhda1Jxnaat02XRvG6A1TQ%40mail.gmail.com.


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

2019-09-20 Thread Marc Kaufmann
Thanks Jens, yes the send/forward seems to at least address a few of the
cases that I have - not sure if it disallows the forms unless I use
continuations in the forms (right now I am not, mostly just sending the
request to the current URL. I'll have to see.

Yes, I worked through and read the Continue tutorial a few times and use
redirect/get to work around the double submit error. But -- I think -- the
redirect/get only avoids something like refreshing the page from leading to
a new submit, although I may be wrong. I thought I used it in some places
where I was able to go back and resubmit. I should double check, since I am
not using redirect/get everywhere, so that may be the issue.

Cheers,
Marc

On Fri, Sep 20, 2019 at 1:38 PM Stephen De Gabrielle <
spdegabrie...@gmail.com> wrote:

> Maybe also relevant
>
>
> https://docs.racket-lang.org/continue/index.html#%28part._.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 skrev Marc Kaufmann <
>> marc.kaufman...@gmail.com>:
>>
>>> 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
>>> previous form or hit a link that is an embedded continuation to a function
>>> that should not be called twice.
>>>
>>> One way I can do this is to set some variable in the database when the
>>> form is submitted or one of several links clicked on a page and check
>>> whether it already is set and disallow new submits (or some such). However,
>>> I want to do this in many places and don't want to sprinkle all my code and
>>> database with names that I can't track. I tried to achieve this by defining
>>> a new variable in the request itself that I set to #false initially and
>>> then set! to true when any link is hit -- but this fails if a person comes
>>> back, refreshes the page and clicks the link, since this creates a new
>>> instance of the variable.
>>>
>>> Qualtrics surveys have this feature, but the way they implement it is (I
>>> think) by being single-page apps where the 'Next' button loads the new page
>>> content via an Ajax call. I don't see how to turn my current website into
>>> that without substantial rewrites.
>>>
>>> Cheers,
>>> Marc
>>>
>>> --
>>> 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/7e356eb4-e886-4f9c-90cd-0db658d14a91%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>> --
>> Jens Axel Søgaard
>>
>> --
>> 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/CABefVgzmMJMrqjAF4JXJU7txX9hU5HWBrfREP915j8ggi%3Dmt5w%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAD7_NO6daWvM0Qy4dPMgNsuyfUD990xtKJNEv7WiwNniYUYwXw%40mail.gmail.com.


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

2019-09-20 Thread Stephen De Gabrielle
Maybe also relevant

https://docs.racket-lang.org/continue/index.html#%28part._.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 skrev Marc Kaufmann <
> marc.kaufman...@gmail.com>:
>
>> 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
>> previous form or hit a link that is an embedded continuation to a function
>> that should not be called twice.
>>
>> One way I can do this is to set some variable in the database when the
>> form is submitted or one of several links clicked on a page and check
>> whether it already is set and disallow new submits (or some such). However,
>> I want to do this in many places and don't want to sprinkle all my code and
>> database with names that I can't track. I tried to achieve this by defining
>> a new variable in the request itself that I set to #false initially and
>> then set! to true when any link is hit -- but this fails if a person comes
>> back, refreshes the page and clicks the link, since this creates a new
>> instance of the variable.
>>
>> Qualtrics surveys have this feature, but the way they implement it is (I
>> think) by being single-page apps where the 'Next' button loads the new page
>> content via an Ajax call. I don't see how to turn my current website into
>> that without substantial rewrites.
>>
>> Cheers,
>> Marc
>>
>> --
>> 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/7e356eb4-e886-4f9c-90cd-0db658d14a91%40googlegroups.com
>> 
>> .
>>
>
>
> --
> --
> Jens Axel Søgaard
>
> --
> 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/CABefVgzmMJMrqjAF4JXJU7txX9hU5HWBrfREP915j8ggi%3Dmt5w%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAGHj7-LU4hqi8Q8X9_KbXTBB__JhYC48NK3%3DnkyDn85WBiJvrQ%40mail.gmail.com.


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

2019-09-20 Thread Jens Axel Søgaard
Is `send/forward` what you need?

Den fre. 20. sep. 2019 kl. 11.43 skrev Marc Kaufmann <
marc.kaufman...@gmail.com>:

> 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
> previous form or hit a link that is an embedded continuation to a function
> that should not be called twice.
>
> One way I can do this is to set some variable in the database when the
> form is submitted or one of several links clicked on a page and check
> whether it already is set and disallow new submits (or some such). However,
> I want to do this in many places and don't want to sprinkle all my code and
> database with names that I can't track. I tried to achieve this by defining
> a new variable in the request itself that I set to #false initially and
> then set! to true when any link is hit -- but this fails if a person comes
> back, refreshes the page and clicks the link, since this creates a new
> instance of the variable.
>
> Qualtrics surveys have this feature, but the way they implement it is (I
> think) by being single-page apps where the 'Next' button loads the new page
> content via an Ajax call. I don't see how to turn my current website into
> that without substantial rewrites.
>
> Cheers,
> Marc
>
> --
> 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/7e356eb4-e886-4f9c-90cd-0db658d14a91%40googlegroups.com
> 
> .
>


-- 
-- 
Jens Axel Søgaard

-- 
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/CABefVgzmMJMrqjAF4JXJU7txX9hU5HWBrfREP915j8ggi%3Dmt5w%40mail.gmail.com.


[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 
previous form or hit a link that is an embedded continuation to a function 
that should not be called twice. 

One way I can do this is to set some variable in the database when the form 
is submitted or one of several links clicked on a page and check whether it 
already is set and disallow new submits (or some such). However, I want to 
do this in many places and don't want to sprinkle all my code and database 
with names that I can't track. I tried to achieve this by defining a new 
variable in the request itself that I set to #false initially and then set! 
to true when any link is hit -- but this fails if a person comes back, 
refreshes the page and clicks the link, since this creates a new instance 
of the variable. 

Qualtrics surveys have this feature, but the way they implement it is (I 
think) by being single-page apps where the 'Next' button loads the new page 
content via an Ajax call. I don't see how to turn my current website into 
that without substantial rewrites. 

Cheers,
Marc

-- 
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/7e356eb4-e886-4f9c-90cd-0db658d14a91%40googlegroups.com.