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

2020-08-20 Thread James Platt


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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/1F4FEE9B-83AD-4E10-A850-4341F0AA935D%40biomantica.com.


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

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

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

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


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/08CD0FAF-AFCD-4B43-87C4-422C79AA2361%40biomantica.com.


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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/62C9C1F2-D9D7-4EE2-92AC-1E222428C974%40biomantica.com.


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

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


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


#lang racket

(require racket/gui)

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


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

(send frame show #t)

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/0B543D4F-7928-41CF-963C-E46858C93824%40biomantica.com.


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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87B3E760-332A-4D45-8D1F-0CE9180A2138%40biomantica.com.


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

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

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


[racket-users] Interpreting Racket profile stats

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

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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/859F6F04-1AA7-4BB0-9A88-31C39C9F3D4A%40biomantica.com.


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

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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/0BB22130-12D1-4FF3-9BB1-A79A595E8AF6%40biomantica.com.


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

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

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

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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/55F53C1D-57FB-4EEF-94FB-AC41AC5A2DBD%40biomantica.com.


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

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

James


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

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

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

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


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

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

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


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

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

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

James


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

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

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

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


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

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

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

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

(send frame3 show #t)

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


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


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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/1FEB4FDC-4008-46A7-89E3-29C71C3A6D3A%40biomantica.com.


Re: [racket-users] Stack overflow developer survey

2020-03-09 Thread James Platt


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

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

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


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

2020-02-27 Thread James Platt


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

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

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

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


James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/46BF6E5F-A613-4FF5-9C9B-C1526B31B54A%40biomantica.com.


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

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


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

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

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


[racket-users] keyboard shortcuts in a popup menu

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

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

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

James

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/3926FF2E-DCAB-421D-8EE3-7B4DF5671033%40biomantica.com.


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

2020-01-06 Thread James Platt


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

> No Yosemite users to be found?

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

James

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


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

2019-12-10 Thread James Platt


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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/EDDD1A40-9C10-4F2B-8A07-6933784C5C41%40biomantica.com.


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

2019-12-10 Thread James Platt


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

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

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

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


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

2019-12-03 Thread James Platt


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

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

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

> 
> Long live 10-year-old Macs

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/1934E9FC-CE39-4C4E-BF3A-0DC37DBA2509%40biomantica.com.


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

2019-12-03 Thread James Platt


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

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

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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/D5A56D93-963F-412D-9CA6-7DE3A17F6148%40biomantica.com.


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

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

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

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

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

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

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

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

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

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

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


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

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

2019-11-21 Thread James Platt


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

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

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

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

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

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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/934E0BEE-5840-4596-975F-410C3770DBA6%40biomantica.com.


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

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

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

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


James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/856973E6-6074-4A1F-8DEA-A4302F893D5F%40biomantica.com.


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

2019-11-15 Thread James Platt


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

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


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

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

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


[racket-users] DTLS

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

James

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


Re: [racket-users] running the wrong sqlite3

2019-08-20 Thread James Platt


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

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

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

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


[racket-users] running the wrong sqlite3

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


Here's the full error message.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/C399A6BF-6FDE-49AD-9053-08F0F3FBD49A%40biomantica.com.


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

2019-08-06 Thread James Platt


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

> How can a UDP socket survive process exit?
> 

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


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


James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/7EED97D1-B5AF-4DDF-A5D0-5E47314B04DF%40biomantica.com.


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

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

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

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

> https://pkgs.racket-lang.org/package/multicolumn
> 
> суббота, 20 июля 2019 г., 8:17:58 UTC+5 пользователь Raoul Schorer написал:
> Hi,
> I am trying to make a gui editable table. Is that possible in racket/gui?
> 
> It seems list-box% is not editable by default. Apparently, one can't stick 
> editors as list-box% choices either.
> 
> Can you please help?
> 
> Thanks!
> Raoul
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/d827b9f5-7a58-4b77-927f-b1122a8885c7%40googlegroups.com.

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


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

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

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

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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/4AB42B7E-DF83-4CF8-A14A-F92C2259B3DC%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] HTML rendering

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

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

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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/99A41261-8EF1-47FA-9626-5E749E22BCA7%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] RacketCon hotel group rate

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

James


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

> If you're attending just RacketCon, there are still some group-rate
> rooms available at the Little America Hotel --- but you'll need to act
> fast. Our guaranteed group reservation has expired, but they'll
> continue to accept group reservations as long as space remains.
> 
> See
> 
>  https://con.racket-lang.org/
> 
> for more information.
> 
> At Fri, 14 Jun 2019 08:31:30 -0400, Jay McCarthy wrote:
>> Racket Week is less than a month away! The dorm housing signup for the
>> workshops is closing soon. You'll have until 06/21 to register for it.
>> 
>> https://school.racket-lang.org/#housing
>> 
>> The details are at the link, but in summary, it's $40/night at the
>> University of Utah dorms.
>> 
>> Jay
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/5d03f81c.1c69fb81.eba49.412cSMTPIN_ADDED_MISSING%40gmr-mx.google.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/0F46524A-2E60-48F5-B013-67571DA16812%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-06-11 Thread James Platt


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

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

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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/BEA1A70C-69B1-44CC-ACA8-7A18992054EB%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Enabling/disabling menu items

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

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

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

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

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

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

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

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

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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/6545DE0C-5B87-4C62-AF28-3C2C5A201627%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


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

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


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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/11F780AE-BB3E-463D-8839-B848891DB633%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-05-15 Thread James Platt


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

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

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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/8A2F6E8F-C536-4A0E-9E00-76C6BF92DBA1%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Racket development on ARM

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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/EFD784F4-F109-4234-9D4F-12ECF1B56D20%40biomantica.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-03-25 Thread James Platt


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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-03-25 Thread James Platt


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

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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-03-25 Thread James Platt


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

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

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


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

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


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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Error handling for the GUI

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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Autocomplete from a list

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

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

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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] delays in message delivery

2019-02-08 Thread James Platt


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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] delays in message delivery

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

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

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

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


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-01-29 Thread James Platt


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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

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

James  

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Upgrading Racket

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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Upgrading Racket

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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Upgrading Racket

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

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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Jewel is Jewelbox?

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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

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


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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Contract work

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

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

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

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

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


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

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

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

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

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

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

cryptocurrency, especially the Etherium Virtual Machine.

Fountain codes.

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

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

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

Did I mention information security?

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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-03-23 Thread James Platt

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

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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-03-23 Thread James Platt

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

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

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

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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-03-05 Thread James Platt

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

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


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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Sorting a list-box%

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

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

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

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

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

James

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.