Both Ruby and Python offer great interactive shells, also known as REPLs (Read Eval Print Loops). These are handy for verifying snippets of code. You can invoke Python's by simply running python or Ruby's by running irb, jirb (for jRuby), or rails c (for Rails). Sometimes, however, one can be mystified as to what one … Continue reading Exploring Ruby and Python interactively
Category: Software development
An IDE for TeX
TeXnicCenter is an excellent IDE for developing TeX documents on Windows. It follows the usual interface conventions and is quite helpful in getting started and debugging. TeX is the standard page layout language for writing mathematical and scientific papers. Here are some excellent tutorials for getting started with TeX. The IDE requires MikTeX for actually … Continue reading An IDE for TeX
How to enable logging in Python LDAP
When writing Python scripts which rely on python-ldap and openLDAP, it is often useful to turn on debug messages as follows: import ldap; # enable python-ldap logging ldap.set_option(ldap.OPT_DEBUG_LEVEL, 4095) # enable openLDAP logging l = ldap.initialize('ldap://yourserver:port', trace_level=2) This is also useful when debugging the LDAP Plugin for Trac.
Array access and virtual memory
(This applies to Java and C, but the code is given in Python for readability.) Is it faster to iterate over multiple separate arrays (tuples) of simple variables? for i in range(0, n): phone = phones[i]; # ... email = emails[i]; Or over a single array of complex variables? for i in range(0, n): phone … Continue reading Array access and virtual memory
Setting up svn with trac
Trac is an excellent web-based wrapper for SVN that adds bug tracking, a wiki, and several handy project management features. I keep setting up new repositories up for all the little projects we cook up in DB2 Technical Marketing, so I thought I'd write up a guide. Installing Trac, SVN, and dav_svn for Apache2 is … Continue reading Setting up svn with trac
No implementation defined for org.apache.commons.logging.LogFactory
While writing a DB2 stored procedure that invoked a SOAP/WSDL web service using Apache Axis as part of WSIF, I ran into this doozie: org.apache.commons.discovery.DiscoveryException: No implementation defined for org.apache.commons.logging.LogFactory Ultimately, it's caused by a too restrictive lib/security/java.policy file that ships with DB2. Wrong Solution The standard way to define an implementation is to create … Continue reading No implementation defined for org.apache.commons.logging.LogFactory