Posts

Showing posts from February, 2018

"Zeiger" The Missing C Type Link

I'm just looking at an old C Compiler, the first C compiler I ever used, actually... And, I'll be honest, I didn't live with C long, I moved into C++ pretty quickly.  So much so, I never actually read the this C Compiler's Documentation, here for posterity, is an exert... Pre-defined Data Types ----------------------       Type        sizeof      Bits            Range       ----        ------      ----            -----   unsigned char      1          8             0 to 255   char               1          8          -128 to 127   enum               2         16        -32768 to 32767   unsigned short     2         16             0 to 65535   short              2         16        -32768 to 32767   unsigned int       2         16             0 to 65535   int                2         16        -32768 to 32767   unsigned long      4         32             0 to 4294967295   long               4         32   -2147483648 to 2147483647   <pointer>          4         32  

C++14 std::memset Not Working?

When I say not working, I do not mean the function does not work, of course it works.  What I mean is that left to it's on devices the GCC compiler can actually chose to not perform a memset in certain circumstances, you can read more detail about this in the official bug list . So, what's going on?  Well, I have a piece of code which uses a common buffer, each function locks a mutex (std::lock_guard), fills out the buffer and then transmits over USB to target devices, crucially I then want to clear the common buffer. The purpose of this architecture is to keep sensitive information being transmitted through the buffer present for as little time as possible (i.e. the time between filling out and transmit, ~35ms) rather than filling out, transmitting and leaving the data in the buffer; as the time between calls may be anything up to 5 seconds, plenty of time for someone to halt the program and inspect memory dispositions. In pseudo code therefore our sequence looks something lik

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

Windows : Com File Effect

Image
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 filenam

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 ta

Healthier Lunch #1

Image
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.....

Home Server - New Case (Coolmaster N300)

Image
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.

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 M