Re: how to packge lein project in a maven-style?

2014-01-06 Thread Qiu Xiafei
on, Jan 6, 2014 at 12:33 AM, Qiu Xiafei wrote: > >> >> >> Using maven, we usually package the project in a directory with sub dirs >> like: >> bin/ # bash/python scripts >> lib/ # all jars >> conf/ # resources/configuration files >> &g

how to packge lein project in a maven-style?

2014-01-05 Thread Qiu Xiafei
Using maven, we usually package the project in a directory with sub dirs like: bin/ # bash/python scripts lib/ # all jars conf/ # resources/configuration files And, we often use the *maven-dependency-plugin* to copy dependency jars and use the *maven-resources-plugin* to copy scripts an

Re: newbie question: how to include external libraries from Leiningen REPL

2013-11-07 Thread Qiu Xiafei
you may have a look at alembic: https://github.com/pallet/alembic -- -- 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

Re: How to type hint a String array?

2013-10-09 Thread Qiu Xiafei
Thanks, Jim. On Wed, Oct 9, 2013 at 9:27 PM, Jim - FooBar(); wrote: > On 09/10/13 14:12, Jim - FooBar(); wrote: > >> ps: also, non-primitive arrays are hinted like this if I'm not mistaken: >> #^"[Ljava.lang.String;" >> > > actually you can use both #^ & ^ in regular 'defn' > > Jim > > > > > > >

How to type hint a String array?

2013-10-09 Thread Qiu Xiafei
Clojure provide built-in type hint for primitive types such as: ^ints, ^doubles, but how to type hint an array of arbitrary Class? The following way dosn't work, too: user=> (definterface MyInterface #_=> (^"[Ljava.lang.String" method1 [])) user.MyInterface user=> (.method1 (reify MyInterfa

Ambiguous error message with lazy sequence.

2013-08-06 Thread Qiu Xiafei
I have a test.clj file like the following: $ cat test.clj (defn some-lazy-seq [n] (lazy-cat (concat n;; should be [n] here (some-lazy-seq (inc n) (println (take 100 (some-lazy-seq 0))) It's obviously wrong on line 3, the concat function shoud take a seq as

Re: Get digits of a number

2013-01-20 Thread Qiu Xiafei
yes... it would be better. On Sun, Jan 20, 2013 at 2:30 AM, David Brown wrote: > Qiu Xiafei writes: > > > (defn num->digits > > [num] > > (loop [n num res []] > > (if (zero? n) > > res > > (recur (long (/ n 10)) (cons (mod n 10)

Re: Get digits of a number

2013-01-19 Thread Qiu Xiafei
(defn num->digits [num] (loop [n num res []] (if (zero? n) res (recur (long (/ n 10)) (cons (mod n 10) res) 在 2011年2月17日星期四UTC+8下午1时29分10秒,Andreas Kostler写道: > > Is there an easy and idiomatic way of getting the digits of a number in > clojure? > > (defn explode-to-digits

Re: Searching for a picture

2012-12-28 Thread Qiu Xiafei
good job!! thanks a lot! On Fri, Dec 28, 2012 at 9:39 PM, Mayank Jain wrote: > Nice :) > > On Fri, Dec 28, 2012 at 3:26 PM, Sébastien Wagener > wrote: > > Hi, you probably mean this: > > http://machinegestalt.posterous.com/if-programming-languages-were-cars > >

Searching for a picture

2012-12-27 Thread Qiu Xiafei
I'am preparing an introduce of clojure to my colleague. I remember that there's a picture showing that clojure = java + lisp, the picture must be a good example in my keynote, I think I should refer to it. In that picture, java is like a powful SUV with very big wheels, lisp is like a cool sedan wi

[ANN] zk-web 1.0 release

2012-11-18 Thread Qiu Xiafei
zk-web is a Web UI of Zookeeper , just making it easier to use. It helps you read stat and data of a zookeeper node, and logged in user can add/modify/delete/rmr a node. I hope zk-web could help you. zk-web is hostd on github: https://github.com/qiuxiafei/zk-web This

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-22 Thread Qiu Xiafei
p.s. I think idea + la enclosure works quite wellwhy beginners are always introduced to emacs solution? On Sat, Jun 23, 2012 at 4:45 AM, fenton wrote: > Hi Brad, I've updated my doc with your questions. Here is how I responded > to your particular queries. Note the answer may not be correc

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-13 Thread Qiu Xiafei
how about add something about auto completion, it's pretty useful for working around large project or java interop. On Thu, Jun 14, 2012 at 9:27 AM, fenton wrote: > I totally understand the value of having a single source of truth (DRY > principle). My main problem was that to get from 0-60 for

Slow 'quick sort'

2012-06-08 Thread Qiu Xiafei
I wrote a quick sort function in clojure, but it runs extremely slow. Sometimes, if the input collection grows lager, it may even overflow the stack? Anything wrong with my code? (defn qsort [coll] (if (<= (count coll) 1) coll (let [pivot (last coll) head-half (filter #(< % pi

Re: question with macro!

2012-05-02 Thread Qiu Xiafei
all function arguments will be evaluated so, 123 was printed On Thu, May 3, 2012 at 4:06 AM, thomas wrote: > the arguments to randomly-fn are evaluated before the macro-expansion of > randomly kicks in. > (that's what macros are for: control if, where and how often an expression > is evalua

Re: How Do I Install New Version Of Clojure?

2012-04-15 Thread Qiu Xiafei
I advice you download the clojure package from clojure.org, and unzip it. Then you can put it to any where you want. Finally, write a shell script named clojure, and put the script to $PATH #! /bin/sh java -cp /path/to/your/downloaded/clojure.jar clojure.main On Sun, Apr 15, 2012 at 1:45 PM, Anto

Re: Practical Clojure

2012-04-14 Thread Qiu Xiafei
how about Programming Clojure? I am reading it as a start point of learn clojure On Sat, Apr 14, 2012 at 4:52 PM, faenvie wrote: > light table looks like a candidate for the book ... > btw 'professional clojure' is not a good title ... better: 'beyond > clojure' ? etc. > > -- > You received this