Archive for the ‘life’ Category.

Catching up (8, 9, 10)

I’ve been a little busy with moving, so that is my excuse for being AWOL. Let’s continue.

I learned that Ikea dressers require far more effort to build than beds. Probably twice as much time and effort.

I learned that the California Department of Corporations has wacky accounting that seems to work against their best interest. I just received a full refund for a processing fee they kept requesting last year. Strange.

I learned that it is unexpectedly rare to find web developers who have tried creating their own object-oriented database abstraction layer. I found it is even more rare to find developers who took this abstraction layer and made the (in my opinion) relatively obvious step toward creating a generalized abstraction layer that removes the need to write SQL 90% of the time. For those of you who haven’t thought about this before, creating such a layer, the pride and joy of the rails movement, is relatively simple. While there are many schools of thought on how to accomplish this, I think a simple place to start is to setup something like this:

// Notice my example assumes any table you want.
$object = new DBLayer(‘tablename’);
// Runs an equivalent of SELECT * FROM tablename WHERE
// primary_key_field = 30;

$object->load(30);
// Overload PHP5′s __set() method (see documentation)
// store this in an internal array so that table fields like
// ‘tablename’ don’t accidentally erase object settings.
// Thus, “$this->mData['username'] = $value;”
// Just see the documentation of __set(). Trust me.
$object->username = ‘new username’;
// runs an equivalent of UPDATE tablename SET username=’new
// username’ WHERE primary_key_field = 30;

$object->save();

There are many ways to figure out the primary key. One idea is to standardize the primary key name so that “tablename” always has a primary key of “tablename_id”. Another idea is to dynamically determine it by running a “DESC tablename” and caching the results. Think it over. It’s an interesting, but highly insightful challenge. My example may be a little advanced, but this is the starting point of those shiny “rails frameworks” you hear about.

Something New #5

Today I learned Target has a mini-grocery inside. Now that was unexpected wisdom.

Something New #3

Today I learned that my girlfriend would rather hang out with me and build furniture than go out with her friends on an exciting adventure. On a Friday night.

Something New #2

Today I learned that Visio can do floor plans. It does doors, windows, rooms, let’s you draw in stuff, label things, etc. I used it to plan out my new room.

Visio is a damn impressive product.

Something New #1

For the next 10 days, I will try to post every day. Each day, I will post something new I learned that day. It can pertain to any subject. Here we go.

Today, I learned about the tfoot HTML tag. Well, I knew of it, but now I know why it’s useful. Using it in conjunction with tbody and thead allows a web developer to apply CSS to the middle part of a table (tbody) so that it can be scrolled. When printing, it can be configured so that the header or footer reappear whenever a page break is encountered.. Since the footer (which is usually summary data, such as totals) can be defined before the tbody, it will load accordingly. Another interesting fact is that formatting applied to the tbody tag affects td tags inside it. Since the tbody/thead/tfoot tags are part of the DOM, they can be manipulated accordingly, such as hiding them, which will cause all child rows to also become hidden.

Browser support for this functionality is a little bit erratic, but for the most part, it’s there. A useful code snippet for making the headers or footers reappear on new pages when printing:

<style>
thead { display: table-header-group; }
tfoot { display: table-footer-group; }
</style>

This snippet is not necessary for more advanced browsers. IE, on the other hand, will need this to properly re-display headers and such.

Then use something like this:

<style>
thead { display: table-header-group; }
tfoot { display: table-footer-group; }
</style>
<TABLE border=”1″ cellpadding=”3″ cellspacing=”0″ width=”300″>
<thead><tr><td>sup</td><td>sup</td></tr></thead>
<tfoot><tr><td>footer</td><td>footer</td></tr></tfoot>
<tbody align=”center” style=”font-family:verdana; color:purple”>
<tr>
<td width=”50%”>2nd row</td>
<td width=”50%”>2nd row</td>
</tr>
. . .
. . .
</tbody>
</table>

Make sure to put in LOTS of rows in the tbody tag. Then hit “print preview” in your browser and scroll to the second page. Notice that the header shows up at the top and the footer appears at the bottom.

Every day you learn something new. Maybe tomorrow’s won’t be about programming.

Why Stress?

I was reading an article about project management tips (http://www.projectmanagementsource.com/2006/08/les…) and one of the bullet points talk about stress:

55. One key element in dealing with stress is taking control. A feeling of helplessness increases stress. So take some action that reflects that you do retain some amount of control over the situation – even if that little control is only over your reaction to the stressor.

While this statement is very true to me, I think it misses another point.

Helplessness causes stress for those who can’t accept it. Sort of like how a student might feel stress after believing they failed a final. However, I think that is a closed-minded way of generalizing this problem. The test is done and there’s nothing more you can do; thus, why stress?  I tend to see helplessness as it truly is: something that no longer merits my attention.

Don’t get me wrong: I am very proactive before the point of failure, but once it happens, it’s happened and there’s no point in spending further negative energies thinking about it.

For example, let’s say your company is downsizing. You could be fired tomorrow. Like that fat guy in Office Space, you could get all stressed out and scared. Most smarter people might try to mitigate the risk by proactively working harder or kissing ass. But let’s say you’ve already done all that. Now what? This is where people start stressing out.

I treat scary situations like that as a has-happened situation. There’s nothing worth stressing out over once you’ve done everything you can do. In that situation, I’d continue business as usual. I would figure if I am needed, I won’t be fired either way. And I wouldn’t want to work for a company that keeps people around just because they kiss ass.

As another example, two weekends ago, I flew to Chicago. Somehow, the airport placed my luggage on the wrong flight. I filled in a report and they told me it would be arriving at my hotel within the next 12 hours. Of course, 12 hours later, nothing arrived. I bought some essentials in a local store and pretty much ignored the fact my baggage was mysteriously gone. My co-workers were all perplexed why I wasn’t calling the airline, but my reply was, “If it’s coming, it’s coming. If it’s lost, it’s lost. Calling won’t change that so why stress?” And then another 24 hours later, the bags arrived. Would I have eventually called? Yes, just to make sure they had the right address, but other than that, no.

If I’m truly helpless, I recognize that fact, and move on. Don’t get me wrong: it doesn’t mean I won’t try to improve my situation if I see a chance. My point is that stress is a self imposed reaction.

Word Press SUCKS

Word Press has truncated or otherwise destroyed more than one of my posts on this blog. I am going to look into switching to a better engine. If you have suggestions, please post them. I wrote a very long entry yesterday about technical writing, and I came back today to realize it had killed half my posts during one of my edits. That’s insanely stupid.

Update: I have no plans on re-posting the truncated article. Over half of it was lost and I am too frustrated to convince myself to write the same thing a THIRD TIME. From here on out, I’m posting to this blog using a third party tool.

New Job and Punching Monkeys

I am starting at a new job in a week as Lead Developer. This has kept me busy because I have been slaving away trying to wrap up all my responsibilities at my current job.

On a separate and completely unrelated note, today I saw another variation to those once-popular punch a monkey type of ads. I always humor the programmers of the ad by repeatedly clicking on the ad without actually hitting the target. I’ll try my very darn best to shoot between the targets, miss the baby, and just plain suck at punching.

I’m looking at your ad. I’m clicking — perhaps not where you intended, but I’m clicking. I’m looking at your moving monkey baby thing. I’ve glossed over the ad text. I’m still clicking. And yet nothing happens to move me from viewing the ad to viewing the product. Eventually, I get tired of amusing myself and stop clicking, returning to whatever I was doing.

To me, this is a failure on the advertiser’s part. They’ve gotten my attention and my willingness to interact with the ad, but they’ve failed to communicate why I am interested in the product and convert my interest into action that results in a sale. It seems to me that a failure to use the product in the interactive ad, or the lack of mind-share presence of the product, is a fundamental failure by the advertisers to leverage the limited attention granted to them from a web surfer.

There’s a small chance I’ll want to visit your site, but if I don’t understand what it is I’m punching a monkey for, if punching the monkey becomes the focus of my interaction, I certainly won’t be *actually* interested in visiting your site.

And this is why I love clicking between the action areas on those interactive ads. There’s many solutions around what I do, but it amazes me that the ad hasn’t evolved in the years since it first became popular. Addressing this is how Google became king.

What Should I Write About Next?

I’m sorry about the lack of updates these past few days. I’ve been very, very busy wrapping up a few things in my personal life. I should have a significantly greater amount of time next week. I have a few ideas for some other coding related posts to address in the coming weeks. Whenever I get ideas, I write them down. Here is what I have so far:

Continue reading ‘What Should I Write About Next?’ »

Obligatory First Post

Hello and welcome to my new blog. While it’s hard to predict exactly how this site will turn out, needless to say, I plan to focus a lot of energy into it for the long term. While I did maintain another web journal, it occured to me that the site no longer accurately represented who I am. In short, I’ve graduated from the kid journal and I’m moving on to writing more techincal, thought-out posts. I am in no denial that this journal will contain humor, bad movie reviews, or small tidbits about my daily life, but the intention is to keep this blog insightful and less about the personal, mundane aspects of my life.