- Go to http://maps.google.com
- Click the Help button (white question mark in a blue circle) at the bottom.
- Click Return to classic Google Maps.
- Click Yes in the notification bar that appears.
- On the landing page that appears, follow the instructions to opt out permanently.
- Any feedback you could provide as to why you wanted to opt out will be valuable in improving the product for you in the future.
Saturday, December 7, 2013
Completely turn off new Google Maps and go back to old one
Saturday, November 23, 2013
Customizing NSLog
Customizing NSLog:
================
Search for “preprocessing” and locate the section titled “Preprocessor Macros”. Next, simply add “DEBUG=1″ to the Debug section.
ExtendNSLogFunctionality.h
-----------------------------------
#import
#ifdef DEBUG
#define NSLog(args...) ExtendNSLog(__FILE__,__LINE__,__PRETTY_FUNCTION__,args);
#else
#define NSLog(x...)
#endif
void ExtendNSLog(const char *file, int lineNumber, const char *functionName, NSString *format, ...);
ExtendNSLogFunctionality.m
-----------------------------------
#import "ExtendNSLogFunctionality.h"
void ExtendNSLog(const char *file, int lineNumber, const char *functionName, NSString *format, ...)
{
// Type to hold information about variable arguments.
va_list ap;
// Initialize a variable argument list.
va_start (ap, format);
// NSLog only adds a newline to the end of the NSLog format if
// one is not already there.
// Here we are utilizing this feature of NSLog()
if (![format hasSuffix: @"\n"])
{
format = [format stringByAppendingString: @"\n"];
}
NSString *body = [[NSString alloc] initWithFormat:format arguments:ap];
// End using variable argument list.
va_end (ap);
NSString *fileName = [[NSString stringWithUTF8String:file] lastPathComponent];
fprintf(stderr, "(%s) (%s:%d) %s",
functionName, [fileName UTF8String],
lineNumber, [body UTF8String]);
}
Prefix.pch
-----------
#ifdef __OBJC__
#import
#import
#import "ExtendNSLogFunctionality.h"
#endif
Example:
========
int result = 20;
NSLog(@"Value of result : %d", result);
([AppDelegate application:didFinishLaunchingWithOptions:]) (AppDelegate.m:21) Value of result : 20
Saturday, November 16, 2013
Foods That Strengthen Bone Marrow
Bone marrow is tissue found inside your bones producing your blood
cells. Strong, healthy bone marrow requires foods rich in vitamins and
minerals.
Foods rich in iron can help bone marrow function more
effectively. The body only absorbs approximately 1 milligram of the 10
to 20 milligrams consumed, according to University of Maryland Medical
Center. Thirty percent of your iron is stored in your bone marrow,
spleen or liver. Most of the iron absorbed is used by the bone marrow
for erythropoiesis, a process producing new red blood cells. Foods rich
in iron include red meats, shellfish, cabbage, lima beans and
iron-fortified cereals and bread. Also, consume foods rich in vitamin C
to aid in the absorption of iron. Vitamin C sources include citrus
fruits like oranges, grapefruit and tangerines.
Folic acid, a B vitamin, aids in platelet functioning and
DNA synthesis, a vital step in cell reproduction. In the absence of
proper synthesis of DNA, healthy division of your bone marrow cells does
not occur. Division of bone marrow cells aids in the development of
mature blood cells like platelets. Folic acid deficiencies cause
atypical platelet growth. Foods rich in folic acid include liver, egg
yolk, beans, almonds, sweet potato, wholegrain bread, spinach, cabbage,
oranges and peaches.
Vitamin B12 is essential for the production of healthy bone
marrow. Folic acid and vitamin B12 work together during hematopoiesis,
the manufacturing of bone marrow blood cells. For these red blood cells
to develop in the bone marrow, vitamin B12 activates enzymes and
regulates DNA synthesis. Food sources of vitamin B12 include liver, egg
yolk, cheese, red meat, fish, cabbage, spinach and kale.
Dairy products high in calcium and phosphorus include:
Additional foods with significant amounts of phosphorus:
Potassium is an electrolyte (mineral) that maintains normal fluid balance, supports cell integrity, facilitates the making of protein, assists in the transmission of nerve impulses, and the contraction of the heart and other muscles.
Fruit sources of potassium include:
Significant sources of magnesium include:
Iron
Folic Acid
Vitamin B12
Vitamin A
Foods rich in vitamin A help regulate proteins generated in your cells, which aids in cellular development. Vitamin A is particularly known to promote stem cell maturation in your bone marrow. When vitamin A is deficient in your body, typical blood cell growth is halted, as reported by the Linus Pauling Institute. Strengthen your bone marrow and cells by ingesting vitamin A-rich foods. These foods include carrots, sweet potatoes, cantaloupe, pumpkin, cod liver oil and eggs.Calcium and Phosphorus
Some of your medicines might deplete calcium, which is important for maintaining bone strength. When the staff reviews your medications and labs, they will inform you if this is likely to be a problem. Phosphorus is a mineral that helps to strengthen bones. Some bone marrow transplant patients often need additional phosphorus. Unless you are following a special diet, we recommended you eat a diet high in calcium and phosphorus.Dairy products high in calcium and phosphorus include:
- Creamer (pasteurized)
- Milk (skim, low-fat, whole)
- Natural cheese, processed cheese (pre-packaged)
- Cottage cheese, ricotta cheese
- Yogurt (regular or frozen)
- Pudding, custard
- Ice cream or ice milk
- Cream soup
- Buttermilk
- Evaporated milk
- Powdered milk
- Calcium-enriched fruit juice
- Roasted almonds
- Dried peas and beans (cooked thoroughly)*
- Tofu (calcium enriched, cooked thoroughly)
- Greens (kale,collard, mustard, turnip*)
- Canned salmon with soft bones
- Broccoli*
- Bok choy
- Spinach
- Mackerel
- Sardines*
- Shrimp
Additional foods with significant amounts of phosphorus:
- Brussels sprouts
- Peanut butter
- Beef and Chicken livers
- Whole grain breads
- Coconut
- Chocolate
- Avocados
- Chick peas
- Nuts
- Mushrooms
- Artichokes
- Tropicana Fruit Punch®
- Hawaiian Punch®
- Tropicana Peach Papaya®
- Tropicana Strawberry Melon®
- Fruitworks -- all varieties except pink lemonade
- Cool Iced Tea -- all varieties except lemonade iced tea
Potassium and magnesium
Antibiotics, diarrhea, and vomiting can cause electrolyte (mineral) imbalances. Even after your hospital discharge, it is common to require potassium and magnesium supplementation, which can be given by pill or intravenous infusion.Potassium is an electrolyte (mineral) that maintains normal fluid balance, supports cell integrity, facilitates the making of protein, assists in the transmission of nerve impulses, and the contraction of the heart and other muscles.
Fruit sources of potassium include:
- Apricots
- Avocados
- Bananas
- Dates, figs
- Honeydew/cantaloupe
- Oranges
- Peaches
- Prunes
- Raisins
- Artichokes
- Bamboo shoots
- Beans
- Beets
- Chard
- Chick peas
- Escarole
- Leeks
- Mushrooms
- Spinach
- Squash
- Tomatoes
- White potatoes, sweet potatoes
Significant sources of magnesium include:
- Legumes
- Leafy green vegetables
- Nuts
- Milk
- Whole grain cereals
- Chocolate
- Meat
Thursday, November 14, 2013
What is Hadoop ?
Hadoop is an open-source, Java-based implementation of Google's MapReduce framework. Hadoop is designed for any application which can take advantage of massively parallel distributed-processing, particularly with clusters composed of unreliable hardware.
For example, suppose you have 10 terabytes of data, and you want to process it somehow, (suppose you need to sort it). Using a single computer, this could take a very long time. Traditionally, a high-end super-computer with exotic hardware would be required to do this in a reasonable amount of time.
Hadoop provides a framework to process data of this size using a computing cluster made from normal, commodity hardware. There are two major components to Hadoop: the file system, which is a distributed file system that splits up large files onto multiple computers, and the MapReduce framework, which is an application framework used to process large data stored on the file system.
Of course, there are many distributed computing frameworks, but what is particularly notable about Hadoop (and Google's MapReduce) is the built-in fault tolerance. It is designed to run on commodity hardware, and therefore it expects computers to be breaking frequently. The underlying file system is highly-redundant (blocks of data are replicated across multiple computers) and the MapReduce processing framework automatically handles computer failures which occur during a processing job by reassigning the processing to another computer in the cluster.
For example, suppose you have 10 terabytes of data, and you want to process it somehow, (suppose you need to sort it). Using a single computer, this could take a very long time. Traditionally, a high-end super-computer with exotic hardware would be required to do this in a reasonable amount of time.
Hadoop provides a framework to process data of this size using a computing cluster made from normal, commodity hardware. There are two major components to Hadoop: the file system, which is a distributed file system that splits up large files onto multiple computers, and the MapReduce framework, which is an application framework used to process large data stored on the file system.
Of course, there are many distributed computing frameworks, but what is particularly notable about Hadoop (and Google's MapReduce) is the built-in fault tolerance. It is designed to run on commodity hardware, and therefore it expects computers to be breaking frequently. The underlying file system is highly-redundant (blocks of data are replicated across multiple computers) and the MapReduce processing framework automatically handles computer failures which occur during a processing job by reassigning the processing to another computer in the cluster.
Hardware Machine name
#include <sys/types.h>
#include <sys/sysctl.h>
- (NSString *)machine
{
size_t size;
// Set 'oldp' parameter to NULL to get the size of the data
// returned so we can allocate appropriate amount of space
sysctlbyname("hw.machine", NULL, &size, NULL, 0);
// Allocate the space to store name
char *name = malloc(size);
// Get the platform name
sysctlbyname("hw.machine", name, &size, NULL, 0);
// Place name into a string
NSString *machine = [NSString stringWithUTF8String:name];
// Release allocated memory
free(name);
return machine;
}
Friday, November 8, 2013
Taking Screenshot programatically in iOS
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
UIGraphicsBeginImageContextWithOptions(self.window.bounds.size, NO, [UIScreen mainScreen].scale);
} else {
UIGraphicsBeginImageContext(self.window.bounds.size);
}
[self.window.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSData * data = UIImagePNGRepresentation(image);
[data writeToFile:@"foo.png" atomically:YES];
UIGraphicsBeginImageContextWithOptions(self.window.bounds.size, NO, [UIScreen mainScreen].scale);
} else {
UIGraphicsBeginImageContext(self.window.bounds.size);
}
[self.window.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSData * data = UIImagePNGRepresentation(image);
[data writeToFile:@"foo.png" atomically:YES];
App Icon File name and Size for iOS 7
Icon.png - 57*57
Icon@2x.png - 114*114
Icon-Small.png - 29*29
Icon-Small@2x.png - 58*58
Icon-80.png - 80*80
Icon-120.png - 120*120
Thursday, October 31, 2013
Using Reachability in iOS
Add the SystemConfiguration framework
#import "Reachability.h"
-(BOOL)reachable {
NSString *hostName = @"google.com";
Reachability *r = [Reachability reachabilityWithHostName:hostName];
NetworkStatus internetStatus = [r currentReachabilityStatus];
if(internetStatus == NotReachable) {
return NO;
}
return YES;
}
if ([self reachable]) {
NSLog(@"Reachable");
}
else {
NSLog(@"Not Reachable");
}
Creating PopOverView for iPad
-(void)showPickerView : (NSString *)aScore{
UIViewController* popoverContentViewController = [[UIViewController alloc] init];
UIView *popoverView = [[UIView alloc] init]; //view
popoverView.backgroundColor = [UIColor whiteColor];
// Load tempView
UIView *tempView = nil;
NSArray *arr = nil;
CGRect frame = CGRectZero;
CGRect popOverFrame = CGRectZero;
if([aScore isEqualToString:@"performanceScore"]){
arr = [[NSBundle mainBundle] loadNibNamed:@"PerformanceScoreView" owner:self options:nil];
tempView = [arr objectAtIndex:0];
popOverFrame = CGRectMake(0, 0, 200, 150);
frame = self.performanceScoreTitleLbl.frame;
} else {
arr = [[NSBundle mainBundle] loadNibNamed:@"BreeamScoreView" owner:self options:nil];
tempView = [arr objectAtIndex:0];
popOverFrame = CGRectMake(0, 0, 220, 380);
frame = self.breeamScoreTitleLbl.frame;
}
[popoverView addSubview:tempView];
popoverContentViewController.view = popoverView;
popoverController = [[UIPopoverController alloc] initWithContentViewController:popoverContentViewController];
[popoverController setPopoverContentSize:CGSizeMake(popOverFrame.size.width, popOverFrame.size.height) animated:NO];
[popoverController presentPopoverFromRect:frame inView:self permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
}
Reading from JSON File in ObjectiveC
NSString *fileName = @"property3.json";
NSString *filePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:fileName];
NSString *jsonString = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
NSError *jsonError = nil;
NSDictionary *propertyDict = [NSJSONSerialization JSONObjectWithData:jsonData options:kNilOptions error:&jsonError];
if(jsonError) {
NSLog(@"jsonError : %@", [jsonError localizedDescription]);
} else {
//NSLog(@"propertyDict : %@", propertyDict);
}
Thursday, October 24, 2013
iOS 6.0 to iOS 7.0 full screen transition
self.edgesForExtendedLayout = UIRectEdgeTop | UIRectEdgeLeft | UIRectEdgeBottom | UIRectEdgeRight;
Unwind Segue Programmatically
#pragma mark - Trigger for unwind seque programmatically - (IBAction) done: (id)sender{ SEL theUnwindSelector = @selector(goToRoot:); NSString *unwindSegueIdentifier = @"unwindToRootSeque"; UINavigationController *nc = [self navigationController]; // Find the view controller that has this unwindAction selector (may not be one in the nav stack) UIViewController *viewControllerToCallUnwindSelectorOn = [nc viewControllerForUnwindSegueAction: theUnwindSelector fromViewController: self withSender: sender]; // None found, then do nothing. if (viewControllerToCallUnwindSelectorOn == nil) { NSLog(@"No controller found to unwind too"); return; } // Can the controller that we found perform the unwind segue. (This is decided by that controllers implementation of canPerformSeque: method BOOL cps = [viewControllerToCallUnwindSelectorOn canPerformUnwindSegueAction: theUnwindSelector fromViewController: self withSender: sender]; // If we have permision to perform the seque on the controller where the unwindAction is implmented // then get the segue object and perform it. if (cps) { UIStoryboardSegue *unwindSegue = [nc segueForUnwindingToViewController: viewControllerToCallUnwindSelectorOn fromViewController: self identifier: unwindSegueIdentifier]; [viewControllerToCallUnwindSelectorOn prepareForSegue: unwindSegue sender: self]; [unwindSegue perform]; } }
Subscribe to:
Comments (Atom)