Model-View-Controller song lyrics

Model-View-Controller lyrics

I’m reposting them here – the song appears to have a habit of disappearing, and these lyrics are too good to lose:

Model, View, Controller
Lyrics and music by James Dempsey.

Model View, Model View, Model View Controller
MVC's the paradigm for factoring your code,
into functional segments so your brain does not explode.
To achieve reusability you gotta keep those boundaries clean,
Model on the one side, View on the other, the Controller's in between.

Model View � It's got three layers like Oreos do.
Model View creamy Controller

Model objects represent your applications raison d'�tre.
Custom classes that contain data logic and et cetra.
You create custom classes in your app's problem domain,
then you can choose to reuse them with all the views,
but the model objects stay the same.

You can model a throttle in a manifold,
Model level two year old.
Model a bottle of fine Chardonnay.
Model all the twaddle stuff people say.
Model the coddle in a boiling eggs.
Model the waddle in Hexley's legs.

One, two, three, four.
Model View � You can model all the models that pose for GQ.
Model View Controller

View objects tend to be controls that view and edit,
Cocoa's got a lot of those, well written to its credit.
Take an NSTextView, hand it any old Unicode string,
the user interacts with it, it can hold most anything.
But the view don't knows about the Model:
That string could be a phone number or the words of Aristotle.
Keep the coupling loose and so achieve a massive level of reuse.

Model View � All rendered very nicely in Aqua blue
Model View Controller

You're probably wondering now.
You're probably wondering how,
the data flows between Model and View.
The Controller has to mediate,
between each layer's changing state,
to synchronize the data of the two.
It pulls and pushes every changed value.
Yeah.

Model View � mad props to the smalltalk crew!
for Model View Controller

Model View � it's pronouced Oh Oh not Uh Uh
Model View Controller

There's a bit more on this story,
a few more miles upon this road,
well nobody seems to get much glory
writing controller code.
Well the model is mission critical
and gorgeous is the view,
But I'm not being lazy, but sometimes it's just crazy
how much code i write is just glue.
And it wouldn't be so tragic,
but the code ain't doing magic:
it's just moving values through.
And I wish I had a dime
for every single time
I set a TextField's stringValue.

Model View � how we're gonna deep�six all that glue
Model View Controller

Controller's know the Model and View very
uahh � intimately
They often are hardcoding
which is very verboten for reusability.
But now you can connect any value you select
to any view property.
And I think you'll start binding,
then you'll be finding less code in your source tree.
Yeah I know I was astounded,
that's not even a rhyme.

But I think it bares repeating
all the code you won't be needing,
when you hook it up in IB.

Model View � it even handles multiple selections too
Model View Controller

Model View � hope I get my G5 before you
Model View Controller

Yeah, yeah, yeah. Yeah.

Excel 2007, 65,535 displays as 100,000 and testing

From Risks:

According to a *NY Times* blog (Pogue’s Posts), Excel 2007 for Windows doesn’t cope properly when multiplying two numbers that should yield 65535 (http://pogue.blogs.nytimes.com/2007/09/27/a-big-excel-boo-boo/).
Instead, it gets 100,000.

For a very nice explanation and discussion of its relevance, see Joel Spolsky, Joel on Software blog http://joelonsoftware.com/items/2007/09/26b.html

Have a look at Joel’s blog, and pay especial attention to the talk about testing – the fact that the bug appears to be in the presentation layer, and the testing is probably going to take results from before the presentation layer kicks in.

One more thing occurs to me. If there is this sort of bug that happens on 12 out of 18446744073709551616 possible cases, and it has only just been found, how many more are out there?

Stop telling me about bum_tnoo7@hotmail.com

Please people, stop telling me that bum_tnoo7@hotmail.com (or bu_tnoo7) is a hacker and I shouldn’t add him to my facebook account.

It’s already wasted far too much bandwidth, the message itself that is forwarded is technically rubbish, and you yourself are being used by the “virus” as the propagation mechanism.

Oh, and before I get a load of comments on “how do you know”, “what makes you an expert” – I teach a course on hacking to the Masters courses, and if you don’t believe me, then do some research yourself – http://www.sophos.com/security/hoaxes/facebook_hacker.html

Important

If you receive this or a similar message, please do not forward it to your friends and colleagues. Forwarding unsolicited chain letters wastes time and bandwidth.

How has the user experience changed in 20 years?

Reading Risks Digest this morning I came across a link to an article comparing a 1986 Mac Plus and a 2007 AMD Dual core. The question posed was how has the massive increase in computing power has changed the speed at which the most commonly performed tasks are performed.

“The most amazing achievement of the computer software industry is its continuing cancellation of the steady and staggering gains made by the computer hardware industry…”– Henry Petroski

Of course, some of you might already have guessed the outcome, and some might not agree with the tests as presented, but the fact is that the tests actually look pretty fair when you consider what most office workers do with their PCs.

Anyway you can read the article for yourself here on hubpages

CS259 students read this!

I’ve been beating CS259 about this sort of thing for more years than I care to remember, but it’s always good to have someone else putting it all so succinctly.

Take it away Josiah Cole

(thanks Claire)

iCal web publishing

iCal is a great application, but there are some things about it that bug me.

Apple really want you to pay money for their .mac service, and as such if you want to publish your calendars, it’s either that or set up WebDAV. Now I run my own server, and I could probably install WebDAV, but I’m really not that inclined to, so I decided to use a more portable way to publish my iCal files on the web server, and do it automatically in the background.

I was chatting with James today about the solution that I use that pushes the calendar from this laptop, which I regard as the “master” up to the web server, which runs PHP iCalendar. Of course, I use iSync to synchronise with my mobile phone, and I can make appointments on the phone and they will be imported into iCal at next sync, then to be pushed up onto the web at the next update.

But how to send the file to the web server? Personally I love ssh and especially when I have public key authentication set up properly so I don’t need to type my passwords, so I thought that it would seem sensible to use scp to push the files – I already have a hole in the university firewall for ssh into the box, so it will work from anywhere in the world, even without using VPN to connect to the University network.

So I dusted off my slightly rusty Perl skills and started lookiing at the files that iCal produces. I should probably explain that I used Sunbird for a while, but it was just too buggy to be used as a day-to-day application, so I switched to iCal.

So I now have a perl script which runs from my crontab every 15 minutes, and finds the title of the iCal file from inside the file, because iCal uses a unique name for each file, which is not very user friendly. It then compares each file title with a list of calendars to upload to the server and uses scp to copy the file onto the web server.

It’s currently pretty messy, still has a load of commented out debug code, and really needs a tidy up and a little more intelligence adding, but it works, and works well.

You can’t just copy this into a directory and run it – you really have to understand Perl to be able to customise it for your own use, but please feel free to use it as a starting point for your own development, and if you find it useful, please drop me a line.

You can find the perl program file, and my example data file in this directory.

LED Badges again

It’s visit day tomorrow, and I’ll be wearing my LED Badge.

I just had a comment on my last post from Brian, who would like a look at my source code, so I’ve put it in a directory for you all to download.

It’s a couple of java source files, which I have packaged into a jar file for you to download – there’s no compiled code in there only the source, I’ve only used the jar file to preserve the directory structure.

Anyway, it uses the serial comms libraries from rxtx.org, so you’ll have to download those, and install the runtime libraries in the correct place for your platform, but the program is in java, so change the serial port name in the code, compile it and run it.

Again, it’s not the prettiest of code at this point, but it serves the purpose at the moment, and when I get the time, I’ll try to improve and enhance the code.

Enjoy – you can download the code here: LED Badge java program code.

Eclipse IDE 5 years old!

Cnet has a story on how the Eclipse IDE is now 5 years old, and has a huge impact on the development process as well as proving how successful open source can be.
Eclipse is my tool of choice, and I’ve been using it for a few years now, whilst I only use a few of the features I do find it to be an incredibly easy platform to use, and the fact that it lets me get on with coding without getting in the way of my coding just fits the way I like to work, like using MacOSX.

Ubuntu Edgy Eft released

I’ve just upgraded this server from Dapper Drake LAMP server to Edgy Eft using apt-get dist-upgrade after changing all occurrences for dapper to edgy in /etc/apt/sources.list, and so far everything looks good.

There are some issues with the new release, but nothing that should affect this server – only things that might affect desktop systems.

It does have quite a lot of new features as standard including Firefox 2.0 and you can still download it unlike Fedora Core 6 which was avaiable for download for a massive 4 hours before it was pulled.

Release notes are here
Arstechnica article here

Crossing borders with laptops

Next time you cross a border with your laptop, don’t be suprised if they want to examine the data on it.
Ars Technica have just posted an article about examination of data in the US at international airports and borders. Don’t think that you’re safe in the UK either – they’ve been doing it since at least 1998 as reported by the BBC