<?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/" version="2.0">

<channel>
	<title>Ronald Widha</title>
	
	<link>http://www.ronaldwidha.net</link>
	<description>podcast addict, believes in occam razor, software consultant</description>
	<lastBuildDate>Thu, 10 May 2012 18:26:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/RonaldWidha" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="ronaldwidha" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>How to debug WinJS and C# in the same solution</title>
		<link>http://www.ronaldwidha.net/2012/05/10/how-to-debug-winjs-and-c-in-the-same-solution/</link>
		<comments>http://www.ronaldwidha.net/2012/05/10/how-to-debug-winjs-and-c-in-the-same-solution/#comments</comments>
		<pubDate>Thu, 10 May 2012 18:26:01 +0000</pubDate>
		<dc:creator>Ronald Widha</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Windows 8 Consumer Preview]]></category>
		<category><![CDATA[WinJS]]></category>

		<guid isPermaLink="false">http://www.ronaldwidha.net/?p=955</guid>
		<description><![CDATA[looks like you can’t. Tested on Windows 8 Consumer Preview]]></description>
			<content:encoded><![CDATA[<p align="center"><a href="http://www.ronaldwidha.net/wp-content/uploads/2012/05/image3.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://www.ronaldwidha.net/wp-content/uploads/2012/05/image_thumb.png" width="490" height="428" /></a></p>
<p align="center">looks like you can’t.</p>
<p align="center">Tested on Windows 8 Consumer Preview</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronaldwidha.net/2012/05/10/how-to-debug-winjs-and-c-in-the-same-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WinRT Consumer Preview: Calling C# (CSharp) Async class libraries from Javascript WinJS.Promises using then() clause</title>
		<link>http://www.ronaldwidha.net/2012/05/10/winrt-consumer-preview-calling-c-csharp-async-class-libraries-from-javascript-winjs-promises-using-then-clause/</link>
		<comments>http://www.ronaldwidha.net/2012/05/10/winrt-consumer-preview-calling-c-csharp-async-class-libraries-from-javascript-winjs-promises-using-then-clause/#comments</comments>
		<pubDate>Thu, 10 May 2012 13:34:26 +0000</pubDate>
		<dc:creator>Ronald Widha</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Windows 8 Consumer Preview]]></category>
		<category><![CDATA[WinJS]]></category>
		<category><![CDATA[WinRT]]></category>

		<guid isPermaLink="false">http://www.ronaldwidha.net/?p=949</guid>
		<description><![CDATA[You probably already know that you can call C# Class Libraries from WinJS. Now that means I can define C# async methods and call it with WinJS.Promises right?? Think about it This Javascript means the same as the C# counter part. //C# var csharpclass = new ClassLibrary1.Class1(); await csharpclass.testAsync(); // do something So does it [...]]]></description>
			<content:encoded><![CDATA[<p>You probably already know that <a href="http://www.ronaldwidha.net/2012/05/10/winrt-calling-c-csharp-class-libraries-from-winjs-javascript/" target="_blank">you can call C# Class Libraries from WinJS</a>. Now that means I can define C# async methods and call it with WinJS.Promises right??</p>
<h2>Think about it</h2>
<p>This Javascript means the same as the C# counter part.</p>
<p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:c145f7d4-ef88-43ca-bc6b-ba40c05b9f1e" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">
<pre style=" width: 413px; height: 79px;background-color:White;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #008000;">//</span><span style="color: #008000;">C#</span><span style="color: #008000;">
</span><span style="color: #000000;">var csharpclass </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ClassLibrary1.Class1();
await csharpclass.testAsync();
</span><span style="color: #008000;">//</span><span style="color: #008000;"> do something</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
</p>
<p><div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:1518956a-dacf-4824-808e-9c934f33f485" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">
<pre style=" width: 408px; height: 110px;background-color:White;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #008000;">//</span><span style="color: #008000;">javascript</span><span style="color: #008000;">
</span><span style="color: #000000;">var csharpclass </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ClassLibrary1.Class1();
csharpclass.testAsync().then( function (e) {
    </span><span style="color: #008000;">//</span><span style="color: #008000;"> do something ...</span><span style="color: #008000;">
</span><span style="color: #000000;">});</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
</p>
<p>So does it mean I can avoid <a href="http://www.ronaldwidha.net/2012/05/08/making-a-promise-creating-your-own-then-clause-for-async-call-with-winjs-promise/" target="_blank">creating WinJS.Promises object for async method and use C# instead since it’s (let’s be honest)&#160; kinda confusing</a> and do this instead?</p>
<p>&#160;</p>
<p><div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:3948c664-03c5-47ab-bd04-1c005916b938" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">
<pre style=" width: 342px; height: 162px;background-color:White;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #008000;">//</span><span style="color: #008000;"> to avoid doubt: THIS DOES NOT WORK
</span><span style="color: #008000;">//</span><span style="color: #008000;"> only wishful thinking!</span><span style="color: #008000;">
</span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">sealed</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> Class1
{
    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> async </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> testAsync()
    {
        </span><span style="color: #008000;">//</span><span style="color: #008000;"> do this asynchronously ...</span><span style="color: #008000;">
</span><span style="color: #000000;">    }
}
</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
</p>
<p>wouldn’t that be cool???</p>
<p><strong>Unfortunately not.</strong></p>
<p>to declare an asynchronous method in C# and be able to call it as WinJS.Promises we can’t use the async C# keyword but instead use the IAsyncActionWithProgress interface instead. Here’s an example:</p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:78fbb139-4b73-419c-a1ec-e408ec23670b" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">
<pre style=" width: 554px; height: 350px;background-color:White;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #0000FF;">namespace</span><span style="color: #000000;"> ClassLibrary1
{
    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">sealed</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> Class1
    {
        </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> IAsyncActionWithProgress</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">Result</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> testAsync()
        {
            </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> AsyncInfo.Run</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">Result</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">((token, result) </span><span style="color: #000000;">=&gt;</span><span style="color: #000000;">
                Task.Run</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">Result</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">(()</span><span style="color: #000000;">=&gt;</span><span style="color: #000000;">
                    {
                        </span><span style="color: #008000;">//</span><span style="color: #008000;"> do this asynchronously ...</span><span style="color: #008000;">
</span><span style="color: #000000;">                        </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Result();
                    }

                ));
        }
    }

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">sealed</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> Result { ... }
}</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>Not as clean as one would hope, huh? Hopefully it’ll change in the next Windows 8 release and Microsoft will introduce support to async keyword for WinJS.Promises</p>
<p>Tested on Windows 8 Consumer Preview</p>
<p>Read more: <a href="http://msdn.microsoft.com/en-us/library/windows/apps/br230301(v=vs.110).aspx#AsyncOps" target="_blank">Creating Windows Runtime Components in C# and Visual Basic</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronaldwidha.net/2012/05/10/winrt-consumer-preview-calling-c-csharp-async-class-libraries-from-javascript-winjs-promises-using-then-clause/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WinRT: Calling C# (CSharp) class libraries from WinJS Javascript</title>
		<link>http://www.ronaldwidha.net/2012/05/10/winrt-calling-c-csharp-class-libraries-from-winjs-javascript/</link>
		<comments>http://www.ronaldwidha.net/2012/05/10/winrt-calling-c-csharp-class-libraries-from-winjs-javascript/#comments</comments>
		<pubDate>Thu, 10 May 2012 13:20:37 +0000</pubDate>
		<dc:creator>Ronald Widha</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.ronaldwidha.net/?p=947</guid>
		<description><![CDATA[I must say Microsoft is doing a great job with supporting polyglot programming. With .Net CLR support for numerous languages from C#, VB, F#, IronRuby, IronPython and all that &#8211; and now WinRT with C++, C# and JS. This post is going to quickly show how you could call a C# class from Javascript within [...]]]></description>
			<content:encoded><![CDATA[<p>I must say Microsoft is doing a great job with supporting polyglot programming. With .Net CLR support for numerous languages from C#, VB, F#, IronRuby, IronPython and all that &#8211; and now WinRT with C++, C# and JS. This post is going to quickly show how you could call a C# class from Javascript within WinRT.</p>
<h3></h3>
<h3>1. Add a class library</h3>
<p>I assume you have an existing Javascript Metro Application Project. So now what you have to do is just add a C# Metro Class Library. Add a class. Notice a few rules:</p>
<ol>
<li>Root namespace has to match assembly name</li>
<li>class has to be sealed</li>
<li>and <a href="http://msdn.microsoft.com/en-us/library/windows/apps/br230301(v=vs.110).aspx#DeclaringTypes" target="_blank">there’s a few more restriction</a></li>
</ol>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:7b604be5-9937-4277-91f8-572748c93d54" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">
<pre style=" width: 322px; height: 184px;background-color:White;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #0000FF;">namespace</span><span style="color: #000000;"> ClassLibrary1
{
    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">sealed</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> Class1
    {
        </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> test()
        {
            </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> String.Empty;
        }
    }
}</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<h3>2. Change type of the project to WinMD</h3>
<p>Right click solution, properties, under application tab, change output type to WinMD File.</p>
<p><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://www.ronaldwidha.net/wp-content/uploads/2012/05/image2.png" width="402" height="159" /></p>
<h3>3. Reference project from the JS Metro Application Project</h3>
<h3>4. Consume the class from JS</h3>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:37eee4ec-ba38-4ff0-998e-2734cf2e0922" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">
<pre style=" width: 438px; height: 48px;background-color:White;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #000000;">var csharpclass </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ClassLibrary1.Class1();
csharpclass.test();</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p><a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh779077(v=vs.110).aspx" target="_blank">Read more: Walthrough creating a simple component in C# and calling it from JavaScript</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronaldwidha.net/2012/05/10/winrt-calling-c-csharp-class-libraries-from-winjs-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quickstart with Hadoop &amp; Hadoop on Azure</title>
		<link>http://www.ronaldwidha.net/2012/05/10/quickstart-with-hadoop-hadoop-on-azure/</link>
		<comments>http://www.ronaldwidha.net/2012/05/10/quickstart-with-hadoop-hadoop-on-azure/#comments</comments>
		<pubDate>Thu, 10 May 2012 04:52:05 +0000</pubDate>
		<dc:creator>Ronald Widha</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CTP]]></category>
		<category><![CDATA[Hadoop]]></category>
		<category><![CDATA[Hadoop on Azure]]></category>
		<category><![CDATA[windows azure]]></category>

		<guid isPermaLink="false">http://www.ronaldwidha.net/?p=943</guid>
		<description><![CDATA[There was an awesome Hadoop session last night (sponsored by Microsoft) that explains the basic of Hadoop and then goes into Hadoop on Azure. If you are remotely interested in cloud, big data, or even Business Intelligence, it’s an interesting watch. Recording can be found here https://skydrive.live.com/redir.aspx?cid=9f92dce9238e14a8&#38;resid=9F92DCE9238E14A8!154&#38;parid=root Get it while it’s hot Some gems that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://skydrive.live.com/redir.aspx?cid=9f92dce9238e14a8&amp;resid=9F92DCE9238E14A8!154&amp;parid=root" target="_blank"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="image" src="http://www.ronaldwidha.net/wp-content/uploads/2012/05/image1.png" width="400" height="223" /></a></p>
<p>There was an awesome Hadoop session last night (sponsored by Microsoft) that explains the basic of Hadoop and then goes into Hadoop on Azure. If you are remotely interested in cloud, big data, or even Business Intelligence, it’s an interesting watch.</p>
<p>Recording can be found here <a href="https://skydrive.live.com/redir.aspx?cid=9f92dce9238e14a8&amp;resid=9F92DCE9238E14A8!154&amp;parid=root">https://skydrive.live.com/redir.aspx?cid=9f92dce9238e14a8&amp;resid=9F92DCE9238E14A8!154&amp;parid=root</a> Get it while it’s hot</p>
<p>Some gems that I note down from the session:</p>
<ul>
<li>RDBMS support giga to tera, Big Data <b>peta to exa</b> </li>
<li>Typical DBA:RDBMS ratio 1:40,      <br />DBA:Haddop ratio 1<b>:3,000</b> </li>
<li>BI pattern: extract, structure and store “important information”      <br />Big Data: “store it all”, maybe information becomes important “later”. Structure only on demand. </li>
<li>Common pattern: store all data in Hadoop. structure them on demand for serving more traditional BI tools </li>
<li>Hadoop on Azure is &quot;naturally&quot; integrated with Windows Azure Blob Storage but can be configured to use other storage providers like Amazon S3 (for migration) </li>
<li>With PowerPivot, one can easily pull in Hadoop/Hive map reduce result into Excel </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ronaldwidha.net/2012/05/10/quickstart-with-hadoop-hadoop-on-azure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making a Promise: creating your own then() clause for async call with WinJS.Promise</title>
		<link>http://www.ronaldwidha.net/2012/05/08/making-a-promise-creating-your-own-then-clause-for-async-call-with-winjs-promise/</link>
		<comments>http://www.ronaldwidha.net/2012/05/08/making-a-promise-creating-your-own-then-clause-for-async-call-with-winjs-promise/#comments</comments>
		<pubDate>Tue, 08 May 2012 03:45:42 +0000</pubDate>
		<dc:creator>Ronald Widha</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Metro]]></category>
		<category><![CDATA[Windows 8 Consumer Preview]]></category>
		<category><![CDATA[WinJS]]></category>
		<category><![CDATA[WinRT]]></category>

		<guid isPermaLink="false">http://www.ronaldwidha.net/?p=938</guid>
		<description><![CDATA[WinJS introduces many convenience functions (still trying to learn them) to enrich the language. Some of them you’d see straight away even when just starting a Metro HTML5/Javascript application for Windows 8 like WinJS.Namespace etc. There are reasons to why you would not want to use these convenient functions. The biggest one would be the [...]]]></description>
			<content:encoded><![CDATA[<p>WinJS introduces many convenience functions (still trying to learn them) to enrich the language. Some of them you’d see straight away even when just starting a Metro HTML5/Javascript application for Windows 8 like WinJS.Namespace etc. There are reasons to why you would not want to use these convenient functions. The biggest one would be the fact that WinJS is only available within the Windows 8 runtime. However putting that aside some of these functions are very valuable and easy to use. In this post I’m going to cover specifically on Promise.</p>
<h2>What is it</h2>
<p>WinJS.Promise is an implementation of <a href="http://wiki.commonjs.org/wiki/Promises/A" target="_blank">CommonJS’s Promise ecmascript spec proposal</a>. The spec suggest that we should be able to do the following:</p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:184adcae-f672-4228-85d2-826e558668c0" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">
<pre style=" width: 400px; height: 64px;background-color:White;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #000000;">asyncComputeTheAnswerToEverything().
    then(addTwo).
    then(printResult, onError);
</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>Promise allows you to structure asynchronous code as if it was serial by chaining methods together – a technique that I’m sure you’re familiar with by now through JQuery. To C# folks, this is the next best thing since we do not have async/await keyword for javascript.</p>
<h2>How to implement a Promise with WinJS</h2>
<p>In its simplest form here are the essential element to create a WinJS.Promise to be able to do the above:</p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:f4e593e8-7975-4a08-bde5-4462a4b566e5" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">
<pre style=" width: 506px; height: 458px;background-color:White;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #000000;">(</span><span style="color: #0000FF;">function</span><span style="color: #000000;"> () {
    </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">use strict</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">;

    </span><span style="color: #008000;">//</span><span style="color: #008000;"> ...</span><span style="color: #008000;">
</span><span style="color: #000000;">
    WinJS.Namespace.define(</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">someNameSpace</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">, {
        refreshAsync: </span><span style="color: #0000FF;">function</span><span style="color: #000000;"> () {
            </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> WinJS.Promise(
                </span><span style="color: #0000FF;">function</span><span style="color: #000000;"> (completed, error) {

                    </span><span style="color: #0000FF;">try</span><span style="color: #000000;"> {
                        </span><span style="color: #008000;">//</span><span style="color: #008000;">slightly long process</span><span style="color: #008000;">
</span><span style="color: #000000;">                        ...

                        </span><span style="color: #008000;">//</span><span style="color: #008000;"> you could pass the result to the </span><span style="color: #008000;">
</span><span style="color: #000000;">                        </span><span style="color: #008000;">//</span><span style="color: #008000;"> completed function as arguments</span><span style="color: #008000;">
</span><span style="color: #000000;">                        completed();
                    }
                    </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (e) {
                        error();
                    }
                });
        }
    });
})();</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>then I could consume the method by:</p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:26a9dff3-0f64-4514-8d2c-0c31f6a10f29" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">
<pre style=" width: 346px; height: 58px;background-color:White;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #000000;">someNameSpace.refreshAsync()
    .then(updateUI(), showUIError());</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<h2>Tested on</h2>
<p>Caveats, since all these things are still Beta, the above test “works on my machine” with:</p>
<p>Windows 8 Consumer Preview<br />
  <br />Visual Studio 2011 Ultimate Beta</p>
<h2>Read more</h2>
<p>constructing WinJS.Promise <a href="http://msdn.microsoft.com/en-us/library/windows/apps/br211866.aspx">http://msdn.microsoft.com/en-us/library/windows/apps/br211866.aspx</a></p>
<p>constructing Done clause <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh701079.aspx">http://msdn.microsoft.com/en-us/library/windows/apps/hh701079.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronaldwidha.net/2012/05/08/making-a-promise-creating-your-own-then-clause-for-async-call-with-winjs-promise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cannot find my Windows 8 Metro app in WACK (Windows App Cert Kit)</title>
		<link>http://www.ronaldwidha.net/2012/05/05/cannot-find-my-windows-8-metro-app-in-wack-windows-app-cert-kit/</link>
		<comments>http://www.ronaldwidha.net/2012/05/05/cannot-find-my-windows-8-metro-app-in-wack-windows-app-cert-kit/#comments</comments>
		<pubDate>Sat, 05 May 2012 04:16:23 +0000</pubDate>
		<dc:creator>Ronald Widha</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Metro]]></category>
		<category><![CDATA[WACK]]></category>
		<category><![CDATA[windows 8]]></category>
		<category><![CDATA[WinRT]]></category>

		<guid isPermaLink="false">http://www.ronaldwidha.net/?p=934</guid>
		<description><![CDATA[So you are building a Windows 8 Metro app, wanting to make sure that it passes the Windows Store test and decided to run the Windows App Certification Kit early. You open up WACK from the Windows 8 Consumer Preview Start Menu and cannot find your app listed on the kit. What’s going on? It [...]]]></description>
			<content:encoded><![CDATA[<p><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; border-left: 0px; display: block; padding-right: 0px; margin-right: auto" border="0" alt="image" src="http://www.ronaldwidha.net/wp-content/uploads/2012/05/image.png" width="400" height="280" /></p>
<p>So you are building a Windows 8 Metro app, wanting to make sure that it passes the Windows Store test and decided to run the Windows App Certification Kit early. You open up WACK from the Windows 8 Consumer Preview Start Menu and cannot find your app listed on the kit. What’s going on?</p>
<p>It seems like Windows App Certification Kit is still buggy in the Windows 8 Consumer Preview. It failed my app for one reason (It cant be my fault, can it?). But most importantly it seems if there are any application with a blank <em>InstallLocation</em> then it will stop going through the application list. <a href="http://social.msdn.microsoft.com/Forums/en-US/toolsforwinapps/thread/fa7a1add-3eff-4914-b222-073c4b8b4221" target="_blank">Here’s how to fix it</a>:</p>
<ol>
<li>Open a powershell window</li>
<li>Do a “Get-AppxPackage &gt; out.txt”</li>
<li>Open out.txt and look at InstallLocation field <strong>of all the apps installed (IMPORTANT!!)</strong></li>
<li>For the apps whose InstallLocation is blank, do a “Remove-AppxPackage &lt;packageFullName&gt;”</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.ronaldwidha.net/2012/05/05/cannot-find-my-windows-8-metro-app-in-wack-windows-app-cert-kit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SkyDrive, Live Mesh, Live Devices (Dropbox and Google Drive)</title>
		<link>http://www.ronaldwidha.net/2012/04/27/skydrive-live-mesh-live-devices-dropbox-and-google-drive/</link>
		<comments>http://www.ronaldwidha.net/2012/04/27/skydrive-live-mesh-live-devices-dropbox-and-google-drive/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 16:00:00 +0000</pubDate>
		<dc:creator>Ronald Widha</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[consumer]]></category>
		<category><![CDATA[Dropbox]]></category>
		<category><![CDATA[google drive]]></category>
		<category><![CDATA[Live Mesh]]></category>
		<category><![CDATA[skydrive]]></category>

		<guid isPermaLink="false">http://www.ronaldwidha.net/?p=928</guid>
		<description><![CDATA[A few days back Microsoft announced enhancement to the new SkyDrive. It now works exactly like DropBox.&#160; If you’re confused about the differences between the new SkyDrive, the old SkyDrive and Live Mesh, then you’re not alone. This post will try and clear up the confusion. Hang in there. I’m going to also compared it [...]]]></description>
			<content:encoded><![CDATA[<p><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; border-left: 0px; display: block; padding-right: 0px; margin-right: auto" border="0" alt="image" src="http://www.ronaldwidha.net/wp-content/uploads/2012/04/image7.png" width="400" height="220" /></p>
<p>A few days back Microsoft announced enhancement to the new SkyDrive. It now works exactly like DropBox.&#160; If you’re confused about the differences between the new SkyDrive, the old SkyDrive and Live Mesh, then you’re not alone. This post will try and clear up the confusion. Hang in there. I’m going to also compared it slightly with Dropbox and Google Drive.</p>
<h2>The Old Model</h2>
<p>Before the launch of the new SkyDrive, Microsoft used to offer 2 separate products: SkyDrive and LiveMesh. </p>
<p><strong>SkyDrive</strong> was the online storage service that was used by the Microsoft Office Web App, all accessible from Live.com. There was no official supported way to automatically sync these files to your computer. I guess the combination of SkyDrive and Live Office Web Apps can be seen as Google Docs. An online only solution.</p>
<p><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; border-left: 0px; display: block; padding-right: 0px; margin-right: auto" border="0" alt="image" src="http://www.ronaldwidha.net/wp-content/uploads/2012/04/image1.png" width="434" height="319" /></p>
<p><strong>Windows Live Mesh </strong>(originally name Live Mesh, renamed to Live Sync and back to Live Mesh again….I know.) was and still is an application that lets you sync <strong>folders</strong> across computers – including PCs to the cloud i.e. SkyDrive.    <br />To see a list of the computers participating in the sync, you could go to Windows Live Devices. The SkyDrive storage will be listed as <strong>SkyDrive Synced Storage. </strong></p>
<p>With Live Mesh, SkyDrive is optional. I set up a few of my folders to be synced-up only between computers. Which kinda means there is no size restriction as such. The only downside since the P2P nature of the communication is the participating computers have to be on at the same time.</p>
<p>Most of the confusion comes with the fact that our SkyDrive Synced Storage (used by Windows Live Mesh) is separated from the main SkyDrive. Confused? To put it simply, if you start a document from Live.com Office Web Apps, you won’t see it in any of the Live Mesh folders. The same goes for the opposite. I can start a document locally on my computer, have it stored in Live Mesh &amp; SkyDrive Synced Storage and I won’t be able to see it on the main SkyDrive screen.</p>
<p align="center">&#160;<img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://www.ronaldwidha.net/wp-content/uploads/2012/04/image2.png" width="243" height="167" />&#160;<img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://www.ronaldwidha.net/wp-content/uploads/2012/04/image3.png" width="222" height="167" /><strong>     <br />left: </strong>SkyDrive     <br /><strong>right: </strong>SkyDrive Synced Storage</p>
<p align="center"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://www.ronaldwidha.net/wp-content/uploads/2012/04/image4.png" width="279" height="152" />&#160;<img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://www.ronaldwidha.net/wp-content/uploads/2012/04/image5.png" width="200" height="152" />    <br /><strong>left:</strong> SkyDrive shows 25GB     <br /><strong>right: </strong>SkyDrive synced storage shows 5GB</p>
<h2>The New Model</h2>
<p>The new SkyDrive added a feature which makes it exactly the same as the DropBox model where you get a preconfigured folder where the content will be synchronized across between the cloud storage and your devices. For the consumers, this model is much easier to grasp and managed. </p>
<p><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; border-left: 0px; display: block; padding-right: 0px; margin-right: auto" border="0" alt="image" src="http://www.ronaldwidha.net/wp-content/uploads/2012/04/image6.png" width="433" height="243" /></p>
<p>However for the power users, we’d miss the peer-to-peer feature of Live Mesh, which I’m guessing will at some point go away.</p>
<h2>Which one to use?</h2>
<p>I used to use Live Mesh heavily for peer to peer syncing my archived files. It’s one folder with a few gigabytes of content which I don’t need to have available on the cloud but would like to have on every computers. I then use Dropbox when I want to have it synced to the cloud as well. Also, partly because Windows Live Mesh didn’t have a client on the iPhone too.</p>
<p>But now since Windows Live has increased to 25GB, I see very little occasion where I care about p2p synchronization anymore – or to use the 2GB Dropbox for that matter. 25GB is enough to fit almost all my personal data excluding videos, photos and music. I’m sure this is also true for most people.</p>
<p>Google has also just recently launched their consumer cloud storage offering Google Drive. But with 5GB of storage, at this point I prefer SkyDrive as my primary cloud storage. Having said that, if you use Google Docs heavily, you’d appreciate how Google Drive creates a local shortcut for all the Google Docs that you have as if they are local files. But they are indeed just shortcuts and you still need internet connection to edit them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronaldwidha.net/2012/04/27/skydrive-live-mesh-live-devices-dropbox-and-google-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redis coming to Windows! implemented by Microsoft! on GitHub! ..but little “Cloud value”</title>
		<link>http://www.ronaldwidha.net/2012/04/27/redis-coming-to-windows-implemented-by-microsoft-on-github-but-little-cloud-value/</link>
		<comments>http://www.ronaldwidha.net/2012/04/27/redis-coming-to-windows-implemented-by-microsoft-on-github-but-little-cloud-value/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 03:33:24 +0000</pubDate>
		<dc:creator>Ronald Widha</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Redis]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[windows azure]]></category>

		<guid isPermaLink="false">http://www.ronaldwidha.net/?p=920</guid>
		<description><![CDATA[If you haven’t fainted by now after reading that title, or at least nearly, I don’t know what will. Microsoft Interop team earlier today just announced Redis on Windows prototype project. Redis On Windows Redis is an open source, networked, in-memory, key-value data store with optional atomicity and durability. Or to put it in simple [...]]]></description>
			<content:encoded><![CDATA[<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" border="0" src="http://redis.io/images/redis-300dpi.png" width="400" height="133" /></p>
<p>If you haven’t fainted by now after reading that title, or at least nearly, I don’t know what will. <a href="http://blogs.msdn.com/b/interoperability/archive/2012/04/26/here-s-to-the-first-release-from-ms-open-tech-redis-on-windows.aspx" target="_blank">Microsoft Interop team earlier today just announced Redis on Windows prototype project</a>.</p>
<h2>Redis On Windows</h2>
<p><a href="http://en.wikipedia.org/wiki/Redis" target="_blank">Redis is an open source, networked, in-memory, key-value data store with optional atomicity and durability.</a> Or to put it in simple (but rather vague term), Redis is one of thoes NoSQL databases. Made popular by Craigslist and Groupon. </p>
<p>In the Microsoft stack, we currently have access to Windows Azure Table Storage, RavenDB, MongoDB, CouchDB and so on. The reason why Redis wasn’t initially supported on Windows was due to the lack of a specific OS level function called <em>fork/copy on write</em> which allows data to still be read while written. To overcome this, he Microsoft interop team re-implemented the same feature on the software level as a part of Redis on Windows.</p>
<p>The last surprise was the fact that the Interop team has decided to make GitHub as their home instead of CodePlex. </p>
<h2></h2>
<h2>Little Cloud Value</h2>
<p>Is this is a game changer? I don’t think so. </p>
<p>With the advent of the cloud, it makes sense for one to want to use Redis on Windows Azure – which I’m sure can be made to work with little effort. However the issue is around the economics. To store approx. 2GB of data on Azure Table will cost you approx 25 cents/month. Whereas running a full small sized VM instance (to get approx 2GB of RAM for Redis) means paying 2 x $90/month (2 instances for high availability.</p>
<p>Regardless whether it makes sense or not, it is still nice to see that we have more options in what we do without necessarily switching to a different OS if we don’t want to.</p>
<p>Redis on Windows is available on GitHub <a href="https://github.com/MSOpenTech/redis#readme">https://github.com/MSOpenTech/redis</a> however still <strong>not </strong>labelled as ready for production yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronaldwidha.net/2012/04/27/redis-coming-to-windows-implemented-by-microsoft-on-github-but-little-cloud-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>what is this jealousy??</title>
		<link>http://www.ronaldwidha.net/2012/04/22/what-is-this-jealousy/</link>
		<comments>http://www.ronaldwidha.net/2012/04/22/what-is-this-jealousy/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 10:27:18 +0000</pubDate>
		<dc:creator>Ronald Widha</dc:creator>
				<category><![CDATA[Tumble]]></category>
		<category><![CDATA[hyper-v]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.ronaldwidha.net/?p=918</guid>
		<description><![CDATA[While trying to install VMWare Workstation 8 on Windows 8 …]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ronaldwidha.net/wp-content/uploads/2012/04/image.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; border-left: 0px; display: block; padding-right: 0px; margin-right: auto" border="0" alt="image" src="http://www.ronaldwidha.net/wp-content/uploads/2012/04/image_thumb.png" width="445" height="134" /></a></p>
<p align="center">While trying to install VMWare Workstation 8 on Windows 8 …</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronaldwidha.net/2012/04/22/what-is-this-jealousy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Dart &amp; XAML</title>
		<link>http://www.ronaldwidha.net/2012/04/13/google-dart-xaml/</link>
		<comments>http://www.ronaldwidha.net/2012/04/13/google-dart-xaml/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 18:54:40 +0000</pubDate>
		<dc:creator>Ronald Widha</dc:creator>
				<category><![CDATA[Opinions]]></category>

		<guid isPermaLink="false">http://www.ronaldwidha.net/?p=912</guid>
		<description><![CDATA[I just finished watching 1 hour worth of video on Google Dart. To put it simply, Dart tries to introduce a new browser based, client-side script language which let us not have to deal with Javascript – kinda like CoffeeScript. A few things that I find intriguing: C style syntax – Google consciously don’t try [...]]]></description>
			<content:encoded><![CDATA[<p><iframe height="315" src="http://www.youtube.com/embed/E80DLSyGBgc" frameborder="0" width="560" allowfullscreen="allowfullscreen"></iframe>
<p>I just finished watching 1 hour worth of video on <a href="http://code.google.com/p/dart/" target="_blank">Google Dart</a>. To put it simply, Dart tries to introduce a new browser based, client-side script language which let us not have to deal with Javascript – kinda like CoffeeScript.</p>
<p>A few things that I find intriguing:</p>
<ol>
<li>C style syntax – Google consciously don’t try to invent new syntax and stick to the syntax that most dev already familiar with.</li>
<li>Optional static typing – specifying a type against parameter or variables are optional and mainly for development time checking (intellisense &amp; warnings). On “production mode”, Dart doesn’t enforce it.</li>
<li>Dart is designed for dev to work with an “offline first” approach. The server component will be simple REST component like WCF Data Services, Web API, or NodeJS type of service (which to note; all the above will run on Azure <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://www.ronaldwidha.net/wp-content/uploads/2012/04/wlEmoticon-winkingsmile.png" />)</li>
<li>View engines work very similarly to XAML. Google is still brewing the view engine and seems to borrow a lot of the concept from XAML &amp; its view model binding capabilities.      <br />The view engine will be based on using HTML as a templating system, which will get parsed and output javascript code that generates the DOM elements. It’ll have capabilities to bind visual elements to observables.</li>
<li>Just like CoffeeScript – using Dart would mean that we as the developer will need to debug on code that the framework generates. There’s no correlation engine as yet between the source code and generated code.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.ronaldwidha.net/2012/04/13/google-dart-xaml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

