Skip to content

Instantly share code, notes, and snippets.

View antonywu's full-sized avatar

Antony Wu antonywu

View GitHub Profile
#begin custom quote: IV Rank
#
# from TastyTrade: You've Got Mail 4Sep2013
# use on Market Watch -> Quotes to see vol percentile(ranking)
# go Long when vol percentile is low
# go Short when vol percentile is high
#
def ivol = if !IsNaN(imp_volatility) then imp_volatility else 0;
#
# the number after ivol refers to the number of trading days to include in the comparison. The current IV is compared to the lowest and highest IV over that period.
@antonywu
antonywu / README.md
Created March 24, 2016 18:23 — forked from dannguyen/README.md
Using Google Cloud Vision API to OCR scanned documents to extract structured data

Using Google Cloud Vision API's OCR to extract text from photos and scanned documents

Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.

The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.

On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:

####### 1. A low-resolution photo of road signs

@antonywu
antonywu / brewDoctor
Last active December 21, 2015 02:49
Homebrew VIM 7.4 installation failure brew install & doctor logs below No files found under ~/Library/Logs/Homebrew/vim
$ brew doctor
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libmacfuse_i32.2.dylib
/usr/local/lib/libmacfuse_i64.2.dylib
/usr/local/lib/libosxfuse_i32.2.dylib
/usr/local/lib/libosxfuse_i64.2.dylib
@antonywu
antonywu / e1071.R
Created July 10, 2013 23:03 — forked from ivannp/e1071.R
svmComputeOneForecast = function(
id,
data,
response,
startPoints,
endPoints,
len,
history=500,
trace=FALSE,
kernel="radial",
@antonywu
antonywu / node_csv2json.js
Created May 19, 2013 03:02
CSV 2 JSON utility Ran into some issues with http://shancarter.com/data_converter/, because it doesn't escape values that contain double quotes. jsonlint.com does not help the matter further because it tries to beautify raw JSON, and thus introduces new line characters within values, causing validation to fail. This script should get you to conv…
/*
CSV 2 JSON utility:
It reads in all the content from the csv line by line (may be read out of order)
It then use underscorejs to convert into key + value pairs and finally dump into
a json file
Developer: Antony Wu (antony@meshway.com)
*/
var csv = require('csv'),
@antonywu
antonywu / nodeServer.js
Created May 19, 2013 02:49
NodeJS Based Basic Static Server
var http = require('http');
var fs = require('fs');
var path = require('path');
http.createServer(function (request, response) {
var filePath = '.' + request.url;
if (filePath == './')
filePath = './index.htm';