Really Reusable

Friday, 30 September 2011

When SpaceX talks about reusable launch systems, they’re not talking about letting rocket boosters fall into the sea and be towed home to be rebuilt from scratch. Check out this video (although I advise turning off the music – sounds like bad Russian Cosmorock from the eighties).

[via SpaceRef]

(Actually I really like Трава у дома)

iPhone Nano

Iphone nano phone

Apple has finally set a date for the unveiling of the new iPhone. Or iPhones. Or whatever.

I like Apple and I read the usual blogs but I have to admit to suffering from rumour overload. Listening to JG and DB, amongst others, it sounds like I’m not alone. Maybe it’s because Apple has done such a great job of keeping everything secret this time around – so the rumours are even more numerous, contradictory and bizarre and, it must be said, reek even more of an unhealthy obsession. Sure, Apple designs nice things. It’ll be great to see what they’ve been up to since the launch of the iPhone 4 over a year ago. But really, my iPhone 4 and my recently acquired iPad 2 are already pretty great.

Even this incipient apathy pales, however, in the face of my beloved wife’s utter lack of interest. Her disinterest, like a faster-than-light neutrino, is such that it bends the laws of physics in the immediate vicinity. I merely have to mention the first syllable of the word “iPhone” and she closes her eyes, hand clasped to her furrowed brow in mute suffering, and in a weak voice asks me to please, just stop talking. Fully understandable. Keeps me grounded.

But it got me thinking. My wife has an iPhone 4 as well, but she only ever uses it for email, the web, maps and making phone calls. She never installs any apps. She’s no Luddite, it’s just that she has all her mobile needs satisfied without needing to go beyond the default Apple apps.

The iPod Nano does not run iOS. But a similarly configured iPhone, with just those four apps – messaging, browsing, map and phone – would perfectly suit my wife, and probably a large number of other non-geeks as well.

And now I will stop talking about it.

Rails file upload permissions

Tuesday, 27 September 2011

This was irritating me, and now it seems so obvious, so I’m putting it up here for the benefit of anyone else who happened to get into this situation.

My Rails production servers are Ubuntu running Passenger. I used to run RedHat, under which the user running Apache is usually “nobody”. When I switched to Ubuntu, I noticed that the Apache user was now “www-data”. However I found that even if I chowned my log and file upload directories to “www-data” thus:

# chown www-data log
# chown www-data uploads

I would still get permissions errors. Rails would complain in /var/log/apache2/errors.log that it couldn’t write to log/production.log. It suggested setting the permissions to 0666 (anyone can write). I didn’t like that idea, and eventually I found out why my chowning wasn’t working.

Even though Apache runs under www-data, Rack still runs as “nobody”. What’s needed is

# chown nobody log
# chown nobody uploads

Obvious to anyone, probably, but it caught me out well and truly.

Clearly the superior song

Monday, 26 September 2011

Copyright over music is expressed in two forms. The first form is the copyright over the music and lyrics. Thus when Tori Amos records a vastly improved version of Smells Like Teen Spirit, the rights she must negotiate with Nirvana relate to their copyright over the music and lyrics. These rights are generally referred to as the performing rights. Licence fees payable to the copyright holders are managed through bodies representing composers such as (in Australia) APRA – the Australian Performing Rights Association.

The second form is called mechanical copyright, and is the copyright held in a specific recording of music. Thus when Vanilla Ice improves Under Pressure by Queen and David Bowie, by directly sampling the opening piano and bass line from an actual recording, he is infringing both the rights of the composer and the rights of the publisher, the usual owner of the mechanical copyright. Licence fees payable to mechanical copyright owners are managed through bodies representing publishers, such as AMCOS (Australian Mechanical Copyright Owners’ Society).

When it comes to software, however, we seem to have a missing link.

Because my source code is written by me, I automatically own the copyright. No one can use my exact source code without my permission. However, that is not to say that someone could not write some completely different source code, possibly in a completely different language, and produce exactly the same software function, right down to the pixels displayed on the screen. Therefore, unless my source code represents a unique way to solve a particular algorithmic problem that is difficult to reverse engineer (by far the minority in terms of all source code in the world), my copyright in it is effectively worthless. No one is on the phone to me wanting to licence my source code for displaying a button on the screen. They will just write their own version, over which I will have no claim.

Companies wanting to protect their investment in software development have turned instead to the patent system. Therefore, if the particular button I want to display on screen is labelled “Click to Buy” and when clicked, it purchases an item from a catalogue using a stored payment method, I actually have to pay Amazon a licence fee, since they own a patent on that particular software effect.

Ask a typical software developer about this, and they will tell you that it’s absurd – the trivial equivalent of someone owning the copyright in the chord C-major. And yet many, many patents just like this one have been granted and continue to be granted, despite their triviality and the presence of obvious prior art.

Yet, when copyright is no protection, what else is there? If we discard the patent approach because of these trivial claims, we also curtail the rights over those functions and features that are more worthy of protection. There are those that argue that the entire software patent system should be junked because it is being abused by “trolls” trying to capitalise on widely used, trivial features to which they have acquired patents. Yet these same developers would be rightly indignant if some other company produced an identical version of their software and began eating into their revenues. It seems what is needed is some empirical way of telling the difference.

When Vanilla Ice samples a recording of Under Pressure, we can use digital forensic methods as well as our own ears to tell that this is both the same song and the same recording. However when Tori Amos performs Smells Like Teen Spirit, we can also tell that this is the same song, even though the audio waveform is utterly different. If we wanted to debate it, the document we would most likely use is the sheet music, which contains a language of pitches, tempo, lyrics etc. that defines how the music will sound.

Perhaps what is needed is a formal language of software effect. If the source code defines the software, it is only one way to define that software’s effect. This is more or less equivalent to the mechanical copyright – the copyright that defines only one recording of a song. Someone else could write completely different source code, forensically orthogonal to my source code, that still produces the same or a very similar effect. The same “song”, in other words. In this case, we can’t refer to the source code if we want to debate the similarity of the two. We need something else. A formal language of software effect. This language, like sheet music, could not only help us to establish similarities but could also help to weed out trivialities – that “single C-chord”.

With the rise of indie developers mirroring a rise in the power of composers and a corollary decline in the power of music publishers, in music as in software: it’s the performing rights that are the important ones.

That’s no moon

Friday, 23 September 2011

Unveiled in 2008, the tiny dot spotted circling Fomalhaut, a star just 25 light years from our own solar system, was billed as the first exoplanet to be directly imaged at optical wavelengths. Now Fomalhaut b’s identity is being questioned after new data, presented last week at an exoplanet conference in Grand Teton National Park, Wyoming, shows it has moved in an unexpected way.

[Nature]

Soul

Wednesday, 21 September 2011

You need to ferret out the people who play politics but don’t get things done. You need to squash bureaucracy that stops innovation with doubt and red tape. You need to eliminate the energy drains, systemic distortions, and toxic people that force others to act like corporate drones instead of like entrepreneurs with a vested interest in success.

The Pipeline to your Corporate Soul – Alan Cooper

Cooper is talking about how website and software design problems are often reflections of deeper structural and social problems inside a company. But in a broader context that quote is a gem, and should be the litany of every CEO.

Xcode Can do Better

Tuesday, 20 September 2011

John Gruber writes:

…it’s curious to argue Apple developer tools and frameworks are deficient due to a lack of time put into them.

and

The enormousness of the developer base for Windows and Java is such that many developers feel that those environments are “normal”, and anything different is by nature inferior simply because it’s unfamiliar.

However, it’s only recently that you would find Mac (or more likely, iOS) developers who would have any sort of experience of other IDEs. It used to to be the case that developing for the Apple platform required a large investment of time to overcome the learning curve for a comparatively small return. This meant that if you decided to develop for Apple, you developed for Apple and that was it. Your tool of choice would be Metrowerks Codewarrior, or later Xcode, and you would be very unlikely to use any other IDEs in anger.

On the other hand, and once again due to the steep learning curve, it was very unusual to see Windows C++ or .NET, or Java developers move over to developing for the Mac. The small exception would be WebObjects developers, who – since they were using Java anyway – tended to stick with Eclipse and its WebObjects-specific plugins, rather than using Xcode.

Now, however, due to the potential money to be made on the Apple platform, developers from all sorts of backgrounds are finding it worth their while to invest the time in learning Objective C and Xcode. Now, many developers who have experience of excellent IDEs such as Visual Studio are running smack bang into Xcode’s funny little ways.

Like many geeks of my vintage, I’ve been writing code since I got my first computer at the age of 8 (a VIC-20 thank you for asking). I’ve spent the better part of 32 years writing software for a living using all sorts of IDEs and text editors, but mostly Visual Studio, JBuilder, Eclipse and more recently IntelliJ. I’m a huge Apple fan, and I love developing for iOS devices, and so this next statement is in the nature of a gentle word from an old friend:

Please, Apple, fix your goddamn fucking awful IDE.

Why are there fifteen different ways to navigate my project hierarchy? Why do few, if any, represent the actual layout of files in the filesystem? Why do you use that impossible to read font that is so tiny (yes, I can and do customise it)? Why is your syntax highlighting so unilluminating? Why oh why please dear God does your code completion suggest options that are OUT OF SCOPE AND SYNTACTICALLY WRONG. Why, when I ask you to format my code, do you make such a random hash of it?

The one thing I think Apple has got right is Interface Builder. Particularly in recent versions of Xcode, syncing your UI up with the iOS concept of Outlets and Actions is clever, (mostly) intuitive and yields great productivity benefits.

But almost all of those productivity benefits are eroded by the simple fact that the code completion is so rubbish I almost always have it turned off. Instead of relying on it to traverse the API (effectively an inline aide-memoire/research tool bundled into one), I have to constantly flip back and forth between my code window and the developer documentation. Clever UI design tools are all well and good, but as a professional developer, what I need is for the things I do thousands of times a day to be fast, intuitive and to get out of my way. I never have this problem in Visual Studio, nor in IntelliJ. In fact Intellisense is one of Microsoft’s few really brilliant pieces of technology – the gold standard by which all other IDEs should be measured.

It hurts me to say these positive things about Microsoft, for whom I otherwise have no affinity whatsoever, and to be so critical of Apple, for whom I have nothing but admiration, but the truth is the truth.

Xcode sucks.

Inchoate Windows 8

Thursday, 15 September 2011

There seem to be two main threads of discussion going on amongst the “Apple community” regarding the recent showing of Windows 8 at the Build conference.

1. It’s way pre-beta and won’t be ready to ship for at least a year, whereas iOS devices are well and truly in production and onto their 3rd and 5th iterations respectively

2. The Microsoft “Windows everywhere” strategy is wrong, because iOS demonstrates you need to build something suitable for the hardware and the user experience, both of which are sufficiently different from the desktop PC to warrant a custom fork of the OS.

These are interesting comments, but – and I say this as someone who loves, prefers, buys and develops for Apple – they don’t really say anything about the future of mobile computing and Apple’s dominance of it.

Apple dominates today, yes. They had the passion and the wherewithal to innovate in secret and get a massive, extraordinary head start – indeed, pretty much to invent the category, much as they did with the iPod.

But this preview from Microsoft is innovative, and does not appear to be copying Apple to any great degree. It draws on some very interesting UI ideas from Windows Phone (notably, a part of Microsoft that was acquired from outside and then operated almost as a separate business until the launch of Windows Phone Series 7 Phone). Furthermore, looking at this chart that was shown at Build…

Archslide

…it’s clear that in fact this is, to all intents and purposes, a fork of the OS. Indeed, you could replace “Windows Kernel Services” with “Darwin” and “Win RT APIs” with “iOS APIs” and you’d have almost exactly the same construction. The major difference would be that unlike Apple, Microsoft is not yet at the point where they’re able to port back to the desktop OS some of the learnings from the mobile OS.

Despite the similarities, I’m not suggesting this will be a repeat of the Apple II experience, where Apple sold 48 million units, making a laughing stock of early attempts by competitors, until some years later DOS/Windows became the dominant platform. But these two threads of discussion do concern me because of their apparent complacency.

Particularly in a post-Jobs Apple, the need to innovate will be stronger than ever if Apple is to retain its current dominance of mobile computing.

On the subject of Tesla…

Wednesday, 14 September 2011

Check out this video of a Tesla Roadster competing in the Targa Tasmania 2011 rally. Love that electric engine note.

Learning to Fly

Cessna 172

This year after we moved back to Australia from the UK, I decided to pick up my private pilot training again.

The last time I’d flown was about 15 years ago, in Goulburn, NSW. Goulburn Airport is a sleepy little airfield with no control tower. The perfect place to learn the basics in fact, and I had a great instructor: Teraya Miller from Goulburn Aviation. She was very patient with me while I repeatedly banged the Piper Warrior into the grass runway until I started to get the hang of it.

I’m now learning at Melbourne Flight Training from yet another very patient Flight Instructor, Darren Schmidt. Patience must definitely be one of the screening criteria for Flight Instructors. It’s amazing how much you forget – I felt like I was learning everything again from scratch. Moorabbin airport, where MFT is based, is the busiest General Aviation airport in Australia. It’s towered, with full Class D radio and reporting procedures, which is quite a lot to get your head around when you’re also trying not to bang the aeroplane into the ground too much.

Learning to fly is not cheap. Each lesson costs about $450, which includes about an hour of preflight briefing, 60-90 minutes in the air, and about 30 minutes debrief. However, you can go at your own pace. I’d love to fly every week but with other commitments I’m only managing it once every couple of weeks.

But oh. Can I just say that again? Oh. There is. Nothing. Like it.

Once you master the controls and you damp down your panic about crowded airspace procedures, the feeling of being able to move in three dimensions, to move the controls slightly, and suddenly to soar off in another direction – any direction – is simply extraordinary. The sense of freedom is immense. In a country as large as Australia, the idea that one day soon I might be able to fly the family anywhere we like, whenever we like (especially since Moorabbin is about 15 minutes from where we live) encourages me to press on and learn as quickly as I can.

However, there’s something that gives me pause.

Aviation is one of the worst contributors to greenhouse emissions. The design of these planes and their engines, from the single-engine trainers right up to something I might reasonably expect to fly such as a Piper Seneca (twin prop), hasn’t really changed since the 1960s. In fact many of the actual aircraft date back that far (although, of course, they are rigorously and carefully maintained). Imagine if the cars we drove every day were of a similar vintage.

1960s Chevy

It’s a strange enough anachronism. Being a great fan of Tesla Motors, I was lucky enough to test drive a Roadster in the UK a couple of years ago. It’s a toss-up which is more exhilarating: flying, or driving the Roadster. The question is: if they can make a powerful electric sports car with a range of 300 miles, why can’t they make an electric aeroplane?

Well, it looks like at least someone is having a go:

The company’s goal is to develop a practical, cost-effective conversion to environmentally friendly electric propulsion systems as a replacement for internal combustion engines on aircraft requiring 150 to 200 hp.

“…we are very pleased to announce that we taxied the aircraft for the first time on Friday, July 22, 2011,” said Charlie Johnson, President of Beyond Aviation. “We will be announcing our first flight date soon.”

Cessna is partnering directly with Beyond Aviation on this initiative, but things seem to be moving very slowly.

Which is a shame, because that $450 a lesson I mentioned earlier? More than half of that cost is fuel.

Performance Optimization WordPress Plugins by W3 EDGE