The Code Kitchen

I wrote this bit of code while working on a D project this morning:

 

void trace(R ...)(char[] a, lazy R r) {
     if (tracing_enabled)
         do_trace(a, r);
}

trace("Playing {} on {} ({})", _sound, _channel, _device);

That, friends, is a variadic lazy function template conditionally at run-time calling a type-safe variadic function, only evaluating its arguments if the call is made.

#

You are banned from this site due to an unknown user-agent

Best Error Page Evar

#

DESTROY OF HONOR

#

There's something that's been bugging me for a while: how did I ever enjoy the Red Hot Chili Peppers?

#

Redmine Invoicing Plugin

#

Simple git-daemon launchd script

Here is a simple launchd script to run git-daemon under launchd on Leopard. Edit the XML to tweak any options, it's self-explanatory.

You'll need to change at least the UserName and --base-path options to match your configuration. Don't forget to touch git-daemon-export-ok in each repository you want to export. See git-daemon(1) for more info.

> sudo mv cz.or.git.git-daemon.plist /Library/LaunchDaemons/
> sudo chown root:wheel /Library/LaunchDaemons/cz.or.git.git-daemon.plist
> sudo launchctl load /Library/LaunchDaemons/cz.or.git.git-daemon.plist

#

fish in the river

Invisible wires.

#

the view from on top of bald mountian

The view from top of Bald Mountain looking toward Mirror Lake.

#

#

Is your local hardware store owner on the no-fly list?

 In the process of remodeling our basement, we found part a March 1959 issue of the Deseret News and Telegraph stuffed up in the ceiling. I could go on and on about some of the fascinating parallels with content you'd find in any major newspaper of 2008 -- some things really never change. But this hilarious post-McCarthy-era comic took the cake for me:

Nancy comic from March 1959

The late '50s also appears to be one of those periods when everybody wanted good mileage from their vehicles -- most every car ad prominently displayed a MPG rating. Did you know that the 1958 Renault 4-door sedan got 40 MPG?

delicate arch in arches national park, utah

Delicate Arch (aka "the schoolmarm's bloomers")

#

wildflower in foreground, mountains and clouds in background

 On Desolation Trail, near Salt Lake City. We saw the biggest rattlesnake I've ever seen, I'm kicking myself for not getting a photo before it got out of view.

#

#

Comments? Feedback? Drop me a line.

The Code Kitchen is a software consulting business run by me, Brian Palmer. But this site is really about whatever catches my interest.

Questions or Feedback? Email Brian.

Lorem Cookies

cookiesLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.