That's a really nice article, thanks. And I can see how separating the validation logic from processing code is useful.
What's not clear to me is why you chose this approach over existing OOP techniques, such as GoF Adapter Pattern, or even just interface implementation (as Go looses a lot of the ceremony of Java/C#).
> That's a really nice article, thanks. And I can see how separating the validation logic from processing code is useful.
> What's not clear to me is why you chose this approach over existing OOP techniques, such as GoF Adapter Pattern, or even just interface implementation (as Go looses a lot of the ceremony of Java/C#).
Thanks for that feedback! Really appreciate it and glad you liked it. I'm planning to try get a series of posts written about the project and also CUE.
You are right I could have used adapters and/or interfaces. The main reason I went with CUE was to keep the transformation logic declarative and in one place. With adapters, I'd still need to write Go code for each sensor type
The goal I had was to minimise the amount of changes I have to make in my Go code. With my current approach I have minimal Go changes and just additions to my CUE schemas. When firmware updates land or I add new sensors, I update the schema and the generic processing code just works.
The CUE schemas are also portable. I can take them to other projects without trying to make generic reusable Go code that works across multiple codebases. The schemas double as documentation too, so if someone asks what a sensor reports, I point them at the CUE file rather than explaining how various structs fit together.
Honestly I also just wanted to try building something with CUE and this felt like a good use case for it
* Don't have high fat/sugar snacks in the house - but do have an alternative you'll eat
* Move - low intensity exercise uses your body's stored energy (i.e fat) rather than using carbs
* Find other people to help get you through the tough patches - for me, making a commitment to someone else makes me more motivated.
The author doesn't state what RDMS he's used, but I think Microsoft's SQL Server Platform covers a lot of these, and third party tools, such as Redgate's amazing suite of DB tools, fill in a lot of the gaps.
My Firefox was a minor update earlier than the one on the sibling comment (72.0.1). It has updated now, and the site claims that my connection is down on my machine too.
Now that I have seen the message... It's a funny thing for a web page to claim.
If it's the UK, then you can book a seat on most services... if you're travelling distance during peak time, and you know in advance, then I'd recommend it - and being prepared to politely but assertively ask people to move if they are sat in your seat.
One thing that comprehensively confuses people using UK railway train reservations: The 'A' suffix on your seat number doesn't matter. When you have a reservation for 44A that doesn't actually mean there is a seat 44A distinct from seat 44, it's because somebody thought it's important to bake in metadata about how seats are arranged in trains, the A apparently stands for "airline" style for some reason.
If you hate reservations or are too disorganised to book one for a busy train, but also dislike being disturbed by someone who does have a reservation and wants you to move, most train operators have some rule about which parts of their trains aren't reserved, you can find that out and then travel in the unreservable part of the train. Finding a seat there won't be any easier, but you won't be asked to move later.
It is interesting how trains are offering better services even as planes suck more over time. Ten years ago knowing where to find power sockets in the Standard class 444 series (next to the cab at the far end from First class) made the difference between charging devices and going without, now almost every train has power sockets and/or USB, free WiFi (not _good_ WiFi, you won't be streaming video - but it'll let you check email and read Hacker News) and air conditioning.
> Finding a seat there won't be any easier, but you won't be asked to move later.
It used to be really easy. Reserved seats had a paper ticket stuck in the back. Virgin trains switched to a small LED display on the edge of the luggage rack. Rather than have a single word like "Vacant" it has a scrolling message. As do reserved seats. So you have to peer at every single display as the text slowly scrolls past to figure out where you can sit. I don't know if this is gross incompetence or part of their ongoing efforts to discourage unbooked travel.
The longer scrolling message is telling you, as you'd know if you read it, that this seat can be reserved even though it currently isn't. As I indicated, some seats can't be reserved, and in this case the message is far shorter and doesn't scroll. "Unreserved" is usually the word used.
Paper tickets can't be updated and so in some cases they reflect no longer accurate information. This is especially misleading for long distance services where many reservations may happen after the service departs from its origin.
The unreserved message definitely used to scroll without any mention of future reservations. Perhaps they've updated them or perhaps it varies by region.
Nope. Both aisle and window seats will be suffixed A. I almost invariably book window seats, they have an A suffix anyway.
There are other suffixes, but they relate to the layout of seating in a carriage and apparently almost all trains have "airline" style according to the nomenclature of whoever decides these things.
I bought Cormac McCarrthy's Border Trilogy on a whim (had seen and loved the film of No Country for Old Men before). I'm based in the UK, but it honestly takes you places you can never go. Read the whole three books four or five times nows.
I agree with this - his works may have a logic of their own, or they may not, or the logic may not be a logic that can be understood by any human. For me, it helps to think of them as dreams - there's some normal looking stuff, but then there's that bit where you're cycling up a lane that looks like one you used to ride almost weekly, with the head of the sister of a teenage girlfriend looming large somewhere you can't quite place. It doesn't have to mean anything.
What's not clear to me is why you chose this approach over existing OOP techniques, such as GoF Adapter Pattern, or even just interface implementation (as Go looses a lot of the ceremony of Java/C#).