Re: Should predicates always have one argument?

2014-02-04 Thread Ryan
[maps validator] > (let [valid? (partial validator)] > (map valid? maps))) > > On Friday, January 31, 2014 11:44:38 AM UTC-5, Ryan wrote: >> >> Hello, >> >> I am wondering if all my predicates should be one argument functions >> because I run into a couple

get fn and not-found

2013-10-27 Thread Ryan
key isn't found? Why am I seeing the above behavior instead? Thank you for your time, Ryan -- -- 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

Re: get fn and not-found

2013-10-27 Thread Ryan
Silly me, thank you for your replies guys! One more question though, what if my-foo had parameters? Ryan On Sunday, October 27, 2013 6:55:34 PM UTC+2, Luc wrote: > > You are getting my-foo evaluated, remove the parens around it. > > Luc P. > > > > Hello, > > &g

Re: get fn and not-found

2013-10-28 Thread Ryan
Thank you all for your answers :) Ryan On Tuesday, October 29, 2013 7:40:41 AM UTC+2, Mars0i wrote: > > This is essentially the same as some of the other solutions, but more > succinct: > > (or (get a-map :b) (println "Oh no!")) > > -- -- You received this mes

Any elegant solutions for this problem?

2013-12-01 Thread Ryan
Hi all, I have a vector which contains an unknown number of repetitions of the following pattern: String, followed by 1 or more integers For example: String Integer String Integer Integer String Integer Integer Integer String Integer What I am trying to do is to create a vector of pairs which

Re: Any elegant solutions for this problem?

2013-12-01 Thread Ryan
I need (("foo" 1) ("bar" 10) ("bar" 20) ("clown" 5)) Ryan. On Sunday, December 1, 2013 9:21:14 PM UTC+2, john walker wrote: > > Sorry, I spoke without seeing that you were aware of partition-by. Here's > one that isn't vectorized. &

Re: Any elegant solutions for this problem?

2013-12-01 Thread Ryan
Haha, no worries, it happens :) That seems to work nice as well! Ryan On Sunday, December 1, 2013 9:36:47 PM UTC+2, john walker wrote: > > I swear english is my first language. This one isn't elegant, but at least > you know you aren't alone: > > (->>

Re: Any elegant solutions for this problem?

2013-12-01 Thread Ryan
Nice James, I like it :) Ryan On Sunday, December 1, 2013 10:02:32 PM UTC+2, James Reeves wrote: > > There's also: > > (->> xs > (partition-by string?) > (partition 2) > (mapcat (fn [[[s] xs]] (for [x xs] [s x] > > > - James >

Best way to loop a map of maps

2013-12-03 Thread Ryan
ly nested iterations/traversal of map of maps? Thank you for any replies! Ryan -- -- 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: Best way to loop a map of maps

2013-12-05 Thread Ryan
Thanks guys for the useful answers :) Ryan On Wednesday, December 4, 2013 1:27:57 AM UTC+2, James Ferguson wrote: > > `update-in` could be helpful, depending on what exactly you're doing. > > (doseq [keyA keys, keyB otherkeys] > (update-in m [keyA keyB] some-function)) >

Re: Best way to loop a map of maps

2013-12-10 Thread Ryan
I've seen postwalk and prewalk but never really played around with them so I will give it a shot. Thanks for your input! Ryan On Tuesday, December 10, 2013 10:29:51 AM UTC+2, Jeroen van Dijk wrote: > > Don't forget about the option of walking over a map by using > cloju

Re: Best way to loop a map of maps

2014-01-21 Thread Ryan
Thank you for your input Thomas. All replies have definitely been very useful :) Cheers, Ryan On Tuesday, December 10, 2013 1:57:38 PM UTC+2, Thomas Heller wrote: > > Oh nvm, just saw that it was suggested before. > > But maybe this is new: > > (def m > {"outerKey

Should predicates always have one argument?

2014-01-31 Thread Ryan
the clojure way? What are my alternatives? Should I just use a different function name which does not have a question mark at the end that implies that is a predicate? Cheers, Ryan -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Creating a hash-map with conditional keys

2013-02-21 Thread Ryan
ind a proposed solution on a stackoverflow post<http://stackoverflow.com/questions/8992997/initializing-elements-of-a-map-conditionally-in-clojure>, but I am not sure if that's the most elegant way. Thank you for your time. Regards, Ryan -- -- You received this message because

Re: Creating a hash-map with conditional keys

2013-02-21 Thread Ryan
big hash-map, and not with just two pairs, wouldn't it be ugly with the above way? or..it's just fine and no better way is possible? Ryan On Thursday, February 21, 2013 5:02:21 PM UTC+2, Meikel Brandmeyer (kotarak) wrote: > > Hi, > > merge works with nil. So (merge (creat

Re: Creating a hash-map with conditional keys

2013-02-21 Thread Ryan
Thanks for your input Alex. Do you think a macro would be appropriate if I use this more than once in my code? Ryan On Thursday, February 21, 2013 5:41:49 PM UTC+2, Alex Baranosky wrote: > > I'd often just write it like this: > > (defn create-map [] >> (merge {:foo &qu

Re: Creating a hash-map with conditional keys

2013-02-21 Thread Ryan
I got confused a bit with the reason that a macro would not be appropriate for this case. Can you please explain again? Ryan On Thursday, February 21, 2013 7:05:11 PM UTC+2, Alex Baranosky wrote: > > A function could be appropriate, but a macro not appropriate, since > everything

Re: Creating a hash-map with conditional keys

2013-02-21 Thread Ryan
Thank you both for your answers Regards, Ryan On Thursday, February 21, 2013 7:43:05 PM UTC+2, Jim foo.bar wrote: > > I think Alex is trying to say that a macro is almost never appropriate > when a first-class function would do...therefore, there is no good reason > for

Get difference between two lists with java objects of same class

2013-03-11 Thread Ryan
would be the most elegant way to achieve it. Thank you for your time Ryan -- -- 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: Get difference between two lists with java objects of same class

2013-03-11 Thread Ryan
a more clojurish way instead of calling java methods. or is it pointless and I should just use removeAll()? Ryan On Monday, March 11, 2013 8:49:45 PM UTC+2, Jim foo.bar wrote: > > On 11/03/13 18:35, Jim - FooBar(); wrote: > > Well, java.util.List specifies a retainAll(Collection c)

Re: Get difference between two lists with java objects of same class

2013-03-11 Thread Ryan
rty which has a unique value. I am trying to find out, which objects from the first list, based on that "id" property, are not included in list b. I assume this rules out the use of clojure.data/diff and I will need my own function like Marko suggested to make those property comparisons

Re: Get difference between two lists with java objects of same class

2013-03-11 Thread Ryan
tems from list-a which do not exist in list-b. Would i go with the two functions you suggested or is there something else I could use? Ryan On Tuesday, March 12, 2013 12:03:47 AM UTC+2, Marko Topolnik wrote: > > On Monday, March 11, 2013 10:55:12 PM UTC+1, Ryan wrote: > >> Thank y

Re: Get difference between two lists with java objects of same class

2013-03-12 Thread Ryan
Thanks guys for your replies. I will re-read everything carefully and decide what to do :) Ryan On Tuesday, March 12, 2013 11:14:17 AM UTC+2, Marko Topolnik wrote: > > On Monday, March 11, 2013 11:09:31 PM UTC+1, Ryan wrote: > >> What if, i had two clojure lists, with hash-maps

Re: Get difference between two lists with java objects of same class

2013-03-21 Thread Ryan
Marko, Can you please do me a favor and break down the function you suggested me? I understand partially how it works but I am having trouble to fully get it. Thank you for your time. On Monday, March 11, 2013 11:05:47 PM UTC+2, Marko Topolnik wrote: > > Another approach, preserving the order o

Re: Get difference between two lists with java objects of same class

2013-03-21 Thread Ryan
Thanks a lot Marko. Much better now :) I also wanted to ask you why did you mention in a previous post that you prefer using *remove *than *filter + complement*. Is there a reason for this or just a personal preference? Ryan On Thursday, March 21, 2013 5:37:33 PM UTC+2, Marko Topolnik wrote

Re: Get difference between two lists with java objects of same class

2013-03-21 Thread Ryan
d applies the predicate to each item? (if the answer is no my head will definitely explode) Thanks again for your patience :) Ryan On Thursday, March 21, 2013 6:09:42 PM UTC+2, Marko Topolnik wrote: > > Personal preference. It causes less mental load because it more obviously > sp

Re: Get difference between two lists with java objects of same class

2013-03-22 Thread Ryan
rch 21, 2013 8:48:51 PM UTC+2, Marko Topolnik wrote: > > On Thursday, March 21, 2013 5:21:53 PM UTC+1, Ryan wrote: > >> Thanks Marko. I do have couple more q's for you just to ensure I got >> everything right: >> >> (comp keyset-b key-fn) >>> This r

Re: Get difference between two lists with java objects of same class

2013-03-22 Thread Ryan
Thanks a lot Marko :) On Friday, March 22, 2013 12:44:06 PM UTC+2, Marko Topolnik wrote: > > Let's assume that key-fn is defined as #(.getID %) so we have: > >> >> #(keyset-b #(.getID %)) >> >> And now let's assume that item-object is passed to it. So, #(.getID %) >> returns, >> let's say, the n

Which is the most idiomatic way to go

2013-03-24 Thread Ryan
Hello all, I am trying to figure out which is the most idiomatic way to go in a project I am doing. I've noticed the following pattern in my code and I started wondering if there is a more clojurish approach to go with it. For the shake of readability and simplicity, I will provide a pseudo-cod

Re: Which is the most idiomatic way to go

2013-03-25 Thread Ryan
to test. > 2. I separates your data processing from the side-effects, which lets you > implement batching, switch to another DB, etc. without touching the data > processing code. > > So I would trust your instincts on this one. :) > > --Leif > > On Sunday, March

Re: Which is the most idiomatic way to go

2013-03-25 Thread Ryan
> > Yes, it's almost always a good thing to separate the formatting of data > from processing its side effects. > When talking to a database, there might already be record and > list-of-records interface, for step 2. > > > 2013/3/25 Ryan > > >> Thanks a lot

Re: Which is the most idiomatic way to go

2013-03-26 Thread Ryan
Ah! Got what you mean, thanks a lot :) On Tuesday, March 26, 2013 3:52:39 AM UTC+2, Herwig Hochleitner wrote: > > 2013/3/25 Ryan > > >> Thanks for your input Herwig. >> >> When talking to a database, there might already be record and >>> list-of-records i

Apply elements in a vector as arguments to function

2013-03-26 Thread Ryan
Hello all, I have been searching and searching on how to do this but I am failing miserably. I am trying to do a pretty simply thing actually. I have the following vector: [:foo :bar] and a function that takes keywords as arguments, like so: (my-function :foo :bar & more) What i am trying

Re: Apply elements in a vector as arguments to function

2013-03-26 Thread Ryan
Thanks Michael, but If i am not mistaken, your example only works with a vector with two elements. What if we have an unknown number of vector elements? My apologies if that wasn't clear on my first post. On Tuesday, March 26, 2013 9:38:55 PM UTC+2, Michael Klishin wrote: > > >

Re: Apply elements in a vector as arguments to function

2013-03-26 Thread Ryan
3 9:51:34 PM UTC+2, Jim foo.bar wrote: > > On 26/03/13 19:28, Ryan wrote: > > apply the elements of my vector as arguments to the function > > you said it yourself in your first post... :) 'apply' is what you're > looking for! > > Jim > -- -- Yo

Re: Apply elements in a vector as arguments to function

2013-03-26 Thread Ryan
n a keyword or keywords. Try just (fields fields-vector), without > the "apply". > > > On Tue, Mar 26, 2013 at 4:12 PM, Ryan >wrote: > >> Thank you guys for your answer. apply was the first thing I used but I >> got the following error: >> >> ja

Re: Apply elements in a vector as arguments to function

2013-03-26 Thread Ryan
the sources second (if > available)...I should have done that as well :) > > Jim > > > On 26/03/13 20:28, Ryan wrote: > > Ah damn, you are right! Sorry if I wasted anyone's time :) > > At least I learned that apply was the way to go in my original post > >

Re: Apply elements in a vector as arguments to function

2013-03-27 Thread Ryan
> > The idea that people should read the source to get reasonably > straightforward stuff done is wrong and does a lot of long term damage to > the community. I believe Jim meant to check the source to figure out how does it work, not that the way it's implemented is the most proper way to im

Re: Apply elements in a vector as arguments to function

2013-03-27 Thread Ryan
no worries, I understood that you didn't mean "read the code before you post next time" :) On Wednesday, March 27, 2013 12:37:28 PM UTC+2, Michael Klishin wrote: > > > 2013/3/27 Ryan > > >> I believe Jim meant to check the source to figure out how does it

hash-map initialization issue

2013-03-28 Thread Ryan
Hello! I am having a small issue with a hash-map initialization and I am failing to understand why. I have the following situation: (def a-list '({:BAR_KEY bar-value}, {:BAR_KEY another-value})) (defn my-function [foo-id a-keyword a-list] (map #({:foo_id foo-id (keyword a-keyword) (:BAR_KE

Re: hash-map initialization issue

2013-03-28 Thread Ryan
use underscore so I gotta go with underscores in order code to match them :) Ryan On Thursday, March 28, 2013 11:24:38 PM UTC+2, Jonathan Fischer Friberg wrote: > > It's because the #() syntax always calls the content as a function. > > So #(...) is the same as (fn [] (..

Re: hash-map initialization issue

2013-03-28 Thread Ryan
Thanks for all your help Jonathan :) I went with the standard fn syntax, its a two-liner anyway so not a big of deal :) The important part here was that I learned that #() executes the content as a function, very helpful! Ryan On Friday, March 29, 2013 12:08:04 AM UTC+2, Jonathan Fischer

Re: hash-map initialization issue

2013-03-31 Thread Ryan
Thanks for your input guys Ryan On Sunday, March 31, 2013 11:11:08 AM UTC+3, Alex Baranosky wrote: > > There's also 'for' > > (defn my-function [foo-id a-keyword a-list] > (for [m a-list] > {:foo_id foo-id (keyword a-keyword) (:BAR_KEY m)})) > >

Re: hash-map initialization issue

2013-04-02 Thread Ryan
Thanks Gary, it didn't cross my mind that i can use the # reader with the threading macro :) On Tuesday, April 2, 2013 4:15:58 PM UTC+3, Gary Verhaegen wrote: > > And there's the threading macro : #(-> {:foo %}) > > On 1 April 2013 07:12, Ryan > wrote: &g

Re: Fastest way to generate comma-separated list

2013-04-02 Thread Ryan
andrei, can you please the solution you came up after all? On Thursday, October 28, 2010 3:04:32 PM UTC+3, andrei wrote: > > > > Are you looking for pr-str? > > > > user> (pr-str "foo") > > "\"foo\"" > > Yeah, that's exactly what I tried to implement with my `pr-to-str`, > thank you. -- --

Re: Fastest way to generate comma-separated list

2013-04-02 Thread Ryan
andrei, can you please share the solution you came up after all? On Thursday, October 28, 2010 3:04:32 PM UTC+3, andrei wrote: > > > > Are you looking for pr-str? > > > > user> (pr-str "foo") > > "\"foo\"" > > Yeah, that's exactly what I tried to implement with my `pr-to-str`, > thank you. -

Re: Fastest way to generate comma-separated list

2013-04-02 Thread Ryan
not sure if that's correct. I think that the final string should look like this: "\"jim\",\"jon\",\"chris\"" Ryan On Wednesday, April 3, 2013 2:33:22 AM UTC+3, Jim foo.bar wrote: > > I'm sorry, I've not followed this discussi

Re: Fastest way to generate comma-separated list

2013-04-03 Thread Ryan
> > Most SQL Database support array types natively If you are using MySQL unfortunately there isn't and the OP (including myself) probably needs this because his RDBMS does not support the array type. On Wednesday, April 3, 2013 2:47:45 PM UTC+3, Thomas Heller wrote: > > My Question would be

Question about destructuring with :keys :or and :as

2013-05-03 Thread Ryan
bservation, it seems that *:as* will not fill in the missing keys with the default values if those are provided as in my case. Does anyone have a solution for this? Thank you for your time Ryan -- -- You received this message because you are subscribed to the Google Groups "Clojure&quo

Re: Question about destructuring with :keys :or and :as

2013-05-03 Thread Ryan
it and has an elegant proposal :) Ryan On Friday, May 3, 2013 10:04:41 PM UTC+3, Anthony Rosequist wrote: > > The value of :my-key (or the default, if :my-key doesn't exist) is being > bound to the symbol my-key, so all you need to do is this: > > (defn my-function [{:keys [m

Re: Question about destructuring with :keys :or and :as

2013-05-03 Thread Ryan
2:59 PM UTC+3, Sean Corfield wrote: > > The :as key binds the entire _original_ map. > > The :or defaults apply only to the bound variables extracted from the map. > > It caught me out when I first used map destructuring but I soon got used > to it. > > > On Fri, May 3,

Re: Question about destructuring with :keys :or and :as

2013-05-03 Thread Ryan
Ah, the default nap is a nice idea :) -- -- 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 unsubs

Re: Question about destructuring with :keys :or and :as

2013-05-04 Thread Ryan
t; Sean > > On Fri, May 3, 2013 at 12:38 PM, Ryan > > wrote: > > Well, I need to do something more "clever" because I am passing the > whole > > map to another function which does validation on the key-value pairs. > > Soi guess I need to

Re: Question about destructuring with :keys :or and :as

2013-05-04 Thread Ryan
server apps I made I never found myself needing this. A :merge-as would be nice, maybe something with the use of macro can be done. I used assoc as Sean suggested but It can get easily ugly if you have a lot of parameters and plenty functions needing this. Ryan On Saturday, May 4, 2013 2:00:20 PM

clojure.lang.PersistentArrayMap

2010-06-01 Thread Ryan
I have the following user=> (class ({:one "1"} {:two "2"} {:three "3"})) clojure.lang.PersistentArrayMap but am a little confused as to how best to access the data for example: user=> (count ({:one "1"} {:two "2"} {:three "3"})) 1 user=> (first ({:one "1"} {:two "2"} {:three "3"})) [:three "3"] u

Unable to use/refer/require clojure.contrib

2011-09-02 Thread Ryan
I'm getting such strange results trying to use the clojure contrib libraries (1.1.0). Some I can "use", others I can only "refer", but some I can't do either. I'm using clojure-1.2.1 and clojure- contrib-1.1.0 from: http://code.google.com/p/clojure-contrib/downloads/detail?name=clojure-contrib-1.1

Re: Baltimore Functional Programming

2011-11-29 Thread Ryan
I'm just south in Odenton, and definitely interested. I'll see if I can't wrangle a few more peeps. -- 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 mod

Not understanding the proper use of map

2008-12-10 Thread Ryan Neufeld
I've been working on learning Clojure after taking a course in Common Lisp and I am having some troubles translating a particular Common Lisp function to Clojure that uses mapping. We're defining a function that takes a function and two lists and applies the function to each two items in the list

Re: Not understanding the proper use of map

2008-12-10 Thread Ryan Neufeld
Thats the CL'ism I was hanging on to! Thanks for the amazing and prompt replies. On Dec 10, 1:59 pm, Dean Ferreyra <[EMAIL PROTECTED]> wrote: > Ryan Neufeld wrote: > > I've been working on learning Clojure after taking a course in Common > > Lisp and I am hav

Re: General question: Petri nets and STM in clojure

2010-03-22 Thread Ryan Teo
rateful if you can send some to me. Hopefully, the understanding I get can be shared with everyone. I think concurrency is quite important for today's applications, and I'm quite interested in that aspect of Clojure. Ryan On Mar 22, 11:14 am, Andrzej wrote: > On Mon, Mar 22, 2010

Re: General question: Petri nets and STM in clojure

2010-03-23 Thread Ryan Teo
Okie, thanks a lot! I'll bend my mind over other things then.. =p Yup, I'm catching up on the videos I should watch. Thank you! Ryan On Mar 22, 9:58 pm, alux wrote: > Hi Ryan, > > well, to describe in the terms of Petri nets how the Clojure STM is > built? Thats a good t

Re: tutorial on clojure protocols 1.2

2010-04-26 Thread Ryan Waters
the end so I'm glad those items were included, too. Thank you! - Ryan On Apr 26, 11:20 am, Stuart Halloway wrote: > I have created a short (30 min) tutorial on clojure protocols > athttp://vimeo.com/11236603 > . Hope some of you will find it useful. > > Feedback welcome! &

[ANN] Retrieve the source body of bound symbols

2013-05-19 Thread Kelker Ryan
There's now a library that allows you to retrieve the source body of bound symbols.https://github.com/runexec/concrete#concrete- -- -- 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 t

Re: find first match in a sequence

2013-05-19 Thread Kelker Ryan
Try this user> (first (drop-while even? [2 4 6 7 8 10])) 7 19.05.2013, 23:06, "Jim - FooBar();" : > no need to traverse the entire seq with 'filter' if you only want the 1st > match... > > (some #(when (odd? %) %)  [2 4 6 7 8 9]) > => 7 > > Jim > > On 19/05/13 13:42, Thumbnail wrote: > >> ... or

[ANN] CHP framework major update

2013-05-19 Thread Kelker Ryan
ClojureHomePage is a Compojure based web framework that allows you to write the backend and frontend with Clojure. Here's a small tutorialHere's the documentation You can Embed Clojure into a HTML file with the tagsEnable multiple method handlers under a single route (get, post, put, delete, and h

Re: Compiling the Android version of Clojure

2013-05-21 Thread Kelker Ryan
Did you download the Android JAR? http://www.java2s.com/Code/Jar/a/Downloadandroid32jar.htm 22.05.2013, 04:52, "Alex Fowler" : > I'm trying to build this project: https://github.com/clojure-android/clojure  > with "ant" command. It sarts working, but I get this output with errors: > > Buildfile:

Re: Compiling the Android version of Clojure

2013-05-21 Thread Kelker Ryan
013 at 11:59 PM, Kelker Ryan <theinter...@yandex.com> wrote:Did you download the Android JAR? http://www.java2s.com/Code/Jar/a/Downloadandroid32jar.htm 22.05.2013, 04:52, "Alex Fowler" <alex.murat...@gmail.com>:> I'm trying to build this project: https://github.com/clojure

Re: Compiling the Android version of Clojure

2013-05-21 Thread Kelker Ryan
p me aside from that maybe maven will somehow manage to reolve the deps...On Wed, May 22, 2013 at 12:18 AM, Kelker Ryan <theinter...@yandex.com> wrote:Did you run ./antsetup.sh before trying to build with ant? 22.05.2013, 05:01, "Alex Fowler" <alex.murat...@gmail.com>:Nope, the i

[ANN] Pedestal 0.1.7 has been released.

2013-05-24 Thread Ryan Neufeld
those two things. Expect more details in the coming weeks and months. I hope to write a blog article in the next week or so showcasing what the new dataflow engine can do. You'll find the full changelog for this and other changes here: http://git.io/dHCnJQ. - Ryan and the rest of th

Re: Any alternatives for these two ugly patterns?

2013-05-25 Thread Kelker Ryan
Here's my solution to your problem. Let me know if it helps. ``` user> (defn if-attr [-key obj missing] (if-let [ret (get obj -key)] ret (assoc obj -key missing))) #'user/if-attr user> (if-attr :abc {} "missing-value") {:abc "missing-value"} user> (if-attr :abc {:abc 123} "missing-value") 1

Re: Loop run until a Clojure Agent send-off is complete

2013-05-27 Thread Kelker Ryan
I wrote it for fun and deleted after no one took interest. There was no real purpose other than to see if it could be done.  28.05.2013, 08:33, "Plínio Balduino" :404?On May 10, 2013 8:04 AM, "Kelker Ryan" <theinter...@yandex.com> wrote:I would like to share a library

Re: Loop run until a Clojure Agent send-off is complete

2013-05-27 Thread Kelker Ryan
I can't watch videos at the moment, so would you mind writing a short summary?  28.05.2013, 10:12, "atkaaz" :I find this might be helpful in this situation:Google I/O 2009 - The Myth of the Genius Programmerhttps://www.youtube.com/watch?v=0SARbwvhupQOn Tue, May 28, 2013 at 4:02

Re: Loop run until a Clojure Agent send-off is complete

2013-05-28 Thread Kelker Ryan
I'll re-write it, but I have my doubts as to why anyone would use it. It was just an experiment to see if it could be done. 29.05.2013, 05:22, "Dan Neumann" : > Aw, come on. No need to squander value back out of the world. > > On Monday, May 27, 2013 8:02:28 PM UTC-

Re: No-source-path ??

2013-06-03 Thread Kelker Ryan
Try this. cd my-website lein repl (load-file "src/my-website/models/db.clj") 03.06.2013, 15:20, "jayvandal" : > I am trying to run the my-website.My structure is >                      my-website top level >                              src >                                my-website >          

Re: Best IDE

2013-06-04 Thread Kelker Ryan
Have you tried Eclipse Emacs+? http://marketplace.eclipse.org/content/emacs 04.06.2013, 21:41, "Korny Sietsma" :My 2c - I use emacs, I love it.  I don't inflict it on my team, and I strongly disagree with it being "easy".  To learn the basics, yes, but full fluency?  If you have someone fluent in I

parsing xml with zip, xml and clojure.data.zip

2013-06-05 Thread Ryan Moore
Hi, I've read http://nakkaya.com/2009/12/07/zipping-xml-with-clojure/ and http://stackoverflow.com/questions/1194044/clojure-xml-parsing/9595315#comment24442712_9595315 , but the usage of (xml->) is still mysterious to me. If I have this for my xml file... (def myxml (zip-str "

Re: parsing xml with zip, xml and clojure.data.zip

2013-06-05 Thread Ryan Moore
Ahh, so if the var refers to the root that would explain why specifying the root never returns anything. Thanks. On Wednesday, June 5, 2013 11:54:49 AM UTC-4, Stefan Kamphausen wrote: > > AFAIK your var myxml already refers to the root node of your XML > document. > > So your first example sea

Re: Making cryptograms, my first Clojure function. Feedback welcome.

2013-06-10 Thread Kelker Ryan
Here's my re-write. user> (defn gen-crypto [] (let [atoz (range 65 91) upper (map char atoz) lower (map #(char (+ % 32)) atoz) digit (range 10) [sl su sd] (map shuffle [lower upper digit]) encrypt (reduce conj

Re: Making cryptograms, my first Clojure function. Feedback welcome.

2013-06-10 Thread Kelker Ryan
> (map #(char (+ 48 %)) (range 10))(\0 \1 \2 \3 \4 \5 \6 \7 \8 \9)will fix that issue. Or (map char (range 48 58))On Monday, June 10, 2013 7:42:45 PM UTC-7, Kelker Ryan wrote:Here's my re-write. user> (defn gen-crypto [] (let [atoz (range 65 91) upper (map char atoz)

Re: swap keys / values in hash map

2013-06-11 Thread Kelker Ryan
 This is the easiest way to swap the keys with the values in a hash-map.(defn flip-map [m] (zipmap (vals m) (keys m))) #'user/flip-map user> (def m1 (apply hash-map (range 8))) #'user/m1 user> m1 {0 1, 2 3, 4 5, 6 7} user> (def m2 (flip-map m1)) #'user/m2 user> m2 {7 6, 5 4, 3 2, 1 0} 11.06.2013,

Re: alter a map in a vector (reference)

2013-06-11 Thread Kelker Ryan
I've seen some interesting responses, but here's my solution. user> (def example (ref [{:id 1 :email {"a...@mail.com" 1}} {:id 2 :email {"d...@mail.com" 1}} {:id 3 :email {"g...@mail.com" 2}} {:id 4 :email {"f...@mail.com" 2}}])) #'user/example user>

Re: alter a map in a vector (reference)

2013-06-11 Thread Kelker Ryan
Here's the refactored version.user> (def example (ref [{:id 1 :email {"a...@mail.com" 1}} {:id 2 :email {"d...@mail.com" 1}} {:id 3 :email {"g...@mail.com" 2}} {:id 4 :email {"f...@mail.com" 2}}])) #'user/example user> (defn

Re: problem using gen-class and using the class name in the same file

2013-06-12 Thread Kelker Ryan
There are two things that I've notice about your code that could probably be the cause. In the :constructors section of :gen-class, you're refering to test-gen.Tata although it doesn't exist yet. The -pre-init function also tries to call a class that doesn't exist yet. 12.06.2013, 16:39, "Armel Esn

Re: Making cryptograms, my first Clojure function. Feedback welcome.

2013-06-12 Thread Kelker Ryan
No problem. I re-wrote your latest version, so let me know what you think. tdsl.core> (defn make-crypto [] (let [char-range #(map char (range (int %1) (-> %2 int inc))) [l u d] (map char-r

[ANN] Pedestal 0.1.9 has been released

2013-06-14 Thread Ryan Neufeld
p or service (hint: it's 'start'.) You'll find the full changelog for this and other changes here: http://git.io/dHCnJQ. - Ryan and the rest of the Pedestal team -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post t

Re: [ANN] Pedestal 0.1.9 has been released

2013-06-15 Thread Ryan Neufeld
This release shouldn't change that much (with the exception of some bugs you could have run into). Regardless, Brenton has been working hard at preparing a full tutorial of pedestal-app. We're expecting to release that in just under a month or so. On Friday, June 14, 2013 10:00:02 PM UTC-4,

Re: simple brute-force password cracker runs out of memory

2013-06-16 Thread Kelker Ryan
Have you tried wrapping recursive calls with lazy-seq? (defn brute-force "..." ([...] ...) ([check-pred possibilities] (lazy-seq (apply brute-force 4 check-pred possibilities Here's a token-types rewrite (def token-types (let [-chars #(map char (range (int %1) (-> %2 int inc

Re: Multiple args: opts map vs inline arguments

2013-06-18 Thread Kelker Ryan
 The code for dmirylenka's release-sharks form tdsl.search> (defn release-sharks [n & {:keys [laser-beams]}]       (if (boolean laser-beams) (repeat (int n) :shark)))#'tdsl.search/release-sharkstdsl.search> (release-sharks 2 :laser-beams 1)(:shark :shark)  18.06.2013, 14:32, "dmirylenka" :Accor

Re: In what OS do you code?

2013-06-18 Thread Kelker Ryan
Arch Linux, but moving to Manjaro for a more stable and simple version of the distro. The editor is Emacs + nrepl.el + clojure-mode + ritz + rainbow parens + eldoc + ac. 18.06.2013, 14:47, "dmirylenka" :OS X on the working machine, Ubuntu on the servers.For my project it makes little difference, es

Web Framework update

2013-06-21 Thread Kelker Ryan
Some major changes have been made to the CHP framework. This library provides the following Clojure on the front end Run Clojure inside a HTML file with the tagsStyle templates can be written in CHTML ex. chp.template/using-template Parameters Request params ex. ($p userid)Common web headers ex. (

Re: Database migrations

2013-06-25 Thread Kelker Ryan
To answer your first email, here's a Lobos based migration using the CHP framework https://github.com/runexec/chp#db-migrations. The configuration file is in resources/config/db.clj and is used by clojure.java.jdbc, KormSQL, and Lobos. 26.06.2013, 04:38, "Marian Schubert" :Hello, few days ago I ext

Re: Interleaving

2013-06-27 Thread Kelker Ryan
Try this.  user> (def xy [:x1 :y1 :x2 :y2 :x3 :y3])(as-> xy _ (partition 2 _) (interleave _ [:z1 :z2 :z3]) (flatten _))#'user/xy(:x1 :y1 :z1 :x2 :y2 :z2 :x3 :y3 :z3)user>  27.06.2013, 19:55, "Paul Meehan" :Hi,Given a sequence (x1, y1, x2, y2, x3, y3,...)and another (z1, z2, z3, ...)I wa

Re: [ANN] Pedestal 0.1.9 has been released

2013-07-03 Thread Ryan Neufeld
It's so close I can almost taste it. Most Relevance Pedestallions are going to be doing what I think is a final review on Friday. I really think you folks are going to enjoy it. -- Ryan Neufeld On Jul 3, 2013, at 6:47 AM, Leon Talbot wrote: >> Brenton has been working hard at

Re: [ANN] Pedestal 0.1.9 has been released

2013-07-03 Thread Ryan Neufeld
Docs first, videos in a bit. I don't want this to be like that Christmas where you thought you were going to get *all* the presents and you were all disappointed but had to put on a brave face to seem like you still appreciated it. -- Ryan Neufeld On Jul 3, 2013, at 7:20 AM, Mayank

Leiningen and s3-wagon-private load order issues?

2013-07-05 Thread Ryan Stradling
vate. Are there any workarounds to this? Thanks, Ryan -- -- 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 wit

Re: Leiningen and s3-wagon-private load order issues?

2013-07-05 Thread Ryan Stradling
ot; #(eval '(org.springframework.aws.maven.PrivateS3Wagon.))) But still get the same no connector available to access repository On Friday, July 5, 2013 11:17:00 AM UTC-4, Ryan Stradling wrote: > > I have created a lein plugin called lein-install. Lein install is > published to a private s3 repo using s3-

[ANN] Pedestal 0.1.10 has been released

2013-07-05 Thread Ryan Neufeld
ion (among other improvements.) You'll find the full changelog for this and other changes here: http://git.io/_vm7wQ. - Ryan and the rest of the Pedestal team -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: Leiningen and s3-wagon-private load order issues?

2013-07-05 Thread Ryan Stradling
this is not reliable behavior or if there is (or will be) a better way to handle this. Thanks, Ryan On Friday, July 5, 2013 11:29:46 AM UTC-4, Ryan Stradling wrote: > > I also found this thread > http://librelist.com/browser//leiningen/2012/8/29/plugins-can-t-be-on-s3/#648e7f85c85

Re: Pedestal introduction question

2013-07-05 Thread Ryan Neufeld
est to the pedestal/docs repo if you run into stuff like this [2]. -Ryan [1]: https://github.com/pedestal/docs/blob/master/documentation/application-introduction.md [2]: https://github.com/pedestal/docs On Thursday, July 4, 2013 12:22:25 PM UTC-4, Greg Slepak wrote: > > Thanks! Yeah it&#

Re: Offline Clojure docs

2013-07-05 Thread Kelker Ryan
wget -k -m http://clojure-doc.org/wget -k -m http://clojuredocs.org/ 06.07.2013, 12:59, "Tom Faulhaber" :It's easy to pull the autodoc documentation for offline use. You can either do this: $ git clone https://github.com/clojure/clojure.git clojure-api$ cd clojure-api$ git checkout gh-pages or you

  1   2   3   4   >