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
sorted_firm_forces = [0.0, | |
0.0138888883369941, | |
0.0555555533479762, | |
0.0694444416849703, | |
0.166666660043929, | |
0.263888878402887, | |
0.277777766739881, | |
0.291666655076875, | |
0.305555543413869, | |
0.319444431750863] |
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
first_ten_forces = [0.0, | |
0.0208333330228925, | |
0.041666666045785, | |
0.0624999990686774, | |
0.0833333320915699, | |
0.104166665114462, | |
0.124999998137355, | |
0.145833331160247, | |
0.16666666418314, | |
0.187499997206032] |
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
questionable_strides = { \ | |
val: int(round(indexed_distances[val] * 60 * 100)) / 100.0 \ | |
for val in questionable_indices } |
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
questionable_indices = [ ix \ | |
for ix, val in indexed_distances.iteritems() \ | |
if int(round(val * 60)) != 1 ] |
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
distances = [] | |
i = 0 | |
while i < len(sorted_forces) — 2: | |
this_val = sorted_forces[i] | |
next_val = sorted_forces[i+1] | |
# ^^ this is why we use -2 instead of -1 in the while condition | |
distance = next_val — this_val | |
distances.append(distance) | |
i += 1 |
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
var possibleForceValues: Set<CGFloat> = [] | |
func touchUpdatedHandler(touch: UITouch) { | |
let preInsertionLength = possibleForceValues.count | |
possibleForceValues.insert(touch.force) | |
let postInsertionLength = possibleForceValues.count | |
if postInsertionLength - preInsertionLength == 1 { | |
print("inserted unique force: \(touch.force)") | |
} | |
} |
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 | |
matcher = re.compile('^inserted unique force: (\d*\.\d*)$') | |
with open('pasted_log_file.txt', 'r') as lf: | |
lines = lf.readlines() | |
forces = set() | |
for line in lines: | |
match = matcher.search(line) | |
if match: | |
groups = match.groups() | |
force = groups[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
# Released as CC0 - do what you wish with these, they're just numbers. | |
sorted_force_values = [0.0, | |
0.0166666666666667, | |
0.0333333333333333, | |
0.05, | |
0.0666666666666667, | |
0.0833333333333333, | |
0.1, | |
0.116666666666667, | |
0.133333333333333, |
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
touches began: | |
[<UITouch: 0x1375295e0> phase: Began tap count: 1 window: <UIWindow: 0x1376422c0; frame = (0 0; 667 375); autoresize = W+H; gestureRecognizers = <NSArray: 0x13762fe90>; layer = <UIWindowLayer: 0x1376422a0>> view: <TouchCanvas.CanvasView: 0x1375544d0; frame = (0 0; 667 375); autoresize = W+H; layer = <CALayer: 0x137554ef0>> location in window: {507.5, 172} previous location in window: {507.5, 172} location in view: {507.5, 172} previous location in view: {507.5, 172}] | |
touch pressure: 0.366666666666667 | |
touch pressure: 0.95 | |
touch pressure: 1.73333333333333 |
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 private/docker/host/postgres-flask-uwsgi-nginx | |
MAINTAINER Kevin Nelson "[email protected]" | |
# Set up nginx by removing the default site, and adding ours | |
#RUN rm /etc/nginx/sites-enabled/default | |
RUN ln -s $APP_DIR/deploy/nginx.conf /etc/nginx/conf.d/ | |
# create log folders | |
RUN mkdir -p /var/log/uwsgi |