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 could get some feedback if my approach OK, or what needs to be 
changed.  What is missing is the documentation, but I would like to leave 
that until after the code is considered OK.  I wrote up some notes about 
the API here: https://github.com/alex-hhh/plot/wiki/overlays-notes

I also did a write-up of the features, as well as some screenshots to 
illustrate what can be done with the new functionality.  You can find that 
here: 
https://alex-hhh.github.io/2018/02/interactive-overlays-with-the-racket-plot-package.html

Best Regards,
Alex. 

On Monday, January 29, 2018 at 11:18:39 PM UTC+8, Matthias Felleisen wrote:

> This is dang cool. Yes please submit a PR. 

-- 
You received this message because you are subscribed to the Google 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] Quick regexp question

2018-02-02 Thread nocheroot
It is nice.  I'll have to play with this as well.  Thanks again everyone.

On Friday, February 2, 2018 at 5:49:15 PM UTC-6, johnbclements wrote:
>
>
>
> > On Feb 2, 2018, at 3:21 PM, Matthew Butterick  > wrote: 
> > 
> > 
> >> On Feb 2, 2018, at 10:23 AM, 'John Clements' via Racket Users <
> racket...@googlegroups.com > wrote: 
> >> 
> >> This macro gets the names in much closer to the corresponding patterns 
> than matching by index, but it doesn’t actually embed the names into the 
> regexp. 
> > 
> > 
> > If you like keeping the names and patterns together, you could also 
> create an association list of the names and subpatterns, and iterate: 
> > 
> > #lang racket 
> > 
> > (define msg "2018-02-02T11:26:34 someuser some-computername01 
> 233.194.20.110 something broke") 
> > (with-input-from-string msg 
> >  (thunk 
> >(for/hash ([(name pat) (in-dict '((date . "[-\\dT:]+") 
> >  (username . "\\w+") 
> >  (hostname . "[-\\w\\d]+") 
> >  (ip . "[\\d\\.]+") 
> >  (message . ".+")))]) 
> >  (values name (car (regexp-match (pregexp pat) 
> (current-input-port))) 
>
> Oh, that’s nice. 
>
> In fact, I’ll tell you what I *really* like about that; it could radically 
> simplify the irritating process of debugging regexps by breaking them in 
> various places to perform a binary search; you could instead provide a nice 
> error message specifying exactly which part of the regexp failed to match. 
>
> One thing to be aware of is that you’d need to make sure that your regexp 
> still works without backtracking. If you broke #px”.*abc” into #px”.*” and 
> #px”abc”, it wouldn’t mean the same thing any more. 
>
> John 
>
> > 
> > 
> > '#hash((message . #" something broke") 
> >   (date . #"2018-02-02T11:26:34") 
> >   (username . #"someuser") 
> >   (hostname . #"some-computername01") 
> >   (ip . #"233.194.20.110")) 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Racket Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to racket-users...@googlegroups.com . 
> > 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] Quick regexp question

2018-02-02 Thread 'John Clements' via Racket Users


> On Feb 2, 2018, at 3:21 PM, Matthew Butterick  wrote:
> 
> 
>> On Feb 2, 2018, at 10:23 AM, 'John Clements' via Racket Users 
>>  wrote:
>> 
>> This macro gets the names in much closer to the corresponding patterns than 
>> matching by index, but it doesn’t actually embed the names into the regexp.
> 
> 
> If you like keeping the names and patterns together, you could also create an 
> association list of the names and subpatterns, and iterate:
> 
> #lang racket
> 
> (define msg "2018-02-02T11:26:34 someuser some-computername01 233.194.20.110 
> something broke")
> (with-input-from-string msg
>  (thunk
>(for/hash ([(name pat) (in-dict '((date . "[-\\dT:]+")
>  (username . "\\w+")
>  (hostname . "[-\\w\\d]+")
>  (ip . "[\\d\\.]+")
>  (message . ".+")))])
>  (values name (car (regexp-match (pregexp pat) 
> (current-input-port)))

Oh, that’s nice.

In fact, I’ll tell you what I *really* like about that; it could radically 
simplify the irritating process of debugging regexps by breaking them in 
various places to perform a binary search; you could instead provide a nice 
error message specifying exactly which part of the regexp failed to match.

One thing to be aware of is that you’d need to make sure that your regexp still 
works without backtracking. If you broke #px”.*abc” into #px”.*” and #px”abc”, 
it wouldn’t mean the same thing any more.

John

> 
> 
> '#hash((message . #" something broke")
>   (date . #"2018-02-02T11:26:34")
>   (username . #"someuser")
>   (hostname . #"some-computername01")
>   (ip . #"233.194.20.110"))
> 
> -- 
> You received this message because you are subscribed to the Google 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] How to integrate Racket with a .Net application?

2018-02-02 Thread HiPhish
For the people not following my bug tracker: I fixed it now.

On Friday, February 2, 2018 at 2:44:25 PM UTC+1, berthold.baeuml wrote:
>
> https://pkgs.racket-lang.org/package/msgpack is a nice package to use. 
> Thank you for providing it. But there is a bug for sequence lengths  >15 
> and <255. I filed an issue at 
> https://gitlab.com/HiPhish/MsgPack.rkt/issues/4
>
> Berthold
>

-- 
You received this message because you are subscribed to the Google 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] Quick regexp question

2018-02-02 Thread Matthew Butterick

> On Feb 2, 2018, at 10:23 AM, 'John Clements' via Racket Users 
>  wrote:
> 
> This macro gets the names in much closer to the corresponding patterns than 
> matching by index, but it doesn’t actually embed the names into the regexp.


If you like keeping the names and patterns together, you could also create an 
association list of the names and subpatterns, and iterate:

#lang racket

(define msg "2018-02-02T11:26:34 someuser some-computername01 233.194.20.110 
something broke")
(with-input-from-string msg
  (thunk
(for/hash ([(name pat) (in-dict '((date . "[-\\dT:]+")
  (username . "\\w+")
  (hostname . "[-\\w\\d]+")
  (ip . "[\\d\\.]+")
  (message . ".+")))])
  (values name (car (regexp-match (pregexp pat) 
(current-input-port)))


'#hash((message . #" something broke")
   (date . #"2018-02-02T11:26:34")
   (username . #"someuser")
   (hostname . #"some-computername01")
   (ip . #"233.194.20.110"))

-- 
You received this message because you are subscribed to the Google 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] How do I increase memory for Racket?

2018-02-02 Thread David Storrs
Brilliant.  Thanks, Matthew.

On Fri, Feb 2, 2018 at 12:35 PM, Matthew Flatt  wrote:

> At Fri, 2 Feb 2018 12:08:39 -0500, David Storrs wrote:
> > I've got some tests that are crashing due to running out of memory.  I
> > would rather not pull aside to track down the issue, preferring instead
> to
> > get the functionality working now and solve the memory problem later.
> > Regardless, Racket is only getting 128MB, which seems pretty anemic.
> >
> > I've checked 'racket --help' and googled but apparently my google fu is
> > weak.  How do I tell Racket that it's okay to take more RAM?
>
> 128MB sounds like DrRacket's limit. Select "Limit Memory..." in the
> "Racket" menu.
>
> Otherwise, Racket will use as much memory as the OS allows. So, if I
> guess wrong about DrRacket, I think you must have a limit at the OS
> level and need to use something like `ulimit` or `limit` in your shell.
>
>

-- 
You received this message because you are subscribed to the Google 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] Quick regexp question

2018-02-02 Thread nocheroot
In the long run this is probably better than what I wanted.  Thank you

On Friday, February 2, 2018 at 12:23:48 PM UTC-6, johnbclements wrote:
>
> Not sure if this gets you as far as you want, but you could use a macro to 
> associate names with paren-wrapped items: 
>
> #lang racket 
>
> (define-syntax re-match 
>   (syntax-rules () 
> [(_ str re name ...) 
>  (match str 
>[(regexp re (list _ name ...)) 
> (list (list (quote name) name) ...)])])) 
>
> (define msg "2018-02-02T11:26:34 someuser some-computername01 
> 233.194.20.110 something broke") 
>
> (re-match msg 
>   #px"^([-\\dT:]+)\\s(\\w+)\\s([-\\w\\d]+)\\s([\\d\\.]+)\\s(.+)$" 
>   date username hostname ip message) 
>
> … produces: 
>
> '((date "2018-02-02T11:26:34") 
>   (username "someuser") 
>   (hostname "some-computername01") 
>   (ip "233.194.20.110") 
>   (message "something broke”)) 
>
>
> This macro gets the names in much closer to the corresponding patterns 
> than matching by index, but it doesn’t actually embed the names into the 
> regexp. 
>
> John Clements 
>
>
> > On Feb 2, 2018, at 10:01 AM, noch...@gmail.com  wrote: 
> > 
> > Sorry if I've missed this in the documentation, but I don't see it, and 
> it is starting to bother me. 
> > 
> > In Powershell. Python, and Splunk I'm able to perform automatic field 
> extraction on strings and access the values of fields by name.  Is there a 
> way to do this in Racket?  Of course, pairing matches with field names by 
> index is an option, but not as convenient in some situations. 
> > 
> > Take string "2018-02-02T11:26:34 someuser some-computername01 
> 233.194.20.110 something broke" as a trivial example. 
> > 
> > Powershell: 
> > "2018-02-02T11:26:34 someuser some-computername01 233.194.20.110 
> something broke" -match 
> "^(?[\d\-T:]+)\s(?\w+)\s(?[\w\-\d]+)\s(?[\d\.]+)\s(?.+)$"
>  
> | Out-Null 
> > 
> > $matches.date 
> > $matches.username 
> > $matches.hostname 
> > $matches.IP 
> > $matches.message 
> > 
> > Python: 
> > m = 
> re.match("^(?P[\d\-T:]+)\s(?P\w+)\s(?P[\w\-\d]+)\s(?P[\d\.]+)\s(?P.+)$",
>  
> "2018-02-02T11:26:34 someuser some-computername01 233.194.20.110 something 
> broke") 
> > 
> > m['Date'] 
> > m['Username'] 
> > m['Hostname'] 
> > m['IP'] 
> > m['Message'] 
> > 
> > Both output: 
> > 
> > 2018-02-02T11:26:34 
> > someuser 
> > some-computername01 
> > 233.194.20.110 
> > something broke 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Racket Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to racket-users...@googlegroups.com . 
> > 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] Quick regexp question

2018-02-02 Thread 'John Clements' via Racket Users
Not sure if this gets you as far as you want, but you could use a macro to 
associate names with paren-wrapped items:

#lang racket

(define-syntax re-match
  (syntax-rules ()
[(_ str re name ...)
 (match str
   [(regexp re (list _ name ...))
(list (list (quote name) name) ...)])]))

(define msg "2018-02-02T11:26:34 someuser some-computername01 233.194.20.110 
something broke")

(re-match msg
  #px"^([-\\dT:]+)\\s(\\w+)\\s([-\\w\\d]+)\\s([\\d\\.]+)\\s(.+)$"
  date username hostname ip message)

… produces:

'((date "2018-02-02T11:26:34")
  (username "someuser")
  (hostname "some-computername01")
  (ip "233.194.20.110")
  (message "something broke”))


This macro gets the names in much closer to the corresponding patterns than 
matching by index, but it doesn’t actually embed the names into the regexp.

John Clements


> On Feb 2, 2018, at 10:01 AM, nocher...@gmail.com wrote:
> 
> Sorry if I've missed this in the documentation, but I don't see it, and it is 
> starting to bother me.
> 
> In Powershell. Python, and Splunk I'm able to perform automatic field 
> extraction on strings and access the values of fields by name.  Is there a 
> way to do this in Racket?  Of course, pairing matches with field names by 
> index is an option, but not as convenient in some situations.
> 
> Take string "2018-02-02T11:26:34 someuser some-computername01 233.194.20.110 
> something broke" as a trivial example.
> 
> Powershell:
> "2018-02-02T11:26:34 someuser some-computername01 233.194.20.110 something 
> broke" -match 
> "^(?[\d\-T:]+)\s(?\w+)\s(?[\w\-\d]+)\s(?[\d\.]+)\s(?.+)$"
>  | Out-Null
> 
> $matches.date
> $matches.username
> $matches.hostname
> $matches.IP
> $matches.message
> 
> Python:
> m = 
> re.match("^(?P[\d\-T:]+)\s(?P\w+)\s(?P[\w\-\d]+)\s(?P[\d\.]+)\s(?P.+)$",
>  "2018-02-02T11:26:34 someuser some-computername01 233.194.20.110 something 
> broke")
> 
> m['Date']
> m['Username']
> m['Hostname']
> m['IP']
> m['Message']
> 
> Both output:
> 
> 2018-02-02T11:26:34
> someuser
> some-computername01
> 233.194.20.110
> something broke
> 
> -- 
> You received this message because you are subscribed to the Google 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] Quick regexp question

2018-02-02 Thread nocheroot
Sorry if I've missed this in the documentation, but I don't see it, and it 
is starting to bother me.

In Powershell. Python, and Splunk I'm able to perform automatic field 
extraction on strings and access the values of fields by name.  Is there a 
way to do this in Racket?  Of course, pairing matches with field names by 
index is an option, but not as convenient in some situations.

Take string "2018-02-02T11:26:34 someuser some-computername01 233.194.20.110 
something 
broke" as a trivial example.

Powershell:
"2018-02-02T11:26:34 someuser some-computername01 233.194.20.110 something 
broke" -match 
"^(?[\d\-T:]+)\s(?\w+)\s(?[\w\-\d]+)\s(?[\d\.]+)\s(?.+)$"
 
| Out-Null

$matches.date
$matches.username
$matches.hostname
$matches.IP
$matches.message

Python:
m = re.match(
"^(?P[\d\-T:]+)\s(?P\w+)\s(?P[\w\-\d]+)\s(?P[\d\.]+)\s(?P.+)$"
, "2018-02-02T11:26:34 someuser some-computername01 233.194.20.110 something 
broke")

m['Date']
m['Username']
m['Hostname']
m['IP']
m['Message']

Both output:

2018-02-02T11:26:34
someuser
some-computername01
233.194.20.110
something broke

-- 
You received this message because you are subscribed to the Google 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] Building GUI launcher icons with raco setup

2018-02-02 Thread Matthew Flatt
At Fri, 26 Jan 2018 20:44:44 -0600, Philip McGrath wrote:
> The package includes a module that programmatically generates the icons for
> the GUI launcher at the expected paths ("my-application.png" and so forth).
> I would like to have raco setup run this code before it builds the
> launcher, but I haven't figured out how to get the code to run at the right
> point.
> 
> [...]
> 
> Is there a recommended way to do this? I guess I could have the install
> function use install-gracket-program-launcher manually, instead of using
> gracket-launcher-names and gracket-launcher-libraries, but that seems less
> ideal.

I don't have a better recommendation than that one.

One drawback of using `install-gracket-program-launcher` directly is
that `raco setup` doesn't record which "info.rkt" generated the
launcher, so that it can be removed if the package containing the
"info.rkt" is unnstalled. Otherwise, I can't think of a problem with
this technique, other than the extra work it requires.

-- 
You received this message because you are subscribed to the Google 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] raco distribute help

2018-02-02 Thread Matthew Flatt
At Thu, 1 Feb 2018 12:53:50 -0500, Deren Dohoda wrote:
> tl;dr main.rkt has to (dynamic-require user-selected.rkt) and
> user-selected.rkt is written in a different #lang and requires a file from
> this program. How do I glue these pieces together for raco exe / raco
> distribute?

You'll need to tell `raco exe` that you plan to use the `#lang` modules
at run time. Use `++lib` to add the language's module, but note that
you may need to specify the language's reader module specifically.

-- 
You received this message because you are subscribed to the Google 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] How do I increase memory for Racket?

2018-02-02 Thread Matthew Flatt
At Fri, 2 Feb 2018 12:08:39 -0500, David Storrs wrote:
> I've got some tests that are crashing due to running out of memory.  I
> would rather not pull aside to track down the issue, preferring instead to
> get the functionality working now and solve the memory problem later.
> Regardless, Racket is only getting 128MB, which seems pretty anemic.
> 
> I've checked 'racket --help' and googled but apparently my google fu is
> weak.  How do I tell Racket that it's okay to take more RAM?

128MB sounds like DrRacket's limit. Select "Limit Memory..." in the
"Racket" menu.

Otherwise, Racket will use as much memory as the OS allows. So, if I
guess wrong about DrRacket, I think you must have a limit at the OS
level and need to use something like `ulimit` or `limit` in your shell.

-- 
You received this message because you are subscribed to the Google 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] How do I increase memory for Racket?

2018-02-02 Thread David Storrs
I've got some tests that are crashing due to running out of memory.  I
would rather not pull aside to track down the issue, preferring instead to
get the functionality working now and solve the memory problem later.
Regardless, Racket is only getting 128MB, which seems pretty anemic.

I've checked 'racket --help' and googled but apparently my google fu is
weak.  How do I tell Racket that it's okay to take more RAM?

-- 
You received this message because you are subscribed to the Google 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] How to integrate Racket with a .Net application?

2018-02-02 Thread Berthold Bäuml
https://pkgs.racket-lang.org/package/msgpack is a nice package to use. Thank 
you for providing it. But there is a bug for sequence lengths  >15 and <255. I 
filed an issue at https://gitlab.com/HiPhish/MsgPack.rkt/issues/4

Berthold


> On 2. Feb 2018, at 01:04, HiPhish  wrote:
> 
> On Wednesday, January 31, 2018 at 4:17:09 PM UTC+1, Greg Hendershott wrote:
> Another way is for two (OS) processes to "pipe" I/O to each other. 
> 
> This is a great idea since it would allow to integrate any language with the 
> .NET application. It is how Neovim does it: the main application is Neovim, 
> which is written in C, and it acts as a server for a client application 
> written in whatever other language. The protocol used is MessagePack RPC:
> https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md
> 
> It is built on top of the MessagePack serialisation format. In a nutshell, 
> MessagePack is like JSON, but binary. This makes it smaller to transport and 
> faster to pack and unpack, but it loses the nice human-readability of JSON. I 
> think that's a good tradeoff for data that is not meant to be stored and 
> manipulated by a person, but instead passed around between processes.
> https://msgpack.org/
> 
> I have already written a general-purpose MessagePack library for Racket, as 
> well as a language client for Neovim:
> https://pkgs.racket-lang.org/package/msgpack
> https://pkgs.racket-lang.org/package/nvim-client
> 
> The MessagePack library is safe to use. The Neovim client is my first time 
> doing something with RPC, so I'm not yet ready to call it stable. The part of 
> the codebase which implements MessagePack RPC is not entangled with the 
> Neovim-specific parts, so once the language client matures it will be easy to 
> take it out and make it into a general-purpose MessagePack RPC library.
> 
> -- 
> You received this message because you are subscribed to the Google 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 
> .

-- 
---
Berthold Bäuml -- Head of Autonomous Learning Robots Lab
DLR, Robotics and Mechatronics Center (RMC)
Münchner Str. 20, D-82234 Wessling
Phone +49 8153 282489
http://www.robotic.de/Berthold.Baeuml 

-- 
You received this message because you are subscribed to the Google 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.