September 25th, 2007

Ported my old geek blog’s theme to Wordpress

If you read this blog on the web, you may have noticed that the whole site looks different. I’ve never been too fond of the default Wordpress theme, and didn’t like any of the other Wordpress themes that I’ve seen, enough to use them.

I did always like the theme I had on my old Blogger geek blog, but that theme was not available for Wordpress. The theme is called “Rounders 3″, originally designed by Douglas Bowman.

So, I hacked apart a page from my old geek blog, and did some reading about Wordpress theme development (see links section below), and worked on building a Wordpress theme based my old geek blog’s theme. Today, I decided to go ahead and switch this blog to use that newly-ported theme.

Here are two screenshots, for comparison:
spugbrap’s blog (old theme - default wordpress) [small]spugbrap’s blog (new theme - ported from Blogger to Wordpress) [small]

Useful Links:
Theme Development « WordPress Codex
How-To: Create a Wordpress Theme in 5 minutes

Feedback:
What do you think of the new look? Please feel free to leave a reply, below! Also, if you run across any broken links, unreadable fonts, missing images, alignment problems, etc., please let me know. Thanks!

September 14th, 2007

Regular expressions for converting code-indentation spaces to tabs in TextPad

I’ve never been a fan of using tabs to indent my code; I prefer spaces. Writing code is an art form, and when you use tabs to indent, you can’t assume that it will still look pretty on someone else’s machine, or in another application, etc., since tab sizes are platform-dependent and–although usually user-definable–the default size (typically 8 spaces, I think) tends to be much larger than my own 2-4 space indentation style.

However, some of my co-workers indent with tabs, and others indent with spaces. I’ve found that it’s easier for me to avoid inadvertently messing up existing code when I just bite the bullet and use tabs.

So, what follows are a couple of search/replace regular expressions I’ve recently used in TextPad, to make some existing code more consistent, by converting the spaces to tabs in certain relevant locations.


1. Regular expressions for aligning inline comments with tabs

Find what:   \;( *) {2}(\t*)\/\/
 
Replace with:   \;\1\t\2//

Customization: The number 2, in curly braces (above), should be replaced with the number of spaces that are used for indentation, in the code you’re running this on. In this case, the code was indented in increments of 2 spaces. Sometimes I deal with code that’s indented in increments of 4 spaces, in which case that 2 would change to a 4.

Manner of execution: Run via Replace All, repeatedly, until there are no more matches.

Recommended scope: I used it on a very specific block of selected code. Keep reading for the specific format.

When I used this on a block of code that consisted of variable declarations and //-style comments, it ended up making the comment blocks all line up nicely. Here is an animated GIF1 of a series of screenshots, showing how repeatedly running this expression transformed the comments into tab-indented comments that lined up nicely:

animated progression of screenshots showing comments separated from code with spaces, and eventually just tabs (and all lined up nicely)

I’m not sure how useful this will be, in general, because I think I just kind of lucked out when I got the results that I did. I thought it was worth sharing, though, because it impressed me when it produced results that were better than I had actually envisioned. :)

Two important things to note are:

  • The actual variable declarations (beginning of each line) were already indented with 1 tab.
  • There were a consistent number of spaces between the semicolons ending the variable declarations, and the double slashes starting the comments. While this didn’t help them line up, as spaces, it did make things pretty when the spaces were replaced with tabs.

If you’d like, you can see what my TextPad Replace dialog looked like, so you can see things like which checkboxes are checked, etc. Also, please note that in my TextPad preferences, I have it set to Use POSIX regular expression syntax (as previously mentioned, in another TextPad search/replace expression entry, a couple years ago).


2. Regular expressions for changing leading indentation spaces to tabs

Find what:   ^(\t*) {4}
 
Replace with:   \1\t

Customization: As with the first expression, above, the number in curly braces should be changed to the spacing increment used for indentation, in the code you’re running this on.

Manner of execution: Run via Replace All, repeatedly, until there are no more matches.

Recommended scope: It can be used on a block of selected text, the entire active document, or even on all open documents, if you’re brave and somewhat evil. :)


Footnotes

1 Sorry for using an animated GIF. I’d rather not have something constantly flashing on the page, because it distracts, and resembles an advertisement. I would have preferred another solution, but I racked my brain for over two hours, trying to decide how to present this series of 9 screenshots. I didn’t want to alienate readers who might read this using a feed reader that doesn’t support javascript, and I hate making people click through from the feed to the main site–I strongly prefer full-text rss feeds! Laying the 9 images out horizontally or vertically took up either too much space, or required making the images too tiny to read. In the end, this animated GIF seemed like the best portable way to show the effect I was trying to show. I won’t make a habit of using them, though. :)

[return to top] / [expression 1] / [expression 2]

July 2nd, 2007

Twelve 7-Eleven stores become Kwik-E-Marts

Regular 7-Eleven store plus sign Cartoon Kwik-E-Mart equals sign 7-Eleven turned into Kwik-E-Mart

From an article on msn tv news (and every other AP affiliate):

Over the weekend, 7-Eleven Inc. turned a dozen stores into Kwik-E-Marts, the fictional convenience stores of “The Simpsons” fame, in the latest example of marketers making life imitate art.

Those stores and most of the 6,000-plus other 7-Elevens in North America will sell items that until now existed only on television: Buzz Cola, KrustyO’s cereal and Squishees, the slushy drink knockoff of Slurpees.

What an awesome promotion! I just wish more stores were getting the temporary face lifts. But I vow to attempt to visit the closest one (in Bladensburg, MD) sometime this month. To see tons of pictures of the real-life Kwik-E-Marts, check out the Simpsons Movie Kwik-E-Mart Mirror.

There’s also a sweepstakes going on, with the grand prize winner getting to be animated in an upcoming Simpsons episode.

April 14th, 2007

How Bank of America also ruined my Merrill Lynch Platinum Plus Visa

About 3 years ago, I got a new credit card called the Merrill Lynch Platinum Plus Visa. The card came with a nice, big credit limit, and had a fixed interest rate of 5.9% for purchases, balance transfers, and even cash advances. I’d never seen a rate so low for cash advances. I did not plan to do any cash advances, but it was still nice to know that I could, without suffering a typical 17-27% cash advance interest rate.

Anyways, this card happened to be managed by MBNA. I used the card for all my credit purchases, and it was my favorite card for a while. Then, in February of 2006, there was notice in with my statement, which said that they were changing my terms, due to a “change in [their] business practices”. These changes included making the interest rate for everything variable, which came out to 8.9% at that time. I was carrying a balance of over $13,000 on it at that time, so I was not looking forward to this rate increase.

In fact, I was so pissed off about it that I did what it said in the small print on the notice: I sent them a written letter, refusing the new terms. This meant that I could keep the existing interest rate, until I paid off the balance, but if I made any purchases on the card, it would automatically constitute acceptance of the new terms. So, I went through and switched everything that was linked to that card (SmartTag toll transponder, automatic monthly payment for Hwar Do lessons, and a few other recurring payments) to a different card.

Well, two weeks later, I received a notice from MBNA talking about how their merger with Bank of America had completed in January, after having been given the green light by the FTC in December. So, I’m pretty sure this merger is the change in business practices they were talking about. They sure didn’t waste any time making unfavorable changes to their terms!

So, my MBNA card was to be come a BoA card, slowly over the course of the year — the same way my Fleet card became a BoA card the previous year. We put the cards away and did not use them for 3 months straight. They still raised my limit a couple times during those months, and kept sending me promos/convenience checks, in the hopes that I’d suddenly have a need for thousands of dollars and that the promo checks (with 5.9% rate — same as the fixed rate my whole account had since opening it) would make me forget about the fact that I’d have to accept all their terms if I use them.

Anyways, I thought I’d changed all my recurring payments to use a different card, but apparently I missed one. :( The University of Phoenix billed me for a $70 “resource fee”. This is a fee that you have to pay for every class you take, and if you don’t pay it manually by a certain date, they auto-charge it. You’re supposed to pay it by the date the class starts, but I’ve always (for about 3 years before) paid it after the class ended, along with my tuition payment. They’ve never auto-billed me for it so early. Yes, technically they did what their rules say that they do, but it really irked me that they’d never done that to me before, and had to chose this particular time to start.

I tried and tried to get ahold of anyone in the finance/billing department at UOP, but could not reach anybody. I left voicemails for several people, and sent them emails as well, but nobody called me back or replied to the email. Actually, one person did call me back, about 3 weeks later.

So, I automatically accepted BoA’s new terms. I eventually accepted that at least 8.9% was still better than the rates on any of my other cards, which had both suffered from merger-induced terms changing (the previously mentioned fleet card, and a chase card). Thankfully, the rate has not gone up any more since that one time, while my other cards have continued getting worse.

I think it’s time to shop around and find a new card, though, from a bank other than Bank of America or Chase, so I can just cancel both of my damn BoA cards. I’ll probably switch my checking and savings accounts to another bank while I’m at it, since BoA has just done one thing after another to make my existing credit cards suck.

April 11th, 2007

How Bank of America ruined my Fleet MasterCard

This rant has been a long time coming, but a post on the Consumerist blog today, entitled “BoA Buys MBNA, Starts Charging Customers Extra For Not Paying Balances Off In Full“, inspired me to write it up. Forgive me if the timing of some of these events is a little bit off, but the overall gist of it is the same, regardless of some of the details.

I opened checking and savings accounts at Bank of America about 3 years ago, because Wachovia royally screwed me over in my first overdraft situation ever. I shopped around for a new bank for a while, particularly soliciting word-of-mouth advice from friends and coworkers. I was impressed with BoA’s online banking, in which check card transactions appeared on the website instantly. This was much better than Wachovia’s, where it sometimes took *days* for a charge to appear on the website, even in a “pending” state.

Well, it wasn’t long before BoA bought Fleet. This seemed like a good thing to me, because my Fleet credit card (my primary credit card, which I’d held for longer than any other cards) suffered from a more painfully slow charge-to-website time than Wachovia’s check card. With my Fleet card, my charges would sometimes take 7-14 DAYS to appear online, even in a pending state. Unacceptable. But I kept using the card, because of the positive impact it had on my credit rating (the many years the account had been open, and because of the fixed 7.99% interest rate).

Actually, I should point out that at some point prior to the BoA-Fleet announcement, my Fleet card suddenly changed its terms, instituting a variable interest rate which was, at that time, around 13.5%. I called their Customer Service and complained about this, and they lowered my rate down to a lower variable rate, around 7.4% or so. At some point, a year or two later, I received notice about a class-action lawsuit against Fleet, regarding the changing of fixed rates into variable rates (not very “fixed” if they can change it whenever they want to). Although technically they may have been allowed to change it, it still wasn’t very nice, and they ended up settling the suit. A while later, I got over $100 back on my Fleet card in two settlement-related deposits. That was cool.

Anyways… After BoA bought Fleet, they immediately changed the terms of the card, making the interest rate go back up to something-teen-point-something. Ugh. A year or so later, BoA finally assimilated the Fleet card into its online banking system, though, and it did, in fact, speed up the charge-to-website time. It also gave me back a feature that the Fleet website had taken away at some point — the ability to download transactions from the currently open billing period into my personal financial software (MS Money, the subject of another rant!). That was nice. It also allowed me to now make payments to the Fleet card (now a BoA card) much faster, and I could even do instant cash advances from the card, in the event of an emergency, directly into my checking account. This came in handy a couple times. Yes, the fees are horrible for that, but still better than dealing with overdraft/NSF hell!

Over time, BoA has changed the terms even more, making the variable interest rate even higher (currently 17.24% for purchases, 24.24% for cash advances), raising balance transfer fees, late fees, and generally making every other rate/fee higher as well.

I’ve kept the card, though, because it’s now pushing me close to the 10-year mark, which should look good on my credit report. Oh, and one other positive thing in all of this… When I got this Fleet card, it was called the “Winners Edge MasterCard”. Every time you used the card, there was a slight chance that you could win a prize of getting that charge paid for. I won a couple times over the first couple years, with charges in the $5-20 range (of course it was never any of the $500-5000 charges!). At some point, the card quietly stopped offering that reward. Boo! Hiss! But when BoA took over the card, they renamed to to “Power Rewards MasterCard” and I started accumulating points-per-dollar-spent. That has continued, and that’s better than no rewards.

Anyways.. That’s [more than] enough for this rant. Next one will be about how BoA has destroyed my Merrill Lynch Platinum Plus Visa.