Re: Working with a huge graph - how can I make Clojure performant?

2013-03-28 Thread Balint Erdi
. On Thursday, March 28, 2013 2:22:44 AM UTC+1, Stephen Compall wrote: On Mon, 2013-03-11 at 10:37 -0700, Balint Erdi wrote: (let [neighbors (persistent! (reduce (fn [c u] (if (explored u) c (conj! c u

Re: Working with a huge graph - how can I make Clojure performant?

2013-03-28 Thread Balint Erdi
PM UTC+1, Balint Erdi wrote: Yes, that's definitely a good idea. I tried a few other things (including that, I think) after I posted that but nothing really worked and it turned out that the tail-recursive version even had a bug. I couldn't find a way to really keep the amount of copying

Working with a huge graph - how can I make Clojure performant?

2013-03-11 Thread Balint Erdi
Hey, I got an assignment to implement an algorithm to calculate strongly connected components in a graph ( http://en.wikipedia.org/wiki/Kosaraju's_algorithm). The graph is rather big, it has ~900.000 vertices. In its first pass, it needs to do a depth-first search on the graph and

Re: how would you implement sending out a verification email?

2013-02-21 Thread Balint Erdi
itself fails then the transaction rolls back like always. On Wednesday, February 20, 2013 9:32:14 AM UTC-5, Balint Erdi wrote: Hey, So yesterday we discussed concurrency at our meetup ( http://www.meetup.com/Budapest-Clojure-User-Group/) and a question occurred to me. Suppose we have

how would you implement sending out a verification email?

2013-02-20 Thread Balint Erdi
Hey, So yesterday we discussed concurrency at our meetup (http://www.meetup.com/Budapest-Clojure-User-Group/) and a question occurred to me. Suppose we have a classic web application. (I'm not currently building such a web app in Clojure, so that's a theoretical question). When the user

Clojure user group in Budapest just launched

2013-01-11 Thread Balint Erdi
Hey, Delighted to announce that the Budapest Clojure Group has just launched: http://www.meetup.com/Budapest-Clojure-User-Group/ The official language is English so consider joining/attending if you're from a relatively close city but don't speak Hungarian (Bratislava Vienna come to mind).

Re: Clojure user group in Budapest just launched

2013-01-11 Thread Balint Erdi
Great, just sent the pull request. On Friday, January 11, 2013 at 4:03 PM, Michael Klishin wrote: 2013/1/11 Balint Erdi balint.e...@gmail.com (mailto:balint.e...@gmail.com) Delighted to announce that the Budapest Clojure Group has just launched: http://www.meetup.com/Budapest-Clojure

Re: group-by vs. reducers?

2012-12-07 Thread Balint Erdi
Hey, Reducers is fascinating and quite complex at the same time. I feel like best practices around it has not quite solidified yet. Here is how I made your example work: (ns group-by-reducers.core (:require [clojure.core.reducers :as r :only [fold reduce map]]) (:require [criterium.core

Re: group-by vs. reducers?

2012-12-07 Thread Balint Erdi
BTW I understood the most about reducers (still not quite there yet, though :) ) from Rich Hickey's talk at EuroClojure: https://vimeo.com/45561411 On Friday, December 7, 2012 10:21:59 AM UTC+1, Balint Erdi wrote: Hey, Reducers is fascinating and quite complex at the same time. I feel like

Re: group-by vs. reducers?

2012-12-07 Thread Balint Erdi
: 728.19 msecs Elapsed time: 475.543 msecs Run 3 Elapsed time: 657.255 msecs Elapsed time: 725.995 msecs Elapsed time: 494.038 msecs Run 4 Elapsed time: 647.53 msecs Elapsed time: 731.085 msecs Elapsed time: 538.649 msecs hth, Christophe On Fri, Dec 7, 2012 at 10:30 AM, Balint Erdi

Re: confused about the scope of variables, or is it something else? ClojureScript

2012-12-04 Thread Balint Erdi
As Sean suggested you should use doseq instead of for and map to force side-effects: http://clojuredocs.org/clojure_core/clojure.core/doseq Since doseq uses the exact same syntax as for, you should just write doseq in its place. map should be converted to doseq syntax, too. Balint On Monday,

Starting a Clojure user group in Budapest

2012-11-27 Thread Balint Erdi
Hey, I've grown extremely enthusiastic about Clojure (and still growing more and more :) ) and would like to spread the love around here in Budapest, Hungary. This is to estimate how many people are interested in attending a monthly meetup where we'd have presentations, code dojos, etc, so

Re: what is the simplest user auth system possible?

2012-10-29 Thread Balint Erdi
If you share your pc with your brother then using the classic one username/password per site you'd have to log out and back in on each site you want to use (or use another browser/incognito window, etc.) With Persona you only have to do this once. On Sunday, October 28, 2012 9:05:20 PM UTC+1,

strange pattern to implement comp, juxt and partial

2012-10-02 Thread Balint Erdi
Hey, When browsing through clojure.core I noticed something peculiar in the implementation of comp, juxt and partial. All three share the same implementation pattern. They define separate methods for the arity of 0,1,2,3 and any. For example in juxt: (defn juxt (…) ([f g] (fn

Re: strange pattern to implement comp, juxt and partial

2012-10-02 Thread Balint Erdi
Makes sense but why don't we have it in all possible places then? Thank you. On Tuesday, October 2, 2012 9:55:42 PM UTC+2, Herwig Hochleitner wrote: That is because dispatch on argument count is fast, while apply is slow. Especially so since it might have to create an intermediate seq. It's

Re: strange pattern to implement comp, juxt and partial

2012-10-02 Thread Balint Erdi
guess is that it's useful in the core functions which are more heavily used. Otherwise you're getting into premature optimization if you use it in any of your own functions without profiling it first. On Tue, Oct 2, 2012 at 4:18 PM, Balint Erdi balin...@gmail.comjavascript: wrote: Makes

Re: The Value of Values

2012-08-25 Thread Balint Erdi
I'd like to read that thread, can you provide a url? Thank you, Balint On Saturday, August 25, 2012 2:41:40 AM UTC+2, Bost wrote: See the thread The Value of Values started by Conrad Barski -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: recursion question

2012-08-15 Thread Balint Erdi
This is the classic Subset sum problem (http://en.wikipedia.org/wiki/Subset_sum_problem) and is an NP one. I've implemented the pseudo-polynomial dynamic programming solution found on the above Wikipedia page: https://gist.github.com/3359504 It returns the indexes of the elements that give the