As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
from django.views.decorators.csrf import csrf_exempt | |
@csrf_exempt | |
def reverse_proxy(request): | |
""" | |
Reverse proxy for a remote service. | |
""" | |
path = request.get_full_path() | |
#Optionally, rewrite the path to fit whatever service we're proxying to. | |
With NLTK version 3.1 and Stanford NER tool 2015-12-09, it is possible to hack the StanfordNERTagger._stanford_jar
to include other .jar
files that are necessary for the new tagger.
First set up the environment variables as per instructed at https://github.com/nltk/nltk/wiki/Installing-Third-Party-Software
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
import asyncio | |
loop = asyncio.get_event_loop() | |
async def hello(): | |
await asyncio.sleep(3) | |
print('Hello!') | |
if __name__ == '__main__': | |
loop.run_until_complete(hello()) | |
# Reason for choosing cherrypy | |
# https://blog.appdynamics.com/engineering/a-performance-analysis-of-python-wsgi-servers-part-2/ | |
# | |
# Flask application based on Quickstart | |
# http://flask.pocoo.org/docs/0.12/quickstart/ | |
# | |
# CherryPy documentation for this | |
# http://docs.cherrypy.org/en/latest/deploy.html#wsgi-servers | |
# http://docs.cherrypy.org/en/latest/advanced.html#host-a-foreign-wsgi-application-in-cherrypy | |
# Install: pip install cherrypy |
# post_loc.txt contains the json you want to post | |
# -p means to POST it | |
# -H adds an Auth header (could be Basic or Token) | |
# -T sets the Content-Type | |
# -c is concurrent clients | |
# -n is the number of requests to run in the test | |
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |