This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// UIApplication.h | |
UIApplicationDidEnterBackgroundNotification __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0); | |
UIApplicationWillEnterForegroundNotification __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0); | |
UIApplicationDidFinishLaunchingNotification; | |
UIApplicationDidBecomeActiveNotification; | |
UIApplicationWillResignActiveNotification; | |
UIApplicationDidReceiveMemoryWarningNotification; | |
UIApplicationWillTerminateNotification; | |
UIApplicationSignificantTimeChangeNotification; | |
UIApplicationWillChangeStatusBarOrientationNotification; // userInfo contains NSNumber with new orientation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main (int argc, char * const argv[]) { | |
int i = 6; | |
std::cout << i++ << std::endl; | |
int j = i++; | |
std::cout << j << std::endl; | |
int p = 7; | |
std::cout << ++p << std::endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main (int argc, char * const argv[]) { | |
int i = 1; | |
int j = i << 4; | |
std::cout << j << std::endl; | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main (int argc, char * const argv[]) { | |
int i = 5; | |
int *p = &i; | |
++*p; | |
std::cout << i << std::endl; | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main (int argc, char * const argv[]) { | |
int a[] = {3,2,1,0}; | |
int *pa = a; | |
std::cout << pa++ << std::endl; | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Stack { | |
private Object[] elements; | |
private int size = 0; | |
public Stack(int initialCapacity) { | |
this.elements = new Object[initialCapacity]; | |
} | |
public void push(Object e) { | |
ensureCapacity(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define myIndexPath [NSIndexPath indexPathForRow:2 inSection:1] | |
NSAssert(myIndexPath == [NSIndexPath indexPathForRow:2 inSection:1], @"they should be the same object"); | |
// omitted code from UITableView -cellForRowAtIndexPath: | |
if (myIndexPath == systemIndexPath){ | |
// my cell, show my contents | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wc -l `find . -type f \( -name "*.h" -or -name "*.m" \)` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f \( -name '*.xib' -or -name "*.h" -or -name "*.m" \) -exec awk '{print NR}' {} +|tail -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOTE: all the color mark must be surrounded with \[\] to avoid a wrong line wrapping calculation. | |
export PS1="\[\e[35;40m\]\u\[\e[0m\]@\[\e[36;40m\]\h\[\e[0m\]:\[\e[37;40m\]\W\[\e[0m\] \t \[\e[36;40m\](\j) <\!>\[\e[0m\]\n\[\e[35;40m\]\$\[\e[0m\] " |