code logs -> 2007 -> Sun, 04 Feb 2007< code.20070203.log - code.20070205.log >
--- Log opened Sun Feb 04 00:00:07 2007
00:00
< Janus>
When one is faced with switching to dial-up, they tend to keep their connection busy.
00:02
< Vornicus>
Dreamweaver is a very nice tool for HTML and CSS editing.
00:02
< Vornicus>
I have, on occasion, been able to fool it, but only with some somewhat esoteric CSS options
00:03
<@ToxicFrog>
...ok, Dicing Knight is surprisingly addictive.
00:03
<@ToxicFrog>
Not as addictive as Cave Story, mind you.
00:03
< Vornicus>
"dicing knight"
00:03
< Vornicus>
?
00:04
<@ToxicFrog>
Indie WonderSwan Color game.
00:04
<@ToxicFrog>
A realtime roguelike. Battle your way through randomly generated dungeons. You get a score at the end (after either dying, or clearing the dungeon) and your experience - and thus your level - is the total of your *high scores*.
00:05
< Vornicus>
....that sounds kinda cool.
00:05
<@ToxicFrog>
Doesn't have the same depth of gameplay as Nethack or even Rogue, but it's lots of fun.
00:07
< Vornicus>
ah, an agtp project
00:07
<@ToxicFrog>
Yep.
00:07
<@ToxicFrog>
Everyone over in #aeongen is playing it.
00:08
<@ToxicFrog>
Well, that or La-Mulana.
00:08
< Vornicus>
Okay, it's an ips patch, I can handle that bit, now I just need to find the japanese version. Well, that, or poke you to death with it.
00:09
< Vornicus>
What network is #aeongen on?
00:09
<@ToxicFrog>
Darkmyst.
00:09
<@ToxicFrog>
And hang on a moment
00:10
<@ToxicFrog>
http://sourceforge.jp/projects/oswan/ -- WSC emulator
00:10
< Vornicus>
I have a Wonderswan emu.
00:10
<@ToxicFrog>
http://forums.selecbutton.net/viewtopic.php?t=1416 -- via google
00:10
<@ToxicFrog>
Aah. Which one?
00:10
< Vornicus>
Oswan, apparently.
00:13
< Vornicus>
...well that's not very encouraging.
00:13
<@ToxicFrog>
?
00:14
< Vornicus>
The emulator doesn't open.
00:14
<@ToxicFrog>
;.;
00:15
< Vornicus>
indeed. ;_;
00:15
<@McMartin>
http://www.livejournal.com/userpic/55917210/8007645
00:15
<@ToxicFrog>
Got Drill Arm!
00:15
< Vornicus>
yey omgwtfbbq
00:15
<@McMartin>
<3
00:18
< Vornicus>
meanwhile, I am still trying to figure out Javascript.
00:18
< Vornicus>
the apparent lack of coherent documentation is not helping.
00:21 * McMartin has the Rhino Book.
00:21
< Vornicus>
That's O'Reilly's Javascript book?
00:21
<@McMartin>
O'RLY!
00:22
<@McMartin>
Or, perhaps, Ya'Reilly.
00:23 * Vornicus is trying to figure out how to, given a select box and an image, change the image when the select box gets changed.
00:23
<@McMartin>
Also, Vorn, can you recommend a book on Ruby that won't make me walk away in disgust halfway through the introduction?
00:23 * ToxicFrog clears Lindwurm, beats his previous score by 300 points.
00:24
<@McMartin>
Not even CHUNKY BACON could save me last time I tried.
00:24
<@ToxicFrog>
Vornicus: probably onSelect or something.
00:24
< Vornicus>
McM: The one I recommend for new programmers is Learn To Program, which is pretty good. You're /decidedly not/ a new programmer, though, so Idunno.
00:25
<@McMartin>
Every time I've looked at Ruby materials I get something like:
00:25
<@McMartin>
"Ruby is insanely simple and intuitive. Look at this!"
00:25
<@McMartin>
#*@&$@^O(!I!@#MKSDK:::$NO_CARRIER
00:25 * Reiver snerks.
00:25
<@McMartin>
"Isn't that simple and easy? But wait, there's more!"
00:25
< Vornicus>
I've never quite gotten that.
00:25
<@McMartin>
And then I say "No." and leave.
00:25
<@ToxicFrog>
And then you get something that looks like Perl that's been reduced to eight-point font and run through the fax?
00:25
<@ToxicFrog>
...yeah.
00:25
<@ToxicFrog>
This has also been my experience with Ruby.
00:26
<@Reiver>
http://starship.python.net/crew/mwh/hacks/objectthink.html
00:26
<@Reiver>
I am not sure what to make of this.
00:26
<@McMartin>
Vorn: That was roughly my reaction to the Poignant Guide.
00:26
< Vornicus>
The Poignant Guide is, well, I don't know.
00:27
< Vornicus>
It's Completely Unsuitable For Learning Ruby.
00:27
<@McMartin>
It was also my reaction to Rails
00:27
<@McMartin>
Of course, maybe I've just been dealing with people who hype things too much.
00:28
< Vornicus>
So far you've mentioned a book that is completely incoherent, and a library that does things wrong.
00:28 * Reiver decides he'll just learn Python, thanks. >.>
00:28
< Vornicus>
Programming In Ruby is pretty good.
00:28
<@McMartin>
OK.
00:29 * McMartin may just start skipping introductions.
00:29
< Vornicus>
Learn To Program is very basic, but if you can handle the hand-holding it is quite nice.
00:29
< Vornicus>
Really the way I learned it was through Best Of Ruby Quiz.
00:30
<@McMartin>
Hmm.
00:30
<@McMartin>
I remember the Programming Ruby intro, too.
00:30 * McMartin skips it.
00:31
<@ToxicFrog>
I suspect, from my looks at Ruby, that learning it by simply reading the reference manual is impractical?
00:31
< Vornicus>
BoRQ has a lot of examples, and some of them get kinda long, but in general it shows just what you can do.
00:33
<@McMartin>
"First, some general observations. Ruby syntax is clean. You don't need semicolons at the ends of statements as long as you put each statement on a separate line."
00:33
<@McMartin>
These people have a different definition of "clean" than I do
00:33
<@McMartin>
Or maybe it's that I learned JavaScript first. =P
00:34
<@ToxicFrog>
No, I wouldn't classify that as clean either~
00:34
<@ToxicFrog>
Or rather, I don't see how it has any effect or lack thereof on the cleanliness of the syntax.
00:35
<@McMartin>
In JavaScript, it means that newlines cause statements to parse differently~
00:35
<@ToxicFrog>
(Lua doesn't require semicolons except in table declarations, but you are permitted to separate statements with them if you so desire)
00:35
<@McMartin>
Though if Ruby forbids Random Newlines, as JavaScript does not, it ducks most of the trouble.
00:36
< Vornicus>
Ruby deals with newlines the way Python does.
00:36
<@McMartin>
That's merely a "wart" then~
00:36
< Vornicus>
Which is to say, if you've got an unclosed bracket, it figures that the command continues.
00:37
<@McMartin>
Yeah. JavaScript chokes on, say, "return\n3;" which it reads as "return; 3;".
00:38
<@McMartin>
Right
00:38
<@McMartin>
I think I have a more refined version of my question.
00:38
<@McMartin>
Is there a guide to Ruby that isn't absolutely convinced that every little bit of semantics and syntax is amazingly novel and totally optimum across all time forever?
00:39
< Vornicus>
Well, there's me. There's also Zenspider's quick reference sheet, which makes no judgements.
00:39
<@McMartin>
Programming Ruby has, so far, proclaimed every single language construct as one of its particular strengths
00:39
<@McMartin>
Where's the ref sheet?
00:40
< Vornicus>
http://www.zenspider.com/Languages/Ruby/QuickRef.html
00:40
< Vornicus>
But it doesn't handle most of the libraries.
00:41
<@McMartin>
I can deal with those later
00:43 * ToxicFrog skims it
00:43
<@ToxicFrog>
This looks like someone went "I will combine all of the best parts of Bash and Perl! AHAHAHAHAHAHAHA! *lightning bolt outside the windows of the castle*"
00:43
< Vornicus>
heh
00:45
<@McMartin>
The fact that someone went "I will combine all the best parts of PHP and Assembler!" and consider this a selling point instead of a horrifying abomination still makes me die a little inside.
00:45
<@McMartin>
Because, like, that was explicitly the goal.
00:45
<@ToxicFrog>
Yes.
00:45 * ToxicFrog weeps tears of bubbling pitch
00:45
< Vornicus>
...the best parts of php and assembler?
00:46
<@ToxicFrog>
Vornicus: NSIS.
00:46
<@McMartin>
That's a purported selling point of the NSIS scripting language.
00:46
< Vornicus>
00:46
<@ToxicFrog>
"combines the best aspects of PHP and assembler" is a direct quote from the documentation.
00:46
<@McMartin>
Like, they openly say those are the two things they're trying to combine to provide the most pleasant possible programming experience.
00:46
<@ToxicFrog>
The designers consider this a good thing.
00:47
< Vornicus>
insanity.
00:48 * McMartin sings the song that ends the world
00:48
<@ToxicFrog>
With one of your six mouths?
00:48
<@ToxicFrog>
Yes, that is an appropriate reaction to NSIS.
00:48
<@McMartin>
Also, this QuickRef sheet does not appear to actually explain the |foo| block syntax.
00:48
<@McMartin>
Despite using it to describe file processing.
00:48
<@McMartin>
I'm vaguely aware that this is similar but not identical to lambda closures.
00:49
< Vornicus>
It's talked about on like one line in Invoking A Method.
00:49 * ToxicFrog plays through dungeon #2 again, raises his score from 70 to 685 before starving to death on DL03
00:51
<@McMartin>
It is?
00:51
< Vornicus>
Yes, but not well.
00:51
<@McMartin>
Which line?
00:52
<@Reiver>
...
00:52
<@McMartin>
The closest I've found so far is expr.each do | name[, name]... |
00:52 * Vornicus looks
00:52
< Vornicus>
odd.
00:52
< Vornicus>
okay, so
00:53
< Vornicus>
you have a method that takes a block (you don't have to explicitly say you do, unless you want to pass the block somewhere else - to say you're taking a block, just say &block at the end of the method declaration)
00:54
<@ToxicFrog>
...you can't pass it in as just another argument?
00:54
<@McMartin>
And you can only pass in one?
00:54
< Vornicus>
You can pass it in as just another argument, but then you can't use yield on it.
00:55
< Vornicus>
Really these bits are about the hairiest part of Ruby, it's more complicated than I really understand.
00:55
<@McMartin>
This sounds like something somewhere between coroutines and generators.
00:56
< Vornicus>
It's kinda like those, sorta
00:56
<@McMartin>
ARG NO
00:56 * McMartin beats the writers
00:57
< Vornicus>
The writers of what?
00:57
<@McMartin>
DO NOT TEACH A LANGUAGE IN WHICH YOU PULL NEW METHODS OUT OF YOUR HAT BEFORE EXPLAINING THEM
00:57
<@McMartin>
Programming Ruby.
00:57
< Vornicus>
ah
00:57
<@McMartin>
Java Tutorial writers are also horribly notorious for this.
00:58
<@McMartin>
The way Ruby is structured, these generator things should honestly be introduced before arrays.
00:58
<@McMartin>
Because you can't use arrays properly without understanding them.
00:58
<@ToxicFrog>
How do you mean "pulling new methods out of your hat before explaining them"?
00:58
<@ToxicFrog>
Do you consider this the same as, say, showing something, and then immediately dissecting and explaining it?
00:59
<@McMartin>
No
00:59
<@McMartin>
I mean, doing a complete worked example.
00:59
<@McMartin>
And then saying "Actually, we shouldn't do this, because array.find exists, and it uses a construct I haven't mentioned before now.
00:59
<@McMartin>
"
00:59
<@McMartin>
"Nor did I mention that arrays have methods like find."
00:59
<@McMartin>
"In fact, never do anything like that example I gave above."
00:59
<@Reiver>
...
01:00
<@McMartin>
It's like teaching Java.Util by hand-implementing a linked list, and then saying "Actually, we could do this, but if we want to do anything interoperable, we probably should have used java.util.LinkedList."
01:00
<@ToxicFrog>
...
01:00
<@McMartin>
"...and while we're at it, in this case it really should have been java.util.HashSet."
01:00
<@McMartin>
http://www.whytheluckystiff.net/ruby/pickaxe/html/tut_containers.html
01:01
<@McMartin>
I began screaming at "Blocks and Iterators."
01:01
<@McMartin>
"This works, and it looks comfortingly familiar: a for loop iterating over an array. What could be more natural?
01:01
<@McMartin>
It turns out there is something more natural. In a way, our for loop is somewhat too intimate with the array; it asks for a length, then retrieves values in turn until it finds a match. Why not just ask the array to apply a test to each of its members? That's just what the find method in Array does."
01:01
<@McMartin>
This is, ANIACT, the first mention of Array.find.
01:03
<@McMartin>
... Right. This is syntactic sugar for callbacks. OK.
01:05 * McMartin now believes he can at least basically parse Ruby code.
01:09 gnolam|Party [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has quit [Quit: ]
01:37 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
02:26
< Vornicus>
Hokay. Select tags have an onchange method.
02:28
< Vornicus>
To make a function get called when the select changes, I must then put a... function name? Something? into that attribute.
02:29
<@ToxicFrog>
A statement, I think.
02:29
<@ToxicFrog>
Like: onChange="handleChangedThing();"
02:29
< Vornicus>
I'm seeing that now.
02:30
< Vornicus>
now I need to figure out what data it knows, how I pass that data to a function outside the actual tag (because this sort of thing is all over the place), and, hm.
02:31
< Vornicus>
then I have to figure out whether I can merely change the src of an image.
02:31
<@ToxicFrog>
I know that changing the src of an image is doable, because AGTP does it. One moment while I RTFS.
02:32
<@ToxicFrog>
As for what data it knows - as far as I know you can't pass data directly to the onWhatever functions, but the page is in global space; you can access HTML elements by name (name="whatever") and get at their bits from javascript.
02:32
< Vornicus>
I wonder if you just assign a new value (it's a property) or if you must instead call a particular function.
02:33
<@ToxicFrog>
document.slideshow.src = NewImg[ImgNum];
02:33
< Vornicus>
it appears that there is a "this" object, which I think is the select tag.
02:33
<@ToxicFrog>
<img src="images/doukutsu/thumb/1.png" name="slideshow" border=0 height="240" width="320">
02:33
< Vornicus>
Okay.
02:33
< Vornicus>
...hey it /is/ a property.
02:33
<@ToxicFrog>
(where NewImg is an array of strings)
02:33
<@ToxicFrog>
Yep.
02:33
< Vornicus>
Okay. That makes my life easier.
02:34
<@ToxicFrog>
...in fact, the LJ "new post" screen does exactly this
02:34
<@ToxicFrog>
That is to say, sets an image based on what's chosen from a <select>
02:34
<@ToxicFrog>
So studying that may also be useful.
02:34
< Vornicus>
now I need to see about naming specific objects, because the trick about this is that I need to do this many times on one page.
02:37
<@ToxicFrog>
Gooo automatic HTML generation~
02:37
< Vornicus>
It's going in a big loop in my application.
02:37
<@ToxicFrog>
I wonder what happens if you give a bunch of tags name="foo" and then go document.foo.src="whatever"
02:37
<@ToxicFrog>
Does it change them all?
02:37
<@ToxicFrog>
Just the first one?
02:38
< Vornicus>
I don't know
02:38
< Vornicus>
I think it would be a bad idea though.
02:41
<@ToxicFrog>
I'm too lazy to read the spec.
02:42
< Vornicus>
Yeah, well
02:43
<@ToxicFrog>
(as if any browsers actually implemented the spec as written)
02:44
< Vornicus>
(yeah, right)
02:59 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: "That's not a dog you hit, it was a rat. Don't worry, it's getting back up."]
03:27 Reiver is now known as Daram
03:40 Daram is now known as Reiver
04:47 BlueTiger [BlueTiger@Nightstar-567.natsoe.res.rr.com] has joined #Code
05:17
< Vornicus>
Okay, let's see.
05:27
< Vornicus>
In order to do what I need to do, I believe I need to do some string manipulation, and that means I can't use the document.foo syntax.
06:01 BlueTiger [BlueTiger@Nightstar-567.natsoe.res.rr.com] has quit [Quit: ]
06:28 AnnoDomini [~farkoff@Nightstar-29664.neoplus.adsl.tpnet.pl] has joined #Code
06:34 AnnoDomini [~farkoff@Nightstar-29664.neoplus.adsl.tpnet.pl] has quit [Quit: Argh. Damnit.]
06:38 AnnoDomini [~farkoff@Nightstar-29664.neoplus.adsl.tpnet.pl] has joined #Code
07:54 Mahal is now known as MahalBEDD
08:14 gnolam [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has joined #Code
09:46 Jo}{n is now known as EvilDarkLord
10:12 You're now known as TheWatcher
12:50 Serah is now known as Serah-Lost
14:03 Vornicus is now known as Vornicus-Latens
14:18
<@ToxicFrog>
Vornicus-Latens: why not?
15:15 Reiver is now known as ReivZzz
16:41 gnolam [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has quit [Ping Timeout]
16:48 gnolam [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has joined #Code
17:20 You're now known as TheWatcher[afk]
17:32 AnnoDomini [~farkoff@Nightstar-29664.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
17:37 AnnoDomini [~farkoff@Nightstar-6881.neoplus.adsl.tpnet.pl] has joined #Code
18:01 gnolam [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has quit [Ping Timeout]
18:06 MahalBEDD is now known as Mahal
18:07 gnolam [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has joined #Code
18:49 You're now known as TheWatcher
19:04 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
19:04 mode/#code [+o Chalcedon] by ChanServ
19:34 AnnoDomini is now known as Kiers
19:35 BlueTiger [BlueTiger@Nightstar-567.natsoe.res.rr.com] has joined #Code
19:37 EvilDarkLord is now known as Thokk
19:46 BlueTiger [BlueTiger@Nightstar-567.natsoe.res.rr.com] has quit [Quit: ]
20:02
< Thokk>
Do any decent flash editors exist beside Macromedia's?
20:02
< Kiers>
Swish.
20:02
< Thokk>
Hmm?
20:03
< Kiers>
Dunno what company.
20:03
< Kiers>
It's a flash editor.
20:05 gnolam [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has quit [Ping Timeout]
20:12 gnolam [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has joined #Code
20:57 McMartin is now known as McMartin[adventures]
21:18 Kiers is now known as AnnoDomini
21:18 Thokk is now known as EvilDarkLord
22:23 You're now known as TheWatcher[T-2]
22:28 You're now known as TheWatcher[zZzZ]
22:36
< Vornicus-Latens>
TF: because in order to create the name of the object I need, I need to act on it like it's a string.
22:36 Vornicus-Latens is now known as Vornicus
22:36
<@ToxicFrog>
Aah.
22:36
<@ToxicFrog>
I think the JS-traditional way to do this is to create a string that performs that assignment, then call eval() on it
22:37
<@ToxicFrog>
Like, eval(sprintf("document.img_%d.src = foo", index))
22:39
< Vornicus>
eeew
22:39 * Vornicus thinks there's FindElementByName or some such.
22:41 Chalcedon is now known as ChalcyStressed
23:13 * ToxicFrog implements an undirected breadth-first search that solves the Missionaries and Cannibals problem.
23:15
< Vornicus>
Missionaries and Cannibals?
23:15
< Vornicus>
aha
23:17
<@ToxicFrog>
Yes. Like fox, chicken, corn (or, as I first learned it, BEM, astronaut, ice cream)
23:17
<@ToxicFrog>
Only harder.
23:17
< Vornicus>
hee
23:17 * Vornicus is currently running a brute-force probability analysis.
23:19
< Vornicus>
started about 5:30 this morning, it's about 2/3 done now.
23:19
<@ToxicFrog>
And once I've tested this, I need to implement an A* directed search that solves an eight-puzzle.
23:19
< Vornicus>
woo A*
23:20
<@ToxicFrog>
It is a new, but delicious concept to me.
23:21 * Vornicus needs to actually learn A* at some point.
23:22
<@ToxicFrog>
A* is actually very simple.
23:22
< Vornicus>
oh?
23:22
< gnolam>
Yep.
23:22
<@ToxicFrog>
First of all, it's like a breadth-first search, except you sort the queue of states to examine based on how tasty they are.
23:23
<@ToxicFrog>
Tastiness is the sum of two properties: distance from the initial state and estimated distance from the goal state.
23:23
< Vornicus>
and then you have a "tastiness" function?
23:23
<@ToxicFrog>
The former you get for free.
23:23
<@ToxicFrog>
The latter you can implement with any function that never overestimates the distance.
23:24
<@ToxicFrog>
This is an improved version of a directed search that only uses estimated distance from the goal, which works very fast but can easily generate sub-optimal solutions.
23:24
<@ToxicFrog>
So, for example, for an 8-puzzle:
23:24
<@ToxicFrog>
- distance from the start state is the number of moves it took to reach this state
23:25
<@ToxicFrog>
- estimated distance from the goal state is typically either the number of tiles not in place (each of them needs to moved at least once, so this never overestimates) or the total distance (in number of moves) each one is from its correct place
23:26
<@ToxicFrog>
And the tastiest state to examine next is the one where the sum of these two costs is lowest.
23:37
< Vornicus>
So it uses the same sort of priority queue setup that, say, Dijkstra uses.
23:38
<@ToxicFrog>
I have no idea what Dijkstra uses.
23:38
<@ToxicFrog>
Goddamn that name is hard to spell right.
23:39
< Vornicus>
Dijkstra, you have a priority queue where you store graph nodes (states) sorted by the current cost to get there from the start state.
23:41 ReivZzz is now known as Reiver
23:42
< Vornicus>
Since you can get to a particular state from multiple directions you have to either keep the queue clean by reordering it as nodes become less expensive, or just trashing already-seen nodes as they show up.
23:43
<@ToxicFrog>
Aah. Similar, but not the same.
23:43
<@ToxicFrog>
A* sorts using a combination of current cost and predicted final cost.
23:43
< Vornicus>
right.
23:44
< Vornicus>
I'm figuring that's the only real difference.
23:44
<@ToxicFrog>
Probably.
23:45
<@ToxicFrog>
(pruning duplicated states is Strongly Recommended in A*, as otherwise it's trivially easy to produce infinite loops in most UoDs)
23:45
< Vornicus>
UoDs?
23:45
<@ToxicFrog>
Universes of Discourse.
23:46
< Vornicus>
aha
23:57 GeekSoldier [IceChat7@Nightstar-4272.pools.arcor-ip.net] has joined #code
23:59 GeekSoldier [IceChat7@Nightstar-4272.pools.arcor-ip.net] has left #code []
--- Log closed Mon Feb 05 00:00:07 2007
code logs -> 2007 -> Sun, 04 Feb 2007< code.20070203.log - code.20070205.log >