上一页 1 2 3 4 5 6 7 ··· 44 下一页
摘要: 任意一个对2的n次方的数求余,可以优化为 任意数 & (2^n-1),从累除法优化为位运算 阅读全文
posted @ 2023-03-18 13:52 ty1539 阅读(56) 评论(0) 推荐(0) 编辑
摘要: import re a = 'sadf.4.555.asdf.123sadf.sadf' b = re.sub(r"\.([0-9a-zA-Z]+)\.[0-9a-zA-Z]+$", "-你好啊时间-\g<1>", a) ##2, 批量修改文件 #_*_ encoding: utf-8 _*_ @a 阅读全文
posted @ 2023-03-15 23:19 ty1539 阅读(88) 评论(0) 推荐(0) 编辑
摘要: https://www.jianshu.com/p/31cdfd6f5a48 https://www.cnblogs.com/lojunren/p/3856290.html http://cenalulu.github.io/python/gil-in-python/ https://www.jia 阅读全文
posted @ 2023-03-14 17:38 ty1539 阅读(17) 评论(0) 推荐(0) 编辑
摘要: package main import "fmt" func MapKeys[K comparable, V any](m map[K]V) []K { r := make([]K, 0, len(m)) fmt.Printf("001%v,%T\n", r, r) for k := range m 阅读全文
posted @ 2023-03-13 20:32 ty1539 阅读(16) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/wql025/p/14439071.html 阅读全文
posted @ 2023-03-13 18:56 ty1539 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 1, 间隔5的 package main import ( "fmt" "reflect" ) type Author struct { Name int `json:Name` Publications []string `json:Publication,omitempty` } func ma 阅读全文
posted @ 2023-03-10 16:53 ty1539 阅读(20) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" ) //二分查找的函数 /* 二分查找的思路: 比如我们要查找的数是 findVal 1. arr是一个有序数组,并且是从小到大排序 2. 先找到 中间的下标 middle = (leftIndex + rightIndex) / 2, 然后让 阅读全文
posted @ 2023-03-06 20:11 ty1539 阅读(19) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" "math/rand" "sort" ) // 1.声明Hero结构体 type Hero struct { Name string Age int } // 2.声明一个Hero结构体切片类型 type HeroSlice []Hero // 阅读全文
posted @ 2023-03-06 19:31 ty1539 阅读(17) 评论(0) 推荐(0) 编辑
摘要: package main /* #cgo LDFLAGS: -lre2 -lcre2 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <cre2.h> */ import ( "C" "fmt" "unsafe" 阅读全文
posted @ 2023-03-04 23:54 ty1539 阅读(14) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" ) type T struct { a int } func (t T) Get() int { return t.a } func (t *T) Set(i int) { t.a = i } //表达式`T.Get`和`(*T).Set`被称 阅读全文
posted @ 2023-03-04 23:46 ty1539 阅读(11) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 44 下一页