Goal: Connect to MSSQL using FreeTDS / ODBC in Python.
Host: Ubuntu 11.10 x86_64
Install:
sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy
In /etc/odbcinst.ini:
Goal: Connect to MSSQL using FreeTDS / ODBC in Python.
Host: Ubuntu 11.10 x86_64
Install:
sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy
In /etc/odbcinst.ini:
As configured in my dotfiles.
start new:
tmux
start new with session name:
| package main | |
| import ( | |
| "fmt" | |
| "html/template" | |
| "log" | |
| "net/http" |
| """ Inspired by http://flask.pocoo.org/snippets/40/ """ | |
| app = Flask(__name__) | |
| @app.url_defaults | |
| def hashed_url_for_static_file(endpoint, values): | |
| if 'static' == endpoint or endpoint.endswith('.static'): | |
| filename = values.get('filename') | |
| if filename: | |
| if '.' in endpoint: # has higher priority |
| # run with a custom --n | |
| # python run_luigi.py SquaredNumbers --local-scheduler --n 20 | |
| import luigi | |
| class PrintNumbers(luigi.Task): | |
| n = luigi.IntParameter(default=10) | |
| def requires(self): | |
| return [] |
| Asset,Type,Asset Value,Debt,Net Value,Change vs 2015,Change,Stake,Latitude,Longitude,Notes | |
| Trump Tower (New York City),Office and retail,471,100,371,-159,Down,1,40.768277,-73.981455,Opened 1983 | |
| 1290 Avenue of the Americas (New York City),Office and retail,2310,950,408,-62,Down,0.3,40.768277,-73.981455, | |
| Niketown (New York City),Office and retail,400,10,390,-52,Down,1,40.768277,-73.981455,Ground lease through 2079 | |
| 40 Wall Street (New York City),Office and retail,501,156,345,-28,Down,1,40.768277,-73.981455, | |
| Trump Park Avenue (New York City),Residential and retail,191,14.3,176.7,-27,Down,1,40.768277,-73.981455,"49,564 sq. ft. of condos; 27,467 sq. ft. of retail" | |
| Trump Parc/Trump Parc East (New York City),Residential and retail,88,0,88,17,Up,1,40.768277,-73.981455,"11,750 sq. ft. of condos; 14,963 sq. feet of retail; 13,108 sq. ft. of garage" | |
| "Trump International Hotel and Tower, Central Park West (New York City)","Hotel, condos and retail",38,0,38,21,Up,1,40.768277,-73.981455, | |
| "Trump World Tower, 845 United Natio |
| import os | |
| import codecs | |
| data_directory = os.path.join('..', 'data', | |
| 'yelp_dataset_challenge_academic_dataset') | |
| businesses_filepath = os.path.join(data_directory, | |
| 'yelp_academic_dataset_business.json') | |
| with codecs.open(businesses_filepath, encoding='utf_8') as f: |