<?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/"
	>

<channel>
	<title>Northern Binary</title>
	<atom:link href="http://blog.northernbinary.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.northernbinary.org</link>
	<description></description>
	<pubDate>Sun, 21 Jun 2009 09:10:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Build Nagios 3 from source for Ubuntu 8.04 LTS</title>
		<link>http://blog.northernbinary.org/ubuntu/build-nagios-3-from-source-for-ubuntu-804-lts/</link>
		<comments>http://blog.northernbinary.org/ubuntu/build-nagios-3-from-source-for-ubuntu-804-lts/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 09:10:30 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
		
		<category><![CDATA[Nagios]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.northernbinary.org/?p=82</guid>
		<description><![CDATA[First install a clean copy of Ubuntu 8.04 LTS and configure it how you see fit (e.g. give it a static IP address to add it to your network).
We&#8217;re going to start with installing the NTP time services:
$ sudo apt-get install ntp ntpdate
Now install a fresh Apache web server instance:
$ sudo apt-get install apache2 apache2.2-common [...]]]></description>
			<content:encoded><![CDATA[<p>First install a clean copy of Ubuntu 8.04 LTS and configure it how you see fit (e.g. give it a static IP address to add it to your network).</p>
<p>We&#8217;re going to start with installing the NTP time services:</p>
<p><code>$ sudo apt-get install ntp ntpdate</code></p>
<p>Now install a fresh Apache web server instance:</p>
<p><code>$ sudo apt-get install apache2 apache2.2-common apache2-mpm-prefork apache2-utils</code></p>
<p>Slap on a copy of MySQL:</p>
<p><code>$ sudo apt-get install mysql-server mysql-client</code></p>
<p>And a copy of PHP 5 to make our LAMP stack complete:</p>
<p><code>$ sudo apt-get install php5 php5-common libapache2-mod-php5 php5-mysql</code></p>
<p>Nagios is going to need GD 2 support. We&#8217;re installing it without X pixmap and fontconfig support.</p>
<p><code>$ sudo apt-get install libgd2-noxpm-dev</code></p>
<p>We&#8217;re going to need to create a user and a group for Nagios to operate under:</p>
<p><code>$ sudo groupadd -g 9000 nagios<br />
$ sudo groupadd -g 9001 nagcmd<br />
$ sudo useradd -u 9000 -g nagios -G nagcmd -d /usr/local/nagios -c "Nagios Admin" nagios<br />
$ sudo usermod -G nagcmd www-data</code></p>
<p>Create the directories for the Nagios binaries, configuaration and local data storage:</p>
<p><code>$ sudo mkdir -p /usr/local/nagios /etc/nagios /var/nagios</code></p>
<p>Set the nagios user we created earlier to be owner of these directories:</p>
<p><code>$ sudo chown nagios.nagios /usr/local/nagios /etc/nagios /var/nagios</code></p>
<p>Now you need to download the latest version of Nagios 3 from the <a href="http://www.nagios.org" onclick="javascript:pageTracker._trackPageview ('/outbound/www.nagios.org');">Nagios website</a> and extract it somewhere convenient.</p>
<p>Run configure to check if the system is ready to build:</p>
<p><code>$ ./configure --prefix=/usr/local/nagios --sysconfdir=/etc/nagios --localstatedir=/var/nagios --with-nagios-user=9000 --with-nagios-group=9000 --with-command-group=9001</code></p>
<p>Compile all binaries:</p>
<p><code>$ make all</code></p>
<p>And install:</p>
<p><code>$ sudo make install</code></p>
<p>The last thing to do is to run some special installation commands that initialize our Nagios installation and create the initial configuration file etc.:</p>
<p><code>$ sudo make install-init<br />
$ sudo make install-commandmode<br />
$ sudo make install-config</code></p>
<p>You should now have a working Nagios version.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.northernbinary.org/ubuntu/build-nagios-3-from-source-for-ubuntu-804-lts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why I don&#8217;t use Microsoft technology</title>
		<link>http://blog.northernbinary.org/general/why-i-dont-use-microsoft-technology/</link>
		<comments>http://blog.northernbinary.org/general/why-i-dont-use-microsoft-technology/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 21:36:33 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.northernbinary.org/?p=74</guid>
		<description><![CDATA[Everyone who knows me knows that I&#8217;m big on Linux, well Ubuntu to be more specific. I also have strong tendencies towards Java and open source when it comes to programming. But, it wasn&#8217;t always like that&#8230; Long ago, when I was still a lad, I was BIG on Microsoft. I guess because that&#8217;s all [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone who knows me knows that I&#8217;m big on Linux, well Ubuntu to be more specific. I also have strong tendencies towards Java and open source when it comes to programming. But, it wasn&#8217;t always like that&#8230; Long ago, when I was still a lad, I was BIG on Microsoft. I guess because that&#8217;s all I knew. I&#8217;ve been programming since my early teens and simply never been introduced to anything else than DOS and, a bit later on, Windows.</p>
<p>Naturally I started using Visual Studio to program in C and C++ during the late 90&#8217;s after swinging a bit with Watcom and Borland for a while. But Watcom ceased to exist and Visual C++ was the next best thing because of the C++ optimizing compiler it used. Intel&#8217;s C++ compiler was to expensive other than the fact that none of my friends had a &#8220;free&#8221; copy of it (if you know what I mean).</p>
<p>When I became a professional, full time, programmer I started to learn things. Slowly that is. The first couple of years of my career I was pretty mindless. I didn&#8217;t know what to do, so, I just did what I did best, I programmed. I programmed in C, in C++, in ToolBook, in GRASP, in Lingo (Director), Java, and some more C++. Then the web became very popular so I did some HTML and Javascript. I hated HTML and Javascript in those early days of the web, to chaotic and messy. So, I did more Java and C++. Then Flash became really hot in 2001/2002. So I did ActionScript and started to specialize in the Flash Platform.</p>
<p>I did all of this in a Microsoft world using Windows as a platform.</p>
<p>Then, in the early 2000&#8217;s I started to notice something. At the time I was working for a large consulting/outsourcing company in Europe. I was also swinging between Java and C++ at the time. All C++ work was done with Visual Studio for the Windows platform. Actually, to be more specific, it was all MFC. I loved MFC. Because I did Java and C++ projects I switched between two different departments. And what I started to notice was that whenever I was with the &#8216;Java guys&#8217; I just learned so much more. Even though I was working on a Windows box when developing Java, these &#8216;Java guys&#8217; where all running Linux desktops and Linux servers. I saw them type in magical commands into consoles that vaguely reminded me of the commands I used to type in when I used DOS when I was a kid. But somehow, these commands where much more complex with weird characters and what&#8217;s not. I learned about regular expressions, design patterns, databases, client server models, reverse proxies, tunneling, security, the list goes on and on. I thought my head exploded.</p>
<p>Then, when doing C++ with the &#8216;Microsoft guys&#8217; I noticed that I didn&#8217;t learn anything significant. I mostly worked with guys that I now like to call &#8220;drag &#038; drop programmers&#8221;. They hooked up ActiveX controls and dragged and dropped some UI controls onto a gray canvas and called it an application. These guys where clearly in it for the money and the title on their business cards. They didn&#8217;t give a crap about programming or, beautiful code. Of course, there where a couple guys who&#8217;d know their stuff but most of them where the product of Microsoft&#8217;s latest Visual Studio features. Just drag and drop, click and point. In my opinion Microsoft had singlehandedly created an whole generation of programmers who didn&#8217;t care. Microsoft had made programming accessible to just about anyone with a university degree and an interested in a big paycheck every month.</p>
<p>At the time, programming in Java was something that you could only do if you really really wanted it. To work with Java you had to get over quite a threshold. There where no fancy editors (Eclipse was just emerging) and there was a lot of command-line stuff with build scripts involved. I guess this culled of a large amount of the drag &#038; drop programmers and only the motivated programmers where left. The sad thing is that this has nothing to do with the quality of Microsoft&#8217;s products. I&#8217;ve used them for years and know it to be very good. It was just the people I was working with that weren&#8217;t that interesting and made me switch.</p>
<p>I guess this is also the reason why I never picked up any of Microsoft&#8217;s .NET stuff. .NET became popular just around the time I was losing interest in Microsoft. I know C# to be an excellent programming language. It might even be better than Java on some points. But the lack of choice is just not appealing to me. If I choose Microsoft I would feel locked in. There is no alternative if you find yourself unhappy with it for some sort of reason. This is why I love e.g. Java. If I choose to use Java technology to power my business and applications I can actually choose. Not only can I choose my runtime but I can choose my platform like JBoss, Geronimo, JRun or even just a servlet engine like Tomcat or Jetty and there a numerous frameworks for Java available. The list is endless.</p>
<p>What it basically comes down to is, instead of not choosing Microsoft I chose freedom. The freedom of choice. The good thing is is that I&#8217;m still free to choose Microsoft if I wanted to.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.northernbinary.org/general/why-i-dont-use-microsoft-technology/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Stackoverflow</title>
		<link>http://blog.northernbinary.org/dribble/stackoverflow/</link>
		<comments>http://blog.northernbinary.org/dribble/stackoverflow/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 05:09:46 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
		
		<category><![CDATA[Dribble]]></category>

		<category><![CDATA[General]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.northernbinary.org/?p=56</guid>
		<description><![CDATA[When Stackoverflow went in beta I was really excited. Joel &#38; Jeff had been discussing it for a couple of months already in their pod-cast and I was kind of curious to finally see it in action. I already had an OpenId which I had never actually used so Stackoverflow gave me a chance to [...]]]></description>
			<content:encoded><![CDATA[<p>When <a href="http://www.stackoverflow.com" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.stackoverflow.com');">Stackoverflow</a> went in beta I was really excited. <a href="http://www.joelonsoftware.com/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.joelonsoftware.com');">Joel</a> &amp; <a href="http://www.codinghorror.com/blog/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.codinghorror.com');">Jeff</a> had been discussing it for a couple of months already in their <a href="http://blog.stackoverflow.com/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/blog.stackoverflow.com');">pod-cast</a> and I was kind of curious to finally see it in action. I already had an <a href="https://www.myopenid.com/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.myopenid.com');">OpenId</a> which I had never actually used so Stackoverflow gave me a chance to finally test it out. I signed in&#8230;</p>
<p>It&#8217;s a couple of months later now and I&#8217;m currently not sure what to think of Stackoverflow. I liked the idea of a community of programmers coming together to discuss programming and anything related in a forum/wiki style environment. But what can I say, programmers will always be programmers.</p>
<p>By participating on Stackoverflow you gain reputation points and badges. The old style forum set ups had a similar thing where you basically gained status by the number of posts you had contributed to the forum. Often forums would also give you a title, or rank, based on this number or contributions. E.g. if Bill Gates would sign up at some Windows discussion forum he would gain the status of &#8220;rookie&#8221; because he had made zero contributions. These forums would always assume that if you hadn&#8217;t posted anything yet you knew nothing about the subject, so &#8220;rookie&#8221; in this context would mean that Bill was a &#8220;beginner&#8221; or a complete &#8220;noob&#8221; when it comes to Windows.</p>
<p>Stackoverflow&#8217;s reputation scheme works a bit different. Your reputation is based on what others think of you. Your questions and answers can be up or down voted by the other participants of Stackoverflow. Badges are assigned according to what type of actions you perform. E.g., if you write a lot of comments (which are like annotations to questions and answers) you might receive at some point the Commentator badge.</p>
<p>However, besides all the fun, Stackoverflow is starting to bug me.</p>
<p>As I said earlier, programmers will always be programmers. I&#8217;m not sure if the reputation scheme aggravates the typical programmer behavior (you know, that of the anal attitude and the obsession with the specific definition of things) but it seems to happen within Stackoverflow with an irritating presence.</p>
<p>To give you an example. I gained reputation points (or votes) for an <a href="http://stackoverflow.com/questions/172945/php-libraries-svn-access#172949" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/stackoverflow.com');">answer</a> that basically told the person asking the question to use Google. Now, even though its a valid answer because people should use Google before asking questions like that. To &#8220;up vote&#8221; an answer like that is kinda, well&#8230;, sad. It&#8217;s like kicking someone who is already down.</p>
<p>As I understand it, Stackoverflow was created as a community for programmers to share all things programming and related. However, there seems to be a certain self righteousness on Stackoverflow where certain individuals seem to think that its up to them to decide whether a question is a <a href="http://stackoverflow.com/questions/345395/how-many-oreilly-books-do-you-own-closed" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/stackoverflow.com');">valid question or not</a>. I really don&#8217;t understand why people need to go around and close other peoples questions just because it doesn&#8217;t fit with their opinion of what type of questions can and can&#8217;t be asked. If my question was totally unrelated to anything programming, e.g. about shepherding or something, I could understand, but just because someone doesn&#8217;t share a certain interest (in my case O&#8217;Reilly programming books) doesn&#8217;t mean they should be closing questions. E.g. asking a question about <a href="http://stackoverflow.com/questions/234075/programmer-jokes-whats-your-best-one" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/stackoverflow.com');">Programmer Jokes</a> seems to be just fine. I guess, it doesn&#8217;t really matter if your question is pointless as long as it has a gimmick or an element of fun to it.</p>
<p>The typical programmer behavior comes to surface in the type of contributors who go around &#8220;editing&#8221; other peoples questions and answers for, guess what&#8230;, <a href="http://stackoverflow.com/revisions/386445/list" onclick="javascript:pageTracker._trackPageview ('/outbound/stackoverflow.com');">typos</a>! It&#8217;s &#8220;Apache&#8221;, not &#8220;apache&#8221;! Oh dear&#8230;</p>
<p>Well. I&#8217;m not sure what Stackoverflow will do for me in the new year. I&#8217;ll probalby phase myself out at some point as happend in the past when I used be very active on a <a href="http://www.actionscript.org" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.actionscript.org');">certain forum</a> where I haven&#8217;t been activally contributing for over a year now.</p>
<p>I guess time will tell&#8230;</p>
<p>In the meantime, have a good one and the best wishes for 2009!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.northernbinary.org/dribble/stackoverflow/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CodeIgniter and Controllers structure</title>
		<link>http://blog.northernbinary.org/php/codeigniter-and-controllers-structure/</link>
		<comments>http://blog.northernbinary.org/php/codeigniter-and-controllers-structure/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 21:58:14 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
		
		<category><![CDATA[CodeIgniter]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://blog.northernbinary.org/?p=40</guid>
		<description><![CDATA[Over the weekend I was playing around with CodeIgniter. I was up and running pretty quickly and it all seemed to go pretty smoothly. Having built web applications and web sites for a number of years now and before that desktop applications etc, I&#8217;m usually pretty quick with establishing a technical structure for my site. [...]]]></description>
			<content:encoded><![CDATA[<p>Over the weekend I was playing around with <a href="http://www.codeigniter.com" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.codeigniter.com');">CodeIgniter</a>. I was up and running pretty quickly and it all seemed to go pretty smoothly. Having built web applications and web sites for a number of years now and before that desktop applications etc, I&#8217;m usually pretty quick with establishing a technical structure for my site. I do this because I tend to work in iterations rather than focusing on one specific thing before moving on the next. Anyway, I became a bit frustrated when I noticed that I couldn&#8217;t subdivide my controllers folder. It seemed that I could only have one big pool of controllers. This was no good. I checked the documentation and at first I didn&#8217;t notice <a href="http://codeigniter.com/user_guide/general/controllers.html#subfolders" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/codeigniter.com');">the section that describes how to divide your controllers folder into sub folders</a>. When I finally had figured it out I ran into the next problem.</p>
<p>My site has a top level menu option called &#8216;Settings&#8217;. When you click &#8216;Settings&#8217; I want to execute the &#8217;settings&#8217; controller located in the controllers/ folder. The Settings page however has more sub-options like Users, Groups, Roles etc. and I want all these controllers to live inside a settings/ folder that&#8217;s located in the controllers/ folder:</p>
<pre>+ controllers/
   +settings/
      -users.php
      -groups.php
      -roles.php
   -settings.php</pre>
<p>This was going to clash. Going to the <em>localhost/myapp/settings</em> URL would execute the &#8217;settings&#8217; controller and going to <em>localhost/myapp/settings/users</em> would bring up a 404 error page. I assume this is because the framework tries to execute a method called &#8216;users&#8217; inside the &#8217;settings&#8217; controller.</p>
<p>Going back and forth with this issue I finally figured out a way to overcome this problem. In the routes.php configuration file you can set a default controller to execute. I&#8217;ve set mine to &#8216;index&#8217;. So, this could mean that if I would bring my settings.php file holder the Settings controller into the settings/ folder and rename it to index.php, it might execute that controller when browsing to <em>localhost/mysite/settings</em>. And behold, it does. the structure I ended up with was:</p>
<pre>+ controllers/
   +settings/
      -index.php  &lt;- default controller
      -users.php
      -groups.php
      -roles.php</pre>
<p>I haven&#8217;t tried this yet with deeper structures but I assume that the same idea applies to that as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.northernbinary.org/php/codeigniter-and-controllers-structure/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Eclipse Local History</title>
		<link>http://blog.northernbinary.org/eclipse/eclipse-local-history/</link>
		<comments>http://blog.northernbinary.org/eclipse/eclipse-local-history/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 05:16:18 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
		
		<category><![CDATA[Eclipse]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.northernbinary.org/?p=35</guid>
		<description><![CDATA[I&#8217;ve been a big fan of Eclipse for quite while now and every now and again I find a new feature that gets me more excited about Eclipse just a bit more.
The other day when I was working on this project I noticed in the Team folder of the right-click (context) menu of a file, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a big fan of Eclipse for quite while now and every now and again I find a new feature that gets me more excited about Eclipse just a bit more.</p>
<p>The other day when I was working on this project I noticed in the Team folder of the right-click (context) menu of a file, the Local History option. I&#8217;d actually seen this option many times before but I never took any notice of it. The other day however I decided to click on it. When I did a tab opened that showed me some sort of history of the file I had selected when I selected the option. It was, not to my surprise, a local history of the file. Every time I had saved my file, Eclipse has kept a previous copy of it. Local History turns out to be a super undo. Awesome!</p>
<p>Now, Local History is not like version control. Local History is much more low level than that. Basically, Local History is your version control between commits. Sort of.</p>
<p>After discovering Local History I decided to have another quick peek at the other menu options. After a bit of clicking around I noticed that when I right clicked a folder, the option Restore From Local History&#8230; appeared. And just like the title implied, you can actually bring back deleted files. Not only that, you can actually select which version from the Local History of that file you&#8217;d like to bring back.</p>
<p>All in all, again I&#8217;m pretty impressed with Eclipse. If you happen to know any cool Eclipse features, please let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.northernbinary.org/eclipse/eclipse-local-history/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New hosting</title>
		<link>http://blog.northernbinary.org/dribble/new-hosting/</link>
		<comments>http://blog.northernbinary.org/dribble/new-hosting/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 08:23:54 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
		
		<category><![CDATA[Dribble]]></category>

		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.northernbinary.org/?p=30</guid>
		<description><![CDATA[Just got myself some new hosting. I used to have my stuff hosted at MDWebhosting in Melbourne and they gave me a pretty good deal. However, I came across HawkHost and I just could resist their offering. Good storage, good bandwidth, unlimited add-on domains, unlimited sub-domains, unlimited databases (MySQL and PostgreSQL), the list goes on [...]]]></description>
			<content:encoded><![CDATA[<p>Just got myself some new hosting. I used to have my stuff hosted at <a href="http://www.mdwebhosting.com.au/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.mdwebhosting.com.au');">MDWebhosting</a> in Melbourne and they gave me a pretty good deal. However, I came across <a href="http://www.hawkhost.com" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.hawkhost.com');">HawkHost</a> and I just could resist their offering. Good storage, good bandwidth, unlimited add-on domains, unlimited sub-domains, unlimited databases (MySQL and PostgreSQL), the list goes on and on.</p>
<p>I also took the opertunity to get a new domain up and running. I used to use my opject.org domain but I thought maybe a name change couldn&#8217;t hurt. I&#8217;m always in for a bit of change (not to much though!). So, there you go. I&#8217;m now reachable under NorthernBinary.org (because I&#8217;m from the northern hemisphere and I guess, a bit binary&#8230;).</p>
<p>Last but not least. I also took the opportunity to upgrade to the latest version of Wordpress. Ah yeah, good &#8216;ol Wordpress. Not sure what the current version is, something like 2.6.1 or so.</p>
<p>Anyways, there is still some stuff to do. Getting rid of the default theme and some external dependencies need to be resolved (images that are loaded etc.)</p>
<p>Busy busy busy&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.northernbinary.org/dribble/new-hosting/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash Remoting with AS3</title>
		<link>http://blog.northernbinary.org/actionscript-30/flash-remoting-with-as3/</link>
		<comments>http://blog.northernbinary.org/actionscript-30/flash-remoting-with-as3/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 08:23:26 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
		
		<category><![CDATA[Actionscript 3.0]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Remoting]]></category>

		<guid isPermaLink="false">http://blog.opject.org/?p=31</guid>
		<description><![CDATA[While staying on the topic of Flash Remoting. Using it with ActionScript 3 isn&#8217;t all that different. The basic building blocks are quite similar with those used in ActionScript 2. The main difference is that in ActionScript 3 there is a dedicated flash.net.Responder object that needs to be instantiated to receive the result from a [...]]]></description>
			<content:encoded><![CDATA[<p>While staying on the topic of Flash Remoting. Using it with ActionScript 3 isn&#8217;t all that different. The basic building blocks are quite similar with those used in ActionScript 2. The main difference is that in ActionScript 3 there is a dedicated flash.net.Responder object that needs to be instantiated to receive the result from a AMF call. Knowing that, a bare bone ActionScript 3 Flash Remoting call would than look something like this:</p>
<pre>
import flash.events.NetStatusEvent;
import flash.net.NetConnection;
import flash.net.Responder;

function onConnectionStatus( event : NetStatusEvent ) : void
	{
		trace("onConnectionStatus " + event.info.level + ", " + event.info.code );
	}

function onResponderResult( result : String ) : void
	{
		trace("onResponderResult " + result);
	}

function onResponderStatus( event : NetStatusEvent ) : void
	{
		trace("onResponderStatus " + event.info.level + ", " + event.info.code );
	}

var responder : Responder;
responder = new Responder( onResponderResult, onResponderStatus );

var nc : NetConnection;
nc = new NetConnection();
nc.addEventListener( NetStatusEvent.NET_STATUS, onConnectionStatus);
nc.connect(http://localhost/remoting/gateway.php");
nc.call("HelloWorld.say", responder, "hello");
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.northernbinary.org/actionscript-30/flash-remoting-with-as3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash Remoting</title>
		<link>http://blog.northernbinary.org/actionscript/flash-remoting/</link>
		<comments>http://blog.northernbinary.org/actionscript/flash-remoting/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 11:57:42 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
		
		<category><![CDATA[Actionscript]]></category>

		<category><![CDATA[Actionscript 2.0]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Remoting]]></category>

		<guid isPermaLink="false">http://blog.opject.org/?p=30</guid>
		<description><![CDATA[I never really had the chance to use Flash Remoting on a commercial project and it has been years since I played around with it. It must have been 2003/2004 or so that I first tried using it. At the time I tried it with ColdFusion, which worked pretty OK, and with Java (JRun to [...]]]></description>
			<content:encoded><![CDATA[<p>I never really had the chance to use Flash Remoting on a commercial project and it has been years since I played around with it. It must have been 2003/2004 or so that I first tried using it. At the time I tried it with ColdFusion, which worked pretty OK, and with Java (JRun to be precise). I was pretty impressed with the level of abstraction that Flash Remoting provided. Not just from the ActionScript point of view but also from the server point of view. No more manual parsing of data structures. Great! Thinking about it, I can&#8217;t really understand why it isn&#8217;t more widely used. It seems that it is only used on the more corporate websites, or very specialized stuff to say the least, and you don&#8217;t see it much used with the &#8216;typical&#8217; Flash stuff or hear much about it in the general Flash community. Maybe that&#8217;s because Flash Remoting is quite a techy thing to get your head around and that it&#8217;s out of the league of your typical Flashers. Maybe <a href="http://labs.adobe.com/technologies/blazeds/" onclick="javascript:pageTracker._trackPageview ('/outbound/labs.adobe.com');">BlazeDS</a> is going to make a change to this, but somehow I doubt that.</p>
<p>Anyways, I was playing with <a href="http://www.amfphp.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.amfphp.org');">AMFPHP</a> over the weekend. It was a fair bit of work to get it all up and running. The documentation on the site isn&#8217;t what you would call &#8216;good&#8217; but after a bit of puzzling I was able to figure it out and was able to make a request through Remoting and get a result value back. Awesome. The next thing I wanted to do was to use a bare bone <a href="http://livedocs.adobe.com/flash/8/main/00002550.html" onclick="javascript:pageTracker._trackPageview ('/outbound/livedocs.adobe.com');">NetConnection</a> instance to connect to AMFPHP. After all, in Flash it&#8217;s the only intrinsic object available to connect to an AMF server and somehow the Remoting classes provided by Adobe seem to be so incredibly complicated and not intuitive to use at all. Luckily they changed this for ActionScript 3, but I wanted to figure this out for ActionScript 2.</p>
<p>The first mistake I made was to focus on the <a href="http://livedocs.adobe.com/flash/8/main/00002551.html" onclick="javascript:pageTracker._trackPageview ('/outbound/livedocs.adobe.com');"><i>connect</i></a> method of the NetConnection object. I figured out that the NetConnection has an undocumented <i>onStatus</i> event handler. I figured also out that when I made a connection the <i>onStatus</i> wasn&#8217;t triggered when I used http, only when I used rtmp. Hmmm, that was kinda odd. I played around with it for a while and decided to move on to the next thing, which was calling a remote method. I created a simple HelloWorld method on the AMFPHP server and called it using the Remoting classes provided by Adobe. That worked fine. So I set up the following code using a bare bone NetConnection:</p>
<pre>
var responder : Object;
responder = new Object();
responder.onResult = function( result : String ) : Void
   {
      trace("responder:onResult " + result);
   };
responder.onStatus = function( info : Object ) : Void
   {
      trace("responder:onStatus " + info.code + ", " + info.level);
   };

var nc : NetConnection;
nc = new NetConnection();
nc.onStatus = function( info : Object ) : Void
   {
      trace("nc:onStatus " + info.code + ", " + info.level);
   };
nc.connect("http://localhost/remoting/gateway.php");
nc.call("HelloWorld.say", responder);
</pre>
<p>Now, this is where I went on my next wild goose chase. I spent the next couple of hours trying to figure out why this didn&#8217;t work. Going back and forth between the test case I did with the Adobe classes and this example. I just couldn&#8217;t figure out why the NetConnection example wasn&#8217;t working. I made dozens of small changes, trying to isolate the problem. But alas. Nothing. Until, at one point, I decided to change this line:</p>
<pre>nc.call("HelloWorld.say", responder);</pre>
<p>To this:</p>
<pre>nc.call("HelloWorld.say", responder, "hello");</pre>
<p>Bang! It worked. Apparently, just because the signature didn&#8217;t match previously with any remote function on the server, the function simply wasn&#8217;t called&#8230; Maybe it&#8217;s my naivety, but I was expecting the parameter to be just passed as an empty string, or <i>null</i>, if not specified. I&#8217;m currently not sure where the problem lies with that, but I guess it&#8217;s with AMFPHP. I think AMFPHP is to strict on signature testing and should be a bit more relaxed when it comes to that. I played around with it a bit more and decided to call it a day.</p>
<p>Today, while doing the dishes, or better, cleaning out the dishwasher the http/rtmp problem just solved itself. Of course the behavior was different! When connecting to an AMF server through http, the connection is stateless and can&#8217;t be maintained. In fact, calling the <i>connect</i> method on the NetConnection object doesn&#8217;t actually do that much and behaves completely different than with rtmp. It does call the server, but it seems to only check if the location, or gateway you want to call, exists. Only over an rtmp connection the Flash Player can maintain an open connection with the server. Duh!</p>
<p>I will definitely be using more Flash Remoting in the future and will most likely try to push it for more commercial projects from now on. It&#8217;s a great technology, saves heaps of bandwidth and no more XML/JSON parsing!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.northernbinary.org/actionscript/flash-remoting/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP</title>
		<link>http://blog.northernbinary.org/php/php/</link>
		<comments>http://blog.northernbinary.org/php/php/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 22:44:03 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://blog.opject.org/?p=28</guid>
		<description><![CDATA[I used to hate PHP. I still do actually, even if it&#8217;s only just a bit. But, over the past year or so I&#8217;ve developed an appreciation for the language. OK, as a programming language it is pretty odd. I mean that syntax, c&#8217;mon. Some weird demon child offspring between C and Perl. It&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>I used to hate PHP. I still do actually, even if it&#8217;s only just a bit. But, over the past year or so I&#8217;ve developed an appreciation for the language. OK, as a programming language it is pretty odd. I mean that syntax, c&#8217;mon. Some weird demon child offspring between C and Perl. It&#8217;s a pretty hideous creature. Furthermore, PHP cannot be considered a platform like .NET or J2EE. It&#8217;s a programming language, nothing more and nothing less. Anything you can code with PHP can be done in as many different ways as there are PHP programmers. In a way it reminds me of the good old C days. C came with a massive library of incoherent functions. E.g. with C there where multiple of different ways of working with files. You use the set of functions that would make to most sense to you. In a sense, the biggest difference between PHP and C is the lack of pointers&#8230;</p>
<p>I believe that the power of PHP doesn&#8217;t lay in the programming language itself, because any serious programmer can confirm that the language is pretty frustrating to work with on a day to day basis. No, the power of PHP lies in its availability. A programming environment like ColdFusion, Java or even .NET is much more powerful and structured. Not that you can do more with these languages than with PHP, but it provides a common ground for programmers to start off with. The problem with ColdFusion and Java is that you can&#8217;t get it hosted, unless you&#8217;re willing to shell out the big bucks. Most providers offer Windows hosting so hosting ASP isn&#8217;t outside the reach of small time web developers and whipping up some old school ASP isn&#8217;t that much different than doing PHP. With .NET that&#8217;s a different story. Unfortunately, to <u>effectively</u> develop for .NET you need the Visual Studio development environment which you can buy for lots of money from Microsoft, making the platform unavailable for a large group of developers. I&#8217;m sure Micorsoft provides a stripped command-line SDK, but that doesn&#8217;t make the environment more approachable for people who don&#8217;t have the budget to buy Visual Studio.</p>
<p>The typical web developer likes PHP because every cheap hosting enviroment has at least PHP 4. And even though PHP 4 lacks some OO functionality, you can create pretty good applications with it. Other than that, there is so much information available for PHP available that&#8217;s being able to be grasped by not only the hard-core coders but also the the guy who just wants to store some stuff in a database and doesn&#8217;t want to get to much involved in the details of the language. Because of this, there are a lot of web developers using PHP. Which in turn means that a lot of companies use it because it has a large resource pool. So, even though PHP isn&#8217;t the most elegant programming language, it is popular because of these reasons.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.northernbinary.org/php/php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>(more) ActionScript 3 weirdness</title>
		<link>http://blog.northernbinary.org/actionscript/more-actionscript-3-weirdness/</link>
		<comments>http://blog.northernbinary.org/actionscript/more-actionscript-3-weirdness/#comments</comments>
		<pubDate>Wed, 07 May 2008 01:08:31 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
		
		<category><![CDATA[Actionscript]]></category>

		<category><![CDATA[Actionscript 3.0]]></category>

		<category><![CDATA[Dribble]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.opject.org/?p=27</guid>
		<description><![CDATA[The other day I was attending the Colin Moock lecture &#8220;AS3 from the ground up&#8221; here in Sydney. Even though the lecture was very (and I mean very) basic, as it was intended, it was still quite interesting to see the man in action. I sat through the whole thing even though around 4 o&#8217;clock [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was attending the Colin Moock lecture &#8220;AS3 from the ground up&#8221; here in Sydney. Even though the lecture was very (and I mean very) basic, as it was intended, it was still quite interesting to see the man in action. I sat through the whole thing even though around 4 o&#8217;clock I was ready to walk out (of boredom). I&#8217;m glad I made it till the end.</p>
<p>Even though the lecture was quite basic there was one thing he pointed out that caught my attention. The implicit calling of the super class constructor. He&#8217;s stated that even if you do not specify a call to <code>super</code> in your sub class constructor, the super class constructor is still called. this sounded all to weird for me. I didn&#8217;t wanted to shout this out in case I was wrong and I didn&#8217;t bring a laptop to test out if this weird behavior was true. And thinking again, AS3 has a number of weird things going on that are not consistent with what you would expect. So, this might be another one of those things.</p>
<p>Never the less, the next day I decided to test this behavior just to make sure this was the case, and behold. It is. Besides the fact that you can&#8217;t make constructors private in AS3 (which is a different discussion all together) the super class constructor IS ALWAYS CALLED!!!</p>
<p>As a programmer, for me to override the constructor has actual meaning. It means that I DO NOT WANT THE SUPER CLASS CONSTRUCTOR TO EXECUTE, unless I call the super class constructor explicitly with the <code>super</code> keyword. To me this is another typical one of those; &#8220;we complier designers need to protect those poor little programmers from them selfs, the poor souls don&#8217;t know what they&#8217;re doing&#8221; type of thing. Sigh&#8230;</p>
<p>For some reason, the more I do with AS3 the the more frustrating it is becoming. Every time I run into small but irritating issues like this the more I tend to step away from the language. Don&#8217;t get me wrong, I like the executing speed increase and the improvement from AS2 its just these little annoying things that get to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.northernbinary.org/actionscript/more-actionscript-3-weirdness/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
