code logs -> 2012 -> Sun, 09 Sep 2012< code.20120908.log - code.20120910.log >
--- Log opened Sun Sep 09 00:00:07 2012
00:09 Rhamphoryncus [rhamph@Nightstar-cc6253d6.abhsia.telus.net] has joined #code
00:37 You're now known as TheWatcher[T-2]
00:42 You're now known as TheWatcher[zZzZ]
00:50 Kindamoody is now known as Kindamoody[zZz]
01:53 io\meh is now known as iospace
02:22
<&ToxicFrog>
Python's scoping constantly fucks with my head
02:25
<&Derakon>
Python has two scopes: module-global and function.
02:26
<&Derakon>
In order to assign to a module-scoped variable inside a function you need to do "global varName" first.
02:27
<&Derakon>
There's no special scope for code blocks, and variables declared inside a block will still be in-scope after it.
02:27
<&Derakon>
So e.g. "if foo: bar = 86 else: bar = 77" means that bar is guaranteed to exist after that block even if it didn't before, which still bugs me a bit.
02:30
<&ToxicFrog>
Yes. It's the lack of block scope that fucks with me.
02:51 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
03:14 Attilla [Obsolete@Nightstar-5d310455.as43234.net] has quit [Ping timeout: 121 seconds]
03:19 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
03:19 mode/#code [+o himi] by ChanServ
04:37 iospace is now known as iospacedout
06:52 Kindamoody[zZz] is now known as Kindamoody
07:06 Derakon is now known as Derakon[AFK]
07:56 celticminstrel [celticminst@Nightstar-05d23b97.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
08:48 Kindamoody is now known as Kindamoody|out
08:50 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
08:56 Vash[uh-nya] [Vash@Nightstar-e8057de2.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
08:59 * Vornicus befuddles vaguely at html, wonders why his table cells are 5px higher than the contents.
09:03 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
09:03 mode/#code [+o himi] by ChanServ
09:33 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has quit [Ping timeout: 121 seconds]
09:39 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has joined #code
09:40 mode/#code [+o Alek] by ChanServ
10:52 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
11:06 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
11:06 mode/#code [+o himi] by ChanServ
11:15 Kindamoody|out is now known as Kindamoody
11:16 You're now known as TheWatcher
11:24 Kindamoody is now known as Kindamoody|out
12:40 Attilla [Obsolete@Nightstar-5d310455.as43234.net] has joined #code
14:04 cpux|2 [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
14:07 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
14:38 iospacedout is now known as iospace
15:32 Attilla_ [Obsolete@Nightstar-1332e5aa.as43234.net] has joined #code
15:32 Attilla [Obsolete@Nightstar-5d310455.as43234.net] has quit [Ping timeout: 121 seconds]
15:40
<~Vornicus>
There's something obvious i'm missing; Chrome, Firefox and IE all do it.
15:41
<@TheWatcher>
?
15:41
<@TheWatcher>
Oh, the table cells?
15:42
<~Vornicus>
Yeah
15:42
<@TheWatcher>
Have you got a `td { margin: 0px; padding: 0px; }` in your stylesheet? And what's in the cells?
15:43
<~Vornicus>
Each cell holds an image, 598px*237px. however the tds are sizing to 598x242
15:45
<@TheWatcher>
ahh, yeah, images will mess with take cell rendering by default - you'll also need `td img { display: block; padding: 0px; }`
15:45
<~Vornicus>
\o/
15:45
<~Vornicus>
Thank you!
15:49 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
15:50 * Vornicus then adjusts it to the exact size he actually wants
16:01 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
16:01 mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ
16:09 celticminstrel [celticminst@Nightstar-05d23b97.cable.rogers.com] has joined #code
16:10 Attilla_ [Obsolete@Nightstar-1332e5aa.as43234.net] has quit [Ping timeout: 121 seconds]
16:15 Attilla [Obsolete@Nightstar-0601b683.as43234.net] has joined #code
17:08 Vash [Vash@Nightstar-e8057de2.wlfrct.sbcglobal.net] has joined #code
17:08 mode/#code [+o Vash] by ChanServ
17:48 Syloq_Home [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
17:58 rms is now known as Vasi
18:02 iospace is now known as io\FOOTBALL
18:12
< gnolam>
Man, I haven't done any 2D stuff in /ages/.
18:16
< gnolam>
Yay, programmer art: http://www.lysator.liu.se/~gnolam/temp/walk_test.gif
18:17
<@Vash>
random: http://i170.photobucket.com/albums/u261/Metaver/Evidencecopy.jpg
18:18
<@Vash>
(Pearl is our cat- Vorn and mine.)
18:18
<~Vornicus>
That's a heck of a hat
18:19
< gnolam>
That's where he keeps his weapons.
18:19
< gnolam>
Like the mitre saw.
18:20
<~Vornicus>
I should have seen that one coming.
18:20
< gnolam>
:)
18:21 You're now known as TheWatcher[afk]
19:24 cpux|2 is now known as cpux
19:26 Vasi is now known as rms
20:07 Derakon[AFK] is now known as Derakon
20:08
<&Derakon>
Gnolam: pretty good! My only complaint is that it's very low-contrast.
21:19 Kindamoody|out is now known as Kindamoody
21:28 io\FOOTBALL is now known as io\PACKERS
21:38
< gnolam>
Thank you. :)
21:39
< gnolam>
But it's programmer art. It's just meant to get things going until you can find someone with actual talent.
21:40
< gnolam>
Works well enough for initial testing at least: http://www.lysator.liu.se/~gnolam/temp/blastphemy_test0.png
21:56 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
22:09 You're now known as TheWatcher
22:13 ErikMesoy [Erik@A08927.B4421D.B81A91.464BAB] has joined #code
22:36 ErikMesoy is now known as ErikMesoy|sleep
22:41
< ErikMesoy|sleep>
Is there a simple way to "flip" or "rotate" a table in Python? I want to set Foo2[n,m] = Foo1[m,n] without having to iterate over the lot of them.
22:41
< ErikMesoy|sleep>
(last-minute thing bugging me)
22:41
<&jerith>
ErikMesoy|sleep: You probably want numpy for that.
22:42
<&jerith>
Also, there's no foo[n,m]. There's foo[n][m] or foo[(n,m)].
22:42
< ErikMesoy|sleep>
yeah, foo[n][m]
22:42
< ErikMesoy|sleep>
this is why I should have gone to bed, starting to make elementary mistakes >_>
22:43
<~Vornicus>
zip
22:44
<~Vornicus>
foo2 = zip(foo1). Note that this has problems with not strictly rectangular arrays
22:45
<&jerith>
Oh, right.
22:45
<&jerith>
That works.
22:46
<~Vornicus>
sorry, zip(*foo1)
22:46 * jerith should be asleep already.
22:47
<~Vornicus>
note that you get tuples out of that, not lists, so it might be a bit more involved
22:47
<&jerith>
foo2 = [list(foo) for foo in zip(*foo1)]
22:48
<~Vornicus>
that'll do list of lists to list of lists.
22:48 Kindamoody is now known as Kindamoody|afk
22:48
<&jerith>
That'll turn the tuples into lists.
22:49
<~Vornicus>
Note that if you're doing a throwaway, just using zip -- or even izip, which makes an iterator instead - would be better
22:56
<~Vornicus>
rotate is [list(reversed(foo) for foo in zip(*foo1)] for clockwise, or list(reversed([list(foo) for foo in zip(*foo1)])) for ccw
22:57
<~Vornicus>
But at this point you're probably better off using numpy and its considerably more efficient systems.
23:03 gnolam [lenin@Nightstar-ccbf4b44.cust.bredbandsbolaget.se] has quit [Client closed the connection]
23:06 gnolam [lenin@Nightstar-ccbf4b44.cust.bredbandsbolaget.se] has joined #code
23:20 Kindamoody|afk is now known as Kindamoody
23:33 himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code
23:33 mode/#code [+o himi] by ChanServ
--- Log closed Mon Sep 10 00:00:22 2012
code logs -> 2012 -> Sun, 09 Sep 2012< code.20120908.log - code.20120910.log >

[ Latest log file ]