IUnknown
Windows Azure mumblings of IUnknown

I've taken up typing

Last week I was neck deep into some code + good ol SQL and it was a serious jam! I knew mighty well the thing cooking in my head but the hands have mind of their own. It dawned on me that I am a terrible typist. Had I known how to touch type I could have accomplished a lot more without having to slog the weekend.

Now most the people who know me would say I type pretty fast but unfortunately It's just a five finger varant of Hunt and Peck as its equally bad. My fingers know a little bit about the keyboard layout from more than ten years of typing however, all ten of them hardly ever work in tandem.

Technomad Prafulla and I have been together for more than a decade now. The man has taken professional typing lessons even before computing "happened" to both us. I used to make fun of him back then about this, but boy was I WRONG!

This had to change! And then the hunt for skills improvement began, I was looking for developers who are equally good typists. And by good I don't mean 40wpm good. I mean 60wpm and above good. None Nada Zilch at the workplace. Time to check my "extended" workplace, the internet and first thng I find is this life changing post by none other than Codinghorror, Jeff Atwood. This pointed me to another acridly honest comment on non-typist programmers by Steve-Yegge and here I am a "Convert" so to say.

I am sure there would be many like me who'd want to learn to touch type like the pros and let the mind do what it does best Imagine, Think, Create. Whenever I try to do something creative I set out with a pen and paper (yeah right engadget). This gives my mind the creative freedom I love. While writing my fingers don't have to think, they write. And help me think!

 

The Plan

The plan is to spend an hour each day. For starters it'll be at TypingOnline a UK based site that assists improve your typing skills. Once I feel at home with typing without looking at the keyboard then I'll move to a better and more hardcore training course and maybe some typing games too.

<PlaceHolder for better suggestion out of my learning experiences>

 

The Hardware

Since I am in India, a land of snake charmers and elephant riders who are happy with whatever incompetent IT retailers throw at us I am going to pick the only mechanical keybard avaialbe out there. The TVS-e Gold, they've renamed it to TVS-e Bharat USB. It's gonna be noisy, but I'll live with that till i can find something eqally good and less noisy.

Do pour in with what you think about all this "Getting Better" plan.



  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Force.com presents Database.com SQL Azure/Amazon RDS unfazed

At the DreamForce 2010 event in San Francisco Force.com unveiled their next big thing in the Fat SaaS portfolio "Database.com". I am still wondering how would they would've shelled out for that domain name.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Virtualization demystified (source: AnandTech)

A fantastic set of Q and A on and around virtualization by some of the 'folks in the know'. The guys that (un?)arguably understand the virtualization business better than anyone else. Intel Fellow, Rich Uhlig and VMWare Chief Platform Architect, Rich Brunner and of course the man himslef, Anand Lal Shimpi.

http://www.anandtech.com/show/3827/virtualization-ask-the-experts-1

http://www.anandtech.com/show/3831/virtualization-ask-the-experts-2

 



  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Excellent Windows Azure benchmarks

The Extreme computing group has released a fairly comprehensive set of benchmarks  for almost all aspects of WA. They have also provided the source code to alleviate all doubts that may surface with the MSFT logo lurking around the top right of their homepage :) (Which also resides at a cloudapp.net url).


The code is simple and the tests comprehensive enough to hold as data points for customer interactions. Add to it the clean no nonsense Silverlight charts to render the benchmarks and you are set to sell.



  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

No Clipboard support in Windows Phone 7 Series – iPhone points laughs

What exactly were you taking of late MSFT? So much for a spanking new mobile OS which wants to emulate the iPhone OS so badly that it even copied and pasted the iPhone’s erstwhile lack of clipboard support as well? The reason given is so lame (shall I say differently able?) that deserves pity rather than lament.

According to MSFT people don’t use the clipboard that often. Being a WinMo user for the better part of my life and having developed for the platform for worse part of it I could say with conviction that Clipboard support was one key differentiator which kept me away from “The Phone to have” of 2007-8-9. Let me try to find few use cases I for one have been using the clipboard.

  1. Copy files to and from card and phone memory.
  2. Copy images, audio files from apps/browsers/explorer to email other apps.
  3. Copy text to/from word documents, notes and emails.
  4. Copy content from network drives to memory card.
  5. Copy links between browsers (Yes i did it for the love of Opera and PIE alike).

Others could definitely come up with more. So who are these so called “users” who provided feedback to MSFT that the clipboard is useless? If you are among the lucky few being asked for the “feedback” kindly chime in the comments. Would be interesting to see different views on this.



  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

LinqPad with Azure Table Storage

LinqPad as we all know has been a wonderful tool for running ad-hoc queries. With Windows Azure Table storage in picture LinqPad was no longer in picture and we shifted focus to Cloud Storage Studio only to realize the limited and strange querying capabilities of CSS. With some tweaking to Linqpad we can get the comfortable old shoe of ad-hoc queries with LinqPad in the Windows Azure Table storage.

Steps:

1. Start LinqPad

2. Right Click in the query window and select “Query Properties”

3. In The Additional References add reference to Microsoft.WindowsAzure.StorageClient, System.Data.Services.Client.dll and the assembly containing the implementation of the DataServiceContext class tied to the Windows Azure table storage.

4. In the additional namespace imports import the same three namespaces mentioned above.

5. Then we need to provide following details.

a. Table storage account name and shared key.

b. DataServiceContext implementing class in your code.

c. A LINQ query.

e.x.

        var storageAccountName = "myStorageAccount"// Enter valid storage account name

        var storageSharedKey = "mysharedKey"; // Enter valid storage account shared key

        var uri = new System.Uri("http://table.core.windows.net/");

        var storageAccountInfo = new CloudStorageAccount(new StorageCredentialsAccountKey(storageAccountName, storageSharedKey), false);

        var serviceContext = new TweetPollDataServiceContext(storageAccountInfo); // Specify the DataServiceContext implementation

        // The query

        var query = from row in serviceContext.Table

                    select row;

        query.Dump();

Thanks LinqPad!



  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Ping.eu

Found an interesting resource thanks to a close friend. Ping.eu is a free service which would let you test various aspects related to networks which would typically be pain inducing doing it on your own. For seasoned network professional having a MAC address of their own instead of a name :) this might not be that useful. However for a layperson like me this an invaluable resource.

These guys provide you with following services:

Ping – Shows how long it takes for packets to reach host

Traceroute – Traces the route of packets to destination host from our server

DNS lookup – Look up DNS record

WHOIS – Lists contact info for an IP or domain

Port check – Tests if port is opened on specified IP

Reverse lookup – Gets hostname by IP address

Proxy checker – Detects a proxy server

Mail relaying – Tests relaying capabilities of specified mail-server

Bandwidth meter – Detects your download speed from our server

Network calculator – Calculates subnet range by network mask

Network mask calculator – Calculates network mask by subnet range

Country by IP – Detects country by IP or hostname

Unit converter – Converts values from one unit to another

 

Taken straight from their site.

Thanks Ping.eu



  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Firefox for NTLM secured sites

Spent the last weekend fighting to get firefox to connect to a sharepoint portal hosting my homegrown TFS instance's TFS/WEB and team project portal from a friends' place.Firefox is THE favourite browser and I was hating to se it fail miserably with NTLM authentication.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Thou Shalt not Iterate! : Part 2

Last time we saw some interesting initialization constructs possible with LINQ. Hope some of you have tried it out. If not, it’s never too late. LinqPad is a good friend in need.

This time around we’d take a look at two common looping scenarios.

1. Looking up an object by name:

Object lookup is commonplace while dealing with collections. Let’s look for an object with a given name. Previously we’d run a for each and come up with something like.

public MyObject FindByName(string value)
 
{
 
foreach (MyObject obj in objects)
 
if (obj.Name == value)
 
return obj;
 
return null;
 
}
 

With LINQ this could be simplified to.

public MyObject FindByName(string value)
return (objects.Where(obj => obj.Name == value).FirstOrDefault());
 
  // Chose First or FirstOrDefault depending on probability of getting a no match. 
 
// Wise choice here would help reducing exception handling semantics
 
}
 

2. Changing a property of some/all elements in a collection:
We often need to change a property for some/all elements in a collection. E.g. Changing the background of all TextBoxes on a form. This could be worded as “Changing the BackColor property of all Controls of type TextBox on a Form)

In the days bygone (Not exactly bygone yet :)) we’d use something like:

public void ColorTextBoxes()
{
    // Loop through all controls on the form.
    foreach (Control ctrl in this.Form.Controls)
    {
        // Ensure it is a TextBox.
        if (ctrl is TextBox)
        {
            // Cast to a TextBox and make the background Windows Azure.
            ((TextBox)ctrl).BackColor = System.Drawing.Color.Azure;
         }
    }
}

With LINQ we could conjure up something like

public void ColorTextBoxes() 
{ 
    (from control in this.Form.Controls.Cast<Control>() where control is TextBox select control).ToList().ForEach(t => ((TextBox)(t)).BackColor = System.Drawing.Color.Azure);
}

The query looks cryptic to start, however if you look closely its fairly straightforward. We’d first cast the ControlCollection to an IEnumerable of Controls with the Cast<>() extension. Then we filter only the TextBoxes with where.  Then we use ToList() to expedite query processing otherwise lazy evaluation would be used. Then the List.ForEach() would iteratively process the parameter statement which simply changes the BackColor property of TextBox to Windows Azure.



  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Thou Shalt not Iterate! : Part 1

LINQ as we all know provides intrinsic data querying capabilities to the framework languages supporting LINQ. Going forward its an obvious way to code clean, and with growing number of LINQ providers (LINQ to SQL, LINQ to Entities, LINQ to XML, LINQ for Maps, and not to forget DryadLinq and pLinq for us Cloudy folks’ Parallel Computing needs, and so on) it looks to be the de facto standard for querying within dotnet framework languages. 

Let us get acquainted to LINQ by taking a close look at the beauty and simplicity of LINQ, instead of getting into technical nitty-gritty’s. 

We can start off with simple scenarios where we inherently use loops and replace the codes with LINQ equivalents. Going forward we can include complex looping operations in growing order of complexities. 

To kick off let’s look at some interesting Linq alternatives to de-rigueur C# code:

 

 //Initialize an array with 10 as default value 

 //Loop
int[] iArr = new int[11];
for(int i = 0; i < 11; i++)
{
   iArr[i] = 10;
}

 //LINQ
int[] iArr = Enumerable.Repeat(10, 11).ToArray();  

//Fill an array with 1 to 100

//Loop
int[] iArr = new int[100];
for(int i = 1; i < 101; i++)
{
   iArr[i-1] = i;
}

//LINQ
int[] iArr = Enumerable.Range(0, 100).ToArray();

 

//Fill an array with 100, 150, 200, 250, ..... upto 100 Terms

//Loop
int[] iArr = new int[100];
for (int i = 0; i < 100; i++)
{
    if (i != 0)
    {
         iArr[i] = iArr[i-1]+50;
    }
    else
    { 
        iArr[i] = 100;
    }
}

 //LINQ
int[] c = Enumerable.Range(0, 100).Select(i => 100 + 50 * i).ToArray();

Feel free to provide valuable feedback about the kind of content you expect in this initiative.

PS: Thanks to Nathan Kelly, this post stands corrected.



  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati