>>> t = Tree()
>>> d = {}
>>> d["hoge"] = 1
>>> d["fuga"] = 2
>>> d["piyo"] = 3
>>> d
{'fuga': 2, 'piyo': 3, 'hoge': 1}
>>> t["a"]["b"]["hoge"]=1
>>> t["a"]["b"]["fuga"]=2
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
俺の iPhone 4 (iOS 5.0.1) の JB 環境まとめ。とりあえず。 | |
--- | |
Sources | |
*Backspace Repos* | |
http://v.backspace.jp/repo/ | |
*BigBoss* | |
http://apt.thebigboss.org/repofiles/cydia/dists/stable |
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 json | |
import urllib, urllib2 | |
import time | |
from datetime import datetime | |
from lib.core import Input | |
class Teiden(Input): | |
def get_info(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
# -*- coding: utf-8 -*- | |
from pymongo import Connection | |
from lib.core import Filter | |
class Deleted(Filter): | |
def init(self): | |
self.watch = [] # 監視対象のスクリーンネームを入れる. 空なら全部通知 | |
addr = "localhost" |
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 os | |
def get_ancestor_dir(path, n): | |
''' | |
pathからn階層上のディレクトリを返す | |
path: ディレクトリの文字列. os.path.abspath(__file__)とかを想定. | |
n: 遡る階層の数 | |
return: パスの文字列 | |
''' |
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 | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright 2007 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
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
#include<Python/Python.h> | |
#include<vector> | |
#include<map> | |
#include<queue> | |
#include<functional> | |
using namespace std; | |
struct Point{ | |
short x,y; |
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
from scipy import signal | |
def lpf(x, cutoff_freq, samp_rate): | |
norm_pass = cutoff_freq/(samp_rate/2) | |
norm_stop = 1.5*norm_pass | |
N, Wn = signal.buttord(wp=norm_pass, ws=norm_stop, gpass=2, gstop=30, analog=0) | |
b, a = signal.butter(N, Wn, btype='low', analog=0, output='ba') | |
y = signal.lfilter(b, a, x) | |
return y |
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 cPickle as pickle | |
import pylab | |
from mpl_toolkits.mplot3d.axes3d import Axes3D | |
from numpy import arange, sqrt, cos, sin, matrix, identity, pi | |
from scipy import signal | |
from scipy.interpolate import UnivariateSpline | |
def squarediff(x, y): |
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 urllib, urllib2 | |
from oauth import OAuth | |
class Api(): | |
def __init__(self, atoken="", atokensecret="", ckey="", csecret="", hostname=""): | |
self.oauth = OAuth(ckey, csecret, atoken, atokensecret) | |
self.site = "http://api.tumblr.com/v2/blog/%s/" % (hostname) | |
OlderNewer