Re: query on clojure maps / vectors

2014-02-13 Thread David Jagoe
Here's an example: http://www.bagdemir.com/2013/07/30/implementing-relational-algebra-in-clojure/ On 13 February 2014 18:32, David Jagoe wrote: > Would this work for you? > > http://clojure.github.io/clojure/clojure.set-api.html > > (in particular select for your example)

Re: query on clojure maps / vectors

2014-02-13 Thread David Jagoe
u 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. > -- David Jagoe davidja

Re: Using lein in upstart init script

2013-02-06 Thread David Jagoe
On 6 February 2013 14:40, Phil Hagelberg wrote: > > You can use an uberjar without AOT; just use something like this: > > $ java -cp my-uberjar.jar clojure.main -m my.namespace 8080 > Excellent, thanks. -- -- You received this message because you are subscribed to the Google Groups "Clojur

Using lein in upstart init script

2013-02-06 Thread David Jagoe
t; I get "respawning too fast" from upstart. Any ideas on how to do this? Thanks, David -- David Jagoe davidja...@gmail.com +18053284389 -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Re: core.match - how to simplify patterns with repeated guards

2012-11-14 Thread David Jagoe
I hope that helps! > > -- > 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 >

core.match - how to simplify patterns with repeated guards

2012-11-13 Thread David Jagoe
to do with the fact that match itself is a macro? Is there some other way that I could extend match to only match when the variable is not nil? Thanks, David -- David Jagoe davidja...@gmail.com +18053284389 -- You received this message because you are subscribed to the Google Groups "

Dynamically building SQL queries with core.match & dynamic variables

2012-11-13 Thread David Jagoe
(format "AND t.date >= '%s'::timestamp" from) (format "AND t.date < '%s'::timestamp" to)) :else (throw (Exception. "Illegal combination") (defn drilling-aggregates [&

Re: Clojure turns 5

2012-10-16 Thread David Jagoe
bscribe 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 -- David Jagoe davidja...@gmail.com +18053284389 -- You received this message because you are subscribed to the Google Gr

Re: Announcing dyscord

2012-07-02 Thread David Jagoe
roup, 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.go

Re: a library I'm working on for generating PDFs from Clojure

2012-04-22 Thread David Jagoe
On 21 April 2012 14:41, Dan Cross wrote: > On Sat, Apr 21, 2012 at 6:20 AM, David Jagoe wrote: > > Can anybody tell me whether wkhtmltopdf or flying-saucer deal with > > pagination properly? I've been templating TeX to get properly laid out > > tables broken over mul

Re: a library I'm working on for generating PDFs from Clojure

2012-04-21 Thread David Jagoe
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 > -- David Jagoe davidja...@gmail.com +447535268218 -- You received this message because you are subscribed to the

Re: Inconsistency of dissoc on maps vs records?

2012-04-20 Thread David Jagoe
On 20 April 2012 07:38, Mark Engelberg wrote: > On Thu, Apr 19, 2012 at 11:31 PM, David Jagoe wrote: > >> >> Out of curiosity, why is this useful to you? >> > > It certainly has performance benefits. > > When things are tested for equality (e.g., to test agai

Re: Inconsistency of dissoc on maps vs records?

2012-04-19 Thread David Jagoe
agine that the fact that it works like that for maps at the moment is an implementation detail that you shouldn't rely upon. dissoc[iate]. Returns a new map of the same (hashed/sorted) type, that does not contain a mapping for key(s). -- David Jagoe davidja...@gmail.com +447535268218 -- Y

Re: ClojureCLR on .net compact?

2012-04-19 Thread David Jagoe
> On Thursday, April 19, 2012 3:11:02 AM UTC-5, David Jagoe wrote: >> >> Hi all, >> >> Does anyone know whether I can run ClojureCLR on .net compact? >> Specifically I would need to run it on Windows CE. Currently the >> application is written in C# which work

Re: a library I'm working on for generating PDFs from Clojure

2012-04-19 Thread David Jagoe
ns are welcome. > > -- > 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 pos

ClojureCLR on .net compact?

2012-04-19 Thread David Jagoe
Hi all, Does anyone know whether I can run ClojureCLR on .net compact? Specifically I would need to run it on Windows CE. Currently the application is written in C# which works ok, but I need to rewrite it and I'm deciding between C#, F# and ClojureCLR. Thanks, David -- David Jagoe da

Re: Advice on style & implementation

2012-04-04 Thread David Jagoe
gt; On Apr 4, 6:50 am, David Jagoe wrote: >> Particularly I very often find myself doing >> >> (apply hash-map (flatten (for [[k v] some-map] ...))) > > :( :( :( flatten is vile, never use it[1]. What if the value in the > map is a list, or the key is a vector? Now yo

Re: Advice on style & implementation

2012-04-04 Thread David Jagoe
gt; 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 a

Advice on style & implementation

2012-04-04 Thread David Jagoe
k (apply (agg k) vs)]) Thanks, -- David Jagoe davidja...@gmail.com +447535268218 -- 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

Re: Where to post job ad

2012-04-02 Thread David Jagoe
Thank you all for your feedback. I will certainly post in local user groups and Functional Jobs + Linked In are my next stops. Cheers, David On 30 March 2012 21:49, blcooley wrote: > > > On Mar 30, 7:35 am, David Jagoe wrote: >> G'day everyone >> >> I am inc

Clojure Job in Bellingham/Seattle WA

2012-04-02 Thread David Jagoe
are making fuzzy decisions in place of human operators. -- David Jagoe davidja...@gmail.com +447535268218 -- 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 mem

Where to post job ad

2012-03-30 Thread David Jagoe
G'day everyone I am increasingly relying on clojure and plan to use clojureclr and clojurescript in production too. I will soon need to hire a clojure developer and was hoping that someone could suggest a good place to post a job ad. I've never seen a job posted here but I would like to reach the

Re: partition-distinct

2012-03-30 Thread David Jagoe
On 29 March 2012 21:41, Cedric Greevey wrote: > > On Thu, Mar 29, 2012 at 4:18 PM, David Jagoe wrote: > > Given a sequence like this: [1 2 1 2 1 1 2 1 2 2 2] > > > > partition it to get this: [(1 2) (1 2) (1) (1 2) (1 2) (2) (2)] > >! > > (defn partition-

partition-distinct

2012-03-29 Thread David Jagoe
want to be able to deal with more than 2 distinct values. Thanks! -- David Jagoe davidja...@gmail.com +447535268218 -- 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 p

Re: Clojure in Python

2012-03-01 Thread David Jagoe
d. I've done a lot of advanced Python programming so unlike Java I understand the language well. I'll start by getting my head around the code. Cheers! David -- David Jagoe davidja...@gmail.com +447535268218 -- You received this message because you are subscribed to the Google Groups &

Re: [ANN] s3-wagon-private

2012-01-01 Thread David Jagoe
ups "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 > Fo

Re: ClojureQL & Postgres question

2011-08-21 Thread David Jagoe
On 19 August 2011 17:25, Herwig Hochleitner wrote: > This is a bug in `rename`. > That needs to be worked on, thanks for pointing it out. > In the meantime, please use >    (-> (table nil :users) >         (project [[:id :as :idx] >                     :name]) >         to-sql) > in the meantime.

ClojureQL & Postgres question

2011-08-17 Thread David Jagoe
Hi All, Could someone with experience in clojureql + postgres tell me if this works: clojureql.core> (-> (table nil :users) (project [:id :name]) (rename {:id :idx}) to-sql) "SELECT users.id,users.name FROM users A

Re: Example of a real-world ClojureScript web application

2011-08-09 Thread David Jagoe
Thank you for making this available! On 10 August 2011 02:53, Filip de Waard wrote: > I'm working on Vix, which is a document repository and content > management system written in Clojure with a CouchDB backend. After the > announcement on July 23 I immediately got excited about ClojureScript > a

Re: Extending a type to an Interface

2011-07-10 Thread David Jagoe
rotocols on the other hand doesn't define functions 'inside' the object, > they are simply standard functions. > > Jonathan > > On Sun, Jul 10, 2011 at 1:15 PM, David Jagoe wrote: >> >> Thanks for your response Devin. >> >> I guess I had come t

Re: Extending a type to an Interface

2011-07-10 Thread David Jagoe
> On Jul 8, 2011, at 5:14 PM, Kevin Downey wrote: > >> if only lisp had macros >> >> On Fri, Jul 8, 2011 at 12:16 PM, David Jagoe wrote: >>> Hi All, >>> >>> I am battling with how to deal with the difference between Protocols >>> and

Extending a type to an Interface

2011-07-08 Thread David Jagoe
Hi All, I am battling with how to deal with the difference between Protocols and Interfaces in a particular case. Consider the following code: (defrecord DomainTypeA [] SomeInternalProtocol (foo [this] "foo result") clojure.lang.IFn (invoke [this] "invoke result")) This code works fine

Re: Stout

2011-06-01 Thread David Jagoe
Well I like the name! On 2 June 2011 06:21, Andreas Kostler wrote: > Hi All, > > Stout is a porter stemmer implemention using a snowball-like syntax for > defining rules. > Rules are of the form {:c? condition :s1 "abc" :s2 "efg" :a action} > reading if condition is met, replace s1 with s2 and e

Re: fs and with-tempdir

2011-05-31 Thread David Jagoe
Hey Miki, On 31 May 2011 17:52, Miki wrote: > Just uploaded fs 0.8.0 to clojars with your changes. Thanks! I'm glad to contribute something and I'll be glad to remove some code from my project! > (I've changed the assert in your code to :pre checks) Ah yes that sounds better. Cheers, David

Re: fs and with-tempdir

2011-05-29 Thread David Jagoe
On 29 May 2011 16:40, Miki wrote: > >> Cool, I'll clean up the code and submit it along with tests and docs. >> While Im about it i may as well write the equivalent macro for tempfile. I've submitted a bit bucket pull request with the changes. Never used bit bucket before so not sure what the pro

Re: fs and with-tempdir

2011-05-27 Thread David Jagoe
Cool, I'll clean up the code and submit it along with tests and docs. While Im about it i may as well write the equivalent macro for tempfile. Cheers David On 27 May 2011 5:52 PM, "Miki" wrote: I've opened https://bitbucket.org/tebeka/fs/issue/5/with-tempdir-macro and will try to get to it soon

fs and with-tempdir

2011-05-27 Thread David Jagoe
G'day all, Thanks Miki for fs, also coming from a Python background I am enjoying the familiarity! The thing that I most often use tempdir for is unit testing where I want to clean up immediately in a finally block. (defmacro with-tempdir "bindings => [name path] Evaluates body in a try ex

Re: San Francisco Clojure Users

2011-05-24 Thread David Jagoe
Are you in Nigeria? Anyone else on this list in Africa? On Sunday, 22 May 2011, Emeka wrote: > Okay. > I live in Africa... maybe we should have online meetups for now. > Emeka > > On Thu, May 19, 2011 at 4:29 PM, David Jagoe wrote: > On 18 May 2011 18:54, Emeka wrote: &

Re: San Francisco Clojure Users

2011-05-19 Thread David Jagoe
On 18 May 2011 18:54, Emeka wrote: > David, > How is Clojure doing in Africa? There really aren't that many people using it among the people that I have spoken to. I've worked in the UK, Europe and the US and in comparison South Africa is a little bit behind and quite conservative when it comes t

Re: San Francisco Clojure Users

2011-05-10 Thread David Jagoe
would be great. There aren't too many Clojure developers in South Africa!! > > Zach > > On May 10, 1:07 pm, David Jagoe wrote: >> G'day everyone, >> >> Forgive me if this is not the appropriate place for this message, but >> I'm in San Fran

San Francisco Clojure Users

2011-05-10 Thread David Jagoe
G'day everyone, Forgive me if this is not the appropriate place for this message, but I'm in San Francisco for a few days from Johannesburg, South Africa. Any clojure users keen on meeting up? Any clojure events going on that I haven't spotted on-line? I run a business using Clojure for web devel

Re: Declarative Data Models

2011-05-03 Thread David Jagoe
Hey Stuart, On 4 May 2011 00:19, Stuart Sierra wrote: > No. Clojure template (which I wrote) is a backwards way of doing macros. It > happens to be useful in clojure.test, but nowhere else. Thanks that's good to know. While we're on the subject, I'm curious about cc.apply-macro. Why should it no

Re: Key order of literal maps

2011-05-03 Thread David Jagoe
Thanks for the responses. On 3 May 2011 17:39, Steve Miner wrote: > > On May 3, 2011, at 7:08 AM, David Jagoe wrote: > > For your specific purpose, I would be careful about using a map as an > "entity" specification. If the order is significant, a vector of field >

Key order of literal maps

2011-05-03 Thread David Jagoe
Hey everyone, I'm busy implementing a macro whose usage looks like this: (defentity Person {:name {:type String :validator name-validator} :id-number {:type String :validator id-number-validator} :height{:type Float :default 0.0} :weight{:type Float :default 0.0} :bmi

Re: Declarative Data Models

2011-05-02 Thread David Jagoe
Hi Ken, > Shoundn't be too hard. Something like [snip] Thanks, looks good. I haven't had a chance to play with the code yet but it looks like a very good start. > > You probably want it to omit bmi from the argument lists and compute > it -- that will complicate things, something like: > [snip

Re: Declarative Data Models

2011-05-02 Thread David Jagoe
On 2 May 2011 14:06, craig worrall wrote: > > > On May 2, 8:37 pm, David Jagoe wrote: >> >> (i) Is it possible to generate the (defrecord Person ...) from the >> person-entity hash-map that I have shown? > > Sure. You may want to have a look at https://gist.gi

Re: Declarative Data Models

2011-05-02 Thread David Jagoe
Hi Everyone, Background to my problem: I am developing a compojure application, and there is lots of duplication in listing field names in my current data model: (i) in the defstruct (ii) in the public constructor's argument list (iii) in the hiccup form fields (iv) in the compojure argument des

Re: Declarative Data Models

2011-05-02 Thread David Jagoe
Hey Paul, On 30 April 2011 20:27, Paul deGrandis wrote: > I'm not exactly sure of your specific use case, but you should take a > look at clojure.template.  It could be what you're looking for. > > http://clojuredocs.org/clojure_core/clojure.template Great, I will have a look thanks. -- You re

Re: Declarative Data Models

2011-05-02 Thread David Jagoe
ords. > Of course there are downsides to this (speed, lack of types) but it can be a > useful strategy. > Thanks, > Ambrose > On Sat, Apr 30, 2011 at 4:46 PM, David Jagoe wrote: >> >> G'day everyone, >> >> Are there any libraries or projects that are

Declarative Data Models

2011-04-30 Thread David Jagoe
G'day everyone, Are there any libraries or projects that are similar to Python Traits or Zope Schemas (http://pypi.python.org/pypi/zope.schema) for clojure. I am developing a compojure application and there is a lot of duplication between areas of the codebase, e.g. - Fields listed on the defreco

Re: defnk pre- and post-conditions

2011-04-26 Thread David Jagoe
On 26 April 2011 13:27, Meikel Brandmeyer wrote: > Hi, > > clojure supports keyword arguments for a quote some time now. > > (defn foo >   [positional1 ... positionalN & {:keys [kw1 ... kwn]}] >   ...) > > The syntax is the usual destructuring syntax for maps. So you can specify > defaults via :or

defnk pre- and post-conditions

2011-04-26 Thread David Jagoe
G'day folks, I've recently started using defnk more widely, and just run into the fact that pre and post conditions won't work. I understand that this is because they are a clojure special form and therefore cannot be supported by the macro - is that right? Is there any way to work around that? Ha

Re: ClojureCLR in production ?

2011-03-26 Thread David Jagoe
Jules, I ran into a problem implementing a Clojure CLR http client for a Clojure web server. I can't remember the details off-hand but I recall that it had something to do with a static global variable in some .NET http client library and SSL certificate handling. It wasn't a problem with ClojureC

Re: Jesus, how the heck to do anything?

2011-03-23 Thread David Jagoe
Have a look at leiningen. Its a build tool that manages your project environment, allows you to compile your code to a jar etc. http://www.assembla.com/wiki/show/clojure/Getting_Started_with_Leiningen https://github.com/technomancy/leiningen/blob/master/TUTORIAL.md lein run -m org.you.main will

Re: Passing vars

2011-02-21 Thread David Jagoe
Hey Daniel, > You can use a macro to make the add-to-hook take the function symbol so > it looks more like adding the function instead of having to do all of > the #'fn syntax. Thanks, I think that's the answer I was looking for. Cheers, David -- You received this message because you are subs

Re: Passing vars

2011-02-21 Thread David Jagoe
Hey Phil, On 22 February 2011 06:48, Phil Hagelberg wrote: > > https://github.com/technomancy/robert-hooke Thanks, I'll have a look! Cheers, David -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

Re: Passing vars

2011-02-21 Thread David Jagoe
Hi Meikel, On 21 February 2011 15:18, Meikel Brandmeyer wrote: > Hi, > > Is there a reason, not to use the function object directly? Just that I wanted to prevent adding the same function multiple times. But it was just for testing convenience, and perhaps over-complicating things a bit. > > (d

Passing vars

2011-02-21 Thread David Jagoe
G'day all, Is it considered unusual to pass a var into a function? My use-case is as follows: I want code to be able to register a function on a hook (kinda like emacs). Each of the registered functions should be called once on a particular well-defined event. I want the process of registering a p

Re: Faster ring reload middleware

2011-01-05 Thread David Jagoe
Hi James, On 5 January 2011 18:50, James Reeves wrote: > Ring enhancement and patches are best posted to the "ring-clojure" > group. There's a chance they might be missed if only posted to the > Clojure group. Ok, will do that in future. > > Regarding wrap-reload, your enhancements would put it

Faster ring reload middleware

2011-01-05 Thread David Jagoe
G'day, Ring ships with some development middleware that reloads the supplied namespaces every request. This is fantastic for quick iterative development, particularly because the JVM takes so long to start. However as soon as you have more than a few namespaces every request becomes rather slow -

Re: Porting libraries to ClojureCLR

2010-11-24 Thread David Jagoe
On 24 November 2010 02:11, JMatt wrote: > The easiest way to prevent divergence is to write and use native > clojure libraries. I totally agree. However because of clojure's excellent interop capabilities it is extremely common (in fact encouraged) for developers to directly use Java code. For ex

Porting libraries to ClojureCLR

2010-11-23 Thread David Jagoe
G'day all, I am using ClojureCLR (thanks everyone involved, clojure makes me happy!) to develop a Windows application. I need a json library (and don't really want to directly use the native C# one) so it seems like the best option will be to port an existing Clojure library to the CLR. Basically

ClojureCLR Windows Service

2010-11-19 Thread David Jagoe
Hi All, Is this the right place for ClojureCLR-specific questions? I have managed to install and use ClojureCLR on Windows but before I head too far down that track I'd like to canvas some expert opinion: Is it going to be painful trying to implement a Windows Service in ClojureCLR? Basically,

Re: Question about lein swank and emacs

2010-10-25 Thread David Jagoe
On 26 October 2010 04:36, Mark Engelberg wrote: > When I do restart-inferior-lisp, it says, "no inferior lisp process". Yeah, that'll only work if you originally started swank from emacs as the inferior lisp process. If you're doing 'lein swank' on the command line it won't work - looks like elei

Re: Misleading error message on incorrect if-let use

2010-10-20 Thread David Jagoe
Looks like its already done: https://www.assembla.com/spaces/clojure/tickets/103-gc-issue-99--incorrect-error-with-if-let On 20 October 2010 22:20, David Jagoe wrote: > Hi all, > > I noticed today (clojure 1.2) that using if-let incorrectly thusly: > > (if-let [a 1] >  (printl

Misleading error message on incorrect if-let use

2010-10-20 Thread David Jagoe
Hi all, I noticed today (clojure 1.2) that using if-let incorrectly thusly: (if-let [a 1] (println "1") (println "2") (println "3")) Instead of e.g. (if-let [a 1] (println "1") (do (println "2") (println "3"))) Results in this error if-let requires a vector for its binding

Re: Need some help with static files and ring...

2010-10-18 Thread David Jagoe
Hey Luc, Are you deploying to Tomcat using a war file? Are you perhaps missing the :web-content key in your project.clj file (I presume you're using Leiningen + leiningen-war) (defproject myproject "0.0.1" :description "" :dependencies [[org.clojure/clojure "1.2.0"]

Re: Find file from namespace symbol

2010-09-30 Thread David Jagoe
Thanks chaps, that's what I was looking for. Luckily I came across an easier solution to the underlying problem (i.e. using session and reload middleware in ring): http://groups.google.com/group/ring-clojure/browse_thread/thread/a0dffa86be0896ff# basically, using defonce allows me to create memor

Find file from namespace symbol

2010-09-29 Thread David Jagoe
Hi all, Anyone know of a utility that returns a absolute filename given a namespace symbol? Actually what I'm trying to do is adjust ring.middleware.reload to only reload source files if they've changed (otherwise I run into problems with session management), so if anyone knows of utilities that a

Re: Clojure 1.3: Integrating clj-stacktrace?

2010-08-25 Thread David Jagoe
On 25 August 2010 20:16, Alan wrote: > I have the same problem, but you can usually figure that out by > looking at the function to which the backtrace refers, as well as the > filename: > >  4: clojure.lang.RT.nth(RT.java:722) >  5: ddsolve.core$play_deal_strategically.invoke(core.clj:177) >  6:

Re: misunderstanding collection

2010-08-25 Thread David Jagoe
Ahoy, On 25 August 2010 16:06, Glen Rubin wrote: > After toying around at the REPL I realize that I have been working > with a heretofore invalid understanding of collections.  For example, > working with the following collection(s): > > signal: > (((1 2 3 4) (2 3 4 5) (3 4 5 6)) ((3 4 5 6) (4 5

Re: Clojure 1.3: Integrating clj-stacktrace?

2010-08-25 Thread David Jagoe
Ahoy, On 25 August 2010 15:46, Stuart Halloway wrote: > > *Specific* documentation of pain points also welcome. In general I haven't found the stack traces to be too much of a problem, but the lack of full paths in the trace has bitten me. Since all of my namespaces have a core.clj this can mean