学习
文章平均质量分 58
jiegemena
喜欢技术!
种瓜得果编程!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
go 并发学习-互斥锁
go 并发学习-互斥锁并发输出 inums 自增编写代码运行输出并不能正常输出使用互斥锁修改代码结果结果正常使用锁时注意上锁的资源独立函数有些时候用读写锁如果可以改为使用 channel 并发输出 inums 自增 编写代码 package main import ( "fmt" "time" ) var inums = 0 func inumadd() int { inums++ fmt.Println(inums) return inums } func test() { for {原创 2021-03-04 10:32:04 · 198 阅读 · 1 评论 -
go 通道(channel),go 线程间通信
go 通道(channel)是用来传递数据的一个数据结构。 通道可用于两个 goroutine 之间通过传递一个指定类型的值来同步运行和通讯。操作符 <- 用于指定通道的方向,发送或接收。 package main import ( "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 · 2229 阅读 · 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 · 248 阅读 · 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 · 3621 阅读 · 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 · 254 阅读 · 0 评论 -
windows vscode mingw c++入门(1)
windows vscode mingw c++入门(1) 安装 mingw32 https://osdn.net/projects/mingw/downloads/68260/mingw-get-setup.exe/ 刚入门就老老实实全安装 mingw32 把 mingw 目录 下 bin 添加到 path 安装 vscode https://code.visualstudio.com/...原创 2020-03-29 17:06:28 · 336 阅读 · 0 评论 -
go 语法入门
go 语法 循环 package main import "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 · 302 阅读 · 0 评论 -
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 · 3319 阅读 · 0 评论 -
net core3.0 修改 web 端口
在 appsettings.json 中 添加配置 “urls”: “http://*:10010”原创 2019-09-30 09:51:47 · 3093 阅读 · 1 评论
分享