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
X = [ | |
1,0,3,0,0,0,0,0,1,0,0; % 7111 | |
1,1,0,0,0,0,0,0,0,2,1; % 8809 | |
1,0,1,2,0,0,0,0,1,0,0; % 2172 | |
1,0,0,0,0,0,0,4,0,0,0; % 6666 | |
1,0,4,0,0,0,0,0,0,0,0; % 1111 | |
1,0,0,4,0,0,0,0,0,0,0; % 2222 | |
1,0,0,1,0,0,0,2,1,0,0; % 7662 | |
1,0,1,0,2,0,0,0,0,0,1; % 9313 | |
1,4,0,0,0,0,0,0,0,0,0; % 0000 |
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/env python | |
import sys, os | |
import re | |
class Properties(object): | |
def __init__(self, prop_name): | |
self._keys = [] # the keys in parsing order | |
self._props = {} # the property dict |
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 | |
import numpy.random as random | |
from bisect import bisect_left, bisect_right | |
class SlaveNode: | |
def __init__ (self, data): | |
self.data = sorted(data) | |
def get_range (self): |
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 | |
# -*- encoding: UTF-8 -*- | |
import codecs | |
import sys | |
from math import log | |
from collections import defaultdict | |
class Trie (object): | |
class TrieNode: |