Code faster with Unit Testing

Posted by on Feb 26, 2013 in Test Driven Development | No Comments
Code faster with Unit Testing

Wait a minute! How can you possibly code faster when in fact you have to write more code? Test Driven Development requires additional (redundant?!) classes which only duplicates work. The “redundant” code has to be maintained and kept in sync with the main software. It might be good for some big companies (preferably at the […]

Serial communication between Arduino and PHP with a protocol

Posted by on Feb 21, 2013 in Arduino, PHP Programming | 2 Comments
Serial communication between Arduino and PHP with a protocol

In my previous post I discussed basics of serial communication between Arduino and PHP. Theory behind it is very simple. It all comes down to writing to a file. Simplicity of the serial communication paradoxically might contribute to confusion and surprising results. Serial device is like a black hole when you think about it. You […]

Cache like a Pro with Memcached

Posted by on Feb 16, 2013 in Environment, PHP Programming | No Comments
Cache like a Pro with Memcached

Every application have a bottle neck. It might be a database query, request to an external service, hard drive I/O or an expensive algorithm. Even if the software is running smoothly it might be necessary to optimise in order to handle higher traffic. Significant part of optimisation is caching.

Benchmarking Amazon EC2 instance for a Web Server

Posted by on Feb 11, 2013 in Environment, Linux | 2 Comments
Benchmarking Amazon EC2 instance for a Web Server

For the last few days I’ve been testing Amazon web services (AWS). I’m looking for a reliable and scalable hosting provider to host Gloople e-commerce platform. Feature wise AWS is amazing. It offers literally everything an enterprise application might need. In fact, they offer so many services (and various configurations of those services) it might […]

Creating a Chat server in PHP with sockets, forks and pipes

Posted by on Feb 9, 2013 in Linux, PHP Programming | 2 Comments
Creating a Chat server in PHP with sockets, forks and pipes

In my previous post I showed how to create a multi process socket server in PHP with pcntl_fork. This time I’m going to extend this example and write a chat server. Chat is far more challenging because you not only have to handle simultaneous connections but also allow communications between processes. Inter process communication (IPC) […]

Multi threaded Socket Server in PHP with fork

Posted by on Feb 4, 2013 in Linux, PHP Programming | One Comment
Multi threaded Socket Server in PHP with fork

When you create your first socket server you will quickly realise that one thread is not enough. In a single thread architecture a server can’t handle more then one connection at the time. It’s undesired because in most cases there will be simultaneous connections.