原文地址:用bash脚本读文件的方法有很多。请看第一部分,我使用了while循环及其后的管道命令(|)(cat $FILE | while read line; do …),并在循环当中递增 i 的值,最后,我得到了非我所想的 i 。主要的原因是,管道命令会发起子shell来读取文件,而任何在(子s...
分类:
其他好文 时间:
2014-07-03 21:57:53
阅读次数:
289
Default do not need username and password authenticate when access mongoDB ,I want to set up the user name & password for my mongoDB. so that any remo...
分类:
数据库 时间:
2014-07-03 21:02:37
阅读次数:
343
题目:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space fo...
分类:
其他好文 时间:
2014-07-03 20:58:08
阅读次数:
248
Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.class Solution...
分类:
其他好文 时间:
2014-07-03 20:25:21
阅读次数:
219
Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.此题目有两种解决思路:1)递归...
分类:
其他好文 时间:
2014-07-03 20:07:01
阅读次数:
199
迭代对于我们搞Java的来说绝对不陌生。我们常常使用JDK提供的迭代接口进行Java集合的迭代。 Iterator iterator = list.iterator(); while(iterator.hasNext()){ String string = iterator.next(); //do...
分类:
编程语言 时间:
2014-07-03 19:06:49
阅读次数:
191
ruby on rails 修改数据库内所有用户的密码 ,全部改成1111
项目文件夹内:
rails c
User.all.each do |u|
u.password='1111'
u.password_confirmation='1111'
u.save
end...
分类:
数据库 时间:
2014-07-03 18:31:09
阅读次数:
237
在苹果的SDK中可以看到这两个都是定义的宏
NSAssert 的定义如下:
#define
NSAssert(condition, desc, ...)
do
{
__PRAGM...
分类:
其他好文 时间:
2014-07-03 16:08:07
阅读次数:
206
在某行或者某个位置,打印出“YY/MM/DDHH:MM:SS”先确定位置再输出即可注:有关时间格式到问题%Y:%B:%d%H:%M:%S定位以及光标到问题:tputcup1010tputsc,tputrc,tputcivis,tputcnorm#!/bin/sh
tputcivis
whiletrue
do
tputsc
#tputclear
tputcup1710
echo-n$(date+%Y)/$(da..
分类:
其他好文 时间:
2014-07-03 14:05:03
阅读次数:
177
refer linkThe"*and"+registers are for the system's clipboard (:help registers). Depending on your system, they may do different things. For instance, ...
分类:
其他好文 时间:
2014-07-03 12:10:56
阅读次数:
195