use Underline in wild card charecter of Like query gives wrong result

●Question
Why the SQL execution always return the wrong result when i use 'underline' ?
select  * 
from  user
where  userid like 'Karen_Chang%'  

●Solution
Use brackets! []
select  * 
from  user
where  userid like 'Karen[_]Chang%'

break label usage in Objective-C and Java

if you have nested for loop or the for loop need to be break in special condition
use 'break label' can satisfy your demand

●Java
myForLoop: {
    for (; ; ;) {
if(someCondition == True)
            break myForLoop;
    }
}

Objective-C
for (;;)
{
    for (;;)
    {
        break; /* breaks inner loop */
    }
    for (;;)
    {
        goto myForLoop; /* breaks outer loop */
    }
}
myForLoop:;

Swipe to delete UITableViewCell

●iOS (2.0 and later)
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        [self.myData removeObjectAtIndex:indexPath.row];
        [tableView reloadData];
    }
}

iOS (8.0 and later)
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}

- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
        [self.myData removeObjectAtIndex:indexPath.row];
        [tableView reloadData];
    deleteAction.backgroundColor = [UIColor redColor];
    return @[deleteAction];
}

But swipe to delete doesn't work at iOS8 
It's Apple's Bug!!!

How to solve?
add the old method 'commitEditingStyle' as below
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
}

Although the Objective-C has the description about the commitEditingStyle as following, iOS 8 is still not working without this method T__T
// After a row has the minus or plus button invoked (based on the UITableViewCellEditingStyle for the cell), the dataSource must commit the change
// Not called for edit actions using UITableViewRowAction - the action's handler will be invoked instead
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath;

How to use NSDefault

Primitive Object
// Get
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString* userId = [defaults objectForKey:@"UserId"];
[defaults synchronize];

// Set
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:userId forKey:@"UserId"];
[defaults synchronize];

// Clear
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults removeObjectForKey:@"UserId"];
[defaults synchronize];

Custom Object
// Get
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSData *formData = [defaults objectForKey:@"CustomObject"];
MyCustomData *data=[NSKeyedUnarchiver unarchiveObjectWithData:data];
[defaults synchronize];

// Set
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:myCustomObject];
[defaults setObject:data forKey:@"CustomObject"];
[defaults synchronize];

// Clear
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults removeObjectForKey:@"CustomObject"];
[defaults synchronize];