<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>These Days Labs</title>
	
	<link>http://labs.thesedays.com</link>
	<description />
	<lastBuildDate>Wed, 25 Aug 2010 07:54:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TheseDaysLabs" /><feedburner:info uri="thesedayslabs" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>10 links for Facebook developers</title>
		<link>http://feedproxy.google.com/~r/TheseDaysLabs/~3/jBHvXptXTso/</link>
		<comments>http://labs.thesedays.com/2010/08/25/10-links-for-facebook-developers/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 07:54:04 +0000</pubDate>
		<dc:creator>Keegan Street</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[FQL]]></category>
		<category><![CDATA[Graph API]]></category>
		<category><![CDATA[JavaScript SDK]]></category>
		<category><![CDATA[Open Graph protocol]]></category>
		<category><![CDATA[PHP SDK]]></category>
		<category><![CDATA[social plugins]]></category>
		<category><![CDATA[URL linter]]></category>
		<category><![CDATA[XFBML]]></category>

		<guid isPermaLink="false">http://labs.thesedays.com/?p=874</guid>
		<description><![CDATA[
These are the resources I most frequently refer to while developing Facebook apps. This is by no means an exhaustive list but hopefully it contains something that will help you out.
Official developer&#8217;s documentation
Googling for Facebook documentation will often bring you to outdated, incorrect information. Even the official looking wiki.developers.facebook.com contains information that is downright wrong, [...]]]></description>
			<content:encoded><![CDATA[
<p><em>These are the resources I most frequently refer to while developing Facebook apps. This is by no means an exhaustive list but hopefully it contains something that will help you out.</em></p>
<h3><a href="http://developers.facebook.com/docs/" target="_blank">Official developer&#8217;s documentation</a></h3>
<p>Googling for Facebook documentation will often bring you to outdated, incorrect information. Even the official looking wiki.developers.facebook.com contains information that is downright wrong, so stick with <a href="http://developers.facebook.com/docs/" target="_blank">developers.facebook.com/docs</a>. Here you can find documentation about everything Facebook: authentication, JavaScript SDK, Graph API, Open Graph protocol, social plugins, FQL, PHP SDK, XFBML and more.</p>
<h3><a href="http://fbrell.com/examples" target="_blank">Working examples of  Javascript SDK methods and XFBML tags</a></h3>
<p>The best way to learn how these things work is to see some working examples.</p>
<h3><a href="http://app.apigee.com/console/facebook" target="_blank">Console for testing Graph API queries</a></h3>
<p> If you&#8217;re having trouble making Graph API queries from the JavaScript SDK, PHP SDK or some other method, this is a great tool that can help you determine whether the problem is in the query or your other code. It also contains an (almost) exhaustive list of the objects and properties available through the Graph API, but still needs to be updated to include <a href="http://developers.facebook.com/docs/reference/api/checkin" target="_blank">checkins</a>. You can browse through the list and see what information is available to you and the format that it is returned in.</p>
<p>If you see an error message saying &quot;You must use https:// when passing an access token,&quot; then change the URL in the input text field from http to https. That&#8217;s a bug Apigee needs to fix in its console.</p>
<h3><a href="http://developers.facebook.com/docs/reference/rest/fql.query" target="_blank">Console for testing FQL queries</a></h3>
<p> FQL queries tend to be more complex than Open Graph queries, so it can be even more valuable to test them out in a console before trying to call them programatically.</p>
<h3><a href="http://developers.facebook.com/tools/lint/" target="_blank">URL Linter</a></h3>
<p> If you want your web pages to be shared through Facebook, you will either add <a href="http://developers.facebook.com/docs/opengraph" target="_blank">Open Graph protocol meta tags</a> or <a href="http://developers.facebook.com/docs/share" target="_blank">basic meta tags</a> to your pages. No matter which technique you use, the URL Linter can easily show you how Facebook will interpret this metadata when users share your pages.</p>
<h3><a href="http://forum.developers.facebook.net/" target="_blank">Developers&#8217; Forum</a></h3>
<p> Draw from the knowledge and experience of over one hundred thousand Facebook developers. Just go easy on the Facebook reps &#8211; you can&#8217;t expect them to respond to every message or fix every bug. Unfortunately a lot of people tend to be quite disrespectful in the forums.</p>
<h3><a href="http://bugs.developers.facebook.net/" target="_blank">Bugzilla</a></h3>
<p> The constant innovation of the Facebook platform comes with a price: there is a never-ending backlog of bugs. If you&#8217;re banging your head up against the wall because your app isn&#8217;t working, more often than not it will be a problem with Facebook&#8217;s code rather than yours. Search Bugzilla to find out if other developers are experiencing the same issues as you &#8211; and see if or when Facebook plan to fix it.</p>
<h3><a href="http://thinkdiff.net/category/facebook/" target="_blank">ThinkDiff.net tutorials</a></h3>
<p>The blog of Md. Mahmud Ahsan contains some really useful tutorials for Facebook development &#8211; from <a href="http://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development/" target="_blank">getting started with the JavaScript SDK</a> through to advanced topics like using the new <a href="http://thinkdiff.net/facebook/how-to-develop-facebook-application-for-iphone/" target="_blank">iPhone SDK</a>.</p>
<h3><a href="http://www.smashingmagazine.com/2010/07/23/free-facebook-gui-psd-kit/" target="_blank">Facebook GUI PSD kit</a></h3>
<p> A free set of vector images of Facebook GUI elements like the multi-friend selector and authentication dialogue. Really useful for wireframing and design. Thanks to <a href="http://surgeworks.com/" target="_blank">SurgeWorks</a> for providing this resource.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://labs.thesedays.com/2010/08/25/10-links-for-facebook-developers/&amp;title=10+links+for+Facebook+developers" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://labs.thesedays.com/2010/08/25/10-links-for-facebook-developers/&amp;title=10+links+for+Facebook+developers" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://labs.thesedays.com/2010/08/25/10-links-for-facebook-developers/&amp;title=10+links+for+Facebook+developers" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://labs.thesedays.com/2010/08/25/10-links-for-facebook-developers/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://labs.thesedays.com/2010/08/25/10-links-for-facebook-developers/&amp;t=10+links+for+Facebook+developers" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=10+links+for+Facebook+developers+-+http://bit.ly/bBvBec+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://labs.thesedays.com/2010/08/25/10-links-for-facebook-developers/&amp;title=10+links+for+Facebook+developers&amp;summary=These%20are%20the%20resources%20I%20most%20frequently%20refer%20to%20while%20developing%20Facebook%20apps.%20This%20is%20by%20no%20means%20an%20exhaustive%20list%20but%20hopefully%20it%20contains%20something%20that%20will%20help%20you%20out.%0D%0AOfficial%20developer%27s%20documentation%0D%0AGoogling%20for%20Facebook%20documentation%20will%20often%20bring%20you%20to%20outdated%2C%20incorrect%20i&amp;source=These Days Labs" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://labs.thesedays.com/2010/08/25/10-links-for-facebook-developers/&amp;t=10+links+for+Facebook+developers" rel="nofollow" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<img src="http://feeds.feedburner.com/~r/TheseDaysLabs/~4/jBHvXptXTso" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://labs.thesedays.com/2010/08/25/10-links-for-facebook-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://labs.thesedays.com/2010/08/25/10-links-for-facebook-developers/</feedburner:origLink></item>
		<item>
		<title>Unit tests: expose bugs and spend less time fixing them!</title>
		<link>http://feedproxy.google.com/~r/TheseDaysLabs/~3/EJ28JZH-ecw/</link>
		<comments>http://labs.thesedays.com/2010/08/16/unit-tests-expose-bugs-and-spend-less-time-fixing-them/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 10:23:26 +0000</pubDate>
		<dc:creator>Lennart</dc:creator>
				<category><![CDATA[Docs & Guides]]></category>
		<category><![CDATA[Patterns & Frameworks]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://labs.thesedays.com/?p=845</guid>
		<description><![CDATA[
Hands-on introduction to creating unit tests that cover your application&#8217;s business logic
An extra effort and more code: two major drawbacks that often discourage developers from writing unit tests. They seem hard to write and little to contribute or at least that is what I first experienced when I started using them. And although I still [...]]]></description>
			<content:encoded><![CDATA[
<p><em>Hands-on introduction to creating unit tests that cover your application&#8217;s business logic</em></p>
<p>An extra effort and more code: two major drawbacks that often discourage developers from writing unit tests. They seem hard to write and little to contribute or at least that is what I first experienced when I started using them. And although I still don’t consider myself to be an expert in the field of test-driven development, I have not given up and can say: <strong>unit tests are a real time saver</strong>. Rather than walking through a long list of benefits, let’s write some code and see for ourselves..</p>
<p>Before you can write a unit test you obviously need to have a chunk of code or some business logic that requires testing. The following example shows you how to add a unit test after writing your initial code and how you can alter the unit test before writing any additional code (e.g. in a second iteration).</p>
<p><strong>Important to note</strong>: although the example is created in C# with the Visual Studio unit-testing framework, the principles can be applied to any given library in your preferred programming language.</p>
<p>The full source code of the example can be downloaded <a href="http://labs.thesedays.com/wp-content/uploads/2010/08/UnitTestDemo.zip" target="_self">here</a>.</p>
<p><strong>Example: Testing the shopping basket of a web shop</strong><br />
Let’s say you are working on a web shop and you are asked to implement some logic that calculates the total price of a shopping basket. You’ve created the shopping basket and price calculation logic in the business tier:</p>
<pre class="brush: php">
public class WebshopFacade
{
public void AddProductToBasket(ShoppingBasket basket,
Product product)
{
basket.Add(product);
UpdateBasketPrice(basket);
}

public void UpdateBasketPrice(ShoppingBasket basket)
{
double totalPrice = 0;
foreach (ShoppingBasketItem item in basket.GetItems())
{
totalPrice += item.Product.UnitPrice * item.Amount;
}
basket.TotalPrice = totalPrice;
}
}
</pre>
<p>The code is pretty straightforward: the web shop can create a basket but to add an item it needs to call the façade which will than update the basket’s total price. Now, before creating a web page (and I know you want to) it’s a good practice to set up a unit test. Why? If there are any coding errors in the shopping basket or its price calculation, <strong>you want to expose these bugs right now</strong>, and not by experiencing strange issues when creating the web page which will eventually have you debug the web application. The unit test may already save you from losing precious time, and surely you want to <strong>hold on to it for future testing</strong> when the price calculation logic becomes more complicated.</p>
<p><strong>Test method 1: Initial price of the basket</strong><br />
Ok, let’s start out with a basic yet crucial test: you want to make sure that when the web shop creates a basket, the initial total price is zero. You may laugh, but your customers won’t if this is not the case!</p>
<pre class="brush: php">
[TestClass]
public class ShoppingBasketTest
{
public ShoppingBasketTest()
{
}

[TestMethod]
public void TotalPriceOfEmptyBasketMustBeZero()
{
ShoppingBasket basket = new ShoppingBasket();
Assert.AreEqual(0, basket.TotalPrice, &quot;Expected total price to be zero for empty basket&quot;);
}
}
</pre>
<p>That wasn’t so hard, was it? Running all tests in Visual Studio takes only a few seconds and for me it resulted in a <em>test run completed, results: 1/1 passed</em>.  Sweet, an instant <strong>confidence boost</strong>!</p>
<p><strong>Test method 2: Adding products to the basket</strong><br />
Let’s move on and add a test method that ensures products can be added to the basket:</p>
<pre class="brush: php">
[TestMethod]
public void ProductsCanBeAddedToTheBasket()
{
ShoppingBasket basket = new ShoppingBasket();
WebshopFacade facade = new WebshopFacade();
MockFactory mocks = new MockFactory();

for (int i = 0; i &amp;lt; 50; i++)
{
facade.AddProductToBasket(basket, mocks.CreateProduct());
}

int totalUnits = 0;
foreach (ShoppingBasketItem item in basket.GetItems())
{
totalUnits += item.Amount;
}

Assert.AreEqual(50, totalUnits, &quot;Expected 50 units in the basket after adding 50 random products&quot;);
}
</pre>
<p>In this test 50 random products are added to the basket, and then the test does a recount by looping through the basket’s items. As the test method cannot create products directly (nor can the web shop for that matter) a mock factory is used to create mock objects, in this case products.</p>
<p>And believe it or not, when I first ran the test it failed because of a bug in the basket. In Visual Studio you can add a breakpoint inside any test method and <strong>instantly debug the test method</strong>, so I was able to resolve the issue in no time!</p>
<p><strong>Test method 3: Price calculation</strong><br />
Finally, you can add a test method which ensures the total price is calculated correctly:</p>
<pre class="brush: php">
[TestMethod]
public void BasketTotalPriceIsCalculatedCorrectly()
{
ShoppingBasket basket = new ShoppingBasket();
WebshopFacade facade = new WebshopFacade();
MockFactory mocks = new MockFactory();

double expectedTotal = 0;
for (int i = 0; i &amp;lt; 50; i++)
{
var product = mocks.CreateProduct();
facade.AddProductToBasket(basket, mocks.CreateProduct());
expectedTotal += product.UnitPrice;
}

Assert.AreEqual(Math.Round(expectedTotal, 2),  Math.Round(basket.TotalPrice, 2), &quot;Expected total price does not match basket&#039;s total price&quot;);
}
</pre>
<p>The code is mostly copied and pasted from the previous method, but here the price calculation is somewhat mimicked. It may seem obvious that this test will pass, but when you make further progress in developing the basket, this test method can fail, and it will expose any bugs that were introduced by your (or someone else’s) changes.</p>
<p>Another way of testing this logic would be to create some specific products, and to hard code the expected total price. This could include special situations that don’t frequently occur but are part of the business logic, e.g. discounts for certain products, discounts for a specific amount of products, etc.</p>
<p><strong>Creating a unit test before writing any code</strong><br />
The unit test now covers the basic functionality of the basket and you might decide to start a second iteration in which you introduce removal of products or discount logic. In either case you can initiate this iteration by creating new unit tests or updating the existing one allowing you to <strong>focus on the requirements</strong> before writing any code.</p>
<p>You can start by changing the “interface” of the façade, by adding a method for product removal:</p>
<pre class="brush: php">
public void RemoveFromBasket(ShoppingBasket basket,
Product product)
{
throw new NotImplementedException();
}
</pre>
<p>And now you can add new test methods that validate the product removal logic:</p>
<pre class="brush: php">
[TestMethod]
public void ProductsCanBeRemovedFromTheBasket()
{
ShoppingBasket basket = new ShoppingBasket();
WebshopFacade facade = new WebshopFacade();
MockFactory mocks = new MockFactory();

var addedProducts = new List
();
for (int i = 0; i &amp;lt; 50; i++)
{
var product = mocks.CreateProduct();
facade.AddProductToBasket(basket, product);
addedProducts.Add(product);
}

for (int i = 0; i &amp;amp;amp;amp;amp;amp;amp;lt; 25; i++)
{
var remove = addedProducts[i];
facade.RemoveFromBasket(basket, remove);
addedProducts.Remove(remove);
}

int totalUnits = 0;
foreach (ShoppingBasketItem item in basket.GetItems())
{
totalUnits += item.Amount;
}

Assert.AreEqual(25, totalUnits, &quot;Expected the basket to have 25 remaining units after removal&quot;);
}
</pre>
<pre class="brush: php">
[TestMethod]
[ExpectedException(typeof(ShoppingBasketException), &quot;Expected shopping basket exception to be thrown&quot;)]
public void ProductMustExistInBasketOnRemoval()
{
ShoppingBasket basket = new ShoppingBasket();
WebshopFacade facade = new WebshopFacade();
MockFactory mocks = new MockFactory();

facade.RemoveFromBasket(basket, mocks.CreateProduct());
}
</pre>
<p>Obviously the unit test will fail if you run it before you have written the actual implementation, but for sure you will <strong>gain a great deal of insight</strong> in how to set up any interfaces, how objects should behave or interact, how exceptions are thrown, etc.</p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/08/ScreenVSTestOuput.jpg"><img class="alignnone size-medium wp-image-866" title="ScreenVSTestOuput" src="http://labs.thesedays.com/wp-content/uploads/2010/08/ScreenVSTestOuput-300x138.jpg" alt="" width="300" height="138" /></a></p>
<p><strong>Try it out yourself!</strong><br />
A demo, including the example’s <strong>full source code</strong> can be downloaded <a href="http://labs.thesedays.com/wp-content/uploads/2010/08/UnitTestDemo.zip" target="_self">here</a>. You can run the tests in Visual Studio by pressing CTRL-R A or through the menu as shown in the screenshot below. If you are new to unit testing and can use a little practice, I strongly recommend that you try and write the code for product removal, and see if you can make the failing unit test pass again.</p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/08/ScreenVSRunAllTests.jpg"><img class="alignnone size-medium wp-image-865" title="ScreenVSRunAllTests" src="http://labs.thesedays.com/wp-content/uploads/2010/08/ScreenVSRunAllTests-300x88.jpg" alt="" width="300" height="88" /></a></p>
<p><strong>Final considerations</strong><br />
•	Any unit tests that you create are there to stay and the more complex a module becomes the more often you will find that<strong> bugs are exposed when the module is changed or re-factored</strong>, simply by rerunning the tests<br />
•	By creating advanced unit tests you are to mimic and validate every possible in- and output of a certain module, allowing you to <strong>immediately recognize and debug</strong> the most specific / exotic situations when a test fails<br />
•	Unit tests may seem like a lot of code to write, but most of the time <strong>you are just writing the consuming code</strong> that has to be implemented anyway<br />
•	Unit tests offer <strong>great insight in how a module behaves or is to be used</strong>. Developers that are not familiar with the code can walk through the tests as it were code documentation</p>
<p>Hope this helps!</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://labs.thesedays.com/2010/08/16/unit-tests-expose-bugs-and-spend-less-time-fixing-them/&amp;title=Unit+tests%3A+expose+bugs+and+spend+less+time+fixing+them%21" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://labs.thesedays.com/2010/08/16/unit-tests-expose-bugs-and-spend-less-time-fixing-them/&amp;title=Unit+tests%3A+expose+bugs+and+spend+less+time+fixing+them%21" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://labs.thesedays.com/2010/08/16/unit-tests-expose-bugs-and-spend-less-time-fixing-them/&amp;title=Unit+tests%3A+expose+bugs+and+spend+less+time+fixing+them%21" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://labs.thesedays.com/2010/08/16/unit-tests-expose-bugs-and-spend-less-time-fixing-them/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://labs.thesedays.com/2010/08/16/unit-tests-expose-bugs-and-spend-less-time-fixing-them/&amp;t=Unit+tests%3A+expose+bugs+and+spend+less+time+fixing+them%21" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Unit+tests%3A+expose+bugs+and+spend+less+time+fixing+them%21+-+http://bit.ly/djRp0C+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://labs.thesedays.com/2010/08/16/unit-tests-expose-bugs-and-spend-less-time-fixing-them/&amp;title=Unit+tests%3A+expose+bugs+and+spend+less+time+fixing+them%21&amp;summary=Hands-on%20introduction%20to%20creating%20unit%20tests%20that%20cover%20your%20application%27s%20business%20logic%0D%0A%0D%0AAn%20extra%20effort%20and%20more%20code%3A%20two%20major%20drawbacks%20that%20often%20discourage%20developers%20from%20writing%20unit%20tests.%20They%20seem%20hard%20to%20write%20and%20little%20to%20contribute%20or%20at%20least%20that%20is%20what%20I%20first%20experienced%20when&amp;source=These Days Labs" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://labs.thesedays.com/2010/08/16/unit-tests-expose-bugs-and-spend-less-time-fixing-them/&amp;t=Unit+tests%3A+expose+bugs+and+spend+less+time+fixing+them%21" rel="nofollow" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<img src="http://feeds.feedburner.com/~r/TheseDaysLabs/~4/EJ28JZH-ecw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://labs.thesedays.com/2010/08/16/unit-tests-expose-bugs-and-spend-less-time-fixing-them/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://labs.thesedays.com/2010/08/16/unit-tests-expose-bugs-and-spend-less-time-fixing-them/</feedburner:origLink></item>
		<item>
		<title>Publishing Facebook stories on browsers with popup blockers</title>
		<link>http://feedproxy.google.com/~r/TheseDaysLabs/~3/1qwA9GqAzA8/</link>
		<comments>http://labs.thesedays.com/2010/08/11/publishing-facebook-stories/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 07:47:33 +0000</pubDate>
		<dc:creator>Keegan Street</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[news feed story]]></category>
		<category><![CDATA[stream publish]]></category>

		<guid isPermaLink="false">http://labs.thesedays.com/?p=812</guid>
		<description><![CDATA[
How to use Facebook&#8217;s Stream.Publish method on browsers with popup blockers. See a demo.
What is the problem?
Recently many Facebook developers have been frustrated by popup blockers preventing the Stream Publish dialogue box from being displayed. If a user hasn&#8217;t logged in and authorised the application, dialogue boxes are shown in a popup window instead of [...]]]></description>
			<content:encoded><![CDATA[
<p><em>How to use Facebook&#8217;s Stream.Publish method on browsers with popup blockers. <a href="http://www.facebook.com/connect/uiserver.php?api_key=fda2d4e90d973af5ef44890448cb9cf8&#038;method=stream.publish&#038;channel=http%3A%2F%2Fwww.facebook.com%2Fxd_receiver_v0.4.php&#038;extern=1&#038;attachment=%7B%22name%22%3A%22I%5Cu2019m+reading+about+Facebook+development+on+These+Days+Labs%22%2C%22href%22%3A%22http%3A%5C%2F%5C%2Flabs.thesedays.com%5C%2F2010%5C%2F08%5C%2F11%5C%2Fpublishing-facebook-stories%5C%2F%22%2C%22caption%22%3A%22Recently+many+Facebook+developers+have+been+frustrated+by+popup+blockers+preventing+the+Stream+Publish+dialogue+box+from+being+displayed.+If+a+user+hasn%5Cu2019t+logged+in+and+authorised+the+application%2C+dialogue+boxes+are+shown+in+a+popup+window+instead+of+an+iframe.+That%5Cu2019s+fine+for+some+visitors%2C+but+for+those+who+have+a+popup+blocker+enabled%2C+it+means+that+they+won%5Cu2019t+see+the+dialogue+box+and+therefore+can%5Cu2019t+publish+a+post+into+the+stream.%22%2C%22media%22%3A%5B%7B%22type%22%3A%22image%22%2C%22src%22%3A%22http%3A%5C%2F%5C%2Flabs.thesedays.com%5C%2Fwp-content%5C%2Fthemes%5C%2Ftdlabs%5C%2Fimg%5C%2Fthese_days.gif%22%2C%22href%22%3A%22http%3A%5C%2F%5C%2Flabs.thesedays.com%5C%2F2010%5C%2F08%5C%2F11%5C%2Fpublishing-facebook-stories%5C%2F%22%7D%5D%7D&#038;action_links=%5B%5D&#038;display=popup&#038;next=http%3A%2F%2Flabs.thesedays.com" target="_blank">See a demo.</a></em></p>
<h3>What is the problem?</h3>
<p>Recently many Facebook developers have been frustrated by popup blockers preventing the Stream Publish dialogue box from being displayed. If a user hasn&#8217;t logged in and authorised the application, dialogue boxes are shown in a popup window instead of an iframe. That&#8217;s fine for some visitors, but for those who have a popup blocker enabled, it means that <i>they won&#8217;t see the dialogue box and therefore can&#8217;t publish a post into the stream</i>.</p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/08/iframe.jpg"><img src="http://labs.thesedays.com/wp-content/uploads/2010/08/iframe-300x226.jpg" alt="The Stream Publish dialogue being displayed in an iframe." title="iframe" width="300" height="226" class="size-medium wp-image-830" /></a><br/>The Stream Publish dialogue being displayed in an iframe.</p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/08/popup.jpg"><img src="http://labs.thesedays.com/wp-content/uploads/2010/08/popup-300x226.jpg" alt="The Stream Publish dialogue being displayed in a popup window. Popup blockers will prevent this from opening." title="popup" width="300" height="226" class="size-medium wp-image-831" /></a><br/>The Stream Publish dialogue being displayed in a popup window. Popup blockers will prevent this from opening.</p>
<h3>What causes it?</h3>
<p>Previously popup blockers didn&#8217;t cause any problems for the Stream Publish method because all dialogue boxes were displayed with an iframe rather than a popup window. But in mid-May Facebook discovered that this exposed users to a <a href="http://www.bbc.co.uk/news/10224434" target="_blank">clickjacking security vulnerability</a>. To address the security problem, dialogue boxes are now shown in a popup window instead of an iframe for users who are not logged in or haven&#8217;t authorised the application making the request. According to Facebook, this change is <a href="http://bugs.developers.facebook.com/show_bug.cgi?id=10509#c11" target="_blank">here to stay</a>.</p>
<p>Technically, popup blockers shouldn&#8217;t block popup windows that are opened intentionally by the user, for example by clicking on a link that says &quot;Publish this to your profile&quot;. Unfortunately however, Facebook have implemented their Stream Publish method in such a way that the relationship between the user action and the popup window being opened is not direct enough. The onus is on Facebook to fix this, but in the meantime, there is a workaround.</p>
<h3>The workaround</h3>
<p>While not documented by Facebook, it is very easy to construct a URL for the Stream Publish dialogue box. To publish the news feed story, the user simply has to click a link pointing to this URL. <a href="http://www.facebook.com/connect/uiserver.php?api_key=fda2d4e90d973af5ef44890448cb9cf8&#038;method=stream.publish&#038;channel=http%3A%2F%2Fwww.facebook.com%2Fxd_receiver_v0.4.php&#038;extern=1&#038;attachment=%7B%22name%22%3A%22I%5Cu2019m+reading+about+Facebook+development+on+These+Days+Labs%22%2C%22href%22%3A%22http%3A%5C%2F%5C%2Flabs.thesedays.com%5C%2F2010%5C%2F08%5C%2F11%5C%2Fpublishing-facebook-stories%5C%2F%22%2C%22caption%22%3A%22Recently+many+Facebook+developers+have+been+frustrated+by+popup+blockers+preventing+the+Stream+Publish+dialogue+box+from+being+displayed.+If+a+user+hasn%5Cu2019t+logged+in+and+authorised+the+application%2C+dialogue+boxes+are+shown+in+a+popup+window+instead+of+an+iframe.+That%5Cu2019s+fine+for+some+visitors%2C+but+for+those+who+have+a+popup+blocker+enabled%2C+it+means+that+they+won%5Cu2019t+see+the+dialogue+box+and+therefore+can%5Cu2019t+publish+a+post+into+the+stream.%22%2C%22media%22%3A%5B%7B%22type%22%3A%22image%22%2C%22src%22%3A%22http%3A%5C%2F%5C%2Flabs.thesedays.com%5C%2Fwp-content%5C%2Fthemes%5C%2Ftdlabs%5C%2Fimg%5C%2Fthese_days.gif%22%2C%22href%22%3A%22http%3A%5C%2F%5C%2Flabs.thesedays.com%5C%2F2010%5C%2F08%5C%2F11%5C%2Fpublishing-facebook-stories%5C%2F%22%7D%5D%7D&#038;action_links=%5B%5D&#038;display=popup&#038;next=http%3A%2F%2Flabs.thesedays.com" target="_blank">Here&#8217;s one I prepared earlier</a>. You can construct the URL with your programming language of choice, but I will demonstrate how it works with an ActionScript 3 example. (I have also provided a PHP example in the <a href="http://playground.thesedays.com/facebook-publish/source.zip">source download</a>).</p>
<p><b>1. Defining the post parameters</b></p>
<p>First we define the parameters for the post, such as the title, link, caption and <a href="http://developers.facebook.com/docs/guides/attachments" target="_blank">any media that we want to attach</a>. The attachment and action_links objects follow exactly the same structure as the JSON objects used by the streamPublish method in the<a href="http://developers.facebook.com/docs/reference/javascript/FB.ui" target="_blank"> JavaScript SDK</a> and the <a href="http://developers.facebook.com/docs/reference/rest/stream.publish" target="_blank">old REST API</a>.</p>
<pre class="brush: php">
// An event handler which publishes a Facebook story when a button is clicked
private function clickPost(event : MouseEvent) : void {
    // Define the stream story parameters
    var attachment:Object = {
        &#039;name&#039; : &quot;I&#039;ve just played golf with Lexus at St Andrews.&quot;,
        &#039;href&#039; : &#039;http://apps.facebook.com/myapp&#039;,
        &#039;caption&#039; : &quot;Win 2 x VIP tickets to the Open Golf Championships at St Andrews. Simply find the missing golf ball to win - it&#039;s quick and fun! Play now...&quot;,
        &#039;media&#039; : [ {&#039;type&#039; : &#039;image&#039;, &#039;src&#039; : &#039;http://www.myapp.com/assets/share_image.jpg&#039;, &#039;href&#039; : &#039;http://apps.facebook.com/myapp&#039;}]
    };
    var action_links:Object = [
        {&#039;text&#039; : &#039;Find the Golf Ball&#039;, &#039;href&#039; : &#039;http://apps.facebook.com/myapp&#039;}
    ];
    var publishURL:URLRequest = StreamPublish.publishStoryLink(&#039;YOUR_API_KEY&#039;, attachment, action_links, TopGoals.APP_TAB_URL);
    // Open the URL and Facebook&#039;s dialogue box will be displayed
    navigateToURL(publishURL, &quot;_blank&quot;);
}
</pre>
<p><b>2. Generating the URL</b></p>
<p>This static method takes the parameters we defined in the previous step and encodes them into a URL. It uses the JSON class from <a href="http://github.com/mikechambers/as3corelib" target="_blank">Mike Chambers&#8217; as3corelib project</a>.</p>
<pre class="brush: php">
package com.thesedays.facebook {
    import flash.net.URLRequest;
    import com.adobe.serialization.json.JSON;

    public class StreamPublish {
        
        /**
         * Generate a URL for displaying the Stream Publish dialogue.
         *
         * @param api_key The API key of your application - you must create an application to call this method.
         * @param attachment An object containing the post text, links, media, etc.
         * @param action_links An object containing actions links of text and hyperlinks.
         * @param next The URL to open after the user has published the post or cancelled it.
         * @param locale The locale code to display the Facebook interface with, for example en_US, fr_FR or nl_NL. It is generally best to leave this parameter as null because then Facebook will determine the language based on the user&#039;s browser and session.
         */
        public static function publishStoryLink(api_key:String, attachment:Object, action_links:Object, next:String, locale:String = null) : URLRequest {
            var url:String = &#039;http://www.facebook.com/connect/uiserver.php&#039; +
            (locale ? &#039;?locale=&#039; + locale + &#039;&amp;&#039; : &#039;?&#039;) +
            &#039;api_key=&#039; + api_key +
            &#039;&amp;method=stream.publish&#039; +
            &#039;&amp;channel=&#039; + escape(&#039;http://www.facebook.com/xd_receiver_v0.4.php&#039;) +
            &#039;&amp;extern=1&#039; +
            &#039;&amp;attachment=&#039; + escape(JSON.encode(attachment)) +
            &#039;&amp;action_links=&#039; + escape(JSON.encode(action_links)) +
            &#039;&amp;display=popup&#039; +
            &#039;&amp;next=&#039; + escape(next);
            return new URLRequest(url);
        }
    }
}
</pre>
<p><a href="http://playground.thesedays.com/facebook-publish/source.zip">Download the source from this example</a>.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://labs.thesedays.com/2010/08/11/publishing-facebook-stories/&amp;title=Publishing+Facebook+stories+on+browsers+with+popup+blockers" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://labs.thesedays.com/2010/08/11/publishing-facebook-stories/&amp;title=Publishing+Facebook+stories+on+browsers+with+popup+blockers" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://labs.thesedays.com/2010/08/11/publishing-facebook-stories/&amp;title=Publishing+Facebook+stories+on+browsers+with+popup+blockers" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://labs.thesedays.com/2010/08/11/publishing-facebook-stories/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://labs.thesedays.com/2010/08/11/publishing-facebook-stories/&amp;t=Publishing+Facebook+stories+on+browsers+with+popup+blockers" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Publishing+Facebook+stories+on+browsers+with+popup+blockers+-+http://bit.ly/aPR2rC+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://labs.thesedays.com/2010/08/11/publishing-facebook-stories/&amp;title=Publishing+Facebook+stories+on+browsers+with+popup+blockers&amp;summary=How%20to%20use%20Facebook%27s%20Stream.Publish%20method%20on%20browsers%20with%20popup%20blockers.%20See%20a%20demo.%0D%0AWhat%20is%20the%20problem%3F%0D%0ARecently%20many%20Facebook%20developers%20have%20been%20frustrated%20by%20popup%20blockers%20preventing%20the%20Stream%20Publish%20dialogue%20box%20from%20being%20displayed.%20If%20a%20user%20hasn%27t%20logged%20in%20and%20authorised%20the%20appl&amp;source=These Days Labs" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://labs.thesedays.com/2010/08/11/publishing-facebook-stories/&amp;t=Publishing+Facebook+stories+on+browsers+with+popup+blockers" rel="nofollow" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<img src="http://feeds.feedburner.com/~r/TheseDaysLabs/~4/1qwA9GqAzA8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://labs.thesedays.com/2010/08/11/publishing-facebook-stories/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://labs.thesedays.com/2010/08/11/publishing-facebook-stories/</feedburner:origLink></item>
		<item>
		<title>Why Umbraco suits us</title>
		<link>http://feedproxy.google.com/~r/TheseDaysLabs/~3/WTThD-62vjU/</link>
		<comments>http://labs.thesedays.com/2010/07/30/why-umbraco-suits-us/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 12:41:21 +0000</pubDate>
		<dc:creator>Lennart</dc:creator>
				<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://labs.thesedays.com/?p=773</guid>
		<description><![CDATA[
It has only been a couple of months since we first started using Umbraco, an open-source CMS built on top of the .NET platform, and a lot of my colleagues will agree when I say that we have grown extremely fond of it. Why, you ask? Well, let me explain a few things.
Finding the right [...]]]></description>
			<content:encoded><![CDATA[
<p>It has only been a couple of months since we first started using <a href="http://umbraco.org/" target="_blank">Umbraco</a>, an open-source CMS built on top of the .NET platform, and a lot of my colleagues will agree when I say that we have grown extremely fond of it. Why, you ask? Well, let me explain a few things.</p>
<p><strong>Finding the right CMS is a challenge</strong></p>
<p>Finding a CMS that suits your needs – not to mention fully embracing one – is not an easy task. It is hard to get your hands on a descent comparison and research is very time consuming as you really need to get your hands dirty. If you are somewhat wary and cautious about using a CMS, you are right, it is to be <strong>a tool that assists you</strong> in creating and maintaining websites, and it should never dictate the way you handle things as you probably already have a methodology or framework in place. And that is exactly what we have found in Umbraco: a reliable, user-friendly and extensible platform which drastically reduces development time and really fits into our projects.</p>
<p><strong>Umbraco is easy, extensible and reduces development time</strong></p>
<p>After completing several projects with Umbraco, we are very pleased with the results and would like to emphasize the following:</p>
<ul>
<li>Umbraco is <strong>easy to learn</strong>. Within days you are able to grasp its concept and developers <em>will</em> be writing custom XSLT for dynamic content such as a news pages, FAQ’s, ..</li>
<li>As Umbraco is based on ASP.NET, most developers will be <strong>very familiar</strong> with the environment and configuration settings which eases development and deployment</li>
<li>Umbraco has an <strong>active community</strong>: <a href="http://our.umbraco.org/" target="_blank">http://our.umbraco.org/</a></li>
<li>A project can be implemented <strong>without writing a single line of .NET code</strong>. You may have to write some XSLT or install a package, but you will save a considerable amount of development time nonetheless</li>
<li>Umbraco is <strong>extensible in many ways</strong>, from writing custom XSLT and .NET user controls to installing packages and integrating its API or event-driven model.</li>
</ul>
<p>Most importantly, its extensibility allows us to choose which parts of an application we wish to implement using Umbraco while we are still able to implement the parts we don’t see fit in the exact same way we would implemented these in other situations.</p>
<p><strong>Completed projects</strong></p>
<p>Although we still have several projects in the pipeline, we would already like to share some of the projects that have been fully implemented using Umbraco:</p>
<ul>
<li>Ijsboerke &#8211; <a href="http://www.ijsboerke.be/" target="_blank">http://www.ijsboerke.be</a></li>
<li>Wunderman Belgium – <a href="http://www.wunderman.be/" target="_blank">http://www.wunderman.be</a></li>
<li>Mio – <a href="http://www.mio.be/" target="_blank">http://www.mio.be</a></li>
<li>VAD – <a href="http://www.qado.be/" target="_blank">http://www.qado.be</a></li>
</ul>
<p><strong>Plans for the future</strong></p>
<p>We plan to do much more with Umbraco, and the first thing we want to do now is tweak our development environment and make Umbraco integration even easier:</p>
<ul>
<li>Add an <strong>abstraction layer</strong> to our framework that will abstract the Umbraco API integration and provides a set of global helper classes for Umbraco</li>
<li>Create a <strong>template solution</strong> for Visual Studio that contains a pre-configured Umbraco install and includes our framework projects</li>
<li>Moving the template solution to <strong>Microsoft’s Web Platform Installer</strong>, allowing our developers to install the latest version of the template in no time. See also: <a rel="nofollow" href="http://bit.ly/aj2Uwm" target="_blank">http://bit.ly/aj2Uwm</a></li>
</ul>
<p>As you can see, many of us have become strong believers and if you are considering using Umbraco as your CMS or you are a strong believer yourself we are always glad to hear from you.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://labs.thesedays.com/2010/07/30/why-umbraco-suits-us/&amp;title=Why+Umbraco+suits+us" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://labs.thesedays.com/2010/07/30/why-umbraco-suits-us/&amp;title=Why+Umbraco+suits+us" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://labs.thesedays.com/2010/07/30/why-umbraco-suits-us/&amp;title=Why+Umbraco+suits+us" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://labs.thesedays.com/2010/07/30/why-umbraco-suits-us/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://labs.thesedays.com/2010/07/30/why-umbraco-suits-us/&amp;t=Why+Umbraco+suits+us" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Why+Umbraco+suits+us+-+http://bit.ly/9oRI0L+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://labs.thesedays.com/2010/07/30/why-umbraco-suits-us/&amp;title=Why+Umbraco+suits+us&amp;summary=It%20has%20only%20been%20a%20couple%20of%20months%20since%20we%20first%20started%20using%20Umbraco%2C%20an%20open-source%20CMS%20built%20on%20top%20of%20the%20.NET%20platform%2C%20and%20a%20lot%20of%20my%20colleagues%20will%20agree%20when%20I%20say%20that%20we%20have%20grown%20extremely%20fond%20of%20it.%20Why%2C%20you%20ask%3F%20Well%2C%20let%20me%20explain%20a%20few%20things.%0D%0A%0D%0AFinding%20the%20right%20CMS%20is%20a%20cha&amp;source=These Days Labs" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://labs.thesedays.com/2010/07/30/why-umbraco-suits-us/&amp;t=Why+Umbraco+suits+us" rel="nofollow" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<img src="http://feeds.feedburner.com/~r/TheseDaysLabs/~4/WTThD-62vjU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://labs.thesedays.com/2010/07/30/why-umbraco-suits-us/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://labs.thesedays.com/2010/07/30/why-umbraco-suits-us/</feedburner:origLink></item>
		<item>
		<title>An easy way to detect mobile devices</title>
		<link>http://feedproxy.google.com/~r/TheseDaysLabs/~3/HcnuEOfDy5E/</link>
		<comments>http://labs.thesedays.com/2010/07/29/an-easy-way-to-detect-mobile-devices/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 12:41:06 +0000</pubDate>
		<dc:creator>Keegan Street</dc:creator>
				<category><![CDATA[Mobile development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[detection]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[Windows Mobile]]></category>
		<category><![CDATA[WURFL]]></category>

		<guid isPermaLink="false">http://labs.thesedays.com/?p=748</guid>
		<description><![CDATA[
So you want to deploy a mobile version of your website? You’ve thought about what your target users would do with a mobile version, written your content, created your design and developed your Flash or HTML, CSS and Javascript (if you haven&#8217;t done that yet, read this post instead). Now for the task that can [...]]]></description>
			<content:encoded><![CDATA[
<p>So you want to deploy a mobile version of your website? You’ve thought about what your target users would do with a mobile version, written your content, created your design and developed your Flash or HTML, CSS and Javascript (if you haven&#8217;t done that yet, <a href="http://labs.thesedays.com/2010/07/16/10-tips-for-designing-mobile-websites/" target="_blank">read this post instead</a>). Now for the task that can seem most daunting to new mobile web developers — detecting devices and serving the correct version of your site. How do you ensure that users with mobile phones will see the mobile version and vice versa?</p>
<p>The answer: <a href="http://wurfl.sourceforge.net/" target="_blank">WURFL</a>. The Wireless Universal Resource File (WURFL) is an open source project which collects information about all of the different mobile devices in use. It is constantly being updated, so as long as you keep your WURFL definitions up-to-date you don’t have to worry about your detection scripts not recognising new devices. By querying a WURFL database with your visitor&#8217;s User Agent string, you can not only determine whether the device they are using is a mobile device, but whether it has a touch screen, can make phone calls, is a tablet (iPad) and <a href="http://wurfl.sourceforge.net/help_doc.php#product_info" target="_blank">more</a>.</p>
<p>It is reasonably straightforward to <a href="http://www.tera-wurfl.com/wiki/index.php/Installation" target="_blank">install a Tera-WURFL service</a> on your PHP enabled web server. If download speed is critical for your website, it would be best to install Tera-WURFL on the same web server. But if  you would prefer to avoid the installation process, feel free to use our quick and easy <a href="http://wurfl.thesedays.com/" target="_blank">These Days implementation of Tera-WURFL</a>.</p>
<p>It can be as simple as this:</p>
<p><code>&lt;?php<br/>require_once ('<a href="http://wurfl.thesedays.com/example/example.zip">TeraWurflRemoteClient.php</a>');<br />
	$wurflObj = new TeraWurflRemoteClient( <br />
	&nbsp;&nbsp;&nbsp;&nbsp;'http://wurfl.thesedays.com/webservice.php' );<br />
	$wurflObj-&gt;getCapabilitiesFromAgent(null, array('product_info'));<br />
	if ($wurflObj-&gt;getDeviceCapability(&quot;is_wireless_device&quot;)) {<br />
	&nbsp;&nbsp;&nbsp;&nbsp;// Show mobile website<br />
	} else {<br />
	&nbsp;&nbsp;&nbsp;&nbsp;// Show normal website<br />
	}<br/>?&gt;</code>
</p>
<p><b>Don&#8217;t forget</b> to give your users a way of overriding automatic device detection. Even WURFL can get it wrong sometimes, and anyway some users prefer to view full sites on their mobile phones. The user is king!</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://labs.thesedays.com/2010/07/29/an-easy-way-to-detect-mobile-devices/&amp;title=An+easy+way+to+detect+mobile+devices" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://labs.thesedays.com/2010/07/29/an-easy-way-to-detect-mobile-devices/&amp;title=An+easy+way+to+detect+mobile+devices" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://labs.thesedays.com/2010/07/29/an-easy-way-to-detect-mobile-devices/&amp;title=An+easy+way+to+detect+mobile+devices" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://labs.thesedays.com/2010/07/29/an-easy-way-to-detect-mobile-devices/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://labs.thesedays.com/2010/07/29/an-easy-way-to-detect-mobile-devices/&amp;t=An+easy+way+to+detect+mobile+devices" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=An+easy+way+to+detect+mobile+devices+-+http://bit.ly/diuXcv+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://labs.thesedays.com/2010/07/29/an-easy-way-to-detect-mobile-devices/&amp;title=An+easy+way+to+detect+mobile+devices&amp;summary=So%20you%20want%20to%20deploy%20a%20mobile%20version%20of%20your%20website%3F%20You%E2%80%99ve%20thought%20about%20what%20your%20target%20users%20would%20do%20with%20a%20mobile%20version%2C%20written%20your%20content%2C%20created%20your%20design%20and%20developed%20your%20Flash%20or%20HTML%2C%20CSS%20and%20Javascript%20%28if%20you%20haven%27t%20done%20that%20yet%2C%20read%20this%20post%20instead%29.%20Now%20for%20the%20tas&amp;source=These Days Labs" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://labs.thesedays.com/2010/07/29/an-easy-way-to-detect-mobile-devices/&amp;t=An+easy+way+to+detect+mobile+devices" rel="nofollow" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<img src="http://feeds.feedburner.com/~r/TheseDaysLabs/~4/HcnuEOfDy5E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://labs.thesedays.com/2010/07/29/an-easy-way-to-detect-mobile-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://labs.thesedays.com/2010/07/29/an-easy-way-to-detect-mobile-devices/</feedburner:origLink></item>
		<item>
		<title>Close Call</title>
		<link>http://feedproxy.google.com/~r/TheseDaysLabs/~3/jIvB9D6ewuo/</link>
		<comments>http://labs.thesedays.com/2010/07/27/close-call/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 12:24:48 +0000</pubDate>
		<dc:creator>Antony Wellens</dc:creator>
				<category><![CDATA[Storage]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[business continuity]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[netapp]]></category>
		<category><![CDATA[redundancy]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://labs.thesedays.com/?p=732</guid>
		<description><![CDATA[
Time for a change. No developers slang or pics of mobile phones, it’s time to take a look behind the scenes at the systems which make These Days people able to work and do their stuff.
At These Days, it’s pretty simple. I’ve installed a NetApp SAN (FAS 2050c) about 2 years ago. It’s a clustered [...]]]></description>
			<content:encoded><![CDATA[
<p>Time for a change. No developers slang or pics of mobile phones, it’s time to take a look behind the scenes at the systems which make These Days people able to work and do their stuff.</p>
<p>At These Days, it’s pretty simple. I’ve installed a <a href="http://www.netapp.com" target="_blank">NetApp</a> SAN (FAS 2050c) about 2 years ago. It’s a clustered box which contains all fileserver data (the normal network drives which almost every digital company has and where employees save all their documents and work-related files) and it also contains all data from our <a href="http://www.vmware.com" target="_blank">VMware</a> virtual infrastructure environment. The latest is a 25-30 virtual server clustered farm, These Days is <strong>completely virtualized and thus heavily dependent on the NetApp SAN/Virtual Infrastructure</strong>.</p>
<p>So basically, if the NetApp box goes down, we’re in big trouble. No fileserver nor access to servers anymore (development, finance, planning, …) and 80 people who are unable to work. You don’t even want to know how much that would cost for an office. Imagine 80 people completely unable to work! Time is money right?</p>
<p>But the NetApp SAN doesn’t go down. It’s made and designed for that. You boot it up once and you never turn it off or reboot it. It doesn’t require patches or updates. OK, you’ve got the occasional firmware updates but they can be done online with a 40sec Disk I/O interrupt. So yeah, that’s not bad. It’s even clustered, 2 controllers in an <a href="http://en.wikipedia.org/wiki/High-availability_cluster" target="_blank">active/active mode</a>, so <em>IF</em> something went wrong and one of the controllers died, the other one would take over and keep everything running.</p>
<p>It’s a box which <strong><em>stays</em> online, 24&#215;7</strong>.</p>
<p>Unless&#8230; you get a <strong>power outage</strong> like we did last week. It happened between 4-5 AM. The UPS (emergency battery power) kicked in and gave me 40 minutes to restore power or shut everything down. But I didn’t wake up from those text alert messages at 5AM! So UPS time went down while I was sleeping and dreaming of <span style="text-decoration: line-through;">hot chicks</span> ICT Business Continuity. Eventually the whole server room was without power and everything went down.</p>
<p>When I woke up, I saw the text messages and said (more like screamed) something along the lines of “EEK!” and “F*CK”. Phone calls from the early birds in the office were already coming in saying there was no power and after the fastest bike ride ever to the office, I booted up everything and got the whole thing up and running again in 15mins.</p>
<p>Now the cool thing about this experience kicks in. The same day, in the afternoon, I noticed something was wrong with one of the NetApp controllers. LEDs weren’t on/flashing, no network activity, nothing, completely nothing. I checked the box and noticed a<strong> failover</strong> happened and one controller was handling all traffic and took over all tasks from the other controller.</p>
<p>I was shocked and happy at the same time. Shocked as in: <strong>one of the controllers didn’t boot</strong> up and happy as in: cool, we’ve been running on one controller for a whole day and no one noticed a thing! All iSCSI and CIFS connections stayed up with no problems.<br />
After some testing, I declared the faulty controller dead and called support to bring me a new one. It probably died from a voltage spike when restoring power.</p>
<p>The next day, I received a brand <strong>new controller</strong> and replaced the dead one. Another cool thing about NetApp controllers: all OS and config data is stored on the compact flash. So placing the flash card from the old controller in the new one restores all configs on the new controller. The only thing that needs to be done manually is reassign the disks to the new system ID, which takes about… 3 seconds.</p>
<p>The point of this post is to show how important it is to have <strong>redundancy</strong> on your business critical systems. What if our NetApp box wasn’t clustered? These Days would have been down for an entire day and lost large amounts of money, it’s the nightmare of every IT Manager. Sometimes we need to invest in these complex solutions to guarantee business continuity and in a situation like this, it pays off. Big time.</p>
<p><strong>ROI on the NetApp</strong>? Ha, yeah, we reached it and even went completely over it <img src='http://labs.thesedays.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://labs.thesedays.com/2010/07/27/close-call/&amp;title=Close+Call" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://labs.thesedays.com/2010/07/27/close-call/&amp;title=Close+Call" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://labs.thesedays.com/2010/07/27/close-call/&amp;title=Close+Call" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://labs.thesedays.com/2010/07/27/close-call/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://labs.thesedays.com/2010/07/27/close-call/&amp;t=Close+Call" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Close+Call+-+http://bit.ly/a7fwln+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://labs.thesedays.com/2010/07/27/close-call/&amp;title=Close+Call&amp;summary=Time%20for%20a%20change.%20No%20developers%20slang%20or%20pics%20of%20mobile%20phones%2C%20it%E2%80%99s%20time%20to%20take%20a%20look%20behind%20the%20scenes%20at%20the%20systems%20which%20make%20These%20Days%20people%20able%20to%20work%20and%20do%20their%20stuff.%0D%0A%0D%0AAt%20These%20Days%2C%20it%E2%80%99s%20pretty%20simple.%20I%E2%80%99ve%20installed%20a%20NetApp%20SAN%20%28FAS%202050c%29%20about%202%20years%20ago.%20It%E2%80%99s%20a%20clu&amp;source=These Days Labs" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://labs.thesedays.com/2010/07/27/close-call/&amp;t=Close+Call" rel="nofollow" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<img src="http://feeds.feedburner.com/~r/TheseDaysLabs/~4/jIvB9D6ewuo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://labs.thesedays.com/2010/07/27/close-call/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://labs.thesedays.com/2010/07/27/close-call/</feedburner:origLink></item>
		<item>
		<title>10 tips for designing mobile websites</title>
		<link>http://feedproxy.google.com/~r/TheseDaysLabs/~3/xBABNGGWaQE/</link>
		<comments>http://labs.thesedays.com/2010/07/16/10-tips-for-designing-mobile-websites/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 11:47:32 +0000</pubDate>
		<dc:creator>Keegan Street</dc:creator>
				<category><![CDATA[Mobile development]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://labs.thesedays.com/?p=697</guid>
		<description><![CDATA[
10 tips for web designers in 2010 &#8211; the year of the mobile.
1. Design with a fluid layout, min-width: 320px
There are two factors that make this a necessity. First, mobile device screens are so small that you really need to utilise all of the available space. Second, there are a lot of different screen resolutions out there. The only [...]]]></description>
			<content:encoded><![CDATA[
<p><strong>10 tips for web designers in 2010 &#8211; the year of the mobile.</strong></p>
<h2>1. Design with a fluid layout, min-width: 320px</h2>
<p>There are two factors that make this a necessity. First, mobile device screens are so small that you really need to utilise all of the available space. Second, there are a lot of different screen resolutions out there. The only way to utilise all of the space available on different sized screens is with a fluid layout.</p>
<p>I have found websites with a minimum width of 320px will look good on most high-end mobile devices like the iPhone, Android and Nokia N97. Here are the screen resolutions of some of the most popular devices:</p>
<table class="gray">
<tbody>
<tr>
<th style="width:120px;">Device</th>
<th>Screen res (height x width)</th>
</tr>
<tr>
<td>iPhone</td>
<td>320 x 480</td>
</tr>
<tr>
<td>iPhone 4</td>
<td>320 x 480 (scaled by a factor of 2)</td>
</tr>
<tr>
<td>Nokia N97</td>
<td>360 x 640</td>
</tr>
<tr>
<td>HTC Legend</td>
<td>320 x 480</td>
</tr>
<tr>
<td>LG eXpo</td>
<td>480 x 800</td>
</tr>
</tbody>
</table>
<p><br/></p>
<p>Technically, the retina display on the iPhone 4 has a screen resolution of 640 x 960 pixels but don&#8217;t worry, if you optimise your site for 320 x 480, the iPhone 4 will scale it up by a factor of two so it fits the whole screen. You will need to insert higher resolution images &#8211; but more on that in the next section!</p>
<h2>2. Include high res images for the iPhone 4 retina display</h2>
<p>The iPhone 4 display has four times the number of pixels as that of the original iPhone. To prevent mobile sites from looking tiny, it magnifies them by 200%. That works great on text and vector images like SVG. But its not so hot on bitmap images (or even the HTML5 canvas  so it would seem). To avoid pixelation, you need to insert alternative high resolution images for the iPhone 4.</p>
<p style="font-weight: bold;">Designers should create their Photoshop documents with a width of 640 pixels. Developers should export the images at full res for iPhone 4 and 50% res for everything else.</p>
<p>Here&#8217;s how to use a CSS media query to insert a high resolution image for iPhone 4:</p>
<p><code>.myImage {<br />
&nbsp;&nbsp;&nbsp;&nbsp;height: 40px;<br />
&nbsp;&nbsp;&nbsp;&nbsp;width: 100px;<br />
&nbsp;&nbsp;&nbsp;&nbsp;-webkit-background-size: 100px 40px;<br />
&nbsp;&nbsp;&nbsp;&nbsp;background: url(&quot;images/myImage.jpg&quot;);<br />
}</p>
<p>@media screen and (-webkit-device-pixel-ratio: 2) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;.myImage {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;background: url(&quot;images/myImage@2x.jpg&quot;); <br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}</code></p>
<p>The first line that might jump out at you as being a little unusual is probably <code>-webkit-background-size: 100px 40px;</code>. The -webkit-background-size CSS property takes two parameters: width and height. The parameters can be <a href="https://developer.mozilla.org/en/css/-moz-background-size" target="_blank">lengths, percentages or &quot;auto&quot;, and can even be mixed</a>, i.e. <code>-webkit-background-size: 100% auto</code>. This tells the browser to stretch the background image to a specific size.</p>
<p>The second interesting part is the media query <code>@media screen and (-webkit-device-pixel-ratio: 2) {...}</code>. This means that any styles contained within the curly braces only apply if the device has a pixel ratio of 2 (<a href="http://blog.iwalt.com/2010/06/targeting-the-iphone-4-retina-display-with-css3-media-queries.html" target="_blank">two physical pixels per measurement pixel</a>). Inside the media query selector, we override the .myImage class, and replace the background image with  the high resolution image <code>myImage@2x.jpg</code>.</p>
<p>The left half of this screenshot shows the pixelation that occurs on iPhone 4, and the right half shows how it looks when we insert with a high resolution image:</p>
<p><img src="http://labs.thesedays.com/wp-content/uploads/2010/07/sideBySide.jpg" alt="The left half of this screenshot shows the pixelation that occurs on iPhone 4, and the right half shows how it looks when we insert with a high resolution image" title="The left half of this screenshot shows the pixelation that occurs on iPhone 4, and the right half shows how it looks when we insert with a high resolution image" width="628" height="272" class="alignnone size-full wp-image-718" /></p>
<h2>3. Turn off auto-scaling</h2>
<p>Mobile devices will assume your website is optimised for desktop computers unless you tell them otherwise. Add a viewport meta tag to the head section of your HTML to set the width of your website to match the width of the display, render with a zoom level of 100% and prevent the user from zooming in/out.</p>
<p><code>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no&quot; /&gt;</code></p>
<p>Mobile phones will also <a href="http://www.alistapart.com/articles/putyourcontentinmypocket/" target="_blank">adjust text size when the screen orientation changes</a> unless you include a special CSS parameter:</p>
<p><code>body {<br/>&nbsp;&nbsp;&nbsp;&nbsp;-webkit-text-size-adjust: none;<br/>}</code></p>
<h2>4. Make clickable elements big enough for a fingertip, ≈44px²</h2>
<p>Your mobile visitors don&#8217;t have the accuracy of a mouse &#8211; they are often using their fingertips on a touch screen. Don&#8217;t make them put their fingers through a pencil sharpener just to click your button! Apple has said that the <a href="http://stackoverflow.com/questions/1928991/minimum-sensible-button-size-on-iphone" target="_blank">average finger tap on an iPhone is 44px by 44px</a> (in your high res Photoshop doc that will be 88px by 88px), so aim to make clickable areas at least that size. This doesn&#8217;t mean you have to design gigantic looking buttons. Just add some padding to your small buttons to enlarge the clickable area.</p>
<h2>5. Don&#8217;t use hover states</h2>
<p>Today&#8217;s touch screens can&#8217;t detect when a finger is getting close to touching, so the concept of rollovers does not apply. On the iPhone your <code>:hover</code> style will actually display on click and then remain on screen even after the user takes their finger away, which can be really annoying. So the rule is &#8211; don&#8217;t use <code>:hover</code> in your CSS or <code>mouseover</code> in your JavaScript.</p>
<h2>6. Create icons for your site</h2>
<p>Hopefully users will really love your site and add it to their home screen for easy access. Don&#8217;t ruin the mood with an ugly default icon! Add these meta tags to the head section of your HTML to define icons.</p>
<p><code>&lt;!-- 57 x 57 Android and iPhone 3 icon --&gt;<br />
&lt;link rel=&quot;apple-touch-icon&quot; media=&quot;screen and (resolution: 163dpi)&quot; href=&quot;icon57x57.png&quot; /&gt;<br />
&lt;!-- 114 x 114 iPhone 4 icon --&gt;<br />
&lt;link rel=&quot;apple-touch-icon&quot; media=&quot;screen and (resolution: 326dpi)&quot; href=&quot;icon57.png&quot; /&gt;<br />
&lt;!-- 57 x 57 Nokia icon --&gt;<br />
&lt;link rel=&quot;shortcut icon&quot; href=&quot;icon57x57.png&quot; /&gt;<br />
</code></p>
<p>Note: The iPhone will automatically add rounded corners and a glossy effect to your icon. If you want to turn this off, change the <code>rel</code> attribute to <code>apple-touch-icon-precomposed</code>. Thanks to Jesse Dodds for discovering how to specify a <a href="http://notes.jessedodds.com/post/730336221" target="_blank">seperate high res icon for the iPhone 4 retina display</a>.</p>
<h2>7. Reduce load time by using CSS3 instead of images for gradients, rounded corners, shadows, etc.</h2>
<p>Depending on the devices you are targeting, CSS3 can be an excellent option for mobile design. With old school web design techniques, a button with a gradient and rounded corners might consist of 9 separate image slices, a bunch of nasty non-semantic markup and a hefty amount of CSS. With CSS3, you can create this:</p>
<p><img src="http://labs.thesedays.com/wp-content/uploads/2010/07/2010-07-15_1702.png" alt="CSS3 button" title="CSS3 button" width="209" height="81" class="alignnone size-full wp-image-716" /></p>
<p>With this:</p>
<p><code>.redButton {<br />
&nbsp;&nbsp;&nbsp;&nbsp;color: #B91440;<br />
&nbsp;&nbsp;&nbsp;&nbsp;font-size: 19px;<br />
&nbsp;&nbsp;&nbsp;&nbsp;line-height: 25px;<br />
&nbsp;&nbsp;&nbsp;&nbsp;padding: 10px 30px;<br />
&nbsp;&nbsp;&nbsp;&nbsp;border: 1px solid #FFFFFF;<br />
&nbsp;&nbsp;&nbsp;&nbsp;background: -webkit-gradient(linear, left top, left bottom, from(#F2F2F2), to(#FFFFFF));<br />
&nbsp;&nbsp;&nbsp;&nbsp;-webkit-box-shadow: 0 0 2px #E4E3E3;<br />
&nbsp;&nbsp;&nbsp;&nbsp;-webkit-border-radius: 5px;<br />
}</code></p>
<p><a href="http://www.css3.info/" target="_blank">Go here for everything you need to know about CSS3</a>.</p>
<p>But be careful! While the iPhone, Android and <a href="http://www.forum.nokia.com/info/sw.nokia.com/id/75994a4a-382b-4a60-aaf2-2446f9e8c4f3/Web_Design_Guidelines_for_the_Nokia_N900.html" target="_blank">Nokia</a> all have good CSS3 support, the <a href="Developing Web Applications for Internet Explorer Mobile 6 on Windows Mobile 6.5" target="_blank">Windows Mobile 6.5 browser</a> is built on a version of IE6 (sigh&#8230;). Define, define, define your target devices before you begin design and development.</p>
<h2>8. Use an HTML5 doctype</h2>
<p>Not all browsers implement HTML5 features, but they will still <a href="http://ejohn.org/blog/html5-doctype/" target="_blank">accept an HTML5 doctype</a>.</p>
<p><code>&lt;!DOCTYPE html&gt;</code></p>
<p>Using this doctype declaration will allow you to display HTML4 elements to all browsers, and then add in additional functionality for the browsers that support HTML5.</p>
<h2>9. Make your site operate offline</h2>
<p>Your visitors won&#8217;t always have a fast Internet connection. If you&#8217;re designing the type of site that will have return visitors, consider leveraging the client-side storage capabilities of HTML5. It can be as simple as <a href="http://diveintohtml5.org/offline.html" target="_blank">creating a cache manifest file</a> that tells the browser what files it needs to cache for offline access. A more advanced option is to <a href="http://developer.apple.com/safari/library/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/UsingtheJavascriptDatabase/UsingtheJavascriptDatabase.html#//apple_ref/doc/uid/TP40007256-CH3-SW1" target="_blank">create an SQLite database</a> on the client with JavaScript.</p>
<h2>10. Include an option for your mobile visitors to view the normal website</h2>
<p><a href="http://labs.thesedays.com/2010/07/29/an-easy-way-to-detect-mobile-devices/" target="_blank">Detection scripts</a> can get it wrong, or a user might simply prefer not to use the mobile optimised interface. So my final tip is, always offer users a way to switch back to &#8216;normal mode&#8217;.</p>
<p>So there&#8217;s a few mobile web tips I&#8217;ve picked up over the last few months. I&#8217;d love to hear yours too in the comments!</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://labs.thesedays.com/2010/07/16/10-tips-for-designing-mobile-websites/&amp;title=10+tips+for+designing+mobile+websites" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://labs.thesedays.com/2010/07/16/10-tips-for-designing-mobile-websites/&amp;title=10+tips+for+designing+mobile+websites" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://labs.thesedays.com/2010/07/16/10-tips-for-designing-mobile-websites/&amp;title=10+tips+for+designing+mobile+websites" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://labs.thesedays.com/2010/07/16/10-tips-for-designing-mobile-websites/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://labs.thesedays.com/2010/07/16/10-tips-for-designing-mobile-websites/&amp;t=10+tips+for+designing+mobile+websites" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=10+tips+for+designing+mobile+websites+-+http://bit.ly/9y1NQR+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://labs.thesedays.com/2010/07/16/10-tips-for-designing-mobile-websites/&amp;title=10+tips+for+designing+mobile+websites&amp;summary=10%20tips%20for%20web%20designers%20in%202010%20-%20the%20year%20of%20the%20mobile.%0D%0A%0D%0A1.%20Design%20with%20a%20fluid%20layout%2C%20min-width%3A%20320px%0D%0AThere%20are%20two%20factors%20that%20make%20this%20a%20necessity.%20First%2C%20mobile%20device%20screens%20are%20so%20small%20that%20you%20really%20need%20to%20utilise%20all%20of%20the%C2%A0available%C2%A0space.%20Second%2C%C2%A0there%20are%20a%20lot%20of%20differ&amp;source=These Days Labs" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://labs.thesedays.com/2010/07/16/10-tips-for-designing-mobile-websites/&amp;t=10+tips+for+designing+mobile+websites" rel="nofollow" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<img src="http://feeds.feedburner.com/~r/TheseDaysLabs/~4/xBABNGGWaQE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://labs.thesedays.com/2010/07/16/10-tips-for-designing-mobile-websites/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		<feedburner:origLink>http://labs.thesedays.com/2010/07/16/10-tips-for-designing-mobile-websites/</feedburner:origLink></item>
		<item>
		<title>Logging in – a barrier to application uptake?</title>
		<link>http://feedproxy.google.com/~r/TheseDaysLabs/~3/Iw6hWfamhGo/</link>
		<comments>http://labs.thesedays.com/2010/07/02/logging-in-a-barrier-to-application-uptake/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 08:41:07 +0000</pubDate>
		<dc:creator>Keegan Street</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[behaviour]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://labs.thesedays.com/?p=683</guid>
		<description><![CDATA[
An analysis of the Facebook &#8220;Request for Permission&#8221; dialogue as a barrier to application uptake.
I have always wondered how much of a barrier the &#8220;Request for Permission&#8221; dialogue presents to uptake of Facebook applications. So two months ago I set up a simple one-page app to gather some statistics about user behavior.
My sample group consisted [...]]]></description>
			<content:encoded><![CDATA[
<p><em>An analysis of the Facebook &#8220;Request for Permission&#8221; dialogue as a barrier to application uptake.</em></p>
<p>I have always wondered how much of a barrier the &#8220;Request for Permission&#8221; dialogue presents to uptake of Facebook applications. So two months ago I set up a simple one-page app to gather some statistics about user behavior.</p>
<p>My sample group consisted of 4000 unique visitors who spoke English, Dutch, Spanish or Portugese. Visitors came from 82 countries but the largest groups were from Portugal, Belgium, the Netherlands and Argentina.</p>
<p>The idea of the application was very simple. Users were asked to enter their birthday with one of two input methods, either (a) through a series of dropdown boxes or (b) with a button that gave the app access to the birthday on their Facebook profile. The app then calculated how many days, weeks and months the person had been alive for and allowed them to post the result to their Facebook profile.</p>
<p>This is what the input screen looked like:<br />
<a href="http://labs.thesedays.com/wp-content/uploads/2010/07/2010-07-02_0846.png"><img class="alignnone size-full wp-image-684" title="Your Age in Days input screen" src="http://labs.thesedays.com/wp-content/uploads/2010/07/2010-07-02_0846.png" alt="Your Age in Days input screen" width="518" height="257" /></a></p>
<p>And the resulting profile story:</p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/07/2010-07-02_08492.png"><img class="alignnone size-full wp-image-694" title="Your Age in Days result" src="http://labs.thesedays.com/wp-content/uploads/2010/07/2010-07-02_08492.png" alt="Your Age in Days result" width="549" height="159" /></a></p>
<p>So what were the results? For whatever reason, 96% of users chose method a &#8211; the dropdown boxes. That&#8217;s a pretty significant majority, but it doesn&#8217;t tell us why users chose this option. They probably had different reasons, but I think some would have been:</p>
<ul>
<li>&#8220;The dropdown boxes look quicker and/or easier&#8221;</li>
<li>&#8220;I don&#8217;t want to give this application access to my personal information&#8221;</li>
<li>&#8220;I don&#8217;t know what will happen if I click the Facebook button&#8221;</li>
</ul>
<p>Personally, I can understand people not wanting to grant the application permission to access their information. Even the lowest level of authorization gives an app access to the user&#8217;s name, profile picture, list of friends and other &#8220;public&#8221; parts of their profile.</p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/07/2010-07-02_0853.png"><img class="alignnone size-full wp-image-688" title="Facebook permissions dialogue" src="http://labs.thesedays.com/wp-content/uploads/2010/07/2010-07-02_0853.png" alt="Facebook permissions dialogue" width="439" height="232" /></a></p>
<p>Much of the time when we develop Facebook apps we can&#8217;t avoid asking users for authorization. But we need to be aware of the barrier this creates. We should delay the authorization request in our application flow until the point where we really need it. And hopefully by that time the user will be able to see the value of authorizing our app.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://labs.thesedays.com/2010/07/02/logging-in-a-barrier-to-application-uptake/&amp;title=Logging+in+-+a+barrier+to+application+uptake%3F" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://labs.thesedays.com/2010/07/02/logging-in-a-barrier-to-application-uptake/&amp;title=Logging+in+-+a+barrier+to+application+uptake%3F" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://labs.thesedays.com/2010/07/02/logging-in-a-barrier-to-application-uptake/&amp;title=Logging+in+-+a+barrier+to+application+uptake%3F" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://labs.thesedays.com/2010/07/02/logging-in-a-barrier-to-application-uptake/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://labs.thesedays.com/2010/07/02/logging-in-a-barrier-to-application-uptake/&amp;t=Logging+in+-+a+barrier+to+application+uptake%3F" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Logging+in+-+a+barrier+to+application+uptake%3F+-+http://bit.ly/cR4bjE+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://labs.thesedays.com/2010/07/02/logging-in-a-barrier-to-application-uptake/&amp;title=Logging+in+-+a+barrier+to+application+uptake%3F&amp;summary=An%20analysis%20of%20the%20Facebook%20%22Request%20for%20Permission%22%20dialogue%20as%20a%20barrier%20to%20application%20uptake.%0D%0A%0D%0AI%20have%20always%20wondered%20how%20much%20of%20a%20barrier%20the%20%22Request%20for%20Permission%22%20dialogue%20presents%20to%20uptake%20of%20Facebook%20applications.%20So%20two%20months%20ago%20I%20set%20up%20a%20simple%20one-page%20app%20to%20gather%20some%20statist&amp;source=These Days Labs" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://labs.thesedays.com/2010/07/02/logging-in-a-barrier-to-application-uptake/&amp;t=Logging+in+-+a+barrier+to+application+uptake%3F" rel="nofollow" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<img src="http://feeds.feedburner.com/~r/TheseDaysLabs/~4/Iw6hWfamhGo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://labs.thesedays.com/2010/07/02/logging-in-a-barrier-to-application-uptake/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://labs.thesedays.com/2010/07/02/logging-in-a-barrier-to-application-uptake/</feedburner:origLink></item>
		<item>
		<title>Dependency injection with Spring.NET</title>
		<link>http://feedproxy.google.com/~r/TheseDaysLabs/~3/EQZYix4X7Dk/</link>
		<comments>http://labs.thesedays.com/2010/05/05/dependency-injection-with-spring-net/#comments</comments>
		<pubDate>Wed, 05 May 2010 14:12:44 +0000</pubDate>
		<dc:creator>Lennart</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Patterns & Frameworks]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[dependency injection]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[inversion of control]]></category>
		<category><![CDATA[spring.net]]></category>

		<guid isPermaLink="false">http://labs.thesedays.com/?p=664</guid>
		<description><![CDATA[
Hands-on introduction on how to configure dependency injection using Spring.NET
In a previous post I’ve discussed a simple n-tier approach using a Facade and Dao pattern. The Facade provides a single access point for the business tier, and wraps a data access object that encapsulates the implementation of the persistence mechanism, separating the concerns.
I also mentioned [...]]]></description>
			<content:encoded><![CDATA[
<p>Hands-on introduction on how to configure dependency injection using Spring.NET</p>
<p>In a <a href="http://labs.thesedays.com/2010/03/15/basic-architecture-of-an-asp-net-silverlight-web-application/" target="_blank">previous post</a> I’ve discussed a simple n-tier approach using a Facade and Dao pattern. The Facade provides a single access point for the business tier, and wraps a data access object that encapsulates the implementation of the persistence mechanism, separating the concerns.</p>
<p>I also mentioned that these objects introduce a large <a href="http://en.wikipedia.org/wiki/Coupling_(computer_science)" target="_blank">dependency</a> (high coupling) as the Facade does not function without the Dao. I will now show you how this dependency can be overcome, by injecting the Dao into the Facade using the <a href="http://www.springframework.net" target="_blank">Spring.NET framework</a>.</p>
<p>In the following example we will create a simple web management tool for a Zoo (inspired by <a href="http://amazedsaint.blogspot.com/2009/11/mef-or-managed-extension-framework.html" target="_blank">amazedsaint</a>). The tool needs to list all animals and caretakers, and allow the manager to rename animals or to assign one or more caretakers to an animal.</p>
<p>We start out by creating the business entities:</p>
<pre class="brush: csharp">

public class Caretaker

{

public string Name { get; set; }

public int Age { get; set; }

}

public abstract class Animal

{

public string Name { get; set; }

public IList&lt;Caretaker&gt; Caretakers { get; set; }

}

public class Lion : Animal { }

public class Elephant : Animal { }
</pre>
<p>We will also create a Facade which allows consumers to have a good understanding of the class library without having to worry about the exact implementation. Therefore, a good practice is to set up an interface:</p>
<pre class="brush: csharp">

public interface IZooManagement

{

IList&lt;Animal&gt; GetAllAnimals();

IList&lt;Caretaker&gt; GetAllCaretakers();

void RenameAnimal(Animal a, string newName);

void AssignCaretaker(Animal a, Caretaker c);

}
</pre>
<p>This should cover all requirements. The animals and caretakers will be stored in some kind of data store, so we’ll create a data access object (Dao) that will handle this for us. We haven’t decided on which type of data store or which ORM to use, so for now, let’s not worry about its implementation and create the interface:</p>
<pre class="brush: csharp">

public interface IZooDao

{

IList&lt;Animal&gt; GetAllAnimals();

IList&lt;Caretaker&gt; GetAllCaretakers();

void UpdateAnimal(Animal a);

}
</pre>
<p>Ok, now let’s implement the Facade. For the sake of simplicity, I will leave out any validation or error handling. Eventually, the minimal implementation will look much like this:</p>
<pre class="brush: csharp">

public class ZooManagement : IZooManagement

{

private IZooDao dao;

public virtual IZooDao Dao

{

set { dao = value; }

}

public IList&lt;Caretaker&gt; GetAllCaretakers()

{

return dao.GetAllCaretakers();

}

public IList&lt;Animal&gt; GetAllAnimals()

{

return dao.GetAllAnimals();

}

public void RenameAnimal(Animal a, string newName)

{

a.Name = newName;

dao.UpdateAnimal(a);

}

public void AssignCaretaker(Animal a, Caretaker c)

{

a.Caretakers.Add(c);

dao.UpdateAnimal(a);

}

}
</pre>
<p>The persistence mechanism has now completely been abstracted from the Facade. Also notice that the Facade does not instantiate a Dao: the property allows us to “inject” the Dao implementation and completely remove the dependency (this can also be done using a constructor parameter).</p>
<p>We now need to find a good way to inject the Dao into the Facade, and this is where the Spring.NET framework provides additional support, as one of its many features allows you to set up <a href="http://en.wikipedia.org/wiki/Dependency_injection" target="_blank">dependency injection</a> through configuration.</p>
<p>Before we configure the dependency injection, let us create a “dummy” Dao, one that does not really access a data store, but holds a list of animals and caretakers internally:</p>
<pre class="brush: csharp">

public class DummyDao : IZooDao

{

private IList&lt;Animal&gt; animals;

private IList&lt;Caretaker&gt; caretakers;

public DummyDao()

{

animals = new List&lt;Animal&gt;();

animals.Add(new Lion() { Name = &quot;Simba&quot; });

caretakers = new List&lt;Caretaker&gt;();

caretakers.Add(new Caretaker() { Name = &quot;Leo&quot;, Age = 25 });

}

public IList&lt;Animal&gt; GetAllAnimals()

{

return animals;

}

public IList&lt;Caretaker&gt; GetAllCaretakers()

{

return caretakers;

}

public void UpdateAnimal(Animal a)

{

throw new NotImplementedException();

}

}
</pre>
<p>If you want to use the Spring.NET framework, you will first need to add a reference to your web project. The latest version can be downloaded <a href="http://www.springframework.net/" target="_blank">here</a>. Next, you’ll need to configure Spring.NET in the Web.config:</p>
<pre class="brush: xml">

&lt;sectionGroup name=&quot;spring&quot;&gt;

&lt;section name=&quot;context&quot; type=&quot;Spring.Context.Support.ContextHandler, Spring.Core&quot;/&gt;

&lt;section name=&quot;objects&quot; type=&quot;Spring.Context.Support.DefaultSectionHandler, Spring.Core&quot;/&gt;

&lt;sectionGroup name=&quot;child&quot;&gt;

&lt;section name=&quot;objects&quot; type=&quot;Spring.Context.Support.DefaultSectionHandler, Spring.Core&quot;/&gt;

&lt;/sectionGroup&gt;

&lt;/sectionGroup&gt;

&lt;spring&gt;

&lt;context name=&quot;ParentContext&quot;&gt;

&lt;resource uri=&quot;config://spring/objects&quot;/&gt;

&lt;/context&gt;

&lt;objects xmlns=&quot;http://www.springframework.net&quot;&gt;

&lt;object id=&quot;ZooDao&quot; name=&quot;ZooDao&quot; type=&quot;TheseDays.Business.DAL.DummyDao, TheseDays.Business&quot;&gt;

&lt;/object&gt;

&lt;object id=&quot;ZooManagement&quot; name=&quot;ZooManagement&quot; type=&quot;TheseDays.Business.ZooManagement, TheseDays.Business&quot;&gt;

&lt;property name=&quot;Dao&quot;&gt;

&lt;ref local=&quot;ZooDao&quot;/&gt;

&lt;/property&gt;

&lt;/object&gt;

&lt;/objects&gt;

&lt;/spring&gt;
</pre>
<p>The first part is standard and announces the Spring.NET configuration. The second part is where the magic happens: the spring/context section is necessary for Spring to create its application context, and the spring/objects section allows you to configure the resources.</p>
<p>The object configuration is pretty straightforward: we tell Spring.NET we want to create an object of type ZooManagement (our Facade) and to set its property with an object we also configured, an object of type DummyDao.</p>
<p>Once we have implemented an actual Dao (rather than a dummy one), in order to start using it all we need to do is reconfigure its type. For example, if we would create a RealDao that also implements the IZooDao interface, and we need to pass a connection string to the constructor, the configuration of the Dao would look like this:</p>
<pre class="brush: xml">

&lt;object id=&quot;Dao&quot; name=&quot;Dao&quot; type=&quot;TheseDays.Business.DAL.RealDao, TheseDays.Business&quot;&gt;

&lt;constructor-arg name=&quot;connectionString&quot;&gt;

&lt;value&gt;Server=.;Initial Catalog=Zoo;User=ZooUsr;Password=ZooPwd;Application&lt;/value&gt;

&lt;/constructor-arg&gt;

&lt;/object&gt;
</pre>
<p>In the web application we can then access the ZooManagement Facade through the Spring’s application context. Here’s a demonstration of a small helper class I often use:</p>
<pre class="brush: csharp">

public class ApplicationContextHolder

{

private static ApplicationContextHolder instance = new ApplicationContextHolder();

public static ApplicationContextHolder Instance

{

get { return instance; }

}

private IApplicationContext applicationContext;

private IZooManagement zoo;

private ApplicationContextHolder()

{

applicationContext = ConfigurationManager.GetSection(&quot;spring/context&quot;) as IApplicationContext;

zoo = applicationContext.GetObject(&quot;ZooManagement&quot;, typeof(ZooManagement)) as IZooManagement;

}

public IApplicationContext ApplicationContext

{

get { return applicationContext; }

}

public IZooManagement Zoo

{

get { return zoo; }

}

}
</pre>
<p>Now you can access the ZooManagement in the web pages with a single line of code:</p>
<pre class="brush: csharp">

IZooManagement zoo = (ZooManagement)ApplicationContextHolder.Instance.Zoo;
</pre>
<p>Surely a nice feature when you&#8217;re building your own framework!</p>
<p>You can download the full source code of the example <a href="http://labs.thesedays.com/wp-content/uploads/2010/05/ZooExample.zip" target="_self">here</a>.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://labs.thesedays.com/2010/05/05/dependency-injection-with-spring-net/&amp;title=Dependency+injection+with+Spring.NET" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://labs.thesedays.com/2010/05/05/dependency-injection-with-spring-net/&amp;title=Dependency+injection+with+Spring.NET" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://labs.thesedays.com/2010/05/05/dependency-injection-with-spring-net/&amp;title=Dependency+injection+with+Spring.NET" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://labs.thesedays.com/2010/05/05/dependency-injection-with-spring-net/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://labs.thesedays.com/2010/05/05/dependency-injection-with-spring-net/&amp;t=Dependency+injection+with+Spring.NET" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Dependency+injection+with+Spring.NET+-+http://bit.ly/amEy4T+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://labs.thesedays.com/2010/05/05/dependency-injection-with-spring-net/&amp;title=Dependency+injection+with+Spring.NET&amp;summary=Hands-on%20introduction%20on%20how%20to%20configure%20dependency%20injection%20using%20Spring.NET%0D%0A%0D%0AIn%20a%20previous%20post%20I%E2%80%99ve%20discussed%20a%20simple%20n-tier%20approach%20using%20a%20Facade%20and%20Dao%20pattern.%20The%20Facade%20provides%20a%20single%20access%20point%20for%20the%20business%20tier%2C%20and%20wraps%20a%20data%20access%20object%20that%20encapsulates%20the%20implem&amp;source=These Days Labs" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://labs.thesedays.com/2010/05/05/dependency-injection-with-spring-net/&amp;t=Dependency+injection+with+Spring.NET" rel="nofollow" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<img src="http://feeds.feedburner.com/~r/TheseDaysLabs/~4/EQZYix4X7Dk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://labs.thesedays.com/2010/05/05/dependency-injection-with-spring-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://labs.thesedays.com/2010/05/05/dependency-injection-with-spring-net/</feedburner:origLink></item>
		<item>
		<title>Concept blogpost: Future web browsing</title>
		<link>http://feedproxy.google.com/~r/TheseDaysLabs/~3/0CuKq5JrkJo/</link>
		<comments>http://labs.thesedays.com/2010/04/23/concept-blogpost-future-browsing/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 07:57:57 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[Innovation]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[concept]]></category>
		<category><![CDATA[experience]]></category>
		<category><![CDATA[explorer]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[friendly]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[thenextweb]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[windows7]]></category>

		<guid isPermaLink="false">http://labs.thesedays.com/?p=652</guid>
		<description><![CDATA[
Concept blog post about how browsing could be more user-friendly in the future.
After reading the &#8216;goodbye http&#8216; blog post on thenextweb.com I first thought that it was a crappy idea to change the way of browsing for users&#8230; but @donotfold managed to change my mind&#8230;
Let me quote one of his emails:
&#8220;Everything that is illogical or [...]]]></description>
			<content:encoded><![CDATA[
<p>Concept blog post about how browsing could be more user-friendly in the future.</p>
<p>After reading the &#8216;<a href="http://thenextweb.com/google/2010/04/18/google-chrome-goodbye-http/" target="_blank">goodbye http</a>&#8216; blog post on <a href="http://www.thenextweb.com" target="_blank">thenextweb.com</a> I first thought that it was a crappy idea to change the way of browsing for users&#8230; but <a href="http://twitter.com/donotfold/" target="_blank">@donotfold</a> managed to change my mind&#8230;</p>
<p>Let me quote one of his emails:</p>
<blockquote><p>&#8220;Everything that is illogical or irrelevant for the end-user should be popped out, it&#8217;s a logical next step in the evolution of the internet and web browsers.&#8221;</p></blockquote>
<p>And after reading that I couldn&#8217;t agree more. So we started thinking .. how far can we actually take this? For example; I&#8217;m a huge fan of the windows7 explorer. Can&#8217;t we port this technique to web browsing? There’s bound to be a point where, by over-simplifying things, you will eventually begin to make it more difficult for the end user &#8230; the ultimate goal would be to find that tipping point. So let&#8217;s try out some ideas, shall we? <img src='http://labs.thesedays.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Our starting point; A regular website made by John Doe with a .com url.</p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_current.gif"><img src="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_current_inline.gif" border="0" alt="" /></a></p>
<p>Let&#8217;s get rid of the http:// as suggested by google.</p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_nohttp.gif"><img src="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_nohttp.gif" border="0" alt="" /></a></p>
<p>And if we can delete the http:// part in URL&#8217;s, why not hide the extensions too? No one really cares about whether your site has been made in PHP or ASPX. And why not take this even further and add a breadcrumb system instead of the slashes, you&#8217;ll end up with something like this:</p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_breadcrumbs.gif"><img src="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_breadcrumbs.gif" border="0" alt="" /></a></p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_breadcrumbs_level.gif"><img src="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_breadcrumbs_level.gif" border="0" alt="" /></a></p>
<p>You often also have websites that are multilingual (especially in Belgium) so instead of using /nl/, /fr/, /en/ or ?lang=en we can display a flag icon of the current language.</p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_language.gif"><img src="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_language.gif" border="0" alt="" /></a></p>
<p>Here&#8217;s where the windows7 explorer principle will come in. If we click on the language flag, we can quickly switch between languages, and when we click on the arrow before Home you can select another item in that level from the dropdown.</p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_language_selection.gif"><img src="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_language_selection.gif" border="0" alt="" /></a></p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_item_selection.gif"><img src="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_item_selection.gif" border="0" alt="" /></a></p>
<p>And now if we take the idea really far &#8230; Let&#8217;s add the possibility to query your page. Give a selection to show the latest 10 items (where applicable) or show latest 20 items, you can add the possibility to sort those items .. I think you can go quite far with this <img src='http://labs.thesedays.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_show_latest.gif"><img src="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_show_latest.gif" border="0" alt="" /></a></p>
<p><a href="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_sortby.gif"><img src="http://labs.thesedays.com/wp-content/uploads/2010/04/fb_sortby.gif" border="0" alt="" /></a></p>
<h2>Control</h2>
<p>How would all of this be controlled? Should it be controlled? A possibility would be to use the sitemap.xml as a basis for the breadcrumb system. And then implement a second, language.xml file for the language dropdown. I, personally, would prefer to be in control instead of the browser generating it all for you.  That way, it&#8217;s still up to the webmasters if they want to use this function or not.</p>
<h2>Conclusion</h2>
<p>Would this be an improvement for me? No! For the common user? I believe so. But there&#8217;s a point where it will be to difficult, so how far can we really go? How will we handle id&#8217;s? Here too, we could choose to just handle this in the background, users don&#8217;t necessarily need to be faced with this. But then how do we allow users to share links? We could use a button and convert all links into short links&#8230; (http://goo.gl/123) &#8230; And I believe we should always have the possibility to switch back to the full path, like the Windows7 explorer does. Suffice it to say that there is a lot to think about and plenty of room for discussion.</p>
<p>Bear in mind that this is a concept &#8230; I don&#8217;t see any of these suggestions happening any time soon, especially not while browsers are at war with each other and standards aren&#8217;t yet where they need to be. Something huge like this should be a unified effort, not a nice-to-have feature in one browser trying to gain on the competitors. So google; nice job starting this! But invite your peers and explain to them the reasons why and the importance for the user.</p>
<h2>Join the discussion</h2>
<p>As for our little concept, &#8230; What do you think? Should everything stay as it is? Is there room for improvement? Let&#8217;s start the discussion here, who knows, maybe some good can come of it. <img src='http://labs.thesedays.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://labs.thesedays.com/2010/04/23/concept-blogpost-future-browsing/&amp;title=Concept+blogpost%3A+Future+web+browsing" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://labs.thesedays.com/2010/04/23/concept-blogpost-future-browsing/&amp;title=Concept+blogpost%3A+Future+web+browsing" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://labs.thesedays.com/2010/04/23/concept-blogpost-future-browsing/&amp;title=Concept+blogpost%3A+Future+web+browsing" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://labs.thesedays.com/2010/04/23/concept-blogpost-future-browsing/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://labs.thesedays.com/2010/04/23/concept-blogpost-future-browsing/&amp;t=Concept+blogpost%3A+Future+web+browsing" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Concept+blogpost%3A+Future+web+browsing+-+http://bit.ly/9HJxiO+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://labs.thesedays.com/2010/04/23/concept-blogpost-future-browsing/&amp;title=Concept+blogpost%3A+Future+web+browsing&amp;summary=Concept%20blog%20post%20about%20how%20browsing%20could%20be%20more%20user-friendly%20in%20the%20future.%0D%0A%0D%0AAfter%20reading%20the%20%27goodbye%20http%27%20blog%20post%20on%20thenextweb.com%20I%20first%20thought%20that%20it%20was%20a%20crappy%20idea%20to%20change%20the%20way%20of%20browsing%20for%20users...%20but%20%40donotfold%20managed%20to%20change%20my%20mind...%0D%0A%0D%0ALet%20me%20quote%20one%20of%20his%20&amp;source=These Days Labs" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://labs.thesedays.com/2010/04/23/concept-blogpost-future-browsing/&amp;t=Concept+blogpost%3A+Future+web+browsing" rel="nofollow" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<img src="http://feeds.feedburner.com/~r/TheseDaysLabs/~4/0CuKq5JrkJo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://labs.thesedays.com/2010/04/23/concept-blogpost-future-browsing/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://labs.thesedays.com/2010/04/23/concept-blogpost-future-browsing/</feedburner:origLink></item>
	</channel>
</rss>
