Re: [racket-users] Looking for system admin help for the package system

2021-12-08 Thread James Platt
Hi Sam,

I've got some pretty good general sysadmin skills.  I would have to get up to 
speed with some of the specific technologies but that should not be a problem.  
 I'm pretty much booked up to the end of the year, with lots to do but, come 
January, I should be in much better shape.  

James

On Dec 7, 2021, at 3:30 PM, Sam Tobin-Hochstadt wrote:

> Currently, the implementation of https://pkgs.racket-lang.org as well
> as https://pkg-build.racket-lang.org (see Notes) is primarily
> maintained by Matthew Flatt, although much of it was originally
> written by Jay McCarthy and Tony Garnock-Jones (for pkgs in
> particular). Matthew of course wears a lot of hats and maintains lots
> of things, and he's tired of this job.
> 
> As a result, I'm going to take over the sysadmin role, but I'm looking
> for additional people who can help out as well -- this is a key part
> of Racket infrastructure and one person is probably not enough. Anyone
> with experience with system admin, web servers, the Racket web server,
> AWS, Docker, etc would be great, or but expertise is _not_ required,
> just a willingness to help out.
> 
> Of course, there are many ways to improve the system as well, and
> helping to maintain it is a great way to get started on that.
> 
> If you're willing to volunteer some time to help with this, let me
> know, either here or by messaging me (@samth) on Discord or Slack.
> 
> Sam
> 
> ### Notes:
> 
> The implementation of pkgs.racket-lang.org is a front-end here:
> https://github.com/racket/racket-pkg-website and a backend here:
> https://github.com/racket/pkg-index/. They both run on the same EC2
> instance, and store almost all of the state (including the index of
> packages) in S3.
> 
> The implementation of pkg-build.racket-lang.org is a separate
> continously-running EC2 instance running the `pkg-build` package,
> implemented here: https://github.com/racket/pkg-build
> 
> -- 
> 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/CAK%3DHD%2Ba5zFaHMGijuhCZ_jb7g1aEmukMwyXfxHYiErEWU%2B5aFQ%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/55BA3E3A-7945-4DCD-AD59-3764BF3F6390%40biomantica.com.


Re: [racket-users] Re: Discourse - Mailing list mode

2021-12-08 Thread James Platt


> If you had continued reading, you would have seen my comment that NOT ALL 
> news groups support list distribution or posting via email. NNTP is not 
> email.  Usenet group moderators[*] can choose how to make their groups 
> available: the default is via list distribution and NNTP both, but the 
> moderator can deliberately disable one or the other - or only enable digests 
> via email, or disable posting.

I did read that part.  I just didn't understand what you mean.  I still don't.  
NNTP is not involved here, with the Racket community, as far as I know.  The 
one thing that is clear is that NNTP is one of the many different technologies 
which these forums can get fragmented across.  That is a problem.  NNTP was 
originally designed to manage bandwidth way back when transfer of plain text 
was an issue.  Today, text is trivial next to Bit Torrent, Netflix and other 
things which use up orders of magnitude more bandwidth.  I haven't used NNTP in 
more than a decade now so I don't know if there have been improvements but, 
from what I remember, there is no reason to use it today.  I can't think of any 
advantage it has over any other technology at all.  If it does, let me know.  
Sometimes it's good to take another look at an old technology which you thought 
was basically dead.  It's been, what? about 20 years, since an NNTP server was 
considered one of the basic services which you get from your ISP.  

-- 
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/B8C2C9A2-DA9A-4E9B-911B-40456BDF8765%40biomantica.com.


Re: [racket-users] Re: Discourse - Mailing list mode

2021-12-08 Thread James Platt


On Dec 8, 2021, at 10:45 AM, George Neuner wrote:

> It's a big deal if you are (or were) following multiple groups.

I don't understand.  Why is this an issue?  I find it very convenient to filter 
each group into it's own folder in email.  If this were a non-technical group, 
you wouldn't expect everyone to know how to do that but anyone who is a 
programmer ought to have no problem configuring filters and folders.

-- 
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/E3524041-641D-40A0-AB14-80055D1EE6D7%40biomantica.com.


[racket-users] Discourse - Mailing list mode

2021-12-07 Thread James Platt
I notice that Discourse has a "mailing list mode"  which you can set in the 
preferences.  I haven't had a chance to evaluate it much yet but, what I'm 
hoping for is that this will allow me to use the forum pretty much the same way 
as I have been using Google Groups all along.  I just realized, after catching 
up with some older messages on this list, that I have been presuming, thus far, 
that the whole point of Discourse was to have basically the same functionality 
as Google Groups from the standpoint of managing the email list but also have 
different (hopefully better) features at the server/web site end.   Are others 
not seeing it this way?  List mode is not default so you do have to explicitly 
go in and set it.  With Google Groups, list mode is default but you can turn 
that off and only read messages on the server.   So I'm not seeing this change 
as that much of a big deal unless I'm wrong about the email end for Discourse

-- 
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/E36237FF-E999-4F35-A21B-310F287702A3%40biomantica.com.


Re: the end of the [racket-users] mailing list and the migration to Discourse as a forum for Racket

2021-12-07 Thread James Platt


> I wouldn't take it as passive-aggressive per-se. It's just super confusing. 
> Especially if you watch the discussion about future of Racket at RacketCon 
> where Matthias has stated it pretty clearly and other confirmed that - the 
> core team is doing all infrastructure maintenance more-or-less in their free 
> time because their primary focus is development (of various parts of Racket 
> ecosystem).


If the Racket community has grown enough recently (not sure where we stand 
right now), maybe we should take a look at what needs doing and which tasks can 
be split up to be done by different people.   Then ask for volunteers.  

James

-- 
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/48254C71-400F-4820-8313-8352B50DD6B3%40biomantica.com.


Re: [racket-users] How to learn the *core* of Racket?

2021-11-11 Thread James Platt
... and from there it's turtles all the way down.

On Nov 11, 2021, at 9:46 AM, David Storrs wrote:

> Sure, that's as good a definition as any.
> 
> On Thu, Nov 11, 2021, 6:04 AM Yushuo Xiao  wrote:
> Thank you for your comprehensive answer! It helps a lot. I also read more 
> about Racket after I posted the question and now I think that the few special 
> forms (as stated in "fully expanded program") are the core. All languages 
> built in Racket will parse and convert their syntax into syntax objects 
> (S-expressions) and then expand to these special forms. Am I right?
> 
> On Sunday, November 7, 2021 at 6:53:53 AM UTC+8 david@gmail.com wrote:
> Hi Yushuo,
> 
> On Sat, Nov 6, 2021 at 5:33 AM Yushuo Xiao  wrote:
> I've learned some Racket, and can comfortably program in it, but I only 
> learned it as an ordinary language, much like Scheme. I know Racket is much 
> more than that, for its "language-oriented" features. Languages become a 
> first-class member in Racket, and to my understanding, even "#lang racket" is 
> just a language built on some core. What I want to know is, what's the very 
> core of Racket?
> 
> It depends on where you stop measuring.  You could argue that...
> 
> ...#lang racket  is the core, because it's what comes in the installation.  
> Things like gregor, struct-plus-plus, and csv-reading are packages that you 
> install from http://pkgs.racket-lang.org/ and are therefore outside the core.
> 
> ...#lang racket/base is the core, because it's the most limited set of Racket 
> that comes by default.  It mostly consists of only the basic list 
> manipulation functions, and if you want to use other things then you need to 
> include relevant libraries such as racket/match (giving you the 'match' 
> special form) or racket/format (giving you the ~a function), or racket-string 
> (giving you the string-length function), etc.
> 
> ...Raw lambdas and a few special forms are the core, because everything 
> compiles down to those.  (Approximately speaking.)
> 
> ...Lambda calculus is the core, because it's what all LISP descendants are 
> based on.
> 
> Once you start talking about other Racket languages with different syntax and 
> semantics, well then all bets are off.
> 
> 
> Does this help?
> 
> 
> I've noticed that in the Racket Reference there is a section "Fully Expanded 
> Programs", which seems the very core of Racket. But it still takes an 
> S-expression form, and apparently Racket allows language customization on the 
> syntax level. I wonder if the S-expression language is the core of Racket, or 
> the entire Racket has a different structure?
> 
> I would really appreciate it if anyone could explain it in a simple way or 
> could point out some good (and short) material for me to read. The Racket 
> Reference is too long, and I believe the core Racket can be well explained in 
> a much shorter piece of text, if I just look for a brief understanding.
> 
> Also my question may be confusing, because I don't understand Racket well at 
> all. Feel free to correct me or ask for clarification. Thanks in advance!
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/63b1134b-16e4-4447-828a-1e607013bd7cn%40googlegroups.com.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/6929457c-459f-4c25-94c0-ea973b121c65n%40googlegroups.com.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAE8gKoc-8rGaY%2BF2nDLR5BULe1tGnO5BnGAZt-DgBmhCVg_9dw%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/CEEAE11F-8185-461E-8DDF-C640330E8F91%40biomantica.com.


[racket-users] port 55555 in use error

2021-11-08 Thread James Platt
I'm getting an error (shown below) when trying to run any code from Emacs with 
Racket Mode.  It says to restart the REPL but that does not clear the problem.  
It even persists through a reboot.  I was on Racket 8.0 and I tried upgrading 
to 8.2 to solve the problem but that did not work either.

If I take a file that has just "#lang racket ", nothing else, and hit C-c C-c 
in emacs, I get the following error:

Welcome to Racket v8.2 [cs].
tcp-listen: listen failed
hostname: 127.0.0.1
port number: 5
system error: Address already in use; errno=48 
context...:
   
/Users/jtp/.emacs.d/elpa/racket-mode-20191016.1311/racket/command-server.rkt:108:3
   
example_code.rkt>


To try and see what is going on, I tried the following commands after getting 
the error and then exiting the Racket REPL but neither showed anything using 
port 5.

$ ps -fA | grep -E [r]acket


$ sudo lsof -i :5
Password:


What can I do to get clear of this error?

-- 
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/3876F5D1-95C9-4A17-94D2-C3FFB69C4E84%40biomantica.com.


Re: [racket-users] problem of gui layout using side-by-side frames

2021-08-12 Thread James Platt
On Aug 12, 2021, at 3:47 PM, George Neuner wrote:

> However it does suggest that he wants menubar menus.  I don't use (or have 
> available to check) MacOS, so I'm don't know what limitations may be on 'root 
> menubars, or whether a child frame can have its own internal menubar (which 
> is possible on Windows and Linux).

I think Apple's position on this is that you don't need separate menus for 
separate windows because the application menu bar is contextual.  Instead, you 
have it modify itself to fit the context of whatever window has focus.  Having 
said that, you can certainly put menu widgets on any frame you want and, 
probably, with some work, put them together to look like a menu bar.  

-- 
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/F5B4FF9E-AF69-4EB5-956D-7F220B2C1A51%40biomantica.com.


Re: [racket-users] problem of gui layout using side-by-side frames

2021-08-12 Thread James Platt
On Aug 12, 2021, at 2:52 PM, Jens Axel Søgaard wrote:

> Are we talking menu bar menus or contextual menus?
> 
> On macOS the menu bar menu belongs to the application and not a window.

The macOS menu bar is also contextual.  It changes depending on what is 
selected in the application.  IIRC, according to Apple's HIG, all items which 
appear in contextual menus are supposed to also appear as contextual items in 
the application's menu bar.  According to Apple, contextual (right-click) menus 
are supposed to only be shortcuts and not something which your application 
depends on.  All functions of a program are supposed to be discoverable by 
looking through the menu bar.  Contextual items in the menu bar get grayed out, 
rather than disappear, so that you know the function exists even if nothing 
appropriate is selected at the time.  

-- 
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/A7B7013B-1A5D-472E-83D4-9E145DF3E6B4%40biomantica.com.


Re: [racket-users] racket/gui fn that returns width of O.S. toolbar?

2021-08-06 Thread James Platt
> In linux and I imagine on Windows and macOS, when there exists a vertical OS 
> toolbar the values returned by get-display-size and get-client-size are the 
> same and are insufficient.

The macOS version, at least, is draggable so there can be different widths on 
different Finder windows at the same time.  You can get the info by shelling 
out to the command line if that's a possibility for you.

$osascript -e 'tell application "Finder" to get the sidebar width of Finder 
window 1'

or 

$osascript -e 'tell application "Finder" to get the sidebar width of front 
Finder window'

or

$defaults read com.apple.finder | grep SidebarWidth

Note that this gives a list of results but I am not clear on whether they are 
all default values or values for current windows or, more likely, some of each. 
 The file com.apple.finder is a plist file which is a form of xml so you might 
even read the file directly into Racket and parse it.

I would not be at all surprised if there are multiple other ways to get the 
info from the command line.  

James

-- 
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/91A18C2A-4BCF-47F9-A18A-967BDD2AF7BC%40biomantica.com.


Re: [racket-users] Is there a good Racket DSL alternative to Image Magick?

2021-05-21 Thread James Platt
I was there and, as I remember it, there was a presentation on something else 
where this was mentioned.  IIRC, the topic was Language Oriented Programming 
and there was a discussion about how much complexity is okay when you are 
programmatically generating DSL code.  The presenter mentioned PostScript as an 
example of a DSL where very complex code is often machine generated.  Then 
there was more discussion about postscript and related things you can do with 
Racket.  Maybe that's what you were thinking about.

James


On May 11, 2021, at 11:03 AM, Sage Gerard wrote:

> I hope that has what Robert is looking for, but I don't recognize that 
> speech. In fact, I have a false memory, because I'm not finding the speech 
> I'm looking for on https://con.racket-lang.org/2018/#speakers
> 
> On 5/11/21 10:19 AM, Bruce O'Neel wrote:
>> This might be it.
>> 
>> (seventh RacketCon): Leif Andersen -- Movies as Programs: The Story of a 
>> Racket - YouTube
>> 
>> 
>> 
>> 
>> 
>> 11 May 2021 15:30 Sage Gerard  wrote:
>> I don't know of one off hand, but I believe RacketCon 2018 (?) included a 
>> presenter that showed a PostScript-like DSL for designers and artists.  If 
>> pict not cover your needs, maybe dig into the presentations?
>> Failing that, can you show what you'd hope the syntax would look like? That 
>> would probably help point you in the right direction,
>> On 5/11/21 9:26 AM, Robert Haisfield wrote:
>>> I have to do a bunch of .jpg and .png image resizings and was looking for a 
>>> programmatic way to do it. Is their a Racket DSL for this? --
>>> 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/0d576c32-7d4d-4944-9cbc-c12f04406fccn%40googlegroups.com.
>> -- ~slg --
>> 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/6e3aacdc-015b-2484-3bee-0c08e3fb612d%40sagegerard.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/1620742795-01b81de5d6862fd390ec60605ee3bc9d%40pckswarms.ch.
> --
> ~slg
> 
> 
> -- 
> 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/c911fc49-034e-7159-8a14-7fc5466122b0%40sagegerard.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/7C14FDFA-B9B8-431E-9801-569240EC15A6%40biomantica.com.


Re: [racket-users] Upgrading installer verification

2021-04-06 Thread James Platt
On Apr 2, 2021, at 6:59 PM, Alex Harsányi wrote:

> Hi James,
> 
> If you are worried about dependency confusion attacks, you can set up your 
> own package catalog on an internal server, delete the default catalogs from 
> racket and add only a reference just your internal catalog.  This way, "raco 
> pkg install" will install all packages (and all their dependencies) only from 
> a source which you have full control of.
> 
> I use a similar technique when I build my application on the CI server, to 
> ensure that all packages and their dependencies are under source control and 
> no untracked dependency sneaks in via a new package dependency. 

Thanks.  I had not though of that.  My company will probably want to do 
something of the kind before we release anything to the public.  

-- 
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/A5666929-68E1-4A8F-94DC-B085633D17C5%40biomantica.com.


Re: [racket-users] Upgrading installer verification

2021-04-02 Thread James Platt


Are you bring this up because of the recent rise of dependency confusion 
attacks?  In any case, it would be good to know where Racket stands with that.  

On Apr 1, 2021, at 12:39 PM, Sage Gerard wrote:

> Are there any plans to publish GPG signatures for Racket installers, or
> at least upgrade the cryptographic hash function used for the checksums?
> 
> If not, who would be a good person to talk to about contributing that?
> 
> --
> ~slg
> 
> 
> -- 
> 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/70e8acf9-9993-0e7c-3d10-b7964cc6ed03%40sagegerard.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/8DEE7478-3E76-43EC-8691-AA44D016E764%40biomantica.com.


Re: [racket-users] Smart contracts in Racket

2021-03-18 Thread James Platt


On Mar 16, 2021, at 3:24 PM, Christopher Lemmer Webber wrote:

> But "smart contracts" is a use case, a broad problem domain.  What kind
> of smart contracts are you wanting to write?

I do need to research the topic a bit to make sure that what I want to do is 
possible but, according to what I understand so far, it's actually a clearer 
use case for smart contracts than most.  I want to use them to promote 
reproducibility of scientific data analysis.  The idea would be that you put 
your data analysis together as a smart contract and then others can run it 
again and be much better assured of getting the same result than they would be 
without the smart contract.  As I understand it, one of the big issues with 
smart contracts for work transactions is that there could be a bug which causes 
your contract to enforce something a bit differently than you intended. This is 
quite different from traditional business contracts where, if it comes to a 
lawsuit, the courts will look for the intent of the contract.   My use case is 
only asking for reproducibility.

The big difficulty for my use case is that you have to be able to tie into 
various different bits of code previously published by others.  For example, a 
DNA sequencing analysis pipeline which I worked with, had various parts of the 
process written in Perl, Python, C, R, JAVA, javascript, UNIX shell script, and 
AppleScript, much of it published by people outside my lab.  So a lot of that 
would probably have to be outside the contract.  However, you need a "glue 
language" to put it all together.  We were using shell script for that because 
most of it needs to run on a supercomputing cluster.  We looked for something 
that could make the code more understandable.  Python was a possibility but we 
were leaning towards Big Data Script (BDS) which is a DSL specifically for this 
purpose.  In any case, if something like BDS (as a glue language) were 
implemented as a smart contract language, that would at least take care of the 
top level. 

Later on, it would be great to be able to buy and sell resources on our P2P 
network with a cryptocurrency.  This would include storage, bandwidth, and 
processing time for intensive computations.  You would be able to buy and sell 
smart contracts using these things.  I understand that Etherium can do things 
like this but there are quite a few technologies to read up on, starting with 
Subutai, https://subutai.io.  

-- 
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/19277102-150B-4C78-85B2-8A568271F40D%40biomantica.com.


Re: [racket-users] Smart contracts in Racket

2021-03-16 Thread James Platt


On Mar 15, 2021, at 7:01 PM, Beatriz Moreira wrote:

> Hello! I recently used Racket as a tool to see the small step execution of 
> some smart contract languages and I was wondering if there is anywhere i can 
> submit my work or share it with the Racket community.

One place might be the Racket Artifacts site.  I think it's mainly intended for 
short demonstrations of code but, if yours is not too long, that might be the 
place. 

https://github.com/racket/racket/wiki/Artifacts

I am interested in smart contracts, as well, for a possible future addition to 
a project I am working on but it will be a while before I get to that point.  

-- 
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/E3DCE2FA-3159-4F4C-A7FE-D529A95E8755%40biomantica.com.


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

2021-03-12 Thread James Platt
Thanks for the suggestions.  I had not thought about using "terminal" as a 
search term since I was expecting to find something that would implement 
keyboard shortcuts regardless of whether you are using the command line 
(Terminal in Mac and Linux or CMD in Windows)  or not.  It doesn't look like 
any of those packages will do what I want easily.  Rackterm would work, since 
you can attach menus to it and define the keyboard shortcuts there, except I 
want something which will work in an ssh session.  The command prefix idea 
seems like the easiest way to go.  I think IRC does something like that.  




On Mar 12, 2021, at 6:49 AM, schle...@gmail.com wrote:

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

-- 
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/B3A419B8-A7B5-4FBC-8C58-78F6CD17FBDF%40biomantica.com.


[racket-users] key combos at the command line

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/6230AA95-C01A-4F1D-842F-4965BFE4AD55%40biomantica.com.


Re: [racket-users] GUI button% string label keyboard mnemonics

2021-01-13 Thread James Platt
One workaround you could do would be to duplicate the functionality of the 
button in a pulldown menu and define the keyboard shortcut there.  I think it 
is good general practice anyway to put all functions in the pulldown menus and 
use other GUI elements only as shortcuts.  This gives the user one place they 
can look to find all the functions of your software.  It's part of Apple's 
Human Interface Guidelines but I think it's a good idea on any platform.  

-- 
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/ABB20AC3-C747-4B4A-AFDE-AA79E1F4E381%40biomantica.com.


Re: [racket-users] Threading question

2020-12-18 Thread James Platt
I sent this reply to the list three days ago but it never made it back to me 
from the list so I am trying again.  Apologies if you get it twice.

Thanks.  The `finder:common-get-file` solution does the trick for my present 
purposes as just a demo of the NAT-Traversal code.  In the long run I should 
learn more about places.  Also, if there is enough interest in having a FOSS, 
decentralized Zoom equivalent in Racket, I will copy the GUI chat client code 
to its own project as a starting point and see who wants to help out.  That is, 
once I finish with the NAT-Traversal package.

James


On Dec 15, 2020, at 1:34 PM, Matthew Flatt wrote:

> It sounds like you're running into a problem specifically with things
> like the file dialog.
> 
> Everything in Racket runs in a thread. When your program starts, it
> runs in the "main" thread. Normally, a Racket thread that can run will
> run, no matter what other Racket threads are doing. When a
> foreign-function call blocks its thread, however, then it blocks all
> Racket threads --- at least, all threads in the same place.
> 
> Places offer one potential way out, because a blocking foreign call in
> one thread does not necessarily block other places. In CS, the
> foreign-function calls still have to be somewhat cooperative (by using
> `#:blocking? #t` at the level of `_fun` or `_cprocedure`), otherwise
> they can block even other places when a garbage collection is needed.
> The file dialogs are not currently using `#:blocking? #t`, but I think
> they could.
> 
> In the case of file dialogs, another option is `finder:common-get-file`
> and `finder:common-put-file` from `framework`, which are Racket
> implementations of those dialogs instead of calling the
> platform-specific dialogs through foreign functions. Whether that's a
> good option probably depends on your users.
> 
> Finally, Racket CS offers access to OS-level threads through
> `ffi/unsafe/os-thread`. That's unlikely to be a good option, though,
> because it can't cooperate with Racket's I/O layer.
> 
> Matthew
> 
> At Tue, 15 Dec 2020 13:12:16 -0500, James Platt wrote:
>> In Racket, does a given process have to be in a thread in order to give up 
>> time 
>> to other threads?  In other words, putting code in a thread does not 
>> guarantee 
>> it will keep running if execution can move into other code that is not 
>> threaded?
>> 
>> Details:
>> 
>> I am working on documenting and writing examples for a NAT-Traversal package 
>> which is to be contributed as a Racket package.  In order to keep a P2P 
>> connection alive, the NAT-Traversal (specifically STUN) process needs to 
>> keep 
>> sending pings back and forth between the peers.  Otherwise, the firewalls 
>> involved will close the ports being used for the connection.  To prevent 
>> this 
>> from happening, the NAT-Traversal code uses a lot of threading.  However, I 
>> am 
>> still seeing connections drop.  My example GUI chat client has a file 
>> transfer 
>> utility included but, if you take too much time in the open/save dialog 
>> selecting the file to send, it drops the connection and the file transfer 
>> fails.  Do I need to put my GUI in a thread?  Is that the issue?  I'm asking 
>> here on the list, rather than just trying it, mainly because I want to be 
>> sure 
>> that I explain the situation correctly in my documentation.
>> 
>> James
>> 
>> -- 
>> 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/01C7C30C-C75A-4498-A8FB-A5F7B1518
>> 1E8%40biomantica.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/B88F3221-72A7-4D8F-A034-B448DA803752%40biomantica.com.


[racket-users] Threading question

2020-12-15 Thread James Platt
In Racket, does a given process have to be in a thread in order to give up time 
to other threads?  In other words, putting code in a thread does not guarantee 
it will keep running if execution can move into other code that is not threaded?

Details:

I am working on documenting and writing examples for a NAT-Traversal package 
which is to be contributed as a Racket package.  In order to keep a P2P 
connection alive, the NAT-Traversal (specifically STUN) process needs to keep 
sending pings back and forth between the peers.  Otherwise, the firewalls 
involved will close the ports being used for the connection.  To prevent this 
from happening, the NAT-Traversal code uses a lot of threading.  However, I am 
still seeing connections drop.  My example GUI chat client has a file transfer 
utility included but, if you take too much time in the open/save dialog 
selecting the file to send, it drops the connection and the file transfer 
fails.  Do I need to put my GUI in a thread?  Is that the issue?  I'm asking 
here on the list, rather than just trying it, mainly because I want to be sure 
that I explain the situation correctly in my documentation.

James

-- 
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/01C7C30C-C75A-4498-A8FB-A5F7B15181E8%40biomantica.com.


Re: [racket-users] GUI zoom and normal-control-font

2020-08-20 Thread James Platt


On Aug 19, 2020, at 8:53 PM, George Neuner wrote:

> Sorry, it was not clear to me that you wanted to resize widgets (child 
> windows).  Typically when one speaks about a window's "content" they are 
> referring to text or imagery drawn onto the window's backing bitmap.

I was going by Macintosh terminology where there are two different kinds of 
zoom.  A window zoom is activated, currently, by double clicking on the top bar 
of a window.  Previously, it was the green button on the window bar but that 
now activates full screen mode.  It toggles between the last custom dragged 
size of the window and a size of its contents.  Unfortunately, this has never 
worked as well in Mac OS X and macOS as well as it did in Classic Mac OS which 
might be part of the reason they switched the green button to full screen mode. 
 The zoom I want is the one activated by the zoom menu item (or command - / 
command =).  This resizes contents of the window, including text and imagery as 
well as widgets.  I would really like to have the full functionality but, for 
now, just resizing widgets would be a major improvement.  

-- 
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/1F4FEE9B-83AD-4E10-A850-4341F0AA935D%40biomantica.com.


Re: [racket-users] GUI zoom and normal-control-font

2020-08-19 Thread James Platt
> 
> On 8/18/2020 12:31 PM, James Platt wrote:
>> I'm looking at implementing a zoom contents (not zoom window) feature in a 
>> GUI with lots of elements and I'm wondering about the best way to do this.  
>> Most, if not all, standard GUI widgets in Racket can be resized by changing 
>> the font size of their contents or label.   Then redraw the widget and you 
>> have the whole thing in a new size.  So zoom could be done by creating a 
>> function which handles each element individually but I would like a more 
>> general solution, if possible.  Most widgets use the value 
>> normal-control-font for their default but it doesn't look like this can be 
>> changed at present.  If there were a setter for normal-control-font, it 
>> looks like you could have a menu item change it, then recursively get the 
>> children of the frame it is attached to and redraw them.  Would this 
>> actually work? Is there a better way to do it?
> 
> If you can access (or render) the contents as a 'pict', then it be scaled 
> somewhat arbitrarily (though a scaled version is not guaranteed to look good).
> https://docs.racket-lang.org/pict/Pict_Drawing_Adjusters.html
> 
> It is a form of BitBLT operation.  I would search the docs for "blt" or 
> "blit" in addition to "scale" and "size".  Sorry I can't point you more 
> directly to relevant functions:  I've done a lot of GUI programming, but, 
> unfortunately, I know it from C++ using device contexts directly, not from 
> using Racket's graphics.

If I understand correctly, I would do that like in the Stackoverflow post 
below.   Note the need for using the bitmap% version of the button label.   The 
advantage of this approach is that you can change the label dynamically with a 
send.  The drawback is that I would have to create a modified version of every 
widget.  I was just hoping for a solution which would not require so much 
customization of a standard Racket package.  

https://stackoverflow.com/questions/48414363/how-to-change-the-color-of-text-in-a-racket-gui-button/48468797#48468797


-- 
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/08CD0FAF-AFCD-4B43-87C4-422C79AA2361%40biomantica.com.


[racket-users] GUI zoom and normal-control-font

2020-08-18 Thread James Platt
I'm looking at implementing a zoom contents (not zoom window) feature in a GUI 
with lots of elements and I'm wondering about the best way to do this.  Most, 
if not all, standard GUI widgets in Racket can be resized by changing the font 
size of their contents or label.   Then redraw the widget and you have the 
whole thing in a new size.  So zoom could be done by creating a function which 
handles each element individually but I would like a more general solution, if 
possible.  Most widgets use the value normal-control-font for their default but 
it doesn't look like this can be changed at present.  If there were a setter 
for normal-control-font, it looks like you could have a menu item change it, 
then recursively get the children of the frame it is attached to and redraw 
them.  Would this actually work? Is there a better way to do it?

-- 
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/62C9C1F2-D9D7-4EE2-92AC-1E222428C974%40biomantica.com.


[racket-users] combo-field% glitch in Linux

2020-07-16 Thread James Platt
I'm seeing a glitch with all Racket combo fields when run in Linux Mint 19.3.  
When you click on the popup menu, it just flashes open for an instant and then 
disappears, the first item becomes selected without actually clicking on it 
with the mouse, and the callback is triggered.   If you hold the mouse button 
down rather than just clicking, then you are able to make a selection.  
However, this isn't intuitive to a typical user.  Running a simple example, 
like below, gives the error shown below when run from Terminal.  I don't see 
the error message in DrRacket but the problem is the same.  The glitch does not 
occur in macOS.  I'm guessing that this is a GTK bug rather than a Racket bug 
but that's just a guess.  Is there something that can be done in Racket or is 
this something that needs to be fixed in Linux?


Error message:
(Combo-select-test.rkt:2195): Gtk-WARNING **: 12:02:54.443: no trigger event 
for menu popup


#lang racket

(require racket/gui)

(define frame (new frame%
   [label "Combo Field Test"]
   ))


 (new combo-field% (parent frame)
   (label "choose")
   (choices '("choice1" "choice2" "choice3"))
   (callback (lambda (c e) (println "A choice was made.")))
   )

(send frame show #t)

-- 
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/0B543D4F-7928-41CF-963C-E46858C93824%40biomantica.com.


Re: [racket-users] Re: DB hangs with postgres and broken network link

2020-07-03 Thread James Platt
I wonder if this is a more general TCP/IP issue rather than anything Postgres 
specific.  I'm troubleshooting an issue where a TCP connection to a server is 
unexpectedly going down, once in a while, with no obvious indication.  The 
solution, for now, is to have the client send a sort of ping over the TCP 
connection to the server every so often and then establish a new connection if 
it doesn't get a response.  In other words, when the connection goes down, 
trying to send something over it from the client does not generate an error.  I 
haven't found an indication on either the client or server.  So, to detect the 
connection failure, you have to look for a lack of response.  This is an 
intermittent failure and, as such, very annoying to troubleshoot.

-- 
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/87B3E760-332A-4D45-8D1F-0CE9180A2138%40biomantica.com.


Re: [racket-users] Artifacts: code snippets that are too small to be a package.

2020-06-09 Thread James Platt
I just added an example to Artifacts with one way of using the qresults-list 
package to create a table and manipulate it with a right-click menu.  I added 
quite a few comments which, I hope, will help people wanting to figure out how 
to use the qresults-list package.  This package has been mentioned a number of 
times on this list, but for those who aren't familiar, qresults-list has been 
part of ActivityLog2 for a long time and most examples of how to use the tool 
are in that application.  ActivityLog2 is one of the top examples people look 
at for how to create a GUI with Racket.  It was only just recently, however, 
that the author made the qresults-list code available as a separate package.  

-- 
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/BF493C6C-318C-4593-85AB-BBAE442F30CF%40biomantica.com.


[racket-users] Interpreting Racket profile stats

2020-06-05 Thread James Platt
I'm looking at profiling some code for performance and tried out the Racket 
profile package but I'm not sure what the numbers mean.  

Here is a very simple example:
https://stackoverflow.com/questions/23988370/thorough-guide-for-profiling-racket-code

Here's a run from my actual code:
https://gitlab.com/snippets/1983422

What is Total, versus Self versus Local?   Even in the simple, single threaded, 
example the percentages add up to much more than 100.  So how do they relate to 
each other?   Does this mean that some items are multi-step processes which 
include some of the other items?  In the multi threaded example, are some 
processes concurrent and, therefore, representing simultaneous execution on 
different processor cores?  In any case, the point is to be able to look at the 
output and figure out where the code is taking a lot of time.  If I am guessing 
correctly the numbers in the Idx column actually represent blocks of code 
(s-expressions?) rather than lines of text in the code.

-- 
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/859F6F04-1AA7-4BB0-9A88-31C39C9F3D4A%40biomantica.com.


Re: [racket-users] How to run multiple Racket installations?

2020-05-08 Thread James Platt
Would virtual machines be an option?  You do have to have a pretty good host 
machine with lots of RAM.  I do this mainly to have different development and 
testing environments.  It works pretty smoothly on my Mac Pro, with VirtualBox 
for Linux and Windows guest machines and VMWare for macOS guests.  

James

-- 
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/0BB22130-12D1-4FF3-9BB1-A79A595E8AF6%40biomantica.com.


Re: [racket-users] trickiness about the order of definitions in GUI code

2020-05-07 Thread James Platt
On May 7, 2020, at 12:44 AM, Philip McGrath wrote:

> Rather than designing an ad hoc system of indirection that can handle all of 
> the complexity,* I suggest using the one that already exists: units, Racket's 
> original, first-class (rather than first-order) module system, offer support 
> for cyclic dependencies. In fact, they are used in the implementation of 
> Racket's GUI framework to address precisely this problem.

Thanks.  I need to read up on Units.  Like I said, my production code is much 
more complicated than the example I posted so I'm sure that better organization 
will really help in the long run.  

James

-- 
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/55F53C1D-57FB-4EEF-94FB-AC41AC5A2DBD%40biomantica.com.


Re: [racket-users] Re: trickiness about the order of definitions in GUI code

2020-05-06 Thread James Platt
Thanks, Alex.  I actually tried something very similar to this earlier but 
failed.  What I should have done is to try it with my simplified code and then 
I would have realized it was an approach that could work.  The complication is 
that there is much more stuff going on in my production code.  For example, the 
popup menu is defined with a demand-callback function to enable and disable 
menu items, so that something which operates on a selection will be grayed out 
if there is no selection.  This also depends on the table definition.  I'll try 
and figure out how to make that work but, like you said, it's just a matter of 
more indirection.

James


On May 6, 2020, at 9:27 PM, Alex Harsanyi wrote:

> Every problem can be solved by adding another level of indirection (except 
> perhaps having too many  levels of indirection :-) ).  You can put the code 
> below in a separate file:
> 
> (define (make-info-menu-item parent target-table)
>   (new menu-item%
>   (label "info")
>   (parent parent)
>   (callback (lambda (menu-item event)
>   (message-box "Info"
>(~a "You have selected " (length (send target-table 
> get-selected-row-indexes)) " rows")
>#f)
> 
> And use it like so:
> 
> (require "info-menu-item.rkt")
> (define row-edit-menu (new popup-menu% ))
> (define table3 ...)
> (define info-menu (make-info-menu-item row-edit-menu table3)
> 
> You could also have just one "make-row-edit-menu" function which creates all 
> menu items.
> 
> Alex.
> 
> On Thursday, May 7, 2020 at 7:50:01 AM UTC+8, James Platt wrote:
> I'm working on organizing and documenting some things and I have some code, 
> below, which works but I don't understand why.  Specifically, why don't I get 
> an error about table3 not being defined? 
> 
> This is a very simplified version of what I'm working on.  What I actually 
> want to do is put all the code related to creating a standard table editing 
> menu in a file which I can then include wherever I want that menu.  The full 
> menu will be a lot of code.  Unfortunately I can't seem to get this to work 
> without either getting an error that row-edit-menu is not defined or that 
> table3 is not defined.  In other words, I want to be able to define table3 in 
> one file which requires the file where row-edit-menu is defined but I can't 
> seem to figure out how to get this to work.  It works just fine when all the 
> code is in one file, however. 
> 
> James 
> 
> 
> #lang racket 
> (require racket/gui/base 
>  qresults-list 
>  ) 
> 
> ;set up columns 
> (define (column1 data) (vector-ref data 0)) 
> (define (column2 data) (vector-ref data 1)) 
> 
> (define my-columns 
>   (list 
>(qcolumn "Column1" column1 column1) 
>(qcolumn "Column2" 
> (lambda (row) 
>   ;(displayln row) 
>   ;(displayln (db-row-ref row "Column2" headers 1)) 
>   (if (number? (column2 row)) (number->string (column2 row)) 
> "");This allows a cell to be blank. 
>   ;(number->string (column2 row)) 
>   ) 
> column2) 
> 
>) 
>   ) 
> 
> (define frame3 (new frame% 
>   [label "myTable 3"] 
>   [width 800] 
>   [height 600] 
>   )) 
> 
> 
> (define row-edit-menu (new popup-menu% )) 
> 
> (define info-menu-item (new menu-item% 
>   (label "info") 
>   (parent row-edit-menu) 
>   (callback (lambda (menu-item event) 
>   (message-box "Info" 
>(~a "You have selected 
> " (length (send table3 get-selected-row-indexes)) " rows") 
>#f) 
>   )) 
>   )) 
> 
> (define table3 
>(new (class qresults-list% (init) (super-new) 
>   [parent frame3] 
>   [pref-tag 'preferences-tag] 
>   [selection-type 'multiple] 
>   [right-click-menu row-edit-menu]) 
>   ) 
> 
> (send table3 setup-column-defs my-columns) 
> 
> (send frame3 show #t) 
> 
> (send table3 add-row (vector "R1C1" 10)) 
> (send table3 add-row (vector "R2C1" 11)) 
> (send table3 add-row (vector "R3C1" 12)) 
> (send table3 add-row (vector "R4C1" 13)) 
> 
> 
> 

Re: [racket-users] trickiness about the order of definitions in GUI code

2020-05-06 Thread James Platt
Thanks, Jon.  I'm going to try Alex's solution first but I may get back to this.


On May 6, 2020, at 8:49 PM, Jon Zeppieri wrote:

> On Wed, May 6, 2020 at 7:50 PM James Platt  wrote:
>> 
>> I'm working on organizing and documenting some things and I have some code, 
>> below, which works but I don't understand why.  Specifically, why don't I 
>> get an error about table3 not being defined?
> 
> The reason you don't get an error for the code you posted is because
> the mention of `table3` (before its definition) in `info-menu-item` is
> inside a function body. The referent of the name `table3` isn't
> required to define `info-menu-item`; it's sufficient to know that it
> refers to _something_, and that it will be available when that
> function is (later) called.
> 
>> In other words, I want to be able to define table3 in one file which 
>> requires the file where row-edit-menu is defined but I can't seem to figure 
>> out how to get this to work.
> 
> It's a bit trickier to define these things in separate files, because
> their definitions refer to each other (though indirectly in this
> case), and the module system does not tolerate cyclic dependencies.
> The most straightforward way to break the cycle would be to take
> advantage of the fact that `table3` and `info-menu-item` each depends
> on `row-edit-menu`, and `info-menu-item` further depends on `table3`,
> but `row-edit-menu` doesn't depend on either. So the dependencies
> aren't really cyclical. You can divide stuff up into separate modules
> like so:
> 
> menu.rkt
> ```
> #lang racket
> 
> (require racket/gui/base)
> 
> (provide frame3
> row-edit-menu)
> 
> (define frame3
>  (new frame%
>   [label "myTable 3"]
>   [width 800]
>   [height 600]))
> 
> (define row-edit-menu (new popup-menu%))
> ```
> 
> 
> table.rkt
> ```
> #lang racket
> 
> (require racket/gui/base
> qresults-list
> "menu.rkt")
> 
> (provide table3
> add-rows)
> 
> ;set up columns
> (define (column1 data) (vector-ref data 0))
> (define (column2 data) (vector-ref data 1))
> 
> (define my-columns
>  (list
>   (qcolumn "Column1" column1 column1)
>   (qcolumn "Column2"
>(λ (row)
>  ;(displayln row)
>  ;(displayln (db-row-ref row "Column2" headers 1))
>  (if (number? (column2 row)) (number->string (column2
> row)) "");This allows a cell to be blank.
>  ;(number->string (column2 row))
>  )
>column2)))
> 
> (define table3
>  (new (class qresults-list% (init) (super-new))
>   [parent frame3]
>   [pref-tag 'preferences-tag]
>   [selection-type 'multiple]
>   [right-click-menu row-edit-menu]))
> 
> (define (add-rows)
>  (send table3 add-row (vector "R1C1" 10))
>  (send table3 add-row (vector "R2C1" 11))
>  (send table3 add-row (vector "R3C1" 12))
>  (send table3 add-row (vector "R4C1" 13)))
> ```
> 
> 
> menu-item.rkt
> ```
> #lang racket
> 
> (require racket/gui/base
> "menu.rkt"
> "table.rkt")
> 
> (provide info-menu-item)
> 
> (define info-menu-item
>  (new menu-item%
>   [label "info"]
>   [parent row-edit-menu]
>   [callback (λ (menu-item event)
>   (message-box "Info"
>(~a "You have selected " (length (send
> table3 get-selected-row-indexes)) " rows")
>#f))]))
> ```
> 
> 
> main.rkt
> ```
> #lang racket
> 
> (require "menu.rkt"
> "table.rkt")
> 
> (send frame3 show #t)
> (add-rows)
> ```
> 
> Hope that helps.
> 
> - Jon
> 
> -- 
> 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/CAKfDxxwofLFVTkcGii%2BtLGKYCBFVNY2Tw9m8ZNjR--Hh_FRtEw%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/58CCDAB6-F650-4582-9038-5BA3C78728E8%40biomantica.com.


[racket-users] trickiness about the order of definitions in GUI code

2020-05-06 Thread James Platt
I'm working on organizing and documenting some things and I have some code, 
below, which works but I don't understand why.  Specifically, why don't I get 
an error about table3 not being defined?

This is a very simplified version of what I'm working on.  What I actually want 
to do is put all the code related to creating a standard table editing menu in 
a file which I can then include wherever I want that menu.  The full menu will 
be a lot of code.  Unfortunately I can't seem to get this to work without 
either getting an error that row-edit-menu is not defined or that table3 is not 
defined.  In other words, I want to be able to define table3 in one file which 
requires the file where row-edit-menu is defined but I can't seem to figure out 
how to get this to work.  It works just fine when all the code is in one file, 
however.

James


#lang racket
(require racket/gui/base
 qresults-list
 )

;set up columns
(define (column1 data) (vector-ref data 0))
(define (column2 data) (vector-ref data 1))

(define my-columns 
  (list
   (qcolumn "Column1" column1 column1)
   (qcolumn "Column2"
(lambda (row)
  ;(displayln row)
  ;(displayln (db-row-ref row "Column2" headers 1))
  (if (number? (column2 row)) (number->string (column2 row)) 
"");This allows a cell to be blank.
  ;(number->string (column2 row))
  )
column2)
   
   )
  )

(define frame3 (new frame% 
  [label "myTable 3"]
  [width 800]
  [height 600]
  ))


(define row-edit-menu (new popup-menu% ))

(define info-menu-item (new menu-item%
  (label "info")
  (parent row-edit-menu)
  (callback (lambda (menu-item event)
  (message-box "Info"
   (~a "You have selected " 
(length (send table3 get-selected-row-indexes)) " rows")
   #f)
  ))
  ))

(define table3
   (new (class qresults-list% (init) (super-new)
  [parent frame3]
  [pref-tag 'preferences-tag]
  [selection-type 'multiple]
  [right-click-menu row-edit-menu])
  )

(send table3 setup-column-defs my-columns)

(send frame3 show #t)

(send table3 add-row (vector "R1C1" 10))
(send table3 add-row (vector "R2C1" 11))
(send table3 add-row (vector "R3C1" 12))
(send table3 add-row (vector "R4C1" 13))


-- 
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/F54B34B7-F04F-4DF7-9236-FD6C4FE3C983%40biomantica.com.


[racket-users] Another suggestion for "The Racket Guide"

2020-04-08 Thread James Platt
While we are looking at the possibility of improving The Guide, one of the 
things which I find confusing in Racket documentation is that The Guide, The 
Reference and various manuals all look the same.  On several occasions I have 
started in The Guide, followed links, and then discover that I am in The 
Reference instead.  I think what is happening is that The Guide links to stuff 
in the other manuals and then the manuals link to both The Guide and The 
Reference.  You can easily end up moving from on to the other without realizing 
it.  The easiest way to figure out where you are, as far as I can tell, is to 
examine the URL of the page but this is an easy thing to miss.  I think it 
would help quite a bit to adopt some visual cue as to where you are.  This 
could be as simple as a change in the background color of the page or something 
like that.  It would also be great, in any case where an item appears in both 
The Guide and The Reference, to have a link from one to the other.  For 
example, in The Guide,  you would have a link for each item with a label called 
something like "See this page in The Reference."

-- 
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/1FEB4FDC-4008-46A7-89E3-29C71C3A6D3A%40biomantica.com.


Re: [racket-users] Stack overflow developer survey

2020-03-09 Thread James Platt


> https://stackoverflow.blog/2020/02/05/the-2020-developer-survey-is-now-open/
> 
> Represent!

I tried this right after I saw this message on Friday and it said that the 
survey had already expired.  I tried again with three different browsers, just 
now, to be sure it wasn't a glitch but I got the same result.  Since the linked 
post was dated Feb. 5th, it looks like they only allowed a month or less.  That 
doesn't seem to me like enough time to get the word out as they suggest.  Was 
anyone here on the list able to fill out the survey on or after last Friday?

-- 
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/53FF6D91-CFEF-4DBF-8263-D6ED2E9968C8%40biomantica.com.


Re: [racket-users] Re: quick racket editor survey

2020-02-27 Thread James Platt


On Feb 26, 2020, at 10:44 AM, Stephen De Gabrielle wrote:

> At 62 response, sadly the histogram doesn't show how many people use two or 
> even three editors.
> https://www.surveymonkey.com/results/SM-GBD6J7ST7/

I am in transition between DrRacket and Emacs so I checked both of those two, 
myself.  That was after you had posted your Venn diagram.  I was mostly using 
DrRacket before but now I am mostly using Emacs.  I still like the features in 
DrRacket for tracing definitions and use it for that.  Also, I have two 
monitors and Gnu Emacs in the terminal does fine for splitting the screen on 
one monitor but not so well across two monitors.  So, on the occasions where I 
want another file open on my second monitor, I have been using Emacs on the 
main monitor but DrRacket on the second.  I probably could use Emacs on 
multiple monitors if I used one of the Mac specific GUI versions.  I noticed 
several people at Racketcon using, not Aquamacs, but another GUI version of 
Emacs.  Is there any particular reason to pick one of these over another?

I also have set up a Racket development environment in Termux on my Android 
tablet.  Since there is no version of DrRacket for Android, I am exclusively 
using Emacs there.  Having said that, I haven't actually done any more yet than 
test it to see that it works.  


James

-- 
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/46BF6E5F-A613-4FF5-9C9B-C1526B31B54A%40biomantica.com.


Re: [racket-users] keyboard shortcuts in a popup menu

2020-01-23 Thread James Platt
Thanks.  I guess the point of having keyboard shortcuts in popup menus is just 
to display them to remind the user what they are.  At this point, I plan to 
follow the practice of having everything from the popups also in a main menu 
bar in every platform.  So really, the glitch failing to display a 
'#\backspace' shortcut in Linux is the serious one in terms of practicality.  


On Jan 22, 2020, at 5:42 PM, George Neuner wrote:

> 
> On 1/22/2020 4:44 PM, James Platt wrote:
>> I'm working on some GUI code and I am seeing some glitches with keyboard 
>> shortcuts in popup menus.  I wonder if others are seeing the same things.
>> 
>> In Racket 7.5 on macOS 10.11.6 "El Captian":
>> Shortcuts defined in a menu-item% in a popup menu don't work unless the 
>> popup menu is displayed. In other words, you have to right click first and 
>> then the shortcut will work while the menu is open.  This isn't a big deal 
>> if you are working according to Apple's human interface guidelines because 
>> all items in popup menus are also supposed to be in the main menu bar [1].   
>> Still, it seems like this should work on it's own.
> 
> It's pretty standard across platforms for popup windows (any kind) to become 
> inactive when they are hidden.  In most windowing systems it is possible to 
> override that behavior and keep a window active even when not shown, but I 
> haven't worked with Macs since MultiFinder so I can't guide you as to how to 
> do it there.
> 
> 
>> In Racket 7.5 on Linux Mint 19.1 (Racket installed with the Ubuntu PPA):
>> The shortcuts don't work at all, whether the popup is displayed or not.  
>> Also a keyboard shortcut defined with '#\backspace'  does not display in the 
>> popup.  This  is supposed to be ctl-backspace on Linux and Windows and 
>> command-delete on macOS.  The macOS version works but not the Linux version. 
>>  I haven't tested with Windows.
> 
> This sounds like a bug.
> 
> 
>> James
>> 
>> [1] 
>> https://developer.apple.com/design/human-interface-guidelines/macos/menus/contextual-menus/
> 
> 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/DD9915CE-FF87-4782-9DEF-EF07C5B2EB50%40biomantica.com.


[racket-users] keyboard shortcuts in a popup menu

2020-01-22 Thread James Platt
I'm working on some GUI code and I am seeing some glitches with keyboard 
shortcuts in popup menus.  I wonder if others are seeing the same things.  

In Racket 7.5 on macOS 10.11.6 "El Captian":
Shortcuts defined in a menu-item% in a popup menu don't work unless the popup 
menu is displayed. In other words, you have to right click first and then the 
shortcut will work while the menu is open.  This isn't a big deal if you are 
working according to Apple's human interface guidelines because all items in 
popup menus are also supposed to be in the main menu bar [1].   Still, it seems 
like this should work on it's own.  

In Racket 7.5 on Linux Mint 19.1 (Racket installed with the Ubuntu PPA):
The shortcuts don't work at all, whether the popup is displayed or not.  Also a 
keyboard shortcut defined with '#\backspace'  does not display in the popup.  
This  is supposed to be ctl-backspace on Linux and Windows and command-delete 
on macOS.  The macOS version works but not the Linux version.  I haven't tested 
with Windows.

James

[1] 
https://developer.apple.com/design/human-interface-guidelines/macos/menus/contextual-menus/

-- 
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/3926FF2E-DCAB-421D-8EE3-7B4DF5671033%40biomantica.com.


Re: [racket-users] Re: macOS 10.10 Yosemite?

2020-01-06 Thread James Platt


On Jan 4, 2020, at 4:04 PM, Robby Findler wrote:

> No Yosemite users to be found?

At some point, I should build a Yosemite VM in VMWare for testing purposes but 
it isn't a priority at the moment. The thing is that Yosemite is one of those 
versions of macOS where the use cases to stick with it, rather than upgrade, 
are very rare.  IIRC, there is little or no difference in system requirements 
versus El Capitan and it's very low risk to do that upgrade.   If this is 
important, I could bump up my testing priorities a little. 

James

-- 
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/CBFFA378-C9FF-46E8--4710473D4E87%40biomantica.com.


Re: [racket-users] Racket 7.5 DMG file does not open on OSX 10.11

2019-12-10 Thread James Platt


On Dec 6, 2019, at 9:56 PM, Darth Vadør wrote:

> If it isn't too much trouble, I at least would really appreciate this.
> One reason I think this is important is because Homebrew has a cask for 
> Racket, which uses the .dmg distribution. It sets up $PATH (and probably 
> other things I don't know about as well), and can update Racket for you, 
> which is quite pleasant.
> 
> If the maintainers of the cask see there is an easy way to support older Macs 
> they might (fingers crossed) consider it.

I would also like to have an HFS+ formatted dmg as an option.  However, 
Homebrew has dropped support for El Capitan and earlier but it continues to 
work (most of the time) if you already had a previous version installed.  
Everything after El Capitan can read APFS.   So, the maintainers of the cask 
might decide that any new legacy support would be short lived.

-- 
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/EDDD1A40-9C10-4F2B-8A07-6933784C5C41%40biomantica.com.


Re: [racket-users] Racket 7.5 DMG file does not open on OSX 10.11

2019-12-10 Thread James Platt


On Dec 3, 2019, at 7:09 PM, John Clements wrote:

> It sounds to me like an easy solution to your problems would be a 
> .tgz-bundled set, as e.g. we offer for Minimal Racket on the page
> 
> https://download.racket-lang.org/releases/7.5/
> 
> specifically at the link 
> 
> https://download.racket-lang.org/releases/7.5/installers/racket-minimal-7.5-x86_64-macosx.tgz
> 
> It looks to me like it would be fairly easy to generate this bundle for full 
> racket, unless I’m missing something obvious. It would presumably appear on 
> the “More Variants and Checksums” page along with the other tarballs. Is this 
> something you’d like to see happen for the 7.6 release?
> 
> As far as the choice of .dmg for the standard distribution, it has two 
> advantages that I’m aware of:
> 1) It allows us to create a easy installation path by specifying the way the 
> disk window should look when we open it, as opposed to having an installer, 
> and
> 2) It’s natively supported by Apple’s notarization workflow; I know that .tgz 
> files don’t work, and I suspect that .zip files wouldn’t work either, though 
> that’s just a guess.

Yes, I think tgz would be helpful.  The market my company is targeting with our 
software has a much greater share of Mac and Linux than typical and tgz is 
native to both.  On the other hand, would an HFS+ formatted dmg be an option?  
Support for that format goes all the way back to Mac OS 8.1.  I know that HFS+ 
formatted dmg distributions supported both advantages (1 and 2 above) in the 
past.  

-- 
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/45E4E017-A087-4790-AD12-C3ADD6336BD6%40biomantica.com.


Re: [racket-users] Re: Racket 7.5 DMG file does not open on OSX 10.11

2019-12-03 Thread James Platt


On Nov 27, 2019, at 12:42 PM, Darth Vadør wrote:

> I am having the same problem, and I am pretty sure that this is because the 
> new DMG uses the novel APFS format, which is not readable by our old HFS 
> computers. 
> As far as I know, HFS DMGs can be opened on new APFS Macs; would it be 
> possible / a good idea to keep distributing Racket on an HFS DMG for our 
> dinosaur machines? 

APFS has a number of new and improved features but I don't think any of them 
are really important for a software distribution archive.  Note that macOS does 
have zip built in.  As I understand it, the reason for dmg as the official 
distribution format is just that it is supposed to have superior integrity 
checking compared to zip.

> 
> Long live 10-year-old Macs

Indeed.  The 2009 Mac Pro which I am using right now is among most likely 
machines to be in use by the people who my company is developing software for 
in Racket.  This Mac Pro, running El Capitan (macOS 10.11), is not just a 
workable machine.  It's still a powerful machine by todays standards.  El 
Capitan is the highest OS officially supported but it can run High Sierra 
(10.13) just fine in VMWare.  Having said that, we also need to support the 
newest machines so I will probably try setting up a VM with an even newer OS or 
buy whatever is the cheapest laptop that can run Catalina.  For the Mac Pro, I 
am considering installing Linux and running macOS only in virtual machines.

If you want to test that the issue really is APFS then you might consider 
installing a High Sierra (or possibly later) virtual machine.  High Sierra, and 
up, can read APFS.

-- 
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/1934E9FC-CE39-4C4E-BF3A-0DC37DBA2509%40biomantica.com.


Re: [racket-users] Re: GUI (get-directory)

2019-12-03 Thread James Platt


On Nov 25, 2019, at 1:29 PM, Stephen De Gabrielle wrote:

> Many packages contain an /examples folder, and adding examples is an easy way 
> to contribute.

I did not know that.  So, I guess the strategy is to find the git repository 
for the package and look there?  In any case, I haven't been finding these 
examples with a general web search.

> 
> There is also https://github.com/racket/racket/wiki/Artifacts
> 
>> This page captures useful code snippets that are too small to be a package.
>> 
>> Please contribute your own!
> 
> Though these might be better places in documentation, or in /examples

That artifacts wiki a good thing to know about.  Most of these are a little 
more complex than I am thinking are good for documentation but I may well 
contribute some small but useful code.  I sometimes create my own examples as I 
go because I often look back through my own code to refresh my memory on how to 
do something.  

-- 
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/D5A56D93-963F-412D-9CA6-7DE3A17F6148%40biomantica.com.


Re: [racket-users] GUI (get-directory)

2019-12-03 Thread James Platt
On Nov 21, 2019, at 6:27 PM, Alexis King wrote:

>> On Nov 21, 2019, at 11:21, James Platt  wrote:
>> 
>> If we can direct more of the energy of this community into, not just 
>> improving the documentation, but the way we do documentation, it would be a 
>> major improvement.  Requiring lots of parentheses doesn't bother me.  Lack 
>> of infix notation doesn't bother me.  Lack of documentation does.
> 
> Every so often I see this sentiment expressed, and I’ll be entirely honest: I 
> find it very surprising! I don’t at all want to suggest your experiences are 
> untrue, or that they’re somehow your fault or not worth fixing, but they’re 
> so contrary to my own that I must be missing something. I would go so far as 
> to say that my experience with Racket’s documentation is far and away the 
> best of every programming language I have ever used, even without adjusting 
> for its comparatively small community.

It is definitely true that poor documentation is a general problem with 
programming languages and the Racket Guide and Racket Reference are, indeed, 
among the best that I have seen.  I really like the fact that the Racket 
community explicitly recognizes the need to have both a guide and a reference. 
Documentation actually is a big problem almost everywhere these days.  

> 
> I will concede that racket/draw and racket/gui are particularly sparse in the 
> way of inline examples—perhaps something about the amount of context setup 
> often necessary—but as the main distribution goes, that feels more like an 
> exception than the norm! If you pick any section in the Datatypes chapter of 
> the Racket Reference, for example, virtually every binding has typeset 
> examples (using the scribble/example library you mention). Sections with 
> fewer inline examples usually at least have links to example-heavy companion 
> sections in the Guide. Even a library like pict, which is visual in the same 
> way racket/draw and racket/gui are, has typeset examples for nearly every 
> documented export.

A lot of what I have been working on in Racket is GUI related.  That might be 
part of the reason my experience has been so different than yours.  I have 
almost entirely been using the Racket Guide rather than the Racket Reference.  
I suppose I should start collecting examples of lack of examples.  As it 
happens, my next project is about creating stand-alone executables.  Look at 
the Racket Guide about raco distribute and there are no examples at all.  I'm 
looking here:  https://docs.racket-lang.org/raco/exe.html?q=raco%20distribute

I also have not been able to find Racket examples very easily with a web 
search.  I did some example searches just now to make sure I'm right about that 
and it looks like my default search engine, DuckDuckGo, has a particular 
problem with Racket.  DuckDuckGo, usually gets just as good, and sometimes 
better, results than Google, in my general experience.  However, I got better 
results with Startpage for a few Racket related searches.  For example, I 
recently needed to use a PBKDF in my Racket code.  Search for "racket pbkdf" 
(without the quotes) in DuckDuckGo and you don't get much of use but Google or 
Startpage get you straight to the most relevant material.  So I'll have to make 
sure to try Startpage for my Racket work from now on.  Maybe this part is not 
so bad as I thought.  

Something else which I am not able to find easily about creating standalone 
executables is an overall description of how to do this.  If I understand 
correctly, there are at least three methods.  There are command line tools, 
there is the "Create Executable" command in DrRacket or you can create and run 
a makefile.   Are there limitations to any of these compared to the others?  

The documentation probably belongs here:
https://docs.racket-lang.org/guide/exe.html

I do expect that this blog post will be helpful:
https://www.greghendershott.com/2017/04/racket-makefiles.html

I'm sure that I  can also find lots of examples of makefiles around which I can 
look through but it is nicer to have some official documentation.  I probably 
will create some documentation about this myself but I would want to run it by 
someone with more knowledge on the topic before contributing it to the official 
documentation.  It's easier to create a blog post and give the information on a 
this-worked-for-me basis.  What I would go ahead and add to the official 
documentation is a link to the DrRacket Create Executable documentation, which 
is missing at first link above.  


> I agree that it would be nice to make contributing small documentation 
> improvements more accessible, but your wording seems to suggest you feel 
> there is a deeper, systemic problem with the existing documentation. Could 
> you say more on what that is? Or, maybe better

Re: [racket-users] Re: GUI (get-directory)

2019-11-21 Thread James Platt


On Nov 20, 2019, at 3:31 AM, Jack Firth wrote:

> Would it have helped if the get-directory documentation had included 
> examples? Many parts of Racket's documentation are lacking in example code, 
> especially the less-commonly-encountered parts.

Indeed, I have previously mentioned the lack of examples as a general problem.  
However, many potential examples may already be written in the form of test 
code.  There is a way to add a sandbox to Scribble which allows you to write 
test code and documentation at the same time.  It would be great if this could 
be made easier to set up and then promoted for wider use.  One place where it 
has been used is the struct++ package.

See:
https://docs.racket-lang.org/struct-plus-plus/index.html
https://github.com/dstorrs/struct-plus-plus/blob/master/scribblings/struct-plus-plus.scrbl

Also, as David Storrs has mentioned, it would be good if we can find a way to 
make it easier for more people to contribute to the documentation.  See, for 
example, the thread "Wanted: Easier way to contribute docs" on this forum from 
June of 2017.  

If we can direct more of the energy of this community into, not just improving 
the documentation, but the way we do documentation, it would be a major 
improvement.  Requiring lots of parentheses doesn't bother me.  Lack of infix 
notation doesn't bother me.  Lack of documentation does.

James

-- 
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/934E0BEE-5840-4596-975F-410C3770DBA6%40biomantica.com.


Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-18 Thread James Platt
On Nov 16, 2019, at 3:49 AM, Bogdan Popa wrote:

> 
> James Platt writes:
> 
>> Would this now be the preferred method to include a copy of the SQLite
>> library. required by the DB module, to your distribution?  The
>> software I am working on requires a newer version of SQLite than is
>> included in at least some of the operating systems we want to support
>> and it's too much to expect end users to install it themselves.
> 
> I released two packages[1][2] that distribute more recent versions of
> SQLite3 to Linux and macOS a couple of months ago.  I build the shared
> libraries in CI (using GitHub Actions) then add the .so and .dylib files
> to each package, using #lang info's `copy-foreign-libs'[3] to tell
> Racket that it should add the libs to a folder where the ffi library
> will know to look them up.  The source code is here[4].  I'd be happy to
> add more architectures and OSs if you need them.

Thanks.  I think this is exactly what I need.  Linux and macOS are good for 
now.  We will need to add Windows support later but that won't be for a while 
yet.   Eventually, we will want to support some NAS devices and limited mobile 
apps (Android and iOS) but these are not a priority.  


James

-- 
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/856973E6-6074-4A1F-8DEA-A4302F893D5F%40biomantica.com.


Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-15 Thread James Platt


On Nov 12, 2019, at 10:13 PM, Matthew Flatt wrote:

>> Although you can find the files using `find-share-dir` and/or
>> `find-user-share-dir`, adding a 'share mode to `define-runtime-path`
>> would make it possible for `raco distribute` to find and carry along a
>> directory/file when it's present, the same as 'so mode does.
> 
> Added.


Would this now be the preferred method to include a copy of the SQLite library. 
required by the DB module, to your distribution?  The software I am working on 
requires a newer version of SQLite than is included in at least some of the 
operating systems we want to support and it's too much to expect end users to 
install it themselves.  

https://docs.racket-lang.org/db/notes.html?q=sqlite#%28part._sqlite3-requirements%29

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5F0EC3D9-1D58-426D-9D00-984560CF85B4%40biomantica.com.


[racket-users] DTLS

2019-11-08 Thread James Platt
I looking at implementing DTLS (TLS for UDP) and I see that ports->ssl-ports in 
the openssl package does not specify that the port has to be TCP.  Does that 
mean that this should already work with UDP?  If so, has anyone done much work 
with this?

James

-- 
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/B46867EF-60B3-4EE0-A164-A39035EAD514%40biomantica.com.


Re: [racket-users] running the wrong sqlite3

2019-08-20 Thread James Platt


On Aug 19, 2019, at 9:24 PM, John Clements wrote:

> Perhaps you need to configure your lib-search-dir setting?
> 
> https://docs.racket-lang.org/raco/config-file.html?q=lib-search-dir#%28idx._%28gentag._65._%28lib._scribblings%2Fraco%2Fraco..scrbl%29%29%29

Thanks for the help but I think that's not the issue because 
(get-lib-search-dirs) returns exactly the same thing on a machine where this is 
working perfectly as on the machine where it isn't.  The machine where it is 
not working is a virtual machine with a stock install of macOS High Sierra and 
a relatively fresh install of Racket.  This VM is meant for development and 
testing.   This particular clone of the reference VM has been used for a little 
while but it should still be close to the reference.  So, on the one hand, it's 
surprising that this is happening here, with something so close to stock 
configuration.  On the other hand, the machine where it is working has been 
beaten into submission to run all kinds of development tools over a period of 
years.  

-- 
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/91E6919B-7066-4550-B394-0FA66886A6B0%40biomantica.com.


[racket-users] running the wrong sqlite3

2019-08-19 Thread James Platt
I'm having an issue where I can't seem to get Racket to run the right version 
of sqlite3.  At least, I'm assuming that's the problem because the syntax error 
below occurs in an older version but not the current version of sqlite3.  My 
Terminal command path has the correct version.  What can I do to make sure 
Racket is using the right version?


Here's the full error message.

RUNNING reset_dbs.rkt
rows are: '(#hash((data . #hasheq((base_dir . "/tmp/biomantica"))) (name . 
"filesystem")))
SQL:
INSERT INTO config ( name, data ) VALUES ($1,$2) ON CONFLICT DO NOTHING  
vals: 
'("filesystem" "{\"base_dir\":\"/tmp/biomantica\"}")
query-exec: near "ON": syntax error
  error code: 1
  context...:
   /Applications/Racket/collects/db/private/sqlite3/connection.rkt:457:0: 
handle-status*
   /Applications/Racket/collects/db/private/sqlite3/connection.rkt:413:8
   /Applications/Racket/collects/db/private/sqlite3/connection.rkt:216:4: 
prepare1* method in connection%
   
/Applications/Racket/collects/db/private/generic/../../../racket/private/more-scheme.rkt:261:28
   [repeats 1 more time]
   /Applications/Racket/collects/db/private/generic/functions.rkt:90:0: 
compose-statement
   /Applications/Racket/collects/db/private/generic/functions.rkt:148:0: 
query-exec
   /Users/fingal/code/bmtc_dev/app/db/tests/db_test_utils.rkt:103:8: for-loop
   "/Users/fingal/code/bmtc_dev/app/network/reset_dbs.rkt": [running body]
   temp37_0
   for-loop
   run-module-instance!125
   perform-require!78

-- 
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/C399A6BF-6FDE-49AD-9053-08F0F3FBD49A%40biomantica.com.


Re: [racket-users] Re: Do custodians shutdown when Racket exits?

2019-08-06 Thread James Platt


On Aug 6, 2019, at 1:54 PM, Tony Garnock-Jones wrote:

> How can a UDP socket survive process exit?
> 

I don't knot but this appears to happen.  On macOS, the open port shows in 
netstat but not lsof.  You can find the process ID with netstat but then, when 
you go to kill it, kill says there is no such process.  The important this is, 
of course, that trying to run another process with that port will fail.


Note that netstat on macOS does not have all the same command flags as the 
Linux version but you can see pids using:
netstat -anv


James

-- 
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/7EED97D1-B5AF-4DDF-A5D0-5E47314B04DF%40biomantica.com.


Re: [racket-users] Re: Gui editable grid/table

2019-07-22 Thread James Platt
There is also qresults-list, which is from Alex Harsanyi's ActivityLog2 
application.  You can see how it is used in that application.

https://pkgs.racket-lang.org/package/qresults-list
https://github.com/alex-hhh/ActivityLog2

On Jul 22, 2019, at 7:22 AM, Roman Klochkov wrote:

> https://pkgs.racket-lang.org/package/multicolumn
> 
> суббота, 20 июля 2019 г., 8:17:58 UTC+5 пользователь Raoul Schorer написал:
> Hi,
> I am trying to make a gui editable table. Is that possible in racket/gui?
> 
> It seems list-box% is not editable by default. Apparently, one can't stick 
> editors as list-box% choices either.
> 
> Can you please help?
> 
> Thanks!
> Raoul
> 
> 
> 
> 
> 
> -- 
> 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/d827b9f5-7a58-4b77-927f-b1122a8885c7%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/BA4BCCE1-706A-4018-A08F-BF38EF802E98%40biomantica.com.


Re: [racket-users] The case, and a proposal, for elegant syntax in #lang racket2

2019-07-18 Thread James Platt
Like others have said, I'm not sure that syntax is really the issue with Racket 
adoption.  For me, the difficulty in moving to Racket from other languages is 
not the syntax, it's other things.  Lot's of parentheses don't bother me.  
Writing (2 + 2) as (+ 2 2) is a little weird but It's not going to stop me from 
using Racket.  Maybe there are other examples of infix notation where it really 
helps for the syntax to be more like natural language but I can't think of an 
example right now.  

One issue is that Racket is documentation assumes more of a computer science 
background than I have.  My single biggest suggestion in this regard is to use 
examples... lots of examples.  The documentation shows you the syntax but 
that's not the same thing as understanding how something actually works or 
where it fits in with other elements of the base language.  

Also related to the background of the users is, for example, the family of 
functions including car, cdr, caar, cddadr, etc..  I puzzled over the question 
of why these functions even exist for quite a while.  I had never heard of this 
way of doing things before.  As I understand it, these functions are basically 
around for historical reasons.  There is no compelling need for me to learn 
them for the purpose of writing my own code and so I haven't been using them.  
It's only a matter for understanding other people's code.  During Racket Week 
and Racketcon, when I saw these functions being used, I understood to the point 
of realizing that the point was to pull a value out of whatever they were used 
on.  I couldn't tell you which value.  

There has to be some compromise between having flexibility to do things lots of 
different ways and having limits to what a programmer needs to know to read 
other people's code.  I have had the experience of writing a Perl script and 
then looking at some one else's Perl script, which does the exact same thing, 
and not being able to make head nor tail of it.   AppleScript is much more 
limited and easier to understand.  Part of that is just the limited scope of 
the language but they also have the philosophy that it is more important to 
make code easy to read than easy to write.  I agree with that decision a lot of 
the time.  R seems to me to strike a pretty good middle ground position in this 
area.  

A phrase which came up several times during Racket Week and Racketcon was "...a 
trap for the unwary."  There seem to be a lot of these in Racket.  I'm already 
pushing the TL;DR boundary pretty hard so I'll just suggest looking at the 
video and seeing where these this phase came up and whether there are any 
general categories of problems where something can be done.

-- 
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/4AB42B7E-DF83-4CF8-A14A-F92C2259B3DC%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] HTML rendering

2019-06-21 Thread James Platt
I've been looking at HTML rendering in Racket and the Browser package looks 
interesting, especially since it can execute Racket code from a special HTML 
tag.

https://docs.racket-lang.org/browser/index.html

The problem is that the rendering it does is too simple.  It's about on the 
level of Lynx and doesn't even render tables.  Is there another option that I 
am missing, like something implementing Gecko or KHTML/Webkit?  If not is there 
much interest in creating such a thing? The idea would be to be able to have a 
Racket GUI with a component implemented in HTML + CSS.  

James

-- 
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/99A41261-8EF1-47FA-9626-5E749E22BCA7%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] RacketCon hotel group rate

2019-06-14 Thread James Platt
I actually booked rooms at a hotel across the street from the Little America 
for much less.  In all the conferences and other events I have been to, I don't 
think I have ever, even once, found the group-rate rooms at the host hotel to 
be the best deal.

James


On Jun 14, 2019, at 3:40 PM, Matthew Flatt wrote:

> If you're attending just RacketCon, there are still some group-rate
> rooms available at the Little America Hotel --- but you'll need to act
> fast. Our guaranteed group reservation has expired, but they'll
> continue to accept group reservations as long as space remains.
> 
> See
> 
>  https://con.racket-lang.org/
> 
> for more information.
> 
> At Fri, 14 Jun 2019 08:31:30 -0400, Jay McCarthy wrote:
>> Racket Week is less than a month away! The dorm housing signup for the
>> workshops is closing soon. You'll have until 06/21 to register for it.
>> 
>> https://school.racket-lang.org/#housing
>> 
>> The details are at the link, but in summary, it's $40/night at the
>> University of Utah dorms.
>> 
>> Jay
> 
> -- 
> 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/5d03f81c.1c69fb81.eba49.412cSMTPIN_ADDED_MISSING%40gmr-mx.google.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/0F46524A-2E60-48F5-B013-67571DA16812%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Enabling/disabling menu items

2019-06-11 Thread James Platt


On Jun 11, 2019, at 4:54 PM, Matthew Flatt wrote:

> At Tue, 11 Jun 2019 16:45:05 -0400, James Platt wrote:
>> It looks like there is not way to enable and disable (grey out) menu
>> items the way that there is with buttons.
> 
> There's no `enable` initialization argument for `menu-item%`, but
> there's an `enable` method the same as for `button%` instances. If
> would be nice to have an `enable` initialization argument to create an
> initially disabled menu item, but you can send `enable` just after
> creating the menu item.
> 
> Is that what you were looking for, or do you have something else in
> mind?

Thanks.  I think this will work for me but, yes, it would be nice to have the 
initialization argument.  That was what threw me off into thinking that it 
wasn't available.  

James

-- 
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/BEA1A70C-69B1-44CC-ACA8-7A18992054EB%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Enabling/disabling menu items

2019-06-11 Thread James Platt
It looks like there is not way to enable and disable (grey out) menu items the 
way that there is with buttons.  So my question is whether the expectation is 
that you add and remove items from a menu instead or is this a reasonable 
feature request for a new version of Racket?

To illustrate what I mean with buttons, I have taken the code recently posted 
on this list by Matthias for the 7 GUIs task 5 (CRUD) and modified it so that 
the buttons enable and disable depending on whether something is selected or 
not.  After something is selected, you can click inside the list-box but not on 
any item to deselect and disable the buttons.  I want this kind of behavior but 
for menu items as well as buttons.

#! /usr/bin/env gracket
#lang at-exp racket/gui

;; a create-read-update-deleted MVC implementation 

;; 
---
(define *data '("Emil, Hans" "Mustermann, Max" "Tisch, Roman"))
(define *selector "")
(define *selected *data) ;; selected = (filter select data)

(define (selector! nu) (set! *selector nu) (data->selected!))
(define (select s) (string-prefix? s *selector))
(define (data->selected!)  (set! *selected (if (string=? "" *selector) *data 
(filter select *data

(define-syntax-rule (def-! (name x ...) exp) (define (name x ...) (set! *data 
exp) (data->selected!)))
(def-! (create-entry new-entry) (append *data (list new-entry)))
(def-! (update-entry new-entry i) (operate-on i (curry cons new-entry) *data 
select *selected))
(def-! (delete-from i) (operate-on i  values))

#; {N [[Listof X] -> [Listof X]] [Listof X] [X -> Boolean] [Listof X] -> 
[Listof X]}
;; traverse list to the i-th position of selected in data, then apply operator 
to rest (efficiency)
;; ASSUME selected = (filter selector data)
;; ASSUME i <= (length selected)
(define (operate-on i operator (data *data) (select select) (selected 
*selected))
  (let sync ((i i) (data data) (selected selected))
(if (select (first data))
(if (zero? i)
(operator (rest data))
(cons (first data) (sync (sub1 i) (rest data) (rest selected
(cons (first data) (sync i (rest data) selected)

;; 
---
(define-syntax-rule (def-cb (name x) exp ...) (define (name x _y) exp ... (send 
lbox set *selected)))
(def-cb (prefix-cb field) (selector! (if (string? field) field (send field 
get-value
(def-cb (Create-cb _b) (create-entry (retrieve-name)))
(def-cb (Update-cb _b) (common-cb (curry update-entry (retrieve-name
(def-cb (Delete-cb _b) (common-cb delete-from))

(define (common-cb f) (define i (send lbox get-selection)) (when i (f i)))
(define (retrieve-name) (string-append (send surname get-value) ", " (send name 
get-value)))
(define (lbox-click-action lstbox ctlevent)
  (cond [(null? (send lstbox get-selections))
 (send update-button enable #f)
 (send delete-button enable #f)]
[else (send update-button enable #t)
 (send delete-button enable #t)])
  )
;; 
---
(define frame   (new frame% [label "CRUD"]))
(define hpane1  (new horizontal-pane% [parent frame][border 10][alignment 
'(left bottom)]))
(define vpane1  (new vertical-pane% [parent hpane1]))
(new text-field% [parent vpane1][label "Filter prefix: "][init-value 
""][callback prefix-cb])
(define lbox(new list-box% [parent vpane1][label #f][choices '()][min-width 
100][min-height 100] [callback lbox-click-action]))
(define vpane2  (new vertical-pane% [parent hpane1][alignment '(right center)]))
(define name(new text-field% [parent vpane2][label "Name:  
"][init-value ""][min-width 200]))
(define surname (new text-field% [parent vpane2][label "Surname: "][init-value 
""][min-width 200]))
(define hpane2  (new horizontal-pane% [parent frame]))
(define create-button (new button% [label "Create"][parent hpane2][callback 
Create-cb]))
(define update-button (new button% [label "Update"][parent hpane2][callback 
Update-cb][enabled #f]))
(define delete-button (new button% [label "Delete"][parent hpane2][callback 
Delete-cb][enabled #f]))

(prefix-cb "" '***)
(send frame show #t)

-- 
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/6545DE0C-5B87-4C62-AF28-3C2C5A201627%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Distributing executables with homebrew

2019-06-10 Thread James Platt
Another consideration with Homebrew is how far back you want to go with OS 
support.  They recently ended support for macOS 10.11 "El Capitan".   In fact, 
it's the very first thing which has become an issue for me still running El 
Capitan.  I don't know exactly how far back you can support with Racket but 
it's farther than that.  


On Jun 10, 2019, at 5:58 AM, James Geddes wrote:

> Many thanks Joel,
> 
> I do agree that `raco distribute` seems the way to go. Indeed, the setup 
> described in the blog post you shared is just what I’m currently doings (so 
> it’s nice to know I’m not doing something too crazy!).
> 
> What gave me pause, however, was that homebrew seems to discourage 
> binary-only packages. You /can/ distribute a pre-built binary — as a “bottle” 
> — but the process to create a bottle requires one to have a distributable 
> source-code version first. (There are also “casks” for pre-built binaries but 
> these seem to be specifically designed for MacOS GUI binaries, whereas I have 
> a command-line utility.) So I feel I ought to follow that practice. 
> 
> And I am also unsure about whether Racket modules written for an application 
> "should be" distributed as a Racket package. Given how much of the Racket 
> tooling is around packages (scribble, dependencies), I would have thought all 
> of it. So one approach to building an executable might to be to set the 
> collections directory to somewhere local (I’m assuming this is doable), then 
> `raco pkg install my-app`, followed by compilation of the main module. But 
> then, as far as I can tell, one can’t `raco exe` a library module, only a 
> file. So I’m a bit stuck there, too.
> 
> These are rather incoherent thoughts to which I don’t except an answer. But I 
> will continue to try to figure out a sensible approach and report back if 
> anyone else is interested.
> 
> 
> James
> 
> 
> 
> 
>> On 9 Jun 2019, at 21:00, 'Joel Dueck' via Racket Users 
>>  wrote:
>> 
>> I’m no expert, but since no one else has chimed in: if you’re distributing a 
>> program (vs a library) and you want it to work regardless of whether Racket 
>> is installed, what you probably want is to compile your program using raco 
>> distribute (https://docs.racket-lang.org/raco/exe-dist.html). Then 
>> distribute the resulting binary. This will be faster for your users.
>> 
>> I haven’t done much with Homebrew, but maybe this would be a good place to 
>> start: http://octavore.com/posts/2016/02/15/distributing-go-apps-os-x 
>> 
>> On Friday, June 7, 2019 at 3:59:21 AM UTC-5, james.geddes wrote:
>> Dear All, 
>> 
>> Does anyone have experience sharing a Racket program using homebrew, for 
>> users who may or may not have the Racket distribution installed? (Homebrew 
>> is a popular package management system for the Mac.) 
>> 
>> In particular, I'd like to ensure that a certain Racket package (gregor) is 
>> available but without necessarily changing the user's installation of Racket 
>> if they already have one. 
>> 
>> (It doesn’t help that I have very little experience in distributing any kind 
>> of program with homebrew.) 
>> 
>> If anyone has a homebrew “formula” that you would be willing to share, I’d 
>> greatly appreciate taking a look! 
>> 
>> Many thanks, 
>> 
>> James 
>> 
>> 
>> 
>> 
>> -- 
>> 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/06889ecc-cf38-4037-9678-413169c8d5e2%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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/602099D3-2101-4C4B-9B05-413E291630FA%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/11F780AE-BB3E-463D-8839-B848891DB633%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Racket development on ARM

2019-05-15 Thread James Platt


On May 15, 2019, at 11:25 PM, Daniel Lister wrote:

> I do my racket projects using android with an external keyboard plugged in as 
> well, here's how I do it:
> 
> -Install termux
> -Inside termux, do a pkg install unstable-repo
> -You can now install racket
> 
> I haven't had any issues so far working this way.

Good.  I already have Termux installed and have emacs and git working in it.  I 
didn't realize that Racket was available in the unstable repo.  Thanks.

James

-- 
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/8A2F6E8F-C536-4A0E-9E00-76C6BF92DBA1%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Racket development on ARM

2019-05-15 Thread James Platt
I'm looking at the idea of writing Racket code on an ARM device.  Specifically, 
I have a tablet, which shipped with Android, with an external keyboard.   I 
have a few questions but I think I should start with the most fundamental.   Is 
Lineage OS the best choice or would something else be better for development 
purposes?  

James

-- 
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/EFD784F4-F109-4234-9D4F-12ECF1B56D20%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Error handling for the GUI

2019-03-25 Thread James Platt


On Mar 25, 2019, at 12:49 PM, Matthias Felleisen wrote:

> See how precise the exn message is: 2nd arg of 1st arg of f ~~ not a boolean? 

Okay.  So the exn message is generated in a systematic way which I can count 
on.  I didn't realize that.  Thanks.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Error handling for the GUI

2019-03-25 Thread James Platt


On Mar 25, 2019, at 12:05 PM, Matthias Felleisen wrote:

> Your exception handlers may test a contract failure to any level. You can 
> specify this in the predicate part of with-handlers or via match on the exn 
> within the handler function. Regexp matching works well here. 

It's obvious enough how to use regex matching for this purpose.  My concern is 
partly that it ends up being a lot of code to write and partly that I was 
assuming that the exact wording of error message details could change with 
updates.  Maybe these concerns are not so bad as I anticipate.  

>From The Racket Guide, I did not get the impression that you could test a 
>contract at any level.  Specifically, I don't see how you tell which parameter 
>caused the error. It could just be me not understanding something that is 
>actually obvious in the docs or maybe the docs need some work.  As usual, 
>examples would help.  I did search the web for examples of Racket code 
>including "exn:fail:contract" and found very little.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Error handling for the GUI

2019-03-25 Thread James Platt


On Mar 23, 2019, at 5:49 PM, Greg Hendershott wrote:

> But -- contract violations aren't like that. They're about some code
> surprising some other code. I think the only hope here is, run the
> code enough (before the user ever does) to flush out the bad code
> assumptions and fix them. Realistically that means having enough
> automated tests, and running them frequently enough (like on every
> code commit, or at least push, and you can't merge to master if tests
> don't pass, etc.).

Yes, but contract violations are also, by definition, problems that have been 
anticipated.  You may not know why a function is, for example, being passed a 
specific parameter that is the wrong data type or is empty when you said it 
should be non-empty but you do know that that is what happened.  It's enough to 
go on for an error message.  My hope was that contracts would provide a more 
granular set of predicates to test for each of the possible violations.  


-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Error handling for the GUI

2019-03-22 Thread James Platt
Well, I might make some kind of compromise.  What I don't want to allow is the 
possibility of the user experience being "I click on the button and nothing 
happens."  Next worst is to display a raw error message which the user can only 
interpret by cutting and pasting it into a web search.  So yes, I could just 
get that far and then try and fix all the bugs rather than try and handle every 
possible exception gracefully.  More likely, meet somewhere in the middle of 
those approaches.  


On Mar 22, 2019, at 4:55 PM, Robby Findler wrote:

> I know this will sound silly, but you could just consider them bugs and the 
> fix them? (I went through a similar thought process with DrRacket years ago 
> and that was the conclusion I came to-- just slap an "internal error" message 
> on it so people aren't confused about it being a bug in their program.)
> 
> Robby
> 
> On Fri, Mar 22, 2019 at 3:09 PM James Platt  wrote:
> I'm working on displaying informative error messages in a GUI and I have been 
> finding that many of the things I need to handle are contract violations in 
> downstream functions.  The thing is that it seems like there ought to be a 
> better way than the methods I can think of.  
> 
> It's very simple to use the predicate exn:fail:contract? to tell if there was 
> a contract violation but this doesn't tell me which downstream function or 
> which parameter caused the error.  I could parse the full error message with 
> regular expressions and use that to build my error message for the user.  
> However, this turns out to be a lot of code and it also seems like it could 
> break down if a future update to Racket or some package changes the wording 
> of an error message.  I could go to the downstream functions, remove their 
> contracts and, instead, have them raise custom exceptions.  Then catch those 
> exceptions in the GUI code.  Not only is this a lot of code to change but it 
> seems wrong to start with code created according to good practice and then 
> undo it for further improvement.  
> 
> So my question is whether there is a better way to do this than I am aware of?
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Error handling for the GUI

2019-03-22 Thread James Platt
I'm working on displaying informative error messages in a GUI and I have been 
finding that many of the things I need to handle are contract violations in 
downstream functions.  The thing is that it seems like there ought to be a 
better way than the methods I can think of.  

It's very simple to use the predicate exn:fail:contract? to tell if there was a 
contract violation but this doesn't tell me which downstream function or which 
parameter caused the error.  I could parse the full error message with regular 
expressions and use that to build my error message for the user.  However, this 
turns out to be a lot of code and it also seems like it could break down if a 
future update to Racket or some package changes the wording of an error 
message.  I could go to the downstream functions, remove their contracts and, 
instead, have them raise custom exceptions.  Then catch those exceptions in the 
GUI code.  Not only is this a lot of code to change but it seems wrong to start 
with code created according to good practice and then undo it for further 
improvement.  

So my question is whether there is a better way to do this than I am aware of?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Use cases for tables and records

2019-02-22 Thread James Platt
In R, I have extensively used the sqldf package, which allows you to execute 
SQL commands on one or more data frames and get the results back as another 
data frame.  You can connect it to different database engines to handle the 
SQL.  Although sqlite is the default, I mostly used PostgreSQL because of it's 
extensive features.  Windowing queries from PostgreSQL, for example, can be a 
really good solution in some circumstances.  

As far as I understand the term, I think this is a good example of language 
oriented programming.  It makes sense to me that Racket should have a way of 
using SQL to directly manipulate data structures.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Autocomplete from a list

2019-02-17 Thread James Platt
On Feb 14, 2019, at 9:22 PM, Alex Harsanyi wrote:

> There are two solutions I can think of:
> 
> (1) derive combo-field% and override the on-popup method to construct the 
> choice menu dynamically based on what is selected in the combo box field.  
> This has a few disadvantages, namely (a) you have to produce the menu 
> immediately, so if you have to query a database for the list of items, there 
> might be a long delay for the menu to show up and (b) the menu will not 
> update when the user types more text in the field, instead it will have to be 
> closed and reopened.
> 
> (2) you can use a combination of text-field% and a list-box%, where the 
> callback on the text field will populate the list box with the filtered 
> contents.  The user would have to select an item from the list box, but this 
> can be populated in a separate thread to prevent the GUI from freezing up 
> during a database query.  It does not look as nice as GUI widgets from other 
> applications though...
> 
> Here is some example code for both options, including an animation of what it 
> looks like:
> 
> https://gist.github.com/alex-hhh/20f03dcf2f7f340d20b95cb36da39f61
> 
> Alex.

Thanks.  This is really helpful.  I will probably go with option (2) because 
it's more practical and this is a part of the application which will not be 
used frequently.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Autocomplete from a list

2019-02-14 Thread James Platt
I have a situation where I want a Racket GUI combo-field% (or some other GUI 
element) to allow the user to select an exact item (uniquely matching a 
database key) from a list that is too long to display all at once.  I'm 
thinking that some form of auto completion would be best.  In Framework, I see 
that there is an auto-complete method in text% but I don't see a way to give it 
a specific search space to work from.  I see the opposite. You can get the list 
which it is auto completing from but I don't see how to set it.  

I mention combo-field% because the equivalent item in the LibreOffice database 
module does what I want.  I had a LibreOffice document which was connecting as 
client to a PostgreSQL database.  The combo-field list items were populated 
with an SQL query which got all the official human gene symbols from the 
database.  At the time there were something like 40,000 unique official gene 
symbols.  The user could start typing and it would reduce the list, as you go, 
to the remaining items that match.  Also, when there are too many items to 
display at once, LibreOffice only displays the first 10 or 20 items in the 
combo-field menu and gives you a scroll bar.  This worked out pretty well for 
that use case.  I now have a very similar one.  

What would be the best way to handle this situation?  The user needs to select 
an exact item from a database but there are too many items for a simple menu.

James

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] delays in message delivery

2019-02-08 Thread James Platt


On Feb 8, 2019, at 12:51 PM, Robby Findler wrote:

> There are some messages that get held up in the spam traps that
> requires one of the admins to explicitly approve (this happens when
> the post comes from someone on the list, but where they post with a
> different email address, I believe).

Any time I try and post a message from a different address, the message is 
immediately rejected.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] delays in message delivery

2019-02-08 Thread James Platt
I noticed recently that there have been several messages to this list which 
took an excessively long time to get to me.  For example, two messages from 
George Neuner, which arrived today, were actually sent on Wednesday.  Since I 
am having messages delivered to my desktop client, I decided to investigate the 
email headers to see where the delay was.  I am using an email alias created in 
a domain hosted at gandi.net which forwards to my Comcast address.  So, I 
wanted to see whose fault the delay was (Google, Gandi, or Comcast.)  According 
to my reading of the headers, the delay was entirely within Google.  In other 
words, there were excessive delays moving from one Google server to another.  
If this is correct then other people on the list should be seeing the same 
delays.  At least, anyone who is having list messages sent to a regular email 
address should be seeing the same delay.  So can other's confirm?  Are we all 
having the same problem?

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Beginning of the end for googlegroups?

2019-01-29 Thread James Platt
On Jan 25, 2019, at 8:51 PM, Neil Van Dyke wrote:

> Regarding hosting of the email list server... worst case, were Google Groups 
> to shut down with no good migration offering... if we can't find a turn-key 
> email list service we like, we could always run the time-honored MailMan on 
> either one of the affiliated universities' in-house systems (if the non-owned 
> .org domain name isn't a problem for that .edu), or on Linode/AWS/etc.
 
GDPR now mandates data portability for companies serving European citizens.  
IIRC, Google, among others, just a few months ago, set up some standards for 
exchanging data among competing services to comply with the new law.  If we go 
for some other service, we should check that they have a good statement 
regarding GDPR compliance.

At the university where I worked until recently, we had a MailMan server and it 
was trivial to set up a group on just about any vaguely academic topic you 
wanted.  However, they decommissioned the server just last year and now use a 
combination of features from Microsoft cloud services.   University IT has been 
moving away from anything maintained in-house.  The idea is that it is better 
for the IT department to act as a broker for external services.  With forum 
hosting, specifically, spam is an issue.   Our servers, or even our whole 
domain, were increasingly getting blocked by external servers.  SaaS (Software 
as a Service) is now the first choice.   I don't know if other universities 
are, or will be, making similar decisions but I wouldn't be too surprised.  


-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Beginning of the end for googlegroups?

2019-01-29 Thread James Platt


On Jan 29, 2019, at 3:08 PM, 'John Clements' via Racket Users wrote:

> For what it’s worth, I’m firmly in the “let’s wait and see” camp. I’m not 
> worried about losing archives…I think I personally have just about all of the 
> messages that have been posted to the google group, and I don’t think I’m 
> alone. So: for the moment, I’m not that concerned.

I have full archives since the time I first subscribed but it may still be 
useful, from time to time, to search the older archives.  Also, I think part of 
the value of having this kind of forum is that it is searchable from the 
internet for people who are researching something or doing some kind of 
troubleshooting.   It helps to promote and support Racket.  The Racket-Money 
list has made a different choice and decided to promote more candid discussion. 
 You just have to consider what the mission of this particular list is.  

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Places code not using all the CPU

2018-10-08 Thread James Platt
I wonder if this has anything to do with mitigation for Spectre, Meltdown or 
the other speculative execution vulnerabilities that have been identified 
recently.  I understand that some or all of the patches affect the performance 
of multi-CPU processing in general.

James  

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Upgrading Racket

2018-10-03 Thread James Platt
It turns out that the solution was to delete previously compiled code in 
various places.  I guess that things I was trying to run were trying to link to 
something, besides standard libraries, compiled under Racket 6.10. 

On Oct 3, 2018, at 3:48 PM, Philip McGrath wrote:

> Seeing that you're on Mac, `which raco` should help to confirm what version 
> of raco you have installed. (Interestingly, raco doesn't seem to support the 
> `--version` flag, which I think it probably should. `racket --version` does 
> work, but it's possible, albeit unlikely, that you could be have a raco that 
> doesn't match your racket.) 
> 
> If the version is wrong, the most likely place to have changed your path on 
> Mac would be in "~/.bash_profile". I personally recommend creating a file in 
> "/etc/paths.d/", which adds it for all users: e.g. `sudo echo 
> "/Applications/Racket v7.0/bin" >/etc/paths.d/racket`.
> 
> -Philip
> 
> 
> On Tue, Oct 2, 2018 at 9:53 PM James Platt  wrote:
> I'm just now getting back to this after returning from Racketcon.  I ran 
> `raco setup` as the user and again as root and it did not solve the problem.  
> So then I tried `raco setup -c` but this gave permission errors (unlike the 
> previous commands).  so I ran `sudo raco setup -c' and then `sudo raco 
> setup'.  I still get the same error.  Perhaps it's a matter of having a path 
> misconfigured somewhere, but where?
> 
> On Sep 28, 2018, at 9:33 PM, Tom Gillespie wrote:
> 
> > The compiled versions of all your modules are stale. One way to fix this is 
> > to run `raco setup`. On my system I have to run it as root, but you may be 
> > able to run it as the user that installed Racket.
> > 
> > On Friday, September 28, 2018 at 5:49:21 PM UTC-7, James wrote:
> > I just tried upgrading to Racket 7 on one of my machines (macOS 10.11.6) 
> > and I get the error shown below in DrRacket.  I thought I should mention it 
> > since I am probably not the only one.  I installed with the obvious method, 
> > which is to just drag the new Racket folder over to applications as it 
> > indicates in the disk image.  Did I miss some standard set of instructions 
> > for upgrading?  This happens any time I try to run something from DrRacket. 
> > 
> > read (compiled): wrong version for compiled code 
> >   compiled version: 6.10 
> >   expected version: 7.0 
> >   in: rkt/compiled/main_rkt.zo 
> > 
> > James
> > 
> > -- 
> > 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.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Upgrading Racket

2018-10-02 Thread James Platt
I'm just now getting back to this after returning from Racketcon.  I ran `raco 
setup` as the user and again as root and it did not solve the problem.  So then 
I tried `raco setup -c` but this gave permission errors (unlike the previous 
commands).  so I ran `sudo raco setup -c' and then `sudo raco setup'.  I still 
get the same error.  Perhaps it's a matter of having a path misconfigured 
somewhere, but where?

On Sep 28, 2018, at 9:33 PM, Tom Gillespie wrote:

> The compiled versions of all your modules are stale. One way to fix this is 
> to run `raco setup`. On my system I have to run it as root, but you may be 
> able to run it as the user that installed Racket.
> 
> On Friday, September 28, 2018 at 5:49:21 PM UTC-7, James wrote:
> I just tried upgrading to Racket 7 on one of my machines (macOS 10.11.6) and 
> I get the error shown below in DrRacket.  I thought I should mention it since 
> I am probably not the only one.  I installed with the obvious method, which 
> is to just drag the new Racket folder over to applications as it indicates in 
> the disk image.  Did I miss some standard set of instructions for upgrading?  
> This happens any time I try to run something from DrRacket. 
> 
> read (compiled): wrong version for compiled code 
>   compiled version: 6.10 
>   expected version: 7.0 
>   in: rkt/compiled/main_rkt.zo 
> 
> James
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Upgrading Racket

2018-09-28 Thread James Platt
I just tried upgrading to Racket 7 on one of my machines (macOS 10.11.6) and I 
get the error shown below in DrRacket.  I thought I should mention it since I 
am probably not the only one.  I installed with the obvious method, which is to 
just drag the new Racket folder over to applications as it indicates in the 
disk image.  Did I miss some standard set of instructions for upgrading?  This 
happens any time I try to run something from DrRacket.

read (compiled): wrong version for compiled code
  compiled version: 6.10
  expected version: 7.0
  in: rkt/compiled/main_rkt.zo

James

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Jewel is Jewelbox?

2018-09-28 Thread James Platt
In the PLT Games included with Racket 7, there is a game called Jewel.  It's 
very much like a game from a while back that was called Jewelbox.  This was 
something like 20 years ago and I remember it mainly because I still have the 
little drawstring bag which the disk came in.  It was distributed as shareware 
and I liked it well enough to pay the fee.  So I'm guessing that someone else 
here also liked that game.  

James

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] GUI problem -- main window loosing focus when two dialog boxes are opened

2018-05-08 Thread James Platt
No problem on macOS 10.11.6 "El Capitan", Racket 6.10, or on macOS 10.13.4 
"High Sierra", Racket 6.12.


On May 7, 2018, at 8:46 PM, Alex Harsanyi wrote:

> I have a problem with the Racket GUI where the main application window looses
> focus if two dialog boxes are opened than closed.  The problem occurs when the
> main window opens the first dialog box and the first dialog box opens the
> second one on top of it.  Once both dialog boxes are closed, the main window
> looses focus and goes to the bottom of the window stack (i.e. behind other
> windows).  This does not seem to happen if only one dialog box is opened than
> closed -- in that case the main window will have the focus.
> 
> Could someone confirm if this behaviour is seen on other platforms (I use
> Windows), and perhaps offer a workaround?
> 
> I attached a sample application that illustrates the problem below and you can
> also find the code here:
> https://gist.github.com/alex-hhh/20b3f1000813677330bbd2b85c57d319
> 
> Too see the problem, this code needs to be compiled into a stand-alone
> executable (using the Racket/Create Executable... from DrRacket).
> 
> #lang racket
> (require racket/gui)
> 
> (define toplevel (new frame%
>   [label "Hello World"]
>   [width 800]
>   [height 600]))
> (define dialog-1 (new dialog%
>   [parent toplevel]
>   [label "Dialog 1"]
>   [width 400]
>   [height 300]))
> (define dialog-2 (new dialog%
>   [parent dialog-1]
>   [label "Dialog 2"]
>   [width 200]
>   [height 150]))
> 
> (define (on-open-dialog1 button event)
>   (send dialog-1 show #t))
> 
> (define (on-close-dialog1 button event)
>   (send dialog-1 show #f))
> 
> (define (on-open-dialog2 button event)
>   (send dialog-2 show #t))
> 
> (define (on-close-dialog2 button event)
>   (send dialog-2 show #f))
> 
> (define b1 (new button%
> [parent toplevel]
> [label "Open Dialog 1..."]
> [callback on-open-dialog1]))
> (define b2 (new button%
> [parent dialog-1]
> [label "Open Dialog 2..."]
> [callback on-open-dialog2]))
> (define b3 (new button%
> [parent dialog-1]
> [label "Close Dialog 1"]
> [callback on-close-dialog1]))
> (define b4 (new button%
> [parent dialog-2]
> [label "Close Dialog 2"]
> [callback on-close-dialog2]))
> 
> (send toplevel show #t)
> 
> Thanks,
> Alex.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Contract work

2018-03-29 Thread James Platt
My company, Biomantica, is working on an SBIR grant application and we would 
like to be able to include statements from people who would be willing to do 
Racket contract work for us contingent on our getting the grant.  What we 
really need is just to show that we have people we can call on who have 
expertise we will need.  This is done with a form which the NIH calls a 
"bioisketch."  It's like a resume or CV but shorter (just a few paragraphs) and 
the really important part is a paragraph explaining what skills you have to 
contribute to this specific project.  

To be clear, this is not near-term.  The grant comes in two phases, and it will 
be December before we know if we're getting Phase 1.  Unfortunately the grant 
deadline is now a week away, so sorry for the short notice, but who is 
interested and what skills (below) can you provide?

Please note that we won't know if we're getting the grant until the end of the 
year, so sending us your biosketch does not commit you to anything and you will 
have plenty of time to make arrangements when the time comes. 

Note that we will also want to hire full time Racket programmers as regular 
employees if we get Phase II of the grant.  People who send us biosketches now 
will be at the head of the line then.

The initial product is something which behaves like Dropbox but is actually a 
P2P network so you can get accelerated data transfer and your file space is 
only limited by the storage (hard drives) you contribute to the network.  We 
will then add features for data analytics, real-time conferencing, and 
distributed computation.


Things involved in our product, and therefore things we will be hiring for:

FFI from Racket to various C libraries which might include PJSIP, libnice,  and 
libsodium, for example.

PKI with both a CA and WoT which reinforce each other for TLS, digital signing 
of files, and authentication of users that are part of a collaborative group to 
us and to each other.

NAT traversal, including PCP, NAT-PMP, uPnP, STUN, TURN, and ICE.

Various optimizations of data transfer using TCP/IP, UDP, UDT, and uTP, IPv4, 
and IPv6. 

Optimizations of data transfer based on predictions of its likely destinations 
from relationships in the WoT and network performance metrics.

cryptocurrency, especially the Etherium Virtual Machine.

Fountain codes.

GUI work, especially for managing collaborative groups of people, sort of 
social networking style, but actually supporting our WoT.

Protocol buffers and database work to exchange metadata with other systems such 
as the Galaxy open source bioinformatics platform.

Although I have the CISSP credential, we could still use more depth in 
information security.

Did I mention information security?

If you actually understand what we're talking about (above), you're probably 
someone we can use.  :)

James

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Splitting up a GUI source file?

2018-03-23 Thread James Platt

> May be relevant
> 
> https://pkgs.racket-lang.org/package/spreadsheet-editor

Indeed, I got part way through working with that package for this exact purpose 
but ran into glitches.  The main thing is just a lack of documentation.  At 
this point, I am favoring the idea of borrowing qresults-list% from the 
Activity Log2 application as mentioned previously on this list (quoted below.)  
Unfortunately, I probably won't have time to get back to the project until May.

On Mar 5, 2018, at 4:00 PM, Alex Harsanyi wrote:

> If you want to look at a possible implementation, I wrote a wrapper around 
> list-box% for exactly the purpose of showing SQL query results in a 
> list-box%.  It supports sorting, adding, deleting and updating individual 
> rows, and you can also reorder and resize columns and this layout is saved 
> and can be restored:
> 
>https://github.com/alex-hhh/ActivityLog2/blob/master/rkt/widgets.rkt#L982
> 
> The name of the class is `qresults-list%` and you can find usage examples of 
> it throughout the application.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Splitting up a GUI source file?

2018-03-23 Thread James Platt

> I am trying to create a GUI program, my problem is that the source code for 
> the
> GUI portion is growing out of control and I don't know how to split it up.

I'm not sure if this will really answer your question but you may want to look 
at some code from MrEd Designer and see how it splits stuff up.  It generates 
all the GUI code in a file which you then include in a file with the logic you 
write.  Following this approach, you could probably have more than one GUI file 
which you could include in your top level file.  

> 
> Here is some background info: the GUI is basically just a specialised frontend
> to a database, the users clicks some stuff, the corresponding query is
> constructed and sent off to SQLite using the db library.

Actually, I've been thinking about learning about how to create MrEd Designer 
widgets in order to add some elements which would be useful for database 
clients.  This would include editable tables, like you mention.

James

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Sorting a list-box%

2018-03-05 Thread James Platt

On Mar 5, 2018, at 4:00 PM, Alex Harsanyi wrote:

> If you want to look at a possible implementation, I wrote a wrapper around 
> list-box% for exactly the purpose of showing SQL query results in a 
> list-box%.  It supports sorting, adding, deleting and updating individual 
> rows, and you can also reorder and resize columns and this layout is saved 
> and can be restored:
> 
> https://github.com/alex-hhh/ActivityLog2/blob/master/rkt/widgets.rkt#L982
> 
> The name of the class is `qresults-list%` and you can find usage examples of 
> it throughout the application.


Thanks.  I will definitely check that out.  I have another reason to look at 
ActivityLog2 which is that I am a runner (mostly half marathon and 20K) and I 
have a Garmin Vivoactive HR.  

James

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Sorting a list-box%

2018-03-05 Thread James Platt
I'm working on something which is leading to a cascade of questions so I 
suppose that I should just start by explaining what I am trying to do.  I have 
written some code which takes the results of an SQL query and displays it as a 
table in a GUI using list-box%.  This works and I am now writing the callback 
function.  One of the things I want it to do is sort the table by a given 
column when you click on that column header.  As far as I can tell, the way to 
do this is to get the contents of the table, sort it, and put it back. The 
Racket Guide doesn't show any way to just get all the data from the list-box% 
at once but you can get a row by index number.  Fine, so I could loop through 
and get all the rows but how do I know how many rows there are?  There isn't a 
way to get the number of rows directly but there is a way to get the number of 
visible items in the list-box% so maybe I could use that? 

The message is:
(send a-list-box number-of-visible-items)

So, at this point, I have my callback just using this message to report back 
the number of visible items when I click a column header.  I have a 4 x 8 table 
and it tells me that there are 35 items.  Where is this number coming from?  
Could it be a pair of opposite off-by-one errors and it thinks I have a 5x7 
table?  

There are ways to get around the problem.  I could, for example, maintain a 
parallel copy of the contents of the table but I want to write the most 
generalizable code possible since I expect to do this kind of thing repeatedly 
in different contexts.  It seems more reliable to work with the actual data in 
the list-box%.  

The bigger question is whether I am going about what I want to do the best way 
in the first place.  Is list-box really what I want to use?  Is there a better 
choice?  If not, should I work with someone to modify list-box to be more 
accommodating to my use case?

James

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Want to send email with net/smtp. An error to fix.

2018-01-19 Thread James Platt
> 
> (And is the html thing really that big a deal?)
> 
> 
> It's likely that part of the reason they were caught in a spam trap was 
> because they were HTML and formatted with both very large font and half a 
> dozen different colors.  Also, as George points out, HTML formatting gets 
> fouled up far more easily than raw text.

Right.  The main point, for me, is the uncertainty that I'm seeing everything I 
should see.  in a properly configured (in my opinion) email client, a lot of 
HTML features will be disabled for security reasons, including such things as 
cookies, javascript and remote images...

-- 
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.
For more options, visit https://groups.google.com/d/optout.