Tag Archives: hacking

On Hacking and Sharpening Tools

Mrs. Woo watched Monty Don. That always means trouble. Monty said ‘we’ must stake our raspberries at the weekend. He appeared to use brand new fence posts for the job but our raspberries came under the fence from next-door, so I wasn’t going to spend money. Last year, I replaced half a dozen cross-members in fence panels, so they’d  do. They were triangular in section, like carpenters’ pencils, which I sharpen with a Stanley knife. I couldn’t see any reason why the operation wouldn’t scale. I fetched my hand axe and started to whittle, at industrial scale. In my head, I was already writing a Tweet about hardware hacking.

I soon knew that I should have sharpened the blade before I started but it might take me ages to find the sharpening stone and some oil. I could even remember thinking the same the last time I used it. It might have been worthwhile if I had a bigger herd of yaks to shave but this wouldn’t take long.*

An axe is an interesting tool, relying on the momentum of the head, once the cut has started. Unfortunately, when hacking tangentially at a lump of wood, getting started is the biggest issue and this depends on blade sharpness. The more my efforts honed each giant pencil, the slower I progressed. When I was close to finishing each one, any possible last stroke seemed to have a more than equal chance of breaking off any point I’d created. It wasn’t until I’d had a particularly frustrating time with the last piece and was gripping the axe head between both hands, trying to use it like a chisel that I remembered my Dad’s old spoke-shave. I was long past the point where going and sharpening its blade, so I could use an appropriate tool, would have been a wise move. If I was going to do that, I might as well have sharpened the axe two hours ago.

There IS a point to this story, beyond self-flagellation. Hacking techniques are great for immediate, fast progress, and the sharper your tools the faster you’ll travel, so investing in preparation can be cost-effective but sharp, crude tools can only take you so far. I hadn’t been aware enough to see that I’d moved into the precision stage of pointy-stick development and should have changed to precision tooling, the low gear of change implementation.

The archaeology bit

Have you ever watched a pre-historic archaeological dig on TV? Sometimes they find a few flint axe-heads which they get very excited about and loads of flint scraping tools which they say were probably used for scraping animal skins. They should try sharpening a stick with a hand axe. I think our ancestors were busy incrementally inventing the spoke-shave. I wouldn’t be at all surprised if the wheel was invented by a stick sharpener, probably a woman, as she chuckled at the men showing off how many rolling-logs they could carry at a time.

* – For “yak shaving”, see The Jargon File.
http://www.catb.org/~esr/jargon/html/Y/yak-shaving.html
Beware: it is a yak watering-hole and many of them could do with a trim.

Hacking on Apple Hardware

Over the last few days I’ve discussed with a few people the origin of the word “hacker”, meaning someone who makes useful items with an axe. Having recently sharpened an axe, I decided that no phrase can be taken too literally when you only have yourself to amuse. I needed a stake to support a wobbly apple tree we planted at the bottom of the garden, so I decided there was no better solution than to fashion my own from the first hazel branches we cut last year. It turns out that I’m a natural axe hacker; probably all those hours whittling as a lad and the preference I inherited from my Dad to sharpen pencils with a knife rather than a pencil sharpener. I got my hardwood stick so sharp that when I tried to carry everything, I  cut my finger on the point. Never has the phrase “sweat and blood” been more appropriate for a project. At the end, I had confidence that if I was ever lost in a forest with only a sharp axe, within half an hour I could produce a pointy stick with which to defend myself. I suddenly realised that I’ve worked on software projects like that too.

Flushed with my success and with no in-house health & safety accident recording system to slow me down, I determined to complete another hardware hack before bed. I needed to debug why the new water-butt wasn’t filling from the old down-pipe bypass system which had worked faultlessly for a couple of years. I’d had a cunning theory that as the new butt was taller than the old one (“I like big butts and I cannot lie”,) there was insufficient height differential for the water to overcome the bypass system. It had worked, I implemented the butt upgrade and then it didn’t work. It had to be that, NOTHING ELSE HAD CHANGED. I have worked in Information Systems for over 30 years and this thought actually went through my head. I ‘wrote a test’ (disconnected the pipe and put it over a bucket, as low as it would reach.) The test still failed.

I disassembled the water trap and identified the problem. I’m a trained engineer so please excuse any technical jargon: the pipe to the water butt was blocked by a big lump of slimy gubbins. I poked it out with my finger ‘because Real Man’. OK, I didn’t realise what it was in time.

I’ve worked on software like that too. At least, this time, I get free water from the sky to wash away my impure thoughts.

2014, My #YearOfCode

I used to program professionally in the 1980s, in Pascal, BASIC and FORTRAN after learning Algol 68 and a little LISP at university. I was what was known as a ‘3rd Generation language’ programmer. I wrote programs that ran on ‘dumb terminals’ and IBM 3270 ‘sreens’ for organisations that could not yet afford to buy relational database software. I stopped programming just as I’d helped my employers select their first Oracle database, so I only ever coded for the native file-system of the operating systems I worked on. I didn’t stop coding completely because I became a system manager of DEC VMS systems and continued to write ‘scripts’ in DCL (Digital Command Language) for several years. I eventually drifted off to work on technical projects, information risk management and several years ago, I moved to business process modelling in a graphical language called UML (Universal Modelling Language) and business analysis, most recently with Agile development teams. Agile teams work best when they are made up of ‘generalising specialists’ so I decided a while ago that it was time I got back into coding.

I’m a bit jealous of my friends who have the current software skillz to go on hack-days, help at a @CodeClub and otherwise ‘make’ the world a better place. Since I was ‘Senior Programmer’, software development has changed considerably. To start programming again now, I need to gain experience of databases and object-oriented design. I have the option of programming back-end server systems, for desktop Graphical User Interfaces or for web browsers. The languages I used are no longer appropriate for this new world and the programming environments and software libraries have changed.

I need to start from scratch and re-learn everything practical I learned in the computer science half of my degreee and more. How hard can that be?

I have options. I won’t be programming for native Microsoft or Apple environments on moral grounds, though I haven’t comletely runled out C or C#. As I like open systems and Free software, I could learn the scripting language of the Linux bash shell (Bourne-again shell) first. I could use Python as it is widely used in free software projects and is becoming a popular language for teaching, so there are plenty of tutorials available, or Java which is more widely used and still popular as a professional language. The best reason to learn Java is probably that it is the Google-approved language for the Android platform and can be used to write portable software. Or I could look to a web-centric future by learning the new open standards of HTML5, CSS and JavaScript, with a choice of environments, including PhoneGap and Mozilla OS.

So the options are quite simple really :-/

This week the government announced that 2014 is #YearOfCode. I’m going to take that as the kick I need, before I’m over-taken by 8-year-olds so I just told young @LottieDexter that if she can learn to code in an hour then so can I and I’ll start tonight. I decided I wasn’t going to bed until I’d written something that worked, so concluded that it was best to cheat.

Based on http://www.w3schools.com/js/js_examples.asp, here is my first JavaScript code.

<!DOCTYPE html>
<html>
<body>

<h1>World Wide Welcome</h1>

<script>
document.write(“<p>Hello world!</p>”);
</script>

</body>
</html>

See, Lottie was right. It IS easy! <Checks rear-view-mirror for kids>