Life, climbing, work, expenses

My photo journal has been updated to bring it up to today.
After the holidays, life has returned to its usual habit of climbing on Tuesday, board games on Thursday, and climbing (plus food) on Friday. It’s a nice routine, and it means I get out of the house, so that’s good.
Climbing and gaming photos from January have also made it up at photos.

Traverse party!

I made a bad thing at work. During some refactoring for a feature I built for the last release, I apparently failed to notice that the class I was pulling code out of was a singleton, so I added instance variables in the base class. The feature in question was a login feature, so the end result was a concurrency bug where users could get logged in as other users.
Oops.
Lesson learned: Singletons are dangerous. Be careful when using them and probably avoid them for things that don’t want state to be shared (like a global whitelist or something), even if they don’t currently have any state.

I’ve belatedly crunched all my expenses from the past year. As expected, 2014 is the year that breaks my spending trend: I spent $11,664.02 in 2011, $12,356.83 in 2012, $13,698.12 in 2013, and $15,821.38 in 2014 (not including wedding expenses).
The responsibility for this lies almost entirely in food expenditures, up around $1,200 from $3,804.70 to $5,081.34 (or a monthly average of $317.06 to $423.45). I guess I’ve been eating out a lot more or something this past year.
Everything else has remained fairly flat, including my $50/month discretionary budget, which hasn’t changed since 2004. Which is surprising given the four weddings we attended in 2014 (travel expenditures of $1,390.13 in 2013 versus $1,787.94 in 2014).
My share of the wedding expenses so far (save the dates, invitations, deposits, scheduled payments) total $2,953.74, which ultimately puts 2014 expenditures at $18,775.12. Not so bad. That’s still under what I was spending in SF (with an average rent and utilities of $1,200 to $1,600 compared to the current $450 to $500), even though monthly food expenditures have more than doubled since then.

Wedding plans continue. The next big thing, I think, is the honeymoon. We’re currently planning a UK and France trip for that, which should be a lot of fun, but argh long plane flights. Hooray for things?

Automation, cards, yay

life has gotten an update that brings it up to present day. Yay life.

I’ve also posted Tartan photos at photos.

While I was batching photos today, it occurred to me that I should learn how to write Photoshop scripts to do the watermarking and resizing for me. (Previously I had been using the standard Image Processor to resize, then watermarking manually.)
The result is this script that opens the watermark files, then resizes and watermarks all jpg images in the selected directory.
Yay scripts. Maybe someone will find it useful.

In non-scripty-Photoshopy news, I’ve been working a bit on cards for the next People Wars expansion, Celebrations.


I mostly just like this image. Josh is over 6’5″ and Jen is shorter than 5′, and it’s amusing to see them together. (Yes, they’re both standing up. Here’s what happens when he kneels.)

Their individual cards are also interesting because of the effects I gave them.

I think it’ll be interesting to see how these work out in the game.

Yay things.

Photoshop Album Hackery

In the last episode of “Alan Does Sketchy Things,” we updated post formats in a WordPress 3.2 installation.
Today, we bring you “Mass moving photos in a Photoshop Elements 5.0 organizer album.”

So Photoshop Elements organizer does have a built-in “Reconnect Missing Files” tool. However, this tool is super slow and clunky, and can only update one folder of photos at a time. In my case, I wanted to move well over 100 folders of photos, which amounted to over 100,000 individual files. Doing this through the reconnect files tool would have been way too slow. (It is also prone to causing the program to freeze, which then requires a lengthy database recovery process on next startup. Not fun.)

Fortunately for us, the photo album file (Catalog.psa) is nothing more than a Microsoft Access database. Even though the extension isn’t right, Access can still open the file without any problems.

So do that, and we see a few tables. There’s only one relevant to us: ImageTable. Open this up and you’ll see a list of every image in the catalog. There are two columns in this table that store the path to the file: fImageOriginalFilePath and fMediaFullPath.

Fixing them is as easy as doing a find-replace (which you can access via Ctrl-F). We’ll do each of the two columns separately.
Enter the old file path (for example, G:\0_Galleries2\), replace with the new file path (for example, G:\0_Galleries\), look in the fImageOriginalFilePath column only, and set match to “Any Part of Field”. Replace, and you should be set. Repeat for the fMediaFullPath column.

In my case, I had way too many rows in the table (277072 rows). This causes occasional “You can’t replace the current value of the field with the replacement text.” errors. Fortunately, retrying seems to work fine. It took me about 25 search and replace operations per column to fix up all of the relevant rows.

Once you’re done, save and open the album back up in Photoshop Organizer. I asked it to reconnect all missing files just to make sure things looked good, and then opened a few of the moved files to make sure it was properly detecting them.

Done!

WordPress post format hackery

So I’m in the process of converting Randomjunk over to a WordPress blog, since it seems the main thing I use it for nowadays is quotes (which used to be stored way down under my AIM subprofile that no one uses anymore).

After several hundred posts, I noticed that there was an option for post format, one of which was the “Quotes” type. Unfortunately, WordPress 3.2 mass edit does not include a way to mass update post formats. Therefore, to the SQL.

All of the posts I wanted to convert already had a tag called “Quotes”. Looking in the database in the wp_terms table told me the number of this tag.
SELECT term_id FROM `wp_terms` WHERE name='Quotes';
This ended up being 9.

I also got the term id for the post format I wanted.
SELECT term_id FROM `wp_terms` WHERE name='post-format-quote';
This ended up being 86.

Therefore, I just run this query on the relationships table:

INSERT INTO `wp_term_relationships`(object_id, term_taxonomy_id, term_order) SELECT object_id, 86, 0 FROM `wp_term_relationships` WHERE term_taxonomy_id=9;

I also needed to fix up the term_taxonomy table
SELECT count(1) FROM `wp_term_relationships` WHERE term_taxonomy_id=86;
gave me 337 rows, so
UPDATE `wp_term_taxonomy` SET count=337 WHERE term_taxonomy_id=86;

Done. Yay.

Blackberry complaints

The more I use consumer electronics, the more it’s clear to me why Apple is so successful. Their stuff just works, and it mostly works the way you expect it to (and without getting in your way like most intro-level Adobe products do).

Case in point… I have an email in Gmail from Groupon saying that I can get a $5 credit if I make a purchase from my mobile device, and helpfully providing links to places to download. Okay, great… I load Gmail on my Blackberry, and see that the links in the email are not rendered as links. They are plain <a href=""> tags. Every browser can render links. WTF, Blackberry.

Fine, whatever. I email myself the link as plain text so I can click it. Doing so brings me to this page, which is Blackberry’s official App World. See that “Download” button? Yeah, I didn’t. The Blackberry browser does not render that button. None of the four browser options render that button. (And, if you view source, you can see why… it’s not a button at all but a bunch of styled divs. WTF again.) And why are there four browser options? Should an end user have to know the difference between “Hotspot Browser” and “BlackBerry Browser” and “Internet Browser”? Does anyone actually know the difference?

Fine, whatever. I have the official Blackberry App World application installed on my phone. Let’s do that instead. Go in, search… and no results. There are no results for the Groupon application I am staring at on my laptop browser. I search for a bit in the various views and can’t find it. So I give up and try to close the application. Which proceeds to freeze and crash the phone. The official App World application. And this isn’t the first time it’s done this either.

This is, of course, in addition to other problems I’ve been having, such as buttons that can’t be clicked in the Blackberry Browser (plain HTML input buttons too), the generally unintuitive UI, the “Emergency Call” option being helpfully located right under “Unlock Phone” where you will hit it almost every time you try to unlock your phone, and the selection defaulting on the “Lock” option after you unlock where lag between popup notifications (such as for meeting invites) *will* cause you to hit the “Lock” button again. (And don’t even get me started on some of the issues I’ve had to deal with at work related to the Blackberry browser.)

So yeah. As much as I love having a physical keyboard, if I was ever going to buy my own smartphone, I will stay far, far, far away from Blackberries.

Edit: Yes, I could copy-paste the “Download” link into an email and open it in the Blackberry and hopefully get the right thing to happen, but I shouldn’t have to do that, and I’m too frustrated with the phone to want to do that now anyway. It’s one thing if third-party websites and software don’t work correctly on the phone (although I’m still extremely confused why it can’t make plain input buttons work properly), but if your first-party website and apps don’t work correctly, something is very wrong. That’s not just bad design, that’s sloppy.