• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            tqsheng

            go.....
            隨筆 - 366, 文章 - 18, 評論 - 101, 引用 - 0
            數據加載中……

            GUID generation : Slick-C version

            http://community.slickedit.com/index.php/topic,202.html 


            GUID generation : Slick-C version
            « on: July 31, 2006, 05:20:58 PM »
            The earlier post on uuidgen prompted me to share my own macro implementation that I created for my own use a few months ago. This  macro implementation is self-contained, and doesn't shell out to any other utilties.

            There are 3 commands and 1 function for generating GUIDs:

            insert_guid(_str format = 'B'); (command)
            This generates a new GUID, formatted according to format specifier parameter, and inserts it at the current position in the buffer. Default is Brace Format.
            Use it on the command line like so:
            Code: [Select]
            insert-guid g
            copy_guid(_str format = 'B'); (command)
            Same as above, but places the results on the clipboard. This way you can generate a GUID without having an edit buffer open. On the command line:
            Code: [Select]
            copy-guid b
            gui_insert_guid(); (command)
            Shows a small dialog, allowing you to generate multiple GUIDs, or to insert the same GUID in multiple string formats.

            _str guid_create_string(_str format); (function)
            Works the same as insert_guid, but returns the string. For use in your own macro functions and forms.

            The string formats for GUID output are documented in the source guidgen.e, at the top, in the Javadoc for insert_guid. But to pique
            your interest...
            • 'B' - Brace format: {F3410386-1DBB-4035-A293-440A106A6665}
            • 'G' - General format: F3410386-1DBB-4035-A293-440A106A6665
            • 'P' - Paren format: (F3410386-1DBB-4035-A293-440A106A6665)
            • 'N' - Number format: F34103861DBB4035A293440A106A6665
            • 'C' - Const declaration: static const GUID <<name>> = { 0xf3410386, 0x1dbb, 0x4035, { 0xa2, 0x93, 0x44, 0xa, 0x10, 0x6a, 0x66, 0x65 } };
            • 'D' - DEFINE_GUID macro: DEFINE_GUID(<<name>>, 0x17342D4B, 0x906F, 0x4706, 0x0F, 0xAC, 0xC5, 0x8E, 0x4D, 0xE7, 0x32, 0x29);
            • 'O' - IMPLEMENT_OLECREATE macro: IMPLEMENT_OLECREATE(<<class>>, <<external_name>>, 0xf3410386, 0x1dbb, 0x4035, 0xa2, 0x93, 0x44, 0xa, 0x10, 0x6a, 0x66, 0x65);

            In my own testing I have generated over 50,000 GUIDs without a duplicate, so the algorithm looks to be holding up so far.
            But if you'd like to verify the reliability before using in your own code, I have provided some unit testing commands as well.
            Open an empy edit buffer and run the following command line:
            Code: [Select]
            guid-unittest-duplicates 200, where 200 is the number of GUIDs you want to create. This will populate the
            buffer with the requested number of GUIDs in brace format using insert_guid('b');. Any number less than 
            2000 should complete in a reasonable amount of time. 2000 takes around 5 seconds on my Pentium M 2.0 GHz, 1 GB RAM. The results of 
            the unit testing are displayed in the VSAPI message window since it uses the say() funtion. You can run the unit test multiple times in
            the same edit buffer, and it will append the results to the end of the previous test.

            For those of you interested in such things, the GUIDs generated are created (and marked) as version 4. This means
            that all bytes of the GUID were created using a random number, and does not use a MAC address as a basis.

            posted on 2012-04-24 15:26 tqsheng 閱讀(303) 評論(0)  編輯 收藏 引用 所屬分類: slickedit

            99精品久久久久久久婷婷| 国产成人无码久久久精品一| 久久九九久精品国产| 久久人人爽人人精品视频| 日本WV一本一道久久香蕉| AV狠狠色丁香婷婷综合久久| 国产亚洲精午夜久久久久久| 久久久久精品国产亚洲AV无码| 久久亚洲精精品中文字幕| 精品水蜜桃久久久久久久| 伊人久久大香线蕉AV色婷婷色| 免费观看成人久久网免费观看| 久久久久久免费视频| 欧美久久综合性欧美| 久久人人添人人爽添人人片牛牛| 狠狠干狠狠久久| 无码人妻久久久一区二区三区| 国产女人aaa级久久久级| 亚洲欧美伊人久久综合一区二区| 国产精品成人无码久久久久久| 青青草原精品99久久精品66| 青青久久精品国产免费看| 久久精品国内一区二区三区| 性色欲网站人妻丰满中文久久不卡| 国产精品久久久久一区二区三区| 亚洲va国产va天堂va久久| 亚洲欧洲久久久精品| 久久精品国产一区二区电影| 久久国产精品99久久久久久老狼| 亚洲AV无码1区2区久久| 久久婷婷色综合一区二区| 亚洲欧洲中文日韩久久AV乱码| 99热成人精品免费久久| 欧美日韩中文字幕久久伊人| 国产精品岛国久久久久| 97精品国产91久久久久久| 久久精品aⅴ无码中文字字幕不卡| 亚洲精品午夜国产VA久久成人| 漂亮人妻被中出中文字幕久久 | 狠狠狠色丁香婷婷综合久久俺| 中文国产成人精品久久不卡 |