1 #!/bin/bash 2 #based on a script from
http://invisible-island.net/xterm/xterm.faq.html 3 exec /dev/tty 8 # tput u7
> /dev/tty # when TERM=xt...
分类:
其他好文 时间:
2014-05-21 18:43:15
阅读次数:
300
In bash shell, when you use a dollar sign
followed by a variable name, shell expands the variable with its value. This
feature of shell is called para...
分类:
其他好文 时间:
2014-05-21 18:32:32
阅读次数:
332
Say you have an array for which theithelement
is the price of a given stock on dayi.Design an algorithm to find the maximum
profit. You may complete a...
分类:
其他好文 时间:
2014-05-21 17:27:55
阅读次数:
252
【题目】
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and uses constant space.
【题意】
给定一个数组,找出第一个缺失的正数。时间复杂度O(n)
...
分类:
其他好文 时间:
2014-05-21 17:13:07
阅读次数:
219
【题目】
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
Each number in C may only be used once in the combination.
Note:
All numbers (including target) will be ...
分类:
其他好文 时间:
2014-05-21 15:55:25
阅读次数:
259
【题目】
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
The same repeated number may be chosen from C unlimited number of times.
Note:
All numbers (including target) w...
分类:
其他好文 时间:
2014-05-21 15:21:28
阅读次数:
292
今天在腾讯云的服务器被攻击后,apache启动报错,查找原因发现是磁盘空间不够no space left on device,
诡异的是df命令磁盘占用仅55%
继续查找原因,发现是iNode已满,即没有索引空间
这就好办了,首先定位哪个目录占用iNode最多,命令如下:
find */ ! -type l | cut -...
分类:
系统相关 时间:
2014-05-21 14:46:09
阅读次数:
363
这篇博客主要讨论了在EBS form 查询界面上, 点击 find 之后走了哪些代码流程, 数据库里面的值是怎样被赋值到界面上去的....
分类:
其他好文 时间:
2014-05-21 11:28:37
阅读次数:
421
题目:
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up t...
分类:
其他好文 时间:
2014-05-21 07:42:18
阅读次数:
230
做过一些的带权并查集,再来做所谓的“种类并查集",发现好像就顿悟了。
种类并查集与带权并查集实质上的差别并不大, 关键的区别就是种类并查集只是带权并查集再弄个%取余操作而已,然后余数就表示他属于哪个种类。
这题只有两个种类,也就是只有0和1两种, 对于两个不同的种类,那么之间的权值是相差1的,所以按照带权并查集的方法做加上1,然后取余2即可。
#include
const int N = ...
分类:
其他好文 时间:
2014-05-21 07:24:40
阅读次数:
173