[ANN] Bract: Data-driven Application initialisation framework

2019-01-15 Thread Shantanu Kumar
Hi, I am happy to announce a data-driven application initialisation framework called Bract. https://bract.github.io/ Bract provides a first class, declarative way to express application initialisation config and steps/workflow. Bract has modules for various purposes, and offers the necessary

[ANN] Stringer (v0.3.1) - fast string concatenation

2019-01-11 Thread Shantanu Kumar
Hi, I am pleased to announce Stringer, a library for fast string concatenation. Stringer is designed (with tradeoffs) to complement Clojure's string concat operations. https://github.com/kumarshantanu/stringer Stringer's API contains several macros (so they can not be used as functions) -

Re: [ANN] Calfpath (v0.7.1), a fast and flexible Ring request router

2019-01-06 Thread Shantanu Kumar
Sorry, the runtime complexity in Calfpath would be generally O(n^2) because iterating routes and under every route iterating each character in the URI template in the worst case. Shantanu On Monday, 7 January 2019 12:43:44 UTC+5:30, Shantanu Kumar wrote: > > > > On Monday, 7 Jan

Re: [ANN] Calfpath (v0.7.1), a fast and flexible Ring request router

2019-01-04 Thread Shantanu Kumar
andidate libraries for your actual use cases. Shantanu > Alan > > > On Fri, Jan 4, 2019 at 9:50 PM Shantanu Kumar > wrote: > >> Hi, >> >> (Cross-posted on Clojure and Ring mailing lists.) >> >> Happy new year to all! >> >> I am ple

[ANN] Calfpath (v0.7.1), a fast and flexible Ring request router

2019-01-04 Thread Shantanu Kumar
Hi, (Cross-posted on Clojure and Ring mailing lists.) Happy new year to all! I am pleased to announce Calfpath, a fast Ring-based routing library that supports flexible, à la carte request matching. It supports both macro-based and data-driven routing.

[ANN] Promenade 0.7.0 - Elegant error handling and control flow

2018-10-30 Thread Shantanu Kumar
Hi, I'm happy to release version 0.7.0 of the Promenade library. This release switches expression sequencing to use clojure.core/reduce, hence adding early termination support. Please see changelog for the list of changes. Project website: https://github.com/kumarshantanu/promenade Changelog:

ANN: Promenade 0.6.0 - Elegant error handling and more for Clojure/CLJS

2018-08-02 Thread Shantanu Kumar
Hi, Promenade is a Clojure/ClojureScript library to elegantly handle errors and other oddities. The 0.6.0 release adds support for (1) wrapping functions that throw exceptions, and (2) early termination in reducing functions. URL: https://github.com/kumarshantanu/promenade Docs:

Re: Protocols considered harmful?

2018-05-22 Thread Shantanu Kumar
Hi Sam, In my experience, protocols are a great mechanism for extensibility. Let's say you build an abstraction with a default implementation. If your abstraction is based on protocols, somebody can extend the abstraction to build a different implementation (that possibly integrates with

ANN: DIME - Dependency Injection for Clojure

2018-05-07 Thread Shantanu Kumar
Hi, I am happy to announce DIME - a "Dependency Injection" library for Clojure: Project: https://github.com/kumarshantanu/dime Docs: https://github.com/kumarshantanu/dime/blob/master/doc/intro.md Blog post:

ANN: Promenade - Elegant handling of errors and other oddities (Clojure/ClojureScript)

2018-04-16 Thread Shantanu Kumar
Hi, I am pleased to announce Promenade - a Clojure/ClojureScript library to elegantly handle errors and other oddities: Project: https://github.com/kumarshantanu/promenade Docs: https://github.com/kumarshantanu/promenade/blob/master/doc/intro.md Promenade helps one express odd conditions

ANN: Cambium 0.9.2 (Structured logging for Clojure)

2018-03-22 Thread Shantanu Kumar
Hi, I am happy to announce the availability of Cambium 0.9.2 - Cambium is a structured logging library for Clojure, compatible based on SLF4J/Logback and clojure/tools.logging libraries. https://cambium-clojure.github.io/ The release changelog for various modules[1] are in their respective

Re: [ANN] Cambium - Structured logging for Clojure

2017-12-01 Thread Shantanu Kumar
On Friday, 1 December 2017 18:18:36 UTC+5:30, oleksand...@zalando.de wrote: > > On Thursday, November 30, 2017 at 3:35:24 PM UTC+1, Shantanu Kumar wrote: >> >> >> I am happy to announce the availability of Cambium, an Open Source >> project for structured

[ANN] Cambium - Structured logging for Clojure

2017-11-30 Thread Shantanu Kumar
Hi, I am happy to announce the availability of Cambium, an Open Source project for structured logging in Clojure using SLF4j and Logback. Details: https://cambium-clojure.github.io/ Repos: https://github.com/cambium-clojure *Highlights:* - Evolved through two years of production use at Concur

Re: [ANN] Clojure 1.9.0-RC1

2017-11-13 Thread Shantanu Kumar
e same behavior in Clojure 1.7.0 and 1.8.0 as you see in 1.9.0-RC1. > > Andy > > On Mon, Nov 13, 2017 at 9:48 PM, Shantanu Kumar <kumar.s...@gmail.com > > wrote: > >> Sorry, I did not specify the problem completely earlier. The coercion >> fails only when *un

Re: [ANN] Clojure 1.9.0-RC1

2017-11-13 Thread Shantanu Kumar
> 97 > > On Mon, Nov 13, 2017 at 1:09 PM, Shantanu Kumar <kumar.s...@gmail.com > > wrote: > >> The coercion (byte \a) works fine in Clojure 1.8, but it fails with >> `ClassCastException java.lang.Character cannot be cast to java.lang.Number` >> in 1.

Re: [ANN] Clojure 1.9.0-RC1

2017-11-13 Thread Shantanu Kumar
The coercion (byte \a) works fine in Clojure 1.8, but it fails with `ClassCastException java.lang.Character cannot be cast to java.lang.Number` in 1.9.0-RC1. Is this by design? Shantanu On Monday, 13 November 2017 07:32:00 UTC+5:30, Alex Miller wrote: > > Hi David, > > Clojure 1.9 now

Re: Don't Laugh - How to Get the Name of an Anonymous Function

2017-10-23 Thread Shantanu Kumar
Not sure whether you can deterministically recover the exact name at all times, but the following can get you started: (re-matches #".*\$(.*)__.*" (.getName (class (fn cool-func! [] (println "hi") I have altered the name to `cool-func!` on purpose to show where it may break. Shantanu

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread Shantanu Kumar
On Monday, 9 October 2017 12:34:41 UTC+5:30, lawrence...@gmail.com wrote: > > Shantanu Kumar, thanks for that, I might try it. I assume you've never had > the problem I'm talking about, of messages on background threads that > disappear? > Logback (the SLF4j impl we use) is cap

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread Shantanu Kumar
On Monday, 9 October 2017 12:31:57 UTC+5:30, lawrence...@gmail.com wrote: > > Kumar, > > Just so you know, on this page: > > https://github.com/cambium-clojure/cambium.logback.core > > you link to here: > > https://cambium-clojure.github.io/ > > but I get a 404 when I go there. > I'm sorry

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread Shantanu Kumar
> > > > I'm curious what others do for logging? > At Concur we using Cambium https://github.com/kumarshantanu/cambium that's being moved (WIP) here: https://github.com/cambium-clojure Cambium wraps SLF4j and gives a Clojure API (which extends tools.logging) to use it's MDC feature.

Predicates for atom/ref/agent

2017-07-16 Thread Shantanu Kumar
Hi, Since Clojure 1.7 there's a `volatile?` predicate function, but no such equivalent for atom/ref/agent. Can anybody explain the rationale behind the difference? I found an old thread on a related topic (URL below) but would like to know if there's an updated explanation.

Compiling a library with direct-linking

2017-03-09 Thread Shantanu Kumar
Hi, As per Clojure 1.8 release info [1][2] "As of Clojure 1.8, the Clojure core library itself is compiled with direct linking." I want to know whether it is possible to compile a 3rd-party Clojure library with direct-linking - does it require AOT compilation? I know about the

Re: Why does "clojure.core/run!" end in an exclamation mark?

2016-12-24 Thread Shantanu Kumar
I'm curious about `clojure.core/run!` too, but my question is whether it is meant to be a `reduce` variant of `clojure.core/doseq` or it has some other purpose. Shantanu On Saturday, 24 December 2016 21:37:11 UTC+5:30, James Reeves wrote: > > My understanding is that the convention used in

Re: Good way of handling metric gathering?

2016-11-11 Thread Shantanu Kumar
Hi Tianxiang, In my experience a good way to decouple a non-trivial fn with metrics is to make the fn provide hooks for various events when metrics may be gathered. (defn nop [& args]) (defn foo->bar [foo {:keys [on-foo on-bar] :or {on-foo nop on-bar nop} :as options}] (on-foo) (let [bar

Re: clojure.spec - Using :pre conditions (or not)?

2016-09-15 Thread Shantanu Kumar
Hi Joakim, You might be interested in Paul Stadig's library https://github.com/pjstadig/assertions that leverages Java's `-ea` (enable-assertions, which you may want to keep enabled in dev) command-line flag. If you have a bunch of things together to assert, you may want to use the

Re: Protocols for persistence - not sure about a few cases

2016-08-28 Thread Shantanu Kumar
Considering the regular use-cases with records: Create - requires record without any auto-generated identifiers Retrieve - requires primary identifier or lookup parameters Update - requires record with primary identifier and updated fields Delete - requires primary identifier or lookup parameters

Re: why is it so annoying to run clojure code

2016-06-09 Thread Shantanu Kumar
Consider http://inlein.org/ or https://github.com/kumarshantanu/lein-exec HTH Shantanu On Thursday, 9 June 2016 21:38:39 UTC+5:30, Jiacai Liu wrote: > > I started learning clojure recently, and I am annoyed at the way to run > it (aka. lein run). why clojure script can't be run like

Re: [ANN] Clojure 1.9.0-alpha5

2016-06-08 Thread Shantanu Kumar
On Wednesday, 8 June 2016 00:31:41 UTC+5:30, Alex Miller wrote: > > I'm not opposed to it but can't say that's anywhere on my priority list. > Does anyone use incubator? > Just to add a data point, I use incubator at work for `dissoc-in`. Shantanu > > > On Tuesday, June 7, 2016 at 1:21:34

Re: connecting to infobrite server from clojure

2016-05-02 Thread Shantanu Kumar
Could you try connecting to InfoBright using DbVisualizer? It is a Java based tool and any differences w.r.t. the MySQL JDBC driver would be evident if it fails to work with DbVisualizer. https://www.dbvis.com/ Shantanu On Monday, 2 May 2016 12:48:16 UTC+5:30, Sunil Nandihalli wrote: > > Hi

Re: How to configure a library from a file in the project that has it as a dependency?

2016-04-19 Thread Shantanu Kumar
How about accepting a fn as argument to provide the config required? In that case the user is free to use whichever library/hand-rolled code to read config from a file. Shantanu On Tuesday, 19 April 2016 22:15:22 UTC+5:30, Facundo Olano wrote: > > Hi! I started to use clojure a couple of

Re: How to use a Java SDK from Amazon?

2016-01-09 Thread Shantanu Kumar
On Sunday, 10 January 2016 04:09:45 UTC+5:30, Laws wrote: > > Damn. I tried localrepo, just like I have in the past: > > lein localrepo install alexa-skills-kit-1.1.jar alexa-sdk 1.1 > > and then in project.clj: > > :dependencies [[org.clojure/clojure "1.6.0"] > [alexa-sdk

Re: Is it possible to print log statements on clojure repl as well?

2015-12-17 Thread Shantanu Kumar
nREPL server started on port 4005 on host 127.0.0.1 - nrepl:// > 127.0.0.1:4005 > 2015-12-17 12:11:50 ERROR user:288 - hi > > Am I missing something? > > Other infomation: > $ java -version > java version "1.8.0_45" > Java(TM) SE Runtime Environment (bui

Re: Is it possible to print log statements on clojure repl as well?

2015-12-16 Thread Shantanu Kumar
as ctl]) > nil > user> (ctl/error "Fail!") > nil > > And here's what I get on my console > $ lein repl :headless :port 4005 > nREPL server started on port 4005 on host 127.0.0.1 - nrepl:// > 127.0.0.1:4005 > 2015-12-16 23:44:50 ERROR user:288 - Fail! > >

Re: Is it possible to print log statements on clojure repl as well?

2015-12-16 Thread Shantanu Kumar
If you enabled Log4j console logger, the logs should appear in the REPL too. See example at http://www.mkyong.com/logging/log4j-log4j-properties-examples/ You do not necessarily need log4j to log to the REPL via clojure.tools.logging - you can just use c.t.l. without any logging library and

Re: [ANN] Clojure 1.8.0-RC3

2015-12-07 Thread Shantanu Kumar
On Tuesday, 8 December 2015 07:17:15 UTC+5:30, Howard M. Lewis Ship wrote: > > I suspect there's a few cases where we would like to use direct linking, > but will not be able to, because it will disrupt a 3rd party library we > use. This is hypothetical, so I'll keep you posted ... I may run

Re: Practical ways to deal with 'bag-of-properties' syndrome, AKA dynamic typing?

2015-11-30 Thread Shantanu Kumar
I think https://github.com/pjstadig/assertions is very useful to assert the values in development, and turn off in production without any penalty. Can't expect libraries to include this though. Shantanu On Tuesday, 1 December 2015 03:19:09 UTC+5:30, Jonathon McKitrick wrote: > > I've read the

Re: [ANN] Clojure 1.8.0-RC1 is now available

2015-11-11 Thread Shantanu Kumar
int (foo)) > VerifyError (class: user$eval13, method: invokeStatic signature: > ()Ljava/lang/Object;) Expecting to find integer on stack > java.lang.Class.getDeclaredConstructors0 (Class.java:-2) > > > On 11 Nov 2015, at 07:46, Shantanu Kumar <kumar.s...@gmail.com > >

Re: [ANN] Clojure 1.8.0-RC1 is now available

2015-11-10 Thread Shantanu Kumar
One of my libraries (https://github.com/kumarshantanu/asphalt) is failing to compile with 1.8 (works fine with 1.6, 1.7); the stack trace is below: $ lein do clean, with-profile dev,c18 test Exception in thread "main" java.lang.VerifyError: (class: asphalt/core$invoke_with_transaction, method:

Re: is there a community "best practice" for including your co-workers libraries?

2015-10-16 Thread Shantanu Kumar
We are using Artifactory for our internal Maven repo (supports enterprise Single-Sign-On): https://www.jfrog.com/open-source/ Shantanu On Saturday, 17 October 2015 02:47:29 UTC+5:30, Lawrence Krubner wrote: > > I know this question has been asked before, but when I went searching I > mostly

[ANN] Clojure High Performance Programming, 2nd edition

2015-10-08 Thread Shantanu Kumar
: https://www.packtpub.com/application-development/clojure-high-performance-programming-second-edition On Amazon: http://www.amazon.com/Clojure-Performance-Programming-Shantanu-Kumar-ebook/dp/B013EJ3DRK This edition is updated for Clojure 1.7 and Java 8, and includes a new chapter on measuring

Re: Strictly tagged clojure

2015-08-08 Thread Shantanu Kumar
This is a very useful enhancement indeed. I wonder if it is feasible (or if it makes sense) to extend this to have type based overloading: (defn foo ([^TypeA a] ..) ([^TypeB b] ..)) Shantanu On Friday, 7 August 2015 11:40:42 UTC+5:30, Alex Miller wrote: Hey Reid, I've forwarded this

Re: Anotating functions for pre-processing

2015-08-07 Thread Shantanu Kumar
Hi Georgi, Have you seen this thread? https://groups.google.com/forum/#!topic/clojure/0hKOFQXAwRc Shantanu On Wednesday, 5 August 2015 17:28:42 UTC+5:30, Georgi Danov wrote: Hi, I have had good 6 months of fun with Clojure and have big appreciation for it's way of doing things. Coming

Re: [ANN] Release 0.32.0 of Counterclockwise

2015-07-31 Thread Shantanu Kumar
On Friday, 31 July 2015 19:41:45 UTC+5:30, fasfsfgs wrote: Sorry for my noobness but is there any tutorial on how to use counterclockwise? I'm a java developer and I'm super curious about Clojure. I'm still learning the very basics of the language and I'd like to keep using eclipse

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

2015-07-25 Thread Shantanu Kumar
Logging calls are far too frequent to practically pass config as argument everywhere, hence some kind of shared implicit context is required. Which logging libraries are you dealing with? If you use Timbre[1], you can pass config using dynamic vars or altering global state. If you use

Re: http-kit and context root?

2015-07-07 Thread Shantanu Kumar
I think what you need on the http-kit side is a context stripper middleware, because http-kit would receive a URI like /server1/foo/bar that needs to be stripped down to /foo/bar to match your app routes. (defn strip-middleware [handler ^String prefix] (let [plen (count prefix)] (fn

Re: awful performance on Windows 7 compared to anything else

2015-07-03 Thread Shantanu Kumar
Hi Colin, If you know that the delay is happening in the server-side Clojure code, maybe you can give https://github.com/kumarshantanu/espejito a try to determine where in the call stack is the latency happening? Shantanu On Friday, 3 July 2015 22:20:23 UTC+5:30, Colin Yates wrote: Hi all,

Re: How to use a java web service project in clojure?

2015-05-27 Thread Shantanu Kumar
You should probably include the right dependencies in project.clj, e.g. :dependencies [[javax.ws.rs/jsr311-api 1.1.1]] You might actually need an implementation, e.g. Apache-CXF, or RestEasy etc. as dependency but I am not sure. Shantanu On Wednesday, 27 May 2015 16:28:54 UTC+5:30, Peng Lin

Re: How to use a java web service project in clojure?

2015-05-27 Thread Shantanu Kumar
. But there is a lot of jars i used (in the WEB-INF/lib), how to add all these jars once and ever? i found jvm-opts -Djava.library.path, but i don't know how to use it 在 2015年5月27日星期三 UTC+8下午9:01:15,Shantanu Kumar写道: You should probably include the right dependencies in project.clj, e.g. :dependencies

Re: Advice when running java -jar rather than a managed server like tomcat?

2015-05-26 Thread Shantanu Kumar
I'm doing some of those things at work (http-kit, logback+slf4j+MDC+clojure.tools.logging, config via property files). My entry point (main) is a Java class that reads properties file, sets system properties to hoist logging config variables, then uses reflection to load other Java/Clojure

Re: contains? on String

2015-05-12 Thread Shantanu Kumar
. So: (contains? {:a 1} :a) = true (contains? {:a 1} 1) = false (contains? [:a] :a) = false (contains? [:a] 0) = true (contains? #{:a} :a) = true (contains? a \a) = error (contains? '(:a) :a) = error - James On 12 May 2015 at 19:25, Shantanu Kumar kumar.s

contains? on String

2015-05-12 Thread Shantanu Kumar
Hi, I notice the following in Clojure 1.7.0-beta2: user= (contains? hello 2) true user= (contains? hello \e) IllegalArgumentException contains? not supported on type: java.lang.String clojure.lang.RT.contains (RT.java:800) Is this just a case of misleading error message or am I missing

Re: Idiomatic access to collaborators/services

2015-02-25 Thread Shantanu Kumar
Having tried few other ways earlier, I now prefer the `first` approach you described. Protocols decouple the contract and the implementation very well, and can be reified for various profiles (unit tests, scenario tests, integration etc.) For constructing the graph I have found Prismatic graph

Re: Why no h2 1.4.176

2015-02-25 Thread Shantanu Kumar
On Wednesday, 25 February 2015 15:11:14 UTC+5:30, Cecil Westerhof wrote: 2015-02-25 10:10 GMT+01:00 Shantanu Kumar kumar.s...@gmail.com javascript:: This has nothing to do with Leiningen, I think. The H2 artifacts are here: http://mvnrepository.com/artifact/com.h2database/h2 You can

Re: Why no h2 1.4.176

2015-02-25 Thread Shantanu Kumar
This has nothing to do with Leiningen, I think. The H2 artifacts are here: http://mvnrepository.com/artifact/com.h2database/h2 You can only use the artifacts that are available, which doesn't include 1.4.176 on Maven Central. Shantanu On Wednesday, 25 February 2015 14:27:51 UTC+5:30, Cecil

Re: Name of a function

2015-02-14 Thread Shantanu Kumar
You can probably omit try and throw to achieve the same effect. (let [ste# (aget (.getStackTrace (Exception.)))] ..) Shantanu On Sunday, 15 February 2015 00:58:28 UTC+5:30, Shantanu Kumar wrote: See if you can put this to any use (implies no warranty) - applicable to the JVM only

Re: Name of a function

2015-02-14 Thread Shantanu Kumar
See if you can put this to any use (implies no warranty) - applicable to the JVM only: (defmacro whereami [] `(try (throw (Exception.)) (catch Exception e# ;; (.printStackTrace e#) ; uncomment this line to inspect stack trace (let [ste# (aget (.getStackTrace e#)

Re: which are the pros and cons between stuartsierra/component and prismatic/graph?

2015-02-04 Thread Shantanu Kumar
On Wednesday, 4 February 2015 18:26:43 UTC+5:30, Lucas Bradstreet wrote: Component is more for managing state, whereas graph is for structuring computation. All I can really tell you is that after using component I am never going back (at least in Clojure). With Prismatic graph you can

Re: which are the pros and cons between stuartsierra/component and prismatic/graph?

2015-02-04 Thread Shantanu Kumar
test suite etc.) though the test profiles (where one wants mock impl) may require much smaller graphs depending on the scope. Shantanu Timothy On Wed, Feb 4, 2015 at 6:42 AM, Shantanu Kumar kumar.s...@gmail.com javascript: wrote: On Wednesday, 4 February 2015 18:26:43 UTC+5:30, Lucas

Re: lein uberjar not creating class files with :aot

2015-01-04 Thread Shantanu Kumar
I have run into this (using lein 2.5.0 and 2.4.1) as well. `lein uberjar` seems to wipe out the pre-generated classes when creating an uberjar. Shantanu On Sunday, 4 January 2015 01:09:30 UTC+5:30, Shoeb Bhinderwala wrote: When I create a uberjar with aot compilation I am surprised to see

Re: Clojure CLR Experiences

2014-11-11 Thread Shantanu Kumar
Not sure why you say that 1.4 is the current version. ClojureCLR releases are here: https://www.nuget.org/packages/Clojure - as of today 1.6.0.1 is the current stable version. Leiningen plugin is here: https://github.com/kumarshantanu/lein-clr Shantanu On Tuesday, 11 November 2014 21:08:58

Re: [ANN] rete4frames, v. 5.2.0 - CLIPS-like expert system shell

2014-10-13 Thread Shantanu Kumar
OK, I understand now - will report bugs if I find any, am at a newbie level now. I was confused whether it's an Alpha release, because the subject didn't mention that. Shantanu On Monday, 13 October 2014 17:46:30 UTC+5:30, ru wrote: Hi Shantanu, 1. I am waiting for bug reports from you,

Re: [ANN] rete4frames, v. 5.2.0 - CLIPS-like expert system shell

2014-10-12 Thread Shantanu Kumar
Hi Ru, Congrat's on the release. I wonder why did you choose to release the new version as 5.2.0-SNAPSHOT instead of 5.2.0. Shantanu On Saturday, 11 October 2014 22:29:43 UTC+5:30, ru wrote: Hello all, New version 5.2.0 of rete4frames CLIPS-like expert system shell published on

Re: How do I track down a painfully long pause in a small web app?

2014-09-14 Thread Shantanu Kumar
Few thing to consider: 1. Which API calls pause? If only certain calls pause, then probably you have something specific to suspect. Try adding a dummy REST call - see if that call pauses while others do. 2. Is any of your services running on a t1.micro or a burst-oriented EC2 instance on AWS?

Re: running a jar-based cli tool

2014-08-14 Thread Shantanu Kumar
On Thursday, 14 August 2014 03:25:48 UTC+5:30, Brian Craft wrote: Thanks! This works perfectly. It took a few tries to find the right incantation, but this seems to do: (defn -main [ args] (Main/main (into-array String args))) I note that the .clj file for this namespace ends up in

Re: running a jar-based cli tool

2014-08-13 Thread Shantanu Kumar
On Thursday, 14 August 2014 02:23:50 UTC+5:30, Brian Craft wrote: I need to run a tool while building docs which is distributed as a jar file, and is run with java -jar. Not sure the best way to do this. lein can fetch the jar if I add it to dev dependencies, but then it's in some

Re: Leiningen resource-paths

2014-07-25 Thread Shantanu Kumar
For our project we have decided to depend on Maven and require user to install Maven and execute these several commands to add jars to the local repository. You could probably have a script that uses lein-localrepo (to install all dependencies in one go) if you don't want to install

Re: [Request for Feedback] Clojure Lab: IDE for Clojure in Clojure

2014-06-27 Thread Shantanu Kumar
Downloaded and tried. It's very neat! Thanks for sharing. Shantanu On Friday, 27 June 2014 20:30:37 UTC+5:30, juan.facorro wrote: Hello Clojurians! I wanted to share with you a project called *Clojure Lab*, an *IDE for Clojure in Clojure*. *https://github.com/jfacorro/clojure-lab

Re: dynamic java obj construction from classname string

2014-05-25 Thread Shantanu Kumar
On Sunday, 25 May 2014 22:45:27 UTC+5:30, Gregg Reynolds wrote: Hi, I'm trying to construct a Java obj from a from a classname string. I've managed to import the thing using a macro: (defmacro import-by-name [name] `(import [~name])) (let [klass-name foo.bar.Baz the-ns

ANN: lein-servlet 0.4.0

2014-03-22 Thread Shantanu Kumar
Hi, lein-servlet helps you to work with servlet based apps. I pushed out version 0.4.0 of lein-servlet to Clojars -- the changes are listed at the URL below: https://github.com/kumarshantanu/lein-servlet/blob/master/CHANGES.md#2014-march-22--040 Shantanu -- You received this message because

Re: Creating multi-module projects with dependencies between modules

2014-03-19 Thread Shantanu Kumar
On Tuesday, 18 March 2014 08:25:30 UTC+5:30, Dave Kincaid wrote: I'm trying to create a project with multiple modules where there are some dependencies between modules. So far I've tried out lein-sub and lein-modules but neither one seems to handle inter-module dependencies (either that

Re: algorithm help: extracting groups of consecutive ints from a sorted list

2014-03-18 Thread Shantanu Kumar
Something like this? (defn x [1 3 4 5 7 9 10 13]) (reduce (fn [a i] (let [y (last a) z (last y)] (if (and z (= (inc z) i)) (conj (pop a) (conj y i)) (conj a [i] [] x) Shantanu On Wednesday, 19 March 2014 08:26:43 UTC+5:30, John Gabriele wrote: If you've got a sorted list of numbers, for

Re: algorithm help: extracting groups of consecutive ints from a sorted list

2014-03-18 Thread Shantanu Kumar
On Wednesday, 19 March 2014 09:39:56 UTC+5:30, Shantanu Kumar wrote: Something like this? (defn x [1 3 4 5 7 9 10 13]) Sory for the typo. Should be (def x [1 3 4 5 7 9 10 13]) (reduce (fn [a i] (let [y (last a) z (last y)] (if (and z (= (inc z) i)) (conj (pop a) (conj y i)) (conj

Re: Get a LAZY list of records from a database query ?

2014-03-14 Thread Shantanu Kumar
Hi Frank, You can look at the source code of `resultset-seq` (in Clojure-JVM) to see how it does a similar thing. You must consume the entire set of messages before closing the connection though. The `clojure.java.jdbc` library ensures that, for example. You may also want to discuss this on

Re: Clojure Jruby (Ruby on Rails) Interop

2014-03-12 Thread Shantanu Kumar
On Monday, 9 September 2013 07:55:15 UTC+5:30, rdelcueto wrote: Hi everyone, I'm about to start working on building a site for a startup company. We are a small team, and currently they've been coding the site using RoR (Ruby on Rails). I was thinking Clojure might be better suited for

Re: Do I have to have knowlegde about Lisp

2014-03-10 Thread Shantanu Kumar
On Monday, 10 March 2014 20:11:12 UTC+5:30, Roelof Wobben wrote: Hello, I like the idea of Clojure but I wonder if I have to know a lot of Lisp to work with Clojure. What is the best way to go from a absolute beginner to someone who can work with Clojure. To have a quick feel of

Re: clojure lazy-seq caching?

2014-03-04 Thread Shantanu Kumar
On Tuesday, 4 March 2014 14:54:49 UTC+5:30, Andy Smith wrote: Does this mean that in a single threaded application lazy sequences suffer the overhead of locks? I thought one of the features of clojure is that it tries to avoid locks as much as possible. The JIT compiler eliminates locks

Re: Clojure performance question

2014-03-02 Thread Shantanu Kumar
On Sunday, 2 March 2014 12:49:15 UTC+5:30, Shantanu Kumar wrote: On Sunday, 2 March 2014 05:32:00 UTC+5:30, bob wrote: Good point, Thanks a lot. Shall we improve the str fn in the core lib? From my point of view, the core fns should be performance sensitive. If string formation

Re: Clojure performance question

2014-03-02 Thread Shantanu Kumar
On Monday, 3 March 2014 02:18:39 UTC+5:30, tbc++ wrote: How are you running these tests? The correct way to benchmark such things is via a real benchmark framework (such as criterium) then compile your clojure app to a jar (perhaps via lein uberjar) and finally run it via a bare java

Re: Clojure performance question

2014-03-01 Thread Shantanu Kumar
On Saturday, 1 March 2014 15:32:41 UTC+5:30, bob wrote: Case : clojure verison: (time (dotimes [n 1000] (str n another word))) ;; take about 5000msec java version long time = System.nanoTime(); for(int i=0 ; i1000 ;i++){ String a=i+another word;

Re: Clojure performance question

2014-03-01 Thread Shantanu Kumar
On Sunday, 2 March 2014 05:32:00 UTC+5:30, bob wrote: Good point, Thanks a lot. Shall we improve the str fn in the core lib? From my point of view, the core fns should be performance sensitive. If string formation is the bottleneck in your app and if you can come up with a version of

Re: Clojure performance question

2014-02-28 Thread Shantanu Kumar
I have seen (and I keep seeing) a ton of Java code that performs poorly. Empirically, it's equally easy to write a slow Java app. You always need a discerning programmer to get good performance from any language/tool. Numbers like 1/4 or 1/10 can be better discussed in presence of the

Re: Source code reloading with leiningen checkouts

2014-02-26 Thread Shantanu Kumar
On Wednesday, 26 February 2014 14:58:06 UTC+5:30, Niels van Klaveren wrote: Windows (7) has different versions of linking. For checkouts to work on Windows 7 you need to have a *junction* to the directory, not a symbolic link. I make mine with Link Shell Extension for Windows

Re: call clojure from java

2014-02-18 Thread Shantanu Kumar
Hi Sorin, Are you looking for something like load-file: http://clojuredocs.org/clojure_core/clojure.core/load-file Shantanu On Tuesday, 18 February 2014 17:09:20 UTC+5:30, sorin cristea wrote: Hi do you know how I can call a clojure script from a java method ? Thanks, Sorin. -- You

Re: Korma Sql model not accepting url var

2014-02-11 Thread Shantanu Kumar
Can you post the SQL template (with ? symbols) you are trying to execute? Usually, with PostgreSQL you can specify ?::integer in place of ? to imply that the passed parameter is an integer. Shantanu On Tuesday, 11 February 2014 13:52:54 UTC+5:30, The Dude (Abides) wrote: Hi, I'm getting an

Re: Korma Sql model not accepting url var

2014-02-11 Thread Shantanu Kumar
Btw, would you recommend using an ORM or straight java.jdbc and if an ORM, any particular one you'd recommend? ORMs are not prevalent in Clojure. You can use java.jdbc (the 0.3.x series or later) with one of the SQL generators (HoneySQL, YeSQL etc) that you like. See what works for you

ANN: clj-liquibase 0.5.1 for database change management

2014-01-28 Thread Shantanu Kumar
Hi, I'm happy to announce clj-liquibase version 0.5.1: https://github.com/kumarshantanu/clj-liquibase for database (JDBC) change management. Since 0.4.0, this version upgraded Liquibase dependency from 2.5 to 3.0 and added support for free-form SQL and SQL files as units of change. (Thanks

Re: core.async question - canceling thread

2014-01-22 Thread Shantanu Kumar
On Thursday, 23 January 2014 02:37:43 UTC+5:30, puzzler wrote: Is there a convenient way within Clojure to launch a Clojure function or Java call in a separate process as opposed to a separate thread? Only way I know of is to literally shell out to the command prompt and launch a new

Re: Servlet adapter for ring handlers with support for asynchronous processing

2014-01-18 Thread Shantanu Kumar
Hi Jan, This not directly related, but i thought it might be useful in some way. In case you do the java interop stuff on your own to implement the servlet 3.0 methods, you might want to use lein-servlet to run the servlet using Jetty 9 maybe. https://github.com/kumarshantanu/lein-servlet

Re: Extracting a database schema and using it to synthesize and check SQL queries at compile time

2014-01-08 Thread Shantanu Kumar
Hi Alex, On Wednesday, 8 January 2014 13:28:29 UTC+5:30, Alexander Hudek wrote: Hey everyone, We've been exploring ways to make working with database code more efficient and less error prone. For complex queries, we prefer working directly with SQL. However, like for many others, a lot

Re: Extracting a database schema and using it to synthesize and check SQL queries at compile time

2014-01-08 Thread Shantanu Kumar
The approach to read the database to generate code is pretty interesting. There is a more portable way to extract the schema information, using DatabaseMetadata that you can extract from a Connection. http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html

Re: Advice for dealing with CSV data set

2014-01-05 Thread Shantanu Kumar
If you are only going to read the CSV files, you can put the CSV file in `resources` directory (so that it is part of the jar/uberjar), and use https://github.com/clojure/data.csv with http://clojuredocs.org/clojure_core/clojure.java.io/resource to read the data. If you need to make some

Re: how to packge lein project in a maven-style?

2014-01-05 Thread Shantanu Kumar
There's Clojure Maven plugin if that can help: https://github.com/talios/clojure-maven-plugin Shantanu On Monday, 6 January 2014 11:03:45 UTC+5:30, Qiu Xiafei wrote: Using maven, we usually package the project in a directory with sub dirs like: bin/ # bash/python scripts lib/

Re: library development

2013-12-20 Thread Shantanu Kumar
Author of lein-localrepo here. Just to mention few points: 1. Leiningen builds over Maven's transitive dependency management system. So, I guess at some point of time you just have to accept Maven's nomenclature. 2. `lein install` works when you have source code and a `project.clj` for your

Re: Clojure CLR versioning and binary downloads

2013-11-24 Thread Shantanu Kumar
I am trying to run some tests (that worked fine with Mono+ClojureCLR 1.4.1) in Mono+ClojureCLR 1.5.0 from SourceForge and finding the below exception: $ # CLOJURE_LOAD_PATH is configured properly $ mono /path/to/clojure-clr-1.5.0-Release-4.0/Clojure.Main.exe -i /tmp/intermediate-file -e (use

Re: ANN: Clojure High Performance Programming

2013-11-21 Thread Shantanu Kumar
On Thursday, 21 November 2013 07:40:09 UTC+5:30, Alex Baranosky wrote: Congratulation on the book Shantanu! Thanks, Alex! Shantanu On Wed, Nov 20, 2013 at 5:16 PM, Shantanu Kumar kumar.s...@gmail.comjavascript: wrote: Now also available on Amazon US: http://www.amazon.com/dp

Re: ANN: Clojure High Performance Programming

2013-11-21 Thread Shantanu Kumar
this is temporary. Shantanu On 21 November 2013 02:10, Alex Baranosky alexander...@gmail.comjavascript: wrote: Congratulation on the book Shantanu! On Wed, Nov 20, 2013 at 5:16 PM, Shantanu Kumar kumar.s...@gmail.comjavascript: wrote: Now also available

Re: ANN: Clojure High Performance Programming

2013-11-21 Thread Shantanu Kumar
On Thursday, 21 November 2013 16:28:14 UTC+5:30, Ulises wrote: Thank you! The book is published very recently and I noticed it took a while for the printed editions to appear on Amazon. I am getting in touch with Packt to find out why the kindle editions not on Amazon and whether this

Re: ANN: Clojure High Performance Programming

2013-11-21 Thread Shantanu Kumar
On Thursday, 21 November 2013 16:48:56 UTC+5:30, Ulises wrote: Could you please let me know which URL and page no. did you find the images missing on? I noticed the images are visible (for example on page number 21) when I visited

Re: ANN: Clojure High Performance Programming

2013-11-21 Thread Shantanu Kumar
On Thursday, 21 November 2013 21:39:36 UTC+5:30, Gary Johnson wrote: This looks incredible! Just bought a copy. Congratulations, Shantanu! Thanks, Gary! Those who might look for a Kindle edition can find it here: http://www.amazon.com/Clojure-Performance-Programming-Shantanu-Kumar-ebook/dp

ANN: Clojure High Performance Programming

2013-11-20 Thread Shantanu Kumar
Hi, I am pleased to announce availability of the book `Clojure High Performance Programming` that I have been writing for the better part of this year: http://www.packtpub.com/clojure-high-performance-programming/book This book is ideally meant for intermediate Clojure programmers. It is

  1   2   3   4   5   >