Sometime, we need to open a file or buffer which name began with current word in emacs.
Here I give the solution as follows.
(provide 'quick-file-jump)
(defun ab/quick-buffer-jump ()
"Quickly jum...
分类:
其他好文 时间:
2014-05-15 15:02:20
阅读次数:
373
水题。
描述的还挺麻烦的,实际上就是纸老虎,用两个string,一个存上一轮的结果,一个用来更新出这一轮的结果,每次扫描上一轮,统计一个字符出现的次数,然后把这个次数和字符加入到这一轮的字符串中就可以了。
class Solution {
public:
string countAndSay(int n) {
if(n == 0) return "";
...
分类:
其他好文 时间:
2014-05-15 04:12:07
阅读次数:
289
今天趁着看源代码的同时,记录学习的小知识。一、String.Split方法有6个重载函数:1)
public string[] Split(params char[] separator)2) public string[] Split(char[]
separator, int count)3) ...
分类:
Web程序 时间:
2014-05-15 01:47:50
阅读次数:
396
Description
Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the Universit...
分类:
其他好文 时间:
2014-05-15 00:20:39
阅读次数:
332
当我们查看JDK API的时候,总会发现一些类说明写着,线程安全或者线程不安全,比如说StringBuilder中,有这么一句,“将StringBuilder 的实例用于多个线程是不安全的。如果需要这样的同步,则建议使用StringBuffer。
”,那么下面手动创建一个线程不安全的类,然后在多线程中使用这个类,看看有什么效果。
Count.java:
...
分类:
编程语言 时间:
2014-05-14 20:42:25
阅读次数:
398
1、
??
Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S.
A subsequence of a string is a new string which is formed from the original str...
分类:
其他好文 时间:
2014-05-14 20:22:58
阅读次数:
275
不走索引的情况还是蛮多的1、条件字段选择性弱,查出的结果集较大,不走索引;2、where条件等号两边字段类型不同,不走索引;3、优化器分析的统计信息陈旧也可能导致不走索引;4、索引字段
is null 不走索引;5、对于count(*)当索引字段有not null约束时走索引,否则不走索引;6、li...
分类:
其他好文 时间:
2014-05-14 13:46:56
阅读次数:
326
最近在看Jdk6中String的源码的时候发现String的有个这样的构造方法,源代码内容如下:public String(String original)
{ int size = original.count; char[] originalValue = original.value; cha...
分类:
其他好文 时间:
2014-05-14 11:34:24
阅读次数:
274