Interactive tool for creating directed graphs, created using d3.js.
Demo: http://bl.ocks.org/cjrd/6863459
Operation:
- drag/scroll to translate/zoom the graph
| @decorator_with_args | |
| def with_request_values_positionally(view, keys=[], optional_keys=[], | |
| error_view=request_by_json_missing_value): | |
| try: | |
| values = [request.values[key] for key in keys] | |
| #Only catch a KeyError from that particular lookup, not the whole view function | |
| except KeyError: | |
| return error_view() | |
| def relative_datetime(then): | |
| delta = arrow.now() - then | |
| years, days_of_year = delta.days // 365, delta.days % 365 | |
| months_of_year, days_of_month = days_of_year // 30, days_of_year % 30 | |
| hours_of_day, seconds_of_hour = delta.seconds // (60*60), delta.seconds % (60*60) | |
| minutes_of_hour, seconds_of_minute = seconds_of_hour // 60, seconds_of_hour % 60 | |
| if years != 0: |
Interactive tool for creating directed graphs, created using d3.js.
Demo: http://bl.ocks.org/cjrd/6863459
Operation:
| #!/usr/bin/env python3 | |
| import sys, os | |
| def fix_eol(filename): | |
| with open(filename) as f: | |
| contents = f.read() | |
| if not contents.endswith("\n"): | |
| contents += "\n" |