the magic of reading

On holidays this week and have been catching up on some reading. Starting with Age of Ultron (Avengers) on the weekend and a little halfway through Unruly Places: Lost Spaces, Secret Cities, and Other Inscrutable Geographies. The former was ok but not great and was read more in the vein of prep reading for the forthcoming movie. It also fits in with my continuing collecting of Captain America omnibuses of which I have many.

bookcase full of Captain America
Unruly Places channels into an itinerant fascination of mine for lost or mysterious places; some real, some less so. It’s a curiousity that falls well short of conspiracy theories of lost empires yet at the same time overlaps. An earlier book I dip into every so often along such lines is Atlas of Remote Islands by Judith Schalansky, an exploration of 50 little islands scattered about the place.

Diverting back to fiction, I’ve read the first book in a trilogy by Lev Grossman called The Magicans, sort of a darker version of Harry Potter and indeed it references Potter here and there. Not a bad read though it dragged a little in the middle, looking forward to reading the second book.

While buying the e version of that, I happened to look up another book of similar title, Magician by Raymond E. Feist and found that the e version was available for a mere 7 bucks. I remember loving this book and used to return to favourite sections over the years. The advantage of print is browsibility and that casual sort of scan across multiple pages that I’ve never quite managed in electronic versions. So I bought the electronic and within a day am well into it; it sucked me in again from the opening pages. There’s something about Feist’s writing that immediately captures and the flow of his story-telling is a little like cuddling up in my favourite doona.

Many, many years ago when I lived in Bankstown there was a chain of bookshops called Grahames, of which there was a store in Bankstown Square managed by John and Sue. John knew the sorts of books I liked to read as I bought much of my early SF there. I discovered Galaxy in the city later. John had heard there was a new edition of Magician coming out, the author’s preferred edition. While acknowledging that fantasy wasn’t really my fare, John strongly recommended it. Even though I was on the dole at the time, I pre-ordered it on lay-buy, and the following 3 books, all of which were being published afresh to coincide with the new edition of Magician.

The tricky bit was that I was unemployed and on the dole at the time. John was happy for me to pay them off in small sums over a much longer period than usual. Clearly, he was experienced in managing addictions :-) Where it got tricky is that they arrived out of order and two of the other books arrived before the first. When the first arrived, I convinced John to let me have it, though I hadn’t paid off the full lay-buy. I read it, loved it and was utterly entranced. I managed to pay off enough to cover the cost of the second and again convinced John to split the lay-buy and let me have it. And so on.

Posted in books | Leave a comment

a little tidying

Haven’t done much coding in the last month which is problematic as I should do stuff every week in order to avoid skill rustiness, not to mention learning new stuff. A few weeks prior to christmas, there was a lightning storm and the house got hit by a power surge which killed off the PS3, PS4, 55″ TV, DVD player, and router. All the fun stuff. I did have basic surge protection via cheap powerboards but it clearly wasn’t effective. I hadn’t managed to transfer my house insurance to the new house so we weren’t technically covered. However NRMA (with whom I have contents insurance) informed me that they have a 60 day grace period when moving house and were happy to backdate it to cover the lost equipment though I needed to get quotes.

This proved tricky for the playstations and at times frustrating. Thanks to instructions online, I was able to remove the game discs from each of the dead consoles. I have managed to find someone who can repair the PS3 and I’ll follow up with them in the next few weeks. The PS4 proved harder and after a frustrating hunt, it turns out that the EB Games store I bought it from were happy to exchange it for a new machine as it was covered under their own 12 month policy. The TV will cost about $300 to fix and the electrician is waiting for a part to arrive. The router only needed a new power cable which cost all of $5. The DVD player was over a decade old so I’m not going to worry about claiming that and we’ve instead bought a PVR that can handle DVD/Bluray.

However the main pain point with the dead consoles has been the loss of the save files including 300 hours of Skyrim on the PS3. I remain hopeful that the PS3 can be fixed and may just need a new power supply. It is possible to backup the save files to an external hard drive but not easily from a dead machine. I suspect it would be more efficient to get an annual subscription to Playstation Plus ($70/yr) and backup the save files to my account on the playstation network automatically.

I have since bought heavy duty surge protection powerboards from Belkin and have all the gear running off them now. These boards include guarantees to replace all connected equipment if they fail. I have finally set up my mac and QNAP NAS in the new home too. I’ve also done full backups of my mac pro and windows laptop. That’s the first time I’ve been able to backup the laptop in over 12 months so I’m feeling rather relieved. The NAS is set up as RAID 5 which means that one of the four discs (each disc can hold 3 terabytes) can fail without affecting the backup. I will eventually back up the backup to 2 external drives, one of which will be kept elsewhere in the house and the other at work. I will probably refresh these on a monthly basis.

While the laptop has become my primary day to day device and my email archive, I suspect I’ll continue to use the mac pro for managing my photos and playing with code. It’s an older machine dating back to 2006 and doesn’t support the last couple of OS releases from apple. However, it still has a lot of grunt and I daresay will remain a viable machine for years to come. In addition to backups, the NAS holds most of my photos as well as my itunes library. However I need to do some more work on configuring it to suit the family rather than just me :-) Eventually, I want everyone to be able to use it as a home server with varying degrees of access.

Posted in flotsam, meta, tech | Leave a comment


As per my previous post, I thought it would be a good to try generating the filename of the output file based on the name of the source file. The tricky bit ended up being mostly easy, and the easy bit ended up being tricky. Unsurprisingly there’s a module devoted to splitting up filenames and thus, this resulted in my first use of a module as well:

use File::Basename;

followed by:

my $basename = basename($source, “.csv”);

the use of which in this instance, is based on the assumption that the source file is a .csv file (Comma Separated File). It takes the source name eg snailsource.csv and strips off the .csv. I create the new filename such:

$result = “$basename.txt”;

which results in snailsource.txt. it really was as simple as expressing the new name by adding “.txt” to the $basename variable. I suspect I could have called the “$basename” variable $snailsource or $filename etc.

What I hadn’t realised was that variables are “scoped” and are only recognised within the {} of your subroutine if they have not first been declared outside the subroutines. I eventually worked that out, through Perl Maven’s article. The hard bit was trying to understand why it still didn’t work. I spent an hour on Friday night getting nowhere then looked at it at the start of lunch today and had it solved in a couple of minutes.

Turns out that I’d been under the assumption that I needed to assign values to variables using “my” so the original version of the above line was:

my $result = “$basename.txt”;

within a {…} subroutine. I removed the “my” and it worked.

My little program now checks for 2 arguments, and if there is 2 arguments (source and output files), it sends the results to the specified output file. If there is only 1 argument (the source file), it generates the name of the output file using the name of the source file.

Posted in tech | Leave a comment

another step

I had another idea regarding my little perl program which meant I learnt a little more. I thought it would be nice if the program could write the list of barcodes to a file as currently it sends them to the screen along with the final count. This meant I needed to learn how to use perl to create a file and write to it, from within the program. This turned out to be fairly easy as I’d already learnt some file handling last week in order to read data from a file.

I included checks to see whether a filename was passed as one of the arguments and if not to halt, with an indicative message. This version of the program will only successfully run if there are calls to a source CSV file and a text file is named for output. I s’pose the next step would be for it to generate a filename, based on the source file, if there is no output file included.

It had not been my intention to learn perl. I had planned to learn python but a task came up and I knew more about perl than python so I did it that way and it worked. I recall from my old computer engineering days that a good way to compare languages and learn their strengths and weaknesses, is to write the same program in each. I may give this a go when I’ve developed my barcode handler a little further.

Having registered for a course online with the hope that that would inspire me to learn, instead it’s more the case that I required a problem to solve in order to commit myself. Solving that problem in turn led to other possibilities to develop. I now have a few simple programs doing a couple of different actions on the same data and already I’m thinking that later, I should turn them into one program that does all that and more. At some point along the way, it would be good to develop a web interface and make it easier for other people to run the same reports.

Early days but clearly, I am having fun :-)

Posted in tech | Leave a comment

reading nice things

Fetish for nice things aside, I’ve been looking at all my books and particularly the dodgy, old paperbacks. There are particular gems among them and I thought it would be nice to have nice editions and get rid of the increasingly fragile/deteriorating copies. While reading about some of the nice editions that Easton Press do, I happened to come across a few copies that they published of Clifford Simak‘s work, Way Station and City. I dutifully ordered both and they’ve been sitting on the shelf for the last couple of months.

A couple of nights ago, I picked up Way Station and started reading it again. Once again it grabbed me right from the start and I was reminded of how much I love the flow of Simak’s writing and his treatment of science fiction incorporating believable approaches to technological developments. I recall reading him voraciously, and ending up with a collection of 20 or so of his novels secondhand. Way Station and City are regarded as two of his best.

The Easton Press editions are nicely bound in leather, with gilt edging and a bound ribbon marker. Having recently picked up a splendid edition of Ender’s Game by Orson Scott Card from Centipede Press, I’m looking forward to re-reading it too. I’ve come across a list of the Easton Press SF editions and already spotted a couple on AbeBooks. I don’t want them all but there are several at least I may well acquire at some point including:

  • A Canticle for Leibowitz by Walter M. Miller, Jr.
  • The Day of the Triffids by John Wyndham
  • The Dispossessed by Ursula K. Le Guin
  • Dune by Frank Herbert
  • Earth Abides by George R. Stewart
  • Fahrenheit 451 by Ray Bradbury
  • The Foundation Trilogy by Isaac Asimov
  • More Than Human by Theodore Sturgeon
  • Solaris by Stanislaw Lem

One book I’d like but left off the list above is “Do Androids Dream of Electric Sheep?” by Philip K. Dick. Many of the Easton Press editions I’m after are likely to cost around $60-100 (+pp) however this one, on which the movie BladeRunner was based, seems to be a minimum of $400 or thereabouts. Ouch. I still have the paperback dad gave me when the movie came out. I didn’t see the movie at the time but read the book instead. It would be nice to re-read it too. Today, I did at least buy the Easton Press edition of one of Dick’s other great works, The Man in the High Castle.

Posted in books | 2 Comments

virtually linux

These days I’m increasingly rusty techwise. After last week’s success writing a simple program in perl, I decided to try installing linux on my windows (8.1) laptop. Many years ago when I tried to doing this on an old XP box, it was a long and complicated process, involving BIOS changes, partitioning and other dark arts. I was always scared that I was going to do something wrong and make the machine entirely unworkable. I did manage to get an installation of Debian Linux running after a fashion. It often started with errors, usually with just the command line though on rare occasions it would try to launch the graphical interface (X), and mostly fail. Later, work provided me with a pre-built dual boot machine running ubuntu linux and XP.

Times have changed and dual booting is not the only way. Computers are powerful enough to run operating systems within the OS in virtual machines. These are much, much easier to install. I even found instructions for installing both a virtual machine and linux in 5 steps, easy steps they claimed. It was a wee bit harder than that with a couple of extra bits including a BIOS change but overall nothing too scary.

Following the steps which included sensible suggestions for each setup screen (not many setup screens either), the virtual box was straightforward to download and setup. However I’m running a 64 bit machine and it turns out my install of virtual box wouldn’t recognise 64 bit settings, only 32 bit. Turns out there’s a BIOS option for Intel’s Virtualisation and it was disabled by default. So I gritted my teeth, rebooted and went into the BIOS and enabled it. This ended up being easy and painless. Phew. Rebooted and now virtualbox recognised the 64 bit stuff.

Next step was to install linux itself. Having read around a bit I decided that I’d give Linux Mint a go, though I was fine with ubuntu previously. I downloaded the disc image, all 1.3Gb of it. I started up virtualbox, and created a new virtual machine and opened the disc image. This ended up being a *lot* quicker than the suggested 15 minutes, perhaps a minute or two on my machine (Sony vaio running on the i7 chipset) and started to load. Unfortunately, it didn’t quite make it all the way. Took a while to work out why and then after some googling, I came across a note that suggested increasing the memory. I had done this as part of setting up virtualbox initially but it looks like my settings hadn’t saved the first time. So I increased the memory and all good.

I now have linux mint running successfully in a window on my windows desktop. I can open a command line and use apt-get to install additional software. Amusingly, the first thing I installed was lynx, a text based web browser I used to use many years ago. This was installed from the command line by typing:

sudo apt-get install lynx

and voila:


Posted in tech | Leave a comment

a wee bit of code

A month or so ago, in anticipation of attending THATCamp, I thought I should finally start learning a new computer language and chose python. Alas, the reality was that I only got as far as writing the standard “hello world” program and no further. Last weekend’s time in Canberra has been percolating in the back of my mind and when a problem popped up this week, I thought “aha! I could write a script to do that”. I’ve long had a basic grasp of simple regular expressions for examining strings of text or numbers and used that to edit simple authentication scripts for a previous employer.

For the problem at hand, I needed to search for a particular barcode pattern in a spreadsheet and count them. As my regular expression experience was from perl, I’d see if I could learn enough perl to do the task. And I did. Though I cheated a little and used “grep” initially to pull out all the potential lines; basically I wanted to do a pattern match on a barcode for all lines that also included the word “Success”. So I used grep to pull out all the “Success” lines:

grep Success filename.csv >success.csv

and then wrote a perl script ( to handle the pattern matching for the right barcode. I ran that script on my original file and, via the unix command line, piped it through a line counter:

perl bin/ | wc -l

to give me the total number of times it appeared. “wc” is an old unix tool that’s an acronym for Word Count. Adding the “-l” forces it to count lines instead of words. I’ve hardcoded the reference to “success.csv” into the perl script.

No doubt I could have done all of the steps via a perl script but my skill level isn’t there yet. I relied heavily on this tutorial and followed it through and modified it to handle the search for the barcode pattern.

Update: Had a couple of ideas overnight and improved the code this morning. It can now take a CSV file as an argument, and output the total number of successful barcodes. I no longer need to grep the file before, or run wc to count the lines afterward. The only thing it probably needs is a check to make sure the file itself is in the correct format.

Posted in tech | Leave a comment