<?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/"
	>

<channel>
	<title>Zen</title>
	<atom:link href="http://zefonseca.com/blogs/zen/feed/" rel="self" type="application/rss+xml" />
	<link>http://zefonseca.com/blogs/zen</link>
	<description></description>
	<lastBuildDate>Thu, 15 Dec 2011 11:53:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Guns &#8216;n SOPA</title>
		<link>http://zefonseca.com/blogs/zen/guns-n-sopa/</link>
		<comments>http://zefonseca.com/blogs/zen/guns-n-sopa/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 11:50:04 +0000</pubDate>
		<dc:creator>Zen</dc:creator>
				<category><![CDATA[The Web]]></category>

		<guid isPermaLink="false">http://zefonseca.com/blogs/zen/?p=581</guid>
		<description><![CDATA[SOPA is based on the absurd principle that sites shall be co-responsible for criminal acts committed by their members. It turns web sites into accomplices for copyright violations perpetrated by people the site owners have never met. It is a confession of defeat by authorities &#8211; they are unable to enforce copyright law in the [...]]]></description>
			<content:encoded><![CDATA[<p>SOPA is based on the absurd principle that sites shall be co-responsible for criminal acts committed by their members. It turns web sites into accomplices for copyright violations perpetrated by people the site owners have never met. It is a confession of defeat by authorities &#8211; they are unable to enforce copyright law in the new reality of 2011, thus they will remove everybody&#8217;s rights online because of their particular failure.</p>
<p>Let&#8217;s draw a parallel here. Blaming Reddit, Youtube and even Wikipedia for any eventual copyrighted content submitted by their users is akin to blaming gun makers for homicides committed using their product.  You will not, in our lifetimes, see the gun makers be criminally convicted for murders committed using their product. It&#8217;s been tried, and it&#8217;s always been a lost cause. Civil lawsuits have been won, damages have been granted for violent gun-related crimes, but a criminal conviction has never been attained, precisely because you can&#8217;t be criminally responsible for crime you didn&#8217;t commit(or actively participate in, in some way).</p>
<p>Why should SOPA, then, convict websites like Wikipedia of a felony if anyone is able to submit copyrighted content to them? It is obvious that if SOPA is passed, it may be used against websites by the very copyright holders. Copyright owners, <a href="http://torrentfreak.com/how-to-find-fake-torrents-uploaded-by-the-mpaa-and-riaa/">who have been known for spreading their own content</a> as a &#8220;honey pot&#8221; in order to implicate downloaders, could easily sabotage sites like Wikipedia by submitting their own content, taking screenshots filing lawsuits for copyright infringement.</p>
<p>SOPA has the potential to create a sea of lawsuits, by everyone against everyone. Just upload your copyrighted work and file a criminal complaint any given site. This old trick has been used against me in the past, by a photographer. </p>
<p>One website I worked on was sued by a photographer who claimed one of his photos was used without authorization. We checked and the photo had been uploaded just days before the lawsuit was filed&#8230;it is unlikely this photographer found this photo casually on the internet. Most likely, we were the victims of that very photographer. We checked and this person had over 300 identical lawsuits against sites which allowed the upload of photos. Basically, this photographer was making a living by submitting his photos and then filing lawsuits. As of this time, we&#8217;re still defending ourselves against his accusations. Now, imagine if SOPA were in effect here, we&#8217;d be criminally responsible, along with 300 others, for a crime we didn&#8217;t commit.</p>
<p>SOPA has the potential of destroying the collaborative nature of the Internet and it must be stopped. Do your part!</p>
]]></content:encoded>
			<wfw:commentRss>http://zefonseca.com/blogs/zen/guns-n-sopa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google, the scraper?</title>
		<link>http://zefonseca.com/blogs/zen/google-the-scraper/</link>
		<comments>http://zefonseca.com/blogs/zen/google-the-scraper/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 00:41:41 +0000</pubDate>
		<dc:creator>Zen</dc:creator>
				<category><![CDATA[The Web]]></category>

		<guid isPermaLink="false">http://zefonseca.com/blogs/zen/?p=575</guid>
		<description><![CDATA[Google penalizes any site which copies content from another with the intent of taking the original author&#8217;s traffic. I wonder if they have a special deal with some sites in order to present their content on Google&#8217;s search results directly? Here&#8217;s a simple example. I&#8217;ll ask Google to define what monopoly means. I take the [...]]]></description>
			<content:encoded><![CDATA[<p>Google penalizes any site which copies content from another with the intent of taking the original author&#8217;s traffic. I wonder if they have a special deal with some sites in order to present their content on Google&#8217;s search results directly?</p>
<p>Here&#8217;s a simple example. I&#8217;ll ask Google to define what monopoly means.<br />
<img src="http://zefonseca.com/blogs/zen/wp-content/uploads/2011/11/monopoly_google.png" alt="" title="monopoly_google" width="508" class="alignnone size-full wp-image-576" /></p>
<p>I take the definition and search for it in quotes, on Google itself. Which gives me the following result:<br />
<img src="http://zefonseca.com/blogs/zen/wp-content/uploads/2011/11/oxford_monopoly.png" alt="" title="oxford_monopoly" width="526" height="310" class="alignnone size-full wp-image-577" /></p>
<p>The definition which Google showed on its search result is exactly the same provided by the Oxford Dictionary. But the user never reached the source of the original definition of &#8220;monopoly&#8221;, never registered for that site&#8217;s services, never even saw the logo of Oxford. </p>
<p>I wonder if dictionary sources are getting some compensation for allowing this? </p>
]]></content:encoded>
			<wfw:commentRss>http://zefonseca.com/blogs/zen/google-the-scraper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gmail shows incomplete Twitter messages</title>
		<link>http://zefonseca.com/blogs/zen/gmail-shows-incomplete-twitter-messages/</link>
		<comments>http://zefonseca.com/blogs/zen/gmail-shows-incomplete-twitter-messages/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 15:26:28 +0000</pubDate>
		<dc:creator>Zen</dc:creator>
				<category><![CDATA[The Web]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://zefonseca.com/blogs/zen/?p=566</guid>
		<description><![CDATA[If, by any chance, you decide to reset your Twitter password and you receive the message via Gmail, you&#8217;ll find that it&#8217;s currently impossible to procede because only a part of the message is displayed. The solution is to &#8220;View Original Message&#8221; on the drop-down menu located at the top-right hand corner of Gmail messages. [...]]]></description>
			<content:encoded><![CDATA[<p>If, by any chance, you decide to reset your Twitter password and you receive the message via Gmail, you&#8217;ll find that it&#8217;s currently impossible to procede because only a part of the message is displayed.</p>
<p><img src="http://zefonseca.com/blogs/zen/wp-content/uploads/2011/09/twitter-reset-pwd-gmail.png" alt="" title="Twitter reset password on Gmail message" width="579" height="259" class="alignnone size-full wp-image-567" /></p>
<p>The solution is to &#8220;View Original Message&#8221; on the drop-down menu located at the top-right hand corner of Gmail messages. There you&#8217;ll find the link, you should copy and paste it into a new browser tab.</p>
]]></content:encoded>
			<wfw:commentRss>http://zefonseca.com/blogs/zen/gmail-shows-incomplete-twitter-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solving the &#8220;Software caused connection abort&#8221; mod_cache problem</title>
		<link>http://zefonseca.com/blogs/zen/mod_cache-problem/</link>
		<comments>http://zefonseca.com/blogs/zen/mod_cache-problem/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 00:51:14 +0000</pubDate>
		<dc:creator>Zen</dc:creator>
				<category><![CDATA[Linux/UNIX]]></category>

		<guid isPermaLink="false">http://zefonseca.com/blogs/zen/?p=547</guid>
		<description><![CDATA[In the first days of August I was in charge of setting up a new Apache server for a medium traffic site. The backend was a rather large system that had finally passed all tests on the x86 64 bit platform. We&#8217;d finally be leaving 32 bits behind. After a few pleasant hours of the [...]]]></description>
			<content:encoded><![CDATA[<p>In the first days of August I was in charge of setting up a new Apache server for a medium traffic site. The backend was a rather large system that had finally passed all tests on the x86 64 bit platform. We&#8217;d finally be leaving 32 bits behind.</p>
<p>After a few pleasant hours of the usual custom compilations, package upgrades and pre-requisites checking, the migration was finally done. To our surprise, all went perfectly &#8211; not a single glitch. </p>
<p>Comparing to some of my past experiences, it&#8217;d be surreal to imagine such a successful migration a few years ago, with zero complaints or technical issues. </p>
<p>Peace lasted very little, as expected: several hours after the launch, Apache had started randomly returning blank pages and producing 500 Server Errors. </p>
<p>The only clue I had was this error_log entry, repeated thousands of times:<br />
<code><br />
(103)Software caused connection abort: cache: error returned while trying to return disk cached data<br />
</code></p>
<p>So mod_cache was ruining our sleep.</p>
<h3>What didn&#8217;t work</h3>
<p>Since you&#8217;ve likely Googled or Binged the problem and read all the suggestions in mailing lists and forums, here are some steps I tried and still didn&#8217;t work: </p>
<ul>
<li>Disabled SELinux &#8211; no luck.  (Who knows, in previous lives I had issues with Apache serving and SELinux.) </li>
<li>Changed mounted disks for the cache data &#8211; no luck. (Maybe we had a bad filesystem, who knows.)</li>
<li>I thought it could be related to the <a href="http://aws.amazon.com/ebs/">Amazon EBS</a> virtual drive latency, so I used the instance RAM memory for the cache directory(<a href="http://www.cyberciti.biz/tips/what-is-devshm-and-its-practical-usage.html">using tmpfs</a>) &#8211; no luck.</li>
<li>Tried reducing the CacheDirLevels and CacheDirLength to one. Nope&#8230;wait 15 minutes or so, and the errors returned.</li>
<li>Set htcacheclean to clean up after 30 minutes, allowing only 250MBytes of cache data. (/usr/sbin/htcacheclean -p /var/cache/apache/ -l250M -d30). No luck &#8211; the errors still appeared, seemingly randomly.</li>
</ul>
<p>There was apparently no specific file type that triggered the error. PHP scripts, Perl programs, WordPress, MediaWiki and our in-house systems &#8211; all equally affected.</p>
<p><em>Note that each time the Cache settings were changed, we started with a fresh cache directory(/var/cache/apache1,apache2,apache3 &#8230; apacheN). Once we found a solution, we went back to /var/cache/apache &#8211; cleaning it up before.</em></p>
<p>After reading a dozen or so related complaints in mailing lists and having unsuccessfully tried their recommendations I figured it was time to access the Apache documentation and see what directives we could tweak that could help us.</p>
<p><a href="http://httpd.apache.org/docs/2.2/mod/mod_disk_cache.html">mod_disk_cache</a> gives us 5 configuration options only: CacheDirLength, CacheDirLevels, CacheMaxFileSize, CacheMinFileSize and CacheRoot.  Click <a href="http://httpd.apache.org/docs/2.2/mod/mod_disk_cache.html">here</a> for a detailed explanation of each. After testing several combinations of these directives, and starting with a fresh cache directory, the error would return after a few thousand(or so) requests. Debugging this issue is specially hard because the problem doesn&#8217;t happen as soon as the Apache server is started &#8211; it takes a while to replicate and test.</p>
<h3>The Solution</h3>
<p>This combination of CacheMaxFileSize and CacheDisable for the images directory.<br />
<code><br />
CacheMaxFileSize 64000<br />
CacheDisable /images<br />
</code></p>
<p>Limiting the cached files to 64KB and making sure the /images directory was not being cached solved the problem. It&#8217;s been a week now and we had zero of the dreaded &#8220;Software caused connection abort&#8221; error 103 messages. Having to block the images directory came as a shock to us, because none of the errors we examined were triggered by serving an image. It seemed random and happened for html files, PHP and Perl scripts and so forth.</p>
<p>So what&#8217;s the cause? I have no idea. Folks wanted the site back up and running, so we had zero time left for long debugging sessions. It&#8217;s something which only happened after a few minutes. The reason it took the initial install more time to present the problem was because we performed the main migration on a late sunday night, when traffic was considerably lower. </p>
<h3>Additional Info</h3>
<p><code><br />
#httpd -l<br />
Compiled in modules:<br />
  core.c<br />
  prefork.c<br />
  http_core.c<br />
  mod_so.c</p>
<p># httpd -v<br />
Server version: Apache/2.2.15 (Unix)<br />
Server built:   Apr  9 2011 08:58:28</p>
<p># uname -a<br />
Linux hostname_here 2.6.32-131.4.1.el6.x86_64 #1 SMP Fri Jun 10 10:54:26 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux</p>
<p># Cache-related directives on httpd.conf:<br />
CacheRoot   /var/cache/apache/<br />
CacheEnable disk /<br />
<strong>CacheMaxFileSize 64000</strong><br />
CacheDirLevels 1<br />
CacheDirLength 1<br />
<strong>CacheDisable /images</strong><br />
CacheDefaultExpire 176400<br />
CacheIgnoreHeaders Set-Cookie<br />
CacheIgnoreNoLastMod On<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://zefonseca.com/blogs/zen/mod_cache-problem/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quieting &#8216;DBIx::Class::ResultSet::next(): Prefetching multiple has_many rels&#8217; messages</title>
		<link>http://zefonseca.com/blogs/zen/quiet-dbix-class/</link>
		<comments>http://zefonseca.com/blogs/zen/quiet-dbix-class/#comments</comments>
		<pubDate>Sun, 07 Aug 2011 01:24:16 +0000</pubDate>
		<dc:creator>Zen</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://zefonseca.com/blogs/zen/?p=543</guid>
		<description><![CDATA[The error_log for my DBIx::Class based sites were absolutely packed with warnings about n to n relationships getting out of hand, such as this line: [Sat Aug 06 21:09:02 2011] [warn] [1144]ERR: 32: Warning in Perl code: DBIx::Class::ResultSet::next(): Prefetching multiple has_many rels addresses and addresses at the same level (person) will explode the number of [...]]]></description>
			<content:encoded><![CDATA[<p>The error_log for my DBIx::Class based sites were absolutely packed with warnings about n to n relationships getting out of hand, such as this line:<br />
<code><br />
[Sat Aug 06 21:09:02 2011] [warn] [1144]ERR:  32:  Warning in Perl code: DBIx::Class::ResultSet::next(): Prefetching multiple has_many rels addresses and addresses at the same level (person) will explode the number of row objects retrievable via ->next or ->all. Use at your own risk. at /chili/beans/Lib/Process.pm line 38<br />
</code></p>
<p>I&#8217;m aware of the dangers of a badly implemented ORM schema and I took care to add enough constraints to my query so that next() won&#8217;t blow up my memory space. And I never use all() &#8230; at all().</p>
<p>So I searched for options on how to quiet these messages, because in a heavy traffic site these log files reach gigabytes every day. Plus, logging all that stuff surely slows the site down. Here&#8217;s how I solved it. If you came here looking for an elegant solution, please hit Back now.</p>
<p><code><br />
# cd /usr/local/share/perl5/DBIx/Class<br />
# vi ResultSource.pm<br />
:/Prefetching # this will search for the first occurrence of the word Prefetching<br />
        #carp (<br />
        #  "Prefetching multiple has_many rels ${last} and ${pre} "<br />
        #  .(length($as_prefix)<br />
        #    ? "at the same level (${as_prefix}) "<br />
        #    : "at top level "<br />
        #  )<br />
        #  . 'will explode the number of row objects retrievable via ->next or ->all. '<br />
        #  . 'Use at your own risk.'<br />
        #);<br />
</code></p>
<p>Comment out the multiline carp() call, and Bob&#8217;s your uncle. A clean error_log from now on.</p>
]]></content:encoded>
			<wfw:commentRss>http://zefonseca.com/blogs/zen/quiet-dbix-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Increasing MySQL login and network timeouts for EC2 instances</title>
		<link>http://zefonseca.com/blogs/zen/mysql-ec2-timeout/</link>
		<comments>http://zefonseca.com/blogs/zen/mysql-ec2-timeout/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 17:31:39 +0000</pubDate>
		<dc:creator>Zen</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://zefonseca.com/blogs/zen/?p=538</guid>
		<description><![CDATA[For quite a few days now I&#8217;d been getting 500 Server Errors on my main Apache server, which is an EC2 instance at Amazon Web Services. The traffic on some of the sites is quite respectable, so i was definitely not a &#8220;morning bug&#8221; issue. The messages I was receiving varied, and the error seemed [...]]]></description>
			<content:encoded><![CDATA[<p>For quite a few days now I&#8217;d been getting 500 Server Errors on my main Apache server, which is an EC2 instance at Amazon Web Services. </p>
<p>The traffic on some of the sites is quite respectable, so i was definitely not a &#8220;<a href="http://modperlbook.org/html/20-1-5-5-The-morning-bug.html">morning bug</a>&#8221; issue.</p>
<p>The messages I was receiving varied, and the error seemed random &#8211; it wasn&#8217;t the first connection, it wasn&#8217;t a last, not related to long queries, not related to a certain section of the web site and so on. Worst kind of problem to debug.</p>
<p>Some of the messages I received included:<br />
<code><br />
DBI Connection failed<br />
or<br />
Can't connect to MySQL server on [...]<br />
or<br />
DBI Connection failed: Lost connection to MySQL server at 'reading authorization packet', system error: 0 at [...]<br />
</code></p>
<p>Further testing led me to several MySQL bug reports, some of which were legitimate. Others were just support requests disguised as bugs.</p>
<p>It turns out sometimes the network latency of EC2 instances can get quite high. I&#8217;d heard such comments before, but never had any issues.</p>
<p>Raising connect_timeout from the default of 5 seconds to 30 solved the &#8216;connection failed&#8217; problem. Raising the net_read_timeout solved the &#8216;Lost connection&#8217; issue. All three problems were related to network latency.</p>
<p>Added to my MySQL server&#8217;s /etc/my.cnf [mysqld] section:<br />
<code><br />
connect_timeout=30<br />
net_read_timeout=45<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://zefonseca.com/blogs/zen/mysql-ec2-timeout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The timthumb.php vulnerability</title>
		<link>http://zefonseca.com/blogs/zen/the-timthumb-php-vulnerability/</link>
		<comments>http://zefonseca.com/blogs/zen/the-timthumb-php-vulnerability/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 23:52:39 +0000</pubDate>
		<dc:creator>Zen</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://zefonseca.com/blogs/zen/?p=531</guid>
		<description><![CDATA[If your website, like the one you&#8217;re reading now, has timthumb.php anywhere on one of its themes, you should be aware of a zero day remote exploit uncovered just hours ago. Update: download the fixed version here. The discussion is happening over at the timthumb.php development site. If you don&#8217;t absolutely need to use external [...]]]></description>
			<content:encoded><![CDATA[<p>If your website, like the one you&#8217;re reading now, has timthumb.php anywhere on one of its themes, you should be aware of a zero day remote exploit uncovered just hours ago.</p>
<p><strong><a href="http://timthumb.googlecode.com/svn/trunk/timthumb.php">Update: download the fixed version here.</a></strong></p>
<p><a href="http://code.google.com/p/timthumb/issues/detail?id=212#c18">The discussion is happening over at the timthumb.php development site.</a></p>
<p>If you don&#8217;t absolutely need to use external images on your site thumbnails, then you should clear the $allowedSites array immediatley:</p>
<p><code><br />
$allowedSites = array (<br />
	'flickr.com',<br />
	'picasa.com',<br />
	'blogger.com',<br />
	'wordpress.com',<br />
	'img.youtube.com',<br />
	'upload.wikimedia.org',<br />
);<br />
</code></p>
<p>The vulnerable code is at line 641:</p>
<p><code><br />
				$isAllowedSite = false;<br />
				foreach ($allowedSites as $site) {<br />
					<strong>if (strpos (strtolower ($url_info['host']), $site) !== false) {</strong><br />
						$isAllowedSite = true;<br />
					}<br />
				}<br />
</code></p>
<p>strpos() will report a true value if it finds the allowed site anywhere within the $site string. So &#8216;flickr.com.badguyblackhat.com&#8217; will pass.</p>
<h3>The Exploit</h3>
<p>Instead of submitting an image, an attacher will try to make a thumbnail out of a file containing PHP code, also ending in the .php extension. </p>
<p>The thumbnail process will fail of course, but a copy of the PHP file will be stored at the ./cache/ directory &#8211; using the same name that was submitted(including .php). The attacker will then access the file remotely and your server will run its contents.</p>
<p>The vulnerability is very serious, it is out on the WWW right now and you should take immediate action.</p>
<h3>Temporary Fix</h3>
<p>Clear the $allowedSites array until a new version is released. </p>
<p><a href="http://timthumb.googlecode.com/svn/trunk/timthumb.php">Update: download the fixed version here.</a></p>
<p><code><br />
$allowedSites = array ();<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://zefonseca.com/blogs/zen/the-timthumb-php-vulnerability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get out of Google+</title>
		<link>http://zefonseca.com/blogs/zen/how-to-get-out-of-google/</link>
		<comments>http://zefonseca.com/blogs/zen/how-to-get-out-of-google/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 18:15:50 +0000</pubDate>
		<dc:creator>Zen</dc:creator>
				<category><![CDATA[The Web]]></category>

		<guid isPermaLink="false">http://zefonseca.com/blogs/zen/?p=525</guid>
		<description><![CDATA[This may be hard to find in the Google system: https://plus.google.com/u/0/downgrade/ Unfortunately, I shared a couple of posts on Google+ and they ended up on over a hundred mailboxes as unsolicited mail. The checkbox under the Share button means you&#8217;d like to share with everyone NOT on Google+. I scanned it in a hurry and [...]]]></description>
			<content:encoded><![CDATA[<p>This may be hard to find in the Google system:</p>
<h2>https://plus.google.com/u/0/downgrade/</h2>
<p>Unfortunately, I shared a couple of posts on Google+ and they ended up on over a hundred mailboxes as unsolicited mail. The checkbox under the Share button means you&#8217;d like to share with everyone NOT on Google+. I scanned it in a hurry and ended up accidentally spamming almost 200 mailboxes of former bosses, former relationships and tens of folks I haven&#8217;t talked to in a while. Some of the phone calls were less friendly than others.</p>
<h3>In one word: Awkward.</h3>
<p>Tip received via <a href="http://www.reddit.com/">Reddit.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://zefonseca.com/blogs/zen/how-to-get-out-of-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Gear Oracle</title>
		<link>http://zefonseca.com/blogs/zen/the-gear-oracle/</link>
		<comments>http://zefonseca.com/blogs/zen/the-gear-oracle/#comments</comments>
		<pubDate>Wed, 25 May 2011 17:20:13 +0000</pubDate>
		<dc:creator>Zen</dc:creator>
				<category><![CDATA[The Web]]></category>

		<guid isPermaLink="false">http://zefonseca.com/blogs/zen/?p=516</guid>
		<description><![CDATA[The good news, at lunch with my good friend Fabio Pili, was that he&#8217;d finally concede &#8211; answering my(and several others&#8217;) countless requests &#8211; and finally publish an online photography and gear resource we can all refer to. For years we&#8217;d call him the &#8220;gear oracle&#8221;, because he knows every spec, of every lens, of [...]]]></description>
			<content:encoded><![CDATA[<p>The good news, at lunch with <a href="http://www.pili.com.br/">my good friend Fabio Pili</a>, was that he&#8217;d finally concede &#8211; answering my(and several others&#8217;) countless requests &#8211; and finally publish an online photography and gear resource we can all refer to. For years we&#8217;d call him the &#8220;gear oracle&#8221;, because he knows every spec, of every lens, of every camera we could think of, and folks would always ask &#8220;why aren&#8217;t you publishing this stuff up, it&#8217;d make a neat site!&#8221;. </p>
<p>One who simply enjoys the art of photography, who lives and breathes photography, Pili is always happy to talk about his craft &#8211; especially the tools of the craft. There has never been an email I sent him that has gone unanswered, never a question missed, even when stamping 16-hour-days onto his punch card, he&#8217;s always there at 10 pm to help folks get the most out of their photography and design. </p>
<p>So I&#8217;m glad to refer my friends and readers to <a href="http://gearoracle.com/">Fabio Pili&#8217;s Gear Oracle</a>. He won&#8217;t tell me what the Beta system is yet, but I have my guesses, and I think it&#8217;s going to be neat. </p>
<p>For the time being, <a href="http://gearoracle.com/articles/lens-distortion-correction-on-post-processing/">his</a> <a href="http://gearoracle.com/guides/firefox-color-management/">technical</a> <a href="http://gearoracle.com/guides/web-browser-color-management-guide/">articles</a> have been attracting quite some attention and positive reviews from photo experts that I know, both online and off. Please don&#8217;t mind me slipping in one more praise &#8211; but I&#8217;d say the good press is deserved.</p>
<p>So Bob&#8217;s your uncle and that&#8217;s my useful resource tip of the day. I hope you visit and that you like it as much as I did.</p>
]]></content:encoded>
			<wfw:commentRss>http://zefonseca.com/blogs/zen/the-gear-oracle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The sum of cubes = the square of the sum</title>
		<link>http://zefonseca.com/blogs/zen/the-sum-of-cubes-the-square-of-the-sum/</link>
		<comments>http://zefonseca.com/blogs/zen/the-sum-of-cubes-the-square-of-the-sum/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 12:57:15 +0000</pubDate>
		<dc:creator>Zen</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://zefonseca.com/blogs/zen/?p=514</guid>
		<description><![CDATA[A short little Java program to test whether 1^3 + 2^3 + 3^3 + ..... + n^3 = (1 + 2 + 3 + .... + n)^2 Remains true for larger values of n. import javax.swing.*; import java.awt.FlowLayout; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.lang.Math; public class cubesums extends JFrame { private static final long serialVersionUID [...]]]></description>
			<content:encoded><![CDATA[<p>A short little Java program to test whether </p>
<pre>
1^3 + 2^3 + 3^3 + ..... + n^3 = (1 + 2 + 3 + .... + n)^2
</pre>
<p>Remains true for larger values of n. </p>
<pre>
import javax.swing.*;
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.lang.Math;

public class cubesums extends JFrame {

	private static final long serialVersionUID = 1L;
	JLabel value;
	JTextField iterationsText;
	public cubesums() {
		getContentPane().setLayout(new FlowLayout(FlowLayout.LEFT));
		iterationsText = new JTextField("10");
		getContentPane().add(iterationsText);

		value = new JLabel("N/A");
		getContentPane().add(value);
		JButton jb = new JButton("Calculate");
		jb.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				long ln  = 0;
				long ln3 = 0;
				long basesum=0;
				int iterations = Integer.parseInt(iterationsText.getText());
				for (int i=1; i<= iterations; i++) {
					ln += (long) Math.pow(i, 3);
					basesum += i;
				}
				ln3 = (long) Math.pow(basesum, 2);
				value.setText("SUM OF CUBES " + ln + " == SQUARE OF SUM " + ln3 + " FOR N == " + iterations);
				pack();
			}
		});
		getContentPane().add(jb);
		setBounds(400,400,400,100);
		pack();
		setTitle("Sum of cubes = Cube of sum");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setVisible(true);
	}

	public static void main(String[] args) {
		new cubesums();
	}

}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://zefonseca.com/blogs/zen/the-sum-of-cubes-the-square-of-the-sum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

