Tuesday, August 29, 2006

Scott Hanselman's 2006 Ultimate Developer and Power Users Tool List for Windows

Scott Hanselman's 2006 Ultimate Developer and Power Users Tool List for Windows The title says it all: A great list of usefull tools for the developer.

.NET Reflector Add-Ins

.NET Reflector Add-Ins This page lists all the greatest add-ins for the .NET Reflector tool.

Thursday, August 24, 2006

Sample book chapter on new features from C#2.0

In this sample chapter from the book "Visual C#2005 - A Developer's Notebook" learn about and use the new features in C# 2.0, including generics, iterators, anonymous methods, partial types, static classes, nullable types, and limiting access to properties, as well as delegate covariance and contravariance. http://www.oreilly.com/catalog/visualcadn/chapter/ch01.pdf

Free C# chapters from books

This guy regularly updates this page with links to freely downloadable chapters from books on C#. Great resource. PublicJoe's - C# Tutorial - Free EBook

A good paper on binary representation of floating point data

Here is a good article on binary representation of floating point values. The article use C# to explain the concepts. Herong's Tutorial Notes On C# - Part B - Binary Representation of 'float' and 'double' Values

Interop 101: PInvoke

Here is a series of posts from BorisJ on PInvoke. Interesting stuff. Part 1: http://blogs.msdn.com/borisj/archive/2006/07/29/683061.aspx Part 2: http://blogs.msdn.com/borisj/archive/2006/08/21/711530.aspx

Tuesday, August 22, 2006

A book on OpenSource licensing

A book on OpenSource licensing: Open Source LicensingSoftware Freedom and Intellectual Property Law http://www.rosenlaw.com/oslbook.htm This book is available online under the Academic Free License version 3.0. Links to the individual chapters are shown below. Front matter Preamble Chapter 1: Freedom and Open Source Chapter 2: Intellectual Property Chapter 3: Distribution of Software Chapter 4: Taxonomy of Licenses Chapter 5: Academic Licenses Chapter 6: Reciprocity and the GPL Chapter 7: The Mozilla Public License (MPL) Chapter 8: The Common Public License (CPL) Chapter 9: The OSL and the AFL Chapter 10: Choosing an Open Source License Chapter 11: Shared Source, Eventual Source, and Other Licensing Models Chapter 12: Open Source Litigation Chapter 13: Open Standards The Open Source Paradigm Appendices

CoolCommands 3.0 for Visual Studio 2005

Here is another really useful Visual Studion 2005 PowerToy:

CoolCommands 3.0 for Visual Studio 2005

In short, the tool provides access to some everyday tasks that you might do within VS, such as collapse all projects. Great time saver. Check it out at: http://weblogs.asp.net/gmilano/archive/2006/05/10/446010.aspx or directly download it from : http://downloads.deklarit.com/files/gmilano/CoolCommands30.msi

Visual Studio 2005 PowerTools

Here is a great tool for debugging .NET20 apps. From:http://www.codeplex.com/Wiki/View.aspx?ProjectName=MSE Do you ever need to get stack traces for your .NET 2.0 applications? Want a quick and easy way to monitor managed processes and threads? Need a way to view a thread's stack trace to investigate an application hang? If so, Managed Stack Explorer is for you.

Managed Stack Explorer is a lightweight tool that allows you to do just this. Simply copy the executable anywhere and start monitoring your stack traces today.

Check out all of the MSE Features for the 1.0 release. Learn more about the Managed Debugger Sample MDbg

Monday, August 21, 2006

VS2005 - Forms Designer exception: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for mo

Update : MS has a hotfix for this problem : Check out the following page: http://support.microsoft.com/kb/912019/en-us Kept having the following problem with the Windows Forms Designer in VS2005. Here is what the problem is: All my Forms that inherited from another base form that I had created would all of sudden stop displaying the designer. The error that I would get was: One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. Hide at System.Reflection.Module.GetTypesInternal(StackCrawlMark& stackMark)at System.Reflection.Assembly.GetTypes()at Microsoft.VisualStudio.Shell.Design.AssemblyObsoleteEventArgs..ctor(Assembly assembly)at Microsoft.VisualStudio.Design.VSDynamicTypeService.ReloadAssemblyIfChanged(String codeBase) . . . It was the most annoying error and I found that it would happen most often when I performed a rebuild on my solution. The one method that I found that always worked was to close down the solution, and go to the project folder and clean out the obj and bin folders. (Performing a clean from within the solution did not always work, but shutting down VS and then cleaning the files worked always.) Some bloggers have pointed to this problem being caused by an indexing service that is run in the background, which causes file locking and hence the error. To work around this do the following: Select the projects folder in Windows File Explorer. On the Properties Tab, click the Advanced button and disable the checkbox to allow the indexing of the folder and subdirectories and files. But this was not the case on my machine. So there may be more than one reason for this error. (But if you want there is a hot fix for this file locking due to indexing issue and its : VS.NET 2005 Hotfix 265517_ENU_i386 - you will have to contact MS tech support for it though). Another reason that this can be caused is if the UserControl or base class form is in another DLL and its version has changed between builds. (To work around this, you can set the AssemblyVersion in the AssemblyInfo.Cs file of the DLL.

Sunday, August 20, 2006

jfo's coding

Here is a pretty good MSDN blog on Windows Forms. Lots of interesting discussion. jfo's coding

jfo's coding

Here is a pretty good MSDN blog on Windows Forms. Lots of interesting discussion. jfo's coding

FTPOnline - .NET Blogosphere

FTPOnline - .NET Blogosphere These guys constantly read .Net blogs and post those that are most interesting for that day. A great time saver, as I find these guys do my work of finding the latest interesting blogs. Most of the time, these guys find good ones. Check it out: http://www.ftponline.com/portals/blogosphere/net/

LogMeIn - Remote Access and Desktop Control Software for your PC

LogMeIn - Remote Access and Desktop Control Software for your PC: "Provide instant remote support in seconds, without pre-installing software. LogMeIn Rescue gives you temporary control of remote PCs over the web to accelerate problem resolution, reduce support times, and increase customer satisfaction."

Windows Live Ideas � Product Page

Windows Live Ideas � Product Page: "What it is Windows Live� Writer is a free, downloadable program that will help you lay out your blog posts just the way you want them." Compose posts for Windows Live Spaces as well as Blogger, LiveJournal, TypePad, WordPress, and many other services

Saturday, August 19, 2006

FTPOnline - Special Report: Visual Studio Team System

FTPOnline - Special Report: Visual Studio Team System: "Visual Studio 2005 Team System Microsoft Visual Studio 2005 Team System, an integrated software development platform to help your team build mission-critical applications, delivers new role-based tools for software architects, developers, testers, database professionals, and project managers. This Special Report shows how you can use VSTS and its Team Foundation Server to better manage application delivery and maintenance, as well as improve realtime communication across the enterprise. "

Wednesday, August 16, 2006

AutoStitch: Automatic photo/image stitcher, creates panoromas from a set of images

AutoStitch: "Autostitch� is the world's first fully automatic 2D image stitcher. Capable of stitching full view panoramas without any user input whatsoever, Autostitch is a breakthrough technology for panoramic photography, VR and visualisation applications. This is the first solution to stitch any panorama completely automatically, whether 1D (horizontal) or 2D (horizontal and vertical). Autostitch is built using cutting edge research from the AI lab at UBC, but it's incredibly simple to use! Just select a set of photos, and Autostitch does the rest: digital photos in, panoramas out. Try the free demo (for Windows):"

The Most Important Software Innovations

The Most Important Software Innovations An excellent list of the most important software innovations. Did you know that hypertext was invented in 1945! The last innovation of web-crawling search engines is from way back in 1994. None since then.

The Road to Know Where: Ultimate List of Free Windows Software from Microsoft

The Road to Know Where: Ultimate List of Free Windows Software from Microsoft Microsoft has over 150 FREE Windows Programs available for download -- but finding them all is extremely difficult. This page has a small description and links to these useful tools.

Seven deadly sins of programming

Eric Gunnerson's C# Compendium : Seven deadly sins of programming Another good read. A list of stuff to watch out for while programming.

Three Sins of Authors in Computer Science and Math

Three Sins of Authors in Computer Science and Math: "Three Sins of Authors in Computer Science and Math " A concise article on some mistakes often found in technical papers (Not only those written on Math and CS subjects). A good read for anybody writting a paper.

Idiot's Guide to Neural Networks

Richard Bowles' Idiot's Guide to Neural Networks An article on Neural Nets, also contains some source code.

Debugging MSI problems

 Feed: Microsoft WebBlogs
 Title: Diagnosing Installation Errors

Author: heaths 
0+ Comments 



When problems occur when installing, repairing or patching, or uninstalling a product using Windows Installer technology, you need to be able to figure out what happened and why it happened. Dialogs that occur when the user interface is displayed can be helpful sometimes, but many times you need to look at a log to determine the exact cause of the problem.

The first step in diagnosing a problem using the log is to, of course, enable logging. When performing any actions with an installation package or patch always be sure to pass /L*v filename.log on the command line. This enables verbose logging. You can also use /L*vx which outputs debugging information as well, but this isn't always helpful and can lead to much larger log file sizes than even verbose logs. This option is also only available on Windows Server 2003 and newer. You can also set logging options using the logging policy that will apply to all Windows Installer operations on the machine.

Now that verbose logging is enabled when an error occurs you can search for "value 3" and in most cases find the return code from a failed standard or custom action. Note that this is not the only indication that a standard or custom action did not run perhaps as expected. An installation that returned prematurely but that did not return an error code from the process would have returned IDIGNORE, so you would have to search for "value 5". In Return Values of JScript and VBScript Custom Actions you can find the return values that can be returned from actions and what they indicate. Of course, it is recommended that you write custom actions in native C++ but this page does list both the #define constants and their values. Another good source of return values for custom actions is Logging of Action Return Values that lists a few more possible return values, as well as what value is returned from the custom action server depending on what values you return from your custom action.

You should see a line like the following listing the action that returned the error value:

Action ended 12:00:00: MyCustomAction. Return value 3.

Now that you've located the error in the log you must determine what really happened since the return value isn't really adequate for determining the cause of the problem. If your custom action failed hopefully you've logged enough information to determine the cause right away. If you used the MsiProcessMessage function to log the error from the Error table, or a standard action failed, you will find the error number in field 1 of the log message a little above where you found "value 3":

MSI (s) (AC:14) [12:00:00:000]: Note: 1: 1601 2: C: 3: 4096 4: 1024
MSI (s) (AC:14) [12:00:00:0000]: Product: My Product -- Out of disk space -- Volume: 'C:'; required space: 4096 KB; available space: 1024 KB

The first line lists the error in field 1 as 1601. If you look up the error in Windows Installer Error Messages you will see Windows Installer error 1601 has the English text of "Out of disk space -- Volume: '[2]'; required space: [3] KB; available space: [4] KB". Plus the values of the fields in the first line into that message and you'll end up with the second line in the log. This will give you a much better indication of what error occurred. If the error value isn't in the Windows Installer Error Messages table, be sure to look in the Error table itself since this may be a custom error. Custom errors should be in the range from 25000 to 30000 according to the documentation for the Error table, but this isn't always the case.

In Logging of Action Return Values return codes from msiexec.exe are paired with error codes returned from custom actions, but msiexec.exe may return other error codes as documented in Error Codes, such as ERROR_UNKNOWN_PRODUCT (1605) if you try uninstalling a product by its ProductCode that is not installed, or ERROR_PATCH_TARGET_NOT_FOUND (1642) if you try applying a patch to a product that is not installed.


Debugging .NET Loading problems

Create a text file named fusionLog.reg
Edit it with notepad and add the following content:

Windows Registry Editor Version 5.00



create a folder c:\log\fusion


double click the fusionLog.reg file and accept adding info in the registry

Each time an assembly fails to load, a log file is created in c:\log\fusion folder

In order to also see successes, change ForceLog to 1

Sunday, August 13, 2006

Open source Licenses

Recently, I was looking into the different kinds of licenses available for open source software. Specifically I was looking into the Lesser GNU Public License (LGPL). Most of the main pages such as the GNU site (http://www.gnu.org/licenses/lgpl.html) is so full of legalize that I just could not figure out what I had to do to comply with the license. The best that I found was this page for the CGAL library, that tells me what I have to do with the LGPL license. http://cgal.org/license_frame.html The Lesser General Public License gives you the right to use and copy the code freely. It is also possible to modify the code under the condition that the resulting modification is released as source code under the LGPL with any binary distribution that you may do of a resulting application using these LGPL parts. And these are some other links that I found along the way: Here is a page on different kinds of Open Source licenses. Open Source Initiative OSI - Licensing And this one is for all GNU Licenses : http://www.gnu.org/licenses/

Saturday, August 12, 2006

Reflection in .NET

Recenty I was doing some research on reflection in .NET. Questions I was looking at were: When is it to be used? What costs are there to using reflection? What alternatives are there to reflection? Here are some websites that I found to answer these questions: Reflection (A chapter from the book Programming C#) http://www.oreilly.com/catalog/progcsharp/chapter/ch18.html Reflection Demystified http://www.dotnetdevs.com/articles/ReflectionDemystified.aspx Dodge Common Performance Pitfalls to Craft Speedy Applications http://msdn.microsoft.com/msdnmag/issues/05/07/Reflection/ This article compares CodeDOM to Emit (The major difference is that Emit, emits IL code, whereas CodeDOM can generates code in .NET languages like C#, VB....) http://www.fawcette.com/reports/vslivesf/2004/holmes/ In .NET 2.0, there is an alternative to Reflection called Dynamic Code Generation (sort of a light weight Emit) This article from CodeProject talks about it with some good examples: http://www.codeproject.com/useritems/Dynamic_Code_Generation.asp Here is a code project article on using this method to work around the issue of calling properties in a loop using reflection (which is very slow). Fast Dynamic Property/Field Accessors http://www.codeproject.com/csharp/DynamicCodeVsReflection.asp In VS2005, one can use visualizer and here is one for use with Reflection Debugger Visualizer for MethodInfo, DynamicMethod, and MethodBase http://weblogs.asp.net/rosherove/archive/2006/04/25/MethodsVisualizer.aspx ---------------------------------------------------------------------------- One major use of Reflection is for the loading of plugin dlls, using the mechanism of loading a DLL and then using reflection to query and find those types that implement a certain interface. Here is some information regarding this use of Reflection. Remember to scroll down to the "Oops a small problem" part of the article (which talks about doing this querying in a different appdomain). http://weblogs.asp.net/rosherove/pages/8048.aspx

Cool Dev Tools

Often times I have XML files that I have written out in my code and I want to view quickly such that the view is formatted and nice and pretty with color. Here is a great tool that does just that: XMLDocViewer. Its free and all it does is view XML files. I need to see if it will work with SOAP XML, cause if it does, then its like gold to me. http://www.sliver.com/dotnet/XmlDocViewer/ There are many other tools and snippets on this guys website worth checking out : http://www.sliver.com/dotnet/index.aspx Snippet Compiler: This is Jeff's best tool. An easy way to test C# code, without having to create a solution and a project in VisualStudio. A must have : http://www.sliver.com/dotnet/SnippetCompiler/

Tuning your XP machine for best performance during recording of Audio

Here is a site that has a list of tips for making an XP machine faster for recording of auido. http://www.musicxp.net/tuning_tips.php

Friday, August 11, 2006

Virtual Earth V3.0 API

Replacing Start Run

Feed: ComputerZen.com - Scott Hanselman's Weblog Title: Replacing Start Run - The Quest Continues

So many ways to launch programs. A good launcher doesn't just launch, it also auto-completes paths for you, starts your search engine or browser and generally saves you 15 minutes a day. No need to learn all the hotkeys like those Keyboard wonks who try to guilt you. Just learn ONE and make it do everything.

Given these offerings, if you open your Start Menu at all, at any point in the day, you're doing something wrong. Try them all, pick one, and save 15 min * 5 days * 52 weeks = 65 hours a year you'd have spent futzing around in your Start Menu*. * These numbers came straight out of my butt.

  • Slickrun - still the sexy favorite, this little floating magic bar keeps me moving fast, launching programs, macros and explorer with it's shiny simplicity. Tell them I sent you. ;)

  • SmartStartMenu - Shaun Harrington has created this elegant little application that lives in the task bar and automatically indexes the list of items in your Start Menu for quick access with the speed of AutoComplete. It will take system commands, paths to launch explorer, even UNC paths. Launch anything on your system with less than 4 keystrokes. It also adds new context menus to Explorer like CopyPath and Open in DOS box to Explorer.

  • Martin Plante, hot off his gig at Xceed has created slimKEYS, a "universal hotkey manager" with a simple .NET plugin architecture. If you've got ideas or thoughts, visit the slimCODE Forums. Have you ever wanted to bind something to Shift-Ctrl-Alt-Window-Q but didn't know how to grab a global hotkey? This will launch programs, watch folders, and find files. It has great potential as more and more plugins appear. The current version already comes with the following built-in plug-ins:
    • slimSIZE: Change the current window's position, size or monitor location to any area of your choice.
    • slimLAUNCH: Open applications, documents or folders by typing a few letters from their name.
    • slimVOLUME: Display the volume level when you use your keyboard's volume control.

  • Colibri - The closest thing so far, IMHO, to Quicksilver on Windows, although this little gem has a slow startup time, it runs fast! It's being actively developed and promises integration with a dozen third party programs. It also formally supports "Portable Mode" for those of you who like to carry your apps around on a USB key.
  • Launchy - Another do it all application, this one Open Source and written entirely in .NET, Launchy binds to Alt-Space by default. This app also has the potential to be Quicksilver like if it start including support for stringing together verb-noun combos. It's pretty as hell and totally skinnable (there's TWO Quicksilver skins included!)
  • AppRocket -this little bar sits at the top of your screen, popping down an active list of Bookmarks, Programs, Music, Web Queries and more. It's unclear if this tool is being enhanced for future versions as folks have reported not hearing from the company in a while.
  • ActiveWords - Arguably the most minimal of these launchers (as it can have no UI at all if you like!), but the most configurable. ActiveWords watches everything you type, in every application, so anything you've just typed could potentially be used by you to launch a program, a macro, send email, or give you Auto-Correct in any application. Check out their screencast/demos and their scripting language. It also is the only launcher (I've seen) with explicit support for the Tablet PC and allows ink to trigger an "Active Word."
  • Dave's Quick Search Bar - Written orignally in JavaScript and now written in magic and ensconced in voodoo, this little Toolbar sits in your Windows Task bar (or wherever you choose to drag it) and supports a huge community of macro writers who've enabled it as a Calculator, Web Searcher, People Finder, Currency Converter and literally hundreds of other tasks via simple to write plugins. Very actively developed and on the web for over 5 years (that's like 100 people years).It even has a Search Wizard to create your own web searches by example.

UPDATE: I forgot a few that were totally worth mentioning. My bad.

  • Google Desktop - Google Desktop has an option that let's you use it as a quick program launcher along with fantastic search abilities by tapping Ctrl-Ctrl.
  • Find and Run Robot - Lightweight, small, quiet until you need it. This little application allows for tuneable heuristics to make it work like you think. Demo Screencast here.

Tuesday, August 01, 2006

Getting the relative path to a file, given its absolute path and a source folder (C#)

Here is some code that will get the relative path to a file, given its absolute path and the source folder from which the relative path should be computed. Code is in C# private static string GetRelativePath(string mainDirPath, string absoluteFilePath) { mainDirPath = mainDirPath.Substring(0,mainDirPath.LastIndexOf(Path.DirectorySeparatorChar)); string[] firstPathParts=mainDirPath.Trim(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar); string[] secondPathParts=absoluteFilePath.Trim(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar); int sameCounter=0; for(int i=0; isameCounter ) { newPath+=Path.DirectorySeparatorChar; } newPath+=".."; } if( newPath.Length==0 ) { newPath="."; } for(int i=sameCounter; i { newPath+=Path.DirectorySeparatorChar; newPath+=secondPathParts[i]; } return newPath; }