revjim.net

January, 2004:

All the Real Girls

Nerve.com is running a feature entitled All the Real Girls. It features the work of a fashion photographer, D. Brian Nelson, whose work I admire very much. Unfortunately, this feature is available to members only. Do any of my readers have a Nerve.com membership they’d be willing to share, or would any of you be willing to download the text and images of that story and send it to me? I would really appreciate it. I’d like to view the feature but, that alone isn’t worth the $7.50.

the sky is falling

Saturday morning, Jess and I took a shower. A little while after wards, I noticed the shower head was still dripping, so I went and made sure it was turned all the way off. Yet, a bit later, I still hear dripping. Then Jess notices the water isn’t coming from our shower head. It’s coming from the ceiling above our shower.

When we first moved in, I noticed a bulge in the ceiling above the shower. We mentioned it on our move-in check-list, but the apartment complex didn’t really seem to care. It was this bulge that was dripping. We complained to the apartment complex and they sent a team to fix it within a few hours.

A man and his side-kick showed up. They cut a hole in the ceiling, pulled out the insulation, and determined the leak was coming from the bathtub in the apartment above us. They went to Home Depot to get the parts to fix it, and Jess and I left for Justin’s party. When we returned, there was a note on the bathroom counter stating that they couldn’t fix the leak and that they would be back tomorrow (Sunday) to finish the job.

Sure enough, on Sunday around noon the leader and a new team mate arrive to repair the leak. I don’t know what they were doing, in there. But it smelled like burnt plastic. After about 3 or 4 hours, they declared that the leak was fixed and that we had to wait a couple days for the sheet-rock to dry before the hole could be repaired. They said that a sheet-rock repair team would be here on Tuesday (Today) to fix the hole.

Jess and I, despite them telling us that the shower was usable, have been using the shower in the second bathroom. There’s just something very unappealing about shower underneath a giant mold infested hole in the ceiling.

Last night, Jess and I are laying in bed watching TV when suddenly it sounds as though the Niagara Falls have been redirected into our bathroom. We both spring from bed to determine what has happened. Sure enough, the people upstairs are taking a shower and I can see the water pouring from the pipes coming directly from their bathtub drain. From this vantage point, I can actually see a large section of the bottom of their tub and I have instant revelation regarding why it is we can always hear everything they are doing upstairs. The ceilings are very thin. I can tell the water is drain water, not only because it is coming from where the drain seems to be, but because it smells like soap and men’s cologne.

So, it looks like the leak isn’t fixed. I’ll call the apartment complex and tell them that there is still more work to do. But, even if they send someone out today, it’ll be at least 2 or 3 more days before the sheet-rock dries enough to have the hole repaired. And, that’s provided they actually fix the leak this time.

I’m no plumber (and I don’t think these guys are either), but it doesn’t seem like it should be that hard to repair. Get a few new pieces of PVC. Cut them to the proper length. Get that super magic purple PVC glue stuff. Pull off the old piping. Put on the new piping. Glue it. Let it dry. That should do it, right?

Have I mentioned how much I hate living here?

Inklog: HEEEEEEEEEEEEEEELP!

This is driving me crazy. I get so close to being done, and then I realize that I’m not.

I having this huge debate with myself over the way to handle a particular (very important and central) feature. But arguing with myself isn’t very productive. I need a nerd, stat.

Here’s the shortened version of the problem. There are 14,000,000 ways to do anything, I want the best one. At this point in the system, a user has requested to view an object. It doesn’t really matter what but, for fun, we’ll say it’s a page in an image gallery with all the thumbnails of the pictures on it. I’ve narrowed it down to two ways of doing it.

The first method would put most of the work in the gallery handling code. This means that it’s written in PHP and isn’t really meant to be edited by everyday users. In this case, the gallery code would access a configuration variable to determine how many thumbnails to show on a page. Then it would access a parameter passed to it to determine which page the user was requesting. Then it would get the images that were requested and prepare them to be displayed. Then it would pass all of this information on to a template. The template (which should be easily editible by those who know a little HTML) would then cycle through the images and display them. The template would handle deciding when to start a new row and, therefore, must have some notion of how many thumbnails have been requested for each page, although it doesn’t have to… it just means that all of the pages might ALWAYS not have enough images to fill the last row in the display. This is a nice option because the code in the template is kept to a minimum.

The second method is much more flexible, however it puts a lot more code in the template. Instead of using a configuration variable to determine how many items are on a page, the template actually requests the number of items that it would like. This is faster because the data doesn’t have to be preprepared. It’s also more flexible because the template is the source for important information like the number of thumbnails on a page. If the website owner should choose to change how a page looks, she wont have to update the template and the configuration. Just the template will do. However, the code looks MUCH more complex.

Allow me to give you an example of each version of the code.

Simple Template:

<html>  <head>    <title>      Gallery    </title>  </head>  <body>    <p>      <a href="{$selfurl}/{math equation="x - 1" x=$page}">        PREVIOUS PAGE      </a>      |      <a href="{$selfurl}/{math equation="x + 1" x=$page}">        NEXT PAGE      </a>    </p>    <table>      {section name=thumbnail loop=$thumbnails}        {if $smarty.section.thumbnail.index mod 3 eq 0}          <tr>        {/if}        <td>          <p>            <a href="{$thumbnails[thumbnail].url}">              <img src="{$thumbnails[thumbnail].imgsrc}" />            </a>          </p>          <p>            {$thumbnails[thumbnail].description}          </p>        </td>        {if $smarty.section.thumbnail.index_next mod 3 eq 0}          </tr>        {/if}      {/section    </table>  </body></html>

Complex Template:

<html>  <head>    <title>      Gallery    </title>  </head>  <body>    <p>      <a href="{$selfurl}/{math equation="x - 1" x=$pageparams.page}">        PREVIOUS PAGE      </a>      |      <a href="{$selfurl}/{math equation="x + 1" x=$pageparams.page}">        NEXT PAGE      </a>    </p>    <table>      {getchildren type="image" num="9"         start="$pageparams.page * 9" assign="thumbnails"}      {section name=thumbnail loop=$thumbnails}        {if $smarty.section.thumbnail.index mod 3 eq 0}          <tr>        {/if}        <td>          <p>            <a href="{$thumbnails[thumbnail].url}">              <img src="{$thumbnails[thumbnail].imgsrc}" />            </a>          </p>          <p>            {$thumbnails[thumbnail].description}          </p>        </td>        {if $smarty.section.thumbnail.index_next mod 3 eq 0}          </tr>        {/if}      {/section    </table>  </body></html>

In case it’s hard to tell the difference, look at the "getchildren" command being issued in the second template. That’s the biggest change between the two. The nice thing about the second version is it gives the template author so much more power. So many other cool things can be done if the templates work in this fashion. However, this means that the template author must know that he is looking for children of this node that are of type "image". Without this knowledge, her template wouldn’t display any thumbnails at all.

Or maybe there’s a better way. Tell me how YOU would propose the template should look to allow a user to display any number of thumbnails on a page. Anything. Please. I’ll entertain any and all suggestions.

Microsoft allegedly sues Mike Rowe

According to a Slashdot article and Mike Rowe’s website (currently VERY slow due to the article on Slashdot), Mr. Mike Rowe (17) is being sued by the Microsoft Corporation for trademark infringment due to his "confusingly similar" domain name, MikeRoweSoft.com. Microsoft allegedly offered him $10 (which was to include all out-of-pocket expenses) for the domain name. When Mr. Rowe responded stating that his time, effort and materials were worth at least $10,000 the Microsoft corporation filed a law suit through the Canadian Law Firm Smart & Biggar claiming that the MikeRoweSoft.com domain was purchased in bad faith.

Something smells fishy about this whole thing. So I’m not sure how legit I believe it to be just yet.

*nix under MIcrosoft?

Sure, there’s Cygwin. They’ve done a good job. But if I’m going to do it, I want to do it right. I want real integration with Windows. I want windowing integration, and file system integration. I want to have the same users in both places. I want real telnet and and ftp. I want them all to run perfectly, and I want them to be as *nixy as *nix itself.

Well, thanks to Microsoft, this is possible now. Microsoft has updated their Windows Services for Unix package. With this package comes a Perl Interpreter, Korn and Bash, Bind, FTP and Sendmail. Even GCC and all the libraries. [via Anil Dash]

Thank you, Microsoft.

A day off?

I’m very bad at remembering when my company has a holiday and when we do not. I thought that, just maybe, we had today off for Martin Luther King Day, but we don’t. Apparently — I had to ask my dad — we used to have it off. But, as of this year many of the days that we used to get off have been converted to floating holidays (synonymous in almost every way with "vacation day"). So, I don’t get today off.

Weight Loss: week 1 (192.6)

I’ve started a weight loss program… again. This time, I’m not doing anything too drastic with the way that I eat. That’s why I’ve failed every time I’ve tried in the past. I’m not coutning calories or carbohydrates, or anything like that. Doing so only pisses me off because I hate being told I can’t have something, especially when I’m the one telling myself such things. So, I’ve all but cut out soda from my diet. If I do drink soda, I drink Pepsi One. Additionally, I’m trying to eat less refined sugar and less enriched flour. I’m also trying to do my best to eat 4 small meals each day, as opposed to a small lunch and a huge dinner. This should keep my metabolism up much higher.

This "diet", alone, might be enough to keep me from gaining weight, but I want to lose weight. So, I’ve begun an excersize program as well. Again, I’m not being a maniac about it, because if I do, I’ll never keep up with it. Instead, here’s my routine. Every other day I spend 20 minutes on some sort of cardio-vascular machine. I spend another 5 minutes warming up and another 5 minutes cooling down. I don’t have a heart-rate monitor, so I just play it by ear. On the remaining days, I engage in 10 minutes of cardio-vascular and then perform 2 sets of 10 on 7 different machines working 7 different muscle groups. I use as much weight as I can possibly handle for the 10 lifts and I go as quickly as I possibly can while making sure that I am doing the exercize properly. I’ve been doing this for about a week now and it seems to be going well.

I’d like to lose 40 pounds of fat and gain 15 – 20 pounds of muscle. That would put my weight around 170ish. Right now, I’m a hair over 190 which isn’t horrible. But, if you consider the amount of muscle mass I have — very little — it’s not so good. Last week, my first week, I skipped only two days. That’s pretty good for me especially in my first week. I’m begining to learn when good times are for me to go and different ways to motivate myself. I think I’m catching on. Every monday morning, if I can remember, I’ll post my weight so you all can cheer me on.

Weight: 192.6

Sudbury, in another light

In this collection of photographs by Edward Burtynsky, I found a section that looks (mostly) at Sudbury, Ontario in a different light. [ via BoingBoing]

Object Crazy!

So I’m going object craaaaaazy.

Ever since Matt and I had our long talk about what an object really is and the value of it, I’ve been converting everything in Inklog to objects. And when I finally realize that something isn’t an object that could be, I have a strong desire to convert it. This is nice because it’ll make life easier for people who wish to extend my code. However, it’s horrible because sometimes I go too far and make things into objects that shouldn’t be.

Right now, whenever a handler object returns it’s data, it returns an ObjectRendering object. This is fine and dandy. But, it might be a lot cooler if it returned an object that was typed according to the output. If you ask for HTML, you get a RenderedHTML object. If you ask for JPEG, you get a RenderedJPEG object. That sort of idea. This might be a little overboard. Because, regardless of what type of Object is returned, I can’t think of when you’d use more than the same few methods: gettype(), getdata(). Well, except in ONE case, which is what made me think of doing this in the first place. A user might wish to have a Config Objects or a Metadata Object rendered as a Struct. Even in that case, it’s still just getdata() and gettype(), unless I make those Objects do special things.

I have a big kink to work out right now regarding ErrorHandling. And I think, when I work that out, it’ll help me decide if I need to have multiple Rendering objects, or just one. We’ll see, I guess.

Also, a simple site is in the works to be deployed where it can be used. I’ve also got all of the NEW Inklog code on a CVS server. Those of you interested in hacking on it or just getting a look, email me. There are a few things I have to take care of before I’m ready to make it public, but, I’ll share it with those who ask.

Inklog: Objects need friends too, damn it

I’ve run into a bit of a design delimna with Inklog. It’s not too difficult to understand and, in the end, it really doesn’t matter. However, I thought I’d get the opinion of other developers before proceeding.

In Inklog, all the items that the system can display are represented as objects (PHP Objects) within the code. However, the data is stored in a database, so the objects need to be flattened and then reinflated. The method I choose to use when flattening is this. One table holds the object’s shortname (unique to each parent), title, type, data, creation date, modification date, and format. This table has a parent field to represent what object contains this object. A second table holds the various properties of an object. Each object type requires certain things to be present within it. For instance, a BLOG object type requires a TEXT object type with a shortname of "content" to be contained within it.

This presents two problems. First of all, it is difficult to determine which objects were added by the owner and which objects are required elements of thier parents. I could place the required elements in another table, but that seems silly. I’d like a way to easily determine, however, which things were added by the owner, and which things are required by the parent object type. Another problem is that, rarely are both "data" and any of the other fields used. For instance, if we consider the above BLOG object. In the actual BLOG object, there is a title, a createdate, a modifydate, and a shortname. But the BLOG object doesn’t have any data of it’s own. Instead, it’s child named "content" has data. However, this child doesn’t really have a title, and, it’s createdate and/or modifydate are unimportant since the BLOG object that is its parent has that data already. Additionally, while this "content" child has a shortname (because everything has one), the object it isn’t meant to be directly accessed. This is easily determined by the object type (i.e. TEXT objects should never be directly accessed) but, without extensive processing, it isn’t easy to make that determination.

There are two options that I can think of to solve this issue. The first is quite simple. Remove the uniqueness requirement of shortnames within a parent and enforce said requirement in code instead of in the database. Then, for any object that is a required element of it’s parent, don’t give it a shortname and use the title field to name the object. With this model, any item without a short name is both not directly accessible, and is a required element of it’s parent. It sort of defeats of few of the design goals that I had for data integrity, but it works.

The second option is to place required elements in a table of their own with a parent field to denote their relationship. The biggest downside to this approach is that this means that any required element of an object type must be a "simple" object (like the "content" object above) and not a complex object (like the BLOG object above). One of the main differences between a simple object and a complex object would be that a simple object cannot contain other objects. This could end up limiting the functionality of certain object types that would like to require a complex object. I can’t think of any examples off-hand of where this would be needed, but Inklog is about being open, flexible, and extensible… so I’d rather not place that limitation on the system if I don’t have to.

I guess there is a third option. I could add a "required" field to the database that is set to TRUE whenever an object is a required child of its parent. This would denote that it is unable to be accessed directly and would also allow a simple SQL query to determine the list of owner added objects within another object.

So I ask of you, which method is better, or is there another option I have yet to think of?