Nov 3, 2007

How to reduce memory usage of Yahoo Messenger

With every new version, Yahoo! Messenger seems to be using more and more memory than the previous versions. With the addition of the Plugin feature in the latest version, things have got even more bulky.

Currently, Yahoo! Messenger uses about 41,164K memory on my system. Based on your usage of the messenger, the memory usage increases and decreases.
Here are some very simple tips to decrease memory usage of Yahoo Messenger:

Uninstall Plugins:
The amount of memory Plugins use depend on the number of plugins you install. To uninstall plugins from the Plug-ins Manager, go to ‘Actions>Choose a plugin…’ and click the ‘My Plug-ins’ tab. Decide which Plugins you don’t need and then click ‘Stop’ and the icon near to it to uninstall

Remove Ads:
You can save some memory and bandwidth by removing Yahoo! Messenger’s Ads. You can find how to do it here

Switch to Classic Skin: If you prefer performance to appearance, you may switch to the classic skin of Yahoo! Messenger. You can do this by going to ‘Messenger>Change Skin…’ and select Classic from there.

Just little reference to reduce memory usage of yahoo messenger.

Nov 1, 2007

ASP Get Browser URL

There are times in your scripts when you are going to want to get the current page URL that is shown the browser URL window. For example maybe a page URL has Querystring info appended to it and you need to send an email off to someone with that same exact URL and Querystring information. There are plenty of other reasons as well.

Here is some code to do it.


Lets say the current page is simply "http://www.mysite,com/view_user.asp"

This is all you need to get you the current page URL
<%
Thispage ="http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL")
%>


Now, if your page has Querystring info and variables you want as well.
Like so "http://www.mysite,com/view_user.asp?ID=1&Name=Fred"

you would use code like this.

<%
Thispage ="http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") & "?" & Request.Querystring
%>

If your page had Form info that might have been posted to it you would use code like this.

<%
Thispage = "http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") & "?" & Request.Form
%>


If your page had both Querystring and Form info you could try code like this.

<%
Thispage = "http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") & "?" & Request.Querystring & Request.Form
%>

Save Web pages in MHT & MAFF using Firefox

Save Web pages in MHT & MAFF using Firefox

1) Download the extension file
2) Rename the file extension from xpi to zip.
3) Open the zip file
4) Open install.rdf
5) Change MinVersion to Current Version of Firefox version
6) Change Maxversion to 1.0 (or higher)
7) Rename zip back to xpi
8) Drag xpi to your firefox.

You can download from here.

Update DB Data With Leading Zero Format

UPDATE EM_MST_EMPLOYEE
SET PIN = '0' + PIN
WHERE ({ fn LENGTH(PIN) } = 7)

Shrink SQL Data Log File

When DBCC SHRINKFILE is run, SQL Server 2000 shrinks the log file by removing as many virtual log files as it can to attempt to reach the target size. If the target file size is not reached, SQL Server places dummy log entries in the last virtual log file until the virtual log is filled and moves the head of the log to the beginning of the file. The following actions are then required to complete the shrinking of the transaction log:

1. You must run a BACKUP LOG statement to free up space by removing the inactive portion of the log.

2. You must run DBCC SHRINKFILE again with the desired target size until the log file shrinks to the target size.

The following example demonstrates this with the pubs database and attempts to shrink the pubs_log file to 2 MB:
1. Run this code:

DBCC SHRINKFILE(pubs_log, 2)


NOTE: If the target size is not reached, proceed to the next step.

2. Run this code if you want to truncate the transaction log and not keep a backup of the transaction log. Truncate_only invalidates your transaction log backup sequence. Take a full backup of your database after you perform backup log with truncate_only:

BACKUP LOG pubs WITH TRUNCATE_ONLY

-or-
Run this code if you want to keep a backup of your transaction log and keep your transaction log backup sequence intact. See SQL Server Books Online topic "BACKUP" for more information:

BACKUP LOG pubs TO pubslogbackup

3. Run this code:

DBCC SHRINKFILE(pubs_log,2)

must run step 1,2 then 3

Oct 30, 2007

Get Physical File Path, Virtual Directory

oFSO = Server.CreateObject("Scripting.FileSystemObject")
sPath = Server.MapPath("Moozik\")
fRoot = oFSO.GetFolder(sPath)


(web paths, not full physical)

My file: /Test/Myfile.aspx
Virtual directory: /Test/VirtualDir/
Code: Server.MapPath("VirtualDir/")

or if you are in a higher directory:

MyFile: /Test/Something/MyFile.aspx
Virutal: /VirtualDir/
Code: Server.MapPath("../../VirtualDir/")

You are probably just getting the virtual path (the one that gets sent into
MapPath) wrong.