Skip to content
Archive of posts filed under the General category.

Photo 219: Parent reward?

Send child away for a trip with grandparents, get fudge when she returns.

Photo 42: Send help now

Yes, its male

Playing with posterous and proving I have the humor level of a fifth grader.

This is an example of…

This is an example of blogging using Jott. I’ve plan the showbiz at the session on Monday. listen

Powered by Jott

Unnatural love

Unnatural Love

Behold the unnatural love between a gnome and a turtle.  Saw this in Walgreen and just had to take a picture.  Probably due to the influence of the Gnome meme happening on the Slice of SciFi voice mail show.

Behold my stacking powers…

Heather took this back in May with her Blackberry.  I keep forgetting to post it.

Small fix for WordPress XML-RPC

I had the idea that I might photo blog more if there was an easy way to get photos off my iPhone and into a blog post.  The easiest way would be to e-mail the photo someplace for WordPress to get it.  Unfortunately, most of the e-mail to blog post plugins (and the built-in stuff) just sucks for my need.

I decided to look at the XML-RPC API to see if I could get it done that way, and then write a script to be called out of procmail to create the mail.  There is a function there that will do what I want, wp.uploadFile aka metaWeblog.newMediaObject.  The specification for that call says that the file being uploaded must be Base64 encoded.  No problem, a few line of ruby later and I have everything ready to test an upload.  The file goes up, but its unviewable in a browser.  A quick check of the file on the server and its revealed to be a text file filled with Baes64 looking data.  Somewhere along the line it wasn’t being decoded.

After about an hour of screwing around, I determined it wasn’t anything obvious in my code, so I thought I’d look at the code for WordPress 2.5.1 to see if I missed anything obvious.  In reading their code, I found that the WordPress folks forgot something obvious, their code never Base64 decodes it before it writes it to a file.  A quick one-line change later, and *boom* I’m off.

Here’s the patch in case its useful to anyone else. I’ll have the script up when I’m done with it.

(Also, in a small bit of embarrassment, I must admit fixing this took me 10 minutes longer than it should because I forgot ; is end of statement in PHP.)

Index: xmlrpc.php
===================================================================
--- xmlrpc.php  (revision 7840)
+++ xmlrpc.php  (working copy)
@@ -1880,6 +1880,10 @@
                        $name = "wpid{$old_file->ID}-{$filename}";
                }
 
+                # The specification says that this is base64 encoded,
+                # we should really decode it.
+                $bits = base64_decode($bits);
+
                $upload = wp_upload_bits($name, $type, $bits);
                if ( ! empty($upload['error']) ) {
                        $errorString = sprintf(__('Could not write file %1$s (%2$s)'), $name, $upload['error']);

Thank you, drive thru…

We got a couple Flip Video cameras in at work. We plan to use them to get some stuff for the web and various other things. One thing we’ll do sometime this week is write a review. That being said, Chris took one home to play with to get a feel for them, and caught this moment of awesomeness.

4 more years! 4 more years!

Dinah is 4 years old today. She’s lived her toughest year to date having to adjust to a younger sibling who’s become mobile and takes her stuff now. Here’s a picture from her princess makeover and photo shoot at Disney World.


Yes, hopefully its a lot more than 4 more years, but the title brings the funny to me.

New panic in the streets!

I read this in the dead tree edition of the Tribune yesterday and forgot to make a post bitching about it. Luckily, Chicagoist was there: Congressman Says Second Life Could Expose Kids To Porn, Predators.

Basically, Mark Kirk got his panties all up in a bunch because Second Life have some adult stuff going on and in his opionin its too easy for minors to get into that area. While I understand his concern, I disagree that the government should be stepping in here, even with something as minor as an FTP consumer alert. Parents should be monitoring what their children are doing on-line. If you can’t take the time and/or education commitment to do that as a parent, disable your internet access.

The part that really chaps my hide is the following (quoted from the Tribune):

Kirk said he knew of no cases in which children were targeted by sexual predators on Second Life, but he said he considers the virtual world an emerging danger.

So…there’s been no reported problems, or at least none visible to him, but OH MY GOD! RAISE THE ALARM BELLS!  THE CHILDRENS!  WON’T SOMEONE THINKS OF THEM??!?!?!!!  I hate election year fear-based  attention-getting pandering.

For the record, I have no particular love for Second Live either.  I’ve played with it a bit but I don’t get all the hype around it.  I must just be getting old.