On Sat, Jun 26, 2010 at 05:58, Andrzej ndrwr...@googlemail.com wrote:
On Sat, Jun 26, 2010 at 4:04 AM, Rich Hickey richhic...@gmail.com wrote:
equiv, the revenge of num
Has it already been decided that some sort of this new numeric tower
will find its way into Clojure?
Personally, I think
On Jun 26, 2010, at 12:37 AM, rob levy wrote:
Rich Hickey's insightful videos have caused me to stop
writing loops whenever possible. For me this is the same
level of thinking-change that happened when I moved to
using Structured Programming rather than GOTO (in Fortran).
Rich needs to write
Hi,
On 25 Jun., 21:04, Rich Hickey richhic...@gmail.com wrote:
equiv, the revenge of num
[...]
Feedback welcome,
sorry, no feedback, but one question which is rather important to me:
will this make it into Clojure 1.2?
Kind regards,
Stefan
--
You received this message because you are
I think I pointed it out, and I reiterate it will probably not improve
performance a lot (Except if you use always the 5 same numbers).
On Sat, Jun 26, 2010 at 7:59 AM, B Smith-Mannschott
bsmith.o...@gmail.comwrote:
This was suggested on the previous thread on this topic as well, but
I don't
Please not that ClojureX is now discontinued. There are enough viable
alternatives like David's clj [1] by now, so I don't see the need for
this project anymore. If you do however, feel free to fork away :-)
Michael
[1] http://github.com/liebke/clj
--
You received this message because you are
On 26 June 2010 03:36, MarkSwanson mark.swanson...@gmail.com wrote:
I still like timestamps even with per-user logging.
Sorry, I guess wasn't entirely clear.
The maps would still contain timestamps. My point is that we should
get away from the idea thinking of logs as unstructured text strings.
Dear all,
for a project, I need a data structure to represent finite distribution,
that is a set of elements, each of which having a mass in the set, and two
functions:
- total-mass : the sum of the masses of each element
- draw : return an element with a probability proportional to its mass
I
[Format recovered from top posting.]
Nicolas Oury nicolas.o...@gmail.com wrote:
On Sat, Jun 26, 2010 at 7:59 AM, B Smith-Mannschott
bsmith.o...@gmail.comwrote:
This was suggested on the previous thread on this topic as well, but
I don't think it was pointed out that *Java already does this*.
On Sat, Jun 26, 2010 at 3:59 PM, B Smith-Mannschott
bsmith.o...@gmail.com wrote:
This was suggested on the previous thread on this topic as well, but
I don't think it was pointed out that *Java already does this*.
See the inner class IntegerCache at line 608:
http://tech.puredanger.com/2007/02/01/valueof/
http://tech.puredanger.com/2007/02/01/valueof/Apparently, a program that
only access 1 integer (0) is only twice as fast when caching.
We are very far from the *10/20 that occurs.
On Sat, Jun 26, 2010 at 2:04 PM, Mike Meyer
And, by the way, after having looked into the compiler source, the current
Master already uses the valeOf function.
On Sat, Jun 26, 2010 at 2:31 PM, Nicolas Oury nicolas.o...@gmail.comwrote:
http://tech.puredanger.com/2007/02/01/valueof/
You can store the numbers in a vector [2 5 3]. Instead of doing this
store the cumulative weight v = [0 2 7 10]. What your problem comes
down to is given a number n, find the the lowest index i such that
v[i] = n. This can be accomplished with binary search. You can also
use a binary search tree
Thank you very much for your answer. I forgot to tell you that I also needs
to be able to have usual set operations.
They become linear with your 1st idea. (But, sorry, it's my bad! I should
have asked the right question. Your answer is very good for the question I
actually asked, not the one I
You can use Perl's map/grep pretty much anywhere, though they're not as
nice to use because the language is a mess (albeit more functional than
Python). I, too, have found myself using fewer and fewer explicit loops as
time goes on, starting with a revelation about the versatility of map while
Hi,
Re: caching boxed ints:
I think I pointed it out, and I reiterate it will probably not improve
performance a lot (Except if you use always the 5 same numbers).
Reiteration won't make it true.
At about 10m - 12m into this video, Cliff Click suggests that Java's
caching of Integer objects
Are there going to be a lot of deletions from the set? Or mostly insertions?
If it's mostly insertions (or if it's just a static data structure that
stays the same once built) then I think I can help.
On Sat, Jun 26, 2010 at 9:01 AM, Nicolas Oury nicolas.o...@gmail.comwrote:
Dear all,
for a
Insertion and deletions. But I would like to hear your idea anyway.
Always good to hear ideas :)
On Sat, Jun 26, 2010 at 7:58 PM, Garth Sheldon-Coulson g...@mit.edu wrote:
Are there going to be a lot of deletions from the set? Or mostly
insertions?
If it's mostly insertions (or if it's just
Well, my idea involves rejection sampling. In order to sample an element
from the set in a mass-weighted fashion, you can sample an element in a
uniform fashion and then reject the sample with a certain probability (more
below). If you do reject the sample, you keep drawing from the uniform
Sorry - the call at the end of my message should be: (some identity (apply
pcalls (repeat f))).
I also realized that the random seed contention issues that were discussed
on the list earlier might prevent very much gain from parallelizing the
accept-reject.
Garth
On Sat, Jun 26, 2010 at 5:04
By storing the set in a binary (or n-ary) tree and maintaining the
total weight in a node you can make every operation (draw, insert,
union, intersect) O(log n) and total-weight O(1). Draw like this
(where node(w,l,r) denotes a node with weight w, left subtree l and
right subtree r and leaf(w,v)
Is there a list somewhere of all the protocols built-in to Clojure
1.2's core that are available for extension?
--
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
21 matches
Mail list logo