is there a naming convention for the directory with java in it?

2013-05-28 Thread larry google groups
I started a project with "lein new". I had a jar file I needed to include in this project (a recommended class from a company that has an API that we are using -- it would be pointless for me to re-write their code, so I simply grabbed the class they offered and compiled it as a jar). I ended up

idiot question about macros

2013-06-07 Thread larry google groups
I am very stupid and I am having trouble figuring out how to read this: (defmacro match-func [& body] `(fn [~'x] (match [~'x] ~@body))) ((match-func [q :guard even?] (+ 1 q) [z] (* 7 z)) 33) ;; 231 What? Why 231? The article is here: http://java.dzone.com/articles/my-first-clojure-macro I es

How does "

2013-09-13 Thread larry google groups
I am stupid and recursion is clearly beyond my intellect. Martin Trojer has a great blog post here which I learned a lot from but I don't understand why the final example works: http://martintrojer.github.io/clojure/2013/07/17/non-tailrecursive-functions-in-coreasync/ He offers this as an exam

What is current "best practice" regarding exceptions?

2015-04-20 Thread larry google groups
I'm curious, how are people in the Clojure community currently dealing with exceptions? I have a diverse set of questions on this topic. 1.) How many have adopted an Erlang "die fast and restart" strategy? 2.) How many use something like Supervisor to spin up new JVMs? If not Supervisor, then

What are favored Redis-backed queues?

2015-04-24 Thread larry google groups
I'm looking at this old post from Github, that lists the features they were looking for in a message queue: - Persistence - See what's pending - Modify pending jobs in-place - Tags - Priorities - Fast pushing and popping - See what workers are doing - See what workers ha

Re: Clojure needs a web framework with more momentum

2015-05-03 Thread larry google groups
The industry has been moving against frameworks for 15 years now. The peak of the monolithic framework craze was Struts, back in 2000. After that, people started craving something less bloated. That's why the whole industry was so excited when Rails emerged in 2004. Bruce Eckel summed up the su

Re: Clojure needs a web framework with more momentum

2015-05-03 Thread larry google groups
This can be read in a manner opposite to what you intended: > There's one factor missing from this discussion which is framework > community. I think there's immense value in the community factor which > emerges when a web framework gains a lot of mindshare. From what I've > read in this threa

Re: Clojure needs a web framework with more momentum

2015-05-03 Thread larry google groups
o the product of not needing or wanting anybody else's help to do something." On Sunday, May 3, 2015 at 9:51:15 AM UTC-4, g vim wrote: > > On 03/05/2015 14:39, larry google groups wrote: > > The industry has been moving against frameworks for 15 years now. The > > pe

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread larry google groups
nobody wanted anyway or split them up into smaller > pieces. > > > On Sunday, May 3, 2015 at 8:25:22 PM UTC+2, larry google groups wrote: >> >> >> > The web development industry as reflected in job postings at >> > Indeed.co.uk is still dominated by the like

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread larry google groups
> While I agree that g vim's metrics aren't terribly meaningful, the conclusion he's arriving at is an important one. I think g vim's metrics have some impact with management. Certainly, its worth talking about. A few months ago I was talking to the woman at the New York Times who overseas th

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread larry google groups
> Someone earlier in the thread wrote about how Ruby was the abstraction in contrast to PHP where libraries > were tied to a framework. I've never worked with Rails seriously, but I find it hard to believe that libraries > such as shopping carts intended for Rails will work out of the box with

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread larry google groups
> Very interesting discussion going on here. As a beginner, what I'd like to see is not something > like Django or Rails, but something like Flask. Flask started off as a sort of joke -- a few Python programmers, responding to criticism of bloat in Django, said it should be possible to create a

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread larry google groups
> I've taken a couple of long lived Rails apps from Rails 1 to Rails 4 and while there have been breaking changes with > each major version change (and some minor versions) in general it's pretty easy to keep up with the latest > versions and there are copious docs (even whole ebooks in some ca

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread larry google groups
> I read several comments about how easy it is to upgrade Rails. > Either things have been improving at the speed of light or I am > a complete idiot. My last upgrades from 2.x to 2.y have been > nightmares, dependency hell multiplied by an unknown factor > above 100... I strongly agree. I t

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread larry google groups
> My guess is that over the next 2-3 years we will see some clojure frameworks emerge but > they will not be like "traditional" frameworks. Or the space for "web framework" will always default to Rails. Clojure certainly has some great frameworks in other areas, such as distributed data pro

What is "best practice" regarding transducers

2015-05-06 Thread larry google groups
I would like to write a detailed blog post about how developers are actually using transducers. If you have a public project on Github that is using transducers, would you please point me to it? I would like to see what you did. If you are not using transducers, but you plan to in the near fut

Re: Clojure needs a web framework with more momentum

2015-05-06 Thread larry google groups
> Maybe I don't entirely understand what a web framework is, but it seems to me > like Immutant is an example of something that might fit into a lot of the buckets. I agree. Perhaps people feel that it lacks the auto-generation of scaffolding for CRUD? Though I imagine that would be easy to f

Re: Clojure needs a web framework with more momentum

2015-05-06 Thread larry google groups
>Also, most of the time you do not need any complex "framework" to build a basic webservice with Clojure. True. Also, what is a basic web service? I have a friend who just got done with the 12 week crash-course in Rails that is offered by DevBootcamp in New York City. In 12 weeks he had to lea

What is a real example of the Observer pattern?

2015-05-06 Thread larry google groups
I am looking here: https://strange-loop-2012-notes.readthedocs.org/en/latest/monday/functional-design-patterns.html I read: Observer Pattern - Register an observer with a

Re: Clojure needs a web framework with more momentum

2015-05-06 Thread larry google groups
This is certainly true: "Docs are about empathy, which means discussions should show empathy." I am not sure what you mean by "That response does not respect people’s limited time." I think you mean that Pull Requests are often a waste of time, because you can not be certain if the Pull Request

Re: Clojure needs a web framework with more momentum

2015-05-07 Thread larry google groups
I assume most people here would agree with this: "Nothing is merely a pull request; it is someone's valuable time spent in contemplation and action." At the same time, I assume most people who would use Clojure will also know something about Git, and I think this applies even to fairly new pr

how do I clojure.string/replace regex characters? Escaping gives me StringIndexOutOfBoundsException

2014-08-04 Thread larry google groups
I'm working on a website with a frontender who asked to be able to save JSON maps that contain field names such as: "$$hashKey" : "00C" The dollar signs are a violation of MongoDB limits on field names, so i need to convert to something else and then convert back. So I thought I would convert

Can I compare ::logging from one namespace with ::logging from another?

2014-08-09 Thread larry google groups
Please forgive this stupid question, but I'm still trying to understand exactly what the double "::" means. I have read that I can use (derive) to establish a hierarchy and I can imagine how this would be useful for things like throwing errors and catching them and logging, but I've also read th

Re: Can I compare ::logging from one namespace with ::logging from another?

2014-08-09 Thread larry google groups
to :ns2/foo, nor to just :foo. >> :: >> is used in cases where you want to exploit this important property of >> keywords, so that your keyword won't e.g. clash with other keywords in a >> collection, contents of which you don't know. >> >> Jozef >

Re: Can I compare ::logging from one namespace with ::logging from another?

2014-08-09 Thread larry google groups
n't have to the current or > even a real one. > > Jozef > > On Saturday, August 9, 2014 9:49:58 PM UTC+2, larry google groups wrote: >> >> Thank you for the responses. However, when I look here: >> >> http://clojure.org/multimethods >> >> I see tha

Re: Can I compare ::logging from one namespace with ::logging from another?

2014-08-09 Thread larry google groups
t;>>> :your.current.ns/foo. Its purpose is to make it easy to create keywords >>>> that do not clash with other ones. >>>> >>>> Keywords are equal (and identical) only when both of their namespaces >>>> and names are equal. :ns1/foo is thus

Re: Can I compare ::logging from one namespace with ::logging from another?

2014-08-09 Thread larry google groups
amespace, you can use the alias instead of the fully > qualified name in keywords: > > (ns example.core > (require [example.other :as o])) > > (defmethod o/speak ::o/dog [_] "bark") > (defmethod o/speak ::o/cat [_] "meow") > > -

How do I track down a painfully long pause in a small web app?

2014-09-14 Thread larry google groups
I have an embarrassing problem. I convinced my boss that I could use Clojure to build a RESTful API. I was successful in so far as that went, but now I face the issue that every once in a while, the program pauses, for a painfully long time -- sometimes 30 seconds, which causes some requests t

Re: How do I track down a painfully long pause in a small web app?

2014-09-15 Thread larry google groups
rbage-collection-options.html > > Shantanu > > On Monday, 15 September 2014 09:45:14 UTC+5:30, larry google groups wrote: >> >> >> I have an embarrassing problem. I convinced my boss that I could use >> Clojure to build a RESTful API. I was successful in so far as t

Re: How do I track down a painfully long pause in a small web app?

2014-09-15 Thread larry google groups
ning a profiler? >> 5. Have you tried printing GC info? Maybe this could be useful: >> http://blog.ragozin.info/2011/09/hotspot-jvm-garbage-collection-options.html >> >> Shantanu >> >> On Monday, 15 September 2014 09:45:14 UTC+5:30, larry google groups wrote: >>>

Re: How do I track down a painfully long pause in a small web app?

2014-09-15 Thread larry google groups
er? >> 5. Have you tried printing GC info? Maybe this could be useful: >> http://blog.ragozin.info/2011/09/hotspot-jvm-garbage-collection-options.html >> >> Shantanu >> >> On Monday, 15 September 2014 09:45:14 UTC+5:30, larry google groups wrote: >>> >&g

Re: How do I track down a painfully long pause in a small web app?

2014-09-15 Thread larry google groups
Okay, I will dig into jvisualvm. Thanks. On Monday, September 15, 2014 5:53:34 AM UTC-4, David Powell wrote: > > Use the jvisualvm tool that comes with the jdk- you should be able to > connect to the clojure process. > > Looking at the memory usage graphs, and if the heap size is banging > aga

Re: Is this a reasonable use of core.async?

2014-09-16 Thread larry google groups
This does not look correct to me. Perhaps someone else has more insight into this. I am suspicious about 2 things: 1.) your use of doall 2.) your use of (thread) It looks to me like you are trying to hack together a kind of pipeline or channel. Clojure has a wealth of libraries that can han

Re: Is this a reasonable use of core.async?

2014-09-17 Thread larry google groups
jobs to do, I'm partitioning that list up into 4 sub > lists to be worked through by 4 p// workers, I then want to block and wait > until all 4 workers have finished their tasks. > > On Wednesday, September 17, 2014 3:27:07 AM UTC+10, larry google groups > wrote: >> >>

Re: Is this a reasonable use of core.async?

2014-09-17 Thread larry google groups
want to block and wait >> until all 4 workers have finished their tasks. >> >> On Wednesday, September 17, 2014 3:27:07 AM UTC+10, larry google groups >> wrote: >>> >>> >>> This does not look correct to me. Perhaps someone else has more insig

Re: Is this a reasonable use of core.async?

2014-09-17 Thread larry google groups
eue new jobs etc is really not > needed. Cheers though. > > On Thursday, September 18, 2014 9:38:47 AM UTC+10, larry google groups > wrote: >> >> >> > We don't have streams of data here, the long running tasks have >> side-effects. I would >> >

Re: [ANN] Nginx-Clojure v0.2.5 released!

2014-09-17 Thread larry google groups
> JVMs are not goot at huge memory management. Configurable multiple JVM instances (is the > same number of Nginx Worker processes) will manage less memory. e.g. we have ten > Nginx Worker processes in one Nginx instance every JVM instance will only manage 1/10 memory This is a stupid quest

Re: How do I track down a painfully long pause in a small web app?

2014-09-23 Thread larry google groups
JVM ran in 1 process? Does strace show me userland threads (like htop does) or are these child processes? On Monday, September 15, 2014 12:15:14 AM UTC-4, larry google groups wrote: > > > I have an embarrassing problem. I convinced my boss that I could use > Clojure to build a RES

Re: How do I track down a painfully long pause in a small web app?

2014-09-23 Thread larry google groups
00.00 45.497046100943 10483 total On Tuesday, September 23, 2014 9:44:52 PM UTC-4, larry google groups wrote: > > I am intrigued by this article, as the problem sounds the same as mine: > > http://corner.squareup.com/2014/09/logging-can-be-tricky.html &g

Re: multimethod, record, type, and protocol pitfalls?

2014-10-27 Thread larry google groups
The differences between OOP and multimethods should be stressed. I just wrote about this on my blog, and those who mostly worked with OOP kept wondering, how do you get inheritance of functionality? Actually, they did not ask this clearly, so it took me awhile to understand their question, an

Re: multimethod, record, type, and protocol pitfalls?

2014-10-27 Thread larry google groups
; > On Mon, Oct 27, 2014 at 2:21 PM, larry google groups > wrote: > ​ > >> The differences between OOP and multimethods should be stressed. >> >> I just wrote about this on my blog, and those who mostly worked with OOP >> kept wondering, how do you get inheritan

Is there a Clojure library for generating checksum patterns

2014-12-29 Thread larry google groups
I've some questions about generating checksum patterns with Clojure. 1.) The simple case. Suppose I arbitrarily decide that in my project the correct answer will be 2, and I want this to be generated by 4 numbers. Is there a Clojure library that would give me: 2 8 4 7 1 1 2 2 4 1 3 4 with

Re: [ANN] permissions - role & permission based access control

2016-10-10 Thread larry google groups
A minor pet peeve of mine, but is it possible to attach prime numbers to the roles, and to then decipher the roles from the factors of the total? Using strings or keywords for permissions often strikes me as inefficient. Assuming: create -- 2 read -- 3 update -- 5 delete -- 7 bulk-erase --

Re: [ANN] permissions - role & permission based access control

2016-10-12 Thread larry google groups
. Okt. 2016 um > 14:04 Uhr: > >> If you wanted to do something more efficient, why not just use a bitmask? >> That is far more efficient than prime factorization. >> >> >> On Tuesday, October 11, 2016 at 12:06:19 AM UTC-4, larry google groups >> wrote:

Re: Keywords with colon on the backside?

2016-10-13 Thread larry google groups
Am I correct in saying that this conversation is at least partly related to the question of "Will Clojure ever support reader macros?" And for now the answer is "no". Because with reader macros, programmers could change the meaning of ":". On Friday, September 23, 2016 at 7:13:30 PM UTC-4, Joh

Re: core.async top use cases

2016-10-13 Thread larry google groups
> It is not just convenience. For example agents don't provide functionality like buffering, back pressure > and select aka alts. If you send an action to an agent you don't get to know when it's done or > to choose what to do if it is currently busy. So when to use agents? I've looked throu

Re: WAT: JavaScript & Ruby

2016-10-13 Thread larry google groups
> Waiting for the Clojure and Scala version. :-} But there won't be. Not ever. Not really. The reason I prefer Clojure over Javascript or Ruby is because so much care and thought went into the APIs of Clojure's core structures and syntax. If you try really hard, you can find the occasional arti

How do I call a function in the catch block of try/catch?

2016-11-25 Thread larry google groups
I know some of you will tell me that I shouldn't use try/catch for control flow. That is fine. I might redo this. But for now, I'd like to simply know why this doesn't work. I have this function: (defn start [] (let [filenames-as-seq-of-strings (.list (io/file "/home/ec2-user/uploads/"))]

Re: How do I call a function in the catch block of try/catch?

2016-11-25 Thread larry google groups
like my try/catch does not catch this. How is that possible? On Friday, November 25, 2016 at 6:41:57 PM UTC-5, larry google groups wrote: > > I know some of you will tell me that I shouldn't use try/catch for control > flow. That is fine. I might redo this. But for now, I&#x

Re: How do I call a function in the catch block of try/catch?

2016-11-25 Thread larry google groups
Sorry, I am an idiot. I had added a try/catch to the first "convert" when I was debugging. Ignore all this. On Friday, November 25, 2016 at 6:41:57 PM UTC-5, larry google groups wrote: > > I know some of you will tell me that I shouldn't use try/catch for control &g

what does (seq) in zipmap do?

2016-11-29 Thread larry google groups
I apologize for this question, because I think it has been asked before, and yet I can not find the answer. In the definition of zipmap, what do these 2 lines do? ks (seq keys) vs (seq vals) In particular, what is (seq) doing? Is this to ensure that ks is false if "keys" is empty? And vs is f

Re: What does "Map literal must contain an even number of forms" mean?

2016-12-05 Thread larry google groups
This is all you need: {:c "Turd" :d "More Turd"} (defn turd [] {:c "Turd" :d "More Turd"}) On Sunday, December 4, 2016 at 4:03:04 PM UTC-5, bill nom nom wrote: > > ;; This works, > (hash-map :a 1 :b 2 ) > > > ;; Here's another way to create a hash map, this won't work because map > ;; liter

Re: What does "Map literal must contain an even number of forms" mean?

2016-12-05 Thread larry google groups
This: (defn turd [] {:c "Turd" :d "More Turd"}) Would return this map: {:c "Turd" :d "More Turd"} This: (defn config [username password] {:u username :p *password*}) returns a map based on the function arguments. On Monday, December 5, 2016 a

"lein uberjar" gives me java.lang.OutOfMemoryError:

2016-12-10 Thread larry google groups
I had a small app that was compelling, and then I added in a java class, and now when I run "lein uberjar" I get java.lang.OutOfMemoryError. I'm working on my MacBook Pro, 16 gigs of memory Dependencies were: :dependencies [ [org.clojure/clojure "1.7.0"] [

Re: "lein uberjar" gives me java.lang.OutOfMemoryError:

2016-12-10 Thread larry google groups
December 10, 2016 at 11:37:44 PM UTC-5, larry google groups wrote: > > I had a small app that was compelling, and then I added in a java class, > and now when I run "lein uberjar" I get java.lang.OutOfMemoryError. > > I'm working on my MacBook Pro, 16 gigs of memory >

ava.lang.SecurityException: class "org.apache.poi.POIXMLDocumentPart"'s signer information does not match signer information of other classes in the same package

2016-12-10 Thread larry google groups
I've never worked much with Java, so dealing with stuff like Maven is the stuff I understand least about Clojure. I've added these 3 items to the dependencies that I list in project.clj [org.apache.poi/poi "3.9"] [org.apache.poi/poi-ooxml "3.9"]

Re: ava.lang.SecurityException: class "org.apache.poi.POIXMLDocumentPart"'s signer information does not match signer information of other classes in the same package

2016-12-10 Thread larry google groups
atools.modelbase.derby "1.0.0.v201107221519"] [org.eclipse.birt.runtime/org.eclipse.datatools.modelbase.sql.query "1.1.4.v201212120619"] [org.eclipse.birt.runtime/org.eclipse.datatools.modelbase.sql "1.0.6.v201208230744"] [org.eclipse.birt.runtime/org.eclip

Re: ava.lang.SecurityException: class "org.apache.poi.POIXMLDocumentPart"'s signer information does not match signer information of other classes in the same package

2016-12-11 Thread larry google groups
Thank you. That is a bit frustrating but I guess that is the route I will go On Sunday, December 11, 2016 at 6:26:04 AM UTC-5, Matching Socks wrote: > > Did you find > > http://stackoverflow.com/questions/2877262/java-securityexception-signer-information-does-not-match > and the linked > > http:/

Re: "lein uberjar" gives me java.lang.OutOfMemoryError:

2016-12-11 Thread larry google groups
Thank you. On Sunday, December 11, 2016 at 6:32:50 AM UTC-5, Matching Socks wrote: > > An answer from "noisesmith" here > > http://stackoverflow.com/questions/32288195/why-lein-uberjar-evaluates-variables-defined-with-def > says, "In order to compile your namespace for the uberjar (if you have AO

Are there file watchers that can tell me when a file is done uploading?

2016-12-11 Thread larry google groups
I'm in a situation where we allow staff to upload Microsoft Excel files to our servers, which we then parse and store the data in DynamoDB. I've only used file watchers once before, to watch for any change in a directory. These seemed to trigger when a file was created in a directory -- I rec

Re: Are there file watchers that can tell me when a file is done uploading?

2016-12-12 Thread larry google groups
; > Alternatively, you could build a simple web app with a drag and drop file > API. Users open the webpage, drag the Excel files to it, and you can then > control the upload and processing directly, even providing feedback. > > - James > > On 11 December 2016 at 19:47, larry go

Why would I get this: FileNotFoundException: Could not locate raynes/fs__init.class

2016-12-13 Thread larry google groups
What am I doing wrong here? This is from my project file: :dependencies [ [org.clojure/clojure "1.7.0"] [org.clojure/test.check "0.9.0"] [org.clojure/data.xml "0.1.0-beta1"] [org.clojure/data.json "0.2.6"] [com

Re: Why would I get this: FileNotFoundException: Could not locate raynes/fs__init.class

2016-12-13 Thread larry google groups
Thank you. That must have been a copy-and-paste error. Funny thing is that I looked at it a half-dozen times and asked myself if I'd copied something wrong. On Tuesday, December 13, 2016 at 12:28:16 PM UTC-5, Toby Crawley wrote: > > On Tue, Dec 13, 2016 at 12:20 PM, larry go

What is the correct way to use 'into'?

2016-12-17 Thread larry google groups
I was trying to combine 2 maps into a new map, as you can see here. I printed both maps to the screen so I could see that, indeed, they were both maps. And yet I got a NullPointerException on the last line here: (defn update-config [more-config] (swap! config-holder (fn [old-config

Re: Are there file watchers that can tell me when a file is done uploading?

2016-12-17 Thread larry google groups
ed. the move should be an atomic operation. > > On 11 Dec 2016 21:47, "larry google groups" > wrote: > >> >> I'm in a situation where we allow staff to upload Microsoft Excel files >> to our servers, which we then parse and store the data in DynamoDB.

what tutorials exist for working at the Repl in Emacs?

2016-12-22 Thread larry google groups
I'm curious if there are good tutorials for a modern setup in Emacs. Especially any tutorial that mentions stuff like Pomegranate, that helps at the Repl? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@

NoClassDefFoundError after I import with "use" on the repl?

2014-02-06 Thread larry google groups
I imagine this question has been asked a million times before, but I can not find the answer. I was looking at Raynes/fs library: https://github.com/Raynes/fs/blob/master/src/me/raynes/fs.clj I wanted to check and see if "iterate-dir" returned a seq of strings (paths) or a seq of File objects

Re: NoClassDefFoundError after I import with "use" on the repl?

2014-02-07 Thread larry google groups
oject.clj dependencies: [me.raynes/fs "1.4.3"] > > Andy > > > On Thu, Feb 6, 2014 at 9:11 PM, larry google groups > > > wrote: > >> I imagine this question has been asked a million times before, but I can >> not find the answer. >> >

What is "#" doing in " #+cljs [cljs.reader :as reader] "

2014-02-07 Thread larry google groups
I am looking here: https://github.com/jkk/formative/blob/master/src/formative/parse.cljx and I see this line: #+cljs [cljs.reader :as reader] So I look here to see what the "#" is doing: http://clojure.org/reader and I read: Dispatch (#) The dispatch macro causes the reader to use a reade

Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
I have no background with Java so I tend to suffer pain when dealing with it. I am trying to create a thumbnail for an image, but my code dies on the :post assertion of this function: (defn get-file-as-image [filename] {:pre [(= (type filename) java.lang.String) (fs/exists? filename)

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
: read for class java.lang.Class I don't get why ImageIO is java.lang.Class after I imported it. On Thursday, February 27, 2014 3:09:53 PM UTC-5, larry google groups wrote: > > I have no background with Java so I tend to suffer pain when dealing with > it. I am trying to create

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
Ah, I see what happened. There was a Microsoft Word document in my folder of images. It was causing the problems. I had no error handling for non-images. On Thursday, February 27, 2014 3:52:09 PM UTC-5, Aaron Cohen wrote: > > On Thu, Feb 27, 2014 at 3:44 PM, larry google

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
ng files get to this function. Any suggestions why nothing gets written to disk? On Thursday, February 27, 2014 4:09:10 PM UTC-5, larry google groups wrote: > > > Ah, I see what happened. There was a Microsoft Word document in my folder > of images. It was causing the pr

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
.ImageIO/write simg ext (io/as-file path-to-new-file-including-file-name So the final println gives me: the extension we use: "JPG" and yet now I get: Exception in thread "Thread-1" javax.imageio.IIOException: Invalid argument to native writeImage at com.sun.imageio.plugins.jpe

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
ImageIO.write(image, "png",new File("C:\\out.png")); None of those formatting strings have a period in them. And yet when I remove the period from my extension, I get an error. And even with it, nothing happens and nothing gets written to disk. On Thursday, February 27, 20

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
's > actually loaded correctly? > > > > > On Thu, Feb 27, 2014 at 5:04 PM, larry google groups > > > wrote: > >> I wanted to see what Format strings I am allowed, so at the repl: >> >> >> user> (import 'javax.imageio.ImageIO) >

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
code isn't working, it's hard to say. Can you try just > writing out the file you read (before resizing) and make sure that it's > actually loaded correctly? > > > > > On Thu, Feb 27, 2014 at 5:04 PM, larry google groups > > > wrote: > >> I w

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
ich does what you want. It uses Scalr > internally which has some good quality options. > > As for why your code isn't working, it's hard to say. Can you try just > writing out the file you read (before resizing) and make sure that it's > actually loaded correctly? >

My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread larry google groups
I am working on web software where admins will be using HTML forms to update data in a MongoDb database. I decided to use Lamina to off-load the work to the background. There are several operations that need to happen: updates, deletions, etc, and I thought I'd put each on a different channel.

Re: My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread larry google groups
> the forms in a "do" block. > > As an aside, this doesn't look like a good use-case for macros. You'd > probably be better defining a map with keys for :worker, :channel, etc. > Either that or a protocol. > > - James > > > On 10 December 2013 17:42,

Re: My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread larry google groups
Thanks much. Your approach is much better than mine. I was looking for a good excuse to use a macro, but I suppose I will postpone that for another day. On Tuesday, December 10, 2013 2:03:07 PM UTC-5, James Reeves wrote: > > On 10 December 2013 18:24, larry google groups >

When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-22 Thread larry google groups
I am surprised that a map literal is clojure.lang.PersistentArrayMap but as soon as I assign it to a var, it becomes clojure.lang.PersistentHashMap. Are there any rules for being able to predict when these conversions occur? user> (type {}) clojure.lang.PersistentArrayMap user> (type {:what "

Re: When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-22 Thread larry google groups
rule is that handles the conversion. I don't care if the return type is clojure.lang.PersistentArrayMap or clojure.lang.PersistentHashMap, all I want is it for it be consistently one or the other. On Sunday, December 22, 2013 2:31:45 PM UTC-5, larry google groups wrote: > > >

Re: When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-22 Thread larry google groups
Hmm, I see. get-distinct was returning an empty lazyseq, which apparently made the difference. On Sunday, December 22, 2013 2:56:01 PM UTC-5, larry google groups wrote: > > Hmm, the different return types seem tied to the 2 different functions > being called, but both functions have

How do I fix *warn-on-reflextion* warnings in 3rd party libraries?

2013-12-22 Thread larry google groups
I know this has been discussed before but I could not find anything like a canonical answer via Google. I just set to :warn-on-reflection true in my project.clj and now I get the following warnings. How do I fix the warnings that are in 3rd party libraries? How do I add type hints to code

Re: How do I fix *warn-on-reflextion* warnings in 3rd party libraries?

2013-12-23 Thread larry google groups
Sean, Thank you much. I do understand that Clojure is not a *statically typed language, *but it seems like it should be possible to deal with these reflexion issues when someone needs to. In my company we had a Scala versus Clojure debate and there was a vocal crowd that felt we should use Sc

Re: When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-23 Thread larry google groups
Clojure sometimes uses one and sometimes the > other. If you want to enforce that a map is returned, enforce that the > return is a subtype of java.util.Map rather than checking for a specific > concrete class of map. > > > On Sun, Dec 22, 2013 at 3:07 PM, larry google groups

Re: When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-23 Thread larry google groups
$fetch.invoke(secretary.clj:327) How else do I find what interfaces the return value might be implementing? On Monday, December 23, 2013 10:04:54 PM UTC-5, larry google groups wrote: > > > enforce that the return is a subtype of java.util.Map rather than > checking for a specific co

is there a tutorial about working at the REPL?

2013-12-28 Thread larry google groups
I have been working with Clojure now some of the time for the last 18 months, so I am no longer a complete noob. But I still have many questions about how to work at the REPL. In particular, I don't understand how the REPL interacts with the class path. I have an app that is working. When I

Re: In your opinion, what's the best, and what's the worst aspects of using Clojure?

2013-12-28 Thread larry google groups
> What still scars me in terms of incorporating Clojure as a language of choice in more > complicated projects I work on in my other life, is the error reporting facility. The > errors sometimes might as well just say 'I just cannot run!'. It would be nice if > there was some facility to ap

Re: In your opinion, what's the best, and what's the worst aspects of using Clojure?

2013-12-28 Thread larry google groups
I like this: (defmacro dump-locals [] `(clojure.pprint/pprint ~(into {} (map (fn [l] [`'~l l]) (reverse (keys &env)) Slingshot also allows one to throw+ an object that is full of local information: https://github.com/scgilardi/slingshot And Michael Drogalis's library Dire rece

Why is "add-watch" still in alpha?

2013-12-29 Thread larry google groups
add-watch was alpha in Clojure 1.2: http://clojuredocs.org/clojure_core/1.2.0/clojure.core/add-watch it is still alpha now, in Clojure 1.5: http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/add-watch I am curious what the plan is for add-watch? I was just reading this: h

Re: is there a tutorial about working at the REPL?

2013-12-29 Thread larry google groups
> If it can't find the file, > `clojure.java.io/resource` returns nil; and (slurp > nil) throws an IllegalArgumentException, which doesn't seem to be the error > you're getting. Thanks for that. But the app has no problem reading the schema.edn file when I

Re: Error on redirect when attempting unauthorized entry to Friend route

2013-01-17 Thread larry google groups
How should I debug this? What questions should I ask? At this point, for the sake of debugging, I have everything in one file, in one name space. I have recreated the dummy users database: (def users {"root"{:username "lawrence" :password (creds/hash-bcrypt "admin_password")

my css and images are on the wrong path? -- NoClassDefFoundError: org/eclipse/jetty/http/MimeTypes

2013-01-18 Thread larry google groups
I searched on Google but found little about this error. I was leaving work, where my app was working, and so I did "git push origin master" and sent it all to Github, I got home and did "git pull origin master" to pull everything onto my machine (work is a Mac running OSX 10.8 and at home I've got

Re: my css and images are on the wrong path? -- NoClassDefFoundError: org/eclipse/jetty/http/MimeTypes

2013-01-18 Thread larry google groups
. Not sure if that is coincident to something else, or whether the cause is somehow direct. On Jan 18, 3:08 am, larry google groups wrote: > I searched on Google but found little about this error. > > I was leaving work, where my app was working, and so I did "git push > origin ma

Re: my css and images are on the wrong path? -- NoClassDefFoundError: org/eclipse/jetty/http/MimeTypes

2013-01-18 Thread larry google groups
something does. If anyone else runs into, the solution was as simple as deleting all cookies when I restart the app. On 18 Sty, 03:15, larry google groups wrote: > Hmm, strange. I have had a lot of problems trying to get Friend to > work. I have been wrestling with it, on and off, for 2 days,

why would I use uberwar instead of uberjar?

2013-01-22 Thread larry google groups
I know very little about the JVM eco-system. I have been using "lein uberjar" for all of my webapps, and it has worked great (Jetty/Ring). Why would I use uberwar? What are the advantages? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

what does "is" expect in tests?

2013-01-25 Thread larry google groups
I thought this test would assure me that my test data contains at least one question: (deftest is-there-at-least-one-question (testing "We want to see if there is at least one question in memory.]" (let [first-question (get-in @um/interactions [:questions])] (println (apply str first

SIGBUS : A fatal error has been detected by the Java Runtime Environment

2013-01-28 Thread larry google groups
I have a small clojure app (maybe 700 lines of code). I start it at the terminal and it runs for 10 minutes or so. Then, sometimes, it produces this error: # A fatal error has been detected by the Java Runtime Environment: # # SIGBUS (0xa) at pc=0x00010e34815e, pid=45108, tid=22787 # # JR

  1   2   3   4   >