code formating

Monday, March 14, 2011

From text to graph in a blink of an eye

If I tell you I draw finite state automata with plain text, would you take me as a freak?

It's being time since I was seeking for a free GNU/Linux based application to draw simple circles connected by arrows. This is a very simple way to represent
states and state changes in programs as well as in real life projects and processes. I wanted something easy to draw and easy to change ones it's drawn.
I wanted beautiful graphs, that would keep it's forms as I add more bubbles to it. I wanted all and I wanted it now! Well, want it no more.

DOT is a plain text graph description language.(n.d.). In Wikipedia. Retrieved March 14, 2011, from http://en.wikipedia.org/wiki/DOT_language
It abstracts away the drawing part and leaves you with the structure part. You can easily declare nodes, give them names and connect them in plain text.

Ones you are finished, execute a program that can process DOT, and you will have a beautiful graph. You don't have to think about organising bubbles every time you want to add something new. Just change the text, rerun the program and done!

A very simple example of DOT could be this:

diagraph name1{
a->b->c;
b->d;
a[label="start"];
b[label="
jump"];
c[label="land"];
d[label="fall"];
}

Executing it gives you this:

Programatically walk a CATIA tree in .NET

One of the most basic tasks when automating anything in CATIA, it's usually to walk the whole tree and apply some changes to objects in ...