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
"use strict"; | |
exports.__esModule = true; | |
//script requires you to run | |
//npm install watch | |
//before running it. | |
var fs = require("fs"); | |
var watch = require("watch"); |
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
adb backup --noapk <your_apk_package_name> | |
#extract it, skipping the first 24. we'll use them later though, so keep the files | |
dd if=backup.ab bs=24 skip=1 | /usr/local/ssl/bin/openssl zlib -d > backup.tar | |
# do some stuff with it ... | |
#then repackage everything | |
/usr/local/ssl/bin/openssl zlib -e < ./newbackup.tar | dd of=newbackup.ab bs=24 seek=1 | |
#reapply the first 24 bit to the file | |
dd if=mybackup.ab bs=24 count=1 | dd of=backup.ab bs=24 conv=notrunc | |
adb restore newbackup.adb #and confirm on the device |
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
# | |
# $Id: 3D plot of performance | |
# | |
# Processes files that were created by Generate_Graphs | |
# and displays the results. Also, saves a postscript copy. | |
# | |
# Don Capps | |
dirs = "write rewrite read reread randread randwrite bkwdread recrewrite strideread fwrite frewrite fread freread" | |
titles = "Write ReWrite Read Reread Random_read Random_write Read_Backwards Record_rewrite Stride_read Fwrite Frewrite Fread Freread" |
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
alignment top_right | |
background no | |
border_width 1 | |
color1 07CC0D | |
color2 D1E7D1 | |
color3 FF0000 | |
color4 FFFFFF | |
cpu_avg_samples 2 | |
default_color D1E7D1 | |
default_outline_color white |
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 json | |
import os | |
path = os.path.abspath(os.path.curdir) + "/Searches" | |
json_files = os.listdir(path) | |
#helper function | |
def parse_file(file_dict): | |
queries = [] | |
for q in file_dict.get('event'): | |
q = q.get('query') |
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 datetime | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import matplotlib.patches as patches | |
import matplotlib.path as path | |
# preparing our timestamps | |
timestamps = [int(q[1][:-6]) for q in searches] | |
datetime_timestamps = [datetime.datetime.fromtimestamp(ts) for ts in timestamps] |
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
year_dow_pairs = [[ts.year, ts.isoweekday()] for ts in datetime_timestamps] | |
year_dow_pairs[4] | |
#getting year dict | |
years = list(set([ts.year for ts in datetime_timestamps])) | |
years.sort() | |
dow_in_year_dict = {} | |
for year in years: | |
dow_in_year_dict[str(year)] = [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
from collections import Counter | |
terms = [t[0] for t in searches] | |
term_counts = Counter(terms) | |
term_counts = list(term_counts.items()) | |
term_counts.sort(key=lambda tup: tup[1],reverse=True) | |
for term in term_counts[0:30]: | |
print(term) |
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 re | |
def cleanup_term(term): | |
words = re.findall('[\w]+', term) | |
return [w.lower() for w in words] | |
clean_terms = [cleanup_term(t) for t in terms] | |
print(len(clean_terms)) | |
terms_singles = [] |
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 wordcloud import WordCloud | |
wordcloud = WordCloud().generate(" ".join(terms_singles)) | |
plt.axis("off") | |
fig = plt.figure() | |
fig.set_size_inches(21,9) | |
# lower max_font_size | |
wordcloud = WordCloud(max_font_size=80, width=2100, height=900, colormap='prism').generate(" ".join(terms_singles)) | |
plt.imshow(wordcloud, interpolation="bilinear") |