Tuesday, May 20, 2008

Microsoft SQL Server 2008

Microsoft SQL Server 2008
— Code name “katmai”
— Currently in Beta
— CTP available for free download
— CTP contains working features end-end
— RTM in Q3 2008

System Requirements
— Supported Operating Systems:
— Windows Server 2003 Service Pack 2
— Windows Server 2008
— Windows Vista
— Windows XP Service Pack 2
— For all download types:
— 32-bit systems:
— Intel compatible Pentium III 600 MHz (1 GHz recommended)
— 64-bit systems:
— 1 GHz CPU
— 512 MB of RAM (1 GB recommended)
— 675 MB of available hard disk space

What’s New?
— Platform Features (DBA)
— T-SQL Features
— Data Types
— Reporting Services

Platform Features
— Transparent Data Encryption
— External Key Management
— Data Auditing (change tracking)
— Hot Add CPU
— Transparent Failover
— Policy Implementation
— Auto Synchronization (conflict detection)

T-SQL Features
— Table Value Parameters
— FileStream Object Storage
— Merge
— Variable initializers
— Row constructors with >1 row
— Compound operators (+=)
— Grouping sets (extension of Group By clause)
— Intellisense added
— New Collations
— CLR UDT 2GB capacity
— Integrated Full Text Search
— Sparse Columns (Indexing)

T-SQL Data Types
— Geometery (for planar shapes, i.e. whse layout)
— Geography (for GPS coordinates)
— HierarchyID
— date
— time
— datetime2
— Datetimeoffset (timezone )

Business Intelligence
— SSRS free with SQL Server 2008
— Incorporates Dundas Controls
— Render to MS-Word
— Scale out Analysis (read-only)
— Subspace computations/aggregations
— New Cube Design Tools
— Best Practice Design Alerts
— IIS Agnostic SSRS

New Features of Visual Studio 2008 and .NET Framework 3.5

New Features of Visual Studio 2008 and .NET Framework 3.5

• Javascript Intellisense
• Javascript Debugging
• CSS Web Designer and CSS Support
• Vertical Split View Support
• Debug .NET Framework Source
• Multi-targeting support
– .NET Framework 2.0, 3.0 and 3.5


JS Intellisense



























Immediate Window



















AJAX Intellisense















Other Visual Studio 2008 Features
• In-built Silverlight Library
• WPF Support
• New AJAX Extender Controls
• Intellisense Improvements
• In-built C++ SDK
• Microsoft Popfly Support
• Nested ASP.NET Masterpages

.NET Framework 3.5 Features
• Anonymous Types
• Automatic Properties, Object Initializers and Collection Initializers
• Extension Methods
• Lambda Expressions
• LINQ to SQL
• LINQ to XML
• LINQ to Objects

Microsoft Windows XP SHORTCUT KEYS

Microsoft Windows SHORTCUT KEYS: Windows XP Shortcuts

ALT+- (ALT+hyphen) Displays the Multiple Document Interface (MDI) child window's System menu
ALT+ENTER View properties for the selected item
ALT+ESC Cycle through items in the order they were opened
ALT+F4 Close the active item, or quit the active program
ALT+SPACEBAR Display the System menu for the active window
ALT+TAB Switch between open items
ALT+Underlined letter Display the corresponding menu
BACKSPACE View the folder one level up in My Computer or Windows Explorer
CTRL+A Select all
CTRL+B Bold
CTRL+C Copy
CTRL+I Italics
CTRL+O Open an item
CTRL+U Underline
CTRL+V Paste
CTRL+X Cut
CTRL+Z Undo
CTRL+F4 Close the active document
CTRL while dragging Copy selected item
CTRL+SHIFT while dragging Create shortcut to selected iteM
CTRL+RIGHT ARROW Move the insertion point to the beginning of the next word
CTRL+LEFT ARROW Move the insertion point to the beginning of the previous word
CTRL+DOWN ARROW Move the insertion point to the beginning of the next paragraph
CTRL+UP ARROW Move the insertion point to the beginning of the previous paragraph
SHIFT+DELETE Delete selected item permanently without placing the item in the Recycle Bin
ESC Cancel the current task
F1 Displays Help
F2 Rename selected item
F3 Search for a file or folder
F4 Display the Address bar list in My Computer or Windows Explorer
F5 Refresh the active window
F6 Cycle through screen elements in a window or on the desktop
F10 Activate the menu bar in the active program
SHIFT+F10 Display the shortcut menu for the selected item
CTRL+ESC Display the Start menu
SHIFT+CTRL+ESC Launches Task Manager
SHIFT when you insert a CD Prevent the CD from automatically playing
WIN Display or hide the Start menu
WIN+BREAK Display the System Properties dialog box
WIN+D Minimizes all Windows and shows the Desktop
WIN+E Open Windows Explorer
WIN+F Search for a file or folder
WIN+F+CTRL Search for computers
WIN+L Locks the desktop
WIN+M Minimize or restore all windows
WIN+R Open the Run dialog box
WIN+TAB Switch between open items

Sunday, May 18, 2008

PHP/MySQL How to Create and use Tell a Friend Script in PHP

PHP/MySQL How to Create and use Tell a Friend Script in PHP
How to Create and use Tell a Friend Script in PHP
This Script for Tell a Friend featuring
· Page tracking for landing page
· PHP Validation
· Ability to send to muliple friends at once
· User Email/Message optional or required
This PHP script consists of 2 files
1. config.php
2. tell.php
Where config.php can be used for Site Options and configuration. Open config.php and edit it to your specification, use notepad/wordpad/frontpage/dreamweaver etc. to edit it.
Setup Options:
Require Email -> Require user to enter their email to send a TAF (Tell-a-Friend) message, 1= yes, 2=no
Require Message -> Require user to enter a message to send a TAF (Tell-a-Friend) message, 1= yes, 2=no
Multiple Emails -> Allow users to send multiple emails (separated by Comma) to friends.
Current Landing Page -> If enabled, message will include the current page to which the user sent the TAF from.
Site Title -> Title of the site, e.g.: allfree-stuff.com All Free Stuff for you
Site URL -> URL of the site, e.g.: http://www.allfree-stuff.com
Site Email -> To be used for Reply to and From headers
Email Charset -> UTF-8 should suit most, but you can localize it if needed
Email Type -> text/plain (text only) or text/html (html+text)
Email Subject -> Subject of Email sent
Email Template -> Email to be sent to user
To Use this Script in your website
To use this script, place this code andwhere where you want the counter to appear:
Create the following 2 files and upload them in your website.
CONFIG.PHP
//Site Options and configuration
//Require user to enter their email -> 1=yes,2=no
$REQUIRE_EMAIL = 1;
//Require user to enter a message -> 1=yes,2=no
$REQUIRE_MESS = 1;
//Allow Multiple emails be sent -> 1=yes,2=no
//Multiple emails separated comma
$MULTIPLE_EMAILS = 1;
//Send current page in email -> 1=yes,2=no
$CUR_PAGE = 1;
//Site title
$EMAIL_OPTIONS['TITLE'] = 'Demo of Tell A Friend PHP Script ' ;
//Site URL
$EMAIL_OPTIONS['URL'] = 'http://allfree-stuff.com';
//Main email
$EMAIL_OPTIONS['FROM'] = 'webmaster@allfree-stuff.com';
//Charset
$EMAIL_OPTIONS['CHARSET'] = 'utf-8';
//Type -> HTML=text/html Text = text/plain
$EMAIL_OPTIONS['TYPE'] = 'text/html';
//Email subjects
$EMAIL_OPTIONS['EMAIL_SUBJECT'] = 'Tell A Friend For You' ;
/*
For Templates you can use the following variables:
$+name+$ -> User Name Sending Contact
$+page_send+$ -> Page user is comming from
$+message_text+$ -> Contact Message
*/
//EMAIL Template
$EMAIL_TEMPLATE = 'Hello,
Your friend $+name+$ decided to sent you a tell-a-friend notice.';
if($CUR_PAGE == 1){
$EMAIL_TEMPLATE .= 'You can visit the page your friend sent his email: $+page_send+$';
}
if($REQUIRE_MESS == 1){
$EMAIL_TEMPLATE .= 'Your friend\'s message was: $+message_text+$';
}
$EMAIL_TEMPLATE .= 'You can visit our main url @ '.$EMAIL_OPTIONS['URL'].',
'.$EMAIL_OPTIONS['TITLE'].'';
/* +++++++++++++++++++++++++++++++++++++
END FILE CONFIGURATION
---------------------------------------*/
?>
TELL.PHP
//Include configuration file and function file
//(default location is in the same directory)
include_once('config.php') ;
//Function to check for valid email
function is_valid_email($string) {
return preg_match('/^[.\w-]+@([\w-]+\.)+[a-zA-Z]{2,6}$/', $string) ;
}
//Check cur page
if($_POST['this_page'] == NULL){$_POST['this_page'] = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']; }
//If contact is being sent:
if($_POST['submit_id'] == 1){
//Check name entered
if($_POST['name'] == NULL){ $message = 'Please enter your name.';}
//check if email is enetered
if($message == NULL && $REQUIRE_EMAIL == 1 && is_valid_email($_POST['email']) == false ){ $message = 'Please enter a valid email.';}
//check if message is entered
if($message == NULL && $REQUIRE_MESS == 1 && $_POST['message_text'] == NULL){ $message = 'Please enter a comment.';}
//check to send emails
if($message == NULL)
{
if($MULTIPLE_EMAILS == 1){
//multiple emails
$valid_emails = array();
$emails = explode(',',$_POST['toemails']);
foreach($emails as $email){
$email = trim($email);
if($email != NULL){
if(is_valid_email($email) == false ){
$temp_message .= 'We couldn\'t send and email to: '.$email.' because it is not valid.';
} else {
array_push($valid_emails,$email);
}
}
}
if(count($valid_emails) <=0 ){
$message = 'Please enter at least one email to send message to.';
}
} else {
//one email
if(is_valid_email($_POST['toemails']) == false ){ $message = 'Please enter a valid friend\'s email.';}
}
}
//End verifications, start processing
if($message == NULL){
//compose user message templates replaces
$do_search = array('$+name+$','$+page_send+$','$+message_text+$');
$do_replace = array($_POST['name'],$_POST['this_page'],$_POST['message_text']);
$subject = str_replace($do_search,$do_replace,$EMAIL_TEMPLATE);
//Set Headers
$headers = "Return-Path: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n";
$headers .= "From: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n";
$headers .= "Content-Type: ".$EMAIL_OPTIONS['TYPE']."; charset=".$EMAIL_OPTIONS['CHARSET'].";\n\n\r\n";
if($MULTIPLE_EMAILS == 1){
foreach($valid_emails as $this_email){
// mail ($this_email,$EMAIL_OPTIONS['EMAIL_SUBJECT'],$subject,$headers);
$one_pass = true ;
}
} else {
mail ($_POST['toemails'],$EMAIL_OPTIONS['EMAIL_SUBJECT'],$subject,$headers);
}
$message = 'Your emails have been sent, thank you.';
$message .= $temp_message ;
$_POST = NULL ;
}
}
if($message != NULL){
?>
" method=post>
Your name:
" name=name>
if($REQUIRE_EMAIL == 1){?>
Your Email:
" name=email>
Your Friend's emails:
Separated by comma
Your Friend's email:
" name=toemails>
if($REQUIRE_MESS == 1){?>
Message:

" name=this_page>

Microsoft Windows SHORTCUT KEYS : Run Commands To Access The Control Panel

Microsoft Windows SHORTCUT KEYS : Run Commands To Access The Control Panel

Add/Remove Programs control appwiz.cpl

Date/Time Properties control timedate.cpl


Display Properties control desk.cpl


FindFast control findfast.cpl


Fonts Folder control fonts


Internet Properties control inetcpl.cpl


Keyboard Properties control main.cpl keyboard


Mouse Properties control main.cpl

Multimedia Properties control mmsys.cpl

Network Properties control netcpl.cpl

Password Properties control password.cpl

Printers Folder control printers

Sound Properties control mmsys.cpl sounds

System Properties control sysdm.cpl

Changing MySQL root user password using mysql sql command

Changing MySQL root user password using mysql sql command

This is another method. MySQL stores username and passwords in user table inside MySQL database. You can directly update password using the following method to update or change password for user kamal:

1) Login to mysql server, type following command at shell prompt:
$ mysql -u root -p

2) Use mysql database (type command at mysql> prompt):
mysql> use mysql;

3) Change password for user kamal:
mysql> update user set password=PASSWORD("NEWPASSWORD") where User='kamal';

4) Reload privileges:mysql> flush privileges;mysql> quit
This method you need to use while using PHP or Perl scripting.

Microsoft Windows SHORTCUT KEYS : Command Prompt

Microsoft Windows SHORTCUT KEYS : Command Prompt


ANSI.SYS Defines functions that change display graphics, control cursor movement, and reassign keys.

APPEND Causes MS-DOS to look in other directories when editing a file or running a command.

ARP Displays, adds, and removes arp information from network devices.

ASSIGN Assign a drive letter to an alternate letter.

ASSOC View the file associations.

AT Schedule a time to execute commands or programs.

ATMADM Lists connections and addresses seen by Windows ATM call manager.

ATTRIB Display and change file attributes.

BATCH Recovery console command that executes a series of commands in a file.

BOOTCFG Recovery console command that allows a user to view, modify, and rebuild the boot.ini

BREAK Enable / disable CTRL + C feature.

CACLS View and modify file ACL's.

CALL Calls a batch file from another batch file.

CD Changes directories.

CHCP Supplement the International keyboard and character set information.

CHDIR Changes directories.

CHKDSK Check the hard disk drive running FAT for errors.

CHKNTFS Check the hard disk drive running NTFS for errors.

CHOICE Specify a listing of multiple options within a batch file.

CLS Clears the screen.

CMD Opens the command interpreter.

COLOR Easily change the foreground and background color of the MS-DOS window.

COMP Compares files.

COMPACT Compresses and uncompress files.

CONTROL Open control panel icons from the MS-DOS prompt.

CONVERT Convert FAT to NTFS.

COPY Copy one or more files to an alternate location.

CTTY Change the computers input/output devices.

DATE View or change the systems date.

DEBUG Debug utility to create assembly programs to modify hardware settings.

DEFRAG Re-arrange the hard disk drive to help with loading programs.

DEL Deletes one or more files.

DELETE Recovery console command that deletes a file.

DELTREE Deletes one or more files and/or directories.

DIR List the contents of one or more directory.

DISABLE Recovery console command that disables Windows system services or drivers.

DISKCOMP Compare a disk with another disk.

DISKCOPY Copy the contents of one disk and place them on another disk.

DOSKEY Command to view and execute commands that have been run in the past.

DOSSHELL A GUI to help with early MS-DOS users.

DRIVPARM Enables overwrite of original device drivers.

ECHO Displays messages and enables and disables echo.

EDIT View and edit files.

EDLIN View and edit files.

EMM386 Load extended Memory Manager.

ENABLE Recovery console command to enable a disable service or driver.

ENDLOCAL Stops the localization of the environment changes enabled by the setlocal command.

ERASE Erase files from computer.

EXIT Exit from the command interpreter.

EXPAND Expand a M*cros*ft Windows file back to it's original format.

EXTRACT Extract files from the M*cros*ft Windows cabinets.

FASTHELP Displays a listing of MS-DOS commands and information about them.

FC Compare files.

FDISK Utility used to create partitions on the hard disk drive.

FIND Search for text within a file.

FINDSTR Searches for a string of text within a file.

FIXBOOT Writes a new boot sector.

FIXMBR Writes a new boot record to a disk drive.

FOR Boolean used in batch files.

FORMAT Command to erase and prepare a disk drive.

FTP Command to connect and operate on a FTP server.

FTYPE Displays or modifies file types used in file extension associations.

GOTO Moves a batch file to a specific label or location.

GRAFTABL Show extended characters in graphics mode.

HELP Display a listing of commands and brief explanation.

IF Allows for batch files to perform conditional processing.

IFSHLP.SYS 32-bit file manager.

IPCONFIG Network command to view network adapter settings and assigned values.

KEYB Change layout of keyboard.

LABEL Change the label of a disk drive.

LH Load a device driver in to high memory.

LISTSVC Recovery console command that displays the services and drivers.

LOADFIX Load a program above the first 64k.

LOADHIGH Load a device driver in to high memory.

LOCK Lock the hard disk drive.

LOGON Recovery console command to list installations and enable administrator login.

MAP Displays the device name of a drive.

MD Command to create a new directory.

MEM Display memory on system.

MKDIR Command to create a new directory.

MODE Modify the port or display settings.

MORE Display one page at a time.

MOVE Move one or more files from one directory to another directory.

MSAV Early M*cros*ft Virus scanner.

MSD Diagnostics utility.

MSCDEX Utility used to load and provide access to the CD-ROM.

NBTSTAT Displays protocol statistics and current TCP/IP connections using NBT

NET Update, fix, or view the network or network settings

NETSH Configure dynamic and static network information from MS-DOS.

NETSTAT Display the TCP/IP network protocol statistics and information.

NLSFUNC Load country specific information.

NSLOOKUP Look up an IP address of a domain or host on a network.

PATH View and modify the computers path location.

PATHPING View and locate locations of network latency.

PAUSE Command used in batch files to stop the processing of a command.

PING Test / send information to another network computer or network device.

POPD Changes to the directory or network path stored by the pushd command.

POWER Conserve power with computer portables.

PRINT Prints data to a printer port.

PROMPT View and change the MS-DOS prompt.

PUSHD Stores a directory or network path in memory so it can be returned to at any time.

QBASIC Open the QBasic.

RD Removes an empty directory.

REN Renames a file or directory.

RENAME Renames a file or directory.

RMDIR Removes an empty directory.

ROUTE View and configure windows network route tables.

RUNAS Enables a user to execute a program on another computer.

SCANDISK Run the scandisk utility.

SCANREG Scan registry and recover registry from errors.

SET Change one variable or string to another.

SETLOCAL Enables local environments to be changed without affecting anything else.

SETVER Change MS-DOS version to trick older MS-DOS programs.

SHARE Installs support for file sharing and locking capabilities.

SHIFT Changes the position of replaceable parameters in a batch program.

SHUTDOWN Shutdown the computer from the MS-DOS prompt.

SMARTDRV Create a disk cache in conventional memory or extended memory.

SORT Sorts the input and displays the output to the screen.

START Start a separate window in Windows from the MS-DOS prompt.

SUBST Substitute a folder on your computer for another drive letter.

SWITCHES Remove add functions from MS-DOS.

SYS Transfer system files to disk drive.

TELNET Telnet to another computer / device from the prompt.

TIME View or modify the system time.

TITLE Change the title of their MS-DOS window.

TRACERT Visually view a network packets route across a network.

TREE View a visual tree of the hard disk drive.

TYPE Display the contents of a file.

UNDELETE Undelete a file that has been deleted.

UNFORMAT Unformat a hard disk drive.

UNLOCK Unlock a disk drive.

VER Display the version information.

VERIFY Enables or disables the feature to determine if files have been written properly.

VOL Displays the volume information about the designated drive.

XCOPY Copy multiple files, directories, and/or drives from one location to another.

TRUENAME When placed before a file, will display the whole directory in which it exists

TASKKILL It allows you to kill those unneeded or locked up applications