Ben Chuanlong Du's Blog

It is never too late to learn.

Connect to Databases Using pyodbc in Python

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

pyodbc only supports qmark

https://github.com/mkleehammer/pyodbc/wiki

Unicode Converter Buffer Overflow

This issues arises in Python3 but not Python2, so the simplest way is to use Python2 if …

Tips on Python Flask

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

app.run(host= '0.0.0.0')

  1. jsonify auto does the conversion between None (Python) and null (JS).

Java PPA for Ubuntu

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

sudo add-apt-repository ppa:webupd8team/java

If you are behind a firewall and has to communicate to the internal via a proxy, you can first export the environment vairables http_proxy and https_proxy …

Tips on Oracle SQL

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. Unlike Teradata SQL, a select statement in Oracle must have the from keyword. The dual table can be used if you do not really want to select from a table.

    select …

Visualization Using Plotly

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

https://plot.ly/python/offline/

  1. plotly works out-of-box in RStudio, however, not in rmakrdown. This is due to account setup issues. Use plotly in offline mode solves the problem.

Tips on MySQL

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

sudo service mysql restart
mysqladmin -u root -p variables | grep port

mysqladmin --help list the locations of my.cnf.

mysqladmin --help

Python Packages

  1. peewee

  2. PyMySQL

  3. MySQLdb

References