Re: [ANN] Flake 0.4.0: Decentralized, k-ordered unique ID generator

2016-06-21 Thread Max Countryman
I also released Flake 0.4.2 today which includes an important bugfix where two competing threads could have caused duplicate IDs in certain circumstances as well as a new method for deriving timestamps. > On Jun 21, 2016, at 16:29, Max Countryman wrote: > > Brian, > > I think you make good p

Re: [ANN] Flake 0.4.0: Decentralized, k-ordered unique ID generator

2016-06-21 Thread Max Countryman
Brian, I think you make good points here, especially with regard to the size of IDs. I’d also like to point out that while adding the process and thread IDs helps, it doesn’t eliminate the possibility of duplicate IDs: this is why it’s necessary to write out the last used timestamp in a separat

New issue of Clojure Gazette is out

2016-06-21 Thread Alan Thompson
If you haven't seen the Clojure Gazette, please give it a try! http://us4.campaign-archive2.com/?u=a33b5228d1b5bf2e0c68a83f4&id=70c69d167d&e=c39662b4e4 Alan -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure

Re: clojure.string unexpected behaviors

2016-06-21 Thread Sean Corfield
On 6/21/16, 1:28 PM, "Alex Miller" wrote: > I'm not a fan of the word "garbage" in this case or "garbage in / garbage > out". For me there’s no judgment involved in the “GIGO” principle but fair enough. > "specified"/"unspecified" is much better. It’s inaccurate. Unspecified behavior is where

Re: clojure.string unexpected behaviors

2016-06-21 Thread Alex Miller
On Tuesday, June 21, 2016 at 2:45:45 PM UTC-5, Sean Corfield wrote: > > Alex gave you a correct (but fairly short) answer. I’d like to expand on > it a bit, partly in light of a certain recent blog post, partly because of > a personal “hot button”… > > This is going to be along the same lines as

Re: clojure.string unexpected behaviors

2016-06-21 Thread Sean Corfield
Alex gave you a correct (but fairly short) answer. I’d like to expand on it a bit, partly in light of a certain recent blog post, partly because of a personal “hot button”… This is going to be along the same lines as clojure.set functions producing “garbage” output if you give them “garbage” in

Re: clojure.string unexpected behaviors

2016-06-21 Thread Alex Miller
There are some comments at the top of clojure.string (http://clojure.github.io/clojure/#clojure.string) about expected usage. In particular, you should expect all clojure.string functions to accept CharSequence (a parent interface of String, StringBuffer, and StringBuilder and return the same (

clojure.string unexpected behaviors

2016-06-21 Thread Elena Machkasova
Greetings, I was looking at clojure.string functions, and noticed that some have unexpected (especially for less experienced programmers) behavior on non-string arguments. For instance, 'capitalize' applies toString to its argument, effectively making it possible to pass any type, but with une

Re: tips on writing modern idiomatic code

2016-06-21 Thread Sean Corfield
On 6/21/16, 5:46 AM, "Sergey Didenko" wrote: > What would you advise for writing-rewriting your Clojure code in MODERN > idiomatic way? It’s a good question and I get the impression that a) it’s constantly evolving as we all gain more experience building large systems with Clojure(Script) and

Re: [ANN] Flake 0.4.0: Decentralized, k-ordered unique ID generator

2016-06-21 Thread Brian Platz
Bruno, I think the more you can reduce the chance of collision the better and the thread-local capability is a good idea, but in the process you've almost doubled the bits. For me anyhow, an ID need to be produceable at a reasonable rate (1 million a second per machine is good for me), have ne

Re: tips on writing modern idiomatic code

2016-06-21 Thread Leon Grapenthin
https://github.com/bbatsov/clojure-style-guide is a good place to start. On Tuesday, June 21, 2016 at 2:46:22 PM UTC+2, Sergey Didenko wrote: > > Hi, > > What would you advise for writing-rewriting your Clojure code in MODERN > idiomatic way? > > Using Kibit? > > Pasting your code samples on som

tips on writing modern idiomatic code

2016-06-21 Thread Sergey Didenko
Hi, What would you advise for writing-rewriting your Clojure code in MODERN idiomatic way? Using Kibit? Pasting your code samples on some review site? Asking help in IRC channel? Asking here? Reading some noticeable open source projects? Reading some new Clojure book? I ask about the latest

Re: [ANN] Flake 0.4.0: Decentralized, k-ordered unique ID generator

2016-06-21 Thread Bruno Bonacci
Sorry, it looks like images are only visible in the google groups https://groups.google.com/forum/#!topic/clojure/fRYCowf6VUg Bruno On Tue, Jun 21, 2016 at 1:38 PM, Bruno Bonacci wrote: > >

Re: [ANN] Flake 0.4.0: Decentralized, k-ordered unique ID generator

2016-06-21 Thread Bruno Bonacci
> > Another thing I've noticed is that you are using (System/currentTimeMillis > ) to get the wall clock on every generation. > > (S