Conversation with #inferno at Wed Nov 21 18:40:31 2012 on powerman-asdf@irc.freenode.net (irc) (18:40:31) sturgeon.freenode.net: (notice) [freenode-info] if you're at a conference and other people are having trouble connecting, please mention it to staff: http://freenode.net/faq.shtml#gettinghelp (18:57:40) raphaelsc [~raphaelsc@187-127-103-45.user.veloxzone.com.br] entered the room. (19:00:49) leetspete: powerman-asdf: bind '#U*/dev/urandom' /dev/notquiterandom (19:00:52) ***leetspete ducks (19:03:19) powerman-asdf: leetspete: interesting idea, but my game is supposed to be cross-platform as inferno, so I prefer to avoid such workarounds (19:03:50) powerman-asdf: it's still interesting, is 2 sec init time is legal behaviour, or a bug (19:04:31) leetspete: powerman-asdf: It was (mostly) a joke. :) The time required is a bit strange. (19:08:33) powerman-asdf: actually I think this can be solved in many ways. first, it looks like main issue with rand(2) is using sys->millisec() to init it, and looks like millisec doesn't differs "enough" for rand(2). I think maybe using some hash function on millisec (like md5) before feeding it to rand->init() will solve this issue and be fast enough. (19:09:38) powerman-asdf: second, I can run separate thread which will generate and buffer data from /dev/*random and provide already generated values by chan (19:15:17) leetspete: When I did Gameboy stuff, I'd usually start with a constant and then each time the title screen came up, xor each byte with the number of hsyncs between the start of the title screen and the user pressing start. Probably not much better than sys->millisec(). (19:24:49) leetspete: Nethack has a very strang PRNG. (19:25:27) leetspete: But then almost everything about that game's source is strange. But it is readable. (19:37:16) leetspete: Looks like if there's no initial seed, notquiterandom waits for "real" random data to seed it, spawning the procs to generate/gather it on first read. (19:39:07) leetspete: Might be able to get around it by spawning a thread to read a byte from notquiterandom on startup and then hoping that thread finishes before you need random data? (19:40:21) powerman-asdf: when starting new game I need it immediately (19:47:17) leetspete: powerman-asdf: Hm. Maybe spawn it at emu startup, or is your game run self-contained and that's not an option? (19:48:14) powerman-asdf: yeah, I plan to distribute it self-contained, so game starts when emu starts (19:50:10) leetspete: powerman-asdf: Do...do a 2-second animation on startup. (19:50:11) ***leetspete ducks (19:50:40) leetspete: Text-based, though, so...how much text takes 2 seconds to print? (19:50:50) leetspete: Joking. :) (19:51:01) powerman-asdf: :) (19:52:22) powerman-asdf: maybe just ask user does he willing to wait 2 seconds or not? :) and wait for his answer. (19:52:42) leetspete: haha (19:53:14) leetspete: Well, a prompt of some sort before starting the data. Ask the user's name? (19:53:20) raphaelsc: leetspete, Any segmentation violation results in a segmentation fault (SIGSEGV). However, what's the proper name which refers to page fault? I mean, Is there a specific application-level signal to page fault? (19:53:51) leetspete: raphaelsc: I don't know of a signal for page faults; they're supposed to be transparent. (19:56:10) raphaelsc: How about if someone is trying to access a Supervisor-privileged page? (19:56:59) raphaelsc: I guess most of kernels perform copy-on-write when dealing with Shared Pages. (19:57:02) leetspete: That'd be a segfault. (19:58:30) raphaelsc: Even though segmentation is "disabled" in most of current kernels, it is totally different than paging. (19:59:40) raphaelsc: leetspete, So I guess segfault is an unsuitable description. (20:01:00) raphaelsc: leetspete, By the way, How about inferno's world? haha (20:01:07) raphaelsc: There is a long time since I used it :) (20:01:25) raphaelsc: I would like to run it again on my computer haha (20:08:14) raphaelsc: leetspete, My frined told me a detailed explanation about that matter ;) (20:08:21) raphaelsc: Take a look: (20:08:21) raphaelsc: SIGSEGV happens at the application level, and page faults happen at the kernel level. Indeed, most page faults (swapping data in from disk, lazy program loading) are never experienced by a program. (20:08:43) raphaelsc: s/gave me/told me/ (20:50:17) anth_x [~a@66.231.217.87] entered the room. (20:57:56) rogpeppe1 [~rog@host-92-23-112-169.as13285.net] entered the room. (20:58:20) rogpeppe left the room (quit: Ping timeout: 264 seconds). (21:00:14) leetspete: raphaelsc: Sorry, on the phone battling the IRS. :P (21:00:26) raphaelsc: hehe (22:32:26) anth_r left the room (quit: Ping timeout: 255 seconds). (22:44:00) anth_x left the room (quit: Quit: Leaving.). (22:47:30) jbrhee left the room (quit: Quit: Leaving.). (22:57:54) rogpeppe1 left the room (quit: Ping timeout: 240 seconds). (00:01:51) rogpeppe1 [~rog@host-92-23-112-169.as13285.net] entered the room. (01:15:48) rogpeppe1 left the room (quit: Ping timeout: 265 seconds). (02:00:23) doublec_ is now known as doublec (02:00:36) doublec left the room (quit: Changing host). (02:00:36) doublec [~doublec@unaffiliated/doublec] entered the room. (02:10:42) redblue left the room (quit: Quit: "The pursuit of truth and beauty is a sphere of activity in which we are permitted to remain children all our lives." -AE). (02:52:21) raphaelsc left the room (quit: Remote host closed the connection). (03:17:09) redblue [whois@24-230-226-60.tr.cgocable.ca] entered the room. (05:03:57) raphaelsc [~raphaelsc@187-127-103-45.user.veloxzone.com.br] entered the room. (06:08:14) vsriniva1 [~me@ec2-50-112-52-254.us-west-2.compute.amazonaws.com] entered the room. (06:23:33) anth_x [~a@cpe-74-65-156-253.maine.res.rr.com] entered the room. (06:26:04) anth_x1 [~a@cpe-74-65-156-253.maine.res.rr.com] entered the room. (06:27:37) anth_x left the room (quit: Read error: Connection reset by peer). (06:51:40) anth_x1 left the room (quit: Quit: Leaving.). (07:33:12) Gegemon [~ynv@mx1.airis.ru] entered the room. (07:50:07) raphaelsc left the room (quit: Remote host closed the connection). (08:03:43) AndroUser2 [~androirc@45.sub-174-254-48.myvzw.com] entered the room. (08:12:37) anth_x [~a@cpe-74-65-156-253.maine.res.rr.com] entered the room. (08:17:11) AndroUser2 left the room (quit: Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )). (08:21:14) anth_x left the room (quit: Ping timeout: 240 seconds). (10:16:54) `jpi left the room (quit: Ping timeout: 264 seconds). (10:23:37) `jpi [~jpi@unaffiliated/pseud0cod3r] entered the room. (10:53:41) rogpeppe1 [~rog@host-92-23-112-169.as13285.net] entered the room. (12:02:29) anth_x [~a@cpe-74-65-156-253.maine.res.rr.com] entered the room. (12:10:32) anth_x left the room (quit: Ping timeout: 255 seconds). (12:46:36) rogpeppe1 is now known as rogpeppe (13:22:36) anth_x [~a@cpe-74-65-156-253.maine.res.rr.com] entered the room. (13:31:26) anth_x left the room (quit: Ping timeout: 252 seconds). (15:27:15) Gegemon left the room (quit: Remote host closed the connection). (15:27:34) Gegemon [~ynv@mx1.airis.ru] entered the room. (15:47:01) Gegemon left the room (quit: Quit: Leaving.). (16:00:57) powerman-asdf: I need data structure like 3-dimension array (to get/set things using their 3D x/y/z coordinates), which have to dynamically grow at any dimension (including negative x, y or z, because I may need to do set(10,-5,-2,something) at any time without preparatorily filling "previous" coords like (1,-1,-1)). (16:01:58) powerman-asdf: Right now I'm going in obvious brute force way, which result in somewhat ugly interface like this: (16:05:23) powerman-asdf: http://pastebin.com/qqiRL0qT (16:06:17) anth_x [~a@cpe-74-65-156-253.maine.res.rr.com] entered the room. (16:07:13) powerman-asdf: it may be less ugly if limbo allow syntax like this: (16:07:13) powerman-asdf: data: ref Growing[ref Growing[ref Growing[ref MyData]]]; (16:07:13) powerman-asdf: but it complains about poly adt can't be param of poly adt (16:08:02) powerman-asdf: is there any other, simpler solutions to this? maybe some other data structures? (16:08:54) powerman-asdf: I was also thinking about using hash with keys like "x:y:z", but it sounds much less efficient for large enough amount of items in hash (16:10:59) powerman-asdf: btw, testing this Growing is fun - a lot of off-by-one errors is chasing after me :) (16:20:44) fdd [fdd@2a02:2f02:8029:f003::bc18:5357] entered the room. (16:20:45) fdd left the room (quit: Changing host). (16:20:45) fdd [fdd@unaffiliated/fdd] entered the room. (18:57:55) The account has disconnected and you are no longer in this chat. You will automatically rejoin the chat when the account reconnects.