Pre with line breaks

I know I am going to forget this. So I am going to write a post about this and I am hoping this process will help me remember this information.

Recently I needed to add some content to a wiki, but I didn’t want to pre-parse the data to escape any wiki or html formatting. What I wanted was the pre tag. But the pre tag will not line break the content to fit on the page. I need a pre tag with line breaks. Here is the standards based way to do this:

<pre style=”white-space: pre-wrap;”>

My sister has a tatoo

My sister decided to add a picture of her tatoo to her email signature:

I’ll ignore how this increases the minimum size of her emails. Adding this to my blog means I am committing copyright infringement. Maybe she’ll sue me. *grin*

Mini Movie Review

Nick & Norah’s Infinite Playlist

If there was an award for most considerate depiction of third base, this movie would get it.

I don’t care if Michael Cera plays the same character in every movie, I can’t get enough of him.

Writing Web Applications

The last few weeks I’ve been writing a web application. My first.
I used perl for the back-end, and HTML and Javascript for the front-end. It is far enough along that I announced it to the community it is aimed at.

http://cocomag.dyndns.org/UnderColor.shtml

I’d like to thank Robert Gault, Joel Ewy, and Darren A. for wonderful feature suggestions and bug reports.
My biggest mistake so far was not doing enough testing when I moved the app from the development machine (Max OS X) to the deployment machine (Debian). I had it in my mind to do the testing, but when everything was working so wonderfully on my development machine I decided just to release without testing everything. This caused a 12 hour period where the site was up and down and things did not look so good. But I got thru it.
Finding little differences between Linux and Mac was an interesting problem. Opendir/readdir on the Mac will return alphabetically sorted entries, on Linux it won’t. There was also a weird problem with a system() call. When calling ImageMagick’s convert program I would pass computed cropping and resizing like this:

'-crop', $width."x".$height."+".$left."+".$top, '-resize','540x700'

On Mac this would produce the a correctly cropped and scaled image, maintaining the proper aspect ratio. But on Linux the image would be stretched to exactly 540 pixels by 700 pixels. The fix was to do this instead (this works on both Mac and Linux):

'-crop', $width.'x'.$height.'+'.$left.'+'.$top, '-resize','540x700'

I really can’t explain why one would work and the other wouldn’t.

Update: I published this entry on September 7, 2008 10:42 AM, and Google did it’s first read of my project at: September 7, 2008 11:10 AM. Neat.

Packages of Two

The other day, my 10-year-old daughter comes into our bedroom and asks, “Can I have a Poptart™?”
My wife and I have the exact same response, though she said it first, “You can have one.”
This sends Megan into a fit. She wants two! Our thinking is this: Poptarts™ come in packages of two, she’ll cook two, she’ll be full after eating one, the other will be wasted. Just as my wife starts yelling back at her to calm down and use her “Quiet Voice”, something unusual happens to me. I become calm and I know exactly what to say.
“Megan, cook only one, and we’ll see how you feel afterword about the other one.”
Megan calms down, says, “OK.”
Just as she turns around I say, “And put the other Poptart™ in a bag.”
Mentioning the bag after she agreed to eat only one was important. She already accepted the deal, so the bag didn’t affect her attitude.
And this is why I’m eating the last tasty Poptart™ in the house right now.

Brick

On the last episode of The Totally Rad Show Dan Trachtenberg mentioned that Brick was a good movie and everyone should see it. His movie recommendations have always been good, so I decided to watch it. Thanks to my local video store I did just that a few days ago.

He mentioned it’s style was film noir, but with a twist. I enjoyed it a lot. As usual these days, it took me two viewings to fully understand the movie.