Re: Tool authors: ClojureScript support in tools.namespace?

2015-07-25 Thread Dylan Butman
I use .repl constantly for namespace reloading. Clojurescript support would 
be a fantastic improvement for reloading cljs component systems.

On Friday, July 24, 2015 at 5:14:04 PM UTC-4, Stuart Sierra wrote:

 Hello to anyone and everyone writing tools for working with Clojure and 
 ClojureScript source files …

 I've been looking into adding better support for ClojureScript in 
 tools.namespace.

 It's not a trivial problem. Lots of places in tools.namespace assume there 
 is only one kind of source file. For Clojure 1.7 it got updated to include 
 .cljc files as well, but it's still hard-coded. I've collected some of my 
 notes in TNS-35: http://dev.clojure.org/jira/browse/TNS-35

 My question to you: if you maintain a tool or library which uses 
 tools.namespace:

1. Do you need/want ClojureScript support?

2. What namespaces (repl, find, dir, file, parse) do you call in 
 tools.namespace?

3. How would you like to distinguish between get me Clojure sources 
 and get me ClojureScript sources?

 Note: I am **not** proposing a full port of tools.namespace to 
 ClojureScript. Something like c.t.n.repl/refresh is too tightly coupled 
 to JVM Clojure, and equivalent tools already exist for ClojureScript.

 This is just about using tools.namespace to parse and analyze the 
 dependencies of ClojureScript source files, statically, the same way it now 
 does for Clojure source files.

 Thanks,
 –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 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] bidi 1.20.0 - with Schema suppport

2015-06-29 Thread Dylan Butman
Hey Malcolm,

Just confirming my understand, the schema addition is to validate the bidi 
routes themselves, not path parameters matched within the routes, right? Is 
this something you're thinking one might do at component start, 
say 
https://github.com/juxt/modular/blob/master/modules/bidi/src/modular/bidi.clj#L88.

Best
Dylan

On Monday, June 29, 2015 at 11:47:00 AM UTC-4, Malcolm Sparks wrote:

 bidi is a routing library that lets you define the URI routes for your 
 website as data.

 Until now, there has been no way to validate whether that data conforms to 
 the expected structure. Not doing so can often lead to problems.

 I've just released a new version that defines a Prismatic Schema for 
 letting you check and validate your bidi routes in your code.

 Schema validation works for both Clojure and ClojureScript, now that 
 ClojureScript has Var instances (see 
 https://groups.google.com/forum/#!topic/prismatic-plumbing/jqOkv_r8QZk)

 See http://github.com/juxt/bidi for further details.


-- 
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: Writing REST api the right way

2015-06-25 Thread Dylan Butman
Have you looked at yada http://yada.juxt.pro/user-guide.html ?

It's an aleph compatible alternative to liberator that is swagger 
compatible with swagger out of the box.

On Tuesday, June 23, 2015 at 5:33:50 AM UTC-4, Mike Grabowski wrote:

 Hey guys,

 I am so excited to join Clojure bandwagon, last weeks have been super 
 exciting, pretty much in love with Clojure syntax. As we are currently 
 building an application broken into smaller micro services, I thought I am 
 gonna make one or two Clojure based modules. Although the initial purpose 
 of picking the language was to do some CPU demand calculations and data 
 processing, I found it really simple yet enjoyable to write REST api as 
 well (we also use Node.js and Elixir for that purpose and it works pretty 
 well - especially with Elixir thanks to awesome yet simple Erlang model 
 where you can `spawnblock` and be happy).

 I've seen lots of benchmarks already featuring Aleph, Jetty, Vert.x and 
 other HTTP servers and I am currently with `Aleph` thanks to its ability to 
 handle channels and futures out of the box. Unfortunately, because I spent 
 so many years with Node.js and stopped using Java ages ago, I just can't 
 stop thinking about non-blocking evented IO interactions. It just does not 
 feel right to me to block the thread when e.g. logging in an user. 
 Unfortunately, there are no NIO drivers for the database engines I am 
 interested in (Neo4J, Mongo) so async channels are not the way to go.

 Any advices or interesting thoughts? Maybe I am missing something as I am 
 not entirely sure if evented IO is always speeding up the overall 
 performance. Any performance optimisations are welcome. I am especially 
 unhappy with one Neo4J request that takes 1.5 second to finish (it's only 
 because the database is hosted on free Heroku plan and this is not going to 
 happen in production but I find it quite a good place to tweak the 
 optimisations and concurrency).

 Another question is - is there any documentation generator that can parse 
 your comments, take keywords like `:params` or `:returns` (just the idea) 
 and generate beautiful API docs out of the box? Swagger is not a way to go 
 as it requires me to use `Schema` plugin - I am currently with `bouncer` 
 thanks to more real-life validators as well as user friendly messages that 
 I can just print to users out of the box (maybe it's worth building as an 
 open source module then)

 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
--- 
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.


Boot: How to run with the clojure version declared in the :dependencies?

2015-06-13 Thread Dylan Butman
Yes you need to duplicate the version in a properties file or env variable. 
It's important to differentiate between runtime and compiled dependencies vs 
the environment that actually does the compiling. There could be instances 
where different versions may be needed. 

-- 
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.


reader conditional indentation (clojure-mode)

2015-04-16 Thread Dylan Butman
Does anyone know the required clojure-mode indentation configuration to 
achieve indentation aligned 
with http://dev.clojure.org/display/design/Reader+Conditionals ? 
Specifically, I'd like the next line following either #?(... or #?@(... to 
be indented at the same level as the #. 

-- 
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: reader conditional indentation (clojure-mode)

2015-04-16 Thread Dylan Butman
Also, what would be necessary to get repl (cider, etc) working with cljc? 

On Thursday, April 16, 2015 at 10:41:28 AM UTC-4, Dylan Butman wrote:

 Does anyone know the required clojure-mode indentation configuration to 
 achieve indentation aligned with 
 http://dev.clojure.org/display/design/Reader+Conditionals ? Specifically, 
 I'd like the next line following either #?(... or #?@(... to be indented at 
 the same level as the #. 


-- 
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: Kwargs vs explicit parameter map for APIs?

2015-03-13 Thread Dylan Butman
or a macro

(defmacro defkargs [name destrt  body]
  `(clojure.core/defn ~name
 ([] (~name {}))
 ([a# b#  {:as r#}]
  (~name (clojure.core/assoc r# a# b#)))
 ([~destrt]
  ~@body)))

(defkargs kargs-test {:keys [some me]}
  (when (and some me)
(+ some me)))

(and (= (kargs-test :some 1 :me 2)
(kargs-test {:some 1 :me 2})
3)
 (= (kargs-test)
nil))

On Friday, March 13, 2015 at 1:46:08 PM UTC-4, Dylan Butman wrote:

 Late chime in...how about both?

 (defn kargs
   ([] (kargs {}))
   ([a b  {:as r}]
(kargs (assoc r a b)))
   ([a] a))

 On Thursday, May 1, 2014 at 12:21:03 AM UTC-4, Jim Crossley wrote:

 Oh, right. (f m) instead of (apply f [m]). Duh. 


 On Wed, Apr 30, 2014 at 11:15 PM, Colin Fleming colin.ma...@gmail.com 
 wrote:

 I think it would because in that case you'd just pass your arg map 
 straight through rather than having to reconstruct it. So if you weren't 
 passed :y in g (in Mark's example), g wouldn't pass it on to f. By forcing 
 the reconstruction of the map from explicit args, you're forced to use the 
 value (incorrectly) destructured in g. Mark could work around it in his 
 example by using (apply f (mapcat identity m)) in g, but it's far from 
 intuitive.


 On 1 May 2014 15:04, Jim Crossley j...@crossleys.org wrote:

 Unless I'm missing something subtle, all of your points would hold if 
 you removed the  in your argument vector to turn your kwargs into an 
 explicit map, wouldn't they? One advantage is you'd be able to (apply f 
 [m]), but I'm not sure the :or logic would be any less troublesome.
  

 On Wed, Apr 30, 2014 at 8:06 PM, Mark Engelberg mark.en...@gmail.com 
 wrote:

 Here's the thing I can't stand about keyword args:

 Let's start off with a simple function that looks for keys x and y, 
 and if either is missing,
 replaces the value with 1 or 2 respectively.

 (defn f [ {:keys [x y] :or {x 1 y 2}}]
   [x y])

 = (f :x 10)
 [10 2]

 So far, so good.

 Now, let's do an extremely simple test of composability.  Let's define 
 a function g that destructures the keyword args, and if a certain keyword 
 :call-f is set, then we're just going to turn around and call f, passing 
 all the keyword args along to f.

 (defn g [ {call-f :call-f :as m}]
   (when call-f
 (apply f m)))

 = (g :call-f true :x 10)
 [1 2]

 What?  Oh right, you can't apply the function f to the map m.  This 
 doesn't work.  If we want to apply f, we somehow need to apply it to a 
 sequence of alternating keys and values, not a map.

 Take 2:

 (defn g [ {:keys [call-f x y] :as m}]
   (when call-f 
 (f :x x :y y)))

 OK, so this time we try to workaround things by explicitly calling out 
 the names of all the keywords we want to capture and pass along.  It's 
 ugly, and doesn't seem to scale well to situations where you have an 
 unknown but at first glance, it seems to work:

 = (g :call-f true :x 80 :y 20)
 [80 20]

 Or does it?

 = (g :call-f true :x 10)
 [10 nil]

 What is going on here?  Why is the answer coming out that :y is nil, 
 when function f explicitly uses :or to have :y default to 2?

 The answer is that :or doesn't do what you think it does.  The word 
 or implies that it substitutes the default value of :y any time the 
 destructured :y is nil or false.  But that's not how it really works.  It 
 doesn't destructure and then test against nil; instead the :or map only 
 kicks in when :y is actually missing as a key of the map.

 This means that in g, when we actively destructured :y, it got set to 
 a nil, and then that got passed along to f.  f's :or map didn't kick in 
 because :y was set to nil, not absent.

 This is awful.  You can't pass through keyword arguments to other 
 functions without explicitly destructuring them, and if you destructure 
 them and pass them along explicitly, nil values aren't picked up as 
 absent 
 values, so the :or default maps don't work properly.

 To put it simply, keyword args are bad news for composability.

 It's a shame, and I'd love to see this improved (rather than just 
 having the community give up on keyword arguments).
  
 -- 
 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 clo...@googlegroups.com
 Note that posts from new

Re: Kwargs vs explicit parameter map for APIs?

2015-03-13 Thread Dylan Butman
Late chime in...how about both?

(defn kargs
  ([] (kargs {}))
  ([a b  {:as r}]
   (kargs (assoc r a b)))
  ([a] a))

On Thursday, May 1, 2014 at 12:21:03 AM UTC-4, Jim Crossley wrote:

 Oh, right. (f m) instead of (apply f [m]). Duh. 


 On Wed, Apr 30, 2014 at 11:15 PM, Colin Fleming colin.ma...@gmail.com 
 javascript: wrote:

 I think it would because in that case you'd just pass your arg map 
 straight through rather than having to reconstruct it. So if you weren't 
 passed :y in g (in Mark's example), g wouldn't pass it on to f. By forcing 
 the reconstruction of the map from explicit args, you're forced to use the 
 value (incorrectly) destructured in g. Mark could work around it in his 
 example by using (apply f (mapcat identity m)) in g, but it's far from 
 intuitive.


 On 1 May 2014 15:04, Jim Crossley j...@crossleys.org javascript: 
 wrote:

 Unless I'm missing something subtle, all of your points would hold if 
 you removed the  in your argument vector to turn your kwargs into an 
 explicit map, wouldn't they? One advantage is you'd be able to (apply f 
 [m]), but I'm not sure the :or logic would be any less troublesome.
  

 On Wed, Apr 30, 2014 at 8:06 PM, Mark Engelberg mark.en...@gmail.com 
 javascript: wrote:

 Here's the thing I can't stand about keyword args:

 Let's start off with a simple function that looks for keys x and y, and 
 if either is missing,
 replaces the value with 1 or 2 respectively.

 (defn f [ {:keys [x y] :or {x 1 y 2}}]
   [x y])

 = (f :x 10)
 [10 2]

 So far, so good.

 Now, let's do an extremely simple test of composability.  Let's define 
 a function g that destructures the keyword args, and if a certain keyword 
 :call-f is set, then we're just going to turn around and call f, passing 
 all the keyword args along to f.

 (defn g [ {call-f :call-f :as m}]
   (when call-f
 (apply f m)))

 = (g :call-f true :x 10)
 [1 2]

 What?  Oh right, you can't apply the function f to the map m.  This 
 doesn't work.  If we want to apply f, we somehow need to apply it to a 
 sequence of alternating keys and values, not a map.

 Take 2:

 (defn g [ {:keys [call-f x y] :as m}]
   (when call-f 
 (f :x x :y y)))

 OK, so this time we try to workaround things by explicitly calling out 
 the names of all the keywords we want to capture and pass along.  It's 
 ugly, and doesn't seem to scale well to situations where you have an 
 unknown but at first glance, it seems to work:

 = (g :call-f true :x 80 :y 20)
 [80 20]

 Or does it?

 = (g :call-f true :x 10)
 [10 nil]

 What is going on here?  Why is the answer coming out that :y is nil, 
 when function f explicitly uses :or to have :y default to 2?

 The answer is that :or doesn't do what you think it does.  The word 
 or implies that it substitutes the default value of :y any time the 
 destructured :y is nil or false.  But that's not how it really works.  It 
 doesn't destructure and then test against nil; instead the :or map only 
 kicks in when :y is actually missing as a key of the map.

 This means that in g, when we actively destructured :y, it got set to a 
 nil, and then that got passed along to f.  f's :or map didn't kick in 
 because :y was set to nil, not absent.

 This is awful.  You can't pass through keyword arguments to other 
 functions without explicitly destructuring them, and if you destructure 
 them and pass them along explicitly, nil values aren't picked up as absent 
 values, so the :or default maps don't work properly.

 To put it simply, keyword args are bad news for composability.

 It's a shame, and I'd love to see this improved (rather than just 
 having the community give up on keyword arguments).
  
 -- 
 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 
 javascript:
 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 javascript:
 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 javascript:.
 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 clo...@googlegroups.com 
 javascript:
 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 javascript:
 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 

Re: idiomatic use of Stuart Sierra's component

2015-03-02 Thread Dylan Butman
I would do the latter.

I like the extend types to component/Lifecycle wherever possible. The goal 
is to have all components in your system only interact via protocols. This 
way, you have established interfaces between components, and if you want to 
swap an implementation, you just satisfy the protocol. So adapting your 
example

(defprotocol IRegistry
  (register-with [registry cb spec]))

I also like to provide all reference as arguments instead of assoc'ing them 
inside component/start. This allows them to be more easily used in other 
parts of the system, and gives you the opportunity to validate the 
references, continuing the idea of protocol interface

(defn validate-system
  validate the portion of the system contained within the component
  [schema cmp]
  (s/validate {s/Keyword s/Any} schema)
  (- (select-keys cmp (keys schema))
   (s/validate schema)))

(defrecord Registry [state]
  Lifecycle
  (start [this]
(validate-system {:state clojure.lang.Atom} this) ;; this could be more 
general, let's be specific though
;; start the registry
this)
  (stop [this]
;; stop the registry
this)
  IRegistry
  (register-with [registry cb spec]
(swap! state :assoc cb spec)))

(defrecrod UsesRegistry [registry]
  Lifecycle
  (start [this]
 (validate-system {:registry (s/pred (partial satisfies? 
IRegistry))} this)

 this)
  (stop [this]
this))
  

On Sunday, March 1, 2015 at 7:50:58 AM UTC-5, Colin Yates wrote:

 If I have a stateful thing with a lifecycle then is the system component 
 the instance of the thing or a wrapper that contains the thing.

 For example, let's say I have a registry of clients that want to be polled 
 then I might have the following:

 (defrecord Registry [state])
 (defn register-with [registry cb spec] (swap! (:state registry) :assoc cb 
 spec))
 (defn start [registry] ...)
 (defn stop [registry] ...)
 (den some-other-thing [..] )

 Great.

 Now I want to expose that and use Stuart's excellent component library 
 (which I really wish a global 'everything has been defined, now the actual 
 system is starting' lifecycle event, but anyway). I seem to find most 
 examples do:

 (defrecord RegistryComponent [] 
   component/Lifecycle
   (start [this]
 (let [registry (-Registry (atom {}))]
   (start registry)
   (assoc this :registry registry))
   (stop [this]
  (stop (:registry this))
  (assoc this :registry nil)))

 Other components get the RegistryComponent but then have to unravel the 
 actual :registry. 

 Another approach would be to adjust the actual Registry and that that 
 implement the lifecycle:

 (defn register-with [registry cb spec] (swap! (:state registry) :assoc cb 
 spec))
 (defn start [registry] ...)
 (defn stop [registry] ...)
 (den some-other-thing [..] )
 (defrecord Registry [state]
   component/Lifecycle
   (start [this] (start this) this)
   (stop [this] (stop this) this))

 On the one hand, the Lifecycle component can be viewed as separate from 
 the thing it is managing, and this wrapping and unwrapping is only a 
 concern of Components. Nothing outside of a Lifecycle instance worries 
 about it and nothing ever receives a Lifecycle instance.

 On the other hand, it all felt a little bit OO-ish - and actually I don't 
 quite see the 'vanilla' Registry implementing the Lifecycle component as 
 complecting anything inappropriate. The Lifecycle instance is only 
 describing behaviour - there is no separate 'thing'.

 Is that correct or have I missed something? What do you all do?



-- 
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] thi.ng collection update (CLJ/CLJS)

2015-02-25 Thread Dylan Butman
Hey Karsten,

Really glad to see you've been continuing the awesome work here! I used 
toxiclibs extensively when I first starting programming in processing and it 
was hugely influential for me! I've been drifting away from computational 
design since then but I'm hoping to get some serious time to play with your 
clojure work soon.

Best
Dylan

On Wednesday, February 25, 2015 at 12:07:01 AM UTC-5, Karsten Schmidt wrote:
 Hi guys,
 
 thi.ng is a collection of over a dozen largely x-platform Clojure 
 Clojurescript libs for computational/generative design  data
 visualization tasks.
 
 I just wanted to give a little heads up that this project has recently
 seen a number of releases and, as a whole, by now is generally quite
 stable and usable (*is used*) for realworld projects (although most
 libs remain in constant parallel development to make them more feature
 complete). I've collated a number of images of projects and links to
 the most important libs here:
 
 http://thi.ng/
 
 Most notably of those:
 
 http://thi.ng/geom
 By far the largest sub-project and backbone for most others: A 2D/3D
 geometry package w/ comprehensive vector algebra, swizzling,
 intersections, matrix types  helpers, quaternions, pure shape
 primitives with ~50 protocols for polymorphic enquiry  manipulation,
 meshes (incl. I/O), mesh subdivisions, CSG mesh ops, Verlet physics
 engine (only particles, springs, behaviors)... Most of this lib is
 pure geometry w/ no rendering specifics, although there're separate
 modules for SVG rendering w/ shader support  decorators [1], WebGL
 wrapper and converters from shapes/meshes to VBOs and various shader
 presets/utils.
 
 http://thi.ng/shadergraph
 GLSL (WebGL) pure function library  dependency graph (based on
 com.stuartsierra/dependency), GLSL minification during CLJS compile
 time
 
 http://thi.ng/color
 RGB, HSV, CMYK, CSS conversions, color presets (incl. D3 category schemes)
 
 http://thi.ng/luxor
 Complete scene compiler DSL for http://luxrender.net, based around thi.ng/geom
 
 http://thi.ng/morphogen
 Declarative 3D form evolution through tree-based transformations,
 basically an AST generator of geometric operations to transform a
 single seed node into complex 3D objects
 
 http://thi.ng/tweeny
 Interpolation of nested (presumably animation related) data
 structures. Allows tweening of deeply nested maps/vectors with
 completely flexible tween fns/targets and hence easy definition of
 complex timelines
 
 http://thi.ng/validate
 Purely functional, composable data validation  optional corrections
 for nested data. Supports both maps  vectors, wildcards, comes with
 many predefined validators, but extensible...
 
 http://thi.ng/trio
 A generic, non-RDF specific triple store API and feature rich
 SPARQL-like query engine
 (and my prime example of using the literate programming approach with
 org-mode[2][3])
 
 Last but not least: Super special thanks are due to the following people:
 
 Rich, Alex + rest of clojure.core
 David (+everyone else involved) for the immense effort on making CLJS
 proper useful,
 Chas, Kevin and anyone else working on CLJX...
 none of this would have been possible without these amazing tools!
 
 Best, K.
 
 Ps. There're a number of other libs in this collection which are in
 dire need of updating (last touched spring 2013) - these are related
 to general OpenCL functionality and voxel rendering. Some of the
 example images on the above site were created with these...
 
 [1] https://github.com/thi-ng/geom/blob/master/geom-svg/src/examples.org
 [2] https://github.com/thi-ng/trio/blob/master/src/query.org
 [3] http://orgmode.org/
 
 -- 
 Karsten Schmidt
 http://postspectacular.com | http://thi.ng/

-- 
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: [ClojureScript] [ANN] thi.ng collection update (CLJ/CLJS)

2015-02-25 Thread Dylan Butman
I totally thought that map was a photo of 3d printed shapes, but it makes
sense that you're using luxrender now. Is there a video of the animation
online somewhere?

On Wed Feb 25 2015 at 6:13:25 PM Karsten Schmidt i...@toxi.co.uk wrote:

 That's a good point, Bruce! To be honest, I don't know anymore, but it
 makes complete sense to change it. Consider it done! :)

 As for your mapping question, yes, of course! I've done a few of them.
 E.g. the first pic on the website [1] was a project for The ODI in
 2013 and is a map of different council/borough stats of London (here
 knife crime). The shape files were first retrieved  processed with
 the thi.ng/trio lib directly from the UK statistics office's SPARQL
 endpoint [2], then projected to Mercator, converted to 2d polygons,
 smoothed them and then extruded as 3D walled meshes and exported as
 STL files using geom. To create that rendered image, another function
 then combined all borough meshes into a complete render scene for
 Luxrender (using the luxor lib). Since this all was for a 60sec
 animation, I also wrote the tweeny lib for that project to allow me to
 define the timeline for the various camera, mesh, light  shader
 changes. The whole bundle was then sent to EC2 and rendered on 340+
 CPUs... basically, spawned a private render farm.

 Alternatively with  30 lines of code you could query any UK
 constituency (or use similar endpoints for other countries), do those
 initial shape transformations and send the resulting STL mesh file
 straight to a 3D printer... For online use, of course the SVG or WebGL
 modules would be more interesting, but these really would just deal
 with that last transformation/visualization step, i.e. turning a
 thi.ng.geom.Polygon2 into an SVG polygon node or tesselate it and
 stuff it into WebGL buffer to display...

 For more flexible mapping, it'd be great to port some/all of the
 projections from [3] in its own clj lib for easier (and non-JS
 related) access...

 [1] http://thi.ng/img/04.jpg
 [2] http://statistics.data.gov.uk/doc/statistical-geography
 [3] https://github.com/d3/d3-geo-projection/

 Hth!

 On 25 February 2015 at 22:34, Bruce Durling b...@otfrom.com wrote:
  Karsten,
 
  Is there a reason why you went with a README.md and then an index.org
  rather than a plain README.org?
 
  (love all the rest of it and loved your use of it at The Barbican. I
  need to get my head around it all. I'm wondering if I can use it for
  some of the geographic and other charting things I do a lot of).
 
  cheers,
  Bruce
 
  On Wed, Feb 25, 2015 at 5:06 AM, Karsten Schmidt i...@toxi.co.uk
 wrote:
  Hi guys,
 
  thi.ng is a collection of over a dozen largely x-platform Clojure 
  Clojurescript libs for computational/generative design  data
  visualization tasks.
 
  I just wanted to give a little heads up that this project has recently
  seen a number of releases and, as a whole, by now is generally quite
  stable and usable (*is used*) for realworld projects (although most
  libs remain in constant parallel development to make them more feature
  complete). I've collated a number of images of projects and links to
  the most important libs here:
 
  http://thi.ng/
 
  Most notably of those:
 
  http://thi.ng/geom
  By far the largest sub-project and backbone for most others: A 2D/3D
  geometry package w/ comprehensive vector algebra, swizzling,
  intersections, matrix types  helpers, quaternions, pure shape
  primitives with ~50 protocols for polymorphic enquiry  manipulation,
  meshes (incl. I/O), mesh subdivisions, CSG mesh ops, Verlet physics
  engine (only particles, springs, behaviors)... Most of this lib is
  pure geometry w/ no rendering specifics, although there're separate
  modules for SVG rendering w/ shader support  decorators [1], WebGL
  wrapper and converters from shapes/meshes to VBOs and various shader
  presets/utils.
 
  http://thi.ng/shadergraph
  GLSL (WebGL) pure function library  dependency graph (based on
  com.stuartsierra/dependency), GLSL minification during CLJS compile
  time
 
  http://thi.ng/color
  RGB, HSV, CMYK, CSS conversions, color presets (incl. D3 category
 schemes)
 
  http://thi.ng/luxor
  Complete scene compiler DSL for http://luxrender.net, based around
 thi.ng/geom
 
  http://thi.ng/morphogen
  Declarative 3D form evolution through tree-based transformations,
  basically an AST generator of geometric operations to transform a
  single seed node into complex 3D objects
 
  http://thi.ng/tweeny
  Interpolation of nested (presumably animation related) data
  structures. Allows tweening of deeply nested maps/vectors with
  completely flexible tween fns/targets and hence easy definition of
  complex timelines
 
  http://thi.ng/validate
  Purely functional, composable data validation  optional corrections
  for nested data. Supports both maps  vectors, wildcards, comes with
  many predefined validators, but extensible...
 
  http://thi.ng/trio
  A generic, non-RDF specific triple store 

[ANN] Bardo v0.1.0 - A clojure(script) library to assist with transitions between dimensions

2014-12-13 Thread Dylan Butman
TL:DR 

Bardo https://github.com/pleasetrythisathome/bardo 
https://github.com/pleasetrythisathome/bardo is a clojure(script) library 
that provides semantics for defining interpolators between data structures as 
well as utilities for composing them with each other, easing curves, and other 
transformations. It can be extended through clojure protocols to define other 
interopolateable types. 

This is great for animations, but can be useful in a variety of contexts where 
state is not binary.
 
I come from a design and graphics background and got into programming initially 
writing particle systems and music visualizers. When I started doing web 
development and interactive work, transitions and animation we’re always an 
interest. I was deeply unsatisfied with the current state of black box Jquery 
animation, where one must be content with pressing play, and then watching the 
side effects flow. 

When I first started using React around the time it came out, and I was 
thrilled by the declarative nature. I realized that by instead of animation dom 
properties, if you transition component state, then suddenly you have the 
opportunity to insert arbitrary control flow into running animations. I wrote 
https://github.com/pleasetrythisathome/react.animate 
https://github.com/pleasetrythisathome/react.animate based on d3 
interpolators. This library is a big step forward, based on an entirely 
functional approach and greatly aided clojure’s expressiveness. 

I’ve been using some version of this code in production projects for a while. 
That said, this is definitely still alpha software. Thoughts, issues, pull 
request, etc. are very welcome. I hope someone finds it useful!

-- 
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: clojure.edn won't accept clojure.java.io/reader? How to work around this and why isn't this documented anywhere?

2014-12-08 Thread Dylan Butman
+10 for bringing this thread around. 

On Monday, December 8, 2014 9:42:33 PM UTC-5, Luc wrote:

 Dunno the answer but I know how many buddhist monks are needed, exactly 
 three:

 a) the first one readies itself for the bulb swap! by repeating a mantra
 b) the second meditates to make the first monk levitate toward the fixture 
 c) the third one immolates itself to provide light for the entire duration 
 of the operation

 Sorry for all the buddhist monks that may be offended by the above :)
 I like black humor very much and this is probably the only joke that I can 
 write
 on this list that will not qualify me hopefully for eternal damnation... 
 Euh moderation...

 Luc P.

 Sent from my iPad

 On Dec 8, 2014, at 20:11, Matching Socks phill...@gmail.com javascript: 
 wrote:

 How many programmers does it take to change a light bulb?!

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

  -- 
 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 javascript:
 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 javascript:
 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 javascript:.
 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: perform action after events stop for some period

2014-12-04 Thread Dylan Butman
woops should actually be

(go-loop []
  (let [[v c] (alts! [(timeout period) events-ch])]
(if (= c events-ch)
  (when v
(recur))
  (apply f args

the timeout returns nil

On Wednesday, December 3, 2014 3:47:35 PM UTC-5, Erik Price wrote:

 Thank you for calling my attention to this possibility!

 e

 On Wed, Dec 3, 2014 at 2:49 PM, Dylan Butman dbu...@gmail.com 
 javascript: wrote:

 Erik that's pretty! But be careful about go-loops and closed channels. 
 This will recur infinitely if events-ch is closed (it will continuously 
 return nil)

 (defn invoke-after-uninterrupted-delay

   ([period events-ch f]

 (invoke-after-uninterrupted-delay period events-ch f []))

   ([period events-ch f  args]

 (async/go-loop []

   (let [[v p] (async/alts! [(async/timeout period) events-ch])]

 (when v

   (if (= p events-ch)

 (recur)

 (apply f args)))
 will allow the go-loop to return when the channel is closed.


 On Monday, December 1, 2014 8:33:10 PM UTC-5, Erik Price wrote:

 Coincidentally, we recently wrote code to do something very similar. The 
 following function will invoke f after period milliseconds, unless a 
 value is sent on events-ch, in which case the timeout is reset (and 
 starts counting down again):

 (defn invoke-after-uninterrupted-delay
   ([period events-ch f]
 (invoke-after-uninterrupted-delay period events-ch f []))
   ([period events-ch f  args]
 (async/go-loop []
   (let [[_ p] (async/alts! [(async/timeout period) events-ch])]
 (if (= p events-ch)
   (recur)
   (apply f args))

 e
 ​

 On Mon, Dec 1, 2014 at 6:50 PM, Brian Craft craft...@gmail.com wrote:

 That version has the unfortunate behavior that (func) can be 
 interrupted if (event) is called while it is running. Here's another 
 version using an agent:

 (defn queue-with-delay2 [period func]
   (let [q (agent nil)]
 (fn []
   (send-off q (fn [t]
 (when t
   (future-cancel t))
 (future (Thread/sleep period) (send-off q (fn [_] 
 (func) nil

 Running with a sleep to see that (func) is not canceled by subsequence 
 (event) calls:

 (def event (queue-with-delay2 2000 #(do (println running) 
 (Thread/sleep 2000) (println ending

 Oddly, if calling (event) between running and ending messages, the 
 repl will stack-overflow on the return value. No idea what that's about. 
 But, running like this is fine:

 (do (event) nil)





 On Monday, December 1, 2014 1:37:56 PM UTC-8, Brian Craft wrote:

 I have need to perform an action when a series of events is quiet for 
 some period. That is, if one event arrives an action is queued to execute 
 after some timeout. If a second event arrives the timeout is reset, and 
 so-forth.

 The following code seems to work, however I'm wondering if calling 
 'future' from 'swap!' is a bad idea (side effecting), and if there's a 
 better way.

 (defn queue-with-delay [period func]
   (let [f (atom nil)]
 (fn []
   (when @f
 (future-cancel @f))
   (swap! f (fn [_] (future (Thread/sleep period) (func)))


 Use like

 (def event (queue-with-delay 2000 #(println running)))
 (event)
 (event)
 (event)  ; pause 2 sec
 running



  -- 
 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 clo...@googlegroups.com 
 javascript:
 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 javascript:
 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 javascript:.
 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

Re: perform action after events stop for some period

2014-12-03 Thread Dylan Butman


Erik that's pretty! But be careful about go-loops and closed channels. This 
will recur infinitely if events-ch is closed (it will continuously return 
nil)


(defn invoke-after-uninterrupted-delay
  ([period events-ch f]
(invoke-after-uninterrupted-delay period events-ch f []))
  ([period events-ch f  args]
(async/go-loop []
  (let [[v p] (async/alts! [(async/timeout period) events-ch])]
(when v(if (= p events-ch)  (recur)
  (apply f args))


On Monday, December 1, 2014 8:33:10 PM UTC-5, Erik Price wrote:

 Coincidentally, we recently wrote code to do something very similar. The 
 following function will invoke f after period milliseconds, unless a 
 value is sent on events-ch, in which case the timeout is reset (and 
 starts counting down again):

 (defn invoke-after-uninterrupted-delay
   ([period events-ch f]
 (invoke-after-uninterrupted-delay period events-ch f []))
   ([period events-ch f  args]
 (async/go-loop []
   (let [[_ p] (async/alts! [(async/timeout period) events-ch])]
 (if (= p events-ch)
   (recur)
   (apply f args))

 e
 ​

 On Mon, Dec 1, 2014 at 6:50 PM, Brian Craft craft...@gmail.com 
 javascript: wrote:

 That version has the unfortunate behavior that (func) can be interrupted 
 if (event) is called while it is running. Here's another version using an 
 agent:

 (defn queue-with-delay2 [period func]
   (let [q (agent nil)]
 (fn []
   (send-off q (fn [t]
 (when t
   (future-cancel t))
 (future (Thread/sleep period) (send-off q (fn [_] 
 (func) nil

 Running with a sleep to see that (func) is not canceled by subsequence 
 (event) calls:

 (def event (queue-with-delay2 2000 #(do (println running) (Thread/sleep 
 2000) (println ending

 Oddly, if calling (event) between running and ending messages, the 
 repl will stack-overflow on the return value. No idea what that's about. 
 But, running like this is fine:

 (do (event) nil)





 On Monday, December 1, 2014 1:37:56 PM UTC-8, Brian Craft wrote:

 I have need to perform an action when a series of events is quiet for 
 some period. That is, if one event arrives an action is queued to execute 
 after some timeout. If a second event arrives the timeout is reset, and 
 so-forth.

 The following code seems to work, however I'm wondering if calling 
 'future' from 'swap!' is a bad idea (side effecting), and if there's a 
 better way.

 (defn queue-with-delay [period func]
   (let [f (atom nil)]
 (fn []
   (when @f
 (future-cancel @f))
   (swap! f (fn [_] (future (Thread/sleep period) (func)))


 Use like

 (def event (queue-with-delay 2000 #(println running)))
 (event)
 (event)
 (event)  ; pause 2 sec
 running



  -- 
 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 
 javascript:
 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 javascript:
 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 javascript:.
 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: perform action after events stop for some period

2014-12-03 Thread Dylan Butman
 

Erik that's pretty! But be careful about go-loops and closed channels. This 
will recur infinitely if events-ch is closed (it will continuously return 
nil)

(defn invoke-after-uninterrupted-delay

  ([period events-ch f]

(invoke-after-uninterrupted-delay period events-ch f []))

  ([period events-ch f  args]

(async/go-loop []

  (let [[v p] (async/alts! [(async/timeout period) events-ch])]

(when v

  (if (= p events-ch)

(recur)

(apply f args)))
will allow the go-loop to return when the channel is closed.


On Monday, December 1, 2014 8:33:10 PM UTC-5, Erik Price wrote:

 Coincidentally, we recently wrote code to do something very similar. The 
 following function will invoke f after period milliseconds, unless a 
 value is sent on events-ch, in which case the timeout is reset (and 
 starts counting down again):

 (defn invoke-after-uninterrupted-delay
   ([period events-ch f]
 (invoke-after-uninterrupted-delay period events-ch f []))
   ([period events-ch f  args]
 (async/go-loop []
   (let [[_ p] (async/alts! [(async/timeout period) events-ch])]
 (if (= p events-ch)
   (recur)
   (apply f args))

 e
 ​

 On Mon, Dec 1, 2014 at 6:50 PM, Brian Craft craft...@gmail.com 
 javascript: wrote:

 That version has the unfortunate behavior that (func) can be interrupted 
 if (event) is called while it is running. Here's another version using an 
 agent:

 (defn queue-with-delay2 [period func]
   (let [q (agent nil)]
 (fn []
   (send-off q (fn [t]
 (when t
   (future-cancel t))
 (future (Thread/sleep period) (send-off q (fn [_] 
 (func) nil

 Running with a sleep to see that (func) is not canceled by subsequence 
 (event) calls:

 (def event (queue-with-delay2 2000 #(do (println running) (Thread/sleep 
 2000) (println ending

 Oddly, if calling (event) between running and ending messages, the 
 repl will stack-overflow on the return value. No idea what that's about. 
 But, running like this is fine:

 (do (event) nil)





 On Monday, December 1, 2014 1:37:56 PM UTC-8, Brian Craft wrote:

 I have need to perform an action when a series of events is quiet for 
 some period. That is, if one event arrives an action is queued to execute 
 after some timeout. If a second event arrives the timeout is reset, and 
 so-forth.

 The following code seems to work, however I'm wondering if calling 
 'future' from 'swap!' is a bad idea (side effecting), and if there's a 
 better way.

 (defn queue-with-delay [period func]
   (let [f (atom nil)]
 (fn []
   (when @f
 (future-cancel @f))
   (swap! f (fn [_] (future (Thread/sleep period) (func)))


 Use like

 (def event (queue-with-delay 2000 #(println running)))
 (event)
 (event)
 (event)  ; pause 2 sec
 running



  -- 
 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 
 javascript:
 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 javascript:
 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 javascript:.
 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.


Cursive Reloaded Workflow

2014-12-01 Thread Dylan Butman
I've been playing around with Cursive lately (it seems awesome if I can 
ever get comfortable with the keybindings!). I emacs/cider, I have a custom 
keybinding that injects user/reset to trigger something 
like 
https://github.com/stuartsierra/reloaded/blob/master/src/leiningen/new/reloaded/templates/user.clj#L48.
 
Is there a way to do this in cursive?

-- 
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: Cursive Reloaded Workflow

2014-12-01 Thread Dylan Butman
Thanks guys,

Colin, the history search sounds like a great substitute. Just tried it out 
and it works great! Will definitely get a lot of mileage for other things 
as well. 

On Monday, December 1, 2014 7:49:17 PM UTC-5, Colin Fleming wrote:

 So IntelliJ works in different way to Eclipse, as I understand it. The 
 terminology is a little confusing - in IntelliJ a project is what I 
 normally think of as a project, so in the case of a multi-module project 
 like CCW or Leiningen, the project is the whole thing (CCW or lein) and the 
 sub-projects (leiningen.core, or ccw.branding, .core, .feature etc) are 
 called modules. A project is opened in a dedicated window, so there's no 
 concept like the Eclipse workspace, where you could have both lein and CCW 
 open at once in the same window (I think, I'm a little fuzzy on Eclipse, 
 and what little knowledge I do have is years out of date). 

 So in Cursive, the REPLs are specific to a project but you can have 
 multiple REPLs for a particular project (so a CLJ one and a CLJS one, or I 
 tend to have one open on my current IDE instance, one on my external 
 instance I'm debugging, and perhaps a test REPL). The REPLs are shown in a 
 toolwindow on one side of the screen, and the different REPLs are tabs 
 within that.

 So when the user performs an operation which requires a REPL, it uses the 
 currently selected REPL (active tab) of the current project. This generally 
 works pretty well, since the REPL is always related to the correct project, 
 and the user generally knows which REPL they're working in. It can get 
 confusing in my case though when I have three very similar REPLs open, but 
 I just have to be careful or restart them from time to time :-)

 On 2 December 2014 at 12:14, Laurent PETIT lauren...@gmail.com 
 javascript: wrote:



 2014-12-02 0:02 GMT+01:00 Colin Fleming colin.ma...@gmail.com 
 javascript::

 Looks like Laurent is one ahead of me :-). Cursive can't do this right 
 now, although it's a much-requested feature with an issue in the tracker. 
 I'll try to add this soon. In the meantime, you can use the Search REPL 
 History action which narrows down on typing - not ideal, but it should work 
 for now. You can invoke that from any context, you don't have to be in the 
 REPL editor, and you can use Shift-Enter to execute immediately rather than 
 copying to the REPL editor and focusing it.


 Wow, being able to use the Search REPL History action from any context is 
 great!

 BTW, how do you solve the which repl for which editor? issue in 
 Cursive? In CCW, sometimes ago the REPL to use was derived from the project 
 the files were located. These days, it's just the last active REPL that is 
 used (more freedom for the user, but arguably less intelligence in the 
 IDE). What will be used tomorrow remains an open subject, currently users 
 seem happy ...
  


 Cheers,
 Colin

 On 2 December 2014 at 11:47, Laurent PETIT lauren...@gmail.com 
 javascript: wrote:

 FWIW, please note that it's now possible to script Counterclockwise in 
 such a way.

 The following link shows how to add a new keybinding for calling 
 (user/reset) on the active REPL : 
 https://github.com/laurentpetit/ccw-plugin-repl#repl-keybindingsclj

 (Requires a Counterclockwise built from the master branch, e.g. 
 http://updatesite.ccw-ide.org/branch/master/CI0176-master-gitf1930d7/ )

 Was just working on it this week-end, thus the high-jack of the thread 
 ;-)

 -- 
 Laurent


 2014-12-01 17:14 GMT+01:00 Dylan Butman dbu...@gmail.com javascript:
 :

 I've been playing around with Cursive lately (it seems awesome if I 
 can ever get comfortable with the keybindings!). I emacs/cider, I have a 
 custom keybinding that injects user/reset to trigger something like 
 https://github.com/stuartsierra/reloaded/blob/master/src/leiningen/new/reloaded/templates/user.clj#L48.
  
 Is there a way to do this in cursive?

 -- 
 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 
 javascript:
 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 javascript:
 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 javascript:.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Laurent Petit
  
 -- 
 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 
 javascript:
 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

Re: CCW bug [SEVERE]

2014-10-31 Thread Dylan Butman
Is it hard to actually send the log? Are you purposefully uncooperative to 
people trying to help?



 On Oct 31, 2014, at 11:51 PM, Fluid Dynamics a2093...@trbvm.com wrote:
 
 On Friday, October 31, 2014 11:44:49 PM UTC-4, Luc wrote:
 I'll repeat myself : 
 
 '...guessing which error is 
 relevant or not is an educated guess at best except if you are deep in 
 Eclipse plugins coding.' 
 
 Laurent stated clearly that saving 
 a file triggers a number of things 
 in several plugins. 
 
 There could be suspicious messages in the log 
 that have nothing to do with CCW 
 and that could give an idea of the root of 
 the problem. 
 
 And I'll repeat *my*self: each save I did in the ten minutes before the hang 
 produced a particular message in the log. The save I did that triggered the 
 hang produced the exact same message. The very next message was the first 
 message generated by a fresh CCW instance starting up. There was nothing in 
 between. There was nothing different, special, or unusual anywhere near (and 
 prior to) the time of the hang, nor anything missing that was present for 
 previous saves. Ergo there was nothing in the log that was any kind of clue 
 to the reason for the hang.
 
 -- 
 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/6Vw7wuVXz9E/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: Starting a project the right way - tips?

2014-10-29 Thread Dylan Butman
+1 for using https://github.com/stuartsierra/component for managing runtime 
state. makes subbing stub components for testing really easy, and also 
allows you to test more granular parts of your system. also for 
datomic https://github.com/rkneufeld/conformity is a nice utility for 
managing datomic schema.

On Monday, October 27, 2014 9:59:28 AM UTC-4, Ashton Kemerling wrote:

 I ham-fistedly kill and reset the DB before every test using clojure.test 
 fixtures.

 Passing the conn never occurred to me, and I kind of wish I did it that 
 way. Currently I have any reading database functions accept the db (which 
 makes testing using “with” very fast and easy), and any writing functions 
 return the tx-data rather than executing it directly. This also makes 
 testing easier, as I can assert on the exact tx-data expected, or again use 
 with in my tests to check the side-effects. As a result the only tests I 
 have that actually touch db state are anything that check my actual routing 
 code.

 —
 Ashton



 On Mon, Oct 27, 2014 at 7:52 AM, Sven Richter sve...@googlemail.com 
 javascript: wrote:

 Hi Ashton,

 After some discussion in the datomic and clojure irc channel I decided to 
 go the route to pass in the datomic connection or datomic value to every 
 function. This way it is really easy to do integration tests of these 
 functions by setting up an in memory datomic database for every single one 
 of my tests.
 Mixing in some fixtures and I was done.

 I am curious, how did you solve this finally?

 Best Regards,
 Sven



 Am Montag, 27. Oktober 2014 14:25:12 UTC+1 schrieb Ashton Kemerling:

 Consider how your database will be setup and handled. My project uses 
 Datomic (also a SPA), but it was a little painful learning how to get the 
 tests to run cleanly with the database being setup and torn down between 
 runs.

 Also, consider using Secretary on the frontend early. I’m using Om and 
 thought I could get away without it by using component state to control 
 what is displayed, and boy was I wrong.

 —
 Ashton



 On Mon, Oct 27, 2014 at 6:54 AM, Joshua Ballanco jbal...@gmail.com 
 wrote:

 Just in case you hadn’t already come across it in your Google-ing, I 
 thought you should know about http://clojure-doc.org . This site is 
 more than just API documentation, it also contains a number of useful 
 guides covering various topics in Clojure. It’s not exactly a collection 
 of 
 prescriptions, but it might help you figure out what direction to head in 
 more than just reading the API docs would.

 Cheers,
 Josh


 On October 27, 2014 at 13:08:42, Colin Yates (colin...@gmail.com) 
 wrote:

   About to embark on a new project and interested in wish I knew 
 this/wish I had used this type sentiments. An extension of this 
 splendid 
 article: 
 http://blog.mattgauger.com/blog/2014/09/15/clojure-code-quality-tools/. 
 Any others?

 For context, this is going to be a non-trivial SPA using clojurescript 
 supported by a Clojure backend (
 https://groups.google.com/d/topic/clojurescript/9cDFfAGsDE4/discussion)

 In addition to the tips I found in the article I am also planning on 
 using core.typed, primarily to address the anyone remember what this data 
 structure looked like? 12 month maintenance risk. I did look at schematic 
 but I like the extra enforcement core.typed gives.

 On a side note, answering this question from google alone is 
 non-trivial. We, as a community have reached that point where there are so 
 many (good, but overlapping and sometimes contradictory) good next steps 
 it 
 is easy to be paralysed by choice. A few more authorized (whatever that 
 means) prescriptions wouldn't go amiss. Not sure what the answer is, 
 merely raising the flag. 

 So, what tips/techniques/XYZ do you wish you had started with?

 Thanks!
  --
 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.

 signature.asc

  
  -- 
 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 
 javascript:
 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 javascript:
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message 

Re: CCW bug [SEVERE]

2014-10-28 Thread Dylan Butman
This still sounds like a case of I haven't learned how to use git yet, and 
although that means I can't possibly understand how it might improve my 
workflow, I don't want to take the time to learn a fundamental piece of 
software that's used by the vast majority of the programming community. 

On Tuesday, October 28, 2014 5:14:45 PM UTC-4, Fluid Dynamics wrote:

 On Tuesday, October 28, 2014 5:01:47 PM UTC-4, Charlie Griefer wrote:


 On Oct 28, 2014, at 1:28 PM, Fluid Dynamics a209...@trbvm.com wrote:

 Meanwhile, I think some people still have not grasped the scale of what 
 I'm doing, namely how small it is. Small, experimental, limited to one 
 person, and so forth. Version control, I repeat, would be MASSIVE overkill 
 under the circumstances. It would make barely any less sense to reach for 
 version control before writing a hello, world program.

 IF the project grows enough and is successful enough, then I might 
 consider creating a github account and basing it there.


 As has been mentioned already, git != github.

 Really, if the risk of losing your changes to this file are enough to 
 warrant the tirade that you’ve been on, it’s enough of a risk to warrant 
 doing a git init in the directory.


 It's not doing a git init that concerns me. It's:
 * Finding and installing yet another piece of software
 * Learning at least the basic ins and outs of that piece of software
 * Configuring it, since it sounds like commandline stuff that probably 
 does not simply work OOTB without setting PATH and probably fiddling with 
 other things
 * Figuring out how to configure CCW to integrate with that other piece of 
 software -- if that's even possible
 * Manually mucking about checking out, copying the files into CCW's 
 workspace, and later copying the files back out and checking in if not
 * Extra steps around every file save or open, namely whatever is needed to 
 do checkins and checkouts from version control.
 * Dealing with whatever subset actually happens of the new 
 things-that-can-go-wrong that get introduced by all this added complexity.

 One warning flag already apparent is the very phrase doing a git init in 
 the directory in your post. Sounds like I'd be having to do a lot more 
 fiddling around at the command line than I currently do. Infinitely more, 
 in fact, since the current amount is zero. :)

 I remain wholly unconvinced that it's worth the hassle for a project this 
 small.



-- 
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: State of Clojure 2014 Survey - please contribute!!

2014-10-17 Thread Dylan Butman
I'd just like to say that I'm very impressed that this conversation is 
happening. It shows a great level of awareness within the community and 
makes me really optimistic about clojure as a inclusive language for the 
future.

On Wednesday, October 15, 2014 10:59:08 PM UTC-4, Mars0i wrote:

 After reading Sean's thoughtful off-list remarks, I think it's worth 
 commenting on my previous remarks.  I don't think it matters whether I 
 understand people's reasons.  People may have their own personal reasons 
 for not wanting to answer demographic questions, and I accept that, don't 
 object to it, and am open to supporting it.

 On Wednesday, October 15, 2014 7:22:56 PM UTC-5, Mars0i wrote:

 I don't really get it.  I don't see a legitimate reason why anyone would 
 refuse to participate in the survey because it included demographic 
 questions.  The survey is anonymous.  The combination of questions is not 
 such that it would be at all plausible that anyone could be identified by 
 their responses.  At worst, answering a few additional questions--or simply 
 skipping those questions--would be a very minor annoyance.  Is it that some 
 people object to the idea that there are disparities due to systemic 
 factors in our society?  If someone wants to disagree about that, OK, but I 
 still don't see how boycotting a survey because it offers respondents the 
 opportunity to provide demographic information is reasonable.

 On Wednesday, October 15, 2014 2:06:29 PM UTC-5, Sean Corfield wrote:

 On Oct 15, 2014, at 11:29 AM, Ashton Kemerling ashtonk...@gmail.com 
 wrote: 
  I would rather not say is a common and valid response in these 
 scenarios. 

 Yes, although that doesn't address that there are people who will not 
 complete a survey that even asks such questions (on a philosophical 
 objection to collecting such demographic information). As I said, it's a 
 sensitive issue. 

 As Bridget noted, they'll consider the approach for 2015. 

 Sean Corfield -- (904) 302-SEAN 
 An Architect's View -- http://corfield.org/ 

 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
--- 
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: best way to edit EDN value in cljs

2014-10-11 Thread Dylan Butman
you can do some pretty powerful things using update-in and merge-with, 
especially if combined with protocols or multimethods that determine 
behavior. Can you give a more specific example of what you're trying to do? 
deep-merge and deep-merge-with are also useful here. There are a lot of 
nearly identical implementations originally taken from 
clojure.contrib.map-utils. 
 
https://github.com/puppetlabs/clj-kitchensink/blob/cfea4a16e4d2e15a2d391131a163b4eeb60d872e/src/puppetlabs/kitchensink/core.clj#L311-L332

Another approach to look at would 
be 
https://github.com/clojure/clojurescript/blob/master/src/cljs/clojure/zip.cljs 
(or the faster 
https://github.com/akhudek/fast-zip/blob/master/src/cljs/fast_zip/core.cljs), 
and maybe porting some of the functionality 
of https://github.com/xsc/rewrite-clj to cljs. 

Perhaps a combination of the two for first finding said arbitrary point in 
your tree and then returning an edited version.

On Friday, October 10, 2014 2:28:26 PM UTC-4, Dustin Getz wrote:

 I have an arbitrarily nested EDN value stored in an atom in ClojureScript.

 What is the best way to make edits to an arbitrary subtree of this value?


-- 
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] Silk, an isomorphic routing library for Clojure and ClojureScript

2014-10-10 Thread Dylan Butman
 

I’ve been using silk in conduction with compojure. Most middleware aren’t 
compojure specific, but I’ve just found it easier to stick with base level 
compojure routes and then pass uris to silk for pattern matching. This is 
mostly because there is such a wealth of documentation and examples to draw 
from with compojure. For example, session management, login flows with 
friends, etc have already been solved and there is plenty of code to strip. 
Silk wouldn’t complicated them (in some cases it might simplify), but when 
the wheel rolls, push it.


I’ve been approaching silk solely as a library for pattern matching within 
the specific domain of urls, which it does very cleanly. More importantly, 
it’s currently the only one that does it in both clojure and clojurescript, 
which makes it possible to have the same routing code used on client and 
server, which is necessary if you want to do server rendering, or more 
complicated websocket updates. 

-- 
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] Clojure instaREPL for web

2014-10-08 Thread Dylan Butman
Very nice! looks like there are some css issues with output display for 
example, (map inc [1 2 3 4]) doesn't output on a single line, and seems to 
shift a little bit from time to time.

With a little more polishing this could be fantastic teaching tool for 
intro to clojure workshops and tutorials. Lighttable has been my goto for 
this in the past, and is still a more robust solution for larger project 
workshops, but having an immediate way to get code working is fantastic.

How about a gist integration? It'd be absolutely wonderful if you could 
permalink to a instarepl that pulls code from a gist and then just start 
evaluating.

On Tuesday, October 7, 2014 3:00:08 PM UTC-4, Lauri Hartikka wrote:

 A web based clojure instaREPL,

 Check it out :)

 http://clojurerepl.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.


Re: [ANN] Silk, an isomorphic routing library for Clojure and ClojureScript

2014-10-07 Thread Dylan Butman
Sorry i don't have time to really explain any of this...

but here's some code I pulled out of a recent project. maybe it'll be helpful 
to you. unfortunately I can't share the whole project.

https://gist.github.com/pleasetrythisathome/7adbdc9c8b7ab689df45

-- 
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: Pause a go loop

2014-09-12 Thread Dylan Butman
How about this?

https://gist.github.com/pleasetrythisathome/4f03ba9f729300beea40

On Friday, September 12, 2014 12:51:39 PM UTC-4, Jeremy Vuillermet wrote:

 thx, I'll look more into in but it doesn't seem they are able to pause and 
 resume scheduled functions

 On Thursday, September 11, 2014 4:34:16 PM UTC+2, Linus Ericsson wrote:

 For instance you can use schejulure [1] or at-at [2] and make sure the 
 scheduled function calls put an item (event) on the channel and then made 
 the scheduler do the pausing work.

 All the listeners attached to the channel will receive the events at 
 the time the scheduler releases them, and you don't have to manage 
 anything regarding timing/pausing.

 /Linus


 [1] https://github.com/AdamClements/schejulure
 [2] https://github.com/overtone/at-at


 2014-09-11 13:52 GMT+02:00 Jeremy Vuillermet jeremy.v...@gmail.com:

 Hello,

 here is my use case 

 (defn replay [history] (go (doseq [millis history] 
   (! (timeout millis)) 
   (prn millis

 history is a vector of duration: [1000 2000 4000]

 Now I would like to pause this doseq. One way is to use an atom pause?, 
 check for the pause and block until a new value in a resume chan.

 But there may be an other way with channels only and avoid global/shared 
 pause atom.
 I was naively thinking of a pause channel and at each loop I check if 
 there is a value but I'm not sure it's better and I couldn't manage to do 
 it anyway.

 -- 
 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.


Clojure(script) Job Opportunity in NYC

2014-08-27 Thread Dylan Butman


We're looking for a full-time clojure(script) dev to join our team in NYC. 
Here's the posting. Shoot be an email at dy...@ib5k.com if you're 
interested. 


Posting:


We are IB5k ( http://ib5k.com ), a software dev shop based in SOHO, and we 
are looking for a promising developer to become a core part of our team. 
 We are looking for either a senior developer or a junior developer who 
feels that they can become a senior developer with the proper training. We 
specialize in data visualization and analytics, interactive development, 
and progressive UI design. In addition to high end commercial work, we 
incubate start-ups, provide direct equity to our employees within them, and 
provide a supportive, collaborative environment to help our developers 
excel and our start-ups succeed. We are looking for a seasoned developer or 
a younger developer who just gets it and possesses the as many of the 
following as possible: 


   - 
   
   Has some (or a lot of!) experience with functional programming and/or 
   Clojure(script)
   - 
   
   An thorough understanding full-stack web development: from DB to API, 
   and from PSD to HTML
   - 
   
   Has a strong attention to detail. Messy code is unfinished code, margins 
   must be exact to comps, animation timing and easing matters, etc. 
   - 
   
   Has a strong desire to think critically about language, development, and 
   project level issues, and to develop creative solutions to solve them
   - 
   
   The ability to make reasonable time estimations and to make strong 
   pragmatic decisions based on time-constraints (you know when it's time to 
   refactor and clean up ugly code, and you know when you're biting off more 
   than you can chew)
   - 
   
   Is highly motivated to succeed.
   - 
   
   Is a team player. Someone who knows how to listen AND is not afraid of 
   contributing to the conversation
   

More about us: 

We love the Clojure programming language and functional programming in 
general. Our ideal candidate will do some research on the subject and 
develop a legitimate interest to learn more. Our work environment is laid 
back. You don't need to dress up, you don't have time sheets to fill out, 
you can work from home when you're getting your work done or don't have a 
meeting. We’re committed to open source and our developers have the 
opportunity to release software under both their personal means and under 
the company umbrella.

To apply:


   - 
   
   Send us a link to your Github account if you have one and address at 
   least two of the below:
   - 
   
   Tell us something about yourself (what borough you live in, favorite 
   band, anything) 
   - 
   
   Tell us the web development stack you are most comfortable with and 
   defend your choice
   - 
   
   Tell us the personal project you’d work on right now if someone paid 
   your salary for a year to do it
   - 
   
   Tell us something you find interesting about Clojure and why. 
   

-- 
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: [ClojureScript] DevArt Co(de)Factory open source release

2014-08-21 Thread Dylan Butman
This is really awesome Karsten!

I first got obsessed with programming writing particle systems in processing 
with toxiclibs. Thanks for all your work! Will definitely be digging deep into 
this one. 

-- 
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] lein-plz 0.1.1 - Add dependencies quickly

2014-08-19 Thread Dylan Butman
I'm going to tie a bow on it today and I'll get back to you

 On Aug 19, 2014, at 1:07 AM, john walker john.lou.wal...@gmail.com wrote:
 
 Is there a link to your work? I'm very interested in this.
 
 On Monday, August 18, 2014 8:49:36 PM UTC-7, Dylan Butman wrote:
 It'd be great if you could chain lein take like that to take advantage of 
 having already spun up the jvm. 
 
 I've been thinking a lot lately about scaffolding for clojure projects, and 
 while lein templates are a nice start, what I want to work towards is 
 modular templates that can add (and maybe remove, although that's much 
 harder) functionality where you need it. 
 
 Modular deps would be a great start! I'm almost done with an automatic 
 template generator (also using re that's at least very helpful for template 
 development. 
 
 On Aug 18, 2014, at 6:28 PM, john walker john.lo...@gmail.com wrote:
 
 I hadn't planned on adding remove, but with groups of dependencies, it 
 makes sense. I like it
 
 Dependencies that will surely be added get lookups, but no one else. I'm 
 going to play with exclusions to see if I can make it launch faster, but I 
 suspect that it's largely a clojure issue in general. Another way that it 
 can be sped up is by switching from rewrite-clj to the built-in lein change.
 
 One way that you might be able to eyeball the task's performance is by doing
 
 lein do help, plz add cljs match
 
 and eyeballing the gap? I bet there are problems with this approach, though.
 
 Something I'm interested in is a lein task for switching directories like 
 this:
 
 lein do new baz, cd baz, plz add cljs
 
 if there were, then you could save some calls to lein.
 
 The right answer is probably here. I'll look through it and figure 
 something out. https://github.com/technomancy/leiningen/wiki/Faster
 
 On Monday, August 18, 2014 9:24:00 AM UTC-7, Dylan Butman wrote:
 It looks like it walks the file and injects new lines. 
 
 Are you planning on adding a remove task?
 
 Also, it'd be great if you define groups of dependencies by giving 
 multiple dependencies the same key. For example, I want something like
 
 {
   om#{om frontend}
   prismatic/om-tools#{om-tools frontend}
   sablono#{sablono frontend}
 }
 
 where lein plz add frontend would add all three deps.
 
 Also, it seems like the task takes quite a while, and there's no debug 
 output to indicate why, is this because you're fetching a lot of things 
 behind the scenes?
 
 -- 
 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 a topic in the 
 Google Groups Clojure group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/clojure/f5avH92IkBA/unsubscribe.
 To unsubscribe from this group and all its topics, 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 a topic in the Google 
 Groups Clojure group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/clojure/f5avH92IkBA/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: [ANN] lein-plz 0.1.1 - Add dependencies quickly

2014-08-19 Thread Dylan Butman
Here you go! https://github.com/pleasetrythisathome/lein-templater

I'm sure there are some kinks to iron out, give it a try!

On Tuesday, August 19, 2014 1:07:34 AM UTC-4, john walker wrote:

 Is there a link to your work? I'm very interested in this.

 On Monday, August 18, 2014 8:49:36 PM UTC-7, Dylan Butman wrote:

 It'd be great if you could chain lein take like that to take advantage of 
 having already spun up the jvm. 

 I've been thinking a lot lately about scaffolding for clojure projects, 
 and while lein templates are a nice start, what I want to work towards is 
 modular templates that can add (and maybe remove, although that's much 
 harder) functionality where you need it. 

 Modular deps would be a great start! I'm almost done with an automatic 
 template generator (also using re that's at least very helpful for template 
 development. 

 On Aug 18, 2014, at 6:28 PM, john walker john.lo...@gmail.com wrote:

 I hadn't planned on adding remove, but with groups of dependencies, it 
 makes sense. I like it

 Dependencies that will surely be added get lookups, but no one else. I'm 
 going to play with exclusions to see if I can make it launch faster, but I 
 suspect that it's largely a clojure issue in general. Another way that it 
 can be sped up is by switching from rewrite-clj to the built-in lein change.

 One way that you might be able to eyeball the task's performance is by 
 doing

 lein do help, plz add cljs match

 and eyeballing the gap? I bet there are problems with this approach, 
 though.

 Something I'm interested in is a lein task for switching directories like 
 this:

 lein do new baz, cd baz, plz add cljs

 if there were, then you could save some calls to lein.

 The right answer is probably here. I'll look through it and figure 
 something out. https://github.com/technomancy/leiningen/wiki/Faster

 On Monday, August 18, 2014 9:24:00 AM UTC-7, Dylan Butman wrote:

 It looks like it walks the file and injects new lines. 

 Are you planning on adding a remove task?

 Also, it'd be great if you define groups of dependencies by giving 
 multiple dependencies the same key. For example, I want something like

 {
   om#{om frontend}
   prismatic/om-tools#{om-tools frontend}
   sablono#{sablono frontend}
 }

 where lein plz add frontend would add all three deps.

 Also, it seems like the task takes quite a while, and there's no debug 
 output to indicate why, is this because you're fetching a lot of things 
 behind the scenes?

  -- 
 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 a topic in the 
 Google Groups Clojure group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/clojure/f5avH92IkBA/unsubscribe.
 To unsubscribe from this group and all its topics, 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] lein-templater - automagically generate templates from your existing projects

2014-08-19 Thread Dylan Butman
I've been writing a lot of templates lately for various web stacks and 
whatnot, and I got really tired of having to copy my files into a template 
every time they changes. I figured it wouldn't be too hard to generate them 
programmatically, and after a few more days than expected, here you have it.

Introducing lein-templater - 
https://github.com/pleasetrythisathome/lein-templater

It generates templates for you! It has options! 

Feedback appreciated. I'm sure there are some kinks to iron out.

-- 
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] lein-plz 0.1.1 - Add dependencies quickly

2014-08-18 Thread Dylan Butman
It looks like it walks the file and injects new lines. 

Are you planning on adding a remove task?

Also, it'd be great if you define groups of dependencies by giving multiple 
dependencies the same key. For example, I want something like

{
  om#{om frontend}
  prismatic/om-tools#{om-tools frontend}
  sablono#{sablono frontend}
}

where lein plz add frontend would add all three deps.

Also, it seems like the task takes quite a while, and there's no debug 
output to indicate why, is this because you're fetching a lot of things 
behind the scenes?

-- 
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] lein-plz 0.1.1 - Add dependencies quickly

2014-08-18 Thread Dylan Butman
It'd be great if you could chain lein take like that to take advantage of 
having already spun up the jvm. 

I've been thinking a lot lately about scaffolding for clojure projects, and 
while lein templates are a nice start, what I want to work towards is modular 
templates that can add (and maybe remove, although that's much harder) 
functionality where you need it. 

Modular deps would be a great start! I'm almost done with an automatic template 
generator (also using re that's at least very helpful for template development. 

 On Aug 18, 2014, at 6:28 PM, john walker john.lou.wal...@gmail.com wrote:
 
 I hadn't planned on adding remove, but with groups of dependencies, it makes 
 sense. I like it
 
 Dependencies that will surely be added get lookups, but no one else. I'm 
 going to play with exclusions to see if I can make it launch faster, but I 
 suspect that it's largely a clojure issue in general. Another way that it can 
 be sped up is by switching from rewrite-clj to the built-in lein change.
 
 One way that you might be able to eyeball the task's performance is by doing
 
 lein do help, plz add cljs match
 
 and eyeballing the gap? I bet there are problems with this approach, though.
 
 Something I'm interested in is a lein task for switching directories like 
 this:
 
 lein do new baz, cd baz, plz add cljs
 
 if there were, then you could save some calls to lein.
 
 The right answer is probably here. I'll look through it and figure something 
 out. https://github.com/technomancy/leiningen/wiki/Faster
 
 On Monday, August 18, 2014 9:24:00 AM UTC-7, Dylan Butman wrote:
 It looks like it walks the file and injects new lines. 
 
 Are you planning on adding a remove task?
 
 Also, it'd be great if you define groups of dependencies by giving multiple 
 dependencies the same key. For example, I want something like
 
 {
   om#{om frontend}
   prismatic/om-tools#{om-tools frontend}
   sablono#{sablono frontend}
 }
 
 where lein plz add frontend would add all three deps.
 
 Also, it seems like the task takes quite a while, and there's no debug 
 output to indicate why, is this because you're fetching a lot of things 
 behind the scenes?
 
 -- 
 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/f5avH92IkBA/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: Success Stories w/US Government Projects

2014-08-09 Thread Dylan Butman
We've had a software product in congress for a while now. The version there 
isn't clojure, but we've had a number of talks about integrating our newer 
versions that do contain heavy amounts of clojure. We recently did a 
complete rewrite of cosponsor.gov (which we had previously written in 
ruby/js) in clojure for a congressman. It's down at the moment due to 
changes in the political climate (the guy who paid for it is now out of 
office). I'm not as familiar with the intricacies of the process as our 
other developer who worked on the original project. 

I'd be happy to try to set up a call or connect you via email with the 
folks who might be able to answer more specific questions about our 
experience

On Friday, August 8, 2014 8:54:08 PM UTC-4, rcg wrote:

 Hello;

 We are looking for Clojure success stories within the US Government.

 If you have a success story you'd be willing to share, this may counter or 
 help resolve objections to the EPL license that have been raised by 
 Lawyers. Our development group has had much success with Clojure. 
 Unfortunately, we may be forced away from Clojure. 

 An alternative would be to have the license modified (we understand that 
 is probably a non-starter) or have a dual license setup for Clojure (with 
 acceptable license).

 However, if there are other groups out there that have survived US Govt 
 Lawyer Scrutiny of the EPL, that may be very useful.

 Thanks in advance for any help!


-- 
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] Silk, an isomorphic routing library for Clojure and ClojureScript

2014-08-07 Thread Dylan Butman
I agree with Joel that I've found that secretary works very well with Om, 
especially with a few abstractions built over it to built the corresponding 
state. The opposite direction is tricky though, and the biggest problem I've 
run into is that matching order is based on runtime route declaration order, 
and as Dom points out, if you try to do this across namespaces, you're in for 
trouble. In practive, I've never wanted or needed to define routes in any way 
but top to bottom in a single file. 

That said, I think the Silk approach is very elegant. First, isomorphism is 
great, good one. Second, being able to easily define subsets of routes and 
match/unmatch on arbitrary combinations of them is very powerful and highly 
composable. You could use the same (Google History) hash change token → 
dispatch! → data → transition! (Om), where dispatch! is a match on a group of 
routes. 

The state - route direction is much cleaner with silk. It simplifies the 
problem a lot to be able to filter your routes to only include those dealing 
with your current app state, then selecting from your app state and matching on 
the filtered routes. I was trying to do something similar with Tao (although it 
was an alpha level mess), but ended up being hampered by the somewhat hidden 
nature of secretary matching/unmatching. 

I agree it's a shame to keep reinventing the wheel, but while I like secretary, 
I've never felt that it's approach was the be all end all. I appreciate some of 
the sentiment of if it ain't broke, don't fix it, but more good ideas in the 
mix only push us all to write better code. 

Dom, some questions and thoughts for improvement. 

If you define routes with :path and :query, will the route match/unmatch with 
undefined query keys? If so, how are they handled? If not, I'd suggest making 
query matching optional, where nils are substituted. 

It's a little unclear how your matching functions relate to route. It looks 
like Silk always breaks at / in path and matches, is that correct?

There are some really good things in secretary. What do you think about them? 

Splat, regex, format matchers. 

protocol based render function for multiple arity unmatching. this is really 
great.

and more I'm sure I'm missing

-- 
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: [ANN] core.async (and more) video tutorials

2014-06-05 Thread Dylan Butman
Thanks for doing these Tim! Very good stuff.

Would like to echo the above results for code. Can you put what you're 
working from on github for all the videos? I found myself wanting to use 
some of your pipeline stuff today and I'd rather not watch 20 minutes of 
video again to type it out

-- 
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] core.async (and more) video tutorials

2014-06-05 Thread Dylan Butman


 Thanks for doing these Tim! Very good stuff.

 Would like to echo the above requests for source code. Can you put what 
 you're working from on github for all the videos? I found myself wanting to 
 use some of your pipeline stuff today and I'd rather not watch 20 minutes 
 of video again to type it out


-- 
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: Re-evaluating recuring go blocks

2014-05-19 Thread Dylan Butman
Great!

I've used alts! before with control channels which is definitely useful as 
well. 

Timothy, can you elaborate a little? I'm still a little unclear when 
channels are garbage collected. It it an issue to leave channels open after 
you've stopped using them? I always feel a little strange constantly 
creating new channels to replace callbacks, blocking on their output, and 
then wondering whether or not I need to worry about closing them. If a 
channel falls out of scope is it garbage collected? How do go blocks affect 
scoping? 


-- 
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: Re-evaluating recuring go blocks

2014-05-19 Thread Dylan Butman
Yea that's very helpful. When you say the channel can never give them a 
value, is that because the channel is no longer in scope?

So 

(def c (chan))
(dotimes [x 10]
  (go (! c)))

would not be GC'd until the entire namespace is reevaluated? Would redefining c 
here cause the 10 GOs to be GC'd? I feel like I've done this before and ended 
up with duplicated actions...

On May 19, 2014, at 2:36 PM, Timothy Baldridge wrote:

 Channels are not tied to anything, so once your code stops referencing them, 
 they are garbage collected. 
 
 Go blocks are actually nothing more than pretty callbacks that are attached 
 to channels. So if a go is waiting for a put or a take from a channel, it 
 will be GC'd with the channel. I could go into the details here, but I'll say 
 it this way: if a channel could ever have a value again, it will not be GC'd 
 if there's no possible way for the channel to receive a value, then it will 
 be GC'd at some point. 
 
 For example:
 
 (dotimes [x 100]
   (let [c (chan)]
(dotimes [x 10]
  (go (! c)
 
 Here, all these gos will be GC'd they are parked on the channel, but the 
 channel can never give them a value, so once the channel is GC'd all the gos 
 will as well. 
 
 You can (ab)use this by simply re-defining your channels when you want to 
 throw away new state. The new channel will replace the old, and that channel 
 will be GC'd along with all the GOs that are waiting on it. 
 
 Now, this is all a bit different if you use the (thread) macro. In that case 
 threads are not GC'd (since the OS is holding on to them) so you'll need to 
 shut those down on your own. 
 
 Hopefully this  helps. 
 
 Timothy
 
 
 On Mon, May 19, 2014 at 12:23 PM, Dylan Butman dbut...@gmail.com wrote:
 Great!
 
 I've used alts! before with control channels which is definitely useful as 
 well. 
 
 Timothy, can you elaborate a little? I'm still a little unclear when channels 
 are garbage collected. It it an issue to leave channels open after you've 
 stopped using them? I always feel a little strange constantly creating new 
 channels to replace callbacks, blocking on their output, and then wondering 
 whether or not I need to worry about closing them. If a channel falls out of 
 scope is it garbage collected? How do go blocks affect scoping? 
 
 
 
 -- 
 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.
 
 
 
 -- 
 “One of the main causes of the fall of the Roman Empire was that–lacking 
 zero–they had no way to indicate successful termination of their C programs.”
 (Robert Firth)
 
 -- 
 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/xGWfw0O9kbU/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.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [ANN] Quil 2.0.0 released

2014-05-18 Thread Dylan Butman
Great news! Thanks Nikita!

On Sunday, May 18, 2014 6:59:00 AM UTC-4, Nikita Beloglazov wrote:

 Happy to announce release of Quil 2.0.0!

 To use Quil 2.0.0 update project.clj to following:

 :dependencies [...
[quil 2.0.0]]


 Major change is that Quil now uses latest Processing 2.2.0. Check release 
 notes https://github.com/quil/quil/blob/master/RELEASE-NOTES.md for 
 list of all other changes. Github repo https://github.com/quil/quil.

 Thanks everyone who helped with development of 2.0.0. Special thanks to 
 Maksim Karandashov who helped a lot with adding support of Processing 
 present mode and other features.

 Future plans: 

- Maksim is working on Quil on ClojureScript project as part of Google 
Summer of Code program. You'll be able to run Quil sketches in browser by 
the end of this summer!
- Support more functional-style sketches. 

 Happy hacking!

 Nikita


-- 
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-evaluating recuring go blocks

2014-05-18 Thread Dylan Butman
When working with channels and go blocks with nRepl, I often want to do 
something like this.

(def events (event-generator))
(go-loop []
 (when-let [event (! events)]
   (handle-event event)
   (recur)))

Sometime later I want to stop listening, so I

(close! events)

This is fine, but I often find myself with a lot of boilerplate around go 
blocks where I'm constantly closing the channel, redefining it, and then 
re-evaluating the go-block just to try a different behavior. If you 
re-evaluate the go-block without closing the channel, you'll get duplicate 
actions. Additionally, if your channel drops out of scope, or you didn't 
set an exit condition on the go block (using while true or something 
similar), you can end up with indefinite operations that are impossible to 
kill without restarting the repl (and does this actually stop the code from 
continuing to execute somewhere in java)?

I'm not very familiar with garbage collection, but is there some way to 
garbage collect blocks that have been re-evaluated? Does the treatment of 
re-evaluation depend on scope, ie. if you wrap it in a function, will it 
make a difference? 

I can imagine some function or macro that might close! and then re-create a 
channel everytime it's is called, maybe something like,

(defn my-chan (atom (chan)))
(defn test-chan []
  (close! @my-chan)
  (reset! my-chan (event-generator))
  (go-loop []
   (when-let [event (! events)]
 (handle-event event)
 (recur

But that doesn't really seem to reduce the complexity, since you'd have to 
define an atom for each of these types of functions. 

Thoughts?

Best
Dylan


-- 
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.