Skip to content

Instantly share code, notes, and snippets.

View staticor's full-sized avatar

SteveYagn staticor

View GitHub Profile
@staticor
staticor / default.custom.yaml
Last active August 29, 2015 14:08
鼠须管配置
# 在 ~/Library/Rime 下建立 default.custom.yaml,输入如下内容,然后在菜单栏点「重新部署」
patch:
schema_list:
- schema: wubi86
#!/usr/bin/python
# -*- coding:utf-8 -*-
import re
import sys
import requests
reload(sys)
sys.setdefaultencoding('utf8')
@staticor
staticor / matplotlibrc
Last active August 29, 2015 14:23 — forked from huyng/matplotlibrc
### 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).
CONFIG = {
'Arial Black' : 'ENG',
'Arial' : 'ENG',
'Calibri' : 'ENG',
'Cambria' : 'ENG',
'Candara' : 'ENG',
'Comic Sans MS' : 'ENG',
'Constantia' : 'ENG',
'Corbel' : 'ENG',
'Georgia' : 'ENG',
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 )
using System;
using System.Linq;
using System.Collections.Generic;
 
// http://acm.timus.ru/problem.aspx?space=1&num=1727
static class Timus
{
  static void Main()
  {
    var n = int.Parse(Console.ReadLine());
@staticor
staticor / 0717acm
Created July 17, 2013 11:58
acm everyday
0177
@staticor
staticor / python-1
Created July 24, 2013 05:21
data clean job.
test python.
fro deata clean
# -*- coding=utf-8 -*-
import collections
 
# Usage:
# 我的做法是把WordsDetector.py里的结果输出到文件,
# 然后把文件名放到下面的names列表中,运行本程序。
 
names = ['name0',
'name1',
'name2',
# -*- coding=utf-8 -*-
import feedparser
import re
import collections
import math
 
def info_entropy(words):
result = 0
total = sum([val for _, val in words.iteritems()])
for word, cnt in words.iteritems():