Re: Best Way To Implement Priority Map With Finite Size

2014-03-28 Thread milinda
Sorry I forgot the link [1].

Thanks
Milinda

[1] https://github.com/clojure/data.priority-map

On Saturday, March 29, 2014 12:28:17 AM UTC-4, milinda wrote:
>
> Hi All,
>
> I wanted to extend priority-map which can be found at [1] to support size 
> limitation. So when the map is full I need to drop element/elements based 
> on priority when assoc is call with a new key/keys. Is using the deftype 
> the best way? If I use deftype can I only implement assoc or limited number 
> of functions from IPeristentMap. Really appriciate your feedback.
>
> Thanks
> Milinda
>

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


test.check, quickcheck concurrency

2014-03-28 Thread Brian Craft
Re: John Hughes' talk at clojure/west, at the end he did a fairly 
incredible demo of testing concurrency. It doesn't look like this was 
implemented in test.check (or I'm not finding it). Are there any plans?

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


Best Way To Implement Priority Map With Finite Size

2014-03-28 Thread milinda
Hi All,

I wanted to extend priority-map which can be found at [1] to support size 
limitation. So when the map is full I need to drop element/elements based 
on priority when assoc is call with a new key/keys. Is using the deftype 
the best way? If I use deftype can I only implement assoc or limited number 
of functions from IPeristentMap. Really appriciate your feedback.

Thanks
Milinda

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


Re: using contrib functions

2014-03-28 Thread John Gabriele
On Friday, March 28, 2014 10:40:55 PM UTC-4, Christopher Howard wrote:
>
> Hi. --Insert here the usual caveats about being new to Clojure and 
> Java.-- 
>
> I wanted to try out this Contrib function describe on this 
> page 
> <
> http://richhickey.github.io/clojure-contrib/types-api.html#clojure.contrib.types/defadt>.
>  
> How 
> do I get that in my project?
>

Hi Chris,

I'm not sure, but that link you have may be referring to the old defunct 
monolithic contrib library.

You can find a listing of all current modular contrib libraries at 
. The links 
there point to their respective homes on github. API docs for the contrib 
libs are available at .

As described on the individual github pages, to use a contrib lib, you need 
to put something like the following into your project.clj's :dependencies 
vector:

[org.clojure/foo.bar "1.2.3"]  ; That's group-id/artifact-id.

and then, in your source code file's `ns` macro, something like:

(:require [clojure.foo.bar :as foob])  ; clojure.foo.bar is a namespace 
provided by the org.clojure/foo.bar lib.

Note: don't let the dots in the contrib lib's group-id and artifact-id 
throw you. The group-id and artifact-id are not *necessarily* related to 
the namespace(s) provided by the lib, though they usually have pieces in 
common.

-- John


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


Re: using contrib functions

2014-03-28 Thread Sean Corfield
BTW, where did you find the references to defadt and clojure.contrib.types? 
Perhaps we can get the original references updated so people aren't misled in 
future...

Sean

On Mar 28, 2014, at 8:05 PM, Sean Corfield  wrote:
> On Mar 28, 2014, at 7:40 PM, Christopher Howard  wrote:
>> I wanted to try out this Contrib function describe on this
>> page
>> .
>>  How
>> do I get that in my project? Trying to follow documentation, I did
> 
> That's very out of date documentation. The current documentation is here:
> 
>   http://clojure.github.io/
> 
> The old monolithic clojure-contrib library hasn't been maintained for a very 
> long time.
> 
> Some parts of that library were migrated to the new modular contrib 
> libraries. You can read more about that here:
> 
>   http://dev.clojure.org/display/community/Where+Did+Clojure.Contrib+Go
> 
> The old clojure.contrib.types library was not one of those so it's 
> essentially "gone" now. That usually means there are better ways to do what 
> the old library did - or that the old library was never really a good way to 
> do things in the first place. I've no idea what defadt was meant to do, I'm 
> afraid.




signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: using contrib functions

2014-03-28 Thread Sean Corfield
On Mar 28, 2014, at 7:40 PM, Christopher Howard  wrote:
> I wanted to try out this Contrib function describe on this
> page
> .
>  How
> do I get that in my project? Trying to follow documentation, I did

That's very out of date documentation. The current documentation is here:

http://clojure.github.io/

The old monolithic clojure-contrib library hasn't been maintained for a very 
long time.

Some parts of that library were migrated to the new modular contrib libraries. 
You can read more about that here:

http://dev.clojure.org/display/community/Where+Did+Clojure.Contrib+Go

The old clojure.contrib.types library was not one of those so it's essentially 
"gone" now. That usually means there are better ways to do what the old library 
did - or that the old library was never really a good way to do things in the 
first place. I've no idea what defadt was meant to do, I'm afraid.

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

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)





signature.asc
Description: Message signed with OpenPGP using GPGMail


using contrib functions

2014-03-28 Thread Christopher Howard
Hi. --Insert here the usual caveats about being new to Clojure and
Java.--

I wanted to try out this Contrib function describe on this
page
.
 How
do I get that in my project? Trying to follow documentation, I did
"lein search":
  
code:

my-host:~/my-project$ lein search contrib
Warning: couldn't download index for http://repo1.maven.org/maven2
 == Results from clojars - Showing page 1 / 1 total
[webnf.deps/contrib "0.0.1"] The uber dependency to get a full set of popular
  dependencies. For development or when you have room in your .m2 repo.

my-host:~/my-project$ lein search clojure.contrib.types
Warning: couldn't download index for http://repo1.maven.org/maven2
my-host:~/my-project$ lein search defadt
Warning: couldn't download index for http://repo1.maven.org/maven2


Is that "webnf" package the thing I am supposed to put in my
"dependencies" list? Version 0.0.1 doesn't sound right. Or am I
supposed to download something myself and throw it in my lib
directory?

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


Error when starting REPL

2014-03-28 Thread Niels van Klaveren
Its a problem with writing to a temp folder. Run Ccw as admin, or take a look 
at the counterclockwise group for a solution that doesn't need that.

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


Re: Unexpected core.async timeout behaviour

2014-03-28 Thread Timothy Baldridge
This is a caused by an interesting interaction of two things: 1) channels
can have no more than 1024 pending takes at a time. and 2) (timeout)
"caches" it's return value for a given ms + window size of time. At the
moment, window is about 5-10ms.

This error message is normally the result of a bug. That is to say, if you
have 1024 pending (not buffered, but actual blocking) takes/puts, then
normally your system is not considering back pressure in some way. So we
created an arbitrary limit imposed to keep people from writing bad code. If
you think of it, pending takes/puts can create unbounded queues on the
input/output of a channel. This is an attempt to make that queue size
bounded.

However, in your problem you have something else going on as well. In order
to make calls to timeout fast inside an inner loop, timeout will often
return the same channel from more than one call to the function. So if you
call timeout every millisecond, you'll get the same channel about 5-10
times. This increases performance, and since the timeout logic involved
isn't highly accurate anyways this performance optimization rarely causes
very many problems.

If this is causing a problem in an actual system I'd love to hear about it.
Neither of these issues are caused by hard limits in the design of
core.async. So they could be tweaked, but we'll probably only do so if we
have a concrete example of a problem. So a use case would be needed,
instead of an arbitrary failing test case.

Timothy


On Fri, Mar 28, 2014 at 6:21 AM, Peter Taoussanis wrote:

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



-- 
"One of the main causes of the fall of the Roman Empire was that-lacking
zero-they had no way to indicate successful termination of their C
programs."
(Robert Firth)

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


Re: working with "multiple" return values

2014-03-28 Thread Nicola Mometto

You can use destructuring
user=> (let [[a b] [(+ 1 2) (+ 2 3)]]
 [a b])
[3 5]


Christopher Howard writes:

> In Clojure, what is the easiest (cleanest) way to return "multiple"
> values from a function, in order to work with them immediately
> afterwards? In Haskell you can return a tuple, and pattern match the
> components into variables.
>
> Prelude> let (a, b) = (1 + 4, 2 - 1)
> Prelude> a
> 5
> Prelude> b
> 1
>
> IIRC, Python has something similar.
>
> I know how to return a list or a vector, of course, but I'm imagining
> having to put in a bunch of cludgy code to extract the components into
> variables, which is not appealing.

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


working with "multiple" return values

2014-03-28 Thread Christopher Howard
In Clojure, what is the easiest (cleanest) way to return "multiple"
values from a function, in order to work with them immediately
afterwards? In Haskell you can return a tuple, and pattern match the
components into variables.

Prelude> let (a, b) = (1 + 4, 2 - 1)
Prelude> a
5
Prelude> b
1

IIRC, Python has something similar.

I know how to return a list or a vector, of course, but I'm imagining
having to put in a bunch of cludgy code to extract the components into
variables, which is not appealing.

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


Re: Amazonica performance: options?

2014-03-28 Thread Dave Tenny
Actually, let me withdraw the question for now.  If I call an unfiltered
(describe-images) on my account I'll get ~27,900 images.  It takes 70
seconds to retrieve them using the Java api
(from clojure).

If I then print (str image) for all those images to a file, that makes adds
another 153 seconds for a total of 223 seconds.  Presumably that's the
normal java toString() method invocation.

If I print out the Amazonica version of it, it takes 195 seconds,
presumably because we're sharing keyword references internally and so
abusing memory less overall (just a wild guess).

So if I do the native calls and cherry pick the information I want (like
the java EC2 CLI does), then I can get the time down significantly.
Otherwise Amazonica is probably doing a reasonable job given what I'm
asking of it.

And, in the wisdom gained department, never do unfiltered (describe-images)
requests if you can help it :-)




On Fri, Mar 28, 2014 at 12:52 PM, Michael Cohen  wrote:

> time ec2-describe-images -a > ec2-cli-images.txt
>
> real  1m26.401s
> user  0m6.551s
> sys 0m1.159s
>
> and writes a 7.5MB file to disk. Note the -a flag, to list all of the
> available public images.
>
> in a repl,
>
> (time (spit "clj-awz-images.txt" (describe-images)))
>
> "Elapsed time: 90258.47 msecs"
>
> and writes an 18MB file to disk containing all the available public
> images.
>
> Am I missing something?
>
> You can also pass a list of filters to the call to narrow the result.
>
>
>
> On Friday, March 28, 2014 7:59:48 AM UTC-7, Dave Tenny wrote:
>>
>> I'm trying to code some amazonica based solutions in a nontrivial AWS
>> environment.
>> I work with many AWS accounts and it isn't unusual to see a thousand
>> instances running on one account, and similar excesses in other types of
>> AWS resources.  So if you're going an ec2-describe-instances (or amazonica
>> equivalent), it needs not to choke in this environment.
>>
>> I like the way amazonica does all the bean marshalling for me so I can
>> express queries simply.  But the returned datasets need to be more
>> pragmatic/performant.
>>
>> The problem for me is that Amazonica doesn't seem up to the task of
>> dealing with queries that return large volumes of data.
>> It has nothing to do with reflection I suspect, and more to do with
>> unwieldy amounts of duplicate information in the result unmarshalling
>> process.
>> The "clojure all the way down" philosophy results of duplicated
>> information and just printing the result to a file takes a long time.
>> If I accidentally let the output go to an emacs cider repl buffer, then
>> things get so wedged up to the point I  may as well kill -9 emacs.
>> (Known cider repl issues here, it isn't all amazonica).
>>
>> For example:  here's how long it takes to run the java based ec2 cli to
>> describe instances on an account:
>>
>> $ time ec2-describe-images >/tmp/ec2-cli-images.out
>>
>> real0m11.484s
>> user0m2.564s
>> sys 0m0.129s
>>
>>
>> And here's how long it takes from a 'lein repl' to run the same query on
>> the same account:
>>
>> (time (with-output ["/tmp/clj-awz-images.out"] (println
>> (ec2/describe-images
>> "Elapsed time: 194685.552683 msecs"
>>
>> Now the amount of data being printed by the EC2 CLI is of course much
>> different than the output from Amazonica,
>> amazonica is returning everything in gory duplicate map detail, ec2 is
>> not, as evidenced by the relative output sizes:
>>
>> -rw-rw-r--.  1 dave dave 17201290 Mar 28 10:35 clj-awz-images.out
>> -rw-rw-r--.  1 dave dave99342 Mar 28 10:26 ec2-cli-images.out.11.5s
>>
>> Where the amazonica output starts with:
>> {:images [{:hypervisor xen, :state available, :virtualization-type
>> paravirtual, :root-device-type instance-store,
>> ... and goes on like that with duplicate keywords all the way down.
>>
>> Anyway, my goal isn't to turn amazonica into ec2 cli.  But even the most
>> trivial operations in amazonica (especially the most trivial, i.e. those
>> lacking filters against large data sets), pretty  much whack me left and
>> right
>> with CPU wedged tools and (completely unacceptable) long waits for
>> results.
>>
>> Any suggestions on how to use amazonica in a way where the output is ...
>> different, and minimal/workable?
>>
>> Or am I left with going to another package or writing my own java sdk
>> api's directly?
>>
>> I'm pretty sure the results need to be structures whose relationship to
>> data values is implicit (and not explicit in map keys). I don't see any
>> options with amazonica to change this however.
>>
>> Thanks for suggestions, forgive me if I've missed something obvious.  I'm
>> just trying to see what's out there and at the same time move along quickly
>> enough that I can get some usable tools for work (so I can lose all my
>> python and bash scripts for various interfaces, I want clojure!).
>>
>> - Dave
>>
>>
>>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this gr

Re: java interop help for beginner calling java class

2014-03-28 Thread bryan webb
Thanks the help is much appreciated


 created file ocfLZWBW,java
added 
package my.nice.lzw;   to the top of the file

changed 
/*     */ public class OcfLZW  to  /*     */ public class OcfLZWBW

compiled ocfLZWBW.java to a class file of ocfLZWBW.class  (no errors)

in eclipse added the ocfLZWBW.class files

in eclipse i see public class my.nice.lzw.ocfLZWBW when i use the class file 
editor


added 

(let [oi (my.nice.lzw.OcfLZWBW.)  buff  buffout]  ;; instantiate an object of 
that class 
    (.expand oi buff buffout)) ;; call its expand() method 

fired up the repl 


get a compilerexception
java.lang.ClassNotFoundException: my.nice.lzw.ocfLZWBW







On Friday, March 28, 2014 12:15 PM, Tassilo Horn  wrote:
 
"bww00amd...@yahoo.com"  writes:

> I have read so much i cant see the tree for the forest.  and need some
> help calling the ocfLZW class below from clojure.

If that's really the complete class definition...

> /*     */ public class OcfLZW
> /*     */ {

... then you can't use it from Clojure because it's defined in the
default package.  There's no way to refer to such classes from any other
package except from the default package itself (no matter if from
Clojure or Java).

Solution: Add a

  package my.nice.lzw;

to the top of the java file.  Then you can instantiate it and call its
method's from Clojure like so:

  (let [oi (my.nice.lzw.OcfLZW.)    ;; instantiate an object of that class
        s-inefficient ...
        out ...]
    (.expand oi s-inefficient out)) ;; call its expand() method

HTH,
Tassilo

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


Error when starting REPL

2014-03-28 Thread Arie van Wingerden
Hi,

I freshly installed the stand-alone Counterclockwise in Windows 8.1.

When I execute: "Load file in REPL" I get this error:

java.io.IOException: Access denied
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(Unknown Source)
at java.io.File.createTempFile(Unknown Source)
at java.io.File.createTempFile(Unknown Source)
at leiningen.javac$javac_options.invoke(javac.clj:66)
at leiningen.javac$run_javac_subprocess.invoke(javac.clj:115)
at leiningen.javac$javac.doInvoke(javac.clj:139)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.Var.invoke(Var.java:415)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$resolve_task$fn__3029.doInvoke(main.clj:189)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$apply_task.invoke(main.clj:230)
at leiningen.core.eval$run_prep_tasks.invoke(eval.clj:43)
at leiningen.core.eval$prep.invoke(eval.clj:57)
at leiningen.core.eval$eval_in_project.invoke(eval.clj:323)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.repl$repl.doInvoke(repl.clj:263)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$resolve_task$fn__3029.doInvoke(main.clj:189)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$apply_task.invoke(main.clj:230)
at leiningen.core.main$resolve_and_apply.invoke(main.clj:234)
at leiningen.update_in$update_in.doInvoke(update_in.clj:34)
at clojure.lang.RestFn.invoke(RestFn.java:573)
at clojure.lang.Var.invoke(Var.java:440)
at clojure.lang.AFn.applyToHelper(AFn.java:193)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$resolve_task$fn__3029.doInvoke(main.clj:189)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$apply_task.invoke(main.clj:230)
at leiningen.core.main$resolve_and_apply.invoke(main.clj:234)
at leiningen.update_in$update_in.doInvoke(update_in.clj:34)
at clojure.lang.RestFn.invoke(RestFn.java:1138)
at clojure.lang.Var.invoke(Var.java:465)
at clojure.lang.AFn.applyToHelper(AFn.java:248)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$resolve_task$fn__3029.doInvoke(main.clj:189)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$apply_task.invoke(main.clj:230)
at leiningen.core.main$resolve_and_apply.invoke(main.clj:234)
at leiningen.update_in$update_in.doInvoke(update_in.clj:34)
at clojure.lang.RestFn.invoke(RestFn.java:2482)
at clojure.lang.Var.invoke(Var.java:496)
at clojure.lang.AFn.applyToHelper(AFn.java:328)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$resolve_task$fn__3029.doInvoke(main.clj:189)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$apply_task.invoke(main.clj:230)
at leiningen.core.main$resolve_and_apply.invoke(main.clj:234)
at leiningen.core.main$_main$fn__3092.invoke(main.clj:303)
at leiningen.core.main$_main.doInvoke(main.clj:290)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:617)
at ccw.leiningen.main$_main.doInvoke(main.clj:47)
at clojure.lang.RestFn.invoke(RestFn.java:2422)
at clojure.lang.Var.invoke(Var.java:496)
at clojure.lang.AFn.applyToHelper(AFn.java:328)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:617)
at clojure.main$main_opt.invoke(main.clj:335)
at clojure.main$main

Re: algorithm help: extracting groups of consecutive ints from a sorted list

2014-03-28 Thread John Gabriele
Brilliant. Thanks, Shantanu!


On Wednesday, March 19, 2014 12:09:56 AM UTC-4, Shantanu Kumar wrote:
>
> Something like this?
>
> (defn x [1 3 4 5 7 9 10 13])
>
> (reduce (fn [a i] (let [y (last a) z (last y)] (if (and z (= (inc z) i)) 
> (conj (pop a) (conj y i)) (conj a [i] [] x)
>
> Shantanu
>
> On Wednesday, 19 March 2014 08:26:43 UTC+5:30, John Gabriele wrote:
>>
>> If you've got a sorted list of numbers, for example:
>>
>> [1 3 4 5 7 9 10 13]
>>
>> where some are consecutive, how can you pull out the consecutive runs? 
>> That is, either produce
>>
>> [1 [3 4 5] 7 [9 10] 13]; or maybe something like
>> [[1 7 13] [3 4 5] [9 10]]  ; (the first vec is the elements left over)
>>
>> from the original coll?
>>
>> I can do it in Python in an imperative style, but it's a bit messy. My 
>> hunch is that there's probably a shorter way in Clojure, but I'm not seeing 
>> it.
>>
>> Thanks!
>>
>>

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


[ANN] avi 0.1.3

2014-03-28 Thread Jason Felice
*0.1.3 - The "view" Release*

Avi should now make an acceptable replacement for the "view" command.


   - Clojure 1.6.0
   - Implemented ^D, ^U, L, H, M, gg
   - Implementing new normal mode commands is now much cleaner.

avi

A lively vi.
Vision

We love vim. We want more! Test coverage. Flexibilty. Live REPLs!
Guiding Principles

   - Test driven. All functionality covered by tests.
   - Don't defeat vim muscle memory.
   - Code is for people. Be expressive as hell.
   - Be friendly. Especially to noobs.

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


Re: java interop help for beginner calling java class

2014-03-28 Thread Tassilo Horn
"bww00amd...@yahoo.com"  writes:

> I have read so much i cant see the tree for the forest.  and need some
> help calling the ocfLZW class below from clojure.

If that's really the complete class definition...

> /* */ public class OcfLZW
> /* */ {

... then you can't use it from Clojure because it's defined in the
default package.  There's no way to refer to such classes from any other
package except from the default package itself (no matter if from
Clojure or Java).

Solution: Add a

  package my.nice.lzw;

to the top of the java file.  Then you can instantiate it and call its
method's from Clojure like so:

  (let [oi (my.nice.lzw.OcfLZW.);; instantiate an object of that class
s-inefficient ...
out ...]
(.expand oi s-inefficient out)) ;; call its expand() method

HTH,
Tassilo

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


Re: Garden, Thorn - Looking for contributors

2014-03-28 Thread Timothy Washington
So there's 2 points that I raised. The main one is getting the
*@import*working. And I probably just need to see an example of how to
do that in
the API. With that, I'd probably move over to hiccup / garden.

Wrt garden-watch , I understand
and agree with your rationale. However, I can think of at least 2
considerations where a user of the tool may not want to enter the repl.

   1. A user in some other language wants a simple tool from which they can
   generate HTML or CSS. For example, when I use guard and it's plugins (see
   here  and
here),
   it doesn't force my project to use Ruby. And we shouldn't make that
   imposition on others.
   2. If I have a designer building out solely my HTML / CSS, I'd like her
   to just edit edn, and have corresponding code generated. No need for her to
   dive into a repl unnecessarily.


But again, for my immediate needs, point 2 is secondary. I just need
@import and those other edge cases working. I still think inlining raw CSS
is a good idea, for just seeing which use cases garden misses.


Hth

Tim Washington
Interruptsoftware.com 


On Thu, Mar 27, 2014 at 10:33 AM, Joel Holdbrooks wrote:

> I've answered this question numerous times and am convinced I need to
> write a blog post so I can just drop a link.
>
> In general the biggest win is that you can use Clojure and all of the
> facilities therein to write more sophisticated stylesheets. Large CSS
> codebases are notoriously hard to manage and require a lot of discipline to
> get right. If you're not writing a lot of CSS it isn't necessarily a big
> win.
>
>
> On Tuesday, March 25, 2014 5:42:45 PM UTC-7, Daniel wrote:
>>
>> I wonder what is so bad about pure CSS. Don't get me wrong - I do
>> appreciate projects like these.
>
>

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


Re: Amazonica performance: options?

2014-03-28 Thread Michael Cohen
time ec2-describe-images -a > ec2-cli-images.txt

real  1m26.401s
user  0m6.551s
sys 0m1.159s

and writes a 7.5MB file to disk. Note the -a flag, to list all of the 
available public images.

in a repl,

(time (spit "clj-awz-images.txt" (describe-images)))

"Elapsed time: 90258.47 msecs"

and writes an 18MB file to disk containing all the available public images. 

Am I missing something? 

You can also pass a list of filters to the call to narrow the result.



On Friday, March 28, 2014 7:59:48 AM UTC-7, Dave Tenny wrote:
>
> I'm trying to code some amazonica based solutions in a nontrivial AWS 
> environment.
> I work with many AWS accounts and it isn't unusual to see a thousand 
> instances running on one account, and similar excesses in other types of 
> AWS resources.  So if you're going an ec2-describe-instances (or amazonica 
> equivalent), it needs not to choke in this environment.
>
> I like the way amazonica does all the bean marshalling for me so I can 
> express queries simply.  But the returned datasets need to be more 
> pragmatic/performant.
>
> The problem for me is that Amazonica doesn't seem up to the task of 
> dealing with queries that return large volumes of data.
> It has nothing to do with reflection I suspect, and more to do with 
> unwieldy amounts of duplicate information in the result unmarshalling 
> process.
> The "clojure all the way down" philosophy results of duplicated 
> information and just printing the result to a file takes a long time.
> If I accidentally let the output go to an emacs cider repl buffer, then 
> things get so wedged up to the point I  may as well kill -9 emacs.
> (Known cider repl issues here, it isn't all amazonica).
>
> For example:  here's how long it takes to run the java based ec2 cli to 
> describe instances on an account:
>
> $ time ec2-describe-images >/tmp/ec2-cli-images.out
>
> real0m11.484s
> user0m2.564s 
> sys 0m0.129s 
>
>
> And here's how long it takes from a 'lein repl' to run the same query on 
> the same account:
>
> (time (with-output ["/tmp/clj-awz-images.out"] (println 
> (ec2/describe-images
> "Elapsed time: 194685.552683 msecs"
>
> Now the amount of data being printed by the EC2 CLI is of course much 
> different than the output from Amazonica,
> amazonica is returning everything in gory duplicate map detail, ec2 is 
> not, as evidenced by the relative output sizes:
>
> -rw-rw-r--.  1 dave dave 17201290 Mar 28 10:35 clj-awz-images.out
> -rw-rw-r--.  1 dave dave99342 Mar 28 10:26 ec2-cli-images.out.11.5s
>
> Where the amazonica output starts with:
> {:images [{:hypervisor xen, :state available, :virtualization-type 
> paravirtual, :root-device-type instance-store,
> ... and goes on like that with duplicate keywords all the way down.
>
> Anyway, my goal isn't to turn amazonica into ec2 cli.  But even the most 
> trivial operations in amazonica (especially the most trivial, i.e. those 
> lacking filters against large data sets), pretty  much whack me left and 
> right
> with CPU wedged tools and (completely unacceptable) long waits for results.
>
> Any suggestions on how to use amazonica in a way where the output is ... 
> different, and minimal/workable?
>
> Or am I left with going to another package or writing my own java sdk 
> api's directly?
>
> I'm pretty sure the results need to be structures whose relationship to 
> data values is implicit (and not explicit in map keys). I don't see any 
> options with amazonica to change this however.
>
> Thanks for suggestions, forgive me if I've missed something obvious.  I'm 
> just trying to see what's out there and at the same time move along quickly 
> enough that I can get some usable tools for work (so I can lose all my 
> python and bash scripts for various interfaces, I want clojure!).
>
> - Dave
>
>
>

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


java interop help for beginner calling java class

2014-03-28 Thread bww00amd...@yahoo.com
I have read so much i cant see the tree for the forest.
and need some help calling the  ocfLZW class below from clojure.

THANKS for the help

using eclipse and counterclockwise

In clojure 
 have the data to decompress read into an array.
 have an array allocated to hold the decompresed data


The java class ocfLZW is accessible

I have a java program exert below that calls the ocfLZW class and verified 
that it works.


FileInputStream fis = new FileInputStream(input);

byte[] sInefficient= new byte[(int)input.length()] ;
fis.read(sInefficient);

OcfLZW oi = new OcfLZW();

byte[] out = null;

 out = new byte[160];

int len = oi.expand(sInefficient, out);
System.out.println(new String (out));
System.out.println("out size = "+len);


ocfLZW java class that does LZW decompress 

/* */ public class OcfLZW
/* */ {
/* */   static final int INIT_BITS = 9;
/*   6 */   final int MAX_BITS = 13;
/*   7 */   final int TABLE_SIZE = 9029;
/*   8 */   final int HASH_SHIFT = 5;
/*   9 */   final int CLEAR_TABLE = 256;
/*  10 */   final int TERMINATOR = 257;
/* */   static final int FIRST_CODE = 258;
/* */   static final int CHECK_TIME = 100;
/*  13 */   final int STACK_SIZE = 4000;
/*  14 */   boolean EOF = false;
/* */   static int myIndex;
/* */   static int offset;
/* */   static int input_bit_buffer;
/* */   static int output_bit_buffer;
/* */   static int string_code;
/* */   static int bytes_out_this_time;
/*  22 */   static int next_code = 258;
/* */   static int max_code;
/*  24 */   static int checkpoint = 100;
/*  25 */   static int tot_bytesin = 0;
/* */   static int gbl_ulong;
/*  28 */   static int[] code_value = null;
/*  29 */   static int[] prefix_code = null;
/*  31 */   int input_bit_count = 0;
/*  32 */   int output_bit_count = 0;
/*  33 */   int num_bits = 9;
/*  34 */   int clear_bytesin = 0;
/*  35 */   int clear_bytesout = 0;
/*  36 */   int tot_bytesout = 0;
/* */   int ratio_new;
/*  38 */   int ratio_old = 100;
/*  40 */   static boolean compress_flag = false;
/*  41 */   static int initialized = 0;
/*  43 */   static byte[] in_buffpoint = null;
/*  44 */   static byte[] out_buffpoint = null;
/*  45 */   int in_buff_n = 0;
/*  45 */   int out_buff_n = 0;
/*  45 */   int in_buffend = 0;
/*  45 */   int out_buffend = 0;
/*  47 */   byte[] append_character = null;
/*  48 */   byte gbl_ptr_idx = 0;
/*  50 */   byte[] decode_stack = null;
/*  51 */   int ds_i = 0;
/* */   
/* */   public int expand(byte[] paramArrayOfByte1, byte[] 
paramArrayOfByte2)
/* */   {
/*  56 */ this.ds_i = 0;
/* */ 
/*  58 */ compress_flag = false;
/* */ 
/* */ 
/*  61 */ max_code = (1 << this.num_bits) - 1;
/*  62 */ prefix_code = new int[9029];
/*  63 */ this.append_character = new byte[9029];
/* */ 
/* */ 
/* */ 
/*  67 */ this.decode_stack = new byte[4000];
/*  69 */ if ((prefix_code == null) || (this.append_character == null) 
|| (this.decode_stack == null) || ((compress_flag) && (code_value == 
null))) {
/*  73 */   return 0;
/* */ }
/*  75 */ out_buffpoint = paramArrayOfByte2;
/*  76 */ this.out_buff_n = 0;
/*  77 */ in_buffpoint = paramArrayOfByte1;
/*  78 */ this.in_buff_n = 0;
/* */ 
/* */ 
/* */ 
/*  82 */ int[] arrayOfInt1 = new int[1];
/*  83 */ int i = 0;
/*  84 */ int j = 0;
/* */ 
/*  86 */ int[] arrayOfInt2 = new int[1];
/*  87 */ int m = 0;
/*  88 */ arrayOfInt1[0] = 0;
/* */ 
/*  90 */ arrayOfInt2[0] = 0;
/* */ 
/*  92 */ int k = 1;
/* */ 
/* */ 
/* */ 
/* */ 
/* */ 
/*  98 */ inputCode(arrayOfInt1);
/*  99 */ while ((!this.EOF) && (arrayOfInt1[0] != 257))
/* */ {
/* 100 */   if (k > 0)
/* */   {
/* 101 */ i = arrayOfInt1[0];
/* 102 */ j = i;
/* 104 */ if (arrayOfInt1[0] <= 255)
/* */ {
/* 105 */   k = 0;
/* 106 */   if (putByte(i) == 0) {
/* 107 */ return 0;
/* */   }
/* 108 */   m++;
/* 109 */   inputCode(arrayOfInt1);
/* 110 */   continue;
/* */ }
/* */   }
/* 114 */   if (arrayOfInt1[0] == 256)
/* */   {
/* 115 */ k = 1;
/* 116 */ this.num_bits = 9;
/* 117 */ next_code = 258;
/* 118 */ max_code = MAXVAL(this.num_bits);
/* 119 */ inputCode(arrayOfInt1);
/* */   }
/* */   else
/* */   {
/* 127 */ if (arrayOfInt1[0] >= next_code)
/* */ {
/* 128 */   this.decode_stack[this.ds_i] = ((byte)j);
/* 129 */   if (decodeString(arrayOfInt2, this.decode_stack, 
this.ds_i + 1, i) == 0) {
/* 130 */ return 0;
/* */   }
/* */ }
/* 133 */ else if (

Re: Problem in clojars SSL Cert

2014-03-28 Thread Nelson Morris
Some jvm's do not ship the startcom ssl cert in the default list.  This
means a verified chain cannot be found to the clojars cert.  This was
resolved in leiningen by shipping the startcom cert and adding it to that
jvm's trust mananger (https://github.com/technomancy/leiningen/issues/613).
 Since you're using maven, the solution might be to use the `keytool`
command as show in
http://stackoverflow.com/questions/4302686/import-startcom-ca-certificates-in-windows-jre

-
Nelson Morris


On Wed, Mar 26, 2014 at 2:54 AM, radhika shashank <
radhika.shash...@gmail.com> wrote:

>
> 
>
> Hi,
>
> I am trying to run incubator-storm-master but I am getting the following
> error:
>
>
>
> It is clear that the error is for "clojars" SSL Certificate.
>
> I ll be glad if you could tell me how to add the certificate and prevent
> this error
>
>
> I have been looking for this answer and referred many links like :
>
> https://github.com/technomancy/leiningen/issues/692
>
>
> But I have still could not get this thing working
>
>
>
>
>
> Thanks,
>
> Radhika
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: algorithm help: extracting groups of consecutive ints from a sorted list

2014-03-28 Thread John Gabriele
Y'know, I'm guilty of not looking into flatland/useful enough. I'll have to 
try out codox on it, and see if that makes it easier for me to get 
acquainted with it.

Thanks, Alex.



On Wednesday, March 19, 2014 6:57:27 AM UTC-4, Alex Nixon wrote:
>
> Or use glue from flatland.useful.seq 
>  and:
>
> user=> (glue conj [] (fn [s n] (= (inc (last s)) n)) [1 3 4 5 7 9 10 13])
> ([1] [3 4 5] [7] [9 10] [13])
>
>
> On 19 March 2014 04:10, Shantanu Kumar 
> > wrote:
>
>>
>>
>> On Wednesday, 19 March 2014 09:39:56 UTC+5:30, Shantanu Kumar wrote:
>>>
>>> Something like this?
>>>
>>> (defn x [1 3 4 5 7 9 10 13])
>>>
>>
>> Sory for the typo. Should be (def x [1 3 4 5 7 9 10 13])
>>  
>>
>>>
>>> (reduce (fn [a i] (let [y (last a) z (last y)] (if (and z (= (inc z) i)) 
>>> (conj (pop a) (conj y i)) (conj a [i] [] x)
>>>
>>> Shantanu
>>>
>>> On Wednesday, 19 March 2014 08:26:43 UTC+5:30, John Gabriele wrote:

 If you've got a sorted list of numbers, for example:

 [1 3 4 5 7 9 10 13]

 where some are consecutive, how can you pull out the consecutive runs? 
 That is, either produce

 [1 [3 4 5] 7 [9 10] 13]; or maybe something like
 [[1 7 13] [3 4 5] [9 10]]  ; (the first vec is the elements left 
 over)

 from the original coll?

 I can do it in Python in an imperative style, but it's a bit messy. My 
 hunch is that there's probably a shorter way in Clojure, but I'm not 
 seeing 
 it.

 Thanks!

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

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


Amazonica performance: options?

2014-03-28 Thread Dave Tenny
I'm trying to code some amazonica based solutions in a nontrivial AWS 
environment.
I work with many AWS accounts and it isn't unusual to see a thousand 
instances running on one account, and similar excesses in other types of 
AWS resources.  So if you're going an ec2-describe-instances (or amazonica 
equivalent), it needs not to choke in this environment.

I like the way amazonica does all the bean marshalling for me so I can 
express queries simply.  But the returned datasets need to be more 
pragmatic/performant.

The problem for me is that Amazonica doesn't seem up to the task of dealing 
with queries that return large volumes of data.
It has nothing to do with reflection I suspect, and more to do with 
unwieldy amounts of duplicate information in the result unmarshalling 
process.
The "clojure all the way down" philosophy results of duplicated information 
and just printing the result to a file takes a long time.
If I accidentally let the output go to an emacs cider repl buffer, then 
things get so wedged up to the point I  may as well kill -9 emacs.
(Known cider repl issues here, it isn't all amazonica).

For example:  here's how long it takes to run the java based ec2 cli to 
describe instances on an account:

$ time ec2-describe-images >/tmp/ec2-cli-images.out

real0m11.484s
user0m2.564s 
sys 0m0.129s 


And here's how long it takes from a 'lein repl' to run the same query on 
the same account:

(time (with-output ["/tmp/clj-awz-images.out"] (println 
(ec2/describe-images
"Elapsed time: 194685.552683 msecs"

Now the amount of data being printed by the EC2 CLI is of course much 
different than the output from Amazonica,
amazonica is returning everything in gory duplicate map detail, ec2 is not, 
as evidenced by the relative output sizes:

-rw-rw-r--.  1 dave dave 17201290 Mar 28 10:35 clj-awz-images.out
-rw-rw-r--.  1 dave dave99342 Mar 28 10:26 ec2-cli-images.out.11.5s

Where the amazonica output starts with:
{:images [{:hypervisor xen, :state available, :virtualization-type 
paravirtual, :root-device-type instance-store,
... and goes on like that with duplicate keywords all the way down.

Anyway, my goal isn't to turn amazonica into ec2 cli.  But even the most 
trivial operations in amazonica (especially the most trivial, i.e. those 
lacking filters against large data sets), pretty  much whack me left and 
right
with CPU wedged tools and (completely unacceptable) long waits for results.

Any suggestions on how to use amazonica in a way where the output is ... 
different, and minimal/workable?

Or am I left with going to another package or writing my own java sdk api's 
directly?

I'm pretty sure the results need to be structures whose relationship to 
data values is implicit (and not explicit in map keys). I don't see any 
options with amazonica to change this however.

Thanks for suggestions, forgive me if I've missed something obvious.  I'm 
just trying to see what's out there and at the same time move along quickly 
enough that I can get some usable tools for work (so I can lose all my 
python and bash scripts for various interfaces, I want clojure!).

- Dave


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


Re: [ANN] Clojure cheat sheet (v13)

2014-03-28 Thread John Gabriele
Thanks, Andy! Love love love the cheatsheet. :)

-- John

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


Re: Unexpected core.async timeout behaviour

2014-03-28 Thread Peter Taoussanis
One thing I'm not clear on: if I've understood your explanation correctly, 
I would expect the 100ms timeout to produce this error _more_ (not less) 
often.

So can I just confirm some things here?

1. `async/timeout` calls can (always?) get "cached" to the nearest 
TIMEOUT_RESOLUTION_MS.
2. In this tight loop example, that means that `http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unexpected core.async timeout behaviour

2014-03-28 Thread Peter Taoussanis
Okay, fantastic - appreciate the detailed info Timothy!

This did actually came up in staging today; reduced it to the toy example 
here. Now that I understand what's happening, let me think about it a 
little and get back to you.

BTW I don't think I've ever thanked you personally for your work on 
core.async. It's incredible, a real game changer and a pleasure to work 
with - so thank you.

>

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


Re: [ANN] Clojure 1.6

2014-03-28 Thread Alex Miller
I noticed that but am unclear how that zip file got created in the past. 
Might need to page Dr. Stuart "Maven" Sierra. Perhaps its due to changing 
the Nexus staging/release process?


On Thursday, March 27, 2014 7:58:12 PM UTC-5, David Nolen wrote:
>
> It looks like the zip file that usually included with the releases is 
> missing?
>
> http://repo1.maven.org/maven2/org/clojure/clojure/1.5.1/
>
> vs.
>
> http://repo1.maven.org/maven2/org/clojure/clojure/1.6.0/
>
> Thanks,
> David
>
>
> On Tue, Mar 25, 2014 at 7:00 AM, Alex Miller 
> 
> > wrote:
>
>> We are pleased to announce the release of Clojure 1.6.
>>
>> Getting Clojure:
>>
>>   Web:  http://clojure.org/downloads
>>   Lein/Maven:   :dependencies [[org.clojure/clojure "1.6.0"]]
>>
>> (The download should be available shortly)
>>
>> This release includes significant features and bug fixes, documented
>> here:
>>
>>   https://github.com/clojure/clojure/blob/master/changes.md
>>
>> The number of Clojure contributors continues to grow. Thanks to all
>> of those who contributed specifically to Clojure 1.6:
>>
>> Bruce Adams 
>> Vipul Amler
>> Mike Anderson
>> Timothy Baldridge
>> Brandon Bloom
>> Toby Crawley
>> Andy Fingerhut
>> Michael Fogus
>> Gary Fredricks
>> Joe Gallo
>> Christophe Grand
>> Chris Gray
>> Anthony Grimes
>> Stuart Halloway
>> Herwig Hochleitner
>> Gabriel Horner
>> Colin Jones
>> Stefan Kamphausen
>> Scott Lowe
>> Alan Malloy
>> Michał Marczyk
>> Tim McCormack
>> Alex Miller
>> Steve Miner
>> Nicola Mometto
>> Max Penet
>> Christoffer Sawicki
>> Karsten Schmidt
>> Ghadi Shayban 
>> Stuart Sierra
>> Brian Taylor
>> Devin Walters
>> Jason Wolfe
>>
>> and to the total list of contributors from all releases:
>> http://clojure.org/contributing#patches
>>
>> Thanks!
>>
>> Alex Miller
>>
>>  -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


Re: [ANN] Clojure 1.6

2014-03-28 Thread Alex Miller
Looks like the pom.xml should create that with "mvn -Pdistribution 
package". Perhaps we accidentally lost that profile during the Nexus change.



On Friday, March 28, 2014 7:52:21 AM UTC-5, Alex Miller wrote:
>
> I noticed that but am unclear how that zip file got created in the past. 
> Might need to page Dr. Stuart "Maven" Sierra. Perhaps its due to changing 
> the Nexus staging/release process?
>
>
> On Thursday, March 27, 2014 7:58:12 PM UTC-5, David Nolen wrote:
>>
>> It looks like the zip file that usually included with the releases is 
>> missing?
>>
>> http://repo1.maven.org/maven2/org/clojure/clojure/1.5.1/
>>
>> vs.
>>
>> http://repo1.maven.org/maven2/org/clojure/clojure/1.6.0/
>>
>> Thanks,
>> David
>>
>>
>> On Tue, Mar 25, 2014 at 7:00 AM, Alex Miller wrote:
>>
>>> We are pleased to announce the release of Clojure 1.6.
>>>
>>> Getting Clojure:
>>>
>>>   Web:  http://clojure.org/downloads
>>>   Lein/Maven:   :dependencies [[org.clojure/clojure "1.6.0"]]
>>>
>>> (The download should be available shortly)
>>>
>>> This release includes significant features and bug fixes, documented
>>> here:
>>>
>>>   https://github.com/clojure/clojure/blob/master/changes.md
>>>
>>> The number of Clojure contributors continues to grow. Thanks to all
>>> of those who contributed specifically to Clojure 1.6:
>>>
>>> Bruce Adams 
>>> Vipul Amler
>>> Mike Anderson
>>> Timothy Baldridge
>>> Brandon Bloom
>>> Toby Crawley
>>> Andy Fingerhut
>>> Michael Fogus
>>> Gary Fredricks
>>> Joe Gallo
>>> Christophe Grand
>>> Chris Gray
>>> Anthony Grimes
>>> Stuart Halloway
>>> Herwig Hochleitner
>>> Gabriel Horner
>>> Colin Jones
>>> Stefan Kamphausen
>>> Scott Lowe
>>> Alan Malloy
>>> Michał Marczyk
>>> Tim McCormack
>>> Alex Miller
>>> Steve Miner
>>> Nicola Mometto
>>> Max Penet
>>> Christoffer Sawicki
>>> Karsten Schmidt
>>> Ghadi Shayban 
>>> Stuart Sierra
>>> Brian Taylor
>>> Devin Walters
>>> Jason Wolfe
>>>
>>> and to the total list of contributors from all releases:
>>> http://clojure.org/contributing#patches
>>>
>>> Thanks!
>>>
>>> Alex Miller
>>>
>>>  -- 
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with 
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+u...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to clojure+u...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

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


Re: Unexpected core.async timeout behaviour

2014-03-28 Thread Peter Taoussanis
Please, not at all! Appreciate any ideas :-)

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


Re: Unexpected core.async timeout behaviour

2014-03-28 Thread Tim Visher
On Fri, Mar 28, 2014 at 8:08 AM, Peter Taoussanis  wrote:
> Hi Tim, thanks for the info!
>
> It's not clear to me that this is the same issue, unfortunately. (Though I
> may be missing something obvious).
>
> In the example I've provided above, we're actually creating a _new_ channel
> for each take. The problem appears to be either some interaction between the
> loop and core.async that I'm not aware of, or something on the
> _implementation-end_ that is bumping up against the referenced issue (i.e.
> an insufficiently-buffered channel somewhere).
>
> So there's actually no channel here that I could be buffering, since it's
> not my channel that's overflowing. Again, modulo me missing something
> obvious :-)
>
> Does that make sense?

Ah, forgive me for not seeing the subtlety and getting excited about
being able to help in some small way on a core.async problem. :)

Can one of the adults chime in?

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

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


Re: Unexpected core.async timeout behaviour

2014-03-28 Thread Peter Taoussanis
Hi Tim, thanks for the info!

It's not clear to me that this is the same issue, unfortunately. (Though I 
may be missing something obvious).

In the example I've provided above, we're actually creating a _new_ channel 
for each take. The problem appears to be either some interaction between 
the loop and core.async that I'm not aware of, or something on the 
_implementation-end_ that is bumping up against the referenced issue (i.e. 
an insufficiently-buffered channel somewhere).

So there's actually no channel here that I could be buffering, since it's 
not my channel that's overflowing. Again, modulo me missing something 
obvious :-)

Does that make sense?

>  

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


Re: Unexpected core.async timeout behaviour

2014-03-28 Thread Tim Visher
Hi Peter,

On Fri, Mar 28, 2014 at 2:48 AM, Peter Taoussanis  wrote:
> Hi all, quick question:
>
> `(dotimes [_ 5] (go ( `(dotimes [_ 5] (go ( produces an error:
>
> (< (.size takes) impl/MAX-QUEUE-SIZE)> java.lang.AssertionError: Assert
> failed: No more than 1024 pending takes are allowed on a single channel.
>
> It appears (?) that there's a (surprisingly low?) limit to the number of
> unique timeout timestamps that can be simultaneously queued.
>
> Is this the expected behaviour running Clojure 1.6.0, core.async
> 0.1.278.0-76b25b-alpha?
>
> Much appreciated, thanks! Cheers :-)

I _still_ have no personal experience with core.async ( :((( ), but I
did spot this message coming through recently which answers your
question with 'yes' I believe.

https://groups.google.com/forum/#!searchin/clojure/1024/clojure/NIPIzJ7l6RA/Idm1_2GMlCMJ

It sounds like you need to use a different kind of channel buffer
(whatever that means :).

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

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