A simulated scrubbable animated gif.
Mouse over the video to scrub it. Works by rapidly changing the position of a jpeg sprite sheet in the background of a div.
Inspired by GIFCTRL
import re | |
read_in = open("original.plist") | |
write_out = open("new.plist","w") | |
minus = 280 | |
pat = re.compile('\t\t\t\t<real>([0-9]*)<') | |
for line in read_in: | |
mo = pat.search(line) | |
if mo: | |
value = int(mo.group(1)) |
UIButton *tmpButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; | |
tmpButton.frame = CGRectMake(0, 0, 100, 50); | |
[tmpButton addTarget:self action:@selector(pressButton:) forControlEvents:UIControlEventTouchUpInside]; | |
[tmpButton setTitle:@"TEST" forState:UIControlStateNormal]; | |
[self.view addSubview:tmpButton]; |
A simulated scrubbable animated gif.
Mouse over the video to scrub it. Works by rapidly changing the position of a jpeg sprite sheet in the background of a div.
Inspired by GIFCTRL
Convert shape file to GeoJSON file
ogr2ogr -f GeoJSON provincial.json admin2_poly_32.shp
Convert and combine GeoJSON files into a single TopoJSON file, making the contents of either DIST_32_NA or PRV_NAME the id attribute, renaming the PROV_32_NA property to province, and preserving the province property
topojson --id-property DIST_32_NA,PRV_NAME -p province=PROV_32_NA -p province -o combined.json international-geo.json provinces-geo.json districts-geo.json
Forked from tjdecke/README.md
Data shows answers to a question in the Asia Foundation's 2012 Survey of the Afghan People broken down by gender, age, location, ethnicity, income, education and region.
Based on mbostock's examples Stacked Bar Chart and Normalized Stacked Bar Chart. Adds transitions between the two states.
Data shows answers to the question "Generally speaking, do you think things in Afghanistan today are going in the right direction, or do you think they are going in the wrong direction?" in the Asia Foundation's 2012 Survey of the Afghan People broken down by gender, age, location, ethnicity, income, education and region.
Testing two different methods for pulling data from a google spreadsheet for display on a web page:
using a direct link to the automatically generated csv as described by Kristin Henry.
using Tabletop.js to parse the spreadsheet automatically generated in 'Web page' format.
It appears that the csv version of the data generated by Google updates less frequently than the 'Web page' version, so using Tabletop.js is more reliable if you need immediate updates on data without manual refresh.
import csv | |
import re | |
import glob | |
for input_filename in glob.glob("./*.csv"): | |
print("working on {}".format(input_filename)) | |
with open(input_filename, 'rU') as infile: | |
output_filename = "./strp-{}.csv".format(input_filename.lower().rstrip(".csv").lstrip("./")) | |
with open(output_filename, 'a') as outfile: | |
output_writer = csv.writer(outfile) |
import re | |
with open("calon-dprd_diy.csv", 'rU') as f: | |
for line in f: | |
if re.search(r'[\x80-\xFF]', line): | |
print 'bad string in line ' + line |
{ | |
"results": { | |
"count": 1, | |
"polygons": [{ | |
"id_polygon": 22848, | |
"provinsi DPD": "Daerah Khusus Ibukota Jakarta", | |
"caleg_results": { | |
"count": 35, | |
"caleg": [] | |
} |