自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 收藏
  • 关注

原创 Mysql的锁。

乐观锁线程在读取数据时对读取数据不进行加锁,在准备写会数据时,会先查询原值,操作的时候比较原值是否修改,若违背其他线程修改则写回,若已被修改,则重新执行读取流程。悲观锁悲观锁从宏观的角度,就是认为你是个渣男时刻会绿她,所以时刻防止你做坏事。(意思上是在字面意义上,只要有读取数据就会加锁)...

2020-05-18 22:27:07 136

原创 gorm的自定义主外键连接

package mainimport ( "fmt" _ "github.com/go-sql-driver/mysql" "github.com/jinzhu/gorm")//type PackageManagement struct {// Name string// Age int//}//////type ListNode struct {//...

2020-04-14 15:40:47 1495

原创 容器核心技术知识点整理

容器本身就是一个进程,通过Namespace、Cgroups和rootfs组成。namespace:对容器进行隔离,让他活在自己的世界 cgroups:在linux内核提供的一种可以限制单个进程的或者多个进程所使用资源的限制。 rootfs: 文件系统隔离,生产的镜像就是为容器提供的文件系统的根文件系统1. NamespaceNamespace是Linux内核从版本2.4.19开始陆...

2020-04-01 10:58:10 415

原创 基于Golang编写的词法分析

package mainimport ( "bufio" "fmt" "io" "os")var key = make(map[string]int)var ( FileName = "main.cpp" InputFile *os.File InputError error status = false)//初始化...

2019-11-17 23:04:26 656 2

原创 y=ax+b最小二乘c++实现

#include<iostream>#include<vector>typedef std::vector<std::vector<double>> Matrix;typedef std::vector<double> Line;Matrix getLsf(Matrix A, Matrix B);Matrix T(Matri...

2019-08-03 17:03:32 1241

原创 c++ socket 入门练手

#include<iostream>#include "winsock2.h"#pragma comment(lib,"ws2_32.lib")using namespace std;int main(){ int RetVal; WORD SocketVersion = MAKEWORD(2, 2); WSADATA wsd; if (WSAStartup(Soc...

2019-05-31 22:15:13 336

原创 八数码非优化版本的A*算法

#include<iostream>#include<queue>#include<cmath>#include<string>#include<utility>#include<vector>#include<time.h>#include<set>#include<map&g...

2019-05-19 16:12:06 159

原创 cifar的图像分类

import os#图像读取库from PIL import Image#矩阵运算库import numpy as npimport kerasfrom keras.layers import Dense,Dropout,Flattenfrom sklearn.preprocessing import LabelEncoderfrom keras.utils import np_...

2019-05-18 01:06:33 542

原创 VS2019+Opencv4.0+Win10配置

一.下载OpenCV4.0的安装文件:OpenCV官网然后安装到你想要的地方二.添加到Path里面:并且把文件opencv_world400.dll和opencv_world400d.dll文件复制到C:\Windows\SysWOW64这个文件夹;三.配置Vs2019环境(OpenCV4.0只能用x64配置)1.在把opencv的include添加到Inc...

2019-04-08 18:14:12 6959 8

原创 Win10系统安装Torch的方法

我选择的是Win10+Cuda9.0+Python3.7的安装conda install pytorch torchvision cudatoolkit=9.0 -c pytorch如果想选择pip3下载的话pip3 install https://download.pytorch.org/whl/cu90/torch-1.0.1-cp37-cp37m-win_amd64.whl...

2019-04-01 22:38:38 3916 2

原创 线段树

#include<iostream>const int MAX_LEN = 1000;void build_tree(int arr[], int tree[], int node, int start, int end) { if (start == end) { tree[node] = arr[start]; } else { int ...

2019-03-26 11:08:05 97

原创 Python用matplotlib绘制3D图片

from matplotlib import pyplot as pltimport numpy as npfrom mpl_toolkits.mplot3d import Axes3Ddef gauss(x, y, c1, c2): return np.exp(-1 * ((x - c1) ** 2 + (y - c2) ** 2) / 2)fig = plt.figure...

2019-03-15 12:23:21 806

原创 golang的append

package mainimport "fmt"func main(){ a:=make([]int,1) fmt.Println(a) a=append(a,2)//len=2,cap=2 fmt.Println(a) a=append(a,3)//len=3,cap=4 b:=append(a,4)//len=4,cap=4 a=append(a,3)//len=4,c...

2018-08-31 22:44:07 1405

原创 判断链表是否有闭环,并且出现了,得到闭环位置

用快慢指针判断是否有;慢指针每次都slow=slow-&gt;next;而快指针每次都quick=quick-&gt;next-&gt;next;如果slow==quick;则得到有闭环存在着;设x为在闭环里面走的步数,c为闭环的长度,a链表头部到闭环入口点假设慢指针走的步数为slow=x+m*c+a假设快指针走的步数为quick=x+n*c+a又因为2*slow=...

2018-07-17 11:47:30 3909

原创 简单用golang实现链表

package mainimport "fmt"type Node struct{ key interface{} next *Node}type Link struct { root *Node}type linkMethod interface { addValue(value interface{}) findValue(value interface{})*N...

2018-07-16 13:49:52 503

原创 快排写法

#include&lt;algorithm&gt;#include&lt;functional&gt;void f(int start, int end, int *num) { if (start &gt;= end)return; int point = start; for (int i = start; i &lt; end; i++) { if (point == -1 &...

2018-05-18 00:52:49 224

原创 POJ 1837-Balance

http://blog.csdn.net/lyy289065406/article/details/6648094(参考此人代码和思路)#include &lt;iostream&gt; #include &lt;cstdio&gt; #include &lt;cstring&gt;using namespace std;int weightNum;int hookNum;in...

2018-03-10 11:24:08 159

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除