cd (打开目录)cd 返回到用户主目录cd .. 返回到上一级grep(查找文件)grep string test.log 查找并返回test.log里面包含string的行grep -c string test.log 查找并返回test.log里面包含string的行数grep -...
分类:
系统相关 时间:
2015-01-23 17:41:28
阅读次数:
167
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
P A H N
A P L S I I ...
分类:
其他好文 时间:
2015-01-23 16:27:21
阅读次数:
163
1. 每一个非基本类型的对象都有一个toString方法,而且当编译器需要一个String而你却只有一个对象时,该方法便会被调用。
public class SprinklerSystem {
private String valve;
public String toString() {
value = "test";
return "valve = " + valve;
}...
分类:
编程语言 时间:
2015-01-23 16:22:52
阅读次数:
169
题目描述:Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example,...
分类:
其他好文 时间:
2015-01-23 16:15:18
阅读次数:
131
简单的方法想日志中追加内容public static void updateSql(string Name,string str) { FileStream fs = new FileStream(@"D:\Acer\logSql.txt", FileMode.A...
分类:
其他好文 时间:
2015-01-23 16:02:33
阅读次数:
205
首先在function.php中定义一个函数:
//关键字描红
function keywords_red($string,$keywords=''){
if(empty($keywords)||empty($string)) return $string;
return str_replace($keywords,''.$keywords.'',$string);
}
然后在...
分类:
Web程序 时间:
2015-01-23 14:44:46
阅读次数:
117
Implicitly unwrapped optionals:
// an implicitly unwrapped optional variable
varmaybeString:String!maybeString=nilmaybeString="fish"
// methods invoked directly, failing at runtime// if the opt...
分类:
移动开发 时间:
2015-01-23 14:44:18
阅读次数:
203
今天遇到个问题,将"yyyyMMddHHmmss"直接用Convert.ToDateTime()转换时抛出个FormatException:该字符串未被识别为有效的 DateTime。到网上搜索了一下,找到了解决方案: string time1 = "20150123134045"; ...
题目:
Given an absolute path for a file (Unix-style), simplify it.
For example,
path = "/home/", => "/home"
path = "/a/./b/../../c/", => "/c"
click to show corner cases.
Corner Cases:
...
分类:
编程语言 时间:
2015-01-23 13:34:14
阅读次数:
204
#include
#include
#include //包含system()函数
#include
using namespace std;
const char *to_search = "F:\\pro\\VC++ VFW\\*.cpp"; //欲查找的文件,支持通配符*
int main()
{
long handle; //用于查找的句柄
string str,...
分类:
其他好文 时间:
2015-01-23 13:23:27
阅读次数:
210