--- Log opened Tue May 27 00:00:18 2014 |
00:10 | <&McMartin> | Sorry. Today it's videogames |
00:11 | <&McMartin> | Probably going to slow down on the retro stuff now that Ophis 2.1 is finally out. |
00:11 | <&McMartin> | On the plus side, that means hopefully back to Monocle once I get coding time again |
00:14 | <~Vornicus> | poor disappointed jerith. |
00:20 | <&McMartin> | I have the day off, but I should probably do paperwork today anyway |
00:48 | | JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds] |
01:51 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [Ping timeout: 121 seconds] |
01:59 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
02:09 | | * Vornicus discovers xpath |
02:09 | <~Vornicus> | holy dang where has this been all week, this is delicious |
02:10 | <&McMartin> | XPath is how you end up with zero problems instead of two |
02:11 | | * Vornicus tears out a bunch of code to fill in his XML and writes one function that takes a couple of arrays instead. |
02:18 | <@Reiv> | XPath does? |
02:19 | <&Derakon> | Apparently makes interacting with XML marginally less painful. |
02:21 | <&McMartin> | The original "now you have two problems" was dealing with XML via regex |
02:22 | <&McMartin> | Which it regex is uniquely unsuited for doing |
02:22 | <&McMartin> | -it |
02:22 | <~Vornicus> | Reiv: okay so I'm writing some values into an XML template |
02:23 | <&Derakon> | McM: ;_; yes. |
02:23 | <@Reiv> | Yes I can imagine that |
02:24 | <~Vornicus> | This is a line of code in my existing setup: $package -> Request -> Products -> Intelliscore -> BusinessApplicant -> BusinessName = $businessName; |
02:24 | <~Vornicus> | |
02:24 | <@Reiv> | In fact I need to do it One Of These Days for my Gmail filters, which are woefully out of date and even more horridly maintained~ |
02:24 | <&Derakon> | 99% of the time (these days, anyway), if you're writing a parser then something has gone horribly wrong. |
02:24 | <@Azash> | # THIS SHOULD DO BETTER WITH HOOKING NETHOD NAME LIKE GLOBALIZE2 DOES SOMETHING LIKE THAT :( |
02:24 | <~Vornicus> | Which looks all right, I guess, but 1. it's code as opposed to config, so if I need to change my XML format I'll need to change the code as well; 2. it's kind of wordy. |
02:24 | <&McMartin> | Derakon: Well, there's parsing and then there's gettin ginformation out of the parsed structure |
02:25 | <&McMartin> | XPath is a minilanguage for solving the latter given the former, while possibly also hiding the former. |
02:26 | <~Vornicus> | With XPath, I can avoid both problems; instead, I stuff my data into an array, and I'll have another array in my config that says, among other things, 'businessName' => '/NetConnectRequest//BusinessName' |
02:27 | <~Vornicus> | And then walk the two arrays, filling in my XML using XPath to find the nodes I need. |
02:31 | <~Vornicus> | This is more maintainable and less wordy: The XML template (in a here-document) sits next to the xpaths in the config file, and the code can be reused for every XML templating task I have. |
02:31 | <~Vornicus> | And the less-wordy part should be pretty obvious |
02:32 | <~Vornicus> | I don't need to name each child node I cross. |
02:33 | <@Reiv> | That should work rather well. |
02:33 | <@Reiv> | How hard would it be to set up for fiddling GMail mail filter XML, you think? |
02:34 | <&McMartin> | The "don't need to name each child node" thing can of course sting you if the leaf node is repeated in different content-type nodes along the way |
02:35 | <~Vornicus> | You don't want to use it for walking the dom. |
02:36 | <@Reiv> | dom? |
02:36 | <~Vornicus> | Document Object Model |
02:36 | <~Vornicus> | Which is to say if you're looking at lots and lots of nodes, probably in sequence? Wrong tool. |
02:36 | <&McMartin> | Right |
02:36 | <&McMartin> | My thing that converts my XML spec for my game writeups into HTML, for instance, is not an appropriate use of XPath |
02:37 | <&McMartin> | But if I were to query the XML for specific things - "given this game, return me the developer and publisher" - I think you can make it do that easily |
02:41 | <~Vornicus> | What it can do is give you a list of nodes you might be interested in, though. wikipedia's examples show this off. |
02:48 | | Turaiel[Offline] is now known as Turaiel |
03:04 | | Attilla [uid13723@Nightstar-ed0oqj.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity] |
03:29 | | Turaiel is now known as WetTur |
03:38 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down] |
03:38 | | HotShot [fake@Nightstar-ro8a2k.sfldmi.sbcglobal.net] has joined #code |
03:47 | | WetTur is now known as TUraiel |
03:50 | <~Vornicus> | I wrote a parser the other day but it was for a tiny tiny input format |
03:52 | | TUraiel is now known as Turaiel |
04:32 | | Nemu [NeophoxProd@Nightstar-kpuumf.gv.shawcable.net] has joined #code |
04:53 | | Nemu [NeophoxProd@Nightstar-kpuumf.gv.shawcable.net] has quit [[NS] Quit: ] |
05:01 | | io\moved is now known as io\passed_out |
05:09 | | Derakon is now known as Derakon[AFK] |
05:44 | | Kindamoody[zZz] is now known as Kindamoody |
06:01 | | JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code |
06:01 | | mode/#code [+o JackKnife] by ChanServ |
06:15 | | Turaiel is now known as Turaiel[Offline] |
06:33 | | RchrdB [RichardB@Nightstar-c6u.vd5.170.83.IP] has quit [[NS] Quit: Gone.] |
06:37 | | RchrdB [RichardB@Nightstar-c6u.vd5.170.83.IP] has joined #code |
06:38 | | JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has quit [[NS] Quit: If the world didn't suck, we'd all fall off.] |
06:58 | | celticminstrel [celticminst@Nightstar-g3ttc7.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
07:15 | | Attilla [uid13723@Nightstar-ed0oqj.irccloud.com] has joined #code |
07:17 | | HotShot [fake@Nightstar-ro8a2k.sfldmi.sbcglobal.net] has quit [[NS] Quit: Trespassers will be shot, Survivers will be shot again! [Time wasted on Mirc 3hrs 39mins]] |
07:24 | <&jeroud> | Vornicus: github.com/jerith/xpathlet |
07:25 | <&jeroud> | Don't use that, but know that it exists. :-) |
07:27 | <~Vornicus> | hahaha, no, I'm using one that's already built in |
07:28 | <&jeroud> | Etree? That's not xpath. |
07:29 | <&jeroud> | It's a much simpler thing that looks a little like xpath. |
07:30 | <&jeroud> | (Which is fine if that's all you need, but you'll be horribly confused if you're expecting it to be proper xpath.) |
07:31 | <~Vornicus> | No, I'm using php simplexml, which has xpath support built in |
07:32 | <&jerith> | PHP ;_; |
07:36 | <~Vornicus> | Well, I am getting paid. |
07:41 | <&jerith> | \o/ |
07:43 | <&jerith> | If you want superfast PHP, there's http://hippyvm.com/ by some friends of mine. |
07:44 | <~Vornicus> | Deployment is, thank goodness, not my department. |
07:50 | | Kindamoody is now known as Kindamoody|afk |
08:31 | | AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has joined #code |
09:01 | | AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has quit [[NS] Quit: Leaving] |
10:54 | | Attilla [uid13723@Nightstar-ed0oqj.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity] |
11:27 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
11:32 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed] |
11:33 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
11:33 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
11:41 | | Syka [the@Nightstar-r5u.p1l.126.1.IP] has joined #code |
12:14 | | * Azash eyes Rails |
12:14 | <@Azash> | raise exception if env['action_dispatch.show_exceptions'] == false |
12:17 | < Syka> | wat |
12:28 | <@TheWatcher> | That's special |
12:34 | < Julius> | If an exception is raised and nobody sees it, is it still raised? |
12:43 | < simon_> | I wonder how to best design a small toy bank transaction system |
12:45 | < Syka> | bash on your keyboard |
12:45 | < Syka> | compile it with the gnu fortran compiler |
12:45 | < Syka> | threre you go |
12:45 | < simon_> | I want the balance to reflect the effect of all transactions, rather than just be a number that's history-lessly updated. |
12:45 | < simon_> | so basically, the balance is the sum of some list of transactions |
12:46 | < simon_> | double-bookkeeping style, I think. |
12:46 | < Syka> | thats not double bookkeeping |
12:46 | < Syka> | thats where you have the account, and the type, and have it entered in both |
12:46 | < simon_> | double bookkeeping, as far as I understand, means that money can never appear somewhere without disappearing somewhere else. |
12:46 | < Syka> | it can |
12:46 | < Syka> | double bookkeeping is a method to check that it doesn't |
12:47 | < simon_> | with double book-keeping, naturally, you also have two records where what I suggest only has one. |
12:47 | < simon_> | right |
12:47 | < Syka> | simon_: you would do, like |
12:47 | < Syka> | select sum(value) from transactions where user=foo |
12:47 | < Syka> | where transactions would be like |
12:47 | < Syka> | user | value | details |
12:47 | < Syka> | foo | 100 | magic |
12:48 | < Syka> | foo | -10 | less magic |
12:48 | < simon_> | yeah |
12:48 | < Syka> | don't actually do that in a real system though |
12:48 | < simon_> | I was worrying about inefficiency, but I suppose I could just cache the result until it is updated. |
12:48 | < Syka> | you want to work off a cached value, and have it updated whenever anything touches the transactions table |
12:49 | < Syka> | so adding a transaction for user foo runs that sql again |
12:49 | < Syka> | and holds the cached value |
12:49 | < simon_> | I want to find a balance between re-calculating the entire thing and working with cached values. |
12:49 | < Syka> | simon_: layer it through an api |
12:49 | < Syka> | the only thing that can add/remove/modify a transaction updates the cached value |
12:50 | < simon_> | yeah. I think what I'll do is implement it naively and subsequently add a transparent cache layer. |
12:51 | < simon_> | thanks! |
12:52 | < Syka> | the api method is the best, though |
12:52 | < Syka> | because you will run into that problem |
12:52 | < Syka> | (the billing system at work had such a problem) |
12:53 | < [R]> | jerith: (asking because the site doesn't have an FAQ) does it have a FastCGI mode? (RE: hippy-VM) |
12:55 | < Syka> | [R]: if it doesnt, its on its way |
12:55 | < Syka> | fijal was complaining about how batshit the api was a few weeks ago |
12:56 | < [R]> | Know if Facebook's thing does? |
12:56 | < Syka> | hiphopvm? hmm |
12:57 | < Syka> | apparently |
12:58 | < Syka> | http://hhvm.com/blog/1817/fastercgi-with-hhvm |
13:03 | | Turaiel[Offline] is now known as Turaiel |
13:08 | < Julius> | "< simon_> I want the balance to reflect the effect of all transactions, rather than just be a number that's history-lessly updated." <- You want to reimplement Bitcoin? |
13:09 | <~Vornicus> | Julius: he said nothing whatsoever about distributedness |
13:09 | <~Vornicus> | This is a simple accounting app. |
13:09 | <~Vornicus> | And, it should be said, an accounting app done correctly. |
13:09 | <@gnolam> | Someone should make a cryptocurrency based on sprite drawing: blitcoin. |
13:09 | < simon_> | yes, exactly. :) |
13:10 | < simon_> | gnolam, they're trying to use GPUs for financial computing anyways. :) |
13:10 | < Julius> | gnolam: Would the richness of a user be determined by the amount of funny pictures on their hard drive? |
13:13 | <~Vornicus> | simon_: what I'd do is, hm |
13:13 | <~Vornicus> | Pick an update rate. |
13:14 | <~Vornicus> | Each (?month), save off to a balances table the current balance |
13:20 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
13:45 | | Turaiel is now known as Turaiel[Offline] |
13:50 | | mac is now known as macdjord|slep |
14:02 | | celticminstrel [celticminst@Nightstar-g3ttc7.dsl.bell.ca] has joined #code |
14:02 | | mode/#code [+o celticminstrel] by ChanServ |
14:57 | | JackKnife [Z@Nightstar-ro94ms.balk.dk] has joined #code |
14:57 | | mode/#code [+o JackKnife] by ChanServ |
15:21 | | Serah [Z@Nightstar-ro94ms.balk.dk] has joined #code |
15:21 | | mode/#code [+o Serah] by ChanServ |
15:22 | | JackKnife [Z@Nightstar-ro94ms.balk.dk] has quit [Ping timeout: 121 seconds] |
15:29 | | Syka [the@Nightstar-r5u.p1l.126.1.IP] has quit [Connection closed] |
15:46 | | Syka [the@Nightstar-r5u.p1l.126.1.IP] has joined #code |
15:54 | | io\passed_out is now known as iospace |
15:58 | <@ErikMesoy> | Agh. What's the proper form of this list comprehension: [word if "foo" in word for word in sentence] ? |
16:00 | <@ErikMesoy> | Python |
16:00 | | Serah [Z@Nightstar-ro94ms.balk.dk] has quit [[NS] Quit: If the world didn't suck, we'd all fall off.] |
16:01 | | JackKnife [Z@Nightstar-ro94ms.balk.dk] has joined #code |
16:02 | | mode/#code [+o JackKnife] by ChanServ |
16:07 | <@gnolam> | ErikMesoy: filter()~ |
16:08 | <@gnolam> | (Otherwise: [word for word in sentence if "foo" in word] |
16:08 | <@gnolam> | ) |
16:24 | <@ErikMesoy> | ah, the if goes at the end. |
16:24 | <@ErikMesoy> | thanks |
17:12 | | Kindamoody|afk is now known as Kindamoody |
17:25 | | Syka [the@Nightstar-r5u.p1l.126.1.IP] has quit [Ping timeout: 121 seconds] |
18:11 | | Kindamoody is now known as Kindamoody|afk |
18:21 | <@Azash> | Does anyone know somewhere to get a decent sample set for playing around with Vertica? |
18:22 | | * Julius looks at this archive for DOS games. |
18:22 | < Julius> | POP is flagged as "no violence". |
18:28 | <@ErikMesoy> | Lol. I played Prince of Persia back in the day. |
18:29 | <@ErikMesoy> | Maybe there were several versions, but the one I played had swordfights, people falling to their death, people being impaled on spike traps, and people being crushed under falling roofs. |
18:29 | < Julius> | That's the one. |
18:41 | <&ToxicFrog> | That is a bit odd, yeah. |
18:42 | <&ToxicFrog> | I recall something about Descent being flagged as "vandalism", because while it is a combat-centric game, all you were ever fighting were robots. |
19:33 | | JackKnife [Z@Nightstar-ro94ms.balk.dk] has quit [Ping timeout: 121 seconds] |
19:54 | | Kindamoody|afk is now known as Kindamoody |
19:59 | | Kindamoody is now known as Kindamoody[zZz] |
20:01 | <&McMartin> | Yes indeed |
20:01 | <&McMartin> | "Damage to Realistic Looking Objects" |
20:01 | <&McMartin> | That said, people did die, but it was only narrated. |
20:01 | <&McMartin> | (If you rescued hostages and then blew up before getting them somewhere safe~) |
20:03 | <&McMartin> | ErikMesoy: Also people being bisected by Hall Guillotines. |
20:13 | | JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code |
20:13 | | mode/#code [+o JackKnife] by ChanServ |
20:20 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
20:20 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
21:02 | | Julius is now known as AnnoDomini |
21:31 | | Nemu [NeophoxProd@Nightstar-kpuumf.gv.shawcable.net] has joined #code |
21:52 | | JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds] |
--- Log closed Wed May 28 00:00:34 2014 |