事件监听 当某个事件发生,会产生什么? public class Demo01 { public static void main(String[] args) { //按下按钮,触发事件 Frame frame = new Frame(); Button button = new Button() ...
分类:
其他好文 时间:
2021-04-14 12:40:04
阅读次数:
0
sys.exc_info() 获取异常 import sys try: raise ValueError('this is a exp') except Exception as ex: ex_type, ex_val, ex_stack = sys.exc_info() print(ex_type ...
分类:
编程语言 时间:
2021-04-14 12:39:26
阅读次数:
0
### range(start,stop ,step) - 按循序生成整数 #生成整数,参数可是负值,STEP可以是负值,参数可以只是一个整数 for item in range(0,10,2): print(item) 结果: 0 2 4 6 8 列2: for item in range(10) ...
分类:
其他好文 时间:
2021-04-14 12:16:21
阅读次数:
0
### time - time.time() - 获取时间戳 #获取时间戳,从1970年1月1日0点0分0秒(中国差8个小时,就8点)到当前的时间,以秒位单位计算 import time ctime = time.time() print(ctime ) 结果: 1611901935.2243853 ...
分类:
其他好文 时间:
2021-04-14 12:15:17
阅读次数:
0
再次因为浮点数g++, c++编译器的问题WA,中间还因为reset没有改过来编译器无脑再WA了一次 这道题很适合Kruskal这种将最开始的联通森林,一点点聚合到一起成为一棵联通的最小生成树的想法,只不过,具体到这道题,是要将原先的p个森林,聚合成为s个森林,所以实现就非常简单了 #include ...
分类:
其他好文 时间:
2021-04-14 12:13:20
阅读次数:
0
这题就是简单的bts一次遍历,算相邻两个元素之间的最小差值就结束了。 BTS的遍历模板: def dfs(root): if not root: return dfs(root.left) # 对当前节点的操作,比如print dfs(root.right) ...
分类:
其他好文 时间:
2021-04-14 12:03:49
阅读次数:
0
先来个单例模式的线程安全代码 package basic.single; public class SingleTon { private SingleTon(){ System.out.println(Thread.currentThread().getName()); } private sta ...
分类:
其他好文 时间:
2021-04-14 11:58:53
阅读次数:
0
输入一个数,分解成其质因子 1 #include<stdio.h> 2 3 int main() 4 { 5 int val,temp; 6 scanf("%d", &val); 7 printf("%d=1*", val); 8 temp = val; 9 for (int i = 2; i < ...
分类:
其他好文 时间:
2021-04-14 11:57:55
阅读次数:
0
#!/usr/bin/env python3#!-*- coding:UTF-8 -*- import osclass GetPath():# 获取所有目录 @staticmethod def get_dir(path): print("打印所有目录:") for root, dirs, files ...
分类:
编程语言 时间:
2021-04-14 11:51:07
阅读次数:
0
一、Golang开发环境搭建 1.下载安装jetbrain Goland IDE 下载地址:https://www.jetbrains.com/go/download/#section=windows 2.安装golang编译器 下载地址:https://golang.google.cn/doc/i ...
分类:
其他好文 时间:
2021-04-13 12:35:02
阅读次数:
0