Archive for June, 2008
My tweets on 2008-06-22
- woke up with a bit of a stuffy nose. I hope I’m not getting sick again! That’ll be the third time this year in my second winter of the year. #
- Cleaning the apartment in preparation for hosting a women’s same-sex attracted pot luck of sorts. Hope I don’t feel out of place tonight. #
- @mistressmatisse Girls wielding 20-sided dice are the hottest kind. All those…facets…and…numbers…. ::fans self:: #
- Using del.icio.us more now due to @sanbeiji but WP’s stock RSS widget has issues with its feeds, so I’m using del.icio.us cached++ plugin. #
- I was totally going to do something. Fuck, what was it? #
- Oh noes! I am definately catching a cold again. Boo on colds, stuffy noses, and general feeling not greatness. Guess I’ll drink lots of tea. #
- Internal monologue: When I get to work, I’ll have to work on that project I hate. Why can’t I get my laptop and sit at a cafe instead? #
My tweets on 2008-06-21
- I just sent out four emails declining development job proposals that are based in New York City. I clearly need to update my résumé. #
- At a cafe in Newtown that’s got the best carrot juice I’ve had in a long time and, even better, free WiFi! Next, a bacon cheese burger! Yum! #
- There’s a tall, cute Aussie girl at the café bar wearing black boots and a sporty gray dress. This is the part where I wish I had more guts. #
- @wendyblackheart Yeah…but how do I show them that I’m intelligent by saying “Hello”? Is it in tone of voice? It’s certainly not in looks! #
- Just saw a young girl with an Acer laptop trying to explain to an older man: “It’s not a trillion gigabytes! It’s in terabytes!” OMGSOCUTE! #
- Checked out Zivity.com and obviously I’m wondering why it’s not also male models. I guess it’d need a way to filter out penis pics. :( Men…. #
- @wendyblackheart Meh. I’m just not good at random icebreakers like that…I say as I am preparing to go to a kinky dinner party. #
- Back from kinky dinner—sparked lots of vehement debate over accessibility of fetish/BDSM culture in the mainstream. My work here is done. :) #
- In the last 4 days, 4 recruiters emailed me, I worked on 4 personal projects, and been approached by 4 people for side work. Gah! Too much…. #
My tweets on 2008-06-20
- Just approved the cover design and text for my new Website Creation book. Very cool. Also very cool: MultiFirefox http://tinyurl.com/54pgk6 #
- Setting up my machine for Firefox 3. HtmlValidator extension for Firefox 3 is supposedly available now, but downloading returns 404 Error. #
- Switching btw writing PHP code and the new employee setup runbook for work-I should double check I’m not writing code that makes user accts. #
- It’s settled. I am the undefeated champion of Wii Tennis AND Wii Bowling. Boo. Yah. That’s right. Boo. Yah. :) #
- At the Stonewall Bar on Oxford Street watching drag queens perform Britney Spears. It’s amazing how fun stupid can be. #
- Heading home from a night at the bars. Holy Shit, Australians are freaking drinkers. I’m wobbly! #
My tweets on 2008-06-19
- Had a bad dream and now I’m all pissed for no good reason. Boo on bad dreams. I hope this doesn’t spoil my day. Maybe I just need breakfast. #
- Sad things: bash’s inane quoting rules and how long it takes to approve a single design template. Functionality’s been done for ages now…. #
- So hungry, but so interested in Google App Engine. The plan: Presentation at Google Sydney office, then dinner! #
- Do you think I’m biting off more than I can chew trying to learn most of Python, Google App Engine, and Google Code all at once? For a talk? #
My tweets on 2008-06-18
- @sanbeiji Boo, I just missed @stefsull since she’s headed back to the States now…sigh…sometimes it feels like I left my real life in the US. #
- @sheershir I didn’t know you were a Wikipedia contributor. I am too! Here’s mine: http://tinyurl.com/5cgalc #
- What! Firebug isnt compatible with Firefox 3? At least its CSS is better: http://tinyurl.com/yuxlbs #
- My biggest Firefox 3 questions: How good is “good” SVG support, and hey, HTML5: are you a document format or an application framework? Srsly #
- And, oh wow! A global Microformats object? How did I miss that in the beta? Very cool: http://tinyurl.com/2en2w8 #
- @lanej0 Oh, thanks. :) I’ll do that. Hi by the way. Nice to see you on Twitter. #
- Okay, for srsly, *now* I’ll go get some food for lunch. What a slow day…. I feel like I should do more but can’t seem to chase down what. #
- Woah, it’s so nice outside. Glad I was working from home even if I do end up feeling unproductive. Might go in to the office later. #
- Walking to the office. My commute’s so short that the only way to catch up on podcasts is to stroll. Now playing: Security Now! #
- Yay for WordPress’s bundled PHPMailer package. Now if only I can figure out why PHP is complaining that I can’t redeclare the SMTP class…. #
- Hooray for regular expressions and their extraordinary super powers of string inspection and manipulation! Also hooray for cheese. #
- All right. At 10:40 PM, it’s time to clock out. Heading home and then, most likely, to bed. So in the end, not an unproductive day at all. #
- On the http://SydPHP.org/ website, the number one category is “announcements” and the number two category is “beer”. I am so vindicated! #
- In bed but not sleepy. Have an early start tomorrow though, so should find a way to doze off. Looking forward to SyPy, which is not helping. #
My tweets on 2008-06-17
- Having so much trouble getting up this morning. Thankfully I can get my email from under the covers or I’d never have even opened my eyes. #
- I was totally going to do work tonight. No, really. #
- If I’d been drinking three beers a night in New York City, everyone would have branded me an alcoholic but in Sydney I’m a lightweight. Hmm. #
- Watched Office Space again. Oh, the memories. So glad my job doesn’t look like that anymore. It’s not all I want it to be yet, but soon…. #
Fix Subversion “checksum mismatch” error by editing .svn/entries file
I can’t explain why this happened because in my several-year-long history with Subversion, I’ve never experienced this issue once. However, today, I fell into the (arguably) unfortunate circumstance of running into a most disturbing error from SVN. When trying to commit my changes, SVN barfed at me and complained of a “checksum mismatch”. It looked something like this:
Transmitting file data ..svn: Commit failed (details follow): svn: Checksum mismatch for '/Users/maymay/Sites/path/to/subversion/working/copy/.svn/text-base/working-file.php.svn-base'; expected 'cde4d8fbd5c623da3a8b1a343aa7b3f4', actual: '270b2f20804a5fcdbd15eec5910f6e3f'
Of course, the path/to/subversion/working/copy bit was the path to my working copy file’s parent directory and the working-file.php was an actual file in my working directory.
I think what Subversion was trying to tell me is that its hashed copy of the working-file.php file and the copy I was asking it to commit weren’t the same. It would be nice if it would actually tell me why that happened, but it’s clearly more temperamental than that.
Anyway, to fix this issue (at least for now…?) I simply checked out a new working copy of this directory, examined the .svn/entries file from it and sure enough, found the actual checksums in there, just as Subversion reported expecting. I simply copied those expected checksums into the .svn/entries overwriting the old actual checksums and, voila, Subversion has been fooled. After that, I could commit my changes.
Step by step (because I’m sure someone, somewhere, somehow, will run into this again—if it’s not me that is!), this procedure looked like this:
- Copy the “expected” and “actual” checksums Subversion reports to you to a new text file so you can refer to them later. Note which one is the expected and which is the actual checksum.
- Go to where the problem is (that is,
cd path/to/broken-files-parent-dir/.svn) - Open the
entriesfor editing (for example,vim entries) - Search the file for the actual checksum.
- Replace it with the expected checksum. Be careful not to change any other part of the file.
- Save the file.
- Try to
svn commitagain. - Lather, rinse, and repeat for any other files Subversion barfs at you about.
I’m sure this is not an elegant or even the recommended solution to this problem. The truth is I never bothered to look up what the recommended solution is, because it seems to me that any code repository that can’t guarantee what I get out of it is the same as what I put into it isn’t a versioning system I really want to trust the “recommended” solution of, anyway.
Also known as: this is another reason why I like git better now.
My tweets on 2008-06-16
- It’s a long shot, but I might get to use the iPhone SDK for real, actual, WORK in the next few months. Spiffy! Mean time, back to PHP. Sigh. #
- I might be too optimistic, but I think I’m totally going to Scrum-ify this product backlog into extinction. Take that, overbudget projects! #
- Hilarious legacy code snippet of the day: <?php ob_start(’stupid_hack’);?> Wow…y’think someone would refactor that after 8 months, … #
- Why I love @BloodyLaughter: Me: “Why is he the hottest?” Her: “Because his torture scene is the best.” Me: <smirk> Her: “Whaaaaat?” #
- @BloodyLaughter snickered because my Orgasm Permission Machine was mean to me. At least my dreams should be “sweet” tonight. ‘Night, tweets. #
My tweets on 2008-06-15
- @essinem Thanks re: Orgasm Permission Machine. Would love your feedback. Also, which friend is that who knows me? Maybe I know them, too? #
- @BloodyLaughter Boy chose to get up. Unless you want him to double as popsicle then you must get up to have boy too! T’is for your own good! #
- New Orgasm Permission Machine feature in v1.0.1: Automatic update notification. http://tinyurl.com/58mkgd #
- What’s the point of putting service change info inside the turnstiles, Sydney mass transit people? You made me waste 2.60 for nothing. #
- Not to be derrogatory, but Rugby makes American Football look like a sissy’s game. Also wow, Rugby players are hawt! And more naked! #
- @CurvaceousDee I’ve not been much of a sports fan—I played soccer but didn’t watch it—but I think the Rugby guys might change my mind. Yum! #
- I just got a job referral from FetLife. You’d think there was a business in this web thing or something. See also http://tinyurl.com/5ju4ag #
- Oh, Monday, must you always come so soon after Sunday? And if you must, why so cold? #
Ridiculously simple JavaScript version string to object parser
In any kind of development, you often have to deal with version strings. Typically, these version strings are just a dot-separated list of numbers that represent different versions of the software. I recently had a need to compare two version numbers against one another to determine which one was newer. This is useful if, say, you’re building an application that wants to check its current version against the “latest” available version.
In JavaScript, this is thankfully pretty trivial. My solution is to just parse the version strings with a simple function and return them as objects with appropriate properties whose values are integers. Once in this form, we can compare them with simple math.
function parseVersionString (str) {
if (typeof(str) != 'string') { return false; }
var x = str.split('.');
// parse from string or default to 0 if can't parse
var maj = parseInt(x[0]) || 0;
var min = parseInt(x[1]) || 0;
var pat = parseInt(x[2]) || 0;
return {
major: maj,
minor: min,
patch: pat
}
}
Using this new object, we can now compare two versions really simply:
var running_version = parseVersionString('3.5.2');
var latest_version = parseVersionString('3.4.5');
if (running_version.major < latest_version.major) {
// A major new update is available!
} else if (running_version.minor < latest_version.minor || running_version.patch < latest_version.patch) {
// A new minor or patch update is available.
} else {
// We are running the latest version! No need to update.
}