. .

Monthly Archives: August 2011

0

Graph editor and Matrix generator

Graph editor and Matrix generator

Making matrix representations of graphs always takes a lot of time. For practicing algebraic or spectral graph theory on computer algebra systems, one has to create a lot of graphs. A handy tool can make this easy, which allows to draw graphs and generate code e.g. for Maple with one click. Well I couldn’t find a tool like that, so I made one on the weekend in C#. With it, you can draw custom graphs, including: arbitrary loops, parallel edges, directed edges, etc. and can generate code for these computer algebra systems: Maple, MATLAB, Maxima. Then the code can be

0

Exception class with printf-like parameters for C++

When raising exceptions it is good to make their error texts as detailed as possible. Usually this isn’t an easy task, cause it involves type conversions and string operations. This is why I’ve implemented this class, which can be instantiated by printf-like parameters as easily as this line: throw(new FException("Invalid tag: ‘%s’. At line: %d.", tag, line));

0

Deadlocks and graph theory

thumb

When accessing a database through a series of transactions, a deadlock can occur any time. They are natural companions of transactions. We can decrease their likelihood by rigorously  accessing the records and the tables always in the same order, but over a level of complexity we can never be 100% free of them. This is a fair price for the ACID properties. Deadlocks occur very rarely,  and when this happens, the only thing to do is to repeat the transaction in the process which had been interrupted by the deadlock detection demon of the database. This is very small performance