Re: [racket-users] Looking for system admin help for the package system
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
> 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
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
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
> 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?
... 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.
Re: [racket-users] Adding keybindings to debug
I don't have the time to attempt modifications to DrRacket right now. Instead I've moved to emacs, which (to the question posed earlier by Robby Findler) does have keyboard shortcuts for running the debugger. I'm still using racket via emacs' racket-mode but trying to click on the very small green circles and rectangles in the DrRacket debug interface was just too much. I could probably figure out how to add keyboard shortcuts by inspecting the racket-mode code; that may happen later when I know my way around scheme/lisp much better. Thanks for all the help on this thread. It's good to know there are helpful people in this community. On Wednesday, November 3, 2021 at 6:41:55 AM UTC-7 James Zollinger wrote: > Your explanation of "lambda _" jogged my memory. I'm remembering long ago > Haskell learnings where the underscore is used in much the same way. > > I'll take a look at the two references you shared. This is a really useful > starting point. Thank you again, Laurent. > > > On Tue, Nov 2, 2021 at 5:35 AM Laurent wrote: > >> On Mon, Nov 1, 2021 at 11:14 PM James Zollinger wrote: >> >>> Thanks for the info, Laurent. I tried the trick outlined in the link you >>> sent me on Debian 11 versions of Gnome 3.38.5 (just to test this) and MATE >>> 1.24.1-2 (my preferred environment) without any success. >>> >> >> I haven't tried myself. For what it's worth, I wrote another quickscript >> called "command palette" that does exactly that, but of course specifically >> for DrRacket (*): >> https://gist.github.com/Metaxal/d06f50a2534ca229309e71a2d244a912 >> >> Again it doesn't look into context (right click) menus as they are not >> easily accessible. >> >> (*) Actually, it could be used with any Racket GUI app! >> >> >>> My LISP/scheme/racket skills are maturing but I'm not quite ready to >>> tackle: >>>(when (cons? stat) >>> (make-object menu-item% >>>"Print return value to console" menu >>>(lambda _ (send (get-tab) print-to-console >>>(string-append "return val = " >>> rendered-value) >>> and friends! (What is "lambda _"?!) >>> >> >> Yeah, that can seem weird, but it will make sense. Let me explain in >> examples: >> >> (define f (lambda (x) (displayln x))) >> (f 3) ; ok >> (f 3 4 5) ; not ok >> (f) ; not ok >> >> (define g (lambda (x . rst) (displayln (list x rst >> (g 3) ; ok, equiv to (displayln '(3 ()), rst is the empty list >> (g 3 4 5) ; ok, equiv to (displayln '(3 (4 5))) >> (g) ; not ok, needs at least 1 argument >> >> (define h (lambda lst (displayln lst))) >> (h 3) ; equiv to (displayln '(3)) >> (h 3 4 5) ; equiv to (displayln '(3 4 5)) >> (h) ; equiv to (displayln '()) >> >> Now, `_` is just an identifier like any other, like `lst`, but by >> (untold) convention it means "I won't use this argument". So >> (define k (lambda _ (displayln "hoy"))) >> (k) ; equiv to (displayln "hoy") >> (k 3 4 5) ; equiv to (displayln "hoy") >> >> >>> Any suggestions on how to quickly get up to speed to >>> modify debug-tool.rkt beyond reading all of the Racket Documentation >>> <https://docs.racket-lang.org/>? >>> >> >> debug-tool.rkt is probably not the best first encounter with Racket. It >> draws on many concepts (macros, classes, gui, etc.). Though if you do >> manage to make sense of it you may learn a lot :) >> >> For this particular task, even though the file contains "units", I think >> you shouldn't have to understand units, but you will certainly have to >> understand Racket classes: >> https://docs.racket-lang.org/guide/classes.html >> and part of the GUI: >> https://docs.racket-lang.org/gui/index.html >> >> HTH, >> Laurent >> > -- 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/69770cba-7aa9-4666-b5f3-5a8d4d81e458n%40googlegroups.com.
[racket-users] port 55555 in use error
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] Adding keybindings to debug
Your explanation of "lambda _" jogged my memory. I'm remembering long ago Haskell learnings where the underscore is used in much the same way. I'll take a look at the two references you shared. This is a really useful starting point. Thank you again, Laurent. On Tue, Nov 2, 2021 at 5:35 AM Laurent wrote: > On Mon, Nov 1, 2021 at 11:14 PM James Zollinger wrote: > >> Thanks for the info, Laurent. I tried the trick outlined in the link you >> sent me on Debian 11 versions of Gnome 3.38.5 (just to test this) and MATE >> 1.24.1-2 (my preferred environment) without any success. >> > > I haven't tried myself. For what it's worth, I wrote another quickscript > called "command palette" that does exactly that, but of course specifically > for DrRacket (*): > https://gist.github.com/Metaxal/d06f50a2534ca229309e71a2d244a912 > > Again it doesn't look into context (right click) menus as they are not > easily accessible. > > (*) Actually, it could be used with any Racket GUI app! > > >> My LISP/scheme/racket skills are maturing but I'm not quite ready to >> tackle: >>(when (cons? stat) >> (make-object menu-item% >>"Print return value to console" menu >>(lambda _ (send (get-tab) print-to-console >>(string-append "return val = " >> rendered-value) >> and friends! (What is "lambda _"?!) >> > > Yeah, that can seem weird, but it will make sense. Let me explain in > examples: > > (define f (lambda (x) (displayln x))) > (f 3) ; ok > (f 3 4 5) ; not ok > (f) ; not ok > > (define g (lambda (x . rst) (displayln (list x rst > (g 3) ; ok, equiv to (displayln '(3 ()), rst is the empty list > (g 3 4 5) ; ok, equiv to (displayln '(3 (4 5))) > (g) ; not ok, needs at least 1 argument > > (define h (lambda lst (displayln lst))) > (h 3) ; equiv to (displayln '(3)) > (h 3 4 5) ; equiv to (displayln '(3 4 5)) > (h) ; equiv to (displayln '()) > > Now, `_` is just an identifier like any other, like `lst`, but by (untold) > convention it means "I won't use this argument". So > (define k (lambda _ (displayln "hoy"))) > (k) ; equiv to (displayln "hoy") > (k 3 4 5) ; equiv to (displayln "hoy") > > >> Any suggestions on how to quickly get up to speed to >> modify debug-tool.rkt beyond reading all of the Racket Documentation >> <https://docs.racket-lang.org/>? >> > > debug-tool.rkt is probably not the best first encounter with Racket. It > draws on many concepts (macros, classes, gui, etc.). Though if you do > manage to make sense of it you may learn a lot :) > > For this particular task, even though the file contains "units", I think > you shouldn't have to understand units, but you will certainly have to > understand Racket classes: > https://docs.racket-lang.org/guide/classes.html > and part of the GUI: > https://docs.racket-lang.org/gui/index.html > > HTH, > Laurent > -- 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/CAN-sgtKa_3HNU1UNQnyhU3Hu3K7Lz%3D_WvFY-n5fbyf2eLFhvjw%40mail.gmail.com.
Re: [racket-users] Adding keybindings to debug
Thanks for the info, Laurent. I tried the trick outlined in the link you sent me on Debian 11 versions of Gnome 3.38.5 (just to test this) and MATE 1.24.1-2 (my preferred environment) without any success. My LISP/scheme/racket skills are maturing but I'm not quite ready to tackle: (when (cons? stat) (make-object menu-item% "Print return value to console" menu (lambda _ (send (get-tab) print-to-console (string-append "return val = " rendered-value) and friends! (What is "lambda _"?!) Any suggestions on how to quickly get up to speed to modify debug-tool.rkt beyond reading all of the Racket Documentation <https://docs.racket-lang.org/>? On Sat, Oct 30, 2021 at 3:37 AM Laurent wrote: > On Fri, Oct 29, 2021 at 10:47 PM James Zollinger wrote: > >> Thank you both for the thoughtful answers. I will take a look at the >> quickscript you sent, Laurent. The mac keyboard shortcut is a great >> feature. Makes me wonder about buying a mac again after quite a few years. >> (I use debian as my daily driver, at least for development.) > > > Apparently it should be possible to do the same thing for Debian, > depending on your window manager, with some caveats: > > https://askubuntu.com/questions/107849/can-i-assign-custom-keyboard-shortcuts-for-menu-items-in-applications > > >> If anyone out there knows how to deal with context menus >> programmatically, please share. >> > > The code of the debug-tool should be changed to make these reachable from > the outside with a define/public. Somewhere around here: > > https://github.com/racket/drracket/blob/b74dc3bc65b4843db0c2b381161fa9e8d85d230d/drracket/gui-debugger/debug-tool.rkt#L375 > but it's a little intricate because a set of specialized menu items are > created after right-clicking when in debug mode. > > Another possibility would be to simulate the mouse clicks, but that seems > rather hacky and error-prone. > > -- 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/CAN-sgtLf0q3aVwYJSvYDBpBErWoouKkhBsE5N3-yLnx-nJkNZw%40mail.gmail.com.
[racket-users] Adding keybindings to debug
I'm a happy user of DrRacket, plowing through the MIT SICP (Structure and Interpretation of Computer Programs.) As I'm learning Scheme, I'm spending more time than I'd like to admit in the debugger. I'm more used to emacs/bash but really liking the DrRacket IDE (using graphical libs to display output, for example) and would really like to stick with it, but I'm struggling with the keybindings... I have seen the documentation: https://docs.racket-lang.org/drracket/Keyboard_Shortcuts.html but I don't see a way to add keyboard shortcuts in the debugger. I'd like to add shortcuts for GUI buttons "Go", "Step", "Over", etc. as well as context menus "Print return value to console", "Pause at this point", etc. Any help would be greatly appreciated. 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/c429d210-7392-4ad3-90db-b1e9edba08b2n%40googlegroups.com.
Re: [racket-users] problem of gui layout using side-by-side frames
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
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?
> 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?
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
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
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
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
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
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
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
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
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
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] (current-memory-use cust) gives "wrong number of arguments" in typed racket
Thanks! On Monday, 14 December 2020 at 00:56:15 UTC sorawe...@gmail.com wrote: > Fixed by https://github.com/racket/typed-racket/pull/1009. > > On Sat, Dec 12, 2020 at 7:09 PM James Cook wrote: > >> I'm new to racket, and I'm not sure if this is a bug or oversight or I'm >> just missing something. >> >> In typed racket, when I try to pass a custodian as an argument to the >> current-memory-use function, I get an error like so: >> >> falsifian angel ~ $ racket -I typed/racket >> Welcome to Racket v7.9 [cs]. >> > (define c (make-custodian)) >> > (current-memory-use c) >> ; readline-input:2:0: Type Checker: could not apply function; >> ; wrong number of arguments provided >> ; expected: 0 >> ; given: 1 >> ; in: (current-memory-use c) >> ; [,bt for context] >> >> If I don't pass "-I typed/racket" then there's no trouble. What's going >> on? Does the current-memory-use function need a better type annotation? >> >> 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...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/racket-users/164bb6df-9dd6-4aa5-91a5-8ea3d70ad2a4n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/racket-users/164bb6df-9dd6-4aa5-91a5-8ea3d70ad2a4n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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/205fe188-6158-4e01-9435-5924f7be4d09n%40googlegroups.com.
[racket-users] (current-memory-use cust) gives "wrong number of arguments" in typed racket
I'm new to racket, and I'm not sure if this is a bug or oversight or I'm just missing something. In typed racket, when I try to pass a custodian as an argument to the current-memory-use function, I get an error like so: falsifian angel ~ $ racket -I typed/racket Welcome to Racket v7.9 [cs]. > (define c (make-custodian)) > (current-memory-use c) ; readline-input:2:0: Type Checker: could not apply function; ; wrong number of arguments provided ; expected: 0 ; given: 1 ; in: (current-memory-use c) ; [,bt for context] If I don't pass "-I typed/racket" then there's no trouble. What's going on? Does the current-memory-use function need a better type annotation? 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/164bb6df-9dd6-4aa5-91a5-8ea3d70ad2a4n%40googlegroups.com.
Re: [racket-users] Application Templates!
> On 20 Aug 2020, at 18:22, Sorawee Porncharoenwase > wrote: > > Is this intended to be something like https://docs.racket-lang.org/scaffold/? That also looks extremely useful! 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/13867585-A96B-49A9-ACEB-C824315AF71C%40gmail.com.
Re: [racket-users] Application Templates!
Just to note that I would find this sort of thing very useful. I have struggled to package my command-line app in a way that makes it easily accessible to my colleagues (a mixture of Python developers on Macs using homebrew and non-developers on corporate Windows systems using who knows what). I’ve also struggled to understand the convention organising directories within a package. (I think perhaps this is because the system is actually very flexible.) For me, commented examples of these would be a very helpful complement to the (excellent) guide and reference. James > On 20 Aug 2020, at 18:11, Stephen De Gabrielle > wrote: > > Alex is right, most developers don't need this. > > The point of templates is a jumping off point for new developers, or > developers trying a domain they are not familiar with. > > Where possible I will be linking back to any supporting materials > (https://alex-hhh.github.io/2020/03/a-game-of-tetris.html thank you Alex) > > As part of the working example distributing or deploying; sometimes we make > software for ourselves, (packages, plugins, scripts, keybindings and new raco > commands), > but sometimes we make software for others; in those cases the templates need > to include instructions for that process > - create the distributable executable > - deploy a web app (blog post by Alexis - but might make use of the 'Deploy > to Heroku' button) > - Microsoft Store (help please? both x86 and ARM) > - App Store for mac (https://defn.io/2020/01/04/remember-internals/ thank you > Bogdan) and maybe iOS ( https://defn.io/2020/01/05/racket-on-ios/ ) > - packaged as a PPA for linux. > - github actions > - services or components in larger frameworks/applications/or os's (?) > > A recent contribution is a new command extension to raco: > https://github.com/nixin72/from-template > $ raco from-template > Philip described it 'like create-react-app, but for all sorts of Racket > templates' > (It is currently only linux so it would be nice if a windows user could help) > > A big thank you goes to Philip because it serves two purposes > 1. It’s a raco tool for installing templates - exactly what is needed > 2. It is a template for adding a command to raco! > > PS: I would suggest that Racket is *a lot* like dotnet core in that it is a > 'developer platform' (not a framework) > that consists of 'a runtime, a series of languages and a bunch of libraries'. > Mirroring https://twitter.com/shanselman/status/1288698620804362240?s=20 : > Racket = .Net (The Ecosystem) > bc/cs = JVM, CLR > racket/base, racket/gui, typed/racket, datalog & others = Languages > https://pkgs.racket-lang.org > = npm, maven, etc > > raco > = dotnet cli - your entry point, SDK, driver, javac, go, etc > > raco from-template = create-react-app, dotnet new - templates > raco exe > = dotnet run - dev time compile and run > > raco distribute = dotnet publish - ready up for deploy > > Kind regards, > > Stephen > > > On Thu, Aug 20, 2020 at 11:17 AM Laurent wrote: > Stephen's work may still be quite useful, as it provides a set of really > minimal (almost?) working examples that explain the specifics of various > tools. > > I say keep it up, Stephen! > > On Thu, Aug 20, 2020 at 5:33 AM Alex Harsanyi wrote: > I am not sure that a template in the style of "dotnet new" is directly > applicable for Racket -- the .Net framework is, well a framework. which is a > library that expects the users to structure their own programs in certain > ways. The templates fill the need of setting up the boilerplate code for > different kind of applications as required by the .Net framework. Racket > applications don't need large amounts of "setup code", most of the code is > very specific to the application itself, so not sure what a template would > contain apart from very basic things. > > I think Racket would benefit by a suite of applications which are small but > not trivial and with a source code which is commented in more detail than a > regular application. I attempted to do this with my blog posts, some of > which describe more-or-less complete applications (most of them games). The > entire source code is in a single file which can be run directly and is > available as a GitHub Gist linked from the blog posts. > > Here are some examples: > > * ishido game (936 lines): > https://gist.github.com/alex-hhh/2e204b3a9d9d7094f65a0b585d0b7480 > * tetris game (893 lines): > https://gist.github.com/alex-hhh/2233aee39852f4e0aead4af4cafb40d5 > * chess board (893 lines): > https://gist.github.com/alex-hhh/4817c4
Re: [racket-users] GUI zoom and normal-control-font
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
> > 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
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
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
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.
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
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?
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
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
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
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
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"
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] Important message about meet up on 9 April (Racket London)
Stephen, All, I think that is likely to be right. For now, I’ve kept my room booking but if the Turing or the British Library close, I will let you know. James > On 13 Mar 2020, at 21:39, Stephen De Gabrielle > wrote: > > Hi All, > > While I haven't yet, I'm expecting it will be appropriate to cancel the meet > up on 9 April. > > Now the good news: I'm planning an 'After Work' Racket London Picnic Tuesday > 16 June in Kensington Gardens > > Probably start at 5pm sunset is around 9:20pm > > Stephen > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/racket-users/CAGHj7-%2B63RS4Bb2eFVYYbNWs-DeHzWxf45GQB%2Bh3JTzYa8BoFA%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/493D593C-05D1-4305-8056-81C2B55A4439%40gmail.com.
Re: [racket-users] Stack overflow developer survey
> 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
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] racket meet-up in London ?
That sounds a great idea, I am interested. For numbers less than about 10, if it helps, I can get a meeting room in the Turing Institute (though I’m also happy to try a coffee shop, not that I have any good suggestions). James > On 24 Feb 2020, at 21:41, Stephen De Gabrielle > wrote: > > Proposed date: Thursday 9th April 1-2pm, > - probably at a cafe near St Pancras station. (suggestions appreciated?) > > Please let me know if you are interested, even if you can’t confirm > attendance. I’ll take the afternoon out of my holiday leave so I can get > there. > > (If the numbers get too big and I need to book a meeting room I think the > best I can get is an hour at kingscross.impacthub.net for £5.70 pp) > > It will be casual introductions and chat, though if someone wants to do a > short talk or demo that would be most welcome. > > Kind regards, > > Stephen > > > On Sun, 23 Feb 2020 at 20:56, Stephen De Gabrielle > wrote: > Is anyone up for another racket meet-up in London ? > > Need to work out a time and place to meet. > > Kind regards > > Stephen > > > -- > > -- > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/racket-users/CAGHj7-Ly6gn-_m5cMHrN%3DeCt_k_m1-f04MBWijrJi7LJsge%2B8A%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/6656AD88-B8A7-4E6D-8BDA-9F02E8F84A50%40gmail.com.
Re: [racket-users] keyboard shortcuts in a popup menu
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
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?
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
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
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
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)
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)
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)
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
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
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
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
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
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?
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] Directory-specific installation of packages?
Alex, many thanks for the suggestions. I feel I’m putting too many obstacles in the way. (On the other hand, perhaps my situation is not so unusual.) I’m trying to make something work with as few barriers as possible, both for experienced (but non-Racket!) developers, and for Mac users who are still unsure about the command-line. > You can always create an executable (using "raco exe") and a distribution > (using "raco dist") which packs all dependencies in a single directory. This indeed was my original plan. But I worried about updates: `brew update` (or `raco pkg update`) are straightforward enough that people won’t balk. I think I can persuade people to do a one-off manual install process, but probably not repeated ones. In fact, as a first attempt I used homebrew to distribute an executable produced by `raco dist`. But to do this one has to go against the spirit of homebrew; and it’s therefore a pain to arrange. > You could also provide a small shell script to update the PATH, which users > will have to run once for installation (I believe MacOS stores environment > variables in a plist?) In the end, I went with the “please copy this shell command into a terminal” approach to have users set the PATH. Under MacOS, at least one mechanism to set the path is to create a file under /etc/paths.d/ whose contents are the required paths, so that’s what I did. (Paths set in one's bash config aren’t picked up by Mac GUI applications, not that that matters particularly in this case.) The only downside here is that the user needs to sudo the command. As I say, perhaps I’m just making up ad hoc objections, in which case I apologise. I’m reasonably happy with where I’ve ended up, though I remain hopeful that a more universal package manager will someday arise, perhaps along the lines of Nix (or Guix). Many thanks again, 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/171A1141-3D94-43ED-93FC-722E4105CDD6%40gmail.com.
Re: [racket-users] Directory-specific installation of packages?
Tom, Stephen, Many thanks for the advice. In the end, I gave up on a single homebrew-able install. I could not find a way to have homebrew manage an app I created in Racket. During the homebrew-controlled installation process, Racket’s package manager tries to download other Racket packages; and that fails because, as Tom noted, Racket’s package manger needs to write to somewhere that homebrew won’t let it. Stephen, I think bottles are indeed the way to go — but homebrew will only make a bottle if you can in principle compile from source. I initially tried a version of your other suggestion: I made a distributable executable and then lied to homebrew and told it this was “source code”. But I felt bad about it! My workaround is to tell my colleagues to use homebrew to install Racket; then use `raco pkg` to install the app; and to specify `(define racket-launcher-names …)` in the info.rkt file to make an executable. It’s a workaround because it requires an additional step beyond this: the default location for such executables is not typically in one’s PATH, so my users have to set the PATH. For most of them that’s fine, but for some it’s not great. In general, I now have the sense that there are OS-specific package managers, and there are language-specific package managers, and they do not play nicely with each other. Racket has such a great cross-platform story; it would be nice to have a good “distribute your own apps” story. (On the question of uptake of different languages, I wonder whether part of Excel’s appeal might be that it supports a model in which technically sophisticated “spreadsheet developers" can make spreadsheets for “spreadsheet users”, and then distribution is straightforward; and this is a space that most programming languages have not yet colonised.) Many thanks again, James > On 23 Jul 2019, at 08:43, Tom Gillespie wrote: > > I have periodically investigated installing racket packages via gentoo in a > dev-racket/package way that matches how python packages are installed (a far > saner experience than any of python's native packaging tools). I always hit > roadblocks because raco wants to hit an sqlite database that is outside the > build sandbox. I usually attempt to do this via raco, but perhaps there are > other ways, which might apply in this case as well. If your colleagues just > need the compiled program and do not need the underlying code, why not use > raco exe and distribute the standalone binary? Best, > Tom > > On Tue, Jul 23, 2019 at 12:17 AM Stephen De Gabrielle > wrote: > Hi James > > Did you have any luck with using homebrew to package and distribute your > Racket program? > > I thought Bottles might be the way to go but I’m not sure: > https://docs.brew.sh/Bottles > > I have two ideas > a) add installing racket from homebrew to a bash script that launches your > prog > b) using the create executable function in DrRacket (or raco) to build a > stand-alone version that can be modified to distribute via homebrew > > Kind regards > > Stephen > > PS I think this is a great idea that I’m sure others will use. > > On Mon, 22 Jul 2019 at 14:05, James Geddes wrote: > Dear All, > > For reasons (explained below, possibly foolish reasons) I am trying to do the > following: > > 1. Have `raco pkg install` install a package X to a specific directory, > including, in the same directory, all of the dependencies of X, but excluding > those dependencies that are already present in the current installation's > collections; and > > 2. Have `raco exe myprok.rkt` look in that custom directory for `(require X)`? > > I tried the `--scope-dir` option to `raco pkg install` but that installed > what looks like the entire racket standard library (see below). > > Many thanks, > > James > > > > PS. What I'm /really/ trying to do is distribute a little command-line > programme that I wrote in Racket to my colleagues using the homebrew package > manager. My programme depends on the gregor library. > > Most of my colleagues don't have Racket. Homebrew likes to compile from > source, so I will need to have homebrew download the dependencies I need for > compilation. But now, homebrew really doesn't like you to write outside a > very small set of directories during the installation process, and those > don't appear to include the standard Racket collections directories. > > (I could well have misunderstood this. I don't understand at all how homebrew > interacts with language-specific package managers like raco, pip, cabal, and > so on. My sense is that the non-raco ones install dependencies in > project-specific directories and I suspect homebrew has specific suppor
Re: [racket-users] Re: Gui editable grid/table
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.
[racket-users] Directory-specific installation of packages?
Dear All, For reasons (explained below, possibly foolish reasons) I am trying to do the following: 1. Have `raco pkg install` install a package X to a specific directory, including, in the same directory, all of the dependencies of X, but excluding those dependencies that are already present in the current installation's collections; and 2. Have `raco exe myprok.rkt` look in that custom directory for `(require X)`? I tried the `--scope-dir` option to `raco pkg install` but that installed what looks like the entire racket standard library (see below). Many thanks, James PS. What I'm /really/ trying to do is distribute a little command-line programme that I wrote in Racket to my colleagues using the homebrew package manager. My programme depends on the gregor library. Most of my colleagues don't have Racket. Homebrew likes to compile from source, so I will need to have homebrew download the dependencies I need for compilation. But now, homebrew really doesn't like you to write outside a very small set of directories during the installation process, and those don't appear to include the standard Racket collections directories. (I could well have misunderstood this. I don't understand at all how homebrew interacts with language-specific package managers like raco, pip, cabal, and so on. My sense is that the non-raco ones install dependencies in project-specific directories and I suspect homebrew has specific support for Python libraries.) Anyway, my program depends on the gregor library, so I tried this: $ raco pkg install --scope-dir tmp gregor-lib $ ls tmp 2d-lib pict-doc at-exp-lib pict-lib base pict-snip-lib cext-lib pkgs.rktd class-iop-lib plai-lib cldr-bcp47 planet-doc : [ ~100 rows omitted] : net-docweb-server-doc net-libweb-server-lib option-contract-libwxme-lib parser-tools-doc xrepl parser-tools-lib xrepl-doc pconvert-lib xrepl-lib pict zo-lib -- 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/2C6D9102-2F63-4A0E-A033-C7FECC5F9CF8%40gmail.com.
Re: [racket-users] The case, and a proposal, for elegant syntax in #lang racket2
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.
Re: [racket-users] Impromptu racket meetup in London Friday, 19 July at 12pm-3pm
Given that I work inside the Library building, I will try to drop by! (I also have a Racket sticker on my laptop. Will be there around 12:30.) James > On 12 Jul 2019, at 16:20, Stephen De Gabrielle > wrote: > > Hi, > > Next Friday, 19 July at 12pm-3pm there will be an impromptu Racket meetup at > the cafe at the British Library 'The Last Word'. > https://goo.gl/maps/M62e4b9JK7c1oaA69 > > No agenda. All welcome. Spread the word! > > I'll be drinking tea, eating cake(I hope), and will be easily identified as a > the man with racket logo on his laptop. Updates on this thread. > > Stephen > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/racket-users/CAGHj7-%2BygW4HZEstkv-xBCsdb0eaxro8DR9QWzpkSciPbNzvhw%40mail.gmail.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/831ED46F-E64A-4C0A-AAB3-C6BDD1B4A741%40gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: Re: [racket-users] Thinking in scheme / racket
Dear Bob, My sense is that there are, perhaps, two questions: first, what's the advantage of Racket when faced with a "prosaic computational task where ... my brain defaults to writing in something like C"?; and second, how to advocate for Racket when Python (appears to be) "quite a bit faster". I’m interested in both of these because I am trying to understand where my colleagues are coming from (and possibly changing their minds). On the first question, this discussion has perhaps produced four different versions of the prime-counting program: 1. Python (using a for-loop); 2. Racket (using accumulator-passing style); 3. Racket (using a for-loop); 4. Racket (using map/filter). (Actually, I can’t find an example of (4) in the email chain, but there’s one at the bottom of this email.) It’s certainly been educational for me to see all four. On reflection, do you still have the sense that (1) is the “most natural”? On the second question, let me report some rough-and-ready timings on my machine for counting the number of primes of the form 2^n + 3 for n < 1000 (the code is at the end of the email): Python: 265 ms Racket (filter/map version): 760 ms Racket (for loop version): 670 ms. My own feeling is that /for this particular application/, there's just not that much difference. I strongly suspect that all of the difference comes from the implementation of the primality testing functions. It turns out that, for sufficiently large numbers, both sympy and math/number-theory actually check for pseudoprimality. So there may be implementation-dependent details (which I don't understand) that are different, such as the probability that a composite number is incorrectly identified as a prime. Indeed, maybe the answer to your second question is that, I rather suspect, Racket is quite a bit faster than Python, so one could reasonably turn the question around. I implemented a cheap-and-cheerful, deterministic primality test (from Wikipedia, code again at the end of the email). I’m pretty sure I’ve written essentially identical code in Python and Racket: Python using `while` and mutation; Racket using `for/and`. Here are the times I get for testing the primality of 2^55 + 3 (which is in fact prime): Python: 7 s Racket: 0.8 s Make of that what you will! Best regards, James === Python, count special primes === import timeit import sympy def count_special_primes(N): count = 0 for n in range(N): if sympy.isprime(2 ** n + 3): count = count + 1 return count print(timeit.timeit('count_special_primes(1000)', globals = globals(), number = 1)) === Racket, count special primes === #lang racket (require math/number-theory) ;; "filter/map" variation ;; Count primes of the form 2^n + 3 for n < N (define (count-special-primes N) (define (f n) (+ (expt 2 n) 3)) (length (filter prime? (map f (range N) (time (count-special-primes 1000)) ;; “for-loop" variation (define (count-special-primes/quicker N) (define (f n) (+ (expt 2 n) 3)) (for/sum ([n (in-range N)]) (if (prime? (f n)) 1 0))) (time (count-special-primes/quicker 1000)) === Python, primality test === Import timeit import math ## Quick and dirty test for primality ## from https://en.wikipedia.org/wiki/Primality_test def is_prime(n): if n <= 3: return (n > 1) elif (n % 2 == 0) or (n % 3 == 0): return False else: k = 5 k_max = int(math.sqrt(n)) + 1 while k < k_max: if (n % k == 0) or (n % (k + 2) == 0): return False k = k + 6 return True print(timeit.timeit('is_prime(2 ** 55 + 3)', globals = globals(), number = 1)) === Racket, primality test === ;; integer? -> integer? ;; Quick-and-dirty test for primality ;; from https://en.wikipedia.org/wiki/Primality_test (define (prime/slow? n) (if (<= n 3) (> n 1) (if (or (= (modulo n 2) 0) (= (modulo n 3) 0)) #f (prime-aux n ;; Test for primality assuming n > 3 and divisible by neither ;; 2 nor 3 (define (prime-aux n) (let ([k-max (ceiling (sqrt n))]) (for/and ([k (in-range 5 n 6)] #:break (> k k-max)) (not (or (= (modulo n k) 0) (= (modulo n (+ k 2)) 0)) (time (prime/slow? (+ 3 (expt 2 55 > On 11 Jul 2019, at 02:36, Bob Heffernan wrote: > > On 19-07-10 02:46, Maciek Godek wrote: >> A while ago, I wrote a booklet which used almost the same problem to >> introduce to, what you called nicely in the title of this thread, "thinking >> in Scheme", so if you're interested, you may want to check out the first >> chapter ("Introduction"): > > Maciek, > > Thank you for your reply. > > I skimmed through your booklet some tim
Re: [racket-users] Re: Thinking in scheme / racket
I am also interested in this problem, because many of my colleagues use Python and "isn't Python faster?" is a common argument. (Albeit one that I think is more of a rationalisation than an reason.) In this case, however, I would not have thought that there's any prima facie reason why the Python version should be faster, even compared to the "filter and map" Racket version. Indeed, I would have thought that the calculation time would be entirely dominated by the test for primality, and especially what happens once the candidate primes are bigger than 2^64 and can no longer be represented by a single word. (One possible explanation might be that the Racket math library is written in Typed Racket; when calling it from untyped Racket, there is some type checking using contracts -- it's possible, I suppose, that this is causing a performance penalty.) I am going to investigate but if anyone knows more than me I'd appreciate thoughts. Regards, James > On 11 Jul 2019, at 02:36, Bob Heffernan wrote: > > On 19-07-10 02:46, Maciek Godek wrote: >> A while ago, I wrote a booklet which used almost the same problem to >> introduce to, what you called nicely in the title of this thread, "thinking >> in Scheme", so if you're interested, you may want to check out the first >> chapter ("Introduction"): > > Maciek, > > Thank you for your reply. > > I skimmed through your booklet some time ago. (I too dislike the R > language, although some attempts have been made in recent years to make > it less awful). I read through the introduction again this morning and > enjoyed it. > > The reason I like racket (and scheme-like languages in general) is that > they encourage the style of programming you are advocating (I think) > where the program is expressive and can be read and appreciated by > humans. In theory, my favourite style of programming is one that is > elegant and readable by humans. > > My original email had to do with the problem of when this comes into > conflict with a prosaic computational task where my main aim is simply > to get the job done efficiently and my brain defaults to writing the > program in something like C. > > For instance, another way of writing something like my original program > might be something like: > > (define (f n) (- (expt 2 n) 3)) > (define (good? n) (and (positive? n) (prime? n))) > (length (filter good? (map f (range 1 100 > > which is, I think, fairly expressive. It is still, however, relatively > inefficient. A python programmer might write something like > > count = 0 > for n in range(1, 1000): >if 2 ** n - 3 >= 0 and isprime(2 ** n - 3): > count += 1 > > print(count) > > and happily report that her program ran quite a bit faster than mine. > > I'm not sure how I'd advocate for Racket (or scheme) in a situation like this. > > Regards, > Bob > > -- > 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/20190711013633.nm2jlznhzwibhsli%40bob-cit. > 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/627E56DD-D629-48D8-BF65-714D1F906AFE%40gmail.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] HTML rendering
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
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
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
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
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: Distributing executables with homebrew
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.
[racket-users] Distributing executables with homebrew
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/95915948-B101-4697-929E-3F68FBB8BA8F%40gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Typed Racket segmentation fault
This is very helpful, thank you. In fact, my "naive" version (in untyped Racket) was about the same speed as my colleague's naive Python version. Switching to fl+, fl-, etc bought me a 10x improvement (I presume from the JIT compiler avoiding boxing and unboxing?). Annoyingly, my colleague had got the same speedup by using Numpy, but that does require a change to the way one arranges the calculation (and the change is unnatural, to my eye). Simply switching to Racket on Chez improved the naive version by a factor of 5x, which was very nice to see. However, I'm now unsure how to continue. How should I think about making speed improvements? There are flvectors, for example: under what circumstances would these help? Should I expect more gains from TR above this, or do the gains only come from TR figuring out that it can use fl+ rather than me doing so? Many thanks again, James > On 5 Jun 2019, at 17:08, Philip McGrath wrote: > > In case it's helpful as a workaround, changing the #lang line to: > #lang typed/racket #:no-optimize > will disable the type-based optimizations, so the problematic > `unsafe-make-flrectangular` isn't introduced and the segfault is avoided. You > presumably loose some performance, though, and "use this flag to work around > a compiler bug" may not be the first example you want to show your > colleagues—but, even without the type-based optimizations, Racket is probably > still faster than Python. > > In case it's helpful for your colleagues, someone recently brought up this > direct comparison of speed benchmarks for Racket and Python 3: > https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/racket-python3.html > > -Philip > > > On Wed, Jun 5, 2019 at 11:46 AM Matthew Flatt wrote: > I had just reached the same conclusion. Specifically, it looks like a > missing runstack sync in the JIT-inlined `unsafe-make-flrectangular`. > > Thanks! > > At Wed, 5 Jun 2019 11:40:41 -0400, Sam Tobin-Hochstadt wrote: > > I think this is a miscompilation of `unsafe-make-flrectangular` by the > > underlying Racket compiler. > > The below program is a plain racket version of the code, with just one > > use of unsafe, a call to `unsafe-make-flrectangular`. If that's > > replaced with `make-flrectangular`, then the program works propetly. > > Furthermore, if we add a print statement that requires the argument to > > `unsafe-make-flrectangular`, then the program also works correctly. > > The program also works correctly with the JIT off, and under RacketCS. > > https://gist.github.com/samth/683042c4754c1c5ce284794b19dd37e3 > > > > On Wed, Jun 5, 2019 at 11:02 AM 'Paulo Matos' via Racket Users > > wrote: > > > > > > > > > On 05/06/2019 16:47, Philip McGrath wrote: > > > > What version of Racket are you using? I get a segfault in 7.2, but 7.3 > > > > works for me. > > > > > > I see the segfault in 7.1 but not in 7.2 or 7.3. Then I run it under > > > valgrind and I see it in all the versions. :) > > > It's there, but sometimes hiding. > > > > > > Will take a look. > > > > > > > -Philip > > > > > > > > > > > > On Wed, Jun 5, 2019 at 10:42 AM James Geddes > > > <mailto:james.ged...@gmail.com>> wrote: > > > > > > > > Dear All, > > > > > > > > The following Typed Racket program is intended to produce an image > > > > of the Mandelbrot set (but it doesn't bother actually displaying the > > > > image). > > > > > > > > Running the program using command-line Racket causes a crash. > > > > Specifically, Racket terminates with the error message: > > > > > > > > Segmentation fault: 11 > > > > > > > > However, > > > > > > > > 1. The program runs successfully in DrRacket; > > > > > > > > 2. Reducing the size of the image to, say, 200 x 200 (by changing > > > > the last arguments in the calls to `make-ticks`) also results in > > > > successful termination, without a segmentation fault. > > > > > > > > Any advice appreciated! > > > > > > > > (PS: I'm not actually that interested in making pictures. I'm trying > > > > to do some speed benchmarks to show my colleagues, particularly > > > > those who argue that Python is faster, and this example happened to > > > > be on hand.) > > >
Re: [racket-users] Typed Racket segmentation fault
I'm using version 7.3, amusingly. James > On 5 Jun 2019, at 15:47, Philip McGrath wrote: > > What version of Racket are you using? I get a segfault in 7.2, but 7.3 works > for me. > -Philip > > > On Wed, Jun 5, 2019 at 10:42 AM James Geddes wrote: > Dear All, > > The following Typed Racket program is intended to produce an image of the > Mandelbrot set (but it doesn't bother actually displaying the image). > > Running the program using command-line Racket causes a crash. Specifically, > Racket terminates with the error message: > > Segmentation fault: 11 > > However, > > 1. The program runs successfully in DrRacket; > > 2. Reducing the size of the image to, say, 200 x 200 (by changing the last > arguments in the calls to `make-ticks`) also results in successful > termination, without a segmentation fault. > > Any advice appreciated! > > (PS: I'm not actually that interested in making pictures. I'm trying to do > some speed benchmarks to show my colleagues, particularly those who argue > that Python is faster, and this example happened to be on hand.) > > > James > > > > > #lang typed/racket > > ;; Generate an image of the Mandelbrot set > (https://en.wikipedia.org/wiki/Mandelbrot_set) > > (define *iteration-limit* : Integer 50) > > (: mandel (-> Float-Complex Integer)) > ;; Given c, iterate z <- z^2 + c starting from z = 0 until either |z| > 2 or > the number of iterations > ;; exceeds *iteration-limit*. Returns the number of iterations required. > (define (mandel c) > (let mandel-iter ([z 0.0+0.0i] > [i 0]) > (if (or (>= i *iteration-limit*) (> (magnitude z) 2.0)) > i > (mandel-iter (+ c (sqr z)) (+ i 1) > > (: brot ((Listof Float) (Listof Float) -> (Listof Integer))) > ;; Apply mandel to a rectangular grid of complex numbers > (define (brot xs ys) > (for*/list : [Listof Integer] > ([y (in-list ys)] >[x (in-list xs)]) > (mandel (make-rectangular x y > > (: make-ticks (-> Float Float Integer (Listof Float))) > (define (make-ticks min max resolution) > (range min max (/ (- max min) resolution))) > > (define *xs* (make-ticks -1.5 0.5 300)) > (define *ys* (make-ticks -1.0 1.0 300)) > > ;; Compute a Mandelbrot image (but then discard it) > (void (brot *xs* *ys*)) > > > > > -- > 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/194F0EE9-0B9E-412B-A2C0-BCE51CD0AA75%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/831D8880-1BBD-4EE2-B112-61BD8E6A1020%40gmail.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Typed Racket segmentation fault
Dear All, The following Typed Racket program is intended to produce an image of the Mandelbrot set (but it doesn't bother actually displaying the image). Running the program using command-line Racket causes a crash. Specifically, Racket terminates with the error message: Segmentation fault: 11 However, 1. The program runs successfully in DrRacket; 2. Reducing the size of the image to, say, 200 x 200 (by changing the last arguments in the calls to `make-ticks`) also results in successful termination, without a segmentation fault. Any advice appreciated! (PS: I'm not actually that interested in making pictures. I'm trying to do some speed benchmarks to show my colleagues, particularly those who argue that Python is faster, and this example happened to be on hand.) James #lang typed/racket ;; Generate an image of the Mandelbrot set (https://en.wikipedia.org/wiki/Mandelbrot_set) (define *iteration-limit* : Integer 50) (: mandel (-> Float-Complex Integer)) ;; Given c, iterate z <- z^2 + c starting from z = 0 until either |z| > 2 or the number of iterations ;; exceeds *iteration-limit*. Returns the number of iterations required. (define (mandel c) (let mandel-iter ([z 0.0+0.0i] [i 0]) (if (or (>= i *iteration-limit*) (> (magnitude z) 2.0)) i (mandel-iter (+ c (sqr z)) (+ i 1) (: brot ((Listof Float) (Listof Float) -> (Listof Integer))) ;; Apply mandel to a rectangular grid of complex numbers (define (brot xs ys) (for*/list : [Listof Integer] ([y (in-list ys)] [x (in-list xs)]) (mandel (make-rectangular x y (: make-ticks (-> Float Float Integer (Listof Float))) (define (make-ticks min max resolution) (range min max (/ (- max min) resolution))) (define *xs* (make-ticks -1.5 0.5 300)) (define *ys* (make-ticks -1.0 1.0 300)) ;; Compute a Mandelbrot image (but then discard it) (void (brot *xs* *ys*)) -- 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/194F0EE9-0B9E-412B-A2C0-BCE51CD0AA75%40gmail.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Unexpected error in output of :print-type
Dear All, The following output from Typed Racket is unexpected -- to me! -- can someone confirm whether I should have expected it or that it's (perhaps) a bug or known limitation? > % racket -I typed/racket > > Welcome to Racket v7.3. > > > (for/vector ([i (in-range 5)]) i) > - : (Vectorof Any) [more precisely: (Mutable-Vectorof Any)] > '#(0 1 2 3 4) > > > (:print-type (for/vector ([i (in-range 5)]) i)) > ; /Applications/Racket > ; v7.3/share/pkgs/typed-racket-lib/typed-racket/base-env/prims.rkt:854:36: > ; Type Checker: type mismatch; > ; mutation only allowed with compatible types > ; expected: Zero > ; given: Positive-Byte > ; in: (set! n new-n) > ; [,bt for context] > > > (For what it's worth, I'm on macOS 10.14.5.) The reason I did this at all was that I'm getting a segmentation fault in my Typed Racket program (but only when run via `racket` or from Emacs racket-mode, not when run in DrRacket). However, I'm struggling to get a minimal reproducible example that I can share and in trying to do so I ran into this one. (I will keep trying, however.) 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/BAAD082B-539C-4BBF-B1C9-956F93A07649%40gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Re: Racket development on ARM
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
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
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
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
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
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
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
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
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
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
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
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.
[racket-users] Guide and reference
Dear All, There was a recent discussion on this list about the Racket guides and manuals. Without wishing to comment on the suggestions therein, I did want to say what I really, really like about the Racket documentation. There are two things. The first is that the Reference is — and I know this sounds odd — true: when I want to know something, I look it up in the Reference, and there I find the truth and the whole truth about the thing. I don’t know how this is made to happen, but I find it extraordinarily helpful. It’s not an intuitive explanation, or an analogy, or a description in vague language: it’s the truth. (And it’s organised very well so I know where to look.) The second thing I like is the concision of the Guide. It is readable, and may well contain intuitive explanations and ways to think about things, yet it does so with economy. There are of course things I am still confused about (packages…) but in general I’ve not found elsewhere this tasteful combination of clarity and completeness. (Well, except RnRS, so maybe my prejudices are showing through.) I find other languages point me to books about the language that take too long to get a handle on the basics; and exhaustive references that seem to contain both more than I want and less than I need. Thank you to everyone who has worked on the documentation. James James Geddes -- 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?
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?
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
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
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
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
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?
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.
[racket-users] handin-server submissions
Hi, everyone I'm currently in charge of a handin-server instance for a course at my university. We're currently experiencing issues where students are unable to handin their work, receiving this error message: login error: user (STUDENT_USERNAME) not in assignment/section lab-01 I think I've configured config.rktd correctly, with "lab-01" being in the correct active-dirs s-expression. Does anyone have an idea of what's going on? I'd be happy to share my config.rktd file. 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. For more options, visit https://groups.google.com/d/optout.