摘要: C# abp http辅助类 文件上传 鉴权请求头 阅读全文
posted @ 2023-04-25 18:16 codeIsArt 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 1、使用反射创建泛型对象 public T Method<T>(string param) { var obj = Activator.CreateInstance(typeof(T)); // 设置默认值 var col = obj.GetType().GetProperty("属性名"); if 阅读全文
posted @ 2023-03-11 11:57 codeIsArt 阅读(130) 评论(0) 推荐(0) 编辑
摘要: ef core迁移与恢复迁移 阅读全文
posted @ 2023-02-22 13:06 codeIsArt 阅读(182) 评论(0) 推荐(0) 编辑
摘要: golang // 格式化时间 t1 := time.Now().Format("2006-01-02 15:04:05") Nodejs // 时间格式化 const moment = require('moment') // 区分大小写 moment().format("YYYY-MM-DD H 阅读全文
posted @ 2022-09-27 00:04 codeIsArt 阅读(22) 评论(0) 推荐(0) 编辑
摘要: GIL GIL是Python的全局解释器锁,同一进程中假如有多个线程运行,一个线程在运行Python程序的时候会霸占Python解释器(加了一把锁即GIL),使该进程内的其他线程无法运行,等该线程运行完后其他线程才能运行。如果线程运行过程中遇到耗时操作,则解释器锁解开,使其他线程运行。所以在多线程中 阅读全文
posted @ 2022-08-27 15:45 codeIsArt 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Golang // 求2个很大数之和 func maxNumSum(a string, b string) string { size := 0 alen := len(a) blen := len(b) if alen > blen { size = alen } else { size = bl 阅读全文
posted @ 2022-08-27 15:07 codeIsArt 阅读(25) 评论(0) 推荐(0) 编辑
摘要: Golang // 断言 import ( "testing" "github.com/stretchr/testify/assert" ) func TestSomething(t *testing.T) { assert := assert.New(t) assert.Equal(1, 2, " 阅读全文
posted @ 2022-08-27 11:21 codeIsArt 阅读(43) 评论(0) 推荐(0) 编辑
摘要: Golang // https://blog.csdn.net/yyclassmvp/article/details/124942527 sum := func(x int, y int) int { return x*y } Nodejs const sum = (x, y) => x*y; Py 阅读全文
posted @ 2022-08-27 10:49 codeIsArt 阅读(6) 评论(0) 推荐(0) 编辑
摘要: Golang func warp(f func([]int) int) func([]int) int { return func(list []int) int { start := time.Now() s := f(list) end := time.Now() fmt.Println(end 阅读全文
posted @ 2022-08-27 10:42 codeIsArt 阅读(17) 评论(0) 推荐(0) 编辑
摘要: Golang func Demo(arr ...interface{}) int { for _, v := range arr { } } Nodejs function Demo(...arr) { for(const v of arr) { } } Python function Demo(l 阅读全文
posted @ 2022-08-27 10:33 codeIsArt 阅读(8) 评论(0) 推荐(0) 编辑