<    April 2017    >
Su Mo Tu We Th Fr Sa  
                   1  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
30
01:25 jaagr joined
03:43 tvw joined
04:23 kristofferR joined
06:03 coffeescriptbot joined
06:03 <coffeescriptbot> [coffeescript] GeoffreyBooth pushed 1 new commit to 2: https://git.io/v9Z9E
06:03 <coffeescriptbot> coffeescript/2 3e70d31 Chris Connelly: Remove support for bound instance methods (#4530)...
06:03 coffeescriptbot left
08:30 BearishMushroom joined
09:26 trojanc joined
10:16 irclogger_com joined
10:16 Topic for
10:16 cschneid joined
11:49 vlad1777d joined
15:17 FunnyLookinHat joined
16:25 Gustavo6046 joined
16:58 sz0 joined
17:08 xmonader joined
17:09 <xmonader> hi i've this snippet in python ```hex(random.randint(0, 2 ** 64) | 1 << 63)```
17:09 <xmonader> I'm trying to convert it to coffeescript
17:09 <xmonader> i came up with this ``` randint: (min=0, max) ->
17:09 <xmonader> min + Math.floor(Math.random() * (max - min + 1))
17:09 <xmonader> genCapnpID: -> Number(@randint(0, 2**64) | (1<<63)).toString(16) #convert to hex.```
17:10 <xmonader> problem is those two aren't equivalent
17:44 <deltab> don't you mean randrange? randint could return 2 ** 64
17:45 <xmonader> deltab, well i think it's okay if 2**64 is included
17:45 <deltab> js bit operations are limited to 32 bit integers, so you'll need to do that in two parts
17:46 <xmonader> deltab, can you redirect me to the correct way?
17:47 <deltab> (@randrange(0, 2**32) | (1<<31)).toString(16) + (@randrange(0, 2**32)).toString(16)
17:48 <deltab> hmm, even that might not work
17:49 <deltab> yeah, 1<<31 is negative
17:50 <xmonader> :(
17:51 <deltab> randbyte = (setBits=0) -> (@randrange(0, 256) | setBits).toString(16)
17:52 <deltab> randbyte(64) + randbyte() + randbyte() + randbyte()
17:52 <deltab> gah, leading noughts
17:54 joshontheweb joined
17:58 <deltab> what's going on with ['x' for i in 1..4]?
19:48 PaulCapestany joined
20:44 Gustavo6046 joined
22:45 kristofferR joined
23:25 netj joined