uniqueidentifier

Excel 2007 - Generate unique ID based on text?

南笙酒味 提交于 2019-12-01 01:29:41
问题 I have a sheet with a list of names in Column B and an ID column in A. I was wondering if there is some kind of formula that can take the value in column B of that row and generate some kind of ID based on the text? Each name is also unique and is never repeated in any way. It would be best if I didn't have to use VBA really. But if I have to, so be it. 回答1: Solution Without VBA. Logic based on First 8 characters + number of character in a cell. = CODE(cell) which returns Code number for

Convert from UniqueIdentifier to BigInt and Back?

自作多情 提交于 2019-11-30 22:41:38
问题 declare @uu uniqueidentifier = 'C50B0567-F8CC-4219-A1E1-91C97BD9AE1B' select @uu declare @zaza bigint = ( select convert(bigint, convert (varbinary(8), @uu, 1)) ) select @zaza select CONVERT( uniqueidentifier , convert( varbinary(16) , @zaza , 1 ) ) I thought I had a fast way to convert Unique Identifier values to a Big Int, and back. But there is a problem in my second convert. Can anyone comment on the right way to fully convert a GUID to a number and back? I am only getting part of the

Using GUIDs in Primary Keys / Clusted Indexes

不想你离开。 提交于 2019-11-30 20:04:02
I'm fairly well versed in SQL server performace but I constanly have to argue down the idea that GUIDs should be used as the default type for Clusterd Primary Keys. Assuming that the table has a fairly low amount of inserts per day (5000 +/- rows / day), what kind of performace issues could we run into? How will page splits affect our seek performance? How often should I reindex (or should I defrag)? What should I set the fill factors to (100, 90, 80, ect)? What if I were inserting 1,000,000 rows per day? I apologize beforhand for all of the questions, but i'm looking to get some backup for

How to set a field to keep a row unique in lucene?

陌路散爱 提交于 2019-11-30 14:33:25
My app generates unique id for each row to index in lucene and save to database. One sutation is if there is and row have the same id,I want to update it,not insert an new row and index. How to do that? This is exactly the purpose of the IndexWrite#updateDocument method. The first argument is the term that must be unique in your index. For example, String id = "42"; Document doc = new Document(); Field field = new Field("id", id, Store.YES, Index.NOT_ANALYZED); doc.add(field); indexWriter.updateDocument(new Term("id", id), doc); will ensure that doc is the only document with id 42 in your

generate UUID of long type

六月ゝ 毕业季﹏ 提交于 2019-11-30 14:18:15
Please give me sample code to generate UUID of long type in java without using timestamp. Thanks A real UUID is 128 bits. A long is 64 bits. This is not just pedantry. UUID stands for Universal Unique IDentifier. The "universal uniqueness" of the established UUID schemes are based on: encoding a MAC address and a timestamp, encoding a hash of a DNS name and a timestamp, or using a 122 bit random number ... which is large enough that the probability of a collision is very very small. With 64 bits, there are simply not enough bits for "universal uniqueness". For instance, the birthday paradox

uniqid() in javascript/jquery?

大兔子大兔子 提交于 2019-11-30 13:57:13
what's the equivalent of this function in javascript: http://php.net/manual/en/function.uniqid.php Basically I need to generate a random ID that looks like: a4245f54345 and starts with a alphabetic character (so I can use it as a CSS id) Manish Trivedi Try this (Work in php). $prefix = chr(rand(97,121)); $uniqid = $prefix.uniqid(); // $uniqid = uniqid($prefix); Try this for JavaScript:: var n = Math.floor(Math.random() * 11); var k = Math.floor(Math.random() * 1000000); var m = String.fromCharCode(n) + k; Try PHPJS's website, specifically the page for uniqid I have been using this ... I use it

Is it possible to get a truly unique id for a particular JVM instance?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 11:42:45
I need a way to uniquely and permanently identify an instance of the JVM from within Java code running in that JVM. That is, if I have two JVMs running at the same time on the same machine, each is distinguishable. It is also distinguishable from running JVMs on other machines and from future executions on the same machine even if the process id is reused. I figure I could implement something like this by identifying the start time, the machine MAC, and the process id, and combining them in some way. I'm wondering if there is some standard way to achieve this. Update : I see that everyone

Generate a unique id

房东的猫 提交于 2019-11-30 11:12:34
问题 I am a student at university and our task is to create a search engine. I am having difficulty generating a unique id to assign to each url when added into the frontier. I have attempted using the SHA-256 hashing algorithm as well as Guid. Here is the code that i used to implement the guid: public string generateID(string url_add) { long i = 1; foreach (byte b in Guid.NewGuid().ToByteArray()) { i *= ((int)b + 1); } string number = String.Format("{0:d9}", (DateTime.Now.Ticks / 10) % 1000000000

How to to create unique random integer ID for primary key for table?

安稳与你 提交于 2019-11-30 09:13:44
I was wondering if anybody knew a good way to create a unique random integer id for a primary key for a table. I'm using MySQL. The value has to be integer. byte_slave If your're open to suggestions and you can implement it, use UUIDs. MySQL's UUID() function will return a 36 chars value which can be used for ID . If you want to use integer, still, I think you need to create a function getRandID() that you will use in the INSERT statement. This function needs to use random + check of existing ids to return one that is not used before. Check RAND() function for MySQL. In response to: "Because I

Safe to use System.currentTimeMillis() to generate a unique database ID?

强颜欢笑 提交于 2019-11-30 08:23:35
问题 I'm using System.currentTimeMillis() (which returns a long integer) in Java to generate a unique ID for database entities since I assume that it's not possible for these times to overlap at any point. Is this a safe assumption? For example, at the moment I get this: 1296691225227 回答1: No, this is not safe. A millisecond is a long time in CPU cycles (they run at billions of cycles per second, not thousands), so if multiple requests come in at a time or if multiple threads all try creating