creating maps out of sql

2013-05-24 Thread Mond Ray
I am starting out to use Clojure to combine and verify data between DB2 on a Mainframe, SQL Server and an Atom Feed. Yes, it's such fun working in a start-up ;-) Database wise, all is connecting OK after some Leiningen shenanigans and I am now stuck on the mapping part ;-) The code is below.

Re: creating maps out of sql

2013-05-24 Thread Mond Ray
ere A2P_PROJECT_ID = ?" a2p-id)) > > (println (a2p-records-by-date "select project_id from PROJECT where > timestamp > ? and timestamp < ?" "2012-03-02" "2012-03-07" dh-sub-query)) > > > Of course, I haven't tested any of this, so plenty of opp

Re: creating maps out of sql

2013-05-24 Thread Mond Ray
the Atom > feed would require a bit more work but probably not too bad. > > On Friday, May 24, 2013 7:55:17 AM UTC-7, Mond Ray wrote: >> >> I am starting out to use Clojure to combine and verify data between DB2 >> on a Mainframe, SQL Server and an Atom Feed. Yes, it&

Re: creating maps out of sql

2013-05-24 Thread Mond Ray
table"] > (doall rs))) >sql (sql/with-connection db > (sql/with-query-results rs ["select fields from table"] > (doall rs)))] > (left-outer-join db2 sql :db2field :sqlfield)) > >

Re: creating maps out of sql

2013-05-25 Thread Mond Ray
of maps it's clear that there may be room for further compression but I want to wait until I get all of the queries and odd cases out of the way first. Thanks again for your help. Ray On Friday, 24 May 2013 23:20:11 UTC+2, Mond Ray wrote: > > Fantastic answer Marc - I had been fidd

filter on sets ... [reward: me face palming]

2013-05-25 Thread Mond Ray
I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id "1", :dh-uuid "abc-def-ghi-klm"} {:a2p-id "2", :dh-uuid "def-ghi-klm-opq"} {:a2p-id "3", :dh-uuid nil}) ({:a2p-id "1", :dh-uuid "abc-def-ghi-klm"} {:a2p-id "2", :dh-uu

Re: filter on sets ... [reward: me face palming]

2013-05-25 Thread Mond Ray
p-id "3", :dh-uuid nil}) ({:a2p-id "1", :dh-uuid >> "abc-def-ghi-klm"} {:a2p-id "2", :dh-uuid "def-ghi-klm-opq"} {:a2p-id "3", >> :dh-uuid nil})) >> >> then especially note the double parentheses. That is a list

Re: filter on sets ... [reward: me face palming]

2013-05-25 Thread Mond Ray
On the other hand ... does that mean that the sequence being filtered is not lazy? On Saturday, 25 May 2013 20:09:05 UTC+2, Mond Ray wrote: > > Bingo: > > user=> (filter (complement :dh-uuid) (apply concat (map find-records > query-parts))) > ({:a2p-id "3", :dh-u

Re: filter on sets ... [reward: me face palming]

2013-05-25 Thread Mond Ray
It's as I presented it - a list of a list of maps On Saturday, 25 May 2013 13:27:45 UTC+2, atkaaz wrote: > > can you tell what this returns? > (map find-records query-parts) > > > On Sat, May 25, 2013 at 2:21 PM, Mond Ray > > wrote: > >> I am missing som

Re: filter on sets ... [reward: me face palming]

2013-05-25 Thread Mond Ray
TC+2, sdegutis wrote: > > Wouldn't (remove :dh-uuid (apply concat (map find-records query-parts))) > be better? > > > On Sat, May 25, 2013 at 1:09 PM, Mond Ray > > wrote: > >> Bingo: >> >> user=> (filter (complement :dh-uuid) (apply concat (map find-rec

Re: filter on sets ... [reward: me face palming]

2013-05-25 Thread Mond Ray
; {:a2p-id "3", :dh-uuid *false*})) > )) > (({:a2p-id "3", :dh-uuid nil}) ({:a2p-id "3", :dh-uuid *false*})) > > idiomatic clojure ftw :) > > > On Sat, May 25, 2013 at 9:38 PM, Mond Ray > > wrote: > >> This is my latest

lazy sequence termination

2013-05-28 Thread Mond Ray
Hi Clojurians, I have a program which generates a lazy sequence to read ATOM feed chunks. That part works OK but now I want to only take a limited number of the chunks based on some predicate. My predicate is currently returning an empty list so I think (hope!) I am missing something simple. H

Re: lazy sequence termination

2013-05-28 Thread Mond Ray
? Am I asking too much ... in other words I have got this far and I should be expected to know the answer (I really feel like I should too by the way!) Use of the term Clojurians? Something else? Thanks Ray On Tuesday, 28 May 2013 13:44:57 UTC+2, Mond Ray wrote: > > Hi Clojurians, &

Re: lazy sequence termination

2013-05-28 Thread Mond Ray
that comes > from and it would be helpful to run the code to see what happensno > guarantees though =) > > On May 28, 1:05 pm, Mond Ray wrote: > > Quite a few views but no bites ... what have I done wrong in asking this > > question? If you can't help with the p

Re: lazy sequence termination

2013-05-28 Thread Mond Ray
On Tuesday, 28 May 2013 23:46:34 UTC+2, Michael Gardner wrote: > > On May 28, 2013, at 15:05 , Mond Ray > > wrote: > > > Quite a few views but no bites ... what have I done wrong in asking this > question? If you can't help with the problem would you please take a

Re: [ANN] defn podcast ep.3 : A tour of REPLs feat. Mike Fikes :)

2016-06-16 Thread Mond Ray
Thanks for listening Jason and for taking the time to give us feedback. To echo Vijay's comments, we will be happy to have a 'follow-up' section in the podcast to correct mistakes and omissions. I really need to work on a defn related pun to end such emails but for now, I hope you keep on list

Re: [ANN] defn podcast ep.3 : A tour of REPLs feat. Mike Fikes :)

2016-06-16 Thread Mond Ray
Thanks Ashish. We will certainly add to the list of interesting subjects. To be transparent about our approach, we are starting with the (many) core concepts and technologies and will gradually fan out to specialist items. So items such as ML and other 'big data' related topics will be in our

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-24 Thread Mond Ray
I agree Colin, this feels more like the beatings shall continue until morale improves ;-) More seriously, I understand the point of the musical instruments analogy to be a reminder to programmers that learning a language and understanding it in depth will increase your power and expressivity wi

Re: core.async top use cases

2016-09-18 Thread Mond Ray
Pushing asynchrony further into the stack is useful for reliability and fault tolerance. We can also use it as a basis for Complex Event Processing using time series windows. I wrote up a few examples in my blog

Re: [ANN] New Clojure Podcast: defn

2016-05-20 Thread Mond Ray
That's great feedback. We can (and will) definitely improve the notes along the lines you suggest. On Friday, 20 May 2016 12:19:17 UTC+2, Alan Forrester wrote: > > On 20 May 2016, at 10:32, Vijay Kiran > > wrote: > > > On Friday, May 20, 2016 at 9:29:29 AM UTC+2, Ashish Negi wrote: > >> One su

Re: [ANN] New Clojure Podcast: defn

2016-05-20 Thread Mond Ray
Thanks Ashish - that's really good feedback. We will improve the notes along the lines that you request. On Friday, 20 May 2016 12:02:05 UTC+2, Ashish Negi wrote: > > The notes has : > ``` > Credits: > > *Music:* Thanks to the very talented *ptzery* for the permitting us to > use his music on t

datomic + clojure + clojurescript examples

2013-02-23 Thread Mond Ray
My fellow Clojurians, I am having a trouble hunting down an example of the above stack for clojure applications. Can anyone point me in the right direction? Thanks Ray -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

Re: Multiple replacements in string using a map

2013-04-19 Thread Mond Ray
Old thread but what the heck... it doesn't work in my REPL user=> (defn key-pattern #_=> "Create a regex Pattern of the form '|', the key names #_=> will be quoted in case they contain special regex characters" #_=> [m] #_=> (->> (keys m) #_=> (map #(java.util.regex.

Re: Multiple replacements in string using a map

2013-04-20 Thread Mond Ray
t; first, then copied and pasted those two function definitions, and did not > get the errors you are seeing. I don't have a good guess why you are > getting those errors. Did you do the require first? What version of > Clojure are you using? > > Andy > > > On Fri, A

Re: Multiple replacements in string using a map

2013-04-22 Thread Mond Ray
lassCastException clojure.lang.Keyword cannot be cast to java.lang.String user/key-pattern/fn--352 (NO_SOURCE_FILE:6) user=> You see my full REPL session. I reckon I must be doing something dumb wrong - any ideas on what's going on? Thanks Ray On Saturday, 20 April 2013 09:51:21 UTC

Re: Multiple replacements in string using a map

2013-04-22 Thread Mond Ray
attle, do you guys have any ideas (including that its not a good idea!)? Cheers Ray On Monday, 22 April 2013 23:19:16 UTC+2, Sean Corfield wrote: > > On Mon, Apr 22, 2013 at 1:45 PM, Mond Ray > > wrote: > > Something very odd going on here - one day it works the next day it > fail

newbie question regarding maps

2012-09-25 Thread Mond Ray
I am playing around with maps and using wish lists as a learning tool. I have a list of items in wish lists like this: user=> items [{:name "Item 1", :cost 20.0} {:name "Item 2", :cost 40.0}] user=> wiggle-items [{:name "Wiggle 1", :cost 20.0} {:name "Wiggle 2", :cost 40.0} [:name "Item 3" :cos

Re: newbie question regarding maps

2012-09-27 Thread Mond Ray
Thanks for the support and especially the examples. I will be back when I bump into the next level of complexity ;-) On Monday, 24 September 2012 12:04:42 UTC+2, Mond Ray wrote: > > I am playing around with maps and using wish lists as a learning tool. I > have a list of items in w