--- Log opened Fri Dec 12 00:00:57 2014 |
00:18 | | Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [Ping timeout: 121 seconds] |
00:21 | | Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code |
00:21 | | mode/#code [+o Alek] by ChanServ |
01:59 | | Checkmate [Z@Nightstar-ev6.6um.94.83.IP] has quit [Operation timed out] |
02:21 | | * celticminstrel started to rewrite the massive action-handling function and is now starting to think about abandoning the attempt. |
02:43 | | * ToxicFrog pushes an experiental branch of emufun that supports per-directory metadata cache files |
03:25 | | * celticminstrel starts over with slightly less grandiose plans - just split the function up without changing anything. |
04:05 | <&ToxicFrog> | Load time for /orias/media/video/tv goes from ~10 seconds to less than half a second \o/ |
04:38 | <~Vornicus> | hm. that new bpg thing doesn't work on mac chrome yet |
05:05 | | Orthia [orthianz@Nightstar-rfh.o7s.224.119.IP] has quit [[NS] Quit: Going dooooown...] |
05:22 | | Derakon is now known as Derakon[AFK] |
05:27 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
05:36 | | Orthia [orthianz@Nightstar-rfh.o7s.224.119.IP] has joined #code |
05:36 | | mode/#code [+o Orthia] by ChanServ |
05:40 | | Orthia [orthianz@Nightstar-rfh.o7s.224.119.IP] has quit [[NS] Quit: Going dooooown...] |
05:40 | | Orthia [orthianz@Nightstar-rfh.o7s.224.119.IP] has joined #code |
05:40 | | mode/#code [+o Orthia] by ChanServ |
06:08 | | himi [sjjf@Nightstar-dm0.2ni.203.150.IP] has quit [Ping timeout: 121 seconds] |
06:45 | | Kindamoody[zZz] is now known as Kindamoody |
06:54 | | Kindamoody [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has quit [[NS] Quit: Switching networks, brb] |
06:55 | | Kindamoody|autojoin [Kindamoody@Nightstar-cb4936.mobileonline.telia.com] has joined #code |
06:55 | | mode/#code [+o Kindamoody|autojoin] by ChanServ |
06:55 | | Kindamoody|autojoin is now known as Kindamoody |
07:59 | <@celticminstrel> | Okay, so, I have things that do stuff when (age % x == 0), for various values of x. When increasing age by more than 1 in a single jump, I'd like to know how many such boundaries were skipped over, for a given x. |
08:02 | < abudhabi> | A simple for loop with an if statement inside? |
08:02 | <@celticminstrel> | Are you suggesting I just increase it by 1 as normal? |
08:05 | < abudhabi> | Yes? You increase it by 1 and check every time you do if you've crossed a threshold, until you've reached the number you want to increase age by. |
08:05 | < abudhabi> | Are you looking for something other than a brute force approach? |
08:05 | <@celticminstrel> | I was hoping for a method that doesn't involve a loop. |
08:06 | <@celticminstrel> | I need to check it for several values of x, and I don't even know ahead of time what all the values are. |
08:06 | <@celticminstrel> | It could be sufficient to merely know if at least one boundary was crossed (per value of x). |
08:07 | < abudhabi> | If the increase is greater or equal x, that's guaranteed at least one boundary crossing. For lower values, you'd have to check more in-depth. |
08:07 | <@celticminstrel> | Hmm. |
08:08 | < abudhabi> | Are you sure you're not overoptimizing this? |
08:08 | < abudhabi> | Is age a large number? |
08:08 | <@celticminstrel> | It could be. |
08:09 | < abudhabi> | How large? |
08:10 | <@celticminstrel> | Uhh, there's theoretically no limit to how large it can get short of integral limits (which is quite high, since it's an unsigned long). That said, in practice, I don't think it's likely for integral limits to be reached; but I wouldn't be too surprised at getting 5-6 digits. |
08:10 | <@celticminstrel> | It depends on a lot of stuff, of course. |
08:10 | <@celticminstrel> | It's basically your turn counter, so it's incremented constantly. |
08:11 | <@celticminstrel> | If I divide by x, I think I'd get an answer that might be off by one, right? |
08:11 | <@celticminstrel> | Divide the increase by x, that is. |
08:12 | <@celticminstrel> | Or wait, was it the other way around... |
08:12 | | Orthia [orthianz@Nightstar-rfh.o7s.224.119.IP] has quit [Ping timeout: 121 seconds] |
08:12 | <@celticminstrel> | Ah, no, divide the increase by x. |
08:12 | | * celticminstrel probably is over-optimizing, really. |
08:15 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down] |
08:16 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
08:18 | | Orthia [orthianz@Nightstar-kjngsn.callplus.net.nz] has joined #code |
08:18 | | mode/#code [+o Orthia] by ChanServ |
08:42 | | celticminstrel is now known as celmin|sleep |
09:02 | | himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code |
09:02 | | mode/#code [+o himi] by ChanServ |
09:09 | | Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code |
09:09 | | mode/#code [+o Checkmate] by ChanServ |
09:55 | | Kindamoody [Kindamoody@Nightstar-cb4936.mobileonline.telia.com] has quit [Connection reset by peer] |
10:18 | | Kindamoody|autojoin [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has joined #code |
10:18 | | mode/#code [+o Kindamoody|autojoin] by ChanServ |
10:19 | | Kindamoody|autojoin is now known as Kindamoody |
10:25 | | Kindamoody is now known as Kindamoody|out |
13:30 | | Orthia [orthianz@Nightstar-kjngsn.callplus.net.nz] has quit [Ping timeout: 121 seconds] |
13:34 | | Orthia [orthianz@Nightstar-rfh.o7s.224.119.IP] has joined #code |
13:34 | | mode/#code [+o Orthia] by ChanServ |
13:38 | <@Azash> | "The first Lisp interpreter was implemented by McCarthy with the help of the LORD" |
14:34 | <@iospace> | LORD of parens? :P |
14:34 | | celmin|sleep is now known as celticminstrel |
14:46 | <&McMartin> | Heh. You know the story about the parens, right? |
14:48 | <@froztbyte> | are they the arms of our dark lord cthulhu reaching out to hold you? |
14:52 | <@iospace> | McMartin: why don't you tell us anyway :P |
14:53 | <&McMartin> | They were intending to design a "real" grammar for it, but they had work to do, so they basically said "let's just type the ASTs in directly for now and we'll get back to it" |
14:53 | <&McMartin> | And then got hooked |
14:53 | <@iospace> | ASTs? |
14:53 | <&McMartin> | Abstract Syntax Trees |
14:53 | <@iospace> | ah |
14:57 | | Orthia [orthianz@Nightstar-rfh.o7s.224.119.IP] has quit [Ping timeout: 121 seconds] |
15:03 | | Orthia [orthianz@Nightstar-j7t.tff.224.119.IP] has joined #code |
15:04 | | mode/#code [+o Orthia] by ChanServ |
15:44 | <@celticminstrel> | Stupid fingers, stop typing minus instead of equals. :/ |
16:13 | | * celticminstrel blinks. |
16:16 | <&McMartin> | Heh. If I turn on the "positional keyboard map" in my C64 emulator, the = key *is* minus. |
16:16 | <@celticminstrel> | Okay, so... I add one line to ensure the background textures are (re)created after the dialog window is created, and now the dialog alternates between itself and garbage... but then I closed and reopened it ant it worked perfectly, and now it doesn't anymore... |
16:17 | <@celticminstrel> | ...and now it's perfect. |
16:17 | <&McMartin> | So it works every other time, or...? |
16:17 | <@celticminstrel> | I'm not sure. |
16:17 | <@celticminstrel> | It definitely doesn't work the first time a dialog is opened. |
16:18 | <@celticminstrel> | Hm, it seems to start working if I activate another program, then reopen the same dialog... :S |
16:19 | <@celticminstrel> | Prior to introducing that one line, it would alternate between normal and just background texture. |
16:20 | <@celticminstrel> | (The line is a call to a function that rebuilds the background textures.) |
16:33 | | * celticminstrel blinks. |
16:33 | <@celticminstrel> | Just now I had a button hiliting itself until I switched out. |
16:34 | <@celticminstrel> | As if it was remembering the state when the last dialog closed... though that button shouldn't've been hilited... |
16:35 | | * celticminstrel suspects something is somehow not getting initialized... |
16:58 | | * celticminstrel blinks. |
16:58 | <@celticminstrel> | Okay, I fiddled with it a bit by just reordering a few things, and suddenly it works? Or is it a fluke... |
16:58 | <@celticminstrel> | Well, it doesn't seem to be a fluke. |
17:03 | <@celticminstrel> | Seemingly the fix is to do the initial draw before making the window visible. |
17:06 | <@celticminstrel> | There's still the glitch where the dialog is momentarily drawn to the main window... |
17:10 | <@iospace> | I hate PL/SQL |
17:10 | <@iospace> | I really do |
17:13 | | * McMartin blinks |
17:13 | <&McMartin> | My brain is still in a retro mode |
17:13 | <&McMartin> | I read that as some kind of horrifying hybrid of PL/I and SQL |
17:16 | <@iospace> | :P |
17:16 | <@iospace> | it's oracle shit |
17:16 | <&McMartin> | Yeah, looking it up now on wiki |
17:17 | <&McMartin> | Syntax inspired by Ada |
17:17 | <&McMartin> | I'd make the usual warding gestures but I've seen decent Ada code and I have to admit they won the war =/ |
17:17 | <@TheWatcher> | Tautology Alert: Oracle Shit. |
17:17 | <@iospace> | like, this entire script- well yes TheWatcher- can be written in Python and achieve a lot faster response time |
17:20 | | * McMartin fingertappity |
17:20 | <&McMartin> | I'd like an excuse to write something substantial in Go, but I have no real excuses to do so |
17:21 | <&ToxicFrog> | McMartin: which war? |
17:21 | <&McMartin> | Ada's idea of how modules should work is very obviously a precursor to the Java/C# systems. |
17:21 | <&McMartin> | Like, after Java Ada doesn't even look verbose, just inconveniently low-level |
17:26 | <@celticminstrel> | ... why did I have (x == true ? false : true). |
17:27 | <@TheWatcher> | !aclue. |
17:28 | <@celticminstrel> | Me neither. |
17:28 | <&McMartin> | It's clearly formed from a thought and then directly represented |
17:28 | <&McMartin> | Let's go with "avoiding premature optimization"~ |
17:29 | <@celticminstrel> | Actually, it's probably lazy translation or something. |
17:29 | <@celticminstrel> | I think originally it might've been done because C did not have a bool type. |
17:29 | <@celticminstrel> | (And I think we're talking about pre-ANSI C, too.) |
17:30 | <&McMartin> | C's "everything has a bool context and it means '!= 0'" goes back to K&R, though. |
17:30 | <@celticminstrel> | Yeah, well, maybe he wanted to be "safe" or something? |
17:30 | <&McMartin> | I guess if it's from C to something else they might have done that, but "x==true" implies x has a boolean form and thus can just be x. |
17:31 | <@celticminstrel> | The original would've either had 1 and 0 or TRUE and FALSE. I dunno which. |
17:31 | | * McMartin nods. |
17:31 | <&McMartin> | The latter is more likely for a result like this |
17:31 | <&McMartin> | Particularly for entertaining cases where TRUE is not 1 >_< |
17:31 | <@celticminstrel> | I think TRUE was defined in one of the Mac toolbox headers or something. |
17:32 | <&McMartin> | Windows has one too. |
17:32 | <@celticminstrel> | Make sense, I suppose. |
17:32 | <&McMartin> | But it's not uncommon for the equivalent of (int)(1 == 1) to be -1. |
17:34 | <@celticminstrel> | In other news, strict enums are pretty nice. They allow me to force the use of enum constants where they're relevant, which I had no way to do before. |
17:34 | <@celticminstrel> | Thus improving readability. |
17:35 | <&McMartin> | Pascal: gettin' the last laugh |
17:35 | <@celticminstrel> | Hm? |
17:35 | <&McMartin> | Oh. IIRC Pascal enumerated types also worked like that |
17:35 | <@celticminstrel> | Ah. |
17:37 | | thalass|sweaty [thalass@Nightstar-9ai58o.bigpond.net.au] has joined #code |
17:37 | | mode/#code [+o thalass|sweaty] by ChanServ |
17:37 | | thalass|sweaty is now known as Thalass |
17:37 | | * Thalass idly ponders The Machine |
17:42 | <@Thalass> | http://www.technologyreview.com/news/533066/hp-will-release-a-revolutionary-new- operating-system-in-2015/ |
17:47 | | * iospace noogies Thalass |
17:48 | <@Thalass> | aie! |
17:48 | <@Thalass> | I just heart memristors. I would suffer through dealing with HP if it meant a linux machine with memristor hardware. |
17:52 | <@Thalass> | anyway slep |
17:58 | <@celticminstrel> | Hm, "x ? n : 0" is equivalent to x * n... |
18:05 | <&McMartin> | Only if n is sharply constrained to 0 and 1. |
18:08 | <@celticminstrel> | Don't you mean if x is constrained? |
18:08 | <&McMartin> | Er |
18:08 | <&McMartin> | Yes |
18:08 | <@celticminstrel> | Well, it's a bool, I think that counts. |
18:09 | <&McMartin> | As noted above, make sure your bools aren't signed. |
18:09 | <@celticminstrel> | I'm pretty sure casting to bool restricts it to 0 or 1... |
18:10 | <@celticminstrel> | You'd have to do fancier stuff to get a bool with some other value. |
18:10 | <@celticminstrel> | Like unions. |
18:10 | <@celticminstrel> | Anyway, I'm fairly sure I only ever assign true or false to x. |
18:13 | <&McMartin> | Yeah, I'm saying "check, because the logical other value for boolean true is -1" |
18:13 | <&McMartin> | The last language I used where that came up that was true, but to be fair that language was Commodore BASIC |
18:13 | <@celticminstrel> | And I'm saying I don't think C++ allows this normally. |
18:15 | <&McMartin> | Just check. gcc at least does render it as 1. |
18:15 | <&McMartin> | *checked |
20:11 | | Kindamoody|out is now known as Kindamoody |
20:29 | | Vorntastic [Vorn@Nightstar-k70f1n.ct.comcast.net] has joined #code |
20:30 | < Vorntastic> | So my coworker has found himself in a situation where he has a big javascript object and wishes to ask questions about it that look vaguely like sql queries. |
20:42 | <@celticminstrel> | ...fun? |
20:43 | < Vorntastic> | I'm not sure whether to call him silly, explain map filter & reduce, or... |
21:10 | | Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds] |
21:24 | | Derakon[AFK] is now known as Derakon |
21:24 | | * Derakon readsup. |
21:24 | <&Derakon> | If you're getting cute about auto-casting booleans into numbers, then you probably have a bug somewhere in your code. |
21:24 | <&Derakon> | I've gotten tripped up by boolean conversion rules in many different languages. |
21:33 | | Kindamoody is now known as Kindamoody[zZz] |
22:03 | <@celticminstrel> | ...it looks odd, but apparently ((a<x||a>y)&&(a<u||a>v)) is true if a is in neither range [x,y] nor range [u,v]. |
22:07 | | Checkmate [Z@Nightstar-g2q2tu.customer.tdc.net] has joined #code |
22:07 | | mode/#code [+o Checkmate] by ChanServ |
22:18 | <@gnolam> | It only looks odd because there are no spaces in there.~ |
22:18 | <&McMartin> | Yeah, that's pretty straightforward. |
22:18 | <@celticminstrel> | Eh, it looks odd to me. |
22:19 | | * celticminstrel has spaces in the actual situation. |
22:22 | <@celticminstrel> | Making these enums strict has a tendency to really propagate throughout everywhere. >_> |
22:23 | <&McMartin> | It's like const only more so |
22:40 | | Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [[NS] Quit: beroot] |
22:47 | | Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code |
22:47 | | mode/#code [+o Alek] by ChanServ |
22:47 | | Vorntastic [Vorn@Nightstar-k70f1n.ct.comcast.net] has quit [Connection reset by peer] |
22:48 | | Vorntastic [Vorn@Nightstar-k70f1n.ct.comcast.net] has joined #code |
22:48 | | Vorntastic [Vorn@Nightstar-k70f1n.ct.comcast.net] has quit [[NS] Quit: Bye] |
23:22 | <@Azash> | âI thank Heaven no one has been able to add significant value to their Puppet deployments with an afternoonâs worth of perl scripting.â |
23:36 | <@celticminstrel> | Finally finished propagating. |
23:36 | <@celticminstrel> | Well, almost. Link error. |
23:46 | <@Azash> | http://www.technologyreview.com/news/533066/hp-will-release-a-revolutionary-new- operating-system-in-2015/ |
--- Log closed Sat Dec 13 00:00:13 2014 |