04:10:01 | * | XAMPP quit (Ping timeout: 246 seconds) |
06:09:42 | * | XAMPP joined #nimrod |
06:09:42 | * | XAMPP quit (Changing host) |
06:09:42 | * | XAMPP joined #nimrod |
06:41:11 | * | Boscop quit (Disconnected by services) |
06:41:13 | * | Boscop joined #nimrod |
07:07:44 | * | Boscop is now known as Boscop_ |
07:35:47 | * | zahary joined #nimrod |
07:40:05 | * | Araq_ joined #nimrod |
07:41:25 | * | Boscop joined #nimrod |
07:47:30 | * | Araq_ quit (Quit: ChatZilla 0.9.88.2 [Firefox 14.0.1/20120713134347]) |
07:55:56 | * | zahary quit (Quit: Leaving.) |
08:12:24 | * | zahary joined #nimrod |
08:41:20 | * | zahary1 joined #nimrod |
08:41:58 | * | zahary quit (Ping timeout: 240 seconds) |
09:20:45 | * | zahary1 quit (Quit: Leaving.) |
09:50:40 | * | Araq_ joined #nimrod |
09:50:58 | * | Araq_ quit (Client Quit) |
10:46:24 | * | Araq_ joined #nimrod |
10:46:55 | * | Araq_ quit (Client Quit) |
10:58:04 | * | Boscop_ quit (Ping timeout: 244 seconds) |
11:10:43 | * | Trix[a]r_za is now known as Trixar_za |
11:23:33 | * | zahary joined #nimrod |
11:51:06 | * | Boscop quit (Disconnected by services) |
11:51:07 | * | Boscop joined #nimrod |
12:31:07 | * | Araq_ joined #nimrod |
12:42:06 | * | XAMPP quit (Ping timeout: 264 seconds) |
12:53:03 | * | Boscop quit (Disconnected by services) |
12:53:05 | * | Boscop joined #nimrod |
12:54:08 | * | Boscop quit (Disconnected by services) |
12:54:12 | * | Boscop joined #nimrod |
13:00:40 | * | Araq_ quit (Quit: ChatZilla 0.9.88.2 [Firefox 14.0.1/20120713134347]) |
13:07:55 | * | Boscop quit (Ping timeout: 246 seconds) |
13:11:49 | * | XAMPP joined #nimrod |
13:14:31 | * | q66 joined #nimrod |
13:38:16 | * | Trixar_za is now known as Trix[a]r_za |
13:54:24 | * | Boscop joined #nimrod |
14:31:56 | * | Boscop quit (Disconnected by services) |
14:31:58 | * | Boscop joined #nimrod |
15:32:20 | * | Boscop quit (Disconnected by services) |
15:32:29 | * | Boscop joined #nimrod |
16:52:32 | * | shevy quit (Ping timeout: 244 seconds) |
17:05:32 | * | shevy joined #nimrod |
17:27:13 | Araq | ping q66 |
17:27:53 | q66 | pong Araq |
17:28:11 | Araq | can you help this guy: http://forum.nimrod-code.org/t/69 ? |
17:28:44 | q66 | Araq, i'll try when i'll have time to get to my vm |
17:28:45 | dom96 | whoa, I just noticed I missed like 4 forum threads. |
17:29:26 | Araq | because nimbot doesn't notify you :P |
17:29:51 | reactormonk | there's a forum? ... >:) |
17:29:54 | reactormonk | does it have rss? |
17:31:01 | dom96 | not yet :P |
17:31:45 | Araq | reactormonk: yep and it's written in Nimrod ;-) |
17:32:17 | reactormonk | Araq: thought so |
17:32:57 | reactormonk | I suppose nimrod has an XML builder? |
17:33:12 | Araq | sey |
17:33:17 | Araq | *yes |
17:33:22 | Araq | (strange typo ...) |
17:33:28 | Araq | q66: thanks |
17:37:37 | * | Boscop quit (Disconnected by services) |
17:37:39 | * | Boscop joined #nimrod |
17:43:17 | * | Boscop quit (Ping timeout: 248 seconds) |
17:49:44 | * | Boscop joined #nimrod |
17:56:27 | shevy | it's a good typo |
17:56:32 | shevy | 'y' is close to 's' |
17:56:40 | shevy | I once typoed "YOU SHOULD ALL DIE!!!" |
17:56:44 | shevy | that was harder to explain... |
17:56:54 | shevy | ... but my cat is creative |
18:10:54 | reactormonk | Araq: how the heck do you test a random number generator... |
18:11:51 | reactormonk | Araq: btw, what about .importnative. instead of .importc. ? |
18:13:01 | Araq | why importnative? you mean because it's been reused for the JS backend? :-) |
18:13:15 | Araq | there is also importcpp btw |
18:13:28 | reactormonk | indeed ^^ |
18:13:32 | reactormonk | what's the difference? |
18:14:48 | reactormonk | btw, is there a converter from TSlice to int,int ? |
18:14:51 | reactormonk | is that even possible |
18:15:25 | Araq | I think I disallowed generic converters for now :P |
18:15:37 | reactormonk | why so? |
18:15:56 | Araq | never tested if they would work ;-) |
18:16:14 | Araq | generic methods are also missing for now |
18:16:39 | Araq | but hey, templates and macros can now be generic, so there's hope ... ;-) |
18:19:27 | reactormonk | does return type overloading work? |
18:19:34 | Araq | nope |
18:20:09 | Araq | var x: int = parse(...) # oh why? |
18:20:25 | Araq | var x = parse(int, ...) # can easily be made to work :P |
18:22:13 | Araq | there is also marshal.to[int]("123") |
18:59:19 | reactormonk | except var int ? |
19:05:26 | reactormonk | Araq: http://sprunge.us/EeCV |
19:05:43 | reactormonk | but how do I test that? |
19:06:11 | reactormonk | oh, a " missing |
19:06:17 | Araq | yeah ... |
19:06:34 | Araq | well *compiling* it as a first test would be nice :P |
19:08:06 | reactormonk | :D |
19:12:15 | Araq | and there are ways to test random number generators |
19:12:42 | Araq | for a start you could call it 100x and check you got 50 different results or something |
19:13:07 | reactormonk | there's drand48 which returns a double - what's a float in nimrod again? |
19:13:30 | Araq | a double |
19:14:02 | Araq | well actually it's platform defined |
19:14:25 | Araq | use float32 or float64 |
19:14:46 | Araq | though I don't think there is a platform where I map 'float' to 'float32' ... |
19:15:12 | Araq | but I heard GPUs love float32 ... |
19:20:00 | reactormonk | looks like I need two calls to rand() if I want a 64bit float |
19:20:05 | reactormonk | or a double, taht is |
19:21:39 | reactormonk | can I mash two cints into a nimrod float? |
19:22:38 | Araq | yeah with 'cast' magic |
19:22:44 | Araq | somehow |
19:23:40 | reactormonk | uh-oh |
19:26:04 | * | Boscop quit (Disconnected by services) |
19:26:06 | * | Boscop joined #nimrod |
19:26:23 | reactormonk | means you don't know how? |
19:27:52 | Araq | means I'm too lazy to think for you |
19:28:22 | Araq | var x: array[0..1, cint] |
19:28:24 | reactormonk | casting is easy, joining isn't - my solution would be to cast the int to a string |
19:28:29 | reactormonk | oh, right |
19:28:34 | Araq | x[0] = random() |
19:28:38 | Araq | x[1] = random() |
19:28:57 | Araq | result = cast[ptr float64](addr(x))[] |
19:30:54 | reactormonk | and how do I distinct between a random that returns a 32 and a 64 float? |
19:32:48 | reactormonk | and welcome to NaN... :-/ |
19:35:45 | Araq | oh yeah, lol |
19:35:50 | Araq | forgot about Nan |
19:36:52 | reactormonk | proc randomfloat(): float32 = |
19:36:55 | reactormonk | result = cast[float32](rand())/cast[float32]RAND_MAX |
19:38:05 | Araq | reactormonk: don't just hack around, ask the internet about random float |
19:38:15 | reactormonk | http://stackoverflow.com/questions/686353/c-random-float |
19:42:27 | * | Boscop quit (Disconnected by services) |
19:42:29 | * | Boscop joined #nimrod |
19:42:50 | reactormonk | a) implement using rand() and some mashup b) grab a lib |
19:43:18 | reactormonk | Araq: I suppose you favor a) |
19:43:57 | * | Boscop quit (Disconnected by services) |
19:43:59 | * | Boscop joined #nimrod |
19:44:18 | Araq | true |
19:46:40 | * | Boscop quit (Disconnected by services) |
19:46:41 | * | Boscop joined #nimrod |
19:47:53 | reactormonk | proc random(max: float): float32 = |
19:47:56 | reactormonk | result = cast[float32]random(max) |
19:48:00 | reactormonk | might have the same problem with NaN |
19:48:10 | Araq | don't 'cast' |
19:48:15 | Araq | use toFloat() |
19:48:28 | reactormonk | oh, ups |
19:48:38 | reactormonk | and the code sucks anyway, but I assume you get that part... |
19:50:33 | * | Boscop quit (Disconnected by services) |
19:50:36 | * | Boscop joined #nimrod |
19:50:55 | * | Boscop quit (Client Quit) |
19:51:15 | * | Boscop joined #nimrod |
19:51:20 | * | Boscop quit (Remote host closed the connection) |
19:52:32 | * | Boscop joined #nimrod |
20:25:29 | * | XAMPP quit (Ping timeout: 246 seconds) |
20:51:48 | fowl | trying to move some of my code out of the main file |
20:51:51 | fowl | failing -__ |
20:51:52 | fowl | - |
20:52:10 | fowl | i think i'll just use include instead of import |
20:52:28 | reactormonk | fowl: nope, fail. |
20:57:26 | reactormonk | let's see, http://stackoverflow.com/questions/12289646/how-do-i-create-a-random-double-with-rand |
20:59:03 | Araq | fowl: in languages that punish recursive deps like nimrod (and delphi, haskell, ...) it often leads to moving the types into its own module |
21:04:31 | reactormonk | Macro: int RAND_MAX |
21:04:33 | reactormonk | The value of this macro is an integer constant representing the largest value the rand function can return. In the GNU library, it is 2147483647, which is the largest signed integer representable in 32 bits. In other libraries, it may be as low as 32767. |
21:04:40 | reactormonk | what to do about that? |
21:04:53 | fowl | reactormonk: high(int32) |
21:09:06 | reactormonk | fowl: doesn't need to correspond to that |
21:11:29 | fowl | o |
21:12:05 | reactormonk | Araq: http://stackoverflow.com/questions/12289646/how-do-i-create-a-random-double-with-rand/12289830 enough consulting? ;-) |
21:16:32 | fowl | im only able to move certain functions and the type defs out of the main file |
21:16:58 | fowl | because i have too many globals and constants :( |
21:20:29 | * | XAMPP joined #nimrod |
21:25:51 | reactormonk | Araq: hmm, erand48 requires the caller to provide an array of three unsigned shorts - how should I handle them? |
21:30:50 | Araq | dunno ... I'm too tired to think |
21:39:27 | reactormonk | a) per thread. do we have thread-local storage? |
21:39:52 | reactormonk | b) globally. it's just about 6 bytes |
21:40:01 | reactormonk | c) globally, but lazy |
21:40:29 | reactormonk | b and c might lead to less-random sequences and the good old global variable shit |
21:44:39 | Araq | var x {.threadvar.}: array[0..2, uint16] |
21:44:48 | reactormonk | nice |
21:46:31 | reactormonk | nice |
21:46:35 | reactormonk | err |
21:51:14 | reactormonk | or not. http://sprunge.us/PjIj |
21:53:05 | reactormonk | how do I use this threadvar? |
21:54:49 | reactormonk | http://sprunge.us/NdUV now that's better |
22:24:42 | Araq | good night |
22:38:41 | * | Boscop quit (Ping timeout: 246 seconds) |
23:08:31 | * | q66 quit (Quit: Quit) |