16 Nov 2008 (updated 16 Nov 2008 at 21:24 UTC)
»
You can do everything in assembler
I first want to say that layout manager and such really is
something that is old technology and already included in all
modern gui's, but it is always good to just focus on a thing
and think a little to see if things can be improved.
When drawing diagrams in powerpoint I always get very
frustrated. the reason is that I believe that something like
a well implementation of the tools found in the TeX
community to draw diagrams, would be so much easier (for
me). It would be so cool to be able to use the TeX tools to
layout stuff in diagramming and gui construction. If you are
like me I suggest to read and play with those TeX tools like
xy-pic, great fun.
Let me also point out that QP is probably not used because
simpler solutions then what I described is probably already
implemented. The point using QP is that you can specify that
not only X is close to Y, but allow the distance is allowed
to vary if there is conflicting constraint(s). It is also a
quite
general framework if you stick to linear constructs. What
I miss is a framework and tools, to handle and develop
layout managers. There should simply be a tool for me and
others who now the math (perhaps do it using scipy) to
develop some great markup framework to do layout of
different things. I could imagine it being based of QP and
also of cause, as a special case Linear programming. One
could think of including other mathematical tools as well
like convex programming.
As an example let's discuss about implementing a tool to
make sure that the layout has straight left and right
margins. We stack a sequence of objects X1,X2,X3..., with a
smallest distance d1,d2,d3,.. between X1,X2;X2,X3;..., And
we also say that we punish a deviation from di by a coupling
constants C1,C2,... basically you could automatically select
Ci,di according to the sizes of objects (xy-pic in the TeX
world has such ideas in it's layout strategy of diagrams.)
Now to specify a conflicting constraint to let the total
distance of the sequence to be constant in order to achieve
a right margin. You never get an exact right margin, but by
adjusting the spaces between words or objects you may make
it happen. The good thing using this is that you will always
get an answer and depending on measures how well every
constraints is satisfied you can decide to remove objects to
the next line or include new objects. Also you could fire up
guis and let users who want to tweak the coupling constants,
do it to adjust the layout.
Finally here is a trick I use to deduce the components in a
quadratic criteria x'S'x + v'x + d from other
representations without thinking. When I first tried
to do this I went for the white board and started to deduce
things by hand. well that is not needed. just define a
function f(x) that is your definition of the criteria,
that is most easy to define. Then use your computer to
evaluate f(0), f(ei),i=1,..,n, f(ei+ej) i,j=1,..,n. Using
this information you will be able to deduce S and v.
I find this a very neat tool. It is written once and will
save you ton's of time.
What I fear is that we mostly develop to make things
simple for the less advanced users because most users are on
that level which means that this is ok. Beeing an advanced
user means that you don't get the benefit of most
development and that means that you are not 10 times as
effective but perhaps only 2 times and you loose.
Cheers