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 nu...
分类:
其他好文 时间:
2014-05-26 19:50:39
阅读次数:
314
1.php str_replace函数:str_replace()
函数使用一个字符串替换字符串中的另一些字符。str_replace(find,replace,string,count)find:必须,表示被查找的值replace:必须,替换别查找的值的值string:必须,被查找的字符串coun...
分类:
Web程序 时间:
2014-05-26 19:38:05
阅读次数:
292
出题:并查集(Union-Find
Sets)分析:一种树型数据结构,用于处理不相交集合(Disjoint
Sets)的合并以及查询;一开始让所有元素独立成树,也就是只有根节点的树;然后根据需要将关联的元素(树)进行合并;合并的方式仅仅是将一棵树最原始的节点的父亲索引指向另一棵树;优化:加入一个ra...
分类:
其他好文 时间:
2014-05-26 18:48:46
阅读次数:
290
1.先用:ls -al /usr/lib | grep
libevent查看是否已安装,如果已安装且版本低于1.3,则先通过:rpm -e libevent —nodeps进行卸载。安装:# wget
http://www.monkey.org/~provos/libevent-1.4.13-sta...
分类:
其他好文 时间:
2014-05-25 23:34:50
阅读次数:
271
在备份ltedecoder程序时,需要把此目录拷由到bak目录下,但decoder目录下有个大文件,不需要备份,还有日志问题,也不需要备份,如何实现呢??
方法:
cd /source-dir
find . -name .snapshot
-prune -o -print0 | cpio -pmd0 /dest-dir
解释: This command cop...
分类:
其他好文 时间:
2014-05-25 21:51:29
阅读次数:
518
原文:
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without ...
分类:
其他好文 时间:
2014-05-25 21:30:02
阅读次数:
276
IP层在内存中有一个路由表,当有数据要发送或接收到的数据到达IP层时,都要在这个路由表中进行查找,具体查找过程如下:
搜索路由表,寻找能与目的IP地址完全匹配的表目。如果找到,则发送。否则,执行下一步。搜索路由表,寻找能与目的网络号相匹配的表目。如果找到,则发送。否则,执行下一步。搜索路由表,寻找标为“默认”的表目。如果找到,则发送。否则,执行下一步。发送失败,则向应用层返回错误信息。
...
分类:
其他好文 时间:
2014-05-25 21:10:36
阅读次数:
324
Visual Assist X 快捷键 Shift+Alt+F Find References
查找引用 Shift+Alt+S FindSynbolDialog 打开查找符号对话框 Alt+G GotoImplementation 转到定义 Alt+M
ListMethodsInCurrentFi...
分类:
其他好文 时间:
2014-05-25 18:50:17
阅读次数:
350
gunzip -r hongchangfirst/data
如何递归删除那些剩余的非log结尾的文件?
先列出确认一下:
find hongchangfirst/data -type f ! -name "*.log"
然后真正的删除:
find hongchangfirst/data -type f ! -name "*.log" -exec rm -f {} \;...
分类:
系统相关 时间:
2014-05-25 09:41:05
阅读次数:
694
A palindromic number or numeral palindrome is a 'symmetrical' number like 16461 that remains the same when its digits are reversed. In this problem you will be given two integers i j, you have to find...
分类:
其他好文 时间:
2014-05-25 07:41:08
阅读次数:
253