Posts

Showing posts with the label Windows

Cross Compiling Clarity

I have an important distinction to make clear... Cross Compiling is using a machine with a different processor type than the target machine for your program. So, you have a PC with an Intel Core 2 Duo in it, and you use a compiler to output an ARM executable, that is cross compiling. If you're on an Intel Core Duo toting 15" MacBook pro (from 2006 ) and you use that to produce the same ARM executable, that's still cross-compiling.  BUT if you use that MacBook to generate a windows executable it's not cross compiling, as the processor is the same in both targets, you're not crossing over... Some folks argue this differently, because you're crossing between the Windows and Apple OS's you're cross-compiling.  In my book, and by the definition given elsewhere, you're not, in this case you are cross-platform (the platform being the OS) but you're not cross compiling because the processors are the same family. That's all, I just wanted this out t...

Microsoft's Noexcept Code Throws Exceptions

Image
I've not dug into this one fully yet, I'm mid-stride on what's going on, however the stack has unspooled me to this location having thrown a read access violation... But can you see the problem here?  I'm in Microsoft's xstring, as far as I'm concerned this is from my using std::string or std::ostringstream, the function is decorated "noexcept" yet its throwing an exception! I find this mind bendingly annoying, not least as under GCC & clan on Linux it runs perfectly fine! So, this is "Unhandled exception thrown: read access violation" in xstring _Equal which is decorated noexcept... Time to format c: and never use Windows I think.

Sex, Secret or God... Passwords

Image
In the 1990's it was common to have to tell folks not to use "popular" password, like "sex", or "god", believe it or not even "password" and "secret".  Since then times have moved on, folks have become very adept at using other characters in their passwords... Unfortunately, this is (very seriously) what one of our IT bods here has just found on a machine: Props to the user for mixing in some numbers, a word and a symbol, however... We can all see the flaw in their storing the password. (Thanks to our IT Manager for letting me use his picture - it is a lovely left hand, I wonder if he does hand modelling?)

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

Windows Defrag v KingDian SSD... FAIL

Image
I'm sure you all already know this one, and many vendor specific implementations of SSD drivers/applications prevent this... Not me though. Yes, I have a dirty cheap (£27) SSD from KingDian in my Laptop... Wait, wait wait, stop abusing me!  This is just a boot disk to hold a local OS and some scratch space, all my storage is provided to this machine over NFS. The trouble?  Well, in the late summer the wife and I had a few days away in deepest darkest Wales... Now this was a disconnected break, however, I couldn't resist taking the laptop loaded down with a few DVD based games and a steam download or two, plus I got to take some system code with me and a slew of PDF's I could read... I got a lot of work done, even without Linux (yes I had to flatten the machine back to Windows 7). And I pretty much put the machine away until just before Christmas, I then needed it again, so flipped it out the cabinet and fired it up, only to immediately find the battery was dead... It had be...

C/C++ Stop Miss using inline.... PLEASE!

Image
This is a plea, from the bottom of my rotten black heart, please... Please... PLEASE stop miss using the inline directive in your C and C++. Now, I can't blame you for this, I remember back in the 90's being actually taught (at degree level) "use inline to make a function faster", and this old lie still bites today. inline does not make your function faster, it simply forces the compiler to insert "inline" another copy of the same code whenever you call it, so this code: #include <iostream> inline void Hello() {     std::cout << "Hello"; } int main () {     Hello();     Hello();     Hello(); } Turns into the effective output code of: int main () {     std::cout << "Hello";     std::cout << "Hello";     std::cout << "Hello"; } What does this mean in practice?  Well, you saves yourself a JMP into the function, and the position on the stack holding the return address, and the RET from t...

Server Admin : How Good is your Backup?

Image
How robust is your back up solution?  Go on, be honest with yourself, how good is it?... Because I've seen a whole host of them and, at this very moment, this is the screen up on one of my servers.... Yes, my raid 5, just a test raid 5 with three really bad recycled SAS drives in it has failed; this doesn't surprise me, but it does delay me because I now have to rebuild the data... However, I know my data is good.... Lets see how good my back up is. This back up is coming from a DD created raw image of the virtual disk, stored to and soon lifted from my NFS accessible ZFS mirrored back up server. Therefore you would be right to ask, why are you rebuilding the virtual RAID disk in the above screen shot?  Well, I'm going to test my back up strategy! I popped the known bad disk and the good disks out, replaced all three and I'm able to test a restore to a new virtual disk set, I have a USB boot drive ready, this is a test. This kind of test, a real live restore, is sorely ...