Welcome to Portal Experts | Vishwak.com |Blogs
Blogs

Venkatarangan TNC

  • Firefox Geode and W3C Geolocation

    Mozilla in their upcoming Firefox 3.1 release is introducing an experimental feature "Geode". Geode is about browser (and server) automatically deducing your location and provide appropriate location based information. Though Location-aware applications are present in Mobile Phones using Cell-Tower Triangulation or GPS, this is the first major effort to do something similar on the PCs.

    Geode provides an early implementation of the W3C Geolocation specification and location information will be provided by one or more user selectable service providers and methods - GPS-based, WiFi-based, manual entry, etc. What I was curious is how they deduct location information using Wi-Fi. It seems they use a technology from a company called SkyHook, whose hybrid positioning system (XPS) is a software-only location solution that allows any mobile device with Wi-Fi, GPS or a cellular radio (GSM/CDMA) to determine its position with an accuracy of 10 to 20 meters. Click on the video below to see how it works - basically they are building huge database of Wi-Fi access points and correlating them with Latitude/Longitude information from other sources like GPS for each access point profiled.

    Skyhook's hybrid positioning system (XPS) - How it works?

    All these are transparent to developers and users, for developers it is just a Javascript call like the one shown below:

    navigator.geolocation.getCurrentPosition(function(pos) {
      alert( pos.latitude + ", " + pos.longitude );
    })

    Before these initiatives web applications were limited to deducing user's location based on your IP. Technology is not standing still with IP based deduction, earlier they were limited to US cities, now database are more complete and are able to identify cities world over including India.

    Related links: ZoneInfo database, GeoNames

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • Cross browser Vector graphics

    If you have tried to do a decent chart or graph or any line drawings in HTML/CSS you would have felt extremely frustrated, more so you want it to be cross-browser compatible. Though SVG and VML have been around for years, the support for them is not uniform between browsers. Recently in a newsletter from Sitepoint I came across Raphaël - a small JavaScript library (less than 19Kb in filesize) written by Dmitry Baranovskiy of Atlassian, that allows you to create and manipulate vector graphics in your web pages. It's simple to use and supports Internet Explorer 6.0+, Safari 3.0+, Firefox 3.0+, and Opera 9.5+. Internally Raphaël uses VML in IE and SVG in the other browsers.

    Raphaël is published under MIT License which basically allows you to use the code in both commercial and non-commercials applications and even redistribute freely (as in free beer).

    CurrentSprocket

    To do the above graph, you need to write only 30 lines of Javascript. Check it out.

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • Basics that came up in a code review

    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.

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • Demand for SharePoint developers

    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:

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • TCP/IP fundamentals

    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.

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • Web Browsing Testing Tool

    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.

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • My MVP Award for 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.

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • Hyper-V and VM Additions for Linux

    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).

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • Lightweight Database Engines

    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.

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • Dell Vostro 1400 with Vista x64

    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
    • 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.

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • Web Browser Standards

    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)".

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • Microsoft Sync Framework

    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

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • Firebug and YSlow!

    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!

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • Font Embedding in Windows Forms

    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.

    Share this post: email it! | del.icio.us! | digg it! | newsVine!
  • Change IP Address from Command Line

    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.

    Share this post: email it! | del.icio.us! | digg it! | newsVine!

Browse by Tags

All Tags » Developer (RSS)
Copyright ©2010 Vishwak Solutions Pvt. Ltd.All rights reserved. Disclaimer | Privacy Policy
Vishwak is a registered trademark of Vishwak Solutions in India & the United States.