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 magnitude(image, pos): | |
x, y = pos | |
return np.mean(image[x, y]) | |
def isPeak(image, pos, threshold): | |
x, y = pos | |
mag = magnitude(image, pos) | |
for i in range(x-1, x+1): | |
for j in range(y-1, y+1): | |
if i == x and j == y: |
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 cv2 | |
image = cv2.imread('./4.2.04.tiff') | |
# Since OpenCV uses BGR, this code will correctly remove the red channel | |
image[:, :, 2] = 0 | |
cv2.imshow('Hello World', image) | |
k = cv2.waitKey(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
import cv2 | |
import numpy as np | |
def magnitude(image, pos): | |
x, y = pos | |
return np.mean(image[x, y]) | |
def isPeak(image, pos, threshold): | |
x, y = pos | |
mag = magnitude(image, pos) |
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 convertToJSON(obj) { | |
function traverse(root, visited, level) { | |
if (level > 4) { | |
return '<<'+level+' levels>>'; | |
} | |
if (!root) { | |
return '<<null root>>' | |
} | |
if (visited.indexOf(root) >= 0) { | |
return '<<visited>>'; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Keep in mind that when asking for a `return` after another, only the first one will be output. | |
# This example is meant as a simple starting point, to show how to get the information in the simplest available way. | |
# Google Chrome | |
tell application "Google Chrome" to return URL of active tab of front window | |
tell application "Google Chrome" to return title of active tab of front window | |
# Google Chrome Canary | |
tell application "Google Chrome Canary" to return URL of active tab of front window | |
tell application "Google Chrome Canary" to return title of active tab of front window | |
# Chromium |
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 random | |
import string | |
import webbrowser | |
import urlparse | |
import requests | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
# NEED TO FILL OUT THESE VALUES | |
_client_id = '' | |
_client_secret = '' |
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 requests | |
import base64 | |
import json | |
import random | |
import string | |
username = raw_input() | |
password = raw_input() | |
fingerprint = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10)) |
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 sys | |
import requests | |
from pyquery import PyQuery | |
# Clothing items holds all the info needed to display a clothing item from | |
# any source. | |
class ClothingItem(object): | |
def __init__(self, name, price, imageURL, itemURL): | |
super(ClothingItem, self).__init__() |
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
curl 'http://www.napaonline.com/pa/philadelphia/mechanics-auto' | |
-H 'Host: www.napaonline.com' | |
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0' | |
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' | |
-H 'Accept-Language: en-US,en;q=0.5' --compressed | |
-H 'Connection: keep-alive' | |
-H 'Cookie: D_SID=73.160.108.26:gL/pcVXaWORFEUVp5LdvI8TzMyho15lhjwvJ99mLPRk; D_PID=3119DF0B-3C06-308A-88B4-6118E4B86D16; D_IID=537F6159-CBB6-39AF-B0EB-3FB67E6AE7A1; D_UID=73B0C82A-856C-3071-810D-3741B7285A52; D_HID=JvZnDFfJrbcyzrowMossc7nUpelw7rwBvDgfDnfvXYY; .ASPXANONYMOUS=dgx-Q9oW0QEkAAAAOTEzOTk5MDItMDI2Yy00ZmQ4LWIwNjAtYTNjYmExZTNmYmQ26nSaDOnkO-Y0VUrxvqiWnywbE-E1; __utma=44732731.1803377310.1440949231.1440949231.1440954475.2; __utmz=44732731.1440949231.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); AMCV_Genuine%20Parts%20Company%40AdobeOrg=136688995%7CMCMID%7C17924727585726661166837957770550610914%7CMCAAMLH-1441554031%7C7%7CMCAID%7CNONE; s_nr2=1440954476 |