guid

How can I generate GUIDs in Excel?

坚强是说给别人听的谎言 提交于 2019-11-26 20:15:51
I have an excel file with one order on each row, and I want each order to have a unique identifier, so there will be a Unique ID column. Every time I fill a row, I want Excel to automatically populate the Unique ID column for me. I did some research and was pointed in the direction of GUIDs. I found the following code: Function GenGuid() As String Dim TypeLib As Object Dim Guid As String Set TypeLib = CreateObject("Scriptlet.TypeLib") Guid = TypeLib.Guid ' format is {24DD18D4-C902-497F-A64B-28B2FA741661} Guid = Replace(Guid, "{", "") Guid = Replace(Guid, "}", "") Guid = Replace(Guid, "-", "")

Performance - using Guid object or Guid string as Key

[亡魂溺海] 提交于 2019-11-26 19:48:29
问题 When using a Guid as an index for a Dictionary , is it better to use the Guid object, or the string representation of the Guid? I just refactored some code which was using string to use the object, because there were new Guid() calls all over the place. But that left me wondering what the performance issues might be. (The collections are fairly small, but they get iterated lots of times.) 回答1: The Guid should be quicker, as the comparison is simpler - just a few direct bytes. The string

Generating Guids in Ruby

怎甘沉沦 提交于 2019-11-26 19:38:27
I have problem that is really easily solved with Guids. In particular, for a password reset workflow, I would like to send a Guid token to a user's email and have them reset their password using the token. Since guids are unique, this is pretty secure and saves me emailing people passwords, which is risky. I noticed there is one Guid gem for Ruby; but it looks quite old, and it writes stuff to the file system. Does anyone know of any other gems that can create a globally unique identifier? I know I can just fall back to: (0..16).to_a.map{|a| rand(16).to_s(16)}.join But it does not really seem

What is a good unique PC identifier?

半世苍凉 提交于 2019-11-26 19:36:15
I've been looking at the code in this tutorial , and I found that it uses My.Computer.Name to save settings that shouldn't roam between computers. It's entirely possible, however, for a user to have two identically named PCs. If they wanted to have the same username on each PC, for example, they may very well end up with two PCs named Username-PC. What are some good methods of identifying different PCs? Do PCs have GUIDs associated with them, or should I look into pulling the serial number off of some hardware? I don't care if the identification persists through reinstallation of Windows. (The

C# how to create a Guid value?

不羁的心 提交于 2019-11-26 19:28:56
One field of our struct is Guid type. How to generate a valid value for it? Guid id = Guid.NewGuid(); Adam Driscoll Guid.NewGuid() creates a new random guid. There are two ways var guid = Guid.NewGuid(); or var guid = Guid.NewGuid().ToString(); both use the Guid class, the first creates a Guid Object, the second a Guid string. Guid.NewGuid() will create one var guid = new Guid(); Hey, its a 'valid', although not very useful, Guid. (the guid is all zeros, if you don't know. Sometimes this is needed to indicate no guid, in cases where you don't want to use a nullable Guid) reza.cse08 To makes an

guid to base64, for URL

主宰稳场 提交于 2019-11-26 19:27:48
问题 Question: is there a better way to do that? VB.Net Function GuidToBase64(ByVal guid As Guid) As String Return Convert.ToBase64String(guid.ToByteArray).Replace("/", "-").Replace("+", "_").Replace("=", "") End Function Function Base64ToGuid(ByVal base64 As String) As Guid Dim guid As Guid base64 = base64.Replace("-", "/").Replace("_", "+") & "==" Try guid = New Guid(Convert.FromBase64String(base64)) Catch ex As Exception Throw New Exception("Bad Base64 conversion to GUID", ex) End Try Return

Event Tracing for Windows

时光毁灭记忆、已成空白 提交于 2019-11-26 19:13:29
突然ですが、皆さんは、馬に乗ったことはありますか?・・・このお話にご興味のある方は本文の最後の【閑話休題】までどうぞ。 さて、今回は、 Event Tracing for Windows (ETW) についてお話ししようと思います。ドライバ開発者の方にとって、なぜ、 ETW が必要なのでしょうか?読者の皆様にもご経験があるかもしれませんが、エンドユーザ様の運用環境の現象を、開発側で再現できない場合や、開発側でカーネルデバッガを接続し、Checked Build 版ドライバでデバッグプリントを出力すると、タイミングが変わって現象が再現しない場合があります。このような時、ドライバに ETW を実装しておくと、エンドユーザ様の運用環境で現象を再現することさえできれば、追加で何かをインストールする必要なく、かつ、パフォーマンスに影響を与えることもほとんどなく、デバッグプリント並みの詳細なログが取ることができるのです。追加で何かのインストールが必要ない、というのは、 OS にすでに入っているツール (logman.exe) を使ってログを採取することができる、ということです。ただ、一方で、「 イベントログの出力方法 」の記事にも書いた通り、常時採取するには向いていません。短時間でもデータ量が非常に多くなってディスクスペースを圧迫する可能性がありますし

用API获得Internet Explorer_Server类的HTML

落花浮王杯 提交于 2019-11-26 19:03:28
     首先要找到含有Internet Explorer_Server类句柄,   HTMLDocumentClass result = (HTMLDocumentClass)documentFromDOM(hWnd.ToInt32());    result.activeElement.innerHTML 就得到所有HTML    private static IHTMLDocument2 documentFromDOM(int hWnd) { IHTMLDocument2 document=null; int lRes=0; int lngMsg = NativeMethods.RegisterWindowMessage("WM_HTML_GETOBJECT"); Guid IID_IHTMLDocument = new Guid("626FC520-A41E-11CF-A731-00A0C9082637"); if (lngMsg != 0) { NativeMethods.SendMessageTimeout(hWnd, lngMsg, 0, 0, NativeMethods.SMTO_ABORTIFHUNG, 1000, ref lRes); if (!(bool)(lRes == 0)) { int hr = NativeMethods

MOSS 工作流 vs2008+win2008

无人久伴 提交于 2019-11-26 19:03:04
  工作流,这一周都在练习,WF的出现的确让工作流程显示得更加方便和明朗,   今天的日志,也没有特别要写方法和实例,这一周都在看实例,其中有个非常不解的地方,就是为什么老是提示 "启动失败(正在重启中)",和例子一模一样的样,问题出在哪里,我一行一行的对照都没有写错,就是DEBUG不到问题,查看日志提示:      06/25/2010 21:43:10.71 w3wp.exe (0x14A0) 0x0414 Windows SharePoint Services Workflow Infrastructure 936l High Engine RunWorkflow: System.Workflow.ComponentModel.Compiler.WorkflowValidationFailedException: 工作流验证失败 。 在 System.Workflow.Runtime.WorkflowDefinitionDispenser.ValidateDefinition(Activity root, Boolean isNewType, ITypeProvider typeProvider) 在 System.Workflow.Runtime.WorkflowDefinitionDispenser.LoadRootActivity(Type workflowType,

Generate GUID in MySQL for existing Data?

Deadly 提交于 2019-11-26 19:01:32
问题 I've just imported a bunch of data to a MySQL table and I have a column "GUID" that I want to basically fill down all existing rows with new and unique random GUID's. How do I do this in MySQL ? I tried UPDATE db.tablename SET columnID = UUID() where columnID is not null And just get every field the same 回答1: I'm not sure if it's the easiest way, but it works. The idea is to create a trigger that does all work for you, then, to execute a query that updates your table, and finally to drop this