uuid

命令行获取mobileprovision文件的UUID

北慕城南 提交于 2019-12-01 08:40:56
有时候我们需要获取Provisioning Profile的UUID,一般情况下我们是双击mobileprovision文件安装,在老版本Xcode里可以从Organizer窗口里找到对应的UUID,新版本Xcode里不知道为什么这个路径下就找不到uuid了,幸运地我找到了另外一个软件:iPhone配置实用工具,这个软件里也能查看。 只是每次都要借助于GUI工具来查看还是太麻烦了,更好的方法是用命令行,我找到了这个: 0xc010d/mobileprovision-read 使用方法: 在Terminal下输入下面的命令并回车: curl https://raw.githubusercontent.com/0xc010d/mobileprovision-read/master/main.m | clang -framework Foundation -framework Security -o /usr/local/bin/mobileprovision-read -x objective-c - 这条命令的作用是下载mobileprovision-read的源码,然后编译,最后把生成的二进制文件 mobileprovision-read 放入到 /usr/local/bin/ 路径下。 现在你就可以执行 mobileprovision-read 命令来查看帮助了。

get the unix timestamp from type 1 uuid

不问归期 提交于 2019-12-01 08:11:58
In our java application we are trying to get the unix time from the type 1 uuid. But its not giving the correct date time values. long time = uuid.timestamp(); time = time / 10000L; // Dividing by 10^4 as its in 100 nanoseconds precision Calendar c = Calendar.getInstance(); c.setTimeInMillis(time); c.getTime(); Can some one please help ? Edit: Fixed the divisor(10^4) From the docs for timestamp() : The resulting timestamp is measured in 100-nanosecond units since midnight, October 15, 1582 UTC. So you need to offset it from that. For example: Calendar uuidEpoch = Calendar.getInstance(TimeZone

CentOS7 使用NetworkManager

╄→尐↘猪︶ㄣ 提交于 2019-12-01 07:29:01
1.nmcli [root@cloud ~]# nmcli --help Usage: nmcli [OPTIONS] OBJECT { COMMAND | help } OPTIONS -o[verview] overview mode (hide default values) -t[erse] terse output -p[retty] pretty output -m[ode] tabular|multiline output mode -c[olors] auto|yes|no whether to use colors in output -f[ields] <field1,field2,...>|all|common specify fields to output -g[et-values] <field1,field2,...>|all|common shortcut for -m tabular -t -f -e[scape] yes|no escape columns separators in values -a[sk] ask for missing parameters -s[how-secrets] allow displaying passwords -w[ait] <seconds> set timeout waiting for

ANDROID_ID

[亡魂溺海] 提交于 2019-12-01 07:18:35
在设备首次启动时,系统会随机生成一个64位的数字,并把这个数字以16进制字符串的形式保存下来,这个16进制的字符串就是ANDROID_ID,当设备被wipe后该值会被重置。可以通过下面的方法获取: import android.provider.Settings; String ANDROID_ID = Settings.System.getString(getContentResolver(), Settings.System.ANDROID_ID); 1 2 ANDROID_ID可以作为设备标识,但需要注意: 厂商定制系统的Bug:不同的设备可能会产生相同的ANDROID_ID:9774d56d682e549c。 厂商定制系统的Bug:有些设备返回的值为null。 设备差异:对于CDMA设备,ANDROID_ID和TelephonyManager.getDeviceId() 返回相同的值。 Sim Serial Number 装有SIM卡的设备,可以通过下面的方法获取到Sim Serial Number: TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String SimSerialNumber = tm.getSimSerialNumber(); 注意

Sword 第三方库介绍二

懵懂的女人 提交于 2019-12-01 07:03:54
/* uuid生成 */ #include <stdio.h> #include <stdlib.h> /* calloc()函数头文件 */ #include <assert.h> #include "uuid.h" void test() { uuid_t uuid; char *pcOut = NULL; /* 设计说明: uuid一般是36个字节 */ //1.分配内存 pcOut = (char *)calloc(37, sizeof(char)); assert(pcOut); //2.创建uuid uuid_generate(uuid); //3.转化成字符串 uuid_unparse(uuid, pcOut); //4.打印uuid printf("====uuid [%s]====\n", pcOut); //5.释放内存 free(pcOut); pcOut = NULL; } int main() { test(); return 0; } 来源: https://www.cnblogs.com/zhanggaofeng/p/11666066.html

8种方案解决重复提交问题

坚强是说给别人听的谎言 提交于 2019-12-01 06:44:40
1.什么是幂等 在我们编程中常见幂等 select查询天然幂等 delete删除也是幂等,删除同一个多次效果一样 update直接更新某个值的,幂等 update更新累加操作的,非幂等 insert非幂等操作,每次新增一条 2.产生原因 由于重复点击或者网络重发 eg: 点击提交按钮两次; 点击刷新按钮; 使用浏览器后退按钮重复之前的操作,导致重复提交表单; 使用浏览器历史记录重复提交表单; 浏览器重复的HTTP请; nginx重发等情况; 分布式RPC的try重发等; 3.解决方案 1)前端js提交禁止按钮可以用一些js组件 2)使用Post/Redirect/Get模式 在提交后执行页面重定向,这就是所谓的Post-Redirect-Get (PRG)模式。简言之,当用户提交了表单后,你去执行一个客户端的重定向,转到提交成功信息页面。这能避免用户按F5导致的重复提交,而其也不会出现浏览器表单重复提交的警告,也能消除按浏览器前进和后退按导致的同样问题。 3)在session中存放一个特殊标志 在服务器端,生成一个唯一的标识符,将它存入session,同时将它写入表单的隐藏字段中,然后将表单页面发给浏览器,用户录入信息后点击提交,在服务器端,获取表单中隐藏字段的值,与session中的唯一标识符比较,相等说明是首次提交,就处理本次请求,然后将session中的唯一标识符移除

Git repository unique id

倾然丶 夕夏残阳落幕 提交于 2019-12-01 05:43:40
I need to find out if a commit belongs to a particular git repository. The idea is to generate some unique id for every repository I need to test. Then I can compare this unique id to the id, calculated from tested commit. For example take an SHA of initial change set. Can it uniqely identify the repository? The SHA1 key is about identifying the content (of a blob, or of a tree), not about a repository. If the content differ from repo to repo, then its history has no common ancestor, so I don't think a change-set-based solution will work. Maybe (not tested) you could add some marker (without

How do I unit test code which uses Java UUID?

孤街浪徒 提交于 2019-12-01 05:17:07
I have a piece of code which is expected to populated one attribute of response object with Java UUID ( UUID.randomUUID() ). How can I unit test this code from outside to check this behaviour? I don't know the UUID that would be generated inside it. Sample code which needs to be tested: // To test whether x attribute was set using an UUID // instead of hardcode value in the response class A { String x; String y; } // Method to test public A doSomething() { // Does something A a = new A(); a.setX( UUID.randomUUID()); return a; } Powermock and static mocking is the way forward. You will need

How do I unit test code which uses Java UUID?

随声附和 提交于 2019-12-01 02:44:42
问题 I have a piece of code which is expected to populated one attribute of response object with Java UUID ( UUID.randomUUID() ). How can I unit test this code from outside to check this behaviour? I don't know the UUID that would be generated inside it. Sample code which needs to be tested: // To test whether x attribute was set using an UUID // instead of hardcode value in the response class A { String x; String y; } // Method to test public A doSomething() { // Does something A a = new A(); a

mysql主从复制错误:A slave with the same server_uuid/server_id as this slave has connected to the master;

十年热恋 提交于 2019-12-01 02:35:32
A slave with the same server_uuid/server_id as this slave has connected to the master; 有一个slave和这个slave有相同的server_uuid或server_id,已经连接了master。即存在两个或两个以上slave的server_uuid或server_id相同 这种情况下请检查从库是否存在相同的server_id/server_uuid show variables like '%server%id%'; 如果server_id相同,请修改/etc/my.cnf中server_id的配置 如果server_uuid相同,请删除auto.cnf文件,然后重启数据库,数据库会重新生成server_uuid和auto.cnf文件 我出现这个问题是因为克隆了从库所在的虚拟机,于是克隆的从库和原来的从库server_id和server_uuid都相同,于是出现了上述问题 参考地址 : 来源: https://www.cnblogs.com/kiko2014551511/p/11648521.html