Archive for the ‘Geek’ Category

It’s Time to Touch

Thursday, July 24th, 2008

Yesterday, I caught myself poking at my laptop screen three times. With the addition of NetNewsWire and OmniFocus, I find myself using my iPhone more and more even when I’m at my computer. One of the unexpected side effects is that not being able to touch my screen suddenly seems rather strange. This is especially true when moving between the iPhone and my Mac. All those delicious little app icons in my doc are just begging to be touched. The little exposed corner of my iChat window under Safari begs me to poke it.

I don’t think touch computing is going to replace the mouse just yet, and we’re certainly not ready to give up our keyboards, but hasn’t the time come for us to be able to touch our screens. If you can find somebody who’s never used or observed a computer before, sit them down in front of your machine. Ask them to click on something or move a window. I’ll bet you they don’t reach for the mouse. The most natural way to interact with the spacial metaphor of windows is to touch them.

It doesn’t matter if you’re sporting dual thirties or a svelte thirteen point three, chances are, you’re using all of the real estate and more. Far too much time is spent moving panels around to get what you want in front of you. The mouse is just not the right tool for the job. It’s too limited. You have to find the point you want to drag, find your pointer, move your pointer to the point you want to drag, then move the window. The problem is even worse for drag/resize maneuvers. Studies have shown that there is a marked productivity increase associated with having a larger display. This is because it reduces the amount of time you have to spend organizing your windows.

Styluses suck. We don’t need them. They’re not the answer. We need sexy glass surfaces that respond to our fingers in the most natural way possible. Apple has already taught us several multi-touch gestures with the iPhone. There’s no reason they can’t translate directly to the OS X windowing system. Touch and drag to move windows. Pinch to resize. Tap to click. That’s all we need to start with. From there, you can expose the stuff to the application and let apps do clever things or do nothing.

The world is ready. We have the technology. Let us have it.

New Xbox Interface

Wednesday, July 16th, 2008

Yesterday, at Microsoft’s E3 media briefing, they announced a completely new interface for the XBox 360. It’s a bit disappointing to me, actually. It seems a whole lot like the kind of unoriginal, “me too” crap I’d come to expect from Microsoft, but not Microsoft Games division. First of all, they’ve dropped the “blades” interface which I rather liked. They’ve also dropped the gamer image in favor of an “avatar.” The first thing that comes to mind is “what happens to the skins and gamer pictures that users have payed real money for?”

The new “avatars” feature sure seems a whole lot like Nintendo’s Mii functionality. The major difference is that Microsoft’s version seems to be much less flexible. It looks like you’ll be buying new outfits to customize your characters. So, the gamer pictures you just purchased are now unusable, but Microsoft is generously providing new worthless content for you to buy. I never actually spent money on this content, but it’s very upsetting to see Microsoft just nuke paid content without providing the user with any options.

The one feature I’m happy to see as part of the new update is integration with Netflix. It will be nice to have an easy way to use the Netflix streaming functionality on my TV.

Backing up with S3

Sunday, July 6th, 2008

Last night, I threw together a little script for backing up content from my web server to Amazon S3. It’s not really feature complete, but it is good enough for what I need for now. It provides a very simple DSL for specifying what content should be backed up.

Download it here.

To specify content:

backup :foo do
  folder '/path/to/stuff'
  folders ['/path/to/things', '/path/to/blah']
  file '/path/to/allyourbase.rb'
end

Will produce this in S3:

-{date stamp}
  -foo
    -stuff
      -..content of stuff
    -things
      -..content of things
    -blah
      -..content of blah
    -allyourbase.rb

The idea is that you could have one backup block for each site (notice how the symbol passed to the block becomes the root folder). You could backup all the different parts of the application under one umbrella without having to worry about any collisions with other apps.

You’ll need the ‘aws-s3′ gem. To deploy this on your server, just put the files somewhere on your server, modify the configuration in the run_backup.rb script and point a cron task at it.

Proper DSLs

Friday, July 4th, 2008

Dave Thomas wrote a great article describing a troubling fad in Ruby development. Specifically, he addresses DSLs - Domain Specific Languages - that try too hard to look like English rather than trying to cleanly describe a problem domain. I’ve always had a distaste for things like RSpec and AppleScript, but had a hard time describing exactly why.

Ruby makes it easy to create a domain specific language and many of the existing ones make the language particularly compelling. Rails migrations are beautiful in their elegance and descriptiveness. Rake is a joy to use compared to most build systems. XMLBuilder is a very sexy way to build XML files. The things that I feel many new rubyists fail to grasp is that these DSLs are not trying to be English. They are trying to create a simple and clear way to solve a specific problem while adding as little unnecessary cruft as possible. Most importantly, they all remember the difference between code and human language. A good DSL is unapologetically code.

Search Wikipedia from Google

Friday, June 27th, 2008

I often use google to search wikipedia with keywords like “wikipedia little endian.” I discovered on accident this morning that if you just type wikipedia, Google actually supplies a search box for wikipedia within their result set. Pretty cool. Is this new? Is it just for wikipedia? Is there an API for defining this?

Why You’re not too Smart to Switch to Mac

Thursday, June 26th, 2008

Somebody over at Gizmodo published an article on why he still uses Windows. He begins by saying that he’s “too smart for Macs” (emphasis his). No, dude. You’re not. Let’s go through your arguments one at a time and see what’s really what.

The first argument, “I’m a monster on Windows” has merit. If you’d expanded on this a little and let that be it, I’d have left you alone. If you’re comfortable and really productive on an OS, there’s really no reason for you to make the switch. You might find that you’re more productive on another OS once you get over the learning curve, but I’ll give you this one.

The next section describes how Macs used to be utter garbage. This is a statement I agree with. Mac OS and even OS X wasn’t always as awesome as it is today. But it is awesome today. Who cares about what it used to be. Windows used to be better. It’s not today. Welcome to the present.

The next section tries to make several points, most of which, are utterly misinformed. PCs are better for games. Agreed. “Windows is an OS that feels structured and it makes sense just because I’m used to them.”(sic) There’s always a period of getting used to something new. This is the same as the first point. Macs feel dumbed down. You can’t tinker or access low level system stuffs. Mac OS X is based on BSD Unix. I would argue that it’s more flexible/tweakable, though, fewer changes are necessary to get acceptable performance. There aren’t as many apps. True. But it’s not like it used to be. There may not be as many, but there are plenty, and they’re usually better. Limited hardware choices. The Mac Pro is very expandable. If you really want to build your own machine, and that’s more important than actually using the machine, I have nothing more to say to you. Nowadays, most people buy laptops, and nobody is really making laptops designed to be taken apart.

Next up, we have a section about the founders of the companies. This is irrelevant. It’s worth mentioning, however, that even Bill Gates thinks Windows sucks. This is followed up by a section about how Macs are too cool. This is another irrational decision that has nothing to do with the actual platform itself.

The last section is a gold mine. “The main reason I still use Windows is this: I’m stubborn and lazy.” Not too smart, too stubborn and too lazy. I believe that. “I don’t want to switch because it will amount to admitting that I’ve been wrong for the last 15 years or so.” First of all, so fucking what. I thought you didn’t care what people thought? What happened to “My computer is not a fashion statement”? Second, you don’t really have to admit anything. Windows used to be better. Now Mac is. You weren’t really wrong. I got razzed a little bit when I made the switch, but I’m still glad I did. There’s some more stuff about not wanting to learn something new. It takes about two weeks to get acclimated to the Mac. Ask your pals over there at Gizmodo for a few app suggestions to replace your Windows tools.

Get yourself a review MacBook Pro and use it for a month or so. You won’t want to give it back.

It doesn’t bother me so much that this guy uses Windows. If he’s comfortable, productive, and happy with it, there’s no reason to switch to something else. The thing that bothers me about this article is how ignorant most of his arguments are. In 2001, I would never have imagined myself using a Mac. The people over there have made some amazing achievements since then. I’m irritated when people compare today’s Windows with 1998 Macs and say they’re better. We should be looking at today’s realities and tomorrow’s prospects.

Smooth Scrolling with ScrollBox.js

Thursday, June 26th, 2008

Somebody wrote an email asking for a good way to do smooth scrolling with my scrollbox library. If you have some code that will do smooth scrolling on a div, you can use it. The scrollbox will watch what’s going on and automatically update the handle as well as its internal state. If you’re looking for a good solution, here’s a simple one that uses scriptaculous.

	Effect.SmoothScroll = Class.create(Effect.Base, {
		initialize: function(scrollbox, options){
			this.scrollbox = scrollbox;
			this.options = Object.extend({
				to: scrollbox.scroll_pos,
				from: scrollbox.scroll_pos,
				duration: 0.5
			}, options || {});
			this.start(this.options);
		},
		update: function(position){
			this.scrollbox.scrollTo(Math.round(position));
		}
	});

If you have already created a scrollbox like this, var sb = new ScrollBox($('somebox'), {auto_hide: true});, you could trigger a smooth scroll like this:

	//scroll to the top over half a second (the default duration)
	new Effect.SmoothScroll(sb, {to: 0}); 

	// or

	// scroll from top to bottom over 5 seconds
	new Effect.SmoothScroll(sb, {from: 0, to: sb.scroll_max, duration: 5});

You can embellish this with any of the other scriptaculous goodness you see fit. I noticed when testing this that it automatically applied a nice ease in/out effect to the timing of the scroll. Pretty sweet.

Marking Down

Wednesday, June 25th, 2008

Based partially on the fact that I’ve always wanted to build my own blog engine, partially on my WordPress ownage experience, and inspired by Geoffery Grosenbach’s writing about why rails developers should write their own blog engines, I’ve set about doing just that, which is why I haven’t bothered fixing up this site. It’s taken a bit long than I’d hoped, largely because I already have so much content I have to migrate over. The limited feature set I’d mapped out for version one just wasn’t going to support carrying all my old posts forward.

One of the challenges I’ve been dealing with lately is content formatting. WordPress offers, out of the box, some simple formatting help. It’s nothing major, but things like double newlines are appropriately turned converted to paragraphs and such. All of my past posts rely on these features. The problem is that I’m really not sure what exactly the behavior actually is. I spent some time toying with different things and never really got a consistent reproduction of what the posts look like on the current site.

I finally arrived on Markdown. I’d goofed around with it before, but never really gave it much consideration. Being a web developer, HTML is practically a first language for me. I don’t find it particularly cumbersome to just plunk out all the tags I need myself. After reading John Gruber’s philosophy on what such a system should be, I decided it was pretty much in line with what I wanted. The best part is that, after installing BlueCloth - a ruby implementation of Markdown - into my app, I discovered that just about every post looked just as I wanted without any modification.

So, I’m going to go with Markdown in my new engine. Anybody have any words of wisdom or gotchas I should be prepared for?

SproutCore: JavaScript on Rails?

Tuesday, June 24th, 2008

I took a few minutes to read the Hello World tutorial for SproutCore. Looks mighty interesting. The first thing I thought was that it looks like JavaScript on Rails. The framework is installed the same way (rubygems). It uses what looks like rubigen to build out your application skeleton as well as providing other code generators. It even uses erb with rails style tag helpers for the views.

Code wise, it looks like they’ve taken some hints from Cocoa. Views are designed to be localized similar to Cocoa’s nib (or xib) files. Properties are accessed through getters and setters to allow for more hooks. There is support for public and private variables.

I’m not sure I’m ready to jump on this bandwagon completely just yet, but it looks promising. I’ll have to get in there and really mess with it before I can really know what’s what.

What if you Break It?

Friday, June 20th, 2008

As part of the deal around getting the price of the iPhone cut in half, AT&T is mandating that all iPhones be activated in store as part of the purchase process. They do not offer a non-subsidized price at all. What happens if you break your shiny new iPhone. The thing is made, in large part, of glass. Can you get a new one? Do you have to suffer yet another new contract? Credit check? Two more years of lock-in?