jsNG

Posted on 2017-03-10 10:14 +0000 in Coding • Tagged with Norton Guide, Coding, JavaScript • 3 min read

Like many programmers, I have a couple of "Hello, World" projects that I've carried with me over the years. One is 5x5 (which has been used to get to grips with things as diverse as the Palm Pilot and GNU emacs). Another is Norton Guides database readers.

I've made Norton Guides tools that have allowed web servers to serve guides (w3ng), that have allowed you to convert guides to HTML (ng2html), that have let you read guides on OS/2 and GNU/Linux (eg) and also have let you read guides in Microsoft Windows (weg). It's a problem I know fairly well and one where I know the solution well enough so I can concentrate on learning the new language or environment.

Recently I wanted to get to grips with some "pure" ES6 coding while also getting to know node.js. A new version of the Norton Guide code, written for this environment, seemed like a good thing to do.

And so jsNG was born.

At its core is a library of code for opening and reading data from Norton Guides databases. While I doubt it's good ES6 code, or even good node.js code, it's been very useful in giving me a fun problem to solve and it'll carry on being something I'll tweak and tinker with by way of trying new things out.

On top of this I've built a handful of tools for working with Norton Guides databases. The most useful one at the moment (the others are more in the "test the library" than the "make something handy with the library" category) is ngserve. This is designed as a simple Norton Guides database HTTP server.

ngserve in action

When run, you give it a list of guides to serve:

Starting ngserve

and it does the right thing. It has a small number of command line options that help configure what it does:

ngserve command line options

Possibly the most useful are the ones that let you change how it handles "higher" DOS characters and, if you don't like the default colours and stuff, the option that lets you point to your own style sheet (note for now you'll need to host the stylesheet somewhere else -- ngserve won't serve it for you; I'm aiming to change that in some way in the near future).

jsNG does have a fairly basic design compromise at its heart. In the very early version I started out using the async functions for opening and reading the guides. This got very tedious very quickly and I could see that it was going to make for a very messy library with a very messy interface. While it might not be in the spirit of node.js programming I decided to go with the sync version of the file IO functions and code up the core library based around this.

This approach also means that I took another leap that I never have done with Norton Guides before: rather than doing the traditional thing of keeping an open handle into them and reading direct from the file as you navigate the guide, I simply read it all into a buffer in one go and keep it in memory. This is a "guides are small, memory is cheap, things will go faster" approach.

It does mean that when you load up a load of guides into ngserve they're all sat in memory. The upside of this is that things should be a lot faster and the code is a lot easier to follow (I think). To put this in some perspective: I have a directory here that contains 110 Norton Guides files. They total 36M in size. If that seems like a lot of stuff to hold in memory... remind me how much is being used by your web browser so you can look at some hilarious kittens. ;)

Anyway, that's where I'm at with it right now. The code is mostly settled and mostly tidy. I need to write up some documentation for it (and so I need to take a look at good JavaScript documentation tools) and perhaps tinker with ngserve a little more. I'd also like to do a new version of ng2html with this -- a version that makes it far easier to control the style of the output. I'm also tempted to do a CLI-based reader in pure ES6; something similar to EG or WEG.

All in good time.


Hello Google Pixel

Posted on 2017-03-08 12:22 +0000 in Tech • Tagged with Google, Android, Phone • 3 min read

For the past two years I've, mostly, being happily using a Google Nexus 6 as my phone. In the past six months or so I've started to notice that it hasn't been quite as good as it was. The main problem, for me, was that the camera was starting to play out. The issues were the ones that I've seen reported elsewhere: use of the camera would quickly make the phone laggy, very slow response times on pressing the shutter, occasional failure to save an image, etc. This was generally frustrating and, even more so, because I'd got back into photoblogging.

Meanwhile... I've been lusting over the Google Pixel ever since it was originally shown off. I was some way off my phone contract renewal and the price of a new Pixel was something I just couldn't justify. Last week though an offer cropped up that meant I could renew early and get a Pixel (including a free Daydream headset thrown in).

Fast forward to Monday just gone and...

My new Pixel

So far I'm liking it rather a lot. It is odd that it's smaller in my hand than the Nexus 6 was (the XL wasn't an available option and I was also starting to think it was time to drop down in size a little again) but I'm also finding it a little easier to work with; it's also nice that it fits in trouser pockets as well as jacket pockets.

It feels very fast (although every Android phone and tablet I've ever had have felt fast to start with) and smooth to use. I especially like the default feedback vibration -- it's a lot smoother yet also more reassuring than any I've felt before.

The Google Assistant is proving to be very handy. I'm sort of used to it anyway thanks to having owned an Android Wear watch for a couple of years but having it on the phone like this seems like a natural next step.

Another thing I'm getting very used to very quickly, and really liking a lot, is fingerprint recognition. I didn't think I needed it but now I'm wondering how I ever managed without it. Combined with the notification pull-down gesture that the recognition area supports it seems like a perfect way to open the get going with a phone.

There's a couple of niggles with it, of course. The main one for me is the lack of wireless charging. That was something I really liked about the Nexus 6: I could be sat at my desk and have the phone sat on top of a charging pad, staying topped up. No such handy setup with the Pixel. The other thing is the lack of water resistance. To be fair: it's not something I've ever really felt I needed with other phones and I'm not in the habit of sticking them under water; but knowing that it doesn't matter too much if it gets exposed to rain would be nice.

Other than that... there's not much else to say right now. It works and works well, the move from the N6 to it was pretty smooth and the Pixel has fallen perfectly into my normal routine.


Seen by davep (the return)

Posted on 2016-11-15 15:52 +0000 in Creative • Tagged with blogging, photography • 2 min read

A few years back, not long after I got my first smartphone (a HTC Magic), I started maintaining a photoblog that was based around photos I took on that phone. The blog itself was very important to me as it covered a pretty difficult time in my life -- many of the images on it contained and conveyed feelings and emotions that seem a world away now, but which I never want to totally forget.

It served as a visual diary, a note to future me.

And, hopefully, it provided some entertainment for those who viewed it.

Sadly the company who hosted it closed down and the whole thing was lost, except for a hasty (and only partially successful) backup to a Wordpress blog.

After the blog died I sort of lost interest in trying to maintain one and, to some degree, lost interest in active photography in general. Between the blog disappearing and another disappointing event relating to photography I sort of lost confidence in myself and my ability to dare to publish photos online.

This year, despite how shitty it's been for the world in general, has been a really good one for me. Lots of positive changes have happened and continue to happen and I noticed that I was starting to do the phone-based photoblog thing again, albeit only via twitter.

From up the hill

Finally, this week, I've cracked and decided to make it "official". My old "Seen by davep" blog is reborn, with new content and the same old purpose. You can find it here: seenbydavep.blogspot.com

The blog itself is still driven by twitter and the posts will still appear on twitter. In the background I have an IFTTT process running, watching for any tweet of mine with the #photoblog tag and creating a post on the blog from it.

As for how often and what the content will be... simple: it'll be when I see something that I need to capture.


A bit of a backlog at the Apple store

Posted on 2016-11-03 13:45 +0000 in Tech • Tagged with Apple, iMac, OS X • 2 min read

Over the past couple or so weeks my Macbook air has started to develop a minor, but irritating, hardware problem. Simply put, the left shift key fails now and again. I can press it and it does nothing. It's irritating because it messes with the flow of typing (especially when writing code) and the key also feels like it's sticking or clicking in a way that's different from all the other keys.

Macbook Keyboard

Given that I pass through Edinburgh on a pretty regular basis I thought I'd drop in and have a quick chat with someone about it. While I didn't expect a fix there and then (although finding out it was a trivial issue would have been nice) I was hoping someone could take a quick look and let me know what might be going on.

So, this morning, on the way to Waverley Station, I dropped in to the Apple store on Princes Street.

I walked in and looked for a member of staff, all seemed to be busy to start with but one soon noticed that I looked a little lost and asked me if they could help. I explained the issue and she said I needed to pop upstairs to chat with the staff up there.

So far so good.

So, I headed up to the first floor and caught the attention of another member of staff. Having explained the exact same thing to them I was told I needed to speak with yet another staff member. The chap I needed to speak to had a queue (yes, a physical queue of people) waiting to speak to him.

I joined the queue.

About five minutes later I got to speak with him. I, again, explained the problem and was told that looking at it would be no problem and they could do so at around 4pm. This was at about 10am. Having gone through 3 people and spent 10 minutes doing so I found out that there was a six hour queue to have someone actually take a quick look at the issue.

By that time I wouldn't even be in the same country, let alone the same city. So I had to say thanks but no thanks.

So now it looks like I have to make an appointment for some point in the future and make a special trip into Edinburgh just so someone can check out a sticky key on my Macbook.

Remind me again how the nice thing with Apple gear is that it "just works"...


Virgin East Coast 21

Posted on 2016-11-03 13:00 +0000 in Life • Tagged with travel, Virgin • 2 min read

Yesterday I got the call about the Virgin East Coast Ticket Wallet app that I was promised last week (well, actually, promised a couple of months back). It didn't go well.

Well, I say "didn't go well", the conversation itself went very well, the chap I spoke to was polite and apologetic and helpful, but the outcome wasn't really very brilliant.

It didn't get off to a brilliant start when I was first told that the solution to my problem was that I needed to uninstall and then reinstall the app (something I've done more than once while trying to get to the bottom of the problem). I asked if that was really necessary and I was informed that it was the only way to fix the problem of the tickets not showing. Problem is... that wasn't my problem. So I then had to explain the exact nature of the fault I was experiencing (and also explained my guess as to what the cause of the problem was).

After that, much of the content of the conversation involved vaguely confidential information (nothing too terrible or that big a secret -- just stuff that isn't generally known yet) which I'm not going to repeat here. The upshot of the chat though is this: they can't do anything for me.

Simply put: they acknowledge there's a problem with the app, the problem is at their end, it's a problem that needs to be fixed and there's nothing they can do to fix it any time soon.

The causes of this will sound familiar to anyone with experience of large companies who outsource much of their development and get involved in areas that they might not have much experience with.

I also found out the cause of some of the delay in actually getting back to me: the person who was supposed to originally call me went on maternity leave just after they'd first tried to call and, it seems, nobody thought to pick up their workload. This left me in the bizarre position of trying to call someone who was off work for an extended period of time, and whose phone wasn't being answered in any way.

Of course, it doesn't explain why that person's boss, who I was promised a call from a short while after, never bothered to call.

So, I think, to some degree, that's the end of this silly saga. Their software is buggy, they can't fix it any time soon, and I'm out of luck.

As for the extra free tickets I was promised a couple of weeks back now... they've still not appeared. Time for me to chase that up again.


Evernote's confusing menu

Posted on 2016-10-31 11:38 +0000 in Tech • Tagged with Evernote, coding • 2 min read

The other day I stumbled on a tip about Evernote. It was a snippet of information in a bigger post on the Evernote blog so I saved it to Evernote (obviously) to take a look at later.

The tip was that Ctrl-Cmd-B in Evernote (on the Mac) will format a body of text as source code. While I'm not in the habit of using Evernote to store code, not even snippets of code (that's something far better served by Gist), it seemed like something worth committing to memory.

This morning, while finally in front of a suitable machine, I took a look. Sure enough, there's the menu option.

Code formatting menu option

Handy! So I created a test note with some code in it so that I could see how it formatted it. I was curious to see if it just did simple fixed text or if it offered options to highlight various languages (I didn't hold out much hope for the latter, but it was worth a look).

That's when it got odd.

After I created a note and went to format some code, the menu option disappeared!

Lack of code formatting menu option

From what I can tell, once it's gone, there's no way to get it back. At least, not until you actually close down Evernote and start it up again.

Frustratingly, none of this is the case in the Windows version. While the key combination is different there, the menu option is available and stays available.

The version of Evernote I have (on my iMac and my Macbook) is 6.9.2. The version number on Windows is 6.4.2 (after checking for updates -- I'm going to guess that the Mac and Windows version numbers don't match on purpose).

Goodness knows what's going on here. All I can imagine is that it has something to do with a thread I found on Evernote's support forum that suggests that code block formatting is some sort of test/beta feature and can only be enabled via a settings option that isn't available via the version downloaded from the Apple App Store.

So, at some point, I guess I'm going to have to uninstall Evernote from the Macbook and the iMac, reinstall from the Evernote website itself, and try this again. All of which seems a bit silly when the menu option is there and visible when I run Evernote up!


Edit to add: Sure enough, removing the App Store version and installing the version from Evernote's own website, and then going into preferences and enabling the option, sorted it. It's still really odd they'd promote the facility via the blog and not mention it, and also very odd that the option would always show until the first time you're in a position to use it, and then it'd disappear.


Virgin East Coast 20

Posted on 2016-10-29 16:53 +0100 in Life • Tagged with travel, Virgin • 2 min read

After my last post I sent off an email to chase up what was happening with the promised phone calls about the Ticket Wallet app and the general delays with getting things sorted. Here's what I wrote:

Hi again Mike.

It's now a week since you replied and, I think it's fair to note, it's no longer "early" this week. I've had no call -- neither form yourself nor from anyone related to the Ticket Wall App -- and I've not received the promised tickets either. While I do try to be patient I have to admit that it's starting to get very frustrating, being made lots of promises about progress that simply never happen. This has been going on for months now and I'm always having to chase things up.

I'd very much appreciate it if you could explain to me what's going on, and why.

A while later I got a reply. He said he'd be getting the tickets in the post the following day (so a Friday, which I think I can safely say isn't the start of the week) and would also phone me.

The following day he did keep his promise. He called (I managed to miss him the first time, but when I was finally free I called back and we got to chat). He promised I'd get some more tickets early next week and also that someone with technical knowledge would finally call about the app problem.

I have, of course, been here before. This is exactly the promise that was made a couple of months ago. It's easy to make the promise, apparently not so easy to deliver on it (or address the issue of not delivering on it).

So now I wait. Again. I'll be sure to update when something happens (or doesn't).


Virgin East Coast 19

Posted on 2016-10-27 11:21 +0100 in Life • Tagged with travel, Virgin • 1 min read

I think I need to rethink the meaning of the word "certainly". Anyone still bothering to read this blog will recall that, last week, the Customer Relations Manager at Virgin East Coast said:

If you can leave this with me I will certainly be in contact early next week to try and get this resolved once and for all. In the meantime I will pop a further couple of tickets in the post for you, just so you have them incase you need to travel urgently.

That email was received last Thursday evening. It's now the following Thursday. Personally I'd take "certainly", in the above, to mean that there's little to no chance that I won't be contacted in the early part of this week, and that there's little to no chance that the tickets won't arrive in the early part of this week.

I'd have thought that "certainly" would be used to create a huge contrast between what has gone on before, and what will follow.

But, like I say, it's Thursday the following week and I've had no call from anyone about the Ticket Wallet app, I've had no call or email from Mike (the Customer Relations Manager) and the tickets haven't tumbled through the door.

I'm not surprised. I'm not in the least bit surprised. I am, however, rather disappointed.

And, of course, I'm now going to have to chase things up again.


Virgin East Coast 18

Posted on 2016-10-24 11:29 +0100 in Life • Tagged with travel, Virgin • 2 min read

Late on last week some progress was made with the issue of no longer being able to contact Mike at Virgin East Coast. After chasing up via twitter (mentioning the MD as well as the normal support account) I finally got a reply from the support account, saying they'd get a message to Mike and let him know what was going on.

I wasn't really very hopeful about it, if I'm honest. If I couldn't get a reply from him via the channels I'd normally used what hope was there that I'd get a reply this way?

The following day was mostly spent traveling but my phone was on and always to hand. I never received any call. However, late in the day I did get an email! This was the first direct contact, that replied to an attempt to contact him on the current issue, I'd had from the Customer Relations Manager since the previous month.

Here's what he said (quoted in full):

My sincere apologies for the silence, I have been away and it was remiss of my not to advise my regular contacts, of my colleagues details.

If you can leave this with me I will certainly be in contact early next week to try and get this resolved once and for all. In the meantime I will pop a further couple of tickets in the post for you, just so you have them incase you need to travel urgently.

My apologies again David, and I look forward to chatting early next week.

I am, of course, a little skeptical of this at the moment. A few times before I've been told they'll be in contact "early next week", or something similar, and nothing has happened. It'll be interesting to see if this will be different.

Will I get an update? Will I finally get a call about the Ticket Wallet app? Will the extra tickets turn up?


Virgin East Coast 17

Posted on 2016-10-19 11:28 +0100 in Life • Tagged with travel, Virgin • 2 min read

The Virgin East Coast Trains saga gets more and more odd. Following on from yesterday's update I thought I'd give Mike an actual call. As in, a call on the phone.

I don't generally like calling people. I'm one of those people who gets a little anxious about using the phone and much prefer email. I'll use a phone as a last resort and, given how long this was going on for, I thought it time to break my normal "no phone" rule and pick mine up and call to find out what the hell is going on.

Turns out the number is no longer available!

The last email I have that was sent from Mike was on September 25th. The number I used was the one in the footer of that email. It doesn't work. There's also a land line given. Calling that gives the same result.

As of now, if I try and call the customer relations manager for Virgin East Coast Trains, someone who I was referred to by David Horne (the MD), I get a message that the phone isn't available.

I...

Erm...

What?!?

So, given that, I thought I'd drop David a direct message on twitter. We'd spoken that way back on August 9th when he requested my contact details. Nope. Can't send him a DM any more. Guess I got unfollowed.

So I've tried tweeting him instead:

This did get a reply from @Virgin_TrainsEC and I let them know what I was after. They say they've sent him an email too now:

Really, this is a silly mess again. My query is simple and straightforward. I'm simply chasing up two promises that were made by Mike, on behalf of Virgin. All I seem to be getting now on those two points is complete silence.

I'm really not in the business of telling people how to do their jobs but... wouldn't customer relations involve actually talking to customers and delivering on promises made to them when you do talk to them? That strikes me as the sensible thing to do.