Profile cover photo
Profile photo
David Alan Gilbert
chocolate eating computer geek
chocolate eating computer geek
About
David Alan's posts

Heck I hate JSON, Matrix's protocol is heavily based on it, and it's painful at times; ok it's not as verbose as XML but then very little is.
I ran into a bug in json-glib's parser where it doesn't like object's with members whose name is the empty string - I have some sympathy with json-glib's author saying that it's bizarre, but it is legal JSON.
JSON has arrays [ "dog", "cat", "penguin" ] and objects { "name": "dog", "legs": 4 }
but when serialising a hash with key->value it seems normal to output them as objects rather than arrays, e.g. you might get "legs": { "cat": 4, "dog": 4, "fish": 0 }
and if you don't have any restriction on your input to your hash then you can end up with the bizarre "whatever":{ "": 5 }
It seems to me the oddity is that objects are really two things - they're mappings from fields in a structure but they're also key/value maps that can be used that way.
They also have no order, so the only way to parse stuff is to read the entire structure in and then figure out what you've got; so for example you might have something like:
"thing": { "type": "animal", "legs": 4 } but that's equally valid as "thing": { "picture": "biglumpofpixels", "legs": 4, "type": "animal" } so you end up parsing everything even if you don't want to bother looking at the details of things that are type "animal".
But you also have to parse them because you can't just skip something without parsing it's contents; so streaming parsers are just a pain.

Finally deleted my linkedin account; all I've had from it is years of odd job ads; ok so I can see what job some ex-colleagues have but I reckon at least half of people dont update linkedin when they change jobs.

Post has attachment

Post has attachment
Ok, so last night was clouded completely - so here's a moon from last Saturday when we had a lovely clear sky. (Over the blade on the top of Manchester's Beetham tower).
Photo

To be able to see an eclipse of the moon I'd have to at least be able to see the moon..... The weather was definitely one week early

wth:
Jan 31 04:38:26 ip-x-x-x-x ntpd[16325]: kernel reports leap second insertion scheduled
Jan 31 07:33:50 ip-x-x-x-x ntpd[16325]: kernel leap second insertion cancelled

(from an AWS VM)

Post has attachment
Happy Chinese new year; this was being walked in Manchester yesterday.
Photo

Post has attachment
I reckon this is a 'Leafy brain fungus' - spectacular thing;
Photo

Post has attachment
The design of these LED light is quite different and interesting. They seem to be a very neat glass encapsulation.

Post has attachment
After my recent experiment with photographing laser print, I tried creating an image for a photo printer instead and took into a print shop; it took quite a bit of effort to find one with enough of a clue to tell me the printer model so I could look up the spec, the one I found had a Kodak 7000 printer - a 300dpi dye sublimation printer. I generated a 300dpi 6"x4" image and submitted it at the kiosk from a png. The 'Test' image here (click to see the full image) has from top to bottom, my laser printer (1200dpi Sammy), the input, the Kodak's print - both the laser print and Kodak are crops from the same photo from my camera. The 'T' in the test is one 300dpi pixel wide on the stem and one 300dpi pixel on either side of the top bar. I find it's quite interesting. Also interesting is the line image, the outer thicker line is 2 pixels (i.e. 150th of an inch) while the inner line is 1 pixels - I find 2 interesting artefacts, the first is the way that the 1 pixel horizontal line appears thinner than the vertical line it's connected; the second is the way that there are places where the vertical lines appear to overrun the horizontal lines, while the input shows they should meet.
Photo
Photo
14/01/2017
2 Photos - View album
Wait while more posts are being loaded