code logs -> 2009 -> Sun, 21 Jun 2009< code.20090620.log - code.20090622.log >
--- Log opened Sun Jun 21 00:00:43 2009
00:00 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Operation timed out]
00:28 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
00:28 mode/#code [+o ToxicFrog] by ChanServ
01:47 Consul_ [~Consul__@Nightstar-3702.dsl.sfldmi.ameritech.net] has joined #code
01:47 Consul_ [~Consul__@Nightstar-3702.dsl.sfldmi.ameritech.net] has quit [Quit: Leaving]
01:48 Consul [~Consul__@Nightstar-3702.dsl.sfldmi.ameritech.net] has quit [Ping Timeout]
02:13 Consul [~Consul__@Nightstar-3702.dsl.sfldmi.ameritech.net] has joined #code
02:13 mode/#code [+o Consul] by ChanServ
02:22 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Quit: <Insert Humorous and/or serious exit message here>]
03:01 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Quit: Z?]
03:03 SmithKurosaki [~Smith@Nightstar-7213.cpe.net.cable.rogers.com] has quit [Operation timed out]
03:03 SmithKurosaki [~Smith@Nightstar-7213.cpe.net.cable.rogers.com] has joined #code
03:04 mode/#code [+o SmithKurosaki] by ChanServ
03:36 Vornicus is now known as Vornicus-Latens
06:03 Syloqs-AFH [Syloq@ServicesAdmin.Nightstar.Net] has quit [Connection reset by peer]
06:34 Thaqui [~Thaqui@121.98.166.ns-22683] has joined #code
06:34 mode/#code [+o Thaqui] by ChanServ
07:13 UndeadAnno [AnnoDomini@Nightstar-29070.neoplus.adsl.tpnet.pl] has joined #Code
07:13 mode/#code [+o UndeadAnno] by ChanServ
07:50 Derakon is now known as Derakon[AFK]
07:53
< Reiver>
Okay, so
07:53
< Reiver>
Steps required to get to 3rd Normal Form in databases?
07:55 * Reiver is preparing a Cheat Sheet for his exam, keeps getting hung up on the technical definitions instead of the straightforward stuffs.
07:56
<@UndeadAnno>
Make sure every attribute is dependant on the primary key - and only that. There are to be no other keys the attributes depend on.
07:56
< Reiver>
hm, so
07:57
< Reiver>
1NF: Relationship to a key must be non-arbitary, no repeating columns
07:57
<@UndeadAnno>
"(...) must provide a fact about the key, the whole key, and nothing but the key, so help me Codd."
07:57
< Reiver>
Er. No repeating *data*, innit?
07:57 * Reiver blargs. Is terribly used to just skipping straight to 3NF.
07:58
<@Namegduf>
Columns define the data present.
07:58
<@Namegduf>
1NF == The database should not have columns containing the same data in two different places.
07:58
<@UndeadAnno>
http://en.wikipedia.org/wiki/First_normal_form#1NF_tables_as_representations_of_ relations
07:58
<@Namegduf>
I believe.
07:59
< Reiver>
aha
08:00
< Reiver>
Is Namegduf's assesmet fairly close?
08:00
<@Namegduf>
Not according to that.
08:00
< Reiver>
Hrn.
08:01 * Reiver needs the Short And Simple Summary version, everything gets so technical when people describe it formally ;_;
08:08 * UndeadAnno shrugs.
08:09
<@UndeadAnno>
I have, at best, a practical understanding of these things. I wouldn't be able to explain to someone how I make a database, but the product will likely pass inspection.
08:11 You're now known as TheWatcher
08:11
< Reiver>
yeah
08:15
< Reiver>
TheWatcher!
08:15
< Reiver>
Can you give shortform explanations on 1nf, 2nf, 3nf?
08:15
< Reiver>
I can do 3nf, but trying to seperate out the stuff beneath it throws me.
08:21
<@TheWatcher>
At 8:20am, I have very little chance of achieving that
08:21
< Reiver>
hee
08:21
< Reiver>
Mind If I bug ya later on it?
08:21
<@TheWatcher>
sure
08:27
< Reiver>
danke kindly
08:36 * TheWatcher is going to be goign swimming shortly, so may be a fe whours
08:36
<@TheWatcher>
... yeah, I can type, really
08:37 You're now known as TheWatcher[swim]
08:52
< jerith>
Swimming as a database theroy avoidance technique. I approve.
08:53
< jerith>
It beats my usual reflex which is extreme violence until the problem goes away. ;-)
10:52
< Reiver>
So!
10:52
< Reiver>
Anyone here know anything at all about PL/SQL (now that I'm in the right channel)
10:54 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
10:54 mode/#code [+o gnolam] by ChanServ
11:23 Reiv is now known as Orthia
11:33
< Reiver>
augh, hate these
11:33
< Reiver>
Vorn: What's the correct application of inner joins and outer joins, and when do you use one or the other?
11:35
< jerith>
Reiver: Inner joins return only results where both sides exist.
11:35
< jerith>
Outer joins will also return resuls where one side or the other does not.
11:35
< Reiver>
Okay, that's lovely
11:36
< jerith>
Say you're joining a table of people against a table of cars.
11:36
< Reiver>
I'm going to have to parse this stuff by hand tomorrow, so
11:36
< jerith>
The inner join will return all people that own cars and their cars.
11:36
< jerith>
A left outer join will return all people, along with the cars for those that have.
11:37
< jerith>
Similarly for the right outer join, except it will return unowned cars rather than carless people.
11:38
< Reiver>
Okay. Er.
11:38
< Reiver>
Syntax for left/right outer joins?
11:38
< Reiver>
That's the bit that scares me.
11:39
< Reiver>
We're allowed a cheat sheet, so syntactical errors are not allowed~
11:40
< jerith>
SELECT * FROM people LEFT OUTER JOIN cars ON people.car = cars.id WHERE people.garage = true;
11:40
< jerith>
Or something like that.
11:40
< jerith>
This is one of those areas where different dialects can be subtly different.
11:41
< jerith>
So I'd recommend RTFM for the details.
11:41
< Reiver>
SELECT * FROM people INNER JOIN cars WHERE people.car_id = cars.id AND people.garage = true; correct, then?
11:42
< jerith>
Correct.
11:42
< jerith>
The default join is usually an inner join.
11:43
< Reiver>
SELECT * FROM people RIGHT OUTER JOIN cars WHERE people.car_id = cars.id AND people.garage = true; would return all cars that live in a garage?
11:45
< jerith>
Um. It would probably be the same as the inner join in that case, or maybe an error.
11:46
< jerith>
Because you're filtering on people, which may not be present.
11:46
< Reiver>
Aha. Okay. Thank you.
11:47
< Reiver>
SELECT * FROM people LEFT OUTER JOIN cars WHERE people.car_id = cars.id AND people.garage = true; would return all people who owned a garage, and what cars they owned /if any/?
11:47
< jerith>
I generally look this stuff up as I need it, and I am by no means expert.
11:47
< jerith>
Reiver: Correct.
11:47
< Reiver>
VORN
11:47
< Reiver>
Can you confirm jerith is not wrong, before I screw up a third of my exam?~
12:14
< Reiver>
... this is a stupid question
12:14
< Reiver>
How do you use GROUP BY again? I should know this one, it's easy. >.<
12:20
<@Vornicus-Latens>
SELECT sum(foo) FROM bar GROUP BY category;
12:21
< Reiver>
ah, yes
12:21
<@Vornicus-Latens>
Inner joins only give you those things where both ends exist.
12:22
<@Vornicus-Latens>
Outer joins will give you everything an inner join does, plus those things that don't have one of the two ends.
12:22
<@Vornicus-Latens>
Left and Right joins, I forget which is which, but they each give you one half of the "no match" side.
12:33
< Reiver>
Hn
12:33
< Reiver>
ORDER BY is simply shoved after the WHERE, yeah?
12:33
< Reiver>
SELECT column FROM table WHERE condition ORDER BY column asc (or desc)
12:34
<@TheWatcher[swim]>
yes, that's right
12:34 You're now known as TheWatcher
12:36
< Reiver>
Excelent
12:37
< Reiver>
TW: SELECT * FROM people LEFT OUTER JOIN cars WHERE people.car_id = cars.id; would select all people, carless or otherwise?
12:37
< Reiver>
TW: SELECT * FROM people RIGHT OUTER JOIN cars WHERE people.car_id = cars.id; would select all cars, ownerless or otherwise?
12:39
<@TheWatcher>
Looks right. I haven't wrangled oracle in 10 years, so the syntax is slightly egh, but that looks right, yeah
12:40
< Reiver>
Okay, thank you
12:41
< jerith>
Oracle?
12:41
< Reiver>
Subqueries: SELECT * FROM people WHERE people.car_id IN (SELECT * FROM cars WHERE car.id)
12:41
< Reiver>
Would return all details of people who owned cars, and what cars they owned.
12:41
< jerith>
Your best bet is to try get your hands on the evaluation version and play with it a bit.
12:42
< jerith>
Reiver: SELECT * FROM people WHERE people.car_id IN (SELECT id FROM cars);
12:42
< jerith>
Although that's generally a bad way to do that particular query.
12:43
< Reiver>
Was trying to keep my example code consistent.
12:43
<@TheWatcher>
Be careful with your WHEREs: WHERE <condition> needs some kind of operator or function in the condition.
12:44
< Reiver>
Aye, thanks for catching that
12:44 * Reiver is working off the textbook and trying to write simple example code for tomorrows cheat sheet.
12:44
<@TheWatcher>
I also second jerith's suggestion of getting an evaluation version of the oracle server, so you can actually /try/ these things.
12:44 * Reiver is doublechecking here so he isn't making stupid mistakes~
12:45
<@TheWatcher>
Regarding the 1NF/2NF/3NF stuff, do you want the Correct Definitions, or the versions Understandable By Normal Human Beings?
12:48
<@Vornicus-Latens>
select from where group by having order by limit offset.
12:49
<@Vornicus-Latens>
maybe offset limit
12:51 * Vornicus-Latens always forgets the order of those last two, he hasn't really used them.
12:52
< Reiver>
TW: Understandable By Normal Human Beings.
12:52 * Vornicus-Latens gave him definitions earlier.
12:52
< Reiver>
Vorn: Which I do appreciate, but I'd happily have TW's as well
12:52
<@Vornicus-Latens>
'k
12:53
< Reiver>
This way I can gestalt the pair of ye into a Level 16 Elder Horror|Diviner Wizard/Archmage.
12:53
<@Vornicus-Latens>
Pffff
12:53
< Reiver>
(One of you is an Elder Horror, the other of you codes in perl... it's a match made in heav-- uhh, anywhere but~)
12:56
<@EvilDarkLord>
Wait, I thought they were both Elder Horrors, the other one is just more blatant about it what with the Perl.
12:57
< Reiver>
Well, he's blatant in how he does it
12:57
< Reiver>
The other is blatant by /being/ one
12:57
< Reiver>
I guess it works out.
12:58
<@EvilDarkLord>
Well, look. Tentacles I can deal with, but Perl is just showing off.
12:59
< Reiver>
But how else would they induce madness in the hearts of men?
12:59
<@EvilDarkLord>
SQL.
13:00
<@EvilDarkLord>
Wait, no, that's actually logical. Or am I already insane?
13:00
< Reiver>
If you're claiming that SQL is anywhere nearly close to perl, then yes, you are insane
13:01
< jerith>
SQL is often misused.
13:01
<@EvilDarkLord>
Well, it's a good thing I'm not then, innit?
13:01
< jerith>
And certain query optimisers need to die in fires.
13:03
<@EvilDarkLord>
Do you include MyISAM and/or InnoDB in these? I don't have a lot of experience with actually demanding DB use.
13:03
<@Vornicus-Latens>
Why do they need to DIAF?
13:05
<@TheWatcher>
Hey, I don't induce madness in the hearts of men.
13:05
<@TheWatcher>
Minds, maybe.
13:22
< jerith>
Vorn: Partly because they require weird contortions to achieve acceptable performance.
13:22
< jerith>
Mostly because they chage dramatically between point releases.
13:22 * jerith *glares* at MySQL.
13:23 * Reiver ponders, wishes to clear something up
13:24
< Reiver>
So, summaries of the xNF forms
13:24
< Reiver>
2NF:
13:24
< Reiver>
- Meets 1NF
13:25
< Reiver>
(TW) - remove subsets of data that apply to multiple rows of a table into a separate table
13:25
< Reiver>
(Vorn) - No information from only part of the key.
13:25
< Reiver>
These two apparently explain the same thing in a different way; but I'm a bit baffled as to how that makes sense?
13:30 * TheWatcher ponders a way to put it
13:32
<@TheWatcher>
Okay, reiv - if you have several rows in your database that have the same values in several columns (say you have a lot of cars with silver paint and metallic finish) then those values are not fully dependant on the key (ie: they are shared by multiple keys)
13:32
<@TheWatcher>
*dependent
13:33
< Reiver>
Okay
13:37 * TheWatcher hrms
13:38 * TheWatcher is trying to find a way to explain this that isn't going to involve madness
13:40 * TheWatcher is honestly tempted to point you to this example: http://en.wikipedia.org/wiki/Second_normal_form#Example as it does a better job of explaining it than I can in IRC
13:41
<@TheWatcher>
Basically, you want to eliminate from the table anything that isn't wholly dependent on the key, by moving it out into its own table and setting up a fk relation
14:13 Orthia [~Orthianz@Nightstar-8852.xdsl.xnet.co.nz] has quit [Ping Timeout]
14:22
<@Vornicus-Latens>
(2nf is specifically "no non-prime components are functionally dependent on only /part/ of any candidate key")
14:23 * Vornicus-Latens is not sure how TW's thing gets to that; his seems to be a combination of 2nf and 3nf.
14:24
< Reiver>
hrm
14:26
< Reiver>
... oh, hrm
14:27
< Reiver>
1NF tables without composite keys are automatically 2NF
14:27
< Reiver>
So 2NF applies only to composite keys?
14:27
< Reiver>
Thus the whole 'shouldn't be able to refer to just one part of the key'?
14:29
<@Vornicus-Latens>
It is not necessarily true that 2nf only makes sense on tables with composite keys - all that matters is that the key is not fully atomic.
14:30
<@Vornicus-Latens>
For instance you could make a key that's an integer but acts like a bunch of flags, and if you list the flags for each key, then that table isn't 2nf.
14:31
<@Vornicus-Latens>
Also it should be noted that /all/ candidate keys, not just the one you chose, must be considered for the thing to be in 2nf.
14:32
<@Vornicus-Latens>
If you can come up with a key scheme from the existing columns that violates 2nf, then the table as a whole violates 2nf, no matter the key scheme you actually use.
14:32
< Reiver>
Funny hting is
14:32
< Reiver>
TW's description made sense in a building-up-the-normal-forms sense
14:32
< Reiver>
This thing just sounds... odd.
14:35
<@Vornicus-Latens>
It's really not as complicated as it sounds.
14:39 You're now known as TheWatcher[afk[
14:40 You're now known as TheWatcher[afk]
14:42
<@Vornicus-Latens>
The point is, if you can replace the data with a reference and this saves you space, you're not in 2nf.
14:47 UndeadAnno [AnnoDomini@Nightstar-29070.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
14:47
< Reiver>
Ah... hah
14:48
<@Vornicus-Latens>
(this makes more sense to a programmer)
14:50
<@Vornicus-Latens>
actually I lie, that's not 2nf
14:54 UndeadAnno [AnnoDomini@Nightstar-29035.neoplus.adsl.tpnet.pl] has joined #Code
14:54 mode/#code [+o UndeadAnno] by ChanServ
14:54
< Reiver>
It's -not-?
14:54
< Reiver>
Then what is?
14:54 * Reiver is getting tired, apologises but this is getting gnarly
14:58
<@Vornicus-Latens>
Remember the IRC example?
14:58 Vornicus-Latens is now known as Vornicus
14:59
<@Vornicus>
(speaking of IRC, I keep forgetting to change my nick)
15:08
< simontwo>
2NF is something like: parts of a primary key cannot be primary keys themselves + there cannot be redundancy as the result of non-primary keys being dependent on *parts* of the primary key.
15:11
< simontwo>
in the wikipedia example (http://en.wikipedia.org/wiki/Second_normal_form#Example), this is demonstrated as "Current Work Location" being dependent on "Employee", which is only a part of the primary key. since "Employee" is not unique in itself, combinations of "Employee" and the other part of the PK, "Skill", introduce redundancy because the "Current Work Location" repeats several times for the same employee.
15:18
<@Vornicus>
The point of the IRC example is that you don't need to care about the channel involved to get the host of a person; thus, putting the host in a dictionary where the key includes channel is kind of silly.
15:25
< Reiver>
Current uptime: 8wks 2days 9hrs 41mins 50secs
15:25
< Reiver>
A sad day indeed for a reboot, I suppoe...
15:26 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Quit: Current uptime: 8wks 2days 9hrs 41mins 43secs. Nonetheless, time to beboot.]
15:33 DiceBot [~Reiver@Nightstar-24583.xdsl.xnet.co.nz] has quit [Quit: DiceBot: based on AnnoDomini's KarmaBot.]
15:38 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
15:38 mode/#code [+o Reiver] by ChanServ
16:07 Syloqs_AFH [Syloq@Admin.Nightstar.Net] has joined #code
16:08 Syloqs_AFH is now known as Syloqs-AFH
16:42 Thaqui [~Thaqui@121.98.166.ns-22683] has quit [Client exited]
16:44 You're now known as TheWatcher
17:47 Attilla [~The.Attil@92.18.64.ns-4168] has joined #code
17:47 mode/#code [+o Attilla] by ChanServ
18:28 Derakon[AFK] is now known as Derakon
18:34 Attilla [~The.Attil@92.18.64.ns-4168] has quit [Ping Timeout]
18:37 NSGuest-1057 [~The.Attil@92.18.64.ns-4168] has joined #code
18:45 * UndeadAnno hrms.
18:45 * UndeadAnno tries to understand how a fuzzy-neural system works.
18:46
<@gnolam>
Imbibe half a bottle of vodka. Cogitate.
18:46
<@UndeadAnno>
I see what you did there.
19:00
<@gnolam>
In other news, the Diablo II soundtrack is awesome as background music for Arkham Horror.
19:02 * simontwo used the Diablo I soundtrack
19:02 * UndeadAnno plays the Shadow of the Comet soundtrack.
19:03
<@Derakon>
Arkham Horror...ugh. >.<
19:06 NSGuest-1057 is now known as Attilla
19:12 * TheWatcher notes that the DII soundtrack is just awesome anyway
19:17
< simontwo>
any Standard ML nerds here? how do I refer to a structure within another source code file?
19:17
< simontwo>
I have a book on SML, and it doesn't even say that.
19:18
< simontwo>
I suppose I can specify all the files at compile time.
19:21
<@TheWatcher>
I used to know SML. I've blanked it from my memory, though...
19:35
<@Derakon>
Man, my data directory has a lot of subdirectories...
19:35
<@Derakon>
For example, data/images/effects/environments/water/water or data/images/terrain/jungle/grass/blocks/center
19:53
<@TheWatcher>
Well, if it works...
19:54
<@Derakon>
It not only works; most of those levels will be entirely vital for ensuring I don't get a confusing mess.
20:04
<@Derakon>
Hrmph. This, on the other hand, is a problem: I'm losing 15FPS when I have to draw large quantities of water.
20:04
<@Derakon>
(Down from 40 to 25, which is right at the point where I'm doing one physics update per draw cycle)
20:15
<@gnolam>
Unaccelerated transparency?
20:18
<@Derakon>
I wouldn't think that'd be such a huge issue...
20:18
<@gnolam>
Oh, it is.
20:19
<@gnolam>
You're going from simple blitting to per-pixel calculations - and almost more importantly, per-pixel read/writes.
20:19
<@gnolam>
+multisource
20:20
<@Derakon>
Comparing in-water and out-of-water, the in-water is spending 56% of its time under the top-level draw() invocation, while out-of-water is spending 47% of its time there.
20:20
<@Derakon>
Which doesn't really explain a 25% drop in framerate.
20:21
<@Derakon>
(Out-of-water is also spending a nontrivial amount of time sleeping, while in-water isn't doing it really at all)
20:21
<@Derakon>
Oh, wait, my bad. It is. Just not as much.
20:30 Attilla [~The.Attil@92.18.64.ns-4168] has quit [Ping Timeout]
20:31 Attilla [~The.Attil@92.18.64.ns-4168] has joined #code
20:31 mode/#code [+o Attilla] by ChanServ
23:38 UndeadAnno [AnnoDomini@Nightstar-29035.neoplus.adsl.tpnet.pl] has quit [Quit: I'm sick of it all! Morning sun, vanquish me!!]
23:57 You're now known as TheWatcher[T-2]
--- Log closed Mon Jun 22 00:00:57 2009
code logs -> 2009 -> Sun, 21 Jun 2009< code.20090620.log - code.20090622.log >