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
# Author: Adrian Rosebrock | |
# Website: www.pyimagesearch.com | |
# import the necessary packages | |
import os | |
def list_images(basePath, contains=None): | |
# return the set of files that are valid | |
return list_files(basePath, validExts=(".jpg", ".jpeg", ".png"), contains=contains) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
@brief | |
This XML schema file is used to describe pills. | |
@author Adrian Rosebrock | |
--> | |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.shiftybits.com"> | |
<!-- define the 'pills' element --> |
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
# @brief | |
# Performs file upload validation for django. The original version implemented | |
# by dokterbob had some problems with determining the correct mimetype and | |
# determining the size of the file uploaded (at least within my Django application | |
# that is). | |
# @author dokterbob | |
# @author jrosebr1 | |
import mimetypes |
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
// initialize the jQTouch variable and the current hash, then grab | |
// the app history from local storage | |
var jQT = null; | |
var currentHash = null; | |
var hist = localStorage.getItem("app_history"); | |
// if the history is null, then reset the history list to include | |
// just 'home' | |
if (hist == null){ | |
hist = ["home"]; |
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 cluster(self): | |
# ... # | |
# cluster the codes together using hierarchical agglomerative | |
# clustering and then parse the returned clusters | |
self.clusters = hierarchy.linkage(clusterCodes, "single", "euclidean") | |
self.clusters = self.parseClusters(self.clusters, numClusters) | |
# ... # | |
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
<?php | |
/** | |
* @brief | |
* Class used to calculate the human readable time from a supplied | |
* date. | |
* | |
* This class is used to calculate the human readable time from a | |
* supplied date such as on Facebook and Twitter. A returned value | |
* from this class would look like '4 minutes, 58 seconds ago' or |