
问题解决
早晨的初露
性格开朗,喜欢打篮球,羽毛球。工作认真,负责。
展开
-
C++的to_string保留默认小数位的问题
C++编译环境C++ 11,使用std::to_string函数将double转化成字符串发现小数位被做四舍五入,且保留6位小数,这个问题在实际使用过程中经常遇到,必须被坑过一次,才深深留意。自己写一个转化函数,这里有一个示例供参考。如代码所示,其中,double类型的数据d在经cout输出后会保留5位小数,经函数std::to_string转化后保留6为小数;to_string_with_precision函数是实现控制精度转化成字符串函数,用到了std::ostringstream类型。原创 2023-03-09 14:52:59 · 7137 阅读 · 1 评论 -
如何在MacOS上卸载IPGuard的软件--LAgent/LSDhelper程序
在MacOS上卸载IPGuard的软件--LAgent/LSDhelper程序原创 2023-03-06 18:50:13 · 2961 阅读 · 0 评论 -
Mysql的更新数据on duplicate key update的注意事项
关于mysql的on duplicate key update的功能,解决了如下场景的问题:如果数据存在做更新,否则增加。对于使用此场景的情况,使用此功能简化对数据的更新操作,带来好多方便,如:简化代码;原创 2023-02-23 16:13:39 · 866 阅读 · 0 评论 -
关于Oracle函数INSTR使用的问题
Oracle数据库提供的工具函数instr,用于查找字符串的位置。此函数经常使用到,但使用的时候需要注意一些事项,接下来进行具体说明。首先,我们了解下函数instr,它有四个参数;source, target [, start_position] [, nth_appearance ];source为原字符串; target为要查找的字符串; start_position为开始位置,可选项; nth_appearance为匹配序号,即target第几次出现的位置...原创 2021-12-08 19:43:50 · 1663 阅读 · 0 评论 -
MacOS下python连接Oracle数据库
1. 安装cx_Oracle玩过python的同学都知道,要访问oracle数据库先要安装插件。所使用插件时cx_Oracle,通过pip安装命令:pip install cx_Oracle如果pip源存在访问问题,可以指定pip源地址,只要在上面命令加上“-i”参数并在后面跟上url地址,如下:pip install cx_Oracle -ihttp://mirrors.aliyun.com/pypi/simple/ ...原创 2021-09-03 16:26:06 · 845 阅读 · 0 评论 -
关于Java的enum枚举属性与Json字符串之间的互转
可能很多人遇到过类似的问题:Java的enum枚举属性与Json字符串之间的互转,但json字符串结果是enum枚举的名称,最简单方法是在enum枚举类中定义属性字段,在get方法上添加注解@JsonValue。如下面的示例:import com.fasterxml.jackson.annotation.JsonValue;import com.fasterxml.jackson.databind.DeserializationFeature;import com.fasterxml.jackso.原创 2021-04-30 14:54:03 · 10779 阅读 · 1 评论 -
C++的问题:comparison object must be invocable as const
最近在CentOS7上使用devtoolset-8的GCC编译代码出错,错误描述:/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/stl_set.h:133:17: required from ‘class std::set<std::weak_ptr<xxx:xxx>, xxx::xxx::SetCompare<xxx::xxx::xxx> >’/home/sources/xxx/xxx.h:27:67: ..原创 2021-03-10 11:21:07 · 5183 阅读 · 2 评论 -
C++代码编译时库libuv找不到
C++开发中使用库libuv,编译时提示“not find -llibuv”。错误描述如下:/opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: cannot find -llibuvcollect2: error: ld returned 1 exit status但我已经是从libuv的网站下载程序,网址:http://libuv.org/ 。查看目录/usr/local/lib下已经有libuv.so文件..原创 2021-03-09 13:23:57 · 2130 阅读 · 0 评论 -
C++编译找不到uuid库下‘uuid_generate’函数
最近C++开发项目中使用uuid库遇到些错误和解决方法分享:错误描述:函数uuid_generate没有申明In file included from xxx.cpp:9:xxx/uuid_util.hpp: In function ‘std::string xxx::xxx::GenerateUuid()’:xxx/uuid_util.hpp:25:12: error: aggregate ‘uuid_t guid’ has incomplete type and cannot be d原创 2021-03-09 12:17:28 · 1060 阅读 · 0 评论