esvect and reflectbox

2007-10-06 Thread Tom Jones
Hi,

I am trying to create a leftarrow of \vv{}.  I thought I could just 
reflect the vector, but the solution has escaped me.  Could someone help 
me out?

[EMAIL PROTECTED]
   [EMAIL PROTECTED]
\cleaders\hbox{$#4\mkern0mu#2\mkern0mu$}\hfill%
\mkern-1.5mu#3$%
}

was replaced with

[EMAIL PROTECTED]
   [EMAIL PROTECTED]
\cleaders\hbox{$#4\mkern0mu#2\mkern0mu$}\hfill%
\mkern-1.5mu#3$}%
}

But the result is incorrect (the vector does not fill properly).

Thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list


dependency algorithm

2007-11-14 Thread Tom Jones
Hi,

Consider tuples of the above numbers in the form:
   (a,b)

Suppose this relation means:
   a depends on b

Given a list of tuples, I would like an algorithm to return the proper 
ordering of the elements...and if the ordering has a loop (which in this 
case, prevents a proper ordering), then it should return None.

For example,


   [(1,2),(2,3),(3,4)]
should give:
   [4,3,2,1]


   [(3,2),(1,3),(2,4)]
should give:
   [4,2,3,1]


   [(1,4),(4,3),(2,3)]
should give:
   [3,2,4,1]  or [3,4,2,1]  (which one doesn't matter)


   [(1,2), (2,3), (3,2)]
should give
   None, since it cannot be resolved


I'm sure this is a standard problem (mro, resolving inheritance?), but 
this is a simplified case since each element can directly depend on only 
one other element (thus, multiple inheritance is not allowed)...but many 
elements can depend on the same element (no limit on the number of 
classes which subclass another class).  A quick hack is simple enough to 
code, but I am wondering if there are 'standard' ways of performing this 
task in this limited scope.

Thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list