optional std rvo

std::condition_variable 练习(多线程任务序列化)

#include <functional> #include <map> #include <random> #include <chrono> #include <iostream> #include <format> #include <cmath> #include <thread> #inc ......

Springboot跨域问题,options请求

# 🐋背景 在做项目的时候: 前端地址: http://127.0.0.1:8080 后端地址: http://127.0.0.1:8099 前端发送请求时,请求方法变成options,这是为什么呢? 同源策略,它是由Netscape提出的一个著名的安全策略。现在所有支持JavaScript 的浏 ......
Springboot options 问题

C++ 字符串拼接技巧(stringstream、字符串迭代器、字符串的加法运算符、std::accumulate、boost库join)

在C++中,经常需要将多个字符串拼接成一个大字符串。这个过程很容易出错,但有一些技巧可以帮助我们轻松地实现这个目标。本文将介绍一些C++中join字符串的技巧。 一、使用stringstream stringstream是一个流。使用它可以将多个字符串连接起来,然后将它们转换为一个字符串。可以使用' ......

The MySQL server is running with the LOCK_WRITE_GROWTH option so it cannot execute this statement

然后百度 参考:The MySQL server is running with the LOCK_WRITE_GROWTH option so it cannot execute this statement_冰尘s1的博客-CSDN博客 mysql报错The MySQL server is ru ......

函数指针、std::function、std::bind

# 函数指针、std::function、std::bind ## 函数指针: - C++语法中可以直接将函数名作为指针, ```cpp void fun(int a, int b); ``` 在这个函数声明中,函数指针即为`fun`,传入要被调用的地方时只需要传入`fun`就可以。 但是这个函数指 ......
指针 函数 std function bind

c++ std::hash<std::string> 字符串哈希函数

## msvc 采用了[FNV-1a](http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param)的哈希算法 ``` // 众所周知 std::string 就是一个 basic_string template struct has ......
字符串 函数 std 字符 string

Java:Optional

创建Optional对象 1. 创建一个空的Optional对象 Optional<String> empty = Optional.empty(); 使用 isPresent() 方法检查Optional对象中是否有值。 2. 创建一个Optional对象 String name = "baeld ......
Optional Java

[Vue warn]: Property or method "todoName" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option,

## 错误原因 > 先上报错截图 ![](https://img2023.cnblogs.com/blog/2942345/202308/2942345-20230806143312604-1751762480.png) 报错翻译 : ![](https://img2023.cnblogs.com/ ......
quot referenced the Property instance

双通道MIL-STD-1553B总线通讯模块

* 双通道MIL-STD-1553B总线通讯模块 * 32bi,33 MHz CPCI/PCI/总线* 每个通道为A、B双冗余总线* 单功能可设置BC/RT/BM一种工作模式* 数据传输率: 4Mbps* 支持32位时标, 时标精度0.25微秒* 软件可设詈应答超时: 0-32767µs* 大容量的 ......
总线 模块 通道 MIL-STD 通讯

std::shared_ptr 线程安全方面的思考

一直惦记着 std::shared_ptr 线程安全的问题,看了些文章后,又怕过段时间忘记了,遂记录下来 std::shared_ptr 的线程安全问题主要有以下两种: 引用计数的加减操作是否线程安全 std::shared_ptr 修改指向时是否线程安全 第一个问题的答案: 是线程安全的,因为是原 ......
线程 shared_ptr 方面 shared std

grep - useful options

The “ -c ” option counts the number of occurrences of a string: even though ABC4.sh has no matches, it still counts them and returns zero: grep –c abc ......
options useful grep

关于python的GIL的解除——PEP 703 – Making the Global Interpreter Lock Optional in CPython

PEP地址: https://peps.python.org/pep-0703/ PEP 703 – Making the Global Interpreter Lock Optional in CPython ......
Interpreter Optional CPython python Making

c++11 std::condition_variable

# std::condition_variable * 需要配合unique_lock使用,`wait(unique_lock&)` * notify_one()调用时,只有随机一个wait()线程会得到通知 * notify_all(),所有wait()线程会被通知并得到执行 * wait()调用 ......
condition_variable condition variable std 11

std::bitset 的常用函数

菜。 `flip`:反转。 `set()`:全部置 `1`。 `set(i)`:第 $i$ 位置 `1`。 `set(i, 0)`:第 $i$ 位置 `0`。 `reset`:置 `0`。 `count`:求 `1` 的个数。 `test`:返回第 $i$ 位是 `0/1`。 `any`:是否有 ` ......
函数 常用 bitset std

c++11 std::unique_lock

# std::unique_lock * 用法类似lock_guard,离开作用域后自动unlock * 定义的时候可以不需要mutex初始化,可以为空 * 可以手动调用lock(),unlock() ```cpp // unique_lock example #include // std::co ......
unique_lock unique lock std 11

让nlohmann json支持std::wstring和嵌套结构的序列化与反序列化

nlohmann json是一个star很高的C++ json解析库。 要让nlohmann json支持某个类型T,只要给这个类型T实现一个偏特化的struct adl_serializer<T>即可。adl_serializer是这个库里面针对泛型T预定义的适配器。 而嵌套结构,本身就支持的。使 ......
序列 nlohmann wstring 结构 json

GO 编程模式:FUNCTIONAL OPTIONS

在本篇文章中,我们来讨论一下Functional Options这个编程模式。这是一个函数式编程的应用案例,编程技巧也很好,是目前在Go语言中最流行的一种编程模式。但是,在我们正式讨论这个模式之前,我们需要先来看看要解决什么样的问题。 本文是全系列中第3 / 10篇:Go编程模式 Go编程模式:切片 ......
FUNCTIONAL OPTIONS 模式 GO

asp.net core之Options

本文将介绍 ASP.NET Core 中的 Options 概念和使用方法。Options 是一种配置管理机制,可以将应用程序的配置信息从代码中分离出来,提高代码的可维护性和可测试性。我们将详细介绍如何定义 Options 类、注册 Options、使用 Options,并提供相应的示例代码。此外, ......
Options core asp net

java Stream之Optional API

**摘要**:介绍Stream的容器类中 Optional 方法。 ### 综述 仰慕 Stream 流久矣,终于有机会彻底的了解其特性以及用法了,关于源码的理解还需要持续增加深度。在学习 Stream 的时候,同时认识了强大的 Optional,本文就介绍 Optional 的API。 Optio ......
Optional Stream java API

std::move和std::forward

move和forward不进行任何操作,他们只负责类型转换。 move(x)等价于 static_cast<remove_reference_t<T>&&>(x)。因为T首先被剥夺引用,因此这里不会产生引用折叠,必定返回右值。 forward(x)等价于 static_cast<T&&> (x)。因 ......
std forward move

MIL-STD-1553B总线通信模块(1553B板卡)

MIL-STD-1553B总线通信模块(1553B板卡)产品具有以下特点: 1.产品覆盖多种接口CPCI/PXI/PCI/PC104/PC104+/USB等,满足用户不同平台的使用要求; 2.自主知识产权IP核,通信速率支持1M/4M ......
板卡 1553 总线 模块 MIL-STD

std::queue 中遇到释放内存错误的问题

项目上有个需求要用到 std::queue 顺序处理消息事件 简单的示例如下: struct MyEvent { MyEvent() { event_ = CreateEvent(nullptr, 0, 0, 0); } ~MyEvent() { std::cout << "MyEvent deco ......
内存 错误 问题 queue std

c++ std::thread::joinable

# std::thread::joinable * 默认构造的thread对象 not joinable * join/detach之后 not joinable * 不能反复join/detach,会崩 * 当前线程会阻塞在join()调用处 * detach()不会阻塞当前线程,但是主进程结束后 ......
joinable thread std

std::optional 内存布局

对于`std::optional`对应的内存布局为 ```c++ struct optional_mem { int _M_payload; bool _M_engaged; }; ``` 可以通过[godbolt](https://godbolt.org "godbolt")通过pahole工具查 ......
布局 optional 内存 std

npm ERR! `perfix` is not a valid npm option

全局路径cmd命令:npm config set perfix "D:\Program Files\nodejs\node_global" 缓存路径cmd命令:npm config set cache"D:\Program Files\nodejs\node_cache" 在注册nodejs全局路径 ......
npm perfix option valid ERR

Options, Futures, and Other Derivatives (10th Edition) 作业四

Problem 17.9. A foreign currency is currently worth $1.50. The domestic and foreign risk-free interest rates are 5% and 9%, respectively. Calculate a ......
Derivatives Options Futures Edition Other

Options, Futures, and Other Derivatives (10th Edition) 作业三

Problem 13.1. A stock price is currently $40. It is known that at the end of one month it will be either $42 or $38. The risk-free interest rate is 8% ......
Derivatives Options Futures Edition Other

std::bind 详解

# bind bind 是C++ 的一个函数, 用来绑定其他函数,用来改造。 ## 1. 普通函数的bind 普通函数可以被绑定,传参。 ```cpp int add(int x, int y){ cout using std::bind; int main(){ auto f = bind(&ad ......
bind std

Ffmpeg:Could not set audio only options

在调用Ffmpeg的avformat_open_input函数时,由于设置options这个参数,然后程序立即报这个错误: [dshow @ 0000026cebd068c0] Could not set audio only options [dshow @ 0000026cebd068c0] S ......
options Ffmpeg Could audio only

std::ofstream 写本地音频

最近线上 PK 偶然出现双方主播互相听不见声音的情况,在日志不能明确体现问题时,就需要抓下主播本地的音频和远端的音频来确定数据是在哪消失的 所以我们用到一个比较简单的流写出的标准库类:std::ofstream 通过 std::ofstream 类,可以创建一个用于写入文件的输出流对象,可以将数据写 ......
ofstream 音频 std