<?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.southworks.net/~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>Juan Pablo Garcia</title>
	
	<link>http://blogs.southworks.net/jpgarcia</link>
	<description>The real .JPG extension</description>
	<lastBuildDate>Sun, 07 Aug 2011 19:36:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.southworks.net/jpgarcia" /><feedburner:info uri="jpgarcia" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Windows Azure Storage for Node.js</title>
		<link>http://feeds.southworks.net/~r/jpgarcia/~3/8hk57UfRkVA/</link>
		<comments>http://blogs.southworks.net/jpgarcia/2011/08/06/windows-azure-storage-for-node-js/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 15:26:51 +0000</pubDate>
		<dc:creator>jpgarcia</dc:creator>
				<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[azure]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/jpgarcia/?p=100</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/jpgarcia/2011/08/06/windows-azure-storage-for-node-js/" class="more-link">read more<img src="http://blogs.southworks.net/jpgarcia/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>I got really exited after <a href="http://www.youtube.com/watch?v=jo_B4LTHi3I&amp;feature=player_embedded">watching the Introduction to Node.js video</a> performed by Ryan Dahl the creator of <a href="http://nodejs.org/">Node.js</a>, just after that I installed node in my computer and started playing a little bit with Javascript which is one of the languages that I love.</p>
<p>A few days ago I announced the release of the first version (0.0.1) of the <a title="windows azure storage library for node.js" href="waz-storage-js">waz-storage-js</a> library I wrote in <a href="http://nodejs.org/">Node.js</a>. The code is based on the <a href="https://github.com/johnnyhalife/waz-storage">waz-storage</a> ruby library written by friend and colleague <a href="http://blogs.southworks.net/jhalife/">Johnny Halife</a> who let me contribute with the <strong>Tables</strong> service and the <a href="https://github.com/jpgarcia/dm-waztables-adapter">dm-waztables-adapter</a> for datamapper.</p>
<p>This version allows you to deal only with <strong>Blobs</strong> but my plan is to include also <strong>Tables</strong> and <strong>Queues</strong> in the near future.</p>
<p>Remember that you can always fork the code hosted on <a href="https://github.com/jpgarcia/waz-storage-js">Github</a> and contribute to speed up the thing!</p>
<h2>Let&#8217;s play with it and install the package</h2>
<p>The library is available as an <a href="http://npmjs.org/">npm package</a>. To install, run the following command:</p>
<pre style="font-size: 12px;color: #444;background-color: #eee;border: solid 1px #ddd;padding: 5px;margin-bottom: 20px">npm install waz-storage-js</pre>
<h2>Configure your account information</h2>
<pre style="font-size: 12px;color: #444;background-color: #eee;border: solid 1px #ddd;padding: 5px;margin-bottom: 20px">var waz = waz.establishConnection({
        accountName: 'your_account_name'
        , accountKey: 'your_key',
        , useSsl: false
      });</pre>
<h2>And finally read and write data from you Blobs</h2>
<pre style="font-size: 12px;color: #444;background-color: #eee;border: solid 1px #ddd;padding: 5px;margin-bottom: 20px">// Creating a new container
waz.blobs.container.create('myContainer', function(err, result){
});

// Listing existing containers
waz.blobs.container.list(function(err, result){
});

// Finding a container
waz.blobs.container.find('myContainer', function(err, container){

        // Getting container's metadata
        container.metadata(function(err, metadata){
        });

        // Adding properties to a container
        container.putProperties({'x-ms-custom' : 'MyValue'}, function(err, result){
        });

        // Getting container's ACL
        container.getAcl(function(err, result){
        });

        // Setting container's ACL (null, 'blob', 'container')
        container.setAcl('container', function(err, result){
        });

        // Listing blobs in a container
        container.blobs(function(err, result){
        });

        // Getting blob's information
        result.getBlob('myfolder/my file.txt', function(err, blob){

            // Getting blob's contents
            blob.getContents(function(err,data){
                console.log(data);
            });
        });

        // Uploading a new Blob
        result.store('folder/my file.xml', 'content', 'text/xml', {'x-ms-MyProperty': 'value'}, function(err, result){
        });
    }
});

// Deleting containers
waz.blobs.container.delete('myContainer', function(err){
});</pre>
<p>Microsoft is working to <a href="http://blogs.msdn.com/b/interoperability/archive/2011/06/23/microsoft-working-with-joyent-and-the-node-community-to-bring-node-js-to-windows.aspx">bring Node.js to both Windows and Azure</a> and I hope my contribution (and why not yours) helps developers in future projects.</p>
<p>Stay tuned! I wil keep you posted.</p>
<img src="http://feeds.feedburner.com/~r/jpgarcia/~4/8hk57UfRkVA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.southworks.net/jpgarcia/2011/08/06/windows-azure-storage-for-node-js/</feedburner:origLink></item>
		<item>
		<title>Using TwitPic API 2.0 (OAuth Echo) from a C# client to upload pictures</title>
		<link>http://feeds.southworks.net/~r/jpgarcia/~3/g_N4f9hZIu8/</link>
		<comments>http://blogs.southworks.net/jpgarcia/2010/07/31/using-twitpic-api-20-oauth-echo-from-a-c-client-to-upload-pictures/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 20:08:55 +0000</pubDate>
		<dc:creator>jpgarcia</dc:creator>
				<category><![CDATA[Emerging Technology]]></category>
		<category><![CDATA[OAuth]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/jpgarcia/2010/07/31/using-twitpic-api-20-oauth-echo-from-a-c-client-to-upload-pictures/</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/jpgarcia/2010/07/31/using-twitpic-api-20-oauth-echo-from-a-c-client-to-upload-pictures/" class="more-link">read more<img src="http://blogs.southworks.net/jpgarcia/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>Last week we enjoyed a remote pair programming session with my friend <a href="http://blogs.southworks.net/jhalife/" target="_blank">Johnny</a>, the challenge was to upload a picture from a console application using the new <a href="http://dev.twitpic.com/docs/" target="_blank">TwitPic&#8217;s API</a> which takes advantage of the <a href="http://dev.twitter.com/pages/oauth_echo" target="_blank">OAuth Echo</a> authentication mechanism provided by Twitter.</p>
<p>The scenario we wanted to create wasn&#8217;t a web application, so we had not been able to handle a full OAuth process which forced us to perform an <strong>oob</strong> authentication method as <a href="http://dev.twitter.com/pages/auth_overview#oob" target="_blank">described here</a>:</p>
<p><em>&quot;For applications that really can&#8217;t handle the full OAuth process Twitter provides the out-of-band/PIN code authentication mode, also known as oob.      <br />This authentication flow is almost identical to full OAuth except instead of being directed back to your website the user is presented with a PIN code. The user is then asked to type this PIN code into your application which will then complete the token exchange.&quot;</em></p>
<p>Below you will find every step we followed to get this running.</p>
<h2>Getting a token and a token secret from Twitter</h2>
<ol>
<li>Register your application on <a href="http://dev.twitter.com/">http://dev.twitter.com/</a> to get your <strong>Consumer Key</strong> and <strong>Consumer Secret</strong>       <br />&#160;<a href="http://blogs.southworks.net/jpgarcia/files/2010/07/image3.png"><img border="0" alt="image" src="http://blogs.southworks.net/jpgarcia/files/2010/07/image-thumb3.png" width="640" height="460" /></a> </li>
<li>Create a new console application and reference the <strong>DotNetOpenAuth</strong> (<a href="http://www.ohloh.net/p/dotnetopenauth/download?package=DotNetOpenAuth" target="_blank">download it from here</a>), <strong>System.Web</strong> and <strong>System.Windows.Forms</strong> assemblies      <br /><a href="http://blogs.southworks.net/jpgarcia/files/2010/07/image1.png"><img border="0" alt="image" src="http://blogs.southworks.net/jpgarcia/files/2010/07/image-thumb1.png" width="265" height="341" /></a> </li>
<li>Create a service descriptor providing Twitter endpoints:
<div>
<div>
<pre>var descriptor = <span style="color: #0000ff">new</span> ServiceProviderDescription</pre>
<p><!--CRLF--></p>
<pre>{</pre>
<p><!--CRLF--></p>
<pre>    RequestTokenEndpoint = <span style="color: #0000ff">new</span> MessageReceivingEndpoint(<span style="color: #006080">&quot;http://twitter.com/oauth/request_token&quot;</span>, HttpDeliveryMethods.GetRequest | HttpDeliveryMethods.AuthorizationHeaderRequest),</pre>
<p><!--CRLF--></p>
<pre>    UserAuthorizationEndpoint = <span style="color: #0000ff">new</span> MessageReceivingEndpoint(<span style="color: #006080">&quot;http://twitter.com/oauth/authenticate&quot;</span>, HttpDeliveryMethods.GetRequest | HttpDeliveryMethods.AuthorizationHeaderRequest),</pre>
<p><!--CRLF--></p>
<pre>    AccessTokenEndpoint = <span style="color: #0000ff">new</span> MessageReceivingEndpoint(<span style="color: #006080">&quot;http://twitter.com/oauth/access_token&quot;</span>, HttpDeliveryMethods.GetRequest | HttpDeliveryMethods.AuthorizationHeaderRequest),</pre>
<p><!--CRLF--></p>
<pre>    TamperProtectionElements = <span style="color: #0000ff">new</span> ITamperProtectionChannelBindingElement[] { <span style="color: #0000ff">new</span> HmacSha1SigningBindingElement() }</pre>
<p><!--CRLF--></p>
<pre>};</pre>
<p><!--CRLF--></p>
</p></div>
</p></div>
</li>
<li>Now, we must create a token manager that implements <strong>IConsumerTokenManager</strong> and <strong>IOpenIdOAuthTokenManager</strong> interfaces. In this case we used an in memory implementation provided as part of <strong>DotNetOpenAuth</strong> samples. You can find the code in <strong>DotNetOpenAuth.ApplicationBlock</strong> sample, or you can copy and paste it form here:
<div>
<div>
<pre><span style="color: #0000ff">namespace</span> TwitpicOAuthClient</pre>
<p><!--CRLF--></p>
<pre>{</pre>
<p><!--CRLF--></p>
<pre>    <span style="color: #0000ff">using</span> System;</pre>
<p><!--CRLF--></p>
<pre>    <span style="color: #0000ff">using</span> System.Collections.Generic;</pre>
<p><!--CRLF--></p>
<pre>    <span style="color: #0000ff">using</span> DotNetOpenAuth.OAuth.ChannelElements;</pre>
<p><!--CRLF--></p>
<pre>    <span style="color: #0000ff">using</span> DotNetOpenAuth.OAuth.Messages;</pre>
<p><!--CRLF--></p>
<pre>    <span style="color: #0000ff">using</span> DotNetOpenAuth.OpenId.Extensions.OAuth;</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>    <span style="color: #0000ff">internal</span> <span style="color: #0000ff">class</span> InMemoryTokenManager : IConsumerTokenManager, IOpenIdOAuthTokenManager</pre>
<p><!--CRLF--></p>
<pre>    {</pre>
<p><!--CRLF--></p>
<pre>        <span style="color: #0000ff">private</span> <span style="color: #0000ff">readonly</span> Dictionary&lt;<span style="color: #0000ff">string</span>, <span style="color: #0000ff">string</span>&gt; tokensAndSecrets = <span style="color: #0000ff">new</span> Dictionary&lt;<span style="color: #0000ff">string</span>, <span style="color: #0000ff">string</span>&gt;();</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>        <span style="color: #0000ff">public</span> InMemoryTokenManager(<span style="color: #0000ff">string</span> consumerKey, <span style="color: #0000ff">string</span> consumerSecret)</pre>
<p><!--CRLF--></p>
<pre>        {</pre>
<p><!--CRLF--></p>
<pre>            <span style="color: #0000ff">if</span> (String.IsNullOrEmpty(consumerKey))</pre>
<p><!--CRLF--></p>
<pre>            {</pre>
<p><!--CRLF--></p>
<pre>                <span style="color: #0000ff">throw</span> <span style="color: #0000ff">new</span> ArgumentNullException(<span style="color: #006080">&quot;consumerKey&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre>            }</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>            <span style="color: #0000ff">this</span>.ConsumerKey = consumerKey;</pre>
<p><!--CRLF--></p>
<pre>            <span style="color: #0000ff">this</span>.ConsumerSecret = consumerSecret;</pre>
<p><!--CRLF--></p>
<pre>        }</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>        <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> ConsumerKey { get; <span style="color: #0000ff">private</span> set; }</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>        <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> ConsumerSecret { get; <span style="color: #0000ff">private</span> set; }</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>        <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> GetTokenSecret(<span style="color: #0000ff">string</span> token)</pre>
<p><!--CRLF--></p>
<pre>        {</pre>
<p><!--CRLF--></p>
<pre>            <span style="color: #0000ff">return</span> <span style="color: #0000ff">this</span>.tokensAndSecrets[token];</pre>
<p><!--CRLF--></p>
<pre>        }</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>        <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> StoreNewRequestToken(UnauthorizedTokenRequest request, ITokenSecretContainingMessage response)</pre>
<p><!--CRLF--></p>
<pre>        {</pre>
<p><!--CRLF--></p>
<pre>            <span style="color: #0000ff">this</span>.tokensAndSecrets[response.Token] = response.TokenSecret;</pre>
<p><!--CRLF--></p>
<pre>        }</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>        <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> ExpireRequestTokenAndStoreNewAccessToken(<span style="color: #0000ff">string</span> consumerKey, <span style="color: #0000ff">string</span> requestToken, <span style="color: #0000ff">string</span> accessToken, <span style="color: #0000ff">string</span> accessTokenSecret)</pre>
<p><!--CRLF--></p>
<pre>        {</pre>
<p><!--CRLF--></p>
<pre>            <span style="color: #0000ff">this</span>.tokensAndSecrets.Remove(requestToken);</pre>
<p><!--CRLF--></p>
<pre>            <span style="color: #0000ff">this</span>.tokensAndSecrets[accessToken] = accessTokenSecret;</pre>
<p><!--CRLF--></p>
<pre>        }</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>        <span style="color: #0000ff">public</span> TokenType GetTokenType(<span style="color: #0000ff">string</span> token)</pre>
<p><!--CRLF--></p>
<pre>        {</pre>
<p><!--CRLF--></p>
<pre>            <span style="color: #0000ff">throw</span> <span style="color: #0000ff">new</span> NotImplementedException();</pre>
<p><!--CRLF--></p>
<pre>        }</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>        <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> StoreOpenIdAuthorizedRequestToken(<span style="color: #0000ff">string</span> consumerKey, AuthorizationApprovedResponse authorization)</pre>
<p><!--CRLF--></p>
<pre>        {</pre>
<p><!--CRLF--></p>
<pre>            <span style="color: #0000ff">this</span>.tokensAndSecrets[authorization.RequestToken] = String.Empty;</pre>
<p><!--CRLF--></p>
<pre>        }</pre>
<p><!--CRLF--></p>
<pre>    }</pre>
<p><!--CRLF--></p>
<pre>}</pre>
<p><!--CRLF--></p>
</p></div>
</p></div>
</li>
<li>Provide the consumer information you got when you registered your application on Twitter. At this point you should be able to get a token URL from Twitter and let the user know from where he can authenticate to get the PIN code.
<div>
<div>
<pre><span style="color: #0000ff">string</span> requestToken;</pre>
<p><!--CRLF--></p>
<pre>var twitterConsumerKey = <span style="color: #006080">&quot;twitter_consumer_key&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre>var twitterConsumerSecret = <span style="color: #006080">&quot;twitter_consumer_key_secret&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>var consumer = <span style="color: #0000ff">new</span> DesktopConsumer(descriptor, <span style="color: #0000ff">new</span> InMemoryTokenManager(twitterConsumerKey, twitterConsumerSecret));</pre>
<p><!--CRLF--></p>
<pre>var requestTokenUrl = consumer.RequestUserAuthorization(<span style="color: #0000ff">null</span>, <span style="color: #0000ff">null</span>, <span style="color: #0000ff">out</span> requestToken);</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>Console.WriteLine(<span style="color: #006080">&quot;Please copy the following Url to your favorite web browser (it's already on your clipboard), and write the PIN below:&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre>Console.WriteLine(requestTokenUrl);</pre>
<p><!--CRLF--></p>
<pre>Clipboard.SetText(requestTokenUrl.ToString());</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>Console.Write(<span style="color: #006080">&quot;PIN: &quot;</span>);</pre>
<p><!--CRLF--></p>
<pre>var pin = Console.ReadLine();</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
</p></div>
</p></div>
</li>
<li>Decorate the Main method with the <strong>[STAThread]</strong> attribute to avoid a <strong>ThreadStateException </strong>while copying the URL to the user&#8217;s clipboard:
<div>
<div>
<pre>[STAThread]</pre>
<p><!--CRLF--></p>
<pre><span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> Main(<span style="color: #0000ff">string</span>[] args)</pre>
<p><!--CRLF--></p>
<pre>{</pre>
<p><!--CRLF--></p>
</p></div>
</p></div>
</li>
<li>Get the <strong>access_token</strong> and <strong>access_token_secret </strong>values provided by twitter:
<div>
<div>
<pre>var response = consumer.ProcessUserAuthorization(requestToken, pin);</pre>
<p><!--CRLF--></p>
<pre>var token = response.AccessToken;</pre>
<p><!--CRLF--></p>
<pre>var tokenSecret = ((ITokenSecretContainingMessage)response).TokenSecret;</pre>
<p><!--CRLF--></p>
</p></div>
</p></div>
</li>
</ol>
<h2>Using TwitPic API 2.0</h2>
<ol>
<li>First of all we must get an API key from <a href="http://dev.twitpic.com/apps/new">http://dev.twitpic.com/apps/new</a>
<p><a href="http://blogs.southworks.net/jpgarcia/files/2010/07/image2.png"><img border="0" alt="image" src="http://blogs.southworks.net/jpgarcia/files/2010/07/image-thumb2.png" width="640" height="362" /></a>&#160; </p>
</li>
<li>Further on this guide we will need to sign Twitpic&#8217;s requests, to do that you have to include the <strong>OAuthBase.cs</strong> library on your project(<a href="http://oauth.googlecode.com/svn/code/csharp/OAuthBase.cs">http://oauth.googlecode.com/svn/code/csharp/OAuthBase.cs</a>).&#160; </li>
<li>Provide your Twitpic API key and define the following variables just after where you got the <strong>token</strong> and the <strong>token secret </strong>from Twitter:
<div>
<div>
<pre>var twitpicApiKey = <span style="color: #006080">&quot;twitpic_api_key&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre>var oauthSignaturePattern = <span style="color: #006080">&quot;OAuth realm=\&quot;{0}\&quot;, oauth_consumer_key=\&quot;{1}\&quot;, oauth_signature_method=\&quot;HMAC-SHA1\&quot;, oauth_token=\&quot;{2}\&quot;, oauth_timestamp=\&quot;{3}\&quot;, oauth_nonce=\&quot;{4}\&quot;, oauth_version=\&quot;1.0\&quot;, oauth_signature=\&quot;{5}\&quot;&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre>var authenticationRealm = <span style="color: #006080">&quot;http://api.twitter.com/&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre>var twitpicUploadApiUrl = <span style="color: #006080">&quot;http://api.twitpic.com/2/upload.json&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre>var twitterVerifyCredentialsApiUrl = <span style="color: #006080">&quot;https://api.twitter.com/1/account/verify_credentials.json&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre>var contentEncoding = <span style="color: #006080">&quot;iso-8859-1&quot;</span>;</pre>
<p><!--CRLF--></p>
</p></div>
</p></div>
</li>
<li>Use the <strong>OAuthBase</strong> library to generate the signature:
<div>
<div>
<pre>var oauth = <span style="color: #0000ff">new</span> OAuthBase();</pre>
<p><!--CRLF--></p>
<pre><span style="color: #0000ff">string</span> normalizedString, normalizedParameters;</pre>
<p><!--CRLF--></p>
<pre>var timestamp = oauth.GenerateTimeStamp();</pre>
<p><!--CRLF--></p>
<pre>var nounce = oauth.GenerateNonce();</pre>
<p><!--CRLF--></p>
<pre>var signature = oauth.GenerateSignature(</pre>
<p><!--CRLF--></p>
<pre>                    <span style="color: #0000ff">new</span> Uri(twitterVerifyCredentialsApiUrl),</pre>
<p><!--CRLF--></p>
<pre>                    twitterConsumerKey,</pre>
<p><!--CRLF--></p>
<pre>                    twitterConsumerSecret,</pre>
<p><!--CRLF--></p>
<pre>                    token,</pre>
<p><!--CRLF--></p>
<pre>                    tokenSecret,</pre>
<p><!--CRLF--></p>
<pre>                    <span style="color: #006080">&quot;GET&quot;</span>,</pre>
<p><!--CRLF--></p>
<pre>                    timestamp,</pre>
<p><!--CRLF--></p>
<pre>                    nounce,</pre>
<p><!--CRLF--></p>
<pre>                    <span style="color: #0000ff">out</span> normalizedString,</pre>
<p><!--CRLF--></p>
<pre>                    <span style="color: #0000ff">out</span> normalizedParameters);</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>signature = HttpUtility.UrlEncode(signature);</pre>
<p><!--CRLF--></p>
</p></div>
</p></div>
</li>
<li>Create a multipart/form-data <strong>HttpWebRequest</strong> and set the required <strong>X-Verify-Credentials-Authorization</strong> and <strong>X-Auth-Service-Provider</strong> headers as described in <a href="http://dev.twitpic.com/docs/2/upload/">http://dev.twitpic.com/docs/2/upload/</a> page:
<div>
<div>
<pre>var boundary = Guid.NewGuid().ToString();</pre>
<p><!--CRLF--></p>
<pre>var request = (HttpWebRequest)WebRequest.Create(twitpicUploadApiUrl);</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>request.PreAuthenticate = <span style="color: #0000ff">true</span>;</pre>
<p><!--CRLF--></p>
<pre>request.AllowWriteStreamBuffering = <span style="color: #0000ff">true</span>;</pre>
<p><!--CRLF--></p>
<pre>request.ContentType = <span style="color: #0000ff">string</span>.Format(<span style="color: #006080">&quot;multipart/form-data; boundary={0}&quot;</span>, boundary);</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>request.Headers.Add(<span style="color: #006080">&quot;X-Auth-Service-Provider&quot;</span>, twitterVerifyCredentialsApiUrl);</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>var authorizationHeader = <span style="color: #0000ff">string</span>.Format(</pre>
<p><!--CRLF--></p>
<pre>                            CultureInfo.InvariantCulture,</pre>
<p><!--CRLF--></p>
<pre>                            oauthSignaturePattern,</pre>
<p><!--CRLF--></p>
<pre>                            authenticationRealm,</pre>
<p><!--CRLF--></p>
<pre>                            twitterConsumerKey,</pre>
<p><!--CRLF--></p>
<pre>                            token,</pre>
<p><!--CRLF--></p>
<pre>                            timestamp,</pre>
<p><!--CRLF--></p>
<pre>                            nounce,</pre>
<p><!--CRLF--></p>
<pre>                            signature);</pre>
<p><!--CRLF--></p>
<pre>request.Headers.Add(<span style="color: #006080">&quot;X-Verify-Credentials-Authorization&quot;</span>, authorizationHeader);</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>request.Method = <span style="color: #006080">&quot;POST&quot;</span>;</pre>
<p><!--CRLF--></p>
</p></div>
</p></div>
</li>
<li>Create the payload for the request, which includes the TwitPic message and image contents:
<div>
<div>
<pre>var header = <span style="color: #0000ff">string</span>.Format(<span style="color: #006080">&quot;&#045;&#045;{0}&quot;</span>, boundary);</pre>
<p><!--CRLF--></p>
<pre>var footer = <span style="color: #0000ff">string</span>.Format(<span style="color: #006080">&quot;&#045;&#045;{0}&#045;&#045;&quot;</span>, boundary);</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>var contents = <span style="color: #0000ff">new</span> StringBuilder();</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine(header);</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre><span style="color: #0000ff">string</span> fileContentType = <span style="color: #006080">&quot;image/png&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre><span style="color: #0000ff">string</span> fileHeader = <span style="color: #0000ff">string</span>.Format(<span style="color: #006080">&quot;Content-Disposition: file; name=\&quot;{0}\&quot;; filename=\&quot;{1}\&quot;&quot;</span>, <span style="color: #006080">&quot;media&quot;</span>, <span style="color: #006080">&quot;sample_image.png&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre><span style="color: #0000ff">string</span> fileData = Encoding.GetEncoding(contentEncoding).GetString(File.ReadAllBytes(<span style="color: #006080">@&quot;c:\sample_image.png&quot;</span>));</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine(fileHeader);</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine(<span style="color: #0000ff">string</span>.Format(<span style="color: #006080">&quot;Content-Type: {0}&quot;</span>, fileContentType));</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine();</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine(fileData);</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine(header);</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine(<span style="color: #0000ff">string</span>.Format(<span style="color: #006080">&quot;Content-Disposition: form-data; name=\&quot;{0}\&quot;&quot;</span>, <span style="color: #006080">&quot;key&quot;</span>));</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine();</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine(twitpicApiKey);</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine(header);</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine(String.Format(<span style="color: #006080">&quot;Content-Disposition: form-data; name=\&quot;{0}\&quot;&quot;</span>, <span style="color: #006080">&quot;message&quot;</span>));</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine();</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine(<span style="color: #006080">&quot;Testing Twitpic API&quot;</span> + Path.GetTempFileName()); <span style="color: #008000">// GetTempFileName is to avoid duplicate prevention.</span></pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>contents.AppendLine(footer);</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre><span style="color: #0000ff">byte</span>[] bytes = Encoding.GetEncoding(contentEncoding).GetBytes(contents.ToString());</pre>
<p><!--CRLF--></p>
<pre>request.ContentLength = bytes.Length;</pre>
<p><!--CRLF--></p>
</p></div>
</p></div>
</li>
<li>And finally perform the request:
<div>
<div>
<pre><span style="color: #0000ff">using</span> (var requestStream = request.GetRequestStream())</pre>
<p><!--CRLF--></p>
<pre>{</pre>
<p><!--CRLF--></p>
<pre>    requestStream.Write(bytes, 0, bytes.Length);</pre>
<p><!--CRLF--></p>
<pre>&#160;</pre>
<p><!--CRLF--></p>
<pre>    <span style="color: #0000ff">using</span> (var twitpicResponse = (HttpWebResponse)request.GetResponse())</pre>
<p><!--CRLF--></p>
<pre>    {</pre>
<p><!--CRLF--></p>
<pre>        <span style="color: #0000ff">using</span> (var reader = <span style="color: #0000ff">new</span> StreamReader(twitpicResponse.GetResponseStream()))</pre>
<p><!--CRLF--></p>
<pre>        {</pre>
<p><!--CRLF--></p>
<pre>            Console.WriteLine(twitpicResponse.StatusCode + <span style="color: #006080">&quot;: &quot;</span> + reader.ReadToEnd());</pre>
<p><!--CRLF--></p>
<pre>            Console.Read();</pre>
<p><!--CRLF--></p>
<pre>        }</pre>
<p><!--CRLF--></p>
<pre>    }</pre>
<p><!--CRLF--></p>
<pre>}</pre>
<p><!--CRLF--></p>
</p></div>
</p></div>
</li>
</ol>
<h2>Running the Sample</h2>
<ol>
<li>Run the console application and the token URL should be copied to your clipboard: <a href="http://blogs.southworks.net/jpgarcia/files/2010/07/image4.png"><img border="0" alt="image" src="http://blogs.southworks.net/jpgarcia/files/2010/07/image-thumb4.png" width="667" height="144" /></a> </li>
<li>Open a web browser an paste the URL to obtain the PIN code:
<p><a href="http://blogs.southworks.net/jpgarcia/files/2010/07/image5.png"><img border="0" alt="image" src="http://blogs.southworks.net/jpgarcia/files/2010/07/image-thumb5.png" width="640" height="287" /></a> </li>
<li>Enter the PIN code in the console and if there are no errors you will be able to view the new image on Twitpic:
<p><a href="http://blogs.southworks.net/jpgarcia/files/2010/07/image6.png"><img border="0" alt="image" src="http://blogs.southworks.net/jpgarcia/files/2010/07/image-thumb6.png" width="618" height="190" /></a> </li>
</ol>
<img src="http://feeds.feedburner.com/~r/jpgarcia/~4/g_N4f9hZIu8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.southworks.net/jpgarcia/2010/07/31/using-twitpic-api-20-oauth-echo-from-a-c-client-to-upload-pictures/</feedburner:origLink></item>
		<item>
		<title>AD FS 2.0 – No certificate with thumbprint “…….” found</title>
		<link>http://feeds.southworks.net/~r/jpgarcia/~3/yHEL7MVaJwk/</link>
		<comments>http://blogs.southworks.net/jpgarcia/2010/04/17/ad-fs-20-no-certificate-with-thumbprint-found/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 17:34:42 +0000</pubDate>
		<dc:creator>jpgarcia</dc:creator>
				<category><![CDATA[AD FS 2.0]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/jpgarcia/?p=74</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/jpgarcia/2010/04/17/ad-fs-20-no-certificate-with-thumbprint-found/" class="more-link">read more<img src="http://blogs.southworks.net/jpgarcia/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>During the last week I was working for an identity project related to the new <strong>U-Prove CTP</strong> version of the <strong>Active Directory Federation Services 2.0</strong>.</p>
<p>As you know, when working with new technologies, it is very common to find blocking issues like this. This is why I want to share with you my experience.</p>
<h2>Symptom</h2>
<p>AD FS certificates cannot be changed neither from the Management Console nor PowerShell Cmdlet. You may receive an error message like <em><strong>No certificate with thumbprint &#8220;&#8230;&#8230;.&#8221; found</strong></em>.</p>
<p><img src="http://dl.dropbox.com/u/1432886/blogs/jpgarcia/adfs-cert/1a.png" alt="" /></p>
<h2>Solution</h2>
<ol>
<li>Open the <strong>Microsoft Management Console</strong> and add a new <strong>Certificates</strong> Snap-in for <strong>Computer Account </strong>
<ul>
<li> Go to the <strong>Personal</strong> / <strong>Certificates</strong> node and open the new certificate you are going to use by doble-clicking on it</li>
<li>Select the <strong>Details</strong> tab and copy the <strong>Thumbprint</strong> value</li>
</ul>
</li>
<li>Open <strong>SQL Server Management Console </strong>
<ul>
<li>Select the <strong>AdFsConfiguration</strong> database<strong>Note</strong>: If you are using the Microsoft Internal Database you can use this connection string ( <em>\\.\pipe\mssql$microsoft##ssee\sql\query </em>)</li>
<li>Open the <strong>IdentityServerPolicy.ServiceSettings</strong> table and copy the <strong>ServiceSettingsData</strong> field value (XML) to a Notepad</li>
<li>Find the missing <strong>Thumbprint</strong> values you got on the AD FS error message</li>
<li>Replace the found values by the new one certificate&#8217;s Thumbprint without empty spaces.<strong><br />
</strong></li>
<li>Update the <strong>ServiceSettingsData</strong><span> field with the new XML configuration<strong><br />
Note</strong>: XML contents must not BE tidy</p>
<p></span></li>
</ul>
</li>
<li><span>Go to to </span><span> and refresh the Certificates node<br />
</span></li>
<li><span>At this point you should see listed the new certificate<br />
</span></li>
<li>If you are changing the <strong>Service Communications Certificate</strong>, open the <strong>Internet Information Service (IIS) Manager </strong>
<ul>
<li>Select the <strong>Default Website<br />
</strong></li>
<li>Click on <strong>Bindings&#8230;</strong> action, go to the <strong>https</strong> row ad click on <strong>Edit&#8230;<br />
</strong></li>
<li>Select the new certificate from the <strong>SSL certificate</strong> combo-box and click OK (<strong>Note: </strong><span>if you see an error message, click ok</span>)</li>
</ul>
</li>
</ol>
<img src="http://feeds.feedburner.com/~r/jpgarcia/~4/yHEL7MVaJwk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.southworks.net/jpgarcia/2010/04/17/ad-fs-20-no-certificate-with-thumbprint-found/</feedburner:origLink></item>
		<item>
		<title>Windows Azure Tables adapter for DataMapper</title>
		<link>http://feeds.southworks.net/~r/jpgarcia/~3/HllOoGlTwOU/</link>
		<comments>http://blogs.southworks.net/jpgarcia/2010/02/08/windows-azure-tables-adapter-for-datamapper/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 12:17:27 +0000</pubDate>
		<dc:creator>jpgarcia</dc:creator>
				<category><![CDATA[DataMapper]]></category>
		<category><![CDATA[Emerging Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/jpgarcia/?p=73</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/jpgarcia/2010/02/08/windows-azure-tables-adapter-for-datamapper/" class="more-link">read more<img src="http://blogs.southworks.net/jpgarcia/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<h1>The Past</h1>
<p>Last Friday, we shipped the first Major version (v1.0.0) of the Windows Azure Storage API gem for ruby, started a few months ago by my friend <a href="http://blogs.southworks.net/jhalife/">Johnny Halife</a>. As it is an open-source project, I had the opportunity to contribute with:</p>
<ul>
<li>Support for table service to query, get_one, insert, update, merge and delete entities.</li>
<li>Support for running against the Storage Developement Fabriq shipped with Microsoft SDK.</li>
<li>Signature support for Tables service according to <a href="http://msdn.microsoft.com/en-us/library/dd179428.aspx">msdn.microsoft.com/en-us/library/dd179428.aspx</a></li>
<li>Support to enumerate, create, and delete tables on give storage account.</li>
<li>Give feedback to Improve the support for stacked connection management.</li>
</ul>
<p>This release of waz-storage for ruby includes numerous features collected thru 0.5.6 to 1.0.0, for more information you can visit the <a href="http://waz-storage.heroku.com/">http://waz-storage.heroku.com/</a> where you will find all the gem documentation, or if you like to read the source code, contribute or giving us feedback you can get it from on <a href="http://github.com/johnnyhalife/waz-storage/">http://github.com/johnnyhalife/waz-storage</a>.</p>
<h2>The Present</h2>
<p>One of the objectives of having Tables support on the gem was to have an interface to interact with Tables and Entities that we can consume from an adapter as we usually do with our favorite ORM written in ruby which is DataMapper.</p>
<p>This is why this weekend was pretty much to make the dream come true, creating a new project on github called <strong>dm-waztables-adapter</strong> (<a href="http://github.com/jpgarcia/dm-waztables-adapter">http://github.com/jpgarcia/dm-waztables-adapter</a>) and spitting some lines of code.</p>
<h3>Writing the adapter</h3>
<p>As everything in Ruby wonderful world, it was really easy to have a first version running with the features provided by Datamapper.</p>
<p>It took me a few hours to write down <strong>85 lines of code </strong>to cover the whole adapter (Create, Read, Update and Delete methods)</p>
<p>Sorry, I&#8217;m forgetting the aditional 30 minutes I spent on writing <strong>32 more lines</strong> to cover the Migrations stuff. So you won&#8217;t worry about creating the tables when you design your models (As Windows Azure doesn&#8217;t have support for schemas inside tables, migrations exists just to make sure that you have the tables. It won&#8217;t modify attributes of existing data).</p>
<p>Below you will find some code samples. I hope you like it.</p>
<h3>Getting started</h3>
<pre>sudo gem install dm-waztables-adapter --source http://gemcutter.org</pre>
<h3>Usage</h3>
<pre>require 'dm-waztables-adapter'

# set up a DataMapper with your Windwows Azure account
DataMapper.setup(:default, { :adapter =&gt; 'WAZTables',
                                         :account_name =&gt; 'name',
                                         :access_key =&gt; 'your_access_key' })

# define a new model
class Guitarist
    include DataMapper::Resource

    property :id, String, :key =&gt; true
    property :name, String
    property :age, Integer
end

# set up database table on Windows Azure for a specific model
Guitarist.auto_migrate! # (destructive)
Guitarist.auto_upgrade! # (safe)

# set up database table on Windows Azure for all defined models
Datamapper.auto_migrate! # (destructive)
Datamapper.auto_upgrade! # (safe)

# play with DataMapper as usual
Guitarist.create(:id =&gt; '1', :name =&gt; 'Ritchie Blackmore', :age =&gt; 65)

yngwie = Guitarist.new(:id =&gt; '2', :name =&gt; 'Yngwio Malmsteen', :age =&gt; 46)
yngwie.name = "Yngwie Malmsteen"
yngwie.save

# retrieving a unique record by its id
ritchie = Guitarist.get('1')
ritchie.age # =&gt; 65

# updating records
ritchie.age = 66
ritchie.save

# retrieving all guitarists
    Guitarist.all.length # =&gt; 2

# performing queries
    older_guitar_players = Guitarist.all( { :age.gte =&gt; 50 } )

# deleting records
older_guitar_players.destroy!</pre>
<h3>TODO</h3>
<ul>
<li>Allow users to define the model partition key by using :partition_key =&gt; true option on the property.</li>
<li>Allow users to set the partition key as an additional attribute of the model with a lambda as default value.</li>
<li>Allow users to set the partition key as a method on the model.</li>
<li>Implement “in” operator in queries</li>
<li>Implement “order” query option</li>
<li>Retrieve more than 1000 fields using Windows Azure :continuation_token</li>
</ul>
<h3>Known Issues</h3>
<ul>
<li>Like statements are not working since Microsoft service API is throwing a NotImplemented exception when<br />
using <em>startswith</em> and <em>endswith</em> filters (<a href="http://msdn.microsoft.com/en-us/library/dd541448.aspx">more information here</a>)</li>
<li>There&#8217;s no way to tell thru the entity which is the partition key of our entity, so there&#8217;s no out-of-the-box load balancing support (for mor info on the tables model that a look at http://msdn.microsoft.com/en-us/library/dd179338.aspx)</li>
</ul>
<img src="http://feeds.feedburner.com/~r/jpgarcia/~4/HllOoGlTwOU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.southworks.net/jpgarcia/2010/02/08/windows-azure-tables-adapter-for-datamapper/</feedburner:origLink></item>
		<item>
		<title>Reaching Azure Development Fabriq from a remote machine</title>
		<link>http://feeds.southworks.net/~r/jpgarcia/~3/mq26aJd59mA/</link>
		<comments>http://blogs.southworks.net/jpgarcia/2010/01/03/azure-development-fabriq-from-a-remote-machine/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 18:55:15 +0000</pubDate>
		<dc:creator>jpgarcia</dc:creator>
				<category><![CDATA[Emerging Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/jpgarcia/?p=59</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/jpgarcia/2010/01/03/azure-development-fabriq-from-a-remote-machine/" class="more-link">read more<img src="http://blogs.southworks.net/jpgarcia/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>Are you following me on <a href="http://twitter.com/jpgd">Twitter</a>? If the answer is yes, you may know that I forked the <a href="http://github.com/jpgarcia/waz-storage">waz-storage</a> project to write the Tables and Entities operations exposed by the <a href="http://msdn.microsoft.com/en-us/library/dd179423.aspx">Windows Azure Table API</a>.</p>
<p>One of the things I wanted to get while writing code in my ruby environment, was to perform functional tests against a local environment. So, today I’m going to talk about the <a title="Azure Development Fabriq" href="http://msdn.microsoft.com/en-us/library/dd179455.aspx">Azure Development Fabriq</a> and how you can access to this service from outside your local host.</p>
<h2>The problem</h2>
<p>The Development Fabriq is configured by default to listen in the following sockets: </p>
<ul>
<li><strong>Blob Service</strong>: <a href="http://127.0.0.1:10000">http://127.0.0.1:10000</a> </li>
<li><strong>Queue Service</strong>: <a href="http://127.0.0.1:10001">http://127.0.0.1:10001</a> </li>
<li><strong>Table Service</strong>: <a href="http://127.0.0.1:10002">http://127.0.0.1:10002</a> </li>
</ul>
<p>That said, we can imagine that <a title="blob endpoint" href="http://{Your_LAN_IPAddress}:10000/devstoreaccount1/container/myblob">http://{Your_LAN_IPAddress}:10000/devstoreaccount1/container/myblob</a> will allow us to get that blob, but it will never happen. At this point, you can consume the services just from your localhost.</p>
<h2>The solution</h2>
<p>You can change the default 127.0.0.1 IP address by the one assigned to your interface, in the configuration file <em>C:\Program Files\Windows Azure SDK\v1.0\bin\devstore\DSService.exe.config</em>:</p>
<p>&lt;services&gt;    <br />&#160; &lt;service name=&quot;Blob&quot; url=&quot;<a href="http://192.168.1.100:10000/&quot;/">http://192.168.1.100:10000/&quot;/</a>&gt;     <br />&#160; &lt;service name=&quot;Queue&quot; url=&quot;<a href="http://192.168.1.100:10001/&quot;/">http://192.168.1.100:10001/&quot;/</a>&gt;     <br />&#160; &lt;service name=&quot;Table&quot; url=&quot;<a href="http://192.168.1.100:10002/&quot;/">http://192.168.1.100:10002/&quot;/</a>&gt;     <br />&lt;/services&gt;</p>
<p>Shutdown / Start the Development Fabriq to apply those changes and that’s it. Tests passing from Textmate against a vm runing the Storage Service locally.</p>
<p><a href="http://blogs.southworks.net/jpgarcia/files/2010/01/image121.png"><img border="0" alt="image" src="http://blogs.southworks.net/jpgarcia/files/2010/01/image12-thumb1.png" width="640" height="267" /></a> </p>
<p><a href="http://blogs.southworks.net/jpgarcia/files/2010/01/image1.png"><img border="0" alt="image" src="http://blogs.southworks.net/jpgarcia/files/2010/01/image-thumb1.png" width="594" height="197" /></a> </p>
<p>hope you like it!</p>
<img src="http://feeds.feedburner.com/~r/jpgarcia/~4/mq26aJd59mA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.southworks.net/jpgarcia/2010/01/03/azure-development-fabriq-from-a-remote-machine/</feedburner:origLink></item>
		<item>
		<title>Dropzone extension leveraging Ruby waz-storage gem</title>
		<link>http://feeds.southworks.net/~r/jpgarcia/~3/opDyVEryDgk/</link>
		<comments>http://blogs.southworks.net/jpgarcia/2009/10/19/dropzone-extension-leveraging-ruby-waz-storage-gem/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 22:19:12 +0000</pubDate>
		<dc:creator>jpgarcia</dc:creator>
				<category><![CDATA[Dropzone]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/jpgarcia/?p=55</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/jpgarcia/2009/10/19/dropzone-extension-leveraging-ruby-waz-storage-gem/" class="more-link">read more<img src="http://blogs.southworks.net/jpgarcia/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a long time since my last post, so today I want to share with you my experience on using the <a title="waz-storage" href="http://github.com/johnnyhalife/waz-storage">waz-storage gem</a>, created by my friend <a title="Johnny Halife" href="http://blogs.southworks.net/jhalife/">Johhny Halife</a>. If you are not aware about his amazing job you should check <a href="http://blogs.southworks.net/jhalife/2009/10/16/announcing-ruby-windows-azure-storage-sdk-v05/">this post</a> to get more context about what I&#8217;m going to show you.</p>
<h2>What can I do?</h2>
<p>After reviewing Johnny&#8217;s code I was very excited on creating something and to start playing with that toy, but obviously the question was WHAT?</p>
<p>The answer came to my mind while reading a blog about an application for Mac OSX desktop called <a href="http://aptonic.com/">Dropzone</a>. This is a excerpt taken from <a href="http://aptonic.com/">Dropzone</a>&#8216;s website.</p>
<p><em>&#8220;Drag a file onto the dock icon and your fully customizable grid of destinations flies smoothly out using core animation. Drop the file onto a destination and Dropzone will take care of the rest. Whether you&#8217;re installing an app, uploading a file to an FTP server or sharing your photos on Flickr.&#8221;</em></p>
<p>There is a section regarding how to extend the Dropzone&#8217;s features, and how to contribute creating plugins. Dropzone can easily be extended using simple ruby scripts.</p>
<p>So, I thought about writing a script that allow users to easily drag an drop files from your computer and store them as Blobs on the Windows Azure Storage Services.</p>
<h2>Coding for fun!</h2>
<p>I started reading the <a href="http://aptonic.com/dropzone/documentation/">Dropzone Scripting API</a> documentation and I was surprised how easy it was. There are only two methods to implement which are <strong>dragged</strong>,<strong> clicked</strong> and that&#8217;s it.</p>
<p>Beyond the simplicity that gives the Dropzone&#8217;s API, I had the joy of coding in Ruby and the <a href="http://github.com/johnnyhalife/waz-storage">waz-storage gem</a> <span>easiness</span><a href="http://blogs.southworks.net/jhalife/"></a>.</p>
<p>You can find the source code on the following url <a href="http://github.com/jpgarcia/dropzone-user-scripts/blob/master/WAZBlobs.dropzone">http://github.com/jpgarcia/dropzone-user-scripts/blob/master/WAZBlobs.dropzone</a></p>
<h2>How can you try it?</h2>
<p>Installation and configuration:</p>
<ol>
<li>Download the Dropzone program <a href="http://aptonic.com/index.php">from here</a></li>
<li>Install the <strong>waz-storage gem</strong> if the gem isn&#8217;t installed yet<br />
<span style="color: #333333"><em>sudo gem install waz-storage &#8211;version &gt;= 0.5.4 &#8211;source http://gemcutter.org</em></span></li>
<li>Download the dropzone extension that I created from the <a href="http://github.com/jpgarcia/dropzone-user-scripts">github repositories</a>. The file is called <span style="color: #333333"><em><strong>WAZBlobs.dropzone</strong></em></span></li>
<li><span style="color: #333333"><span style="color: #000000">Open the <span style="color: #333333"><em><strong>WAZBlobs.dropzone</strong></em></span> file and provide your Windows Azure Services credentials as depicted below:<br />
</span></span><a href="http://blogs.southworks.net/jpgarcia/files/2009/10/picture-3.png"><img class="alignnone size-medium wp-image-56" src="http://blogs.southworks.net/jpgarcia/files/2009/10/picture-3.png" alt="" width="300" height="282" /></a></li>
</ol>
<p>The script and the functionality is very simple:</p>
<ol>
<li>Drag and drop your files to the Azure&#8217;s icon on the Dropzone panel<br />
<a href="http://blogs.southworks.net/jpgarcia/files/2009/10/wasdrag.png"><img class="alignnone size-medium wp-image-57" src="http://blogs.southworks.net/jpgarcia/files/2009/10/wasdrag.png" alt="" width="300" height="265" /></a></li>
<li>The files will be uploaded to a <strong>public</strong> container called <strong>dropzone</strong>.</li>
<li>The following picture shows how the <strong>Picture 3</strong>, that I dragged &amp; dropped above, is already on Windows Azure Blobs servers. So I will play a little bit with the console to show you that the Blob is already there <img src='http://blogs.southworks.net/jpgarcia/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<a href="http://blogs.southworks.net/jpgarcia/files/2009/10/console.png"><img class="alignnone size-full wp-image-58" src="http://blogs.southworks.net/jpgarcia/files/2009/10/console.png" alt="" width="499" height="255" /></a></li>
</ol>
<p>On my next post I will show you a new application I&#8217;m developing on <a href="http://heroku.com">Heroku</a> that uses the same gem to manage the Blobs via Web. Stay tuned!</p>
<img src="http://feeds.feedburner.com/~r/jpgarcia/~4/opDyVEryDgk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.southworks.net/jpgarcia/2009/10/19/dropzone-extension-leveraging-ruby-waz-storage-gem/</feedburner:origLink></item>
		<item>
		<title>Webcast for Latin American Community about HPC with WCF</title>
		<link>http://feeds.southworks.net/~r/jpgarcia/~3/5TCKnPh4kGg/</link>
		<comments>http://blogs.southworks.net/jpgarcia/2009/01/09/webcast-for-latinoamerica-about-hpc-with-wcf/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 09:41:47 +0000</pubDate>
		<dc:creator>jpgarcia</dc:creator>
				<category><![CDATA[WCF]]></category>
		<category><![CDATA[Windows HPC Server 2008]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/jpgarcia/?p=52</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/jpgarcia/2009/01/09/webcast-for-latinoamerica-about-hpc-with-wcf/" class="more-link">read more<img src="http://blogs.southworks.net/jpgarcia/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: right"><a href="http://www.jpgarcia.com.ar/index.php/2009/01/04/webcast-para-latinoamerica-sobre-hpc-con-wcf/">Spanish Version</a></p>
<p>On December 11, 2008 we gave a Webcast for Latin American Community with my friend and mentor <a href="http://blogs.southworks.net/jhalife/">Johnny Halife</a> about how to develop distributed applications by using <a href="http://www.microsoft.com/hpc/en/us/default.aspx">Windows HPC Server 2008</a>.</p>
<p>The objective of the talk was about to explain the platform that <a href="http://www.microsoft.com/hpc/en/us/default.aspx">Windows HPC Server 200</a>8 provide us to build distributed applications with a SOA architecture by using Windows Communication Foundation (WCF).</p>
<p>In addition we had the opportunity to make a small demo creating a simple application on our lab deployed at <a href="http://www.southworks.net">Southworks</a>.</p>
<p>For the ones that couldn&#8217;t attend this presentation, you can download or watch it in the following url: <a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032390257&amp;Culture=es-AR">http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032390257&amp;Culture=es-AR</a>.</p>
<p><a href="http://blogs.southworks.net/jpgarcia/files/2009/01/webcasthpc.png"><img class="alignnone size-full wp-image-53" src="http://blogs.southworks.net/jpgarcia/files/2009/01/webcasthpc.png" alt="" width="400" height="372" /></a></p>
<p>Enjoy it!</p>
<img src="http://feeds.feedburner.com/~r/jpgarcia/~4/5TCKnPh4kGg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.southworks.net/jpgarcia/2009/01/09/webcast-for-latinoamerica-about-hpc-with-wcf/</feedburner:origLink></item>
		<item>
		<title>Visual Studio 2008 templates compliant with Microsoft StyleCop</title>
		<link>http://feeds.southworks.net/~r/jpgarcia/~3/DLuRfOOvEYw/</link>
		<comments>http://blogs.southworks.net/jpgarcia/2008/09/01/visual-studio-2008-templates-compliant-with-microsoft-stylecop/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 13:45:12 +0000</pubDate>
		<dc:creator>jpgarcia</dc:creator>
				<category><![CDATA[ASP.Net MVC]]></category>
		<category><![CDATA[Code Quality]]></category>
		<category><![CDATA[StyleCop]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/jpgarcia/?p=38</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/jpgarcia/2008/09/01/visual-studio-2008-templates-compliant-with-microsoft-stylecop/" class="more-link">read more<img src="http://blogs.southworks.net/jpgarcia/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<h2>Motivation</h2>
<p>Since Microsoft launched <a title="StyleCop" href="http://code.msdn.microsoft.com/sourceanalysis" target="_blank">StyleCop</a>, we are running this tool in all <strong>Southworks&#8217;</strong> projects. From our <strong>Engineering Excellence</strong> department we&#8217;re promoting the use of this tool because it give us source code consistency and homogeneity we want for developers and customers who read the code.</p>
<p>If you&#8217;re using this tool, you surely be realized that some <strong>Visual Studio</strong> templates are not compliant with some of the <a title="StyleCop" href="http://code.msdn.microsoft.com/sourceanalysis" target="_blank">StyleCop</a> rules, like using directives inside the namespaces, regions, one class for each file, among others. This is quite annoying when you&#8217;re coding because each class, interface or test you add to your project has to be stylized to meet that rules. </p>
<p>Project templates like <b>ASP.Net Web MVC Application (Preview 5)</b> have an amount of <b>~120</b> warning even avoiding the documentation rules. </p>
<p>The purpose of this post is to give you a workaround to avoid this unnecessary work.</p>
<p><b></b></p>
<h2>Context</h2>
<p>The way that <strong>Visual Studio</strong> provides these templates is by using a series of compressed zip files, with the base source code inside.</p>
<p>There are two folders inside the <em>&#8220;</em><b><em>%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\&#8221;</em> </b>with these templates, one for the items (classes, interfaces, tests, etc.) and one for projects (Class Library, Console Application, MVC Web Application, etc.).</p>
<p><b></b></p>
<h2>Workaround</h2>
<p>The workaround is pretty much straightforward, all you have to do is:</p>
<ol>
<li>Extract the default Visual Studio template files </li>
<li>Modify them to be compliant </li>
<li>Compress it again </li>
<li>and overwrite the original files </li>
</ol>
<p>What I did this weekend, is make the work for you for the most used files and projects for me including the <a title="Microsoft ASP.Net MVC preview 5" href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=16775" target="_blank">Microsoft ASP.Net MVC preview 5</a> project template <img src='http://blogs.southworks.net/jpgarcia/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . So below you&#8217;ll find a table with the zip files to download and the folder location where you will overwrite them.</p>
<p>Once you have copied the files, ensure you&#8217;ve all you Visual Studio instances closed and run as administrator from the console the following command to refresh Visual Studio&#8217;s template cache:</p>
<p><b><i>&#8220;%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\devenv.com&quot; /setup&quot;</i></b></p>
<h2>Template Files</h2>
<p><strong>(*) rootPath = &quot;</strong>%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\&quot;</p>
<table cellspacing="0" cellpadding="2" width="575" border="0">
<tbody>
<tr>
<td style="font-weight: bold;color: #fff" width="231">template path </td>
<td style="font-weight: bold;color: #fff" width="342">template file </td>
</tr>
<tr>
<td style="vertical-align: middle" width="231">
<p><strong>(*)</strong>\ItemTemplates\CSharp\Web\MVC\1033</p>
</td>
<td style="vertical-align: middle" valign="top" width="342">
<ul>
<li><a href="http://blogs.southworks.net/jpgarcia/files/2008/09/mvcviewpageitemtemplatep5cs.zip" target="_blank">MvcViewPageItemTemplateP5.cs.zip</a> </li>
<li><a href="http://blogs.southworks.net/jpgarcia/files/2008/09/mvcviewusercontrolitemtemplatep5cs.zip" target="_blank">MvcViewUserControlItemTemplateP5.cs.zip</a> </li>
<li><a href="http://blogs.southworks.net/jpgarcia/files/2008/09/mvccontrolleritemtemplatep5cs.zip" target="_blank">MvcControllerItemTemplateP5.cs.zip</a> </li>
<li><a href="http://blogs.southworks.net/jpgarcia/files/2008/09/mvcviewcontentpageitemtemplatep5cs.zip" target="_blank">MvcViewContentPageItemTemplateP5.cs.zip</a> </li>
<li><a href="http://blogs.southworks.net/jpgarcia/files/2008/09/mvcviewmasterpageitemtemplatep5cs.zip" target="_blank">MvcViewMasterPageItemTemplateP5.cs.zip</a> </li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align: middle" width="231">
<p><strong>(*)</strong>\ItemTemplates\CSharp\1033</p>
</td>
<td style="vertical-align: middle" valign="top" width="342">
<ul>
<li><a href="http://blogs.southworks.net/jpgarcia/files/2008/09/simpleunittest.zip" target="_blank">SimpleUnitTest.zip</a> </li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align: middle" width="231">
<p><strong>(*)</strong>\ItemTemplates\CSharp\Code\1033</p>
</td>
<td style="vertical-align: middle" valign="top" width="342">
<ul>
<li><a href="http://blogs.southworks.net/jpgarcia/files/2008/09/netcfv2-class.zip" target="_blank">NETCFv2-Class.zip</a> </li>
<li><a href="http://blogs.southworks.net/jpgarcia/files/2008/09/interface.zip" target="_blank">Interface.zip</a> </li>
<li><a href="http://blogs.southworks.net/jpgarcia/files/2008/09/class.zip" target="_blank">Class.zip</a> </li>
<li><a href="http://blogs.southworks.net/jpgarcia/files/2008/09/codefile.zip" target="_blank">CodeFile.zip</a> </li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align: middle" width="231">
<p><strong>(*)</strong>\ProjectTemplates\CSharp\Web\1033</p>
</td>
<td style="vertical-align: middle" valign="top" width="342">
<ul>
<li><a href="http://blogs.southworks.net/jpgarcia/files/2008/09/mvcwebapplicationprojecttemplatep5cs.zip" target="_blank">MvcWebApplicationProjectTemplateP5.cs.zip</a> </li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align: middle" width="231">
<p><strong>(*)</strong>\ProjectTemplates\CSharp\Test\1033</p>
</td>
<td style="vertical-align: middle" valign="top" width="342">
<ul>
<li><a href="http://blogs.southworks.net/jpgarcia/files/2008/09/mvcwebapplicationtestprojecttemplatep5cs.zip" target="_blank">MvcWebApplicationTestProjectTemplateP5.cs.zip</a> </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>You can also download all templates in a single .zip file: <a href="http://blogs.southworks.net/jpgarcia/files/2008/09/alltemplates.zip" target="_blank">AllTemplates.zip</a></p>
<img src="http://feeds.feedburner.com/~r/jpgarcia/~4/DLuRfOOvEYw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.southworks.net/jpgarcia/2008/09/01/visual-studio-2008-templates-compliant-with-microsoft-stylecop/</feedburner:origLink></item>
		<item>
		<title>One year and four months later…</title>
		<link>http://feeds.southworks.net/~r/jpgarcia/~3/oTx1iWBSaF4/</link>
		<comments>http://blogs.southworks.net/jpgarcia/2008/08/31/one-year-and-four-months-later/#comments</comments>
		<pubDate>Sun, 31 Aug 2008 08:59:03 +0000</pubDate>
		<dc:creator>jpgarcia</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/jpgarcia/2008/08/31/one-year-and-four-months-later/</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/jpgarcia/2008/08/31/one-year-and-four-months-later/" class="more-link">read more<img src="http://blogs.southworks.net/jpgarcia/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p align="right"><a title="Spanish Version" href="http://www.jpgarcia.com.ar/index.php/2008/08/30/un-ao-y-cuatro-meses-despus/" target="_blank">Spanish Version</a></p>
<p>Yesterday night while drinking a couple of beers with some of my Southworks&#8217; colleagues, I returned back to my home and being lying on my bed, I started to think on this last year and four months from when I began working in <strong>Southworks</strong>.</p>
<p>While I was dating back over time, I remembered in which projects and customers we were worked for, some of them are &#8220;<a href="http://msdn.microsoft.com/en-us/architecture/default.aspx">Microsoft Architecture Strategy Team</a>&#8221;, &#8220;<a href="http://www.federaldeveloper.com/default.aspx">Microsoft Depeloper &amp; Platform Evangelism Team</a>&#8221;, &#8220;<a href="http://www.microsoft.com/serviceproviders/solutions/connectedservicesframework.mspx">Microsoft Connected Services Framework Team</a>&#8221;, &#8220;<a href="http://msdn.microsoft.com/en-us/sqlserver/default.aspx">Microsoft SQL Server Team</a>&#8221;, &#8220;<a href="http://www.sancorseguros.com/">Grupo Sancor Seguros</a>&#8221; among others, and the important people who I known in person like <a href="http://blogs.msdn.com/eugeniop/">Eugenio Pace</a> y <a href="http://blogs.msdn.com/gianpaolo/">Gianpaolo Carraro</a>.</p>
<p>Words and technical acronyms came to my mind regarding things I have being acquired and incorporated during this time. So, in this moment I started to imagine something like a mental <b>&#8220;Tag Cloud&#8221;</b> and it was there when I decided to write this post with the objective of leaving this as a log experience and to compare it in the future with the new words that surely will be added.</p>
<p>Beside all tags am I listing in this post, I wanted to thank all <strong>Southies</strong> who were helping me to fill my mind with all this knowledge and specially to my two mentors, which are <b><a href="http://blogs.southworks.net/jhalife">Johnny Halife</a></b> y <b><a href="http://blogs.southworks.net/mwoloski/">Matias Woloski</a> </b>who today I still admiring and respecting, but the ones who I having fun where the computer aren&#8217;t close to us.</p>
<p>Here is my <strong>&quot;Mind Tag Cloud&quot;</strong>:</p>
<p><span style="font-size: 14px">&#160; Refactoring&#160; </span><span style="font-weight: bold;font-size: 18px">&#160; Code Analysis&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; Retrospective&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; TDD&#160; </span><span style="font-size: 17px">&#160; WCF&#160; </span><span style="font-weight: bold;font-size: 19px">&#160; WSDL&#160; </span><span style="font-size: 14px">&#160; Continuous Integration&#160; </span><span style="font-size: 17px">&#160; Patterns&#160; </span><span style="font-size: 14px">&#160; Cluster Server&#160; </span><span style="font-size: 14px">&#160; ISO&#160; </span><span style="font-size: 13px">&#160; Virtualization&#160; </span><span style="font-size: 12px">&#160; SOA&#160; </span><span style="font-size: 14px">&#160; Singleton&#160; </span><span style="font-weight: bold;font-size: 18px">&#160; Cyclomatic Complexity&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; WPF&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; Model View Controller&#160; </span><span style="font-weight: bold;font-size: 18px">&#160; REST&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; Linq to XML&#160; </span><span style="font-size: 13px">&#160; Mocks&#160; </span><span style="font-size: 12px">&#160; Paravirtualization&#160; </span><span style="font-weight: bold;font-size: 18px">&#160; Sprint&#160; </span><span style="font-size: 12px">&#160; Hyper-V&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; Lamda Expressions&#160; </span><span style="font-weight: bold;font-size: 18px">&#160; Repository&#160; </span><span style="font-size: 17px">&#160; SAN&#160; </span><span style="font-weight: bold;font-size: 18px">&#160; Synchronization Framework&#160; </span><span style="font-size: 14px">&#160; iSCSI&#160; </span><span style="font-size: 13px">&#160; LUN&#160; </span><span style="font-weight: bold;font-size: 18px">&#160; Powershell&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; SCRUM&#160; </span><span style="font-size: 17px">&#160; Ssds&#160; </span><span style="font-weight: bold;font-size: 18px">&#160; Agile&#160; </span><span style="font-size: 12px">&#160; Spike&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; NAS&#160; </span><span style="font-weight: bold;font-size: 18px">&#160; Iteration Planning&#160; </span><span style="font-size: 14px">&#160; Dependency Injection&#160; </span><span style="font-size: 16px">&#160; Factory&#160; </span><span style="font-weight: bold;font-size: 18px">&#160; Linq to SQL&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; Code Coverage&#160; </span><span style="font-size: 12px">&#160; Subversion&#160; </span><span style="font-size: 17px">&#160; Security Token Service&#160; </span><span style="font-size: 14px">&#160; CMMi&#160; </span><span style="font-size: 19px">&#160; StyleCop&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; Model View Presenter&#160; </span><span style="font-size: 12px">&#160; Strategy&#160; </span><span style="font-size: 19px">FxCop&#160; </span><span style="font-size: 14px">&#160; Serialization&#160; </span><span style="font-size: 12px">&#160; Apache&#160; </span><span style="font-size: 17px">&#160; Prototype&#160; </span><span style="font-size: 13px">&#160; Datamember&#160; </span><span style="font-size: 14px">&#160; Composite Application Block&#160; </span><span style="font-size: 12px">&#160; Build Server&#160; </span><span style="font-size: 17px">&#160; RSS&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; DIT&#160; </span><span style="font-size: 14px">&#160; S+S&#160; </span><span style="font-size: 13px">&#160; Backlog&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; Commitment&#160; </span><span style="font-weight: bold;font-size: 18px">&#160; Inversion Of Control&#160; </span><span style="font-size: 14px">&#160; Scaffolding&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; Abstract Factory&#160; </span><span style="font-size: 12px">&#160; Reflection&#160; </span><span style="font-size: 13px">&#160; LCOM&#160; </span><span style="font-size: 17px">&#160; Iteration Review&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; Software As A Service&#160; </span><span style="font-size: 17px">&#160; DataContract&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; TFS&#160; </span><span style="font-weight: bold;font-size: 19px">&#160; Code Query Language&#160; </span><span style="font-weight: bold;font-size: 16px">&#160; SOAP&#160; </span><span style="font-size: 17px">&#160; Dynamic Language Runtime&#160; </span><span style="font-size: 12px">&#160; Lightweight Directory Services&#160; </span></p>
<img src="http://feeds.feedburner.com/~r/jpgarcia/~4/oTx1iWBSaF4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.southworks.net/jpgarcia/2008/08/31/one-year-and-four-months-later/</feedburner:origLink></item>
		<item>
		<title>Avoiding duplicated items in Fxcop analysis using MSBuild</title>
		<link>http://feeds.southworks.net/~r/jpgarcia/~3/Rf21XS6GJj4/</link>
		<comments>http://blogs.southworks.net/jpgarcia/2008/07/13/avoiding-duplicated-items-in-fxcop-analysis-using-msbuild/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 06:18:01 +0000</pubDate>
		<dc:creator>jpgarcia</dc:creator>
				<category><![CDATA[Code Quality]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[MSBuild]]></category>
		<category><![CDATA[Southworks SDC Tasks]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/jpgarcia/2008/07/13/avoiding-duplicated-items-in-fxcop-analysis-using-msbuild/</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/jpgarcia/2008/07/13/avoiding-duplicated-items-in-fxcop-analysis-using-msbuild/" class="more-link">read more<img src="http://blogs.southworks.net/jpgarcia/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://blogs.southworks.net/jpgarcia/2008/07/11/updating-your-assembly-info-files-with-southworks-sdc-tasks/" target="_blank">previous post</a>, I started with a posts series that describe the tasks we&#8217;ve included in the <a href="http://code.google.com/p/sdctasks/" target="_blank">Southworks SDC Tasks</a> we recently published at <strong>Google Code</strong>.</p>
<p>Today, I&#8217;m going to focus in a useful and interesting task which is <strong>RemoveDuplicatedFileNames </strong>and the reason of why we had the need to create it.</p>
<p>So let&#8217;s start.</p>
<h2>The Problem</h2>
<p>Imagine you have a solution where your assemblies are referenced as depicted in the picture below:</p>
<p><a href="http://blogs.southworks.net/jpgarcia/files/2008/07/image2.png"><img height="261" alt="image" src="http://blogs.southworks.net/jpgarcia/files/2008/07/image-thumb2.png" width="281" /></a> </p>
<p>When you compile this solution you&#8217;ll realize that the <strong>Contracts.dll</strong> assembly will be generated into the <strong>Services</strong> and in <strong>WebUx </strong>folders, that&#8217;s right?</p>
<p>So far, there is no problem regarding compilation, but what happens if we define an ItemGroup in our MSBuild project that includes all our solution assemblies to be examined by FxCop by using WildCards like this?</p>
<div>
<div style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">ItemGroup</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">  <span style="color: #0000ff">&lt;</span><span style="color: #800000">Assemblies</span> <span style="color: #ff0000">Include</span><span style="color: #0000ff">=&quot;$(SampleDirectory)\**\*.dll&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">ItemGroup</span><span style="color: #0000ff">&gt;</span></pre>
</p></div>
</div>
<p>The answer is that FxCop will analyze the same assembly twice, which will generate duplicated warnings and Code Analysis errors.</p>
<h2>Our solution approach</h2>
<p>As I told you previously we created a simple task called <strong>RemoveDuplicatedFileNames </strong>that basically remove items from an ItemGroup on the MSBuild process, to avoid the problem described above.</p>
<p>So let me show you how you should configure your project file to use this task</p>
<ol>
<li>Reference the <a href="http://code.google.com/p/sdctasks/" target="_blank">Southworks SDC Tasks</a> assembly <strong>RemoveDuplicatedFileNames </strong>in your project file
<div>
<div style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">UsingTask</span> <span style="color: #ff0000">AssemblyFile</span><span style="color: #0000ff">=&quot;$(ToolsPath)\Southworks.Sdc.Tasks.dll&quot;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">           <span style="color: #ff0000">TaskName</span><span style="color: #0000ff">=&quot;RemoveDuplicatedFileNames&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
</p></div>
</p></div>
</li>
<li>Create your ItemGroup including your assembly files
<div>
<div style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">ItemGroup</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">  <span style="color: #0000ff">&lt;</span><span style="color: #800000">Assemblies</span> <span style="color: #ff0000">Include</span><span style="color: #0000ff">=&quot;$(SampleDirectory)\**\*.dll&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">ItemGroup</span><span style="color: #0000ff">&gt;</span></pre>
</p></div>
</p></div>
</li>
<li>Inside the target that runs FxCop include the following lines
<div>
<div style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">RemoveDuplicatedFileNames</span> <span style="color: #ff0000">Input</span><span style="color: #0000ff">=&quot;@(Assemblies)&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">  <span style="color: #0000ff">&lt;</span><span style="color: #800000">Output</span> <span style="color: #ff0000">TaskParameter</span><span style="color: #0000ff">=&quot;FilteredItems&quot;</span> </pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">          <span style="color: #ff0000">ItemName</span><span style="color: #0000ff">=&quot;<span>CodeAnalysisItems</span>&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">RemoveDuplicatedFileNames</span><span style="color: #0000ff">&gt;</span></pre>
</p></div>
</p></div>
</li>
<li>Finally, instead of using the <strong>Assemblies </strong>defined in the first point, you should use the new filtered ItemGroup generated in the previous point
<div>
<div style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">FxCop</span> <span style="color: #ff0000">Assemblies</span><span style="color: #0000ff">=&quot;@(<span>CodeAnalysisItems</span>)&quot;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">       <span style="color: #ff0000">OutfileName</span><span style="color: #0000ff">=&quot;$(CCNetArtifactDirectory)\fxcop.xml&quot;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">       <span style="color: #ff0000">ProjectFilePath</span><span style="color: #0000ff">=&quot;$(CCNetArtifactDirectory)\project.fxcop&quot;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">       <span style="color: #ff0000">ToolPath</span><span style="color: #0000ff">=&quot;$(FxCopPath)&quot;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">       <span style="color: #ff0000">ProjectTemplateFilePath</span><span style="color: #0000ff">=&quot;$(ToolsPath)\template.fxcop&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
</p></div>
</p></div>
</li>
</ol>
<p><strong>Note</strong>: The FxCop task is not part of <a href="http://code.google.com/p/sdctasks/" target="_blank">Southworks SDC Tasks</a>, you can get it from the <a href="http://www.codeplex.com/sdctasks/" target="_blank">Microsoft SDC Tasks</a> at Codeplex. There are many useful tasks for your build process!</p>
<h2>Verification</h2>
<p>in order to verify if your assemblies are no duplicated you should add a <strong>Message</strong> task on the same target to display the contained values on both <strong>ItemGroup</strong>, <strong>Assemblies</strong> and <strong>CodeAnalysisItems</strong>.</p>
<div>
<div style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Message</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;Unfiltered Assemblies&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Message</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;=====================&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Message</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;@(Assemblies)&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace">&#160;</pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Message</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;Filtered Assemblies&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Message</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;===================&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, &#39;Courier New&#39;, courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Message</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;@(CodeAnalysisItems)&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
</p></div>
</div>
<p><a href="http://technorati.com/claim/rjaizdjqx2" rel="me">Technorati Profile</a></p>
<img src="http://feeds.feedburner.com/~r/jpgarcia/~4/Rf21XS6GJj4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss />
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.southworks.net/jpgarcia/2008/07/13/avoiding-duplicated-items-in-fxcop-analysis-using-msbuild/</feedburner:origLink></item>
	</channel>
</rss>

