摘要: 问题描述 在使用python的threading库时,希望如何设置最大线程数N_max 从而确保当python开启的线程数超过N_max时,将暂停程序; 直到前面的线程结束后,再开始新的线程 解决方案 import threading import time # 定义工作函数 def worker( 阅读全文
posted @ 2024-01-12 19:48 夜久听山雨 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 一、用法 v-if是Vue.js中常用的条件渲染指令,根据表达式的值来动态控制元素的显示或隐藏。具体的使用方法如下: 1.基本语法 <div v-if="condition"> <!-- content --> </div><div v-if="condition"> <!-- content -- 阅读全文
posted @ 2023-11-28 14:17 夜久听山雨 阅读(64) 评论(0) 推荐(0) 编辑
摘要: 一、在有默认(create、list、retrieve、update、destroy)接口时自定义接口 class IterationsViewSet(MyModelViewSet): queryset = uc_iterations.objects.all().order_by('id') ser 阅读全文
posted @ 2023-11-21 12:51 夜久听山雨 阅读(129) 评论(0) 推荐(0) 编辑
摘要: LOGGING = { 'version': 1, 'disable_existing_loggers': True, 'formatters': { 'verbose': { 'format': '[application] %(levelname)s %(asctime)s %(module)s 阅读全文
posted @ 2023-11-14 17:09 夜久听山雨 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 1、 使用 .split(''): split() 是一种字符串方法,可将字符串拆分为具有模式的有序列表的数组。这是一种 ES6 方法,是完成工作的最干净的方法。 Seperate string by space character(' ') * const myFavShow = 'The Off 阅读全文
posted @ 2023-10-23 16:04 夜久听山雨 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 库安装 pip3 install pymongo==3.12.2 from pymongo import MongoClient import pymongo # 连接 MongoDB(无账号密码) client = MongoClient(host='localhost',port=27017) 阅读全文
posted @ 2023-10-19 11:32 夜久听山雨 阅读(17) 评论(0) 推荐(0) 编辑
摘要: JWT主要用于用户登录鉴权,所以我们从最传统的session认证开始说起。 session认证 众所周知,http协议本身是无状态的协议,那就意味着当有用户向系统使用账户名称和密码进行用户认证之后,下一次请求还要再一次用户认证才行。因为我们不能通过http协议知道是哪个用户发出的请求,所以如果要知道 阅读全文
posted @ 2023-10-13 17:44 夜久听山雨 阅读(47) 评论(0) 推荐(0) 编辑
摘要: 一、父组件调用子组件的方法 $refs:父组件 调用 子组件的 方法 或者 属性,由父级来主导调用这里我们可以使用规则的数据结构来存储和转发。通过this.$refs.子组件名.方法(属性名)来操控子组件中的方法或者属性,如下图 父组件: <template> <div> <uuu ref='tes 阅读全文
posted @ 2023-08-07 20:33 夜久听山雨 阅读(357) 评论(0) 推荐(0) 编辑
摘要: ## 一、安装quill-editor富文本编辑器 ```bash 安装: npm install vue-quill-editor --save 安装Vue-Quill-Editor需要依赖: npm install quill --save ``` ## 二、引入 ### 1.全局引入 在mai 阅读全文
posted @ 2023-08-07 16:17 夜久听山雨 阅读(4351) 评论(0) 推荐(0) 编辑
摘要: js笔记 apollo.is_execute = apollo.is_execute ? 1 : 0; 把true或者false转化为1或者0 或者有值的时候是1,没有值的时候是0 true转化为1,为false的0 !db.execution_condition 判断为空或者为undefind ! 阅读全文
posted @ 2023-06-29 20:13 夜久听山雨 阅读(10) 评论(0) 推荐(0) 编辑