Using insert rows in a UITableView

I was missing one thing. In setEditing:, instead of calling reloadData I should have done: – (void)setEditing:(BOOL)editing animated:(BOOL)animated { [super setEditing:editing animated:animated]; [self.tableView setEditing:editing animated:animated]; // not needed if super is a UITableViewController NSMutableArray* paths = [[NSMutableArray alloc] init]; // fill paths of insertion rows here if( editing ) [self.tableView insertRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationBottom]; else [self.tableView deleteRowsAtIndexPaths:paths … Read more

Detect Start and Stop Editing UITextView

http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextViewDelegate_Protocol/Reference/UITextViewDelegate.html#//apple_ref/occ/intf/UITextViewDelegate Here you can find several useful methods to investigate: textViewDidBeginEditing: textViewDidEndEditing: Moreover to leave UITextView you often should implement action that calls [yourTextView resignFirstResponder]; Objective-C example //you may specify UITextViewDelegate protocol in .h file interface, but it’s better not to expose it if not necessary @interface ExampleViewController()<UITextViewDelegate> @end @implementation ExampleViewController – (void)viewDidLoad { [super … Read more

how to edit a file in powershell remoting session (powershell)

If you are using Powershell 5, you can use command called PSEdit. It only works from ISE. So first, open PowerShell ISE Then open remote session to the remote computer using Enter-PSSession Then edit the file using PsEdit ‘filename’ The remote file will be opened in a new tab in your (local) ISE window. Actually … Read more

How does Google Docs deal with editing collisions?

There are different possibilities for realizing concurrent changing of replicas, depending on the scenario’s topology and with different trade-offs. Using a central server The most common scenario is a central server that all clients have to communicate with. The server could keep track of how the document of each participant looks. Both A and B … Read more

Commenting out a set of lines in a shell script

The most versatile and safe method is putting the comment into a void quoted here-document, like this: <<“COMMENT” This long comment text includes ${parameter:=expansion} `command substitution` and $((arithmetic++ + –expansion)). COMMENT Quoting the COMMENT delimiter above is necessary to prevent parameter expansion, command substitution and arithmetic expansion, which would happen otherwise, as Bash manual states … Read more

How to prevent Sublime Text 2 from swallowing closing brackets, quotes and parentheses?

add this to your user keybindings file { “keys”: [“)”], “command”: “insert”, “args”: {“characters”: “)”}, “context”: [ { “key”: “setting.auto_match_enabled”, “operator”: “equal”, “operand”: true }, { “key”: “selection_empty”, “operator”: “equal”, “operand”: true, “match_all”: true }, { “key”: “following_text”, “operator”: “regex_contains”, “operand”: “^\\)”, “match_all”: true } ] } it will override the one keybinding that instead … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)