News for hackers. Stuff that matters.
Re:Sick Linux Commands by jfb on Saturday December 04, 2010 @09:27AM (#1969266)
I make this comment on every one of these posts, but the one I am so glad some beardie committed way back in the dim mists of time is "tsort". Sure, only the linker really needs a topological sort, but pulling it out into a separate executable has saved my bacon on more than one occasion.

It's little gems like that that make Unix bearable.

Re:Sick Linux Commands by Monkeyget on Saturday December 04, 2010 @10:34AM (#1969367)
In what kind of situations do you use topological sort? I can't think of any scenario where I would use it leading me to think that there are problems I could solve more easily by thinking of them as graph problems.
Re:Sick Linux Commands by jfb on Saturday December 04, 2010 @10:41AM (#1969388)
I've used it to drive a bunch of independent makefiles, when I didn't need an overarching makefile. I've used it to sort dependencies in a simple work queue thing I wrote in the shell. It's not generally all that useful, but being able to grab it and do a quick tsort on paired strings is significantly less painful than writing a Python or Scheme script to do it, and it fits neatly into a pipeline.
Re:Sick Linux Commands by silentbicycle on Sunday December 05, 2010 @02:47AM (#1971204)
I wrote a simple (http://github.com/silentbicycle/wn) to-do graph analyzer for exactly that. I got sick of analyzing "I have to do X, but X needs Y and Z, and Z needs A, and ..." dependency charts. I'm comfortable with BSD make, but sometimes clients give hairy dependency graphs.