Friday, 27 December 2019

Be Aggressive....

SPOILER ALERT!
I just came back from watching Jumanji : The Next Level.... And... And... yes, good film, the wife and I like them, but I was very ... LIKE VERY... surprised to hear a reference to "Be Aggressive"...

A song from Faith No More's 1992 album "Angel Dust", an album I not only own but own two copies of in different formats, but it's a family film...  In case you missed it, the song is about oral sex, rough oral sex.

So a family film, and the character who made the reference is like what 18, 20 at most, and I can't for the life out of me figure out the pop-culture link from 1992 to that characters mind even via an older script writers pen.

Its gnawing at me (no pun intended) like some ungodly experiment in Kevin Bacon's six degrees of separation.


I just hope that it's not some cheer leader chant the parents are snickering about making their cherub kids sing about from the side lines.

Wednesday, 25 December 2019

C++ Programming : SDL2 Graphics Rendering Loop

Today, it's a bit of a programming ramble, I'm literally throwing this code together, from memory and the docs... What does it do?

Well, I set up an SDL2 based graphics project.  Added font loading and set up the compilation environment and get something updating on screen, at the end there's then a second short video debugging a flickering... or if not properly fixing it, I at least start to pull the thread as to what is going wrong.

You can find the final code here: https://github.com/Xelous/Frog


And the short follow up:


Thursday, 28 November 2019

From intel to AMD...

Well, that just happened... I bought a Ryzen CPU...

That may not seem a huge revelation, but let me be clear in my PC's I have always (well nearly always) had Intel CPU's.  But the current 3rd generation of Ryzen has Intel on the ropes and I have to get moving with my new PC build.

And I've gone in what may seem a strange direction.

Initially I thought about third gen Threadripper, but I really can not justify the expense, most of my work is done on servers and though I could bring it all onto my workstation for compiles (like LLVM) but really its a convenience and not worthhy of nearly £2500 (after a processor and motherboard).

So what did you do Xel?... WHAT DID YOU DO?

Well, I've gone with an AM4 socket motherboard, a very good AM4 socket motherboard, and I've gone with a 3rd Gen Ryzen Zen 2 architecture processor, but perhaps not the one you'd expect.

You may expect me to have gone with the Ryzen 9 3950X, and you'd be right sometime next year, when they're properly out and in stock and prices have homogenised some.  But today, pre-Christmas, they're like rocking horse shite and costly.

The processor I've gone with then is the Ryzen 5 3600X...

Yes, it's Zen 2, yes it's AM4... Yes it's only 6 cores and 12 threads like my current workstation machine.  But it was only £200.  It comes with the stock cooler, so I cam practice with that before delving into fitting the AIO.

I've gone with an Asus ROG top tier motherboard for this class of processor, and I plan to let it go up to the 3950X with it's 16 cores and 32 threads sometime next year.

Memory, I've gone with two sets of 2 x 16GB Corsair Dominator RGB.  For a total of 64GB of RAM, which is a massive upgrade and maxes out the motherboard.

For that's the big thing I'm giving up, if I had gone with the threadripper3, then I'd have automatically had access to double the RAM slots (8 to be precise) and 128GB of RAM is common as a maximum on the X399... But here on the X370's it's usually 64GB (though some are 128GB).

The motherboard, RAM and processor all come from Amazon, for (to me) the princely sum of £700.  So the whole new machine, with the PSU, AIO, Case and storage I already have has topped me out at £1,100.

Expect build videos and tech tinkering footage soon.

Tuesday, 12 November 2019

Second piece of kit....The PC Case

And so the purchases start to roll in, tonight I've ordered a new case and I've gone with the Corsair Obsidian 750D Airflow.


I plan to swap out the vanilla fans at the front for RGB ones and the cooling solution is likely to be a waterblock to rad with RGB too... ditto RGB on the memory.. so a little bling.

But, tonight the case, it's the all black version... it is "Obsidian" after all, with a window on the right side, so I will be able to see it all to my right as I sit at my desk.

I'm planning to make the current machine my main office server/file server, but that'll be when I move onto an all Linux base.  Yes, I'm going to retired Window as my main boot environment and go with Ubuntu.  And I'll run VGA passthrough on KVM to a Windows machine if I need to play games or run VS.

Everything else will go onto my file server, and in that direction, I've also ordered two more 4TB Drives.  I'm only getting WD Blue, I've had great personal success with WD Blues, only having one failure in about 15 years (mucho lower than Samsung, Sandisk, Hitachi and Toshiba).  And then I got excellent customer support.

So, 8TB more storage... I've also gone with a 500GB SSD, again a WD Blue.  Because I have a 500G NVME M.2 SSD I can pull out of my current machine for the main boot.

I'm sticking with my EVGA 1080 GTX SC graphics card, and I'll put the older 770GTX SC into the file server - or maybe something less power hungry.

Either way, at the moment the new machine will go into this new case and the old machine will remain in the now very aged but trusty Coolmaster Cosmos 1000, except I will eventually recase even that in a matching Obsidian, maybe one without the airflow front and I'll keep the Cosmos as a spare (you never know).


But, all this is on order... The only part to yet arrive is the power supply.

I've had some Molex to SATA death cables arrive too, but they're for a server project which I've been trying to film for you guys for a few days.

This isn't to be confused with my current under desk server, which you can see me working on the case here:


I've also started to record snippets of my review of the 6 core 12 thread laptop I've been using for the last 6 months, so I hope to start editing that together.

I will also, hopefully, this weekend be able to start showing you why there has been a large chunk of time missed in my posts... What have I been busy doing?... 

Sunday, 10 November 2019

My First Piece of Software

What was the first piece of commercial software you wrote and what did it do?

This was a good question I was asked by a student interviewing me about my entry into being a software engineer, so I thought I'd share the answer.

It was a PC auditing software application, written in Turbo Pascal for DOS, it scanned your files identified a bunch of known executable and produced a finger print of your machine (linked to either the network Mac address or the BIOS serial number) it showed a number on the screen and I had a silver (label) punch to put that number into a hard metal sticker and put that onto the PC case.

This was used by Claremont Garments* (by me actually) to audit most all the machines they had, it was related to a commercial product we'd bought to do a similar task, but after a bit of tinkering I found my own solution did the task better, and I could export the data to a spreadsheet to produce reports more easily and cheaply than paying for the custom import tools.

I used this software throughout the UK, I sent it to a bunch of folks working with me from the London office and then North East office and finally it went with me for my sojourn in Morocco to audit everything.

I was actually waxing lyrical just today about in order execution of the 486, that first piece of software of mine was definitely operating "in order".

To this day I have fond memories of programming in Pascal for DOS.  And though this was not the first major piece of software I'd written, it was the first used for a commercial purpose and by someone other than me.




* Interesting link to the past, the Claremont site at which I worked was the Selston Factory, which is the town in which I now live... I have fond memories of that job, and I think a fair few people around here remember that factory.  It lives on under "Lilley Close" which is built on the site, but there is a commemoration of the factory in its original "Wood Bastow" incarnation.... That maybe another post I put together, to share with you all.

Saturday, 9 November 2019

How did I halve my Build speeds?... Oh

Deconstructing my build hive... As you may tell form earlier posts this month, I'm on a mission to sort out some of my equipment and either recycle it or whatever, and on this mission one of the first stops has been the older dual socket servers, which live in the garage on an ethernet spur at the moment.

And, I've taken them down, now I didn't really appreciate how much they lent to my build times, as my main app server (on which I coordinate the building of gcc projects with distcc) started to report 4x longer builds (on average) and I couldn't find a reason for it.

I looked at the app server, I looked at the jobs being thrown about and really there was no reason for the massive slow down...

Until I remembered something about my VDI set up, the app server used two sources for it's virtual disk images, one local and one was passed over to the containers on the garage servers, these images could be mounted over NFS but more regularly I had the garage servers sync them and mount locally from their local disks.

In migrating the build containers back locally to the app server, I'd moved the containers from their local loop mounted VDI's to ones hosted on the app server... From being mounted from 15,000 RPM SAS disks at about 12gb/s to a SATA 7,200 RPM disk at 6gb/s.

I'd essentially halved the disk speed of my builds, and totally forgot about setting this all up, now I did this years ago, it must be about two years since I set it up and it's been nearly a year since I moved house and started everything back up on the ethernet spur, which necessitated using the copy/sync and local mount option to get over the slow 10mbs ethernet in the garage.

My plan therefore is to get the new power supply, experiment with the supermicroo motherboard and then see if I can set up a new ZFS based file server on that SAS controller... Watch this space.

Friday, 8 November 2019

Dull Directory Colour in Ubuntu Server

One of my problems with the latest version of Ubuntu server is the default colour for the ls command, I'd never engaged with this before, but it's a dark blue.  It's probably always been dark blue, if you perform ls with "--color=auto" you'll see it's probably dark blue, but the server always left it without the default colour... until now.

And I can't see the dark blue very well, I have reduced the amount of blue light on all my screens and dimmed things down for long hours in front of the screen, so dark blue really really doesn't work.

I have to change my folders, but I don't want to overload everything... Only the directory colour, if you take a look at the ~/.bashrc file then you will see ls colur defaults to auto:


But, I figured out that the colour will default and THEN another alias will over ride... So, I leave the auto alone and add a new alias at the bottom of the file:


This is setting the "di"rectory to colour 33, which is orange...

Reboot and this is what I now see...


The cyan colour for the files is coming from the auto, the highlight around tmp likewise.  But the orange is coming from my alias... Lovely, now I can read the server information even on this dim dim screen... eye candy!

If you want to follow more of this, check out this source.

Thursday, 7 November 2019

Doubled my All Time Views

Since September we've doubled my all time view count, it was around 250,000 total views for all time... As of the time of writing 456,000 total views.... In just over 2 months?

I'm a bit amazed.

Pageviews all time history
465,076

Wednesday, 6 November 2019

Personal PC Kit Stock Take - And First new PC Part Purchase

It begins.... A new PC build.

Yes, its that time, I simply need more power in my workstation on my desk.  I've been farming more and more work off to servers throughout the house, and I did a stock take... of all my kit... I've not done this since the house move, and indeed I documented the last stock take on these pages.

Workstation
Xeon X5670 (6 core, 12 thread) - 32GB RAM - Used all the time

Single Socket Servers
Xeon L5640 (6 core, 12 thread)- 8GB RAM - DistCC slave, Git Host & Fire Host - Used Rarely
Core 2 Duo E6750 (2 core, 2 thread) - 4GB RAM - General always on server (VPN Machine for Chaplain)


Dual Socket Servers
Xeon E5240 (2 core x 2) - 16GB RAM - Dist CC slave, Squid Host, Proxmox Host - Used Rarely
Xeon E5250 (2 core x 2) - 16GB RAM - Dist CC slave, Wow Classic Staging server - Used Rarely
Xeon E5430 (4 core x 2) - 32GB RAM - Dist CC, Dell BMC Test bed, ZFS mirror, Docker container host - Always On
Xeon E5430 (4 core x 2) - 32GB RAM - Xen Server Host.
Xeon E5340 (4 core x 1) - No RAM - Spares for other Dell Boxes
Xeon E5-2620 (6 core, 12 thread x 2) - 128GB RAM - DistCC build coordinator, main server - always on


It has to be said, nearly none of the server have been used regularly as I've just been so so busy.

Laptops
HP Omen (6 core, 12 thread) - 8GB RAM - Used Rarely
PC Specialist (4 core, 8 thread) - 8GB RAM - The Wifes machine, used as a network drive mirror
Lenovo ThinkPad E480 (4 core, 8 thread) - 16GB RAM - Main Laptop


What I decided is, a lot of this server infrastructure has got to go, and to do that the tasks they do - even in frequently have to be picked up by something, and I decided that as I usually spend my time in my new dedicated office I may as well have as much of that working here in the room with me.

The immediate points were to take all the work of the two main machines, the E5-2620 dual socket server (so 24 threads) and my workstation (12 threads), that's 36 threads of work to contend with doling out.

But, I immediately thought about keeping costs low.  The E5 class of Xeons have come down in price and have 10 cores and 20 threads, two of those maybe the way I decide to go... Forearmed with 40 threads, it's a case of getting a dual socket motherboard for my workstation, and since I game on the machine too, perhaps the slower L versions of that class wouldn't cut it... But research will be had.

128GB of RAM or more, seeing as these processors are last-gen that means DDR3 and specifically server EEC DDR3, which is fairly cheap.  And of course I have a whole bunch already in the house.  Unfortunately I have 128GB in 4GB sticks, but it's enough to get me up and testing x79 motherboards from aliexpress.

With the stock of parts I have on hand, it's therefore a the task of recasing things, making them quiet and having them bearably in the office with me.... I've been enamoured with the Corsair Obsidian range of cases for a while... But even before the case, power... 

My E5 based server is a Supermicro, but the motherboard within is actually just an EATX board, so with a spare PSU I could power it up in a new case maybe... And that's where I've decided to start... My first purchase therefore has been a new PSU.


This is platinum rated, that's highly highly efficient, it's all Japanese capacitors, it's workstation class and completely modular.

And you know what, it's only the third power supply I own, you may recall the Xmas Eve rush for a PC from a mate of mine, well I'm pretty sure that the problems there were the PSU in that machine... And I had no spare to offer, felt quite bad about that.  But now I will have spare, because my workstation will be shuffled down one notch into other devices.

The last focus I had on cases was cheapness...


The next one will be style & function.

Tuesday, 5 November 2019

October 2019

I just realised, October 2019 is the first month without a single post since this blog started... I really must make amends.  Sorry October!

Monitor Stuck in Interlaced Mode?

Sorry for the very long delay between posts, I am just incredibly busy... But, here's a problem I've just had to solve and I thought worth coming to these pages for... Ever had a screen stuck in interlaced mode?

So my monitor is an Asus MX27AQ, really nice screen, but I was part of Alpha testing of a game at the weekend and it had set the game into what appeared to be 1920x1080@60hz interlaced mode.  I have NO idea why the game did this, but it was all testing and work in progress, they had a report and I closed the game.

But, it left my screen stuck in a strange way, it wasn't interlaced it had gone back to progressive, but it was at 59hz not 60, no matter what I did with drivers or windows display settings it was stuck at a lower refresh rate, selecting 60hz just resulted in no change and the "Do you wish to keep these changes"... Nothing was happening, either accepting them or reverting them.

And the horizontal pixel clock seemed to be off, now I could not change this setting, either in the screen controls, windows display controls nor by removing and reinstalling the display driver nor graphics card driver, even removing all the settings seemed to leave the screen still in this situation... I reset it, re-powered it, disconnected reconnected... I did everything physical and software related.

Absolutely frustrated I then delved a bit deeper, and inside the nVidia display settings I found "Create Custom Resolution", you can get to it on your own nVidia card via their menu...




The key thing for me was to create an invalid resolution, so I just changed progressive to interlaced...


And hit that "Test" button at the bottom.

The screen went on the fritz immediately, but only for 15 seconds as I didn't accept the changes and the screen righted itself.

Properly righted itself, all the settings came back, the pixel clock skew was gone and I could see 60hz and select it for the display again.

I think this was a case of the screen itself holding onto some setting maybe on its own firmware... I'm totally guessing... and in kicking it again via the nVidia driver I cleared the bad settings out.

But, the did persist, over power cycles, over reboots, over removing and replacing the drivers and even taking the screen to another PC (in my case a laptop) I even changed from a Display Port cable to an HDMI cable.  The only thing to sort it out was the bad custom resolution and letting the display return to "normal".

Sunday, 22 September 2019

Taking a Strole

That moment when you're out walking and wish you weren't... No, I'm not talking about the company, the weather or the time of year... I'm talking about the sudden warning about military debris...

Saturday, 21 September 2019

Annoying Neighbours Update - The Solicitor Speaks

How have things gone with the annoying neighbours?.... Well, from bad to worse, though they'd argue otherwise.

A turn up for events, which gave us hope they'd seen things with a modicum of empathy they started to park one of their cars in front of their house, not in front of ours.  The other one remained where it was, but remember we'd been told they planned to clear the garage out and move one car into their.... So we were under graces that there'd now be one car out of sight and the other in their own double garage.... NO MORE CARS ON MY LAND....

Except, immediately, this meant they had one car parked and a space.... or what everyone coming to their house took to be a space... and they had a slew of visitors, ranging from a few hours to overnight stays, all coming and going too-ing and fro-ing using the right hand end of my drive as their parking spaces.

It struck us immediately that they've only moved the car to free up a space and please themselves, it was NOTHING to do with empathy for us.

We've tried to speak to them, we've sent them a nice letter setting out a few rules and granting basic permission so long as they tow the very thin rules, but to no avail, we've tried to mediate and let them but giving and inch simply seemed to see a mile taken.

It was solicitor time.

We actually spoke to our solicitor in July, he's asked us to just sit on the topic, see if it was a one off and to be stern with ourselves to ask "are you being unreasonable", but then these visitors started and then th eguy began using the area as a place to drill out and nail length of wood - nails or gawd knows what potentially going down the hill onto my drive - and then with the doors open on thei double garage all summer as he's been "working" in their... it became apparent it was a joke, they'd unilaterally decided to convert part of their buildings for another use and their solution to parking was to just park on my land.

So, our solicitor did his thing, and he turned up an interesting covenant from the original construction of the houses..... That the occupants of that house can not do anything which disturbs or which causes a loss of environment for occupiers of my house.... This was set out in 2002 when they were built.  There is apparently an auxiliary list of things, like not parking a vehicle in front of the garages, no vehicles, caravans, storage units or other unsightly items to be stored unless explicitly agreed and not for more than reasonable for the purpose of access... So, lets say they were moving house and they hired a huge van, they could ask and I would reasonably say it could be parked there maybe over night, or for a few days whilst they moved... see... but not for ever, not the norm.

Our solicitors letter was quite to the point and polite.  We know it was sent yesterday.... it clearly just arrived.

The woman from next door is literally out stalking the street telling anyone and everyone who'll listen of her plight.  I'm sure she's making something up about her being old and their having been reasonable, and it being us whom are unreasonable.

What she doesn't quite get is, I'll hear all this, I'll hear what she's been saying, I'll extend my solicitors instructions on any defamation occurring.  And that we're in the right, we have all the photographic proof of cars routinely being there and coming and going, visitors, family and their own... Which are not just for access, but are to park literally occupy that end of my drive way, in full or part the cars are parked on my drive that's the point.

And you may recall my attempts to speak to them:
* Moving in day - totally overwhelmed me, gave them verbal permission to carry on as we saw no harm.

* Easter 2019 - verbally he approached me to check whether being "so far your land" was acceptable - for you and your wife yes - and he immediately had visitors, a camper van thing and then his daughters parking all the time, they'd even go so far to move their own car down onto the road to make space for the vistors to park (and these aren't infirm visitors, these are fully able bodied people - before that comes up).

* Camels back - The incident of my asking them not to park cars there and the guy went crying at me, then crying at the other neighbour, and then later his wife came over and when I asked about the cars not parking there, especially the large camper van thing she said "Camper van, do you not know how much that cost?" - I don't really care love, move it.

* The massive blow out - their visitor had completely blocked the drive the day my Rabbit needed vetinary care, utter nightmare... But they didn't even have the decency to talk to me about it.  This was when the next day, I stopped to just heads up about it, I was even going to say "That's not your fault he'd parked there, just ask them to move, no biggy" - and the guy just literally moaned at me and waved his hands as he could not be bothered with me...

Solicitor time, done, lets see what the idiots say, we've been basically advised if they've got a large double garage and have found a space besides their property for a car anyway, they shouldn't be parking at all in front of mine ever and a judge would essentially conclude they have adequate parking and their repurposing the building shouldn't impact on the use, enjoyment of environment of our property.

This whole thing is long since due, as we understand it, the vendors who sold to us; very sneakily not mentioning these issues; moved partly because of this issue, except they themselves had enflamed the problem by blocking the right of way... Instead of talking and checking their rights, the old fella who lived at mine before me just pulled his cars forward to completely block the road... which put him himself at a loss.

So, here we are just shy of a year of moving in, finally getting it down official, don't park on my land kids, go park on your own or the road, enjoy!

Wednesday, 18 September 2019

1am Cavalry : A follow up

As a follow up to the horses being loose the other night, my wife and I were the ONLY people to go out and get them home, to corral them out of the street and back up the hill, to wake the yard owner and get her and her partner to help get them safe.... THE ONLY PEOPLE.

Yet, my wife has been stopped three times by people to tell her all about it... As though they were there.

Folks who were NOT there, who were NOT out helping, who do not even own horses, "Have you heard about the horses, they were up and down here".

One woman even said "Oh yes, I looked out and saw you were on it so knew they'd be safe"... Really, two people sorting out nine loose horses, you were a lot of help, jog on, love... Jog on.

The arrogance of these people, trying to feel involved, especially when they try to patronize that they know all about it and they're doing you a favour of involving you.... I think they feel that by telling you about their little world they're involved in the community, but their community is based on gossip and bullshit, there's nothing solid to it, nothing real about their little suburban folly.

It's a little bit sickening.  

You were not involved, watching out of the window does not make you part of the solution, it does not make you part of events, to be involved you have to get out and get doing.

Total idiots these people, total and utter idiots, and they've quite annoyed the both of us.

Tuesday, 17 September 2019

The 1am Cavalry

I'm having a hard time sleeping tonight, we ate late... And it's lucky I'm disturbed, as in a hazy half sleep laying here I could swear I heard horses hooves, then I definitely heard horse shoes on iron (once you've heard that sound you'd never forget it)... And then I heard something (or somethings large) on our gravel...

Oh yes, turned out to be something like 8 or the horses from our friend Julies at the top of the hill.

Strangely one of the horses in this pack I'd actually owned, Ted.  So he knew me and calmed right down, but it appeared the rest of them were not happy at being loose.  So, using Ted as a guide pony I let them lead off back up the hill... They had a few pit stops on the way, notably one of the gardens now totally lacks all the roses it had earlier in the evening.

But disaster did nearly strike as instead of finding the gate open for them to return through there was a closed locked gate, how the heck had they gotten out?  And more to the point how was I going to get them back in.

Luckily the wife arrived with a torch and kept them in a building site area at the top, not the best place but no-one, literally NO ONE else came to help, despite our seeing lights springing on, no-one came out to help, they just stared slacked jawed.

So with the wife holding them in a little, I went to get Julie up, she only lived a few doors down... She was mightily surprised and soon reinforcements to our make shift corralling arrived.

After they were back roughly in a safer place we paced back, they'd gotten out of their paddocks through two gates, two gates opened and left open by pedestrians....

DO PEDESTRIANS NOT KNOW HOW DANGEROUS IT IS TO LEAVE A COUNTRY GATE OPEN?

Eight, if not more beautiful horses could have been killed or worse passers by trampled or car drivers insured or themselves killed by stampeding panicked horses all through your taking a short cut rather than going through the allotted human sized, self closing, appointed foot path gate... Just because the large animal gate is 30 feet closer to where you want to be use the stiles, use the county council fitted weighted gates DO NOT open animal gates!

So, here I now am 2am and wired... I've been on a post-midnight mission...

I hope all the horses are back, and I hope they've not got cuts or grazes after going through the brambles and detritus in the builders yard.  I hope the lazy builder puts the wall he's taken down back.

And I hope at least on lazy pedestrian reads this and stops taking short cuts.

Friday, 13 September 2019

PC Overclock and Boot Issues

I've had a bit of a rough ride the last few days, my main workstation PC has been playing me up chronic.  The first signs of problems were a failure to post, then I had a VGA missing error in quick succession.  Power cycling at the wall I got a post but the drive order has been lost.

My immediate thought was perhaps the graphics card had worked loose, I ensured it was seated and rebooted, all seemed fine.

However, getting into windows I immediately felt a sort of sluggish feeling, taking a look around I quickly saw the problem I'd lost my overclock...

To remind you the machine is sporting a Xeon X5670 overclocked to 4.0ghz, but it was running at a stock 2.53ghz, and I could really really tell.

So, back to the BIOS and I suspected I'd lost the overclock and the drive settings because of a flaky motherboard manual.

Swapping the battery out and reapplying the overclock and everything seems fine, I've even reset which drive to boot from as I'm not booting from an M.2 PCIe NVME.


But it has been a trying time, and it's really set me back... Watch this space for a 6 core, 12 thread potential replacement...

Saturday, 31 August 2019

World of Warships : Code Give Away

Hey readers, sorry I've been absent so long... To make up for things, for my five readers who use these codes there's free stuff on WarGamings World of Warships.... The code can only be used once and only one per account, so once you've used one you've used all you can.

Find me in-game on the EU server as "Xelous" for some Coop battles.


Codes for Existing Accounts:

HEBCT-VN2E8-G4K6X

HEBCU-XSBPF-M64PC

Existing players can redeem your codes via the Wargaming.net shop.

Codes for new players opening an account:

HEWCB-H48ZV-PVGFY

HEWC9-TRFAK-5R9M8

HEWCU-5YEYS-A395Z

If you want to sign up for a World of Warships account, click the link below where you'll get some bonuses and so will I... https://warships.net/Xelous

Monday, 15 July 2019

Willful Ignorance (C++ Templates)

I had a moment last week where I was a little down on my C++, you see I'm a very old programmer, by programmer standards, and my experience with C++ stems from a time before templates, this may amaze and delight in equal measure as template use is so ubiquitous today, however I've been using find & replace style boiler-plate code in the form of both macros and code-gen for literally decades.

Templates however have not been my go to option, because of that weight of experience.  I actually find picking apart heavy template code quite hard going at times (I think a lot of us do).

But I was down as a valued colleague (Hi D if you read this, you know it's you) described this approach of mine as "willful ignorance".  And he was right, I have to put my hands up and admit he's right.

As such I took a look over my old state machine repo on github and realised there was a bunch of boiler plate stuff I was doing with both macros, or not doing at all, which could easily be made to leverage templates.

Watch this space...

Thursday, 27 June 2019

C++: make_unique friendship

I've previously posted about adding a friendship to the shared_ptr base class to allow a public static function containing a "make_shared" to access private constructors....

Well, here's the partial move I've started to make in my own code bases to do the same with a unique_ptr.

#include <iostream>
#include <memory>

class Item;
using ItemPtr = std::unique_ptr<Item>;
class Item
{
public:
    static ItemPtr Create()
    {
        return std::make_unique<Item>();
    }

    const int& Get() const
    {
        return value;
    }

private:
    friend std::unique_ptr<Item> std::make_unique<Item>();

    Item()
        : value(42)
    {
    }

    int value;
};

int main ()
{
auto i = Item::Crete();
std::cout << i->Get() << std::endl;
}

The secret sauce here is the friend, making the "make_unique" function a friend allows it to access the private constructor.

We could water-tight the "Item" class here by deleting the other constructors...

Item() = delete;
Item(const Item&) = delete;
Item(Item&&) = delete;
Item& operator=(const Item&) = delete;
Item& operator=(Item&&) = delete;

This way we stop any assignment to the type or construction except through the static "Create" function.

Nothing truly amazing here, but I challenge you all now to go add a parameter to the constructor... const int& incomingValue... perhaps and add it to the "Create" and try to set "value" to 100 instead of 42.

The template deduction for the type becomes a total mine-fiend, as the compiler wants to marry  up the "Type&& ..." underlying the parameters rather than treating it as a pure standard forward.

Saturday, 22 June 2019

Problem Neighbours - mY RanT FOr SanITy SaKE

Ooooommmmmmm.... I will remain calm..... Oooooommmmmm..... Neighbours eh... Everybody needs good neighbours, just a friendly wave each morning, helps to make a better day...

Yeah, not here.  So, we moved, just six months ago, on moving day the guy selling to us had what at the time seemed like a grand pantomime, he seemed to relish in stepping out the house for the last time and declaring the neighbours on one side to have been the worst neighbours he's ever had.

At the time we thought, Christ... and I even touched base with my solicitor whether this; whatever it was; should have been disclosed.  But it was not listed anywhere, querying there was no legal dispute it seemed to just be two folks not getting on.  Indeed, the neighbour in question popped around a day later to welcome us and gave us a potted plant, we exchanged christmas cards and thought nothing more of it.

Except, slowly over time, we started to see cars slowly encroaching on the drive...

Let me explain, we're in a block of three, a cul-de-sac off the main road, three houses in a row, with one tarmac area, the house to my left owned their whole front right out and we have an "easment" to cross it... Not a right of way per-say, but an easement such that anything related to the operation of my house I can cross their front... I then own the whole middle segment aligned with the neighbour to the left and my right hand wall... straight line.  Dead simple.

This line cuts right in front of the other neighbour, the problem neighbours, garage doors.

So, it's poor design, they're meant to store their cars in the garage, pull them out, shut the door and drive off... They're not meant to park on my drive in front of their garages.

However, these problem neighbours, before we even moved in decided to repurpose this double garage into a workshop, I had no idea of this when buying, none at all, the cars were not parked where they now were, but there seemed to be a status quo... So long as these parking neighbours didn't push it, we accepted them parking there and I left it with them as such when we spoke whilst I was out pottering and sorting the front garden.

Fast-forward two months, and suddenly they wanted to put a huge camper van there.  To their credit they came and asked if we minded, as rightly it would be a pain blocking the common access road to the whole close.  Fine, it parked there, but I said "this isn't a permanent thing, just a few days whilst you have these special visitors"... Fine, and it went, no problem.

You see, this cul-de-sac is on an incline, we're in the middle, nice neighbours to the left are down hill, problem neighbours are up hill... They say shit rolls down hill, but the problem with this incline is that their cars are at eye level as we sit in our nice new front room, literally there, no sky, no view just the underside rear of these cars which shouldn't be there... Which we're doing them a favour of letting them park there.

Fast forward again, and randomly this big blue VW van like people carrier appears.  This thing totally blots out what little view there was, just puft, no view... and it was a dark blue, so there was no reflected light either... It was a nice sunny day, but a miserable view.

Now, this turned out to be a visitor to problem neighbours, they stayed a few days.  I hark back to the other camper van and I you can see I gave an inch but suddenly it felt like a mile was taken.  So I waited until these visitors had gone, no-one wants to be embarrassed, and I quietly went to speak to the neighbours.

Well, never have I had such a drama.  The guy started to wail and grabbed his forehead "I don't need this stress, I saw all my mates shot in the middle east, I don't need this"... I was like, how the hell did I get from "can you refrain from parking that huge camper here" to combat casualties in the 1960's Lebanon or Sinai (he's not English BTW, this chap is Norwegian) plus he's hard of hearing, so I'm not sure he heard what I was saying at all with his own voice echoing in his ears.  It was a very simple request, just to make sure that the previous permission for the visiting camper, it was clear, didn't extend any further, that I didn't like it.

After all, it's my land... And this seems to be the crux of the problem, they want to use their garage in an unintended way, their solution then isn't to park somewhere else, it has been to park on my land.  Now, okay, I don't use that land and yes the width of it they have an easement over which they may pass, but it's a right of way, not a right of occupancy.

But the drama didn't stop there, this chap went to the other neighbours, the nice ones... Crying.

Now, he's in his mid-70's... and apparently sobbing that he's upset someone (we'll get back to that theme later).

My take away was he's got some form of PTSD, and I planned to speak to his wife when I saw her, she's always seemed more level headed, Poe faced and a bit stuck up, but sounded reasonable, and she's not hard of hearing and English so I thought there'd be no deafness nor language barrier.

OH HOW WRONG YOU CAN BE.

She appeared about an hour later knocking on my door, and her words about the visiting camper were... "Do you know how much that cost?"...

Like I was meant to be impressed!... Conspicuous consumption does not flatter the beholder love.  It was a dirty great tin can on wheels with a white plastic roof (can you tell I'm not interested in cars?) and even if it was say a Lamborghini sat there, it'd still have been sat on my land, in my eye line and not either of their (the neighbours) car which we'd had allowed.

Her then immediate reaction was to turn on the other neighbours, the nice ones, who happened to have a caravan on their front that day... "What about that caravan?! You've not told them".

No, because firstly the caravan was on their drive, in their car port, it was not blocking nor on any part of my land at all.  Second the neighbour herself had said, "It'll not be there long, I can't stand it being there, its only here before we go away at the weekend"... Which was all fair enough.

Problem neighbour didn't like that though, she stomped off... I called after her "Sorry"  I wish I hadn't, I should have stuck to my guns.

But I spoke to my solicitor about this, he said "keep it a civil matter, the moment you involve me you'll have problems if you ever want to sell.  But send them a letter, explain what you don't like, what you will tolerate".

So I did, I explained my intention was not to upset him, I explained though that it's quite ugly, not our cup of tea, that they are over our boundary and we accepted their two cars only as a neighbourly favour.  I didn't want to be petty and just summarily ban them.... I kind of wish I had now.

I suggested, maybe if they convert half the garage back and put one in, at least swap them over so the larger car is further away from my window.  And if they ever wanted to talk to us please do.  That they can park their two cars, but not visitors and if ever they, or we, put the houses on the market the cars to move immediately.  As I didn't want this to be inherited as a problem down the line.

That letter was handed over a month ago... What's happened since has been subtle signed of rebellion, so they did swap the cars around so the larger darker one was further away from the windows.  But then they started to drop the other one back... Not pull it to the garage doors as they had done... Just a subtle "fuck you".

Then, they started to slowly drift the cars pulling up towards the property, rather than sticking; as they had for so many months; to the far fence.

And then the drama yesterday... and just now....

So, both our rabbits have had operations and one of them stopped breathing and went blue, the vet needed permissions signing to act, I gave verbal permission and went to go sort things out... I was so frantic.  I called my wife to come back from the dog walk she was on and we'd swap, she'd stay with the dogs and I'd drive to the vets.

The wife came in, and said "you can't get out"... There was a giant van parked there... Blocking my entire front.

Now, I immediately recognised this van, it's a battered old 1990's ambulance with a hand painted sign about being a mean green machine.  It was just sat there, it belongs to a guy at the top of the street who has two such monstrosities.

I got my shoes, grabbed my keys, and went to knock on the problem neighbours door... I knocked... And rang the bell, and knocked... Nothing... 3 minutes seems like an eternity... Five minutes and I can vaguely hear voices down their far side alley, so I call down "coo, it's me from next door can you move your van"... Laughter, more chatting... 6 minutes seem like a very long time, I rang the door bell.. Remember I know the guy is nearly deaf, these voices sound male, so I call again... "Hello, can you move your van"... Nothing.

My wife calls to me, "they're in the back garden, call over our fence".

So I pop down and get up and call over, there's the owner of the van say chatting with the wife (she must have a very manly voice for it to sound like that) anyway, I ask him to move it "can you move your van"...

"Why"

"because I need to get out"

"Who needs to get out"

"I do"

"Alright, in a minute"

I'm getting mightily annoyed now....

"No, now, I need to go out now"  I don't want to say "cus my bunny is maybe dead" that's not macho enough, but this prick just gives me this fucking stare

"Who wants me to move?"

"I do, me"

"And who are you"

"Just move the van now"

He's grunting and grumbling but he steps into the conservatory on the back of next doors, and does the most stupid thing, he grabs his crotch with his left hand and makes the wanker sign at me with his right, like I can't see him... Clearly their opinion of me is that level, the owner of the house she sits there impassive, she doesn't say anything, she doesn't say "sorry" to me, or "please go move it" to this is a visitor to her house....

I see this gesture and I call "don't make that sign at me"

"Fuck off" he screams, literally, as he gets in his van "this is a right of way, fuck you"

"This is not a right of way, this is private property you are not delivering or doing anything other than block me in, this is my drive, my land, and if you make that gesture at me again you will regret it"

"Fuck you, I'll fucking knock you spark out"

"You will try, now move this shit heap off my drive"

"Fuck you, show some respect for your neighbours, how long have you lived here?!"

"Six months, and you have a whole empty road to park on, but park here blocking me in, you show some respect, now move it"

"I'll fucking knock you spark out talking to me like this, who do you think you are"

"The owner of this land, and you try and hit me you will regret it"

I don't think this floppy haired idiot has ever been stood up to before, he seemed quite willing to mouth, but had no trousers on, I meanwhile really, really wanted to break some part of his scrawny little know nothing body.

He finally moves, but I've not got my phone, so I turn around to get it and the vet is calling, I take the call.  Bunny lives, just she's blue but alive.

I quickly go speak to the neighbour, in the hope of pointing out this was exactly what was on that civil letter sent not a month before... her instant stance "it has nothing to do with me, Andy is having a hell of a bad time at the moment" and she's putting up her hands... I really don't care what kind of time he's having.  And a visitor to her house, blocking completely the neighbouring property, on a contentious issue they've already had a letter about and then said visitor being abusive and threatening the owner and person in the right.... Nothing to do with her.  Right, got your level.

I'm starting to see where this worst neighbour mantle awarded them comes from, because they are, they're awful passive aggressive people, stuck up and not a little spiteful.  I've told numerous visitors to park on the road, this guy as well should know that, he lives on the same street!  But oh no, "it's a right of way", his van was empty, he was in their back garden chatting... Fuck that, tired of it.

I left her there, went to the vets.

As I'm coming back from the vets I call through to the nice neighbours, after the pantomime of him going crying to them before I wanted to just nip any miss communication in the bud, not least as this abusive wally has two clapped out vans blocking both his drives to his wife parks his car on nice neighbours drive when they're away; which they are now.

Nice neighbour immediately said this Andy is an idiot, he's fallen out with multiple people over his time on the street.

As for the problem neighbours, she wouldn't be drawn on them, but admitted that this whole issue had come up with the people who sold this house to me, the moment they moved in these problem neighbours were take take take, push, push, push.

So, this morning, I'm actually again back from the vets, bunnies in their carriers on in each hand.  And the problem neighbour block, the deaf one, pulls up.  I wait a moment and say morning, and I say "That unpleasentness with Andy yesterday".

Before I can continue... "Its nothing to do with us".

"He was a visitor to your property, it is to do with you"

"It has nothing to do with us" and he lifted both arms palms towards me and motioned to bat me away like a fly.

I called after him "That's it now, I've tried to speak to you twice, clearly I can't speak to you, I shall not try again".

What else can you do with people like this?

I am very tempted right now to tell them to get the solicitor involved and just injunction them from parking on my land, they have a double garage use it.  And to reinforce legally that this easement is not a right of occupancy, and to clarify it's not a right of way.

So an easement is a permission that I have to give to let them cross my land, for the function and purposes of the running of their house, so deliveries and their own access to their border and garage front.

It's not a permission to park.

Now, on moving day the drama kicked off when the deaf problem guy did try to tell me the border was elsewhere from where it is, he tried to tell me it was dog legged off another wall and so he owned this piece of land his cars are over onto.  I immediately nipped that in the bud, and clearly they went back to review their own legals as he even verbally admitted "I am a long way over onto your land, are you sure you don't mind".... Stupidly I said, I didn't.

In hindsight, I wish I'd have said it annoys the shit out of me, because that's where we are now, that niggling annoying thing you can't yourself easily solve.  Legally they don't have a leg to stand on, they're on my land, on my terms, they've violated the civil request in a most uproarious fashion and then want to wash their hands of it.

If they'd say "I'm so sorry he spoke to you like that, he is in a bad place, I'll have a word with him" then that'd have been much better, pacify both parties, as you try to do, instead passive aggressive "nothing to do with us"... Like it's a sport, they're goading you on that little bit.

The ultimate step for me is to speak to my solicitor, give them a date to move the cars and my reclaim and affirm the land as mine.  That puts me in a difficult situation regarding selling down the line, we were not thinking of selling, only just getting here, but this situation is enough to put you off.

We shall see, but this is one of my rant posts, an insight into the passive aggressive or out and out yobbish behaviour of the British public.