2013-03-22T00:02:07 *** dvladim has joined #aichallenge 2013-03-22T00:11:16 *** dvladim has quit IRC (Ping timeout: 240 seconds) 2013-03-22T00:49:31 *** cyphase has quit IRC (Read error: Connection reset by peer) 2013-03-22T01:26:50 *** cyphase has joined #aichallenge 2013-03-22T02:18:28 *** mceier has quit IRC (Quit: leaving) 2013-03-22T02:47:29 *** thestinger has quit IRC (Quit: WeeChat 0.4.0) 2013-03-22T02:48:47 *** Areks has quit IRC (Read error: Connection reset by peer) 2013-03-22T03:10:15 *** mceier has joined #aichallenge 2013-03-22T03:14:58 *** Areks has joined #aichallenge 2013-03-22T03:40:54 *** epicmonkey has joined #aichallenge 2013-03-22T03:59:55 *** epicmonkey has quit IRC (Ping timeout: 264 seconds) 2013-03-22T04:23:03 *** amstan_ has quit IRC (Ping timeout: 245 seconds) 2013-03-22T05:04:17 *** epicmonkey has joined #aichallenge 2013-03-22T05:22:50 *** coeus_ has quit IRC (Ping timeout: 255 seconds) 2013-03-22T05:32:29 *** sigh has joined #aichallenge 2013-03-22T05:34:11 *** loglog has joined #aichallenge 2013-03-22T07:05:23 *** sigh has quit IRC (Remote host closed the connection) 2013-03-22T07:09:33 *** sigh has joined #aichallenge 2013-03-22T07:51:09 *** chris__0076 has joined #aichallenge 2013-03-22T07:55:05 *** chris___0076 has quit IRC (Ping timeout: 260 seconds) 2013-03-22T08:28:11 *** heinrich5991 has quit IRC (Ping timeout: 258 seconds) 2013-03-22T08:29:36 *** heinrich5991 has joined #aichallenge 2013-03-22T08:55:39 *** Garf has joined #aichallenge 2013-03-22T09:25:04 *** sigh has quit IRC (Remote host closed the connection) 2013-03-22T09:25:26 *** RagingDave has joined #aichallenge 2013-03-22T09:39:08 *** sigh has joined #aichallenge 2013-03-22T10:11:24 *** floWenoL has quit IRC (Quit: Lost terminal) 2013-03-22T10:12:51 *** floWenoL has joined #aichallenge 2013-03-22T10:52:04 *** chris__0076 has quit IRC (Ping timeout: 256 seconds) 2013-03-22T11:13:26 *** Chris_0076 has joined #aichallenge 2013-03-22T11:31:17 *** mceier has quit IRC (Quit: leaving) 2013-03-22T12:12:44 *** sigh has quit IRC (Remote host closed the connection) 2013-03-22T12:29:35 *** iglo has joined #aichallenge 2013-03-22T12:44:10 *** mceier has joined #aichallenge 2013-03-22T13:01:39 *** iglo has quit IRC (Remote host closed the connection) 2013-03-22T13:36:48 *** epicmonkey has quit IRC (Read error: Operation timed out) 2013-03-22T14:23:32 *** mviel has quit IRC (Remote host closed the connection) 2013-03-22T14:35:15 *** thestinger has joined #aichallenge 2013-03-22T14:54:19 *** epicmonkey has joined #aichallenge 2013-03-22T15:01:59 *** Scooper has joined #aichallenge 2013-03-22T15:34:02 *** Garf has quit IRC (Quit: Make a new plan, Stan!) 2013-03-22T16:48:23 *** epicmonkey has quit IRC (Ping timeout: 260 seconds) 2013-03-22T17:27:56 *** mcstar has joined #aichallenge 2013-03-22T17:30:58 thestinger: do you know of a good video player that can upsample low res movies to look good in fullhd? 2013-03-22T17:32:33 mcstar: mplayer 2013-03-22T17:32:44 i meant it as a joke :( 2013-03-22T17:32:49 ;p 2013-03-22T17:33:06 thestinger: got github sites working 2013-03-22T17:33:06 the accelerated (or default software fallback) scaling isn't the best quality 2013-03-22T17:33:17 gonna have a static blog <3 2013-03-22T17:33:22 can tell it to use slow high quality scaling 2013-03-22T17:33:39 thestinger: well, it cant add detail, so it doesnt matter much 2013-03-22T17:33:51 yeah it can just be told to lose less detail 2013-03-22T17:34:05 and there are horrific post-processing things that fake detail, but I don't like that 2013-03-22T17:34:19 also, smplayer has an annoying bug, it displays a white stripe on the bottom side, in fullscreen 2013-03-22T17:34:24 interpolation for interlacing is reasonable though 2013-03-22T17:34:47 mcstar: I just use plain old mplayer2 2013-03-22T17:34:53 i do too, now 2013-03-22T17:35:06 but i used to use smplayer, it is feature full and great 2013-03-22T17:35:13 until this bug appeared 2013-03-22T17:35:24 (maybe it has to do with awesome + smaplayer) 2013-03-22T17:35:28 mplayer2 is a tiny bit nicer than mplayer (I don't like when seeking unpases in regular mplayer) 2013-03-22T17:35:32 unpauses* 2013-03-22T17:35:34 yes 2013-03-22T17:35:41 and has double click fullscreen 2013-03-22T17:35:54 and right click pause 2013-03-22T17:36:04 and blackjack and hookers 2013-03-22T17:36:13 oh, didnt know about those 2013-03-22T17:36:19 thestinger: i hacked my keyboard yesterday 2013-03-22T17:36:27 mcstar: how so? 2013-03-22T17:36:40 there is an Fn key where the right Super supposed to be 2013-03-22T17:36:52 so this key is not registered by X, it is a hardware modifier 2013-03-22T17:37:05 and i managed to rewire it as left Super 2013-03-22T17:37:13 so i can use it for window management stuff 2013-03-22T17:37:26 now, this is a great keyboard 2013-03-22T17:38:02 thestinger: http://www.microsoft.com/hardware/en-us/p/comfort-curve-keyboard-3000 2013-03-22T17:38:28 it had a shitload of screws... 2013-03-22T17:39:28 4 in the clear, 8 under the pads, and 3 under cover sheets 2013-03-22T17:41:54 ugh, this function is going to be hard to convert from recursive -> state machine 2013-03-22T17:41:56 * thestinger sighs 2013-03-22T17:42:02 thestinger: if mplayer2 had a seek bar, or a better seeking mechanism, and could remember positions it would be great 2013-03-22T17:42:26 mcstar: use shift-left/right to seek 2013-03-22T17:42:29 instead of left/right 2013-03-22T17:42:38 thats still not graphical :) 2013-03-22T17:42:47 left/right only seek to frames and round to ~10s 2013-03-22T17:42:56 yeah, there are 3 kinds 2013-03-22T17:43:06 but id like a graphical bar to seek with the mouse 2013-03-22T17:43:21 thestinger: what function? 2013-03-22T17:43:50 mcstar: http://ix.io/4Qy it visits all the nodes in a radix trie 2013-03-22T17:44:00 need to transform it into an external iterator 2013-03-22T17:44:10 so I need a stack of nodes up to the root + the index they are at 2013-03-22T17:44:13 oh, c++ 2013-03-22T17:44:13 + the current node and index 2013-03-22T17:44:15 mcstar: rust 2013-03-22T17:44:17 :P 2013-03-22T17:44:18 XD 2013-03-22T17:44:20 i know... 2013-03-22T17:44:47 one day maybe there will be 'yield' and automatic transformations to state machine generators.... until then *sigh* 2013-03-22T17:45:04 you want to turn an iteration inside out? 2013-03-22T17:45:18 continuation passing transformation? if im correct 2013-03-22T17:45:33 mcstar: internal iterator is a function you pass a closure to, an external one is a state machine (like C++ iterators) 2013-03-22T17:46:19 that is just one possible implementation 2013-03-22T17:46:22 there is no inherent state 2013-03-22T17:46:30 could automatically generate a state machine (turn local variables into the current state, use a stack for recursion and forbid mutual recursion - like python) 2013-03-22T17:46:35 mcstar: there's state under the hood :P 2013-03-22T17:47:12 it's relevant in rust because the lifetime of the iterator is the lifetime of the container - you can't invalidate it 2013-03-22T17:47:23 a zip iterator would be an intersection of the lifetime of two iterators 2013-03-22T17:47:32 (they have to outlive it) 2013-03-22T17:47:55 if you only have garbage collected, persistent containers things are easier :P 2013-03-22T17:48:04 how can an iterator always be valid? 2013-03-22T17:48:09 you cant copy it? 2013-03-22T17:48:15 mcstar: you can copy it 2013-03-22T17:48:19 rust has region pointers 2013-03-22T17:48:20 i mean, they have a single reference? 2013-03-22T17:48:52 mcstar: they have many references into the container, at least for a tree 2013-03-22T17:49:39 fn(a: &T) -> &U 2013-03-22T17:49:47 function that takes a reference to type T and returns a ref to type U 2013-03-22T17:49:51 fn(a: &'r T) -> &'r U 2013-03-22T17:50:20 sorry, this noise looks too much like scala 2013-03-22T17:50:23 that tells the compiler that the return value is allowed to live beyond the call - as long as the lifetime of the parameter 2013-03-22T17:50:40 mcstar: 'lifetime is just for borrowed pointers 2013-03-22T17:52:16 and & is an immutable borrowed pointer so as long as you have it, you're prevented from modifying what it points to 2013-03-22T17:52:42 thestinger: what kind of database would you recommend for simple uses, that is not based on sql? 2013-03-22T17:52:47 mcstar: leveldb 2013-03-22T17:53:05 ordered key-value database, keys are bytestrings, values are bytestrings 2013-03-22T17:53:13 has batch writes, transactions, etc. 2013-03-22T17:53:27 can be used from 1 process at a time 2013-03-22T17:53:47 and fast as hell :) 2013-03-22T17:54:46 mcstar: you have to manually namespace stuff with prefixes and serialize, but I find that easier than dealing with SQL 2013-03-22T17:55:11 thestinger: what do you use it for? 2013-03-22T17:55:25 mcstar: random persistent key-value stores on disk? :P 2013-03-22T17:55:31 * thestinger shrugs 2013-03-22T17:55:58 id like haskell interface :) 2013-03-22T17:56:17 http://hackage.haskell.org/package/leveldb-haskell 2013-03-22T17:56:32 *** sigh has joined #aichallenge 2013-03-22T17:56:40 if you trust someone who spells leveldb wrong in their package summary 2013-03-22T17:56:48 ;p 2013-03-22T17:57:02 LeveldDB 2013-03-22T17:57:13 yeah, i should use acid-state 2013-03-22T18:01:38 *** RagingDave has quit IRC (Quit: Ex-Chat) 2013-03-22T18:07:30 thestinger: how come you dont blog about rust, if you like it so much? 2013-03-22T18:07:42 mcstar: I don't blog ;p 2013-03-22T18:07:53 yes, i noticed, but why not? 2013-03-22T18:07:57 * thestinger shrugs 2013-03-22T18:07:59 (about rust, not random topics) 2013-03-22T18:09:47 thestinger: c++ templates: would it be hard to write one, that could produce arbitrarily nested codes, the input is the level of nesting 2013-03-22T18:09:58 nested for loop* 2013-03-22T18:10:10 not code, ofc, it would have code too 2013-03-22T18:10:20 mcstar: I think you could do that 2013-03-22T18:10:22 perhaps. 2013-03-22T18:11:29 i want to publish a piece of code, and it looks ugly, since you have to edit the code to increase n, the level of nesting 2013-03-22T18:12:07 i could use a different algorithm, that is general in n, but that would lower performance, i think 2013-03-22T18:12:38 mcstar: could you use a variadic template? 2013-03-22T18:12:57 i dont think thats relevant 2013-03-22T18:13:30 *** antimatroidl has joined #aichallenge 2013-03-22T18:14:02 well, maybe, if i could recurse on that variadic template, and build the loops with it 2013-03-22T18:14:11 yeah you can recurse on it 2013-03-22T18:14:15 but it might be slower 2013-03-22T18:14:53 mcstar: so you think I should start a blog? :) 2013-03-22T18:14:59 yeah 2013-03-22T18:15:09 thestinger: http://liquid-phynix.github.com/ 2013-03-22T18:15:35 I mostly just write documentation instead of blogging :P 2013-03-22T18:15:35 all i need is content, thats the easy part! 2013-03-22T18:18:26 mcstar: well, I do kind of have a lot I could blog about 2013-03-22T18:18:30 thestinger: i wrote some fortran at last :) http://sprunge.us/cRXA?fortran 2013-03-22T18:18:55 great, then do it 2013-03-22T18:19:05 region pointers are pretty bleeding edge CS stuff 2013-03-22T18:19:09 im sure it has crossed your mind before 2013-03-22T18:19:14 yeah 2013-03-22T18:21:39 this stuff seems too complicated 2013-03-22T18:22:21 mcstar: region pointers? 2013-03-22T18:22:28 yeah 2013-03-22T18:22:32 they're simple! :P 2013-03-22T18:22:34 https://github.com/mozilla/rust/wiki/Proposal-for-regions 2013-03-22T18:22:43 mcstar: that's really old 2013-03-22T18:22:58 id rather study ghc extensions 2013-03-22T18:23:09 that's not something that's actually in the language 2013-03-22T18:23:24 mcstar: you already know what regions are, and how to use them in C++ - they just aren't enforced 2013-03-22T18:23:33 i dont 2013-03-22T18:23:43 i really dont know what a region is 2013-03-22T18:23:51 or in what sense you are using the term 2013-03-22T18:23:57 mcstar: well rust calls them lifetimes now, it makes more sense that way 2013-03-22T18:24:05 region pointers is the CS terminology 2013-03-22T18:24:17 and 'linear types' are the CS term for ownership and unique ptrs 2013-03-22T18:24:28 well, linear/affine types 2013-03-22T18:25:05 mcstar: okay so lets say you have a container like a vector, and it has a method that returns a reference (mutable or immutable) 2013-03-22T18:25:19 the reference points to memory inside the vector - to be valid, the vector has to outlive it 2013-03-22T18:25:32 once the vector's lifetime is over, the reference is dangling 2013-03-22T18:25:46 thestinger: i hope you are 'tee'ing this to your blog too 2013-03-22T18:25:49 so lets call 'a the lifetime of the vector 2013-03-22T18:26:22 fn(vec: &[T]) -> &T, that's without using regions 2013-03-22T18:26:36 &[T] is a slice (view of any type of vector), and it returns a reference 2013-03-22T18:26:51 the compiler won't let the reference outlive the call - you can dereference it, but you can't keep it around 2013-03-22T18:27:04 fn(vec: &'r [T]) -> &'r T 2013-03-22T18:27:21 that just describes the lifetime of the vector as 'r, and the lifetime of the reference is the same 2013-03-22T18:27:40 whats []? 2013-03-22T18:27:42 so the compiler will allow keeping the reference as long as the vector is around, and the reference is immutable so it will "freeze" the vector 2013-03-22T18:27:44 mcstar: a vector 2013-03-22T18:27:45 the view? 2013-03-22T18:27:51 yes, &[T] is a view 2013-03-22T18:28:02 under the hood it's a ptr and a length in a struct 2013-03-22T18:28:02 why is T the return type? 2013-03-22T18:28:08 or &T 2013-03-22T18:28:16 mcstar: because I'm returning a reference to something in the vector 2013-03-22T18:28:28 it's like [a] -> a in haskell 2013-03-22T18:28:39 so this is like a find functions or something 2013-03-22T18:28:42 -s 2013-03-22T18:28:42 yeah 2013-03-22T18:28:54 or front()/back() 2013-03-22T18:29:34 fn front(v: &[T]) -> &T { &v[0] } 2013-03-22T18:29:38 fn front(v: &'r [T]) -> &'r T { &v[0] } 2013-03-22T18:29:48 thestinger: i dont understand, why return a reference if it cant outlive the call? 2013-03-22T18:30:03 mcstar: you can still do *foo() == 5 2013-03-22T18:30:13 what? 2013-03-22T18:30:16 thats horrible 2013-03-22T18:30:19 why? 2013-03-22T18:30:27 doesnt make sense 2013-03-22T18:30:35 (from a functional standpoint) 2013-03-22T18:30:40 (which im gaining) 2013-03-22T18:30:47 mcstar: why doesn't it make sense though? 2013-03-22T18:30:58 because, it mutates state 2013-03-22T18:31:03 it doesn't mutate any state 2013-03-22T18:31:04 and you dont even know what 2013-03-22T18:31:09 ==, not = 2013-03-22T18:31:12 oh 2013-03-22T18:31:19 & is immutable, the object it points to is frozen 2013-03-22T18:31:21 i thought that was the assigment operator in rust 2013-03-22T18:31:39 anyway, foo needs an argument 2013-03-22T18:31:42 doesnt it? 2013-03-22T18:31:47 yeah but it was a silly example 2013-03-22T18:31:58 *vec.front() == 5 2013-03-22T18:32:08 works without a region annotation 2013-03-22T18:32:21 the region annotation lets you keep around the reference longer than the call 2013-03-22T18:32:39 "the compiler won't let the reference outlive the call - you can dereference it, but you can't keep it around" 2013-03-22T18:32:44 i dont understand this 2013-03-22T18:33:02 how can i dereference it if it isnt around? 2013-03-22T18:33:33 mcstar: returning a reference is allowed, so it's usable when you return it 2013-03-22T18:33:59 but the lifetime is over immediately, it's ephemeral 2013-03-22T18:34:03 and it is valid only for a direct dereferenceing, like you showed and nothing else? 2013-03-22T18:34:08 mcstar: pretty much 2013-03-22T18:34:08 (without region annotation) 2013-03-22T18:34:41 ok, so with this annotation, i can keep the reference 2013-03-22T18:34:49 why is this good? 2013-03-22T18:34:58 does the compiler know if i made a mistake? 2013-03-22T18:34:58 mcstar: ok think about an iterator over a treemap 2013-03-22T18:35:01 mcstar: yes 2013-03-22T18:35:03 it's memory safe 2013-03-22T18:35:09 you can't ever have a dangling or null ptr 2013-03-22T18:35:17 and you don't need to use any gc 2013-03-22T18:35:32 i just dont unserstand how can a reference always be valid 2013-03-22T18:35:45 mcstar: because the compiler enforces that the region it points to outlives it 2013-03-22T18:36:11 if it's an immutable reference, the compiler enforces that the region it points to is immutable as long as it exists 2013-03-22T18:36:22 because for example, think about a sum type 2013-03-22T18:36:27 take a reference to something inside it 2013-03-22T18:36:36 modifying the sum type (changing the stored type) would invalidate it 2013-03-22T18:36:53 &mut references are unique - as long as you have one, it's the only way to mutate the thing it points to 2013-03-22T18:38:30 mcstar: it knows the lifetime of objects from ownership 2013-03-22T19:03:05 *** amstan_ has joined #aichallenge 2013-03-22T19:03:05 *** ChanServ sets mode: +o amstan_ 2013-03-22T19:16:37 *** antimatroidl has quit IRC (Quit: Leaving.) 2013-03-22T19:41:49 *** mcstar has quit IRC (Quit: mcstar) 2013-03-22T22:14:46 *** Scooper has quit IRC (Quit: Leaving)