Archive for 2011

Motorcycle shops and parts places for vintage japanese bikes in the Bay Area

So far I’ve had great success with or good recommendations for the following places for service and parts for my Kawasaki KZ650-B2:

  • O’Hanlon Motorcycles for top notch service, advice and parts. Under a $100 per hour!
  • Hayasa Motorcycles in Oakland
  • Golden Gate Cycles for parts
  • Werkstatt if you have to, they have parts and stuff but they’re not very nice.
  • Berkeley Performance Motorcycles & Service
  • Hayward Cycle Salvage if you ‘re okay with digging through boxes
  • Fremont Cycle Salvage, again, if you’re okay with digging through boxes for second hand parts.

Of course there are internet retailers as well, but these are the places to call if you need parts right away.

Pat’s paper-writing formula.

My advisor, Pat Hanrahan, just stated his paper writing formula. Since he’s a God in the graphics world, I’m going to yot this down for future reference:

  • Motivate the problem
  • State the challenge
  • Describe your approach
  • State your contributions

His golden rule for writing good science papers is, be precise, be complete.

The Ideal TextMate Setup.

I’d like to present my TextMate setup as my ideal coding environment:

I’ve only recently discovered that the real secret to TextMate is having the right bundles. I’ve got TextMate configured with the following bundles:

Then, there is a set of utilities I use that’s not actually TextMate, but that I primarily use along with TextMate:

  • fikovnik’s ShiftIt to move textmate & terminal windows around using keyboard shortcuts
  • Divvy for accurate placement of my windows to get 100% screen space utilization.
  • git for source code tracking, it’s unbeatable.
  • rsync for data files (especially those multi-gigabyte binary meshes).
  • git hooks into rsync, so it automatically rsync’s when I push.

X-Macros

This blew my mind and made my eyes bleed at the same time. My convoluted version of X-Macros:

char* foo() { return "foo"; }
char* bar() { return "bar"; }
void baz(char *z, char* a, char* b) { printf("BAZ: %s, %s\n", a, b); }

#define ARGS(_) ,_

#define KERNEL_CALL(a) \
KERNEL_ARGS(PRINTF_MACRO); \
baz("boo" KERNEL_ARGS(ARGS)); \
printf("Now we print %s\n", a);
int main() {
#define KERNEL_ARGS(_) _(foo()) _(bar())
#define PRINTF_MACRO(_) printf("I am printing %s\n",_);
KERNEL_CALL("done");
#undef KERNEL_ARGS
#undef PRINTF_MACRO
}

The biggest problem with this approach is the opaqueness it introduces into your source. You can’t grep for the results of the preprocessor, so if you use X-macros to create functions by concatenating arguments together (which is exactly what they’re good at) then grepping turns up nothing!