This file contains 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
1. Do binary search on a rotated array. | |
Eg., given [100, 110, 121, 5, 11, 44, 78, 91, 99], be able to binary search on it. | |
2. Implement the * and / operations without actual multiplication and division. | |
3. Implement the ^ operator without using any in-build exponentiation methods. | |
4. Implement the median of an unsorted array in O(n). | |
5. Implement sqrt() |
This file contains 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
* Select Image View Mode for Image Resizing if its bigger than the screen. | |
* Delegate - Add callbacks somewhere else when something changes. | |
* protocol and interface are synonyms in objc. | |
Delegate Pattern | |
* Can use delegate instead of passing around controllers. | |
* Mark protocol methods as @optional if you dont need them. | |
* Check this via respondsToSelector method. | |
* KVO |
This file contains 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
If you delete the default Storyboard etc., put this in the AppDelegate.m | |
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
When setting things like images in cells, reuse the cells. For some reason, if you allocate a fresh cell, it doesn't work. | |
Pass data between controllers, rather than views, or modifying the view of the next controller. |
This file contains 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
pttrns.com => For patterns. | |
Reference Counting (arc). | |
@ for NSLiteral, so that "" doesn't mean C-string. | |
Set tableView delegate and dataSource = self. | |
Set numberOfRowsInSection | |
Set cell | |
This file contains 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> | |
#include <cstring> | |
// This is a toy program, so please excuse the trivial flaws. | |
#define MAXN 2000 | |
#define MAXC 20 | |
// An N*C array, hard-coding the max N = 2000, C = 20. | |
int r[MAXN][MAXC]; | |
int cval[MAXC]; | |
int N, C; |
This file contains 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
import java.util.Random; | |
class FooThread extends Thread { | |
int threadNum; | |
Random random; | |
FooThread(int threadNum) { | |
this.threadNum = threadNum; | |
this.random = new Random(System.currentTimeMillis() + threadNum); | |
} |
This file contains 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
_________________________________________ | |
/ Walter White: If you don’t know who I \ | |
| am, maybe your best course would be to | | |
\ tread lightly. / | |
----------------------------------------- | |
\ ^__^ | |
\ (oo)\_______ | |
(__)\ )\/\ | |
||----w | | |
|| || |
This file contains 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
curl -s http://randquotes.com/qt?f=cowsay |
This file contains 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
export PS1="\n\[$(tput bold)\]\033[38;5;132m\\u\033[39m \[$(tput sgr0)\]at \033[38;5;180m\h \033[39m\\[$(tput sgr0)\][\033[38;5;191m\\W\033[39m]\n\[\033[38;5;208m\]>\[\033[39m\] " |
This file contains 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
gauravmenghani at localhost [~] | |
> curl -s http://andazapnapna.com/quote | cowsay | |
______________________________________ | |
/ "Jab koi bachcha nahin sota, to uski \ | |
| maa kehti hai ki... soja soja soja | | |
\ nahin toh Gogo aa jayega." / | |
-------------------------------------- | |
\ ^__^ | |
\ (oo)\_______ | |
(__)\ )\/\ |