Paul's Programming Notes     Archive     Feed     Github

Change Percent To Numbers and Keep Color - Flot Pie Chart

You can access the color of the section of the pie chart by using “series.color”:

Use List In Bind Parameters - SQLAlchemy

Overwriting module with same version in Heroku - Python

I needed to install a newer version of a module from a github commit, but it had the same version number. Heroku just used the cached version of the module and didn't overwrite it with the newer version.

The easiest fix for this:

  1. Create a file in your application's root directory called "runtime.txt" with only "python-3.4.1" written inside.
  2. Add, commit, and push the new runtime.txt
  3. Change runtime.txt back to "python-2.7.6"
  4. Add, commit, and push to clear your virtualenv and reinstall all modules

WinSCP vs Samba For Windows <---> Ubuntu Development

I’ve always used WinSCP to transfer files between my Windows development environment and Ubuntu. It worked pretty well. All you had to do was open the file with your editor by clicking the file in WinSCP, and when you saved the file it would save to the server in the background.

The main negative was the lack of feedback when a file fails to save to the server. WinSCP could be logged out and asking for a password in the background, but you were expecting that save to fix the bug you were working on. It ended up being another thing to debug.

A coworker suggested using Samba instead. I installed it with this simple guide: How to Create a Network Share Via Samba Via CLI Then I mapped the network drive in Windows by going to the “Map Network Drive” option in the tools menu of the file explorer:

map network drive

The only negative I’ve found with Samba so far is that it makes Notepad++ a little less responsive. But it helps a small amount if you turn off “File Status Auto-Detection”:

File Status Auto-Detection