Archive for the ‘PHP’ Category

CSS2UML - generating hierarchy graphs from CSS

Wednesday, May 14th, 2008

One day doing my labour work - related with models transformations. Unexpectantly work results was interesting and not quite but i wanned but, decided share my results with you.

Main work idea was model transformation. But in this case transformation results was unextpected. Was created prototype witch allows generate hierarchy graphs from CSS (Cascading style sheets)

How does it works ?
Generatoriaus veikimo schema

Schema is quite simple (P.s at some schema elements you can do not pay attention) they were left just for simplifying understandability.

Like you see graphs are drawed using graphviz tool. This tool is also used by doxygen doxygen for drawing diagrams. For parsing CSS file is used csstidy, but tools is not quite stable atleast. Talking about graphs results it’s submited in the picture.

Įrankio sugeneruotas grafikas

Also would like to mention that tool does support complete CSS standards like (p + table) and so on. But most regular CSS files it parses “correctly”. One of the interesting result graphs . Also nocited that there are some problems with comments interpretatio. Of course you can play your self.

Talking about practical adoption the only purpose of this tool i see possibility use this tool for better understanding page CSS hierarchy then need quick integrate some enchantments do not breaking whole CSS structure.

Working tool realization can be found here

PHP caching methods (Unfinished traslation to english…)

Sunday, December 2nd, 2007

So, I will try to review a ceople caching methods witch I used.

  1. SQL query caching.
  2. Content caching
  3. Memcache( For testing purposes tested )
  4. eAccelerator, Zend and others similar php cache engines.

(more…)

PHP sorting algorithms

Sunday, December 2nd, 2007

One day looking for a sorting algorithm spent some time and did not find anything good. Actually found, but it needed some adoption. So decided paste it here, maybe someone it will save some time:

I give you free main functions.

  • First moves item up.
  • Second moves item down.
  • Third one moves item down or up by number of positions depending on given parameter.

(more…)