Re: Alan Kay talk

2012-04-24 Thread Brad Lucas
The link Tim provided is the direct link but it doesn't 'work' unless 
you are already on the site.


I had the same problem.

Try going to the main page for the video here 
http://tele-task.de/archive/lecture/overview/5819/


There is a group of links of which one of is the flash link which will 
then 'work'. Try http://tele-task.de/archive/video/flash/14029/


- Brad

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


ANN: quote-downloader 1.0.0

2012-02-26 Thread Brad Lucas
Yahoo provides downloadable historical quote data if you exercise a
properly formatted URL. The data is returned in CSV format and is
easily stored in a file. I wrote quote-downloader to accept stock
symbols from the command line and request and store the data in
symbol.csv files locally.

The program demonstrates reading from the command line, building a
unique URL and reading from it as well as saving the results to a file
and

The code is on github here
https://github.com/bradlucas/quote-downloader

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


PersistentHashMap vs PersistentArrayMap in Postal Question

2012-03-04 Thread Brad Lucas
I'm using Postal (https://github.com/drewr/postal) and found something
I don't know how to fix.

I have my application working fine if I have a var with my smtp
properties created as follows:

(def smtp-original {:host "foo.com"
  :port 2525
  :user "me"
  :pass "pwd"
  })

Since I want to release my project for others I thought to modify it
to read the smtp values from a Properties file. I used the routine
from Dave Ray's answer on StackOverFlow (http://stackoverflow.com/a/
7781443/406220).

;; Load smtp information out of a file from 
http://stackoverflow.com/a/7781443/406220
(defn load-props
  [file-name]
  (with-open [^java.io.Reader reader (clojure.java.io/reader file-
name)]
(let [props (java.util.Properties.)]
  (.load props reader)
  (into {} (for [[k v] props] [(keyword k) (read-string v)])

This works well in that it returns a Map that looks just like the smtp-
original when reading the following file.

host=foo.com
port=2525
user=me
pass=pwd


The trouble is when I run my app and it calls into Postal I get a
java.lang.ClassCastException.

I notice that the smtp-original created with a def is a
clojure.lang.PersistentHashMap while the return from load-props is a
clojure.lang.PersistentArrayMap.

I looked into Postal but don't see why this matters.

So, I guess I have a few questions.

Can I convert the PersistentArrayMap to a PersistentHashMap? Is this
the right way to go?
Is load-props doing something unusual? It seems fine.
Does anyone understand the internals of Postal? Why would it not work
with the PersistentArrayMap?

Any ideas or pointers would be greatly appreciated. I'm looking to
understand what is going on.

Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: PersistentHashMap vs PersistentArrayMap in Postal Question

2012-03-04 Thread Brad Lucas
That did the trick. Thanks.

Oh and I'll be careful on StackOverflow :)

- Brad


On Mar 4, 12:51 pm, Dave Ray  wrote:
> Brad,
>
> As Kevin points out, because the values in the property file go
> through read-string, they're read as Clojure literals, symbols in this
> case. One solution is to make the string values look like string
> literals to the reader:
>
> host="foo.com"
> port=2525
> user="me"
> pass="pwd"
>
> Try that and never believe anything you read on StackOverflow :)
>
> Dave
>
>
>
>
>
>
>
> On Sun, Mar 4, 2012 at 10:23 AM, Brad Lucas  wrote:
> > I'm using Postal (https://github.com/drewr/postal) and found something
> > I don't know how to fix.
>
> > I have my application working fine if I have a var with my smtp
> > properties created as follows:
>
> > (def smtp-original {:host "foo.com"
> >                      :port 2525
> >                      :user "me"
> >                      :pass "pwd"
> >                      })
>
> > Since I want to release my project for others I thought to modify it
> > to read the smtp values from a Properties file. I used the routine
> > from Dave Ray's answer on StackOverFlow (http://stackoverflow.com/a/
> > 7781443/406220).
>
> > ;; Load smtp information out of a file 
> > fromhttp://stackoverflow.com/a/7781443/406220
> > (defn load-props
> >  [file-name]
> >  (with-open [^java.io.Reader reader (clojure.java.io/reader file-
> > name)]
> >    (let [props (java.util.Properties.)]
> >      (.load props reader)
> >      (into {} (for [[k v] props] [(keyword k) (read-string v)])
>
> > This works well in that it returns a Map that looks just like the smtp-
> > original when reading the following file.
>
> > host=foo.com
> > port=2525
> > user=me
> > pass=pwd
>
> > The trouble is when I run my app and it calls into Postal I get a
> > java.lang.ClassCastException.
>
> > I notice that the smtp-original created with a def is a
> > clojure.lang.PersistentHashMap while the return from load-props is a
> > clojure.lang.PersistentArrayMap.
>
> > I looked into Postal but don't see why this matters.
>
> > So, I guess I have a few questions.
>
> > Can I convert the PersistentArrayMap to a PersistentHashMap? Is this
> > the right way to go?
> > Is load-props doing something unusual? It seems fine.
> > Does anyone understand the internals of Postal? Why would it not work
> > with the PersistentArrayMap?
>
> > Any ideas or pointers would be greatly appreciated. I'm looking to
> > understand what is going on.
>
> > Thanks
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient with 
> > your first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en