<?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>TylerBurton.ca &#187; Software</title>
	<atom:link href="http://www.tylerburton.ca/category/tech/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tylerburton.ca</link>
	<description></description>
	<lastBuildDate>Tue, 10 Jan 2012 04:41:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to easily forward Firefox traffic through an SSH tunnel</title>
		<link>http://www.tylerburton.ca/2012/01/how-to-easily-forward-firefox-traffic-through-an-ssh-tunnel/</link>
		<comments>http://www.tylerburton.ca/2012/01/how-to-easily-forward-firefox-traffic-through-an-ssh-tunnel/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 04:41:43 +0000</pubDate>
		<dc:creator>Tyler Burton</dc:creator>
				<category><![CDATA[Computer security]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tunnel]]></category>
		<category><![CDATA[VPN]]></category>
		<category><![CDATA[web browsing]]></category>

		<guid isPermaLink="false">http://www.tylerburton.ca/?p=669</guid>
		<description><![CDATA[Say you are travelling, or are at a neighbourhood coffee shop, using whatever unsecured WiFi network they make available. You could either: trust that no one is sniffing your web traffic, capturing passwords, e-mails, IMs, etc. trust that no one is using more sophisticated methods to trick you into thinking that you are secure (i.e. [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Say you are travelling, or are at a neighbourhood coffee shop, using whatever unsecured WiFi network they make available. You could either:</p>
<ol>
<li>trust that no one is sniffing your web traffic, capturing passwords, e-mails, IMs, etc.</li>
<li>trust that no one is using more sophisticated methods to trick you into thinking that you are secure (i.e. man in the middle attack)</li>
<li>route your Internet traffic through a secure tunnel to your home PC before going out onto the web, protecting you from everyone at your current location</li>
</ol>
<p>which would you choose?</p>
<p><a href="https://en.wikipedia.org/wiki/Virtual_Private_Network">VPNs</a> and <a href="https://en.wikipedia.org/wiki/Secure_Shell">SSH</a> tunnels are actually a relatively easy means for you to be more secure while browsing the Internet from potentially dangerous locations. There are many, many different ways for you to do this but I find using a Linux PC that is running on your home network to be the easiest.</p>
<ol>
<li>Configure your home Linux PC. Install ssh (and sshd if it is separate). If you are using <a href="http://www.ubuntu.com/">Ubuntu</a> this is as easy as running the following command: <strong>sudo apt-get install ssh</strong></li>
<li>Sign up for a free DNS service like <a href="http://dyn.com/">DynDNS</a> so that you know of a web address that always points to your home Internet connection. To do this follow the instructions at the service you choose.</li>
<li>On your laptop (that you have taken with you to the hotel or coffee shop) connect to your home PC&#8217;s ssh server. If you are on Windows you will need to get a program like <a href="http://www.putty.org/">PuTTY</a>. See their documentation on how to forward ports. On Linux you can simply use the <strong>ssh</strong> command. The goal is to forward a dynamic port to the remote ssh server. For instance if you are using a Linux laptop and ssh then the command would look something like: <strong>ssh -D [dynamic port] [user]@[home server] -p [external port number - if not 22]</strong>. An example of one would be <strong>ssh -D 4096 user@example.com -p 4000<br />
</strong></li>
<li>In your browser open the networking options window. This will allow you to tell the browser to forward all of its traffic to a proxy, which in this case, will be our dynamic port that we set up in step 3. Here is an example of my configuration for the example above.<a href="http://www.tylerburton.ca/files/wordpress/2012/01/firefoxproxy.png"><img class="aligncenter size-medium wp-image-671" title="firefoxproxy" src="http://www.tylerburton.ca/files/wordpress/2012/01/firefoxproxy-300x276.png" alt="" width="300" height="276" /></a></li>
<li>Browse normally.</li>
</ol>
<p>You are now browsing the Internet by routing all of your traffic (in Firefox) securely through your home PC. Note that this doesn&#8217;t actually make web browsing any more secure beyond protecting you from people in your immediate vicinity (i.e. connected to the same insecure WiFi network).</p>
<div class="shr-publisher-669"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.tylerburton.ca/2012/01/how-to-easily-forward-firefox-traffic-through-an-ssh-tunnel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New year, new PGP key</title>
		<link>http://www.tylerburton.ca/2012/01/new-year-new-pgp-key/</link>
		<comments>http://www.tylerburton.ca/2012/01/new-year-new-pgp-key/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 02:00:05 +0000</pubDate>
		<dc:creator>Tyler Burton</dc:creator>
				<category><![CDATA[Computer security]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[OpenPGP]]></category>
		<category><![CDATA[PGP]]></category>
		<category><![CDATA[pretty good privacy]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.tylerburton.ca/?p=663</guid>
		<description><![CDATA[I logged onto my desktop the other day, for the first time in a couple of weeks &#8211; I&#8217;ve been away travelling, and was surprised to notice that my PGP key was set to expire. Long story short I have generated a brand new key. OpenPGP Key Name: Tyler Burton Key ID: 0x1CD3E3D8 Key Fingerprint: [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I logged onto my desktop the other day, for the first time in a couple of weeks &#8211; I&#8217;ve been away travelling, and was surprised to notice that my PGP key was set to expire. Long story short I have generated a brand new key.</p>
<p><strong>OpenPGP Key<strong></strong><br />
</strong></p>
<p><strong>Name:</strong> Tyler Burton<br />
<strong>Key ID:</strong> 0x1CD3E3D8<br />
<strong>Key Fingerprint:</strong> 96ED 6B13 10B1 69C1 8299 693C 2921 6D80 1CD3 E3D8<br />
<strong>Keyserver:</strong> pgp.mit.edu<br />
<strong>Key Algorithm:</strong> <a href="https://en.wikipedia.org/wiki/RSA_%28algorithm%29">RSA</a><br />
<strong>Preferred Cipher:</strong> AES256<br />
<strong>Preferred Digest:</strong> SHA512<br />
<strong>Direct Download:</strong> <a href="../files/gpg/0x1CD3E3D8.asc">Download Here</a></p>
<div class="shr-publisher-663"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.tylerburton.ca/2012/01/new-year-new-pgp-key/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Linux Experiment Post Roundup</title>
		<link>http://www.tylerburton.ca/2012/01/the-linux-experiment-post-roundup/</link>
		<comments>http://www.tylerburton.ca/2012/01/the-linux-experiment-post-roundup/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 01:43:17 +0000</pubDate>
		<dc:creator>Tyler Burton</dc:creator>
				<category><![CDATA[Created by Tyler Burton]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[The Linux Experiment]]></category>
		<category><![CDATA[amd]]></category>
		<category><![CDATA[ati]]></category>
		<category><![CDATA[distributions]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[red alert]]></category>
		<category><![CDATA[sun]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.tylerburton.ca/?p=656</guid>
		<description><![CDATA[There has been quite a bit of activity on The Linux Experiment over the past little while. Check out the site here or quickly jump to the post that I wrote below. Big distributions, little RAM 3 How do the &#8216;big time&#8217; distributions handle on constrained hardware? Take a look. How to install sun-java6-jdk and [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>There has been quite a bit of activity on The Linux Experiment over the past little while. Check out the site <a href="http://www.thelinuxexperiment.com">here</a> or quickly jump to the post that I wrote below.</p>
<h2><a href="http://thelinuxexperiment.com/guinea-pigs/tyler-b/big-distributions-little-ram-3/">Big distributions, little RAM 3</a></h2>
<p>How do the &#8216;big time&#8217; distributions handle on constrained hardware? Take a look.</p>
<h2><a href="http://thelinuxexperiment.com/guinea-pigs/tyler-b/how-to-install-sun-java6-jdk-and-netbeans-in-ubuntu-11-10/">How to install sun-java6-jdk and Netbeans in Ubuntu 11.10</a></h2>
<p>A simple process to install the <em>official</em> <del>Sun</del>Oracle Java JDK and Netbeans IDE in the latest Ubuntu.</p>
<h2><a href="http://thelinuxexperiment.com/guinea-pigs/tyler-b/ubuntu-11-10s-wifi-crashes-my-router/">Ubuntu 11.10′s WiFi crashes my router</a></h2>
<p>The new Ubuntu release is pretty good. Unfortunately it also causes my router to crash.</p>
<h2><a href="http://thelinuxexperiment.com/guinea-pigs/tyler-b/gentoo-a-k-a-compiling/">Gentoo (A.K.A. “Compiling!”)</a></h2>
<p>My first post for the second Linux Experiment where I speak about my Gentoo first impressions.</p>
<h2><a href="http://thelinuxexperiment.com/guinea-pigs/tyler-b/how-to-enable-rebootshutdown-in-kde-on-gentoo/">How to enable reboot/shutdown in KDE on Gentoo</a></h2>
<h2><a href="http://thelinuxexperiment.com/guinea-pigs/tyler-b/closed-source-amdati-drivers-wireless-networking-and-flash-in-gentoo/">Closed source AMD/ATI drivers, wireless networking and Flash in Gentoo</a></h2>
<h2><a href="http://thelinuxexperiment.com/guinea-pigs/tyler-b/how-to-update-your-whole-gentoo-system/">How to update your (whole) Gentoo system</a></h2>
<p>A trio of small posts that walk new Gentoo users through setting up and doing some basic things in their new desktop.</p>
<h2><a href="http://thelinuxexperiment.com/guinea-pigs/tyler-b/how-to-play-red-alert-2-on-linux/">How to play Red Alert 2 on Linux</a></h2>
<p>I managed to get this classic game to run great on Linux. It even includes a bit of a hack that allows you to play LAN games. I don&#8217;t think you can even do that on Windows any more.</p>
<h2><a href="http://thelinuxexperiment.com/guinea-pigs/tyler-b/oh-gentoo/">Oh Gentoo</a></h2>
<p>My final post of the second Linux Experiment. Includes my conclusions on running Gentoo as a day-to-day desktop system.</p>
<div class="shr-publisher-656"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.tylerburton.ca/2012/01/the-linux-experiment-post-roundup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A couple of new posts on The Linux Experiment</title>
		<link>http://www.tylerburton.ca/2011/07/a-couple-of-new-posts-on-the-linux-experiment/</link>
		<comments>http://www.tylerburton.ca/2011/07/a-couple-of-new-posts-on-the-linux-experiment/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 18:26:02 +0000</pubDate>
		<dc:creator>Tyler Burton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[loopback]]></category>
		<category><![CDATA[PulseAudio]]></category>
		<category><![CDATA[The Linux Experiment]]></category>
		<category><![CDATA[X.org]]></category>

		<guid isPermaLink="false">http://www.tylerburton.ca/?p=637</guid>
		<description><![CDATA[In case you somehow found your way here and haven&#8217;t already seen them over at The Linux Experiment, I have put up two new posts that deal with fixes for your linux desktop. Two monitors. Different resolutions. One desktop. If you&#8217;ve ever wondered how to use two monitors with different resolutions as a single, unified, [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>In case you somehow found your way here and haven&#8217;t already seen them over at <a href="http://www.thelinuxexperiment.com">The Linux Experiment</a>, I have put up two new posts that deal with fixes for your linux desktop.</p>
<h2><a href="http://thelinuxexperiment.com/guinea-pigs/tyler-b/two-monitors-different-resolutions-one-desktop/">Two monitors. Different resolutions. One desktop.</a></h2>
<p>If you&#8217;ve ever wondered how to use two monitors with different resolutions as a single, unified, extended desktop I highly suggest you do a quick read of this post. I&#8217;ve covered how to avoid, and fix, the &#8216;dead space&#8217; issue where application windows can get lost because of the difference is vertical resolutions.</p>
<h2><a href="http://thelinuxexperiment.com/guinea-pigs/tyler-b/fix-pulseaudio-loopback-delay/">Fix PulseAudio loopback delay</a></h2>
<p>For some reason I encountered an issue where the PulseAudio loopback module introduced a delay in my sound, causing audio and video to be out of sync. Here is a simple solution to fix the issue.</p>
<p>&nbsp;</p>
<p>Hopefully the above two posts can be of use to some of you out there. Let me know if you have any issues getting them to work.</p>
<div class="shr-publisher-637"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.tylerburton.ca/2011/07/a-couple-of-new-posts-on-the-linux-experiment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamically load a jar at runtime</title>
		<link>http://www.tylerburton.ca/2011/06/dynamically-load-a-jar-at-runtime/</link>
		<comments>http://www.tylerburton.ca/2011/06/dynamically-load-a-jar-at-runtime/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 01:10:48 +0000</pubDate>
		<dc:creator>Tyler Burton</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[jar]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.tylerburton.ca/?p=607</guid>
		<description><![CDATA[How to dynamical load jar files at runtime]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>A short post but I figured I would throw it up here before I lose my code. There are a couple of different ways that you can load jar&#8217;d code at runtime but here is a simple solution that I found to work very easily.</p>
<pre>
       File myJar = new File("myJar.jar");
       URL url = myJar.toURI().toURL();

       Class<?>[] parameters = new Class[]{URL.class};

        URLClassLoader sysLoader = (URLClassLoader)ClassLoader.getSystemClassLoader();
        Class<?> sysClass = URLClassLoader.class;
        try
        {
            Method method = sysClass.getDeclaredMethod("addURL", parameters);
            method.setAccessible(true);
            method.invoke(sysLoader,new Object[]{ url });

            Constructor<?> cs = ClassLoader.getSystemClassLoader().loadClass("com.example.MyClass").getConstructor();
            MyInterface instance = (MyInterface)cs.newInstance();
            instance.someFunction();
        }
        catch(Exception ex)
        {
            System.err.println(ex.getMessage());
        }
</pre>
<p>In the code example above the jar at the location pointed to by the <i>url</i> object is dynamically loaded and an instance of the class <i>com.example.MyClass</i> is created that conforms to a known interface <i>MyInterface</i>. This could be used in a situation where you are loading plugins that use a common interface example.</p>
<div class="shr-publisher-607"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.tylerburton.ca/2011/06/dynamically-load-a-jar-at-runtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a GStreamer powered Java media player</title>
		<link>http://www.tylerburton.ca/2011/03/create-a-gstreamer-powered-java-media-player/</link>
		<comments>http://www.tylerburton.ca/2011/03/create-a-gstreamer-powered-java-media-player/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 02:18:08 +0000</pubDate>
		<dc:creator>Tyler Burton</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[GStreamer]]></category>
		<category><![CDATA[media player]]></category>
		<category><![CDATA[mp3]]></category>

		<guid isPermaLink="false">http://www.tylerburton.ca/?p=593</guid>
		<description><![CDATA[For something to do I decided to see if I could create a very simple Java media player. After doing some research, and finding out that the Java Media Framework was no longer in development, I decided to settle on GStreamer to power my media player. GStreamer for the uninitiated is a very powerful multimedia [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>For something to do I decided to see if I could create a very simple Java media player. After doing some research, and finding out that the <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Java_Media_Framework">Java Media Framework</a> was no longer in development, I decided to settle on <a href="http://gstreamer.freedesktop.org/">GStreamer</a> to power my media player.</p>
<p><a href="https://secure.wikimedia.org/wikipedia/en/wiki/Gstreamer">GStreamer</a> for the uninitiated is a very powerful multimedia framework that offers both low-level pipeline building as well as high-level playback abstraction. What&#8217;s nice about GStreamer, besides being completely open source, is that it presents a unified API no matter what type of file it is playing. For instance if the user only has the free, high quality GStreamer <em>codecs</em> installed, referred to as the <em>good</em> plugins, then the API will only play those files. If however the user installs the other plugins as well, be it the <em>bad</em> or <em>ugly</em> sets, the API remains the same and thus you don&#8217;t need to update your code. Unfortunately being a C library this approach does have some drawbacks, notably the need to include the <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Java_Native_Access">JNA</a> jar as well as the system specific libraries. This approach can be considered similar to how <a href="http://www.tylerburton.ca/2010/09/hash-verifier-0-3-0-0-a-k-a-the-swt-re-write/">SWT</a> works.</p>
<p><strong>Setup</strong></p>
<p>Assuming that you already have a Java development environment, the first thing you&#8217;ll need is to install GStreamer. On Linux odds are you already have it, unless you are running a rather stripped down distro or don&#8217;t have many media players installed (both <a href="http://projects.gnome.org/rhythmbox/">Rhythmbox</a> and <a href="http://banshee.fm/">Banshee</a> use GStreamer). If you don&#8217;t it should be pretty straight forward to install along with your choice of plugins. On Windows you&#8217;ll need to head over to <a href="https://code.google.com/p/ossbuild/">ossbuild</a> where they have downloadable installers.</p>
<p>The second thing you&#8217;ll need is gstreamer-java which you can grab over at their website <a href="https://code.google.com/p/gstreamer-java/">here</a>. You&#8217;ll need to download both gstreamer-java-1.4.jar and jna-3.2.4.jar. Both might contain some extra files that you probably don&#8217;t need and can prune out later if you&#8217;d like. Setup your development environment so that both of these jar files are in your build path.</p>
<p><strong>Simple playback</strong></p>
<p>GStreamer offers highly abstracted playback engines called PlayBins. This is what we will use to actually play our files. Here is a very simple code example that demonstrates how to actually make use of a PlayBin:</p>
<pre>public static void main(String[] args) {
     args = Gst.init("MyMediaPlayer", args);

     Playbin playbin = new PlayBin("AudioPlayer");
     playbin.setVideoSink(ElementFactory.make("fakesink", "videosink"));
     playbin.setInputFile("song.mp3");

     playbin.setState(State.PLAYING);
     Gst.main();
     playbin.setState(State.NULL);
}</pre>
<p>So what does it all mean?</p>
<pre>public static void main(String[] args) {
     args = Gst.init("MyMediaPlayer", args);</pre>
<p>The above line takes the incoming command line arguments and passes them to the Gst.init function and returns a new set of arguments. If you have ever done any <a href="http://www.gtk.org/">GTK+</a> programming before this should be instantly recognizable to you. Essentially what GStreamer is doing is grabbing, and removing, any GStreamer specific arguments before your program will actually process them.</p>
<pre>     Playbin playbin = new PlayBin("AudioPlayer");
     playbin.setVideoSink(ElementFactory.make("fakesink", "videosink"));
     playbin.setInputFile("song.mp3");
</pre>
<p>The first line of code requests a standard &#8220;AudioPlayer&#8221; PlayBin. This PlayBin is built right into GStreamer and automatically sets up a default pipeline for you. Essentially this lets us avoid all of the low-level craziness that we would have to normally deal with if we were starting from scratch.</p>
<p>The next line sets the PlayBin&#8217;s VideoSink, think of sinks as output locations, to a &#8220;fakesink&#8221; or null sink. The reason we do this is because PlayBin&#8217;s can play both audio and video. For the purposes of this player we only want audio playback so we automatically redirect all video output to the &#8220;fakesink&#8221;.</p>
<p>The last line is pretty straight forward and just tells GStreamer what file to play.</p>
<pre>     playbin.setState(State.PLAYING);
     Gst.main();
     playbin.setState(State.NULL);
</pre>
<p>Finally with the above lines of code we tell the PlayBin to actually start playing and then enter the GStreamer main loop. This loop continues for the duration. The last line is used to reset the PlayBin state and do some cleanup.</p>
<p><strong>Bundle it with a quick GUI</strong></p>
<p>To make it a little more friendly I wrote a very quick GUI to wrap all of the functionality with. The download links for that (binary only package), as well as the source (all package) is below. And there you have it: a very simple cross-platform media player that will playback pretty much anything you throw at it.</p>
<table border="1">
<tbody>
<tr>
<td></td>
<td><strong>Binary Only Package</strong></td>
<td><strong>All Package</strong></td>
</tr>
<tr>
<td><strong>File name:</strong></td>
<td>my_media_player_binary.zip</td>
<td>my_media_player_all.zip</td>
</tr>
<tr>
<td><strong>File hashes:</strong></td>
<td style="text-align: center;" colspan="2"><a href="http://www.tylerburton.ca/files/hashes/my_media_player_march_13_2011.hashes.txt" target="_blank">Download Here</a></td>
</tr>
<tr>
<td><strong>GPG signature:</strong></td>
<td><a href="http://www.tylerburton.ca/files/sigs/my_media_player_13_2011_binary.zip.sig">Download Here</a></td>
<td><a href="http://www.tylerburton.ca/files/sigs/my_media_player_march_13_2011_all.zip.sig">Download Here</a></td>
</tr>
<tr>
<td><strong>Screenshots:</strong></td>
<td><a href="http://www.tylerburton.ca/files/wordpress/2011/03/MyMediaPlayerWindows.jpg"><img class="aligncenter size-medium wp-image-597" title="MyMediaPlayerWindows" src="http://www.tylerburton.ca/files/wordpress/2011/03/MyMediaPlayerWindows-300x95.jpg" alt="" width="200" height="63" /></a></td>
<td><a href="http://www.tylerburton.ca/files/wordpress/2011/03/MyMediaPlayerLinux.jpg"><img class="aligncenter size-medium wp-image-599" title="MyMediaPlayerLinux" src="http://www.tylerburton.ca/files/wordpress/2011/03/MyMediaPlayerLinux-300x104.jpg" alt="" width="200" height="69" /></a></td>
</tr>
<tr>
<td><strong>Version:</strong></td>
<td style="text-align: center;" colspan="2">March 13, 2011</td>
</tr>
<tr>
<td><strong>File size:</strong></td>
<td>1.5MB</td>
<td>1.51MB</td>
</tr>
<tr>
<td><strong>File download:</strong></td>
<td><a href="http://www.tylerburton.ca/files/apps/my_media_player_13_2011_binary.zip">Download Here</a></td>
<td><a href="http://www.tylerburton.ca/files/apps/my_media_player_march_13_2011_all.zip">Download Here</a></td>
</tr>
</tbody>
</table>
<div class="shr-publisher-593"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.tylerburton.ca/2011/03/create-a-gstreamer-powered-java-media-player/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Objective-C IDE</title>
		<link>http://www.tylerburton.ca/2011/01/objective-c-ide/</link>
		<comments>http://www.tylerburton.ca/2011/01/objective-c-ide/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 17:54:38 +0000</pubDate>
		<dc:creator>Tyler Burton</dc:creator>
				<category><![CDATA[Created by Tyler Burton]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[GTK+]]></category>
		<category><![CDATA[IDE]]></category>

		<guid isPermaLink="false">http://www.tylerburton.ca/?p=582</guid>
		<description><![CDATA[With no real alternative to Xcode on non-Mac platforms there is a real lack of a genuine development environment for Objective-C. With projects like GNUstep picking up the Objective-C runtime portion of the equation I&#8217;ve decided to try my hand at filling the other gap by creating a very simple IDE strictly for Objective-C. My [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>With no real alternative to <a href="http://en.wikipedia.org/wiki/Xcode" target="_blank">Xcode</a> on non-<a href="http://en.wikipedia.org/wiki/Mac_OS" target="_blank">Mac</a> platforms there is a real lack of a genuine development environment for <a href="http://en.wikipedia.org/wiki/Objective-C" target="_blank">Objective-C</a>. With projects like <a href="http://en.wikipedia.org/wiki/GNUstep" target="_blank">GNUstep</a> picking up the Objective-C runtime portion of the equation I&#8217;ve decided to try my hand at filling the other gap by creating a very simple <a href="http://en.wikipedia.org/wiki/Integrated_development_environment" target="_blank">IDE</a> strictly for Objective-C. My goals were simple: create a basic IDE written in Objective-C that provides syntax highlighting, one button program compilation, and (if I could get it to work) some form of auto-complete or a suggestion system.</p>
<p>For my project I decided to target the cross-platform <a href="http://en.wikipedia.org/wiki/GTK%2B" target="_blank">GTK+</a> because while Objective-C has the <a href="http://en.wikipedia.org/wiki/Application_Kit" target="_blank">AppKit</a> GUI libraries they just don&#8217;t look native enough for my liking. In addition because Objective-C is backwards compatible with all C code I could easily embed the GTK+ calls within wrapped objects and methods.</p>
<p><a href="http://www.tylerburton.ca/files/wordpress/2011/01/ide1.jpg"><img class="aligncenter size-medium wp-image-584" title="ide1" src="http://www.tylerburton.ca/files/wordpress/2011/01/ide1-300x233.jpg" alt="" width="300" height="233" /></a></p>
<p>With a simple press of a button the program is compiled and run in the terminal just as you would expect.</p>
<p><a href="http://www.tylerburton.ca/files/wordpress/2011/01/ide2.jpg"><img class="aligncenter size-medium wp-image-585" title="ide2" src="http://www.tylerburton.ca/files/wordpress/2011/01/ide2-300x66.jpg" alt="" width="300" height="66" /></a></p>
<p>As you can see I&#8217;ve so far succeeded in my simple goals. Although this project is still very much a work in progress I do hope to be able to release the source to it once I get it to a point where it is cleaned up and feature complete.</p>
<p><a href="http://www.tylerburton.ca/files/wordpress/2011/01/ide3.jpg"><img class="aligncenter size-medium wp-image-587" title="ide3" src="http://www.tylerburton.ca/files/wordpress/2011/01/ide3-300x218.jpg" alt="" width="300" height="218" /></a></p>
<div class="shr-publisher-582"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.tylerburton.ca/2011/01/objective-c-ide/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My (current) top 10 most used iOS apps</title>
		<link>http://www.tylerburton.ca/2010/12/my-current-top-10-most-used-ios-apps/</link>
		<comments>http://www.tylerburton.ca/2010/12/my-current-top-10-most-used-ios-apps/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 19:45:15 +0000</pubDate>
		<dc:creator>Tyler Burton</dc:creator>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Corus Radio]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[IM+]]></category>
		<category><![CDATA[IMDb]]></category>
		<category><![CDATA[Netflix]]></category>
		<category><![CDATA[Newsy]]></category>
		<category><![CDATA[PingChat!]]></category>
		<category><![CDATA[TweetDeck]]></category>
		<category><![CDATA[VLC]]></category>

		<guid isPermaLink="false">http://www.tylerburton.ca/?p=559</guid>
		<description><![CDATA[The iOS platform, consisting of the iPhone and the iPad, has seen most of it&#8217;s success thanks to the plethora of applications (apps) available for download. It is without a doubt the platform&#8217;s strongest asset and one that, thanks to the continued success of apps like Angry Birds, seems likely to continue for some time. [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>The <a href="http://en.wikipedia.org/wiki/IOS_%28Apple%29">iOS platform</a>, consisting of the <a href="http://www.apple.com/iphone/">iPhone</a> and the <a href="http://www.apple.com/ipad/">iPad</a>, has seen most of it&#8217;s success thanks to the plethora of applications (apps) available for download. It is without a doubt the platform&#8217;s strongest asset and one that, thanks to the continued success of apps like <a href="http://www.rovio.com/index.php?page=angry-birds">Angry Birds</a>, seems likely to continue for some time. While a lot of time on these devices is spent listening to music, browsing the web, reading e-mails and, let&#8217;s face it, playing games I wanted to write up a quick post about some of the other apps that I use on a regular basis. These small, often single purpose, programs make my life easier in their unique way and keep me connected no matter where I am. The following is a list of apps, ordered by how often I use them, that I am currently making heavy use of on my iPhone.</p>
<p><strong>10. <a href="http://www.videolan.org/">VLC</a></strong></p>
<p>The iOS media player can play a large number of audio and video formats. Unfortunately there are still a few obscure formats, and some that Apple just doesn&#8217;t like, that won&#8217;t work. This is where VLC comes in. Like the desktop counterpart, VLC lets the device play almost every file type imaginable, from <a href="http://en.wikipedia.org/wiki/Matroska">MKV</a> to <a href="http://en.wikipedia.org/wiki/Ogg">OGG</a>. It even integrates into the e-mail client letting me view attachments that I otherwise wouldn&#8217;t have been able to. The only drawback is the ridiculous way you have to add media to the VLC library. Sadly this is on Apple&#8217;s side of the equation and I doubt we&#8217;ll see this changed anytime soon.</p>
<div id="attachment_560" class="wp-caption aligncenter" style="width: 330px"><a href="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0423.png"><img class="size-full wp-image-560" title="IMG_0423" src="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0423.png" alt="" width="320" height="480" /></a><p class="wp-caption-text">Do I have to read a manual first too?</p></div>
<p><strong>9. <a href="http://www.imdb.com/">IMDb</a></strong></p>
<p>The Internet Movie Database is an awesome website that tracks almost <em>ever</em> detail of a movie&#8217;s production (from actors to directors and more). This app is the iOS version of their website (they actually block you from using the proper website on your device). Thankfully this is also one of the most well designed and easy to use apps I have ever seen. Need to find the name of that actress? No problem. Want to know what else she&#8217;s been in? Super simple. This app is a staple that everyone should have installed.</p>
<div id="attachment_561" class="wp-caption aligncenter" style="width: 330px"><a href="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0424.png"><img class="size-full wp-image-561" title="IMG_0424" src="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0424.png" alt="" width="320" height="480" /></a><p class="wp-caption-text">It even gives you movie news and showtimes</p></div>
<p><strong>8. <a href="http://itunes.apple.com/ca/app/corus-radio/id302901619?mt=8">Corus Radio</a></strong></p>
<p>There are a number of streaming radio apps available for download from <a href="http://www.shoutcast.com/">Shoutcast!</a> to those specific to a certain radio station. Corus Radio is one such application. It makes it easy to listen to any of the Corus owned radio stations all from within a single app. From a design perspective this is not a very good app, but its no frills approach makes it sufficient for me when I want to catch the early morning <a href="http://www.edge.ca/">Dean Blundell Show</a>.</p>
<div id="attachment_562" class="wp-caption aligncenter" style="width: 330px"><a href="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0425.png"><img class="size-full wp-image-562" title="IMG_0425" src="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0425.png" alt="" width="320" height="480" /></a><p class="wp-caption-text">No frills but it does the job</p></div>
<p><strong>7. <a href="http://itunes.apple.com/us/app/convert-units-for-free/id337224035?mt=8">Convert Units</a></strong></p>
<p>Have you ever been reading a recipe or following directions and had to convert between oz and mL or lbs and kg? Enter Convert Units. This super handy application lets you easily convert between all sorts of different units for all kinds of situations</p>
<div id="attachment_563" class="wp-caption aligncenter" style="width: 330px"><a href="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0426.png"><img class="size-full wp-image-563" title="IMG_0426" src="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0426.png" alt="" width="320" height="480" /></a><p class="wp-caption-text">Did you know 1 beer = 0.355L?</p></div>
<div id="attachment_564" class="wp-caption aligncenter" style="width: 330px"><a href="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0427.png"><img class="size-full wp-image-564" title="IMG_0427" src="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0427.png" alt="" width="320" height="480" /></a><p class="wp-caption-text">Convert Units works in all sorts of different situations</p></div>
<p><strong>6. <a href="http://www.netflix.com">Netflix</a></strong></p>
<p>With the recent release of Netflix <a href="http://www.netflix.ca">in Canada</a> I am suddenly able to try out this service from the comfort of my&#8230; phone. OK so maybe it&#8217;s not the best way to watch movies but it&#8217;s still really cool. There isn&#8217;t much to really say about this beyond the fact that this is yet another excellent Netflix experience.</p>
<div id="attachment_568" class="wp-caption aligncenter" style="width: 330px"><a href="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0428.png"><img class="size-full wp-image-568" title="IMG_0428" src="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0428.png" alt="" width="320" height="480" /></a><p class="wp-caption-text">I wonder how much data a movie uses over 3G</p></div>
<p><strong>5. <a href="http://www.facebook.com">Facebook</a></strong></p>
<p>Ah Facebook. Whatever your feelings are about this privacy eroding service that enables <span style="text-decoration: line-through;">complete publication of your life</span> you to keep in touch with friends and family, Facebook (the app) is a prime example of how an iOS program should work. It is so simple and feature rich (a rare combination) that I actually prefer it to the full website.</p>
<div id="attachment_565" class="wp-caption aligncenter" style="width: 330px"><a href="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0438.png"><img class="size-full wp-image-565" title="IMG_0438" src="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0438.png" alt="" width="320" height="480" /></a><p class="wp-caption-text">Even better than their excellent mobile site</p></div>
<p><strong>4. <a href="http://www.newsy.com/">Newsy</a></strong></p>
<p>Newsy is an interesting app, actually more of a front end to their website, that combines various perspectives of a newsworthy event from different TV news shows, blogs and radio commentators. Their tag-line is &#8220;Multiple sources. The real story.&#8221; and one that I believe they live up to. If you are looking for a more or less non-bias summary of something in the news I would highly recommend checking out Newsy.</p>
<div id="attachment_567" class="wp-caption aligncenter" style="width: 490px"><a href="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0429.png"><img class="size-full wp-image-567" title="IMG_0429" src="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0429.png" alt="" width="480" height="320" /></a><p class="wp-caption-text">Top stories of the day (videos and transcripts)</p></div>
<p><strong>3. <a href="http://www.tweetdeck.com/">TweetDeck</a></strong></p>
<p>There are literally dozens, maybe even hundreds, of Twitter clients for iOS but none are as fully featured (in my opinion at least) as TweetDeck. Taking a cue from their desktop version, this client displays all of the information in a series of columns that you can swipe back and forth to cycle through.</p>
<div id="attachment_569" class="wp-caption aligncenter" style="width: 330px"><a href="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0432.png"><img class="size-full wp-image-569" title="IMG_0432" src="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0432.png" alt="" width="320" height="480" /></a><p class="wp-caption-text">Everything is split up into customizable columns</p></div>
<p>If you do use the desktop version as well it will automatically sync things between them so you don&#8217;t have to constantly update both independently. My only complaints have to do with the lack of real multitasking and the crash happy nature of the in-application browser. Honestly I don&#8217;t know how they did it&#8230; but they took the perfectly stable browser component and broke it.</p>
<p><strong>2. <a href="http://www.pingchat.com/">PingChat!</a></strong></p>
<p>PingChat! has the <a href="http://www.thestar.com/business/companies/rim/article/902240--rim-kik-and-bbm">dubious honour</a> of being one of the <a href="http://supportforums.blackberry.com/t5/Downloaded-Applications-for/GIVE-US-BACK-OUR-KIK-MESSENGER-SERVICE/m-p/658955">only remaining</a> cross-platform instant messengers in the vein of <a href="http://en.wikipedia.org/wiki/BlackBerry_Messenger">BlackBerry Messenger</a>. This means that from your iOS device can talk to your friend on an Android device or even on a BlackBerry.</p>
<div id="attachment_570" class="wp-caption aligncenter" style="width: 330px"><a href="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0434.png"><img class="size-full wp-image-570" title="IMG_0434" src="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0434.png" alt="" width="320" height="480" /></a><p class="wp-caption-text">PingChat! also supports group chat</p></div>
<p>Like BBM, PingChat! shows you when the other party has received a message and runs over the data network, thus saving you from text messaging fees. Another nice feature is the ability to send pictures, video, audio, contact information and more.</p>
<div id="attachment_571" class="wp-caption aligncenter" style="width: 330px"><a href="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0435.png"><img class="size-full wp-image-571" title="IMG_0435" src="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0435.png" alt="" width="320" height="480" /></a><p class="wp-caption-text">The send contact feature is especially useful for quickly sharing information</p></div>
<p>I <strong>highly</strong> recommend this application, and not just because <a href="http://enflick.com/">the guys behind it</a> are local <img src='http://www.tylerburton.ca/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>1. <a href="http://www.shapeservices.com/en/products/details.php?product=im&amp;platform=none">IM+</a></p>
<p>iOS has a slew of instant messenger applications but I prefer IM+ to all of the other ones that I&#8217;ve tried. A slick interface, tons of features, and a quick update cycle means that this app is constantly improving.</p>
<div id="attachment_572" class="wp-caption aligncenter" style="width: 330px"><a href="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0436.png"><img class="size-full wp-image-572" title="IMG_0436" src="http://www.tylerburton.ca/files/wordpress/2010/12/IMG_0436.png" alt="" width="320" height="480" /></a><p class="wp-caption-text">Trust me, it looks better without all of the censorship <img src='http://www.tylerburton.ca/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p></div>
<p>You can send pictures, audio, and videos to your contacts, talk on all different types of services (MSN, AOL, etc.) and even configure it to stay logged in on their servers so that (even with the application closed) you get Push notifications when someone messages you. Overall it offers a solid experience that is only getting better and better.</p>
<p><strong>Honourable Mention</strong></p>
<p><a href="http://www.epicgames.com/">Epic</a> has recently released a tech demo called <em>Citadel</em> showcasing the <a href="http://en.wikipedia.org/wiki/Unreal_Engine">Unreal Engine</a> running on iOS. This is by far the best example of what the iPhone/iPad hardware is capable of in terms of delivering absolutely stunning graphics. Sadly that&#8217;s all it is, a tech demo. Hopefully we will see this technology <a href="http://itunes.apple.com/us/app/infinity-blade/id387428400?mt=8">used more often</a> going forward.</p>
<div id="attachment_573" class="wp-caption aligncenter" style="width: 490px"><a href="http://www.tylerburton.ca/files/wordpress/2010/12/photo.png"><img class="size-full wp-image-573" title="photo" src="http://www.tylerburton.ca/files/wordpress/2010/12/photo.png" alt="" width="480" height="320" /></a><p class="wp-caption-text">Very gorgeous graphics</p></div>
<div class="shr-publisher-559"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.tylerburton.ca/2010/12/my-current-top-10-most-used-ios-apps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create a GTK+ application on Linux with Objective-C</title>
		<link>http://www.tylerburton.ca/2010/12/create-a-gtk-application-on-linux-with-objective-c/</link>
		<comments>http://www.tylerburton.ca/2010/12/create-a-gtk-application-on-linux-with-objective-c/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 03:12:06 +0000</pubDate>
		<dc:creator>Tyler Burton</dc:creator>
				<category><![CDATA[Created by Tyler Burton]]></category>
		<category><![CDATA[F/OSS]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[GNUstep]]></category>
		<category><![CDATA[GTK+]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.tylerburton.ca/?p=538</guid>
		<description><![CDATA[As sort of follow-up-in-spirit to my older post I decided to share a really straight forward way to use Objective-C to build GTK+ applications. Objective-what? Objective-C is an improvement to the iconic C programming language that remains backwards compatible while adding many new and interesting features. Chief among these additions is syntax for real objects [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>As sort of follow-up-in-spirit to <a href="http://www.tylerburton.ca/2010/03/the-case-for-objective-c/">my older post</a> I decided to share a really straight forward way to use Objective-C to build GTK+ applications.</p>
<p><strong>Objective-what?</strong></p>
<p><a href="http://en.wikipedia.org/wiki/Objective-C">Objective-C</a> is an improvement to the iconic <a href="http://en.wikipedia.org/wiki/C_%28programming_language%29">C programming language</a> that remains backwards compatible while adding many new and interesting features. Chief among these additions is syntax for real objects (and thus <a href="http://en.wikipedia.org/wiki/Object-oriented_programming">object-oriented programming</a>). Popularized by <a href="http://en.wikipedia.org/wiki/NeXT">NeXT</a> and eventually <a href="http://www.apple.com">Apple</a>, Objective-C is most commonly seen in development for Apple OSX and iOS based platforms. It ships with or without a large standard library (sometimes referred to as the <a href="http://en.wikipedia.org/wiki/GNUstep#Foundation_Kit">Foundation Kit</a> library) that makes it very easy for developers to quickly create fast and efficient programs. The result is a language that compiles down to binary, requires no virtual machines (just a runtime library), and achieves performance comparable to C and C++.</p>
<p><strong>Marrying Objective-C with GTK+</strong></p>
<p>Normally when writing a <a href="http://en.wikipedia.org/wiki/GTK%2B">GTK+</a> application the language (or a library) will supply you with <a href="http://en.wikipedia.org/wiki/GTK%2B#Programming_language_bindings">bindings</a> that let you create GUIs in a way native to that language. So for instance in <a href="http://en.wikipedia.org/wiki/C%2B%2B">C++</a> you would create GTK+ objects, whereas in C you would create structures or ask functions for pointers back to the objects. Unfortunately while there used to exist a couple of different Objective-C bindings for GTK+, all of them are quite out of date. So instead we are going to rely on the fact that Objective-C is backwards compatible with C to get our program to work.</p>
<p><strong>What you need to start</strong></p>
<p>I&#8217;m going to assume that <a href="http://www.ubuntu.com">Ubuntu</a> will be our operating system for development. To ensure that we have what we need to compile the programs, just install the following packages:</p>
<ol>
<li>gnustep-core-devel</li>
<li>libgtk2.0-dev</li>
</ol>
<p>As you can see from the list above we will be using <a href="http://en.wikipedia.org/wiki/GNUstep">GNUstep</a> as our Objective-C library of choice.</p>
<p><strong>Setting it all up</strong></p>
<p>In order to make this work we will be creating two Objective-C classes, one that will house our GTK+ window and another that will actually start our program. I&#8217;m going to call my GTK+ object MainWindow and create the two necessary files: <em>MainWindow.h</em> and <em>MainWindow.m</em>. Finally I will create a <em>main.m</em> that will start the program and clean it up after it is done. <strong></strong></p>
<p><strong>Let me apologize here for the poor code formatting; apparently WordPress likes to destroy whatever I try and do to make it better. If you want properly indented code please see the download link below.</strong></p>
<p><strong>MainWindow.h</strong></p>
<p>In the MainWindow.h file put the following code:</p>
<blockquote><p>#import &lt;gtk/gtk.h&gt;<br />
#import &lt;Foundation/NSObject.h&gt;<br />
#import &lt;Foundation/NSString.h&gt;</p>
<p>//A pointer to this object (set on init) so C functions can call<br />
//Objective-C functions<br />
id myMainWindow;</p>
<p>/*<br />
* This class is responsible for initializing the GTK render loop<br />
* as well as setting up the GUI for the user. It also handles all GTK<br />
* callbacks for the winMain GtkWindow.<br />
*/<br />
@interface MainWindow : NSObject<br />
{<br />
//The main GtkWindow<br />
GtkWidget *winMain;<br />
GtkWidget *button;<br />
}</p>
<p>/*<br />
* Constructs the object and initializes GTK and the GUI for the<br />
* application.<br />
*<br />
* *********************************************************************<br />
* Input<br />
* *********************************************************************<br />
* argc (int *):    A pointer to the arg count variable that was passed<br />
*             in at the application start. It will be returned<br />
*            with the count of the modified argv array.<br />
* argv (char *[]):     A pointer to the argument array that was passed in<br />
*            at the application start. It will be returned with<br />
*            the GTK arguments removed.<br />
*<br />
* *********************************************************************<br />
* Returns<br />
* *********************************************************************<br />
* MainWindow (id):    The constructed object or nil<br />
* arc (int *):        The modified input int as described above<br />
* argv (char *[]):    The modified input array modified as described above<br />
*/<br />
-(id)initWithArgCount:(int *)argc andArgVals:(char *[])argv;</p>
<p>/*<br />
* Frees the Gtk widgets that we have control over<br />
*/<br />
-(void)destroyWidget;</p>
<p>/*<br />
* Starts and hands off execution to the GTK main loop<br />
*/<br />
-(void)startGtkMainLoop;</p>
<p>/*<br />
* Example Objective-C function that prints some output<br />
*/<br />
-(void)printSomething;</p>
<p>/*<br />
********************************************************<br />
* C callback functions<br />
********************************************************<br />
*/</p>
<p>/*<br />
* Called when the user closes the window<br />
*/<br />
void on_MainWindow_destroy(GtkObject *object, gpointer user_data);</p>
<p>/*<br />
* Called when the user presses the button<br />
*/<br />
void on_btnPushMe_clicked(GtkObject *object, gpointer user_data);</p>
<p>@end</p></blockquote>
<p><strong>MainWindow.m</strong></p>
<p>For the class&#8217; actual code file fill it in as show below. This class will create a GTK+ window with a single button and will react to both the user pressing the button, and closing the window.</p>
<blockquote><p>#import &#8220;MainWindow.h&#8221;</p>
<p>/*<br />
* For documentation see MainWindow.h<br />
*/</p>
<p>@implementation MainWindow</p>
<p>-(id)initWithArgCount:(int *)argc andArgVals:(char *[])argv<br />
{<br />
//call parent class&#8217; init<br />
if (self = [super init]) {</p>
<p>//setup the window<br />
winMain = gtk_window_new (GTK_WINDOW_TOPLEVEL);</p>
<p>gtk_window_set_title (GTK_WINDOW (winMain), &#8220;Hello World&#8221;);<br />
gtk_window_set_default_size(GTK_WINDOW(winMain), 230, 150);</p>
<p>//setup the button<br />
button = gtk_button_new_with_label (&#8220;Push me!&#8221;);</p>
<p>gtk_container_add (GTK_CONTAINER (winMain), button);</p>
<p>//connect the signals<br />
g_signal_connect (winMain, &#8220;destroy&#8221;, G_CALLBACK (on_MainWindow_destroy), NULL);<br />
g_signal_connect (button, &#8220;clicked&#8221;, G_CALLBACK (on_btnPushMe_clicked), NULL);</p>
<p>//force show all<br />
gtk_widget_show_all(winMain);<br />
}</p>
<p>//assign C-compatible pointer<br />
myMainWindow = self;</p>
<p>//return pointer to this object<br />
return self;<br />
}</p>
<p>-(void)startGtkMainLoop<br />
{<br />
//start gtk loop<br />
gtk_main();<br />
}</p>
<p>-(void)printSomething{<br />
NSLog(@&#8221;Printed from Objective-C&#8217;s NSLog function.&#8221;);<br />
printf(&#8220;Also printed from standard printf function.\n&#8221;);<br />
}</p>
<p>-(void)destroyWidget{</p>
<p>myMainWindow = NULL;</p>
<p>if(GTK_IS_WIDGET (button))<br />
{<br />
//clean up the button<br />
gtk_widget_destroy(button);<br />
}</p>
<p>if(GTK_IS_WIDGET (winMain))<br />
{<br />
//clean up the main window<br />
gtk_widget_destroy(winMain);<br />
}<br />
}</p>
<p>-(void)dealloc{<br />
[self destroyWidget];</p>
<p>[super dealloc];<br />
}</p>
<p>void on_MainWindow_destroy(GtkObject *object, gpointer user_data)<br />
{<br />
//exit the main loop<br />
gtk_main_quit();<br />
}</p>
<p>void on_btnPushMe_clicked(GtkObject *object, gpointer user_data)<br />
{<br />
printf(&#8220;Button was clicked\n&#8221;);</p>
<p>//call Objective-C function from C function using global object pointer<br />
[myMainWindow printSomething];<br />
}</p>
<p>@end</p></blockquote>
<p><strong>main.m</strong></p>
<p>To finish I will write a main file and function that creates the MainWindow object and eventually cleans it up. Objective-C (1.0) does not support automatic garbage collection so it is important that we don&#8217;t forget to clean up after ourselves.</p>
<blockquote><p>#import &#8220;MainWindow.h&#8221;<br />
#import &lt;Foundation/NSAutoreleasePool.h&gt;</p>
<p>int main(int argc, char *argv[]) {</p>
<p>//create an AutoreleasePool<br />
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];</p>
<p>//init gtk engine<br />
gtk_init(&amp;argc, &amp;argv);</p>
<p>//set up GUI<br />
MainWindow *mainWindow = [[MainWindow alloc] initWithArgCount:&amp;argc andArgVals:argv];</p>
<p>//begin the GTK loop<br />
[mainWindow startGtkMainLoop];</p>
<p>//free the GUI<br />
[mainWindow release];</p>
<p>//drain the pool<br />
[pool release];</p>
<p>//exit application<br />
return 0;<br />
}</p></blockquote>
<p><strong>Compiling it all together</strong></p>
<p>Use the following command to compile the program. This will automatically include <strong>all</strong> <em>.m</em> files in the current directory so be careful when and where you run this.</p>
<p>gcc `pkg-config &#8211;cflags &#8211;libs gtk+-2.0` -lgnustep-base -fconstant-string-class=NSConstantString -o &#8220;./myprogram&#8221; $(find . -name &#8216;*.m&#8217;) -I /usr/include/GNUstep/ -L /usr/lib/GNUstep/ -std=c99 -O3</p>
<p>Once complete you will notice a new executable in the directory called <em>myprogram</em>. Start this program and you will see our GTK+ window in action.</p>
<p><a href="http://www.tylerburton.ca/files/wordpress/2010/12/window1.jpg"><img class="aligncenter size-full wp-image-546" title="window1" src="http://www.tylerburton.ca/files/wordpress/2010/12/window1.jpg" alt="" width="242" height="186" /></a></p>
<p>If you run it from the command line you can see the output that we coded when the button is pushed.</p>
<p><a href="http://www.tylerburton.ca/files/wordpress/2010/12/window2.jpg"><img class="aligncenter size-full wp-image-547" title="window2" src="http://www.tylerburton.ca/files/wordpress/2010/12/window2.jpg" alt="" width="658" height="289" /></a></p>
<p><strong>Wrapping it up</strong></p>
<p>There you have it. We now have a program that is written in Objective-C, using C&#8217;s native GTK+ &#8216;bindings&#8217; for the GUI, that can call both regular C and Objective-C functions and code. In addition, thanks to the porting of both GTK+ and GNUstep to Windows, this same code will also produce a cross-platform application that works on both Mac OSX and Windows.</p>
<p><strong>Source Code Downloads</strong></p>
<table border="1">
<tbody>
<tr>
<td></td>
<td><strong>Source Only Package</strong></td>
</tr>
<tr>
<td><strong>File name:</strong></td>
<td>objective_c_gtk_source.zip</td>
</tr>
<tr>
<td><strong>File hashes:</strong></td>
<td style="text-align: center;"><a href="http://www.tylerburton.ca/files/hashes/objective_c_gtk_source.hashes.txt">Download Here</a></td>
</tr>
<tr>
<td><strong>File size:</strong></td>
<td>2.4KB</td>
</tr>
<tr>
<td><strong>File download:</strong></td>
<td style="text-align: center;"><a href="http://www.tylerburton.ca/files/apps/objective_c_gtk_source.zip">Download Here</a></td>
</tr>
</tbody>
</table>
<div class="shr-publisher-538"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.tylerburton.ca/2010/12/create-a-gtk-application-on-linux-with-objective-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playing around with Django</title>
		<link>http://www.tylerburton.ca/2010/11/playing-around-with-django/</link>
		<comments>http://www.tylerburton.ca/2010/11/playing-around-with-django/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 02:35:57 +0000</pubDate>
		<dc:creator>Tyler Burton</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.tylerburton.ca/?p=526</guid>
		<description><![CDATA[Recently I have been messing around with Django, a very cool Python powered web framework that makes it very easy to create websites quickly. Like similar frameworks (i.e. Ruby on Rails, CakePHP, etc.) Django excels at doing most of the heavy lifting for you. What is most jarring at first, and perhaps the most powerful [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Recently I have been messing around with <a href="http://www.djangoproject.com/">Django</a>, a very cool <a href="http://www.python.org/">Python</a> powered web framework that makes it very easy to create websites quickly. Like similar frameworks (i.e. <a href="http://rubyonrails.org/">Ruby on Rails</a>, <a href="http://cakephp.org/">CakePHP</a>, etc.) Django excels at doing most of the heavy lifting for you. What is most jarring at first, and perhaps the most powerful design choice later on, is that Django has an almost complete separation of server side code from website design.</p>
<p><strong>How does it work?</strong></p>
<p>Django works in a very straightforward way.</p>
<ol>
<li>Upon receiving a new request, Django will match the request to a handler function.</li>
<li>The handler function will gather all of the data needed to display the page as well as do any server-side changes (i.e. database updates or whatever).</li>
<li>The handler function will pass the information to the HTML template to render and the result will be sent back to the requester.</li>
</ol>
<p>This very straight forward, three step process is just a high level view of the power that Django offers however.</p>
<p><strong>1. Match incoming requests to an appropriate handler function</strong></p>
<p>This step is actually done by using Django&#8217;s urlpatterns system. Essentially a collection of regex this (very fast!) function easily re-directs your incoming requests to their destinations. For instance in the example below a request to www.example.com/ would be handled by the <em>index_handler</em> function, whereas a request to www.example.com/hello/ would be handled by <em>some_other_function</em>.</p>
<pre>urlpatterns = patterns('',
     ('^/$', index_handler),
     ('^hello/$',  some_other_function),
)</pre>
<p>What&#8217;s beautiful about this is that you can easily change the URL structure of your website (or just change URL mappings) without actually moving any code. So unlike something like classical <a href="http://www.php.net/">PHP</a>, where the code is embedded in the web page, Django simply looks at the incoming URL and then decides which code it should run. If I want to change my URL syntax from www.example.com/blog/ to www.example.com/awesomeblog/ I can do it (without breaking anything!) by just changing this file. And this is just the start of the cool things you can do with this file. As the official Django tutorial says:</p>
<blockquote><p>Because the URL patterns are regular expressions, there really is no limit on what you can do with them. And there&#8217;s no need to add URL cruft such as .php &#8212; unless you have a sick sense of humor, in which case you can do something like this:</p>
<p>(r&#8217;^polls/latest\.php$&#8217;, &#8216;polls.views.index&#8217;),</p>
<p>But, don&#8217;t do that. It&#8217;s silly.</p></blockquote>
<p><strong>2. The handler function</strong></p>
<p>Instead of reinventing the wheel, each handler function is simply a standard Python function that takes in a request object. In its most basic form it looks something like this:</p>
<pre>def hello(request):
     return HttpResponse("Hello world")
</pre>
<p>Of course being standard Python these functions also inherit the ability to do anything Python can do, including using <strong>real</strong> objects. Django does an excellent job of marrying these objects with the database engine so that, if you want to, you don&#8217;t ever have to write any real <a href="http://en.wikipedia.org/wiki/SQL">SQL</a>. Instead Django will handle the creation of highly optimized SQL calls for you automatically when you call basic object functions.</p>
<p>One of the coolest built in features is the <em>Form</em> class. This class represents a standard HTML form as well as a selection of standard rendering formats (i.e. tables, ordered lists, unordered lists, etc.) in addition to allowing you to completely customize them. Why put this HTML in a Python function and not in the HTML template? Because using it here gives us free validation. I&#8217;ll give you an example:</p>
<pre>class ContactForm(forms.Form):
     subject = forms.CharField()
     email = forms.EmailField(required=False)
     message = forms.CharField()
</pre>
<p>Creates a form class with three fields (two of which are required). The resulting HTML (depending on how you want it displayed) is something like:</p>
<pre>&lt;tr&gt;&lt;th&gt;&lt;label for="id_subject"&gt;Subject:&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;input type="text" name="subject" id="id_subject" /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th&gt;&lt;label for="id_email"&gt;Email:&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;input type="text" name="email" id="id_email" /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th&gt;&lt;label for="id_message"&gt;Message:&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;input type="text" name="message" id="id_message" /&gt;&lt;/td&gt;&lt;/tr&gt;</pre>
<p>OK so how is it used?</p>
<pre>def contact(request):
     if request.method == 'POST':
          form = ContactForm(request.POST)
          if form.is_valid():
               return HttpResponse("Everything was valid!")
          else:
               form = ContactForm()
               return render_to_response('contact_form.html', {'form': form})</pre>
<p>This function will accept the form&#8217;s submitted POST arguments, validate them (meaning that at a minimum the <em>subject</em> and <em>message</em> fields need to be filled out) and return a page saying &#8220;Everything was valid!&#8221;. If the form is not valid it simply hands off the form object to the template engine to be rendered into the html file called &#8220;contact_form.html&#8221;</p>
<p><strong>3. The template engine</strong></p>
<p>Sticking to its MVC roots Django makes it very easy for web designers to use the data they need without actually needing to write any real code.</p>
<p>For instance here is the example contact_form.html from above:</p>
<pre>&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Contact us&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;h1&gt;Contact us&lt;/h1&gt;
    &lt;form action="" method="post"&gt;
      &lt;table&gt;
        {{ form.as_table }}
      &lt;/table&gt;
      &lt;input type="submit" value="Submit"&gt;
    &lt;/form&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre>
<p>The {{ }} braces tell the temple engine to place a Python object in the page at that spot. This is great but what if you need to handle multiple pieces of data (like a Python list)? The template engine allows you access to easy functionality to accomplish anything you can think of. Here is an example of some template &#8216;code&#8217; that will put all of the items in <em>item_list</em> in an unordered HTML list for displaying.</p>
<pre>&lt;ul&gt;
  {% for item in item_list %}
    &lt;li&gt;{{ item }}&lt;/li&gt;
  {% endfor %}
&lt;/ul&gt;</pre>
<p><strong>More to come</strong></p>
<p>I know this post sounds a lot like an advertisement but the truth is that the flexibility and power of Django is really stunning. I will definitely be doing some more work in this framework going forward so expect to see more updates sometime in the future.</p>
<p><strong>Useful links:</strong></p>
<ul>
<li><a href="http://djangobook.com/en/2.0/">The (free) Django Book</a></li>
<li><a href="http://docs.djangoproject.com/en/dev/intro/tutorial01/">The official Django tutorials</a></li>
</ul>
<div class="shr-publisher-526"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.tylerburton.ca/2010/11/playing-around-with-django/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

