uuid

C++ com 组件 事件 备忘

▼魔方 西西 提交于 2019-11-28 19:29:29
[ object, uuid(AECE8D0C-F902-4311-A374-ED3A0EBB6B49), dual, nonextensible, pointer_default(unique) ] interface ICallbacks : IUnknown { [id(1)] HRESULT UserExit([in] int errorCode, [in] BSTR errorMessage); [id(2)] HRESULT UserAttemptingReconnection(); [id(3)] HRESULT UserReconnected(); }; [ object, uuid(B98A7D3F-651A-49BE-9744-2B1D8C896E9E), dual, nonextensible, pointer_default(unique) ] interface ICerberusSession : IDispatch { ... [id(5)] HRESULT SetCallbacks([in] ICallbacks* callbacks); }; 来源: https://www.cnblogs.com/nanfei/p/11423184.html

How to generate a GUID in VBScript?

偶尔善良 提交于 2019-11-28 19:11:48
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? Roger Lipscombe 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 that Scriptlet.TypeLib.Guid returns a null-terminated string, which can cause some things to

Is there a method to generate a standard 128bit GUID (UUID) on the Mac?

时光总嘲笑我的痴心妄想 提交于 2019-11-28 19:05:31
问题 Is there a built in function equivalent to .NET's Guid.NewGuid(); in Cocoa? My desire is to produce a string along the lines of 550e8400-e29b-41d4-a716-446655440000 which represents a unique identifier. 回答1: UUIDs are handled in Core Foundation, by the CFUUID library. The function you are looking for is CFUUIDCreate. FYI for further searches: these are most commonly known as UUIDs, the term GUID isn't used very often outside of the Microsoft world. You might have more luck with that search

How to generate unique 64 bits integers from Python?

断了今生、忘了曾经 提交于 2019-11-28 18:43:15
问题 I need to generate unique 64 bits integers from Python. I've checked out the UUID module. But the UUID it generates are 128 bits integers. So that wouldn't work. Do you know of any way to generate 64 bits unique integers within Python? Thanks. 回答1: just mask the 128bit int >>> import uuid >>> uuid.uuid4().int & (1<<64)-1 9518405196747027403L >>> uuid.uuid4().int & (1<<64)-1 12558137269921983654L These are more or less random, so you have a tiny chance of a collision Perhaps the first 64 bits

Cassandra: Generate a unique ID?

隐身守侯 提交于 2019-11-28 18:41:42
I'm working on a distributed data base. I'm trying to generate a unique ID that will serve as a column family primary key in cassandra . I read some articles about doing this with Java using UUID but it seems like there is a probability for collision (even if it's very low). I wonder if there is a way to generate a unique ID based on time maybe? Richard You can use the TimeUUID type in Cassandra, which backs a Type 1 UUID . This uses the current time and the creator's MAC address and a sequence number. If the TimeUUID number is generated correctly this can be done with zero collisions (you can

How to efficient insert and fetch UUID in Core Data

流过昼夜 提交于 2019-11-28 17:56:29
I am looking for an efficient way to store and search UUID in Core Data. Those UUID are generated by many iOS devices in a distributed system. Each of those devices may store about 20-50k UUIDs. It is obvious that storing UUID as String in Core Data will hurt the efficiency of indexing on it. But after a series of research I found that storing UUID as Binary Data in Core Data (and index it) may be less efficient than storing it as String . As there is no BINARY-like or VARBINARY-like data type in SQLit is supported. I guess that any Binary Data type of data in Core Data is stored as BLOB in

Laravel str_random() or custom function?

回眸只為那壹抹淺笑 提交于 2019-11-28 17:24:57
问题 Is the Laravel str_random() function random enough so that I can use it for IDs? For example: str_random(32); This produces a random string of length 32 made up of alphanumeric characters [a-zA-z0-9] (62 characters in total). Which equates to 2272657884496751345355241563627544170162852933518655225856 possibilities. However, my question is, is this going to be good enough? Or should I consider using UUIDs or another custom function. 回答1: str_random ( Str::random() ) tries to use openssl_random

how to use UUID in Django

大兔子大兔子 提交于 2019-11-28 16:41:31
问题 I am trying to get unique IDs for my Django objects. In Django 1.8 they have the UUIDField. I am unsure how to use this field in order to generate unique IDs for each object in my model. Here is what I have for the UUIDField import uuid from django.db import models class MyUUIDModel(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) class Person(models.Model): ... unique_id = MyUUIDModel() I can reproduce the id for the UUID model, but everytime I do I

How can I use UUIDs in SQLAlchemy?

依然范特西╮ 提交于 2019-11-28 15:42:39
Is there a way to define a column (primary key) as a UUID in SQLAlchemy if using PostgreSQL (Postgres)? JDiMatteo The sqlalchemy postgres dialect supports UUID columns. This is easy (and the question is specifically postgres) -- I don't understand why the other answers are all so complicated. Here is an example: from sqlalchemy.dialects.postgresql import UUID from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() class Foo(db.Model): id = Column(Integer, primary_key=True) uuid = Column(UUID(as_uuid=True), unique=True, nullable=False) I wrote this and the domain is gone but here's the guts..

What's your opinion on using UUIDs as database row identifiers, particularly in web apps?

痞子三分冷 提交于 2019-11-28 15:38:07
I've always preferred to use long integers as primary keys in databases, for simplicity and (assumed) speed. But when using a REST or Rails-like URL scheme for object instances, I'd then end up with URLs like this: http://example.com/user/783 And then the assumption is that there are also users with IDs of 782, 781, ..., 2, and 1. Assuming that the web app in question is secure enough to prevent people entering other numbers to view other users without authorization, a simple sequentially-assigned surrogate key also "leaks" the total number of instances (older than this one), in this case