<?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>Calvin Freitas &#187; Howto</title>
	<atom:link href="http://calvinf.com/blog/category/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://calvinf.com</link>
	<description>Web Consulting, Development, and Marketing Services for Your Small Business</description>
	<lastBuildDate>Tue, 06 Jul 2010 06:25:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Installing, Configuring, and Using the XHP PHP Extension by Facebook</title>
		<link>http://calvinf.com/blog/2010/installing-configuring-and-using-the-xhp-php-extension-by-facebook/</link>
		<comments>http://calvinf.com/blog/2010/installing-configuring-and-using-the-xhp-php-extension-by-facebook/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 00:07:08 +0000</pubDate>
		<dc:creator>Calvin Freitas</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[XHP]]></category>

		<guid isPermaLink="false">http://calvinf.com/?p=262</guid>
		<description><![CDATA[Facebook announced the release of XHP yesterday. It is an extension for PHP which provides enhancements to the PHP language syntax and gives the language some convenient capabilities. In this post I will provide you links to the essential sources of information about XHP, show some XHP sample code, and discuss the installation process for [...]]]></description>
			<content:encoded><![CDATA[<p>Facebook <a href="http://www.facebook.com/notes/facebook-engineering/xhp-a-new-way-to-write-php/294003943919">announced the release of XHP</a> yesterday.  It is an extension for PHP which provides enhancements to the PHP language syntax and gives the language some convenient capabilities.</p>
<p>In this post I will provide you links to the essential sources of information about XHP, show some XHP sample code, and discuss the installation process for XHP on Ubuntu with Apache and PHP5.</p>
<p><strong>The Essential Information</strong><br />
<a href="http://github.com/facebook/xhp">Download XHP at GitHub</a><br />
<a href="http://wiki.github.com/facebook/xhp/">How XHP Works</a><br />
<a href="http://wiki.github.com/facebook/xhp/building-xhp">Building XHP</a><br />
<a href="http://wiki.github.com/facebook/xhp/configuration">Configuring XHP</a></p>
<p><b>Example XHP Sample Code (<a href="http://xhp.calvinf.com/" target="_blank">View Code in Action</a>):</b></p>
<pre class="brush: php;">&lt;?php
require_once('/home/cal/facebook-xhp-290b185/php-lib/init.php');
$name  = 'Calvin Freitas';
$title = &quot;{$name} loves XHP!&quot;;
$url   = 'http://calvinf.com/';

$permalink = 'http://wp.me/pcoLC-4e';

#create a &lt;head&gt; element
$head =
  &lt;head&gt;
   &lt;title&gt;{$title}&lt;/title&gt;
  &lt;/head&gt;;

#create a div
$div =
  &lt;div id=&quot;header&quot;&gt;
    &lt;h1&gt;{$title}&lt;/h1&gt;
  &lt;/div&gt;;

$body =
  &lt;body&gt;
    {$div}
    &lt;div&gt;
      &lt;p&gt;My name is {$name} and you should go visit &lt;a href={$url}&gt;my website&lt;/a&gt; now.&lt;/p&gt;
      &lt;p&gt;Read my &lt;a href={$permalink}&gt;guide to installing XHP on Ubuntu&lt;/a&gt;. It includes the source code for this page. Comments and corrections are welcome.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/body&gt;;

echo
&lt;html&gt;
  {$head}
  {$body}
&lt;/html&gt;;
?&gt;</pre>
<p><b>A few syntax notes</b><br />
XHP forces you to properly nest tags &#8212; make sure you close them properly or it won&#8217;t compile and it will throw errors.  Because XHP auto-escapes, when you&#8217;re creating a link (such as in an <em>a</em> element), you don&#8217;t need to put quotes around it.</p>
<pre class="brush: php;">&lt;a href={$permalink}&gt;guide to installing XHP on Ubuntu&lt;/a&gt;</pre>
<p><strong>Installing XHP on Ubuntu</strong><br />
Server: Ubuntu 9.10 running on a slice at the Rackspace Cloud.<br />
Web server: Apache 2<br />
<a href="http://articles.slicehost.com/2008/4/25/ubuntu-hardy-installing-apache-and-php5">Apache installation guide</a> (Slicehost article, but generally applicable)</p>
<p>Below I will go into more detail about the installation process.<br />
<span id="more-262"></span><br />
There are packages for all the prerequisites in Ubuntu (installation will be similar on Debian, though package names my vary).</p>
<p><code>sudo apt-get install php5 php5-common php5-cli php5-dev libapache2-mod-php5</code><br />
<code>sudo apt-get install build-essential gcc flex bison re2c</code></p>
<p>The package manager will include other prerequisite packages.</p>
<p>After you&#8217;ve installed these packages, download the <a href="http://github.com/facebook/xhp/downloads">latest tagged release of XHP</a> from GitHub to your server.</p>
<p>Then, you&#8217;ll need to make it.  Unzip/untar the file, go to that directory, and run the following commands. (Use <em>sudo</em> as necessary.)<br />
<code>phpize<br />
./configure<br />
make<br />
make install<br />
</code></p>
<p>Note regarding <span class="code">make test</span>: the tests failed for me because it wasn&#8217;t finding my currently installed PHP5 modules. I ran <span class="code">make install</span> and it worked anyway.  There should be a way to include the modules path in the compilation, but at this time I have not found it.</p>
<p>After installing the module, you must configure Apache to include the XHP module in the php.ini file.  On my system, the file is located in <span class="code">/etc/php5/apache2</span>. Find the line with <span class="code">extension_dir</span> &#8212; mine is the following:<br />
<code>extension_dir = "/usr/lib/php5/20060613/"</code></p>
<p>In /etc/php5/apache2/conf.d, create a file called xhp.ini.<br />
<b>xhp.ini</b><br />
<code>#load xhp<br />
extension=xhp.so</code></p>
<p>Now, at this point everything should work, but some users are reporting <a href="http://github.com/facebook/xhp/issues#issue/2">issues with XHP on Ubuntu</a> systems, but there is a solution &#8211; you may need to include files from the php-lib folder (in the source code folder where you ran make).  See the &#8220;require_once&#8221; function used in the sample code above.</p>
]]></content:encoded>
			<wfw:commentRss>http://calvinf.com/blog/2010/installing-configuring-and-using-the-xhp-php-extension-by-facebook/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HowTo: Make IE8 Display Your Website in IE7 Compatibility Mode</title>
		<link>http://calvinf.com/blog/2009/howto-make-ie8-display-your-website-in-ie7-compatability-mode/</link>
		<comments>http://calvinf.com/blog/2009/howto-make-ie8-display-your-website-in-ie7-compatability-mode/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 05:58:33 +0000</pubDate>
		<dc:creator>Calvin Freitas</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[compatibility]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://calvinf.com/?p=84</guid>
		<description><![CDATA[To make your website or web page look the same in Internet Explorer 8 as it does in Internet Explorer 7, include the following line in the &#60;head&#62; tag on your page. &#60;meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible" /&#62; This code tells IE8 to render the page in IE7 compatibility mode. That way you can just worry about [...]]]></description>
			<content:encoded><![CDATA[<p>To make your website or web page look the same in Internet Explorer 8 as it does in Internet Explorer 7, include the following line in the &lt;head&gt; tag on your page.</p>
<p><code>&lt;meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible" /&gt;</code></p>
<p>This code tells IE8 to render the page in IE7 compatibility mode.  That way you can just worry about making your site work in IE6 and IE7 and not trying to support three concurrent generations of the web browser.</p>
<p>Microsoft has more information about <a href="http://blogs.msdn.com/ie/archive/2008/08/27/introducing-compatibility-view.aspx"> Compatibility View for IE8</a> on the <a href="http://blogs.msdn.com/ie/">IEBlog</a>.</p>
<p>You can also tell IE8 to apply compatibility mode by setting the header in your web server.  In Apache, you can do this by including the following line in your site config file (or apply it just to a specific directory or page if needed).  Make sure you have the Headers module installed.</p>
<p><code>Header set X-UA-Compatible "IE=EmulateIE7"</code></p>
<p>More information is available in the <a href="http://msdn.microsoft.com/en-us/ie/cc405106.aspx">Internet Explorer Compatibility Center</a>.</p>
<p>(Thanks to <a href="http://twitter.com/kevmoo">@kevmoo</a> (<a href="http://www.linkedin.com/in/kevinrmoore">Kevin Moore</a>) for initially answering my question about this topic.)</p>
]]></content:encoded>
			<wfw:commentRss>http://calvinf.com/blog/2009/howto-make-ie8-display-your-website-in-ie7-compatability-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wireless Audio w/ Airport Express and Airfoil for Windows or Mac</title>
		<link>http://calvinf.com/blog/2008/wireless-audio-w-airport-express-and-airfoil-for-windows-or-mac/</link>
		<comments>http://calvinf.com/blog/2008/wireless-audio-w-airport-express-and-airfoil-for-windows-or-mac/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 23:52:02 +0000</pubDate>
		<dc:creator>Calvin Freitas</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[AirFoil]]></category>
		<category><![CDATA[AirPort Express]]></category>
		<category><![CDATA[AirTunes]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[FLAC]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://calvinf.com/blog/2008/wireless-audio-w-airport-express-and-airfoil-for-windows-or-mac/</guid>
		<description><![CDATA[I recently acquired an Apple Airport Express (gracias a kamyn1) with the intent of wirelessly broadcasting music/audio from my computer (one side of the room) to my home stereo system (other side of the room) using the AirTunes functionality. This has been a good solution for me as it&#8217;s designed for iTunes and that&#8217;s what [...]]]></description>
			<content:encoded><![CDATA[<p>I recently acquired an <a href="http://www.apple.com/airportexpress/">Apple Airport Express</a> (<em>gracias a <a href="http://kamyn1.wordpress.com/">kamyn1</a></em>) with the intent of wirelessly broadcasting music/audio from my computer (one side of the room) to my home stereo system (other side of the room) using the AirTunes functionality.  This has been a good solution for me as it&#8217;s designed for <a href="http://www.apple.com/itunes/">iTunes</a> and that&#8217;s what I primarily use to play music on my computer.</p>
<p><a href='http://calvinf.com/wp/wp-content/uploads/2008/03/itunes_prefs_airtunes.png' title='iTunes Preferences - AirTunes'><img src='http://calvinf.com/wp/wp-content/uploads/2008/03/itunes_prefs_airtunes.thumbnail.png' alt='iTunes Preferences - AirTunes' align="right" /></a>First, you need to install the Airport Express.  This can be a difficult process depending on your level of experience with wireless networking; if you&#8217;re having trouble, visit the <a href="http://www.apple.com/support/airport/">Apple Support page for the AirPort</a>.  To use the device, begin by running the installation software that comes with the device (or download it from <a href="http://www.apple.com/support/downloads/">Apple</a>) on your computer.  You will also need to connect the Airport Express to your stereo; for this, you can either use a 1/8&#8243; to RCA connector or 1/8&#8243; to Optical/Toslink connector and hook it to your stereo receiver or other audio input.</p>
<p><span id="more-8"></span><a href='http://calvinf.com/wp/wp-content/uploads/2008/03/itunes_airtunes.png' title='iTunes w/ AirTunes'><img src='http://calvinf.com/wp/wp-content/uploads/2008/03/itunes_airtunes.thumbnail.png' alt='iTunes w/ AirTunes' align='left' /></a>Once you&#8217;ve setup your wireless network and connected the Airport to your stereo, you can begin broadcasting music from your computer to your stereo using iTunes.  In iTunes, check <em>Edit->Preferences->Advanced</em> to make sure &#8220;Look for remote speakers connected with AirTunes&#8221; is selected.  In the bottom right-hand corner of the iTunes screen, a dropdown list will show the speakers iTunes is able to connect to.  It will allow you to select &#8220;Computer&#8221; to play audio through your computer speakers, and the list will also include the names of any identified Airport Express connections.  In my case, it shows as &#8220;Casa Express&#8221; so it&#8217;s ready to play.  Once I select &#8220;Casa Express,&#8221; iTunes connects and begins playing audio through the speakers connected to the Airport.<br clear="all" /></p>
<p>This works well for playing music from iTunes; however, I also want to be able to play other file types besides MP3, AAC, and Apple&#8217;s DRMed files; specifically, I want to be able to play <a href="http://en.wikipedia.org/wiki/Free_Lossless_Audio_Codec" title="Wikipedia: Free Lossless Audio Codec">FLAC</a> files.</p>
<p>Thanks to another attendee at <a href="http://www.saturdayhouse.org/">SaturdayHouse</a>, I discovered <a href="http://www.rogueamoeba.com/airfoil/">Airfoil</a>.  Here&#8217;s the description:</p>
<blockquote><p>With Airfoil for Windows [or Mac] you can take audio from any application and send to your AirPort Express units, as well as Apple TVs, and even other PCs and Macs running Airfoil Speakers! Transmit audio from Winamp, RealPlayer, and other media players. Send audio from Rhapsody, Yahoo Music, and other music stores. Even web-based applications like Pandora, Last.fm, can now be transmitted wirelessly.</p></blockquote>
<p>The good news about Airfoil is you can install a fully working demo version (<a href="http://www.rogueamoeba.com/airfoil/windows/">Windows</a>, <a href="http://www.rogueamoeba.com/airfoil/mac/">Mac</a>) in order to try it out before you buy it.  I downloaded it, installed both the Airfoil for Windows and Airfoil Speakers applications.</p>
<p>At this point, I discovered my used AirPort Express had an outdated firmware version that I needed to update.  No problem &#8212; I downloaded and ran the AirPort Express 6.3 firmware updater (<a href="http://www.apple.com/support/downloads/airportexpressfirmwareupdate63forwindows.html">Windows</a>, <a href="http://www.apple.com/support/downloads/airportexpressfirmwareupdate63formacosx.html">Mac</a>).  (Note: The Windows version didn&#8217;t work on Vista for me, but I had no trouble running the update from a Windows XP installation connected to the same wireless network.)</p>
<p><a href='http://calvinf.com/wp/wp-content/uploads/2008/03/winamp_mcs_screen.png' title='Winamp screenshot'><img src='http://calvinf.com/wp/wp-content/uploads/2008/03/winamp_mcs_screen.thumbnail.png' alt='Winamp screenshot' align='right' /></a>Now that I had Airfoil installed, I ran both the Airfoil and Airfoil Speakers applications.  I then booted up <a href="http://www.winamp.com/">Winamp</a> (<a href="http://www.winamp.com/player/features">features</a> include FLAC support) to try the wireless broadcast using a FLAC-rip of <a href="http://www.motioncitysoundtrack.com/">Motion City Soundtrack</a>&#8216;s album &#8220;Evin If It Kills Me.&#8221;<br clear="all" /></p>
<p><a href='http://calvinf.com/wp/wp-content/uploads/2008/03/airfoil_mcs_screen.png' title='Airfoil'><img src='http://calvinf.com/wp/wp-content/uploads/2008/03/airfoil_mcs_screen.png' alt='Airfoil' align='left' /></a>In Airfoil, I selected Winamp from the application list at the bottom of the screen.  Then I clicked the volume icon next to the name for my Airport Express (Casa Express) and adjusted the volume.  Airfoil informed me it needed to restart Winamp so I let it.  Once Winamp loaded back up, I pressed play again and then my stereo (which was already turned on and set to the channel the Airport Express is hooked to) began to play the Motion City Soundtrack album.<br clear="all" /></p>
<p>In the demo version, it starts to make noise on the sound after 10 minutes.  With the product fully working, I decided to give them my $25 so I can enjoy the benefits of the Airport Express with any application on my computer and not just iTunes.</p>
]]></content:encoded>
			<wfw:commentRss>http://calvinf.com/blog/2008/wireless-audio-w-airport-express-and-airfoil-for-windows-or-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
