Scott Hanselmans Ultimate Tools List#

Too many to list.

Some of my favs are on this list, like Launchy and SnippetCompiler.

Categories:  | 
Tuesday, October 16, 2007 9:35:45 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Finding the cause for slow loading webpages#

Yahoo has released a tool called YSlow that helps developers identify why a specific website is loading slow.

Take a look at this screen cap (click to enlarge):

 

Categories:  |  |  | 
Tuesday, October 16, 2007 9:18:04 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Refactor! for ASP.NET#

This looks really cool. 

You can download it here for free.

Included Refactorings

Add Validator
Create Overload
Encapsulate Field
Extract ContentPlaceHolder
Extract ContentPlaceHolder (create master page)
Extract Method
Extract Property
Extract Style (Class)
Extract Style (id)
Extract to User Control
Flatten Conditional
Inline Temp
Introduce Constant
Introduce Local
Introduce Local (replace all)
Move Declaration Near Reference
Move Initialization to Declaration
Move Style Attributes to CSS
Move to Code-behind
Rename
Reorder Parameters
Replace Temp with Query
Reverse Conditional
Safe Rename
Simplify Expression
Split Initialization from Declaration
Split Temporary Variable
Surround with Update Panel
 

UPDATE:  It seems that installing this may have removed some of the features of the old Refactor! that I was frequently using (?).  I used to use the "Surround With-->Region" all the time.  Now that is gone.  I will have to investigate.

Categories:  |  |  | 
Friday, June 01, 2007 8:57:43 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

IBiz Quickbooks Integrator#

nSoftware just released a product called IBiz Integrator for Quickbooks, which is supposed to enable one to integrate their applicaiton with Quickbooks via QBXML.

A comprehensive suite of Internet-enabled components for QuickBooks (QBXML) Integration. Includes easy-to-use components for accessing QuickBooks constructs and automating accounting tasks.

Should be work looking into for QB applications.

Categories:  |  | 
Friday, July 07, 2006 10:44:48 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Run ASP.NET Web Server From Any Folder#

Rob McLaws has this cool extension that lets you click on a folder and run a webserver from it.

The article, with some comments on alternative ways to do it, or ways to improve it can be found here.

http://weblogs.asp.net/rmclaws/archive/2005/10/25/428422.aspx

From the page:

I've been doing some web development work again lately, and I haven't wanted to screw with setting up IIS on my virtual machine. The .NET Framework 2.0 comes with a built-in webserver, based on the old Cassini web server. So I wanted to be able to easily set up any directory to have its contents served up on an as-needed basis. The result is an addition to the Windows Explorer right-click menu, as shown below:

This is enabled by a simple modification to the registry. You can take the text below and dump it into a file named "WebServer.reg", and then run it, to immediately get the item in the context menu.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\VS2005 WebServer]
@="ASP.NET 2.0 Web Server Here"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\VS2005 WebServer\command]
@="C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\Webdev.WebServer.exe /port:8080 /path:\"%1\""

There are a couple caveats to this tool, however:

  1. The web server does not randomly assign a port number, so it has to be hard-coded into the registry.
  2. The web server does not automatically assign a virtual directory, so it will always be "http://localhost:port"
  3. A command prompt window will be spawned, and cannot be closed without closing the web server process.

Moving foward, there are a couple of options to fix these issues:

  1. Someone who knows more about variables in the registry can help me fix issues #2 and #3
  2. I can build a wrapper executable that solves all three problems
  3. Microsoft can put in a DCR and fix it before it goes gold in a few days.

#3 is not likely, so I'd love to hear what you think. Hope this trick is useful.

 

Categories:  |  |  | 
Tuesday, May 09, 2006 2:55:26 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

AWStats#

This is a well known log analyzer application that can provide a nice web interface for viewing we stats.

http://awstats.sourceforge.net/ 

Categories:  |  |  |  | 
Thursday, May 04, 2006 2:55:16 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

VS2005 VB.Net Create Properties From Private Fields#

"Refactor!" has the ability to turn your fields into public accessible properties, but it kinda sucks because 1) you have to do it 1 at a time, and 2) the naming convetion is all wrong. 

For example if you have a private integer called myInt then your property will be MyInt1.  Not exaclty what I am looking for.

So I updated my 2002 macro for creating these properties.  It should allow you to follow a variety of naming conventions "m_XXX", "ciXXX", "strXXX" etc.

Just include the macro below, then just highlight your private fields, and run the macro.

   ' highlight the private properties
Public Sub AddClassProperties()

Dim oTextSelection As TextSelection = DTE.ActiveWindow.Selection
Dim iLinesSelected = oTextSelection.TextRanges.Count
Dim colPropertyList As New Collection()
Dim iIndex As Integer
Dim oStart As EditPoint = oTextSelection.TopPoint.CreateEditPoint()
Dim oEnd As TextPoint = oTextSelection.BottomPoint

'Create an Undo context object so all the changes can be
'undone by CTRL+Z
Dim oUnDo As UndoContext = DTE.UndoContext

'Supress the User Interface. This will make it run faster
'and make all the changes appear once
DTE.SuppressUI = True

Try

oUnDo.Open("Comment Line")

Dim sProperty As String
Dim sLineOfText As String

Do While (oStart.LessThan(oEnd))

sLineOfText = oStart.GetText(oStart.LineLength).Trim
'*** do some kind of simple check to make sure that this line
'*** isn't blank and isn't some other kind of code or comment
If (sLineOfText.IndexOf(" As ") >= 0 And ( _
(sLineOfText.IndexOf("Public ") >= 0) Or _
(sLineOfText.IndexOf("Private ") >= 0) Or _
(sLineOfText.IndexOf("Dim ") >= 0) Or _
(sLineOfText.IndexOf("Protected ") >= 0) Or _
(sLineOfText.IndexOf("Friend ") >= 0) Or _
(sLineOfText.IndexOf("ReDim ") >= 0) Or _
(sLineOfText.IndexOf("Shared ") >= 0) Or _
(sLineOfText.IndexOf("Static ") >= 0) _
)) Then

sProperty = oStart.GetText(oStart.LineLength).Trim.Replace(" New ", " ").Replace("()", "")

colPropertyList.Add(sProperty)
End If

oStart.LineDown()
oStart.StartOfLine()

Loop

If colPropertyList.Count > 0 Then

For Each sProperty In colPropertyList
Call InsertProperty(sProperty)
Next

Else
MsgBox("You must select the class properties")
End If

Catch ex As System.Exception

Debug.WriteLine(ex)
If MsgBoxResult.Yes = MsgBox("Error: " & ex.ToString & vbCrLf & "Undo Changes?", MsgBoxStyle.YesNo) Then
oUnDo.SetAborted()
End If

Return
Finally

'If an error occured, then need to make sure that the undo context is cleaned up.
'Otherwise, the editor can be left in a perpetual undo context
If oUnDo.IsOpen Then
oUnDo.Close()
End If

DTE.SuppressUI = False
End Try


End Sub

Private Sub InsertProperty(ByVal sProp As String)
Dim oTextSelection As TextSelection = DTE.ActiveWindow.Selection
Dim sMember As String = sProp.Substring(sProp.IndexOf(" ")).Trim
Dim sDataType As String
Dim sName As String
Dim i As Integer
Dim iAscVal As Integer

i = sMember.IndexOf("(")
If Not i = -1 Then
sMember = sMember.Substring(0, i)
End If

i = sMember.IndexOf("=")
If Not i = -1 Then
sMember = sMember.Substring(0, i)
End If

sDataType = sMember.Substring(sMember.IndexOf(" As ") + 1)

For i = 0 To sMember.Length - 1
'iAscVal = Asc(Mid(sName, i, 1))
iAscVal = Asc(sMember.Chars(i))
If iAscVal > 64 And iAscVal < 91 Then
sName = sMember.Substring(i)
Exit For
End If
Next i

sName = sName.Substring(0, sName.IndexOf(" As ") + 1).Trim

If sName.Length = 0 Then
MsgBox("Unable to process the class property: " & sMember & ". This is usually caused by an incorrect naming convention (e.g. not cxName)")
Return
End If

sMember = sMember.Substring(0, sMember.Length - sDataType.Length).Trim

With oTextSelection
.MoveToPoint(.ActivePoint.CodeElement(vsCMElement.vsCMElementClass).GetEndPoint(vsCMPart.vsCMPartWhole))
.LineUp()
.EndOfLine()

.Text = "Public Property " & sName & "() " & sDataType
.NewLine()
.Text = "Return " & sMember
.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, True)
.Copy()
.LineDown(False, 3)
DTE.ExecuteCommand("Edit.Paste")
.Text = "Me." & sMember & " = Value"
.LineDown(False, 2)
.NewLine(2)

End With

End Sub

 

 

Update1: When using code that you cut and paste from here, you might need to first paste it into Word or Wordpad.

Update2: When using this macro, you need a space (new line) between the last private field variable and your end of class line.

Categories:  |  |  | 
Thursday, April 27, 2006 8:53:16 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

App.Config functionality for Class Library Assembiles#

I was just reading this site:

http://www.bearcanyon.com/dotnet/#AssemblySettings

I downloaded the sample code (link below).  It is supposed to allow you to have a config file per assembley e.g. MyAssembly.dll.config. 

I haven't looked at the code, but I guess you would just write something that uses reflection to find the assembly name, and then look for an xml file to read.

AssemblySettings.zip (10.5 KB)

 

Categories:  |  |  | 
Thursday, April 20, 2006 1:25:32 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Implementing System.ICloneable and a Snippet#
This will provide the necessary functions to implement ICloneable as well as a type specific Clone method.
        
Public Function Clone() As ClassName
Dim bFormatter As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
Dim stream As New System.IO.MemoryStream()
bFormatter.Serialize(stream, Me)
stream.Seek(0, System.IO.SeekOrigin.Begin)
Dim newClone As ClassName
newClone = CType(bFormatter.Deserialize(stream), ClassName)
Return newClone
End Function
Private Function ICloneableImplementation() As Object Implements System.ICloneable.Clone
Return Me.Clone
End Function


I wrapped this into a snippet that you can import into Visual Studio 2005.

Implement ICloneable.snippet (1.84 KB)


Categories:  |  |  |  | 
Thursday, April 20, 2006 8:00:40 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Quickbooks Integration#
AcctSync is a .NET SDK for integrating stuff into quickbooks.

Update: I first made this post in 2003, but I have another client that is going to be looking to do something with Quickbooks.  Might want to revisit this component in the near future.
Categories:  | 
Thursday, April 13, 2006 2:40:26 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Troubleshooting .NET Applications - Knowing Which Tools to Use and When#
This whitepaper: Troubleshooting .NET Applications - Knowing Which Tools to Use and When talks about different methods for debugging .net applications, and talks about the various tools available to aid in the debugging efforst.
Categories:  | 
Friday, March 24, 2006 7:27:28 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

More Testing Tools and Testing Pages#
NUnit is good, but I think something that is more focused on Acceptance Testing or Functional Testing would be better suited.

TestComplete and to a possibly lesser extent, WebKing seem to focus on these more.

In addition, I might be able to use the MS ACT for this.
This guy thinks that FIT(.net version?) and the FitNesse framework are the ways to go.

Microsoft has it's own Testing Patterns and Practices section.

If all else fails... here are tons of links about functional testing.
Categories:  |  | 
Thursday, March 18, 2004 2:08:52 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Test Driven Development with NUnit#
NUnit is supposed to help with TDD and writing test scripts. I also found a link to ASP.NET addin which I guess I'll need for working with ASP.NET.(?)

Here is another MSDN article... but there is a newer on in the lastest MSDN magazine... but I guess that isn't online.
Categories:  |  |  |  | 
Wednesday, March 17, 2004 10:49:07 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

New Version of Dundas Charts#
Categories:  |  |  | 
Tuesday, January 20, 2004 12:30:30 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Programming Intellisense#
Here is an article that I would have loved to have read like a year ago.
Categories:  |  |  | 
Tuesday, January 20, 2004 12:27:08 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

nTierGen Data Access Layer#
nTierGen is another data access layer generator, but it generates a bunch of SPs as well as the DAL.
Categories:  |  |  |  | 
Friday, January 09, 2004 8:29:03 AM (Central Standard Time, UTC-06:00) #    Comments [0]  |