uuid

java.io.IOException: Service discovery failed

旧时模样 提交于 2019-12-11 03:29:00
问题 I'm working on an Android app using Bluetooth connectivity between two paired smartphones. The Bluetooth logic is based on the famous BluetoothChat SDK example: a "service" Class managing a thread for server accept() , a thread for client connect() and a thread for reading/writing on the socket. Everything works fine, except if I close an active connection (both from client or server side), then all successive attempts to start a new connection will fail with this error: java.io.IOException:

Cant find uuid in org.apache.spark.sql.types.DataTypes

大憨熊 提交于 2019-12-11 01:29:23
问题 We have a PostgreSQL table which has UUID as one of the column. How do we send UUID field in Spark dataset(using Java) to PostgreSQL DB. We are not able to find uuid field in org.apache.spark.sql.types.DataTypes. Please advice. 回答1: Yes, you are right, there is no UUID datatype in SparkSQL. Treating them as String should work because the connector will convert the String to UUID. I haven't tried with PostgreSQL, but when I used Cassandra (and Scala) it worked perfectly. 回答2: As already

Android Marshmallow [API 23] : Bluetooth UUID returns NULL

微笑、不失礼 提交于 2019-12-11 00:58:17
问题 Just updated my android to marshmallow and realized that is not working very well. I have just created an app that reports the Devices and Services (with UUIDs) availables via classical bluetooth: I've tested it in: API 16 API 22 API 23 My manifiest permissions are: <uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name=

How can I force the value of a MySQL query to use a particular collation?

試著忘記壹切 提交于 2019-12-11 00:29:19
问题 I want to use UUID() to generate primary keys. After some investigation, I thought this should work: INSERT INTO aTable (`id`) VALUES (UNHEX(REPLACE(UUID(),'-',''))); Where id is of the type BINARY(16) . Unfortunately, UUID() returns a value which uses the utf8_general_ci collation. The rest of my database uses utf8_unicode_ci , which means I get the following error: #1270 - Illegal mix of collations (utf8_general_ci,COERCIBLE), (utf8_unicode_ci,COERCIBLE), (utf8_unicode_ci,COERCIBLE) for

Generating UUIDs for IndexedDB keys?

喜夏-厌秋 提交于 2019-12-10 23:57:13
问题 The W3C spec for IndexedDB defines a key generator as: A key generator generates a monotonically increasing numbers [sic] every time a key is needed. Now, it seems (to me) that a common use case for IndexedDB (or, for that matter, any of the HTML5 client-side storage options: WebSQL, localStorage etc.) would be apps designed to work offline (in conjunction with HTML5 ApplicationCache). In this scenario, a disconnected web application might generate new objects/records in it's local data store

Modeling UUID in Hibernate entity against MySQL

情到浓时终转凉″ 提交于 2019-12-10 23:09:49
问题 I have a very similar question to this one, however my question is even more basic than that one and so I don't feel like its a dupe...(we'll see what SO thinks). And if it is a dupe of another question, please point out to me (perhaps in a comment) how the accepted answer completely answers/addresses my issue (I don't think it does!). I have a Java/JPA/Hibernate @Entity class that needs to have a UUID field: @Canonical @MappedSuperclass public abstract class BaseEntity { @Id @GeneratedValue

ruby base64 encode 128 bit number by starting with a 2 bit character to prevent padding at the end

本小妞迷上赌 提交于 2019-12-10 23:01:36
问题 This question is a follow up to my previous question here: How can I convert a UUID to a string using a custom character set in Ruby? But I will try to formulate it as a separate and specific question. I do have a Ruby 128 bit UUID as hex value: SecureRandom.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594" If I get the IFC specification correctly (http://www.buildingsmart-tech.org/ifc/IFC2x3/TC1/html/ifcutilityresource/lexical/ifcgloballyuniqueid.htm), I want to Base64 encode this, but instead

UUID into unsigned int

醉酒当歌 提交于 2019-12-10 21:28:14
问题 Is there anywhere to compress/convert/encode/encrypt a UUID into an unsigned int? I read UUID's from a sql table, the history is ugly and i can not change... I have only an unsigned int to store it in. This is C++ in case that makes a difference Any thoughts on this? Thanks Reza 回答1: Use a CRC32 of the UUID (I assume you mean 32-bit integer). There's obviously the potential for collisions, but if there's a collision it should be rare enough you can just fix it manually. Note that if this is

Extracting MAC addresses from UUIDs

痴心易碎 提交于 2019-12-10 20:15:50
问题 A program that I work on assumes that the UUID generated by the Windows RPC API call UuidCreateSequential() contains the MAC address of the primary ethernet adapter. Is this assumption correct or should I use a different method to get the MAC address? 回答1: I wouldn't rely on this - the only reason that UuidCreateSequential has the MAC address is it's trying to guarantee that the UUID is unique across the network. Plus, why would you use such a weird way to get a MAC address? Use WMI and

Performance gains to using UUID instead of its string representation as _id on MongoDB?

三世轮回 提交于 2019-12-10 18:54:46
问题 In REST applications, I need to convert UUID string representation (received in json ) to UUID Object to store it on MongoDB's _id field. I'm doing that as I heard there is a performance gain in the lookup/insertion time when using UUID vs String . Is there really a performance gain when using UUID as _id on MongoDB instead of its string representation? (even small performance gains can have a big impact for me) PS: I saw this post that says performance is better for ObjectID (not exactly the