--- Log opened Wed Mar 19 00:00:16 2014 |
00:03 | <@Azash> | RichyB: SELECT result_column = (WHEN exp THEN val)+ ELSE val |
00:05 | <@RichyB> | How does that parse and what dialect is it? |
00:07 | | McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [Operation timed out] |
00:08 | | himi [fow035@Nightstar-q9amk4.ffp.csiro.au] has joined #code |
00:08 | | mode/#code [+o himi] by ChanServ |
00:09 | | JustBob [justbob@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
00:11 | | JustBob [justbob@ServerAdministrator.Nightstar.Net] has joined #code |
00:11 | | mode/#code [+o JustBob] by ChanServ |
00:20 | | gnolam is now known as Edward_Hickoryhands |
00:25 | | Edward_Hickoryhands is now known as gnolam |
00:30 | | Derakon[AFK] is now known as Derakon |
00:37 | <@Reiv> | RichyB: SELECT WHEN column = rule THEN 'yep' ELSE 'nope' AS column_name |
00:37 | <@Reiv> | Would be Oracle. |
00:37 | <@Reiv> | But I'd never seen one work in a WHERE clause before. |
00:42 | <@RichyB> | Ah, hokay. That's in SQL92 but requires CASE ... END around it. |
00:49 | <@Reiv> | Oh, heh |
00:49 | <@Reiv> | It has that in Oracle too~ |
00:49 | <@Reiv> | ... wait the one in the where doesn't wtf |
00:49 | | * Reiv eyes |
00:49 | <@Reiv> | Oh it's a function? You tricksy little bugger |
00:50 | <@Reiv> | How did you do that I wish you weren't now working for Toyota |
00:50 | <@Reiv> | Then I wouldn't have to do this stupid report fix at all, come to think of it~ |
01:11 | < Xon> | Reiv, you can basicly put a case statements in your from or join clause =p |
01:32 | | HotShot [HotShot@Nightstar-v7se27.try.wideopenwest.com] has joined #code |
01:34 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
01:34 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
01:40 | | HotShot [HotShot@Nightstar-v7se27.try.wideopenwest.com] has quit [Ping timeout: 121 seconds] |
01:42 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
02:18 | | HotShot [HotShot@Nightstar-i370o1.sfldmi.sbcglobal.net] has joined #code |
02:22 | | HotShot [HotShot@Nightstar-i370o1.sfldmi.sbcglobal.net] has quit [Connection closed] |
02:23 | | HotShot [HotShot@Nightstar-i370o1.sfldmi.sbcglobal.net] has joined #code |
02:36 | | HotShot^sleep is now known as q[o_O]p |
02:36 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down] |
02:55 | | q[o_O]p [theeaznon@Nightstar-i370o1.sfldmi.sbcglobal.net] has quit [[NS] Quit: Trespassers will be shot, Survivers will be shot again! [Time wasted on Mirc 22hrs 59mins 50secs]] |
03:08 | | HotShot [HotShot@Nightstar-i370o1.sfldmi.sbcglobal.net] has quit [Ping timeout: 121 seconds] |
03:32 | | McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code |
03:32 | | mode/#code [+ao McMartin McMartin] by ChanServ |
03:42 | | Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has quit [Ping timeout: 121 seconds] |
03:50 | | iospace is now known as io\passed_out |
04:00 | | Derakon is now known as Derakon[AFK] |
05:19 | | mac is now known as macdjord |
05:19 | | mode/#code [+o macdjord] by ChanServ |
05:28 | | RichyB [RichyB@Nightstar-c6u.vd5.170.83.IP] has quit [[NS] Quit: Gone.] |
05:29 | | thalass [thalass@Nightstar-bk3u2d.bigpond.net.au] has joined #code |
05:29 | | mode/#code [+o thalass] by ChanServ |
05:30 | | himi [fow035@Nightstar-q9amk4.ffp.csiro.au] has quit [Ping timeout: 121 seconds] |
05:32 | | RichyB [RichyB@Nightstar-c6u.vd5.170.83.IP] has joined #code |
05:34 | | * thalass ponders finally gutting that busted NES he bought a few years ago and building a mythbox. Primarily for netflix, but also to access a future NAS/mythbackend box for our dvd collection |
05:56 | | celticminstrel [celticminst@Nightstar-mhtogh.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] |
06:00 | | q[o_O]p [theeaznon@Nightstar-i370o1.sfldmi.sbcglobal.net] has joined #code |
06:02 | | Kindamoody[zZz] is now known as Kindamoody |
06:12 | | Turaiel is now known as Turaiel[Offline] |
06:18 | | HotShot [theeaznon@Nightstar-i370o1.sfldmi.sbcglobal.net] has joined #code |
06:19 | | orth_ [orthianz@Nightstar-0dllvd.ihug.co.nz] has joined #code |
06:21 | | ErikMesoy|sleep is now known as ErikMesoy |
06:25 | | HotShot [theeaznon@Nightstar-i370o1.sfldmi.sbcglobal.net] has quit [Connection closed] |
06:25 | | HotShot [theeaznon@Nightstar-i370o1.sfldmi.sbcglobal.net] has joined #code |
06:25 | | HotShot is now known as TestBot |
06:27 | | TestBot is now known as HotShot |
06:45 | | Kindamoody is now known as Kindamoody|afk |
06:54 | | AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has joined #code |
07:01 | | HotShot [theeaznon@Nightstar-i370o1.sfldmi.sbcglobal.net] has quit [[NS] Quit: Bot Shuting Down (q[o_O]p)] |
07:04 | | q[o_O]p [theeaznon@Nightstar-i370o1.sfldmi.sbcglobal.net] has quit [[NS] Quit: bed] |
07:11 | | Erik [8f610223@Nightstar-d81bfg.mibbit.com] has joined #code |
07:33 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code |
07:33 | | mode/#code [+o himi] by ChanServ |
08:06 | | McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [Ping timeout: 121 seconds] |
08:10 | | Red_Queen [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code |
08:10 | | mode/#code [+o Red_Queen] by ChanServ |
08:11 | | AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has quit [[NS] Quit: Leaving] |
08:13 | | McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code |
08:13 | | mode/#code [+ao McMartin McMartin] by ChanServ |
08:18 | | Syka [the@Nightstar-p5ku8k.lnk.telstra.net] has joined #code |
08:19 | | Syka is now known as NSGuest42706 |
08:28 | | NSGuest42706 [the@Nightstar-p5ku8k.lnk.telstra.net] has quit [Ping timeout: 121 seconds] |
09:00 | | Syka [the@Nightstar-sbe.vk4.127.1.IP] has joined #code |
09:01 | | Syka is now known as NSGuest42527 |
09:29 | | NSGuest42527 [the@Nightstar-sbe.vk4.127.1.IP] has quit [Connection closed] |
09:34 | | Syka [the@Nightstar-sbe.vk4.127.1.IP] has joined #code |
09:35 | | Syka is now known as NSGuest19198 |
09:55 | | Shemhazai [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code |
09:56 | | Netsplit *.net <-> *.split quits: @Red_Queen |
09:57 | | Netsplit over, joins: @Red_Queen |
09:57 | | Red_Queen [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds] |
10:07 | | mode/#code [+o RichyB] by ChanServ |
10:19 | | NSGuest19198 [the@Nightstar-sbe.vk4.127.1.IP] has quit [Ping timeout: 121 seconds] |
10:36 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds] |
10:42 | | thalass [thalass@Nightstar-bk3u2d.bigpond.net.au] has quit [Ping timeout: 121 seconds] |
10:45 | | Syka [the@Nightstar-gcr.tk7.127.1.IP] has joined #code |
10:46 | | Syka is now known as NSGuest8135 |
10:49 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code |
10:49 | | mode/#code [+o himi] by ChanServ |
10:54 | | You're now known as TheWatcher |
10:58 | | thalass_ [thalass@Nightstar-bk3u2d.bigpond.net.au] has joined #code |
11:08 | | io\passed_out is now known as iospace |
11:24 | | NSGuest8135 is now known as Syk |
12:03 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed] |
12:22 | | Syk [the@Nightstar-gcr.tk7.127.1.IP] has quit [Ping timeout: 121 seconds] |
12:33 | | Syk [the@Nightstar-gcr.tk7.127.1.IP] has joined #code |
13:00 | | Syk [the@Nightstar-gcr.tk7.127.1.IP] has quit [Ping timeout: 121 seconds] |
13:00 | | Syk [the@Nightstar-gcr.tk7.127.1.IP] has joined #code |
13:08 | | thalass_ is now known as Thalasleep |
13:12 | | Thalasleep [thalass@Nightstar-bk3u2d.bigpond.net.au] has quit [Ping timeout: 121 seconds] |
13:34 | | Shemhazai [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds] |
13:41 | | * TheWatcher eyes this SQL query, realises why it keeps failing |
13:42 | <@TheWatcher> | The code is on drugs, apparently: "LEFT JOINT anim_entries_prizes..." |
13:46 | < Erik> | Ahahaha |
13:46 | < Erik> | Obviously it should be LEFT JOINED so that the transaction will already have happened by the time execution reaches that point, and you can use it as cached. |
13:47 | < Erik> | Also, don't take any advice starting with "Obviously". :-) |
13:47 | <@Azash> | TheWatcher: Reminds me of the time I spent something like half an hour debugging late at night before noticing "PRIMATE KEY" |
13:54 | <@gnolam> | TheWatcher: ah, taking the blunt approach I see. |
14:02 | | * Erik groans at gnolam |
14:06 | <@TheWatcher> | Yeah, now I'm left weeding out bugs. |
14:07 | <@iospace> | http://bianalystblog.files.wordpress.com/2012/06/media_httpiimgurcomvr_fvfjb-sca led1000.jpg |
14:16 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds] |
14:16 | | Red_Queen [Z@Nightstar-ro94ms.balk.dk] has joined #code |
14:16 | | mode/#code [+o Red_Queen] by ChanServ |
14:29 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code |
14:29 | | mode/#code [+o himi] by ChanServ |
14:42 | | Erik [8f610223@Nightstar-d81bfg.mibbit.com] has quit [[NS] Quit: I depart] |
14:43 | | Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
14:45 | | Syloq [Syloq@Nightstar-mbk.c3p.254.173.IP] has joined #code |
14:45 | | mode/#code [+o Syloq] by ChanServ |
15:09 | | q[o_O]p [theeaznon@Nightstar-pcem1v.sfldmi.sbcglobal.net] has joined #code |
15:10 | | q[o_O]p is now known as TestBot |
15:29 | | Syk [the@Nightstar-gcr.tk7.127.1.IP] has quit [[NS] Quit: lol3g] |
16:24 | <@RichyB> | iospace, I'm a developer and I think the QA line is correct. |
16:25 | <@iospace> | as in how QA views people? |
16:37 | <@RichyB> | Yes. |
17:57 | <@macdjord> | Database question: Using SQL, what is the best way to implement an ordered one-to-many relationship? (E.g. 'book' and 'chapter': Every book is assosiated with one or more chapters, and these chapters are in a specific order; given the book, you should be able to fetch the nth chapter quickly.) |
17:58 | <@macdjord> | Goals: |
17:59 | <@macdjord> | Access time: You should be able to fetch an item by its index quickly, O(1) time by preference, O(log(n)) time acceptable. |
18:00 | <@macdjord> | Single Point of Truth: It should not be possible to have two 'chapter 2's, not to have a 'chapter 3' without a 'chapter 2'. Ideally this should be a property of the data structure, but its acceptable if its done with constraints. |
18:00 | <@macdjord> | I can see two obvious solutions: |
18:01 | <@macdjord> | * Linked list: book points to first chapter, each chapter references the next. This enforces good ordering, but access time is linear. |
18:04 | <@macdjord> | * Array-index column: The relationship between books and chapters is a standard one-to-many, but each chapter has an interger 'chapter_num' column, which indicates its place in the list. Fast access, assuming you index that column, but there's no way to enforce ordering. (A UNIQUE constraint can prevent duplicate chapters, but not missing ones.) |
18:04 | <@macdjord> | Anyone know of a better way? |
18:20 | <@gnolam> | The latter: bookID + chapterNum as the primary key for chapters, with AUTO INCREMENT on the chapter number. |
18:21 | <@RichyB> | Oh yeah, you can have compound keys. (bookID, chapterNum) is a perfectly valid primary key. |
18:21 | <@RichyB> | You don't need O(1) insertion of a new chapter into the middle, do you? |
18:31 | <@macdjord> | gnolam: Unless each book has its own table of chapters, autoincrement will result in each new chapter getting the first /totally/ unused chapter number, not the next number for that book. |
18:32 | <@macdjord> | RichyB: No. It needs to be /possible/, but insertion anywhere but at the end is rare. |
18:37 | | HotShot [HotShot@Nightstar-v7se27.try.wideopenwest.com] has joined #code |
18:45 | < HotShot> | `leave |
18:45 | < TestBot> | I was asked to leave by |
18:45 | | TestBot [theeaznon@Nightstar-pcem1v.sfldmi.sbcglobal.net] has left #code [] |
19:08 | | HotShot [HotShot@Nightstar-v7se27.try.wideopenwest.com] has quit [Connection closed] |
19:09 | | HotShot [HotShot@Nightstar-v7se27.try.wideopenwest.com] has joined #code |
19:11 | | Kindamoody|afk is now known as Kindamoody |
19:20 | <@Azash> | macdjord: Would say what gnolam suggested |
19:20 | <@Azash> | Insertion in the middle can be done with an update statement as long as the index that gets shuffled in is known |
19:21 | <@Azash> | Moving the chapter numbers for the ones that come after it, I mean |
19:22 | <@Azash> | UPDATE chapter SET chapter_num = chapter_num + 1 WHERE chapter_num >= chapter_num_to_insert |
19:54 | <@macdjord> | Azash: How do I enforce correct ordering, then? There's nothing stopping you from deleting ch. 2 of a 3 chapter book. |
19:57 | <@Azash> | If you do, just run the update but the other way around |
19:57 | <@Azash> | That kind of logic doesn't really belong in the DB anyway |
20:02 | <@macdjord> | Azash: Yes, it does. Orderedness is part of the fundamental relationship between book and chapters. Ideally, the database should be constructed such that there is no way to represent a non-contiguous list. |
20:03 | | Kindamoody is now known as Kindamoody[zZz] |
20:08 | | Reiv__ [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has joined #code |
20:13 | | Reiv__ is now known as Reiv |
20:16 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds] |
20:25 | | macdjord is now known as macdjord|dogwalk |
20:29 | <@Azash> | macdjord|dogwalk: Different strokes, I suppose |
20:29 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code |
20:29 | | mode/#code [+o himi] by ChanServ |
20:29 | <@Azash> | I see the important thing in a database being enforcing a general structure and then having a program handle the logic of it |
20:32 | <@macdjord|dogwalk> | Azash: 'Ordered list, with no duplicate or skipped elements' is structural, not logic. |
20:35 | <@Azash> | "Chapters with unique (book,chapter_num) pairs" is structural |
20:35 | <@Azash> | "When removing a row, do the following" is logic |
20:35 | <@Azash> | Still, someone more experienced than me can say whether there's a possibility of storing code in the DB to handle this |
20:40 | | orth_ [orthianz@Nightstar-0dllvd.ihug.co.nz] has quit [Ping timeout: 121 seconds] |
20:49 | | HotShot [HotShot@Nightstar-v7se27.try.wideopenwest.com] has quit [Connection closed] |
20:50 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
20:50 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
20:58 | | macdjord|dogwalk is now known as macdjord |
20:59 | <@macdjord> | Azash: Yes, that /is/ logic. Which is why I would prefer a design which enforces the ordering structuraly. |
21:05 | | Red_Queen [Z@Nightstar-ro94ms.balk.dk] has quit [Ping timeout: 121 seconds] |
21:20 | | HotShot [HotShot@Nightstar-v7se27.try.wideopenwest.com] has joined #code |
21:41 | | Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has quit [Ping timeout: 121 seconds] |
21:43 | | HotShot [HotShot@Nightstar-v7se27.try.wideopenwest.com] has quit [Connection closed] |
21:48 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
21:49 | | Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has joined #code |
21:49 | | mode/#code [+o Reiv] by ChanServ |
22:22 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds] |
22:28 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed] |
22:59 | | Vorntastic [Vorn@Nightstar-ntaj2f.sub-70-211-1.myvzw.com] has joined #code |
23:00 | | ErikMesoy is now known as ErikMesoy|sleep |
23:16 | | Vornlicious [Vorn@Nightstar-28h42k.sd.cox.net] has joined #code |
23:19 | | Vorntastic [Vorn@Nightstar-ntaj2f.sub-70-211-1.myvzw.com] has quit [Ping timeout: 121 seconds] |
23:25 | | Turaiel[Offline] is now known as Turaiel |
--- Log closed Thu Mar 20 00:00:32 2014 |