Posted by & filed under programming.

So of late, I’ve had the opportunity to work with the 2oceansvibe crew and one of the best advantages of the gig has been listening to 2oceansvibe Radio while coding. Major Plus!

So as it is, there’s practically no excuse for not getting in on the coolest radio station this side of the sun.
They have an iPhone app, a BlackBerry app, a web app and now a Facebook app in addition to being able to listen/stream from just about any media player (Real, Winamp, iTunes).

So, for kicks, here’s an audio streamer for the Mac, recompiled to default to 2oceansvibe Radio. Download StreamingAudioPlayer. Yes, you can listen through iTunes. And indeed, 90% of the times I would just use what’s already there (i.e. iTunes) but like most projects, it’s sometimes just cool to be able to roll your own, plus it’s a really decent sample codebase for an in-the-wild cocoa app.

All code on this project is originally developed by mattgallager and code can be found here on the project site.

Posted by & filed under Business, perspective.

So your company is looking to hire (again). The (dis?)advantage to the online space is that you don’t have to write an ad (carefully and though-provokingly) that needs to be circulated in print. However, it’s only an advantage if it translates into an opportunity to be as creative as need be (pictures! videos! woohoo). Sadly however, it seems that no matter how drunk the opportunity might be, it will never get taken advantage of.
Seriously. When last did you see a job ad that included *at least* one (non-stock) picture- or even some gratuitous colour?

Let’s say you’re looking to hire a developer/marketing guru/insert-job-title-here…
First question: who would be the best possible candidate (within your organisation) to strike a chord with other potential developers/marketing gurus/insert-job-titles-here out there seeking gainful employment?


Surely not?

I’ll talk from a developer’s perspective to illustrate my point.

Does HR really know how to communicate with another programmer better than a fellow of the realm? (unless of course that HR has had a career change, which is not unlike a sex change apparently)
I’m guessing not.

Does HR (or is this marketing’s influence?) also not realise that phrases like “fresh, dynamic company” apply to 99.99999% of all job ads out there. After all, who would advertise:

Boring, staid company seeks equally dull individual to maintain lack of office vibe.

So you’re effectively writing without really communicating when you drop phrase du jour into your ads.

Now also keep in mind that programmers, like any other jobseeker out there, are accustomed to reading 1000s of job ads. After a while, you can’t help but pick up the patterns, which, evidently is what a programmer is born, trained, paid, skilled and schooled to do. It’s like staring at those hidden pictures…

So the last thing you want to do is sound just like every other ad out there- unless the first thing you want to do is attract anybody who calls themselves a programmer. And in this day and age, it *is* scary at exactly what does flock towards the job title of programmer.

So here’s an approach: distributed problem solving. Get your developers to write the spec. Heck, get as many people in your company to write the spec.

Use HR for editing and to correct the offered renumeration. If your developers come back with…:

come slave away in our luxury offices overlooking the ocean with so much coffee on tap it would kill an elephant (seriously, George (UI) was taken to hospital twice last year with caffeine poisoning).
the pay is “ok” but the pointy-eared bosses don’t have a clue about things technical so you can just BS your time away and put up with the occasional demand.
overtime sux. at least the lan is wicked fast and we have uncapped ADSL with no firewall :)
p.s. my christmas leave just got cancelled thanks to an unreasonable deadline. bastards will pay!

Maybe you need to rethink hiring another head and spend some time “fixing” first?

But wait. You’ve also gained some valuable insight into the current group dynamic. That is an entirely different post altogether, needless to say, you can discern the inherent value therein yourself.
Oh, and one important tip: don’t give the task of writing their own job ad to your programmers with the air of a pointy-eared boss. At best, you’re going to get a copy-paste version. At worst, a one-liner: software developer required. apply within.

Done right, your devs communicating and reaching out to their peers works “better”. it’s more viral, more accessible, more appealing. It’s why the techie companies attract all the “cool” people because they speak the same language. But it doesn’t mean that just because your company doesn’t have a tech focus that it can’t do the same.

So here’s what i would like to see in a job ad:
It’s posted on youtube (for starters). It includes a view of the offices and some insight to the people i’m going to be working with; kinda like a:
“hi. my name is Martin. I’m head of engineering here at insert-company-here. looking forward to meeting you. bye.” and so on with key people.
and please include the receptionist. i’d also like to see footage of the coffee machine (in working order).
i would like to see/feel the buzz/vibe on a normal day. don’t go overboard with editing; candid is good.
and of course, i wanna see hardware. that’s important too. and workspaces, collaboration spaces and chill spaces.
you don’t have to give any secrets away, but if you can capture your ogranisation, it sells itself.

and if you can’t… erm… yes, well.. erm… right. look! ooooh. shiny.

Posted by & filed under programming.

Generics has undoubtedly made life a lot easier in the world of 1s and 0s and so this code snippet will only deal with the generics version since the code reads a lot easier. This is also a great bookmark post for future reference…

public class Foo {
 public string Alpha {get;set;}
 public string Omega {get;set;}

This shouldn’t bother you too much, we just got Foo. Nice. But now we want to sort a bunch of instantiated Foos, as a “once-off” ascending, according to Alpha.

List<Foo> result = new List<Foo>();
results.Sort(delegate(Foo lhs, Foo rhs) {
                     return lhs.Alpha.CompareTo(rhs.Alpha);

Straightforward. Using the anonymous delegate to achieve that once-off without creating an unnecessary class. You might think you could do the same thing with BinarySearch.

Foo sample = new Foo{Alpha="a", Omega="z"};
results.BinarySearch(sample, delegate(Foo lhs, Foo rhs) { return lhs.Alpha.CompareTo(rhs.Alpha); });

But you can’t. In this case, you actually do need to create an unnecessary class.

Foo sample = new Foo{Alpha="a", Omega="z"};
srchIdx = results.BinarySearch(sample, new FooAlphaComparer());
internal class FooAlphaComparer : IComparer<Foo> {
			public int Compare(Foo lhs, Foo rhs) {
				return lhs.Alpha.CompareTo(rhs.Alpha);

Same one liner in the Compare function, but this time, it has to be a class.

However (there’s always a BUT somewhere even if you call it a ‘however’), with a bit of kung-fu and ninja superpowers (apparently) there is a way to plumb this and make it work- but i tend to shift the complexity in other areas of the problem domain. It gets complicated. Moving right along…

For interest sake, you want to compare by Alpha AND Omega?

public int Compare(Foo lhs, Foo rhs) {
  int cfA = lhs.Alpha.CompareTo(rhs.Alpha);
  int cfO = lhs.Omega.CompareTo(rhs.Omega);
  if(0 != cfA) { //Alphas are not equal
    return cFA;
  } else if(0 != cfO) {   
     return cf0; //Alphas are equal but Omegas aren't
  } else {
    return 0; //Alphas are equal and so are Omegas

Posted by & filed under Technology.

If you’re using zaFin on your BlackBerry or using any of the published data via webfeeds, you should note that the data has been updated to reflect the latest changes in the prime lending rate as well as the most recent CPI figures (still waiting for August to be released which should be fairly soon).

On your BlackBerry, click on Update and then *Fetch Latest CPI Values and *Fetch Latest Lending Rate Values.

Posted by & filed under Technology.

There are too many reasons why I Love My Mac. And I’m not an Apple fanboy mind you. The iPhone? No way, hose. BlackBerry all the way otherwise, Android or bust. Noooo, the reasons I just simply love my Mac is because it just works (like the brochure says).

Took a new entry-level MacBookPro and swopped in a SSD. Whooaaa. Speed. Seriously. My SSD Rocks. The daunting problem was getting up and going again with all my applications, emails, developer configurations, blah, blah, blah…

Hello, Time Capsule. Hello, Migration Assistant. Hello, Joy. In less than an hour, I’ve got my “old” machine back, on a brand new harddrive, on a brand new spanking machine. And it just works!

I’m so happy right now

Posted by & filed under programming.

I (along with probably 1 000 000 other people) have found the self-help series of Dummies books quite amusing on different levels. As the saying goes, if I had a penny for every time “… for dummies” comes up in a situation joke…

Now there are a number of dummies books covering a host of programming topics. I would be surprised if they haven’t covered every mainstream language, framework and toolset available to the masses. Of course, there’s always “… in 24hrs” to cover what’s missed: C++ in 24hrs. You’ve got ask yourself: “Why, with the abundance of literature available, would a graduate want to spend 3 years (or more, sometimes involuntarily) studying something which can be studies in 24hrs?”

Well, truth be told: software is hard. It’s a popular quote, I’ve said it before and “kids” will probably still be quoting it generations from now. The only thing I could add to that quote is the word “really”. Software is really hard. Not all of it. Not all the time. But it is. Really.

Neither a dummies book, a 24hrs book, or even a 2 week course in learning how to code in c# is going to make you a programmer. In fact, no amount of certification is going to certify you as a competent programmer. The one common trait between certified (and good) programmers and not certified (yet good) programmers is the time spent on the keyboard. Voluntary time. That, and an odd fashion sense says I who doth dare venture out to the mall in my PJs.

Time behind the keyboard is a way of life. You need to develop (if you haven’t been born with it) a particular style of thinking and a particular approach. It’s not a one-style fits all either. There is no ultimate secret recipe to be a programmer (except for the time behind keyboard thing- and quite possibly the poor fashion). In KungFu, you can study the Crane, Tiger, Praying Mantis, Monkey and Snake and there are probably more too. In programming, there are no definitive animals to master. It’s more like a zoo from Star Wars. Looks like Monkey, walks like Snake but eats like Duck. It’s not too important what approach you have, so long as it does the job proper (sic).

Afterall, software is -really- hard but not always rocket-science (the two concepts are mutually exclusive). So don’t be fooled by dummies. It’s simple but not without complication. It’s straightforward but never cut-and-dried. It’s easy but really hard.

Posted by & filed under Technology.

There’s been a lot of excitement in the local ADSL market with prices getting better and better and now with the lines being upgraded to 10Mbps, things are getting even better. If you need to check wether your line is eligible for a 10Mbps upgrade, check here on Telkom.

I once read the question that asked wether the bandwidth limitations do in fact impact on our behaviour (and hence performance in the education/business world).

For example, at the time of writing, a 5GB cap on bandwidth “seems” like a lot of bandwidth for home (or small office) users; and let’s say that’s on a 1024 kpbs line.

Now would getting 15GB (for the same price and maybe bump up the line speed at the same time) really make a difference to how you use the internet? Surely if you get by on what you got, getting more is not really going to affect you? Well, to argue by hyperbole, how would “no cap” change the way you use the internet?

Would it make you more productive?
Would your (small) business benefit from the boost- in a measurable financial way?

Or what about on the negative side; would it syphon time away from “real” world activities into the virtual world of increased time spent on social networking and virtual marketing. Is that so bad?

Whatever answer you come up with, the boost does impact on your home (or small business) at least in the short term. Think of a toddler who has been denied Smarties only to arrive at a birthday party with a bowl full of Smarties in the middle of the table (within easy reach) for everybody to snack on. And for one thing, it makes the cellular provider data bundles an absolute joke, trying to “sell” you increments of 10MB. But that’s a different rabbit hole..

Posted by & filed under programming, Technology.

It’s not uncommon when moving across to the BlackBerry platform, to get a little confused or even frustrated. It’s a “who moved my cheese” series of moments because in reality, “we” tend to expect that BlackBerry will do things in exactly the same way as “our” previous handsets. And when it doesn’t, “we” might think it’s broken. Truth be told, BlackBerry does do a lot of things a little differently and IMHO those differences are what make it great.

I see the same kind of frustration when users migrate from Windows to Ubuntu or Mac.
I see the same kind of disappointment when users switch from Symbian to BlackBerry.
I see the same kind of disillusionment when developers switch from [insert-language-of-choice-here] to Ruby.

Security prompts on the BlackBerry platform are one of those areas that come up for discussion quite often. To understand “why” it does things the way it does things, here’s an 8min video clip which is extremely useful in explaining that. You decide wether that’s good or not, but whatever conclusion you come to, remember, it’s just the way it is.

Personally, I think giving the user (or the BES admin) the final say and control is the better policy when you start examining all the other options available.

Yes, it can be argued that it does demand a level of sophistication on the user’s part, but like anything out there (be it a carving knife, a phone, an OS, an application, a motor vehicle, a bank account or a piece of sports equipment) your understanding of that “thing” is directly related to your proficiency and enjoyment in using that “thing”. A phone, even a BB, is no different.

Posted by & filed under programming.

I’ve mentioned Heroku a couple times before in my posts and I mention them again today. I was impressed way back then when I started 2 years ago, and I’m further impressed today.

I finally managed to get around to moving Morty from the now deprecated HerokuGarden onto the Heroku platform. And it was a cinch! (just one little surprise on the .gems file tripped me up easily sorted though)

The heroku gem makes life (too?) easy and even on a the most basic of basic (read: free) deployments, Morty is running pretty smoothly.

Posted by & filed under programming.

When whipping out the Josephus game, I used Jasmine to write the tests… er.. spec for anticipating the behaviour of the code. Among the many reasons I use a “test-driven methodology” (even in the smallest of projects) is that I like to (nay, NEED to) keep a close eye on the strategic direction of the code while I’m minutely engaged in the technical direction. And a picture like this is so easy to read: