<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DkAER3k4fSp7ImA9WhRaE0Q.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448</id><updated>2012-02-16T04:18:26.735-08:00</updated><category term="Web technology" /><category term="linux" /><category term="UIWebView" /><category term="How To" /><category term="skills" /><category term="logout" /><category term="reviews" /><category term="javascript" /><category term="java" /><category term="asp .net" /><category term="success" /><category term="tutorial" /><category term="web development" /><category term="secure download" /><category term="website" /><category term="Life Style" /><category term="c#" /><category term="PHP" /><category term="Drupal" /><category term="Recession" /><category term="iPhone" /><category term="SEO" /><category term="planning" /><category term="tips" /><category term="optimization" /><category term="resource" /><category term="servlet" /><category term="New Technologies" /><category term="laptop" /><category term="Utilities" /><title>Dipak Mishra's blog</title><subtitle type="html">My Journey of Development</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://blog.dipak.org.in/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>40</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/diipak" /><feedburner:info uri="diipak" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CE8NSX06cCp7ImA9WhZRF0U.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-6946031455090368578</id><published>2011-04-14T04:54:00.000-07:00</published><updated>2011-04-14T05:08:18.318-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-14T05:08:18.318-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iPhone" /><category scheme="http://www.blogger.com/atom/ns#" term="How To" /><title>How to add custom navigation bar (navigation bar with image)</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="separator" style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-3ELeOydi-EI/TabhnBCxiWI/AAAAAAAAA74/WhrxGWb1pNU/s1600/Screen+shot+2011-04-14+at+5.28.26+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="282" src="http://4.bp.blogspot.com/-3ELeOydi-EI/TabhnBCxiWI/AAAAAAAAA74/WhrxGWb1pNU/s320/Screen+shot+2011-04-14+at+5.28.26+PM.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;A lot of time I came across a common problem of showing background image in navigation bar of iPhone application. For very first time, I used a very uncommon solution of inserting an image view in navigation bar. But then came other problem like showing title, left bar button and right bar button were getting hidden.&lt;br /&gt;
&lt;br /&gt;
After a bit research I found a very easy solution of this problem. As a solution, we need to write few lines in Application's app delegate file and the navigation bar for that particular gets customized accordingly. Below is the code:&lt;br /&gt;
&lt;blockquote&gt;@implementation UINavigationBar (CustomImage)&lt;br /&gt;
- (void)drawRect:(CGRect)rect {&lt;br /&gt;
UIImage *image = [UIImage imageNamed: @"iphone_bar.jpg"];&lt;br /&gt;
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];&lt;br /&gt;
}&lt;br /&gt;
@end&lt;/blockquote&gt;&lt;br /&gt;
If this piece of code solves you problem, do leave a comment below.&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-6946031455090368578?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oDDQgVpiTCAVokqMExmS7pKeM8o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oDDQgVpiTCAVokqMExmS7pKeM8o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oDDQgVpiTCAVokqMExmS7pKeM8o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oDDQgVpiTCAVokqMExmS7pKeM8o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/JMeJH7SczjM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/6946031455090368578/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2011/04/how-to-add-custom-navigation-bar.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/6946031455090368578?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/6946031455090368578?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/JMeJH7SczjM/how-to-add-custom-navigation-bar.html" title="How to add custom navigation bar (navigation bar with image)" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-3ELeOydi-EI/TabhnBCxiWI/AAAAAAAAA74/WhrxGWb1pNU/s72-c/Screen+shot+2011-04-14+at+5.28.26+PM.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2011/04/how-to-add-custom-navigation-bar.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4GRnc-fCp7ImA9WhZRGU8.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-7959831664485424631</id><published>2011-02-25T21:24:00.000-08:00</published><updated>2011-04-15T21:25:27.954-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-15T21:25:27.954-07:00</app:edited><title>How to crop an image on iPhone</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;iframe align="right" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=dipaksblog-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B002Y27P3M&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;&lt;br /&gt;
Here is a code for cropping image on iPhone.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event&lt;br /&gt;
{&lt;br /&gt;
UITouch *touch = [[event allTouches]anyObject];&lt;br /&gt;
CGPoint loc = [touch locationInView:touch.view];&lt;br /&gt;
&lt;br /&gt;
tmpVView.frame = CGRectMake(tmpVView.frame.origin.x, tmpVView.frame.origin.y, fabs(tmpVView.frame.origin.x-loc.x), fabs(tmpVView.frame.origin.y-loc.y));&lt;br /&gt;
}&lt;br /&gt;
-(void)cropImage:(id)sender&lt;br /&gt;
{&lt;br /&gt;
if(tmpVView &amp;amp;&amp;amp; tmpVView.frame.size.width &amp;gt; 10 &amp;amp;&amp;amp; tmpVView.frame.size.height &amp;gt; 10)&lt;br /&gt;
{&lt;br /&gt;
//UIImage *img = [originalImg.image imageScaledToSize:CGSizeMake(32.0f, 32.0f) interpolationQuality:1];&lt;br /&gt;
//UIImage *img = [self resizedImage:originalImg.image inFrame:originalImg.frame];&lt;br /&gt;
[originalImg drawRect:originalImg.frame];&lt;br /&gt;
finalImg.image = [self imageByCropping:originalImg.image toRect:tmpVView.frame];&lt;br /&gt;
[tmpVView removeFromSuperview];&lt;br /&gt;
[tmpVView release];&lt;br /&gt;
tmpVView = nil;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
- (UIImage*)imageByCropping:(UIImage *)imageToCrop toRect:(CGRect)rect&lt;br /&gt;
{&lt;br /&gt;
//create a context to do our clipping in&lt;br /&gt;
UIGraphicsBeginImageContext(rect.size);&lt;br /&gt;
CGContextRef currentContext = UIGraphicsGetCurrentContext();&lt;br /&gt;
&lt;br /&gt;
//create a rect with the size we want to crop the image to&lt;br /&gt;
//the X and Y here are zero so we start at the beginning of our&lt;br /&gt;
//newly created context&lt;br /&gt;
CGRect clippedRect = CGRectMake(0, 0, rect.size.width, rect.size.height);&lt;br /&gt;
CGContextClipToRect( currentContext, clippedRect);&lt;br /&gt;
&lt;br /&gt;
//create a rect equivalent to the full size of the image&lt;br /&gt;
//offset the rect by the X and Y we want to start the crop&lt;br /&gt;
//from in order to cut off anything before them&lt;br /&gt;
CGRect drawRect = CGRectMake(rect.origin.x * -1,&lt;br /&gt;
rect.origin.y * -1,&lt;br /&gt;
imageToCrop.size.width,&lt;br /&gt;
imageToCrop.size.height);&lt;br /&gt;
CGContextTranslateCTM(currentContext, 0.0, drawRect.size.height);&lt;br /&gt;
CGContextScaleCTM(currentContext, 1.0, -1.0);&lt;br /&gt;
//draw the image to our clipped context using our offset rect&lt;br /&gt;
CGContextDrawImage(currentContext, drawRect, imageToCrop.CGImage);&lt;br /&gt;
&lt;br /&gt;
//pull the image from our cropped context&lt;br /&gt;
UIImage *cropped = UIGraphicsGetImageFromCurrentImageContext();&lt;br /&gt;
&lt;br /&gt;
//pop the context to get back to the default&lt;br /&gt;
UIGraphicsEndImageContext();&lt;br /&gt;
&lt;br /&gt;
//Note: this is autoreleased&lt;br /&gt;
return cropped;&lt;br /&gt;
}&lt;/blockquote&gt;&lt;br /&gt;
Enjoy!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-7959831664485424631?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vzS4ULyvmpOGbSZ6c8rkFONORIY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vzS4ULyvmpOGbSZ6c8rkFONORIY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vzS4ULyvmpOGbSZ6c8rkFONORIY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vzS4ULyvmpOGbSZ6c8rkFONORIY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/weKnZGs6qOA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/7959831664485424631/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2011/02/how-to-crop-image-on-iphone.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/7959831664485424631?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/7959831664485424631?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/weKnZGs6qOA/how-to-crop-image-on-iphone.html" title="How to crop an image on iPhone" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>4</thr:total><feedburner:origLink>http://blog.dipak.org.in/2011/02/how-to-crop-image-on-iphone.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYHRX08cSp7ImA9Wx9UFUQ.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-5614980807133274223</id><published>2011-02-13T01:41:00.000-08:00</published><updated>2011-02-13T01:42:14.379-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-13T01:42:14.379-08:00</app:edited><title>How to use iPhone contacts in your own application</title><content type="html">In this how to series, I have come up with yet another code snippet, which allows you to use iPhone’s contact data into your own application. The code is:&lt;br /&gt;&lt;br /&gt;-(void)retrieveContactList&lt;br /&gt;{&lt;br /&gt; ABAddressBookRef myAddressBook = ABAddressBookCreate();&lt;br /&gt; NSArray *allPeople = (NSArray *)ABAddressBookCopyArrayOfAllPeople(myAddressBook);&lt;br /&gt; contactList = [[NSMutableArray alloc]initWithCapacity:[allPeople count]];&lt;br /&gt; for (id record in allPeople) {&lt;br /&gt;CFTypeRef phoneProperty = ABRecordCopyValue((ABRecordRef)record, kABPersonPhoneProperty);&lt;br /&gt;NSArray *phones = (NSArray *)ABMultiValueCopyArrayOfAllValues(phoneProperty);&lt;br /&gt; //NSLog(@”phones array: %@”, phones);&lt;br /&gt;CFRelease(phoneProperty);&lt;br /&gt; NSString* contactName = (NSString *)ABRecordCopyCompositeName((ABRecordRef)record);&lt;br /&gt; &lt;br /&gt; NSMutableDictionary *newRecord = [[NSMutableDictionary alloc] init];&lt;br /&gt; [newRecord setObject:contactName forKey:@"name"];&lt;br /&gt; //[contactName release];&lt;br /&gt; NSMutableString *newPhone = [[NSMutableString alloc] init];&lt;br /&gt; for (NSString *phone in phones) {&lt;br /&gt; //NSString *fieldData = [NSString stringWithFormat:@"%@: %@", contactName, phone];&lt;br /&gt; if(![newPhone isEqualToString:@""])&lt;br /&gt; [newPhone appendString:@", "];&lt;br /&gt; [newPhone appendString:phone];&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt; [newRecord setObject:newPhone forKey:@"phone"];&lt;br /&gt; [newPhone release];&lt;br /&gt; [phones release];&lt;br /&gt; [contactList addObject:newRecord];&lt;br /&gt; //[newPhone release];&lt;br /&gt;}&lt;br /&gt; CFRelease(myAddressBook);&lt;br /&gt;// NSLog(@”Final data: %@”, contactList);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-5614980807133274223?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JsD5mIhkWbAkW4JdPXjIRoNLqD0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JsD5mIhkWbAkW4JdPXjIRoNLqD0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JsD5mIhkWbAkW4JdPXjIRoNLqD0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JsD5mIhkWbAkW4JdPXjIRoNLqD0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/UPwWIbBnEeA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/5614980807133274223/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2011/02/how-to-use-iphone-contacts-in-your-own.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/5614980807133274223?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/5614980807133274223?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/UPwWIbBnEeA/how-to-use-iphone-contacts-in-your-own.html" title="How to use iPhone contacts in your own application" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2011/02/how-to-use-iphone-contacts-in-your-own.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8CQ3g7cSp7ImA9Wx9WGEk.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-4917066425674759004</id><published>2011-01-23T21:23:00.000-08:00</published><updated>2011-01-23T21:44:22.609-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-23T21:44:22.609-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iPhone" /><category scheme="http://www.blogger.com/atom/ns#" term="How To" /><title>How to save current screen to iPhone library</title><content type="html">Here is a quick post, in which I am posting a quick snippet to capture the current screen of iPhone and save it to the phone library. This piece of code will be helpful in generating screen-shot of any iPhone application programmatically.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 12px; line-height: 14px; white-space: pre; "&gt;&lt;ol style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; list-style-image: initial; line-height: 1.22em; color: black; "&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt;&lt;span class="sy0" style="line-height: 1.22em; "&gt;-&lt;/span&gt;&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;(&lt;/span&gt;&lt;span class="kw4" style="line-height: 1.22em; color: blue; "&gt;void&lt;/span&gt;&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;)&lt;/span&gt;saveScreen&lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt;&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; CGRect myRect &lt;span class="sy0" style="line-height: 1.22em; "&gt;=&lt;/span&gt; &lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;[&lt;/span&gt;self.view bounds&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;]&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; UIGraphicsBeginImageContext&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;(&lt;/span&gt;myRect.size&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;)&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; CGContextRef ctx &lt;span class="sy0" style="line-height: 1.22em; "&gt;=&lt;/span&gt; UIGraphicsGetCurrentContext&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;(&lt;/span&gt;&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;)&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; &lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;[&lt;/span&gt;&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;[&lt;/span&gt;UIColor blackColor&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;]&lt;/span&gt; set&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;]&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; CGContextFillRect&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;(&lt;/span&gt;ctx, myRect&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;)&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; &lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;[&lt;/span&gt;self.view.layer renderInContext&lt;span class="sy0" style="line-height: 1.22em; "&gt;:&lt;/span&gt;ctx&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;]&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; UIImage &lt;span class="sy0" style="line-height: 1.22em; "&gt;*&lt;/span&gt;image1 &lt;span class="sy0" style="line-height: 1.22em; "&gt;=&lt;/span&gt; UIGraphicsGetImageFromCurrentImageContext&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;(&lt;/span&gt;&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;)&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; UIImageWriteToSavedPhotosAlbum&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;(&lt;/span&gt;image1, &lt;span class="kw2" style="line-height: 1.22em; color: green; "&gt;nil&lt;/span&gt;, &lt;span class="kw2" style="line-height: 1.22em; color: green; "&gt;nil&lt;/span&gt;, &lt;span class="kw2" style="line-height: 1.22em; color: green; "&gt;nil&lt;/span&gt;&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;)&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; UIGraphicsEndImageContext&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;(&lt;/span&gt;&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;)&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li class="li1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; "&gt;&lt;div class="de1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.22em; color: rgb(0, 0, 139); "&gt;&lt;span class="br0" style="line-height: 1.22em; color: olive; "&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Please leave your comments here so that I can find out, if you find this snippet useful or not&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Enjoy!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-4917066425674759004?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gJrcS4MOpkZYBnnI0TUUdihfVqc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gJrcS4MOpkZYBnnI0TUUdihfVqc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gJrcS4MOpkZYBnnI0TUUdihfVqc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gJrcS4MOpkZYBnnI0TUUdihfVqc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/eZOl0FeDRws" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/4917066425674759004/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2011/01/how-to-save-current-screen-to-iphone.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/4917066425674759004?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/4917066425674759004?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/eZOl0FeDRws/how-to-save-current-screen-to-iphone.html" title="How to save current screen to iPhone library" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2011/01/how-to-save-current-screen-to-iphone.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAFQHc_fSp7ImA9Wx5bFkw.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-1354338932292356472</id><published>2010-11-01T05:15:00.000-07:00</published><updated>2010-11-01T06:05:11.945-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-01T06:05:11.945-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iPhone" /><category scheme="http://www.blogger.com/atom/ns#" term="tips" /><title>Using NSUserDefaults in iPhone app - Interesting fact.</title><content type="html">In one of my projects, I was using User Defaults for the first time. Then I came across a very interesting problem. I was writing this code for setting value to user defaults:&lt;br /&gt;&lt;br /&gt;NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];&lt;br /&gt;[prefs setObject:@"Value" forKey:@"key"];&lt;br /&gt; &lt;br /&gt;After setting the values this way, I tried retrieving the value for the key in next session, it simply did not return correct value.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After googling for a while, I came to know about this line and it worked perfectly:&lt;br /&gt;&lt;br /&gt;[prefs synchronize];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thus, I came to know that in order to use User Defaults, one have to use this synchronize function. The final code looks like:&lt;br /&gt;&lt;br /&gt;NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];&lt;br /&gt;[prefs setObject:@"Value" forKey:@"key"];&lt;br /&gt;[prefs synchronize];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-1354338932292356472?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DOX5qfqIUlbHlSMB4B8IlqpH4a4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DOX5qfqIUlbHlSMB4B8IlqpH4a4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DOX5qfqIUlbHlSMB4B8IlqpH4a4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DOX5qfqIUlbHlSMB4B8IlqpH4a4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/GYVyXsIQPVw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/1354338932292356472/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/11/in-one-of-my-projects-i-was-using-user.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/1354338932292356472?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/1354338932292356472?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/GYVyXsIQPVw/in-one-of-my-projects-i-was-using-user.html" title="Using NSUserDefaults in iPhone app - Interesting fact." /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/11/in-one-of-my-projects-i-was-using-user.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0ADQng6fip7ImA9Wx5bEkg.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-8505221111814188789</id><published>2010-10-28T00:38:00.000-07:00</published><updated>2010-10-28T00:42:53.616-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-28T00:42:53.616-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Utilities" /><category scheme="http://www.blogger.com/atom/ns#" term="iPhone" /><title>Merging two images in objective-c</title><content type="html">While researching about image manipulation for my next project, I came across an interesting piece of code, using which, we can merge two images into a single image. Here's the code:&lt;br /&gt;&lt;br /&gt;-(UIImage*)mergeImage:(UIImage*)mask overImage:(UIImage*)source inSize:(CGSize)size&lt;br /&gt;{&lt;br /&gt;    //Capture image context ref&lt;br /&gt;    UIGraphicsBeginImageContext(size);&lt;br /&gt;    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];&lt;br /&gt;    UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();&lt;br /&gt;    UIGraphicsEndImageContext();&lt;br /&gt;   &lt;br /&gt;    //Draw images onto the context&lt;br /&gt;    [source drawInRect:CGRectMake(0, 0, source.size.width, source.size.height)]; &lt;br /&gt;    [mask drawInRect:CGRectMake(0, 0, mask.size.width, mask.size.height)]; &lt;br /&gt;   &lt;br /&gt;    return viewImage;&lt;br /&gt;   &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Got the reference from &lt;a href="http://www.iphonedevsdk.com/forum/iphone-sdk-development/14209-how-merge-two-images.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-8505221111814188789?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YfQV_XtR2vrNNI5eS2kASIMDsAc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YfQV_XtR2vrNNI5eS2kASIMDsAc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YfQV_XtR2vrNNI5eS2kASIMDsAc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YfQV_XtR2vrNNI5eS2kASIMDsAc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/zY2yBIeD8lU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/8505221111814188789/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/10/merging-two-images-in-objective-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/8505221111814188789?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/8505221111814188789?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/zY2yBIeD8lU/merging-two-images-in-objective-c.html" title="Merging two images in objective-c" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/10/merging-two-images-in-objective-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4BQHo4fSp7ImA9Wx5QFko.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-1665055867808187612</id><published>2010-09-04T23:48:00.000-07:00</published><updated>2010-09-05T00:15:51.435-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-05T00:15:51.435-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iPhone" /><category scheme="http://www.blogger.com/atom/ns#" term="tutorial" /><title>Date formatting in Cocoa</title><content type="html">"&lt;span style="font-style: italic;"&gt;Date formatters format the textual representation of cells that contain date objects (including Gregorian dates), and convert textual representations of dates and times into date objects.&lt;/span&gt;" - Apple Documentation.&lt;br /&gt;&lt;br /&gt;While creating an app, you generally come across a situation, when you require custom date format to represent dates in user friendly manner. For this purpose, Cocoa provides date formatter class. Using a date formatter, we can express dates colloquially, such as “today,” “day after tomorrow,” and “a month from today.”&lt;br /&gt;&lt;br /&gt;Here's the example of date formatter:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc]&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;initWithDateFormat:@"%1m/%1d/%Y" allowNaturalLanguage:NO] autorelease];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;NSDate *date = [NSDate dateWithTimeIntervalSinceReferenceDate:118800];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;NSString *formattedDateString = [dateFormatter stringFromDate:date];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;NSLog(@"formattedDateString: %@", formattedDateString);&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;// Output: formattedDateString: 1/2/2001&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Below is the list of possible date conversions using date formatter (More detail on date conversion and range of conversions can be found &lt;a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/DataFormatting/Articles/df100103.html#//apple_ref/doc/uid/TP40007972-SW9"&gt;here&lt;/a&gt;):&lt;br /&gt;&lt;br /&gt;&lt;table class="graybox" border="0" cellpadding="5" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th scope="col" style="text-align: left;" class="TableHeading_TableRow_TableCell"&gt;&lt;p&gt; Specifier&lt;/p&gt;&lt;/th&gt;&lt;th scope="col" style="text-align: left;" class="TableHeading_TableRow_TableCell"&gt;&lt;p&gt;Description&lt;/p&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%%&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;A &lt;code&gt;'%'&lt;/code&gt; character&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%a&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Abbreviated weekday name&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%A&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Full weekday name&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%b&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Abbreviated month name&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%B&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Full month name&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%c&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Shorthand for “&lt;code&gt;%X %x&lt;/code&gt;", the locale format for date and time&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%d&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Day of the month as a decimal number (01-31) &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%e&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Same as &lt;code&gt;%d&lt;/code&gt; but does not print the leading 0 for days 1 through 9 (unlike &lt;code&gt;strftime()&lt;/code&gt;, does not print a leading space)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%F&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Milliseconds as a decimal number (000-999)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%H&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Hour based on a 24-hour clock as a decimal number (00-23) &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%I&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Hour based on a 12-hour clock as a decimal number (01-12)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%j&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Day of the year as a decimal number (001-366) &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%m&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Month as a decimal number (01-12) &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%M&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Minute as a decimal number (00-59) &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%p&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;AM/PM designation for the locale&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%S&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Second as a decimal number (00-59) &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%w&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Weekday as a decimal number (0-6), where Sunday is 0&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%x&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Date using the date representation for the locale, including the time zone (produces different results from &lt;code&gt;strftime()&lt;/code&gt;)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%X&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Time using the time representation for the locale (produces different results from &lt;code&gt;strftime()&lt;/code&gt;)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%y&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Year without century (00-99) &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%Y&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Year with century (such as 1990)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%Z&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Time zone name (such as Pacific Daylight Time; produces different results from &lt;code&gt;strftime()&lt;/code&gt;)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td scope="row"&gt;&lt;p&gt;&lt;code&gt;%z&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Time zone offset in hours and minutes from GMT (HHMM)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Hope this helps you in programming. Do let me know your views on it.&lt;br /&gt;&lt;br /&gt;Enjoy Coding!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-1665055867808187612?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PCilKyDYrbE1eX6sUU7-UHo9HVI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PCilKyDYrbE1eX6sUU7-UHo9HVI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PCilKyDYrbE1eX6sUU7-UHo9HVI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PCilKyDYrbE1eX6sUU7-UHo9HVI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/sJF83b10g-A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/1665055867808187612/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/09/date-formatting-in-cocoa.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/1665055867808187612?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/1665055867808187612?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/sJF83b10g-A/date-formatting-in-cocoa.html" title="Date formatting in Cocoa" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>4</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/09/date-formatting-in-cocoa.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQGRHo_eip7ImA9Wx5QEEQ.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-5019903252077309362</id><published>2010-08-29T09:03:00.000-07:00</published><updated>2010-08-29T09:12:05.442-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-29T09:12:05.442-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iPhone" /><category scheme="http://www.blogger.com/atom/ns#" term="How To" /><category scheme="http://www.blogger.com/atom/ns#" term="UIWebView" /><title>How to show UIWebView without background</title><content type="html">I was working on an iPhone app, when I came across a problem, where I had to use UIWebView to show some of the data, but the background should not be shown (I had a background image for my app, and the content of web view should have to be shown just over the app background). But the background of web-view was showing as white color. After googling for sometime, I came across this small piece of code, which solved my problem:&lt;br /&gt;&lt;br /&gt;    [myWebView setBackgroundColor:[UIColor clearColor]];&lt;br /&gt;    [myWebView setOpaque:NO];&lt;br /&gt;    [myWebView loadHTMLString:@"&amp;lt;html&amp;gt;\&lt;br /&gt;        &amp;lt;body style="'background-color:transparent;'"&amp;gt;\&lt;br /&gt;        Welcome!&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;";&lt;br /&gt;&lt;br /&gt;And this small piece worked for me.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-5019903252077309362?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ZFyui7wVJ_Vag91xVEY8AwNreVk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZFyui7wVJ_Vag91xVEY8AwNreVk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ZFyui7wVJ_Vag91xVEY8AwNreVk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZFyui7wVJ_Vag91xVEY8AwNreVk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/aqXoKPjH5QQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/5019903252077309362/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/08/how-to-show-uiwebview-without.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/5019903252077309362?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/5019903252077309362?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/aqXoKPjH5QQ/how-to-show-uiwebview-without.html" title="How to show UIWebView without background" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/08/how-to-show-uiwebview-without.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8EQnc-cCp7ImA9Wx5SGEs.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-4499416656485001903</id><published>2010-08-15T02:00:00.000-07:00</published><updated>2010-08-15T02:00:03.958-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-15T02:00:03.958-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iPhone" /><category scheme="http://www.blogger.com/atom/ns#" term="How To" /><title>How to set specific year/month/date/time into UIDatePicker control</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_tWmIcWSBDVU/TGeIlZR3d3I/AAAAAAAAA5c/XgaKusphw1k/s1600/ruler.png"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 305px; height: 217px;" src="http://2.bp.blogspot.com/_tWmIcWSBDVU/TGeIlZR3d3I/AAAAAAAAA5c/XgaKusphw1k/s400/ruler.png" alt="" id="BLOGGER_PHOTO_ID_5505519245506082674" border="0" /&gt;&lt;/a&gt;While working on a date picker control I encountered a problem, where I was supposed to set year of the date picker control to a specific year. For this problem, I added a custom text box over date picker. When a user enters a year in that text box and clicks done button, I changed the year of date picker to the year provided in text box.&lt;br /&gt;&lt;br /&gt;Here is the piece of code, which I used to change year of my date picker control.  This logic can be used to change other components of the date picker with any year, month or date.&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;NSDate *today=calenderPicker.date;&lt;br /&gt;  NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];&lt;br /&gt;  NSDateComponents *components = [gregorian components:  (NSYearCalendarUnit | NSMonthCalendarUnit |  NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit) fromDate: today];&lt;br /&gt;  components.year = [textField.text intValue];  // Here value for year is fetched from a text field control. Similarly other values like month, date, hour or minute can be changed.&lt;br /&gt;  [calenderPicker setDate: [gregorian dateFromComponents:components] ];  // Update the date picker control.&lt;br /&gt;  [gregorian release];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-4499416656485001903?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EKUaFrhbsdW_tGhsaRE0xLfdq0c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EKUaFrhbsdW_tGhsaRE0xLfdq0c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EKUaFrhbsdW_tGhsaRE0xLfdq0c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EKUaFrhbsdW_tGhsaRE0xLfdq0c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/wGD8YDVE6VU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/4499416656485001903/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/08/how-to-set-specific-yearmonthdatetime.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/4499416656485001903?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/4499416656485001903?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/wGD8YDVE6VU/how-to-set-specific-yearmonthdatetime.html" title="How to set specific year/month/date/time into UIDatePicker control" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_tWmIcWSBDVU/TGeIlZR3d3I/AAAAAAAAA5c/XgaKusphw1k/s72-c/ruler.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/08/how-to-set-specific-yearmonthdatetime.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYAR3oyeip7ImA9Wx5SGEg.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-3497993434489693767</id><published>2010-08-08T03:44:00.000-07:00</published><updated>2010-08-14T23:35:46.492-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-14T23:35:46.492-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iPhone" /><category scheme="http://www.blogger.com/atom/ns#" term="How To" /><title>How to show UIPopover control with header bar and title</title><content type="html">In iPad, we have a new control called UIPopover. This control shows up as an overlay in the screen with a UIViewController or UIView in it. But I came across a problem of showing title with header bar in Popover control. Then came across a set of solution, which solved my problem.&lt;br /&gt;&lt;br /&gt;The logic behind this implementation is:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Create a view controller class (here demoViewController).&lt;/li&gt;&lt;li&gt;Create an object of navigation controller (here demoNavController) and initialize it with view controller as it's RootViewController.&lt;/li&gt;&lt;li&gt;Create an object of UIPopoverController (here demoPopup) and initialize it with navigation controller as it's ContentViewController&lt;/li&gt;&lt;li&gt;Set delegate of popover control to current class and set title of navigation controller with desired string.&lt;/li&gt;&lt;li&gt;Find bounds of a button (or any control, from where you want to present the popover control) and show the control from this bound.&lt;/li&gt;&lt;/ul&gt;And that's it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is the code for this implementation:&lt;br /&gt;&lt;br /&gt;if(trainnePopup == nil)&lt;br /&gt;   {&lt;br /&gt;       DemoViewController *demoViewController = [[DemoViewController alloc]initWithNibName:@"DemoViewController" bundle:[NSBundle mainBundle]];&lt;br /&gt;     &lt;br /&gt;       UINavigationController *demoNavController = [[[UINavigationController alloc] initWithRootViewController:demoViewController] autorelease];&lt;br /&gt;      &lt;br /&gt;UIPopoverController *demoPopup = [[UIPopoverController alloc]initWithContentViewController:demoNavController];&lt;br /&gt;       [demoPopup setPopoverContentSize:CGSizeMake(demoViewController.view.frame.size.width, demoViewController.view.frame.size.height)];&lt;br /&gt;       [demoViewController release];&lt;br /&gt;       demoPopup.delegate = self;&lt;br /&gt;       demoPopup.contentViewController.title=@"Demo Popup";&lt;br /&gt;     &lt;br /&gt;   }&lt;br /&gt; &lt;br /&gt;   // Below lines are used to show the arrow of the popover control&lt;br /&gt;   CGRect popoverRect= [self.view convertRect:[buttonCtrl bounds]&lt;br /&gt;                                     fromView:[buttonCtrl superview]];&lt;br /&gt; &lt;br /&gt;   [demoPopup presentPopoverFromRect:CGRectMake(335, 258, 100, 100)&lt;br /&gt;                                inView:[self view] permittedArrowDirections: UIPopoverArrowDirectionUp&lt;br /&gt;                              animated:YES];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-3497993434489693767?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/X1hlL9SQ_LLxBnD6cChrPTsOc1A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/X1hlL9SQ_LLxBnD6cChrPTsOc1A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/X1hlL9SQ_LLxBnD6cChrPTsOc1A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/X1hlL9SQ_LLxBnD6cChrPTsOc1A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/tASmM-41xG8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/3497993434489693767/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/08/how-to-show-uipopover-control-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/3497993434489693767?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/3497993434489693767?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/tASmM-41xG8/how-to-show-uipopover-control-with.html" title="How to show UIPopover control with header bar and title" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/08/how-to-show-uipopover-control-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYAR3oyeip7ImA9Wx5SGEg.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-2825019574128319785</id><published>2010-08-06T11:08:00.000-07:00</published><updated>2010-08-14T23:35:46.492-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-14T23:35:46.492-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="PHP" /><category scheme="http://www.blogger.com/atom/ns#" term="tips" /><category scheme="http://www.blogger.com/atom/ns#" term="How To" /><title>How to access remote MySql database from localhost</title><content type="html">I had this requirement from long to access my remote MySql database (hosted on some service provider, for which I had access to control panel only) from my localhost. This was not for the fun, but it's really convenient if we can access remote database locally. Once one of my friend configured on my laptop for me, but I never know, how this worked. Then I formatted my laptop and all the settings were gone.&lt;br /&gt;&lt;br /&gt;Today, one of my colleagues asked me to solve the same problem for him and I cracked for him, which I never tried for myself. So, the steps for configuring the remote database on local machine is as follows:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Grab a copy of phpmyadmin from app folder of your WAMP (on MAC, you can find phpmyadmin in bin folder of you MAMP installation). Put all the files into root folder of your localhost, so that it can be accessed via http://localhost/new-phpmyadmin/&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Open the "config.inc.php" file from above setup in any text editor.&lt;/li&gt;&lt;li&gt;Now configure these values:&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;$cfg['Servers'][$i]['host'] = "IP address of your remote server"; //&lt;/li&gt;&lt;li&gt;$cfg['Servers'][$i]['port']          = '3306';&lt;/li&gt;&lt;li&gt;$cfg['Servers'][$i]['user']          = 'MySql username';&lt;/li&gt;&lt;li&gt;$cfg['Servers'][$i]['password']      = 'MySql password';&lt;/li&gt;&lt;/ul&gt;And this is all, what it takes to configure the localhost to access remote MySql database. It worked like magic for me, and was very relaxing for my colleague.&lt;br /&gt;&lt;br /&gt;Please let me know, if it does not work for you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-2825019574128319785?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MLE-pPBXonE5iu92f6qcix8V7ug/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MLE-pPBXonE5iu92f6qcix8V7ug/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MLE-pPBXonE5iu92f6qcix8V7ug/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MLE-pPBXonE5iu92f6qcix8V7ug/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/FINK_FhGzyY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/2825019574128319785/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/08/how-to-access-remote-mysql-database.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/2825019574128319785?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/2825019574128319785?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/FINK_FhGzyY/how-to-access-remote-mysql-database.html" title="How to access remote MySql database from localhost" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/08/how-to-access-remote-mysql-database.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4EQXw6fCp7ImA9WxFaFEg.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-2062931736649288865</id><published>2010-07-18T04:35:00.000-07:00</published><updated>2010-07-18T04:35:00.214-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-18T04:35:00.214-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="PHP" /><category scheme="http://www.blogger.com/atom/ns#" term="Utilities" /><title>PHP function to create random password.</title><content type="html">&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;While creating a password recovery system for one of my projects, I had to generate random password. I could have written a function at my own, but had a very tight deadline for this feature. Thus I went on googling for it and came across a very cool function at &lt;a href="http://www.phptoys.com/e107_plugins/content/content.php?content.42"&gt;this link&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The post not just saved my valuable time, I was so impressed with it that I decided to write a post for this function it self.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The function goes like this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;function &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;generatePassword&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$length&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;6&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$level&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;2&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;)&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$usec&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$sec&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;) = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;explode&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;' '&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;microtime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;());&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;srand&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;((float) &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$sec &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;+ ((float) &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$usec &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;* &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;100000&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;));&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$validchars&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;] = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;"0123456789abcdfghjkmnpqrstvwxyz"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$validchars&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;2&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;] = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;"0123456789abcdfghjkmnpqrstvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$validchars&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;3&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;] = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;"0123456789_!@#$%&amp;amp;*()-=+/abcdfghjkmnpqrstvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_!@#$%&amp;amp;*()-=+/"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;;&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$password  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;""&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$counter   &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;;&lt;br /&gt;&lt;br /&gt; while (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$counter &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;&lt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$length&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;) {&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$actChar &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;substr&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$validchars&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$level&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;], &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;rand&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;strlen&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$validchars&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$level&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;])-&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;), &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;);&lt;br /&gt;&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;// All &lt;span class="searchhighlight"&gt;character&lt;/span&gt; must be different&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;if (!&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;strstr&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$password&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$actChar&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;)) {&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$password &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;.= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$actChar&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$counter&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;++;&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; return &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;$password&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;;&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-2062931736649288865?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rlrqAbcU9uwrzrG0g6VhTbfmrec/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rlrqAbcU9uwrzrG0g6VhTbfmrec/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rlrqAbcU9uwrzrG0g6VhTbfmrec/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rlrqAbcU9uwrzrG0g6VhTbfmrec/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/etgWef-dX6Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/2062931736649288865/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/07/php-function-to-create-random-password.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/2062931736649288865?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/2062931736649288865?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/etgWef-dX6Y/php-function-to-create-random-password.html" title="PHP function to create random password." /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/07/php-function-to-create-random-password.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4BR389fyp7ImA9WxFaFEk.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-1482212646144405445</id><published>2010-07-15T06:32:00.000-07:00</published><updated>2010-07-18T03:29:16.167-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-18T03:29:16.167-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Utilities" /><category scheme="http://www.blogger.com/atom/ns#" term="iPhone" /><title>iPhone - How to find height of a label for dynamic string in it.</title><content type="html">&lt;span style="font-family: verdana;"&gt;Here is a small but very useful function, which gives height of a label for which dynamic string is to be set:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;-(NSInteger) findHeightOfLabelString:(NSString *)textString&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;    UIFont *font = [UIFont systemFontOfSize:17];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;    CGSize size = CGSizeMake(175.0f, MAXFLOAT);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;    CGSize labelSize=[textString sizeWithFont:font constrainedToSize:size lineBreakMode:UILineBreakModeWordWrap];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;    return labelSize.height;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-1482212646144405445?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/sUOeazfLaB2DK6S0Nr-3JQWGJpY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sUOeazfLaB2DK6S0Nr-3JQWGJpY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/sUOeazfLaB2DK6S0Nr-3JQWGJpY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sUOeazfLaB2DK6S0Nr-3JQWGJpY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/BEaSFJcYMkI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/1482212646144405445/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/07/iphone-how-to-find-height-of-label-for.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/1482212646144405445?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/1482212646144405445?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/BEaSFJcYMkI/iphone-how-to-find-height-of-label-for.html" title="iPhone - How to find height of a label for dynamic string in it." /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/07/iphone-how-to-find-height-of-label-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cFSH07fCp7ImA9WxFaFEk.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-5227028695478769609</id><published>2010-07-09T02:49:00.000-07:00</published><updated>2010-07-18T03:30:19.304-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-18T03:30:19.304-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Utilities" /><category scheme="http://www.blogger.com/atom/ns#" term="iPhone" /><title>Objective C - Convert local time into GMT time.</title><content type="html">&lt;span style="font-family:arial;"&gt;These days m working on iPhone development and came across an interesting problem of converting GMT time into local time. After some research, I found this interesting function achieve it: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;-(NSString *)convertGMTDateFromLocalDate:(NSString *)gmtDateStr&lt;br /&gt;{&lt;br /&gt;   NSDateFormatter* formatter = [[NSDateFormatter alloc] init];&lt;br /&gt;&lt;br /&gt;   [formatter setDateFormat:@"yyyy-MM-dd HH:mm"];&lt;br /&gt;&lt;br /&gt;   NSTimeZone *gmt = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];&lt;br /&gt;&lt;br /&gt;   [formatter setTimeZone:gmt];&lt;br /&gt;&lt;br /&gt;   NSDate *localDate = [formatter dateFromString:gmtDate]; // get the date&lt;br /&gt;&lt;br /&gt;   NSTimeInterval timeZoneOffset = [[NSTimeZone systemTimeZone] secondsFromGMT]; // You could also use the systemTimeZone method&lt;br /&gt;&lt;br /&gt;   NSTimeInterval gmtTimeInterval = [localDate timeIntervalSinceReferenceDate] - timeZoneOffset;&lt;br /&gt;&lt;br /&gt;   NSDate *gmtCurrentDate = [NSDate dateWithTimeIntervalSinceReferenceDate:gmtTimeInterval];&lt;br /&gt;&lt;br /&gt;   return [formatter stringFromDate:gmtCurrentDate];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-5227028695478769609?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/h-vRh_z0aSgV4nWnYrqUSnFMzpY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/h-vRh_z0aSgV4nWnYrqUSnFMzpY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/h-vRh_z0aSgV4nWnYrqUSnFMzpY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/h-vRh_z0aSgV4nWnYrqUSnFMzpY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/CYi3DJt_jnU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/5227028695478769609/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/07/objective-c-convert-local-time-into-gmt.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/5227028695478769609?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/5227028695478769609?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/CYi3DJt_jnU/objective-c-convert-local-time-into-gmt.html" title="Objective C - Convert local time into GMT time." /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/07/objective-c-convert-local-time-into-gmt.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQNRH86fip7ImA9Wx5TEE4.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-4642686471093603871</id><published>2010-05-03T01:55:00.001-07:00</published><updated>2010-07-24T20:59:55.116-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-24T20:59:55.116-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><title>Running a batch file from C#</title><content type="html">Here's a piece of code, which enables running a batch file from C# code. I found this on google, but don't remember the link for it. So, if somebody have copyright for this code, please let me know. I'll remove this from my site.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;string basePath = htmpPath + "\\" + bookId.ToString() + "\\";&lt;br /&gt;         &lt;br /&gt;           // Get the full file path&lt;br /&gt;           string strFilePath = "C:\\Inetpub\\wwwroot\\test\\pdftohtml.bat";&lt;br /&gt;&lt;br /&gt;           // Create the ProcessInfo object&lt;br /&gt;           System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(strFilePath);&lt;br /&gt;           psi.UseShellExecute = false;&lt;br /&gt;           psi.RedirectStandardOutput = true;&lt;br /&gt;           psi.RedirectStandardInput = true;&lt;br /&gt;           psi.RedirectStandardError = true;&lt;br /&gt;           psi.WorkingDirectory = "C:\\Inetpub\\wwwroot\\test";&lt;br /&gt;           psi.Arguments = basePath + " " + txt.Text + fileUploadControl.FileName + " " + txt.Text; ;&lt;br /&gt;           psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;&lt;br /&gt;&lt;br /&gt;           // Start the process&lt;br /&gt;           System.Diagnostics.Process proc = System.Diagnostics.Process.Start(psi);&lt;br /&gt;&lt;br /&gt;           // Open the batch file for reading&lt;br /&gt;           System.IO.StreamReader strm = System.IO.File.OpenText(strFilePath);&lt;br /&gt;&lt;br /&gt;           // Attach the output for reading&lt;br /&gt;           System.IO.StreamReader sOut = proc.StandardOutput;&lt;br /&gt;&lt;br /&gt;           // Attach the in for writing&lt;br /&gt;           System.IO.StreamWriter sIn = proc.StandardInput;&lt;br /&gt;&lt;br /&gt;           // Write each line of the batch file to standard input&lt;br /&gt;           while (strm.Peek() != -1)&lt;br /&gt;           {&lt;br /&gt;               sIn.WriteLine(strm.ReadLine());&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           strm.Close();&lt;br /&gt;&lt;br /&gt;           // Exit CMD.EXE&lt;br /&gt;           string stEchoFmt = "# {0} run successfully. Exiting";&lt;br /&gt;&lt;br /&gt;           sIn.WriteLine(String.Format(stEchoFmt, strFilePath));&lt;br /&gt;           sIn.WriteLine("EXIT");&lt;br /&gt;&lt;br /&gt;           // Close the process&lt;br /&gt;           proc.Close();&lt;br /&gt;&lt;br /&gt;           // Read the sOut to a string.&lt;br /&gt;           string results = sOut.ReadToEnd().Trim();&lt;br /&gt;&lt;br /&gt;           // Close the io Streams;&lt;br /&gt;           sIn.Close();&lt;br /&gt;           sOut.Close();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-4642686471093603871?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rbso_Xlt_456Cjf2Yl0lLp_cYAU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rbso_Xlt_456Cjf2Yl0lLp_cYAU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rbso_Xlt_456Cjf2Yl0lLp_cYAU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rbso_Xlt_456Cjf2Yl0lLp_cYAU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/ThzYJz1JfFo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/4642686471093603871/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/05/running-batch-file-from-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/4642686471093603871?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/4642686471093603871?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/ThzYJz1JfFo/running-batch-file-from-c.html" title="Running a batch file from C#" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/05/running-batch-file-from-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUACRH4_cSp7ImA9WxBVEEk.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-5201080980741754210</id><published>2010-02-12T23:54:00.000-08:00</published><updated>2010-02-12T23:56:05.049-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-12T23:56:05.049-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><title>Cool function to convert integer value into money value (Adds comma after 3 digits from right)</title><content type="html">&lt;div&gt;This function adds comma to make it look like money value.&lt;/div&gt;&lt;div&gt;function addComma(val)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;var regEx = /(\d+)(\d{3})/;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;while (regEx.test(val))&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;val = val.replace(regEx, '$1' + ',' + '$2');&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;return val;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-5201080980741754210?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vO4xq16OQUC2UHXFTw6EU36BnK4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vO4xq16OQUC2UHXFTw6EU36BnK4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vO4xq16OQUC2UHXFTw6EU36BnK4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vO4xq16OQUC2UHXFTw6EU36BnK4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/6uVm8VAZ4zw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/5201080980741754210/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/02/cool-function-to-convert-integer-value.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/5201080980741754210?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/5201080980741754210?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/6uVm8VAZ4zw/cool-function-to-convert-integer-value.html" title="Cool function to convert integer value into money value (Adds comma after 3 digits from right)" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/02/cool-function-to-convert-integer-value.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEAQXk_cCp7ImA9WxBXFE0.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-4540703225615910932</id><published>2010-01-25T00:04:00.000-08:00</published><updated>2010-01-25T00:04:00.748-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-25T00:04:00.748-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drupal" /><title>Showing navigation menu to specific roles or users</title><content type="html">&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;These days Drupal is my life and spending all the research and work on it only. So came across another interesting problem and it's solution. &lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;b&gt;&lt;u&gt;The problem is&lt;/u&gt;&lt;/b&gt;: I was supposed to show custom menu to all the users for my web-site and main navigation menu should not be visible to all the users.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;b&gt;&lt;u&gt;The solution&lt;/u&gt;&lt;/b&gt;: Go to administer -&gt; Site building -&gt; Blocks and then select the configuration link of Navigation menu. This will open up the configuration page. Now go down to &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(73, 73, 73); line-height: 20px; "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;Show block on specific pages. Now select the radio, which says "&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;i&gt;Show if the following PHP code returns &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;code style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;i&gt;TRUE&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;i&gt; (PHP-mode, experts only)"&lt;/i&gt; and add these code in the text-area below:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(73, 73, 73); line-height: 20px; "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:Georgia, serif;color:#000000;"&gt;&lt;span class="Apple-style-span" style="line-height: normal;"&gt;&lt;span class="Apple-style-span"   style="font-family:georgia;color:#494949;"&gt;&lt;span class="Apple-style-span" style="line-height: 20px;"&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;global $user;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;return (($user-&gt;uid == 1) || ((is_array($user-&gt;roles)) &amp;amp;&amp;amp; (in_array("Model", $user-&gt;roles))));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here $user-&gt;uid is being compared for a specific user, in my case admin of the site and $user-&gt;roles is being compared for some role, for which the menu is supposed to be shown, in my case &lt;/div&gt;&lt;div&gt;Model.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-4540703225615910932?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JRARkzkDpFXjz1sOVfEfeDPk-iI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JRARkzkDpFXjz1sOVfEfeDPk-iI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JRARkzkDpFXjz1sOVfEfeDPk-iI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JRARkzkDpFXjz1sOVfEfeDPk-iI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/XTRLocGpo2w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/4540703225615910932/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/01/showing-navigation-menu-to-specific.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/4540703225615910932?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/4540703225615910932?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/XTRLocGpo2w/showing-navigation-menu-to-specific.html" title="Showing navigation menu to specific roles or users" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/01/showing-navigation-menu-to-specific.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8MRn86eip7ImA9WxBQGE8.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-5928677269596860278</id><published>2010-01-18T06:04:00.000-08:00</published><updated>2010-01-18T06:11:27.112-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-18T06:11:27.112-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drupal" /><title>Logging in a user into Drupal using PHP code.</title><content type="html">&lt;div&gt;These days I am working on a Drupal project, where I am supposed to manage our own users and we decided to manage separate table for users. Now the client asked us to create blogs for this as well. In our previous flow, we were treating our system users as anonymous users for Drupal. But given the fact that anonymous user cannot create blogs. Then we decided to make our anonymous users a registered users with Drupal. After searching a lot, I found out these pieces of code, which I suppose are great for our system. The code is:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;global $user;&lt;/div&gt;&lt;div&gt;$user = user_load($uid);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here $uid is the user id, that you want to forcefully login into Drupal system. Using this code, an external system logs in as a registered user and hope fully will be able to write blogs as well. Will let you know as soon as I finish with the blog feature.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-5928677269596860278?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CnJlkJRPrzTMHt5KfG25fKl5n3o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CnJlkJRPrzTMHt5KfG25fKl5n3o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CnJlkJRPrzTMHt5KfG25fKl5n3o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CnJlkJRPrzTMHt5KfG25fKl5n3o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/B7d6shpKegc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/5928677269596860278/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/01/logging-in-user-into-drupal-using-php.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/5928677269596860278?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/5928677269596860278?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/B7d6shpKegc/logging-in-user-into-drupal-using-php.html" title="Logging in a user into Drupal using PHP code." /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/01/logging-in-user-into-drupal-using-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4HRXg_eyp7ImA9WxBQGE8.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-6112871746930170952</id><published>2010-01-14T00:05:00.000-08:00</published><updated>2010-01-18T06:12:14.643-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-18T06:12:14.643-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drupal" /><title>Anonymous comment problem in Drupal</title><content type="html">Today I came across a unique problem. I was working on a Drupal website for one of my clients and there I was required to create a page to show testimonials for the site. For this very purpose I decided to use comments feature of Drupal.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The problem I came across is that writing comment was working perfectly, but the comments written by anonymous users were not being shown up on the page. I checked the permissions and also checked whether the comments are being added to the approval queue. But every thing went in vein. Every thing was correct, comments were being added to the database but neither being shown on testimonials page nor being added to approval queue. Finally after googling I found out the solution and it was interesting to know.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;First the fact about the Drupal&lt;/b&gt;: drupal uses a user, whose id is 0 as anonymous user.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Now the solution of the problem&lt;/b&gt;: You have to have a user with user id as 0 in your database. Otherwise it does not show any comments of anonymous users. So, if you are suffering from very same problem, then go to your database, browse users table and see if you have a entry as uid = 0 in your table. If not, then do one and the thing will start working.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Enjoy Coding!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-6112871746930170952?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uWfBrBb83xVf7aVlWmMEMtD8VXU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uWfBrBb83xVf7aVlWmMEMtD8VXU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uWfBrBb83xVf7aVlWmMEMtD8VXU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uWfBrBb83xVf7aVlWmMEMtD8VXU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/ctDAiEYt8Ik" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/6112871746930170952/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2010/01/anonymous-comment-problem-in-drupal.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/6112871746930170952?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/6112871746930170952?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/ctDAiEYt8Ik/anonymous-comment-problem-in-drupal.html" title="Anonymous comment problem in Drupal" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.dipak.org.in/2010/01/anonymous-comment-problem-in-drupal.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMFQ308eip7ImA9WxNXF00.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-3939925458937532395</id><published>2009-10-04T18:40:00.000-07:00</published><updated>2009-10-04T19:06:52.372-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-04T19:06:52.372-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="tips" /><title>A mysterious JavaScript keyword</title><content type="html">One day, I came across to know a strange keyword of JavaScript, which I believe that very few people would know about. This keyword is &lt;b&gt;&lt;i&gt;items&lt;/i&gt;&lt;/b&gt;. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That day my colleague told me that he is not able to run a fragment of code of JavaScript, even it is being well written. We both had a sort of brainstorming on the code and the outcome was surprising for us.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There were a variable called &lt;i&gt;items &lt;/i&gt;and the code was terminating itself there. When we changed the variable from &lt;i&gt;items&lt;/i&gt; to &lt;i&gt;nItems&lt;/i&gt;, the code was running perfectly. While it stopped running when changed the variable name back to &lt;i&gt;items&lt;/i&gt;. Then we concluded that it might be a hidden keyword of JavaScript.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;Note&lt;/span&gt;&lt;/b&gt;:&lt;/div&gt;&lt;div&gt;We checked the wikipedia for keywords of JavaScript and it says that "All Java keywords are reserved in JavaScript", but items is not there. We also found &lt;a href="http://www.quackit.com/javascript/javascript_reserved_words.cfm"&gt;this&lt;/a&gt; web-page, which has list of keywords, but the "&lt;i&gt;items&lt;/i&gt;" thing is also not there.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-3939925458937532395?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fnEO-af3bonl1ajWm_TYjfthpoo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fnEO-af3bonl1ajWm_TYjfthpoo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fnEO-af3bonl1ajWm_TYjfthpoo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fnEO-af3bonl1ajWm_TYjfthpoo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/V3zGZvbCgdc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/3939925458937532395/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2009/10/mysterious-javascript-keyword.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/3939925458937532395?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/3939925458937532395?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/V3zGZvbCgdc/mysterious-javascript-keyword.html" title="A mysterious JavaScript keyword" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.dipak.org.in/2009/10/mysterious-javascript-keyword.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIARX86cCp7ImA9WxJUGE0.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-8320165301848893236</id><published>2009-07-16T19:50:00.000-07:00</published><updated>2009-07-16T20:49:04.118-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-16T20:49:04.118-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="servlet" /><category scheme="http://www.blogger.com/atom/ns#" term="resource" /><title>5-steps for creating and running a Java Servlet program</title><content type="html">This tutorial gives step-by-step guide for creating and running a servlet program on windows platform.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Step 1&lt;/span&gt;: Create an application directory parellel to the ROOT directory under &lt;installation folder=""&gt;/webapps directory, here "demoApp". Also create "WEB-INF" folder under recently created application directory and a "classes" folder under "WEB-INF" directory.&lt;/installation&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Step 2&lt;/span&gt;: Create a new java file, here "demoServlet.java", and write this code inside this file:&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;import java.io.*;&lt;br /&gt;import javax.servlet.*;&lt;br /&gt;import javax.servlet.http.*;&lt;br /&gt;&lt;br /&gt;public class demoServlet extends HttpServlet&lt;br /&gt;{&lt;br /&gt;public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException&lt;br /&gt;{&lt;br /&gt;   res.setContentType("text/html");&lt;br /&gt;   PrintWriter out = res.getWriter();&lt;br /&gt;   String myName = req.getParameter("myname");&lt;br /&gt;   out.println("&amp;lt;html&amp;gt;");&lt;br /&gt;   out.println("&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Hello "+myName+"&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;");&lt;br /&gt;   out.println("&amp;lt;body&amp;gt;");&lt;br /&gt;   out.println("Welcome "+myName+"!");&lt;br /&gt;   out.println("&amp;lt;/body&amp;gt; &amp;lt;/html&amp;gt;");&lt;br /&gt;}&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Step 3&lt;/span&gt;: Create a web.xml file under &lt;application directory=""&gt;/WEB-INF directory. Put these configuration under web.xml file:&lt;/application&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_tWmIcWSBDVU/Sl_xw0yoU2I/AAAAAAAAApU/EPExMP4Zi0s/s1600-h/web_xml.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 272px;" src="http://1.bp.blogspot.com/_tWmIcWSBDVU/Sl_xw0yoU2I/AAAAAAAAApU/EPExMP4Zi0s/s400/web_xml.JPG" alt="" id="BLOGGER_PHOTO_ID_5359267902701196130" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Step 4&lt;/span&gt;: Compile the java class created in 2nd step using command prompt (javac demoServlet.java) from "WEB-INF/classes" folder.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Step 5&lt;/span&gt;: Browse "http://localhost:8080/newApp/demoServlet?myname=user" from browser. You will see an output, something like this screen-shot:&lt;/li&gt;&lt;/ul&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_tWmIcWSBDVU/Sl_s7NZKvbI/AAAAAAAAApM/UwJOJndiUiQ/s1600-h/sample_servlet.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 236px;" src="http://4.bp.blogspot.com/_tWmIcWSBDVU/Sl_s7NZKvbI/AAAAAAAAApM/UwJOJndiUiQ/s400/sample_servlet.JPG" alt="" id="BLOGGER_PHOTO_ID_5359262583545839026" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Here, I have assumed that you have Java Development Kit (JDK) and Apache Tomcat Server installed and configured on your machine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-8320165301848893236?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mZOebVnu3dUh93p-FVF3YIt7OJk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mZOebVnu3dUh93p-FVF3YIt7OJk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mZOebVnu3dUh93p-FVF3YIt7OJk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mZOebVnu3dUh93p-FVF3YIt7OJk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/en8wJ8LlVXw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/8320165301848893236/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2009/07/5-steps-for-creating-and-running-java.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/8320165301848893236?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/8320165301848893236?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/en8wJ8LlVXw/5-steps-for-creating-and-running-java.html" title="5-steps for creating and running a Java Servlet program" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_tWmIcWSBDVU/Sl_xw0yoU2I/AAAAAAAAApU/EPExMP4Zi0s/s72-c/web_xml.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2009/07/5-steps-for-creating-and-running-java.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IEQXszcCp7ImA9WxJXFE4.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-6974692712046874826</id><published>2009-06-07T20:25:00.000-07:00</published><updated>2009-06-07T20:25:00.588-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-07T20:25:00.588-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="success" /><category scheme="http://www.blogger.com/atom/ns#" term="planning" /><category scheme="http://www.blogger.com/atom/ns#" term="Recession" /><title>Getting a good salary hike in the time of slowdown</title><content type="html">It may be hard for a lot of people to even save their job in the hard time of recession. But still people can think of getting a good salary hike in these times. I am one of those fortunate people, who managed to get a salary hike n this hard time. For geting this hike, there was no fixed rule, but I followed some, and got the result. Here I wish to share them with you.&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Believe in yourself&lt;/span&gt;: The best formula to get success anywhere is first to believe in yourself. Unless you will have faith in your own abilities, no-one will bother to believe in you. Then believing in yourself gives you a lot of strength and inspiration to complete all the tasks, even tougher ones. If you will have faith in yourself, then only you can produce a good result in your work. Thus this is the first and foremost requirement.&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Be honest&lt;/span&gt;: Here being honest means being honest to your work. I feel that you cannot do justice to your work, unless you love your work. But just loving your work does not guarantee that you will be doing the work perfectly. And for making your presence felt in an organization, you need to work perfectly. Thus, be honest to your work and do full justice to it. This will give you an image boost in your organization.&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Work hard&lt;/span&gt;: Unless you will work hard, you will not be able to deliver what you are expected to. Specially in these tough times, when companies are laying-off people, you will sustain only by putting some extra effort to your work.&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Work smart&lt;/span&gt;: I firmly believe that only working hard does not pay, but working smart always pay. And if you could blend the two, you will certainly get the desired result.&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Deliver on-time&lt;/span&gt;: As per me, what your seniors want from you is a good output, that too in a given time-frame. In some cases, if you give some-thing, that error prone, but is being delivered on time, this helps your organization a lot. And if organization get some praise due to your timely work, it's a great reward for you. So, try putting those extra efforts in making the delivery on or before the cut-off time. I prefer keeping things ready before cut-off time, as this gives you some extra space to mend your unknown mistakes.&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Win trust of seniors&lt;/span&gt;: Finally the most valued point in these times. Try to win the trust of your seniors. If you could win over management, then that is the best thing for you to have. Since you could win over your seniors only by working hard and smart, this is prone to happen that seniors start trusting you in the course, when you are following the above points.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;I have followed the above points and got results, so hope these points help you as well. &lt;/div&gt;&lt;div&gt;With Best Wishes.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-6974692712046874826?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iieOswvk4JaT_yt5HTIihYWtmlw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iieOswvk4JaT_yt5HTIihYWtmlw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iieOswvk4JaT_yt5HTIihYWtmlw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iieOswvk4JaT_yt5HTIihYWtmlw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/eHGaldX71jM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/6974692712046874826/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2009/06/getting-good-salary-hike-in-time-of.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/6974692712046874826?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/6974692712046874826?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/eHGaldX71jM/getting-good-salary-hike-in-time-of.html" title="Getting a good salary hike in the time of slowdown" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2009/06/getting-good-salary-hike-in-time-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEBR349eyp7ImA9WxJXEE4.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-3210576523800875680</id><published>2009-05-30T03:58:00.000-07:00</published><updated>2009-06-03T06:10:56.063-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-03T06:10:56.063-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="New Technologies" /><category scheme="http://www.blogger.com/atom/ns#" term="Web technology" /><title>Remarkable developments on web this year</title><content type="html">&lt;span class="Apple-style-span"  style=" ;font-family:'Times New Roman';"&gt;&lt;div style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; width: auto; font: normal normal normal 100%/normal Georgia, serif; text-align: left; "&gt;This is going to be a great year for the web, as we are seeing a lot of new and wonderful developments in on the web. This all started with the launch of &lt;a href="http://www.wolframalpha.com/"&gt;Wolfram|Alpha&lt;/a&gt; and counting with the announcement of launch of new products like &lt;a href="http://www.bing.com/"&gt;Bing&lt;/a&gt; from Microsoft and &lt;a href="http://wave.google.com/"&gt;Wave&lt;/a&gt; from Google. So, here's a brief introduction to the new market hopper:&lt;/div&gt;&lt;div style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; width: auto; font: normal normal normal 100%/normal Georgia, serif; text-align: left; "&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;Wolfram Alpha&lt;/span&gt;&lt;/span&gt;: Rather than a search-engine  it is an answer-engine. It is an online tool to get answer of all your factual queries. It computes the answers of you queries directly from structured data, rather than providing link to sites, that may contain the result of the given query, like most search engines do.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;Yahoo Glue Pages&lt;/span&gt;&lt;/span&gt;: It is a specialized kind of search, where you get results of wiki, images, videos, articles and all other stuffs over a single page. It provides regular search results with option to other related stuffs.&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;Bing&lt;/span&gt;&lt;/span&gt;: This is going to be the upgrade of Microsoft's Live Search. The notable change in this version would be the explorer pane, based on semantic technology from PowerSet which gives the related search results.&lt;span class="Apple-style-span"   style="  line-height: 19px;font-family:-webkit-sans-serif;font-size:13px;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;Wave&lt;/span&gt;&lt;/span&gt;: It is proposed to be a perfect blend of e-mail, instant messaging, wiki and social networking. It will have live features in e-mails like instant messaging. That means e-mail is going to change for-ever. It will also have features of using documents with multiple users, that means a group of people can now work easily after the release of wave, which is supposed to come later this year, though there no word of release date from Google itself.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;So, I hope things are going to be interesting this year, specially in the field of web. Just wait and watch, what's in the store for all of us.&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-3210576523800875680?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pIjJW5bfWfjn-3R4INGLZc-I4iA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pIjJW5bfWfjn-3R4INGLZc-I4iA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pIjJW5bfWfjn-3R4INGLZc-I4iA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pIjJW5bfWfjn-3R4INGLZc-I4iA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/6Dwh5ovPo1U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/3210576523800875680/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2009/05/remarkable-developments-on-web-this.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/3210576523800875680?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/3210576523800875680?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/6Dwh5ovPo1U/remarkable-developments-on-web-this.html" title="Remarkable developments on web this year" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2009/05/remarkable-developments-on-web-this.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEBR348cCp7ImA9WxJXEE4.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-982165917069862765</id><published>2009-01-23T00:26:00.000-08:00</published><updated>2009-06-03T06:10:56.078-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-03T06:10:56.078-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><title>Code for adding JS Files at runtime and then executing Functions from currently loaded file.</title><content type="html">&lt;div&gt;&lt;div&gt;/*-------This works for IE and non IE as well----------------*/&lt;/div&gt;&lt;div&gt;var oScript = document.createElement("script");&lt;/div&gt;&lt;div&gt;oScript.src = fileName.js;&lt;/div&gt;&lt;div&gt;document.body.appendChild(oScript);&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;if(browser=="NonIE")&lt;/div&gt;&lt;div&gt;oScript.onload = function(){callAFunction()}; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;else&lt;/div&gt;&lt;div&gt;oScript.onreadystatechange = function(){callAFunction()}; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-982165917069862765?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-yswM9Ay7pNhoWwrDwN4kcYC_1w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-yswM9Ay7pNhoWwrDwN4kcYC_1w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-yswM9Ay7pNhoWwrDwN4kcYC_1w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-yswM9Ay7pNhoWwrDwN4kcYC_1w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/ADH9TXS1a9s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/982165917069862765/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2009/01/code-for-adding-js-files-at-runtime-and.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/982165917069862765?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/982165917069862765?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/ADH9TXS1a9s/code-for-adding-js-files-at-runtime-and.html" title="Code for adding JS Files at runtime and then executing Functions from currently loaded file." /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.dipak.org.in/2009/01/code-for-adding-js-files-at-runtime-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEBR34yeSp7ImA9WxJXEE4.&quot;"><id>tag:blogger.com,1999:blog-315558899505753448.post-7982745330117812720</id><published>2009-01-02T00:06:00.000-08:00</published><updated>2009-06-03T06:10:56.091-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-03T06:10:56.091-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="logout" /><category scheme="http://www.blogger.com/atom/ns#" term="asp .net" /><title>Handling logout (back button) for secure pages in asp .net (C#)</title><content type="html">It is a common problem in programming that if a user is logged in to a secure page and loggs out of that page. Then clicking on the back button of browser gets a user back to that secure page (regardless of the fact that the user has logged out of the page.)&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ideally, the secure page should bot be shown, in case the user has logged out of the page due to security concerns. I found it very hard to crack. But finally I got a magic function, that handles this problem perfectly. This code worked for me perfectly in IE 6.0, FireFox 2.0 and chrome 1.0.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The code is:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 153, 0);"&gt;//Put this line in page load event of the page:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;Response.Cache.SetNoStore();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;and&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 153, 0);"&gt;//Put this code, where you have to logout a user:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;Session.Abandon();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;Response.Redirect("Login.aspx"); &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you don't want to remove all the sessions on logout, then you can user below line to remove a specific session:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;Session["SessionId"]=null;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/315558899505753448-7982745330117812720?l=blog.dipak.org.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XGtXIFHhXAS8AfbYhnrbsv2uu-k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XGtXIFHhXAS8AfbYhnrbsv2uu-k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XGtXIFHhXAS8AfbYhnrbsv2uu-k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XGtXIFHhXAS8AfbYhnrbsv2uu-k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/diipak/~4/3sfi5XoQFy4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.dipak.org.in/feeds/7982745330117812720/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.dipak.org.in/2009/01/handling-logout-back-button-for-secure.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/7982745330117812720?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/315558899505753448/posts/default/7982745330117812720?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/diipak/~3/3sfi5XoQFy4/handling-logout-back-button-for-secure.html" title="Handling logout (back button) for secure pages in asp .net (C#)" /><author><name>Dipak Mishra</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-ssxN2GaJmbQ/AAAAAAAAAAI/AAAAAAAABDE/S2IwzxmvPv8/s512-c/photo.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.dipak.org.in/2009/01/handling-logout-back-button-for-secure.html</feedburner:origLink></entry></feed>

