Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
h1994st committed Sep 29, 2016
1 parent 0f9bf4c commit ebd85ff
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 22 deletions.
13 changes: 11 additions & 2 deletions OurSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,11 @@ def extract9(riders, carriers):


def capacity(aI, aK):
assert aI >= 1, aI
assert aK >= 1, aK
assert aI >= 0, aI
assert aK >= 0, aK

if aI == 0 or aK == 0:
return 0, 0, 0, 0

t9 = T9(aI)
t5 = T5(aI)
Expand Down Expand Up @@ -596,3 +599,9 @@ def unrank(aI, aK, aMsg):
arrangement, rK = unrank(3, 3, 238)
print rK
print arrangement

for k in xrange(1, 11):
print 'K=%d' % k
for i in xrange(0, 101, 10):
print capacity(i, k)[0],
print ''
30 changes: 30 additions & 0 deletions output_ifttt_delay.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2016-09-26 12:55:22
# @Author : Tom Hu ([email protected])
# @Link : http://h1994st.com
# @Version : 1.0

import json


def main():
# Evernote -> Github via IFTTT
print 'Evernote -> Github via IFTTT'
with open('data/rtt/evernote_to_github_IFTTT.json') as fp:
data = json.load(fp)
delays1 = [x[1] - x[0] for x in data]

with open('data/rtt/evernote_IFTTT_github_1474663935.json') as fp:
data = json.load(fp)
delays2 = [x[1] - x[0] for x in data]

with open('data/rtt/evernote_IFTTT_github_1474714363.json') as fp:
data = json.load(fp)
delays3 = [x[1] - x[0] for x in data]

print delays1 + delays2 + delays3


if __name__ == '__main__':
main()
26 changes: 26 additions & 0 deletions output_rtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ def main():
intervals.append(
action_performed_at[i + 1] - action_performed_at[i])

print 'Delay Avg.:', np.mean(delays),
print 'Delay Std.:', np.std(delays)
print 'Interval Avg.:', np.mean(intervals),
print 'Interval Std.:', np.std(intervals)
with open('data/rtt/evernote_IFTTT_github_1474714363.json') as fp:
data = json.load(fp)
delays = [x[1] - x[0] for x in data]
action_performed_at = [x[1] for x in data]
intervals = []
for i in xrange(len(action_performed_at) - 1):
intervals.append(
action_performed_at[i + 1] - action_performed_at[i])

print 'Delay Avg.:', np.mean(delays),
print 'Delay Std.:', np.std(delays)
print 'Interval Avg.:', np.mean(intervals),
Expand All @@ -60,6 +73,19 @@ def main():

# Ghost -> Wordpress via Zapier
print 'Ghost -> Wordpress via Zapier'
with open('data/rtt/ghost_Zapier_wordpress_1474702567.json') as fp:
data = json.load(fp)
delays = [x[1] - x[0] for x in data]
action_performed_at = [x[1] for x in data]
intervals = []
for i in xrange(len(action_performed_at) - 1):
intervals.append(
action_performed_at[i + 1] - action_performed_at[i])

print 'Delay Avg.:', np.mean(delays),
print 'Delay Std.:', np.std(delays)
print 'Interval Avg.:', np.mean(intervals),
print 'Interval Std.:', np.std(intervals)
print ''

# Evernote -> Github via Zapier
Expand Down
40 changes: 20 additions & 20 deletions pool.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
"url": "http://english.sina.com/",
"children": [
{
"name": "",
"url": "",
"name": "Basketball",
"url": "http://english.sina.com/news/sports/basketball.html",
},
{
"name": "",
"url": "",
"name": "Science & Tech",
"url": "http://english.sina.com/news/biz-tech/scitech.html",
},
{
"name": "",
"url": "",
"name": "Movie",
"url": "http://english.sina.com/news/entertainment/movie.html",
}
]
},
Expand All @@ -24,34 +24,34 @@
"url": "https://us.yahoo.com/",
"children": [
{
"name": "",
"url": "",
"name": "News",
"url": "https://www.yahoo.com/news/",
},
{
"name": "",
"url": "",
"name": "Sports",
"url": "https://sports.yahoo.com/",
},
{
"name": "",
"url": "",
"name": "Movies",
"url": "https://www.yahoo.com/movies/",
}
]
},
{
"name": "Reddit",
"url": "https://www.reddit.com/",
"name": "Google News",
"url": "https://news.google.com/news?cf=all&ned=us&edchanged=1&ict=lbe_jp",
"children": [
{
"name": "",
"url": "",
"name": "Sports",
"url": "https://news.google.com/news/section?cf=all&ned=us&topic=s",
},
{
"name": "",
"url": "",
"name": "Entertainment",
"url": "https://news.google.com/news/section?cf=all&ned=us&topic=e&siidp=bfd47e14edb7406b0ea8c65415ec09a8f44d&ict=ln",
},
{
"name": "",
"url": "",
"name": "Health",
"url": "https://news.google.com/news/section?cf=all&ned=us&topic=m",
}
]
}
Expand Down

0 comments on commit ebd85ff

Please sign in to comment.