Archive for November, 2011
Apple TV 2 Review
I’ve had the Apple TV 2 for a few days now, after having upgraded from the original ATV1. I just wanted to jot down some notes on what’s good and what’s not so good.
Firstly why did I bother upgrading? Well it was mostly for Airplay – the ATV1 doesn’t do Airplay (it does sound only), and so I wanted to be able to load up a youtube video or things like that on the iPad (which I also bought), and have them play on the TV. I also just wanted to see what the latest version was like, and for $110 (CAD) it is a great price.
My biggest gripe is that despite the software version being the same as what I had on the old ATV, the user interface has changed for the worse. The ATV2 no longer syncs from my iTunes, it only does “Home Sharing”. Previously it would sync the playlist (I didn’t have it copy things over – just the playlist) and have a Movies menu containing my movies, a TV Shows menu showing my TV Shows, and a Music menu showing my music. It would also give me direct access to the most recently added items in there.
The new version however has the “Computers” menu, which shows my iMac iTunes share, so you go in there, click on Movies, and it syncs the list of movies right then (it’s not too slow, but it takes a couple of seconds), and then just shows them all. No access to the most recently added movies, though technically I could make a playlist for this I guess.
Furthermore, the TV Shows are no longer grouped by TV Show, but by TV Show Series. So for something like Dexter and How I Met Your Mother I now have 6+ entries in the list to scroll through. This makes the list of TV Shows way too long.
Since watching movies that I have on my iMac iTunes share is my primary use of this device, this has been a disappointing experience.
Of course that’s not how Apple wants you to use the device any more. They want you to rent movies and TV Shows on it from the iTunes Store, or use Netflix. I haven’t signed up for Netflix yet, so I can’t describe how good that interface is yet.
Pros:
- Airplay – seems to work well for youtube/vimeo videos on the iPad.
- Smaller, runs cooler, no hard drive to go wrong.
- Rewinding and ffwding movies seems to work better.
- Netflix access.
Cons:
- Airplay doesn’t seem to work with music videos on the iPad. WTF? I mean I can access them directly on the ATV itself (via the horrible menu system I described above), but why not Just Work? It transfers the sound only. This may be an iPad issue though.
- The lack of Sync and interface to Home Sharing is crap
- Not much of an update really – the UI should be much fancier
- No ability to sign up for Netflix or any of the other services on there via the ATV itself. Not a huge deal, but goes against the grain
Overall I’m going to keep with it for a while, and see if subscribing to Netflix helps things out.
It’s all about the logging
I’ve been a developer for a long time. Hell, I’ve been with my current company, as a developer, for a very long time – over ten years now. And there’s one thing that has really struck me over that period of time that is the one thing that makes life easier: Logging.
You can almost never log enough. When we’ve come across problems that we don’t understand, the first thing we end up doing is adding more logging.
One of my goals in Haraka has been to ensure that issues are easy to track. Deny (5xx and 4xx to the SMTP-savvy people) messages contain a UUID which can be tracked back directly into the logs. Having sat across the developer/sysadmin divide for a number of years (ok in truth, I just had fantastically bitchy sysadmins, and I love them for that) this is HUGELY important.
A lot of developers think that writing defect free software is the most important thing. They are entirely wrong – even defect free software gets a boat load of bug reports. Most problems and expenses with software will occur after you ship it. The only way you are going to be able to track what that problem was is through extensive logging.
So my message to you, dear coder friends, is to log early, log often, and log in a way you can track it back to an individual transaction. And save logs, lots of them, for as long as you possibly can.
And for Haraka users – we are working on improving this – it will be improved in the next major release (even though it’s pretty darn good already).
On thinking of senders
So I’ve been starting hacking on a sender’s system for Haraka. Senders seem to love HTTP, and Node makes this really easy, so adding a HTTP server that allows sending to Haraka is dead easy (just a exports.register() function that starts a HTTP server, loading outbound.js for sending – I already have the proof of concept).
What I’ve been thinking is something that takes a sender, recipients, a subject, a text body, and potentially a HTML body, and produces the correct contents for outbound, and sends the mail.
It might return a UUID which you could query for a status (but that’s yet to be determined – and not something Haraka can do yet).
Is that something the senders who follow this blog would be interested in?
Why linting Javascript is totally bloody useless
There was a post this week that was talked about how a missing “var” ruined their launch (because it put the Javascript variable in the global/module scope). All of the discussion about this seemed to focus on one thing “You Should Have Run jslint”.
I’m here to tell you that jslint (and the fork: jshint) is absolutely bloody useless, and hence I don’t use it.
Let’s have a quick look shall we. First let’s install jshint (which is better than jslint, and more modern):
$ sudo npm -g install jshint Password: /usr/local/bin/jshint -> /usr/local/lib/node_modules/jshint/bin/hint jshint@0.5.2 /usr/local/lib/node_modules/jshint ├── argsparser@0.0.6 └── minimatch@0.0.4
That all went well… So lets try it on haraka.js:
$ jshint haraka.js haraka.js: line 3, col 1, Use the function form of "use strict". haraka.js: line 5, col 14, 'require' is not defined. haraka.js: line 8, col 1, 'process' is not defined. haraka.js: line 8, col 22, 'process' is not defined. haraka.js: line 10, col 5, 'require' is not defined. haraka.js: line 10, col 34, 'process' is not defined. haraka.js: line 13, col 5, 'process' is not defined. haraka.js: line 13, col 46, 'process' is not defined. haraka.js: line 16, col 14, 'require' is not defined. haraka.js: line 17, col 14, 'require' is not defined. haraka.js: line 18, col 14, 'require' is not defined. haraka.js: line 20, col 1, 'exports' is not defined. haraka.js: line 21, col 35, '__dirname' is not defined. haraka.js: line 24, col 1, 'process' is not defined. haraka.js: line 34, col 5, 'process' is not defined. haraka.js: line 37, col 52, 'exports' is not defined. 16 errors
WTF? This script is pretty battle tested. Everything it has complained about are node.js variables, but everything I have read told me that jshint was node.js compatible.
So maybe jshint just shouldn’t be used. Let’s do a search on NPM for alternatives:
lint This package provide lint validation library + node-lint command line tool allows you to che
Looks promising. Installed it, tried it:
$ node-lint haraka.js
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'vows'
at Function._resolveFilename (module.js:320:11)
at Function._load (module.js:266:25)
at require (module.js:348:19)
at Object.<anonymous> (/usr/local/lib/node_modules/lint/lib/lint/vows.js:5:12)
at Module._compile (module.js:404:26)
at Object..js (module.js:410:10)
at Module.load (module.js:336:31)
at Function._load (module.js:297:12)
at require (module.js:348:19)
at Object.<anonymous> (/usr/local/lib/node_modules/lint/lib/lint/index.js:15:16)
Fucking useless. And dependencies really aren’t that hard in npm. Let’s press on:
nodelint The nodelint command line tool allows you to check for problems using JSLint. You can specif
What do we get:
$ nodelint haraka.js 0 errors
Praise Thor! OK so now we’re getting somewhere. Let’s move on to another file:
$ nodelint utils.js
utils.js, line 5, character 78: Use the array literal notation [].
var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
utils.js, line 9, character 10: Move 'var' declarations to the top of the function.
for (var i = 0; i < 36; i++) {
utils.js, line 9, character 10: Stopping. (10% scanned).
3 errors
These kinds of errors are completely fucking unreasonable, and laid down by Crockford who clearly needs to revise his viewpoint – putting the var in the for() statement is a reasonable thing to do, and yes I KNOW it doesn’t do what it looks like it does. I don’t care. And the problem is that these aren’t configurable checks for jslint – the “var at the top of the function” is not a parameter in the jslint config, and if it finds too many of those it just stops until you fix them!
So does nodelint actually find anything worth worrying about?
The truth is, yes it does occasionally find some issues, but getting it to accept your style is hard. Getting it to find real bugs is really hard. I’d love to be proved otherwise.