tag:blogger.com,1999:blog-27181703211318383152024-03-13T08:07:37.322+00:00The Megalomaniac BoreA blog about my rantings, including Games, Game Development, Gaming, Consoles, PC Gaming, Role Playing Games, People, Gaming tips & cheats, Game Programming and a plethora of other stuff.Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.comBlogger1313125tag:blogger.com,1999:blog-2718170321131838315.post-62771888835189242082024-03-04T19:00:00.002+00:002024-03-04T19:00:00.143+00:00Tech Tribulations #2: There's a New System in Town<div style="text-align: justify;"><span style="font-family: helvetica;"><br /></span></div><p style="text-align: left;"><span style="font-family: helvetica;">Time for another story from my tech history, this time I point my torch of memory at one of the first larger systems I worked on from start to finish (nearly 10 years).</span></p><p style="text-align: left;"><span style="font-family: helvetica;">I think I can say the product name of this particular system, it was called Phoenix and it wasn't a bad idea, to be honest, as with nearly every project I've ever worked on we needed more documentation and design; those to continuously neglected facetes of software engineering. But other than that, the initial design stood up.<br /><br />Before we dive into that though, we need to understand the reason Phoenix was thrown onto a whiteboard and born. What was the direct predecessor?<br /><br />Yes, there was one, this is not a bluesky thinking system, Phoenix was to directly replace a system which had itself been engineered over the prior two years and not really lived up to expectations.</span></p><p style="text-align: left;"><span style="font-family: helvetica;">I shan't name that system, but anyone who knows me and knows Phoenix may know the code name it was given. It was a hybrid of two languages a C wrapper around the physical hardware bound with JNI to a java core, which itself used the ODBC driver to talk to a Marathon database backend.</span></p><p style="text-align: left;"><span style="font-family: helvetica;">The idea being that the transactional nature of the database allowed for the representation of perfect state, and in any error it was simply a case of rolling the transaction off and so we had RORI behaviour in a very complex system.</span></p><p style="text-align: left;"><span style="font-family: helvetica;">The problem?<br /><br />It was SSSSLLLLOOOOWWWWWW.</span></p><p style="text-align: left;"><span style="font-family: helvetica;">The host machine was (and I think I'm right here) a Pentium II class machine (it may have been a Pentium III later) with 16MB of RAM (and I believe it went up to 64MB by the end). Am I talking about early 2005 here, we were working with legacy machines in the field which were being refitted from a system itself all written in C but not well understood.<br /><br />This new modular java, database, transactional system was envisioned to be the future!</span></p><p style="text-align: left;"><span style="font-family: helvetica;">The problem? Still it was SLLOOOOOOWWWWWW......</span></p><p style="text-align: left;"><span style="font-family: helvetica;">I've said that twice now, so for effect lets skip forward to about 2006, two years in and this database java monstrosity is not doing well, it doesn't perform well, the team has literally stopped even trying to work in agile scrum manner; the lead developer didn't take well to critique amongst other issues (like it's slow, have I said that three times now?)<br /><br />Happily however there were two separate development machines, the one on the old old system and a whole other on the java junk. So it was in the C group I was called into a meeting with my manager, the manager of the whole department.</span></p><p style="text-align: left;"><span style="font-family: helvetica;">He had a punch bag doll in front of a whiteboard and asked me to close the door. Furtively expecting my P45 (to be fired) he asked me to take a look at the board... he had asked two other engineers to take a look through the day, so he was canvassing for opinion.<br /></span></p><p style="text-align: left;"><span style="font-family: helvetica;">In the dry wipe ink was a block diagram, eight boxes, a hardware module to talk to hardware, a module to account, a module to host the menu, a module to talk to the content program, and so on, one for logging, one for sending reports back to HQ... These simple systems.</span></p><p style="text-align: left;"><span style="font-family: helvetica;">Each would talk to one another with a message passing mechanism, which was a line from each of these eight boxes. Little did I know then that this message passing system would be the biggest part of my debugging life for the next ten years; that however is another story.</span></p><p style="text-align: left;"><span style="font-family: helvetica;">Right there and then this new system seemed like a much better proposition.</span></p><p style="text-align: left;"><span style="font-family: helvetica;">The manager liked the feedback from the various folks he had to talk to, and it was decided upon. He would work on the platform, starting up the system, securing it with a manifest and preventing unauthorized execution of random code and content.<br /><br />I would be working on the main attract module, this is the main menu from which content is categorized, and launched.</span></p><p style="text-align: left;"><span style="font-family: helvetica;">The content would talk to the Game Interface module, which was owned by a guy called Darren.<br /><br />The accounting module was handled by the previous lead on the java system, and later a guy called Conrad. Conrad at first though would be doing some other systems.</span></p><p style="text-align: left;"><span style="font-family: helvetica;">And there was a smattering of other work, like a logger module, and a build stack and al-sorts.</span></p><p style="text-align: left;"><span style="font-family: helvetica;">Work began, but not before the lead on the then current system had to be told her baby was being canned. She and her main ally were duly summoned, shown the block diagram and where they would be working. She did not take it well.</span></p><p style="text-align: left;"><span style="font-family: helvetica;">As she left the managers office, he was heard to exclaim and his stapler threw across the space and nailed a window barrier, sticking into it with a vibrating twang.</span></p><p style="text-align: left;"><span style="font-family: helvetica;">She loved her system, she did not like Phoenix, not least as it's name was a direct reference to something rising from the ashes, her system being declared to have self-combusted in failure.<br /></span></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-4995744074201709882024-02-26T19:00:00.001+00:002024-02-26T19:00:00.127+00:00Tech Tribulations #1 : Smartcard Release Drama<p style="text-align: justify;"><span style="font-family: helvetica;">It has been a very long time since a story time, so I thought I'd go over one about a software system I wrote from the ground up to secure the service to a machine; so I worked for a company which sold a whole machine to the customer (or leased them) while ever the buyer had the machines they would run.<br /><br />In late 2014 the higher management realized this was an untapped revenue stream, and much to the annoyance of the customers, it was decided that a system update would go out; which the customer had to take to get any new content; and in this update they would have to also have a smart card reader installed and a card inserted which would count down time until it ran out.<br /><br />Metering essentially, but "metering" had a whole other meaning for this system already, so it was just called the "Smartcard" system.<br /><br />Really it was a subsystem, bolted into the main runtime as a thread check, which would wake at intervals, query if there was a card reader on the USB at all, check it was the exact brand of card reader (because we wanted to limit the customer just being able to put any in, they had to buy our pack).<br /><br />And then it would query the card and deduce credit/count down if we were beyond a day.<br /><br />We tried a bunch of time spans, hours, minutes etc, but deducting was decided to be after we accumulated 24 hours of on time, every 5 minutes an encrypted file on the disk would be marked, after 24 hours worth of accumulations the deduct would happen.<br /><br />We tested this for months, absolutely months and to be honest we thought it was really robust.</span></p><p style="text-align: justify;"><span style="font-family: helvetica;">Until it actually went into the customers hands, we suddenly had a slew of calls and returns, folks unhappy that they were inserting the card, "testing their machines" and suddenly all the credit was gone, and they were asking for a new card all the time.<br /><br />At first we could simply not explain this anomaly, we had the written information about the service calls, replicated what the folks were saying, it all checked out fine, we got our increments, we could inspect the encrypted file and see we were accumulating normally and deducting normally.<br /><br />I worked on this for days on end, we had to test for real, we did all sorts of things, power drop tests, pulling the card tests, all sorts.<br /><br />The machine checked out, end of.<br /><br />What had we missed? What are the customers doing? Testing the machine, okay, what are they testing? The content, how does the content work for this update? Well, seems that the customers didn't trust their testers or engineers, so what was happening was instead of testing for real they were doing what we called "Open door testing".<br /><br />You see, when you close the door you accumulate and deduct, the machine is in operation normally as any user their end would have it operate.... <br /><br />Door open mode however, was intended to be used by service engineers, when the machine was deployed; so it is still in operation, the machine is in the field, but the door is briefly open to check things.<br /><br />But these customers didn't trust their engineers in their warehouse, so they were not giving them credit to check the machine properly, they therefore tested in open mode... for days....<br /><br />They accumulated massive operation debt with the machines in door open mode for days.<br /><br />The moment they turned them off, happy they were working, and shipped them to sites they'd arrive on side immediately be turned on finally after so long in proper door closed operation and they'd instantly deduct the massive debt the warehouse team has accrued.<br /><br />This was intentional.... But their use of the door open mode was an abuse, and one we had not even thought about. We didn't even clock how long a machine sat in door open or door closed mode, worse still when in door open mode and test things on the machine ran at an accelerated update rate, we ticked over 10x faster to allow faster testing... The result was in just 3 days of warehouse door open mode testing they could accrue 30 days of operational debt.<br /><br />That was a fault, one I could tackle with the team. But changing the user habit of leaving the door open was harder...<br /><br />We had to work with the user, and their patterns, we suspended the system for a short while and issued a new update, but the first customer taste of this "pay as you go" approach was a sour one.<br /><br />Then things got bad....<br /><br />Yes, you might think they were already bad, but they got worse.<br /><br />A month later, all the above was resolved, and we thought things were settling down... Until we suddenly all hell broke loose.</span></p><p style="text-align: justify;"><span style="font-family: helvetica;">EVERY MACHINE WAS LOCKED.</span></p><p style="text-align: justify;"><span style="font-family: helvetica;">There were dozens of reports of their just not working, they had done their daily reboot and all of them reported a security fail on the smartcard....</span></p><p style="text-align: justify;"><span style="font-family: helvetica;">All hands on deck, are our machines in the test pool doing the same? Nope.<br /><br />Is there something special going on? Have clocks changed, is it a leap year, has the sky fallen on Chicken Little?<br /><br />We honestly had no idea, there was no repeat in any of our test pool, no repeat on our personal engineering rigs, there was essentially no reason for this failure.</span></p><p style="text-align: justify;"><span style="font-family: helvetica;">The only answer in such a situation is to observe or return one of the machines exhibiting the problem.</span></p><p style="text-align: justify;"><span style="font-family: helvetica;">A lorry was sent and a machine brought back, under the explicit instruction not to open it nor change it, and the customer was not to keep their smartcard (it was theirs, but we would credit them a whole new card for the inconvenience).<br /><br />Several hours spent staring at the code, and running checks by lowering cards so they would expire, or pulling the reader out and inserting it again we had no answer.</span></p><p style="text-align: justify;"><span style="font-family: helvetica;">Before that arrives back with us however lets just think about the "smartcards" we used in our daily lives; our bank cards, they go into a machine we enter our pin and we remove them again. Then how about cards like your gas meter, or you go see your GP, they have a card you insert into a machine and it stays there all the time to validate they are the GP, or they keep your meter in operation, if you have Sky TV and a viewing card; same thing, it is always in the device.<br /><br />These machines are the latter kind.... Those cards are rated to have power on to them for long periods of time, as a consequence they cost more money than a card you only insert transiently...</span></p><p style="text-align: justify;"><span style="font-family: helvetica;">And this company I worked for had very canny buyers, too canny. Because they spotted a smartcard which used the same protocol... but was significantly less money to buy!<br /><br />The difference? You guessed it, it was the transient use variant.</span></p><p style="text-align: justify;"><span style="font-family: helvetica;">The broken machine arrived, we powered it on, fail. We open the door, remove the smartcard and sure enough on the rear of the plastic behind the chip the plastic is brown, burned.</span></p><p style="text-align: justify;"><span style="font-family: helvetica;">The card can not be electrically trusted!</span></p><p style="text-align: justify;"><span style="font-family: helvetica;">We highlight this and send it back to the buying department, they fouled up, they changed the hardware after we certified it, essentially sending an uncertified machine out.<br /><br />A huge issue ensued about this, as this wasn't well understood that we had been provided and advised one card type into the update set, but of course the buyers would not accept it wasn't the same until we literally had the specifications of the card side by side we could see a digit difference in the part number and looked up the datasheet where clearly it said that the transient card was only rated to remain in a machine for 10 minutes. More than enough for an ATM. But a "security gating" card, as we wanted, they are rated to be inserted continually for 36 months.<br /></span></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-63504141947294065522024-01-08T19:00:00.001+00:002024-01-08T19:00:00.261+00:00The 2023 Great Laptop Shop...<p style="text-align: justify;"><span style="font-family: verdana;">It is that time of life again.... Time to shop for a new Laptop... And I am finding a new scourge in the mix, that is "Soldered".</span></p><p style="text-align: justify;"><span style="font-family: verdana;">I am so absolutely sick of seeing "Soldered" next to the RAM specifications, like I get it for budget machines, I get it for tiny integrations, but for actual working laptops? For laptops marketed as "Business" or as "performance"... oh my word, why are they doing this?</span></p><p style="text-align: justify;"><span style="font-family: verdana;">I really hate this whole phase. I have hated the laptop hidden gotcha's for years to be honest, and I'm upset Lenovo have joined the price crunch unupgradable ewaste train.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">My current machine being a Lenovo E480, I can and have upgraded the RAM, it has two drive slots (one SATA and one nVME), you can change the battery and it has plenty of USB and aux IO ports all around. The issues I have with it is that one RAM Slot has gone bad; I simply doubled the RAM in the one remaining slot - but really I'm not at end of life. And the CPU being an 8th gen is struggling with my workloads.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">My options are to soldier on with the E480, maybe even move all my work into remote virtual machines and use this simply as a terminal into them; but then I would always require network access and that's not always possible.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Or get something new and locked down. <br /></span></p><p style="text-align: justify;"><span style="font-family: verdana;">Or a Framework offering, which lets me upgrade to a point.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Or keep shopping... But the ease of finding what I want is very much on the low-side, and I'm a technical user, finding what I want should be simple. But the deck seems stacked with both retailers and system integrators wanting to pass off this shovel ware crap on me.<br /></span></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-20268746185034721432023-10-23T19:00:00.001+01:002023-10-23T19:00:00.140+01:00Job Interview : switch(char) again! Twenty years on!<p>I've spoken about some of the strange interviews I've enjoyed over the years; notable engineering highlights were having test driven development spooned to me, when I simply didn't know the particular syntax they were demanding, or having StringBuilder suggested for a C# task where they actually needed to cross-core thread their problem, or pointing out that the CI solution being described would lead to an alien environment of folks being paralysed by fear of red flags; only to witness their development floor being paralysed by exactly those issues as I walked out the door.</p><p>Today however, I'm going to go way back and talk about one of the very early development interviews I had; this maybe like the third interview I ever had after graduating, it was with a rail rolling stock company, in a very bright and sunny room with three guys who seemed to know their entire universe was correct and they'd take no new information into their sphere of understanding.</p><p>I share this one as a friend of mine was in touch over the weekend, he had an interview, and strangely he had the exact same conversation I had... THE EXACT CONVERSATION, twenty something years later.</p><p>Let us start by sharing some perfectly valid C++ code:</p><div style="text-align: left;"><span style="font-family: courier;">bool validate(const char& value)<br />{<br /><span style="white-space: normal;"><span style="white-space: pre;"> </span>switch (value)<br /></span><span style="white-space: normal;"><span style="white-space: pre;"> </span>{<br /></span><span style="white-space: normal;"><span style="white-space: pre;"> </span>case 0:<span style="white-space: pre;"> </span>return true;<br /></span><span style="white-space: normal;"><span style="white-space: pre;"> </span>case 'x': return true;<br /></span><span style="white-space: normal;"><span style="white-space: pre;"> </span>default: return false;<br /></span><span style="white-space: normal;"><span style="white-space: pre;"> </span>}<br /></span><span style="white-space: normal;"><span style="white-space: pre;"> </span>return false;<br /></span>}<br />int main()<br />{<br /><span style="white-space: normal;"><span style="white-space: pre;"> </span>const bool isValidOne{ validate('a') };<br /></span><span style="white-space: normal;"><span style="white-space: pre;"> </span>const bool isValidTwo{ validate('x') };<br /></span><span style="white-space: normal;"><span style="white-space: pre;"> </span>const bool isValidMe{ validate(12) };<br /></span>}</span></div><p style="text-align: left;">Read this code, we should see an output (if we output the bools) of "false", "true" and "false"... I think we can all agree. This is perfectly valid C++.</p><p style="text-align: left;">It isn't very clean nor pretty, we're relying on the compiler standard decaying char to int and vice versa; which is not very nice and I wish compilers would complain here, that we're comparing int to char in the first case and we're converting the integer 12 to char, I think it should really strong type this.</p><p style="text-align: left;">But that is not the point, the point is that both in my friends case and mine all those years ago the interviewers got really uppity about that "switch" statement. They insisted that you can not "switch" on a character type...</p><p style="text-align: left;">Just flat insisted.<br /></p><p style="text-align: left;">I remember in my experience they had me write up what they wanted on a blackboard, with chalk, and they wanted me to go through the code line by line; I wrote more or less the above, they insisted they had a character not a byte (uint8_t: though there was no standard for this at the time) and then they went off on this tangent amongst themselves about the value of the if-elseif-else stanza's they insisted would work over my solution above.</p><p style="text-align: left;">Now I was talking to these guys in the early 00's, my friend however was talking to them in 2023. He jumped on this with the point of "well if the character is known at compile time, yes then constexpr maybe of use" and he showed them:</p><p style="text-align: left;"><span style="font-family: courier;">if constexpr(foo)</span> and <span style="font-family: courier;">if consteval(bar)</span> examples.</p><p style="text-align: left;">He described their faces screwing up and two of the chaps he was talking to staring at each other before making subtle notes on their paper.<br /><br />It was very clear at this point that the CTO performing the interview was not keeping his knowledge up to date, the group seemed to cluster onto the idea of just maintaining what they have, stagnation like this in our joint experience can be problematic. Both team morale and high turn over of engineers always happens when things stagnate.</p><p style="text-align: left;">I have to say in my interview I actually sat it out from beginning to end and just knew I was not interested in the role; and I did not hear from them again.</p><p style="text-align: left;">My friend however, he was genuinely concerned he'd done a good interview and they'd be offering him a role, they kept him talking for over an hour and a half!</p><p style="text-align: left;">He's a late 40's engineer of 25+ years experience, just like me; the three chaps interviewing him, including the CTO, were ten or more years his junior, it seemed they were looking to back up their team with an older head to lend legitimacy to things; and they had lost two original engineers of their project to literal retirement without replacing them.</p><p style="text-align: left;">He saw the issues and he thanked them for his time and left, with a negative to whether he would be interested in going further. This stunned them.</p><p style="text-align: left;">It has to be said, so many interviewers forget that though they are interviewing you, you are also interviewing them like most all human interaction it is a two way street and it's crucially important to remember that in a job interview. We spent a significant amount of our time at work, if you are not comfortable there or feel you are going to be acting out a role instead of filling one and making it your own.</p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-64415360029564630812023-09-14T23:30:00.008+01:002023-09-14T23:30:58.388+01:00C++: I was today years old when I learned this about shared_ptr<p style="text-align: justify;"><span style="font-family: verdana;">I was on a review for a colleague and there was this piece of code which stood out to me, I could not figure out what was being achieved. Without being specific it was essentially</span></p><p style="text-align: justify;"><span style="font-family: courier;">static std::unique_ptr<B> Create(const std::shared_ptr<A>& referenceToA);</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Just the function prototype didn't sit right with me and the use case was even more strange to my eye for the "B" structure here being created has the shared pointer in the members.</span></p><div style="text-align: justify;"><span style="font-family: courier;">struct B<br /></span><span style="font-family: courier;">{</span><span><span style="font-family: courier;"><br /></span></span><span><span style="font-family: courier;"><span> B(const std::shared_ptr<A>& referenceToA)</span></span></span><br /><span><span><span style="font-family: courier;"><span> </span><span> : mMyA(referenceToA)</span></span></span></span><br /><span><span><span><span style="font-family: courier;"> {</span></span></span></span><br /><span><span><span><span style="font-family: courier;"><span> }</span></span></span></span></span></div><div style="text-align: justify;"><span><span><span><span><span style="font-family: courier;"><br /></span></span></span></span></span><span><span style="font-family: courier;">public:</span></span><br /><span style="font-family: courier;"><span> </span>static std::unique_ptr<B> Create(const std::shared_ptr<A>& referenceToA)</span><br /><span style="font-family: courier;"><span> {</span></span><br /><span><span style="font-family: courier;"><span> </span><span> return std::unique_ptr<B>(new B(referenceToA));</span></span></span><br /><span><span><span style="font-family: courier;"><span> }</span></span></span></span><br /><span><span style="font-family: courier;">};</span></span></div><p style="text-align: left;"></p><div style="text-align: justify;"><span style="font-family: courier;">private:</span></div><div style="text-align: justify;"><span style="font-family: courier;"> std::shared_ptr<A> mMyA;</span></div><p></p><p style="text-align: justify;"><span><span style="font-family: verdana;">And my head just lot it. To my eye this API, the create function here, is given a constant reference to the shared_ptr and what can be constant about a shared_ptr? Well the internal reference count, or so I thought. I believed this was a mistake, I believed the compiler would throw this one out and say "No, you can't change the reference count of this const object".</span></span></p><p style="text-align: justify;"><span><span style="font-family: verdana;">Never had I ever thought that the shared_ptr is actually referencing some other controlling block elsewhere. My understanding was therefore flawed and I'm happy to admit naive.</span></span></p><p style="text-align: justify;"><span><span style="font-family: verdana;">So what would happen here? Well, the B constructor, actually copies the shared_ptr control block, it therefore does and can increment the reference counter to the shared_ptr.</span></span></p><p style="text-align: justify;"><span style="font-family: verdana;"><span>As counter intuitive as the const is therefore. We aren't actually saying the shared_ptr itself is constant, rather the reference to it is, we should be reading the parameter type as </span>std::shared_ptr<A>const & referenceToA.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">I felt rather silly for not realising this earlier, not least as I did once write a C program to switch out the qualifiers on a function call to make things like this stand out in formatting my code!!</span></p><p style="text-align: justify;"><span style="font-family: verdana;">But it has slipped my mind! Okay! I'm old, shut up.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Here is the full code of what I put together to understand this: </span></p><div style="text-align: justify;"><span style="font-family: courier;">#include <memory></span><span style="font-family: courier;"><br /></span><span style="font-family: courier;">#include <mutex><br /></span><span style="font-family: courier;">#include <queue><br /></span><span style="font-family: courier;">#include <string></span><span style="font-family: courier;"><br /></span><span style="font-family: courier;">#include <cstdio></span><span style="font-family: courier;"><br /></span><span style="font-family: courier;">struct A<br /></span><span style="font-family: courier;">{<br /></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>A()<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>:<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>mIndex(GetNextIndex())<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>{<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>}</span></span><span style="font-family: courier;"><br /></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>~A() = default;</span></span><span style="font-family: courier;"><br /></span><span style="font-family: courier;"><br /></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>const int mIndex;</span></span><span style="font-family: courier;"><br /></span><span style="font-family: courier;">private:<br /></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>static int GetNextIndex()<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>{<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>static int index{ 0 };<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>return ++index;<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>}<br /></span></span><span style="font-family: courier;">};</span><span style="font-family: courier;"><br /></span><span style="font-family: courier;">struct B<br /></span><span style="font-family: courier;">{<br /></span><span style="font-family: courier;">public:<br /></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>B(const std::shared_ptr<A>& parent)<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>: mParent(parent)<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>{<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>}</span></span><span style="font-family: courier;"><br /></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>std::shared_ptr<A> mParent;</span></span><span style="font-family: courier;"><br /></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>static std::unique_ptr<B> Create(std::shared_ptr<A>const & referenceToA)<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>{<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>return std::make_unique<B>(referenceToA);<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>}</span></span><span style="font-family: courier;"><br /></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>~B()<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>{<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>mParent.reset();<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>}</span></span><span style="font-family: courier;"><br /></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>const int& GetParentIndex() const { return mParent->mIndex; }<br /></span></span><span style="font-family: courier;">};</span><span style="font-family: courier;"><br /></span><span style="font-family: courier;">int main()<br /></span><span style="font-family: courier;">{<br /></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>std::shared_ptr<A> original{ std::make_shared<A>() };<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>printf("Original %i: %i\n", original->mIndex, original.use_count());</span></span><span style="font-family: courier;"><br /></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>auto createdB{ B::Create(original) };<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>printf("Copy %i: %i\n", createdB->GetParentIndex(), createdB->mParent.use_count());<br /></span></span><span style="white-space: normal;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>printf("Original %i: %i\n", original->mIndex, original.use_count());<br /></span></span><span style="font-family: courier;">}</span></div><p style="text-align: justify;"><span style="font-family: verdana;">However, I have to say, I still don't like this; clever as it is, there's a hidden copy going on, in the B constructor the copy of the shared_ptr control block and it's reference count incrementing from 1 to 2.</span></p><p></p><div style="text-align: justify;"><span style="font-family: verdana;">It does quite neatly move ownership of the pointer, but the const and the reference just make my brain spin. So where this can only gain 10/10 plaudits for C++ smarts, it only gets a mere 3/10 on the maintainability ladder for me, and only when we have the const& together, when written as at the top of the page this drops to 1/10.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Performance is also a factor here, if we wanted better performance we would have to consider whom owns the original A here. If no-one and it is always added into the shared member in B, well move it... Create once and move it, this code doesn't communicate that as an option, but it certainly could be.</div></span><p></p><p style="text-align: justify;"><span style="font-family: verdana;"><br /></span></p><p style="text-align: justify;"><br /></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-1337876692050314672023-08-30T18:30:00.001+01:002023-09-01T16:23:48.916+01:00tBs - My First Clan<p style="text-align: justify;"><span style="font-family: verdana;">Today I want to regale you with a story of my past gaming glory, before Eve... before WoW... Back in the days of 2002 I joined a clan.... Now, I've read Ready Player One over and over, I do not get this whole "I don't clan" ethos in that writing because back then being in a Clan was the thing.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Guilds and corps in my later gaming life are very different things, this clan was cut throat. We were</span></p><p style="text-align: center;"><span style="font-family: verdana;">{tBs}</span></p><p style="text-align: center;"><span style="font-family: verdana;">The Butchers</span></p><p style="text-align: justify;"><span style="font-family: verdana;">This is where I met my long time co-killer Chaplain (wave, hi chap!) for we were together the scourge of Avalanche.</span></p><p></p><div class="separator" style="clear: both; text-align: justify;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEi_ii0BFNGwuV5iStys5mz5gAt0Zu-Sos_SL92O0J8EWzi9ThLkjmc9ircY039CeP7JSWZB7QyKktjsrdv51xhoU7w8drKyHRq0OyIqCNtSSGbfH_Qb6GVH4laA1JuahCInWk4ewOh1v5vZ2iL9GV7GQhVdAePSGrTnCLleN5JOwDD5PCG7cvQFvmW9IvQ" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: verdana;"><img alt="" data-original-height="358" data-original-width="637" height="180" src="https://blogger.googleusercontent.com/img/a/AVvXsEi_ii0BFNGwuV5iStys5mz5gAt0Zu-Sos_SL92O0J8EWzi9ThLkjmc9ircY039CeP7JSWZB7QyKktjsrdv51xhoU7w8drKyHRq0OyIqCNtSSGbfH_Qb6GVH4laA1JuahCInWk4ewOh1v5vZ2iL9GV7GQhVdAePSGrTnCLleN5JOwDD5PCG7cvQFvmW9IvQ" width="320" /></span></a></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">This is in the Half Life engine mod "Day of Defeat", and it didn't look this good (this is from the later Source version); all important in this game play was the tick rate of the server, most serious clans hosted their own servers and they tweaked them to the max.</span></div><p></p><p style="text-align: justify;"><span style="font-family: verdana;">I remember our server admin was a chap called Twister, but that's about all, he never much liked any input about the status of the server. He didn't play very often, so it was always quite curious that us experienced players were not welcomed into giving him feed back; let me tell you as a now professional game developer and server administrator listen to your expert users, they will know when things are off, they may speculate, but they will know and help you spot issues up front they're a resource, use them, never dismiss them.</span></p><p></p><div class="separator" style="clear: both; text-align: justify;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhnrYRYKbq_MptRJ4KshAUFFPxVNIVTveeFozEixWPM9wBF-0g-wkIyFi1gWmmthEv3WI4KTMQHX0Vl6bMK8ncpbRUxVv-xJ66_4VY08yTb2iBaoWGS2WMVvNCs-iH05S4VycPFcldasmfTUPFXh-y41ULRZfjwzF7IueKTPGCMtsdJksuOhEs3KKtUw7I" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: verdana;"><img alt="" data-original-height="360" data-original-width="480" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEhnrYRYKbq_MptRJ4KshAUFFPxVNIVTveeFozEixWPM9wBF-0g-wkIyFi1gWmmthEv3WI4KTMQHX0Vl6bMK8ncpbRUxVv-xJ66_4VY08yTb2iBaoWGS2WMVvNCs-iH05S4VycPFcldasmfTUPFXh-y41ULRZfjwzF7IueKTPGCMtsdJksuOhEs3KKtUw7I" width="320" /></span></a></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Anyway tBs were well known, playing on the European Enemy Down ladder we were very often top 10 in Europe, one time top three, playing on again off again matches against the other members of the ladder; we were effectively the second most active clan behind "Scotlands Finest Highlanders" or SFH.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">At one time I myself organised our own "Butchers League" and for four weeks in the summer of 2003 I ran the website and helped organise five guest teams to play pre-arranged matches in a knock-out for the win. SFH won. Yes, SFH won the tBs League. That was fine.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">What wasn't fine was the reaction of another clan OAP or "Old Aged Players" they kicked off big time, they could not connect their players to the server; they didn't do any preparation up front and get really really angry, really for no reason, when they were disqualified from a match they simply could not raise five players to compete in. They were offered a different match slot, but they even turned up to that with only four players and a bad attitude.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Within tBs ourselves there were a bunch of interesting characters, but lets talk more about the game.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Day of Defeat</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">I loved that game, or mod, my favourite map was Avalanche, a wholly unfair map for the allied side (and yes, I admit I enjoyed playing the German side more) but Chaplain and I were demons of the Church.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">The Church, pictured above sat on the flank of the map, entered via the smashed bell tower at the top or the rubble strewn wall at the bottom, the actual doors were closed. Inside you had two side by side, but slightly offset rooms on the ground, then rubble streaming up to a mezzanine level, with then either the option to climb a ladder to the exposed but dominating tower top, or to carry on up and through a wall to the tiled rooves beyond.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">As an axis player you began from the top side, coming into the church via the tower.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">As an allied player you began on the ground and were forced up through the rubble.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Defending that tunnel route was critical to holding the map, you controlled access to the opposite side for the allied players, you pinned them in their spawn.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Or you held the tower and dominated the center.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">It was probably not well thought-out in design terms, but it was such a wonderful piece of level spacing I loved it.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><div style="text-align: justify;"><span style="font-family: verdana;">My best memory came playing another clan, we as axis and they as allies. For some ungodly reason they had a machine gunner run right up into my door way... and it was my door way, I had gone from spawn, swept over the roof into the church and down in sprint fashion time. This guy thought he could take my church and lay MG fire on my team from my church tower?! Nope. A burst of MP40 and he was down, but do was his MG.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Now it was not often ever we took the MG to the church, it wasn't practical in the close-quarters environment SMG was the usual call to arms. But this day I could not resist, I lay in the rubble pounding their own MG fire down on them. Their only hope to remove me was to pre-cook a grenade and time it perfectly to explode in my face. They did not do this; my score was astronomical with chaplain bringing me a reload of ammo and they throwing himself into fire to respawn and bring me yet more.</span></div></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">That was our church on Avalanche.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">A few other maps floated our boat, but were were just so good at that map, specialist even that when we played on open public servers we were often accused of cheating, being so good someone is convinced you are cheating is just the ultimate thrill. I've only managed it through good strong team work.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">The other tBs characters though:</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Weeman - constantly threatening to self-harm, a disturbed kid to say the least.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Hopper - Cheating chap, he blanked chaplain and I after botting in WoW (and obviously so) undermining any respect we had for this "skills".</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Remus - an older guy, interesting fellow to talk to.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Twister - the hard put server admin, who didn't want to know really about our issues.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Dodi - a nice lad who came and went.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Mako - Not the shark he thought he was.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">and of course "The Butcher" himself, Butcher being his surname... Always in charge, but never there.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">I learned a lot from this, my first clan, I learned about team work, about trusting others and appointing them correctly and appropriately, all from a computer game, backed up with my martial experience in karate I believe I'm quite rounded in letting people both prove and earn their reward and garnering them with praise for a job well done; whilst also being even handed.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">All experience for a computer game, and they call is a game; well, isn't life just one big game too?</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><br /></div><p></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-24449231522955006712023-08-07T18:30:00.009+01:002023-08-07T18:30:00.138+01:00Amber Valley Planning aren't very good<div style="text-align: left;"><div style="text-align: justify;"><span style="font-family: verdana;">I think I've come to the conclusion Amber Valley Planning Department are either incompetents' or simply idiots. Having had to interact with them myself and now in relation to a nearby development, they've demonstrated incompetance which can't easily be explained... Let me explain.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><span style="font-family: verdana;"><div style="text-align: justify;">You see a development was proposed, ironically the owners only sought planning permission after the fact, fine whatever get on with it...</div><div style="text-align: justify;"><br /></div></span><span style="font-family: verdana;"><div style="text-align: justify;">So the ground-works and building are complete?... Yes.</div><div style="text-align: justify;"><br /></div></span><span style="font-family: verdana;"><div style="text-align: justify;">The official visited the site?... Yes, there was a woman with a clipboard.</div><div style="text-align: justify;"><br /></div></span><span style="font-family: verdana;"><div style="text-align: justify;">Does the block plan represent the reality on the ground?... No, not even close.</div><div style="text-align: justify;"><br /></div></span><span style="font-family: verdana;"><div style="text-align: justify;">Any school child with a ruler and pencil would be able to very quickly look at two reference points on the ground, extrapolate two lines then compare them to the building work which took place. They don't match, not even close.</div><div style="text-align: justify;"><br /></div></span><span style="font-family: verdana;"><div style="text-align: justify;">Further more the building work significantly changed the levels of the area in question. This is not mentioned on the planning permission request at all.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">And the newly raised area is several hundred tonnes being held back by concrete posts... No no structural engineering posts, we're talking 4 inch garden posts, with postcrete and concrete weather board.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">In the July & August ran we've had they're already bowing ominously.</div><div style="text-align: justify;"><br /></div></span><span style="font-family: verdana;"><div style="text-align: justify;">And I find these two points extremely curious, for you see we were the ire of this department having skimmed 2 inches of soil and spread road stone we had to account for a "Change of level"... yet someone else can dump several hundred weight and build up a new embankment to around 6 feel of altitude?</div><div style="text-align: justify;"><br /></div></span><span style="font-family: verdana;"><div style="text-align: justify;">We presented drawing plans from overhead shots, real shots from Google Earth, showing the true scale and location; it being a photograph after all. We had to go back and be exacting, that was the order "be exacting" in the block out diagram shown.... Yet someone else can be approximately six feet off level of reality in two axis?</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">When this goes over, and it is likely to, could it be a danger to life? Yep. Will the planning department comment? Will they heck as like, they just tick their box and waltz off, it is almost criminal in this case.</div><div style="text-align: justify;"><br /></div></span><span style="font-family: verdana;"><div style="text-align: justify;">Either the planning are incompetents', and I strongly suggest they explain their decision; oh but wait, one can not challenge them, only the applicant can appeal?!?</div></span><span style="font-family: verdana;"><div style="text-align: justify;">I must therefore air on the side of caution and suggest they're merely idiots, <span style="background-color: white; color: #202124;">bureaucratic </span>machination maniacs of the paid civil servant ilk just there to tick the boxes and dot the lowercase J's, since the service... Clearly the service is broken.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Want to know the major comment about the works carried out? That they must ensure the hedge remain for at least 5 years. This is a hedge in which (at least further up) I found bottles tangled in the roots with a date of 1914 on them, so this is already very much an older hedge... so a) 5 years makes no sense, b) you ignored they changed the level, c) the works do not match the plans provided - and I told you of this! and finally d) they're already subsiding, dangerously so!</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Incompetence demonstrated, well done Amber Valley Planning Department, well done.</div><div style="text-align: justify;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://media.tenor.com/T0X9tHH7mLAAAAAC/bye-waving.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="372" data-original-width="498" height="372" src="https://media.tenor.com/T0X9tHH7mLAAAAAC/bye-waving.gif" width="498" /></a></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">I am extremely glad my hard earned council tax money no-longer goes to them, indeed I've spoken to my local duty planner, they were highly available very interested in my requirements and helped me out immensely; Amber Valley, not so much.</div></span></div>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-51788769075743621512023-08-05T18:30:00.001+01:002023-08-05T18:30:00.141+01:00Wiley IT Manager Saving on Microsoft Licences<p></p><div style="text-align: justify;"><span style="font-family: verdana;">It is late 1998 and I observe one of the smartest PC acquisition steps ever; the company I work for is reequipping every one using a certain application to a new specification machine. This means a major purchase and roll out for those of us in IT.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">A little background first the company I work for has one customer, just one single customer, this may sound crazy but at the time it made perfect sense and the customer was a reassuring British stalwart of the high street the business was rock solid. They were however also extremely protective of their brand and selling our whole product line exclusively they knew they could tell us how to do everything.</div></span><p></p><p style="text-align: justify;"><span style="font-family: verdana;">One of the key things they specified was a hard encryption model to their stock and control system software, we had to run the software they provided, we had to run is with "secure" physical dongles performing periodic security authorisation checks and we did all this on a specification of machine they laid down to us.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">So it was in 1998 a new version of this software was hoving into view, the specification leapt from a mere 486 running 25hmz to a Pentium III running at or over 120mhz. The RAM requirements went from 4MB and windows 3.11 for workgroups to the then brand new Windows 98.</span></p><p></p><div class="separator" style="clear: both; text-align: justify;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgYWSAuCWvvfUX2X3LVxmrrrtexTNN11TDyjurfK7uoInZQUuToGpZnUTowu3xnd0v12g1nlML985RZGcxtN2qIvBo5_zV0Ddf9-Yd4BUaxszVgqBo3aPKovDgNk6OprKrH7zjwtIX4OjL-3iib9X_BMK8A5MH-MRz4igoz8h9oJQBCCQQiDd438L49qHk" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: verdana;"><img alt="" data-original-height="225" data-original-width="225" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEgYWSAuCWvvfUX2X3LVxmrrrtexTNN11TDyjurfK7uoInZQUuToGpZnUTowu3xnd0v12g1nlML985RZGcxtN2qIvBo5_zV0Ddf9-Yd4BUaxszVgqBo3aPKovDgNk6OprKrH7zjwtIX4OjL-3iib9X_BMK8A5MH-MRz4igoz8h9oJQBCCQQiDd438L49qHk" width="240" /></span></a></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">So it was my boss (shout out to Dave) set about working out the best platform for this.</div></span><p></p><p style="text-align: justify;"><span style="font-family: verdana;">He had previously been in charge of the purchase of new server stack from Compaq and with a positive impression he turned to them.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">With a little wrangling I believe he had a roll out of 30 machines, with three years support, for £890. In terms today this is approximately £2000 a seat and was just for the machine a 17" monitor, keyboard, mouse and windows 98. Nothing else.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Folks had to do other tasks on these machines, not just this customer software, therefore he set about buying Office. Homogenising the previous smorgasbord array of different spreadsheet and word processing software variously in use.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Adding Office 97 SBE unfortunately pushed the machines up another £80 per seat, this included £19 off for bulk purchase, but it was a crazy price.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">But then Dave taught me an extremely valuable lesson, to play the edge cases.</span></p><p></p><div style="text-align: justify;"><span style="font-family: verdana;">Could you get Office 97 for les than £80? Yes, you could get it for £49.95 a seat. But only if it was an upgrade. Hmm, what could we count as an upgrade from?</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Well, it turned out Office 97 could be an upgrade from MS Works 95. At the time Works was my go to office package, I've never felt the ease and familiarity with office ever again since. But works was canned by Microsoft; probably because of Wiley IT managers like Dave.</div></span><p></p><p style="text-align: justify;"><span style="font-family: verdana;">For a full new copy of Works would be had for just £12.95.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Doing a little mathematics, £12.95 + £49.95 is a mere £62.90.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">The company was already duty bound to pay me as part of my regular services, so installing Works and installing Word over the top, taking hours to get through all the machine did result in quite a saving. About £400 for the whole project; meaning Dave was well under budget and everything worked as intended.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">It did however leave one literally huge problem; for the next working year our already tiny IT office was overrun with these dozens of double boxes of Works and Office upgrade, just in case Redmond came knocking asking about licenses.</span></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-1649632923665403842023-07-31T00:00:00.004+01:002023-07-31T00:00:00.146+01:00Blog Security Updates<p><span style="font-family: verdana;">Blog Security Updates....<br /><br />I have just enabled a forced HTTPS redirect on my blog, unbeknownst to me you could still get to it via an unsecured link! Thanks google for not making that more obvious.<br /><br />I've also changed the comment rules to require you to have a google account to comment.</span></p><p><span style="font-family: verdana;">Believe you me I do read every comment, I reply to quite a few. But for the most part I spent time removing adverts, and I have had some bizarre adverts posted as comments. However today I had the most in appropriate advert ever for illegal items, which I not only completely disagree with but found abhorrent could be posted anonymously.</span></p><p><span style="font-family: verdana;">So you now need to have a google account.</span></p><p><span style="font-family: verdana;">Thanks for sticking with me!</span></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-38438717141940891052023-07-26T18:30:00.045+01:002023-07-26T18:30:00.146+01:00My Worst Development Argument Ever<p style="text-align: justify;"><span style="font-family: verdana;">I have had a really excellently interesting sprint with the work I'm currently doing, like you know one of those sprints where you get a real technical tooth into the pie of problems.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">That however is neither an interesting story, nor one I can actually tell.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Instead I will fling my mind back a score of years and we'll discuss THE WORST DEVELOPMENT ARGUMENT I HAVE EVER HAD!</span></p><p style="text-align: justify;"><span style="font-family: verdana;">The problem started with the platform I was then working on, it was a quite low-powered single core Celeron PC base, running a favour of Windows for Embedded systems (I think it was Windows 2000 Embedded), but it was basically used as a host for a C# application stack which itself was more or less a wrapper around a C hardware driver talking to the various light, button and money handling mechanisms in the machine.</span></p><p></p><div class="separator" style="clear: both; text-align: justify;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhq0TPT8TEBJdwml5gK4R4GBy2FhTV0XYfFOAIBqRsmdPh_pN-YCusBKoRkkl10dedQBkBjotkbaPNLoGQSYw-IBs0HrTvo9jISbkuZgN8K1zQo7nwNjO-TroX7HegwXDv0NHBirTLDVuwvRJVb_Mtv-QyvqbRzSkAZLVj1aWejqIb7ElTRbdDMgjdim44" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: verdana;"><img alt="" data-original-height="480" data-original-width="640" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEhq0TPT8TEBJdwml5gK4R4GBy2FhTV0XYfFOAIBqRsmdPh_pN-YCusBKoRkkl10dedQBkBjotkbaPNLoGQSYw-IBs0HrTvo9jISbkuZgN8K1zQo7nwNjO-TroX7HegwXDv0NHBirTLDVuwvRJVb_Mtv-QyvqbRzSkAZLVj1aWejqIb7ElTRbdDMgjdim44" width="320" /></span></a></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div></span><p></p><p style="text-align: justify;"><span style="font-family: verdana;">This system of ours then simply would process launch, at the shell level, another child process which was the actual game content. And there were lots of different games we could fire up.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Our menu and the hardware polling all would back off, it was actually only polling for button and light IO and every second polling for cash changes from money physically being entered; so that was slow to update, but otherwise it was fine and backed off.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Being a Win32 environment it was fairly easy to back off most all the threading and just launch the child process.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Our testing showed that we had a 92/8% CPU split, the system would take on average 8% CPU whilst in this active child mode; it had a few spikes and it had a few troughs, that included windows itself. Otherwise it was pretty much that most all the CPU was available to the child process.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">It was therefore with some scepticism that we had the development manager in the content area wonder over complaining that one of his guys was having issues getting smooth frame rates from the platform. We accepted the install and ran the child process, indeed we immediately saw the issue.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">A popular UK TV show game, with a target circling the board...</span></p><p></p><div class="separator" style="clear: both; text-align: justify;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhmzLqistZkq7IO47ayiJon3W5B_glr5dD_E3FDbGUbQi77sUOSfgd7P352-PsuNAVkpm2DgXzU4s-MDaDQhqvqOcJUXGWsdgtmIWULvXEAv3__EHZiU66PlceUYAKNCSBYPSaeIojDhkEEAErnfEOqVy3xwVMaY3vh3I3hLkh74wa-o2C20pV4JKYgu5E" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: verdana;"><img alt="" data-original-height="585" data-original-width="740" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEhmzLqistZkq7IO47ayiJon3W5B_glr5dD_E3FDbGUbQi77sUOSfgd7P352-PsuNAVkpm2DgXzU4s-MDaDQhqvqOcJUXGWsdgtmIWULvXEAv3__EHZiU66PlceUYAKNCSBYPSaeIojDhkEEAErnfEOqVy3xwVMaY3vh3I3hLkh74wa-o2C20pV4JKYgu5E" width="304" /></span></a></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">The target would stagger and slew around, this was immediately explained to us that the system was so busy the game was being forced to drop frames, the frame rate icon the game had programmed into it went up and down like a pair of kangaroo's in the mating season. This was the whole argument, our game drops frames your system takes too much time on the CPU.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">It has to be pointed out that our manual actually said we only make 75% of the system time available to the game, our demonstrating we were making over 90% available was well within tolerance, and this is the only game showing this kind of issue. We were therefore skeptical about the claims being made; especially about the high quality and tested nature of their content executable.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">After an amount of head scratching we decided to measure how often the "Present" function was being called in DirectX, a little hackery later and we had a measure... Was Present being called consistently and then the system not presenting, or was the game itself changing the length of time a frame took, staggering when it presented?</div></span><p></p><p></p><div style="text-align: justify;"><span style="font-family: verdana;">Yes, the game itself was almost immediately measured to be staggering how often it called Present. So the question came up "When you move these items are you interpolating between the position and so smoothing where the target is? Or are you moving them a fixed distance each frame?"</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">"The frames are a fixed length"... The developer and their manager said. We had just measured and shown that the frames were changing length, we couldn't look at their code, so we'd had to hack about but we'd shown their code was calling the present with the same staggering it was not a fixed frame rate as they said it should be.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">We video recorded (literally with a camera on a tripod) measured the frames on the camera and calculated the stutter. Then measured with our test harness when present was being called and saw a direct match, when they called present the present happened. Our conclusion, the only conclusion really, was the content executable needed to be calling present more consistently; or their DirectX present be set up to sync with the screen or something.</div></span><p></p><p style="text-align: justify;"><span style="font-family: verdana;">The argument then began, they insisted that their game was presenting at a fixed interval, it was fixed to 30 FPS; they refused to turn on VSync, their platform did not allow this setting to be part of the DirectX initialise... It really should have been. But we had explained the staggering, the delay in present being called, neither were o do with the system all appeared to be in their code.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">"But the system is taking 100% CPU"</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Yes at this point three member of my department all pulled this face:</span></p><p></p><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgQjXQJTs3Rz7srnknncQ90kmb5vYLZw93slScTfCBPkjy7aU4s5hQ4Fxp9x0fdDXua5KjRRT4MW8eURNLTxzwrNbBDsnFXLo03piVZbW_5m50RIQdfUCrZ1cdt5BZ1QmDOXfwCwz4wWKSIRnpiXutCxrMYqFEshj3APn1LeAU51T4dgqnlTpf8LlRgUR8" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: verdana;"><img alt="" data-original-height="612" data-original-width="612" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEgQjXQJTs3Rz7srnknncQ90kmb5vYLZw93slScTfCBPkjy7aU4s5hQ4Fxp9x0fdDXua5KjRRT4MW8eURNLTxzwrNbBDsnFXLo03piVZbW_5m50RIQdfUCrZ1cdt5BZ1QmDOXfwCwz4wWKSIRnpiXutCxrMYqFEshj3APn1LeAU51T4dgqnlTpf8LlRgUR8" width="240" /></span></a></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">It has to be said the manager in charge of this developer is perhaps the worst development manager I've ever met, a man so inept he alienated and lost developers at a prolific rate, who spent £40,000 on migrating to Perforce rather than paying his team and just using git. Who seemed to think he could pick up modern development techniques by osmosis.</div></span><p></p><p style="text-align: justify;"><span style="font-family: verdana;">The developer himself? Well, lets see how he handled all this evidence from the camera footage....</span></p><div class="separator" style="clear: both; text-align: justify;"><a href="https://media0.giphy.com/media/jkYhaCyVaTxqHLk2Yl/200w.gif?cid=790b7611idztb72h2c9zlrx0d8spqges827d3dhhrrxschy0&ep=v1_gifs_search&rid=200w.gif&ct=g" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: verdana;"><img border="0" data-original-height="200" data-original-width="200" height="200" src="https://media0.giphy.com/media/jkYhaCyVaTxqHLk2Yl/200w.gif?cid=790b7611idztb72h2c9zlrx0d8spqges827d3dhhrrxschy0&ep=v1_gifs_search&rid=200w.gif&ct=g" width="200" /></span></a></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">That's right, he lost his shit.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: left;"><div style="text-align: justify;"><span style="font-family: verdana;">Despite myself, a coworker and our manager all confirming our observations that the hitching and stuttering were coming from the child process itself seeming to go idle and so it calling present at differing intervals he clearly took this to be a personal attack. He stood in our development lab and basically tore into our system; our whole team took a verbal berating at this juniors gob and his manager relished it (this was one of the earliest examples I saw of this manager relishing in his minions going to town on others instead of his reeling them in).</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Rocked by their insistence and being in the unhappy situation of having to prove our innocence our manager asked for us to be able to review their code. They refused. There were some issues, because our company had just conjoined with the place this developer worked with, they still saw us as interlopers.</div></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">My colleague was known to be somewhat more volatile than myself, so our manager left me on this horrible issue, trying to figure out what was wrong.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: left;"><div style="text-align: justify;"><span style="font-family: verdana;">Come the Friday, and a little exacerbated after two days, I started to decompile their executable. It appeared to me that their main loop was miss-behaving, it seemed to be just calling Sleep with a fixed value on top of the work it had carried out each loop. And sleep takes a variable amount of time.... It was not taking a check of how long their update took and then sleeping for the difference to meet the frame rate target and then it dawned on me.... Did you spot it too?</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">They were calling SLEEP.</div></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">The Win32 API documentation literally says sleep is not a fixed interval, it relinquishes your thread for the remainder of your time slice up to or more than the sleep time given, returning when the windows scheduler next wishes to make your thread active.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">It still says similar today, the time slept is not guaranteed.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: left;"><div style="text-align: justify;"><span style="font-family: verdana;">This client process main function seemed to be calling sleep with a fixed value each pass, it was hardcoded into the executable. If you sleep for X+Unknown, you are going to see exactly this staggering. Our demo child application has a busy wait, it never slept, it yielded by passing a sleep of zero (which make it give up its time slice but remain ready, and it would more or less always be rescheduled before the fixed frame rate next time point, plus we interpolated our animation example).</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">This child process was just proving more and more to not be to specification.</div></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Their manager insisted it was to spec... Which was very frustrating, as he grandly declared "I have read the code, I know it is correct" and "when we run it, we do not see this issue".</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">It felt like a fundamental miss-understanding, none of the folks on the team I was within were being treated with any respect, nor acknowledging our collective experience and understanding.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">I stewed on this all Friday, come the Monday things were getting fractious. This game had to be out! It came up in the master development round up that this game was held up by our system. This started the direct antagonism.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Everything I did, everything other members of the team did, all showed this content application was just staggering and stuttering on it's own volition, by design, by intent it staggered. It was not our system!</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">To prove this I therefore set about writing a harness, which would just give the client process the same DLL to load, but they were all stubbed out calls, and it would run WITHOUT our system. The content could be tested locally and checked. We got one of the same Celeron PC's, just a flat install of the OS and double clicked my harness.... Sure enough the game staggered about in the exact same way!</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">I presented a A4 page example and showed how the loop in our example application worked, explaining that Sleep is not a fixed time interval and a busy loop should be used with a yield not a time span anyway. I recorded this with my harness and their game, I presented both recordings too.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">The developer went apoplectic....</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><a href="https://media.tenor.com/D1lHRi_kUvYAAAAd/agk-angry-german-kid.gif" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: verdana;"><img border="0" data-original-height="480" data-original-width="640" height="480" src="https://media.tenor.com/D1lHRi_kUvYAAAAd/agk-angry-german-kid.gif" width="640" /></span></a></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div></span><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">He literally shouted at me that Sleep was guaranteed to come back after that amount of time, and when he ran my DLL shim locally it ran really smoothly.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">He was right, it did, but he had a much different dual core machine with 4GB of RAM and a graphics card. Our platform was a single core Celeron 1GB of RAM and built-in Intel graphics shared vram, in short very different.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">At this point the director who sat between my manager and this development manager ordered that I be allowed to look at their code.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: left;"><div style="text-align: justify;"><span style="font-family: verdana;">The worse development argument I have ever had then hit a peak, as I walked over, flanked by my manager and their manager. I lent over his shoulder and pointed to the sleep function and said that is not going to be a fixed period.</span></div><div style="font-family: verdana; text-align: justify;"><br /></div><div style="font-family: verdana; text-align: justify;">That was all I said, he never let me explain any further, he just went MENTAL! He started shouting, screaming, and called me a few choice names. He would not accept all the evidence that his loop was not a fixed length, that it was changing from frame to frame, he just could not figure out that:</div><div style="font-family: verdana; text-align: justify;"><br /></div><div style="text-align: justify;"><span style="font-family: courier;">{</span></div></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: courier;"> UpdateStuff();</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: courier;"> Render();</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: courier;"> Sleep(33);</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: courier;">}</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">Was not going to always take a fixed amount of time, first of all I pointed out that doing anything and then sleeping like this will be the time the work takes plus at least 33, and then there was no guarantee that the sleep would immediately come back. The windows scheduler would decide when you can come back after at minimum that amount of time rounded to the nearest platform tick.</span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;">His manager immediately backed him up and agreed with him, they both talked down to me. They insisted loudly and angrily that sleep was fixed and the functions they have took such a trivial amount of time they were not worth measuring.... </span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><a href="https://media.tenor.com/7QhoA9wcstgAAAAM/confused-no.gif" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: verdana;"><img border="0" data-original-height="162" data-original-width="220" height="162" src="https://media.tenor.com/7QhoA9wcstgAAAAM/confused-no.gif" width="220" /></span></a></div><span style="font-family: verdana;"><div style="text-align: justify;">Even my manager backed me up here, of course doing a function call, any function, will take some amount of time and they need to take that into account.</div></span><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">I had just had these two idiots literally shouting at me, whilst I had to stay so calm, it took an icy handful of minutes for them to accept the argument that 33+N is > 33 where N is none zero. It was just fundamental and they were not having it.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Their code became:</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: courier;">{</span></div><div style="text-align: justify;"><span style="font-family: courier;"> startTime = Now();</span></div><div style="text-align: justify;"><span style="font-family: courier;"> UpdateStuff();</span></div><div style="text-align: justify;"><span style="font-family: courier;"> Render();</span></div><div style="text-align: justify;"><span style="font-family: courier;"> endTime = Now();</span></div><div style="text-align: justify;"><span style="font-family: courier;"> Sleep(33 - (endTime - startTime));</span></div><div style="text-align: justify;"><span style="font-family: courier;">}</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Slightly better, but we still saw hitches and stutters, they were far far less frequent now.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">This massive drop in frequency I immediately and without changing my argument pointed me to the sleep, as I said the sleep is not a fixed time, it was not going to sleep for X and come immediately back, that's not how Windows worked.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Their argument was that Sleep was fixed, that it was guaranteed to return after X.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><a href="https://media.tenor.com/SvU2kn1K4y0AAAAC/frustrated-ugh.gif" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: verdana;"><img border="0" data-original-height="244" data-original-width="244" height="244" src="https://media.tenor.com/SvU2kn1K4y0AAAAC/frustrated-ugh.gif" width="244" /></span></a></div><span style="font-family: verdana;"><div style="text-align: justify;">They were very loud, very obnoxious and very adamant.</div></span><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">We returned to the developers desk: "Show me why you think Sleep is fixed".</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">I expected him to bring up some code, some harness, some proof of his thinking. Instead he opened Internet Explorer, went to MSDN and showed me the Sleep function documentation.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Sure enough it said "fixed interval". He was so smug. So infuriatingly smug. His manager was ultra smug too.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">I reached down, scrolled the mouse and pointed to the screen.... </span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div><div class="separator" style="clear: both; text-align: justify;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjsGZqzj4rRSUlPsEVrcUWD1J-6hUo2u9nH4sXuJctfGt0QB2NyVYqSIePnAXrqpukj0jx13nIWwyy7cs4FotSp6JV9tYTXPXeL7udVl7Xu3BWrvDMHk_52J1tWtWG9hDuk_Xtf7jldv0AP5qzqVBdoafLTVP0Muqz784Wvem8D5R7HwA48AceFgj46Ono" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: verdana;"><img alt="" data-original-height="415" data-original-width="1122" height="118" src="https://blogger.googleusercontent.com/img/a/AVvXsEjsGZqzj4rRSUlPsEVrcUWD1J-6hUo2u9nH4sXuJctfGt0QB2NyVYqSIePnAXrqpukj0jx13nIWwyy7cs4FotSp6JV9tYTXPXeL7udVl7Xu3BWrvDMHk_52J1tWtWG9hDuk_Xtf7jldv0AP5qzqVBdoafLTVP0Muqz784Wvem8D5R7HwA48AceFgj46Ono" width="320" /></span></a></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div></span><div><div style="text-align: justify;"><span style="font-family: verdana;">He was reading Sleep in the Windows Mobile SDK. He's right on Windows Mobile sleep is a fixed interval. However, we're not on Windows Mobile are we.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">My manager looked at the screen, I looked at the screen, they looked at the screen. And immediately the developer called me a horrible name, yup, just straight up called me a name.</div></span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">I have to admit I didn't react well, fisty-cuffs didn't happen, though the way he erupted out of his seat raging I expected the guy to swing for me.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><a href="https://thumbs.gfycat.com/RapidFriendlyCondor-size_restricted.gif" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: verdana;"><img border="0" data-original-height="251" data-original-width="334" height="251" src="https://thumbs.gfycat.com/RapidFriendlyCondor-size_restricted.gif" width="334" /></span></a></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div></span><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">He could not take it, his manager still argued he was right, so invested in their mistake were they that they could not admit their miss-understanding. The manager always claiming he only hired the best minds, this guy being quite arrogant and the whole lot of them generally being very dismissive of both myself and the department to which I belonged.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">I walked away with my head up high. My manager stood and pair programmed with both their manager and their developer for maybe twenty minutes and a new version of the content executable quietly appeared without any stutter; even when we ran obrut!</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">It was a horrible moment in my time with that employer, I remember how the guy never apologised, that development manager never apologised and the game went out without any further delay, but they never received any censure for the episode.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Our department also never shook this kind of effect either, for some reason because their manager had gone to bat for them from the off every following time a performance issue arose we had to prove everything to the Nth degree without ever seeing the other side doing the same. Very rarely was it ever truly our issue.</span></div></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">I have never forgotten, I have never forgiven.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">When you foul up, just admit it, owning it and learning from it is far more wholesome than being uptight and obtuse.</span></div>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-38065858841000262782023-07-14T18:30:00.001+01:002023-07-14T18:30:00.145+01:00Publishing Tribulations<span style="font-family: verdana;">Okay so I will start here...</span><div><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: verdana;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/8mwwdsUt_HI" width="320" youtube-src-id="8mwwdsUt_HI"></iframe></span></div><span style="font-family: verdana;"><br /></span><div><span style="font-family: verdana;">Now I have that out of my system, what am I talking about? I am talking about English.</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">As you may notice I am English, I speak English, I write in English I am fluent in English.</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">I recently sent a piece literature for publishing, I've self published before, this time it was going to a publisher.... Their reply:</span></div><div><br /></div><div><span style="font-family: courier;">Sorry to hear you are unable to response in person for your trities will not meet our publishing guideline. Please check and correct spelling, punctuation and parographing, formatting and font.</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: verdana;">Very seriously this was the reply I was sent.</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">I have withdrawn my manuscript for consideration with them, sending it to penguin... No no the publisher, just a penguin, it'll be able to give me a more coherent reply.</span></div>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-85197279294607953762023-06-25T14:00:00.000+01:002023-06-25T14:00:11.392+01:00Soooo... About the Ballad of Buster Scruggs....<div style="text-align: justify;"><span style="font-family: verdana;">It has taken me a very long time to watch this film in a single sitting, and a very long time tolerating it, so much so that upon completion and having given it some years, I immediately searched the internet for people of a like mind as me; that being that it's a load of rubbish.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">There are a few out there, mostly on hidden secret dark little corners; of which clearly this is another example.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">The open chorus of plaudits for this film, if we can call it that, all fall into two broad but terrifying categories. The first are Cohen brother fans, they won't be deterred and I can agree with them on some of the points they raise. It looks great, the cinematography and sets are for the most part great and it has call backs to great westerns.... Like the name of the Bank.... Little nuggets of gold itself. And individually the performances are great.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><span style="font-family: verdana;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/o1DcFhaCCwI" width="320" youtube-src-id="o1DcFhaCCwI"></iframe></span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">The second group are those voices which really annoy me, they say "you have to be smarter" to get the joke... To read between the lines.... To understand the history.... These people are the worst, not the least as their attitude is very insulting, which it very much is, and condescending. But really we are not dumb, we are not being obtuse and really should we need a social education background in order to comprehend some of these stories? No, not really.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">So in order, and I am going to go from memory here, we have:</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Buster the gun slinger story.</span></div><div style="text-align: justify;"><span style="font-family: verdana;">The Bank robbery.</span></div><div style="text-align: justify;"><span style="font-family: verdana;">The Gold Prospector.</span></div><div style="text-align: justify;"><span style="font-family: verdana;">The limbless Thespian.</span></div><div style="text-align: justify;"><span style="font-family: verdana;">The Wagon Train.</span></div><div style="text-align: justify;"><span style="font-family: verdana;">The Stage Coach.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">The weakest is the Stage Coach, just extremely weak, and unlike the others it looks the worst. And it was really hard to watch, really quite boring and ultimately had no point. You can tell me it did have a point, but watch it again... Did it? Really?</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">The Wagon Train, it had something, there was something there.... I was even hoping that Billy/William and Alice would tie the knot but then the other Wagon Guide would fly into a jealous rage, like there was some homosexual tension or active romance the younger man was basically calling off; just something which would have explained the story, nothing did... Sure I watched the story, but it was a pointless story.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">The Bank Robbery had a very strong start, you had the explanation of the previous robber being kept alive for the Marshal for three weeks and ending up doing hard labour, instead we cut to James Franco strung up... Twice... Just... Erg, there was no fabric, the two halves of it made no connection to one another save for his horse not listening to him, that was the only link between front and back.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">We're half way through this production, I can already see in the last story it was simply rushed and done very much to a budget, but was pointless, so we're not far from useless.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Again the Wagon Train, slow burn start, quite interesting middle, the tension over the marriage... But then, just as you think... "Oh the lover of Billy saved Alice, now he's properly torn between the two" or something... boom... literally, killed the plot.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">The title carrier, Buster Scruggs, well that was my favourite of the stories (closely followed by the Prospector) I thought that was going to be the whole style of the film, heck it is its very title. But then they shot that down fast, and the looney toons soul rising to heaven scene.... It reminded me of the laughing hyena's at the end of Who Frames Roger Rabbit.... And just was no in keeping, it was so jarring for the whole rest of the film. And it ultimately made no sense, like if we saw the spirits of the other gun slingers he fought, maybe.... There might have been an Undead PD thing, or a Frighteners Wild West style thing... But no, no pay off, just... a song.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">This leaves the Prospector to save the film, and I have to be honest, it was slow, but my favourite story.... His throwing away ANY gold though, even little flakes in the first few pans... Just so they can say "keepers, we're getting to keepers" is pointlessly annoying, and really flies in the face of the "you need to know the history kind"... really, know the history, ever seen anyone knowingly discard gold? But it had an interesting parable with an echo of echo message, he entered a virgin, un touched wild, dug holes, shared with the owl, nature reclaiming it almost immediately with the deer at the end... Even though they were just holes he made little impact but got what he wanted, which is a good way to think.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Rather than watch, ride on someone else's efforts and steal from nature, from the Prospector.... It's a moral tale and the only one to pick out of the bunch.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">If either of the brothers were to ever read this meager gaggle of gripes, I'd say to them to loose the yes men, sometimes things aren't very good, you done goofed boys.</span></div>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-47242584211216209112023-06-11T14:11:00.001+01:002023-06-11T14:11:13.676+01:00React Physics 3D : First Impressions<p><span style="font-family: verdana;">With my home engine coming to the state of being able to visually represent a world and move about within it, I've decided to set about sorting out a physics representation.</span></p><p><span style="font-family: verdana;">Very much as I did with the mathematics where I set about writing all my own code and then adopting a library; in order to best learn the process from first principles I also set about writing my own physics engine and visualizer (the latter using the much more familiar to me fixed function pipeline of DirectX 9 - Yes it still has a use in 2023!)</span></p><p><span style="font-family: verdana;">The physics implementation I went with was a simple rigid body test for cuboids and spheres. Then a ray cast. At which point I set about seeking a library as it's a huge topic I didn't want to sink too much time into.</span></p><p><span style="font-family: verdana;">I settled, after about a fortnight of reading and trying on <a href="https://www.reactphysics3d.com/">React Physics 3D</a>.</span></p><p><span style="font-family: verdana;">My initial impressions are that it is easy to set up, supports CMake and just worked; though I'm yet to fully get to grips with it, I am happy I have my world and simulation set up and working.</span></p><p><span style="font-family: verdana;">I've also happily separated my game objects from my visual objects with the use of my Ecs and I'm able to do the same, by registering a new Ecs update system with my entity list and simply piping the commands to create and destroy physics objects per frame.</span></p><p><span style="font-family: verdana;">The update pumping of time matches my engine instantly, so I had a lot of wins.</span></p><p><span style="font-family: verdana;">However, I am not building in a permissive manner, I have maximum warnings as errors, I have strictness on and permissive off; I also remove all compiler specific extensions, so I am using only C++ in it's rawest, most portable form.</span></p><p><span style="font-family: verdana;">Immediately, even though I've compiled React separately and then just link to the library statically, I have a bunch of the React headers giving me errors; notably map, BroadPhaseSystem and DefaultLogger.</span></p><p><span style="font-family: verdana;">The first two are the same sort of issue, which just surprised me, there's a constexpr uint64 set to minus one (so it's max) an unsigned value set to a signed negative to under roll it... Well it's quite bad practice:</span></p><p><span style="font-family: courier;">static constexpr uint64 INVALID_INDEX = -1;</span></p><p><span style="font-family: verdana;">And I immediately updated this to:</span></p><p><span style="font-family: courier;">static constexpr uint64 INVALID_INDEX { std::numeric_limits<uint64_t>::max() };</span></p><p><span style="font-family: verdana;">I may feed this back to the author, he most likely knows, maybe there's even a reason for it, personally I'd always stick to numeric limits and max in this case though, not least as it is constexpr and not a hack ;) </span></p><p><span style="font-family: verdana;">The other one was a lambda expression in a call to std::transform for making all logging strings lower case, the code simply used ::tolower. However, it was not type safe, it was converting int to char, but that's not explicit and so I changed it over to read:</span></p><div style="text-align: left;"><span style="font-family: courier;">std::string toLowerCase(const std::string& text) {<br /> std::string textLower{ text };<br /> std::transform(textLower.begin(), textLower.end(), textLower.begin(), <b>[](const char& character) -> char { return static_cast<char>(std::tolower(character)); }</b>);<br /> return textLower;<br /> }</span></div><p><span style="font-family: verdana;">The lambda here is hard to read, so lets split it out:</span></p><div style="text-align: left;"><span style="font-family: courier;">[](const char& character) -> char <br /></span><span style="font-family: courier;">{<br /></span><span style="font-family: courier;"> return static_cast<char>(std::tolower(character));<br /></span><span style="font-family: courier;">}</span></div><p><span style="font-family: verdana;">We take in a character, return a character, explicitly, so we have to cast the int return of std::tolower... simple really, but hard to read. It compiles down well; but just using "::tolower" well that's a decay to int and you have to be permissive in your type exchange... I don't like that, express yourself in your code type correctly, and it'll be type safe.</span></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-64137378632162682272023-06-02T21:55:00.004+01:002023-06-02T21:55:33.941+01:00Little bit of Love for Beagle 2's Colin!<p>Remembering the Professor... And the wonderful Beagle 2 Mission.<br /><br /><a href="https://www.bbc.co.uk/news/uk-england-bristol-65788431">https://www.bbc.co.uk/news/uk-england-bristol-65788431</a></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgRFJLw_C7g2ntLq4CPvEHJmfrx2nw3Lo1CzQcnPBYtV-7K5ABOyEulF_sXLJzYEd8JM2jlua_p8q5Ik_6nMlAemaxGmsTKC19fzOgeaMfJod0NgDQt5qqbYnDYJ6nE2diaQErtimuVnWP0BJM7QjhALGlvS6eZjaSfgE7IEaQMzQcrXeJTKVhYnLSx" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="549" data-original-width="976" height="180" src="https://blogger.googleusercontent.com/img/a/AVvXsEgRFJLw_C7g2ntLq4CPvEHJmfrx2nw3Lo1CzQcnPBYtV-7K5ABOyEulF_sXLJzYEd8JM2jlua_p8q5Ik_6nMlAemaxGmsTKC19fzOgeaMfJod0NgDQt5qqbYnDYJ6nE2diaQErtimuVnWP0BJM7QjhALGlvS6eZjaSfgE7IEaQMzQcrXeJTKVhYnLSx" width="320" /></a></div><br /><br /><p></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-22475803410007774602023-05-25T18:30:00.005+01:002023-05-25T18:30:00.142+01:00Just Stand It Up: About Premature Pessimization<p style="text-align: justify;"><span style="font-family: verdana;">Engineers often talk about premature optimization, but today I'm going to just talk briefly about the opposite, premature pessimization.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">I currently work on a very large code base, it has been developed over four years from scratch. One of the first things performed were a series of investigations into "best performing" data structures, such as maps, lists and so forth.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Now of course one has to totally accept one can optimize any data structure that little bit more for a specific use case. One also accepts that when in C++ the standard library lends itself to being replaced bu defining standard operators, iterators and the algorithms going with all this use those standard exposed APIs, so you can implement your own.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">I just want you to stop though and think... Do you want to?</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Too early in a project and you can start to introduce bloat, either in terms of slight differences in the optimized cases, the code from whatever third party "best" you picked and even from your build chain, as you are bringing in dependencies on someone else.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">The standard library doesn't do any of this, its dependencies are guaranteed by the ABI.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">So why not just use standard map, or standard vector and standard string, or standard formatting?</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Quite often I'm finding it is due to premature pessimization, that developers voice who cries out about some issue they had, either when some technology was new and emerging or late in an earlier project's life where they had to optimize for that specific case I mention, where the standard version did prove itself to be a detriment.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">These engineers carry with them the experience, sometimes scars, from such exposure to edge cases and bugs they had to quash. Rightly and understandably they do not want to experience these self same issues again; their minds therefore are almost averted from just standing it up with the standard version. They immediately seek and even proactively nay-say the standard versions in favour of domain specific "best" versions.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">This is in my opinion the very definition of premature pessimization, the standard library is wonderful, diverse and full of very well tested code and will have nearly zero overhead in adding and using to your project in C++.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">I would therefore coach any developer with such mental anguish over just using the standard library to simply stand it up, just get across that line of things both building and running, then extend it to remain maintainable. And finally as you think you're getting close to stable, well then you can expend more time looking at, profiling, and understanding the edge cases.</span></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-13270295372821218292023-04-23T15:31:00.003+01:002023-04-23T15:31:52.380+01:00Missing Emergency AlertJust 30 minutes ago the UK was meant to test a nationwide all handsets Emergency Alert system... They did, my wife received the message and we saw someone at the Crucible in Sheffield at the Snooker also get the alert.<div><br /></div><div>But I didn't get it.... Precious few others I know seem to have received it, in total I can say two, the strange on the Tele and the Wife, that's it... No-one else has mentioned getting int, quite the opposite, lots of people interested in the technology didn't receive the message.</div><div><br />So what gives?<br /><br />Has there been some technical glitch?<br /><br />Did handsets turn out to not be compatible?<br /><br />Did some spam protection in the networks stop the message?<br /><br />It is curious, and I'd love to find out more.</div>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-38999521807867919022023-04-10T13:08:00.002+01:002023-04-10T13:08:16.400+01:00Disgusted by the BBC (Taiwan & Ukraine)<div style="text-align: justify;"><span style="font-family: verdana;">I'd like to bring a heart warming post this Easter Monday; but I can't... Instead I just sat down and listened to the 1 o'clock news by the BBC and I'm shocked, annoyed and disgusted by their describing Taiwan as a "self governing province".</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Taiwan is a country in it's own right! I admit a fall out of the Chinese civil war, but the BBC describing Taiwan so is like my British head calling the Republic of Ireland a "Self Governing Province"... or Canada, or New Zealand, or Australia. It would simply not be tolerated.</div></span><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div><div style="text-align: justify;"><span style="font-family: verdana;">And I think this narrative can only be for one purpose, to placate Beijing!</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">I say, this Chinese exercise to "encircle Taiwan" is illegal, should be utterly condemned, not just in the strongest words but by physical action to see them off.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">And whilst I'm at it, the same rhetoric left to the humanitarian catastrophe in Ukraine and I can only express my opinion that the west needs to stop with the words and act.</div></span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">A warmonger I am happy to be called, if just one person retains their own self determined liberty, and that is what is at stake with Russian in Eastern Europe, and with China as a whole. Countries led by literal megalomaniacs, unlike me who hold the free world hostage!</span></div><div style="text-align: justify;"><br /></div>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-12065929484403762032023-03-29T23:45:00.001+01:002023-03-29T23:53:18.743+01:00A mini-break in C++ Optimization (Pt 1)<p><span style="font-family: verdana;">I have had one of those evenings, in reviewing some code for a friend I came across a repeated pattern where he would iterate over collections, strings and other linear items in a loop and mutate them. We're of course talking C++ here, and he had this whole myriad of loops all over sanitizing, processing, event summing values.</span></p><p><span style="font-family: verdana;">I asked whether he had access to the STL he immediately got a bit uppity, he and I have never seen eye to eye about using the STL.</span></p><p><span style="font-family: verdana;">I advocate it be used, even just standing something up which you go back and make more performant or more memory efficient later, just stand up your project, don't get bogged down in details of the best string, or the best vector.</span></p><p><span style="font-family: verdana;">He however stands by his having "long tested examples I use all the time, just ignore them"...</span></p><p><span style="font-family: verdana;">No.</span></p><p><span style="font-family: verdana;">Simply put his examples, used in a smattering of programs, peer reviewed very infrequently by a miniscule handful of people is not good enough, use the STL, it is seen by literally millions of engineers, it is very portable and well adopted, use it to your advantage.</span></p><p><span style="font-family: verdana;">We sparred a little about this, but then I simply asked whether he had any parallelism in his algorithms?</span></p><p><span style="font-family: verdana;">Nope, of course STL can just use them.... You can provide the execution policy.</span></p><p><span style="font-family: verdana;">Lets take one of his examples, a simple function to give him the time & date as a character array.</span></p><div style="text-align: justify;"><span style="font-family: courier;"><span style="white-space: pre;"> </span>char* GetDateTimeStringHis()<br /><span style="white-space: pre;"> </span>{<br /><span style="white-space: pre;"> </span>time_t now = time(0);<br /><span style="white-space: pre;"> </span>char* buffer = new char[64];<br /><span style="white-space: pre;"> </span>memset(buffer, 0, 64);<br /><span style="white-space: pre;"> </span>ctime_s(buffer, 63, &now);<br /><span style="white-space: pre;"> </span>for (int i = 0; i < 64; ++i)<br /><span style="white-space: pre;"> </span>{<br /><span style="white-space: pre;"> </span>if (buffer[i] == '\n') buffer[i] = 0;<br /><span style="white-space: pre;"> </span>}<br /><span style="white-space: pre;"> </span>return buffer;<br /><span style="white-space: pre;"> </span>}</span></div><p><span style="font-family: verdana;">This returns a character array buffer raw pointer.... No, he interjected, it returns a string. A raw pointer to memory is NOT a string folks, this is where my argument on that point begins and ends. This code is very unsafe, I don't like it and I certainly insist it can easily leak memory, for whom is going to delete that buffer?</span></p><p><span style="font-family: verdana;">So I erase that buffer with an actual standard string:</span></p><div style="text-align: left;"><span style="font-family: courier;"> std::string GetDateTimeStringV1()<br /><span style="white-space: pre;"> </span>{<br /><span style="white-space: pre;"> </span>time_t now = time(0);<br /><span style="white-space: pre;"> </span>std::string buffer(64, 0);<br /><span style="white-space: pre;"> </span>ctime_s(buffer.data(), 63, &now);<br /><span style="white-space: pre;"> </span>for (int i = 0; i < 64; ++i)<br /><span style="white-space: pre;"> </span>{<br /><span style="white-space: pre;"> </span>if (buffer[i] == '\n') buffer[i] = 0;<br /><span style="white-space: pre;"> </span>}<br /><span style="white-space: pre;"> </span>return buffer;<br /><span style="white-space: pre;"> </span>}</span></div><p><span style="font-family: verdana;">he didn't like this, but accepted perhaps that was better, he argued about the string constructor taking a length and a character (zero) to initialize itself with, but went with it. It's safer, simpler, easier to read code.</span></p><p><span style="font-family: verdana;">I'm still not happy, I don't like that loop:</span></p><div style="text-align: left;"><span style="font-family: courier;"> std::string GetDateTimeStringV1()<br /><span style="white-space: pre;"> </span>{<br /><span style="white-space: pre;"> </span>time_t now = time(0);<br /><span style="white-space: pre;"> </span>std::string buffer(64, 0);<br /><span style="white-space: pre;"> </span>ctime_s(buffer.data(), 63, &now);<br /><span style="white-space: pre;"> </span>std::transform(<br /><span style="white-space: pre;"> </span>buffer.begin(), buffer.end(), buffer.begin(),<br /><span style="white-space: pre;"> </span>[](const char character) -> char<br /><span style="white-space: pre;"> </span>{<br /><span style="white-space: pre;"> </span>if (character == '\n')<br /><span style="white-space: pre;"> </span>{<br /><span style="white-space: pre;"> </span>return 0;<br /><span style="white-space: pre;"> </span>}<br /><span style="white-space: pre;"> </span>else<br /><span style="white-space: pre;"> </span>{<br /><span style="white-space: pre;"> </span>return character;<br /><span style="white-space: pre;"> </span>}});<br /><span style="white-space: pre;"> </span>return buffer;<br /><span style="white-space: pre;"> </span>}</span></div><p><span style="font-family: verdana;">He hated this, and I have to be honest I don't like the lambda either, but this is correct, using the transform algorithm and the lambda could be expressed in a location it could be reused, or just as a free function somewhere, it doesn't have to be inline here making a mess of reading the code.</span></p><p><span style="font-family: verdana;">What however is it doing? It changes any new line to a zero in the buffer string, why? Well ctime_s puts a new line at the end, so if we reverse the iteration we may get a much better performance we can early out of the loop. But we can even just do away with the whole transform, we know it's the last character so just set it to zero as an optimization and simplification. My friend can get behind this now:</span></p><div style="text-align: left;"><span style="font-family: courier;"> std::string GetDateTimeStringV2()<br /><span style="white-space: pre;"> </span>{<br /><span style="white-space: pre;"> </span>time_t now = time(0);<br /><span style="white-space: pre;"> </span>std::string buffer(64, 0);<br /><span style="white-space: pre;"> </span>ctime_s(buffer.data(), 63, &now);<br /><span style="white-space: pre;"> </span>buffer[std::strlen(buffer.data())-1] = 0;<br /><span style="white-space: pre;"> </span>return buffer;<br /><span style="white-space: pre;"> </span>}</span></div><p><span style="font-family: verdana;">We can even further think about this code, what will strlen do? It might count from 0 to N to find the first zero character as the value, could we therefore count backwards from the 64th position in the buffer? Well, we know the format of the data and time we get is known:</span></p><p><span style="font-family: courier;"> Wed Mar 29 23:36:01 2023</span></p><p><span style="font-family: verdana;">Twenty five characters with the new line, adding another for the null termination character, so we can always just set the twenty fourth to zero and reduce the buffer size at the same time to perfectly fit!</span></p><div style="text-align: left;"><span style="font-family: courier;"> std::string GetDateTimeStringV3()<br /><span style="white-space: pre;"> </span>{<br /><span style="white-space: pre;"> </span>time_t now = time(0);<br /><span style="white-space: pre;"> </span>std::string buffer(26, 0);<br /><span style="white-space: pre;"> </span>ctime_s(buffer.data(), 26, &now);<br /><span style="white-space: pre;"> </span>buffer[24] = 0;<br /><span style="white-space: pre;"> </span>return buffer;<br /><span style="white-space: pre;"> </span>}</span></div><div style="text-align: left;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: left;"><span style="font-family: verdana;">I feel I'm getting somewhere, I just want to make sure we use the STL version of the time functions now and use brace initialization for the "now".</span></div><div style="text-align: left;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: left;"><div><span style="font-family: courier;"> std::string GetDateTimeStringV4()</span></div><div><span style="font-family: courier;"><span style="white-space: pre;"> </span>{</span></div><div><span style="font-family: courier;"><span style="white-space: pre;"> </span>std::time_t now{ std::time(0) };</span></div><div><span style="font-family: courier;"><span style="white-space: pre;"> </span>std::string buffer(26, 0);</span></div><div><span style="font-family: courier;"><span style="white-space: pre;"> </span>ctime_s(buffer.data(), 26, &now);</span></div><div><span style="font-family: courier;"><span style="white-space: pre;"> </span>buffer[24] = 0;</span></div><div><span style="font-family: courier;"><span style="white-space: pre;"> </span>return buffer;</span></div><div><span style="font-family: courier;"><span style="white-space: pre;"> </span>}</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">This ended my concerns and improved the performance of the code, he was calling this function nearly every time he logged, nearly every time he sent a network message and for very many of his database transactions. This was 10 minutes of just thinking about the problem.</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">Now... Back to <algorithm> and execution policy with him...</span></div><div><br /></div></div>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-36384584193060478892023-02-28T18:30:00.005+00:002023-02-28T18:30:00.184+00:00Will I ever Buy a Laptop Again?<p></p><div style="text-align: justify;"><span style="font-family: verdana;">Will I ever buy a laptop again? This is a significant question, PC's themselves are going the way of becoming locked down, indeed UEFI was the first step on that road, requiring secure keys and other literal dongles is becoming quite common for the home PC Builder; or even small assembly shops.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Laptops are an even more confused space, building your own is sadly incredibly rare, but even rarer is being able to buy a laptop and it being upgradable.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Now, I accept laptops have soldered on components, they are an all in one solution for most vendors. So it was four years ago when I specced up and bought my current laptop I had three requirements from it:</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">1. Upgradable Memory</div></span><p></p><p style="text-align: justify;"><span style="font-family: verdana;">2. Upgradable Drives/Storage</span></p><p style="text-align: justify;"><span style="font-family: verdana;">3. Changeable Battery</span></p><p></p><div style="text-align: justify;"><span style="font-family: verdana;">At that time I settled on the Lenovo E480, with an 8th Generation Intel Core i5 inside.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">For point 1 I was able to buy it with 4GB of RAM (a single stick of DDR4) installed, saving me over £110 on buying an upgrade to 8GB direct. I simply received it, opened it and installed a 16GB kit (pair of 8GB sticks) for £83; so I saved and had more memory.</div></span><p></p><p style="text-align: justify;"><span style="font-family: verdana;">For point 2, I was again able to get deliver with a single 500gb mechanical hard drive, and for merely £65 I was able to get a really nice M.2 nVME SSD and install that the moment it arrived. I am still able to replace the standard 2.5" SSD SATA drive if I want. And I was also able to install a 1TB MicroSD card for more cold storage of large files when on the move and disconnected from my file server.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">For point 3, being a Lenovo is a huge boon, there are a lot of resellers of their components and the battery is no exception, plus it's a battery just installed with a sticky pad and a single 4 pin connector, very simple to open the chassis and swap it out. After four years mine is due a change, it has gone from around 9 hours on a full charge to only 4.</span></p><p></p><div style="text-align: justify;"><span style="font-family: verdana;">The machine is simple to work on, it's got lots of external ports, it can drive all the devices I want, the wfi, bluetooth and just quality of the Lenovo build is very nice.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">So, what could possibly replace it?</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">I am coming up blank, I've been looking and looking, I do not want to support Apple, as much as I like the look of their hardware the total lack of any repair or upgrade paths in the M1/M2 space annoys me, their GPU is custom too, and I want to be working in open source wherever possible (read Linux).</div></span><p></p><p></p><div style="text-align: justify;"><span style="font-family: verdana;">Asus are similarly offering lots of options but so very many of them are locked down, there are RAM upgrades for some, but that's about all. And crucially battery replacement is sketchy, it's hard to even find out what battery a unit offering has.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Very similar results in my search with Toshiba, Acer, Dell (including Alienware) and a custom builder here in the UK.</div></span><p></p><p style="text-align: justify;"><span style="font-family: verdana;">I did look briefly at modular options, such as the ones touted recently by Linus Sebastian, but getting them here in the UK is a massive pain in the rear.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">So simply put will I ever buy a laptop again? I don't know.</span></p><p></p><div style="text-align: justify;"><span style="font-family: verdana;">If I can find something meeting my three previous requirements and include adding an external GPU via USB-C to it, that maybe a selling point, but I'm really not willing to give up on the first three requirements I had. They are the very definition of a laptop to me, you live with a locked down CPU and GPU, but at least you can expand the utility of the unit in other ways. Except, vendors want to ship thinner, sealed, easy [for them] to support units with a limited [est 2 year] shelf life; after which you are cast to the winds.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">As I understand it my Lenovo now being 4 years old, an 8th Gen Intel, makes it positively geriatric.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Want to read more about my quest for a laptop in 2018, why not read this one <a href="http://megalomaniacbore.blogspot.com/2018/12/deep-thought-about-new-laptop.html">http://megalomaniacbore.blogspot.com/2018/12/deep-thought-about-new-laptop.html</a><br /><br />Or even my laptop purchase from 2012, <a href="http://megalomaniacbore.blogspot.com/2012/01/custom-laptop-for-virtual-deeds.html">http://megalomaniacbore.blogspot.com/2012/01/custom-laptop-for-virtual-deeds.html</a></div></span><p></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com1tag:blogger.com,1999:blog-2718170321131838315.post-86009977354676153762023-02-19T10:06:00.001+00:002023-02-19T10:06:12.828+00:00Home Game Engine : Physics Debugging Tool Progress<p></p><div style="text-align: justify;"><span style="font-family: verdana;">The last week has been invested into the Physics Debugging tool, it connects to the main game world; whether that is running in the client with it's own vulkan renderer, or into the server, for I am planning to have the server be authorative over player position at least, to prevent some of the strange hackery doo of the client being in charge.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Here's a silent video of that progress, as I'm recording from my Ryzen Workstation and I don't have a mic in here.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/31r_9HEvUmE" width="320" youtube-src-id="31r_9HEvUmE"></iframe></span></div><p></p><p></p><div style="text-align: justify;"><span style="font-family: verdana;">There is actually a lot going on in the background here, though the scene looks largely unchanged.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">The most obvious addition since the last scene update is the replication of the rotating object, which is just a box, but that is being rotated on the client. My controls here send a message to the client, which then sends the status update to it's GameObject. The same frame the GameObject queues a message out and the scene updates to the physics representation; which means I get near real time (minimum of network delay + 1 frame) of the replication of an object back and forth.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">However, I don't plan on expanding that too much, the number of messages is getting silly. For example, I have an object for a position update (3 floats) then I have one for a position and a rotation (6 floats) and then a whole other one for position, rotation and scale (9 floats) which I call a transform. I could just replicate a transform each frame, but then the amount of data gets very much larger.</span></div><p></p><p style="text-align: justify;"><span style="font-family: verdana;">I also have flash backs of delivering data from a server on a provisioned box, where you pay by the megabyte per monthly usage (and I honestly don't know why I couldn't host a service like this server publically on my massive 500mbit home fiber, which has no cap on data, it's all I can eat) but practically, I'd not like to host this here, except for debug, and if I were to make a game, it'd need to be on an AWS instance or something.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Anyway, that's all very much future stuff, my next problems are all about the game, improving and cleaning up my game object authoring, improving my model making skills (I might actually have to double down and actually learn Blender) and the working out a few issues I know exist in my control scheme.</span></p><p></p><div style="text-align: justify;"><span style="font-family: verdana;">More about all that in March though, for the rest of February, I have to tidy this stuff up.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">If you want to know more, or follow some of my other older projects and videos, my YouTube Channel exists <a href="https://www.youtube.com/@LordXelous">https://www.youtube.com/@LordXelous</a> and of course this blog is always ticking over!</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">That Subscribe button really helps!</span></div><p></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-39244163157748125372023-02-18T09:57:00.005+00:002023-02-18T09:57:30.187+00:00Programming the Thought Triangle<div style="text-align: justify;"><span style="font-family: verdana;">As a programmer I spend a lot of time with my mind on the problem space I'm tackling, my hands are on the keyboard, my eyes are on the screen and this trinity is my creative process.</span></div><p style="text-align: left;"></p><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><span style="font-family: verdana;"><div style="text-align: justify;">If you start to talk to me from a room away, if you come to my door and start to wave at me to get my attention, if you keep calling my name, if you keep calling my phone or sending me texts... Do you know what you are doing?</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">That's right, you are totally derailing my thought process and creative flow.</div></span><p></p><p style="text-align: justify;"><span style="font-family: verdana;">You, the interrupter are pretty much responsible for costing me a complete mental problem space unload and a complete mental space reload.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">That is very stressful for a programmer, it's a huge amount of mental gymnastics, which is tiring, difficult and above all unnecessary.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">If you have a child at home who shows any interest in programming, and they're busy doing it, or "playing" on the computer, but there's no actual game showing, just let them, leave them be.</span></p><p style="text-align: left;"></p><div style="text-align: justify;"><span style="font-family: verdana;">You don't need to train them to program a computer, you need to train yourself to not interrupt them, that screen to fingers to thought triangle needs to be left where it is they need to be left alone.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><b><div style="text-align: justify;"><b>Social Media!!!</b> Now, I have to add a prickle problem into this, you maybe training yourself to leave a creative alone and leave them in their screen to fingers to brain triangle of creativity. Now, is the same true of someone deep into social media?</div></b><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Well, sort of, the key different I find is creativity, are they being creative in their little bubble? Are they learning? There are clear flagging indicators of a problem, where you do have to step in.</div><div style="text-align: justify;"><br /></div><b><div style="text-align: justify;"><b>Communication?!?!</b> Even more confusing is where we come to the screen to fingers to brain communication items, I can certainly relate to being deep into typing an e-mail and someone is saying my name over and over; that person does not respect that I'm actually doing something, they do not lend any value to the fact I am trying to write an email. Immediately I point out that I am in the midst of a creative effort, that person therefore needs to train themselves to not interrupt. They're being rude and disrespectful.</div></b><div style="text-align: justify;"><br /></div><div style="text-align: justify;">However, is the same creative tag so easily applied to having a chat? To having a visual chat with someone over WhatsApp for instance, no. I don't think it can be, when two people are talking face to face you can interject; you can say excuse me I just need to tell you.... and speak, this is completely normal interruption.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">The distinction interrupting someone on WhatsApp talking to a friend is simple, it's a leisure, it's not live and death.</div><div style="text-align: justify;"><br /></div><b><div style="text-align: justify;"><b>Until it is life and death!</b> I had this argued with me, that you can't interrupt someone if it's life and death, and I agree. But you know what, if you're telling someone something on the "live and death" scale of humanity over WhatsApp... Get a life!</div></b></span><p></p><p style="text-align: left;"></p><div style="text-align: justify;"><span style="font-family: verdana;">In short, I think I keep meeting with rude, self centered, selfish people, who lack empathy and don't value that when I'm sat at my computer; I am actually doing something. And I work at my computer, and I work at writing computer games, so you can not assume because there's a game on the screen I'm not busy.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">However, if you see that 2 foot fixed gaze, my fingers flying and I am clearly engaged with the work a head of me... well it's pretty safe to say you should GO AWAY!</div></span><p></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-44693196823854186002023-02-07T18:30:00.001+00:002023-02-07T18:30:00.191+00:00The Old Lady and the Server<p style="text-align: justify;"><span style="font-family: verdana;">No, this isn't some strange nursery rhym (though I wonder if it could be) no this is a story of a literal old lady whom I believe was trying to collect as many notches on her bed post as possible...</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Let's start at the beginning, I lived in a house I rented, I had a spare bedroom and my younger brother broke up with his long term girlfriend. He came to live with me, quite unsuccessfully, as his life was very chaotic, and indeed in the end I threw him out in the end.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">But in the nine months he inflicted himself upon me he had a few lovers through his door. One of them was said "old lady".</span></p><p style="text-align: justify;"><span style="font-family: verdana;">I say old she was maybe early to mid-forties, with children, but that was old, my brother was nineteen... heck I was only twenty two.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">He was going through a series of different jobs at the time, and somehow he met this woman, who promised him a bunch of things; like a car, and MR2 if I call correctly. Which he went on about constantly.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">These rewards never appeared, but one day she did, one morning to be precise, I came down into my own kitchen and there was this woman in my non-smoking house smoking. If looks could have killed she would have murdered me when I asked her to go outside to smoke. Until she realised this was my house; so the stories clearly went both ways between them and my brother.</span></p><p></p><div style="text-align: justify;"><span style="font-family: verdana;">"Where does server come into this xel?"</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div></span><p></p><p style="text-align: justify;"><span style="font-family: verdana;">Well, when my brother broke things off with her she continued to communicate with me, I'm not even sure how she knew my contact details to be honest, I think she had a nominal business address or something, in fact thinking back now, I think one of the mysterious things she promised my brother as she bedded him was to get me a job; despite my not asking.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">But it seems she was looking for a NOC engineer.</span></p><p style="text-align: justify;"><span style="font-family: verdana;">Indeed, I spoke to her briefly where she was talking to me about setting up BSD servers, "My servers run BSD". She never explained what her servers were doing (I suspected porn).</span></p><p style="text-align: justify;"><span style="font-family: verdana;">She did however offer me a job, at £4,000 a month. That's £48,000 a year. At the time I was in a £21,500 job doing network maintenance (which I hated, and have commented about in earlier posts).</span></p><p></p><div style="text-align: justify;"><span style="font-family: verdana;">So her offer was interesting, I took a weekend to expose myself to BSD. I'd not really used it before, just early versions of Linux, ScoUnix and Windows. BSD was interesting, different, but nothing I had experience with. She kept talking about her current NOC guy.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Either way, it came to nothing, and I think that's because I never came...</div></span><p></p>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-86221925227702882932023-02-05T17:00:00.001+00:002023-02-05T17:00:00.200+00:00Physics Debugger in my Home Game Engine<div style="text-align: justify;"><span style="font-family: verdana;">It may not look much, but this is a huge step forward in my home game engine development. This is a physics visualization tool I've written, to show me the shapes I register with my physics simulation, it communicates with the game client one frame behind the client, and lets me zoom a camera around the world to see whether shapes line up and to take a snapshot of the physics/collisions being resolved this frame.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">The whole physics system is pretty much a bag of spatial checks at the moment, for instance I ray cast from a given point to the four corners of a cube to test whether the point is within, that's pretty compute-intensive.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">But at least now I can see there is only one such cube (the purple/pink) one in the scene.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">I can also clearly see the ground mesh (the yellow/red triangles).</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Infinity is just the blue.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div class="separator" style="clear: both; text-align: justify;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnN7IcLGBZdrTcXWpJZffTm9lLcqwzXzOqpVWuKYGYiFEcj1moNNmFmLVm0_hdidfI8Ey7Wwy1srFJoxK0K1ulAwZAqf0h59xvTlklnFZGcfcTBrN4xXYO3O8JdCNpO1DM1KMvFCinyFXj2gxN7y0IMD8we2SouSMBGFRpty5DlnBCFTJi0Y9LPqt-/s802/UpTo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: verdana;"><img border="0" data-original-height="632" data-original-width="802" height="252" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnN7IcLGBZdrTcXWpJZffTm9lLcqwzXzOqpVWuKYGYiFEcj1moNNmFmLVm0_hdidfI8Ey7Wwy1srFJoxK0K1ulAwZAqf0h59xvTlklnFZGcfcTBrN4xXYO3O8JdCNpO1DM1KMvFCinyFXj2gxN7y0IMD8we2SouSMBGFRpty5DlnBCFTJi0Y9LPqt-/s320/UpTo.png" width="320" /></span></a></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><span style="font-family: verdana;"><div style="text-align: justify;">Also, this rendering of the physics world is using yet another renderer I've put together, again integrating ImGui as my defacto GUI in such circumstances.</div></span><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">I need to do a lot of work on this, but it's just a fun project.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">And recently having a bit of run, something you can tinker with, something which just makes you think and relax is perhaps key to improving ones skills.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Before I started this whole home game engine (despite working on games at work) I had no idea how to put a renderer together; even as badly as I have; and certainly no idea about a physics engine, now I have the rough knowledge of both.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div><div style="text-align: justify;"><span style="font-family: verdana;">My home project backing up my experience at work, and also the home project lets me try things I might not otherwise do at work, like totally break things... Oh no wait, I break things all the time....</span></div><div style="text-align: justify;"><br /></div></div>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-3126628908983446752023-01-25T18:30:00.001+00:002023-01-25T18:30:00.251+00:00No Rack, but definitely an IT mistake <div style="text-align: justify;"><span style="font-family: verdana;">I sat down to write this on Christmas Day, but things went wrong... so here it is a mere month late!</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">It has been twenty years, so I feel comfortable sharing this one with you.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Christmas Eve afternoon my landline began to ring and ring and ring, foolishly, rashly I answered to hear an unfamiliar accent telling me to explain to them the complete inner workings of an intranet web service. No hello, no explanation who they were, just a desperate voice asking, nay demanding, this information....</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">It took me a few minutes to collect my thoughts and realise what they were talking about. At the time I was contracting in short sharp sprints between projects for various folks, I'd actually written three different web based systems in the prior three months; so i was trying to figure out which of the recent ones it was..... Only to then hear the name of the company and realised this voice was asking about a project I had been contracted to write nine months prior.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">It was a very long ways away in my memory.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Not only was my memory foggy but I had ensured everything asked for in the contract was documented, all the work was carried out at their offices, on their own machine, I didn't even hold a copy of their system.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Above all it was Christmas Eve!!</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">I explained that not only was I not contracted to support the project (a sore spot, as I usually made as much money supporting a project as doing it at that time); but this project had actually been a bit of a squeeze, for it had been two weeks work and absolutely no more.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">Long story short I'd been contracted by one chap, the manager, because his in house analyst was overwhelmed and unable to cope, so he'd had me to quickly deliver this project for them. It was a simple view over data on a few pages, driven from a server that the analyst knew and who deployed it out for himself.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">The manager and this analyst signed it all off as I went, and I documented the whole thing, critically including how to edit the pages... So they only needed to know a bit of HTML, JavaScript and CSS to change any part of it as they felt suited themselves... and I left.... Getting my money a month later and never hearing anything from them.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">On a shoe string I thought I had delivered them a real bargain! Not hearing anything for all that time had made me confident they were happy.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">So what was this desperate emergency?</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">The colour! The guy wanted to know how to change the colours in the cascading style sheet...</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">It is Christmas Eve! And this £100k per year analyst is calling me to ask for a crash course in CSS!!!</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">To say I was not amused is perhaps the understatement of the decade!</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">I politely explained that I was available (at an extortionate price her hour) from December 28th onwards and then regular rate January 3rd onwards for contracting, but right now I was not available. And all this was available through my then solo contractor company.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">The reply? To be honest he was quite rude, at which point the telephone was returned to its cradle and the TV remote rediscovered.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">The trill ring carried on until I unplugged the phone... and my mobile started to ring, my inbox fill, and my patience ran wafer thin.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">But I was simply not going to be talking to this guy, my opinion all these years later was that the guy was a paper suit, he sat there getting others to do all this work for him, not even delivering to his own manager and said manager was just accepting of this for some internal political reasons I could guess at, but which were lost on me at the time.</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div><div style="text-align: justify;"><span style="font-family: verdana;">I decided however to be proactive, I wrote up a couple of paragraphs on my headed PDF, attached the original contract, attached a proposal for employing me from the 28th for 2x8 hour slots and then from the first week back in January for 5x8 hours as a starting point. I put this all together, with an estimate and I sent it in triplicate.... To this analyst, to the manager and to the HR department at said company through whom I had worked for them.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">I then had the most interesting email, which only reaffirmed my paper suit opinion of the guy.... For this email was from the manager saying "Why are you sending me this on Christmas Eve?"</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">And I replied "because your analyst <insert name here> is contacting me, phone off the hook on Christmas Eve to ask me about that work I did in March".</div></span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div><div style="text-align: justify;"><span style="font-family: verdana;">I heard nothing more.... Until the week following the week back, I was at another contract and my mobile rang... It was a very polite voice, the manager, he wanted me to come work for them.... because Mr Analyst had left his role.</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div><div style="text-align: justify;">I asked a few poignant questions; essentially the chap was earning an absolute fortune (for 2002) at nearly £136,000 a year and he did nearly nothing, nothing.... he'd sat on projects, say on code, couldn't script, couldn't program, couldn't even communicate properly. Quite how he'd got into the role I will never know.</div><div style="text-align: justify;"><br /></div></span></div><div style="text-align: justify;"><span style="font-family: verdana;">I however simply kindly declined, I was due to go to Egypt on Holiday so I did that rather then try and fix that guys mess.</span></div>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0tag:blogger.com,1999:blog-2718170321131838315.post-36224019071518782732023-01-18T21:59:00.001+00:002023-01-18T21:59:37.046+00:00ChatGPT Poetry<div style="text-align: justify;"><span style="font-family: verdana;">I've had a play with ChatGPT, completely away from asking it to write or improve code snippets I asked it to generate some poetry...</span></div><span style="font-family: verdana;"><div style="text-align: justify;"><br /></div></span><div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">Could you tell me a poem in the style of Wilfred Owen but about Strawberries and Skunks?</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana;">And here's the reply....</span></div><div style="text-align: justify;"><span style="font-family: verdana;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">The strawberry fields, so red and sweet,</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">Are guarded by the skunk, so discreet.</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">He sprays his scent with such disdain,</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">To keep the birds and beasts at bay.</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">But man, with greed in heart and mind,</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">Does not let the skunk's defense bind.</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">He steals the fruit, so plump and ripe,</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">And leaves the skunk with nought but spite.</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">But in the end, the skunk prevails,</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">For though the berries may be hailed,</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">The smell of skunk, it lingers still,</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">And serves to remind us of our ill.</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;"><br /></span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">So let us honor the skunk's defense,</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">And give the strawberries their due recompense.</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">For in this balance, all is fair,</span></div><div style="text-align: justify;"><span style="font-family: verdana; font-size: medium;">And all may share the bountiful air.</span></div></div>Xeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.com0