过滤重复字符[plain] view plaincopyperl-e'$_=;@in=split;if(@in15 && NRFNR&&!a[$0]' file1 file2 找出文件2中不同的值awk 'NR==FNR{a[$0]++} NR>FNR&&a[$0]' file1 file2 找出两...
分类:
其他好文 时间:
2015-04-19 00:55:51
阅读次数:
327
在manifest的入口activity里面intent-filter中设置元素。比如:注意,android:scheme是大小写敏感的,必须以小写字母开头也就是这个MainActivity可以响应Uri为com.android.example://AuthActivity的特定 Intent但是为...
分类:
其他好文 时间:
2015-04-19 00:57:09
阅读次数:
144
题目链接: HDU - 1501Given three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings....
分类:
其他好文 时间:
2015-04-19 00:57:26
阅读次数:
207
题目大意:求最大的两个数的最大公约数。思路:数据范围较小,只有10^5,可以考虑哈希。解法1: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int N = 100001; 7 int hash_table...
分类:
其他好文 时间:
2015-04-19 00:53:37
阅读次数:
174
```java /** * 半角转全角 * @param input String. * @return 全角字符串. */ public static String ToSBC(String input) { char c[] = input.toCharArray(); for (int i = 0; i < c.length; i++) { if (c[i] == ...
分类:
其他好文 时间:
2015-04-18 23:54:35
阅读次数:
300
1.?编写一个函数,给定字符串,产出一个包含所有字符的下标的映射。举例来说:indexes("Mississippi")应返回一个映射,让‘M‘对应集{0},‘i‘对应集{1,4,7,10},依此类推。 使用字符到可变集的映射。另外,你如何保...
分类:
其他好文 时间:
2015-04-18 23:51:39
阅读次数:
316
-l参数就是用来指定程序要链接的库,-l参数紧接着就是库名,那么库名跟真正的库文件名有什么关系呢?就拿数学库来说,他的库名是m,他的库文件名是libm.so,很容易看出,把库文件名的头lib和尾.so去掉就是库...
分类:
其他好文 时间:
2015-04-18 23:52:42
阅读次数:
291
$>?yum?install?ruby 查看是否安装成功: $>?ruby?-v 若安装成功,则会显示ruby的版本 接着安装rails 由于要国内网络被**,下载不稳定,因此使用国内镜像安装 $>?gem?source?-l
出现 删除此source,并添加...
分类:
其他好文 时间:
2015-04-18 23:54:21
阅读次数:
351
唉,最近熬夜看动漫,早上还测了个蛋疼的数学测验,我也是醉了,今天得早点睡。 实验目的:在flask应用中使用多个http头并借助PUT,POST提交数据 源代码: __author__?=?‘hochikong‘
from?flask?import?Fla...
分类:
其他好文 时间:
2015-04-18 23:51:27
阅读次数:
349
为什么要用分布式锁 分布式系统,需要采用集群,多个服务之间可能需要用到共享数据(redis或者数据库),这时,JVM内的锁已经不能满足跨JVM的需求,因此需采用外部的锁机制 如何实现分布式锁 个人理解,不管是jav...
分类:
其他好文 时间:
2015-04-18 23:51:10
阅读次数:
286
题目描述Given numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5,
Return
从第三行开始,每行除了最左边和最右边两个数为1,其他数字都是上一行中相邻两个数字之和。根据上述规则可以写出下面的代码:class Solution {
public:
vecto...
分类:
其他好文 时间:
2015-04-18 23:49:45
阅读次数:
341
这道题搞了好久,刚开始数组开小了RE,然后是用了set就TLE,最后用数组替换set就变成了WA,最后终于发现了问题,原来if语句和else语句之间的逻辑没搞清楚
A掉之后感觉眼泪都要掉下来了
#include
#include
#include
#include
#include
using namespace std;
#define N 201005
char s[101][2001]...
分类:
其他好文 时间:
2015-04-18 23:48:45
阅读次数:
229
ZOJ 3327 Friend Number(数学啊 )...
分类:
其他好文 时间:
2015-04-18 23:51:14
阅读次数:
278
题目描述Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.使用字符串表示数字,对数字进行“加1”操作,返回结...
分类:
其他好文 时间:
2015-04-18 23:48:52
阅读次数:
208
飘过的小牛,争取成为全球统一账号2013 年本科毕业,90 后弱菜一枚前新浪广告技术部 RD,现百度凤巢 RD热爱分享。希望结交更多志同道合的朋友共同进步:)热爱跑步。2015 年计划每周刷一次奥森 10 公里,争取参加北马
github pages 地址:飘过的小牛(http://github.thinkingbar.com)
PS:专注技术。请发表技术评论,勿灌水,...
分类:
其他好文 时间:
2015-04-18 23:50:16
阅读次数:
369
题目描述Given a binary tree, flatten it to a linked list in-place.For example,
Given
The flattened tree should look like:
本题也是考察二叉树和指针操作的题目。题目要求将一棵二叉树拉平为一个链表 。链表通过树节点的右子树相连,且展开的顺序为原来树的前序遍历。实现思路:
若节点n存...
分类:
其他好文 时间:
2015-04-18 23:48:59
阅读次数:
213
/**
* 开始定时器
*/
-(void)addTimer
{
NSTimer * timer = [NSTimer
scheduledTimerWithTimeInterval:2.0
target:self
selector:@selector(nextPage)
userInfo:nil
repeats:YES];
// 这样 ti...
分类:
其他好文 时间:
2015-04-18 23:47:55
阅读次数:
156