Thursday, October 30, 2008

Installing Player / Stage

Playing around with the Player / Stage project from source for a tad bit of research. A few install notes to help others headed in this direction.

Player

Pretty nice installer with (seemingly) clear output about what packages will not be built and why. Somehow I missed the fact that playerv would not be installed due to a number of missing packages in this output. Digging through some mail logs I found that I should also install the packages: libfltk1.1-dev libgtk2.0-dev libgdk-pixbuf-dev libgnomeui-dev Also, remember that rerunning configure does not force code to be rebuilt. A make clean solves that. Oops.

Stage

Just needed to install cmake.

Tuesday, October 28, 2008

Good DVI to PDF Conversion

Old school Latex user and want to produce clean PDF files without pdflatex? The following steps tend to work pretty well after you've generated a dvi using latex:
  • dvips -P cmz -t letter -o file.ps file.dvi
  • ps2pdf file.ps file.pdf
If the '-P cmz' option to dvips does not work, some folks have luck with '-P pdf'.

Wednesday, September 10, 2008

Lines Per-Page in LNCS Formatting

Typing with a text width of 72, I get about 60 lines or 550 words of text (with no formatting, sections, etc.) per page of LNCS formated LaTeX. An alternate way view of this is about one column of ACM 10pt text. Crazy!

Tuesday, September 9, 2008

Disabling Intellisense in Visual Studio

For one reason and another I've been needing to use MS Visual Studio 2005 on a big project at work. Unfortunately, running MSVS with a BIG project in a VM on an already resource limited machine can bring my system grinding to a halt. The key offender seems to be intellisense. The easy answer is to disable intellisense... Too bad that's not an option in MSVS! I finally found this tip from k_d on the Microsoft Forums:
The simplest way to disable Intellisense for a solution/project is to simply create a directory with the same name of the intellisense file in the directory where the file normally resides. In other words, if you have a Stuff solution, delete the Stuff.ncb file in the directory where Stuff.sln resides and create a directory named Stuff.ncb. Every time you load the solution a dialog panel will be displayed warning that intellisense will be disabled, but other than that everything seems to operate normally.
And it works!

Saturday, August 9, 2008

Poor Boy's Header Dependancy Graph

Spent a few days breaking up a nasty cluster of inter-header dependencies. The code base contained a large core of header files that each included lots other header files that were not needed. That kind of thing irks me like fingernails on a chalkboard. I decided to graph header includes to visually look for odd includes, connected clusters that can be merged into a single header file, and redundant includes. My solution simply generates a dot graph for easy visualization.

#!/bin/bash

# 'Cause bash bugs suck
set -o nounset
set -o errexit

BASEDIR=$1

echo "digraph depends_on {"

for file in `find $BASEDIR -name "*.[ch]" -print | grep -v "tools/"`
do 
    for include in `grep "#include" $file | tr \< \: | tr \> \: | tr \" \: | cut -f2 -d\:`
    do
        f=`basename $file`
        i=`basename $include`
        echo "    \"$f\" -> \"$i\";"
    done
done 

echo "}"

Monday, June 30, 2008

Cygwin Copy and Paste

Can't copy to and paste from the Cygwin window? I had the problem also until I enabled copy and pasting from the Cygwin window:
  1. Open Cygwin
  2. Right click on the Cygwin icon in upper left of window frame
  3. Check 'QuickEdit Mode' from the properties menu
Windows will prompt to see if this should be the default. You can say 'Ok' to make it the default. Now copy and paste to your hearts content!

Tuesday, June 10, 2008

Building Valgrind Without Root

Word on the street is that support for debugging Wine using Valgrind has continued to increase over the past year. I decided to give Valgrind another whirl and see what I can find. I'm currently working away from home on a computer that I don't have admin privileges on and that made the Valgrind build a little more exciting.

$ sh autogen.sh

aclocal: configure.in: 58: macro `AM_PROG_CC_C_O' not found in library

Bummer. Valgrind requires a recent version of autotools. The distribution that I'm running on uses a default of automake-1.4 and aclocal-1.4 as specified in /etc/alternatives. Fortunately, 1.9 versions of both tools are installed. Some quick symbolic links to a ~/local/bin and a redefine of my path cleared up those problems and I was good to go.

Setting Up New Workstations

You get a new job, the dog eats your laptop, or it is time for the annual wipe and reinstall (although I've not done the past for a few years now). Either way you need to recreate a working environment that works. Here's the short list of what I typically do:

Dot files

  • bashrc
  • vimrc
  • vim (directory)
  • irssi (directory)

Firefox Add-ons

  • Add Block Plus
  • Flash Block
  • It's All Text
  • Session Manager
  • Tabbrowser Preferences

Programs

  • Ion
  • Vim (with all the good stuff)
  • Git
Over the next week or two we'll see what all I've forgotten.

Thursday, May 29, 2008

Debugging in Python

Test driven development, clean code, and the occasional printf statement can go a long way towards debugging programs. But I remain a bit surprised by the number of developers who seem to take offense when users ask about a debugger for python. For those who do find reason for using a debugger I recommend: The former is a friendlier read with a tutorial flavor, while the latter provides a definitive reference.

Tuesday, May 6, 2008

Latex and Letter Paper

Very rarely do I work on a system that has the correct defaults setup to produce letter paper. The steps to get everything coming out nice and "letterpaperish" are:
  1. Specify letterpaper in the documentclass command
  2. Specify the paper size when converting from dvi such as: dvips -t letter mydoc.dvi -o mydoc.ps
A (slightly) more detailed description of this is available at C.U. Boulder's A4 paper vs. letter paper.

Wednesday, April 30, 2008

Inline Functions in C

Unfortunately, inline in C leaves a bit to be desired. A decent description of the funk that emerges / is supported by GNU C is described in Inline Functions In C. The short version is to suck it up and use static inline with code sitting in a header file. Blah.

Thursday, April 24, 2008

Multi-Architecture Builds

Building for multiple architectures tends to get a bit messy. Trying to get a clean OS build that uses:
  • Core OS kernel (same code base on multiple targets)
  • Processor specific drivers
  • Platform (hardware attached to processor) specific drivers
Current build system uses vpaths to locate all source files that are built into objects residing in a single build directory. Unfortunately, this build system is very ad hoc and rather painful to expand or even maintain. I had hoped to move over to autotools ('cause they make everything better, right...) but soon ran into problems. I've not figured out how to link to an object file built in directory X from another directory Y. My current solution uses libtool (rather viral suite of tools, you grab piece of autotools and the rest soon follow) to create a holder library in each directory if interest and link these into a final image. Good idea? Yes, except it fails. The final image uses jump tables of code not directly accessed from any point in the program. I've not yet figured out (seems that this happens a lot to me) how to force the linking of code that is not ever accessed. I'm currently working off of two sample tutorials on line. We'll see if a combination of them solves my problems:

08/04/30

It looks like the best way to do what I have in mind is through the use of the subdir-objects. But I didn't get that up and running before heading back to research.