Re: ANN clj-time 0.8.0 is released

2014-07-28 Thread Andrey Antukh
Awesome!

Thanks!


2014-07-27 20:24 GMT+02:00 Michael Klishin :

> clj-time [1] is a popular Clojure date/time library built on top of Joda
> Time.
>
> Unfortunately, the project currently doesn't have a human-friendly change
> log,
> so here's a git one (sorry):
>
> https://github.com/clj-time/clj-time/compare/v0.7.0...v0.8.0
>
> 1. https://github.com/clj-time/clj-time/
> --
> @michaelklishin, github.com/michaelklishin
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Andrey Antukh - Андрей Антух -  / 
http://www.niwi.be 
https://github.com/niwibe

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Tools for cleaning namespaces?

2014-07-28 Thread Bertrand Dechoux
Hello,

I am trying to tidy up a project and I have two actions that could be 
somehow be automatized.

*1) Display the dependencies between the namespace of my project as a graph 
(text graph being good enough).*
One would want to break dependencies which do not make sense and sometimes 
to create indirection in order to lessen the impact of changes.

*2) Find out which dependencies are not required.*
Splitting a namespace might be quite easy (the complex part is on the 
consumer side) but often I find out that dependencies were not pruned 
correctly.
And so there are useless remaining dependencies that were not removed. 

I understand that a 100% bullet proof solution might be really hard to do.
But I was wondering, is there any tools that allows to do these tasks for 
common cases?

Regards

Bertrand Dechoux

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is still idiomatic the ant simulation code?

2014-07-28 Thread Yu Shen
What's the meaning of the following code:

 (([move #(turn % -1) #(turn % 1)]   (wrand [(if (:ant @ahead) 0 
(ranks ahead))   (ranks ahead-left) (ranks ahead-right)]))  
  loc)))


in https://www.refheap.com/paste/3099  from line 192 to 195?

Sorry to bother you, it's new to me, and it's really hard to Google, as the 
characteristic of the code is not well defined. I'm learning Clojure in 
ad-hoc manner, so I might not be aware some Clojure expression. Giving me 
some pointer to study further would be sufficient. 

By the context, it seems that it's trying to take a move.

Thanks a lot!

Yu

On Tuesday, June 12, 2012 7:19:22 PM UTC+8, Baishampayan Ghose wrote:
>
> >> While I agree that one could use a record in place of a struct, I 
> >> don't think structs are "obsolete", at least not officially. 
> >> 
> > 
> > From http://clojure.org/datatypes: 
> > 
> >>> Overall, records will be better than structmaps for all 
> >>> information-bearing purposes, and you should move such structmaps to 
> >>> defrecord. 
>
> In that case, defstruct, etc. should bear the same warning in 
> docstrings/metadata as well. 
>
> Regards, 
> BG 
>
> -- 
> Baishampayan Ghose 
> b.ghose at gmail.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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Leiningen profile problem

2014-07-28 Thread Paul Butcher
Oops - I originally sent this to the ClojureScript group, which probably wasn’t 
the best place. Apologies to those who subscribe to both lists for the spam:

I’m clearly misunderstanding something fundamental about how Leiningen profiles 
work. I’d appreciate help fixing my understanding.

I’m trying to create a Ring server that behaves differently when in production 
or development mode. I’ve checked a minimal cut-down version of my server into 
GitHub here:

https://github.com/paulbutcher/profile-problem

There are two different versions of config.clj. The production version looks 
like this:

(ns problem.config)
(def production true)

And the development version like this:

(ns problem.config)
(def production false)

The profiles section of project.clj adds the appropriate one of these to 
source-paths depending on which profile is active:

  :profiles {:production {:source-paths ["production/src"]}
 :dev {:source-paths ["dev/src"]}
 :uberjar [:production {:aot :all}]}

Finally, the server prints a message during startup:

(println "Starting in" (if config/production "production" "development") 
"mode"))

This all works fine - if I run “lein ring server-headless” or “lein 
with-profile dev server-headless”, I see “Starting in development mode” and if 
I run “lein with-profile production server-headless”, I see “Starting in 
production mode”.

So far so good.

The problem arises after I run “lein ring uberjar”. The uberjar works exactly 
as I would expect (it runs in production mode). But if I then run “lein ring 
server-headless” or “lein with-profile dev server-headless” in my project 
directory, instead of seeing “Starting in development mode”, I see “Starting in 
production mode”.

Running “lein clean” sorts the problem out, but I worry that I’m missing 
something fundamental that’s going to bite me at some point…

Thanks in advance...

--
paul.butcher->msgCount++

Silverstone, Brands Hatch, Donington Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
Skype: paulrabutcher

Author of Seven Concurrency Models in Seven Weeks: When Threads Unravel
http://pragprog.com/book/pb7con

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tools for cleaning namespaces?

2014-07-28 Thread Andy Fingerhut
You can try Eastwood's :unused-namespaces linter for #2.  It is disabled by
default, so you need to give an option on the command line to enable it.
If you want to try *only* that linter, and none of the other warnings,
first follow the simple install instructions in the README, then change to
the home dir of your project and type:

lein eastwood '{:linters [:unused-namespaces]}'

Eastwood will not currently help you with your request #1, but it would not
be difficult to add such a feature to it, since it determines dependencies
between namespaces already using tools.namespace.  There are other tools
that can do this for you, e.g. nephila [2] will create a graphics image of
your project's namespace dependencies, but you must have graphviz
installed.  I don't know of a similar tool that only creates text
dependency output.

Andy

[1] https://github.com/jonase/eastwood

[2] https://github.com/timmc/nephila


On Mon, Jul 28, 2014 at 4:58 AM, Bertrand Dechoux 
wrote:

> Hello,
>
> I am trying to tidy up a project and I have two actions that could be
> somehow be automatized.
>
> *1) Display the dependencies between the namespace of my project as a
> graph (text graph being good enough).*
> One would want to break dependencies which do not make sense and sometimes
> to create indirection in order to lessen the impact of changes.
>
> *2) Find out which dependencies are not required.*
> Splitting a namespace might be quite easy (the complex part is on the
> consumer side) but often I find out that dependencies were not pruned
> correctly.
> And so there are useless remaining dependencies that were not removed.
>
> I understand that a 100% bullet proof solution might be really hard to do.
> But I was wondering, is there any tools that allows to do these tasks for
> common cases?
>
> Regards
>
> Bertrand Dechoux
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] Clara 0.6.0

2014-07-28 Thread Alan Moore
Awesome - thanks for the update!

Does the storm example work with the new version?

Alan

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Leiningen profile problem

2014-07-28 Thread Thomas Heller
Your issue is probably due to AOT compilation, uberjar aot compiles 
everything and leaves alot of class files in your target directory (aka 
classpath). When you run your app afterwards the class file is used instead 
of the clj file since the .class file is "newer". When you run lein clean 
those .class files are removed and the classloader then looks for the clj 
file.

I'd recommend keeping a config file (can be EDN) and just having a 
development and production version instead of using different code. You can 
either use a command line argument to choose which config to load or use 
leinigen profiles and resource paths so only include the one you want.

HTH,
/thomas

On Monday, July 28, 2014 3:45:51 PM UTC+2, Paul Butcher wrote:
>
> Oops - I originally sent this to the ClojureScript group, which probably 
> wasn’t the best place. Apologies to those who subscribe to both lists for 
> the spam:
>
> I’m clearly misunderstanding something fundamental about how Leiningen 
> profiles work. I’d appreciate help fixing my understanding.
>
> I’m trying to create a Ring server that behaves differently when in 
> production or development mode. I’ve checked a minimal cut-down version of 
> my server into GitHub here:
>
> https://github.com/paulbutcher/profile-problem
>
> There are two different versions of config.clj. The production version 
> looks like this:
>
> (ns problem.config)
> (def production true)
>
> And the development version like this:
>
> (ns problem.config)
> (def production false)
>
> The profiles section of project.clj adds the appropriate one of these to 
> source-paths depending on which profile is active:
>
>   :profiles {:production {:source-paths ["production/src"]}
>  :dev {:source-paths ["dev/src"]}
>  :uberjar [:production {:aot :all}]}
>
> Finally, the server prints a message during startup:
>
> (println "Starting in" (if config/production "production" "development") 
> "mode"))
>
> This all works fine - if I run “lein ring server-headless” or “lein 
> with-profile dev server-headless”, I see “Starting in development mode” and 
> if I run “lein with-profile production server-headless”, I see “Starting in 
> production mode”.
>
> So far so good.
>
> The problem arises after I run “lein ring uberjar”. The uberjar works 
> exactly as I would expect (it runs in production mode). But if I then run 
> “lein ring server-headless” or “lein with-profile dev server-headless” in 
> my project directory, instead of seeing “Starting in development mode”, I 
> see “Starting in production mode”.
>
> Running “lein clean” sorts the problem out, but I worry that I’m missing 
> something fundamental that’s going to bite me at some point…
>
> Thanks in advance...
>
> --
> paul.butcher->msgCount++
>
> Silverstone, Brands Hatch, Donington Park...
> Who says I have a one track mind?
>
> http://www.paulbutcher.com/
> LinkedIn: http://www.linkedin.com/in/paulbutcher
> Skype: paulrabutcher
>
> Author of Seven Concurrency Models in Seven Weeks: When Threads Unravel
> http://pragprog.com/book/pb7con
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: subtle om + core.async problems

2014-07-28 Thread Dylan Butman
That looks great Dan!

here's a slightly different version that takes a supplied channel and kills 
the go on either component unmount or the supplied channel being closed 

(defmixin go-block-aware
  (init-state []
  {:chans {:mounted (async/chan)}})
  (will-unmount [owner]
(async/close! (om/get-state owner [:chans :mounted])))

  (go [owner read-chan callback]
  (let [mounted (om/get-state owner [:chan :mounted])]
(go-loop []
 (when-some [v (first (async/alts! [read-chan exit-chan]))]
   (callback v)
   (recur))

I've used something like this before with mult/tap

(defn create-mults [chans]
  {:chans chans
   :mults (zipmap (keys chans) (map mult (vals chans)))})

(defn get-shared-chan [owner key]
  (om/get-shared owner [:chans key]))

(defn tap-shared-chan
  ([owner key] (tap-shared-chan owner key (async/chan)))
  ([owner key ch]
 (tap (om/get-shared owner [:mults key]) ch)))

(om/root app-view app-state {:target (.getElementById js/document "app")
 :shared (create-mults {:nav (chan)
:events (chan)})})

and then in your component you could use something like what Dan suggests

(defcomponentk a-component [owner]
  (:mixins go-block-aware)
  (did-mount [_]
(.go owner (tap-shared-chan owner :nav) (fn [v] ...)))
  (render [_]
...))

I usually then submit tuples to the shared channels and then destructure

(fn [[action & args]
(case action
  :login (let [[id] args]
   (do-login id))])


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Leiningen profile problem

2014-07-28 Thread Paul Butcher
Ah! I thought that Leiningen put class files in different places for different 
profiles, but it looks like I was mistaken.

Thanks for the EDN hint - that sounds like a good way to go.

Cheers!

--
paul.butcher->msgCount++

Silverstone, Brands Hatch, Donington Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
Skype: paulrabutcher

Author of Seven Concurrency Models in Seven Weeks: When Threads Unravel
http://pragprog.com/book/pb7con

On 28 July 2014 at 18:01:16, Thomas Heller (th.hel...@gmail.com) wrote:

Your issue is probably due to AOT compilation, uberjar aot compiles everything 
and leaves alot of class files in your target directory (aka classpath). When 
you run your app afterwards the class file is used instead of the clj file 
since the .class file is "newer". When you run lein clean those .class files 
are removed and the classloader then looks for the clj file.

I'd recommend keeping a config file (can be EDN) and just having a development 
and production version instead of using different code. You can either use a 
command line argument to choose which config to load or use leinigen profiles 
and resource paths so only include the one you want.

HTH,
/thomas

On Monday, July 28, 2014 3:45:51 PM UTC+2, Paul Butcher wrote:
Oops - I originally sent this to the ClojureScript group, which probably wasn’t 
the best place. Apologies to those who subscribe to both lists for the spam:

I’m clearly misunderstanding something fundamental about how Leiningen profiles 
work. I’d appreciate help fixing my understanding.

I’m trying to create a Ring server that behaves differently when in production 
or development mode. I’ve checked a minimal cut-down version of my server into 
GitHub here:

https://github.com/paulbutcher/profile-problem

There are two different versions of config.clj. The production version looks 
like this:


(ns problem.config)
(def production true)

And the development version like this:


(ns problem.config)
(def production false)

The profiles section of project.clj adds the appropriate one of these to 
source-paths depending on which profile is active:


  :profiles {:production {:source-paths ["production/src"]}
 :dev {:source-paths ["dev/src"]}
 :uberjar [:production {:aot :all}]}

Finally, the server prints a message during startup:


(println "Starting
in" (if config/production "production" "development") "mode"))

This all works fine - if I run “lein ring server-headless” or “lein 
with-profile dev server-headless”, I see “Starting in development mode” and if 
I run “lein with-profile production server-headless”, I see “Starting in 
production mode”.

So far so good.

The problem arises after I run “lein ring uberjar”. The uberjar works exactly 
as I would expect (it runs in production mode). But if I then run “lein ring 
server-headless” or “lein with-profile dev server-headless” in my project 
directory, instead of seeing “Starting in development mode”, I see “Starting in 
production mode”.

Running “lein clean” sorts the problem out, but I worry that I’m missing 
something fundamental that’s going to bite me at some point…

Thanks in advance...

--
paul.butcher->msgCount++

Silverstone, Brands Hatch, Donington Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
Skype: paulrabutcher

Author of Seven Concurrency Models in Seven Weeks: When Threads Unravel
http://pragprog.com/book/pb7con
--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ANN: Namespace browser for Emacs users

2014-07-28 Thread Robin Heggelund Hansen
Neat

kl. 04:48:20 UTC+2 mandag 28. juli 2014 skrev John Andrews følgende:
>
> Emacs users: I have put together a namespace browser which builds upon the 
> existing functionality of Cider. It is in early stages of development but I 
> find it quite useful.
>
> Check it out! https://github.com/jxa/cider-browse-ns
>  

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is still idiomatic the ant simulation code?

2014-07-28 Thread Gary Johnson
Hi Yu,

  This is a pretty dense (and IMHO non-idiomatic) piece of Clojure code. 
Without reading the paste you provided, I can at least tell you what 
appears to be happening here, given Clojure's evaluation semantics:

1. The [move ...] expression creates a vector of three functions.
2. The [(if ...)] expression creates a vector of three values (presumably 
numeric) resulting from calls to the ranks function.
3. The (wrand ...) form calls wrand on the ranks vector to presumably 
produce an integer index into the [move ...] vector.
4. The [move ...] vector is called on wrand's result, which should return 
one of the three functions it contains.
5. The function returned from step 4 is called on loc.

  Happy hacking,
~Gary

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help Getting Sente to Work

2014-07-28 Thread Timothy Washington
Hey Peter,

Thanks for getting back to me. Good explanation here.

Wrt the CSRF issue, I'll try running again without it. Now, a port changed
fixed the issue for me. But before I passed in a *chsk-url-fn*, I was still
getting a 404, even when trying with a browser (ie, using the correct
port).

That 404 went away when I included the CSRF middleware. I still had to pass
in a custom *chsk-url-fn*, but I could use it through the browser, for
example.

And I'm just grokking the false `*websocket?`* allowance now. Ie, an https
ajax connection would give me a sente URL of "*wws://172.28.128.5:8090/chsk
*". Is that right? What about plain http?


Cheers

Tim Washington
Interruptsoftware.com 


On Mon, Jul 28, 2014 at 2:45 AM, Peter Taoussanis 
wrote:

> The new docstring:
> https://github.com/ptaoussanis/sente/blob/65fcf8d9be14bfc69a7798b5c159780d1d2a3804/src/taoensso/sente.cljx#L787
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Leiningen profile problem

2014-07-28 Thread Curtis Summers
Paul,

Leiningen can isolate the target-paths by profile if you use :target-path 
in your project.clj with the %s in it.  

Per the sample project.clj file (
https://github.com/technomancy/leiningen/blob/master/sample.project.clj):

  ;; All generated files will be placed in :target-path. In order to avoid
  ;; cross-profile contamination (for instance, uberjar classes interfering
  ;; with development), it's recommended to include %s in in your custom
  ;; :target-path, which will splice in names of the currently active profiles.
  :target-path "target/%s/"




--Curtis


On Monday, July 28, 2014 12:40:45 PM UTC-5, Paul Butcher wrote:
>
> Ah! I thought that Leiningen put class files in different places for 
> different profiles, but it looks like I was mistaken.
>
> Thanks for the EDN hint - that sounds like a good way to go.
>
> Cheers!
>
> --
> paul.butcher->msgCount++
>
> Silverstone, Brands Hatch, Donington Park...
> Who says I have a one track mind?
>
> http://www.paulbutcher.com/
> LinkedIn: http://www.linkedin.com/in/paulbutcher
> Skype: paulrabutcher
>
> Author of Seven Concurrency Models in Seven Weeks: When Threads Unravel
> http://pragprog.com/book/pb7con
>
> On 28 July 2014 at 18:01:16, Thomas Heller (th.h...@gmail.com 
> ) wrote:
>
>  Your issue is probably due to AOT compilation, uberjar aot compiles 
> everything and leaves alot of class files in your target directory (aka 
> classpath). When you run your app afterwards the class file is used instead 
> of the clj file since the .class file is "newer". When you run lein clean 
> those .class files are removed and the classloader then looks for the clj 
> file.
>
> I'd recommend keeping a config file (can be EDN) and just having a 
> development and production version instead of using different code. You can 
> either use a command line argument to choose which config to load or use 
> leinigen profiles and resource paths so only include the one you want.
>
> HTH,
> /thomas
>
> On Monday, July 28, 2014 3:45:51 PM UTC+2, Paul Butcher wrote: 
>>
>>  Oops - I originally sent this to the ClojureScript group, which 
>> probably wasn’t the best place. Apologies to those who subscribe to both 
>> lists for the spam:
>>  
>>  I’m clearly misunderstanding something fundamental about how Leiningen 
>> profiles work. I’d appreciate help fixing my understanding.
>>
>> I’m trying to create a Ring server that behaves differently when in 
>> production or development mode. I’ve checked a minimal cut-down version of 
>> my server into GitHub here:
>>
>>  https://github.com/paulbutcher/profile-problem
>>
>> There are two different versions of config.clj. The production version 
>> looks like this:
>>
>>   (ns problem.config)
>>  (def production true)
>>  
>> And the development version like this: 
>>
>>   (ns problem.config)
>>  (def production false)
>>  
>> The profiles section of project.clj adds the appropriate one of these to 
>> source-paths depending on which profile is active:
>>
>> :profiles {:production {:source-paths ["production/src"]}
>>   :dev {:source-paths ["dev/src"]}
>>   :uberjar [:production {:aot :all}]}
>>  
>> Finally, the server prints a message during startup:
>>
>>  (println "Starting in" (if config/production "production" "development")
>>  "mode"))
>>
>> This all works fine - if I run “lein ring server-headless” or “lein 
>> with-profile dev server-headless”, I see “Starting in development mode” and 
>> if I run “lein with-profile production server-headless”, I see “Starting in 
>> production mode”.
>>
>> So far so good.
>>
>> The problem arises after I run “lein ring uberjar”. The uberjar works 
>> exactly as I would expect (it runs in production mode). But if I then run 
>> “lein ring server-headless” or “lein with-profile dev server-headless” in 
>> my project directory, instead of seeing “Starting in development mode”, I 
>> see “Starting in production mode”.
>>
>> Running “lein clean” sorts the problem out, but I worry that I’m missing 
>> something fundamental that’s going to bite me at some point…
>>
>> Thanks in advance...
>>  
>>  --
>> paul.butcher->msgCount++
>>
>> Silverstone, Brands Hatch, Donington Park...
>> Who says I have a one track mind?
>>
>>  http://www.paulbutcher.com/
>> LinkedIn: http://www.linkedin.com/in/paulbutcher
>> Skype: paulrabutcher
>>
>> Author of Seven Concurrency Models in Seven Weeks: When Threads Unravel
>>  http://pragprog.com/book/pb7con
>>   
>  --
> 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=en
> ---
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
>

Re: [ANN] Clara 0.6.0

2014-07-28 Thread Ryan Brush
Hey Alan, 

The Storm example was an experiment showing we could distribute the 
engine's working memory between processes, but the needs for it haven't 
materialized as much as other use cases, so I haven't been maintaining or 
growing that part of the system.

This may change in the future. If there's interest in improved Storm 
integration that's something we can kick around, and I would like to get 
back to that at some point. But for the time being I've focused on making 
the core of Clara a solid basis for expert systems.

As a side note, I always like to hear ideas on Clara's direction, and of 
course contributions are welcome. 

-Ryan

On Monday, July 28, 2014 11:37:36 AM UTC-5, Alan Moore wrote:
>
> Awesome - thanks for the update!
>
> Does the storm example work with the new version?
>
> Alan
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help Getting Sente to Work

2014-07-28 Thread Peter Taoussanis

>
> Wrt the CSRF issue, I'll try running again without it.
>

Out of curiosity, sure - but if you've already gone to the effort of 
setting up the CSRF I'd leave it in (better to have it) :-)
 

> Now, a port changed fixed the issue for me. But before I passed in a 
> *chsk-url-fn*, I was still getting a 404, even when trying with a browser 
> (ie, using the correct port).
>

Not sure about that, may be that something in your setup is tripping up the 
default `chsk-url-fn`. Would appreciate a GitHub issue on it and I'll take 
a closer look - may be a bug.

That 404 went away when I included the CSRF middleware. I still had to pass 
> in a custom *chsk-url-fn*, but I could use it through the browser, for 
> example. 
>

My guess is that the 404 is going away because you're passing in a custom 
`chsk-url-fn`, not because of the CSRF middleware. I.e. it's a broken chsk 
url that's causing the 404, not anything to do with the CSRF.


And I'm just grokking the false `*websocket?`* allowance now. Ie, an https 
> ajax connection would give me a sente URL of "*wws://172.28.128.5:8090/chsk 
> *". Is that right? What about plain http?
>

The `chsk-url-fn` will be called with:
1. The path as given to the client-side `make-channel-socket!` fn (usu. 
"/chsk").
2. A window location map of the current page.
3. A bool indicating whether Sente is requesting a WebSocket (true) or Ajax 
(false) connection.

>From these, your fn will need to produce an URL that matches your 
server-side channel socket route.

For WebSocket connections you'll want the URL to start with "ws://" 
(insecure) or "wss://" (secure).
For Ajax connections you'll want the URL to start with "http://"; (insecure) 
or "https://"; (secure).

I wouldn't stress too much about that though - let's start with a GitHub 
issue since it's quite possible I can mod the default fn to cover your 
use-case automatically. Ideally you shouldn't need to fiddle with any of 
this :-)

Cheers!


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is still idiomatic the ant simulation code?

2014-07-28 Thread Yu Shen
Hi Gary,

Your examination makes perfect sense in the context.

Thanks for your help!

Yu


On Tue, Jul 29, 2014 at 8:01 AM, Gary Johnson  wrote:

> Hi Yu,
>
>   This is a pretty dense (and IMHO non-idiomatic) piece of Clojure code.
> Without reading the paste you provided, I can at least tell you what
> appears to be happening here, given Clojure's evaluation semantics:
>
> 1. The [move ...] expression creates a vector of three functions.
> 2. The [(if ...)] expression creates a vector of three values (presumably
> numeric) resulting from calls to the ranks function.
> 3. The (wrand ...) form calls wrand on the ranks vector to presumably
> produce an integer index into the [move ...] vector.
> 4. The [move ...] vector is called on wrand's result, which should return
> one of the three functions it contains.
> 5. The function returned from step 4 is called on loc.
>
>   Happy hacking,
> ~Gary
>
>  --
> 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 a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/sHLQN8m60qM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tools for cleaning namespaces?

2014-07-28 Thread Bertrand Dechoux
Cool! Thanks a lot. Graphviz is low tech enough for me. I will give a try 
at both.

Bertrand

Le lundi 28 juillet 2014 16:38:52 UTC+2, Andy Fingerhut a écrit :
>
> You can try Eastwood's :unused-namespaces linter for #2.  It is disabled 
> by default, so you need to give an option on the command line to enable 
> it.  If you want to try *only* that linter, and none of the other warnings, 
> first follow the simple install instructions in the README, then change to 
> the home dir of your project and type:
>
> lein eastwood '{:linters [:unused-namespaces]}'
>
> Eastwood will not currently help you with your request #1, but it would 
> not be difficult to add such a feature to it, since it determines 
> dependencies between namespaces already using tools.namespace.  There are 
> other tools that can do this for you, e.g. nephila [2] will create a 
> graphics image of your project's namespace dependencies, but you must have 
> graphviz installed.  I don't know of a similar tool that only creates text 
> dependency output.
>
> Andy
>
> [1] https://github.com/jonase/eastwood
>
> [2] https://github.com/timmc/nephila
>
>
> On Mon, Jul 28, 2014 at 4:58 AM, Bertrand Dechoux  > wrote:
>
>> Hello,
>>
>> I am trying to tidy up a project and I have two actions that could be 
>> somehow be automatized.
>>
>> *1) Display the dependencies between the namespace of my project as a 
>> graph (text graph being good enough).*
>> One would want to break dependencies which do not make sense and 
>> sometimes to create indirection in order to lessen the impact of changes.
>>
>> *2) Find out which dependencies are not required.*
>> Splitting a namespace might be quite easy (the complex part is on the 
>> consumer side) but often I find out that dependencies were not pruned 
>> correctly.
>> And so there are useless remaining dependencies that were not removed. 
>>
>> I understand that a 100% bullet proof solution might be really hard to do.
>> But I was wondering, is there any tools that allows to do these tasks for 
>> common cases?
>>
>> Regards
>>
>> Bertrand Dechoux
>>
>> -- 
>> 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=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] System

2014-07-28 Thread Daniel Szmulewicz
Hi everyone, 

Announcing system, some candy built on top of component, the Reloaded 
pattern by Stuart Sierra. 

https://github.com/danielsz/system

The idea behind this library is to serve as a community-backed repository 
of readymade components. 

The README has the details. 

Please don't hesitate to comment/ask/contribute. 

Thank you.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] System

2014-07-28 Thread Michael Klishin
 On 29 July 2014 at 10:00:31, Daniel Szmulewicz (daniel.szmulew...@gmail.com) 
wrote:
> > The idea behind this library is to serve as a community-backed  
> repository of readymade components.

So, basically like Modular?

https://github.com/juxt/modular
--  
@michaelklishin, github.com/michaelklishin

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] System

2014-07-28 Thread Daniel Szmulewicz
I wasn't aware of it. 

How does it relate to Jig (of which I was aware), if it does?

Anyway, modular looks neat and has more components, for sure. The example 
in the README shows usage via a Leiningen template. I found it was 
difficult to retrofit changes on existing projects with the template 
approach. 

But yes, it looks like there's some duplication of effort going on. Ouch.


On Tuesday, July 29, 2014 9:03:07 AM UTC+3, Michael Klishin wrote:
>
>  On 29 July 2014 at 10:00:31, Daniel Szmulewicz (daniel.s...@gmail.com 
> ) wrote: 
> > > The idea behind this library is to serve as a community-backed   
> > repository of readymade components. 
>
> So, basically like Modular? 
>
> https://github.com/juxt/modular 
> --   
> @michaelklishin, github.com/michaelklishin 
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] System

2014-07-28 Thread Michael Klishin
On 29 July 2014 at 10:21:33, Daniel Szmulewicz (daniel.szmulew...@gmail.com) 
wrote:
> > I wasn't aware of it.
>  
> How does it relate to Jig (of which I was aware), if it does?

Jig originally was reinventing parts of Component + did what Modular does.
Malcolm will likely correct me but I believe Modular is what Jig meant to be,
built on top of Component (which has taken off in the community).

> Anyway, modular looks neat and has more components, for sure.  
> The example in the README shows usage via a Leiningen template.  
> I found it was difficult to retrofit changes on existing projects  
> with the template approach.

You can use the modules individually, the template simply brings together
a few commonly used for Web development. You can use e.g. the Netty module
w/o the template or any other modules. 
--  
@michaelklishin, github.com/michaelklishin

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.