Tuesday, December 18, 2012

thumbnail

How to remove SegmentControl Shadow Effect.


-(void)defineSegmentControlStyle
{
    //normal segment
    NSDictionary *normalAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                      [UIFont fontWithName:@"Helvetica" size:16.0],UITextAttributeFont,
                                      [UIColor colorWithRed:75.0/255.0 green:75.0/255.0 blue:75.0/255.0 alpha:1.0], UITextAttributeTextColor,
                                      [UIColor clearColor], UITextAttributeTextShadowColor,
                                      [NSValue valueWithUIOffset:UIOffsetMake(0, 1)], UITextAttributeTextShadowOffset,
                                      nil];//[NSDictionary dictionaryWithObject:  [UIColor redColor]forKey:UITextAttributeTextColor];
    [tempSegmentControl setTitleTextAttributes:normalAttributes forState:UIControlStateNormal];
    
    NSDictionary *selectedAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                        [UIFont fontWithName:@"Helvetica" size:16.0],UITextAttributeFont,
                                        [UIColor whiteColor], UITextAttributeTextColor,
                                        [UIColor clearColor], UITextAttributeTextShadowColor,
                                        [NSValue valueWithUIOffset:UIOffsetMake(0, 1)], UITextAttributeTextShadowOffset,
                                        nil] ;//[NSDictionary dictionaryWithObject:  [UIColor redColor]forKey:UITextAttributeTextColor];
    [tempSegmentControl setTitleTextAttributes:selectedAttributes forState:UIControlStateSelected];
    
}

Sunday, October 14, 2012

thumbnail

Multilingual App in iPhone Without effecting on ios Device language


//=========================.h file =====================================
//  LocalizationSystem.h
//  NYF
//
//  Created by Nasrullah Mahar on 10/15/12.
//  Copyright (c) 2012 Techliance. All rights reserved.
//

#import

#import

#define AMLocalizedString(key, comment) \
[[LocalizationSystem sharedLocalSystem] localizedStringForKey:(key) value:(comment)]

#define LocalizationSetLanguage(language) \
[[LocalizationSystem sharedLocalSystem] setLanguage:(language)]

#define LocalizationGetLanguage \
[[LocalizationSystem sharedLocalSystem] getLanguage]

#define LocalizationReset \
[[LocalizationSystem sharedLocalSystem] resetLocalization]

@interface LocalizationSystem : NSObject {
NSString *language;
}

// you really shouldn't care about this functions and use the MACROS
+ (LocalizationSystem *)sharedLocalSystem;

//gets the string localized
- (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)comment;

//sets the language
- (void) setLanguage:(NSString*) language;

//gets the current language
- (NSString*) getLanguage;

//resets this system.
- (void) resetLocalization;
@end



============================ .m File =============================
//
//  LocalizationSystem.m
//  NYF
//
//  Created by Nasrullah Mahar on 10/15/12.
//  Copyright (c) 2012 Techliance. All rights reserved.
//

#import "LocalizationSystem.h"


@implementation LocalizationSystem

//Singleton instance
static LocalizationSystem *_sharedLocalSystem = nil;

//Current application bungle to get the languages.
static NSBundle *bundle = nil;

+ (LocalizationSystem *)sharedLocalSystem
{
@synchronized([LocalizationSystem class])
{
if (!_sharedLocalSystem){
[[self alloc] init];
}
return _sharedLocalSystem;
}
// to avoid compiler warning
return nil;
}

+(id)alloc
{
@synchronized([LocalizationSystem class])
{
NSAssert(_sharedLocalSystem == nil, @"Attempted to allocate a second instance of a singleton.");
_sharedLocalSystem = [super alloc];
return _sharedLocalSystem;
}
// to avoid compiler warning
return nil;
}


- (id)init
{
    if ((self = [super init])) 
    {
//empty.
bundle = [NSBundle mainBundle];
}
    return self;
}

// Gets the current localized string as in NSLocalizedString.
//
// example calls:
// AMLocalizedString(@"Text to localize",@"Alternative text, in case hte other is not find");
- (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)comment
{
return [bundle localizedStringForKey:key value:comment table:nil];
}


// Sets the desired language of the ones you have.
// example calls:
// LocalizationSetLanguage(@"Italian");
// LocalizationSetLanguage(@"German");
// LocalizationSetLanguage(@"Spanish");
// 
// If this function is not called it will use the default OS language.
// If the language does not exists y returns the default OS language.
- (void) setLanguage:(NSString*) l{
NSLog(@"preferredLang: %@", l);
NSString *path = [[ NSBundle mainBundle ] pathForResource:l ofType:@"lproj" ];
    
if (path == nil)
//in case the language does not exists
[self resetLocalization];
else
bundle = [[NSBundle bundleWithPath:path] retain];
}

// Just gets the current setted up language.
// returns "es","fr",...
//
// example call:
// NSString * currentL = LocalizationGetLanguage;
- (NSString*) getLanguage{
    
NSArray* languages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
    
NSString *preferredLang = [languages objectAtIndex:0];
    
return preferredLang;
}

// Resets the localization system, so it uses the OS default language.
//
// example call:
// LocalizationReset;
- (void) resetLocalization
{
bundle = [NSBundle mainBundle];
}

@end

===========================Calling=============================

-(IBAction)getEnglish:(id)sender
{
    
    LocalizationSetLanguage(@"en");
    lblMultilingualtext.text = AMLocalizedString(@"WelcomeKey", @"");

}

-(IBAction)getArabic:(id)sender
{
    LocalizationSetLanguage(@"ar");
    lblMultilingualtext.text = AMLocalizedString(@"WelcomeKey", @"");
}

==========================Localizable String Files=====================

======================en file=======
/* 
  Localizable.strings
  NYF

  Created by Nasrullah Mahar on 10/15/12.
  Copyright (c) 2012 Techliance. All rights reserved.
*/

"WelcomeKey" = "Welcome!!!!";

======================ar file=========

/* 
  Localizable.strings
  NYF

  Created by Nasrullah Mahar on 10/15/12.
  Copyright (c) 2012 Techliance. All rights reserved.
*/

"WelcomeKey" = "مرحبا!!";




Sunday, September 23, 2012

thumbnail

Avoiding Buffer Overflows and Underflows


Buffer overflows, both on the stack and on the heap, are a major source of security vulnerabilities in C, Objective-C, and C++ code. This chapter discusses coding practices that will avoid buffer overflow and underflow problems, lists tools you can use to detect buffer overflows, and provides samples illustrating safe code.
Every time your program solicits input (whether from a user, from a file, over a network, or by some other means), there is a potential to receive inappropriate data. For example, the input data might be longer than what you have reserved room for in memory.
When the input data is longer than will fit in the reserved space, if you do not truncate it, that data will overwrite other data in memory. When this happens, it is called a buffer overflow. If the memory overwritten contained data essential to the operation of the program, this overflow causes a bug that, being intermittent, might be very hard to find. If the overwritten data includes the address of other code to be executed and the user has done this deliberately, the user can point to malicious code that your program will then execute.
Similarly, when the input data is or appears to be shorter than the reserved space (due to erroneous assumptions, incorrect length values, or copying raw data as a C string), this is called a buffer underflow. This can cause any number of problems from incorrect behavior to leaking data that is currently on the stack or heap.
Although most programming languages check input against storage to prevent buffer overflows and underflows, C, Objective-C, and C++ do not. Because many programs link to C libraries, vulnerabilities in standard libraries can cause vulnerabilities even in programs written in “safe” languages. For this reason, even if you are confident that your code is free of buffer overflow problems, you should limit exposure by running with the least privileges possible. See“Elevating Privileges Safely” for more information on this topic.
Keep in mind that obvious forms of input, such as strings entered through dialog boxes, are not the only potential source of malicious input. For example:
  1. Buffer overflows in one operating system’s help system could be caused by maliciously prepared embedded images.
  2. A commonly-used media player failed to validate a specific type of audio files, allowing an attacker to execute arbitrary code by causing a buffer overflow with a carefully crafted audio file.
    [1CVE-2006-1591 2CVE-2006-1370]
There are two basic categories of overflow: stack overflows and heap overflows. These are described in more detail in the sections that follow. More Detail

Wednesday, September 19, 2012

thumbnail

Exception handling in Objective C


Exception Handling

The Objective-C language has an exception-handling syntax similar to that of Java and C++. By using this syntax with the NSExceptionNSError, or custom classes, you can add robust error-handling to your programs. This chapter provides a summary of exception syntax and handling; 

Enabling Exception-Handling

Using GNU Compiler Collection (GCC) version 3.3 and later, Objective-C provides language-level support for exception handling. To turn on support for these features, use the -fobjc-exceptions switch of the GNU Compiler Collection (GCC) version 3.3 and later. (Note that this switch renders the application runnable only in OS X v10.3 and later because runtime support for exception handling and synchronization is not present in earlier versions of the software.)

Exception Handling

An exception is a special condition that interrupts the normal flow of program execution. There are a variety of reasons why an exception may be generated (exceptions are typically said to be raised or thrown), by hardware as well as software. Examples include arithmetical errors such as division by zero, underflow or overflow, calling undefined instructions (such as attempting to invoke an unimplemented method), and attempting to access a collection element out of bounds.
Objective-C exception support involves four compiler directives: @try@catch@throw, and @finally:
  • Code that can potentially throw an exception is enclosed in a @try{} block.
  • @catch{} block contains exception-handling logic for exceptions thrown in a @try{} block. You can have multiple @catch{} blocks to catch different types of exception. (For a code example, see “Catching Different Types of Exception.”)
  • You use the @throw directive to throw an exception, which is essentially an Objective-C object. You typically use an NSException object, but you are not required to.
  • @finally{} block contains code that must be executed whether an exception is thrown or not.
This example depicts a simple exception-handling algorithm:
Cup *cup = [[Cup alloc] init];
 
@try {
    [cup fill];
}
@catch (NSException *exception) {
    NSLog(@"main: Caught %@: %@", [exception name], [exception reason]);
}
@finally {
    [cup release];
}

Catching Different Types of Exception

To catch an exception thrown in a @try{} block, use one or more @catch{}blocks following the @try{} block. The @catch{} blocks should be ordered from most-specific to least-specific. That way you can tailor the processing of exceptions as groups, as shown in Listing 10-1.
Listing 10-1  An exception handler
@try {
    ...
}
@catch (CustomException *ce) {   // 1
    ...
}
@catch (NSException *ne) {       // 2
    // Perform processing necessary at this level.
    ...
 
}
@catch (id ue) {
    ...
}
@finally {                       // 3
    // Perform processing necessary whether an exception occurred or not.
    ...
}
The following list describes the numbered code lines:
  1. Catches the most specific exception type.
  2. Catches a more general exception type.
  3. Performs any clean-up processing that must always be performed, whether exceptions were thrown or not.

Throwing Exceptions

To throw an exception, you must instantiate an object with the appropriate information, such as the exception name and the reason it was thrown.
NSException *exception = [NSException exceptionWithName: @"HotTeaException"
                                                 reason: @"The tea is too hot"
                                               userInfo: nil];
@throw exception;
Inside a @catch{} block, you can rethrow the caught exception using the @throw directive without providing an argument. Leaving out the argument in this case can help make your code more readable.
You are not limited to throwing NSException objects. You can throw any Objective-C object as an exception object. The NSException class provides methods that help in exception processing, but you can implement your own if you so desire. You can also subclass NSException to implement specialized types of exceptions, such as file-system exceptions or communications exceptions.

Courtesy:http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/Exceptions/Tasks/HandlingExceptions.html#//apple_ref/doc/uid/20000059-SW1

Tuesday, September 18, 2012

Monday, September 10, 2012

thumbnail

Recovering Memory You Have Abandoned


The Allocations trace template measures heap memory usage by tracking allocations, including specific object allocations by class. It also records virtual memory statistics by region. It consists of the Allocations and the VM Tracker instruments.
Avoid abandoned memory by ensuring that the heap does not continue to grow when the same set of operations are continuously repeated. For example, opening a window then immediately closing it, or setting a preference then immediately unsetting it are operations that conceptually return the app to a previous and stable memory state. Cycling through such operations many times should not result in unbounded heap growth. To ensure that none of your code abandons memory, repeat user scenarios and use the Mark Heap feature after each iteration. After the first few iterations (where caches may be warmed), the persistent memory of these iterations should fall to zero. If persistent memory is still accumulating, select the focus arrow to see a call tree of the memory. There you can identify the code paths responsible for abandoning the memory. Ensure that your scenarios exercise all your code that allocates memory.

Thursday, August 30, 2012

thumbnail

Working with Visual Studio on a Mac


When I recently purchased a Macbook Pro, I had a couple of options to set up my .Net development environment on there. I could use a Virtual Machine based solution such asParallels or VMware Fusion, or run Windows natively using BootCamp. My first preference was to stay inside the Mac OS if possible. I spent some time researching which product other developers are having more success with and Fusion seemed to be  more stable and responsive for the majority of them. I downloaded the trial version from their website and took it for a spin, and have been really happy with it.
I have used both XP and Windows 7 in a VM with Fusion, and the performance has been pretty flawless. I allocate both processors, 40 GB of hard disk space and 2 GB of RAM to a VM. Some of my peers have long been advocating the advantages of developing using VMs, and now I totally get how cool this way of working is. I can create and restore snapshots at any point of time, create a new VM to try out any beta software, and keep my development environment isolated from softwares/utilities that it does not need (avoiding software bloat). I am using a Windows 7 VM right now for the most part and playing around with Visual Studio 2010 on it. I intially found the Unity feature in Fusion (it gives the illusion of running Windows apps natively on the Mac OS)  to be really cool, but I don't really use it much. I have dedicated a Space to my VMs, and tend to work in full screen mode.
If you end up going the same way as me, I would recommend looking at multiple vendors before purchasing Fusion. I bought if off Amazon, and it cost me $23.49 (including a $10 mail-in rebate). Other sites,including VMware, offer it for upto $80.

Monday, July 30, 2012

thumbnail

UP DOWN Animation with Different Speed Objective C

This Animation is look like Bio Breathing Animation, Upward and Downward with different speed.


.h file


//
//  Created by Nasrullah Mahar on 7/18/12.
//

#import

@interface BioBreathAnimationView  : UIViewController
{
    IBOutlet UIView *upView;
    IBOutlet UIView *downView;
    IBOutlet UIView *mainView;
    
    BOOL isAnimated;
    IBOutlet UILabel *inhaleLabel;
    IBOutlet UILabel *exhaleLabel;
    
    IBOutlet UISlider *inhaleSlider;
    IBOutlet UISlider *exhaleSlider;
    
    IBOutlet NSTimer *CallingTimer;
    
}


@property(nonatomic,retain) IBOutlet  UIView *upView;
@property(nonatomic,retain) IBOutlet  UIView *downView;
@property(nonatomic,retain) IBOutlet  UIView *mainView;

@property(nonatomic,retain) IBOutlet  NSTimer *CallingTimer;

@property(nonatomic,retain) IBOutlet  UISlider *inhaleSlider;
@property(nonatomic,retain) IBOutlet  UISlider *exhaleSlider;

@property (nonatomic, retain) IBOutlet UILabel *inhaleLabel;
-(IBAction)sliderInhaleChanged:(id)sender;

@property (nonatomic, retain) IBOutlet UILabel *exhaleLabel;

-(IBAction)sliderExhaleChanged:(id)sender;


@end


.m file




//  Created by Nasrullah Mahar on 7/18/12.


#import "BioBreathAnimationView.h"

@interface BioBreathAnimationView ()

@end

@implementation BioBreathAnimationView 

@synthesize inhaleLabel,exhaleLabel,inhaleSlider,exhaleSlider,upView,downView,mainView,CallingTimer;

float inhaleval=3.5,exhaleval=4.5;
float duration = 3.5;



-(IBAction)sliderInhaleChanged:(id)sender
{
    UISlider *slider = (UISlider *)sender;
    inhaleval = (float)(slider.value + 0.5f);
    int progressAsInt = (int)(slider.value + 0.5f);
    NSString *newText = [[NSString alloc] initWithFormat:@"%d", progressAsInt];
    inhaleLabel.text=newText;
    [newText release];
    
    duration = inhaleval;
    
    if (CallingTimer != nil) {
            [CallingTimer invalidate];
    }

    
  CallingTimer =  [[NSTimer scheduledTimerWithTimeInterval:duration target:self selector:@selector(ShowHide) userInfo:nil repeats:NO]retain];

   
}

-(IBAction)sliderExhaleChanged:(id)sender
{
    UISlider *slider = (UISlider *)sender;
    exhaleval = (float)(slider.value + 0.5f);
    int progressAsInt = (int)(slider.value + 0.5f);
    NSString *newText = [[NSString alloc] initWithFormat:@"%d", progressAsInt];
    exhaleLabel.text=newText;
    [newText release];
    
    duration = inhaleval;
    
    if (CallingTimer != nil) {
        [CallingTimer invalidate];
    }
    
   CallingTimer = [[NSTimer scheduledTimerWithTimeInterval:duration target:self selector:@selector(ShowHide) userInfo:nil repeats:NO]retain];

    
}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}




- (void)viewDidLoad
{
    //Load Automatically
    
    
    
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    isAnimated = NO;
    
    [NSTimer scheduledTimerWithTimeInterval:duration target:self selector:@selector(ShowHide) userInfo:nil repeats:NO];

}




-(void)ShowHide
{
    switch (isAnimated) {
        case YES: //it's show tableview
            
            self.upView.hidden   = NO;   // Blue
            self.downView.hidden = YES;
            [upView setFrame:CGRectMake(0.0, 0.0, 111.0, 218.0)];
            
            [UIView beginAnimations:nil context:NULL];
            [UIView setAnimationCurve:UIViewAnimationCurveLinear];
            [UIView setAnimationDuration:exhaleval];
            [upView setFrame:CGRectMake(0.0, 213.0, 111.0, 5.0)];
            [UIView commitAnimations];
            isAnimated = NO;
            duration = exhaleval;
            
            //duration = inhaleval;
            
            if (CallingTimer != nil) {
                [CallingTimer invalidate];
            }
            
            CallingTimer = [[NSTimer scheduledTimerWithTimeInterval:duration target:self selector:@selector(ShowHide) userInfo:nil repeats:NO]retain];
            
            break;
            
        case NO: //it's show mapview
            
            self.upView.hidden   = YES;
            self.downView.hidden = NO;
            [downView setFrame:CGRectMake(0.0, 213.0, 111.0, 5.0)];
            [UIView beginAnimations:nil context:NULL];
            [UIView setAnimationCurve:UIViewAnimationCurveLinear];
            [UIView setAnimationDuration:inhaleval];
            // [UIView setAnimationRepeatCount: 10000];
            // [UIView setAnimationRepeatAutoreverses: YES];
            [downView setFrame:CGRectMake(0.0, 0.0, 111.0, 218.0)];
            [UIView commitAnimations];
            isAnimated = YES;
            
            duration = inhaleval;
            
            //duration = inhaleval;
            
            if (CallingTimer != nil) {
                [CallingTimer invalidate];
            }
            
            CallingTimer = [[NSTimer scheduledTimerWithTimeInterval:duration target:self selector:@selector(ShowHide) userInfo:nil repeats:NO]retain];
            
            break;
            
        default:
            break;
            
           
    }
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}



@end

xib file




Sunday, July 22, 2012

thumbnail

Navigating back & forward in a UINavigationController causes crash

I think this may have something to do with memory managment. Instead of using viewController as a local variable, set it up as a property and get rid of the release.

@property(nonatomic, retain) UIViewController *viewController;
synth the getters and setters (in the .m file)

@synthesize viewcontroller;
and use the dot syntax to access it.

self.viewController
This will release the old controller if one exist and ensure that the object is still around when the Nav Controller needs it to be.
thumbnail

Shortcut Keys for Ms.Word


Command Name                  Shortcut Keys
   ------------------------------------------------------------------------
 
   All Caps                      CTRL+SHIFT+A
   Annotation                    ALT+CTRL+M
   App Maximize                  ALT+F10
   App Restore                   ALT+F5
   Apply Heading1                ALT+CTRL+1
   Apply Heading2                ALT+CTRL+2
   Apply Heading3                ALT+CTRL+3
   Apply List Bullet             CTRL+SHIFT+L
   Auto Format                   ALT+CTRL+K
   Auto Text                     F3 or ALT+CTRL+V
   Bold                          CTRL+B or CTRL+SHIFT+B
   Bookmark                      CTRL+SHIFT+F5
   Browse Next                   CTRL+PAGE DOWN
   Browse Previous               CTRL+PAGE UP
   Browse Sel                    ALT+CTRL+HOME
   Cancel                        ESC
   Center Para                   CTRL+E
   Change Case                   SHIFT+F3
   Char Left                     LEFT
   Char Left Extend              SHIFT+LEFT
   Char Right                    RIGHT
   Char Right Extend             SHIFT+RIGHT
   Clear                         DELETE
   Close or Exit                 ALT+F4
   Close Pane                    ALT+SHIFT+C
   Column Break                  CTRL+SHIFT+ENTER
   Column Select                 CTRL+SHIFT+F8
   Copy                          CTRL+C or CTRL+INSERT
   Copy Format                   CTRL+SHIFT+C
   Copy Text                     SHIFT+F2
   Create Auto Text              ALT+F3
   Customize Add Menu            ALT+CTRL+=
   Customize Keyboard            ALT+CTRL+NUM +
   Customize Remove Menu         ALT+CTRL+-
   Cut                           CTRL+X or SHIFT+DELETE
   Date Field                    ALT+SHIFT+D
   Delete Back Word              CTRL+BACKSPACE
   Delete Word                   CTRL+DELETE
   Dictionary                    ALT+SHIFT+F7
   Do Field Click                ALT+SHIFT+F9
   Doc Close                     CTRL+W or CTRL+F4
   Doc Maximize                  CTRL+F10
   Doc Move                      CTRL+F7
   Doc Restore                   CTRL+F5
   Doc Size                      CTRL+F8
   Doc Split                     ALT+CTRL+S
   Double Underline              CTRL+SHIFT+D
   End of Column                 ALT+PAGE DOWN
   End of Column                 ALT+SHIFT+PAGE DOWN
   End of Doc Extend             CTRL+SHIFT+END
   End of Document               CTRL+END
   End of Line                   END
   End of Line Extend            SHIFT+END
   End of Row                    ALT+END
   End of Row                    ALT+SHIFT+END
   End of Window                 ALT+CTRL+PAGE DOWN
   End of Window Extend          ALT+CTRL+SHIFT+PAGE DOWN
   Endnote Now                   ALT+CTRL+D
   Extend Selection              F8
   Field Chars                   CTRL+F9
   Field Codes                   ALT+F9
   Find                          CTRL+F
   Font                          CTRL+D or CTRL+SHIFT+F
   Font Size Select              CTRL+SHIFT+P
   Footnote Now                  ALT+CTRL+F
   Go Back                       SHIFT+F5 or ALT+CTRL+Z
   Go To                         CTRL+G or F5
   Grow Font                     CTRL+SHIFT+.
   Grow Font One Point           CTRL+]
   Hanging Indent                CTRL+T
   Header Footer Link            ALT+SHIFT+R
   Help                          F1
   Hidden                        CTRL+SHIFT+H
   Hyperlink                     CTRL+K
   Indent                        CTRL+M
   Italic                        CTRL+I or CTRL+SHIFT+I
   Justify Para                  CTRL+J
   Left Para                     CTRL+L
   Line Down                     DOWN
   Line Down Extend              SHIFT+DOWN
   Line Up                       UP
   Line Up Extend                SHIFT+UP
   List Num Field                ALT+CTRL+L
   Lock Fields                   CTRL+3 or CTRL+F11
   Macro                         ALT+F8
   Mail Merge Check              ALT+SHIFT+K
   Mail Merge Edit Data Source   ALT+SHIFT+E
   Mail Merge to Doc             ALT+SHIFT+N
   Mail Merge to Printer         ALT+SHIFT+M
   Mark Citation                 ALT+SHIFT+I
   Mark Index Entry              ALT+SHIFT+X
   Mark Table of Contents Entry  ALT+SHIFT+O
   Menu Mode                     F10
   Merge Field                   ALT+SHIFT+F
   Microsoft Script Editor       ALT+SHIFT+F11
   Microsoft System Info         ALT+CTRL+F1
   Move Text                     F2
   New                           CTRL+N
   Next Cell                     TAB
   Next Field                    F11 or ALT+F1
   Next Misspelling              ALT+F7
   Next Object                   ALT+DOWN
   Next Window                   CTRL+F6 or ALT+F6
   Normal                        ALT+CTRL+N
   Normal Style                  CTRL+SHIFT+N or ALT+SHIFT+CLEAR (NUM 5)
   Open                          CTRL+O or CTRL+F12 or ALT+CTRL+F2
   Open or Close Up Para         CTRL+0
   Other Pane                    F6 or SHIFT+F6
   Outline                       ALT+CTRL+O
   Outline Collapse              ALT+SHIFT+- or ALT+SHIFT+NUM -
   Outline Demote                ALT+SHIFT+RIGHT
   Outline Expand                ALT+SHIFT+=
   Outline Expand                ALT+SHIFT+NUM +
   Outline Move Down             ALT+SHIFT+DOWN
   Outline Move Up               ALT+SHIFT+UP
   Outline Promote               ALT+SHIFT+LEFT
   Outline Show First Line       ALT+SHIFT+L
   Overtype                      INSERT
   Page                          ALT+CTRL+P
   Page Break                    CTRL+ENTER
   Page Down                     PAGE DOWN
   Page Down Extend              SHIFT+PAGE DOWN
   Page Field                    ALT+SHIFT+P
   Page Up                       PAGE UP
   Page Up Extend                SHIFT+PAGE UP
   Para Down                     CTRL+DOWN
   Para Down Extend              CTRL+SHIFT+DOWN
   Para Up                       CTRL+UP
   Para Up Extend                CTRL+SHIFT+UP
   Paste                         CTRL+V or SHIFT+INSERT
   Paste Format                  CTRL+SHIFT+V
   Prev Cell                     SHIFT+TAB
   Prev Field                    SHIFT+F11 or ALT+SHIFT+F1
   Prev Object                   ALT+UP
   Prev Window                   CTRL+SHIFT+F6 or ALT+SHIFT+F6
   Print                         CTRL+P or CTRL+SHIFT+F12
   Print Preview                 CTRL+F2 or ALT+CTRL+I
   Proofing                      F7
   Redo                          ALT+SHIFT+BACKSPACE
   Redo or Repeat                CTRL+Y or F4 or ALT+ENTER
   Repeat Find                   SHIFT+F4 or ALT+CTRL+Y
   Replace                       CTRL+H
   Reset Char                    CTRL+SPACE or CTRL+SHIFT+Z
   Reset Para                    CTRL+Q
   Revision Marks Toggle         CTRL+SHIFT+E
   Right Para                    CTRL+R
   Save                          CTRL+S or SHIFT+F12 or ALT+SHIFT+F2
   Save As                       F12
   Select All                    CTRL+A or CTRL+CLEAR (NUM 5) or CTRL+NUM 5
   Select Table                  ALT+CLEAR (NUM 5)
   Show All                      CTRL+SHIFT+8
   Show All Headings             ALT+SHIFT+A
   Show Heading1                 ALT+SHIFT+1
   Show Heading2                 ALT+SHIFT+2
   Show Heading3                 ALT+SHIFT+3
   Show Heading4                 ALT+SHIFT+4
   Show Heading5                 ALT+SHIFT+5
   Show Heading6                 ALT+SHIFT+6
   Show Heading7                 ALT+SHIFT+7
   Show Heading8                 ALT+SHIFT+8
   Show Heading9                 ALT+SHIFT+9
   Shrink Font                   CTRL+SHIFT+,
   Shrink Font One Point         CTRL+[
   Small Caps                    CTRL+SHIFT+K
   Space Para1                   CTRL+1
   Space Para15                  CTRL+5
   Space Para2                   CTRL+2
   Spike                         CTRL+SHIFT+F3 or CTRL+F3
   Start of Column               ALT+PAGE UP
   Start of Column               ALT+SHIFT+PAGE UP
   Start of Doc Extend           CTRL+SHIFT+HOME
   Start of Document             CTRL+HOME
   Start of Line                 HOME
   Start of Line Extend          SHIFT+HOME
   Start of Row                  ALT+HOME
   Start of Row                  ALT+SHIFT+HOME
   Start of Window               ALT+CTRL+PAGE UP
   Start of Window Extend        ALT+CTRL+SHIFT+PAGE UP
   Style                         CTRL+SHIFT+S
   Subscript                     CTRL+=
   Superscript                   CTRL+SHIFT+=
   Symbol Font                   CTRL+SHIFT+Q
   Thesaurus                     SHIFT+F7
   Time Field                    ALT+SHIFT+T
   Toggle Field Display          SHIFT+F9
   Toggle Master Subdocs         CTRL+\
   Tool                          SHIFT+F1
   Un Hang                       CTRL+SHIFT+T
   Un Indent                     CTRL+SHIFT+M
   Underline                     CTRL+U or CTRL+SHIFT+U
   Undo                          CTRL+Z or ALT+BACKSPACE
   Unlink Fields                 CTRL+6 or CTRL+SHIFT+F9
   Unlock Fields                 CTRL+4 or CTRL+SHIFT+F11
   Update Auto Format            ALT+CTRL+U
   Update Fields                 F9 or ALT+SHIFT+U
   Update Source                 CTRL+SHIFT+F7
   VBCode                        ALT+F11
   Web Go Back                   ALT+LEFT
   Web Go Forward                ALT+RIGHT
   Word Left                     CTRL+LEFT
   Word Left Extend              CTRL+SHIFT+LEFT
   Word Right                    CTRL+RIGHT
   Word Right Extend             CTRL+SHIFT+RIGHT
   Word Underline                CTRL+SHIFT+W

About me

simple one.