uuid

URL safe UUIDs in the smallest number of characters

吃可爱长大的小学妹 提交于 2019-12-04 17:54:04
问题 Ideally I would want something like example.com/resources/äFg4вNгё5 , minimum number of visible characters, never mind that they have to be percent encoded before transmitting them over HTTP. Can you tell a scheme which encodes 128b UUIDs into the least number of visible characters efficiently, without the results having characters which break URLs? 回答1: Base-64 is good for this. {098ef7bc-a96c-43a9-927a-912fc7471ba2} could be encoded as vPeOCWypqUOSepEvx0cbog The usual equal-signs at the end

Generate UUID with GWT

匆匆过客 提交于 2019-12-04 17:50:46
问题 Is there any way to generate UUID with GWT? 回答1: According to this page: http://2ality.blogspot.com/2009/01/uuids-for-gwt.html This UUID generator works with GWT: http://www.pst.ifi.lmu.de/%7Erauschma/download/UUID.java 回答2: You can generate an UUID in GWT by reusing a Javascript UUID implementation an wrapping it using JSNI: public native static String uuid() /*-{ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random() * 16 | 0, v = c == 'x' ? r :

Does anyone have a Notepad++ plugin that will generate UUIDs and insert them

那年仲夏 提交于 2019-12-04 17:38:28
问题 I Often need UUIDs inserted into files that I'm editing in Notepad++. Does anyone have a macro or add in that does this. Or an autohotkey script? 回答1: Install the GhNppExec plugin from Plugin Central, then configure to run the simple Python script below. Use the shortcut mapper to assign a key combination to the plugin command. import uuid import sys # make a random UUID sys.stdout.write(str(uuid.uuid4()).upper()) 回答2: NppToolBucket does it very nicely, too. http://sourceforge.net/p/npp

MySQL UUID() when not unique?

ⅰ亾dé卋堺 提交于 2019-12-04 16:56:05
What happens when a UUID() generated by MySQL is not unique? If this is for a column that is a primary key, does MySQL error out, or does it try generating another UUID until a truly unique one is found? Well, if you call UUID() twice and get the same results, the most problematic thing would be that "stuff is broken" (tm). It's supposed to be unique and it should be always, as far as I know. There would be no "regenerate" code available: the function is designed to create unique keys even across computers, so how could it even know its result was not unique? from http://dev.mysql.com/doc

Android listen for connections without UUID

 ̄綄美尐妖づ 提交于 2019-12-04 16:46:10
I have written an Android game that uses Bluetooth to transfer data. I copied the code from the Bluetooth Chat application that comes with the ADK. My phone doesn't seem to be able to connect with UUID so I would like to replace it with other methods. I have already replaced my connecting methods with Method m = device.getClass().getMethod("createRfcommSocket", new Class[] {int.class}); tmp = (BluetoothSocket) m.invoke(device, 1); and now I wonder how I can listen for that kind of connections? Currently there reads tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME_SECURE,MY_UUID_SECURE);

db4o, Linq, and UUID's

守給你的承諾、 提交于 2019-12-04 15:45:38
Apparently the db4o website was recently redone, and now old urls are giving 404 errors. Everytime I think I've found the answer, I get a 404 error. I have a simple db4o database I've setup to store people. public class Person { public string Firstname { get; set;} public string Lastname {get;set;} } I've been able to run Linq queries on the database, and everything works wonderfully. I'm programming in a web environment, so I will need someone to identify and fetch unique objects from the database, so I simply configured the database to use UUID's. Now the problem has become, how can I get to

xcode 插件失效 解决办法

我的梦境 提交于 2019-12-04 15:25:07
1. 首先查看 Xcode 的 UUID,在终端执行 defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID 会得到一串 UUID 码 2. 找到 Xcode 插件所在的目录 ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins 选择已安装的插件如:VVDocumenter-Xcode,右键显示包内容,找到 info.plist 找到DVTPlugInCompatibilityUUIDs的项目,添加一个Item,Value的值为之前Xcode的UUID,保存. 重启 Xcode 之后会提示"Load bundle"、 "Skip Bundle",这里必须选择"Load bundle",不然插件无法使用。 3. 如果手误点击了"Skip Bundle"的解决办法 找到该插件安装路径下,继续打开在 info.plist 删除与命令端里面同样的UUID号,一般都是会再最后一行,自己添加的那一行也要删除掉 保存之后重启Xcode 来源: oschina 链接: https://my.oschina.net/u/1265766/blog/541254

如何在RedHat 6.3中安装postgresql93

扶醉桌前 提交于 2019-12-04 13:28:28
第一步:首先安装postgresql93的RPM资料库 wget http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm 第二步:执行命令安装rpm -ivh pgdg-redhat93-9.3-1.noarch.rpm 第三步:执行yum install postgresql93-server postgresql93-contrib 发现如下问题:Error: Package: postgresql93-contrib-9.3.5-1PGDG.rhel6.i686 (pgdg93) Requires: libcrypto.so.10(libcrypto.so.10) ![libcrypto.so.10(libcrypto.so.10)][1] [1]: http://static.oschina.net/uploads/space/2014/0811/032653_pqnq_122078.png 原因居然是openssl的版本不对。解决方案如下: 升级openssl下载openssl10-libs-1.0.1e-1.ius.el6.i686.rpm文件然后用rpm --force -ivh openssl10-libs-1.0.1e-1.ius.el6.i686.rpm

Cassandra/Pycassa: Getting random rows

≡放荡痞女 提交于 2019-12-04 12:42:55
Is there a possibility to retrieve random rows from Cassandra (using it with Python/Pycassa)? Update: With random rows I mean randomly selected rows! You might be able to do this by making a get_range request with a random start key (just a random string), and a row_count of 1. From memory, I think the finish key would need to be the same as start , so that the query 'wraps around' the keyspace; this would normally return all rows, but the row_count will limit that. Haven't tried it but this should ensure you get a single result without having to know exact row keys. Not sure what you mean by

PHP websocket之聊天室实现

萝らか妹 提交于 2019-12-04 12:11:40
PHP部分 <?php error_reporting(E_ALL); set_time_limit(0);// 设置超时时间为无限,防止超时 date_default_timezone_set('Asia/shanghai'); class WebSocket { const LOG_PATH = '/tmp/'; const LISTEN_SOCKET_NUM = 9; /** * @var array $sockets * [ * (int)$socket => [ * info * ] * ] * todo 解释socket与file号对应 */ private $sockets = []; private $master; public function __construct($host, $port) { try { $this->master = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); // 设置IP和端口重用,在重启服务器后能重新使用此端口; socket_set_option($this->master, SOL_SOCKET, SO_REUSEADDR, 1); // 将IP和端口绑定在服务器socket上; socket_bind($this->master, $host, $port); //