2018-10-10

Norfolk Broads

Time for another short cruise. Well, cruise is a bit of an over statement, it was four nights pottering about on the Norfolk Broads. It is the first time I have ever been there. I have been on canal boats as a child in the Midlands, but nothing quite like this - thankfully no locks!

For a start, I had not appreciated how flat and wet Norfolk seems to be - lots of water and marshes, and clearly the first against the wall when sea levels rise. I mean seriously the whole place is going to vanish off the map, it is scary. So just as well I have had the chance to visit. It is quaint :-)

I can see how it is a lovely holiday for some people, and I do not want to put it down at all. Apart from freezing the first night, the weather for early October was actually quite good - dry, clear, sunny. Actually nice and pleasant.


As boats on the Broads go, we had a nice boat from Barnes Brinkcraft, an electric hybrid. We pottered around, went to a pub one night, ate well all week, and drank well! A nice quiet few days with my two best friends.


We even played cards (a 64 card deck with Altreran characters)...


I managed to keep up walking a bit, and even found an old Abbey, turned in to a windmill (literally just built over the original gate/entrance). They have lots of windmills there, mostly to pump water!


So, thank you Simon and Mike for a nice few days.

However, there was one thing that surprised me. A bit of technology...

  • I have had this technology for at least a decade
  • I have never (until this trip) used it
  • It is always on my person, I mean not a second not so, even shower, bath, swimming, sleeping.
  • It does not need charging even

What is it?

My watch! It has tides shown on the main screen. I may only be an ape-descended life forms that is so amazingly primitive that I still think digital watches are a pretty neat idea, but it was not actually a key feature when buying it. It works, and we needed it as some bridges are too low during high tide. It shows three levels of amplitude and roughly where you are in the tide cycle (6 steps) on the main display. It is solar powered and radio set, nice little watch and I can see how anyone that lived or worked on the water, such as on the Broads, would find it invaluable.

Anyway, we are pondering a trip on a canal next time...

2018-10-09

SVG, font metrics, am I being thick?

I really hope someone tells me I have missed the bleeding obvious for a change.

I think SVG lacks two key features.

1. The ability to set a maximin size on a line of text, i.e. so that if it works out longer it will be squashed in some way. There is a way to set a calculated size and have either the spacing or the spacing and glyphs adjusted to match that, but I cannot find a way to say "squash, but only if it would be too big".

2. The ability to take a block of text, give it a width (and height, why not) and line spacing and have it fill the box, breaking on spaces between words.

If there is svg magic (and I don't mean javascript to run on a web site that will do the business later), just plain svg that will easily convert to png or pdf, and still work, that is what I want.

The alternative, for which I am still massively failing to find a solution, is a simple Debian installed C code library (not C++ please) that allows me to ask "how wide is this string in this font". I found qfontmetrics which looks spot on, but is C++. Obviously, including emojis!

With this I can make the tools I current have which produce svg output (to later be converted to PDF or PNG, etc) work out when to set a line width, or break blocks of text, and work with normal svg.

All of this is a doddle in postscript, but unless someone has a patch for gs to handle utf-8 strings natively and handle a fuller character set with the likes of emojis, I need to move away from postscript, hence using svg. Just hitting this key stumbling block for now.

Update: Thanks for all the comments. I am looking at freetype at the moment. It looks like it has exactly what I need, but slightly struggling with Emojis and the like at the moment :-)

Update: Yes, FreeType has simple C functions to load a font/face and find the size of glyphs based on unicode characters, and simple to tell it does not have the character and use a noto/emoji font instead, etc. This should be simple to then work out line wrapping and sizes for SVG with tspan for emojis and the like. Now I know it is all possible and how to do it, I have to think about the project for which I was asking this - a new system for designing printed plastic cards...

2018-10-06

Making people aware: Anglian windows

As I blogged (here) I have a new conservatory. Some have asked why we went for Anglian windows, mainly because they are expensive. Well, I'm married and sometimes I do as I am told by my wife, but to be fair, the actual windows looked good (pictures, samples, etc). I cannot really comment on the quality beyond that as I am no expert, and the real proof will be what happens over the next few years, but fingers crossed. I can say, apart from the missing pane of glass, the result does look good, and is a lot nicer than our old one.

I can comment on the salesman. He was annoyingly pushy. The price is hiked and then vague discounts applied to get it to just being really expensive instead of insanely so. He really did not like that I said initially "not now" - it was just before I went on a holiday, and I was not sure if I could afford it yet - they were calling lots even though we specifically said what date to come back. He did not like that I wanted to just pay for it rather than taking their credit. I really hate having debts hanging over me (after various experiences in my life), so as much as possible I try to pay for things or not have them - fortunately I'm in a position where that can work most of the time.

The mildly slick part was the iPad which created a pretty accurate 3D image of the conservatory as it would actually be - colours of everything, right size, everything. Some weeks later a proper survey was done, and we were sent drawings. All good.

I was pretty unhappy with communications from them - they called after 5pm Friday to say they would come on Monday. They could have booked a date weeks in advance, but no, we are just told the day with no notice. That was hassle.

As I said, it ended up with bits missing and delays, but by the end of the week we had most of a conservatory except one pane of glass.


Mistakes happen. I run a company, and I know things can, and do, go wrong. Personally, I take things seriously and always aim to fix things, not just for the mistake but to stop the same mistakes in future.  If anyone has a problem with A&A you are welcome to tell me, please. However, Anglian have a different approach it seems.

Again, very poor communications, and now several times, a few weeks apart each time, they have come out with the wrong pane of glass. How can this happen? Well, mistakes happen I guess! How can it happen two or three times? How can they have no process to expedite making the new pane of glass and not take weeks?

Well, I do try to be reasonable, really. They had chance to fix this - which is only fair - but after a while I ended up giving them an ultimatum - end of Sep or it gets to be a sponsored tweet.

That did nothing to get them to actually fix it, or even try to fix it quickly, which was a surprise. Well, I don't like making threats that I don't follow through...


Now some may think that is somewhat mean, I guess. As I say, I gave them plenty of time to avoid it. But the real irony here is that the salesman gave one of the vague discounts in return for my agreeing to post on social media - so they literally asked for this!

I only paid twitter £100, which is almost used up now, but so far it is around 60,000 views, and 40 new followers as a result. Many people saying they won't now buy from Anglian. One that had a quote from them but is now cancelling that. I am also quite relieved that the comments I am getting are largely "good on you" / "well done", and people impressed that I am putting my own money in to making people aware of this. To be fair, if people were calling me an arse, I would have stopped the promotion, but they are not - this is nice as I do not always gauge how people will react to something like this (yeh, really, sorry).

Of course, there will have to be a next step. I plan to wait for one more wrong pane of glass before we get to the legal notice stage.

What puzzled me is that they really seem not to care. In some ways it is like dealing with large companies like BT that seem to lack the concept of "expedite the fix if we screwed up" even though they have (paid) expedite processes. Why can Anglian not make the right pane of glass in a day? Why can they not make the right pane of glass? It really is amazingly crap customer service.

I hope what I did has been a useful service to people considering double glassing, conservatories, etc.

Update: Windows update complete, 10th October. Initial install 20th August.


2018-10-03

Making tax digital

HMRC are expecting VAT to be submitted electronically directly from accounts systems. This seems vaguely sensible. It is mandatory from April 2019. It avoids typing mistakes at the very least.

So, we look on HMRC developer web site and see that they list APIs. They list some using RESTful APIs and some XML ones here. The XML ones include submitting VAT returns. Something we have had for some time, and is all "digital" as required. So we were thinking, cool, we did this years ago, not an issue.

But we actually asked them about it, just in case, and they are very confusing. They say the XML API does not "support" making tax digital - which - err - makes no sense, it is digital. They apparently have an API that is not the XML API for the MTD VAT submission but oddly it is not in that list of APIs, so we have to register with them in some way to get the API.

The web site does not say the existing XML API is going away, indeed they confirm it is not, but apparently will not be valid to use for MTD, which makes no sense whatsoever.

Why are HMRC not accepting their own digital XML APIs that they have in existence for submitting VAT digitally? An API they confirm they are not withdrawing? Why have they apparently produced secret new APIs to submit it? It makes no sense.

Thankfully it will be simple enough to do, one way or another, and there is still plenty of time. The recording of VAT and ensuring it is all digital is all covered, thankfully.

Update: We have finally got access to the documentation on the API, it is hidden behinds a login and not published along side all of the other APIs. There is no reason why the API for this should not be published, and even less reason when you consider the other APIs are published. It also makes little sense for a mandatory API to be in a beta state only 6 months before it has to be in use by every accounting package in the country. Thankfully it is very noddy JSON/OAuth.  I cannot see anything in VAT notice 700/22 that makes the XML API invalid in anyway. The OAuth, of course makes assumptions, i.e. that someone is authorising a third party to access / submit VAT details, which is not the case here. There seems to be no "journey" (as they describe it) for someone that is submitting VAT returns for themselves using their own software. They also have gems like they want to know the public IP address and port of the web browser that requested filing the VAT return - forgetting that it may not have a public IP address even as it may be on a private network! I just hope it copes with that being an IPv6 address.

Update: WTF? They made us jump through hoops before letting us have access to the API documentation for submitting the VAT return - but their own service standards require that everything they do is published, reusable, open source, and they even have a GitHub page!

Update: I am pretty sure I have now found a newbie error in the HMRC OAUTH stuff (mis escaping form data in a sequence of pages) - we'll see what they say. Worked around.

2018-10-01

OFCOM and some sanity? Maybe?

We have had, for some time, a term on our order form for all communications service a requirement to agree to:

"(OFCOM GC20.5) You confirm that you, and all end users, have access to a missing child helpline using 116000 - i.e. you all have mobile phones, landlines or payphone you could use to call this number. Sorry, stupid clause I know, blame OFCOM."

The new GCs that come in today are slightly saner and only apply where we are providing services "for originating calls to a number or numbers in the National Telephone Numbering Plan, excluding any Click to Call Service". Finally these requirements for access to the missing child helpline no longer apply to anyone providing any communications service (e.g. broadband or leased lines, etc).

So, at last, the requirement is removed from the terms on our order form. Our telephony services do allow 116000 to be called.

I should add that is this insane in the first place, as the 116000 "missing child helpline" is (a) not for missing children to call, i.e. the people that may need to remember some special short code (116000 is not so short), and (b) simply passes on details to the police, it is not a counselling service or something otherwise more useful than FUCKING CALLING THE POLICE IN THE FIRST PLACE.

This, and some cookie laws, are the few cases I curse the EU stupidity. But at least whilst we are in the EU we can try and fix these.

Also, OFCOM have finally removed some of the requirements to provide directory enquiries and operator assistance. The Internet replaced these a long time ago, but OFCOM still needed them until today.

2018-09-30

Being a fucking idiot, or just getting old.

I am seriously kicking myself over this, massively, but the outcome is not as bad as it sounds!

I have visited the US before, and I know one needs an ESTA. I wanted to ensure it was up to date as considering a canal trip next year maybe, which involves US.

So, I googled ESTA, and made a huge mistake, I click on the first link. I won't give the web site the credit of being listed on my blog post.

This was fucking stupid, and I really am not sure if just because I had drunk too much or what. Being a bit drunk is an insight in to being a bit stupid at times.

The real trick is that is was not a .gov domain.

The problem was that their web site was very slick, and more so than the "proper" US Gov web site. That should have been a clue.

At the end I realised they charged me $99 to my Amex. Well done for the Amex app telling me this. And calling Amex was no help as they said basically "the site is legit and some people do use them". They did advise to complain though. They gave the impression I am far from the first to make such a call to them!

What is good is that (a) the ESTA went through, and (b) they emailed back confirming that $85 processing fee is now refunded because of my complaint.

What is odd is the way it showed on Amex, as "ESTA VISA SPAIN" and as a vague UK address. They clearly automate it all and so the $85 is money for old rope. I imagine they have a simple policy to refund the processing fee when asked so it makes life simple and no actual loss to them.

Obviously I should not have fallen for it, and I feel like an idiot, but at the end of the day this also saved some hassle. I went to the ESTA site and it insists on US address, which was skipped via this "agent". As it was "On a bloody cruise ship" that was not easy to do and so it was hard to progress that on the real site.

I still do not know if we will do the cruise, but having an ESTA at the proper price of $14 fee is much better.

2018-09-27

I thought PDF solved this crap

This is all about the tools used, and how they maybe don't quite fit together sometimes.

I have been working with the people at Ivory Graphics, as you may know. Having done a few things with them I am now quite good and making the artwork in the right format for them.

Little things like, if I have a pack of cards, making it a single multi-page PDF is better for them than separate files for each card. It also ensures they know the order I want the cards to be in, which can be nice. Another small detail is interleaving the face and back of the cards in the PDF - this is crucial for a marked deck or a deck that has stuff separately on both sides of the cards for example, but they do have macros which will take one "back" and slot it in to a deck as well.

But how do I make the artwork?

Well, I start with SVG. In fact, for the card faces, I have SVG and C code, and the C code has some SVG in it (like shapes of the suits and digits), some it constructs with code, and some it pulls in from files (like the various layers of court card artwork) which I originally edited in inkscape, and it constructs final SVGs.

However, for the box designs I have used inkscape to create and edit. The original PDF from Ivory (they have templates on their web site) is imported in to inkscape, and split in to layers to allow me to make a design. In some cases I have then imported symbols and whole playing cards from my generated SVG. It works well.

I then have scripts which use inkscape command line to export PDFs and then pdfunite to make multiple page PDFs with card backs in the right order. I do the same for the box, making one PDF which has all of the cut and fold outlines for reference and one that does not, ready for printing. I view the PDFs either in Safari or using Preview on my Mac.

Here is the latest deluxe Stargate box design as an example. I exported as PNG from Preview:


I can, of course, view the SVG for this in Safari too, works well, except that the gate symbols at the top do not show! This is because they use SVG "symbols", which seem to not to always work in Safari for no good reason. In other cases they work fine, so really not clear. Also, bizarrely (having just checked this to make sure I was right) Safari has stopped using the fonts in the SVG (that are loaded on this Mac) so it actually looks very wrong indeed! That used to work, so I'll have to figure out why it is not (I did update my MacOS the other day). This is a screenshot from Safari on my Mac:


Anyway, the final product is PDF format, albeit using RGB colour space. Ivory Graphics cope very well with converting to CMYK for print, I have to say, so that has not been an issue.

PDFs "just work" as you probably know. They embed fonts as needed, and they are a consistent format, and I have never had any problem with PDFs, honest. Seriously, it is impressive - so many other formats for things, even (as you see above) SVGs, are not reliable, but PDFs just work. So it is very sensible of Ivory Graphics to prefer PDF as the means to send them artwork.

But, to my surprise, this is not always the case. It seems that the Stargate on the box causes problems, and it is not clear why. The same Stargate on the card backs was no problem! Loading the PDF broke horribly for them with bits missing in all sorts of places. The comment was "And when I attempt to crop it, other sections drop off.". This example is the previous version on a white background, but you can see the cards are broken badly, and bits of the gate are a mess. What on Earth is going wrong?


This was, I believe, loading in to Adobe Illustrator. To fix that she did something involving Photoshop and then Illustrator, and probably something else, and managed to sort it. But this time she failed, and different ways of loading caused error of not recognising a shading or getting colours wrong. She spent time creating new shading even but was not entirely happy with it.

I am really surprised by this to be honest, PDFs really should "just work".

However, there was a fix, which I stumbled upon, and it "worked perfectly" allowing the PDF to just import with no problems. The alternative was to make a raster PNG which would work, but can lose detail.

What did I do? I opened in "Preview" on the Mac, and did Export PDF from it. The result was on the wrong page size, and even rotated, and a different (smaller) file size, but still properly vector graphics, and apparently loaded with no problem in to Illustrator and whatever other tools she is using. The proofs she then produced just looked spot on, and no problems at all.

Unfortunately we live in a world where we are removed from the nuts and bolts of such file formats enough that you have to basically play around at a high level until something seems to work. It is a shame really, and not a situation I like. Whilst I have good understanding of Postscript and SVG (and PNG), I don't when it comes to PDFs. Someone that does could probably explain what inkscape did that was special in some way that it sometimes breaks Illustrator but not breaking Preview.

Just goes to show that some times the simplest solutions work best, and a useful tip for next time. And well done to Zsuzsa from Ivory for her hard work on this. It is nice dealing with a company that really do try to get things right.

QR abuse...

I'm known for QR code stuff, and my library, but I have done some abuse of them for fun - I did round pixels  rather than rectangular, f...