Skip to main content

Posts

MVVM Architecture

MVVM:  Model–View-ViewModel talks of creating a new model (in addition to your domain model). This model normally adds additonal properties from the prespective of View (as we understand that View has controls in addition to data which it’s displaying). For instance if View had a property IsChecked and Presenter was setting in classic MVP, in MVVM Presenter will have that IsChecked Property which View will sync up with (doesn’t it look like Strategy pattern has been replaced with Observer?). So now a Presenter becomes more like a combo of – View Properties & Model properties which would be synchronized with View. So why not rename Presenter to ViewModel? Do that and you get MVVM. MVVM is attractive for platforms which support bi-directional binding with less effort. Also a minor tradeoff is ViewModel unlike Presenter can stand on its own (Presenter normally requires a View’s interface). 

Optimizing PHP

The more you understand the software you are using (Apache, PHP, IIS, your database) and the deeper your knowledge of the operating system, networking and server hardware, the better you can perform global optimizations on your code and your system. Try to use as much caching as possible, typically I would use this configuration: Squid -- PHP and memcache or file caching -- Database. For PHP scripts, the most expensive bottleneck is normally the CPU. If you are not getting out of memory messages, more CPUs are probably more useful than more RAM. Compile PHP with the "configure –-enable-inline-optimization" option to generate the fastest possible PHP executable. Tune your database and index the fields that are commonly used in your SQL WHERE criteria.  ADOdb , the very popular database abstraction library, provides a  SQL tuning mode , where you can view your invalid, expensive and suspicious SQL, their execution plans and in which PHP script the SQL was executed. Use...

The 7 Biggest and Boldest Time Management Lies We Tell Ourselves

“Time is really the only capital that any human being has, and the only thing he can’t afford to lose” – Thomas Edison . I f lately you have been feeling stressed out and overwhelmed with how much you have to do, if you believe that you can be more productive or learn to manage yourself and your time more efficiently, if you have an incredibly busy week ahead of you – take a few minutes to read about the 7 Biggest and Boldest Time management Lies that are the main cause of our stress, burn out, and procrastination. You might be surprised to catch yourself telling at least one of these lies before lunch time! 1. I Can Do It All! This is one of the most frequent lies I tell myself. And then some few hours later, I have to admit that I was wrong. There simply is not enough time to do everything we usually plan on doing. Nor is there the need to do all of it. Often we are the ones who willingly put too much on our plate and then stress out about it. So next time the thought...

Don’t underestimate the power of project planning

There are many articles on the worldwide web that claim to be the guide on how to plan your project. A simple and quick search on a term such as ‘project planning’ and a large number of hits will slap you in your face. A lot of those articles are similar to each other or just plain copies. The question I asked myself a while back, after participated in a bunch of projects myself, is: “If so much can be found on this subject (best practices, case studies) , why is it that it’s still so hard to make a decent project plan?” A key stage in project management Planning your project is all about getting the job done by planning each stage of a project before it happens, from your first ideas through to completion. This sounds simple and clear but most of the times it’s complex and blurry. In my opinion ‘planning your project’ is one of the key stages in project management next to picking your resources/team. Save yourself time, money and the trouble Project planning is easily ig...
sendmail: Introduction and Configuration Guide for those of you configuring your first e-mail server. With the growth of the Internet, e-mail has quickly become the main vehicle to spread information through the public at large. As the demand for fast, cheap and reliable e-mail grows, more individuals are turning to Linux to provide a fast, cheap and reliable solution. sendmail was originally developed by Eric Allman, in 1979, as "delevermail", which first shipped with BSD 4.0. This program was not very flexible and required configuration at compile time. With the growth of TCP protocol and other factors, it became obvious that delevermail was not flexible enough to handle these new demands. Eric Allman had to recreate sendmail from scratch, and what he produced has become the standard for MTAs. Rather than reject messa...

10 reasons to choose cakephp

I want to list all those things, but near to each of them I will give short explanation what is it and how CakePHP implement it. So, if somebody ask me what are those 10 things which drive me to choose this framework as my primary one I will answer with: MVC Pattern – Model support data handling, with model class you can insert, update, delete or read the data from the database. View support data rendering on the screen. Controller process and responds to events and can modify data before it interact with the model (database). With this pattern it’s very easy to separate the logic from the presentation, which is very useful for large applications and sites. How is in CakePHP? It is MVC Driven framework, so you cannot do much if you don’t use this pattern. I found it really handy once you start thinking MVC way. ORM – Object Relational Mapping is a programming technique for converting data between incompatible type systems in databases and object-oriented programming languages /sc...

Install PHP 5.3.0/Lighttpd On Debian (Lenny) With Imap, MySQL, Sqlite3 And ImageMagick Support

Install PHP 5.3.0/Lighttpd On Debian (Lenny) With Imap, MySQL, Sqlite3 And ImageMagick Support This tutorial covers the setup of PHP 5.3.0/Lighttpd on Debian (lenny) with imap, mysql, mysqli, sqlite3, ImageMagick and mycrypt support. For this tutorial I will assume you are logged in as root this is not advised. First we need to install the webserver: aptitude install lighttpd Now we install the packages needed for mysql and mysqli support. You will be promoted to enter a mysql root password - please use a strong password. aptitude install mysql-server mysql-client libmysqlclient15-dev Next install some packages php needs to compile. aptitude install libtidy-dev curl libcurl4-openssl-dev libcurl3 libcurl3-gnutls zlib1g zlib1g-dev libxslt1-dev libzip-dev libzip1 libxml2 libsnmp-base libsnmp15 libxml2-dev libsnmp-dev libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev zlib1g zlib1g-dev libfreetype6 libfreetype6-dev libbz2-dev libxpm-dev libmcrypt-dev libmcrypt4 sqlite3 bzip2 build-essential l...