2012-01-08T00:03:09 *** grc48 has joined #aichallenge 2012-01-08T00:19:45 *** dorisabayon has joined #aichallenge 2012-01-08T00:21:27 *** u_ has quit IRC (Quit: u_) 2012-01-08T00:22:48 *** Fandekasp has quit IRC (Ping timeout: 252 seconds) 2012-01-08T00:55:01 *** raemde has joined #aichallenge 2012-01-08T00:58:32 *** lhb__ has quit IRC (Ping timeout: 240 seconds) 2012-01-08T01:16:15 *** Kahtras has joined #aichallenge 2012-01-08T01:21:41 bah stupid network 2012-01-08T01:21:46 claims ports are open yet they aren't 2012-01-08T01:21:51 including my torrent ones 2012-01-08T01:27:38 *** antimatroid has joined #aichallenge 2012-01-08T01:28:23 *** antimatroid1 has quit IRC (Ping timeout: 240 seconds) 2012-01-08T01:33:28 nm i'm retarded 2012-01-08T01:45:46 *** amstan has quit IRC (Quit: Konversation terminated!) 2012-01-08T01:47:18 *** amstan has joined #aichallenge 2012-01-08T01:47:31 *** ChanServ sets mode: +o amstan 2012-01-08T01:57:14 https://github.com/berak/ants-tcp/blob/master/webserver.py#L478 2012-01-08T01:57:19 i don't get how to add my host ip to that? 2012-01-08T01:57:24 anyone know? 2012-01-08T02:06:13 thestinger: are you around? 2012-01-08T02:07:59 http://www.whatsmyip.org/ 2012-01-08T02:09:21 yeah i can get that 2012-01-08T02:09:31 but it doesn't load for me 2012-01-08T02:09:39 only when i go via 192.168.1.100 2012-01-08T02:09:49 i'm wondering if people outside can access it 2012-01-08T02:23:18 *** Kurnevsky has joined #aichallenge 2012-01-08T02:25:29 antimatroid: did you forward the port to there? 2012-01-08T02:28:38 *** amstan has quit IRC (Ping timeout: 240 seconds) 2012-01-08T02:32:35 *** Palmik has joined #aichallenge 2012-01-08T02:48:35 thestinger: yeah it seems to work 2012-01-08T02:48:39 got pairofdice to load it 2012-01-08T02:49:00 it wont load the external ip from my computer though, i don't understand these things though so not sure if that's to be expected :\ 2012-01-08T02:51:05 what are peoples thoughts about username/botname/versionno for tcp? 2012-01-08T02:51:06 i 2012-01-08T02:51:17 i'm thinking of just leaving it at botname/versionNo 2012-01-08T02:51:28 well, adding in the versionNo 2012-01-08T02:51:38 i like being able to be more anonymous 2012-01-08T03:04:12 *** thestinger has quit IRC (Quit: WeeChat 0.3.6) 2012-01-08T03:20:03 *** Fandekasp has joined #aichallenge 2012-01-08T03:23:25 *** dorisabayon has quit IRC (Ping timeout: 252 seconds) 2012-01-08T03:25:26 *** JamesMG_ has quit IRC (Read error: Connection reset by peer) 2012-01-08T03:28:41 *** JamesMG has joined #aichallenge 2012-01-08T03:47:50 *** Jak_o_Shadows has quit IRC (Ping timeout: 248 seconds) 2012-01-08T03:49:45 *** Jak_o_Shadows has joined #aichallenge 2012-01-08T04:01:50 phiton TCP srver and client very baggy and bad 2012-01-08T04:23:25 *** grc48 has quit IRC (Quit: Leaving) 2012-01-08T04:26:14 Accoun: I'm currently looking at rewriting it, although i have zero idea with this stuff so i can't imagine i'm going to do a very good job 2012-01-08T04:26:23 especially the webserver part 2012-01-08T04:27:46 *** epicmonkey has joined #aichallenge 2012-01-08T04:36:37 *** ruser has quit IRC (Read error: Operation timed out) 2012-01-08T04:40:34 *** ruser has joined #aichallenge 2012-01-08T04:56:19 *** acieroid has quit IRC (Quit: :[) 2012-01-08T04:57:46 Huh? math.sqrt(1) gives 1.0 not 0, there goes that PE #80 solution 2012-01-08T05:03:51 *** ikaros has joined #aichallenge 2012-01-08T05:08:29 Well, that was too easy for an 80 2012-01-08T05:10:07 *** foRei has joined #aichallenge 2012-01-08T05:14:54 not 1* 2012-01-08T05:23:17 man the tcp code is gross 2012-01-08T05:29:17 *** Kurnevsky has quit IRC (Quit: Instantbird 1.0) 2012-01-08T05:39:34 *** choas has joined #aichallenge 2012-01-08T05:53:02 *** kire has joined #aichallenge 2012-01-08T06:01:44 *** kilae has joined #aichallenge 2012-01-08T06:20:23 *** dorisabayon has joined #aichallenge 2012-01-08T06:22:14 *** Redgis has joined #aichallenge 2012-01-08T06:23:22 *** Fandekasp has quit IRC (Ping timeout: 240 seconds) 2012-01-08T06:25:36 *** X-Scale has quit IRC (Remote host closed the connection) 2012-01-08T06:29:52 *** kire has quit IRC (Quit: Leaving) 2012-01-08T06:32:05 *** replore has joined #aichallenge 2012-01-08T06:38:33 *** nickjohnson has joined #aichallenge 2012-01-08T07:23:57 *** sigh has quit IRC (Remote host closed the connection) 2012-01-08T07:24:45 *** sigh has joined #aichallenge 2012-01-08T07:24:49 *** dr- has quit IRC (Ping timeout: 240 seconds) 2012-01-08T07:28:37 *** dorisabayon has quit IRC (Ping timeout: 248 seconds) 2012-01-08T07:29:17 *** Fandekasp has joined #aichallenge 2012-01-08T07:30:32 *** dr- has joined #aichallenge 2012-01-08T07:48:06 *** Jak_o_Shadows has quit IRC (Remote host closed the connection) 2012-01-08T08:15:35 *** antbuilder has joined #aichallenge 2012-01-08T08:16:15 hello room 2012-01-08T08:16:23 hello 2012-01-08T08:16:41 *** AntMan_ has joined #aichallenge 2012-01-08T08:16:57 hey 2012-01-08T08:17:36 does any of you have any experience with the java starter package of the ant builder? 2012-01-08T08:17:46 i mean the ant challenge* 2012-01-08T08:19:23 because i have tried to implement an A* algorithm in the code, after following the tutorial, however, my bot does not do anything anymore 2012-01-08T08:43:02 *** antbuilder has quit IRC (Quit: Page closed) 2012-01-08T08:47:13 *** TheLinker has joined #aichallenge 2012-01-08T09:04:17 *** aeter has joined #aichallenge 2012-01-08T09:09:09 *** AlliedEnvy has quit IRC (Read error: Connection reset by peer) 2012-01-08T09:10:14 *** AlliedEnvy has joined #aichallenge 2012-01-08T09:10:18 *** mceier has joined #aichallenge 2012-01-08T09:14:17 *** AntMan_ has quit IRC (Ping timeout: 258 seconds) 2012-01-08T09:14:52 *** conor_f has joined #aichallenge 2012-01-08T09:20:36 *** dorisabayon has joined #aichallenge 2012-01-08T09:23:56 *** Fandekasp has quit IRC (Ping timeout: 240 seconds) 2012-01-08T09:26:33 *** mleise has joined #aichallenge 2012-01-08T09:36:22 lol, fear and loathing in las vegas 2012-01-08T09:36:48 "What?! No! We can't stop here! This is bat country." 2012-01-08T09:40:38 I never quite got that quote, are bats supposed to be scary? 2012-01-08T09:41:19 nah, I think it's the fact that they were "giant bats" and they appeared out of nowhere in the middle of the desert 2012-01-08T09:41:40 and maybe a bit of parinoia from all the drugs lol 2012-01-08T09:42:28 Drugs would explain most of it, yes 2012-01-08T09:43:12 heh, drugs explains just about everything in that film :) 2012-01-08T09:43:18 have you read the book? 2012-01-08T09:44:22 Nah 2012-01-08T09:45:01 * conor_f needs to go find a free ebook of it 2012-01-08T09:45:19 *** srgpqt has joined #aichallenge 2012-01-08T09:53:00 *** Blkt has joined #aichallenge 2012-01-08T09:53:45 good day everyone 2012-01-08T09:55:27 hi Blkt 2012-01-08T09:55:35 :D 2012-01-08T09:56:01 The Pemba flying fox is one big bat with a wingspan of up to 5 1/2 feet 2012-01-08T09:56:52 They were also very tasty according to local cuisine 2012-01-08T09:57:56 *** aeter has quit IRC (Quit: Leaving.) 2012-01-08T09:57:57 And a herbivore, also very rare 2012-01-08T10:02:29 look at that: http://www.youtube.com/watch?v=UROVfmY3NTA, funny comment: Joker: "Its simple: We kill the Batman." - Centipede: "Ok" 2012-01-08T10:03:17 a bat eating centipede.... 2012-01-08T10:03:29 do you want me to ever sleep again in my life?!? 2012-01-08T10:03:31 Those are fucking creepy 2012-01-08T10:04:06 dear god. I'm not the most squeamish of people 2012-01-08T10:04:32 but did you watch that video? theres bugs _everywhere_ 2012-01-08T10:04:44 Guano eating bugs 2012-01-08T10:04:51 Fucked if you thinkn I'd be the cameraman... 2012-01-08T10:04:51 * antimatroid just discovered chuck 2012-01-08T10:05:37 g++'s -g option is the best thing <3 2012-01-08T10:06:22 especially since I learned to use gdb :) 2012-01-08T10:21:16 *** kire has joined #aichallenge 2012-01-08T10:24:10 *** mcstar has joined #aichallenge 2012-01-08T10:27:15 *** dici has joined #aichallenge 2012-01-08T10:33:25 *** dici has quit IRC (Read error: Connection reset by peer) 2012-01-08T10:37:21 *** aeter has joined #aichallenge 2012-01-08T10:53:46 *** u_ has joined #aichallenge 2012-01-08T10:57:35 Programming with unicode: "Your cards are: ♠8 ♠9 ♣9 ♣J ♢Q ♣Q ♢K ♠K" 2012-01-08T10:59:24 It would be an unreadable mess in ascii 2012-01-08T11:00:54 Still has 2 squares for me :/ 2012-01-08T11:05:14 Your cards are: ♠8 ♠9 ♣9 ♣J ♢Q ♣Q ♢K ♠K 2012-01-08T11:05:32 no hearts or diamonds 2012-01-08T11:05:48 ♢ 2012-01-08T11:05:54 this is the diamond 2012-01-08T11:05:58 square 2012-01-08T11:06:04 sorry 2012-01-08T11:06:10 it's very vague and grey 2012-01-08T11:06:44 conor_f: did you solve the problem? 2012-01-08T11:06:57 which? 2012-01-08T11:07:04 wedge/point mass 2012-01-08T11:07:13 no -_- 2012-01-08T11:08:16 I hate wedges with a passion 2012-01-08T11:30:17 http://codepad.org/E0J60YoN 2012-01-08T11:30:32 for PE #23 2012-01-08T11:30:38 it should work 2012-01-08T11:30:49 and yes, set tabstop=4 2012-01-08T11:30:57 and yes that code will take ages to run 2012-01-08T11:31:14 any ideas why it's not working? 2012-01-08T11:35:25 conor_f: d^2x/dt^2=g tan(a)(1+m/M)/(1/tan(a)-tan(a)(1+m/M))/M 2012-01-08T11:35:37 thats what i get 2012-01-08T11:35:43 im not sure if its correct 2012-01-08T11:36:01 it was literally ages since i did these kinds of stuff 2012-01-08T11:36:36 but i was very fast in these in high school, almost always the first 2012-01-08T11:36:47 heh 2012-01-08T11:36:48 i wonder what happened... 2012-01-08T11:36:55 competetitive ;) 2012-01-08T11:37:07 conor_f: dont drink when you get into university 2012-01-08T11:37:07 I'll try it again later maybe 2012-01-08T11:37:10 lol 2012-01-08T11:37:16 *** g0llum has joined #aichallenge 2012-01-08T11:37:24 s/university/high school :P 2012-01-08T11:37:48 woooow 2012-01-08T11:37:51 I'm retarded 2012-01-08T11:37:53 >_< 2012-01-08T11:38:19 instead of summing them all up, just use n(n-1)/2 to add up everything from 1 to 28123 2012-01-08T11:38:27 and then take away all the abundant numbers lol 2012-01-08T11:39:44 *** Kurnevsky has joined #aichallenge 2012-01-08T11:40:08 *n(n+1)/2 2012-01-08T11:41:44 *** dorisabayon has quit IRC (Ping timeout: 252 seconds) 2012-01-08T11:48:02 *** choas has quit IRC (Ping timeout: 240 seconds) 2012-01-08T11:57:48 *** kire has quit IRC (Remote host closed the connection) 2012-01-08T12:18:08 *** choas has joined #aichallenge 2012-01-08T12:21:58 *** Paradoxiality has joined #aichallenge 2012-01-08T12:36:43 *** aeter has quit IRC (Ping timeout: 252 seconds) 2012-01-08T12:38:36 *** aeter has joined #aichallenge 2012-01-08T12:40:19 *** grwip has joined #aichallenge 2012-01-08T12:41:52 *** sofuture has joined #aichallenge 2012-01-08T12:42:56 *** denysonique_ has joined #aichallenge 2012-01-08T12:46:44 *** thestinger has joined #aichallenge 2012-01-08T13:03:22 *** sashaSochka has joined #aichallenge 2012-01-08T13:08:30 drink all the alcohol 2012-01-08T13:12:50 http://projecteuler.net/problem=61 another one of these :) 2012-01-08T13:12:58 *** X-Scale has joined #aichallenge 2012-01-08T13:16:34 thestinger: lol, these problems are so stupid, yet I'm compelled to do them :P 2012-01-08T13:16:55 54 was really fun 2012-01-08T13:17:55 heh 2012-01-08T13:18:17 *** aeter has quit IRC (Quit: Leaving.) 2012-01-08T13:18:21 that is actually the most useful one I've seen (still not very useful though :P) 2012-01-08T13:18:56 well you end up with a program that can rank poker hands 2012-01-08T13:19:00 but still, wouldn't it be better if they asked you to code how much to bet? 2012-01-08T13:19:09 given a hand 2012-01-08T13:19:26 they need to have questions with one answer 2012-01-08T13:19:42 yeah, a limitation of the site 2012-01-08T13:19:59 thats what makes spoj.pl a bit superior 2012-01-08T13:20:06 The use of that site isn't in practical applications... 2012-01-08T13:20:08 but I prefer PE overall 2012-01-08T13:20:31 thestinger: i could get my haskell one for 74 down to 8.5 secs vs yours 8.0(pypy) 2012-01-08T13:21:18 thestinger: the weird thing was that testing a list/set/map/hashmap for membership for the cycle detection, didnt matter 2012-01-08T13:21:22 mcstar: I tried 74 yesterday in C. Manage to get it down to 0.050s at 1.7GHz 2012-01-08T13:21:48 X-Scale: what data structure do yo use? 2012-01-08T13:21:54 damn, cold fingerds 2012-01-08T13:22:04 well, lets see how fast it is if I rewrite it in C++ :P 2012-01-08T13:22:54 thestinger: i think haskell didnt like that i have to create those structures a million times 2012-01-08T13:23:02 *** aeter has joined #aichallenge 2012-01-08T13:23:04 I used memoization on a simple array of unsigned chars for the main table. Another array for the 0..9 factorials, and another array to store temporary partial chains. 2012-01-08T13:23:14 so their better membership complexity didnt shop up 2012-01-08T13:23:27 yeah 2012-01-08T13:23:34 simple damn vectors 2012-01-08T13:23:36 lol 2012-01-08T13:23:47 hashmaps and balanced trees can suck my finger 2012-01-08T13:25:06 *** alehorst has joined #aichallenge 2012-01-08T13:25:31 meh, I'm too lazy lol 2012-01-08T13:25:43 oh wait nvm 2012-01-08T13:25:51 it will be easy, my hash table is already basically an array 2012-01-08T13:25:58 thestinger $! program 2012-01-08T13:26:07 *** mceier has quit IRC (Quit: leaving) 2012-01-08T13:26:08 *** sashaSochka has quit IRC (Ping timeout: 258 seconds) 2012-01-08T13:27:01 http://codepad.org/chx5pAJU 2012-01-08T13:27:17 can anyone see the problem with that? It's failing 2012-01-08T13:27:52 sum all the integers that can't be represented by the sum of 2 abundant numbers 2012-01-08T13:30:09 also, I know it would be slow 2012-01-08T13:30:22 but it's only going through 1 number a second.... 2012-01-08T13:32:45 you should put the sums into a set 2012-01-08T13:32:50 or at least sort them 2012-01-08T13:33:02 yeah 2012-01-08T13:33:12 if they were in a set I wouldn't have any duplicates alright 2012-01-08T13:33:15 but still 2012-01-08T13:33:17 conor_f: what's that problem # ? 2012-01-08T13:33:23 23 2012-01-08T13:33:26 thx 2012-01-08T13:34:06 mcstar: >_< 2012-01-08T13:34:24 i dont see an error so far 2012-01-08T13:34:31 a simple break if the abundant sum is greater then i would make things a lot faster I imagine :/ 2012-01-08T13:34:34 its not the way id do it, but.. 2012-01-08T13:35:46 *** sashaSochka has joined #aichallenge 2012-01-08T13:36:28 a lot faster, but also wrong 2012-01-08T13:38:41 mcstar: on 74, they forgot to mention that 1, 2 and 40585 also have the same 1-cycle property as 145. 2012-01-08T13:38:55 and 0 2012-01-08T13:39:08 ah no 2012-01-08T13:39:17 0!=1 1!=1 2012-01-08T13:39:22 lol 2012-01-08T13:39:27 0 doesnt cycle 2012-01-08T13:40:01 I spotted 1 and 2 cases before testing, because they were trivial. But the 40585 demanded a simple GDB session as the program was in an infinite loop. :P 2012-01-08T13:40:03 Right 2012-01-08T13:43:03 conor_f: i dont know really 2012-01-08T13:43:16 seems logically correct to me 2012-01-08T13:43:51 yeah 2012-01-08T13:43:56 its not an overflow 2012-01-08T13:46:30 PE#23 sounds interesting. Specially finding a fast way of creating the sum of all proper divisors of a large number set. 2012-01-08T13:47:17 I just brute forced that one 2012-01-08T13:47:18 mcstar: I think I found the problem 2012-01-08T13:47:38 23 takes 500ms in python 2012-01-08T13:47:44 a stupid mistake 2012-01-08T13:47:48 thestinger: :O 2012-01-08T13:47:52 whats that? 2012-01-08T13:47:57 brute force? 2012-01-08T13:48:01 conor_f: you're doing factoring in a really bad way :P 2012-01-08T13:48:07 lol, yes 2012-01-08T13:48:10 but still 2012-01-08T13:48:23 you could start by just finding the lower factors and getting the higher ones from that 2012-01-08T13:48:27 the difference between like, 3 mins and counting and 500 ms? 2012-01-08T13:48:42 just takes one infinite loop 2012-01-08T13:48:49 so you turn n into sqrt(n) 2012-01-08T13:49:05 anyway, you can get divisors in better ways than that 2012-01-08T13:49:09 Yeah, you don't need to go past sqrt(n) at all 2012-01-08T13:49:26 yeah, I knew that 2012-01-08T13:49:36 but thats not whats taking the time 2012-01-08T13:49:49 are you sure? 2012-01-08T13:49:56 yes 2012-01-08T13:50:00 certain 2012-01-08T13:50:02 how do you check if a number is abundant 2012-01-08T13:50:04 that takes less then a second 2012-01-08T13:50:13 sum all its divisors 2012-01-08T13:50:24 and then if it's greater then the base 2012-01-08T13:50:28 simpley as that 2012-01-08T13:50:36 all that is done in < 1 second 2012-01-08T13:50:50 and summing them all and putting them into a vector 2012-01-08T13:51:12 a vector..? 2012-01-08T13:51:12 it's the sorting of the vector and the checking for non-abundant numbers thats killing it 2012-01-08T13:51:21 so you are doing a linear search over it? 2012-01-08T13:51:29 yes 2012-01-08T13:51:56 well, use a proper data structure where it's O(1) to check if something is in it, not O(n) 2012-01-08T13:52:22 http://codepad.org/lS0OD2MD 2012-01-08T13:52:24 std::hash is a perfect hash for unsigned ints 2012-01-08T13:52:29 or you could just use a bit/bool array 2012-01-08T13:52:58 conor_f: what was the problem? 2012-01-08T13:53:29 conor_f: well, I'm too lazy to figure out what your code does :P 2012-01-08T13:53:49 thestinger: i looked over it and found no logical errors 2012-01-08T13:54:51 mcstar: what I said at 33 of this hour 2012-01-08T13:54:58 about checking if it was greater 2012-01-08T13:55:09 (line 42 in the most recent paste 2012-01-08T13:56:06 I hadn't the vector sorted so it wasn't checking it correctly 2012-01-08T13:56:17 still doesn't explain why it's so incredibly slow though.... 2012-01-08T13:57:31 well, you should use a better data structure 2012-01-08T13:58:54 yes 2012-01-08T13:58:56 I should 2012-01-08T14:00:47 if(j == abundant_numbers.size()-1) 2012-01-08T14:00:57 if(j == abundant_numbers_sums.size()-1) 2012-01-08T14:01:16 i think this was the problem 2012-01-08T14:01:23 the sorting inst necessairy 2012-01-08T14:01:37 and that other check is redundant also 2012-01-08T14:01:40 i think 2012-01-08T14:01:49 oh ffs 2012-01-08T14:01:53 tyvm mcstar 2012-01-08T14:02:04 i missed this th efirst time 2012-01-08T14:02:17 weird, I think I found a pypy bug 2012-01-08T14:02:37 mcstar: both checks are needed 2012-01-08T14:02:51 stops line 42 being a seg fault 2012-01-08T14:03:00 *accessing an element outside the array 2012-01-08T14:03:04 not always seg faults 2012-01-08T14:03:26 use libmudflap 2012-01-08T14:03:29 catches all that stuff 2012-01-08T14:04:16 gcc -fmudflap -o test test.c -lmudflap 2012-01-08T14:04:32 well, not sure how well it works with C++ 2012-01-08T14:04:53 lol 2012-01-08T14:04:57 never heard of that 2012-01-08T14:05:29 it's better than crappy valgrind because it builds in checks for each array 2012-01-08T14:05:40 so it doesn't have false positives and doesn't miss stuff 2012-01-08T14:05:59 huh 2012-01-08T14:06:05 *** aeter has quit IRC (Quit: Leaving.) 2012-01-08T14:06:29 funny how there are programs debugging your programs all running under some program :P 2012-01-08T14:06:36 computes amaze me from time to time 2012-01-08T14:06:50 well, it's a library 2012-01-08T14:06:56 yeah 2012-01-08T14:07:51 my codes speed makes me want to cry 2012-01-08T14:08:15 especially when theres a much easier way to do it but I'm not bothered coding it 2012-01-08T14:08:33 answer = n(n+1)/2; 2012-01-08T14:08:58 and then just take all the unique values in abundant_numbers_sums away from it 2012-01-08T14:13:58 lol, did it and got it right :P 2012-01-08T14:14:05 I should make more of an effort :| 2012-01-08T14:25:17 conor_f: http://codepad.org/aasTIC1Z 2012-01-08T14:25:54 ugh... C++ 2012-01-08T14:26:33 sum(map(factorial, map(int, str(current_n)))) <- I like how that becomes 5 lines, and I have to use to_string and c_to_i functions 2012-01-08T14:26:49 mcstar: runtime? 2012-01-08T14:26:59 1.4sec 2012-01-08T14:27:03 I clearly use map too little (not at all) 2012-01-08T14:27:24 heh, same here pairofdice :P 2012-01-08T14:27:34 it was the same with vectors 2012-01-08T14:27:38 set/map aren't very useful, unordered_set and unordered_map are though 2012-01-08T14:27:40 i told you that would fix it 2012-01-08T14:27:42 http://codepad.org/s3IUrhwp 2012-01-08T14:27:45 thats mine 2012-01-08T14:27:48 pairofdice: don't you use lots of sets and dicts in python? :P 2012-01-08T14:27:53 but if i didnt change the vector to set, thestinger would tkae my head off 2012-01-08T14:27:54 Sure 2012-01-08T14:28:09 runtime 30 seconds lol :P 2012-01-08T14:28:19 mcstar: well, or use an array as a hash table :) 2012-01-08T14:28:31 But I'm only at the DDK pythonista level 2012-01-08T14:28:59 well my solution is 1.6s now for 74 2012-01-08T14:31:15 you all need to do 54 2012-01-08T14:31:24 best problem I've done so far 2012-01-08T14:32:36 heh 2012-01-08T14:34:16 it looks difficult enough 2012-01-08T14:34:27 well, long enough anyways 2012-01-08T14:34:29 no it was pretty easy 2012-01-08T14:34:32 just took a while 2012-01-08T14:34:34 but it was fun 2012-01-08T14:34:39 im tired by looking at the long description 2012-01-08T14:34:41 11+ functions in C++ methinks 2012-01-08T14:34:50 mcstar: well, I can explain it in a sentence 2012-01-08T14:34:53 no 2012-01-08T14:34:53 mcstar: who wins a hand of poker 2012-01-08T14:34:57 thats it :P 2012-01-08T14:35:02 i dont care 2012-01-08T14:35:07 XD 2012-01-08T14:35:27 http://projecteuler.net/project/poker.txt each line is 2 poker hands (split in the middle), count the number of times the hand on the left wins :P 2012-01-08T14:36:04 conor_f: anyway, that's the perfect place to use std::unordered_map 2012-01-08T14:36:38 for the problem I just did or the poker one? 2012-01-08T14:36:44 I ended up making cards_by_suit and cards_by_value for each hand 2012-01-08T14:36:46 conor_f: the poker one 2012-01-08T14:37:25 anyway I'm going to rewrite it in C++ for fun 2012-01-08T14:37:33 lol 2012-01-08T14:37:38 what did you do it in? 2012-01-08T14:37:45 python 2012-01-08T14:37:52 ah 2012-01-08T14:37:56 takes 50ms anyway 2012-01-08T14:38:09 I need to do one more problem tonight :@ 2012-01-08T14:38:17 just want to get to level 1 lol :P 2012-01-08T14:39:09 I need to do 1 more for level 3 but I'm too lazy 2012-01-08T14:39:17 lol 2012-01-08T14:39:32 first level 1, then catch up with rwest_ ;) 2012-01-08T14:39:49 I "solved" 51 but it was taking more than 10s so I cancelled it 2012-01-08T14:40:10 lol 2012-01-08T14:40:16 I thought the limit was 1 minute? 2012-01-08T14:40:52 I'm not that patient 2012-01-08T14:41:27 *** aeter has joined #aichallenge 2012-01-08T14:41:55 22 shouldn't be too bad 2012-01-08T14:42:26 oh, that one was easy 2012-01-08T14:42:33 it's a one liner in python 2012-01-08T14:42:53 Yeah, pretty easy 2012-01-08T14:42:56 most of the ones I've done are just a single list comprehension thing though 2012-01-08T14:43:15 maybe 2-3 nested ones 2012-01-08T14:43:33 Nice work, strcat, you've just advanced to Level 3. 2012-01-08T14:43:35 :) 2012-01-08T14:43:48 ./solution.py 6.31s user 0.11s system 99% cpu 6.423 total 2012-01-08T14:43:51 anyway it was only 6s 2012-01-08T14:44:01 in pypy 2012-01-08T14:44:19 in cpython, it's 45s 2012-01-08T14:45:21 thestinger: that's #51 ? 2012-01-08T14:45:41 yeah, I did it a really stupid way 2012-01-08T14:46:00 Like 97, I read the forums with some guys whining 2012-01-08T14:46:29 *** dr- has quit IRC (Ping timeout: 240 seconds) 2012-01-08T14:46:33 pairofdice: lol? 97? 2012-01-08T14:46:38 that's just ipowmod 2012-01-08T14:46:48 print(str(28433*(2**7830457)+1)[-10:]) 2012-01-08T14:46:49 built-in in python, but easy to code in C 2012-01-08T14:47:02 pairofdice: pow(base, exp, mod) 2012-01-08T14:47:07 it's an optional third argument 2012-01-08T14:47:11 does modular exponentiation 2012-01-08T14:47:34 ../../archive/euler/97/solution.py 0.04s user 0.01s system 72% cpu 0.073 total 2012-01-08T14:47:46 in C, it takes 0ms 2012-01-08T14:47:54 well, in between 0 and 1ms 2012-01-08T14:48:32 pairofdice: http://sprunge.us/UVdg <- I have both ipow and ipowmod in C++ 2012-01-08T14:48:35 so you can see how it works 2012-01-08T14:49:01 just an extra % mod with each step 2012-01-08T14:49:36 limit = 10**10 2012-01-08T14:49:39 print((28433 * pow(2, 7830457, limit) + 1) % limit) 2012-01-08T14:49:43 anyway I just did that in python 2012-01-08T14:50:39 *** Kingpin13 has quit IRC (Quit: quit) 2012-01-08T14:51:09 anyway you can definitely do them all in python, I'm just not smart enough 2012-01-08T14:51:14 had to brute force a few in C++ 2012-01-08T14:51:25 anyway, im disapointed in haskell's set 2012-01-08T14:51:31 What are you guys talking about? 2012-01-08T14:51:47 IntMap is fast though 2012-01-08T14:51:51 but the others suck 2012-01-08T14:52:09 cYmen: Project Euler 2012-01-08T14:52:13 Data.Set and Data.Map are ordered 2012-01-08T14:52:34 they still should be very fast 2012-01-08T14:52:56 n is much worse than logn 2012-01-08T14:53:39 problem 23 takes a minute in haskell 2012-01-08T14:53:45 Anyway, many of these are oneliners in python, even for me 2012-01-08T14:53:54 lol, itertools and functools have so much stuff I've coded myself 2012-01-08T14:54:08 http://docs.python.org/py3k/library/itertools.html 2012-01-08T14:54:15 takewhile, dropwhile, etc. 2012-01-08T14:54:16 I am pleased with myself - I managed to do problem 355 which feels like the first hard one I have managed. 2012-01-08T14:54:34 nobody messing with the asteroids teststuff yet? 2012-01-08T14:55:13 error: conversion from ‘const char [7]’ to non-scalar type ‘std::vector >’ requested 2012-01-08T14:55:32 *** Kingpin13 has joined #aichallenge 2012-01-08T14:56:25 anyone know whats wrong with that? the line is where I try to initialize a vector of strings with names.txt. A file containing names in this format: "name", "name2", "name3" 2012-01-08T14:56:30 conor_f: what are you trying to do? 2012-01-08T14:56:37 show us the code 2012-01-08T14:56:53 cYmen: this channel became some pointless code showoff place 2012-01-08T14:57:05 otherwise would be silence, so this is still better 2012-01-08T14:57:51 :p 2012-01-08T14:57:57 http://codepad.org/mgrVufYH 2012-01-08T14:58:02 is the code thestinger 2012-01-08T14:58:19 mcstar: it was all silence for a bad length of time :P 2012-01-08T14:58:40 well, first of all 2012-01-08T14:58:48 read it in from names.txt lol 2012-01-08T14:58:51 I came here and it was just you and UncleVasya talking. The logs for the day were like, 6 screens of people leaving and joining lol 2012-01-08T14:58:54 thestinger: :/ 2012-01-08T14:58:59 this way seemed easier :P 2012-01-08T14:59:23 oh, spaces >_< I bet thats it 2012-01-08T14:59:24 {"name1","name"....} 2012-01-08T14:59:31 {} 2012-01-08T14:59:33 {} 2012-01-08T14:59:34 *** amstan has joined #aichallenge 2012-01-08T14:59:34 *** ChanServ sets mode: +o amstan 2012-01-08T14:59:37 mcstar: thats for initialising an array ;) 2012-01-08T14:59:43 no 2012-01-08T14:59:48 thats an initialization list 2012-01-08T15:00:02 you cant initilize multiple items that way in '03 2012-01-08T15:00:08 but you can use my method in '1 2012-01-08T15:00:11 '1 2012-01-08T15:00:12 he's also using () 2012-01-08T15:00:14 '111111111 2012-01-08T15:00:17 '11 2012-01-08T15:00:21 my keyboard is broken 2012-01-08T15:00:22 http://codepad.org/W7qWiw08 2012-01-08T15:00:42 conor_f: just read it in from the file like it says :P 2012-01-08T15:00:54 conor_f: -std=c++0x 2012-01-08T15:00:59 for gcc ofc 2012-01-08T15:01:05 I'm using g++? 2012-01-08T15:01:10 same 2012-01-08T15:01:12 kk 2012-01-08T15:01:19 Gnu Compiler Collection 2012-01-08T15:01:23 you can compile with gcc anyway 2012-01-08T15:01:45 you guys seem to be having too much fun with projecteuler.. maybe i shoul 2012-01-08T15:01:53 should give it a try 2012-01-08T15:02:41 srgpqt: do :) 2012-01-08T15:04:13 *** Accoun has quit IRC () 2012-01-08T15:04:45 anyway you can do 'gcc -o test test.cc -lstdc++ -lm' and it's basically the same as g++ :P 2012-01-08T15:04:57 really? 2012-01-08T15:05:00 yes 2012-01-08T15:05:02 no i mean 2012-01-08T15:05:04 really? 2012-01-08T15:06:00 i probably turn HighPerfomanceHaskell into SlowPerm.... 2012-01-08T15:06:18 lol getting a negative answer 2012-01-08T15:06:24 thestinger: can you do #23 run fast in haskell? 2012-01-08T15:06:38 whatever i do, its still a minute 2012-01-08T15:07:01 well, if Set is the bottleneck then no 2012-01-08T15:07:09 abundants = set(filter(is_abundant, range(12, MAX))) 2012-01-08T15:07:12 I do that in python 2012-01-08T15:07:18 oh shiiiiit 2012-01-08T15:07:24 itertools has permutations 2012-01-08T15:07:30 yes, and combinations 2012-01-08T15:07:35 and they're faster than my hand-coded ones 2012-01-08T15:07:40 also functools is good too 2012-01-08T15:08:13 functools.partial lets you make partial functions 2012-01-08T15:08:14 i tried with Set, IntMap 2012-01-08T15:08:56 http://sprunge.us/DcaK pointless example 2012-01-08T15:09:04 pairofdice: you're using python3, right? 2012-01-08T15:09:23 yeah 2012-01-08T15:09:31 map, filter, reduce, range, etc. are all generators in py3, so you can write code that uses laziness very easily 2012-01-08T15:09:58 you have to write some helper functions though, but then you can treat generators like haskell lists 2012-01-08T15:11:34 if only tuple unpacking was lazy 2012-01-08T15:13:02 woot :D 2012-01-08T15:13:32 I am of the 18.28% of people on PE who have made to level 1 :P 2012-01-08T15:13:56 #23 takes me 1s at 1.7GHz, but somehow it's giving me the wrong result. Those off-by-one errors can be tricky. 2012-01-08T15:14:16 weird how there are so many people but only 36658 have done >= 25 problems :/ 2012-01-08T15:14:22 nice article http://www.haskell.org/haskellwiki/Performance/Strictness 2012-01-08T15:15:48 *** Kurnevsky has quit IRC (Quit: Instantbird 1.0) 2012-01-08T15:16:38 *** pairofdice has quit IRC (Quit: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.) 2012-01-08T15:20:42 *** Accoun has joined #aichallenge 2012-01-08T15:32:51 *** Chris_0076 has quit IRC (Quit: Leaving) 2012-01-08T15:33:42 should give it a try 2012-01-08T15:33:57 on problem 3 now :P 2012-01-08T15:34:34 *** chris_0076 has joined #aichallenge 2012-01-08T15:37:59 ok, this is me out 2012-01-08T15:38:14 I'm only going to be on for like an hour a day any more lol :( 2012-01-08T15:38:27 I miss holidays already lol 2012-01-08T15:38:32 ttyl #aichallenge 2012-01-08T15:38:34 *** conor_f has quit IRC (Quit: leaving) 2012-01-08T15:49:58 *** mcstar has quit IRC (Quit: mcstar) 2012-01-08T15:50:22 *** iglo has joined #aichallenge 2012-01-08T15:57:05 X-Scale: what do I have to do to see the result for #23 ? 2012-01-08T16:08:03 I've finally solved it. *sigh* 2012-01-08T16:09:06 680ms @ 1.7GHz 2012-01-08T16:09:49 in which language? 2012-01-08T16:09:54 C 2012-01-08T16:10:06 I can be more optimized 2012-01-08T16:10:30 Specially the final step where you find all the number that can be the sum of two abundant numbers 2012-01-08T16:10:35 yeah, I need to write a better function for finding divisors 2012-01-08T16:10:52 numbers* 2012-01-08T16:11:12 ah...that part is interesting, thestinger 2012-01-08T16:11:16 *** chris_0076 has quit IRC (Ping timeout: 276 seconds) 2012-01-08T16:12:41 It always end up in a compromise between time and space 2012-01-08T16:13:05 well, you can get divisors by taking all the products of prime factors 2012-01-08T16:13:14 24 is 2 2 2 3 2012-01-08T16:13:55 so 2, 3, 6 = 2*3, 8 = 2*2*2, 12 = 2*2*3, 24 = 2*2*2*3 2012-01-08T16:14:03 and factorization can be done really fast 2012-01-08T16:14:03 Exactly. But I avoid doing to many calculations like the plague. So, I didn't calculate the prime factors 2012-01-08T16:14:24 yeah, I didn't do it for that one 2012-01-08T16:14:32 I need to write a better factorize function first 2012-01-08T16:14:38 atm it uses a sieve, which is wasteful 2012-01-08T16:14:45 I need to try one of the proper mathematical methods 2012-01-08T16:17:02 *** Blkt has quit IRC (Ping timeout: 252 seconds) 2012-01-08T16:19:29 For instance. Right now, just by moving half an abundant number check from inside to outside of a for loop, the algorithm improved 3 times. These little details can make a huge difference. It went from 680ms to 210ms @ 1.7GHz 2012-01-08T16:20:08 *** Palmik has quit IRC (Remote host closed the connection) 2012-01-08T16:22:30 *** kilae has quit IRC (Quit: ChatZilla 0.9.88 [Firefox 9.0.1/20111220165912]) 2012-01-08T16:22:44 What language are you using, thestinger ? 2012-01-08T16:24:33 mostly python (coded in a pretty functional way), but also C++ and haskell 2012-01-08T16:24:42 sometimes I write a few solutions to each problem 2012-01-08T16:26:10 Most the the python/haskell solutions I see on the PE threads are pretty slow. But normally there is one or two guys that manage to make some blazingly fast solutions in those two languages, which is pretty amazing. 2012-01-08T16:27:43 haskell isn't really very slow 2012-01-08T16:30:50 anyway, my python solutions aren't slow either 2012-01-08T16:31:03 if you use the proper algorithm, they're all under 5s 2012-01-08T16:31:23 I can "cheat" and brute force stuff in a stupid way using C or C++ though 2012-01-08T16:31:39 I guess the difference gets more pronounced as you get to the later problems 2012-01-08T16:33:11 for example, my solution to problem 23 takes 525ms 2012-01-08T16:33:18 So...later problems favour the C/C++ approach ? 2012-01-08T16:33:48 well, lots of them look like they're just massive versions of the earlier ones 2012-01-08T16:34:14 so you could come up with an amazing algorithm, or rely on brute force and code optimization rather than making the algorithm better 2012-01-08T16:34:27 525ms using Python ? That's pretty impressive. 2012-01-08T16:35:15 not really :P 2012-01-08T16:35:27 just using trial division to find the divisors 2012-01-08T16:35:28 Makes sens 2012-01-08T16:35:28 uh.. my solution to 23 is still calculating 2012-01-08T16:35:35 sense* 2012-01-08T16:36:07 *** Anilm3 has joined #aichallenge 2012-01-08T16:36:11 ... 2012-01-08T16:37:24 how bad can it be.. three nested loops over 28123 numbers 2012-01-08T16:37:29 lol 2012-01-08T16:37:35 hehe 2012-01-08T16:37:37 mleise: how are you getting divisors? 2012-01-08T16:38:02 mleise: it can get 28123^3 as bad 2012-01-08T16:38:03 that's not the problem 2012-01-08T16:38:36 well, I calculated all the abundant numbers in the range 2012-01-08T16:38:46 me too 2012-01-08T16:39:13 yeah, but then it's just O(1) to check if a number is abundant 2012-01-08T16:39:23 unless you're doing a linear search over an array 2012-01-08T16:39:28 like so http://codepad.org/7i35Jv6G 2012-01-08T16:39:30 or a binary search 2012-01-08T16:40:06 mleise: you're checking more than you have to 2012-01-08T16:40:17 4179871 ! in 140 seconds 2012-01-08T16:40:20 checking up to n/2 finds all the divisors 2012-01-08T16:40:30 you only need to find the lower half, since they come in pairs 2012-01-08T16:40:38 so you can check up to sqrt(n) 2012-01-08T16:41:01 4179871 2012-01-08T16:41:02 ./solution.py 0.49s user 0.03s system 99% cpu 0.520 total 2012-01-08T16:41:04 :P 2012-01-08T16:42:53 Nice 2012-01-08T16:43:02 I can optimize my code a bit and then it will be 300x faster, ok? 2012-01-08T16:43:12 that should be close to your results 2012-01-08T16:44:42 *** Anilm3 has quit IRC (Quit: Lost terminal) 2012-01-08T16:47:48 *** sashaSochka has quit IRC (Quit: Page closed) 2012-01-08T16:49:23 http://projecteuler.net/thread=23 2012-01-08T16:49:31 It's a nice reading. 2012-01-08T16:52:21 I do it like alvaro's post but I use a set (unordered hash based set) instead of a bool/bit array (since it's python) 2012-01-08T16:53:39 oh hm 2012-01-08T16:53:47 I do it a bit differently 2012-01-08T16:54:34 I love how the first post in the forums is often someone who did it in assembly 2012-01-08T16:56:46 anyway, I'm stuck on a few problems because I can't get divisors fast enough 2012-01-08T16:56:50 I need to learn how to do it properly 2012-01-08T17:02:54 I still need a deeper grasp on -> http://en.wikipedia.org/wiki/Euclid's_algorithm 2012-01-08T17:07:21 The issue I have with finding the divisors of sucessive numbers is that it makes me feel I'm repeating a lot of useless work. 2012-01-08T17:07:36 If I do it the traditional way, that is. 2012-01-08T17:08:25 yea 2012-01-08T17:08:31 132 seconds, im getting closer 2012-01-08T17:10:01 I rewrote mine in C++ because I'm trying to work on the fast prime factorization now 2012-01-08T17:13:04 oh neat, random useful fact 2012-01-08T17:13:20 all numbers above 20161 can be written as abundant numbers :P 2012-01-08T17:13:32 s/written/expressed/ 2012-01-08T17:14:44 yep 2012-01-08T17:14:58 but you cannot know this, so your program must check them all up to 28123 2012-01-08T17:15:25 90 seconds, catching up 2012-01-08T17:15:31 makes no real difference in speed anyway 2012-01-08T17:16:34 36ms with 28123 as the limit, 21ms with 20161 2012-01-08T17:17:52 Newer processor archs make a big difference too. I'm still using an old Pentium-M at 1.7GHz from 2005. 2012-01-08T17:18:13 There was one guy that was spreading the workload on several cores, using OpenMP 2012-01-08T17:18:22 ah 2012-01-08T17:19:12 yeah, and gcc has -ftree-parallelize-loops 2012-01-08T17:19:13 He got around 10ms. Some of these problems would get a huge boost using OpenCL on a proper GPU. 2012-01-08T17:22:30 *** dmj111 has joined #aichallenge 2012-01-08T17:24:04 *** thagomizr has joined #aichallenge 2012-01-08T17:28:53 *** sigh has quit IRC (Remote host closed the connection) 2012-01-08T17:34:53 *** choas has quit IRC (Ping timeout: 255 seconds) 2012-01-08T17:35:37 *** amstan has quit IRC (Quit: Konversation terminated!) 2012-01-08T17:40:59 *** aeter has quit IRC (Quit: Leaving.) 2012-01-08T17:45:59 20,3 seconds... 2012-01-08T17:50:46 :) 2012-01-08T17:50:53 *** g0llum has quit IRC (Read error: Connection reset by peer) 2012-01-08T17:52:31 *** amstan has joined #aichallenge 2012-01-08T17:52:31 *** ChanServ sets mode: +o amstan 2012-01-08T17:57:01 *** TheLinker has quit IRC (Quit: Bye) 2012-01-08T18:01:09 *** JorgeB has joined #aichallenge 2012-01-08T18:10:25 95ms :) 2012-01-08T18:10:46 wow 2012-01-08T18:10:58 python ? 2012-01-08T18:16:44 no, native code 2012-01-08T18:17:03 Core 2 Duo notebook @2Ghz 2012-01-08T18:17:42 now I need a fast factorization routine 2012-01-08T18:19:51 mleise: http://sprunge.us/aPSZ that was my crappy brute force trial division method 2012-01-08T18:20:03 you don't need the factors to calculate the sum though 2012-01-08T18:21:14 doesn't that add the square roots twice? 3 in the case of 9 2012-01-08T18:21:26 yes 2012-01-08T18:21:28 {} is a set though 2012-01-08T18:21:33 ah i see 2012-01-08T18:21:35 well 2012-01-08T18:21:38 {} is actually a dict 2012-01-08T18:21:43 but {1,2,3} is a set 2012-01-08T18:22:00 weird quirk of the language since a dict is {1:"something", 2:"bla"} 2012-01-08T18:22:25 you would be faster if the runtime didn't have to check for duplicates 2012-01-08T18:22:41 well, it doesn't 2012-01-08T18:22:49 it's hash based, so it just overwrites the old one 2012-01-08T18:23:03 anyway that's not really a good way to do it 2012-01-08T18:23:14 I think you can just get all the factors from the prime factors 2012-01-08T18:23:31 and I don't think you need to do a powerset either 2012-01-08T18:23:44 24 -> 2 2 2 3 2012-01-08T18:24:31 then you cycle through the prime factors and keep dividing until it gives a remainder 2012-01-08T18:24:38 not really sure about the best way to do that 2012-01-08T18:25:37 so you start with 2: 24 / 2 = 12, 12 / 2 = 6, 6 / 2 = 3 and then 3 / 3 = 1 2012-01-08T18:26:29 anyway, something like that 2012-01-08T18:30:45 with combinatorics you can calculate how many different divisions are possible, but not their results :D 2012-01-08T18:33:09 *** ikaros has quit IRC (Quit: Ex-Chat) 2012-01-08T18:37:03 *** iglo has quit IRC (Quit: .) 2012-01-08T18:41:00 *** grwip has quit IRC (Quit: Leaving) 2012-01-08T18:48:40 *** Fandekasp has joined #aichallenge 2012-01-08T18:52:49 *** Redgis has quit IRC (Ping timeout: 240 seconds) 2012-01-08T18:54:32 *** epicmonkey has quit IRC (Ping timeout: 260 seconds) 2012-01-08T19:05:26 *** AlliedEnvy_ has joined #aichallenge 2012-01-08T19:05:33 *** AlliedEnvy has quit IRC (Read error: Connection reset by peer) 2012-01-08T19:30:57 *** foRei has quit IRC (Read error: Connection reset by peer) 2012-01-08T19:52:30 65ms... this is getting harder 2012-01-08T20:16:04 lol, I was using a templated to_string function with a stringstream (in C++), and it was slower than converting to a string in python... 2012-01-08T20:16:47 boost::lexical_cast (at least in 1.48) is actually optimized for specific cases so it's faster... but it's still slower than it should be 2012-01-08T20:30:43 thestinger: what's wrong with ss.string? 2012-01-08T20:30:47 ss.string()* 2012-01-08T20:31:12 slower than python 2012-01-08T20:31:38 http://sprunge.us/daCT I was doing that 2012-01-08T20:31:49 incredibly slow, it was the bottleneck in something where it really shouldn't have been 2012-01-08T20:32:56 and I really mean it is _slow_ 2012-01-08T20:33:02 it's slower than str() in cpython... 2012-01-08T20:33:13 at least for integers 2012-01-08T20:33:54 ./solution 0.16s user 0.00s system 99% cpu 0.158 total 2012-01-08T20:34:01 with the to_string function in that paste 2012-01-08T20:34:13 ./solution 0.02s user 0.00s system 96% cpu 0.024 total 2012-01-08T20:34:24 with boost::lexical_cast() 2012-01-08T20:35:04 stringstreams are really slow. 2012-01-08T20:35:11 they are dynamically allocated, and then you feed data into them 2012-01-08T20:35:18 and then _copy_ the data into new string 2012-01-08T20:35:30 interesting 2012-01-08T20:35:37 and you feed the data into them with operator<<, which is pretty slow for that purpose 2012-01-08T20:35:39 i wonder if they're the problem with my process struct 2012-01-08T20:35:51 boost::lexical_cast has special cases for things like ints 2012-01-08T20:36:24 anyway, I was really surprised about how slow my to_string function was 2012-01-08T20:36:30 stupid stringstreams... 2012-01-08T20:37:59 http://en.cppreference.com/w/cpp/types/numeric_limits/digits anyway boost uses this for a statically allocated buffer to hold the string for ints 2012-01-08T20:55:17 *** CIA-92 has quit IRC (Ping timeout: 268 seconds) 2012-01-08T21:13:39 *** Chris_0076 has joined #aichallenge 2012-01-08T21:22:40 *** TheLinker has joined #aichallenge 2012-01-08T21:22:50 *** CIA-45 has joined #aichallenge 2012-01-08T21:26:06 *** JorgeB has quit IRC (Ping timeout: 244 seconds) 2012-01-08T21:36:03 *** deathcorps has joined #aichallenge 2012-01-08T21:44:31 *** dorisabayon has joined #aichallenge 2012-01-08T21:47:17 *** Fandekasp has quit IRC (Ping timeout: 244 seconds) 2012-01-08T22:00:45 *** deathcorps has quit IRC () 2012-01-08T22:30:01 thestinger: 33ms, huh! I've heard there is also an optimization that filters out odd or even numbers. 2012-01-08T22:50:12 assembly ftw :) 2012-01-08T22:51:08 are you using rdtsc to profile the crucial loops ? 2012-01-08T22:51:52 no, I used oprofile to get the overview and then two timers in the code 2012-01-08T22:51:59 there isn't really much to test 2012-01-08T22:52:20 the prime number generation is the most simple algorithm i could come up with for example 2012-01-08T22:53:28 whats funny is, that I get down to 0ms, if I execute the program at compile time and just print the result 2012-01-08T22:54:00 I really need variable input to feel a need to move anything to runtime 2012-01-08T22:54:36 yeah, not having a variable input takes the motivation out of optimizing 2012-01-08T22:56:02 and ofc D lets you move anything to compile time easily 2012-01-08T22:56:38 yep, it doesn't even look like a big change in the code 2012-01-08T22:56:49 in C++ you can use constexpr now, but not without C++11 support 2012-01-08T22:57:06 and you have to write your code functionally for constexpr to work 2012-01-08T23:01:22 *** raemde_ has joined #aichallenge 2012-01-08T23:05:09 *** raemde has quit IRC (Ping timeout: 248 seconds) 2012-01-08T23:12:49 *** mleise has quit IRC (Ping timeout: 240 seconds) 2012-01-08T23:15:48 *** CowTipperVirus has joined #aichallenge 2012-01-08T23:16:24 @seen janzert 2012-01-08T23:16:24 CowTipperVirus: janzert was last seen in #aichallenge 1 day, 3 hours, 10 minutes, and 39 seconds ago: @later tell cowtippervirus sorry, I must not have been clear. The engine warnings/errors and bot stderr output are recorded together. They just aren't being displayed to the user unless the bot crashed/timed out/issued an invalid move 2012-01-08T23:18:46 @later tell janzert Great. One possible flaw in that, you said that I should see that if I issued an invalid move? I'm aware that my bot throws invalid moves a lot. If a food spawns next to an ant, it tries to move to it (as opposed to staying put). The game engine returns a "move blocked" message, like the one you posted in your screenshot. Is that considered an invalid move? If so, I'm not able to see such warnings 2012-01-08T23:18:46 CowTipperVirus: Ready to serve, my lord. 2012-01-08T23:19:18 contestbot: lol, you're overly-complimentary... 2012-01-08T23:19:19 CowTipperVirus: No! 2012-01-08T23:24:41 yeah, it's the game end state would have to be invalid and I think may actually only be in play for the initial upload test game 2012-01-08T23:24:56 which of course the replay never gets recorded for anyway 2012-01-08T23:25:09 *** mleise has joined #aichallenge 2012-01-08T23:25:15 janzert: ok, thanks 2012-01-08T23:25:44 or hmm, maybe sending garbage to the engine (i.e. something it can't parse at all) would trigger it in a regular game too 2012-01-08T23:25:51 janzert: Yeah, returning that small snippet of warnings and std err output to the players would go a long way 2012-01-08T23:26:28 janzert: wouldn't that just boot you out of the game though? 2012-01-08T23:26:56 right, and give you an end status of invalid 2012-01-08T23:27:17 ok 2012-01-08T23:27:20 it is displayed for games where the player ended with 'crashed', 'timeout' or 'invalid' 2012-01-08T23:27:41 ok, yeah, that makes sense then 2012-01-08T23:27:43 *** McLeopold has joined #aichallenge 2012-01-08T23:28:34 well, if you decide (as you initially pondered) to open that up no matter the end result of the game, I would certainly appreciate it and use that for debugging 2012-01-08T23:29:07 *** thestinger has quit IRC (Quit: sleep) 2012-01-08T23:29:22 not perfect, but it's already in place, and certainly better than what we have now