Sunday, April 27, 2008

Consolas Font Pack for Microsoft Visual Studio 2005 or 2008

Microsoft has released the consolas font pack for Visual Studio 2005 and 2008. The consolas font is a ClearType font - which is optimized for LCD display. (What is ClearType?).

My first impressions are - I do prefer consolas. But the real verdict can only be delivered after I have used it for a while.... which will come later.

Here is what it looks like on my machine:

Before consolas:


With consolas:


Download: Consolas Font Pack

According to Microsoft:

Consolas is intended for use in programming environments and other circumstances where a monospaced font is specified. All characters have the same width, like old typewriters, making it a good choice for personal and business correspondence. Optimizing the font specifically for ClearType allowed a design with proportions closer to normal text than traditional monospaced fonts like Courier. This allows for more comfortable reading of extended text on-screen.
The package will change the default text face in Visual Studio to the Consolas family.

Saturday, April 26, 2008

Pre-JIT a Windows Forms Application

Useful information on creating a pre-compiled copy of your application at install time.

Why? Because it can lead to a faster loading application. (This is true at least for the first time the .NET app runs on a machine - after which the IL code should get cached, never-the-less, this can provide significant time savings on loading of the app, especially on long complex codes).

Prejit a Windows Forms Application


In addition the site has some very useful tips and techniques for working with windows in .NET.


Friday, April 25, 2008

Vista only - Snipping Tool

I have had Vista for almost 6 months now and I had no idea about this feature that comes installed with Windows Vista.


The "Snipping Tool" in Vista allows you to create screen captures and its free!


Above - creation of a free form clip using the Snipping Tool.

3D interface to Twitter

I dont have a Twitter account - but saw this very cool 3D globe interface to twitter.

Check it out at


Thursday, April 24, 2008

Free C# books

The following site has electronic version of the hard-copy books that they publish available for free download.
Dissecting a C# Application is a good book!.

Tuesday, April 22, 2008

IPSec compliant VPN client for Windows XP 64

I used to use the Netscreen Remote VPN Client for VPN access. But unfortunately, I had to add it to my growing list of programs that are not supported by Windows XP 64. (
VPN access was absolutely critical for me and so I spent quite some time trying different VPN clients that would work with our Netgear 5GT hardware. (The basic criteria is that the client must support IPSec).
After a lot of search and testing I found that "NCP Secure Entry Client" to be a good and easy to use IPSec compliant VPN client that also worked on my XP 64 machine. (link). NCP also bills its software as the first one to support XP 64 (link) and from all my searching - I think that it is a true statement.
As for setting up the client to work with my company's VPN server, once I had all the settings - the setup was easy and straight forward. The UI is a lot better than the NetScreen client and provides more information about the connection status. The only thing I dont like about it - is its price - which at $130 per license is a lot more than Netscreen's client ($100 for 10 seats).
And as for the information that you need to setup your VPN client - (this should be universal for all clients, but might change based on your server's setup as well as the client might reference the information using different names).
1. IP (or the name) of the VPN hardware. This is the address of the VPN hardware that you will connect to.
2. IKE Policy (phase 1): Authentication type, Encryption algorithm, Hash algorithm, DH group.
3. IPSec policy (phase 2): Protocol (probably ESP), Transform algorithm and authentication algorithm.
4. Exchange mode: Aggresive or main mode.
5. PFS group.
6. Advanced IPSec settings: Is compression turned on?, Does dead peer detection need to be disabled? and if UDP encapsulation has to be turned on and if so which port is to be used?
7. Local Identity information: Id type and ID.
8. Whether authentication is based on a pre-shared key or certificates? (and if pre-shared key - then what is the key)
9. If using XAuth, then you need the user name and password.
10. IP address assignment for the local machine. (This can be provided by DHCP over the VPN connection or staticly set by the admin and provided to you. Other options are also available)
11. Network addresses and subnet masks over which the VPN tunnel should be used.

Monday, April 21, 2008

Windows Live Programs and XP 64.

Bad news..... Windows Live suite of programs are currently (as of April 21, 2008) not supported by Windows XP 64. So, I dont have my trusty Windows Live Writer to write up my blog-posts on my new XP64 machine! As for Windows Live Messenger, the latest version 8.5 wont install on Xp64, but the good news is that version 8.1 works on XP 64. (download link). More info is available at!5B410F7FD930829E!32578.entry

Sunday, April 20, 2008

Visual Studio Hotfixes

images Finally Microsoft has a website that acts as a single point for finding and downloading hot-fixes for Visual Studio.

The site is part of the MSDN Code Gallery.

Recently I found VS behaving sluggishly on my C++ projects. Searched for: "visual studio slow c++" (link), voila - found KB920805 that solves it. Now to install it and see if it makes VS a better behaved beast.

Wednesday, April 16, 2008

Marshaling between Managed and Unmanaged Code

A good article on the marshaling of data from managed to unmanaged code and vice versa.

Marshaling between Managed and Unmanaged Code from CLR Inside Out:-- MSDN Magazine, January 2008

Al Gore: New thinking on the climate crisis (video)

TED | Talks | Al Gore: New thinking on the climate crisis (video)

Cool Quotes by Einstein

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

The secret to creativity is knowing how to hide your sources.images

The only thing that interferes with my learning is my education.

Education is what remains after one has forgotten everything he learned in school.

Two things are infinite: the universe and human stupidity; and I’m not sure about the universe.

Not everything that counts can be counted, and not everything that can be counted counts. (Sign hanging in Einstein’s office at Princeton)

Imagination is more important than knowledge.

Reality is merely an illusion, albeit a very persistent one.

Great spirits have often encountered violent opposition from weak minds.

The whole of science is nothing more than a refinement of everyday thinking.

Technological progress is like an axe in the hands of a pathological criminal.

We can’t solve problems by using the same kind of thinking we used when we created them.

According to a friend of mine (Josh Morey) - many of them are either un-sourced or missattributed. So quote these at your own peril!

25 Best Microbreweries in the U.S.

from: Drinking Across America: A Look at the 25 Best Microbreweries in the Country | Travelhacker

    1. Anchor Brewing Company: San Francisco’s Anchor Brewing Company offers a beer experience that you just don’t see often these days. It’s made in a gorgeous brewery modeled after traditional, historic brewhouses. Because of this, each brew is “virtually handmade,” a quality that beer lovers are sure to appreciate. Their most famous beer is Anchor Steam, which has a uniquely rich flavor. Make a reservation to tour their brewery and see how beer is made in this brewery that embraces the brewhouses of old.
    2. Full Sail Brewing Company: The “specialists in the liquid refreshment arts” at Full Sail are “stoked to brew,” and it shows through their beers. This employee owned brewery in Oregon is home to award-winning beers like the Full Sail Amber, IPA, LTD and Wassail, which all picked up a gold medal at this year’s World Beer Championships. Even better, the brewery is located (and open for tours) in Hood River Oregon, a gorgeous little surf town that’s a favorite of windsurfers and skiiers alike.
    3. Real Ale Brewing Company: Located in the Texas Hill Country, Real Ale is a nice place to stop by if you’re on a scenic drive. They use the nearby Blanco river for brewing water, which Owner Brad Farbstein touts as “some of the best brewing water for the styles of beer that we make.” Their tours and tasting hours are on Friday afternoons, making a stop by the brewery a great way to kick off your weekend with a good quality beer.
    4. Stone Brewing Company: Stone brews “big character” beers, like their intensely strong Arrogant Bastard Ale, which, by the way, you’re not worthy to drink. The brewery has a restaurant and beer garden in which you’re free to enjoy their tasty brews.
    5. Saint Arnold: Beer lovers, from connoisseurs to frat boys, love to visit Saint Arnold’s. Why? Their tours are essentially a beer drinking free-for-all party. Held every Saturday at 1, visitors are treated to a history of beer and the brewery, followed by a celebration with free flowing taps and a fun ambiance. Spend one of four tokens to fill a glass, whether it’s a small one provided with the tour, or a large glass purchased from the brewery. Some of their best-loved brews include the Brown Ale, which offers a slight hint of chocolate pudding, and the Fancy Lawnmower, a beer that won the Kolsch gold medal at the Great American Beer Festival this year.
    6. Redstone Meadery: The Redstone Meadery is unlike any of the other breweries on this list, as they create something completely different. Redstone’s tiny brewery puts out honey wine, or mead, an ancient beverage enjoyed by drinkers from Vikings to Beowulf. Six of their meads won medals at the International Mead Festival, including their 2002 Reserve and Sunshine Nectar, which earned Gold. Just the meadery’s aroma is enough to turn you on to their brews: a visit to their facility is sure to be sweet.
    7. Avery Brewing: Avery brews perhaps some of the hoppiest beers in Colorado. As “big beer” lovers, this family owned brewery’s team of hopheads creates intensely flavored brews that are favorites among beer afficionados. Just think of your favorite brewery’s specialty ale: nearly every one of their beers is just as big and robust. These beers are sure to please, as is a visit to the brewery, where you can sample all of their creations and even try cask ales that you can’t find anywhere else.
    8. Flying Dog Brewery: Flying Dog Brewery takes the cool prize. These brewers used to be friends and neighbors with Hunter S. Thompson, and use artist Ralph Steadman for all of their labels. But their excellence doesn’t stop there. They have some truly awesome beers, ranging from the Horn Dog barley wine to the In Heat Wheat. If you tour the brewery, you’ll have a chance to drink a fresh brew straight from the fermenter, and even check out the unique whiskey distillery next door.
    9. Left Hand Brewing: Left Hand’s philosophy is all about balance: of fun activities and of great beer. They work towards a perfect balance of malt and hops, a process that’s evident in all of their beers. This year alone, they’ve raked in 9 awards for their brews, including their intriguing Juju Ginger Ale, which was awarded Best of the Rockies in the Spiced Beer category at the US Beer Tasting Championships.
    10. Dogfish Head: Dogfish has some strong, special brews that hopheads are sure to love. They have a line of time-hopped IPAs, ranging from 60 to 120 minutes. They also have a complex Raison D’Etre, which was voted American Beer of the Year by Malt Advocate Magazine in 2000, and the Midas Touch Golden Elixir, a beverage that showcases ingredients that were found in drinking vessels in King Midas’ tomb. Check out both their brewery and brewpub if you’re in the Delaware area.
    11. New Belgium Brewery: For New Belgium, like many others, brewing is a labor of love. From delivering beer by station wagon to becoming the country’s first brewery to subscribe to wind-generated electricity, this brewery has a rich history and rich beers to match. Their Belgian-inspired brews are a treat, particularly the Sunshine Wheat, a refreshing hefeweizen with a citrus bouquet.
    12. Rahr and Sons Brewing Company: Rahr & Sons is a family owned brewery in North Texas. The brews are only available in Texas, but they’ve won national awards. Rahr’s Blonde Lager, Ugly Pug, and Summertime Wheat have all been recognized at the US Beer Tasting Championships.
    13. Redhook: Redhook’s beers “defy ordinary.” Their flagship beer, the ESB, or extra special biiter, is styled after bitters served in England. They have recently merged with Widmer Brothers Brewing Company, the brewers credited with bringing the hefeweizen to America.
    14. The Lost Abbey: The Lost Abbey has beers for saints and sinners alike, offering beers modeled after the brews created by monks in Belgium as well as numerous other styles. At the Great American Beer Festival this year, The Lost Abbey took home three medals, and was crowned the nations’ best small brewery.
    15. Rogue Brewery: Rogue’s founders fled the corporate life in favor of the food and beverage industry. Significant brews include the Brew 10,000, which was brewed in a limited batch using ultra premium ingredients, and the Chipotle Ale, dedicated to Spanish author Juan de la Cueva. Most recently, their Imperial Stout took a Bronze medal at this year’s Great American Beer Festival, and Shakespeare Stout took Guld at the Stockholm Beer & Whiskey Festival.
    16. Russian River Brewing Company: Russian River is an example of what happens when a skilled champagne company, in this case Korbel, tries their hand at brewing beer. It’s now owned by a husband and wife team and has won numerous awards, from gold medals for individual beers to Champion Brewery and Brewmaster. Their adventuous beers include a double IPA and wine barrel-aged ales.
    17. Lagunitas: Lagunitas prides themselves on “steadily losing less money each month,” a feat achieved by the growing popularity of their quality beers. From their Imperial Stout to seasonal ales like the Lagunator, you’re sure to find something tasty.
    18. Allagash Brewing Company: Allagash started out brewing a Belgian Wit beer, Allagash White, and has expanded to a variety of bottle conditioned beers. This involves a second fermentation in the bottles after the initial fermenting in tanks. It adds an air of complexity to the beers, and the novelty of drinking a “living” beer.
    19. New Glarus Brewing Company: New Glarus was founded by Deborah Carey, the first woman to found and operate a brewery. They have recently moved to New Glarus, Wisconsin, and their facility, currently under construction, is designed to look like an old-world Switzerland town square. Their most popular brew is the Spotted Cow, a blonde ale. Also notable is the Wisconsin Belgian Red, which has won a number of awards worldwide. Last year, New Glarus took the Midsize Brewery of the Year award at the Great American Beer Festival.
    20. Deschutes Brewery: Deschutes is located on the banks of the Deschutes river, offering a small brewpub and specialty brewing facility. They have a number or unique beers, from the Obsidian stout to the Jubelale.
    21. Big Sky Brewing: Big Sky “makes water fun” by pouring their hearts into every beer. Their beer sells in thirteen states, most popularly in Montana. Their brews include Moose Drool, Scape Goat, and Big Sky IPA.
    22. Harpoon Brewery: Harpoon is one of the largest craft breweries in New England, due in large part to their great beer. Located in both Massachusetts and Vermont, they’ve been a large part of the rebirth of microbrewing. They’re best known for the Harpoon India Pale Ale, but their Munich Dark, hefeweizens, and brown are not to be missed.
    23. Great Divide Brewing Company: Great Divide, based in downtown Denver, offers a number of challenging beers. The most popular is the Denver Pale Ale, followed closely by the Hibernation ale. So far, they’ve collected twelve awards from the Great American Beer Festival. They have since ventured into “big beer” territory, producing beers like the Oak Aged Yeti Imperial Stout and Hercules Double IPA.
    24. Independence: Independence’s Rob Cartwright started out brewing beer with his mom at the tender age of 14. Since then, he’s brewed beers for both personal consumption and hand-crafted style. This Austin beer offers loads of flavor and easy drinking. Independence beers include the seasonal Jasperilla Old Ale, Bootlegger Brown Ale, and Freestyle Wheat Beer.
    25. Bear Republic Brewing Company: In the heart of wine country, Bear Republic offers an award winning beer experience. Ingredients at Bear Republic are hand-selected, and recipes are developed over several years. Their Racer 5, Red Rocket, and Heritage ales have been recipients of gold, silver, and bronze medals. This brewery was awarded the Great American Beer Festival’s Small Brewing Company of the Year.

Download YouTube Videos as MP4 Files

The following page has the best bookmarklet for downloading YouTube videos in a format that makes it compatible for loading on to an IPOD.

Download YouTube Videos as MP4 Files

or just right click on the following link %20Download%20as%20MP4%20'+%20%20((navigator.userAgent.indexOf('Safari')!=-1)?'(control-click%20and%20select%20Download%20linked%20file%20as)':('(right-click%20and%20select%20Save%20'+%20(navigator.appName=='Microsoft%20Internet%20Explorer'?'target':'link')%20+'%20as)'))+'';}void(0);">Get YouTube video and select "Add to favorites...". (And if you choose Links as the create in folder - the short-cut will appear on the links toolbar).

Save  LinksSave  Links

Now if you are not familiar with bookmarklets - they are URL bookmarks that contain code within them that allow them to do some amount of processing.


Once you have added the above bookmark-let, if you click on the bookmark while viewing a YouTube video - you will get a link in the Video's author box, which will allow you to download the video as an MP4. (And this occurs without refreshing the page - so you can decide to download the video in the middle of watching a video without having to worry about restarting the video)

I also found that the format of the video as downloaded - works great on the IPOD nano. I had to make no changes to the video, nor convert it (size or encoding) using a tool like SUPER(c). It just works - and works great!

Makes it so much easier to take PodCasts with you on the iPod.

Sunday, April 06, 2008

LIDAR in India


Here is a recent news article on how India plans to use LIDAR technology in The Telegraph - Calcutta (Laser Light on Terror)

Airborne Altimetric LiDAR Where does India stand?

The Indian Institute of Technology at Kanpur (IIT-K), seems to be at the fore-front of LIDAR research in India. Here are some links from that organization.

IIT Kanpur page on LIDAR: Dr. Bharat Lohani is part of the Civil Engineering department at IIT-K and does most of the research into LIDAR.

International School on LiDAR Technology: : A workshop on LIDAR that is currently in progress at IIT-K. This is the workshop that the news article from "The Telegraph - Calcutta" references.

LAS Convertor : A convertor utility that allows you to move between LAS formats as well as to ASCII.

Limulator : LIDAR data capture simulator. The simulator generates LiDAR data similar to a real LiDAR sensor for further display and analysis


Shameless self-plug:

LIDAR Analyst : The LIDAR tool created by my group at VLS for automated feature extraction from LIDAR data.

Friday, April 04, 2008

Why should you be recycling more?

Hopefully the following video will show you why:

And here is more information if you are interested:

PBS Podcast:

The cause of the plastic cloud is a natural phenomenon called the Gyre - a swirling vortex of ocean currents - and here is more information on how it causes the plastic cloud:

The natural currents combined with the fact that plastics do not bio-degrade - they disintegrate in the presence of sun-light. This results in the plastic pieces that slowly keep disintegrating into smaller and smaller pieces until they are plastic molecules. At this point they just float around as nothing can degrade them further. And unless we find a solution - these molecules are going to keep floating around making the oceans one large plastic cloud. This causes further problems - as it contaminates the fish as well as pollutes beaches.

Finally, this is not a new phenomenon:

Bottom line: Its a problem caused by humans - and an easy solution exists - recycle - at least your plastics!

Coz like diamonds - plastics are FOREVER!


Thursday, April 03, 2008

UI Design - Prototyping

Recently I was looking for a tool that I could use to mock up UIs. Prototyping of UIs and getting user feedback is an exercise that developers often overlook - but is extremely important - because the interface is the "application" as far as the user is concerned.

Typically - I have used a paper and pencil for UI design prototyping.

Why is prototyping using a simple tool important? If you expend a lot of energy developing a UI - especially via code - then it becomes very hard to let it go. A simple form of prototyping - allows you to get a feel for the interface with the least amount of energy. In addition - it allows you to gather feedback and constantly rearrange and add UI elements to get an interface that you users want - and allows for a productive workflow.

So what is important during prototyping?

  1. Should require little effort to create and change
  2. Should allow you to explore and iterate over the design with your users.
  3. If using a tool - it should be simple to use by developers as well as end users and other stake holders in the project. (which is why paper or a white board will never become old fashioned)
  4. Whatever you use - it should be able to communicate your idea universally to all the project's stake holders.

The following video - a presentation by Manuel Clement - shows how one can use PowerPoint for prototyping. (He calls it wireframe prototyping)

I like the idea of using PowerPoint - because you get a softcopy that you can save, email and use as a tracking tool of your project's design history. Paper is still useful - especially as a first step. (I remember using PowerPoint 2000 when I took a UI class for the purpose of designing a touch-screen ticket kiosk for a public transportation system - and the results were pretty good - allowing for non-linear progression through screens).

As a follow-up I found this website - that provides a download of a power-point file from which you can copy and past commonly used design controls like buttons, scroll bars and window elements.



The following article has some useful steps on configuring the master slide which will make prototyping multiple dialogs/screens quicker - by creating the basic canvas on the master slide.

Vertex Normals

Recently I had to create a 3D model in OpenFlight. The model was made up of a mesh - a list of points and a list of triangles that reference the points in the list by index.

Writing out the mesh just as it is - leads to a flat colored object.

The reason for this is that without normals - the viewer doesn't know how light is reflected off the faces of the model. This is why we need to provide information about the normals for the model. Normals are used in Gouraud shading, Phong shading and other lighting models.

From all my experience with 3D graphics - there was one normal assigned to each face in the model. In other examples I have worked with - this surface normal is then applied to each vertex that makes up the face - a simplified vertex normal.

The only issue with one normal being assigned to all vertices connected to a face - is that the model will have sharp edges - even though it might be a smooth surface. This can look especially terrible when you try and model cylinders, domes or any surface that has a curve on it.

To alleviate this problem - vertices are assigned normals based on the average of all the normals of the faces that, that vertex is a part of.

3d shading

The above example shows an example of shading based on different types of normals.

From left to right:

  • No normals - the first image shows what a 3d model looks like without any normal information - it looks flat.
  • Normals based on the main face - when normals are assigned based on just the main face that they belong to - then the model looks very faceted.
  • Vertex normals based on a combination of surface normals of the faces that contain that vertex - then the model results in a smooth - realistic looking 3d model.

What you need for vertex normal calculations:

  1. Code to compute normal
    The easiest way to do this is to treat the edges of the triangle as vectors (where the triangle is a face of the mesh/object).
    The normal is then computed as the cross product of 2 of the adjacent vectors.
    The normal is then normalized.

As pseudo-code

  • for each vertex i in VertexList v
    • n <== Zero Vector
    • for each triangle j that shares ith vertex
      • n <== n + Normalize( Normal(triangle j) )
    • end for
    • n[i] = Normalize(n)
  • end for

An optimization:

If you look at the above pseudo-code - you will notice that the algorithm runs in will take (n x m) loops to complete, where n is number of vertices and m is the number of triangles. Typically m can approach and even exceed the number of vertices n. Thus the above algorithm has a complexity close to O(n2).

A useful optimization that one can use is instead of looping over the vertices - you loop over the triangles.

  • for each vertex i in VertexList v
    • n[i] <== Zero Vector
  • for each triangle j in TriangleList t
    • n <== Normalize( Normal(triangle j) )
    • for each vertex i in triangle j
      • n[i] <== n[i] + n
    • end for
  • end for
  • for each vertex i in VertexList v
    • n[i] <== Normalize(n[i])
  • end for

This reduces the complexity of the algorithm to O(m) and runs much faster than the original algorithm.

Finally - if you look at the paper Generating Vertex Normals, you will see that there are some useful heuristics that you can apply for more realistic effects based on the application. (such as weighting the average of the normal based on the area of the triangle - vectors make it easy to compute the area of a triangle too).

Useful articles on vertex normal computation:

A Comparison of Algorithms for Vertex Normal Computation (pdf)

Generating Vertex Normals (pdf - contains pseudocode for vertex normal calculation)

Face and Vertex Normal Vectors (Direct3D 9)

A Vector Type for C# - a vector class with useful methods for performing vector arithmetic.

Tuesday, April 01, 2008

LASIK - Week 2 and 3 Report

Nothing much to report about the last 2 weeks.

The dryness is slowly reducing and I need less and less of the artificial tears. My vision has been improving too. Overall my eyes seem to be doing great.

As for problems: Blurred vision as soon as I wake up - maybe occurred a couple of times over the last two weeks. Sometimes I do get a head-ache when I am working on the computer for extended periods (10+ hours). Night time vision still has halos around really bright lights - but it does feel like it is reducing as time goes by.

The main thing at this point is to take regular breaks - especially while I am working on the computer.