摘要: // 121.买卖股票的最佳时机 int maxProfit(vector<int>& prices) { int maiRu = INT32_MAX; // 买入 int maiCh = INT32_MIN; // 卖出 for (int x:prices) { maiRu = min(maiRu 阅读全文
posted @ 2021-11-10 11:03 州长在手 阅读(25) 评论(0) 推荐(0) 编辑
摘要: class MyCircularDeque { public: std::vector<int> q; const vector<int> & getV() const { return q; } } int main() { MyCircularDeque mcd(10); const std:: 阅读全文
posted @ 2021-11-04 15:35 州长在手 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 详细参考链接和解析 下面是代码: library.h 头文件 #ifndef FOURC_LIBRARY_H #define FOURC_LIBRARY_H #include <stdbool.h> #include <stdlib.h> #include <stdio.h> #define MAX 阅读全文
posted @ 2021-10-15 14:45 州长在手 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 源码传送门 2021 年了没有可以直接复制粘贴用fabric 2.2.x 简单代码?那就自己写,并且分享一下偷懒configtx.yaml配置,首先确保你搭建的联盟链channel的配置是这个样子, 这个配置文件名字叫 configtx.yaml ########################## 阅读全文
posted @ 2021-09-04 09:43 州长在手 阅读(439) 评论(1) 推荐(0) 编辑
摘要: Fastjson 是一个 Java 库,可以将 Java 对象转换为 JSON 格式,当然它也可以将 JSON 字符串转换为 Java 对象。 功能: 在不知道JSON格式的情况下,根据路径替换属性。 首先添加依赖,因为我们需要这个库。 <dependency> <groupId>com.aliba 阅读全文
posted @ 2021-03-02 10:46 州长在手 阅读(1076) 评论(1) 推荐(0) 编辑
摘要: package intermediately import ( "encoding/json" "github.com/hyperledger/fabric-protos-go/common" "github.com/hyperledger/fabric/common/tools/protolato 阅读全文
posted @ 2021-01-28 09:08 州长在手 阅读(335) 评论(1) 推荐(0) 编辑
摘要: 首先介绍一下国密算法: 其中SM1、SM4、SM7、祖冲之密码(ZUC)是对称算法;SM2、SM9是非对称算法;SM3是哈希算法。 https://gitee.com/mai12/gmca 这是学习大佬的代码写的,结合了GMCA和gmhelper,实现了证书生成,私钥SM4加密存储,再次感谢大佬们。 阅读全文
posted @ 2020-12-22 15:48 州长在手 阅读(1744) 评论(0) 推荐(0) 编辑
摘要: 简介: 搜狗公司C++服务器引擎,支撑搜狗几乎所有后端C++在线服务,包括所有搜索服务,云输入法,在线广告等,每日处理超百亿请求。这是一个设计轻盈优雅的企业级程序引擎,可以满足大多数C++后端开发需求。 使用: 第一步: 确保机器上有c++环境,安装的有gcc,cmake,CLion(非必须,但是有 阅读全文
posted @ 2020-11-10 21:38 州长在手 阅读(3053) 评论(1) 推荐(1) 编辑
摘要: 首先要安装MySQL sudo apt install -y mysql-server mysql-client libmysqlclient-dev cat /etc/mysql/debian.cnf # 获取密码 mysql -udebian-sys-maint -p # 输入上面现实的密码 u 阅读全文
posted @ 2020-09-25 15:51 州长在手 阅读(1290) 评论(0) 推荐(1) 编辑
摘要: 使用FetchContent的步骤总结起来就是: 在cmake文件写入 include(FetchContent) ,具体看完整实例 使用FetchContent_Declare(三方库) 获取项目。可以是一个URL也可以是一个Git仓库。 使用FetchContent_MakeAvailable( 阅读全文
posted @ 2020-09-04 09:30 州长在手 阅读(8026) 评论(0) 推荐(0) 编辑