
学习
文章平均质量分 58
jiegemena
喜欢技术!
种瓜得果编程!
展开
-
go 并发学习-互斥锁
go 并发学习-互斥锁并发输出 inums 自增编写代码运行输出并不能正常输出使用互斥锁修改代码结果结果正常使用锁时注意上锁的资源独立函数有些时候用读写锁如果可以改为使用 channel并发输出 inums 自增编写代码package mainimport ( "fmt" "time")var inums = 0func inumadd() int { inums++ fmt.Println(inums) return inums}func test() { for {原创 2021-03-04 10:32:04 · 127 阅读 · 1 评论 -
go 通道(channel),go 线程间通信
go 通道(channel)是用来传递数据的一个数据结构。通道可用于两个 goroutine 之间通过传递一个指定类型的值来同步运行和通讯。操作符 <- 用于指定通道的方向,发送或接收。package mainimport ( "fmt" "time")var c1 = make(chan string)func input1() { i := 0 for { time.Sleep(time.Second) i++ // 发送数据 c1 <- "out原创 2020-08-21 00:35:03 · 2112 阅读 · 0 评论 -
mysql c 简单工具类
mysql c 简单工具类mysqltools.h#pragma once#include <mysql.h>#include <iostream>#include <string>#include <map>using namespace std;class MySqlTools{public: MySqlTo...原创 2020-04-08 00:17:28 · 201 阅读 · 0 评论 -
windows vscode mingw c++入门(3) 连接mysql
windows vscode mingw c++入门(3) 连接mysql自备mysql服务器,准备数据库账号密码下载mysql c库官方包https://dev.mysql.com/downloads/installer/新建目录 clib 放c++ 库main.cpp 中 #include “mysql.h”发现 报错,先创建 c_cpp_properties.json文件...原创 2020-03-29 17:29:31 · 3404 阅读 · 3 评论 -
windows vscode mingw c++入门(2)
windows vscode mingw c++入门(2)导包新建文件夹 first与 mian.cpp 同级新建文件夹 first新建两个文件q.h#pragma once // 防止重复导入void q1();q.cpp#include <iostream>using namespace std;#include "q.h"void q1(){...原创 2020-03-29 17:11:26 · 209 阅读 · 0 评论 -
windows vscode mingw c++入门(1)
windows vscode mingw c++入门(1)安装 mingw32https://osdn.net/projects/mingw/downloads/68260/mingw-get-setup.exe/刚入门就老老实实全安装mingw32把 mingw 目录 下 bin 添加到 path安装 vscodehttps://code.visualstudio.com/...原创 2020-03-29 17:06:28 · 282 阅读 · 0 评论 -
go 语法入门
go 语法循环package mainimport "fmt"func main() { i := 0 for i < 1000 { i++ fmt.Println("循环次数:", i) } /* 定义局部变量 */ var fora int = 0 /* 循环 */LOOP: if fora < 20 { /* 跳过迭代 */ for...原创 2019-10-22 18:52:17 · 255 阅读 · 0 评论 -
net core3.0 修改 web 端口
在 appsettings.json 中 添加配置“urls”: “http://*:10010”原创 2019-09-30 09:51:47 · 3021 阅读 · 1 评论 -
dotnet core web IApplicationBuilder 中间件学习
dotnet core web IApplicationBuilder 中间件学习编写一个自己的中间件的模版public static class MyApp { public static IApplicationBuilder UserMyApp(this IApplicationBuilder app) { Func&l...原创 2018-07-05 10:41:58 · 3258 阅读 · 0 评论