This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.actors.Actor | |
import scala.actors.Actor._ | |
case object Ping | |
case object Pong | |
case object Stop | |
class Ping(count: Int, pong: Actor) extends Actor { | |
def act() { | |
var pingsLeft = count - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ========================= | |
" File: daqing.vim | |
" Description: small plugin to asistant my day-to-day development | |
" Maintainer: Kinch Zhang <kinch.zhang@gmail.com> | |
" License: The MIT License <http://www.opensource.org/licenses/mit-license.php> | |
" ========================= | |
fun! Write(str) | |
execute "normal I" . a:str . "\<Esc>" | |
endfun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def insertion_sort(seq) | |
(1..seq.size - 1).each do |i| | |
key = seq[i] | |
left = i - 1 | |
while left >= 0 and seq[left] > key | |
seq[left + 1] = seq[left] | |
seq[left] = key | |
left -= 1 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def insertion_sort(seq): | |
for i in range(1, len(seq)): | |
key = seq[i]; | |
left = i - 1; | |
while left >= 0 and seq[left] > key: | |
seq[left + 1] = seq[left] | |
seq[left] = key | |
left -= 1 | |
return seq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function insertion_sort($seq) | |
{ | |
$size = count($seq); | |
for ($i = 1; $i < $size; $i ++) { | |
$key = $seq[$i]; | |
$left = $i - 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function insertion_sort($seq) | |
{ | |
$size = count($seq); | |
for ($i = 1; $i < $size; $i ++) { | |
$key = $seq[$i]; | |
$left = $i - 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# svn commit wrapper | |
clear | |
echo -e "\n=> status changed:" | |
svn st | less -d | |
svn diff | less -d | |
echo -ne "\n=> do you want to commit? [y/n]: " | |
read i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set t_Co=256 | |
set nocompatible | |
set mouse=a | |
syntax on | |
filetype on | |
filetype plugin on | |
set autowrite | |
set autoread | |
set number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$bbcode = '[p][url=http://www.gmail.com][u]gmail[/u][/url]'; | |
$bbcode .= '[b][size=3]foo[/size][/b]'; | |
$bbcode .= '[color=red][u][i]bar[/i][/u][/color][/p]'; | |
$root = new BBCodeNode('root'); | |
$root = build_tree($bbcode, $root); | |
echo 'BBCode: ', $bbcode, "\n\n"; | |
traverse_tree($root, 'printer', 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
echo -e "\n=> status changed:" | |
svn st | less -d | |
svn diff | less -d | |
echo -ne "\n=> do you want to commit? [y/n]: " | |
read i | |
if [ -z "$i" ];then | |
svn commit -m "debug" | |
fi | |
echo -e "\n=> done." |