python: generator IDAL and DAL using sql server 2019

其它数据库也是一样的思维方式

create IDAL

# encoding: utf-8
# 版权所有 2024 ©涂聚文有限公司
# 许可信息查看:言語成了邀功盡責的功臣,還需要行爲每日來值班嗎
# 描述:
# Author    : geovindu,Geovin Du 涂聚文.
# IDE       : PyCharm 2023.1 python 3.11
# OS        : windows 10
# Datetime  : 2024/11/18 21:10
# User      : geovindu
# Product   : PyCharm
# Project   : pyGenerator
# File      : SqlServerGenerator/createInterface.py
# explain   : 学习
import os
import re
import sys
import io
import datetime
from common.fileHelper import FileHelper
from common.strHelper import StrHelper
from bll.tableNameAndKey import TableNameAndKeyBll
from bll.tableForegin import TableForeginBll
from bll.tableModel import TableModelBllclass CreateInterface(object):""""""def __init__(self):self.__modelpath = os.path.join(os.getcwd() + "/test/interface/")self.__file = FileHelper()self.__blltablekey = TableNameAndKeyBll()self.__database = "sql server 2019"self.__name = "CreateInterface"passdef __del__(self):""":return:"""print(f"{self.__name} ERASE MEMORY")def addpackagefile(self):"""生成包配置文件:return:"""now = datetime.datetime.now()bll = TableNameAndKeyBll()sb = []sbt = f"""
# encoding: utf-8
# 版权所有 2024 ©涂聚文有限公司
# 许可信息查看:言語成了邀功盡責的功臣,還需要行爲每日來值班嗎
# 描述:
# Author    : geovindu,Geovin Du 涂聚文.
# IDE       : PyCharm 2023.1 python 3.11
# OS        : windows 10
# Datetime  : {now.strftime('%Y-%m-%d %H:%M:%S')}
# database  :{self.__database}
# User      : geovindu
# Product   : PyCharm
# Project   : IctGame
# File      : interface/__init__.py
# explain   : 学习"""sb.append(sbt)for li in bll.selectSql():sbp=f"""
from interface.{StrHelper.firstLower(li.TableName)} import I{li.TableName}
"""sb.append(sbp)if not os.path.exists(self.__modelpath):os.makedirs(self.__modelpath)filepath = self.__modelpath + '__init__.py'content = ''.join(sb)ok = self.__file.createModelFile(filepath, content)def add(self):"""生成实体:return:"""# fileHelper=FileHelper()now = datetime.datetime.now()bll = TableNameAndKeyBll()for li in bll.selectSql():sb = []sbt = f"""
# encoding: utf-8
# 版权所有 2024 ©涂聚文有限公司
# 许可信息查看:言語成了邀功盡責的功臣,還需要行爲每日來值班嗎
# 描述:
# Author    : geovindu,Geovin Du 涂聚文.
# IDE       : PyCharm 2023.1 python 3.11
# OS        : windows 10
# Datetime  : {now.strftime('%Y-%m-%d %H:%M:%S')}
# database  :{self.__database}
# User      : geovindu
# Product   : PyCharm
# Project   : IctGame
# File      : interface/{li.TableName}.py
# explain   : 学习
from __future__ import annotations
from abc import ABC, abstractmethod
import os
import sys
from model.{StrHelper.firstLower(li.TableName)} import {li.TableName}Infoclass I{li.TableName}(ABC):\"""{li.TableDescription}                   \"""
"""sb.append(sbt)tbll = TableModelBll()sinhead = f"""@classmethoddef __subclasshook__(cls, subclass):return (hasattr(subclass, 'load_data_source') andcallable(subclass.load_data_source) andhasattr(subclass, 'extract_text') andcallable(subclass.extract_text) orNotImplemented) @abstractmethoddef selectSql(cls) -> list:\""":return:\"""pass@abstractmethoddef selectSqlCount(cls) -> list:\"""查询数据 总数:return:\"""pass@abstractmethoddef selectSqlOrder(cls, order: str) -> list:\""":param order::return:\"""pass@abstractmethoddef selectSort(cls,field:str,isOrder:bool)->list:\""":param field:param order:  desc/asc:return:\"""pass@abstractmethoddef selectIdSql(cls, {StrHelper.firstLower(li.FieldName)}: str):\""":param {li.FieldName}::return:\"""pass@abstractmethoddef selectProc(cls):\""":return:\"""pass@abstractmethoddef selectIdProc(cls, {StrHelper.firstLower(li.FieldName)}):\""":param {li.FieldName}::return:\"""pass@abstractmethoddef addSql(cls, info: {li.TableName}Info):\""":param info::return:\"""pass@abstractmethoddef addProc(cls, info: {li.TableName}Info):\""":param info::return:\"""pass@abstractmethoddef addOutProc(cls, info: {li.TableName}Info):\""":param info::return:\"""pass@abstractmethoddef editSql(cls, info: {li.TableName}Info):\""":param info::return:\"""pass@abstractmethoddef editProc(cls, info: {li.TableName}Info):\""":param info::return:\"""pass@abstractmethoddef delSql(cls, {StrHelper.firstLower(li.FieldName)}):\""":param {li.FieldName}::return:\"""pass@abstractmethoddef delProc(cls, {StrHelper.firstLower(li.FieldName)}):\""":param {li.FieldName}::return:\"""pass              """sb.append(sinhead)if not os.path.exists(self.__modelpath):os.makedirs(self.__modelpath)filepath = self.__modelpath + StrHelper.firstLower(li.TableName) + '.py'content = ''.join(sb)ok = self.__file.createModelFile(filepath, content)

create DAL 

# encoding: utf-8
# 版权所有 2024 ©涂聚文有限公司
# 许可信息查看:言語成了邀功盡責的功臣,還需要行爲每日來值班嗎
# 描述:
# Author    : geovindu,Geovin Du 涂聚文.
# IDE       : PyCharm 2023.1 python 3.11
# OS        : windows 10
# Datetime  : 2024/11/18 21:10
# User      : geovindu
# Product   : PyCharm
# Project   : pyGenerator
# File      : SqlServerGenerator/createDal.py
# explain   : 学习
import os
import re
import sys
import io
import datetime
from common.fileHelper import FileHelper
from common.strHelper import StrHelper
from bll.tableNameAndKey import TableNameAndKeyBll
from bll.tableForegin import TableForeginBll
from bll.tableModel import TableModelBllclass CreateDal(object):""""""def __init__(self):self.__modelpath = os.path.join(os.getcwd() + "/test/dal/")self.__file = FileHelper()self.__blltablekey = TableNameAndKeyBll()self.__bllTableModel = TableModelBll()self.__database = "sql server 2019"self.__name = "CreateDal"passdef __del__(self):""":return:"""print(f"{self.__name} ERASE MEMORY")def getColumn(self,tableName:str) -> str:"""column=("SchoolId","SchoolName","SchoolTelNo"):return:"""tables = self.__bllTableModel.selectSql(tableName)columns = []columnstr = '('if len(tables) > 0:for obj in tables:columns.append("\""+obj.FieldName+"\"")columnstr =columnstr + ','.join(columns)return columnstr+')'def getVales(self,tableName:str) -> str:"""egs:vales=[info.SchoolId,info.SchoolName,info.SchoolTelNo]:return:"""vales = []valesstr = '['tables = self.__bllTableModel.selectSql(tableName)if len(tables)>0:for obj in tables:vales.append('info.'+obj.FieldName)valesstr = valesstr+','.join(vales)return valesstr + ']'def getArgs(self,tableName:str) -> str:"""egs:args = [info.SchoolId,info.SchoolName,info.SchoolTelNo] #修改的args ={{"schoolId":f"{{info.schoolId}}","SchoolName":f"{{info.SchoolName}}","SchoolTelNo":f"{{info.SchoolTelNo}}"}}:return:"""args = []argsstr = '['tables = self.__bllTableModel.selectSql(tableName)if len(tables)>0:for obj in tables:args.append('info.'+obj.FieldName)argsstr =argsstr+ ','.join(args)return argsstr+']'def getArgs(self,tableName:str) -> str:"""egs:args = [info.SchoolId,info.SchoolName,info.SchoolTelNo] #修改的:return:"""args = []argsstr = '['tables = self.__bllTableModel.selectSql(tableName)if len(tables)>0:for obj in tables:args.append('info.'+obj.FieldName)argsstr = argsstr+','.join(args)return argsstr+']'def getArgsVariable(self,tableName:str) -> str:"""egs:args ={"schoolId":f"{{info.schoolId}}","SchoolName":f"{{info.SchoolName}}","SchoolTelNo":f"{{info.SchoolTelNo}}"}}:return:"""args = []argsstr = '{'tables = self.__bllTableModel.selectSql(tableName)if len(tables)>0:for obj in tables:args.append("\""+obj.FieldName+"\":f\"{info."+obj.FieldName+"}\"")argsstr =argsstr+ ','.join(args)return argsstr+'}'def getArgsOut(self,tableName:str, primekey:str) -> str:"""egs:args = [info.SchoolName, info.SchoolTelNo,outid]   #添加返回值:return:"""args = []argsstr = '['tables = self.__bllTableModel.selectSql(tableName)if len(tables)>0:for obj in tables:if str(obj.FieldName).lower() != primekey.lower():args.append('info.'+obj.FieldName)argsstr = argsstr+','.join(args)return argsstr+',out'+primekey+']'def addpackagefile(self):"""生成包配置文件:return:"""now = datetime.datetime.now()bll = TableNameAndKeyBll()sb = []sbt = f"""
# encoding: utf-8
# 版权所有 2024 ©涂聚文有限公司
# 许可信息查看:言語成了邀功盡責的功臣,還需要行爲每日來值班嗎
# 描述:
# Author    : geovindu,Geovin Du 涂聚文.
# IDE       : PyCharm 2023.1 python 3.11
# OS        : windows 10
# Datetime  : {now.strftime('%Y-%m-%d %H:%M:%S')}
# database  :{self.__database}
# User      : geovindu
# Product   : PyCharm
# Project   : IctGame
# File      : dal/__init__.py
# explain   : 学习"""sb.append(sbt)for li in bll.selectSql():sbp=f"""
from dal.{StrHelper.firstLower(li.TableName)} import {li.TableName}Dal
"""sb.append(sbp)if not os.path.exists(self.__modelpath):os.makedirs(self.__modelpath)filepath = self.__modelpath + '__init__.py'content = ''.join(sb)ok = self.__file.createModelFile(filepath, content)def add(self):"""生成实体:return:"""# fileHelper=FileHelper()now = datetime.datetime.now()bll = TableNameAndKeyBll()for li in bll.selectSql():sb = []sbt = f"""
# encoding: utf-8
# 版权所有 2024 ©涂聚文有限公司
# 许可信息查看:言語成了邀功盡責的功臣,還需要行爲每日來值班嗎
# 描述:
# Author    : geovindu,Geovin Du 涂聚文.
# IDE       : PyCharm 2023.1 python 3.11
# OS        : windows 10
# Datetime  : {now.strftime('%Y-%m-%d %H:%M:%S')}
# database  :{self.__database}
# User      : geovindu
# Product   : PyCharm
# Project   : IctGame
# File      : dal/{li.TableName}.py
# explain   : 学习
from __future__ import annotations
from abc import ABC, abstractmethod
import os
import sys
from model.{StrHelper.firstLower(li.TableName)} import {li.TableName}Info
from DBUtility.MsSQLHelper import MsSqlHelper
from interface.{StrHelper.firstLower(li.TableName)} import I{li.TableName}class {li.TableName}Dal(I{li.TableName}):\"""{li.TableDescription}                   \"""
"""sb.append(sbt)sinhead = f"""myms = MsSqlHelper()def __init__(self):\"""构造函数,方法:param strserver::param struser::param strpwd::param strdatabase:\"""self._strserver = ""self._struser = ""self._strpwd = ""self._strdatabase =""def selectSql(cls)->list:\"""查询数据 self._strserver, self._struser, self._strpwd, self._strdatabase:return:\"""row=cls.myms.execute("select * from {li.TableName};")#cls.myms.close()return rowdef selectSqlCount(cls)->list:\"""查询数据 总数:return:\"""row=cls.myms.execute("select count(*) as total from {li.TableName};")#cls.myms.close()return row[0]def selectSqlOrder(cls,order:str)->list:\""":param order:  SchoolId desc/asc:return:\"""students=[]strsql=f"select * from {li.TableName} order by {{order}};"row=cls.myms.execute(f"select * from {li.TableName} order by {{order}};")return rowdef selectSort(cls,field:str,isOrder:bool)->list:\""":param field {li.FieldName}:param order:  desc/asc:return:\"""order='desc'if isOrder==True:order='desc'else:order='asc'strsql=f"select * from {li.TableName} order by {{field}} {{order}};"row=cls.myms.execute(f"select * from {li.TableName} order by {{field}} {{order}};")#cls.myms.close()return rowdef selectIdSql(cls,{li.FieldName}:str)->list:\""":param {li.FieldName}: 主键ID:return:\"""row=cls.myms.execute(f"select * from {li.TableName} where SchoolId='{{SchoolId}}';")  #考虑数据类型#cls.myms.close()return rowdef selectProc(cls)->list:\"""存储过程:return:\"""args = ()row = cls.myms.executeCallProc("procSelect{li.TableName}All",args)return rowdef selectIdProc(cls,{li.FieldName}:str)->list:\"""存储过程:param {li.FieldName}: 主键ID:return:\"""args = ({li.FieldName},)row = cls.myms.executeCallProc('procSelect{li.TableName}', args)return rowdef addSql(cls,info:{li.TableName}Info)->int:\"""添加,要考虑添加返回ID值:param info:实体类:return:\"""column={self.getColumn(li.TableName)}vales={self.getVales(li.TableName)}return cls.myms.insertByColumnaAndValues("{li.TableName}",column,vales)def addProc(cls,info:{li.TableName}Info)->int:\"""添加,要考虑添加返回ID值:param info:实体类:return:\"""args={self.getArgs(li.TableName)}return cls.myms.insertCallProc("procInsert{li.TableName}",args)def addOutProc(cls,info:{li.TableName}Info) -> int:\"""添加,要考虑添加返回ID值:param info:实体类:return: 返回增加的ID\"""id = 0try:outid =('int',) #输出,元组类型print(info)args = {self.getArgsOut(li.TableName,li.FieldName)}print(args)result=cls.myms.insertOutCallProc("procInsert{li.TableName}Output", args)print(result)id = resultexcept Exception as ex:print(ex)return iddef editSql(cls,info:{li.TableName}Info)->int:\""":param info:实体类:return:\"""args = {self.getArgsVariable(li.TableName)}where = f"{li.FieldName}={{info.{li.FieldName}}}" ##print(args,where)return cls.myms.updateByKeyValues("{li.TableName}",where,args)def editProc(cls, info: {li.TableName}Info)->int:\""":param info: 实体类:return:\"""args = {self.getArgs(li.TableName)}return cls.myms.updateProc("procUpdate{li.TableName}",args)def delSql(cls,{li.FieldName}:str)->int:\"""sql语句删除:param {li.FieldName}: 主键ID:return:\"""where={{f"{li.FieldName}":{li.FieldName}}}return cls.myms.deleteByKeyValues("{li.TableName}",where)def delProc(cls, {li.FieldName}:str)->int:\"""删除 存储过程 删除多个ID,后面增加:param {li.FieldName}: 主键ID:return:\"""args ={li.FieldName}k=cls.myms.deleteProc("procDuDelete{li.TableName}", args)return k           
"""sb.append(sinhead)if not os.path.exists(self.__modelpath):os.makedirs(self.__modelpath)filepath = self.__modelpath + StrHelper.firstLower(li.TableName) + '.py'content = ''.join(sb)ok = self.__file.createModelFile(filepath, content)

生成的代码:

# encoding: utf-8
# 版权所有 2024 ©涂聚文有限公司
# 许可信息查看:言語成了邀功盡責的功臣,還需要行爲每日來值班嗎
# 描述:
# Author    : geovindu,Geovin Du 涂聚文.
# IDE       : PyCharm 2023.1 python 3.11
# OS        : windows 10
# Datetime  : 2024-11-19 21:12:32
# database  :sql server 2019
# User      : geovindu
# Product   : PyCharm
# Project   : IctGame
# File      : interface/School.py
# explain   : 学习
from __future__ import annotations
from abc import ABC, abstractmethod
import os
import sys
from model.school import SchoolInfoclass ISchool(ABC):"""学校表                   """@classmethoddef __subclasshook__(cls, subclass):return (hasattr(subclass, 'load_data_source') andcallable(subclass.load_data_source) andhasattr(subclass, 'extract_text') andcallable(subclass.extract_text) orNotImplemented) @abstractmethoddef selectSql(cls) -> list:""":return:"""pass@abstractmethoddef selectSqlCount(cls) -> list:"""查询数据 总数:return:"""pass@abstractmethoddef selectSqlOrder(cls, order: str) -> list:""":param order::return:"""pass@abstractmethoddef selectSort(cls,field:str,isOrder:bool)->list:""":param field:param order:  desc/asc:return:"""pass@abstractmethoddef selectIdSql(cls, schoolId: str):""":param SchoolId::return:"""pass@abstractmethoddef selectProc(cls):""":return:"""pass@abstractmethoddef selectIdProc(cls, schoolId):""":param SchoolId::return:"""pass@abstractmethoddef addSql(cls, info: SchoolInfo):""":param info::return:"""pass@abstractmethoddef addProc(cls, info: SchoolInfo):""":param info::return:"""pass@abstractmethoddef addOutProc(cls, info: SchoolInfo):""":param info::return:"""pass@abstractmethoddef editSql(cls, info: SchoolInfo):""":param info::return:"""pass@abstractmethoddef editProc(cls, info: SchoolInfo):""":param info::return:"""pass@abstractmethoddef delSql(cls, schoolId):""":param SchoolId::return:"""pass@abstractmethoddef delProc(cls, schoolId):""":param SchoolId::return:"""pass              

# encoding: utf-8
# 版权所有 2024 ©涂聚文有限公司
# 许可信息查看:言語成了邀功盡責的功臣,還需要行爲每日來值班嗎
# 描述:
# Author    : geovindu,Geovin Du 涂聚文.
# IDE       : PyCharm 2023.1 python 3.11
# OS        : windows 10
# Datetime  : 2024-11-19 21:12:32
# database  :sql server 2019
# User      : geovindu
# Product   : PyCharm
# Project   : IctGame
# File      : dal/School.py
# explain   : 学习
from __future__ import annotations
from abc import ABC, abstractmethod
import os
import sys
from model.school import SchoolInfo
from DBUtility.MsSQLHelper import MsSqlHelper
from interface.school import ISchoolclass SchoolDal(ISchool):"""学校表                   """myms = MsSqlHelper()def __init__(self):"""构造函数,方法:param strserver::param struser::param strpwd::param strdatabase:"""self._strserver = ""self._struser = ""self._strpwd = ""self._strdatabase =""def selectSql(cls)->list:"""查询数据 self._strserver, self._struser, self._strpwd, self._strdatabase:return:"""row=cls.myms.execute("select * from School;")#cls.myms.close()return rowdef selectSqlCount(cls)->list:"""查询数据 总数:return:"""row=cls.myms.execute("select count(*) as total from School;")#cls.myms.close()return row[0]def selectSqlOrder(cls,order:str)->list:""":param order:  SchoolId desc/asc:return:"""students=[]strsql=f"select * from School order by {order};"row=cls.myms.execute(f"select * from School order by {order};")return rowdef selectSort(cls,field:str,isOrder:bool)->list:""":param field SchoolId:param order:  desc/asc:return:"""order='desc'if isOrder==True:order='desc'else:order='asc'strsql=f"select * from School order by {field} {order};"row=cls.myms.execute(f"select * from School order by {field} {order};")#cls.myms.close()return rowdef selectIdSql(cls,SchoolId:str)->list:""":param SchoolId: 主键ID:return:"""row=cls.myms.execute(f"select * from School where SchoolId='{SchoolId}';")  #考虑数据类型#cls.myms.close()return rowdef selectProc(cls)->list:"""存储过程:return:"""args = ()row = cls.myms.executeCallProc("procSelectSchoolAll",args)return rowdef selectIdProc(cls,SchoolId:str)->list:"""存储过程:param SchoolId: 主键ID:return:"""args = (SchoolId,)row = cls.myms.executeCallProc('procSelectSchool', args)return rowdef addSql(cls,info:SchoolInfo)->int:"""添加,要考虑添加返回ID值:param info:实体类:return:"""column=("SchoolId","SchoolName","SchoolTelNo")vales=[info.SchoolId,info.SchoolName,info.SchoolTelNo]return cls.myms.insertByColumnaAndValues("School",column,vales)def addProc(cls,info:SchoolInfo)->int:"""添加,要考虑添加返回ID值:param info:实体类:return:"""args=[info.SchoolId,info.SchoolName,info.SchoolTelNo]return cls.myms.insertCallProc("procInsertSchool",args)def addOutProc(cls,info:SchoolInfo) -> int:"""添加,要考虑添加返回ID值:param info:实体类:return: 返回增加的ID"""id = 0try:outid =('int',) #输出,元组类型print(info)args = [info.SchoolName,info.SchoolTelNo,outSchoolId]print(args)result=cls.myms.insertOutCallProc("procInsertSchoolOutput", args)print(result)id = resultexcept Exception as ex:print(ex)return iddef editSql(cls,info:SchoolInfo)->int:""":param info:实体类:return:"""args = {"SchoolId":f"{info.SchoolId}","SchoolName":f"{info.SchoolName}","SchoolTelNo":f"{info.SchoolTelNo}"}where = f"SchoolId={info.SchoolId}" ##print(args,where)return cls.myms.updateByKeyValues("School",where,args)def editProc(cls, info: SchoolInfo)->int:""":param info: 实体类:return:"""args = [info.SchoolId,info.SchoolName,info.SchoolTelNo]return cls.myms.updateProc("procUpdateSchool",args)def delSql(cls,SchoolId:str)->int:"""sql语句删除:param SchoolId: 主键ID:return:"""where={f"SchoolId":SchoolId}return cls.myms.deleteByKeyValues("School",where)def delProc(cls, SchoolId:str)->int:"""删除 存储过程 删除多个ID,后面增加:param SchoolId: 主键ID:return:"""args =SchoolIdk=cls.myms.deleteProc("procDuDeleteSchool", args)return k           

拼就是一个粗放的项目

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/474816.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

鲸鱼机器人和乐高机器人的比较

鲸鱼机器人和乐高机器人各有其独特的优势和特点,家长在选择时可以根据孩子的年龄、兴趣、经济能力等因素进行综合考虑,选择最适合孩子的教育机器人产品。 优势 鲸鱼机器人 1)价格亲民:鲸鱼机器人的产品价格相对乐高更为亲民&…

探究IOC容器刷新环节初始化前的预处理

目录 一、IOC容器的刷新环节快速回顾 二、初始化前的预处理prepareRefresh源码分析 三、初始化属性源 (一)GenericWebApplicationContext初始化属性源 (二)StaticWebApplicationContext初始化属性源 四、初始化早期事件集合…

【Java SE】PreparedStatement

PreparedStatement 是一个接口,它继承自 Statement,用于预编译 SQL 语句。简单来说,PreparedStatement 是 JDBC 提供的一个对象,用于执行 SQL 语句。它的重要功能是帮助防止 SQL 注入攻击,并提高执行效率。 SQL 注入问…

集群聊天服务器(7)数据模块

目录 Mysql数据库代码封装头文件与源文件 Mysql数据库代码封装 业务层代码不要直接写数据库,因为业务层和数据层的代码逻辑也想完全区分开。万一不想存储mysql,想存redis的话,就要改动大量业务代码。解耦合就是改起来很方便。 首先需要安装m…

数造科技亮相第26届高交会并接受媒体采访,以数据智能赋能未来

11 月 14 日至 16 日,第二十六届中国国际高新技术成果交易会(简称“高交会”)在深圳成功举办。本届大会以“科技引领发展,产业融合聚变”为主题,汇聚了全球最新的科技成果,打造了一场科技界的盛大聚会。 在…

C#获取视频第一帧_腾讯云媒体处理获取视频第一帧

一、 使用步骤: 第一步、腾讯云开启万象 第二步、安装Tencent.QCloud.Cos.Sdk 包 第三步、修改 腾讯云配置 图片存储目录配置 第四步、执行获取图片并保存 二、封装代码 using System.Text; using System.Threading.Tasks;using COSXML.Model.CI; using COSXML.A…

概念解读|K8s/容器云/裸金属/云原生...这些都有什么区别?

随着容器技术的日渐成熟,不少企业用户都对应用系统开展了容器化改造。而在容器基础架构层面,很多运维人员都更熟悉虚拟化环境,对“容器圈”的各种概念容易混淆:容器就是 Kubernetes 吗?容器云又是什么?容器…

吴恩达深度学习笔记:序列模型(Sequence Models) 1.3-1.4

目录 第五门课 序列模型(Sequence Models)第一周 循环序列模型(Recurrent Neural Networks)1.3 循环神经网络模型(Recurrent Neural Network Model)1.4 通过时间的反向传播(Backpropagation through time) …

语义分割(semantic segmentation)

语义分割(semantic segmentation) 文章目录 语义分割(semantic segmentation)图像分割和实例分割代码实现 语义分割指将图片中的每个像素分类到对应的类别,语义区域的标注和预测是 像素级的,语义分割标注的像素级的边界框显然更加精细。应用&#xff1a…

C++ —— string类(上)

目录 string的介绍 string类功能的使用介绍 constructor —— 构造 介绍使用(1)(2)(4) :构造、拷贝构造、带参构造 介绍(3):拷贝string类对象的一部分字符…

Python小白学习教程从入门到入坑------第三十二课 生成器(语法进阶)

目录 一、生成器 generator 1.1 生成器表达式 1.1.1 表达式一 1.1.2 表达式二 二、可迭代对象、迭代器、生成器三者之间的关系 2.1 定义与特性 2.2 关系与区别 一、生成器 generator 在Python中,生成器(Generators)是一种用于迭代对象…

商业iOS端路由架构演进

背景 目前商业SDK中的点击事件,会根据不同的「事件类型」「业务类型」,去执行不同的路由跳转逻辑,然而不同的跳转事件内部又有着很复杂的跳转逻辑, 痛点 不同的跳转逻辑之间存在耦合 例如,在deeplink的跳转逻辑之中…

数据结构(单向链表——c语言实现)

链式存储的优缺点: 优点: 1、动态分配内存: 链式存储不需要在数据插入之前分配固定大小的数组或内存块,因此它更适合存储动态变化的数据 2、高效的插入和删除操作: 在链表中插入或删除元素只需要调整相邻节点的指…

【SQL】E-R模型(实体-联系模型)

目录 一、介绍 1、实体集 定义和性质 属性 E-R图表示 2. 联系集 定义和性质 属性 E-R图表示 一、介绍 实体-联系数据模型(E-R数据模型)被开发来方便数据库的设计,它是通过允许定义代表数据库全局逻辑结构的企业模式&#xf…

Pytest-Bdd-Playwright 系列教程(12):步骤参数 parsers参数解析

Pytest-Bdd-Playwright 系列教程(12):步骤参数 & parsers参数解析 前言一、什么是步骤参数?二、pytest-bdd 的步骤参数用法2.1 简单字符串解析2.2 自定义正则表达式解析2.3 参数类型转换 三、案例:基于 pytest-bdd…

vscode 快捷键生成代码

1. !Tab/回车键 便捷生成html初始结构代码(注意!是英文字符) 2. Alt B 快捷默认浏览器打开 3. Ctrl / 增加注释 4. 光标放到该行即可,直接ctrlC,ctrlv,即可在下面复制一行 5. 选中要修改的标签…

前端接入Paymax支付请求

材料指南 开发者平台 :配置开发必备信息(appid,商户号,公钥私钥),此处与请求参数appId、merchantNo有关。 PayerMax Apis:各支付接口信息,本文以收银台支付API为请求展开,请求url为orderAndPay,测试环境基…

Jmeter的后置处理器(二)

5--JSR223 PostProcessor 功能特点 自定义后处理逻辑:使用脚本语言编写自定义的后处理逻辑。支持多种脚本语言:支持 Groovy、JavaScript、BeanShell 等脚本语言。动态参数传递:将提取的数据存储为变量,供后续请求使用。灵活性高…

CSS遮罩:mask

CSS属性 mask 允许使用者通过遮罩或者裁切特定区域的图片的方式来隐藏一个元素的部分或者全部可见区域。 // 一般用位图图片做遮罩 mask: url(~/assets/images/mask.png); mask-size: 100% 100%;// 使用 SVG 图形中的形状来做遮罩 mask: url(~/assets/images/mask.svg#star);…

Zmap+python脚本+burp实现自动化Fuzzing测试

声明 学习视频来自 B 站UP主泷羽sec,如涉及侵权马上删除文章。 笔记的只是方便各位师傅学习知识,以下网站只涉及学习内容,其他的都与本人无关,切莫逾越法律红线,否则后果自负。 ✍🏻作者简介:致…