guid

Identity change GUID to int

好久不见. 提交于 2019-11-27 13:17:54
How does one change the PK column of the AspNetUser table from a guid to int data type? This should now be possible with the latest asp.net-identity version which got released today. But I can't find anywhere how this is done? James Skimming By default the ASP.NET Identity (using Entity Framework) uses strings as the primary keys, not GUIDs, but it does store GUIDs in those string. You need to define a few more classes, I've just created a new project (I'm using the VS2013 Update 2 CTP), here are the identity models you need to change: public class ApplicationUser : IdentityUser<int,

How to generate a GUID in VBScript?

99封情书 提交于 2019-11-27 12:01:42
问题 I want to generate GUID strings in VBScript. I know that there's no built-in function in VBScript for generating one. I don't want to use random-generated GUIDs. Maybe there is an ActiveX object that can be created using CreateObject() that is sure to be installed on (newer) Windows versions that can generate a GUID? 回答1: How Can I Create a GUID Using a Script? (in: Hey, Scripting Guy! Blog) says this: Set TypeLib = CreateObject("Scriptlet.TypeLib") Wscript.Echo TypeLib.Guid However, note

Convert from Oracle's RAW(16) to .NET's GUID

坚强是说给别人听的谎言 提交于 2019-11-27 11:28:06
I'm having difficulties manually debugging an .NET application where the Guid values differ from .NET to Oracle. Where C# reads: 17D89D326C2142D69B989F5201288DBF Oracle reads: 329DD817216CD6429B989F5201288DBF How would I be able to manually debug, i.e., from C#'s GUID be able to paste that value in an oracle query and get the correct results (and viceversa)? If you look at the values involved (in pairs) of hex digits you can see that the last 7 bytes are the same in both cases, but the first 9 are switched around a bit. Going from your example, but rewriting each pair in the .NET as 00, 11, 22

Platform-independent GUID generation in C++?

浪子不回头ぞ 提交于 2019-11-27 11:11:44
What is the best way to programmatically generate a GUID or UUID in C++ without relying on a platform-specific tool? I am trying to make unique identifiers for objects in a simulation, but can't rely on Microsoft's implementation as the project is cross-platform. Notes: Since this is for a simulator, I don't really need cryptographic randomness. It would be best if this is a 32 bit number. Anonymous If you can afford to use Boost, then there is a UUID library that should do the trick. It's very straightforward to use - check the documentation and this answer . on linux: man uuid on win: check

What exactly is GUID? Why and where I should use it?

感情迁移 提交于 2019-11-27 11:02:38
问题 What exactly is GUID? Why and where I should use it? I've seen references to GUID in a lot of places, and in wikipedia, but it is not very clear telling you where to use it. If someone could answer this, it would be nice. Thanks 回答1: GUID technically stands for globally unique identifier. What it is, actually, is a 128 bit structure that is unlikely to ever repeat or create a collision. If you do the maths, the domain of values is in the undecillions. Use guids when you have multiple

SQL Server: converting UniqueIdentifier to string in a case statement

送分小仙女□ 提交于 2019-11-27 11:01:07
问题 We have a log table that has a message column that sometimes has an exception stack trace. I have some criteria that determines if the message has this. We do not want to show these messages to the customer but instead have a message like: Internal Error Occured. Contact US with reference code xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx where xxx etc is a guid column in the table. I am writing stored proc like this: declare @exceptionCriteria nvarchar(50) select @exceptionCriteria = '%<enter

Would it help to add index to BIGINT column in MySQL?

这一生的挚爱 提交于 2019-11-27 09:46:08
I have a table that will have millions of entries, and a column that has BIGINT(20) values that are unique to each row. They are not the primary key, but during certain operations, there are thousands of SELECT s using this column in the WHERE clause. Q: Would adding an index to this column help when the amount of entries grows to the millions? I know it would for a text value, but I'm unfamiliar with what an index would do for INT or BIGINT . A sample SELECT that would happen thousands of times is similar to this: `SELECT * FROM table1 WHERE my_big_number=19287319283784 If you have a very

Send Meeting By SMTP

流过昼夜 提交于 2019-11-27 07:37:01
4 用SMTP 发送会议邀请 public ServiceWrapper SendInvitation(MMeetingInvitation model) { Log.WriteMsg($ " OldModel:{new JavaScriptSerializer().Serialize(model)} " ); var sw = new ServiceWrapper( " SendMeetingInvitation " ); InvitationMail im = new InvitationMail(); try { if (! string .IsNullOrEmpty(model.content)) model.content = model.content.Replace( " \\n " , " \n " ); if (! string .IsNullOrEmpty(model.attendees)) model.attendees = model.attendees.Replace( " , " , " ; " ); string attendees; attendees = string .Join( " ; " , (model.organizer + " ; " + model.attendees).Split( ' ; ' ).Where(s => {

How to generate a new GUID?

落爺英雄遲暮 提交于 2019-11-27 07:26:00
I'm working on a web service which requires a new GUID() passed as a reference to a method within the service. I am not familiar with C# or the GUID() object , but require something similar for PHP (so create a new object which from my understanding returns an empty/blank GUID ). Any ideas? You can try the following: function GUID() { if (function_exists('com_create_guid') === true) { return trim(com_create_guid(), '{}'); } return sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0,

What is the most efficient way to encode an arbitrary GUID into readable ASCII (33-127)?

 ̄綄美尐妖づ 提交于 2019-11-27 06:37:40
The standard string representation of GUID takes about 36 characters. Which is very nice, but also really wasteful. I am wondering, how to encode it in the shortest possible way using all the ASCII characters in the range 33-127. The naive implementation produces 22 characters, simply because 128 bits / 6 bits yields 22. Huffman encoding is my second best, the only question is how to choose the codes.... The encoding must be lossless, of course. Use Base 85. See section 4.1. Why 85? of A Compact Representation of IPv6 Addresses An IPv6 address, like a GUID is made up of eight 16-bit pieces.