-
In confronting complex situations, no single model can capture everything. Thus, we need to bring several of models to bear, not just one
-
as powerful as models may be, they’re only guides to thinking. We have to maintain contact with reality.
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
(function () { | |
var hot_movies = document.querySelectorAll('.ui-slide-item'); | |
[].forEach.call( | |
hot_movies, | |
function (e) { | |
var rate = e.getAttribute('data-rate'); | |
rate = parseInt(rate, 10); | |
if (!isNaN(rate) && rate < 7) { | |
e.remove(); | |
} |
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
[etcd] Jul 31 03:41:53.475 INFO | 20634ec121f9479ca7a6cd50a5efcc0b: warning: heartbeat time out peer="86a6adecb8c | |
[etcd] Jul 31 03:42:24.976 INFO | 20634ec121f9479ca7a6cd50a5efcc0b: warning: heartbeat time out peer="86a6adecb8c | |
[etcd] Jul 31 03:44:00.477 INFO | 20634ec121f9479ca7a6cd50a5efcc0b: warning: heartbeat time out peer="86a6adecb8c | |
[etcd] Jul 31 03:44:32.225 INFO | 20634ec121f9479ca7a6cd50a5efcc0b: warning: heartbeat time out peer="86a6adecb8c | |
[etcd] Jul 31 03:45:36.475 INFO | 20634ec121f9479ca7a6cd50a5efcc0b: warning: heartbeat time out peer="86a6adecb8c | |
[etcd] Jul 31 03:46:10.975 INFO | 20634ec121f9479ca7a6cd50a5efcc0b: warning: heartbeat time out peer="86a6adecb8c | |
[etcd] Jul 31 03:46:43.976 INFO | 20634ec121f9479ca7a6cd50a5efcc0b: warning: heartbeat time out peer="86a6adecb8c | |
[etcd] Jul 31 03:47:12.563 INFO | 20634ec121f9479ca7a6cd50a5efcc0b: warning: heartbeat time out peer="86a6adecb8c | |
[etcd] Jul 31 03:47:16.475 INFO | 20634ec121f9479ca7a6cd50a5efcc0b: |
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
$ mtr -u --report -c 10 douban.com | |
Start: Sat Jan 3 09:57:13 2015 | |
HOST: diablo Loss% Snt Last Avg Best Wrst StDev | |
1.|-- 10.255.254.34 0.0% 10 0.4 0.4 0.3 0.6 0.0 | |
2.|-- 203.90.233.1 0.0% 10 1.0 1.3 0.7 4.8 1.1 | |
3.|-- 202.97.122.101 0.0% 10 4.8 3.5 1.7 5.4 1.2 | |
4.|-- 202.97.61.37 0.0% 10 39.9 39.0 37.5 40.9 0.8 | |
5.|-- 202.97.53.233 0.0% 10 38.9 39.7 38.5 40.9 0.5 | |
6.|-- 202.97.53.93 0.0% 10 37.6 39.9 37.6 42.5 1.7 | |
7.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.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
import random | |
import datetime as dt | |
import requests | |
from pyquery import PyQuery as pq | |
s = requests.Session() | |
d = {'form_email': 'xxx', 'form_password': 'yyy'} | |
today = dt.datetime.today() | |
login_url = 'https://accounts.douban.com/login' |
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
import random | |
def setup_doors(): | |
doors = [0] * 3 | |
doors[random.choice(range(3))] = 1 | |
return doors | |
def select(): | |
return random.choice(range(3)) |
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
s = "s = {:c}{}{:c}{:c}print(s.format(34, s, 34, 10))" | |
print(s.format(34, s, 34, 10)) |
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
In [74]: timeit.timeit(stmt='del dll[10000]', setup='from collections import deque;dll = deque(range(10**5))', number=100) | |
Out[74]: 0.002535041014198214 | |
In [75]: timeit.timeit(stmt='del l[10000]', setup='l = list(range(10**5))', number=100) | |
Out[75]: 0.006009762000758201 |
-
Simple Graph
-
Undirected
-
has no loops
-
no more than one edge between any two different vertices
-
Regular Graph
- each vertex has the same number of neighbors
-
Complete Graph
-
each pair of vertices has an edge connecting them
- different functions with the same growth rate may be represented using the same O notation.
- If f(x) is a sum of several terms, the one with the largest growth rate is kept, and all others omitted.
- If f(x) is a product of several factors, any constants (terms in the product that do not depend on x) are omitted.
OlderNewer