code logs -> 2007 -> Tue, 04 Sep 2007< code.20070903.log - code.20070905.log >
--- Log opened Tue Sep 04 00:00:32 2007
00:11 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has quit [Quit: Z?]
00:13 ChalcyAFK is now known as Chalcedon
00:55 Vornicus-Latens is now known as Vornicus
01:05 takyoji [~bubbad@Nightstar-25812.dhcp.roch.mn.charter.com] has joined #code
01:07 takyoji_ [~bubbad@Nightstar-25812.dhcp.roch.mn.charter.com] has quit [Ping Timeout]
03:13
< MinceR>
gn
03:23 takyoji [~bubbad@Nightstar-25812.dhcp.roch.mn.charter.com] has quit [Quit: Leaving]
04:22 GeekSoldier|Bed is now known as GeekSoldier
04:22 GeekSoldier is now known as GeekSoldier|work
05:08 ReivZzz is now known as ReivClass
05:30 Forj [~Forj@Nightstar-2472.ue.woosh.co.nz] has joined #code
05:30 mode/#code [+o Forj] by ChanServ
05:38 MinceR [~mincer@Nightstar-4916.nik.bmf.hu] has quit [Ping Timeout]
05:38 MinceR [~mincer@Nightstar-4916.nik.bmf.hu] has joined #code
06:54 ReivClass is now known as Reiver
07:04 MyCatVer1s [~mycatverb@Nightstar-13709.lurkingfox.co.uk] has joined #code
07:04 MyCatVerbs [~mycatverb@Nightstar-13709.lurkingfox.co.uk] has quit [Operation timed out]
--- Log closed Tue Sep 04 07:30:15 2007
--- Log opened Tue Sep 04 07:33:29 2007
07:33 TheWatcher[zZzZ] [~chris@Nightstar-29731.dsl.in-addr.zen.co.uk] has joined #code
07:33 Irssi: #code: Total of 20 nicks [8 ops, 0 halfops, 2 voices, 10 normal]
07:34 Irssi: Join to #code was synced in 36 secs
08:30 You're now known as TheWatcher
09:43 Thaqui [~Thaqui@Nightstar-26823.jetstream.xtra.co.nz] has quit [Quit: This computer has gone to sleep]
10:12 GiantDemon [AnnoDomini@Nightstar-29623.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
10:18 AbuDhabi [AnnoDomini@Nightstar-28904.neoplus.adsl.tpnet.pl] has joined #Code
10:22 Forj [~Forj@Nightstar-2472.ue.woosh.co.nz] has quit [Quit: Gone]
10:58 Chalcedon [~Chalcedon@Nightstar-2472.ue.woosh.co.nz] has quit [Quit: gone]
11:53 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has joined #Code
11:53 mode/#code [+o gnolam] by ChanServ
11:57 AbuDhabi is now known as AnnoDomini
11:57 mode/#code [+o AnnoDomini] by ChanServ
12:19 Syloqs-AFH [Syloq@NetAdmin.Nightstar.Net] has quit [Connection reset by peer]
12:20 Syloq [Syloq@NetAdmin.Nightstar.Net] has joined #code
12:21 Syloq is now known as Syloqs-AFH
12:27 MyCatVerbs [~rb6822@Nightstar-18504.cs.bris.ac.uk] has joined #code
12:36 Thaqui [~Thaqui@Nightstar-26823.jetstream.xtra.co.nz] has joined #code
12:36 mode/#code [+o Thaqui] by ChanServ
12:40 gnolam is now known as gnolamidget
12:59 Vornicus is now known as Vornicus-Latens
13:23 Thaqui [~Thaqui@Nightstar-26823.jetstream.xtra.co.nz] has quit [Quit: This computer has gone to sleep]
14:14 gnolamidget is now known as gnolam
14:22 GeekSoldier|work is now known as GeekSoldier
14:43 GeekSoldier [~Rob@Nightstar-4914.pools.arcor-ip.net] has quit [Ping Timeout]
14:51 GeekSoldier [~Rob@Nightstar-3275.pools.arcor-ip.net] has joined #code
14:52 GeekSoldier is now known as GeekSoldier_
14:55 GeekSoldier_ is now known as GeekSoldier
15:22 AnnoDomini is now known as inimoDonnA
16:42
< MinceR>
r4wr
16:44
<@inimoDonnA>
You like using /amsg.
16:44
< MinceR>
no, i don't.
16:44
< MinceR>
i don't even have /amsg.
16:45
< MinceR>
though i guess it wouldn't be too hard to code with /foreach.
16:46
< MinceR>
on second thought, it would be a broken way to implement it.
16:46
< MinceR>
(it probably wouldn't use multiple-target messages)
16:54 MyCatVerbs [~rb6822@Nightstar-18504.cs.bris.ac.uk] has quit [Quit: Swim, swim, hungry!]
17:09 GeekSoldier_ [~Rob@Nightstar-3275.pools.arcor-ip.net] has joined #code
17:09 GeekSoldier [~Rob@Nightstar-3275.pools.arcor-ip.net] has quit [Killed (NickServ (GHOST command used by GeekSoldier_))]
17:09 GeekSoldier_ is now known as GeekSoldier
18:01
<@Pi>
Most clients implement /amsg with the /foreach algorithm. mIRC and irssi are the only major clients I'm aware of that use multiple target messages.
18:04 Chalcedon [~Chalcedon@Nightstar-2472.ue.woosh.co.nz] has joined #code
18:04 mode/#code [+o Chalcedon] by ChanServ
18:24 mode/#code [+o TheWatcher] by ChanServ
18:40 Chalcedon [~Chalcedon@Nightstar-2472.ue.woosh.co.nz] has quit [Quit: Gone]
18:57
<@ToxicFrog>
testing
18:59
<@ToxicFrog>
Dammit, that was not meant to happen.
19:01
< GeekSoldier>
I suppose you failed?
19:02
<@inimoDonnA>
This falls short of "Epic Fail", though.
19:02
<@ToxicFrog>
Well, it was meant to broadcast to a single one of my connections, not all of them.
19:05 * TheWatcher stabs php for providing the irritating 'date()' function, and programmers for using it
19:10 * MinceR avoids php for being an annoying pile of hacks.
19:12
<@TheWatcher>
yeah, no kidding. I wouldn't mind, it;s even inconsistent within the same function
19:13
<@TheWatcher>
for example, in the format string for date() "D" is the short name of the weekday from Mon to Sun, while "l" is the long version from Sunday" through "Saturday"
20:24 GeekSoldier is now known as GeekSoldier|bed
21:41
<@ToxicFrog>
...
21:42
<@ToxicFrog>
20 minutes of conversation about the differences between settable() and rawset().
21:42
<@ToxicFrog>
And then...
21:42
<@ToxicFrog>
<Polarina> What is the alternative to lua_setfield that doesn't calls any metamethods?
21:44 * Chalain tries very hard to remember enough lua to get that.
21:45 * Chalain suspects, without actual confirmation, that lua_* methods don't interact with the metatable...?
21:46
<@ToxicFrog>
Not so. All the lua API functions start with lua_ or luaL_.
21:46
<@Chalain>
ah.
21:46
<@Chalain>
I don't actually know lua. I use plua. :-)
21:46
<@ToxicFrog>
Basically lua_settable() is the C interface to foo[bar] = baz
21:47
<@ToxicFrog>
And lua_rawset() does the same operation, but without querying the metatable
21:47
<@Chalain>
Ah, okay.
21:47
<@ToxicFrog>
And lua_setfield() is a macro around lua_settable().
21:47
<@Chalain>
Ahhh, okay. I get it.
21:47
<@Chalain>
so, how would you set a table element without interacting with the metatable?
21:47 * Chalain flees, giggling
21:48 * ToxicFrog beats Chalain mercilessly
21:48 * Chalain richly deserves it.
21:48
<@Chalain>
So, elegant coding question for you.
21:48
<@Chalain>
Given an array of arrays, and the ability to iterate without indices, how do you pivot the array?
21:49
<@ToxicFrog>
(I suppose that, since you use plua, you wouldn't be able to help test gtk-server-lua?)
21:49
<@Chalain>
I'm thinking at least one of these MUST be indexed to work.
21:49
<@Chalain>
Indeed, I would not, sorry.
21:49
<@Chalain>
I would be happy to try it out, but I am also under a critical job time crunch. :-(
21:49
<@Chalain>
It sounds way cool, though.
21:49
<@ToxicFrog>
"pivot"?
21:50 * ToxicFrog knows that only in the context of pivot_root
21:50
<@Chalain>
I have a CSV full of data in columns, which is easy and handy for a human to read.
21:50
<@Chalain>
I want to essentially be able to walk this array with each_column, which doesn't exist.
21:50
<@ToxicFrog>
Shouldn't you end up with an array of records, then?
21:50
<@Chalain>
No
21:50
<@Chalain>
Well
21:50
<@Chalain>
Yes, that's what I Want
21:51
<@Chalain>
what I have is an array of stripes.
21:51
<@Chalain>
Each row contains one attribute for each object.
21:51
<@Chalain>
rwo 0: name1, name2, name3, etc., then row 1: code1, code2, code3, etc....
21:51
<@Chalain>
I want row 0: name1, code1, etc.
21:52
<@Chalain>
And for some reason my brain is just fogged out completely.
21:52
<@Chalain>
I can *TASTE* the solution.
21:52
<@ToxicFrog>
And you can't just rewrite the loader to generate more workable data structures?~
21:52
<@Chalain>
I know what it feels like in my mouth.
21:52
<@Chalain>
Typing with my tongue has not succeeded in translating this sensation to working code. :-)
21:52
<@Chalain>
I *am* rewriting the loader. Hence the need for pivot.
21:52
<@Chalain>
:-)
21:53
<@Chalain>
Though, to answer your more specific question, I get supplied these feckers as spreadsheets from some knuckle-draggers. Retraining them is... problematic. :-)
21:53
<@Chalain>
OH MAN
21:53
<@Chalain>
COULD I be that stupid?
21:53 * Kyrre PatPats Chalain.
21:53
< MinceR>
pointer arithmetic! =)
21:53
< Kyrre>
Don't worry, I'm usually stupider.
21:53 * Chalain goes and looks for a "Pivot This Spreadsheet" option in Excel and/or OpenOffice's Calc
21:53
<@ToxicFrog>
Waitwaitwait
21:54
<@ToxicFrog>
If you're rewriting the loader, then your data structure should never end up in the format you outline above!
21:56
<@ToxicFrog>
If the csv is one row per record, you just read row[i] into records[i][0..n]; if it's one col per record (and thus one row per field), you read row[i] into records[0..n][i]
21:56
<@Chalain>
Ohhh
21:56
<@Chalain>
Okay, yeah.
21:56
<@Chalain>
I'm not doing that.
21:56
<@Chalain>
I'm using an off-the-shelf CSV reader.
21:56
<@ToxicFrog>
Oh.
21:56 * Chalain thumps the table.
21:56
<@Chalain>
It LOOKS like Calc should be able to do it.
21:56
<@ToxicFrog>
Which reads row[i] into records[i][0..n] regardless?
21:57
<@Chalain>
But it's poorly documented. Sigh.
21:57
<@ToxicFrog>
One would think it would have an iterateable mode. Keh.
21:58
<@Chalain>
Ooh. I'll go check to see if FasterCSV has a pivot option. THAT would be farking intelligent.
21:58
<@ToxicFrog>
That would also be nice.
21:58
<@ToxicFrog>
Some way of iterating over fields, or even just lines, would also solve it handily.
21:59
<@Chalain>
Drat. No such luck.
21:59
<@ToxicFrog>
So its only interface is that you can feed it a CSV, and it spits out an array of arrays?
21:59
<@Chalain>
Well, it's stoopid, but I guess it's time for inelegance. I can do for y in rows; for x in cols; pivot[x][y] = data[y][x]
21:59
<@ToxicFrog>
How vexing.
22:00
<@Chalain>
Yeah, sigh. It's one of those "we wrote a generic library, and chose to err on the side of simplicity".
22:00
<@Chalain>
I can't really fault them; their call made sense at the time.
22:01
<@Chalain>
I would also be that I'm pole-vaulting over a mouse turd here, and the FasterCSV authors would simply say "Uhhh, dude? Just pivot the table." And then they would point to a really obvious and simple way of doing just that. :-)
22:01
<@ToxicFrog>
Keh. Simple is exporting the iterator. Then you can wrap that in the csv->array[][] mapper trivially.
22:02
<@Chalain>
That's just an inlining of for x, y; data[x][y] == foo, yeah.
22:02
<@Chalain>
But it supports iterated read, yes.
22:03
<@ToxicFrog>
Why not use that, then?
22:03 * Chalain points to the bit where he said "brainfried and tired" :-)
22:03
<@Chalain>
Although... hmm.
22:03
<@Chalain>
It's Ruby.
22:04
<@Chalain>
I'm tempted to rip open Array and add a pivot() method. >:-)
22:04
<@ToxicFrog>
Takes more effort, and is slower.
22:04
<@Chalain>
pivoted_data = FasterCSV.read("file.csv").pivot
22:04
<@jerith>
Chalain: Were it Python, I'd suggest unzip().
22:04
<@Chalain>
True, but looks hella cleaner.
22:04
<@ToxicFrog>
And, um, I did suggest using an iterator earlier :P
22:04
<@Chalain>
WHOA
22:04
<@Chalain>
Getting MAJOR lightning hits out here
22:04
<@jerith>
Ruby, however, has no such beast.
22:05
<@jerith>
I looked this morning.
22:05
<@Chalain>
jerith: describe Python's unzip()
22:05
<@jerith>
Eventually I used .collect(), since I only wanted one column.
22:05
<@Chalain>
Ah
22:06
<@jerith>
Apparently I am mistaken, Python has no unzip either.
22:06
<@Chalain>
lol
22:07
<@jerith>
At least, it's not unzip(array) or array.unzip().
22:07
<@jerith>
Although...
22:08
<@jerith>
irb(main):001:0> a = [[1,2,3],[4,5,6],[7,8,9]]
22:08
<@jerith>
=> [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
22:08
<@jerith>
irb(main):002:0> a[0].zip(a[1],a[2])
22:08
<@jerith>
=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
22:09
<@jerith>
Except Ruby's zip syntax makes it a little nastier than a zip(*a) should be.
22:09 * Chalain nods.
22:10
<@Chalain>
It'd be nice to have each_column, though you can't really rely on an Array to be sufficiently 2D and non-sparse to support that.
22:10
<@jerith>
Although you could probably do something with slices to get mostly there.
22:10
<@jerith>
irb(main):004:0> a[0].zip(*(a[1..a.length]))
22:10
<@jerith>
=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
22:11
<@jerith>
And you could hide that in a method on Array.
22:11
<@Chalain>
>> [[1,2,3], [4,5,6], [7,8,9]].pivot
22:11
<@Chalain>
=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
22:11
<@Chalain>
All hail the Rails /lib folder. :-)
22:11 * jerith grins.
22:16
<@Chalain>
So, I learned an AEVIL Ruby trick the other day.
22:17
<@Chalain>
Grabbing an existing object and bolting class methods onto it after the fact.
22:18
<@jerith>
I've given up on writing clean ruby.
22:18
< MinceR>
i prefer python anyway :>
22:18
<@Chalain>
The Python idiom is to use copy/subclass ctors. E.g.: if genericmsg[0]=='PRIVMSG': privmsg = PrivMsg(genericmsg)
22:18
<@jerith>
MinceR: Likewise.
22:18
<@Chalain>
Heh
22:19
<@jerith>
I now rearrange Ruby methods and such with gay abandon.
22:19
<@Chalain>
I had that problem for the first year in Ruby, until somebody finally thwapped me and said, "Stop trying to write C++ in Ruby."
22:19
< MinceR>
and then you were enlightened. :>
22:19
<@jerith>
About the only language I don't write Python in these daaaays is Erlang.
22:20
<@jerith>
And that's because you can't. ;-)
22:20
<@Chalain>
I actually got a full writeup in the Ruby Quiz by James Gray. He posted my solution and said, "Okay, folks, this is a brilliant example of how NOT to do this."
22:21
<@Chalain>
...and then he reduced my ~300 line solution to about 28 lines of VERY elegant code.
22:21 * jerith grins.
22:22
<@jerith>
I did that to a coworker's code a few months ago.
22:22
<@jerith>
He was learning Ruby from a Java background.
22:22 * Chalain nods
22:23
<@Chalain>
My code was like that. Lots of "array.size.times {|i| do_something(array[i]) }" stuff, e.g. explicit iterators where non were needed, etc.
22:23 * jerith has decided to forswear database servers forever.
22:24
<@jerith>
I'm even looking forward to writing Java code for a few weeks.
22:24 * Chalain giggles and starts a stopwatch.
22:24
<@Chalain>
Oh man. I... that's bad.
22:25
<@Chalain>
When you're looking forward to Java, it's time for a vacation. :-P
22:25
<@jerith>
Heh. Nontrivial migration betwene subtly incompatible versions.
22:25
< MinceR>
lol
22:25
<@jerith>
*between
22:25
<@ToxicFrog>
...yeah
22:25
< MinceR>
"looking forward to java"
22:25
<@jerith>
Add in slaving between said versions and various jobs running /everywhere/ that need updating...
22:26
<@Chalain>
whee
22:26
<@jerith>
Then a nasty query that hits a pathological case in the new version and increases from a few seconds runtime on the old to kill -9 the server process several hours later on the new...
22:28
<@jerith>
Combine that with a slightly different network config on the new box, taking the opportunity while things are being changed anyway to tighten various access controls, some slightly dodgy DNS and get to 18h00 with things still broken...
22:29
<@jerith>
Yeah. This was all supopsed to be finished last week.
22:29
<@Chalain>
Heh
22:29 * Chalain patpats.
22:29
<@jerith>
But that query bug took a day to track down.
22:29
<@Chalain>
Dono what you're doing, but it sounds like you're trying to change too much too fast with too little testing. :-/
22:30
<@jerith>
All these tyoops are my laptop ripping a dvd, btw.
22:30
<@Chalain>
(That's not a judgment of your skill or attitude. Merely an observation, and a tentative diagnosis based on symptoms.)
22:30
<@jerith>
For some reason keyboard and pointer inputs are adversely affected,
22:30
<@jerith>
Chalain: Yeah, I agree.
22:30
<@Chalain>
tyoops?
22:31
<@ToxicFrog>
typos.
22:31
<@Chalain>
Ohh
22:31
<@jerith>
It delays stuff and doubles some things.
22:31
<@jerith>
s/doubles/repeats/
22:31
<@Chalain>
I was trying to read that as "all these $OBJECTS are CAUSING my laptop to run slow and affect input"
22:31 * Chalain nods
22:32
<@Chalain>
I get a similar thing on my laptop as well. HP Pavilion running Kubuntu 7.04
22:32
<@jerith>
This particular db has grown rather haphazardly.
22:32 * Chalain ponders.
22:32
<@jerith>
We're trying to shove the whole problem off onto someone else, though.
22:32
<@Chalain>
You know, I don't have a problem when CPU is spun up. I get all my problems when memory is all gone.
22:32
<@Chalain>
Heh
22:32
<@Chalain>
Yay outsourcing!
22:33
<@ToxicFrog>
Chalain: well, in that case, it's because the kernel is spending a lot of time IO bound moving stuff between swap and memory.
22:33
<@jerith>
The beauty of working for a big company that routinely handles mind-bogglingly vast amounts of data is that there are teams dedicated to doing things like that.
22:34
<@Chalain>
TF: Yeah. When you hit swap on my laptop, it's all over.
22:34
<@Chalain>
Swap memory is not a viable operating resource. It is merely a skidplate to give you time to get stuff aborted. :-)
22:34
<@ToxicFrog>
Exactly.
22:35
<@Chalain>
Heh.
22:35
<@jerith>
Anyways, testing on this kind of thing is difficult, which is to say "more expensive than having the stuff that relies on that db go down while you fix things".
22:35
<@Chalain>
The running joke at the place Vorn & I coworked at was a guy on usenet who came up with a brilliant idea to speed up his computer by mounting the swapfile on a ramdisk.
22:35 * jerith giggles.
22:37
<@jerith>
Nothing in that db is /critical/, but the boss came out a few times today to complain that his pretty graphs were unavailable and once to ask why it told him we hadn't made any money for a week.
22:38
<@Chalain>
ouch/heh
22:39
<@jerith>
Anyways, I have now reached the point where I can do a somewhat wide range of db troubleshooting and fixing without resorting to Google.
22:40
<@Chalain>
Nice!
22:40
<@jerith>
Not really. It means I'm probably going to have to.
22:40
<@Chalain>
Except for that raw, burned feeling behind your eyes... :-)
22:40
<@Chalain>
Heh, yeah
22:41
<@Chalain>
Sometimes you have to know when to Forget something.
22:41
<@jerith>
Of course, since I set this whole new thing up, I'm going to be the first guy who gets called to fix it when it breaks.
22:42
< Kyrre>
Charge twice of what you did when you set it up.
22:43
< Kyrre>
The next time they call ( if there is a next time ) charge twice as much as last time.
22:43
<@Chalain>
Well, sometimes you also have to know how to Document something and then sneer at other people in team meetings. "Hey, this thing broke, could you--" "Did you look at the documentation? It's all self-explanatory, really. Well, I gotta get back to this other very important thing."
22:43
<@jerith>
Kyrre: I'm an employee, not a contractor.
22:43
<@Chalain>
"What's so important about that?" "Well, mostly, that it isn't the thing I'm dropping in your lap."
22:44
< Kyrre>
Yes?
22:44
<@Chalain>
Kyrre: that's evil! ...I'm stealing that for my playbook. :-)
22:44
< Kyrre>
:p
22:46
<@jerith>
Anyways, I may whinge and moan, but I still love my job.
22:46
<@jerith>
About the only constant is that I'm not going to be doing the same thing two months from now.
22:47
<@jerith>
There are only two major subsystems (excluding the networking stuff which Seattle handles) that I haven't gotten my hands dirty with and I hack on one of those next week.
22:47
< Kyrre>
I love my job more.
22:48
< Kyrre>
My job is pretty much to get paid.
22:48
< Kyrre>
Another application of Serah's business strategies.
22:48 * jerith grins.
22:49
<@jerith>
Anyways, it's past my bedtime already.
22:50
<@jerith>
So I'd best get some sleep.
22:51
<@Chalain>
nini
22:51
<@jerith>
G'night.
22:51
<@jerith>
(Shouldn't you be working, Chalain?) :-P
22:52
<@Chalain>
(yes, sigh)
22:52
<@Chalain>
(though Array#pivot *was* work...)
22:52
<@Chalain>
(/me gets back to it, though.)
22:52 * ToxicFrog patpats
22:53
<@jerith>
Nope, I'm not sleeping. I think I ate something dodgy for lunch. TMI on request, but I'm not going to try outdo Chalain in that regard.
22:53
<@Chalain>
Heh.
22:53 * jerith wanders porcelainwards.
22:53
<@Chalain>
You know when I said "that raw, burning feeling... behind your eyes"? Yeah, I edited that.
22:54 * jerith grins.
22:55 * jerith takes his ipod with to listen to another Bertie and Jeeves story while his plumbing sorts itself out.
22:55
<@Chalain>
Good luck!
23:17
<@ToxicFrog>
...aha. So that's how you make auto-targets sticky in FF12.
23:18
<@ToxicFrog>
Enemy/Party Leader's Target { attack }; Enemy/Targeting Self { attack }; Enemy/Nearest { attack };
23:27 Thaqui [~Thaqui@Nightstar-26823.jetstream.xtra.co.nz] has joined #code
23:27 mode/#code [+o Thaqui] by ChanServ
23:59 You're now known as TheWatcher[T-2]
--- Log closed Wed Sep 05 00:00:38 2007
code logs -> 2007 -> Tue, 04 Sep 2007< code.20070903.log - code.20070905.log >