[racket-users] Re: Decision Tree in Racket - Performance

2017-08-07 Thread Zelphir Kaltstahl
I've now implemented post pruning with 2 test cases as well.

-- 
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] Anyone using MongoDB 3.2.15 with DrRacket 6.9?

2017-08-07 Thread Ryan Culpepper

On 08/06/2017 05:49 PM, Cecil McGregor wrote:

[...]
What are other people using for a NoSQL racket experience?


Are you looking for no schema or no ACID? If the latter, the git version 
of the db library now has experimental support for Apache Cassandra.


Ryan

--
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] table lookup shorthands?

2017-08-07 Thread Luis Sanjuán
Expanding on what Alex has already point out, you can do something like this:

;; PitchClass is one of
(define C 0)
(define C# 1)
(define D 2)
(define D# 3)
(define E 4)
(define F 5)
(define F# 6)
(define G 7)
(define G# 8)
(define A 9)
(define A# 10)
(define B 11)

;; Interval is Natural
;; number of semitones between two notes
;; assume: ascending intervals
(define FIFTH 7)  ;number of semitones
(define FOURTH 5) ;ditto

;; Direction is "up" or "down"
;; the direction of rotation around a circle of fifths
;; "up" means clockwise (ascending fifths), "down" counterclockwise
;; (descending fifths)

;; PitchClass PitchClass -> Nat
;; produce number of semitones between pc1 and pc2
;; where pc1 is lower than pc2
(define (interval pc1 pc2)
  (modulo (- pc2 pc1) 12))

;; PitchClass Interval -> PitchClass
;; produce the pitch class at the given ascending interval from pc
(define (next pc interval)
  (modulo (+ pc interval) 12))

;; Some 'next' concrete functions, for convenience
(define perfect-fifth (curryr next FIFTH))
(define perfect-fourth (curryr next FOURTH))

;; PitchClass PitchClass Direction -> PitchClass (listof PitchClass) Nat
;; ...
(define (fifths-from-to from to by)
  (define-values (next count)
(if (string=? by "up")
(values perfect-fifth add1)
(values perfect-fourth sub1)))
  (for/fold ([init from]
 [circle-up-to null]
 [fifths# 0])
([i (in-naturals)]
 #:break (equal? init to))
(values (next init)
(append circle-up-to (list init))
(count fifths#

The last function produces as last value the distance in ascending/descending 
fifths as you has hardcoded in the table. There might be better for forms to 
implement the same or you can use another style. Or you can produce something 
simpler like the positive count of fifths/forths, and convert it with another 
function to obtain the representation (positive/negative numbers) you want. As 
a bonus the function produces the actual ascending/descending fifths between 
the initial one (from) up to the final one (to) fifth, not included, it is the 
second value of the result. Anyway, you could pass the result to another 
function to do whatever you like with those values.

The rationale is just that each pitch-class is represented, as usual in music, 
by the way, by an integer from 0 to 11. This makes easier to work on 
intervallics by simple arithmetic. Based on it producing sequences of 
pitch-classes at the same intervallic like the circle of fifths is just a 
matter of generating it recursively. In addition, as a fourth is just the 
inversion of a fifth, you can traverse/generate the circle of descending fifths 
using fourths. 

-- 
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] Anyone using MongoDB 3.2.15 with DrRacket 6.9?

2017-08-07 Thread Cecil McGregor
On Monday, August 7, 2017 at 9:01:39 AM UTC-7, Ryan Culpepper wrote:
> On 08/06/2017 05:49 PM, Cecil McGregor wrote:
> > [...]
> > What are other people using for a NoSQL racket experience?
> 
> Are you looking for no schema or no ACID? If the latter, the git version 
> of the db library now has experimental support for Apache Cassandra.
> 
> Ryan

I was hunting for a no schema solution. I've used MongoDB in the past
with great success and saw it for DrRacket. I'll look into using the
redis package. At my stage of racket experience, I'm not ready to
delve into the source code of MongoDB without spending lots of
time.

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


[racket-users] table lookup shorthands?

2017-08-07 Thread Luis Sanjuán
I forgot to mention that, of course, you can rely on structs as Alex 
recommends, I used just naturals to simplify 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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] table lookup shorthands?

2017-08-07 Thread Luis Sanjuán
EDIT.

In the description of the 'Interval' data type, replace 'notes'  with 
'pitch-classes'

In the signature of the function `interval`, replace 'Nat' with 'Interval'

-- 
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] Re: table lookup shorthands?

2017-08-07 Thread Luis Sanjuán
On Monday, August 7, 2017 at 6:39:58 PM UTC+2, Luis Sanjuán wrote:
> EDIT.
> 
> In the description of the 'Interval' data type, replace 'notes'  with 
> 'pitch-classes'
> 
> In the signature of the function `interval`, replace 'Nat' with 'Interval'

Another one:

In the signature of `fifths-from-to` replace the returned type `Nat` with 
`Integer`

-- 
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] Does anyone have experience with GObject Introspection?

2017-08-07 Thread David Storrs
We're trying to work with the gir module and GOI in general and finding it
pretty heavy going.  Can anyone recommend a really good tutorial on GOI in
general and ideally on using it from Racket?  Also, can anyone explain how
to generate a typelib file?  For the life of me I cannot figure that one
out.

-- 
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] Re: Does anyone have experience with GObject Introspection?

2017-08-07 Thread Greg Trzeciak
On Monday, August 7, 2017 at 8:07:02 PM UTC+2, David K. Storrs wrote:
> We're trying to work with the gir module and GOI in general and finding it 
> pretty heavy going.  Can anyone recommend a really good tutorial on GOI in 
> general and ideally on using it from Racket?  Also, can anyone explain how to 
> generate a typelib file?  For the life of me I cannot figure that one out.

Have you seen https://github.com/mwunsch/overscan ?
One of it's module provides dynamic Racket bindings to GObject Introspection.

-- 
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: table lookup shorthands?

2017-08-07 Thread Philip McGrath
Others have given good reasons to take alternate approaches, but if I were
writing your define-lookup-function macro, I would avoid using a dictionary
type and have the macro expand to `case`, like this:
(define-syntax define-lookup-function
  (syntax-parser
[(_ name:id
[lhs:expr rhs:expr] ...)
 #'(define (name arg)
 (case arg
   [(lhs) rhs] ...
   [else (error 'name (format "no matching clause for ~e"
arg))]))]))

For a pre-made solution, I'd look at match-lambda.

I'm interested to see what you're doing with this code! (I'm a musicology
student when I'm not playing with Racket.)

-Philip

On Mon, Aug 7, 2017 at 1:01 PM, Luis Sanjuán 
wrote:

> On Monday, August 7, 2017 at 6:39:58 PM UTC+2, Luis Sanjuán wrote:
> > EDIT.
> >
> > In the description of the 'Interval' data type, replace 'notes'  with
> 'pitch-classes'
> >
> > In the signature of the function `interval`, replace 'Nat' with
> 'Interval'
>
> Another one:
>
> In the signature of `fifths-from-to` replace the returned type `Nat` with
> `Integer`
>
> --
> 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] Re: Need help porting a library to Typed Racket

2017-08-07 Thread hiphish
Thank you for your response. Right now I cannot implement it because either 
Racket or my package manager (or both) keeps breaking itself, but I will keep 
in mind what you said.

-- 
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] Racket from Homebrew has trouble when upgrading

2017-08-07 Thread hiphish
Hello,

I have had this same problem when I was upgrading Racket from 6.8 to 6.9, and 
now again when upgrading from 6.9 to 6.10. Basically what happens is that raco 
downloads and installs all packages as if they were for the previous version of 
Racket.

I installed Racket as 'brew install minimal-racket' and it installed Racket 
under `/usr/local/Cellar/minimal-racket/6.10/` as expected. Next, I ran `raco 
pkg install --auto drracket` and what happened was that raco downloaded the 
packages for the 6.9 release and installed them under 
`/usr/local/Cellar/minimal-racket/6.9/`. I checked and that directory indeed 
did not exist prior to running raco.

This messes up things because now Racket and raco get confused. At first 
everything runs normally, but after running `raco setup` (to update a package I 
have been developing locally) the symlink to the `raco` binary is gone from 
`/usr/local/bin`. The binary is still there in the `6.10/bin` directory though. 
There is probably even more things messed up, but raco was the first one I 
noticed.

I had the same problem when I was upgrading from 6.8 to 6.9 and I don't know 
what made it go away. Is this a Racket problem or a Homebrew problem? My bet is 
on Racket since the initial installation seems to be proper, but maybe Homebrew 
compiled Racket with the wrong options?

Any ideas what could be going on here? I know that there is a cask, but I 
prefer to install software the Unix way. Thanks in advance.

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


[racket-users] Re: Racket from Homebrew has trouble when upgrading

2017-08-07 Thread hiphish
It seems I got it working now. I deleted `(find-system-path 'config-dir)` and 
`(find-system-path 'addon-dir)`. My bet is that the former was the culprit. 
We'll see about that when 6.11 is released.

-- 
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: Racket from Homebrew has trouble when upgrading

2017-08-07 Thread Shu-Hung You
>From this thread, it seems that the original formula it not actively
maintained. But the thread also mentions `cask`, probably worth a try.
https://groups.google.com/forum/#!msg/racket-dev/Zyl9m8UWvp0/GVDcHVkWAwAJ

Best,
Shu-Hung

On Mon, Aug 7, 2017 at 6:23 PM,   wrote:
> It seems I got it working now. I deleted `(find-system-path 'config-dir)` and 
> `(find-system-path 'addon-dir)`. My bet is that the former was the culprit. 
> We'll see about that when 6.11 is released.
>
> --
> 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.