Showing posts with label Computer Tips. Show all posts
Showing posts with label Computer Tips. Show all posts

Tuesday, August 25, 2009

10 Windows XP Services You Should Never Disable

1. DNS Client
If you stop this service, you will disable your computer’s ability to resolve names to IP addresses, basically rendering Web browsing all but impossible.

2: Network Connections
If this service is disabled, network configuration is not possible. New network connections can’t be created and services that need network information will fail.

3: Plug and Play
If you disable Plug and Play, your computer will be unstable and incapable of detecting hardware changes.

4: Print Spooler
When the Print Spooler service is not running, printing on the local machine is not possible. 5: Remote Procedure Call (RPC)Bad news. The system will not boot. Don’t disable this service.

6: Workstation
Disable the Workstation service and your computer will be unable to connect to remote Microsoft Network resources.

7: Network Location Awareness (NLA)
Your computer will not be able to fully connect to and use wireless networks. Problems abound!8: DHCP ClientWithout the DHCP Client service, you’ll need to manually assign static IP addresses to every Windows XP system on your network. If you use DHCP to assign other parameters, such as WINS information, you’ll need to provide that information manually as well.

9: Cryptographic Services
Disable Cryptographic Services at your peril! Automatic Updates will not function and you will have problems with Task Manager as well as other security mechanisms.

10: Automatic Updates
New security updates will not be automatically installed to your computer.

Thursday, July 30, 2009

Show/Hide from JavaScript Code

To make a DIV visible or hidden from JavaScript use the code

<script type="text/javascript">
    var DivToApply = document.getElementById("Div1");
    DivToApply.style.visibility = "visible";
    DivToApply.style.visibility = "hidden";
</script>



Tuesday, July 14, 2009

Make a Checkbox Read-Only

To make a html input type checkbox readonly is not possible from its default properties. So we can just use this small tricks to make it read only.

<input type="checkbox" onClick="return false;" CHECKED />Readonly
<input type="checkbox" CHECKED DISABLED />Disabled

It looks like:


Tuesday, June 9, 2009

Speedup Mozilla Firefox Page Loading



Here's something for broadband people that will really speed Firefox up:

1. Type about:config into the address bar and hit return. Scroll down and look for the following entries:

network.http.pipelining
network.http.proxy.pipelining
network.http.pipelining.maxrequests

Normally the browser will make one request to a web page at a time. When you enable pipelining it will make several at once, which really speeds up page loading.

2. Alter the entries as follows:

Set network.http.pipelining to true

Set network.http.proxy.pipelining to true

Set network.http.pipelining.maxrequests to some number like 30. This means it will make 30 requests at once.

3. Lastly right-click anywhere and select New-> Integer. Name it nglayout.initialpaint.delay and set its value to 0 (zero). This value is the amount of time the browser waits before it acts on information it recieves.

If you're using a broadband connection you'll load pages MUCH faster now!


You have to close your browser after you make the changes. When you start it back up they will be in effect.

Thursday, May 21, 2009

How to get rid of the installer/configuration dialog when running Office 2007 and Office 2003 on the same system

After installing both Office 2007 and Office 2003 on same system you may face the problem of the following dialogs below every time you switch between Office 2007 Program and Office 2003 Program. Which is so disturbing and time killing.






Add the following Registry entries to solve the problem.


reg add HKCU\Software\Microsoft\Office\11.0\Word\Options /v NoReReg /t REG_DWORD /d 1

reg add HKCU\Software\Microsoft\Office\12.0\Word\Options /v NoReReg /t REG_DWORD /d 1

Just copy each line and paste in the RUN dialog (Win+R) and press OK.
After doing it if the dialogs appear further just continue the installing process for that time.
It will not shown again.

Sunday, May 17, 2009

Java Script Trim Function

RIGHT TRIM
function RTrim(VALUE){
var w_space = String.fromCharCode(32);
var v_length = VALUE.length;
var strTemp = "";
if(v_length <>
return"";
}
var iTemp = v_length -1;

while(iTemp > -1){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(0,iTemp +1);
break;
}
iTemp = iTemp-1;
} //End While
return strTemp;
} //End Function


LEFT TRIM
function LTrim(VALUE){
var w_space = String.fromCharCode(32);
if(v_length <>
return"";
}
var v_length = VALUE.length;
var strTemp = "";
var iTemp = 0;

while(iTemp <>
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(iTemp,v_length);
break;
}
iTemp = iTemp + 1;
} //End While
return strTemp;
} //End Function


BOTH END TRIM
function Trim(TRIM_VALUE){
if(TRIM_VALUE.length <>
return"";
}
TRIM_VALUE = RTrim(TRIM_VALUE);
TRIM_VALUE = LTrim(TRIM_VALUE);
if(TRIM_VALUE==""){
return "";
}
else{
return TRIM_VALUE;
}
} //End Function

Some Regular Expression

using System.Text.RegularExpressions

Roman Numbers

string p1 = "^m*(d?c{0,3}|c[dm])(l?x{0,3}|x[lc])(v?i{0,3}|i[vx])";

string t1 = "vii"; Match m1 = Regex.Match(t1, p1);

Swapping First Two Words

string t2 = "the quick brown fox";

string p2 = @"(\S+)(\s+)(\S+)";

Regex x2 = new Regex(p2);

string r2 = x2.Replace(t2, "$3$2$1", 1);

Keyword = Value

string t3 = "myval = 3";

string p3 = @"(\w+)\s*=\s*(.*)\s*";;

Match m3 = Regex.Match(t3, p3);

Line of at Least 80 Characters

string t4 = "********************"

+ "******************************"

+ "******************************";

string p4 = ".{80,}";

Match m4 = Regex.Match(t4, p4);

MM/DD/YY HH:MM:SS

string t5 = "01/01/01 16:10:01";

string p5 = @"(\d+)/(\d+)/(\d+) (\d+):(\d+):(\d+)";

Match m5 = Regex.Match(t5, p5);

Changing Directories (for Windows)

string t6 = @"C:\Documents and Settings\user1\Desktop\";

string r6 = Regex.Replace(t6, @\\user1\\, @\\user2\\);

Expanding (%nn) Hex Escapes

string t7 = "%41"; // capital A

string p7 = "%([0-9A-Fa-f][0-9A-Fa-f])";

// uses a MatchEvaluator delegate

string r7 = Regex.Replace(t7, p7, HexConvert);

Deleting C Comments (Imperfectly)

string t8 = @"

/*

* this is an old cstyle comment block

*/

";

string p8 = @"

/\* # match the opening delimiter

.*? # match a minimal numer of chracters

\*/ # match the closing delimiter

";

string r8 = Regex.Replace(t8, p8, "", "xs");

Removing Leading and Trailing Whitespace

string t9a = " leading";

string p9a = @"^\s+";

string r9a = Regex.Replace(t9a, p9a, "");

string t9b = "trailing ";

string p9b = @"\s+";

string r9b = Regex.Replace(t9b, p9b, "");

Turning '\' Followed by 'n' Into a Real Newline

string t10 = @"\ntest\n";

string r10 = Regex.Replace(t10, @"\\n", "\n");

IP Address

string t11 = "55.54.53.52";

string p11 = "^" +

@"([01]?\d\d|2[0-4]\d|25[0-5])\." +

@"([01]?\d\d|2[0-4]\d|25[0-5])\." +

@"([01]?\d\d|2[0-4]\d|25[0-5])\." +

@"([01]?\d\d|2[0-4]\d|25[0-5])" ;

Match m11 = Regex.Match(t11, p11);

Removing Leading Path from Filename

string t12 = @"c:\file.txt";

string p12 = @"^.*\\";

string r12 = Regex.Replace(t12, p12, "");

Joining Lines in Multiline Strings

string t13 = @"this is

a split line";

string p13 = @"\s*\r?\n\s*";

string r13 = Regex.Replace(t13, p13, " ");

Extracting All Numbers from a String

string t14 = @"

test 1

test 2.3

test 47

";

string p14 = @"(\d+\.?\d*|\.\d+)";

MatchCollection mc14 = Regex.Matches(t14, p14);

Friday, January 2, 2009

Send Email from ASP.NET usign GMAIL Account

protected void Page_Load(object sender, EventArgs e)
{
SendMail("smtp.gmail.com",
465,
"account@gmail.com",
"<accountpassword>",
"Your name",
"account@gmail.com",
"Stefan Receiver",
"receive@whatever.com",
"Test",
"Hello there Steff!",
true);
}
public static void SendMail(string sHost, int nPort, string sUserName, string sPassword, string sFromName, string sFromEmail,
string sToName, string sToEmail, string sHeader, string sMessage, bool fSSL)
{
if (sToName.Length == 0)
sToName = sToEmail;
if (sFromName.Length == 0)
sFromName = sFromEmail;

    System.Web.Mail.MailMessage Mail = new System.Web.Mail.MailMessage();
Mail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"] = sHost;
Mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"] = 2;
    Mail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = nPort.ToString();
if (fSSL)
Mail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpusessl"] = "true";

    if (sUserName.Length == 0)
{
//Ingen auth
}
else
{
Mail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
Mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = sUserName;
Mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = sPassword;
}

    Mail.To = sToEmail;
Mail.From = sFromEmail;
Mail.Subject = sHeader;
Mail.Body = sMessage;
Mail.BodyFormat = System.Web.Mail.MailFormat.Html;

    System.Web.Mail.SmtpMail.SmtpServer = sHost;
System.Web.Mail.SmtpMail.Send(Mail);
}

Thursday, January 1, 2009

Grey-out html page and pop-up a interactive dialog box

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
function showPopUp(el) {
var cvr = document.getElementById("cover")
var dlg = document.getElementById(el)
cvr.style.display = "block"
dlg.style.display = "block"
if (document.body.style.overflow = "hidden") {
cvr.style.width = "1024"
cvr.style.height = "100%"
}
}
function closePopUp(el) {
var cvr = document.getElementById("cover")
var dlg = document.getElementById(el)
cvr.style.display = "none"
dlg.style.display = "none"
document.body.style.overflowY = "scroll"
}
</script>
<style type="text/css">
#cover {
display:none;
position:absolute;
left:0px;
top:0px;
width:100%;
height:100%;
background:gray;
filter:alpha(Opacity=50);
opacity:0.5;
-moz-opacity:0.5;
-khtml-opacity:0.5
}
#dialog {
display:none;
left:200px;
top:200px;
width:300px;
height:300px;
position:absolute;
z-index:100;
background:white;
padding:2px;
font:10pt tahoma;
border:1px solid gray
}
</style>
</head>
<body>
<div id="cover"></div>
<div id="dialog">
My Dialog Content
<br><input type="text">
<br><input type="button" value="Submit">
<br><a href="#" onclick="closePopUp('dialog');">[Close]</a>
</div>
<a href="#" onclick="showPopUp('dialog');">Show</a>
</body>
</html>