Re: Comparing Regular Expression pattens for equality?

2014-02-27 Thread Thomas
Thanks guys, Shame that it doesn't work that way. I've worked around it as suggested below. Thomas -- 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

'lein pom' and 'mvn package'

2014-02-27 Thread Paul Smith
Hi, Through restrictions, I am prevented from using Leiningen on the CI server and I am attempting to package Clojure through Maven. I have a core.clj with a (:gen-class) in the namespace and a (-main). My project.clj includes a :main and :aot with the value of the main namespace. I can 'lein

Re: Om: trouble with goog reference

2014-02-27 Thread cig
Hi David I tried changing :advanced mode to :whitespace mode. My index.html file looks as follows: html body div id=registry/div script src=http://fb.me/react-0.9.0.js;/script script src=js/om_ho.js/script /body /html my project.clj file looks as follows: (defproject om-ho

problem catching exceptions in webapp

2014-02-27 Thread Wei Hsu
I'm having trouble catching exceptions in my Compojure web app. Made a small test case to illustrate the issue: https://github.com/yayitswei/exceptiontest Could you take a look and spot what I'm doing wrong? Thanks, Wei -- You received this message because you are subscribed to the Google

Re: [ANN] Sente - Clojure(Script) + core.async + WebSockets/Ajax

2014-02-27 Thread edbond
Thanks. Can you compare sente with chord? On Wednesday, February 26, 2014 3:57:24 PM UTC+2, Peter Taoussanis wrote: Hi folks, Quick post to announce a new lib release: https://github.com/ptaoussanis/sente From the README: *Sente* is small client+server library that makes it easy to build

Re: [ANN] Sente - Clojure(Script) + core.async + WebSockets/Ajax

2014-02-27 Thread Peter Taoussanis
@Base This looks great! can't wait to try it out. Well done. Much appreciated, hope it's useful :-) @edbond Thanks. Can you compare sente with chord? Sure, I can try - have never actually used Chord though (it wasn't around when I wrote Sente's predecessor) - so I can only comment

Comparing classes in case statement

2014-02-27 Thread Markus Bader
Hello, if I am not too dumb, it seems that comparing for classes does not work in case statements, like: = (class '(1 2 3)) clojure.lang.PersistentList = (case (class '(1 2 3)) clojure.lang.PersistentList :amazing :so-sad) :so-sad I do not need a workaround - that is already

Re: Comparing classes in case statement

2014-02-27 Thread Jan Herich
From official clojure documentation: The test-constants are not evaluated. They must be compile-time literals Dňa štvrtok, 27. februára 2014 14:03:04 UTC+1 Markus Bader napísal(-a): Hello, if I am not too dumb, it seems that comparing for classes does not work in case statements, like: =

Re: Om: trouble with goog reference

2014-02-27 Thread David Nolen
Your markup needs to look something like: div id=classes/div script src=http://fb.me/react-0.9.0.js;/script script src=js/out/goog/base.js type=text/javascript/script script src=js/om_ho.js type=text/javascript/script script type=text/javascriptgoog.require(om_ho.core);/script HTH, David On

Re: Is there a function to determine if code is run as script or library ?

2014-02-27 Thread GeekyCoder
Hi, Aaron, Rob thank for the reply. I actually thinking that something that is straightforward and less involving (without daemon or lein). What happen is that I like to write a script in intellij editor, and then choose run, clojure will check for main function in current file , and

Re: problem catching exceptions in webapp

2014-02-27 Thread Immo Heikkinen
(assert false) throws AssertionError which doesn't extend Exception and therefore is not caught. :: Immo 2014-02-27 13:42 GMT+02:00 Wei Hsu yayits...@gmail.com: I'm having trouble catching exceptions in my Compojure web app. Made a small test case to illustrate the issue:

Re: Help with data structures and dereferencing

2014-02-27 Thread Dave Della Costa
Hi Robert, I completely understand the desire to structure your code in a way that isolates business logic. It's something I struggle with all the time and I think it's not simple when you're shifting from thinking in an OO way (as you and I and so many folks are) to thinking more functionally

Re: object identity

2014-02-27 Thread Andy Fingerhut
I will mention a case that I wasn't thinking about when I wrote my previous message in this thread. If one is commonly dealing with tree-like data structures, e.g. maps that contains maps as keys or values, which in turn contain other maps, or vectors, or sets, etc., it is relatively trivial in

[ANN] jetty9-websockets-async - A servlet implementation

2014-02-27 Thread ToBeReplaced
Hi, Presenting a `javax.http.servlet.HttpServlet` for offloading WebSocket communication onto `core.async` channels: https://github.com/ToBeReplaced/jetty9-websockets-async Note that this implements a `WebSocketServlet` using Jetty9 for the handshakes. The resulting servlet can be used by any

[ANN] lein-modules 0.2.0

2014-02-27 Thread Jim Crossley
What is lein-modules? A leiningen plugin providing support for project aggregation, letting you define parent-child relationships between projects to achieve interdependence-based build ordering, project inheritance based on leiningen profiles, and centralized dependency management. What's in

Re: Help with data structures and dereferencing

2014-02-27 Thread Robert Quinn
That does help. thanks for the link. good to get feedback, I figured there's no magic bullet but didn't want to go to far down a path without soliciting advice. I'm going to try a few things, keep it simple and see how it holds up. thanks again dave On Thursday, February 27, 2014

Re: [ANN] clojure.test.check (previously, simple-check)

2014-02-27 Thread Ambrose Bonnaire-Sergeant
Congrats! Ambrose On Fri, Feb 28, 2014 at 1:22 AM, Reid Draper reiddra...@gmail.com wrote: I'm happy to announce the first release of the newest Clojure contrib library: test.check [1]. Previously named simple-check [1], test.check is a property-based testing library, based on QuickCheck.

[ANN] clojure.test.check (previously, simple-check)

2014-02-27 Thread Reid Draper
I'm happy to announce the first release of the newest Clojure contrib library: test.check [1]. Previously named simple-check [1], test.check is a property-based testing library, based on QuickCheck. The README has a guide for migrating from simple-check, as well as some getting-started

Problem with nREPL handle* function

2014-02-27 Thread Jony Hudson
Hi Folks, I'm stuck and would like a bit of help. This is following on from a question I posted to clojure.tools, but I've reduced the problem to its essence, and figure it might get a few more eyes on it here. My apologies to anyone who has to suffer reading about it twice :-) My actual

Re: Om: trouble with goog reference

2014-02-27 Thread boz
Hi David, Clifford, I'm pretty sure Clifford is using the Cider version from Mimmohttps://github.com/magomimmo/om-start-template/. I've got a fork of ithttps://github.com/christoferjennings/om-start-templatewith updates so it work with Om 0.5.0 and React 0.9.0 that I've used to get through

Re: Om: trouble with goog reference

2014-02-27 Thread boz
... should have mentioned, in case it's not obvious, I got through the basic tutorial using my fork of Mimmo's excellent work. ,chris (aka boz) On Thursday, February 27, 2014 10:40:23 AM UTC-8, boz wrote: Hi David, Clifford, I'm pretty sure Clifford is using the Cider version from

Re: Om: trouble with goog reference

2014-02-27 Thread David Nolen
Many thanks for taking the time to implement share your solution! David On Thu, Feb 27, 2014 at 1:40 PM, boz b...@cox.net wrote: Hi David, Clifford, I'm pretty sure Clifford is using the Cider version from Mimmohttps://github.com/magomimmo/om-start-template/. I've got a fork of

[ANN] ILC 2014 call for papers reminder

2014-02-27 Thread Marc Feeley
ILC 2014 - International Lisp Conference Lisp on the Move August 14-17 2014, Université de Montréal, Montréal, Canada Sponsored by the Association of Lisp Users http://www.international-lisp-conference.org Scope: Lisp is one of the greatest ideas from computer

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?

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
I tried this too: (ns tma-make-thumbnails.make-images (:import (java.util UUID) (javax.imageio ImageIO) (java.awt.image BufferedImage) (javax.imageio ImageReader)) (defn get-file-as-image [filename] {:pre [(= (type filename) java.lang.String) (fs/exists? filename)

Found some unexpected behavior to me

2014-02-27 Thread Brent Millare
Clojure 1.5.1 user= (defprotocol IEmit (-emit [x])) IEmit user= (defrecord css [y] IEmit (-emit [_] y)) user.css user= (-emit (-css 3)) 3 user= (map -emit [(-css 3)]) IllegalArgumentException No matching field found: emit for class user.css clojure.lang.Reflector.getInstanceField

Re: Why do I have to register an ImageReader?

2014-02-27 Thread Aaron Cohen
On Thu, Feb 27, 2014 at 3:44 PM, larry google groups lawrencecloj...@gmail.com wrote: I tried this too: (ns tma-make-thumbnails.make-images (:import (java.util UUID) (javax.imageio ImageIO) (java.awt.image BufferedImage) (javax.imageio ImageReader)) (defn

Re: Found some unexpected behavior to me

2014-02-27 Thread David Nolen
Fixed in 1.6. David On Thu, Feb 27, 2014 at 3:50 PM, Brent Millare brent.mill...@gmail.comwrote: Clojure 1.5.1 user= (defprotocol IEmit (-emit [x])) IEmit user= (defrecord css [y] IEmit (-emit [_] y)) user.css user= (-emit (-css 3)) 3 user= (map -emit [(-css 3)])

Re: [GSoC]: How to participate

2014-02-27 Thread Максим Карандашов
Hello, all. I would like to take part in GSOC 2014 And after talking to a mentor I have next questions: 1. Does the community some particular proposal form for students? 2. Are there any formal requirements for students? (like fix bug in bug tracker of some project of community) -- You

Uberjar woes

2014-02-27 Thread Tom Connors
Hi Everyone, I've been having trouble creating an uberjar of a project and I'm hoping someone here can point me toward a solution. After cleaning out the target directory (with lein clean) and preprocessing my cljx, I can run the project with no trouble using lein repl and lein run. I can

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 groups

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
Hmm, I made it a little further. Now I am trying to write a thumbnail to disk. I have copied the code from StackOverflow. I am using this function: (defn make-thumbnail [filename path-to-new-file-including-file-name width] {:pre [(= (type filename) java.lang.String) (fs/exists?

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
I wanted to see what Format strings I am allowed, so at the repl: user (import 'javax.imageio.ImageIO) javax.imageio.ImageIO user (require '[clojure.pprint :as pp]) user (pp/pprint (javax.imageio.ImageIO/getReaderFormatNames))[BMP, bmp, jpg, JPG, wbmp, jpeg, png, JPEG, PNG, WBMP, GIF, gif]

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
and if I look here: http://www.mkyong.com/java/how-to-write-an-image-to-file-imageio/ I see this example: ImageIO.write(image, jpg,new File(C:\\out.jpg)); ImageIO.write(image, gif,new File(C:\\out.gif)); ImageIO.write(image, png,new File(C:\\out.png));

Re: Why do I have to register an ImageReader?

2014-02-27 Thread Aaron Cohen
This is going to result in a pretty ugly thumbnail because you're missing the hints java needs to do high quality resizing. Java's shrinking also doesn't really have a nice smoothing mode. I'd actually recommend you look into https://github.com/mikera/imagez. It has a resize function in core

Re: [GSoC]: How to participate

2014-02-27 Thread Daniel Solano Gómez
On Thu Feb 27 13:04 2014, Максим Карандашов wrote: Hello, all. I would like to take part in GSOC 2014 And after talking to a mentor I have next questions: 1. Does the community some particular proposal form for students? We do have some student application guidelines up on the wiki [1].

Re: Why do I have to register an ImageReader?

2014-02-27 Thread Aaron Cohen
You definitely don't want a period in your format string. Why are you calling(.drawImage g img 0 0 width height nil). What's the nil for? I'd try dropping it. On Thu, Feb 27, 2014 at 5:17 PM, larry google groups lawrencecloj...@gmail.com wrote: and if I look here:

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
Thanks for the tip about imagez. I wanted to get something basic working today, but I'll give imagez a look tomorrow. As for now, I feel like I should not give up till I have figured out what the problem is. On Thursday, February 27, 2014 5:17:20 PM UTC-5, Aaron Cohen wrote: This is going

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
I found this: http://stackoverflow.com/questions/3432388/imageio-not-able-to-write-a-jpeg-file So I changed this: imgtype (java.awt.image.BufferedImage/TYPE_INT_ARGB) to this: imgtype (java.awt.image.BufferedImage/TYPE_3BYTE_BGR) and that worked for one image. The next image

[ANN] Clojure 1.6.0-beta2

2014-02-27 Thread Alex Miller
Clojure 1.6.0-beta1 is now available. Try it via - Download: http://central.maven.org/maven2/org/clojure/clojure/1.6.0-beta2 - Leiningen: [org.clojure/clojure 1.6.0-beta2] See the full change log here: https://github.com/clojure/clojure/blob/master/changes.md Clojure 1.6.0-beta2 has the

Re: [ANN] Clojure 1.6.0-beta2

2014-02-27 Thread Alex Miller
That first line should be 1.6.0-beta2 of course. :) On Thursday, February 27, 2014 5:37:15 PM UTC-5, Alex Miller wrote: Clojure 1.6.0-beta1 is now available. Try it via - Download: http://central.maven.org/maven2/org/clojure/clojure/1.6.0-beta2 - Leiningen: [org.clojure/clojure

Re: Why do I have to register an ImageReader?

2014-02-27 Thread larry google groups
Okay, everything works now. Apparently that last problem had something to do with differences between OpenJDK and the SunJDK. I have: java -version openjdk version 1.7.0-ea OpenJDK Runtime Environment (build 1.7.0-ea-b222) OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode) I don't recall

Re: Uberjar woes

2014-02-27 Thread Sam Ritchie
Hey Tom, Can you post your project.clj for us to take a peek? Tom Connors mailto:t.v.conn...@gmail.com February 27, 2014 12:49 PM Hi Everyone, I've been having trouble creating an uberjar of a project and I'm hoping someone here can point me toward a solution. After cleaning out the target

Re: Macro writing macro fails with CLJS

2014-02-27 Thread Karsten Schmidt
Just to follow up on this a note for future reference: I could get my original macro to work in both dialects by just syntax quoting the passed in arguments and I've also pushed out a first release of the mini-library this is all meant for...

Re: Uberjar woes

2014-02-27 Thread Tom Connors
Hi Sam, thanks a lot for responding. Here's my project.clj: https://gist.github.com/tomconnors/9261413 On Thursday, February 27, 2014 2:49:38 PM UTC-5, Tom Connors wrote: Hi Everyone, I've been having trouble creating an uberjar of a project and I'm hoping someone here can point me toward a

Re: Do you recommend the book: Web Development with Clojure

2014-02-27 Thread Hari Krishnan
My experience.. 1. It is a well written book. You will have to read sequentially. 2. Prior knowledge of clojure is required -- list, vector, map, let etc. (Or at least review the clojure summary at the back first). 3. Since I knew Rails before, a lot of the concepts seemed to be straight

Re: Database migrations

2014-02-27 Thread Chris Kuttruff
Reginald, clearly late to the game on this thread :) but figured I'd share a project that I created recently ( clj-sql-up ). It is a leiningen plugin that is dead simple to use, and it doesn't try to over-abstract, but it also allows for dynamic sql generation since it runs from the context

Re: Do you recommend the book: Web Development with Clojure

2014-02-27 Thread Mark Engelberg
It's worth noting that the new Clojure Cookbook also has a chapter that goes over the basics of Clojure web development. If you already are quite comfortable with Clojure and don't need to see a lot of extended examples, the Cookbook chapter covers much of the same ground as the Clojure Web

Re: Image processing

2014-02-27 Thread exel...@gmail.com
Hi Michael, Got some good results on img processing tests. I got image resizer working nice, it was a resource path issue. However after some side by side testing with graphicmagick, I found imgscalr outputs files at a 30% to 50% larger file size. About 30% on larger dimensions, 50% on

Re: [ANN] Sente - Clojure(Script) + core.async + WebSockets/Ajax

2014-02-27 Thread Peter Taoussanis
Quick addendum: I've had a few folks ask about various security implementations. So first up - as I mention in the REAME, I have had to make some changes to the codebase for the public release so I wouldn't quite trust anything pre-1.0 in production just yet (there's likely at least minor

Re: Om: trouble with goog reference

2014-02-27 Thread boz
Hopefully it's helpful. :) Here's a branch with the completed Basic tutorial. The commit log for the branch follows the Basic Tutorial. https://github.com/christoferjennings/om-start-template/tree/om-0-5-0-tut/samples/om-0-5-0-tut I still need to relaunch Cider occasionally. Basically every