<?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>Basecode.net</title>
	<atom:link href="http://basecode.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://basecode.net</link>
	<description>Code based internet solutions.</description>
	<lastBuildDate>Sun, 13 Mar 2011 03:19:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Slow internet connection with Ubuntu &#8211; blame MDNS</title>
		<link>http://basecode.net/2011/02/13/slow-internet-connection-with-ubuntu-blame-mdns/</link>
		<comments>http://basecode.net/2011/02/13/slow-internet-connection-with-ubuntu-blame-mdns/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 02:08:54 +0000</pubDate>
		<dc:creator>Tim Massey</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://basecode.net/?p=127</guid>
		<description><![CDATA[I experienced really slow internet connections all of a sudden through a wired connection to my Ubuntu desktop. It was weird as the wireless connections were all faster and the router was getting good signal. Anyway, it turned out (after much tweaking &#38; a fresh install!) that it was something to do with DNS resolution!? [...]]]></description>
			<content:encoded><![CDATA[<p>I experienced really slow internet connections all of a sudden through a wired connection to my Ubuntu desktop. It was weird as the wireless connections were all faster and the router was getting good signal. Anyway, it turned out (after much tweaking &amp; a fresh install!) that it was something to do with DNS resolution!?</p>
<p>sudo gedit /etc/nsswitch.conf &amp; change:</p>
<pre># hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
hosts:          files dns</pre>
<p>I reckon mdns is to blame&#8230;</p>
<p>At the end of the day, I wanted to upgrade to 10.10 anyway and it forced me to backup my files. A good spring clean &amp; learning experience.</p>
<p>As an addendum to this post…</p>
<p>Since I made it, the network connection on the “fresh” install ground to a halt. It turns out that its the default network manager which is to blame (thus far). I’m not sure how it manages it, but it breaks networking in some fashion.</p>
<p>What you need to do is install “wicd” network manager in place of the default installed network-manager.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get install</span> wicd</div></td></tr></tbody></table></div>
<p>Then remove the network manager using synaptic or the Ubuntu software centre(er).</p>
]]></content:encoded>
			<wfw:commentRss>http://basecode.net/2011/02/13/slow-internet-connection-with-ubuntu-blame-mdns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu window control locations</title>
		<link>http://basecode.net/2011/01/14/ubuntu-window-control-locations/</link>
		<comments>http://basecode.net/2011/01/14/ubuntu-window-control-locations/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 09:44:02 +0000</pubDate>
		<dc:creator>Tim Massey</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://basecode.net/?p=125</guid>
		<description><![CDATA[If you want to get the buttons back onto the right hand side on the windows use: tim@laptop:~$ gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close This is for 10.10 which I just dual booted on the laptop.]]></description>
			<content:encoded><![CDATA[<p>If you want to get the buttons back onto the right hand side on the windows use:</p>
<pre>tim@laptop:~$ gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close</pre>
<p>This is for 10.10 which I just dual booted on the laptop.</p>
]]></content:encoded>
			<wfw:commentRss>http://basecode.net/2011/01/14/ubuntu-window-control-locations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xdebug .htaccess settings</title>
		<link>http://basecode.net/2011/01/14/xdebug-htaccess-settings/</link>
		<comments>http://basecode.net/2011/01/14/xdebug-htaccess-settings/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 04:39:01 +0000</pubDate>
		<dc:creator>Tim Massey</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://basecode.net/?p=119</guid>
		<description><![CDATA[You&#8217;ll need to add these to get it working. php_value xdebug.remote_host &#60;your IP.0.0.1&#62; php_value xdebug.remote_enable 1 php_value xdebug.show_exception_trace 1]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ll need to add these to get it working.</p>
<pre>
<pre>php_value xdebug.remote_host &lt;your IP.0.0.1&gt;
php_value xdebug.remote_enable 1
php_value xdebug.show_exception_trace 1</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://basecode.net/2011/01/14/xdebug-htaccess-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FizzBuzz Test</title>
		<link>http://basecode.net/2010/12/21/fizzbuzz-test/</link>
		<comments>http://basecode.net/2010/12/21/fizzbuzz-test/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 22:24:06 +0000</pubDate>
		<dc:creator>Tim Massey</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://basecode.net/?p=115</guid>
		<description><![CDATA[This morning someone on twitter (@brooklynDev) commented about how good the FizzBuzz test was to weed out bad programmers. I&#8217;ve been interviewing for a few jobs recently and by co-incidence so I wanted to give it a go. In essence it is as follows: "Write a program that prints the numbers from 1 to 100. [...]]]></description>
			<content:encoded><![CDATA[<p>This morning someone on twitter (<a href="http://twitter.com/#!/brooklynDev/status/16884513305010176" target="_blank">@brooklynDev</a>) commented about how good the FizzBuzz test was to weed out bad programmers. I&#8217;ve been interviewing for a few jobs recently and by co-incidence so I wanted to give it a go.</p>
<p>In essence it is as follows:</p>
<pre><em>"Write a program that prints the numbers from 1 to 100.
But for  multiples of three print “Fizz” instead of the number and for the  multiples of five print “Buzz”.
For numbers which are multiples of both  three and five print “FizzBuzz<a rel="nofollow" href="http://c2.com/cgi/wiki?edit=FizzBuzz" target="_blank">?</a>”."
</em></pre>
<p>Pretty straight forward right? I thought so anyway&#8230; Here&#8217;s my solution. It took about 5 minu</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp;<br />
<span style="color: #000088;">$divThree</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$divFive</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$divThree</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Fizz'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$divFive</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Buzz'</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$divThree</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$divFive</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$i</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$i</span><span style="color: #339933;">++;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>I saw another solition which involved the use of a case statement with a &#8220;true&#8221; test condition which I also liked, but it is not something which immediately jumped to mind for me.</p>
<p><em> </em></p>
]]></content:encoded>
			<wfw:commentRss>http://basecode.net/2010/12/21/fizzbuzz-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retrospective coding</title>
		<link>http://basecode.net/2010/07/20/retrospective-coding/</link>
		<comments>http://basecode.net/2010/07/20/retrospective-coding/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 23:00:06 +0000</pubDate>
		<dc:creator>Tim Massey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://basecode.net/?p=112</guid>
		<description><![CDATA[Its interesting that since my last post I&#8217;ve been made redundant from my position at The Sound Alliance. They cut back the development team to bare bones as the good work we did made maintenance a lot easier. Effectively we coded ourselves out of a job! I wont go into it here though. Anyway, I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>Its interesting that since my last post I&#8217;ve been made redundant from my position at The Sound Alliance. They cut back the development team to bare bones as the good work we did made maintenance a lot easier. Effectively we coded ourselves out of a job! I wont go into it here though.</p>
<p>Anyway, I&#8217;ve found another position at The Royal College of Physicians and have had a week and a half off. Well not really &#8220;off&#8221; but working on a freelance project for an old client. It involves implementing some workflow automation within their Intranet that I developed about over the last 4 years and haven&#8217;t touched for 2 years .</p>
<p>What I&#8217;m amazed by in this is how my code style and even logic evolves over time. Its made me realise that I learned a lot of good technique while at TSA. Its also highlighted some of the great design decisions and techniques I already posessed.</p>
<p>If you look at your old code and cant see room to improve, you&#8217;re missing something &#8211; or its genuinely good code!</p>
]]></content:encoded>
			<wfw:commentRss>http://basecode.net/2010/07/20/retrospective-coding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We have lift off!</title>
		<link>http://basecode.net/2010/06/07/we-have-lift-off/</link>
		<comments>http://basecode.net/2010/06/07/we-have-lift-off/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 23:33:59 +0000</pubDate>
		<dc:creator>Tim Massey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://basecode.net/2010/06/07/we-have-lift-off/</guid>
		<description><![CDATA[We released a new version of inthemix.com.au yesterday. My feeling is that it went really well. There were only very minor oversights which we had pre-determined solutions in place for. Ut was a real case of &#8220;Fail to prepare, prepare to fail&#8221;. We had prepared.]]></description>
			<content:encoded><![CDATA[<p>We released a new version of inthemix.com.au yesterday. My feeling is that it went really well. There were only very minor oversights which we had pre-determined solutions in place for. Ut was a real case of  &#8220;Fail to prepare, prepare to fail&#8221;.</p>
<p>We had prepared.</p>
]]></content:encoded>
			<wfw:commentRss>http://basecode.net/2010/06/07/we-have-lift-off/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android</title>
		<link>http://basecode.net/2010/06/02/android/</link>
		<comments>http://basecode.net/2010/06/02/android/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 13:56:04 +0000</pubDate>
		<dc:creator>Tim Massey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://basecode.net/2010/06/02/android/</guid>
		<description><![CDATA[Well. I made my first attempt at development on Android tonight. Im excited by it as it leverages off the Java skills I got back at TAFE. Excellent Eclipse integration and the backup of the future monopoliser, Google&#8230;]]></description>
			<content:encoded><![CDATA[<p>Well. I made my first attempt at development  on Android tonight. Im excited by it as it leverages off the Java skills I got back at TAFE. Excellent Eclipse integration and the backup of the future monopoliser, Google&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://basecode.net/2010/06/02/android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getters &amp; Setters in PHP ~ Why Add Lines?</title>
		<link>http://basecode.net/2010/06/01/getters-setters-in-php-why-add-lines/</link>
		<comments>http://basecode.net/2010/06/01/getters-setters-in-php-why-add-lines/#comments</comments>
		<pubDate>Mon, 31 May 2010 22:15:23 +0000</pubDate>
		<dc:creator>Tim Massey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://basecode.net/?p=51</guid>
		<description><![CDATA[The dynamic nature of PHP defines &#8211; you don&#8217;t need to declare all variables, inherently adding the notion that adding them initially was a pursuit to be avoided. So why re-implement a feature people bothered to un-impliment? $this-&#62;that; VS ~ $this-&#62;getThat(); function getThat(){ return $this-&#62;that; } At least make redundant set/get [tters] dynamic. Use of [...]]]></description>
			<content:encoded><![CDATA[<p>The dynamic nature of PHP defines &#8211; you don&#8217;t need to declare all variables, inherently adding the notion that adding them initially was a pursuit to be avoided.</p>
<p>So why re-implement a feature people bothered to un-impliment?</p>
<pre>$this-&gt;that;</pre>
<p>VS ~</p>
<pre>$this-&gt;getThat();</pre>
<pre>function getThat(){
    return $this-&gt;that;
}</pre>
<p>At least make redundant set/get [tters] dynamic. Use of the magic __set() and __get() methods means the benefit of protecting access to your objects properties can be encapsulated into your base class easily enough.</p>
]]></content:encoded>
			<wfw:commentRss>http://basecode.net/2010/06/01/getters-setters-in-php-why-add-lines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nohup 2&gt;&amp;1 &amp; WTF</title>
		<link>http://basecode.net/2010/05/28/nohup-21-wtf/</link>
		<comments>http://basecode.net/2010/05/28/nohup-21-wtf/#comments</comments>
		<pubDate>Fri, 28 May 2010 05:56:57 +0000</pubDate>
		<dc:creator>Tim Massey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Command Line]]></category>

		<guid isPermaLink="false">http://basecode.net/?p=61</guid>
		<description><![CDATA[Let me explain&#8230; As a relative command line newbie the characters 2&#62;&#38;1 &#38; at the end of commands are quite intreguing. I figured out what they mean The command line apps have 3 types of output Standard input (STDIN) Standard output (STDOUT) Error output (STDERR) So, when you run this command: [tim@desktop]$ programName &#62; filename.log [...]]]></description>
			<content:encoded><![CDATA[<p>Let me explain&#8230; As a relative command line newbie the characters <span>2&gt;&amp;1 &amp; at the end of commands are quite intreguing. I figured out what they mean</span></p>
<p><span>The command line apps have 3 types of output</span></p>
<ul>
<li><span>Standard input (STDIN)<br />
</span></li>
<li><span>Standard output (STDOUT)<br />
</span></li>
<li><span>Error output (STDERR)</span></li>
</ul>
<p>So, when you run this command:</p>
<pre>[tim@desktop]$ programName &gt; filename.log 2&gt;&amp;1</pre>
<p>The output of the program is output into the file and the output from output 2 (STDERR) is sent to output 1 (STDOUT). This effectively sends any errors into the file also.</p>
<p>If you add a space&amp; like so to the end of the command it sends it to the background and returns the pid (in case you need to track/kill it).</p>
<pre>[tim@desktop]$ programName &gt; filename.log 2&gt;&amp;1 &amp;</pre>
<p>Thanks to: http://www.xaprb.com/blog/2006/06/06/what-does-devnull-21-mean/comment-page-3/ for the detail (&amp; Sasha for clarifying some things)</p>
]]></content:encoded>
			<wfw:commentRss>http://basecode.net/2010/05/28/nohup-21-wtf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Whats the Procedure?</title>
		<link>http://basecode.net/2010/05/21/whats-the-procedure/</link>
		<comments>http://basecode.net/2010/05/21/whats-the-procedure/#comments</comments>
		<pubDate>Fri, 21 May 2010 00:46:04 +0000</pubDate>
		<dc:creator>Tim Massey</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://basecode.net/?p=87</guid>
		<description><![CDATA[My first stored procedure in MySQL. I hope it doesnt open a can of worms for me. I&#8217;ve already experienced the pitfalls of putting too much logic in the database (SP&#8217;s) and don&#8217;t intend on allowing history to repeat itself. CREATE PROCEDURE CreateReportUnits(IN num INT, unit VARCHAR(20)) SQL SECURITY INVOKER BEGIN TRUNCATE test.report_days; SET @i [...]]]></description>
			<content:encoded><![CDATA[<p>My first stored procedure in MySQL. I hope it doesnt open a can of worms for me. I&#8217;ve already experienced the pitfalls of putting too much logic in the database (SP&#8217;s) and don&#8217;t intend on allowing history to repeat itself.</p>
<pre>CREATE PROCEDURE CreateReportUnits(IN num INT, unit VARCHAR(20))
SQL SECURITY INVOKER
BEGIN
 TRUNCATE test.report_days;
 SET @i = 0;
 WHILE @i &lt; num DO
 SET @i = @i + 1;
 SET @query = CONCAT("INSERT INTO test.report_days ( report_day_timestamp ) VALUES ( DATE_SUB(CURDATE(),INTERVAL ",@i," ",unit,") );");
 PREPARE statement FROM @query;
 EXECUTE statement;
 END WHILE;

END

# To invoke use:
CALL CreateReportUnits(6 'MONTH');</pre>
<p>The invocation will create a record for the last 6 months based on today&#8217;s date to use in reports.</p>
]]></content:encoded>
			<wfw:commentRss>http://basecode.net/2010/05/21/whats-the-procedure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

