python: more Layer Architecture and its Implementation in Python

news2024/9/21 1:15:56

sql server:

--学生表
DROP TABLE DuStudentList
GO
create table DuStudentList
(
     StudentId INT IDENTITY(1,1) PRIMARY KEY,
     StudentName nvarchar(50),
     StudentNO varchar(50),                    --学号
     StudentBirthday datetime                  --学生生日     
  
)
go

model

"""
StudentListInfo.py
学生类
date 2023-06-16
edit: Geovin Du,geovindu, 涂聚文
ide:  PyCharm 2023.1 python 11
"""
 
import datetime
from datetime import date
import sys
import os
import Common
 
class StudentList(object):
    """
    学生实体类
    """
 
 
 
    def __init__(self,StudentId:int,StudentName:str, StudentNO:str,StudentBirthday:datetime.datetime):
        """
 
        :param StudentName:
        :param StudentNO:
        :param StudentBirthday:
        """
        self._StudentName=StudentName
        self._StudentNO=StudentNO
        self._StudentBirthday=StudentBirthday
        self._StudentId=StudentId
        self._age=0 #date.today().year-StudentBirthday.year #date.today().year-StudentBirthday.year #Common.Commond.calculateAge(date(StudentBirthday.year,StudentBirthday.month,StudentBirthday.day))
 
    def __init__(self,StudentId:int,StudentName:str, StudentNO:str,StudentBirthday:datetime.datetime,age:int):
        """
 
        :param StudentName:
        :param StudentNO:
        :param StudentBirthday:
        """
        self._StudentName=StudentName
        self._StudentNO=StudentNO
        self._StudentBirthday=StudentBirthday
        self._StudentId=StudentId
        self._age=age #date.today().year-StudentBirthday.year #date.today().year-StudentBirthday.year #Common.Commond.calculateAge(date(StudentBirthday.year,StudentBirthday.month,StudentBirthday.day))
 
    def __del__(self):
        """
 
        :return:
        """
        print(f"{self._StudentName}")
 
    def setStudentName(self,StudentName):
        """
 
        :param StudentName:
        :return:
        """
        self._StudentName = StudentName
 
 
    def getStudentName(self):
        """
 
        :return:
        """
        return self._StudentName
 
    def setStudentNO(self,StudentNO):
        """
 
        :param StudentNO:
        :return:
        """
        self._StudentNO=StudentNO
 
 
    def getStudentNO(self):
        """
 
        :return:
        """
        return self._StudentNO
 
    def setStudentId(self,StudentId):
        """
 
        :param StudentId:
        :return:
        """
        self._StudentId=StudentId
 
 
    def getStudentId(self):
        """
 
        :return:
        """
        return  self._StudentId
 
    def setStudentBirthday(self,StudentBirthday):
        """
 
        :param StudentBirthday:
        :return:
        """
        self._StudentBirthday = StudentBirthday
        dage =date.today().year-StudentBirthday.year# Common.Commond.calculate_age(StudentBirthday)
        self._age=dage
 
 
    def getStudentBirthday(self):
        """
 
        :return:
        """
        return self._StudentBirthday
 
    def setAge(self,age):
        """
 
        :param age:
        :return:
        """
        dage=1 #Common.Commond.calculate_age(StudentBirthday)
        self._age = age
 
 
    def getAge(self):
        """
 
        :return:
        """
        return self._age
 
    def __str__(self):
        """
 
        :return:
        """
        return f"{self._StudentId},{self._StudentName},{self._StudentNO},{self._StudentBirthday}{self._age}"

DAL

"""
StudentDALListDAL.py
数据业务处理层 Data Access Layer (DAL)
SQL Server 数据库操作
date 2023-06-21
edit: Geovin Du,geovindu, 涂聚文
ide: PyCharm 2023.1 python 11
"""
 
import os
import sys
from pathlib import Path
import re
import pymssql  #sql server
import Model.StudentListInfo
import UtilitieDB.MsSQLHelper
import Interface.IStudentList
 
class StudentDal(Interface.IStudentList.IStudentList):
    """
    数据业务处理层  学生
    数据库连接可以放在这里,通过配置读取数据连接参数
    """
 
    def __init__(self):
        """
        构造函数,方法
        :param strserver:
        :param struser:
        :param strpwd:
        :param strdatabase:
        """
        self._strserver = ""
        self._struser = ""
        self._strpwd = ""
        self._strdatabase =""
 
    def selectSql(self):
        """
        查询数据 self._strserver, self._struser, self._strpwd, self._strdatabase
        :return:
        """
 
        myms = UtilitieDB.MsSQLHelper.MsSqlHelper()
        row=myms.execute('select *,DATEDIFF(hour,StudentBirthday,GETDATE())/8766 as Age from DuStudentList;')
        return row
 
    def selectSqlOrder(self,order:str)->list:
        """
 
        :param order:  studenName desc/asc
        :return:
        """
        students=[]
        myms = UtilitieDB.MsSQLHelper.MsSqlHelper()
        strsql=f"select * from DuStudentList order by {order};"
        row=myms.execute(f'select *,DATEDIFF(hour,StudentBirthday,GETDATE())/8766 as Age from DuStudentList order by {order};')
        return row
 
    def selectIdSql(self,StudentId:int):
        """
 
        :param StudentId: 主键ID
        :return:
        """
        myms = UtilitieDB.MsSQLHelper.MsSqlHelper()
        row=myms.execute(f'select * from DuStudentList where StudentId={StudentId};')
        return row
    def selectProc(self):
        """
        存储过程
        :return:
        """
        myms = UtilitieDB.MsSQLHelper.MsSqlHelper()
        args = ()
        row = myms.executeCallProc("proc_Select_StudentListAll",args)
        return row
 
    def selectIdProc(self,StudentId:int):
        """
        存储过程
        :param StudentId: 主键ID
        :return:
        """
        myms = UtilitieDB.MsSQLHelper.MsSqlHelper()
        args = (StudentId,)
        row = myms.executeCallProc('dbo.proc_Select_StudentList', args)
        return row
 
    def addSql(self,info:Model.StudentListInfo.StudentList):
        """
        添加,要考虑添加返回ID值
        :param info:学生实体类
        :return:
        """
        myms=UtilitieDB.MsSQLHelper.MsSqlHelper();
        column=("StudentName","StudentNO","StudentBirthday")
        vales=[info.getStudentName(),info.getStudentNO(),info.getStudentBirthday()]
        myms.insertByColumnaAndValues("dbo.DuStudentList",column,vales)
 
    def addProc(self,info:Model.StudentListInfo.StudentList):
        """
        添加,要考虑添加返回ID值
        :param info:学生实体类
        :return:
        """
        myms = UtilitieDB.MsSQLHelper.MsSqlHelper();
        args=(info.getStudentName(),info.getStudentNO(),info.getStudentBirthday())
        myms.insertCallProc("dbo.proc_Insert_StudentList",args)
 
    def addOutProc(self,info:Model.StudentListInfo.StudentList):
        """
        添加,要考虑添加返回ID值
        :param info:学生实体类
        :return: 返回增加的学生的ID
        """
        id=0
        myms = UtilitieDB.MsSQLHelper.MsSqlHelper();
        outid = pymssql.output(int)
        args = (info.getStudentName(), info.getStudentNO(), info.getStudentBirthday(),outid)
        print(args)
        id=myms.insertOutCallProc("dbo.proc_Insert_StudentListOutput", args)
        return id
    def editSql(self,info:Model.StudentListInfo.StudentList):
        """
 
        :param info:学生实体类
        :return:
        """
        myms = UtilitieDB.MsSQLHelper.MsSqlHelper();
        args = {"StudentName":f"{info.getStudentName()}","StudentNO":f"{info.getStudentNO()}","StudentBirthday":f"{info.getStudentBirthday()}"}  #"StudentId":6
        where = f"StudentId={info.getStudentId()}" #
        #print(args,where)
        myms.updateByKeyValues("DuStudentList",where,args)
 
    def editProc(self, info: Model.StudentListInfo.StudentList):
        """
 
        :param info: 学生实体类
        :return:
        """
        myms = UtilitieDB.MsSQLHelper.MsSqlHelper();
        args = (info.getStudentId(),info.getStudentName(),info.getStudentNO(),info.getStudentBirthday())
        myms.updateProc("[dbo].[proc_Update_StudentList]",args)
 
 
    def delSql(self,StudentId:int):
        """
        sql语句删除
        :param StudentId: 主键ID
        :return:
        """
        myms = UtilitieDB.MsSQLHelper.MsSqlHelper();
        where={f"StudentId":StudentId}
        myms.deleteByKeyValues("DuStudentList",where)
 
    def delProc(self, studentId):
        """
        删除 存储过程 删除多个ID,后面增加
        :param StudentId: 主键ID
        :return:
        """
        myms = UtilitieDB.MsSQLHelper.MsSqlHelper();
        args =studentId
        myms.deleteProc("dbo.proc_Delete_StudentList",args)

IDAL

"""
IStudentList.py
接口层 Interface Data Access Layer
IDAL(Interface Data Access Layer)DAL的接口层
date 2023-06-19
edit: Geovin Du,geovindu, 涂聚文
ide:  PyCharm 2023.1 python 11
"""
from __future__ import annotations
from abc import ABC, abstractmethod
import os
import sys
import Model.StudentListInfo
 
class IStudentList(ABC):
    """
 
    """
 
    @classmethod
    def __subclasshook__(cls, subclass):
        return (hasattr(subclass, 'load_data_source') and
                callable(subclass.load_data_source) and
                hasattr(subclass, 'extract_text') and
                callable(subclass.extract_text) or
                NotImplemented)
 
    @abstractmethod
    def selectSql(self):
        """
 
        :return:
        """
        pass
 
    @abstractmethod
    def selectSqlOrder(self, order: str) -> list:
        """
 
        :param order:
        :return:
        """
        pass
 
    @abstractmethod
    def selectIdSql(self, StudentId: int):
        """
 
        :param StudentId:
        :return:
        """
        pass
 
    @abstractmethod
    def selectProc(self):
        """
 
        :return:
        """
        pass
 
    @abstractmethod
    def selectIdProc(self, StudentId: int):
        """
 
        :param StudentId:
        :return:
        """
        pass
 
    @abstractmethod
    def addSql(self, info: Model.StudentListInfo.StudentList):
        """
 
        :param info:
        :return:
        """
        pass
 
    @abstractmethod
    def addProc(self, info: Model.StudentListInfo.StudentList):
        """
 
        :param info:
        :return:
        """
        pass
 
    @abstractmethod
    def addOutProc(self, info: Model.StudentListInfo.StudentList):
        """
 
        :param info:
        :return:
        """
        pass
 
    @abstractmethod
    def editSql(self, info: Model.StudentListInfo.StudentList):
        """
 
        :param info:
        :return:
        """
        pass
 
    @abstractmethod
    def editProc(self, info: Model.StudentListInfo.StudentList):
        """
 
        :param info:
        :return:
        """
        pass
 
    @abstractmethod
    def delSql(self, StudentId: int):
        """
 
        :param StudentId:
        :return:
        """
        pass
 
    @abstractmethod
    def delProc(self, studentId):
        """
 
        :param studentId:
        :return:
        """
        pass

BLL

"""
StudentListBLL.py
业务层 Business Logic Layer (BLL)
date 2023-06-19
edit: Geovin Du,geovindu, 涂聚文
ide:  PyCharm 2023.1 python 11
"""
 
import os
import sys
from pathlib import Path
import re
import pymssql  #sql server
from datetime import date
import DAL.StudentListDAL
#import DAL.ConfigDAL
import Model.StudentListInfo
import Interface.IStudentList
import Factory.AbstractFactory
 
class StudentBll(object):
    """
    学生信息操作业务类
    """
 
 
    dal=Factory.AbstractFactory.AbstractFactory.createStudentList
    #dal =DAL.StudentListDAL.StudentDal() #Factory.AbstractFactory.AbstractFactory.createStudentList()#
    """
    类属性 操作DAL
    """
    def __init__(self):
        """
 
        """
        self._name = "geovindu"
 
 
 
    def __del__(self):
        print(f"{self._name}挂失了")
 
    def selectSql(cls)->list:
        """
        元组数据
        :return: list 学生列表
        """
        students = []
 
 
        data = cls.dal().selectSql()
        stus = list(data)  # 如C# 强制转换
        '''
        for a in data:
            for i in a:
                print("II",i[0],i[1],i[2],i[3],i[4])
        '''
        #print(stus)
        for ii in stus:
            for i in ii:
                students.append(Model.StudentListInfo.StudentList(i[0],i[1],i[2],i[3],i[4]))
        return students
 
    def selectSqlOrder(cls, order: str)->list:
        """
        元组数据
        :param order: studenName desc/asc
        :return:
        """
        studentsorder = []
        students=[]
        data = cls.dal().selectSqlOrder(order)
        (studentsorder) = data # 如C# 强制转换
        '''
        for i in range(len(studentsorder)):
            print("rrr",type(studentsorder[i]))
            for duobj in studentsorder[i]:
                print(type(duobj))
                print(duobj)
        '''
        for obj in studentsorder:
            for i in obj:
                students.append(Model.StudentListInfo.StudentList(i[0], i[1], i[2], i[3],i[4]))
        return students
 
 
    def selectIdSql(cls,StudentId:int)->list:
        """
 
        :param StudentId:学生ID
        :return:
        """
        students = []
        data = cls.dal().selectIdSql(StudentId)
        students=data
        for ii in students:
            for i in ii:
                students.append(Model.StudentListInfo.StudentList(i[0],i[1],i[2],i[3]))
        return students
 
 
    def selectProc(cls):
        """
 
        :return:
        """
        students=[]
        data = cls.dal().selectProc()
        for i in data:
            students.append(Model.StudentListInfo.StudentList(i[0],i[1],i[2],i[3],i[4]))
        return students
 
    def selectIdProc(cls,StudentId:int)->list:
        """
 
        :param StudentId:
        :return:
        """
        students = []
        data = cls.dal().selectIdProc(StudentId)
        for i in data:
            students.append(Model.StudentListInfo.StudentList(i[0],i[1],i[2],i[3]))
        return students
 
    def addSql(cls,info:Model.StudentListInfo.StudentList):
        """
 
        :param info:学生实体类
        :return:
        """
        cls.dal.addSql(info)
 
    def addProc(cls,info:Model.StudentListInfo.StudentList):
        """
 
        :param info:学生实体类
        :return:
        """
        #print(info)
        cls.dal().addProc(info)
 
    def addOutProc(cls,info:Model.StudentListInfo.StudentList)->int:
        """
 
        :param info: 学生实体类
        :return: 返回增加的学生ID
        """
        print(info)
        return cls.dal().addOutProc(info)
 
    def editSql(cls,info:Model.StudentListInfo.StudentList):
        """
 
        :param info:学生实体类
        :return:
        """
        #print(info)
        cls.dal().editSql(info)
 
    def editProc(cls, info: Model.StudentListInfo.StudentList):
        """
 
        :param info:学生实体类
        :return:
        """
        cls.dal().editProc(info)
 
    def delSql(cls, StudentId: int):
        """
 
        :param StudentId:
        :return:
        """
        cls.dal().delSql(StudentId)
 
    def delProc(cls, StudentId):
        """
 
        :param StudentId:
        :return:
        """
        cls.dal().delProc(StudentId)

UI

"""
StudentUI.py
读文件类
date 2023-06-24
edit: Geovin Du,geovindu, 涂聚文
ide:  PyCharm 2023.1 python 11
 
"""
 
import datetime
import sys
import os
from tkinter import ttk
from tkinter import *
from tkinter.ttk import *
from ttkbootstrap import Style  # pip install ttkbootstrap
import random
import Model.StudentListInfo
import BLL.StudentListBLL
 
class StudentUi(object):
 
    global tree
    stubll = BLL.StudentListBLL.StudentBll()
 
    def __init__(self):
        self.name="geovindu"
 
    def __del__(self):
        print(f"{self.name}")
 
    def delete(cls):
        #global tree
        curItem = cls.tree.focus()
        val=cls.tree.item(curItem)['values'][0]  #id
        print(val)
        print(cls.tree.selection())
        cls.tree.delete(cls.tree.selection())
        cls.stubll.delSql(val)  #需要删除关联的数据才可以删除
 
        #cls.stubll.delSql()
 
    def main(cls):
        """
        窗体绑定数据
        :return:
        """
 
 
        style=Style(theme='darkly') #定义窗口样式
        window=style.master
        window.title("学生管理")
        # win = Tk()
        screenWidth = window.winfo_screenwidth()
        screenHeight = window.winfo_screenheight()
        width=100
        height=600
        x=int((screenWidth-width)/2)
        y=int((screenHeight-height)/2)
        window.geometry('{}x{}+{}+{}'.format(width,height,x,y))
        #Treeview 控件
        cls.tree=ttk.Treeview(master=window,style='success.Treeview',height=25,show='headings')
        cls.tree.pack()
        #定义列
        cls.tree['columns']=("StudentId","StudentName","StudentNO","StudentBirthday","Age")
        #设置列属性,列不显示
        cls.tree.column("StudentId",width=150,minwidth=100,anchor=S)
        cls.tree.column("StudentName", width=150, minwidth=100, anchor=S)
        cls.tree.column("StudentNO", width=150, minwidth=100, anchor=S)
        cls.tree.column("StudentBirthday", width=150, minwidth=100, anchor=S)
        cls.tree.column("Age", width=150, minwidth=100, anchor=S)
        #设置表头
        cls.tree.heading("StudentId",text="序号")
        cls.tree.heading("StudentName", text="姓名")
        cls.tree.heading("StudentNO", text="学号")
        cls.tree.heading("StudentBirthday", text="出生日期")
        cls.tree.heading("Age", text="年龄")
        # stubll = BLL.StudentListBLL.StudentBll()
        geovindu = cls.stubll.selectSqlOrder("Age asc")  # list()
        #treeView控件绑定数据
        i=1
        for Model.StudentListInfo.StudentList in geovindu:
            cls.tree.insert("",i,text="2",values=(Model.StudentListInfo.StudentList.getStudentId(),Model.StudentListInfo.StudentList.getStudentName(),Model.StudentListInfo.StudentList.getStudentNO(),Model.StudentListInfo.StudentList.getStudentBirthday(),Model.StudentListInfo.StudentList.getAge()))
            i+=1
        #删除按钮
        ttk.Button(window,text="删除",style='success,TButton',command=cls.delete).pack(side='left',padx=5,pady=10)
        window.mainloop()

输出“

 

 

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Qt关闭主窗口后,退出所有异步线程

目录 1.要知道主窗口什么时候关闭2.关闭异步线程 1.要知道主窗口什么时候关闭 在widget.h新增下面的函数 private slots:void closeEvent(QCloseEvent *event);在widget.cpp新增 void Widget::closeEvent(QCloseEvent *event) {qDebug() << "关闭主窗口了&#x…

「网络编程」第三讲:认识协议及简单的协议定制

「前言」文章内容是关于协议的&#xff0c;大致内容是再次认识协议及简单协议的定制&#xff0c;目的是帮助理解协议&#xff0c;下面开始讲解&#xff01; 「归属专栏」网络编程 「笔者」枫叶先生(fy) 「座右铭」前行路上修真我 「枫叶先生有点文青病」「句子分享」 我与我周…

qt 调节win声音版本大小

QT4 情况下&#xff0c;运行的&#xff0c;会出错&#xff0c;目前暂时没有办法解决在&#xff0c;win下调节音量大小问题在这里插入代码片 参考资料 QT 对window系统下音量的设置和获取 还有个很好贴子&#xff0c;没有找到

LLM 应用参考架构:ArchGuard Co-mate 实践示例

随着&#xff0c;对于 LLM 应用于架构领域探索的进一步深入&#xff0c;以及 ArchGuard Co-mate 开发进入深入区&#xff0c;我们发现越来越多的通用模式。 在先前的文章里&#xff0c;我们总结了一系列的设计原则&#xff0c;在这篇文章里&#xff0c;我们将介绍 ArchGuard Co…

架构重构|性能和扩展性大幅提升的Share Creators智能数字资产管理软件3.0

作为数字资产管理行业的领军者&#xff0c;Share Creators智能数字资产管理软件持续致力于帮助企业和团队智能化管理数字资产&#xff0c;提升工业化管线制作效率。经过本次重构&#xff0c;Share Creators 3.0版本重装上阵&#xff0c;全面更新的服务架构标志着软件整体性能的…

C语言-数字爆炸游戏

问题&#xff1a; 你好&#xff0c;欢迎来到数字爆炸&#xff0c;系统随机生成一个数字&#xff0c;猜大了&#xff0c;提示猜大了&#xff0c;猜小了&#xff0c;提示猜小了。 思路&#xff1a; 先写游戏大概思路首先&#xff0c;会有菜单吧&#xff0c;所以先写一个菜单函数…

服务启动后能ping通但无法访问

近期业务需要&#xff0c;重启了服务器&#xff08;centos 7.4&#xff09;&#xff0c;但是各类服务启动后&#xff0c;仍然无法访问&#xff0c;Nginx的白页面都访问不到&#xff0c;能ping通&#xff0c;nslookup 域名解析也没问题&#xff0c;考虑是防火墙 -- 查看防火墙启…

《2023 信创软件品牌影响力报告》发布!融云入选「信创生态」代表厂商

信创正由试点实践转向全面推广。关注【融云 RongCloud】&#xff0c;了解协同办公平台更多干货。 由于外围环境收紧和国内数字经济高速发展等原因&#xff0c;信创产业在顶层战略的指引推动下蓬勃发展&#xff0c;相关政策有力促进了芯片、操作系统、数据库、办公软件、工业软…

jquery html页面先加载内容过几秒后显示数据

&#x1f607;作者介绍&#xff1a;一个有梦想、有理想、有目标的&#xff0c;且渴望能够学有所成的追梦人。 &#x1f386;学习格言&#xff1a;不读书的人,思想就会停止。——狄德罗 ⛪️个人主页&#xff1a;进入博主主页 &#x1f5fc;推荐专栏&#xff1a;点击进入查看 &a…

文心一言 VS 讯飞星火 VS chatgpt (50)-- 算法导论6.2 2题

二、参考过程 MAX-HEAPIFY&#xff0c;写出能够维护相应最小堆的 MIN-HEAPIFY(A&#xff0c;i)的伪代码&#xff0c;并比较 MIN-HEAPIFY 与 MAX-HEAPIFY 的运行时间。 文心一言&#xff1a; MIN-HEAPIFY(A, i)的伪代码如下&#xff1a; 1.将节点i及其子树中的最小元素交换到…

linux定时清理三个月前的应用日志

目录 思路find 命令需要用到 -mtime n 参数 shell脚本三种方法方法一方法二方法三 配置计划任务 思路 要想删除三个月前的日志&#xff0c;先得找到三个月前的日志才行&#xff0c;可以通过 find命令查找。 find 命令 1.find命令基本介绍     find顾名思义就是查找&…

UMS攸信入选福建省知识产权优势企业名单,为企业自主创新体系建设增添新动能!

近日&#xff0c;根据福建省市场监管局办公室《关于组织开展2023年度省知识产权优势企业申报及复核工作的通知》&#xff08;闽市监办〔2023〕11号&#xff09;要求&#xff0c;将拟确认的2023年福建省知识产权优势企业名单予以公示。 攸信技术成功入选该名单&#xff0c;荣获2…

chatgpt赋能python:Python退出主程序:如何正确结束你的Python代码

Python退出主程序&#xff1a;如何正确结束你的Python代码 对于Python编程的初学者来说&#xff0c;经常会遇到一个问题&#xff1a;如何正确退出Python程序&#xff1f;在Python中&#xff0c;有许多种方式可以停止运行Python程序&#xff0c;但不是所有的方法都是相同的。如…

vue 访问本地json数据

如果你的项目中需要模拟下json数据&#xff0c;来看下访问速度&#xff0c;那就参照这个试试吧&#xff0c;首先创建test.josn&#xff0c;放在pulic目录下&#xff0c;见下图 定义js // 文件 prodOrder.jsexport function test(data) {return request({url: http://localhost…

无缝数据转换!使用C++ 实现 Excel文件与CSV之间的相互转换

CSV格式是一种通用的文本文件格式&#xff0c;可在多个应用程序之间共享和使用。相比之下&#xff0c;Excel文件是一种电子表格格式&#xff0c;通常只能在Microsoft Excel中编辑和查看。因此&#xff0c;将Excel文件转换为CSV格式可使数据更方便地在其他应用程序中使用&#x…

Linux服务器丢包故障的解决思路及引申的TCP/IP协议栈理论

Linux服务器丢包故障的解决思路及引申的TCP/IP协议栈理论 我们使用Linux作为服务器操作系统时&#xff0c;为了达到高并发处理能力&#xff0c;充分利用机器性能&#xff0c;经常会进行一些内核参数的调整优化&#xff0c;但不合理的调整常常也会引起意想不到的其他问题&#x…

Android 冷启动优化的3个小案例

背景 为了提高App的冷启动耗时&#xff0c;除了在常规的业务侧进行耗时代码优化之外&#xff0c;为了进一步缩短启动耗时&#xff0c;需要在纯技术测做一些优化探索&#xff0c;本期我们从类预加载、Retrofit 、ARouter方面进行了进一步的优化。从测试数据上来看&#xff0c;这…

docker创建mysql容器

步骤 引言执行创建命令设置远程访问使用Navicat连接 引言 只要有开发&#xff0c;就要用数据库&#xff0c;mysql是最简单&#xff0c;也是非常好用的数据库&#xff0c;也要学会用docker创建mysql数据库。 执行创建命令 docker run --name mysql\--restartalways\-p 13306:…

每天一点Python——day43

#第四十三天字典的视图操作&#xff1a; ①keys()获取字典中所有的键 ②values()获取字典中所有的值 ③items()获取字典中所有的键值对#如图&#xff1a; #例&#xff1a;获取所有的键 a{哥哥:18,妹妹:16,姐姐:17}#字典创立 ba.keys()#获取后我们存在变量b中&#xff0c;右边的…

【Mysql】索引数据结构深入研究(二)

前言 在这里需要明确的一点是&#xff0c;数据库的引擎InnoDB或者是MyISAM引擎它们是形容数据表的&#xff0c;不是形容数据库的。 另外&#xff1a;文章中提到的索引的数据结构暂且都默认使用BTree InnoDB引擎 InnoDB的索引数据文件有两个&#xff0c;tableName.frm和table…