code logs -> 2009 -> Fri, 07 Aug 2009< code.20090806.log - code.20090808.log >
--- Log opened Fri Aug 07 00:00:17 2009
00:13 Derakon[afk] is now known as Derakon
00:33 You're now known as TheWatcher[T-2]
00:34
<@Derakon>
I shall share the brainteaser I had to solve at my interview today, because I found it interesting.
00:34
<@Derakon>
There's a sequence of nine gnomes traveling in a line through the forest. Each gnome is taller than the ones in front of him, such that the shortest gnome is standing in front and the tallest gnome can see all of his companions.
00:35
<@Derakon>
The gnomes are approached by a troll. "I shall put a hat -- either white, or red, on each of your heads, such that you cannot see your own hat color. Then I want you to each tell me what color your hat is, starting with the tallest of you, and ending with the shortest. If you get your color wrong, I will eat you."
00:36
<@Derakon>
"You are only allowed to say the color, and if you try to communicate anything else I'll catch you and eat you before you can."
00:36
<@Derakon>
The gnomes know about this troll, and have devised a plan to ensure that eight of them at least will survive. What is their plan?
00:36
<@McMartin>
This is a variant of a classic puzzle.
00:36
<@Derakon>
Very likely.
00:37
<@McMartin>
It's different due to differing information between gnomes.
00:37
<@McMartin>
And due to ordering.
00:37
<@McMartin>
In the classic one everyone can see everyone and the goal is to be the first to deduce your own hat color.
00:38 You're now known as TheWatcher[zZzZ]
00:39
<@Derakon>
In this one, each gnome knows a) what the previous gnomes have said, b) whether or not they were eaten, and c) what the gnomes in front of him are wearing.
00:39
< Namegduf>
Hmm. I suck at these.
00:39 * TheWatcher[zZzZ] eyes
00:39
<@Derakon>
It took me quite a while to figure it out.
00:40
<@Derakon>
Straight-up guessing will, over an infinite number of gnomes, get you about 4.5 survivors.
00:40
< Namegduf>
It's "at least", though, not on average, so I assume it's not a statistical game?
00:40
<@Derakon>
Right.
00:40
<@McMartin>
I strongly suspect that... wait.
00:40
< Namegduf>
I figured the first gnome could say the colour of the next gnome, who can then get through okay, but, hmm.
00:40
<@McMartin>
OK, I got it.
00:41
<@Derakon>
Fundamentally, the first guy to go is screwed.
00:41
<@Consul>
YAY! Just beat level 29!
00:41
<@McMartin>
The problem, that is.
00:41 * Derakon nods.
00:41
<@McMartin>
Yeah, first to go has 50%.
00:41
<@Derakon>
But you are guaranteed to be able to save the rest.
00:41
<@TheWatcher[zZzZ]>
so does the second, unless there is some kind of pattern, which isn't stated
00:41
<@Derakon>
Not true!
00:42
<@Derakon>
(And there is no pattern. Distribution of hats is entirely arbitrary)
00:42
<@ToxicFrog>
Offhand, the classic version (everyone sees everyone, first to solve) doesn't seem solvable unless you know how many hats there are of each colour.
00:42
<@McMartin>
This is where "answers that encode results" is necessary.
00:42
< Rhamphoryncus>
Yeah, I don't see any correlations
00:42
<@McMartin>
TF: I believe you know that there is at least one of one color, and the only answer that produces a solvable problem is "all hats are that color".
00:42
<@Derakon>
You need for the first gnome to, in the way he gives his answer, tell the next gnome how to derive his hat color.
00:42
<@ToxicFrog>
Aah.
00:42
<@Derakon>
There need not be at least one hat of both colors.
00:42
<@ToxicFrog>
Derakon: but if all you can say is "red" or "white"...
00:42
<@Derakon>
They could all be white, or all black.
00:43
< Rhamphoryncus>
First guy gives even or odd of one of the hat counts?
00:43
<@Derakon>
Does that work?
00:43
<@TheWatcher[zZzZ]>
Yeah, I can't see how there can be any way to encode it given a single word response, no pattern, and potentially any number of either colour
00:43
< Namegduf>
...even or odd.
00:43
< Rhamphoryncus>
Once you know the hat counts then each person can see in front of them and hear the results of behind them
00:44
< Rhamphoryncus>
add them up, and you know what yours is
00:44
< Namegduf>
Yeah, that's clever. You can have the first guy die (possibly) to reduce it to a case of the classical problem.
00:44
< Namegduf>
(Well, sort of)
00:44
<@McMartin>
If the first guy lives, that's the other piece of info you need
00:44
<@Derakon>
Rhamphoryncus has it.
00:44
<@TheWatcher[zZzZ]>
Rhamph: So, how do you do that if you can only say "red" or "white"?
00:45
< Rhamphoryncus>
TheWatcher[zZzZ]: red is odd number of red hats, white is even number of white hats
00:45
<@McMartin>
Prearrange "red" to mean "even number of red hats in front of me"
00:45
<@Derakon>
TW: attach meaning to red and white. Say "red" is "there are an even number of white hats" and "white" is "there is an odd number of white hates".
00:45
<@Derakon>
Heh.
00:45
< Rhamphoryncus>
it's a bitwise XOR :)
00:45
< Rhamphoryncus>
a parity bit
00:45
<@McMartin>
l33t x0rxx0r1n6 sk1llz
00:45
<@Derakon>
Surely you mean x0rr0oxx0ring sk1llz.
00:46
<@TheWatcher[zZzZ]>
Huh, kay
00:46
<@McMartin>
That's for the Inferior Linked List.
00:46
<@TheWatcher[zZzZ]>
Anyway, slep
00:47
<@Derakon>
So the first gnome says "I see an even number of white hats (and therefore an even number of red hats." Then he dies, or not; it doesn't matter. The second gnome says "Ahh, I see an odd number of white hats; therefore, my hat must be white, to make the count even." The third gnome says "But I now see an even number of hats...but the guy before me said white, and lived; therefore, I also have a white hat." And so on.
00:47
<@Derakon>
You were much faster than I was. ¬.¬
00:47
< Rhamphoryncus>
figuring it out?
00:47
<@Derakon>
Yes.
00:48
< Rhamphoryncus>
your hint, the word "encoding", triggered it
00:48
<@Derakon>
Dang.
00:48
< Rhamphoryncus>
also, I happen to like ECC :)\
00:48
<@Derakon>
Yeah, afterwards, the interviewer asked "So what concept in compsci does this relate to?" and it took me a bit to think of checksums.
01:10 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Quit: Z?]
01:10 Myst [~Myst@Nightstar-29731.dsl.in-addr.zen.co.uk] has quit [Quit: "Everyone dies, but not everyone lives." -- A. Sachs]
01:18
<@Derakon>
In other news, http://www.doc.ic.ac.uk/~rb1006/projects:marioai
01:26
<@Vornicus>
Madness.
01:33
<@Consul>
God, all I see now are cute cartoon blocks flying around.
02:16 Vornicus [~vorn@ServicesOp.Nightstar.Net] has quit [Quit: Leaving]
02:19 Vornicus-Latens [Vornicus@Admin.Nightstar.Net] has joined #code
02:19 Vornicus-Latens is now known as Vornicus
02:35 Vornicus is now known as Phas
02:45 Syloqs-AFH [Syloq@ServicesAdmin.Nightstar.Net] has quit [Connection reset by peer]
02:54 Syloqs_AFH [Syloq@Admin.Nightstar.Net] has joined #code
02:55 Syloqs_AFH is now known as Syloqs-AFH
03:05 Janus [~nsJChat@Nightstar-15463.sip.pns.bellsouth.net] has joined #code
03:09
< Janus>
If I'm a Virtual Machine, and I see... "float something;" inside a function somewhere, do I set asside the memory for it (and all the other variables) when the function is called, or when I hit it inside the function?
03:09
<@Derakon>
Virtual machines are, as far as they are aware, exactly like real machines.
03:10
< Phas>
When you hit it inside the function, generally, for Java or C.
03:10
< Phas>
Or more precisely: memory gets allocated at the start of the block, and freed at the end of it.
03:11
< Janus>
What if it's nested inside an if block thingy..? Or should it be illegal to do that?
03:11
< Phas>
It's legal; if the declaration is inside an if block, then the variable will only exist inside the if.
03:12
< Janus>
Oh! That makes sense! (also, I did not know if blocks had scope... huh!)
03:12
<@Derakon>
Whether or not declaring variables later than the beginning of a function is legal depends on how recent the language is.
03:12
<@Derakon>
I think that's been legal C since the early 90's.
03:16
<@Derakon>
Idly, one of my interview questions today was "What does this print?". http://paste.ubuntu.com/248940/
03:16
<@Derakon>
And we spent about thirty seconds arguing over it before he realized that he'd meant to leave off the argument to checkMessage.
03:16
<@Derakon>
Er, changeMessage.
03:16
<@Derakon>
(He'd meant to ask a scoping question, see)
03:21
< Janus>
I'm not sure, but Bar is the least immediately right seeming, so it has to be it.
03:24
<@ToxicFrog>
As written, fails to compile~
03:24
<@Derakon>
Pass msg to changeMessage too.
03:25
<@ToxicFrog>
Foo.
03:25
<@Derakon>
Now don't pass it, and remove the argument to changeMessage.
03:25
<@ToxicFrog>
Bar.
03:28
<@Derakon>
And that understanding was what he was after, but he asked the question wrong. :)
03:35 Janus [~nsJChat@Nightstar-15463.sip.pns.bellsouth.net] has quit [Quit: Nightstar's Java Chat http://www.nightstar.net]
03:35 Janus [~nsJChat@Nightstar-15463.sip.pns.bellsouth.net] has joined #code
03:37 Attilla [~The.Attil@92.21.253.ns-11808] has quit [Quit: ]
03:39
< Janus>
This is probably obvious, but if a parameter, like, in, um 'thingy(iamaparameter){}' has the same name as a global, like in that one thing, how does the function know which to use? </questionbag>
03:39
<@Derakon>
It uses the one with the tightest scope.
03:40
<@Derakon>
But as a general rule, having names override each other like that is a bad idea.
03:41
< Phas>
Though often unavoidable, especially when you're writing code where there aren't many useful names.
03:43
< Janus>
Do the if/for/while things follow the same rule? I always figured 'for(int n; blah; blah)' would throw an error if 'n' was already defined.
03:44
<@Derakon>
Nope.
03:44
<@Derakon>
Any given set of curlies creates a new scope.
03:44
<@ToxicFrog>
And stuff in a for loop's (parens) counts as "inside the {}" for the purposes of scoping.
03:45
<@ToxicFrog>
Conceptually, you can think of it as a search from most general to most specific; so if you name a variable, it'll look for it in the block you're in; then the block enclosing that; then the block enclosing that; and once it's at the very top it'll look for a global with that name.
03:45
<@ToxicFrog>
If there are multiple variables with that name, it grabs the first one it finds - the one with the narrowest scope.
03:50
< Janus>
... that's so cool! And simple. Gaaff, I never seen anything about if/for/while/suchnsuch scopes in the c++ refs and tuts. You'd think it'd have it's own section.
03:52
< Phas>
Most of the time you don't want them.
03:52
< Phas>
And in many languages it doesn't work that way.
03:52
< Phas>
So usually I would avoid them.
03:52
<@Derakon>
Well, generally it's a good idea to keep variables as tightly bound as possible, to prevent accidental re-use of values.
03:59
< Janus>
*googles* ... You can even use the curly brackets by themselves!
03:59
<@Derakon>
Indeed, though I'd say any time you have cause to do that you should just go ahead and make a new function.
04:01 * Janus is a strange new world. Everything looks kinda sharp.
04:02
< Janus>
Oh. Are functions special scopes? At least, in relation to goto? Since you can use them to go to any block in a function, yet not from function to function?
04:02
< Phas>
DO NOT USE GOTO
04:02
<@Derakon>
Heh.
04:02
< Janus>
I won't! D:
04:03
<@Derakon>
It's more that creating a new scope generally indicates creating a solid "block" of code that has some unified purpose; functions are a similar concept and are more generally useful.
04:03 * Janus takes a moment to hide something in the lake
04:06
<@McMartin>
Gotos cannot leave functions.
04:06
< Janus>
Since they can be called whenever..? (hum, so you can't define functions in other functions either. Guess they are a little special)
04:06
<@McMartin>
Not in C++, but it's conceptually possible.
04:06
<@Derakon>
Mmmm, lambda.
04:06
<@Derakon>
Mmmm, closures.
04:06
<@McMartin>
It opens questions of what certain things mean, and if you answer them in certain ways, you can end up using nothing but nested function definitions to re-invent object-oriented programming.
04:07
<@McMartin>
I note also that "free"
04:07
<@McMartin>
Er
04:07
<@McMartin>
"free" braces {} in the middle of a function have a brutally practical use if you're writing strictly-ANSI-compliant C; that's the only way you can put new variable declarations in the middle of your functions.
04:07
<@McMartin>
UQM does that a good deal because C89 compliance is one of the project goals.
04:14
<@ToxicFrog>
<3 closures
04:15
<@McMartin>
That said, C++ doesn't have closures in the classic sense. The closest thing to them that it has are objects that override the operator() method and which also have fields in them.
04:16
< Janus>
Aren't they bringing closures in with the new C++ standard thingy? I heard lambda functions were in it, so...
04:17
<@McMartin>
I haven't studied it in detail; closures are lambdas with state, though.
04:17
<@McMartin>
They might
04:18
<@McMartin>
But a closure and a stateful callable object are exactly equivalent, and can be made so all the way down to the binary level.
04:18
<@ToxicFrog>
Knowing C++, every compiler will implement different behaviours for them ;.;
04:31 Namegduf [namegduf@82.25.200.ns-12231] has quit [Ping Timeout]
04:33
< Janus>
Snagged a copy of the C++98 standards. By the time I finish reading, it'll be made obsolete by C++0x. Thanks for endurin' all the questions by the way! I'll let you know how this c++ parser turns out!
04:34
<@McMartin>
C++98 didn't have working compilers until the mid-2000s; I'd say you have plenty of time to catch up.
04:34
<@Derakon>
You're writing a C++ parser?
04:34
<@Derakon>
Have fun.
04:35 Namegduf [namegduf@86.25.56.ns-26296] has joined #code
04:35 * Janus forgot the command that does the fancy quit messa-- '/quit'!
04:35
<@Derakon>
/quit insert message here
04:35
<@Derakon>
Heh.
04:36
< Janus>
Haha, and by 'let you know how it turns out' I mean 'when I give up violently'
04:36
<@ToxicFrog>
...why, exactly, are you writing a C++ parser?
04:36
<@ToxicFrog>
And what kind of parser is it?
04:37
< Janus>
Eitherway, "I made a c++ parser" sounds impressive. Maybe if I finish, I can trick someone into hiring me.
04:38
<@ToxicFrog>
....that's the only reason?
04:39
<@McMartin>
That a parser *in* or *for* C++?
04:39
< Janus>
Not really. xD Maybe a good sideeffect. But what it's for... um
04:42
< Janus>
It's kinda dumb, but I want to make an IdleMMO sorta thing with it. It'd take the code someone rights with it, turn it into little instruction bits that can be tracked, and impose memory and speed limits on those bits are executed. And there'd be robot things that are controlled by it. Like. Uh. there'd be a 'torque' variable for a wheel, or a 'iseethis' variable for an eye.
04:42
<@McMartin>
Aha. So, "in".
04:42
<@McMartin>
What's your background experience?
04:44
< Janus>
I sadly have very little right now. But I like taking really big things I can't finish and sinking time into them. Maybe, if anything, I'll learn some stuff from it~
04:45
< Janus>
It. Uh... parses numbers so far? :D...
04:45
<@Derakon>
Heh.
04:46
<@McMartin>
Do you have any background/books on parser writing?
04:46
< Janus>
I made sure to get all of them too. decimal, oct, hex, exponentual, float... though, using char arrays probably wasn't a very smart way to do it.
04:46
<@McMartin>
Numbers is a start.
04:46
<@McMartin>
Basically, your first step is a "lexer" - take one big string (the file) and make it into a list of objects ("tokens")
04:46
<@McMartin>
Numbers are one kind of token. "identifiers" (variables, etc.) are others.
04:46
< Janus>
Oh! that's what that's called?
04:46
<@Derakon>
Allow me to quote from a sig I saw on the GameDev.net forums: "If you are posting in For Beginners and your code contains "char", you have a bug. std::string roxxors the big one one one."
04:47
< Janus>
I seen that sig too. xD
04:47
<@Derakon>
And yeah, if you're going to write a parser, you should read up on parser design. :)
04:47
< Janus>
Right now, it breaks up the file into numbers, words, operators, and whitespace. Ignores comment blocks too. (finally)
04:47
<@McMartin>
Depending on whether you're aiming for learning OO or low-level programming, Appel's "Modern Compiler Implementation in Java" or "Modern Compiler Implementation in C" are good starts.
04:48
<@McMartin>
Aha. That's most of a lexer as is.
04:48 * Janus writes down
04:49
<@McMartin>
The defining textbook is actually "The Dragon Book": "Compilers: Principles, Techniques, and Tools", by Aho, Sethi, Ullman, and Lam.
04:49
<@McMartin>
That's probably more advanced than you seek, though.
04:49
< Janus>
Then... hrm. It classifies the words, numbers, and operators. The numbers and operators one is finished, so all that's left are words.
04:50 * Janus adds it to the list. Above the other ones.
04:50
<@McMartin>
Also, if you don't have Stroustrup's "The C++ Programming Language", that's a better language bible than the standard.
04:53
<@McMartin>
It's worth noting that parsers are an officially hard problem (much more so than lexers) so if this is a first project, you've got a bumpy ride ahead.
04:53
<@McMartin>
Lexers are *awesome* early projects though.
04:58
< Janus>
If I can so much as get it to do math on the console, I'll be happy. (which is why I didn't start in on categorizing the word tokens yet)
05:00
< Janus>
The lexer was surprisingly fun! Even if the code I wrote for it is... oh wow. Probably ugly by proffessional standards.
05:00
<@ToxicFrog>
Math is a nice easy starting point for parsing, yeah.
05:00
<@ToxicFrog>
The grammars are simple, it's easy to start small (say, addition and subtraction only) and work your way up, and it serves as a natural introduction to syntax trees.
05:01
<@ToxicFrog>
(I note that in practice, there are established tools for automatically generating efficient lexers and parsers from formal specifications; however, writing one yourself is great fun and teaches useful skills besides)
05:02
<@Derakon>
I'm still amused by the name Yet Another Compiler Compiler.
05:03
<@Derakon>
...according to Wikipedia, yacc has been supplanted by tools like Berkeley Yacc and GNU bison.
05:03
<@McMartin>
Bison is the standard, pretty much.
05:03
<@McMartin>
I detest it though.
05:03
<@McMartin>
I like parsec a lot
05:04
<@McMartin>
Java has a few
05:04
<@McMartin>
The language class yacc/bison/etc. use ("LALR(1)") is tricky to get precise errors out of.
05:04
<@Derakon>
I was mostly commenting on the name.
05:06 * Derakon blarghs, mutters at line-of-sight for board games.
05:07
<@Derakon>
Your options appear to be a) draw a line from player A to player B, and see if it passes through any obstacles.
05:07
<@Derakon>
And that's it.
05:07
<@McMartin>
Yeah.
05:07
<@McMartin>
You can play corner games like D&D4e, but that's about it
05:07
<@Derakon>
There's gotta be something that works reasonably well without requiring you to look like you're playing WH40k.
05:08
<@McMartin>
You can eyeball it easily enough on a square grid.
05:08
<@Derakon>
Mmm...
05:12
<@ToxicFrog>
I've had good experiences with Bison, but I've never used it to parse anything more complicated than pascal or C-.
05:12
<@ToxicFrog>
I've heard lots of good about Parsec.
--- Log closed Fri Aug 07 05:18:57 2009
--- Log opened Fri Aug 07 05:22:43 2009
05:22 TheWatcher[zZzZ] [~chris@Nightstar-29731.dsl.in-addr.zen.co.uk] has joined #code
05:22 Irssi: #code: Total of 12 nicks [6 ops, 0 halfops, 0 voices, 6 normal]
05:23 Irssi: Join to #code was synced in 50 secs
05:26 SmithKurosaki [~Smith@Nightstar-10011.dsl.teksavvy.com] has joined #code
05:28 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
05:28 Syloq [Syloq@Admin.Nightstar.Net] has joined #code
05:28 mode/#code [+o Chalain] by ChanServ
05:28 mode/#code [+o jerith] by ChanServ
05:28 mode/#code [+o Reiver] by ChanServ
05:28 mode/#code [+o MyCatVerbs] by ChanServ
05:28 mode/#code [+o Derakon] by ChanServ
05:28 mode/#code [+o Thaqui] by ChanServ
05:28 mode/#code [+o ToxicFrog] by ChanServ
05:29 Syloq is now known as Syloqs-AFH
05:29 SmithKurosaki is now known as NSGuest-1719
05:30
<@ToxicFrog>
Hmm. I kind of don't like how this is set up.
05:30 NSGuest-1716 [~mcmartin@76.202.197.ns-14219] has joined #code
05:30
<@ToxicFrog>
At the moment the lexer needs to know the distinction between control tokens (<>=+-@) and everything else.
05:30 Tarinaky [~Tarinaky@Nightstar-16638.plus.com] has joined #code
05:30 Janus [~nsJChat@Nightstar-15463.sip.pns.bellsouth.net] has joined #code
05:30
<@ToxicFrog>
This makes it hard (relatively speaking) to add new control tokens.
05:31 Rhamphoryncus [~rhamph@Nightstar-16476.ed.shawcable.net] has joined #code
05:31
<@ToxicFrog>
...hmm. Maybe add another attribute (value) to iothings, which lets the parser know if they have an associated value or not.
05:31
<@ToxicFrog>
Then it can error at parse time if try doing something like, say, foo:+8
05:31
<@ToxicFrog>
Or perhaps it should just permit that and assign nil to foo?
05:31
<@ToxicFrog>
Thoughts?
05:35
< Janus>
It'd be pretty harsh to check for nil on every integer. ... I think. :< (ruby?)
05:42
<@ToxicFrog>
I'm writing this in Lua.
05:42
<@ToxicFrog>
The parser is for a simple data structure description language.
05:42
<@ToxicFrog>
It uses <name><width> to indicate a data type; for example "u4" or "uint4" is a 4-byte unsigned int.
05:42
<@ToxicFrog>
You can prefix fields with name: to assign names to them in the returned data structure.
05:43
<@ToxicFrog>
But, some things aren't fields - they're control directives.
05:43
<@ToxicFrog>
"+8" for example is "seek forward 8 bytes"
05:43
<@ToxicFrog>
So, something like foo:u4 is "read a 4-byte unsigned int and store it in field 'foo'"
05:43
<@ToxicFrog>
But how should foo:+8 be handled?
05:44
<@ToxicFrog>
Is it a compile time error? A run time error? Or does it assign nil to foo?
05:44
<@ToxicFrog>
I am leaning towards "compile time error" even though this makes the parser more complicated.
05:50
< NSGuest-1716>
Hmm
05:50 NSGuest-1716 is now known as McMartin
05:51
< McMartin>
Compile-time is best, run-time is probably acceptable.
05:51
< McMartin>
But if you can represent it in a way that means you *can* catch it at run-time, you might as well be catching it at compile time.
05:51
< McMartin>
Unless you're parsing as you go, which it sounds like you aren't.
05:55 Consul_ is now known as Consul
05:56
<@ToxicFrog>
I'm not; I'm generating an AST, saving it for later, and walking it at unpack time.
05:57
<@ToxicFrog>
The distinction between runtime and compile time is: at runtime, you error if an IO handler returns nil rather than a value but you expect to store it.
05:57
<@ToxicFrog>
At compile time, you ask each IO handler referred to by the source whether it returns a value or not.
05:57
<@ToxicFrog>
Well, each named IO handler.
05:57
<@ToxicFrog>
Non-named ones are cool.
05:58 * ToxicFrog ponders IO handler semantics
06:02
<@ToxicFrog>
....hmm.
06:02
<@ToxicFrog>
Actually, I think the AST needs more data included in it than I thought.
06:02
<@ToxicFrog>
Each node needs a count of both how many bytes it will consume on read, and how many objects it requires on write.
06:03
< Phas>
Um.
06:04
< Phas>
Do you mean "compile time" in the sense of "I have parsed the string as an unpack format"?
06:04 Syloqs-AFH [Syloq@Admin.Nightstar.Net] has quit [Connection reset by peer]
06:05
<@ToxicFrog>
Phas: yes.
06:05
<@ToxicFrog>
"compile time" here is "the format string has been passed to io.(un)pack and I'm generating the structures describing the data to be manipulated"
06:06
<@ToxicFrog>
"run time" is "I am now packing or unpacking data from an fd or something with equivalent duck type"
06:53
<@Derakon>
Har.
06:54
<@Derakon>
Response to the interview question I was talking about earlier: "I'm sure there's a system somewhere that gives the gnomes a sufficient attack bonus to defeat the troll."
07:05 AnnoDomini [AnnoDomini@Nightstar-29769.neoplus.adsl.tpnet.pl] has joined #Code
07:05 mode/#code [+o AnnoDomini] by ChanServ
07:27 Derakon is now known as Derakon[AFK]
07:55 Phas is now known as Vornicus
08:17 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
08:17 mode/#code [+o gnolam] by ChanServ
09:06 Janus [~nsJChat@Nightstar-15463.sip.pns.bellsouth.net] has quit [Quit: Nightstar's Java Chat http://www.nightstar.net]
09:25 You're now known as TheWatcher
10:28 * TheWatcher is attempting to explain make and Makefiles in less than several trees worth of documentation, flails vaguely
10:31
<@gnolam>
Hah. Good luck.
10:31
< Vornicus>
Explain entirely, or explain in brief to someone who doesn't know how this stuff works.
10:34
< Vornicus>
cuz the latter I can do.
10:34
< TheWatcher>
I need to be able to get 2nd year undergrads who a) are just learning C, and b) have done nothing other than Java coding for a year, to a point where they can create and use makefiles to do basic independent compilation and linking stuff
10:35
< Vornicus>
Ouch.
10:35
< Namegduf>
Definite ouch.
10:36
< Namegduf>
With Autotools, or just make?
10:36
< TheWatcher>
(whilst fighting the temptation to tell the obnoxious little vermin to just go and read the goddamn GNU make documentation, the lazy sods)
10:37
< TheWatcher>
I'm just likely to go as far as explaining the basics of variables and rules, with some simple examples, and assume they'll kludge it from there
10:37
< Namegduf>
Yeah, while doing some crappy C stuff I decided to try to self-teach myself that a while ago, it was terrible.
10:37
< Namegduf>
Not the learning, that wasn't too hard.
10:37 * Vornicus hates make entirely.
10:37
< Namegduf>
The files, though... eurgh.
10:37
< Namegduf>
make is bad. Autotools is worse.
10:38
< TheWatcher>
Don't get me started on autotools >.>
10:38
< McMartin>
Makefile programming is best learned by cookbook, tbh
10:38
< TheWatcher>
Indeed. That or via prodigious use of LSD.
10:39
< McMartin>
Whip up a simple three line one with The Handy Patterns, give it to them, and tell them "put the target .o files here."
10:39
< McMartin>
If they have to mix C and C++ and this matters, feel free to steal Sable's makefile~
10:39
< McMartin>
Er, and gcc vs g++ matters, rather
10:41
< TheWatcher>
Nah, they're going nowhere near c++ matters, so it's not going to get anywhere near that. Thank goodness.
10:46 Myst [~Myst@Nightstar-29731.dsl.in-addr.zen.co.uk] has joined #code
10:46 mode/#code [+o Myst] by ChanServ
10:47
< McMartin>
If you really want to get fancy you can preload the template with the relevant makedepend calls.
10:48
< McMartin>
http://hkn.eecs.berkeley.edu/~mcmartin/sable-make
10:53 Vornicus [Vornicus@Admin.Nightstar.Net] has quit [Quit: ]
10:55 Vornicus [~vorn@Admin.Nightstar.Net] has joined #code
10:55 mode/#code [+o Vornicus] by ChanServ
10:55 Vornicus is now known as Vornicus-Latens
11:33 Attilla [~The.Attil@92.21.253.ns-11808] has joined #code
11:33 mode/#code [+o Attilla] by ChanServ
12:27 Thaqui [~Thaqui@121.98.166.ns-22683] has quit [Client exited]
12:37 Rhamphoryncus [~rhamph@Nightstar-16476.ed.shawcable.net] has quit [Quit: Rhamphoryncus]
12:50 Consul [~Consul__@Nightstar-521.dsl.sfldmi.ameritech.net] has quit [Ping Timeout]
12:51 Consul [~Consul__@Nightstar-521.dsl.sfldmi.ameritech.net] has joined #code
12:51 mode/#code [+o Consul] by ChanServ
14:51 mode/#code [+o TheWatcher] by ChanServ
16:22 Syloqs_AFH [Syloq@Admin.Nightstar.Net] has joined #code
16:23 Syloqs_AFH is now known as Syloqs-AFH
17:07 NSGuest-1719 is now known as SmithKurosaki
17:24 Derakon[AFK] is now known as Derakon
18:47
<@Consul>
Okay, this looks pretty darn cool: http://www.machinarium.com/
21:01 Vornicus-Latens is now known as Vornicus
21:30 AnnoDomini [AnnoDomini@Nightstar-29769.neoplus.adsl.tpnet.pl] has quit [Quit: "... Why are you smiling? I just beat you!" "Did you? Look at yourself. Look at what you've /become/."]
21:48 Rhamphoryncus [~rhamph@Nightstar-16476.ed.shawcable.net] has joined #code
22:47 Kazriko [~kazrikna@Nightstar-26123.gdj-co.client.bresnan.net] has quit [Operation timed out]
22:53 Kazriko [~kazrikna@Nightstar-26123.gdj-co.client.bresnan.net] has joined #code
--- Log closed Sat Aug 08 00:00:31 2009
code logs -> 2009 -> Fri, 07 Aug 2009< code.20090806.log - code.20090808.log >