Re: Generating varying sized map using test.check

2015-07-27 Thread Mayank Jain
> It also might be helpful to know that there is already a subset generator > available in this library > . > Thanks, this looks good, will check it out. > What you've done here might appear to work, but it will get you into >> trouble

Re: What is the best way to pass log configs everywhere without a global var?

2015-07-27 Thread crocket
Can I see your proof of concept on github? Is it just an idea? On Mon, Jul 27, 2015 at 2:27 PM, James Reeves wrote: > On 27 July 2015 at 05:25, crocket wrote: >> >> How those logs are outputted is stored in a global state called log >> configuration. So, I think the separation was done. >> How e

Re: What is the best way to pass log configs everywhere without a global var?

2015-07-27 Thread Colin Yates
I don’t have a proof of concept either but if somebody is going to put some effort into writing a new library I had a great idea they could incorporate. Continuing the ‘decomplecting’ that James started, the other thing that is decomplected (or actually not addressed at all) is _why_ we want log

Re: Java 8 Lambda Interop

2015-07-27 Thread Gary Verhaegen
On Sunday, 26 July 2015, Andrew Oberstar wrote: > Hi, > > I'm wondering if anyone has a good approach for making calls from Clojure > to Java APIs (e.g. Stream API) that expect a @FunctionalInterface type. > > Ideally, IFn would transparently work, but I'm guessing that requires some > compiler c

Twitter bot crashing on Heroku

2015-07-27 Thread Divyansh Prakash
Hi! I had written a poetry generator sometime back and wanted to convert it into a Twitter bot. I followed this tutorial to do so. You can find my code here . The bot's working fine

Re: Twitter bot crashing on Heroku

2015-07-27 Thread Gary Verhaegen
the error message also sugget that your process may not have started quickly enough. How do you deploy on heroku? Do you have a Procfile? What does it say? Do you prepackage on push, or recompile everything on startup? On Monday, 27 July 2015, Divyansh Prakash wrote: > Hi! > > I had written a po

Re: Twitter bot crashing on Heroku

2015-07-27 Thread Gary Verhaegen
Just peeked at your code, and it seems to indeed compile everything at startup. I'm not quite remembering all of the details, but I remember that Chestnut got it right: on Heroku, you can set things up so that an uberjar is created on git push and then started with java -jar on startup, which is us

Re: What is the best way to pass log configs everywhere without a global var?

2015-07-27 Thread Gary Verhaegen
Have you guys looked at dire? https://github.com/MichaelDrogalis/dire/blob/master/README.md it could be used to take decomplection one step further, by not defining monitoring things inline at all. A library author could define additional logging namespace(s) with fns that load different levels o

Re: Twitter bot crashing on Heroku

2015-07-27 Thread Pedro Santos
Are you actually binding to a port? I didn't find it in your code. If you don't bind to the PORT env variable, heroku will fail. If you have a bot you may not need to bind to a port... but heroku needs that on the default web dynos. Don't know if you can skip that validation. On Mon, Jul 27, 2015

WebService request are not getting served properly

2015-07-27 Thread hemant gautam
On running the below mentioned code on browser I am getting "Page not found" for each type of request. Can anybody suggest me where I am doing a mistake. (ns currentday.core (:require [compojure.core :refer :all] [compojure.route :as route] [compojure.handler :as handler]

Re: WebService request are not getting served properly

2015-07-27 Thread Colin Yates
Hi Hermant, are you running this at a REPL? What URL exactly are you going to (http://localhost:3032/ should work if the server is running)? > On 27 Jul 2015, at 10:55, hemant gautam wrote: > > On running the below mentioned code on browser I am getting "Page not foun

Re: WebService request are not getting served properly

2015-07-27 Thread hemant gautam
It's working fine. I was trying it wrong way. Anyways thanks for your reply :) On 27-Jul-2015 5:37 pm, "Colin Yates" wrote: > Hi Hermant, are you running this at a REPL? What URL exactly are you going > to (http://localhost:3032/ should work if the server is running)? > > > On 27 Jul 2015, at 10:

Re: WebService request are not getting served properly

2015-07-27 Thread Gary Verhaegen
On Monday, 27 July 2015, hemant gautam wrote: > On running the below mentioned code on browser I am getting "Page not > found" for each type of request. > Can anybody suggest me where I am doing a mistake. > > (ns currentday.core > (:require [compojure.core :refer :all] > [compojure.rou

Re: WebService request are not getting served properly

2015-07-27 Thread hemant gautam
Hi Gary, You are right, the points that you mentioned are valid. Those things are already taken care of. I am new to Ring and Compojure so was trying out some stuff. I was confused at some part, but now it got cleared and code if running as required. Thanks for your time and reply. On Monday

Re: Twitter bot crashing on Heroku

2015-07-27 Thread Divyansh Prakash
Thanks for the response, everyone. My Procfile says: > worker: lein trampoline run > I'm not binding to any port because my app doesn't require it. How do I do so, though? Will it be available as a part of lein-environ? -- You received this message because you are subscribed to the Google Gr

Re: Twitter bot crashing on Heroku

2015-07-27 Thread Divyansh Prakash
Thanks for the response, everyone. My Procfile says: > worker: lein trampoline run > I'm not binding to any port because my app doesn't require it. How do I do so, though? Will it be available as a part of lein-environ? -- You received this message because you are subscribed to the Google Gro

[bug] Reflector can't resolve a method in a non-public generic-typed abstact class

2015-07-27 Thread Alexander Yakushev
Reproducible minimal example here: https://github.com/alexander-yakushev/generics-reflection-bug . Clone it and do `lein run`. The example is small enough to paste it here. So we have a class called AbstractStorage: abstract class AbstractStorage { T thingToStore; public AbstractStor

Re: Generating varying sized map using test.check

2015-07-27 Thread Carlo Zancanaro
Whoops, forgot the group on this. On 27 July 2015 at 18:10, Carlo Zancanaro wrote: > You're generating two random things: the map, and the subset of the keys. > You can't generate the subset of the keys without first knowing the full > set of keys, so bind lets you make the subset generator depe

Re: Generating varying sized map using test.check

2015-07-27 Thread Mayank Jain
> > On 27 July 2015 at 18:10, Carlo Zancanaro > wrote: > >> You're generating two random things: the map, and the subset of the keys. >> You can't generate the subset of the keys without first knowing the full >> set of keys, so bind lets you make the subset generator depend on the >> result of th

New Functional Programming Job Opportunities

2015-07-27 Thread Functional Jobs
Here are some functional programming job opportunities that were posted recently: Software Developer | Scala, Clojure | Spark, Solr, Agile at Elmar Reizen http://functionaljobs.com/jobs/8848-software-developer--scala-clojure--spark-solr-agile-at-elmar-reizen Cheers, Sean Murphy Functional

Re: What is the best way to pass log configs everywhere without a global var?

2015-07-27 Thread James Reeves
On 27 July 2015 at 08:28, crocket wrote: > Can I see your proof of concept on github? Is it just an idea? > Well, my first attempt at this was Inquest: https://github.com/weavejester/inquest The idea of Inquest was to (ab)use alter-var-root to insert monitoring into existing functions, but I qu

Re: Twitter bot crashing on Heroku

2015-07-27 Thread Carin Meier
By default, Heroku sets up a web worker for your project. Check your project resources. It sounds like you have an extra web worker setup trying to bind to the port. - Carin On Monday, July 27, 2015 at 10:04:16 AM UTC-4, Divyansh Prakash wrote: > > Thanks for the response, everyone. > > My

a question about Chris Zheng's "Abstract Container Pattern"

2015-07-27 Thread Lawrence Krubner
I have a question about this: "Servers that are running on a particular port can be tracked and stopped. I have to say, this was the feature that I wanted the most, which motivated the framework's design. The annoying thing about development in emacs is that I have to be careful of not losing

Re: a question about Chris Zheng's "Abstract Container Pattern"

2015-07-27 Thread Lawrence Krubner
I guess I'm wondering why take Zheng's approach, versus something more direct? I'm especially reacting to this: One way to look at design using abstract classes (or any language feature for that matter) is that it is a programming contract that is strictly enforced by the language itself. W

Re: a question about Chris Zheng's "Abstract Container Pattern"

2015-07-27 Thread Colin Yates
I think his last sentence gives you the answer: "A warm shoutout to Tushar, Lyndon, Dean, Alan, Hank, Derek, and all the guys at clj-melb that gave feedback and helped flesh out this rehash of OO design.” (my emphasis) He wanted an OO approach and has implemented one; specifically behaviour and

Re: [ANN] Clojure 1.8.0-alpha2

2015-07-27 Thread Lawrence Krubner
Off topic, but I wonder if there was ever any discussion of megarefs being added to Clojure? https://github.com/cgrand/megaref On Tuesday, July 21, 2015 at 3:30:46 PM UTC-4, Rangel Spasov wrote: > > Ok, I think someone already mentioned this - sorry. Got it to compile by > bumping to [potemkin

[ANN] clojure.java.jdbc 0.4.1

2015-07-27 Thread Sean Corfield
Clojure contrib library that provides JDBC wrapper. https://github.com/clojure/java.jdbc • Release 0.4.0 / 0.4.1 on 2015-07-26 • db-do-prepared now allows transaction? to be omitted when a PreparedStatement is passed as the second argument JDBC-111 - Stefan Kamphausen. • Nested t

ANN Langohr 3.3.0 is released

2015-07-27 Thread Michael Klishin
Langohr [1] is a small, feature complete Clojure client for RabbitMQ.   Release notes: http://blog.clojurewerkz.org/blog/2015/07/27/langohr-3-dot-3-0-is-released/  1. http://clojurerabbitmq.info -- MK -- You received this message because you are subscribed to the Google Groups "Clojure

Re: Java 8 Lambda Interop

2015-07-27 Thread Andrew Oberstar
Thanks for the reply Gary. Sounds like I'm on as good a track as I can be with current Clojure. I am curious though why you say that it is unrealistic for IFn to support arbitrary @FunctionalInterface. It certainly seems like it would require compiler changes, but I would think that either through

Re: Java 8 Lambda Interop

2015-07-27 Thread Mikera
It could certainly be achieved in the Clojure compiler, by allowing (some-functional-interface .) to compile to the appropriate function call even if it doesn't implement IFn It would be quite a big change though and would probably have some limitations, e.g.: a) It probably wouldn't work w

Re: Java 8 Lambda Interop

2015-07-27 Thread Andrew Oberstar
Mikera, I think you're addressing a different interop concern. I'm particularly interested in something like this: (-> (IntStream/range 0 100) (.filter odd?) (.limit 5) (.collect Collectors/toList)) Where "odd?" is a normal Clojure IFn that I want to use when calling a Java API that expects somet

Re: Java 8 Lambda Interop

2015-07-27 Thread Sean Corfield
I think Mike was suggesting something like this: (-> (IntStream/range 0 100) (.filter ^Predicate odd?) (.limit 5) (.collect Collectors/toList)) and having the Clojure compiler figure out that you’re trying to cast an IFn to a functional interface and therefore "do the magic" for you. I don’t kn

Re: Java 8 Lambda Interop

2015-07-27 Thread Mikera
Ah, I get what you are doing now. Don't think that is likely to work unless Clojure starts making IFn instances implement the right java.util.function.* interfaces. Which seems unlikely given the conservatism of Clojure development. Having said that, I do think it is possible, have been playing

Re: ANN: ClojureScript 0.0-3308, fixes & enhancements

2015-07-27 Thread Adam Morgan
After running lein new mies test and then scripts/watch I am getting the following exception: π ./scripts/watch Building ... Reading analysis cache for jar:file:/Users/ajmorgan/.m2/repository/org/clojure/clojurescript/0.0-3308/clojurescript-0.0-3308-aot.jar!/cljs/core.cljs Compiling src/test/

Re: Next release for clojure.tools.cli? Is it dead?

2015-07-27 Thread guns
On Thu 23 Jul 2015 at 09:33:13PM -0700, Keith Irwin wrote: > There are some handy additions committed to the tools.cli project at: > > https://github.com/clojure/tools.cli > > but there hasn’t been a release in ~1.5 years (not even a snapshot > release). > > In fact, these commits have been si

Re: [ANN] Clojure 1.8.0-alpha2

2015-07-27 Thread Daniel Compton
I think this is pretty unlikely. While megarefs look very cool, I'm not sure what the benefit to having these directly in Clojure would be over having them in a library. Anecdotally, everyone I have talked to about Clojure's reference types have said that they have never needed to use ref's or age