Re: Clojure in production

2013-06-13 Thread Zhemin Lin
We use Clojure in some backend services in Trend Micro.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Tortoise-hare algorithm

2013-06-29 Thread Zhemin Lin
Hi.
One of my colleagues gave a share about the cycle detecting tortoise-hare 
algorithm (wiki
).
I translated the script on Wiki from Python to Clojure.
It worked, but not elegant.  I'd like to make it more functional, more 
tasty.
Any suggestions to help it evolve?

I uploaded my (messy) code here: 
https://github.com/miaoski/clojure-tortoise-hare
Thanks a lot! :)

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Tortoise-hare algorithm

2013-06-29 Thread Zhemin Lin
Hi Simone & Cedric,

Thanks for your comment.  In fact, my purpose is to demonstrate to my 
colleagues how Clojure deals with this algorithm.
I'm going to implement the Brent's way.

However, I'm wondering if I can make the Floyd's more functional.
Tail recursion is good, but not good enough to show the "paradigm shift" 
(of functional programming) to my colleagues.

Any ideas?
Thanks! :)

2013年6月30日日曜日 2時58分57秒 UTC+8 Cedric Greevey:
>
> If the function is expensive to compute, you might prefer Brent's 
> periodicity detection algorithm, which instead of 1.5xn invocations of the 
> function only requires n + o(log n) invocations and supposedly detects just 
> as fast.
>
> You store [last-n, last-f, next-n] = [0, f(0), 1] and then, for n = 1 to 
> whatever:
>
> * compute f(n)
> * see if it's equal to last-f; if it is, f is or becomes periodic with a 
> period dividing n - last-n.
> * if n = next-n, change the store to [n, f(n), 2*next-n]
> * move on to f(n + 1).
>
>
>
> On Sat, Jun 29, 2013 at 10:43 AM, Simone Mosciatti 
> 
> > wrote:
>
>> It is very interesting, just a friendly suggestion, if you share code, 
>> and need some help, make sure people can get immediately what is going on.
>> (READ: comment the code)
>>
>>
>> On Saturday, June 29, 2013 1:34:57 PM UTC+2, Zhemin Lin wrote:
>>>
>>> Hi.
>>> One of my colleagues gave a share about the cycle detecting 
>>> tortoise-hare algorithm 
>>> (wiki<http://en.wikipedia.org/wiki/Cycle_detection#Tortoise_and_hare>
>>> ).
>>> I translated the script on Wiki from Python to Clojure.
>>> It worked, but not elegant.  I'd like to make it more functional, more 
>>> tasty.
>>> Any suggestions to help it evolve?
>>>
>>> I uploaded my (messy) code here: https://github.com/**
>>> miaoski/clojure-tortoise-hare<https://github.com/miaoski/clojure-tortoise-hare>
>>> Thanks a lot! :)
>>>
>>>  -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@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+u...@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 unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




first vals first vals

2013-11-21 Thread Zhemin Lin
Hi.
I'm quite annoyed by the ugly smell of (first (vals (first ... )).  Is 
there any better way to do it?

user=> (-> {:key1 {:cf {:cq "0,1,2,3"}}} vals first vals first vals first 
(clojure.string/split #","))
["0" "1" "2" "3"]


Thanks a lot!

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: first vals first vals

2013-11-21 Thread Zhemin Lin
Thanks, John & Jernau.
What if :cf, :cq are not fixed, and I don't really care about the keys, but 
only the value of the value of the value ...?


Thanks,
Zhemin.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: first vals first vals

2013-11-21 Thread Zhemin Lin
Wow, that's really cool!
Thanks a lot, John!

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Why I'm giving Clojure a try

2014-04-16 Thread Zhemin Lin
Hi Massimiliano,
You may also want to give ClojureScript or LiveScript (which compiles to 
JavaScript and run on node.js) a try!
LiveScript is quite functional and the callback hell is somewhat eased.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ANN lein-daemon, lein-test-out

2013-05-17 Thread Zhemin Lin
Hey guys,

Thank Allen Rohner for his lein-test-out.
If you're using Leiningen 2 as well as I do and got some problem, please 
feel free to check out my branch at https://github.com/miaoski/lein-test-out 
before 
he has time to merge the pull request.
In Trend Micro, we use Hudson and automated unit tests & report generation 
is thus important.
Easy to do that with lein-test-out + Ring/Mock.
Great to stand on the shoulders of giants :)

Zhemin.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: community interest in machine learning (?)

2012-07-19 Thread Zhemin Lin
Hi Joshua,

I've taken Andrew Ng's courses, too.  Wonder where have they shared the 
source code in Clojure?
I've done all the exercises in Octave.  It would be great to study how to 
do it in Clojure.

Thanks!


2012年7月16日月曜日 22時24分36秒 UTC+8 Joshua Bowles:
>
> Incanter does look great; look forward to getting into it; I'll check out 
> your mahout examples too... I'm about ready to tear into that book.
>
> So much research has been done in Artificial Intelligence with LISP. With 
> the applied history of LISP it just seems like a perfect fit for Clojure to 
> take the lead in many AI sub-fields. I know also that a few people taking 
> Andrew Ng's (online) Machine Learning Class did it in Clojure. 
>
>
>

-- 
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