Tuesday, September 30, 2014

Better way to check empty string

//Check if we have any search terms in the search dictionary.
    if( (searchBar.text==(id) [NSNull null] || [searchBar.text length]==0 || searchBar.text isEqual:@""))
    {
         [AlertView showAlert:@"Please enter a search string"];

    }

Monday, September 29, 2014

Check device for iPhone 5

#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )

if(IS_IPHONE_5{

   // It's iPhone 5
}

Calculate Height of Text from Width of an UILabel

UILabel *type;
type.frame=[self calculateHeightOfTextFromWidth:type withText:type.text];

-(CGRect) calculateHeightOfTextFromWidth:(UILabel*)detailLabel withText:(NSString*)text
{
    
    CGRect currentFrame = detailLabel.frame;
    CGSize max = CGSizeMake(detailLabel.frame.size.width, 500);
    CGSize expected = [text sizeWithFont:detailLabel.font constrainedToSize:max lineBreakMode:detailLabel.lineBreakMode]; 
    currentFrame.size.height = expected.height;
    return currentFrame;
}

Load an Image from existing location and from URL

AsynchImage.h

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>

@interface AsynchImage : UIView{
    
    NSURLConnection* connection;
    NSMutableData* data;
    UIImageView* imageView;
}

-(void)loadImageFromURL:(NSURL*)url;
-(void)loadExistingImage:(UIImage *)image;

@end

AsynchImage.m


#import "AsynchImage.h"

#define ACTIVITY_FRAME CGRectMake(30, 35, 10, 10)
#define ACTIVITYINDICATOR_TAG 999
#define BORDER_COLOR [[UIColor colorWithRed:FLOAT_COLOR_VALUE(200) green:FLOAT_COLOR_VALUE(210) blue:FLOAT_COLOR_VALUE(232) alpha:1.0] CGColor];


@implementation AsynchImage

- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

-(void)loadExistingImage:(UIImage *)image {
    
    if ([[self subviews] count]>0) {
        [[[self subviews] objectAtIndex:0] removeFromSuperview];
    }
    
    UIImageView* _imageView = [[UIImageView alloc] init];
    _imageView.frame = CGRectMake(2, 2, self.frame.size.width-4, self.frame.size.height-4); 
    _imageView.image = image; 
    _imageView.layer.borderWidth= 2.5f;
    _imageView.layer.borderColor=BORDER_COLOR
    _imageView.contentMode = UIViewContentModeScaleToFill;
    _imageView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);

    [self addSubview:_imageView];
    _imageView =nil;
    [_imageView setNeedsLayout];

    [self setNeedsLayout];
}

- (void)loadImageFromURL:(NSURL *)url{
    
    self.layer.borderColor = BORDER_COLOR
    self.layer.borderWidth = 2.5f;
    UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc
                                                  initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
    activityIndicator.frame=ACTIVITY_FRAME;
    activityIndicator.center=CGPointMake(self.frame.size.width/2, self.frame.size.height/2);

    activityIndicator.tag = ACTIVITYINDICATOR_TAG;
    [self addSubview:activityIndicator];
    [activityIndicator startAnimating];
      
    if (data!=nil) { data = nil; }
    NSURLRequest* request = [NSURLRequest requestWithURL:url                                       
cachePolicy:NSURLRequestUseProtocolCachePolicy
                                          timeoutInterval:30.0];

    connection = [[NSURLConnection alloc]
                  initWithRequest:request delegate:self];
}

#pragma mark - delegates

- (void)connection:(NSURLConnection *)theConnection
    didReceiveData:(NSData *)incrementalData {
    if (data == nil) {
        data = [[NSMutableData alloc] initWithCapacity:2048];
    }

    [data appendData:incrementalData];
}

- (void)connectionDidFinishLoading:(NSURLConnection *)theConnection {
      
    connection=nil;
    
    if ([[self subviews] count]>0) {
        [[[self subviews] objectAtIndex:0] removeFromSuperview];
    }
   
        imageView = [[UIImageView alloc] init];
        imageView.frame = CGRectMake(0, 0, self.frame.size.width-1, self.frame.size.height-1); 
        imageView.image = [UIImage imageWithData:data];
        //To crop Image
        imageView.image=[self imageByScalingAndCroppingForSize:CGSizeMake(100, 100)];      
  
        int resolution=data.length;
        if(resolution>800) {
            
        }

        imageView.contentMode=UIViewContentModeScaleToFill;
        imageView.autoresizingMask = (UIViewAutoresizingFlexibleWidth
                                      UIViewAutoresizingFlexibleHeight);
        [self addSubview:imageView];
        [imageView setNeedsLayout];
        [self setNeedsLayout];   
        imageView = nil;
        // save the image to avoid multiple downloads
       data=nil;
    
       UIActivityIndicatorView *activity = (UIActivityIndicatorView *)[self 
                          viewWithTag:ACTIVITYINDICATOR_TAG];
       [activity removeFromSuperview];
}

- (void)connection:(NSURLConnection *)theConnection didFailWithError:(NSError *)error {
    connection=nil;
   
    UIImage *image = [UIImage imageNamed:@"userImage"];
    [self loadExistingImage:image];
    
    UIActivityIndicatorView *activity = (UIActivityIndicatorView *)[self viewWithTag:ACTIVITYINDICATOR_TAG];
    [activity removeFromSuperview];
}

//crop Image
- (UIImage *)imageByScalingAndCroppingForSize:(CGSize)targetSize
{
    UIImage *sourceImage = imageView.image;
    UIImage *newImage = nil;
    CGSize imageSize = sourceImage.size;
    CGFloat width = imageSize.width;
    CGFloat height = imageSize.height;
    CGFloat targetWidth = targetSize.width;
    CGFloat targetHeight = targetSize.height;
    CGFloat scaleFactor = 0.0;
    CGFloat scaledWidth = targetWidth;
    CGFloat scaledHeight = targetHeight;
    CGPoint thumbnailPoint = CGPointMake(0.0,0.0);
    
    if (CGSizeEqualToSize(imageSize, targetSize) == NO)
    {
        CGFloat widthFactor = targetWidth / width;
        CGFloat heightFactor = targetHeight / height;
        
        if (widthFactor > heightFactor)
            scaleFactor = widthFactor; // scale to fit height
        else
            scaleFactor = heightFactor; // scale to fit width
        scaledWidth  = width * scaleFactor;
        scaledHeight = height * scaleFactor;
        
        // center the image
        if (widthFactor > heightFactor)
        {
            thumbnailPoint.y = (targetHeight - scaledHeight) * 0.1;
        }
        else
            if (widthFactor < heightFactor)
            {
                thumbnailPoint.x = (targetWidth - scaledWidth) * 0.1;
            }
    }
    
    UIGraphicsBeginImageContext(targetSize); // this will crop
    
    CGRect thumbnailRect = CGRectZero;
    thumbnailRect.origin = thumbnailPoint;
    thumbnailRect.size.width  = scaledWidth;
    thumbnailRect.size.height = scaledHeight;
    
    [sourceImage drawInRect:thumbnailRect];
    
    newImage = UIGraphicsGetImageFromCurrentImageContext();
    if(newImage == nil)
         
    //pop the context to get back to the default
    UIGraphicsEndImageContext();
    return newImage;
}


@end

Remove subviews (if already exists)

if ([[self subviews] count]>0) {
        [[[self subviews] objectAtIndex:0] removeFromSuperview];

}

Sunday, September 28, 2014

Font, UIImage, Float Color Value, URL set as global

//Declaration
#define GET_BOLD_FONT_WITH_SIZE(__SIZE)        ([UIFont fontWithName:FONT_BOLD size:__SIZE])

#define GET_REGULAR_FONT_WITH_SIZE(__SIZE)     ([UIFont fontWithName:FONT_REGULAR size:__SIZE])

#define IMAGE(imageName)    (UIImage *)[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:imageName         ofType:IMAGE_TYPE_PNG]]

#define FLOAT_COLOR_VALUE(n) (n)/255.0

#define DISCLAIMERURL @"http://www.google.com"

#define VIEW_FRAME CGRectMake(0, 0, 320, 95)


//Usage
cancelButton.titleLabel.font=GET_BOLD_FONT_WITH_SIZE(15);
[cancelButton setBackgroundImage:IMAGE(@"buttonWhiteSmall") forState:UIControlStateNormal];

notes.font=GET_REGULAR_FONT_WITH_SIZE(14);

[self.layer setBorderColor:[[UIColor colorWithRed:FLOAT_COLOR_VALUE(112) green:FLOAT_COLOR_VALUE(105) blue:FLOAT_COLOR_VALUE(159) alpha:0.50] CGColor]];

NSString *strWebsiteUlr = [NSString stringWithFormat:DISCLAIMERURL];

self.frame=VIEW_FRAME;

Wednesday, September 24, 2014

Invoke SOAP web-service

NSString *xml = requestXMLToSent;

NSString *msgLength = [NSString stringWithFormat:@"%lu"
                      (unsigned long)[xml length]];

NSURL *serviceURL = [NSURL URLWithString: url];
NSMutableURLRequest *urlRequest = [NSMutableURLRequest  
                                  requestWithURL:serviceURL];

[urlRequest addValue:@"text/xml; charset=utf-8" 
            forHTTPHeaderField:@"Content-Type"];
[urlRequest addValue: serviceURL forHTTPHeaderField:@"SOAPAction"];
[urlRequest addValue:msgLength forHTTPHeaderField:@"Content-Length"];
[urlRequest setHTTPBody:[xml dataUsingEncoding: NSUTF8StringEncoding]];

[urlRequest setHTTPMethod:@"POST"];

[NSURLConnection sendAsynchronousRequest:urlRequest queue:[[NSOperationQueue alloc]init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
        
  if (connectionError == NULL) {
        
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
    NSInteger statuscode = httpResponse.statusCode;
    
       if (statuscode == 200) {
            
         NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
            NSLog(@"response String  : %@",responseString);
                        
        }else{
            NSLog(@"%@",response);            
        }
                                
    }else{
        
        NSLog(@"There is an error in URL connection and the Error is: %@",connectionError);

    }

Thursday, September 11, 2014

Convert NSString to UIImage

-(UIImage *)imageFromText:(NSString *)text
{
    // set the font type and size
    UIFont *font = [UIFont systemFontOfSize:20.0];
    CGSize size  = [text sizeWithFont:font];
    
    // check if UIGraphicsBeginImageContextWithOptions is available (iOS is 4.0+)
    if (UIGraphicsBeginImageContextWithOptions != NULL)
        UIGraphicsBeginImageContextWithOptions(size,NO,0.0);
    else
        // iOS is < 4.0
        UIGraphicsBeginImageContext(size);
    
    // optional: add a shadow, to avoid clipping the shadow you should make the context size bigger
    //
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    CGContextSetShadowWithColor(ctx, CGSizeMake(1.0, 1.0), 5.0, [[UIColor brownColor] CGColor]);
    
    // draw in context, you can use also drawInRect:withFont:
    [text drawAtPoint:CGPointMake(0.0, 0.0) withFont:font];
    
    //CGImageRef cimg = UIGraphicsGetCurrentContext();
    
    // transfer image
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height);
    [image drawInRect:rect blendMode:kCGBlendModeNormal alpha:1.0];
    
    //CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetRGBStrokeColor(ctx, 2.0, 3.5, 5.0, 1.0);
    CGContextStrokeRect(ctx, rect);
    UIImage *testImg = UIGraphicsGetImageFromCurrentImageContext();
    
    UIGraphicsEndImageContext();    
    
    return testImg;

}

Convert long URLs into short (Bitly format)

Short URLs can be created in two different ways : Bitly and TinyUrl.
I have implemented this using Bitly approach.

Include BitlyShortUrl.h and BitlyShortUrl.m file into your project [available on Github].

Now, #import "BitlyShortUrl.h" in header file where functionality is to be implemented.
Specify delegate “BitlyShortUrlDelegate” in interface of header file.


#pragma mark -
#pragma mark BitlyShortUrlDelegate Methods


- (void)BitlyShortUrlSucceededWithShortUrl:(NSString *)shortUrl{
  // Success in creating short URL
    NSLog(@"shortUrl : %@ ",shortUrl);  
}

- (void)BitlyShortUrlFailedWithError:(NSError *)error {
  // Failed in creating short URL
}

 BitlyShortUrl *ShortURL = [[BitlyShortUrl alloc] initWithDelegate:self];
 [ShortURL BitlyUrl:longURLValue];

Human Psychology


Human Psychology is most interesting stuff to understand. It is an observed fact that "Thinking pattern" determines psychology of person. If a person has poor/uncontrolled thinking pattern then it can lead to several disorder. There are people around us that may be suffering from psychological disorder but we fail to notice it.

Famous painting by Armand Gauiter (19th century) depicting eight women with different mental disorders.


Most common disorders are listed below :

1. Obsessive Compulsive Disorder (OCD) is an anxiety disorder characterized by intrusive thoughts that produce uneasiness, fear, repetitive behaviors. Symptom include excessive washing or cleaning, repeated checking, violent or religious thoughts, relationship-related obsessions.

2. Attention Deficit Hyperacitivty Disorder (ADHD) is a psychiatric disorder in which there are significant problems of attention, hyperactivity, or acting impulsively that are not appropriate for a persons age.

3. Schizophrenia is a psychiatric disorder often characterized by abnormal social behavior and failure to recognize what is real. Common symptoms include false beliefs, unclear or confused thinking, auditory hallucinations, reduced social engagement and emotional expression, and inactivity.

4. Major Depressive Disorder (MDD) / Unipolar Disorder is a mental disorder characterized by a pervasive and persistent low mood that is accompanied by low self-esteem and by a loss of interest or pleasure in normally enjoyable activities.

5. Learning disabilities : This include reading disability (dyslexia), mathematics disability (dyscalculia) and writing disability (dysgraphia).


I'm aware of such kind of "State-of-Mind". Also, I'm 100% confident of getting a person out of such State-of-Mind with self-practised mental tricks.

Contact : jp.dubey07@gmail.com


Wednesday, September 10, 2014

iOS interview question and answers

[Source : Internet]

Q: Does iOS support multitasking? 
    iOS 4 and above supports multi-tasking and allows apps to remain in the background until they are launched again or until they are terminated.  

Q: Which JSON framework is supported by iOS? 
   SBJson framework is supported by iOS.  It is a JSON parser and generator for Objective-C. SBJson provides flexible APIs and additional control that makes JSON handling easier.

Q: How can we achieve singleton pattern in iOS?

The Singleton design pattern ensures a class only has one instance, and provides a global point of access to it. The class keeps track of its sole instance and ensures that no other instance can be created. Singleton classes are appropriate for situations where it makes sense for a single object to provide access to a global resource.













Several Cocoa framework classes are singletons. They include NSFileManagerNSWorkspaceNSApplication, and, in UIKit, UIApplicationA process is limited to one instance of these classes. When a client asks the class for an instance, it gets a shared instance, which is lazily created upon the first request.

Q: What is Delegation in iOS?

Delegation is a design pattern in which one object sends messages to another object—specified as its delegate—to ask for input or to notify it that an event is occurring. Delegation is often used as an alternative to class inheritance to extend the functionality of reusable objects. For example, before a window changes size, it asks its delegate whether the new size is ok. The delegate replies to the window, telling it that the suggested size is acceptable or suggesting a better size. 


Q: What is delegate pattern in iOS?

Delegation is a mechanism by which a host object embeds a weak reference (weak in the sense that it’s a simple pointer reference, unretained) to another object—its delegate—and periodically sends messages to the delegate when it requires its input for a task. The host object is generally an “off-the-shelf” framework object (such as an NSWindow or NSXMLParserobject) that is seeking to accomplish something, but can only do so in a generic fashion. The delegate, which is almost always an instance of a custom class, acts in coordination with the host object, supplying program-specific behavior at certain points in the task. Thus delegation makes it possible to modify or extend the behavior of another object without the need for subclassing.

Monday, September 8, 2014

Zoom to particular location in iOS ArcGIS

//Zooming to an initial envelope with the specified spatial reference of the map
AGSSpatialReference *sr = [AGSSpatialReference webMercatorSpatialReference];
    
AGSEnvelope *env = [AGSEnvelope envelopeWithXmin:-14631218.265139 ymin:8384478.275350 xmax:-9170290.964017 ymax:2245708.599438  spatialReference:sr];
    

[self.mapView zoomToEnvelope:env animated:YES];

Sunday, September 7, 2014

iOS or Android, Confused what to start with?

[Source :  http://blog.bazingalabs.in]

Being a developer and also handling most of the Management, I realised there is lots that go into deciding what to start with: iOS or Android

There are a huge lots of posts on this topic, and many people fight and claim one of the two, I am just here to explain you various Factors that matters into the decision. Then its all upto you.

So let the battle Begin -

1.Market Share - 
Android Dominates the Market Share by having about 80% of the market share world Wide.
Thats a huge Leap over iOS and is a big number to consider! But does it really Matter, We will see as we read though.


2.Target Audience - 
What is your target Audience? 
There is much higher user Engagement on iOS as compared to Android.
Apple users are much more towards using new apps more, and new technologies.
Above 62% of Mobile Web traffic comes from iOS Platform.

3.Money - SHOW ME THE MONEY!!
Money is all iOS!
Above 70% of Mobile E Commerce traffic comes from iOS Platform.
Facebook Ads were 1790% times more profitable on iOS, As compared to Android.
I don't think I need to say any more.


4.Environment & Language

You can still write code with text files and command lines, and many do, but it’s so much more productive to use an integrated development environment, or IDE.

Apple’s Xcode, which is, by and large, a joy to work with. It’s slick, fast, powerful, helpful without being intrusive, and it keeps getting better at papering over both the unheimlich compilation machinery beneath its glossy exterior, and the complex and paranoid certificate/profile machinery which Apple imposes on developers to retain its titanium-fisted control over iOS apps and devices. The debugger works seamlessly, and the simulator is fast and responsive.

But Android? Oh, Android. The current state-of-the-art IDE is Eclipse with Android Plugins, and it is embarrassingly bad. Slow, clunky, counterintuitive when not outright baffling, poorly laid out, needlessly complex, it’s just a mess. Its debugger is so clumsy that I find myself doing log-file debugging most of the time, whereas the XCode debugger is my iOS go-to bug-hunt tool. And the less said about the Android emulator, which takes minutes to launch and then half the time fails to connect to the Android Debug Bridge, the better.

Now, to be fair, Google knows this is a problem, and they are working on a new Android Studio IDE. Alas:
Android Studio is currently available as an early access preview. Several features are either incomplete or not yet implemented and you may encounter bugs. If you are not comfortable using an unfinished product, you may want to instead download (or continue to use) the ADT Bundle (Eclipse with the ADT Plugin).
It’s nice to see they’re working on it.

Regarding the Language,

I cut my programming teeth on Java, and didn’t think much of Objective-C at first, in large part because of its excessive verbosity: a line like

String s2 = s1.replace(“abc”,”xyz”);

becomes

NSString *s2 = [s1 stringByReplacingOccurrencesOfString:@"abc" withString:@"xyz"];

but I’ve grown very fond of Objective-C. It’s just better and cleaner than Java. It has blocks: Java does not. It has categories; Java does not. It does not require you to wrap much of your code with vast swathes of boilerplate try/catch exception-handling whitespace: Java does.

Java has its advantages. Better stack traces, for one thing, which means tracking down sporadic bugs tends to be a lot easier. And until a couple of years ago Android had the huge advantage of garbage collection. But now that iOS hasautomatic reference counting, that advantage has mostly vanished (although old third-party tools often don’t work with ARC, which means you have to do some XCode configuration voodoo to switch it off on a file-by-file basis.), And with SWIFT coming in lately, There is no comparison now!

5.UI UX Designs

You would expect Apple to walk off with this trophy. Its Interface Builder is a very sleek way to put simple good-looking user interfaces together quickly. The trouble is, the more I’ve actually used Interface Builder, the less I’ve liked it. It’s another layer of configuration complexity; it’s excellent for simple things, but as time goes by and apps evolve, those simple things tend to get complex and messy; and I really don’t like the multi-screen Storyboards Apple added about a year ago.

While Android theoretically has a comparable visual tool, the less said about it the better. In practice you wind up writing XML files which provide layout guidelines, as opposed to rules, so that apps are rendered (hopefully) well on the entire vast panoply of devices and screen sizes out there. (Apple’s Auto Layout moves in the same direction, with an eye towards a larger variety of iOS screens in the future, no doubt.) Meanwhile, Android provides an icon pack for developers to use, whereas iOS developers have to go with third parties like Icons8, or roll their own.

Overall it’s a closer contest than you’d think, although I concede that this is pretty idiosyncratic. In the end two things give iOS the edge. First, it’s still much simpler: three screen sizes (including iPad) and two screen densities, as opposed to the mass of complexity which is Android. Second, the default iOS visual elements — eg popup menus and messages – are so much more visually attractive than Android’s.
6.Cost, Effort and Developers
There is this general misconception that iOS will cost more then Android.
iOS might be more complex to code, but the tools and technologies like Xcode are so powerful that iOS is coded hell lot faster then Android
Plus iOS does not have to support huge variety of devices.
About developers, Data speaks for itself!



7.Publishing
Publishing an Android app is easy as a dream. Just sign your app via a handy Eclipse wizard, and poof, you have an APK file that can run on any device. Email it, put it up on a web site, or upload it to Google Play and make it available worldwide (probably) within the hour. Could hardly be simpler. Check install statistics and crash reports, including stack traces which (usually) identify the individual line of code that went wrong, at your leisure, and you can upload a bug-fix version immediately.

Publishing an Apple app is a nightmare. A brilliant friend of mine always advises people to add at least a day to their iOS development schedule just to wrestle with certificates and distribution profiles. No matter how many times I do it, or how easy the latest version of XCode tries to make it, it’s always a giant hassle. And testing would be even worse if not for TestFlight. And Apple’s “iTunes Connect” web site is to Google Play Developer Console as a Ford Pinto is to a Tesla. Good luck getting any crash reports at all, much less useful information from them; have fun jumping through their arbitrary hoops; and marvel at just how bad mighty Apple’s UX can be.


8.Funding for Startup's, Community
It has been a trend that VC's don't fund Android Apps! Why? No idea. But if you are a startup, Dont even think about Android!

9.Security and Enterprise usage
I dont have to speak anything about Android's security and uses in the enterprises. It cannot be used. Simple. Android being open source does not have any high level security.
Apple levies strict guidelines for development, and if violated, your app does not get uploaded on the app store.
The same is not true for Android.
Plus Android is not at all secure.



And the Winner is - 
iOS, and by some distance. Android has its advantages, but overall, it remains significantly easier to write good iOS apps than good Android apps. Combine that with the fact that iOS users tend to be wealthier–and arguably more influential–and it still makes sense for most startups who want to make a splash to go iOS-first, Android-later. The new Android Studio IDE could conceivably close some of that gap…but not all of it.


Friday, September 5, 2014

Ten commandment for effective study

The following are tips (based on experience) for an effective study :

1. Always sit on first bench during lectures. The benefit of this are :

  •     You may not get distracted by what others are doing.
  •     You can listen clearly to lecturer.
  •     You cannot sleep!

2. Give importance to studies. It is feature of Human-Brain that whatever things we give importance it remembers clearly. Hence, if you give importance to studies automatically all concepts can be remembered better.

3. Understand the concepts and not just recite it. It becomes interesting to study when concept-oriented technique is used. This helps a lot during aptitude, interview preparation etc.

4. When you sit down to study dissolve yourself completely in it.

5. Speed at which study is done is of great importance. A topic taken for study should be completed within allocated time. For e.g. To complete a chapter maximum time allocated should be five hours or so.

6. Confine yourself to single reference material (preferred is textbooks). If multiple book are referred then chances of confusion are greater.

7. Maintain focus at studies. There might be situations when others might demoralize you. In such situations always believe in Self and to whom you Worship.

8. Study at time that involves less disturbance. For e.g.. For hostel students extreme night or extreme morning is best time to study.

9. Always remember that there is world outside studies. Give time to family, friends and to who you love!

10. Most important is worship. Always worship to Goddess Saraswati (or in whom you believe) because if you are blessed then you might be next Einstein!

ArcGIS iOS : Add a number in circle

// Create point symbol with Numbers on Map
- (AGSCompositeSymbol *) inputStopSymbolWithNumber:(int) stopNumber {
    
AGSCompositeSymbol *cs = [AGSCompositeSymbol compositeSymbol];
    // create outline
AGSSimpleLineSymbol *sls = [AGSSimpleLineSymbol simpleLineSymbol];
sls.color = [UIColor blackColor];
sls.width = 2;
sls.style = AGSSimpleLineSymbolStyleSolid;
    
    // add number as a text symbol
AGSTextSymbol *ts =  [[AGSTextSymbol alloc] initWithText:[NSString stringWithFormat:@"%d", stopNumber] color:[UIColor blackColor]];
ts.vAlignment = AGSTextSymbolVAlignmentMiddle;
ts.hAlignment = AGSTextSymbolHAlignmentCenter;
ts.fontSize = 18;      
    
    // create main circle
AGSSimpleMarkerSymbol *sms = [AGSSimpleMarkerSymbol simpleMarkerSymbol];   
    sms.color = [UIColor colorWithRed:238.0/255.0 green:195.0/255.0 blue:3.0/255.0 alpha:1.0];
sms.outline = sls;
    
    // Dynamically set size of Text
//[sms setSize:CGSizeMake(labelStringSize.width+8,25)];
    
    [sms setSize:CGSizeMake(25,25)];
sms.style = AGSSimpleMarkerSymbolStyleCircle;
    
[cs addSymbol:sms];
[cs addSymbol:ts];
   
return cs;
}