29.1.08

Inverse-Proportioned Columns

Today I accidentally blew my mind with a table layout. Given the following [simplified/spare me validation] code:


<table border=1>
<tr>
<td width=50%>hello</td>
</tr>
</table>


If you decrease the width of the column, you'll see the table grow. If you increase it (up to 100%), you'll see the table shrink. Get it? reduce the width and the thing grows!

The explanation is simple, however. When a table layout is auto and a column is defined in percentage, the table width is calculated as the column width multiplied by the inverse of its percentage. In other words, a 20% cell will occupy 1/5 of the table's width. This logic is loosely based on the assumption that you'll have the corresponding number of cells per row (in this case, 5), but it certainly isn't required to do so.

Verdict: USELESS

23.1.08

Jaxer

John Resig writes about Server Side JavaScript with Jaxer in his blog. Basically, it's an extremely simple way to set up a JavaScript server, with the things that you would expect a server to be able to do such as writing and reading files.

I first ran into Jaxer a couple of days ago when doing the latest update for the Aptana plugin for Eclipse. I didn't give it much attention, other than getting upset at the ugly icon on the toolbar. Ok, it's not ugly as much as it is inconsistent. The last thing I want is another "feature" being shoved down my throat (like the Aptana messages — grrr).

Hey, if John thinks it's cool, then it is. His jQuery library is not half bad and his book "Pro JavaScript Techniques" is not terrible either,* so there might be something to Jaxer.

Dion Almaer also posts about it on Ajaxian, adding that the database connection could be integrated with Gears. One thing that immediately caught my eye is that you can use JavaScript 1.8 — on the server.

Personally, I'd like to work on a project where there's only JavaScript to deal with, both on the server and the client side. Ok, maybe lately I've been hating C++ more than the average person, but wouldn't it be nice to use the same language on both sides? Have both sides talk to each other without complicated setups? That's Jaxer's promise to you. We'll see how it pans out.



*My sarcastic signature comments may confuse the unacquainted. John Resig has earned my respect because of his visionary work, most notably jQuery and lately with his excellent book.

9.1.08

n52

Inspired by Go “First-person shooter” with the Eclipse debugger, I bought a shiny new Nostromo n52 almost a month ago.

Several of those who know me or have seen me working know that I'm somewhat obsessed with keyboard shortcuts, so it doesn't come as a surprise that I pounced to get the toy as soon as I could.

I'm still a bit hazy about it. On one hand, it IS a super sweet toy: good looking, well built and quite useful. Everything I pictured. On the other hand, I soon started noticing a few flaws about my newly-acquired toy.

While it's understandable that I'm trying to fulfill a different goal than what the n52 is supposed to fulfill, I still can't figure out why would a d-pad be useful at all. This gadget replaces a trackball, which keeps my insurance premiums low by happily assisting my pre-TCS right hand. The n52, however, is absolutely useless when one attempts to map the d-pad to mouse movements. It really is the equivalent of moving the mouse with the arrows.

I soon started fantasizing about ripping it open and sticking in a small trackball. I'm not hardware hacker, so I'm pretty confident that while I have a good chance of making it work, the aesthetic result will be shameful. Assuming it works without having to pay attention to keeping the unit in one piece while using it.

After a few days of using it, I inevitably ran into configuration problems. No, the software is fine, I just couldn't figure out what to map to what. It has 4 states (normal + 3 "shifts"), which somehow forced me to find 4 different group-related macros or key presses.

I mapped the standard state to window and browser management: alt-tab, alt-shift-tab, control-tab, maximize, minimize, close tab, next, previous, etc. It works ok, I still find myself wondering what the right key is for minimizing a window instead of closing the last tab of my browser.

I mapped the second to "typed stuff"... well, so far, to parts of my password. Now I can log in with one hand. Of course, I could've created a one-handed password but shifting for caps or symbols wouldn't be as easy.

The third state is for gmail shortcuts. The fourth is for eclipse and firebug debugging.

So far... I can't say it has saved me much time or frustration. I have gotten used to keyboard shortcuts and I still find myself using them when I'm in the middle of typing. I wouldn't want to forget them anyway. On the other hand, I do find myself hoping that I could use it as a pointing device. Perhaps much of the problem also lies in the fact that I have Linux, Windows and Mac systems tied with Synergy, making the task of defining common shortcuts more difficult.

Originally, I wanted to buy the n52te (for "Tournament Edition"). It's much better looking and the d-pad is actually a joystick, which might help. Then again, belkin doesn't seem to be in a rush to deliver it, since it has been promising it for several months now. Well, my wallet appreciates sparing it the $50 difference anyway. For now.

5.1.08

gNius

Previewing gNius: a tool smarter than you.

I spent about 7 hours last night finally working on a pet project that had been laughing at me for a while now. Inspired by frustratingly unreadable template engines, I decided to write something that has a very gentle learning curve, yet just as powerful.

(to be continued...)