C++避免vector索引超出范围 描述:该类通过重载operator[]来提供更安全的访问方式 重载operator[],并使用了std::enable_if和std::is_trivially_default_constructible来限制只有在T是默认构造的类型时才生效。 代码:1234567891011121314151617181920212223242526272829303132333435363738394041 2023-05-30 STL vector C++ STL vector
Pytorch循环神经网络LSTM时间序列预测 官方文档:https://pytorch.org/docs/stable/generated/torch.nn.LSTM.html 示例:预测某只股票未来5天的收盘价 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626 2022-11-05 Python Pytorch Python Pytorch LSTM
Jupyter Lab安装与使用 JupyterLab 官网:https://jupyterlab.readthedocs.io pip 安装:1pip install jupyterlab 生成配置文件:12# 默认配置文件生成路径:~/.jupyter/jupyter_lab_config.pyjupyter lab --generate-config 生成密码:123jupyter lad password# 输入两次密码生 2022-10-28 Jupyter Lab Jupyter Lab
STL-unordered系列容器自定义哈希函数 概述:由于在STL中,有关于hash的数据结构值针对于基础数据类型如int, string等提供了hash模板, 因此如果想要使用自定义类,那么我们需要自定义hash函数! 重写hash函数和equal_to函数1234567891011121314151617181920212223242526272829303132333435363738#include <iostream># 2022-07-04 STL unordered STL unordered
VS2019 + VMware双机内核调试驱动 准备前提:Visual Studio下载 https://visualstudio.microsoft.com/zh-hans/downloads/ Windows SDK https://developer.microsoft.com/zh-cn/windows/downloads/sdk-archive/ 下载和安装 Windows 10 WDK https://docs.microsoft. 2022-05-17 VS2019 VMware VS2019 VMware 双机调试
spdlog封装使用 使用spdlog:拉取官网spdlog代码,在项目中引入include路径(仅头文件,编译器需要支持C++11)spdlog地址:https://github.com/gabime/spdlog官方详细文档:https://github.com/gabime/spdlog/wiki 简单封装:12345678910111213141516171819202122232425262728293031 2022-05-07 spdlog spdlog
LeanCloud-Valine出现ERR_CONNECTION_REFUSED问题 问题:部分用户使用leancloud国际版域名 “https://xxxxxxxx.api.lncldglobal.com ” 会出现net::ERR_CONNECTION_REFUSED问题,可能是 DNS 劫持导致 解决办法1(客服端解决):1.先ping自己的REST API 服务器地址(xxxxx为自己AppID的前8位字符)(如果ping xxxxxxxx.api.lncldgloba 2022-04-24 LeanCloud Valine LeanCloud Valine
Clang-Tidy静态代码分析框架 描述官方文档 clang-tidy是一个基于clang的静态代码分析框架,支持C++/C/Objective-C; clang-tidy不仅可以做静态检查,还可以做一些自动修复工作。 安装clang-tidy和clang编译工具1.ubantu20安装(默认安装clang-tidy-10版本) sudo apt install clang-tidy clang 2.centos安装(只有cl 2022-03-24 Clang-Tidy Clang-Tidy
make error:relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' 问题:make时链接gflags时报错: relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC 解决办法:重新编译gflags加上 【-DCMAKE_CXX_FLAGS=-fPIC】 gi 2022-03-23 make error make error
cmake获取svn版本信息 说明通过cmake在编译阶段获取svn版本信息,并生成宏提供代码使用 获取svn信息cmake获取svn信息,并定义宏 1234567891011121314151617181920if(UNIX) # 获取svn信息,svn info 可以填相对/绝对路径或者远程地址 execute_process(COMMAND svn info http://192.168.6.124/usvn/publ 2022-03-22 cmake svn cmake svn