Showing posts with label issues. Show all posts
Showing posts with label issues. Show all posts

Saturday, 24 February 2018

WD Disk DOE & Dust....

I recently ordered a new WD Blue disk, it duly arrived and had the strangest problem I've seen in many a long year, no matter what I did the disk showed as 64MB total and it lost all data upon power cycling.

I puzzled over this briefly, until I pulled the disk back out the caddy and saw it had exactly 64MB of cache, yes, no platter space was being shown, just the cache showing up as disk space.  I have never ever seen this before, cache has always been a transparent intermediary for me in production and so to suddenly have the cache being the only exposed space was odd.

However, dead on arrival hard disk, a quick RMA and a new one winged its way into my hands, they actually gave me a slight upgrade as I got a WD Black by return of post.

Tonight I planned an hour to fit the new disk and add it to my workstation.... This machine has no cable management, and its a nightmare to add drives, there are six built in 3.5" bays but they have a set latch and screw mechanism, which forces you to fit the drives to that the power connectors are actually straining the distant power plugs. (I do plan to buy a pair of SATA power extenders on pay day).

What struck me as a massive problem however, is the amount of dust inside there.  Clearly, since fitting the 1080 GTX I've had something change or fail or open as there are copious amounts of dust in there.

Now my work area is not optimum for a workstation, I have a full tower case, so it has to go under the desk and the floor is carpeted.  Now this had been mitigated by the Coolmaster Cosmos 1000 case having lifting rails, taking the whole thing 1.25" off of the floor level, and two ground level filters, as well as a rear and front filter set.

But clearly things have not gone well, as just dust dust dust.

My original plan for the start of the year was to re-case the server, then re-case this PC as a server as well, retire one of the aging DELL 2950's for this machine itself, and put myself a new workstation together for my 40th.

Trouble is?... I'm skint, like proper skint, so I can't afford the workstation I was planning on...

And now I need to sort out this machine... I smell another re-casing task a head... Hmm, which case?  I'm thinking about the Corsair Obsidian range... Anyone have any other suggestions for a full height tower?... 1 x 5.25" at least 6 x 3.5" internal mount points and at least 2 x 2.5" mount points internally.  Front Panel USB would be a boon.

Dust seems to be my enemy.

Monday, 22 January 2018

C++ Simple Limits & Server Recase

Health & Myself
What a whirlwind few weeks I've had, first of all, I've had some minor medical work done so not really been in the mood to do anything very interesting except recuperate in my spare time.  I've also got on-going dental treatment going on, so I'm doubly aggravated.

Next I have been so busy with work, I've had a change of job title, I've been effectively promoted into the lead developer role for the platform/product range I work on; this is sort of a defacto position, as I'm the ONLY developer working in this area at present, however I'm now officially the man on point and am about to reform a new development team around it.  I will be working in Scrum methodology with this new team, we'll be pushing product to both Windows and Linux, Git will be our source control system (no matter what anyone else says) and I'm going to leverage C++ as the core product with tools all being produced in Python, very exciting stuff.

Server Issues
At home however, you may have seen this late night  problem....


I have not, as yet, tackled this problem in any satisfactory manner; there's just been too much going on.

However.... I have a plan, a plan so cunning you could put a tail on it and call it a fox.

I had a look around in the case, and removed the bad drive, here it is....


This is an old drive first of all, and it was only 3.0gb/s SATA, but it was useful as part of my mirror, and without it I'm now naked.  In my room/workspace tidy rambling video you will see I have a stack of WD blue drives on my desk, however I'm at pains to put them into this server, as the more space I give myself then the more data I have to move later, and the less places I have to stash that data.

What do I mean?... Well, that machine already has about 4TB of data in the two ZFS Pools and the one scratch drive, I do not have ANYWHERE else to put 4TB of data, and I can't afford a new drive, hence why I've carefully and strategically informed the wife I'm buying the off 1TB drive once in a while over the last year... Dropping a 4TB drive in the mix, she'll flip.

Recasing my Server & Workstation
So, my plan?


Well, first of all I have my main work station in a trusty, but now rather old, Coolmaster Cosmos 1000 case (you can see this case in some of the very early pages of this very blog)... Now, this is a very nice case, and has 10 internal 3.5" drive bays... So would be pretty nice for my server to move into, add all the new WD drives to it and voila a working server with expansion capabilities.... A recasing, that's a plan... Plus I get to perhaps look at that Xeon mod a year on and evaluate how it got along.... And of course more ZFS fun... Maybe a video about Git & setting up my own ticket handling system.


Right, that's the server... What about the now case-less workstation?

Well, I'm considering a new case, of course.  Front runners are the Corsair Obsidian 750D as it has modular upgrade ability, and if I like it, I can get another and expand the server into it next year.

Infiniband
A long-term project is to consider an Infiniband link between my server and my workstation, we'll see how this goes along, not only would I need to purchase some adapters and cables, but I would need to switch my workstation into a new dual-boot as only Linux would be on Infiniband (and as you may have noticed Windows was on the list of platforms for my new role specification).

C++
Simple limits in C++?.. What am I talking about, hmmm, well I just ran into some code:

auto value (0);
if ( requisitValue < defaultValue )
{
    value = requisitValue;
}
else
{
     value = defaultValue;
}

Nothing wrong with this you may argue, however the developer hadn't looked at the values they were working with, the defaultValue for this system locale was ALWAYS the highest value on a sliding scale, the configuration insisted the default be the cap and so any requisite value would be smaller.

I asked the chap to have a think about this code, having explained the requisit would always be lower than the default, and asked him to come up with any improvements.  He did....

auto value(
  (requisitValue < defaultValue) ? requisitValue : defaultValue);

I asked him to rationalise this change, why had he done it?


  • To meet the coding standard define of not assigning, but to initialise with a value
  • To make the code less lines of code
I have no disagreement with the first point, the second... Not so much....

I do not subscribe to needing code to be smaller (less lines of code) so long as it's readable, as for my work maintainability far out reaches using less lines of code.  Especially when the change made is exactly the the same resulting code, just the change is far harder to read.


(Don't miss-read this, I agree you should try to make functional code take less lines of code, but the above is white-space more than functional change, white-space on a modern compiler is NOT a problem, make your code readable before you start trying obfuscating functionality for fancy frills).

I stopped the developer in his tracks however, and asked him to pull up the document for the specification and describe "defaultValue"... "The maximum amount allowed in the value" he read.

So, changing the name of this value was the first step it became "MaximumValue".  Use a meaningful name.

And finally, if you really want this decision to be a single line of code, how about:

auto value(
    std::min<valueType>(
        requisiteValue,
        maximumValue));

Using the minimum function here, we make it clear we're doing a mathematical operation, it's a single line instruction (even if I do stagger it for readability over four), and we're not going to confusing the order of our parameters, so avoid introducing comparator ordering bugs later.

This is the simplest way to find a limit between two variables of the same type in C++, using std::min and std::max.  Learn about them and love them.

The reply the young man gave me... "But changing the name'll mean I have to change hundreds of different places in the code!".... "Yes, so use find & replace in files?".... "Oh but what about all the other "defaultValues?".... "Why are they not in namespaces, or classes, or using other names?"... Silence.

Friday, 15 April 2016

Windoze Security Loop Hole

This is an example of why I hate Windows...

In a curious case of a security loop hole, in the office, we have a supposedly locked down security situation, none of us are local administrators on our machines, and neither do we have access to any of the very useful parts of our machines.

This is a real pain, and one whereby we often have to call up on the IT Administrators to come and physically, or remotely in a remote desktop session, enter their password for us.

I personally disagree that educated users such as myself have to put up with this situation, I agree totally with data privacy and integrity, however, I wholly disagree with locking people out of things on their machines, such as defragging, or emptying the temporary folders... Or in the case of a programmer, not being able to empty Prefetch or write an ISO to an SD Card.

Anyway, today, I had to write an ISO to an sdcard, the result... I called IT and asked them to run the program for me....


So, just to be clear, I'm logged in as myself:


I am unable to access parts of the system, like the Administrators desktop folders...


I get IT to log the ISO image writer as their elevated user, and the loop-hole begins, you see the program has a standard windows open dialog.  And this will work with any standard windows open or save-as dialog, in any program... The program is running as Administrator at this point.

When I select to browse to the file to open, the default folder is the administrators folder by name...


However, because these dialogs all use explorer under the hood, and it's all integrated, they do far more than select a file for you, they let you create folders, browse things and even launch programs...

Yes you can launch a program from a save-sa, or open-sa, browsing dialog!


Lets try to run a command prompt...


Oh, look, it's running as Administrator...


And now I can see the Administrator account directories, which were hidden from be in my own logged on Explorer window..


And I can clear the prefetch folder in windows...


This is clearly wrong, but it's all caused by windows, so what's going on?...

Well, instead of asking the current session (logged in as regular old me) to start the new application instance of Command Prompt, it's asking the application owning the browsing dialog, so command prompt is started under and inherits the user credential level of that program, not my whole session.

What should have happened, well, I believe windows, starting a new program from an elevated user like this should have re-prompted for the user's password again.  And indeed, trying to start certain files from the launched command prompt it does go back to the session level to ask for the credentials to start the application with.  But not asking and just starting the new application is a problem.

Solutions I can think of include, setting the administrator level account to timeout its password every minute, so one reduces the amount of time a regular user has an unaccredited ability to launch programs.  And within a minute the administrator could have started anything the user wanted and left.

A better solution however, might have been to have a user elevation level which could give access only to what the regular user wanted, permissions to use peripherals perhaps, rather than start applications.  And the Administrator should not have just started the application as themselves, but should have started the application under themselves as the Hardware only user.

There are other solutions, and I'm sure many I'm not even going to think about, because I don't use Windows systems.  If I want security, I simply use Linux and set things up correctly.

Monday, 12 January 2015

My XML Library is Kapput

I've been using an XML library of my own devices, based around RapidXML for ages, it has been totally brilliant, utterly useful and completely thread & memory safe for about three years.

Yet today, the trusty dog that it is, has turned around and bit my hand, as I've found a bug, and I'm not sure where the bug comes in, whether in my code or from the underlying RapidXML.

My problem, I load a structure:

<Root>
    <a>0</a>
    <b>1</b>
</Root>

This is fine, however, these turn into my classed "XMLConstruct" and I have three of these:

XMLConstruct
   m_Name = "Root"
   m_Value = null
   m_Children[2]
       [0] = XMLConstruct
          m_Name = "a"
          m_Value = "0"
          m_Children = null
       [1] = XMLConstruct
          m_Name = "b"
          m_Value = "1"
          m_Children = null
          
This is fine, it works, I have my data... But every use previously I created a class "Root" from this, and used that classes "ToXML" function.

However, today I want to just open the XML and "for each node if m_name == 'a' set m_value = '999'".

Sounds simple... Nope, when I do this the XML output I get from the underlying Rapid XML is:

<Root>
   <a>
      <>999</>
   </a>
   <b>
      <>1</>
   </b>
</Root>

This is a mystery to me, I'm going to have to bottom it out, but it's that kind of problem on a Monday morning which annoys me.

More annoyingly, the C# implementation of the same library I'm using, does not do this... The difference between the C++ version and the C# version is the underlying XML library, so I'm suspecting something about the node allocation, or the node use inside Rapid XML being off...

Tuesday, 21 October 2014

WarThunder - Gaijin's Russian Bias Shows Doesn't It.

Last night I went for a few flights in various BF109's in WarThunder... It was an utter and total disaster, I didn't make a single air kill, and twice ended up getting bounced whilst in the middle of my dive on a target and having to try and flee.  And only once did my attempt to flee and calling for help get a return from my team mates... So my thanks to those chaps that time, you kicked arse...

However, after a couple of hours I had my BF109E-3, BF109F-1 & 2, BF109F-4 and BF109F-4/trop all in repairs... My frustration was palpable.

I reviewed my replays, I thought about what I was doing wrong, and I thought about my opponents... Some of them were just excellent pilots and out flew me, I accept that, however, I looking at the roster of opponents who had shot me down... La-5... La-5.... Hmmm... La-5..... I-185... There were a lot of higher battle rating (BR) opponents than my measily E-3 or F-2 (the two planes I flew repeatedly)...

Now I'm no fool, my aircraft handling though not perfect is okay and in Simulated Battle you expect an amount of luck, but my luck was running so bad.  I switched to Realistic Battle, maybe I could identify what I was doing wrong by seeing the target tags coming towards me...

I could not see any tags... I don't know if this is a feature now, or something about skills, or just a bug... But I had to close to within 1km of a target dot before I got to see its label text... and when friendlies were tangling with enemy planes I saw the blue of the friendly from miles, but never saw the enemy... Tracers and flame and death, I saw plenty of, but actual aircraft/player legend text, not a jot of it...

So at one point I'm in the F-4, and I'm 800 meters above a pair of La-5's... I know I'm going to die, so I invert, pull through a half loop, and when out of the loop I'm the right way up going to opposite direction at about 550km/h... And I accelerate away, I'm going maybe 580km/h, and I reckon I'm around 10km away from where I saw the targets, I'm low on ammo anyway, and 7 minutes of fuel, so I report heading to base.

I check my shoulder, just as a stream of red tracer goes past... both La-5's are right there... they've climbed 750ish meters and caught up over 10km from behind a plane going away from them at over 550km/h... I dive away from them and am going 715km/h, opening the distance between us... But their fire is hell accurate, I can see the separation on the mini-map its over 800 meters between us, but they're still shooting...

These are La-5's... with twin 20mm cannon, their cannon should be dry>?!>?! What the hell... I lead them off and over the airfield, they break off only when the AA has holed one... but as I break into a rising climb turning my now 600km/h speed into about 900 meters of altitude and levelling off to assess my situation, the other LA-5 does what can only be described as a UFO move, it rolls and almost flat spins around and comes back at me, acceleration was incredible, the aircraft was level with me, having used his speed to climb... and he's flying straight and level.... over 8km... be cross the airfield and forced me into a split-S to avoid his head on in what felt like 10 seconds... I literally had no come-back.

When we read historical accounts of the performance of the La-5 it does not stand up to the scrutiny of its performance in game, I get that Gaijin have their own ideals of history, they say as much in one of their news posts:

"the British have their own history and their own view on the Second World War and we, the descendants of our Soviet heroes had our own war and own memories of it" - WarThunder Blog.

You don't have memories young sir, you are not over 80 years old and were of an age to have served, your parents at a push, or your grandparents certainly may have, but you do not have memories.  What you have are recollections, those rosey tinted, glossy postcard photograph ideas of what it was like.  And I can only really stress that in my opinion the balance of plane performance, especially Russian plane performance, is rather more rosey than it should be according to the history at hand.

"the La-5FN excelled at altitudes below 3,000 m (9,843 ft) but suffered from short range and flight time of only 40 minutes at cruise engine power. All of the engine controls (throttle, mixture, propeller pitch, radiator and cowl flaps, and supercharger gearbox) had separate levers which served to distract the pilot during combat to make constant adjustments or risk suboptimal performance. For example, rapid acceleration required moving no less than six levers. In contrast, contemporary German aircraft, especially the BMW 801 radial-engined variants of the Focke-Wulf Fw 190 front line fighter, had largely automatic engine controls with the pilot operating a single lever and electromechanical devices, like the Kommandogerät pioneering engine computer on the radial-engined Fw 190s, making the appropriate adjustments. Due to airflow limitations, the engine boost system (Forsazh) could not be used above 2,000 m (6,562 ft). Stability in all axes was generally good. The authority of the ailerons was deemed exceptional but the rudder was insufficiently powerful at lower speeds. At speeds in excess of 600 km/h (370 mph), the forces on control surfaces became excessive. Horizontal turn time at 1,000 m (3,281 ft) and maximum engine power was 25 seconds." - 

Or perhaps
"In comparison with the Bf 109 the La-5FN possessed a slightly higher roll rate, however the Bf-109 was slightly faster and had the advantages of a smaller turn radius and higher rate of climb." - Hans-Werner Lerche (ISBN 0531037118)

Even ignoring the performance issues, why was my BF109F4 being pitted against La-5's?... The F series of 109 was ubiquitous yes, but in 1942 when the F4 was really at its height the La-5 was still under development:

"from the first tests, which began toward the end of March 1942, it became clear that the new variant was a marked improvement over the basic model" - about the LA-5 from www.century-of-flight.net.

The timeline does not work out, the La-5 should not have been present to shoot me down perhaps?... But its UFO like performance is clearly not warranted from the history.

I know already what Gaijin's response would be, if they dained to give one, and that would be that this is a BETA, and that things can change, but I believe for too long and too many comparisons; which I have been through; the Russians get the better of it over the Americans, the Americans get the better of over the Japanese and the Germans generally struggle to compete save when we get to the very highest tiers.

The BF109F series under-perform, the accepted best aerobatically able 109's and they're pitted against floating Russian crates which historically were not overly available*, the BF109G series are often forced to fight off of their comfort zone, i.e. the BF109G-6 designed to intercept bombers is pushed into dogfights with other fighters, where its climb/weight disadvantage soon tell...

To then rub salt into already open wounds I flew out in a Russian plane, in simulated mode, for the first time ever, took the Yak-7 which was completely stock out for a fly out... Immediately entered a low-level dogfight and in both the horizontal and vertical could out turn and out perform German BF109F1's and an FW190A-1... And got two kills!.... I gave up playing for the night right there, disgusted how easy the kills were, when ammunition, aiming and the general low-tech of the Yak-7, a trainer pushed back into front-line service, bested some of the finest fighter aircraft the Luftwaffe fielded.



* Losses of La-5's in 1942 dropped dramatically, this wasn't because the La-5's were doing well, but that so few La-5 were produced that there were none-left for the jagdflieger to shoot down, only in 1943 as production ramped back up did losses increase in relation ship to the number of available aircraft.  This is the kind of history ignored by Gaijin and their apparent blanket rosey tinted view of history.