Enable your Zend Framework App with Conditional GET!

Enable your Zend Framework App with Conditional GET!

A short article describing how to add support for conditional GET to your Zend Framework project in under 5 minutes. Something that will improve your performance and reduces the load on the server.

Disable Skype’s auto-changing of microphone volume

Disable Skype’s auto-changing of microphone volume

Skype always irritated me with its automatic microphone volume changes. The Windows version has the ability to disable this option in the preferences pane, but the Mac version does not. Today, I spent some time trying to solve this problem. After some searching on net, I found a solution for the Windows version which also works on the Mac.


Storing Hierarchical Data in a Database

Storing Hierarchical Data in a Database

Whether you want to build your own forum, publish the messages from a mailing list on your Website, or write your own cms: there will be a moment that you'll want to store hierarchical data in a database. And, unless you're using a XML-like database, tables aren't hierarchical; they're just a flat list. You'll have to find a way to translate the hierarchy in a flat file.

Storing trees is a common problem, with multiple solutions. There are two major approaches: the adjacency list model, and the modified preorder tree traversal algorithm.

In this article, we'll explore these two methods of saving hierarchical data.


In the Woods – Vertical Centering With CSS

In the Woods – Vertical Centering With CSS

There are a few different ways to vertically centre objects with CSS, but it can be difficult to choose the right one. I’ll show you all the best ways I’ve seen and also how to create a nice little centered website.
Vertical centering with CSS isn’t an easy thing to do. There are many different ways that may not work in some browsers. Let’s review 5 different ways to vertically centering objects, as well as the pros and cons of each method. (You can see my test page briefly explaining all of them.)


Method chaining with PHP 5

Since the introduction of PHP 5 and it’s better OO capabilities it is possible to use method chaining. In most modern frameworks, like Zend Framework‘s Zend_Mail for example, it’s widely used.

An example of method chaining from the Zend Framework documentation for the Zend_Mail component looks like this:

$mail = new Zend_Mail();
$mail->setBodyText('This is the content of the mail.')
     ->setFrom('somebody@example.com', 'Some Sender')
     ->addTo('somebody_else@example.com', 'Some Recipient')
     ->setSubject('My own subject')
     ->send();

The code above can also be written like below, without method chaining:

$mail = new Zend_Mail();
$mail->setBodyText('This is the content of the mail.');
$mail->setFrom('somebody@example.com', 'Some Sender');
$mail->addTo('somebody_else@example.com', 'Some Recipient');
$mail->setSubject('My own subject');
$mail->send();

It depends on your likings of which method you want to use, but you can extend your methods with the chaining way without harming the traditional way so in the end the programmer can decide the method he desires. If you want to make the methods ready for it the method simply needs to return the object itself, like so:

public function foo() {
    // ... do something here ...
    return $this;
}

I’ve highlighted line 3 where the magic applies. If you had foo(), bar(), baz() and bat() methods you could then do this:

$myClass->foo()->bar()->baz()->bat();

You may not want or need to do this in any of your code, but the possibility is there if you or any colleague wants to.


Font Generator – Make Your Own Handwriting Font With Your Fonts

Font Generator – Make Your Own Handwriting Font With Your Fonts

Convert your handwriting to a font in 7 easy steps, the only things you need are a printer, pen and a scanner. Upload the scanned pages and recieve your digitized handwriting for usage in most common programs!


Copyright © 1996-2010 Re:morse.nl. All rights reserved.
iDream theme by Templates Next | Powered by WordPress