Thursday, July 03, 2008

Last few days there has been buzz around Adobe's announcement of collaboration with Google and Yahoo! to improve the ability of search engines to index Flash files better - which are normally .SWF binary files. Instead of coming with open XML based file formats Adobe has chosen to offer an "optimised" (basically a server component) version of Flash Player that sits on a search engine's server and checks for Flash at the same time as HTML.

Compare this with Microsoft's Silverlight. Silverlight applications are packaged in a XAP file (which are simply a zip) format and any static textual content is in the XAML files. XAML files are nothing more than a well-defined XML file, this means even today without any special API search engines can index Silverlight Applications. In addition Silverlight apps supports deep linking which is important for facilitating relevance, very much like HTML's nested links concept. For more details see this post here by Microsoft's Nikhil Kothari on how Silverlight by design is Search Engine friendly.

Anyways, this is a very important step that Adobe that has announced. Flash is currently the entrenched player in the RIA space having more than 95% of market share. This has resulted in enormous amount of content being out there in the Web in Flash file formats. These have been so far out of reach of Search Engines and any attempt by Adobe to make it reachable is welcome. And any competition here between Adobe and Microsoft is also a welcome one.

 
Tuesday, July 01, 2008

Few weeks back I was with a developer doing a code-review for one of his application. The application was a Windows Forms Application written in C# that monitors several running jobs and reports on any event/failure found in the log file.

Many gaps came up in the review which made me thinking (me thinking is surprising isn't it), hence this post. The abstractions in the form of frameworks and IDEs that are available today make programming definitely accessible but at what cost. Do they make a formal (structured) learning of programming unnecessary?. Are today's engineers getting away by not following any coding disciplines like the one's enforced by my mentor(s) and teachers when I learned programming. Before I continue this rattle and list the items let me clarify, I am not intending this post to be a comprehensive check list - it just happens to be the issues I noticed in this particular incident. I have grouped few of my findings in sections.

Reading a configuration file

  • When reading a configuration file (like .config/xml) to load values, validate whether the file exists. If file is not present either load default values and proceed  (or) exit gracefully. Having a simple try/catch  block doesn't mean you have handled all exceptions and you no further work
  • Try not to read the entire file to memory. In .NET this will be for example using StreamReader.ReadToEnd method. Think about what will happen if you the file has been corrupted or wrongly replaced with a 10GB video file. You will crash the machine by running out of memory. In typical configuration files especially for your applications you can identify the maximum likely size which will be say few MBs. So in .NET try to use StreamReader.ReadLine for as many lines as you will need
  • Similarly don't load the entire XML into XMLDOM (like by using XmlDocument) where it is not necessary. Instead try to use XmlReader which is a stream based XML processor and doesn't take up memory (many times of the full XML filesize)

UI Related items

  • While designing design the work flow and the steps with the user of the application in mind. Think about the likely steps the user will follow. Do not design with your code flow as the steps. In this application this meant not having to select a configuration file and global settings screen as first step in the Tab order. Instead have the first screen after application launch as the one the user will use repeatedly

In an earlier project I gave the complete UI design specification in Visio format to a developer that avoided all the iterations and confusions. You can read about that in this earlier post.

 
Friday, June 20, 2008

In the last two to three quarters we are seeing a huge surge in SharePoint projects and as a result the demand of SharePoint developers is sky rocketing. Initially we were thinking this to be a local (India) phenomena but when I talk to many of my contacts in the industry worldwide and check out articles in the Internet, it turns out to be a worldwide phenomena.

Below are some random resources on SharePoint that might be useful for developers:

 
Wednesday, June 11, 2008

I have come across Developers and System Engineers who have trouble with networking time and again. The principle reason I have observed is a lack of thorough understanding of the underlying TCP/IP layer. Most engineers assume that if they know what is an IP Address, Subnet and DHCP they know networking. How wrong can they be?. This gets more complicated with the introduction of IPv6,  Security and Performance features newly introduced in Windows Vista and Windows Server 2008.

Till now the hurdle in solving this was availability of easily accessible and digestible materials on the subject. Today thanks to one of my fellow MVPs who pointed me to this resource from Microsoft - a free book on "TCP/IP Fundamentals for Windows". It is available both for online viewing and downloadable as a PDF file. Don't let the 559 page count scare you, the book is easily readable with some effort. I highly recommend downloading the PDF file and saving - it will be a worthy reference.

 
Friday, May 23, 2008

Last few days I had a firewall issue in my desktop that made web browsing irregular. It was a peculiar problem, I was able to browse few sites like Google, Vishwak.COM but not others. I had to keep running the same diagnostic commands many times to take values to be sent to my support team. Finally I ended up writing this handy tool that copies to clipboard diagnostic informations from IPConfig, Tracert, Ping & WebGet commands. This information can be used for further investigation or email to support. I also added features to FlushDNS, Renew IP & Turn Auto Tuning (Vista and Windows Server 2008) OFF/ON.

diagnose tool screenshot

While developing the tool over two half-a-days I learnt quite a few APIs and a bit of C# coding. This included how to call a console command like IPCONFIG /ALL and capture the output to a string from a C# application, get the Internet Explorer Proxy settings, Call Network Properties applet, create an install with VS 2008 & how to paste a code snippet in WLW.

   1: private string DoConsoleAndCapture(string sInput)
   2: {
   3:  
   4: string sOutput = "";
   5: ProcessStartInfo pi = new ProcessStartInfo("cmd.exe", "/c " + sInput );
   6: pi.WindowStyle = ProcessWindowStyle.Minimized; 
   7: pi.RedirectStandardOutput = true;
   8: pi.UseShellExecute = false;
   9: Process p = Process.Start(pi);
  10: p.WaitForExit();
  11: //p.Start();
  12: TextReader t = p.StandardOutput;
  13: sOutput = t.ReadToEnd();
  14: t.Close();            
  15: p.Close();
  16:  
  17: return sOutput; 
  18: }

The experience of using Visual Studio 2008 was interesting as it has been few years since I coded something end to end. I wish the coding surface to become more intelligent in terms of offering help on discovering commands and APIs that the developer is looking for. When VB6 came a decade or so back the help feature that it had was revolutionary and the wealth of information MSDN provided was without par in the industry. Now with Web & Internet Search prevalent the present IDE calls for a complete rethinking and revamp - unfortunately I don't feel the tools have come there yet. What I am talking here is not about wizards, smart tags or even intellisense but about how the tool helps a developer to learn/discover necessary APIs/solve the problem at hand.

 
Monday, January 21, 2008
 MVP Award 2008

MVP Award for the year 2008
 MVP Award 2007
MVP Award for the year 2007

I have been a Microsoft Regional Director (RD) from 1999 and I am happy to write here that Microsoft has renewed me as an RD for another two years. The RD program is a honorary title conferred to select professionals around the world who are passionate on Microsoft technologies. Over 140 software architects, developers, trainers and other professionals are selected by Microsoft as Regional Directors. The first thing to know is that, while we’re officially recognized by Microsoft and often receive inside information about forthcoming technologies, we are completely independent. We are not Microsoft employees.

Apart from being a RD, last year (2007) I was named as a Microsoft Most Valuable Professional (MVP) as well. I was given MVP in the category of Visual Developer - Solutions Architect. Recently, I was renewed as a MVP for this year as well. This entitles apart from other benefits, membership to a very lively exclusive email alias participated by all MVPs.  You can check out my MVP Profile here.

 
Tuesday, December 25, 2007

Microsoft recently announced their new virtualization technology  "Hyper-V" (codename Viridian) as part of Windows Server 2008 that will replace Microsoft Virtual Server 2005. I wanted to understand the differences between the two virtualization products and how to use Hyper-V. In my search, I came up with the following list of references and understandings.

Rough Technology differences between Hyper-V and earlier products:
One way to think about these new chip technologies is that they introduce a “-1” ring essentially to the usual four rings in the x86 CPU architecture. With the VPC and Virtual Server offerings, they use a trick called ring compression where the kernel of the VM is placed into Ring 1, instead of the expected Ring 0. This is so that the host can absolutely ensure that VMs are running in their own sandbox and can’t gain access to any resources of the host or other VMs. There is something like 14-17 CPU instructions in the x86 instruction set that can’t be executed directly because of sandbox violation. Hence, the need to place the child VM’s kernel into Ring 1 so that the host can place itself in Ring 0 to intercept those calls to protect them directly or to emulate them. By introducing a “-1” ring, the hypervisor lives here and controls the access to the various virtual machines. So, with the introduction of a hypervisor living in ring -1, the need for ring compression of child VMs is essentially removed. At least, this is one way to think about. They hypervisor itself is not a complete OS, per se. The hypervisor is a VERY thin and small, trusted computing base.

Hyper-V, codenamed Viridian Architecture from Wikipedia Technical References:

 

VM Additions for Linux

Earlier Microsoft Virtual PC and Microsoft Virtual Server 2005 didn't have VM Additions for Linux, recently Microsoft released fully supported VM Additions for Linux (Download from here).

 
Thursday, December 06, 2007

I was in lookout today for a small footprint / compact / embedded database engines suitable for .NET applications (mainly web) and found the following candidates. This is just a list compiled from the Internet.

  1. Microsoft Access (JET Engine) - Very Popular from Windows 3.1 days due to the fact it is out-of-box in most versions of Windows OS.
  2. Microsoft SQL Server 2005 Express - The plus here is that it is easy to upgrade to full-fledged SQL Server as Express edition uses the same file format and is binary compatible. Also ships with a free management tool "SQL Server Management Studio"
  3. Microsoft SQL Server 3.5 Compact - Can be embedded easily with less than 2MB in distribution size. Works with Windows Mobile as well.
  4. SQLite - A free / no license extremely lightweight Database engine which is less than 250KB in distribution size. There is no server process that needs to be started, stopped, or configured here. A detailed article here.
  5. VistaDB - Quite popular, 3rd party, commercial Database Engine that can be easily embedded. Written in NET Managed Code.

In the above list, other than VistaDB all the other are free (as in free beer) to deploy/distribute.

 
Friday, November 30, 2007

My everyday work laptop is a lightweight Sony Vaio TX57GN around 1.25Kg, having a Core Solo CPU, 1.5GB RAM, 4200RPM HDD, Vista its speed is sub-optimal and I can only use it for email and browsing. Even then I am not complaining and actually I love it especially on my travels. This changes when I have to do demos (customer presentations or Microsoft events) I got to run multiple virtual machines and at that time CPU muscle, RAM and Speed are crucial. So few months back I decided to buy a second laptop for demos alone and eventually settled down on Dell Vostro 1400. That was the time (August '07) Dell had introduced Vostro series in USA, the price of USD 1740 (with taxes) for the configuration was attractive so I immediately purchased it and got it through one of my colleagues coming to India.

Dell Vostro 1400 configuration

  • Vostro 1400, Intel Core 2 Duo T5470, 1.6GHz, 800Mhz FSB 2M L2 Cache
  • 14.1 inch Wide Screen XGA LCD
  • 4GB, DDR2, 667MHz
  • Mobile Intel 965 Express Chipset
  • Intel Integrated Graphics Media Accelerator X3100
  • 160GB 7200RPM SATA Hard Drive
  • Windows Vista Business    
  • 24X COMBO CD-RW/DVD for Vostro
  • Dell Wireless 1390 802.11g
  • Warranty Support, 2 Year Extended

The laptop scores good on Vista Benchmarks and performs well with multiple VPCs and Vista Aero interface. Dell shipped the laptop (strangely) with Vista 32Bit OS, so it showed only 3.5GB of RAM. This week I decided to upgrade the machine to Vista x64, so I got it formatted and installed Vista Ultimate x64. Now the laptop shows 4GB RAM, but most of the devices (as expected) were not installed with drivers. Luckily Wi-Fi worked and after running Windows Update which download 150MB of 42+ updates and a reboot, most of the devices including Graphics card got installed. The Ethernet card proved tricky with no drivers available either from Microsoft's Windows Update or from Dell support site. Dell doesn't provide drivers for Windows x64 OS for any of the devices in their Vostro series Laptop. After some searching I found the driver from Broadcom's support site for the LAN card and now everything is working fine.

Download Vista x64 Ethernet Driver for Dell Vostro 1400 laptop from here.

 
Monday, November 19, 2007

I came across these two references today.

One was Web Browser Standards Summary that summarizes the level of support for web standards and maturing technologies in popular web browsers. It covers the Internet Explorer, Firefox, and Opera web browsers, with focus on the HTML, CSS, DOM, and ECMAScript technologies.

Web Browser Standards Summary

Second one is the Audio interview with Chris Wilson, the Platform Architect for Internet Explorer at Microsoft. "Chris has been building web browsers for as long as there have been web browsers, and it was a pleasure to sit down with him at the end of the final day of the conference. In his talk at the conference, Moving the Web Forward, Chris gave the audience a glimpse into the realities of developing the most popular web browser in the world. With over 500,000,000 users to answer to, the words Don’t break the Web have become an overriding mantra for the company in its work to develop the next version of Internet Explorer (currently known as IE.Next)".

 
Saturday, November 17, 2007

Microsoft announced recently a new Sync Framework. This is a CTP release that is targeted for release in Q2 2008 and it supports P2P and Online/Offline synchronization of data. Currently though customers require Outlook like Offline/Online Sync scenario, it means developers doing custom coding. The Sync Framework is claimed to support P2P sync of any type of file including contacts, music, videos, images and settings. And has built-in support for synchronizing relational databases, NTFS/FAT file systems, Simple Sharing Extensions for RSS/ATOM, devices and web services.

I welcome having a standard framework for doing this repetitive job, it also removes the complexity of handling multiple connection types, scenarios, fail over, retry, etc. Download CTP from here.

image

 
Friday, September 14, 2007

If you are a web developer you might be familiar with the great free tool - Firebug. Firebug is an add-on for Mozilla Firefox that allows you to easily inspect the HTML DOM/CSS for a page, edit them inplace and many other useful tricks. Recently I came across another useful tool YSlow -which is an addon to Firebug. YSlow is from Yahoo! which analyzes web pages and tells you why they're slow based on the rules for high performance web sites. Check them out!

 
Thursday, August 30, 2007

Thanks to Scott Hanselman (my fellow RD) for this post where he had pointed to a four part series by Microsoft's Michael Kaplan on this topic. MichKa's post talks in detail with sample code on how you can embed fonts in a Windows Forms Application and have it run in any target machine where that font is not available & doesn't get installed permanently. Please note that I am talking about Windows Client Applications here and not a Web Application where you can use WEFT (Microsoft's IE only option for embedded font) or sIFR (Flash based technique) to embed fonts. 

  • Part 1 - Basics of Font Embedding
  • Part 2 - Getting the Font you're going to embed
  • Part 3 - Loading the Embedded Font
  • Part 4 - Embedded Font Licensing and DPI
  • I found the part of creating a font from a file, loading and using dynamically very interesting. It opens interesting possibilities especially for Indic Language applications.

     
    Wednesday, August 29, 2007

    While development and testing many times we need to change the IP addresses manually to a given IP and then switch back to Dynamic IP (DHCP). Doing it everytime through GUI especially in Vista (finding the Network Option from Start, Right Click, Selecting Network Connections, then Right Click on the Interface, Choose IPV4, ...) is tiresome and waste of time.

    For doing it easily Windows exposes a great command called NETSH. NETSH exposes too many options, the help (/?) and online documentation runs for several pages. Because of this, everytime I tried I was put off. Today I spent last 5 minutes and cracked this. For changing IP address, we need to use the NETSH INTERFACE IP command.

    To display current IP settings (equivalent to your ipconfig command):

    C:\>netsh interface ip show addresses

    Configuration for interface "Local Area Connection"
        DHCP enabled:                       No
        IP Address:                           10.10.99.222
        Subnet Prefix:                       10.10.0.0/16 (mask 255.255.0.0)
        Default Gateway:                   10.10.10.11
        Gateway Metric:                    256
        InterfaceMetric:                     20

    To change your IP Settings to DHCP:

    C:\>netsh interface ip set address name="Local Area Connection" source=dhcp

    To set IP to a manual config (replace with your own values):

    C:\> netsh interface ip set address "Local Area connection" static 10.10.9.22 255.0.0.0 10.10.10.111 1

    Here after static command, the first value is your IP Address, second is NetMask, third is Gateway and fourth is metric.

    Similar to set address command in netsh interface ip there is set DNS command that can set the DNS values as well. If you put the above in a batch (.bat) file then you can just double-click on it everytime you want the IP config to be changed.

     
    Thursday, June 21, 2007

    Many times you have the need to access data (XML) from other sites than the current page, browser security settings prevent it as it could lead to Cross Site Security issues. I came across these two good references on solving this:

    1. Yahoo! Developer Use a Web Proxy for Cross-Domain XMLHttpRequest Calls
    2. Mash-it Up with ASP.NET AJAX: Using a proxy to access remote APIs
     
    Saturday, June 16, 2007

    Most of the time, I get this question - not so much nowadays, but a lot in previous years.

    At Vishwak, we have been using IIS for all our customers for nearly last 10 years and after IIS 5.0 we are very satisfied with it and its scalability. Whenever I get this question I have to keep explaining the differences, pros and cons - but now it is made easy with this excellent comparison written by Microsoft Bill Staples (from Product team of IIS). BillS is very passionate on IIS and I have enjoyed attending his presentations including one in Microsoft Redmond on IIS 7.0.

     
    Monday, June 11, 2007

    The best mantra on security is to reduce the surface area for attacks. This means have minimum number of components or code running at a given point to get the work done, no more and no less (Slogan Courtesy: Oswald Cartoon character Henry Penguin). For example, if you are running a web server for serving static web pages and images, why install and run .NET Framework/JAVA or a Database server or COM+ components. In *nix world this was possible for years but in Windows, though this was possible - it required the average Systems Admin to have extensive knowledge of each and every service running on the machine.

    Now Microsoft has simplified this with the introduction of Windows Server 2008 Core. The Server Core installation of Microsoft Windows Server 2008 provides a minimal environment for running specific server roles that reduces the maintenance and management requirements and the overall attack surface area. To provide this minimal environment, a Server Core installation installs only the subset of the binaries that are required by the supported server roles. For example, the Explorer shell is not installed as part of a Server Core installation. Instead, the default user interface for a Server Core installation is the command prompt. You can manage either locally at the command prompt or remotely by using Remote Desktop. You can also manage the server remotely by using the Microsoft Management Console (MMC) or command-line tools that support remote use.

    In Tech Ed 2007 - Microsoft announced that the Server Core installation option of Microsoft Windows Server 2008 now includes Internet Information Services 7.0 (IIS7). IIS 7.0 introduces much wanted capability such as shared Web server configuration across servers.

    As a side note: I envisioned :-), a similar SKU about 8 years back when I presented this mock presentation on MSDOS.NET for grabbing the audience before my Commerce Server 2000 presentation in Tech Ed 2000.

    References: Server Core: Windows Without Windows

     
    Tuesday, May 15, 2007

    At Vishwak, we have been working on Live.Com gadgets, Vista Gadgets and other mash-up technologies for quite some time. Out of this, I personally feel the Vista gadgets to have the most potential to be useful. Lot of people seem to understand its potential though a bit delayed - including BBC Radio in the Vista gadget that I talked about in my Mix '07 posts.

    When we published to Live Gallery few of our experimental gadgets, we were really surprised by the number of downloads they made. The gadgets we published were Dictionary Gadget, Media Player Gadget, System Notify, CPU Meter, History on Today, Outlook Task and Radio Gadget. Out of this Dictionary and Media player have got over 9000 downloads and growing.

    Vista Gadgets developed by Vishwak Solutions

     
    Friday, April 13, 2007

    If you have been using Vista, Outlook 2007 combination and using POP3 (Non Exchange Server) for downloading emails - you may be experiencing slow email download. This might be due to the auto tuning of TCP/IP in Vista. Here is a Microsoft Support KB that helps to resolve this.

    Update (20 April 2007): Similarly if you feel that search is slow with Outlook 2007 (I liked Lookout, unfortunately it doesn't work with Outlook 2007) then download this fix from Microsoft.

     
    Thursday, January 18, 2007

    One of the questions I frequently get is how to upgrade from VB 6 to VB.NET. Though there are lot of upgrade scenerios explained in detail in MSDN, my favourite has always been step-by-step upgrade. In this approach, you take one of your existing forms, upgrade/re-develop them in VB.NET and have it being called from VB 6.0 applications. Then you move to the next form, by doing this, over a period you can have the entire application moved to VB.NET. The problem in doing this was to have the knowledge on how to turn the VB.NET form into a COM component that can be called from VB 6.0, MS has made this easier now with Interop Forms Toolkit 1.0.

    Having the forms developed in VB.NET brings in lot of capabilities - foremost being the ability to support 100% Unicode, which is very important for Indic Languages like Tamil, Hindi, etc.

    For doing Unicode with VB 6.0:

    Though basic: If Windows XP / 2003 - First ensure you have selected the check box in Control Panel -> Regional and Languages Options -> Languages Tab -> Install Files for Complex Script and Right Languages (or) If Windows 2000 – Ensure you have Indic Support enabled

    VB 6.0 even with MS Forms 2.0 will have some issues with Unicode, especially Indic languages like Tamil. I found it easier and better to do the forms in VB.NET 1.1 and then call the forms from VB 6.0. So the .NET application can be either a standalone EXE (or) called as a ActiveX COM DLL .

    These references might be useful, check them out: