Categories
perspective

Time Value of Money

The most useful “fun” utility on the zaFin suite was the time value of money calculator which basically allows you to compare the value of money at different times.
For example, how many times have you heard someone older than you mention the price of something way back when and then proceed to complain about the price of things today?
“When I was 25 years old, the price of bread was only 50c. Today, it’s R10!”
Well, 50c way back then was equivalent to just exactly how much today? Remember, all prices are relative, thanks to inflation. Things get more expensive, but we don’t still earn R150 per year (hopefully), right?
Nonetheless, the zaFin inflation and time value of money calculator will help put things in perspective for you.

Categories
perspective

To The Power Of, by hand

I’ve often needed to create a power function, as in 2^3 or more commonly Math.pow(2,3) = 8. However, sometimes, the Math.pow() doesn’t exist and the operator ^ is reserved for other useful functions or not recognised at all. In times like that, you need to hand roll- so here’s a good link to keep bookmarked.

Categories
Life perspective

The Next Round

So it was an incredibly busy end-of-year (2009) with exams, lifesaving, BlackBerry and .NET projects and family life. And then the festive season came and went; New Year’s slipped by and now we’re this side of 2010 looking forward to another round of whatever may be.
And right off the bat, tax season looms. Registration for university is on the go, lifesaving competitions get into full swing with some major events, followed by mid-year exams and winter. And then 3Nut (sprog #3) arrives and then (allegedly) the exponential busy-ness kicks in. So already, the first half of the year is underway at a pace. Which is New Year’s celebrations have always been foreign to me.
There’s this air of expectation around them like something “new” and exciting will be heralded in and when you wake up the next day and everything is supposed to be “different”. And because it’s New Year, you have a milestone whereby you can mark your life’s progress. Strange. Why wait to do that only once a year?
Every day is filled with new and exciting adventures. Every day is a milestone and an accomplishment. Every day is different and is definitively the last of _that_ day you’ll ever have.
So, today is the day you make a resolution; and if you resolve to do something, it means you do it- not just think about doing it. “Carpe diem” is the old expression (which i strangely don’t hear much anymore?) so seize the carp!

Categories
perspective Technology

Context Switching

It’s expensive, mentally and resourcefully, but it’s rewarding. It also isn’t easy, which is probably why it’s not advocated by the populous, but it is rewarding. And it’s filled with all sorts of risks and dangers, but definitely rewarding. Rewarding if you get it right.

After months on Rails (web), Python (web), Objective C (iPhone) and C# (web) projects, i’ve settled my teeth into a juicy little BlackBerry project. It’s taken a lot of mental effort to switch, and in particular, switching to the following:
* the language: Java. New syntax, keywords and run-time nuances in memory management
* the frameworks J2ME and RIM: what do they offer where are all the packages
* the IDE (Eclipse): how does it work and how to customize your environment/experience, and then what else does it offer that no other IDE to date has offered
* the BlackBerry device: where, what, how does it do the things it does
* the unit tests (jmunit cross bunit): new language, new platform, new test harness, same procedures (more or less)
* runtime debugging tools with the simulator and component packs
* mobile development: patterns, architectures, design and development principles
* the UI: a whole new playing field where the only place in the world Managers are your friends
* automated building and testing (still getting there)
* code control and IDE integration

Every day is filled to the brim with slow progress punctuated by episodes of breakthrough bubbles, although a the days wear on, the bubbles are more frequent and the productivity increases naturally on a curve on its own.

The end result: another framework, platform, language, set of tools available at my fingertips to enable me to express a solution to a problem and then successfully execute that solution without too much limitation.

Spin-offs include restless nights, lots of “aarrggg’s”, a lot of debugging and a whole lot more muttering which usually starts with “now how do you do that?”. And that right there has been one of the greatest little nuggets- tackling a project like a n00b, a grom; with all the enthusiasm naivety brings, but with experience (ok, age).

Categories
perspective

Golden Section Search

For me, implementing code really helps me to understand the algorithms (i need to know) better. It might sound a bit odd in that you might need to understand the algorithm before you can implement it. And that’s partially true. An understanding is definitely required. But, with TDD and iterative processes ingrained, discovery of what makes the algorithm tick is made possible through doing it (by repetition and/or implementation).

Repetition helps you to understand it and use it. Implementing it in code is like rediscovering the algorithm from the beginning. It’s a small taste of that journey- and it’s addictive 🙂 Anyhooo, the Golden Section Search is not an exception- but surprisingly trivial. Maybe it was just all the fluff around the topic that got me distracted….

class Golden
  ...
  def search(tolerance)
    return if(@b - @a) <= tolerance

    dif =R*(@b-@a)
    x1 = @b - dif
    x2 = @a + dif
    vx1 = i_eval(x1)
    vx2 = i_eval(x2)

    if(vx1 > vx2)
      @b = x2
    else
      @a = x1
    end

    search(tolerance)
  end
  ...
end

“i_eval” just evaluates the formula you supply (and uses the built-in Ruby expression evaluation) but the part that makes the grok for me is the if(vx1 > vx2) bit.

The way the text books explain it is pretty long-winded. The interval of uncertainty changes, but you’ve got the unknowns a,b,x1 and x2 floating around and changing positions all the time during the explanation. Plus you’ve got to now try remember case 1, case 2 and case 3. Eish. And all that inter-mixed with function and set notation. But that can be maths for you: pick any number between 0 and 10 => pick any integer from the domain of real numbers over the interval from, and including 0 to, and including 10.

The short of it lies in… :

‘b’ changes to x2 if vx2 [or f(x2)] is smaller (or equal) and
‘a’ changes to x1 if vx1 [or f(x1)] is smaller ..

… for the next iteration, everything else keeps the same value. That’s it.

And graphically, it also makes more sense to simplify that for one second and draw the lines in and see how ‘a’ and ‘b’ move along the axis iteration after iteration. Once that’s settled, going back to the ever pedantic yet accurate language of maths is then a whole bunch easier.

Categories
perspective Technology

Software Guarantees

It’s a long time coming: consumer protection for software. And it’s a good not altogether bad thing. How much software out there promises the world but delivers nothing but a world of headache? Of course, the devil is in the details and how they go about enforcing that is going to be interesting. Can you imagine the legal copy? Of course, this opens up the world for computer forensics in a big way. We might even get a new show: CSI Brussels, the Bits-n-Bytes version. Ha.

But from an engineering perspective, this kind of move will most certainly sift out the hype from the functional (and create more of a different hype) and all the war around the best technology might abate (while the war between lawyers rage) so that the job can just get done by those actually doing the job and knowing how to do it (which, by this stage will not be many). It also means developers will choose their tools more carefully and with more consideration and be less prone to just adopting the next best thing just because it’s the next best thing. Which, in turn will impact the software tool market (probably negatively though). Who’s going to write code to interact with a service (or even allow interaction) if you got no control over how the other end of your integration works and you could possibly get sued for thrice more than you earned on the job. Imagine the insurance?

Of course, i’m assuming that the implementation of this kind of policies (or others related to it) is well though-out, fair and just 🙂 The evil side to this kind of policy is just too staggering. That’s something for the budding authors (of CSI) out there to write about…

Categories
Life perspective

Your Word

In days of yonder (although, probably more of a romantic legend) “your word” used to mean quite a bit. No legal fluff or long-winded contracts- it was your word that counted most. Today, that still is true, but we also have legal contracts because, i guess, in days of yonder, much like today, people renege on their word for various reasons. And that is a complex issue on its own, but reasonably i see it as primarily coming down to not taking your own word seriously enough. The opposite of that is interesting…

And by word i do mean commitments and promises, both explicit and implicit. Explicit as in “I promise i’ll get that done by tomorrow” and implicit as in “Sure, i can do that by end of day”.

So the opposite is that you take your own word so seriously, you check yourself at every turn and make no commitments or promises, either explicitly or implicitly. Your speech changes to “I might have that done by the end day, but no guarantee”. It is a lot better in terms of expectation management, being realistic and does give yourself room to breathe a little; even under-promise somewhat. As a default, neither are great.

On the one side you get to disappoint a lot of people through broken commitments, and on the other side, you get to disappoint yourself because you never get to challenge yourself. It’s one of those situations where neither end of the spectrum really works, and the middle ground is pretty soft. The best is to fold the spectrum back on itself.

Take your word seriously AND make big (not brash) commitments (and then pull it off). Of course, the wisdom and grace to get that perfect won’t come without a bruised ego, but, like i read once, it’s hard(er) to stumble when you’re on your knees. Don’t be scared to commit and give yourself a challenge and then take your commitment seriously enough to see it through.

The ultimate is like saying “I do”. It’s not “I might” or “I could” or “I probably should”. Commit, lock and load and make it work. The fruit is way more than you could ever positively dream of.

Categories
Life perspective

Underneath The Radar

No, this is not an attempt at trying to revive an 80’s hit. It’s just my status quo. Watching people, watching me sort of thing. And there’s plenty going on right now. (But it’s still a pretty funky song in it’s own way)

In SA, we have an absolute mess of a political cam-pain *sic*; too boring and complicated to ever make it onto an episode of any soapie worth its suds. Politicians just blabber ****; the clamorous dings of empty gongs polluting the space inside my head and on the local internet. And i checked, our news is so boring, and so over-hyped, it doesn’t even make a small headline on bbc, sky or cnn. Let alone the Afghan Times. Apparently, the new Beatles album is more newsworthy than a southern african political party leader getting off the hook for corruption charges- despite threats to bring ’em all down and not because he’s not guilty. And there are very big differences between “not guilty” and “innocent”. Ah well. Karma’s a bitch, right?

(And i don’t think it’s worth even touching on “the economic situation”- oh my goodness! If there ever was a phrase in danger of losing it’s vitality, meaning, pillow and marshmallow- that one deserves a righteous nomination. *Everyone* is suddenly an economist with an opinion- double you tea eff?)

On the other side of life though, tech is kinda stale. Some tech- not my tech 😉 Domains are dying (which is a funny read, btw). There’s Windows 7: the yawn version, is coming up. And more politics around that. Apparently it’s a bit of a boo-haa that you cannot upgrade from XP to 7. Shame.

But from all that fuss, i’ve learned one very important lesson: the media trashes your mind (not actively but by consequence) and robs you of your vibe- so be careful of what you fill yourself up with. They have no market in talking about the really cool things that are happening. And there’s also too much of that happening all over the world right now… but that too, it seems, remains underneath the radar.

Categories
perspective

While The Politicians Dance

At home (that’s SA, not USA; although….), the politicians continue their frenzy of politicking. It’s great for them, i guess. They get to spend all their (paid) time to do what they studied to do (and perhaps the only thing they know how to do?): launch political strategies, talk about each other, spend money, campaign; pretty much everything except get down and solve the real problems.

Health, education, safety, housing, food, energy… these issues are not so important it seems. While all the politicians dance, the “guy on the street”, the ones working 8-5, 6-6 or not at all, are the ones bearing the burdens and suffering the patience of a long-awaited non-delivery. We have to be content with watching our money being diverted from the promised land into more airflights, suits, lunches, breakfasts, t-shirts, stickers, petty (and not so petty) court cases…

Of course, the argument is that these breakfasts and continued (boring) media tantrums are important enough so that the rest of the real work can start happening properly, with the right people in charge. And there’s truth to that. But the obvious responding question: “then why is there more politicking than delivery?” is never really answered. Except to say, well, because it’s really important to get that sorted so that the right people can start to do the work properly.

The irony is, the right people for the job are the ones who get busy just doing it, regardless. But they would probably never dream of being distracted from getting on with their job and “run for office”. ‘Cos, well, that’s all it is: running for an office. Maybe if we gave our politicans cubicles instead, there would be less of them “running for cubicles” :p

Categories
perspective

Piracy

I been biting to write on this for a bit now… piracy. Music, movie, software, whatever. If you illegally “own” it, it’s piracy. And not agreeing with the law is not an argument to support your position and justify your actions to pirate anything. Not even a TV-episode. This wouldn’t be such a huge problem, except that….

A lot of people in this country (South Africa) complain about crime. No argument there. We live in a particularly violent and crime-riddled country at the moment. Does that mean that “lesser” crimes cannot be considered as crimes since we reserve the word crime for rape, murder, hijacking, theft…? Certainly not for copying a music CD, software program or even documentary. You can hardly call that crime, now can you? Or can you?

Indeed you can. The lawmakers of this (and other countries) deem that illegal. So it’s criminal. You break the law, you’re as lawless as the rest of the bunch. When you start to complain about the lawlessness of the country, and own (heck, even redistribute) illegal media, you border on major double-standards. And if you are actively not campaigning against the lawmakers to actually change the law (doing anything about the situation) you’ve got a long way to go, a big mouth to match.

When the laws change, superb. Copy to your heart’s content. Until then, buy legal.