uniqueidentifier

hibernate generator won't insert with uniqueidentifier

I'm trying to map an entity using Hibernate Annotations, so that when a record is created and saved (via cascade), an ID is automatically generated. With my current setup (or a few others I've tried) I get the following error: ...org.hibernate.exception.ConstraintViolationException: could not insert: [com.gorkwobbler.shadowrun.karm...

18 Digit Unique ID - Code reliability

I want a number that would be unique forever, I came up with the following code, it generates a number and adds a check digit to the end of it, I would like to know how reliable is this code? public void GenerateUniqueNumber(out string ValidUniqueNumber) { string GeneratedUniqueNumber = ""; // Default implementation of...

__COUNTER__ equivalent on Xcode?

Hi! I am migrating a project from Linux to Xcode and I encountered a "version" problem.. I need a unique identifier at compile time for my dynamic stuff, on linux I was using the __ COUNTER__ preprocessor, but it seems that the gcc 4.2 used in Xcode doesn't know about __ COUNTER__ yet... So, I was wondering what I could do to solve th...

Failing to convert string to uniqueidentifier in C# via a SQL Parameter...

I have a table with a PK column of type uniqueidentifier. I am trying to write an update statement from C#, where I have the identifier as a string. Here is the code I am trying: string sql_start = "update SecurityUserGroup set "; int paramPos = 0; var paramList = new List<SqlParameter>(); if (roleName !=...

How many unique ids could MongoDB generate for a single server?

Hi! I'm rather confused right now about exactly how many unique ids MongoDB could generate for a single server. Of course, with multiple servers the server section of their id object would change too, but with a single server the only parts that would change seem to be the pid section (2 digits) and the incrementing section (4 digits). ...

How are uniqueidentifiers calculated?

I was curious as to how SQL Server calculates uniqueidentifiers. I understand that uniqueidentifiers, are GUIDs but are these calculated based on system time? Or are they calculated based on the name of job/script that has called the NEWID() function. I found this but i found this reference to be unclear. ...

Unique and readable ID for each computer.

I need to do some tests, and make DB out of the testing result. After I'm done with that, I send the DB to server to merge it into some host DB. For that purpose, I want to have a UNIQUE ID for each computer that I run on. I thought about the GUID, but I'd like to avoid that option if possible. I prefer to have something that I can rea...

is it possible to get a unique identification number from a mobile device?

I am currently working on mobile device web applications, and I was wondering if there is some sort of unique id number per device that could be detected via the browser. The purpose would be to store this number in order to recognize people who already visited the site. I was working with bluetooth quite a lot, and there some sort of ...

How to obtain the android_id of a device?

In the licensing documentation the android developers mention an easy way to more or less securely identify an android device. They are using android.Settings.Secure.ANDROID_ID. They say they query the system settings for this. But they don't explain this any further. How do I obtain the android_id and do I need special permissions fo...

Programmatically display iPhone/iPad UDID

I have an iPad app in which I get the device's UDID by the following code in the viewDidLoad method. uid = [[UIDevice currentDevice] uniqueIdentifier]; uid = [uid stringByReplacingOccurrencesOfString:@"-" withString:@""]; I wanted to remove the dashes in the string. Later, in another method call, I try to access this uid string (whic...

How can one get the appwidget's own ID?

I am trying to debug a problem where my widget becomes invalid and a new one fills in. This only happens once at the beginning of time and then it remains the second widget forever. So, I want to put code in to narrow down the point in time when it happens. What I would like to do it something like this: e.g., (not real code) Log.d(T...

SQL Server Unique Identitifier vs Integer

Hi all, I've been learning ASP.net, and been using the membership system. When it auto generated the tables, I was quite suprised to see it uses a field type called 'uniqueIdentifier' as a primary key, when for many years I have been using an integer field set to be an identity that auto increments. What is the difference (if any at a...

Getting hardware information using java/jna to work on all operating systems

Hi I am trying to write a java applet that will get some hard ware info, mac address(which I have done), cpuid motherboard serial number and hard drive serial number. I know I need to use jna to do this. My question is, is there a way in c/c++ to get that information that is not platform dependent? Everything i have seen would work only ...

Locally unique identifier

Question: When you have a .NET GUID for inserting in a database, it's structure is like this: 60 bits of timestamp, 48 bits of computer identifier, 14 bits of uniquifier, and 6 bits are fixed, ---- 128 bits total Now I have problem with a GUID, because it's a 128 bit number, and some of the DBs I'm using only support 64 bit numbers...

How to generate unique 64 bits integers from Python?

I need to generate unique 64 bits integers from Python. I've checked out the UUID module. But the UUID it generates are 128 bits integers. So that wouldn't work. Do you know of any way to generate 64 bits unique integers within Python? Thanks. ...

How do you "concatenate" two 32 bits int to get a 64 bits long in Python?

I want to generate 64 bits long int to serve as unique ID's for documents. One idea is to combine the user's ID, which is a 32 bit int, with the Unix timestamp, which is another 32 bits int, to form an unique 64 bits long integer. A scaled-down example would be: Combine two 4-bit numbers 0010 and 0101 to form the 8-bit number 00100101...

Unique computer ID hardware based in Java

Hello all. I need to generate a unique code from a single PC, my software will be distribute by licence, and locally I need to identify the environment and send this code to the server. I don't want to mantain on the server a sequencial number and each client recieve a number of the sequence, i tried to read the MAC adress from NetworkIn...

SQL Server - Create auto-incrementing unique key

Is there a way in SQL Server to create a table with a primary key that auto-increments itself? I've been looking at the "UniqueIdentifier" type, but this doesn't seem to do what I expect. Currently, I have something like this: CREATE TABLE [dbo].[MyTable]( [Date] [datetime] NOT NULL, [MyField1] [nchar](50) NOT NULL, [M...

Using the title of a posting as a unique identifier [Ruby/Rails]

Hi gang! I need to store a range of unique strings. For each unique string, i need to store this in the DB: ["Unique title/unique description"] -> [3][pointer_to_posting 1, pointer_to_posting 2, to_posting 3] I have a model for the posting, but i do not have a model for [unique title]. All I want to do is to store a list of questions...

Generating ID unique to a particular computer

Possible Duplicate: Reliable way of generating unique hardware ID Am trying to generate an ID that will be unique to a particular computer. The ID will not be generated randomly. It will be calculation based, such that the ID generated for computer A will be fixed and unique to computer A. Everytime the program is executed on ...