<?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>Matt Borja</title>
	<atom:link href="http://www.mattborja.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattborja.com</link>
	<description>PHP/MySQL Web Developer</description>
	<lastBuildDate>Mon, 06 Sep 2010 00:18:13 +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>Upgrading PEAR and other extensions</title>
		<link>http://www.mattborja.com/2010/08/04/upgrading-pear-and-other-extensions/</link>
		<comments>http://www.mattborja.com/2010/08/04/upgrading-pear-and-other-extensions/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 06:31:01 +0000</pubDate>
		<dc:creator>Matt Borja</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.mattborja.com/?p=173</guid>
		<description><![CDATA[Just ran into a slight hiccup that I felt needed to be documented for future reference. We&#8217;re currently working on a final list of todos for The Giiver Project and one of our libraries required an up to date installation of the PHP Extension and Application Repository (or PEAR). This post serves as documentation of [...]]]></description>
			<content:encoded><![CDATA[<p>Just ran into a slight hiccup that I felt needed to be documented for future reference. We&#8217;re currently working on a final list of todos for The Giiver Project and one of our libraries required an up to date installation of the PHP Extension and Application Repository (or PEAR). This post serves as documentation of those issues and their solutions.</p>
<h4>Problem #1</h4>
<p>Warning: require_once(Mail/mime.php) [function.require-once]: failed to  open stream: No such file or directory in  /home/viewtube/public_html/mail.php on line 3</p>
<p>On Centos, this required an installation of PEAR on the server. We did not have, nor intended to use, PEAR on the system prior to this stage in our development. It was installed by running the following command as root: <strong>yum install php-pear</strong></p>
<p>Once PEAR has been installed, we may use it as a PHP library or package manager to install our first library (Mail). First, update your <strong>php.ini </strong>configuration by appending the location of your PEAR installation to the <strong>include_path</strong> setting. It should read something like this: <strong>include_path = &#8220;</strong>.:/usr/local/lib/php<strong>:/usr/share/pear&#8221;</strong></p>
<p>Next, to install a library or an extension, run the pear install command given library&#8217;s parent name (and children if necessary) as follows: <strong>pear install Mail</strong></p>
<p>If a child library or dependency doesn&#8217;t exist (e.g. Mail/mime.php), we can also fetch those by running: <strong>pear install Mail_mime</strong> (or Mail_<em>childname</em>)</p>
<h4>Problem #2</h4>
<p><em>Extension being installed or upgraded</em> requires PEAR Installer (version &gt;= <em>NEW_VERSION</em>), installed version is <em>CURRENT_VERSION</em></p>
<p>In some cases, you may not be able to install an extension because your version of PEAR doesn&#8217;t meet the extension&#8217;s requirements. Usually an error similar to the one shown will be displayed. This one was a little tricky because you could not upgrade PEAR Installer over itself without forcing the upgrade as some of PEAR Installer&#8217;s dependencies required a higher version as well. To get around this, we can force upgrade our PEAR Installer by running: <strong>pear upgrade &#8211;force PEAR</strong></p>
<p>You may then proceed to upgrade all locally installed packages by running: <strong>pear upgrade-all</strong></p>
<p>Note: You may have to run through this procedure in the event an extension refuses to be installed due to a lower version of PEAR Installer currently installed, and not only when upgrading packages.</p>
<h4>Problem #3</h4>
<p>WARNING: channel &#8220;pear.php.net&#8221; has updated its protocols, use &#8220;channel-update pear.php.net&#8221; to update</p>
<p>If you get this message while attempting to install an extension, simply do what it says: <strong>pear channel-update pear.php.net</strong></p>
<h4>Problem #4</h4>
<p>Call to undefined function mime_content_type()</p>
<p>According to PHP online documentation, this function has actually been deprecated and replaced by the PHP Extension Community Library (or PECL) FileInfo extension. We can get this installed easily by running: <strong>pecl install FileInfo</strong></p>
<p>If you&#8217;re using PECL to install a PHP extension, you&#8217;ll notice that it uses the traditional <strong>make</strong> commands to compile the extension locally. It will not, however, update your php.ini settings to reflect the new extension in use (even though it might install it to your ext/ directory). If you find that the extension installed still leaves errors in your PHP applications, try adding the extension to your php.ini file as follows: <strong>extension=<em>extensionname.so</em></strong> (may vary depending on your platform).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattborja.com/2010/08/04/upgrading-pear-and-other-extensions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The MMORPG Project is Back!</title>
		<link>http://www.mattborja.com/2010/07/28/the-mmorpg-project-is-back/</link>
		<comments>http://www.mattborja.com/2010/07/28/the-mmorpg-project-is-back/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 05:37:29 +0000</pubDate>
		<dc:creator>Matt Borja</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://www.mattborja.com/?p=169</guid>
		<description><![CDATA[Well it&#8217;s almost been a year now since The MMORPG Project was taken offline, but we are EXTREMELY excited to announce that we&#8217;ve brought it back! To tell you the truth, it&#8217;s been sitting on a rackmount server that was kindly donated to us by a colleague a little over a year ago now. The [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mmorpg.borjawebs.com/"><img class="alignright" title="The MMORPG Project" src="http://mmorpg.borjawebs.com/images/logo.png" alt="" width="207" height="137" /></a>Well it&#8217;s almost been a  year now since The MMORPG Project was taken offline, but we are  EXTREMELY excited to announce that we&#8217;ve brought it back!</p>
<p>To tell you the truth, it&#8217;s been sitting on a rackmount server that  was kindly donated to us by a colleague a little over a year ago now.  The server itself was actually refurbished in-house due to some contract  and client adjustments the <a href="http://www.borjawebs.com/">parent company</a> was making.</p>
<p>At any rate, things have been restored back to normal and we&#8217;re back with The MMORPG Project!</p>
<p><strong>Note:</strong> We have also restored all original links and  domain names where our project previously resided. The MMORPG Project  now sites on a new server. You may have accessed this site via one of  our original links published at one of our sponsor websites. We intend  to keep our links the same and continue to offer 100% online social  networking and interactive text-based gaming at <strong>http://mmorpg.borjawebs.com/</strong>.  On that note, as it has been a while, you may not remember your  password. That&#8217;s okay, because we&#8217;re fixing to reset and send out  everyone&#8217;s password for them to come back and pick up where they left  off. <strong>That&#8217;s right,</strong> if you receive a &#8220;come back&#8221; invitation from us, it means you won&#8217;t have to start over!</p>
<p><a title="Visit The MMORPG Project" href="http://mmorpg.borjawebs.com/" target="_blank">Visit The MMORPG Project</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattborja.com/2010/07/28/the-mmorpg-project-is-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS rounded corners using a single image</title>
		<link>http://www.mattborja.com/2010/07/24/css-rounded-corners-using-a-single-image/</link>
		<comments>http://www.mattborja.com/2010/07/24/css-rounded-corners-using-a-single-image/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 01:48:19 +0000</pubDate>
		<dc:creator>Matt Borja</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[rounded corners]]></category>

		<guid isPermaLink="false">http://174.126.246.213/mattborja.com/?p=110</guid>
		<description><![CDATA[I decided to take a Sunday afternoon off and put together some code for rounded corners in CSS. After looking around for a brief period of time, it appears that there are lots of sites out there featuring everything from CSS to Javascript code that will do exactly what you&#8217;ll find done here. I found [...]]]></description>
			<content:encoded><![CDATA[<p><span class="meta"></span>I decided to take a Sunday afternoon off and put together some code for rounded corners in CSS. After looking around for a brief period of time, it appears that there are lots of sites out there featuring everything from CSS to Javascript code that will do exactly what you&#8217;ll find done here. I found maybe one tutorial that showed how to create rounded corners with a single image; everyone else had to use four.</p>
<p>However, we&#8217;re going to use pure CSS and a single image drawn up in Adobe Photoshop to create the ever popular rounded corner effect. This code is highly portable, browser friendly and is simple enough to modify and bend to suit the needs of any web designer, from beginner to expert.</p>
<h3>Semantics: <acronym title="Hypertext Markup Language">HTML</acronym></h3>
<p>To begin, let&#8217;s take a look at some HTML.</p>
<p><code>&lt;div class="corners_5x5"&gt;<br />
&lt;div class="tl"&gt;&lt;/div&gt;&lt;div class="tr"&gt;&lt;/div&gt;<br />
&lt;div class="content"&gt;<br />
&lt;small&gt;Using 5x5 rounded corners. Good for areas where smaller font sizes are used.&lt;/small&gt;</code></p>
<p>&lt;/div&gt;<br />
&lt;div class=&#8221;bl&#8221;&gt;&lt;/div&gt;&lt;div class=&#8221;br&#8221;&gt;&lt;/div&gt;<br />
&lt;div style=&#8221;clear: both;&#8221;&gt;&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p>Here I&#8217;ve created a <code>div</code> container and called it <code>corners_5x5</code> for the simple fact that I will be using corners that are 5px in radius. You can call it whatever you want, so long as you remember to label it as such everywhere else.</p>
<p>Now, you may be able to figure out looking at the <em>class</em> attributes of the <code>div</code> containers we&#8217;ve created inside that we start out by defining the <em>top left</em> and <em>top right</em> containers.</p>
<p>We then create another container to place our content in which we&#8217;ll label using class name <em>content</em>.</p>
<p>Lastly, we define our <em>bottom left</em> and <em>bottom right</em> containers and close out the <em>corners_5x5</em> with the appropriate closing <code>div</code> tag.</p>
<h3>Presentation: <acronym title="Cascading Style Sheets">CSS</acronym></h3>
<p>You will need two (2) things for the presentation aspect of our rounded corners:</p>
<ol>
<li>A copy of <a href="code/corners/5x5_corners.png">5x5_corners.png</a>.</li>
<li>CSS code shown below that will take the containers we&#8217;ve defined in our HTML and create the rounded corner effect.</li>
</ol>
<p><code>&lt;style type="text/css"&gt;</code><br />
.corners_5x5 {width: 250px; background: #555; margin: 5px 0;}<br />
.corners_5x5 .content {background: #555; color: #fff; clear: both; padding: 0 5px;}<br />
.corners_5x5 .tl {width: 5px; height: 5px; float: left; background: url(&#8217;5x5_corners.png&#8217;) top left;}<br />
.corners_5x5 .tr {width: 5px; height: 5px; float: right; background: url(&#8217;5x5_corners.png&#8217;) top right;}<br />
.corners_5x5 .bl {width: 5px; height: 5px; float: left; background: url(&#8217;5x5_corners.png&#8217;) bottom left;}<br />
.corners_5x5 .br {width: 5px; height: 5px; float: right; background: url(&#8217;5x5_corners.png&#8217;) bottom right;}<br />
&lt;/style&gt;</p>
<p>The simplest way to understand what is going on here is to treat <code>.corners_5x5</code> as a <em>selector</em> that will &#8220;select&#8221; HTML elements using the same <em>class</em> name. In fact, that&#8217;s what they&#8217;re called &#8211; <strong>CSS class selectors</strong>. There are other types of selectors, but for the scope of this article, we&#8217;re only dealing with <em>class selectors</em> (prefixed with a period) for now.</p>
<p>Quickly summarizing this code, it&#8217;s main purpose is to set a defined width of the entire rounded corner box itself to 250px wide. You can leave off the width property altogether to allow it to take up 100% of the width of its parent container. Also, we&#8217;ve set the background color of the container itself to match the colors of our rounded corner image. We&#8217;ve also defined a CSS selector for our <code>.content</code> container as well in similar manner.</p>
<p>The next four lines employ slightly more advanced properties including the <code>float</code> and <code>background</code> properties with multiple values specified inline. We&#8217;ll take a moment to explain these.</p>
<h4>CSS property: <code>float</code></h4>
<p>In CSS, we use the word <code>float</code> to detach containers from the page itself and float it in a couple directions, either <em>left</em> or <em>right</em>. This causes all sorts of fun things to happen to the surrounding content on the page and your best bet is to simply play with it and find out what happens. I&#8217;ve put together an illustration below to help you visualize what takes place when using the CSS float property:</p>
<p><img src="images/float-illustrated.png" alt="An image illustrating the effects of using the CSS float property" /></p>
<h4>CSS property: <code>background</code></h4>
<p>Next, we set up our background images to use the same image, just position it differently. This part is actually self-explanatory as the image we&#8217;re using allows us to take advantage of CSS&#8217; built-in background positioning values (e.g. <em>top left</em> and <em>bottom right</em> as shown).</p>
<p>This should give you a general idea as to how the code works and why it works. The image we&#8217;re using is actually one I created in Photoshop that has a 5px radius corner for each corner within a 10&#215;10 image. If you were to divide up the image in equal quarters, it comes out to be precisely what we need in measurement for our rounded corners, not a pixel more, not a pixel less.</p>
<p>Well, I hope this article helped and that you&#8217;ll find a use for it somewhere in your next website endeavor. Another great thing about this particular version of CSS rounded corners is that you can easily change up the width and heights (along with the physical image itself) to reflect 10px radius corners rather than just 5px.</p>
<p>For your convenience, here is a copy of <a href="code/corners/10x10_corners.png">10x10_corners.png</a> used in this example.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattborja.com/2010/07/24/css-rounded-corners-using-a-single-image/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Understanding the difference between single equal sign (=), double equal sign (==), and triple equal sign (===) operators in PHP</title>
		<link>http://www.mattborja.com/2010/07/24/understanding-the-difference-between-single-equal-sign-double-equal-sign-and-triple-equal-sign-operators-in-php/</link>
		<comments>http://www.mattborja.com/2010/07/24/understanding-the-difference-between-single-equal-sign-double-equal-sign-and-triple-equal-sign-operators-in-php/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 01:47:16 +0000</pubDate>
		<dc:creator>Matt Borja</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[comparison operators]]></category>
		<category><![CDATA[data types]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[sanitization]]></category>
		<category><![CDATA[triple equal sign]]></category>
		<category><![CDATA[typecasting]]></category>

		<guid isPermaLink="false">http://174.126.246.213/mattborja.com/?p=106</guid>
		<description><![CDATA[I was looking around just a few minutes to refresh my memory on what the difference was between the double equal sign comparison operator and triple equal sign comparison operator only to end up leaving a couple comments with further clarifications on the topic itself. Here is one of them that I believe sums it [...]]]></description>
			<content:encoded><![CDATA[<p><span class="meta">I</span> was looking around just a few minutes to refresh my memory on what the difference was between the double equal sign comparison operator and triple equal sign comparison operator only to end up leaving a couple comments with further clarifications on the topic itself. Here is one of them that I believe sums it up about as beginner and user friendly as it can possibly be:</p>
<p>Always remember (at least in PHP) that the data type of a variable is being set automatically by <strong>the type of value you assign it.</strong> This could be integer (int), floating point (float), associative array (array), boolean (bool), class object (object) or even a resource, in which case the variable would be of a resource data type (e.g. a simple MySQL query).</p>
<p>Use of the triple equal sign (===) for comparison is most appropriate when data types matter. However, you find yourself rarely using this if you force data types by typecasting input variables (especially user input). For example:</p>
<p><code>function get_user_profile($user_id) {<br />
$user_id = (int)$user_id;<br />
echo '&lt;p&gt;Retrieving user profile for User ID #', $user_id, '&lt;/p&gt;';</code></p>
<p>// $sql = mysql_query(&#8220;SELECT * FROM users WHERE user_id={$user_id} LIMIT 1&#8243;) or die(mysql_error());<br />
// and so on&#8230;<br />
}</p>
<p>In this particular case, you can see that typecasting is going to force that $user_id to be of integer (int) data type and anything you specify in the accept_input() function will be treated as an integer. Default in most cases it comes out to 0 but there are a lot of fun on-the-fly sanitization tricks you can do like this to cut out the extra if/then statements.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattborja.com/2010/07/24/understanding-the-difference-between-single-equal-sign-double-equal-sign-and-triple-equal-sign-operators-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
