DC Comicon

I went to DC Comicon this weekend, and the experience was not quite was I was expecting or hoping for. I’ve seen other people’s reactions to it, and they are wildly differing, to say the least. For the record, I agree more with the former than the latter. As a non-collector, it didn’t make me swoon to see leagues and leagues of not-very-recent books on display and for sale. The artists present were scattered around and I couldn’t tell if they were big names or small guys based on their positioning or presentation, and I’m not deep enough in the rabbit hole to intrinsically know the difference on name alone.

But more than that, was the major headache the second blog post mentioned: it was more like a VA Comicon #2. It was in Fairfax, which, while close to DC, is not actually DC. It’d be purely a matter of semantics, but the fact of the matter is that I live in Baltimore, and every extra mile is an extra pain in my ass. Plus, as I’ve discovered from working on a campus that’s huge and it isn’t easy to leave for some food and come back unless you want to eat away two hours, urban location can be pretty important. People should be able to socialize more than saying “Oh, you want at this box? Sure.” That was seriously the most social event I had while there. Of course, the George Mason University was probably the most receptive to the event, or charged much cheaper than any place in the heart of DC would, but if you’re going to announce a DC comics convention, you should be prepared to deal with what being in DC entails.

Aside from that, the logistical problems William mentioned were quite true. I wasn’t driving, so I had my phone out, alternating between the campus map and Google maps, and I still almost wound up leaving the campus accidentally before I turned around and got to the parking lot. We were followed from there by someone who had even less of an idea how to get there than I did, so I was feeling the pressure when it turned out we went up and around a building needlessly. Damn social anxiety. Then I was asked for directions on our way out by a deaf guy across the street, and hopefully my wild gesturing was helpful cause I don’t think he was close enough to read my lips and I still don’t know ASL.

One of the bigger busts was not the con’s fault, but my own, in that I was kind of looking forward to meeting the aforementioned William, cause he seems pretty cool and I prefer knowing people in real life when possible. Unfortunately, not realizing that he was likewise looking forward to meeting up and having made several circuits of the floor, I decided to go ahead and head out. Adding to the decision was the fact that I’d almost bumped into a couple of people several times, during which I stopped suddenly, right on my partner’s feet, while he was wearing flip-flops. Since he looked about ready to toss me out the nearest window by the second or third time I did it, it seemed a good idea not to risk further incidents. Again, none of this was anything to do with the con itself, just stuff that happened to…er, happen.

It wasn’t really a horrible experience, but it’s probably not one I’ll repeat unless a couple of things change for next year. It should be in DC. It should be more than a vendor room. It should have clear directions for parking and for getting to the convention. The $5 admission price is well under what I’d expect for a convention, but was about par or above for paying to pay for stuff. I have hopes for next year, but I’m not holding my breath too long.

I am looking forward to Baltimore Comic-Con though, I’ve heard it’s quality.

Odds and Ends

I’ve had a mishmash of thoughts today, so, what better place to toss them than a blog no one reads? Sure, why not!

First off: Free Comic Book Day was today, and it was fine. I went to Amazing Spiral in the Rotunda shopping center and picked up a couple of trade paperbacks (The Sandman vol. 6: “Fables and Reflections“, and Cable and Deadpool vol. 6: “Separation Anxiety“). While The Sandman series strikes me more like a heady novel-type read, the Cable and Deadpool has already been consumed as “lighter” fare, and was delicious. I know the sacrifice at the end has been undone via comic book magic but it was still pretty poignant, and the balance of the book was pretty hilarious. Still have yet to start the other one.

I picked up a couple of freebies too: War of the Supermen and Thor #1 (I think the second one the guy just threw in cause he was nice, not cause it was meant to be free). I’ve never been big on Norse mythology, and Marvel’s watered-down version certainly doesn’t make me leap for joy, but Thor #1 definitely makes me want to read more of this. Fortunately, it’s a year or two old, so I already can!

Second off: I got in a debate with someone over Steve Jobs’s recent “open letter” on Flash. She lauded him for standing firm on “this controversial issue.” Of course, it ain’t exactly health care and human rights we’re talking about here. It’s about an asshole sitting on top of a mountain of money and guarding it like a rabid Doberman. At any rate, he’s being douchey and claiming to be only acting in the best interests of consumers everywhere.

Hey Steve: shove your concerned protection, please. Thanks.

I don’t think, with a five-minute review process, that any app gets the entirety of its code checked for all possible security threat vectors, nor do I think it’s fully put through its paces to make sure it doesn’t crash (I use a couple relatively “popular” apps that crash all the fucking time). 3D games, lauded on the system, are complete energy whores. At no point does he acknowledge that his “it’s buggy and crash-happy” (paraphrased) argument holds water only when you admit that the entire ecosystem is built around such buggy, crash-happy, energy-sucking apps, mixed in with an overwhelming pile of shitty flashlight and fart apps. You’ve got a few gems, like Foursquare, but a lot of that 100,000+ library is pretty terrible. Anyway, I like my internet with Homestar Runner, and why the fuck do you think I need to be protected from what I want in the first place?

Oh yeah, that’s right, cause you’re a self-centered whiny little bitch. Adobe has been getting smacked around by your financial muscle, strong-armed by a skinny black-turtle-necked jackass who used them up and now that he’s done with them, is posting all the nude photos for everyone to laugh at. Yes, even the one with the bunny ears. Especially the one with the bunny ears. Like I said with the bullshit about Gizmodo, they’re allowed to be just as douchey as the market allows them to be with regards to their closed ecosystem and completely arbitrary approval process, but the key word, underlined and bolded for your convenience, is douchey. This is why I hate those guys, and that’s not even getting into how they’re playing at being Magnum P.I. and trying to go around the police (who are already banging down doors in a highly-suspect potentially-illegal action for them). They’re assholes through and through. The only argument that jumps out at me as logical in the whole tirade was “flash was designed for mice,” and even then it doesn’t have to use that idiom, it just does right now. It’s all preference, and Steve Jobs, in classic “I have the best brain ever, BOOM” douchebag fashion, is cramming his down everyone else’s throats.

Third, and finally, off: I think I’ve figured out what I want to call this blog. It references the blog post I wrote several months ago when I was just starting out. It’s part of a quote I feel really proud of, and that’s what I’d really like this blog to be about: writing I can later look back on and hopefully, for the most part, be proud of. Not all of it will be, of course, as I’ll probably look back on this post later and the inevitable back-and-forth about how justified Apple is in doing whatever it damn well pleases, or that maybe Deadpool is a lot more “deep” than I gave him credit for (anybody?!), and regret that I ever said anything.

Whatever.

The new title of the blog, in case you’re curious (and also stupid, cause it’s now in the header) is “An Oak In The Fall.”

Welcome.

Faithful Ramblings

Lest it seem too much like self-congratulatory fawning over my own work, let me say this: I do not really think my last blog post was particularly great. I do think it was good, though I see some cracks, and clearly can see where someone might come across with a “bad” verdict. Still, I wanted to write a bit about what I meant by the whole thing, in spite of a distinct lack of comments on it (I honestly was expecting at least one or two).

To lead off: this story is decidedly fiction. It had a few elements to it that were inspired by real events, but for the most part it is fictitious. I wrote it while depressed, as that seems to be the only time remaining wherein I’m distinctly creative. I walled myself off and had Sigur Rós’s ( ) playing. Sigur Rós, like Massive Attack, has been a must-buy for me for years, all based on watching this haunting video at 4AM one night a long time ago.

I wasn’t really sure what I was planning on writing, at first. Actually, the first part I wrote was the bit in the third paragraph, at the well. As I was writing, I was taking periodic breaks to find quotes that were floating around in my head, and to either integrate them, use them as inspiration, or both. My initial search was for “The time has come to put away childish things.” It seems, based on my initial search, that I mashed up two quotes: one from Lewis Carroll’s The Walrus and the Carpenter around the 11th stanza, and one from the Bible, specifically 1 Corinthians 13:11. Interestingly, I chose neither of those quotes, but ones relating to the 3rd stanza and 1 Corinthians 13:2.

I knew I had heard the quote from Corinthians before, but it didn’t occur to me until later where it was: wedding ceremonies. Strangely, I thought of it and immediately jumped to how appropriate it would be at a funeral (strangely I say, because I’ve been to many wedding where they’ve used it). I’ve got a friend who says weddings and funerals are the same thing. Of course he’s being incredibly sardonic, but it has some grain of truth (for the more religious/spiritual among us): in a way, it’s an ending of one life, and a beginning of another (presuming the presence of an afterlife, as one listening to scripture might do). And of course, for the humanist in me, being faithful is all well and good, but living and dying without love is pretty damn terrible.

The third and fourth quotes were somewhat more deliberate, as I put them in after writing at least half of the story, rather than at the beginning like the first two. I had just finished reading Neil Gaiman’s “The Sandman” vol. 5, “A Game of You,” and the quote about wishing came from there. From what I could tell, it actually is an old saying, and most of the time isn’t quite as vulgar, but I liked the vulgarity because it seemed more like you’d expect a phrase like that to come. The last quote I looked for specifically as something to do with silence, cause that’s where I wanted to go with the last portion of the story. After passing up a quote from Shusaku Endo’s “Silence” because it hammered too heavily on the Christian aesthetic for my tastes, I settled on a quote from John Cage in reference to his piece 4’33″, which felt better as it had to do with the nature of silence (his idea was actually built into the narrative), and isn’t just something from a work titled “Silence.”

I said I wanted to critique my work a bit, so I’ll get to that, but I also realized another reason I was doing this was for attribution. Footnotes in the text seemed like they’d be gaudy, and so I didn’t include them. However, in fear of people not searching for these quotes and realizing who the original authors were, I felt compelled to discuss it, at some length. At any rate, onward:

As I said, I wrote the third paragraph first. The first I wrote specifically after the inclusion of the Lewis Carroll reference, and honestly it feels a bit forced, like I was leading into the quote and never quite delivered. The idea was that the person who died was just dead, and all the moping was pointless cause they were crying over an empty vessel. Unfortunately, that could not have been more obscured by the text and I think that ultimately the atheistic, cynical, and nihilistic existentialism in the first paragraph really jars when set against the more spiritual context of the scripture quotation later. Although, the narrator’s opinion could be argued to be changing by the time he’s at the bus stop, hence going to the well in the first place.

The other part that’s consistently bothered or delighted me, depending on my mood at the time, is the change in tense. For the first half, it’s in present tense. The second half is in past tense, and takes place over a longer span of time. The change in tense itself doesn’t bother me insomuch as the fact that it felt backwards: the first half occurs historically first, so if anything is past tense, it should be that. However, I keep waffling. It’s all after-the-fact reasoning, though. The real truth is that I just had tense trouble (going back and forth with present and past) throughout and it was easiest to resolve it the way I did, although…

I mention in the last paragraph a scene that didn’t occur anywhere else, with the drifting off in the first bus ride. The whole first half could just be a memory, and like all memory it’s faulty and only the parts that are important to you at the time tend to surface. When the narrator was cynical, all he could remember was his cynicism and the cause of it. When he was hopeful, he remembered something more positive. And, as the entire thing was a memory, he was narrating it like he was there. In that respect, the verb tense issue could be resolved, and I can pat myself on the back for something so deep that I didn’t necessarily mean to do in the first place.

Speaking of tense: I changed “could make it” to “can make it” to sound more hopeful. I’m not sure if it didn’t just sound like I’d forgotten the way I started the sentence. Instead of saying “could” like it’s past tense and has been proven wrong, I say “can” to show it’s still going on, thus: so far, so good. Whatever. The final word problem I had was in the first paragraph again, “tinnitus.” It’s a chronic ear-ringing condition that runs in my family, and it’s maddening. But, more than that, it broke up the narrative because someone might go “what the hell is that?” That would be a dead stop in the story right there as they pulled up Wikipedia, and would be kind of terrible.

Speaking of Wikipedia, I wanted it to be a timeless sort of story, set anywhere, so I avoided mentioning technology as much as possible. I’m not sure what I could have done about the bus stop, it just seemed like the right location, but clearly that places it sometime since the turn of the last century or so, and as such reduces the “timeless” quality (and not nearly every place has bus stops). Ah well.

At any rate, like I said, it wasn’t my best work to date, but I like it. I originally intended to post a follow-up as a comment on the post, but as you can see from the length of this post, that wasn’t particularly feasible, as it’s longer than the story itself. Hopefully it’s given you more clarity as to what I was thinking, or that it’ll help me to write better in the future. I’d really like to know what people think of these things, so if you’re reading, please do comment (either here or on the original post). I’ve got to approve posts when you do it the first time, but you’re “trusted” after that.

Short Story: Faith

Everyone looks better in a black suit. I distinctly remember thinking it first this morning when getting ready, trying for about the 5th time to get the tie tied to the right length, and now it won’t get out of my head. It’s like a song that keeps repeating, but it’s just that thought, ringing like tinnitus, boiling my brain in its own juices. I look around at everyone else. There’s a lot of sniffling, and some dainty dabbing of eyes. No one’s broken out bawling, yet. I well up a bit, but it’s purely empathetic. I don’t feel anything at all. There’s nothing even in the box in front of us. It’s just a box.

The sea was wet as wet could be, The sands were dry as dry.

After the service, we’re waiting for the bus to come and take us back into town. We talk about something, hell, I don’t even bother to process what. “It was beautiful,” probably. Lip service. There’s probably a questioning of why these sorts of things happen. Out of the corner of my eye, I spot a wishing well next to the little shop that had cropped up next to the bus stop. I’m not really thinking about suits anymore, but something I’d heard earlier.

If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing.

I’m standing by the well. The coin I’d flicked in flutters lazily to the bottom. Already the exact wording of the wish I’d thrown together and uttered under my breath is fading. I look at you. You look away.

Wish in one hand, shit in the other, and see which one fills up first.

I tossed the bags on the couch, thinking I’d unpack them later. We went about our routines. Nothing had changed. Like the tides, we still came and went, not noting the passing of one of our number as it rolled back out to the sea. We’re all crashing up on the shore, and we’re all getting dragged back out. Later on, when the tears finally came, I cried alone. You never even knew it had happened. I wonder if you did the same, but we haven’t talked.

What they thought was silence, because they didn’t know how to listen, was full of accidental sounds.

A month later, I heard you. A little noise, a faint gasp. I looked at you and knew, and you reached out and put your hand on mine. The wind rustled outside, and I thought about that coin. I thought about the scripture that I’d heard, and the book I’d been reading on the way over when you’d fallen asleep and your head accidentally drifted onto my shoulder for a moment. I remembered, and I saw your eyes, and I believed once again that we can make it.

Gizmodo and the iPhone (Finally)

So, my blog went down for a few days. Dreamhost’s automatic scanning script detected something wrong, and disabled it. All I got in the error message was a warning to update all of my software/plugins (which everything was, except for two plugins that went out of date while the site was down), and to check the server-side code for malicious modifications. Despite WordPress being a giant hideous PHP beast, I went through it yesterday, and everything looked just about like I’d expect. I think it was triggered because I had an unencrypted/uncompressed backup copy in a subdirectory with a much older version of WordPress. I’m not sure if it was accessible, but I deleted it anyway to prevent future occurrences.

Moving on.

So, Gizmodo is apparently made up of jackasses. As anyone who’s read this is already well aware, they somehow acquired a next-generation iPhone prototype. As we all know, Apple’s ass is squeezed so tight even radio signals can’t get out, so it’s clear that Gizmodo having the device in the first place wasn’t very much on the up and up. That much was clear as soon as I read the original article.

However, they then upped their jack-assery by outing the Apple engineer whose phone it was. Now, don’t get me wrong: I have no doubt that eventually Apple was going to get their hardware back, and a simple serial number check would tell them to whom they gave it. His life at Apple, likely, was ended. That sucks for him, cause people who work at Apple tend to like it, in spite of the draconian restrictions on talking to anyone about what you do (I know people who work at NSA who are allowed to talk more about what they do for a living). Of course, that much was his own fault.

The problem for me, though, is that all of that is an internal Apple affair. In no way was it journalism to out a guy that was about to get canned. It might be a human-interest story about how evil Apple is that they’d fire someone for losing a prototype; but that might happen at any company, it’s just that much more certain at Apple. And that argument is even flawed, because if Gizmodo had simply been up front with Apple and returned the device, there might not have even been an issue. The human-interest argument, broken as it clearly is, also assumes that they were doing it for some sort of altruistic purpose.

They weren’t.

Reading through their repeated posts, it sounds like they’re trying to be funny while fingering the guy. Let me clue you in, Gizmodo: Apple isn’t going to say “well, clearly it’s this guy’s fault so we’ll just let it slide.” The whole thing reads like the following story: a nerdy guy is encouraged by his smooth-talking friends to steal his dad’s porno stash so they can all beat off in the tool shed later; the nerdy guy gets caught; the smooth-talking friends say, while snickering, “Well, shucks, Mr. Jobs, poor old Gray just made a mistake any of us could make, if we were trying to STEAL PORN MAGS TO BEAT OFF, golly goshes.” They act smugly about the entire affair, but the problem is that this wasn’t some small-time misunderstanding, and Steve Jobs doesn’t seem like the kindly hearted dad-next-door who doesn’t want to spank you with the full force of Johnny Law.

I do not like Apple’s methods of locking down all their research, the entire environment of their computers/devices, or much of anything about Apple (aside from the physical appearance and software stability of their computers, which you have to admit is sexy). However, it’s their prerogative. As a consumer, the only way you get to vote on this is with your dollars. They don’t do anything wrong legally by walling off their ecosystem, and it’s not a bout of journalistic prudence to crack open an illicitly-acquired prototype. It’s potential theft and destruction of property charges. And as much as I dislike Apple, and would relish the opportunity to know what the next iteration of their software/hardware does with out the “Apple Event” Steve Jobs/media circle jerk, it’s the way they do things, and the way they’re allowed to do things.

I’m not sure what the statutes will say about any of this legally, since the device has now been returned to Apple without invoking any law enforcement thus far. However, Apple has (to my estimation) the following possible recourses:

  • Do Nothing – Unlikely, to me. They rely on extreme secrecy, and if a breach of that secrecy goes unpunished, other people will be willing to say “screw it” in the future.
  • Cockblock Gizmodo – This seems almost a given. While other media outlets are invited to the Apple Events to get first cracks at live-blogging/tweeting new hardware and software releases, Gizmodo may have to sit outside in the rain and wait for scraps in the trash can left over from more favored pets. Note that the following options are still available in conjunction with this one.
  • Red Tape – Assuming there’s nothing that Apple can eventually legally do, they can still squash Gizmodo with long-term legal problems, overmatching them with a legal team big enough to staff an aircraft carrier, as big corporations are known for having, tying them up until their funds completely dry up and they collapse.
  • Lawsuit – Like the previous one, but successful: assuming they can prove that they lost R&D money, or eventual sales due to less impact at their eventually unveiling, or anything resulting from a yet-to-be-proven-illegal “transaction” (read: theft) of a prototype, that could land Gizmodo in spicy legal waters which could prove disastrous: from major fines all the way up to jail time.

I do not like being on Apple’s side on this. If it had stopped at “they published a story which damages Apple’s bottom line,” I’d wince and look away, feeling badly as they were eviscerated and/or annihilated at Cupertino’s hands; I might even write an objection at Apple’s shitty tactics (I did say I don’t like them). But the arrogance and flippant way in which they tossed the engineer’s name out there, while still protecting the guy who sold them the phone “as a source,” like they were some sort of legitimate news organization that just happened to act like guilty 15-year-olds, makes me hope for the worst.

Mashups and Massive Attack – Good Listening Times

I don’t often post about my musical tastes, as it leaves me ripe for criticism (“oh my god, you like this electro-trash?”). However, I haven’t posted recently and, in want of a more thought-out post, I’ll just list what has been occupying my ear canals for the last week or two. I mean, I added a whole category for it in my blog, might as well, right?

First off, I’ll admit readily that I’m a total mash-up whore. The idea that you can take two songs, sometimes even terrible songs on their own, and play them at the same time and come up with something awesome is just pretty neat to me. While it may seem  I’ve found a few I really like in the past, such as these two Ratatat/Michael Jackson ones (I can never figure out which I like more), this Eurythmics/Lady Gaga one (in spite of the quality issues), and this Gnarls Barkley/Avalanches mashup is just crazy awesome. I miss the original video I saw of that last one, which mashed up both songs’ videos and scenes from The Shining.

But no one has quite captured my fancy as much as Robin Skouteris, who regularly tosses six or so songs into the mix and makes it work. I suggest, if you enjoy a good mash-up, go check out his videos, cause almost all of them are good in some way. However, the one I really like is an ambient mix of HIM, Lady Gaga, Justin Timberlake, and what seems like 50 other people:

So, now that I’ve gotten that out of the way, let’s continue to a single artist. Massive Attack has been a long-standing favorite of mine. I have most of the CDs they’ve produced or been featured on. Yeah, CDs, right? I know. Anyway, somehow I missed that they released an album in February. I want to buy it, but at this point I’m still on the fence about this whole “digital media” thing. I want to avoid having more CDs to clog up my physical space, but I’m concerned that by downloading the music from iTunes or Amazon, I’ll be getting a file of inferior quality, due either to DRM or just low-rate encoding. I can’t tell much difference about the encoding cause it seems my high-range hearing is terrible, but other people complain when I put that crap on.

In the meantime, I’ve been entertaining myself by watching this incredibly trippy video for “Paradise Circus”:

Now I have to also get “The Fall,” which looks incredibly gorgeous based on this short video. Damn it YouTube, stop making me want to spend money.

Rusty

I went to the “Spaghetti Disco” at the church up the street from me tonight. It’s a benefit for a library-ish community center, also up the street from me (though going the other direction). All in all, it wasn’t bad. It led me to a realization, though, or rather led me to realize something again:

I’m a bit rusty.

There are a number of things at which I’m rusty: playing music, playing Quake (not that I was ever particularly good), and playing the social scene. Alright, I’ll admit that last one didn’t work. I’m a sucker for trying to stretch the rule of threes. But the point is, I’m just not very good at socializing. It’s probably not a big shock, and in fact you could likely discern this from not-subtle contextual clues here on this very blog. But there is positivity in that I’m trying, I think.

I think the main thing I still have to get over is wondering whether or not people like me. From what I can understand of people who are successful at having friends, they don’t spend a lot of time thinking about it. It may cross their mind from time to time, but it’s not the world-ending calamitous spiral into despair that it winds up being for me. Of course, that may be coming more from the fact that I’m a compulsive worrier than that I’m particularly bad at human interaction.

All things considered, though, I shouldn’t have anything to complain about with tonight. The event itself was pretty well organized, and definitely well attended. I finally met my foursquare nemesis, and he and his fiancée were cool people. Also, I found a beer which I don’t mind drinking (a rare breed indeed): Dundee Honey Brown. I wound up jetting after the raffle and the prizes, as the one beer I had didn’t get me loosened up enough to “shake [my] booty,” and as the bar was cash only I could not procure another. The building feeling that I was sticking out didn’t necessarily help, either.

But, like I always say at the end of these self-pitying blog posts, I must simply try to do better. It’s easy to complain about my failings, and probably necessarily cathartic in a way, but simply wallowing in it will not do. I’m not sure if I come off weird, or stupid, or any number of other negative adjectives. Most people probably wouldn’t tell me anyway, like a piece of food stuck on my chin. People are prone to such harmful niceties. But I can’t really let that be a defining issue for me. The only way to get better at performing is to perform more often. Being rusty shouldn’t be an excuse anymore.

Baltimore’s Snow Response

This is mostly in response to this post by another Baltimore native, in addition to some conversation I’ve had with him since. The feelings I have simply could no longer be expressed in 140 characters or less, and I’m not a fan of the long-form multi-tweet thought.

I realize that Baltimore is not a city in the north or in the midwest; 3 feet of snow is not something that happens every winter. After all, we tend to get a nice “wintry mix” of about 3 inches of wet snow that melts the next day and it sends most people into a blind panic. Given that the entire city hasn’t collapsed into a swirling vortex of despair, I’d say we’re doing pretty well. But that doesn’t mean I don’t think we can do better.

Given that we got hit with two storms in quick succession, a good two feet followed a few days later by another foot or so, I realize that there’s much to be done. Streets that were formerly plowed now need to be gone over again, and in the middle of a city there’s not much place for all that snow to go. However, my street was visited by a plow about an hour or two before the first flakes of second storm. That’s fine, it helps keep the total amount to be plowed next time down. Of course, that’s assuming they actually plowed. After sitting at the end of my block for a good few minutes (I’d assume they were digging out, except they’d have to have been doing it by telekinesis), they trundled down our street, plowing about halfway before lifting the scoop up and continuing on out of our block.

It’s not a terrible thing to take a break, as I’m sure those guys had probably been driving around city streets for many hours. But, if you’re actually going to resume plowing, I’d appreciate it if you plowed the whole street, and not just a little bit. Sure, it’s a business at the end of the block and not houses, but we still need to drive there. Since that time, like much the rest of the street, there is now a nice patch of packed-in snow sitting on top of a sheet of ice. Very nice.

Again, they have a whole metric shitload of snow to move all around the city, and it’s not unreasonable to assume that a silly residential side-street will get less attention than the main thoroughfares. But I actually ventured out into the city in my car for the first time since Thursday today, and I was delayed a good few minutes by a snow removal crew. The street was fine; they were clearing parking spaces. For that, I wouldn’t fault them, because I know people have been complaining about parking spaces, snow removal routes, etc. However, they weren’t in front of houses, or even a heavy business district. They were clearing spots in front of a church, and a garage (access to the garage was already available). At this point, I’d say that maybe their time would be better spent clearing out the side streets.

I say that because, after eventually getting back to our house, I had to grab a shovel and spend 20 minutes trying to break up the ice in the center of the road so that we could have enough traction to actually park in our carefully-cleaned spot. As an aside, here’s a note to other Baltimore city-dwellers: we did not put a chair in our spot; that crap is tacky. We got lucky and got our spot back but were willing to grab a shovel and make another one if need be. We shoveled a patch of pavement; doesn’t mean we own it. Back to the topic: there’s definitely an issue with organization. Could I do it better? Probably not, but I didn’t run for a seat in the city government.

If it sounds like I’m ragging on the city too hard, it’s just a form of tough love: for someplace where the average annual snowfall is less than one of two storms that hit it in a week, it’s doing pretty well. Don’t just take a pat on the back, though: there’s still work to be done, and ways it can be better. And for city residents, it’s hard to refrain from being shrill, but many snow-removal crews have been working pretty damn hard to make up for a lack of preparation, so a little slack might not be out of order.

Postgres Session Variables – Neat.

After futzing around a bit, and once again having my suspicions confirmed, I came up with the following solution to my session variables problem: temporary tables. They are dropped at the end of the session, so it all pans out nicely. I still didn’t like having to make front-ends do all the work (plus I was all excited after figuring it out), so I slapped together a pretty basic couple of wrapper functions:

/*
 * Session Variables in PostgreSQL via PL/pgSQL
 * Written/tested on version 8.4.2, but should work anywhere
 *
 * Code written by Stephen "sycobuny" Belcher
 *
 * Free to use, I enjoy writing stuff like this.
 * Just give me some props if you do.
 *
 */

/* -- These lines may not be necessary, lang/schema may exist

   -- Remove commenting only if they need to be created

CREATE
  LANGUAGE 'plpgsql';

CREATE
  SCHEMA SV;

 */

-- Make sure the session_variables temporary table exists

-- TODO: Make sure it has the right columns, too
CREATE OR REPLACE
  FUNCTION SV.ensure_session_table_exists()
  RETURNS VOID AS
$BODY$BEGIN
  PERFORM *
    FROM pg_catalog.pg_class
    WHERE relname = 'session_variables' AND
          relnamespace = pg_catalog.pg_my_temp_schema();

  IF NOT FOUND THEN
    CREATE
      TEMPORARY TABLE session_variables (
        "key" TEXT PRIMARY KEY,
        "value" TEXT
      );
    RETURN;
  END IF;
END;$BODY$ LANGUAGE 'plpgsql';

-- Set a variable. Yep.
CREATE OR REPLACE
  FUNCTION SV.set(IN xKey TEXT, INOUT xValue TEXT) AS
$BODY$BEGIN
  PERFORM SV.ensure_session_table_exists();
  PERFORM *
    FROM session_variables
    WHERE "key" = xKey;

  IF FOUND THEN
    UPDATE session_variables
      SET "value" = xValue
      WHERE "key" = xKey;
  ELSE
    INSERT
      INTO session_variables ("key", "value")
      VALUES (xKey, xValue);
  END IF;

  RETURN;
END;$BODY$ LANGUAGE 'plpgsql';

-- Get a variable's value. It's just that easy!
CREATE OR REPLACE
  FUNCTION SV.get(IN xKey TEXT, OUT xValue TEXT) AS
$BODY$BEGIN
  PERFORM SV.ensure_session_table_exists();
  PERFORM "value"
    FROM session_variables
    WHERE "key" = xKey;

  IF NOT FOUND THEN
    RAISE WARNING 'Variable % does not exist', xKey;
  END IF;

  SELECT "value"
    INTO xValue
    FROM ession_variables
    WHERE "key" = xKey;

  RETURN;
END;$BODY$ LANGUAGE 'plpgsql';

From this point, you just do:

SELECT SV.set('my session variable', 'its value');
SELECT SV.get('my session variable');

It handles creating and updating the table and values independently, without any hassles.

Well, there’s a couple hassles:

If it’s the first time you access it in a session, it barfs out warnings because PostgreSQL likes to warn you when it creates new indexes and constraints implicitly; whether this causes any libraries such as ActiveRecord to croak, I’m not sure – I will be testing that one shortly at least. Also, the get() function itself throws up a warning if you try to get a variable that hasn’t been defined yet. This is because the value of any variable can actually be NULL, but there’s nothing else to return if it hasn’t been defined yet. It’s an intrinsically implementation-specific concern whether this behavior is desired, so I split the difference: you can do it, but you’re going to be tut-tutted by the database.

So, there you have it. Of course, changing the schema into which I put these functions should be trivial; I put them there because I like the simple syntactic sugar it provides, but, as they are not tied to a permanent table it should be as simple as just changing the function names. I’ll probably wind up doing it myself, as my schemas are thematically named (individual “projects” and their “code names”).

There’s one final gotcha, which I didn’t fully account for because I ran out of ideas how to ensure it continues working right: PostgreSQL processes statements directed towards temporary tables first (if you don’t specify the fully qualified name), before checking the schemas in the search_path. I’m not sure if this is an SQL-standard way of doing things; if it isn’t, I’m sure they’ll correct it at some point, and then my code will be broken. Unfortunately, I’m not entirely sure how best to perform a query on a temporary schema (which is assigned a technically-random name by the database) without constructing the query as string, which totally removes any optimization done by preparing the statements ahead of time. If there’s some way around that, I’d be quite interested to hear it. Oh yeah, and it hides your “session_variables” table, if you’ve made one yourself. Sorry. Qualify your names and it won’t be a problem, though.

Postgres Triggers, Why Do You Hate Me?

Actually, in spite of the melodramatic post title, figuring out triggers in PostgreSQL has been relatively painless. Of course, I had a pretty firm grasp of them in MySQL, and thus the major migration headache is realizing that the code handling the trigger has to be defined separate from the trigger itself.

The issue for me, however, is that (unlike Peter Eisentraut)  I have a sordid love affair with schemas. For me, it’s not just about addressing the potential naming conflicts, but breaking down the tasks our database/frontend performs into more manageable blocks. Put it this way: I have over 100 tables, functions aplenty, and datatypes (as ENUM now has to be a datatype) to spare. While I recognize that it’s not impossible to manage, and there’s many systems that probably have a volume of data far exceeding mine, it still does wonders for my sanity if I can break those down so I only have to look through at most 25 tables at a time. They’re not randomly selected, they are geared towards similar ends and logically fit together, and I think schemas really helps on that front.

My solution to Peter’s problem of localized search paths is obtuse, but it works: I deliberately name the full path in anything that’s going inside a stored procedure. It’s a very tedious and defensive posture, but it has worked pretty well, at least up until now. This is where we get back to triggers: triggers in PostgreSQL are not named according to the same conventions as almost everything else in the DBMS. While most times, in the docs “simple_name” by itself is tantamount to “public”.”simple_name” (as the default search path is ‘”$user”, public’), this is not so for triggers. They are associated with the tables for which they are defined. While in hindsight, this makes sense, it took some time to figure this out (also, Michael Graziano pointed me in the right direction after I bitched about it). What would have been far more simple is if, anywhere in the documentation, they had simply specified this strange behavior. Even a hint, when executing “CREATE TRIGGER my_schema.do_something” other than a bland “syntax error at ‘.’” would be nice.

The other part of my problem with triggers doesn’t have anything to do with the trigger mechanism itself, but an issue I’ve encountered in the database as a whole. There is, as far as I can tell, no mechanism for creating connection-level or database-level custom variables. You can make variables obviously in any of the procedural languages. However, setting a variable, like MySQL’s “SET @@my_custom_variable := ‘some custom value’;” just doesn’t seem to exist. While this may not seem like a feature that would be particularly useful (after all, there are the aforementioned procedural languages), I’ve been finding it quite problematic.

When we were on MySQL, we used wxPerl and wxRuby as front-ends to connect directly to the database using database-level logins, and I was able to write auditing fairly handily: not only could I have information about the table on what data was modified and when, I could also log who modified the data. That doesn’t seem all that amazing, except that this was all database-side. The clients had to change exactly 0 code. You could even optionally issue a “@@COMMENTS := ‘my editing comments’;” and have it apply to all of the changes automatically until you unset it, providing an easy-access way to comment the audit log. I knew this was going to be problematic switching to rails, as ActiveRecord only ever connects as one user, and uses special models to manage logins. However, with MySQL, I could just ensure that the client issued a “@@CURRENT_USER := ‘whomever@address’;” before starting work. This, while obtuse, still has the database doing the majority of the legwork. I could easily reject any statements that occured before that variable was assigned, to make sure that changes made should always include complete auditing data.

PostgreSQL has denied my attempts at a simple solution to this, however. I’ve been searching, but the easiest solution seems to be to make a special table which holds “current connection” information and somehow tie the connection ID to the user ID that way. This seems pretty complicated, and I’m not sure how safe it is to assume that the connection ID will be unique for an arbitrary length of time (as I’m not sure what mechanisms exist for periodically purging the table of stale IDs). If there is any other way around this, I’d love to hear about it.

Return top