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/env python | |
# encoding: utf-8 | |
import lxml.etree | |
import lxml.html | |
import requests | |
xml_sample = """<?xml version="1.0" encoding="UTF-8"?> | |
<foo:Results xmlns:foo="http://www.foo.com" xmlns="http://www.bah.com"> | |
<foo:Recordset setCount="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
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
Some exercising of Python test functionality based on: | |
https://docs.python.org/3/library/doctest.html | |
https://docs.python.org/3/library/unittest.html | |
Generating tests dynamically with unittest |
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/env python | |
# encoding: utf-8 | |
from __future__ import unicode_literals | |
import json | |
import requests | |
import scraperwiki | |
from collections import OrderedDict |
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 csv | |
mydir = "C:/Users/Nessa/Documents/Work/Coding/Test" | |
os.chdir(mydir) | |
all_filenames = [i for i in glob.glob("*.{}".format("csv"))] | |
all_data = [] | |
for f in all_filenames: |
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/env python | |
""" | |
Save stock ticker data from Yahoo! Finance to sqlite. | |
""" | |
import datetime as d | |
import sqlite3 | |
import pandas.io.data as web | |
import pandas.io.sql as sql |
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
#!/bin/bash | |
trap '[ "$?" -eq 0 ] || read -p "Looks like something went wrong... Press any key to continue..."' EXIT | |
VM=default | |
#DOCKER_MACHINE=./docker-machine.exe | |
DOCKER_MACHINE=/c/Program\ Files/Docker\ Toolbox/docker-machine.exe | |
if [ ! -z "$VBOX_MSI_INSTALL_PATH" ]; then | |
VBOXMANAGE="${VBOX_MSI_INSTALL_PATH}VBoxManage.exe" |
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/Rscript | |
# Script to create r-view 2013-08-14 | |
# Ian Hopkinson | |
source('scraperwiki_utils.R') | |
NumberOfTweets<-function(){ | |
query = 'select count(*) from tweets' | |
number = ScraperWikiSQL(query) | |
return(number) |
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
function save_api_stub(){ | |
scraperwiki.exec('echo "' + scraperwiki.readSettings().target.url + '" > ~/tool/dataset_url.txt; ') | |
} | |
function run_once_install_packages(){ | |
scraperwiki.exec('run-one tool/runonce.R &> tool/log.txt &') | |
} | |
$(function(){ | |
save_api_stub(); |
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/Rscript | |
# Script to knit a file 2013-08-08 | |
# Ian Hopkinson | |
library(knitr) | |
.libPaths('/home/tool/R/libraries') | |
render_html() | |
knit("/home/tool/view.Rhtml",output="/home/tool/http/index.html") |
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
[Results2008Cohort.csv] | |
CharacterSet=65001 | |
Format=Delimited(|) | |
ColNameHeader=False | |
Col1="TESTID" Integer | |
Col2="VEHICLEID" Integer | |
Col3="TESTDATE" Char | |
Col4="TESTCLASSID" Char | |
Col5="TESTTYPE" Char | |
Col6="TESTRESULT" Char |
NewerOlder