实在不忍心x1c吃灰。。。
打算装个arch玩。。。
第一次失败了,原因是忘记配置引导相关…
第二次就成功了…
教程满大街都是就不再写了….
update3:
终于知道了正确的学习姿势…
用百度把要用的东西大概描述出来,然后总能找到一个是你要的。。。
然后再去搜关键词。。。
嗯。。百度还是很有用的啊2333
qt5.8_doc_Line Edits Example
所以现在要把之前写成dialog的几个改回Line edit
感觉其实。。。更像是一种规范。。。?而不是一种具体要求吧。。。
转自 # 头文件(.h): # 写类的声明(包括类里面的成员和方法的声明)、函数原型、#define常数等,但一般来说不写出具体的实现。
参考资料
一. 常用编译命令选项 假设源程序文件名为test.c。
无选项编译链接 用法:#gcc test.c 作用:将test.c预处理、汇编、编译并链接形成可执行文件。这里未指定输出文件,默认输出为a.out。
先来放一波过程中用到的资料和官方文档好了。
basic layout_qt5.8
QBoxLayout Class_qt5.8
QString Class 5.8
QChar Class qt 5.8
Standard Dialogs Example qt 5.8
更新的部分还是放在最前面好了。
convert from QString to char *的时候有个坑。
In order to convert a QString to a char*, then you first need to get a latin1 representation of the string by calling toLatin1() on it which will return a QByteArray. Then call data() on the QByteArray to get a pointer to the data stored in the byte array. See the documentation: See the following example for a demonstration:
嘛。。为了系统安全课来学一波qt…
现在算是写出了一个可以打开文件,保存文件的记事本。
接下来要搞定的事情是,如何写一个自定义的事件?比如计算个开方之类的。
题目链接
题意:有2种货币,分别为C和D.给出n种资源的代价和美丽度,每种资源只能用其中一种资源购买。现在拥有货币C的数量是c,拥有货币D的数量是d.然后恰好买2个资源,问最大美丽度,不能的话输出0.
题目链接
题意:有n个T恤,每个价格都不同,有三种颜色,分别用1,2,3表示,每件T恤给出前xiong和后背的颜色。现在有m个顾客排成一队,对于每个顾客,给出他喜欢的颜色,只要一个T恤的前xiong或者后背的颜色之一满足该颜色即可。顾客总希望买符合他喜欢颜色的T恤中价格最低的。现在问每个顾客买到的T恤的价格,如果某个顾客没有买T恤,输出-1
题目链接
题意:初始有一个锅,每t分钟可以做好k个饼,现在需要N个饼。还可以另外建一个锅,花费d时间,建好以后两个锅可以并行烙饼。问是否应该建锅?(以期减少烙饼时间)
思路:求出两种情况下的总时间,比较一下。
啊。。在准备考试QAQ
明天约了鹅厂面试。。。然而从四月就开始一直考试考试考试….感觉药丸啊?
MS的结果貌似明天也要出了orz…
之前没收到positive以为是跪了,结果听说有人没收到positive也拿到了offer啊?
症状是不管安装什么,都会说有一大堆依赖无法安装。。。
大概是: a depends b[i],but b[i] is not be installed. (b==0..n)
最后会提示Unable to correct problems, you have held broken packages
解决办法:用synaptic工具,把可能存在问题的包都清除掉。
我的chromebook 是 samsung 3
查阅Hardware Compatibility 可以知道我的cb支持 gallium,对应的cpu 是Intel Braswell
然后去galliumos 官网 下载相应版本。 (发现这种做法并不需要自己下载。。。)
安装 galliumOS大体有两种方法,一种是完全去掉chromeOS,这种方法需要拆机去除写保护。。。我嫌麻烦。。。于是打算另一种,使用chrx
连着考试。。。
取消考试周这做法就是蠢。。。
白天上课晚上考试。。。
说得好像没有考试周大家就不会复习了一样。。。
结果就只能是在白天的课上复习。。。
又影响听新的课,又影响复习。。。。
最让你恶心痛苦的那些人,你必要从他们身上学到最重要和有用的东西。 所有的痛苦都不能白受,克我者必生我。
在知乎看到这句话,不禁在想
人无疑是zhangk,可是学到了什么呢?
A peak element is an element that is greater than its neighbors.
Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.
The array may contain multiple peaks, in that case return the index to any one of the peaks is fine.
You may imagine that num[-1] = num[n] = -∞.
For example, in array [1, 2, 3, 1], 3 is a peak element and your function should return the index number 2.
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the largest product = 6.
思路:由于有正,有负,还有0.。。所以比最大子串之和要复杂一些。。。
dp[i].max表示到当前位置的最大乘积。
Given a sorted integer array without duplicates, return the summary of its ranges.
For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].
题意:把连续的数连续表示
思路:模拟。注意有负数,注意有-2147483648这种数据。
本来还想着,可能是leetcode加数据的审核机制太松,导致被人加了奇怪的数据。。。
Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn’t one, return 0 instead.
For example, given the array [2,3,1,2,4,3] and s = 7, the subarray [4,3] has the minimal length under the problem constraint
思路:尺取即可。。好久没写,竟然调了半天。。。
代码实现 1/* *********************************************** 2Author :111qqz 3Created Time :2017年04月13日 星期四 20时48分00秒 4File Name :209.cpp 5************************************************ */ 6class Solution { 7 8public: 9 10 int ruler(vector<int>nums,int tar,int n) 11 { 12 int head = 0; 13 int tail = 0; 14 int sum = 0 ; 15 int res = 0x3f3f3f3f; 16 while (tail<n&&head<=tail) 17 { 18 sum = sum + nums[tail]; 19 if (sum>=tar) 20 { 21 res = min(res,tail-head+1); 22 while (sum>=tar&&head<tail) 23 { 24 sum-=nums[head]; 25 head++; 26 } 27 if (sum>=tar) 28 { 29 res = min(res,tail-head+1); 30 } 31 else 32 { 33 head--; 34 sum+=nums[head]; 35 res = min(res,tail-head+1); 36 } 37 } 38 39 40 41 tail++; 42 } 43 return res==0x3f3f3f3f?0:res; 44 } 45 46 47 int minSubArrayLen(int s, vector<int>& nums) { 48 int n = nums.size(); 49 int res = ruler(nums,s,n); 50 return res; 51 52 53 } 54 55};
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space.
题意:给你n个数,要求找出出现此处大于n/3的。。。
思路:之前做过一个找出n个数出现此处大于n/2的题目,思想是“非吾族类,其心必异”。。
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.
题意:一个数组,由0,1,2组成,现在要求升序排列
思路:无脑做法就是计数排序,扫两遍,时间复杂度O(n),空间复杂度O(1)