Re: core.async top use cases

2016-09-19 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: Why is this not considered to be in a go block?

2016-08-27 Thread mond
more embarrassing. It should have been kafka-ch (chan 1 (comp (filter #(matching-event client-filter (.key %))) (map sse-data)))] Doh! On Saturday, 27 August 2016 01:25:57 UTC+2, Moe Aboulkheir wrote: > > > > On Sat, Aug 27, 2016 at 12:08

Re: Why is this not considered to be in a go block?

2016-08-26 Thread mond
The flood gates are open Timothy! and on the back of that, I'm gonna dump some code in here so pls excuse me - it's on GitHub too so maybe look there if it's too heavy for email. I have this code in the go-loop

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

Re: Frustrations so far

2016-07-23 Thread mond
You are not alone - it's the number one frustration in the community https://www.reddit.com/r/Clojure/comments/433y02/state_of_clojure_2015_survey_results/ But also see the responses - maybe we will have some major improvements with 1.9. Spec looks like good infra to support those efforts for

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

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

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

Re: core.async | compojure ... odd error ... help!!

2014-09-27 Thread mond
* as an argument name, but this isn't really recommended. This only works by coincidence, and it may be removed in future versions. Instead use something like: (GET [/:brand/:country/:resource :resource #.*] [brand country resource] ...) - James On 27 September 2014 00:14, mond r

core.async | compojure ... odd error ... help!!

2014-09-26 Thread mond
My first core.async program ... all works outside of the web app but barfs once I put the functions inside a web container. I hope somebody in the group can point to my obvious mistake... The idea is that the function 'respond-within-sla' will give back a result or a come back later message

is it possible to join on lazy seqs?

2013-07-16 Thread mond
Sorry if this is a RTFM style question ... this is what I have in terms of types and was wondering if there is another form of join or another library / collection combination that can achieve the same relational join? Thanks in advance, Ray check-delta-feeds.core= (def changed-records (map

Re: keys maps ... gak

2013-06-01 Thread mond
On Friday, May 31, 2013 10:18:09 PM UTC+2, mond wrote: Sometimes its just so frustrating when you know you are close but just cannot get that last little bit ... so I am appealing again for more newbie support I have a map for some names: user= (def entity-names {:project Project :model Model

keys maps ... gak

2013-05-31 Thread mond
Sometimes its just so frustrating when you know you are close but just cannot get that last little bit ... so I am appealing again for more newbie support I have a map for some names: user= (def entity-names {:project Project :model Model}) Which I then reference in a set of maps: user= def

Re: lazy sequence termination

2013-05-28 Thread Mond Ray
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, I have

Re: lazy sequence termination

2013-05-28 Thread Mond Ray
from and it would be helpful to run the code to see what happensno guarantees though =) On May 28, 1:05 pm, Mond Ray mondraym...@gmail.com 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

Re: lazy sequence termination

2013-05-28 Thread Mond Ray
May 2013 23:46:34 UTC+2, Michael Gardner wrote: On May 28, 2013, at 15:05 , Mond Ray mondr...@gmail.com javascript: 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 moment to help me

lazy seq termination

2013-05-28 Thread mond
I have managed to create a function that will read an ATOM feed indefinitely and now need a way to stop it ;-) (defn fetch-atom-chunk Returns an ATOM chunk from the feed-url [feed-url] (:ATOM_FEED (:body (client/get feed-url {:as :json} (defn fetch-atom-feed Returns a list of ATOM

Re: creating maps out of sql

2013-05-25 Thread Mond Ray
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 fiddling about with map and hash maps and could quite get the parens right but now its sorted. Brilliant - thanks again

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

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

2013-05-25 Thread Mond Ray
note the double parentheses. That is a list (or sequence), whose first element is a list (or sequence) of maps. You can use (first (map find-records query-parts)) to get the inner list. Andy On Sat, May 25, 2013 at 4:21 AM, Mond Ray mondr...@gmail.comjavascript: wrote: I am missing

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-uuid nil} {:a2p-id 3, :dh-uuid nil

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 mondr...@gmail.comjavascript: wrote: I am missing something obvious... I get

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

2013-05-25 Thread Mond Ray
(remove :dh-uuid (apply concat (map find-records query-parts))) be better? On Sat, May 25, 2013 at 1:09 PM, Mond Ray mondr...@gmail.comjavascript: wrote: Bingo: user= (filter (complement :dh-uuid) (apply concat (map find-records query-parts))) ({:a2p-id 3, :dh-uuid nil} {:a2p-id 3

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

2013-05-25 Thread Mond Ray
:) On Sat, May 25, 2013 at 9:38 PM, Mond Ray mondr...@gmail.comjavascript: wrote: This is my latest working invocation: (doall (map #(remove :dh-uuid %) (map find-records query-parts))) (({:a2p-id 3, :dh-uuid nil}) ({:a2p-id 3, :dh-uuid nil})) The list of maps is retained which might be useful

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
2012-03-07 dh-sub-query)) Of course, I haven't tested any of this, so plenty of opportunity for mistakes. Marc On Fri, May 24, 2013 at 10:55 AM, Mond Ray mondr...@gmail.comjavascript: wrote: I am starting out to use Clojure to combine and verify data between DB2 on a Mainframe, SQL

Re: creating maps out of sql

2013-05-24 Thread Mond Ray
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's such fun working in a start-up ;-) Database wise

Re: creating maps out of sql

2013-05-24 Thread Mond Ray
(sql/with-query-results rs [select fields from table] (doall rs)))] (left-outer-join db2 sql :db2field :sqlfield)) On Friday, May 24, 2013 4:55:17 PM UTC+2, Mond Ray wrote: I am starting out to use Clojure to combine and verify data between DB2

Re: Multiple replacements in string using a map

2013-04-23 Thread mond
, Mond Ray wrote: Man - you guys are good and *fast*. I was pootling around with a version that would directly replace /a/:key/b {:key value} with /a/value/b and a failed version sneaked into my code. Incidentally that is my only slight complaint about the code as it stands: I have to use

Re: Multiple replacements in string using a map

2013-04-22 Thread Mond Ray
on what's going on? Thanks Ray On Saturday, 20 April 2013 09:51:21 UTC+2, Mond Ray wrote: Just tried again - using lein repl (clojure 1.4.0) and it worked fine. It was late - who knows what I did ;-) Thanks for checking guys. On Saturday, 20 April 2013 02:37:14 UTC+2, Andy Fingerhut wrote

Re: Multiple replacements in string using a map

2013-04-22 Thread Mond 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 mondr...@gmail.comjavascript: wrote: Something very odd going on here - one day it works the next day it fails :( This code is different to what you posted the other day

Re: Multiple replacements in string using a map

2013-04-20 Thread Mond Ray
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, Apr 19, 2013 at 5:17 PM, Mond Ray mondr

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 'key1|key2', the key names #_= will be quoted in case they contain special regex characters #_= [m] #_= (- (keys m) #_= (map

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

Re: another n00b defrecord combination question

2012-12-16 Thread mond
Great stuff Ben. Thanks. ray On Saturday, December 15, 2012 10:54:42 PM UTC+1, Benjamin R. Haskell wrote: On Sat, 15 Dec 2012, mond wrote: Thanks for picking up the cudgels Ben! Ha. It's nice to have reached a point where I feel at-all confident with any of this... happy to help

Re: another n00b defrecord combination question

2012-12-16 Thread mond
in advance ray On Saturday, December 15, 2012 10:54:42 PM UTC+1, Benjamin R. Haskell wrote: On Sat, 15 Dec 2012, mond wrote: Thanks for picking up the cudgels Ben! Ha. It's nice to have reached a point where I feel at-all confident with any of this... happy to help. To be honest I am

another n00b defrecord combination question

2012-12-15 Thread mond
I have defined these types of records for modelling a simple shopping cart: ; An item in the cart (defrecord Item [id name product quantity purchased]) ; The product that relates to the item in the cart (defrecord Product [id name description prices]) ; A price definition (defrecord Price

Re: another n00b defrecord combination question

2012-12-15 Thread mond
take back a list of values from the inputs? Thanks ray On Saturday, December 15, 2012 5:25:59 PM UTC+1, mond wrote: I have defined these types of records for modelling a simple shopping cart: ; An item in the cart (defrecord Item [id name product quantity purchased]) ; The product

Re: another n00b defrecord combination question

2012-12-15 Thread mond
, mond wrote: I think I am close to answering this myself (which is always nice!) I have done the necessary joins with map and I can return a product description user= (map (fn [item product] (= (:product item (:id product))) (:description product)) items products) (Men's Leather Slip

Re: another n00b defrecord combination question

2012-12-15 Thread mond
Thanks for picking up the cudgels Ben! To be honest I am struggling to repeat your advice in the REPL. In any case, I decided to change the data structures in line with your advice and put the IDs into maps rather than the records. (defrecord Item [name product quantity purchased])

n00b question on embedded defrecord

2012-12-09 Thread mond
; I have these records defined (defrecord Customer [firstName lastName emailAddress deliveryAddress invoiceAddress]) (defrecord Address [street number town postcode]) ; I have this small sample data (def customers { (-Customer Drongo Bongo dro...@bongo.co (-Address Gongo 32A Fongo

Re: n00b question on embedded defrecord

2012-12-09 Thread mond
Thanks Jordan - I just couldn't quite get that magic combination :) On Sunday, December 9, 2012 11:38:50 PM UTC+1, Jordan wrote: On Sun, Dec 9, 2012 at 4:45 PM, mond r...@mcdermott.be javascript:wrote: ; I have these records defined (defrecord Customer [firstName lastName emailAddress

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 wish lists like

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 :cost 10.0]]