<?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>MIH SWAT &#187; facebook</title>
	<atom:link href="http://www.mihswat.com/tag/facebook/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mihswat.com</link>
	<description>MIH SWAT - the official blog of MIH's Strategic Worldwide Applications and Technology Team.</description>
	<lastBuildDate>Mon, 06 Sep 2010 10:24:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>In a Facebook world, what’s a social network to do?</title>
		<link>http://www.mihswat.com/2010/05/03/in-a-facebook-world-what%e2%80%99s-a-social-network-to-do/</link>
		<comments>http://www.mihswat.com/2010/05/03/in-a-facebook-world-what%e2%80%99s-a-social-network-to-do/#comments</comments>
		<pubDate>Mon, 03 May 2010 07:46:58 +0000</pubDate>
		<dc:creator>Theo van den Berg</dc:creator>
				<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[social networking]]></category>

		<guid isPermaLink="false">http://www.mihswat.com/?p=1256</guid>
		<description><![CDATA[It can be argued that Facebook is now the de facto online social network with almost 500 million registered users, with only a few countries such as China (QQ), Russia (Vkontakte), Japan (Mixi) and Brazil (Orkut) left where it is not the dominant social force. Facebook has been especially successful in expanding geographically via local [...]]]></description>
			<content:encoded><![CDATA[<p>It can be argued that Facebook is now the de facto online social network with almost <a href="http://techcrunch.com/2010/04/21/facebook-500-million-visitors-comscore/">500 million registered users</a>, with only a few countries such as China (<a href="http://www.qq.com/">QQ</a>), Russia (<a href="http://vkontakte.ru/index.php">Vkontakte</a>), Japan (<a href="http://mixi.jp/">Mixi</a>) and Brazil (<a href="http://www.orkut.com/">Orkut</a>) left where it is not the dominant social force. Facebook has been especially successful in expanding geographically via local language implementations and is now taking this further by also extending users’ <a href="http://www.mihswat.com/2009/05/25/visualise-your-social-graph-on-facebook/">social graphs</a> and activities to the wider web through its Open Graph tools (<a href="http://social.venturebeat.com/2010/04/21/facebook-f8-roundup">announced at their F8 conference</a> last week).<span id="more-1256"></span></p>
<p>These new tools enable any website to become ‘social’ – allowing users to share, recommend and comment on content, while even being able to chat to other friends outside of Facebook. The site is therefore weaving a social fabric into the web, which <a href="http://techcrunch.com/2010/04/25/the-age-of-facebook/">all leads back to Facebook</a>. This allows Facebook to collect massive amounts of personalised data on its users. Sound familiar? Just as Google uses search and its other products (the Chrome browser, Gmail email service, YouTube etc.) to collect user data to serve relevant advertising, Facebook is building an extensive and massively detailed database of their users’ needs, activities, interests, you name it. This is now no longer confined to only within the Facebook walled garden. For all intents and purposes, Facebook – like Google with search – is becoming an advertising company by winning the social game.</p>
<p>So where does this leave other social networks? Sure, countries like China might just not be a cultural fit for the Facebook model (not to mention insulated and limited via <a href="http://topics.nytimes.com/topics/news/international/countriesandterritories/china/internet_censorship/index.html">censorship</a>). However, as a general-purpose social network, Facebook is probably unassailable at this point. Which leads us to the question: how does a scrappy social service compete with the mighty Facebook?</p>
<p>In my opinion, there are a few ways for niche (as opposed to general) social services to compete:</p>
<ul>
<li>Specialise – focus on a particular social aspect and excel at it (i.e. <a href="http://www.linkedin.com/">LinkedIn</a> offers business networking and operates as a ‘stealth recruitment service’)</li>
<li>Exclusivity – limit access to users of a certain, social, economic or other metric (i.e. <a href="http://www.asmallworld.net/">ASMALLWORLD</a> is a private network which started out as the Myspace for the rich and famous and limits invitations to ‘trusted’ members)</li>
<li>Be distinctive – offer a service that Facebook doesn’t (i.e. <a href="http://foursquare.com/">Foursquare</a> is a combination of a game and social network and uses a user’s location to allow venue check-ins)</li>
</ul>
<p>Using one or more of the above elements, these niche social networks have been able to carve out successful and sometimes highly profitable positions in the face of Facebook’s growing influence. Some others I can think of are <a href="http://www.flickr.com/">Flickr</a> (for photo-sharing), <a href="http://www.last.fm/">Last.fm</a> (for music lovers), <a href="http://www.tripadvisor.com/">TripAdvisor</a> (for travellers) and <a href="http://www.clubpenguin.com/">Club Penguin</a> (for children).</p>
<p>Are there any other successful or up-and-coming niche social networks you can think of? And do you think there are other ways for these services to compete other than being specialised, exclusive or distinctive?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihswat.com/2010/05/03/in-a-facebook-world-what%e2%80%99s-a-social-network-to-do/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three almost sure things for 2010</title>
		<link>http://www.mihswat.com/2010/01/12/three-almost-sure-things-for-2010/</link>
		<comments>http://www.mihswat.com/2010/01/12/three-almost-sure-things-for-2010/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 14:22:20 +0000</pubDate>
		<dc:creator>Jacques van Niekerk</dc:creator>
				<category><![CDATA[SWAT]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[#mihswat]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[Apple Tablet]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[Natal]]></category>
		<category><![CDATA[prediction]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.mihswat.com/?p=1040</guid>
		<description><![CDATA[January brings with it the usual proliferation of lists predicting technology trends for 2010. I&#8217;ll add to the swarm by providing a short list of events which I believe will have a significant impact on the Web As We Know It in the coming year. The first item is the release of Apple&#8217;s Tablet. The [...]]]></description>
			<content:encoded><![CDATA[<p>January brings with it the usual proliferation of lists predicting technology trends for 2010. I&#8217;ll add to the swarm by providing a short list of events which I believe will have a significant impact on the Web As We Know It in the coming year.<span id="more-1040"></span></p>
<p>The first item is the release of <a href="http://news.google.com/news?hl=en&amp;q=apple+tablet&amp;um=1&amp;ie=UTF-8&amp;ei=zO5FS_KnHdP-4AbavMyiCA&amp;sa=X&amp;oi=news_group&amp;ct=title&amp;resnum=1&amp;ved=0CBEQsQQwAA">Apple&#8217;s Tablet</a>. The impact of this device will be to make it abundantly clear to the consumer that the Web is to be had without the need for a typical computing device &#8211; no laptop required here. The Apple tablet will be an elitist device outside the US (as is the iPhone), but may turn out to be <strong>the poster child for convergence</strong>. As the delivery mechanisms for all content becomes IP networks, the consumer will cease to think of print, television and web content as different from each other &#8211; all will be one, as demonstrated by the Apple Tablet.<br /> <a href="http://www.engadget.com/2009/11/11/project-natal-launching-in-november-2010-priced-for-impulse-bu/"><br /> Microsoft&#8217;s Project Natal</a> will be released into the wild. Forget augmented reality. This will be the first step towards <strong>extended reality</strong>, the blurring between virtual and real. The success of <a href="http://www.imdb.com/title/tt0499549/">Avatar, the movie</a> and the increasing availability of devices with <a href="http://news.bbc.co.uk/2/hi/technology/8447432.stm">three-dimensional displays</a> will contribute to the acceptance of extended reality as an everyday reality, because the display techniques they use appear to intrude into the &#8220;real&#8221; world.  This will smooth the road towards wide adoption of extended reality as a user interface mode. (Finally &#8211; a replacement for the <a href="http://en.wikipedia.org/wiki/Mouse_%28computing%29">mouse</a>.) 2010 will be the year we start adding reality to the &#8220;real world&#8221;.</p>
<p>And finally &#8211; this year will resolve the question of how the planet&#8217;s largest social and communications platforms can evolve to have viable business models. Both <a href="http://www.twitter.com">Twitter</a> and <a href="http://www.facebook.com">Facebook</a> have massive and growing user bases, but neither have a clear plan for exploiting this user base &#8211; the sheer number of users, and the wide global distribution of these users should offer unique opportunities. I believe that 2010 will be the year that a way is found to exploit the <a href="http://en.wikipedia.org/wiki/Mega-">mega</a>-nets &#8211; paving the way for planetary connectivity, and the <a href="http://en.wikipedia.org/wiki/Giga">giga</a>-net.</p>
<p>In summary, my three (almost) sure things for the year:</p>
<ul>
<li>Convergence, convergence, convergence. The medium is changing, and <a href="http://en.wikipedia.org/wiki/The_medium_is_the_message">so shall the message</a>.</li>
<li>Extended reality starts entering the mainstream.</li>
<li>A way is found to exploit mega-sized social and communications networks commercially.</li>
</ul>
<p> </p>
<p>There are a number of other trends which I believe will have a significant impact on the web-as-we-know-it: semantic markup is becoming ever more ubiquitous without anyone really noticing; cloud computing is maturing; entirely new modes of internet usage is establishing itself in developing countries. Mobile internet usage continues to increase. Broadband penetration will continue to grow, enabling more and more users to join social and communications networks &#8211; we will see the rise of the giga-net within a very few years.</p>
<p>But I believe the three most significant  changes in the WAWKI will be triggered by the three events I listed here. Your mileage might vary &#8211; tell us about it.</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihswat.com/2010/01/12/three-almost-sure-things-for-2010/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How did they do that ?</title>
		<link>http://www.mihswat.com/2009/11/16/how-did-they-do-that/</link>
		<comments>http://www.mihswat.com/2009/11/16/how-did-they-do-that/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 12:16:43 +0000</pubDate>
		<dc:creator>Hennie Grobler</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://www.mihswat.com/?p=913</guid>
		<description><![CDATA[Have you ever come across a website and saw some really interesting aspects of the user interface ? Maybe it was a site design that looks like a flash site but was not? Or maybe you came across a site that had a visually appealing menu. Coming from mostly a backend-development background I get this [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-914" src="http://www.mihswat.com/wp-content/uploads/2009/10/FacebookHideSample.bmp" alt="Sample Image" width="381" height="51" /></p>
<p>Have you ever come across a website and saw some really interesting aspects of the user interface ? Maybe it was a site design that looks like a flash site but was not? Or maybe you came across a site that had a visually appealing menu.<span id="more-913"></span></p>
<p>Coming from mostly a backend-development background I get this feeling often. Last week it happened when I saw the Hide option on Facebook. I have seen it a hundred times before but on that day I found myself wondering, so I recreated the sample in my own way from scratch.</p>
<p>The following questions came to mind while looking at Facebook’s implementation:</p>
<ol>
<li>how to make the hide option, appear next to feed item that the mouse is hovering over.</li>
<li>how to make the ‘menu’ item under the hide option appear and stay there when the Hide button is clicked</li>
<li>how to remove the selected options from the list without having to refresh the whole page</li>
<li>how to send the filter option to the server without posting back the whole page</li>
</ol>
<p style="padding-top:10px">I decided that I will use styling and jQuery to complete steps 1 – 3 and use a ajax call via jQuery to post the selected filter option back to the server.</p>
<p><strong>Note</strong> that you will need some prior knowledge of jQuery selectors in order to follow the code sample. See the following urls for some background information on this:</p>
<ul>
<li><a href="http://woorkup.com/2009/10/05/jquery-lesson-series-introduction-to-selectors/">http://woorkup.com/2009/10/05/jquery-lesson-series-introduction-to-selectors/</a></li>
<li><a href="http://docs.jquery.com/Selectors">http://docs.jquery.com/Selectors</a></li>
</ul>
<p style="padding-top:10px"><strong><span style="text-decoration: underline">The following are the steps I completed to make these options work:</span></strong></p>
<h4><strong><span style="text-decoration: underline">Create the folder structure:</span></strong></h4>
<p><strong><span style="text-decoration: underline"><img class="alignnone size-full wp-image-918" src="http://www.mihswat.com/wp-content/uploads/2009/10/filestructure.bmp" alt="filestructure" /></span></strong></p>
<ol>
<li>Download the latest query plug-in (jquery.js in the screenshot) from <a href="http://jquery.com/">http://jquery.com/</a></li>
<li>Create your project with necessary files. See the screen shot for my folder structure:</li>
</ol>
<p style="padding-top:10px"><strong><span style="text-decoration: underline">Import the style sheets and javascript files:</span></strong></p>
<p>1. Place the following statements in the index.php file to reference the style sheets and javascript files</p>
<pre>&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;How did they do that: Facebook Hide&lt;/title&gt;
        &lt;link type="text/css" rel="stylesheet" href="styles/default.css" /&gt;
        &lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="js/jquery.feedfilter.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="js/hidebutton.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
&lt;body&gt;</pre>
<p style="padding-top:10px"><strong><span style="text-decoration: underline">Create the news feed items:</span></strong></p>
<ol>
<li> The sample only shows one of the news feed entries for clarity sake. Repeat item-container div for each additional item you want.</li>
<li>Note the following things when reviewing the snippet
<ol>
<li>The class name for the feed item is <span style="color: #ff00ff">item-container</span>.</li>
<li><span style="color: #ff00ff">Hide-button</span> is a child element of <span style="color: #ff00ff">item-container</span></li>
<li><span style="color: #ff00ff">Hide-menu-header</span> and <span style="color: #ff00ff">hide-button-options</span> are child elements of <span style="color: #ff00ff">hide-button</span>.</li>
<li>The <span style="color: #ff00ff">hide-menu-header</span> relates to the Hide button on the screen shot and <span style="color: #ff00ff">hide-button-options</span> relate to the menu item under that.</li>
<li>The custom <span style="color: #ff00ff">user</span> attribute on the span. This is the id (in our case a fictional id x) of the user&#8217;s events that must be filtered. This is the value that will be posted back to the server during the ajax call.</li>
</ol>
</li>
</ol>
<pre>&lt;body&gt;
    &lt;center&gt;
        &lt;div class="item-container"&gt;
            &lt;div class="left"&gt;
                &lt;div class="left"&gt;
                    &lt;a class="left" href="/profile/sampleprofile"&gt;
                        &lt;img class="profile-pic" src="images/avatar.png" width="55px" height="55px" /&gt;
                    &lt;/a&gt;
                    &lt;div style="clear:both"&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="info"&gt;
                    &lt;p&gt;
                        &lt;strong&gt;
                            &lt;a href="/profile/sampleprofile"&gt;Bruce Banner&lt;/a&gt;
                        &lt;/strong&gt; posted on twitter
                    &lt;/p&gt;
                    &lt;div class="detail"&gt;
                        &lt;a href="#"&gt;8 hours ago&lt;/a&gt; | &lt;a href="#"&gt;comment&lt;/a&gt; | &lt;a href="#"&gt;like&lt;/a&gt;
                    &lt;/div&gt;
               &lt;/div&gt;
           &lt;/div&gt;
           &lt;div class="hide-button"&gt;
               &lt;div class="hide-menu-header"&gt;
                   &lt;input type="button" value="hide"/&gt;
               &lt;/div&gt;
               &lt;span class="hide-button-options" user="x"&gt;
                   &lt;input  type="button" value="Bruce Banner" /&gt;
               &lt;/span&gt;
          &lt;/div&gt;
      &lt;/div&gt;
...
&lt;center&gt;
&lt;body&gt;</pre>
<p><strong><span style="text-decoration: underline">Link up all the events to the appropriate elements:</span></strong></p>
<p>Add script to hidebutton.js. The $(document).ready(&#8230;) construct is used to ensure that the initialization is only run once the full DOM is loaded. Note that $(document).ready(&#8230;) will run as soon as index page is loaded because it is imported in index.php and is not wrapped by any functions.</p>
<p>The script calls three methods that in turn use jQuery selectors to find the appropriate elements by class name or id and then links events to them.</p>
<ul>
<li><span style="color: #ff00ff">initializeFeedItemHoverEvent</span><span style="font-family: monospace">: adds the </span><span style="color: #ff00ff">hover </span><span style="font-family: monospace">event to all elements that contain class </span><span style="color: #ff00ff">item-container <span style="color: #000000">(news feed entries)</span></span><span style="font-family: monospace">. There are 2 functions in this method. The first is fired when a mouse cursor is moved over the element and the second is fired when the mouse is moved away from the element</span></li>
<li><span style="color: #ff00ff">initializeHideMenuClick</span><span style="font-family: monospace">: adds a </span><span style="color: #ff00ff">click </span><span style="font-family: monospace">event to all </span><span style="color: #ff00ff">hide-menu-header</span><span style="font-family: monospace"> (hide menu button) items. It uses </span><span style="color: #ff00ff">$(&#8230;).parent</span><span style="font-family: monospace"> and </span><span style="color: #ff00ff">$(&#8230;).find</span><span style="font-family: monospace"> to find the appropriate elements relative to the current element. </span><span style="color: #ff00ff">$(this)</span><span style="font-family: monospace"> in this method relates to the hide menu button. It also uses </span><span style="color: #ff00ff">removeClass</span><span style="font-family: monospace"> and </span><span style="color: #ff00ff">addClass</span><span style="font-family: monospace"> to toggle the selected and unselected appearance of the hide menu button.</span></li>
<li><span style="color: #ff00ff">initializeHideSubMenuClick</span><span style="font-family: monospace">: Calls the </span><span style="color: #ff00ff">feedfilter</span><span style="font-family: monospace">() method (explained in the next step) on the appropriate hide button sub menu element. The feedfilter() method will use ajax to post the filter back to the server.</span></li>
</ul>
<p style="padding-top:10px">
<pre>//file: hidebutton.js
$(document).ready(function() {
    initializeFeedItemHoverEvent();
    initializeHideMenuClick();
    initializeHideSubMenuClick();
});

//Initialise the hover events over the newsfeed entries function initializeFeedItemHoverEvent(){
//Find all newsfeed items that have a class called item-container
$('.item-container').hover(function() {
        //Show the hide button when the mouse moves onto the item
        $(this).find('.hide-button').show();
    },
    function() {
        //When the mouse cursor leaves the newsfeed item,
        //hide the hide button and reset the styling to original
        var hideButton = $(this).find('.hide-button');
        hideButton.hide();
        resetStyles(hideButton);
        //Hide the submenu of the hide button
        $(this).find('.hide-button-options').hide();
    })
}

//Initialise the click on the hide menu item
function initializeHideMenuClick(){
    //Find the hide button the user clicked and toggle (show/ hide) submenu
    $('.hide-menu-header').click(function() {
        //Find parent with class 'hide-button' of the current element
        //from there find the child of the found element called 'hide-button-options'
        var element = $(this).parent('.hide-button').find('.hide-button-options');

        //Find out which class is set on the current element
        //and based on that set a different class
        if ($(this).attr('class') == 'hide-menu-header'){
            $(this).removeClass('hide-menu-header');
            $(this).addClass('hide-menu-header-selected');
            element.show();
        }
        else {
            $(this).removeClass('hide-menu-header-selected');
            $(this).addClass('hide-menu-header');
            element.hide();
        }
    })
}

//Initialise the click event on the hide sub menu
function initializeHideSubMenuClick(){
    //When the user clicks on the menu option then
    //call the feedfilter method in the  jquery.feedfilter.js file
    if ($(".hide-button-options").length &gt; 0) {
        $(".hide-button-options").feedfilter();
    }
}

//Hide the menu button and its sub menus
function resetStyles(hideButton){
    var menuHeader = hideButton.find(".hide-menu-header-selected");
    if (menuHeader != null){
        menuHeader.removeClass('hide-menu-header-selected');
        menuHeader.addClass('hide-menu-header');
    }
}</pre>
<p><span style="text-decoration: underline"><strong>Complete the server post back:</strong></span><br />
The following section describes the code that fires when a user clicks on the hide button sub menu option. It first extracts the user id that is stored in the custom <span style="color: #ff00ff">user </span>attribute and posts it back to the specified page.</p>
<p>Note the <span style="color: #ff00ff">if (response == &#8220;success&#8221;) {..}</span> section. It finds all the news feed items with a sub element that has a <span style="color: #ff00ff">user </span>attribute with the same value as the news feed item that the user chose to hide.</p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace;line-height: 18px;font-size: 12px">//jquery.feedfilter.js</span></p>
<pre>//Specifiy the feedfilter function definition
//What must happen when the user clicks the sub menu item
(function($) {
	$.fn.feedfilter = function() {

		this.click(function() {
			//Call setFeedfilter
            setFeedfilter($(this));
			return false;
		})

		function setFeedfilter(obj) {

            //Get the value of the user attribute on the current element
            //as the user clicked on the hide sub menu the current element is
            //the hide sub menu
            var user = obj.attr("user");
            var container = obj;
            var originalContent = container.html();

			$.ajax({
		    	type: "POST", //post back method
		    	url: "ajaxpostback.php", //page to post back to
		    	dataType: "json",
		    	data: {"userId": user}, //additional parameters
		    	beforeSend: function(xmlhttprequest) {
                                //change the content of the sub menu button to appear as a
                                //loading animated gif
		    		container.html('&lt;img src="\" alt="\"loading\"" /&gt;')
		    	},
		    	complete: function(xmlhttprequest, textStatus) {
                               //add any code here that should fire once the post back
                               //is completed
		    	},
		    	success: function(response) {
                               //add any code that must run once the postback is completed and
                               //successfull
		    		if (response == "success") {
                        $(".item-container .hide-button-options").each( function() {
                               var data = $(this).attr("user");
                               if (user == data)
                               {
                                   $(this).parent('div').parent('.item-container').hide();
                               }
                            }
                        );
		    		}
                    else
                    {
		    			alert(response);
		    		}
		    	},
		    	error: function(xmlhttprequest,status,error) {
		    		alert("There was a problem with filtering events.");
                    container.html(originalContent);
                    }
		    })
		}
	}
})(jQuery)</pre>
<p style="padding-top:10px"><strong><span style="text-decoration: underline">What happens on the post back page?</span></strong></p>
<p>I have not implemented the actual persisting of the filter setting but have shown how to retrieve the parameter value passed from the client side.</p>
<pre>&lt;?php
    //Persist $_POST["userId"];
    echo json_encode(array("success"));
?&gt;</pre>
<p style="padding-top:10px"><span style="text-decoration: underline"><strong>View the result</strong></span></p>
<p style="padding-top:10px">Browse to the index.php page and you should get something similar to the screenshot shown below.</p>
<p><img class="alignnone size-full wp-image-967" src="http://www.mihswat.com/wp-content/uploads/2009/10/result.bmp" alt="Code Sample Result" /></p>
<p style="padding-top:10px"><strong><span style="text-decoration: underline">What&#8217;s next?</span></strong></p>
<ul>
<li>Styling can be refined. I used some inline styles etc that can be moved to the style sheets.</li>
<li>Content is static at the moment. The news feed items would normally be generated from a data store of some sort</li>
<li>Add additional error handling</li>
<li>I used inline php and markup together to simplify the example. Best practice though, is to split your php code and markup. One approach would be to implement the Model View Controler (MVC) design pattern. A good option for this is to use the Zend Framework (<a href="http://framework.zend.com/">http://framework.zend.com/</a>). It implements the MVC pattern and has loads wrapper classes that wraps commonly used functionality to promote reuse.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mihswat.com/2009/11/16/how-did-they-do-that/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Journey to planet Android</title>
		<link>http://www.mihswat.com/2009/09/28/my-journey-to-planet-android/</link>
		<comments>http://www.mihswat.com/2009/09/28/my-journey-to-planet-android/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 09:11:17 +0000</pubDate>
		<dc:creator>Bradley Wells</dc:creator>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[SWAT]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.mihswat.com/?p=838</guid>
		<description><![CDATA[Coming from a Flash Developer background I have had no experience with mobile application development. From the time I saw the first phone to run Android, the G1, I have been itching to get into Android development. So when I was recently given the go-ahead to take this journey into the Android world, plus a [...]]]></description>
			<content:encoded><![CDATA[<p>Coming from a Flash Developer background I have had no experience with mobile application development. From the time I saw the first phone to run Android, the G1, I have been itching to get into Android development. So when I was recently given the go-ahead to take this journey into the <a title="Android" href="http://www.android.com/" target="_blank">Android</a> world, plus a shiny new Android phone <img src='http://www.mihswat.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  , I was both excited and nervous<span id="more-838"></span> . Why nervous? Firstly, I had never developed for a mobile device before, secondly I had never written  a Java application before and lastly because I had no idea how the Android framework actually worked . But this is what we as SWAT employees love, new territory to conquer ! If you havent seen a Android device yet, see the video below of the new HTC Hero.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/FKTDSfbcbBU&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0xe1600f&amp;color2=0xfebd01" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="400" height="295" src="http://www.youtube.com/v/FKTDSfbcbBU&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0xe1600f&amp;color2=0xfebd01" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Nowadays it&#8217;s almost impossible to write an article about mobile phones without mentioning the very successful<a title="iPhone" href="http://www.mihswat.com/2009/09/22/i-dont-like-the-iphone/" target="_self"> iPhone</a>. <a title="Apple" href="http://www.apple.com" target="_blank">Apple</a> had practically turned the mobile  industry upside down with its touch screen device. Some people will argue to the death about how the iPhone, or the &#8220;Jesus Phone&#8221; as some call it, is the best thing since sliced bread &#8211; and nobody can argue against how successful this device has become. But I am predicting a total onslaught of Android devices within 2 years. The Android army of phones will be everywhere you look and you will not be able to visit any cellphone store without running into at least 50 different phones running this OS. OK &#8211; maybe that is going a bit far but I think you get the message and already we are seeing signs of it. At the time of writing this article there are 16 official Android devices. How will this army of Android devices be created you ask ? Enter the Open Handset Alliance.</p>
<p>The <a title="Open Handset Alliance" href="http://en.wikipedia.org/wiki/Open_Handset_Alliance" target="_blank">Open Handset Alliance</a> was formed in 2007 and currently has 47 members. It is a consortium of technology and mobile companies all dedicated to bringing us better mobile experiences, with Android being their first project . There are some big names amongst the 47 members, including Google, Intel, Nvidia, HTC, Asus, SonyEriccson, LG, Ebay. With so many big names dedicated to Android development, it is bound to be amongst the top mobile device OS&#8217;s. You can read more about this <a title="before" href="http://www.mihswat.com/2008/10/07/why-android-will-win-or-iphone-in-the-long-run/" target="_self">argument here</a>, let me get to the Android architecture.</p>
<p>Android is a Linux based software stack. On top of the Linux kernel layer lies a layer for the system libraries such as SQLite, SSL, OpenGL, etc. This layer also houses the Android runtime, which runs the Dalvik Virtual Machine. On top of this there&#8217;s the Application Framework, housing the managers like the Activity Manager, Window Manager, etc. Then finally there is the application layer, which is the layer we are most interested in.</p>
<p><img class="alignnone size-full wp-image-844" title="system-architecture" src="http://www.mihswat.com/wp-content/uploads/2009/09/system-architecture.jpg" alt="system-architecture" width="428" height="307" /></p>
<p>Android applications can consist of different sections, namely Activities, Services, Broadcast Recievers and Content Providers. Activities form the User Interface(UI) part of the application, Services run in the background similar to RSS feed readers checking for updates. Broadcast Receivers just listen for particular system broadcasts, for example , when the battery is low. Content Providers just provide content to any asking application , for example your application asking the contact book to provide the users contacts for use within your application. We will mostly be concerned with Activities.</p>
<p>Activities were designed to be totally integrated with one another. What I mean is that Activities can call one another and pass data to one another, basically  like an event driven system, but on a system wide level. An application is thus a group of Activities passing Intents to one another. It is then possible to include , lets say, a Google Maps Activity into your application by passing a Google Maps Intent to it and waiting for a result from it. It would seem to the end user that you created a Google Maps section to your app. I think this is pretty powerful.</p>
<p>To get started with creating these applications you need the free <a title="Android SDK" href="http://developer.android.com/sdk/1.6_r1/index.html">Android SDK</a>, Apple iPhone developers need to register first($99!). Then you going to need an IDE, there is an Eclipse plugin, the <a title="Android Development Tools" href="http://dl.google.com/android/ADT-0.9.3.zip">Android Development Tools</a>(ADT) plugin that has everything including the latest stable SDK. You don&#8217;t immediately need a phone to test on as ADT comes with an Android emulator that you can debug and test with but you will eventually need a phone to properly test with. ADT is pretty awesome as it comes with many tools to tell you exactly whats happening on the phone, which threads are running,it has code completion, wizards to quickly create sub classes and much more. It took me less than 30 minutes to get a  &#8220;Hello World&#8221; application running on the Android emulator from the time I installed the ADT!</p>
<p>Since ActionScript 3 is a lot like Java I could easily jump in even though there were a few syntax differences &#8211; but after about 2 days and the help of ADT I had a basic application drawing a ball bouncing round the screen. But that was only the beginning and have rewritten sections of the game many times. Now after two weeks of lots of learning I have created the game and have it running on my phone. It is still a prototype and even though it needs weeks more spit and polish, after demonstrating the game I have gotten the thumbs up to turn it into a real game which we will be registering in the Android market.  There is still a lot to learn from this wonderful framework but the <a title="Android Groups" href="http://groups.google.com/group/android-beginners">Android groups</a> have been great help, as well as all the <a title="Android forums" href="http://www.anddev.org/" target="_blank">Android forums</a> and of course, <a title="developers guide" href="http://developer.android.com/guide/topics/graphics/2d-graphics.html">the Reference guide</a> which ships with the SDK. It has been a challenge to get to grips with this entirely new development area but it was far easier than imagined it would be. I spent about 10 times longer getting to know Flash, and that was with people available to help me.</p>
<p>What about my experience using the phone? I can honestly say I am now more connected than ever before. My email, both gmail and exchange, is pushed to the phone. My Twitter application runs in the background constantly fetching  tweets, while my Facebook application gets all my buddies&#8217; status updates to me as often as I want to see them. News and weather is updated all the time. My calendar and contacs are synchronised between my phone and my mobile. I never get lost anymore, maps are always available and my Gtalk status is always &#8220;available&#8221; and running in the background, unlike on some other phones <img src='http://www.mihswat.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Oh, and it makes phone calls as well.</p>
<p>I will follow up with another article of my findings, good and bad, this time focusing on the actual Android game development.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihswat.com/2009/09/28/my-journey-to-planet-android/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Visualise your social graph on Facebook</title>
		<link>http://www.mihswat.com/2009/05/25/visualise-your-social-graph-on-facebook/</link>
		<comments>http://www.mihswat.com/2009/05/25/visualise-your-social-graph-on-facebook/#comments</comments>
		<pubDate>Mon, 25 May 2009 15:23:23 +0000</pubDate>
		<dc:creator>Neb Kragic</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[Neb Kragic]]></category>
		<category><![CDATA[Social Graph]]></category>
		<category><![CDATA[spring graph]]></category>

		<guid isPermaLink="false">http://www.mihswat.com/?p=704</guid>
		<description><![CDATA[We have just posted our experimental Social Graph application on Facebook. It offers Facebook users additional insight into their personal social networks, allowing them to identify different social clusters they belong to. In the work and life balancing game, the person with the biggest number of clusters, and not the person with the biggest number [...]]]></description>
			<content:encoded><![CDATA[<p><!--[if gte mso 10]&gt;--> <!--[endif]--></p>
<p class="MsoNormal">We have just posted our experimental <a href="http://apps.facebook.com/socgraph">Social Graph</a> application on Facebook. It offers Facebook users additional insight into their personal social networks, allowing them to identify different social clusters they belong to. In the work and life balancing game, the person with the biggest number of clusters, and not the person with the biggest number of friends, wins.<span id="more-704"></span></p>
<p class="MsoNormal"><a href="http://apps.facebook.com/socgraph"><img class="alignnone size-full wp-image-705" src="http://www.mihswat.com/wp-content/uploads/2009/05/graph.png" alt="graph" width="416" height="330" /></a></p>
<p class="MsoNormal"><!--[if gte mso 9]&gt;  Normal 0     false false false  EN-ZA X-NONE X-NONE                           &lt;![endif]--><!--[if gte mso 9]&gt;                                                                                                                                            &lt;![endif]--> The most interesting part in developing this application is its use of the so called <a href="http://en.wikipedia.org/wiki/Force-based_algorithms">spring-electrical-graph</a>. It utilises a simple yet powerful algorithm for laying out entity-relationship diagrams (or graphs in a mathematical sense of the word). Any well laid out graph should keep the unrelated entities far from each other while keeping the related ones close. The spring-electrical-graph does exactly this by simulating an environment where all entities are electrical particles of the same charge while the related entities are connected via springs. The rest is left up to physics. The electrical particles repel each other via <a href="http://en.wikipedia.org/wiki/Coulomb%27s_law">Coulomb’s law</a> while the related ones pull each other via <a href="http://en.wikipedia.org/wiki/Hooke%27s_law">Hooke’s law</a> due to the springs that link them. <span> </span></p>
<p class="MsoNormal">The actual simulation is implemented using the 4<sup>th</sup> order <a href="http://en.wikipedia.org/wiki/Runge-Kutta">Runge-Kutta method</a> for solving ordinary differential equations. Other methods could be used as well but this one was particularly well suited for our use and I had the code available from my <a href="http://www.binarytoys.com/">Binary Toys</a> project.</p>
<p class="MsoNormal">While there are other social graphs applications already available on Facebook, <a href="http://apps.facebook.com/nexus">Nexus</a> being one of them, ours is a bit more interactive and fun to play with. But we are paying a heavy price for this interactivity in a form of performance degradation for users with a very large number of friends. As the repelling force acts between all entities all the time, for a user that has 1000 friends, we have to apply almost a million forces to our model. And we have to do that four times for the 4<sup>th</sup> order Runge-Kutta computation. For everything to run smoothly we would like to do all that at least 25 times per second, which takes our hunger for CPU power up to 100 million computations per second. We soon learned the hard way why Action Script 3 is still just a script, even though we love it.</p>
<p class="MsoNormal">Click this link to add the SWAT Social Graph to your facebook account:  <a href="http://apps.facebook.com/socgraph">Social Graph</a></p>
<p class="MsoNormal">
]]></content:encoded>
			<wfw:commentRss>http://www.mihswat.com/2009/05/25/visualise-your-social-graph-on-facebook/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New version of Feedalizr</title>
		<link>http://www.mihswat.com/2008/10/27/new-version-of-feedalizr/</link>
		<comments>http://www.mihswat.com/2008/10/27/new-version-of-feedalizr/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 15:33:43 +0000</pubDate>
		<dc:creator>John Kotsaftis</dc:creator>
				<category><![CDATA[SWAT]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[feedalizr]]></category>
		<category><![CDATA[friendfeed]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.mihswat.com/?p=345</guid>
		<description><![CDATA[We have just launched a new version of Feedalizr and what is SO special about this version is that we now provide users with the ability to update their facebook status (and also read their friends updates &#8211; sort of like facebook twitter). Feedalizr is becoming a way for you to &#8220;re-mix&#8221; the web and [...]]]></description>
			<content:encoded><![CDATA[<p>We have just launched a new version of <a title="Feedalizr" href="http://www.feedalizr.com" target="_blank">Feedalizr</a> and what is SO special about this version is that we now provide users with the ability to update their facebook status (and also read their friends updates &#8211; sort of like facebook twitter).</p>
<p>Feedalizr is becoming a way for you to &#8220;re-mix&#8221; the web and we notice that lots of our users are using the product in the discovery of serendipitous content. Not so much reporting to each other about what they had for breakfast&#8230; <img src='http://www.mihswat.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This is largely a function of  how twitter/friendfeed are evolving. I think the facebook status update makes feedalizr the must have web 2.0 killer app (if I may say so myself &#8211; and you guys can flame me cause I am wearing kevlar !).</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihswat.com/2008/10/27/new-version-of-feedalizr/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
