uniqueidentifier
Unique Identifier of a Mac?
Apple has a technote on uniquely identifying a mac. Here’s a loosely modified version of the code Apple has posted in that technote… don’t forget to link your project against IOKit.framework in order to build this: #import <IOKit/IOKitLib.h> – (NSString *)serialNumber { io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching(“IOPlatformExpertDevice”)); CFStringRef serialNumberAsCFString = NULL; if (platformExpert) { serialNumberAsCFString … Read more
How to obtain (almost) unique system identifier in a cross platform way?
To generate a mostly unique machine id, you can get a few serial numbers from various pieces of hardware on the system. Most processors will have a CPU serial number, the hard disks each have a number, and each network card will have a unique MAC address. You can get these and build a fingerprint … Read more
How to generate and manually insert a uniqueidentifier in SQL Server?
ApplicationId must be of type UniqueIdentifier. Your code works fine if you do: DECLARE @TTEST TABLE ( TEST UNIQUEIDENTIFIER ) DECLARE @UNIQUEX UNIQUEIDENTIFIER SET @UNIQUEX = NEWID(); INSERT INTO @TTEST (TEST) VALUES (@UNIQUEX); SELECT * FROM @TTEST Therefore I would say it is safe to assume that ApplicationId is not the correct data type.
Convert NULL to empty string – Conversion failed when converting from a character string to uniqueidentifier
SELECT Id ‘PatientId’, ISNULL(CONVERT(varchar(50),ParentId),”) ‘ParentId’ FROM Patients ISNULL always tries to return a result that has the same data type as the type of its first argument. So, if you want the result to be a string (varchar), you’d best make sure that’s the type of the first argument. COALESCE is usually a better function … Read more
is it possible to get a unique identification number from a mobile device?
Well after further research, the answer is: No, it’s not possible right now to get a mobile device id number from its browser… A solution I found is to generate a “unique” number (in my case I worked with php, so I used the session_id() number mixed with a number generated with the rand() function, … Read more
Reliable way of generating unique hardware ID
It seems to me that you should construct the unique ID corresponding to your requirements. This ID can be constructed as a hash (like MD5, SHA1 or SHA512) from the information which is important for you (some information about software and hardware component). You can make your solution more secure if you sign such hash … Read more
INT vs Unique-Identifier for ID field in database
GUIDs are problematic as clustered keys because of the high randomness. This issue was addressed by Paul Randal in the last Technet Magazine Q&A column: I’d like to use a GUID as the clustered index key, but the others are arguing that it can lead to performance issues with indexes. Is this true and, if … Read more
Algorithm for generating a unique ID in C++?
Getting a unique 32-bit ID is intuitively simple: the next one. Works 4 billion times. Unique for 136 years if you need one a second. The devil is in the detail: what was the previous one? You need a reliable way to persist the last used value and an atomic way to update it. How … Read more
Programmatic Views how to set unique id’s?
Just want to add to Kaj’s answer, from API level 17, you can call View.generateViewId() then use the View.setId(int) method. In case you need it for targets lower than level 17, here is its internal implementation in View.java you can use directly in your project: private static final AtomicInteger sNextGeneratedId = new AtomicInteger(1); /** * … Read more