摘要: 1. json字符串 jsStr = “{"a":'xxx', "b":'yyy'}” JSON.parse(jsStr); //可以将json字符串转换成json对象 //JSON.stringify(jsStr); //可以将json对象转换成json对符串 阅读全文
posted @ 2019-11-18 13:49 不知起什么名字 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1.离线人脸识别本地部署 详情请阅读百度人脸识别官网 2.nodejs做socket通信的客户端 为什么不直接通过调用c++编译的exe获得人脸识别结果? 原因:exe运行时会加载很多模型而消耗很多时间,导致不能实时得到人脸识别结果;而用socket通信则只需执行一次加载模型的过程,后面的请求只需直 阅读全文
posted @ 2019-11-18 10:40 不知起什么名字 阅读(1141) 评论(0) 推荐(0) 编辑
摘要: 1. append string a= "xxx"; string b="yyy"; a.append(b); 结果 a = “xxxyyy”; 阅读全文
posted @ 2019-11-18 10:00 不知起什么名字 阅读(3967) 评论(0) 推荐(1) 编辑
摘要: 解决方法:将string 通过copy函数复制到某个char[] 1. string res =“xxx”; char arr[100]; int len = res.copy(arr, 100); arr[len] = '\0'; //一定要加结束符 sendData = arr; 阅读全文
posted @ 2019-11-18 09:57 不知起什么名字 阅读(1006) 评论(0) 推荐(0) 编辑
摘要: 1. char boxData[100]; fi.mWidth = 1.0, fi.mCenter_x= 2.1, fi.mCenter_y=1.1; sprintf(boxData, ",mWidth:%f,mCenter_x:%f,mCenter_y,:%f", fi.mWidth, fi.mC 阅读全文
posted @ 2019-11-18 09:48 不知起什么名字 阅读(289) 评论(0) 推荐(0) 编辑
摘要: string Convert(float Num) { ostringstream oss; oss<<Num; string str(oss.str()); return str; } 阅读全文
posted @ 2019-11-15 17:15 不知起什么名字 阅读(5425) 评论(0) 推荐(0) 编辑
摘要: 将string类型转换为字符数组char [] char arr[50]; //数组大小根据s的大小确定 string s= "12slfjksldkfjlsfk"; int len = s.copy(arr, 50); arr[len] = '\0'; 阅读全文
posted @ 2019-11-15 15:17 不知起什么名字 阅读(783) 评论(0) 推荐(0) 编辑
摘要: string get_string(string res){ //删除换行符 int r = res.find('\r\n'); while (r != string::npos) { if (r != string::npos) { res.replace(r, 1, ""); r = res.f 阅读全文
posted @ 2019-11-14 15:32 不知起什么名字 阅读(8899) 评论(0) 推荐(0) 编辑
摘要: 1. string s = “xxx”; int a = s.find(‘x’); 如果没有匹配到,那么a = string::npos; 阅读全文
posted @ 2019-11-14 15:28 不知起什么名字 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 提示说是预编译出现问题,提示添加头文件stdafx.h,但是添加了也会继续有其他错误解决方法: 在菜单Project->Properties(或者直接快捷键Alt+F7)->C/C++->Precompile Header,设置为第一项:Not using precompile headers。 阅读全文
posted @ 2019-11-12 15:46 不知起什么名字 阅读(256) 评论(0) 推荐(0) 编辑