free hit counter

Friday, April 21, 2006

What the hell is the ## doing in the middle of a C++ macro?

Funny me, I went searching all over google, google groups, and a9 for it. Since I only found scant uncommented references in code I figured it had to be something totally obvious.

So, going on the track that it must be something so basic that everyone knows it and so doesn't bother writing about it on the web I grabed my trusty K&R C book.

Right there in the index, and written about on page 90: the ## operator in a macro will concatenate two macro arguments. e.g

#define MAKE_NAME(x,y) x ## Y
//...
MAKE_NAME(frank, 1) //will create frank1

Labels:

Wednesday, April 19, 2006

company

Original Designer of Cubicles remarks on their adulteration

Metropolis Feature: The Man Behind the Cubicle

My favorite quote comes right at the end:

"The dark side of this is that not all organizations are intelligent and progressive," Propst says. "Lots are run by crass people who can take the same kind of equipment and create hellholes. They make little bitty cubicles and stuff people in them. Barren, rat-hole places."

Tuesday, April 18, 2006

sortable, pickable Ecel tables

Missing my nice TWiki tables, and looking for Excel add ins for similar funcationality.

The builtin autofilter checkbox under the data menu is great, as are the data->validation dropdowns.

There doesn't look to be a bultin datepicker, but this addin looks like it should do the trick:
Excel Date Picker

Monday, April 17, 2006

Compiling your C++ app with the Python C API

The boost documentation has an example for including the Python C API lib using bjam, but its easier for me to use a qmake include file:


PYTHON_PATH= C:\python24
INCLUDEPATH *= $$PYTHON_PATH\include
LIBS *= $$PYTHON_PATH\libs\python24.lib


Embedding

cool looking tool: Code Collaborator

Tool for supporting code review which organizes documentation about each step of the process

Code Collaborator

Saturday, April 15, 2006

Understanding the histograms your DSLR gives you

Great artical.
Understanding Histograms

And a way more technical one I haven't finished digesting:
http://www.luminous-landscape.com/tutorials/expose-right.shtml

Monday, April 10, 2006

python doc strings

To see a python functions doc string use its __doc__ property:

print math.atan2.__doc__


If you're doing this in a larger script it may be more helpful to use str(foo.__doc__) because function foo may not have a doc string and if it is null, str will nicely print 'None'

Wednesday, April 05, 2006

Open source implementation of the ITRON RTOS

Monday, April 03, 2006

python vs qt: namespace collision

This is why the #define is bad, and namespaces are good. QT #defines their keyword slots, but python's object.h defines a struct member with the name slots. Try to use both libraries without carefull header inclusion order is a cryptic error message about a missing semicolon in python's object.h

The solution is to include all the boost stuff before QT stuff. May be easier said than done.

linkage

Monitoring Windows Services

Because it's so damn hard to share files between two Windows PCs that aren't on the same domain I installed an FTP server. But I don't always want the thing running. So, I turned it off, but wanted to double check that the service was *actually* disabled. Services don't show up in Task Manager, and they're hidden from view.

To monitor which service processes are running on your machine: start->Run->msconfig

source linkage