code logs -> 2007 -> Fri, 20 Jul 2007< code.20070719.log - code.20070721.log >
--- Log opened Fri Jul 20 00:00:35 2007
02:13 * ToxicFrog learns about memoization using metatables
02:13
< ToxicFrog>
Ok, that is so cool.
02:13
<@Vornicus>
memoization kinda rocks.
02:16
< ToxicFrog>
Yes.
02:17
< ToxicFrog>
This implementation has some cool examples of stuff like self-expanding polydimensional arrays, too.
02:17
<@Vornicus>
sweet.
02:18
< ToxicFrog>
http://lua-users.org/wiki/FuncTables
02:19
< ToxicFrog>
The self-expanding array is just memoize(function() return {} end)
02:19
< ToxicFrog>
Assign to foo[3][4][5] and it suddenly grows into a three-dimensional array.
02:20
<@Vornicus>
I used memoization for a fast binomial coefficient thing once.
02:25
<@Vornicus>
(200 choose 100 is 200 multiplies and 100 divides of large integers, usually; doing it by memoization gets you to about 1000 adds, but you only have to do it once, and you get all the results that it depends on)
02:27
< ToxicFrog>
I've used similar techniques in algorithmic analysis, but this implementation is really elegant.
02:31
<@Vornicus>
...holy shit.
02:32
<@Vornicus>
that's awesome.
02:34
< ToxicFrog>
http://rafb.net/p/oxblqZ92.html
02:34
< ToxicFrog>
Even more awesome, a self-memoized memoize.
02:35
<@Vornicus>
a... whut?
02:35
< ToxicFrog>
a memoize() that is, itself, memoized.
02:35
<@Vornicus>
I don't understand what that's supposed to do
02:35
< ToxicFrog>
The same thing any other memoized function does.
02:35
<@Vornicus>
...that the newlines seem to have exploded doesn't help.
02:36
< ToxicFrog>
In particular, this guarantees that memoize(x) == memoize(x) for all x == x.
02:36
< ToxicFrog>
And gives a performance improvement.
02:36
< ToxicFrog>
Hang on, I'll reformat it...
02:36
<@Vornicus>
So it memoizes the memo functions themselves?
02:37
< ToxicFrog>
"memo functions"?
02:37
<@Vornicus>
uh
02:37
< ToxicFrog>
The functions to be memoized?
02:37
<@Vornicus>
uh
02:38
<@Vornicus>
memoiation, you take a function and wrap it in another function that stores the already-figured results
02:38
<@Vornicus>
thus, memoization of the memoize function would ensure that trying to create two memoizations of a single function just return the same thing.
02:39
<@Vornicus>
it caches the results of the memoization process.
02:39
< ToxicFrog>
http://lua.pastey.net/71074
02:39
< ToxicFrog>
Yes. That's what I just said, isn't it?
02:39
<@Vornicus>
probably, but I had to work it through
02:41
< ToxicFrog>
This particular implementation does it with extra flair by constructing a lambda that maps f => f(f), then creating memoize as another lambda and feeding it to the first.
03:02 Serah [~Z@87.72.35.ns-3885] has quit [Ping Timeout]
03:02 KarmaBot [~fark.off@87.72.35.ns-3885] has quit [Ping Timeout]
05:10 ReivOut is now known as Reiver
05:34 Forj [~Forj@Nightstar-17168.ue.woosh.co.nz] has joined #code
05:37 ChalcyAFK is now known as Chalcedon
06:05 Chalcedon is now known as ChalcyCleaning
08:09 You're now known as TheWatcher
08:18 ChalcyCleaning is now known as Chalcedon
08:30 Chalcedon is now known as ChalcyAFK
08:41 ChalcyAFK is now known as Chalcedon
08:58 Reiver [~reaverta@IRCop.Nightstar.Net] has quit [Ping Timeout]
09:01 Reiver [~reaverta@IRCop.Nightstar.Net] has joined #Code
09:01 mode/#code [+o Reiver] by ChanServ
10:24 Serah [~Z@87.72.35.ns-3885] has joined #Code
10:25 mode/#code [+o Serah] by ChanServ
10:48 Chalcedon [~Chalcedon@Nightstar-17168.ue.woosh.co.nz] has quit [Quit: Gone]
11:00 Forj [~Forj@Nightstar-17168.ue.woosh.co.nz] has quit [Quit: Gone]
11:31 Netsplit Blargh.CA.US.Nightstar.Net <-> Troika.TX.US.Nightstar.Net quits: @Pi, @Vornicus, @EvilDarkLord, @Serah, @jerith, ToxicFrog, @Reiver, @ToxicFrog|W`rkn, @Chalain
11:32 Netsplit over, joins: EvilDarkLord, ToxicFrog|W`rkn, ToxicFrog, Reiver, Serah
11:32 mode/#code [+o TheWatcher] by ChanServ
11:38 AnnoDomini [~farkoff@Nightstar-29066.neoplus.adsl.tpnet.pl] has joined #Code
11:38 mode/#code [+o AnnoDomini] by ChanServ
11:54 Vornicus [~vorn@69.0.80.ns-25984] has joined #code
11:55 Vornicus is now known as NSGuest-248
11:55 NSGuest-248 is now known as Vornicus
12:07 KarmaBot [~fark.off@87.72.35.ns-3885] has joined #Code
12:07 mode/#code [+v KarmaBot] by ChanServ
12:43 MyCatVerbs [~rb6822@Nightstar-18641.cs.bris.ac.uk] has joined #code
13:02 ToxicFrog is now known as ToxicFrog`
13:03 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
13:04 mode/#code [+o ToxicFrog] by ChanServ
13:04 ToxicFrog` [~ToxicFrog@Nightstar-20147.cpe.net.cable.rogers.com] has quit [Quit: Leaving]
13:35 MyCatVerbs [~rb6822@Nightstar-18641.cs.bris.ac.uk] has quit [Client exited]
13:36 MyCatVerbs [~rb6822@Nightstar-18641.cs.bris.ac.uk] has joined #code
14:17 ToxicFrog|W`rkn [soleta@Nightstar-26102.dreamhost.com] has quit [Quit: Leaving]
14:17 ToxicFrog is now known as ToxicFrog|W`rkn
15:01 Chalcedon [~Chalcedon@Nightstar-17168.ue.woosh.co.nz] has joined #code
15:01 mode/#code [+o Chalcedon] by ChanServ
15:16 Chalcedon is now known as ChalcyZzz
15:43 * ToxicFrog|W`rkn fiddles with gtk-server some more
15:43
<@ToxicFrog|W`rkn>
I should submit these changes to the mailing list
15:45
< Vornicus>
what have you done?
15:47
<@ToxicFrog|W`rkn>
Fixed the Glade stuff. server_glade_xml_file and server_glade_xml_string have always returned GladeXML handles, but you couldn't do anything with them.
15:48
<@ToxicFrog|W`rkn>
Now, server_glade_widget expects a GladeXML handle as well as a widget name.
15:48
<@ToxicFrog|W`rkn>
This means you can load multiple Glade XML files (or the same file multiple times) and use them all.
15:49
<@ToxicFrog|W`rkn>
I've also split glade_xml_autoconnect into a seperate function - there are few situations in which you'll actually want to use it directly in a gtk-server program, and all the messages from Glade on stderr are distracting.
15:50
< Vornicus>
Why can't I be as awesome a programmer as you? :P
15:50
<@ToxicFrog|W`rkn>
Tjere
15:50
<@ToxicFrog|W`rkn>
There's nothing awesome about this code ;.;
15:51
< Vornicus>
sad.
15:51
<@ToxicFrog|W`rkn>
Indeed.
15:51
<@ToxicFrog|W`rkn>
xml = (GladeXML *)(atol((char *)xml)); -- I mean, look at that
15:53
<@ToxicFrog|W`rkn>
Hmm. If I rearrange these arguments, I can get sane behaviour when the XML handle isn't passed in and avoid breaking existing code.
15:54
< Vornicus>
;_;
15:54
<@ToxicFrog|W`rkn>
Ok, API design question.
15:55
<@ToxicFrog|W`rkn>
If you call one of the glade functions without a handle, it uses whatever the curent default is.
15:55
< Vornicus>
the current defult handle, you mean?
15:55
<@ToxicFrog|W`rkn>
Yes.
15:55
<@ToxicFrog|W`rkn>
Should the default be set by -any- glade call, or only by the last load?
15:55
< Vornicus>
ok
15:55
<@ToxicFrog|W`rkn>
Ie, if I call gtk.server_glade_widget("WidgetName", XMLHandle2), is XMLHandle2 the new default?
15:55
< Vornicus>
I don't know anything about Glade, what's your workflow usually look like?
15:56
<@ToxicFrog|W`rkn>
Design UI in Glade, export XML file; load XML file with glade_xml_new, optionally connect signal handlers with glade_xml_signal_autoconnect, perform any final initialization that needs doing (trees, for example, must be constructed at runtime).
15:57
<@ToxicFrog|W`rkn>
Hmm. I think I'll have load set the default, but also add an explicit glade_xml_set_default function.
16:00
<@ToxicFrog|W`rkn>
gtk_server_glade_set_default(). Return the new default handle, or the previous one?
16:01
<@ToxicFrog|W`rkn>
Former's easier to code >.>
16:03
< Vornicus>
I'd prefer the new one, personally - I'm matching it against IRC here, though, where your nick and joins and so forth are confirmed by the server.
16:03 * ToxicFrog|W`rkn nods
16:04
<@ToxicFrog|W`rkn>
If you need the old one, you just call it with no arguments.
16:05
<@ToxicFrog|W`rkn>
The bit that terrifies me is that this code, despite looking like the spawn of Shub-Niggurath's black womb, is all 64-bit clean.
16:05
< Vornicus>
hee.
16:06
< Vornicus>
By the way, question for you in #lua.
16:07
<@ToxicFrog|W`rkn>
The "LuaSDL" he refers to is almost certainly the one listed on the wiki, LuaSDL 4.0.
16:07
<@ToxicFrog|W`rkn>
Mine hasn't been released publically yet; you're the only person apart from myself to have the code.
16:08
< Vornicus>
aha
16:13 Reiver is now known as ReivZzz
16:29 MyCatVerbs [~rb6822@Nightstar-18641.cs.bris.ac.uk] has quit [Quit: Swim, swim, hungry!]
17:09 You're now known as TheWatcher[afk]
17:28
<@ToxicFrog|W`rkn>
Man, monday is going to be interesting.
17:29
<@ToxicFrog|W`rkn>
First, I submit a 2,000 item changelist that touches the build system, the bind files, and headers in every module in the system.
17:29
<@ToxicFrog|W`rkn>
Then, my dad submits a 200 item changelist that adjusts kernel data structures and requires a full rebuild.
17:30
<@ToxicFrog|W`rkn>
So, basically, 90% of the developers will need to resync, resolve at least one file's worth of changes, and then do a complete recompile of everything.
18:31 You're now known as TheWatcher
18:36 AnnoDomini is now known as Lerhir
19:25 ChalcyZzz is now known as Chalcedon
22:07 You're now known as TheWatcher[T-2]
22:11 You're now known as TheWatcher[zZzZ]
22:49 Thaqui [~Thaqui@Nightstar-26619.jetstream.xtra.co.nz] has joined #code
22:49 mode/#code [+o Thaqui] by ChanServ
23:11 ToxicFrog|W`rkn is now known as ToxicFrog
--- Log closed Sat Jul 21 00:00:42 2007
code logs -> 2007 -> Fri, 20 Jul 2007< code.20070719.log - code.20070721.log >