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
| <html> | |
| <head> | |
| <title>login</title> | |
| <script type="text/javascript" > | |
| function id(id){ | |
| return document.getElementById(id); | |
| } | |
| function setCookie(c_name,value,expiredays){ | |
| var exdate=new Date(); | |
| exdate.setDate(exdate.getDate()+expiredays); |
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
| #based on https://cran.r-project.org/web/packages/ggjoy/vignettes/gallery.html | |
| library(viridis) | |
| library(ggjoy) | |
| library(aire.zmvm) | |
| library(lubridate) | |
| library(ggplot2) | |
| library(dplyr) | |
| library(tidyr) | |
| temp <- get_station_data(criterion = "HORARIOS", # Can be one of MAXIMOS (daily maximum), |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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 cv2.cv as cv | |
| import tesseract | |
| gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE) | |
| cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY) | |
| api = tesseract.TessBaseAPI() | |
| api.Init(".","eng",tesseract.OEM_DEFAULT) | |
| api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz") | |
| api.SetPageSegMode(tesseract.PSM_SINGLE_WORD) | |
| tesseract.SetCvImage(gray,api) | |
| print api.GetUTF8Text() |
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
| # scrape tweets from topsy.com | |
| import sys, urllib, urllib2, json, random | |
| def search(query): | |
| data = {'q': query, 'type': 'tweet', 'offset': 1, 'perpage': 1000, 'window': 'a', 'sort_method': "-date", 'apikey': '09C43A9B270A470B8EB8F2946A9369F3'} | |
| url = "http://otter.topsy.com/search.js?" + urllib.urlencode(data) | |
| data = urllib2.urlopen(url) | |
| o = json.loads(data.read()) | |
| res = o['response'] |
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 m = [0, 120, 20, 320], | |
| w = 1280 - m[1] - m[3], | |
| h = 800 - m[0] - m[2], | |
| i = 0, | |
| root; | |
| var tree = d3.layout.tree() | |
| .size([h, w]); | |
| var diagonal = d3.svg.diagonal() |
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 lsh | |
| lsh_machine = lsh.LSH(assignment_name="example") | |
| # data is a dictionary of the form: | |
| #{user_id: set([item_id1, item_id2, ...]), ...} | |
| # Depending on the input size, training can take a while. | |
| # But it will use all your cores to do so, and will | |
| # automatically cache the data for assignment_name. This |