Re: Mock db data for unit tests

2014-03-07 Thread Alex Robbins
It looks like the issue is that korma.core/select is a macro, and has already expanded by the time you redef it. https://github.com/korma/Korma/blob/master/src/korma/core.clj#L113 On Fri, Mar 7, 2014 at 12:59 PM, Mark Watson wrote: > I have a web service that uses Korma for interacting with my

Re: cljsbuild dev/release, different debug levels

2014-04-03 Thread Alex Robbins
If you used cljx, you could probably use the feature expressions to do what you want. https://github.com/lynaghk/cljx You'd need to set up a custom rule for it, but it seems well within the scope of the project. On Thu, Apr 3, 2014 at 8:50 AM, t x wrote: > Hi, > > I'm trying to figure out h

Re: Is it possible to give an atomic message?

2014-04-11 Thread Alex Robbins
You could do this with core.async. Make a channel that takes messages, and then run a go loop that pulls messages off the message channel and prints them. Then only one part of the program is ever printing. Any other part that wants to print a message can push onto the channel. On Fri, Apr 11,

Re: Kwargs vs explicit parameter map for APIs?

2014-04-30 Thread Alex Robbins
Maybe they want config in the least variance argument so it can be partial'ed? On Wed, Apr 30, 2014 at 10:03 AM, Jim Crossley wrote: > We used kwargs for options extensively in Immutant 1.x, and we're moving > to explicit maps for Immutant 2.x, for the reasons cited above. > > It's not obvious

Re: java.lang.OutOfMemoryError when slurping lots of files?

2013-04-05 Thread Alex Robbins
Slurp reads the entire file into memory. Maybe it is a combination of a) the program taking up more of the heap in other parts as it runs and then b) a particularly large file? Is there a reason you can't process the files as a line-seq so you don't have to load the entire thing into memory all at

Re: More idiomatic way to find the first non-nil function result?

2013-05-01 Thread Alex Robbins
This is similar to, but not exactly the same, as some-fn. Maybe the source of that could guide you? http://clojuredocs.org/clojure_core/clojure.core/some-fn On Wed, May 1, 2013 at 11:13 AM, Steven Degutis wrote: > I've found myself writing a validator function. > > It has a list of internal va

Re: [ANN] nrepl.el 0.1.6 released

2013-01-30 Thread Alex Robbins
Thanks for your great work on this! On Tue, Jan 29, 2013 at 9:07 PM, Tim King wrote: > I am pleased to announce that nrepl.el v0.1.6 has been released, and is > now available on marmalade. > > Preview versions of the next release are available on Melpa. > See the Readme on github (https://githu

Re: what on earth is happening?

2013-02-28 Thread Alex Robbins
Maybe you are already doing this, but as soon as I get into "This doesn't seem possible" territory, I run a "lein clean". That has resolved the problem for me several times. On Thu, Feb 28, 2013 at 9:01 AM, Jim foo.bar wrote: > On 28/02/13 14:34, Marko Topolnik wrote: > > So it makes sense tha

Re: Loading a huge graph

2012-04-12 Thread Alex Robbins
Yeah, sounds like it could definitely be a memory issue. This is one part where the JVM works a lot differently than I expected coming from a python background. Everybody may already know this, but the JVM only takes 64mb for the heap by default. You'll get an out of memory error if your program u

Re: Assuring avalaibility of ring web apps

2012-05-16 Thread Alex Robbins
You could probably use upstart or supervisord. Upstart is available if you are on a newish ubuntu system (and maybe others?). Supervisord could run on most linuxes I think, although I've only ever used it on ubuntu. Hope that helps, Alex On Wed, May 16, 2012 at 2:13 AM, Murtaza Husain wrote: >

Re: If Using nth Creates Dependencies, What Is The Best Way To Pull Data Elements From A Sequence

2012-05-18 Thread Alex Robbins
I wonder if the idea was that you are better off using a hash-map and key lookups so the positions are labeled. Some csv libs return a seq of maps where the keys are the column header values. That way you'd be able to select data by name instead of a sometimes arbitrary position. Just a guess. Ale

Core.logic, dynamically generated goals

2012-05-19 Thread Alex Robbins
I'm just getting started with logic programming, and it is entirely possible I'm just approaching this incorrectly. Is it possible to use dynamically generated goals in run* ? For example, (defrel grade person course g) (fact grade 'Bob 'Algebra 'B) (fact grade 'Bob 'Art 'C) (fact grade 'John 'A

Re: Core.logic, dynamically generated goals

2012-05-19 Thread Alex Robbins
gt; > (defn matches [{:keys [course g]}] >   (run* [q] >     (fresh [p] >       (grade p course g) >       (== q [p course g] > > (matches {:course 'Algebra :g 'B}) > > On Sat, May 19, 2012 at 2:12 PM, Alex Robbins > wrote: >> >> I'm just g

Re: Core.logic, dynamically generated goals

2012-05-19 Thread Alex Robbins
_ (run* [person] >      (meets-requirements >       person >       [{:course 'Algebra :g 'B} >        {:course 'Art :g 'C}])) > > > On Saturday, 19 May 2012 15:07:47 UTC-4, Alex Robbins wrote: >> >> Hmm, I didn't explain it very well. Wh

Re: Core.logic, dynamically generated goals

2012-05-22 Thread Alex Robbins
Good to think about. Thanks Brian. On Sun, May 20, 2012 at 5:44 PM, Brian Marick wrote: > > On May 19, 2012, at 1:12 PM, Alex Robbins wrote: > >> Is it possible to use dynamically generated goals in run* ? > > You might want to think macros. I have written macros that twea

Re: critique my code!

2012-07-06 Thread Alex Robbins
Reading through your code, many of your functions have large cond or condp clauses. Sometimes those can be replaced with multimethods. They let you define all the options to a choice as separate functions, and add extra choices later without touching the rest of your code. At the same time, they ad

Re: Clojure group in DFW area

2012-08-09 Thread Alex Robbins
The group hasn't met in a long time, but we were actually talking about some kind of a relaunch last week. We were hoping some Clojure interest had increased in the DFW area since we tried last time. Anyone else in the DFW area interested in getting together? Alex On Tue, Aug 7, 2012 at 11:09 AM,

Re: Clojure group in DFW area

2012-08-28 Thread Alex Robbins
orks for me. > > On Thursday, March 10, 2011 7:28:10 AM UTC-6, Alex Robbins wrote: >> >> Anyone else in the north Dallas area using/interested in Clojure? I'd >> love to get together. >> >> Alex > > -- > You received this message because you are su

Re: Clojure group in DFW area

2012-08-29 Thread Alex Robbins
Ok, the meetup group is setup and the meetup location is confirmed. http://www.meetup.com/DFW-Clojure/ I look forward to seeing everyone in person. Alex On Tue, Aug 28, 2012 at 1:00 PM, Alex Robbins wrote: > Hey guys, sorry about the radio silence. Unofficially, it looks like > the

Clojure group in DFW area

2011-03-10 Thread Alex Robbins
Anyone else in the north Dallas area using/interested in Clojure? I'd love to get together. Alex -- 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 modera

Clojure Meetup at Pycon

2011-03-10 Thread Alex Robbins
Hey guys, I'm pretty new to Clojure and loving it. I'm going to be at Pycon (the Python conference in Atlanta) this weekend. Any other clojurers going to be there? Want to meet and chat about our two favorite languages? Alex -- You received this message because you are subscribed to the Google

Re: RabbitMQ

2011-03-24 Thread Alex Robbins
According to http://www.clojure-toolbox.com/ https://github.com/mefesto/wabbitmq But I'm pretty new to clojure and don't know if it is good. On Thu, Mar 24, 2011 at 10:30 AM, Mark Rathwell wrote: > > I just wrapped their java client library: > http://www.rabbitmq.com/java-client.html > > On Thu

Re: Fun: Write the fastest code that flattens nested maps of a particular type

2011-04-13 Thread Alex Robbins
That has tricked me before. The lazy one is fastest because all you are timing is the creation of the lazy seq, not its realization. Wrap the lazy seq in a doall inside the time macro. On Wed, Apr 13, 2011 at 12:59 PM, babui wrote: > I was asking because my timings show that the lazy version is t

Re: Clojure group in DFW area

2011-04-14 Thread Alex Robbins
wrote: > I live in Fort Worth and work in Addison. I'd love to get together > sometime. If there is any interest in getting a user group together, I > have the perfect place to host it. > > On Mar 10, 8:28 am, Alex Robbins > wrote: >> Anyone else in the north Dallas are

Re: Open Source Projects for Beg/ Intermediate

2011-04-15 Thread Alex Robbins
I'm learning Clojure also, and have been working through some of the project euler problems. (Got started on it from the labrepl introduction.) It has been a lot of fun and I think I'm learning a fair amount about how the language works. http://projecteuler.net/index.php?section=problems I've got

Re: Clojure group in DFW area

2011-04-20 Thread Alex Robbins
ully there are more than two clojure users in Dallas. >> >> >> >> On Wed, Apr 13, 2011 at 3:44 PM, J.R. Garcia wrote: >> > I live in Fort Worth and work in Addison. I'd love to get together >> > sometime. If there is any interest in getting a user group

Re: Clojure group in DFW area

2011-04-25 Thread Alex Robbins
ls of the group, > etc. > > On Mar 10, 8:28 am, Alex Robbins > wrote: >> Anyone else in the north Dallas area using/interested in Clojure? I'd >> love to get together. >> >> Alex > > -- > You received this message because you are subscribed to the Goo

Re: What role does ? operator play?

2011-05-19 Thread Alex Robbins
? isn't an operator, it is part of a function's name. user=> (doc pos?) - clojure.core/pos? ([x]) Returns true if num is greater than zero, else false nil user=> Hope that helps! Alex On Thu, May 19, 2011 at 8:09 AM, octopusgrabbus wrote: > Given the following function

Re: Clojure group in DFW area

2011-05-20 Thread Alex Robbins
I'm planning to be there. Alex -- 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

Re: List comprehension and sets

2011-05-24 Thread Alex Robbins
What is the difference between (into #{} (for x..)) and (set (for x ..)) Is one preferred? Thanks! Alex On Tue, May 24, 2011 at 11:20 AM, Mark Engelberg wrote: > Scala's approach to comprehensions is to automatically produce the > same type of collection that is used first in your compre

Re: library or namespace doc helper function from repl?

2011-06-02 Thread Alex Robbins
(ns-publics 'namespace) will show all the publicly defined things in a namespace. On Thu, Jun 2, 2011 at 11:51 AM, Avram wrote: > > Apologies for a silly question, there must be a simple way to do this > from the repl, but I can't seem to find it… > > Is there a way from the repl to view all avai

Re: library or namespace doc helper function from repl?

2011-06-02 Thread Alex Robbins
e. > -A > > > On Jun 2, 10:22 am, James Estes wrote: >> You could also try >> (find-doc "libname") >> >> On Thu, Jun 2, 2011 at 11:15 AM, Alex Robbins >> >> >> >> wrote: >> > (ns-publics 'namespace) will show all

Re: Free Compojure Hosting? (or mostly free)

2011-06-08 Thread Alex Robbins
You can also put stuff up on the java part of Google App Engine. It is pretty easy with this project: https://github.com/gcv/appengine-magic You have a limit of ten apps per user, but it works for just getting stuff up to play with. Alex On Tue, Jun 7, 2011 at 11:37 PM, Sean Corfield wrote: > I t

Re: Best Way To Extract Data From Lazy Sequence

2011-06-28 Thread Alex Robbins
If you are trying to get the 6th row, you might use the "nth" function. It allows you to grab an element based on its index. That'd be better than tons of (next (next (next rows))) stuff. user=> (doc nth) - clojure.core/nth ([coll index] [coll index not-found]) Returns th

Re: Alternative structures to arrays?

2011-12-22 Thread Alex Robbins
Hey Simon, Incanter is a clojure data processing platform (R-like). http://incanter.org/ It wraps Parallel Colt, a Java matrix math/linear algebra library, among other things. Parallel colt provides sparse matrices, and I *guess* they are exposed in the clojure wrapper. https://sites.google.com/si

Re: Must a page refresh fire an init event?

2012-01-22 Thread Alex Robbins
Not sure what you are planning to do with the data, but you shouldn't trust data in cookies. It is trivial to edit the cookies in your browser using something like FireCookie [1] Cookies are fine for storing form info, or something like that, but you wouldn't want to store something like admin=tr