--- Log opened Sun Jan 01 00:00:30 2012 |
--- Day changed Sun Jan 01 2012 |
00:00 | <~Vornicus> Also, I was wrong: whenever a connection starts a transaction, the database locks; single queries get wrapped in their own transaction if they're not already in one. |
00:06 | <~Vornicus> Each individual session/thread should have its own connection. |
00:08 | < Tarinaky> | Ahah, cool. |
00:08 | <~Vornicus> This makes life a lot easier, I imagine. |
00:08 | <~Vornicus> It is not nearly as sophisticated as the lock systems on other programs, where there are table locks and sometimes even page locks. |
00:09 | <~Vornicus> But it's a lot nicer than complete denial to second-comers. |
00:09 | < Tarinaky> | I think a stackoverflow I saw said that the connection can be shared between threads. |
00:09 | < Tarinaky> | Just not the cursor. |
00:11 | < RichardBarrell> | AIUI, no databases allow you to share cursors between threads. |
00:12 | < RichardBarrell> | Some let you share connections between threads, some don't. |
00:13 | <~Vornicus> Considering how much a cursor is a Giant State Machine Of Death, yeah, you'd better not be able to share them. |
00:19 | | Derakon is now known as Derakon[AFK] |
00:26 | | * Vornicus sighs vaguely, should get back to building the database for vornsettlers |
00:29 | | Kindamoody|out is now known as Kindamoody |
00:31 | <~Vornicus> Which had some gloriously ridiculous select statements in it. |
00:32 | < ToxicFrog> | I now think of that as Vortlers |
00:32 | <~Vornicus> Heee |
00:33 | <~Vornicus> (I had a view that could tell you where a particular player could build a road, it was spectacular. let me see if I can find it again.) |
00:36 | <~Vornicus> (a View, for those of you playing the home game, is a select statement that's built into the database strongly enough that very often you can talk about it like a table.) |
00:36 | | maoranma [maoranma@Nightstar-b7e1e6d1.pools.spcsdns.net] has joined #code |
00:37 | < maoranma> | if notIdle = 1 then { Hi Noah } else { derp } |
00:38 | <~Vornicus> (indeed, views often come with, in larger database systems, their own permissions, independent of the tables they're based on.) |
00:38 | <~Vornicus> DERP |
00:38 | <~Vornicus> sorry, got that wrong. |
00:38 | <~Vornicus> DERP NOAH |
00:39 | < himi> | I think permissions and the like on views are built into current SQL standards |
00:40 | < maoranma> | Derp Vornicus |
00:40 | <~Vornicus> Yeah, but sqlite doesn't even have permissions |
00:41 | < Tarinaky> | sqlite isn't client/server. |
00:50 | <~Vornicus> THe select statement is your best friend and the thing you'll probably get the most mileage out of. UPDATE and DELETE are very simple. |
00:51 | | Derakon[AFK] is now known as Derakon |
01:14 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code |
01:21 | | Kindamoody is now known as Kindamoody[zZz] |
02:15 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection reset by peer] |
02:16 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code |
02:24 | | * Vornicus pokes at his code |
02:24 | | Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code |
02:25 | <~Vornicus> I guess at some point I'm going to need to lern2render here |
02:27 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds] |
02:27 | < Derakon> | Like, write your own raytracer? |
02:27 | < Derakon> | Or figure out some modern modeling program? |
02:27 | <~Vornicus> No, like, feed openGL. |
02:27 | < Derakon> | Ah. |
02:28 | <~Vornicus> Also figuring out a modern modeling program would help, but feeding openGL would be a nice bonus! |
02:28 | <~Vornicus> would be the important part. |
02:28 | < maoranma> | I head once you learn it, it's the same in every program you use it in |
02:28 | < Derakon> | Ehh, more or less. |
02:28 | < maoranma> | heard* |
02:28 | < Derakon> | There are certain base skills that transfer from one program to another. |
02:28 | < Derakon> | Being able to think in three dimensions, knowing what the basic tools are, etc. |
02:29 | < Derakon> | Knowing what the different lighting modeling systems generate. |
02:29 | < maoranma> | Dropped frames? |
02:29 | < maoranma> | I thought they all generate those |
02:29 | < Derakon> | Har. |
02:30 | < maoranma> | Thanks, I'll be here all night |
02:30 | < maoranma> | Except when I'm not |
02:30 | <~Vornicus> I can think in 3d, that I've never had too much trouble with. |
02:30 | < Derakon> | No, I meant things like bump mapping, normal mapping, etc. |
02:31 | < Derakon> | There's also a certain amount of skill involved in getting the shape you want while retaining a tidy mesh. |
02:39 | <~Vornicus> right now I've been feeding POV Ray, which is not the way to build a video game, let me tell you. |
02:43 | < Derakon> | Heh, yeah. |
02:44 | < Derakon> | I used to work a lot with POV-Ray back in the day, but I was mostly just arranging toruses in repeating patterns. |
02:45 | <~Vornicus> I once built the Miranu Fighter. |
02:45 | <~Vornicus> And then one day I built a 6-sided die with custom faces, which I was going to show you but now I can't find it. |
02:47 | <~Vornicus> Also all the crazy line arts you've seen from this have been in pov. |
02:58 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [[NS] Quit: This computer has gone to sleep] |
02:59 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code |
03:00 | | Attilla [Obsolete@Nightstar-5a27386a.as43234.net] has quit [Ping timeout: 121 seconds] |
03:03 | | * Vornicus hmmms. Can drastically cut down on degenerate-removal time if I hint it with the indices of the start and end of where I do that, for time linear on number of degenerates that need removing, instead of time on number of points in the polygon, but the real speed problem is probably the polygon merger, which is O(m*n) for m and n vertex counts of the two things. |
03:07 | <~Vornicus> OKay, time to describe the problem: I have two polygons. One is small, and guaranteed convex; the other is large and not only not necessarily convex, but can have subpolygons. They are guaranteed to be outside each other; they are guaranteed to share two points, they are guaranteed to wind in the same direction. |
03:08 | <~Vornicus> (so the two shared points are guaranteed to appear in the opposite order from each other) |
03:08 | < Derakon> | Is the larger polygon guaranteed to not overlap itself? |
03:09 | < Derakon> | And presumably you're trying to efficiently find the shared points? |
03:09 | <~Vornicus> It is guaranteed not to self-overlap "properly", but it is possible for it to touch itself. |
03:09 | <~Vornicus> Yes. |
03:09 | < Derakon> | So, a point on the polygon can lie on one of its edges without actually participating in that edge, so to speak. |
03:10 | < Derakon> | Okay, I don't really see why the shape of the larger polygon is an issue here. |
03:10 | <~Vornicus> It is possible for two edges or two points to coincide completely |
03:10 | < Derakon> | Make a dict mapping points to their positions on the smaller polygon, iterate over points in the larger polygon, if you find two in a row that are also adjacent in the other direction in the smaller polygon, you're done. |
03:11 | < Derakon> | ("position" as in "index", e.g. 1st point, 2nd point, etc.) |
03:11 | <~Vornicus> ...shit that is linear. Woot |
03:11 | <~Vornicus> Thank you Der! |
03:11 | < Derakon> | Happy to help. :) |
03:12 | <~Vornicus> Certainly faster than a try-catch loop around list.index() |
03:13 | < Derakon> | try-catch will tend to slow you down, yeah. |
03:13 | < Derakon> | IMO you should never write code where you expect the catch statement to occur regularly. |
03:14 | < Derakon> | (Certainly not in a compiled language where the CPU is going to be pre-executing your code on the presumption that you'll not hit the catch block, because then you have a ton of unwinding to do, and that's sloooow) |
03:14 | < McMartin> | Unless your language guarantees continuation-based semantics, or is guaranteed to use stack cutting instead of unwinding. |
03:14 | < McMartin> | So, ML and similar. |
03:14 | < Namegduf> | My understanding is that almost all exception mechanisms are slow when they happen, to an extent much worse than a branch misprediction. |
03:14 | <~Vornicus> The alternative here was if x in first: a = first.index(x) |
03:14 | < McMartin> | Stack cutting is no more expensive than a function return; continuation editing is no more expensive than a tail call. |
03:14 | < McMartin> | Both require the runtime to be gc'd, though. |
03:14 | <~Vornicus> Which is two pass. |
03:18 | < maoranma> | Looks like GlovePIE developer is planning to start charging for his software :\ |
03:19 | | RichardBarrell [mycatverbs@Nightstar-4ad9b0c6.bb.sky.com] has left #code ["ERC Version 5.3 (IRC client for Emacs)"] |
03:20 | <~Vornicus> Nice. Cut time down to 28% of previous time. |
03:21 | < maoranma> | I'm really surprised I haven't seen an opensource solution to input device remapping |
03:22 | <~Vornicus> not doing my debug prints for hinting I'm down to 23%. |
03:34 | <~Vornicus> OKay, now to check out hinting properly. |
03:40 | | Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has quit [Client exited] |
04:42 | | * McMartin tries to figure out where Steam's version of ScummVM hides its save games. |
04:42 | < Derakon> | Which platform? |
04:42 | < McMartin> | Mac |
04:42 | < Derakon> | Probably under ~/Library/Application Support/Steam then. |
04:42 | < McMartin> | Yeah, but I'm not finding anything probable with respect to it. |
04:42 | < Derakon> | Ah. |
04:43 | | * Derakon shrugs. |
04:48 | <~Vornicus> Hot. Hinting the degenerate-edge-removal algorithm drops me down to 0.078 seconds, which means I've gotten a nearly tenfold speed boost from those two things. |
04:51 | <~Vornicus> (the degenerate-edge-removal algorithm locates places where the points go a-b-a and replaces them with simply a. I discovered that there's only two places where that can happen given the way I'm merging polygons, so telling the algorithm those two places drops it from linear-on-points to linear-on-degenerates) |
04:53 | <~Vornicus> And that's on reference python, no pypy or that thing that lets you annotate with types or anything. |
04:54 | < Derakon> | "that thing" is Cython, I suspect. |
04:54 | <~Vornicus> Probably. |
04:59 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Client closed the connection] |
05:01 | | * Vornicus commits that code and fiddles with whatever he needs to do next. |
05:03 | | Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds] |
05:08 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code |
05:51 | | Kindamoody[zZz] is now known as Kindamoody |
05:51 | | * Vornicus tries to figure out what this is called anyway. |
05:53 | <~Vornicus> I think it's called sub-polygons. |
06:46 | <~Vornicus> also, finding the math for miter joins is kind of hard |
06:48 | | Derakon is now known as Derakon[AFK] |
06:52 | | * Vornicus can probably do that by hand though. |
07:00 | < Reiver> | sub-polygons? |
07:02 | | Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code |
07:04 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds] |
07:05 | <~Vornicus> http://www.flickr.com/photos/7861878@N06/6605223235/ Consider the cenral area, where there's a small grey spot separated from the other grey. The polygon that is the large black area has that thing's edge as a "subpolygon" - but the polygon as a whole is still one piece, so there's a little piece of edge that connects it with the outside part. |
07:06 | <~Vornicus> I want to separate the two, so things that are based on the edges of the large polygon actually work. |
07:22 | <~Vornicus> (trying to, for instance, draw walls along those edges, would not work as is.) |
07:32 | <~Vornicus> okay enough of that. More math and code tomorrow. |
07:41 | | Vash [Vash@Nightstar-8697fea9.wlfrct.sbcglobal.net] has quit [[NS] Quit: I<3craft Vorn!] |
07:53 | | eckse [eckse@Nightstar-e0fc8261.dsl.sentex.ca] has quit [Connection reset by peer] |
07:59 | | eckse [eckse@Nightstar-e0fc8261.dsl.sentex.ca] has joined #code |
08:47 | | Kindamoody is now known as Kindamoody|out |
08:54 | < jerith> | Ooh, Vornikins. I've just had a fantastic use for your thing. |
08:55 | < jerith> | I have some bitmapped fonts and I need to make outline fonts out of them. |
08:56 | < jerith> | The usual autotracing stuff doesn't work, because the resolution is too low. |
08:57 | < jerith> | But if I use something like your polygon whatsit, I can get a better shape to work with. |
09:05 | | eckse [eckse@Nightstar-e0fc8261.dsl.sentex.ca] has quit [Connection reset by peer] |
09:13 | | celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [Client exited] |
09:13 | | celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code |
09:16 | | celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
09:21 | | You're now known as TheWatcher |
10:25 | | Attilla [Obsolete@Nightstar-c075ee54.as43234.net] has joined #code |
11:17 | | Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds] |
11:22 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code |
12:07 | | You're now known as TheWatcher[afk] |
13:55 | | Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has joined #code |
14:35 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
15:25 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
15:54 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds] |
16:01 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code |
16:07 | | celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code |
17:30 | | Kindamoody|out is now known as Kindamoody |
17:44 | | Vash [Vash@Nightstar-8697fea9.wlfrct.sbcglobal.net] has joined #code |
17:52 | <~Vornicus> jerith: that's certainly a possible use case; one wouldd have to write the full original algorithm for that though. I can drop you my code but I should probably comment it first. |
17:53 | < jerith> | "Write the full original algorithm"? |
17:55 | < jerith> | Do you mean finish what you're doing or are you basing your code on something else? |
17:55 | <~Vornicus> http://research.microsoft.com/en-us/um/people/kopf/pixelart/ I'm using the first few steps of the algorithm described here |
17:56 | <~Vornicus> SPecifically, I'm building a connectivity graph, choosing diagonals (using a different heuristic from theirs), building the pseudo-voronoi polygons, and connecting them together to make the outer edge. |
17:56 | <~Vornicus> After that, the algorithm turns the edges into bezier curves, and uses a weighting trick to smooth those curves. |
17:57 | <~Vornicus> I won't be doing those steps. |
17:59 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds] |
18:05 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code |
18:17 | | You're now known as TheWatcher |
18:29 | < jerith> | Ah, right. |
18:29 | < jerith> | Are you going to draw bitmaps? |
18:31 | <~Vornicus> Once I'm done with the current stuff, I have to start figuring out how to load data into openGL |
18:43 | | ErikMesoy [Erik_Mesoy@Nightstar-f7eedefa.80-203-17.nextgentel.com] has joined #code |
18:49 | <~Vornicus> And at that figure out what data I'd need to generate the things I want in OpenGL. |
19:10 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds] |
19:14 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code |
19:29 | | Kindamoody is now known as Kindamoody[zZz] |
20:02 | | eckse [eckse@Nightstar-e0fc8261.dsl.sentex.ca] has joined #code |
20:03 | < jerith> | Vornicus: Are you writing this in Pyton? |
20:03 | < jerith> | *Python? |
20:03 | < jerith> | If so, what are you using to generate the output? |
20:03 | < jerith> | PIL? |
20:04 | <~Vornicus> Heh. POV-Ray, actually. I'm insane. |
20:04 | <~Vornicus> and yeah, Python is doing the code |
20:05 | | * jerith is starting on the bits he needs, which means reading BDF files. |
20:11 | < Tarinaky> | What whitespace does SQL allow? |
20:11 | < jerith> | Pretty much all of it, I believe. |
20:12 | < Tarinaky> | And what whitespace -should- I use to break up a statement so it's not massively long... |
20:12 | <~Vornicus> tabs, newlines, spaces, it's all allowed. |
20:12 | <~Vornicus> My usual thing is to, um |
20:12 | <~Vornicus> Hang on, let me space one here. |
20:13 | < Tarinaky> | http://pastebin.com/fs8ECMEK << Is this good? |
20:14 | < Tarinaky> | Or should I be breaking it up in a different way? |
20:14 | <~Vornicus> http://paste.ubuntu.com/789884/ |
20:14 | <~Vornicus> That's pretty much what I'd do for a create, yeah, though i get kind of weird about stuff |
20:14 | <~Vornicus> YOu may find it useful to put individual query strings in their own files. |
20:15 | < Tarinaky> | That seems a little bit excessive. |
20:15 | <~Vornicus> Oh, also, use triplequotes when you do that. |
20:15 | < Tarinaky> | Why? |
20:15 | <~Vornicus> So c.execute(""" .... """) |
20:15 | < Tarinaky> | I thought triple quotes were for docstrings? |
20:15 | <~Vornicus> Not just docstrings |
20:16 | <~Vornicus> Triplequotes are used whenever you want multiline strings. |
20:16 | < Tarinaky> | Ahah. |
20:16 | < Tarinaky> | Umm... What's python's way of moving a file? |
20:16 | < maoranma> | Or multiline comments |
20:16 | < Tarinaky> | This is supposed to be a 'set up' script so if users.db exists it should move it. |
20:17 | < maoranma> | Took me a while to get my intro to programming instructor to accept that until I gave him the twitter where Guido approves |
20:17 | <~Vornicus> os.rename |
20:17 | < Tarinaky> | Ahah. |
20:17 | < Tarinaky> | Cheers. |
20:19 | < Tarinaky> | Oh God's sake Chromium. Please may I look at 3 web pages at the same time? |
20:20 | < Tarinaky> | Man. I'm really not used to using python for shellscripts. |
20:20 | < Tarinaky> | How do I test if the file exists? |
20:24 | < Tarinaky> | Ahah. os.path |
20:29 | <~Vornicus> Check out the whole module, it's a lot of good stuff. |
20:39 | < Tarinaky> | If I use excute(" ... (?,?) ... ", What goes here? |
20:39 | < Tarinaky> | A python tuple? |
20:39 | < Tarinaky> | Or just the arguments as seperate arguments? |
20:39 | <~Vornicus> A tuple or list. |
20:44 | < Tarinaky> | Okay. Say I want a python function that returns true if a username exists. |
20:44 | < Tarinaky> | What would be the select statement I use as a base for it? |
20:44 | < Tarinaky> | SELECT what? |
20:44 | < Tarinaky> | Since I'm only interested in whether a row is returned at all. |
20:52 | <~Vornicus> select user_name ... |
20:53 | <~Vornicus> Anything works for that, really. |
21:08 | < Tarinaky> | Euuuugh. I've screwed this up so badly. |
21:08 | | * Tarinaky facepalms. |
21:23 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds] |
21:28 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code |
21:40 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds] |
21:42 | <~Vornicus> What's wrong? |
21:45 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code |
22:12 | | Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code |
22:14 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds] |
22:23 | | ErikMesoy is now known as ErikMesoy|sleep |
23:17 | < maoranma> | What's the concept where something exists because something else requires to exists for the purpose of the first thing existing? |
23:18 | <~Vornicus> For humanity in particular it's "the anthropic principle" |
23:18 | < maoranma> | Like, uh, in Simcity 4, if you don't save, you eventually will crash to desktop, and it's the crashing to desktop that warrants having to save. |
23:18 | < maoranma> | And if you DO save, it won't crash |
23:19 | < maoranma> | Reading on the anthropic principle |
23:23 | | Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds] |
23:24 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code |
23:29 | | Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code |
23:29 | | Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds] |
--- Log closed Mon Jan 02 00:00:01 2012 |