Or you can simply use - (NSEnumerator *)reverseObjectEnumerator from the NSArray class.
NSArray *sortedArray = [....]
NSArray *reversedArray = [[sortedArray reverseObjectEnumerator] allObjects];
NSArray *sortedArray = [....]
NSArray *reversedArray = [[sortedArray reverseObjectEnumerator] allObjects];
* "Every nation gets the government it deserves." ~ Joseph de Maistre
- Stop complaining about the government* and banks**. Get your own ass up! Take responsibility for yourself and the world around you.
- Learn proper English. English is the world's collective language (at least for now). Doesn't matter if you like it or not. That's just the way it is. Adapt to it or fall behind.
- Learn something that actually matters and practice it.
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.title = @"My title";
}
-(void)viewWillDisappear:(BOOL)animated
{
self.title = nil;
[super viewWillDisappear:animated];
}This way iOS will automatically set the title to "Back" or to the equivalent for whatever language is configured for the device.if (FBSession.activeSession.isOpen) {Also, don't forget to ask for the email permission when opening the FB session:
[[FBRequest requestForMe] startWithCompletionHandler:^(FBRequestConnection *connection, NSDictionary*user, NSError *error) {
if (!error) {
self.nameLabel.text = user.name;
self.emailLabel.text = [user objectForKey:@"email"];
}
}];
}
NSArray *permissions = [[NSArray alloc] initWithObjects:@"email", nil];Source: stackoverflow.com
[FBSession sessionOpenWithPermissions:permissions completionHandler:
^(FBSession *session, FBSessionState state, NSError *error) {
[self facebookSessionStateChanged:session state:state error:error];
}];
NSString *url = @"mobilejazz.cat";// Open with Google Chrome if possibleif ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"googlechrome:"]]) {[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"googlechrome://%@", url]]];} else {[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@", url]]];}
50% increase in quantity = 150% = 1.5For those who still don't get it, we can also look at it the other way around:
33% discount = 67% = 0.67
1 / 1.5 = 0.67 and thus 1 / 0.67 = 1.5
150% * (1-0.33) = 100%and a 50% increase on something that is 67% also results in 100%
67% * (1+0.50) = 100%
100% * (1-0.20) * (1-0.25) = 60% which is obviously a 40% discountNote: values have been rounded to make them easier readable. If you perform the calculations yourself and you want precise results, use fractions instead of percentages, e.g. 1/3 instead of 33%.

“I observed something fairly early on at Apple, which I didn’t know how to explain then, but have thought a lot about it since. Most things in life have a dynamic range in which average to best is at most 2:1. For example if you go to New York City and get an average taxi cab driver versus the best taxi cab driver, you’ll probably get to your destination with the best taxi driver 30% faster. And an automobile; What’s the difference between the average car and the best? Maybe 20% ? The best CD player versus the average CD player? Maybe 20% ? So 2:1 is a big dynamic range for most things in life. Now, in software, and it used ot be the case in hardware, the difference between the average software developer and the best is 50:1; Maybe even 100:1. Very few things in life are like this, but what I was lucky enough to spend my life doing, which is software, is like this. So I’ve built a lot of my success on finding these truly gifted people, and not settling for ‘B’ and ‘C’ players, but really going for the ‘A’ players. And I found something… I found that when you get enough ‘A’ players together; when you go through the incredible work to find these ‘A’ players, they really like working with each other. Because most have never had the chance to do that before. And they dont work with ‘B’ and ‘C’ players, so its self policing. They only want to hire ‘A’ players. So you build these pockets of ‘A’ players and it just propagates.”~ Steve Jobs in Steve Jobs - The Lost Interview
"I divide my officers into four groups. There are clever, diligent, stupid, and lazy officers. Usually two characteristics are combined. Some are clever and diligent -- their place is the General Staff. The next lot are stupid and lazy -- they make up 90 percent of every army and are suited to routine duties. Anyone who is both clever and lazy is qualified for the highest leadership duties, because he possesses the intellectual clarity and the composure necessary for difficult decisions. One must beware of anyone who is stupid and diligent -- he must not be entrusted with any responsibility because he will always cause only mischief."~ Kurt von Hammerstein-Equord (German General)
sk@supernova:~/ > source ~/.zshrcor, even shorter:
sk@supernova:~/ > . ~/.zshrc
enum Cardsuit { CLUBS, DIAMONDS, SPADES, HEARTS };That is pretty basic and probably everyone learned that in Java 101. What was new to me, though, is that you can customize the enum { } pretty much like a class.
if ( Cardsuit.CLUBS.compareToString(xmlString) ) { .... }Of course there would have been many other ways to do this, but this solution seems quite clean and elegant to me.
Name of the file signaling the media scanner to ignore media in the containing directory and its subdirectories. Developers should use this to avoid application graphics showing up in the Gallery and likewise prevent application sounds and music from showing up in the Music app.
nc -lk $ip $port
sk@supernova:~/ > nc -lk 0.0.0.0 8080
POST /rpc HTTP/1.1
Accept: application/json
Content-type: application/json
Accept-Encoding: gzip
Host: 192.168.2.3
Content-Length: 152
Connection: Keep-Alive
{"id":3,"jsonrpc":"2.0","method":"sendTestMessage","params":{"clientVersion":"0.11.4-debug","user":"sk@geekmind.net","imei":"32420214181983746","message":"This is a test message :-)"}}
curl -v -i -X POST -d $data $uri
sk@supernova:~/ > curl -v -i -X POST -d '{"id":1,"jsonrpc":"2.0","method":"sendTestMessage","params":{"clientVersion":"0.11.4-debug","user":"sk@geekmind.net","imei":"1111111111111111111"}}' http://android.geekmind.net/rpc
* About to connect() to android.geekmind.net port 80 (#0)
* Trying 74.125.43.121... connected
* Connected to android.geekmind.net (74.125.43.121) port 80 (#0)
> POST /rpc HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
> Host: android.geekmind.net
> Accept: */*
> Content-Length: 157
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Content-Type: text/html; charset=utf-8
Content-Type: text/html; charset=utf-8
< Cache-Control: no-cache
Cache-Control: no-cache
< Expires: Fri, 01 Jan 1990 00:00:00 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
< Date: Fri, 08 Apr 2011 09:19:32 GMT
Date: Fri, 08 Apr 2011 09:19:32 GMT
< Server: Google Frontend
Server: Google Frontend
< Transfer-Encoding: chunked
Transfer-Encoding: chunked
<
* Connection #0 to host android.geekmind.net left intact
* Closing connection #0
{"jsonrpc": "2.0", "id": 1, "error": "1", "message": "ERROR: user and IMEI do not match!"}}
| Shortcut | Action |
|---|---|
CTRL + A | Move to the beginning of the line |
CTRL + E | Move to the end of the line |
CTRL + [left arrow] | Move one word backward (on some systems this is ALT + B) |
CTRL + [right arrow] | Move one word forward (on some systems this is ALT + F) |
CTRL + U (bash) | Clear the characters on the line before the current cursor position |
CTRL + U (zsh) | If you're using the zsh, this will clear the entire line |
CTRL + K | Clear the characters on the line after the current cursor position |
ESC + [backspace] | Delete the word in front of the cursor |
CTRL + W | Delete the word in front of the cursor |
ALT + D | Delete the word after the cursor |
CTRL + R | Search history |
CTRL + G | Escape from search mode |
CTRL + _ | Undo the last change |
CTRL + L | Clear screen |
CTRL + S | Stop output to screen |
CTRL + Q | Re-enable screen output |
CTRL + C | Terminate/kill current foreground process |
CTRL + Z | Suspend/stop current foreground process |
| Command | Action |
|---|---|
!! | Execute last command in history |
!abc | Execute last command in history beginning with abc |
!abc:p | Print last command in history beginning with abc |
CTRL + R to search through the history. Continue pressing CTRL + R until you find the entry you're looking for. Press [ENTER] to execute the current expression. Press [Right Arrow] to modify the current expression. Press CTRL + G to escape from search mode.Terminal -> Preferences -> Settings -> KeyboardALT or OPTION key, select use option as meta keyCTRL + [left arrow] and CTRL + [right arrow] shortcuts, selectcontrol cursor left and set it to \033b andcontrol cursor right and set it to \033f.