home > developer

Tuesday, April 5th, 2011

ZeroMQ: “Pimped Socket Interface”

Nicholas Piel gives a great introduction to ZeroMQ:

But while the library may feel small it has a grand vision of being the new messaging layer. And really, it is not that weird when you come to think of it. Scalability issues are mostly just communication and portability issues, ZeroMQ can solve these problems for you.

And here’s another bit of wisdom from 0MQ - The Guide:

What we need is something that does the job of messaging but does it in such a simple and cheap way that it can work in any application, with close to zero cost. It should be a library that you just link with, without any other dependencies. No additional moving pieces, so no additional risk. It should run on any OS and work with any programming language.

And this is 0MQ: an efficient, embeddable library that solves most of the problems an application needs to become nicely elastic across a network, without much cost.

/developer   〆   permalink

Tuesday, May 11th, 2010

Installing PyQt 4.7.3

Abbreviated notes for installing PyQt 4.7.3 on Mac OS 10.6 (Snow Leopard). This assumes you have already downloaded and installed the Qt SDK.

cd tmp

wget http://www.riverbankcomputing.co.uk/static/Downloads/sip4/sip-4.10.2.tar.gz
untar sip-4.10.2.tar.gz 
open doc/html/index.html 
cd sip-4.10.2
python configure.py --arch i386 --sdk MacOSX10.4u.sdk
make
sudo make install
cd ..
rm -rf sip-4.10.2/

wget http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-mac-gpl-4.7.3.tar.gz
untar PyQt-mac-gpl-4.7.3.tar.gz 
cd PyQt-mac-gpl-4.7.3
python configure.py --use-arch i386
make
sudo make install
cd ..
rm -rf PyQt-mac-gpl-4.7.3/

Then, do a quick test.

python
>>> from PyQt4 import QtGui
>>> a = QtGui.QApplication([])
>>> w = QtGui.QWidget()
>>> w.show()    
>>> w.hide()

Smile.

/developer   〆   permalink

Wednesday, February 24th, 2010

Hg Init

Hg Init: a Mercurial tutorial by Joel Spolsky is awesome. Consise, funny, clear, and true. Plus the domain name is perfect.

/developer   〆   permalink

Tuesday, February 23rd, 2010

Software Carpentry

Software Carpentry’s tag line is “Basic software development practices for scientists and engineers.” Definitely worthwhile — although I’d recommend hg or git over subversion.

/developer   〆   permalink

Tuesday, February 23rd, 2010

Best Explanation of Git and Mercurial’s Similarities

Mercurial for Git users answered many of my questions on the nuances of Mercurial. The branch model, bare repositories, and command equivalence table were especially helpful for someone like myself who has used both systems but never fully understood the distinctions.

/developer   〆   permalink

Wednesday, February 10th, 2010

TortoiseHg Usage Introduction (Mercurial on Windows)

I wanted to share a quick introduction to using a Mercurial repository on Windows with TortoiseHg. This assumes someone has already setup the repository on a shared network drive (we’ll call \\Shared\Repo\Project44) and you want to keep up do date with the changes directly in Windows Explorer.

Initial Checkout

  1. Download and install the latest TortoiseHg at http://bitbucket.org/tortoisehg/stable/downloads/.
  2. After rebooting, Right-click -> TortoiseHG -> Settings -> Global -> Commit, and set your Username to something. I’m using “Alan Brooks”.
  3. Right-click -> TortoiseHG -> Clone a Repository.
  4. Put your \\Shared\Repo\Project44 in “Source Path”.
  5. Click “clone” in the upper left.
  6. The folder “Project44” on your hard drive is a working copy of all the latest files and also a complete copy of the entire history of the project (a.k.a. the repository in the “.hg” folder). I’ll call this folder your “local repo” for short.

Example Workflow

  1. Edit some code or files until you get to a point where you’d like to record a small incremental change in your local repo.
  2. Notice that the files/folders you’ve changed all have little red marks in Windows Explorer.
  3. Commit to your local repo. Right-click -> HG Commit …, select files to commit, write a checkin comment, then click Commit. This commit will be an atomic action for all the files as a group.
  4. Sync with the remote repo. Right-click -> TortoiseHG -> Synchronize…, click Pull to get anyone else’s changes. If there are changes, they may need merged before you push. If no changes, click Push to publish your changes to the repo.
  5. Look at the history. Right-click -> TortoiseHG -> View Changelog.

References

A couple of good things to read to get started with Mercurial are:

/developer   〆   permalink

Saturday, January 23rd, 2010

Link Roundup

Trying to clear out my inbox today … so here’s a variety of interesting links I’ve seen in the last few months.

Top 10 User Interaction Myths

Python Debugging Techniques (code.interact(), logging, pdb)

Logging Module

Guide to Branching in Mercurial

Python Bytecode Disassembler

Python Module of the Week

Windows Sysinternals

UI Complexity

Arduino Small Prototyping Board

fabricate Build Tool

mlabwrap Python to Matlab Bridge

eCircuit Center (former Varian guy’s EE circuit learning site)

/developer   〆   permalink

Saturday, January 23rd, 2010

A Style Guide and pychecker

I came across Google’s Python Style Guide and enjoyed it. It mentioned pychecker which is a nice static analysis tool for helping to find bugs in Python code.

/developer   〆   permalink

Saturday, January 23rd, 2010

grin: Easy Search of Directorys Full of Source Code

I am loving the grin tool. It’s like a find/grep mashup with good defaults. In human-speak, that means you can easily search source code on the command line with a short command.

Just go pip install grin it already (or easy_install grin if you’re old school).

/developer   〆   permalink

Saturday, January 23rd, 2010

View Python Profiles

Profiling tools are essential to understanding where to focus your attention when improving software performance. RunSnakeRun is a nice way to visualize, sort, and better understand Python profiling data.

/developer   〆   permalink

Saturday, January 23rd, 2010

Instant Ubuntu GUIs with Quickly

I like the idea of Quickly: make easy one-line commands for creating, editing, designing, running, packaging, and releasing Ubuntu GUI projects. Ars’s overview captures the gist of it well.

/developer   〆   permalink

Thursday, January 14th, 2010

Mercurial Command Line Quick Reference

There are two main ways I’ve been using Mercurial over the last couple years: on the command line and via tortoisehg (right-click) on Windows. This is a quick reference to the command-line interface. Mercurial on the command line is called “hg” (a reference to the element Mercury).

Help

>> hg            % lists basic commands
>> hg help       % lists all commands
>> hg help pull  % gives detailed help on command "hg pull"

Where am I?

>> hg status    % tell which files have been modified
>> hg st        % same as hg status (you can abbrevitate
                %    non-ambiguous commands)
>> hg log -l 5  % log of last 5 commits
>> hg diff      % current changes to your working directory
>> hg diff -c 9 % changes made by revision 9

Committing as you work

>> hg commit -m "change 1"  % regular commit
>> hg add new.c             % tell hg to start tracking a file
>> hg ci -m "change 2"      % "ci" is short for commit (legacy)
>> hg rename new.c blue.c   % rename a file (like copy + remove)
>> hg revert ---all          % oops, I didn't want to rename
>> !del blue.c              % del manually (stop tracking blue.c)
>> hg mv new.c red.c        % "mv" is short for rename
>> hg ci -A -m "change 3"   % "-A" adds/del's files, avoids 
                            %    the "hg add, hg remove" dance

Syncing with another repository

>> hg pull      % grab any new changes from default repo
>> hg update    % update your working directory with the changes
>> hg merge     % merge new code with your code
>> hg ci -m "merge" % commit merge result
>> hg fetch     % short for "hg pull, hg update, hg merge, hg ci"
>> hg push      % send your changes to the default repo

Merging

>> hg heads     % list the potential heads that could be merged
>> hg merge     % auto-merge (specify rev with -r if >2 heads)
>> hg resolve   % if auto-merge failed, retry after manual edits

Repository management

>> hg init          % make a new repo in the current dir
>> hg clone C:\Repo % clone the repo to work on a branch/idea

Advanced, but nice (many require enabling extentions)

>> hg view      % launches a graphical history viewer
>> hg paths     % where this repo pushes and pulls from
>> hg rollback  % undo the last commit (only OK if not pushed)
>> hg shelve    % stash work-in-progress to fix something else
>> hg unshelve  % resume your work-in-progress
>> hg rebase    % move a set of commits to a new baseline
>> hg tip -p    % show latest committed changes

Hope this helps. Please send me ideas for other commands that you like to use often.

/developer   〆   permalink

Saturday, January 9th, 2010

Why I Like Mercurial

Mercurial is a great version control tool. I like it for the following reasons:

  • distributed (you can checkin changes with no network connection)
  • free, open-source
  • written in Python (easy to customize with workflows)
  • works well on Mac, Linux, and Windows
  • TortoiseHG on Windows means non-developers at work can use it
  • simple to get started with, but powerful features available
  • hg is the shortest and easiest name to type on the command line compared to the only credible competitors: git, svn, bzr … it doesn’t get any better than 2 adjacent letters on the home row!

/developer   〆   permalink

Saturday, January 9th, 2010

lxml.objectify == Best Python XML API

I’ve used a couple different XML parsing libraries in the past, but have always had a desire for XML to behave just like an object where accessing attributes maps directly to accessing XML children. Who would have known it — the lxml library, one of the fastest XML processors offers exactly this API, calling it lxml.objectify. I can’t wait to try it …

/developer   〆   permalink

Saturday, January 9th, 2010

Generate Microsoft Word 2007/2008 docx Files from Python Code

In some situations, it would be nice to be able to spit out an automated report as a Word document. Mike Maccana has come up with a new tool for doing just that and shared the code on github as project python-docx. I like it.

/developer   〆   permalink

Sunday, September 27th, 2009

Updating NumPy, SciPy, and Matplotlib

I recently upgraded to NumPy to 1.4.0.dev7419, SciPy to 0.8.0.dev5953, and matplotlib version 0.99.1.1.

svn co http://svn.scipy.org/svn/numpy/trunk numpy
cd numpy
python setup.py build
python setup.py install
cd ..

svn co http://svn.scipy.org/svn/scipy/trunk scipy
cd scipy
python setup.py build
python setup.py install
cd ..

python
>>> import numpy
>>> numpy.__version__    # '1.4.0.dev7419'
>>> numpy.test('1','10') # 26 errors in 2231 tests, but usable
>>> import scipy
>>> scipy.__version__    # '0.8.0.dev5953'
>>> scipy.test('1','10') # 165 errors in 4515 tests, but usable

rm -rf /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib*
wget http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/matplotlib-0.99.1.1.tar.gz/download
open matplotlib-0.99.1.1.tar.gz
cd matplotlib-0.99.1.1
python setup.py build
python setup.py install
cd ..

ipython -pylab
>>> plot([1,2,3])

/developer   〆   permalink

Monday, July 13th, 2009

Python Link Roundup

Intra-package References

I just found out that Python 2.5 or newer allows relative imports, something I had been writing custom code to work around. Python documentation gives examples in 3 forms:

from . import echo
from .. import formats
from ..filters import equalizer

Packaging Tools

Alex Clemesha explains modern python hacker tools virtualenv, Fabric, and pip. I find all three of them intersting.

pip is an alternative to easy_install where you can install and upgrade python packages easily with commands like:

pip install -U ipython

Fabric facilitates deploying code to a remote location.

virtualenv lets you setup and manage working environments that aren’t littered with everything you ever installed into your global site-packages directory.

I also recommend virtualenvwrapper, which puts a nice interface on top of virtualenv.

/developer   〆   permalink

Saturday, January 31st, 2009

Agreed. Git is Awesome.

I agree with every word in Fine. Git is Awesome.

/developer   〆   permalink

Saturday, January 17th, 2009

Mercurial and Git Links

Useful Mercurial Setup suggestions from Ted Naleid.

Daily Git tips at git ready.

/developer   〆   permalink

Saturday, January 3rd, 2009

Introducing numpyIO.py

I implemented numpyIO.py because I often use scipy.io.numpyio.fread() and scipy.io.numpyio.fwrite(), but I don’t want to depend on scipy. It uses numpy’s tofile/fromfile functions instead.

Why might you want this instead of SciPy’s numpyio? Well, I can think of a few reasons:

  • it imports faster because it only depends on numpy, not scipy
  • easier to package with py2exe or py2app
  • it is slightly faster
  • it lets you avoid rewriting legacy code that makes extensive use of scipy’s deprecated fread/fwrite

Grab the numpyIO project from bitbucket or clone the repo with:

hg clone http://bitbucket.org/lannybroo/numpyio

/developer   〆   permalink

Saturday, January 3rd, 2009

Updating to Python 2.6 on Mac OS X Leopard 10.5.6

Install Python from source.

cd ~/tmp
wget http://www.python.org/ftp/python/2.6.1/Python-2.6.1.tgz
untar Python-2.6.1.tgz
cd Python-2.6.1
mate Mac/README
./configure --enable-framework
make
make install
cd ..

Update setuptools so that easy_install works.

wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c9-py2.6.egg
sh setuptools-0.6c9-py2.6.egg

Add the following to my .profile so that the binaries installed by easy_install take precedence over my old Python 2.5 stuff.

export PATH=/Library/Frameworks/Python.framework/Versions/2.6/bin:$PATH

Easy install various packages I use frequently.

easy_install IPython
easy_install nose
easy_install pexpect
easy_install cheetah
easy_install clonedigger
easy_install pyserial
easy_install markdown2
easy_install euclid
easy_install psyco

Do the slightly tougher installs: NumPy (svn rev 6271), SciPy (svn rev 5300), matplotlib, and euclid. See http://www.scipy.org/Installing_SciPy/Mac_OS_X for details. Before starting, I also updated to the latest apple developer tools, although this isn’t strictly necessary.

wget http://r.research.att.com/gfortran-4.2.3.dmg
open gfortran-4.2.3.dmg # install using GUI

wget http://www.fftw.org/fftw-3.2.tar.gz
untar fftw-3.2.tar.gz
cd fftw-3.2
./configure
make
sudo make install
cd ..

svn co http://svn.scipy.org/svn/numpy/trunk numpy
cd numpy
python setup.py build
python setup.py install
cd ..

svn co http://svn.scipy.org/svn/scipy/trunk scipy
cd scipy
python setup.py build
python setup.py install
cd ..

python
>>> import numpy
>>> numpy.test('1','10') # 6 problems in 1897 tests, but usable
>>> import scipy
>>> scipy.test('1','10') # 168 errors of 3990 tests, but usable

sudo port install libpng
sudo port install freetype
easy_install matplotlib

ipython -pylab
>>> plot([1,2,3])

svn checkout http://pyeuclid.googlecode.com/svn/trunk/ pyeuclid
cd pyeuclid
python setup.py install
cd ..

Install wxPython and PythonCard for GUI development.

wget http://downloads.sourceforge.net/wxpython/wxPython2.8-osx-unicode-2.8.9.1-universal-py2.6.dmg
wget http://downloads.sourceforge.net/wxpython/wxPython2.8-osx-docs-demos-2.8.9.1-universal-py2.6.dmg
open wxPython2.8-osx-unicode-2.8.9.1-universal-py2.6.dmg
open wxPython2.8-osx-docs-demos-2.8.9.1-universal-py2.6.dmg

wget http://prdownloads.sourceforge.net/pythoncard/PythonCard-0.8.2.tar.gz
untar PythonCard-0.8.2.tar.gz
cd PythonCard-0.8.2
python setup.py install
open /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PythonCard/samples/minimal/

Then, Ctrl-click and open minimal.py with Python Launcher to test.

/developer   〆   permalink

Sunday, November 30th, 2008

Git-SVN Cheat Sheet

Set good “don’t mess with my line endings” option before first checkout:

git config --global core.autocrlf false

Do this one time to suck in the repo w/history from SVN:

git svn clone svn://myrepo.com/project/

Do this loop over and over until your code ready to push back to SVN. The cool thing about this is that the adds and commits can be done off the network! Don’t forget to merge and re-test your changes after the rebase:

git add .
git commit -m "Added some awesome stuff"
git svn rebase

Push all local changes back to the SVN repo, which will now have all the local commits you did when you were on the airplane:

git svn dcommit

One other key tip is what when you want to decommit or rebase but you are in the middle of some changes, don’t worry. git-stash to the rescue:

git stash
git svn rebase
git stash apply

Also, here are a few links that inspired this post:

/developer   〆   permalink

Sunday, November 30th, 2008

Speedy Python

A great reference: Tools for Accelerating Python. I learned about quite a few new ways of getting Python code to run faster …

/developer   〆   permalink

Sunday, November 30th, 2008

Git Link Roundup

I’ve been working more with git lately and have found a few more interesting sites I’d like to share.

The Git Community Book is a great quick reference for finding out how to use a command if you can’t recall from the man page.

If you want to really understand the gory details of branching and merging with git (and I do highly recommend understanding them … easy branching is the best part of git coming from a svn background), then read this long article on LWN.net.

Also, R. Tyler Ballance has a series of blog entries on moving his team from subversion to git. I especially liked Team Development with Git which details the bad habits of developers that are just becoming familiar with distributed source control.

The Battery Powered blog tells us how to deploy a Git Repository Server in Ubuntu, which may prove useful soon. Currently, I’m just using Git for my local work and then pushing to a SVN repo, but I’d like to move others to Git soon.

scie.nti.st also explains how to host a Git repo. Both this and the Battery Powered link above use gitosis to make setup easier.

/developer   〆   permalink

Monday, October 6th, 2008

Decent Python References

I’ve been doing some more Python development lately. Wanted to document the following decent references online.

/developer   〆   permalink

Saturday, May 10th, 2008

Run Your Software on Your GPU

Check out GPULib from Tech-X Corp. It gives you the ability to run mathematical functions on your GPU card (certain NVIDIA models only, as the moment). Includes a blog and bindings for Python (pystream) and MATLAB.

/developer   〆   permalink

Tuesday, May 6th, 2008

Idiomatic Python, the Cheese Shop, PyEuclid

Today is becoming python link day, so here are a few more:

  • Idiomatic Python has some great tips on how to use python as it was intended.
  • The Python Package Index is a good place to look for code someone has already written that might solve the problem you’re thinking about, and probably in a much cleaner way than you were thinking. This used to be known as the Cheese Shop.
  • pyeuclid is a nice 2D/3D vector, matrix, and quaternion math library (that needs better docstrings and a ray-sphereoid intersection).

/developer   〆   permalink

Tuesday, May 6th, 2008

Numpy for MATLAB Users

Great reference for those of us recovering from a MATLAB addiction, like this guy, who recently moved his scientific workflow to Python.

/developer   〆   permalink

Thursday, May 1st, 2008

Python-by-example

Straight-forward Python reference the explains the standard library rather completely and cleanly just by showing a simple example for each module and function. Very nice for a quick lookup of something you don’t quite remember.

/developer   〆   permalink

Saturday, October 13th, 2007

effbot

Great Python articles, books and downloads. Visit and enjoy. I especially enjoyed this optimization of a log file parser.

Some other interesting articles:

/developer   〆   permalink

Thursday, October 11th, 2007

SVN Version in Your Source

Suppose you are using Subversion to manage your code and find that you’d like to include revision information within a file. You might read this and think it won’t work, but do not be dismayed. You really wanted to look at Keyword Substitution in the Subversion book.

There you will find that enabling substution on a file is rather easy. Say you have some code in Spam.py and you’re running TortiseSVN. Then, the basic process is:

  1. Rt click file -> Properties -> Subversion tab -> Properties.
  2. Add a property svn:keywords with value Date Revision Author HeadURL Id
  3. Put a keyword in the file where you want it to expand the thing — I put $Id$ in the docstring of Spam.py. Id is a summary which, after checking in, expanded to "$Id: Spam.py 513 2007-10-10 23:10:30Z username $".

/developer   〆   permalink

Tuesday, October 9th, 2007

Hex Fiend for Windows

On Mac OS X, Hex Fiend handles editing of binary files beautifully. On occasion, I also need to munge around with large hex files on Windows. Today, I found the XVI32 hex editor — it does the job nicely, letting me delete out segments and re-save the result. It probably wouldn’t work as well with extremely huge files because it does everything in-memory, but for 300MB files, it works great.

/developer   〆   permalink

Friday, October 5th, 2007

Text Processing in Python

Check out this great book online (there is a print version too).

/developer   〆   permalink

Monday, September 24th, 2007

Why Rewrites Can Go Wong

Good article series from Chad Fowler on why rewriting software often goes bad if you do it as a Big Rewrite. Kevin Barnes also has some thoughts.

/developer   〆   permalink

Sunday, April 16th, 2006

Language-Maven vs Tool-Maven

In The IDE Divide, Oliver Steele uses his analytical knife to split developers into language mavens versus tool mavens. What would you rather use on your next project?

  1. a powerful language and text editor
  2. whatever language and a powerful IDE

/developer   〆   permalink

Monday, April 10th, 2006

People Don’t Crunch Well

Evan Robinson gives a clear explanation of why crunch mode doesn’t work.

In most times, places, and industries over the past century, managers who worked their employees this way would have been tagged as incompetent — not just because of the threat they pose to good worker relations, but also because of the risk their mismanagement poses to the company’s productivity and assets. A hundred years of industrial research has proven beyond question that exhausted workers create errors that blow schedules, destroy equipment, create cost overruns, erode product quality, and threaten the bottom line. They are a danger to their projects, their managers, their employers, each other, and themselves.

/developer   〆   permalink

Sunday, March 19th, 2006

Joel Test for the Web

The Joel Test gives 12 simple tests for the quality of a sofware development team.

Drew Mclellan offers thoughts on The Joel Test for Web Development. He finds that the test is still very useful in the context of web development.

/developer   〆   permalink

Sunday, March 19th, 2006

Cheat Sheet Roundup

Pete Freitag lists cheat sheets for developers. I love cheat sheets. This covers web, programming, version control, OS commands, and more.

/developer   〆   permalink

Sunday, March 19th, 2006

Subversion Install and Use on Mac OS X

Justin Williams of MacZealots.com gives some good tips on installing and using subversion on Mac OS X. I found subversion indispensable in keeping track of all the code and writing for my master’s thesis.

/developer   〆   permalink

Sunday, March 19th, 2006

Haskell for C Programmers

Haskell (a programming language) has no update operator. There is no order of operations. Find out more from this introduction to a “functional” programming language.

/developer   〆   permalink

Sunday, March 19th, 2006

Dignity considered harmful

Kathy Sierra, a writer for the Creating Passionate Users blog, elaborates on Paul Graham’s idea:

When you evolve out of start-up mode and start worrying about being professional and dignified, you only lose capabilities. You don’t add anything… you only take away. Dignity is deadly.

/developer   〆   permalink

Saturday, February 11th, 2006

Hoping that a future subversion won’t lose file dates

This feature is proposed in their issue tracking database as Issue 1256. It recently got bumped from consideration for version 1.3 and is now being considered for 1.5. For some reason, the fact that subversion doesn’t keep the last modification date of files under version control is very annoying for me.

/developer   〆   permalink

Wednesday, November 9th, 2005

William Kahan’s Archive of Math-Related Problems with Floating Point Implementations (including MATLAB, Java, C, …)

Mr. Kahan is a math/EE/CS professor at Berkely who writes some interesting notes on limitations and problems with math libraries. His work is archived on his homepage. Some of my favorites include:

/developer   〆   permalink

Tuesday, October 25th, 2005

Python + Readline = Auto Complete

I can’t really tolerate a command line and/or programming environment that doesn’t include a usable auto-completion feature (like Python’s built-in shell). To solve this problem, I’m using the “enhanced” shell IPython on my Windows machine. It wasn’t working well, but then I found that IPython’s docs suggest that I need the readline extention:

While you can use IPython under Windows with only a stock Python installation, there is one extension, readline, which will make the whole experience a lot more pleasant. It is almost a requirement, since IPython will complain in its absence (though it will function). The readline extension needs two other libraries to work, so in all you need:

  1. PyWin32 from http://starship.python.net/crew/mhammond.
  2. CTypes from http://starship.python.net/crew/theller/ctypes (you must use version 0.9.1 or newer).
  3. Readline for Windows from http://sourceforge.net/projects/uncpythontools.

Sweet. Download 3 exe’s. Install. It works and I’m happy. Lesson: sometimes it’s useful to read documentation.

See IPython’s quick tips for a crash course in the magic of IPython.

Also, see ONLamp’s tutorial.

/developer   〆   permalink

Sunday, September 18th, 2005

Do Not Fear Unicode

I recently decided to brush up on Unicode because I’m preparing to redesign this website and I’d like it to fully use Unicode as it’s text-delivery format.

What is Unicode? It is basically a mapping of a single number that represents each character in every writing system. It even includes some dead languages from the past.

Here are some great places to learn more.

I was struggling with how to enter Unicode characters on Mac OS X, when I finally found some useful tools that can be enabled by the “Input Menu” tab of the International System Preferences. If you enable “Character Palette” and “Unicode Hex Input”, you’ll get a little flag in your menu bar that lets you choose among two useful input methods:

  1. Character Palette - graphically pick your glyphs (see screenshot)
    character palette

  2. Unicode Hex Input - type in the hex Unicode code point while holding down the option key

Here’s some examples, for your viewing pleasure.

〆 = ideographic closing mark (U+3006)
☃ = snowman (U+2603)
♥ = heart (U+2665)
⌘ = place of interest sign (U+2318)
☮ = peace sign (U+262E)
∃ = there exists (U+2203)
∢ = spherical angle (U+2222)
’ = apostrophe (decimal 8217)
Δ, Й, ק, م, ๗, あ, 叶, 葉, and 냻

/developer   〆   permalink

Friday, September 16th, 2005

Useful Commands for Python Debugging

As explained in the Python Library Reference documentation, command-line debugging in python is made possible by the pdb module.

I like using it this way:

python -m pdb myscript.py

Once you’re in the debugger, the following commands were most useful.

h(elp): show me some help

w(here): print the current stack trace (where is the code now?)

u(p) and d(own): navigate up/down within the stack heirarchy

s(tep): run current line of code, stopping within sub-functions

n(ext): run current line of code, stopping at next line in the current function (aka step over)

b(reak): specify a breakpoint

c(ont(inue)): run until you hit a breakpoint

l(ist): show the source code surrounding the current line

p <expression>: print the contents of an object <expression>

q(uit): quit the debugger and your program

/developer   〆   permalink

Wednesday, August 10th, 2005

Installing Subversion on Windows with No Sweat

Mere-Moments Guide to installing a Subversion server on Windows allowed me to install Subversion within about 10 minutes on my laptop. Thanks, Joe White, for doing the work to write this easy-to-follow guide.

/developer   〆   permalink

Friday, June 24th, 2005

More Python: psyco and pythonmac

pythonmac.org has some very nice python packages pre-built for Mac OS X.

Psyco can really speed up the execution of Python code (only on i386 processors for now). It is a just-in-time compiler so you can run your code fast with no change in your souce code. If you’re interested in more tech detail, check out the theory (pdf).

Some other packages of interest are Matplotlib (provides a plotting library with commands similar in syntax to MATLAB), numarray (array/matrix processing), py2app (converts python scripts to standalone Mac OS X apps), and the Python Imaging Library (PIL).

/developer   〆   permalink

Friday, June 24th, 2005

Codeville Version Control

The distributed version control system called Codeville sounds very nice. I’d like to check it out. Favorite feature: “Almost trivial to use for personal projects without running a server”.

/developer   〆   permalink

Tuesday, June 21st, 2005

Norm Matloff’s Python Tutorials

Professor Norm Matloff from University of California at Davis has many sets of nice tutorials. I especially liked his stuff on Python.

Actually, he has quite a few nice articles and tutorials on programming:

/developer   〆   permalink

Saturday, December 4th, 2004

Graphical User Interface (GUI) Design Tips

Benjamin Roe’s “Usable GUI Design: A Quick Guide” nicely summarizes some of the most useful ideas in user interface design. His 5 major points are:

0) The user is not “using” your application, rather getting their work done with the help of your application.

1) Fitt’s law: big stuff close to your mouse is easier to click on.

2) Avoid unnecessary interference with your user.

3) Use the power of the computer to be helpful to the user. Don’t burdon with mundane tasks.

4) Make items easy to distinguish and find.

I also think that saving state is a very great feature that could improve many applications. Ben mentions this under his point 3, but I just wanted to emphasize that saving state is very important. Some of my favorite applications do this well (MATLAB, UltraEdit, Firefox with SessionSaver) once it is setup, but I think it should be the default!

/developer   〆   permalink

Sunday, November 28th, 2004

MATLAB Distributed Computing Toolbox 1.0

On a related note to my previous post, The MathWorks, makers of MATLAB, have just released thier first toolbox focusing on supporting distributed computing.

The Distributed Computing Toolbox allows one to develop a MATLAB program or Simulink simulation that can be run on a cluster of computers. It’s very platform-savvy: it runs on Linux, Mac OS X, Solaris, or Windows.

/developer   〆   permalink

Sunday, November 28th, 2004

Using MATLAB with Xgrid

As reported on Mac OS X Hints, it is possible to use MATLAB to Xgrid. It only should work well for those “embarassingly parallel” tasks that you can manually split into chunks of data to process, but it could be interesting!

/developer   〆   permalink

Wednesday, October 27th, 2004

Good SW Essays

A good collection of software essays is listed on Joel on Software discussion group.

/developer   〆   permalink

Friday, September 10th, 2004

Intro to Source Control

Erik Sink’s Source Control HOWTO is a very good introduction into the basics of a software configuration management system.

/developer   〆   permalink

Friday, September 3rd, 2004

Security and Privacy for Regular Folks

Thomas C. Greene writes about improving Linux and Windows security. It’s quite in depth.

/developer   〆   permalink