--- Log opened Sun Nov 14 00:00:42 2010 |
00:01 | | Taki^ [ikat@Nightstar-0816732d.consolidated.net] has quit [Ping timeout: 121 seconds] |
00:18 | | Attilla [Some.Dude@Nightstar-d191149c.threembb.co.uk] has joined #code |
00:18 | | mode/#code [+o Attilla] by Reiver |
00:20 | | You're now known as TheWatcher[T-2] |
00:24 | | You're now known as TheWatcher[zZzZ] |
01:49 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
01:52 | | Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Connection closed] |
01:57 | | NSJavaGuest-9752 [nsJChat@Nightstar-2d1aa47d.pa.comcast.net] has joined #code |
01:57 | < NSJavaGuest-9752> | Hello, |
01:58 | < NSJavaGuest-9752> | Anyone there? |
01:58 | <@Derakon> | No. |
01:58 | < NSJavaGuest-9752> | Oh hey Derakon |
01:59 | | NSJavaGuest-9752 is now known as Chicken |
01:59 | < Chicken> | :) |
01:59 | < Chicken> | It's quiet, anyone wanna chat. |
02:00 | < Chicken> | you dont love me D: |
02:00 | | Chicken [nsJChat@Nightstar-2d1aa47d.pa.comcast.net] has quit [[NS] Quit: Nightstar's Java Chat http://www.nightstar.net] |
02:00 | <@Derakon> | Dang kids and their need for instant gratification |
02:00 | <@Derakon> | And, for that matter, random chat in a purpose-built channel~ |
02:02 | < celticminstrel> | ... |
02:07 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?] |
02:10 | <@Derakon> | "All this mess will hopefully go away pretty soon when we move to C99 types. It's a shame, I like Angband header files being fun little logic puzzles..." |
02:10 | <@Derakon> | From a thread discussing the following lines of C: |
02:10 | <@Derakon> | #undef bool |
02:10 | <@Derakon> | #define bool bool_hack |
02:10 | <@Derakon> | typedef char bool; |
02:12 | < celticminstrel> | ...what on earth is that for? |
02:12 | <@Derakon> | At a guess, to deal with different interpretations of the keyword "bool" on different compilers? |
02:13 | <@Derakon> | Especially e.g. to keep savefiles of the same size. |
03:04 | | Anno[Laptop] [annodomini@Nightstar-520aa444.adsl.tpnet.pl] has quit [[NS] Quit: Sleep.] |
03:15 | | Attilla [Some.Dude@Nightstar-d191149c.threembb.co.uk] has quit [[NS] Quit: ] |
03:24 | | Vornicus-Latens is now known as Vornicus |
03:44 | | * Derakon eyes http://www.youtube.com/watch?v=NszGurDUlHc&feature=player_embedded and can see Reiver's point. |
03:44 | <@Derakon> | Mischan. |
04:39 | | SmithKurosaki [Smith@Nightstar-8ff23d84.dsl.teksavvy.com] has joined #code |
04:40 | | kaura [kaura@Nightstar-fd82400d.snfc21.sbcglobal.net] has joined #code |
04:40 | < kaura> | Avast! |
04:41 | <@Vornicus> | Howdy. |
04:43 | <@Vornicus> | I have completely forgotten where we were. |
04:46 | < kaura> | I have too. Lemme look at my notes. |
04:48 | <@Vornicus> | I recall we had lexed the string into tokens, and that we had written our operator precedence dictionary, but beyond that... |
04:50 | < kaura> | Yes, something like that. Now I just need to recall the filename~ |
04:51 | < kaura> | Oh, right, Pycalc! |
04:52 | <@Vornicus> | Pretty sure we were starting work on the actual thing that figures out what it means, which means we had a paste about what to do in each situation. |
04:53 | < kaura> | I'd pastebin what we had so far, but pastebin apparently hates me right now. |
04:55 | <@Vornicus> | Not just you. And it looks like my rules paste has gone the way of the dodo, so I have to find it again. |
04:57 | < kaura> | Here we go. http://pastebin.starforge.co.uk/438 |
04:59 | <@Vornicus> | Ah, perfect. |
05:00 | <@Vornicus> | All right, so. We want to actually write evaluate now. |
05:00 | < kaura> | ...damn, I think I took too long a break. |
05:00 | <@Vornicus> | Probably. |
05:01 | <@Vornicus> | So let's look over what we've already written, first, and see if we can figure out what it's doing. |
05:02 | <@Vornicus> | I guess a good place to start is "rollone" - what's it do? |
05:05 | < kaura> | Returns an integer based off a number we set that represents the number of faces on the die. |
05:06 | <@Vornicus> | All right, and roll? |
05:07 | < kaura> | Hm. Returns the sum of a set of randomized outputs, all with the same number of "sides." |
05:08 | <@Vornicus> | Good. Okay, and lex? |
05:08 | <@Vornicus> | (one line at a time.) |
05:12 | < kaura> | Lesse. Strips the whitespace out of an input, dumping the result into "symbols"... |
05:12 | < kaura> | Does a search against the regex string. |
05:13 | < kaura> | If found, it appends to... ...actually, yeah, don't quite remember this part. |
05:14 | <@Vornicus> | ok, let's look at it for a moment. Actually i see a couple errors in here. Ones that, were we able to run the code, we'd notice immediately. |
05:16 | <@Vornicus> | 61: expr = self.expr_string.lstrip(), instead of what's there. This prevents you from stomping on self (which is the original object's name), and gets the thing we're actually dealing with to be local. |
05:17 | <@Vornicus> | What it /does/ is it takes self.expr_string, chops off any starting whitespace, and assigns it to expr. |
05:17 | <@Vornicus> | (now we also have to change most references to "self" in here to "expr" |
05:17 | <@Vornicus> | 62... makes an empty list that we're calling "symbols" |
05:19 | <@Vornicus> | 63: replace "self" with "expr" again; loop until we're out of expression to deal with. |
05:19 | <@Vornicus> | 64: run a regex match. |
05:20 | <@Vornicus> | This assigns the match object to "match". |
05:20 | <@Vornicus> | (again replace self with expr on 64. Also in 68, both times. Indent 69 one level) |
05:21 | <@Vornicus> | So far so good. What's 65 do? |
05:21 | < kaura> | If it isn't found in the regex, it tosses up an error flag. |
05:22 | <@Vornicus> | Good good. Okay, 67? |
05:24 | < kaura> | yeah, I forgot what x.group() does. |
05:24 | | cpux [chatzilla@Nightstar-c978de34.dyn.optonline.net] has quit [[NS] Quit: ChatZilla 0.9.86 [Firefox 3.6.12/20101026210630]] |
05:25 | < kaura> | It looks as if it takes everything stripped out and appends it to Symbols |
05:26 | <@Vornicus> | It takes the thing it found and appends it to symbols; |
05:26 | <@Vornicus> | 68 on the other hand manipulates expr. What's it do? |
05:28 | < kaura> | You know, that's about where I really got stumped. I think match.end() checks from the end of the list, but I don't know why there's a colon there. |
05:28 | <@Vornicus> | match.end() actually returns the index in the string of the last character of the match. |
05:29 | <@Vornicus> | and it's in an array slicing. Do yourself a favor, try "abcde"[2:] in the terp. |
05:30 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
05:31 | < kaura> | ...bwah, syntax error. |
05:31 | < kaura> | Over a colon in U_DICT. Bwah? |
05:31 | < kaura> | Oh, nm. |
05:31 | <@Vornicus> | Put commas after each value. "+": "u+", |
05:31 | < kaura> | Yeah, saw that. |
05:32 | <@Vornicus> | (that one occasionally sneaks up on me, too.) |
05:34 | < kaura> | Ahhh, I see now. |
05:35 | <@Vornicus> | What we're actually doing here is removing the symbol we found from expr, so that naxt time through... |
05:36 | | * Vornicus thinks kaura can figure out what happens next time through. |
05:37 | | cpux [chatzilla@Nightstar-c978de34.dyn.optonline.net] has joined #code |
05:39 | < kaura> | Right, the next part was to basically cycle through the expressions, removing them as it processes them, right? ...or something like that? |
05:40 | <@Vornicus> | Right. Okay, and 69. |
05:40 | <@Vornicus> | (and, actually, through the symbols.) |
05:50 | < kaura> | Right, 69... defines self.symbols as the... tuple, right? ...why are we doing that again? |
05:51 | <@Vornicus> | Self.symbols exists outside the function; symbols itself does not. |
05:53 | < kaura> | Ahh. |
05:58 | <@Vornicus> | And that's that. What we have, after lex is called, is an object with both expr_string and symbols on it. Now, we can move on to evaluate. |
06:03 | <@Vornicus> | So far what we've done in evaluate is set stuff up. |
06:05 | <@Vornicus> | Now, we have to take that stuff in the text (78-end) and turn it into code. This is a lot of stuff to do in one function, but you can if you want; I've actually separated it out into four functions. |
06:08 | <@Vornicus> | (specifically: one that handles the beginning and end and dispatches stuff to the operator- and number-mode functions, the operator- and number-mode functions themselves, and the thing that actually does the evaluation.) |
06:10 | <@Vornicus> | (which I actually do entirely separately from the reading off of symbols.) |
06:24 | <@Derakon> | ...why is top using 25% of my CPU? |
06:24 | <@Derakon> | It shouldn't need anywhere near that much. |
06:25 | <@McMartin> | If there's a shit-ton of processes it keeps interrogating them all |
06:25 | <@Derakon> | ps -efwww | wc -l |
06:25 | <@Derakon> | 81 |
06:33 | <@Vornicus> | (my four functions are called, in that order: postfixize, pfi_number, pfi_operator, and eval_postfix) |
07:31 | | Derakon is now known as Derakon[AFK] |
07:50 | | Yoda [ikat@Nightstar-0816732d.consolidated.net] has joined #code |
07:56 | | Yoda [ikat@Nightstar-0816732d.consolidated.net] has quit [Ping timeout: 121 seconds] |
07:59 | | crem [moo@2D9A5E.4363FC.B8C774.D2B68F] has joined #code |
08:01 | | Yoda [ikat@Nightstar-0816732d.consolidated.net] has joined #code |
08:15 | | Yoda [ikat@Nightstar-0816732d.consolidated.net] has quit [Ping timeout: 121 seconds] |
08:19 | | Yoda [ikat@Nightstar-0816732d.consolidated.net] has joined #code |
09:06 | | Vornicus is now known as Vornicus-Latens |
09:21 | | You're now known as TheWatcher |
09:26 | | Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has joined #code |
10:15 | | Anno[Laptop] [annodomini@Nightstar-520aa444.adsl.tpnet.pl] has joined #code |
10:55 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed] |
11:06 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code |
11:24 | | Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has quit [Client closed the connection] |
11:40 | | You're now known as TheWatcher[afk] |
11:53 | | Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code |
12:14 | | Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code |
12:16 | | Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds] |
12:27 | | Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code |
13:01 | | Abu[Laptop] [annodomini@Nightstar-500a30de.adsl.tpnet.pl] has joined #code |
13:02 | | Anno[Laptop] [annodomini@Nightstar-520aa444.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds] |
13:22 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [Ping timeout: 121 seconds] |
13:23 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code |
13:41 | | Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds] |
14:10 | | Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code |
14:25 | | Attilla [Some.Dude@Nightstar-2ec6e03b.threembb.co.uk] has joined #code |
14:25 | | mode/#code [+o Attilla] by Reiver |
16:45 | | You're now known as TheWatcher |
16:46 | | Attilla [Some.Dude@Nightstar-2ec6e03b.threembb.co.uk] has quit [[NS] Quit: ] |
16:56 | | Attilla [Some.Dude@Nightstar-907836f5.threembb.co.uk] has joined #code |
16:56 | | mode/#code [+o Attilla] by Reiver |
17:07 | | Derakon[AFK] is now known as Derakon |
17:29 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
17:43 | | Attilla_ [Some.Dude@Nightstar-1dddcdb5.threembb.co.uk] has joined #code |
17:43 | | Attilla [Some.Dude@Nightstar-907836f5.threembb.co.uk] has quit [Ping timeout: 121 seconds] |
18:18 | | Abu[Laptop] is now known as Birds |
18:47 | | crem [moo@2D9A5E.4363FC.B8C774.D2B68F] has quit [[NS] Quit: Ep0xa 1.2v] |
19:26 | | Vornicus-Latens is now known as Vornicus |
19:41 | | Yoda [ikat@Nightstar-0816732d.consolidated.net] has quit [Client closed the connection] |
19:42 | | Yoda [ikat@Nightstar-0816732d.consolidated.net] has joined #code |
22:09 | | Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [Ping timeout: 121 seconds] |
22:10 | | Birds is now known as AnnoDomini |
22:38 | | Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code |
22:52 | | Attilla_ is now known as Attilla |
23:49 | | AnnoDomini [annodomini@Nightstar-500a30de.adsl.tpnet.pl] has quit [[NS] Quit: Enough.] |
--- Log closed Mon Nov 15 00:00:43 2010 |