Thursday, June 3, 2010

URL Encoding Reference

URL Encoding Reference

ASCII Character URL-encoding
space %20
! %21
" %22
# %23
$ %24
% %25
& %26
' %27
( %28
) %29
* %2A
+ %2B
, %2C
- %2D
. %2E
/ %2F
0 %30
1 %31
2 %32
3 %33
4 %34
5 %35
6 %36
7 %37
8 %38
9 %39
: %3A
; %3B
< %3C
= %3D
> %3E
? %3F
@ %40
A %41
B %42
C %43
D %44
E %45
F %46
G %47
H %48
I %49
J %4A
K %4B
L %4C
M %4D
N %4E
O %4F
P %50
Q %51
R %52
S %53
T %54
U %55
V %56
W %57
X %58
Y %59
Z %5A
[ %5B
\ %5C
] %5D
^ %5E
_ %5F
` %60
a %61
b %62
c %63
d %64
e %65
f %66
g %67
h %68
i %69
j %6A
k %6B
l %6C
m %6D
n %6E
o %6F
p %70
q %71
r %72
s %73
t %74
u %75
v %76
w %77
x %78
y %79
z %7A
{ %7B
| %7C
} %7D
~ %7E
%7F
%80
%81
%82
ƒ %83
%84
%85
%86
%87
ˆ %88
%89
Š %8A
%8B
Œ %8C
%8D
Ž %8E
%8F
%90
%91
%92
%93
%94
%95
%96
%97
˜ %98
%99
š %9A
%9B
œ %9C
%9D
ž %9E
Ÿ %9F
%A0
¡ %A1
¢ %A2
£ %A3
%A4
¥ %A5
| %A6
§ %A7
¨ %A8
© %A9
ª %AA
« %AB
¬ %AC
¯ %AD
® %AE
¯ %AF
° %B0
± %B1
² %B2
³ %B3
´ %B4
µ %B5
%B6
· %B7
¸ %B8
¹ %B9
º %BA
» %BB
¼ %BC
½ %BD
¾ %BE
¿ %BF
À %C0
Á %C1
 %C2
à %C3
Ä %C4
Å %C5
Æ %C6
Ç %C7
È %C8
É %C9
Ê %CA
Ë %CB
Ì %CC
Í %CD
Î %CE
Ï %CF
Ð %D0
Ñ %D1
Ò %D2
Ó %D3
Ô %D4
Õ %D5
Ö %D6
%D7
Ø %D8
Ù %D9
Ú %DA
Û %DB
Ü %DC
Ý %DD
Þ %DE
ß %DF
à %E0
á %E1
â %E2
ã %E3
ä %E4
å %E5
æ %E6
ç %E7
è %E8
é %E9
ê %EA
ë %EB
ì %EC
í %ED
î %EE
ï %EF
ð %F0
ñ %F1
ò %F2
ó %F3
ô %F4
õ %F5
ö %F6
÷ %F7
ø %F8
ù %F9
ú %FA
û %FB
ü %FC
ý %FD
þ %FE
ÿ %FF


URL Encoding Reference

The ASCII device control characters -%1f were originally designed to control hardware devices. Control characters have nothing to do inside a URL.
ASCII Character Description URL-encoding
NUL null character
SOH start of header %01
STX start of text %02
ETX end of text %03
EOT end of transmission %04
ENQ enquiry %05
ACK acknowledge %06
BEL bell (ring) %07
BS backspace %08
HT horizontal tab %09
LF line feed %0A
VT vertical tab %0B
FF form feed %0C
CR carriage return %0D
SO shift out %0E
SI shift in %0F
DLE data link escape %10
DC1 device control 1 %11
DC2 device control 2 %12
DC3 device control 3 %13
DC4 device control 4 %14
NAK negative acknowledge %15
SYN synchronize %16
ETB end transmission block %17
CAN cancel %18
EM end of medium %19
SUB substitute %1A
ESC escape %1B
FS file separator %1C
GS group separator %1D
RS record separator %1E
US unit separator %1F

Sunday, May 23, 2010

Deadlock or Stop may happen when Using ServerXMLHTTP or XMLDocument Requests and Load Page to the Same Server

If you are failed to using ServerXMLHTTP send the request or using XMLDocument load a page in the same Server, you have to take look this below...
 
Using ServerXMLHTTP or WinHTTP objects to make recursive Hypertext Transfer Protocol (HTTP) requests to the same Internet Information Server (IIS) server is not recommended.
 
If the ServerXMLHTTP or WinHTTP component must send a request to another ASP on the same server, the target ASP must be located in a different virtual directory and set to run in high isolation. Avoid using ServerXMLHTTP or WinHTTP to send a request to an ASP that is located in the same virtual directory.
 
If all of the ASP worker threads send HTTP requests back to the same Inetinfo.exe or Dllhost.exe process on the server from which the requests are sent, the Inetinfo.exe or Dllhost.exe process may deadlock or stop responding (hang)
 
 
 
How Resolve This Problem
For IIS 6.0 you can create a new application pool, put all the request pages in a virtual directory and set the Application Pool to the new pool.
 

Saturday, May 15, 2010

XSLT Samples

<List>
    <Item name="xslt sample1">
        <fieldName>sTitle</fieldName>
        <Value>This is Sample fo xslt</Value>
    </Item>
    <Item name="xslt sample2">
        <fieldName>PostDate</fieldName>
        <Value>This is Sample fo xslt</Value>
    </Item>
</List>

<xsl:value-of select="."/>
<xsl:value-of select="List/Item/@name"/>
<xsl:value-of select=""List/Item[@name='xslt sample2']" />
<xsl:value-of select=""List/Item[fieldName='PostDate']/Value" />
<xsl:value-of select="parent::Item/@srId" />
<xsl:if test="string(number(rssCount))!='NaN'"> .... </xsl:if>

................................................................................................
<xsl:template match="Item/Value">
    <xsl:value-of select="text()"/>
</xsl:template>

<!-- HTML textarea closed tag issue-->
<textarea><xsl:text>&#xA;</xsl:text></textarea>

<!--Get TagName -->
<xsl:value-of select="name()"/>

<xsl:if test="count(Item) < 3"> The Item has less than 3 elements. </xsl:if>


<xsl:if test="count(Item) &gt; 3"> The Item has more than 3 elements. </xsl:if>

About Using <!CDATA[[ ... ]]> If you want to output a text wrapped by <!CDATA[[]]> to another xml, you can do this as below.
Some times you want to output it to an HTML through xsl transformer, the transformer will not to proccess the CDATA been output in a text as below. 
<script type="text/javascript"> 
 
    // the transformer result should look like:
    // <!--
    //     Some scripting code here... 
    // -->
    <xsl:text disable-output-escaping="yes">&lt;!--&gt;&lt;![CDATA[//&gt;&lt;!--</xsl:text> 
        Some scripting code here...
    <xsl:text disable-output-escaping="yes">//--&gt;]]&gt;</xsl:text>
 
    // this trans result same as above but more simple and clear 
    <xsl:comment><![CDATA[        Some scripting code here...    ]]> </xsl:comment> 
</script>
 
If you want the xsl output wrapped by <!CDATA[[ ... ]]>, Only one way i knew can do it that is cdata-section-elements.
You can add cdata-section-elements in xsl:output, each cdata-section-elements could contains one valu, but you can 
add more than one xsl:output, see the sample.
 
<xsl:output method="html" cdata-section-elements="title" />
<xsl:output cdata-section-elements="content" />
.....
<xsl:template match="content">
   your content here....
</xsl:template>
....
<xsl:apply-templates select="content" />
 
xsl output is:
<!CDATA[[your content here....]]>
 
Related
http://www.w3schools.com/xsl/default.asp
http://msdn.microsoft.com/en-us/library/ms256086%28VS.85%29.aspx
http://www.dpawson.co.uk/xsl/sect2/N8413.html
http://www.xml.com/pub/a/2003/04/02/trxml.html
http://www.brics.dk/~amoeller/XML/transformation/examples.html
 

Saturday, April 17, 2010

Microsoft SQL Server Management Studio 2008: Error 916

When using Microsoft SQL Server Management Studio 2008 to connect and manage a database
if you clicked the “Database” node within “Object Explorer” may received the message:
The server principal “username” is not able to access the database “databasename” under the current security context. (Microsoft SQL Server, Error: 916)
When you  clicked the “Database” node in the Object Explorer Panel in the background  SQL Server Management Studio 2008 execute an T-SQL query to retrieve a list of databases along with additional information about those databases, one of those information is collation, which didn’t have a permission to do for scan every database.
Fix:
  1. In Object Explorer, click Databases
  2. Display “Object Explorer Details” (F7) or “View –> Object Explorer Details”
  3. Right click the column headers and deselect “collation”
  4. Refresh Databases. 


Tuesday, February 2, 2010

Windows Media Player PARAM Elements

PARAM Elements in an OBJECT Element
Windows Media Player uses the PARAM element to define specific startup conditions for the control. The PARAM element is embedded inside the OBJECT element.
For example, if you want to define whether the autoStart property is True, you would embed the PARAM element inside the OBJECT element.


<OBJECT ID="Player"
  CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
    <PARAM name="autoStart" value="True">
</OBJECT>
You can have as many PARAM elements in an OBJECT element as you want. PARAM has two attributes, name and value. Both attributes must be set.
The supported PARAM attributes vary slightly among browsers and mime types. The following table shows the attributes supported by the Internet Explorer and Firefox browsers. The preferred mime type for the Firefox browser is application/x-ms-wmp, however, there are several other mime types that you can use to embed the Player control in a Web page hosted by the Firefox browser. The fourth column of the table shows the attributes that are supported when you use a mime type other than application/x-ms-wmp.
PARAM name Type Internet Explorer Firefox with mime type application/x-ms-wmp Firefox with any other mime type
autoStart Boolean, yes yes yes
balance Long, -100 to 100, default 0. yes yes yes
baseURL String , yes yes yes
captioningID String yes yes yes
currentMarker Long, default 0 yes yes yes
currentPosition Double, default 0 yes yes yes
defaultFrame String yes no no
enableContextMenu Boolean yes yes yes
enabled Boolean yes yes yes
enableErrorDialogs Boolean yes yes no
fileName String no yes yes
fullScreen Boolean yes no no
invokeURLs Boolean, default true yes no no
mute Boolean yes yes yes
playCount Long, 0 to ..n yes yes no
rate Double, default 1.0 yes yes yes
SAMIFileName String yes yes yes
SAMILang String yes yes yes
SAMIStyle String yes yes yes
SRC String no yes yes
stretchToFit Boolean, default false yes yes no
URL String yes yes yes
volume Long, 0 to ..n yes yes yes
windowlessVideo Boolean, default false yes yes yes

Note  The fileName and SRC PARAM elements are supported by the Firefox plug-in, but not by Internet Explorer. They both perform the same function as the URL PARAM element.
See the Object Model Reference for Scripting for more details about the values for each name attribute.

See Also

Using the Windows Media Player Control in a Web Page

Thursday, January 28, 2010

Configure Windows XP to Automatically Login

1. At a command prompt, type "control userpasswords2" and press Enter to open the Windows User Accounts application.
2. On the Users tab, clear the Users Must Enter A User Name And Password To Use This Computer check box and then click OK.
3. In the Automatically Log On dialog box that appears, type the user name and password for the account you want to be logged on each time you start your computer.

Saturday, January 16, 2010

How to remote connect to SQL Server 2005 by Specific TCP Port

SQL Server 2005 is not configured to accept remote connections. By default.

To allow remote connections, you have to complete all the following steps:

  • Enable remote connections on the instance of SQL Server that you want to connect to from a remote computer.
  • Configure SQL Server to Listen on a Specific TCP Port.
  • To open a port in Windows Firewall.
  • Connect to SQL Server 2005 by using MS SQL Server Management Studio with port number.

Enable remote connections on the instance of SQL Server that you want to connect to from a remote computer.
  1. Click Start, point to Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Surface Area Configuration.
  2. On the SQL Server 2005 Surface Area Configuration page, click Surface Area Configuration for Services and Connections.
  3. On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Remote Connections, click Local and remote connections, click the appropriate protocol to enable for your environment, and then click Apply.

    Note Click OK when you receive the following message:
    Changes to Connection Settings will not take effect until you restart the Database Engine service.
  4. On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Service, click Stop, wait until the MSSQLSERVER service stops, and then click Start to restart the MSSQLSERVER service.
Configure SQL Server to Listen on a Specific TCP Port
  1. In SQL Server Configuration Manager, in the console pane, expand SQL Server 2005 Network Configuration, expand Protocols for <instance name>, and then double-click TCP/IP.
  2. In the TCP/IP Properties dialog box, on the IP Addresses tab, all the IP addresses available in your computer is listed in here ... IP1, IP2, up to IPAll. Right-click one of address, and then click Properties to identify the IP address that you wish to configure.
  3. The TCP Dynamic Ports dialog box contains 0, indicating the Database Engine is listening on dynamic ports. Which means they select an available port when the SQL Server service is started. To disable listening dynamic port you can delete the 0 and left the blank.
  4. In the IPn Properties area box, in the TCP Port box, type the port number you wish this IP address to listen on, and then click OK.
  5. In the console pane, click SQL Server 2005 Services.
  6. In the details pane, right-click SQL Server (<instance name>) and then click restart, to stop and restart SQL Server.

To open a port in Windows Firewall
  1. On the Start menu, click Control Panel.
  2. In Control Panel, click Network and Internet Connections, and then open Windows Firewall.
  3. In Windows Firewall, click the Exceptions tab, and then click Add Port.
  4. In the Add a Port dialog box, in the Name box, type SQL Server <instanceName>.
  5. In the Port number box, type the port number of the Database Engine instance. Use 1433 for the default instance. Type 1500 if you are configuring a named instance and configured a fixed port to 1500 . Verify that TCP is selected, and then click OK
Connect to SQL Server 2005 by using MS SQL Server Management Studio with port number
  1. Open SQL Server Management Studio, In the Connect to Server dialog box, in the Server Name box type xxx.xxx.xxx.xxx\SQLEXPRESS,1500.
  2. type user name and password to connect to server.