Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 27 Dec 2009
Offline Last Active Apr 10 2015 08:52 PM

#5174894 Is the BIOS Serial Number Always Set, Constant & Reliable

Posted by gretty on 19 August 2014 - 07:23 PM



I am thinking of using the users BIOS/Motherboard Serial Number to uniquely identify a user (the application runs on Windows OS). When I refer to the BIOS/Motherboard Serial Number I am referring to the serial number returned when you type in: wmic BIOS get SerialNumber


I have previously attempted to use the Hard Drive serial number to uniquely identify a user but WMI is notoriously unreliable. For example; if you are running your .exe as an elevated process you will get a different Hard Drive serial number back from WMI. Also as crazy as this sounds, I have had 2 different Windows 8 machines change their Hard Drive serial no. on me when the Hard Drives were not changed at all - I'm not crazy this really happened - I realise there's no better way for people to think you're crazy than saying 'I'm not crazy' but putting that aside - do you know if I will experience these same issues with the BIOS/Motherboard' Serial Number?


Some queries

  • Can the user change this serial number? Either using third party applications or through Windows.
  • According to this forum post, not all vendors supply a motherboard UUID so I cannot use this to uniquely identify the user. Do venders mostly/always supply/fill out the BIOS/Motherboard Serial Number or will I also find some computers dont have a serial number?
  • I have tried to uniquely identify a user using the Hard Drive's Serial Number. But I have run into the issue that the serial number can change and that Windows API is unreliable and can return different values. Do you know if I may experience the same issue for the BIOS/Motherboard's Serial Number?
  • Can a standard process (Standard Windows User) retrieve the BIOS/Motherboard Serial Number? Or does the process need to be elevated (Admin User)?
  • What would happen if the user has a virtual machine?

Just to confirm the BIOS is the motherboard, correct? I am a little unclear because I thought the BIOS is the simple software installed on the motherboard.


#5168087 Thinking in Javascript

Posted by gretty on 21 July 2014 - 12:43 AM

I tend to learn programming easier by thinking up something I want to achieve then attempting to code it (and asking questions about 'How to do...' along the way) rather than reading books and doing exercises. Thats how I learnt/am learning Javascript. But this may not be how you learn.


But if you do, I'd try to do something like 'Move a div from the left of the screen to the right' or 'Get some XML from a server'.


Javascript is really powerful because there isn't quite anything called a class, yet you can still achieve sub-classing, polymorphism and abstraction.


An example is:

var someVariable= {"key": "value"}; // this a map

someVariable["Anonymous Function"] = new function(someParams) {

// call anonymous function
someVariable["Anonymous Function"]("blah");

someVariable = [1, 2, 3]; // this is now an array

// I think you can do this also but may need to check
someVariable = {someProperty: 1.1};
console.log(someVariable.someProperty);  // almost treat the variable as a class with properties.

#5112008 Insert Image into SQLite3 Database: Unsure whats causing the error

Posted by gretty on 25 November 2013 - 07:49 PM

First of all, SQLite doesn't care whether your blob is a valid PNG image.

Second, please try to understand what you are doing.
"Someone advised me to use byte[] instead of a string or etc" is not a matter of opinion: the function you are trying to call is declared as int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)), you cannot pass what you want as a parameter.

Third, RTFM.
Why are you goofing around with DllImport instead of using the proper .Net wrapper (system.data.sqlite.org)? Code examples like http://stackoverflow.com/questions/625029/how-do-i-store-and-retrieve-a-blob-from-sqlite are easy to find.


You're pretty rude and thats putting it politely. Dont assume I haven't read the ******* manual because I have (I am aware of a much simpler way to achieve what I am trying to do, ie, use system.data.sqlite). I am using Unity3d where you cant use system.data.sqlite.org so you are forced to use the C API, this may have changed in the latest release of Unity3d though.


I'll accept that you (incorrectly) assumed my ignorance but I dont accept your aggressive condescending demeanour. You were never obliged to reply to my thread so there's no reason to be angry and I'm telling you, dont reply to my threads in the future.

#4879152 Extract the R, G, B values from a Flash decimal number

Posted by gretty on 31 October 2011 - 11:56 PM


I have colour values from a Flash application that are ARGB format(A being the alpha/transparency value).

I have to convert that long decimal number to a RGB/Hexadecimal number in Javascript. I REALLY struggle with bitwise operations. In Flash the colour white is represented by the decimal number: 16777215, black is obviously 0. Other colours are like: 84545883, 4803910 etc which I have no idea what colour they are.

Do you know how I can extract the individual R, G, B & A values from a long(8 digit) number?

Can you help me get these functions to extract the (R,G,B,A) values?

function getA( num )
   // eg value for num is 84545883
   return (parseInt(num,10)) & 0xFF000000;  // does this correctly get the A value from a ARGB value?

function getR( num )
   // eg value for num is 84545883
   return (parseInt(num,10)) & 0x00FF0000;  // does this correctly get the R value from a ARGB value?

function getG( num )
   // eg value for num is 84545883
   return (parseInt(num,10)) & 0x0000FF00;  // does this correctly get the G value from a ARGB value?