<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Roberto Aloi &#187; HowTo</title>
	<atom:link href="http://aloiroberto.wordpress.com/category/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://aloiroberto.wordpress.com</link>
	<description>My code is bug-free. It implements some random, undocumented features</description>
	<lastBuildDate>Fri, 26 Oct 2012 20:54:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='aloiroberto.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Roberto Aloi &#187; HowTo</title>
		<link>http://aloiroberto.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://aloiroberto.wordpress.com/osd.xml" title="Roberto Aloi" />
	<atom:link rel='hub' href='http://aloiroberto.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How to manage multiple Erlang installations</title>
		<link>http://aloiroberto.wordpress.com/2010/11/24/how-to-manage-multiple-erlang-installations/</link>
		<comments>http://aloiroberto.wordpress.com/2010/11/24/how-to-manage-multiple-erlang-installations/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 20:07:36 +0000</pubDate>
		<dc:creator>Roberto Aloi</dc:creator>
				<category><![CDATA[Erlang]]></category>
		<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://aloiroberto.wordpress.com/?p=440</guid>
		<description><![CDATA[Sometimes you need to use different Erlang versions for different projects. I personally have to use an old R12B-5 for one of my projects, which won&#8217;t compile on any of the latest Erlang versions. The question is then: How to switch from one version of Erlang to another one in a simple way? There are no &#8230; <a href="http://aloiroberto.wordpress.com/2010/11/24/how-to-manage-multiple-erlang-installations/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=440&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:justify;">Sometimes you need to use different Erlang versions for different projects. I personally have to use an old R12B-5 for one of my projects, which won&#8217;t compile on any of the latest Erlang versions. The question is then:</p>
<blockquote>
<p style="text-align:justify;">How to switch from one version of Erlang to another one in a simple way?</p>
</blockquote>
<p style="text-align:justify;">There are no magics behind what I&#8217;m going to say in this post. Actually, this post will sound quite trivial to most of you. I simply wanted to share what I currently do with the ones of you who might have the same need. I&#8217;m using Snow Leopard, but all of the above should apply to any UNIX-like system. Also, I assume you&#8217;re fine with installing Erlang from source.</p>
<p style="text-align:justify;">Assume you have two separate Erlang installations in your home directory:</p>
<blockquote><p>~/erlang13b04</p>
<p>~/erlang14a</p></blockquote>
<p>Notice that you can specify the installation path of Erlang by selecting, at installation time:</p>
<blockquote><p>./configure &#8211;prefix=YOUR_INSTALLATION_PATH</p></blockquote>
<p style="text-align:justify;">First of all, let&#8217;s edit our ~/.bashrc, by adding the following line:</p>
<blockquote><pre class="brush: bash; title: ; notranslate">

PATH=$PATH:$HOME/bin

</pre>
</blockquote>
<p style="text-align:justify;">Then, let&#8217;s create the bin folder under the home directory:</p>
<blockquote><p>mkdir $HOME/bin</p></blockquote>
<p style="text-align:justify;">Let&#8217;s now create some scripts in the directory we&#8217;ve just created. We will need one script for each installation we want to use.</p>
<p style="text-align:justify;">Let&#8217;s create a file called &#8220;13&#8243; (no extension). Inside the file, we write:</p>
<pre class="brush: bash; title: ; notranslate">

#!/bin/bash
env PATH=/User/[USERNAME]/erlang13b04/bin:$PATH &quot;$@&quot;

</pre>
<p style="text-align:justify;">Let&#8217;s then do the same for R14. Create a file named &#8220;14&#8243; and write the following into it:</p>
<pre class="brush: bash; title: ; notranslate">

#!/bin/bash
env PATH=/User/[USERNAME]/erlang14a/bin:$PATH &quot;$@&quot;

</pre>
<p style="text-align:justify;">Make the two script executable:</p>
<blockquote><p>cd ~/bin</p>
<p>chmod +x 13 14</p></blockquote>
<p style="text-align:justify;">Let&#8217;s &#8220;source&#8221; the ~/.bashrc (or simply open a new shell):</p>
<blockquote><p>source ~/.bashrc</p></blockquote>
<p style="text-align:justify;">That&#8217;s it. If you want to run a command using R13, just:</p>
<blockquote><p>13 erl</p>
<p>Erlang R13B04 (erts-5.7.5)</p>
<p>Eshell V5.7.5  (abort with ^G)</p>
<p>1&gt;</p></blockquote>
<p>Or:</p>
<blockquote><p>14 erl</p>
<p>Erlang R14A (erts-5.8)</p>
<pre><span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height:19px;white-space:normal;font-size:13px;">Eshell V5.8  (abort with ^G)</span></pre>
<p>1&gt;</p></blockquote>
<p style="text-align:justify;">Assuming you have a project you want to compile with R13:</p>
<blockquote><p>13 make</p></blockquote>
<p style="text-align:justify;">Or, if you prefer R14:</p>
<blockquote><p>14 make</p></blockquote>
<p style="text-align:justify;">Well, you should have got the idea at this point&#8230;</p>
<p style="text-align:justify;">Notice that you can still specify the path of your favourite (default) Erlang installation in your ~/.bashrc file, so you wan&#8217;t need to prepend &#8220;14&#8243; to your commands every time you want to use the latest Erlang version.</p>
<p style="text-align:justify;">As I&#8217;ve already said, there&#8217;s nothing special here. Just a bit of playing with paths that might turn useful from time to time.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aloiroberto.wordpress.com/440/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aloiroberto.wordpress.com/440/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=440&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aloiroberto.wordpress.com/2010/11/24/how-to-manage-multiple-erlang-installations/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c20f7f4a8aa455aa6e0c2a0092883cd0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">prof3ta</media:title>
		</media:content>
	</item>
		<item>
		<title>When all the applications start crashing on the iPhone [solved]</title>
		<link>http://aloiroberto.wordpress.com/2010/06/13/when-all-the-applications-start-crashing-on-the-iphone-solved/</link>
		<comments>http://aloiroberto.wordpress.com/2010/06/13/when-all-the-applications-start-crashing-on-the-iphone-solved/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 12:27:22 +0000</pubDate>
		<dc:creator>Roberto Aloi</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">https://aloiroberto.wordpress.com/2010/06/13/when-all-the-applications-start-crashing-on-the-iphone-solved/</guid>
		<description><![CDATA[It happened to me several times to encounter a tedious bug on my iPhone. Suddenly, with no apparent reason, every non native application crashes immediately after the launch. A reboot in this case doesn&#8217;t help. The native applications (mail, safari, settings, etc) simply work fine. I&#8217;ve just realized that an update of ANY existing application &#8230; <a href="http://aloiroberto.wordpress.com/2010/06/13/when-all-the-applications-start-crashing-on-the-iphone-solved/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=356&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>It happened to me several times to encounter a tedious bug on my iPhone.</p>
<p>Suddenly, with no apparent reason, every non native application crashes immediately after the launch. A reboot in this case doesn&#8217;t help. The native applications (mail, safari, settings, etc) simply work fine.</p>
<p>I&#8217;ve just realized that an update of ANY existing application or the installation of ANY new application via the Apple store brings the device back into a normal state and all applications behave normally again.</p>
<p>Obviously this is just an ugly workaround, but it seems to work very effectively. See if it helps.  </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aloiroberto.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aloiroberto.wordpress.com/356/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=356&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aloiroberto.wordpress.com/2010/06/13/when-all-the-applications-start-crashing-on-the-iphone-solved/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c20f7f4a8aa455aa6e0c2a0092883cd0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">prof3ta</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Display &#8220;accesskey&#8221; shortcuts in Google Chrome (and much more)</title>
		<link>http://aloiroberto.wordpress.com/2010/06/12/how-to-display-accesskey-shortcuts-in-google-chrome-and-much-more/</link>
		<comments>http://aloiroberto.wordpress.com/2010/06/12/how-to-display-accesskey-shortcuts-in-google-chrome-and-much-more/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 10:00:34 +0000</pubDate>
		<dc:creator>Roberto Aloi</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[access key]]></category>
		<category><![CDATA[accesskey]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[chromium]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[manual]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[shortcut]]></category>
		<category><![CDATA[shortcuts]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://aloiroberto.wordpress.com/?p=338</guid>
		<description><![CDATA[Have you ever heard about access keys? Well, I did. And I loved them. Your productivity can be so improved when surfing a web page by avoiding to use the mouse and by using shortcuts, instead. The bad thing about access keys is that they&#8217;re often hidden, by default, in the web pages. This doesn&#8217;t &#8230; <a href="http://aloiroberto.wordpress.com/2010/06/12/how-to-display-accesskey-shortcuts-in-google-chrome-and-much-more/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=338&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Have you ever heard about <a href="http://en.wikipedia.org/wiki/Access_key" target="_blank">access keys</a>? Well, I did. And I loved them. Your productivity can be so improved when surfing a web page by avoiding to use the mouse and by using shortcuts, instead.</p>
<p>The bad thing about access keys is that they&#8217;re often hidden, by default, in the web pages. This doesn&#8217;t make sense to me.</p>
<p>Take the Twitter home page. How many of you knew that, during a search, you could press CTRL+ALT+n to display the &#8220;N new tweets since you started searching&#8221; or that you could press CTRL+ALT+s to visit your &#8220;settings&#8221; page? As a different example, let&#8217;s consider Wikipedia. Did you know that CTRL+ALT+e lead you to the &#8220;edit&#8221; mode? Probably not.</p>
<p>Resuming, &#8220;accesskey&#8221; shortcuts can be very useful. So why they are not displayed by default on the web pages? How should we know about them? And how could we ever remember all of them?</p>
<p>Long time ago, I found <a href="http://blog.andrewbeacock.com/2007/06/firefox-hack-to-display-accesskey.html" target="_blank">this post </a>on how to display the &#8220;accesskey&#8221; keyboard shortcuts in Firefox and I used it for a while. But I&#8217;ve recently fallen in love with Google Chrome and I was wondering if the same feature was already available.</p>
<p>At first, I googled for a quick solution and I couldn&#8217;t find anything really useful. Then, <a href="http://superuser.com/questions/141142/displaying-the-accesskey-keyboard-shortcuts-in-chrome-mac" target="_blank">I asked on Superuser if what I wanted was somehow possible</a>. After a couple of hours, someone answered my question, claiming he created a new Chrome extension just for that. I must admit I was more impressed by the rapidity of the answer than by the answer itself. If this guy could read my specification and implement a solution in such a short time, there was only one possible consequence: <strong>&#8220;Creating extension for Google Chrome is easy&#8221;</strong>.</p>
<p>So, I tried by myself.</p>
<p>First of all, I had a look <a href="http://code.google.com/chrome/extensions/getstarted.html" target="_blank">to the &#8220;Getting Started&#8221; section of the Chrome extensions documentation</a>. As expected, everything was extremely simple. To implement the &#8220;accesskey&#8221; shortcuts, it took me no more than five minutes. Literally. And now my Twitter page looks like:</p>
<p style="text-align:center;"><a href="http://aloiroberto.files.wordpress.com/2010/06/screen-shot-2010-06-11-at-11-59-19-pm.png"><img class="aligncenter size-medium wp-image-339" title="My new Twitter Home Page" src="http://aloiroberto.files.wordpress.com/2010/06/screen-shot-2010-06-11-at-11-59-19-pm.png?w=300&#038;h=173" alt="" width="300" height="173" /></a></p>
<p>Can you see the pink characters close to the links? They are all available &#8220;accesskey&#8221; shortcuts, a piece of information that was already embedded in the web page but that has just been hidden. Let&#8217;s see how can we make it visible again via a brand new Google Chrome Extension.</p>
<p>First of all, <strong>create a new folder</strong> somewhere in your hard drive and call it &#8220;shortcuts&#8221;.</p>
<p>Every Chrome extension is characterized by a &#8220;manifest&#8221; file, written in json, reporting the &#8220;properties&#8221; of the extension itself. Inside the &#8220;shortcuts&#8221; folder, <strong>create a new file, named &#8220;manifest.json&#8221;</strong>:</p>
<pre>{</pre>
<pre>  "name": "Shortcuts",</pre>
<pre>  "version": "1.0",</pre>
<pre>  "description": "Display the accesskey shortcuts.",</pre>
<pre>  "content_scripts": [{</pre>
<pre>    "matches": ["http://*/*", "https://*/*"],</pre>
<pre>    "css": ["style.css"]</pre>
<pre>  }]</pre>
<pre>}</pre>
<p>Apart from the name, the version number and the description of the extension, you can notice a &#8220;content_scripts&#8221; property. This is used to &#8220;inject&#8221; some code automatically every time a web page is displayed. In our case, we simply want to apply some specific CSS properties to the pages. The &#8220;matches&#8221; section tells Chrome to apply the transformation to every page using the http or the https protocol.</p>
<p>Now, we just need to <strong>create a style.css file</strong> (inside the same &#8220;shortcuts&#8221; folder) containing the needed stylistic information:</p>
<pre>a[accesskey]:after,</pre>
<pre>button[accesskey]:after,</pre>
<pre>input[accesskey]:after,</pre>
<pre>label[accesskey]:after,</pre>
<pre>legend[accesskey]:after,</pre>
<pre>textarea[accesskey]:after {</pre>
<pre>  margin-left: 0.3em;</pre>
<pre>  color: Plum;</pre>
<pre>  content: "[" attr(accesskey) "]";</pre>
<pre>}</pre>
<p>That&#8217;s all folks. We&#8217;re done. We can just install our brand new Google Chrome Extensions by visiting the URL:</p>
<address>chrome://extension</address>
<p>and clicking on the &#8220;Load Unpacked Extension&#8221; button.</p>
<p>Using the same strategy, it is obviously possible to apply different CSS transformations. Imagine for a second that you would like to hide all the images from a web page. A CSS like the following would do the job:</p>
<pre>img {</pre>
<pre>  display: none;</pre>
<pre>}</pre>
<p>Hope this help.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aloiroberto.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aloiroberto.wordpress.com/338/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=338&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aloiroberto.wordpress.com/2010/06/12/how-to-display-accesskey-shortcuts-in-google-chrome-and-much-more/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c20f7f4a8aa455aa6e0c2a0092883cd0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">prof3ta</media:title>
		</media:content>

		<media:content url="http://aloiroberto.files.wordpress.com/2010/06/screen-shot-2010-06-11-at-11-59-19-pm.png?w=300" medium="image">
			<media:title type="html">My new Twitter Home Page</media:title>
		</media:content>
	</item>
		<item>
		<title>Numbered lists in Emacs</title>
		<link>http://aloiroberto.wordpress.com/2010/04/10/numbered-lists-in-emacs/</link>
		<comments>http://aloiroberto.wordpress.com/2010/04/10/numbered-lists-in-emacs/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 12:35:51 +0000</pubDate>
		<dc:creator>Roberto Aloi</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[manual]]></category>
		<category><![CDATA[numbered list]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://aloiroberto.wordpress.com/?p=308</guid>
		<description><![CDATA[Imagine that you&#8217;re using Emacs and you have a list of items that you would like to convert into a numbered list. We&#8217;re going from: first second third To: 1. first 2. second 3. third Obviously, there are many ways to achieve this, but one is to use the Emacs Keyboard Macro Counter. Put the &#8230; <a href="http://aloiroberto.wordpress.com/2010/04/10/numbered-lists-in-emacs/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=308&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Imagine that you&#8217;re using Emacs and you have a list of items that you would like to convert into a numbered list.</p>
<p>We&#8217;re going from:</p>
<blockquote><p>first</p>
<p>second</p>
<p>third</p></blockquote>
<p>To:</p>
<blockquote><p>1. first</p>
<p>2. second</p>
<p>3. third</p></blockquote>
<p>Obviously, there are many ways to achieve this, but one is to use <a href="http://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macro-Counter.html#Keyboard-Macro-Counter" target="_blank">the Emacs Keyboard Macro Counter</a>.</p>
<div id="_mcePaste">
<ul>
<li>Put the cursor one line ABOVE your list.</li>
<li>Start a macro: `F3`</li>
<li>Insert the counter value: `C-x C-k C-i`. A 0 will appear</li>
<li>Insert the DOT and a space: `.`</li>
<li>Move  the cursor to the next line</li>
<li>Stop the macro: `F4`</li>
<li>Select your list</li>
<li>`M-x apply-macro-to-region-lines`</li>
<li>You can delete the 0 you added on the top and enjoy <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aloiroberto.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aloiroberto.wordpress.com/308/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=308&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aloiroberto.wordpress.com/2010/04/10/numbered-lists-in-emacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c20f7f4a8aa455aa6e0c2a0092883cd0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">prof3ta</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP Mode for Emacs &#8211; Flymake</title>
		<link>http://aloiroberto.wordpress.com/2010/02/02/php-mode-for-emacs-flymake/</link>
		<comments>http://aloiroberto.wordpress.com/2010/02/02/php-mode-for-emacs-flymake/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 18:29:46 +0000</pubDate>
		<dc:creator>Roberto Aloi</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[environment]]></category>
		<category><![CDATA[flymake]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[unused]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://aloiroberto.wordpress.com/?p=270</guid>
		<description><![CDATA[I always find flymake extremely useful when editing code in Emacs. In this period, I&#8217;m working a bit with PHP and I&#8217;ve immediately thought that enabling flymake for Emacs was indeed a good idea. Well, someone has apparently already thought about it, so everything you need to know about it is explained here. I tried &#8230; <a href="http://aloiroberto.wordpress.com/2010/02/02/php-mode-for-emacs-flymake/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=270&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I always find <strong>flymake </strong>extremely useful when editing code in Emacs.</p>
<p>In this period, I&#8217;m working a bit with PHP and I&#8217;ve immediately thought that enabling flymake for Emacs was indeed a good idea.</p>
<p>Well, <a href="http://twitter.com/sachac" target="_blank">someone</a> has apparently already thought about it, so everything you need to know about it is explained <a href="http://sachachua.com/wp/2008/07/emacs-and-php-on-the-fly-syntax-checking-with-flymake/" target="_blank">here</a>.</p>
<p>I tried it on my machine and it worked like a charm. Combined with some <a href="http://aloiroberto.wordpress.com/2009/12/09/php-and-emacs-how-to-browse-documentation/" target="_blank">PHP documentation integrated in Emacs</a>, I&#8217;m now starting to have a complete and powerful development environment for PHP.</p>
<p>I&#8217;m now wondering if there&#8217;s any way to get this a step forward. First of all, I&#8217;m trying to identify <em>errors</em> different from the parsing ones. What I would really love, for example, is to have Emacs showing me all the <strong>unused variables</strong> in a PHP file. If you have any idea on how to achieve this, don&#8217;t be shy and share your thoughts with me, as a post comment or, if you prefer, as a private e-mail or through <a href="http://twitter.com/prof3ta" target="_blank">twitter</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aloiroberto.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aloiroberto.wordpress.com/270/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=270&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aloiroberto.wordpress.com/2010/02/02/php-mode-for-emacs-flymake/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c20f7f4a8aa455aa6e0c2a0092883cd0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">prof3ta</media:title>
		</media:content>
	</item>
		<item>
		<title>Gmail Tips by Google</title>
		<link>http://aloiroberto.wordpress.com/2010/01/13/gmail-tips-by-google/</link>
		<comments>http://aloiroberto.wordpress.com/2010/01/13/gmail-tips-by-google/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 21:28:34 +0000</pubDate>
		<dc:creator>Roberto Aloi</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://aloiroberto.wordpress.com/2010/01/13/gmail-tips-by-google/</guid>
		<description><![CDATA[Google has just released a series of really interesting tips for Gmail. Some of them look extremely cool: Are you already using the full power of Gmail?<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=245&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Google <a href="http://www.google.com/mail/help/tips.html" target="_blank">has just released</a> a series of really interesting tips for Gmail. Some of them look extremely cool:</p>
<p>Are you already using the full power of Gmail?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aloiroberto.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aloiroberto.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=245&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aloiroberto.wordpress.com/2010/01/13/gmail-tips-by-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c20f7f4a8aa455aa6e0c2a0092883cd0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">prof3ta</media:title>
		</media:content>
	</item>
		<item>
		<title>Joomla and Gmail How To</title>
		<link>http://aloiroberto.wordpress.com/2009/12/23/joomla-and-gmail-how-to/</link>
		<comments>http://aloiroberto.wordpress.com/2009/12/23/joomla-and-gmail-how-to/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 12:53:59 +0000</pubDate>
		<dc:creator>Roberto Aloi</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[1.5.6]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[googlemail]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[joomla!]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[mailer]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpmailer]]></category>
		<category><![CDATA[send]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[to]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[version]]></category>

		<guid isPermaLink="false">http://aloiroberto.wordpress.com/?p=211</guid>
		<description><![CDATA[A couple of weeks ago, I decided to use Gmail as SMTP server to send emails from my Joomla website. Here is explained what I did to make everything working. First of all, I edited my configuration.php file to contain the following settings: var $mailer = 'SMTP Server'; var $mailfrom = 'MY_GMAIL_ADDRESS'; var $smtpauth = '1'; &#8230; <a href="http://aloiroberto.wordpress.com/2009/12/23/joomla-and-gmail-how-to/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=211&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A couple of weeks ago, I decided to use Gmail as SMTP server to send emails from my Joomla website. Here is explained what I did to make everything working.</p>
<p>First of all, I edited my <strong>configuration.php</strong> file to contain the following settings:</p>
<pre>	var $mailer = 'SMTP Server';
	var $mailfrom = 'MY_GMAIL_ADDRESS';
	var $smtpauth = '1';
	var $smtpuser = 'MY_GMAIL_ADDRESS';
	var $smtppass = 'MY_GMAIL_PASSWORD';
	var $smtphost = 'ssl://smtp.gmail.com:465';</pre>
<p>Then, I patched the <strong>libraries/phpmailer/phpmailer.php</strong> file by editing the <em>SmtpConnect</em> function. In the specific I changed the lines:</p>
<pre>if(strstr($hosts[$index], ":"))
        list($host, $port) = explode(":", $hosts[$index]);</pre>
<p>into:</p>
<pre>if (preg_match('#(([a-z]+://)?[^:]+):(\d+)#i', $hosts[$index], $match))
{
        $host = $match[1];
        $port = $match[3];
}</pre>
<p>Please note that I&#8217;m using Joomla version 1.5.6. This trick is based on <a href="http://byet.net/showthread.php?t=7142" target="_blank">the following discussion</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aloiroberto.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aloiroberto.wordpress.com/211/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=211&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aloiroberto.wordpress.com/2009/12/23/joomla-and-gmail-how-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c20f7f4a8aa455aa6e0c2a0092883cd0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">prof3ta</media:title>
		</media:content>
	</item>
		<item>
		<title>How to set up UNIX permission for files and directories. Cleverly.</title>
		<link>http://aloiroberto.wordpress.com/2009/12/04/how-to-set-up-unix-permission-for-files-and-directories/</link>
		<comments>http://aloiroberto.wordpress.com/2009/12/04/how-to-set-up-unix-permission-for-files-and-directories/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 11:04:43 +0000</pubDate>
		<dc:creator>Roberto Aloi</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[joomla!]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[directories]]></category>
		<category><![CDATA[safe]]></category>
		<category><![CDATA[chmod]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[moodle]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[recursive]]></category>
		<category><![CDATA[recursively]]></category>

		<guid isPermaLink="false">http://aloiroberto.wordpress.com/?p=153</guid>
		<description><![CDATA[Sometimes you need to recursively set a specific UNIX permission for a whole set of files and/or directories. And you want to have a different permission for your files and for your directories. For example, when installing a CMS like Joomla (or Moodle), you might want to recursively set the UNIX permissions to 700 for &#8230; <a href="http://aloiroberto.wordpress.com/2009/12/04/how-to-set-up-unix-permission-for-files-and-directories/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=153&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://aloiroberto.files.wordpress.com/2009/12/bsd-linux-devil.jpg"><img class="aligncenter size-medium wp-image-160" title="BSD Devil" src="http://aloiroberto.files.wordpress.com/2009/12/bsd-linux-devil.jpg?w=300&#038;h=225" alt="" width="300" height="225" /></a></p>
<p>Sometimes you need to recursively set a specific UNIX permission for a whole set of files and/or directories. And you want to have a different permission for your <strong>files</strong> and for your <strong>directories</strong>.</p>
<p>For example, when installing a CMS like Joomla (or Moodle), you might want to recursively set the UNIX permissions to <strong>700</strong> for all the <strong>directories</strong> contained in your <strong>web root</strong> (say, your <em>htdocs</em>). And you want to do the same for all the <strong>files</strong>, but this time to <strong>600</strong>.</p>
<p>This can easily be achieved by entering your <strong>htdocs</strong> and by using the <strong>find</strong> command:</p>
<pre>find . -type d -exec chmod 700 {} +
find . -type f -exec chmod 600 {} +</pre>
<p>The commands should be read as follows:</p>
<p>&#8220;Read everything in the current directory, recursively. For every single item that is of type <em>directory </em>(<em>file</em>) change permissions to <em>700 </em>(<em>600</em>).&#8221;</p>
<p>The <em>{} + </em>option (refer to the find <strong>man</strong> page) runs the specified  command  on	      the  selected  files, but the command line is built by appending	      each selected file name at the end.</p>
<p>More information about UNIX permissions <a href="http://en.wikipedia.org/wiki/File_system_permissions" target="_blank">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aloiroberto.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aloiroberto.wordpress.com/153/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=153&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aloiroberto.wordpress.com/2009/12/04/how-to-set-up-unix-permission-for-files-and-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c20f7f4a8aa455aa6e0c2a0092883cd0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">prof3ta</media:title>
		</media:content>

		<media:content url="http://aloiroberto.files.wordpress.com/2009/12/bsd-linux-devil.jpg?w=300" medium="image">
			<media:title type="html">BSD Devil</media:title>
		</media:content>
	</item>
		<item>
		<title>Php from Command Line</title>
		<link>http://aloiroberto.wordpress.com/2009/10/17/php-from-command-line/</link>
		<comments>http://aloiroberto.wordpress.com/2009/10/17/php-from-command-line/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 12:33:30 +0000</pubDate>
		<dc:creator>Roberto Aloi</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[execute]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://aloiroberto.wordpress.com/?p=139</guid>
		<description><![CDATA[A really simple, still useful tip for php developers. It is possible to execute a php command directly from the command line by doing the following: php -r 'COMMAND' For example: php -r 'echo substr("hello world", 6);' Enjoy!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=139&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A really simple, still useful tip for php developers.</p>
<p>It is possible to execute a php command directly from the command line by doing the following:</p>
<p><code>php -r 'COMMAND'</code></p>
<p>For example:</p>
<p><code>php -r 'echo substr("hello world", 6);'</code></p>
<p>Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aloiroberto.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aloiroberto.wordpress.com/139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=139&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aloiroberto.wordpress.com/2009/10/17/php-from-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c20f7f4a8aa455aa6e0c2a0092883cd0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">prof3ta</media:title>
		</media:content>
	</item>
		<item>
		<title>Erlang Quickcheck Design Patterns &#8211; Black Box</title>
		<link>http://aloiroberto.wordpress.com/2009/10/07/erlang-quickcheck-design-patterns-black-box/</link>
		<comments>http://aloiroberto.wordpress.com/2009/10/07/erlang-quickcheck-design-patterns-black-box/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 18:06:05 +0000</pubDate>
		<dc:creator>Roberto Aloi</dc:creator>
				<category><![CDATA[Erlang]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[design pattern]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[ets]]></category>
		<category><![CDATA[quickcheck]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://aloiroberto.wordpress.com/?p=113</guid>
		<description><![CDATA[Name Black Box Also Known As ETS Driven Testing Intent When writing Quickcheck unit tests for an Erlang application, it usually happens that you require to stub some external application, since you&#8217;re not interested in System Tests, but you want to test your application as a mere black box. Motivation You want complete control on &#8230; <a href="http://aloiroberto.wordpress.com/2009/10/07/erlang-quickcheck-design-patterns-black-box/">Continue reading <span class="meta-nav">&#187;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=113&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><strong>Name</strong><br />
Black Box</p>
<p><strong>Also Known As</strong><br />
ETS Driven Testing</p>
<p><strong>Intent</strong><br />
When writing <em>Quickcheck</em> <strong>unit tests</strong> for an Erlang application, it usually happens that you require to stub some external application, since you&#8217;re not interested in <strong>System Tests</strong>, but you want to test your application as a mere <em>black box</em>.</p>
<p><strong>Motivation</strong><br />
You want complete control on the results provided by your stubs, so that you can successfully check the properties you need for your application.</p>
<p><strong>Sample Code</strong></p>
<p>In your quickcheck module, just define in your state the results you need, together with their default value:</p>
<pre>-record(state, {stub_result = true}).</pre>
<p>Define the initial state as follows:</p>
<pre>
initial_state() -&gt;
    init.

initial_state_data() -&gt;
    #state{}.
</pre>
<p>In your property, create an ETS table containing the results (don&#8217;t forget to delete it after running the tests) and call the <em>run_commands</em> function by passing an extra parameter:</p>
<pre>
prop_commands() -&gt;
    ?FORALL({Cmds, State}, custom_commands(),
            ?TRAPEXIT(begin
                          results = ets:new(results, [named_table, set, public]),
                          ets:insert(results, {stub_result, State#state.stub_result}),
                          {H,S,Res} = eqc_fsm:run_commands(?MODULE, Cmds, [{var, stub_result}]),
                          true = ets:delete(results),
                          ...
</pre>
<p>The <em>custom_commands</em> function is the place where you set the list of available results:</p>
<pre>
custom_commands() -&gt;
    ?LET(State,
         #state{stub_result = oneof([true, false])},
         {more_commands(100, eqc_fsm:commands(?MODULE, {init, State})), State}).
</pre>
<p>You can check the result in your postconditions, as follows:</p>
<pre>
postcondition(_From, _To, S, {call, _, _, _}, R) -&gt;
    S#state.stub_result == R.
</pre>
<p>Obviously, your stubs need to contain something like:</p>
<pre>
stubbed_function() -&gt;
    ets:lookup_element(results, stub_result, 2).
</pre>
<p><strong>Consequences</strong><br />
Your tests will be able to cover a bigger number of code lines (<a target="_blank" href="http://en.wikipedia.org/wiki/Lemmings_(video_game)">lemmings</a>).</p>
<p><strong>Thanks</strong><br />
Thanks to <em>Master</em> Magnus Henoch for his help.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aloiroberto.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aloiroberto.wordpress.com/113/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aloiroberto.wordpress.com&#038;blog=6646513&#038;post=113&#038;subd=aloiroberto&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aloiroberto.wordpress.com/2009/10/07/erlang-quickcheck-design-patterns-black-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c20f7f4a8aa455aa6e0c2a0092883cd0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">prof3ta</media:title>
		</media:content>
	</item>
	</channel>
</rss>
