Re: first element after an element in the sorted-set?

2011-05-23 Thread Sunil S Nandihalli
finger-trees would have solved the problem .. but unfortunately it is not part of the clojure distro yet.. :( On Tue, May 24, 2011 at 11:53 AM, Sunil S Nandihalli < sunil.nandiha...@gmail.com> wrote: > that may be inefficient for a large-set..? I was hoping it would be > log(n).. > > > On Tue, Ma

Re: first element after an element in the sorted-set?

2011-05-23 Thread Sunil S Nandihalli
that may be inefficient for a large-set..? I was hoping it would be log(n).. On Tue, May 24, 2011 at 11:45 AM, Michael Wood wrote: > On 24 May 2011 08:07, Sunil S Nandihalli > wrote: > > Hello everybody, > > is there a function to find the first element after an element in the > > sorted-set?

Re: first element after an element in the sorted-set?

2011-05-23 Thread Michael Wood
On 24 May 2011 08:07, Sunil S Nandihalli wrote: > Hello everybody, > is there a function to find the first element after an element in the > sorted-set? > (first-element-after 3 (sorted-set 1 2 3 4 5 6)) > should return 4? How about this?: (first (drop-while (partial >= 3) (sorted-set 1 2 3 4 5

first element after an element in the sorted-set?

2011-05-23 Thread Sunil S Nandihalli
Hello everybody, is there a function to find the first element after an element in the sorted-set? (first-element-after 3 (sorted-set 1 2 3 4 5 6)) should return 4? thanks, Sunil. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

Re: Passing "environment configuration parameters" to a Clojure web app

2011-05-23 Thread Shantanu Kumar
> This assumes you have a ServletContextListener or equivalent in place > to read on deployment. > > This is quick and dirty. I'd definitely like to see something better emerge. I noticed this: http://j.mp/l5vsjS -- looks like it suits the workflow you described. Regards, Shantanu -- You receiv

Re: interest in STM, where can I start to get knowing well about it?

2011-05-23 Thread jaime
huh, I do not know this topic well, any good resource for this?? On May 19, 3:59 pm, MohanR wrote: > So I think readng the actual STM source with Java' features might > help. > > Are there actually books on this topic ? Peter Van roy's Data flow > concurrency book ? > > Thanks, > Mohan -- You r

Re: interest in STM, where can I start to get knowing well about it?

2011-05-23 Thread jaime
Tom, I had a fast view on the first several slides (slides about your MC- STM implementation version 1), and found it concise and precise and could be a good resource for demonstration/comprehension on basic STM concepts/mechanism. Great job! I will definitely come back to this useful slide when I

Re: Functional Blackjack in Clojure

2011-05-23 Thread David Nolen
On Mon, May 23, 2011 at 5:02 PM, Sam Ritchie wrote: > Hey all, > > As an exercise in Clojure, I recently went about implementing a functional > version of BlackJack, and wanted to post it here for everyone's perusal. The > goal here was to write idiomatic code with good testing and documentation,

Re: Passing "environment configuration parameters" to a Clojure web app

2011-05-23 Thread Allen Johnson
On a related note. About a month or two ago I started work on a patch for lein-ring so you'd have more control over the web.xml that is generated. This was motivated by the desire to use the container's datasource instead of creating one yourself. If anyone is interested I can finish this up and co

Re: Clojure, Swank, and Leiningen with Emacs on Mac OS X

2011-05-23 Thread Tom Hicks
> :dev-dependencies [[swank-clojure "1.2.1"]]) I think this is an outdated dependency. I got it to work with 1.4.0- SNAPSHOT. (1.2.1 is, of course, the latest stable clojure.jar version, so this might have been a typo from your previous experiments). good luck -t On May 22, 1:53 am, dokondr

Re: Passing "environment configuration parameters" to a Clojure web app

2011-05-23 Thread Allen Johnson
I'm also interested in this topic. It was discussed briefly on the clojure-web-dev mailing list a little while ago. What I've been doing is something like this: # lein ring project myapp/ config/ production/WEB-INF/myapp.properties development/WEB-INF/myapp.properties test/WEB-INF/my

Re: Contagious BigDecimals?

2011-05-23 Thread pmbauer
(re: why then...) P.S. I mean in more general context of how double contagion is handled in most languages. Clojure 1.3 alphas auto-promote floats to doubles in almost every case eg. exception: (type (float 1.0)) On Monday, May 23, 2011 4:16:48 PM UTC-7, pmbauer wrote: > > If you add an inexact

Re: Contagious BigDecimals?

2011-05-23 Thread pmbauer
> > If you add an inexact number and an exact number, the only thing that > makes sense is to return something that is inexact. So why then are double's contagious when mixing double and float values in a calculation? Doubles and floats are both inexact, but floats are at least less exact than

Re: Contagious BigDecimals?

2011-05-23 Thread Mark Engelberg
doubles are inherently inexact; they are approximations of a real number. If you add an inexact number and an exact number, the only thing that makes sense is to return something that is inexact. BigInt contagion is different, because you are adding two exact things, it's just a question of intern

Re: Parameterizing project.clj

2011-05-23 Thread Phil Hagelberg
On May 23, 6:19 am, Rasmus Svensson wrote: >     (defproject foo 1.0.0 >       ...the usual stuff... >       :aws {:access-key ~access-key >                :secret-key ~secret-key} This is good advice, but you can also use leiningen.core/user- settings, which returns a map of user-level configura

Re: Navigating to Clojure Source using Emacs' Find Source Command

2011-05-23 Thread Simon Katz
On Mon, May 23, 2011 at 15:11, Simon Katz wrote: > On Mon, May 23, 2011 at 14:36, Simon Katz wrote: > >> On Sun, May 22, 2011 at 03:35, Phil Hagelberg wrote: >> >>> On May 21, 1:28 pm, Simon Katz wrote: >>> > I'm having trouble using Emacs' Find Source command to navigate to >>> > Clojure sour

Functional Blackjack in Clojure

2011-05-23 Thread Sam Ritchie
Hey all, As an exercise in Clojure, I recently went about implementing a functional version of BlackJack, and wanted to post it here for everyone's perusal. The goal here was to write idiomatic code with good testing and documentation, and, hopefully, to provide the basis for an example of a well

Re: Passing "environment configuration parameters" to a Clojure web app

2011-05-23 Thread Shantanu Kumar
Hello Laurent, Quite interesting points there. Yes, I agree - having confidential config (production etc.) in code base is not advisable. The reason I mentioned that though, was because I was trying to cover a gamut of workflows the situation may demand. One one extreme there may be a company wher

Re: Books on Java Objects and Primitives

2011-05-23 Thread Armando Blancas
Maybe something like this: Java for Programmers [Paperback] Paul J. Deitel (Author), Harvey M. Deitel (Author) You can start with the basics of the language and then move on to using the libraries as needed. The docs api (linked above) is a great reference but not a place for learning how to use t

Re: RIncater

2011-05-23 Thread Ulises
Ugh! Actually, I was more after a wrapper around the Rserve client more than anything however RIncanter is the closest thing I could find. >        Sortof.  The original author is updating thing so that they work more > cleanly.  In the interim if you want to get it to work modify the project.cl

Re: Books on Java Objects and Primitives

2011-05-23 Thread octopusgrabbus
This was very helpful. Thanks. On May 23, 12:36 pm, Chas Emerick wrote: > I'm still not certain what you're asking after here.  The JVM comes with a > sizable standard library, documented here: > > http://download.oracle.com/javase/6/docs/api/ > > and then you have at your feet the entirety of t

Re: We need a better way to handle errors.

2011-05-23 Thread Ken Wesson
On Mon, May 23, 2011 at 1:28 PM, Daniel Werner wrote: > On May 23, 12:24 am, Aaron Bedra wrote: >> Have you signed a CA yet? If so, you can sign up for a confluence account >> and start a wiki page around this.  This way the appropriate discussions and >> review can take place and then possibly a

Re: Clojure stack

2011-05-23 Thread Laurent PETIT
2011/5/23 Daniel Werner : > On May 22, 10:53 pm, Laurent PETIT wrote: >> Your discussion has been slowly getting me into the mindstate that >> I'll add this missing "reindent whole file/current selection" feature >> in CCW, AH ! > > Or, perhaps into a separate library so we can use your reindentin

Re: Clojure stack

2011-05-23 Thread Daniel Werner
On May 22, 10:53 pm, Laurent PETIT wrote: > Your discussion has been slowly getting me into the mindstate that > I'll add this missing "reindent whole file/current selection" feature > in CCW, AH ! Or, perhaps into a separate library so we can use your reindenting feature in Emacs, VimClojure etc

Re: We need a better way to handle errors.

2011-05-23 Thread Daniel Werner
On May 23, 12:24 am, Aaron Bedra wrote: > Have you signed a CA yet? If so, you can sign up for a confluence account > and start a wiki page around this.  This way the appropriate discussions and > review can take place and then possibly a JIRA ticket/patch to fix things > up. Discussions about im

Re: interest in STM, where can I start to get knowing well about it?

2011-05-23 Thread Tom Van Cutsem
If you are more interested in the semantics of STM (such as "how is commute different from alter?"), rather than in the actual Java implementation, I wrote a little "meta-circular" STM system in Clojure that could be helpful: Kind regards, Tom 2011/5/1

Re: Books on Java Objects and Primitives

2011-05-23 Thread Chas Emerick
I'm still not certain what you're asking after here. The JVM comes with a sizable standard library, documented here: http://download.oracle.com/javase/6/docs/api/ and then you have at your feet the entirety of the Java library ecosystem. It's big. Pending your obtaining the library(ies) you'

Re: Books on Java Objects and Primitives

2011-05-23 Thread octopusgrabbus
I apologize for not being clearer in why I asked this question. While learning Clojure, I thought it would be helpful to have some Java objects/primitives documentation to know what I can call in Clojure. Thanks and sorry for the too brief original post. On May 23, 10:01 am, octopusgrabbus wrote:

Contagious BigDecimals?

2011-05-23 Thread Chas Emerick
Bigints are contagious, so (+ 1 XXXN) => XXYN. It occurred to me to ask, Why aren't BigDecimals contagious as well? As things stand, (+ 1.0 1e400M) => Infinity — doubles are contagious, even when operated over with BigDecimals. I've never seen any discussion of BigDecimal contagion, so I assum

Re: Navigating to Clojure Source using Emacs' Find Source Command

2011-05-23 Thread Simon Katz
On Mon, May 23, 2011 at 14:36, Simon Katz wrote: > On Sun, May 22, 2011 at 03:35, Phil Hagelberg wrote: > >> On May 21, 1:28 pm, Simon Katz wrote: >> > I'm having trouble using Emacs' Find Source command to navigate to >> > Clojure source. >> > >> > I'm using Leiningen (1.4.2) and Emacs (23.2).

Books on Java Objects and Primitives

2011-05-23 Thread octopusgrabbus
What are some recent books that cover Java objects and primitives? -- 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 yo

Re: Navigating to Clojure Source using Emacs' Find Source Command

2011-05-23 Thread Simon Katz
On Sun, May 22, 2011 at 03:35, Phil Hagelberg wrote: > On May 21, 1:28 pm, Simon Katz wrote: > > I'm having trouble using Emacs' Find Source command to navigate to > > Clojure source. > > > > I'm using Leiningen (1.4.2) and Emacs (23.2). > > > I thought this would be enough to allow the Emacs Fi

Re: Callback functions

2011-05-23 Thread Vivek Khurana
On Mon, May 23, 2011 at 1:06 PM, Meikel Brandmeyer wrote: > Hi, > > works for me. Did you call (require (symbol ns-name)) before the resolve > call? Thanks I was using (:use) which was not working. regards Vivek -- The hidden harmony is better than the obvious!! -- You received this message

Re: Parameterizing project.clj

2011-05-23 Thread Rasmus Svensson
2011/5/23 Ulrik Sandberg : > How can I parameterize stuff in Leiningen's project.clj? For example, > I don't want to put my AWS credentials inside the project file: > > ... > :aws {:access-key "XX" >      :secret-key "Y"} > > but instead use some kind

Re: swank-clj 0.1.0 - a refactored swank-clojure, with sldb support

2011-05-23 Thread Sam Aaron
On 23 May 2011, at 13:23, Hugo Duncan wrote: >> Out of interest, how do swank-clj and swank-clojure (with merged in cdt >> stuff) compare? > > I would have to let others comment on the user experience, not having used > the cdt support in swank-clojure. From reading the code, I see two > diff

Parameterizing project.clj

2011-05-23 Thread Ulrik Sandberg
How can I parameterize stuff in Leiningen's project.clj? For example, I don't want to put my AWS credentials inside the project file: ... :aws {:access-key "XX" :secret-key "Y"} but instead use some kind of property names that refer to environ

Re: swank-clj 0.1.0 - a refactored swank-clojure, with sldb support

2011-05-23 Thread Hugo Duncan
On Sun, 22 May 2011 18:09:50 -0400, Jason Wolfe wrote: 1. The usual repl entry point is not used, and so, e.g., (set! *warn- on-reflection* true) fails. Thanks, I raised an issue to track this https://github.com/hugoduncan/swank-clj/issues/8 2. I could not figure out a way to browse ex

Re: swank-clj 0.1.0 - a refactored swank-clojure, with sldb support

2011-05-23 Thread Hugo Duncan
On Sun, 22 May 2011 16:59:24 -0400, Sam Aaron wrote: Very cool! Thanks. Out of interest, how do swank-clj and swank-clojure (with merged in cdt stuff) compare? I would have to let others comment on the user experience, not having used the cdt support in swank-clojure. From reading the

Re: Passing "environment configuration parameters" to a Clojure web app

2011-05-23 Thread Chas Emerick
On May 23, 2011, at 3:48 AM, Laurent PETIT wrote: > So far, the "most" general techniques I can see are : either > bundle/repackage your webapp for the target servlet container > instance, either pass the path to configuration file(s) via one (or > more) JNDI parameters. That's about right — tho

Re: Passing "environment configuration parameters" to a Clojure web app

2011-05-23 Thread Laurent PETIT
Hello, Thanks for answering ! My remarks follow: 2011/5/22 Shantanu Kumar : > I have wondered about this problem and at the first glance it looked > straightforward to me to put moving parts (config elements that could > change) into dynamic vars/atoms/refs. The production env can use the > defa

Re: RIncater

2011-05-23 Thread Edmund Jackson
Hey Ulises, Sortof. The original author is updating thing so that they work more cleanly. In the interim if you want to get it to work modify the project.clj to look like this: https://gist.github.com/962673. Then comes the hard bit. The JRI uses native libraries that upon compilati

Aw: Callback functions

2011-05-23 Thread Meikel Brandmeyer
Hi, works for me. Did you call (require (symbol ns-name)) before the resolve call? Sincerely Meikel -- 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 m

Callback functions

2011-05-23 Thread Vivek Khurana
Hi! I am building an application with menu callbacks. Based on the url request the application has to call a function. The function name and namespace is available as strings from database. The issue I am facing is, when I try to call the function using ns-resolve, I get an error saying "No names