--- Log opened Tue Jan 31 00:00:19 2012 |
00:29 | <@ToxicFrog> | Oh goddamnit. |
00:29 | <@ToxicFrog> | The windows build of lqt doesn't incorporate the patch I sent. |
00:30 | | Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code |
00:31 | | Reiver [orthianz@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
00:50 | | Derakon[AFK] is now known as Derakon |
00:58 | <~Vornicus> | What's your patch do? |
01:00 | <@ToxicFrog> | NULL pointers are passed to lua as nil rather than as a boxed NULL of the appropriate type. |
01:00 | <~Vornicus> | aha. |
01:00 | <@ToxicFrog> | This means that you can do things like: if scene:itemAt(pos) then... |
01:00 | <@ToxicFrog> | Instead of: local NULL = scene:itemAt(-9999,-9999); if scene:itemAt(pos) ~= NULL then... |
01:01 | <@ToxicFrog> | (at least boxed values are interned, so you don't need to worry about two calls returning different nulls unless they are null pointers of different types) |
01:01 | <~Vornicus> | Aha |
01:01 | <~Vornicus> | Yes, that is Useful. |
01:15 | <@ToxicFrog> | Now the question is, do I build the windows version of lqt from source, or do I add a workaround for this problem to the windows version of felt? |
01:56 | <&Derakon> | Okay, what's the recommended way to do "cp ~ /Volumes/BackupDrive"? |
01:57 | <&Derakon> | Since I started this copy yesterday and it's still going, and has spit out a bunch of errors somhow. |
01:58 | <&Derakon> | Also, given that my home directory contains 211GB of stuff, it seems odd that I've managed to copy 465GB onto the backup drive. |
02:00 | <@Ling> | First off, you'll want to use -a, secondly it's better to use rsync. |
02:01 | <&Derakon> | D'oh, stupid symbolic links. |
02:02 | <&Derakon> | Recommended rsync invocation? |
02:04 | | * Derakon googles, ends up with rsync -aP |
02:20 | | Attilla [Obsolete@Nightstar-036c237a.as43234.net] has quit [Ping timeout: 121 seconds] |
02:35 | | Derakon is now known as Derakon[AC2] |
02:55 | | gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Z?] |
03:26 | | celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code |
03:26 | | Kindamoody[zZz] is now known as Kindamoody |
03:31 | | Derakon[AC2] is now known as Derakon |
03:42 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out] |
03:58 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code |
03:58 | | mode/#code [+o ToxicFrog] by ChanServ |
04:59 | <&McMartin> | Woo |
04:59 | <~Vornicus> | ooW? |
04:59 | | * McMartin finishes up his complete draft IR |
04:59 | <&McMartin> | 94 lines for the full type specification for a Pascal IR. |
05:01 | <~Vornicus> | IR? |
05:01 | <&McMartin> | Intermediate Representation |
05:01 | <~Vornicus> | aha |
05:02 | <&McMartin> | http://pastebin.ubuntu.com/823447/ |
05:04 | <~Vornicus> | sweet |
05:04 | <&McMartin> | Oops, still have one thing commented out |
05:05 | <&McMartin> | callable_decls shouldn't be commented, obvs |
05:08 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
05:09 | | Vash [Vash@Nightstar-8697fea9.wlfrct.sbcglobal.net] has quit [Ping timeout: 122 seconds] |
05:14 | <@ToxicFrog> | Derakon: rsync -avvPh is usually what I use. |
05:14 | <@ToxicFrog> | Tack a -z on there if the data compresses well. |
05:15 | <&Derakon> | vv for extra verbose? |
05:15 | <@ToxicFrog> | Yeah. |
05:15 | <@ToxicFrog> | And h for human-readable units (bytes/kB/MB/GB) instead of blocks. |
05:15 | <&Derakon> | Yeah. |
05:15 | <&Derakon> | Kinda useless if you're transferring a couple hundred thousand small files though~ |
05:16 | <@ToxicFrog> | If I'm worried about the trustworthiness of my transport or destination filesystem, I add -c as well (which checksums the files before and after copying) |
05:16 | <&Derakon> | Thanks. |
05:17 | <@ToxicFrog> | (and if you're copying to something like vfat that doesn't support permissions, use -r instead of -a, otherwise you'll get dozens of pages of error messages about timestamps and permissions) |
05:18 | <@ToxicFrog> | (-z, incidentally, zlib-compresses the data before transmission; it's useless for local copies, but a great help when doing network copies over a slow connection) |
05:19 | | gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code |
05:30 | | himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds] |
05:58 | | iospace is now known as iosleep |
06:00 | | Kindamoody is now known as Kindamoody|out |
06:26 | | Kindamoody|out [Kindamoody@Nightstar-5507a6b5.tbcn.telia.com] has quit [Connection reset by peer] |
06:26 | | Derakon is now known as Derakon[AFK] |
06:27 | | Kindamoody|out [Kindamoody@Nightstar-5507a6b5.tbcn.telia.com] has joined #code |
06:27 | | mode/#code [+o Kindamoody|out] by ChanServ |
06:53 | | eckse [eckse@Nightstar-d939497f.dsl.sentex.ca] has quit [Client closed the connection] |
07:03 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
07:03 | | mode/#code [+o himi] by ChanServ |
07:11 | | You're now known as TheWatcher |
07:23 | | celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [Connection closed] |
08:04 | | You're now known as TheWatcher[ak] |
08:15 | | cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [Client closed the connection] |
09:02 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
09:02 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
09:52 | | You're now known as TheWatcher |
10:06 | | maoranma [maoranma@490720.C448F4.1402BD.E3F5F7] has quit [Client closed the connection] |
11:01 | | You're now known as TheWatcher[d00m] |
11:17 | | Attilla [Obsolete@Nightstar-036c237a.as43234.net] has joined #code |
11:54 | | Kindamoody|out is now known as Kindamoody |
12:00 | | You're now known as TheWatcher |
12:44 | <@Tarinaky> | Idiot question: |
12:44 | <@Tarinaky> | Can an sqlite connection be shared? |
12:45 | <@Tarinaky> | Or should I -always- open and close the file constantly. |
12:45 | <@Tarinaky> | Or is it enough to simply create and commit new cursors? |
12:49 | | Kindamoody is now known as Kindamoody|out |
13:02 | | Kindamoody|out [Kindamoody@Nightstar-5507a6b5.tbcn.telia.com] has quit [Connection closed] |
13:02 | | Kindamoody|out [Kindamoody@Nightstar-5507a6b5.tbcn.telia.com] has joined #code |
13:02 | | mode/#code [+o Kindamoody|out] by ChanServ |
13:09 | | Vash [Vash@Nightstar-cdeba41f.wlfrct.sbcglobal.net] has joined #code |
13:09 | | mode/#code [+o Vash] by ChanServ |
13:36 | <@jerith> | Tarinaky: sqlite is pretty much single-connection only. |
13:36 | <@jerith> | I think it's /safe/ to share it (although I'm not 100% sure) but the performance hit is really horrible. |
13:40 | | * TheWatcher eyes this student |
13:40 | <@TheWatcher> | He wants to learn perl |
13:41 | <@TheWatcher> | I have this strange sensation; I am torn between encouraging him (because I know I'll be able to direct the way he learns it), or yelling FLY, YOU FOOL |
13:41 | <@jerith> | TheWatcher: Point him at Ruby instead. |
13:41 | <~Vornicus> | No do not do that |
13:42 | <@jerith> | That way he can inflict his damage on a community that deserves it.~ |
13:42 | <@TheWatcher> | sneeerk |
13:42 | <~Vornicus> | Ah, well if that's what you're going to do, then yeah, go ahead~ |
13:43 | <@jerith> | TheWatcher: Do you really want to spend your time teaching him? |
13:44 | | Kindamoody|out is now known as Kindamoody |
13:46 | <@TheWatcher> | jerith: well, I probably won't be doing much of actual teaching, but I will be pointing him at resources I think are worth looking at, and teaching some aspects of Not Writing Typical Perl. |
13:47 | <@jerith> | TheWatcher: I repeat my question. :;-) |
13:47 | <@jerith> | -: |
13:47 | <@TheWatcher> | Well, I'll put my answer another way: "not really, but better me than the internet" |
13:48 | <@jerith> | Why does he want to learn Perl? |
13:48 | <@TheWatcher> | Something to do with his MSc project. Not entirely certain |
13:49 | <@TheWatcher> | Possibly as an antidote to the endless stream of java they have in the msc taught modules these days |
14:01 | | Attilla_ [Obsolete@Nightstar-036c237a.as43234.net] has joined #code |
14:01 | | Attilla [Obsolete@Nightstar-036c237a.as43234.net] has quit [Ping timeout: 121 seconds] |
14:16 | <@Tarinaky> | So if I open and close connections as requested - will it behave reasonably or will it throw exceptions? |
14:16 | <@Tarinaky> | I mean, I don't think the performance will be a major issue since I can only read/write as a fast as the disk will go anyway. |
14:18 | <@Ling> | Not entirely correct, modern operating systems have their own disk cache |
14:19 | <@Tarinaky> | Give or take. |
14:19 | <~Vornicus> | (which is why you have to click that little button before you remove your flash drive.) |
14:19 | <@Ling> | Opening/closing it repeatedly could cause the OS to flush the file to disk then read it again pointlessly. |
14:19 | <@Tarinaky> | Life's too short to remove my drives safely :p |
14:20 | | Kindamoody is now known as Kindamoody|out |
14:22 | <@Tarinaky> | But yeah. I was told to use sqlite because I don't need ENTERPRISE |
14:22 | <@Tarinaky> | But I'm already using an async framework for the networking... |
14:23 | <@Tarinaky> | So it's not single-threaded. |
14:24 | <@Ling> | Language? |
14:24 | <@Tarinaky> | At least, not if I understand what TWisted does >.< |
14:24 | <@Tarinaky> | Python with Twisted. |
14:24 | <@Ling> | Oh, Python |
14:25 | <@Ling> | My understanding is Twisted is painful unless every other module is designed to work with it. |
14:27 | <@Ling> | How many things need direct access to make SQL queries? |
14:27 | <@Tarinaky> | Pfft, no idea :) |
14:27 | <@Ling> | What are you making? |
14:27 | <@Tarinaky> | MUD server |
14:28 | <@TheWatcher> | ... in twisted. |
14:29 | <@Ling> | Oh! Should be easy then: have each storable object produce a dictionary to be saved to the storage, then have a single access point to the storage which generates the objects by giving the dictionary back. |
14:29 | <@Ling> | Then you'd be able to swap out different storage systems |
14:30 | <@Tarinaky> | Don't '...' >.> this was what I was told to use >.< |
14:31 | <@Ling> | Are you learning? |
14:32 | <@Tarinaky> | I'm not sure I understand the question. |
14:32 | | iosleep is now known as iospace |
14:32 | <@Ling> | Have you coded in Python before this without following a guide? |
14:33 | <@Tarinaky> | Yes. |
14:38 | | You're now known as TheWatcher[afk] |
14:38 | | Kindamoody|out is now known as Kindamoody |
14:39 | | Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code |
15:12 | <@Tarinaky> | Okay. So what -should- I be doing for my database? |
15:12 | <@Tarinaky> | Baring in mind working at all > working fast. |
15:25 | <@Ling> | Pickle? |
15:26 | <@jerith> | Tarinaky: sqlite should be fine if you don't have lots of concurrent access. |
15:26 | <@jerith> | This is from Twisted, right? |
15:26 | <@jerith> | What kind of stuff needs to go in the db? |
15:29 | <@Tarinaky> | Basically everything. |
15:29 | <@Tarinaky> | If only for serialisation and recovery. |
15:29 | <@jerith> | What does "everything" include? |
15:30 | <@Tarinaky> | I don't know. I don't have a design. |
15:33 | <@jerith> | Do you expect most things to be per-player? global? |
15:46 | | Attilla_ is now known as Attilla |
15:56 | <@Tarinaky> | Global I guess. |
16:02 | <@jerith> | Hrm. |
16:03 | <@jerith> | Twisted isn't great for SQL databases in general. |
16:30 | | Vash is now known as Vash[Out] |
16:37 | <@Tarinaky> | I don't really know what I'm doing or how to achieve it. |
16:37 | <@Tarinaky> | I just wanted to avoid writing a bunch of code. |
16:38 | <@jerith> | You don't want to write a bunch of unnecessary code, right? |
16:38 | <@Tarinaky> | Right. |
16:38 | <@jerith> | But you aren't sure what code is necessary yet. |
16:38 | <@Tarinaky> | Well, code in geneeral - I am lazy :p |
16:39 | <@jerith> | Because you don't have the experience to tell the difference. |
16:39 | <@jerith> | But the way you get the experience is to write unnecessary code. :-) |
16:40 | | EvilDarkLord is now known as Maze |
16:40 | <@Tarinaky> | Yeah... |
16:40 | <@jerith> | Anyways, start with a simple system that does just what you need right now. |
16:40 | <@Tarinaky> | But I don't really want to have to reimplement the stuff I'm using Twisted for atm. |
16:40 | <@Tarinaky> | If only because laaaaze. |
16:41 | <@jerith> | You'll almost certainly replace it later, but by then you'll have a better idea of what you need. |
16:41 | <@Tarinaky> | That as well. |
16:42 | <@jerith> | So yeah. You're going to throw away code. That's a given. |
16:42 | <@Tarinaky> | This isn't what I was talking about though. |
16:43 | <@Tarinaky> | I was just emitting a preference for not handrolling my own netcode. |
16:43 | <@jerith> | The difference is whether you plan to throw it away and spend minimum effort on it or whether you overengineer it in the hope that you won't. |
16:43 | <@jerith> | Twisted is a really good base for this kind of thing. |
16:44 | <@jerith> | 18:03 <@jerith> Twisted isn't great for SQL databases in general. |
16:44 | <@jerith> | That was "you might not want a SQL db", not "you might not want Twisted". |
16:44 | <@Tarinaky> | Ooooh. |
16:44 | <@Tarinaky> | What might I want instead? |
16:44 | <@Tarinaky> | brb, food. |
16:45 | <@jerith> | Dunno. Something like redis, maybe? |
16:51 | <@Tarinaky> | (The obvious advantage to SQL though is it's an employable skill~) |
16:51 | <@jerith> | So is experience with couchdb or whatever. |
16:52 | <@Tarinaky> | I've been asked questions about SQL in an interview before. |
16:52 | <@Tarinaky> | Not so much couchdb. |
16:54 | <@Ling> | You're applying to big corperations then |
16:55 | <@Ling> | For startups NoSQL is much more common |
16:55 | <@Tarinaky> | atm I'm not applying to anyone. But it was a medium sized, but existing, company. |
16:55 | <@jerith> | If you want to learn SQL, use SQL. |
16:55 | <@Tarinaky> | I think they did something to do with real estate and err... cms. |
16:56 | <@jerith> | If you're writing a MUD-type thing, it probably isn't the best tool for the job. |
16:56 | <@Tarinaky> | You're probably right. |
16:56 | <@jerith> | It's certainly a pain to talk to a relational db from Twisted. |
16:56 | <@jerith> | (I do that in my work code.) |
16:58 | <@Tarinaky> | Stupid question: WHat's special about a relational db? I mean, what's the opposite of that. |
17:00 | | eckse [eckse@Nightstar-d939497f.dsl.sentex.ca] has joined #code |
17:00 | | mode/#code [+o eckse] by ChanServ |
17:01 | <@jerith> | A relational db is made of tables with rows and columns. |
17:01 | <@jerith> | Some of these columns can contain links to things in other tables. |
17:01 | <@jerith> | (These are "relations".) |
17:02 | <@jerith> | So you can have a "customer" table that contains customer details and an "orders" table that contains order details. |
17:02 | | eckse [eckse@Nightstar-d939497f.dsl.sentex.ca] has quit [Connection reset by peer] |
17:02 | <@Tarinaky> | Oh sure, I get that. |
17:03 | <@jerith> | One of the fields in the "orders" table is a link to the customer who placed the order. |
17:03 | <@Tarinaky> | It's just the relational part implies there's a different way of doing it. |
17:03 | <@jerith> | So you can run a query across both tables, linking the rows based on that field. |
17:03 | <@Ling> | Depending on the NoSQL it can either store: a document (something structured like JSON), a blob (some DBs, like BDB can get multiple keys from this), simple key/value, XML, etc... |
17:04 | <@jerith> | And then say stuff like "find me all orders over $1k from customers in Chicago". |
17:04 | <@Ling> | Note the very few of the NoSQL DBs I've looked at support relations in a usable manner. |
17:04 | <@jerith> | Non-relational databases can't do that, because they don't have those relations. |
17:04 | | eckse [eckse@Nightstar-d939497f.dsl.sentex.ca] has joined #code |
17:04 | | mode/#code [+o eckse] by ChanServ |
17:05 | <@jerith> | Relational databases are really good at connecting lots of things together, but the cost is that all the stuff has to live in the same place. |
17:05 | <@jerith> | So if you don't keep all your data on one machine, you run into problems. |
17:06 | <@jerith> | If you outgrow a single machine, you need to split stuff up carefully. |
17:07 | <@jerith> | If everyone in Chicago lives on one machine and everyone from Nashville lives on another, you have to store their various orders in the right places as well. |
17:07 | <@jerith> | And then you can't easily have a common table of stock that both sets of orders reference. |
17:08 | <@jerith> | So the NoSQL databases drop the relations, but can do a bunch of other things better because they don't have to worry about them. |
17:08 | <@jerith> | On the down side, you don't get relations in the database. |
17:09 | <@jerith> | If you want to find all orders for customers in Chicago, you need to find all customers in Chicago and then find all orders that belong to those customers. |
17:09 | <@jerith> | Much less efficient in your code, because you have to do all the filtering and such yourself. |
17:10 | <@Tarinaky> | Yeah. |
17:10 | <@Ling> | Unless you store the orders in the customers. |
17:10 | <@jerith> | But you'd have to do a lot of that if you're sharding your SQL database anyway. |
17:11 | <@jerith> | Anyways, NoSQL databases are good at different things. Mostly in the direction of "fast" and "big". |
17:13 | <@Tarinaky> | I require "Simple" |
17:14 | <@Tarinaky> | (Well, Simple and Free :p) |
17:15 | <@jerith> | I quite like redis. Might not suit you perfectly, but it certainly meets those two criteria. |
17:15 | <@jerith> | (Although possibly not on Windows.) |
17:16 | <@Tarinaky> | Ah, there's a point. |
17:16 | <@Tarinaky> | The system I've been using to test on I don't have admin access. |
17:16 | | * Tarinaky facepalms. |
17:17 | <@jerith> | I think you'll struggle to find a NoSQL database that runs well on Windows. |
17:18 | <@Ling> | Pickle |
17:18 | <@jerith> | Pickle must go away. |
17:18 | <@jerith> | I've never seen it used without causing pain and suffering for everyone involved. |
17:19 | <@Ling> | *shrugs* |
17:19 | <@Ling> | I find a bunch of things in Python to cause suffering |
17:19 | <@Ling> | Last I check it has yet to have any decent SQL driver (for any DB) |
17:19 | <@jerith> | Ling: Yeah, but I generally don't recommend them. |
17:20 | <@jerith> | What do you mean by "decent"? |
17:20 | <@Tarinaky> | Taking a step back, for a moment. |
17:20 | <@Tarinaky> | Do I actually want/need a database. |
17:20 | <@jerith> | Tarinaky: Do you want persisted data? |
17:21 | <@Tarinaky> | Yes. But that doesn't require a database. |
17:21 | <@jerith> | I'm using the word "database" very generally. |
17:21 | <@Tarinaky> | I'm not. |
17:21 | <@jerith> | Let's switch to datastore, then. |
17:21 | <@Tarinaky> | I think we accept that I will require data. |
17:21 | <@Tarinaky> | And that data will have to live somewhere. |
17:22 | <@jerith> | You can write your own files by hand, and there's a long and proud tradition of doing this badly in MUDs. |
17:22 | <@jerith> | (But it sometimes really is the best solution. Almost never, but still.) |
17:23 | <@jerith> | You could use a relational database, but you'll probably run into its weaknessens more than you use its strengths. |
17:23 | <@jerith> | (Thank Eris we're finally leaving the era of the relation database being the One True Way To Persist Stuff.) |
17:24 | <@Tarinaky> | I thought the disadvantage you mentioned was needing everything on a single server? |
17:24 | <@Tarinaky> | I can't afford more than one server :p |
17:24 | <@Tarinaky> | Oh. Cool. Mongo does python. |
17:24 | <@Tarinaky> | I thought it was js for some reason. |
17:25 | <@jerith> | Tarinaky: SQL databases are designed to do relational stuff well, which means they sometimes do things the long way around even if you don't need relations. |
17:25 | <@jerith> | Also, SQL gets in the way if you just want to say "give me the data for this user id". |
17:29 | <@Tarinaky> | To be honest, they all kindof get in the way >.> |
17:33 | | * TheWatcher[afk] isn't sure what's 'getting in the way' of "SELECT * FROM users WHERE id = ?" ¬¬ |
17:34 | <@jerith> | TheWatcher[afk]: You need a static schema, for starters. |
17:34 | <@jerith> | Adding a field requires a schema migration. |
17:35 | <@jerith> | Unless you shove everything in a giant text blob. |
17:35 | <@jerith> | In which case GLHF. |
17:35 | <@Tarinaky> | GLHF? |
17:35 | <@jerith> | Good Luck, Have Fun. |
17:36 | <@Tarinaky> | I -was- going to get around that by having a table for 'settings'. That was just user_id, key, value or something. |
17:37 | <@Tarinaky> | But I can see why that might be considered bad >.> <.< >.> |
17:39 | <@TheWatcher[afk]> | jerith: I note that adding fields is only a big problem if you haven't written your code expecting that to happen. |
17:40 | <@jerith> | TheWatcher[afk]: Does that include your code being happy with several minutes of table locking which the migration runs? |
17:40 | <@jerith> | (Or, in my previous company, close to three hours?) |
17:40 | <@Tarinaky> | "Yes" |
17:40 | <@jerith> | (That was a special case, though. The guys in charge of that were morons.) |
17:42 | <@TheWatcher[afk]> | jerith: anything that big happens during scheduled maintainence. |
17:43 | | * TheWatcher[afk] shrug |
17:43 | <@Ling> | Scheduled maintenance? You funny. |
17:43 | <@Ling> | Last company I worked for wanted "100% uptime" |
17:43 | <@jerith> | TheWatcher[afk]: Sure. As long as you don't have an SLA that precludes multi-hour downtime. |
17:43 | <@Ling> | We didn't get fancy smancy things like "scheduled maintenance" |
17:47 | <@Tarinaky> | Pickle doesn't look that bad >.> <.< >.> |
17:47 | <@jerith> | Tarinaky: That's why it's dangerous. :-) |
17:48 | <@Tarinaky> | It looks easier to use than Java's serializable. |
17:48 | <@jerith> | Tarinaky: That's why it's dangerous. :-) |
17:49 | <@Tarinaky> | What's BSON, and how is it different to JSON? |
17:50 | <@Tarinaky> | My main concern though is whatever I do needs a sensible way of recovering from a server crash. |
17:51 | <@jerith> | That's why you don't want to do your own flat-file format. |
17:51 | <@jerith> | You don't care so much about losing data. You care about breaking it. |
17:51 | <@Ling> | BSON is basically the same as JSON application side, BSON is just faster to parse and binary (instead of UTF-8 or ASCII) |
17:52 | <@jerith> | If a write that happened a couple of seconds ago gets lost, you have something that's a little stale rather than something broken. |
17:52 | | * Tarinaky nods. |
17:52 | <@jerith> | Then again, you need to be careful about app-level consistency. If you make a two-part change and one part doesn't get written... |
17:53 | <@Tarinaky> | In the worst case scenario there's nothing I can do to stop it breaking somehow. |
17:54 | <@Tarinaky> | +anyway >.< |
17:54 | <@Tarinaky> | IDK. |
17:54 | <@Tarinaky> | I need to have a really long thing whatever I do. |
17:54 | <@Tarinaky> | *think |
17:55 | <@Tarinaky> | I just want to make sure that if the OOM Killer smites everything all I have to do is reboot :p |
17:55 | <@Tarinaky> | Even a Runtime error should be well behaved enough to let everything clean up. |
18:09 | | Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has quit [Client exited] |
18:15 | <@jerith> | https://twitter.com/#!/kurt/status/164396897426096129 |
18:26 | | maoranma [maoranma@Nightstar-ba3a4fc4.pools.spcsdns.net] has joined #code |
18:27 | < maoranma> | WUBWUBWUB |
18:27 | <@Tarinaky> | jerith: Github is horrible. |
18:27 | <@jerith> | Tarinaky: I don't find it to be so. |
18:27 | <@Tarinaky> | Compared to just using ssh on a server you have an account on. |
18:28 | <@jerith> | (But our usages might be different enough to make a differenc.) |
18:28 | <@jerith> | github's an immediate win as soon as you want collaboration. |
18:28 | <@jerith> | Forks, pull requests, etc. |
18:28 | <@Tarinaky> | The web interface is nice. |
18:28 | <@Tarinaky> | But I don't have any friends :p |
18:29 | <@jerith> | Tarinaky: Hey, I looked at your code last night. Doesn't that count? ;-) |
18:30 | <@Tarinaky> | It certainly hasn't earned me any Engineering jobs :p |
18:31 | <@Tarinaky> | Okay. Would anyone hit me if I used something like the following, and Pickle: http://pastebin.com/bAL1Ur5P |
18:32 | <@Tarinaky> | Abusing the fact that Python objects are just key/value pairs themselves. |
18:32 | <@jerith> | I'd print out a copy of PEP-8 so I could roll it up and whack you with it.~ |
18:32 | <@Tarinaky> | Lol. |
18:33 | <@jerith> | You really don't want to use builtins as variable names. |
18:33 | <@Tarinaky> | I genuinely don't get the issue over spaces after commas and such... |
18:33 | | * Tarinaky facepalms. |
18:33 | <@Tarinaky> | Okay, imagine List was called something differnt. |
18:34 | <@Tarinaky> | Or is it something else? |
18:34 | <@jerith> | (I was talking about the tabs there, though.) |
18:34 | | * Tarinaky hasn't run this through the compiler. |
18:34 | <@Tarinaky> | jerith: I literally just typed that into pastebin. |
18:34 | <@Tarinaky> | I find pressing space 4 times unnatural. |
18:34 | <@Tarinaky> | My IDE of choice does spaces automagically. |
18:35 | <@jerith> | So, you've made an object that adds itself to a thing that you pass in, and assumes a bunch of structure about that thing. |
18:36 | <@jerith> | This isn't a fantastic idea. |
18:36 | <@Tarinaky> | I haven't made anything. |
18:36 | <@Tarinaky> | I'm just trying to figure out what I'm even doing :/ |
18:36 | <@jerith> | What are you trying to achieve? |
18:37 | <@Tarinaky> | I don't know. I guess have Accounts that are composed of (among other things) characters which are in turn composed of other things... |
18:37 | <@jerith> | I can show you some better ways to do that "create a new thing and add it to a collection", but adding empty things to another thing is pretty useless. |
18:37 | <@Tarinaky> | And then just write this to disk periodically in case the OOM Fairy strikes. |
18:37 | <@jerith> | Why do you need to group characters into account? |
18:38 | <@Tarinaky> | It seems sensible. |
18:38 | <@jerith> | Or rather, why do you need to do this *now*? |
18:38 | <@jerith> | You need a character to do stuff. |
18:38 | <@jerith> | So make the account and the character the same thing, because it's simpler. |
18:39 | <@Tarinaky> | It doesn't really seem a whole lot simpler. |
18:39 | <@jerith> | You have one thing instead of two. |
18:39 | <@Tarinaky> | But they're each half the size~ |
18:39 | <@jerith> | What does an "account" need to do? |
18:40 | <@jerith> | No. Because you've thrown out all the stuff that lets you have more than one character in an account. |
18:40 | <@jerith> | Have you ever heard of a Minimum Viable Product? |
18:40 | <@Tarinaky> | I have not |
18:40 | <@Tarinaky> | (Is it sold by Microsoft~) |
18:40 | <@jerith> | (No, *Viable*.~) |
18:41 | <@jerith> | It's kind of a businessy buzzword thing recently, but it's based on a pretty good idea. |
18:41 | <@jerith> | You want to build something that works. |
18:41 | <@jerith> | The sooner you can make it work, the sooner you can do interesting things with it. |
18:42 | <@jerith> | So you cut out every single feature that isn't absolutely necessary to making it work. |
18:42 | <@jerith> | You don't need a distinction between "character" and "account", because it'll still work if you only get one character. |
18:43 | <@jerith> | Boom! An entire abstraction layer goes away. |
18:43 | <@jerith> | So you end up with something that does very little, but that actually *does* it. |
18:44 | <@jerith> | Rather than fiddling for months with bits that don't actually make up a working thing. |
18:44 | <@jerith> | Make sense? |
18:45 | <@Tarinaky> | Sure. But it doesn't -really- solve my headache. |
18:45 | <@Tarinaky> | Of trying to figure out where to put it. |
18:46 | <@jerith> | It solves a big part of that headache by making the answer "nowhere, because you don't need it (yet)" for a whole lot of stuff. |
18:46 | <@Tarinaky> | Where do I put my list of characters. |
18:46 | <@jerith> | If you're being absolutely minimal, you don't need to persist anything yet. |
18:46 | <@Tarinaky> | I'm not. |
18:46 | <@jerith> | Because you don't have anything to persist yet. |
18:47 | <@Tarinaky> | Persisting that is. |
18:47 | | Kindamoody is now known as Kindamoody[zZz] |
18:47 | <@jerith> | Ah. You just want to hook it into your game logic or something? |
18:47 | <@Tarinaky> | I don't know :p |
18:47 | <@Tarinaky> | Sorry, I really am terrible at software design >.< |
18:48 | <@jerith> | Tarinaky: "inexperienced", not "terrible". |
18:48 | <@jerith> | And I tend toward the Socratic Method in my tutoring, because I find it makes stuff stick better. |
18:49 | <@jerith> | (Although it can be more frustrating for the student, because it requires them to think harder.) |
18:49 | <@Tarinaky> | I tend to be too reticent to seek help in the first instance. |
18:49 | <@Tarinaky> | So it doesn't work great on me. |
18:49 | < maoranma> | My cat seems to like dubstep... |
18:50 | <@Tarinaky> | ...I liked dubstep before it was popular... |
18:50 | <@jerith> | Tarinaky: It seems to be working now. :-) |
18:50 | <@Tarinaky> | Okay, so I have a module character containing a class Character and a username/Character dictionary? |
18:50 | | * Alek gives Taki a hipster necktie. |
18:50 | <@jerith> | So anyway, start by building the user thing without worrying where to put it. |
18:51 | <@Tarinaky> | Alek: i'm not skinny enough to be a hipster. |
18:51 | < maoranma> | Seriously, she keeps rubbing all over my arm at the laptop. And I know she can't be in heat since she's spayed |
18:52 | <@Alek> | there's fat hipsters too. |
18:52 | <@Tarinaky> | jerith: That's just a username and a password. Hence why I was doing the account first... |
18:52 | <@Alek> | mao: maybe she likes the wibes. |
18:52 | <@Alek> | vibes. dangit. |
18:52 | <@Tarinaky> | Since nothing else matters till there's something to interact -with-. |
18:52 | <@Tarinaky> | I thought you meant wibes... |
18:52 | <@Tarinaky> | Like... Wub wub wub. |
18:52 | <@Tarinaky> | Does she like the wub wub wub or the wubwubwubs? |
18:52 | <@Tarinaky> | :p |
18:53 | < maoranma> | Tarinaky: She says yes. |
18:54 | <@Tarinaky> | Massive DAWW, |
18:54 | <@jerith> | Tarinaky: I suppose you need a collection of users (or accounts or whatever) that you can log in as. |
18:55 | <@jerith> | But don't worry about that yet, because you don't have any users yet because you haven't created one. |
18:55 | <@jerith> | So start with the thing that lets you create a user. |
18:55 | <@Tarinaky> | Did that. |
18:55 | <@Tarinaky> | Lol |
18:55 | <@Tarinaky> | I got bored during Telematics. |
18:56 | <@jerith> | Have you hooked that up to your network thing? |
18:56 | <@Tarinaky> | Or, as I will now call it, "How to identify different cables... #3, the Co-axial... The coaxial..." |
18:56 | <@Tarinaky> | Yes. |
18:56 | <@jerith> | Cool. So you can fire the thing up, connect to it and create a user. |
18:56 | <@jerith> | Correct? |
18:57 | <@Tarinaky> | In theory. |
18:57 | <@Tarinaky> | There's nowhere to create it :p |
18:57 | <@jerith> | You don't need a place to put it to create it. |
18:57 | <@jerith> | Just create it. Worry about where it goes later. |
19:01 | <@ShellNinja> | I just noticed that using strcpy() is like assembly. |
19:03 | <@Tarinaky> | C was originally intended to be portable assembly. |
19:03 | <@Tarinaky> | It does neither badly :p |
19:03 | <@Tarinaky> | *neither, badly |
19:04 | < maoranma> | Yea, the comma makes the context WAY different there. |
19:05 | < gnolam> | Pfft. |
19:05 | < gnolam> | C is excellent at what it's intended for. |
19:06 | < gnolam> | My only real complaint is that the fixed size datatypes should've been introduced way before C99. |
19:06 | <@jerith> | gnolam: They were. As long as you know what machine you're on. |
19:07 | < gnolam> | Pfft x 2. |
19:07 | | * Tarinaky giggles. |
19:07 | <@jerith> | (And in reality, pretty much every useful compiler has had them for decades. But different enough that you couldn't easy switch compilers.) |
19:13 | <@Tarinaky> | Right, time to test and make a slew of commits fixing missing instances of the keyword self :) |
19:14 | <@ToxicFrog> | It's aliiiiiiiiiiiiiiiiiiiiiiiiiiive |
19:14 | <@ToxicFrog> | On both linux and windows |
19:17 | <@Tarinaky> | Sweeeet. |
19:17 | <@Tarinaky> | It works. |
19:17 | < gnolam> | With the sound of music? |
19:18 | <@TheWatcher[afk]> | ToxicFrog: Idly, don't know if you noticed - GOG has Thief Gold up |
19:19 | <@ToxicFrog> | TW: yes. |
19:19 | <@ToxicFrog> | Time to sneak in through the sewers, slip past the guards and make off with a copy~ |
19:19 | <@TheWatcher[afk]> | It is, apparently, entirely devoid of actually useful things like ddfix, but hey |
19:20 | < gnolam> | And it retails for around the same as you can get the Thief Collection for. |
19:20 | <@Tarinaky> | jerith: Is this okay? https://github.com/Tarinaky/AberByCyberscape/blob/master/abcmud/character.py |
19:21 | <@jerith> | Looks good. |
19:21 | <@jerith> | You might want to make index a class variable instead, though. |
19:21 | <@Tarinaky> | In what way? |
19:22 | <@jerith> | class Character(object): |
19:22 | <@jerith> | index = {} |
19:22 | <@jerith> | name = None |
19:22 | <@jerith> | <etc.> |
19:22 | <@Tarinaky> | But then each character will have its own index... |
19:22 | <@jerith> | No, because it's on the class. |
19:22 | <@Tarinaky> | Which isn't correct at all. |
19:22 | <@jerith> | Technically, name and password are class attributes as well. |
19:23 | <@jerith> | The difference is that they're strings, which are immutable. |
19:23 | <@Tarinaky> | Oh dear... |
19:23 | | * Tarinaky shifty eyes. |
19:24 | <@jerith> | So you set a new value in the constructor and it creates a new instance attribute that masks the class attribute and everything's happy. |
19:24 | <@Tarinaky> | I -thought- that putting it in the class was just a handy way of saying that this object has these attributes... |
19:24 | <@jerith> | It does, kind of. |
19:24 | <@jerith> | As I explained above. |
19:24 | <@Tarinaky> | But only for certain things... |
19:25 | <@jerith> | No, for everything. |
19:25 | <@Tarinaky> | And I've used this a lot more than just now. |
19:25 | <@jerith> | But if the thing there is mutable, you can modify it instead of replacing it. |
19:26 | <@jerith> | If you say "self.index = {1: 'foo'}" in a method, you create an instance attribute that's also a dict. |
19:26 | <@Tarinaky> | https://github.com/Tarinaky/AberByCyberscape/blob/master/abcmud/user.py << For example this one... |
19:26 | <@jerith> | But if you say "self.index[1] = 'foo'" you modify the class attribute. |
19:27 | <@Tarinaky> | Where I had user.settings = {} waiting to trip me up. |
19:27 | <@jerith> | Indeed. |
19:27 | <@Tarinaky> | But if I change it to settings = None |
19:27 | <@Tarinaky> | And make __init__ assign a dict to settings, then it's all fine? |
19:28 | <@jerith> | Yup. |
19:28 | <@jerith> | You don't even need to have "settings = None" in that case. |
19:28 | <@Tarinaky> | I find it more readable. |
19:29 | <@jerith> | Since it just means you'll get a different exception if you try to use it. |
19:29 | <@jerith> | (But it doesn't hurt to have it.) |
19:29 | <@Tarinaky> | I just want an equiv to "public int x,y;" |
19:30 | <@jerith> | Why? |
19:30 | <@Tarinaky> | Because it makes it easier for some reason. |
19:31 | <@Tarinaky> | IDK. |
19:31 | <@Tarinaky> | I just feel more comfortable, lol. |
19:31 | <@jerith> | Try leaving it out for a bit. That feeling will go away. |
19:32 | <@Tarinaky> | It also means they appear down the right hand side of the screen of my ide. |
19:32 | <@Tarinaky> | and other "autocomplete" things. |
19:32 | <@Tarinaky> | Since anything in init doesn't exist till runtime. |
20:09 | | eckse [eckse@Nightstar-d939497f.dsl.sentex.ca] has quit [Ping timeout: 121 seconds] |
20:14 | | Attilla_ [Obsolete@Nightstar-0762f3cf.as43234.net] has joined #code |
20:14 | | Attilla [Obsolete@Nightstar-036c237a.as43234.net] has quit [Ping timeout: 121 seconds] |
20:32 | | Maze is now known as EvilDarkLord |
21:45 | | Vash[Out] is now known as Vash |
21:48 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
21:57 | | eckse [eckse@Nightstar-d939497f.dsl.sentex.ca] has joined #code |
21:57 | | mode/#code [+o eckse] by ChanServ |
23:00 | | himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code |
23:00 | | mode/#code [+o himi] by ChanServ |
23:19 | | You're now known as TheWatcher |
23:26 | <@Alek> | <yoshik> I just realized that I haven't used my DVD drive in 3 years. |
23:40 | | * TheWatcher eyes irssi's perl handling code |
23:42 | <@TheWatcher> | Iw ould be kinda nice if it actually told you that you got auto-shoved into the Irssi::Script::<scriptname> package |
--- Log closed Wed Feb 01 00:00:36 2012 |