Hello,
Why the names fix / to-fix ?
2013/2/20 Alan Malloy :
> 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 arguments as
> well, s
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
2013/2/20 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.
OK, I thought there was some more g
Geo 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:
>
> http://stackoverfl
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"
'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...
J
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.
T
> 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"].
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
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)
expect
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 si
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 c
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
ba
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
http://programmingkungfuqi.blogspot.de/2006/04/qi-and-magic-prime-type.html
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 wrote:
> I see that lein2 has factored out the 'interactive' command.
>
> Can I use lein1 and expect the various clojure librar
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 wrote:
> given the current position of
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 i
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 wrote:
> given the current position of core.logi
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
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.
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 s
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 beca
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 Thu
Buck Golemon writes:
> Can I use lein1 and expect the various clojure libraries and templates to
> work?
Not really. You could use it on your own projects if you stick to a
subset of project.clj that's supported on both, but you would be
hampered contributing to other projects.
Most templates
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. I
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 p
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
Gr
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
inc
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.
C:\Users\Frank.Hale\Desktop\clojure-clr
On Wed, Feb 20, 2013 at 2:48 PM, Ari 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
> "/login", I get "Pag
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 wrote:
> Hi,
>
> I'm trying to incorporate authentication via the interactive form workflow;
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 1.4.
Thank you. New ticket created.
On Wed, Feb 20, 2013 at 4:20 PM, Andy Fingerhut wrote:
> 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 win7 64bit
Microsoft Windows [Version 6.1.7601]
C:\Users\user>cd \1
C:\1>powershell
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\1> Measure-Command {*lein version*}
Days : 0
Hours : 0
Minutes : 0
Seconds
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 l
> 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 app I have:
handler/site)
instead of:
(handler/site))
I think it gets rolled up and called at the en
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.
>
Ah, thanks.
On Feb 21, 2013, at 1:42 AM, larry google groups
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 app I have:
>
>
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 wrote:
> Judging from the transcript, there is something not right in your
> ClojureCLR
> 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
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
clojure.lang.Numbers
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
y){r
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
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 p
Herwig Hochleitner writes:
>> I understand not delivering AOT libs through maven not knowing the target
>> environment but having a tuning tool to speed up loading by avoiding
> compilation
>> would help with all the tooling starting to appear.
>
> How about a lein-bytecache plugin, that can AOT
On Feb 20, 2013 5:55 AM, "Phillip Lord"
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 significantly.
>
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 wrote:
> Hi all,
> We recently released a ClojureScript library for FRP called Javelin. Links
> of interest:
>
> * Release ann
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
By the way, in a speech at November's Clojure/conj, some guy remarked that
queues are good, and the mere fact that he hadn't found it necessary for
Clojure to wrap them shouldn't signal that there's something wrong with
them. When a queue would help, use a queue.
In your application... well,
Here's my take:
(defn partition' [coll]
(let [coll' (partition-by keyword? coll)]
(reduce merge {}
(map vector (flatten (take-nth 2 coll')) (take-nth 2 (rest
coll'))
Note that this breaks if some keys point to empty sets
On Wednesday, February 20, 2013 6:50:42 AM UTC-5, St
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 it
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 to
James, I remember something similar to that from this thread:
https://groups.google.com/d/msg/datomic/uzmt03egSHI/ThCLFK2iIaMJ
On Thu, Feb 21, 2013 at 3:46 AM, James Reichley wrote:
> I can't find the reference now, but either in a screencast or a discussion
> I read it was mentioned that if you
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 k
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,
I have a lein project, if using lein2(lein2 deps), it gives me the
following errors:
james:alitoolkit(git:master)$ lein deps
Could not find metadata
com.alibaba.platform.shared:dubbo.rpc/maven-metadata.xml in local
(/home/james/.m2/repository)
Could not find metadata
com.alibaba.platform.share
Thanks! But it sounds odd to me that lein does not use ~/.m2/settings.xml,
why this decision?
From: Michael Klishin
Reply-To:
Date: Thu, 21 Feb 2013 11:45:51 +0400
To:
Subject: Re: does lein2 use repositories defined in ~/.m2/settings.xml?
2013/2/21 James Xu
> so it seems that lein2 does
57 matches
Mail list logo