Exercise: words frequency ranking

2008-12-25 Thread Piotr 'Qertoip' WĹ‚odarek
Given the input text file, the program should write to disk a ranking of words sorted by frequency, like: the : 52483 and : 32558 of : 23477 a : 22486 to : 21993 My first implementation: (defn topwords [in-

Re: Help with Slime

2008-12-25 Thread Emeka
Kugo, Please send me your code and instructions of what you did to get where you are? I am even far behind, however, I use windows. Emeka On Wed, Dec 24, 2008 at 5:47 PM, kogu wrote: > > Hi, > > This is not clojure related but Slime/Emacs related. > > I am using Slime/Emacs/Clojure Mode/Swank

Re: Exercise: words frequency ranking

2008-12-25 Thread Mibu
My version: (defn top-words [input-filename result-filename] (spit result-filename (apply str (map #(format "%s : %d\n" (first %) (second %)) (sort-by #(-(val %)) (reduce #(conj %1 { %2 (inc (%1 %2 0)) }) {}

Re: Exercise: words frequency ranking

2008-12-25 Thread wwmorgan
A better implementation would split the different steps of the program into separate functions. This increases readability and testability of the source code, and encourages the reuse of code in new programs. I haven't tested this program, but hopefully you'll understand the general approach. Als

Re: Exercise: words frequency ranking

2008-12-25 Thread Meikel Brandmeyer
Hi, Am 25.12.2008 um 17:24 schrieb wwmorgan: A better implementation would split the different steps of the program into separate functions. This increases readability and testability of the source code, and encourages the reuse of code in new programs. Yes. One can think of the data flowing

Re: Proxying in clojure

2008-12-25 Thread Emeka
Snake frame would appear with square ball that moves and another that does not move.Below is what I got each time I try to play with arrow keys. I count on you as always to come to my help. user=> (require 'snake) nil user=> (snake/run-snake)nil user=> Exception in thread "AWT-EventQueue-0" ja

Re: Proxying in clojure

2008-12-25 Thread Chouser
On Thu, Dec 25, 2008 at 5:52 PM, Emeka wrote: > Exception in thread "AWT-EventQueue-0" > java.lang.UnsupportedOperationException: keyReleased It was to avoid this exception that my version included an empty implementation of keyReleased. --Chouser --~--~-~--~~~---~-

Re: Help with Slime

2008-12-25 Thread kogu
Hi, Ok. you need all stuff below, might be redundant, but still. I would recommend getting everything from VCS, except emacs perhaps. 1. GNU Emacs 2. Slime 3. Clojure 4. Clojure mode 5. Swank Clojure Below is the relevant part of my init.el. Change paths. Let me know if you are stuck somewhere.