Re: [racket-users] a minor regexp question (and a how-could-I-answer-it-myself? question)

2020-05-01 Thread Tim Hanson
Thanks, Jens, much appreciated. I suspect I even knew this once and had since forgotten it. (I even glanced at the docs, saw the two kinds, but didn’t pause long enough to wonder if it mattered to me.) -- You received this message because you are subscribed to the Google Groups "Racket

[racket-users] a minor regexp question (and a how-could-I-answer-it-myself? question)

2020-05-01 Thread Tim Hanson
hi, just now I'm debugging a regular expression and trying to understand why this: > (regexp-match-positions #rx"[-+][0-9]+" "-0500") '((0 . 5)) works as I expect, whereas this: > (regexp-match-positions #rx"[-+][0-9]{4}" "-0500") #f doesn't. (My naive opinion is the second expression

Re: [racket-users] a question or two regarding Gregor

2020-05-01 Thread Tim Hanson
very helpful that you linked to the issue, thank you. I now understand there are non-trivial problem domain issues (for example, “CDT” is ambiguous, probably even with locale specified.) I will think about how to tackle my specific problem and whether I can help with issues like these. --

Re: [racket-users] a question or two regarding Gregor

2020-04-30 Thread Tim Hanson
Thanks for the quick reply, Jon! OK, good to know. Maybe I can add the ones I need (if I can figure out how...). :) -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: [racket-users] a question or two regarding Gregor

2020-04-30 Thread Tim Hanson
p.s. I'm stuck on parsing one pattern that comes up in my data. Here's a corresponding test: (parameterize ([current-locale "en"]) (check-equal? (parse-datetime "Sun, 21 Jun 2015 17:50:44 -0500 (CDT)" "EEE, dd MMM HH:mm:ss ()") (datetime 2015 6 21 17 50

Re: [racket-users] a question or two regarding Gregor

2020-04-28 Thread Tim Hanson
Thanks, Jon! I agree with your analysis and thoughts about which cases should always raise exceptions. (I can't recall whether you scan patterns that include semi-redundant information such as day-of-week; wondered just now whether a contradictory day of week would be another category of

Re: [racket-users] a question or two regarding Gregor

2020-04-27 Thread Tim Hanson
Thanks. Something like that will let me proceed for now. I'd still be curious what folks think about an approach avoiding exceptions. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from

[racket-users] a question or two regarding Gregor

2020-04-27 Thread Tim Hanson
hi, I've installed and am trying out Gregor: a date and time library for Racket and find it to be very powerful and useful. In my current application (digging through mail headers) I'm wondering whether there is a way to test whether a given date-time format matches without using

Re: [racket-users] question re downloading a PDF file

2019-11-24 Thread Tim Hanson
Thanks, Dominik, that appears to do the trick! (pdfgrep is immediately happy...). Much appreciated, Tim -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[racket-users] question re downloading a PDF file

2019-11-24 Thread Tim Hanson
hi, I need to fetch a number of PDF documents and wrote a bit of racket to make it easier. The part that "downloads" is this: (let ([content ((compose port->string get-pure-port string->url) (url-for-doc year doc-name))]) (let ([out (open-output-file

[racket-users] macOSX trick linking drracket in dock to current version via /etc/paths.d/racket ?

2019-11-17 Thread Tim Hanson
hi, I just upgraded to 7.4 and rediscovered (here, thanks for helpful posts!) the best practice for the bash $PATH using /etc/paths.d/racket. Is there an analogous trick to "update" which version I get when I click on the drracket icon in the macOSX dock? (OK, it's only a few clicks to remove

Re: [racket-users] go cheney yourself

2019-01-08 Thread Tim Hanson
t; > >> On Jan 8, 2019, at 4:09 PM, Tim Hanson wrote: >> >> great piece by Michelle Goldberg, imho: >> >> https://www.nytimes.com/2019/01/07/opinion/rashida-tlaib-profanity.html >> >> -- >> You received this message because you are subscribed

[racket-users] go cheney yourself

2019-01-08 Thread Tim Hanson
great piece by Michelle Goldberg, imho: https://www.nytimes.com/2019/01/07/opinion/rashida-tlaib-profanity.html -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [racket-users] a matrix question

2018-03-26 Thread Tim Hanson
Many thanks, Jens Axel! That looks very good and includes several techniques that will help and inspire me, in particular for*/matrix, which I hadn't used yet. I'll try it out the next chance I get. -- You received this message because you are subscribed to the Google Groups "Racket Users"

[racket-users] a matrix question

2018-03-25 Thread Tim Hanson
hi, I'm trying out matrices (without typed racket, though I read the performance caveat -- I'm not worried about performance at the moment) and am trying to find the best idioms for a small function I'd like to build. Q1: is there an elegant away to assemble a matrix column-wise? (my first

Re: [racket-users] "Site not secure"

2018-03-10 Thread Tim Hanson
Thanks for fixing 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. For more options, visit

[racket-users] "Site not secure"

2018-03-09 Thread Tim Hanson
Hi, I tried to grab the latest racket version from download.racket-lang.org and chrome and edge tell me the certificate of the site at mirror.racket-lang.org is not yet valid or expired. It's no problem as I found a mirror with a valid certificate, but I guess you'll want to renew the

Re: [racket-users] catching a contract violation in a unit test with check-exn

2017-11-25 Thread Tim Hanson
Thanks again. I've tweaked and commented the end of Mathias's example: (module+ test (check-exn exn:fail:contract? (lambda () (f 1))) ; violates contract by returning non-integer (check-exn exn:fail:contract? (lambda () (f 'a ; violates contract by being called with a non-integer and

Re: [racket-users] catching a contract violation in a unit test with check-exn

2017-11-18 Thread Tim Hanson
Beautiful! Thanks to both of you. Can't wait to try it out. Cheers, Tim -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[racket-users] catching a contract violation in a unit test with check-exn

2017-11-18 Thread Tim Hanson
Hi, I guess this didn't find the right subject matter expert yet. Would it be better to ask a specific person or use a different channel? Cheers, tbh -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop

[racket-users] catching a contract violation in a unit test with check-exn

2017-11-12 Thread Tim Hanson
hi, As part of something I'm working on I want to convert a stream of values into a stream of pairs of values, e.g. 1 2 3 4 becomes (1 2) (3 4) The following seems to work fine: (define (pairwise-stream astream) (if (stream-empty? astream) empty-stream (stream-cons

Re: [racket-users] Hint on opening enclosing directory of current file from DrRacket

2017-06-29 Thread Tim Hanson
Heh, cool, Laurent! This dabbler had missed this until now -- I will read and probably use. Cheers, tim -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [racket-users] [Racket-users] IMAP with racket

2017-02-11 Thread Tim Hanson
p.s. I just found this: https://planet.racket-lang.org/package-source/gh/gapi.plt/1/3/planet-docs/manual/Examples.html which leads here: https://github.com/greghendershott/gapi/blob/master/examples/macro/gplus-oauth.rkt and looks promising. (I didn't find any signs of oauth use in sirmail

Re: [racket-users] [Racket-users] IMAP with racket

2017-02-11 Thread Tim Hanson
Bravo! This parallels my motivation. I'm kind of a beginner in Racket, but it is powerful, portable, elegant, well-documented, and well-supported, so I keep dabbling ... -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this

Re: [racket-users] IMAP with racket

2017-02-11 Thread Tim Hanson
Thanks, all, this rings a bell and I note that: https://docs.racket-lang.org/webapi/oauth2.html says use with caution. I will look around and see if I can figure out how to do imap in conjunction with oauth2. Cheers, Tim -- You received this message because you are subscribed to the

Re: [racket-users] IMAP with racket

2017-02-11 Thread Tim Hanson
Thanks again for several helpful pointers. I've recorded humble beginnings here: https://github.com/tbhanson/imap-with-racket Comments and suggestions very welcome. (I know in particular I'd like to have a handy way to store my credentials somewhere, am using ~/.myImapCreds for now, but am

Re: [racket-users] IMAP with racket

2017-02-08 Thread Tim Hanson
Cool, thank you! I had no idea about parameterize. I will try that and continue my investigations. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [racket-users] IMAP with racket

2017-02-08 Thread Tim Hanson
P.s. For that matter couldn't folder also be optional, defaulting to "INBOX"? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [racket-users] IMAP with racket

2017-02-07 Thread Tim Hanson
hi, I'm finally finding time to dig into this a little and have a question about https://docs.racket-lang.org/net/imap.html#%28def._%28%28lib._net%2Fimap..rkt%29._imap-port-number%29%29 Does this make imap-port-number a kind of global variable? My naive view is it would be somewhat

Re: [racket-users] IMAP with racket

2016-12-27 Thread Tim Hanson
Thanks for both answers! I'll report back when I've made some progress! Cheers, Tim -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[racket-users] IMAP with racket

2016-12-26 Thread Tim Hanson
Hi, I think I'd like to try using racket as a way to explore relatively simple ways of getting a grip on some mail accounts that have gotten out of hand. Specifically I'd like to be able to - compute some statistics, such as number of mails from various addresses - reorganize / clean-up, say by

[racket-users] reading UTF-16 from a file

2015-11-13 Thread Tim Hanson
hi, I was hoping yesterday to read UTF-16 characters from a file using, e.g., a small snippet such as the following: (for ([c (in-port read-char (open-input-file "myfile.txt"))] [counter naturals] #:break (>= counter 100)) (printf "(~a [~a]) " c (char->integer c))) For a UFT-16

[racket-users] Re: regexp question

2015-10-31 Thread Tim Hanson
of regular expressions that is more compatible with Perl." > > That must be the only thing in Racket influenced by Perl. > > > > > On Friday, October 30, 2015 at 11:46:27 AM UTC-7, Tim Hanson wrote: > > On Friday, October 30, 2015 at 7:21:58 PM UTC+1, Matthew Butt

[racket-users] Re: regexp question

2015-10-30 Thread Tim Hanson
rence/regexp.html?q=pregexp#%28elem._%28rxex._25%29%29 > > > On Friday, October 30, 2015 at 11:15:08 AM UTC-7, Tim Hanson wrote: > > hi, > > > > I must be overlooking something basic, but can't figure out why the second > > and third tests here fail. (Makes no dif

[racket-users] regexp question

2015-10-30 Thread Tim Hanson
hi, I must be overlooking something basic, but can't figure out why the second and third tests here fail. (Makes no difference whether I spell {space-character} the [[:space:]] or the \\s way.) I'd be grateful for enlightenment. :) Cheers, Tim (define rx-empty-or-all-blank-string