uniqueidentifier

SQL Server database with clustered GUID PKs - switch clustered index or switch to sequential (comb) GUIDs?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 02:34:59
问题 We have a database in which all the PKs are GUIDs, and most of the PKs are also the clustered index for the table. We know that this is bad (due to the random nature of GUIDs). So, it seems there are basically two options here (short of throwing out GUIDs as PKs altogether, which we cannot do (at least not at this time)). We could change the GUID generation algorithm to e.g. the one that NHibernate uses, as detailed in this post, or we could, for the tables that are under the heaviest use,

iPhone UUID change when App Updated?

旧街凉风 提交于 2019-12-05 16:53:48
I use iphone UUID for checking user's device is unique. I already know UUID will be changed when reinstall app. But, I have a question. Then, when app updated, UUID for my app will be changed? If UUID changed when app updated, where can I save UUID in iphone permanently(or same effect)? Save out your created UUID into user preferences for the app, which should be backed up - if they restore the app from a backup you'll get back the UUID. If you want to be even more sure you can get back the same UUID, save the generated UUID into the keychain - the keychain is kept intact even after you delete

Backbone/Underscore uniqueId() Odd Numbers

筅森魡賤 提交于 2019-12-05 14:30:29
I'm relatively new to Backbone and Underscore and have one of those questions that's not really an issue - just bugging me out of curiosity. I built a very simple app that allows you to add and remove models within a collection and renders them in the browser. It also has the ability to console.log the collection (so I can see my collection). Here's the weird thing: the ID's being generated are 1,3,5... and so on. Is there a reason specific to my code, or something to do with BB/US? Here's a working Fiddle: http://jsfiddle.net/ptagp/ And the code: App = (function(){ var AppModel = Backbone

RFID algorithm to get card ID

眉间皱痕 提交于 2019-12-05 11:04:34
I receive bytes from an RFID reader when presenting a card, but I'm unable to figure out how to derive the card ID from these bytes. For example, I have a card that has these numbers printed on it: 0007625328 116,23152 . I would expect that this is the ID of that card, right? For this card, I get the following bytes from the reader (in hexadecimal representation): <42><09><01><74><00><74><5A><70> . The decimal number 0007625328 translates to 0x00745A70 in hexadecimal representation. The number 116,23152 is actually a different representation of that same value (0007625328): 116 in decimal is

Concatenate two 32 bit int to get a 64 bit long in Python

耗尽温柔 提交于 2019-12-05 06:25:55
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 . Does this scheme make sense? If it does, how do I do the "concatenation" of numbers in Python? sykora Left shift the first number by the number of bits in the second number, then add (or bitwise OR - replace + with | in the following examples) the second number

Retrieve the uniqueidentifier key value for a record

℡╲_俬逩灬. 提交于 2019-12-05 02:07:50
问题 in context of SQL Server 2005, I have a table for which the primary key is a uniqueidentifier (GUID), with a default value generated by the newid() function. I want to write a stored procedure that inserts a new record into the table. How do I get the record's PK value? for an identity-declared field, this is easy - I call scope_identity(). How should I proceed with guids? Thanks, Lucian 回答1: I would generate a new Guid prior to inserting the record, and explicitly use this new Guid as the PK

Algorithm to generate unique (possibly auto incremented) ids

烂漫一生 提交于 2019-12-04 20:01:43
I need to generate unique ids for my application and I am looking for suitable algorithms. I would prefer something like this -- YYYY + MM + DD + HH + MM + SS + <random salt> + <something derived from the preceding values> F.ex. - 20100128184544ewbhk4h3b45fdg544 I was thinking about using SHA-256 or something but the resultant string should not be too long. I could use UUID but again, they are too long and they are guaranteed to be unique on only one machine. I would welcome suggestions, ideas. My programming language is Java. Edit: The ids need not be cryptographically secure. I am looking at

ways for a client to identify the specific access point it is connected to within a single SSID?

混江龙づ霸主 提交于 2019-12-04 19:37:37
The problem is as follows - there's a university campus wide wifi connection with a single SSID, say "campus-wifi". The user freely roams around campus, and the usual hand-off between access points occurs. My question is, is there any information at any layer of the network stack that allows the client to identify (any unique identifier is fine) the specific access point they're connected to, rather than simply the fact that they are connected to "campus-wifi"? If it's relevant, I'd like to be able to do this from mobile devices (android/iOS primarily). You can get the BSSID of the access

What are the common solutions for making clean id space in a SPA?

岁酱吖の 提交于 2019-12-04 18:03:56
问题 Situation: several developers working remotely on different section/modules of a SPA. As a result they may accidentally introduce HTML elements with the same id . What are the common ways to avoid that situation (without refusing id-usage if possible) before final assemblage? My shallow guesses: pre-arrange id for all names(a bit ridiculous but...) structure names with architecture e.g. for an app/collection/model dedicate a name like app-collection-model refuse using id s in general or use

Thread.getId() global uniqueness question

故事扮演 提交于 2019-12-04 18:03:46
问题 If multiple Java applications are running on a system, is each Thread ID unique relative to all other Java threads, regardless of what application they are running in? Java applications are supposed to be sand-boxed relative to other Java applications so I thought it might be possible for Thread IDs to collide. If the Thread IDs are unique across all applications, won't that leak some (although very minor) information about other applications on the system? Such as how many threads have