Ben Chuanlong Du's Blog

It is never too late to learn.

Tips on Maven

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

The Central Repository

$HOME/.m2

maven: shade plugin, scala compile plugin, exclude manifest files, ...

import as maven project ...

find an updated version of scala archetype for maven

mvn package  
mvn clean …

Connect to MySQL Using PyMySQL

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

sudo pip3 install PyMySQL

Tricks

  1. Connection in PyMySQL is not autocommit by default. You must commit to save your changes.

    # suppose conn is the connection object
    conn.commit()
    
  2. parameterized sql: %s …

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 …