[racket-users] Re: Best to ask here or on Stackoverflow from a language promotion perspective?

2015-12-09 Thread Alex Harsanyi
On Thursday, December 10, 2015 at 2:33:32 AM UTC+8, Matthew Butterick wrote: > Here's one good way to promote the language: > > 1) Make something impressive with Racket. Not the original poster, but does this count? https://github.com/alex-hhh/ActivityLog2 it is a fitness tracker for

[racket-users] Re: Best to ask here or on Stackoverflow from a language promotion perspective?

2015-12-09 Thread Alex Harsanyi
On Thursday, December 10, 2015 at 9:01:24 AM UTC+8, Emmanuel Oga wrote: > On Wednesday, December 9, 2015 at 3:32:24 PM UTC-8, Alex Harsanyi wrote: > > On Thursday, December 10, 2015 at 2:33:32 AM UTC+8, Matthew Butterick wrote: > > > > > Here's one good way to promote the

[racket-users] Re: trying to use dump-memory-stats

2016-06-02 Thread Alex Harsanyi
I'd like to add that the 32bit version of Racket 6.5 works fine and displays actual numbers. It seems that this would be a bug in the 64 bit version? Alex. On Thursday, June 2, 2016 at 8:24:42 PM UTC+8, Alex Harsanyi wrote: > I'm trying to use dump-memory-stats to find out where my applicat

[racket-users] trying to use dump-memory-stats

2016-06-02 Thread Alex Harsanyi
I'm trying to use dump-memory-stats to find out where my application uses its memory, unfortunately, it does not seem to print out any usefull info. When calling it with no arguments I get the value "???64d" for everything: Begin Dump Begin Racket3m :???64d???64d :

Re: [racket-users] Re: Racket 6.4 very slow

2016-03-02 Thread Alex Harsanyi
I have the same problem with Racket 6.4 64Bit Windows (running on Windows 7): > (time (total 10)) cpu time: 85520 real time: 88070 gc time: 204 BTW, my "Choose Language" dialog box (Ctrl+L) has the following selected: * Debugging * Populate "compiled directories" * Preserve

Re: [racket-users] Racket 6.4 very slow

2016-03-02 Thread Alex Harsanyi
ebug" disabled, "Preserve stack trace" enabled -> 4.5 seconds * "Debug" and "Preserve stack trace" disabled -> 3.6 seconds. > > > On Mar 2, 2016, at 8:21 PM, Alex Harsanyi <alexharsa...@gmail.com> wrote: > > > > I have the

Re: [racket-users] Racket internal error when trying to create an executable

2016-04-03 Thread Alex Harsanyi
On Saturday, April 2, 2016 at 9:03:30 PM UTC+8, Robby Findler wrote: > After you make the changes, run "raco setup" from the command line and just > wait. Everything should be good after that. (No need to delete anything.) Thanks, Robby, this worked. Alex. -- You received this message because

[racket-users] Racket internal error when trying to create an executable

2016-03-31 Thread Alex Harsanyi
Hi, I'm getting an error when trying to create an executable for a program that uses the math/statistics module. The simplest example that reproduces the issue is: #lang racket (require math/statistics) (let* ([s empty-statistics] [s (update-statistics s 1)] [s

Re: [racket-users] Racket internal error when trying to create an executable

2016-04-02 Thread Alex Harsanyi
Hi Matthew, Thanks for the quick reply. I will try a snapshot build of Racket in a few days. Unfortunately, if I just make the changes you suggested in Racket 6.4 and remove the corresponding .zo and .dep files, I just get linkage errors when I start Racket. However, this is due to my

[racket-users] Re: Racket internal error when trying to create an executable

2016-04-01 Thread Alex Harsanyi
Hi George, The option to create an executable from DrRacket worked fine for me in Racket 6.4 and several prior versions. However, this particular problem also happens when I use `create-embedded-executable' (which ultimately raco exe uses), which is how I build my application. I noticed it

Re: [racket-users] DrRacket 6.5 + OS X El Capitan = slow execution

2016-07-27 Thread Alex Harsanyi
This might be a wild guess, but are you using typed/racket as the language? On my machine (Windows 7, DrRacket 6.6), if I use #lang typed/racket, evaluate it than type "Hello World" in the REPL, it takes about 2 seconds to display the result (after that it seems to run fast). If I just use

[racket-users] Re: Time of hash-ref when the key is (not) found

2016-08-11 Thread Alex Harsanyi
On Friday, August 12, 2016 at 10:09:21 AM UTC+8, gustavo wrote: > I have these strange times in a microbenchmark that compares the time > to run hash-ref when the key is in the hash and when it is not there: > > ;--- > #lang racket/base > (define hash0 #hash((0 . #t))) > (define hash1 #hash((1 .

[racket-users] Re: Writing text% to file

2016-06-27 Thread Alex Harsanyi
On Monday, June 27, 2016 at 3:03:27 PM UTC+8, Normal Loone wrote: > Hello, > > I currently want to write a program that includes writing out stuff written > in the buffer. But I cant seem to write out strings stored in text% properly. > Example: > > (define txt (new text%)) > (send txt insert

[racket-users] Re: Functional object-oriented programming

2017-02-08 Thread Alex Harsanyi
Structures support this style of updating: (struct foo (bar baz) #:transparent) (define one (foo "hello" 1)) ;; Copy all fields from "one" and update baz to 2 (define two (struct-copy foo one (baz 2))) They also have immutable fields by default. Best Regards, Alex. -- You

[racket-users] How to debug segmentation fault in Racket application

2017-02-08 Thread Alex Harsanyi
Occasionally, my Racket application crashes with a segmentation fault (under Windows). The crash is a NULL pointer reference. Unfortunately, having no PDB's the stack trace only contains a list of addresses. Unfortunately, this only happens occasionally, but under the same conditions. It

[racket-users] Re: Can raco distribute produce a single executable?

2017-02-20 Thread Alex Harsanyi
On Tuesday, February 21, 2017 at 3:12:50 AM UTC+8, lu wrote: > Hi all, I have this little toy project[1] to help me learn the language. I > would like to produce a single portable executable that can be executed > without reliance on racket installation. `raco distribute` does produce a >

[racket-users] raco test: 0 tests run, 1 test passed

2017-02-24 Thread Alex Harsanyi
I'm a bit confused about how raco test is reporting the number of tests run, if a test case is defined outside a test suite. If I run the program below: #lang racket (require rackunit) (require rackunit/text-ui) (define my-test-case (test-case "My Test case"

[racket-users] Re: get-file-list filter

2017-02-20 Thread Alex Harsanyi
On Tuesday, February 21, 2017 at 11:52:49 AM UTC+8, Lehi Toskin wrote: > In `get-file-list` there is a filter argument that can be passed to the > function such that when going through a directory it'll only list directories > and those files in the filter (separated by a semicolon). This can

[racket-users] Re: racket-mode causes .emacs file to not load

2017-02-28 Thread Alex Harsanyi
On Wednesday, March 1, 2017 at 5:30:06 AM UTC+8, David K. Storrs wrote: > I'm sending this to the list because I suspect I'm not the only one who will > ever have this issue and the next person should now be able to google for it. > > GNU Emacs 24.5.1 > Darwin MacBook-Pro.lan 15.5.0 Darwin

[racket-users] Re: Scrolling in racket/gui

2017-03-01 Thread Alex Harsanyi
On Thursday, March 2, 2017 at 4:16:47 AM UTC+8, Philip McGrath wrote: > This seems like it should be a simple question, but I can't figure out how to > get a scroll bar in a gui application like this one: > > > #lang racket/gui > (define frame >   (new frame% [label "Example"])) > (for ([letter

Re: [racket-users] Re: Scrolling in racket/gui

2017-03-01 Thread Alex Harsanyi
On Thursday, March 2, 2017 at 10:56:30 AM UTC+8, Philip McGrath wrote: > Almost — thanks! (I'm sure I read over that page of the docs, but I somehow > missed 'vscroll.) > > > The one thing that isn't working is scrolling with the mouse/trackpad. It > seems like I might need to override 

[racket-users] Re: Making a snip% select itself in a text%

2017-03-02 Thread Alex Harsanyi
On Thursday, March 2, 2017 at 7:12:22 PM UTC+8, erich wrote: > Hi! I have a simple non-editable and non-resizable snip% class that in > its draw function distinguishes whether it's selected or not. It works > fine when I select it in a text% with the mouse. > > Now I want to select it in the

[racket-users] Re: Do I need a critical section here ... and if so, how to?

2016-09-01 Thread Alex Harsanyi
How about using channels: #lang racket (define handle-channel (make-channel)) (define (handle-producer ch) (let loop ((counter 1)) (channel-put ch counter) (loop (add1 counter (thread (lambda () (handle-producer handle-channel))) (define (new-handle) (channel-get

[racket-users] Re: List-box% using percentages to resize multiple columns

2016-09-08 Thread Alex Harsanyi
I believe the message means that the width you specify is greater than the max value you also specify. That is, you probably call it as (set-column-width i 715 0 596), which could happen if 'perc' is greater than 100. You can verify that by printing out all the values and checking them.

[racket-users] Re: Trying to understand racket/gui and racket/draw

2016-09-15 Thread Alex Harsanyi
According to the documentation for the canvas<%> interface you cannot rely on the canvas not being cleared (http://docs.racket-lang.org/gui/canvas___.html?q=canvas%3C%25%3E): Even when the canvas’s style suppresses explicit clearing of the canvas, a canvas may be erased by the windowing system

[racket-users] Unnecessary re-draw of plot-snip% objects inside a snip-canvas%

2016-10-05 Thread Alex Harsanyi
Hello I'm using plot-snip% objects in my application to display plots. Data and parameters of these plots needs to change based on GUI input. To do that I updated the snip-canvas% object to allow replacing the snip held in the editor-canvas%. Unfortunately, whenever a new snip is inserted, even

Re: [racket-users] How to add undo functionality to text% editor?

2016-09-20 Thread Alex Harsanyi
, Matthew Flatt wrote: > Use the `set-max-undo-history` method to enable undo history: > > (send m-edit set-max-undo-history 1000) > > > At Tue, 20 Sep 2016 06:24:49 -0700 (PDT), Alex Harsanyi wrote: > > Consider the following example (this is pretty much the code from > &g

Re: [racket-users] How to add undo functionality to text% editor?

2016-09-20 Thread Alex Harsanyi
On Wednesday, September 21, 2016 at 10:42:33 AM UTC+8, Robby Findler wrote: > It is a performance issue and the default saves memory when one creates a lot > of little text% objects.  > > > Maybe we should add something to the docs. Where did you look? The overview section for editors could

[racket-users] How to add undo functionality to text% editor?

2016-09-20 Thread Alex Harsanyi
Consider the following example (this is pretty much the code from http://docs.racket-lang.org/gui/editor-overview.html?q=text%25 except I also added a text-field%): #lang racket/gui (define f (new frame% [label "Simple Edit"] [width 200] [height

[racket-users] Re: Plot ticks with arbitrary strings - breaks DrRacket

2016-10-14 Thread Alex Harsanyi
Your tick format function returns less labels than the number of items in the pre-ticks. It should return one label for each pre-tick object (I just printed out the lengths from the function to find this out.) To fix this, I replaced the format function with (for/list (((t idx)

Re: [racket-users] Re: Plot ticks with arbitrary strings - breaks DrRacket

2016-10-14 Thread Alex Harsanyi
On Saturday, October 15, 2016 at 9:19:20 AM UTC+8, Robby Findler wrote: > Is there a contract we could add somewhere? Well, the contract should be that the number of elements in the output list should be the same as the number of elements in the input list. I'm not sure how that would be

[racket-users] Re: Plot with text annotation inside the graph

2016-10-14 Thread Alex Harsanyi
You could try using a point-label or a function-label with a point size of 0, like this: (plot (list (function-interval sin (lambda (x) 0)) (function-label (lambda (x) (* (sin x) 0.2)) -1.8 "sin(x)" #:point-size 0)) #:x-min -2 #:x-max 2) Alex. On Saturday, October 15, 2016

[racket-users] Re: ANN: with-cache

2016-11-23 Thread Alex Harsanyi
Hi Ben, What types of values can be cached by with-cache? I tried to use it with a data-frame object I use in my application (wanted to check if it is faster to retrieve it from the filesystem than the database), but unfortunately it failed with: ; with-cache: Internal error: failed to make

Re: [racket-users] Searching in data the Racket way...

2016-10-30 Thread Alex Harsanyi
While in terms of O-notation, all linear algorithms are equivalent, the actual time to run a linear algorithm can significantly depend on the actual data structure. In the program below, I calculate the sum of the elements of a vector or list in three ways, all of them linear algorithms. *

Re: [racket-users] How to edit the htdp package from a release?

2016-10-13 Thread Alex Harsanyi
On Thursday, October 13, 2016 at 12:01:44 AM UTC+8, Matthew Flatt wrote: > > In this case, things will work better if you use > > $ bin/raco pkg update --catalog https://pkgs.racket-lang.org htdp I tried to run this command (as I also would like to work on some built in packages), and after

[racket-users] Re: inflate/deflate

2017-01-11 Thread Alex Harsanyi
Perhaps you should use `gunzip-through-ports` which also parses the required header? Alex. On Thursday, January 12, 2017 at 11:23:47 AM UTC+8, Lehi Toskin wrote: > I'm looking at some data that was zlib compressed and I thought I'd inflate > it with file/gunzip's deflate function, but I get

[racket-users] Re: Racket graphics?

2017-01-14 Thread Alex Harsanyi
On Saturday, January 14, 2017 at 12:15:50 PM UTC+8, Lawrence Bottorff wrote: > I've seen Racket graphics doing some basic graphics. How expressive is it? > Could it do diagrams as well as TikZ or gnuplot? What output formats are > there? Could it be like Processing and do 3-d and motion? I

[racket-users] Re: Confused about bitmaps drawing to canvas

2016-12-01 Thread Alex Harsanyi
Without seeing the code, this is just a blind guess, but try "(send canvas refresh)" in the implementation for your "set-bitmap" method. Best Regards, Alex. On Thursday, December 1, 2016 at 4:28:02 PM UTC+8, Hersh Krishna wrote: > So I'm making a frame which draws a bitmap that can be replaced

[racket-users] How to embed version and build date in an application executable?

2017-01-05 Thread Alex Harsanyi
I would like to embed versioning and build date information in my application executable, and I'm not sure how to do that. To clarify, in C or C++, I would write the following: #include #ifndef APPVER #define APPVER "no version" #endif void main() { printf("%s\n",

Re: [racket-users] How to embed version and build date in an application executable?

2017-01-05 Thread Alex Harsanyi
Perhaps I should have clarified this better, but My application is an executable built with "create-embedding-executable", not a package, I'm not sure that the info.rkt can be compiled and packaged inside an exe. I would like to have this information compiled as a .zo file and embedded into

Re: [racket-users] Re: Racket graphics?

2017-01-14 Thread Alex Harsanyi
On Saturday, January 14, 2017 at 10:48:26 PM UTC+8, Lawrence Bottorff wrote: > This is all very impressive, indeed. I was wondering if Racket could be used > to create a new sort of GIS app, i.e., geographic information system. It > would have to do "vector graphics," which is to say every

Re: [racket-users] How to work on a package from a released version of Racket?

2017-04-09 Thread Alex Harsanyi
On Monday, April 10, 2017 at 10:06:35 AM UTC+8, Alex Harsanyi wrote: > > Unfortunately, the above command has resulted only in the plot package being > linked to the repository: > > $ raco pkg show -l > Installation-wide: > Package

Re: [racket-users] How to work on a package from a released version of Racket?

2017-04-09 Thread Alex Harsanyi
On Sunday, April 9, 2017 at 10:52:48 PM UTC+8, Matthew Flatt wrote: > > Meanwhile, I expect that you can repair the installation by deleting > "share/info-cache.rktd" and running `raco setup`. Alternatively, the > snapshot from Utah at > > http://www.cs.utah.edu/plt/snapshots/ > > should also

Re: [racket-users] range with small or zero step doesn't return

2017-04-17 Thread Alex Harsanyi
On Tuesday, April 18, 2017 at 5:15:12 AM UTC+8, Jens Axel Søgaard wrote: > 2017-04-17 22:56 GMT+02:00 Vincent St-Amour : > (For people following along, the issue is that there exists a value `x` > > such that `(= (+ x 1e-17) x)`, and that the iteration reaches that

[racket-users] Re: inspecting a table error 'error 'query: multiple statements given'

2017-04-19 Thread Alex Harsanyi
On Monday, April 17, 2017 at 11:41:59 PM UTC+8, Alexander McLin wrote: > The error message is unclear but I believe SQLite do not support parameters > for PRAGMA statements. I worked extensively with Racket + SQLite and I can attest that the "multiple statements given" message should be

Re: [racket-users] raco test: 0 tests run, 1 test passed

2017-03-02 Thread Alex Harsanyi
On Friday, March 3, 2017 at 7:18:27 AM UTC+8, schuster wrote: > The problem is that a test-case expression runs a test immediately; it does > not return a test object to be run later. In your case, the test runs while > my-test-case is being defined, then no test at all actually runs >

Re: [racket-users] How to store SQL query text outside Racket source code?

2017-08-01 Thread Alex Harsanyi
On Tuesday, August 1, 2017 at 8:45:25 PM UTC+8, david.vanderson wrote: > On 07/31/2017 10:46 PM, Alex Harsanyi wrote: > > Unfortunately, `define-runtime-path` can only be used at top-level, so the > > above code does not compile. It works fine without the > > `define-runt

[racket-users] Re: Racket v6.10

2017-08-15 Thread Alex Harsanyi
On Tuesday, August 1, 2017 at 4:59:14 AM UTC+8, Vincent St-Amour wrote: > Racket version 6.10 is now available from > I just updated to Racket 6.10 on Windows 10 and noticed a bug that causes a crash (access violation). This happens when there is a symbolic link in a `make-directory*` call.

[racket-users] Re: query-exec SQLite3 multiple statements

2017-07-26 Thread Alex Harsanyi
There's a problem with the sqlite interface where "multiple statements given" error is reported for any syntax error. This was fixed only recently. See previous discussion:

[racket-users] Re: Best way to write run-once-and-cache functions?

2017-04-25 Thread Alex Harsanyi
On Wednesday, April 26, 2017 at 12:12:26 PM UTC+8, David K. Storrs wrote: > > I could do it with a parameter but that's only sweeping the above ugliness > under the rug: > > (define conf (make-parameter #f)) > > (define (read-conf) >    (or (conf) > (begin >    (conf

[racket-users] Re: Speeding up graphics / moving away from 2htdp/image

2017-04-25 Thread Alex Harsanyi
On Wednesday, April 26, 2017 at 12:09:54 PM UTC+8, Daniel Prager wrote: > Much as I enjoy making images using 2htdp/image it does get a tad slow as > complexity increases. > > I currently have a program in which I generate images in 2htdp/image and > translate them into bitmap%s per racket/gui

[racket-users] Re: How to improve compile times?

2017-04-26 Thread Alex Harsanyi
I would also like to know more about this topic. I have never done any rigorous tests, however for my application which takes about 7 seconds to load, I have observed the following: * there is no big startup difference between running the application as "racket run.rkt" (which loads the

Re: [racket-users] How to improve compile times?

2017-04-28 Thread Alex Harsanyi
On Friday, April 28, 2017 at 10:04:52 PM UTC+8, Matthew Flatt wrote: > I notice that your code calls `running-stickman-icon` on startup, which > takes about 2 seconds on my machine. Well, this is embarrassing for me. I remember adding that code in and having to decide on whether to wait 2

Re: [racket-users] Speeding up graphics / moving away from 2htdp/image

2017-04-28 Thread Alex Harsanyi
On Friday, April 28, 2017 at 6:40:06 PM UTC+8, Daniel Prager wrote: > The reason is that what I really want to do is more complex layouts, for > which 2htdp/image or pict combiners make life a lot easier. The code to convert to bitmap allocates the bitmap and draws to the bitmap. In the

Re: [racket-users] How to improve compile times?

2017-04-28 Thread Alex Harsanyi
On Friday, April 28, 2017 at 2:47:41 AM UTC+8, Dupéron Georges wrote: > Thank you Matthew for the explanation. > > If I understand correctly, > > * Alex Harsanyi's start-up time is due to run-time (phase 0) initialisation > code in the required libraries, including things like (define v >

[racket-users] How to store SQL query text outside Racket source code?

2017-07-31 Thread Alex Harsanyi
I'm trying to write a function to keep the SQL query text outside of the Racket source code, as this would make it easier to write and test the SQL code. Instead of writing: (define query (virtual-statement (lambda (dbsys) "select ..."))) I would like to put the "select ..." part in a

Re: [racket-users] How to store SQL query text outside Racket source code?

2017-07-31 Thread Alex Harsanyi
On Tuesday, August 1, 2017 at 12:11:24 PM UTC+8, gneuner2 wrote: > Hmm.  A change to a query often also means a change to its arguments > and/or its result columns, so I don't see that there is much utility > in keeping the query strings separate from the program.  I'm not

[racket-users] "Test did not clean up resources" message from GUI test runner

2017-08-20 Thread Alex Harsanyi
I just noticed that the GUI test runner displays "test did not clean up resources" messages on my tests, but it is not clear to me what resources are not being cleaned up. I tried to reproduce the problem in the following test case: #lang racket (require rackunit rackunit/gui db)

[racket-users] Re: Executing batch statements against a database using `db` library.

2017-05-12 Thread Alex Harsanyi
You need to execute the statements one by one and write code that reads the statements. I have written code to read a SQL schema definition file and create a database from it, you can find it here: https://github.com/alex-hhh/ActivityLog2/blob/master/rkt/dbutil.rkt The `db-open` command

[racket-users] Re: event resolution for nested editor-snips in racket/gui

2017-06-01 Thread Alex Harsanyi
On Thursday, June 1, 2017 at 8:06:30 AM UTC+8, andrew blinn wrote: > I'm trying to use a assign a keypress to toggle the display of the border of > an embedded editor-snip. Currently pressing the toggle key only toggles the > border of the topmost snip, whereas I want to toggle the border most

[racket-users] Re: #lang languages and cyclic dependencies

2017-05-01 Thread Alex Harsanyi
Hi Philip, I don't have an answer to your problem, but I'm curious as to what do you store in "local.rkt" and "production.rkt" to justify such a complicated solution. In the projects that I worked on (Racket or otherwise), local vs production differ in the values for different parameters,

Re: [racket-users] libusb FFI bindings for a bike trainer control application

2017-09-15 Thread Alex Harsanyi
gt; > Groeten, > Bert > > Van: racket-users@googlegroups.com <racket-users@googlegroups.com> namens > Alex Harsanyi <alexharsa...@gmail.com> > Verzonden: vrijdag 15 september 2017 7:53 > Aan: Racket Users > Onderwerp: [rac

[racket-users] Re: Do futures actually work? What are they useful for?

2017-09-11 Thread Alex Harsanyi
On Tuesday, September 12, 2017 at 4:46:18 AM UTC+8, Alexis King wrote: > > > Furthermore, if this problem really is a lost cause, what are futures > actually useful for? The documentation would imply that they are useful > for lots of number crunching using machine integers or flonums, but >

Re: [racket-users] "Test did not clean up resources" message from GUI test runner

2017-08-21 Thread Alex Harsanyi
On Tuesday, August 22, 2017 at 12:53:20 AM UTC+8, Ryan Culpepper wrote: > On 08/20/2017 09:28 PM, Alex Harsanyi wrote: > > I just noticed that the GUI test runner displays "test did not clean up > > resources" messages on my tests, but it is not clear to me what res

[racket-users] Re: "Test did not clean up resources" message from GUI test runner

2017-08-21 Thread Alex Harsanyi
On Monday, August 21, 2017 at 2:39:06 PM UTC+8, Jack Firth wrote: > On Sunday, August 20, 2017 at 6:28:20 PM UTC-7, Alex Harsanyi wrote: > > I just noticed that the GUI test runner displays "test did not clean up > > resources" messages on my tests, but it is not c

Re: [racket-users] Generate function defintions at compile time

2017-08-24 Thread Alex Harsanyi
On Thursday, August 24, 2017 at 9:42:51 PM UTC+8, Matthias Felleisen wrote: > > Yes, Racket is a good language. But let me point you to the blog of a > reflective developer, and I consider reflective developers the best of their > kind: > > >

Re: [racket-users] Generate function defintions at compile time

2017-08-23 Thread Alex Harsanyi
On Thursday, August 24, 2017 at 8:59:26 AM UTC+8, Neil Van Dyke wrote: > h...@oorg wrote on 08/23/2017 06:56 PM: > > > Wouldn't making a DSL be overkill? > > No. In Racket, a DSL (aka minilanguage, syntax extensions, or macros) > can be a very small implementation effort that does exactly

Re: [racket-users] Re: New wiki page ‘friends of Racket’

2017-11-13 Thread Alex Harsanyi
On Mon, Nov 13, 2017 at 5:26 PM, 'Paulo Matos' via Racket Users <racket-users@googlegroups.com> wrote: > > > On 30/10/17 00:18, Alex Harsanyi wrote: >> >> You could add ActivityLog2 (https://github.com/alex-hhh/ActivityLog2) to >> that list (Disclaimer: I am the

[racket-users] Re: stumped

2017-12-13 Thread Alex Harsanyi
I built a similar control, although it does not represent directory paths, just labels which are stacked vertically. I ended up defining a structure to hold the text and width + height of each label and keep these structures in a list. In my case, all labels have the same size so converting a

[racket-users] Re: 2htdp/universe: behavior of dual shift keys

2017-12-17 Thread Alex Harsanyi
I tested this on a Windows platform and have the same result. It seems there is a problem in Racket with handling the right shift key: pressing down the right shift key results in "keydown" being invoked with a "rshift" argument, but releasing the right shift key results in "keyup" being called

[racket-users] confused about raco check-requires error

2017-11-20 Thread Alex Harsanyi
I'm trying to use the "raco check-requires" command to determine which requires I should remove from my source files, and the command fails when I include one of my files (the application compiles and runs fine). I managed to reproduce the case as follows: ;; Save this in "file1.rkt"

Re: [racket-users] Re: Racket in command line, puts out wrong number

2017-11-09 Thread Alex Harsanyi
Hi Karim, You forgot to add the racket users list to your message, so your reply is sent to the mailing list. I fixed that. On Fri, Nov 10, 2017 at 12:17 AM, Karim Djemai wrote: > Hey Alex, > thank you for your quick response! > Is there any way for me to get the

[racket-users] Re: structs vs classes

2017-12-06 Thread Alex Harsanyi
In my code, I started experimenting with using immutable structs and "updating" them using 'struct-copy'. I had to write my own "update" functions, but I was surprised at how elegant the resulting code was. I believe (although I did not check) that the guard function is invoked every time a

Re: [racket-users] Adding interactive overlays to racket plots

2018-02-02 Thread Alex Harsanyi
Hi Matthias, I updated the plot package to cover all the cases I had in mind for plot overlays and also updated my application to make use of these features, just to make sure that they are adequate. The pull request is here: https://github.com/racket/plot/pull/32, it would be good if I

[racket-users] Adding interactive overlays to racket plots

2018-01-29 Thread Alex Harsanyi
The racket plot package produces interactive snip% objects which allow zooming of the plot area. While this is a cool and sometimes useful feature, the functionality is hard coded in the plot-snip% class inside the package. I would like to extend the package to allow the user to customize the

[racket-users] Re: Adding interactive overlays to racket plots

2018-02-09 Thread Alex Harsanyi
On Saturday, February 10, 2018 at 10:00:29 AM UTC+8, Evan Whitmer wrote: > > Do you anticipate this playing well with charts that have multiple Y > values for a given X value. For example, candlestick plotting >

[racket-users] How to check if a symbol is defined before calling it?

2018-02-17 Thread Alex Harsanyi
The recent plot library introduces a new function, `point-pict` which is not yet available as part of a Racket distribution, and the plot package has to be installed separately from GitHub for this function. In my code I would like to be able to check if this function is available before

Re: [racket-users] How to check if a symbol is defined before calling it?

2018-02-17 Thread Alex Harsanyi
ict (λ () #f))]) > (when point-pict > (point-pict ...))) > > -Philip > > On Sat, Feb 17, 2018 at 7:57 PM, Alex Harsanyi <alexha...@gmail.com > > wrote: > >> >> The recent plot library introduces a new function, `point-pict` which is >> not yet avai

[racket-users] Re: Is it possible to get the size of a panel%

2018-02-21 Thread Alex Harsanyi
Get-size should work, can you provide a example that illustrates the problem? The only tricky bit is that the actual size of a widget is only computed after it is shown. Here is an example: #lang racket (require racket/gui) (define toplevel (new frame% [label "hello"]

Re: [racket-users] How to check if a symbol is defined before calling it?

2018-02-18 Thread Alex Harsanyi
Hi Robby, On Sunday, February 18, 2018 at 10:33:09 AM UTC+8, Robby Findler wrote: > > FWIW, the approach that is less friendly to your clients but perhaps > easier for you (and maybe good enough for them) is to declare a > dependency on a specific version in the info.rkt file of your pkg. The

[racket-users] Are canvases stackable?

2018-02-23 Thread Alex Harsanyi
You want to use a pasteboard% for the chess table and snip% objects for the pieces. You can draw the board as the pasteboard background in the on-draw method. You will have to implement snip management in the pasteboard though because by default snips can just be dragged around and placed

[racket-users] Re: Experience with REST APIs in Racket

2018-04-11 Thread Alex Harsanyi
I used the built-in url package (http://docs.racket-lang.org/net/url.html) from Racket to fetch data from Wunderground weather API and it was simple enough that I did not feel the need for a separate REST library. I just used `format` to construct the URL, `get-pure-port` to fetch the data

[racket-users] Re: truly stand-alone Windows ".exe"s

2018-03-27 Thread Alex Harsanyi
I have version 6.90.0.23 installed from a few days ago, which appears to be the latest version available at http://pre.racket-lang.org/, and "raco exe" does not accept the '--embed-dlls' option. Have these changes not been released in a snapshot yet? Best Regards, Alex. On Monday, March 26,

Re: [racket-users] Re: truly stand-alone Windows ".exe"s

2018-03-28 Thread Alex Harsanyi
On Tuesday, March 27, 2018 at 9:17:49 PM UTC+8, Matthew Flatt wrote: > > I should have bumped the version number when adding `--embed-dlls`, but > I didn't. So, even though it's still version 6.90.0.23, `--embed-dlls` > is in snapshots starting with the ones built on March 26. > I tried the

Re: [racket-users] Re: truly stand-alone Windows ".exe"s

2018-03-28 Thread Alex Harsanyi
Yes, this seems to be a Windows Explorer problem, if I move the executable to a different place, the icon changes. It is the first time I see this behaviour... Sorry for the false alarm :-) Alex. -- You received this message because you are subscribed to the Google Groups "Racket Users"

Re: [racket-users] Unexpected error when building standalone Racket executable

2018-03-24 Thread Alex Harsanyi
tthew > > At Thu, 22 Mar 2018 22:31:11 -0700 (PDT), Alex Harsanyi wrote: > > I started getting some unexpected and unexplained errors from Racket > when > > trying to build a stand alone executable. The versions is: Racket 6.12 > > 64bit > > on Windows 10

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

2018-03-24 Thread Alex Harsanyi
The "traditional" way of doing this in other languages and GUI toolkits is to have a separate class for each of your panes (Books, Users and Rentals). The constructor would receive the parent widget and other initialization parameters (e.g. a database connection). Something like this: ;;

Re: [racket-users] Adding interactive overlays to racket plots

2018-03-20 Thread Alex Harsanyi
-overlays-with-the-racket-plot-package-update.html Best Regards, Alex. On Saturday, February 3, 2018 at 3:08:50 PM UTC+8, Alex Harsanyi wrote: > > > Hi Matthias, > > I updated the plot package to cover all the cases I had in mind for plot > overlays and also updated my appli

[racket-users] Unexpected error when building standalone Racket executable

2018-03-22 Thread Alex Harsanyi
I started getting some unexpected and unexplained errors from Racket when trying to build a stand alone executable. The versions is: Racket 6.12 64bit on Windows 10. If I try to run my application from Racket, it runs with no problems. If I build an executable and try to run it, I get the

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

2018-03-05 Thread Alex Harsanyi
You can get the number of rows by calling `get-number` which is an inherited method from list-control<%>. However, you probably want to keep the data separate from the list box and sort that: the list box always contains strings, but your data type might be a number and you want to sort it

Re: [racket-users] Are canvases stackable?

2018-02-28 Thread Alex Harsanyi
AM David Alkire <david@gmail.com > > wrote: > >> That's interesting. Thanks, I'll give it a try. >> >> On Fri, Feb 23, 2018, 11:24 PM Alex Harsanyi <alexha...@gmail.com >> > wrote: >> >>> You want to use a pasteboard% for the ch

[racket-users] Re: game help

2018-05-03 Thread Alex Harsanyi
I wonder if *just solved your homework...* (define (same-value? vec) (define test-val (vector-ref vec 0)) (if (zero? test-val) #f (let ((same? (for/and ((v (in-vector vec))) (eqv? test-val v (and same? test-val (define (winner-by-row row-num)

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

2018-05-07 Thread Alex Harsanyi
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

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

2018-05-08 Thread Alex Harsanyi
On Wednesday, May 9, 2018 at 7:25:34 AM UTC+8, gneuner2 wrote: > > > Ignoring Racket's extraneous added panels, a better organization would be: > > Window 00010010 "" #32769 (Desktop) > : > Window 0017076E "Hello World" PLTFrame > Window 000F03D2 "Dialog 1" #32770 (Dialog) >

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

2018-05-08 Thread Alex Harsanyi
On Tuesday, May 8, 2018 at 2:08:02 PM UTC+8, gneuner2 wrote: > > Hi Alex, > > > So I guess the 1st question to answer is: does the GDI object have the > correct parent HWND? [The Racket dialog% object has a parent, but does > the underlying display object?] If it does, there's something

[racket-users] How to build unix paths on windows with build-path/convention-type

2018-05-22 Thread Alex Harsanyi
I am trying to create a path named "/foo/bar" in Racket on a windows machine. build-path produces "/foo\\bar" and build-path/convention-type does not seem to work: > (path->string (build-path "/" "foo" "bar")) "/foo\\bar" ; I am running on a Windows machine, so this is expected 

Re: [racket-users] How to build unix paths on windows with build-path/convention-type

2018-05-22 Thread Alex Harsanyi
ot;)) > > Roughly, strings don't work, because they have to be converted to bytes > using the locale's default encoding. Although strings are allowed for > the current platform's convention on the assumption that the current > locale's encoding is the right one, we've avoided buildin