php
daniele_dll's picture
Tagged:  •    •    •    •  

Hola a todos,

di certo non si può dire che sia un bel giorno, dato il mio attuale stato: febbre, raffreddore forte, sangue dal naso e qualche altra poco piacevole situazione!

E' da stamani che mi frulla per la testa un'idea, ovvero quello di rilasciare, su base mensile, sotto licenza BSD, il codice sorgente dei miei applicativi mai finiti per un motivo o per un altro!

Almeno chi ha pazienza o qualche dubbio potrà farne uno per semplificarsi la vita :)

So che non è poi moltissimo, anche perché la documentazione non sarà il massimo, ma sono tutti pargoletti miei che non hanno mai visto la luce e che ci terrei se qualcuno, per un motivo o per un altro, li potesse usare per semplificarsi la vita :)

daniele_dll's picture
Tagged:  •    •    •  

Hi to all,

after a day of work i wrote this little tool to write documentation for databases!
I must add field relations yes, but it's really useful! This application can save documentation producing an html file and a status file that contains documentation status and can load documentation status to let you to contine your work!

Here there is a screenshot:

MySQL DB Documentor while works on MySQL table

daniele_dll's picture
Tagged:  •    •  

A couple of days ago i seen my friend ateicos, the one that work with me on cmsoft2 and its framework. I've seen him, up to now, three times, to define the framework and it's control flow!

If all goes well the next week i'll meet him to define last stuff and write down framework basics, like framework starter and framework loader. Loader will need a caching system so we will convert existent stuff (DBAL and Caching System of CMSoft2) to the framework to test his architecture and check what is necessary to trash, to change and what will remains!

daniele_dll's picture
Tagged:  •    •    •    •    •    •  

Looking around for the web, some time ago, i discovered Phalanger: a php compiler written in C# to output dot net assemblies!

A couple of days ago i rescued it because the smartclient for CMSoft2 will use it for administration modules!

After a lot of experiments, i succeded in php code compilation, assemblies loading and, for the end, in classes instanciation and execution: using windows forms, from php, i shown a form with a label!

I hope that in a couple of days to post a screenshot of smartclient user interface, however, at the moment, there is a shot of a test layout, look at attached files (the clock will be replaced by other stuff).

Ah, before i forgot it, phalanger is twice faster than php and if it will pass to use DLR instead of a lot of code to emulate typeless structure it will be more faster!

daniele_dll's picture
Tagged:  •    •  

Have you ever checked resources consumption of your software? I do it regularly !

A lot of web softwares never check memory and cpu consumption: the result is that a lot of these cannot be used on big web sites and if them are used is necessary a lot of powerful hardware!

As you know i started to work on CMSoft2 and the first step of this work is to make a features's list: a list that contains what is really useful, what is necessary and what can be useful later. To do this is necessary to try out famouses CMSes: wordpress have a wonderful dashboard and drupal has a centralized content managent!

Do you ever think how these features are implemented? How them work and how much resources requests? No? I've done this for you!

If you look at the end of the page you will see two strange lines: them are peak memory consumption and execution time.

Now you try to think at your website: if it has 10 users that connect in the same moment THEY WILL USE ~75 MEGABYTE OF MEMORY! With drupal to mantain online 100 users you will need ~750MB of memory: this is an killer application!

If your server has 1GB of memory, it'll use swap fastly and this is bad: when your server start to use swap, memory is copied from harddisk to memory and from memory to harddisk, without a pause: this kill your harddisks and your applications are slowed down!

As drupal a lot of well known famous software are killer application:
- wordpress
- phpnuke
- xaraya
- xoops
- exoops
- postnuke
- evolution
- drupal
and so on

Wordpress, for example, when a post or a page is loaded extract from a serialized array a tons of perl compatible regular expressions and execute them stopping only when one of these match the url! If you blogged for one year and someone access to your "Who I Am" page, added at begginning, wordpress will execute server preg for every post/page before the correct one and this means a lot of CPU used!

No one optimize the logic behind the code and the code itself! It is like: "If you use my software don't ask me to do better, do it yourself!"

Check memory consumption and time execution is really simply and isin't necessary to modify your source code!

Create a file called resource_check.php
--- CODE ---

function __securename__output_handler($output)
{
$output .= '

Memory Peak: ' . sprintf('%0.6f', memory_get_peak_usage() / 1024) . 'kb';
return $output;
}

ob_start(__securename__output_handler);

?>
--- CODE ---

and modify, or create, your htaccess adding this
--- CODE ---
php_value auto_prepend_file "/PATH/TO/resource_check.php"
--- CODE ---