es6获取object的keys
12data = {a: 1, b: 2}Object.keys(data)
1[a, b]
es6使用map方法改变数组中某一对象的值
@https://blog.csdn.net/m0_47531829/article/details/124753490
123456789101112131415161718192021222324const data = [ { name: "张三", age: 12, _check: true, }, { name: "李四", age: 15, _check: true, }, { name: "王五", age: 18, _check: false, },];data.map(item => { if(item._check) { item._check = false } return item})console.log(data,'data');
Linux统计文件夹下的文件数目
@https://noahsnail.com/2017/02/07/2017-02-07-Linux%E7%BB%9F%E8%AE%A1%E6%96%87%E4%BB%B6%E5%A4%B9%E4%B8%8B%E7%9A%84%E6%96%87%E4%BB%B6%E6%95%B0%E7%9B%AE/
统计当前目录下文件的个数(不包括目录)1ls -l | grep "^-" | wc -l
统计当前目录下文件的个数(包括子目录)1ls -lR| grep "^-" | wc -l
查看某目录下文件夹(目录)的个数(包括子目录)1ls -lR | grep "^d" | wc -l
python dict() 将一个list中的dict的内容转成 k-v 的格式
使用dict()函数12345678910111213141516171819list_ = [ { "id": "11", "name": "12", "other": "13" }, { "id": "21", "name": "22", "other": "23" }, { "id": "31", "name": "32", "other": "33" },]test = dict([(i["id& ...
python list 自定义排序
12345678list_ = [ {"id":1}, {"id": 3}, {"id": 2}, {"id": 4},]list_.sort(key=lambda x: x["id"])print(list_)
1[{'id': 1}, {'id': 2}, {'id': 3}, {'id': 4}]
下划线转驼峰
1res = re.sub(r'_[a-z]', lambda x: x.group(0)[1].upper(), 'SUBMIT_LEAD_FORM'.lower().capitalize())
es6 快速刪除 list 中的一個項
123456let arr = [ {id:1,value:2}, {id:2,value:3}, ....... ]arr = arr.filter(({ id }) => id !== 8);
sql中查询同一列所有值出现的次数
https://blog.csdn.net/love_java_cc/article/details/52234889
1SELECT country as 国家,COUNT(*) as 次数 FROM table3 GROUP BY country
vue3 setup 父组件向子组件传递参数、方法 && 子组件向父组件传递数据,函数
https://blog.csdn.net/qq_27517377/article/details/123163381https://blog.csdn.net/qq_27517377/article/details/123166367
vue3 setup 父组件向子组件传递参数
参数12345678910111213141516171819<template><el-row class="mb-4"> <el-button type="danger">props.vue传递父组件的参数到子组件,子组件用defineProps接收,fatherTitle和fatherMoney参数</el-button></el-row> <!--传递父组件的参数到子组件--><Son :fatherTitle="xxxxx" :fatherMoney="money" :fatherWifi="wifi" :thisIsEm ...
Fastapi中dependency的生命周期
https://bobobo80.com/2021/fastapizhong-dependencyde-sheng-ming-zhou-qi.html
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758发现问题最近使用fastapi时,出现了一个alchemysql数据库连接池的错误。超过了默认的连接池限制。按理说自己的服务只有一个人在用,应该不会出现这种问题。sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30.00 (Background on this error at: https://sqlalche.me/e/14/3o7r)联想到最近的修改是增加了一个文件下载接口,所以查到了原因,是这个接口占用了db连接池。我最开始是用了fastapi作者在full ...