Category Archives: Software

Coding – past, present and future

'Hello World' in JavaScript (Wiki)
‘Hello World’ in JavaScript (Wiki)

Today I thought I’d write about coding. Not in a technical manual, how to do your first “Hello World” widget kind of way, but just to give a general sense of how it’s done, and how things have changed over the years. This was prompted by the passages I have been writing for Timing recently, in which Mitnash and Slate have been crafting a fix for a particularly unpleasant hacking threat. The plot is all wrapped up in blackmail and personal relationships, but their ability to code is what gets them sent here and there. But first, let’s look back in time.

Colossus being operated at Bletchley Park (WIki)
Colossus being operated at Bletchley Park (WIki)

Not so many years ago, computers were relatively simple things to work with. They didn’t look it – all the complexity was visible by way of valves and a spider’s web of cables connecting them. But the range of things you could tell them to do was quite limited. The available options were limited, and they were essentially isolated from each other. Today’s computers are almost the opposite – they look simple on the outside, but they have a hugely expanded range of capabilities, sensory inputs, and ways to communicate with nearby devices.

The art of the coder has changed along with that. Once upon a time the programmer had to do everything. If you wanted to draw a blob on a screen you had to know exactly which bit of memory to poke with which binary digit. You needed to master a whole range of disparate skills in order to accomplish quite modest tasks, and oftentimes you needed to deal with the innards of the machine’s firmware. Porting the results to a different machine was a serious challenge.

Logo Neuframe (I worked on this, long ago)
Neuframe (I worked on this, long ago)

Times have changed. If you need graphics animation, or remote communication, or artificial intelligence, there’s a library for that nowadays. Today’s coder relies on standard modules and frameworks, pulling in this one and that as the need arises. Moreover, he or she is insulated from the nuts and bolts of the device, so can write essentially the same program to run on a high-end server, a regular desktop or laptop, and any one of hundreds of different mobile devices. That is enormously liberating, but brings in a whole raft of new problems.

Does the borrowed code actually do what you want, neither less nor more? Do you trust the library writer with the innards of your system and, what is usually more precious, the data it contains? Does it already come with adequate security against hacking, or do you need something extra? On one level, the coder is freer than ever to be creative with a wealth of open source material, but to offset that, there’s a long and rather dull checklist to work through.

Some while ago I made the transition from pure development to testing and QA: it’s a decision I have had no cause to regret! I still get to write code, but it’s behind the scenes code to validate, or sometimes to challenge the work of others. QA has changed over the years alongside development. Once upon a time there was an adversarial relationship, where the two teams were essentially pitted one against the other by commercial structures, with almost no rapport or dialogue. That has largely gone, and the normal situation now is that developers and testers work together from the outset – a collaborative effort rather than competitive. There’s a lot of interest in strategies where you write the tests first, and then code in such a way as to ensure they pass, rather than test teams playing catch-up at the end of a project.

Certified Ethical Hacker qualification (https://www.eccouncil.org/)
Certified Ethical Hacker qualification (https://www.eccouncil.org/)

Coding and hacking are central to the plot of Far from the Spaceports, and its successor Timing. Hacking, then and now, isn’t necessarily bad. It all depends on the motive and intentions of the hacker, and the same techniques can be used for quite opposite purposes. Some of the time Mitnash and Slate are hacking; some of the time they are defending against other people’s hacks.

I have taken the line that the (future hypothetical) work of the ECRB, to – protect financial institutions against fraud and theft, would need a freelance coder more than a policeman. Moving from place to place around the solar system’s settlements takes weeks or months, and even message signals can take hours. It seems to me that it would be much more efficient for ECRB to send someone who could actually identify and fix a problem, rather than someone who might just chase after a perpetrator.

On one level, Mitnash has it easy. He can pass all the necessary but time-consuming work of testing, validating, and productionising his code to somebody else. If I ever worked with him, I’d get frustrated by his cavalier attitude to the basic constraints of working in a team, and his casual approach to QA. But then, he gets to travel out to Mars and beyond, and has Slate as his team partner.

Artist's impression: Dawn, Ceres and Vesta (NASA/JPL)
Artist’s impression: Dawn, Ceres and Vesta (NASA/JPL)

Matters of coding…

I am a little behind with the blog this week, largely because I have been making some necessary updates to the various websites that I am responsible for. Anyone who has been following the tech news over the last few years will be aware that the EU has insisted that any site using cookies should have a warning to users about this. They are tightening this right now to require that sites have some kind of popup which requires active user dismissal.

Now, along with most people in the techie world I think this is a silly regulation. There are far more effective and far less obtrusive ways that your online activities can be traced which do not involve cookies at all, so the whole mechanism gives a rather spurious sense of safety. And whatever you think of cookies, at least they can be inspected in your browser and deleted if you so choose. All the really big datasets that hold personal information about you – the ones you might conceivably be really worried about – are tucked away on remote servers to which you have no access.

But, whatever I think of it, it has to be implemented… which all takes a bit of time… which takes away from more exciting things.

Now, along the way I also discovered that several of the sites are way out of date! That is unequivocally my own fault, and I have been building up a rather long to-do list for the next few months.

So for today here is another extract from Far from the Spaceports. In this, Mitnash is also struggling with the travails of coding. Mitnash is not me, but I do have first-hand knowledge of the problems he faces! It’s a minor part of the plot, but will give him the opportunity in a few more pages to speak with a person who has information he needs.


It was time that I learned how to code the NuFleece API. So together Slate and I went through the documentation – as pitiful and contradictory as anything I had met before – and learned how to do it. This involved another trip to Aladdin’s, this time to buy a NuFleece wrap that I could practice on, and then most of the rest of the day first being baffled, then swearing at the painfully slow and irrational logic, and finally crowing with satisfaction.

Mrs Riley called me for dinner just as I got to that point. I bounced into her dining room waving the wrap about, and insisted she watch my trial template teapots drift across the surface of the wrap. They cycled through dimension and hue changes as they did so, and adapted contextually to the base colour stripes as they drifted over them. She watched them for a while as I tucked in to the soup she had brought me.

“Could you do that with pictures, Mr Mitnash? I was thinking it would be nice to have a wrap like that with pictures of the four of us on it. Riley, me, and the two children.”

I was on a real high with the afternoon’s successes.

“Drop the pictures onto this hand-held and I’ll have it done for you this evening.”

As always happens, the API work actually took a lot longer than I had expected. I promised myself again that I would stop giving ambitious estimates. So I worked into the night to get it done, and then at breakfast made a little show of presenting her with her finished wrap. She was delighted, and was still talking about it when I set off…

And here, just for fun, is another NASA image, this time of Saturn and (extremely small) the moon Tethys…

NASA picture of Saturn and the moon Tethys, taken by the Cassini probe
NASA picture of Saturn and the moon Tethys, taken by the Cassini probe

The toolkit used for producing Scenes from a Life

Spiral staircase, St John's College, Cambridge
Scenes from a Life is on its very last sanity read-through before release! All being well, this means a kindle release early next week, with physical copies through Amazon Createspace shortly after, depending how long their validation and approval process takes. Watch out later this week for the cover design to appear, a splendid composite picture which would not have been anywhere near so good without the extensive help of Ian Grainger.

So I thought I would take a short break from the slightly mind-numbing process of proof-reading to talk about the tools I have used to put this all together.

First and foremost there is Amazon’s KindleGen. Being of a technical disposition I use this “raw”, with all the actual content written in HTML, and a bunch of configuration files to tie them all together and define the structure. This means that I have complete control over the output, can check the results every step of the way, and avoid the formatting slips and navigation problems that I have met so often in both self-published and small-press books.

Next, epub format, for those many people who have other kinds of ereaders. This uses exactly the same HTML source files as kindle, but with a slightly different set of configuration files. In fact epub is a much stricter and more pedantic format than kindle, so it’s easier to work always to the stricter standard too keep both happy. Also, the diversity of ereader devices and applications, and the variations on how closely the manufacturers and software writers have stuck to the spec, means that to get wide coverage you have to be quite cautious and keep well within the bounds of what is possible. Once the source and configuration files are complete, epub is simply a zip (compressed) archive needing no special tools. Long-term readers of this blog will no doubt remember the struggles I had with this earlier in the year.

Finally, the physical copies. It has been an eye-opener going back to a world of absolute distances and dimensions for the layout. So much of my recent writing and professional life has worked in situations where text can just be reflowed at will to adjust to a different size screen or window. So, working with the constraints of a fixed piece of paper has been, to say the least, interesting.

Following the advice of my Finnish friend Petteri Hannila I tried out an online tool called ShareLatex. This takes source files in plain text, and joins them together with directives that define the physical appearance – paper size and margins, font size and type, and the whole host of conventions that go into book design. It was slow and frustrating at first, but again a technical background helps a great deal, and before too long I had got to grips with the parts of the latex language I needed for both the interior and the cover. The huge advantage of ShareLatex is that the output can go directly into Amazon’s Createspace software in “camera-ready” form. The downside – apart from its general unsympathetic interface – is that the error and warning messages when you make a mistake are exceedingly obscure. And once again, unlike just using Word and exporting to pdf, you have a lot of fine-grained control.

Which brings me to Createspace itself. This is, I think,a wonderful tool for those who are going to self-publish. Unlike ShareLatex, the errors and warnings are clearly explained and presented, and so far the process has been extraordinarily simple. I cannot yet say I have finished this – that will not happen until final proof-reading has happened, followed by the definitive page count and some last-minute accommodation to that. But so far, so good.

OK, that’s all for today… back to chapter 5… watch out for the cover in a few days…

Spotlight review reminder

Picture - Marian Allen Later this week I shall be posting an author interview with Marian Allen (Sage I: The Fall of Onagros) which I reviewed a few days ago. This post is just a quick reminder of the various other activities going on around this book during August.

Cover image - Sage I: The Fall of Onagros You can also check out Readers meet Authors and Bloggers Spotlight group or http://www.kephrath.com/BookReviewGroup.aspx for some details and a rafflecopter giveaway. Marian’s own blog and web site is well worth looking at, as is Michelle Ray’s “1 Book Lover’s Opinion” blog. And a previous author interview with Marian can be found at The Bookworm’s Fancy blog.

I hope that there will also be some other news about mobile apps and epub books later in the week, but that depends on the speed of approval across the various app stores…

Back on the ePub trail…

This is something of a perennial topic for me, but I keep discovering new wrinkles in the ePub drama. This time it was the realisation that some vendors will accept ePub files with minor errors and some will not. In fact most will not, even if the errors are minor. So having got all excited a week or two ago and talked about how Triumphal Accounts in Hebrew and Egyptian was going live… well, it only went live at a limited number of places. I finally tracked the problem down to some errors in the ePub source files which had evaded my notice… but not the detailed scrutiny of the extremely useful epubcheck tool supplied by Google. So… problem fixed, uploads in order, and everyone seems to have accepted the file this time around. Though of course acceptance and distribution takes time so at this point only LeanPub and Smashwords have the thesis live and on sale. Google and iTunes will follow shortly…

I also had a great review of The Man in the Cistern on the Breakfast with Pandora blog – well worth a read.

Lots of other activities in the offing so watch this space next week…

Senet, ‘Scenes from a Life’, and mobile app programming

Well, all three of these have been quite prominent this week. Senet is an ancient Egyptian board game, considered by many people to be an ancestor of backgammon. Available evidence is for the most part from tomb drawings and artefacts, with a small amount of textual material as well. It is not clear how far through the various levels of ancient Egyptian society enthusiasm for the game went – the tomb evidence by its very nature preferentially informs us about elite activities and interests, and we simply do not have information either way about other strata of the culture. Senet was used, apparently, not just directly as a game, but also as a religious or spiritual symbol of the passage through this life and the next. You could liken this very loosely to today’s playing cards, which similarly straddle the long gulf between between gaming and divination in different people’s hands.

Scenes from a Life makes use of Senet quite extensively, and I have assumed that it was played very widely by all kinds of people. Sometimes in the book it is just a game, but much more frequently it features on a metaphorical level. So the journeys that take place through the book might be interpreted by the characters as like movements in the game, with all of the anticipation and anxiety that this brings about. Or there might be an analogy drawn between someone’s behaviour and a game play strategy. If, as I suspect might have been the case, Senet was something of a national game back in New Kingdom Egypt then this is inevitable. Think how sports fans tend to lace their conversation and world-view with ideas and set-piece moves drawn from their favourite sport, whether football, chess, baseball, table-tennis or whatever.

Senet app icon

So that brings us through to mobile apps. Some long-term followers of this blog will know that I have a Senet game available on the various app stores (pick your favourite store and search for DataScenes Development, or just directly for Senet). But over the last few weeks I have been working on a new version. Alongside the paid-for version there will be a free (well, advert-supported) one which has a number of geeky techie advantages.

  • By using a different underlying technology I am able to release it for a lot of phones and tablets of quite modest specification (lots more than was constrained by the previous tech choice).
  • I have integrated the app with the web so there is a sort-of leaderboard feature for those who fancy themselves as modern-day Senet champs.
  • I have taken the opportunity to rework a lot of code that had got more and more like tangled spaghetti. Anyone in the IT trade will recognise this as refactoring, and with my QA hat on I am completely aware just how many bugs get introduced by enthusiastic developers doing just this… but my code will be different…

Senet splash screen But I have also been finding some of the down-sides with the new development tool (it’s the Corona SDK for the true IT geeks). This is based on a graphics engine called OpenGL – which is magnificent for things like displaying images and moving them round the screen, but really quite poor at laying out simple text in – say – some help pages. Ironically I think I have spent longer getting the in-app help to work properly than the mechanics of the game itself.

Now, the characters of Scenes from a Life did not have smart-phones with them on their journeys. But they did enjoy the game of Senet – and you can enjoy it along with them! Realistically Senet the free game will be released quite some time before Scenes from a Life hits the bookshelves, so it can act as a sort of preview…

Launching an author web widget

Firstly, there are a number of birthday giveaway free tokens still available for In a Milk and Honeyed Land – but less than last week so if you would like one of these please contact me at books@kephrath.com. This is for the electronic version (epub or kindle mobi), sadly not for physical copies. I also had time to write a review of Britannia’s Wolf by Antoine Vanner, a piece of naval fiction set near the end of the 19th century.

But the main thing I wanted to talk about today was that, wearing one of my IT development hats, I have now finished work on a web (or blog) widget for authors. This screenshot shows the appearance, but for ‘live’ operation please look at the Matteh Publications site at http://mattehpublications.datascenesdev.com/AuthorWidgets.aspx or http://mattehpublications.datascenesdev.com/AuthorWidgetRegister.aspx.
Screenshot of author web widget

What does the Author Web Widget do? Well, you can have a single widget which combines information from a whole multitude of different sources. It can be placed on your web site or blog – so long as the blog supports JavaScript, which is typically in the sidebars or banners rather than the main area. You can give the code – just a few simple lines to copy and paste, which connect to the Matteh Publications site for all the hard stuff – to your friends and supporters who can embed it on their own site in order to promote you.

The widget will link to your web site, blog, main social media sites and email. It will also allow you to combine a whole list of different vendor links – Amazon, Goodreads, Smashwords, Barnes & Noble and so on. You may well have reviews of the book scattered here and there – maybe Goodreads, Shelfari, and a whole lot of separate blogs. Same for extracts that you have contributed to various locations over the months. Since this widget is independent of each of these separate sites, you can connect to all of them in one place.

All of the details can be edited from a single page on the Matteh Publications web site – colour, size, text and link entries, vendors and so on. This page becomes accessible to you after registration. The edit process is pretty much automated and should be easy to manage, but if you run into problems I am just at the other end of an email – matteh@datascenesdev.com. At the moment the widget only lists a single book, but you can always have more than one and I can walk you through the simple process of hosting multiple widgets on a single web page if you like. From your page on the Matteh Publications site you can also see how much use your widget has had – how many page views, how many times someone has clicked through to one or other site, and so on.
Screenshot of configuring the author web widget

How much does the widget cost? Well, the normal price would be £20 for a year’s subscription, to include unlimited edits and unlimited use on as many different sites or blogs as you wish. I am running an introductory offer of £10 for the first year for a limited time, probably a couple of months as the system is proved in action. The money transaction is handled by PayPal so your financial details wil be held securely at the PayPal site and not by me. All I need is the transaction ID to confirm payment.

If you’re interested in one of these web widgets for yourself, drop me an email at matteh@datascenesdev.com and we can talk about it.

Spring things and a celebration of geeks

Spring has finally well and truly sprung here in north London, and leaf and blossom are everywhere. Quite a spectacular change. Not only that, but the public holiday yesterday featured bright sunshine and heat all day. Here’s the vine by (and above) our front door celebrating Spring…

The household vine coming into leaf

So what with that and lots of work on a web programming project I have been working away at, there is no book review this week! I have, however, been finally making good progress on the last remaining chapter of Scenes from a Life. In terms of the plotline this fits about 3/4 of the way through, and is a flashback scene to an event that took place some ten years or so before the main sequence. So far I’m happy with progress, though it’s some way away from finishing yet. More news later in the summer…

Also, over the weekend, my faith in geeks was confirmed. For reasons unknown, large numbers of my bookmarks / favourites disappeared from Chrome – not sure when, or how, since I only realised when I went to pick one and it wasn’t there! The normally wonderful feature of Chrome that it synchronises across several devices happened, in this case, to work against me… the missing bookmarks were cheerfully missing from all the different gadgets I tried, since Chrome could synch much quicker than I could stop it… A swift internet search showed me that I was far from being alone in this, and happily there are several geek sites which tell you how to recover them… provided you realise soon enough and don’t panic…

It did occur to me that this was a blind spot for me – and obviously a lot of other people – I happily backup in one way or another my writing, computer code, accounts etc, but it never occurred to me to back up bookmarks. A happy end, on this occasion, though having read other accounts it is clear that some people have not had such good fortune. A triumph for the determination of geekly characters to document such things.

epub and Leanpub

As I have mentioned before, I have been delving into epub format for the last month or two, so as to extend the number of places where I can offer some of my writing. Kindle is great, and has been a very good place to start, but a little while ago I decided it was time to branch out.

The Man in the Cistern epub cover

So following a recommendation from the Finnish author Petteri Hannila, I went to the Leanpub site and got to grips with that. They accept a variety of original formats, of which the most interesting to me was html, since I already had that!

Leanpub was originally geared up to present books on computer languages and coding. So parts of their site were not relevant to my project, but the level of help and support is excellent. Whatever input format you choose, it is internally converted to a text layout they call “markdown” (by way of a rather geeky joke on the computer term “markup”, I think). It looks a bit like Wiki formatting for those who have met that. From markdown it goes straight into an epub file. Kindle and pdf versions are thrown in for good measure, though I did not in fact need them.

The Man in the Cistern ended up at https://leanpub.com/TheManInTheCistern. This is the first place this story is available in epub format, though I’m sure I will add more places in time.

You have a whole bunch of settings to grapple with, some of which go into the book file itself and some into the web site listing. Along the way you even get to specify a section as a short sample preview. The link for this goes onto your page listing. I must admit that this bit caught me out slightly, as I had expected it to be optional. As a result, my first attempt ended up with the default sample, which has standard text having nothing to do with your own book. But one of the very cool features of Leanpub came to my rescue – you can upload a revised version whenever you like. Previous buyers are notified and get the update for free, just like an update to a mobile phone app. So last night I hastily put together a quick sample version – if it turns out I don’t like it I can just rework the sample and leave the main content as is.

All very handy, and once you get your head around their terminology it is easy to use. I’m happy to recommend this site as an alternative point of sale. They are totally non-exclusive in their approach so don’t mind where else you sell your books – though other arrangements you might have made like Kindle Select might interfere with this. The terms and conditions are very straightforward and not at all hard to find. Great stuff.

Guest review over at The Bookworm’s Fancy blog

This week I have written another guest article for Erin Eymard’s interesting and wide-ranging blog, The Bookworm’s Fancy. This time it is about a book I have just finished reading, The Bone Thief by V.M. Whitworth. It’s a tale set in tenth century England, and to read what I thought about it you can hop over to https://bookwormsfancy.wordpress.com/2013/03/21/the-bone-thief-by-v-m-whitworth-guest-book-review-by-richard-abbott/ and find out! You’ll also discover why this picture has been included…
LIndisfarne

Erin has also kindly agreed to write something for this blog in a little while, so keep a look out for a different contributing voice…

Other news… I am gradually going around all of the various sites where my books are listed, and filling in details about The Lady of the Lions. This could not be described as the most interesting thing to do, but it does provide a sense of completion.

I am still grappling with epub format, having briefly experimented with several stand-alone or online converters, and not been happy with any of them. So far as I can tell they all do something that I don’t want. Either the cover is messed up, or the html contents table, or the built in ncx navigation. One of them carefully included all my images as hugely long blocks of text, presumably deciding that they were media type text/html rather than image/jpeg or image/png. Not what I wanted at all… So when the time comes to distribute in this format I think that I shall just go back to first principles and do it from scratch.

And I shall also be getting back to grips with Scenes from a Life – one chapter is completely unstarted, and my target for April is to have a first draft ready. Then there’s “just” (haha) the process of finding out where things are ragged around the edges, and then the process of editing…