先看看多少代码量 import os file_types = ['py', 'html', 'css', 'js', ] def count_code_nums(file): """获取单个文件的行数 """ with open(file, mode='rb') as f: return len( ...
分类:
其他好文 时间:
2021-03-29 12:13:33
阅读次数:
0
装饰器 定义:是在不改变函数的调用方式,还能为此函数前后添加功能 装饰器的形成过程 一、写一个测试代码时间的函数 import time#导入time模块是为了模拟函数运行时间 def inner(): start=time.time() time.sleep(1) for i in range(1 ...
分类:
其他好文 时间:
2021-03-29 11:52:53
阅读次数:
0
attribute:html标签的属性 <div class="left" aa="bb" id="div1" checked="checked"></div> div1 = document.getElementById("div1"); div1.getAttribute("checked"); ...
分类:
编程语言 时间:
2021-03-26 15:29:51
阅读次数:
0
Vant weapp滑动单元格SwipeCell按钮样式 引用swipeCell组件的页面,index.wxss中添加样式 .van-swipe-cell__left{ width: 130rpx; height: 100%; font-size: 30rpx; color: #fff; text- ...
分类:
移动开发 时间:
2021-03-18 14:37:32
阅读次数:
0
1.任何程序在执行时,至少有一个主线程。 2.t.Start()启动了一个线程后,用t1.Join()这个方法加入一个线程[即:暂停了主线程的运行],那么操作系统就会马上执行这个新加入的线程 【 (1)Join方法用于一个线程必须等待另外一个线程结束之后才能执行 (2)执行的线程等待,被执行的线程先 ...
分类:
其他好文 时间:
2021-03-17 14:50:24
阅读次数:
0
class Solution { public int characterReplacement(String s, int k) { int left =0,right=0; int maxLength = -1; int result = 0; char[] charNums = new cha ...
分类:
其他好文 时间:
2021-03-17 14:50:06
阅读次数:
0
#111. 二叉树的最小深度 https://leetcode-cn.com/problems/minimum-depth-of-binary-tree/ 关键在于知道f(root)=min(f(left),f(right))+1这个表达式 class Solution { public: int ...
分类:
其他好文 时间:
2021-03-16 12:04:09
阅读次数:
0
void flatten(TreeNode root) { // base case,即最小 if (root == null) return; flatten(root.left); flatten(root.right); /**** 后序遍历 ****/ // 1、保存原来的左右节点,避免变换 ...
分类:
其他好文 时间:
2021-03-16 11:50:33
阅读次数:
0
mysql语句的书写顺序和执行顺序有很大差异。 书写顺序,mysql的一般书写顺写为: select <要返回的数据列> from <表名> join on where group by <分组条件> having <分组后的筛选条件> order by <排序条件> limit <行数限制> 然而 ...
分类:
数据库 时间:
2021-03-15 11:19:23
阅读次数:
0
一、什么是进程 程序:例如xxx.py这是程序,是一个静态的 进程:一个程序运行起来后,代码+用到的资源称之为进程,它是操作系统分配资源的基本单元。 不仅可以通过线程完成多任务,进程也是可以的 进程的状态 工作中,任务数往往大于cpu的核数,即一定有一些任务正在执行,而另外一些任务在等待cpu进行执 ...
分类:
编程语言 时间:
2021-03-15 11:19:10
阅读次数:
0