Practical computing

This looks set to be my final post of this series about the history and functional mechanics of computers. Today I want to get onto the nuts & bolts of computer programming and interaction, the sort of thing you might learn as a budding amateur wanting to figure out how to mess around with these things, and who’s interested in exactly how they work (bear in mind that I am not one of these people and am, therefore, likely to get quite a bit of this wrong). So, to summarise what I’ve said in the last two posts (and to fill in a couple of gaps): silicon chips are massive piles of tiny electronic switches, memory is stored in tiny circuits that are either off or on, this pattern of off and on can be used to represent information in memory, memory stores data and instructions for the CPU, the CPU has no actual ability to do anything but automatically delegates through the structure of its transistors to the areas that do, the arithmetic logic unit is a dumb counting machine used to do all the grunt work and is also responsible, through the CPU, for telling the screen how to make the appropriate pretty pictures.

OK? Good, we can get on then.

Programming languages are a way of translating the medium of computer information and instruction (binary data) into our medium of the same: words and language. Obviously, computers do not understand that the buttons we press on our screen have symbols on them, that these symbols mean something to us and that they are so built to produce the same symbols on the monitor when we press them, but we humans do and that makes computers actually usable for 99.99% of the world population. When a programmer brings up an appropriate program and starts typing instructions into it, at the time of typing their words mean absolutely nothing. The key thing is what happens when their data is committed to memory, for here the program concerned kicks in.

The key feature that defines a programming language is not the language itself, but the interface that converts words to instructions. Built into the workings of each is a list of ‘words’ in binary, each word having a corresponding, but entirely different, string of data associated with it that represents the appropriate set of ‘ons and offs’ that will get a computer to perform the correct task. This works in one of two ways: an ‘interpreter’ is an inbuilt system whereby the programming is stored just as words and is then converted to ‘machine code’ by the interpreter as it is accessed from memory, but the most common form is to use a compiler. This basically means that once you have finished writing your program, you hit a button to tell the computer to ‘compile’ your written code into an executable program in data form. This allows you to delete the written file afterwards, makes programs run faster, and gives programmers an excuse to bum around all the time (I refer you here)

That is, basically how computer programs work- but there is one last, key feature, in the workings of a modern computer, one that has divided both nerds and laymen alike across the years and decades and to this day provokes furious debate: the operating system.

An OS, something like Windows (Microsoft), OS X (Apple) or Linux (nerds), is basically the software that enables the CPU to do its job of managing processes and applications. Think of it this way: whilst the CPU might put two inputs through a logic gate and send an output to a program, it is the operating system that will set it up to determine exactly which gate to put it through and exactly how that program will execute. Operating systems are written onto the hard drive, and can, theoretically, be written using nothing more than a magnetized needle, a lot of time and a plethora of expertise to flip the magnetically charged ‘bits’ on the hard disk. They consist of many different parts, but the key feature of all of them is the kernel, the part that manages the memory, optimises the CPU performance and translates programs from memory to screen. The precise translation and method by which this latter function happens differs from OS to OS, hence why a program written for Windows won’t work on a Mac, and why Android (Linux-powered) smartphones couldn’t run iPhone (iOS) apps even if they could access the store. It is also the cause of all the debate between advocates of different operating systems, since different translation methods prioritise/are better at dealing with different things, work with varying degrees of efficiency and are more  or less vulnerable to virus attack. However, perhaps the most vital things that modern OS’s do on our home computers is the stuff that, at first glance seems secondary- moving stuff around and scheduling. A CPU cannot process more than one task at once, meaning that it should not be theoretically possible for a computer to multi-task; the sheer concept of playing minesweeper whilst waiting for the rest of the computer to boot up and sort itself out would be just too outlandish for words. However, a clever piece of software called a scheduler in each OS which switches from process to process very rapidly (remember computers run so fast that they can count to a billion, one by one, in under a second) to give the impression of it all happening simultaneously. Similarly, a kernel will allocate areas of empty memory for a given program to store its temporary information and run on, but may also shift some rarely-accessed memory from RAM (where it is accessible) to hard disk (where it isn’t) to free up more space (this is how computers with very little free memory space run programs, and the time taken to do this for large amounts of data is why they run so slowly) and must cope when a program needs to access data from another part of the computer that has not been specifically allocated a part of that program.

If I knew what I was talking about, I could witter on all day about the functioning of operating systems and the vast array of headache-causing practicalities and features that any OS programmer must consider, but I don’t and as such won’t. Instead, I will simply sit back, pat myself on the back for having actually got around to researching and (after a fashion) understanding all this, and marvel at what strange, confusing, brilliant inventions computers are.


Muscle time

OK, time for part two of my ‘gym-less workouts’ guide, this time dealing with the important stuff- muscular strength. Strength is a fairly blanket term, covering every one of the (numerous) muscle groups, different motions and the various aspects of size, explosive power, maximum strength and endurance. The general rule that applies to pretty much any exercise is that less reps on a higher load (so more weight, more difficult technique, doing the motion in a slower, more controlled fashion etc.) will build more power and strength, whereas more reps on a lower load will build lean, wiry muscle built for speed and endurance. It’s also important, as with fitness exercises, to do a quick warm-up to ensure your muscles are ready for work- this generally takes the form of a few very easy exercises just to get them moving and the blood flowing. A quick note on sets and reps too- it is standard practice among gym goers to do exercises in ‘sets’ (normally three of them, but any number from 1-5 is fine), each of them containing a fixed number of repetitions, or ‘reps’ of that exercise. Each set is separated by a break of anywhere from 30 seconds to 2 minutes. This way of working allows you to do more stuff than you could in a single sitting, but the resting and then reworking of your muscles will also pay dividends in terms of effectiveness. I have tried to offer some advice as to the amount you should be doing, but adjust to whatever feels right for you. Try to set yourself small, achievable targets to work towards, as these can be the difference between somebody who turns into a muscle-bound hunk to just a bloke who works out and always looks the same way.

One final thing- it’s not good to go and blow yourself out with a high-intensity session every day. These exercises are probably best done in one big ‘gym session’, and if you cycle through the various exercises, giving that muscle group, rather than your whole body, a rest, then this circuit training will be a great fitness workout too. But they can work just as well done whenever is most convenient, and trying to do a big session every single day will just tire you out to the point at which your muscles can’t recover (and thus can’t build effectively) and you won’t be able to keep up a good intensity. A gym goer will rarely do more than three sessions a week, with rest days spread between them , to ensure maximum effectiveness. Sessions should also be well planned in advance (it makes sense for anyone who wants to get serious about this to plan a weekly routine and just change the number or reps & sets as you improve)- good planning separates those who are always improving and the blokes who go to the gym three times a week for years and never look any different.

OK, now to start on the actual exercises (for which a rucksack will be necessary for a number of the exercises), working from the bottom up:

: Quadriceps (quads) are located at the front of the thigh, hamstrings (or ‘leg biceps’) at the back and calves down the back of the foreleg, behind the shin bone
Exercise: Run. Or cycle, if that’s more your thing, but to my mind you can’t really do better than running- it’ll do everything. Sprint sets, running as fast as possible over short, 20 metre distances, will work for strength (try sprinting out and then back-pedalling for a good, mixed workout)- sets of 10 sprints, separated by a minute rest, should do nicely, increasing the number of sets you do as you get fitter and stronger. A good run at moderate intensity should will work wonders for both muscle mass and endurance- it should start to hurt from about 10-20 minutes onwards, in both heart and legs, but try to push on through the pain and it’ll be worth it. However, if you feel a stitch coming on then slow to a walk and take a rest for it to subside, otherwise you’ll be in for a very uncomfortable time and you won’t work as effectively. If you can manage regular half-hour runs, at whatever speed you can, that will do nicely
If you really want to work on your leg strength but for some reason don’t want to do sprints (wanting to mix it up a bit is a good reason- laziness is not!), then load up a backpack with as much weight as it can take, and stand with feet shoulders-width apart. To work the quads, squat down as deep as you can, trying as much as you can to keep your feet flat to the floor, and then stand up- if you really want to feel the burn then do so as slowly as you can. Three sets to destruction (as many as you can do), with a 90 second rest between each should work. For calves, just go up onto tiptoes and back down again repeatedly. These should be done as quickly as possible for as long as possible- but make sure your calves are well-stretched beforehand, as they are particularly prone to cramps and pulling. If this is too easy (which it probably will be), try doing it on only one leg at a time, and do lots of fast reps

 As the name suggests, in the abdominal area- around the belly. These muscles are what form a six pack, and are often hidden by a belly- so if you want to show them off, you’re going to need to lose the flab (which I have yet to do!)
Exercise: There are a huge variety of abdominal exercises you can do- sit-ups, medicine ball drops, leg raises etc.- but one of the most reliable is crunchesLie with your back flat on the floor, hips and knees forming right-angles (so your shin should be parallel with your back). Grab your ears with your hands (you can let go if you’re used to the motion, but it helps to prevent your arms swinging you up), and sit up very slightly, pulling your shoulder blades just off the floor and touching your elbows to your knees. Then drop back down and repeat. Try to keep your knees in position, and do not pull yourself up with your arms. All abdominal exercises are done in an isotonic fashion (low load, fast motion, high reps), and this is no exception- crunches should be done as fast as you can, each one ideally taking around a second (but if you can’t quite keep up then don’t worry- it’ll come). After 20-30 reps, your belly should start to hurt- keep on pushing until you physically cannot do any more. Then take a 90 second break and do another set to destruction, for as many sets as you can do comfortably.
Another muscle group typically grouped with the abs are the obliques, which are similar muscles down each side of your body. A lot of exercises (and gym goers) tend to ignore them, but they are important nonetheless. A small adaptation to crunches can work the obliques- when lifting yourself off the floor, twist your body so that your right elbow touches your left knee. Then, on the next rep, touch your left elbow to your right knee and so on, continuing to alternate. The same ‘burning’ sensation should be felt down your sides as well as in the belly, which tells you you’re doing a good job.

OK, all that rambling at the start took up quite a lot of room, so I’m going to have to continue this in my next post. Until then- see what you can do on the aerobic and flexibility fronts, and try not to burn yourself out too quickly (advice I have been breaking recently =] ).