Thursday, July 31, 2008

Delete SVN Folders Windows Vista

In Windows XP there was no issue deleting SVN folders. I could just search for "SVN" in the directory and end up with a recursive list of SVN folders which I could delete through the Search interface. It doesn't work in Vista. Search and Delete works for other files, but for some reason those SVN files elude deletion. I can go to a directory directly and delete an SVN folder, but in the Search window nothing happens!

I found this which does work...

http://britishinside.com/archive/2008/03/06/The-Deleting-SVN-Folders-meme.aspx

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
@="Delete SVN Folders"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
@="cmd.exe /c \"TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (.svn _svn) DO RD /s /q \"%%f\" \""


Copy the text and paste it into a text file called 'svn.reg'. Save the file and open it to add these keys to your registry. Then all you have to do is right-click on the folder and choose "Delete SVN Folders". It's even easier than the Search and Delete method :)


Here's a Delete PDB files shell:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeletePDB]
@="Delete PDB Files"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeletePDB\command]
@="cmd.exe /c \"TITLE Removing PDB Files in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (*.pdb) DO DEL /s /q \"%%f\" \""



.

Monday, July 28, 2008

JavaScript Current URL Including Querystring

If you want to reload the current page with the same URL including the Querystring:

window.location = location.href;

Another recommendation was:

window.location.reload();

The one above worked for my needs, and the one below did not. I'm sure it depends on your situation.

WebDrive Automatically Downloading Files

I thought my FTP Client had been possessed by a ghost. WebDrive worked fine on Windows XP, but after installing on Windows Vista it got a life of its own. By browsing an FPT folder, it would start downloading files into the ether. Try canceling and it would come back to life to steal my bandwidth and download worthless bytes of data.

After a bit of digging I found this...

http://srthelpdesk.helpserve.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=62
WebDrive isn't automatically downloading the files it's actually Windows Explorer or another process downloading the files anytime something accesses them. Most likely there are programs running in the background such as anti virus real-time scanning that may be accessing these files. WebDrive will NEVER download a file on it's own, it's always in response to an application opening the file and reading data from it. Explorer column hanlders or thumbnail viewers do this.

You can try the following to prevent downloading by explorer

  • In Windows explorer, choose Tools/Folder Options / View Tab. Make sure "Show popup descriptions" is off, also make sure the explorer "View" mode is set to Details, not "Icons" or "Thumbnails".
  • Also in WebDrive make sure you have enabled "Disable shell column handlers" on the program settings/general settings dialog.
  • For Vista turn on the option "Disable explorer icon handler" on the site properties/file settings dialog.

So far so good. Computer exorcism has occurred and I'm back in business.

Windows Vista vs. Windows XP



Windows Vista is a turd. I have finally had to eat Vista for breakfast, lunch, and dinner and compared to XP it's a big slop of fat with lard icing. Besides the minor unnessesary changes, I have managed to lock up the system twice in the last 30 minutes to the point of re-boot. No more "blue screen of death". It's been replaced by a 'hanging processes' for infinity while 'end process' becomes a nice game of nothingness. It's a memory hog and a hard drive hog, and what have I gained? I have gained a machine that sounds like a jet engine which produces enough heat to cause my shoes to melt. Wow! A quad processor and 4GB of RAM that is needed to make this elephant fly.

I don't think it's really Microsoft's fault. Well, I guess it is...I'm sure I have programs installed that are not 'compatible' with Vista - whatever that means.

SQL DateTime British / U.S. Conversion Issue

When working with SQL Strings to input a DataTime in an application, an issue came up due to the month/day difference between British and U.S. conventions. The way around this issue is to use a paramaterized query, however there may be some situations when this is not possible (Web Service requires a string date parameter). The string format conversion I used for the DateTime is as follows:

yyyy-MM-dd HH:MM:ss.mmm

This seems to work except there is an issue with time. I haven't figured out what the issue is yet, but I wanted to post the format for anyone looking to resolve this issue.

Wednesday, July 23, 2008

The Most Clickable HTML Link Color

Web links should always be blue, but what color blue? I would say that hands down, the most clickable color is #0000CC Why? Because that's the link color that Google is using!

Click Me! I'm Google Blue

Background Image Top-Right Corner

Add a style to the Body tag:

STYLE="background-position: top right; background-repeat: no-repeat;"

Tuesday, July 22, 2008

Burned by Check Point VPN

http://www.checkpoint.com/

I received a nice new computer from work and installed Windows Ultimate 64bit OS on it. After spending the day getting everything installed and patched, the last installation failed. Check Point hasn't released their 64bit client yet. So sad. Check Point goes on the Do Not Call list. I'm re-installing a 32bit OS now...

Microsoft License Activation - Phone Number

If you are doing a computer installation and have to go through the hastle of calling Microsoft to get a license key, try this phone number:

1(800)936-5700

Wednesday, July 16, 2008

Server.Transfer vs. Response.Redirect

http://msdn.microsoft.com/en-us/library/ms998549.aspx

"Where possible, use the Server.Transfer method instead of the Response.Redirect method. Response.Redirect sends a response header to the client that causes the client to send a new request to the redirected server by using the new URL. Server.Transfer avoids this level of indirection by simply making a server-side call.

You cannot always just replace Response.Redirect calls with Server.Transfer calls because Server.Transfer uses a new handler during the handler phase of request processing. If you need authentication and authorization checks during redirection, use Response.Redirect instead of Server.Transfer because the two mechanisms are not equivalent. When you use Response.Redirect, ensure you use the overloaded method that accepts a Boolean second parameter, and pass a value of false to ensure an internal exception is not raised.

Also note that you can only use Server.Transfer to transfer control to pages in the same application. To transfer to pages in other applications, you must use Response.Redirect."

Monday, July 7, 2008

Live Meeting Give Control Grayed Out

1. Log into your Live Meeting
2. On the "My Home" screen click "Meet Now Details"
3. Click on "Meet Now Options"
4. Click on "Additional Features"
5. Make sure all of the setting on this page are correct to Give Control to your Desktop.

Wednesday, July 2, 2008

Log4Net Appender SQL 2005 Express

<appender name="SqlDatabase" type="log4net.Appender.AdoNetAppender">
<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<connectionString value="Data Source=192.168.1.3\SQLEXPRESS,2296;Database=MyDatabase;User Id=MyUser;Pwd=password;Trusted_Connection=False;" />

<commandText value="INSERT INTO QMC_A_LOG ([THREAD],[LEVEL],[LOGGER],[MESSAGE], [EXCEPTION]) VALUES (@thread, @log_level, @logger, @message, @exception)"/>
<parameter>
<parameterName value="@thread" />
<dbType value="String" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%thread" />
</layout>
</parameter>
<parameter>
<parameterName value="@log_level" />
<dbType value="String" /> <size value="50" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%level" />
</layout> </parameter>
<parameter> <parameterName value="@logger" />
<dbType value="String" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%logger" />
</layout> </parameter>
<parameter>
<parameterName value="@message" />
<dbType value="String" /> <size value="4000" />
<layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%message" />
</layout>
</parameter>
<parameter>
<parameterName value="@exception" /> <dbType value="String" />
<size value="4000" />
<layout type="log4net.Layout.ExceptionLayout" />
</parameter>
</appender>

C# Page Title Method
Space Between Propercase Letters

protected string GetPageTitle(string fileName)
{
string title = String.Empty;
string fileNameWithoutExtension = String.Empty;

string[] titleParts = fileName.Split('.');
fileNameWithoutExtension = titleParts[0];

char[] c = fileNameWithoutExtension.ToCharArray();

int i = 0; // Don't put a Space in front of the First Character
foreach (char character in c)
{
if (Regex.IsMatch(character.ToString(), "[A-Z]") && i != 0)
{
title += " " + character;
}
else
{
title += character;
}
i++;
}

return title;
}

Tuesday, July 1, 2008

Log4Net Appender MS Access
Local Database

If you want to use an Access Database in your App_Data directory for Log4Net, you can use the following...

<!-- *** log4net *** -->
<log4net debug="false">
<appender name="AccessDatabase" type="log4net.Appender.AdoNetAppender">
<connectionString value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DataDirectoryAccess.mdb;"/>
<commandText value="INSERT INTO Log ([Thread],[Level],[Logger],[Message], [Exception]) VALUES (@thread, @log_level, @logger, @message, @exception)"/>
<bufferSize value="1"/>
<parameter>
<parameterName value="@thread"/>
<dbType value="String"/>
<size value="255"/>
<layout type="log4net.Layout.PatternLayout" value="%thread"/>
</parameter>
<parameter>
<parameterName value="@log_level"/>
<dbType value="String"/>
<size value="50"/>
<layout type="log4net.Layout.PatternLayout" value="%level"/>
</parameter>
<parameter>
<parameterName value="@logger"/>
<dbType value="String"/>
<size value="255"/>
<layout type="log4net.Layout.PatternLayout" value="%logger"/>
</parameter>
<parameter>
<parameterName value="@message"/>
<dbType value="String"/>
<size value="4000"/>
<layout type="log4net.Layout.PatternLayout" value="%message"/>
</parameter>
<parameter>
<parameterName value="@exception"/>
<dbType value="String"/>
<size value="4000"/>
<layout type="log4net.Layout.PatternLayout" value="%exception"/>
</parameter>
</appender>
<root>
<level value="All"/>
<appender-ref ref="AccessDatabase"/>
</root>
</log4net>

Check This Out!

More Links to Good Information