<?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>Tom Reitz</title>
	<atom:link href="http://www.tom-reitz.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tom-reitz.com</link>
	<description>Tech Talk, Catholic Commentary, and American Activism</description>
	<lastBuildDate>Tue, 07 Dec 2010 09:42:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Calendar Syncing with iPhone and Mozilla Sunbird or Thunderbird/Lightning</title>
		<link>http://www.tom-reitz.com/2010/12/07/calendar-syncing-with-iphone-and-mozilla-sunbird-or-thunderbird-lightning/</link>
		<comments>http://www.tom-reitz.com/2010/12/07/calendar-syncing-with-iphone-and-mozilla-sunbird-or-thunderbird-lightning/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 09:22:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[CalDAV]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[lightning]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[sunbird]]></category>
		<category><![CDATA[sync]]></category>
		<category><![CDATA[thunderbird]]></category>
		<category><![CDATA[WebDAV]]></category>

		<guid isPermaLink="false">http://www.tom-reitz.com/?p=180</guid>
		<description><![CDATA[After an unacceptably long vacation from blogging, I&#8217;m back. And I&#8217;ll try to post goodies here more often!
Today&#8217;s post is a rant followed by a technical solution that hopefully some will find useful. You can skip past the rant by clicking here  
The Rant: Cloud Storage and Sync
I tend to use a lot of [...]]]></description>
			<content:encoded><![CDATA[<p>After an unacceptably long vacation from blogging, I&#8217;m back. And I&#8217;ll try to post goodies here more often!</p>
<p>Today&#8217;s post is a rant followed by a technical solution that hopefully some will find useful. You can skip past the rant by <a href="#theproblem">clicking here</a> <img src='http://www.tom-reitz.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' title="Calendar Syncing with iPhone and Mozilla Sunbird or Thunderbird/Lightning" /> </p>
<h2 style="padding: 20px 2px 10px 2px;">The Rant: Cloud Storage and Sync</h2>
<p><a href="http://www.tom-reitz.com/wp-content/uploads/2010/12/iphone.jpg"><img class="alignleft size-full wp-image-195" title="iPhone" src="http://www.tom-reitz.com/wp-content/uploads/2010/12/iphone.jpg" alt="iPhone" width="122" /></a>I tend to use a lot of open source software. It&#8217;s free, and it&#8217;s usually as well or better built than commercial software. It does sometimes require a bit of technical knowledge and troubleshooting though.</p>
<p>I also own an iPhone. In some ways, I really love it. I can check on all my websites, servers, social streams, emails, and calls from one compact gadget. From anywhere. However, the iPhone is unfortunately a very closed sort of platform. Apple controls all of the software available for the device, and chooses not to provide some seemingly basic features &#8211; like accessing files stored on the phone from your computer.</p>
<p>Now almost anybody you ask will say that you should just sync all your data to the cloud. Then you can access it from your computer easily (or from anywhere else). But I have a problem with that.</p>
<p><a href="http://www.tom-reitz.com/wp-content/uploads/2010/12/1216139826649869464rgtaylor_csc_net_wan_cloud.svg_.med_.png"><img class="size-full wp-image-194 alignright" style="margin: 8px;" title="Cloud" src="http://www.tom-reitz.com/wp-content/uploads/2010/12/1216139826649869464rgtaylor_csc_net_wan_cloud.svg_.med_.png" alt="Cloud Storage" width="300" height="158" /></a>When you sync your data to the cloud, you&#8217;re sending it to a server that&#8217;s controlled by a third party. Any of the following things can then happen:</p>
<ol>
<li style="padding-bottom: 10px;">Some nosy admin on the other end can inadvertently or purposely start looking through your data. He could get fired, but only if his boss finds out.</li>
<li style="padding-bottom: 10px;">The third party could have its servers compromised, by hackers for instance. Oops! now <em>bl4sterz.ru</em> knows your every personal detail.</li>
<li style="padding-bottom: 10px;">By storing your data, the third party in a sense &#8220;owns&#8221; it. If they decide to start embedding ads in your data, or charging a monthly fee to use their service, what can you do about it?</li>
</ol>
<p>For these sorts of reasons, I never send information to third parties on the web unless I&#8217;m basically comfortable with that information being publicly available to all. Yes, that means you, Facebook. And Twitter. Et cetera.</p>
<h2 style="padding: 20px 2px 10px 2px;" id="theproblem">The Problem: iPhone/Lightning Calendar Sync, without the Cloud</h2>
<p>OK, enough rant about cloud storage services. Here&#8217;s why this all came up:</p>
<p><a href="http://www.tom-reitz.com/wp-content/uploads/2010/12/mozilla_thunderbird.png"><img class="alignright size-medium wp-image-198" style="margin: 2px 8px;" title="Mozilla Thunderbird" src="http://www.tom-reitz.com/wp-content/uploads/2010/12/mozilla_thunderbird-282x300.png" alt="Mozilla Thunderbird" width="141" /></a>As I said before, I have an iPhone. I also use Mozilla&#8217;s Thunderbird email browser with a calendar plugin called Lightning to manage my appointments and such. I would like to have the calendar on the iPhone sync with Lightning. (Mozilla Sunbird is basically the same as Lightning for Thunderbird &#8211; it&#8217;s made by the same folks and has the same functionality. Sunbird just lacks the email client.)</p>
<p>If you Google how to do this, everyone says that you should sync both Lightning and the iPhone with Google calendar. But that&#8217;s a cloud solution: I don&#8217;t want Google to know all my appointments!</p>
<h2 style="padding: 20px 2px 10px 2px;">The Solution: Set Up Your Own CalDAV server</h2>
<p><a href="http://www.tom-reitz.com/wp-content/uploads/2010/12/1194984495549320725tabella_architetto_franc_01.svg_.thumb_.png"><img class="alignleft size-full wp-image-199" style="margin: 4px 8px;" title="CalDAV" src="http://www.tom-reitz.com/wp-content/uploads/2010/12/1194984495549320725tabella_architetto_franc_01.svg_.thumb_.png" alt="CalDAV" width="100" height="100" /></a>Faced with this problem, I&#8217;ve worked out a nice solution: install your own CalDAV server. You can do this on either your own local network (more secure), or any webserver you have access to remotely (easier to share calendars with many people).</p>
<p>CalDAV is an implementation of a web standard called WebDAV which makes it easy to store files, calendars, addressbooks, and other information in a format that is easily readable by many devices and platforms. CalDAV specifically can identify users and store events &#8211; including recurring events and alerts. You can set up shared calendars, configure read-write access for different users to different calendars. In short, CalDAV can provide enterprise-level calendaring functionality much like Microsoft&#8217;s Exchange server.</p>
<p>There are a number of CalDAV servers available, both free and commercial. After assessing several, I went with <a title="DAViCal" href="http://www.davical.org/" target="_blank">DAViCal</a>, an open source CalDAV server implementation built on top of Apache, Perl, PHP5, and PostgreSQL server. If you need to install this suite, you can grab a prepackaged distribution like the <a title="Bitnami WAPP Stack" href="http://bitnami.org/stack/wappstack" target="_blank">Bitnami stack</a>, or install each package from the Linux shell if you&#8217;re comfortable doing so.</p>
<p><a href="http://www.tom-reitz.com/wp-content/uploads/2010/12/tux-working.png"><img class="alignright size-full wp-image-200" style="margin: 4px;" title="Tux Working" src="http://www.tom-reitz.com/wp-content/uploads/2010/12/tux-working.png" alt="Tux Working" width="160" height="160" /></a>The details of how to install DAViCal depend on the operation system distribution you&#8217;re running on your server box. See the <em>Distribution Specifics</em> section of the <a title="DAViCal Installation Wiki" href="http://wiki.davical.org/w/Installation_Stuff" target="_blank">DAViCal Installation Wiki</a>. When I installed DAViCal, I ran into the following problems. I&#8217;m posting them here, as well as some tips, in hopes that they may save you some time:</p>
<ul>
<li style="padding-bottom: 10px;">If you&#8217;re installing in a shared server environment, you&#8217;ll need to change the hard-coded Postgre database name and username in <span style="font-family: Courier New,monospace;">davical/dba/create-database.sh</span>. You may also need to manually specify the location of the AWL library in this script if it&#8217;s not in <span style="font-family: Courier New,monospace;">/usr/share/awl</span>.</li>
<li style="padding-bottom: 10px;">When running davical/dba/create-database.sh, pay attention to the output. Near the end, it will say something like &#8220;created user <em>user</em> with password <em>password</em>&#8221; &#8211; save these, as you will need them to log into DAViCal&#8217;s web administration interface later.</li>
<li style="padding-bottom: 10px;">I ran into a problem where some of DAViCal&#8217;s installation Perl scripts wouldn&#8217;t run because I was missing some required Perl modules. When I tried installing them (<span style="font-family: Courier New,monospace;">yum install perl-DBD-Pg</span>), I got &#8220;package not found&#8221;&#8230; until I checked <span style="font-family: Courier New,monospace;">/etc/yum.conf</span> which had <span style="font-family: Courier New,monospace;">exclude= &#8230; perl* &#8230;</span>. Removing the <em>perl*</em> fixed this issue <img src='http://www.tom-reitz.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' title="Calendar Syncing with iPhone and Mozilla Sunbird or Thunderbird/Lightning" /> </li>
<li style="padding-bottom: 10px;">The Installation Wiki gives two methods to install DAViCal: as a directory on your server (<em>example.com/davical</em>) or as a VHost subdomain (<em>davical.example.com</em>). If you want this to work with iPhone, go the subdomain route &#8211; when I tried to tack on a directory in the iPhone CalDAV settings, it kept removing it.
<div style="clear:both">&nbsp;</div>
<p>If you&#8217;re using an automated system like cPanel to manage your server VHosts, and hence don&#8217;t want to edit httpd.conf manually, just follow the directions for installing DAViCal in a directory (creating the symlink to davical/htdocs), and then create the subdomain in cPanel, but giving the symlink for the directory.</li>
</ul>
<p>Once installed, visit <em>davical.example.com</em> in your web browser. You should see a login screen soliciting a username and password, or you may see a diagnostic screen with some details if your installation isn&#8217;t complete.</p>
<p>Log into DAViCal with the username and password the dba/create-database.sh script generated. In the menu up top, choose <em>User Functions</em> -&gt; <em>View My Details</em>. At the bottom of this page, under <em>Principal Collections</em>, click <em>Create Collection</em>. This will basically create a new calendar you can subscribe to with a CalDAV client. Fill in the <em>DAV Path</em> and <em>Display Name</em>. Click <em>Create</em>.</p>
<p>Now, to subscribe to your new CalDAV, you&#8217;ll use the URL <em>http://davical.example.com/caldav.php/username/DAVPath</em>, where <em>username</em> is the username you used to log into the administrative interface for DAViCal, and <em>DAVPath</em> is what you set when creating the collection (previous paragraph).</p>
<p><a href="http://www.tom-reitz.com/wp-content/uploads/2010/12/iphone-calendar.png"><img class="alignright size-medium wp-image-202" style="margin: 4px 8px;" title="iPhone Calendar" src="http://www.tom-reitz.com/wp-content/uploads/2010/12/iphone-calendar-200x300.png" alt="iPhone Calendar" width="200" height="300" /></a>On the iPhone, you can subscribe to this calendar by chosing <em>Settings</em> -&gt; <em>Mail, Contacts, Calendars</em> -&gt; <em>Accounts</em> -&gt; <em>Add Account</em> -&gt; <em>Other</em> -&gt; <em>Calendars</em> -&gt; <em>Add CalDAV Account</em>. <em>Server</em> is your <em>davical.example.com</em>, <em>User Name</em> and <em>Password</em> are from your administrative account, and <em>Description</em> is any descriptive name you want appearing in your iPhone Calendar list. (Maybe the <em>Display Name</em> you chose in DAViCal admin?). Click <em>Next</em>: the iPhone will try to autodetect other settings. If it works, great! your calendar has been added. If not, click the <em>Advanced Settings</em> button that appears, then copy<em> http://davical.example.com/caldav.php/username/DAVPath</em> (see previous paragraph) into the<em> Account URL</em>.</p>
<p>In Lightning or Sunbird, right-click in the calendar list and choose <em>New Calendar</em>. Then, <em>On the Network</em> and <em>Next</em>. Choose <em>CalDAV</em> for the format, and enter <em>http://davical.example.com/caldav.php/username/DAVPath</em> (see two paragraphs ago) into <em>Location</em>. Hit <em>Next</em>. Enter your <em>username</em> and <em>password</em>. Now you should be subscribed to your CalDAV calendar!</p>
<h2 style="padding: 20px 2px 10px 2px;">Summary</h2>
<p>The iPhone can sync many things very well indeed &#8211; music, email, even web browser bookmarks. But for open source calendar software, the only easy way is to use Google&#8217;s cloud service. If you&#8217;re unwilling to do that, however, rejoice: there is another way!</p>
<p>Running a CalDAV server like DAViCal is a great way to sync calendars across computers and mobile devices, and even to share calendars with friends. And if you&#8217;re still worried about the security of your data on a public server (even one that you own or control), you can run a CalDAV server on a local network. It just won&#8217;t be accessible for remote synchronization.</p>
<p>I hope this guide was useful to you. Feel free to leave your comments below.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tom-reitz.com%2F2010%2F12%2F07%2Fcalendar-syncing-with-iphone-and-mozilla-sunbird-or-thunderbird-lightning%2F&amp;linkname=Calendar%20Syncing%20with%20iPhone%20and%20Mozilla%20Sunbird%20or%20Thunderbird%2FLightning"><img src="/wp-content/themes/organic-theme/img/share_save.gif" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.tom-reitz.com/2010/12/07/calendar-syncing-with-iphone-and-mozilla-sunbird-or-thunderbird-lightning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roland Juno G Hip Hop Loop Tutorial</title>
		<link>http://www.tom-reitz.com/2010/02/02/roland-juno-g-hip-hop-loop-tutorial/</link>
		<comments>http://www.tom-reitz.com/2010/02/02/roland-juno-g-hip-hop-loop-tutorial/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 15:50:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[Juno G]]></category>
		<category><![CDATA[midi]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.tom-reitz.com/?p=166</guid>
		<description><![CDATA[For the past 4 or so months I've been really enjoying my new Roland Juno G keyboard, it's an amazing machine! I put together a how-to style video tutorial which explains how to create a hip hop loop using the Juno G's midi feature.]]></description>
			<content:encoded><![CDATA[<p>For the past 4 or so months I&#8217;ve been really enjoying my new Roland Juno G keyboard, it&#8217;s an amazing machine! I put together a how-to style video tutorial which explains how to create a hip hop loop using the Juno G&#8217;s midi feature.</p>
<p>The patches used in this tutorial:</p>
<ul>
<li>USER:087 (PeakArpSine)</li>
<li>PR-B:024 (Comp&#8217;d JBass)</li>
<li>USER:011 (HipHop Kit 2)</li>
<li>PR-B:116 (Crossed Bows)</li>
<li>USER:028 (Scrh&amp;Voi&amp;Wld)</li>
</ul>
<p>Here&#8217;s the video:</p>
<p><object width="580" height="458" data="http://www.youtube.com/v/Iv5SWftlXcU&amp;hl=en_US&amp;fmt=16&amp;fs=1&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/Iv5SWftlXcU&amp;hl=en_US&amp;fmt=16&amp;fs=1&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999" /><param name="allowfullscreen" value="true" /></object></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tom-reitz.com%2F2010%2F02%2F02%2Froland-juno-g-hip-hop-loop-tutorial%2F&amp;linkname=Roland%20Juno%20G%20Hip%20Hop%20Loop%20Tutorial"><img src="/wp-content/themes/organic-theme/img/share_save.gif" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.tom-reitz.com/2010/02/02/roland-juno-g-hip-hop-loop-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter from PHP</title>
		<link>http://www.tom-reitz.com/2009/06/16/twitter-from-php/</link>
		<comments>http://www.tom-reitz.com/2009/06/16/twitter-from-php/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 17:52:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[microblogging]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.tom-reitz.com/?p=143</guid>
		<description><![CDATA[A few months ago I broke down and joined Twitter. Pretty much the only reason is that I wanted to learn how to integrate Twitter into PHP web applications. Here&#8217;s what I found:
Twitter has a URL http://www.twitter.com/statuses/update.xml where you can POST a twitter update. The following HTML form will update your twitter status after asking [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago I broke down and joined <a title="Twitter: Tom Reitz" href="http://twitter.com/t0mreitz" target="_blank">Twitter</a>. Pretty much the only reason is that I wanted to learn how to integrate Twitter into PHP web applications. Here&#8217;s what I found:</p>
<p>Twitter has a URL <a title="Twitter status update" href="http://www.twitter.com/statuses/update.xml" target="_blank">http://www.twitter.com/statuses/update.xml</a> where you can POST a twitter update. The following HTML form will update your twitter status after asking you for your username and password:</p>
<pre style="padding-left: 30px;">&lt;form action="http://twitter.com/statuses/update.xml" method="POST"&gt;
	&lt;input type="text" name="status" /&gt;
	&lt;input type="submit" value=""Tweet!" /&gt;
&lt;/form&gt;</pre>
<p>This is cool, but it would be nice to circumvent the password protection in a web application where you probably already have a user logged in and validated? Fortunately this is possible using HTTP headers: (please make sure you read my SECURITY NOTE below)</p>
<pre style="padding-left: 30px;">&lt;form action='twitter.php' method='post'&gt;
	&lt;input type='text' name='status' /&gt;
	&lt;input type='submit' value='tweet' /&gt;
&lt;/form&gt;
&lt;?php
	if($_POST['status']!="") {

		$data = "status=".stripslashes($_POST['status']);
		$fp = fsockopen("www.twitter.com", 80);
		$user = "twitter_username";
		$pass = "twitter_password";

		fputs($fp, "POST /statuses/update.xml HTTP/1.1\r\n");
		fputs($fp, "Host: www.twitter.com\r\n");
		fputs($fp, "Referer: None\r\n");
		fputs($fp, "Authorization: Basic ".
			base64_encode($user.":".$pass)."\r\n");
		fputs($fp, "Content-type: ".
			"application/x-www-form-urlencoded\r\n");
		fputs($fp, "Content-length: ". strlen($data) ."\r\n");
		fputs($fp, "Connection: close\r\n\r\n");
		fputs($fp, $data);

		while(!feof($fp))$str .= fgets($fp, 128);
		if(!strstr(" OK ",$str))
			echo "There was a problem posting your twitter update.";
		else echo "twitter update posted successfully!";
	}
?&gt;</pre>
<h3>SECURITY NOTE:</h3>
<p>Please notice that the code above sends the username and password hash <em>unencrypted</em> over a plaintext HTTP pipe. The password hash is thus vulnerable to rainbow table attacks.</p>
<p>A better solution uses HTTPS with <a title="cURL in PHP" href="http://us.php.net/curl" target="_blank">cURL</a>. This way, the username &amp; password hash info don&#8217;t have to be sent plaintext:</p>
<pre style="padding-left: 30px;">&lt;form action='twitter.php' method='post'&gt;
	&lt;input type='text' name='status' /&gt; &lt;input type='submit' value='tweet' /&gt;
&lt;/form&gt;
&lt;?php
	if($_POST['status']!="") {
		$url = "https://twitter.com/statuses/update.xml";
		$user = "twitter_username";
		$pass = "twitter_password";

		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_HEADER, true);
		curl_setopt($ch, CURLOPT_USERPWD, $user.":".$pass);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
		curl_setopt($ch, CURLOPT_POSTFIELDS,
			"status=".stripslashes($_POST['status']));

		ob_start();
		curl_exec($ch);
		$str = ob_get_contents();
		ob_end_clean();
		curl_close($ch);

		if($str=="" || strstr($str,"&lt;error&gt;"))
			echo "There was a problem posting your twitter update.";
		else echo "twitter update posted successfully!";
	}
?&gt;</pre>
<p>Since I&#8217;ve started using twitter I&#8217;ve found that it&#8217;s very useful for companies and organizations that want to get messages out to lots of people quickly. You can even get twitter updates by phone using SMS!</p>
<p>Happy tweeting!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tom-reitz.com%2F2009%2F06%2F16%2Ftwitter-from-php%2F&amp;linkname=Twitter%20from%20PHP"><img src="/wp-content/themes/organic-theme/img/share_save.gif" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.tom-reitz.com/2009/06/16/twitter-from-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Graduation!</title>
		<link>http://www.tom-reitz.com/2009/05/02/graduation/</link>
		<comments>http://www.tom-reitz.com/2009/05/02/graduation/#comments</comments>
		<pubDate>Sun, 03 May 2009 03:51:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.tom-reitz.com/?p=138</guid>
		<description><![CDATA[[ May 12, 2009; ] Finally, almost done with school. Start the countdown, I'm graduating from UW-Madison! My last exam is on May 12, so I count that I graduate at noon that day.

Afterward I'll be:

	Moving to a house on the West side of Madison
	Working full time with my web development company
	Hopefully having a bit more time to post on [...]]]></description>
			<content:encoded><![CDATA[<table class="ec3_schedule"><tr><td colspan="3">May 12, 2009</td></tr></table><p>Finally, almost done with school. Start the countdown, I&#8217;m graduating from <a title="UW-Madison" href="http://www.wisc.edu" target="_blank">UW-Madison</a>! My last exam is on May 12, so I count that I graduate at noon that day.</p>
<p>Afterward I&#8217;ll be:</p>
<ul>
<li>Moving to a house on the West side of Madison</li>
<li>Working full time with my <a title="Reitz Internet Technologies" href="http://www.reitzinternet.com" target="_blank">web development company</a></li>
<li>Hopefully having a bit more time to post on <a title="Blog | Tom Reitz" href="http://www.tom-reitz.com/page/1/" target="_self">my blog</a>!</li>
</ul>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tom-reitz.com%2F2009%2F05%2F02%2Fgraduation%2F&amp;linkname=Graduation%21"><img src="/wp-content/themes/organic-theme/img/share_save.gif" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.tom-reitz.com/2009/05/02/graduation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP ICO to PNG conversion</title>
		<link>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/</link>
		<comments>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 04:24:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[ico]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[rgb]]></category>

		<guid isPermaLink="false">http://www.tom-reitz.com/?p=119</guid>
		<description><![CDATA[A few posts ago I wrote about using a PHP class to convert an ICO image to a PNG (or GIF or JPG). I just discovered a bug in the class.
I ran into a problem where some red and orange ICO images turned blue during the conversion. Reading this forum post made me realize that [...]]]></description>
			<content:encoded><![CDATA[<p><a title="ICO images in FaceBook profile boxes" href="/2009/02/09/ico-images-in-facebook-profile-boxes/" target="_self">A few posts</a> ago I wrote about using a PHP class to convert an ICO image to a PNG (or GIF or JPG). I just discovered a bug in the class.</p>
<p>I ran into a problem where some red and orange ICO images turned blue during the conversion. Reading <a title="Saving images from Flash using PHP - Colour problem!" href="http://www.flashmove.com/forum/archive/index.php/t-29133.html" target="_blank">this forum post</a> made me realize that the red and blue values were switched somewhere in <a title="PHP ICO Class" href="/wp-content/uploads/2009/02/classicophp.zip" target="_self">class.ico.php</a>. With some experimentation I found it:</p>
<p>In class.ico.php, lines 264-267 need to be changed from</p>
<pre style="font-size: 11px; width: 520px;">$c[$i] = $this-&gt;AllocateColor($im, $this-&gt;formats[$index]['colors'][$i]['red'],
         $this-&gt;formats[$index]['colors'][$i]['green'],
         $this-&gt;formats[$index]['colors'][$i]['blue'],
         round($this-&gt;formats[$index]['colors'][$i]['reserved'] / 255 * 127));</pre>
<p>to</p>
<pre style="font-size: 11px; width: 520px;">$c[$i] = $this-&gt;AllocateColor($im, $this-&gt;formats[$index]['colors'][$i]['blue'],
         $this-&gt;formats[$index]['colors'][$i]['green'],
         $this-&gt;formats[$index]['colors'][$i]['red'],
         round($this-&gt;formats[$index]['colors'][$i]['reserved'] / 255 * 127));</pre>
<p>(Note that the blue and red values are indeed switched.) After changing this, it works like a charm for me.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tom-reitz.com%2F2009%2F02%2F17%2Fphp-ico-to-png-conversion%2F&amp;linkname=PHP%20ICO%20to%20PNG%20conversion"><img src="/wp-content/themes/organic-theme/img/share_save.gif" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Facebook profile box tips</title>
		<link>http://www.tom-reitz.com/2009/02/17/facebook-profile-box-tips/</link>
		<comments>http://www.tom-reitz.com/2009/02/17/facebook-profile-box-tips/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 13:13:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[box]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[profile]]></category>

		<guid isPermaLink="false">http://www.tom-reitz.com/?p=105</guid>
		<description><![CDATA[As mentioned in my previous post, I&#8217;ve been finishing up a facebook application, My Sites. Now that it&#8217;s done, I thought I&#8217;d post a few tips on how to add profile boxes to your facebook application, since I found it maddeningly complicated.
For the non-facebook-savy, a profile box is a small box that applications can add to [...]]]></description>
			<content:encoded><![CDATA[<p>As mentioned in my <a title="ICO images in FaceBook profile boxes" href="/2009/02/09/ico-images-in-facebook-profile-boxes/" target="_self">previous post</a>, I&#8217;ve been finishing up a <a title="FaceBook" href="http://www.facebook.com" target="_blank">facebook</a> application, <a title="FaceBook: My Sites" href="http://apps.facebook.com/my_sites/" target="_blank">My Sites</a>. Now that it&#8217;s done, I thought I&#8217;d post a few tips on how to add profile boxes to your facebook application, since I found it maddeningly complicated.</p>
<p>For the non-facebook-savy, a profile box is a small box that applications can add to your profile&#8217;s &#8220;wall&#8221; or &#8220;boxes&#8221; tabs. They&#8217;re meant to provide a quick glimpse of what&#8217;s happening with the application.</p>
<p>I&#8217;m assuming that you keep a database of Facebook users, and you want to display something about them in the profile box.</p>
<p>The basic code for adding a profile box is below, annotated with copious comments. This is in PHP code, you can do it in other languages, but it&#8217;s what I use. Pop this code into a daily <a title="Wikipedia: Cron" href="http://en.wikipedia.org/wiki/Cron" target="_blank">cron</a> for example, and you&#8217;re good to go.</p>
<blockquote>
<pre style="font-size:11px;">&lt;?php
// This code connects to the facebook API.
@require_once 'facebook-platform/php/facebook.php';
$appapikey = 'facebook app api key';
$appsecret = 'facebook app api secret';
$facebook = new Facebook($appapikey, $appsecret);

// This code connects to your own database.
$BASEURL = "http://example.com/path/to/facebook/app";
$connection = @mysql_connect("server","username","password");
if(!$connection)die("Can't connect to the database at this time.");
$res = @mysql_select_db("database");
if(!$res)die("Site database doesn't seem to exist.");

// This code cycles through each user in the database
$sql="SELECT * FROM users";
$data=@mysql_query($sql);
while($user=mysql_fetch_assoc($data)) {
     // You can, of course, query your database to build these strings
     $WideBox = "Whatever you want a profile box on the 'boxes' tab to say.";
     $MobileBox = "Whatever you want a profile box accessed by a mobile device to say.";
     $NarrowBox = "Whatever you want a profile box on the 'wall' tab to say.";

     // This is the API call, it sets the user's profile box content:
     $facebook-&gt;api_client-&gt;profile_setFBML(
          NULL,        // This is the markup, set to NULL for 'FBML'
          $user['id'],  // ID number of the user whose profile box you want to set
          $WideBox,    // Wide box content for 'boxes' tab
          NULL,        // Deprecated, should always be NULL
          $MobileBox,  // Box content for mobile devices
          $NarrowBox   // Narrow box content for 'wall' tab
     );
}
// Clean up the connection
@mysql_close($connection);
?&gt;</pre>
</blockquote>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tom-reitz.com%2F2009%2F02%2F17%2Ffacebook-profile-box-tips%2F&amp;linkname=Facebook%20profile%20box%20tips"><img src="/wp-content/themes/organic-theme/img/share_save.gif" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.tom-reitz.com/2009/02/17/facebook-profile-box-tips/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>ICO images in FaceBook profile boxes</title>
		<link>http://www.tom-reitz.com/2009/02/09/ico-images-in-facebook-profile-boxes/</link>
		<comments>http://www.tom-reitz.com/2009/02/09/ico-images-in-facebook-profile-boxes/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 02:54:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[box]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[gif]]></category>
		<category><![CDATA[ico]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[jpg]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[profile]]></category>

		<guid isPermaLink="false">http://www.tom-reitz.com/?p=42</guid>
		<description><![CDATA[So I&#8217;ve been developing a FaceBook application, My Sites. It let&#8217;s you bookmark websites you like and share them with your friends.
The Problem
When a FaceBook application tries to add HTML to someone&#8217;s profile box, it can add images, but only in JPG, GIF, or PNG formats. For most uses this is fine, but I needed to add a favicon next [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve been developing a FaceBook application, <a title="FaceBook: My Sites" href="http://apps.facebook.com/my_sites/" target="_blank">My Sites</a>. It let&#8217;s you bookmark websites you like and share them with your friends.</p>
<h3>The Problem</h3>
<p>When a FaceBook application tries to add HTML to someone&#8217;s profile box, it can add images, <em>but only in JPG, GIF, or PNG formats</em>. For most uses this is fine, but I needed to add a favicon next to each website in a list, and ICO format isn&#8217;t allowed.</p>
<h3>The Solution</h3>
<p>Using a free php class that can import ICO images to a GD image resource, I converted the favicons to PNGs. Now FaceBook is all happy. Download a ZIP of the icon class <a title="Download ICO PHP Class" href="http://www.tom-reitz.com/wp-content/uploads/2009/02/classicophp.zip" target="_self">here</a>, or directly from <a title="PHPclasses.org" href="http://www.phpclasses.org/browse/file/9705.html" target="_blank">PHPclasses.org</a>.</p>
<p>[<strong>EDIT</strong>: please see my post on the <a title="PHP ICO to PNG conversion" href="/2009/02/17/php-ico-to-png-conversion/" target="_self"><strong>important bug fix</strong></a>]</p>
<h3>The Code</h3>
<p>Here&#8217;s how you use the class:</p>
<blockquote>
<pre><span style="font-size: small;">
&lt;?php
error_reporting(0);
require("ico.class.php");
$f = "http://www.google.com/favicon.ico";
$i = new Ico($f);
if(!($r=$i-&gt;GetIcon(0))) die("Could not load ICO.");
else {
          header("Content-Type: image/png");
          imagepng($r);
}
?&gt;
</span></pre>
</blockquote>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tom-reitz.com%2F2009%2F02%2F09%2Fico-images-in-facebook-profile-boxes%2F&amp;linkname=ICO%20images%20in%20FaceBook%20profile%20boxes"><img src="/wp-content/themes/organic-theme/img/share_save.gif" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.tom-reitz.com/2009/02/09/ico-images-in-facebook-profile-boxes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Blog</title>
		<link>http://www.tom-reitz.com/2009/02/06/new-blog/</link>
		<comments>http://www.tom-reitz.com/2009/02/06/new-blog/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 13:23:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=1</guid>
		<description><![CDATA[This is my new blog. I&#8217;ll be posting here periodically, mostly on random tech topics. Gadgets and articles I find interesting, solutions to web development problems I encounter, reviews, how-tos, and the like. Occasionally I may post something totally unrelated but I&#8217;ll try not to  .
Thanks for visiting. Please stop by often to check out my blog, [...]]]></description>
			<content:encoded><![CDATA[<p>This is my new blog. I&#8217;ll be posting here periodically, mostly on random tech topics. Gadgets and articles I find interesting, solutions to web development problems I encounter, reviews, how-tos, and the like. Occasionally I may post something totally unrelated but I&#8217;ll try not to <img src='http://www.tom-reitz.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' title="New Blog" /> .</p>
<p>Thanks for visiting. Please stop by often to check out my blog, or keep up via <a title="RSS Blog Feed" href="http://www.tom-reitz.com/feed/" target="_self">RSS</a>!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tom-reitz.com%2F2009%2F02%2F06%2Fnew-blog%2F&amp;linkname=New%20Blog"><img src="/wp-content/themes/organic-theme/img/share_save.gif" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.tom-reitz.com/2009/02/06/new-blog/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

