Phillip Pearson - web + electronics notes

tech notes and web hackery from a new zealander who was vaguely useful on the web back in 2002 (see: python community server, the blogging ecosystem, the new zealand coffee review, the internet topic exchange).


Proper C++ macros?

I just found this in the ht://Dig source code:

#define encodeInput(name) (s = input->get(name), encodeURL(s), s.get())

I had no idea you could do that. A function defined as a macro, that actually returns something.

So will the following work?

int b;
int a = (b = 3, b += 1, b + 1);

Didn't know that C++ would let you do this sort of thing...

Update: I tried it and it works:

#include <stdio.h>

int main()
 int a;
 int b = (a = 1, ++a, a++);
 printf("a = %d, b = %d\n", a, b);

(It prints "a = 3, b = 2").
... more like this: [, ]

PyCS search, continued

Back on this again today. The search engine is looking reasonably stable on Linux. On FreeBSD it's not cleaning up the child processes though, so there's a bit of debugging to do before it'll go properly there.

Follow the instructions to set one up for yourself, if you'd like to try - they work now (I think).

To do still:
- fix FreeBSD child process bug
- get display looking right (currently the templates don't look very PyCS-ish)