Re: Like if, but it composes functions

2013-02-20 Thread Laurent PETIT
Hello, Why the names fix / to-fix ? 2013/2/20 Alan Malloy a...@malloys.org: Useful has functions that do this and more: fix or to-fix, according to taste. Your iffn is just the three-argument case of to-fix: (def magnify (to-fix pos? inc dec)). But fix and to-fix accept more or fewer

Re: Like if, but it composes functions

2013-02-20 Thread Alan Malloy
You can use fix to take some data that might not be right (say, an integer that might actually be a string) and fix it by applying read-string: (fix 10 string? read-string). to-fix returns a function you can use to fix things. On Wednesday, February 20, 2013 12:06:36 AM UTC-8, Laurent PETIT

Re: Like if, but it composes functions

2013-02-20 Thread Laurent PETIT
2013/2/20 Alan Malloy a...@malloys.org: You can use fix to take some data that might not be right (say, an integer that might actually be a string) and fix it by applying read-string: (fix 10 string? read-string). to-fix returns a function you can use to fix things. OK, I thought there was

Re: Clojure Performance For Expensive Algorithms

2013-02-20 Thread Phillip Lord
Geo ggrigor...@gmail.com writes: I am cross-posting my Clojure question from StackOverflow. I am trying to get an algorithm in Clojure to match Java speed and managed to get the performance to within one order of magnitude and wondering if more is possible. The full question is here:

Create map from vector of keywords and other items

2013-02-20 Thread Stefan Kamphausen
Hi, given a vector of the form [:key1 1 2 3 :key2 4 :key3 5 6 7] I wand to create a map collecting the items behind each keyword as a vector like this: {:key1 [1 2 3] :key2 [4] :key3 [5 6 7]} I have already written two functions which achieve this, but neither of them feels good

Re: Create map from vector of keywords and other items

2013-02-20 Thread Jim foo.bar
'keycollect-partition' looks sensible and idiomatic to me... perhaps juxt can come into play here? Of course, both versions will only work with keys as keywords and non-keys as non-keywords. If you use anything else other than a keyword for a key or a keyword for an item, both will break...

Re: Using local jar

2013-02-20 Thread Jarod
It worked after I installed leinigen 2, then ran the same commands that I listed in my previous post. Ben, I'm not sure why the deploy command gave the same error, but I appreciate your detailed response. KK, if I have more problems in the future, I'll be sure to try your recommendation.

Re: kerodon tests explode on lazyseq (session app)

2013-02-20 Thread larry google groups
It was a bug in kerodon that happens when a ring response has a :body that is a not a string (in this case a lazyseq). Reported and fixed by Travis Vachon at https://github.com/xeqi/kerodon/pull/6, I just had lost track of making a release for it. Fixed as part of [kerodon 0.1.0].

Re: Create map from vector of keywords and other items

2013-02-20 Thread Thomas Heller
Not sure if this is any more idiomatic, or feels any better, but I thought a loop would be appropriate here, plus I made key selection pluggable. https://gist.github.com/thheller/4995766 (defn split-into-map [items key-fn] see gist) key-fn is a function which accepts one arg and should return

Re: kerodon tests explode on lazyseq (session app)

2013-02-20 Thread larry google groups
I would like to suggest that a future version of Kerodon have something like text? but checking for a substring, rather than equality. I have been running my tests against my real-world templates, so I get failures for stuff like this: FAIL in (anyone-can-view-frontpage) (core_test.clj:15)

how would you implement sending out a verification email?

2013-02-20 Thread Balint Erdi
Hey, So yesterday we discussed concurrency at our meetup (http://www.meetup.com/Budapest-Clojure-User-Group/) and a question occurred to me. Suppose we have a classic web application. (I'm not currently building such a web app in Clojure, so that's a theoretical question). When the user

Re: Like if, but it composes functions

2013-02-20 Thread James MacAulay
Ben: of course, haha...making it a macro seems rather silly now :P Alan: I didn't know about useful before, thanks for the pointer! fix and to-fix look great. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Faster lein

2013-02-20 Thread Buck Golemon
I see that lein2 has factored out the 'interactive' command. Can I use lein1 and expect the various clojure libraries and templates to work? There's been several mentions of jark in relation to speeding up lein. From what I see, it doesn't seem battle tested. Do any of you use it on a daily

Re: Google Summer of Code 2013

2013-02-20 Thread Maik Schünemann
given the current position of core.logic and core.typed I wonder if it would be in range of a gsoc project to implement something similar to Qis type system for clojure (here is a link to an example of using Qis type system

Re: Faster lein

2013-02-20 Thread Ulises
I've been using drip with quite some success (with the exception of midje tests which seem to launch their own jvm every time.) On 20 February 2013 15:53, Buck Golemon workithar...@gmail.com wrote: I see that lein2 has factored out the 'interactive' command. Can I use lein1 and expect the

Re: Google Summer of Code 2013

2013-02-20 Thread Ambrose Bonnaire-Sergeant
Interesting idea, but the specifics of the project are not clear to me. Could you flesh out what you're trying to achieve in particular? Would you build on top of core.logic and core.typed? Thanks, Ambrose On Thu, Feb 21, 2013 at 12:13 AM, Maik Schünemann maikschuenem...@gmail.com wrote:

Re: Faster lein

2013-02-20 Thread Softaddicts
SSD + fastest laptop in your price range ;) lein2 help takes 12 seconds from start to back at command prompt... We have a huge build here with 9 distinct projects, AOT, ... lein is fired up maybe a dozen times and it takes a bit above 3 mns elapsed time and 2mns of cpu time. Quite happy to live

Re: Google Summer of Code 2013

2013-02-20 Thread David Nolen
It's probably possible but too broad a scope for GSoC 2013. I think the community would be better served by directly contributing to core.logic core.typed both of which could use lots of help :) On Wed, Feb 20, 2013 at 11:13 AM, Maik Schünemann maikschuenem...@gmail.com wrote: given the

Re: Faster lein

2013-02-20 Thread Softaddicts
Drip does not give me any significant advantage on my hardware... I think that most of this 12 seconds is spent compiling and initializing all the plugins on top of lein and clojure itself. One day I will have some time to spit out a tool to create a local AOT version of all these nice tools to

Re: Faster lein

2013-02-20 Thread Phillip Lord
I've got very variable performance from drip. In some cases, it's slower. My guess is that it runs the application in the last JVM, and spins up the new one to replace it at the same time. On slow machines, this is problematic. Personally, I use patience; I find this solves all my problems.

Re: Faster lein

2013-02-20 Thread Softaddicts
You should have worked on a vax-725 with a removable 10mb disk the size if a large pizza 4 inches thick . It would have torned your patience to snowflakes which are presently falling on my head, almost as white as my hairs which have been whitening over years of waiting after the then really too

Re: Like if, but it composes functions

2013-02-20 Thread Jonathan Fischer Friberg
Function composition similar to that has been explored a lot in the haskell world. See: http://www.haskell.org/haskellwiki/Arrow I also made a small library to implement some of the operators: https://github.com/odyssomay/clj-arrow I think the reason arrows are so interesting in haskell is

Re: Google Summer of Code 2013

2013-02-20 Thread Ambrose Bonnaire-Sergeant
I've added two projects related to core.typed. FYI: I am technically qualified to participate as a student in GSoC 2013, but I may participate as a mentor instead. I'm hoping to find out in the next few weeks. http://dev.clojure.org/display/community/Project+Ideas#ProjectIdeas-TypeSystems On

Re: Faster lein

2013-02-20 Thread Phil Hagelberg
Softaddicts writes: SSD + fastest laptop in your price range ;) lein2 help takes 12 seconds from start to back at command prompt... FWIW the help task is basically the worst case scenario for measuring startup time since it has to load every single task in order to get docstrings for them. If

Re: Google Summer of Code 2013

2013-02-20 Thread David Nolen
I've added some projects I'm willing to mentor as well http://dev.clojure.org/display/community/Project+Ideas On Wed, Feb 20, 2013 at 1:10 PM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: I've added two projects related to core.typed. FYI: I am technically qualified to

Re: Create map from vector of keywords and other items

2013-02-20 Thread Mauricio Aldazosa
Don't know if it's better, but: (apply hash-map (map-indexed #(if (= 0 (mod %1 2)) (first %2) (vec %2)) (partition-by keyword? [:key1 1 2 3 :key2 4 :key3 5 6 7]))) Seems to work. Mauricio -- -- You received this message because you are subscribed to the Google

Unable to Authenticate via Friend + Interactive Form Workflow

2013-02-20 Thread Ari
Hi, I'm trying to incorporate authentication via the interactive form workflow; however, I'm currently unable to receive submitted credentials for verification. When I submit the sign-in form that has it's action bound to /login, I get Page not found as per my default route below. I've

Clojure-CLR - Where to report issues?

2013-02-20 Thread Frank Hale
I wanted to report an issue with Clojure-CLR 1.4.1 that I am seeing but the issues section on the Clojure-CLR Github must be disabled because the link is not showing up. When I run the REPL I get a lot of duplicated warnings. I've pasted the warnings below.

Re: Unable to Authenticate via Friend + Interactive Form Workflow

2013-02-20 Thread Nelson Morris
On Wed, Feb 20, 2013 at 2:48 PM, Ari ari.brandeis.k...@gmail.com wrote: Hi, I'm trying to incorporate authentication via the interactive form workflow; however, I'm currently unable to receive submitted credentials for verification. When I submit the sign-in form that has it's action bound to

Re: Unable to Authenticate via Friend + Interactive Form Workflow

2013-02-20 Thread Ilshad Khabibullin
Hi Ari, you have to add wrappers: ring.middleware.params/wrap-parms ring.middleware.keyword-params/wrap-keyword-params --- Ilshad Khabibullin +7 981 688 26 35 On Feb 21, 2013, at 12:48 AM, Ari ari.brandeis.k...@gmail.com wrote: Hi, I'm trying to incorporate authentication via the

Re: Clojure-CLR - Where to report issues?

2013-02-20 Thread Andy Fingerhut
I believe anyone should be able to create an account at this web site and then create a ticket. If you have any trouble doing so, let me know. http://dev.clojure.org/jira/browse/CLJCLR Andy On Feb 20, 2013, at 12:58 PM, Frank Hale wrote: I wanted to report an issue with Clojure-CLR

Re: Clojure-CLR - Where to report issues?

2013-02-20 Thread Frank Hale
Thank you. New ticket created. On Wed, Feb 20, 2013 at 4:20 PM, Andy Fingerhut andy.finger...@gmail.comwrote: I believe anyone should be able to create an account at this web site and then create a ticket. If you have any trouble doing so, let me know.

Re: Faster lein

2013-02-20 Thread AtKaaZ
on win7 64bit Microsoft Windows [Version 6.1.7601] C:\Users\usercd \1 C:\1powershell Windows PowerShell Copyright (C) 2009 Microsoft Corporation. All rights reserved. PS C:\1 Measure-Command {*lein version*} Days : 0 Hours : 0 Minutes : 0 Seconds :

Re: Faster lein

2013-02-20 Thread Softaddicts
I am around the same figures, mostly cpu time. If I take our software which is AOT compiled, I can eval nil (or simple values) through clojure.man in 0.9 seconds. I see this as a significant improvement, we use about two dozen Clojure libs, most of which get at least partially compiled prior to

Re: Clojure-CLR - Where to report issues?

2013-02-20 Thread dmiller
Judging from the transcript, there is something not right in your ClojureCLR setup. protocols.clj should not be loading. It should be AOT-compiled. We can work from the JIRA ticket. -David On Wednesday, February 20, 2013 3:30:52 PM UTC-6, Frank Hale wrote: Thank you. New ticket created.

Re: Unable to Authenticate via Friend + Interactive Form Workflow

2013-02-20 Thread Ilshad Khabibullin
Ah, thanks. On Feb 21, 2013, at 1:42 AM, larry google groups lawrencecloj...@gmail.com wrote: ring.middleware.params/wrap-parms ring.middleware.keyword-params/wrap-keyword-params No, he already has: (handler/site)) Which should add in the middleware that you mention. But in my

Re: Clojure-CLR - Where to report issues?

2013-02-20 Thread Frank Hale
okay, I just compiled from the Clojure-CLR 1.4.1 branch in 'Release' mode and then copied the binaries out to a directory and opened a terminal there to run the REPL. On Wed, Feb 20, 2013 at 4:42 PM, dmiller dmiller2...@gmail.com wrote: Judging from the transcript, there is something not right

Re: Unable to Authenticate via Friend + Interactive Form Workflow

2013-02-20 Thread Ari
Passing a :login-uri causes workflows/interactive-from to change what uri it checks for. Given the setup above the login form needs to post to /. I was under the impression that the :login-uri was on for only getting the form. Do you know if the GET and POST uris can be separated via

a bit mystified by unchecked-multiply

2013-02-20 Thread John Lawrence Aspden
Hi, I'm getting an unexpected exception trying to do unchecked arithmetic: user= (def seed1 25214903917) #'user/seed1 user= (type seed1) java.lang.Long user= (type 25214903917) java.lang.Long user= (unchecked-multiply seed1 0x5DEECE66D) ArithmeticException integer overflow

Re: a bit mystified by unchecked-multiply

2013-02-20 Thread AtKaaZ
looks like different methods are called: for: user= (unchecked-multiply 25214903917 0x5DEECE66D) this method: static public long unchecked_multiply(long x, long y){return x * y;} for: (unchecked-multiply seed1 0x5DEECE66D) this method: static public Number unchecked_multiply(long x, Object

Re: a bit mystified by unchecked-multiply

2013-02-20 Thread AtKaaZ
looks like if you make any(or both) to double it works as expected due to these being called: static public double multiply(double x, double y){ return x * y; } static public double multiply(double x, long y){ return x * y; } static public double multiply(long x, double y){ return x

Re: a bit mystified by unchecked-multiply

2013-02-20 Thread Herwig Hochleitner
I agree that unchecked-multiply should do an unchecked multiply, even when faced with objects. Going to bring that up on clojure-dev. A workaround: (unchecked-multiply (long seed1) 0x5DEECE66D) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Clojure Performance For Expensive Algorithms

2013-02-20 Thread Stephen Compall
On Feb 20, 2013 5:55 AM, Phillip Lord phillip.l...@newcastle.ac.uk wrote: (do (assoc curr (inc j) 0) (recur (inc j) max-len))) Here you're discarding the result of assoc, a pure function, which changes the code's nature

Re: [ANN] Javelin, spreadsheet-like FRP for ClojureScript

2013-02-20 Thread Devin Walters
Surprised this hasn't gotten more attention. Well done. Looking forward to using this on future projects. '(Devin Walters) On Feb 20, 2013, at 1:33 AM, Alan Dipert a...@dipert.org wrote: Hi all, We recently released a ClojureScript library for FRP called Javelin. Links of interest: *

Re: [ANN] Javelin, spreadsheet-like FRP for ClojureScript

2013-02-20 Thread Rich Morin
On Feb 20, 2013, at 1:33 AM, Alan Dipert wrote: We recently released a ClojureScript library for FRP ... On Feb 20, 2013, at 17:02, Devin Walters wrote: Surprised this hasn't gotten more attention. Well done. Looking forward to using this on future projects. Indeed. I'm a big fan of FRP:

Re: how would you implement sending out a verification email?

2013-02-20 Thread James Reichley
I can't find the reference now, but either in a screencast or a discussion I read it was mentioned that if you have a single thing that performs side-effects, you can perform this function last in the transaction without worrying about any issues. The reasoning here is that if anything before

Re: [ANN] Javelin, spreadsheet-like FRP for ClojureScript

2013-02-20 Thread Devin Walters
I think Alan provided more than enough info in his announcement. FRP (Functional Reactive Programming) is a pretty well-known acronym 'round these parts, and the links he provides go a long way toward giving context to FRP beginners. In any event, I'm going to go ahead and assume TLA refers

Re: Create map from vector of keywords and other items

2013-02-20 Thread Elias Zaretsky
And this is mine (defn keycollect-too [key-fn coll] (let [not-key (complement key-fn)] (loop [[k more] coll, res (transient {})] (let [[vv rr] (split-with not-key more)] (if-not k (persistent! res) (recur rr (assoc! res k (vec vv (keycollect-too

Re: Create map from vector of keywords and other items

2013-02-20 Thread AtKaaZ
whatever the implementation I would include some example in the doc, like: (defn keycollect-*fnnamehere** **input: [:key1 1 2 3 :key2 4 :key3 5 6 7] output: {:key1 [1 2 3] :key2 [4] :key3 [5 6 7]} * [coll] ;... implementation here ) wish clojure has this kind of doc(s) instead,