Matt's Home On The Net
    Not posting very much these days!


Welcome to my website!   

I am so busy these days I never really get time to post on this site anymore but I will try and do some writing here soon :)



Latest Blog Entries

 09 January 2008


PNG files don't show in IE7 with Vista   
This has baffled me for a while now but I know a fix.  Basically I think this happens after you install firefox, and is something to do with the UAC because if you turn UAC IE7 off it works ok and you can see PNG files again.  I wouldn't recommend that as it defies the point of Vista UAC, instead run IE7 as administrator and all will work ok; I expect Microsoft will come up with a fix in an update soon enough.


matt morrison at 20:39 | (0) Comments | Add a comment | Permalink



 04 October 2007


Override 'Option Compare Text' with a binary comparison   
When we use 'Option Compare Text' at the top of the page we are saying that we want text comparisons to be case insensitive.  But what if we need to override that setting in a particular situation to do a binary (case sensitive) comparison?  Well we can use this method...

    Public Function BinaryEquality(ByVal String1 As String, _
    ByVal String2 As String) As Boolean
              BinaryEquality = (StrComp(String1, String2, _
              vbBinaryCompare) = 0)
    End Function


Matt Morrison at 16:27 | (0) Comments | Add a comment | Permalink



 04 October 2007


Regular expression which selects all characters invalid in a mangled href   
Insert this into a global class (not global.asax) for your website to reference all characters that are invalid in a mangled href...

Protected Shared reHRefCharacters As Regex = _
New Regex("[^a-zA-Z0-9/]+")


Matt Morrison at 16:12 | (0) Comments | Add a comment | Permalink



 04 October 2007


Trim a string to a specified length   
    Public Shared Function TrimLength(ByVal Str As String, _
    ByVal MaxLength As Integer) As String
           If Str.Length > MaxLength Then
                  TrimLength = Str.Substring(0, MaxLength)
           Else
                  TrimLength = Str
           End If
    End Function


Matt Morrison at 16:07 | (0) Comments | Add a comment | Permalink



 04 October 2007


Tracking TODO's in Visual Studio 2005   
Start by going to the menu bar and selecting 'View' then 'Task List', when the windows appears, notice you can select a drop down box that has two options: 'User Tasks' by default and then comments.  If you select 'comments', it will list all comments, the location and line number where you have written the comment prefixed with TODO:

So just write...

' TODO: Test

in any document and have a look for yourself!


Matt Morrison at 10:37 | (5) Comments | Add a comment | Permalink