This file contains hidden or 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
/** | |
* Inserts a value into an array, shifting elements over as needed. | |
* | |
* @param target: The array to insert into. | |
* @param index: The index to insert the new element into. | |
* @param newVal: The value to insert. | |
* @param targetSize: The size of the array before inserting the new element. | |
* Not capacity, the number of existing elements. | |
* @warn Does not check that the array is large enough to hold the new element. |
This file contains hidden or 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
# Mitchell Wolfe | |
# [email protected] | |
########################################################### | |
# Find longest subsequence | |
def subsequence(numbers): | |
# create a list with the first number of inputed sequence | |
# Go through entire list | |
subseq_found = [] |
This file contains hidden or 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 __browse_for_entry(self, entry_box, dialog_type): | |
"""Browse for a file and put that filename in an entry box. | |
@param entry_box: The entry box to put the filename in. | |
@type entry_box: tkinter.Entry | |
@param dialog_type: The type of dialog to display. Should be 'open' or | |
'save as' | |
@type dialog_type: str | |
""" | |
dialog_type = dialog_type.lower() |
This file contains hidden or 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
# Convenience script to create a local development database for denver_streets. | |
# | |
# Convenience script to create the local development database needed for | |
# denver streets, adding the postgis extensions as necessary. Note that this | |
# does not create the test database. | |
# | |
# @author A. Samuel Pottinger (samnsparky, Gleap LLC) | |
# @param $1 The name of the user to create for manipulating the dev database. | |
# this is typically the user specified in config.yaml. Optional but user | |
# will only be created if a password is specified. |
This file contains hidden or 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
// Thanks http://stackoverflow.com/questions/16065494 | |
// WARNING: Untested. Please provide feedback. | |
/** | |
* Request a local file into the PhoneGap application's temporary directory. | |
* | |
* Get a local file into the the current PhoneGap application's temporary | |
* directory given a larger filesystem file URI. | |
* | |
* @param {String} uri The URI to load the file from. |
This file contains hidden or 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 pycotracer | |
import pymongo | |
client = pymongo.MongoClient() | |
db = client['tracer-records-db'] | |
all_data = pycotracer.get_report(2013) | |
contribution_data = all_data['ContributionData'][:100] | |
expenditure_data = all_data['ExpenditureData'][:100] | |
loan_data = all_data['LoanData'][:100] |
This file contains hidden or 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 q = require('q'); | |
var account_manager = require('./account_manager'); | |
var testQuery = { | |
targetCollection: 'contributions', | |
params: { | |
minAmount: 1, | |
maxAmount: 5000 | |
}, | |
offset: 100, |
This file contains hidden or 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 pycotracer | |
import pymongo | |
client = pymongo.MongoClient() | |
db = client['tracer-records-db'] | |
all_data = pycotracer.get_report(2013) | |
pycotracer.mongo_aggregator.insert_contribution_entries(db, | |
all_data['ContributionData']) |
This file contains hidden or 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 pycotracer | |
import pymongo | |
client = pymongo.MongoClient() | |
db = client['tracer-records-db'] | |
for year in range(2000,2014): | |
print "fetching tracer records for year",year | |
This file contains hidden or 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 pycotracer | |
import pymongo | |
client = pymongo.MongoClient() | |
db = client['tracer-records-db-2'] | |
for year in range(2013,2014): | |
print "fetching tracer records for year",year | |