Python + peewee and OperationalError ‘MySQL server has gone away’

It took hours to figure out why my python script using peewee yielded OperationalError(2006, ‘MySQL server has gone away’), but I found the problem. This error is very misleading and also results when MySQL responds with a Packet Too Large response on an INSERT statement. In my case, I’m inserting a very large 15-20 MB [...]

Configuring Eclipse for IntelliJ users

There are a few things I’ve gotten used to in IntelliJ that require some customizations in Eclipse. The following steps will make Eclipse feel more familiar and ease the transition. Key Bindings You can get close to IntelliJ’s key bindings by installing the ideakeyscheme plugin. Place the downloaded JAR in eclipse/dropins and unzip it into [...]

MacOS Application Installation List

This is a list of applications I find useful on a Mac. KeePassX Chrome Firefox iTerm Flux: I use 3000K for the sunset setting. smcFanControl Sublime Text PyCharm FileZilla Android File Transfer LibreOffice Google Drive JDK 7 JDK 8 Maven Git Homebrew IntelliJ PyCharm Xcode Also developer command-line tools via xcode-select –install Chmox VirtualBox

Sublime Text Key Mappings for MacOS

This is my Sublime Text custom key configuration on MacOS, which makes it a bit more consistent with other text editors. Open Preferences > Key Bindings – User and paste the following. [ // Reference: // http://docs.sublimetext.info/en/sublime-text-2/reference/commands.html {"keys": ["end"], “command”: “move_to”, “args”: {“to”: “eol”}}, {“keys”: ["home"], “command”: “move_to”, “args”: {“to”: “bol”}}, {“keys”: ["super+home"], “command”: “move_to”, [...]

IntelliJ Keymap Customizations on MacOS

A few useful IntelliJ customizations on MacOS. Tab Navigation Some of the tab navigation would be better if it’s consistent with other text editors on MacOS. Go to: Project Settings > Keymap > Main menu > Window > Editor Tabs Under this list, add the following keyboard shortcuts. The existing shortcuts should also be kept. [...]

Configuring Python on MacOS

This post goes through the steps to add the necessary modules in Python that I use. Install pip $ sudo easy_install pip Set up MySQL prerequisites to install the Python MySQLdb module mysql_config must be on the path in order to install the MySQL-python module. I install MySQL in /usr/local and then create a symlink [...]

Save drafts of form textarea inputs in Apache Wicket automatically

This article documents an Apache Wicket solution to automatically save drafts of user input in the background using ajax POST requests to the server. The stateless nature of <textarea> form inputs introduces usability and reliability problems when users require a long time to fill them in. Consider some common scenarios, such as a user’s web [...]

Install python MySQLdb module

MacOS This Stack Overflow article perfectly documents the necessary steps and works with python 2.7. I have also saved these instructions in PDF format.

MacOS Command Prompt and vi Customizations

This is my custom command prompt configuration. Command Line First, install the far better iTerm. Now edit /etc/profile and add the following. This can alternately be added to ~/.profile to make the change local only to the current user. # add vi to the command line for previous command lookups set -o vi # remove [...]

MacOS Keyboard Shortcut Customizations

Custom keyboard shortcuts that I find useful. Maximize Windows Open System Preferences > Keyboard > Shortcuts > App Shortcuts. To maximize the currently focused window, add the following. Menu Title: Zoom Keyboard Shortcut: Control + Option + ⌘ + M Tab It’s also useful to be able to tab through the buttons in dialogs (e.g., [...]