- 博客(33)
- 收藏
- 关注
原创 vue常用指令
1、v-textv-text指令的作用是:设置标签的内容默认写法会替换全部内容,使用差值表达式{{}}可以替换指定内容2、v-htmlv-html指令的作用是:设置标签的innerHTML内容中有html结构会被解析为标签v-text指令无论内容是什么,只会解析为文本3、v-onv-on指令的作用是:为元素绑定时间事件名不需要写on指令可以简写为@绑定的方法定义在methods属性中方法内部通过this关键字可以访问定义在data中数据事件绑定的方法写成函数调用的形式,可
2021-12-06 17:15:33 430
原创 qt退出程序 debug正常 release程序崩溃
一、起因公司的程序,使用debug模式exit 0,但是使用release模式进行发布时,结果程序直接崩溃。属实老毛病了,以前的做法就是用taskkill直接杀死进程。但是今天忍无可忍,想尽了办法来解决这个问题,皇天不负有心人,终于找到了问题所在。二、经过起初,百度说是野指针,空指针,内存溢出等问题,然后我把该new关键词的部分基本都屏蔽了,但是问题还是存在,一直到几乎所有能执行的代码我都屏蔽了,但是就是不见成效。中间我想用qt debug进行调试,然后发现debugger exit code
2021-09-23 17:32:40 3477
原创 设计模式6大原则
助记“SOLID”S: 单一职责原则:实现类要职责单一O: 开闭原则:总纲:对扩展开放,对修改关闭L:里氏替换原则: 不要破坏继承体系L:迪米特法则:降低耦合I:接口隔离原则:设计接口时要精简单一D:依赖倒置原则:面向接口编程...
2021-09-01 17:31:02 115
原创 设置SElinux的规则
getsebool 查看规则对应的bool值ex: getsebool httpd_enable_homedirssetsebool 设置规则的bool值ex: setsebool -P http_enable_homedirs 1 -P表示将修改写进配置文件中...
2021-07-26 10:24:59 315
原创 仅执行一次的工作排程(at)
[root@study ~]# systemctl restart atd[root@study ~]# systemctl enable atd[root@study ~]# systemctl status atd● atd.service - Job spooling tools Loaded: loaded (/usr/lib/systemd/system/atd.service; enabled; vendor preset: enabled) Active: active (.
2021-07-22 17:16:08 169
原创 制作LVM
一、需求使用4个partition,每个partition的容量均在1GB左右,且systemID需要为8e; 全部的partition整合成为一个VG,VG名称设定为vbirdvg;且PE的大小为16GB; 建立一个名为vbirdlv的LV,容量大约为2G; 最终这个LV格式化为xfs的文件系统,且挂载在/srv/lvm中二、gdisk分区[root@study ~]# gdisk /dev/sda #使用gdisk进行分区GPT fdisk (gdisk) version 0
2021-07-22 16:02:12 470
原创 制作软件磁盘阵列(raid)
一、分区这里我使用的是鸟哥linux私房菜上的案例。4个分区组成RAID5; 每个分区约1GB大小,需确定每个分区一样大较佳; 1个分区设为spare disk(备份分区),大小也为1GB chunk(区块)设定为256K; 此RAID5挂载在/srv/raid目录下[root@study ~]# gdisk /dev/sda #对sda磁盘划分区Command (? for help): nPartition number (4-128, default 4):
2021-07-22 12:30:09 903
原创 linux shell如何debug
使用sh命令,可带三个参数-n -v -xsh [-nvx] scripts.sh#选项与参数#-n:不要执行script,仅查询语法的问题#-v:在执行scripts前,先将scripts的内容输出到屏幕上#-x:将使用到的scripts内容显示到屏幕上(重点!) ...
2021-07-20 15:02:00 675
原创 bash通配符(wildcard)和特殊符号
一、通配符(wildcard)符号 意义 * 代表0个到无穷个任意字符 ? 代表一定有一个任意字符 [ ] 同样代表一定有一个在括号内的字符(非任意字符)。例如 [abcd] 代表一定有一个字符,可能是 a,b,c,d这四个任何一个 [ - ] 若有减号在中括号内时,代表在编码顺序内的所有字符。例如 [0...
2021-07-14 15:37:57 435
原创 05-树9 Huffman Codes
In 1953, David A. Huffman published his paper "A Method for the Construction of Minimum-Redundancy Codes", and hence printed his name in the history of computer science. As a professor who gives the final exam problem on Huffman codes, I am encountering a
2021-07-09 14:08:22 89
原创 05-树8 File Transfer
We have a network of computers and a list of bi-directional connections. Each of these connections allows a file transfer from one computer to another. Is it possible to send a file from any computer on the network to any other?Input Specification:Each
2021-07-08 17:04:35 107
原创 05-树7 堆中的路径
将一系列给定数字插入一个初始为空的小顶堆H[]。随后对任意给定的下标i,打印从H[i]到根结点的路径。输入格式:每组测试第1行包含2个正整数N和M(≤1000),分别是插入元素的个数、以及需要打印的路径条数。下一行给出区间[-10000, 10000]内的N个要被插入一个初始为空的小顶堆的整数。最后一行给出M个下标。输出格式:对输入中给出的每个下标i,在一行中输出从H[i]到根结点的路径上的数据。数字间以1个空格分隔,行末不得有多余空格。#include <iostream>
2021-07-08 14:41:26 76
原创 04-树6 Complete Binary Search Tree
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node contains only nodes with keys greater th
2021-07-08 09:41:23 81
原创 vim常用命令
一、一般命令模式可用的功能按键1、移动光标h :左 j:下 k:上 l:右nj 表示向下移动n个字符ctrl + f : 向下移动一页ctrl + b: 向上移动一页0或Home:移动到这一行的最前面字符处$或End:移动到这一行的最后面字符处G:移动到这个文件的最后一行 (nG:移动到文件的第n行)gg:移动到这个文件的第一行n<Enter>:光标向下移动n行2、查找和替换...
2021-07-06 17:40:11 313 1
转载 04-树5 Root of AVL Tree
An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to restore this property. Figures 1-4 illustrate t
2021-07-06 16:13:36 83
原创 04-树7 二叉搜索树的操作集
本题要求实现给定二叉搜索树的5种常用操作。函数接口定义:BinTree Insert( BinTree BST, ElementType X );BinTree Delete( BinTree BST, ElementType X );Position Find( BinTree BST, ElementType X );Position FindMin( BinTree BST );Position FindMax( BinTree BST );其中BinTree结构定义如下:
2021-07-06 14:21:26 175
原创 04-树4 是否同一棵二叉搜索树
给定一个插入序列就可以唯一确定一棵二叉搜索树。然而,一棵给定的二叉搜索树却可以由多种不同的插入序列得到。例如分别按照序列{2, 1, 3}和{2, 3, 1}插入初始为空的二叉搜索树,都得到一样的结果。于是对于输入的各种插入序列,你需要判断它们是否能生成一样的二叉搜索树。输入格式:输入包含若干组测试数据。每组数据的第1行给出两个正整数N(≤10)和L,分别是每个序列插入元素的个数和需要检查的序列个数。第2行给出N个以空格分隔的正整数,作为初始插入序列。最后L行,每行给出N个插入的元素,属于L个需要.
2021-07-06 12:24:56 97
转载 03-树3 Tree Traversals Again
An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6) is traversed, the stack operations are: push(1); push(2); push(3); pop(); pop(
2021-07-06 10:01:46 73
原创 03-树2 List Leaves
Given a tree, you are supposed to list all the leaves in the order of top down, and left to right.Input Specification:Each input file contains one test case. For each case, the first line gives a positive integerN(≤10) which is the total number of no..
2021-07-05 17:38:26 69
原创 03-树1 树的同构
给定两棵树T1和T2。如果T1可以通过若干次左右孩子互换就变成T2,则我们称两棵树是“同构”的。例如图1给出的两棵树就是同构的,因为我们把其中一棵树的结点A、B、G的左右孩子互换后,就得到另外一棵树。而图2就不是同构的。 图1 图2 现给定两棵树,请你判断它们是否是同构的。输入格式:输入给出2棵二叉树树的信息。对于每棵树,首先在一行中给出一个非负整数N(≤10),即该树的结点数(此时假设结点从0到N−1编号);随后N行,第i行对应编号第i个结点,给出该结点中存储的1个英文大写.
2021-07-05 14:00:24 65
原创 配置unixODBC和freetds
1.找到unixODBC配置文件的路径用locate找odbcinst[root@localhost bin]# locate odbcinst/home/cupgod/odbcinst.ini/usr/local/unixODBC/bin/odbcinst/usr/local/unixODBC/etc/odbcinst.ini/usr/local/unixODBC/include/odbcinst.h/usr/local/unixODBC/include/odbcinstext.h/
2021-06-26 17:08:49 463
原创 安装freetds
1.复制tar包到/usr/localcp freetds-1.2.21.tar.gz /usr/local2.解压tar -zxvf freetds-1.2.21.tar.gz3.进入解压后的freetds-1.2.21目录cd freetds-1.2.214.三步曲 ./configure --prefix=/usr/local/freetds --with-unixodbc=/usr/local/unixODBC --enable-msdblib --with-td
2021-06-26 14:29:05 266
原创 linux下qt安装odbc驱动
1.安装unixODBC(1)先下载unixODBC源码包( http://www.unixodbc.org/unixODBC-2.3.1.tar.gz)放到/usr/local下(2)解压:tar -zxvf unixODBC-2.3.1.tar.gz(3)安装unixODBC-2.3.1.tar.gzcd usr/local/unixODBC-2.3.1/./configure --prefix=/usr/local/unixODBCmakemake install(.
2021-06-22 10:07:48 2867
原创 变化的参数模板
//注意每个...的位置#include <iostream>#include <thread>#include <bitset>using namespace std;void print() {}template<typename T, typename... Types>void print(const T& firstArg, const Types& ...args) { cout << first.
2021-06-17 13:59:46 79
原创 02-线性结构4 Pop Sequence
Given a stack which can keepMnumbers at most. PushNnumbers in the order of 1, 2, 3, ...,Nand pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. For example, ifMis 5 andNis 7, we can obta...
2021-06-17 10:53:27 101
原创 02-线性结构3 Reversing Linked List
Given a constantKand a singly linked listL, you are supposed to reverse the links of everyKelements onL. For example, givenLbeing 1→2→3→4→5→6, ifK=3, then you must output 3→2→1→6→5→4; ifK=4, you must output 4→3→2→1→5→6.Input Specification:Eac...
2021-06-17 10:11:59 77
原创 02-线性结构2 一元多项式的乘法与加法运算
设计函数分别求两个一元多项式的乘积与和。输入格式:输入分2行,每行分别先给出多项式非零项的个数,再以指数递降方式输入一个多项式非零项系数和指数(绝对值均为不超过1000的整数)。数字间以空格分隔。输出格式:输出分2行,分别以指数递降方式输出乘积多项式以及和多项式非零项的系数和指数。数字间以空格分隔,但结尾不能有多余空格。零多项式应输出0 0。...
2021-06-16 21:06:26 68
原创 01-复杂度2 Maximum Subsequence Sum
Given a sequence ofKintegers {N1,N2, ...,NK}. A continuous subsequence is defined to be {Ni,Ni+1, ...,Nj} where1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has the largest sum of its elements. For exampl...
2021-06-15 18:34:09 63
转载 01-复杂度1 最大子列和问题
给定K个整数组成的序列{N1,N2, ...,NK},“连续子列”被定义为{Ni,Ni+1, ...,Nj},其中1≤i≤j≤K。“最大子列和”则被定义为所有连续子列元素的和中最大者。例如给定序列{ -2, 11, -4, 13, -5, -2 },其连续子列{ 11, -4, 13 }有最大的和20。现要求你编写程序,计算给定整数序列的最大子列和。本题旨在测试各种不同的算法在各种数据情况下的表现。各组测试数据特点如下:数据1:与样例等价,测试基...
2021-06-15 18:33:01 72
原创 02-线性结构1 两个有序链表序列的合并
#include <stdio.h>#include <stdlib.h>typedef int ElementType;typedef struct Node *PtrToNode;struct Node { ElementType Data; PtrToNode Next;};typedef PtrToNode List;List Read(); /* 细节在此不表 */void Print( List L ); /* 细节在此不表;空链.
2021-06-15 18:31:17 188
原创 01-复杂度3 二分查找
#include <stdio.h>#include <stdlib.h>#define MAXSIZE 10#define NotFound 0typedef int ElementType;typedef int Position;typedef struct LNode *List;struct LNode { ElementType Data[MAXSIZE]; Position Last; /* 保存线性表中最后一个元素的位置 */};.
2021-06-15 18:27:24 83
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人