<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Craig Weston</title>
	<atom:link href="http://craigweston.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://craigweston.wordpress.com</link>
	<description>Just another blog of an aspiring software developer</description>
	<lastBuildDate>Mon, 09 Jun 2008 02:45:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='craigweston.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Craig Weston</title>
		<link>http://craigweston.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://craigweston.wordpress.com/osd.xml" title="Craig Weston" />
	<atom:link rel='hub' href='http://craigweston.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Boost Install on Fedora 8</title>
		<link>http://craigweston.wordpress.com/2008/06/09/boost-install-on-fedora-8/</link>
		<comments>http://craigweston.wordpress.com/2008/06/09/boost-install-on-fedora-8/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 01:56:41 +0000</pubDate>
		<dc:creator>craigweston</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Boost]]></category>
		<category><![CDATA[Boost Jam]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://craigweston.wordpress.com/?p=7</guid>
		<description><![CDATA[Today I reinstalled Boost on Fedora, after a couple of hours of playing around getting everything working I decided to write up a post about it. In the past I have found Boost to be an amazing library to work with. If you have never had a chance to use it I highly recommend it, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=craigweston.wordpress.com&amp;blog=3901777&amp;post=7&amp;subd=craigweston&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I reinstalled Boost on Fedora, after a couple of hours of playing around getting everything working I decided to write up a post about it. In the past I have found Boost to be an amazing library to work with. If you have never had a chance to use it I highly recommend it, Boost can really can open your eyes to the elegance of C++ and is packed full of great libraries for solving every day coding issues. Specifically in the past I have had a chance to work with boost&#8217;s smart pointers, threading and filesystem libraries.  I will soon be writing some tutorials on using Boost, so expect that soon.</p>
<p>One note with the installation of Boost on Linux is that it can be somewhat of a mystery at times and is no easy challenge to setup at first. Hopefully this post will help users out there skip some of the issues I had to work through.</p>
<p><strong>Installation</strong><br />
The first thing to do is to grab the Boost source package and Boost Jam pre-built executable from <a title="here" href="http://sourceforge.net/project/showfiles.php?group_id=7586ls /hopme" target="_blank">here</a><br />
This tutorial uses:</p>
<li>boost_1_33_1</li>
<li>boost-jam-3.1.14</li>
<p>Before starting ensure you are root and have g++ installed. In Fedora you can do this with&#8230;<br />
<code>% yum install gcc-c++</code></p>
<p>Extract the Boost package.<br />
<code>% </code>tar xzf boost_1_33_1.tar.gz</p>
<p>Then extract the bjam files.<br />
<code>% tar xzf boost-jam-3.1.14.tgz</code></p>
<p>Move into the root of the <em>bjam</em> directory, and run the <em>build.sh</em> script to generate the <em>bjam</em> executable.<br />
<code>% cd boost-jam-3.1.14</code><br />
<code>% ./build.sh</code></p>
<p>Grab the <em>bjam</em> file that was created from <em>/bin.linuxx86/</em> and move it into the <em>boost_1_33_1</em> directory.  Run the following, this will take anywhere from 10-20 minutes to run, possibly more depending your system setup.<br />
<code>% bjam ––toolset=gcc install</code></p>
<p>Once it has finished you can check to ensure the libraries and include files are where they should be.<br />
<code>% cd /usr/local/include/boost-1_33_1<br />
% ls -l</code><br />
and<br />
<code>% cd /usr/local/lib<br />
% ls -l</code></p>
<p><strong>Testing the Install</strong><br />
Now we need to ensure that everything was successful. The best way to do this is to write a test app utilizing one of the Boost libraries, for this demonstration we will use the <em>filesystem</em> library.</p>
<p>First, lets set up the environment variables in our <em>.bashrc</em> to make our lives a little easier when compiling.<br />
<code>% vi .bashrc</code></p>
<p>Add the following lines to your <em>.bashrc</em> and then restart your shell to enable the new exports<br />
<code>export CPLUS_INCLUDE_PATH=/usr/local/include/boost-1_33_1</code><br />
<code>export LIBRARY_PATH=/usr/local/lib</code><br />
<code>export LD_LIBRARY_PATH=/usr/local/lib</code></p>
<p>Now that our environment is setup we can write the example code. This code below uses the Boost filesystem library to check to see if your home directory exists and is a directory.</p>
<div style="max-width:100%;overflow:auto;">
<pre>
      	#include &lt;iostream&gt;
      	#include &lt;boost/filesystem/operations.hpp&gt;
      	namespace fs=boost::filesystem;

	int main()
	{
		fs::path homePath("/home/");
		if(fs::exists(homePath) &amp;&amp; fs::is_directory(homePath))
          		std::cout &lt;&lt; "Directory: " &lt;&lt; homePath.leaf() &lt;&lt; " exists!" &lt;&lt; std::endl;

	}
</pre>
</div>
<p>Then compile the source.<br />
<code>% g++ -o boost_test boost_test.cpp -lboost_filesystem-gcc<br />
% ./boost_test<br />
</code></p>
<p>If all has went well you should see <code>Directory: home exists!</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/craigweston.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/craigweston.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/craigweston.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/craigweston.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/craigweston.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/craigweston.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/craigweston.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/craigweston.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/craigweston.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/craigweston.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/craigweston.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/craigweston.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/craigweston.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/craigweston.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/craigweston.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/craigweston.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=craigweston.wordpress.com&amp;blog=3901777&amp;post=7&amp;subd=craigweston&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://craigweston.wordpress.com/2008/06/09/boost-install-on-fedora-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">craigweston</media:title>
		</media:content>
	</item>
		<item>
		<title>No Kettle, No Worries</title>
		<link>http://craigweston.wordpress.com/2008/06/08/no-more-kettle-for-me/</link>
		<comments>http://craigweston.wordpress.com/2008/06/08/no-more-kettle-for-me/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 07:17:13 +0000</pubDate>
		<dc:creator>craigweston</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Coffee]]></category>
		<category><![CDATA[Tea]]></category>

		<guid isPermaLink="false">http://craigweston.wordpress.com/?p=8</guid>
		<description><![CDATA[Everyone knows programmers and techies alike are caffeine addicts. I myself am no different and usually drink a mixture of both tea and coffee. However about a month ago I started to really get tired of always having to put my kettle on every 15mins as I downed cup after cup of green tea while [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=craigweston.wordpress.com&amp;blog=3901777&amp;post=8&amp;subd=craigweston&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<table border="0" cellspacing="0" cellpadding="5" width="80" align="left">
<tbody>
<tr>
<td><a href="http://craigweston.files.wordpress.com/2008/06/tea.jpg"><img class="alignleft size-full wp-image-9" src="http://craigweston.files.wordpress.com/2008/06/tea.jpg?w=480" alt=""   /></a></td>
</tr>
</tbody>
</table>
<p>Everyone knows programmers and techies alike are caffeine addicts. I myself am no different and usually drink a mixture of both tea and coffee. However about a month ago I started to really get tired of always having to put my kettle on every 15mins as I downed cup after cup of green tea while coding. Not only is it just a pain, but your constantly loosing your train of thought while working.<br />
Because of this problem I applied my coffee habits to my tea habits and began to use my coffee maker for tea as well. This allows me to have a pot of tea staying warm for long periods of time with very little effort. To do it just remove any filters from your coffee maker, pour in the water, throw 3 to 4 tea bags in the pot and your good to go.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/craigweston.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/craigweston.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/craigweston.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/craigweston.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/craigweston.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/craigweston.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/craigweston.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/craigweston.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/craigweston.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/craigweston.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/craigweston.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/craigweston.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/craigweston.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/craigweston.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/craigweston.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/craigweston.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=craigweston.wordpress.com&amp;blog=3901777&amp;post=8&amp;subd=craigweston&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://craigweston.wordpress.com/2008/06/08/no-more-kettle-for-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">craigweston</media:title>
		</media:content>

		<media:content url="http://craigweston.files.wordpress.com/2008/06/tea.jpg" medium="image" />
	</item>
		<item>
		<title>Android Notifications</title>
		<link>http://craigweston.wordpress.com/2008/06/07/android-notifications/</link>
		<comments>http://craigweston.wordpress.com/2008/06/07/android-notifications/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 00:35:31 +0000</pubDate>
		<dc:creator>craigweston</dc:creator>
				<category><![CDATA[Google Android]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Notification]]></category>

		<guid isPermaLink="false">http://craigweston.wordpress.com/?p=5</guid>
		<description><![CDATA[Last night I spent sometime experimenting with how to implement a notification system class to abstract the details away of launching notifications from my main application service. After looking into what Android provides for doing this I found it to very clear and easy to implement. Android&#8217;s Notification Manager The Android Notification Manager handles the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=craigweston.wordpress.com&amp;blog=3901777&amp;post=5&amp;subd=craigweston&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last night I spent sometime experimenting with how to implement a notification system class to abstract the details away of launching notifications from my main application service. After looking into what Android provides for doing this I found it to very clear and easy to implement.</p>
<p><strong>Android&#8217;s Notification Manager</strong><br />
The Android Notification Manager handles the system level work of producing notifications allowing us to create custom notification objects specifying how we want our notifications to be produced. You do not need to initialize the Notification Manager instead you can just retrieve a handle to the service using  <a href="http://code.google.com/android/reference/android/content/Context.html#getSystemService%28java.lang.String%29">getSystemService(String)</a> passing it the identifier <a href="http://code.google.com/android/reference/android/content/Context.html#NOTIFICATION_SERVICE">NOTIFICATION_SERVICE</a>. In order to get a context to call this method I had to send the callers context to my constructor and import android.content.Context because my class does not inherit from any Android classes as it is just a helper class to my service. The code below demonstrates the process to get the handle.</p>
<div style="max-width:100%;overflow:auto;">
<pre>mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);</pre>
</div>
<p><strong>Android&#8217;s Notification</strong><br />
To create the Notification object we just call the constructor passing the notification details we want which will determine the final resulting notification. In most cases the constructor takes enough parameters to fulfill the requirements for most notifications you will need to invoke, however there are additional properties provided which can be set on the object after initialization.</p>
<p>Two of the parameters for the constructor are intents, one to be invoked when a user clicks the icon and one when a click on the content of the notification occurs. I generated an explicit intent to call one of my activities, which in this case provides functionality to view a new incoming message.</p>
<div style="max-width:100%;overflow:auto;">
<pre>		Intent viewMsgIntent = new Intent(context, ReceiveMessage.class);
		viewMsgIntent.putExtra("Contact", contact);
		viewMsgIntent.putExtra("Message", msg);</pre>
</div>
<p>I also set up the ticker text string, which is the string that gets scrolled across the notification menu at the top of the screen when a notification is received.</p>
<pre>		String tickerText = "New message received from " + contact + "...";</pre>
<p>The rest of the parameters include, two icons, one for the status bar at the top of the screen, and an application icon which is larger and is displayed in the notifications drop down menu.</p>
<p>The <em>when</em> parameter specifies a time stamp to determine when the notification should be launched. I wanted my notification to be launched instantly so I used the <em>System.currentTimeMillis()</em> to get the current time.</p>
<p>Here is the final code for initializing the notification object.</p>
<div style="max-width:100%;overflow:auto;">
<pre>		Intent viewMsgIntent = new Intent(cx, ReceiveMessage.class);
		viewMsgIntent.putExtra("contact", contact);
		viewMsgIntent.putExtra("message", msg);

		String tickerText = "New message received from " + contact + "...";

		if(msg.length() &gt; 40)
			msg = msg.substring(0, 40);

		Notification obj = new Notification(
                	cx,   // our context
                	R.drawable.im_icon,   // the icon for the status bar
                	tickerText,   // the text to display in the ticker
                	System.currentTimeMillis(),   // the timestamp for the notification
                	titleText,   // the title for the notification
                	msg,   // the details to display in the notification
                	viewMsgIntent,   // the contentIntent (see above)
                	R.drawable.im_icon,   // the app icon
                	"IM App",   // the name of the app
                	viewMsgIntent);</pre>
</div>
<p><strong>Sending the Notification Out</strong><br />
Once the notification object is created you can invoke it by calling the notify method on the Notification Manager, passing it the notification object. The first parameter of this method is an ID representing the notification.</p>
<pre>mNotificationManager.notify(R.string.recv_msg_notif_id, obj);</pre>
<p>So thats it, a very basic break down of the notification process in Android.</p>
<p>You can find more information here:</p>
<ul>
<li> <a href="http://code.google.com/android/reference/android/app/NotificationManager.html">android.app.Notification Manager</a><a href="http://code.google.com/android/reference/android/app/Notification.html"> </a></li>
<li><a href="http://code.google.com/android/reference/android/app/Notification.html">android.app.Notification </a></li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/craigweston.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/craigweston.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/craigweston.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/craigweston.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/craigweston.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/craigweston.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/craigweston.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/craigweston.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/craigweston.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/craigweston.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/craigweston.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/craigweston.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/craigweston.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/craigweston.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/craigweston.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/craigweston.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=craigweston.wordpress.com&amp;blog=3901777&amp;post=5&amp;subd=craigweston&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://craigweston.wordpress.com/2008/06/07/android-notifications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">craigweston</media:title>
		</media:content>
	</item>
	</channel>
</rss>
