code logs -> 2011 -> Sun, 20 Mar 2011< code.20110319.log - code.20110321.log >
--- Log opened Sun Mar 20 00:00:06 2011
00:20 Attilla [Some.Dude@37647E.0E7447.22C7B1.567421] has quit [Ping timeout: 121 seconds]
00:29 Tamber [tamber@furryhelix.co.uk] has quit [Connection closed]
00:29 Tamber [tamber@Nightstar-d36aadfc.co.uk] has joined #code
01:02 * McMartin is a bad person
01:02
<@McMartin>
candidates = [s[2] for s in [parse_line(l) for l in file(sys.argv[1]).readlines()] if s is not None and s[1] == '*']
01:03 * Derakon baps McM on the head with the squeaky mallet.
01:03
< celticminstrel>
How do I set up my git repository so that I don't have to always copy-paste the URL when I push?
01:03
<@McMartin>
Add that URL to the .git/config file
01:04
<@McMartin>
Oh wait, that's wrong
01:04
<@McMartin>
candidates = [(s[2], file_size(s[2])) for s in [parse_line(l) for l in file(sys.argv[1]).readlines()] if s is not None and s[1] == '*']
01:04
<@McMartin>
There we go
01:04
<@Derakon>
Why are you one-linering this anyway?
01:04
<@McMartin>
It's not the interesting part, and it really isn't that bad when you look at it; it's one map and one filter.
01:05
<@McMartin>
(This is part of a script that will parse my OCR index notes and pick out the ones I've marked as Actually Worth Listening To More Than Once - its task will then be to break that list up into chunks that are multiples of 25 files long, each of which is as close as it can get to 700MB, for splitting into CDs.)
01:06
< celticminstrel>
Where/how does it go in that file?
01:06
<@McMartin>
Each line looks something like this:
01:06 * Derakon puts his map generator into overdrive: http://derakon.dyndns.org/~chriswei/games/jbrl/mapgen40d.png
01:07 * simon_ is overwhelmed by documentaries on ants and wants to simulate.
01:08
<@McMartin>
"1870 * Phoenix_Wright_Ace_Attorney_Holiday_with_Mia_Fey_OC_ReMix.mp3 - Hells yes. This is another case where the strength of the original carries the mix, but."
01:08
<@McMartin>
In order: OCR index number, rank code, file name, separator dash, comment.
01:09
<@McMartin>
Rank codes are "*" = good, "-", not good enough, " ", unevaluated or old enough that it's kind of been discarded, "?" = revisit
01:09
<@McMartin>
I also have scripts to autofetch relevant pages and files from OCRemix itself to build the index templates and get the files themselves.
01:13
<@McMartin>
... actually, what I should do first is build my "revisit" list.
01:13 You're now known as TheWatcher[T-2
01:15
< celticminstrel>
Figured it out.
01:15
< celticminstrel>
Thanks.
01:16 You're now known as TheWatcher[zZzZ]
01:16
<@Derakon>
Hm...the functional limit on map size is now how far apart two nodes can be in the graph.
01:16
<@Derakon>
Too far and the function I use to sort nodes by their distance starts returning longs instead of ints.
01:28
< simon_>
dynamic languages are scary.
01:35
<@McMartin>
I should probably break this out into a library eventually.
01:37
<@McMartin>
https://hkn.eecs.berkeley.edu/~mcmartin/notes_parse.py
01:37
<@McMartin>
As you can see, it's not so bad as all that~
01:38
<@McMartin>
The use of fixed-width text fields at the front of each line is not great, but it's also kind of dictated by the format (since ' ' is a valid rank code)
01:38 gnolam [lenin@9D46A2.F4E9D7.E4B4CF.2072AD] has quit [[NS] Quit: Z?]
01:45
<@Derakon>
I would rather write "700000000" as "7 * (10 ** 8)" personally.
01:46
<@Derakon>
Though that's really a nit.
01:49
<@McMartin>
The really important bit here is "CD sized"~
01:49
<@Derakon>
Yeah.
01:50
<@McMartin>
And it's not clear whether it should be 7 * (10**8), 700 * (2 ** 20), or 700000 * (2**10).
01:50
<@McMartin>
So I'm picking the lowest, just in case.
01:50 * McMartin shakefist at marketers.
01:52
<@McMartin>
Hrm
01:52
<@McMartin>
Is there a quick way in Python to say "copy file name X to directory Y" or do I need to open it, read() it, and write() it to a file in Y?
01:53
<@McMartin>
Aha. shutil.copyfile.
01:53
<@McMartin>
or shutil.copy, even.
01:55
<@Derakon>
os.rename will do an mv for you.
01:56
<@McMartin>
I don't actually want an mv, though, I want a cp.
01:57
<@Derakon>
Yeah, I don't see anything in the os module that does that. Weird.
01:57
<@McMartin>
(I want directories I can burn to disc and then delete)
01:57
<@McMartin>
It's in shutil.
01:57
<@McMartin>
Which I got by walking the doc html, but I can't figure out how I got there from os.
02:11
<@VornicusVashicus>
Der: if you're using a sort like that your max distance will be 2**15.5 or +/- 46k
02:13
<@Derakon>
Vorn: well, it's compounded by the fact that I'm returning the square of the distance instead of the actual distance.
02:14
<@ToxicFrog>
I'm trying to write the documentation for bitpacks, but I'm having trouble describing what a bitpack is.
02:14
<@Derakon>
Since ordinarily I wouldn't want to compute all those expensive square roots..
02:27 * ToxicFrog foams
02:28
< Tarinaky>
]
02:32
<@VornicusVashicus>
Der: right, that's what I'm saying.
02:33
<@VornicusVashicus>
which is why it's 2**15.5 instead of 2**31
02:33
<@Derakon>
Well, the map I was trying to make was 50000x50000 pixels.
02:34
<@VornicusVashicus>
Which would certainly hit it, if your origin is in a corner.
02:34
<@VornicusVashicus>
if it's in the center you're perfectly safe.
02:35
<@Derakon>
This is node-to-node distance, not distance-from-center.
02:35
<@VornicusVashicus>
...oh, node to node distance, okay, so you're limited to a circle of diameter 46k.
02:36
<@VornicusVashicus>
(square of side 32k)
02:40
<@Derakon>
It occurs to me that the graph doesn't need to be done at pixel resolution.
02:40
<@Derakon>
I can do it at block resolution instead.
02:41
<@Derakon>
In which case my working area goes up by a factor of 50.
02:57
<@ToxicFrog>
Huh. That was interesting.
02:58
<@ToxicFrog>
While updating the README, I stopped halfway through a feature and thought "huh, does it actually work that way? I can't remember writing a test case for it."
02:58
<@ToxicFrog>
So I wrote a test case and it failed.
02:58
<@ToxicFrog>
Oops.
03:00
< Tamber>
Oopsie.
03:08 * ToxicFrog commits a fix, continues documenting
03:08
<@ToxicFrog>
<3 </3 unit tests
03:22 * ToxicFrog abruptly realizes that the previous behaviour of 'p' was stupid and wrong, casually breaks backwards compatibility
03:23
< Reiv>
YOU BROKE IT
03:23
< Reiv>
Idle clarification: Fractions: x/y/z is equivalent to x/z*y, yes?
03:24
<@McMartin>
Um
03:24
<@McMartin>
Yes, if that's (x/y)/z
03:24
< celticminstrel>
I think it's (x/y)/z, for what little that's worth,
03:24
< Reiv>
Er, yes.
03:24
<@McMartin>
If you're doing x/(y/z), that's x*z/y.
03:24
< Reiv>
Righto, cheers.
03:24
< celticminstrel>
McMartin is faster at this than I am. :)
03:25
< Reiv>
I had indeed intended it to be x/y on top of z.
03:25
< Reiv>
I appreciate the clarification that you need to watch order, though.
03:25
< celticminstrel>
Division is normally left associative, so that's the normal way to treat x/y/z.
03:25
< Reiv>
Right.
03:27
<@ToxicFrog>
Reiv: yes I did. Fortunately, I'm pretty sure I'm the only person who actually uses p.
03:27
<@ToxicFrog>
Also, the old behaviour was inconsistent with everything else in the library, and thus surprising, and thus bad.
04:03 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!]
04:35
<@VornicusVashicus>
x/y/z = x/(yz)
04:42
<@Derakon>
Well, here's a first.
04:42
<@Derakon>
I'm referring to code I wrote at work to help out at home, instead of vice-versa.
05:59 Derakon is now known as Derakon[AFK]
08:04 AnnoDomini [annodomini@D553D1.41311B.698BCE.69E1D9] has joined #code
08:04 mode/#code [+o AnnoDomini] by Reiver
08:27 Kindamoody [Kindamoody@D553D1.68BE08.ECB34C.A3DCD7] has quit [Ping timeout: 121 seconds]
09:16
< Tamber>
Signs you might be a little too tired to be working on your code. "...why is uint13_t not working?"
09:17
<@AnnoDomini>
Haha.
09:18
< Tamber>
"You get the first 13 bits now, the rest when you finish paying"~
09:22 Attilla [Some.Dude@37647E.0E7447.22C7B1.567421] has joined #code
09:22 mode/#code [+o Attilla] by Reiver
10:14 Kindamoody [Kindamoody@Nightstar-4764665d.tbcn.telia.com] has joined #code
10:22 You're now known as TheWatcher
11:21
<@froztbyte>
http://inspiration.sweyla.com/code/
11:53 AnnoDomini [annodomini@D553D1.41311B.698BCE.69E1D9] has quit [[NS] Quit: BRB]
11:56 AnnoDomini [annodomini@D553D1.41311B.698BCE.69E1D9] has joined #code
11:56 mode/#code [+o AnnoDomini] by Reiver
14:41 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
14:44 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
15:08 Reiv [orthianz@3CF3A5.E1CD01.36D449.95F5A5] has quit [Connection reset by peer]
15:08 Reiv [orthianz@3CF3A5.E1CD01.36D449.95F5A5] has joined #code
15:21 Kindamoody [Kindamoody@Nightstar-4764665d.tbcn.telia.com] has quit [Operation timed out]
15:25 Kindamoody [Kindamoody@35E323.4A5F05.9893B9.A684A3] has joined #code
15:39 Reiv [orthianz@3CF3A5.E1CD01.36D449.95F5A5] has quit [Connection reset by peer]
15:40 Reiv [orthianz@3CF3A5.E1CD01.36D449.95F5A5] has joined #code
16:12 Derakon[AFK] is now known as Derakon
16:36 EvilDarkLord [jjlehto3@Nightstar-a5db08cc.org.aalto.fi] has joined #code
16:36
< EvilDarkLord>
Anyone remember whether the AI in any of the Worms games was able to use the ninja rope?
16:50
<@Derakon>
Nope.
16:51
< EvilDarkLord>
Is that "No, they were not able to" or "No, I can't remember"?
16:51
<@Derakon>
To my knowledge they have never tried to use the rope.
16:52
<@Derakon>
I don't know if that's due to difficulty of implementation or decision to leave some advantage to the player.
16:53
< EvilDarkLord>
Cool, thanks.
16:54 Phox [Tertius_Vulpe@Nightstar-ab4cb40f.abhsia.telus.net] has quit [Ping timeout: 121 seconds]
16:59 Phox [Tertius_Vul@EB02D1.0F3E21.BE1EAF.350E2F] has joined #code
17:50
< Tarinaky>
EvilDarkLord: I remember the AI in Armageddon using the ninja rope (badly).
17:50
< Tarinaky>
EvilDarkLord: They'd frequently do daft things though.
17:51
<@Derakon>
Your memory is flawed.
17:52
<@Derakon>
The Armageddon AI can use the bungie rope and parachute but not the rope.
17:52
<@Derakon>
Er, ninja rope.
17:52 * Tarinaky shrugs. I remember the AI in Armageddon using the rope. That's all EDL asked :p
18:05 AnnoDomini is now known as Birds
18:07 * Derakon makes an article on Jetblade's map generation process. http://code.google.com/p/jetblade/wiki/MapGeneration
18:13 Derakon is now known as Derakon[AFK]
18:20 EvilDarkLord is now known as Shield
18:21 cpux [chatzilla@Nightstar-c978de34.dyn.optonline.net] has quit [Client closed the connection]
18:55
< Tarinaky>
Does anyone have a good resource on profiling C++ code?
19:06
< Shield>
What OS are you on?
19:12
< Tarinaky>
Linux.
19:22
< Tarinaky>
gprof is giving me no accumulated time. Which seems wrong.
19:24 Derakon[AFK] is now known as Derakon
19:26
< Tarinaky>
Am I being silly or something?
20:12
<@ToxicFrog>
You might be. Are you using any sort of frontend?
20:13
<@ToxicFrog>
IIRC, there's a bunch of gcc options you need to build and link with for everything to work right
20:18
<@ToxicFrog>
Soliciting feedback on documentation quality: github.com/ToxicFrog/vstruct
20:29
< Tarinaky>
I'm compiling with -pg, which means that running the program now generates a heap of profile information.
20:30
< Tarinaky>
When I invoke gprof ./rontgen|less to inspect that profile information I get something like this:
20:30
< Tarinaky>
(Hold on, copy and pasting.)
20:31
< Tarinaky>
http://pastebin.com/eh41TbbE
20:31
< Tarinaky>
The notion that nothing is taking any time seems silly given I'm getting a noticeable lag.
20:32 * Tarinaky already knows what needs optimising tbh, he just wants to learn how to profile >.>
20:33
<@TheWatcher>
TF: in the documentation for pack, unpack, and compile I'd suggest "takes a format string (see section 5)" for clarity.
20:34
<@TheWatcher>
Otherwise, it looks fine to me. I'd have to actually /use/ it to be certain, but it looks complete enough.
20:36
<@ToxicFrog>
Thank you.
20:51
< Tarinaky>
ToxicFrog: Any idea what I'm doing wrong?
20:59
<@ToxicFrog>
Tarinaky: no idea, sorry
21:02
< Tarinaky>
How annoying.
21:12
<@ToxicFrog>
(it's probably not something difficult to solve, I'm just really out of practice with gprof)
21:18
< Tarinaky>
One thing I'm looking at is a profiler that's described in a book I have.
21:18
<@ToxicFrog>
?
21:18 Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
21:20
< Tarinaky>
From one of the Game Programing Gems books.
21:20
< Tarinaky>
Err 'Real-time heirachical profiling'.
21:20
<@ToxicFrog>
As in...to use instead of gprof?
21:20
< Tarinaky>
Yeah.
21:20
<@ToxicFrog>
Wouldn't it be easier to just figure out what you're doing wrong with gprof, and fix it?
21:21
< Tarinaky>
Yeah. I have no idea what I'm doing wrong with gprof though.
21:22
< Tarinaky>
And what information it is giving me is pretty useless.
21:29 Shield is now known as EvilDarkLord
22:31 Birds is now known as AnnoDomini
22:34 Kindamoody is now known as Kindamoody|food
22:55 Kindamoody|food is now known as Kindamoody
23:03 AnnoDomini [annodomini@D553D1.41311B.698BCE.69E1D9] has quit [[NS] Quit: leaving]
23:48 Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
--- Log closed Mon Mar 21 00:00:07 2011
code logs -> 2011 -> Sun, 20 Mar 2011< code.20110319.log - code.20110321.log >