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

Wednesday, August 21, 2013

Age Calculation in MySQL based on Date of Birth Field

To find out age in mysql we can use two methods. (Assume that DOB is the field name in table)

1)SELECT DATE_FORMAT(NOW(), '%Y') - DATE_FORMAT(DOB, '%Y') - (DATE_FORMAT(NOW(), '00-%m-%d') < DATE_FORMAT(DOB, '00-%m-%d')) AS age FROM students


The above query returns the exact age. (looking for birth date)

- 2013-08-22 - 2008-11-02  returns 4 

2) SELECT YEAR( CURDATE( ) ) - YEAR( DOB ) AS age FROM students.

The above query returns the age difference by year (looking for year only)

- 2013-08-22 - 2008-11-02  returns 5

Monday, August 5, 2013

MySQL Command Line Backup

From Shell prompt Enter the following.
 $ mysqldump -u root -pmqr dbname |gzip -9 > /backup/koha/dbname-$(date +"%d-%m-%Y-%H:%M:%S").gz

This command will make mysql backup and compress it in the name format  dbname-06-08-2013-17:17:34.gz

Friday, December 9, 2011

Firefox Shortcut Keys

Firefox is one of the most using browser in internet world.

In Mozilla Firefox, you can use the combination of different keyboard keys to accomplish your routine task. With shortcut keys, you can speed up your surfing without lifting your hands from the keys; otherwise require a conventional mouse to select menus and buttons options. Basically keyboard shortcuts keys help you to save time and you can perform any tasks without leaving the keyboard keys.

Navigation

Command Shortcut
Back Alt + ← or
Backspace
Forward Alt + → or
Shift + Backspace
Home Alt + Home
Open File Ctrl + O
Reload F5 or
Ctrl + R
Reload (override cache) Ctrl + F5 or
Ctrl + Shift + R
Stop Esc.

Current Page

Command Shortcut
Go to Bottom of Page End
Go to Top of Page Home
Move to Next Frame F6
Move to Previous Frame Shift + F6
Print Ctrl + P
Save Page As Ctrl + S
Zoom In Ctrl + +
Zoom Out Ctrl + -
Zoom Reset Ctrl + 0

Search

CommandShortcut
FindCtrl + F
Find Again F3 or
Ctrl + G
Find Previous Shift + F3 or
Ctrl + Shift + G
Quick Find within link-text only'
Quick Find/

Miscellaneous

Command Shortcut
Complete .com Address Ctrl + Enter
Complete .net Address Shift + Enter
Complete .org Address Ctrl + Shift + Enter
Delete Selected Autocomplete Entry Del
Toggle Full Screen F11
Help F1
Toggle Menu Bar (when hidden) Alt
F10Alt (KDE)
F10 (GNOME)
Show/Hide Add-on Bar Ctrl +
Select Location Bar F6 or
Alt + D or
Ctrl + L

Bookmarks

Command Shortcut
Bookmark All Tabs Ctrl + Shift + D
Bookmark This Page Ctrl + D
Bookmarks sidebar Ctrl + B
Ctrl + I
Library window (Bookmarks) Ctrl + Shift + B

Windows & Tabs

Command Shortcut
Close Tab Ctrl + W
Ctrl + F4
Close Window Ctrl + Shift + W
Alt + F4
Move Tab in focus Left Ctrl + ←
Ctrl + ↑
Move Tab in focus Right Ctrl + →
Ctrl + ↓
Move Tab in focus to start Ctrl + Home
Move Tab in focus to end Ctrl + End
New Tab Ctrl + T
New Window Ctrl + N
Next Tab Ctrl + Tab or
Ctrl + Page Down
Open Address in New Tab Alt + Enter (from Location Bar or Search Bar)
Previous Tab Ctrl + Shift + Tab or
Ctrl + Page Up
Undo Close Tab Ctrl + Shift + T
Undo Close Window Ctrl + Shift + N
Select Tab 1 to 8 Ctrl + 1 to 8

Thursday, December 8, 2011

Windows key keyboard shortcuts

Below is a listing of Windows keys that can be used on computers running a Microsoft Windows operating system and using a keyboard with a Windows key. In the below list of shortcuts, the Windows key is represented by "WINKEY".

Shortcut KeysDescription
WINKEYPressing the Windows key alone will open Start.
WINKEY + F1Opens the Microsoft Windows help and support center.
WINKEY + F3Opens the Advanced find window in Microsoft Outlook.
WINKEY + D Brings the desktop to the top of all other windows.
WINKEY + MMinimizes all windows.
WINKEY + SHIFT + MUndo the minimize done by WINKEY + M and WINKEY + D.
WINKEY + EOpen Microsoft Explorer.
WINKEY + TabCycle through open programs through the taskbar.
WINKEY + FDisplay the Windows Search / Find feature.
WINKEY + CTRL + F Display the search for computers window.
WINKEY + ROpen the run window.
WINKEY + Pause / Break key Open the system properties window.
WINKEY + UOpen Utility Manager.
WINKEY + LLock the computer and switch users if needed (Windows XP and above only).
WINKEY + PQuickly change between monitor display types. (Windows 7 only)
WINKEY + LEFT ARROWShrinks the window to 1/2 screen on the left side for side by side viewing. (Windows 7 only)
WINKEY + RIGHT ARROWShrinks the window to 1/2 screen on the right side for side by side viewing. (Windows 7 only)
WINKEY + UP ARROWWhen in the side by side viewing mode, this shortcut takes the screen back to full size. (Windows 7 only)
WINKEY + DOWN ARROWMinimizes the screen.  Also, when in the side by side viewing mode, this shortcut takes the screen back to a minimized size. (Windows 7 only)

Thursday, August 25, 2011

Windows Shortcut Keys

Below is a listing of all the major Windows shortcut keys
Shortcut KeysDescription
Alt + TabSwitch between open applications.
Alt + Shift + TabSwitch backwards between open applications.
Alt + double-clickDisplay the properties of the object you double-click on. For example, doing this on a file would display its properties.
Ctrl + TabSwitches between program groups or document windows in applications that support this feature.
Ctrl + Shift + TabSame as above but backwards.
Alt + Print ScreenCreate a screen shot only for the program you are currently in.
Ctrl + Print ScreenCreates a screen shot of the entire screen
Ctrl + Alt + DelReboot the computer and brings up the Windows task manager.
Ctrl + Shift + EscImmediately bring up the Windows task manager.
Ctrl + EscBring up the Windows Start menu. In Windows 3.x this would bring up the Task Manager.
Alt + EscSwitch Between open applications on taskbar.
F1Activates help for current open application.
F2Renames selected Icon.
F3Starts find from desktop.
F4Opens the drive selection when browsing.
F5Refresh Contents to where you were on the page.
Ctrl + F5Refreshes page to the beginning of the page.
F10Activates menu bar.
Shift + F10Simulates right-click on selected item.
F4Select a different location to browse in the Windows Explorer toolbar.
Alt + F4Closes Current open program.
Ctrl + F4Closes Window in Program.
F6Move cursor to different Windows Explorer pane.
Alt + Space barDrops down the window control menu.
Ctrl + (the '+' key on the keypad)Automatically adjust the widths of all the columns in Windows explorer
Alt + EnterOpens properties window of selected icon or program.
Alt + Space barOpen the control menu for the current window open.
Shift + Del Delete programs/files without throwing them into the recycle bin.
Holding ShiftBoot Safe Mode or by pass system files as the computer is booting.
Holding ShiftWhen putting in an audio CD, will prevent CD Player from playing.
EnterActivates the highlighted program.
Alt + Down arrowDisplay all available options on drop down menu.
* (on the keypad)Expands all folders on the currently selected folder or drive in Windows Explorer.
+ (on the keypad)Expands only the currently selected folder in Windows Explorer.
- (on the keypad)Collapses the currently selected folder in Windows Explorer.