--- Log opened Sat Sep 20 00:00:59 2014 |
01:41 | | Harlow [harlow@Nightstar-04f.4po.201.71.IP] has joined #code |
01:42 | < Harlow> | Guys I had a weird occurrence recently. I visited Wordpress page, and viewed the source to see some scripts on the page. I then proceeded to click on a link that had some slashes in it and it looked as if it pointed to a DB. then the sight seemed to go down. Is it possible that clicking a link that connects to a DB could crash a website? |
01:43 | <@Checkmate> | Yeah. |
01:44 | < Harlow> | Is it bad practice to put links in there like that? |
01:45 | < Harlow> | Is it avoidable? I mean I'm miffed by the whole thing. |
01:45 | <@Checkmate> | Yes and yes. |
01:46 | <@Checkmate> | Most likely you encountered a glitch. |
01:46 | <@Checkmate> | A wordpress site should be harder to take down. |
01:54 | <&ToxicFrog> | Harlow: for a salutary example of why exposing your DB directly to the users is a bad idea, see Super Meat Boy |
01:55 | | Attilla [uid13723@Nightstar-ed0oqj.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity] |
01:58 | <@RchrdB> | For a salutary example of why exposing your high score table directly to the users, see⦠most videogames with high-score tables. :| |
01:59 | <@RchrdB> | Most games with online high score tables seem to end up getting broken really quickly and then the high score table is just loaded with people who've awarded themselves (2^31)-1 points. |
02:00 | <@RchrdB> | Dustforce does it right: the client uploads a full gameplay recording when sending a result in for the score table, so it can be verified. ⥠|
02:23 | | * Alek thumbs up. |
02:24 | | RchrdB [0x2ba22e11@Nightstar-f7g.a77.120.2.IP] has quit [[NS] Quit: Leaving] |
03:24 | < Turaiel> | Anyone care to give me a bit of input on an SQL query? |
03:25 | < Turaiel> | I'm wondering if there's a decent way to exclude a pair j,i if i,j is already present. I know I can self-join and exclude but is there a more elegant way to do ti? |
03:25 | < Turaiel> | it* |
03:25 | <@Namegduf> | If both pairs are always going to be present, you can require i <= j |
03:26 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
03:26 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
03:26 | < Turaiel> | How does that work? |
03:26 | < Turaiel> | Oh, I see |
03:26 | <@Namegduf> | Yeah, it's a trick I've seen for that effect. |
03:26 | <@Namegduf> | It makes it so only one of the two pairs is legal, but if you don't always have both pairs it can end up missing some. |
03:27 | <@Namegduf> | So doesn't work there. |
03:31 | < Turaiel> | I like that trick. |
03:31 | < Turaiel> | Yeah, in this case both pairs will always be present |
03:31 | < Turaiel> | Thanks |
03:31 | <@Namegduf> | No problem. |
03:43 | <@macdjord> | Is every 32-bit pattern a valid IEEE 754 float? |
03:44 | <~Vornicus> | Yes. |
03:48 | | AverageJoe [evil1@Nightstar-313.8ba.44.72.IP] has joined #code |
03:50 | <~Vornicus> | Note that anything with max exponent and non-zero mantissa gives infinity -- and they are all the same infinity aside from sign |
03:54 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down] |
04:01 | <@macdjord> | Vornicus: But there's not one Canonical one? I mean, say, UTF-8, there are several ways to express certain values, but only one is valid (the one using the fewest bits) |
04:01 | <@macdjord> | s/bits/bytes/ |
04:15 | <~Vornicus> | Infinity is weird because -- uh -- okay so the deal with infinity in this is that its goal is to be really quick to, um, create |
04:16 | <~Vornicus> | In addition, you want to make it quick to *check* |
04:16 | <~Vornicus> | "is this a number I can't do anything useful with? I'll check the exponent!" |
04:22 | <@macdjord> | Vornicus: You could check equally quickly if there was only one of each infinity, but looking for 'all 1s but the sign'. |
04:35 | | Harlow [harlow@Nightstar-04f.4po.201.71.IP] has quit [[NS] Quit: BED] |
04:36 | <~Vornicus> | You probably need a whole exponent to count as infinity or things stop working, I'm not exactly sure what though |
05:57 | | Kindamoody[zZz] is now known as Kindamoody |
06:16 | | Checkmate [Z@Nightstar-g2q2tu.customer.tdc.net] has quit [Ping timeout: 121 seconds] |
06:31 | | AverageJoe [evil1@Nightstar-313.8ba.44.72.IP] has quit [Connection closed] |
06:35 | | Turaiel is now known as Turaiel[Offline] |
06:50 | | jeroud [sid10043@Nightstar-uub.9ff.184.192.IP] has quit [Connection closed] |
07:20 | | jeroud [sid10043@Nightstar-a1k27g.irccloud.com] has joined #code |
07:20 | | mode/#code [+ao jeroud jeroud] by ChanServ |
07:48 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
08:02 | | Kindamoody is now known as Kindamoody|afk |
08:44 | | Kindamoody|afk is now known as Kindamoody |
09:08 | | celticminstrel is now known as celmin|sleep |
09:11 | | macdjord is now known as macdjord|slep |
10:03 | | Kindamoody is now known as Kindamoody|out |
10:32 | | AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has joined #code |
10:48 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
11:13 | | RchrdB [0x2ba22e11@Nightstar-f7g.a77.120.2.IP] has joined #code |
11:13 | | mode/#code [+o RchrdB] by ChanServ |
11:18 | | mac [macdjord@Nightstar-7rac1r.mc.videotron.ca] has joined #code |
11:18 | | mode/#code [+o mac] by ChanServ |
11:21 | | macdjord|slep [macdjord@Nightstar-7rac1r.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
11:22 | | AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has quit [[NS] Quit: Leaving] |
12:33 | | RchrdB [0x2ba22e11@Nightstar-f7g.a77.120.2.IP] has quit [[NS] Quit: Leaving] |
14:20 | < Julius> | Is there some kind of support in C++ or Qt for something like enums, but with ranges instead of a prespecified list of possible values? |
14:21 | <@TheWatcher> | What is it you're trying to do? |
14:23 | < Julius> | Container for floating point values between 0 and 100. |
14:28 | < Julius> | I want it to behave like a qreal/double, but having custom minimum and maximum values. So when you assign something smaller/bigger, it just assigns the minimum/maximum. |
14:35 | <@TheWatcher> | Ah, right. I know of know standard class to do that, you can probably find one in boost, though. |
14:37 | < Julius> | know -> no? |
14:37 | <@TheWatcher> | ... yes |
14:38 | <@TheWatcher> | apparently, I need more tea |
14:46 | <@Tarinaky> | Julius: I think you just want a minimal class with a setter and a getter. |
14:48 | <@Tarinaky> | class Foo { double f; void set( const double& f ) { this->f = f; } double get() { return f; } }; |
14:48 | <@Tarinaky> | Err, except with clamp in the setter |
14:48 | | * Tarinaky is distracted |
14:48 | <@Tarinaky> | But it's still basically a one-liner. |
14:48 | < Julius> | What about operators? |
14:48 | <@Tarinaky> | Julius: "Don't." |
14:49 | < Julius> | No. I definitely DO want operators to function just like they do on normal qreals. Therefore, I think looking into Boost or something is less a hassle than rolling me own. |
14:49 | < Julius> | *my |
14:50 | <@Tarinaky> | I normally find it's enough to use operator* as a sugar for get but I'm sure this is Bad Practice. |
15:26 | <&ToxicFrog> | Julius: can you just subclass qreal? Or does Qt have some kind of clamping wrapper? That seems like a thing a UI framework should have for e.g. sliders |
15:28 | < Julius> | I'm not sure qreal is a proper class. This ain't Java. |
15:28 | <&ToxicFrog> | You think it might be a typedef for double? |
15:28 | <&ToxicFrog> | Also, Java also has primitives. |
15:29 | < Julius> | Yes, but it also has classes for stuff like Integer and Double, right? |
15:30 | | RchrdB [0x2ba22e11@Nightstar-f7g.a77.120.2.IP] has joined #code |
15:30 | | mode/#code [+o RchrdB] by ChanServ |
15:34 | <&ToxicFrog> | Julius: yes, but those exist only to make you sad when they don't automatically convert to/from the primitives, which are what the libraries actually use. |
15:52 | | RchrdB [0x2ba22e11@Nightstar-f7g.a77.120.2.IP] has quit [[NS] Quit: Leaving] |
16:06 | | RchrdB [0x2ba22e11@Nightstar-f7g.a77.120.2.IP] has joined #code |
16:06 | | mode/#code [+o RchrdB] by ChanServ |
16:34 | <@Tarinaky> | The secret about C++ is that it's not actually a library but a framework for you to create your own, shitty, domain specific language out of #defines, typedefs, templates and operator overloads. |
16:35 | <@Tarinaky> | (Not being serious) |
16:35 | <@Tarinaky> | Err |
16:35 | <@Tarinaky> | *language |
16:36 | <@Tamber> | Oh, so it's a lisp for masochists who hate parens? |
16:36 | | * Tamber smack'd |
16:39 | <@Tarinaky> | C/C++ do have the b est debugging tools though - necessity is the mother of invention. |
16:42 | <@RchrdB> | C's debugging tools all work for higher-level languages too, for the most part. |
17:09 | <@gnolam> | https://twitter.com/tdotrob/status/512950648921677825 |
17:39 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
17:39 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
18:12 | <@celmin|sleep> | Julius, Tarinaky: If you replace get() with "operator double" and set() with operator=, wouldn't it "just work" with all other operators? |
18:12 | | * celmin|sleep isn't quite sure. |
18:14 | <@Tarinaky> | Well I'm pretty sure the answer isn't no. |
18:14 | <@Tarinaky> | *is no |
18:14 | <@Tarinaky> | But it'll probably work with a lot of operators |
18:16 | <@Tarinaky> | I don't think the +=(Foo, double) operators will work |
18:16 | | celmin|sleep is now known as celticminstrel |
18:16 | <@celticminstrel> | Ah, that kinda makes sense. |
18:17 | <@Tarinaky> | And by += operators I mean +=,-=,*=/=,|=,&=... |
18:17 | <@Tarinaky> | Dunno what the fancy word is |
18:17 | <@Tarinaky> | It /will/ work with Foo as the RHS type though. |
18:18 | <@Tarinaky> | (I think) |
18:45 | <~Vornicus> | Augmented Assignment Operator |
18:52 | | Turaiel[Offline] is now known as Turaiel |
19:04 | <@gnolam> | The fancy word for cyborg switchboard operators. |
19:20 | | Kindamoody|out is now known as Kindamoody |
20:12 | | Kindamoody is now known as Kindamoody[zZz] |
20:29 | | mac is now known as macdjord |
20:30 | | HotShot [fake@Nightstar-fkrcg4.sfldmi.sbcglobal.net] has joined #code |
20:49 | | Turaiel is now known as Turaiel[Offline] |
21:04 | | Zelclone [zoomzoom@Nightstar-c11.op7.189.197.IP] has quit [Connection closed] |
21:04 | | Zelphar [zoomzoom@Nightstar-c11.op7.189.197.IP] has joined #code |
21:18 | | Turaiel[Offline] is now known as Turaiel |
21:42 | | RchrdB [0x2ba22e11@Nightstar-f7g.a77.120.2.IP] has quit [Connection closed] |
21:54 | | Turaiel is now known as Turaiel[Offline] |
22:03 | | Ghozer [fake@Nightstar-bolbef.sfldmi.sbcglobal.net] has joined #code |
22:06 | | HotShot [fake@Nightstar-fkrcg4.sfldmi.sbcglobal.net] has quit [Ping timeout: 121 seconds] |
22:28 | | Checkmate [Z@Nightstar-g2q2tu.customer.tdc.net] has joined #code |
22:28 | | mode/#code [+o Checkmate] by ChanServ |
22:44 | | HotShot [fake@Nightstar-8quo51.sfldmi.sbcglobal.net] has joined #code |
22:47 | | Ghozer [fake@Nightstar-bolbef.sfldmi.sbcglobal.net] has quit [Ping timeout: 121 seconds] |
23:13 | | HotShot [fake@Nightstar-8quo51.sfldmi.sbcglobal.net] has quit [[NS] Quit: Trespassers will be shot, Survivers will be shot again! [Time wasted on Mirc 28mins 13secs]] |
--- Log closed Sun Sep 21 00:00:15 2014 |