<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Federico Cargnelutti</title>
	<atom:link href="http://blog.fedecarg.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fedecarg.com</link>
	<description>Simple is better than complex. Complex is better than complicated. &#124; @fedecarg</description>
	<lastBuildDate>Wed, 08 Jul 2009 09:59:16 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
		<url>http://www.gravatar.com/blavatar/92b6a280735bcc315d537f1f70767bf0?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Federico Cargnelutti</title>
		<link>http://blog.fedecarg.com</link>
	</image>
			<item>
		<title>Increase speed and reduce bandwidth usage with ZF and Apache</title>
		<link>http://blog.fedecarg.com/2009/07/06/increase-speed-and-reduce-bandwidth-usage-with-zf-and-apache/</link>
		<comments>http://blog.fedecarg.com/2009/07/06/increase-speed-and-reduce-bandwidth-usage-with-zf-and-apache/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 11:09:33 +0000</pubDate>
		<dc:creator>Federico</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open-source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.fedecarg.com/?p=1700</guid>
		<description><![CDATA[Apache&#8217;s mod_deflate module provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network.
There are two ways of enabling gzip compression:

Using Apache&#8217;s mod_deflate
Using PHP&#8217;s built-in functions

Encoding the output and setting the appropriate headers manually makes the code more portable. Keep in mind that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1700&subd=phpimpact&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Apache&#8217;s mod_deflate module provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network.</p>
<p>There are two ways of enabling gzip compression:</p>
<ol>
<li>Using Apache&#8217;s mod_deflate</li>
<li>Using PHP&#8217;s built-in functions</li>
</ol>
<p>Encoding the output and setting the appropriate headers manually makes the code more portable. Keep in mind that there are hundreds of Linux distributions, each slightly different to significantly different. To allow portability the application should not make assumptions about the OS or config involved.</p>
<h3>Using Apache</h3>
<p><strong>1. Enable mod_deflate</strong></p>
<p>Debian/Ubuntu:</p>
<pre>$ a2enmod deflate
$ /etc/init.d/apache2 force-reload</pre>
<p><strong>2. Configure mode_deflate</strong></p>
<pre>$ nano /etc/apache2/mods-enabled/deflate.conf

#
# mod_deflate configuration
#
&lt;IfModule mod_deflate.c&gt;
 AddOutputFilterByType DEFLATE text/plain
 AddOutputFilterByType DEFLATE text/html
 AddOutputFilterByType DEFLATE text/xml
 AddOutputFilterByType DEFLATE text/css
 AddOutputFilterByType DEFLATE application/xml
 AddOutputFilterByType DEFLATE application/xhtml+xml
 AddOutputFilterByType DEFLATE application/rss+xml
 AddOutputFilterByType DEFLATE application/javascript
 AddOutputFilterByType DEFLATE application/x-javascript

 DeflateCompressionLevel 9

 BrowserMatch ^Mozilla/4 gzip-only-text/html
 BrowserMatch ^Mozilla/4\.0[678] no-gzip
 BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

 DeflateFilterNote Input instream
 DeflateFilterNote Output outstream
 DeflateFilterNote Ratio ratio
&lt;/IfModule&gt;</pre>
<h3>Using PHP</h3>
<p><span>Create a gzip compressed string in </span>your bootstrap file:</p>
<pre>try {
    $frontController = Zend_Controller_Front::getInstance();
    if (@strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) {
        ob_start();
        $frontController-&gt;dispatch();
        $output = gzencode(ob_get_contents(), 9);
        ob_end_clean();
        header('Content-Encoding: gzip');
        echo $output;
    } else {
        $frontController-&gt;dispatch();
    }
} catch (Exeption $e) {
    if (Zend_Registry::isRegistered('Zend_Log')) {
        Zend_Registry::get('Zend_Log')-&gt;err($e-&gt;getMessage());
    }
    $message = $e-&gt;getMessage() . "\n\n" . $e-&gt;getTraceAsString();
    /* trigger event */
}</pre>
<h3>Reference</h3>
<p><a href="http://www.g-loaded.eu/2008/05/10/use-mod_deflate-to-compress-web-content-delivered-by-apache/" target="_blank">Use mod_deflate to compress Web content delivered by Apache</a></p>
Posted in Frameworks, Linux, Open-source, PHP, Programming  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpimpact.wordpress.com/1700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpimpact.wordpress.com/1700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpimpact.wordpress.com/1700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpimpact.wordpress.com/1700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpimpact.wordpress.com/1700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpimpact.wordpress.com/1700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpimpact.wordpress.com/1700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpimpact.wordpress.com/1700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpimpact.wordpress.com/1700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpimpact.wordpress.com/1700/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1700&subd=phpimpact&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.fedecarg.com/2009/07/06/increase-speed-and-reduce-bandwidth-usage-with-zf-and-apache/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b8d6b74fce406b08bb28806ce7377e61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">phpimpact</media:title>
		</media:content>
	</item>
		<item>
		<title>Towards Community Cloud Computing</title>
		<link>http://blog.fedecarg.com/2009/07/04/towards-community-cloud-computing/</link>
		<comments>http://blog.fedecarg.com/2009/07/04/towards-community-cloud-computing/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 19:43:06 +0000</pubDate>
		<dc:creator>Federico</dc:creator>
				<category><![CDATA[Software Architecture]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://blog.fedecarg.com/?p=1695</guid>
		<description><![CDATA[Cloud Computing is rising fast, with its data centers growing at an unprecedented rate. However, this has come with concerns of privacy, efficiency at the expense of resilience, and environmental sustainability, because of the dependence on Cloud vendors such as Google, Amazon, and Microsoft. Community Cloud Computing makes use of the principles of Digital Ecosystems [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1695&subd=phpimpact&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Cloud Computing is rising fast, with its data centers growing at an unprecedented rate. However, this has come with concerns of privacy, efficiency at the expense of resilience, and environmental sustainability, because of the dependence on Cloud vendors such as Google, Amazon, and Microsoft. Community Cloud Computing makes use of the principles of Digital Ecosystems to provide a paradigm for Clouds in the community, offering an alternative architecture for the use cases of Cloud Computing. It is more technically challenging to deal with issues of distributed computing, such as latency, differential resource management, and additional security requirements. However, these are not insurmountable challenges, and with the need to retain control over our digital lives and the potential environmental consequences, it is a challenge we must pursue.</p>
<p>Towards Community Cloud Computing (<a href="http://bit.ly/kY0Gu" target="_blank">Visit Site</a> | <a href="http://arxiv.org/pdf/0903.0694v2" target="_blank">Download PDF</a>)</p>
Posted in Software Architecture, Web Services  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpimpact.wordpress.com/1695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpimpact.wordpress.com/1695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpimpact.wordpress.com/1695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpimpact.wordpress.com/1695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpimpact.wordpress.com/1695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpimpact.wordpress.com/1695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpimpact.wordpress.com/1695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpimpact.wordpress.com/1695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpimpact.wordpress.com/1695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpimpact.wordpress.com/1695/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1695&subd=phpimpact&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.fedecarg.com/2009/07/04/towards-community-cloud-computing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b8d6b74fce406b08bb28806ce7377e61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">phpimpact</media:title>
		</media:content>
	</item>
		<item>
		<title>Format a time interval with the requested granularity</title>
		<link>http://blog.fedecarg.com/2009/06/25/format-a-time-interval-with-the-requested-granularity/</link>
		<comments>http://blog.fedecarg.com/2009/06/25/format-a-time-interval-with-the-requested-granularity/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 00:49:29 +0000</pubDate>
		<dc:creator>Federico</dc:creator>
				<category><![CDATA[Open-source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.fedecarg.com/?p=1691</guid>
		<description><![CDATA[This class, a refactored version of Drupal&#8217;s format_interval function, makes it relatively easy to format an interval value. The format will automatically format as compactly as possible. For example: if the difference between the two dates is only a few hours and both dates occur on the same day, the year, month, and day parts [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1691&subd=phpimpact&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This class, a refactored version of Drupal&#8217;s format_interval function, makes it relatively easy to format an interval value. The format will automatically format as compactly as possible. For example: if the difference between the two dates is only a few hours and both dates occur on the same day, the year, month, and day parts of the date will be omitted.</p>
<pre>class DateIntervalFormat
{
    /**
     * Format an interval value with the requested granularity.
     *
     * @param integer $timestamp The length of the interval in seconds.
     * @param integer $granularity How many different units to display in the string.
     * @return string A string representation of the interval.
     */
    public function getInterval($timestamp, $granularity = 2)
    {
        $seconds = time() - $timestamp;
        $units = array(
            '1 year|:count years' =&gt; 31536000,
            '1 week|:count weeks' =&gt; 604800,
            '1 day|:count days' =&gt; 86400,
            '1 hour|:count hours' =&gt; 3600,
            '1 min|:count min' =&gt; 60,
            '1 sec|:count sec' =&gt; 1);
        $output = '';
        foreach ($units as $key =&gt; $value) {
            $key = explode('|', $key);
            if ($seconds &gt;= $value) {
                $count = floor($seconds / $value);
                $output .= ($output ? ' ' : '');
                $output .= ($count == 1) ? $key[0] : str_replace(':count', $count, $key[1]);
                $seconds %= $value;
                $granularity--;
            }
            if ($granularity == 0) {
                break;
            }
        }

        return $output ? $output : '0 sec';
    }
}</pre>
<p>Usage:</p>
<pre>$dateFormat = new DateIntervalFormat();
$timestamp = strtotime('2009-06-21 20:46:11');
print sprintf('Submitted %s ago',  $dateFormat-&gt;getInterval($timestamp));</pre>
<p>Outputs:</p>
<pre>Submitted 3 days 4 hours ago</pre>
Posted in Open-source, PHP, Programming  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpimpact.wordpress.com/1691/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpimpact.wordpress.com/1691/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpimpact.wordpress.com/1691/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpimpact.wordpress.com/1691/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpimpact.wordpress.com/1691/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpimpact.wordpress.com/1691/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpimpact.wordpress.com/1691/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpimpact.wordpress.com/1691/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpimpact.wordpress.com/1691/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpimpact.wordpress.com/1691/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1691&subd=phpimpact&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.fedecarg.com/2009/06/25/format-a-time-interval-with-the-requested-granularity/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b8d6b74fce406b08bb28806ce7377e61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">phpimpact</media:title>
		</media:content>
	</item>
		<item>
		<title>Face Detection Using PHP</title>
		<link>http://blog.fedecarg.com/2009/06/24/face-detection-using-php/</link>
		<comments>http://blog.fedecarg.com/2009/06/24/face-detection-using-php/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:09:01 +0000</pubDate>
		<dc:creator>Federico</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.fedecarg.com/?p=1689</guid>
		<description><![CDATA[Maurice Svay explains how to detect faces in photos with PHP:
Nowadays, face detection is built in many consumer products (camera obviously, but also Google and iPhoto), and seems to be a pretty common job. So I expected to find many solutions for doing it with PHP. Surprisingly, the only one I could find is OpenCV, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1689&subd=phpimpact&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Maurice Svay explains how to detect faces in photos with PHP:</p>
<blockquote><p>Nowadays, face detection is built in many consumer products (camera obviously, but also Google and iPhoto), and seems to be a pretty common job. So I expected to find many solutions for doing it with PHP. Surprisingly, the only one I could find is <a href="http://opencv.willowgarage.com/wiki/">OpenCV</a>, an opensource lib that was originally developed by Intel. OpenCV seems to perform well but you need to be able to install it on your server. In my case, I wanted to have a pure PHP solution, so it can work with most hosts.</p></blockquote>
<p><a href="http://svay.com/blog/index/post/2009/06/19/Face-detection-in-pure-PHP-(without-OpenCV)" target="_blank">Face detection in pure PHP (without OpenCV)</a></p>
Posted in PHP  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpimpact.wordpress.com/1689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpimpact.wordpress.com/1689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpimpact.wordpress.com/1689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpimpact.wordpress.com/1689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpimpact.wordpress.com/1689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpimpact.wordpress.com/1689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpimpact.wordpress.com/1689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpimpact.wordpress.com/1689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpimpact.wordpress.com/1689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpimpact.wordpress.com/1689/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1689&subd=phpimpact&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.fedecarg.com/2009/06/24/face-detection-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b8d6b74fce406b08bb28806ce7377e61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">phpimpact</media:title>
		</media:content>
	</item>
		<item>
		<title>Apache HTTP DoS tool released</title>
		<link>http://blog.fedecarg.com/2009/06/22/apache-http-dos-tool-released/</link>
		<comments>http://blog.fedecarg.com/2009/06/22/apache-http-dos-tool-released/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 20:29:31 +0000</pubDate>
		<dc:creator>Federico</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.fedecarg.com/2009/06/22/1685/</guid>
		<description><![CDATA[Yesterday an interesting HTTP DoS tool has been released. The tool performs a Denial of Service attack on Apache (and some other, see below) servers by exhausting available connections. While there are a lot of DoS tools available today, this one is particularly interesting because it holds the connection open while sending incomplete HTTP requests [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1685&subd=phpimpact&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Yesterday an interesting HTTP DoS tool has been released. The tool performs a Denial of Service attack on Apache (and some other, see below) servers by exhausting available connections. While there are a lot of DoS tools available today, this one is particularly interesting because it holds the connection open while sending incomplete HTTP requests to the server.</p>
<p><a href="http://isc.sans.org/diary.html?storyid=6601" target="_blank">More info here</a></p>
Posted in Linux, Security, Tools  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpimpact.wordpress.com/1685/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpimpact.wordpress.com/1685/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpimpact.wordpress.com/1685/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpimpact.wordpress.com/1685/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpimpact.wordpress.com/1685/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpimpact.wordpress.com/1685/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpimpact.wordpress.com/1685/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpimpact.wordpress.com/1685/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpimpact.wordpress.com/1685/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpimpact.wordpress.com/1685/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1685&subd=phpimpact&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.fedecarg.com/2009/06/22/apache-http-dos-tool-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b8d6b74fce406b08bb28806ce7377e61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">phpimpact</media:title>
		</media:content>
	</item>
		<item>
		<title>Java, C, Python and nested loops</title>
		<link>http://blog.fedecarg.com/2009/06/16/java-c-python-and-nested-loops/</link>
		<comments>http://blog.fedecarg.com/2009/06/16/java-c-python-and-nested-loops/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 21:19:47 +0000</pubDate>
		<dc:creator>Federico</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://blog.fedecarg.com/?p=1670</guid>
		<description><![CDATA[Java has no goto statement, to break or continue multiple-nested loop or switch constructs, Java programmers place labels on loop and switch constructs, and then break out of or continue to the block named by the label. The following example shows how to use java break statement to terminate the labeled loop:
public class BreakLabel
{
  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1670&subd=phpimpact&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Java has no goto statement, to break or continue multiple-nested loop or switch constructs, Java programmers place labels on loop and switch constructs, and then break out of or continue to the block named by the label. The following example shows how to use java break statement to terminate the labeled loop:</p>
<pre>public class BreakLabel
{
    public static void main(String[] args)
    {
        int[][] array = new int[][]{{1,2,3,4},{10,20,30,40}};
        boolean found = false;
        System.out.println("Searching 30 in two dimensional int array");

        Outer:
        for (int intOuter = 0; intOuter &lt; array.length ; intOuter++) {
            Inner:
            for (int intInner = 0; intInner &lt; array[intOuter].length; intInner++) {
                if (array[intOuter][intInner] == 30) {
                    found = true;
                    break Outer;
                }
            }
        }

        if (found == true) {
            System.out.println("30 found in the array");
        } else {
            System.out.println("30 not found in the array");
        }
    }
}</pre>
<p>Use of labeled blocks in Java leads to considerable simplification in programming effort and a major reduction in maintenance.</p>
<p>On the other hand, the C continue statement can only continue the immediately enclosing block; to continue or exit outer blocks, programmers have traditionally either used auxiliary Boolean variables whose only purpose is to determine if the outer block is to be continued or exited; alternatively, programmers have misused the goto statement to exit out of nested blocks.</p>
<p>What&#8217;s interesting is that Python <a href="http://www.python.org/dev/peps/pep-3136/" target="_blank">rejected</a> the labeled break and continue proposal a while ago. And here&#8217;s why:</p>
<blockquote><p>Guido van Rossum wrote:</p>
<p>I&#8217;m rejecting it on the basis that code so complicated to require this feature is very rare. While I&#8217;m sure there are some (rare) real cases where clarity of the code would suffer from a refactoring that makes it possible to use return, this is offset by two issues:</p>
<p>1. The complexity added to the language, permanently.</p>
<p>2. My expectation that the feature will be abused more than it will be used right, leading to a net decrease in code clarity (measured across all Python code written henceforth). Lazy programmers are everywhere, and before you know it you have an incredible mess on your hands of unintelligible code.</p></blockquote>
<p>But what&#8217;s more interesting is that the idea of adding a goto statement was never ever mentioned.</p>
<p>Common sense perhaps?</p>
Posted in Java, Programming, Python, Software Architecture  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpimpact.wordpress.com/1670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpimpact.wordpress.com/1670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpimpact.wordpress.com/1670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpimpact.wordpress.com/1670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpimpact.wordpress.com/1670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpimpact.wordpress.com/1670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpimpact.wordpress.com/1670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpimpact.wordpress.com/1670/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpimpact.wordpress.com/1670/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpimpact.wordpress.com/1670/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1670&subd=phpimpact&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.fedecarg.com/2009/06/16/java-c-python-and-nested-loops/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b8d6b74fce406b08bb28806ce7377e61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">phpimpact</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Page Speed: Web Performance Best Practices</title>
		<link>http://blog.fedecarg.com/2009/06/08/google-page-speed-web-performance-best-practices/</link>
		<comments>http://blog.fedecarg.com/2009/06/08/google-page-speed-web-performance-best-practices/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 21:40:55 +0000</pubDate>
		<dc:creator>Federico</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.fedecarg.com/?p=1666</guid>
		<description><![CDATA[When you profile a web page with Page Speed, it evaluates the page&#8217;s conformance to a number of different rules. These rules are general front-end best practices you can apply at any stage of web development. Google provides documentation of each of the rules, so whether or not you run the Page Speed tool, you can refer [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1666&subd=phpimpact&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When you profile a web page with <a href="http://code.google.com/intl/fi-FI/speed/page-speed/docs/rules_intro.html" target="_blank">Page Speed</a>, it evaluates the page&#8217;s conformance to a number of different rules. These rules are general front-end best practices you can apply at any stage of web development. Google provides documentation of each of the rules, so whether or not you run the Page Speed tool, you can refer to these pages at any time.</p>
<p>The best practices are grouped into five categories that cover different aspects of page load optimization:</p>
<ul>
<li> <strong>Optimizing caching</strong>: Keeping your application&#8217;s data and logic off the network altogether</li>
<li><strong>Minimizing round-trip times</strong>: Reducing the number of serial request-response cycles</li>
<li><strong>Minimizing request size</strong>: Reducing upload size</li>
<li><strong>Minimizing payload size</strong>: Reducing the size of responses, downloads, and cached pages</li>
<li><strong>Optimizing browser rendering</strong>: Improving the browser&#8217;s layout of a page</li>
</ul>
<p><a href="http://code.google.com/intl/fi-FI/speed/page-speed/docs/rules_intro.html" target="_blank">Web Performance Best Practices</a></p>
Posted in Programming, Tools  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpimpact.wordpress.com/1666/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpimpact.wordpress.com/1666/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpimpact.wordpress.com/1666/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpimpact.wordpress.com/1666/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpimpact.wordpress.com/1666/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpimpact.wordpress.com/1666/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpimpact.wordpress.com/1666/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpimpact.wordpress.com/1666/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpimpact.wordpress.com/1666/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpimpact.wordpress.com/1666/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1666&subd=phpimpact&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.fedecarg.com/2009/06/08/google-page-speed-web-performance-best-practices/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b8d6b74fce406b08bb28806ce7377e61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">phpimpact</media:title>
		</media:content>
	</item>
		<item>
		<title>The Cost of Hosting on Amazon</title>
		<link>http://blog.fedecarg.com/2009/06/07/the-cost-of-hosting-on-amazon/</link>
		<comments>http://blog.fedecarg.com/2009/06/07/the-cost-of-hosting-on-amazon/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 11:58:15 +0000</pubDate>
		<dc:creator>Federico</dc:creator>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Software Architecture]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://blog.fedecarg.com/?p=1662</guid>
		<description><![CDATA[Mather Corgan, president of HotPads, gave a great talk on how HotPads uses AWS to run their real estate search engine. HotPads abandoned their managed hosting in December and took the leap over to EC2 and its siblings. The presentation has a lot of detail on costs and other things to watch out for, so [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1662&subd=phpimpact&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Mather Corgan, president of HotPads, gave a great talk on how HotPads uses AWS to run their real estate search engine. HotPads abandoned their managed hosting in December and took the leap over to EC2 and its siblings. The presentation has a lot of detail on costs and other things to watch out for, so if you&#8217;re currently planning your &#8220;cloud&#8221; architecture, you&#8217;ll find some of this really helpful.</p>
<p><a href="http://bit.ly/JhxR3" target="_blank">HotPads on AWS</a></p>
Posted in Deployment, Software Architecture, Web Services  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpimpact.wordpress.com/1662/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpimpact.wordpress.com/1662/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpimpact.wordpress.com/1662/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpimpact.wordpress.com/1662/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpimpact.wordpress.com/1662/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpimpact.wordpress.com/1662/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpimpact.wordpress.com/1662/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpimpact.wordpress.com/1662/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpimpact.wordpress.com/1662/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpimpact.wordpress.com/1662/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1662&subd=phpimpact&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.fedecarg.com/2009/06/07/the-cost-of-hosting-on-amazon/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b8d6b74fce406b08bb28806ce7377e61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">phpimpact</media:title>
		</media:content>
	</item>
		<item>
		<title>TypeFriendly: A Documentation And User Manual Builder</title>
		<link>http://blog.fedecarg.com/2009/05/16/typefriendly-a-documentation-and-user-manual-builder/</link>
		<comments>http://blog.fedecarg.com/2009/05/16/typefriendly-a-documentation-and-user-manual-builder/#comments</comments>
		<pubDate>Sat, 16 May 2009 11:30:23 +0000</pubDate>
		<dc:creator>Federico</dc:creator>
				<category><![CDATA[Open-source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://blog.fedecarg.com/?p=1655</guid>
		<description><![CDATA[TypeFriendly is a documentation generation script written in PHP5. It was designed to be easy in use and it allows to achieve the first results immediately, a couple of minutes after you start the work. The script contains everything you need to write clear, multilingual documentation for your project, so that you do not have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1655&subd=phpimpact&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.invenzzia.org/en/projects/typefriendly" target="_blank">TypeFriendly</a> is a documentation generation script written in PHP5. It was designed to be easy in use and it allows to achieve the first results immediately, a couple of minutes after you start the work. The script contains everything you need to write clear, multilingual documentation for your project, so that you do not have to code everything on your own.</p>
<p>The most important features of TypeFriendly:</p>
<ol>
<li>Modular documentation structure &#8211; it is generated from text files and the structure and navigation are generated from the file names.</li>
<li>Simple syntax &#8211; the text is written in intuitive and clean Markdown syntax.</li>
<li>Multilingual support and tools &#8211; TypeFriendly allows you to create your manuals in many language versions. It also contains a tool that shows whether the derived languages are up-to-date.</li>
<li>Configurable output formats &#8211; currently, TypeFriendly is able to generate the documentation in XHTML (many pages) and XHTML (single page). There is also a third format &#8211; metadata &#8211; still under development. It will allow to import the docs to a database in order to make an on-line version with, for example, user comments.</li>
<li>Various add-ons such as syntax highlighting, references, class description fields.</li>
<li>Navigation generators.</li>
<li>It is portable &#8211; works under Linux, FreeBSD and Windows. All you need is the PHP interpreter available.</li>
</ol>
<p>TypeFriendly is distributed under the terms of GNU General Public License 3, which means that you can use, modify and share it for free.</p>
<p><strong>Demo</strong><br />
<a href="http://static.invenzzia.org/docs/tf/0_1/book/en/index.html" target="_blank">http://static.invenzzia.org/docs/tf/0_1/book/en/index.html</a></p>
<p><strong>Screenshots</strong><a href="http://www.invenzzia.org/en/projects/typefriendly/screenshots" target="_blank"><br />
http://www.invenzzia.org/en/projects/typefriendly/screenshots</a></p>
<p><strong>Source Code</strong><br />
<a href="http://svn.invenzzia.org/browser/TypeFriendly/trunk/" target="_blank">http://svn.invenzzia.org/browser/TypeFriendly/trunk/</a></p>
<p><strong>Website</strong><br />
<a href="http://www.invenzzia.org/en/projects/typefriendly" target="_blank">http://www.invenzzia.org/en/projects/typefriendly</a></p>
Posted in Open-source, PHP, Tools, Web Apps  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpimpact.wordpress.com/1655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpimpact.wordpress.com/1655/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpimpact.wordpress.com/1655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpimpact.wordpress.com/1655/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpimpact.wordpress.com/1655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpimpact.wordpress.com/1655/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpimpact.wordpress.com/1655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpimpact.wordpress.com/1655/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpimpact.wordpress.com/1655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpimpact.wordpress.com/1655/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1655&subd=phpimpact&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.fedecarg.com/2009/05/16/typefriendly-a-documentation-and-user-manual-builder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b8d6b74fce406b08bb28806ce7377e61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">phpimpact</media:title>
		</media:content>
	</item>
		<item>
		<title>The Little Manual of API Design</title>
		<link>http://blog.fedecarg.com/2009/05/13/the-little-manual-of-api-design/</link>
		<comments>http://blog.fedecarg.com/2009/05/13/the-little-manual-of-api-design/#comments</comments>
		<pubDate>Wed, 13 May 2009 20:21:33 +0000</pubDate>
		<dc:creator>Federico</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software Architecture]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://blog.fedecarg.com/?p=1653</guid>
		<description><![CDATA[This manual gathers together the key insights into API design that were discovered through many years of software development on the Qt application development framework at Trolltech (now part of Nokia). When designing and implementing a library, you should also keep other factors in mind, such as efficiency and ease of implementation, in addition to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1653&subd=phpimpact&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This manual gathers together the key insights into API design that were discovered through many years of software development on the Qt application development framework at Trolltech (now part of Nokia). When designing and implementing a library, you should also keep other factors in mind, such as efficiency and ease of implementation, in addition to pure API considerations. And although the focus is on public APIs, there is no harm in applying the principles described here when writing application code or internal library code.</p>
<p><a href="http://chaos.troll.no/~shausman/api-design/api-design.pdf" target="_blank">The Little Manual of API Design (PDF)</a></p>
Posted in Design Patterns, Programming, Software Architecture, Web Services  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpimpact.wordpress.com/1653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpimpact.wordpress.com/1653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpimpact.wordpress.com/1653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpimpact.wordpress.com/1653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpimpact.wordpress.com/1653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpimpact.wordpress.com/1653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpimpact.wordpress.com/1653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpimpact.wordpress.com/1653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpimpact.wordpress.com/1653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpimpact.wordpress.com/1653/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fedecarg.com&blog=920807&post=1653&subd=phpimpact&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.fedecarg.com/2009/05/13/the-little-manual-of-api-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b8d6b74fce406b08bb28806ce7377e61?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">phpimpact</media:title>
		</media:content>
	</item>
	</channel>
</rss>