通常,合并分支时,如果可能,Git会用“Fast forward”模式,但这种模式下,删除分支后,会丢掉分支信息。如果要强制禁用“Fast forward”模式,Git就会在merge时生成一个新的commit,这样,从分支历史上就可以看出分支信息。下面我们实战一下--no-ff方式的merge:首...
分类:
其他好文 时间:
2014-07-08 00:58:29
阅读次数:
202
Implement an algorithm to find the kth to last element of a singly linked list.Classical "Runner" Technique of linkedlist/*Use two pointers, forward o...
分类:
其他好文 时间:
2014-07-08 00:37:17
阅读次数:
315
今天来按照apidemos提供的方法来实现slow loading的效果.
Main.java
import android.app.ListActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view...
看apidemos的 activate items 很简单,就是继承ListActivity, 然后给使用了 api 11中一个系统样式的textView.
然而在 API level 11 之前运行会报错.如果在11之前实现 Activateitems给出的效果,那必然要给textView 的background属性设置一个press等状态的xml来,drawable其选中的背景....
题目:
* 将 电话号码 one two 。。。nine zero 翻译成1 2 。。9 0
*
* 中间会有double
*
* 例如
* 输入:OneTwoThree
* 输出:123
* 输入:OneTwoDoubleTwo
* 输出:1222
* 输入:1Two2
* 输出:ERRO...
分类:
其他好文 时间:
2014-07-06 09:24:44
阅读次数:
229
链表的归并排序
超时的代码
class Solution:
def merge(self, head1, head2):
if head1 == None:
return head2
if head2 == None:
return head1
# head1 and head2 point to the same link list
if head1 == he...
分类:
编程语言 时间:
2014-07-06 09:09:51
阅读次数:
275
;; Fermat's Little Theorem:
;; If N is a prime number and A is any positive integer less
;; than N, then A raised to the N-th power is congruent to A modulo N
;; Two numbers are said to be congruent...
分类:
其他好文 时间:
2014-07-06 09:05:22
阅读次数:
158
Euclid's Game
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 1880 Accepted Submission(s): 825
Problem Description
Two players, Stan...
分类:
其他好文 时间:
2014-07-06 00:02:49
阅读次数:
253
There are two sorted arrays A and B of size m and n respectively.
Find the median of the two sorted arrays.
The overall run time complexity should be O(log (m+n)).
有两个已排序的数组A和B,大小为m 和 n。
找出两数组的中...
分类:
其他好文 时间:
2014-07-05 22:54:17
阅读次数:
244
一直在找svn回滚的方法,这个还是很实用的,屡试不爽阿
经常由于坑爹的需求,功能要切回到之前的某一个版本。有两种方法可以实现:
方法1: 用svn merge
1) 先 svn up,保证更新到最新的版本,如20;
2) 然后用 svn log ,查看历史修改,找出要恢复的版本,如10 。如果想要更详细的了解情况,可以使用svn diff -r 10:20 [文件或目录];
3...
分类:
其他好文 时间:
2014-07-05 22:50:24
阅读次数:
351