This file contains hidden or 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
#!/usr/bin/env ruby | |
require "find" | |
def get_opts | |
require 'trollop' | |
opts = Trollop::options do | |
version "#{File.basename($PROGRAM_NAME)} 1.0.0 (c) 2014 Wubin Qu" | |
banner <<-EOS |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"fmt" | |
"log" | |
"os" | |
"strings" | |
"bufio" | |
"io" |
This file contains hidden or 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
" ~./vimrc | |
" Kompatibilitätsmodus abschalten | |
set nocompatible | |
" Im GUI-Modus Consolas Zeichensatz setzen und fruity Farbschema benutzen. | |
if has("gui_running") | |
colorscheme fruity | |
set guifont=Consolas\ 12 | |
else |
This file contains hidden or 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
// layout file | |
<body> | |
<div class="container"> | |
<%= flash_messages %> | |
<%= yield %> | |
</div><!-- /container --> | |
</body> |
This file contains hidden or 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 sys | |
import numpy | |
from nltk.cluster import KMeansClusterer, GAAClusterer, euclidean_distance | |
import nltk.corpus | |
from nltk import decorators | |
import nltk.stem | |
stemmer_func = nltk.stem.EnglishStemmer().stem | |
stopwords = set(nltk.corpus.stopwords.words('english')) |
This file contains hidden or 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
#!/usr/bin/bash | |
# Give all CPUs usage percent | |
ps fuxw | awk '{ if ($3 ~ /^[0-9]/) {SUM +=$3}} END {print SUM"%"}' |
This file contains hidden or 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
#!/usr/bin/env ruby | |
Dir.foreach('./') do |dir| | |
next unless File.directory?(dir) | |
next if ['.', '..'].include?(dir) | |
if Dir.entries(dir) == ['.', '..'] | |
Dir.delete(dir) | |
end | |
end |
This file contains hidden or 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
#!/home/zhangcg/local/python/bin/python | |
# -*- coding:utf-8 -*- | |
#----------------------------------------------------- | |
# File: CairoNumberWidth.py | |
# Date: 2008-07-04 | |
# Description: | |
#----------------------------------------------------- | |
__version__ = '1.0' |
This file contains hidden or 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
#!/usr/bin/python | |
# Author: Wubin Qu <[email protected]> | |
# Tue Jan 28 23:17:08 2014 | |
import platform | |
import subprocess | |
import re | |
def get_free_memory(): |
This file contains hidden or 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
require 'bio' | |
# Input is abstract file in Medline format. | |
year_count = Hash.new(0) | |
File.read(ARGV[0]).split("\n\n").each do |article_block| | |
article = Bio::MEDLINE.new(article_block) | |
year_count[article.year] += 1 | |
end | |
year_count.each do |year, count| | |
puts "#{year}, #{count}" |
NewerOlder