Re: Resources don't work in uberjar

2015-01-27 Thread Jeroen van Dijk
Hi Dan,

Not sure if there are better options, but I know `slurp` does work on
resources in jars. You could (ab)use `spit` to do the copying.

HTH,
Jeroen

On Tue, Jan 27, 2015 at 3:24 AM, Dan Harbin  wrote:

> I've created a sample project at Github[1] to demonstrate the problem I'm 
> facing with accessing a resource file when using an uberjar.  Could someone 
> point out what I'm doing wrong here?  Thanks!
>
>
> [1]: https://github.com/RasterBurn/halp
>
>
> ### Given this code: ###
>
> ```clojure
> (ns halp.core
>   (:require [clojure.java.io :as io])
>   (:gen-class))
>
> (defn -main
>   "I don't do a whole lot ... yet."
>   [& args]
>   (-> "hi.txt"
>   io/resource
>   io/file
>   (io/copy *out*)))
> ```
>
> ### It runs well under leiningen ###
>
> ```
> ➜  halp  lein run
> .
> ─▄──▄
> ▌▒█───▄▀▒▌
> ▌▒▒▀▄───▄▀▒▒▒▐
> ───▐▄▀▒▒▄▄▄▀▒▐
> ─▄▄▀▒▒▒█▒▒▄█▒▐
> ───▄▀▒▒▒▀██▀▒▌
> ──▐▒▒▒▄▄▄▒▀▄▒▒▌
> ──▌▒▒▐▄█▀▄▀█▄▒▒▒█▒▐
> ─▐▒▒▒▌██▀▀▄▌
> ─▌▒▀▄██▄▒▒▒▌
> ─▌▀▐▄█▄█▌▄▒▀▒▒░░▒▒▒▐
> ▐▒▀▐▀▐▀▒▒▄▄▒▄▒░░▌
> ▐▒▒▒▀▀▄▄▒▒▒▄▒▒░░▒▒▒▐
> ─▌▒▒▀▀▀▌
> ─▐▐
> ──▀▄▒▄▌
> ▀▄▒▒▄▄▄▀▄▀
> ───▐▀▒▀▄▄▀▀▀▒▄▄▀
> ──▐▀▀
> ```
>
> ### But not so much as an uberjar #
>
> ```
> ➜  halp  java -jar target/uberjar/halp-0.1.0-SNAPSHOT-standalone.jar
> Exception in thread "main" java.lang.IllegalArgumentException: Not a file: 
> jar:file:/home/vagrant/code/halp/target/uberjar/halp-0.1.0-SNAPSHOT-standalone.jar!/hi.txt
> at clojure.java.io$fn__8588.invoke(io.clj:63)
> at clojure.java.io$fn__8572$G__8556__8577.invoke(io.clj:35)
> at clojure.java.io$file.invoke(io.clj:414)
> at halp.core$_main.doInvoke(core.clj:11)
> at clojure.lang.RestFn.invoke(RestFn.java:397)
> at clojure.lang.AFn.applyToHelper(AFn.java:152)
> at clojure.lang.RestFn.applyTo(RestFn.java:132)
> at halp.core.main(Unknown Source)
> ```
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hi I am a new user of clojure ,I am not being able to use lein

2015-01-27 Thread Niels van Klaveren
There are some problems with the lein MSI and Chocolaty installs, because 
of wget/curl certificate handling on Windows. If you use lein.bat without 
wget or curl (you can remove wget or curl exes from the lein.bat 
directory), lein will default to Powershell for downloading which works as 
intended.

Regards,

Niels 

On Monday, January 26, 2015 at 10:48:07 AM UTC+1, Bis wrote:
>
> I am trying from some time but cant install lein.
>
> Tried with the MSI installer and it finishes properly but no repl is 
> created neither lein
> tried with lein.bat ,getting errors everytime ,
> "Exception calling Downloadfile with two arguement.the remote server 
> returned an error 403 forbidden.(set http client to "wget" and tried also 
> ,btw lein.bat is taken from the official site so not sure if the official 
> version of the bat file is trying to get some unstable release or not )
> tried with chocolatey but chocolatey tries to install JDK 7 and its 
> failing ,although I have JDK8 in my system 
> Please some one help to debug ,I am getting frustrated 
>

-- 
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] Introducing semantic-csv, a tool for higher-level CSV parsing/processing functionality

2015-01-27 Thread Christopher Small
Hi everyone

I'm pleased to announce the release of 
[semantic-csv](https://github.com/metasoarous/semantic-csv), a humble 
library for working with CSV data.

Existing Clojure libraries for working with CSV data 
([clojure.data.csv](https://github.com/clojure/data.csv) and 
[clojure-csv](https://github.com/davidsantiago/clojure-csv) being the most 
notable), only concern themselves with the _syntax_ of CSV; They take CSV 
text, transform it into a collection of vectors of string values (or when 
writing, write from a sequence of string vectors), and that's it.  Semantic 
CSV takes the next step by giving you tools for addressing the _semantics_ 
of your data, helping you put it into the form that better reflects what it 
means, and make it easier to work with.

## Features

* Absorb header row as a vector of column names, and return remaining rows 
as maps of `column-name -> row-val`
* Write from a collection of maps, given a header
* Apply casting/formatting functions by column name, while reading or 
writing
* Remove commented out lines (by default, those starting with `#`)
* Compatible with any CSV parsing library returning/writing a sequence of 
row vectors
* (SOON) A "sniffer" that reads in N lines, and uses them to guess column 
types

### Structure

Semantic CSV is structured around a number of composable processing 
functions for transforming data as it comes out of or goes into a CSV file. 
This 
leaves room for you to use whatever parsing/formatting tools you like, 
reflecting a nice decoupling of grammar and semantics.  However, a couple 
of convenience functions are also provided which wrap these individual 
steps in an opinionated but customizable manner, helping you move quickly 
while prototyping or working at the REPL.

## Where you come in

Semantic CSV is still in alpha, but I'm excited to start getting people 
using it and providing feedback.  I'm particularly interested at this phase 
in hearing what people think of the overall structure, what pain points 
come up, and what features would be nice.  And bugs of course.  Feel free 
to submit feedback via [Github 
issues](https://github.com/metasoarous/semantic-csv/issues) or the [project 
chat room](https://gitter.im/metasoarous/semantic-csv).

https://github.com/metasoarous/semantic-csv




Thanks for your time; I hope you find this useful.

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


[ANN] Introducing semantic-csv, a tool for higher-level CSV parsing/processing functionality

2015-01-27 Thread Christopher Small


Hi everyone

I’m pleased to announce the release of semantic-csv 
, a humble library for working 
with CSV data.

Existing Clojure libraries for working with CSV data (clojure.data.csv 
 and clojure-csv 
 being the most notable), 
only concern themselves with the *syntax* of CSV; They take CSV text, 
transform it into a collection of vectors of string values (or when 
writing, write from a sequence of string vectors), and that’s it. Semantic 
CSV takes the next step by giving you tools for addressing the *semantics* 
of your data, helping you put it into the form that better reflects what it 
means, and make it easier to work with.
Features 
   
   - Absorb header row as a vector of column names, and return remaining 
   rows as maps of column-name -> row-val 
   - Write from a collection of maps, given a header 
   - Apply casting/formatting functions by column name, while reading or 
   writing 
   - Remove commented out lines (by default, those starting with #) 
   - Compatible with any CSV parsing library returning/writing a sequence 
   of row vectors 
   - (SOON) A “sniffer” that reads in N lines, and uses them to guess 
   column types 

Structure 

Semantic CSV is structured around a number of composable processing 
functions for transforming data as it comes out of or goes into a CSV file. 
This leaves room for you to use whatever parsing/formatting tools you like, 
reflecting a nice decoupling of grammar and semantics. However, a couple of 
convenience functions are also provided which wrap these individual steps 
in an opinionated but customizable manner, helping you move quickly while 
prototyping or working at the REPL.
Where you come in 

Semantic CSV is still in alpha, but I’m excited to start getting people 
using it and providing feedback. I’m particularly interested at this phase 
in hearing what people think of the overall structure, what pain points 
come up, and what features would be nice. And bugs of course. Feel free to 
submit feedback via Github issues 
 or the project chat 
room .

https://github.com/metasoarous/semantic-csv


Thanks for your time; I hope you find this useful.

Chris 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: Resources don't work in uberjar

2015-01-27 Thread Benjamin VanRyseghem
I face something similar.




The issue was that inside a jar file, a resource is not a java.io.File anymore.




I could turn around using an InputStream (I was in the case I wanted to serve a 
resource via http-kit)




If you want more info, I can point you to the code where I use it




Hope it helps,

Ben

On Tue, Jan 27, 2015 at 5:04 AM, Dan Harbin  wrote:

> I've created a sample project at Github[1] to demonstrate the problem I'm 
> facing with accessing a resource file when using an uberjar.  Could someone 
> point out what I'm doing wrong here?  Thanks!
> [1]: https://github.com/RasterBurn/halp
> ### Given this code: ###
> ```clojure
> (ns halp.core
>   (:require [clojure.java.io :as io])
>   (:gen-class))
> (defn -main
>   "I don't do a whole lot ... yet."
>   [& args]
>   (-> "hi.txt"
>   io/resource
>   io/file
>   (io/copy *out*)))
> ```
> ### It runs well under leiningen ###
> ```
> ➜  halp  lein run
> .
> ─▄──▄
> ▌▒█───▄▀▒▌
> ▌▒▒▀▄───▄▀▒▒▒▐
> ───▐▄▀▒▒▄▄▄▀▒▐
> ─▄▄▀▒▒▒█▒▒▄█▒▐
> ───▄▀▒▒▒▀██▀▒▌
> ──▐▒▒▒▄▄▄▒▀▄▒▒▌
> ──▌▒▒▐▄█▀▄▀█▄▒▒▒█▒▐
> ─▐▒▒▒▌██▀▀▄▌
> ─▌▒▀▄██▄▒▒▒▌
> ─▌▀▐▄█▄█▌▄▒▀▒▒░░▒▒▒▐
> ▐▒▀▐▀▐▀▒▒▄▄▒▄▒░░▌
> ▐▒▒▒▀▀▄▄▒▒▒▄▒▒░░▒▒▒▐
> ─▌▒▒▀▀▀▌
> ─▐▐
> ──▀▄▒▄▌
> ▀▄▒▒▄▄▄▀▄▀
> ───▐▀▒▀▄▄▀▀▀▒▄▄▀
> ──▐▀▀
> ```
> ### But not so much as an uberjar #
> ```
> ➜  halp  java -jar target/uberjar/halp-0.1.0-SNAPSHOT-standalone.jar
> Exception in thread "main" java.lang.IllegalArgumentException: Not a file: 
> jar:file:/home/vagrant/code/halp/target/uberjar/halp-0.1.0-SNAPSHOT-standalone.jar!/hi.txt
> at clojure.java.io$fn__8588.invoke(io.clj:63)
> at clojure.java.io$fn__8572$G__8556__8577.invoke(io.clj:35)
> at clojure.java.io$file.invoke(io.clj:414)
> at halp.core$_main.doInvoke(core.clj:11)
> at clojure.lang.RestFn.invoke(RestFn.java:397)
> at clojure.lang.AFn.applyToHelper(AFn.java:152)
> at clojure.lang.RestFn.applyTo(RestFn.java:132)
> at halp.core.main(Unknown Source)
> ```
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Resources don't work in uberjar

2015-01-27 Thread Dan Harbin
Ben, I would appreciate it if you'd show me the sample code.  Thanks for 
your help, everyone!

On Tuesday, January 27, 2015 at 6:28:59 AM UTC-6, Benjamin VanRyseghem 
wrote:
>
> I face something similar.
>
> The issue was that inside a jar file, a resource is not a java.io.File 
> anymore.
>
> I could turn around using an InputStream (I was in the case I wanted to 
> serve a resource via http-kit)
>
> If you want more info, I can point you to the code where I use it
>
> Hope it helps,
> Ben
>
>
>
>
> On Tue, Jan 27, 2015 at 5:04 AM, Dan Harbin  > wrote:
>
>> I've created a sample project at Github[1] to demonstrate the problem I'm 
>> facing with accessing a resource file when using an uberjar.  Could someone 
>> point out what I'm doing wrong here?  Thanks!
>>
>>
>> [1]: https://github.com/RasterBurn/halp
>>
>>
>> ### Given this code: ###
>>
>> ```clojure
>> (ns halp.core
>>   (:require [clojure.java.io :as io])
>>   (:gen-class))
>>
>> (defn -main
>>   "I don't do a whole lot ... yet."
>>   [& args]
>>   (-> "hi.txt"
>>   io/resource
>>   io/file
>>   (io/copy *out*)))
>> ```
>>
>> ### It runs well under leiningen ###
>>
>> ```
>> ➜  halp  lein run
>> .
>> ─▄──▄
>> ▌▒█───▄▀▒▌
>> ▌▒▒▀▄───▄▀▒▒▒▐
>> ───▐▄▀▒▒▄▄▄▀▒▐
>> ─▄▄▀▒▒▒█▒▒▄█▒▐
>> ───▄▀▒▒▒▀██▀▒▌
>> ──▐▒▒▒▄▄▄▒▀▄▒▒▌
>> ──▌▒▒▐▄█▀▄▀█▄▒▒▒█▒▐
>> ─▐▒▒▒▌██▀▀▄▌
>> ─▌▒▀▄██▄▒▒▒▌
>> ─▌▀▐▄█▄█▌▄▒▀▒▒░░▒▒▒▐
>> ▐▒▀▐▀▐▀▒▒▄▄▒▄▒░░▌
>> ▐▒▒▒▀▀▄▄▒▒▒▄▒▒░░▒▒▒▐
>> ─▌▒▒▀▀▀▌
>> ─▐▐
>> ──▀▄▒▄▌
>> ▀▄▒▒▄▄▄▀▄▀
>> ───▐▀▒▀▄▄▀▀▀▒▄▄▀
>> ──▐▀▀
>> ```
>>
>> ### But not so much as an uberjar #
>>
>> ```
>> ➜  halp  java -jar target/uberjar/halp-0.1.0-SNAPSHOT-standalone.jar
>> Exception in thread "main" java.lang.IllegalArgumentException: Not a file: 
>> jar:file:/home/vagrant/code/halp/target/uberjar/halp-0.1.0-SNAPSHOT-standalone.jar!/hi.txt
>> at clojure.java.io$fn__8588.invoke(io.clj:63)
>> at clojure.java.io$fn__8572$G__8556__8577.invoke(io.clj:35)
>> at clojure.java.io$file.invoke(io.clj:414)
>> at halp.core$_main.doInvoke(core.clj:11)
>> at clojure.lang.RestFn.invoke(RestFn.java:397)
>> at clojure.lang.AFn.applyToHelper(AFn.java:152)
>> at clojure.lang.RestFn.applyTo(RestFn.java:132)
>> at halp.core.main(Unknown Source)
>> ```
>>
>>  -- 
>> 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.


Re: [ANN] Introducing semantic-csv, a tool for higher-level CSV parsing/processing functionality

2015-01-27 Thread Sébastien Orban
Wow, nearly perfect timing for me - lot of csv to parse, and transform into 
their final destination (mostly map with correctly asserted/cast value - 
some with instaparse, joy of badly separated data). So, cast-with is very 
appreciated !

Seem to cover everything - even lazy loading so... what's not to like ?

On Tuesday, January 27, 2015 at 10:24:21 AM UTC+1, Christopher Small wrote:
>
> Hi everyone
>
> I’m pleased to announce the release of semantic-csv 
> , a humble library for 
> working with CSV data.
>
> Existing Clojure libraries for working with CSV data (clojure.data.csv 
>  and clojure-csv 
>  being the most notable), 
> only concern themselves with the *syntax* of CSV; They take CSV text, 
> transform it into a collection of vectors of string values (or when 
> writing, write from a sequence of string vectors), and that’s it. Semantic 
> CSV takes the next step by giving you tools for addressing the *semantics* 
> of your data, helping you put it into the form that better reflects what it 
> means, and make it easier to work with.
> Features 
>
>- Absorb header row as a vector of column names, and return remaining 
>rows as maps of column-name -> row-val 
>- Write from a collection of maps, given a header 
>- Apply casting/formatting functions by column name, while reading or 
>writing 
>- Remove commented out lines (by default, those starting with #) 
>- Compatible with any CSV parsing library returning/writing a sequence 
>of row vectors 
>- (SOON) A “sniffer” that reads in N lines, and uses them to guess 
>column types 
>
> Structure 
>
> Semantic CSV is structured around a number of composable processing 
> functions for transforming data as it comes out of or goes into a CSV file. 
> This leaves room for you to use whatever parsing/formatting tools you like, 
> reflecting a nice decoupling of grammar and semantics. However, a couple of 
> convenience functions are also provided which wrap these individual steps 
> in an opinionated but customizable manner, helping you move quickly while 
> prototyping or working at the REPL.
> Where you come in 
>
> Semantic CSV is still in alpha, but I’m excited to start getting people 
> using it and providing feedback. I’m particularly interested at this phase 
> in hearing what people think of the overall structure, what pain points 
> come up, and what features would be nice. And bugs of course. Feel free to 
> submit feedback via Github issues 
>  or the project chat 
> room .
>
> https://github.com/metasoarous/semantic-csv
>
>
> Thanks for your time; I hope you find this useful.
>
> Chris 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: Resources don't work in uberjar

2015-01-27 Thread Benjamin VanRyseghem
The code can be found here: 
https://github.com/teamwall/teamwall/blob/develop/src/server/teamwall/api.clj#L85


Here I used to do something like `io/as-file path-to-my-file`

but it failed because it’s not resolved as a file anymore when it’s jarred




Good luck,

Ben

On Tue, Jan 27, 2015 at 2:00 PM, Dan Harbin  wrote:

> Ben, I would appreciate it if you'd show me the sample code.  Thanks for 
> your help, everyone!
> On Tuesday, January 27, 2015 at 6:28:59 AM UTC-6, Benjamin VanRyseghem 
> wrote:
>>
>> I face something similar.
>>
>> The issue was that inside a jar file, a resource is not a java.io.File 
>> anymore.
>>
>> I could turn around using an InputStream (I was in the case I wanted to 
>> serve a resource via http-kit)
>>
>> If you want more info, I can point you to the code where I use it
>>
>> Hope it helps,
>> Ben
>>
>>
>>
>>
>> On Tue, Jan 27, 2015 at 5:04 AM, Dan Harbin > > wrote:
>>
>>> I've created a sample project at Github[1] to demonstrate the problem I'm 
>>> facing with accessing a resource file when using an uberjar.  Could someone 
>>> point out what I'm doing wrong here?  Thanks!
>>>
>>>
>>> [1]: https://github.com/RasterBurn/halp
>>>
>>>
>>> ### Given this code: ###
>>>
>>> ```clojure
>>> (ns halp.core
>>>   (:require [clojure.java.io :as io])
>>>   (:gen-class))
>>>
>>> (defn -main
>>>   "I don't do a whole lot ... yet."
>>>   [& args]
>>>   (-> "hi.txt"
>>>   io/resource
>>>   io/file
>>>   (io/copy *out*)))
>>> ```
>>>
>>> ### It runs well under leiningen ###
>>>
>>> ```
>>> ➜  halp  lein run
>>> .
>>> ─▄──▄
>>> ▌▒█───▄▀▒▌
>>> ▌▒▒▀▄───▄▀▒▒▒▐
>>> ───▐▄▀▒▒▄▄▄▀▒▐
>>> ─▄▄▀▒▒▒█▒▒▄█▒▐
>>> ───▄▀▒▒▒▀██▀▒▌
>>> ──▐▒▒▒▄▄▄▒▀▄▒▒▌
>>> ──▌▒▒▐▄█▀▄▀█▄▒▒▒█▒▐
>>> ─▐▒▒▒▌██▀▀▄▌
>>> ─▌▒▀▄██▄▒▒▒▌
>>> ─▌▀▐▄█▄█▌▄▒▀▒▒░░▒▒▒▐
>>> ▐▒▀▐▀▐▀▒▒▄▄▒▄▒░░▌
>>> ▐▒▒▒▀▀▄▄▒▒▒▄▒▒░░▒▒▒▐
>>> ─▌▒▒▀▀▀▌
>>> ─▐▐
>>> ──▀▄▒▄▌
>>> ▀▄▒▒▄▄▄▀▄▀
>>> ───▐▀▒▀▄▄▀▀▀▒▄▄▀
>>> ──▐▀▀
>>> ```
>>>
>>> ### But not so much as an uberjar #
>>>
>>> ```
>>> ➜  halp  java -jar target/uberjar/halp-0.1.0-SNAPSHOT-standalone.jar
>>> Exception in thread "main" java.lang.IllegalArgumentException: Not a file: 
>>> jar:file:/home/vagrant/code/halp/target/uberjar/halp-0.1.0-SNAPSHOT-standalone.jar!/hi.txt
>>> at clojure.java.io$fn__8588.invoke(io.clj:63)
>>> at clojure.java.io$fn__8572$G__8556__8577.invoke(io.clj:35)
>>> at clojure.java.io$file.invoke(io.clj:414)
>>> at halp.core$_main.doInvoke(core.clj:11)
>>> at clojure.lang.RestFn.invoke(RestFn.java:397)
>>> at clojure.lang.AFn.applyToHelper(AFn.java:152)
>>> at clojure.lang.RestFn.applyTo(RestFn.java:132)
>>> at halp.core.main(Unknown Source)
>>> ```
>>>
>>>  -- 
>>> 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.

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

Re: Convenient memoization with destructured arguments

2015-01-27 Thread David James
Thanks for mentioning it, Rob. (I have looked at Prismatic Graph before. 
Putting arguments in a graph (at macro time) is a powerful idea; plumbing 
uses this to offer a declarative way to offer various evaluation 
strategies. It is nice to show off Clojure macros! In this case, it makes 
Clojure feel more like Haskell or other lazily-evaluated languages.)

When it comes to the use case I showed above, I don't think Graph would 
address the core problem of memoization. Graph has a memoization function, 
but it does not work with a graph to track cross-function arguments, like I 
would need in my example above. Perhaps it could be extended to do so. 
Perhaps it would be easier to roll my own.

I'm still interested in having a discussion about all of the questions I 
asked:

   - Have others faced [the many arguments vs one composed thing, such as a 
   map or object] tradeoff?
   - How do you think about it?
   - How do you strike a balance, if there is one?
   - More pointedly, is there a way to get the best of both worlds (e.g. 
   the "composed" argument style AND memoization)?
   

-- 
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: Resources don't work in uberjar

2015-01-27 Thread David James
You may find value in reading this:
From: 
http://docs.oracle.com/javase/8/docs/technotes/guides/lang/resources.html

> Methods in the classes Class and ClassLoader provide a 
location-independent way to locate resources.

On Tuesday, January 27, 2015 at 9:12:23 AM UTC-5, Benjamin VanRyseghem 
wrote:
>
> The code can be found here: 
> https://github.com/teamwall/teamwall/blob/develop/src/server/teamwall/api.clj#L85
>
> Here I used to do something like `io/as-file path-to-my-file`
> but it failed because it’s not resolved as a file anymore when it’s jarred
>
> Good luck,
> Ben
>
>
>
>
> On Tue, Jan 27, 2015 at 2:00 PM, Dan Harbin  > wrote:
>
>> Ben, I would appreciate it if you'd show me the sample code.  Thanks for 
>> your help, everyone!
>>
>> On Tuesday, January 27, 2015 at 6:28:59 AM UTC-6, Benjamin VanRyseghem 
>> wrote:
>>>
>>> I face something similar.
>>>
>>> The issue was that inside a jar file, a resource is not a java.io.File 
>>> anymore.
>>>
>>> I could turn around using an InputStream (I was in the case I wanted to 
>>> serve a resource via http-kit)
>>>
>>> If you want more info, I can point you to the code where I use it
>>>
>>> Hope it helps,
>>> Ben
>>>
>>>
>>>
>>>
>>> On Tue, Jan 27, 2015 at 5:04 AM, Dan Harbin  wrote:
>>>
 I've created a sample project at Github[1] to demonstrate the problem I'm 
 facing with accessing a resource file when using an uberjar.  Could 
 someone point out what I'm doing wrong here?  Thanks!


 [1]: https://github.com/RasterBurn/halp


 ### Given this code: ###

 ```clojure
 (ns halp.core
   (:require [clojure.java.io :as io])
   (:gen-class))

 (defn -main
   "I don't do a whole lot ... yet."
   [& args]
   (-> "hi.txt"
   io/resource
   io/file
   (io/copy *out*)))
 ```

 ### It runs well under leiningen ###

 ```
 ➜  halp  lein run
 .
 ─▄──▄
 ▌▒█───▄▀▒▌
 ▌▒▒▀▄───▄▀▒▒▒▐
 ───▐▄▀▒▒▄▄▄▀▒▐
 ─▄▄▀▒▒▒█▒▒▄█▒▐
 ───▄▀▒▒▒▀██▀▒▌
 ──▐▒▒▒▄▄▄▒▀▄▒▒▌
 ──▌▒▒▐▄█▀▄▀█▄▒▒▒█▒▐
 ─▐▒▒▒▌██▀▀▄▌
 ─▌▒▀▄██▄▒▒▒▌
 ─▌▀▐▄█▄█▌▄▒▀▒▒░░▒▒▒▐
 ▐▒▀▐▀▐▀▒▒▄▄▒▄▒░░▌
 ▐▒▒▒▀▀▄▄▒▒▒▄▒▒░░▒▒▒▐
 ─▌▒▒▀▀▀▌
 ─▐▐
 ──▀▄▒▄▌
 ▀▄▒▒▄▄▄▀▄▀
 ───▐▀▒▀▄▄▀▀▀▒▄▄▀
 ──▐▀▀
 ```

 ### But not so much as an uberjar #

 ```
 ➜  halp  java -jar target/uberjar/halp-0.1.0-SNAPSHOT-standalone.jar
 Exception in thread "main" java.lang.IllegalArgumentException: Not a file: 
 jar:file:/home/vagrant/code/halp/target/uberjar/halp-0.1.0-SNAPSHOT-standalone.jar!/hi.txt
 at clojure.java.io$fn__8588.invoke(io.clj:63)
 at clojure.java.io$fn__8572$G__8556__8577.invoke(io.clj:35)
 at clojure.java.io$file.invoke(io.clj:414)
 at halp.core$_main.doInvoke(core.clj:11)
 at clojure.lang.RestFn.invoke(RestFn.java:397)
 at clojure.lang.AFn.applyToHelper(AFn.java:152)
 at clojure.lang.RestFn.applyTo(RestFn.java:132)
 at halp.core.main(Unknown Source)
 ```

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

Re: [ClojureScript] Re: ANN: Om 0.8.6, Hello CLJSJS

2015-01-27 Thread David Nolen
I think expecting every last thing to work especially from third parties
who may be wisely lagging behind is unlikely at least for the near future.

I haven't kept up with Light Table and what issues it may have. Now is
probably a good time to remove the Light Table centric nature of the Om
tutorials and switch to a Figwheel based thing that doesn't require
anything more than your text editor of choice.

The wiki has always been community editable and I would love to see people
push it forward especially with stuff like this. I will have less time for
such things as I focus more on Om core and ClojureScript enhancements.

David

On Tue, Jan 27, 2015 at 10:46 AM, Olav Nymoen  wrote:

> Just testing clojurescript out so many possible pitfalls on my side here.
>
> Does the new javascript externals stuff break lighttables live external
> browser functionality?
>
> Following the basic intro tutorial I cannot get live updates to work. The
> mies-om om-tut is based on 0.8.4 , and it cannot reference
> com.facebook.react, while 0.8.6 cannot find cljsjs.react.
>
> It compiles nicely with lein, but I can't seem to get the lighttable live
> REPL stuff to work.
>
> Olav
>
> On Tuesday, January 27, 2015 at 1:57:19 AM UTC+1, David Nolen wrote:
> > The only significant change is that Om now relies on the cljsjs.react
> artifact instead of the one I maintained myself. cljsjs.react has the
> benefit that usage of React with addons instead of plain React may be
> configured via Maven in your pom.xml or your project.clj. It's exciting to
> see that we are already reaping the benefits of :foreign-libs and Maven
> over existing JavaScript solutions for managing dependencies.
> >
> >
> > This release also includes a fix for a very subtle set-state! bug
> discovered by Brenton Ashworth.
> >
> >
> >
> > Feedback welcome!
> >
> >
> > https://github.com/swannodette/om
> >
> >
> >
> > David
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.
>

-- 
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: Hi I am a new user of clojure ,I am not being able to use lein

2015-01-27 Thread Mark Hinshaw
Did you install with this http://leiningen-win-installer.djpowell.net/ ?

This is what I used.  I did have to make sure that the batch file was added 
to my PATH.  I don't believe the installer does that, but I could be wrong 
(it's been a while).
The bat file is located in C:/User//.lein/bin
Also make sure that lein command is recognized after adding it.  If not, 
check and make sure your PATH string is not too long.  Windows limits the 
length of your PATH string (which is one of its many pain points regarding 
cmd tools).
Then like Denis mentioned, run "lein self-install".

Hope this helps

On Monday, January 26, 2015 at 4:48:07 AM UTC-5, Bis wrote:
>
> I am trying from some time but cant install lein.
>
> Tried with the MSI installer and it finishes properly but no repl is 
> created neither lein
> tried with lein.bat ,getting errors everytime ,
> "Exception calling Downloadfile with two arguement.the remote server 
> returned an error 403 forbidden.(set http client to "wget" and tried also 
> ,btw lein.bat is taken from the official site so not sure if the official 
> version of the bat file is trying to get some unstable release or not )
> tried with chocolatey but chocolatey tries to install JDK 7 and its 
> failing ,although I have JDK8 in my system 
> Please some one help to debug ,I am getting frustrated 
>

-- 
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] Introducing semantic-csv, a tool for higher-level CSV parsing/processing functionality

2015-01-27 Thread Christopher Small
Fabulous. I'm glad you'll find it useful :-)

Chris


On Jan 27, 2015 6:11 AM, "Sébastien Orban"  wrote:

> Wow, nearly perfect timing for me - lot of csv to parse, and transform
> into their final destination (mostly map with correctly asserted/cast value
> - some with instaparse, joy of badly separated data). So, cast-with is very
> appreciated !
>
> Seem to cover everything - even lazy loading so... what's not to like ?
>
> On Tuesday, January 27, 2015 at 10:24:21 AM UTC+1, Christopher Small wrote:
>>
>> Hi everyone
>>
>> I’m pleased to announce the release of semantic-csv
>> , a humble library for
>> working with CSV data.
>>
>> Existing Clojure libraries for working with CSV data (clojure.data.csv
>>  and clojure-csv
>>  being the most notable),
>> only concern themselves with the *syntax* of CSV; They take CSV text,
>> transform it into a collection of vectors of string values (or when
>> writing, write from a sequence of string vectors), and that’s it. Semantic
>> CSV takes the next step by giving you tools for addressing the
>> *semantics* of your data, helping you put it into the form that better
>> reflects what it means, and make it easier to work with.
>> Features
>>
>>- Absorb header row as a vector of column names, and return remaining
>>rows as maps of column-name -> row-val
>>- Write from a collection of maps, given a header
>>- Apply casting/formatting functions by column name, while reading or
>>writing
>>- Remove commented out lines (by default, those starting with #)
>>- Compatible with any CSV parsing library returning/writing a
>>sequence of row vectors
>>- (SOON) A “sniffer” that reads in N lines, and uses them to guess
>>column types
>>
>> Structure
>>
>> Semantic CSV is structured around a number of composable processing
>> functions for transforming data as it comes out of or goes into a CSV file.
>> This leaves room for you to use whatever parsing/formatting tools you like,
>> reflecting a nice decoupling of grammar and semantics. However, a couple of
>> convenience functions are also provided which wrap these individual steps
>> in an opinionated but customizable manner, helping you move quickly while
>> prototyping or working at the REPL.
>> Where you come in
>>
>> Semantic CSV is still in alpha, but I’m excited to start getting people
>> using it and providing feedback. I’m particularly interested at this phase
>> in hearing what people think of the overall structure, what pain points
>> come up, and what features would be nice. And bugs of course. Feel free to
>> submit feedback via Github issues
>>  or the project chat
>> room .
>>
>> https://github.com/metasoarous/semantic-csv
>>
>>
>> Thanks for your time; I hope you find this useful.
>>
>> Chris 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 a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/bmxEwImkfTQ/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: Resources don't work in uberjar

2015-01-27 Thread Marshall Bockrath-Vandegrift
On Monday, January 26, 2015 at 9:24:28 PM UTC-5, Dan Harbin wrote:
>
>
>   io/file
>
>
Just delete that line.  The `io/resource` function returns a URL which all 
the Clojure IO functions can handle just fine-as is.  When running in 
development the URL happens to be a `file://` URL, and thus something 
`io/file` can handle.  Once the resource is in a JAR that is no longer the 
case, and hence exceptions.  Just don't require a file when any URL will do 
and you'll be fine.

-Marshall

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


vertigo question

2015-01-27 Thread Ryan Waters
In working with vertigo I've found the need to parameterize the struct
field I wish to examine.  Unfortunately vertigo doesn't seem to like vars
in its macros.  For example:

- - - -
;; vs is 'vertigo.structs and vc is 'vertigo.core

(vs/def-typed-struct mystruct :ints (vs/array vs/uint32 10))
(def ^:mystruct vert (vc/marshal-seq mystruct [{:ints (range 10)}]))

(vc/get-in vert [0 :ints 1])
1  ;; works, returns 1

(let [^clojure.lang.Keyword x :ints] (vc/get-in vert [0 x 1]))
CompilerException java.lang.IllegalArgumentException: 'x' is assumed to be
numeric, which isn't accepted by mystruct,
compiling:(form-init1370835477311955482.clj:1:38)


- - - -
I originally ran into this when using vc/over within vc/doreduce.  I'm
using vertigo 0.1.3.

Thanks!
Ryan

-- 
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] Re: ANN: Om 0.8.6, Hello CLJSJS

2015-01-27 Thread Daniel Kersten
A figwheel-based tutorial would be fantastic.

I don't have an awful lot of time to convert it right now, but if nobody
does before I do get time, I'll happily take a stab at it. Will likely be a
month or two though.

On 27 January 2015 at 16:24, David Nolen  wrote:

> I think expecting every last thing to work especially from third parties
> who may be wisely lagging behind is unlikely at least for the near future.
>
> I haven't kept up with Light Table and what issues it may have. Now is
> probably a good time to remove the Light Table centric nature of the Om
> tutorials and switch to a Figwheel based thing that doesn't require
> anything more than your text editor of choice.
>
> The wiki has always been community editable and I would love to see people
> push it forward especially with stuff like this. I will have less time for
> such things as I focus more on Om core and ClojureScript enhancements.
>
> David
>
> On Tue, Jan 27, 2015 at 10:46 AM, Olav Nymoen  wrote:
>
>> Just testing clojurescript out so many possible pitfalls on my side here.
>>
>> Does the new javascript externals stuff break lighttables live external
>> browser functionality?
>>
>> Following the basic intro tutorial I cannot get live updates to work. The
>> mies-om om-tut is based on 0.8.4 , and it cannot reference
>> com.facebook.react, while 0.8.6 cannot find cljsjs.react.
>>
>> It compiles nicely with lein, but I can't seem to get the lighttable live
>> REPL stuff to work.
>>
>> Olav
>>
>> On Tuesday, January 27, 2015 at 1:57:19 AM UTC+1, David Nolen wrote:
>> > The only significant change is that Om now relies on the cljsjs.react
>> artifact instead of the one I maintained myself. cljsjs.react has the
>> benefit that usage of React with addons instead of plain React may be
>> configured via Maven in your pom.xml or your project.clj. It's exciting to
>> see that we are already reaping the benefits of :foreign-libs and Maven
>> over existing JavaScript solutions for managing dependencies.
>> >
>> >
>> > This release also includes a fix for a very subtle set-state! bug
>> discovered by Brenton Ashworth.
>> >
>> >
>> >
>> > Feedback welcome!
>> >
>> >
>> > https://github.com/swannodette/om
>> >
>> >
>> >
>> > David
>>
>> --
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "ClojureScript" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojurescript+unsubscr...@googlegroups.com.
>> To post to this group, send email to clojurescr...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/clojurescript.
>>
>
>  --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.
>

-- 
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: Om 0.8.6, Hello CLJSJS

2015-01-27 Thread David Nolen
Just released Om 0.8.7. The only change was bumping the cljsjs.react
dependency to get proper externs support.

David

On Mon, Jan 26, 2015 at 7:57 PM, David Nolen  wrote:

> The only significant change is that Om now relies on the cljsjs.react
> artifact instead of the one I maintained myself. cljsjs.react has the
> benefit that usage of React with addons instead of plain React may be
> configured via Maven in your pom.xml or your project.clj. It's exciting to
> see that we are already reaping the benefits of :foreign-libs and Maven
> over existing JavaScript solutions for managing dependencies.
>
> This release also includes a fix for a very subtle set-state! bug
> discovered by Brenton Ashworth.
>
> Feedback welcome!
>
> https://github.com/swannodette/om
>
> 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/d/optout.


alternatives to component (like) systems

2015-01-27 Thread Huey Petersen
Hello,

I just started writing my first non-toy clojure program and I'm curious how 
people handle global resources without component (or component like) 
systems.  I plan to make use of component but I'm trying to add new 
concepts one by one.

As an example I have a scheduler (quartzile):

(def scheduler (qs/intialize))

(defn -main [& args]
  (qs/start scheduler))

So this works and I can access the scheduler instance in my REPL to poke at 
it while I'm developing.

I then do lein uberjar and it won't compile :).  The compiler is executing 
the qs/initialize function which is no good.

So I could move that initialize inside of main:

(def -main [& args]
  (-> (qs/intialize) (qs/start)))

But I've now lost a global reference to poke at the scheduler.

Instead I used alter-var-root, which I've seen before, but until now 
actually had no idea what it really did...

(def scheduler)

(def -main [& args]
  (alter-var-root #'scheduler (fn [old] (qs/initialize)))
  (qs/start scheduler))

So this seems nasty, but lein uberjar is happy.

Anyways, I'm just curious of what the alternatives are to manage this 
outside of a component type system (which I plan to use!).

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.


Clojurescript :advanced compilation extern only partly working.

2015-01-27 Thread Crispin Wellington
Hi there,

I have been trying to compile some audio code in clojurescript in advanced 
mode. I have setup the w3c_audio.js extern (from: 
http://closureplease.com/externs/) into my extern list. When I compile, it 
prevents the munging of "AudioContext" (without the extern, this is being 
munged, so the extern is 'working'). But it doesn't prevent the munging of 
methods on AudioContext object. 

A super minimal example (but not working code):

(def audio-context (js/AudioContext.))
(.decodeAudioData audio-context "data" #(println "ok" %) #(println "error" 
%))

compiles with advanced to:

;var zv = new AudioContext;
zv.Rd("data", function(a) {
  return fo.c(mh([a], 0));
}, function() {
  return(0).call(null);
});

zv.Rd is wrong. It should be zv.decodeAudioData.

The externs file does indeed have this function prototype. here are the 
excerpts:

/**
 * @constructor
 */
var AudioContext = function() {};



/**
 * @param {ArrayBuffer} audioData
 * @param {Function} successCallback
 * @param {Function=} errorCallback
 */
AudioContext.prototype.decodeAudioData = function(audioData, 
successCallback,
errorCallback) {};

Why would closure compiler protect the AudioContext name, but munge the 
decodeAudioData name? What am I doing wrong?

Regards

Crispin Wellington


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


alternatives to component (like) systems

2015-01-27 Thread Mike Haney
I can say from experience that it's quite a bit easier to use component from 
the beginning than to retrofit it, plus it solves the problem of controlling 
startup order quite nicely (among others).  If you're planning on using 
component anyway, you might as well bite the bullet and start with it now.  As 
a bonus, you'll have a smoother workflow with the reloaded pattern, and you can 
use prebuilt components from juxt/modular or danielsz/system for a lot of 
common services you are likely to need, which saves you more time.

It's not that hard to pick up - a good starting point is Stuart's Clojure West 
talk from last year (on YouTube).  There are also several lein templates out 
there that will get you up and running quickly.  And you can learn a lot just 
reading through the source of components in those libraries I mentioned.

If you still have problems, feel free to ask and someone will be able to help 
you out.  A lot of people use component and related libs, and I've seen 
excellent answers to component questions on here before (so a search of the 
list archives might be in order too).

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