|
 Friday, March 02, 2007

Running Notepad++ From the command line

I've been using Notepad2 for quite awhile now and was recently introduced to Notepad++. I love saving time by launching Notepad2 by typing "n" into the command line. I save all the "otepad"s through the day. Its small, but hey, I learned it from Scott Hanselman, aka: the master of productivty.

After installing Notepad++ I realized I would never use it unless I could launch it with the same quick draw speed as of my favorite Notepad2. I had to type "Notepad++" in the command window to get it going. No! I had already eliminated the "otepad" and now I had two more characters on that same annoyance.

I fixed that annoyance by making a change to this registry key ...

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Notepad++.exe]

I was able to change it to "nn" (yes, I'm still secretly attached to Notepad2 as we speak, but I'm weaning off of it). Now, I can fire up Notepad++ through the command line with a quick "nn".

Here's the registry file if you want to do it yourself.

Download

Notepad++RunFromLettersNN.zip (.35 KB)

#    Comments [0] |

Gemini Webservice interacting with SharePoint Business Data Catalog

At work we use the Gemini Project Issue Tracker every day. We've a very small team, so we're able to get away with the free license for now. Upper management reviews the status of tickets and bugs and the overall status of any project at any given time. We also use SharePoint to collaborate and share documents throughout our company. We recently upgraded to MOSS 2007 (SharePoint 2007) and with this install comes the Business Data Catalog (BDC). This allows us to link back end systems to MOSS. MOSS provides a good toolset of web parts that YOU DO NOT have to write yourself. If your application exposes a web service or database connectivity, MOSS can consume. This means tons of development time, saved, IF. you can figure out how to write the BDC Application MetaData (XML).

I decided that we should try to implement Gemini into MOSS. Again, to my dismay I had to write some really nasty looking XML, this is the "Application MetaData". The documentation on the BDC MetaData Model isnt that "great" (IMHO) and its difficult and frustrating to write the XML MetaData. Who wants to sit around and write XML all day anyway? bleh. Boring...

I got MOSS to connect to Gemini through the webservice. This example only displays a few actions to prove that we can get data from Gemini.

It allows you to select a Project ID (int) and then the actions of "View Project" and "Open Gemini" will be presented.

How To

To get this to work, you'll have to replace this text: http://PathToYourGeminiSite/webservices/gemini.asmx?WSDL with the actual path to your Gemini Site.

Then import it into your BDC and use the Business Data Action Web Part to display the data.

Screen shots

Application Metadata Info Page

Page as user sees it once the web part is live.

Clicking the "View Profile" link will allow you to see data that is returned from the Web Service (as seen below):

Clicking "Open Gemini" will take you to the Gemini home page in a new window. Clicking "Open Project" will open that projects page in a new window.

Download the MetaData File.

GeminiMetadata.zip (1.07 KB)

#    Comments [0] |
 Wednesday, February 28, 2007

Confluence Tree Surgeon

Mike Roberts over at ThoughWorks have a project to help with continuous integration.

The product is called "Tree Surgeon". Tree Surgeon solves the problem of how to set up a development tree.

"Tree Surgeon is a .NET development tree generator. Just give it the name of your project, and it will set up a development tree for you in seconds. More than that, your new tree has years worth of accumulated build engineering experience built right in."

What the product does is it allows you to specify a project name and the application will create a development tree for you (code generation). This tree includes a solution, the tools (NUnit, NCover, NAnt) and a build file and script to execute the build. It saves TONS of time when creating a new project and needing to add it to your build.

Example

Creating a new development tree:

This will generate this tree structure:

Inside of the "ExampleApplication Folder" we have the build and the go script. The "go" script compiles, runs NUnit and NCover. Its the workhorse of the system. Run this from the command line. If you want to see the results while in a command window, I'd advise editing the go.bat file and adding @pause at the end of the script so you can see the results before the window closes.

The solution for the project is located in the 'src' directory:

You can execute the go.bat file and it will complile, and run NUnit and NCover on your application.

The best part about this is that its all configurable. Edit the cs.vm files in the C:\Program Files\Tree Surgeon\Resources\Templates directory and you'll be able to affect the output of the code generation. Plus, its all open source, so you can get the code from the site.

This could help a lot of companies get up and running with a development tree in their source control.

*Note: Currently Tree Surgeon only exports C# files.

I'll be writing more about Source Control Management as time continues... stay tuned.

#    Comments [0] |
 Tuesday, February 27, 2007

Gemini 2.0.5 "The Redirect Loop"

Yesterday while performing some maintenance on our internal Gemini website I ran into an error where the default.aspx page would redirect to the main.aspx page and then the main.aspx page would redirect to the default.aspx page. This loop would continue until windows gave me the classic DNS error page. Looking at the log files I see that the Default.aspx page is issuing a 401 (unauthorized) and then main is issuing a 302 (Redirect). Others have had this problem as well (but with a previous version), but their fix didnt work for me.

I didnt make any changes to the configuration, we just made a dns adjustment. Once the error started occuring we rolled back the change in our dns in attempt to eliminate the error. *NOPE* Didnt work. The redirect loop still existed.

We tried everything from changing security settings, to adjusting config file, rebooting servers, flushing DNS, everything. Nothing worked. The thing is, prior to this errror, we never made any code changes or configuration changes.

Resolution

I'm still baffled by what happened, but how I ended up fixing it is by uninstalling the Gemini application *note: copy your .config file to your local machine before doing this. You'll want it later*. After uninstalling I reinstalled it, and then updated the config file with values that were from the old config file.

I fired up the app through the browser and it works.

Its one of the strangest things I've seen in awhile, but at least its fixed. But the worst part is that it took 4 hours with help from our network team to troubleshoot and when it came down to it, we just had to reinstall. Not the desired method, but still, its an internal app only used by 10 people (max) so it wasnt that big of a deal.

#    Comments [0] |
 Thursday, February 22, 2007

Namespace Aliasing - The using directive

You can easliy alias a namespace in .NET by doing the following:

using System;
using System.Text;
using myXml = System.Xml; // <-- myXml is the alias.

Then in the code you can reference it like this:

using System;
using System.Text;
using myXml = System.Xml;

namespace MetaDatdaGenerator
{
   class Program
   {
      static void Main(string[] args)
      {
         myXml.XmlDocument xmlDoc = new myXml.XmlDocument(); 
         // Do stuff
      }
   }
}

Uses

Perhaps you've named something with similar namespaces or you've encountered a product with a similar namespace. This will allow you to alias them in your projects.

Aliasing a class

You can also alias a class, to save on typing. Saved keystrokes = mo time. Mo time = mo money. Mo money = mo problems! Oh, wait, nevermind...anyway... here's the code.

using System;
using System.Text;
using myXml = System.Xml;
using myException = ExampleCompany.ExampleProduct.Common.Exception.SomeExceptionWithAReallyReallyLongName;

namespace ExampleCompany.ExampleProduct
{
   class Program
   {
      static void Main(string[] args)
      {
         if (args.Length == 0)
         {
            throw new myException("Please provide a parameter!"); 
         }
      }
   }
}

Conclusion

Though it may not be used often, I've found myself using it a couple times when I needed to resolve some names to save on typing as well as an instance where I had two classes with the same name.

MSDN link: The using directive.

   
#    Comments [0] |