Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

How to pass the method name as argument string

Sometime we don't know name of the method at compile time. So pass the method name as argument and use the following lines of code. NSString *methodname=@"calltest"; SEL aSelector = NSSelectorFromString(methodname); NSInvocation *inv = [NS...

Using a dispatch semaphore with block

Blocks are a language-level feature, which allow us to create distinct segment of code. there are three way to recognize the semaphore. dispatch_semaphore_create => creates a semaphore with initial value dispatch_semaphore_signal => i...

Enumeration in Java

INTRODUCTION An enum type in Java is a special data type that is defined whenever you need to define a variable with a set of predefined values such as Days of the Week, Months of the Year, items in a menu, etc. KEY POINTS ABOUT ENUM ...

How to stop scrolling of a scrolling UITableview programmatically

When we are having multiple tableviews with a common datasource we must make sure that only one table view is being reloaded at a time. We cannot load data on one table while other is scrolling as it would invoke datasource methods for the scroll...

How to invoke action on UISlider drag release

We might face situation where we need to do something after slider is released. This may be some code that takes a bit long to execute or makes a request to server or invokes a secondary thread or any such code executing continuously with slider ...

ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint

This error generally comes when we want to delete child table row. To solve this problem we have to disable the foreign key checks. SET FOREIGN_KEY_CHECKS=0; Now you can fire your query. DELETE FROM TABLE WHERE ID = 'Somthing'; You can ena...

Open CSV and PDF file in your application

Add following line of code in your Plist file to open CSV and PDF file in your application. Please note that UTTypeIdentifier should be unique. <key>CFBundleDocumentTypes</key> <array> <dict> ...

Regression Testing

Re-executing the old test cases across multiple releases or built to make sure that changes or bug fixes has not affected the existing functionalities is known as regression testing. 5 Strategies should be remember while doing regression: ...

Custom right bar button in UINavigationBar

Hello friends,This code is to make custom right bar button in UINavigation bar. it helped me to make custom right bar button in UINavigation bar, Hope this will help you too. UIButton *homeButton = [UIButton buttonWithType:UIButtonTypeCustom...

Detect device orientation and set UI according to orientation dynamically.

Hello Friends, these lines of code will help you to detect device orientation and set UI dynamically according to orientation. - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { NSLog(@"rotate");...

Push Notification in iOS

iOS Push Notification Tutorial:- Note:- Start following steps and dont do anything else. There are so many Gotchas while creating certificates but dont get confuse and follow these steps. Step 1:- Generating the Certificate Signing Req...

Load url in UIWebView.

Hello All, Following lines of code will help you to load url in UIWebView and make it fit to IPhone screen. In .h file IBOutlet UIWebView *webView; In .m file [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@...

Play videos sequentially using MPMoviePlayerController

Hello All, Sometime we want to play all videos of gallery sequentially. These lines of code will help you to play videos sequentially using MPMoviePlayerController.it worked for me. In .h file.. MPMoviePlayerController *moviePlayer; in...

To check that internet is available or not.

Hi Friends, sometimes we face problem in internet connectivity, With the following lines of code we can check whether we are connected to internet or not. - (BOOL)isNetworkAvailable { CFNetDiagnosticRef dReference; dReference = CFNe...

Draw a route between two annotation point on MKMapView

The following lines of code helped me to draw a route between two Annotation point in MKMapView Hope this will help you in your coding CSRouteAnnotation* routeAnnotation = (CSRouteAnnotation*)self.routeView.annotation; // only draw o...

Cloud Testing

Cloud Testing: In Cloud Testing we uses virtual environment on cloud. There are many companies which provide cloud testing environments in the market. In cloud testing we can use different virtual testing environments on single machine like Wi...

How to encode and decode NSString

Following method will encode and decode NSString. Characters to leave unescaped (NULL = all escaped sequences are replaced). - (NSString *)URLEncodedString { CFStringRef url = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (...

Truncate text using CSS3

Hi , If anybody needs to truncate the text without any server side script then it is possible using css3. We just need to add following css to container of text: text-overflow:ellipsis; overflow: hidden; width: 200px white-space: nowrap; ...

What is servlet ?

Servlet is very powerful server side scripting language. It is a class which basically handle network request-response model. It is very powerful as we had earlier like CGI. Basic Request-Rsponse Model When browser send http request to jav...

How to hide title bar and status bar in android

In many application we need to hide the title bar of Activity/Fragment Activity. For this we need to add following line in onCreate() method before calling setContentView() requestWindowFeature(Window.FEATURE_NO_TITLE); Example:- publi...

Increase the number of search results in OpenERP

Its sometimes very tedious and time consuming to search for a product or a partner or anything by typing and still not getting the desired result and then you have to wait for the Search More wizard. To compensate this, I have got a solution, ...

JScript: Verify if the given text is present in the Putty Console window

Hi All, Below you can find the code to verify if the given text is present in the Putty Console window. Function require three parameters i.e. Object of putty, the text to verify on console and the position to search for the text( Here the allow...

Types of Mask in Photoshop (part 4)

Hey guys, Welcome back to "Part 4 - Types on Mask in Photoshop". In this Blog i am gonna tell you about Quick Mask. OK Let's get started. Question 1: How to apply Quick Mask? Quick Mask is simply a Mask, but slightly different from prev...

Multithreading in Java

Multithreading is the process of running two or more threads executing altogether within a single program in Java. Before understanding this let me first explain what threads exactly are. A thread is a light-weight process that runs independen...

Code to validate ISBN10 or ISBN13

We seldom need a code to check whether the ISBN of book we are trying to search is a valid ISBN or not. So as to validate a provided ISBN we can use the below code for ISBN10 and ISBN13 respectively : Code for checking validity of ISBN10 : ...

Quartz +Spring Integration

It seems today every application needs background jobs, here we are going to learn how to integrate Quartz Scheduler with Spring. Version we are using Spring 3.x Quartz 1.8.6 Maven 3 we have to follow few steps for configure qua...

How to get sorted NSArray of date for NSDictionary.

With the help of following code you can sort the given dictionary containing key as Date. @implementation NSMutableDictionary (SortingNSMutableDictionary) -(NSArray *)getAllSortedKeys{ NSMutableArray *array = [NSMutableArray arrayWithA...

Unexpected bheaviour of in_array in PHP

We have an associative array where its values are all Boolean and if we search for a string, we got true. Lets see an example. <?php $array = array( 'count' => 1, 'references' => 0, 'ghosts' => 1 ); var&#95;dump...

How to rotate and zoom a view using UIGestureRecognizer

Rotating and zooming a view is a pretty simple task. This blog shows how rotate and zoom a view by implementing UIPinchGestureRecognizer and UIRotateGestureRecognizer. 1. Add pinch and rotate gesture recognizers to the target view. (Gesture ...

How to save a class on Parse

Hi guys , Here is a quick help of saving a class on parse cloud. Download Parse FrameWork. Import it. ParseSave.m NSMutableDictionary *dict=[[NSMutableDictionary alloc]initWithObjectsAndKeys:[data objectForKey:@"Id"],@"Id",[da...

How to drag(pan) a view on iPhone screen using UIPanGestureRecognizer

To drag a view we can either use the touch methods of UIViewController or we can use UIPanGestureRecognizer. UIPanGestureRecognizer is much easier and simple to implement. This blog explains how to use it. Add pan gesture to the view (or any...

Types of Mask in Photoshop (part 3)

Hey guys, Welcome back to "Part 3 - Types on Mask in Photoshop". OK Let's get started. Question 1: what is Vector Mask? Vector means a path or shape which will not lose the quality if we increase or decrease its size. The vector Shapes...

Update cart quantity not working in magento

Issue to update shopping cart quantity in magento - To solve the issue go to your theme's cart.phtml file find the form tag then add <?php echo $this->getBlockHtml(\'formkey\') ?> after start form tag like...

How to filter an array

Sometimes we might need to filter a list of records. For instance : We have an array of employees and we want to get all employees who live in the city Dehradun. Here is the structure of Employee class : @interface Employee : NSObject @p...

How to check the Network availability for 3G and 4G connection

Following code will help in you to check the network availability for 3G and 4G connection const char *host&#95;name = "google.com"; BOOL _isDataSourceAvailable = NO; Boolean success; //Creates a reachability reference to ...

Laravel Framework

Recently Laravel framework has been launched in the market as I am not familiar with it, because still I have not worked on this framework but it seems to be one of the best MVC framework, below link provides you an average of mostly used/popular...

How to Create Line Items in DFP

Hello all, Below is the process to create Line Items in DPP (Double Click for Publishers), To create a line item first you need to create an order if the order is already created then you don't need to do that, else every time whenever you hav...

Getting location from latitude and longitude

If we have latitude and longitude with us and we need to get location name out of that from google api then we need to do the following code; public function findlocation($lat,$long){ $url&#95;data = 'http://maps.googleapis.com/maps/a...

Passing extra data with push notification

Sometime we do need to send additional data while sending Push-notification on iPhone , this can be easily achieved by adding following line to your code. But one should keep in mind that apple does have a limitation of 144 character while sendin...

How to create dynamic UITableViewCell for Chat

Following code will help you to create dynamic UITableViewCell w.r.t to its content of message. -(void)setChatData:(ChatMessage *)messageObj memberDict:(NSDictionary *)memberDict isCurrentUser:(BOOL)isCurrentUser{ NSDictionary *user...

Why eBooks Are Changing Reader's View?

An electronic book is commonly known as eBook or Digital Book. Printed books are always been familiar to all the people from a very long time, as everyone from his/her childhood to older ages are involved in reading books whether it is related to...

Full Text Search

Full Text Search is a way to provide faster search on your website. Suppose you creating a website for a newspaper where lots of article written on various subject and now you want to fetch all news related to word Modi. Full text search is ideal...

Types of Mask in Photoshop (part 2)

Hey guys, Welcome back to "Part 2 - Types on Mask in Photoshop". OK Let's get started. Question 1: How to Apply Layer Mask? Well, It is simple. I have an Image on layer 1 and on the next layer i have written my name "ABHISHEK". I wan...

Types of Mask in Photoshop (part 1)

Hello Friends !! If you are familiar with Photoshop then it is well and good. If you are a fresher then don't worry, Today i gonna tell you about Mask and types of Mask. Ok now the question arise "What is Mask??" Question 1: What is Mask? ...

Import Phonebook contacts in Objective C

Get the complete list of phonebook contacts inside the app. We need to add two frameworks before proceed. Goo to Build Phase and Add these two:- #import < AddressBook/AddressBook.h> #import < AddressBookUI/AddressBookUI.h> ...

Create and Import a List In MailChimp

How To Create & Import a List In MailChimp? You can create as many lists as required in your MailChimp account, but if you're looking to target specific audiences depends on your company business, It would be best if you manage one list. ...

Read/Write able paths on Unity iOS and Android

Read/Write able paths on Unity iOS and Android Most of the users are always worried about the path on which they can write data at runtime. Sometimes we need to save screen shorts, or text files in our game or app. So there I am going to g...

Open multiple skype account in Ubuntu 13.19

Hi All, I was searching for multiple skype window in linux (Ubuntu 13.10) and found lot of options but they are quite complicated for beginners. I found a post and found a simple and working option: 1: Open run window (Alt+ F2 or direct cli...

MailChimp (Email Marketing Service Provider)

MailChimp (Email marketing service provider) MailChimp is an email marketing service provider, founded in 2001 or we can say that its is a web-based email marketing service which helps us to design email newsletters, share them on social netwo...

How to Increase the quality of an Image

BEFORE AFTER Hello Friends, In this blog i want to show you, how you can increase your Image quality with minimum Efforts. ok so lets get started !!! Steps Open an image which you want to enhance. Now make a copy of that...
1 275 292
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: