Re: Clojure - Python Style suggestion

2013-02-06 Thread Max Gonzih
Actually I think python style indention will over-complicate code. When 
writing python style clojure you will always need to think in which clojure 
with parentheses it will be transformed.

Personally I love parentheses. Imho Lisp is easy and S-expressions are 
awesome :)

On Monday, February 4, 2013 11:01:30 PM UTC+3, Sergey Didenko wrote:
>
> Hi, 
>
> For us as Clojure community it is easy to see how Clojure benefits 
> from being a Lisp. Homoiconity, extreme conciseness, esoteric look and 
> feel, etc. 
>
> However it is hard to see from the inside how Clojure as ecosystem 
> (probably) suffer from being a Lisp. Please don't throw rotten eggs at 
> me, I mean only the part of Lisp that is ... parentheses. 
>
> I remember a number of people that mention parentheses as obstacles to 
> the wider Clojure adoption, in the Clojure space - in the Clojure 
> related discussions, even on this mailing list IIRC. 
>
> But the number of people thinking this way outside the Clojure groups 
> is even bigger! We probably don't notice it because got immune to this 
> famous argument "it has too many parentheses" early when diving into 
> Clojure. 
>
> I suggest there are a big number of people that could gain interest in 
> clojure if we provide them with parentheses-lite Clojure syntax. For 
> example we can steal Python way of intending blocks. 
>
> For example the following quicksort implementation 
>
> (defn qsort [[pivot & xs]] 
>   (when pivot 
> (let [smaller #(< % pivot)] 
>   (lazy-cat (qsort (filter smaller xs)) 
> [pivot] 
> (qsort (remove smaller xs)) 
>
> could be written as 
>
> (set! python-style-op-op true) 
>
> defn qsort [[pivot & xs]] 
>   when pivot 
> let [smaller #(< % pivot)] 
>   lazy-cat 
> qsort 
>   filter smaller xs 
> [pivot] 
> qsort 
>   remove smaller xs 
>
> What do you think? 
>
> Isn't is less complex? 
>
>
> P.S. Ok, I must confess, the mention of the C-Word in the last 
> sentence was just a desperate way to get Rich's attention. 
>
> P.P.S. Actually I would also love to see Clojure community making 
> video clip "Clojure - Python Style" as a remix for "G... Style", but 
> this idea is probably way ahead of its time. 
>
>
> Regards, Sergey. 
>

-- 
-- 
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: Tawny-OWL 0.9

2013-02-06 Thread Phillip Lord
Michael Klishin  writes:

> 2013/2/5 Phillip Lord 
>
>> Although, it's been available for a while, this is the first release
>> that I have announced here. I'd welcome feedback.
>>
>
> Phillip,
>
> Please add dependency (artifacts) information to the README.
> Otherwise beginners won't be able to use your project.


You mean "what is the name of this library as maven artifact"? Rather
than it's dependencies. 

I've added this to the documentation; this needs expanding anyway,
because its poor at the moment. 

Phil

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

2013-02-06 Thread Michael Wood
On 6 February 2013 05:52, John Gabriele  wrote:

> On Tuesday, February 5, 2013 12:08:43 PM UTC-5, AtKaaZ wrote:
>
>> you can release that on LGPL License ?
>> does that work with the EPL of clojure ? or is it only an issue when lein
>> uberjar-ed ?
>>
>
> LGPL just means that the library itself is copyleft (if you make changes
> to it, and distribute the modified library, you've got to distribute your
> changes along with it (under the same conditions) as well).
>

See also http://www.gnu.org/licenses/lgpl-java.html

Here's an excerpt:

"If you distribute a Java application that imports LGPL libraries, it's
easy to comply with the LGPL. Your application's license needs to allow
users to modify the library, and reverse engineer your code to debug these
modifications."


> Issues of license compatibility generally only come up when you're linking
> to *GPL* (not LGPL) libs/apps.
>
> Incidentally, Phillip, in your license notice you say the lib is LGPL, but
> then just below it say it's GPL. Also, it doesn't look like you've included
> the full text of the license in the project. I've found <
> http://www.gnu.org/licenses/gpl-howto.html> to be very helpful in getting
> the license stuff set up.
>
> ---John
>

-- 
Michael Wood 

-- 
-- 
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: Tawny-OWL 0.9

2013-02-06 Thread Phillip Lord

This should be fine. Both EPL and LGPL are weak copyleft. Clojure code
does not need to be EPL because EPL does not force it. Likewise, Clojure
can call back to this LGPL library because, the LGPL doesn't enforce
derivative works as a whole to be LGPL (although modifications to the
tawny *would* have to be LGPL, likewise, modified versions of Clojure).

The uber jar is a red herring, I think. It's an aggregation, not a
derivative work. The same problem would exist even if I EPL'd the
library; it uses the OWL API underneath, and this is LGPL also. 

If code written in Clojure were affected by the EPL, then it would have
been a fairly poor choice of license, I feel. 

Phil


AtKaaZ  writes:

> you can release that on LGPL License ?
> does that work with the EPL of clojure ? or is it only an issue when lein
> uberjar-ed ?
>
>
>
> On Tue, Feb 5, 2013 at 5:57 PM, Phillip Lord
> wrote:
>
>>
>>
>> Tawny-OWL is a clojure library which provides a DSL for the construction
>> of OWL Ontologies (http://www.w3.org/2004/OWL/). The practical upshot of
>> this, is that allows a form of logic reasoning over sets of facts about
>> the world, with strong computational guarantees about decidability.
>>
>> At it's simplest it looks rather like the Manchester Syntax, but is
>> fully programmatic language, which allows for arbitrary templating of
>> expressions. Where possible, it uses clojure facilities directly, so
>> things like autocomplete, and documentation look up work out-of-the-box,
>> in what ever IDE is your poison.
>>
>> It comes complete with reasoner support using HermiT
>> (http://www.hermit-reasoner.com/) or ELK
>> (http://code.google.com/p/elk-reasoner/). Tawny-OWL current implements
>> all of the object and annotation side of OWL; expression of datatype
>> properties will follow shortly.
>>
>> Although, it's been available for a while, this is the first release
>> that I have announced here. I'd welcome feedback. The Clojure is a bit
>> nasty at places--I learnt the language at the same time.
>>
>> https://github.com/phillord/tawny-owl
>>
>> and on clojars.
>>
>> Phil
>>
>>
>> --
>> Phillip Lord,   Phone: +44 (0) 191 222 7827
>> Lecturer in Bioinformatics, Email:
>> phillip.l...@newcastle.ac.uk
>> School of Computing Science,
>> http://homepages.cs.ncl.ac.uk/phillip.lord
>> Room 914 Claremont Tower,   skype: russet_apples
>> Newcastle University,   msn: m...@russet.org.uk
>> NE1 7RU twitter: phillord
>>
>> --
>> --
>> 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.
>>
>>
>>
>
>
> -- 
> Please correct me if I'm wrong or incomplete,
> even if you think I'll subconsciously hate it.
>
> -- 

-- 
Phillip Lord,   Phone: +44 (0) 191 222 7827
Lecturer in Bioinformatics, Email: phillip.l...@newcastle.ac.uk
School of Computing Science,
http://homepages.cs.ncl.ac.uk/phillip.lord
Room 914 Claremont Tower,   skype: russet_apples
Newcastle University,   msn: m...@russet.org.uk
NE1 7RU twitter: phillord

-- 
-- 
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: Tawny-OWL 0.9

2013-02-06 Thread Phillip Lord
John Gabriele  writes:
> LGPL just means that the library itself is copyleft (if you make changes to 
> it, and distribute the modified library, you've got to distribute your 
> changes along with it (under the same conditions) as well).
>
> Issues of license compatibility generally only come up when you're linking 
> to *GPL* (not LGPL) libs/apps.
>
> Incidentally, Phillip, in your license notice you say the lib is LGPL, but 
> then just below it say it's GPL. Also, it doesn't look like you've included 
> the full text of the license in the project. I've found 
>  to be very helpful in getting 
> the license stuff set up.


Yeah, cut and paste mess up. It's fixed in the git. Will add the license
full text. 

Phil

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




How do you typecast and insert a Postgres enum value using Clojure JDBC?

2013-02-06 Thread James Thornton


For example, here is a product table in PostgreSQL with status as an enum:

create type product_status as enum ('InStock', 'OutOfStock');

create table product (
pidint primary key default nextval('product_pid_seq'),
skutext not null unique,
name   text not null,
descriptiontext not null,
quantity   int not null,
cost   numeric(10,2) not null,
price  numeric(10,2) not null,
weight numeric(10,2),
status product_status not null);

Typical Clojure code to insert a product would be:

(def prod-12345 {:sku "12345"
 :name "My Product"
 :description "yada yada yada"
 :quantity 100
 :cost 42.00
 :price 59.00
 :weight 0.3
 :status "InStock"})
(sql/with-connection db-spec
   (sql/insert-record :product product-12345))

However, status is an enum so you can't insert it as a normal string 
without casting it to an enum:

'InStock'::product_status

I know you can do it with a prepared statement, such as:

INSERT INTO product (name, status) VALUES (?, ?::product_status)

But is there a way to do it without using a prepared statement?

>From StackOverflow: 
http://stackoverflow.com/questions/14719207/how-do-you-insert-a-postgres-enum-value-using-clojure-jdbc

- James

-- 
-- 
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: Prismatic Plumbing and Graph Open-Source Release

2013-02-06 Thread László Török
Hi,

Good stuff! I was wondering how do you guys deal with "decision nodes" or
does is make sense to model such a thing at the nodel level.

Imagine having a diamond topology e.g.
N1
   /\
  N2aN2b
   \/
N3

based on some input to N1, either N2a or N2b gets computed on which N3
depends.

Does this make sense or should this "decision" step be wrapped in a node
"N2".

Thanks,

Las

2013/1/29 Aria Haghighi 

> Hey all,
>
>  Prismatic has open-sourced our Plumbing and Graph library on 
> github.
> Jason Wolfe gave a 
> talkabout
>  how we use graph for systems composition at Strange loop last year.
> Please give the library
> a whirl and let us know if you're using it and if you find any issues or
> feature requests. We use this library very heavily throughout our code and
> hope others find it useful as well.
>
>  Best, Aria
>
> --
> --
> 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.
>
>
>



-- 
László Török

-- 
-- 
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: Performance issue with hashing records

2013-02-06 Thread Christophe Grand
Hi,

On Mon, Feb 4, 2013 at 12:13 PM, Paul Stadig  wrote:

> On Sunday, February 3, 2013 9:56:49 PM UTC-5, puzzler wrote:
>>
>> In these examples, the map/record is freshly created each time through
>> the loop, so caching should not be a factor.
>>
>
> Good point. So maybe it's not the caching :).
>

No Paul, you were right: it's the caching. The map is seen as constant and
its creation is hoisted outside of the loop so hash is called 1e7 times on
the same map object. While a new record is created at each iteration.

If you rewrite  (time (dotimes [n 1000] (hash (A. "a" 3 as  (time
(dotimes [n 1000] (hash #user.A["a" 3]))) you get a single record
instance -- but still no caching on records.

In my patch to fix the hashing caching (or lack of) I didn't cover records
because it's more involved: it requires changes to the compiler because we
need to add new fields to the record to hold the cached value -- fields
that must not be part of the constructor.

Christophe

-- 
On Clojure http://clj-me.cgrand.net/
Clojure Programming http://clojurebook.com
Training, Consulting & Contracting http://lambdanext.eu/

-- 
-- 
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: Performance issue with hashing records

2013-02-06 Thread Christophe Grand
Hi

On Mon, Feb 4, 2013 at 2:29 PM, AtKaaZ  wrote:

> => (class {:x "a" :y 3})
> clojure.lang.Persistent*Array*Map
> => (def m {:x "a" :y 3})
> #'runtime.q/m
> => (class m)
> clojure.lang.Persistent*Hash*Map
>

huh? that one I can't explain, I'll have to do some research.

=> (def m (let [] {:x "a" :y 3}))
#'user/m
=> (class m)
clojure.lang.PersistentArrayMap


> => (time (dotimes [n 1000] (hash m)))
> "Elapsed time: 168.162927 msecs"
> nil
> => (time (dotimes [n 1000] (hash m)))
> "Elapsed time: 161.341094 msecs"
> nil
> => (time (dotimes [n 1000] (hash m)))
> "Elapsed time: 159.444025 msecs"
> nil
>
>
Since hash is cached and m doesn't change, more runs are just measuring the
time to lookup the cache. There may be a sligt overhead due to m being a
var.

To properly isolate this you have to use locals:
=> (let [m (hash-map :x "a" :y 3)]
 (println (class m))
 (time (dotimes [n 1000] (hash m
clojure.lang.PersistentHashMap
"Elapsed time: 221.62 msecs"
nil
=> (let [m (hash-map :x "a" :y 3)]
 (println (class m))
 (time (dotimes [n 1000] (hash m
clojure.lang.PersistentHashMap
"Elapsed time: 214.624 msecs"
nil
=> (let [m (hash-map :x "a" :y 3)]
 (println (class m))
 (time (dotimes [n 1000] (hash m
clojure.lang.PersistentHashMap
"Elapsed time: 212.505 msecs"
nil
=> (let [m {:x "a" :y 3}]
 (println (class m))
 (time (dotimes [n 1000] (hash m
clojure.lang.PersistentArrayMap
"Elapsed time: 232.872 msecs"
nil
=> (let [m {:x "a" :y 3}]
 (println (class m))
 (time (dotimes [n 1000] (hash m
clojure.lang.PersistentArrayMap
"Elapsed time: 218.141 msecs"
nil
=> (let [m {:x "a" :y 3}]
 (println (class m))
 (time (dotimes [n 1000] (hash m
clojure.lang.PersistentArrayMap
"Elapsed time: 220.813 msecs"
nil

No significant change -- hopefully since 1e7-1 times out od 1z7 we are
measuring the cost of looking up a cache.

Christophe

-- 
On Clojure http://clj-me.cgrand.net/
Clojure Programming http://clojurebook.com
Training, Consulting & Contracting http://lambdanext.eu/

-- 
-- 
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: EDN for Objective-C (iOS/OS X)

2013-02-06 Thread Matthew Phillips
Thanks. I did look at the (incomplete) C version, and will take another 
closer look before deciding what route to take, but I suspect 
an Obj-C/Cocoa version would have different enough requirements to warrant 
a new start, or at least a significant re-write.

Cheers,

Matthew.

On Wednesday, February 6, 2013 12:24:44 PM UTC+10:30, Herwig Hochleitner 
wrote:
>
> According to the "Implementations" page of the edn wiki [1], libclj [2] 
> seems to be a possible starting point for that plan.
>
> [1] https://github.com/edn-format/edn/wiki/Implementations
> [2] https://github.com/brandonbloom/libclj
>
>
> 2013/2/5 Matthew Phillips >
>
>> Hello,
>>
>> a quick search of this group, and the web at large, doesn't get any hits 
>> for an Obj-C EDN implementation. Is there anyone working on this?
>>
>> If not, I'll likely go ahead and implement a basic subset of the EDN spec 
>> for my own needs, which I'd be happy to share.
>>
>> Cheers,
>>
>> Matthew.
>>
>> -- 
>> -- 
>> 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: Possible bug in clojure.java.jdbc

2013-02-06 Thread Shantanu Kumar


On Feb 6, 11:42 am, Sean Corfield  wrote:
> Andy's right on process... but as maintainer of clojure.java.jdbc, I
> have to ask: why on earth do you have column names containing spaces
> or & or other weird characters? That's a serious question: how do you
> get into that situation?

JDBC is an interface for SQL dialects, not necessarily for relational
data stores. For example, I've seen WBEM/CIM[1] exposed via JDBC. I am
not surprised to see spaces in column names. Quite often those
situations are not under the control of JDBC user.

[1] CIM: http://en.wikipedia.org/wiki/Common_Information_Model_(computing)

> I'm not saying clojure.java.jdbc can't be updated to support it, I'm
> just questioning whether it should...

I believe it should. The runtime configuration aspects (1. conversion
of column-name from Clojure to DB and vice versa, 2. wrapping of
Connection, Statement, PreparedStatement objects -- e.g. Excel JDBC-
ODBC connection doesn't support/throws exception on setAutoCommit, or
`long` data type that Clojure defaults to for ints) should be
extensible by the user.

Shantanu

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




leiningen dependencies plugin

2013-02-06 Thread Maris

Is there dependencies plugin for leiningen ?

I need to download all dependencies so I can copy my project to a server.   
( I can't run leiningen on server ).

mvn dependency:copy-dependencies

-- 
-- 
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: leiningen dependencies plugin

2013-02-06 Thread Meikel Brandmeyer (kotarak)
lein deps?

Am Mittwoch, 6. Februar 2013 12:41:03 UTC+1 schrieb Maris:
>
>
> Is there dependencies plugin for leiningen ?
>
> I need to download all dependencies so I can copy my project to a server. 
>   ( I can't run leiningen on server ).
>
> mvn dependency:copy-dependencies
>

-- 
-- 
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: leiningen dependencies plugin

2013-02-06 Thread David Powell
I wrote this recently to copy your dependencies to a specific directory in
your project:
https://github.com/djpowell/lein-libdir

Or you could just use lein-uberjar?

Or lein-tar to bundle everything up?

-- 
Dave



On Wed, Feb 6, 2013 at 11:41 AM, Maris  wrote:

>
> Is there dependencies plugin for leiningen ?
>
> I need to download all dependencies so I can copy my project to a server.
>   ( I can't run leiningen on server ).
>
> mvn dependency:copy-dependencies
>
> --
> --
> 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.
>
>
>

-- 
-- 
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: leiningen dependencies plugin

2013-02-06 Thread Vijay Kiran

Use lein pom - to generate pom.xml and use mvn dependency:copy-depencies :)

On Wednesday, February 6, 2013 12:41:03 PM UTC+1, Maris wrote:
>
>
> Is there dependencies plugin for leiningen ?
>
> I need to download all dependencies so I can copy my project to a server. 
>   ( I can't run leiningen on server ).
>
> mvn dependency:copy-dependencies
>

-- 
-- 
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: constructing matrix-like structures with list-comprehension

2013-02-06 Thread Mikera
Hmmm... sounds like you might want to take a look at the latest development 
version core.matrix: 

https://github.com/clojure-numerics/core.matrix

You can construct nested vectors of arbitrary shape, e.g. 

(new-array 2 3 4 5)

This creates a new 4-dimensional 2x3x4x5 matrix. core.matrix supports all 
different kinds of matrix types (e.g. native JBLAS matrices) but if you 
want to work with nested Clojure vectors you can just do:

(set-current-implementation [])

On Tuesday, 5 February 2013 23:03:17 UTC+8, Jim foo.bar wrote:
>
> Hi all, 
>
> I 'm a bit confused with this - I'm trying to think but I can't!!! 
> Probably cos I've not had any food yet! 
> Up till now I thought I could construct matrices with 'for'...So (for [i 
> (range 3)] i) gives us a 1d structure (a list)... 
> (for [i (range 3) j (range 4)] [i j]) gives us a 2d structure (list of 
> vectors) 
>
> On that basis I wrote the following little macro thinking I'd be bale to 
> create matrices with arbitrary dimensions: 
>
> (defn matrix [& dim-lengths] 
> (let [bindings (vec (mapcat #(vector (gensym) `(range ~%)) dim-lengths)) 
>symbols  (mapv first (partition 2 bindings)) 
>counts (count symbols)] 
>`(for ~bindings  (if (< counts 1) ~symbols (first ~symbols) 
>
> Now, even though this expands to the 'for' I want I'm starting to think 
> this is not the right approach for matrices...all I get is 2d structures 
> regardless of how many dimensions I pass in... 
>
> any ideas anyone? 
>
> Jim 
>
>
>
>
>

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

2013-02-06 Thread AtKaaZ
Hi. Thank you.


On Wed, Feb 6, 2013 at 10:50 AM, Christophe Grand wrote:

> Hi
>
> On Mon, Feb 4, 2013 at 2:29 PM, AtKaaZ  wrote:
>
>> => (class {:x "a" :y 3})
>>  clojure.lang.Persistent*Array*Map
>> => (def m {:x "a" :y 3})
>> #'runtime.q/m
>> => (class m)
>> clojure.lang.Persistent*Hash*Map
>>
>
> huh? that one I can't explain, I'll have to do some research.
>
> => (def m (let [] {:x "a" :y 3}))
> #'user/m
> => (class m)
> clojure.lang.PersistentArrayMap
>
>
>> => (time (dotimes [n 1000] (hash m)))
>> "Elapsed time: 168.162927 msecs"
>> nil
>> => (time (dotimes [n 1000] (hash m)))
>> "Elapsed time: 161.341094 msecs"
>> nil
>> => (time (dotimes [n 1000] (hash m)))
>> "Elapsed time: 159.444025 msecs"
>> nil
>>
>>
> Since hash is cached and m doesn't change, more runs are just measuring
> the time to lookup the cache. There may be a sligt overhead due to m being
> a var.
>
> To properly isolate this you have to use locals:
> => (let [m (hash-map :x "a" :y 3)]
>  (println (class m))
>  (time (dotimes [n 1000] (hash m
> clojure.lang.PersistentHashMap
> "Elapsed time: 221.62 msecs"
> nil
> => (let [m (hash-map :x "a" :y 3)]
>  (println (class m))
>  (time (dotimes [n 1000] (hash m
> clojure.lang.PersistentHashMap
> "Elapsed time: 214.624 msecs"
> nil
> => (let [m (hash-map :x "a" :y 3)]
>  (println (class m))
>  (time (dotimes [n 1000] (hash m
> clojure.lang.PersistentHashMap
> "Elapsed time: 212.505 msecs"
> nil
> => (let [m {:x "a" :y 3}]
>  (println (class m))
>  (time (dotimes [n 1000] (hash m
> clojure.lang.PersistentArrayMap
> "Elapsed time: 232.872 msecs"
> nil
> => (let [m {:x "a" :y 3}]
>  (println (class m))
>  (time (dotimes [n 1000] (hash m
> clojure.lang.PersistentArrayMap
> "Elapsed time: 218.141 msecs"
> nil
> => (let [m {:x "a" :y 3}]
>  (println (class m))
>  (time (dotimes [n 1000] (hash m
> clojure.lang.PersistentArrayMap
> "Elapsed time: 220.813 msecs"
> nil
>
> No significant change -- hopefully since 1e7-1 times out od 1z7 we are
> measuring the cost of looking up a cache.
>
> Christophe
>
> --
> On Clojure http://clj-me.cgrand.net/
> Clojure Programming http://clojurebook.com
> Training, Consulting & Contracting http://lambdanext.eu/
>
> --
> --
> 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.
>
>
>



-- 
Please correct me if I'm wrong or incomplete,
even if you think I'll subconsciously hate it.

-- 
-- 
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: Performance issue with hashing records

2013-02-06 Thread Bronsa
2013/2/6 Christophe Grand 

> Hi
>
> On Mon, Feb 4, 2013 at 2:29 PM, AtKaaZ  wrote:
>
>> => (class {:x "a" :y 3})
>>  clojure.lang.Persistent*Array*Map
>> => (def m {:x "a" :y 3})
>> #'runtime.q/m
>> => (class m)
>> clojure.lang.Persistent*Hash*Map
>>
>
> huh? that one I can't explain, I'll have to do some research.
>
> http://dev.clojure.org/jira/browse/CLJ-944
The second patch should adress this


> => (def m (let [] {:x "a" :y 3}))
> #'user/m
> => (class m)
> clojure.lang.PersistentArrayMap
>
>
>> => (time (dotimes [n 1000] (hash m)))
>> "Elapsed time: 168.162927 msecs"
>> nil
>> => (time (dotimes [n 1000] (hash m)))
>> "Elapsed time: 161.341094 msecs"
>> nil
>> => (time (dotimes [n 1000] (hash m)))
>> "Elapsed time: 159.444025 msecs"
>> nil
>>
>>
> Since hash is cached and m doesn't change, more runs are just measuring
> the time to lookup the cache. There may be a sligt overhead due to m being
> a var.
>
> To properly isolate this you have to use locals:
> => (let [m (hash-map :x "a" :y 3)]
>  (println (class m))
>  (time (dotimes [n 1000] (hash m
> clojure.lang.PersistentHashMap
> "Elapsed time: 221.62 msecs"
> nil
> => (let [m (hash-map :x "a" :y 3)]
>  (println (class m))
>  (time (dotimes [n 1000] (hash m
> clojure.lang.PersistentHashMap
> "Elapsed time: 214.624 msecs"
> nil
> => (let [m (hash-map :x "a" :y 3)]
>  (println (class m))
>  (time (dotimes [n 1000] (hash m
> clojure.lang.PersistentHashMap
> "Elapsed time: 212.505 msecs"
> nil
> => (let [m {:x "a" :y 3}]
>  (println (class m))
>  (time (dotimes [n 1000] (hash m
> clojure.lang.PersistentArrayMap
> "Elapsed time: 232.872 msecs"
> nil
> => (let [m {:x "a" :y 3}]
>  (println (class m))
>  (time (dotimes [n 1000] (hash m
> clojure.lang.PersistentArrayMap
> "Elapsed time: 218.141 msecs"
> nil
> => (let [m {:x "a" :y 3}]
>  (println (class m))
>  (time (dotimes [n 1000] (hash m
> clojure.lang.PersistentArrayMap
> "Elapsed time: 220.813 msecs"
> nil
>
> No significant change -- hopefully since 1e7-1 times out od 1z7 we are
> measuring the cost of looking up a cache.
>
> Christophe
>
> --
> On Clojure http://clj-me.cgrand.net/
> Clojure Programming http://clojurebook.com
> Training, Consulting & Contracting http://lambdanext.eu/
>
> --
> --
> 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.
>
>
>

-- 
-- 
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: constructing matrix-like structures with list-comprehension

2013-02-06 Thread Jim - FooBar();

Hi Mike,

thanks for your reply...I've actually been keeping a very close eye on 
core.matrix since day 1 and I have to admit I am very very tempted to 
start contributing...My research is on Text-mining which as you probably 
know is machine-learning on text (mainly sequence-labelling, HMM based 
). The problem is (as it always tends to be) time...I'm in my 2nd year 
of my Ph.D. and my research just transformed from an idea to something 
concrete roughly 3 months ago so things are truly hectic at the moment! 
I'm preparing papers, doing lots of coding/experiments etc etc...So for 
the moment I physically cannot be of much  use I'm afraid...


anyway, that is probably too much detail! What I meant to say is that 
for now I'm not looking for something performant...I guess you could say 
I was messing about with ways of generating code that constructs 
matrices based on 'for'. I cracked it after a couple of hours so I'm 
happy...Of course it goes without saying that I'm not going to use my 
macro for performance critical code...just fun and games :)


In any case thank you for your reply and a bigger thank you for starting 
core.matrix...this is good stuff and the first chance I get I'll jump in!


Jim


On 06/02/13 12:25, Mikera wrote:
Hmmm... sounds like you might want to take a look at the latest 
development version core.matrix:


https://github.com/clojure-numerics/core.matrix

You can construct nested vectors of arbitrary shape, e.g.

(new-array 2 3 4 5)

This creates a new 4-dimensional 2x3x4x5 matrix. core.matrix supports 
all different kinds of matrix types (e.g. native JBLAS matrices) but 
if you want to work with nested Clojure vectors you can just do:


(set-current-implementation [])

On Tuesday, 5 February 2013 23:03:17 UTC+8, Jim foo.bar wrote:

Hi all,

I 'm a bit confused with this - I'm trying to think but I can't!!!
Probably cos I've not had any food yet!
Up till now I thought I could construct matrices with 'for'...So
(for [i
(range 3)] i) gives us a 1d structure (a list)...
(for [i (range 3) j (range 4)] [i j]) gives us a 2d structure
(list of
vectors)

On that basis I wrote the following little macro thinking I'd be
bale to
create matrices with arbitrary dimensions:

(defn matrix [& dim-lengths]
(let [bindings (vec (mapcat #(vector (gensym) `(range ~%))
dim-lengths))
   symbols  (mapv first (partition 2 bindings))
   counts (count symbols)]
   `(for ~bindings  (if (< counts 1) ~symbols (first ~symbols)

Now, even though this expands to the 'for' I want I'm starting to
think
this is not the right approach for matrices...all I get is 2d
structures
regardless of how many dimensions I pass in...

any ideas anyone?

Jim




--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient 
with your first post.

To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google 
Groups "Clojure" group.
To 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.




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




ANN Neocons 1.1.0-beta3

2013-02-06 Thread Michael Klishin
Neocons is a feature rich idiomatic Clojure client for the Neo4J REST API.

Release notes for 1.1.0-beta3:
http://blog.clojurewerkz.org/blog/2013/02/06/neocons-1-dot-1-0-beta3-is-released/
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

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




Re: ANN: Tawny-OWL 0.9

2013-02-06 Thread Michael Klishin
2013/2/6 Phillip Lord 

> You mean "what is the name of this library as maven artifact"? Rather
> than it's dependencies.
>

Yes.


>
> I've added this to the documentation; this needs expanding anyway,
> because its poor at the moment.
>

Are you sure people will find it there if it's not in the README? The
thinking
"if I can't even get started with it, why do I need to see documentation"
may be
fairly common.
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

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




CSS sometimes disappears in uberjar web app using wrap-resource

2013-02-06 Thread larry google groups

I created a web app using Ring, Jetty, Enlive, Compojure. 

At the end, I bundled everything together by running the command "lein 
uberjar". The resulting file was 21 megs. 

I scp the file to the server, then I ssh to the server. I start a "screen" 
session. Inside the screen session I type :

java -jar kiosk-0.1-standalone.jar 30001

The number at the end is the port that I have it running on. 

Sometimes, when people look at the app, none of the CSS files load. I have 
run into this bug myself. Sometimes, when I look at the app, the Javascript 
and CSS paths are broken. If I click "view source" and see the source, and 
if I try to follow the links to the CSS or Javascript, then I get 404 
errors. 

I have this in my code: 

  (wrap-resource "public")

The structure of the code is: 

/resources
/public
/css
/javascript
/templates
/src
/kiosk

The code is still able to find the templates in resources/templates, and 
that HTML is given to Enlive, so something appears on screen. It's just the 
stuff in "public" that sometimes goes missing. 

Can anyone suggest why? My routes are defined like this:


(defroutes app-routes
  (ANY "/" request (index request))
  (GET "/search-results" request (search-results request))
  (GET "/schema" [] (schema))
  (GET "/account" request (account request))
  (GET "/login" request (login request))
  (GET "/start-over" request (start-over request))
  (GET "/admin" request (admin request))
  (GET "/ok" request (ok request))
  (POST "/admin" request (record-new-question-if-any request))
  (GET "/delete-question/:question-to-delete" request (delete-question 
request))
  (GET "/finish-user-sign-up" request (finish-user-sign-up request))
  (route/not-found "Page not found"))

(def app
  (-> app-routes
  (wrap-resource "public")
  (wrap-session {:cookie-name "discovery-session" :cookie-attrs 
{:max-age 90 }})
  (wrap-cookies)
  (wrap-keyword-params)
  (wrap-nested-params)
  (wrap-params)))


-- 
-- 
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: CSS sometimes disappears in uberjar web app using wrap-resource

2013-02-06 Thread larry google groups
 

I logged into my personal server (in the Rackspace cloud, what used to be 
Slicehost) and blasted the CSS file  with 10,000 requests. There were 0 
(zero) failed requests. This is with Apache Benchmark ("ab -n 1 -c 
50"). The server, Jetty, was able to serve the CSS 10,000 times, yet it 
fails on occasion when my co-workers go and look at it. I am struggling to 
think what the problem is. Any suggestions? Does Jetty fail when the app is 
running an activity in something other than the main thread? 


Document Path:  /css/timeout.css

Document Length:3688 bytes


Concurrency Level:  50

Time taken for tests:   62.913 seconds

Complete requests:  1

Failed requests:0

Write errors:   0

Total transferred:  3843 bytes

HTML transferred:   3688 bytes

Requests per second:158.95 [#/sec] (mean)

Time per request:   314.563 [ms] (mean)

Time per request:   6.291 [ms] (mean, across all concurrent requests)

Transfer rate:  596.53 [Kbytes/sec] received


Connection Times (ms)

  min  mean[+/-sd] median   max

Connect:  137  154  75.01431241

Processing:   139  160  39.0152 772

Waiting:  138  160  38.0152 663

Total:277  314  86.62981636


Percentage of the requests served within a certain time (ms)

  50%298

  66%306

  75%313

  80%318

  90%341

  95%363

  98%422

  99%680

 100%   1636 (longest request)






On Wednesday, February 6, 2013 10:10:25 AM UTC-5, larry google groups wrote:
>
>
> I created a web app using Ring, Jetty, Enlive, Compojure. 
>
> At the end, I bundled everything together by running the command "lein 
> uberjar". The resulting file was 21 megs. 
>
> I scp the file to the server, then I ssh to the server. I start a "screen" 
> session. Inside the screen session I type :
>
> java -jar kiosk-0.1-standalone.jar 30001
>
> The number at the end is the port that I have it running on. 
>
> Sometimes, when people look at the app, none of the CSS files load. I have 
> run into this bug myself. Sometimes, when I look at the app, the Javascript 
> and CSS paths are broken. If I click "view source" and see the source, and 
> if I try to follow the links to the CSS or Javascript, then I get 404 
> errors. 
>
> I have this in my code: 
>
>   (wrap-resource "public")
>
> The structure of the code is: 
>
> /resources
> /public
> /css
> /javascript
> /templates
> /src
> /kiosk
>
> The code is still able to find the templates in resources/templates, and 
> that HTML is given to Enlive, so something appears on screen. It's just the 
> stuff in "public" that sometimes goes missing. 
>
> Can anyone suggest why? My routes are defined like this:
>
>
> (defroutes app-routes
>   (ANY "/" request (index request))
>   (GET "/search-results" request (search-results request))
>   (GET "/schema" [] (schema))
>   (GET "/account" request (account request))
>   (GET "/login" request (login request))
>   (GET "/start-over" request (start-over request))
>   (GET "/admin" request (admin request))
>   (GET "/ok" request (ok request))
>   (POST "/admin" request (record-new-question-if-any request))
>   (GET "/delete-question/:question-to-delete" request (delete-question 
> request))
>   (GET "/finish-user-sign-up" request (finish-user-sign-up request))
>   (route/not-found "Page not found"))
>
> (def app
>   (-> app-routes
>   (wrap-resource "public")
>   (wrap-session {:cookie-name "discovery-session" :cookie-attrs 
> {:max-age 90 }})
>   (wrap-cookies)
>   (wrap-keyword-params)
>   (wrap-nested-params)
>   (wrap-params)))
>
>
>

-- 
-- 
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: CSS sometimes disappears in uberjar web app using wrap-resource

2013-02-06 Thread larry google groups
I hit the app itself with Apache Benchmark. The speed is fairly bad. This 
is a small app which serves everything from memory -- there is no database 
to slow things down. I am aware that I made several mistakes with this app. 
I had to write it in a huge hurry. I abused the Enlive template system and, 
I am fairly sure, there are places where I redundantly change Enlive nodes 
to a string, then change them back to Enlive nodes, then change them back 
to a string to serve them to the public. I imagine I can get a speed bump 
when I go back through and clean it up. But I am still left with the main 
puzzle: why does the CSS sometimes fail to load? I know that sometimes 
(rarely) if I point my browser directly at the path for the CSS file, I get 
a 404 error. What would cause an intermittent problem like that? Some 
background exception? What? 

ab -n 1000 -c 10 

Server Software:Jetty(7.x.y-SNAPSHOT)
Document Path:  /
Document Length:4277 bytes

Concurrency Level:  10
Time taken for tests:   235.877 seconds
Complete requests:  1000
Failed requests:0
Write errors:   0
Total transferred:  4551891 bytes
HTML transferred:   4277000 bytes
Requests per second:4.24 [#/sec] (mean)
Time per request:   2358.775 [ms] (mean)
Time per request:   235.877 [ms] (mean, across all concurrent requests)
Transfer rate:  18.85 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:  137  139   3.4138 172
Processing:  1372 2216 280.3   22103057
Waiting: 1371 2215 280.3   22103057
Total:   1510 2355 280.5   23513195

Percentage of the requests served within a certain time (ms)
  50%   2351
  66%   2470
  75%   2558
  80%   2610
  90%   2734
  95%   2828
  98%   2914
  99%   3008
 100%   3195 (longest request)






On Wednesday, February 6, 2013 10:53:50 AM UTC-5, larry google groups wrote:
>
> I logged into my personal server (in the Rackspace cloud, what used to be 
> Slicehost) and blasted the CSS file  with 10,000 requests. There were 0 
> (zero) failed requests. This is with Apache Benchmark ("ab -n 1 -c 
> 50"). The server, Jetty, was able to serve the CSS 10,000 times, yet it 
> fails on occasion when my co-workers go and look at it. I am struggling to 
> think what the problem is. Any suggestions? Does Jetty fail when the app is 
> running an activity in something other than the main thread? 
>
>
> Document Path:  /css/timeout.css
>
> Document Length:3688 bytes
>
>
> Concurrency Level:  50
>
> Time taken for tests:   62.913 seconds
>
> Complete requests:  1
>
> Failed requests:0
>
> Write errors:   0
>
> Total transferred:  3843 bytes
>
> HTML transferred:   3688 bytes
>
> Requests per second:158.95 [#/sec] (mean)
>
> Time per request:   314.563 [ms] (mean)
>
> Time per request:   6.291 [ms] (mean, across all concurrent requests)
>
> Transfer rate:  596.53 [Kbytes/sec] received
>
>
> Connection Times (ms)
>
>   min  mean[+/-sd] median   max
>
> Connect:  137  154  75.01431241
>
> Processing:   139  160  39.0152 772
>
> Waiting:  138  160  38.0152 663
>
> Total:277  314  86.62981636
>
>
> Percentage of the requests served within a certain time (ms)
>
>   50%298
>
>   66%306
>
>   75%313
>
>   80%318
>
>   90%341
>
>   95%363
>
>   98%422
>
>   99%680
>
>  100%   1636 (longest request)
>
>
>
>
>
>
> On Wednesday, February 6, 2013 10:10:25 AM UTC-5, larry google groups 
> wrote:
>>
>>
>> I created a web app using Ring, Jetty, Enlive, Compojure. 
>>
>> At the end, I bundled everything together by running the command "lein 
>> uberjar". The resulting file was 21 megs. 
>>
>> I scp the file to the server, then I ssh to the server. I start a 
>> "screen" session. Inside the screen session I type :
>>
>> java -jar kiosk-0.1-standalone.jar 30001
>>
>> The number at the end is the port that I have it running on. 
>>
>> Sometimes, when people look at the app, none of the CSS files load. I 
>> have run into this bug myself. Sometimes, when I look at the app, the 
>> Javascript and CSS paths are broken. If I click "view source" and see the 
>> source, and if I try to follow the links to the CSS or Javascript, then I 
>> get 404 errors. 
>>
>> I have this in my code: 
>>
>>   (wrap-resource "public")
>>
>> The structure of the code is: 
>>
>> /resources
>> /public
>> /css
>> /javascript
>> /templates
>> /src
>> /kiosk
>>
>> The code is still able to find the templates in resources/templates, and 
>> that HTML is given to Enlive, so something appears on screen. It's just the 
>> stuff in "public" that sometimes goes missing. 
>>
>> Can anyone suggest why? My routes are defined like this:
>>
>>
>> (defroutes app-routes
>>   (ANY "/" request (index request))
>>   (GET "/search-results" re

clojure.set/intersection can't cope with infinite sets

2013-02-06 Thread Andrea Chiavazza
Currently this hangs, makes my machine quickly run out of memory and swap.

(clojure.set/intersection #{1 2} (range))

The problem seems to be that count is called on both arguments to find the 
smallest set.
Finding the shortest of 2 seqs lazily shouldn't be a problem, but another 
problem I can spot would be that contains? should be used only for some 
data structures, like hash-set, otherwise I guess "some" could be used, 
which would do the right thing, like in:

(some #{1} (range))
1
(some #{2} (range))
2
At this point execution will stop and return the #{1 2} as all elements of 
the smallest set have been tested.

Would it be possible and worth the added complication to fix this ?
There could also be some potential performance improvements, for example 
removing count might be slightly more efficient when big sets are involved.

I came up with this while trying to solve 4clojure #108 "find the smallest 
single number which appears in all of the sequences".
My approach to the 4clojure problem might be wrong altogether, yet I can 
imagine removing this limitation could be useful for some real problems 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/groups/opt_out.




Re: clojure.set/intersection can't cope with infinite sets

2013-02-06 Thread Andy Fingerhut
clojure.set/intersection is documented to work on "input sets".  In Clojure, 
all sets are finite.  (range) is a lazy sequence, which isn't a set.  You could 
attempt to make a set out of it with (set (range)), but that won't work because 
it will try to consume the entire unending sequence.

I would guess that extending clojure.set/intersection to work on lazy sequences 
as well, possibly infinite, would be considered out of scope for what it is 
intended to do, but that is only my guess.

You are of course welcome to make your own generalized version of intersection 
that works as you describe.

Andy

On Feb 6, 2013, at 8:42 AM, Andrea Chiavazza wrote:

> Currently this hangs, makes my machine quickly run out of memory and swap.
> 
> (clojure.set/intersection #{1 2} (range))
> 
> The problem seems to be that count is called on both arguments to find the 
> smallest set.
> Finding the shortest of 2 seqs lazily shouldn't be a problem, but another 
> problem I can spot would be that contains? should be used only for some data 
> structures, like hash-set, otherwise I guess "some" could be used, which 
> would do the right thing, like in:
> 
> (some #{1} (range))
> 1
> (some #{2} (range))
> 2
> At this point execution will stop and return the #{1 2} as all elements of 
> the smallest set have been tested.
> 
> Would it be possible and worth the added complication to fix this ?
> There could also be some potential performance improvements, for example 
> removing count might be slightly more efficient when big sets are involved.
> 
> I came up with this while trying to solve 4clojure #108 "find the smallest 
> single number which appears in all of the sequences".
> My approach to the 4clojure problem might be wrong altogether, yet I can 
> imagine removing this limitation could be useful for some real problems 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/groups/opt_out.




Re: Belgian Clojure base meetup?

2013-02-06 Thread Daniel De Luca
Hi All,

The BeJUG would like to organize a evening session on Clojure in 2013
We're looking for a speaker living/working in Belgium or willing to travel 
(accommodation can be organized).

Anyone interested ?
Many Thanks in advance for the replies.

Daniel De Luca
BeJUG, Devoxx Steering Member


On Monday, December 17, 2012 7:09:56 PM UTC+1, Sébastien Wagener wrote:
>
> Hi Thomas, 
>
> I'm from Luxembourg. If the meetup isn't too far away from the border, I 
> would be interested.
>
> Sébastien
>
>
> 2012/12/16 Thomas Goossens >
>
>> If you are from Belgium, Don't get too excited - yet - .
>>
>> I've been wondering about organising a small meetup somewhere next 
>> semester. (I peeked at our northern neighbours: 
>> http://www.meetup.com/The-Amsterdam-Clojure-Meetup-Group/events/88386392/
>> )
>>
>> Though, I have no idea at all how many people here in Belgium are 
>> actively using clojure and would be interested in such a thing.
>>
>> Its not a plan, just being curious and checking whether it would be worth 
>> the time.
>>
>> So if you are from Belgium, give me a shout!
>>
>> -- 
>> 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 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: leiningen dependencies plugin

2013-02-06 Thread Phil Hagelberg

Maris writes:

> Is there dependencies plugin for leiningen ?
>
> I need to download all dependencies so I can copy my project to a server.   
> ( I can't run leiningen on server ).

If you can't run Leiningen on the server you should probably use an
uberjar; it contains all your dependencies.

Another option is the lein-tar plugin:
https://github.com/technomancy/lein-tar/

-Phil

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

2013-02-06 Thread Mark Engelberg
Yes, you're misunderstanding sets which, as implemented in Clojure, are
inherently finite.  That 4clojure problem is all about learning how to work
with infinite sequences.

I recommend you start by building a helper function that "intersects" two
sorted infinite sequences.  It doesn't already exist in Clojure -- you'll
have to write it yourself.  Then, figure out how to extend that to multiple
infinite sequences.

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




Callbacks as Sequences

2013-02-06 Thread david
I'm not to clojure/clojurescript and was wondering if anyone has taken a 
crack at writing a macro that transforms callbacks into a sequence.  There 
is an awesome implementationion in LispyScript show here: 
https://gist.github.com/santoshrajan/3715526.  Thanks for help.

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: Callbacks as Sequences

2013-02-06 Thread Max Penet
Hi, 

jayq includes something similar (nicer imho). It takes the form of a let 
like construct 

(let-deferred
[a (jq/ajax "http://localhost:8000/1.json";)
 b (jq/ajax "http://localhost:8000/2.json";)]  (do-something-with-result 
(merge a b foo)))

It also supports :let and :when intermediary steps.

more examples can be found here: 
https://github.com/ibdknox/jayq#jayqmacros-source

and the macro: 
https://github.com/ibdknox/jayq/blob/master/src/jayq/macros.clj#L15
https://github.com/ibdknox/jayq/blob/master/src/jayq/core.cljs#L516


Max

On Wednesday, February 6, 2013 7:45:36 PM UTC+1, da...@dsargeant.com wrote:
>
> I'm not to clojure/clojurescript and was wondering if anyone has taken a 
> crack at writing a macro that transforms callbacks into a sequence.  There 
> is an awesome implementationion in LispyScript show here: 
> https://gist.github.com/santoshrajan/3715526.  Thanks for help.
>
> 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: Callbacks as Sequences

2013-02-06 Thread david
I've seen that and think it's awesome. This would be used for Node.js.

I whipped this up to show what a Clojure version might look like.  
Basically each body form after the first is inserted where (cb) is found in 
the previous form.

; Definition
(defmacro defseq
  [fn-name params & body])

; Example usage
(defseq request-handler [req resp]
  ((. resp (set-header "Content-Type" "text/html"))
   (exists "some-file.txt" (cb)))

  (fn [exists]
(if exists
  (read-file filename "utf8" (cb))
  (. resp (end "File Not Found"

  (fn [err data]
(if err
  (. resp (end "Internal Server Error"))
  (. resp (end data)

On Wednesday, February 6, 2013 2:13:33 PM UTC-5, Max Penet wrote:
>
> Hi, 
>
> jayq includes something similar (nicer imho). It takes the form of a let 
> like construct 
>
> (let-deferred
> [a (jq/ajax "http://localhost:8000/1.json";)
>  b (jq/ajax "http://localhost:8000/2.json";)]  (do-something-with-result 
> (merge a b foo)))
>
> It also supports :let and :when intermediary steps.
>
> more examples can be found here: 
> https://github.com/ibdknox/jayq#jayqmacros-source
>
> and the macro: 
> https://github.com/ibdknox/jayq/blob/master/src/jayq/macros.clj#L15
> https://github.com/ibdknox/jayq/blob/master/src/jayq/core.cljs#L516
>
>
> Max
>
> On Wednesday, February 6, 2013 7:45:36 PM UTC+1, da...@dsargeant.comwrote:
>>
>> I'm not to clojure/clojurescript and was wondering if anyone has taken a 
>> crack at writing a macro that transforms callbacks into a sequence.  There 
>> is an awesome implementationion in LispyScript show here: 
>> https://gist.github.com/santoshrajan/3715526.  Thanks for help.
>>
>> 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: clojure.set/intersection can't cope with infinite sets

2013-02-06 Thread Andrea Chiavazza
I can see the points being made, and now I'm also thinking that accepting 
infinite sequences wouldn't always work, for example if the infinite 
sequence wouldn't contain one of the elements of one of the other 
sequences, like:
(clojure.set/intersection #{1 2} (drop 10 (range)))

And I'm not sure it would be acceptable for a function that accepts 
sequences to hang depending on the input.
Which also makes me wonder: shouldn't intersection throw a "cannot be cast 
to clojure.lang.IPersistentSet" when called with (range), rather than 
consume all memory and crash the jvm ?

I still think though that accepting sequences rather then sets could be 
worth consideration for other reasons:
- vectors would just work without having to call set on them: 
(clojure.set/intersection 
[2 3 4] [4 5 6]) (I think duplicate elements shouldn't cause problems)
- it would also work on maps
- sets can be treated as sequences, and operating on sequences whenever 
possible is very idiomatic in Clojure
- no previous code would be broken, neither should performance decrease and 
maybe increase by removing the calls to count
- the doc would simply change to "Returns a set with the elements in common 
between the input seqs."
- the implementation would call contains? if the sequence is a set, for 
performance reasons, and would call (some #{el} seq) otherwise

-- 
-- 
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: CSS sometimes disappears in uberjar web app using wrap-resource

2013-02-06 Thread larry google groups
Sadly, this app is suppose to go live tomorrow, so I am now limited in 
terms of what sort of experiments I can do. But I'd like to re-use this 
code in future projects, so I would like to figure this problem out. 

Does anyone think (wrap-files) would be more reliable than 
(wrap-resources)? 


On Wednesday, February 6, 2013 11:17:03 AM UTC-5, larry google groups wrote:
>
> I hit the app itself with Apache Benchmark. The speed is fairly bad. This 
> is a small app which serves everything from memory -- there is no database 
> to slow things down. I am aware that I made several mistakes with this app. 
> I had to write it in a huge hurry. I abused the Enlive template system and, 
> I am fairly sure, there are places where I redundantly change Enlive nodes 
> to a string, then change them back to Enlive nodes, then change them back 
> to a string to serve them to the public. I imagine I can get a speed bump 
> when I go back through and clean it up. But I am still left with the main 
> puzzle: why does the CSS sometimes fail to load? I know that sometimes 
> (rarely) if I point my browser directly at the path for the CSS file, I get 
> a 404 error. What would cause an intermittent problem like that? Some 
> background exception? What? 
>
> ab -n 1000 -c 10 
>
> Server Software:Jetty(7.x.y-SNAPSHOT)
> Document Path:  /
> Document Length:4277 bytes
>
> Concurrency Level:  10
> Time taken for tests:   235.877 seconds
> Complete requests:  1000
> Failed requests:0
> Write errors:   0
> Total transferred:  4551891 bytes
> HTML transferred:   4277000 bytes
> Requests per second:4.24 [#/sec] (mean)
> Time per request:   2358.775 [ms] (mean)
> Time per request:   235.877 [ms] (mean, across all concurrent requests)
> Transfer rate:  18.85 [Kbytes/sec] received
>
> Connection Times (ms)
>   min  mean[+/-sd] median   max
> Connect:  137  139   3.4138 172
> Processing:  1372 2216 280.3   22103057
> Waiting: 1371 2215 280.3   22103057
> Total:   1510 2355 280.5   23513195
>
> Percentage of the requests served within a certain time (ms)
>   50%   2351
>   66%   2470
>   75%   2558
>   80%   2610
>   90%   2734
>   95%   2828
>   98%   2914
>   99%   3008
>  100%   3195 (longest request)
>
>
>
>
>
>
> On Wednesday, February 6, 2013 10:53:50 AM UTC-5, larry google groups 
> wrote:
>>
>> I logged into my personal server (in the Rackspace cloud, what used to be 
>> Slicehost) and blasted the CSS file  with 10,000 requests. There were 0 
>> (zero) failed requests. This is with Apache Benchmark ("ab -n 1 -c 
>> 50"). The server, Jetty, was able to serve the CSS 10,000 times, yet it 
>> fails on occasion when my co-workers go and look at it. I am struggling to 
>> think what the problem is. Any suggestions? Does Jetty fail when the app is 
>> running an activity in something other than the main thread? 
>>
>>
>> Document Path:  /css/timeout.css
>>
>> Document Length:3688 bytes
>>
>>
>> Concurrency Level:  50
>>
>> Time taken for tests:   62.913 seconds
>>
>> Complete requests:  1
>>
>> Failed requests:0
>>
>> Write errors:   0
>>
>> Total transferred:  3843 bytes
>>
>> HTML transferred:   3688 bytes
>>
>> Requests per second:158.95 [#/sec] (mean)
>>
>> Time per request:   314.563 [ms] (mean)
>>
>> Time per request:   6.291 [ms] (mean, across all concurrent requests)
>>
>> Transfer rate:  596.53 [Kbytes/sec] received
>>
>>
>> Connection Times (ms)
>>
>>   min  mean[+/-sd] median   max
>>
>> Connect:  137  154  75.01431241
>>
>> Processing:   139  160  39.0152 772
>>
>> Waiting:  138  160  38.0152 663
>>
>> Total:277  314  86.62981636
>>
>>
>> Percentage of the requests served within a certain time (ms)
>>
>>   50%298
>>
>>   66%306
>>
>>   75%313
>>
>>   80%318
>>
>>   90%341
>>
>>   95%363
>>
>>   98%422
>>
>>   99%680
>>
>>  100%   1636 (longest request)
>>
>>
>>
>>
>>
>>
>> On Wednesday, February 6, 2013 10:10:25 AM UTC-5, larry google groups 
>> wrote:
>>>
>>>
>>> I created a web app using Ring, Jetty, Enlive, Compojure. 
>>>
>>> At the end, I bundled everything together by running the command "lein 
>>> uberjar". The resulting file was 21 megs. 
>>>
>>> I scp the file to the server, then I ssh to the server. I start a 
>>> "screen" session. Inside the screen session I type :
>>>
>>> java -jar kiosk-0.1-standalone.jar 30001
>>>
>>> The number at the end is the port that I have it running on. 
>>>
>>> Sometimes, when people look at the app, none of the CSS files load. I 
>>> have run into this bug myself. Sometimes, when I look at the app, the 
>>> Javascript and CSS paths are broken. If I click "view source" and see the 
>>> source, and if I try to follow the links to the CSS or Javascript, then I 
>>> get 404 errors. 
>>>
>>> I have 

Re: CSS sometimes disappears in uberjar web app using wrap-resource

2013-02-06 Thread James Reeves
Could you try replacing the wrap-resource middleware with the
route/resources function? The latter operates in a slightly different way
to the Ring middleware, and if the Compojure route works without issue, I
might have an idea what the problem is.

i.e. your code should look like:

(defroutes app-routes
  (ANY "/" request (index request))
  ;; 
  (GET "/finish-user-sign-up" request (finish-user-sign-up request))
  (route/resources "/")
  (route/not-found "Page not found"))

You've also got a max-age of 90 for your session cookies, which would mean
your sessions will time out in 90 seconds. Is that what you want?

Also:

   (GET "/foo" request (foo request))

Is equivalent to:

   (GET "/foo" [] foo)

- James


On 6 February 2013 15:10, larry google groups wrote:

>
> I created a web app using Ring, Jetty, Enlive, Compojure.
>
> At the end, I bundled everything together by running the command "lein
> uberjar". The resulting file was 21 megs.
>
> I scp the file to the server, then I ssh to the server. I start a "screen"
> session. Inside the screen session I type :
>
> java -jar kiosk-0.1-standalone.jar 30001
>
> The number at the end is the port that I have it running on.
>
> Sometimes, when people look at the app, none of the CSS files load. I have
> run into this bug myself. Sometimes, when I look at the app, the Javascript
> and CSS paths are broken. If I click "view source" and see the source, and
> if I try to follow the links to the CSS or Javascript, then I get 404
> errors.
>
> I have this in my code:
>
>   (wrap-resource "public")
>
> The structure of the code is:
>
> /resources
> /public
> /css
> /javascript
> /templates
> /src
> /kiosk
>
> The code is still able to find the templates in resources/templates, and
> that HTML is given to Enlive, so something appears on screen. It's just the
> stuff in "public" that sometimes goes missing.
>
> Can anyone suggest why? My routes are defined like this:
>
>
> (defroutes app-routes
>   (ANY "/" request (index request))
>   (GET "/search-results" request (search-results request))
>   (GET "/schema" [] (schema))
>   (GET "/account" request (account request))
>   (GET "/login" request (login request))
>   (GET "/start-over" request (start-over request))
>   (GET "/admin" request (admin request))
>   (GET "/ok" request (ok request))
>   (POST "/admin" request (record-new-question-if-any request))
>   (GET "/delete-question/:question-to-delete" request (delete-question
> request))
>   (GET "/finish-user-sign-up" request (finish-user-sign-up request))
>   (route/not-found "Page not found"))
>
> (def app
>   (-> app-routes
>   (wrap-resource "public")
>   (wrap-session {:cookie-name "discovery-session" :cookie-attrs
> {:max-age 90 }})
>   (wrap-cookies)
>   (wrap-keyword-params)
>   (wrap-nested-params)
>   (wrap-params)))
>
>
>  --
> --
> 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.
>
>
>

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




Using lein in upstart init script

2013-02-06 Thread David Jagoe
Hi all,

I need to start a ring server from an upstart script on Ubuntu. Normally I
would use an uberjar and execute java directly, but in this case I cannot
do AOT and would like to simply run "lein ring server-headless" from my
upstart script. Even when I use "lein trampoline" I get "respawning too
fast" from upstart.

Any ideas on how to do this?


Thanks,
David

-- 
David Jagoe

davidja...@gmail.com
+18053284389

-- 
-- 
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: Using lein in upstart init script

2013-02-06 Thread Jack Moffitt
> I need to start a ring server from an upstart script on Ubuntu. Normally I
> would use an uberjar and execute java directly, but in this case I cannot do
> AOT and would like to simply run "lein ring server-headless" from my upstart
> script. Even when I use "lein trampoline" I get "respawning too fast" from
> upstart.
>
> Any ideas on how to do this?

Here's one I use:

description "foo bar bz"

start on (local-filesystems and net-device-up IFACE!=lo)
stop on stopping network-services

respawn

setuid someuser
setgid somegroup
chdir /path/to/app
exec lein trampoline ring server-headless 3344

Note that lein won't normally run as root. So the setuid part is
important (or you'll need to set LEIN_ROOT=1).

jack.

-- 
-- 
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.set/intersection can't cope with infinite sets

2013-02-06 Thread Mark Engelberg
Sets are stored in a very specific way that enables intersection to be fast
- proportional to the size of the smaller set.

Intersecting arbitrary sequences can't be done particularly efficiently.
If Clojure's intersection worked on sequences (perhaps by first converting
to sets behind the scenes), people would get in the habit of passing
sequences to intersection and would be surprised by the gross inefficiency
of their code.  Clojure forces you to choose the right data structure for
the task at hand.  If you need to do a lot of intersections, choose sets
from the start.

--Mark

-- 
-- 
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: Prismatic Plumbing and Graph Open-Source Release

2013-02-06 Thread Jason Wolfe
Hi Las,

Currently the graph topology is fixed at compile time, and cannot be 
changed by the values flowing through it. 

In such situations, we either: 
 - Have two copies of the graph with different node functions for N2 (i.e., 
when generating different types of newsfeeds, from our original blog 
example) and call different ones depending on input type
 - Put the conditional into a single node N2

It's hard to say more without knowing about your specific use case.  If you 
want to share details, I'd like to listen, either here or off-list.

Cheers,
Jason

On Wednesday, February 6, 2013 1:08:53 AM UTC-8, Las wrote:
>
> Hi,
>
> Good stuff! I was wondering how do you guys deal with "decision nodes" or 
> does is make sense to model such a thing at the nodel level.
>
> Imagine having a diamond topology e.g.
> N1
>/\
>   N2aN2b
>\/
> N3
>
> based on some input to N1, either N2a or N2b gets computed on which N3 
> depends.
>
> Does this make sense or should this "decision" step be wrapped in a node 
> "N2".
>
> Thanks,
>
> Las
>
> 2013/1/29 Aria Haghighi >
>
>> Hey all,
>>
>>  Prismatic has open-sourced our Plumbing and Graph library on 
>> github. 
>> Jason Wolfe gave a 
>> talkabout
>>  how we use graph for systems composition at Strange loop last year. 
>> Please give the library
>> a whirl and let us know if you're using it and if you find any issues or 
>> feature requests. We use this library very heavily throughout our code and 
>> hope others find it useful as well.
>>
>>  Best, Aria
>>
>> -- 
>> -- 
>> 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.
>>  
>>  
>>
>
>
>
> -- 
> László Török
>  

-- 
-- 
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: Using lein in upstart init script

2013-02-06 Thread Phil Hagelberg

David Jagoe writes:

> I need to start a ring server from an upstart script on Ubuntu. Normally I
> would use an uberjar and execute java directly, but in this case I cannot
> do AOT and would like to simply run "lein ring server-headless" from my
> upstart script. Even when I use "lein trampoline" I get "respawning too
> fast" from upstart.

You can use an uberjar without AOT; just use something like this:

$ java -cp my-uberjar.jar clojure.main -m my.namespace 8080

I think that's the proper invocation; you can do clojure.main --help for
details if that's not right. There is also a lein-otf plugin which can
create jars that work with `java -jar` without AOTing your own code.

-Phil

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

2013-02-06 Thread David Jagoe
On 6 February 2013 14:40, Phil Hagelberg  wrote:
>
> You can use an uberjar without AOT; just use something like this:
>
> $ java -cp my-uberjar.jar clojure.main -m my.namespace 8080
>

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




[ANN] Morph v0.1.0 Monads & friends: pure functions, less boilerplate

2013-02-06 Thread Armando Blancas
Morph is a new implementation of monads based on protocols. It's intended 
to provide the common patterns of error-handling, short-circuit sequencing, 
and modeling of stateful computations in pure functions. I've tried to make 
this library idiomatic while keeping it close to its Haskell roots.

This is a utility library that, I hope, can make your coding easier. No 
particular knowledge is assumed or required. The docs name things but rely 
on getting an intuitive feeling of what's going on. Protocols are relevant 
only if you want to write your own plumbing, which shouldn't be difficult; 
otherwise it's all ready to use.

Project:   https://github.com/blancas/morph
User Guide: https://github.com/blancas/morph/wiki
Codox API:  http://blancas.github.com/morph

Please use the project wiki for feedback, bug reports, or feature requests.

-- 
-- 
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] Morph v0.1.0 Monads & friends: pure functions, less boilerplate

2013-02-06 Thread Ben Wolfson
this is great, just one nit to pick about currying (because it's
something that's bitten me in the past in other contexts):

in the wiki you say "For a predefined function with a fixed number of
arguments, only the function name must be supplied.", but this is only
sort of true---the issue isn't whether the function is predefined or
not, the issue is whether the argument is a symbol that resolves to a
var. This, for instance, doesn't work:

(let [t take] (((curry t) 3) '(1 2 3 4)))

Even though "take" is a predefined function. And this picks up the
wrong metadata (this example is factitious on its face, but it could
happen in practice):

blancas.morph.core> (defn three-params [a b c] a)
#'blancas.morph.core/three-params
blancas.morph.core> (let [three-params take] (((curry three-params) 3)
'(1 2 3 4)))
#
blancas.morph.core>

because "resolve" goes directly to var bindings, overlooking other
niceties of lexical scope.

Unrelatedly:

- I couldn't figure out how to write something like foldM, because I
couldn't figure out how to call return on the seed value when the list
is empty. ISTR (when you announced your parsing library) that there
isn't a way to do that kind of thing at all?
- I'm curious about the Monoid protocol---I have one in babbage, and
it has two more methods than yours, "mempty?" and "value" (instead of
monoid-specific accessors). Why not put the accessors in the protocol?

On Wed, Feb 6, 2013 at 4:06 PM, Armando Blancas  wrote:
> Morph is a new implementation of monads based on protocols. It's intended to
> provide the common patterns of error-handling, short-circuit sequencing, and
> modeling of stateful computations in pure functions. I've tried to make this
> library idiomatic while keeping it close to its Haskell roots.
>
> This is a utility library that, I hope, can make your coding easier. No
> particular knowledge is assumed or required. The docs name things but rely
> on getting an intuitive feeling of what's going on. Protocols are relevant
> only if you want to write your own plumbing, which shouldn't be difficult;
> otherwise it's all ready to use.
>
> Project:   https://github.com/blancas/morph
> User Guide: https://github.com/blancas/morph/wiki
> Codox API:  http://blancas.github.com/morph
>
> Please use the project wiki for feedback, bug reports, or feature requests.
>
> --
> --
> 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.
>
>



-- 
Ben Wolfson
"Human kind has used its intelligence to vary the flavour of drinks,
which may be sweet, aromatic, fermented or spirit-based. ... Family
and social life also offer numerous other occasions to consume drinks
for pleasure." [Larousse, "Drink" entry]

-- 
-- 
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] Morph v0.1.0 Monads & friends: pure functions, less boilerplate

2013-02-06 Thread Ben Wolfson
this is great, just one nit to pick about currying (because it's
something that's bitten me in the past in other contexts):

in the wiki you say "For a predefined function with a fixed number of
arguments, only the function name must be supplied.", but this is only
sort of true---the issue isn't whether the function is predefined or
not, the issue is whether the argument is a symbol that resolves to a
var. This, for instance, doesn't work:

(let [t take] (((curry t) 3) '(1 2 3 4)))

Even though "take" is a predefined function. And this picks up the
wrong metadata (this example is factitious on its face, but it could
happen in practice):

blancas.morph.core> (defn three-params [a b c] a)
#'blancas.morph.core/three-params
blancas.morph.core> (let [three-params take] (((curry three-params) 3)
'(1 2 3 4)))
#
blancas.morph.core>

because "resolve" goes directly to var bindings, overlooking other
niceties of lexical scope.

Unrelatedly:

- I couldn't figure out how to write something like foldM, because I
couldn't figure out how to call return on the seed value when the list
is empty. ISTR (when you announced your parsing library) that there
isn't a way to do that kind of thing at all?
- I'm curious about the Monoid protocol---I have one in babbage, and
it has two more methods than yours, "mempty?" and "value" (instead of
monoid-specific accessors). Why not put the accessors in the protocol?

On Wed, Feb 6, 2013 at 4:06 PM, Armando Blancas  wrote:
> Morph is a new implementation of monads based on protocols. It's intended to
> provide the common patterns of error-handling, short-circuit sequencing, and
> modeling of stateful computations in pure functions. I've tried to make this
> library idiomatic while keeping it close to its Haskell roots.
>
> This is a utility library that, I hope, can make your coding easier. No
> particular knowledge is assumed or required. The docs name things but rely
> on getting an intuitive feeling of what's going on. Protocols are relevant
> only if you want to write your own plumbing, which shouldn't be difficult;
> otherwise it's all ready to use.
>
> Project:   https://github.com/blancas/morph
> User Guide: https://github.com/blancas/morph/wiki
> Codox API:  http://blancas.github.com/morph
>
> Please use the project wiki for feedback, bug reports, or feature requests.
>
> --
> --
> 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.
>
>



-- 
Ben Wolfson
"Human kind has used its intelligence to vary the flavour of drinks,
which may be sweet, aromatic, fermented or spirit-based. ... Family
and social life also offer numerous other occasions to consume drinks
for pleasure." [Larousse, "Drink" entry]

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




Sending Clojure Objects over TCP

2013-02-06 Thread JvJ
Does anyone know if there's a simplified networking library that allows 
this?

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

2013-02-06 Thread Jay Fields
http://code.google.com/p/jetlang/wiki/Remoting

On Wed, Feb 6, 2013 at 8:16 PM, JvJ  wrote:
> Does anyone know if there's a simplified networking library that allows
> this?
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> 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.
>
>

-- 
-- 
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: Sending Clojure Objects over TCP

2013-02-06 Thread Softaddicts
Objects ?!?!? You want to exchange only data structures ?
Or do you expect some form of RPC ?

Luc P.


> Does anyone know if there's a simplified networking library that allows 
> this?
> 
> -- 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> 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.
> 
> 
> 
--
Softaddicts sent by ibisMail from my ipad!

-- 
-- 
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] Morph v0.1.0 Monads & friends: pure functions, less boilerplate

2013-02-06 Thread Armando Blancas
Good catch with currying non vars; I'll try to work something out. Also, 
should come up with a general defcurry macro; I'm not happy with that. 
Things like foldM may just not be possible, but I'll keep track of these 
issues so maybe I can give you a good answer for the things you've brought 
up. Just having to deal with deftype'd monoids is a bit of a pain, so I 
welcome ideas to simplify them.

On Wednesday, February 6, 2013 4:43:33 PM UTC-8, Ben wrote:
>
> this is great, just one nit to pick about currying (because it's 
> something that's bitten me in the past in other contexts): 
>
> in the wiki you say "For a predefined function with a fixed number of 
> arguments, only the function name must be supplied.", but this is only 
> sort of true---the issue isn't whether the function is predefined or 
> not, the issue is whether the argument is a symbol that resolves to a 
> var. This, for instance, doesn't work: 
>
> (let [t take] (((curry t) 3) '(1 2 3 4))) 
>
> Even though "take" is a predefined function. And this picks up the 
> wrong metadata (this example is factitious on its face, but it could 
> happen in practice): 
>
> blancas.morph.core> (defn three-params [a b c] a) 
> #'blancas.morph.core/three-params 
> blancas.morph.core> (let [three-params take] (((curry three-params) 3) 
> '(1 2 3 4))) 
> # blancas.morph.core$eval2780 
> $G__2784__2785$G__2786__2787$fn__2788@65c66812> 
> blancas.morph.core> 
>
> because "resolve" goes directly to var bindings, overlooking other 
> niceties of lexical scope. 
>
> Unrelatedly: 
>
> - I couldn't figure out how to write something like foldM, because I 
> couldn't figure out how to call return on the seed value when the list 
> is empty. ISTR (when you announced your parsing library) that there 
> isn't a way to do that kind of thing at all? 
> - I'm curious about the Monoid protocol---I have one in babbage, and 
> it has two more methods than yours, "mempty?" and "value" (instead of 
> monoid-specific accessors). Why not put the accessors in the protocol? 
>
> On Wed, Feb 6, 2013 at 4:06 PM, Armando Blancas 
> > 
> wrote: 
> > Morph is a new implementation of monads based on protocols. It's 
> intended to 
> > provide the common patterns of error-handling, short-circuit sequencing, 
> and 
> > modeling of stateful computations in pure functions. I've tried to make 
> this 
> > library idiomatic while keeping it close to its Haskell roots. 
> > 
> > This is a utility library that, I hope, can make your coding easier. No 
> > particular knowledge is assumed or required. The docs name things but 
> rely 
> > on getting an intuitive feeling of what's going on. Protocols are 
> relevant 
> > only if you want to write your own plumbing, which shouldn't be 
> difficult; 
> > otherwise it's all ready to use. 
> > 
> > Project:   https://github.com/blancas/morph 
> > User Guide: https://github.com/blancas/morph/wiki 
> > Codox API:  http://blancas.github.com/morph 
> > 
> > Please use the project wiki for feedback, bug reports, or feature 
> requests. 
> > 
> > -- 
> > -- 
> > 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. 
> > 
> > 
>
>
>
> -- 
> Ben Wolfson 
> "Human kind has used its intelligence to vary the flavour of drinks, 
> which may be sweet, aromatic, fermented or spirit-based. ... Family 
> and social life also offer numerous other occasions to consume drinks 
> for pleasure." [Larousse, "Drink" entry] 
>

-- 
-- 
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: Sending Clojure Objects over TCP

2013-02-06 Thread JvJ
I was just looking for sending data structures.  But hey, if RPC existed 
that would be cool too.

On Wednesday, 6 February 2013 20:24:54 UTC-5, Luc wrote:
>
> Objects ?!?!? You want to exchange only data structures ? 
> Or do you expect some form of RPC ? 
>
> Luc P. 
>
>
> > Does anyone know if there's a simplified networking library that allows 
> > this? 
> > 
> > -- 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@googlegroups.com 
> > Note that posts from new members are moderated - please be patient with 
> your first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com  
> > For more options, visit this group at 
> > http://groups.google.com/group/clojure?hl=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. 
> > 
> > 
> > 
> -- 
> Softaddicts> sent by ibisMail from 
> my ipad! 
>

-- 
-- 
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: Sending Clojure Objects over TCP

2013-02-06 Thread Softaddicts
To send clojure values:

http://clojuredocs.org/clojure_core/clojure.core/pr-str

You may need to extend print-dup if you need to stringify Java objects or
defrecords.

http://amalloy.hubpages.com/hub/Dont-use-XML-JSON-for-Clojure-only-persistence-messaging

Have a nice reading and come back if some of that stuff remains unclear.

Luc P.



> I was just looking for sending data structures.  But hey, if RPC existed 
> that would be cool too.
> 
> On Wednesday, 6 February 2013 20:24:54 UTC-5, Luc wrote:
> >
> > Objects ?!?!? You want to exchange only data structures ? 
> > Or do you expect some form of RPC ? 
> >
> > Luc P. 
> >
> >
> > > Does anyone know if there's a simplified networking library that allows 
> > > this? 
> > > 
> > > -- 
> > > -- 
> > > You received this message because you are subscribed to the Google 
> > > Groups "Clojure" group. 
> > > To post to this group, send email to clo...@googlegroups.com 
> > > Note that posts from new members are moderated - please be patient with 
> > your first post. 
> > > To unsubscribe from this group, send email to 
> > > clojure+u...@googlegroups.com  
> > > For more options, visit this group at 
> > > http://groups.google.com/group/clojure?hl=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. 
> > > 
> > > 
> > > 
> > -- 
> > Softaddicts> sent by ibisMail from 
> > my ipad! 
> >
> 
> -- 
> -- 
> 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.
> 
> 
> 
--
Softaddicts sent by ibisMail from my ipad!

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




Clojure/West (Portland, Mar 18-20) - Mission Kontrol, unsessions, lightning talks

2013-02-06 Thread Alex Miller
Clojure/West has a great schedule lined up. If you haven't yet, check out
the schedule at http://clojurewest.org/schedule. You can register at
http://regonline.com/clojurewest2013.

If you've seen the odd couple (Dan Friedman and Will Byrd) talking about
miniKanren and logic programming, you know they have a lot of interesting
stuff to show. We've got a whole miniKanren Confo lined up colocated with
Clojure/West, with not just Dan and Will, but David Nolen, and some other
great talks (http://clojurewest.org/sessions#confo). Register as an
optional item when you register for Clojure/West.

If you're coming in the night before the conference, we've got Mission
Kontrol, the arcade wonderland reserved with FREE PLAY on all games from
7-9 pm. It's just a couple blocks from the hotel.

Unsessions (https://github.com/strangeloop/clojurewest2013/wiki/Unsessions)
and lightning talks (http://bit.ly/WBqELu) are now open for submissions.
Unsessions will be scheduled based on interest and lightning talks will be
opened up to a poll of attendees prior to the conference.

Gonna be great!
Alex

-- 
-- 
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: Callbacks as Sequences

2013-02-06 Thread Feng Shen
I did something for a http lib:

;; get them concurrently(let [response1 (http/get "http://http-kit.org/";)
  response2 (http/get "http://clojure.org/";)]
  ;; handle responses one-by-one, waiting for response as necessary
  ;; other keys :headers :status :error :opts
  (println "response1: " (:body @response1))
  (println "response2: " (:body @response2)))



On Thursday, February 7, 2013 2:45:36 AM UTC+8, da...@dsargeant.com wrote:
>
> I'm not to clojure/clojurescript and was wondering if anyone has taken a 
> crack at writing a macro that transforms callbacks into a sequence.  There 
> is an awesome implementationion in LispyScript show here: 
> https://gist.github.com/santoshrajan/3715526.  Thanks for help.
>
> 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: Possible bug in clojure.java.jdbc

2013-02-06 Thread Sean Corfield
Try this:

...
(jdbc/with-quoted-identifiers \"
(jdbc/update-or-insert-values ...))
...

clojure.java.jdbc supports generic naming strategies that specify how to
wrap column names (going into JDBC) and how to convert column names (back
to Clojure keys on the way out of JDBC).

Different databases use different quoting conventions - MySQL supports
`column` for example. I think MS SQL Server supports [column] so you can do
that by passing a two element vector to with-quoted-identifiers [\[ \]]

By default, c.j.jdbc converts column names to lowercase keywords when
returning a resultset but you can use a naming strategy to override that
and return column names as-is, for example.

See the docs for more details:

http://clojure.github.com/java.jdbc/#clojure.java.jdbc/with-naming-strategy

Sean


On Tue, Feb 5, 2013 at 11:15 PM,  wrote:

> @Andy: Sorry, I didn't know the proper channel, I'll post it there.
>
> I don't control the column names. They're imported from an excel
> spreadsheet or assigned by the client I'm writing the app for. From
> experience, it is certainly *possible*, at least to add these columns.
> Currently I just have a function that "escapes" the user input, replacing
> special characters with lookalikes (i.e. space with an underscore).
>
> On Tuesday, February 5, 2013 10:42:50 PM UTC-8, Sean Corfield wrote:
>
>> Andy's right on process... but as maintainer of clojure.java.jdbc, I
>> have to ask: why on earth do you have column names containing spaces
>> or & or other weird characters? That's a serious question: how do you
>> get into that situation?
>>
>> I'm not saying clojure.java.jdbc can't be updated to support it, I'm
>> just questioning whether it should...
>>
>> On Tue, Feb 5, 2013 at 7:32 PM, Andy Fingerhut 
>> wrote:
>> > You can create a ticket for java.jdbc here if you wish that describes
>> the problem and what you think will fix it.  Then any of the 500+ Clojure
>> contributors can take a shot at fixing it:
>> >
>> > 
>> > http://dev.clojure.org/jira/**browse/JDBC
>> >
>> > Andy
>> >
>> > On Feb 5, 2013, at 7:07 PM, al...@bitlimn.com wrote:
>> >
>> >> Hey all,
>> >>
>> >> I've been using clojure.java.jdbc to write a simple database app. When
>> I use the `update-or-insert-values` function, I get an SQLException thrown
>> whenever my column names have special characters in them (like a space or
>> an ampersand). I think the solution is in line 908: the column-strs should
>> be quoted before calling `interpose`. If you do `(map #(str "\"" %1 "\"")
>> column-strs)` that should do it?
>> >>
>> >> I can get around this by just writing my own version, but I wanted to
>> patch it for everybody. I was told in #clojure that I can't? Anyways, I'm
>> going to try to get in contact with the maintainer, but if anyone here has
>> contributing rights, and would like to patch it, you have my thanks.
>> >>
>> >> --semisight
>> >
>> > --
>> > --
>> > 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.
>>
>> >
>> >
>>
>>
>>
>> --
>> Sean A Corfield -- (904) 302-SEAN
>> An Architect's View -- http://corfield.org/
>> World Singles, LLC. -- http://worldsingles.com/
>>
>> "Perfection is the enemy of the good."
>> -- Gustave Flaubert, French realist novelist (1821-1880)
>>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> 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.
>
>
>



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

"Perfection is the enemy of the good."
-- Gustave Fla

Re: Clojure/West (Portland, Mar 18-20) - Mission Kontrol, unsessions, lightning talks

2013-02-06 Thread Rich Morin
On Feb 6, 2013, at 18:27, Alex Miller wrote:
> If you're coming in the night before the conference, we've got Mission 
> Kontrol,
> the arcade wonderland reserved with FREE PLAY on all games from 7-9 pm.  It's
> just a couple blocks from the hotel. 

And, if you think real computers are more fun to play with than video games,
drop by the Datomic Hack Session, starting at ~3 pm...

-r

 -- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


-- 
-- 
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 (Portland, Mar 18-20) - Mission Kontrol, unsessions, lightning talks

2013-02-06 Thread Leonardo Borges
Hey Rich,

Where can we find more about this datomic hack session?
Leonardo Borges
www.leonardoborges.com


On Thu, Feb 7, 2013 at 4:03 PM, Rich Morin  wrote:
> On Feb 6, 2013, at 18:27, Alex Miller wrote:
>> If you're coming in the night before the conference, we've got Mission 
>> Kontrol,
>> the arcade wonderland reserved with FREE PLAY on all games from 7-9 pm.  It's
>> just a couple blocks from the hotel.
>
> And, if you think real computers are more fun to play with than video games,
> drop by the Datomic Hack Session, starting at ~3 pm...
>
> -r
>
>  --
> http://www.cfcl.com/rdmRich Morin
> http://www.cfcl.com/rdm/resume r...@cfcl.com
> http://www.cfcl.com/rdm/weblog +1 650-873-7841
>
> Software system design, development, and documentation
>
>
> --
> --
> 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.
>
>

-- 
-- 
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: Tawny-OWL 0.9

2013-02-06 Thread Frank Siebenlist
There is one more important difference between EPL and GPL/LGPL that we should 
be aware off:

You cannot copy snippets out of Philip's LGPL'ed code and use them in your own 
EPL'ed code.

For me, one of the great benefits of all the EPL'ed clojure libraries out there 
is, that I've freely borrowed and stolen many functions and snippets from 
libraries of coders much smarter than me…

This is just an observation and warning, and I do not want to engage in any 
religious open source licensing argument…

… however, from a personal benefit point of view, if you want to publish your 
code as open source for the clojure community, and you do not care too much 
about whether it should be EPL or GPL/LGPL, then please choose EPL. If you care 
strongly about GPL/LGPL, more power to you and thanks for sharing the library 
also!

Thanks, Frank.


On Feb 6, 2013, at 12:06 AM, Phillip Lord  wrote:

> 
> This should be fine. Both EPL and LGPL are weak copyleft. Clojure code
> does not need to be EPL because EPL does not force it. Likewise, Clojure
> can call back to this LGPL library because, the LGPL doesn't enforce
> derivative works as a whole to be LGPL (although modifications to the
> tawny *would* have to be LGPL, likewise, modified versions of Clojure).
> 
> The uber jar is a red herring, I think. It's an aggregation, not a
> derivative work. The same problem would exist even if I EPL'd the
> library; it uses the OWL API underneath, and this is LGPL also. 
> 
> If code written in Clojure were affected by the EPL, then it would have
> been a fairly poor choice of license, I feel. 
> 
> Phil
> 
> 
> AtKaaZ  writes:
> 
>> you can release that on LGPL License ?
>> does that work with the EPL of clojure ? or is it only an issue when lein
>> uberjar-ed ?
>> 
>> 
>> 
>> On Tue, Feb 5, 2013 at 5:57 PM, Phillip Lord
>> wrote:
>> 
>>> 
>>> 
>>> Tawny-OWL is a clojure library which provides a DSL for the construction
>>> of OWL Ontologies (http://www.w3.org/2004/OWL/). The practical upshot of
>>> this, is that allows a form of logic reasoning over sets of facts about
>>> the world, with strong computational guarantees about decidability.
>>> 
>>> At it's simplest it looks rather like the Manchester Syntax, but is
>>> fully programmatic language, which allows for arbitrary templating of
>>> expressions. Where possible, it uses clojure facilities directly, so
>>> things like autocomplete, and documentation look up work out-of-the-box,
>>> in what ever IDE is your poison.
>>> 
>>> It comes complete with reasoner support using HermiT
>>> (http://www.hermit-reasoner.com/) or ELK
>>> (http://code.google.com/p/elk-reasoner/). Tawny-OWL current implements
>>> all of the object and annotation side of OWL; expression of datatype
>>> properties will follow shortly.
>>> 
>>> Although, it's been available for a while, this is the first release
>>> that I have announced here. I'd welcome feedback. The Clojure is a bit
>>> nasty at places--I learnt the language at the same time.
>>> 
>>> https://github.com/phillord/tawny-owl
>>> 
>>> and on clojars.
>>> 
>>> Phil
>>> 
>>> 
>>> --
>>> Phillip Lord,   Phone: +44 (0) 191 222 7827
>>> Lecturer in Bioinformatics, Email:
>>> phillip.l...@newcastle.ac.uk
>>> School of Computing Science,
>>> http://homepages.cs.ncl.ac.uk/phillip.lord
>>> Room 914 Claremont Tower,   skype: russet_apples
>>> Newcastle University,   msn: m...@russet.org.uk
>>> NE1 7RU twitter: phillord
>>> 
>>> --
>>> --
>>> 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.
>>> 
>>> 
>>> 
>> 
>> 
>> -- 
>> Please correct me if I'm wrong or incomplete,
>> even if you think I'll subconsciously hate it.
>> 
>> -- 
> 
> -- 
> Phillip Lord,   Phone: +44 (0) 191 222 7827
> Lecturer in Bioinformatics, Email: phillip.l...@newcastle.ac.uk
> School of Computing Science,
> http://homepages.cs.ncl.ac.uk/phillip.lord
> Room 914 Claremont Tower,   skype: russet_apples
> Newcastle University,   msn: m...@russet.org.uk
> NE1 7RU twitter: phillord
> 
> -- 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post t

mysql auth issue when using upstart for ring

2013-02-06 Thread Omer Iqbal
Hey, I used a similar upstart script which works fine for ring.
However, weirdly enough, my auth with a mysql database fails. I'm using 
korma to interface with the db. The problem only occurs with upstart 
script,, because it works fine when I run it myself.
To be clearer. When I run: lein trampoline run/lein ring server, my db 
connects fine.
However, I use the following upstart script:

start on startup
start on runlevel [2345]
stop on runlevel [!2345]
chdir /home/ubuntu/www
setuid ubuntu
exec lein trampoline run > out.log 2>&1

When I run the daemon, ring runs fine. However, when it communicates with 
the mysql server, it throw the following exception (amongst a sea of stack 
traces): "java.sql.SQLException: Access denied for user 'root'@'localhost' 
(using password: NO)"

This is weird because my korma config does supply a password, and it works 
fine when I run lein run myself. However for reference sake, I check for an 
environment variable(CLJ_ENV) to decide which config to use. SInce the only 
differentiating factor is upstart, my assumption is that the problem is due 
to setuid. But to be honest, I have no idea what's going wrong.

Oh, and for clarification this is all on an aws machine running Ubuntu 
Server 12.04 LTS.
Any ideas on whats going on?

-- 
-- 
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: mysql auth issue when using upstart for ring

2013-02-06 Thread Omer Iqbal



On Thursday, February 7, 2013 3:12:22 PM UTC+8, Omer Iqbal wrote:
>
> Hey, I used a similar upstart script which works fine for ring.

[EDIT] ignore the above sentence. I was originally replying to a thread. 
#mybad 

> However, weirdly enough, my auth with a mysql database fails. I'm using 
> korma to interface with the db. The problem only occurs with upstart 
> script,, because it works fine when I run it myself.
> To be clearer. When I run: lein trampoline run/lein ring server, my db 
> connects fine.
> However, I use the following upstart script:
>
> start on startup
> start on runlevel [2345]
> stop on runlevel [!2345]
> chdir /home/ubuntu/www
> setuid ubuntu
> exec lein trampoline run > out.log 2>&1
>
> When I run the daemon, ring runs fine. However, when it communicates with 
> the mysql server, it throw the following exception (amongst a sea of stack 
> traces): "java.sql.SQLException: Access denied for user 'root'@'localhost' 
> (using password: NO)"
>
> This is weird because my korma config does supply a password, and it works 
> fine when I run lein run myself. However for reference sake, I check for an 
> environment variable(CLJ_ENV) to decide which config to use. SInce the only 
> differentiating factor is upstart, my assumption is that the problem is due 
> to setuid. But to be honest, I have no idea what's going wrong.
>
> Oh, and for clarification this is all on an aws machine running Ubuntu 
> Server 12.04 LTS.
> Any ideas on whats going on?
>

-- 
-- 
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: Inflection on clojure.java.io/reader and writer

2013-02-06 Thread Valentin Golev

> Welcome to a world of values, not containers (the blue pieces can only 
fit in the blue 
> container, the red ones  you get the picture) or as Rich says places. 

I always thought that by places he means mutable identifiers; languages 
like Haskell have a lot of luck with type-checking immutable *values*. I 
don't see how appreciation for values over places leads to lack of 
type-checking.

On Wednesday, February 6, 2013 4:50:54 AM UTC+4, Luc wrote:
>
> You are not defining a type here. A type hint is just that... a hint so 
> the compiler 
> can optimize the code it generates to call the readLine method on this 
> specific 
> object class. 
>
> As an example, if io/reader returned an object of a different class at 
> runtime 
> than BufferedReader, it would not fail even if the hint says "expect an 
> object of this class". 
>
> The generated code testing that the object is not of the hinted class 
> would 
> resort to reflection on the object class to find if the readLine method 
> exists. 
> If not you will get the usual runtime error saying that the method does 
> not exists. 
>
> The Clojure compiler has no type checking equivalent to Java, C, ... 
> You can define stuff that is not even bound to a value, it would be hard 
> to type check on 
> these at compile time, no ? 
>
> Welcome to a world of values, not containers (the blue pieces can only fit 
> in the blue 
> container, the red ones  you get the picture) or as Rich says places. 
>
> Luc P. 
>
>
> > That's funny, I did exactly the same thing and wrote BufferedReader for 
> > both. DOH! 
> > 
> > Although I have no idea how the internals of type hinting is, I do think 
> > it's peculiar that there doesn't seem to be type error checking, even 
> > though we are explicitly "defining" the type. I would feel like it 
> should 
> > error, instead of falling back on reflection. 
> > 
> > Kanwei 
> > 
> > On Monday, February 4, 2013 12:36:51 PM UTC-5, AtKaaZ wrote: 
> > > 
> > > in other words: 
> > > this: 
> > > 
> > >   (let [in (clojure.java.io/reader src) 
> > > out (clojure.java.io/writer dest) 
> > > 
> > > 
> > > becomes this: 
> > > (let [^java.io.BufferedReader in (clojure.java.io/reader src) 
> > >^java.io.BufferedWriter out (clojure.java.io/writer dest) 
> > > 
> > > 
> > > and it works for me too. (but I wasted some time by having 
> BufferedReader 
> > > in both places) 
> > > 
> > > 
> > > On Mon, Feb 4, 2013 at 6:26 PM, Andy Fingerhut 
> > >  
>
> > > > wrote: 
> > > 
> > >> I don't have CCW Eclipse installed to test, but by saving that file 
> on my 
> > >> Mac (should also work on Linux) in a subdirectory "obj", and editing 
> it to 
> > >> add the ^java.io.BufferedReader in and ^java.io.BufferedWriter out 
> type 
> > >> hints as suggested by Luc P. earlier in this thread, I was able to 
> > >> eliminate the reflection warnings: 
> > >> 
> > >> % mkdir obj 
> > >> % cp  obj/solutions.clj 
> > >> 
> > >> # Original file without the type hints gives reflection warnings as 
> > >> expected 
> > >> 
> > >> % java -Dclojure.compile.path=./obj -cp clojure-1.4.0.jar:./obj 
> > >> clojure.lang.Compile solution 
> > >> Compiling solution to ./obj 
> > >> Reflection warning, solution.clj:38 - reference to field readLine 
> can't 
> > >> be resolved. 
> > >> Reflection warning, solution.clj:45 - reference to field readLine 
> can't 
> > >> be resolved. 
> > >> Reflection warning, solution.clj:63 - reference to field newLine 
> can't be 
> > >> resolved. 
> > >> Reflection warning, solution.clj:54 - reference to field newLine 
> can't be 
> > >> resolved. 
> > >> 
> > >> # Now I hand-edit obj/solutions.clj to add the type hints, and 
> recompile. 
> > >>  No reflection warnings. 
> > >> % java -Dclojure.compile.path=./obj -cp clojure-1.4.0.jar:./obj 
> > >> clojure.lang.Compile solution 
> > >> Compiling solution to ./obj 
> > >> % 
> > >> 
> > >> Perhaps you should try verifying that you added the type hints 
> correctly, 
> > >> saved the source file, recompiled the one you wanted to in CCW 
> Eclipse, etc. 
> > >> 
> > >> Andy 
> > >> 
> > >> 
> > >> On Feb 4, 2013, at 9:10 AM, Kanwei Li wrote: 
> > >> 
> > >> Hey Andy, 
> > >> 
> > >> Thanks for offering to help. Here's a gist: 
> > >> https://gist.github.com/4696105 
> > >> 
> > >> As you can see at the bottom, I want the main method to read/write to 
> > >> STDIN/STDOUT, but for testing, I want to read from files instead. 
> > >> 
> > >> This is what I get in both CCW Eclipse and nrepl: 
> > >> 
> > >> Reflection warning, NO_SOURCE_PATH:4 - reference to field readLine 
> can't 
> > >> be resolved. 
> > >> 
> > >> Reflection warning, NO_SOURCE_PATH:11 - reference to field readLine 
> can't 
> > >> be resolved. 
> > >> 
> > >> Reflection warning, NO_SOURCE_PATH:29 - reference to field newLine 
> can't 
> > >> be resolved. 
> > >> 
> > >> Reflection warning, NO_SOURCE_PATH:20 - reference to field newLine 
> can't 
> > >> be resolved. 
> > >> Thanks! 
> > >> 
> > >>

Clojure - Python Style suggestion

2013-02-06 Thread Marco Munizaga
We had this talk with scheme. They called it I expressions. Here is the link 
http://srfi.schemers.org/srfi-49/srfi-49.html

Do it because you can, and so you can decide for yourself what to think about 
it. 

-- 
-- 
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 - Python Style suggestion

2013-02-06 Thread Chris Ford
If someone does write a Lisp with significant whitespace, can we please
call it "Whitespathe"?

On 7 February 2013 10:30, Marco Munizaga  wrote:

> We had this talk with scheme. They called it I expressions. Here is the
> link http://srfi.schemers.org/srfi-49/srfi-49.html
>
> Do it because you can, and so you can decide for yourself what to think
> about it.
>
> --
> --
> 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.
>
>
>

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