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
# 在 ~/Library/Rime 下建立 default.custom.yaml,输入如下内容,然后在菜单栏点「重新部署」 | |
patch: | |
schema_list: | |
- schema: wubi86 |
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
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
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()); |
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
0177 |
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
test python. | |
fro deata clean |
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
# -*- 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(): |
OlderNewer