Monday, November 12, 2012

Mad Hacking Skills

I always find myself vaguely embarrassed when someone tells me that they wish they had my hacking abilities. Why? Because it's just a natural progression. It's not something I have or not have. It's an accumulative thing. It's a bit like maths...

I told a friend recently that exponents was just a natural progression and then I had to go on to explain it. If 2+2+2+2 is long hand for 2x4, then 2⁴ is short hand for 2x2x2x2. When you think about it in those terms, it becomes something not so special and just a natural progression.

Just as a side note: 2ⁿ is demonstrable by folding a piece of paper. 1 fold gives you 2 rectangles, 2 folds 4 rectangles, 3 folds 8 rectanges etc.

If only angles were that easy to explain... eg. why do we work off 360°?

So last year I showed one of the kids how to hack the high scores in a game that seemed to be running rampant in that particular class. The idea being that it was a teachable moment. Rather than berating them for playing the game, I figured it'd be much more interesting to teach them something - like a little bit of hacking. Fire up a text editor, show them how to make hidden folders/files visible and edit a file.

The game then became about how high they could set a score without getting an overflow error (basically, a computer stores information in a certain number of bits which gives them a range of numbers they can represent. Go over this value and you get an "overflow error". So in a 8 bit number, I can represent values up to 255. If I try to put 256 in there, I get a wrapped around value - in this case, 0 - actually, there's a little more to this. If I'm dealing with a "signed" value - that is, being able to represent negative and positive numbers - the wrap around value is quite a bit different. And it gets even more complex with "floating point" numbers - where I can represent a "real" number - those with decimal points in them).

This year I learnt that this same kid has learnt how to use the "javascript console" in Chromium browser to hack his online maths games. While possibly a loss for maths skills, I can't help but feel a certain amount of .... pride.

So in terms of hacking - it's actually really not hard. You're simply building on the efforts of others and yourself. You learn you can edit a text file. And from a text file, you can figure out how to parse (process) that file. And now you're in the realms of programming and soon realise that a lot of programming is maths and parsing strings with a bit of flow charting.

To my mind, a much more interesting skill is being able to see requirements and use those hacking skills to produce something that solves the problem in question.

Of course, this isn't in line with the whole media inspired anti-social definition of the word "hacker" - but that's a whole other story.

1 comment:

  1. The number 360 for a complete circle was just made up. There is no logical reason why it shouldn't be something else but it divides nicely with common numbers so people just use it.

    The SI unit for angle measurement is a radian (a complete circle is 2π). It makes much more sense than degrees but it's harder to use in real life - we all have a feel for 30° but π/6 doesn't mean much to most.