Xpert Blog

Windows 10 creators update and Command Promt (cmd) context menu issue
Windows providing new Creators update for windows 10 user free of cost. After updating, main change which noticed in context menu. In previous version 'Open command window here' is replace with 'Open power shell window here' in new version.But widows never removed the command prompt. You can get command prompt in 2 different method.

1) Open power shell through context menu and then type cmd hit enter. This will change your PS Prompt into Cmd Prompt.
2) Press Windows Key+R (open the Run command.) and type cmd, Click OK or hit Enter

To get 'Open Command Window here' in context menu use the following method.

Note : Make a backup copy of you registry before doing anything in registry.

1) Press Windows key + R (open the Run command)
2) Type regedit, and click OK  or hit Enter to open the Registry.
3) Go to the key location HKEY_CLASSES_ROOT\Directory\shell\cmd
4) Right-click the cmd (folder) key, and select Permissions
5) On "Permission for Cmd" window, Click the Advanced button
6) On "Advanced Security Settings" window, Click the Change link next to "Owner."
7) Type your account name in the provided field, click Check Names to verify you're typing the account name correctly, and click OK.
8) Check the Replace owner on subcontainers and objects option.
9) Click Apply.
10) Click OK.
11) On "Permissions," select the Administrators group.
12) Under "Permissions for Administrators," select Allow for the Full Control option.
13) Click Apply.
14) Click OK.
15) Inside the cmd (folder) key, right-click the HideBasedOnVelocityId DWORD, and click Rename.
16) Change the DWORD name from HideBasedOnVelocityId to ShowBasedOnVelocityId, and press Enter.

Once you completed the steps, using the Shift + Right-click combo will now display the "Open command window here" option. But this work only when you select a Folder(Directory). If you wand to open Command prompt from inside a Folder (Directory) without selecting any file or folder use the following steps.

1) Go to the key location Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\cmd
2) Right-click the cmd (folder) key, and select Permissions
3) On "Permission for Cmd" window, Click the Advanced button
4) On "Advanced Security Settings" window, Click the Change link next to "Owner."
5) Type your account name in the provided field, click Check Names to verify you're typing the account name correctly, and click OK.
6) Check the Replace owner on subcontainers and objects option.
7) Click Apply.
8) Click OK.
9) On "Permissions," select the Administrators group.
10) Under "Permissions for Administrators," select Allow for the Full Control option.
11) Click Apply.
12) Click OK.
13) Inside the cmd (folder) key, right-click the HideBasedOnVelocityId DWORD, and click Rename.
14) Change the DWORD name from HideBasedOnVelocityId to ShowBasedOnVelocityId, and press Enter.

Now its ready.

How to turn on automatic logon in Windows Server
Use Registry Editor to turn on automatic logon follow these steps:
  1. Click Start, and then click Run.
  2. In the Open box, type Regedt32.exe, and then press Enter.
  3. Locate the following subkey in the registry:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
  4. Double-click the DefaultUserName entry, type your user name, and then click OK.
  5. Double-click the DefaultPassword entry, type your password, and then click OK.

    Note If the DefaultPassword value does not exist, it must be added. To add the value, follow these steps:

    1. On the Edit menu, click New, and then point to String Value.
    2. Type DefaultPassword, and then press Enter.
    3. Double-click DefaultPassword.
    4. In the Edit String dialog, type your password and then click OK.
    Note If no DefaultPassword string is specified, Windows automatically changes the value of the AutoAdminLogon key from 1 (true) to 0 (false), disabling the AutoAdminLogon feature.
  6. On the Edit menu, click New, and then point to String Value.
  7. Type AutoAdminLogon, and then press Enter.
  8. Double-click AutoAdminLogon.
  9. In the Edit String dialog box, type 1 and then click OK.
  10. Exit Registry Editor.
  11. Click Start, click Shutdown, and then type a reason in the Comment text box.
  12. Click OK to turn off your computer.
  13. Restart your computer. You can now log on automatically.

MySQL function for amount to words
The following MySQL functions used to convert number to words. If we need to print amount in words this function will help.

You need to create 2 functions to achieve this.
1) AmountToWords
2) Number2Char

Usage : SELECT AmountToWords(4896.50)
OutPut : ( Rupees Four Thousand Eight Hundred Ninety Six and Paise Fifty Only. )

AmountToWords Function code

CREATE FUNCTION `AmountToWords`(`nAmount` DECIMAL(11,2))
    RETURNS varchar(2000) CHARSET utf8
    LANGUAGE SQL
    DETERMINISTIC
    CONTAINS SQL
    SQL SECURITY DEFINER
    COMMENT ''
BEGIN

DECLARE AMT_Words   VARCHAR(2000) ;
DECLARE AMT_Text1   VARCHAR(2000) ;
DECLARE AMT_Text2   VARCHAR(2000) ;
DECLARE AMT_Text3   VARCHAR(2000) ;
DECLARE Words          VARCHAR(2000) ;
DECLARE Rupee_Txt      VARCHAR(2000) ;
DECLARE RupeeTxt      VARCHAR(2000) ;
DECLARE SP_Txt1      VARCHAR(2000) ;
DECLARE SP_Txt2      VARCHAR(2000) ;
DECLARE SP_Txt3      VARCHAR(2000) ;
DECLARE Decimal_Txt VARCHAR(20)      ;

DECLARE WP              INT;
DECLARE SP              INT;
DECLARE RLEN          INT;
DECLARE PLEN        INT;
DECLARE _Rupee          INT;
DECLARE _Decimal      INT;
   
   
    SET AMT_Words   = '( Rupees ';
    SET AMT_Text1   = ' One ,Two ,Three ,Four ,Five ,Six ,Seven ,Eight ,Nine ,Ten ';
    SET AMT_Text1   = CONCAT(AMT_Text1,',Eleven ,Twelve ,Thirteen ,Forteen ,Fifteen ,Sixteen ,Seventeen ,Eighteen ,Nineteen ,Twenty ');
    SET AMT_Text2   = ' Twenty ,Thirty ,Fourty ,Fifty ,Sixty ,Seventy ,Eighty ,Ninety ';
    SET AMT_Text3   = ' Crore ,Lakh ,Thousand ,Hundred , ';   
    SET Rupee_Txt   = '';
    SET RupeeTxt    = '';
    SET Decimal_Txt = '';
    SET SP_Txt3     = '';
    SET WP              = 1 ;
    SET SP             = 1 ;
    SET Words       = '';
    SET _Rupee      = TRUNCATE(nAmount,0);
    SET RLEN             = 9-LENGTH(_Rupee);
    SET Rupee_Txt   = CONCAT(SPACE(RLEN),CONVERT(_Rupee,CHAR)) ;   
    SET _Decimal    = CAST(SUBSTRING_INDEX(nAmount,'.',-1) AS UNSIGNED);   
    SET PLEN          = 2-LENGTH(_Decimal);
    SET Decimal_Txt = CONCAT(SPACE(PLEN),CONVERT(_Decimal,CHAR));


    WHILE WP < 6 DO
   
       IF SP =  7 THEN
          
           SET RupeeTxt = SUBSTRING(Rupee_Txt,SP,1);
           SET SP =SP+1;
           SET RupeeTxt = CONCAT('0',RupeeTxt);
           SET Words=Number2Char(RupeeTxt,AMT_Text1,AMT_Text2);       

       ELSE
                           
          SET RupeeTxt = SubString(Rupee_Txt,SP,2);
          SET SP =SP+2;
          SET Words=Number2Char(RupeeTxt,AMT_Text1,AMT_Text2);

                             
       END IF;  
      
       IF Words != '' THEN
     
           IF AMT_Words != '' AND WP = 6 THEN          
               SET AMT_Words =CONCAT(AMT_Words,'and ');       
           END IF;
           
            SET SP_Txt1 = SUBSTRING_INDEX(AMT_Text3,',',WP);
            SET SP_Txt2 = SUBSTRING_INDEX(SP_Txt1,',',WP-1);
            SET SP_Txt3 = SUBSTRING(SP_Txt1,LENGTH(SP_Txt2)+2,LENGTH(SP_Txt1));
            SET AMT_Words = CONCAT(AMT_Words,Words,SP_Txt3) ;
          
       END IF;
      
       SET WP = WP+1;  
           
    END WHILE;

    IF AMT_Words != '' THEN
        SET AMT_Words = CONCAT(AMT_Words,' ');
    END IF;
   
    /*End of Rupee Side*/
   
    SET Words=Number2Char(Decimal_Txt,AMT_Text1,AMT_Text2);

   
    IF Words != '' AND AMT_Words != "" THEN
        SET AMT_Words = CONCAT(TRIM(AMT_Words),' and ', 'Paise ');
    END IF;
   
    IF Words != '' THEN
            SET AMT_Words = CONCAT(AMT_Words,Words);
    END IF;
   
    IF AMT_Words != '' THEN
        SET AMT_Words = CONCAT(TRIM(AMT_Words),' Only. )');
    END IF;


    RETURN AMT_Words;
  
END

Number2Char Function Code

CREATE  FUNCTION `Number2Char`(`cDigits` VARCHAR(500), `cAMT_Text1` VARCHAR(500), `cAMT_Text2` VARCHAR(500))
    RETURNS varchar(2000) CHARSET utf8
    LANGUAGE SQL
    DETERMINISTIC
    CONTAINS SQL
    SQL SECURITY DEFINER
    COMMENT ''
BEGIN

DECLARE Words VARCHAR(2000);
DECLARE AMT_Txt1 VARCHAR(2000);
DECLARE AMT_Txt2 VARCHAR(2000);
DECLARE AMT_Txt3 VARCHAR(2000);
DECLARE Digits INT;
DECLARE Value  INT;

SET Words ='';


    IF cDigits > '20' THEN
   
    -- Never use CONVERT method this will not work in mysql server
    -- Eg: CONVERT(LEFT(cDigits,1),INT)-1;
    -- use CASt method instead of
   
        SET Digits = CAST(LEFT(cDigits,1) AS UNSIGNED)-1;
       
        SET AMT_Txt1 = SUBSTRING_INDEX(cAMT_Text2,',',Digits);
        SET AMT_Txt2 = SUBSTRING_INDEX(AMT_Txt1,',',Digits-1);   
        SET Words =SUBSTRING(AMT_Txt1,LENGTH(AMT_Txt2)+2,LENGTH(AMT_Txt1));
       
        SET cDigits = CONCAT("0",RIGHT(cDigits,1)) ;
       
    END IF;
   
        SET Digits = CAST(cDigits AS UNSIGNED);
   
        SET AMT_Txt1 = SUBSTRING_INDEX(cAMT_Text1,',',Digits);
        SET AMT_Txt2 = SUBSTRING_INDEX(AMT_Txt1,',',Digits-1);   
        SET AMT_Txt3 = SUBSTRING(AMT_Txt1,LENGTH(AMT_Txt2)+2,LENGTH(AMT_Txt1));
        SET Words =CONCAT(Words,AMT_Txt3);

RETURN Words;

END

MySQL funcation for Indian rupee comma separator format (eg: 85,27,41,963.23)
The following MySQL function help you to format a number into Indian rupee comma separator style.

 If you give  852741963.23 the function out put look like this  85,27,41,963.23

select RupeeFormat(852741963.23)

Out put : 85,27,41,963.23

CREATE  FUNCTION `RupeeFormat`(`nAmount` DECIMAL(12,2))
    RETURNS varchar(200) CHARSET utf8
    LANGUAGE SQL
    DETERMINISTIC
    CONTAINS SQL
    SQL SECURITY DEFINER
    COMMENT ''
BEGIN

  DECLARE res VARCHAR(50);
  DECLARE p1  VARCHAR(40);
  DECLARE p2  VARCHAR(10);

  SET res = REPLACE(CAST(FORMAT(nAmount,2) AS CHAR(20) ),',','');
  SET p1  = LEFT(res, INSTR(res,'.')-1);
  SET p2  = SUBSTRING(res, INSTR(res,'.'), 10);

  SET res = CONCAT(RIGHT(p1, 3), p2);
  SET p1  = LEFT(p1, LENGTH(p1)-3);

  WHILE (p1<>'') DO
 
    SET res = CONCAT(RIGHT(p1, 2) , ',' , res);
   
    IF (LENGTH(p1) > 2) THEN
   
      SET p1 = LEFT(p1, LENGTH(p1)-2);
     
    ELSE
   
      SET p1= '';
     
    END IF;
  END WHILE;

  RETURN res;

END

Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT=STATEMENT
MySQL server produce following error while insert or update record to a table.

Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT= STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.

Solution :

Change MySQL Server variable binlog_format value into mixed in global.

SET GLOBAL binlog_format = 'MIXED';

Access denied for user 'root'@'%' (using password yes)
If you specify a host name when trying to connect, but get an error message where the host name is not shown or is an IP address, it means that the MySQL server got an error when trying to resolve the IP address of the client host to a name:

If you try to connect as root and get the following error, it means that you do not have a row in the user table with a User column value of 'root' and that mysql database cannot resolve the host name for your client:

If you do not know the IP address or host name of the machine from which you are connecting, you should '%' as the Host
So you should have to grant all privilege to root for all host by running the following code:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password';

Incorrect integer value: '' for column - MySQL Server
The MySQL versions were different, previously MySQL 4 working fine code may get error in MySQL 5 because of security enhancement or just a change in the default level of data-validation, but in MySQL 4, if you set an int_column = '', (that's 2 single quotes) it would be converted to the zero value. In MySQL 5, by default, it causes this error "Incorrect integer value".

This is an sql-mode issue, the mode defines what SQL syntax should be supported and what kind of data validation should be performed. To overcome this,  reduce the sensitivity of the control. To lower the level of data validation we can set the sql-mode to a lower level or comment it out altogether.

Edit the my.cnf (my.ini in windows) file and find and comment out the line:

#sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

The STRICT_TRANS_TABLES or it might be STRICT_ALL_TABLES is the bit that is causing the problem. STRICT mode is disallows invalid or missing values in a statement and aborts the command.

Save my.ini, restart MySQL.

MySQL server has gone away
The MySQL server has gone away (error 2006) has two main causes and solutions:
  • Server timed out and closed the connection. 
    • To fix, check that “wait_timeout” mysql variable in your my.cnf configuration file is large enough.
  • Server dropped an incorrect or too large packet. If mysqld gets a packet that is too large or incorrect, it assumes that something has gone wrong with the client and closes the connection. 
    • To fix, you can increase the maximal packet size limit “max_allowed_packet” in my.cnf file. eg. set max_allowed_packet = 128M, restart MySQL Server.

"The User Profile Service failed the logon"error message in Windows Vista and later versions

Method 1:

To fix the user account profile, follow these steps:

Important : Serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs.
  1. Click Start, type regedit in the Search box, and then press ENTER.
  2. In Registry Editor, locate and then click the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
  3. In the navigation pane, locate the folder that begins with S-1-5 (SID key) followed by a long number.
  4. Click each S-1-5 folder, locate the ProfileImagePath entry in the details pane, and then double-click to make sure that this is the user account profile that has the error.
  

  1. If you have two folders starting with S-1-5 followed by some long numbers and one of them ended with .bak, you have to rename the .bak folder. To do this, follow these steps:

    •     Right-click the folder without .bak, and then click Rename. Type .ba, and then press ENTER.
    • Right-click the folder that is named .bak, and then click Rename. Remove .bak at the end of the folder name, and then press ENTER. 
    Right-click the folder that is named .ba, and then click Rename. Change the .ba to .bak at the end of the folder name, and then press ENTER.
    If you have only one folder starting with S-1-5 that is followed by long numbers and ends with .bak. Right-click the folder, and then click Rename. Remove .bak at the end of the folder name, and then press ENTER.
  2. Click the folder without .bak in the details pane, double-click RefCount, type 0, and then click OK.
     
  3. Click the folder without .bak, in the details pane, double-click State, type 0, and then click OK.
  4. Close Registry Editor.
  5. Restart the computer.
  6. Log on again with your account.

BCC all sent mails in Outlook 2010 to your another email
In Outlook 2010, Microsoft removed BCC option from Message Rule. So we can't create a rule which can sent all outgoing mails copy to an other account as BCC.

We can do this through a VBA Code which will automatically sent BCC. Follow the steps to achieve this.

1) Go to the Developer tab and click Visual Basic.

2) On the left, expand Project1 (VbaProject.OTM to reveal Microsoft Outlook Objects. Expand Microsoft Outlook Objects and then double-click ThisOutlookSession.

3) In the code editor window, choose Application from the drop-down menu in the top-left.

4) In the top-left drop-down menu, choose ItemSend.

5) Now, copy and paste the following between these two lines.  After “Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)” and before “End Sub.”

Dim oRcp As Recipient
Dim sMsg As String
Dim iRes As Integer
Dim sBcc As String
On Error Resume Next

sBcc = "EmailAddress@domain.com" 'Replace EmailAddress@domain.com with your email address
'This is BCC email address

Set oRcp = Item.Recipients.Add(sBcc)
oRcp.Type = olBCC

If Not oRcp.Resolve Then

sMsg = "Could not resolve the Bcc recipient. Do you want still to send the message?"
iRes = MsgBox(sMsg, vbYesNo + vbDefaultButton1,"Could Not Resolve Bcc Recipient")

If iRes = vbNo Then
Cancel = True
End If

End If

Set oRcp = Nothing
Note : Find sBcc=”EmailAddress@domain.com” and replace the email address you’d like to BCC

Save and Close the Visual Basic Editor and return to Outlook.

When you send messages from Outlook 2010, it will be automatically add BCC recipient you chose in the Visual Basic editor. You don’t have to type in the BCC field, nor will you even see it entered into the BCC field since the Visual Basic Script do it after you hit send. 

Enable VBA (Developer) option in Office 2010
It’s a bit tough to find Visual Basic Editor in Office 2010. It’s hiding in the Developer ribbon, which, by default, is hidden from view. Here’s how to enable it:

1) Launch (Excel, Outlook)
2) Click the File tab and choose Options.
3) Click Customize Ribbon on the left-hand panel. Now, in the list on the far right, make sure Developer is checked. Click OK.
4) The Developer tab will now be revealed in your Office 2010 Ribbon Bar.

List of Recent Documents not showing up in Task Bar or Start Menu.
List of Recent Documents is not showing up in either Task Bar or Start Menu.  In word and Excel recent documents shows while pressing Office Button. In both Excel and Excel Options / Advanced, and selected to display 15 recent documents, but they're not showing up.

Cause :
Check the recent document list within application. If its fine then there might some corruption in the recent items stored in ‘AutomaticDestinations’ folder.

To resolve and fix the issue, follow these steps:

1)   Browse to the location mentioned : %AppData%\Microsoft\Windows\Recent\AutomaticDestinations

Note: the folder ‘AutomaticDestinations’ is hidden

2)   Delete all the files

Reopen Word files and Excel file, now you can see Recent documents in both Start Menu and Task Bar

MySQL Error Code: 1418. This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
When I transferring MySQL Local Server Database to Remote MySQL Server using HeidiSQL Export. HeidiSQL produce error "Error Code: 1418. This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)" while try to transfer MySQL Functions.

MySQL Server had "Binary Logging of Stored Programs" option which cause for this error. The binary log contains information about SQL statements that modify database contents. This information is stored in the form of events that describe the modifications. The binary log has two important purposes:For replication and Certain data recovery operations

However, there are certain binary logging issues that apply with respect to stored programs (stored procedures and functions, triggers, and events), if logging occurs at the statement level:

1, A statement will affect different sets of rows on a master and a slave.
2, Replicated statements executed on a slave which has full privileges
3, If a stored program that modifies data is non deterministic

Solutions:

1, You must declare either that it is deterministic or that it does not modify data. Otherwise, it may be unsafe for data recovery or replication while creating stored procedures and functions, triggers, and events

2,  To relax the preceding conditions on function creation. Set the global log_bin_trust_function_creators system variable to 1. By default, this variable has a value of 0, but you can change it like this:

 mysql> SET GLOBAL log_bin_trust_function_creators = 1;

Documents required for vehicle sales - Kerala
In Kerala, If you try to sale your vehicle direct to a Customer you should keep some necessary documents to complete the legal transactions

1, Form 29 (2 Copies) English Malayalam

2, Form 30 English Malayalam

3, Vehicle Sale Agreement(Malayalam)

Note : Form 29 (2 Copies means ):-To be made in duplicate and the duplicate copy with the endorsement of the Registering Authority to be returned to the transferor or immediately on making entries of transfer of ownership in certificate of Registration and Form 24




MySQL stored routine error, This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration
When I try to create MySQL Stored Routine like function, then I got  "This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)". This error message will appear when try to create Stored Procedure and Function in MySQL Server which had Enabled Binary Log.

The Binary Log

The binary log contains events that describe database changes such as table creation operations or changes to the table data. It also contains events for statements that potentially could have made changes The binary log also contains information about how long each statement took that updated data. The binary log has two important purposes: 

1) For replication, the binary log on a master replication server provides a record of the data changes to be sent to slave servers. The master server sends the events contained in its binary log to its slaves, which execute those events to make the same data changes that were made on the master.

2) Certain data recovery operations require use of the binary log. After a backup has been restored, the events in the binary log that were recorded after the backup was made are re-executed. These events bring databases up to date from the point of the backup. 

Running a server with binary logging enabled makes performance slightly slower. However, the benefits of the binary log in enabling you to set up replication and for restoring operations generally outweigh this minor performance decrement.  

Binary Logging of Stored Programs

 The binary log contains information about SQL statements that modify database contents. This information is stored in the form of events that describe the modifications. The binary log has two important purposes: 

For replication, the binary log is used on master replication servers as a record of the statements to be sent to slave servers. The master server sends the events contained in its binary log to its slaves, which execute those events to make the same data changes that were made on the master.

Certain data recovery operations require use of the binary log. After a backup file has been restored, the events in the binary log that were recorded after the backup was made are re-executed. These events bring databases up to date from the point of the backup.

However, there are certain binary logging issues that apply with respect to stored programs (stored procedures and functions, and triggers):
  • Logging occurs at the statement level. In some cases, it is possible that a statement will affect different sets of rows on a master and a slave.
  • Replicated statements executed on a slave are processed by the slave SQL thread, which has full privileges. It is possible for a procedure to follow different execution paths on master and slave servers, so a user can write a routine containing a dangerous statement that will execute only on the slave where it is processed by a thread that has full privileges.
  • If a stored program that modifies data is nondeterministic, it is not repeatable. This can result in different data on a master and slave, or cause restored data to differ from the original data.
The current conditions on the use of stored functions in MySQL  can be summarized as follows. These conditions do not apply to stored procedures and they do not apply unless binary logging is enabled. 
 To create or alter a stored function, you must have the SUPER privilege, in addition to the CREATE ROUTINE or ALTER ROUTINE privilege that is normally required.

When you create a stored function, you must declare either that it is deterministic or that it does not modify data. Otherwise, it may be unsafe for data recovery or replication.
By default, for a CREATE FUNCTION statement to be accepted, at least one of DETERMINISTIC, NO SQL, or READS SQL DATA must be specified explicitly. Otherwise, this error occurs

 We can avoid this error by creating a stored routines (stored procedures and functions, and triggers) with DETERMINISTIC like

CREATE FUNCTION f1(i INT)
RETURNS INT
DETERMINISTIC
READS SQL DATA
BEGIN
RETURN i;
END;

MySQL does not check that a function declared DETERMINISTIC is free of statements that produce nondeterministic results.  

OR to relax the preceding conditions on function creation, set the global log_bin_trust_function_creators system variable to 1. By default, this variable has a value of 0, but you can change it like this: 

mysql> SET GLOBAL log_bin_trust_function_creators = 1; 
 
You can also set this variable by using the --log-bin-trust-function-creators=1 option when starting the server.

If binary logging is not enabled, log_bin_trust_function_creators does not apply.

Run Window Batch files (BAT) and Windows NT Command Script (CMD) without displaying the command prompt
Window Batch files (. BAT) and Windows NT Command Script (. CMD) files run in a console window when double-clicked. This means that the Command Prompt window will be visible until the .BAT/.CMD file execution is complete. To make .BAT or .CMD file execution less intrusive, you can configure it to run minimized. Or if the .BAT or .CMD file does not require user input during run time, you can launch it in invisible mode using a Script. Both options are discussed below. Running .BAT or .CMD files in minimized mode
1. Create a shortcut to the .BAT or .CMD file. To do so, right click on the file, click Send To, Desktop (create shortcut)
2. Right click on the shortcut and choose Properties
3. On the Run: drop down, choose Minimized
4. Click OK
5. Double-click the shortcut to run the batch file in a minimized window state.

To run .BAT or .CMD files in invisible mode use Windows Script Host’s Run Method. This will allow you to run a program or script in invisible mode.
Sample Code

Set WshShell = CreateObject("WScript.Shell") 
WshShell.Run chr(34) & "C:\Batch Files\filename.bat" & Chr(34), 0 
Set WshShell = Nothing 

Copy the lines above to Notepad and save the file to .VBS extension. Edit the .BAT file name and path accordingly, and save the file. Double-click the .VBS file to run it.

Directory Services: Local database has been closed Directory Services: Could not open local database - Novell Netware Server Locked/Closed NDS Database Error
When loading a server it states on the console that the local database is closed or locked, such as:

Directory Services:  Local database has been closed    
Directory Services:  Could not open local database
   
Users cannot login to the server. DSRepair does not run, shows no tree name, or abends the server.
The server hangs at Bindery open requested by the SERVER. Directory Services remains locked
Error:  -663

Cause

The SYS:_NETWARE\*.NDS database files have become corrupted possibly due to a hardware issue.
Missing UNICODE files in the SYS:LOGIN\NLS directory.
The TTS (Transaction Tracking Service) on the server has been overburdened due to a lack of available resources (such as memory).
Directory Services is locked on this server due to a local repair or hardware upgrade option.
Files are open in the SYS:_NETWARE directory and NDS cannot gain access to the database.

Fix

In Console Prompt type Load DSREPAIR hit ENTER

a) Select Advanced Options Menu from Available Options
b) Select Repair Local DS Database from Advanced Options
c) Type YES to Rebuild Operational Schema?  In Repair Local Database Options and hit Enter

d) Hit F10 to Perform repair
e) Hit Enter on Yes in Repair Directory? Confirm window

f) Select Yes, save the repaired database in Save The Repaired Database (DIB)? Option and hit Enter

g) Press Enter to Continue in Repair Process Completed Summery

h) Press Esc to Return to Main Menu
i) Press Esc to Exit
j) Select Yes and Hit Enter to Confirm Exit DSRepair?
k) Down the Novell Sever and Exit
Reboot the Server and Check.



Reset forgotten Windows administrator password with out third party tools
With out any 3rd party tools we can reset forgotten windows administrator account by using windows boot media. you can’t use the Windows XP boot CD for this purpose because its Recovery Console will ask for a password for the offline installation. However, you can use a Vista or Windows 7 DVD to reset a forgotten Windows administrator password on Windows XP .Windows 7 and vista use the same DVD.
  1. Boot from Windows PE or Windows RE and access the command prompt.
  2. Find the drive letter of the partition where Windows is installed. In most cases because the first partition contains Start up Repair. To find the drive letter, type C: (or D:, respectively) and search for the Windows folder. Note that Windows  usually resides on X:.
  3. Type the following command (replace “c:” with the correct drive letter if Windows is not located on C:):
    copy c:\windows\system32\sethc.exe c:\
    This creates a copy of sethc.exe to restore later.
  4. Type this command to replace sethc.exe with cmd.exe:
    copy /y c:\windows\system32\cmd.exe c:\windows\system32\sethc.exeReboot your computer and start the Windows installation where you forgot the administrator password.
  5. After you see the logon screen, press the SHIFT key five times.
  6. You should see a command prompt where you can enter the following command to reset the Windows password (see screenshot above):
    net user your_user_name new_password
    If you don’t know your user name, just type net user to list the available user names.
  7. You can now log on with the new password.
Recommend that you replace sethc.exe with the copy you stored in the root folder of your system drive in step 3. For this, you have to boot up again with Windows PE or RE because you can’t replace system files while the Windows installation is online. Then you have to enter this command:
copy /y c:\sethc.exe c:\windows\system32\sethc.exe

How to Enable or Disable Hidden / Built in Administrator Account in Windows 7
You can Enable Windows 7 Administrator Account in 2 different method.

A) Through Command Prompt :- To enable the Administrator account by using Command Prompt use the following steps.

1.  Open a Command Prompt in elevated mode this can be don by Click the Start button , type cmd in the Search box, and press CTRL+SHIFT+ENTER. Click Continue in the User Account Control box to open an elevated Command Prompt window.

Note : If you want to enable administrator account using windows 7 installation disk go to Repair --> Command Prompt

 2.After that enter the command below to activate it.
net user administrator /active:yes 

3.You should see a message that the command completed successfully. Log out, and you'll now see the Administrator account as a choice.

B) Local Security Policy - Second method for activating Administrator Account via Local Security Policy.

1) Type secpol.msc in the search bar and hit Enter.

2) After the Local Security Policy pops up, navigate to Local Policies-> Security Options where you can see an entry that reads Accounts: Administrator account. Double click the entry to enable it.

Disable Built in Administrator Account

Make sure you are logged on as your regular user account, and then open an administrator mode command prompt as above. Type the command: net user administrator /active:no This command will disable your Administrator Account

Windows XP Activation screen instead of Windows Login Screen (Can't Login to Windows Desktop)
You've just turned back on your computer and suddenly you can't get into the desktop. It gets stuck in the Windows log-on screen. And what's pretty surprising about it, the activation screen comes up and would ask you to activate again your Windows XP. What you would normally do is to activate the product hoping you could log-on back to the desktop. Unfortunately in most cases, the activation will not work. And in some other cases, when you activate the product, it would tell you that it is already activated but does the same annoying thing after a restart. This works on either Windows XP Home or Professional.

Just follow the steps in order:

1. Start your computer in safe mode.
2. Login using an administrator user account.
3. Go to Windows Start menu and open RUN or press Windows + R. Type CMD in the run text box and       click on OK. This will open the command prompt window.
4. Type these commands and press enter. Then click OK on each prompts :

regsvr32 regwizc.dll
regsvr32 licdll.dll

5. Type this last command (type exactly as what you see here)

 rundll32.exe syssetup,SetupOobeBnk

Wait for a couple of minutes because the last command will not show anything on the screen. However, it will reset the licensing components in the background.
You may now restart your computer and you can log-on back to your normal Windows desktop screen.

Camera app doesn't work in Windows 8, It produce "This app needs Permission to use your Camera. You can change this in App's Settings"
While try to take a Photo orVideo in Windows 8 using its own camera app, it shows a message "This app needs Permission to use your Camera. You can change this in App's Settings" and black out the window. You can change this by following way.
1) Open the Camera Application.
2) Swipe in from the right edge of the screen, and then tap Settings. (If you're using a mouse, point to the upper-right corner of the screen, move the mouse pointer down, and then click Settings.)
3)Tap or click Permissions.
4)Set Webcam and Microphone to On.
5)Tap or click Change camera. You can now take pictures or video.

How to Change the Product Key and Activate - Windows 8
In windows 8 you can change Product Key and Activate in two way. Normally Windows 8  doesn't providee the option directly to do this.
Method I - Move the cursor to the lower left hot corner, right click, and then click Run (alternately, press the Windows and R keys at the same time). In the Run dialog box that appears, type slui.exe 3 then click OK. The Change Product Key GUI will open.
 Enter the new product key in the text box. If the product key is valid, you'll see a message below the text box that reads, "Your product key works! Continue when you're ready."Press the Activate button.You Will Get Message "Thank you're all done".

Method II - Using Command Prompt Firstly, you need to go to the Windows 8 Charms Side Bar Select Search, type cmd and right click on CMD and select run as Administrator. Make sure you choose run as “Administrator” from the bottom options.Once the command prompt is launched with local admin privilege, run the following command to enter your activation key.
 slmgr.vbs -ipk YOUR ACTIVATION KEY HERE
 
 You will get a confirmation for the product key that you have entered. Then, run the following script to activate the product key slmgr.vbs -atoFinally, you will get a confirmation on product activated successfully .

Remove Old Entries from Windows 7 Boot Menu
First open up a command prompt in administrator mode by click the Start button , type cmd in the Search box, and press CTRL+SHIFT+ENTER. Click Continue in the User Account Control box . Then just run the bcdedit command to see a list of all the entries, copy the unique identifier to the clipboard, and then paste it into the command like so, replacing IDENTIFIER with the actual code from the clipboard.

bcdedit /delete IDENTIFIER 

It's an easy process once you go through it, but keep in mind messing with the boot loader can be dangerous, so proceed with caution.

Rename Boot Menu entries Windows 7
Rename the boot menu entries upon installing multiple windows 7 OS in a single machine.

1. Start your computer and choose either entry from the boot menu. After start up completes, make a note of which installation is running.
2. Click the Start button , type cmd in the Search box, and press CTRL+SHIFT+ENTER. Click Continue in the User Account Control box to open an elevated Command Prompt window.
3. Type the following command: bcdedit /set description "Menu description goes here" (substitute your own description for the placeholder text, and be sure to include the quotation marks). Press ENTER.
4. Restart your computer and note that the menu description you just entered now appears on the menu. Select the other menu option.
5. Repeat steps 2 and 3, again adding a menu description to replace the generic text and distinguish this installation from the other one.

Enable USB Storage (Pen Drive) in Ubuntu 12.X and Mint 13.X which is manually Disabled

Enable USB Storage (Pen Drive) Ubuntu 12.X and Mint 13.X  which is all ready manually Disabled using entries in Blacklist.conf, rc.local files and also moving usb-storage.ko. We had to reverse all these step to enable USB. To do use the following steps

In terminal:
1) sudo  mv /root/usb-storage.ko /lib/modules/3.2.0-29-generic/kernel/drivers/usb/storage
This will move usb-storage.ko to Storage
2) sudo gedit /etc/modeprobe.d/blacklist.conf
Put # mark before balcklist usb_storage save and exit
3) sudo gedit /etc/rc.local
Put # mark before modprobe -r usb_storage, save and exit
Reboot your computer and check usb storage is mounting or not