06 2022 档案

摘要:package main import ( "errors" "fmt" ) type Queue struct { maxSize int array [5]int front int rear int } //添加队列 func (q *Queue) AddQueue(val int) (err 阅读全文
posted @ 2022-06-13 10:52 司砚章 阅读(40) 评论(0) 推荐(0) 编辑
摘要:login.go package main import "fmt" func login(userId int, userPwd string) (err error) { fmt.Printf("userId=%d userPwd=%s\n", userId, userPwd) return n 阅读全文
posted @ 2022-06-13 10:49 司砚章 阅读(309) 评论(0) 推荐(0) 编辑
摘要:![image](https://img2022.cnblogs.com/blog/2140721/202203/2140721-20220306095256181-1145825589.png) 阅读全文
posted @ 2022-06-13 10:48 司砚章 阅读(53) 评论(0) 推荐(0) 编辑
摘要:Redis 命令参考 Redis 命令参考 — Redis 命令参考 Set Get 字符串 package main import ( "fmt" "github.com/garyburd/redigo/redis" ) func main() { conn, err := redis.Dial( 阅读全文
posted @ 2022-06-13 10:48 司砚章 阅读(62) 评论(0) 推荐(0) 编辑
摘要:goroutine package main import ( "fmt" "strconv" "time" ) func test() { for i := 1; i <= 10; i++ { fmt.Println("test () hello world" + strconv.Itoa((i) 阅读全文
posted @ 2022-06-13 10:47 司砚章 阅读(23) 评论(0) 推荐(0) 编辑
摘要:测试之前一定要把360关闭 package demo func addUpper(n int) int { res := 0 for i := 1; i <= n-1; i++ { res += i } return res } package demo import "testing" func 阅读全文
posted @ 2022-06-13 10:47 司砚章 阅读(21) 评论(0) 推荐(0) 编辑
摘要:综合案例 package main import ( "encoding/json" "fmt" "io/ioutil" ) type Monster struct { Name string Age int Skill string } func (m *Monster) Store() bool 阅读全文
posted @ 2022-06-13 10:47 司砚章 阅读(63) 评论(0) 推荐(0) 编辑
摘要:命令行参数基本使用 package main import ( "fmt" "os" ) func main() { fmt.Println("命令行的参数有", len(os.Args)) for i, v := range os.Args { fmt.Printf("args[%v]=%v\n" 阅读全文
posted @ 2022-06-13 10:36 司砚章 阅读(152) 评论(0) 推荐(0) 编辑
摘要:JSon json数据在线解析 https://www.json.cn/ 结构体 map 切片 序列化 结构体序列化 package main import ( "encoding/json" "fmt" ) type Monster struct { Name string Age int Bir 阅读全文
posted @ 2022-06-13 10:36 司砚章 阅读(26) 评论(0) 推荐(0) 编辑
摘要:指定结构体的tag标签 package main import ( "encoding/json" "fmt" ) type Monster struct { Name string `json:"moster_name"` Age int `json:"moster_age"` Birthday 阅读全文
posted @ 2022-06-13 10:36 司砚章 阅读(131) 评论(0) 推荐(0) 编辑
摘要:将一个文件内容写入到另一个文件 package main import ( "fmt" "io/ioutil" ) func main() { file1Path := "C:/Users/pc/Desktop/1.txt" file2Path := "C:/Users/pc/Desktop/2.t 阅读全文
posted @ 2022-06-13 10:32 司砚章 阅读(16) 评论(0) 推荐(0) 编辑
摘要:协程求素数 package main import ( "fmt" "time" ) func putNum(intChan chan int) { for i := 1; i <= 8000; i++ { intChan <- i //fmt.Println("写入数据", i) } close( 阅读全文
posted @ 2022-06-13 10:32 司砚章 阅读(31) 评论(0) 推荐(0) 编辑
摘要:前言 Go 是一门简单有趣的编程语言,与其他语言一样,在使用时不免会遇到很多坑,不过它们大多不是 Go 本身的设计缺陷。如果你刚从其他语言转到 Go,那这篇文章里的坑多半会踩到。 如果花时间学习官方 doc、wiki、讨论邮件列表、 Rob Pike 的大量文章以及 Go 的源码,会发现这篇文章中的 阅读全文
posted @ 2022-06-13 10:32 司砚章 阅读(170) 评论(0) 推荐(0) 编辑
摘要:打开文件 关闭文件 package main import ( "fmt" "os" ) func main() { file, err := os.Open("C:/Users/pc/Desktop/1.txt") if err != nil { fmt.Println("err=", err) 阅读全文
posted @ 2022-06-13 10:31 司砚章 阅读(24) 评论(0) 推荐(0) 编辑
摘要:![image](https://img2022.cnblogs.com/blog/2140721/202201/2140721-20220126212628398-1107615227.png) 阅读全文
posted @ 2022-06-13 10:31 司砚章 阅读(27) 评论(0) 推荐(0) 编辑
摘要:![image](https://img2022.cnblogs.com/blog/2140721/202201/2140721-20220124195653227-524878986.png) 阅读全文
posted @ 2022-06-11 10:27 司砚章 阅读(43) 评论(0) 推荐(0) 编辑
摘要:记账软件 面向对象 main.go package main import ( "fmt" "go_code/family/utils" ) func main() { fmt.Println("这个是面向对象的方式完成~") utils.NewFamilyAccount().MainMenu() 阅读全文
posted @ 2022-06-11 10:25 司砚章 阅读(38) 评论(0) 推荐(0) 编辑
摘要:程序框架 服务器server.go package main import ( "fmt" "net" ) func process(conn net.Conn) { defer conn.Close() for { buf := make([]byte, 1024) fmt.Printf("服务器 阅读全文
posted @ 2022-06-11 10:24 司砚章 阅读(142) 评论(0) 推荐(0) 编辑
摘要:channel管道 package main import "fmt" func main() { intChan := make(chan int, 3) fmt.Printf("intChan的值%v intChan本身的地址%p\n", intChan, &intChan) intChan < 阅读全文
posted @ 2022-06-11 10:24 司砚章 阅读(19) 评论(0) 推荐(0) 编辑
摘要:反射的示意图 案例1 package main import ( "fmt" "reflect" ) func reflectTest01(b interface{}) { //通过反射获取传入变量的type kind value rTyp := reflect.TypeOf(b) fmt.Prin 阅读全文
posted @ 2022-06-11 10:23 司砚章 阅读(29) 评论(0) 推荐(0) 编辑
摘要:单链表-往最后面插入 package main import "fmt" type HeroNode struct { no int name string nickname string next *HeroNode } //在单链表之后加入 func InsertHeroNode(head *H 阅读全文
posted @ 2022-06-11 10:23 司砚章 阅读(23) 评论(0) 推荐(0) 编辑
摘要:![image](https://img2022.cnblogs.com/blog/2140721/202203/2140721-20220309111454966-82806504.png) 阅读全文
posted @ 2022-06-11 10:23 司砚章 阅读(156) 评论(0) 推荐(0) 编辑
摘要:![image](https://img2022.cnblogs.com/blog/2140721/202202/2140721-20220204221704484-1748942315.png) 阅读全文
posted @ 2022-06-11 10:21 司砚章 阅读(34) 评论(0) 推荐(0) 编辑
摘要:package main import ( "fmt" ) func main() { key := "" loop := true balance := 10000.0 count := false money := 0.0 note := "" details := "收支\t账户金额\t收支金 阅读全文
posted @ 2022-06-11 10:21 司砚章 阅读(31) 评论(0) 推荐(0) 编辑
摘要:![image](https://img2022.cnblogs.com/blog/2140721/202202/2140721-20220204091501580-1291554275.png) ![image](https://img2022.cnblogs.com/blog/2140721/202202/2140721-20220204092016034-216578758.png) ![i 阅读全文
posted @ 2022-06-11 10:21 司砚章 阅读(19) 评论(0) 推荐(0) 编辑
摘要:先创建文件夹 在一个包中设计需要引入的东西 然后进行引包 阅读全文
posted @ 2022-06-11 10:20 司砚章 阅读(43) 评论(0) 推荐(0) 编辑
摘要:model.go package model import "fmt" type person struct { Name string age int //其他包不能直接访问 sal float64 //其他包不能直接访问 } //写一个工厂模式的函数,相当于构造函数 func NewPerson 阅读全文
posted @ 2022-06-11 10:20 司砚章 阅读(108) 评论(0) 推荐(0) 编辑
摘要:1.自己写方法 package main import ( "fmt" "net/http" ) type MyHandler struct{} func (m *MyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { fmt.F 阅读全文
posted @ 2022-06-11 10:20 司砚章 阅读(214) 评论(0) 推荐(0) 编辑
摘要:创建新项目 测试: import torch import torchvision print(torch.randn(3,4)) 阅读全文
posted @ 2022-06-11 10:10 司砚章 阅读(212) 评论(0) 推荐(0) 编辑
摘要:1.设计的GUI界面为: 2.对象查看器 3.myWidget.py文件 import sys from PyQt5.QtWidgets import (QApplication, QMainWindow,QLabel, QTableWidgetItem, QAbstractItemView) fr 阅读全文
posted @ 2022-06-11 10:10 司砚章 阅读(225) 评论(0) 推荐(0) 编辑
摘要:QPainter绘图系统 paintEvent事件和绘图区 PyQt5的绘图系统使用户可以在屏幕或打印设备上用相同的API绘图,QPainter是用来进行绘图操作的类,一般的绘图设备包括QWidget、QPixmap、QImage等,这些绘图设备为QPainter提供了一个“画布”。 QWidget 阅读全文
posted @ 2022-06-11 10:10 司砚章 阅读(2038) 评论(0) 推荐(0) 编辑
摘要:本文是将PyTorch上的MNIST手写数字的识别、CNN网络 在PyCharm 上进行展示 可以看我这篇博客 PyTorch-CNN Model 关于MNIST数据集无法下载的问题 可以看我另一篇博客 PyTorch-MNIST数据集无法下载-采用手动下载的方式 在PyCharm中导入PyTorc 阅读全文
posted @ 2022-06-11 09:50 司砚章 阅读(1065) 评论(0) 推荐(0) 编辑
摘要:一、列表介绍 想一想: 字符串可以用来存储一串信息,那么想一想,怎样存储所有同学的名字呢?定义100个变量,每个变量存放一个学生的姓名可行吗?有更好的办法吗? 答:列表。 1. 列表的格式 namesList= ['xiaoWang','xiaoZhang','xiaoHua'] 比C语言的数组强大 阅读全文
posted @ 2022-06-09 09:32 司砚章 阅读(196) 评论(0) 推荐(0) 编辑
摘要:1.最大池化层算法 2.平均池化算法 3.乘幂平均池化算法 4.分数池化算法 5.自适应池化算法 6.反池化算法 阅读全文
posted @ 2022-06-09 09:30 司砚章 阅读(47) 评论(0) 推荐(0) 编辑
摘要:在命令行输入pip install jovian --upgrade 对于WARNING进行pip version更新 在命令行输入d:\python\python.exe -m pip install --upgrade pip 这样就成功啦! 阅读全文
posted @ 2022-06-09 09:29 司砚章 阅读(57) 评论(0) 推荐(0) 编辑
摘要:MNIST数据集的下载网站: http://yann.lecun.com/exdb/mnist/ 下载四个文件 放到文件夹里面 把上面的四个压缩文件放在raw里面 然后在进行下载一遍 就可以把剩下的没有下载的东西下载完成 在Pycharm中依然可以这么进行 剩下的就可以看我另外一篇博客 Pytorc 阅读全文
posted @ 2022-06-09 09:29 司砚章 阅读(2542) 评论(0) 推荐(0) 编辑
摘要:代码: def binary_search(li,val): left=0 right=len(li)-1 while left<=right: #候选区有值 mid=(left+right)//2 if li[mid]==val: return mid elif li[mid]>val:#待查找的 阅读全文
posted @ 2022-06-09 09:27 司砚章 阅读(86) 评论(0) 推荐(0) 编辑
摘要:除了使用xlrd库或者xlwt库进行对excel表格的操作读与写,而且pandas库同样支持excel的操作;且pandas操作更加简介方便。 首先是pd.read_excel的参数:函数为: pd.read_excel(io, sheetname=0,header=0,skiprows=None, 阅读全文
posted @ 2022-06-09 09:27 司砚章 阅读(5185) 评论(0) 推荐(0) 编辑
摘要:什么是 SymPy? SymPy 是一个 Python 库,允许你以符号形式计算数学对象。 要安装 SymPy,请键入: pip install sympy 现在让我们看一下 SymPy 能做的一些令人惊奇的事情! 首先导入 SymPy 提供的所有方法 from sympy import * 基本操 阅读全文
posted @ 2022-06-09 09:27 司砚章 阅读(341) 评论(0) 推荐(0) 编辑
摘要:Python将GIF图片转换成png图片帧 效果图: 转换之后保存到文件夹中: 代码如下:(第三方库pillow,安装方法:在cmd中输入: pip install pillow) from PIL import Image import os gifFileName = 'timg.gif' #使 阅读全文
posted @ 2022-06-09 09:24 司砚章 阅读(336) 评论(0) 推荐(0) 编辑
摘要:卷积层 注: 阅读全文
posted @ 2022-06-09 09:23 司砚章 阅读(25) 评论(0) 推荐(0) 编辑
摘要:参考链接 pip install 工具包到指定目录 pip install --target=D:\Python\Lib\site-packages numpy 阅读全文
posted @ 2022-06-09 09:23 司砚章 阅读(494) 评论(0) 推荐(0) 编辑
摘要:线性层 阅读全文
posted @ 2022-06-06 15:00 司砚章 阅读(25) 评论(0) 推荐(0) 编辑
摘要:cd /d D:\Project_Encyclopedia\img pyuic5 -o ui_FormHello.py FormHello.ui 阅读全文
posted @ 2022-06-06 15:00 司砚章 阅读(201) 评论(0) 推荐(0) 编辑
摘要:单引号 ' 单引号里面只能包含一个字符,默认是 rune类型(等同于int32),输出的值改会自动改为字符的ASCII值。 双引号 " 双引号里面可以是单个字符也可以是字符串,对应golang中的string类型,实际上是字符数组。可以用索引号访问某字节,也可以用len()函数来获取字符串所占的字节 阅读全文
posted @ 2022-06-06 14:59 司砚章 阅读(266) 评论(0) 推荐(0) 编辑
摘要:![image](https://img2020.cnblogs.com/blog/2140721/202110/2140721-20211007185630100-1689064757.png) 阅读全文
posted @ 2022-06-06 14:59 司砚章 阅读(34) 评论(0) 推荐(0) 编辑
摘要:![image](https://img2020.cnblogs.com/blog/2140721/202109/2140721-20210913200549035-421994360.png) ![image](https://img2020.cnblogs.com/blog/2140721/202109/2140721-20210913200626729-533731918.png) ![im 阅读全文
posted @ 2022-06-06 14:58 司砚章 阅读(73) 评论(0) 推荐(0) 编辑
摘要:![image](https://img2020.cnblogs.com/blog/2140721/202109/2140721-20210915210646431-1996179958.png) 阅读全文
posted @ 2022-06-06 14:58 司砚章 阅读(24) 评论(0) 推荐(0) 编辑
摘要:![image](https://img2020.cnblogs.com/blog/2140721/202109/2140721-20210921101620634-1876177177.png) 阅读全文
posted @ 2022-06-06 14:58 司砚章 阅读(206) 评论(0) 推荐(0) 编辑
摘要:go build 和go run两种执行流程的方式区别 阅读全文
posted @ 2022-06-06 14:57 司砚章 阅读(44) 评论(0) 推荐(0) 编辑
摘要:go.mod file not found in current directory or any parent directory; see 'go help modules' go env -w GO111MODULE=auto 阅读全文
posted @ 2022-06-06 14:57 司砚章 阅读(183) 评论(0) 推荐(0) 编辑
摘要:#查看字符编码(UTF-8) 查看字符编码(UTF-8) 阅读全文
posted @ 2022-06-06 14:57 司砚章 阅读(20) 评论(0) 推荐(0) 编辑
摘要:package main import ( "fmt" "net/http" ) //创建处理器函数 func handler(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "Hello world!", r.URL.Path) 阅读全文
posted @ 2022-06-05 17:32 司砚章 阅读(56) 评论(0) 推荐(0) 编辑
摘要:在使用pycharm时,经常会需要多行代码同时缩进、左移,pycharm提供了快捷方式 1、pycharm使多行代码同时缩进 鼠标选中多行代码后,按下Tab键,一次缩进四个字符 2、pycharm使多行代码同时左移 鼠标选中多行代码后,同时按住shift+Tab键,一次左移四个字符 阅读全文
posted @ 2022-06-05 17:32 司砚章 阅读(309) 评论(0) 推荐(0) 编辑
摘要:错误类型: ValueError: dictionary file dict.txt must be utf-8 解决方案:txt文件“另存为”设置编码格式为“utf-8” 阅读全文
posted @ 2022-06-05 17:31 司砚章 阅读(119) 评论(0) 推荐(0) 编辑
摘要:go 运行错误expected 'package', found 'EOF'解决 只要将文件保存一下,再运行就ok了 阅读全文
posted @ 2022-06-05 17:30 司砚章 阅读(919) 评论(0) 推荐(0) 编辑
摘要:![image](https://img2020.cnblogs.com/blog/2140721/202110/2140721-20211027232033842-1417225898.png) 阅读全文
posted @ 2022-06-05 17:30 司砚章 阅读(34) 评论(0) 推荐(0) 编辑
摘要:信号与槽的使用 信号与槽(Signals/Slots)是Qt编程的基础,也是Qt的一大特色。因为有了信号与槽的编程机制,在Qt中处理界面组件的交互操作时变得比较直观和简单。 信号(Signal)就是在特定情况下被发射(emit)的一种通告,例如一个PushButton按钮最常见的信号就是鼠标单击时发 阅读全文
posted @ 2022-06-05 17:30 司砚章 阅读(829) 评论(0) 推荐(0) 编辑
摘要:#Go学习方向 #Golang的产生原因 #Golang语言的特点 #VScode的安装和使用 #Windows下搭建Go开发环境-安装和配置SDk SDK的下载地址:https://golang.google.cn/dl/ 阅读全文
posted @ 2022-06-05 17:29 司砚章 阅读(64) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示