Re: Could I get some feedback on this function?

2014-07-25 Thread boz
I'm no Clojure guru, but why not just use set?
http://grimoire.arrdem.com/1.6.0/clojure.core/set/

But you want to get rid of the timestamp. Using map is probably right for 
that. So I think this is more idiomatic...

(defn only-keep-unique-ids [ids]
  (set (map #(get-form-id-without-timestamp %) ids)))

- boz


On Friday, July 25, 2014 2:32:43 PM UTC-7, Christopher Elwell wrote:
>
> New to Clojure, how is this function that I wrote? Any suggestions for 
> improvement; is it too complicated?
>
> It filters a sequence, leaving only the first occurrence of each item in 
> the seq that has a matching prefix (get-form-id-without-timestamp gets 
> just the id prefix).
>
> (defn only-keep-unique-ids [ids]
>   (let [seen-ids (atom #{})
> filter-fn #(let [raw-form-id (get-form-id-without-timestamp %)
>  is-unique (not (contains? @seen-ids raw-form-id))]
>  (do (swap! seen-ids conj raw-form-id)
>  is-unique))]
> (filter filter-fn ids)))
>
>
>
>

-- 
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: a data conversion question

2014-06-08 Thread boz
Wow! 'for' is a powerful thing!!
This is perfect! 

On Sunday, June 8, 2014 12:32:44 PM UTC-7, François Rey wrote:
>
>  (for [[k v] [[:a [1 2]] [:b [3 4]]]
>   n v]
>  [k n])
>
> 

-- 
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: a data conversion question

2014-06-08 Thread boz
Thanks for the replies!!

I goofed and only gave part of my loopy solution ... 
here's the whole thing

(defn do-one [id v]
  (loop [a (first v) r (rest v) result []]
(if a
  (recur (first r) (rest r) (conj result [id a]))
  result)))

(defn do-all [x]
  (loop [a (first x) b (rest x) result []]
(if a
  (recur (first b) (rest b) (into result (do-one (first a) (flatten 
(rest a)
  result)))


On Sunday, June 8, 2014 12:12:19 PM UTC-7, boz wrote:
>
> Is there a better way to take this...
>
> [[:a [1 2]] 
>  [:b [3 4]]]
>
> and convert it to this...
>
> [[:a 1] 
>  [:a 2] 
>  [:b 3] 
>  [:b 4]]
>
> than using a loop like this...
>
> (defn doit [id v]
>   (loop [a (first v) r (rest v) result []]
> (if a
>   (recur (first r) (rest r) (conj result [id a]))
>   result)))
>
> ???
>
> Thanks!
> ,boz
>

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


a data conversion question

2014-06-08 Thread boz
Is there a better way to take this...

[[:a [1 2]] 
 [:b [3 4]]]

and convert it to this...

[[:a 1] 
 [:a 2] 
 [:b 3] 
 [:b 4]]

than using a loop like this...

(defn doit [id v]
  (loop [a (first v) r (rest v) result []]
(if a
  (recur (first r) (rest r) (conj result [id a]))
  result)))

???

Thanks!
,boz

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


test.check :autotest ?

2014-05-05 Thread boz
Is there an :autotest for test.check with Leiningen?

Something like midje, where you can do: lein midje :autotest

Many thanks,
boz

-- 
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: Om: trouble with goog reference

2014-02-27 Thread boz
Hopefully it's helpful. :)

Here's a branch with the completed Basic tutorial. The commit log for the 
branch follows the Basic Tutorial.
https://github.com/christoferjennings/om-start-template/tree/om-0-5-0-tut/samples/om-0-5-0-tut

I still need to relaunch Cider occasionally. Basically every time the HTML 
files changes or the namespace of core.cljs changes. Don't know why.

,chris

On Thursday, February 27, 2014 10:50:03 AM UTC-8, David Nolen wrote:
>
> Many thanks for taking the time to implement & share your solution!
>
> David
>
>
> On Thu, Feb 27, 2014 at 1:40 PM, boz > wrote:
>
>> Hi David, Clifford,
>>
>> I'm pretty sure Clifford is using the Cider version from 
>> Mimmo<https://github.com/magomimmo/om-start-template/>. 
>> I've got a fork of 
>> it<https://github.com/christoferjennings/om-start-template>with updates so 
>> it work with Om 0.5.0 and React 0.9.0 that I've used to get 
>> through the basic tutorial so far. Clifford and I have talked about it 
>> here <https://github.com/magomimmo/om-start-template/issues/5> and there 
>> is a pull request <https://github.com/magomimmo/om-start-template/pull/6>. 
>>  When using the Cider version the HTML should actually look like this 
>> (using "om_ho.js" to match Clifford's)...
>>
>> 
>>   
>> 
>> http://fb.me/react-0.9.0.js"</a>;>
>> 
>>   
>> 
>>
>>
>> I plan to put some examples online asap, hopefully by tomorrow, so other 
>> newbies (like myself) can compare notes. ... One thing that I stumbled on 
>> was that the tutorial shows the whole HTML but really, afaik, the only 
>> change was the id of the div (from "app" to "registry").
>>
>> I'm having a lot of fun working on this stuff, btw. Om is very cool. 
>> Looking forward to getting into the intermediate tutorial with Datomic too 
>> :)
>>
>> ,chris
>>
>> On Thursday, February 27, 2014 6:03:22 AM UTC-8, David Nolen wrote:
>>
>>> Your markup needs to look something like:
>>>
>>> 
>>> http://fb.me/react-0.9.0.js"</a>;>
>>> 
>>> 
>>> goog.require("om_ho.core");
>>>
>>> HTH,
>>> David
>>>
>>>
>>> On Thu, Feb 27, 2014 at 6:26 AM, cig  wrote:
>>>
>>>> Hi David
>>>>
>>>> I tried changing :advanced mode to :whitespace mode. My index.html file 
>>>> looks as follows:
>>>>
>>>> 
>>>>   
>>>> 
>>>> http://fb.me/react-0.9.0.js"</a>;>
>>>> 
>>>>   
>>>> 
>>>>
>>>> my project.clj file looks as follows:
>>>> (defproject om-ho "0.0.1-SNAPSHOT"
>>>>   :description "FIXME: write description"
>>>>   :url "http://example.com/FIXME";
>>>>   :license {:name "Eclipse Public License - v 1.0"
>>>> :url "http://www.eclipse.org/legal/epl-v10.html";
>>>> :distribution :repo}
>>>>
>>>>   :min-lein-version "2.3.4"
>>>>
>>>>   :source-paths ["src/clj" "src/cljs"]
>>>>
>>>>   :dependencies [[org.clojure/clojure "1.5.1"]
>>>>  [org.clojure/clojurescript "0.0-2156"]
>>>>  [org.clojure/core.async "0.1.267.0-0d7780-alpha"]
>>>>  [om "0.5.0"]
>>>>  [com.facebook/react "0.9.0"]]
>>>>
>>>>   :plugins [[lein-cljsbuild "1.0.2"]]
>>>>
>>>>   :hooks [leiningen.cljsbuild]
>>>>
>>>>   :cljsbuild
>>>>   {:builds {:om-ho
>>>> {:source-paths ["src/cljs"]
>>>>  :compiler
>>>>  {:output-to "dev-resources/public/js/om_ho.js"
>>>>   :optimizations :none
>>>>   :pretty-print false)
>>>>
>>>> With this setup. Evaluating core.cljs (which is taken directly from 
>>>> your Higher Order Components tutorial) I see the, "XHR finished Loading" 
>>>> events in the browser, which is a good sign, but the only text which 
>>>> renders is, "Registry". I assume this is because of the missing 
>>>> goog.closure lines in the index.html fil

Re: Om: trouble with goog reference

2014-02-27 Thread boz
... should have mentioned, in case it's not obvious, I got through the 
basic tutorial using my fork of Mimmo's excellent work.
,chris (aka boz)

On Thursday, February 27, 2014 10:40:23 AM UTC-8, boz wrote:
>
> Hi David, Clifford,
>
> I'm pretty sure Clifford is using the Cider version from 
> Mimmo<https://github.com/magomimmo/om-start-template/>. 
> I've got a fork of 
> it<https://github.com/christoferjennings/om-start-template>with updates so it 
> work with Om 0.5.0 and React 0.9.0 that I've used to get 
> through the basic tutorial so far. Clifford and I have talked about it 
> here <https://github.com/magomimmo/om-start-template/issues/5> and there 
> is a pull request <https://github.com/magomimmo/om-start-template/pull/6>. 
>  When using the Cider version the HTML should actually look like this 
> (using "om_ho.js" to match Clifford's)...
>
> 
>   
> 
> http://fb.me/react-0.9.0.js"</a>;>
> 
>   
> 
>
>
> I plan to put some examples online asap, hopefully by tomorrow, so other 
> newbies (like myself) can compare notes. ... One thing that I stumbled on 
> was that the tutorial shows the whole HTML but really, afaik, the only 
> change was the id of the div (from "app" to "registry").
>
> I'm having a lot of fun working on this stuff, btw. Om is very cool. 
> Looking forward to getting into the intermediate tutorial with Datomic too 
> :)
>
> ,chris
>
> On Thursday, February 27, 2014 6:03:22 AM UTC-8, David Nolen wrote:
>>
>> Your markup needs to look something like:
>>
>> 
>> http://fb.me/react-0.9.0.js"</a>;>
>> 
>> 
>> goog.require("om_ho.core");
>>
>> HTH,
>> David
>>
>>
>> On Thu, Feb 27, 2014 at 6:26 AM, cig  wrote:
>>
>>> Hi David
>>>
>>> I tried changing :advanced mode to :whitespace mode. My index.html file 
>>> looks as follows:
>>>
>>> 
>>>   
>>> 
>>> http://fb.me/react-0.9.0.js"</a>;>
>>> 
>>>   
>>> 
>>>
>>> my project.clj file looks as follows:
>>> (defproject om-ho "0.0.1-SNAPSHOT"
>>>   :description "FIXME: write description"
>>>   :url "http://example.com/FIXME";
>>>   :license {:name "Eclipse Public License - v 1.0"
>>> :url "http://www.eclipse.org/legal/epl-v10.html";
>>> :distribution :repo}
>>>
>>>   :min-lein-version "2.3.4"
>>>
>>>   :source-paths ["src/clj" "src/cljs"]
>>>
>>>   :dependencies [[org.clojure/clojure "1.5.1"]
>>>  [org.clojure/clojurescript "0.0-2156"]
>>>  [org.clojure/core.async "0.1.267.0-0d7780-alpha"]
>>>  [om "0.5.0"]
>>>  [com.facebook/react "0.9.0"]]
>>>
>>>   :plugins [[lein-cljsbuild "1.0.2"]]
>>>
>>>   :hooks [leiningen.cljsbuild]
>>>
>>>   :cljsbuild
>>>   {:builds {:om-ho
>>> {:source-paths ["src/cljs"]
>>>  :compiler
>>>  {:output-to "dev-resources/public/js/om_ho.js"
>>>   :optimizations :none
>>>   :pretty-print false)
>>>
>>> With this setup. Evaluating core.cljs (which is taken directly from your 
>>> Higher Order Components tutorial) I see the, "XHR finished Loading" events 
>>> in the browser, which is a good sign, but the only text which renders is, 
>>> "Registry". I assume this is because of the missing goog.closure lines in 
>>> the index.html file
>>>
>>> i.e.
>>> 
>>> goog.require("om_ho.core");
>>>
>>> When I include these two lines I get the same errors that Chris 
>>> mentioned above.
>>>
>>> Would really appreciate your help.
>>>
>>> Clifford
>>>
>>> On Monday, 24 February 2014 03:22:22 UTC+2, boz wrote:
>>>>
>>>> I'm having trouble with the Om basic tutorial Higher Order 
>>>> Components<https://github.com/swannodette/om/wiki/Basic-Tutorial#wiki-higher-order-components>
>>>>  using 
>>>> emacs and a slightly modified version of https://github.com/
>>>> magomimmo/om-start-template that points to Om 0.5.0 and React 0.9.0.
>>>> My version is https://github.com/christoferjennings/om-start-template
>>>>
>>>> The template doesn't have the goog/base.js out of the box. When I add 
>>>> it, I get a "Uncaught ReferenceError: goog is not defined" (Chrome Version 
>>>> 33.0.1750.117)
>>>>
>>>> Here's the final html (basically the same as in the tutorial.
>>>> 
>>>> 
>>>> 
>>>> http://fb.me/react-0.9.0.js"</a>;>
>>>> 
>>>> 
>>>> 

Re: Om: trouble with goog reference

2014-02-27 Thread boz
Hi David, Clifford,

I'm pretty sure Clifford is using the Cider version from 
Mimmo<https://github.com/magomimmo/om-start-template/>. 
I've got a fork of 
it<https://github.com/christoferjennings/om-start-template>with updates so it 
work with Om 0.5.0 and React 0.9.0 that I've used to get 
through the basic tutorial so far. Clifford and I have talked about it 
here<https://github.com/magomimmo/om-start-template/issues/5> and 
there is a pull request<https://github.com/magomimmo/om-start-template/pull/6>. 
 When using the Cider version the HTML should actually look like this 
(using "om_ho.js" to match Clifford's)...


  

http://fb.me/react-0.9.0.js"</a>;>

  



I plan to put some examples online asap, hopefully by tomorrow, so other 
newbies (like myself) can compare notes. ... One thing that I stumbled on 
was that the tutorial shows the whole HTML but really, afaik, the only 
change was the id of the div (from "app" to "registry").

I'm having a lot of fun working on this stuff, btw. Om is very cool. 
Looking forward to getting into the intermediate tutorial with Datomic too 
:)

,chris

On Thursday, February 27, 2014 6:03:22 AM UTC-8, David Nolen wrote:
>
> Your markup needs to look something like:
>
> 
> http://fb.me/react-0.9.0.js"</a>;>
> 
> 
> goog.require("om_ho.core");
>
> HTH,
> David
>
>
> On Thu, Feb 27, 2014 at 6:26 AM, cig  >wrote:
>
>> Hi David
>>
>> I tried changing :advanced mode to :whitespace mode. My index.html file 
>> looks as follows:
>>
>> 
>>   
>> 
>> http://fb.me/react-0.9.0.js"</a>;>
>> 
>>   
>> 
>>
>> my project.clj file looks as follows:
>> (defproject om-ho "0.0.1-SNAPSHOT"
>>   :description "FIXME: write description"
>>   :url "http://example.com/FIXME";
>>   :license {:name "Eclipse Public License - v 1.0"
>> :url "http://www.eclipse.org/legal/epl-v10.html";
>> :distribution :repo}
>>
>>   :min-lein-version "2.3.4"
>>
>>   :source-paths ["src/clj" "src/cljs"]
>>
>>   :dependencies [[org.clojure/clojure "1.5.1"]
>>  [org.clojure/clojurescript "0.0-2156"]
>>  [org.clojure/core.async "0.1.267.0-0d7780-alpha"]
>>  [om "0.5.0"]
>>  [com.facebook/react "0.9.0"]]
>>
>>   :plugins [[lein-cljsbuild "1.0.2"]]
>>
>>   :hooks [leiningen.cljsbuild]
>>
>>   :cljsbuild
>>   {:builds {:om-ho
>> {:source-paths ["src/cljs"]
>>  :compiler
>>  {:output-to "dev-resources/public/js/om_ho.js"
>>   :optimizations :none
>>   :pretty-print false)
>>
>> With this setup. Evaluating core.cljs (which is taken directly from your 
>> Higher Order Components tutorial) I see the, "XHR finished Loading" events 
>> in the browser, which is a good sign, but the only text which renders is, 
>> "Registry". I assume this is because of the missing goog.closure lines in 
>> the index.html file
>>
>> i.e.
>> 
>> goog.require("om_ho.core");
>>
>> When I include these two lines I get the same errors that Chris mentioned 
>> above.
>>
>> Would really appreciate your help.
>>
>> Clifford
>>
>> On Monday, 24 February 2014 03:22:22 UTC+2, boz wrote:
>>>
>>> I'm having trouble with the Om basic tutorial Higher Order 
>>> Components<https://github.com/swannodette/om/wiki/Basic-Tutorial#wiki-higher-order-components>
>>>  using 
>>> emacs and a slightly modified version of https://github.com/
>>> magomimmo/om-start-template that points to Om 0.5.0 and React 0.9.0.
>>> My version is https://github.com/christoferjennings/om-start-template
>>>
>>> The template doesn't have the goog/base.js out of the box. When I add 
>>> it, I get a "Uncaught ReferenceError: goog is not defined" (Chrome Version 
>>> 33.0.1750.117)
>>>
>>> Here's the final html (basically the same as in the tutorial.
>>> 
>>> 
>>> 
>>> http://fb.me/react-0.9.0.js"</a>;>
>>> 
>>> 
>>> 

Om: trouble with goog reference

2014-02-23 Thread boz
I'm having trouble with the Om basic tutorial Higher Order 
Components
 using 
emacs and a slightly modified version 
of https://github.com/magomimmo/om-start-template that points to Om 0.5.0 
and React 0.9.0.
My version is https://github.com/christoferjennings/om-start-template

The template doesn't have the goog/base.js out of the box. When I add it, I 
get a "Uncaught ReferenceError: goog is not defined" (Chrome Version 
33.0.1750.117)

Here's the final html (basically the same as in the tutorial.



http://fb.me/react-0.9.0.js";>


goog.require("my-stuff.core");



There is no "out/goog/base.js", so I'm not too surprised goog is undefined. I'm 
stumped, though, because I don't know if the goog stuff that ends up in the 
.repl folder should be enough, or if I have to do something special to get 
the goog stuff to be in the out folder. I've tried "lein cljsbuild once" 
without luck.

Any ideas on what I'm doing wrong?

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/groups/opt_out.


Re: ANN: Om 0.4.0

2014-02-15 Thread boz
Thanks David! 

I get this on a fresh clone (commit 
7327bcdc17a665d5fde66376bfef9aa2b21c675a)
   Compiling "examples/tests/main.js" failed.
   java.io.FileNotFoundException: examples/tests/src (No such file or 
directory)

$ mkdir examples/tests/src
and build again works fine. 

--- long version ---
bozs-mbp:~/dev/clojure/temp/om (master|169m) $ lein cljsbuild once
Compiling ClojureScript.
Compiling "script/tests.simple.js" from ["src" "test"]...
Successfully compiled "script/tests.simple.js" in 15.829 seconds.
Compiling "examples/hello/main.js" from ["src" "examples/hello/src"]...
Successfully compiled "examples/hello/main.js" in 4.091 seconds.
Compiling "examples/mouse/main.js" from ["src" "examples/mouse/src"]...
WARNING: No such namespace: goog.events.EventType at line 23 
examples/mouse/src/core.cljs
Successfully compiled "examples/mouse/main.js" in 6.781 seconds.
Compiling "examples/multiroot/main.js" from ["src" 
"examples/multiroot/src"]...
Successfully compiled "examples/multiroot/main.js" in 3.775 seconds.
Compiling "examples/counters/main.js" from ["src" 
"examples/counters/src"]...
Successfully compiled "examples/counters/main.js" in 5.824 seconds.
Compiling "examples/animation/main.js" from ["src" 
"examples/animation/src"]...
Successfully compiled "examples/animation/main.js" in 3.538 seconds.
Compiling "examples/shared/main.js" from ["src" "examples/shared/src"]...
Successfully compiled "examples/shared/main.js" in 3.533 seconds.
Compiling "examples/typeahead/main.js" from ["src" 
"examples/typeahead/src"]...
WARNING: Extending an existing JavaScript type - use a different symbol 
name instead of js/String e.g string at line 29 
examples/typeahead/src/core.cljs
WARNING: Extending an existing JavaScript type - use a different symbol 
name instead of js/Number e.g number at line 39 
examples/typeahead/src/core.cljs
Successfully compiled "examples/typeahead/main.js" in 3.577 seconds.
Compiling "examples/sortable/main.js" from ["src" 
"examples/sortable/src"]...
Successfully compiled "examples/sortable/main.js" in 5.916 seconds.
Compiling "examples/graft/main.js" from ["src" "examples/graft/src"]...
Successfully compiled "examples/graft/main.js" in 3.459 seconds.
Compiling "examples/tests/main.js" from ["src" "examples/tests/src"]...
Compiling "examples/tests/main.js" failed.
java.io.FileNotFoundException: examples/tests/src (No such file or 
directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:138)
at clojure.java.io$fn__8638.invoke(io.clj:233)
...
Subprocess failed
bozs-mbp:~/dev/clojure/temp/om (master|170m) $ mkdir examples/tests/src
bozs-mbp:~/dev/clojure/temp/om (master|171m) $ lein cljsbuild once 
Compiling ClojureScript.
Compiling "examples/tests/main.js" from ["src" "examples/tests/src"]...
Successfully compiled "examples/tests/main.js" in 7.81 seconds.

On Thursday, February 13, 2014 10:02:50 PM UTC-8, David Nolen wrote:
>
> Happy to announce a new release of Om. There are some breaking changes 
> mostly to make the API more uniform - om.core/root was needlessly different 
> from om.core/build.
>
> The biggest and most exciting change is the inclusion of the :tx-listen 
> option to om.core/root. This will setup a callback which will be invoked 
> whenever an app state transaction occurs. This function will receive a map 
> tx-data which will include the :path that changed, :old-value and 
> :new-value on that path, :new-state and :old-state which is the entire 
> application (useful for rollbacks), and :tag if one was provided by the 
> transact! / update! call.
>
> It's extremely powerful to make a subscribeable channel out of this and 
> share it over your entire application via om.core/root's :shared option. 
> This is exactly what the reusable om-sync component does http.://
> github.com/swannodette/om-sync.
>
> For a full list of changes, bug fixes, and enhancements:
>
> http://github.com/swannodette/om/blob/master/CHANGES.md
>
> Feedback welcome!
>
> David
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
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/groups/opt_out.


Re: having trouble with lein-ring :auto-refresh?

2014-02-06 Thread boz
Just realized I had name changes ... correction ... changed original to ...


(defn ring-handler [request]
  {:status 200
   :headers {"Content-Type" "text/html"}
   :body (str "" x "change this text" 
"")})

And. Of course. I'll change those string tags to hiccup asap :)
 

On Thursday, February 6, 2014 9:25:30 AM UTC-8, boz wrote:
>
> Thanks James!
>
> That was it. Changed my original handler to this and it works perfectly
>
> (defn ring-handler [request]
>   {:status 200
>:headers {"Content-Type" "text/html"}
>:body (str "" header "change this text" 
> "")})
>
>  
>
>
> On Thursday, February 6, 2014 9:03:25 AM UTC-8, James Reeves wrote:
>>
>> The :auto-refresh option adds in the ring-refresh middleware, which 
>> injects Javascript into HTML pages to automatically refresh the page when 
>> notified.
>>
>> The HTML page needs to be of content-type "text/html", and should be 
>> well-formed with a  element.
>>
>> Try checking the source code of the HTML page being served to see if it's 
>> correctly injecting the script.
>>
>> - James
>>
>>
>> On 6 February 2014 16:41, boz  wrote:
>>
>>> I'm starting to think my expectations are wrong and the :auto-refresh? 
>>> doesn't make the browser refresh. I've never seen it work so what do I 
>>> know. :)
>>> I tried making a new project using the compojure template...
>>>
>>> $ lein new compojure godoggo 
>>>
>>>
>>> I then changed its project.clj to include the :auto-refresh? setting...
>>>
>>> (defproject godoggo "0.1.0-SNAPSHOT"
>>>   :description "FIXME: write description"
>>>   :url "http://example.com/FIXME";
>>>   :dependencies [[org.clojure/clojure "1.5.1"]
>>>  [compojure "1.1.6"]]
>>>   :plugins [[lein-ring "0.8.10"]]
>>>   :ring {:handler godoggo.handler/app
>>>  *:auto-refresh? true*}
>>>   :profiles
>>>   {:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
>>> [ring-mock "0.1.5"]]}})  
>>>
>>>
>>>  Ran the server...
>>>
>>> $ lein ring server  
>>>
>>>
>>> The page pops up in my browser OK. But changes 
>>> to src/godoggo/handler.clj do not show p unless I refresh manually. 
>>> ... So have I just got it wrong? Does :auto-refresh? do something else?
>>>
>>> ???
>>> boz
>>>
>>> On Wednesday, February 5, 2014 11:16:21 PM UTC-8, boz wrote:
>>>>
>>>> Hi,
>>>>
>>>> I've set up lein-ring with ring :auto-refresh? true but don't see 
>>>> updates in the browser unless I refresh manually. It seems I have 
>>>> something 
>>>> configured wrong but I can't see it. Does this look right?...
>>>>
>>>> (defproject mystuff "0.1.0-SNAPSHOT"
>>>>   :description "experiment"
>>>>   :url "http://example.com/FIXME";
>>>>   :license {:name "Eclipse Public License"
>>>> :url "http://www.eclipse.org/legal/epl-v10.html"}
>>>>   :dependencies [[org.clojure/clojure "1.5.1"]
>>>>  [hiccup "1.0.5"]]
>>>>   :plugins [[lein-ring "0.8.10"]]
>>>>:ring {:handler mystuff.core/ring-handler
>>>>  :auto-reload? true
>>>>  :auto-refresh? true}
>>>>   :target-path "target/%s")
>>>>
>>>>
>>>> My ring-handler function is basically a copy of the hello world one on 
>>>> ring's site, but the body comes from a defined value.
>>>>
>>>> (def x (html [:h1 ("hello")]))
>>>>
>>>> (defn ring-handler [request]
>>>>   {:status 200
>>>>:headers {"Content-Type" "text/html"}
>>>>:body x})
>>>>
>>>>
>>>> The :auto-reload? true works as expected. But not :auto-refresh? true.
>>>>
>>>> I'm after the live coding experience here. And I want it to be with 
>>>> lein-ring if I can. 
>>>> (I tried Daniel Szmulewicz's cool emacs way but I think lein-ring will 
>>>> fit my needs better.)
>>>>
>>>>

Re: having trouble with lein-ring :auto-refresh?

2014-02-06 Thread boz
Thanks James!

That was it. Changed my original handler to this and it works perfectly

(defn ring-handler [request]
  {:status 200
   :headers {"Content-Type" "text/html"}
   :body (str "" header "change this text" 
"")})

 


On Thursday, February 6, 2014 9:03:25 AM UTC-8, James Reeves wrote:
>
> The :auto-refresh option adds in the ring-refresh middleware, which 
> injects Javascript into HTML pages to automatically refresh the page when 
> notified.
>
> The HTML page needs to be of content-type "text/html", and should be 
> well-formed with a  element.
>
> Try checking the source code of the HTML page being served to see if it's 
> correctly injecting the script.
>
> - James
>
>
> On 6 February 2014 16:41, boz > wrote:
>
>> I'm starting to think my expectations are wrong and the :auto-refresh? 
>> doesn't make the browser refresh. I've never seen it work so what do I 
>> know. :)
>> I tried making a new project using the compojure template...
>>
>> $ lein new compojure godoggo 
>>
>>
>> I then changed its project.clj to include the :auto-refresh? setting...
>>
>> (defproject godoggo "0.1.0-SNAPSHOT"
>>   :description "FIXME: write description"
>>   :url "http://example.com/FIXME";
>>   :dependencies [[org.clojure/clojure "1.5.1"]
>>  [compojure "1.1.6"]]
>>   :plugins [[lein-ring "0.8.10"]]
>>   :ring {:handler godoggo.handler/app
>>  *:auto-refresh? true*}
>>   :profiles
>>   {:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
>>     [ring-mock "0.1.5"]]}})  
>>
>>
>>  Ran the server...
>>
>> $ lein ring server  
>>
>>
>> The page pops up in my browser OK. But changes to src/godoggo/handler.clj 
>> do not show p unless I refresh manually. 
>> ... So have I just got it wrong? Does :auto-refresh? do something else?
>>
>> ???
>> boz
>>
>> On Wednesday, February 5, 2014 11:16:21 PM UTC-8, boz wrote:
>>>
>>> Hi,
>>>
>>> I've set up lein-ring with ring :auto-refresh? true but don't see 
>>> updates in the browser unless I refresh manually. It seems I have something 
>>> configured wrong but I can't see it. Does this look right?...
>>>
>>> (defproject mystuff "0.1.0-SNAPSHOT"
>>>   :description "experiment"
>>>   :url "http://example.com/FIXME";
>>>   :license {:name "Eclipse Public License"
>>> :url "http://www.eclipse.org/legal/epl-v10.html"}
>>>   :dependencies [[org.clojure/clojure "1.5.1"]
>>>  [hiccup "1.0.5"]]
>>>   :plugins [[lein-ring "0.8.10"]]
>>>:ring {:handler mystuff.core/ring-handler
>>>  :auto-reload? true
>>>  :auto-refresh? true}
>>>   :target-path "target/%s")
>>>
>>>
>>> My ring-handler function is basically a copy of the hello world one on 
>>> ring's site, but the body comes from a defined value.
>>>
>>> (def x (html [:h1 ("hello")]))
>>>
>>> (defn ring-handler [request]
>>>   {:status 200
>>>:headers {"Content-Type" "text/html"}
>>>:body x})
>>>
>>>
>>> The :auto-reload? true works as expected. But not :auto-refresh? true.
>>>
>>> I'm after the live coding experience here. And I want it to be with 
>>> lein-ring if I can. 
>>> (I tried Daniel Szmulewicz's cool emacs way but I think lein-ring will 
>>> fit my needs better.)
>>>
>>> confuzzled,
>>> boz
>>>
>>>  -- 
>> 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/groups/opt_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/groups/opt_out.


Re: having trouble with lein-ring :auto-refresh?

2014-02-06 Thread boz
I'm starting to think my expectations are wrong and the :auto-refresh? 
doesn't make the browser refresh. I've never seen it work so what do I 
know. :)
I tried making a new project using the compojure template...

$ lein new compojure godoggo 


I then changed its project.clj to include the :auto-refresh? setting...

(defproject godoggo "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME";
  :dependencies [[org.clojure/clojure "1.5.1"]
 [compojure "1.1.6"]]
  :plugins [[lein-ring "0.8.10"]]
  :ring {:handler godoggo.handler/app
 *:auto-refresh? true*}
  :profiles
  {:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
[ring-mock "0.1.5"]]}})  


Ran the server...

$ lein ring server  


The page pops up in my browser OK. But changes to src/godoggo/handler.clj 
do not show p unless I refresh manually. 
... So have I just got it wrong? Does :auto-refresh? do something else?

???
boz

On Wednesday, February 5, 2014 11:16:21 PM UTC-8, boz wrote:
>
> Hi,
>
> I've set up lein-ring with ring :auto-refresh? true but don't see updates 
> in the browser unless I refresh manually. It seems I have something 
> configured wrong but I can't see it. Does this look right?...
>
> (defproject mystuff "0.1.0-SNAPSHOT"
>   :description "experiment"
>   :url "http://example.com/FIXME";
>   :license {:name "Eclipse Public License"
> :url "http://www.eclipse.org/legal/epl-v10.html"}
>   :dependencies [[org.clojure/clojure "1.5.1"]
>  [hiccup "1.0.5"]]
>   :plugins [[lein-ring "0.8.10"]]
>   :ring {:handler mystuff.core/ring-handler
>  :auto-reload? true
>  :auto-refresh? true}
>   :target-path "target/%s")
>
>
> My ring-handler function is basically a copy of the hello world one on 
> ring's site, but the body comes from a defined value.
>
> (def x (html [:h1 ("hello")]))
>
> (defn ring-handler [request]
>   {:status 200
>:headers {"Content-Type" "text/html"}
>:body x})
>
>
> The :auto-reload? true works as expected. But not :auto-refresh? true.
>
> I'm after the live coding experience here. And I want it to be with 
> lein-ring if I can. 
> (I tried Daniel Szmulewicz's cool emacs way but I think lein-ring will fit 
> my needs better.)
>
> confuzzled,
> boz
>
>

-- 
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/groups/opt_out.


having trouble with lein-ring :auto-refresh?

2014-02-05 Thread boz
Hi,

I've set up lein-ring with ring :auto-refresh? true but don't see updates 
in the browser unless I refresh manually. It seems I have something 
configured wrong but I can't see it. Does this look right?...

(defproject mystuff "0.1.0-SNAPSHOT"
  :description "experiment"
  :url "http://example.com/FIXME";
  :license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
 [hiccup "1.0.5"]]
  :plugins [[lein-ring "0.8.10"]]
  :ring {:handler mystuff.core/ring-handler
 :auto-reload? true
 :auto-refresh? true}
  :target-path "target/%s")


My ring-handler function is basically a copy of the hello world one on 
ring's site, but the body comes from a defined value.

(def x (html [:h1 ("hello")]))

(defn ring-handler [request]
  {:status 200
   :headers {"Content-Type" "text/html"}
   :body x})


The :auto-reload? true works as expected. But not :auto-refresh? true.

I'm after the live coding experience here. And I want it to be with 
lein-ring if I can. 
(I tried Daniel Szmulewicz's cool emacs way but I think lein-ring will fit 
my needs better.)

confuzzled,
boz

-- 
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/groups/opt_out.


Re: Debugging with Cider

2014-01-08 Thread boz
I'd like to see Ritz with cider too. :)

Just for reference...
there is already an issue on the Ritz 
repo: https://github.com/pallet/ritz/issues/112
and there are a number of Ritz related issues on the Cider repo: 
https://github.com/clojure-emacs/cider/search?q=ritz&ref=cmdform&type=Issues 

On Thursday, October 31, 2013 12:17:52 PM UTC-7, Matthew O. Smith wrote:
>
>
> Hi all,
>
> Has anyone gotten debugging in emacs working with cider (was nrepl).  I 
> did fork and update cljdb but it is pretty old school. 
> https://github.com/m0smith/cljdb
> Is there any work on ritz or cdt?
>
> 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/groups/opt_out.


Re: Clojure west?

2013-12-28 Thread boz
I know it's not January yet :) but any firm date set?
thanks!
chris

On Saturday, December 14, 2013 7:21:33 PM UTC-8, Alex Miller wrote:
>
> Clojure/West will be in San Francisco this year. We are working on a 
> contract for the last week in March but this IS NOT YET a firm date. We 
> will of course post here when we have a date/venue details. I expect the 
> CFP to open in early January.
>
> Alex
>
> On Saturday, December 14, 2013 12:20:29 AM UTC-6, puzzler wrote:
>>
>> Any word yet on when/where Clojure West 2014 will be held?
>>
>

-- 
-- 
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/groups/opt_out.


Re: [ANN] Recursd - Functional Programming Conference in San Diego

2013-12-09 Thread boz
Just registered!
Thanks! Looking forward to it!

!!! :)

On Monday, December 9, 2013 8:04:05 AM UTC-8, Ron Toland wrote:
>
> Recursd  is a one day technical conference on 
> functional programming.
>
> Join other programmers and enthusiasts Saturday January 18th, 2014, to 
> take part in presentations and workshops about functional programming 
> languages and applications.
>
> Recursd will be held in Central San Diego at the Ansir Innovation Center.
>
> Registrationis
>  $10 before Jan 4, 2014, and $20 after.
>
> Presenters receive free admission. To submit a proposal, contact us at: 
> rec...@gmail.com 
>
> Hope to see you there!
>
> Ron
>

-- 
-- 
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/groups/opt_out.


Re: [ANN] Pedestal-app Tutorial has been released

2013-07-15 Thread boz jennings
Having fun going through the tutorial! Thanks for the good stuff!
,boz

On Tuesday, July 9, 2013 9:03:58 AM UTC-7, Ryan Neufeld wrote:
>
> Hey there, Clojurians/Pedestallions! 
>
> I'm pleased to announce the release of a comprehensive tutorial for 
> pedestal-app: http://bit.ly/pedestal-app-tutorial. In this tutorial we 
> finally *dive deep* into the guts of pedestal-app and build a distributed 
> multiplayer game using pedestal-app. 
>
> Major kudos to @brentonashworth for all his hard work on the pedestal-app 
> tutorial. 
>
> Enjoy!
>
> -- Ryan Neufeld 
>
>
> -- Ryan Neufeld 
>
>

-- 
-- 
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/groups/opt_out.