Tuesday, 13 February 2018

Windows : Com File Effect

I'll never claim to know everything about Linux nor Windows, I know a lot more about the former than the latter, mainly as the Windows is a closed source product.  As such it doesn't get my attention as much, unless something is going wrong.... Today I have found an effect I can't explain (at least not easily) in windows, clearly it's some sort of reserved file name or type effect.... Maybe you can explain this to me.

So, open any folder, right click and go to create a new text file...

Once you have the file...

Change the name to "COM" and a port number, so "COM1" in my case.... It can be any COM port name, even if you don't have that port installed or active on your machine....

Once you complete the name, or change focus of the text entry (by say taking a screen shot - not actually committing the new file to disk) you get this strange message...

"The Specified device name is invalid"....

What device?  I'm trying to create a filename.  I was immediately a little puzzled, I've used Windows since Windows 2.0  I've never ran into this issue.

Googling around I find a chap on social.technet.microsoft.com saying not to use a whole plethora of names for files or folder as they're reserved, I have never heard of this.

The official Microsoft advice likewise says not to use these values, and it kindled a memory in me from programming in DOS 6 back in the mid 90's, one would in Pascal, you could "println(PRN, 'some message');" and see the message print out on the printer.

I find it amazingly odd that these files are still reserved in 2018, they're proper nouns, they're things you may want to name files, and they have a FULL Path, which makes them very distinct than the COM port device.  Its odd, trust me.

But the oddest thing is, what does Windows do, what is the piece of code picked up and made to run that message box upon creation of the file?  And I've got to wonder how exploitable that maybe in local malware to open lots of message boxes and annoy the user.

Monday, 5 February 2018

Menstruation is Normal, in 1989 everyone knew, yet not today?

I'm going to come back to this again... In 1989, in a dusty second floor science room at what was Top Valley Comprehensive School I sat down with my then classmates and we had our first sex-education lesson.  Mr Simpson the (unfortunately) body odour riddled and forever exacerbated physics teacher had to teach us young folk about masturbation and menstruation, and ultimately where babies arrive from.

Not one picture of a stalk was had, not one allusion to fact, not one sugar coating, we had a video of (admittedly a cartoon of) a boy holding his penis and the narrator saying it's okay for this to feel good.  We had a young lady (again a cartoon) fondle herself and we were again told this was normal, we were shown putting condoms onto bananas to everyone's mirth as we'd mostly all seen and even used condoms before... This is Top Valley Estate bruv.

And the last part of this talk was about periods.  We were all told all girls start to have periods, it is normal, we were taught about pads, tampons and even moon cups.  We were told, point blank, about how much menstrual blood a girl should expect; and I remember a fair few of my female class mates blankly stating they would say that a vastly conservative estimate.

THIS IS 1989...

Let me make that clear, nineteen eighty-nine.

So, why the hell are articles like this appearing in 2018?

I am utterly baffled and confused by this... Was my school vastly a head of its time?  I don't think we were, we were a daggy comprehensive intended to turn our plasterers, car mechanics and dust-bin men.  It was not an Engineering specialist (read that as "turning out car mechanics") as it is now as an rebuilt academy.

What on Earth has happened in this time?

What has the Department of Education been up to?  How can I go back and check the 1989 Personal and Social education syllabus I was enrolled upon against today's?  Because I remember this episode.

I remember it as it made me vaguely uncomfortable, a period was something my mother had, with her big box of giant canoe like panty liners.  The pretty girls in class with me, they didn't have them, "old women" had them.  It was a genuine surprise, and it is one of the few times during my secondary education where I remember being taught something.

So why are kids today not being taught the same thing?  Again, why this retrograde step?

Healthier Lunch #1

I've been trying to eat more healthily at my desk... Here's the "healthier" option....

Oat So Simple?  More like Owt So Wall-Paper Paste.....

Saturday, 3 February 2018

Home Server - New Case (Coolmaster N300)

The new home server build starts with the case, I've elected to go with my wallet, and this means the cheapests ATX case with the mode drive bays...

The Coolmaster N300 comes in at just over £38 and sports an impressive 8 internal 3.5" drives.

Thursday, 1 February 2018

Intel Home Server CPU

You're all aware (I hope) of my stack of servers under the desk, however, the main server I use is actually a re-purposed desktop - it's the G33 chipset Socket 775 to Socket 771 running a Xeon E5420...

And I have my plan forming to re-case my main workstation, however, I wondered... As I'm currently very exposed with data not replicated across drives on my little server and the machine being quite high power, whether I might not do better in the short term of recasing both... AND changing the server to an always on box.

This way, I could build a machine around a dedicated new board and chip... I started out with the AMD APU's the 2580 and some others, up to a quad core, and as fabulous as they look on cost they didn't float my boat.

I don't need a lot of number crunching power on the server, so what was my concern?  Well, I'm an Intel guy... Always have been, and think I always will be.  Obviously I started with MOS processors, then moved into the world of Motorolla, but since 1994 I've steadfastly bought and used Intel.

Why? Well, I remember the original AMD offerings, they were copies, and hard to find in the UK market without knocking the quality of other items in your build, so I stuck with off the shelf Intels.

I then build my own Pentium II and III computers, I also found use for Celerons - I've never had anything against them - I had a Pentium IV Prescott when they were literally brand new, then I've had the Core i7 950, plus all the Xeon servers and modding fun.

At work I've always been supplied Intel too...

What options does the market offer in the Intel world?.... Well I spotted the dual core, dual thread Celeron G9300.... Which looks just the ticket for me, it's pretty low power (53W compared to the Xeon E5420 at 80W), it can address more RAM, so giving me expansion options and it had decent reviews.  The trick is to not expect a lot from it, and to actually put it to a good use.  If that use is as an SSH point into my network, a git server, NFS host and squid box, then that might work quite well.

I've therefore drafted a build, you can see it here.... 

If nothing else that case, might be a perfect buy, to get the ball rolling, and guess what!... Tomorrow is pay day.

Wednesday, 31 January 2018

C++ boost::replace_all Slowed Me

I've just had myself into a complete frazzle, code yesterday was fast, rendering 120fps, the same code today was struggling to pass 11fps.  And it had me pulling my hair out, of which I have little left to spare.

The problem?

I had been processing strings for specific patterns and only replacing them, so a variable in my engine might have the value "SCORE" and it'd replace the players score value directly into the std::string instance for display.

I however decided I wanted to compound all these reserved words to allow any value to contain any replaced value and also contain formatting, so I could so something like "You have scored %SCORE% today" and it'd just place the number in place.

I turned to boost for this, boost::replace_all, to be specific, and I had about 45 pattern matches which would try to replace any instance of the string in place.

However, this function does not look a head if the predicate is present in the source string, it's in fact very slow.

So code:

const std::string l_Pattern("%SCORE%");
std::string l_Source("You have scored %SCORE% today");

Would result in very slow performance, my solution is not perform the replace... search for the pattern predicate first:

if ( l_Scource.find(l_Pattern) != std::string::npos )

This latter code runs so much more quickly, I'm far in a way back a head of the speed curve, but I have this lovely dynamic placing of the variables into my rendering controls, and any control can receive any value just by my tweaking the loaded display script, so neat....

Anyway, I hope that helps.  If you want to help me, pop over to my YouTube channel and hit that subscribe button.

Thursday, 25 January 2018

When Software Tries to be Cute

Developers of the world, unite, and stop listening to sales-folks who say that variety is the spice of life, that you need to make your programs do cute things, like vary the replies it gives.  You are only causing yourself more trouble testing, debugging and annoying your users.

Users of the world, unite, and stop wanting stupid cute differentiation replies from programs to make you feel special.  You are not special, you are one of very many using the same program, be like normal people and expect the action of something to have the general same reaction so you can see when things go wrong.

I bring this up, as I recently had the Ultimate Ears Blast App, and it was too busy being cute with "just a moment", "hang on in there", "be right with you" bullshit replies to actually work!  Yes, it looked to me they were trying too hard to be hip that actually hit the mark!

And YouTube has just done the same thing, check this out....

Same machine, same time, same browser, same YouTube account target... Two different replies... Just to be cute, and one is broken!... GG YouTube, GG Google...

Oh, and has anyone actually ever worked in the YouTube website?... It's a nightmare to navigate, with things hidden and changed, as a content creator, you go to try and get your own home channel, it's a nightmare, you have to view the whole site, select "Library" and then "Home"... You used to be able to press one thing "My Channel/My YouTube", so simple?  Why change it?.... To be evil of course.