Archive for August, 2008

Obamanomics – bring it!

Shizzam! More people need to get this into their domes: just because McCain talks a big game about tax cuts doesn’t mean that anyone but a very, very small group of people would actually get a tax cut under a McCain Presidency. This NYTimes Magazine article on the ins and outs of Obama’s economic plan drives home the fact that Obama really is “the tax cutter in this race.”

All told, Obama would not only cut taxes for most people more than McCain would. He would cut them more than Bill Clinton did and more than Hillary Clinton proposed doing. These tax cuts are really the essence of his market-oriented redistributionist philosophy (though he made it clear that he doesn’t like the word “redistributionist”). They are an attempt to address the middle-class squeeze by giving people a chunk of money to spend as they see fit.

Is this going to make everyone in America who doesn’t make $250k/year suddenly see the light? Probably not. Could it possibly change the minds of at least some Thomas Franks-style GOPers? Sure—but only if they find out about it. That means a big push from the Obama campaign.

Tags: ,

Loving JQuery

As someone involved with a decent amount of Rails programming over the past year, most of my work in Javascript frameworks has centered on Prototype and script.aculo.us. And with good reason — both are enormously capable and, with Prototype at least, extremely well documented. They create beautiful effects and nearly painless AJAX, they integrate really well with Rails, and there’s a wide community of users you can slot yourself right into. I’ve used some other frameworks as well — made interfaces with ExtJS and messed around with MochiKit some — and I’ve discovered that every one of these things (with the possible exception of MochiKit, which seems to be essentially abandonware at this point) has a specific niche to fill.

But for the most part, what all these things have in common is that they seem to have been created with web application interface development in mind. They’re not all that well suited to the set of one-off needs that crop up with general forms and lead generation tools on your average small site, but a lot of people end up using them for that anyway because they remove some of the tedium from JS. Numerous blog posts have been written about the phenomenon of people including the entirety of Prototype just to make tiny, “DHTML” DOM manipulation a little less painful, which makes no sense. Just suck it up and use JS for real. It’s not that hard.

There are some tasks that fall in between though — they’re more than trivial with bare JavaScript, but loading the entirety of a framework like Prototype is kind of like using a chainsaw to trim hedges. It’ll work, but it will be heavy and imprecise, and you may find yourself regretting all the extra work later. You still need a tool though, so what’s the solution?

A smaller, more task-oriented framework. This week, I decided that I’m a fan of JQuery. Here are the two examples from this work week that sold me:

Cycle

The Cycle plugin makes it dead simple to create a slideshow effect.

It supports pause-on-hover, auto-stop, auto-fit, before/after callbacks, click triggers and many transition effects including fade, shuffle, scroll, turn and zoom. It also allows you to define and run your own custom transitions. In addition, it supports, but does not require, the Metadata Plugin and the Easing Plugin.

The basic way it works is that you put together a div filled with the objects you want to cycle, usually other divs containing, say, an image and a caption. Once you’ve got your structure set up, you call cycle with one line, which it’s good to place at the bottom of your HTML so you’ll know all your pictures have loaded:

1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>
  <span class="ta">&lt;script</span> <span class="an">type</span>=<span class="s"><span class="dl">&quot;</span><span class="k">text/javascript</span><span class="dl">&quot;</span></span> <span class="an">charset</span>=<span class="s"><span class="dl">&quot;</span><span class="k">utf-8</span><span class="dl">&quot;</span></span><span class="ta">&gt;</span><tt>
</tt>    $('#mydiv').cycle();<tt>
</tt>  <span class="ta">&lt;/script&gt;</span><tt>
</tt>

You can add all kinds of options in the call to cycle, but the bare effect itself is pretty pleasing and is frequently exactly what a developer is looking for.

UI.Datepicker

UI.Datepicker is part of the JQuery UI library. You can think of UI as being script.aculo.us to JQuery’s Prototype — it’s built on top of the JQuery core and provides visual effects like fade, appear/disappear, window shade, shrink, grow, etc. It also contains all the drag/drop-oriented stuff you might need, as well as several other “widgets” and interaction pieces.

Datepicker is a widget that provides a calendar. When a user clicks on a form text field which has been tied to a Datepicker object, a calendar appears. The user navigates the calendar and chooses a date, which is then inserted into the text field. Again, the implementation code is short:

You could one-line this at the bottom of your page as well if you wanted (as with cycle above), but using JQuery’s $(document).ready() enables you to ensure that the code won’t try to execute before the page is loaded, so you can keep code you might use a bunch (like a standard calendar widget) outside your HTML file in a central spot.

1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt><strong>5</strong><tt>
</tt>
  <span class="ta">&lt;script</span> <span class="an">type</span>=<span class="s"><span class="dl">&quot;</span><span class="k">text/javascript</span><span class="dl">&quot;</span></span> <span class="an">charset</span>=<span class="s"><span class="dl">&quot;</span><span class="k">utf-8</span><span class="dl">&quot;</span></span><span class="ta">&gt;</span><tt>
</tt>   $(document).ready(function(){<tt>
</tt>     $('#date').datepicker({dateFormat:'yy-mm-dd'});<tt>
</tt>   });<tt>
</tt>  <span class="ta">&lt;/script&gt;</span><tt>
</tt>

One thing I love about the JQuery UI site: you get to build your own download — i.e., you can select the pieces of code you need by feature and have the file built with just that code. Among JavaScript frameworks, I believe this may be unique to JQuery, and it makes a serious difference in the file size.

I believe that this attitude — favoring modular code, giving you only what you need so you don’t end up with page bloat — probably drives a lot of JQuery’s adoption in smaller-need situations like the ones I’m describing here. But JQuery is also the native JS framework for both Drupal and WordPress. I haven’t messed with MooTools or Dojo yet, but I think of them as being in a similar class to JQuery, and I think JQuery definitely has the momentum to draw in more converts the same way I was: dead-simple use, only-what-you-need philosophy of code distribution, pervasive understanding of the bandwidth challengers front-end web developers face.

Tags: ,

iPhone 3G – first week

I got my iPhone 3g one week ago, and so I thought I’d blog a bit about my experience so far.

3G

I’m not sure if it’s just where I live, but the 3G service has been unexceptional so far. Or maybe I should just go ahead and call it “lousy.” I’m almost always auto-switched to the Edge band by the device itself when I’m at home, simply because I’m getting no bars of 3G. I had thought that AT&T had blanketed our nation’s capitol w/ helpful 3G service, but it appears not to be the case in my neck of the woods. Unfortunately, my office is also in a place with no decent coverage. Annapolis, MD isn’t on AT&T’s list of cities covered in Maryland, but it gets some residual 3G I guess from being close to Baltimore and DC.

GPS

This has been seriously cool for the most part, although it seems to work best with the 3G turned on, which I frequently don’t have — either for battery life or service reasons. I can see why it’s not “turn-by-turn” ready, but if you have a destination/route mapped out and you’re just trying to follow it, this works pretty well. It’s generally been just a few seconds behind my actual location.

Bigger Capacity

I bought the 16GB, and after my year of having the 4GB model, this extra capacity is sort of boggling my mind. I need to start adding some videos just to fill it out.

Case

I sort of feel like I liked the heavier metal version of the phone a little bit better, but the curved case is going a long way toward making me a believer in the new form factor. It does seem a bit more cheaply made though — I suppose that’s only natural when you drop the price point and ramp production up enough to have 40 million before the end of the year. I can see tiny inconsistencies in the way the light comes off the metal on the edges. I’m thinking of it as sort of a “brush blemish.”

App Store

Nothing out of here has really blown my mind yet, but I appreciate all the stuff that I’ve used so far. OmniFocus for the iPhone has been pretty disappointing on both this device and the old one, but they’re still working on it, so I’m going to give it some time before I start really dissing the experience.

I’m a fan so far of:

  • New York Times reader
  • Trism
  • Break
  • Twitterific
  • Bank of America Mobile Banking

Jury’s out on:

Apple needs to get hip to the fact that the AppStore is something that people need to like and trust. Pulling apps from the store with no explanation isn’t going to endear you to iPhone users, nor is the inclusion of a “kill switch.” The more people use the store, the more they’re going to expect that Apple act like the the benevolent, permissive distribution mechanism that Jobs’ promised at WWDC 2008.

Hacking/Jailbraking/Pwnage

I decided to wait on implementing the Pwnage tool for a little while. Until AppInstaller is ready for the 2.01 firmware, what you’ve mostly got available is a bunch of developer tools that I really don’t care about right now.

Summary

I like the thing a lot. I had been thinking that it wasn’t as cool as the last one, btu then I realized that the novelty factor w/ the first gen release simply wasn’t going to be topped; no subsequent iPhone experience was ever going to live up to the thrill of having/using one for the very first time. It was unfair to expect that level of cool from what was for me, basically an upgrade.

Tags: ,