Re: testing clojure.core/group-by with clojure.test.check

2014-05-01 Thread henry w
thanks Alex and others for helping out. Some very interesting ideas here but the one about leveraging the grouping function seemed easy and reading that was an epiphany moment where i realised i had been subconsciously constrained by thinking I should generate data and use a grouping fn that

Re: clojure code to java

2014-05-01 Thread henry w
for understanding what goes on in clojure to class file compilation, i have found this blog series very interesting: http://blog.guillermowinkler.com/blog/2014/04/27/decompiling-clojure-iii/ On Thursday, May 1, 2014 5:56:08 AM UTC+1, Andy Fingerhut wrote: Leiningen can convert Clojure source

Re: Access the datastructure used to create a function?

2014-05-01 Thread henry w
related to this discussion and v. interesting: http://blog.guillermowinkler.com/blog/2014/04/27/decompiling-clojure-iii/ On Tuesday, November 26, 2013 10:04:12 PM UTC, Guru Devanla wrote: The important caveat here is what do we label as data?. If we are okay with just 'streams of bytes'

Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-01 Thread Phillip Lord
Sean Corfield s...@corfield.org writes: Short, clear docstrings and well-structured code with well-named symbols short provide enough information for maintenance. But, sadly, not enough documentation for use. The state of Clojure survey brings up complaints about the documentation of

Re: clojure code to java

2014-05-01 Thread Phillip Lord
I've used procyon https://bitbucket.org/mstrobel/procyon/wiki/Java%20Decompiler It decompiles all of clojure.core and produces nicely laid out code (see below). package clojure; import clojure.lang.*; public final class core$first extends AFunction { public Object invoke(Object coll) {

[pre-ANN] Clortex - a VisiCalc for Machine Intelligence Based on Neuroscience?

2014-05-01 Thread Fergal Byrne
Until today, I've been developing Clortex using a private repo on Github. While far from complete, I feel that Clortex is now at the stage where people can take a look at it, give feedback on the design, and help shape the completion of the first alpha release over the coming weeks. I'll be

Re: Do not understand the - macro here

2014-05-01 Thread Roelof Wobben
Is this a nice explanation about macros : http://bryangilbert.com/code/2013/07/30/anatomy-of-a-clojure-macro/ or is there a better one for a beginner. Roelof -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: clojure code to java

2014-05-01 Thread Alex Miller
In general, the bytecode the Clojure compiler produces is not directly transformable back into Java source by any decompiler I'm aware of. On Wednesday, April 30, 2014 11:56:08 PM UTC-5, Andy Fingerhut wrote: Leiningen can convert Clojure source code to Java .class files (compiled Java byte

Re: difference in behavior for :let modifiers in for vs. doseq

2014-05-01 Thread Alex Miller
The code in question is of course easily transformable into: (let [a 1] (for [b '(1 2 3)] (println a b))) and I think that most examples people have given are similarly rewritable. I'm generally in favor of fixing nits like this (removing exceptional cases) so the question does not need to be

Re: Parameter order for APIs

2014-05-01 Thread Alex Miller
On Wednesday, April 30, 2014 10:22:55 PM UTC-5, Colin Fleming wrote: Hi everyone, After the very interesting keyword argument debate, I have another question about API design. Specifically I'm interested in suggestions about parameter order. The new API guidelines, which have changed

Re: Do not understand the - macro here

2014-05-01 Thread Erlis Vidal
I think the confusion is because they used multiple values when comparing the equality (= (__ (sort (rest (reverse [2 5 4 1 3 6] (- [2 5 4 1 3 6] (reverse) (rest) (sort) (__)) 5) This can be seen as : (def A (__ (sort (rest (reverse [2 5 4 1 3 6]) (def B (- [2 5 4 1 3 6] (reverse)

Re: Do not understand the - macro here

2014-05-01 Thread Roelof Wobben
Op donderdag 1 mei 2014 15:20:38 UTC+2 schreef Erlis Vidal: I think the confusion is because they used multiple values when comparing the equality (= (__ (sort (rest (reverse [2 5 4 1 3 6] (- [2 5 4 1 3 6] (reverse) (rest) (sort) (__)) 5) This can be seen as : (def A (__

Re: [ANN] om-start lein template for nrepl compliant editors/IDEs

2014-05-01 Thread Ivan L
Thanks mimmo! Looking forward to trying this out. -- 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.

Re: clojure code to java

2014-05-01 Thread Phillip Lord
Really, try procyon. Of course, it depends on whether you mean java code that you can look at, and get an idea of what is going on easier than looking at bytecode, or java code that you can compile to get the same thing that you decompiled. The latter no, but the former works. Phil Alex Miller

Re: Do not understand the - macro here

2014-05-01 Thread Maik Schünemann
On Thu, May 1, 2014 at 3:51 PM, Roelof Wobben rwob...@hotmail.com wrote: Op donderdag 1 mei 2014 15:20:38 UTC+2 schreef Erlis Vidal: I think the confusion is because they used multiple values when comparing the equality (= (__ (sort (rest (reverse [2 5 4 1 3 6] (- [2 5 4 1 3 6]

Re: Do not understand the - macro here

2014-05-01 Thread Maik Schünemann
The task is to replace __ with the function that makes this true in this case makes [1 2 3 4 5] to 5 On Thu, May 1, 2014 at 4:23 PM, Maik Schünemann maikschuenem...@gmail.comwrote: On Thu, May 1, 2014 at 3:51 PM, Roelof Wobben rwob...@hotmail.com wrote: Op donderdag 1 mei 2014 15:20:38

Re: Do not understand the - macro here

2014-05-01 Thread Erlis Vidal
Look that (def A ...) won't compile as given, so you cannot say A is [1 2 3 4 5], A is something else once you make it compile filling the blank space with the missing function. On Thu, May 1, 2014 at 10:24 AM, Maik Schünemann maikschuenem...@gmail.comwrote: The task is to replace __ with the

Re: Do not understand the - macro here

2014-05-01 Thread Roelof Wobben
oke, I misunderstood everyone. The right answer is last. (def A (__ (sort (rest (reverse [2 5 4 1 3 6]) which would be : (def A (last (sort (rest (reverse [2 5 4 1 3 6]) which resolves to 5 (def B (- [2 5 4 1 3 6] (reverse) (rest) (sort) (__))) Which would be : (def B (- [2 5 4 1

Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-01 Thread Mars0i
On Wednesday, April 30, 2014 1:03:24 PM UTC-5, Gregg Reynolds wrote: The one thing that I think would be genuinely useful and developer friendly with respect to Clojure is a means of making type signatures explicit. Clojure may be dynamically typed, but everything has an intended type,

Re: Datascript and React.js for a Clojure web app

2014-05-01 Thread blake
Looks good. Is the admin login supposed to work? On Wed, Apr 30, 2014 at 6:32 AM, Gijs S. gijsstuur...@gmail.com wrote: Hi all, I've released a Clojure web application. It includes a front-end using DataScript and React.js in ClojureScript. More details here:

Re: [ClojureScript] Re: [ANN] om-start lein template for nrepl compliant editors/IDEs

2014-05-01 Thread Laurent PETIT
Hi Mimmo, I sent 2 small pull requests for updating things in om-start README: - link of the om basic tutorial has changed in swanodette's wiki - starting leiningen projects in CCW uses the familiar (to Eclipse users) Run as Clojure Application instead of the specific Lein Launch headless REPL

Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-01 Thread Ambrose Bonnaire-Sergeant
(Author of core.typed) Typed Clojure's function syntax generally won't get in your way if you're trying to jot down a type signature. It can handle multiple arities, polymorphism, keyword arguments, rest arguments and more. The whole point of Typed Clojure is to model how programmers use Clojure.

Re: [ClojureScript] Re: [ANN] om-start lein template for nrepl compliant editors/IDEs

2014-05-01 Thread Mimmo Cosenza
Hi Laurent, thanks so much. Today I had the time to take a look at my repos on github after a while :(( just merged your PRs together with other couple which were pending there…. My best mimmo On 01 May 2014, at 18:49, Laurent PETIT laurent.pe...@gmail.com wrote: Hi Mimmo, I sent 2

Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-01 Thread guns
On Thu 1 May 2014 at 09:05:29AM -0700, Mars0i wrote: 1. Functions have complex intended type signatures: Functions can have multiple parameter sequences, because of optional arguments with , and because of complex arguments such as maps. Schema expresses these scenarios quite well, as does

Re: Clojure Office Hours

2014-05-01 Thread Jakub Holy
I too can only recommend to make use of this great opportunity. Many thanks to Ulises who helped to find a way with a problem I have always struggled with, namely the shape of the data you are working with is not visible and it is thus easy to make errors which are hard to troubleshoot. I have

Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-01 Thread John Gabriele
On Wednesday, April 30, 2014 5:48:17 PM UTC-4, Sean Corfield wrote: For a project that has its auxiliary documentation on a Github wiki, you don't even need to git clone edit the repo: you can simply click Edit Page. That's about a low a barrier to entry as there can be and we still

Cleaner solution, anyone?

2014-05-01 Thread Divyansh Prakash
Hey! I wrote a blog post discussing Thomson's Paradox, and simulated it in Clojure- http://pizzaforthought.blogspot.in/2014/05/and-infinity-beyond.html The *state* function defined towards the end is not very functional. Could someone guide me towards a cleaner approach? Also, I can't find

Re: Cleaner solution, anyone?

2014-05-01 Thread Guru Devanla
Neat, so in your last solution are you trying to get rid of recur and solve 1 - (1/2)^x = time ? On Thu, May 1, 2014 at 12:06 PM, Divyansh Prakash divyanshprakas...@gmail.com wrote: Hey! I wrote a blog post discussing Thomson's Paradox, and simulated it in Clojure-

Re: Cleaner solution, anyone?

2014-05-01 Thread James Reeves
I'd suggest generating an intermediate seq with the summed time: (defn state [time] (- (thomsons-lamp) (reduce (fn [[_ t] [onoff dur]] [onoff (+ t dur)])) (drop-while (fn [[_ t]] ( t time))) first second)) - James On 1 May 2014 20:06, Divyansh Prakash

Re: Cleaner solution, anyone?

2014-05-01 Thread Guru Devanla
Reduce is not lazy, correct? Will it ever return for drop-while to execute. The problem here is not knowing how many iterations make up the sum, isnt? On Thu, May 1, 2014 at 1:13 PM, James Reeves ja...@booleanknot.com wrote: I'd suggest generating an intermediate seq with the summed time:

Re: Cleaner solution, anyone?

2014-05-01 Thread James Reeves
Yes, sorry, I didn't mean reduce, I meant reductions. - James On 1 May 2014 21:35, Guru Devanla grd...@gmail.com wrote: Reduce is not lazy, correct? Will it ever return for drop-while to execute. The problem here is not knowing how many iterations make up the sum, isnt? On Thu, May 1,

Re: Cleaner solution, anyone?

2014-05-01 Thread Stephen Gilardi
I wrote a blog post discussing Thomson's Paradox, and simulated it in Clojure- http://pizzaforthought.blogspot.in/2014/05/and-infinity-beyond.html The state function defined towards the end is not very functional. Could someone guide me towards a cleaner approach? Here's an option:

Re: Datascript and React.js for a Clojure web app

2014-05-01 Thread Kirstie Cook
very coolI've cloned it to play around with it. It runs locally just fine, but when deploying to heroku I get a 404 not found after trying to login or sign up. is there anything else that needs to be in order to deploy it to heroku? On Wednesday, April 30, 2014 8:32:24 AM UTC-5, Gijs S.

Re: clojure code to java

2014-05-01 Thread Atamert Ölçgen
Hi Julio, There is a difference between `converting Clojure code to Java code` and `compiling Clojure into .class files`. Can you clarify which one are you trying to accomplish? Also if you can provide some more context we might be able to make better suggestions. On Thu, May 1, 2014 at 4:56

Re: Managing State Changes, using Component

2014-05-01 Thread Atamert Ölçgen
I am not an expert on Component. But AFAIK it is not for managing mutable state but for assembling and configuring components, that might or might not be mutable themselves, in an immutable fashion. However from what I can understand, your component-a has an atom, like: (-component-a (atom

twitter-api and streaming calls

2014-05-01 Thread Simon Katz
Hi, I'm playing with twitter-api (https://github.com/adamwynne/twitter-api) and streaming calls. I've also tried twitter-streaming-client (https://github.com/mccraigmccraig/twitter-streaming-client). With the examples each of those provide, I'm getting *EOFException: JSON error (end-of-file)*

Re: twitter-api and streaming calls

2014-05-01 Thread Gary Trakhman
I fixed this in my implementation about a week ago, have a look: Basically, JSON might be split across multiple chunks. You can assemble it back with a PipedReader/Writer and then use cheshire's lazy seq. https://github.com/gtrak/dashboard/blob/master/src/gtrak/dashboard/twitter.clj#L94 On

Re: Clojure Course on Coursera

2014-05-01 Thread Ivan Schuetz
What happened with this? I would really love to make a Clojure course in Coursera... Still none :( Am Donnerstag, 20. September 2012 14:43:52 UTC+2 schrieb Belun: It would be really interesting to see a course about Clojure on coursera.org, where a Scala and functional programming course

Re: Clojure Course on Coursera

2014-05-01 Thread Colin Fleming
There's this one here: http://mooc.cs.helsinki.fi/clojure, which is run by the University of Helsinki. I haven't done the course but I heard good things about it. On 2 May 2014 11:21, Ivan Schuetz ivanschu...@gmail.com wrote: What happened with this? I would really love to make a Clojure

What's clojure killer app? I don't see any.

2014-05-01 Thread Ustun Ozgur
Paulo, I understand your concerns, you are basically taking a bet in choosing Clojure and you want some confirmation that you will not be wasting time/money during the process. Please watch Jay Fields' talk on this topic. I think he presents the upsides and downsides of his journey very well.

Re: Hosting Providers

2014-05-01 Thread Jarrod Swart
As Richard said most places that run Java, will run your Clojure. Google App Engine and Engine Yard appear to take a WAR file. lein ring uberwar (in your project dir) While heroku pushes your code to the server and then does its magic. git push git of project_name If you run on your own

clojure.test parameterized tests

2014-05-01 Thread Brian Craft
I have a number of tests that I would like to run against different implementations of a protocol. In clojure.test there doesn't appear to be a way to parameterize a test over the implementations. Is there a good way to do this? -- You received this message because you are subscribed to the

Re: twitter-api and streaming calls

2014-05-01 Thread Andrew Fitzgerald
I had the same (very frustrating issue) recently. I ended up just using the official twitter API which is written in Java https://github.com/twitter/hbc On Thursday, May 1, 2014 6:59:04 PM UTC-4, Simon Katz wrote: Hi, I'm playing with twitter-api (https://github.com/adamwynne/twitter-api)

Re: twitter-api and streaming calls

2014-05-01 Thread Gary Trakhman
Oh, nice, I was concerned about reconnections and backfill issues, if I have to change anything substantial again I'll reimplement on top of the java api that provides this out of the box. On Thu, May 1, 2014 at 9:13 PM, Andrew Fitzgerald andrewcfitzger...@gmail.com wrote: I had the same

Re: how to convert current time to format i need?

2014-05-01 Thread Alex Walker
https://github.com/mbossenbroek/simple-time (require '[simple-time.core :as t]) (t/format (t/now) dd:MM: HH:mm:ss) = 01:05:2014 21:16:27 On Tuesday, April 29, 2014 5:03:01 AM UTC-5, sindhu hosamane wrote: How to convert the current date and time to the format i need ? for example i

how can I print the function name as parameter?

2014-05-01 Thread Erlis Vidal
Hi guys, I want to write a function (show) that will receive a function as parameter. How can print the original name of that function? I've tried with meta, resolve, name but none of them give me the result I want. The goal is that I want to write a function that print the name of the function

Re: Hosting Providers

2014-05-01 Thread Mike Haney
One thing to keep in mind since he's using Datomic - there is currently no way to restrict access to the transactor, so it needs to be run behind a firewall. This can be done easily on AWS by creating a VPC where only the peer is exposed to the net. Outside of AWS, you're pretty much on your

Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-01 Thread Sean Corfield
On Apr 30, 2014, at 4:08 PM, Val Waeselynck val.vval...@gmail.com wrote: As for what Gregg and Sean objected - that Clojure code is self-sufficient as documenting itself - I have to simply disagree. That is NOT what I said. Please go back and read my response more carefully. Anyway, I

Re: What's clojure killer app? I don't see any.

2014-05-01 Thread Paulo Suzart
Really thanks. Great talk. On 1 May 2014 21:21, Ustun Ozgur ustunoz...@gmail.com wrote: Paulo, I understand your concerns, you are basically taking a bet in choosing Clojure and you want some confirmation that you will not be wasting time/money during the process. Please watch Jay Fields'

Re: core.async and Joy of Clojure

2014-05-01 Thread Mars0i
On Monday, April 28, 2014 9:42:06 AM UTC-5, gamma235 wrote: I heard that Joy of Clojure would be adding a lot in the 2nd edition, including a section on core.logic; is core.async also on that list? I bought the pre-release + final release *Joy of Clojure* 2nd ed. package, so I have the v10

Re: Observing the same non-dynamic var in two different states

2014-05-01 Thread Antti Karanta
Thanks, defonce seems to solve the problem. As there doesn't seem to be a logical explanation for why the vartest.test-data namespace is evaluated twice I filed this as a leiningen issue: https://github.com/technomancy/leiningen/issues/1519 ::Antti:: -- You received this message