Re: Copying (immigrating) macros from namespace to namespace

2013-01-06 Thread Sean Corfield
Here's what I use to pull symbols from Enlive into FW/1:

(def ^:private enlive-symbols
  ['append 'at 'clone-for 'content 'do- 'html-content 'prepend
'remove-class 'set-attr 'substitute])

(defmacro enlive-alias ^:private [sym]
  `(let [enlive-sym# (resolve (symbol (str html/ ~sym)))]
 (intern *ns* (with-meta ~sym (meta enlive-sym#)) (deref enlive-sym#

This pulls in both functions and macros. It hard-codes the alias for
Enlive (html, for net.cgrand.enlive-html) but otherwise should serve
your needs. FW/1 uses it like this:

(doseq [sym enlive-symbols]
  (enlive-alias sym))

Sean

On Sun, Jan 6, 2013 at 12:19 PM, the80srobot a...@ingenious.cz wrote:
 I have come up with a solution to a problem I don't think exists outside of
 my mind, but since I can't for the life of me figure out how Clojure 'wants'
 me to do this, I thought I would bounce this off the Google Group.

 The scenario: I am trying to collect a bunch of functions and macros from
 all the different namespaces in my library into a single namespace; let's
 call the namespace adams-lib.api. The idea is that the consumer of the
 library will only have to include that one API namespace, and not all of the
 little namespaces with parts of the functionality.

 The problem: Obviously, calling (use) doesn't cut it, because the aliased
 vars are not immigrated by subsequent calls to the (use) of the namespace
 that (used) them. You know what I mean.

 The solution: For functions this is simpler, but macros pose some
 additional challenges, which is why I'm including my solution for
 immigrating macros. Hold on to your hats, this one is ugly:

 (defmacro immigrate-macro
   [ns-sym macro-sym]
   `(let [ nspublics# (ns-publics '~ns-sym)
   macro-var# (nspublics# '~macro-sym)
   macro-fn# @macro-var#
   macro-meta# (meta macro-var#)]
 (def ~macro-sym macro-fn#)
 (. (var ~macro-sym) (setMacro))
 (reset-meta! (var ~macro-sym) macro-meta#))
 nil)


 And using it:

 (immigrate-macro adams-lib.some-other-ns some-macro)


 There has got to be a simpler/better/less insane way of doing this. Would
 anyone care to weigh in? For the record, I fully realize that my solution is
 not OK.

 -Adam

 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en



-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Suggestion: add `into` on clojure.org/data_structures page

2013-01-06 Thread Sean Corfield
And there's also the excellent http://clojureatlas.com for exploring
concepts and their implementations within the Clojure ecosystem.

On Sun, Jan 6, 2013 at 3:08 PM, Andy Fingerhut andy.finger...@gmail.com wrote:
 For most of the documentation on clojure.org, only a few people have
 authorization to modify it.  You could create a JIRA ticket suggesting a
 change here:

 http://dev.clojure.org/jira/browse/CLJ

 Such tickets can take anywhere from a few days to many months before someone
 acts upon them, depending upon the severity of the issue.


 I'm not sure if you were looking for the info below, but here are some other
 sources of Clojure documentation:

 http://clojure-doc.org takes pull requests on github from anyone wanting to
 make changes to it.

 http://clojuredocs.org lets anyone with a free-and-quick-to-create account
 add examples or edit existing ones, add see also links, etc.

 There are auto-generated docs from source by going to clojure.org, clicking
 Documentation, then API Documentation.  That is hosted on github, too.

 http://clojure.org/cheatsheet has one way of organizing Clojure symbols.  By
 clicking the link Download other versions with tooltips near the top of
 that page, you can find versions of the cheatsheet that show the
 documentation of the symbols when you hover your mouse over them.

 Andy

 On Jan 6, 2013, at 2:10 PM, David James wrote:

 I noticed that `into` is not currently mentioned on
 http://clojure.org/data_structures

 How do community-suggested documentation changes work? Is there a wiki?
 Auto-generated docs from source?

 Thanks,
 David

 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en



-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Copying (immigrating) macros from namespace to namespace

2013-01-06 Thread Sean Corfield
On Sun, Jan 6, 2013 at 6:17 PM, Stuart Sierra
the.stuart.sie...@gmail.com wrote:
 1. `refer`. Define a public function that `refer`s all the symbols you want.
 It's an extra step for the user, but that's good because it makes it evident
 that extra symbols are being added.

Forcing all users of a library to refer a whole slew of symbols from
another library that they don't even know they're using is horrible
usability and really not a useful suggestion. The user should be able
to (:require [main-library :refer [what i want]) without being forced
to know about a transitive dependency and know which symbols come from
which library, if the main-library developer wishes to provide a
single, simple API.

Could you explain exactly how this breaks dynamic binding,
with-redefs, and the ability to redefine functions at the REPL given
the scenario we're discussing? Remember that the whole purpose of this
discussion is to essentially hide the underlying namespace from which
symbols originate, and to present a single namespace with the desired
API.

 2. `load`. If you have N namespaces with no clashing symbols, then you only
 need one namespace. If you want to split it across multiple files, use
 `load`. `clojure.core` does this.

Fine if you control all of the source yourself.

In the case of FW/1, I want a portion of Enlive available directly and
easily to users of FW/1. Enlive is a transitive dependency - users of
FW/1 don't need to know about it, and shouldn't really care.

Since this appears to be a relatively common use case for library
developers, perhaps a native Clojure solution that doesn't have the
downsides you list would be worth adding? Perhaps some sort of (export
some-ns/some-symbol) that makes *ns*/some-symbol appear like an exact
public alias of some-ns/some-symbol? So users of the library see those
exported symbols exactly as if they were declared in the library
itself, rather than the third-party dependency, and could interact
with them as such.
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: MultiMethod Interoperability with Java

2013-01-05 Thread Sean Corfield
My first thought it that this is because (class nil) = nil so even
tho' the 'correct' Java signature is matched and called, the
multi-method dispatch is still invoked under the hood.

So (String) null selects the [String] String signature, (class
valueHolder) = nil so the :default implementation is called, but I
would expect (nil? valueHolder) to be true and to have it return c.

Similarly, (Object) null selects [Object] String, but again calls the
:default implementation... although I would expect c back.

And (Integer) null selects [Integer] Integer, calls the :default
implementation and fails when it tries to return c (or more likely
d given the previous two results).

I'd add println calls to each implementation and see what valueHolder
seems to be in each case...

Sean

On Sat, Jan 5, 2013 at 12:49 AM, rjf89 robert@gmail.com wrote:
 I'm kind of new to Clojure at the moment, and have been playing around
 re-writing some utility libraries from work in Clojure for import into other
 pieces of our infrastructure. I'm having a blast using it, but I've gotten a
 bit stuck on trying to implement something with Multimethods. I have a
 multimethod dispatching based upon class – for example:

 (ns interop.core
   (:gen-class
:methods [[doSomething [String] String]
  [doSomething [Integer] Integer]
  [doSomething [Object] String]]))
 (defmulti -doSomething (fn [this valueHolder  default] (class
 valueHolder)))
 (defmethod -doSomething String [this valueHolder]
   (if (nil? valueHolder) a b))
 (defmethod -doSomething Integer [this valueHolder]
   (if (nil? valueHolder) (Integer. 1) (Integer. 2)))
 (defmethod -doSomething :default [this valueHolder]
   (if (nil? valueHolder) c d))


 If I compile and export this, and attempt to use it in a Java project, it
 works fine for most use cases:

 core c = new core();
 System.out.println(c.doSomething(new Integer(1))); // 2 -- Correct
 System.out.println(c.doSomething()); // 'b' -- Correct
 System.out.println(c.doSomething(new Object())); // 'd' -- Correct
 // System.out.println(c.doSomething(null)); // The method
 doSomething(String) is ambiguous
 System.out.println(c.doSomething((String) null)); // 'd' -- Wrong
 System.out.println(c.doSomething((Object) null)); // 'd' -- Correct
 System.out.println(c.doSomething((Integer) null)); // ClassCastExc: String
 cannot be cast to Integer


 The oddity is the last line. It looks like it's: Calling the Object =
 String implementation (marked default), but its trying to cast the result
 after the fact to an Integer (to match the Integer = Integer
 implementation). If I had to make a guess, I'd say the return type is being
 correctly matched, but the input parameter is causing the :default
 implementation to always be called. Anyone have any suggestions or ideas on
 either what I'm doing wrong, or even just whats happening behind the scenes?
 Any ideas on how to fix whats probably an egregious mistake on my behalf?

 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en



-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


ANN CongoMongo 0.4.0 released

2013-01-05 Thread Sean Corfield
CongoMongo - a Clojure-friendly API for MongoDB

https://github.com/aboekhoff/congomongo

Version 0.4.0 - January 4th, 2012

BREAKING CHANGES IN THIS RELEASE!

10gen have updated all their drivers to be more consistent in naming.
They have also changed the default write concern (from :none to
:normal, effectively). The new classes introduced have different APIs
to the classes they replace so there are some knock on changes to
CongoMongo as well. The biggest changes are that opt! has been removed
and the actual keyword arguments for MongoOptions have changed to
match MongoClientOptions$Builder instead. An IllegalArgumentException
is thrown for unknown arguments now. This may affect calls to
(mongo-options ..) as well removing (opt! ..)

* You can now pass :write-concern to destroy!, insert! and update! #74
* Upgrade to 2.10.1 Java driver (#104)
  * Switches from Mongo to MongoClient
  * Switches from MongoURI to MongoClientURI
  * Switches from MongoOptions to MongoClientOptions
  * Adds seven new write concern names - the old names are deprecated
(see set-write-concern below)
  * Changes the default write concern from :unacknowledged (formerly
called :normal) to :acknowledged (formerly called :safe or :strict)
* Update clojure.data.json to 0.2.1 (as part of #104)
* Add :replicas-safe write concern (although it is deprecated)
* Add support for :explain? (#102, #103 arohner)
* Switch fetch to use non-deprecated APIs (#101 arohner)
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: how to get the 'else' from if-not?

2013-01-04 Thread Sean Corfield
Seems to work just fine for me:

user (defn make-user-nice-name [map-of-profile]
  (let [user-nice-name
(if-not (or (nil? (:first_name map-of-profile)) (nil?
(:last_name map-of-profile)))
  (apply str (:first_name map-of-profile)   (:last_name
map-of-profile))
  (:username map-of-profile))]
user-nice-name))
#'user/make-user-nice-name
user (make-user-nice-name {:username seanc})
seanc
user (make-user-nice-name {:username seanc :first_name Sean})
seanc
user (make-user-nice-name {:username seanc :first_name Sean
:last_name Corfield})
Sean Corfield
user (make-user-nice-name {:username seanc :last_name Corfield})
seanc

FWIW, I think it would be more readable (and more idiomatic) like this:

(defn make-user-nice-name [map-of-profile]
  (if (and (:first_name map-of-profile) (:last_name map-of-profile))
(str (:first_name map-of-profile)   (:last_name map-of-profile))
(:username map-of-profile)))


On Fri, Jan 4, 2013 at 8:12 PM, larry google groups
lawrencecloj...@gmail.com wrote:

 This function gives me a nicely formatted name if the user has supplied a
 first_name or a last_name, however, if there is no first_name and no
 last_name then I get nothing at all. But the username is there in the
 record. Can someone tell me what I did wrong? Why is the username not
 getting set as the value of user-nice-name?


 (defn make-user-nice-name [map-of-profile]
   (let [user-nice-name
 (if-not (or (nil? (:first_name map-of-profile)) (nil? (:last_name
 map-of-profile)))
   (apply str (:first_name map-of-profile)   (:last_name
 map-of-profile))
   (:username map-of-profile))]
 user-nice-name))

 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en



-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure Conj Videos

2013-01-02 Thread Sean Corfield
On Wed, Jan 2, 2013 at 3:42 PM, Mark Derricutt m...@talios.com wrote:

 +1 - I'm sure I've even seen any BLOGS on this years Conj let alone videos.

http://corfield.org/blog/post.cfm/clojure-conj-2012
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Use repeat with a function argument

2012-12-24 Thread Sean Corfield
He's repeating a function argument, not a function.

Meikel is correct that the second expression causes (some #{0} ...) to
return nil when number is not a multiple of 3 or 5, and then zero? fails.
As he suggests...

(reduce + (filter (fn [number] (some zero? (map mod (take 2 (repeat
number)) [3 5]))) (range 1 1000)))

...works (and returns 233168)

Sean

On Sun, Dec 23, 2012 at 11:56 PM, Marko Topolnik
marko.topol...@gmail.comwrote:

 *repeat* is not supposed to work with functions, but there's *repeatedly.*


 On Monday, December 24, 2012 4:20:23 AM UTC+1, Andrew Care wrote:

 I'm trying to use repeat with a function argument. This works:

 (reduce + (filter (fn [number] (zero? (some #{0} (map mod (take 2 (repeat
 9)) [3 5] (range 1 1000)))

 This doesn't:

 (reduce + (filter (fn [number] (zero? (some #{0} (map mod (take 2 (repeat
 number)) [3 5] (range 1 1000)))

 Why can I use (repeat 9) and not (repeat number)?




-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure 1.5.0 RC 1

2012-12-23 Thread Sean Corfield
On Sun, Dec 23, 2012 at 8:50 AM, Peter Taoussanis ptaoussa...@gmail.comwrote:

 Specifically, seem to be having trouble with
 `ring.middleware.reload/wrap-reload`:
 Exception in thread main java.lang.IllegalArgumentException: contains?
 not supported on type: clojure.lang.LazySeq, compiling:(routes.clj:294:3)
 Line 294 is where the wrap-reload is applied, and this compiles fine under
 alpha3.


Sounds like http://dev.clojure.org/jira/browse/CLJ-932 where contains? now
throws an exception if used on a non-keyed collection type.


 Also `lein swank` appears to be failing on Leiningen 2.0.0-preview10:
 Exception in thread main java.lang.IllegalArgumentException: No matching
 ctor found for class clojure.lang.Compiler$CompilerException,
 compiling:(swank/commands/basic.clj:182:24)


Given that swank-clojure is deprecated, this may be the not so subtle push
that moves everyone over to nREPL :) IIRC, the problem is that swank
constructs that Java class explicitly and its signature has changed to
include column number?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure videos deleted from blip.tv?

2012-12-13 Thread Sean Corfield
When I tried to go to the Clojure videos link inside iTunes (from the set
of videos that I already have downloaded), it went to an unknown podcast
with no image and no episodes - and I can't find the actual list of
blip.tvepisodes in iTunes...


On Thu, Dec 13, 2012 at 3:59 PM, Leonardo Borges 
leonardoborges...@gmail.com wrote:


  Are these videos available elsewhere?

 Yes, in iTunes podcasts.


 Really? I tried finding them in itunes but no luck. Would you be able to
 point me to one of them?

 Cheers,
 Leo

 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Slime and heroku setup question

2012-12-12 Thread Sean Corfield
You should be able to run your app locally and do all your testing and
development locally. Heroku is just a remote server for deployment. I'd
suggest ignoring Heroku at first and focusing on getting your Clojure app
running locally. Presumably you are building a Ring / Jetty app?


On Wed, Dec 12, 2012 at 4:09 PM, Jonathon McKitrick jmckitr...@gmail.comwrote:

 So basically, I need to get used to editing in emacs, uploading to heroku,
 and (perhaps) interactively testing via a remote repl, correct?  Sorry to
 belabor the point, but I'm trying to flatten the learning curve.


 On Wednesday, December 12, 2012 2:22:33 AM UTC-5, Phil Hagelberg wrote:

 On Tue, Dec 11, 2012 at 6:55 PM, Jonathon McKitrick
 jmcki...@gmail.com wrote:
  Well, I've used slime with SBCL for quite a while, but this is my first
  foray into clojure and heroku.  Are you basically saying the best
 approach
  is just to edit locally, push to heroku, and run?

 I suppose if you ensure everything gets required when you boot your
 app and you limit yourself to commands which operate on the region
 rather than loading from disk (and avoid reloads) then you should be
 fine. It's just easy to get into an inconsistent state between what's
 on disk locally and what's in memory during any repl-driven
 development; throwing in a third factor of the remote disk just adds
 more room for error.

 -Phil

  --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Java, Lein, and Windows x64

2012-12-08 Thread Sean Corfield
Is this for Leiningen 2? I've been running it on Windows 8 64-bit without
needing to update lein.bat. Which version of Windows are you on?


On Sat, Dec 8, 2012 at 10:15 AM, Kruno Saho kruno.s...@gmail.com wrote:

 There seems to be an issue, which I have spent several days combating. The
 issue is simple, you can not download any dependencies, and therefore you
 can not run Lein at all.

 The solution is very simple, and it is a well knows solution. In lein.bat,
 at the very end of the file there needs to be a flag 
 -Djava.net.preferIPv4Stack=true ^, and so the final bat file looks like
 this:

 %JAVA_CMD% -client %LEIN_JVM_OPTS% ^
  -Dleiningen.original.pwd=%ORIGINAL_PWD% ^
  -Djava.net.preferIPv4Stack=true ^
  -cp %CLASSPATH% clojure.main -m leiningen.core.main %*

 :EOF

 Even more funny is the fact I knew this problem already existed in
 Eclipse, but solved it quickly, and yet taken me many days over the last
 couple weeks to solve it. If this could get added to lein.bat,or simply
 documented in the FAQ under Running x64 bit JVM under Windows it would
 help a lot of other people.

 Thanks.

 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: in keyword withing where claus java-jdbc

2012-12-05 Thread Sean Corfield
do-commands is intended for DDL, not SQL.

You just want do-prepared:

(sql/with-connection (db-connection)
 (sql/do-prepared (str update TASK_T_MSGIDS set status='T' where
msg_id in ( (apply str (interpose \, acks))  ) ))
   )


On Wed, Dec 5, 2012 at 1:13 AM, Amir Wasim amir.wa...@gmail.com wrote:

 aha, thanks Sean

 I tried alternate and did the following

 = (sql/with-connection (db-connection)
  (sql/do-commands (str update TASK_T_MSGIDS set status='T' where
 msg_id in ( (apply str (interpose \, acks))  ) ))
)

 = (sql/with-connection (db-connection)
  (transaction (sql/do-commands (str update TASK_T_MSGIDS set
 status='T' where msg_id in ( (apply str (interpose \, acks))  ) )))
)
 ==  (sql/with-connection (db-connection)
   (with-open [^Statement stmt (let [^java.sql.Connection con
 (sql/connection)] (.createStatement con))]
   (.addBatch stmt (str update TASK_T_MSGIDS set status='E' where
 msg_id in ( (apply str (interpose \, acks))  ) ))
   (sql/transaction (.executeBatch stmt

 and none of them worked. with exception of do-commands which halts the jvm
 but there is no error on terminal.

 Do you know a way to raw update statement with in within Where clause...


 On Wednesday, December 5, 2012 4:53:39 AM UTC+1, Sean Corfield wrote:

 ... in ? is not supported in c.j.jdbc


 On Tue, Dec 4, 2012 at 6:16 AM, Amir Wasim amir@gmail.com wrote:

 I am trying to use the following

 (defn commit-acknowledged
   [acks]
   (sql/with-connection (db-connection)
 (sql/transaction
   (sql/update-values MSGIDS [msg_id in ? acks] {status H})
   )
 )
 )

 here acks is type of clojure.lang.PersistentVector when i call this
 function i am getting java.sql.SQLException: Invalid column type


 does anyone know why i am getting this?

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com

 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en




 --
 Sean A Corfield -- (904) 302-SEAN
 An Architect's View -- http://corfield.org/
 World Singles, LLC. -- http://worldsingles.com/

 Perfection is the enemy of the good.
 -- Gustave Flaubert, French realist novelist (1821-1880)

  --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ANN: Clojure/West 2013 registration, CFP, sponsorships, training

2012-12-05 Thread Sean Corfield
How long did it actually take to sell all 50 early bird tickets?


On Wed, Dec 5, 2012 at 1:34 PM, Alex Miller a...@puredanger.com wrote:

 Based on a very quick response, the early bird is now sold out!  Plenty of
 tickets left at the regular rate though of $350 though.


 On Tuesday, December 4, 2012 11:43:46 PM UTC-6, Alex Miller wrote:

 Clojure/West http://clojurewest.org returns in 2013 to one of my
 favorite cities: Portland, Oregon. It will take place March 18-20th. Based
 on feedback from last year, we are reducing the number of tracks and
 spreading over 3 days with a mixture of single- and double-track. Our venue
 will be the Gerding Theater at the Armory in the heart of the Pearl
 District. The Gerding is a wonderful venue and should be a great
 location 
 (lobbyhttp://www.360cities.net/image/gerding-theater-at-armory-second-floor-perl-district-portland-oregon#147.15,-0.06,70.0
 , main 
 theaterhttp://www.360cities.net/image/gerding-theater-armory-main-stage-perl-district-portland-oregon-usa#-0.31,0.00,70.0
 ).

 Registration https://regonline.com/clojurewest2013 is now open (
 https://regonline.com/**clojurewest2013https://regonline.com/clojurewest2013).
  Only 50 early bird tickets are available for just $275 rising to $350 for
 the remainder. Buy now if you want the lower price - the early bird will go
 fast.

 Our conference hotel will be the Courtyard City 
 Centerhttp://www.marriott.com/hotels/travel/pdxpc-courtyard-portland-city-center/.
 We have arranged a conference rate of $124/night and the block is now
 available (King rooms code *cwccwca*, Queen rooms code *cwccwcb*).

 Relevance will be running an all-day ClojureScript training 
 classhttp://clojurewest.org/training/ led
 by Stuart Sierra and Luke VanderHart on the day before the conference
 (March 17). The venue is close to the conference hotel and the room block
 is available the night before the training as well. Training registration
 is open now http://clojurescript.eventbrite.com/.

 The call for presentationshttp://clojurewest.org/call-for-presentations/ 
 for
 Clojure/West is open till January 4th. Please check out the CFP and submit
 a talk! Rich Hickey will be giving a keynote (and others to be announced).
 Speakers receive free admission, airfare, and hotel.

 If your company is interested in sponsoring, the sponsorship 
 prospectushttp://clojurewest.org/sponsorship-prospectus/ is
 available. Clojure/West is a great opportunity to get your company's name
 in front of a great group of crazy smart developers.

 Alex Miller
 a...@thestrangeloop.com

  --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: in keyword withing where claus java-jdbc

2012-12-04 Thread Sean Corfield
... in ? is not supported in c.j.jdbc


On Tue, Dec 4, 2012 at 6:16 AM, Amir Wasim amir.wa...@gmail.com wrote:

 I am trying to use the following

 (defn commit-acknowledged
   [acks]
   (sql/with-connection (db-connection)
 (sql/transaction
   (sql/update-values MSGIDS [msg_id in ? acks] {status H})
   )
 )
 )

 here acks is type of clojure.lang.PersistentVector when i call this
 function i am getting java.sql.SQLException: Invalid column type


 does anyone know why i am getting this?

 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: understanding 'binding' use in clojure.java.jdbc

2012-12-03 Thread Sean Corfield
FWIW, the c.j.jdbc docs have an example of connection pooling:

http://clojure.github.com/java.jdbc/doc/clojure/java/jdbc/ConnectionPooling.html


On Mon, Dec 3, 2012 at 6:03 AM, Matthias Cords schlafbo...@gmail.comwrote:

 Hi,

 I found database connection pools to be the right thing to use with
 c.j.jdbc and multiple databases.

 https://clojars.org/org.bituf/clj-dbcp

 (let [conn1 (make-pool-1)
   conn2 (make-pool-2)]
   (sql/with-connection conn1
 (sql/with-query-results r [select ...]
   (sql/with-connection conn2
 (sql/do-commands insert into ...)

 matt



 On 10 October 2012 15:03, Stuart Sierra the.stuart.sie...@gmail.comwrote:



 On Tuesday, October 9, 2012 10:25:05 PM UTC-4, Sean Corfield wrote:

 This is why c.j.jdbc is getting an API overall that will expose
 functions that accept the connection or the db-spec directly (and the old
 API will be rewritten in terms of the new one for compatibility).


 Excellent.
 -S

  --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


  --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: confused about the scope of variables, or is it something else? ClojureScript

2012-12-02 Thread Sean Corfield
Part of it is laziness: map is lazy so it doesn't do anything unless you
use the result. In the REPL, you print the result so map runs across the
whole sequence. In the function, only the last expression (draggables) is
returned so it is the only thing fully evaluated.

Your code is very procedural tho'... you should not have 'def' anywhere
except the top-level (since it always creates top-level definitions -
globals). You probably want 'let' for local definitions. Since you want
non-lazy behavior, you're not going to want 'for' or 'map' - look at
'doseq' instead.

Hope that helps?


On Sun, Dec 2, 2012 at 5:25 PM, Arash Bizhan zadeh aras...@gmail.comwrote:

 I am playing with clojurescript, and I have this code:

 (defn prepare [number]
   (def targets (take 4 (drop (* 4 (- number 1)) (dom/getElementsByClass
 place-div
   (def target-objects (map #(make-target %) targets))
   (for [drag draggables target target-objects]
 (.addTarget drag target))
   (map #(.init %)  draggables)
   (map #(.init %) target-objects)
   draggables)

 It basically creates  a bunch of dragNdrop objects.
 This code doesn't work in this method - no error, just doesn't do the job
 -
 but if I execute the lines one at a time from repl, it works fine.
 Can someone please explain what the heck is going on ?

 much appreciated.

 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Proposed change to let- syntax

2012-12-01 Thread Sean Corfield
On Sat, Dec 1, 2012 at 6:33 AM, Rich Hickey richhic...@gmail.com wrote:

  Given that some- threads while non-nil but the fn some stops with the
 first logical true value, this seems counter-intuitive to me. when- seems
 better here, or while- perhaps? What other names were considered?
 when and while also use logical truth. We don't have anything where the
 basis is non-nil. Thus my extended description of how some* could come to
 occupy that role.


Ah, OK, so the change in semantics is specifically to allow threading of
true/false (as well as other non-nil values)... your intent is much clearer
to me now, thanx. I'm fine with some- after hearing that.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: JavaFX2, problem with overriden constructor

2012-12-01 Thread Sean Corfield
On Sat, Dec 1, 2012 at 11:58 AM, Christian Sperandio 
christian.speran...@gmail.com wrote:

 When I try to use the following constructor 
 *Scenehttp://docs.oracle.com/javafx/2/api/javafx/scene/Scene.html#Scene(javafx.scene.Parent,%20double,%20double,%20javafx.scene.paint.Paint)
 *(Parent http://docs.oracle.com/javafx/2/api/javafx/scene/Parent.html root,
 double width, double height, 
 Painthttp://docs.oracle.com/javafx/2/api/javafx/scene/paint/Paint.html
  fill)
 ...
 I call the constructor like this:  scene (Scene. root 500 250 Color/BLACK)
 I don't have any error if I do:
 (let [ scene (Scene. root 500 250)]
   (.setFill scene Color/BLACK))


Try: (Scene. root 500.0 250.0 Color/BLACK)
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Proposed change to let- syntax

2012-11-30 Thread Sean Corfield
On Fri, Nov 30, 2012 at 7:37 AM, Rich Hickey richhic...@gmail.com wrote:

 A) let- becomes as-


Fine with that.


 B) test- becomes cond-


Fine with that (because I can't think of anything better).


 C) when- becomes some-

 and in doing so, tests for non-nil rather than truth.


Given that some- threads while non-nil but the fn some stops with the
first logical true value, this seems counter-intuitive to me. when- seems
better here, or while- perhaps? What other names were considered?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: seq? vs sequential? vs coll?

2012-11-26 Thread Sean Corfield
A colleague showed me this page recently which seems like a nice quick
reference:

http://www.brainonfire.net/files/seqs-and-colls/main.html


On Mon, Nov 26, 2012 at 6:01 AM, Mark Engelberg mark.engelb...@gmail.comwrote:

 I understand that these functions test for different interfaces, but I
 don't have a clear sense for which things respond differently to these
 predicates.  Has anyone compiled a little table of what things satisfy
 which predicates?

 So far, I've figured out that although lists, strings, vectors, and sets
 all can seq:
 lists are seq?, sequential? and coll?
 vectors are not seq?, are sequential? and coll?
 sets are not seq? and not sequential?, but are coll?
 strings are not seq?, sequential? or coll?

 From these examples, it appears that:
 All seq? are sequential?
 All sequential? are coll?

 Is this really true, or have I just not found enough edge cases?

 Thanks.

 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: seq? vs sequential? vs coll?

2012-11-26 Thread Sean Corfield
clojure.core.incubator:
https://github.com/clojure/core.incubator/blob/master/src/main/clojure/clojure/core/incubator.clj#L77


On Mon, Nov 26, 2012 at 1:51 PM, Frank Siebenlist 
frank.siebenl...@gmail.com wrote:

 Guess we need a test for seq'able ;-)

 -FS.


 On Nov 26, 2012, at 1:47 PM, Herwig Hochleitner hhochleit...@gmail.com
 wrote:

  2012/11/26 Philip Potter philip.g.pot...@gmail.com
   Since ISeq already is a seq and IPersistentCollection derives from
 Sequable,
   both will succeed in a seq call.
 
  A Seqable isn't necessarily a seq:
 
  Didn't say that, but Sequable defines the .seq() method, so it will
 succeed in a seq call.
 
  --
  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.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en

 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ease of use

2012-11-22 Thread Sean Corfield
On Thu, Nov 22, 2012 at 5:39 PM, atucker agjf.tuc...@gmail.com wrote:

 Thanks all!  Sounds like I need to install some more stuff.


I'll +1 what some of the others have said: I too started with Aquamacs and
was told don't do that and later learned they were right! Emacs 24.x from
the emacsformacosx.com site will be a better start. Add the marmalade repo,
install the starter-kit package and the various nrepl packages and you
should be mostly good to go.


 One more question if anyone knows: didn't it use to be possible to make
 parallel connections to the same server?  Can't seem to do it with the new
 set-up...


I just started up a lein repl in one window and then in Emacs did M-x nrepl
to connect to it, then M-x nrepl again to create a second connection to the
same server and it seems to work (I hadn't tried that before).
--
Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Fail to run `lein bootstrap` in ClojureScript One

2012-11-21 Thread Sean Corfield
ClojureScript One still requires Leiningen 1.x - it hasn't been updated to
Leiningen 2.x yet.


On Wed, Nov 21, 2012 at 10:06 PM, Satoru Logic satorulo...@gmail.comwrote:

 HI, all.

 I'm following the instructions on
 http://clojurescriptone.com/getting-started.html,
 and run `lein bootstrap` in the `one` directory, but `lein` complains that
 *'bootstrap' is not a task*.

 How can I install this `bootstrap` task?

 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: need to build clojure myself again?

2012-11-19 Thread Sean Corfield
Try -beta1 - I recall a patch recently that was supposed to fix this.


On Mon, Nov 19, 2012 at 11:47 AM, Jim - FooBar(); jimpil1...@gmail.comwrote:

 Moving from clojure-1.5-alpha1 to -alpha4 i get this again:

 NoClassDefFoundError jsr166y/ForkJoinTask clojure.core.reducers/fjinvoke
 (reducers.clj:61)

 It took me a minute but eventually I remembered the same thing happened
 when I moved from 1.4 to 1.5-alpha1 in order to use reducers. There seems
 to exist aot-compiled (against javac 6) code that will not work with Java 7.

 Is this intentional and will it generally continue happening?

 Jim



 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Sean Corfield
On Mon, Nov 19, 2012 at 9:51 AM, Phil Hagelberg p...@hagelb.org wrote:

 Perhaps it would be helpful if you could explain in more detail what it
 is about the provided explanation that you found confusing?


In the first step you use an actual example, then switch to $KEY_ID without
explanation, instead of again showing an actual example. At the conj, you
just put up slides without any indication of what $KEY_ID was or where it
could be found.

If you turn off :sign-releases inside your :repositories entry when
 deploying libraries everything will work for you as before. But your
 libraries won't qualify for the Releases repo in this case. So once your
 users upgrade to Leiningen 2.0.0 they will have to include a separate
 :repositories entry for the classic repo to indicate that they are OK
 with pulling in dependencies that don't meet the higher standards of the
 new repo.


So the choices are:
* follow the signing path (install and learn gpg etc), users don't need to
do anything
* ignore the signing path, Leiningen will refuse to upload your libraries?
* explicitly turn off signing, users will be forced to change project.clj

Which means this isn't really an optional change: Leiningen is forcing
signing on the community.

Again, I'm not arguing against it, I just want to be clear about whether we
have a status quo option (we don't) so we must change.

Indeed, the root problem is this notion that you can be a professional
 software developer and remain ignorant of how public-key crypto works.


Are you saying that all those people who don't have gpg or similar
installed are unprofessional? It seems that such a statement would insult a
very large number of software developers.

So collecting improved documentation and educational resources is going
 to need to be a priority. I'll do what I can to put together good general
 resources but will need help covering systems like Windows and OS X that
 make things more difficult.


Perhaps you could run Windows and OS X in VMs on your Linux machine so you
can experience what it is like and write about it from the perspective of a
newbie on those OSes? The Windows experience for Clojure is already sub-par
compared to OS X and Linux (although it has improved over time) and this is
another Linux-centric change. OS X has been sufficiently Linux-y in the
past to have escaped change but now is also on the other side of this
particular fence. Have you considered adding keygen to Leiningen so that it
can bridge that divide, as it does for every other aspect of the project
automation process? (well, barring the initial curl/wget issue on Windows
which can be mitigated by downloading the JAR directly)
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Sean Corfield
On Mon, Nov 19, 2012 at 2:28 PM, Phil Hagelberg p...@hagelb.org wrote:

 Yeah, we intended to use that originally, but Bouncy Castle's PGP
 support is awful beyond words. It's effectively undocumented, and the
 classes it exposes really only make sense if you have the OpenPGP RFC
 memorized.


Ugh! :( And there are no other reasonable options?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Sean Corfield
FWIW, after setting up a public key etc and using lein deploy clojars to
push congomongo 0.3.3 (successfully with one key), I am also getting the
error about transferring the POM:

Sending congomongo/congomongo/0.3.3/congomongo-0.3.3.pom.asc (1k)
to https://clojars.org/repo/
Sending congomongo/congomongo/0.3.3/congomongo-0.3.3.jar.asc (1k)
to https://clojars.org/repo/
Sending congomongo/congomongo/0.3.3/congomongo-0.3.3.jar (15k)
to https://clojars.org/repo/
Sending congomongo/congomongo/0.3.3/congomongo-0.3.3.pom (3k)
to https://clojars.org/repo/
Could not transfer artifact congomongo:congomongo:pom:0.3.3 from/to clojars
(https://clojars.org/repo/): Access denied to:
https://clojars.org/repo/congomongo/congomongo/0.3.3/congomongo-0.3.3.pom,
ReasonPhrase:Forbidden.
Failed to deploy artifacts: Could not transfer artifact
congomongo:congomongo:pom:0.3.3 from/to clojars (https://clojars.org/repo/):
Access denied to:
https://clojars.org/repo/congomongo/congomongo/0.3.3/congomongo-0.3.3.pom,
ReasonPhrase:Forbidden.

I still seem to be able to pull the library into a project and Clojars says
it has been promoted (after my first successful try - with a different key
/ user ID).


On Sun, Nov 18, 2012 at 7:14 AM, Nelson Morris nmor...@nelsonmorris.netwrote:

 The Invalid anti-forgery token message is a unfortunate side effect
 of interaction with sessions and restarting the server.  It should
 disappear if the profile page is refreshed.

 enclog 0.5.8 appears in the releases repo, so everything is ok.  I
 have a theory as to why that message occurred and will see what I can
 track down for the future.  Unfortunately, I'd expect a possibility of
 this occurring for any redeployment of artifacts with signatures
 already in the classic repo.

 Thanks for signing and feedback about the issues.

 On Sun, Nov 18, 2012 at 8:57 AM, Jim - FooBar(); jimpil1...@gmail.com
 wrote:
  Ok I managed to push my jar successfully, but i got this at the end:
 
  Could not transfer artifact enclog:enclog:pom:0.5.8 from/to clojars
  (https://clojars.org/repo/): Access denied to:
  https://clojars.org/repo/enclog/enclog/0.5.8/enclog-0.5.8.pom,
  ReasonPhrase:Forbidden.
  Failed to deploy artifacts: Could not transfer artifact
  enclog:enclog:pom:0.5.8 from/to clojars (https://clojars.org/repo/):
 Access
  denied to: https://clojars.org/repo/enclog/enclog/0.5.8/enclog-0.5.8.pom
 ,
  ReasonPhrase:Forbidden.
 
  Is this important?
 
  Jim
 
 
  On 18/11/12 14:46, Jim - FooBar(); wrote:
 
  On 18/11/12 14:39, Nelson Morris wrote:
 
  The previous one was a bit
  strict on the whitespace
 
 
  I just pasted the same with no wxtra white-space and now I'm getting
 
  Invalid anti-forgery token
 
  my god what is happening?
 
  Jim
 
 
 
  --
  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.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en

 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Sean Corfield
On Mon, Nov 19, 2012 at 10:32 PM, Phil Hagelberg p...@hagelb.org wrote:

 Someone who writes software for a living
 without understanding how to securely share secrets over email *and is
 perfectly happy with that fact* is doing something wrong.


Thanx for that clarification :)


 That's actually illegal to do with OS X.


They still don't allow you to run it in a VM if you bought a copy? Dang, I
thought they'd actually fixed that silliness. Good to know.


 Windows isn't that we don't know what's broken; it's that nobody with
 the skills to fix it has volunteered to help.


Well, I'm buying a Windows 8 ultrabook convertible in the next few weeks
and plan to use it for Clojure development while I'm on the road so I'll
have quite the incentive to help...
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] new book: ClojureScript: Up and Running

2012-11-19 Thread Sean Corfield
I wonder if it's some aspect of lein trampoline on Windows. As I understand
it, trampoline generates a file that is used to fire up the next process
and it may well have some *nix-ism that isn't compatible with Windows?


On Mon, Nov 19, 2012 at 11:18 PM, Mark Engelberg
mark.engelb...@gmail.comwrote:

 I just received the book today.  I was surprised to see how thin it is,
 but I'm glad the book exists.  I had a lot of trouble getting up and
 running several months ago, using only the scattered install instructions
 on the web.  It's nice to have a clear path to getting started.

 Unfortunately, I can't get past page 8 and would appreciate some
 additional guidance.
 Using the latest lein 2.0 preview 10, I did lein new cljs2 to create a
 new project called cljs2.
 Then, I edited the project.clj file as described in the book, using the
 latest version number for lein-cljsbuild:

 (defproject cljs2 0.1.0-SNAPSHOT
   :description FIXME: write description
   :url http://example.com/FIXME;
   :license {:name Eclipse Public License
 :url http://www.eclipse.org/legal/epl-v10.html}
   :dependencies [[org.clojure/clojure 1.4.0]
  [org.clojure/clojurescript 0.0-1450]]
   :plugins [[lein-cljsbuild 0.2.9]]
   :cljsbuild {:builds []})

 Then, at the command prompt I typed:
 lein trampoline cljs-build repl-rhino
 and got the following error message.  I'm running on Windows.  Any idea
 what's going wrong?
 Thanks.

 C:\devel\Clojure\lein\cljs2lein trampoline cljsbuild repl-rhino
 Running Rhino-based ClojureScript REPL.
 Exception in thread main clojure.lang.LispReader$ReaderException:
 java.lang.Ru
 ntimeException: EOF while reading, starting at line 1
 at clojure.lang.LispReader.read(LispReader.java:215)
 at clojure.core$read.invoke(core.clj:3346)
 at clojure.core$read.invoke(core.clj:3344)
 at clojure.main$eval_opt.invoke(main.clj:295)
 at clojure.main$initialize.invoke(main.clj:316)
 at clojure.main$script_opt.invoke(main.clj:340)
 at clojure.main$main.doInvoke(main.clj:427)
 at clojure.lang.RestFn.invoke(RestFn.java:703)
 at clojure.lang.Var.invoke(Var.java:450)
 at clojure.lang.AFn.applyToHelper(AFn.java:212)
 at clojure.lang.Var.applyTo(Var.java:532)
 at clojure.main.main(main.java:37)
 Caused by: java.lang.RuntimeException: EOF while reading, starting at line
 1
 at clojure.lang.Util.runtimeException(Util.java:170)
 at clojure.lang.LispReader.readDelimitedList(LispReader.java:1117)
 at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962)
 at clojure.lang.LispReader.read(LispReader.java:180)
 ... 11 more

  --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] new book: ClojureScript: Up and Running

2012-11-19 Thread Sean Corfield
Looks like George nailed it with his note about issue 674 which came in
while I was writing my (accurate but not particularly helpful) response...


On Mon, Nov 19, 2012 at 11:45 PM, Sean Corfield seancorfi...@gmail.comwrote:

 I wonder if it's some aspect of lein trampoline on Windows. As I
 understand it, trampoline generates a file that is used to fire up the next
 process and it may well have some *nix-ism that isn't compatible with
 Windows?


 On Mon, Nov 19, 2012 at 11:18 PM, Mark Engelberg mark.engelb...@gmail.com
  wrote:

 I just received the book today.  I was surprised to see how thin it is,
 but I'm glad the book exists.  I had a lot of trouble getting up and
 running several months ago, using only the scattered install instructions
 on the web.  It's nice to have a clear path to getting started.

 Unfortunately, I can't get past page 8 and would appreciate some
 additional guidance.
 Using the latest lein 2.0 preview 10, I did lein new cljs2 to create a
 new project called cljs2.
 Then, I edited the project.clj file as described in the book, using the
 latest version number for lein-cljsbuild:

 (defproject cljs2 0.1.0-SNAPSHOT
   :description FIXME: write description
   :url http://example.com/FIXME;
   :license {:name Eclipse Public License
 :url http://www.eclipse.org/legal/epl-v10.html}
   :dependencies [[org.clojure/clojure 1.4.0]
  [org.clojure/clojurescript 0.0-1450]]
   :plugins [[lein-cljsbuild 0.2.9]]
   :cljsbuild {:builds []})

 Then, at the command prompt I typed:
 lein trampoline cljs-build repl-rhino
 and got the following error message.  I'm running on Windows.  Any idea
 what's going wrong?
 Thanks.

 C:\devel\Clojure\lein\cljs2lein trampoline cljsbuild repl-rhino
 Running Rhino-based ClojureScript REPL.
 Exception in thread main clojure.lang.LispReader$ReaderException:
 java.lang.Ru
 ntimeException: EOF while reading, starting at line 1
 at clojure.lang.LispReader.read(LispReader.java:215)
 at clojure.core$read.invoke(core.clj:3346)
 at clojure.core$read.invoke(core.clj:3344)
 at clojure.main$eval_opt.invoke(main.clj:295)
 at clojure.main$initialize.invoke(main.clj:316)
 at clojure.main$script_opt.invoke(main.clj:340)
 at clojure.main$main.doInvoke(main.clj:427)
 at clojure.lang.RestFn.invoke(RestFn.java:703)
 at clojure.lang.Var.invoke(Var.java:450)
 at clojure.lang.AFn.applyToHelper(AFn.java:212)
 at clojure.lang.Var.applyTo(Var.java:532)
 at clojure.main.main(main.java:37)
 Caused by: java.lang.RuntimeException: EOF while reading, starting at
 line 1
 at clojure.lang.Util.runtimeException(Util.java:170)
 at clojure.lang.LispReader.readDelimitedList(LispReader.java:1117)
 at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962)
 at clojure.lang.LispReader.read(LispReader.java:180)
 ... 11 more

  --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




 --
 Sean A Corfield -- (904) 302-SEAN
 An Architect's View -- http://corfield.org/
 World Singles, LLC. -- http://worldsingles.com/

 Perfection is the enemy of the good.
 -- Gustave Flaubert, French realist novelist (1821-1880)




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Clojars Releases repository

2012-11-19 Thread Sean Corfield
I removed congomongo completely from my local repo and lein repl seemed to
pull it back down with no problems. Tested it on two machines. So it seems
the repo on Clojars is OK for me - except that I can't redeploy the POM?


On Tue, Nov 20, 2012 at 12:22 AM, Peter Taoussanis ptaoussa...@gmail.comwrote:

 I'd caution anyone against trying to redeploy their libraries right now
 since there seems to be some serious unresolved issues. I just tried a
 redeploy myself and am also getting the ReasonPhrase:Forbidden error.

 Unfortunately this seems to leave the repo in a bad state, since
 dependency pull requests now come back with a Checksum validation failed.

  I still seem to be able to pull the library into a project and Clojars
 says it has been promoted (after my first successful try - with a different
 key / user ID).

 Sean, are you sure it's working if the dependency isn't already in your
 .m2 cache?

 - Peter Taoussanis

 --
 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.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Clojars Releases repository

2012-11-18 Thread Sean Corfield
On Sun, Nov 18, 2012 at 5:56 AM, Phil Hagelberg p...@hagelb.org wrote:

 If you don't have a key yet, generate one with `gpg --gen-key`. The
 default settings are pretty good, though I'd recommend making it expire
 in a year or two. Next find your key ID. It's the 8-character part after
 the slash on the line beginning with pub:


As I said at the conj, I'm looking forward to the documentation explaining
how to install and use gpg since it's not provided by default on either Mac
OS X or Windows.

Then you can show it with `gpg --export -a $KEY_ID`.


$KEY_ID? (again, as I noted at the conj, without good documentation on the
Leiningen site for this, folks won't necessarily know what this is or why
they need to do all of this, especially the web of trust stuff you
discussed and key exchanges / publishing etc).

The Releases repository is the final missing piece of the puzzle for a
 final release of Leiningen 2. But the time isn't yet right because
 version 2 will only check Central and the Clojars Releases repo by
 default. So since the new Releases repo only has a handful of jars, it
 would be a jarring transition to switch at this point. That's why we're
 hoping library maintainers can do what's necessary to ensure their
 libraries make it into the new repository.


So if the status quo persists and Mac and Windows users don't bother to
install gpg, the Clojars process will stay exactly as it is? In other
words, we can simply ignore the whole gpg issue and continue with things
just as we do today and it won't break? Will users of Clojars projects be
required to install and use gpg?

(I'm not arguing against encryption or signing - just trying to a) point
out that I think the vast majority of Clojure library developers probably
don't have gpg installed and b) establish what is _required_ vs _optional_
and figure out what your plans are regarding existing Clojars projects and
users)
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: lein 2.x not working on Mac OS X 10.7.5 -- Exception in thread main java.lang.ClassNotFoundException:

2012-11-13 Thread Sean Corfield
On Tue, Nov 13, 2012 at 4:11 PM, Alec Ramsay a...@frontseat.org wrote:
 But while lein new still works, lein run does not. I get the following
 exception:

How did you create that project? lein new http_hello3 - or - lein new
http-hello3?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: run-jetty doesn't shut down the server after ctrl+c?

2012-11-13 Thread Sean Corfield
On Tue, Nov 13, 2012 at 8:33 PM, Satoru Logic satorulo...@gmail.com wrote:
 BindException Address already in use  sun.nio.ch.Net.bind (Net.java:-2)

 user= 2012-11-14 11:44:21.370:WARN:oejuc.AbstractLifeCycle:FAILED
 SelectChannelConnector@0.0.0.0:3000: java.net.BindException: Address already
 in use
 java.net.BindException: Address already in use


 And I can still access the Hello World example with localhost:3000.

Sounds like you already have a copy of the app - or another ring app -
running since the port is in use and you can still access it.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Coding Standard - ns usage

2012-11-12 Thread Sean Corfield
On Sun, Nov 11, 2012 at 10:31 PM, Denis Labaye denis.lab...@gmail.com wrote:
 Most of my Clojure usage is as a scripting language (where other would use
 Python or Ruby).
 I usually don't plan in advance how my program will be splitted in
 namespaces :
 I start from one namespace that does everything, let it grow, and split it
 if it make sense.

Ah, then your use of boilerplate makes sense.

Don't you find the startup time of the JVM to be a disadvantage for
using Clojure vs Python / Ruby?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Coding Standard - ns usage

2012-11-11 Thread Sean Corfield
On Sun, Nov 11, 2012 at 2:26 PM, Mark Engelberg
mark.engelb...@gmail.com wrote:
 I can relate to Denis' issue.  I find it pretty common to have a common set
 of dependencies across every file in a project.

Well, I have to say I was puzzled by Denis' post because I definitely
don't have common dependencies across every file. Now hearing you say
the same thing I'm doubly puzzled...

I don't like to have anything imported that I'm not explicitly using
(and I regularly double-check after refactoring to make sure I remove
any redundant imports). Preferences aside, however, I'm genuinely
curious as to the sort of program structure that has the same
dependencies in every namespace. I can see how some of Denis' imports
are useful for the repl - but I tend to just import them as needed or
write them out in full (clojure.pprint/pprint is my most common one) -
but I'm a bit surprised to see set, string, xml, sh and io all being
that common (in every file).

Denis, Mark, could you speak to what sort of things you're using these
for that make it convenient to have them in every namespace?

I tend to have I/O isolated to one or two namespaces, the same goes
for shell operations, and XML operations. Maybe we're working in
different enough fields that our use cases are very different (I
suspect that's true for Mark - not sure what area Denis works in?).
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Coding Standard - ns usage

2012-11-11 Thread Sean Corfield
On Sun, Nov 11, 2012 at 6:40 PM, Mark Engelberg
mark.engelb...@gmail.com wrote:
 set, string, numeric-tower, combinatorics all provide fundamental operations
 I need throughout my code.

Ah, very different fields of work. Makes sense.

 My work doesn't usually involve creating a standalone compiled program.  I
 move around from namespace to namespace, interacting with my code from the
 REPL.  In a sense, my code along with the REPL is just my workbench, a
 suite of utilities that I use to solve problems interactively.

OK. That also makes sense.

 One complication that hasn't yet been discussed in this conversation about
 preferring refer to use is that some libraries, such as Incanter, spread
 functions across several namespaces but the tutorials don't really tell you
 which functions come from which namespaces.  The tutorial expects you to
 just use all of the relevant namespaces to use Incanter.

Could I argue poor library design here? No well-defined API? :)

 Just curious, why do you take such care to go through and remove any
 redundant imports?

Clarity of intent. When I read an (ns ..) form, it should tell me
exactly what this namespace depends on, no more, no less. I like a
very structured flow of dependencies. When I see repeated dependencies
across namespaces, if feels like a code smell to me and I'll look for
an appropriate refactoring. Sure, some of the core Clojure libraries
(core + contrib) are repeated as dependencies in several namespaces,
but even there you might be surprised at how little repetition I have.
Call it OCD :)
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: [ANN] ClojureScript release 0.0-1535 with G.Closure 0.0-2029

2012-11-11 Thread Sean Corfield
On Sun, Nov 11, 2012 at 8:49 PM, Evan Mezeske emeze...@gmail.com wrote:
 Oops, I've been out of town and did not see this release!  I'll cut a new
 lein-cljsbuild tomorrow night.

Wasn't trying to make you feel guilty! Just wondered if there was a
policy of tracking builds.

Welcome back - and thank you!
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: clojure.java.jdbc says data too long for 1 character of data

2012-11-10 Thread Sean Corfield
On Sat, Nov 10, 2012 at 9:20 AM, larry google groups
lawrencecloj...@gmail.com wrote:
 In MySql I have a table with a field called is_top_winner and this is
 defined as char(1). In Clojure I have this function:

 (defn downgrade-everyone [db]
   2012-11-10 - Let's start by saying no one is a top expert. In a later
 step we will upgrade those users who are top winners.
   (sql/with-connection db
 (sql/update-values
  :sf_guard_user_profile
  [true]
  {:is_top_winner 'f' })))

'f' is a symbol, not a string or a character. Try: {:is_top_winner
f} or {:is_top_winner \f}
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: does clojure.java.jdbc/with-connection db keep the connection alive?

2012-11-10 Thread Sean Corfield
On Sat, Nov 10, 2012 at 9:21 AM, larry google groups
lawrencecloj...@gmail.com wrote:
 Thank you much. You suggest a good approach: I'll just get it working and
 then I'll worry about performance later.

And as I said, happy to help you off-list since a) I maintain
java.jdbc and b) I've been using it very heavily in production for
about 18 months for World Singles.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: does clojure.java.jdbc/with-connection db keep the connection alive?

2012-11-10 Thread Sean Corfield
On Sat, Nov 10, 2012 at 12:27 PM, larry google groups
lawrencecloj...@gmail.com wrote:
 Thank you very much for all of your help. I am curious, is there anyway to
 print out the sql that is actually run against the database? I looked here
 but didn't see anything obvious:
 https://github.com/clojure/java.jdbc/blob/master/src/main/clojure/clojure/java/jdbc.clj

Not yet. http://dev.clojure.org/jira/browse/JDBC-1 - it will happen at
some point.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Coding Standard - ns usage

2012-11-09 Thread Sean Corfield
On Thu, Nov 8, 2012 at 3:19 PM, Softaddicts lprefonta...@softaddicts.ca wrote:
 Oh, I must say that I rarely use the Eclipse debugger. Tracing does most of 
 the job.
 Removing use would force us to redefine it somehow.

(:use clojure.tools.trace) = (:require [clojure.tools.trace :refer :all)
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Coding Standard - ns usage

2012-11-09 Thread Sean Corfield
On Fri, Nov 9, 2012 at 8:28 AM, Sean Corfield seancorfi...@gmail.com wrote:
 On Thu, Nov 8, 2012 at 3:19 PM, Softaddicts lprefonta...@softaddicts.ca 
 wrote:
 Removing use would force us to redefine it somehow.
 (:use clojure.tools.trace) = (:require [clojure.tools.trace :refer :all)

*sigh* no paredit in Gmail and I haven't had my coffee yet:

(ns ...
  (:use clojure.tools.trace) = (:require [clojure.tools.trace :refer :all])
  ...)

but I'm sure y'all knew what I meant.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: [ANN] ClojureScript release 0.0-1535 with G.Closure 0.0-2029

2012-11-09 Thread Sean Corfield
Nice!

I wonder how quickly lein-cljsbuild will get updated for this new
release? (Evan?)

Nice to see Leiningen and lein-cljsbuild introduced up front in your
book as the quickest way to get up and running, Stuart!

Sean

On Fri, Nov 9, 2012 at 6:17 AM, Stuart Sierra
the.stuart.sie...@gmail.com wrote:
 ClojureScript release 0.0-1535 is out. Get it in Leiningen:

 [org.clojure/clojurescript 0.0-1535]

 Change log for this release:
 http://build.clojure.org/job/clojurescript-release/19/

 This release depends on the latest version of the Google Closure Library,
 r2029. You can also depend on it explicitly:

 [org.clojure/google-closure-library 0.0-2029]

 ClojureScript does NOT depend directly on the Google Closure Library
 third-party extensions, but you can get it:

  [org.clojure/google-closure-library-third-party 0.0-2029]

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: does clojure.java.jdbc/with-connection db keep the connection alive?

2012-11-09 Thread Sean Corfield
On Fri, Nov 9, 2012 at 9:42 AM, larry google groups
lawrencecloj...@gmail.com wrote:
 Can I assume that sql/with-connection does some magic in the background to
 manage the connection? I would not want the connection to get shut down, and
 then restarted, everytime I run a query.

Use a connection pool. There's an example of c3p0 in the java.jdbc
documentation:

http://clojure.github.com/java.jdbc/

Specifically:

http://clojure.github.com/java.jdbc/doc/clojure/java/jdbc/ConnectionPooling.html
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: does clojure.java.jdbc/with-connection db keep the connection alive?

2012-11-09 Thread Sean Corfield
I'm not sure why you'd need to use those low-level APIs for normal queries etc?

Perhaps you can explain a bit more about what you're trying to do.

Have you looked at this page:
http://clojure.github.com/java.jdbc/doc/clojure/java/jdbc/UsingSQL.html

Sean

On Fri, Nov 9, 2012 at 10:13 AM, larry google groups
lawrencecloj...@gmail.com wrote:
 Thank you. Again, apologies for the ignorant questions. I'm reading over
 this:

 http://clojure.github.com/java.jdbc/

 If I read this correctly, once I have the db connection, I can use a
 combination of

 prepare-statement

 and

 do-prepared

 to run the select statements that i need to make?

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: does clojure.java.jdbc/with-connection db keep the connection alive?

2012-11-09 Thread Sean Corfield
On Fri, Nov 9, 2012 at 10:19 AM, larry google groups
lawrencecloj...@gmail.com wrote:
 Usage: (do-commands  commands)

 This seems flexible, but how does it know what the open database connection
 is? I have to switch between 2 databases.

do-commands is intended for DDL. All of these API methods are intended
to be used inside (with-connection ...) which is how they know which
DB connection to use.

Again:

Perhaps you can explain a bit more about what you're trying to do.

Have you looked at this page:
http://clojure.github.com/java.jdbc/doc/clojure/java/jdbc/UsingSQL.html

I think you're over-thinking / over-complicating what you need...
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: does clojure.java.jdbc/with-connection db keep the connection alive?

2012-11-09 Thread Sean Corfield
On Fri, Nov 9, 2012 at 3:17 PM, larry google groups
lawrencecloj...@gmail.com wrote:
 http://clojure.github.com/java.jdbc/doc/clojure/java/jdbc/UsingSQL.html

 I will read over that page. I have no experience with Java, which would
 probably help as there seem to be an abundance of Java examples on related
 topics.

There's no Java at all on that page (hence my puzzlement).

 but I am assuming I would get terrible performance if I use with-connection,
 since I need to make several queries.

Get it working first, then worry about performance (and all you'll
need to do is add the connection pooling stuff as indicated in the
java.jdbc docs and use (db-connection) instead of plain db in your
with-connection calls).

I think you're over-thinking things and I'd be happy to try to help
you off-list if you want - send me an email and we'll figure out
screen sharing or something so I can walk you thru it and get you up
and running.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: EOFException when using clojuredocs under repl

2012-11-09 Thread Sean Corfield
On Fri, Nov 9, 2012 at 8:50 PM, Satoru Logic satorulo...@gmail.com wrote:
 But when I try, it failed with an `EOFException`:

   user= (clojuredocs pprint)
   EOFException Unexpected end of ZLIB input stream
 java.util.zip.InflaterInputStream.fill (InflaterInputStream.java:223)

 Is this a bug?

Perhaps a firewall issue or something? Or maybe clojuredocs.org was
temporarily down?

It works fine for me now.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: [ANN] new book: ClojureScript: Up and Running

2012-11-08 Thread Sean Corfield
On Wed, Nov 7, 2012 at 4:23 PM, Stuart Sierra
the.stuart.sie...@gmail.com wrote:
 Not to toot our own horn, but people have been asking about getting started
 with ClojureScript, so here's our contribution, just released in book form:
...
 http://shop.oreilly.com/product/0636920025139.do

Nice. $15 and already sync'd to my DropBox on all my devices - some
light reading for the train in/out of SF tonight to listen to Rich
Hickey speak at the Bay Area Clojure Meetup!
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: [ANN] new book: ClojureScript: Up and Running

2012-11-08 Thread Sean Corfield
On Thu, Nov 8, 2012 at 2:39 PM, Mayank Jain firesof...@gmail.com wrote:
 Try this code : MBBGS
 It should give you 50% off on the book. Hopefully. :)

Thanx but too late. One of my colleagues also bought it 50% off with a
different code. I'm happy with $15 :)
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: with-open and line-seq

2012-11-07 Thread Sean Corfield
On Wed, Nov 7, 2012 at 11:09 AM, Dave Ray dave...@gmail.com wrote:
 (defn get-records [file-name]
   (with-open [r (reader file-name)]
 (line-seq r)))

I suspect it's considered more idiomatic to do:

(defn process-records [process file-name]
  (with-open [r (reader file-name)]
(doseq [line (line-seq r)]
  (process line

Thoughts?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Cdr car

2012-11-06 Thread Sean Corfield
On Tue, Nov 6, 2012 at 9:34 AM, JvJ kfjwhee...@gmail.com wrote:
 There's quite a number of functions like caar, cadr, cadadr, etc.  It's
 lengthy to do that in clojure with just first and rest.

Clojure does have ffirst, fnext, nfirst, nnext tho' - and I'd question
why you'd need to string several of them together... almost sounds
like you'd want different data structures or a more descriptive way to
access data in them? Perhaps vectors and maps and get-in?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Problem installing Noir with Lein

2012-11-02 Thread Sean Corfield
On Fri, Nov 2, 2012 at 8:15 PM, Satoru Logic satorulo...@gmail.com wrote:
 So I add a line of requirement into `~/.lein/profiles.clj`:

  [lein-noir 1.2.1]

You should not need that.

I just tried on my system, which has no ~/.lein/profiles.clj file. I did:

lein new noir my-website

(note the different syntax)

Then:

cd my-website
lein run

and on http://localhost:8080 I see Noir is up and running... time to
start building some websites!
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Using clj-soap

2012-10-30 Thread Sean Corfield
FWIW, since I said I had made some progress in this thread, I
eventually gave up and went with raw Java SOAP API calls (Axis 1.x)
and Java classes generated by wsdl2java since I really only needed a
one-off solution. I stopped looking at clj-soap in late July...

Sean

On Tue, Oct 30, 2012 at 3:00 AM, diepeglo diepe...@gmail.com wrote:
 Is someone using clj-soap? I tried and it fails with the same error.

 On Friday, July 13, 2012 4:35:39 AM UTC+2, Sean Corfield wrote:

 On Thu, Jul 12, 2012 at 7:34 PM, Sean Corfield seanco...@gmail.com
 wrote:
  When I looked at (soap/client-proxy
  http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL;) it indicated there
  was no such method. I redefined weather with (client
  :GetCityWeatherByZIP 10001) and that gave a different error:

 There's a :GetCityForecastByZIP method but that gives the same
 multimethod error (for :ForecastReturn).

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Fail to run dynamic binding code with Clojure1.4

2012-10-30 Thread Sean Corfield
Yes, it's very unfortunate that Manning released Clojure in Action
without a final pass to make it Clojure 1.3 compatible. I talked to
them about it when they still had time to make changes but they
decided to go ahead and publish a book that is tightly wedded to
Clojure 1.2 after Clojure 1.3 had been released. I think it was a
disservice to both the author and the community :(

Sean

On Tue, Oct 30, 2012 at 6:36 PM, Andy Fingerhut
andy.finger...@gmail.com wrote:
 The code works as written in Clojure 1.2 and 1.2.1.

 It doesn't in 1.3 and later, unless you change the definition of twice to
 annotate that it is a dynamic var, like so:

 (defn ^:dynamic twice [x]
   (println original function)
   (* 2 x))

 With that change, it works in Clojure 1.3 and later.

 Andy

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Fail to run dynamic binding code with Clojure1.4

2012-10-30 Thread Sean Corfield
On Tue, Oct 30, 2012 at 8:38 PM, Satoru Logic satorulo...@gmail.com wrote:
 Could you please recommend a book that's more up-to-date?

Clojure Programming http://www.clojurebook.com/ would be my first choice.

Programming Clojure 2nd Edition
http://pragprog.com/book/shcloj2/programming-clojure would be my
second choice.

The Joy of Clojure http://manning.com/fogus/ is an older book but is
more high-level - the why of functional programming - so it's still
applicable to more recent Clojure versions, but definitely a book for
when you have more Clojure under your belt.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: conversion problems using (count @someatom)

2012-10-29 Thread Sean Corfield
Your last argument is not a sequence - remove the apply.

(and you probably want to remove the conj [] on the free memory call?)

On Mon, Oct 29, 2012 at 9:21 AM, larry google groups
lawrencecloj...@gmail.com wrote:
 Now Ihave this and I get errors:

 (defn show-stats-regarding-resources-used-by-this-app [request]
   (response (apply str Memory in use (percentage/used/max-heap): 
 (who/memory-usage)   CPU usage (how-many-cpu's/load-average):  
 (who/cpu-load-usage)   free memory in jvm:  (conj []
 (who/free-memory-in-jvm))   How many people are logged in:  (str (count
 @registry)

 I get:

 2012-10-29 12:15:02.045:WARN:oejs.AbstractHttpConnection:/show-resources
 java.lang.IllegalArgumentException: Don't know how to create ISeq from:
 java.lang.Long

 I tried this with and without the str. What is wrong with this?

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN: data.json 0.2.0

2012-10-25 Thread Sean Corfield
On Thu, Oct 25, 2012 at 8:08 AM, Stuart Sierra
the.stuart.sie...@gmail.com wrote:
 I certainly did not anticipate this release causing significant problems for
 application or library developers, and if it did then I apologize.

The biggest problem is transitive dependency conflicts (as I had with
congomongo) because this is a very low-level library that is fairly
widely used. I agree with nearly all of your reasons for updating the
API but maintaining the former API as deprecated would have allowed
both application developers and other library maintainers to move at
their own pace instead of forcing lockstep upgrades on whole chains of
libraries. Deprecated in 0.2.0 and removed in 0.3.0 might have been
more appropriate.

 However, I will stand by the decision to update the API. data.json 0.1.x
 suffered from what I consider, in retrospect, to be poor design decisions.

Agreed.

   - Converting field names to keywords by default can create invalid
 keywords.

This was the change that caused me the most work since I needed to
update all call sites in different ways depending on what the code
needed - and then spend a bunch of time carefully testing that I had
restored the correct behavior. Yes, the previous behavior could be
problematic but switching the default behavior of an API is very
disruptive. Since this wasn't mentioned in your highlights, nor in
your Change Log, the first I knew of it was when a huge number of my
unit tests failed in mysterious ways :(

   - Keywordization is controlled by a bare boolean argument with little
 indication of its function.

Agreed this was ugly. Having now restored my code's correct
functionality, I like the flexibility of the :key-fn approach.

   - Inconsistent styles of optional arguments: read-json and write-json take
 booleans as bare arguments, json-str and print-json use keyword-value pairs.

Agreed.

   - Parsing a string and parsing from a stream -- two very different
 operations -- are conflated in a single function.

Agreed.

   - Functions are not consistently named: json-str, read-json, write-json

Agreed.

   - Function names repeat the name of the library, rather than using
 namespaces.

Agreed.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: thinking in data, polymorphism, etc.

2012-10-25 Thread Sean Corfield
On Thu, Oct 25, 2012 at 8:59 AM, Brian Craft craft.br...@gmail.com wrote:
 I have a fairly common scenario where I have a set of operations that need
 to work on two types of data (not data types in the clojure sense) that
 have different internal structure (i.e. maps with different keys). I could
 write a generic function that operates on both types of map. That would
 require implementing getters for each type (not sure where those would
 live).

Jim touched on this - you could have functions that map the two
different input data structures to a common form that the function
needs (assuming the call sites know which structure is which). But as
Brandon said, if you can give a more specific example...?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: compile fails but stack trace does not mention a line of code in my app

2012-10-25 Thread Sean Corfield
On Thu, Oct 25, 2012 at 11:36 AM, larry google groups
lawrencecloj...@gmail.com wrote:
 I am finding the following stack trace unusually devoid of information. My
 app is Clojure 1.3. I run lein compile and I get the following stack
 trace. Am I blind, or does this stack trace fail to tell me what line I
 should look at?

lein compile is not very helpful in terms of debugging syntax errors.
Working with source code in the REPL is sometimes easier to debug
(sometimes!).

My guess would be a syntax error in your (ns ...) declaration tho'...
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: what is the modern equivalent of clojure.contrib.java-utils/file?

2012-10-25 Thread Sean Corfield
On Thu, Oct 25, 2012 at 11:39 AM, larry google groups
lawrencecloj...@gmail.com wrote:
 How do you know this? Where is this documented? I find myself baffled as to
 what is a dependency and what is not.

http://clojure.github.com

If it's listed separated there, it's a contrib you need to pull in
explicitly. Otherwise it's part of Clojure itself.

Clojure's namespaces are documented here (linked from 'clojure' in the
left column of the above page):

http://clojure.github.com/clojure/
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN: data.json 0.2.0

2012-10-25 Thread Sean Corfield
Thanx Stuart! That looks great, at a glance.

On Thu, Oct 25, 2012 at 1:25 PM, Stuart Sierra
the.stuart.sie...@gmail.com wrote:
 I'm sorry for causing people extra work. How's this for a solution:

 https://github.com/clojure/data.json/commit/6ee71009946731d89ef8f98e7b659fa82443b6a2

 This allows the 0.2.x code to pass all the tests for data.json 0.1.3.

 I can't retract the 0.2.0 release, but if I push this out as 0.2.1 the
 compatibility issues should be at a minimum.

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: what is the modern equivalent of clojure.contrib.java-utils/file?

2012-10-25 Thread Sean Corfield
On Thu, Oct 25, 2012 at 12:52 PM, larry google groups
lawrencecloj...@gmail.com wrote:
 Okay, if I look here:

 http://clojure.github.com

 Can I assume that anything that starts with clojure.core is not a
 dependency? And everything else is?

No, some clojure.core.* namespaces are contribs (and need a
project.clj dependency), some are built-in. Per my original email:

 On Thursday, October 25, 2012 2:57:26 PM UTC-4, Sean Corfield wrote:
 http://clojure.github.com

 If it's listed separated there, it's a contrib you need to pull in
 explicitly. Otherwise it's part of Clojure itself.

Everything listed in the left hand column is a contrib that you need
to pull in (as a dependency) in your project.clj, including:

core.cache
core.incubator
core.match
core.memoize
core.unify

(and core.logic which is, for some reason, missing from that list)

 Clojure's namespaces are documented here (linked from 'clojure' in the
 left column of the above page):

 http://clojure.github.com/clojure/

Anything listed in the left hand column here is built-in (also listed
under Table of Contents on the right), no dependency needed (other
than Clojure itself), you just need to :require it in your namespace.

Finding clojure.core.protocols is a little harder, since it's a
sub-namespace of clojure.core so you'll find it here:

http://clojure.github.com/clojure/clojure.core-api.html

Specifically:

http://clojure.github.com/clojure/clojure.core-api.html#clojure.core.protocols

You might find the Clojure Atlas helpful for navigating the built-in
Clojure namespaces and functions:

http://www.clojureatlas.com/

It's a bit of a sprawling universe of namespaces and can be a bit
daunting when you first start working in Clojure but you soon get used
to the layout (honest!).

Hope that helps?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: (if (io/file path-to-session-file) -- returns false though file exists

2012-10-25 Thread Sean Corfield
On Thu, Oct 25, 2012 at 3:21 PM, larry google groups
lawrencecloj...@gmail.com wrote:
 I look here and see that the old monolithic Clojure contrib had an exists
 function:

 http://clojuredocs.org/clojure_contrib/clojure.contrib.java-utils/file

 I see this example:

 (. (clojure.contrib.java-utils/file ...) exists)

 I'd like to  do that but I don't know how with the modern clojure.java.io.

That's a Java method invocation, equivalent to (.exists (io/file
...)) with your io alias.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: when to be lazy

2012-10-23 Thread Sean Corfield
On Tue, Oct 23, 2012 at 11:38 AM, Brian Craft craft.br...@gmail.com wrote:
 Is a lazy seq mostly about algorithmic clarity, and avoiding unnecessary
 computation? So far I haven't run into any cases where I wouldn't realize
 the entire sequence, and it's always faster to do it up-front.

Here's a real world example or two from World Singles (where I work):

Search engine results

We use a search engine that returns pages of results. We provide the
criteria, page number and page size, and get back that page of
results from the overall result set. We have a process that looks thru
search results and discards matches a member has already seen recently
and various other filters. It would be messy to have to write all of
that paging logic into the filtering logic so we have a
lazy-search-results function that hides the paging and turns the
result set into a flat, lazy sequence. That's the only place that has
to deal with paging complexity. The rest of the algorithm is much,
much simpler since it can now operate on a plain ol' Clojure sequence
of search results. Huge win for simplicity.

Emailing matches to members daily

We have millions of members. We have a process that scours the
database for members who haven't had an email from us recently, which
then looks for different types of matches for them (related to the
process above). After each period of 24 hours, the process restarts
from the beginning. We use a lazy sequence around fetching suitable
members from the database that automatically gets a sentinel inserted
24 hours after we started that period's search. As above, the process
now simply just processes a sequence until it hits the sentinel (it's
actually interleaving about fifty sequences and having the sentinel
dynamically inserted in each sequence makes the code simpler than just
hitting the 'end' of a sequence - we tried that first). The number of
members processed in 24 hours depends on how many matches we find, how
far thru each result set we have to look to find matches and so on.
Lazy sequences make this much simpler (and much less memory intensive
since we don't have to hold the entire sequence in memory in order to
process it).

Updating the search engine

We also have a process that watches the database for member profile
changes and transforms profile data into XML and posts it to the
search engine, to keep results fresh. Again, a lazy sequence is used
to allow us to continually process the 'sequence' of changes from the
database and handle 'millions' of profiles in a (relatively) fixed
amount of memory.

So, yes, we are constantly processes sequences that either wouldn't
fit in memory fully realized or are actually infinite. Is the
processing slower than the procedural equivalent of loops and tests?
Quite probably. Is the memory usage better than realizing entire
chunks of sequences? Oh yes, and not having to worry about tuning all
that is a big simplification. Is the code simpler than the procedural
equivalent? Hell, yeah!

Hope that helps?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


[ANN] congomongo 0.2.2 and 0.3.1 released

2012-10-23 Thread Sean Corfield
Today has been a busy day in the world of CongoMongo with four(!) releases...

The 0.2.x branch is now in maintenance, supporting Clojure 1.2.x.
Release 0.3.0 onward only support Clojure 1.3.0 and later.

Only 0.2.1 and 0.3.0 were planned. MongoDB then announced a critical
bug fix in the Java driver (2.9.2 to replace 2.9.1 and 2.9.0) so there
were rather hurried 0.2.2 and 0.3.1 releases to incorporate that
critical fix:

Version 0.3.1 - October 23rd, 2012

* Update Java driver to 2.9.2 for CRITICAL update (#98)

Version 0.3.0 - October 23rd, 2012

* DROP SUPPORT FOR CLOJURE 1.2.1 AND EARLIER!
* Update clojure.data.json to 0.2.0 (#97)
* Update clojure.core.incubator to 0.1.2

Version 0.2.2 - October 23rd, 2012 - last release to support Clojure 1.2.x!

* Update Java driver to 2.9.2 for CRITICAL update (#98)

Version 0.2.1 - October 23rd, 2012

* Support insertion of sets (#94, #95)
* Declare MongoDB service for Travis CI (#96)

The change to clojure.data.json 0.2.0 in 0.3.0 was the catalyst for
dropping support for Clojure 1.2.x since it is only compatible with
Clojure 1.3.0 and later. The CongoMongo 0.2.x branch will continue to
get maintenance fixes for Clojure 1.2.x users but master (0.3.0 and
later) will continue to get new features.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Understanding clojure.core.cache TTL cache

2012-10-22 Thread Sean Corfield
On Mon, Oct 22, 2012 at 12:05 PM, Michael Fogus mefo...@gmail.com wrote:
 First, thanks for trying c.c.cache! The answer to your question is
 that the TTL cache implementation is non-destructive.  The `evict`
 call returns the cache without the element, but does not remove it
 from the original cache.

In other words you need something like this:

(def c3 (atom (cache/ttl-cache-factory {:a 1} :ttl 2)))
user= @c3
{:a 1}
user= (cache/has? @c3 :a)
true
user= (cache/has? @c3 :a)
false
user= @c3
{:a 1}
user= (swap! c3 cache/evict :a)
{}
user= @c3
{}

-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Understanding clojure.core.cache TTL cache

2012-10-22 Thread Sean Corfield
On Mon, Oct 22, 2012 at 1:50 PM, Hussein B. hubaghd...@gmail.com wrote:
 c3 holds a map containing {:a 1} that will lives for two minutes.

In the code I provided, c3 is an atom that holds a cache (which is the map).

 After two minutes, requesting :a is generating false since it reached its
 TTL but it will still live in map until it is removed explicitly by invoking
 evict.

Because the cache itself is immutable. That's why you need to store
the cache in an atom (so the atom can be updated to contain the
modified cache):

(defn hit-or-miss
  Given an atom containing a cache, a key, and a value, update the
cache and return...
  [a k v]
  (if (cache/has? @a k)
(cache/hit @a k)
(cache/miss @a k v)))

... (swap! c3 hit-or-miss :c 42) ...

 On Monday, October 22, 2012 11:15:06 PM UTC+3, Sean Corfield wrote:
 In other words you need something like this:

 (def c3 (atom (cache/ttl-cache-factory {:a 1} :ttl 2)))
 user= @c3
 {:a 1}
 user= (cache/has? @c3 :a)
 true
 user= (cache/has? @c3 :a)
 false
 user= @c3
 {:a 1}
 user= (swap! c3 cache/evict :a)
 {}
 user= @c3
 {}

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Understanding clojure.core.cache TTL cache

2012-10-22 Thread Sean Corfield
Just to clarify, hit does nothing for TTL (since items timeout based
solely on when they were added, not when they were last touched), so
swap! on the hit really makes no difference here. It would, however,
be required for some of the other types of cache.

Also, exactly how you use has? / hit / miss is going to depend on how
you're interacting with the cache and what behavior you want.

For example, at World Singles, we use TTL caches and have three operations:
* evict - this uses swap! and cache/evict to remove a cache entry
* fetch - this uses get to return an entry if present
* store - this uses swap! and cache/miss to add/update a cache entry

Since hit doesn't do anything on a TTL cache, we don't bother calling
it. If we switch to other types of cache, our fetch operation would
need to be updated to use cache/has?, swap! and cache/hit (as well as
get), or we'd need to change our API somewhat...

It's my understanding that you can use assoc / dissoc on a cache as
synonyms for miss / evict (that seemed to be true with the version of
core.cache that I initially used - I'm fairly confident it's still
true of assoc but not so confident that dissoc still works that way...
maybe Fogus can help me out there?).

Sean

On Mon, Oct 22, 2012 at 2:31 PM, Sean Corfield seancorfi...@gmail.com wrote:
 On Mon, Oct 22, 2012 at 1:50 PM, Hussein B. hubaghd...@gmail.com wrote:
 c3 holds a map containing {:a 1} that will lives for two minutes.

 In the code I provided, c3 is an atom that holds a cache (which is the map).

 After two minutes, requesting :a is generating false since it reached its
 TTL but it will still live in map until it is removed explicitly by invoking
 evict.

 Because the cache itself is immutable. That's why you need to store
 the cache in an atom (so the atom can be updated to contain the
 modified cache):

 (defn hit-or-miss
   Given an atom containing a cache, a key, and a value, update the
 cache and return...
   [a k v]
   (if (cache/has? @a k)
 (cache/hit @a k)
 (cache/miss @a k v)))

 ... (swap! c3 hit-or-miss :c 42) ...

 On Monday, October 22, 2012 11:15:06 PM UTC+3, Sean Corfield wrote:
 In other words you need something like this:

 (def c3 (atom (cache/ttl-cache-factory {:a 1} :ttl 2)))
 user= @c3
 {:a 1}
 user= (cache/has? @c3 :a)
 true
 user= (cache/has? @c3 :a)
 false
 user= @c3
 {:a 1}
 user= (swap! c3 cache/evict :a)
 {}
 user= @c3
 {}



-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Understanding clojure.core.cache TTL cache

2012-10-22 Thread Sean Corfield
On Mon, Oct 22, 2012 at 3:08 PM, Hussein B. hubaghd...@gmail.com wrote:
 I tried this:

 (defn hit-or-miss
   [a k v]
   (if (c/has? @a k)
 (c/hit @a k)
 (c/miss @a k v)))

My bad... got a bit carried away with the derefs based on code I was
playing around with in the REPL. Try this:

(defn hit-or-miss
  [c k v]
  (if (c/has? c k)
(c/hit c k)
(c/miss c k v)))

(swap! acu hit-or-miss :e 55)

That will update the atom to hold the new cache with {:e 55}.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Understanding clojure.core.cache TTL cache

2012-10-22 Thread Sean Corfield
On Mon, Oct 22, 2012 at 3:30 PM, Hussein B. hubaghd...@gmail.com wrote:
 So we need to call evict explicitly if we want to remove an entry? no
 automatic deletion after expiring?

The cache is immutable.

When you call hit / miss, you get a new instance of the cache with the
expired entries removed, and the hit entry updated (if appropriate) or
the miss entry added.

That new instance needs to be stored somewhere (or passed to future
code execution).

Entries will be automatically deleted after expiring in any new
instance of the cache - returned by hit / miss.

You can see that here:

user= (swap! c3 hit-or-miss :a 1)
{:a 1}
user= (swap! c3 hit-or-miss :b 2)
{:a 1, :b 2}
user= (swap! c3 hit-or-miss :c 3)
{:c 3, :b 2}
user= (swap! c3 hit-or-miss :d 4)
{:c 3, :d 4}
user= (swap! c3 hit-or-miss :e 5)
{:c 3, :d 4, :e 5}

We add :a, then :b. By the time we add :c, :a has expired (and been
removed). By the time we add :d, :b has expired (and been removed).
Then we add :e before any more expiries. If I wait awhile and add a
new value for :a...

user= (swap! c3 hit-or-miss :a 6)
{:a 6}

...you'll see :c, :d and :e have expired.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Coming from Common Lisp to Clojure

2012-10-19 Thread Sean Corfield
On Thu, Oct 18, 2012 at 4:28 PM, Brian Craft craft.br...@gmail.com wrote:

 C is a C-language, and it seems a lot simpler than clojure to me. KR is
 about 200 pages. I expect you mean C++, Java, etc.


No, I think Clojure is a lot simpler than C. As for C++, I was on the
standards committee for eight years so I know C++ is a lot more complex
than C. I was peripherally involved with the C standards process before
that (I co-wrote one of the first ANSI-validated C implementations).


 Not meaning to start a language war, but my own experiences with C++ and
 Java have mostly convinced me that the added complexity in those languages
 don't lead to better code: quite the opposite.


Happy to agree with you there. I look back at several things I was involved
with in the design of C++ and hang my head in shame, a little :)


 So far it's all been good, except for when I have to muck with java stuff.
 ;)


Cool. Hopefully the longer you spend with Clojure, the more you'll grow to
love it...
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ANN: cljs-info 1.0.0 Help and reflection facilities for ClojureScript

2012-10-19 Thread Sean Corfield
Frank demo'd a lot of this to the Bay Area Clojure Meetup tonight and it is
very cool stuff that makes development with ClojureScript a lot more
interactive and natural. Great work!

On Thu, Oct 18, 2012 at 12:28 AM, Frank Siebenlist 
frank.siebenl...@gmail.com wrote:

 cljs-info is a collection of Clojure-functions to provide basic help and
 reflection facilities for ClojureScript.

 Some of the functions provided are:

 cljs-doc, cljs-doc*, cljs-find-doc, cljs-apropos, cljs-source

 cljs-ns-map, cljs-ns-publics, cljs-ns-refers, cljs-ns-aliases,
 cljs-ns-privates,
 cljs-ns-interns, cljs-ns-resolve, cljs-all-ns, cljs-find-ns,
 cljs-the-ns

 cljs-repl, js-repl

 Note that all those fns run on the clojure side of the fence and are not
 cljs-functions!
 I've tried to explain why in the README. In short, clojurescript
 development is a somewhat schizophrenic process dealing with the
 split-personality of your clojurescript's virtual-world(s)… ;-).

 For details see: https://github.com/franks42/cljs-info;

 The README has more info about install, usage, and the what, where and how.

 Suggestions  comments are very welcome - This is version 1.0 and a work
 in progress.

 Enjoy, FrankS.



-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: I can get this if() clause to ever be true

2012-10-19 Thread Sean Corfield
On Fri, Oct 19, 2012 at 12:10 AM, larry google groups 
lawrencecloj...@gmail.com wrote:

 (defn add-to-logged-in-registry [this-users-params]
   (let [right-now (. (Date.) getTime)
 new-user-entry (conj this-users-params { updated right-now })]
 (if (:username new-user-entry)
   (swap! registry assoc (:username new-user-entry) new-user-entry

 The if statement seems to never be true.


conj produces a sequence, not a map, so the lookup of :username fails. Try
new-user-entry (assoc this-users-params updated right-now)
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: I can get this if() clause to ever be true

2012-10-19 Thread Sean Corfield
On Fri, Oct 19, 2012 at 12:53 AM, Kevin Downey redc...@gmail.com wrote:

 conj can surely produce maps, and does so happily in the following cases:


Doh! Of course. Thank you for the correction. I assumed that was his
problem without actually trying it - my bad :(
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ANN: data.json 0.2.0

2012-10-19 Thread Sean Corfield
Removing the old API causes problems for projects that have transitive
dependencies on multiple versions of c.d.json.

For example, congomongo depends on c.d.json 0.1.3, specifically on
json-str. At World Singles we depend on c.d.json directly and we depend on
congomongo. We can't move to c.d.json 0.2.0 because that breaks congomongo
(json-str no longer available).

I can update congomongo to c.d.json 0.2.0 of course but then anything that
depends on congomongo and c.d.json will be forced to update to c.d.json
0.2.0 as well, if they want an updated congomongo.

Just bringing this up as a general issue for discussion around breaking API
changes in low-level libraries that many things may depend on.

(FWIW, I'm probably going to update congomongo to use c.d.json 0.2.0 and
bump it's version number to indicate a breaking change, then update World
Singles dependency on both congomongo and c.d.json).

On Fri, Oct 19, 2012 at 12:03 PM, Stuart Sierra the.stuart.sie...@gmail.com
 wrote:

 https://github.com/clojure/data.json

 Highlights:
 - New API
 - Customizable type conversion functions
 - big int and big decimal support
 - Performance improvements



-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: code design in clojure

2012-10-18 Thread Sean Corfield
Which books on Clojure have you read so far?

On Wed, Oct 17, 2012 at 8:51 PM, Brian Craft craft.br...@gmail.com wrote:

 I'm finding the books on clojure to be very focused on low-level language
 features. Are there any good references for how to design code in clojure
 (or perhaps in functional languages more generally)? For example, knowing
 when to use a data type or a protocol, knowing when and how to separate
 purely functional code from code with side effects, making use of monads,
 queues, and the other forms that one hears about in the forums, etc.


-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: why is get not giving me a default value?

2012-10-18 Thread Sean Corfield
I tried your code and got the expected result:

user (def registry (atom {}))
#'user/registry
user (import 'java.util.Date)
java.util.Date
user   (defn add-to-logged-in-registry [this-users-params]
  (let [right-now (. (Date.) getTime)
new-user-entry (conj this-users-params { updated right-now })]
(swap! registry (fn [map-of-user-maps]
 (conj map-of-user-maps {:hi new-user-entry})
#'user/add-to-logged-in-registry
user (add-to-logged-in-registry {:a 1 :b 2})
{:hi {updated 1350573599595, :a 1, :b 2}}
user

On Thu, Oct 18, 2012 at 8:16 AM, larry google groups 
lawrencecloj...@gmail.com wrote:

 Okay, this is very confusing to me. If I try this:

   (defn add-to-logged-in-registry [this-users-params]

   (let [right-now (. (Date.) getTime)
 new-user-entry (conj this-users-params { updated right-now })]
 (swap! registry (fn [map-of-user-maps]
  (conj map-of-user-maps {:hi new-user-entry})

 and then at the REPL I:

 who-is-logged-in.core @registry
 {nil {:last_name 777ch, :image in.jpg, :username ch,
 :first_name 7alle, updated 1350573104214}}

 Here I am hard-coding a key called :hi and yet in the registry I still
 see the top level key as nil. What happened to the :hi? I was expecting:


 {:hi {:last_name 777ch, :image in.jpg, :username ch,
 :first_name 7alle, updated 1350573104214}}


 What am I not understanding?





-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: why is get not giving me a default value?

2012-10-18 Thread Sean Corfield
On Thu, Oct 18, 2012 at 8:26 AM, larry google groups 
lawrencecloj...@gmail.com wrote:

 Interesting. I am using Clojure 1.3. And I'm using clojure-jack-in inside
 of emacs. What are you using?


I was using Clojure 1.4 via jack-in from emacs. I just tried it again with
lein repl in a clean Clojure 1.3 project and it works fine there too:

nREPL server started on port 55907
REPL-y 0.1.0-beta10
Clojure 1.3.0
...
user=  (def registry (atom {}))
#'user/registry
user=  (import 'java.util.Date)
java.util.Date
user=  (defn add-to-logged-in-registry [this-users-params]
  #_=   (let [right-now (. (Date.) getTime)
  #_= new-user-entry (conj this-users-params { updated right-now
})]
  #_= (swap! registry (fn [map-of-user-maps]
  #_=  (conj map-of-user-maps {:hi new-user-entry})
#'user/add-to-logged-in-registry
user=  (add-to-logged-in-registry {:a 1 :b 2})
{:hi {updated 1350579386193, :a 1, :b 2}}
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: code design in clojure

2012-10-18 Thread Sean Corfield
On Thu, Oct 18, 2012 at 8:58 AM, Brian Craft craft.br...@gmail.com wrote:

 Clojure Programming, and The Joy of ...


Hmm, I was going to suggest Joy of but if you don't think that helps with
some of those design issues, I'm not sure what to suggest. Others suggested
Clojure Programming but, again, if that doesn't help...

At this point I'd certainly be interested in hearing suggestions from other
people beyond those two books...?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Coming from Common Lisp to Clojure

2012-10-18 Thread Sean Corfield
On Thu, Oct 18, 2012 at 9:37 AM, Brian Craft craft.br...@gmail.com wrote:

 I suspect that if you come from java or C++ it seems like a simple
 language, but it feels pretty cluttered compared to other languages.


Interesting observation and probably true. Although I did Lisp back at
university (in the early/mid-80's), most of my career has been in C-family
languages so, yes, Clojure feels like a VERY simple language with almost no
syntax. Having recently read more Scheme / CL code, I can see how folks
coming from those languages think Clojure is cluttered. But it's SO much
simpler than the C-languages that it must surely be only a little more
cluttered than Scheme / CL? Do the differences really seem that big?
Genuine question, since I've been immersed in C-languages for so long...
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

ANN CongoMongo 0.2.0

2012-10-14 Thread Sean Corfield
I meant to post this a few days ago...

CongoMongo, a Clojure wrapper for MongoDB, just released version 0.2.0 to
Clojars:

Version 0.2.0 - October 10th, 2012:

   - Added URL / license / mailing list information to project.clj so it
   will show up in Clojars and provide a better user experience
   - Allow make-connection to accept symbols again (#80, fixes issue
   introduced in #79)
   - Prevent fetch one / sort being used together (#81)
   - Remove :force option from add-index! since it is no longer effective
   (#82, #83)
   - Add :sparse option to add-index! (#84)
   - Upgrade to 2.9.1 Java driver (#85, #89)
   - Upgrade project to use Clojure 1.4.0 as base version (#86, #88)
   - Upgrade project to use Leiningen 2 (#87)
   - Add aggregate function to leverage MongoDB 2.2 aggregation framework
   (#90)

The bump in the version number (from 0.1.10) signals compatibility with
MongoDB 2.2, the update to the 2.9.x Java driver and the inclusion of an
aggregate function that provides basic support for the new aggregation
framework in MongoDB 2.2:


aggregation (requires mongodb 2.2)

(aggregate
  :expenses
  {:$match {:type airfare}}
  {:$project {:department 1, :amount 1}}
  {:$group {:_id $department, :average {:$avg $amount}}})
= {:serverUsed ..., :result [{:_id ... :average ...} {:_id ...
:average ...} ...], :ok 1.0}

This pipeline of operations selects expenses with type = 'airfare', passes
just the department and amount fields thru, and groups by department with
an average for each.

Based on 10gen's Java Driver example of
aggregationhttp://www.mongodb.org/display/DOCS/Using+The+Aggregation+Framework+with+The+Java+Driver
.

The aggregate function accepts any number of pipeline operations.

-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: trying to read table write file

2012-10-11 Thread Sean Corfield
On Wed, Oct 10, 2012 at 9:43 PM, Brian Craft craft.br...@gmail.com wrote:

 and I get Insufficient bytes to decode frame from gloss. I didn't expect
 an error reading the table. What am I doing wrong?


Source for read-table?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: trying to read table write file

2012-10-11 Thread Sean Corfield
On Thu, Oct 11, 2012 at 10:38 AM, Brian Craft craft.br...@gmail.com wrote:

 Never mind, I found it. ;)  Been up too long, apparently.


Please share - I'm curious now!
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: trying to read table write file

2012-10-11 Thread Sean Corfield
On Thu, Oct 11, 2012 at 5:57 PM, Brian Craft craft.br...@gmail.com wrote:

 Geez, you want me to share my brain failures? ;-p In my defense, I was up
 half the night taking care of sick progeny.


I just wondered if whether it was the sort of problem that others might run
into and sharing it might help them... but apparently not :)

Glad it's all working now.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: pattern for coalescing similar adjacent items in list

2012-10-10 Thread Sean Corfield
partition-by will probably get you started - turning (a1 a2 a3 b1 b2 c1 c2
c3 c4) into ((a1 a2 a3) (b1 b2) (c1 c2 c3 c4)) - then map some function
over that?

On Wed, Oct 10, 2012 at 5:22 PM, Brian Craft craft.br...@gmail.com wrote:

 I have a long list (or seq? result of calling map) something like (a1 a2
 a3 b1 b2 c1 c2 c3 c4)

 I need to replace adjacent items with related attributes with single
 elements, like

 (a b c)

 where 'a' is derived from a1 a2 a3, and so-forth.

 So, again, I'm not sure how to approach this in a functional way. Anyone
 have a suggestion?



-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: understanding 'binding' use in clojure.java.jdbc

2012-10-09 Thread Sean Corfield
No, the inner with-connection binds *db* to db1 so db2 is no longer
accessible.

This is why c.j.jdbc is getting an API overall that will expose functions
that accept the connection or the db-spec directly (and the old API will be
rewritten in terms of the new one for compatibility).

Sean

On Tue, Oct 9, 2012 at 2:44 PM, gaz jones gareth.e.jo...@gmail.com wrote:

 Can you not simply:

 (jdbc/with-connection db2
 (jdbc/with-query-results results
   query
   {:result-type :forward-only
:fetch-size 1000}
   (jdbc/with-connection db1
  ;; read and write?
)))

 ?


-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: understanding 'binding' use in clojure.java.jdbc

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 12:53 PM, Brian Craft craft.br...@gmail.com wrote:

 On Tuesday, October 9, 2012 12:11:28 PM UTC-7, Tassilo Horn wrote:

 Yes, that's true.  Maybe Korma [1] is better suited for this kind of
 operation.

 Thanks for the link to korma.


Korma is built on c.j.jdbc and may suffer from the same issues...?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 7:38 PM, Brian Craft craft.br...@gmail.com wrote:

 I need some basic math functions, e.g. floor. I see there are some in
 contrib, but I'm unable to figure out the status of contrib. Seems like
 it's deprecated, or in transition, or something?


Back with Clojure 1.3, the old monolithic contrib was deprecated and broken
up into separate modules, per:

http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

What would help us is knowing what path you took in looking for information
about the math functions that led you to old contrib... so we can make
adjustments to what documentation is out there to make the new structure
easier to find and understand?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 9:03 PM, kovas boguta kovas.bog...@gmail.com wrote:

 Most of the time you are using the contrib for some convenience
 function. Its way easier to just copy that function into your own
 project, than to worry about tracking down the new library, and then
 checking that the function in question is exactly the same as before.


That might be true for the old pieces which were not migrated but certainly
isn't true for things like c.c.sql (now c.j.jdbc) and things like
core.logic etc. And of course, if they really were just a few convenience
functions, that speaks to why they didn't get migrated as-is.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 9:22 PM, Brian Craft craft.br...@gmail.com wrote:

 Top hits on google. clojure math floor, top three hits are contrib docs.


Thanx. I Googled that phrased and the first result was the old richhickey
repo. We should be able to get that fixed - or at least a notice added
linking to the new contrib. The second result was the new contrib so that's
OK. The third and fourth results were to ClojureDocs... which needs an
update :(

Who owns ClojureDocs? Can we get more bodies involved to help keep that
updated?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 9:23 PM, kovas boguta kovas.bog...@gmail.com wrote:

 The one that bit me specifically was clojure.contrib.string =
 clojure.string . Not criticising the new design, its just a fact that
 its not backwards compatible.


I believe that happened in Clojure 1.2, even before monolithic contrib was
broken up...

c.c.string is not listed here:

http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

so the caveat applies: If a clojure.contrib namespace is not listed here,
it is most likely an old namespace that was either migrated somewhere else
or deprecated as part of Clojure 1.2 (and c.c.string is explicitly called
out as an earlier migration).

You can't hold up c.c.string as an example of a problem with the break up
of old contrib since it predates that - so you're talking about a problem
going from Clojure 1.1 to 1.2?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: math

2012-10-09 Thread Sean Corfield
On Tue, Oct 9, 2012 at 9:43 PM, kovas boguta kovas.bog...@gmail.com wrote:

 Actually all the examples I had in mind where from 1.2 (I migrated
 from 1.1 so it all seemed part of a piece to me)


I think the migration from 1.2 to 1.3 is better documented than the
migration from 1.1 to 1.2...


 So should we expect the function and their signatures to be the same then?


Unfortunately that predates my involvement with Clojure so I can't comment.
I'm doing what I can to document what I know around contrib migration but I
started with early builds of 1.3 and helped with the migration of several
old contribs to the new setup. I'd be happy to see specific suggestions -
or edits - for the wiki page to make it easier to migrate from earlier
versions.

Although I'll also point out that the vast majority of Clojure users over
the language's history will only experience 1.3 or later (probably 1.4 or
later) so it can suck to be an early adopter but in the grand scale of
things, early adopters are a minority :)
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure web framework

2012-09-29 Thread Sean Corfield
Clojure offers a lot of choice. Great for experienced developers, hard for
newbies. Pick something, run with it, contribute documentation to make it
better.

There have been several attempts to create the one true wiki and so far
they've all failed for lack of contributions from the folks who have the
most need (the folks who are already successful with the software don't
need the wiki and are generally too busy to contribute - and also don't
have the newbie's mindset so it's hard to write the right material at the
right level).

Definitely Clojure's Achilles heel...

Sean

On Friday, September 28, 2012, goracio wrote:

 lein new noir my-app
 cd my-app
 lein run

 Yes i already made pull request to update README file with this.

 Well there are many usefull libs for web development you can choose this
 and that combine them and get something.
 But from newbie perspective it's kind of a difficult question where to
 start from, what to use, what good practice is.
 What lib to use for persistance with Mysql, Postgre, for Mongo, is there
 alternative to Backbone here, how make site reactive, how to use ajax, is
 there MVC pattern or there is no any and so on.
 How can i test my app, what best libs for that and what best practices.
 How can i deploy my app, what tools i can use for that.
 What debbuging tools can i use.
 Is there any special IDE or plugin to existing IDE for fast and convinient
 web development. Simple case - lein can autoreload/autocompile code for
 ClojureScript but how about a project?

 So examples and good updated guides/online book does matter.
 There should be clear point about why Clojure and Clojure applied to web
 better then others, how it can solve problems better then others.

 How can i recommend others to use Clojure and how i answer the question
 So what about clojure is there any good framework to start with and what i
 can do with that ?
 I am not talking about absence of any guides and recommendations about web
 dev in Clojure there are couple good examples but they are outdated.

 And still if Noir is like Sinatra for not too big sites and projecst and
 Rails is like a pro maybe there should be something like a pro at Clojure.


 пятница, 28 сентября 2012 г., 19:37:05 UTC+4 пользователь Sean Corfield
 написал:

 The lein-noir plugin works with lein2 so you can just say:

 lein new noir my-app
 cd my-app
 lein run

 The webnoir.org website seems to provide reasonable documentation on
 getting started. If you have suggestions to improve the documentation, I'm
 sure Chris would be happy to receive them (I suspect the webnoir.org site
 is also a repo on github so you can send pull requests).

 I ported my web framework FW/1 from CFML to Clojure for my own use but
 feel free to check that out too. Again, the simple lein2 approach works:

 lein new fw1 my-app
 cd my-app
 lein run
 (or PORT=8123 lein run to use a different port)

 Documentation is minimal because it's deliberately a simple framework but
 there's an example app, also ported from the CFML version, and more docs on
 the CFML version's github repo - plus a fairly large user community for the
 CFML version :)

 I don't really thinks Rails-like frameworks fit with the Clojure way of
 thinking. As Chas said, we're more inclined to combine a number of
 libraries to help build an application than to use frameworks. FW/1 uses
 Ring and Enlive and provides just a thin convention-based veneer over those
 to achieve most of what the CFML version has offered for three years :)

 Sean

 On Friday, September 28, 2012, goracio wrote:

 Hi
 So i'd like to point to the problem here. Clojure web framework in google
 get these results, at least for me
 1. noir
 2. stackoverflow question 2008 year
 3. stackoverflow question 2010 year
 4. joodo ( outdated thing developed by one person)
 5. Compojure ( routing dsl)
 So there is no popular framework these days for clojure.
 Noir is mostly Chris Granger thing. As he make Lighttable today Noir
 developed by some other people ( or may be on person not sure). Main site
 instructions are nice but already outdated ( lein2). No news, no blog, no
 new features, no examples, no infrastructure. Lein new project, insert noir
 in dependencies and you don't have working app, you must add :main and
 stuff to work. What about testing ? no info, no structure, decide on your
 own.
 It's no secret that web development today is biggest and popular trend. If
 language and it's community have good web framework that language will gain
 more popularity.
 Take Ruby on rails it has over 30 core contributers, huuuge community,
 active development, industry standart web development framework. Good
 testing, development infrastracture, easy start, sprockets for js css
 managment and so on. Also it has some books about testing and framework
 itself which is good start point for newbies.
 I like Clojure, for simplicity mostly. It has amazing power and i believe
 it can be very good platform for web development.
 So

Re: Clojure web framework

2012-09-28 Thread Sean Corfield
The lein-noir plugin works with lein2 so you can just say:

lein new noir my-app
cd my-app
lein run

The webnoir.org website seems to provide reasonable documentation on
getting started. If you have suggestions to improve the documentation, I'm
sure Chris would be happy to receive them (I suspect the webnoir.org site
is also a repo on github so you can send pull requests).

I ported my web framework FW/1 from CFML to Clojure for my own use but feel
free to check that out too. Again, the simple lein2 approach works:

lein new fw1 my-app
cd my-app
lein run
(or PORT=8123 lein run to use a different port)

Documentation is minimal because it's deliberately a simple framework but
there's an example app, also ported from the CFML version, and more docs on
the CFML version's github repo - plus a fairly large user community for the
CFML version :)

I don't really thinks Rails-like frameworks fit with the Clojure way of
thinking. As Chas said, we're more inclined to combine a number of
libraries to help build an application than to use frameworks. FW/1 uses
Ring and Enlive and provides just a thin convention-based veneer over those
to achieve most of what the CFML version has offered for three years :)

Sean

On Friday, September 28, 2012, goracio wrote:

 Hi
 So i'd like to point to the problem here. Clojure web framework in google
 get these results, at least for me
 1. noir
 2. stackoverflow question 2008 year
 3. stackoverflow question 2010 year
 4. joodo ( outdated thing developed by one person)
 5. Compojure ( routing dsl)
 So there is no popular framework these days for clojure.
 Noir is mostly Chris Granger thing. As he make Lighttable today Noir
 developed by some other people ( or may be on person not sure). Main site
 instructions are nice but already outdated ( lein2). No news, no blog, no
 new features, no examples, no infrastructure. Lein new project, insert noir
 in dependencies and you don't have working app, you must add :main and
 stuff to work. What about testing ? no info, no structure, decide on your
 own.
 It's no secret that web development today is biggest and popular trend. If
 language and it's community have good web framework that language will gain
 more popularity.
 Take Ruby on rails it has over 30 core contributers, huuuge community,
 active development, industry standart web development framework. Good
 testing, development infrastracture, easy start, sprockets for js css
 managment and so on. Also it has some books about testing and framework
 itself which is good start point for newbies.
 I like Clojure, for simplicity mostly. It has amazing power and i believe
 it can be very good platform for web development.
 So what i suggest :
 Take 1 platform for web development in Clojure (for example noir as most
 mature framework) .
 Form working core group from 5-6 people.
 Decide about name of the project ( or take Noir)
 Make good site about it
 Make a plan for development ( what core features should have first version)
 Make first version
 Make couple good examples
 Make good documentation and maybe a book ( community book for example on
 github that will be online and updated frequently).
 --
 http://www.playframework.org/ good example what site could be
 Alternative to online book can be guides, as for ruby on rails
 http://guides.rubyonrails.org/index.html
 Another good news that there is nice web IDE for Clojure by Bodil Stokke
 https://github.com/bodil/catnip. Super easy install, very nice
 insterface, reactive interface ( no need for browser refresh, autorecompile
 when you save ) web based ! and under active development, just perfect
 place for newbies to start. So this project also can be added to Clojure
 Web framework project.
 Also we have ClojureScript so Clojure web framework would be perfect place
 where this thing can shine.
 Let's discuss.

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to 
 clojure@googlegroups.comjavascript:_e({}, 'cvml', 
 'clojure@googlegroups.com');
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'clojure%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en



-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this 

Re: instantiating a clojure record from Java

2012-09-18 Thread Sean Corfield
On Tue, Sep 18, 2012 at 11:04 AM, Jim - FooBar(); jimpil1...@gmail.comwrote:

 However i get again:  ClassNotFoundException Clondie24.games.chess.Player


That suggests the Clojure code isn't AOT compiled and/or isn't on your
class path?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: idiomatic use of iterate + cycle ?

2012-09-16 Thread Sean Corfield
On Sun, Sep 16, 2012 at 5:15 AM, Jim - FooBar(); jimpil1...@gmail.comwrote:

 It turns out that reduce is exactly what I need...I didn't know this but
 there is a handy 'reduced' fn that makes it easy to terminate from within a
 reduce at any given time. At least this is what i understand from the
 docs...so the final thing looks like this:


Wow, that is a super nice addition to 1.5 - I don't remember reading about
that anywhere but it went in back at the end of April:

https://github.com/clojure/clojure/commit/96e8596cfdd29a2bb245d958683ee5fc1353b87a
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure lazy-seq over Java iterative code

2012-09-14 Thread Sean Corfield
On Fri, Sep 14, 2012 at 8:37 AM, Dave Kincaid kincaid.d...@gmail.com wrote:
 I also posted this to StackOverflow, so sorry if you saw it there too. If
 you want some rep points over there you can answer there too
 (http://stackoverflow.com/questions/12427518/clojure-lazy-seq-over-java-iterative-code).

Looks like there's already a good answer over there.

 Of course when there are a lot of records I end up with a
 StackOverflowException.

Did you dig into where the StackOverflowException originated from? As
noted in a comment on SO, the lazy-seq can handle millions of items
without a problem so the problem isn't inherently with that part of
your code. Perhaps it's the parser or the processor?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


<    6   7   8   9   10   11   12   13   14   15   >