Are GUID collisions possible?

Basically, no. I think someone went mucking with your database. Depending on the version GUID you’re using the value is either unique (for things like version 1 GUIDs), or both unique and unpredictable (for things like version 4 GUIDs). SQL Server’s implementation for their NEWID() function appears to use a 128-bit random number, so you’re … Read more

Generating GUIDs in Ruby

As of Ruby 1.9, uuid generation is built-in. Use the SecureRandom.uuid function. For example: require ‘securerandom’ SecureRandom.uuid # => “96b0a57c-d9ae-453f-b56f-3b154eb10cda”

Best way to create unique token in Rails?

— Update — As of January 9th, 2015. the solution is now implemented in Rails 5 ActiveRecord’s secure token implementation. — Rails 4 & 3 — Just for future reference, creating safe random token and ensuring it’s uniqueness for the model (when using Ruby 1.9 and ActiveRecord): class ModelName < ActiveRecord::Base before_create :generate_token protected def … Read more

Test if string is a guid without throwing exceptions?

Performance Benchmarks Catch exception: 10,000 good: 63,668 ticks 10,000 bad: 6,435,609 ticks Regex Pre-Screen: 10,000 good: 637,633 ticks 10,000 bad: 717,894 ticks COM Interop CLSIDFromString 10,000 good: 126,120 ticks 10,000 bad: 23,134 ticks COM Intertop (Fastest) Answer: /// <summary> /// Attempts to convert a string to a guid. /// </summary> /// <param name=”s”>The string to … Read more

How to create a GUID/UUID using iOS

[[UIDevice currentDevice] uniqueIdentifier] Returns the Unique ID of your iPhone. EDIT: -[UIDevice uniqueIdentifier] is now deprecated and apps are being rejected from the App Store for using it. The method below is now the preferred approach. If you need to create several UUID, just use this method (with ARC): + (NSString *)GetUUID { CFUUIDRef theUUID … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)