code logs -> 2007 -> Mon, 05 Feb 2007< code.20070204.log - code.20070206.log >
--- Log opened Mon Feb 05 00:00:07 2007
00:01
<@ToxicFrog>
Yaye, it works
00:01
<@ToxicFrog>
Now for the A*
01:12 ChalcyStressed is now known as ChalcyUni
01:20 ChalcyUni [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
02:39 Reiver is now known as ReivOut
02:47
<@ToxicFrog>
Aah, I love it when a Makefile comes together.
02:47
<@ToxicFrog>
From Lua source and a plain Lua source tree, to BLCgenned binaries in a single command.
02:51
< Vornicus>
woohoo
02:53 gnolam [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has quit [Quit: Sleep]
03:19 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
03:19 mode/#code [+o Chalcedon] by ChanServ
03:26 ReivOut is now known as Reiver
03:48
<@ToxicFrog>
Hmm.
03:48
<@ToxicFrog>
Ok, I have an efficiency problem.
03:49
<@ToxicFrog>
As the list of states gets longer, sorting it becomes unworkably tedious.
03:51
< Vornicus>
How are you sorting right now?
03:51
<@ToxicFrog>
table.sort(), which is an unspecified sorting algorith,
03:51
<@ToxicFrog>
I'm switching to insertion sort.
03:51
<@ToxicFrog>
(performed on ::Add())
03:51
< Vornicus>
Insertion sort would probably be better.
03:52
< Vornicus>
...on the other hand if you can index it properly, a heap sort can probably do the job.
03:52
<@ToxicFrog>
Much, much, much faster now.
03:53
< Vornicus>
ten bucks it was a quicksort
03:53
<@ToxicFrog>
Although it still starts to bog down noticeably once the queue hits 250 or so.
03:54
<@ToxicFrog>
I may have to actually implement a heap
03:54
<@ToxicFrog>
It gets really slow (about one second per test) around 500 states
03:54
<@ToxicFrog>
But I don't know if I have time! This is due in an hour ;.;
03:55
<@ToxicFrog>
30019 ben 25 0 7924 6312 644 R 100 0.2 2:24.58 lua
03:55 * Vornicus thinks
03:56
< Vornicus>
The real pain here is that you have to hunt through the list killing stale ones.
03:56
<@ToxicFrog>
'stale'?
03:56
< Vornicus>
Stale states - states that are already in the list, but are more expe... wait a second.
03:57
< Vornicus>
The tastiness algorithm guarantees that a state you've already seen is at least as expensive the second time around.
03:57
< Vornicus>
So you don't /get/ any stale ones.
03:58
< Vornicus>
...wait, I don't know if that's true either.
03:58
<@ToxicFrog>
Furthermore, I'm already pruning duplicated states.
03:58
<@ToxicFrog>
Oh wait.
03:58
<@ToxicFrog>
Shit.
03:58
<@ToxicFrog>
No I'm not.
03:58
< Vornicus>
It's the pruning that might be the problem.
03:58
<@ToxicFrog>
No, because the pruning is a simple set-presence test when it enters Add().
03:59
<@ToxicFrog>
Have I seen this state before? Yes? No further action.
03:59
<@ToxicFrog>
So, I've modified it so that
03:59
< Vornicus>
well, okay.
03:59
<@ToxicFrog>
(1) pruning works, which wasn't the case before, which meant vast numbers of duplicated states
04:00
<@ToxicFrog>
(2) it inserts from the end backwards rather than from the front forwards, since most of the states it's adding will be as expensive or more so than the currently most expensive state
04:00
<@ToxicFrog>
This has resulted in vast performance increases.
04:00
< Vornicus>
Okay.
04:00
<@ToxicFrog>
I'm not sure if they're vast *enough*, though.
04:01
< Vornicus>
You're using a binary search algorithm for the insertion of course.
04:01
< Vornicus>
Also, how are you saying "have I seen this state before?"
04:01
<@ToxicFrog>
...no, actually, linear. Oops.
04:01
<@ToxicFrog>
I blame the fact that it's 2300.
04:01
<@ToxicFrog>
if prior[tostring(state)]
04:01
<@ToxicFrog>
then return
04:01
<@ToxicFrog>
else prior[tostring(state)] = true
04:01
<@ToxicFrog>
end
04:02
< Vornicus>
Okay, so that's just using the internal hashing mechanism. Ok.
04:03
<@ToxicFrog>
I know that the algorithm works; if I try it on something smaller it finds a solution fairly quickly.
04:03
<@ToxicFrog>
It's just horribly inefficient.
04:04
< Vornicus>
go from linear to binary and you should get about a hundred-fold increase in speed at 1,000.
04:04 * Vornicus thinks
04:04 * ToxicFrog nods
04:04
<@ToxicFrog>
or just Do It Right and implement AStarFringe as a heap, but this means spending time to actually remember how to do a heap, and it's time I don't think I have.
04:05
< Vornicus>
Arg, I keep getting the heap setup, but all the heap setups I can think of are not efficiently searchable.
04:05
<@ToxicFrog>
Well, it doesn't need to be searchable.
04:05
< Vornicus>
...ah, oh well
04:05
<@ToxicFrog>
It just needs to ensure that after any arbitrary sequence of insertions and removals, the item on top of the heap is the one with the highest tastiness factor.
04:05
<@ToxicFrog>
Which, in this case, means lowest (node.cost + node.state:CostTo())
04:10
<@ToxicFrog>
Ok, yes, binary search == mad speed.
04:10
<@ToxicFrog>
It's up to 3000 buffered states and it looks like the limiting factor is, in fact, how fast it can write to the terminal.
04:10
< Vornicus>
heh
04:10
<@ToxicFrog>
Unfortunately, it's also broken.
04:10
< Vornicus>
...oops
04:11
<@ToxicFrog>
It's examining some nodes out of order, and it's searching down to cost 15 when it should have found a solution at cost 4.
04:15
<@ToxicFrog>
Ok, the problem is that my binary-search insertion sort is broken.
04:16
<@ToxicFrog>
It's inserting states in the wrong places.
04:18
<@ToxicFrog>
Ok. There's the problem.
04:18
<@ToxicFrog>
(1) 1-indexed arrays (2) insert inserts before, not after
04:19
<@ToxicFrog>
So when the correct thing to do was "insert after element #2", it was saying "insert before element #1"
04:19
<@ToxicFrog>
That is fixed.
04:19
<@ToxicFrog>
And now it works! Mostly.
04:19
<@ToxicFrog>
Final printout of the solution is broken.
04:19
< Vornicus>
heh
04:19
< Vornicus>
I take it it's much much faster now than it was before.
04:20
<@ToxicFrog>
Much, much faster.
04:20
<@ToxicFrog>
...hmm. Ok, now that insertion is working I'm seeing that tastiness calculation is broken.
04:21
<@ToxicFrog>
Or perhaps my debugging of tastiness is broken.
04:22
<@ToxicFrog>
No, it's definitely the former.
04:22
<@ToxicFrog>
Ok, it's CostTo that's broken.
04:24
<@ToxicFrog>
Because I'm an idiot.
04:24
< Vornicus>
Isn't it always the way?
04:25
< Vornicus>
I was trying to write to a file yesterday: file("foo.txt", w)
04:25
<@ToxicFrog>
for i=1,8 do
04:25
< Vornicus>
tell me what's wrong with that.
04:25
<@ToxicFrog>
oldcoords = find_tile(board, i)
04:25
< Vornicus>
...heh, okay, that's pretty silly.
04:25
<@ToxicFrog>
newcoords = find_tile(target, i)
04:25
< Vornicus>
unless I miss my understanding of that first line.
04:25
<@ToxicFrog>
return newcoords - oldcoords
04:25
<@ToxicFrog>
end
04:25
<@ToxicFrog>
it's for(double i = 1.0; i <= 8.0; i += 1.0)
04:26
<@ToxicFrog>
That is to say, for i in [1..8] do
04:26
< Vornicus>
right
04:26
<@ToxicFrog>
The silly part is returning at the end of the first iteration.
04:26
< Vornicus>
heh
04:26
<@ToxicFrog>
Thus calculating the cost of tile 1 and none of the others.
04:26
<@ToxicFrog>
Much better.
04:28
< Vornicus>
So how much better is it?
04:28
<@ToxicFrog>
It finds a solution in seconds.
04:28
< Vornicus>
woohoo!
04:28
<@ToxicFrog>
And then crashes because the solution printout code is unfinished, but.
04:29 * Vornicus points and laughs.
04:29
<@ToxicFrog>
"Found a solution after 992 state examinations. util.lua:17: bad argument #3 to format: string expected, got table"
04:29
<@ToxicFrog>
stack traceback:
04:29
<@ToxicFrog>
(...)
04:35
<@ToxicFrog>
Finally. It's working.
04:36
<@ToxicFrog>
Now to finish documenting it, tar it, and hand it in.
04:47
<@ToxicFrog>
Ok, final build test go
04:48
< Vornicus>
meanwhile, my huge angry brute force calculation is 67/68 done.
04:51
<@ToxicFrog>
And sent!
04:51
<@ToxicFrog>
I'm rather proud of this build system.
04:54
< Vornicus>
what's so cool about it?
04:56
<@ToxicFrog>
Well, in addition to all my program source, it contains blcgen and a complete Lua source tree.
04:56
< Vornicus>
ok.
04:56
<@ToxicFrog>
When you invoke "make", it first builds Lua, then uses that to run blcgen to generate C from my program code, then links that against liblua to produce binaries.
04:56
< Vornicus>
..wow.
04:57
<@ToxicFrog>
(lua doesn't come installed standard on the lab machines)
04:59
<@ToxicFrog>
This should, in theory, turn Lua source -> binaries on *any* system with a working make and gcc.
04:59
< Vornicus>
Send me this thing, let us see what it does.
05:00
<@ToxicFrog>
...oh fuck oh fuck oh fuck
05:00
< Vornicus>
???
05:00
< Vornicus>
what?
05:00
<@ToxicFrog>
fatal bug in my code
05:00
<@ToxicFrog>
stand by
05:00
< Vornicus>
Oh god
05:00
< Vornicus>
Nice how you found it three seconds after midnight.
05:02
< Vornicus>
What is this bug?
05:03
<@ToxicFrog>
The trace code in TreeSearch tries to use an A* specific function even when doing breadth-first search.
05:04
<@ToxicFrog>
Ok. This one should work.
05:04
< Vornicus>
uh
05:04
< Vornicus>
That seemed a bit small.
05:04
<@ToxicFrog>
Although it won't trace on the Missionaries and Cannibals problem without modification.
05:04
<@ToxicFrog>
215kb?
05:04
< Vornicus>
5B
05:04
<@ToxicFrog>
...
05:05
< Vornicus>
I think it tried to resume or something.
05:05
< Vornicus>
Try again.
05:05
<@ToxicFrog>
It says it got 215kb worth of ACKs from you.
05:05
<@ToxicFrog>
Aah.
05:05 ktchase_9 [ktchase_9@202.150.121.ns-22220] has joined #code
05:05
<@ToxicFrog>
Anyways. Try unpacking it and doing "make" or "make test"
05:05 ktchase_9 [ktchase_9@202.150.121.ns-22220] has left #code []
05:07
< Vornicus>
-DLUA_USE_LINUX <--- that looks odd.
05:08
< Vornicus>
http://pastie.caboo.se/37929
05:08
< Vornicus>
And I get an error.
05:09
<@ToxicFrog>
Oh. Um.
05:09
<@ToxicFrog>
Edit Makefile.part1 and Makefile.part2 so that it does "make <your OS here>" instead of "make linux" when building Lua
05:09
<@ToxicFrog>
Sorry, forgot about that.
05:10 Reiver [~reaverta@IRCop.Nightstar.Net] has quit [Ping Timeout]
05:14
< Vornicus>
okay. edited to macosx, make clean && make
05:15
< Vornicus>
Your current system will not work on MacOS or Windows; both have case-insensitive filesystems.
05:15
< Vornicus>
ld: can't create output file: eightpuzzle (Is a directory, errno = 21)
05:15
<@ToxicFrog>
...
05:15
<@ToxicFrog>
OSX has a case-insensitive filesystem?
05:15
<@ToxicFrog>
DEATH
05:15
< Vornicus>
Yep.
05:16
< Vornicus>
Case insensitive, case preserving.
05:17
< Vornicus>
It also probably will not work on Cygwin, but I'm not certain.
05:20
< Vornicus>
on the other hand, missionaries and cannibals works.
05:23 * Vornicus tries to remember how to do this.
05:24
< Vornicus>
Okay, I have 4,000 files that need their extensions changed from .txt to .csv
05:24
<@ToxicFrog>
It won't work in Cygwin, since the underlying filesystem is case-insensitive.
05:25
< Vornicus>
They are two directories deep.
05:25
<@ToxicFrog>
for file in *.txt; do mv $file ${file/%.txt/.csv}; done
05:25
<@ToxicFrog>
Oh.
05:25
<@ToxicFrog>
One moment while I hone my find-fu
05:25
< Vornicus>
heh
05:33
<@ToxicFrog>
find . -name '*.txt -exec bash -c "export file='{}';"' mv "$file" "${file/%.txt/.csv}"' ';'
05:33
<@ToxicFrog>
Probably a more elegant way to do it, but that works.
05:34
< Vornicus>
That doesn't seem to work.
05:34
<@ToxicFrog>
Works on my system.
05:34
<@ToxicFrog>
What does it do on yours?
05:35
< Vornicus>
a > is a "continue..." prompt in bash, right?
05:35
<@ToxicFrog>
Yes.
05:35
< Vornicus>
That's what it does.
05:35
<@ToxicFrog>
Oh, wait.
05:35
<@ToxicFrog>
# this one will tell you what commands it's going to run without running them
05:35
<@ToxicFrog>
find . -name '*.txt' -exec bash -c "export file='{}';"' echo mv "$file" "${file/%.txt/.csv}"' ';'
05:35
<@ToxicFrog>
# this one does the actual commands
05:35
<@ToxicFrog>
find . -name '*.txt' -exec bash -c "export file='{}';"' mv "$file" "${file/%.txt/.csv}"' ';'
05:35
<@ToxicFrog>
I left off a ' in the earlier one
05:37
< Vornicus>
perfect, thank you!
05:50 Reiver [~reaverta@IRCop.Nightstar.Net] has joined #Code
05:50 mode/#code [+o Reiver] by ChanServ
07:19
<@Mahal>
A cron job to delete all files older than [x] date in [x] directory and it's subdirecties.
07:19
<@Mahal>
Go.
07:20
<@Mahal>
(Help pls.)
07:20 * Chalcedon apply hugs to Mahal
07:21
<@Reiver>
Mahal: Bad news is Vr0n and TF and McM are all sleepz0rs.
07:21
<@Reiver>
Reccomend asking tomorrow, or when jerith shows up.
07:21 * Mahal nod.
07:21
<@Reiver>
(Or when TW does too.)
07:24 * Vornicus is not sleepzors
07:24
< Vornicus>
let me see what I can do for you.
07:25 * Vornicus breaks out /his/ find-fu.
07:25
< Vornicus>
Mahal: *nix?
07:25
<@Mahal>
Yes
07:26
<@Mahal>
It is not hugely difficult, I am sure, but I have verry little linuxfu these days :(
07:26
<@Mahal>
VOrn: I thus far have find /home/ekmahal/public_html/comics/comics-archive-images -mtime -8 -name *.jpg > list.txt
07:26
<@Mahal>
It is not examining all my subdirectories.
07:26
< Vornicus>
okay, so you have got the age function set up. Okay, one moment.
07:27
<@Mahal>
Also it's getting things >inside< the last 8 days not >outside>
07:27 * Mahal knows she has *something* wrong
07:27
< Vornicus>
Aha.
07:27
< Vornicus>
should be +8, for one thing
07:28
<@Mahal>
.. hehe
07:28 McMartin[adventures] is now known as McMartin
07:28
< Vornicus>
Also, McM is not zleepzors
07:28
<@Mahal>
Apparently thus
07:29
<@Reiver>
Nor is Vorn!
07:29
<@Reiver>
Huh.
07:29
<@Reiver>
Hi Vorn
07:29
< Vornicus>
I'm not sure why it's not descendin the tree.
07:29
<@Mahal>
It is now.
07:29
<@Mahal>
It was only looking for *.jpg and there were nonjpg ones duh me.
07:29
< Vornicus>
okay.
07:29
< Vornicus>
let me see.
07:30
< Vornicus>
you don't want it killing dirs, either, let me seeeeeeeeee...
07:31
<@McMartin>
for find
07:31
<@McMartin>
-type f is "files only"
07:31
<@Mahal>
Yes.
07:31
< Vornicus>
find /yadda/ -mtime +8 -name yadda -type f -exec rm '{}' +
07:31
<@McMartin>
-type d is "dirs only"
07:31
<@Mahal>
tht's all I wanted.
07:31
<@Mahal>
-f
07:31
<@Mahal>
I need to keep the dirs.
07:31
<@Mahal>
find /home/ekmahal/public_html/comics/comics-archive-images -m time +14 -type f
07:31
<@Mahal>
That seems to do that I want.
07:31 * Mahal has been putting output into a text file to check.
07:32
< Vornicus>
warning, THIS COMMAND IS DANGEROUS. try it on a duplicate directory first to make sure it does what you want.
07:33 * Mahal nods at Vornicus?
07:33
< Vornicus>
(it will eat your files and then your kittens)
07:33 * Mahal has been suggested to put the previous command then this: | xargs rm -f 1> /dev/null 2> /dev/null 3> /dev/null
07:33
<@Mahal>
Yes?
07:33
<@McMartin>
Mahal: No, stick with thye -exec line
07:33
<@McMartin>
xargs has trouble with files that have shell-interpretable strings in them.
07:33 * Mahal blink pardon?
07:33
<@Mahal>
oh.
07:33
<@Mahal>
I never saw the exec bit.
07:34 * Mahal looks again.
07:34
<@Mahal>
OK.
07:34
<@Mahal>
so.
07:34
<@Mahal>
find /home/ekmahal/public_html/comics/comics-archive-images -m time +14 -type f -exec rm '{}' +
07:34
<@Mahal>
that line alone?
07:34
<@Mahal>
I also note this is running in a cron job.
07:34
<@Mahal>
If that makes a difference.
07:35
< Vornicus>
It should not.
07:35
<@McMartin>
You need a \; after the '{}'
07:35 * Mahal notes she is running this on a directory she doesn't care about if it goes walking /anywa/
07:35
<@Mahal>
find /home/ekmahal/public_html/comics/comics-archive-images -m time +14 -type f -exec rm '{}' + \;
07:35
<@Mahal>
?
07:35
<@Mahal>
or
07:35
<@Mahal>
find /home/ekmahal/public_html/comics/comics-archive-images -m time +14 -type f -exec rm '{}' \; +
07:36
<@Mahal>
?
07:36
< Vornicus>
uh
07:36
< Vornicus>
no?
07:36
<@McMartin>
The second.
07:36
< Vornicus>
McM, I wanted /all/ the files to go at once, unless that's loud.
07:36 Y_Y [~enterfutu@61.237.230.ns-11985] has joined #Code
07:36 * Mahal blinks, looks confused now.
07:36
< Vornicus>
"-exec command {} +"
07:36
<@Mahal>
OK.
07:36
<@McMartin>
-exec commands have to be terminated by \;, do they not?
07:36
< Vornicus>
according to the thing am reading.
07:36
<@Mahal>
Someone please explain what the + does.
07:37
<@Mahal>
The rest actually makes mostly sense.
07:37
< Vornicus>
semicolon uses /one at a time/, + uses /all of them/
07:37
<@Mahal>
... ah!
07:37
<@Mahal>
so I'm doing "find this" then "remove all you just found" y/n/other ?
07:37
<@McMartin>
Oh, I see
07:37
<@McMartin>
Yeah, + is what you want
07:37 * Mahal ... is trying to actually understand the command not just copy it
07:37
<@McMartin>
That's a new option to me.
07:37
<@Mahal>
OK.
07:37
<@Mahal>
find /home/ekmahal/public_html/comics/comics-archive-images -m time +14 -type f -exec rm '{}' +
07:37 * Vornicus lords his find-fu over McM
07:38
<@Mahal>
Consensus of clever people to leave it at that/
07:38
<@Mahal>
?
07:38
< Vornicus>
Yeah, but it's -mtime not -m time
07:38 * Mahal eyes.
07:38
<@Mahal>
Yes.
07:38
<@Mahal>
Typo me.
07:38
<@Mahal>
find /home/ekmahal/public_html/comics/comics-archive-images -mtime +14 -type f -exec rm '{}' +
07:38
< Vornicus>
Mhaal
07:38
<@Mahal>
heh.
07:38
< Vornicus>
You have been duly typo'd~
07:38
<@Reiver>
07:38 * Mahal ndos happily.
07:38
<@Mahal>
:)
07:38
< Vornicus>
That is your command.
07:38 * Reiver hurtkills Vr0n.
07:38 * Mahal tries is.
07:39 * Vornicus earns it
07:39
<@Mahal>
find: missing argument to exec
07:39
<@Mahal>
er
07:39
<@Mahal>
find: missing argument to '-exec'
07:40
<@McMartin>
Try "{}"
07:40
<@McMartin>
instead of '{}'
07:40
<@Mahal>
find: missing argument to `-exec'
07:41
<@Mahal>
Apparently this is not my argument :(
07:43
< Vornicus>
try \; instead of +
07:43
<@Mahal>
It required -exec rm "{}" \;
07:43 * Mahal ;)
07:43
< Vornicus>
I'm nost sure if... dammit
07:45
<@Mahal>
Final question
07:46
<@Mahal>
If I run at 0 0 * * * wll it run a) every midnight or b) smoething else?
07:46
< Vornicus>
Every midnight.
07:46
<@Mahal>
I thoguht so, but needed to check.
07:46
<@Mahal>
I have fucked up cron before now.
07:48 * Mahal thanks you greatly!
07:49 * Mahal has now halved her disk usage on her webhost.
08:09
< EvilDarkLord>
Would someone kindly remind me how to chmod permissions to all write recursively on a directory?
08:10
< Vornicus>
chmod -R a+w dir
08:10
< Vornicus>
you must, of course, own the file or be root.
08:11
< EvilDarkLord>
Ah, thanks.
08:28 Mahal is now known as MahalBEDD
08:32 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Quit: ]
08:49 You're now known as TheWatcher[afk]
08:57 GeekSoldier [IceChat7@Nightstar-6495.pools.arcor-ip.net] has joined #code
08:57
< GeekSoldier>
Morning, all.
09:57
< EvilDarkLord>
Good mornink!
10:00
<@Reiver>
Almost exactly an hour between them.
10:00
<@Reiver>
I sense a conspiracy.
10:10 * Serah-Lost turns Reiver into a hamster.
10:11 * Reiver eeps, runs frentically within a wheel!
10:11
< GeekSoldier>
it's a soumi-deutsch conspiracy.
10:11
<@Reiver>
soumi?
10:12
< Serah-Lost>
Finland.
10:12
<@Reiver>
Oh.
10:12
<@Reiver>
Why can't you all just use your proper english names? Eh? EH? What's the point in our arbitarily assigning names to you lot if you don't have the decency to /use/ them??
10:12
< Serah-Lost>
Finland in finnish = Suomi.
10:12 * Reiver tks, calls you all insane.
10:12
<@Reiver>
;p
10:13
< Serah-Lost>
Just like you call yourselves kiwis.
10:13
<@Reiver>
Nah, that's slang.
10:13
< GeekSoldier>
Ich bin Deutschlander!
10:13
< GeekSoldier>
Not really, I'm an American werewolf in Darmstadt.
10:31 You're now known as TheWatcher[wr0k]
10:44 Y_Y [~enterfutu@61.237.230.ns-11985] has quit [Quit: ]
11:17 MyCatVerbs [~rb6822@Nightstar-23374.cs.bris.ac.uk] has joined #code
11:49 Serah-Lost [~-@87.72.36.ns-26407] has quit [Quit: Don't try to read the quit message, that is impossible. Instead only realize the truth; "there is no quit message" and you will see it is not you who read the quit message but the quit message who reads you.]
12:42 MyCatVerbs [~rb6822@Nightstar-23374.cs.bris.ac.uk] has quit [Quit: Swim, swim, hungry!]
12:51 gnolam [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has joined #Code
13:02 Reiver is now known as ReivZzz
14:20 Vornicus is now known as Vornicus-Latens
15:33 You're now known as TheWatcher[afk]
16:25 You're now known as TheWatcher
17:22
<@ToxicFrog>
argh
17:22 * ToxicFrog stabs Lua's handling of the __len operator overload
17:22
< GeekSoldier>
what's wrong, TF?
17:23
<@ToxicFrog>
The way lua implements operator overloads is that they are fallbacks, not replacements.
17:23
<@ToxicFrog>
So, for example, overloading __index (the table index operator []), the overload only kicks in if the primitive version doesn't work, ie, if there's no table entry at that index.
17:23
< GeekSoldier>
how is that at all beneficial?
17:23
<@ToxicFrog>
But __len always works on tables - it just returns 0 on tables that don't have numeric indices.
17:24
<@ToxicFrog>
So basically, you can only supply a custom length operator # on userdata.
17:24
<@ToxicFrog>
I don't know. Along with the lack of continue, it is one of my two complaints about Lua.
17:24
<@ToxicFrog>
But continue can be easily worked around.
17:25 You're now known as TheWatcher[afk]
17:32 AnnoDomini [~farkoff@Nightstar-6881.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
17:37 AnnoDomini [~farkoff@Nightstar-29191.neoplus.adsl.tpnet.pl] has joined #Code
17:41
<@ToxicFrog>
It makes me want to implement this thing as a C extension, because then I can use full-userdata and overload any operation I please.
17:43 * ToxicFrog thinks about how he would actually implement that.
17:57
<@jerith>
With a spoon.
17:57
<@ToxicFrog>
Hmm.
17:57
<@ToxicFrog>
On the one hand, it means vastly more powerful operator overloads.
17:58
<@ToxicFrog>
On the other hand, it breaks compatibility with libsurtr.
17:58
<@jerith>
Is it worth it?
17:58
<@jerith>
Or is that what you're trying to figure out?
17:59
<@jerith>
libsurtr isn't a library for surreptitious translations, is it?
18:08 MahalBEDD is now known as Mahal
18:10
<@ToxicFrog>
No, it's a library for message-passing preemptive multithreading.
18:11
<@ToxicFrog>
Due to the way it's implemented you cannot safely pass full userdata between threads.
18:13
<@ToxicFrog>
And yes, whether it's worth it is one of the things I'm trying to figure out.
18:14
<@ToxicFrog>
One kind of workaround is to define __send and __recieve methods.
18:15
<@ToxicFrog>
Which could work; you define __send so that it returns some kind of implementation-specific serialization object, and __recieve which takes that object and generates an actual Object from it.
18:15
<@ToxicFrog>
Hmm. Yes, I think this could work.
18:18
<@ToxicFrog>
So then we get something like
18:18
<@ToxicFrog>
function Symbol:__send()
18:18
<@ToxicFrog>
return { Symbol.__recieve, self.text, self.width }
18:18
<@ToxicFrog>
end
18:19
<@ToxicFrog>
function Symbol:__recieve(table)
18:19
<@ToxicFrog>
return Symbol:New(table.text, table.width)
18:19
<@ToxicFrog>
end
18:22
<@ToxicFrog>
And of course we define an appropriate ctor.
18:23
<@ToxicFrog>
Which leaves the actual implementation...
18:24
<@ToxicFrog>
So. An object is a full userdata which consists of some uniq key into the LUA_REGISTRY.
18:25 You're now known as TheWatcher
18:25
<@ToxicFrog>
Hmm. Actually, no. It doesn't necessarily contain anything. It does, however, have as its environment a lua table.
18:25
<@ToxicFrog>
This table contains all the actual object members.
18:26
<@ToxicFrog>
...hmm. Now I'm having metatable woes.
18:26
<@ToxicFrog>
Any of these userdata needs a metatable that defines __index and __newindex.
18:27
<@ToxicFrog>
But they also need a metatable for the actual operator overloads..
18:27
<@ToxicFrog>
I wonder if you can define metatables for metatables.
18:29
<@ToxicFrog>
Nope.
19:27 Serah-Lost [~-@Nightstar-28403.proxy2.balk.dk] has joined #Code
19:40 GeekSoldier [IceChat7@Nightstar-6495.pools.arcor-ip.net] has left #code []
19:51 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
19:51 mode/#code [+o Chalcedon] by ChanServ
20:30 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
20:30 mode/#code [+o Chalcy] by ChanServ
20:31 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
21:07
<@McMartin>
... I thought Suomi was the language.
21:07 * McMartin says, reading backscroll from days ago
21:07
< AnnoDomini>
It is.
21:07
< AnnoDomini>
I think.
21:08
< AnnoDomini>
Suomi seems to be the word that defines everything Finnish.
21:08
< gnolam>
Nah. That would be "sisu".
21:09
<@McMartin>
I'm pretty sure English uses "Finno-" as the prefix, but I'd have to find a history of WWII to make sure.
21:28
< EvilDarkLord>
Suom- is the Finnish equivalent for that. Everyone else uses Finn-.
21:38 Serah-Lost [~-@Nightstar-28403.proxy2.balk.dk] has quit [Quit: Don't try to read the quit message, that is impossible. Instead only realize the truth; "there is no quit message" and you will see it is not you who read the quit message but the quit message who reads you.]
22:01 ReivZzz is now known as Reiver
22:06
<@Reiver>
ToxicFrog?
22:06
<@Reiver>
You had a computer setup that you gave me the basic gist of the other day.
22:06
<@Reiver>
Would you mind hunting up the specifics and relaying them here, so I may investigate how much such a rig would cost in NZ?
22:09
<@ToxicFrog>
Sapphire Radeon X1950 Pro (PCIE); AMD Athlon 64 X2 3800+ (65W variant); 1GB of DDR2 memory; and an ASUS I-forget-the-model-number AM2/PCIE motherboard.
22:10
<@ToxicFrog>
If you're building a complete system from scratch, stuff like case, PSU, hard and optical drives, soundcard, video capture card, monitor, speakers, keyboard, etc will also be necessary.
22:10
<@Reiver>
Nah
22:10
<@Reiver>
Well
22:10
<@Reiver>
Case + PSU will be needed.
22:10
<@Reiver>
Is it too much effort to dig up the model number of the motherboard?
22:11 * Reiver shudders at mobos, knows jack about them.
22:12
< AnnoDomini>
Case is optional. :)
22:13
<@Reiver>
Nah
22:13
<@Reiver>
Needs to be able to travel.
22:13
<@Reiver>
So case is needed.
22:13
< AnnoDomini>
Ah.
22:15
<@ToxicFrog>
Reiver: one moment
22:15
<@ToxicFrog>
ASUS M2V
22:15
<@ToxicFrog>
Which is a fairly basic PCIE motherboard.
22:15
<@ToxicFrog>
And motherboards aren't that hard to grok.
22:16 You're now known as TheWatcher[T-2]
22:16
<@Reiver>
Too many numbers!
22:16
< AnnoDomini>
Meh.
22:17
< AnnoDomini>
I tell motherboards apart by the looks.
22:17
< AnnoDomini>
Ie. what it has on it.
22:19 * ToxicFrog nods
22:19
<@ToxicFrog>
Basically, they can be distinguished by (1) what they have built in, (2) what kind of processor they accept, (3) what kind of memory they accept (and how much), and (4) what kind of expansion slots they have.
22:20 * AnnoDomini smiles.
22:21 You're now known as TheWatcher[zZzZ
22:21
<@Reiver>
And then what make/model they are, because there are duds out htere on a semi-regular basis.
22:21 You're now known as TheWatcher[zZzZ]
22:21
<@ToxicFrog>
As in, what reputation the company in general and this model in specific has?
22:22
<@Reiver>
Yeah.
22:22
<@Reiver>
I know Asus is 'usually pretty good', but there have been duds all the same.
22:25 * ToxicFrog nods
22:25
<@ToxicFrog>
And their video cards kind of suck, in my experience.
22:25
<@ToxicFrog>
However, I did my research, and this motherboard has a good rep.
22:32 Serah-Lost [~-@87.72.36.ns-26407] has joined #Code
22:41
<@Reiver>
Sweet. Cheers.
22:41
<@Reiver>
(This is why I asked because if I get *that* one, it saves *me* doing all that research etc.)
22:41
<@Reiver>
(Given it was more or less what I wanted anyway...)
22:43 * Serah-Lost dances with Reiver.
22:43 * Reiver collapses on Serah.
22:43 * Serah-Lost snuggles Reiver
22:44 * Reiver huggles back.
22:44 * Reiver is ill.
22:44
<@Reiver>
Why are you lost?
22:46
< Serah-Lost>
SO arriving tomorrow.
22:46
< Serah-Lost>
Lost to the world in 10 hours 4 minutes and 3 seconds.
22:46
<@Reiver>
Oh.
22:46
<@Reiver>
Yeah, don't be /quite/ so certain on the 3 seconds.
22:46
<@Reiver>
Airplanes are less accurate than clocks. ;p
22:46 * Reiver hug Serah. Have fun though eh?
22:47
< Serah-Lost>
Of course.
22:55 BlueTiger [BlueTiger@Nightstar-567.natsoe.res.rr.com] has joined #Code
23:05 Chalcy is now known as Chalcedon
23:07 BlueTiger [BlueTiger@Nightstar-567.natsoe.res.rr.com] has quit [Quit: ]
--- Log closed Tue Feb 06 00:00:07 2007
code logs -> 2007 -> Mon, 05 Feb 2007< code.20070204.log - code.20070206.log >