Substitute of LIMIT clause (as used in MySQL) in O…

Tuesday, 3 July 2007, 18:46 | Category : Database, Technology
Tags :

Substitute of LIMIT clause (as used in MySQL) in Oracle:

SELECT COL_NAME (SELECT COL_NAME, ROWNUM r from TABLE_NAME) WHERE r BETWEEN 10 AND 15

It will select 6 rows (10th to 15th inclusive)

Changing network setting by a batch file in Windows

Wednesday, 20 June 2007, 1:21 | Category : Technology
Tags :

You may change network setting (IP, DNS etc) using batch file in Windows XP.
Lets say, you want a config shown below:


To do so, create a file names as changeIP.bat and write following lines into that:
netsh int ip set address name=”Local Area Connection” source=static addr=10.129.163.208 mask=255.255.255.0
netsh int ip set address name=”Local Area Connection” source=static gateway=10.129.163.1 gwmetric=0
netsh int ip set dns name=”Local Area Connection” source=static addr=202.144.13.50 register=PRIMARY
netsh int ip add dns name=”Local Area Connection” addr=202.144.50.4 index=2
netsh int ip set wins name=”Local Area Connection” source=static addr=none

Now whenever you execute this bat file, your network setting will be changed as required

Sending huge data to client browser

Wednesday, 20 June 2007, 0:56 | Category : Internet, J2EE, Java, Technology
Tags :

If you want to pass huge data to the client from your servlet, user may need to wait till the ServletOutputStream or JSPWriter flushes the data. This happens generally whenever you have a number of items page and you want to pass it to the client. The better approach is to flush the data partly using flush() method rather than flushing whole data at a time. You can initially flush header, then navigation bar, then body content and finally footer so that the user need not wait for whole data and he sees the header data immediately and so on with navigation bar, body content and footer.

out.write(header);
out.flush(); // flush the header
out.write(navbar);
out.flush(); // flush the navigation bar
// write dynamic data here
out.flush(); // flush the dynamic data
out.write(footer);
out.flush(); // finally flush the footer

How to Enable remote debugging of a java application

Friday, 8 June 2007, 2:50 | Category : Java, Technology
Tags :

While running the application pass following as JVM argument
-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8765

This will start listening on port 8765, now you may attach remote debugger from any machine giving the IP/hostname and port.

File sharing in Windows XP Professional

Friday, 8 June 2007, 2:26 | Category : Technology
Tags :

Set Permissions for Shared Files and Folders

Sharing of files and folders can be managed in two ways. If you chose simplified file sharing, your folders can be shared with everyone on your network or workgroup, or you can make your folders private. (This is how folders are shared in Windows 2000.) However, in Windows XP Professional, you can also set folder permissions for specific users or groups. To do this, you must first change the default setting, which is simple file sharing. To change this setting, follow these steps:
•Open Control Panel, click Tools, and then click Folder Options.
•Click the View tab, and scroll to the bottom of the Advanced Settings list.
•Clear the Use simple file sharing (Recommended) check box.
•To manage folder permissions, browse to the folder in Windows Explorer, right–click the folder, and then click Properties. Click the Security tab, and assign permissions, such as Full Control, Modify, Read, and/or Write, to specific users.

You can set file and folder permissions only on drives formatted to use NTFS, and you must be the owner or have been granted permission to do so by the owner.

 

Unwanted XP services

Friday, 8 June 2007, 2:25 | Category : Technology
Tags :

For a Safer, faster XP Close Unwanted Services

To disable unneeded startup services for a safer, faster XP, use the “Services” Admin Tool (Control Panel > Administrative Tools > Services). If you are a single user of a non-networked machine, you can disable the following items, with no ill effect.

Alerter
Clipbook
Computer Browser
Fast User Switching
Human Interface Access Devices
Indexing Service (Slows the hard drive down)
Messenger
Net Logon (unnecessary unless networked on a Domain)
Netmeeting Remote Desktop Sharing (disabled for extra security)
Remote Desktop Help Session Manager (disabled for extra security)
Remote Procedure Call Locator
Remote Registry (disabled for extra security)
Routing & Remote Access (disabled for extra security, used for remote support)
Server
SSDP Discovery Service (this is for the utterly pointless “Universal P’n’P”, & leaves TCP Port 5000 wide open)
TCP/IP NetBIOS Helper
Telnet (disabled for extra security)
Universal Plug and Play Device Host
Upload Manager
Windows Time
Wireless Zero Configuration (for wireless networks)
Workstation

How to remove MSN messenger completely from Windows

Friday, 8 June 2007, 2:22 | Category : Technology
Tags :

Remove MSN Messenger…

Are you tired of seeing MSN Messenger pop up on your Windows XP system? As usual, in an effort to continue its course towards domination of everything, Microsoft has made it difficult to remove. But it is possible! The following method works in Windows XP Professional, but has not been tested on a system with SP1 installed. FYI, I’ve seen scripts that are similar to this, but fail miserably, automatically deleting other much-needed components! Better to do this slow and manually! As always, I am not responsible for the use or the misuse of this information; use at your own risk.

  1. Exit MSN Messenger by right-clicking the MSN icon in the notification area, and selecting Exit.
  2. Add the following registry entries, both with a DWORD value of 1:
    1. HKEY_LOCAL_MACHINESoftwarePoliciesMicrosoftMessengerClientPreventRun
    2. HKEY_LOCAL_MACHINESoftwarePoliciesMicrosoftMessengerClientPreventAutoRun
  3. Open a command prompt by clicking Start/Run, then typing “command” and clicking OK.
  4. Uninstall MSN Messenger by typing “rundll32 advpack.dll,LaunchINFSection %systemRoot%INFmsmsgs.inf,BLC.Remove”
  5. Uninstall the leftover installation information file by typing “rundll32 setupapi,InstallHinfSection BLC.Remove 128 %systemRoot%INFmsmsgs.inf”
  6. Allow MSN Messenger to be displayed in the Add/Remove Windows Components dialog in the future (if it pops up again!) by typing “notepad.exe %systemRoot%INFsysoc.inf” and deleting the word “hide” from the line that starts with “msmsgs=”. It MAY be possible to skip to this step directly and perform the uninstallation directly from the Add/Remove Windows Components dialog, but that method MAY leave unwanted components and has not been thoroughly tested.
  7. Cross your fingers and reboot! You will probably get a message asking you to confirm the removal of some leftover files. Click OK.

OR the same thing can be done as following
Open notepad and paste following content and save the file as _remove.vbs. After creation, double click the file and say yes on option alert box.

Option Explicit
On Error Resume Next

‘Dimension variables
Dim WSHShell, MyBox, p1, q1, rcmd
Dim jobfunc

‘Set the Windows Script Host Shell and assign values to variables
Set WSHShell = WScript.CreateObject(“WScript.Shell”)
p1 = “HKEY_LOCAL_MACHINESoftwareMicrosoftOutlook ExpressHide Messenger”
q1 = 2
rcmd = “RunDll32 advpack.dll,LaunchINFSection %windir%infmsmsgs.inf,BLC.Remove”

‘Create or change the Hide Messenger value
WSHShell.RegWrite p1, q1

‘Run the uninstall command
WshShell.Run(rcmd)

How to switch back to win2000 style search in WinXP

Friday, 8 June 2007, 2:17 | Category : Technology
Tags : ,

Open notepad and paste following content and save the file as XPSearch.reg. After creation, double click the file and say yes on option alert box.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerCabinetState]
“Settings”=hex:0c,00,02,00,1b,01,e7,77,60,00,00,00
“FullPath”=dword:00000001
“FullPathAddress”=dword:00000001
“Use Search Asst”=”no”

How to reset “View source” application in internet explorer back to notepad

Friday, 8 June 2007, 2:15 | Category : Technology
Tags : ,

Open notepad and paste following content and save the file as resetIEViewSource.reg. After creation, double click the file and say yes on option alert box.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftInternet ExplorerView Source EditorEditor Name]
@=”C:\Windows\notepad”

How to enable File Name completion on command prompt

Friday, 8 June 2007, 2:14 | Category : Technology
Tags :

Open notepad and paste following content and save the file as cmdComplete.reg. After creation, double click the file and say yes on option alert box.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USERSoftwareMicrosoftCommand Processor]
“CompletionChar”=dword:00000009