<?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>Albert Fama &#187; learning</title>
	<atom:link href="http://albertfama.com/tag/learning/feed/" rel="self" type="application/rss+xml" />
	<link>http://albertfama.com</link>
	<description>Freelance Web Programmer - specializing in PHP &#38; MySQL</description>
	<lastBuildDate>Fri, 20 Nov 2009 16:06:31 +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>New Tutorial: Integrating FUDforum</title>
		<link>http://albertfama.com/php/new-tutorial-integrating-fudforum/</link>
		<comments>http://albertfama.com/php/new-tutorial-integrating-fudforum/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 00:35:34 +0000</pubDate>
		<dc:creator>Albert Fama</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Fudforum]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[learning]]></category>

		<guid isPermaLink="false">http://albertfama.com/?p=367</guid>
		<description><![CDATA[I have recently published the first part in a new series of tutorials which will look at integrating FUDforum into an existing site. Part 1 looks at how to create FUD accounts for existing users, and how to &#8216;notify&#8217; FUD about things happening on your site. Basically introducing your site to FUD. Back Story It [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently published the first part in a new series of tutorials which will look at integrating <a href="http://fudforum.org/forum/"  title="FUDforum">FUDforum</a> into an existing site. Part 1 looks at how to create FUD accounts for existing users, and how to &#8216;notify&#8217; FUD about things happening on your site. Basically introducing your site to FUD.</p>
<h3>Back Story</h3>
<p>It seems forums have sort of lost their luster for many; I remember when having a website meant having a forum. At that time it seemed every contract I landed, some portion of the job consisted of integrating a forum  into a site. I always hated this job, because at the time PHPBB was the forum of choice and it seemed that there was no &#8216;right&#8217; way to do it, I had simply developed a bunch of hacks which needed to be scattered around the PHPBB code base and even when complete it was still just a bunch of hacks.</p>
<p>As time moved on, the demand for forums became less and less and I had not done a forum integration in many years. That was until I went to my <a href="http://www.azphp.org/"  title="Arizona PHP User's Group">local</a> <a href="http://www.phpusergroups.org/"  title="phpusergroups.org">PHP users group</a> and ended up with a contract to do a forum integration. I really was not looking forward to the project, but it was a part of a larger job and I&#8217;m not one to turn down work.</p>
<p>Luckily the other members of the group convinced the client to use <a href="http://fudforum.org/forum/"  title="FUDforum">FUDforum</a> developed by <a href="http://ilia.ws/"  title="Ilia Alshanetsky: Personal Site/Blog">Ilia Alshanetsky</a>. I had looked into FUDforum before, had used it as a member of different sites, and assumed the code to be a higher quality simply because of who wrote it, but had never written any code to interact with it.</p>
<p>On Wednesday, the night before I was to do the forum integration I began reading the <a href="http://cvs.prohost.org/index.php/Main_Page"  title="FUDforum documentation">documentation</a> and planning how I was going to accomplish this task as easily and painlessly as possible. Looking at the sidebar navigation on the documentation wiki, I was surprised to see the heading &#8216;<a href="http://cvs.prohost.org/index.php/Category:Integration"  title="FUDforum: Integration Documentation">Integration</a>&#8216; two clicks later, a quick scan of two different pages, and I knew exactly what needed to be done. </p>
<p>After a few hours of work Thursday morning I had written a script which created accounts in the forums for existing members, I also altered the sign up, login, and logout code of the main site. With these changes the forums were basically integrated into the site, which brings me to the new tutorial series I will be posting over the next week.</p>
<h3>Integrating FUDforum</h3>
<p><strong><a href="/tutorial-integrating-fudforum-part1" title="FUDforum integration - part 1">Part 1: Introducing your site to FUD</a></strong></p>

                            <div id="aspdf">
                                <a href="http://albertfama.com/wp-content/plugins/as-pdf/generate.php?post=367">
                                    <span>&nbsp;</span>
                                </a>
                            </div>
                        ]]></content:encoded>
			<wfw:commentRss>http://albertfama.com/php/new-tutorial-integrating-fudforum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NOTICES mean something</title>
		<link>http://albertfama.com/php/notices-mean-something/</link>
		<comments>http://albertfama.com/php/notices-mean-something/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 06:34:36 +0000</pubDate>
		<dc:creator>Albert Fama</dc:creator>
				<category><![CDATA[Error Handling]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[environment]]></category>
		<category><![CDATA[error messages]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[learning]]></category>

		<guid isPermaLink="false">http://albertfama.com/?p=264</guid>
		<description><![CDATA[In numerous books and articles the general consensus seems to be that for a production environment Errors and Warnings should be turned on and Notices turned off; as opposed to the development environment where error reporting should be set to E_ALL (report all errors). The reasoning behind this is, Errors and Warnings mean something serious [...]]]></description>
			<content:encoded><![CDATA[<p>In numerous books and articles the general consensus seems to be that for a production environment Errors and Warnings should be turned <strong>on</strong> and <a href="/php/errors-and-error-messages-deciphered/#notice">Notices</a>  turned <strong>off</strong>; as opposed to the development environment where error reporting should be set to E_ALL (report all errors). The reasoning behind this is, Errors and Warnings mean something serious has gone wrong with the script and you (as the developer) need to know about it. Notices on the other hand are kind of disregarded as a nuisance in production.</p>
<p>I completely disagree with this point of view. If I write code which is not intended to generate Notices, then as the developer I want to know if and when Notices are being generated in <strong>any</strong> environment.</p>
<p>Notices are very helpful in tracking down logical errors or bugs, which cause the script not to function as expected.  In PHP they are normally generated when using a previously undeclared variable. Technically speaking there is nothing wrong with this in PHP, other programming languages are not so forgiving. </p>
<p>I personally started declaring all variables when I began to focus on the security implications of using undeclared variables (we&#8217;ll save that information for another post). After getting in the habit I found that I was able find logical errors during development even before I noticed that a bug existed. After realizing this, I now never release code which is know to generate notices. I have also started setting error reporting to E_ALL in <strong>all</strong> environments.</p>
<p>I understand that this is not feasible for everyone. It may not be possible in a professional working environment because of dealing with legacy code. Another issue could arise if you use third-party code which has not subscribed to this way of thinking. Although personally, I feel this is not an excuse there is no reason you can&#8217;t get in there and &#8216;fix&#8217; their script.  </p>
<h5>A word of warning</h5>
<p>I was once hired to fix numerous bugs on a site, all were a fairly obvious fix, but one in particular had me stumped.  I turned on notices when attempting to debug the problem and ended up with an error log that contained over 250 notices for every page load. Since this was a dev environment setup by the client for my use, it was no big deal, but if it were a heavily trafficked live site, there could have been some serious implications.</p>

                            <div id="aspdf">
                                <a href="http://albertfama.com/wp-content/plugins/as-pdf/generate.php?post=264">
                                    <span>&nbsp;</span>
                                </a>
                            </div>
                        ]]></content:encoded>
			<wfw:commentRss>http://albertfama.com/php/notices-mean-something/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learning PHP</title>
		<link>http://albertfama.com/php/learning-php/</link>
		<comments>http://albertfama.com/php/learning-php/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 19:56:12 +0000</pubDate>
		<dc:creator>Albert Fama</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://obnexus.net/?p=40</guid>
		<description><![CDATA[Over the weekend I was visiting a friend, who has his own website. He uses PHP on the site, but he is not a programmer. The site is his hobby and he has only learned enough PHP to get the job done. Simply put this is not his occupation. While visiting he was in the [...]]]></description>
			<content:encoded><![CDATA[<p>Over the weekend I was visiting a friend, who has his own website. He uses PHP on the site, but he is not a programmer. The site is his hobby and he has only learned enough PHP to get the job done. Simply put this is not his occupation. </p>
<p>While visiting he was in the middle of writing a small script which queried articles out of a database and displayed them according to the categories they were assigned to. Everything was working correctly, but the processing time was slower than he would like. He asked if I could take a look and see if anything could be done to speed things up. While optimizing some of the PHP and SQL code; I was showing him different functions which are built into PHP and MySQL, (these functions will always execute faster than the ones you write yourself). </p>
<p>As I was standing over his shoulder pointing out the different problematic areas, he asked me how I was able to keep all that information in my head. I simply replied that it is my job, it&#8217;s what I get paid to do. After going back and forth, what he actually wanted to know was how I  memorized all the different functions, which parameters they accept, and in what order. This is not the first time I have been asked this question so I decided to actually think about how it all happened.</p>
<p>I once read the book &#8216;On Writing&#8217; (by Stephen King), it is a book about how to become a writer. I don&#8217;t really remember a lot about the book, but I do remember one thing. He said that if you want to be a writer, you need to write everyday. It does not have to be anything great, just write something. I attempted to do this, but it became a chore and I soon stopped writing.</p>
<p>After thinking about the question my friend asked (I admit I have a horrible memory) but just like King said, do it everyday. I learned PHP simply by writing code everyday, by using PHP constantly, and little by little things sink in and stay. I never sat down with the manual and made an effort to memorize things, it just naturally happened over a period of time.</p>
<p>When I first started, I remember the fascination I had with writing something that made a computer do what I wanted. It was almost like an addiction, once I got it to do one thing, I wanted write something more complicated. Granted over the years it takes more, but I am now writing more complicated code and when it works, I get that same feeling.</p>
<p>So if you want to become a coder that is able to write scripts off the top of your head, or be able to &#8216;see&#8217; the code before you even begin, do it everyday. It does not have to be ground breaking or a completely new idea, just write something. If you find that writing code everyday becomes a chore, then you may want to try your hand at something else, maybe become an author.</p>

                            <div id="aspdf">
                                <a href="http://albertfama.com/wp-content/plugins/as-pdf/generate.php?post=40">
                                    <span>&nbsp;</span>
                                </a>
                            </div>
                        ]]></content:encoded>
			<wfw:commentRss>http://albertfama.com/php/learning-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
