Monday, May 12, 2008
Multiple websites on XP
You can get it here: http://jetstat.com/iisadmin/
Wednesday, April 30, 2008
Not able to map Network Drive? Read on..
The network folder specified is currently mapped using a different user name and password.To connect using a different user name and password, first disconnect any existing mappings to this network share.
And when you see your network mappings, strangely the drive is not mapped :(
Well, the solution is old reliable DOS commands. here it goes:
> net use
> net use \\SharedDrive /delete
net use command displays a list of all mapped drive. there will be a IPC$ mapping for the drive you want to connect to. Just delete the sharing and then you will be able to connect to the server.
FYI: The Inter-Process Communication (IPC) share or ipc$ is a network share on computers running Microsoft Windows. This share is used to facilitate communication between processes and computers, often to exchange authentication data between computers.
Wednesday, April 11, 2007
HTML Table Sort
Tuesday, February 27, 2007
Regex | Validate email
So, here's the JavaScript code to validate the e-mail address as per RFC. Please correct it if there are any discrepancies.
function checkMail(emailAdd)
{
var regExobj = /^[-!#$%&'*+/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+/0-9=?A-Z^_a-z{|}~])*@[a-zA-Z](-?[a-zA-Z0-9])*(\.[a-zA-Z](-?[a-zA-Z0-9])*)+$/;
return(regExobj.test(emailAdd));
}
.Net Free Charting Solution | ZedGraph
ZedGraph is a set of classes, written in C#, for creating 2D line and bar graphs of arbitrary datasets. The classes provide a high degree of flexibility -- almost every aspect of the graph can be user-modified. At the same time, usage of the classes is kept simple by providing default values for all of the graph attributes. The classes include code for choosing appropriate scale ranges and step sizes based on the range of data values being plotted.
ZedGraph also includes a UserControl interface, allowing drag and drop editing within the Visual Studio forms editor, plus access from other languages such as C++ and VB. ZedGraph is licensed under the LGPL.
ZedGraph Home Page: http://zedgraph.org/wiki/index.php?title=Main_Page
ZedGraph Tutorial: http://codeproject.com/csharp/zedgraph.asp
Wednesday, January 17, 2007
Create Comments Faster | Visual Studio 2005
public void AppendHtmlText(HtmlProvider htmlProvider){...}
would be:
///
/// Appends the HTML text.
///
/// The HTML provider.
public void AppendHtmlText(HtmlProvider htmlProvider)
{
...
}
Some more examples are:
///
/// Gets the
///
///
public string this[int index] {
get { ... }
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
///
/// Gets or sets a value indicating whether
/// this
///
///
///
///
public bool Cool
{
get { return true; }
set { ; }
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
///
/// Determines the size of the page buffer.
///
///
/// Size of the initial page buffer.
///
public int DeterminePageBufferSize(int initialPageBufferSize)
GhostDoc can be downloaded from here.
Tuesday, January 16, 2007
Smart Paster | Add-In for Visual Studio
Wednesday, December 20, 2006
JavaScript | String Concatenation
There are some options to improve performance in these scenarios where string concatenation is required:
- Minimize the size of the string that is being appended to (so there is less memory to reallocate) . This means use local variables inside for loop and the concatenate these small strings to main HTML string variable. e.g.:
buf += "";
";
for (var i=0; i < ROWS; i++){
var row = ""; ";
for (var j=0; j < COLS; j++){
row += "" + CELL + " ";
}
row += "
buf += row
}
buf += "
- The Array object join method provides us a way to join all the elements of an array into a single string separated by a specified string separator. If we will assign each string as an element in the Array and will join all the elements with an empty char as our separator we will have the same result as using the + operator. This method is very similar to Java's StringBuffer object. e.g.:
var buffer = new Array();
buffer[buffer.length] = "Hello";
buffer[buffer.length] = " World";
buffer.join("");
Monday, November 27, 2006
Zip-Up
A sample implementation for VB6 can be found HERE
Another freeware (this one for .Net) is available at kellermansoftware.com
So, Zip-Up ur application ;)
Monday, September 04, 2006
Is 0=="" true or false?
Hope you guys don't have to go through such bugs. Best of Luck.
Monday, August 28, 2006
Impersonation in .Net
Here's the Microsoft kb article to how to impersonate your piece of code:
http://support.microsoft.com/kb/306158/
Sunday, August 20, 2006
CTRL + C, CTRL + V
Till date I was not aware of an easy way to copy this text and was manually typing the content. But recently one of my friend showed me a very simple way to do this, CTRL+C, CTRL+V. Yes, it works for dialog boxes. Whenever a dialog box pops up, just do a copy paste and you have the contents.
That's the power of copy-paste ;)
Monday, August 14, 2006
JavaScript | Redirect Parent Window
Well the solution to this problem is a simple javaScript. It goes something like this (I have executed the script on page load. It can be used with any event)
<body onload="opener.location='http://google.com';self.close();">
Sunday, August 13, 2006
Interesting XSLT Problem
<?xml version="1.0" encoding="UTF-8"?>
<category>
<type>1</type>
<value>20</value>
</category>
<category>
<type>2</type>
<value>10</value>
</category>
<category>
<type>1</type>
<value>25</value>
</category>
<category>
<type>2</type>
<value>40</value>
</category>
<category>
<type>2</type>
<value>41</value>
</category>
</categories>
to something like:
<?xml version="1.0" encoding="UTF-8"?>
<output>
<grid>
<type val="1">
<value>20</value>
<value>-NA-</value>
<value>25</value>
<value>-NA-</value>
<value>-NA-</value>
</type>
<type val="2">
<value>-NA-</value>
<value>10</value>
<value>-NA-</value>
<value>40</value>
<value>41</value>
</type>
</grid>
</output>
I spent couple of hours figuring out how to solve it. Then I came across an interesting XPATH statement at http://www.topxml.com/code/default.asp?p=3&id=v20040207215613&ms=100&l=&sw=All to retrieve distinc values. I worked upon it and wrote the following XSLT which strangely worked :)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<Output>
<Grid>
<xsl:for-each select="//category[not(type=preceding::category/type)]/type">
<xsl:element name="type">
<xsl:attribute name="val"><xsl:value-of select="."/></xsl:attribute>
<xsl:call-template name="map">
<xsl:with-param name="type">
<xsl:value-of select="."/>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
</xsl:for-each>
</Grid>
</Output>
</xsl:template>
<!--Called Once for each type -->
<xsl:template name="map">
<xsl:param name="type"/>
<xsl:for-each select="//category[not(value=preceding::category/value)]/value">
<xsl:call-template name="checkAvailability">
<xsl:with-param name="type">
<xsl:value-of select="$type"/>
</xsl:with-param>
<xsl:with-param name="value">
<xsl:value-of select="."/>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<!-- Called once for each value -->
<xsl:template name="checkAvailability">
<xsl:param name="type"/>
<xsl:param name="value"/>
<value>
<xsl:choose>
<xsl:when test="//category[type=$type and value=$value]">
<xsl:value-of select="$value"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>-NA-</xsl:text>
</xsl:otherwise>
</xsl:choose>
</value>
</xsl:template>
</xsl:stylesheet>