<?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>Francis Shanahan[.com] &#187; Featured</title>
	<atom:link href="http://francisshanahan.com/index.php/category/featured/feed/" rel="self" type="application/rss+xml" />
	<link>http://francisshanahan.com</link>
	<description>Thoughts on technology from a citizen scientist</description>
	<lastBuildDate>Fri, 27 Jan 2012 14:18:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Sencha Touch 2.0 MVC in 5 minutes or less</title>
		<link>http://francisshanahan.com/index.php/2011/sencha-touch-2-0-mvc-in-5-minutes-or-less/</link>
		<comments>http://francisshanahan.com/index.php/2011/sencha-touch-2-0-mvc-in-5-minutes-or-less/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 15:06:45 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/?p=3274</guid>
		<description><![CDATA[I&#8217;ve shied away from JS frameworks on the mobile platform primarily due to performance. I had not been able to find one that came close to native performance on Android. This changed last weekend when I tried out the Sencha Touch 2.0 dev preview. Performance is vastly improved over Touch 1.0. Animations and transitions are smooth, even on my Android 2.2 device and I was able to get up and running very fast. 
Grab the Sencha Touch 2.0 Dev Preview here: http://www.sencha.com/blog/sencha-touch-2-developer-preview/
While I was able to get a basic app ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve shied away from JS frameworks on the mobile platform primarily due to performance. I had not been able to find one that came close to native performance on Android. This changed last weekend when I tried out the Sencha Touch 2.0 dev preview. Performance is vastly improved over Touch 1.0. Animations and transitions are smooth, even on my Android 2.2 device and I was able to get up and running very fast. </p>
<p>Grab the Sencha Touch 2.0 Dev Preview here: <a href="http://www.sencha.com/blog/sencha-touch-2-developer-preview/" target="_blank">http://www.sencha.com/blog/sencha-touch-2-developer-preview/</a></p>
<p>While I was able to get a basic app up and running quickly, unfortunately I spent a lot of time re-factoring into a proper MVC structure. The documentation on how to do this in Touch 2.0 is not there yet and there are some albeit small but killer differences between Touch1.0 and 2.0. To a novice like me they cost me a few hours. </p>
<p>Everything here was based off the Sencha ExtJS 4.0 walkthrough available here: </p>
<ul>
<li><a href="http://www.sencha.com/learn/architecting-your-app-in-ext-js-4-part-1/">http://www.sencha.com/learn/architecting-your-app-in-ext-js-4-part-1/</a></li>
<li><a href="http://www.sencha.com/learn/architecting-your-app-in-ext-js-4-part-2/">http://www.sencha.com/learn/architecting-your-app-in-ext-js-4-part-2/</a></li>
<li><a href="http://www.sencha.com/learn/architecting-your-app-in-ext-js-4-part-3/">http://www.sencha.com/learn/architecting-your-app-in-ext-js-4-part-3/</a></li>
</ul>
<p>The sample code is available on Github and you can go here and download the entire project in a single ZIP/TAR: <a href="https://github.com/FrancisShanahan/SenchaTouch2MVCHelloworld" target="_blank">https://github.com/FrancisShanahan/SenchaTouch2MVCHelloworld</a></p>
<p>Or you can fork the repo using git: <a href="http://help.github.com/fork-a-repo/" target="_blank">http://help.github.com/fork-a-repo/</a></p>
<p>Here are a few key points:</p>
<p>a) Let the app instantiate your controllers and any global stores your app needs. Notice how the initial layout is created using xtypes? These are created as aliases in the views.<br />
<script src="https://gist.github.com/1303996.js"> </script></p>
<p>b) Let your controllers instantiate your views and stores.<br />
<script src="https://gist.github.com/1304002.js"> </script></p>
<p>c) Use Component Queries instead of Ext.getCmp(&#8216;id goes here&#8217;). This&#8217;ll keep your code more manageable as the code base grows. Note, the &#8220;ref&#8221; name here is important as it&#8217;s used to generate getters for the view instances. E.g. a ref of &#8220;stationList&#8221; will create a getter on the controller of &#8220;getStationList&#8221;. </p>
<p><script src="https://gist.github.com/1304014.js"> </script></p>
<p>I&#8217;ve already heard from a few folks so it looks like this project is helpful. It&#8217;s also ready for dropping into a Phonegap shell. Fork it and update or let me know if there&#8217;s anything you&#8217;d like to see added. </p>
<p>Attribution: Today&#8217;s photo comes from Anxo Resúa&#8217;s stream on Flickr <a href="http://www.flickr.com/photos/anxoresua/4652943076/">http://www.flickr.com/photos/anxoresua/4652943076/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2011/sencha-touch-2-0-mvc-in-5-minutes-or-less/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Stream a webcam using Javascript, NodeJS, Android, Opera Mobile, Web Sockets and HTML5</title>
		<link>http://francisshanahan.com/index.php/2011/stream-a-webcam-using-javascript-nodejs-android-opera-mobile-web-sockets-and-html5/</link>
		<comments>http://francisshanahan.com/index.php/2011/stream-a-webcam-using-javascript-nodejs-android-opera-mobile-web-sockets-and-html5/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 20:29:04 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Cool & Future Tech]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Things I've Made]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/?p=3265</guid>
		<description><![CDATA[With all the recent Goruck-ness it&#8217;s time to throw out a tech post. I&#8217;ve been prepping for a NodeJS presentation recently and wanted a unique demo. I had also come across the experimental build of Opera which supports accessing the native webcam of a mobile device. So I threw these two technologies together and came up with a Javascript powered way to stream a video camera from a mobile device to a bunch of desktop (or mobile) clients. 
HTML5 had originally laid out support for a new element (the &#8220;device&#8221; ...]]></description>
			<content:encoded><![CDATA[<p>With all the recent Goruck-ness it&#8217;s time to throw out a tech post. I&#8217;ve been prepping for a NodeJS presentation recently and wanted a unique demo. I had also come across the experimental build of Opera which supports accessing the native webcam of a mobile device. So I threw these two technologies together and came up with a Javascript powered way to stream a video camera from a mobile device to a bunch of desktop (or mobile) clients. </p>
<p>HTML5 had originally laid out support for a new element (the &#8220;device&#8221; element) but it appears this element has been scrapped now in favour of the &#8220;getUserMedia&#8221; API. So far I have only seen the Opera Mobile Experimental build support this but hopefully it&#8217;ll get into Dolphin and other mobile browsers soon. </p>
<p><a href="http://my.opera.com/core/blog/2011/03/23/webcam-orientation-preview">http://my.opera.com/core/blog/2011/03/23/webcam-orientation-preview</a></p>
<p>If you just want to cut to the chase here&#8217;s a video of the final result:<br />
<iframe width="560" height="315" src="http://www.youtube.com/embed/cjmuwA8l1LQ" frameborder="0" allowfullscreen></iframe></p>
<p>There are three moving parts here</p>
<ul>
<li>a) The client page which captures the video</li>
<li>b) the server which is a simple Node broadcast server </li>
<li>c) and the Client which is just a web page that renders the output. </li>
</ul>
<p>The client is just a copy-paste from Opera&#8217;s website. I take the video stream, render it to a canvas, then grab the canvas as a base64 encoded image. One image per frame. I could not find a way to limit the video&#8217;s size so the resulting image is fairly large (240&#215;400 on an HTC Incredible).  I down-sampled, cutting the image data to reduce the traffic over the wire. Framerates are still pretty poor but this is just an experiment. </p>
<p>The server is a generic websockets server and gets a message which is a raw data/base64 stream. It broadcasts this down the any connected clients. </p>
<p>The client then is the simplest of all, just connects to the socket server and renders whatever it gets to an <img> tag. </p>
<p>It&#8217;s all Javascript. </p>
<p>Client (this is a jade view). </p>
<pre class="brush: javascript">

h1
    Remote Webcam using NodeJS, Opera, Web Sockets and HTML5/Canvas
video(autoplay=true,id=&quot;sourcevid&quot;)
canvas(id=&quot;output&quot;)
div(id=&quot;log&quot;)
script
    var log = function(msg) {
       document.getElementById(&#039;log&#039;).innerHTML = document.getElementById(&#039;log&#039;).innerHTML + msg + &quot;&lt;br/&gt;&quot;;
    };
    var video = document.getElementsByTagName(&#039;video&#039;)[0],
        heading = document.getElementsByTagName(&#039;h1&#039;)[0];
    if(navigator.getUserMedia) {
        navigator.getUserMedia(&#039;video&#039;, successCallback, errorCallback);

        function successCallback( stream ) {
            video.src = stream;
        };

        function errorCallback( error ) {
            heading.textContent = &quot;An error occurred: [CODE &quot; + error.code + &quot;]&quot;;
        };
    } else {
        heading.textContent = &quot;Native web camera streaming is not supported in this browser!&quot;;
    };

    var back = document.createElement(&#039;canvas&#039;);
    var backcontext = back.getContext(&#039;2d&#039;);

    var ws;

    if(&#039;WebSocket&#039; in window){
        connect(&#039;ws://192.168.2.100:8080/&#039;);
    } else {
        log (&#039;web sockets not supported&#039;);
     }

    function connect(host) {
        ws = new WebSocket(host);
        ws.onopen = function () {
            log(&#039;connected&#039;);
        };

        ws.onclose = function () {
            log(&#039;socket closed&#039;);
        };

        ws.onerror = function (evt) {
            log(&#039;&lt;span style=&quot;color: red;&quot;&gt;ERROR:&lt;/span&gt; &#039; + evt.data);
        };
    };

    function send(msg){
        if (ws != null) {
            if(ws.readyState === 1) {
               ws.send(msg);
            }
        } else {
            //log (&#039;not ready yet&#039;);
        }
    }    

    cw = 120;//240;//video.clientWidth;
    ch = 200;//400;//video.clientHeight;
    log(&#039;width = &#039; + ch);
    back.width = cw;
    back.height = ch;
    draw(video, backcontext, cw, ch);

    function draw(v, bc, w, h) {

        // First, draw it into the backing canvas
        bc.drawImage(v, 0, 0, w, h);

        // Grab the pixel data from the backing canvas
        var stringData=back.toDataURL();

        // send it on the wire
        send(stringData);

        // Start over! 10 frames a second = 100milliseconds
        setTimeout(function(){ draw(v, bc, w, h); });
    }
</pre>
<p>The server. Simple Broadcast app.</p>
<pre class="brush: javascript">

var sys = require(&quot;sys&quot;),
    ws = require(&quot;./ws.js&quot;);

var clients = [];

ws.createServer(
	function (websocket) {

		clients.push(websocket);

		websocket.addListener(&quot;connect&quot;, function (resource) {
			// emitted after handshake
			sys.debug(&quot;connect: &quot; + resource);
		}).addListener(&quot;data&quot;, function (data) {

		// handle incoming data
		// send data to ALL clients whenever ANY client send up data
		for (var i = 0 ; i &lt; clients.length ; i ++ ) {
			clients[i].write(data);
		}

    }).addListener(&quot;close&quot;, function () {

		// emitted when server or client closes connection
		sys.debug(&quot;close&quot;);
    });
  }).listen(8080);

  sys.debug(&quot;Listening on port 8080&quot;);
</pre>
<p>The client. </p>
<pre class="brush: javascript">

&lt;img src=&quot;&quot; id=&quot;frame&quot; style=&quot;width:240px;height:400px&quot;/&gt;

&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;

&lt;script type=&quot;text/javascript&quot;&gt;

	var img; 

	function Init() {

		img = document.getElementById(&quot;frame&quot;);	

	}

	$(document).ready(function () {

		Init();

	});

// Web socket connection stuff is next...	

	if(&#039;WebSocket&#039; in window){

		connect(&#039;ws://localhost:8080/&#039;);		

	} else {

		log (&#039;web sockets not supported&#039;);

	}

	var ws;

	function connect(host) {

		ws = new WebSocket(host);

		ws.onopen = function () {

			log(&#039;connected&#039;);

		};

		ws.onmessage = function (evt) {  	

            if (evt.data != null) {		

			  if ((evt.data[0]=== &quot;d&quot;) &amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp; (evt.data[1]===&quot;a&quot;) ) img.src=evt.data;	//log(&#039;got&#039; + evt.data);

			}

		};

		ws.onclose = function () {

			log(&#039;socket closed&#039;);

		};

		ws.onerror = function (evt) { 

			log(&#039;&lt;span style=&quot;color: red;&quot;&gt;ERROR:&lt;/span&gt; &#039; + evt.data); 

		};

	};

	function log(msg){

		document.getElementById(&#039;log&#039;).innerHTML = msg + &quot;&lt;br/&gt;&quot; + document.getElementById(&#039;log&#039;).innerHTML ;

	}
&lt;/script&gt;
</pre>
<p>Instead of broadcasting, you could store these frames in a MongoDB for assembly later. This would make the ultimate, storage independent video camera. Never run out of storage again!</p>
<p>I really need to start storing these snippets on github&#8230;</p>
<p>P.S. Everyone knows insects are clockwork which is why god made so many of them. Today&#8217;s image is from <a href="http://www.insectlabstudio.com/">http://www.insectlabstudio.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2011/stream-a-webcam-using-javascript-nodejs-android-opera-mobile-web-sockets-and-html5/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>GoRuck 057 New York City &#8211; GoodLivin&#8217;</title>
		<link>http://francisshanahan.com/index.php/2011/goruck-057-new-york-city/</link>
		<comments>http://francisshanahan.com/index.php/2011/goruck-057-new-york-city/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 19:32:51 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[goruck challenge]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/?p=3201</guid>
		<description><![CDATA[It&#8217;s 7PM, Friday 9/9/11 and I find myself in a dingy one-room loft apartment in SOHO. I&#8217;ve just signed a death waiver so detailed that I&#8217;m not even sure I own my own soul anymore. The police are combing the streets trying to chase down a possible terrorist threat and I&#8217;m carrying 30lbs of bricks on my back. I&#8217;m sweating. I&#8217;m about to start the GoRuck Challenge New York City and experience some #goodLivin first hand. 
Let&#8217;s backup for a minute. In April I completed the Tough Mudder in Bear ...]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s 7PM, Friday 9/9/11 and I find myself in a dingy one-room loft apartment in SOHO. I&#8217;ve just signed a death waiver so detailed that I&#8217;m not even sure I own my own soul anymore. The police are combing the streets trying to chase down a possible terrorist threat and I&#8217;m carrying 30lbs of bricks on my back. I&#8217;m sweating. I&#8217;m about to start the GoRuck Challenge New York City and experience some #goodLivin first hand. </p>
<p>Let&#8217;s backup for a minute. In April I completed the Tough Mudder in Bear Creek PA. 11.5miles of cold muddy fun with some bone-crunching obstacles thrown in [<a href="http://francisshanahan.com/index.php/2011/tough-mudder-pa-reviewpost-mortem/">read more here</a>]. Almost immediately following that I started jones-ing for the next challenge. I had actually found Tough Mudder easy enough, despite lots of long lines and cold, it turned out to be very do-able physically.  So I resolved to find something more difficult. The Goruck Challenge (<a href="http://goruckchallenge.com">http://goruckchallenge.com</a>) seemed like a good candidate so after a LOT of self-doubt and debating I signed up. </p>
<p>I remember thinking at the time &#8220;why am I doing this? I&#8217;m not sure if I can do it&#8221;, then realizing that was exactly why I needed to sign up. GoodLivin&#8217; had begun. </p>
<p>A lot of folks have asked why do this. I guess if you have to ask then I can&#8217;t explain it. For me these challenges are an opportunity to appreciate life, to appreciate health and make the most of it. Here I am with the opportunity and the physical ability to be able to attempt something like this. That&#8217;s not something I take lightly. There are a lot of people who don&#8217;t have that opportunity through no fault of their own. </p>
<p>Over the last four plus years I&#8217;ve watched my wife go through various treatments, radiation, chemotherapy and surgeries and there have been times when something as simple taking a walk together has been out of reach. When just to be able to sit quietly and not have the room spin has been a blessing. I also have known others who&#8217;ve passed either in 9/11 or through cancer and out of respect for their families I won&#8217;t mention them here but all these people would&#8217;ve appreciated the chance to do something like this. Since I have the chance I won&#8217;t take it for granted. </p>
<p>Along with signup fee I committed to raising some cash for the Green Beret Foundation and purchased a Radio Ruck. I had no idea which bag to get but this turned out to be a good choice and I&#8217;ve already used it in my daily life on a recent business trip. More on the bag later. </p>
<p>The Challenge was set for 9/9/11 at 19:00, we&#8217;d be running all night. I had roughly 3 months to prepare. I&#8217;ve already spoken about my training <a href="http://francisshanahan.com/index.php/2011/the-goruck-challenge-training/">here</a>, <a href="http://francisshanahan.com/index.php/2011/the-golden-gate-almost-half-marathon/">here</a>, <a href="http://francisshanahan.com/index.php/2011/goruck-training-full-bricks/">here </a>and <a href="http://francisshanahan.com/index.php/2011/goruck-training-final-push/">here</a>. I&#8217;m not a personal trainer, I don&#8217;t have a coach. Heck I&#8217;m actually an ex-smoker who used to spark up a pack a day! So training for me was sort of a hit-or-miss affair and I muddled through. Overall I think I did OK. I focused on upper-body, shoulders, core, running with a pack and my back. I really did not want to get beat up or cause a lasting injury from this ridiculous activity. </p>
<p>I ran with an old Russell Athletic crappy bag I had, found 20lbs of bricks in the back yard. The neighbors are convinced I am nuts by now. I mostly ran about 6 miles, in hot weather (NJ summer heat). I only really ran with the pack about 6 times. Mostly I ran without it and tried to change up the run by inserting pushups every half mile and pullups at the various kids playgrounds. The kids in the neighbourhood also think I&#8217;m nuts. Evenings I would visit Lifetime and row or do my burpee/pushup/pullup combo which is a good way to push your VO2 Max. </p>
<p>I don&#8217;t really have a huge amount of time to train but I made the most of what I had and come race day I was more or less ready. Areas I could&#8217;ve done more in are lower-body, squats, lunges and interval training. This bit me during the challenge as we&#8217;ll see in a minute. Meanwhile here&#8217;s everything I brought: </p>
<p><img src="https://lh4.googleusercontent.com/-UBptwDaISS0/TnJFVdOE8CI/AAAAAAAAHvo/SMh1kI3aUC8/s400/IMAG0525.jpg" alt="Everything I brought" /></p>
<p>Our class was assigned the number 057 and we were slated for a 7PM start. I had spent the previous day drinking a gallon of water and 2 quarts of Pedialyte. I had kept drinking that day itself so as 7PM came and went I was pretty much amped up and ready to explode. After signing our waivers, Jennifer Paquette, the Executive Director of the Green Beret Foundation showed up to kick off the weekend with some thoughtful words. Her husband is a green beret who&#8217;s lost both legs below the knee. This was starting to get meaningful. </p>
<p>Our cadre&#8217;s name was Lou. Lou&#8217;s a man you don&#8217;t meet every day. A tall guy, well built, tanned and confident. I had pre-conceived notions of a full-metal-jacket Sergeant Hartman type leading us around. Right from the get go I could tell Lou wasn&#8217;t that, but he wasn&#8217;t our best friend either. At least not yet. As he read out the briefing I was starting to wonder what this guy&#8217;s seen. He has the look of a guy who&#8217;s been there and back. He&#8217;s steady. Confident. Takes no shit. You could probably drop him in any given cluster-f*ck of a situation and he&#8217;s going to keep his head. </p>
<p><img src="https://lh6.googleusercontent.com/-jyO-MUOzufk/TmwGrOLBUpI/AAAAAAAAHsw/hlOd8iAgL0o/s400/DSCF1912.JPG" alt="Lou dishing out the goodLivin" /></p>
<p>We paired up 2-by-2 and it turned out our class headcount was only 28. No matter. I was paired up with my &#8220;battle buddy&#8221; Evan Lotzof and we set off running at an easy pace for Battery Park. The first bear crawl happened in the covered footbridge on the way to Battery Park. Up the stairs and over, nothing major but the trick was to keep alongside your buddy. Work as a team, don&#8217;t take off on your own. </p>
<p>We got to the water-side assembled into 4 rows of 7 and dropped packs for some basic PT. Lou had already cautioned us that the packs are not to be taken off without his say-so. Here we did a combination of Pushups, Flutter kicks, Air Squats and more Pushups all to Lou&#8217;s cadence. We sprung back up, put packs on and got ready for buddy carries. </p>
<p>As soon as I put my ruck back on I felt dizzy. Oh dear. Time to throw up. The combination of squats and pushups had pulled all the blood from my core. I&#8217;m sure Evan was thinking &#8220;this guy&#8217;s done, why&#8217;d I get paired up with this joker?&#8221;. That was physically the worst I felt all night. </p>
<p>Lucky for me Evan is a horse. With the pack I probably weighed 210lbs easily and Evan hauled me down the walkway no problem. 15 minutes later I was back to normal. I hadn&#8217;t thrown up. In terms of buddy carries there was no way I could carry Evan, I was just not strong enough so we figured out a strategy of pairing up with other people for buddy carries. This worked much better. </p>
<p><img src="https://lh4.googleusercontent.com/-_GvMjbxSBWw/TmwGTQL-4mI/AAAAAAAAHn4/K1KtWhjzNJ0/s400/DSCF1990.JPG" alt="Buddy Carries" align="center" /><br />
As far as feeling woozy I was not alone. We continued our PT with dive-bombers on the grass during which another big dude got queasy. I took his pack (which couldn&#8217;t hit the ground) and he recovered. A couple of others experienced the same throughout the night. Thankfully no one hurled, no one quit and no one was sent home.</p>
<p>Each team is asked to bring an extra 25lb weight as a team weight. This can be anything of the team&#8217;s choosing and in our case was recovered metal and glass from the world trade centers.  The extra weight is put into a bag which gets passed around from team member to team member as the night progresses. At times you can be running with as much as 55-60lbs depending. A piece of our team weight: </p>
<p><img src="https://lh4.googleusercontent.com/-vcadvoNjVQk/TnJFfaWY5aI/AAAAAAAAHvo/DP8-PV27ZuY/s400/wtc.jpg" alt="A piece of our team weight, recovered steel from WTC." /></p>
<p>The class behind us (<del datetime="2011-09-15T23:02:06+00:00">058</del> 059) arrived at our old spot by the water and proceeded to begin their PT. Here is where Lou&#8217;s fiendish side came out. He decided to split off a small team of 3 or 4 to infiltrate the <del datetime="2011-09-15T23:02:06+00:00">058 </del> 059 team and pretend to be one of them. It was early in the night so teams wouldn&#8217;t have known every member. The rest of us would distract whilst our plant would steal the team&#8217;s &#8220;bitch bag&#8221;. Needless to say we pulled this off flawlessly. A classic move. This pleased Lou greatly and I&#8217;m sure team <del datetime="2011-09-15T23:02:06+00:00">058 </del> 059 was SEVERELY punished at having fallen foul of such a disgrace. We were already gelling as a team. </p>
<p><img src="https://lh3.googleusercontent.com/-pzIU7BpeSyg/TmwGtD5WyVI/AAAAAAAAHtM/E4Mi67cPKP4/s400/DSCF1905.JPG" alt="The Healing Field Project" /><br />
We continued around the tip of Manhattan to the Healing Field project. One flag for every life lost on 9/11. This was an impressive sight, even in the dark and a solemn reminder of the meaning of the weekend.  Then we crab walked down Wall Street. A roach led me most of the way. I would get close to stomping him then he&#8217;d run off again. We stopped at George Washington for a photo op then continued down to the Wall Street Bull. More Photos. Then on to Brooklyn. </p>
<p>On the way we held a race. The losers got punished. I&#8217;m not saying what happened but this was integral in forming of the team. Maybe you can figure it out. </p>
<p>We hoofed over the Brooklyn Bridge. Anytime someone would ask us what we were doing the entire class would yell &#8220;GO-RUCK&#8221;. Sometimes we would ask ourselves what were doing, just as we passed someone sleeping or passed out on a bench. You gotta stay alert in New York City. </p>
<p>Once in Brooklyn we made our way down to the &#8220;beach&#8221; which is nothing more than a pile of slippery rocks. We waded in and laid down for some more PT. Pushups and flutter kicks. The night was hot and humid so the water was actually pretty nice.  I changed my shirt but it really didn&#8217;t matter as ten minutes later it was soaked in sweat again. Given the heat we stopped regularly for water and I think I drank about 7 litres over the course of the night judging by the refills of my camelbak.</p>
<p><img src="https://lh4.googleusercontent.com/-IrjNwHFL0bw/TmwGP39QzYI/AAAAAAAAHnM/5Ol2RJhD_S8/s400/louPushups.jpg" alt="Pushups in the East River 1-2-3-ONE-1-2-3-TWO" /><br />
We picked up two massive coupons in Brooklyn, the first a huge log, estimated at around 500 to 700lbs. That&#8217;s about 50 stone for all my Irish friends. The second was a railroad tie around 300 lbs or 22 stone. These were carried for what seemed like hours. Back into New York over the Manhattan bridge into Chinatown, up Bowery and then over to Washington Square Park. This was far and away the toughest part of the challenge. Not only were they heavy, they were awkward. The log was irregular and you could not get comfortable with it. We tried padding the thing with cardboard found on the sidewalk but it was too little too late. Even now, days later my right shoulder has a huge road-rash area with no skin left. GoodLivin. </p>
<p>Once we dropped the log I think we all would agree the challenge became easy. We had gelled completely as a team. We ran up to Times Square, up to Central Park and watched the sun come up. Then jogged back downtown again. </p>
<p>Our challenge ended at a firehouse in lower Manhattan. This particular firehouse lost seven firefighters in 9/11 and our visit was arranged by a team member, Laura Cross, who&#8217;s father was a New York City battalion chief. </p>
<blockquote><p>&#8220;Chief Cross, 60, known as Captain Fearless, lived with his wife in Islip Terrace, N.Y. His favorite saying was, “Take care of the men and the men will take care of you.” &#8221; </p></blockquote>
<p>Here&#8217;s the coincidence. Our class number was 057, his battalion number was 57. I&#8217;m not sure how this happened. There&#8217;ll only ever be one team 057 and there&#8217;ll only ever be one 10th anniversary of 9/11 so what a great way to memorialize him. </p>
<p>We buddy carried half the team the last 500&#8242; into the firestation where after 15.5miles and 11 hours Lou declared us officially GoRuck Tough. </p>
<p><img src="https://lh6.googleusercontent.com/-yG_bGZOTQac/TmwGSDUlW6I/AAAAAAAAHno/hjhFH3bgJOE/s400/DSCF1994.JPG" alt="Outside the firehouse after the finish" /><br />
A note on the bag: As I&#8217;ve already said I bought a Radio Ruck. The bags are advertised as tough but we&#8217;ve all heard that before. Well after going through this challenge I threw my bag in the laundry to get the East River out of it. It&#8217;s good as new. By way of example at one point we decided carrying the enormous log would be easier if we took our packs off and got on either side of the log with the packs underneath. Each person held one strap of a pack whilst the log rested across all the packs. I was sure the bags would be trashed or rip a strap under the massive load but they held up fine. This worked great but Lou didn&#8217;t like it so we switched back to carrying the log on our shoulders. Bottom line is these bags are tough as nails. </p>
<p>What&#8217;s it all about? If you think this challenge is about a personal goal you&#8217;re right and you&#8217;ll be tested. Physically this is an extreme activity and I&#8217;ve left a lot out. We did a LOT of stuff and it was physically VERY tough but the challenge was not all about the physical. We could&#8217;ve done more pushups, carried more stuff, ran more miles. At the end I was tired but definitely not done-in. In the days that followed I was sore but to be honest I&#8217;ve been worse off in training. </p>
<p>For me this challenge is all about taking a group of individual people, of varying strengths and weaknesses and forming them into a team. You get a glimpse into the type of mental conditioning the army goes through when stakes are high. You go from a mode of &#8220;how can I get myself through this&#8221; to a mode of &#8220;how can I finish quick so I can go help out someone next to me&#8221;. Your mindset changes from thinking about all the stuff that lies ahead and psyching yourself out to breaking the task into smaller chunks and focusing on the immediate task at hand, getting yourself through the next 50 feet. That&#8217;s invaluable. If only there was a way to work this into corporate america <img src='http://francisshanahan.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  </p>
<p><img src="https://lh5.googleusercontent.com/-VFnf7ffAWHI/TmwGT5KpSeI/AAAAAAAAHoA/8MKu8WFlnuM/s400/DSCF1988.JPG" alt="I don't want to carry this jug anymore..." /></p>
<p>I would be remiss to end without a word of thanks: To all in 057. This group quickly put egos aside and were generally out for a good time. And of course my battle buddy Evan Lotzof who kept the party going with Mitch Hedberg jokes. You&#8217;re a horse in a fake tuxedo!  Thanks 057 for a great night and here&#8217;s to many more. </p>
<p><img src="https://lh3.googleusercontent.com/-vCFkWnc_wAs/TnJF-JRUGRI/AAAAAAAAHvk/TDj700i-Fjo/s400/evan.jpg" alt="Evan, ready for a dinner party." /></p>
<p>Overall this was a great experience. I&#8217;ve met a lot of new people, gained some new friends and shared an experience and memories that will last a lifetime. My kids are at an impressionable age and I think it&#8217;s also a good influence on them to see that these kinds of crazy things are attainable and achievable. I&#8217;ve also pushed my own self to a new level both mentally and physically. That kind of goodlivin money can&#8217;t buy. Whatever you want in life, it&#8217;s there for the taking. </p>
<p>Would I do it again? In a heartbeat. What are we dooooowaannn? GO-RUCK!</p>
<p>Now go checkout Asha Wagner&#8217;s account of the night: <a href="http://nuffsaid6.blogspot.com/2011/09/goruck-tough-class-057-with-you.html">http://nuffsaid6.blogspot.com/2011/09/goruck-tough-class-057-with-you.html</a></p>
<p>Here are some other pics from the night:<br />
<embed type="application/x-shockwave-flash" src="https://picasaweb.google.com/s/c/bin/slideshow.swf" width="400" height="267" flashvars="host=picasaweb.google.com&#038;captions=1&#038;noautoplay=1&#038;hl=en_US&#038;feat=flashalbum&#038;RGB=0x000000&#038;feed=https%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Ffrancisshanahan%2Falbumid%2F5650898492881641569%3Falt%3Drss%26kind%3Dphoto%26hl%3Den_US" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></p>
<p>P.S. Thanks to Evan also for some of the pics which I stole from FB. </p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2011/goruck-057-new-york-city/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Golden Gate (almost) Half Marathon</title>
		<link>http://francisshanahan.com/index.php/2011/the-golden-gate-almost-half-marathon/</link>
		<comments>http://francisshanahan.com/index.php/2011/the-golden-gate-almost-half-marathon/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 14:43:44 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[Life & Introspection]]></category>
		<category><![CDATA[goruck challenge]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/?p=3136</guid>
		<description><![CDATA[More GoRuck training folks! Bruce Willis in Die Hard 1 says &#8220;fists with your toes&#8221; is a great way to get rid of that airplane feeling. Well I have another way: running across the Golden Gate Bridge! Last week I flew to San Francisco. I got in around 3PM PST so with a few hours to kill I decided to take a jog over to the Golden Gate bridge, it turned out to be quite the adventure. 
If you&#8217;re interested I mapped the run here [LINK].
I was staying at the ...]]></description>
			<content:encoded><![CDATA[<p>More <a href="http://goruckchallenge.com/events/new-york-city/">GoRuck</a> training folks! Bruce Willis in Die Hard 1 says &#8220;fists with your toes&#8221; is a great way to get rid of that airplane feeling. Well I have another way: running across the Golden Gate Bridge! Last week I flew to San Francisco. I got in around 3PM PST so with a few hours to kill I decided to take a jog over to the Golden Gate bridge, it turned out to be quite the adventure. </p>
<p>If you&#8217;re interested I mapped the run here [<a href="http://www.mapmyrun.com/routes/view/40158430/?open_ive_done=1">LINK</a>].</p>
<p>I was staying at the Fairmont which sits on top of &#8220;Nob&#8221; Hill (this type of name could only exist in America). This is one of the steeper hills in San Fran, something I would realize later. </p>
<p>I dropped the bags, ate a Cliff Bar and set off with my cell phone in hand, $20 in my shoe in case of emergency and my RoadID on my wrist. The hotel desk clerk said it was 3 miles to the bridge and she&#8217;d have towels and water ready when I got back. I told her I&#8217;d be back in an hour. </p>
<p>The plan was to run across the bridge if I could, but I couldn&#8217;t tell if I&#8217;d be able to get up on the actual bridge or not. I figured I&#8217;d find out one way or the other. I turned right out of the hotel and am immediately hit with a view of Alcatraz off in the distance, how cool is that. I ran down towards the touristy part of SF, streets are straight but the pavement is busted up quite badly from roots and the steep incline. The incline is no-joke about 40-45 degrees on Nob Hill, pretty unbelievable in parts. </p>
<p>I&#8217;m jogging along, images of Steve McQueen, Dirty Harry, Bullitt, fastback Mustangs dancing through my head. It&#8217;s awesome. </p>
<p>I&#8217;ve gone about 2 miles and am down in the Marina, it&#8217;s nice, really sunny, I&#8217;m feeling good. I see the bridge off in the distance and ask someone if I&#8217;m on the right track. They say &#8220;yeah but it&#8217;s a bit of a ways, about 3 miles&#8221;. I&#8217;m thinking OK, we can at least get to the base of the bridge but maybe not up onto it. I&#8217;m down low at this point and the bridge looks completely unattainable. </p>
<p>So I run on and cross into Crissy field which is next to the bridge and all of a sudden I realize why no one&#8217;s running here, there&#8217;s a 20 mile an hour head wind blowing sheets of sand and gravel into my face. There are some foolish people walking but they are going the opposite direction and are all wearing hooded sweatshirts. I should&#8217;ve stayed on the road that runs parallel to the park. I&#8217;m convinced they all think I&#8217;m mad.</p>
<p>I stop and ask a couple of ladies wheeling prams (away from the wind) how to get up to the bridge and they direct me to a bike path that leads up to it. Now I&#8217;m sorted. With knowledge that the bridge is attainable I settle down into a rhythm. </p>
<p>I get up on the bridge and find it&#8217;s littered with tourists, all miserable. It&#8217;s freezing up here. The weather so far has been sunny but once you get up on to the bridge you&#8217;re in the clouds and the wind is blowing a gale.  The tops of the bridge supports are not visible due to the fog/clouds. It&#8217;s fairly dizzying. I run into the center of the bridge and the wind has got to be 20-30mph in the middle.  The bridge itself is 1.7 miles across and almost 750 feet above the water. The railings are not that high, you could EASILY vault over and drop to your death. I can see parasail surfers far below and they look like tiny dots. I&#8217;m not that bad with heights but this is making me dizzy. There are less folks in the middle and for good reason, most folks turn back before getting there. </p>
<p>I make it all the way to the Marin County border which is the base of the 2nd tower (the north side) then head back. At this point I&#8217;m ready to get off the bridge. It&#8217;s just too cold and windy. I head back and narrowly miss some cyclists who haven&#8217;t been on a bike in a while. Once I get back to the marina I start to warm up again. I jog through San Fran and eventually turn up Mason street which I now realize is a near-vertical climb all the way back to the hotel. Feck it. Head-down and a few mins later I&#8217;m home. 1hour 52mins 12.6 miles on a Cliff bar and some airline food. </p>
<p>If you get the chance I highly recommend this run, don&#8217;t be a tourist and hire a bike. It&#8217;ll be easier but you&#8217;ll miss a lot of the sights and experience. Jogging in this case is the way to go.  </p>
<p>Separate topic: This Independence day I completed my 2nd run w/bricks. Read about the first here [<a href="http://francisshanahan.com/index.php/2011/the-goruck-challenge-training/">LINK</a>]. This time around was a LOT easier on my shoulders. I have been working on those. I did still end up with some fairly deep cuts into my collar bones where the ruck straps run but not as bad as first time around. I think mentally the fear/intimidation of running with bricks is still greater than the difficulty. It&#8217;s effing difficult, there&#8217;s no doubt. It feels like you are being pulled to the ground with every step. Like there&#8217;s a small child trying to pull you to the ground. But I think it&#8217;s an even worse mental game, especially leading up to the run itself. That&#8217;s something I aim to change. </p>
<p>In 1994 or &#8217;95 I once chain smoked 18 cigarettes in a recreation room on D.C.U. campus as a sort of a dare/bravado on my part. Fast forward 16 years I can run a half marathon without dying and enjoy spectacular scenery from one of the world&#8217;s iconic locations. I&#8217;m glad I quit.  Enjoy the pics: </p>
<p><embed type="application/x-shockwave-flash" src="https://picasaweb.google.com/s/c/bin/slideshow.swf" width="400" height="267" flashvars="host=picasaweb.google.com&#038;captions=1&#038;hl=en_US&#038;feat=flashalbum&#038;RGB=0x000000&#038;feed=https%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Ffrancisshanahan%2Falbumid%2F5626450262371765201%3Falt%3Drss%26kind%3Dphoto%26authkey%3DGv1sRgCOXFsZzOsYyLuQE%26hl%3Den_US" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2011/the-golden-gate-almost-half-marathon/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mycellium Source Code Available</title>
		<link>http://francisshanahan.com/index.php/2011/mycellium-source-code-available/</link>
		<comments>http://francisshanahan.com/index.php/2011/mycellium-source-code-available/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 14:08:35 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[canvas]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/?p=3158</guid>
		<description><![CDATA[Last time [LINK] I discussed how virtual Worms could &#8220;eat&#8221; a picture, seeking out the lighter or darker areas as food and leaving a trail in their wake. I&#8217;ve dumped the source here: http://francisshanahan.com/demos/worms/test.html so you can interact, create your own images and figure out how it&#8217;s done. To be honest I haven&#8217;t had much time to clean this up as I&#8217;ve been focusing on other things and doing a bit of travel for work so be gentle. 
Just enter a URL of an image and click &#8220;create drawing&#8221; to ...]]></description>
			<content:encoded><![CDATA[<p>Last time [<a href="http://francisshanahan.com/index.php/2011/emulating-mycelium-hyphae-with-html5/">LINK</a>] I discussed how virtual Worms could &#8220;eat&#8221; a picture, seeking out the lighter or darker areas as food and leaving a trail in their wake. I&#8217;ve dumped the source here: <a href="http://francisshanahan.com/demos/worms/test.html">http://francisshanahan.com/demos/worms/test.html</a> so you can interact, create your own images and figure out how it&#8217;s done. To be honest I haven&#8217;t had much time to clean this up as I&#8217;ve been focusing on other things and doing a bit of travel for work so be gentle. </p>
<p>Just enter a URL of an image and click &#8220;create drawing&#8221; to being. The page will load that image into a hidden canvas and use it as reference to draw the picture. You should use Chrome of course but this should work in all HTML5 compatible browsers. </p>
<p>Room for improvement might be to place the code in an enclosure, cleaning up the global DOM namespace or  multi-thread it this using Web Workers although the current speed is acceptable. Web Workers in this instance might be overkill. </p>
<p>Enjoy. </p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2011/mycellium-source-code-available/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Node.js, Cygwin and Web Sockets</title>
		<link>http://francisshanahan.com/index.php/2011/using-node-js-cygwin-and-web-sockets/</link>
		<comments>http://francisshanahan.com/index.php/2011/using-node-js-cygwin-and-web-sockets/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 20:40:28 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Cool & Future Tech]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/?p=2995</guid>
		<description><![CDATA[If you have not heard of Node.js (or &#8220;Node&#8221; as Ryan Dahl calls it) [LINK] it is more fun than a barrel full of monkeys and faster than stink. Node.js is built around the Google V8 javascript engine and aims to solve the issues of concurrency and blocking IO which are prevalent in todays web servers. It also improves over traditional OS threading by using an event model to handle requests. This leads to the ability to handle many more concurrent requests but also handle them faster since less memory ...]]></description>
			<content:encoded><![CDATA[<p>If you have not heard of Node.js (or &#8220;Node&#8221; as Ryan Dahl calls it) [<a href="http://nodejs.org">LINK</a>] it is more fun than a barrel full of monkeys and faster than stink. Node.js is built around the Google V8 javascript engine and aims to solve the issues of concurrency and blocking IO which are prevalent in todays web servers. It also improves over traditional OS threading by using an event model to handle requests. This leads to the ability to handle many more concurrent requests but also handle them faster since less memory is allocated on the heap for each new call. </p>
<p>I spent some time last week looking at Web Sockets as a way to push information to the client. Web sockets need a custom server, not an HTTP server, so I used Nugget which is an open source implementation of the web socket protocol on CodePlex (http://nugget.codeplex.com/). Nugget worked great but with all the hype and interest around Node I felt I was missing something so I built the same thing again, this time around using Node.js on the server side. </p>
<p>Before get started you&#8217;ll need to build Node. This can be done </p>
<blockquote><p>&#8220;on Linux, Macintosh, and Solaris. It also runs on Windows/Cygwin, FreeBSD, and OpenBSD. The build system requires Python 2.4 or better. V8, on which Node is built, supports only IA-32, x64, and ARM processors. V8 is included in the Node distribution. To use TLS, OpenSSL is required. There are no other dependencies.&#8221;</p></blockquote>
<p>I used Cygwin on Wintel and installed g++, Python 2.7 and GNU Make. You also need OpenSSL if you plan on using Node with Web Sockets.</p>
<p>Here&#8217;s a comprehensive walkthrough of installing Cygwin and building Node from scratch: [<a href="https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-%28Windows%29">LINK</a>]</p>
<p>Web Sockets uses a funky little handshake protocol [<a href="http://en.wikipedia.org/wiki/WebSockets#WebSocket_Protocol_Handshake">LINK</a>] to establish the connection which I didn&#8217;t feel like implementing so I came across a WS Server implementation using Node.JS up on GitHub [<a href="https://github.com/miksago/node-websocket-server/">https://github.com/miksago/node-websocket-server/</a>]. This worked well with Node 0.2.5  testing from Chrome 12 which uses v-76 of the Hixie protocol.</p>
<p>Here&#8217;s my client which is based off the Dive into HTML5 example:</p>
<pre class="brush: javascript">
if(Modernizr.websockets){
	    connect(&#039;ws://localhost:3400/service&#039;);
	} else {
		log (&#039;web sockets not supported&#039;);
	}
	var ws;

	function connect(host) {
		ws = new WebSocket(host);
		ws.onopen = function () {
			log(&#039;connected&#039;);
		};

		ws.onmessage = function (evt) {
			log(&#039;recv :&#039; + evt.data);
			showNotification(evt.data);
		};

		ws.onclose = function () {
			log(&#039;socket closed&#039;);
		};

		ws.onerror = function (evt) {
			log(&#039;&lt;span style=&quot;color: red;&quot;&gt;ERROR:&lt;/span&gt; &#039; + evt.data);
		};
	};

	function log(msg){
		document.getElementById(&#039;log&#039;).innerHTML += msg + &quot;&lt;br/&gt;&quot;;
	}

	function send(){
		var msg = document.getElementById(&#039;status&#039;).value;
		ws.send(msg);
	}

	function RequestPermission (callback) {
		window.webkitNotifications.requestPermission(callback);
	}

	function showNotification(msg){
		if (window.webkitNotifications.checkPermission() &gt; 0) {
			RequestPermission(showNotification);
		}
		else {
			window.webkitNotifications.createNotification(&quot;alert.jpg&quot;, &quot;Test Notification&quot;, msg).show();
		}
	}
</pre>
<p>With this client-side scripe and Node running the ws-socket server I was able to get a simple echo running forth between the web page and the server.</p>
<p>Node has gained some ground since I first looked at it (back when Chrome was on version 8). Even Microsoft has announced plans to port it over to Windows [<a href="http://blogs.msdn.com/b/interoperability/archive/2011/06/23/microsoft-working-with-joyent-and-the-node-community-to-bring-node-js-to-windows.aspx">LINK</a>]. In the coming weeks I plan on looking at some of the templating engines (Like http://jade-lang.com/ and http://mustache.github.com/)  and web frameworks (like http://expressjs.com and http://geddyjs.org/ ) which have cropped up around it and will report back on whether it&#8217;s ready for prime time or not. Watch this space. </p>
<p>Attribution: Today&#8217;s image by Casch52 on Flickr [<a href="http://www.flickr.com/photos/casch/470563640/">LINK</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2011/using-node-js-cygwin-and-web-sockets/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The GoRuck Challenge &#8211; Training</title>
		<link>http://francisshanahan.com/index.php/2011/the-goruck-challenge-training/</link>
		<comments>http://francisshanahan.com/index.php/2011/the-goruck-challenge-training/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 20:12:07 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[Life & Introspection]]></category>
		<category><![CDATA[goruck challenge]]></category>
		<category><![CDATA[tough mudder]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/?p=3121</guid>
		<description><![CDATA[In April I participated in my first Tough Mudder (LINK). I have never been one to &#8220;participate&#8221; in things like this but I have to admit the sense of accomplishment was pretty overwhelming. We also raised $3,000+ for Colon Cancer (LINK) which only added to the experience. Almost immediately afterwards I started looking for the next challenge. Another TM would be fun but 7,000 people completed the TM course (out of 10,000 entrants), I felt maybe I could find something a bit more &#8220;exclusive&#8221;. 
In researching TM I&#8217;d heard of ...]]></description>
			<content:encoded><![CDATA[<p>In April I participated in my first Tough Mudder (<a href="http://francisshanahan.com/index.php/2011/tough-mudder-pa-reviewpost-mortem/">LINK</a>). I have never been one to &#8220;participate&#8221; in things like this but I have to admit the sense of accomplishment was pretty overwhelming. We also raised $3,000+ for Colon Cancer (<a href="http://ccalliance.org/fundraisers/team_mandelbaum.html">LINK</a>) which only added to the experience. Almost immediately afterwards I started looking for the next challenge. Another TM would be fun but 7,000 people completed the TM course (out of 10,000 entrants), I felt maybe I could find something a bit more &#8220;exclusive&#8221;. </p>
<p>In researching TM I&#8217;d heard of the GoRuck Challenge [<a href="http://goruckchallenge.com/">LINK</a>] &#8211; 15-20 MILES. 8-10 HOURS. GOOD LIVIN’.</p>
<blockquote><p>&#8220;Inspired by the most elite training offered to Special Forces soldiers and led by Green Berets, the GORUCK Challenge is a team event and never a race. Challenge cadre build each class into a team through collective conditions of mental and physical exhaustion. Classes are small, camaraderie is high, smiles are plentiful, and teamwork is paramount.</p>
<p>You and your fellow Challenge takers all wear GORUCK backpacks throughout the Challenge.  Yes, your bags will be weighted down with bricks, but if the Challenge were easy you wouldn’t sign up. In fact, the greatest hurdle is signing up.  We are proud that the pass rate is over 98%.</p>
<p>You won’t know the route but it showcases the best of every city. Think of it as a guided tour.  The miles don’t disappear on their own, and 8 to 10 hours can feel like a lifetime.  Welcome to our version of good livin’. &#8220;</p></blockquote>
<p>The next event in NYC will be on 9/9 at 19:00 and I&#8217;ll be running with a Radio Ruck and 4 bricks. The weekend will commemorate the 10th anniversary of Sept 11th and we aim to start and finish at a Brooklyn firehouse so it should be a rare experience. I&#8217;ll be running with memories of my friend and co-worker Steve Weinstein who died in Tower 1 whilst working for Marsh and McLennan [<a href="http://memorial.mmc.com/pgBio.asp?ID=284">LINK</a>]. I only knew Steve a few years but we had some great conversations and he was someone I looked up to and respected a great deal. </p>
<p>After that long lead-in I must now share some notes from my first training run *with bricks* which happened yesterday. I typically will run 6-7 miles two to three times a week as a means of relaxation. I run slow, about 8:30/9mins pace. I&#8217;ll visit the gym twice on a good week, sometimes 3 times and sometimes miss it altogether. The past month I&#8217;ve been focusing on pushups and chinups. I attempted my first &#8220;Murph&#8221; WOD last Friday and did not finish. I bonked on the chinups managing only 40 out of a required hundred. </p>
<p>On Sunday I took three bricks from the back yard and taped them together. I then wrapped that in a towel, taped that and threw it in a backpack. I also threw in 32oz of water and weighed the whole ensemble. I was expecting the scale to ring up a big number as this felt really heavy but no, only 20lbs total. So I warmed up w/pushups/chins and squats then I set off. </p>
<p>Within 100 yards I realized this additional weight and the way it is distributed (flopping about on your back) really messes with your gait. I live in a VERY hilly neighborhood so it took me a while to figure out how to run with the pack. I also will normally run with a predominantly fore-foot strike, very little heel. With the backpack I found a heel strike is really almost essential. </p>
<p>After about a mile I was into a rhythm and got over the initial embarrassment of running with a backpack. Let&#8217;s face it, you look like a complete maniac running down the road with a 20lbs ruck on your back. </p>
<p>After 2 miles I had to pull over and grab the water out of the pack. I was starting to gas and the water was sloshing like crazy. I carried that for the rest of the way. Not having the water in the pack helped a lot and I got back in a rhythm. The terrain was fairly hilly so this was a tough-ish run even without the pack. It was also 85 degrees so I was feeling the #goodLivin. </p>
<p>After about mile 3 I was into a decent rhythm and tried distracting myself mentally. This worked and for a while I went into a running &#8220;trance&#8221; and almost forgot about the pack. By this time the pack was starting to cut into my collar bones but I&#8217;d expected this and just kept on going. It actually wasn&#8217;t as bad as I&#8217;d expected. I was feeling good and even de-toured about 1 mile to check out an open house along the way. </p>
<p>I Last 800 feet is a solid 400 foot vertical climb which I have done many times, the pack didn&#8217;t effect this as much as I thought it might. Overall about a 6mile run and I survived. It took about 70 minutes. This was hard. Not something I&#8217;d do every day. I think I&#8217;ll try this every two weeks or so and slowly work up to 4 bricks. </p>
<p>On the plus side my GoRuck class has organized itself on email and Facebook and all seem like really good people who&#8217;re really supportive and encouraging so I&#8217;m definitely looking forward to September. </p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2011/the-goruck-challenge-training/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Emulating Mycelium Hyphae with HTML5</title>
		<link>http://francisshanahan.com/index.php/2011/emulating-mycelium-hyphae-with-html5/</link>
		<comments>http://francisshanahan.com/index.php/2011/emulating-mycelium-hyphae-with-html5/#comments</comments>
		<pubDate>Mon, 09 May 2011 21:00:23 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[fungus]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/?p=3084</guid>
		<description><![CDATA[Mycelium (plural mycelia) is the vegetative part of a fungus, consisting of a mass of branching, thread-like hyphae. Hyphae are any of the threadlike filaments forming the mycelium of a fungus. And YES I had to look both of those up. 
Typically they travel and branch along a source of nutrients, following the source. I came across this awesome work of Ryan Alexander [LINK] whilst messing around with Processing one evening. Ryan used Processing which is similar to Java. Processing is a great sketch-language which makes whipping up graphical wonders ...]]></description>
			<content:encoded><![CDATA[<p>Mycelium (plural mycelia) is the vegetative part of a fungus, consisting of a mass of branching, thread-like hyphae. Hyphae are any of the threadlike filaments forming the mycelium of a fungus. And YES I had to look both of those up. </p>
<p>Typically they travel and branch along a source of nutrients, following the source. I came across this awesome work of Ryan Alexander [<a href="http://onecm.com/" target="_blank">LINK</a>] whilst messing around with Processing one evening. Ryan used Processing which is similar to Java. Processing is a great sketch-language which makes whipping up graphical wonders a doddle and is a favourite of interactive media artists. It&#8217;s really cool and I&#8217;ve been messing with it for a few years now. Check out &#8220;http://processing.org/&#8221; for more. </p>
<p>A few hours later I had the same thing implemented in Javascript and HTML5 using the Canvas element although mine is not as sophisticated as Ryan&#8217;s.</p>
<blockquote><p>Disclaimer: I know nothing of Mycelium or of Hyphae or how they branch and form. I merely tried to emulate how the branching works.</p></blockquote>
<p>Basically you take an image as input and a number of threads are created, I called them &#8220;worms&#8221; since &#8220;hyphae&#8221; seemed a but over the top. The worms have a trajectory and will move along it in search of food. Each iteration the worm decides where to move, favouring the light or dark portions of the image. Just as in Ryan&#8217;s Processing application the image acts as a source of food. If the worm ventures into a dark portion of the image, after a while without food, he dies.</p>
<p>I&#8217;m sure there&#8217;s a lot more to say on how this Mycelium stuff grows than what I&#8217;ve modeled here. For example I didn&#8217;t consider the amount of food contributing to the speed of the &#8220;worm&#8221; nor did I attempt to make the worms avoid each other. This was primarily an artistic endeavor and a creative outlet written over a beer one night. </p>
<p>I made a bunch of different images, Martin Luthor King, Bob Dylan, Willie Nelson, Clint Eastwood. For Clint&#8217;s I made a slight adjustment where any worm that died I&#8217;d re-spawn inside his eyes. Results were pretty nice. Here&#8217;s the Flickr Album: <a href="http://www.flickr.com/photos/10277648@N03/with/5704290009/" target="_blank">http://www.flickr.com/photos/10277648@N03/with/5704290009/</a></p>
<p><a href="http://www.flickr.com/photos/10277648@N03/5704290009/" title="clintbig3 by francisshanahan, on Flickr"><img src="http://farm4.static.flickr.com/3137/5704290009_9fd5455ccd.jpg" width="371" height="500" alt="clintbig3"></a></p>
<p>This technique works best on images with high-contrasting areas. Basically wrinkled old men. You&#8217;ll notice how the hyphae follow the wrinkles in Clint&#8217;s face.</p>
<p><a href="http://www.flickr.com/photos/10277648@N03/5704288959/" title="dylan by francisshanahan, on Flickr"><img src="http://farm4.static.flickr.com/3099/5704288959_58e2448027.jpg" width="393" height="500" alt="dylan"></a></p>
<p>Bob Dylan was surprising as the threads were never able to &#8220;break through&#8221; into the darker areas around his eyes. He just didn&#8217;t have enough wrinkles to feed them. </p>
<p><a href="http://www.flickr.com/photos/10277648@N03/5704856326/" title="willie2 by francisshanahan, on Flickr"><img src="http://farm4.static.flickr.com/3274/5704856326_d715484ccd.jpg" width="402" height="500" alt="willie2"></a></p>
<p>Willie Nelson, looking down. You can start to see his two braids forming in the weeds. </p>
<p>If you like these click over to the Flickr Album for more: <a href="http://www.flickr.com/photos/10277648@N03/with/5704290009/">http://www.flickr.com/photos/10277648@N03/with/5704290009/</a></p>
<p>Interesting factoid: At one point Mycelium was considered the largest living organism in the world! From Wikipedia:</p>
<blockquote><p>This 2,400-acre (9.7 km2) site in eastern Oregon had a contiguous growth of mycelium before logging roads cut through it. Estimated at 1,665 football fields in size and 2,200 years old, this one fungus has killed the forest above it several times over, and in so doing has built deeper soil layers that allow the growth of ever-larger stands of trees. Mushroom-forming forest fungi are unique in that their mycelial mats can achieve such massive proportions.</p></blockquote>
<p>In the coming days I&#8217;ll clean up the code and try to make it configurable so you can upload your own photos and play along. More to come on this one&#8230;</p>
<p>[UPDATE] Source code is now available here: <a href="http://francisshanahan.com/index.php/2011/mycellium-source-code-available/">http://francisshanahan.com/index.php/2011/mycellium-source-code-available/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2011/emulating-mycelium-hyphae-with-html5/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Tough Mudder PA &#8211; Review/Post Mortem</title>
		<link>http://francisshanahan.com/index.php/2011/tough-mudder-pa-reviewpost-mortem/</link>
		<comments>http://francisshanahan.com/index.php/2011/tough-mudder-pa-reviewpost-mortem/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 17:46:21 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[Life & Introspection]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/?p=3085</guid>
		<description><![CDATA[On April 9th 2011 together with my brothers in-law Dave and Chris, I ran the Tough Mudder PA course in beautiful Bear Creek. Together we raised $3,120 for the Colon Cancer Alliance [LINK]. Here&#8217;s a post-mortem for anyone interested in doing a TM event. 
Short answer: I highly recommend Tough Mudder. It was the absolute most fun I&#8217;ve had in a long time. I came away with a wide variety of scrapes, a mild sunburn and an adrenaline high that lasted well into mid-week. 
Long answer: We had a 10AM ...]]></description>
			<content:encoded><![CDATA[<p>On April 9th 2011 together with my brothers in-law Dave and Chris, I ran the Tough Mudder PA course in beautiful Bear Creek. Together we raised $3,120 for the Colon Cancer Alliance [<a href="http://www.razoo.com/story/Tough-Mudders-For-Colon-Cancer">LINK</a>]. Here&#8217;s a post-mortem for anyone interested in doing a TM event. </p>
<p>Short answer: I highly recommend Tough Mudder. It was the absolute most fun I&#8217;ve had in a long time. I came away with a wide variety of scrapes, a mild sunburn and an adrenaline high that lasted well into mid-week. </p>
<p>Long answer: We had a 10AM start time on Saturday so we showed up in PA the night before. The morning of I met a number of good-natured burly men in the hotel breakfast area, they were already giddy so I knew we were into something good here. </p>
<p>By way of preparation I had run a bunch of trails, mostly about 9-10 mile distance over fairly rough terrain in the local nature reservation. I had also focused on chinups and some upper body so I went in feeling fairly good. Nothing crazy. </p>
<p>The morning-of we drove to the pre-determined parking lot, TM was very well organized with text messages related to parking lots telling us which lot was filling up so we had no trouble figuring out where to go. A shuttle bus took us from the parking lot to Bear Creek. </p>
<p>Once we got there we registered with the pre-signed death waiver (which is extremely severe, you basically have no rights whilst on the course). All participants are required to write their number on their forehead in permanent marker. Funnily enough I got sun-burnt but the ink came off leaving only my number emblazoned on my forehead in non-pink skin. Funny funny. </p>
<p><img src="https://lh3.googleusercontent.com/_45WOFW8ZSb4/TaINnLrIIoI/AAAAAAAAHR8/LzCDEV35nbY/s400/tough%20mudder%20061.JPG" alt="After the water...7 miles to go still" align="left" />The race got started and for the first couple of hundred yards I thought this is a piece of cake. We ran down the hill, through some small bit of mud, then back up the slope towards the top of the mountain. On the way they blasted us with water, folks were already walking and we hadn&#8217;t even gone a half a kilometer. </p>
<p>The top of the hill we walked under a cargo net. By now I&#8217;m getting a bit bored and thinking this is off to a slow start. Next up we slid down the other side of a small hill and then on through some small woods. Finally came to the tubes. I&#8217;m still sparkling clean at this point so got down in the mud and made some mud angels. </p>
<p>Turns out the tubes were full of sharp rocks which cut my knees and shins to pieces. Things were getting interesting. Then a couple-mile jog through the woods and I think we came out on our first water station. No need for water yet but folks are guzzling it down. Onwards through the woods and we come out at the lake. </p>
<p>Right before the lake was a mystery obstacle which was a dunk tank full of red-hot habaneros. Fool hardy folks were eating them on the spot. I jumped in, immediate pain from all the cuts, then onwards over a 12 foot wall. The walls as it turns out were fairly easy as there&#8217;s a foot-hold about 3 feet up. If you&#8217;re 6&#8242; or over you can just stand there and hoist yourself up and over. One unfortunate soul fell from the top of the wall down the other side but thankfully was not hurt.</p>
<p>Next up another cargo net. I came across a worm in the mud to which some smart ass jersey girl replied &#8220;a worm? in the mud? You think?&#8221;. Delightful. Camaraderie? Next up about a 15 minute wait in line for the &#8220;walk the plank&#8221; obstacle. I&#8217;m not sure what the wait was like for the Sunday group but here there were a few places where folks were really bunching up. </p>
<p>We climbed the platform, yelled at the water and jumped in. This was the worst obstacle by far. The waiting was cold, the platform was high and the water was absolutely frigid. I hit the water and immediately starting swimming for the edge with the singular thought in mind that if I don&#8217;t get out of here I&#8217;m going to die. It was serious business but we loved it. </p>
<p>Directly after this was the Twinkle Toes, again loads of people waiting. The TM folks walked down the line and said if you want to bypass the obstacle by jumping in the water to run up and go ahead. So that&#8217;s what we did. It was warmer than shivering in the line. </p>
<p>One more water obstacle next, the Rope Bridge thing. This one we just jumped in the water, held the bottom rope and sort of under-water traversed the thing. It was freezing. I jumped out and tried some Bear Grills push ups. These warmed me up for 10 seconds but since every piece of clothing is wet it doesn&#8217;t matter. </p>
<p>Onwards for a 3-4 mile run through the woods along some very narrow trails. This bothered me as there were plenty of folks who would steam past then a hundred yards up the same folks would be stood on the side waiting for their buddies and catching their breath. Few seconds later they&#8217;d steam past again. Frustrating. </p>
<p>We got to the top of the hill very slow. The trail was so narrow you had to run single file, the trees were too thick for the sun to warm us and folks were really just walking along. If I had been able to run at a decent pace I could&#8217;ve been done sooner and warmed up to boot. Maybe better to go in the 9AM group in future. </p>
<p>Top of the hill marked the beginning of the &#8220;Muddy Mile&#8221;. A set of trail with 4 foot trenches dug every 20 yards. The trenches were lined with tarp held down by huge jagged rocks. This spoiled the fun as you couldn&#8217;t just jump in for fear of breaking an ankle (something many people did unfortunately). The end of the muddy mile had one big long trench with poles across which required the runner to dive under to pass. This meant you were now freezing once again. By now we were at mile 8 and still having fun. </p>
<p><img src="https://lh4.googleusercontent.com/_45WOFW8ZSb4/TaPGL7FB7CI/AAAAAAAAHU4/-WF4Zc9o08A/s400/218108_10150152717888551_568838550_6724157_4848501_n.jpg" alt="Me on the Monkey Bars of Death" align="right" /><br />
Next up the Monkey Bars. I was most nervous about this one but it turned out to be no problem. You really can&#8217;t swing monkey-style across these as you&#8217;ll pull your shoulder out of their sockets. My advise is to take a half-chinup style grip and just dance across one hand at a time. It&#8217;s really not that hard. Monkey bars were shut down after we crossed them due to someone falling off and breaking their leg in three places. I guess the water underneath was not deep enough. I&#8217;m glad I got to do them though. </p>
<p>The remainder of the race was mostly running the slopes up and down. Most folks were walking by now but I tried to keep a steady trot going, mostly to stay warm and avoid cramping. The log carry, suspended cargo net and the big wall thing was another place where folks got bunched up. One more broken leg at the inverted V-Wall apparently as someone slid down straight-legged. Bad idea. </p>
<p>Things I would change? The main thing I&#8217;d love to see would be to eliminate queuing at the obstacles. This just sucked the fun out of it. It also made it easier as you could just catch your breath at each obstacle. I&#8217;d like to have been able to just blast along at a reasonable pace to make the thing aerobically challenging. By the time we were done we&#8217;d probably spent over 90 minutes just standing in place. Not fun. </p>
<p>Overall this was a well organized event. If you&#8217;re in reasonable shape with some friends to help you along you should have no trouble. Keep your knees bent and apply sunblock BEFORE your apply your number on your forehead. </p>
<p>Would I do it again? Absolutely, in a heartbeat. </p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2011/tough-mudder-pa-reviewpost-mortem/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Android Development Cheatsheet</title>
		<link>http://francisshanahan.com/index.php/2011/android-development-cheatsheet/</link>
		<comments>http://francisshanahan.com/index.php/2011/android-development-cheatsheet/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 20:09:12 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Cool & Future Tech]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[General Computing]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/?p=3070</guid>
		<description><![CDATA[Here&#8217;s a rundown of everything I ran into when hacking my way through android development.
Setup Eclipse, run the Android SDK installer, install the correct USB drivers and finally check your device setup with &#8220;adb devices&#8221;. Your device should be listed. 
If you don&#8217;t have an android device, be prepared for the emulator to be extremely slow especially during startup/shutdown. Be sure to mark your emulator as &#8220;Snapshot&#8221; (accessible from the ADB/AVD SDK Manager-> Start button). Also, don&#8217;t connect your device whilst the emulator is running. Adb gets confused. 
I had ...]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a rundown of everything I ran into when hacking my way through android development.</p>
<p>Setup Eclipse, run the Android SDK installer, install the <a href="http://developer.android.com/sdk/oem-usb.html" target="_blank" >correct USB drivers</a> and finally check your device setup with &#8220;adb devices&#8221;. Your device should be listed. </p>
<p>If you don&#8217;t have an android device, be prepared for the emulator to be extremely slow especially during startup/shutdown. Be sure to mark your emulator as &#8220;Snapshot&#8221; (accessible from the ADB/AVD SDK Manager-> Start button). Also, don&#8217;t connect your device whilst the emulator is running. Adb gets confused. </p>
<p>I had one occurrence where the drawable resources to my project failed to get copied over properly to the device and I spent 20 minutes trying to figure out what I&#8217;d changed in my code. Turning out the emulator was running in the background. I did shut the emulator off and did an adb uninstall &#8220;myApp&#8221; and then redeployed to fix it. </p>
<p>Android works on Intents, Activities and Services. If you want to access the hardware, e.g. the Camera, you&#8217;ll need to fire off an Intent. Here&#8217;s an example of launching an Intent to get a Bitmap back from the camera: </p>
<p><a href="http://mobile.tutsplus.com/tutorials/android/android-sdk-quick-tip-launching-the-camera/" target="_blank" >http://mobile.tutsplus.com/tutorials/android/android-sdk-quick-tip-launching-the-camera/</a></p>
<p>You&#8217;ll also need to mark your application with the right permissions in the AndroidManifest.xml file. Here&#8217;s a good reference to all the <a href="http://developer.android.com/reference/android/Manifest.permission.html" target="_blank">Available Permissions</a>. </p>
<p>Use Drawables and Styles in your layout from Day 1. Use RelativeLayout from Day 1 also and attributes such as &#8220;layout_alignRight&#8221;, &#8220;layout_alignTop&#8221; as necessary to get the achieved UI. Rather than set a bunch of things invisible/visible, use a Viewgroup such as a nested Relative Layout. Yes you can do Forms this way and if you have a lot of labels/fields to hide/show based on other fields this can be really useful. </p>
<p>Don&#8217;t forget you can define gradients and shapes in Drawables also. This saved me a bunch of time trying to create graphics. </p>
<p>In general wrap your root Layout in a ScrollView. This will ensure your screen is usable when you rotate the device. </p>
<p>To Launch a new screen that you need to get something back from (like a Modal dialog) use &#8220;StartActivityForResult&#8221;, otherwise just use &#8220;StartActivity&#8221;</p>
<p>Sample code to launch an Activity: </p>
<pre class="brush: java">
Intent i = new Intent(this, MyActivity.class);
startActivityForResult(i, SCREEN_A);
</pre>
<p>The constant SCREEN_A just helps you identify in the onActivityResult method which one returned. </p>
<pre class="brush: java">

public void onActivityResult(int requestCode, int resultCode, Intent intent) {
	super.onActivityResult(requestCode, resultCode, intent);
	if (resultCode == RESULT_OK) {
		Bundle extras = intent.getExtras();
		switch (requestCode) {
		case SCREEN_A: // do something with the return values
			break;
		}
	}
}
</pre>
<p>Remember your screen can be cancelled by the user using the Back button so only check the intent if the resultCode is &#8220;RESULT_OK&#8221;, otherwise you&#8217;ll get an exception. </p>
<p>Inside your child Activity do this to send data back to the parent:  </p>
<pre class="brush: java">

Intent myReturnIntent = new Intent();
Bundle myBundle = new Bundle();
myReturnIntent.putExtras(myBundle);
setResult(RESULT_OK, myReturnIntent);
finish();
</pre>
<p>Use Log.d(TAG, &#8220;Something&#8221;) combined with &#8220;ADB LOGCAT&#8221; to debug. Define a TAG constant in every class, it&#8217;ll help you filter the Log by defining an environment variable named &#8220;android_log_tags&#8221; with the relevant tags included. <a href="http://developer.android.com/guide/developing/tools/adb.html" target="_blank">http://developer.android.com/guide/developing/tools/adb.html</a></p>
<p>If you need to display a Message box, typically use a &#8220;Toast&#8221; message, here&#8217;s a good reference on Toast: <a href="http://developer.android.com/guide/topics/ui/notifiers/toasts.html" target="_blank">http://developer.android.com/guide/topics/ui/notifiers/toasts.html</a></p>
<p>If you need a dialog box, try this: </p>
<pre class="brush: java">

public static void ShowAlert(String text, String title, Context activity) {

	AlertDialog.Builder myBuilder = new AlertDialog.Builder(activity);
	myBuilder.setMessage(text).setCancelable(false)
		.setPositiveButton(&quot;Ok&quot;, new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int id) {
                                // just close
				dialog.cancel();
		        }
		});

	AlertDialog alert = myBuilder.create();
	alert.setIcon(R.drawable.myIcon);
	alert.setTitle(title);
	alert.show();
}
</pre>
<p>and you can add a &#8220;.setNegativeButton&#8221; if you need more control. </p>
<p>If you need to store simple string name-value pairs use preferences use the built in UI and Preference manager. Good tutorial is here: <a href="http://www.kaloer.com/android-preferences" target="_blank">http://www.kaloer.com/android-preferences</a>.</p>
<p>If you don&#8217;t want to use a Menu you can always use a TabView and I found Google&#8217;s example to be complete and easy to follow: <a href="http://developer.android.com/resources/tutorials/views/hello-tabwidget.html" target="_blank">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a></p>
<p>For background, long running processing use a Service. Great simple complete example here:  <a href="http://marakana.com/forums/android/examples/60.html" target="_blank">http://marakana.com/forums/android/examples/60.html</a></p>
<p>That should be plenty to help you get your first android app up and running. </p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2011/android-development-cheatsheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

