增加模块QT += network // 初始化属性 ui->inport->setText("8888"); ui->outport->setText("9999"); ui->localip->setText("127.0.0.1"); // 创建套接字 udp = new QUdpSocket ...
分类:
其他好文 时间:
2021-05-24 17:03:08
阅读次数:
0
装饰者模式: 在不改变原有对象的基础上,将功能附加到对象上 /** * 装饰者模式 */ public class decoratorTest { public static void main(String[] args) { Component component = new ConcreteD ...
分类:
其他好文 时间:
2021-05-24 17:01:12
阅读次数:
0
HashMap底层为什么一定用数组 HashMap源码数据结构: Entry[] table = new Entry[capacity]; 其中,Entry就是一个链表节点。如果将数组替换成LinkedList是否可行?如下: List<Entry> table = new LinkedList<E ...
分类:
编程语言 时间:
2021-05-24 16:58:48
阅读次数:
0
问题描述: 有一个长度为 arrLen 的数组,开始有一个指针在索引 0 处。 每一步操作中,你可以将指针向左或向右移动 1 步,或者停在原地(指针不能被移动到数组范围外)。 给你两个整数 steps 和 arrLen ,请你计算并返回:在恰好执行 steps 次操作以后,指针仍然指向索引 0 处的 ...
分类:
其他好文 时间:
2021-05-24 16:53:30
阅读次数:
0
给定一个整数数组 nums ,找到一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 方法1:暴力解法 很显然会报 超过时间限制。 /** * @param {number[]} nums * @return {number} */ var maxSubArray = functi ...
分类:
其他好文 时间:
2021-05-24 16:50:25
阅读次数:
0
使用 DirectoryInfo 的 GetFiles 提取文件,提取多种文件 1. DirectoryInfo di = new DirectoryInfo(filePath); FileInfo[] afi = di.GetFiles("*.dat"); 或者 FileInfo[] afi = ...
分类:
其他好文 时间:
2021-05-24 16:47:16
阅读次数:
0
先看一个简单的字典生成式: 1 columns=[1,2,3,4] 2 3 new_dict={c:1 for c in columns} 4 5 print(new_dict) 结果是:{1: 1, 2: 1, 3: 1, 4: 1} ...
分类:
编程语言 时间:
2021-05-24 16:39:55
阅读次数:
0
一.GridView 在控制器 public function actionIndex() { $query = User::find(); $pages = new Pagination(['totalCount' =>$query->count()]); $dataProvider = new ...
分类:
其他好文 时间:
2021-05-24 16:31:36
阅读次数:
0
dataSet和dataTable是在电脑内存中创建“数据库”和“表” 1、创建内存表的过程 // 1-先用dataSet创建一个名字为“School”的数据库,代码如下: DataSet ds = new DataSet("School"); //2-再创建一张表,表名称为“Student”,最后 ...
分类:
数据库 时间:
2021-05-24 16:12:07
阅读次数:
0
reduce语法 array.reduce(function(total, currentValue, currentIndex, arr), initialValue); 参数描述 total 必需。初始值, 或者计算结束后的返回值。 currentValue 必需。当前元素 currentInd ...
分类:
Web程序 时间:
2021-05-24 16:04:18
阅读次数:
0