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

<channel>
	<title>why the long roads</title>
	<atom:link href="http://www.pencilcode.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pencilcode.com</link>
	<description>be simple. be useful. be creative. be curious.</description>
	<pubDate>Sat, 19 Jun 2010 03:33:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6-bleeding2</generator>
	<language>en</language>
			<item>
		<title>creating fractals in javascript</title>
		<link>http://www.pencilcode.com/2010/06/creating-fractals-in-javascript/</link>
		<comments>http://www.pencilcode.com/2010/06/creating-fractals-in-javascript/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 03:25:25 +0000</pubDate>
		<dc:creator>sofia</dc:creator>
		
		<category><![CDATA[curious]]></category>

		<category><![CDATA[open]]></category>

		<category><![CDATA[context free]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.pencilcode.com/?p=238</guid>
		<description><![CDATA[Just found out about the Context Free Art project through it&#8217;s javascript port, ContextFree.js done by Aza Raskin, the same guy involved in the development of Firefox. Raskin developed a lovely playful site, Algorithm Ink. I actually showed it to a friend who&#8217;s not a developer and she started playing right away : )
Here&#8217;s an [...]]]></description>
			<content:encoded><![CDATA[<p>Just found out about the C<a href="http://contextfreeart.org/">ontext Free Art</a> project through it&#8217;s javascript port, <a href="http://www.azarask.in/blog/post/contextfreejs-algorithm-ink-making-art-with-javascript/">ContextFree.js</a> done by <a href="http://azarask.in/blog">Aza Raskin</a>, the same guy involved in the development of Firefox. Raskin developed a lovely playful site, <a href="http://azarask.in/projects/algorithm-ink/">Algorithm Ink</a>. I actually showed it to a friend who&#8217;s not a developer and she started playing right away : )</p>
<p>Here&#8217;s an example: <a href="http://azarask.in/projects/algorithm-ink/#aa486456" target="_blank">http://azarask.in/projects/algorithm-ink/#aa486456</a> . Click browse to see lots more.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pencilcode.com/2010/06/creating-fractals-in-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>how to install munin on rhel</title>
		<link>http://www.pencilcode.com/2010/03/how-to-install-munin-on-rhel/</link>
		<comments>http://www.pencilcode.com/2010/03/how-to-install-munin-on-rhel/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 15:25:35 +0000</pubDate>
		<dc:creator>sofia</dc:creator>
		
		<category><![CDATA[useful]]></category>

		<category><![CDATA[monitoring]]></category>

		<category><![CDATA[munin]]></category>

		<category><![CDATA[server-admin]]></category>

		<guid isPermaLink="false">http://www.pencilcode.com/?p=233</guid>
		<description><![CDATA[Just jotting down all the steps I took to install Munin on a RHEL server:

Login as root
Add the Epel Repository
$ sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
$ sudo yum install munin munin-node
Dont forget to say yes on all checks. I got distracted by the phone and when I looked again I had a missing dependency error.
Edit munin&#8217;s conf [...]]]></description>
			<content:encoded><![CDATA[<p>Just jotting down all the steps I took to install <a href="http://munin-monitoring.org/">Munin</a> on a RHEL server:</p>
<ol>
<li>Login as root</li>
<li>Add the Epel Repository<br />
$ sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm</li>
<li>$ sudo yum install munin munin-node<br />
Dont forget to say yes on all checks. I got distracted by the phone and when I looked again I had a missing dependency error.</li>
<li>Edit munin&#8217;s conf file<br />
$ vim /etc/munin/munin.conf</li>
<li>Set up mail alerts when a status change occurs (eg from OK to warning)<br />
contact.sofia.command mail -s &#8220;Munin notification&#8221; sofia@example.com</li>
<li>Notice the line<br />
# htmldir /var/www/html/munin<br />
This will set where munin&#8217;s reports will beaccessible by the web browser. Change it (and uncomment it) if you want but make sure the folder you set it is writable by munin (chown -R munin &lt;directory&gt;). I had some problems here, Munin didnt create the files there so i set up an alias. But maybe you&#8217;ll be fine : )</li>
<li>Write and close munin.conf. Edit munin-node<br />
$ vim /etc/munin/munin-node.conf</li>
<li>Change the host entry from<br />
host *<br />
to<br />
host 127.0.0.1<br />
In this way you restrict the node to listen to localhost only</li>
<li>Start munin<br />
$ sudo /etc/init.d/munin-node start</li>
<li>Add munin to reboot<br />
$ sudo /sbin/chkconfig munin-node on</li>
<li>Set up the alias. My public directory isnt there so I needed to set up an alias in httpd.conf<br />
$ vim /etc/httpd/conf/httpd.conf</li>
<li>Add the below at the end adjusting what you need
<pre>Alias /srvmunin /var/www/html/munin
&lt;Directory /var/www/html/munin&gt;
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all

    AuthType Basic
    AuthName "Members Only"
    AuthUserFile /etc/munin/munin-htpasswd
    &lt;limit GET PUT POST&gt;
    Require user admin
    &lt;/limit&gt;</pre>
<pre>&lt;/Directory&gt;</pre>
<p>Notice we set the alias at srvmunin, so that the reports will be viewable at www.example.com/srvmunin. We also set an httpauth because otherwise anyone can see the munin reports.</li>
<li>Write and close and restart apache<br />
$ /sbin/service httpd stop<br />
$ /sbin/service httpd start<br />
Someone told me this was quicker than a restart (service httpd restart) but I have no idea if it&#8217;s true</li>
<li>Set up the password<br />
$ htpasswd -c /etc/munin/munin-htpasswd admin</li>
<li>Go to www.example.com/srvmunin and you should be prompted for the password. Then wait a few hours and you&#8217;ll start to see the charts. Done!</li>
</ol>
<p>This was heavily taken from <a href="http://articles.slicehost.com/2010/3/12/installing-munin-on-rhel">slicehost&#8217;s article on munin</a> so if anything goes wrong check there as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pencilcode.com/2010/03/how-to-install-munin-on-rhel/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NLP e Língua Portuguesa</title>
		<link>http://www.pencilcode.com/2009/11/nlp-e-lingua-portuguesa/</link>
		<comments>http://www.pencilcode.com/2009/11/nlp-e-lingua-portuguesa/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 02:14:26 +0000</pubDate>
		<dc:creator>sofia</dc:creator>
		
		<category><![CDATA[curious]]></category>

		<category><![CDATA[ner]]></category>

		<category><![CDATA[nlp]]></category>

		<category><![CDATA[português]]></category>

		<guid isPermaLink="false">http://www.pencilcode.com/?p=225</guid>
		<description><![CDATA[Desde há algum tempo que tenho alguma curiosidade sobre NLP (natural language processing) tanto a nível teórico (como funcionam os algoritmos que usam) como a nivel prático. Não existe por exemplo, um serviço semelhante ao Apture para português. Assim, derivados das minhas pesquisas aqui vão alguns links que achei interessantes:
LXSuite - um conjunto de webservices para [...]]]></description>
			<content:encoded><![CDATA[<p>Desde há algum tempo que tenho alguma curiosidade sobre <a href="http://en.wikipedia.org/wiki/Natural_language_processing">NLP</a> (natural language processing) tanto a nível teórico (como funcionam os algoritmos que usam) como a nivel prático. Não existe por exemplo, um serviço semelhante ao <a href="http://www.apture.com">Apture</a> para português. Assim, derivados das minhas pesquisas aqui vão alguns links que achei interessantes:</p>
<p><a href="http://lxsuite.di.fc.ul.pt/">LXSuite</a> - um conjunto de webservices para a análise linguística de texto desenvolvido pela Universidade Lisboa. Na LxSuite estão todos juntos mas podem ser vistos em separado no <a href="http://lxcenter.di.fc.ul.pt/">LxCenter</a>. Infelizmente, o serviço não tem api e é necessário consentimento para o seu uso.</p>
<p><a href="http://homepages.di.fc.ul.pt/~ahb/BrancoCostaMartinsNunesSilvaSilveira2008.pdf">LXService:  Web Services of Language Technology for Portuguese</a> - artigo a descrever o desenvolvimento dos webservices acima.</p>
<p><a href="http://www.linguateca.pt/">Linguateca</a> - todo um conjunto de recursos de NLP para a língua portuguesa. O <a href="http://www.linguateca.pt/aval_conjunta/HAREM/harem_ing.html">HAREM - NER for portuguese</a> e respectivo livro está <a href="http://www.linguateca.pt/LivroSegundoHAREM/">aqui</a>. Eles também disponibilizam vários corpus para português <a href="http://www.linguateca.pt/acesso/contabilizacao.php">aqui</a>, inclusivé o <a href="http://www.linguateca.pt/cetempublico/index_info.html">CETEMPúblico</a> (disponível para download gratuitamente).</p>
<p><a href="http://www2009.org/pdf/submissions/wwwiberoamerica09_submission_1.pdf">Portuguese Language Processing Service</a> - um artigo sobre o desenvolvimento dum conjunto de webservices de NLP para língua portuguesa desenvolvido no Brasil. De acordo com os próprios:</p>
<blockquote><p>In this paper, we describe F-EXT-WS, a Portuguese Language Processing Service that is now available at the Web. The first version of this service provides Part-of-Speech Tagging, Noun Phrase Chunking and Named Entity Recognition. All these tools were built with the Entropy Guided Transformation Learning algorithm, a state-of-the-art Machine Learning algorithm for such tasks.</p></blockquote>
<p>Este artigo parece interessante e pode ser um ponto de partida para outras explorações (ex. ETL/Entropy Guided Transformation Learning - ver <a href="http://www.scielo.br/scielo.php?script=sci_arttext&amp;pid=S0104-65002008000400003">Portuguese corpus-based learning using ETL</a>). Fui ver o <a href="http://www.learn.inf.puc-rio.br/fextws/index.jsf">F-EXT-WS</a> mas é necessário registo e deu erro.</p>
<p>Alguém conhece outros recursos interessantes dentro desta àrea?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pencilcode.com/2009/11/nlp-e-lingua-portuguesa/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sixth Sense</title>
		<link>http://www.pencilcode.com/2009/11/sixth-sense/</link>
		<comments>http://www.pencilcode.com/2009/11/sixth-sense/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 14:20:25 +0000</pubDate>
		<dc:creator>sofia</dc:creator>
		
		<category><![CDATA[creative]]></category>

		<category><![CDATA[humane]]></category>

		<category><![CDATA[useful]]></category>

		<category><![CDATA[gadgets]]></category>

		<category><![CDATA[sixth sense]]></category>

		<guid isPermaLink="false">http://www.pencilcode.com/?p=219</guid>
		<description><![CDATA[This is truly amazing..

And another interesting find: LED tattoos
]]></description>
			<content:encoded><![CDATA[<p>This is truly amazing..</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="446" height="326" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="wmode" value="transparent" /><param name="bgColor" value="#ffffff" /><param name="flashvars" value="vu=http://video.ted.com/talks/dynamic/PranavMistry_2009I-medium.flv&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/PranavMistry-2009I.embed_thumbnail.jpg&amp;vw=432&amp;vh=240&amp;ap=0&amp;ti=685&amp;introDuration=16500&amp;adDuration=4000&amp;postAdDuration=2000&amp;adKeys=talk=pranav_mistry_the_thrilling_potential_of_sixthsense_tec;year=2009;theme=the_creative_spark;theme=new_on_ted_com;theme=what_s_next_in_tech;theme=tales_of_invention;theme=a_taste_of_tedindia;theme=design_like_you_give_a_damn;theme=ted_under_30;event=TEDIndia+2009;&amp;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" /><param name="src" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" /><embed type="application/x-shockwave-flash" width="446" height="326" src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" flashvars="vu=http://video.ted.com/talks/dynamic/PranavMistry_2009I-medium.flv&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/PranavMistry-2009I.embed_thumbnail.jpg&amp;vw=432&amp;vh=240&amp;ap=0&amp;ti=685&amp;introDuration=16500&amp;adDuration=4000&amp;postAdDuration=2000&amp;adKeys=talk=pranav_mistry_the_thrilling_potential_of_sixthsense_tec;year=2009;theme=the_creative_spark;theme=new_on_ted_com;theme=what_s_next_in_tech;theme=tales_of_invention;theme=a_taste_of_tedindia;theme=design_like_you_give_a_damn;theme=ted_under_30;event=TEDIndia+2009;&amp;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" bgcolor="#ffffff" wmode="transparent" allowfullscreen="true"></embed></object></p>
<p>And another interesting find: <a href="http://www.wired.com/gadgetlab/2009/11/the-illustrated-man-how-led-tattoos-could-change-the-face-of-humanity/">LED tattoos</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pencilcode.com/2009/11/sixth-sense/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Links on tdd, css &#038; others</title>
		<link>http://www.pencilcode.com/2009/03/links-on-tdd-css-others/</link>
		<comments>http://www.pencilcode.com/2009/03/links-on-tdd-css-others/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 05:30:38 +0000</pubDate>
		<dc:creator>sofia</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.pencilcode.com/?p=193</guid>
		<description><![CDATA[
Doctest - runnable tests inside the docstrings (php pear package)
Mutation testing 
&#8220;Mutation Testing is basically testing&#8230;for tests. It ensures that your tests are truly capable of detecting errors and problems with the source code. It does this by mutating the source code itself (using ext/runkit) in such a way that an error is created in the [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li>Doctest - runnable tests inside the docstrings (<a href="http://code.google.com/p/testing-doctest/wiki/Documentation#Anatomy_of_a_doctest">php pear package</a>)</li>
<li><a href="http://blog.astrumfutura.com/archives/389-PHP-Mutation-Testing-With-MutateMe.html">Mutation testing</a> <br />
<blockquote><p>&#8220;Mutation Testing is basically testing&#8230;for tests. It ensures that your tests are truly capable of detecting errors and problems with the source code. It does this by mutating the source code itself (using ext/runkit) in such a way that an error is created in the code. If your tests detect the error, all is well with the world. If your tests do not detect the error&#8230;well, you better add a new test that does&#8221; </p></blockquote>
</li>
<li><a href="http://github.com/sebastianbergmann/phpcpd/tree/master">Phpcp</a><br />
<blockquote><p>&#8220;phpcpd is a Copy/Paste Detector (CPD) for PHP code.</p>
<p>The goal of phpcpd is not not to replace more sophisticated tools such as phpcs, pdepend, or phpmd, but rather to provide an alternative to them when you just need to get a quick overview of duplicated code in a project.&#8221;</p></blockquote>
</li>
<li><a href="http://wiki.github.com/stubbornella/oocss">Object oriented CSS</a><br />
<blockquote><p>&#8220;OOCSS allows you to write fast, maintainable, standards-based front end code.&#8221;  </p></blockquote>
</li>
<li><a href="https://bespin.mozilla.com/">Bespin</a><br />
<blockquote><p> Bespin is a Mozilla Labs experiment on how to build an extensible Web code editor using HTML 5 technology.</p></blockquote>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.pencilcode.com/2009/03/links-on-tdd-css-others/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Doctests for php - test &#038; create documentation</title>
		<link>http://www.pencilcode.com/2009/03/doctests-for-php-test-create-documentation/</link>
		<comments>http://www.pencilcode.com/2009/03/doctests-for-php-test-create-documentation/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 02:38:06 +0000</pubDate>
		<dc:creator>sofia</dc:creator>
		
		<category><![CDATA[useful]]></category>

		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://www.pencilcode.com/?p=186</guid>
		<description><![CDATA[Recently I found out about doctests in php. Doctests are tests you can put inside the docblock of the class or method. They originated in python but now there&#8217;s a ruby implementation, a php implementation and even a javascript implementation. 
An example will explain better (applies to the php package):
class simplemath
{
 
/**
* subtract function.
*
* @access public
* @param [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I found out about doctests in php. Doctests are tests you can put inside the docblock of the class or method. They originated in python but now there&#8217;s a <a href="http://github.com/tablatom/rubydoctest/tree/master">ruby implementation</a>, a <a title="php-doctest" href="http://pear.php.net/package/Testing_DocTest">php implementation</a> and even a <a href="http://svn.colorstudy.com/doctestjs/trunk/docs/index.html">javascript implementation</a>. </p>
<p>An example will explain better (applies to the php package):</p>
<p>class simplemath</p>
<p>{</p>
<p><code> </code></p>
<p><code>/**<br />
* subtract function.<br />
*<br />
* @access public<br />
* @param int $a<br />
* @param int $b<br />
* @return int<br />
*<br />
* &lt;code&gt;<br />
* //doctest: subtract<br />
* echo simplemath::subtract(10,6);<br />
* //expects:<br />
* //4<br />
* &lt;/code&gt;<br />
*/<br />
public static function subtract($a, $b)<br />
{<br />
return (int)$a - (int)$b;<br />
}<br />
</code></p>
<p><span style="font-family: -webkit-monospace;">}</span></p>
<p><code> </code></p>
<p>The test itself is inside the &lt;code&gt; tags. If I then run this code through doctest&#8217;s commandline runner for php, by running</p>
<p>$ phpdt simplemath.php</p>
<p>I&#8217;ll get something like this:</p>
<p><a href="http://www.pencilcode.com/wp-content/uploads/2009/03/doctest.jpg"><img class="alignnone size-medium wp-image-187" title="doctest run" src="http://www.pencilcode.com/wp-content/uploads/2009/03/doctest.jpg" alt="" /></a></p>
<p>Doctests can serve as great documentation by example and as tests, both for your documentation - comments tend to get terribly out of date (when code changes the comments aren&#8217;t updated accordingly) - and for the code itself.</p>
<p>I&#8217;ve also found they&#8217;re an invaluable tool during development. Imagine you&#8217;re developing a method that validates credit card numbers and the only way to get to it in a browser is to perform several actions, eg going to the specific webpage, inputting the credit card number, and submitting the form - it&#8217;s hell basically. If you&#8217;re already doing TDD and using phpUnit you&#8217;re probably not doing this but doctest for me has an advantage there, the test and the code being tested are in the same file - it&#8217;s all there! and so it&#8217;s really easy to grasp the problem at hand.</p>
<p>My process has been,</p>
<ul>
<li>write a test case in doctest</li>
<li>write the code itself</li>
<li>test</li>
<li>repeat as necessary</li>
</ul>
<p>Due to this I submitted a patch to allow the testing of only 1 test, it&#8217;s not in the current release but it&#8217;s been accepted. This way instead of waiting for all the tests to run, i can run only the method I&#8217;m working on.</p>
<p>Another cool thing about it is you become aware of any initial setup code and dependencies. Look at the following:</p>
<p><code><br />
 /**<br />
* Calculates the number of nights between the start and end date of the booking<br />
* @return int<br />
*<br />
<code><br />
* &lt;code&gt;<br />
*  // doctest: booker-&gt;total_nights<br />
* require_once('lib/utilities.class.php');<br />
* $booker = new booker();<br />
* $booker-&gt;startDate = '2009-02-23';<br />
* $booker-&gt;endDate = '2009-02-26';<br />
* echo $booker-&gt;total_nights(). "\n";<br />
* // expects:<br />
* // 3<br />
* &lt;/code&gt;<br />
*<br />
*/<br />
public function total_nights()<br />
{<br />
if (!isset($this-&gt;startDate) || !isset($this-&gt;endDate)) {<br />
return false;<br />
}<br />
return (int)utilities::date_diff($this-&gt;startDate,$this-&gt;endDate,'d');<br />
}<br />
</code></p>
<p>Even without the rest of the class it&#8217;s immediately visible that this method requires that the start and end dates be set and the inclusion of another class.</p>
<pp>I think doctests are a really easy way to start writing tests. If you&#8217;re like me and also use phpUnit, it&#8217;s easy to write an AllTests file that runs both the doctest tests and the phpunit tests.</p>
<p>I view doctest as unitestting in its simplest form, there&#8217;s no setup/teardown methods, no mocks, etc. But since not all classes need all that, that&#8217;s fine by me. You can use doctest and phpunit/simpletest side by side. This way you have tests for code and tests for documentation <img src='http://www.pencilcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Doctests pros</strong> (more or less from the <a href="http://code.google.com/p/testing-doctest/wiki/Documentation#Anatomy_of_a_doctest">php-doctest documentation</a> ):</p>
<ul>
<li>it makes unit tests writing easier and quicker -&gt; easy to <em>test as you go</em></li>
<li>it ensures that docstrings are up-to-date by verifying that all examples work as documented -&gt; a sort of <em>testable documentation</em></li>
<li>it enforces writing of tutorial documentation, liberally illustrated with input-output examples.</li>
</ul>
<p><strong>Cons</strong>:</p>
<ul>
<li>If placed inline and used as the only method of unit-testing they can easily clutter the code. </li>
</ul>
<p><strong>Wishlist for the php packag</strong>e:</p>
<ul>
<li>Ability to enter into interactive mode inside a doctest (<a href="http://bluedynamics.com/articles/jens/interlude-write-python-doctests-interactive">interlude</a> recently added this ability in python) </li>
<li>Allow the inclusion of standalone test files (*) - right now asfaik it only allows for the expected values to be in another file, like this: 
<p><code><br />
* &lt;code&gt;<br />
* //doctest: add<br />
* echo simplemath::add(3,2);<br />
* echo simplemath::add(5,2);<br />
* // expects-file: atestfile.txt<br />
* &lt;/code&gt;<br />
</code><br />
 </li>
</ul>
<p>Hope it&#8217;s as useful to you as it&#8217;s been to me <img src='http://www.pencilcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>* Update: I submitted a patch to allow for this, so if it&#8217;s accepted, it will be possible soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pencilcode.com/2009/03/doctests-for-php-test-create-documentation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to check if mod_deflate is enabled</title>
		<link>http://www.pencilcode.com/2009/01/how-to-check-if-mod_deflate-is-enabled/</link>
		<comments>http://www.pencilcode.com/2009/01/how-to-check-if-mod_deflate-is-enabled/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 01:55:25 +0000</pubDate>
		<dc:creator>sofia</dc:creator>
		
		<category><![CDATA[useful]]></category>

		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.pencilcode.com/?p=180</guid>
		<description><![CDATA[Here are 2 links that allow you to check if mod_deflate is enabled:
port80&#8217;s tools
what&#8217;s my ip mod gzip tester
You can also use YSlow + Firebug but I ran into a strange problem where YSlow did not detect the compressed content (gave an F on gzip components) when I knew I was actually compressing content. I [...]]]></description>
			<content:encoded><![CDATA[<p>Here are 2 links that allow you to check if mod_deflate is enabled:</p>
<p><a href="http://port80software.com/support/p80tools">port80&#8217;s tools</a></p>
<p><a href="http://www.whatsmyip.org/mod_gzip_test/">what&#8217;s my ip mod gzip tester</a></p>
<p>You can also use YSlow + Firebug but I ran into a strange problem where YSlow did not detect the compressed content (gave an F on gzip components) when I knew I was actually compressing content. I then looked around for other tools and found those 2 which detected the compression correctly. So lesson learned, use several tools to validate compression - just to make sure.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pencilcode.com/2009/01/how-to-check-if-mod_deflate-is-enabled/feed/</wfw:commentRss>
		</item>
		<item>
		<title>quick setup instructions for profiling php scripts on a mac with xdebug + webgrind</title>
		<link>http://www.pencilcode.com/2008/11/quick-setup-instructions-for-mac-xampp-xdebug-webgrind/</link>
		<comments>http://www.pencilcode.com/2008/11/quick-setup-instructions-for-mac-xampp-xdebug-webgrind/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 05:43:46 +0000</pubDate>
		<dc:creator>sofia</dc:creator>
		
		<category><![CDATA[useful]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[performance]]></category>

		<category><![CDATA[webgrind]]></category>

		<category><![CDATA[xampp]]></category>

		<category><![CDATA[xdebug]]></category>

		<guid isPermaLink="false">http://www.pencilcode.com/?p=150</guid>
		<description><![CDATA[These instructions are for xampp on a mac.

Download xdebug.so from activestate (thank you Komodo)

Copy xdebug.so (choose the correct xdebug according to your php version) to xampp/xamppfiles/lib/php/php5/extensions/no-debug-non-zts-########/xdebug.so .
Configure php.ini:
At the end of php.ini (it&#8217;s in xampp/etc/php.ini) add
zend_extension=/Applications/xampp/xamppfiles/lib/php/php5/extensions/no-debug-non-zts-20060613/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_host = localhost
xdebug.show_local_vars=1
xdebug.dump.SERVER=HTTP_HOST, SERVER_NAME
xdebug.dump_globals=On
xdebug.collect_params=4
xdebug.profiler_enable=On
xdebug.profiler_enable_trigger=On
xdebug.profiler_output_name=&#8221;%p-%R&#8221;
The &#8220;xdebug.profiler_output_name=&#8221;%p-%R&#8221;" sets the file name to process pid (default) + &#8220;-&#8221; + [...]]]></description>
			<content:encoded><![CDATA[<p>These instructions are for xampp on a mac.</p>
<ol>
<li>Download xdebug.so from <a href="http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging">activestate</a> (thank you <a href="http://www.activestate.com/Products/Komodo/">Komodo</a>)<a href="http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging"><br />
</a></li>
<li>Copy xdebug.so (choose the correct xdebug according to your php version) to xampp/xamppfiles/lib/php/php5/extensions/no-debug-non-zts-########/xdebug.so .</li>
<li>Configure php.ini:<br />
At the end of php.ini (it&#8217;s in xampp/etc/php.ini) add</p>
<p>zend_extension=/Applications/xampp/xamppfiles/lib/php/php5/extensions/no-debug-non-zts-20060613/xdebug.so<br />
xdebug.remote_enable = 1<br />
xdebug.remote_port = 9000<br />
xdebug.remote_host = localhost<br />
xdebug.show_local_vars=1<br />
xdebug.dump.SERVER=HTTP_HOST, SERVER_NAME<br />
xdebug.dump_globals=On<br />
xdebug.collect_params=4<br />
xdebug.profiler_enable=On<br />
xdebug.profiler_enable_trigger=On<br />
xdebug.profiler_output_name=&#8221;%p-%R&#8221;</p>
<p>The &#8220;xdebug.profiler_output_name=&#8221;%p-%R&#8221;" sets the file name to process pid (default) + &#8220;-&#8221; + the REQUEST URI (helpful if you&#8217;re rewriting urls). The xdebug.dump commands are not for profiling but they improve var_dump &amp; error messages. Check <a href="http://devzone.zend.com/article/2899-Profiling-PHP-Applications-With-xdebug">zend&#8217;s article series on xdebug</a> for more info.</li>
<li>Run php info &amp; check xdebug&#8217;s there.<br />
If you get &#8216;could not load.. (null)&#8217; you probably downloaded the wrong version for your mac. Also check the path to xdebug is correct (the <code>no-debug-non-zts-####### part might be different</code>)</li>
<li>Install <a href="http://code.google.com/p/webgrind/">webgrind</a>: download from <a href="http://code.google.com/p/webgrind/">here</a> and copy directory to xampp/xamppfiles/htdocs folder</li>
<li>Visit your script with ?XDEBUG_PROFILE=1 appended to the end of the url. Eg http://localhost/myapp/index.php?XDEBUG_PROFILE=1</li>
<li>Now navigate to webgrind (eg. http://localhost/webgrind/ ), select the correct file from the dropdown - you can see the files xdebug&#8217;s created in yout /tmp directory -  and you should see the profiling info.</li>
<li>Done!</li>
</ol>
<p>Sources:</p>
<ul>
<li><a href="http://debuggable.com/posts/setting-up-xdebug-on-mac-os-x-or-win32-linux:480f4dd6-0240-4a90-8fa1-4e41cbdd56cb">http://debuggable.com/posts/setting-up-xdebug-on-mac-os-x-or-win32-linux:480f4dd6-0240-4a90-8fa1-4e41cbdd56cb</a></li>
<li><a href="http://devzone.zend.com/article/2899-Profiling-PHP-Applications-With-xdebug">http://devzone.zend.com/article/2899-Profiling-PHP-Applications-With-xdebug</a> - this is a really good intro to xdebug</li>
</ul>
<p>Might be interesting:</p>
<p><a href="http://www.maccallgrind.com/">http://www.maccallgrind.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pencilcode.com/2008/11/quick-setup-instructions-for-mac-xampp-xdebug-webgrind/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ipod touch apps</title>
		<link>http://www.pencilcode.com/2008/11/ipod-touch-apps/</link>
		<comments>http://www.pencilcode.com/2008/11/ipod-touch-apps/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 18:37:32 +0000</pubDate>
		<dc:creator>sofia</dc:creator>
		
		<category><![CDATA[useful]]></category>

		<category><![CDATA[applications]]></category>

		<category><![CDATA[iphone]]></category>

		<category><![CDATA[ipod touch]]></category>

		<guid isPermaLink="false">http://www.pencilcode.com/?p=142</guid>
		<description><![CDATA[Since i&#8217;ve got my ipod touch, i&#8217;ve been trying out several applications. Some have sticked, others less. So here&#8217;s my current favorite list along with a few comments.
Stanza provides the best reading  experience of all the ereaders i&#8217;ve tried (stanza, filemagnet, instapaper, ereader) . A feature suggestion: I really would like the ability to add [...]]]></description>
			<content:encoded><![CDATA[<p>Since i&#8217;ve got my ipod touch, i&#8217;ve been trying out several applications. Some have sticked, others less. So here&#8217;s my current favorite list along with a few comments.</p>
<p><a href="http://www.lexcycle.com/">Stanza</a> provides the best reading  experience of all the ereaders i&#8217;ve tried (stanza, filemagnet, instapaper, ereader) . A feature suggestion: I really would like the ability to add notes on any page or at least to underline/highlight text. Highlighting would really be nice - it just makes the reading experience much better. Basically the physical action of highlighting makes it easier for me to process the information and remember it later.</p>
<p>A note on page turning: Stanza is the only app where you press the left/right side of the screen to go to the previous/next page which would be fine if everyone else was doing it as well. As it is, I frequently scroll down and then wonder why nothing&#8217;s happening. I actually would like for everyone else to use Stanza&#8217;s method - it just jumps to the exact spot you were on which is less tiring on the eyes.</p>
<p>Stanza Pros: free; good readability. Cons: Most pdfs i tried to convert were not converted correctly making the app much less usable than i initially thought. Especially images and indexes are really poorly converted. So the search for a decent experience on reading my pdf&#8217;s went on which led me to the next app.</p>
<p><a href="http://www.magnetismstudios.com/filemagnet/">FileMagnet</a> - a file manager for the ipod/iphone. Does what it&#8217;s supposed to do allowing the ipod work like a thumb drive. Cons: Frequent warnings on low memory when reading large pdfs and much poorer reading experience than stanza. Price:3.99€. Pros: Everything that i can&#8217;t read on Stanza, i read here. Useful.</p>
<p><a href="http://www.instapaper.com/">Instapaper</a> - simple app for saving pages and then reading offline. This is probably the app i use the most now along with itunes. Free and paid version. No real cons.</p>
<p><a href="http://www.leftcoastlogic.com/home.html">SmartTime</a> - an app i really appreciate. A todo list + calendar: it&#8217;s been done a thousand times before but they actually innovated in the ui. Cons: no integration with google calendar, no export/import.</p>
<p><a href="http://www.shapewriter.com/iphone.html">Writing Pad</a> - another innovator. Instead of the default experience we have on small software devices where we click letter after letter to write, we now basically draw a line in between all the letters - this simple difference makes the writing experience a bit less clumky and much faster. I&#8217;ve gotten so used to it that i miss it in other apps where i write. A really good idea for writing on small devices (and they&#8217;ve filed a patent).</p>
<p><a href="http://www.accountr.com/">Accountr</a> - a simple app for finance management. Didn&#8217;t really like it at first but it&#8217;s really quick to register stuff and i keep using it so that&#8217;s a good sign. Price: 0.79€</p>
<p>I could also mention others like Evernote but those are the ones i&#8217;m using the most now. Suggestions welcome <img src='http://www.pencilcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pencilcode.com/2008/11/ipod-touch-apps/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ubiquity para páginas amarelas e dicionário priberam</title>
		<link>http://www.pencilcode.com/2008/09/ubiquity-para-paginas-amarelas-e-dicionario-priberam/</link>
		<comments>http://www.pencilcode.com/2008/09/ubiquity-para-paginas-amarelas-e-dicionario-priberam/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 13:16:36 +0000</pubDate>
		<dc:creator>sofia</dc:creator>
		
		<category><![CDATA[simple]]></category>

		<category><![CDATA[useful]]></category>

		<category><![CDATA[páginas amarelas]]></category>

		<category><![CDATA[priberam]]></category>

		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://www.pencilcode.com/?p=127</guid>
		<description><![CDATA[Para me divertir e porque me era útil decidi criar 2 comandos ubiquity para o firefox, um para o pai.pt e outro para o dicionário priberam.
O pai.pt foi fácil, bastou usar o searchCommand et voilá:

makeSearchCommand({
name: "pai",
url: "http://pai.pt/search/{QUERY}.html",
icon: "http://pai.pt/favicon.ico",
description: "Pesquisa nas páginas amarelas (pai.pt); Seaches the portuguese yellow pages."
});

No caso do dicionário priberam a coisa foi [...]]]></description>
			<content:encoded><![CDATA[<p>Para me divertir e porque me era útil decidi criar 2 comandos <a href="http://labs.mozilla.com/2008/08/introducing-ubiquity/">ubiquity</a> para o firefox, um para o pai.pt e outro para o dicionário priberam.<br />
O pai.pt foi fácil, bastou usar o searchCommand et voilá:<br />
<code><br />
makeSearchCommand({<br />
name: "pai",<br />
url: "http://pai.pt/search/{QUERY}.html",<br />
icon: "http://pai.pt/favicon.ico",<br />
description: "Pesquisa nas páginas amarelas (pai.pt); Seaches the portuguese yellow pages."<br />
});<br />
</code></p>
<p>No caso do dicionário priberam a coisa foi um pouco mais trabalhosa, primeiro tudo aquilo funciona à base de javascript no site (após alguma leitura do código lá percebi que faziam à mesma um pedido GET) e depois porque foi necessário codificar os parametros GET porque palavras com acentos estavam a falhar. Neste caso tive que usar o createCommand pois por enquanto não é possível escapar os parâmetros GET no searchCommand.<br />
<code><br />
CmdUtils.CreateCommand({<br />
name: "priberam",<br />
description: "Searches the portuguese dictionary priberam",<br />
help: "Try issuing "priberam aglet"",<br />
icon: "http://priberam.pt/favicon.ico",<br />
takes: {"pal": noun_arb_text},<br />
execute: function( directObj ) {<br />
var word = directObj.text;<br />
Utils.openUrlInBrowser( "http://priberam.pt/dlpo/definir_resultados.aspx?pal=" + escape(word) );<br />
}<br />
});<br />
</code><br />
O comando das páginas amarelas está <a href="http://pencilcode.com/ubiquity/ubiquity-paipt.html">aqui</a> (comando pai) e o da priberam está <a href="http://pencilcode.com/ubiquity/ubiquity-priberam.html">aqui</a> (comando priberam).</p>
<p>[<strong>Update</strong>: Acabei de reparar que o <a href="http://ruimoura.net/blog/">Rui Moura</a> já tinha construído um comando para o dicionário priberam <a href="http://ruimoura.net/blog/2008/08/31/ubiquity-pesquisa-priberam/">aqui</a>. De qualquer modo, ao menos não são iguais porque a versão dele usa o searchCommand e como tal falha no caso de palavras com acentos ou caracteres especiais, ex. doçura.]</p>
<p>[<strong>Update 2</strong>: O <a href="http://miguelpais.com/">Miguel Pais</a> tem a versão mais completa neste momento (<a href="http://miguelpais.com/ubiquity/priberam_install">instalar aqui</a>), com preview e também lida bem com caracteres especiais. Vejam os comentários abaixo.]</p>
<p>[For the <strong>english readers</strong>: to sum it up, when you need to escape accented characters in the query parameter use  createCommand instead of searchCommand; see example code above).]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pencilcode.com/2008/09/ubiquity-para-paginas-amarelas-e-dicionario-priberam/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
