Aug282007
Recently I built some pages for a client, and one of the client contacts came back wanting to use validated XHTML. The guy in question was all, “It looks weird in IE!”
I cursed under my breath, and then looked at the pages he sent back to me. All he had done was add an XHTML doctype to each page. Running them through a validator produced millions of errors. That’s when I decided to read a bit on what XHTML actually does.
Benefits of XHTML
Detriments of XHTML
Sadly, after reading about all this stuff, I realized that I had been making some unwitting mistakes in my HTML for quite a while now, such as inserting a space and slash at the end of single tags (i.e. <br /> instead of <br>). Plus, I haven’t been validating my code… mostly just due to laziness on my part.
Anyway, the long and short of the story is that I learned a lot about doctype declarations, and that XHTML is mostly hype, in terms of accessibility and features. Using the HTML 4.01 Strict doctype will probably ensure that your document will be accessible in its’ original presentation for years to come (if you even care that long).
Aug092007
Sometimes I disgust myself. I have (personally) owned one Apple computer (G3 iBook) in my life, yet still follow Apple product announcements like a blind, gibbering sheep. This is in spite of some pretty decent reasons not to like the platform. For one, Macs’re expensive — and the “added benefits” of included software like iLife don’t really apply to me, since I don’t use ‘em. For another, when I tried to buy a “refurbished” MacBook Pro last year, both units Apple sent me were physically defective… I was on the receiving end of some crap customer service there. Plus, Steve Jobs is kind of a douche. Still, though, in spite of everything, I do like MacOS X. It’s got a familiar Unix shell under all the eye candy nonsense, and there are a lot of great programs for it… I would love to use TextMate and Transmit or Coda. And to be fair, for the extra money you pay, you do get the benefits of a closed hardware/software platform… everything usually just works, which is what I’m desiring now-a-days.
The big thing, though, is that there’s a gap in Apple’s product lineup: a huge gap between the Mac Mini and Mac Pro. I need two monitors for development work (which nixes the Mini), but don’t need the two dual-core CPUs that drive the price up on the Mac Pro. Some dude wrote an article about the issue, which I endorse wholeheartedly. When I went into the local Apple store for a “hiring event,” I was the only person who didn’t own a Mac — I cited the fact that Apple didn’t offer what I needed from a professional standpoint, but it didn’t go over well with the zealots at the store.
Until something changes at Apple, I’m sticking to the tried and true platform of Wintel.
Aug082007
If you’ve ever had to do “print” stylesheets, I’m sure it’s been exasperating. I mean, seriously… who prints web pages (Aside from people in my office, who print everything)? I saw a post on 37signals’ blog regarding print stylesheets that inspired me. That link isn’t actually the original article, but the gist is similar: set display: none for each extraneous element. Easy!
These guys also inspired me with another little bit of labor-saving information: the ‘Home’ and ‘End’ keys. In your browser, Home takes you to the top of a page, while End goes all the way to the bottom. Amazing how often I use these keys now, in addition to the ‘Page Up’ and ‘Page Down’ for scrolling through pages. Plus, in your (non-Emacs) text editor, Home moves the cursor to the start of a line, while End goes to… you guessed it… the end of a line.
Jul262007
CakePHP has all sorts of nifty form helpers that I would ordinarily never use, except for the fact that they get put in the auto-generated views. The helper that creates a day/month/year select tag automatically lists years from like 1947-2017… way too many. I normally don’t care, but a client complained about it this morning, so I had to go searching around for a way to fix it. Rather than go into the code itself, I prefer to be lazy and just search the net to see if anyone else has written something about it. Jackpot! Some dude has written how to modify the dateTimeOptionTag().
In case that page goes blank, the gist is editing
/cake/libs/view/helpers/html.php, which is the HTML Helper. Find the calls to yearOptionTag(), and change the third and fourth parameters to your start and end year, respectively. I used date("Y") and date("Y", strtotime("+4 years")).
[Edit] Alternately, just modify yearOptionTag() itself… the place to change the code is pretty obvious.