Archive
Microsoft.XMLHTTP to the rescue
{
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!=’undefined’)
{
xmlhttp = new XMLHttpRequest();
}
try
{
xmlhttp.open("GET", "http://<alternative URL>/" + url,true);
win=window.open();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4)
{
win.document.write(xmlhttp.responseText);
}
}
xmlhttp.send(null)
}
catch(e2)
{
// The browser doesn’t support XMLHTTP.
window.open(url);
}
}
Help!. Can’t reopen a page whilst another is loading…
<%
for (int i=0;i<1000;i++)
{
System.Threading.Thread.Sleep(100);
Response.Write(i + "…");
Response.Flush();
}
%>
Barcode reading webservice
Clipboard ring in Visual studio .NET
Integrating VSS witn Dreamweaver and VS.NET
If you don’t have the origional installation disk for Visual Souce Safe, but have it installed somewhere. You can still integrate it with Dreamweaver and VS.NET, by following the steps:
1. Copy the VSSWin32 folder to your local hard drive
2. Run Regsvr32 on SSSCC.DLL, SSAPI.DLL and NLHTML.DLL
3. Run SSINT.Exe
Installing IIS on XP Home
Although it’s a hack, I just figured out how to install IIS on XP Home. With the help of these two urls.
http://www.iis-resources.com/modules/AMS/article.php?storyid=48
and
http://www.webthang.co.uk/tuts/tuts_server/iis_xph/pippo_xp.asp
I did hit two problems, one was that it came up with an error "The Specified Module Could not be found" – This is fioxed by opening the IIS snap in, properties > Directory Security > Anonymous access > edit > then uncheck "Allow IIS to control password".
Then, to install .NET, I used aspnet_regiis.exe -i
———-
As an experiment, I tried to get .NET beta 2 to install aswell,but I got this error in the event log
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
StackTrace: at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)
at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters).
Stored Procedure version control
Often, when you work on a large scale database-driven application, you end up with hundreds of stored procedures. As the project evolves, the stored procedures get modified over time, and you often loose older versions of stored procedures.
Although there are many ways to provide stored procedure version control, I opted for a simple approach.
If you have a stored proc called MyProc, before editiing it, create a new procedure called MyProc;2. then edit MyProc (which I shall refer to as MyProc;1 for clarity).
When you call exec MyProc, then MyProc;1 will be executed. and MyProc;2 will not appear in any lists of stored procedures in Enterprise manager or Query Analyser.
To view the source of an older version of a stored proc, you can no longer use sp_helptext, but you can say "select text from syscomments where
id=(select id from sysobjects where name=’myProc’)
AND NUMBER=2"
Google UK reshuffle
Just noticed that Google UK is going through it’s reshuffle / pruning phase tonight. I’ve seen certain sites rapidly move positions under successive searches for the same keyword, and a large pruning of unscanned pages. (pages whoose link has been indexed, but not the content of the page).
Also a little interesting discovery. Ever notice the BIW parameter in a Google search. It’s your browsers width in pixels. – I thought it was a session id….
Changing a Cookie’s path C#
When using a httpWebRequest to a page, with an attached Cookie container, you may find sometimes that the Cookie is set with the wrong path, for instance /cgi-bin/process.cgi rather than cgi-bin/ – This may make the cookie unreadable to other pages within that folder.
Fear not, the solution is simple
Dim cA As Cookie
Dim ccS As CookieCollection
ccS = RequestCookies.GetCookies(New Uri(http://www.someuri.com/cgi-bin/process.cgi"))
cA = ccS.Item(0)
cA.Path = "/cgi-bin"
RequestCookies.Add(cAuthID)
RequestCookies being a Cookie Container object.
IIS problems
I wasn’t able to find any information on these errors which are routinely crashing my IIS server. And I was hoping somebody could throw some light on them
Fault bucket 197406881.
Reporting queued error: faulting application w3wp.exe, version 6.0.3790.1830, faulting module ntdll.dll, version 5.2.3790.1830, fault address 0x0001c93c.
ISAPI ‘C:WINDOWSMicrosoft.NETFrameworkv1.1.4322aspnet_isapi.dll’ reported itself as unhealthy for the following reason: ‘Deadlock detected’.
Error: File /Default.asp Script Engine Exception. A ScriptEngine threw exception ‘C0000005’ in ‘IActiveScript::SetScriptState()’ from ‘CActiveScriptEngine::ReuseEngine()’..
Error: File /articles/header.asp Unexpected error. A trappable error (C0000005) occurred in an external object. The script cannot continue running..
Error: File /programming-in.net/header.asp Script Engine Exception. A ScriptEngine threw exception ‘C0000005’ in ‘IActiveScript::SetScriptState()’ from ‘CActiveScriptEngine::ReuseEngine()’..
Error: Script Engine Exception. A ScriptEngine threw exception ‘C0000005’ in ‘IScriptDispatchEx::Release()’ from ‘CScriptingNamespace::UnInit()’..
Error: File /articles/wmi.asp Unexpected error. A trappable error (C0000005) occurred in an external object. The script cannot continue running..