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
def latlng_dist(src_lat, src_lng, dest_lat, dest_lng): | |
if src_lat == dest_lat and src_lng == dest_lng: | |
return 0.0 | |
theta = float(src_lng) - float(dest_lng); | |
src_lat_radians = math.radians(float(src_lat)); | |
dest_lat_radians = math.radians(float(dest_lat)); | |
dist = math.sin(src_lat_radians) * math.sin(dest_lat_radians) + \ | |
math.cos(src_lat_radians) * math.cos(dest_lat_radians) * \ | |
math.cos(math.radians(theta)); | |
dist = math.acos(dist); |
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
#!/usr/bin/python | |
import zipfile | |
from optparse import OptionParser | |
if __name__ == '__main__': | |
parser = OptionParser() | |
(options, args) = parser.parse_args() | |
zip = zipfile.ZipFile(args[0], mode='r') |
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
include <stdio.h> | |
int main(int argc, char *argv[]) | |
{ | |
FILE *fp = fopen(argv[1], "w"); | |
int b; | |
fwrite(&b, sizeof(int), 1, fp); | |
fclose(fp); | |
} |
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
#0 0x00002b574cba9d59 in pthread_cond_wait@@GLIBC_2.3.2 () | |
from /lib64/libpthread.so.0 | |
#1 0x00002b574a91cc53 in g_once_init_enter_impl () | |
from /usr/lib64/libglib-2.0.so.0 | |
#2 0x000000000042538a in mutter_window_get_type () | |
at /usr/include/glib-2.0/glib/gthread.h:342 | |
#3 0x00002b574df26b05 in shell_wm_class_intern_init (klass=0x6fa970) | |
at shell-wm.c:65 | |
#4 0x00002b574a08db9d in g_type_class_ref () | |
from /usr/lib64/libgobject-2.0.so.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
#0 0x00007ffff2edbad0 in g_once_init_leave () from /usr/lib64/libglib-2.0.so.0 | |
#1 0x00000000004253d5 in mutter_window_get_type () | |
at compositor/compositor.c:233 | |
#2 0x00007fffefa333cf in shell_alt_tab_handler_class_intern_init ( | |
klass=0x6d7a30) at shell-alttab.c:202 | |
#3 0x00007ffff377bb9d in IA__g_type_class_ref (type=<value optimized out>) | |
at gtype.c:1989 | |
#4 0x00007ffff3e1fe38 in dump_properties (type=7167296, out=0x6d4000) | |
at gdump.c:94 | |
#5 0x00007ffff3e20264 in g_irepository_dump (arg=<value optimized out>, |
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
#!/usr/bin/python | |
import math | |
import transitfeed | |
from optparse import OptionParser | |
def latlng_dist(src_lat, src_lng, dest_lat, dest_lng): | |
if abs(src_lat-dest_lat) < 0.00001 and abs(src_lng-dest_lng) < 0.00001: | |
return 0.0 | |
theta = src_lng - dest_lng |
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
#!/usr/bin/python | |
import os | |
import sys | |
from codecs import iterdecode | |
from zipfile import ZipFile | |
import csv | |
import datetime | |
if len(sys.argv) < 2: |
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 cherrypy | |
class HelloWorld(object): | |
@cherrypy.tools.etags(autotags=True) | |
def index(self): | |
cherrypy.response.headers['Content-Type']= 'application/json' | |
return "{ \"a\": 1 }" | |
index.exposed = True |
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 __future__ import print_function | |
import jsbridge | |
import time | |
page_loaded_count = 0 | |
animation_finished_count = 0 | |
def page_loaded(obj): | |
global page_loaded_count | |
print("Page loaded (count %s)" % page_loaded_count) |
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
class BrowserHandler: | |
def process_before_start(self): | |
pass | |
def process_output_line(self, line): | |
pass | |
def process_timeout(self): |