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
class BoyerMoore | |
attr_accessor :text | |
attr_reader :pattern, :matches | |
def initialize( opts ) | |
@text = opts[:text] | |
end | |
def search( pattern_str ) | |
@pattern = Pattern.new( pattern_str ) |
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
# default.custom.yaml | |
# save it to: | |
# ~/.config/ibus/rime (linux) | |
# ~/Library/Rime (macos) | |
# %APPDATA%\Rime (windows) | |
patch: | |
# patch: 这一行 不可重复. | |
"menu/page_size": 7 # 设置候选字数量 个人喜好 7 |
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
#!/usr/bin/python | |
# -*- coding:utf-8 -*- | |
import re | |
import sys | |
import requests | |
reload(sys) | |
sys.setdefaultencoding('utf8') |
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
### MATPLOTLIBRC FORMAT | |
# This is a sample matplotlib configuration file - you can find a copy | |
# of it on your system in | |
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it | |
# there, please note that it will be overridden in your next install. | |
# If you want to keep a permanent local copy that will not be | |
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux | |
# like systems) and C:\Documents and Settings\yourname\.matplotlib | |
# (win32 systems). |
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
CONFIG = { | |
'Arial Black' : 'ENG', | |
'Arial' : 'ENG', | |
'Calibri' : 'ENG', | |
'Cambria' : 'ENG', | |
'Candara' : 'ENG', | |
'Comic Sans MS' : 'ENG', | |
'Constantia' : 'ENG', | |
'Corbel' : 'ENG', | |
'Georgia' : 'ENG', |
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
$ tmux attach | |
protocol version mismatch (client 7, server 6) | |
$ pgrep tmux | |
3429 | |
$ /proc/3429/exe attach |
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
#sudo apt-get remove maven2 | |
sudo add-apt-repository "deb http://ppa.launchpad.net/natecarlson/maven3/ubuntu precise main" | |
sudo apt-get update | |
sudo apt-get install maven3 | |
#If you encounter this: | |
#The program 'mvn' can be found in the following packages: | |
# * maven | |
# * maven2 |
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
#!/usr/local/bin/python2 | |
# -*- coding: utf-8 -*- | |
# Author: Ficapy | |
# Create: '16/1/1' | |
import datetime | |
import sys | |
import os | |
import atexit | |
import requests |
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
class Tx(object): | |
def __init__(self): | |
print("Tx:init") | |
self.something() | |
def something(self): | |
print("Tx:something") | |
def otherthing(self): | |
print("Tx:otherthing") |
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
# 適用於【鼠鬚管】0.9.13+ | |
# 位置:~/Library/Rime/squirrel.custom.yaml | |
# 用法:想要哪項生效,就刪去該行行首的#字符,但注意保留用於縮進的空格 | |
patch: | |
# us_keyboard_layout: true # 鍵盤選項:應用美式鍵盤佈局 | |
# show_notifications_when: growl_is_running # 狀態通知,默認裝有Growl時顯示,也可設爲全開(always)全關(never) | |
# style/horizontal: true # 候選窗横向顯示 | |
# style/inline_preedit: false # 非內嵌編碼行 | |
# style/font_face: "儷黑 Pro" # 我喜歡的字體名稱 |
OlderNewer