Tuesday, December 23, 2008

Internet Explorer / Google Chrome (Gradients)



Comparrison of Internet Explorer and Google Chrome displaying gradients. Can you tell the difference?


Friday, December 5, 2008

Visual Studio Closes when Opening a Solution

I had an issue today where Visual Studio closed as soon as a Solution was opened. Really difficult to troubleshoot right? I believe the problem is in the Web.config. Change the name of Web.config and then try to open up the solution.

The Solution was .NET 2.0 and there were .NET 3.0 values in the Web.config

Saturday, November 15, 2008

Remove Meraki Toolbar

I'm down in Zihuatanejo, Mexico right now on a Meraki network at the condo. There is a toolbar at the top of each Web page in Internet Explorer generated from HTML injection by the network. The network here is not free. It was set up by another condo owner, and he either doesn't know how to turn off the toolbar or likes the extra Google search option at the top right of the page :) This explaination is given if you click on the '?' in the toolbar:

"The toolbar at the top of your browser serves up local advertising, which is one of the ways we may be able to keep Internet access free."

Personally, I don't like anyone to have control over my browser...not even me! I found out that this toolbar can be removed in FireFox using an add-on called Adblock Plus which is a free download.

  1. Open FireFox
  2. Tools
  3. Get Extensions (bottom left link)
  4. Search for 'Adblock Plus' and then 'Add to FireFox'
  5. Add a filter: 'meraki.com/toolbar'


Unfortunately, Adblock Plus is not available for Internet Explorer. It is very interesting to read the developer's comments regarding the cost of creating an IE add-on that performs the same task: http://adblockplus.org/blog/adblock-for-internet-explorer-is-not-an-option

Be careful of rip-offs for Internet Explorer with the same name:
http://www.download.com/Adblock-Plus-for-IE/3000-12770_4-10690444.html

I develop custom applications and only test in Internet Explorer becacause our customers use IE. I really don't like to switch between browsers, but while I am on this network I will be using FireFox. I'm glad that there's an alternative that allows me to feel comfortable, cozy, and secure.

Thursday, August 21, 2008

HTTP 401.2 - Unauthorized

Look in your Web.config for:

<authorization> <deny users="?"/> </authorization>

This could be causing the error.

Saturday, August 16, 2008

Telerik with VS 2008 - Working with 2.0 Framework

I am having a problem getting Telerik to work with the .NET 2.0 framework in Visual Studio 2008. After everything was set up correctly, the final solution was to RE-START VISUAL STUDIO! RE-START VISUAL STUDIO!


Here is the properties of the DLL in our Library folder which we reference:



Originally, the Telerik installation only installed the 3.5 components. I unchecked all of the 3.5 components and created a new tab in the Toolbox. Then I Browsed to the Telerik DLL above and the result was that these components were added.



When I drag a control onto an ASPX page, this is the error I receive:




Here is the Web References:



Here is the Build settings:

Thursday, August 14, 2008

File has invalid value ">>>>>>> .mine".
Illegal characters in path.


This error is caused by the Subversion "Resolved..." function.

Delete the /obj folder in each project that is complaining and re-compile.

 


 

Wednesday, August 13, 2008

Cannot update project reference. Source project not available.

Steps:

1. Right click over web site project

2. select property pages

3. inside category References search the project for (unavalable)

4. select and remove those references

 


 

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>

Wednesday, June 25, 2008

Filter Background Not Showing Up
in RadGrid ASP.NET












The RadGrid Skin now uses RadGridMenu for the Filtiring dropdown. To modify an existing RadGrid Skin:

1. Set the Skin property of the RadGrid to an existing Skin name
2. Set the RadGrid property EnableEmbeddedSkins="False"
3. Manually create a link to the CCS on the page (or MasterPage) for both the RadGrid and RadMenu

Example:

<link id="RadGridSkinCss" href="~/Skins/Telerik/Grid.Telerik.css" rel="stylesheet" type="text/css" runat="server" />
<link id="MenuSkinCss" href="~/Skins/Telerik/Menu.Telerik.css" rel="stylesheet" type="text/css" runat="server" />

Now you can modify the CSS and make changes to the RadGrid.

Friday, June 20, 2008

Free Icon Creator and Editor

I love free software that is quality. Only 1.46 MB in file size for the download. The product is as intuitive as any graphic editor. Why can't Adobe include something like this in Fireworks?

IcoFX (http://icofx.ro/)
An award winning freeware icon editor. It is an all-in-one solution for icon creation, extraction and editing. It is designed to work with Windows XP, Windows Vista and Macintosh icons supporting transparency.

And if you don't have a free graphic editor yet...

Paint.NET
http://www.getpaint.net/

SQL International Date Format
(Insert / Update)

You will run into problems with SQL insert and updates if an application is hosted under a different regional setting than your development environemnt. To resolve this issue, if you are creating a string SQL statement then format the string as follows:

yyyy-mm-ddThh:mi:ss[.mmm]

Another option is to use parameterized queries.

Tuesday, June 17, 2008

Oracle Deleted DAT File
Failed Server Startup

It makes perfect sense...right? If you are a Database Server and you can't find a .DAT file, don't start the server. Make me jump through hoops to get the server back up and running. Here's the error message:

Errors in file d:\oracle\product\10.1.0\admin\server\bdump\server_dbw0_352.trc:ORA-01157: cannot identify/lock data file 21 - see DBWR trace fileORA-01110: data file 21: 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\SERVER\DATABASE_NAME'ORA-27041: unable to open fileOSD-04002: unable to open fileO/S-Error: (OS 2) The system cannot find the file specified.

Here's the solution:

http://www.mydigitallife.info/2007/08/04/how-drop-tablespace-and-recover-oracle-database-when-accidentally-delete-datafile/

Tips for Connecting
  1. Launch SQL Plus using '/nolog' in the command line. You can also right-click on the SQL Plus shortcut and add ' /nolog' to the executable path.
  2. Type: 'conn sys as sysdba'
  3. Enter your password

Monday, June 16, 2008

Display Server Information on the Desktop

Background Info is a small application you place in your StartUp folder to display server information on your desktop. It comes in handy when you manage a number of servers through Remote Desktop, and you need to know which server you have remoted into (it can be confusing sometimes).

http://technet.microsoft.com/en-us/sysinternals/bb897557.aspx

Here is my sample BgInfo configuration:

***************************************
<Host Name> SERVER (User: <User Name>)

IP Addresses: <IP Address>

Free Space: <Free Space>

Volumes: <Volumes>

CPU: <CPU>
Memory: <Memory>

OS Version: <OS Version>
Service Pack: <Service Pack>

MAC Address: <MAC Address>
***************************************

Note: It is probably best to place the .exe in a location like C: and a shortcut to the .exe in the Startup folder. Save out your configuration (bgi). Then you can add the parameters to the shortcut as:

C:\Bginfo.exe C:\bginfo.bgi /SILENT /timer 0

This will start the application without the timer window and shut off all error messages.

Wednesday, June 11, 2008

Update One Oracle Column with the
Data from Another Table

The Good Oracle Update

UPDATE TABLE_A SET COLUMN_A = (SELECT TABLE_B.COLUMN_B FROM TABLE_B WHERE TABLE_A.COLUMN_A = TABLE_B.COLUMN_B)
WHERE EXISTS (SELECT TABLE_B.COLUMN_B FROM TABLE_B WHERE TABLE_A.COLUMN_A = TABLE_B.COLUMN_B)

The Bad Oracle Update
(unless you want to wipe out the data in TABLE_A.COLUMN_A when there is no match)


UPDATE TABLE_A SET COLUMN_A = (SELECT TABLE_B.COLUMN_B FROM TABLE_B WHERE TABLE_A.COLUMN_A = TABLE_B.COLUMN_B)

Sunday, June 8, 2008

Microsoft Windows XP Professional Version 2002 OEM
Serial Number Location

I bought Microsoft Windows XP Professional SP3 English for System Builders 1 Pack CD - OEM from Newegg http://www.newegg.com/Product/Product.aspx?Item=N82E16832116515

After opening the product and throwing away the wrapper, I started the installation and then looked for a license key. I couldn't find it anywhere! That's because Microsoft put it on the cellophane wrapper which was in my trash.

I happened to find the answer on Mac-Pro

http://www.mac-pro.com/Microsoft-OEM-Windows-XP-2002-Pro-DSP
After receiving your copy of Windows XP be careful not to throw away the "product key," which is printed on a sticker affixed to the outside of the software's cellophane wrapper. You will need the product key in order to activate the software.

C# Maximum DateTime

12/31/9999 11:59:59 PM

ASP.NET Task Scheduler:
Windows Service / Web Service or Web Page


















The C# (Visual Studio 2008) solution is here:

The application works. You will have to download the source code, re-import your service method and re-compile. I will work on the project when I have time to make it easier to implement, but it provides a good start towards a solution.
Since the Web Service and re-compilation made it more difficult, I thought I could simplify by making a call to a Web Page instead and use the Page_Load event. I tried to use the WebClient object which worked from a Windows Form but would not work from a Windows Service, even with Administrative privledges. I ended up using some code from a site:


Stream str = null;
HttpWebRequest wReq = (HttpWebRequest)WebRequest.Create("http://www.site.com/tick.aspx");
HttpWebResponse wRes = (HttpWebResponse)(wReq).GetResponse();
str = wRes.GetResponseStream();

I was experiencing a error:

The operation has timed out
You must call either the Stream..::.Close or the HttpWebResponse..::.Close method to close the stream and release the connection for reuse. It is not necessary to call both Stream..::.Close and HttpWebResponse..::.Close, but doing so does not cause an error. Failure to close the stream will cause your application to run out of connections.
So, I added...

str.Close();
str = null;
wRes.Close();
wRes = null;
wReq = null;

It works....


Added 8/25/2008
I zipped up the Source which can be found in this folder:




Saturday, June 7, 2008

Windows Service:
Path to Executable

Working on a Windows Service, trying to get the path to the executable which is displayed in the properties of the service as "Path to executable:"

using System.IO

string pathToExecutable = System.Reflection.Assembly.GetExecutingAssembly().Location;
FileInfo fileInfo = new FileInfo(pathToExecutable);
string pathToConfig = fileInfo.DirectoryName + @"\Configuration.xml";

Wednesday, May 21, 2008

Tortise SVN Optimization and Tweaks

TortiseSVN settings are not the best by default. To get to the settings, right click on a folder and: TortiseSVN / Settings

General:
If you have not started using Tortise, I would recommend checking the box that says "Use '_svn" instead of ".svn" directories. DO NOT CHECK THIS IF YOU ALREADY HAVE FOLDERS USING SVN.
http://lisazhou.wordpress.com/2008/03/09/can-not-open-visual-studio-net-2003-project-once-added-to-svn-problem-resolved/
If it causes problems in VS 2003, it may cause problems with other applications as well.

Icon Overlays:
I noticed that there was a process in Task Manager called "TSVNCache.exe" which is taking up 60k of memory and running at 1-2% every other second causing I/O on the hard drive. My laptop has been running slow, so I was searching to increase speed. I found out that by default, TortiseSVN is set to Overlay all of C:\ and any other Fixed drives.

1. Check Fixed Drives, but exclude them in "Excluded paths:"
C:\*
D:\*

2. Include the paths to the root folders which are using Subversion:
D:\MyApps\*

3. Open up Task Manager and right-click on the TSVNCache.exe process. Choose "Set Priority / Low".

It's amazing how my hard drive has stopped thrashing!

Mailing Address Validation

If you would like to ensure that your customer entered in a correct mailing address, there are a number of options:

UPS OnLine Tools
http://www.ups.com/content/us/en/bussol/offering/technology/automated_shipping/online_tools.html
Sign up and use UPS Address Validation Tool -Ensures that customer-entered shipping addresses are correct at the time of order processing (XML)

FedEx Address Checker
http://www.fedex.com/avs/us_english/?link=4

US Postal Service Address Validation
http://www.eggheadcafe.com/articles/20060430.asp

Sunday, May 18, 2008

Email Validation C#

There are three levels of validating an email address:
  1. Syntax Validation: Does it have an @ sign and at least one full stop, are the left and right hand sides of the @ valid, searching the internet will give you all the things an email address must have.
    http://www.cambiaresearch.com/c4/bf974b23-484b-41c3-b331-0bd8121d5177/Parsing-Email-Addresses-with-Regular-Expressions.aspx
  2. Resolve the Domain: You will need to do a DNS MX lookup, there is a nice C# dll on the internet should be easy to find.
    http://aspalliance.com/744_CodeSnip_Resolving_Domain_Names__and_IP_Addresses
  3. Use a Socket: Actually go through the process of sending an email and then stop just before issuing the .quit command.
    http://www.eggheadcafe.com/articles/20030316.asp

Thursday, May 15, 2008

Convert ArrayList of Objects to DataTable

using System;using System.Collections;
using System.Data;using System.Reflection;
using System.Collections.Generic;
using System.Text;

public static class Util
{
public static DataTable ConvertArrayListToDataTable(ArrayList arrayList)
{
DataTable dt = new DataTable();

if (arrayList.Count != 0)
{
dt = ConvertObjectToDataTableSchema(arrayList[0]);
FillData(arrayList, dt);
}

return dt;
}

public static DataTable ConvertObjectToDataTableSchema(Object o)
{
DataTable dt = new DataTable();
PropertyInfo[] properties = o.GetType().GetProperties();

foreach (PropertyInfo property in properties)
{
DataColumn dc = new DataColumn(property.Name);
dc.DataType = property.PropertyType; dt.Columns.Add(dc);
}
return dt;
}

private static void FillData(ArrayList arrayList, DataTable dt)
{
foreach (Object o in arrayList)
{
DataRow dr = dt.NewRow();
PropertyInfo[] properties = o.GetType().GetProperties();

foreach (PropertyInfo property in properties)
{
dr[property.Name] = property.GetValue(o, null);
}
dt.Rows.Add(dr);
}
}
}

Tuesday, May 13, 2008

Visual Studio ASP.NET Formatting Setting Tip

Tools / Options...

I'm always having to type in quotations for parameter values. Check this box to have Visual Studio do it for you...



If I format a control how I want and then paste another value in, Visual Studio re-formats the control and destroys my work! Uncheck the Format HTML on Paste checkbox...


Telerik Open Window and
Close From Opened Window

OPEN WINDOW
<script type="text/javascript"> //<
![CDATA[
function OpenWindow(name)
{
var mgr = GetRadWindowManager();
}
//]]> </script>

<button id="btnDeleteCustomer">Open with radopen</button> <radW:RadWindowManager ID="RadWindowManager1" runat="server"> <Windows>
<radW:RadWindow
ID="DeleteCustomer"
NavigateUrl = "DeleteBusiness.aspx"
Skin="Default"
VisibleOnPageLoad = "false"
OpenerElementId = "btnDeleteCustomer"
OffsetElementID = "offsetElement"
Top = "115"
Left = "30"
Width = "700px"
Height = "600px"
runat="server"
/>
</Windows>
</radW:RadWindowManager>


CLOSE FROM OPENED WINDOW
<script type="text/javascript">
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;

return oWindow;
}

function CloseWindow()
{
var oWindow = GetRadWindow();
oWindow.Close();
}
</script>

Monday, May 12, 2008

Telerik Rad Window Alert

ASP.NET
<%@ Register TagPrefix="rad" Namespace="Telerik.WebControls" Assembly="RadWindow.Net2" %>

<rad:RadWindowManager ID="RadWindowManager1" runat="server" Left="" NavigateUrl="" Skin="Office2007" SkinsPath="~/RadControls/Window/Skins" Title="" Top="">
</rad:RadWindowManager>


C#

protected void btnSave_Click(object sender, EventArgs e)
{
string strWindowTitle = "Saved";
string strAlert = "Settings have been Saved.";
string strWidth = "330";
string strHeight = "200";

string alert = "<script language='javascript'>" + "radalert('" + strAlert + "', " + strWidth + ", " + strHeight + ", '" + strWindowTitle + "');" + "</script>";

Page.RegisterStartupScript("AlertScript", alert);
}

Sunday, May 11, 2008

Telerik.WebControls.GridInsertionObject



In attempting to use the edit form of the Telerik Grid Control, there is an error when there are no records in the table when using an ArrayList of Objects. Since no Objects are in the array list, the RadGrid cannot determine the column headings or the fields for editing. A way around this is to create a DataTable with the proper headings for the fields which need to be entered.


ArrayList units = unitsBusinessLogic.GetAll();

if (units.Count == 0)
{
DataTable dt = new DataTable();
DataColumn dc = new DataColumn("Name", System.Type.GetType("System.String"));
dt.Columns.Add(dc);
dc = new DataColumn("AccessCode", System.Type.GetType("System.String"));
dt.Columns.Add(dc);
RadGrid1.DataSource = dt;
}
else
{
RadGrid1.DataSource = units;
}

Monday, May 5, 2008

Microsoft Error Message - Move or Copy


How do you answer this question? Do you want to move or copy files from this zone? Two choices...Yes or No

Wednesday, April 23, 2008

Life Expectancy and Longevity - 120 years

The Maximimum Life of a Human is 120 Years
http://creationwiki.org/Human_longevity

Man Lives to 70 or 80 if he has the Strength
http://www.kerala.com/wiki-Longevity
The mainstream view on the future of longevity, such as the US Census Bureau, is that life expectancy in the USA will be in the mid-80s by 2050 (up from 77.85 in 2006) and will top out eventually in the low 90s, barring major scientific advances that can change the rate of human aging itself, as opposed to merely treating the effects of aging as is done today. The Census Bureau also predicted that the USA would have 5.3 million people aged over 100 in 2100.

Life Expectancy is Declining in the United States
http://www.voanews.com/english/AmericanLife/2008-04-22-voa57.cfm
Ezzati finds this a grim statistic for an industrialized nation. "We don't associate worsening of health, worsening of life expectancy with something that happens in a developed high-income country." Ezzati finds this a grim statistic for an industrialized nation. "We don't associate worsening of health, worsening of life expectancy with something that happens in a developed high-income country."

Saturday, April 5, 2008

Free Subversion Repository Space (500 MB)

Every so often I come across a good thing. It's rare, but when I find it I just want to tell everyone about it.

http://www.assembla.com/

The site is fast, simple, productive, and you can start a project for free.

Our Development team uses Perforce, so our Consulting team decided to piggy-back on what was already being used. After fighting Perforce and losing 3 days of code which was overwritten during a sync, we decided to try something else. The Microsoft solution was going to cost us 10k, Visual Source Safe was cheap and old, so we decided to go with something free and fresh - Subversion. There's no turning back now.

Subversion has a wonderful interface and it has never eaten my hours of development time by copying the old files down to my local - overwritting my work. Sometimes it is difficult to get the Subversion repository sync'd due to conflicts, but we have always managed to figure out a way to make it happen.

In searching for free Subversion storage for a personal project, I came across Assembla. I thought "Oh great, another lame free site. What will I have to put up with for some storage?"

I was shocked. I could have used something like SourceForge or Microsoft's Codeplex but to be honest, these sites confuse me. Google hasn't even stepped up to 'logical site design' at Google Code The free source control sites seem to be littered with advertisements and they lack good navigation. It's like they were designed by programmers :)

Whoever designed Assembla should be working for Google. Maybe Google will buy them out and change the name of the site to 'Googlembla". Whatever you want to call it, I call it a 'Top Pick'.

Give it a try! What have you got to lose?

Tuesday, February 26, 2008

C# Web Service Timeout

Make sure you set the Timeout to "-1" for 'infinite", otherwise you may end up with timeout errors at any point in your application that calls the service.

C# Code
MyWebService.WebService webService = new MyWebService.WebService();
webService.Url = ConfigurationManager.AppSettings["WebService.URL"];
webService.Timeout = Int32.Parse(ConfigurationManager.AppSettings["WebService.Timeout"]);


Web.config
<add key="WebService.URL" value="http://myserver.com/MyWebService.asmx">
<add key="WebService.Timeout" value="-1">

Undefined Object JavaScript Controls
Web Resources (.axd)

I ran into an issue with some Web Controls which use Web Resources to find their associated .js files. The problem is that some software blocks Web Resources on the server.

URLScan
allow for .axd files

IIS
  1. Open IIS management snap-in ( e.g. run inetmgr.exe)
  2. Right click your website and choose properties
  3. Go to the "Home Directory" tab and click the "Configuration" button
  4. A dialog should pop out and you would see the mappings listbox
  5. Find the entry for the ".axd" extension and edit it by clicking the "Edit" button
    In the new dialog uncheck the "Verify if file exist" checkbox - which I suspect is causing the problem.

SiteMinder

I had to uncheck "Verify that file exists" for the "Wildcard application map" for SiteMinder (Website Properties->Home Directory tab->Configuration). Once I made the change, my browser started receiving webResource.axd If this does not work for you, create an empty file named 'webresource.axd' and place it in the root of your application. Then the file will exist and it won't matter what the settings are in IIS or SiteMinder.

Friday, February 8, 2008

Burning Heart - Filled with the Spirit

After accepting Christ as Lord in college and walking with Him (seeing His power), I walked away to live my life. I wanted money, security, knowledge, and to experience the world. After ten years of this I recall crying out to God, "Where did you go? When will you come back in my life?" 

I was certain of my salvation, because it was a promise of God and He never lies. But I had lost fellowship. We moved and I got sucked into attending a church with my wife, expecting the same watered down messages I had heard in other churches. What I ended up hearing was the Word preached in Truth and I had to respond. How was it that I could believe I was saved without following Christ as Lord? I was broken in spirit as I read Psalm 51. The bride of Christ (me) had committed adultery with the world. "If you love me, you will obey what I command." - what do you command? "Love God with all of your heart, mind, soul, and strength" - how do I love God? "God so loved you that he gave His only Son." - then let me give myself to You. What is in your heart? The things of this world. The things that I have and the things that I do. 

I surrendered everything to the Lord, placing Him above everything else. It was then that self had died, and there was nothing for a moment. And in my heart I felt something. In the physical location of my upper left chest there was a feeling like menthol. 

That cool, burning feeling that was localized and small. But this was just the start. In a few moments my heart felt like it was wrapped with a heating pad turned on high. I couldn't move. I thought about calling 911, but trusted it was the Lord and calling for physical help for something spiritual would be pointless. My mind felt like there were hands in my head, pulling apart the two lobes of the brain. 

I had felt this same feeling when trying to cram a bunch of information into my head. This went on for some time. Then I could feel something in my heart, difficult to describe - like fingers moving parts of it around. A new sensation started. I can only describe it as my heart filled with a glowing liquid which would pour out over the top and run down the sides. This flow was not in a blood flow rhythm, but more like the rhythm of breath. The "pouring" of the glowing liquid continued. 

 It was at the most intense moment of the experience that I felt as if sin had been removed from me. To say that I had not sinned would be a lie, but at the moment in time I understood what it was like to be 'me' without the sinful nature. What a wonderful feeling to taste of what is to come. To enter into the Kingdom of God. I was doubled over, and the intensity grew until I begged the Lord to withdraw. I was afraid for my life, because I knew that my heart could not contain all of His Glory. 

The burning in my heart remained for the next 5 days with a high level of intensity, and for another 3 months it would burn during prayer, fellowship, worship, or temptation. I can understand how "every knee will bow and every tongue confess that Jesus Christ is Lord to the glory of the Father." Who is the fool that thinks they can stand before God? Jeremiah 20:9 "...his word is in my heart like a fire, a fire shut up in my bones." 

 I wanted to share this experience with you, because I had an expectation that many others have had a similar experience. To my disappointment, testimony has been difficult to find. I was not seeking an experience. There was nothing preconceived or expected. Just an open Bible, and an attempt to do what the Lord commanded - love God. 

I hope that you are able to experience the reality of a living Lord in your lifetime. Jesus isn't dead. He is alive and He sent out His Spirit into those who believe. The feelings are real. Real joy when there is nothing to be joyful of. Real peace when there is worry. I cannot point my finger to the instances of other spiritual fruit, but the Father may give out other blessings by His will.

 Don't seek the gifts. Seek the Giver. 


Here are some other links of similar experiences:

http://ezinearticles.com/?DL-Moody,-Rivers-of-the-Spirit&id=339618 "Immediately an overpowering sense of God’s presence flooded his soul. Almighty God had come to him. Without wasting a moment’s time Dwight locked himself in a nearby friend’s room so he could be alone with God. The room seemed ablaze with God. He stretched out on the floor and lay bathing his soul in the Divine. Of this communion and mountain top experience Moody later wrote, “I can only say that God revealed Himself to me, and I had such an experience of His love that I had to ask Him to stay His hand.” 

http://www.carm.org/testimonies/biff.htm "I took that step of no return in coming to Him with my heart wide open intent on proving to Him that I did love Him and would rather die now under His feet than live without Him for the rest of my life. And as I took that step towards Him that tiny spark of love hidden in my heart for Him suddenly became a flame, and the flame suddenly burst forth into a blazing inferno of love...for 'me' (John 14:23)! All things became new (2 Cor.5:17)! And after 20+ years of reflection I know what happened to me: The Old me DIED, and the New me went to heaven! The 'Old Man' died...yet 'lived' - yet it wasn't "I" any longer ("Gal.2:20")! No one can come to the Father except they go through Christ and Him crucified first! And to come to God through Christ is to come to the foot of the cross and die with and for him there. The cross spells 'Death' to the entire Old Creation! And so, from out of the ashes of that old me glowed a little spark of love towards his God, put there when I first believed, and then came God's power and caused that spark to blaze up into a flaming fire reaching heaven itself."

Wednesday, February 6, 2008

.NET 2.0 Exception Handling in Threads

public static void Main()
{
new Thread (Go).Start();
}

static void Go()
{
try
{
...
throw null; // this exception will get caught below
...
}
catch (Exception ex)
{
Typically log the exception, and/or signal another thread
that we've come unstuck
...
}

From .NET 2.0 onwards, an unhandled exception on any thread shuts down the whole application, meaning ignoring the exception is generally not an option. Hence a try/catch block is required in every thread entry method – at least in production applications – in order to avoid unwanted application shutdown in case of an unhandled exception.

Wednesday, January 2, 2008

Log4Net Debugging Trace Troubleshooting

I couldn't have made it work without the trace. Make sure the following sections are in your Web.config. Then look for the log files in the application root. The directory should have 'write' permissions for ASP.NET user.

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>

<system.diagnostics>
<trace autoflush="true">
<listeners>
<add name="textWriterTraceListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="log4net_trace.txt" />
</listeners>
</trace>
</system.diagnostics>

<appSettings>
<add key="log4net.Internal.Debug" value="true"/>
</appSettings>

<appender name="FileAppender" type="log4net.Appender.FileAppender">
<file value="log-file.txt" />
<appendToFile value="true" />
</appender>

<root>
<level value="ALL"/>
<appender-ref ref="FileAppender"/>
</root>

</log4net>

</configuration>

C# Log4Net Oracle Appender

<log4net>
<appender name="Oracle" type="log4net.Appender.AdoNetAppender">
<connectionType value="System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, publicKeyToken=b77a5c561934e089"/>
<connectionString value="Data Source=TNSName;User ID=MyTableSpace;Password=password;"/>
<commandText value="INSERT INTO LOG_TABLE (DATETIME, THREAD, LOG_LEVEL, LOGGER ,MESSAGE, EXCEPTION, APPDOMAIN, NDC) VALUES (:log_date, :thread, :log_level, :logger, :message, :exception, :appdomain, :ndc)"/>
<bufferSize value="1"/>
<parameter>
<parameterName value=":log_date"/>
<dbType value="DateTime"/>
<layout type="log4net.Layout.RawTimeStampLayout"/>
</parameter>
<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="2000"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%exception"/>
</layout>
</parameter>
<parameter>
<parameterName value=":appdomain"/>
<dbType value="String"/>
<size value="200"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%appdomain"/>
</layout>
</parameter>
<parameter>
<parameterName value=":ndc"/>
<dbType value="String"/>
<size value="2000"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%ndc"/>
</layout>
</parameter>
</appender>
<root>
<level value="ALL"/>
<appender-ref ref="Oracle"/>
</root>
</log4net>



Log Table Script

CREATE TABLE LOG_TABLE
(
DATETIME TIMESTAMP(3),
THREAD VARCHAR2(255 BYTE),
LOG_LEVEL VARCHAR2(255 BYTE),
LOGGER VARCHAR2(255 BYTE),
MESSAGE VARCHAR2(4000 BYTE),
EXCEPTION VARCHAR2(2000 BYTE),
APPDOMAIN VARCHAR2(200 BYTE),
NDC VARCHAR2(2000 BYTE),
ID NUMBER(10) NOT NULL
)
TABLESPACE MyTableSpace
PCTUSED 40
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
FREELISTS 1
FREELIST GROUPS 1
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX LOG_TABLE_PK ON LOG_TABLE
(ID)
LOGGING
TABLESPACE MyTableSpace
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
FREELISTS 1
FREELIST GROUPS 1
BUFFER_POOL DEFAULT
)
NOPARALLEL;


ALTER TABLE LOG_TABLE ADD (
CONSTRAINT LOG_TABLE_PK
PRIMARY KEY
(ID)
USING INDEX
TABLESPACE PWC
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
FREELISTS 1
FREELIST GROUPS 1
));

Check This Out!

More Links to Good Information