uuid

android bluetoothadapter.startLeScan, filter by UUID

只愿长相守 提交于 2019-12-10 18:05:06
问题 I want to scan BLE device with the startLeScan(UUID[] serviceUuids, LeScanCallback callback) method, now I have a UUID, it's a 16-bits value, for example, 00000000-0000-1000-8000-00805F9B34FB . How can I use the UUID in startLeScan method, I write like this, UUID[] uuid = new UUID[1]; uuid[0] = UUID.fromString("00000000-0000-1000-8000-00805F9B34FB"); mBluetoothAdapter.startLeScan(uuid, mLeScanCallback); But finally I can scan nothing. How can I resolve this problem. 回答1: I used the same

sed

孤街浪徒 提交于 2019-12-10 17:46:40
1.1用法与原理 •sed [option]… ‘script’ file 1.2常用选项 •-n:取消默认输出 •-e:多点编辑 •-f :/PATH/TO/SCRIPT_FILE从指定文件中读取编辑脚本 •-r:支持使用扩展正则表达式 1.3地址定界 •(1)不给地址:对全文进行处理 •(2)单地址: #:指定的行 /pattern/:被此处模式所能够匹配到的每一行 •(3)地址范围: #,# #,+# /pat1/,/pat2/ #,/pat1/ #;#;#分隔的多行 1.3.1实践操作 环境准备 [root@oldboyedu-02 oldboy]# cat person.txt 101,oldboy,CEO 102,zhangyao,CTO 103,Alex,COO 104,yy,CFO 105,feixue,CIO •-n取消默认输出,只打印想要的内容 [root@oldboyedu-02 oldboy]# sed '1p' person.txt 101,oldboy,CEO 101,oldboy,CEO 102,zhangyao,CTO 103,Alex,COO 104,yy,CFO 105,feixue,CIO [root@oldboyedu-02 oldboy]# sed -n '1p' person.txt 101,oldboy,CEO •连续多行 [root

awk

天涯浪子 提交于 2019-12-10 17:39:27
1.awk 1.1执行流程 1.2print print item1,item2,… 要点: (1)逗号分隔符 (2)输出的item可以是字符串,也可以是数值,当前记录的字段,变量或awk的表达式 (3)如省略item,相当于print $0 1.3变量 内建变量 FS:input field seperator,输入间隔符,默认为空白字符 OFS:output field separator,输出间隔符,默认为空白字符 RS:input record separator,输入时的换行符 ORS:output record separator,输出时的换行符 NF:number of field,字段数量,{print NF} 输出字段的数量{print $NF}输出最后一列 NR:number of record,行数 FNR:各文件分别计数,行数 FILENAME:当前文件名 ARGC:命令行参数个数 ARGV:数组,保存的是命令行所给定的各个参数 自定义变量 方式一: -v var=value 变量名区分字符大小写 方式二: 在program中直接定义 下面这两个最重要: NF:number of field,字段数量,{print NF} 输出字段的数量{print $NF}输出最后一列 NR:number of record,行数 [root@m01 oldboy]#

How to start ranging without UUID using estimote beacon android?

安稳与你 提交于 2019-12-10 17:19:18
问题 I am making an android application on beacon in this app I want to find estimote beacon. So I want to know that how to start ranging beacon without uuid and how to search estimote beacon. I want to find uuid of Estimote. If anybody knows please help me out with this. 回答1: All Estimote beacons share the same proximity UUID unless changed. If you use Estimote Android SDK, then default proximity UUID is declared in com.estimote.sdk.utils.EstimoteBeacons.ESTIMOTE_PROXIMITY_UUID ( B9407F30-F5F8

Test vectors for UUID version 5 (converting hash into guid) generation algorithm?

我怕爱的太早我们不能终老 提交于 2019-12-10 16:38:48
问题 i'm trying to find some test vectors to check my implementation of RFC 4122 of UUID version 5. 4.3 Algorithm for Creating a Name-Based UUID Version 3 of a UUID is for putting an MD5 hash into a GUID. Version 5 of a UUID is for putting an SHA1 hash into a GUID. The RFC has sample implementation in C: void uuid_create_sha1_from_name( uuid_t *uuid, /* resulting UUID */ uuid_t nsid, /* UUID of the namespace */ void *name, /* the name from which to generate a UUID */ int namelen /* the length of

b/s实现大文件上传分片上传断点续传

北战南征 提交于 2019-12-10 13:44:20
关键部分 前端用file.slice()分块 前端用FileReader获取每一分块的md5值 后端用MultipartFile接受分块文件 后端用FileOutputStream拼装分块文件 话不多说,直接上代码,我想这是你们最喜欢的 工程截图 <%@ page language = "java" import = "java.util.*" pageEncoding = "UTF-8" %><% String path = request.getContextPath(); String basePath = request.getScheme()+ "://" +request.getServerName()+ ":" +request.getServerPort()+path+ "/" ; String clientCookie = request.getHeader( "Cookie" ); %> <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > < html > < head > < meta http-equiv = "Content-Type" content =

Are erlang refs unique between nodes/VM restarts?

妖精的绣舞 提交于 2019-12-10 13:33:40
问题 Documentation says that make_ref() -> ref() Returns an almost unique reference. The returned reference will re-occur after approximately 2 82 calls; therefore it is unique enough for practical purposes. But my eyes tell me that between VM restarts I could easily get the same ref: [~] erl Erlang R14B04 (erts-5.8.5) 1> make_ref(). #Ref<0.0.0.33> 2> make_ref(). #Ref<0.0.0.37> ^C [~] erl Erlang R14B04 (erts-5.8.5) 1> make_ref(). #Ref<0.0.0.33> So, how unique Erlang’s Refs are? Are they suitable

Laravel 4 using UUID as primary key

倾然丶 夕夏残阳落幕 提交于 2019-12-10 13:19:41
问题 I am setting up my first Laravel 4 app and the specs call for the id fields to be varchar(36) and be a UUID. Using Eloquent, my migrations for a sample table looks like this: Schema::create('users', function($table) { $table->string('id', 36)->primary; $table->string('first_name', 50); $table->string('last_name', 50); $table->string('email')->unique(); $table->string('password', 60); $table->timestamps(); $table->softDeletes(); }); When the users table gets created, the id field is not

How to initialize a constant CLSID

删除回忆录丶 提交于 2019-12-10 12:34:43
问题 A class ID (GUID) is generally specified with a sequence of hex numbers separated by dashes, e.g. {557cf406-1a04-11d3-9a73-0000f81ef32e} . This is not a literal that can be used to initialize a CLSID structure directly. I've discovered two ways to initialize the structure, but they're both kind of awkward. The first doesn't allow it to be declared const and must be done at run time, while the second requires extensive reformatting of the hex constants. CLSID clsid1; CLSIDFromString(CComBSTR("

How to use UUID as primary key for Hibernate Entity?

ⅰ亾dé卋堺 提交于 2019-12-10 11:35:44
问题 I am trying to use UUID in Hibernate. Have the following @Entity base-class description (with @MappedSuperclass annotation): @Id @Column(name="id") private UUID id; public UUID getId() { return id; } For test, I am trying to read all entities of my class from database (database exists, records exist). My database is PostgreSQL 8.4 with UUID support and primary key is of UUID type. Running my test I get the following in log: [junit] 14:21:34,839 INFO LongType:203 - could not read column value