--- Log opened Mon Aug 16 00:00:36 2010 |
00:33 | | You're now known as TheWatcher[T-2] |
00:33 | | Bobsentme [aa47fc22@Nightstar-4fab16c5.mibbit.com] has joined #code |
00:35 | | You're now known as TheWatcher[zZzZ] |
00:39 | | Vornicus [vorn@Nightstar-66efdaa0.ct.comcast.net] has quit [[NS] Quit: ] |
01:45 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
01:45 | | mode/#code [+o Vornicus] by Reiver |
01:51 | | Vornicus is now known as Finerty |
05:11 | | Finerty is now known as Vornicus |
05:13 | | * Derakon ponders. |
05:14 | <@Derakon> | I have a working triangulation system already. |
05:14 | <@Derakon> | Do I really need a Delaunay triangulation? |
05:14 | <@Derakon> | Given that I intend to toss most of the edges anyway. |
05:14 | <@Derakon> | Ehh. *off to CIV* |
05:21 | <@McMartin> | "Weaselry at its finest" |
05:32 | < Bobsentme> | heh |
06:06 | | Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code |
06:21 | | Rhamphoryncus [rhamph@Nightstar-bbc709c4.abhsia.telus.net] has joined #code |
06:41 | | Derakon is now known as Derakon[AFK] |
07:07 | | AnnoDomini [annodomini@Nightstar-e2bf5f44.adsl.tpnet.pl] has joined #code |
07:07 | | mode/#code [+o AnnoDomini] by Reiver |
07:52 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code |
08:07 | < Alek> | "Well, those designers sure are funny guys. Made up a sign for a hospital clinic, with a simple font by the name of 'Necropolis'." |
08:23 | | Bobsentme [aa47fc22@Nightstar-4fab16c5.mibbit.com] has quit [G-Lined: Session limit exceeded] |
08:52 | | cpux [cpux@Nightstar-20a84089.dyn.optonline.net] has joined #code |
08:55 | | shade_of_cpux [cpux@Nightstar-20a84089.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
08:55 | | cpux is now known as shade_of_cpux |
09:07 | | Alek [omegaboot@Nightstar-c5f3565b.il.comcast.net] has quit [Ping timeout: 121 seconds] |
09:09 | | You're now known as TheWatcher |
09:11 | | Alek [omegaboot@Nightstar-c5f3565b.il.comcast.net] has joined #code |
10:51 | | Orthia is now known as Reiv |
11:47 | | TarinakyKai [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code |
11:48 | | Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Operation timed out] |
11:49 | | Vornicus is now known as Vornicus-Latens |
12:30 | | Rhamphoryncus [rhamph@Nightstar-bbc709c4.abhsia.telus.net] has quit [Client exited] |
12:54 | < TarinakyKai> | Gah. I'm trying to get back into python but struggling to find something in the documentation. |
12:55 | < TarinakyKai> | The contents of Tuples are all of the same type right? What data type do I want when I want to tie together two different data as part of a structure? |
12:55 | < TarinakyKai> | A class is a bit overkill for this and I can't remember if a list would do or not. |
13:01 | <@ToxicFrog> | Pretty sure tuples are not homogenous |
13:02 | <@ToxicFrog> | >>> (1, True) |
13:02 | <@ToxicFrog> | (1, True) |
13:02 | <@ToxicFrog> | In fact, I'm pretty sure none of python's data structures are homogenous, but don't quote me on that. I know lists and tuples aren't, though. |
13:05 | < TarinakyKai> | Oh. |
13:06 | <@ToxicFrog> | (this is also the kind of thing that's probaby faster to test yourself than looking up in the docs) |
13:06 | < PinkFreud> | you sure? in perl, lists and such require scalars. if you wanted to include arrays, hashes, and other data types, you'd merely use a reference, which itself is a scalar. |
13:06 | < PinkFreud> | I'd be surprised if python didn't have a similar requirement. |
13:07 | <@ToxicFrog> | Yes, I'm quite sure. |
13:07 | <@ToxicFrog> | Python, thankfully, isn't Perl. |
13:07 | < PinkFreud> | heh |
13:08 | <@ToxicFrog> | >>> [ [1,2,3], [4,5,6], [7,8,9], True, False, { "foo": "bar" } ] |
13:08 | <@ToxicFrog> | [[1, 2, 3], [4, 5, 6], [7, 8, 9], True, False, {'foo': 'bar'}] |
13:08 | <@ToxicFrog> | ^ a list containing three lists of numbers, two booleans and a dictionary |
13:09 | < PinkFreud> | yes, but [1,2,3] would evaluate as a reference to an array, would it not? |
13:10 | < PinkFreud> | thus, you're merely throwing scalars into an array |
13:11 | < PinkFreud> | @array = ([1,2,3], {"foo" => "bar"}); |
13:11 | | * TarinakyKai hasn't touched Python and is struggling to get back in it... caught himself wondering how to create an empty dictionary in a classes __init__ |
13:11 | < PinkFreud> | that's valid perl |
13:11 | < TarinakyKai> | +in a while |
13:13 | < simon__> | PinkFreud, there isn't one syntax that returns a value and another that returns a reference for lists and dicts. |
13:14 | < simon__> | TarinakyKai, {}? or maybe you figured that out :P |
13:15 | < PinkFreud> | heh |
13:17 | < TarinakyKai> | simon__: I figured out I didn't need to. |
13:17 | < simon__> | ok |
13:17 | < TarinakyKai> | Hence the "Caught myself wondering how to do something nobody needs to do" |
13:17 | < TarinakyKai> | Because python is strange and magical :/ |
13:18 | < simon__> | I occasionally do that. |
13:18 | < simon__> | (create empty dicts and fill them) |
13:19 | < TarinakyKai> | I realised that the act of filling the dictionary will create it. |
13:19 | < TarinakyKai> | Anyway. Currently trying to work out if I can unpack a tuple in a function's argument list. |
13:20 | < TarinakyKai> | ie: def foo(self,ArgA,(ArgB,ArgC)): |
13:20 | < simon__> | tuple[0] |
13:20 | < TarinakyKai> | Although thinking about it... I probably shouldn't unpack it anyway. |
13:21 | < simon__> | oh, I don't think python is cool enough for that. |
13:22 | < simon__> | I think that would require recursive pattern matching on function arguments. |
13:24 | | Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code |
13:52 | < TarinakyKai> | Hunh. Apparently I -do- need to create empty Dictionaries before I can fill them! |
14:17 | | Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds] |
14:22 | | Netsplit *.net <-> *.split quits: @Kazriko, @McMartin, shade_of_cpux, @AnnoDomini, @jerith, Reiver |
14:23 | | Netsplit over, joins: ~Reiver, @jerith, @Kazriko, @McMartin, shade_of_cpux, @AnnoDomini |
14:24 | | mode/#code [+o Syloqs-AFH] by Reiver |
14:27 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
14:38 | < TarinakyKai> | Stupid question. If I map(operator.add,tuple1,tuple2) that returns the sum of two vectors right? |
14:39 | < TarinakyKai> | Not the sum of the permutations. |
14:40 | | Netsplit *.net <-> *.split quits: @Kazriko, @McMartin, shade_of_cpux, @AnnoDomini, @jerith, @Reiver |
14:41 | | Netsplit over, joins: ~Reiver, @jerith, @Kazriko, @McMartin, shade_of_cpux, @AnnoDomini |
14:41 | <@jerith> | I'd do [a+b for a, b in zip(tuple1, tuple2)], though. |
14:41 | < TarinakyKai> | I have no idea what that means. |
14:41 | <@jerith> | It's a list comprehension. |
14:42 | <@jerith> | Think of it as a neat syntax for a bunch of map() and filter() calls. |
14:43 | <@jerith> | zip([1,2,3], ['a','b','c']) => [(1,'a'),(2,'b'),(3,'c')] |
14:44 | <@jerith> | Listcomp syntax is basically [<transformation of item(s)> for <item(s)> in <iterable> if <predicate expression>] |
14:45 | <@jerith> | You can have multiple "if" and "for" clauses, but that starts to get a little tricky to make readable. |
14:47 | <@ToxicFrog> | PinkFreud: Python continues to be unlike Perl (or rather, Perl continues to be unlike most other things); there's no scalar/reference distinction even for things like lists which are passed by reference. |
14:48 | <@ToxicFrog> | Python's behaviour is much closer to Lua or Java than to Perl or C. |
14:48 | < Reiv> | ToxicFrog! May we ask you a favor? |
14:48 | < Reiv> | wait nm jerith got it~ |
14:48 | <@ToxicFrog> | Murr? |
14:49 | | * Reiv was hoping for someone with Scary Oper Powers to do a minor favor. |
14:49 | | * ToxicFrog pokes Python's map() with a stick. map(f, list, list) == map(f, zip(list, list)) ? |
14:49 | <@jerith> | In [1]: map(lambda a, b: a+b, [1,2,3], [4,5,6]) |
14:49 | <@jerith> | Out[1]: [5, 7, 9] |
14:50 | <@jerith> | In 2.5+, at least. |
14:50 | <@ToxicFrog> | Yeah, I just tested it in 2.6 |
14:50 | <@ToxicFrog> | Just seems weird to me. |
14:51 | <@jerith> | It doesn't hurt, and it can be useful. |
14:52 | <@jerith> | Especially since it doesn't evaluate the whole zip(). |
14:55 | | Netsplit *.net <-> *.split quits: @Kazriko, @McMartin, shade_of_cpux, @AnnoDomini, @jerith, @Reiver |
14:56 | | Netsplit over, joins: ~Reiver, @jerith, @Kazriko, @McMartin, shade_of_cpux, @AnnoDomini |
14:56 | < PinkFreud> | ToxicFrog: as you noted, Perl does tend to act like C |
14:57 | < PinkFreud> | so it's not entirely out there on it's own. :) |
14:57 | < PinkFreud> | Reiv: and what's up? |
14:57 | < celticminstrel> | But Perl doesn't have pointers, right? |
14:58 | < PinkFreud> | celticminstrel: references. |
14:59 | <@ToxicFrog> | PinkFreud: yes, but it's unusual among HLLs in that. |
14:59 | < PinkFreud> | $ perl -e '@{$a} = qw (foo bar); print "$a\n"' |
14:59 | < PinkFreud> | ARRAY(0x1905df0) |
15:00 | < PinkFreud> | ToxicFrog: I'd agree. there's not too many scripting languages that act like a lower level lang like C. |
15:02 | < PinkFreud> | or, for a way to test the type of reference in use... |
15:02 | < PinkFreud> | $ perl -e '@{$a} = qw (foo bar); print ref $a, "\n"' |
15:02 | < PinkFreud> | ARRAY |
15:19 | < TarinakyKai> | Also: Mein gotts! This task is really hard now I try and work through it :/ |
15:22 | < TarinakyKai> | I have a buffer that's generated from tiles. Rather than regenerate the contents of that buffer when it's translated, I only want to 'fetch' the bits of the buffer through loading the sides when they become empty. |
15:23 | < TarinakyKai> | Then just scrolling them into, and out of, view along with the rest of the buffer. |
15:23 | < TarinakyKai> | What I'm struggling to do is come up with a way to work out when the sides are exhausted. |
16:07 | | Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code |
16:19 | < TarinakyKai> | Things I dislike about Python #1,247: I have no idea whether anything is being passed by value or by reference. |
16:29 | <@ToxicFrog> | Er? The manual is quite clear on this, IIRC. |
16:30 | <@ToxicFrog> | Everything mutable is passed by reference; everything immutable is passed by reference internally, but since it's immutable you can't tell the difference anyways. |
16:32 | < celticminstrel> | I think the general rule is that lists, dictionaries, and objects are passed by reference; all other values (numbers, tuples, strings) are passed by value. |
16:32 | < TarinakyKai> | I meant more conceptually. |
16:33 | < TarinakyKai> | Since I don't know what a function's arguments will be. |
16:33 | < celticminstrel> | That's what type() is for? |
16:34 | < TarinakyKai> | It's a lot of work that requires a lot of thought on a lot of issues. |
16:37 | < TarinakyKai> | Can lists be turned into tuples easily? |
16:37 | < TarinakyKai> | I notice list comprehension only returns lists. |
16:38 | < celticminstrel> | Yes. tuple(x) |
16:38 | < celticminstrel> | You can use the list comprehension syntax within parentheses instead of square brackets, but I think that yields an iterator or something, not a tuple. |
16:43 | <@ToxicFrog> | TarinakyKai: what does not knowing a function's arguments have to do with pass by reference vs by value, given that everything for which it makes a difference is passed by reference? |
16:46 | < TarinakyKai> | ToxicFrog: Dynamic typing makes my skin crawl? :p |
16:47 | | * TarinakyKai blinks. I have a tuple that's refusing to be assigned... a tuple. |
16:48 | < celticminstrel> | Tuples are immutable. |
16:48 | <@ToxicFrog> | TarinakyKai: ok, but what does that have to do with pass by reference vs pass by value? |
16:48 | < TarinakyKai> | ToxicFrog: Not much. |
16:49 | < TarinakyKai> | celticminstrel: So how do I put these values into this variable. :/ |
16:49 | < TarinakyKai> | I mean... Yeah... |
16:49 | < celticminstrel> | Make it a list instead of a tuple, I'm guessing? |
16:49 | < TarinakyKai> | TypeError: 'tuple' object does not support item assignment |
16:50 | < TarinakyKai> | On line: self.tableBuffers[i][1] = TargetPosition |
16:50 | < celticminstrel> | Yeah, just make it a list instead. |
16:50 | < TarinakyKai> | Which one? |
16:50 | <@ToxicFrog> | The one that's a tuple? |
16:50 | < celticminstrel> | Yeah. |
16:50 | < TarinakyKai> | THEY'RE BOTH TUPLES |
16:51 | < celticminstrel> | Then make them both lists. |
16:51 | <@ToxicFrog> | The one you're trying to modify, then. |
16:51 | <@ToxicFrog> | You cannot modify tuples in place. |
16:51 | < celticminstrel> | You can't assign to the elements of a tuple. |
16:51 | < celticminstrel> | Lists and tuples are pretty much the same apart from that, though. |
16:51 | | * TarinakyKai blinks... |
16:51 | <@ToxicFrog> | (that would be self.tableBuffers[i] in this case) |
16:51 | < TarinakyKai> | I'm not assigning to the elements of a tuple though. |
16:52 | <@ToxicFrog> | self.tableBuffers is a tuple of tuples, though, from what you've said |
16:52 | <@ToxicFrog> | Which means that self.tableBuffers[i][1] is an attempt to assign to the first element of the tuple self.tableBuffers[i] |
16:52 | < TarinakyKai> | No. It's a dictionary actually. |
16:52 | <@ToxicFrog> | A dictionary of...? |
16:52 | < TarinakyKai> | "Oh." |
16:53 | <@ToxicFrog> | (try dropping into interactive mode and doing type(self.tableBuffers) - it'll say <type 'dict'>) |
16:53 | <@ToxicFrog> | (then do type(self.tableBuffers[i]) and it'll say <type 'tuple'>) |
16:56 | < TarinakyKai> | Right. |
16:56 | < TarinakyKai> | Now I just have to figure out why it's not scrolling. |
17:18 | | * AnnoDomini forever damns LIT conversion under Linux. |
17:19 | | * TarinakyKai boggles at the amazing refusing to change despite having values assigned to it variable. |
17:22 | | * ToxicFrog eyes TarinakyKai |
17:22 | < TarinakyKai> | Well. At least I'm getting it to throw errors now. |
17:23 | < TarinakyKai> | Wish I knew what KeyError: 1 was. |
17:23 | < Namegduf> | It means that there's no key in the dictionary equalling "1" |
17:25 | < TarinakyKai> | Ahah. Thanks. |
17:27 | < TarinakyKai> | So now it appears to not be registering keyboard events properly. |
17:36 | < TarinakyKai> | ... Why have key events stopped working. |
17:39 | <@AnnoDomini> | Infinite loop? |
17:39 | < TarinakyKai> | No. They're working now. Bizarre :/ |
17:40 | | Reiver [reaverta@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
17:41 | | Reiver [reaverta@ServerAdministrator.Nightstar.Net] has joined #code |
17:41 | | mode/#code [+qo Reiver Reiver] by ChanServ |
17:42 | <@AnnoDomini> | Sun spots. |
18:27 | | SmithKurosaki [Smith@Nightstar-cc72cefe.dsl.teksavvy.com] has joined #code |
18:33 | | TarinakyKai is now known as Tarinaky |
18:39 | | shade_of_cpux [cpux@Nightstar-20a84089.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
19:57 | | Namegduf [namegduf@Nightstar-5c10d129.beshir.org] has quit [Ping timeout: 121 seconds] |
19:57 | | Namegduf [namegduf@Nightstar-5c10d129.beshir.org] has joined #code |
21:04 | | aoanla [AndChat@7C1B03.122F4E.4B6C83.00B894] has joined #code |
21:17 | | * TheWatcher ponders what to do if a thread attempts to flush a shared cache while one or more entries are locked, decides that such a situation indicates a sufficient level of b0rkage to just kill everything outright |
21:19 | | Vornicus-Latens is now known as Vornicus |
21:23 | | Netsplit *.net <-> *.split quits: Alek, @Vornicus, aoanla, @Syloqs-AFH, Zed, SmithKurosaki, @ToxicFrog |
21:23 | | Chi [omegaboot@Nightstar-c5f3565b.il.comcast.net] has joined #code |
21:24 | | Netsplit over, joins: aoanla |
21:24 | | Vornotron [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
21:24 | | AgentIchiro [Smith@Nightstar-cc72cefe.dsl.teksavvy.com] has joined #code |
21:24 | | Netsplit over, joins: Zed |
21:24 | | Vornotron is now known as Vornicus |
21:25 | | AgentIchiro is now known as SmithKurosaki |
21:26 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code |
21:26 | | mode/#code [+o ToxicFrog] by Reiver |
21:26 | | Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code |
21:27 | | Syloq is now known as Syloqs-AFH |
21:53 | | aoanla [AndChat@7C1B03.122F4E.4B6C83.00B894] has quit [[NS] Quit: ] |
21:56 | | Derakon [Derakon@Nightstar-1ffd02e6.ucsf.edu] has joined #code |
21:56 | | mode/#code [+o Derakon] by Reiver |
21:56 | <@Derakon> | Today I completely changed the layout for the program again. |
21:56 | <@Derakon> | Fun times. |
21:56 | <@Derakon> | Fortunately, just moving windows around is pretty straightforward. |
21:56 | | PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
21:56 | <@Derakon> | (The change this time is that the center display is now back in landscape mode instead of portrait mode) |
22:03 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed] |
22:08 | | Rhamphoryncus [rhamph@Nightstar-bbc709c4.abhsia.telus.net] has joined #code |
22:40 | | Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Connection closed] |
23:27 | | Derakon [Derakon@Nightstar-1ffd02e6.ucsf.edu] has quit [[NS] Quit: Leaving] |
23:43 | | You're now known as TheWatcher[T-2] |
23:48 | | You're now known as TheWatcher[zZzZ] |
--- Log closed Tue Aug 17 00:00:37 2010 |