Gillianic Tendencies Rotating Header Image

September, 2008:

Magical DBA powers

I thought I’d mention the sort of database-related work I’ve done on contract, in case any of you might be needing some help, or just so you can be awed by my mad skills. I haven’t done a lot of contract work, but there are a lot of blogs and CMS’s out in the world, and sometimes things go wrong.

I just did some work for my friend Kimli, partially because it seemed like a good challenge, but mostly because she was trying to manually type in 2449 blog entries (omfg! 2449!) from a Windows-based blogging software she’d used from 2001 to 2006 into WordPress. This is the sort of thing that makes me weep: why do anything tedious by hand that you can automate? I demanded that she stop and send me her backup file of blog posts, which turned out to be a “CSV” (comma-separated values) file with entries similar to this:

219, “It was a dark and stormy night. The captain of the ship yelled, “”Tell me a story!”" and the story goes like this:
It was a dark and stormy night. The captain of the ship yelled…”, “A silly recursive joke”, 2001-11-01 10:54:33

This is why I double-quoted CSV: this ain’t no proper CSV, because an entry can span more than one line. Not to mention, all the “” within the post text are not going to make MySQL happy when it reads it, since double-quotes are supposed to determine the start and end of the field.

There was also a Windows-to-not-Windows text issue, where some posts had content like so:

On tonightís menu: chicken strips with a sweet yet zesty red chili sauce, sautÈed garlic mushroom caps, roasted potatoes.

The “í” here is supposed to be a ‘ (single-quote), but instead it’s some weird-looking i. And that “È” should be an “é”, and that’s not just a case issue since the accent’s pointing the wrong way. This problem was everywhere, because Kimli seems to like using French words a lot. Damn her and her hoity-toity vocabulary. Unfortunately, the dos2unix utility did not help me here, and I’ve dealt with this problem before.

So, by the wonders of regular expressions (Everybody stand back!) I fixed all of this: all the in-the-middle-of-the-post line breaks became <br />, all the “” became \”, and all the improper characters were mapped back to what they were supposed to be (which required the most time at all, since I had to google what a “Caga TiÛ” might possibly be if it were spelled correctly). There were some other issues, too, but these were most of them.

So I ended up with a file that looked something like this:

219, “It was a dark and stormy night. The captain of the ship yelled, \”Tell me a story!\” and the story goes like this: <br />It was a dark and stormy night. The captain of the ship yelled…”, “A silly recursive joke”, 2001-11-01 10:54:33

Now I had to map these values to blog entries in the WordPress database schema. Time passes. Once I got that figured out, the command I ran to import them into the database was this:

load data infile "fixedbackupfile.csv" into table wp_posts
fields terminated by ","
optionally enclosed by "\""
escaped by "\\"
lines terminated by '\n'
ignore 1 lines
(@var1, post_content, post_title, post_date)
set post_excerpt = left(100, post_content), post_author = 1;

What this all means is irrelevant; doesn’t it look complicated? There was some other stuff to be done to make WordPress work right with the new data, and add categories based on the post year, but it wasn’t much. And what you have is delicious juice dot archives, as Kimli wanted.

Now, none of this is brilliant (though if you want to be impressed, feel free), but it’s the sort of work that requires DBA or coder skills plus a good knowledge of MySQL. And I set up a testing environment to do all this in before pushing it live (woo, look at me, my own home testing environment). And I’ve certainly had more difficult tasks in my full-time work, but they’re even more boring to read about, believe me.

So this is one of the things DBAs work on. It’s often referred to as magical (Kimli agrees). A friend jokes that I need a “DBA hat”, which he insists is like a wizard hat, but Harry Potter doesn’t wear his anymore (I guess because it doesn’t look cool) so I don’t see why I have to.

DBA without a D

It’s been 4 weeks. It’s been great, actually. For the most part. As ridiculous as this may sound, I feel as if I’m having a life-changing experience, because I’ve been working so hard for so long that I didn’t think I was capable of stopping. And actually, I can’t stop; not really. I’ve been doing database work for fun, because I miss it. Yeah, I know I’m weird.

I started sending out resumes this week, though just a couple. It was a bit depressing to see so few ads for database administrators and practically nothing for MySQL DBAs, except in Ontario. So I’m applying to Ontario.

I was also applying for software developer positions, since that’s what I started doing before I fell in love with tables and queries, and I can do it, though it’s not my forte. And there were more job ads for coders in Vancouver, but not a lot (damn economy). I got a request for an interview from one company, reread their job ad and realized that it was a junior position for someone just out of university. Um, no. No no no. I’m not that sad.

A friend suggested I apply to his company, and there was a coder job that I’d be perfect for, involving Java development and reporting and some other stuff. The sort of ad where you read the list of required skills and go check check check. And I was interested in applying because the company is good, until I started feeling really sad. Like I was losing something.

It turns out I really just want to be a DBA. Or a DBA/coder combination of awesomeness, but still a DBA. As bad as the job market is, I’m not ready to give that up yet for the sake of money. I never knew how much it meant to me until now. And I didn’t realize how it had become part of my self-image. Though I’m glad there’s more to me than that, because I see eyes glaze over whenever I talk about my work.

So I guess in the meantime I’ll continue to do personal projects and study and learn. People keep saying that something will come up, so I’m trying not to worry and I’m trying to enjoy this rare time to relax and reflect. And that, for me, is work.

Some sort of weather goddess

At the beginning of Douglas Adams’ So Long and Thanks For All The Fish is a lorry (truck) driver who’s rather miserable because wherever he is, it’s always raining. This is because he is a Rain God, though he doesn’t know it, and he’s followed around by clouds who worship him.

Some of us who have read the book have undoubtedly hypothesized that had his divine status been known, the man could have been hired to bring rain to drought-ridden areas and do good in the world. Or at least make tons of money.

This book character was brought up in conversation when I mentioned my potentially godly talent: producing nice weather while unemployed.

If you can find old weather records, check out mid-February through mid-March 2005. It was unseasonably warm and sunny, and if you don’t believe me, here were the Burrard Station cherry trees on March 15 of that year:

Through the window

This year they blossomed when, May? At least two months later, anyways. While I was working full time, you’ll note.

In late August people were complaining that it had been a crappy summer and that the weather was already turning to fall, and then I was let go. And then came nearly 3 weeks of warmth and sunshine. See? It’s all thanks to me!

The fact that it’s pissing down with rain now and was frightfully cold last night must be because I am looking for work now. If you call sending out one resume looking for work. It’s not not looking for work, surely. Sorry about that, by the way.

It has been suggested numerous times, when this superpower of mine has been mentioned, that people should pay me to not work for the sake of the weather. I could get in with Vancouver’s tourism board. By not working, I could turn this city’s image around and make it a sunny paradise. Maybe they could have me work just for an evening here and there to get the crops watered but not disrupt daytime outdoor events.

Of course, being paid to not work is rather contradictory, because surely it’s work if you’re paid to do something, even if it is to do nothing. Like some union jobs. So I’m not sure if this is logically feasible, though it’s worth a shot. Anyone want to try it out?

Update: I just remembered that the one true vacation trip I’ve had since university had me in New York in mid-October where it was over 20C most days. So obviously the nice weather powers follow me.

Stave Lake

Missing life lesson

I’ve brought this little anecdote up in conversation a few times this week which means I should share it with you since it’s kind of embarrassing. I don’t see the point in ever publishing anything here that doesn’t make me look at least somewhat silly because I’d hate to be accused of untruthful personal portrayal.

The situation in retrospect is one where you just wouldn’t know what to do because it doesn’t happen much in life, if at all. If it does come up enough that you don’t hesitate in your emergency procedures because you’ve dealt with it multiple times, then you might want to reevaluate your diet. Or fix the plumbing.

I was out with a friend last week, drinking at a pub and chatting about life, as one does. When we’d drunk up and paid up my friend wanted to use the bathroom before leaving, so we went to the basement where the gender-segregated toilets were kept. Upon entering, we noticed that there was some water on the floor; but it seemed clear so we proceeded to use the facilities by attempting to tiptoe around the puddles as much as possible.

I don’t wish to tell you too much detail but I only did Number 1. This is necessary for me to point out so that I show that what happened next wasn’t entirely my fault.

I did my thing, sat up and turned around to notice that the water was rather high in the toilet. Not to the top, certainly with room to spare, and not enough for me to have noticed before sitting down. I only paid attention in this case because I was pondering the reason for the lack of dry floor surrounding the stalls as I was sitting there relieving myself.

At this point I will admit a certain level of blame, since I mentioned the toilet water level to my friend and declared my intent to flush the toilet despite being aware of the danger in doing so. And that I was going to pull the flush tab and immediately jump back, just in case. I could, of course, have decided against doing any of this, but perhaps I was feeling adventurous. And normally, when one flushes, whatever’s in there gets sucked under and is replaced by fresh water in a dull yet satisfactory way.

Unfortunately, not this time. Instead, water was added to the toilet bowl in a rather fast manner and the now quite dilute but still gross on principle urine-laced contents were pouring onto the floor. At this time my friend had walked away from the stalls but another woman, who must’ve really needed to pee since she had to walk around my form and step through the flood to get to the next toilet as I was saying “oh God, it’s overflowing!” Deciding that there was nothing I could do to help the situation, I ran out. Without washing my hands, but I figured the alternative of having my pee all over my shoes was potentially less hygienic in comparison.

I immediately told a waitress about the overflowing toilet. She glared at me, and I wanted to iterate that I wasn’t the one to plug it, but I decided to take the blame in her mind because I was beginning to worry that the basement might now be completely flooded and my friend (who decided to wash her hands) was still down there, and arguing fault wasn’t going to save her life. Luckily she came up a minute later, mostly dry.

The life lesson here may be “don’t flush if you’re unsure” but I remember that I wasn’t even sure what to do after I did flush the toilet. What do you say to get people to quickly evacuate the bathroom? All I can think of now is “ABANDON SHIP!”. I must watch too many movies.

Friday Cat Blogging: Ninja Cat

I felt it was important to show the Ninja Cat Youtube video, for all two of you who haven’t seen it yet:

Thanks to the rest of the internet who all sent me emails and messages linking to this. I wish my cat has stealth skills, though there’d be no reason for them.

My cat has developed one skill of late, maybe because I’m home more often: the jump-on-the-hooman-until-she-feeds-me skill. She used to just starve until I got up in the morning or noticed she was half dead. But no more. Now I get the wake-up call of feline hunger a la Simon’s Cat. It’s annoying, but at the same time, up until now I thought my cat was weird for not doing this. It’s just a matter of time before she learns that she’s supposed to move to carpet or upholstery when starting to vomit, rather than to an easily-cleanable surface which has always been her method. Nobody tell her she’s doin’ it wrong.

On my short-lived modeling career

I was teased the other day that I was wanting to get my picture in as many books as possible. I had no good retort for that, since it’s true. I was happy to sign the form to appear in Blogging for Dummies some months ago. Maybe I feel that my name and/or visage inside a published volume gives my life legitimacy. Or maybe it just strokes the ego so slowly and gently, the way I like.

A few weeks ago I got offered the chance to show up in a book again, so I was all “hells yeah” and showed up on Saturday morning to a friend’s place to play model for a book on knitting graffiti called Yarnbombing. The book, as I’ve been told, is a how-to guide to create and deploy knitting (and crochet) onto public places, such as telephone poles, railings, and fences. There’s something especially subversive about the combination of the wholesomeness of yarn crafts and the criminality of graffiti, don’t you think?

A group of us spent the day going around the South Granville area taking photos of the act of attaching the knitting to various public structures, among other yarn-related activities involving needles and hooks. I played one of the textile delinquents in several shots, and learned something about myself I’m very ashamed to admit: Modeling is hard.

I always thought those chicks on America’s Next Top Model were particularly stupid, not just for whoring themselves on international television but because many of them looked like dorks during the photo shoots, unable to do what is asked of them by the photographer and tripping over themselves. So I spent a good portion of Saturday hearing this voice-over repeat how “Gillian can’t take direction” and imagining that I’m no longer in the running to become ANTM. So sad.

Nah, it’s just really funny how I seemed to lose IQ points with a camera pointing at me. Like, I couldn’t distinguish left and right, at all. Normally that’s not an issue because as a lefty I know what makes me Different from everyone else.

The photo shoot was fun, and I’ll be curious to see what’s used in the book when it comes out next year. The opportunity was taken numerous times to refer to two of us “working the pole” as we pretended to hang knitting on a lamp post. There were also many shots taken of me from behind (walking away from the camera, carrying some knitting), which says much of the photographer, who managed to find my best side. In retrospect I should’ve worn tighter jeans.

Mystery t-shirt

Mystery t-shirt Since I’m not working I’ve been taking the opportunity to not get dressed until absolutely necessary, which is fine until you get Fedex arriving at your door and you suddenly have to find some pants. I’m not sure I’ve ever answered the door to unexpected delivery people in proper attire, but sadly I’m never in lingerie either. Though I’m sure that would’ve been lost on the young lady this morning.

So I got this t-shirt in that Fedex package. My cat Shebang was nice enough to model it here, though it doesn’t fit her well; a better version is here in the product page from Busted Tees. Rather superhero-like, I’d say: a red shirt with a gold lightning-bolt on the front. I’m assuming it’s in reference to my Underwear Affair team for 3 years, The Thunder Panties, but that’s just a guess.

I wonder who it’s from. Does anyone here want to own up?

Fate has it that I won’t run out of t-shirts anytime soon; Shan gave me a Threadless shirt yesterday that she’d meant for someone else. I wonder what shirt I’ll get tomorrow, and from whom.