25 August 2010

How to get DAY name from the given DATE ?

suppose you have such a question that on 27-may-1991 what was the DAY?
so... Here is the math trick to get the DAY name from the DATE.

Remember this 2 table
=> MONTH CODE
jan  =1
feb  =4
mar=4
apr =0
may=2
jun  =5
jul   =0
aug=3
sep=6
oct  =1
nov =4
dec=6
(if LEAP YEAR then jan=0, feb=3)

=> DAY CODE (IF year <= 2000)
sun  =1
mon=2
tue  =3
wed=4
thu =5
fri   =6
sat =0

=> DAY CODE (IF year >= 2000)
sun  =0
mon=1
tue  =2
wed=3
thu =4
fri   =5
sat =6

 

step.1
sum of DAY + MONTH CODE + last 2 digit of YEAR + int(1/4th of Last 2 digit of YEAR)

step.2
divide SUM by 7

step.3
now compare REMINDER of STEP.2 with DAY CODE
its your DAY of that DATE


example
if the DATE is 27-may-1991 then find the DAY
step.1
27 + 2(month code)+ 91 + 22
(here 1/4th of 1991 is 22.75 but truncate fraction part so only 22 will be considered)
so, SUM=142
step.2
=142/7
so, REMINDER = 2
step.3
see REMINDER in table of DAY CODE
so... 2= MONDAY is my b'day
so... that we can say that... on DATE 27-may-1991 the day was Monday.

Try this l0g!c........

19 August 2010

Error Message: "The command prompt has been disabled by your administrator"

When you attempt to run CMD.exe or a batch file, you may receive the message
"The command prompt has been disabled by your administrator".
This is caused by restrictions placed in Registry. 
Method 1: Using the console registry tool
Click StartRun and type this command exactly as given below: (better - Copy and paste)

Method 2: Using Group Policy Editor in Windows XP
Navigate to


User Configuration \ Administrative Templates \ System

Double-click the Prevent access to the command prompt

then Disable or set the policy to Not Configured

Error Message: "Registry editing has been disabled by your administrator"

When you attempt to start the Registry Editor (regedit.exe) in your Windows Vista system, you may receive the following message:

Solution - Using Group Policy Editor


=> Start > Run > gpedit.msc=> then nevigate the following path (in left pane)
User Configuration | Administrative Templates | System
=>  Double-click Prevent access to registry editing tools
     Set it as "Disabled" or "Not Configured"

Error Message: "Task Manager has been disabled by your administrator

When you try to open Task Manager, the following error may occur:
Solution :

Method 1:

Click Start, Run and type this command exactly as given below: (better - Copy and paste)

  


Method 2:

   Copy following code in Notepad and Save it as Enable Task Manager.reg
CODE:
===============

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]
"DisableTaskMgr"=dword:00000000
===================
the double click on file Enable Task Manager.reg and click on  button to modify registry entry.

Popular Posts