00:05:29 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:07:56 | * | reem quit (Remote host closed the connection) |
00:08:29 | * | reem joined #nim |
00:27:00 | Aszarsha | well, you should make sure to have slices right when releasing 1.0. D had a major community problem regarding specifically slices. they didn't get it right in D 1.0 and had to change everything (which was very very annoying for everyone) for D 2.0. actually, it was one of the key motivations for making a non-backward compatible D 2 version... |
00:34:38 | * | tmku quit (Ping timeout: 256 seconds) |
00:43:32 | * | Varriount joined #nim |
00:46:49 | fowl | i wish there was a non inclusive range, 0 ... len(x) |
00:49:56 | EXetoC | why use len as an example? since there's high already |
00:51:33 | EXetoC | I assume you just don't want to subtract |
00:56:05 | fowl | high subtracts |
00:56:19 | fowl | this only really bothers me for NimNode |
00:57:16 | fowl | high(nimnode) used to bug out |
00:58:22 | * | reem quit (Remote host closed the connection) |
00:58:44 | EXetoC | when else would you like it? |
01:01:36 | * | reem joined #nim |
01:04:07 | * | reem quit (Remote host closed the connection) |
01:07:26 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
01:07:28 | * | rzzz quit (Ping timeout: 272 seconds) |
01:08:22 | * | reem joined #nim |
01:09:45 | * | reem quit (Remote host closed the connection) |
01:10:16 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
01:11:37 | * | reem joined #nim |
01:17:54 | * | gsingh93 joined #nim |
01:18:46 | * | reem quit (Remote host closed the connection) |
01:25:29 | NhanH | how do you alias array type? |
01:25:37 | NhanH | ie I got this: https://gist.github.com/anonymous/b15a7c7620fe095a40cc , and it doesn't fly with the compiler |
01:25:43 | * | reem joined #nim |
01:27:31 | * | reem quit (Remote host closed the connection) |
01:29:07 | fowl | NhanH, vector[range[0..20], float] |
01:29:52 | fowl | EXetoC, im not sure :x |
01:30:21 | NhanH | fowl: thanks. Another question: how do I initialize x or y? Using the array notation won't work (x = [1,2,3,4, 5]) |
01:30:50 | NhanH | is there any way to initialize it at once? Rather than doing x[i] = z |
01:31:54 | * | reem joined #nim |
01:33:12 | * | rzzz joined #nim |
01:35:05 | EXetoC | you're passing 21 elements? |
01:35:23 | NhanH | yes |
01:35:30 | NhanH | it's array of 21 elements, jsut lazy to type it out here :-) |
01:35:36 | fowl | NhanH, make the first one a float |
01:35:38 | * | Trustable quit (Quit: Leaving) |
01:35:49 | fowl | [1.0, 1,1] is array 0..2 float |
01:36:17 | NhanH | I did, I got `Error: type mismatch: got (Array constructor[0..9, float]) but expected 'vector[range 0..3(int), float]'` |
01:37:35 | * | rzzz quit (Ping timeout: 246 seconds) |
01:37:47 | fowl | it says your array has 10 members but the type has 4 members |
01:38:05 | NhanH | wait yeah |
01:38:08 | NhanH | something is messed up |
01:38:09 | NhanH | let me try again |
01:38:28 | NhanH | okay scratch that, I messed up a number on the file |
01:38:30 | NhanH | thanks! |
01:38:38 | fowl | .eval type v[r,t] = array[r,t]; var x: v[range[0..1],float] = [1.0,1] |
01:38:41 | Mimbus | fowl: <no output> |
01:38:50 | fowl | sure |
01:39:44 | EXetoC | 10 != 4 indeed ;) |
01:51:54 | * | darkf joined #nim |
01:55:19 | * | pregressive quit (Remote host closed the connection) |
01:55:55 | * | pregressive joined #nim |
01:57:35 | * | pregress_ joined #nim |
01:59:08 | * | fizzbooze quit (Ping timeout: 265 seconds) |
02:00:40 | * | pregressive quit (Ping timeout: 272 seconds) |
02:02:06 | * | fizzbooze joined #nim |
02:03:47 | * | ^aurora^ joined #nim |
02:26:34 | * | TEttinger joined #nim |
02:37:05 | * | brson quit (Ping timeout: 246 seconds) |
02:42:45 | * | chemist69 joined #nim |
02:45:47 | * | chemist69_ quit (Ping timeout: 252 seconds) |
02:46:45 | * | bjz joined #nim |
02:51:07 | * | fizzbooze quit (Ping timeout: 245 seconds) |
02:59:04 | * | a5i quit (Quit: Connection closed for inactivity) |
03:01:29 | * | saml_ quit (Quit: Leaving) |
03:09:40 | * | epichero quit () |
03:12:49 | * | ^aurora^ quit (Quit: Leaving.) |
03:14:11 | * | jsudlow joined #nim |
03:15:35 | * | jsudlow__ quit (Ping timeout: 246 seconds) |
03:17:13 | * | jholland quit (Quit: Connection closed for inactivity) |
03:56:54 | * | reem quit (Remote host closed the connection) |
04:03:11 | * | reem joined #nim |
04:04:37 | * | reem quit (Remote host closed the connection) |
04:37:16 | * | reem joined #nim |
04:51:05 | * | pregress_ quit (Remote host closed the connection) |
04:51:17 | * | pregressive joined #nim |
04:56:54 | * | reem quit (Remote host closed the connection) |
05:01:48 | * | reem joined #nim |
05:28:03 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
05:38:00 | * | rzzz joined #nim |
06:01:53 | * | bjz joined #nim |
06:10:51 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
06:14:47 | * | Asz quit (Ping timeout: 252 seconds) |
06:20:31 | * | pregressive quit (Remote host closed the connection) |
06:30:17 | * | gsingh93 quit (Ping timeout: 245 seconds) |
06:44:25 | * | bjz joined #nim |
07:00:16 | * | Demon_Fox quit (Quit: Leaving) |
07:01:47 | * | gsingh93 joined #nim |
07:22:45 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:25:37 | * | untitaker quit (Ping timeout: 264 seconds) |
07:31:28 | * | untitaker joined #nim |
07:46:37 | * | arnetheduck joined #nim |
08:02:14 | * | gmpreussner|work quit (Read error: Connection reset by peer) |
08:03:50 | * | xificurC joined #nim |
08:54:22 | * | MagusOTB quit (Ping timeout: 240 seconds) |
09:00:10 | * | smodo quit (Ping timeout: 244 seconds) |
09:13:42 | * | rzzz quit (Ping timeout: 256 seconds) |
09:47:48 | * | BlaXpirit joined #nim |
09:51:11 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
10:22:11 | * | reem quit (Remote host closed the connection) |
10:22:33 | * | Matthias247 joined #nim |
10:26:40 | * | ^aurora^ joined #nim |
10:54:46 | * | irrequietus joined #nim |
11:01:57 | * | xificurC quit (Ping timeout: 245 seconds) |
11:39:48 | * | davidhq joined #nim |
11:45:09 | * | akiradeveloper joined #nim |
11:46:00 | * | Trustable joined #nim |
11:46:41 | akiradeveloper | is there some general pooling library that demands alloc/dealloc/acquire/release methods? I need this for connection pooling |
11:48:23 | * | polde quit (Quit: q) |
11:53:17 | * | polde joined #nim |
12:21:20 | * | johnsoft quit (Ping timeout: 272 seconds) |
12:22:09 | * | johnsoft joined #nim |
12:36:56 | * | akiradeveloper quit (Remote host closed the connection) |
12:59:39 | federico3 | huh, asciidoc is really nice compared to ReST and markdown |
13:00:16 | qwr | how? (genuinely interested, as i've mostly used rest and sometimes thought about trying asciidoc) |
13:00:39 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:01:59 | federico3 | qwr: I found markdown limited (to the point of being a toy) and ReST less readable, sometimes counter-intuitive and hard to get right |
13:05:30 | federico3 | qwr: asciidoc is claimed to be more feature-rich and extensible, here's the basic grammar http://powerman.name/doc/asciidoc |
13:07:27 | qwr | ok, some of the examples look like they would be hard to reproduce with ReST |
13:07:42 | qwr | (and yes, markdown really don't compete) |
13:10:08 | * | jsudlow__ joined #nim |
13:13:02 | * | jsudlow quit (Ping timeout: 246 seconds) |
13:13:52 | * | akiradeveloper joined #nim |
13:22:55 | * | reem joined #nim |
13:26:20 | * | devzerp quit (Remote host closed the connection) |
13:26:20 | * | no_name quit (Remote host closed the connection) |
13:27:22 | * | reem quit (Ping timeout: 240 seconds) |
13:27:33 | * | devzerp joined #nim |
13:27:37 | * | no_name joined #nim |
13:29:05 | * | ARCADIVS joined #nim |
13:30:10 | * | ARCADIVS quit (Client Quit) |
13:55:42 | * | jsudlow__ quit (Remote host closed the connection) |
13:55:49 | * | xamara1 joined #nim |
13:57:23 | xamara1 | Hi guys. barcode is "1234567". How can I parse the 3rd character to an int? I tried: echo ParseInt(barcode[2]) |
13:57:39 | xamara1 | But that does not work |
13:59:13 | xamara1 | Preferrably I would convert the string to an int Array. But I did not found anything in the documentation |
14:01:09 | EXetoC | it does take a string but you're passing a char to it. try parseInt("" & barcode[2]) |
14:02:37 | xamara1 | Yes. Now it works. Thank you |
14:09:37 | * | gsingh93 quit (Ping timeout: 252 seconds) |
14:09:55 | EXetoC | d(:)|< |
14:11:37 | BlaXpirit | .eval echo parseInt($("1234567"[2])) |
14:11:40 | Mimbus | BlaXpirit: 3 |
14:19:47 | EXetoC | ofc |
14:22:07 | * | qwr quit (Ping timeout: 256 seconds) |
14:34:25 | * | a5i joined #nim |
14:37:05 | * | rzzz joined #nim |
14:38:49 | * | akiradeveloper quit () |
14:42:48 | xamara1 | I want to generate a random 13 character long string. The above code generates a 13 character long string, but it consists of the same characters like "1111111111111" etc... What am I doing wrong? |
14:42:50 | xamara1 | proc randomStrNumber(): string = var number = "" var zahl: int for x in countup(0, 12): randomize() zahl = random(9) number = number & $zahl return number |
14:43:47 | dom96 | could you gist that please? |
14:44:26 | xamara1 | Goal: random 13 character long string |
14:45:01 | xamara1 | Must consist of numbers |
14:45:18 | xamara1 | Like "1397461209237" |
14:46:15 | xamara1 | df |
14:47:23 | EXetoC | xamara1: he meant this https://gist.github.com/ |
14:47:46 | xamara1 | Oh, sorry |
14:48:25 | dom96 | just remove the randomize call |
14:48:35 | dom96 | put it above the for loop and it will work |
14:48:41 | xamara1 | https://gist.github.com/anonymous/52088b4e015b0dbca525 |
14:49:19 | xamara1 | Ah yes. Thank you. Now it works |
14:49:27 | * | darkf quit (Quit: Leaving) |
14:54:36 | * | rzzz quit (Ping timeout: 244 seconds) |
15:01:48 | * | flaviu joined #nim |
15:02:07 | flaviu | xamara1: The randomize call reseeds the PRNG with the current time |
15:02:33 | BlaXpirit | you're basically converting current time to a number |
15:02:44 | BlaXpirit | i hope you don't use this for a password |
15:02:47 | xamara1 | ah, ok |
15:02:57 | xamara1 | No, I don't |
15:02:59 | BlaXpirit | or anything important at all |
15:03:13 | xamara1 | No. I am generating random ean 13 numbers |
15:03:13 | flaviu | so each result is exactly the same. Also, don't count on that function to return anything resembling randomness. C spec provides no guarantees upon it's quality. `return 4` is literally a conforming implementation. |
15:03:16 | xamara1 | Just for testing |
15:03:37 | xamara1 | For learning Nim |
15:03:52 | BlaXpirit | should i try to bug Araq again? |
15:04:20 | BlaXpirit | best that can be done is at least exposing rand() and RAND_MAX instead of just an even more broken wrapper around it |
15:04:30 | * | elrood joined #nim |
15:04:44 | flaviu | BlaXpirit: Just recommend your random library. |
15:05:05 | BlaXpirit | it's futile |
15:06:18 | BlaXpirit | i want random(n) to be deprecated with the message like: use rand() with caution or look for a specialized library |
15:11:12 | * | rzzz joined #nim |
15:14:56 | EXetoC | why didn't you want to use some popular engine by default? |
15:15:00 | EXetoC | or maybe I recall incorrectly |
15:25:45 | * | Matthias247 quit (Read error: Connection reset by peer) |
15:35:29 | * | xamara1 quit (Quit: Page closed) |
15:36:53 | * | rzzz quit (Ping timeout: 252 seconds) |
15:38:59 | * | xificurC joined #nim |
15:39:07 | dom96 | BlaXpirit: Honestly. xamara1 doesn't even care about the security implications of random() |
15:39:13 | dom96 | because he doesn't need to |
15:39:16 | dom96 | he is just learning |
15:39:21 | dom96 | that is what most people will use random() for |
15:39:27 | dom96 | and that is why it should stay in the stdlib |
15:40:39 | BlaXpirit | random(30000) has the first 2000 numbers twice as likely |
15:41:18 | BlaXpirit | random(1000000000) is actually random(32768) |
15:41:23 | BlaXpirit | sure, let's keep it |
15:41:48 | * | mwbrown joined #nim |
15:44:50 | EXetoC | dom96: why not make it use mt or whatever? |
15:46:13 | dom96 | EXetoC: There is no reason not to. |
15:46:21 | EXetoC | I assume there'll be a pluggable interface in the standard distribution at some point |
15:46:52 | dom96 | For some reason BlaXpirit prefers to create his own libraries instead of improving the stuff already in the standard library. |
15:47:18 | * | quasinoxen quit (Ping timeout: 252 seconds) |
15:47:28 | BlaXpirit | there is nothing to improve |
15:47:41 | BlaXpirit | literally just a horrible wrapper for rand |
15:47:47 | * | quasinoxen joined #nim |
15:48:05 | EXetoC | fine, replace then; or add to |
15:48:05 | BlaXpirit | i'm not keeping anyone from adding my library to standar |
15:49:18 | EXetoC | true |
15:53:46 | * | zipR4ND joined #nim |
15:54:49 | dom96 | BlaXpirit: your random module is nice but it doesn't look thread safe. |
15:55:25 | BlaXpirit | there is no good reason to use the same RNG across multiple threads |
15:55:37 | dom96 | I bet Araq would be more inclined to add it to the standard library if you could switch between the implementations with a -d:urandom |
15:55:48 | BlaXpirit | that is silly |
15:56:06 | BlaXpirit | you can switch between implementations in code |
15:56:46 | BlaXpirit | (back to the previous point) you can have separate RNGs for each thread |
15:57:24 | EXetoC | someone might want to use several engines too. both approaches could be supported though |
15:57:52 | EXetoC | but a project-local random module with such conveniences doesn't seem like much work |
15:58:00 | dom96 | good point |
15:58:32 | BlaXpirit | it is actually not difficult to change default implementation with compiler switch |
15:58:59 | * | rzzz joined #nim |
15:58:59 | dom96 | bbl |
15:59:19 | BlaXpirit | but let's just say the default global rng is for "learning" |
16:03:41 | dom96 | BlaXpirit: you have a global var in there which won't be usable with multiple threads because it's not a threadvar. |
16:03:44 | dom96 | bblforreal |
16:04:13 | * | banister joined #nim |
16:04:17 | BlaXpirit | > but let's just say the default global rng is for "learning" |
16:04:53 | BlaXpirit | for simple scripts and whatnot |
16:05:11 | BlaXpirit | still much better than what is currently there |
16:05:47 | BlaXpirit | as soon as your program gets even a tad complicated, you just don't use the global var |
16:09:01 | flaviu | BlaXpirit: Why not just put threadvar on the global PRNG? |
16:09:22 | BlaXpirit | this is the first time i hear of it, for one |
16:09:31 | * | rzzz quit (Ping timeout: 252 seconds) |
16:09:32 | BlaXpirit | it may be good to do |
16:09:36 | flaviu | Is there some hook to initialize something on thread spawn? |
16:10:38 | BlaXpirit | and what if someone doesnt want to call urandom in each thread? |
16:11:14 | BlaXpirit | but then again, they wouldnt be using the global anyway |
16:16:13 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:23:09 | * | bcinman joined #nim |
16:23:19 | flaviu | How does nim initialize threadvars to 0? |
16:34:50 | BlaXpirit | umm |
16:34:57 | BlaXpirit | isn't it the basic guarantee? |
16:39:11 | * | banister joined #nim |
16:44:51 | flaviu | If Nim can do that, why can't variables be initialized in arbitrary ways? |
16:46:28 | BlaXpirit | well zero is special |
16:46:38 | BlaXpirit | everything is initialized to zero |
16:46:52 | BlaXpirit | and we want arbitrary code |
16:47:02 | BlaXpirit | maybe it is possible |
16:48:19 | flaviu | Well, if the thread library is asking for new pages for static data, that'd lead to it being 0ed |
16:48:29 | flaviu | Nim might not actually be doing anything here. |
16:48:38 | * | arnetheduck quit (Ping timeout: 246 seconds) |
17:08:20 | * | flaviu quit (Remote host closed the connection) |
17:18:07 | * | dewdrop joined #nim |
17:48:25 | * | gokr joined #nim |
17:49:38 | * | saml_ joined #nim |
17:50:43 | * | bjz joined #nim |
17:51:16 | * | UberLambda joined #nim |
17:59:40 | * | fowl quit (Ping timeout: 255 seconds) |
18:02:23 | * | ^aurora^ quit (Quit: Leaving.) |
18:11:06 | * | UberLambda quit (Remote host closed the connection) |
18:41:22 | * | UberLambda joined #nim |
18:42:15 | * | gokr quit (Read error: Connection reset by peer) |
18:42:26 | * | gokr joined #nim |
18:57:04 | * | reem joined #nim |
18:59:11 | * | Matthias247 joined #nim |
19:01:06 | * | MagusOTB joined #nim |
19:15:59 | Araq | dom96: how about we let the compiler search the hole hd for some stdlib? |
19:16:05 | Araq | *whole |
19:16:28 | Araq | these bug reports "I failed to install anything properly" are annoying me |
19:16:53 | dom96 | lol. Just search every partition on the user's PC? |
19:16:58 | Araq | yup |
19:17:23 | EXetoC | look in system32 |
19:18:17 | dom96 | on linux we can read /dev/urandom until whatever data we get out of it forms valid Nim source code. |
19:18:32 | Araq | ha, brilliant! |
19:18:50 | Araq | trading a bit of speed for correctness is always valid |
19:19:32 | Araq | "the universe doesn't exist long enough for this operation. But hey, it is correct." |
19:31:02 | * | clynamen quit (Ping timeout: 246 seconds) |
19:32:25 | TEttinger | "Proves P=NP in O(N^Graham's number) time" |
19:33:01 | TEttinger | O(Graham's number^N) would actually be much worse |
19:34:18 | Araq | N=1 --> P=NP ;-) |
19:34:46 | federico3 | or P=0 |
19:35:06 | TEttinger | ah |
19:35:13 | TEttinger | needs to be little n |
19:36:23 | TEttinger | "parses all IEEE standards and produces an implementation of all of them" |
19:37:28 | EXetoC | P for Pie? |
19:37:43 | TEttinger | "it's a library that implements floating-point numbers and 802.11ac wireless" |
19:39:52 | TEttinger | EXetoC: https://en.wikipedia.org/wiki/P_versus_NP_problem |
19:40:14 | TEttinger | one of those things that keeps #haskell up at night |
19:44:52 | * | quasinoxen quit (Ping timeout: 240 seconds) |
19:45:31 | * | quasinoxen joined #nim |
19:47:28 | * | zipR4ND quit (Ping timeout: 252 seconds) |
19:51:44 | * | gsingh93 joined #nim |
20:04:46 | * | reem quit (Remote host closed the connection) |
20:05:27 | * | reem joined #nim |
20:12:19 | * | bmaxa joined #nim |
20:17:54 | * | saml_ quit (Ping timeout: 252 seconds) |
20:20:07 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:39:47 | * | Etheco joined #nim |
20:40:19 | * | bmaxa left #nim ("Leaving") |
20:40:36 | * | reem quit (Remote host closed the connection) |
20:45:48 | * | reem joined #nim |
20:47:00 | * | reem quit (Read error: Connection reset by peer) |
20:47:35 | * | reem joined #nim |
20:52:00 | * | reem quit (Ping timeout: 252 seconds) |
21:02:36 | * | johnsoft quit (Ping timeout: 256 seconds) |
21:03:19 | * | quasinoxen quit (Ping timeout: 256 seconds) |
21:08:12 | * | a5i quit () |
21:14:00 | * | rzzz joined #nim |
21:14:27 | * | fowl joined #nim |
21:14:38 | * | qwr joined #nim |
21:23:30 | * | johnsoft joined #nim |
21:24:00 | * | fizzbooze joined #nim |
21:25:24 | * | quasinoxen joined #nim |
21:25:34 | * | elrood quit (Quit: de chelonian mobile) |
21:33:10 | * | reem joined #nim |
21:40:00 | * | Demon_Fox joined #nim |
21:41:34 | * | pregressive joined #nim |
21:44:50 | * | Jesin joined #nim |
21:46:20 | * | Jesin quit (Max SendQ exceeded) |
21:46:57 | * | Jesin joined #nim |
21:58:19 | * | quasinoxen quit (Quit: No Ping reply in 180 seconds.) |
21:59:33 | * | quasinoxen joined #nim |
22:01:19 | * | gsingh93 quit (Ping timeout: 255 seconds) |
22:04:58 | * | reem quit (Remote host closed the connection) |
22:06:04 | * | reem joined #nim |
22:09:52 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:10:53 | * | banister joined #nim |
22:11:13 | * | reem quit (Ping timeout: 264 seconds) |
22:13:07 | * | UberLambda quit (Quit: Leaving the Matrix) |
22:34:32 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:54:04 | * | davidhq joined #nim |
22:54:41 | * | davidhq quit (Client Quit) |
22:55:42 | * | elbow_jason joined #nim |
23:00:16 | * | xificurC quit (Ping timeout: 255 seconds) |
23:06:50 | * | bitcraft__ quit (Ping timeout: 264 seconds) |
23:07:30 | * | wb joined #nim |
23:10:39 | * | banister quit (Ping timeout: 245 seconds) |
23:12:05 | * | a5i joined #nim |
23:15:53 | * | ^aurora^ joined #nim |
23:32:31 | * | banister joined #nim |
23:48:43 | * | clynamen joined #nim |
23:50:21 | BlaXpirit | uint(int.high)+1 compiles to..... IL64(-9223372036854775807) - IL64(1) |
23:50:23 | BlaXpirit | wut? |
23:53:06 | BlaXpirit | this is probably to avoid number suffixes |
23:54:26 | * | pregress_ joined #nim |
23:54:55 | Varriount | Oh, look! The number of people on the channel is a power of two! |
23:55:34 | EXetoC | half life 3 confirmed |
23:55:44 | * | pregress_ quit (Client Quit) |
23:56:04 | * | pregressive quit (Ping timeout: 244 seconds) |
23:56:16 | BlaXpirit | now i'm gonna make it a power of 5 |
23:56:22 | * | BlaXpirit quit (Quit: Quit Konversation) |
23:56:53 | Varriount | EXetoC: What about portal 3? |
23:57:14 | * | BlaXpirit joined #nim |
23:59:00 | EXetoC | BlaXpirit: how did you do that? |
23:59:23 | BlaXpirit | well it isnt power of 5 anymore |
23:59:27 | BlaXpirit | but it was after i said |
23:59:56 | EXetoC | magic |