References:
https://github.com/tesseract-ocr/tesseract/wiki/Compiling
http://stackoverflow.com/questions/33588262/tesseract-ocr-on-aws-lambda-via-virtualenv
# https://www.quantopian.com/posts/technical-analysis-indicators-without-talib-code | |
import numpy | |
import pandas as pd | |
import math as m | |
#Moving Average | |
def MA(df, n): | |
MA = pd.Series(pd.rolling_mean(df['Close'], n), name = 'MA_' + str(n)) | |
df = df.join(MA) |
AWS Lambda allows you to run custom binaries as child processes.
However, if the packaged binary you're running on AWS Lambda uses shared libraries, they may not be available in the Lambda environment. If this is the case, your binary will terminate without any output. In my case, the exit status code was 127
, which wasn't very helpful (typically this is "command not found.")
2015-11-18T00:50:10.731Z 521db901-8d8e-11e5-b9df-cd31cc90ece2 Calling phantom: /var/task/phantomjs [ '/var/task/phantomjs-script.js' ]
2015-11-18T00:50:10.809Z 521db901-8d8e-11e5-b9df-cd31cc90ece2 child process exited with code 127
Linux's loader, ld.so, allows you (see manpage) to set an environment variable called LD_DEBUG
that will output verbose information while the shared libraries are loaded.
Since Lambda doesn't let you set arbitrary environment variables, you need to set the environment
Clearly ES6 is a huge improvement over ES5, and tools like [6to5][] allow us to use these cool features now. I was reading [Replace CoffeeScript with ES6][replace coffeescript] by [Blake Williams][] and thought it was a great summary of how ES6 solves many of the same problems that CoffeeScript solves; however I'd like to comment on a few of Blake's points and talk about why I'll be sticking with CoffeeScript.
Classes in ES6 (like many of the syntax changes in ES6) are very similar to the CoffeeScript equivalent. To support browsers that are not fully ES5 compliant (e.g. IE8-), however, we still can't really use getters/setters, so ignoring these the comparison is:
from cassandra.cluster import Cluster, OperationTimedOut | |
from cassandra.decoder import SyntaxException | |
from tornado.concurrent import Future | |
from tornado.testing import AsyncTestCase, gen_test | |
class TornadoCassandra(object): | |
def __init__(self, session, ioloop): |
import sys | |
import tornado.ioloop | |
import psycopg2 | |
import psycopg2.extensions | |
io_loop = tornado.ioloop.IOLoop.instance() | |
conn = psycopg2.connect('dbname=mytest user=lbolla password=secret') | |
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) | |
# -*- coding: utf-8 -*- | |
""" | |
ReST directive for embedding Youtube and Vimeo videos. | |
There are two directives added: ``youtube`` and ``vimeo``. The only | |
argument is the video id of the video to include. | |
Both directives have three optional arguments: ``height``, ``width`` | |
and ``align``. Default height is 281 and default width is 500. |