Re: datomic question

2013-03-04 Thread edward
Thanks very much Michael and Jonas. On Monday, 4 March 2013 07:20:24 UTC, Jonas wrote: Hi You can use the tempid ( http://docs.datomic.com/clojure/index.html#datomic.api/tempid) function to generate new temporary ids. Jonas On Monday, March 4, 2013 8:50:56 AM UTC+2,

Re: Wrong clojure version depending on lein dependencies

2013-03-04 Thread Frank Siebenlist
Excellent - thanks for letting me know - Frank. On Mar 3, 2013, at 11:37 PM, Tassilo Horn t...@gnu.org wrote: Frank Siebenlist frank.siebenl...@gmail.com writes: Hi Frank, clj-ns-browser 1.3.1 is released and addresses this issue by upgrading the project's dependencies to seesaw 1.4.3.

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Wolodja Wentland
On Sat, Mar 02, 2013 at 17:42 -0600, Nelson Morris wrote: Or is this a bug in leiningen's dependency resolution? Unfortunately it's behaviour defined by maven. In order to be compatible lein has to do the same thing. I've written up a few things about version ranges at

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Meikel Brandmeyer (kotarak)
Hi, Am Montag, 4. März 2013 13:00:31 UTC+1 schrieb Wolodja Wentland: It is up to a community to fix things that are broken in their toolset and Do not use version ranges is IMHO the wrong answer. Huge +1. I was about to blog in favour of version ranges. As I'm a toolmaker myself, I

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Chas Emerick
On Mar 4, 2013, at 7:36 AM, Meikel Brandmeyer (kotarak) wrote: Hi, Am Montag, 4. März 2013 13:00:31 UTC+1 schrieb Wolodja Wentland: It is up to a community to fix things that are broken in their toolset and Do not use version ranges is IMHO the wrong answer. Huge +1. I was

Re: Wrong clojure version depending on lein dependencies

2013-03-04 Thread Hugo Duncan
Meikel Brandmeyer (kotarak) m...@kotka.de writes: Hi, Am Montag, 4. März 2013 13:00:31 UTC+1 schrieb Wolodja Wentland: It is up to a community to fix things that are broken in their toolset and Do not use version ranges is IMHO the wrong answer. Huge +1. Fixing version ranges seems

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Meikel Brandmeyer (kotarak)
Hi Chas, Am Montag, 4. März 2013 14:33:29 UTC+1 schrieb Chas Emerick: There are a lot of reasons for this, but #1 for me is that few people understand the implications of version ranges, either downstream of their published libraries or when they are consuming a library and place a range

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Michał Marczyk
Hi Wolodja, It's useful to note that you can use the currently preferred fixed version specifiers and still have your dependencies and the top-level project depend on multiple versions of a library (the common case is multiple versions of Clojure specified as dependencies). Also, you can specify

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Wolodja Wentland
On Mon, Mar 04, 2013 at 08:33 -0500, Chas Emerick wrote: FWIW, contributors to Pomegranate and Leiningen are working on general solutions to this sort of madness, but the use of version ranges will always be largely unwarranted, especially in published libraries. There are a lot of reasons

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Wolodja Wentland
On Mon, Mar 04, 2013 at 06:01 -0800, Meikel Brandmeyer (kotarak) wrote: Ok. So instead of the range I specify [org.clojure/clojure 1.2]. What does that mean? Now I either excluded *all* clojure versions not= 1.2 or the version number doesn't mean anything. Then we should get rid of it

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Michał Marczyk
On 4 March 2013 15:01, Meikel Brandmeyer (kotarak) m...@kotka.de wrote: The range [1.2;1.5) means that the library was tested with 1.2 up to 1.4 and - believing in semver - their patchlevel children. 1.5 (was at that time) not released, yet. So compatibility couldn't be guaranteed. For me this

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Marko Topolnik
On Monday, March 4, 2013 3:01:13 PM UTC+1, Meikel Brandmeyer (kotarak) wrote: The range [1.2;1.5) means that the library was tested with 1.2 up to 1.4 and - believing in semver - their patchlevel children. 1.5 (was at that time) not released, yet. So compatibility couldn't be guaranteed.

Re: byte-array woes

2013-03-04 Thread Karsten Schmidt
Hi Frank, I've added a patch to CLJ-766 with a potential fix. Also, Andy F. kindly pointed out that interested parties should vote on that issue to help increase its visibility... Add your 2 cents here (provided you've a CA): http://dev.clojure.org/jira/browse/CLJ-766 Best, K. -- Karsten Schmidt

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Wolodja Wentland
On Mon, Mar 04, 2013 at 15:04 +0100, Michał Marczyk wrote: On the other hand, if you care about securing your project, pulling in the latest bugfixes etc., you will need to monitor new releases anyway, regardless of the version numbering scheme used by their maintainers. And then release a

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread David Powell
On Mon, Mar 4, 2013 at 2:01 PM, Meikel Brandmeyer (kotarak) m...@kotka.dewrote: Hi Chas, Am Montag, 4. März 2013 14:33:29 UTC+1 schrieb Chas Emerick: There are a lot of reasons for this, but #1 for me is that few people understand the implications of version ranges, either downstream of

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Chas Emerick
On Mar 4, 2013, at 9:01 AM, Meikel Brandmeyer (kotarak) wrote: Hi Chas, Am Montag, 4. März 2013 14:33:29 UTC+1 schrieb Chas Emerick: There are a lot of reasons for this, but #1 for me is that few people understand the implications of version ranges, either downstream of their published

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Wolodja Wentland
On Mon, Mar 04, 2013 at 14:42 +, David Powell wrote: 1.2 in this case is a soft dependency on 1.2.  This is probably what you want. http://docs.codehaus.org/display/MAVEN/ Dependency+Mediation+and+Conflict+Resolution# DependencyMediationandConflictResolution-DependencyVersionRanges

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Marko Topolnik
On Monday, March 4, 2013 3:42:56 PM UTC+1, David Powell wrote: Version ranges aren't for communicating what versions of libraries you have tested against - that is best done out-of-band. If you include a version range, like the one above, you are saying that you want the software to fail

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread David Powell
On Mon, Mar 4, 2013 at 2:55 PM, Wolodja Wentland babi...@gmail.com wrote: On Mon, Mar 04, 2013 at 14:42 +, David Powell wrote: 1.2 in this case is a soft dependency on 1.2. This is probably what you want. http://docs.codehaus.org/display/MAVEN/

Re: [GSoC 2013] CinC

2013-03-04 Thread Aaron Cohen
I think there probably is pretty easily a few months work there. If more work were needed, it would be interesting to try to get the clojurescript and clojure compilers using the same front-end. I'm fairly confident that's at least a summer's work. :) --Aaron On Sat, Mar 2, 2013 at 11:05 AM,

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Wolodja Wentland
On Mon, Mar 04, 2013 at 09:54 -0500, Chas Emerick wrote: AFAICT, the vast majority of Leiningen users (same goes for Maven users as well) expect the dependency vector [org.clojure/clojure 1.2.0] to establish a lower bound, the equivalent of [1.2.0,). Further, people expect the maximum of

Re: [GSoC 2013] CinC

2013-03-04 Thread Ambrose Bonnaire-Sergeant
Any prospective students interested? On Mon, Mar 4, 2013 at 11:04 PM, Aaron Cohen aa...@assonance.org wrote: I think there probably is pretty easily a few months work there. If more work were needed, it would be interesting to try to get the clojurescript and clojure compilers using the same

how to get SHA1 of a string?

2013-03-04 Thread larry google groups
I have been having problems making an API call to Omniture. I have exchanged a dozen emails with a developer at Omniture, and he gave me the impression that I was constructing my security codes incorrectly. So now I am confronting my ignorance over how Java handles certain conversions. The

Re: core.logic: Dividing the knowledge base

2013-03-04 Thread Norman Richards
On Wed, Feb 27, 2013 at 4:03 PM, JvJ kfjwhee...@gmail.com wrote: It states that retractions aren't yet implemented. Is there any way to delete facts? Retractions are now supported. DB merging and cross-DB logic queries are still coming. Feel free to comment on the github issues if you have

Re: how to get SHA1 of a string?

2013-03-04 Thread Michael Klishin
2013/3/4 larry google groups lawrencecloj...@gmail.com Any suggestions? You can use https://github.com/clojurewerkz/support/blob/master/src/clojure/clojurewerkz/support/hashing.clj note that you need to concatenate a byte array and bytes from a string first. -- MK

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
You can use https://github.com/clojurewerkz/support/blob/master/src/clojure/cloju... note that you need to concatenate a byte array and bytes from a string first. I appreciate your suggestion, but I feel that I need to understand why I failed when I used these classes:

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
The developer at Omniture very kindly sent me a follow up email that gives me a sense of where my mistake might be, though I have no clear idea how to fix it. I sent him my code and my output, to which he responded: Most things seem in order until I see your wsse header. Its not correct as both

Re: how to get SHA1 of a string?

2013-03-04 Thread Michael Klishin
2013/3/4 larry google groups lawrencecloj...@gmail.com I appreciate your suggestion, but I feel that I need to understand why I failed when I used these classes: (.digest (java.security.MessageDigest/getInstance sha1) digest-as-string) expects its argument to be a byte array:

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
expects its argument to be a byte array:http://docs.oracle.com/javase/6/docs/api/java/security/MessageDigest which can be obtained from a string using String#getBytes. I appreciate your suggestion. For most of the attempts that I have made, I have used this code: nonce

Re: [GSoC 2013] CinC

2013-03-04 Thread abp
Is this work related? http://clojurewest.org/sessions#martin https://github.com/kanaka/clojurescript On Monday, March 4, 2013 4:15:07 PM UTC+1, Ambrose Bonnaire-Sergeant wrote: Any prospective students interested? On Mon, Mar 4, 2013 at 11:04 PM, Aaron Cohen aa...@assonance.orgjavascript:

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread Michał Marczyk
On 4 March 2013 15:30, Wolodja Wentland babi...@gmail.com wrote: On Mon, Mar 04, 2013 at 15:04 +0100, Michał Marczyk wrote: On the other hand, if you care about securing your project, pulling in the latest bugfixes etc., you will need to monitor new releases anyway, regardless of the version

why do I get Null pointer on this GMT SimpleDateFormat?

2013-03-04 Thread larry google groups
I need to get a GMT date. I found this page on StackOverflow: http://stackoverflow.com/questions/308683/how-can-i-get-the-current-date-and-time-in-utc-or-gmt-in-java It gives this example: SimpleDateFormat dateFormatGmt = new SimpleDateFormat(-MMM-dd HH:mm:ss);

Re: datomic question

2013-03-04 Thread larry google groups
This page: http://clojure.org/reader Offers this explanation of what the # character does: Dispatch (#) The dispatch macro causes the reader to use a reader macro from another table, indexed by the character following #: #{} - see Sets above Regex patterns (#pattern) A regex pattern is read

Re: Interesting Light Table post

2013-03-04 Thread larry google groups
I was thinking a lot after reading the thread Why is this so difficult that maybe what we need is a dedicated IDE, something that's built with the clojure workflow in mind, The Clojure workflow, as it has evolved in this community, has mostly been repl combined with a text editor. And that is

Git is a purely functional data structure

2013-03-04 Thread Rich Morin
I found this to be interesting and well written: Git is a purely functional data structure http://www.jayway.com/2013/03/03/git-is-a-purely-functional-data-structure/ -r -- http://www.cfcl.com/rdmRich Morin http://www.cfcl.com/rdm/resume r...@cfcl.com

What role does a semicolon play in this case?

2013-03-04 Thread John Smith
Hi, I'm reading about Clojure from an O'Reilly book and came across this example: (def a-map {:first-key first-value :second-key second-value third-key :third-value fourth-key 4}) Is the semicolon simply part of the atom? Because {first:key first-value...} doesn't work and I get an

Re: What role does a semicolon play in this case?

2013-03-04 Thread Mauricio Aldazosa
I'm assuming you are talking about the colon :, it means that you are working with a keyword: http://clojure.org/data_structures#Data%20Structures-Keywords -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: What role does a semicolon play in this case?

2013-03-04 Thread Yves S. Garret
Yes, colon :) . Thanks for your help. On Mon, Mar 4, 2013 at 12:30 PM, Mauricio Aldazosa mauricio.aldaz...@ciencias.unam.mx wrote: I'm assuming you are talking about the colon :, it means that you are working with a keyword: http://clojure.org/data_structures#Data%20Structures-Keywords

Re: What role does a semicolon play in this case?

2013-03-04 Thread Akhil Wali
Um... Semicolon? where? The colon indicates a symbol though :) On Mar 4, 2013 10:55 PM, John Smith yoursurrogate...@gmail.com wrote: Hi, I'm reading about Clojure from an O'Reilly book and came across this example: (def a-map {:first-key first-value :second-key second-value third-key

Re: Interesting Light Table post

2013-03-04 Thread Erlis Vidal
Exactly! Tha'ts why I see a lot of value in this product! Enabling other languages might be great for Light Table's popularity, but creating the ultimate clojure experience will do a greater good for the clojure community. Now they have two paths, better clojure experience or great popularity,

Re: how to get SHA1 of a string?

2013-03-04 Thread Aaron Cohen
On Mon, Mar 4, 2013 at 11:12 AM, larry google groups lawrencecloj...@gmail.com wrote: expects its argument to be a byte array: http://docs.oracle.com/javase/6/docs/api/java/security/MessageDigest which can be obtained from a string using String#getBytes. I appreciate your

Re: [GSoC 2013] CinC

2013-03-04 Thread Aaron Cohen
On Mon, Mar 4, 2013 at 11:26 AM, abp abp...@gmail.com wrote: Is this work related? http://clojurewest.org/sessions#martin https://github.com/kanaka/clojurescript Nope, completely unrelated, though similar work. --Aaron -- -- You received this message because you are subscribed to the

Re: Interesting Light Table post

2013-03-04 Thread larry google groups
It will be interesting to see what one can do with the plugin mechanism, maybe is up to the clojure community to create the better experience, at this point I'm just very happy to have something like this, great job guys! I have learned Clojure over the last 8 months, and I can speak to

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
 nonce (DigestUtils/md5Hex (random-string 32))  nonce-encoded-base64 (Base64/encodeBase64 (.getBytes nonce)) Is this used somewhere? Yes, at the end, everything gets pulled together in a big string, which is added as a header to the POST request: header (apply str UsernameToken Username=\

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
(str binary-array) returns the toString of the array, which is something like [B@5d5d0293. That has nothing to do with the contents of the array. I think you want the base64 encoded string here. Hmm, interesting. I had assumed that I wanted a string run through SHA1, so I created the string,

Re: Interesting Light Table post

2013-03-04 Thread BJG145
On Monday, March 4, 2013 6:05:01 PM UTC, larry google groups wrote: What was difficult for me was everything that had to do with Java. I have had almost no experience with Java, and Clojure depends heavily on Java. So learning Java, and the JVM, tripped me up repeatedly. Amen to that. My

Re: how to get SHA1 of a string?

2013-03-04 Thread Frank Siebenlist
Not sure if it's helpful in this context, but I've been playing with a more functional message-digest/secure-hashing interface recently. Please take a look at: https://github.com/franks42/clj.security.message-digest It's still a little raw, and probably more educational than practical right

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
Frank, I thank you for your suggestion, though at the moment I am trying to reduce the number of places where I could have made a mistake, switching to a new interface would increase the number of places that I might make a mistake. I would be interested in experimenting with the new interface as

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
So, right now I am using this code: (let [username (get-in @um/interactions [:omniture-api- credentials :username]) secret (get-in @um/interactions [:omniture-api-credentials :shared- secret]) nonce (DigestUtils/md5Hex (str (math/round (* (rand 1 ) 100 nonce-encoded-base64

Re: Faster lein

2013-03-04 Thread Phil Hagelberg
Buck Golemon writes: I take this to mean that there's no widely accepted solution. The widely-accepted solution is to leave a single process running. It certainly has limitations, but it's the way most people deal with the problem. Really, I just want `lein run` to be faster. Can someone

Re: how to get SHA1 of a string?

2013-03-04 Thread Craig Brozefsky
larry google groups lawrencecloj...@gmail.com writes: Hmm, interesting. I had assumed that I wanted a string run through SHA1, so I created the string, then called getBytes on it to feed it to SHA1: digest-as-string (apply str nonce created secret) digest (.digest

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
Hmm, I finally got a different error message (after days of trying). I re-read the documentation here: http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base64.html and realized I might need to use this method: encodeBase64String which returns a string. The method I had

Re: how to get SHA1 of a string?

2013-03-04 Thread Craig Brozefsky
Craig Brozefsky cr...@red-bean.com writes: .. Sorry, didn't reaze you wanted the output to be base64 encoded, in which case, add these funcs: (defn base64-encode [^bytes v] (javax.xml.bind.DatatypeConverter/printBase64Binary v)) (defn sha1-base64 [^String v] (- (.getBytes v)

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
Now the API servers at Omniture tell me: {\error\:\The nonce (ZTQxNWI4ZTU0YTQyMGEwZjRmZTY0ZTU0Nzc4MzgzZTQ=) has already been used\}} I may have misunderstood this. clj-http defaults to retrying the same request 4 times, if it gets a 4xx error, so the nonce gets re-used 4 times, which would

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
I am willing to use these functions, but do you have any idea why my code was wrong? I have the impression that I have somehow ended up with a binary where I should instead have a string. Using a different function won't help me if I use it the wrong way. On Mar 4, 1:43 pm, Craig Brozefsky

[ANN] modern-cljs updated to latest libs and plugins

2013-03-04 Thread Giacomo Cosenza
Hello all, I just published the update of modern-cljs series of tutorials which incorporates the latest available libs and plug-ins (e.g. lein-cljsbuild 0.3.0, lein-ring 0.8.3, domina 1.0.2-SNAPSHOT, shoreleave 0.3.0, etc, Hope it helps Mimmo https://github.com/magomimmo/modern-cljs -- --

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
Right now I am using this block of code: (let [username (get-in @um/interactions [:omniture-api- credentials :username]) secret (get-in @um/interactions [:omniture-api-credentials :shared- secret]) random-number (math/round (* (rand 1 ) 100)) nonce (DigestUtils/md5Hex (str

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
About this: (defn sha1-base64 [^String v]       (- (.getBytes v)           (sha1)           (base64-encode))) I tried to use it and I got unknown symbol for sha1, which makes sense. What class are you using for sha1? On Mar 4, 1:43 pm, Craig Brozefsky cr...@red-bean.com wrote: Craig

Re: how to get SHA1 of a string?

2013-03-04 Thread Aaron Cohen
I think you should try to avoid the string concatenation games. I'm not sure what your current code is, but I suspect you're still ending up with array toString's slipping in. How about the following? On Mon, Mar 4, 2013 at 1:31 PM, larry google groups lawrencecloj...@gmail.com wrote: So,

Re: byte-array woes

2013-03-04 Thread Frank Siebenlist
I gave it my vote - thanks for trying to fix this issue - FrankS. FrankS (from mobile) On Mar 4, 2013, at 6:30 AM, Karsten Schmidt i...@toxi.co.uk wrote: Hi Frank, I've added a patch to CLJ-766 with a potential fix. Also, Andy F. kindly pointed out that interested parties should vote on that

Re: how to get SHA1 of a string?

2013-03-04 Thread Aaron Cohen
On Mon, Mar 4, 2013 at 1:54 PM, larry google groups lawrencecloj...@gmail.com wrote: PasswordDigest=r+HWjSAk8AUvo/QmKKfbqQFnJ18= Nonce=NmQxNGUwZjVlMjFhYjE1MzQ4MjUxYTA1MTg1YzE3ZTg= The developer at Omniture reminded me of the characters allowed into Base64: You can tell a given string

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
;; Should UsernameToken Username really be unquoted in the following line? ;; All the other variable names are quoted Apparently, yes. The developer at Omniture reviewed it and said my only problem was the way the passwordDigest was created. On Mar 4, 2:02 pm, Aaron Cohen

Re: how to get SHA1 of a string?

2013-03-04 Thread Frank Siebenlist
digest (- (java.security.MessageDigest/getInstance sha1) .reset (.update nonce-bytes) (.update create-bytes) (.update secret-bytes) .digest) There may be an issue with this snippet of code

Re: Clojure 1.5 print-table, org-mode babel, and org-mode HTML gen

2013-03-04 Thread Gary Johnson
+1 for org-babel. I put together an example project solving the Potter Kata on github several months ago, so if someone is looking for some examples of how you might do LP with org-babel, take a look at it here: https://github.com/lambdatronic/org-babel-example Happy hacking, ~Gary On

Re: how to get SHA1 of a string?

2013-03-04 Thread Aaron Cohen
Ah darn, thanks for the catch. The following is uglier but should work I guess. :\ digest (.digest (doto (java.security.MessageDigest/getInstance sha1) .reset (.update nonce-bytes) (.update created-bytes)

Re: how to get SHA1 of a string?

2013-03-04 Thread Frank Siebenlist
That should work. No need for .reset though as the initially constructed MessageDigest is already in its initial state. Be careful with .digest as it implicitly resets the MessageDigest, and calling it a second time gives you the digest of the initial state which is not what you want. (all

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
I have a feeling you may be correct, so I copy and pasted your code into mine: (let [username (get-in @um/interactions [:omniture-api- credentials :username]) secret (get-in @um/interactions [:omniture-api- credentials :shared-secret])

Re: how to get SHA1 of a string?

2013-03-04 Thread Aaron Cohen
I'm not familiar with the class, but it seems that MessageDigest/getInstance might retrieve some shared instance that could theoretically need to be reset, no? On Mon, Mar 4, 2013 at 2:43 PM, Frank Siebenlist frank.siebenl...@gmail.com wrote: That should work. No need for .reset though as

Re: why do I get Null pointer on this GMT SimpleDateFormat?

2013-03-04 Thread Ray Miller
You've assigned to date-formatter-set-to-gmt-time the return value from the setTimeZone method call. This method returns null, hence the null pointer exception when you try to call the format method. 'doto' might help here, like: (let [gmt-date-formatter (doto (SimpleDateFormat. -MMM-dd

Re: how to get SHA1 of a string?

2013-03-04 Thread Frank Siebenlist
You should get a new, separate instance for every digest you would like to generate concurrently. Nothing, i.e. no mutable state, is shared between different MessageDigest instances in the subsequent digesting/secure-hashing. The .reset is only used if you want to give up you current effort

Clojurescript bug

2013-03-04 Thread Tom Hall
Hello, I have just been stuck for ages trying to figure out what was going on in my first clojurescript application and think I have found a bug. I took some working game playing code for a simple tictactoe example and found that I got incorrectly names JS outputted I have created a project

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
To be clear about an earlier point, if I do this: digest-as-string (apply str nonce created secret) and then print this to the terminal, I can see it really is just a string made of these 3 items. Just a plain string, exactly what I assumed. On Mar 4, 2:25 pm, Frank

Re: why do I get Null pointer on this GMT SimpleDateFormat?

2013-03-04 Thread larry google groups
Thank you. That is very helpful. On Mar 4, 3:17 pm, Ray Miller r...@1729.org.uk wrote: You've assigned to date-formatter-set-to-gmt-time the return value from the setTimeZone method call. This method returns null, hence the null pointer exception when you try to call the format method. 'doto'

Re: how to get SHA1 of a string?

2013-03-04 Thread Aaron Cohen
Frank pointed out this mistake in my code a little farther in the thread. Sorry for the confusion. digest (.digest (doto (java.security.MessageDigest/getInstance sha1) .reset (.update nonce-as-bytes) (.update

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
I keep trying different things, but I feel like I'm missing some obvious mistake. Right now my code includes this function: (defn sha1 [string] ;; 2013-03-04 - this function comes from here: ;;

Re: how to get SHA1 of a string?

2013-03-04 Thread Frank Siebenlist
Hi Larry, One approach that helps a lot when trying to figure out where the issue is with all that message digesting, is by using well-known test cases. If you look at: http://en.wikipedia.org/wiki/SHA-1 you will find the test cases: SHA1(The quick brown fox jumps over the lazy dog) =

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
Thank you for the suggestions. If I do this: (let [username (get-in @um/interactions [:omniture-api- credentials :username]) secret (get-in @um/interactions [:omniture-api- credentials :shared-secret]) random-number (math/round (* (rand 1 ) 100))

Re: how to get SHA1 of a string?

2013-03-04 Thread Frank Siebenlist
.digest returns a byte array - so your PasswordDigest value is unprintable and is not fit for any header/URL. Not sure what this base64-encode function does exactly, but normally base64 encoding takes a bunch of bytes already, so the (commented-out) digest-base64 (base64-encode (.getBytes

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
Be careful with .digest as it implicitly resets the MessageDigest, and calling it a second time gives you the digest of the initial state which is not what you want. I am somewhat ignorant of how mutable Java variables behave inside of Clojure. Can I assume that the instance of MessageDigest

Re: Clojure 1.5 print-table, org-mode babel, and org-mode HTML gen

2013-03-04 Thread Mark C
Very cool. Great looking doc! I just installed LaTeX and TeXworks so it's off to play. (Other than incanter I already have the rest working, including nrepl - though I have to start up nrepl with nrepl-jack-in. Is that what you were planning on doing? It would be cool to have it launched by

Re: how to get SHA1 of a string?

2013-03-04 Thread Frank Siebenlist
Yup, in your case, with: digest (.digest (doto (java.security.MessageDigest/getInstance sha1) .reset (.update nonce-bytes) (.update created-bytes) (.update secret-bytes))) you do not have to

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
I finally got this to work. Many thanks for all of the help that I was given here. The final, winning combination was: (let [username (get-in @um/interactions [:omniture-api- credentials :username]) secret (get-in @um/interactions [:omniture-api-credentials :shared- secret])

Re: Java interop: Can't call public method of non-public class

2013-03-04 Thread Vladimir Tsichevski
I think not. But upgrading to clojure 1.5 will do. On Friday, March 1, 2013 1:20:57 PM UTC+4, Marko Topolnik wrote: I'd say it's a bug. You are invoking a public class's method, which happens to be inherited from a package-private class. Clojure's reflective code accesses the superclass

Re: Clojure 1.5 print-table, org-mode babel, and org-mode HTML gen

2013-03-04 Thread Mark C
This is a very helpful example. Along similar lines, I was thinking it would be cool to have a document of 4clojure problems/solutions/tests. I haven't used tangle/weave yet, which would be pretty useful for that. I think it would be a great learning resource to create an org-based book of

Re: how to get SHA1 of a string?

2013-03-04 Thread Frank Siebenlist
Glad Larry has working code now... As I mentioned before in this thread, I'm working on this functional interface for the message-digesting/secure-hashing, and this whole discussion reads like a use case for the why? ;-) It proofs to me that there may be real value in a more user-friendly

Re: how to get SHA1 of a string?

2013-03-04 Thread Vladimir Tsichevski
On Monday, March 4, 2013 10:54:13 PM UTC+4, larry google groups wrote: Right now I am using this block of code: (let [username (get-in @um/interactions [:omniture-api- credentials :username]) secret (get-in @um/interactions [:omniture-api-credentials :shared- secret])

Re: Faster lein

2013-03-04 Thread Buck Golemon
On Mon, Mar 4, 2013 at 10:30 AM, Phil Hagelberg p...@hagelb.org wrote: Buck Golemon writes: I take this to mean that there's no widely accepted solution. The widely-accepted solution is to leave a single process running. It certainly has limitations, but it's the way most people deal with

Re: printing and reading functions

2013-03-04 Thread Phil Hagelberg
Dave Sann writes: Is there an Jira issue for this? Is it worth raising one? I don't follow Clojure development much these days, but I do recall Rich's Conj keynote a couple years ago mentioning an interest in dynamicity knobs that let you tune space/perf vs feature trade-offs. But that

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
If you split up your nonce created secret as partial strings of The quick brown fox jumps over the lazy dog, then you know what hex'ified digest to expect, and helps you to track-down/eliminate errors. That is a good tip and I'll use it in the future. On Mar 4, 3:58 pm, Frank Siebenlist

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
Note that base64 encoded stuff is not url/html safe and has to be encoded also before sending it over the http-wire. Hmm, interesting. This is going as the headers in a POST. It did seem to work the last time I ran it, just now, a few minutes ago. I am using the clj-http library and my actual

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
my library lets you write:   (let […         digest (md/digest :sha-1 :utf-8 nonce created secret)          …] Great. Now that I have the code working I'll switch over to your library. I felt the need to get a mental picture of what the underlying Java code was doing, but now that I have

Re: how to get SHA1 of a string?

2013-03-04 Thread larry google groups
Frank, Any idea when you might release your code in a stable form? I am using this code at work so I am nervous about using code that is still marked SNAPSHOT. Lein reminds me not to use a SNAPSHOT: Could not find metadata org.clojars.franks42:clj.security.message-

Re: how to get SHA1 of a string?

2013-03-04 Thread Frank Siebenlist
If your code is for production… do not use my code! It's pretty much written over the weekend and it's security code, meaning that it deserves much more scrutiny than ordinary code. As mentioned in the readme, it's more an educational exercise, although it was good to see you struggling as it

how do I find an IO exception triggering retries in clj-http?

2013-03-04 Thread larry google groups
So, thanks to Michael Klishin, Aaron Cohen, Frank Siebenlist and Craig Brozefsky I am now able to correctly ping the Omniture API. But I am getting a strange behavior from the clj-http library. It makes 4 calls to the API server, even though the first call is successful. When I look here:

Re: Listing more intuitive install options on the Clojure Downloads page

2013-03-04 Thread Sean Corfield
On Fri, Mar 1, 2013 at 9:58 AM, MC Andre andrew.penneba...@gmail.com wrote: I'm sure that Clojure users, especially novices, would appreciate these being listed as well-supported options on the official downloads page: * Windows chocolatey install clojure * Mac OS X brew install clojure *

Re: Inserting multiple rows with clj-jdbc

2013-03-04 Thread Sean Corfield
insert-records will use a single with-connection call and a single transaction to wrap the inserts of all those records (maps). On Fri, Mar 1, 2013 at 3:57 PM, Jonathon McKitrick jmckitr...@gmail.com wrote: Does insert-records with a collection of records have any performance advantage over

Re: how to get SHA1 of a string?

2013-03-04 Thread Frank Siebenlist
Larry, What I can advise though, is to look at my library code and it may give you different perspectives. Furthermore, copy, borrow, and steal what you like and make it your own. -FS. On Mar 4, 2013, at 3:17 PM, Frank Siebenlist frank.siebenl...@gmail.com wrote: If your code is for

Re: Clojurescript bug

2013-03-04 Thread Michał Marczyk
This particular problem goes away if you use ClojureScript release 1586 *and* rename the directory src/cljs/aima-clojure to src/cljs/aima_clojure and the file tictactoe-frontend.cljs to tictactoe_frontend.cljs Maybe we should warn on encountering filenames with dashes, or else

Re: Clojurescript bug

2013-03-04 Thread Michał Marczyk
PS. Incidentally, cljs-1450 has a bug which causes it to emit the unmunged property name regardless of the filenames used. The relevant ticket is CLJS-336, fixed in 9824dbd7c8ac658ebc2d5bc9fa6b5b898f17f659 (releases = 1503). On 5 March 2013 01:06, Michał Marczyk michal.marc...@gmail.com wrote:

Re: core.logic: Dividing the knowledge base

2013-03-04 Thread JvJ
Thanks so much! I'll check it out tomorrow! On Monday, 4 March 2013 10:51:48 UTC-5, Norman Richards wrote: On Wed, Feb 27, 2013 at 4:03 PM, JvJ kfjwh...@gmail.com javascript:wrote: It states that retractions aren't yet implemented. Is there any way to delete facts? Retractions are

  1   2   >