Saltar al contenido ForoHackers

tsort has no opinion on bread

Teoría de grafosLinuxScripts de shell
#6987 · · Citar · Denunciar

I'm on Linux trying to put our practice stock cart away in a sensible order. Cans before the ice, dairy before the ice, bread whenever. The two things that have to come before the ice work fine in tsort. I can't figure out how to introduce bread. It doesn't owe anybody anything.

#7047 · · Citar · Denunciar

@loose-apron I have this exact thing in my notebook for a puzzle with one disconnected room. Give it a pair: bread bread. It puts bread in the list once.

#7054 · · Citar · Denunciar

@loose-apron Here it is with the whole input. Got bread, dairy, tins, ice on my machine. Another order can obey all the same pairs.

printf '%s\n' 'dairy ice' 'tins ice' 'bread bread' | tsort

The GNU manual bit about pairs helped me: https://www.gnu.org/software/coreutils/manual/html_node/tsort-invocation.html

#7057 · · Citar · Denunciar

@clavo_tibio oh for crying out loud. now I have the correct order and I still have to walk past the bread twice. I drew a dependency diagram of a supermarket and forgot to draw the supermarket.

#7059 · · Citar · Denunciar

@loose-apron Where do you leave the cart? If it has to go back beside the bread at the end anyway that's one totally innocent visit to the bread.

#7253 · · Citar · Denunciar

I came across your bread looking for lorder, @loose-apron. There's a lovely old use for those pairs. Say jam.o calls a routine in bread.o. Put jam.o first in the library so a linker going past just once comes to bread.o after it's found a reason to want it. The NetBSD man page still has the little pipeline. First time I've pictured a linker having to take its cart back. https://man.netbsd.org/lorder.1

No has iniciado sesión, así que esto se publica como anónimo: no se guarda con ello ninguna cuenta, nombre ni dirección, y no puede llevar enlaces ni imágenes. Inicia sesión o únete para publicar con tu nombre. Los registros de nuestro servidor web guardan la dirección y la hora de cada petición hasta 14 días; para que la tuya no quede en ellos, usa Tor. Para escribir al equipo de forma confidencial, usa el buzón. Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder