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

Get iPhone contacts for any label in Objective C

Sometimes we do not get other label's contact number from the iPhone device. We only get "Mobile" labelled number or "iPhone" labelled number. Here is the code to get all type of labels contacts from an iPhone device. Inside the loop where we ...

How to Make a new CSV File Through PHP Script.

This tutorial show's how to create a new CSV file through PHP script. This script is more helpful for php developer to create a new CSV file in array formate. function functionname (parameter) { if (($handle = fopen("$data", "r")) !== ...

Setup Virtual Host

As the name suggested, Virtual Host is a technique to create a virtual URL of a website. For example on the local server we generally run a project like http://localhost/xyz but if you want to run this project like http://www.xyz.com on your loca...

How to Run Mysql Server on Safe Mode?

MySQL is an open source database software which is used for storing data. Some time we need to run MySQL Server on safe mode. Please follow the below commands one by one to run MySQL server on safe mode. 1) First of all you have to stop MySQL ...

URL encoding in ios

Hello all, I was facing problem with loading URL in UIWebVIew because of wrong encoding method. After that I tried this code. It helped me. - (NSString*)encodeURL:(NSString *)string { NSString *newString = NSMakeCollectable([(NSString *...

Customize commit editing style delete button in UITableViewCell

Hello All, Following lines of code will customize the delete button in UITableView editing style. This is an override method of UITableViewCell which is called when UITableView goes in editing mode. So to customize the delete button in UITable...

Make file private in drupal 7

To make file access by permission in drupal 7, use 'private_files_download_permission' module. This module provide features to drupal developers to download files by specific roles. For example:- In my requirement,there are multiple resume in a f...

Custom redirection in drupal 7

Hello All, From the given blog below you will get to know about redirection of any form after submission or custom $form_state['redirect] in drupal 7:- First you need to override form_alter by usind drupal hook function hook_form_alter. To...

Static Import in Java

INTRODUCTION: Static import in Java allows to import static members of class and use them, as they are declared in the same class, means access any static member of class directly without using class name. Like regular import statements, stati...

Autoboxing & Unboxing in Java

INTRODUCTION: The automatic conversion made by the Java compiler between primitive types and their corresponding object wrapper classes, is known as Autoboxing It allows us to use primitive and object type interchangeably in Java on many p...

Get current location on load of a page using google map API

A code snippet for getting current location on browser using google map API Here we are calling getLocation() on load of the page getLocation(); function getLocation() { if (navigator.geolocation) { n...

6 useful code chunks for java coders.

Convert Java util.Date to sql.Date This piece of code shows how to convert a java util Date into a sql Date for use in database. java.util.Date util_date = new java.util.Date(); java.sql.Date sql_date = new java.sql.Date(util_date.getT...

Add product to cart in magento programmatically

Hello All, To add product to cart I followed the below code and its work for me - For this you need to pass parameter - product id as $param['pid'] & customer id as $param['customerid'] try { $product = Mage::getModel('c...

Some keyboard shortcuts in Xcode

Xcode provides many keyboard shortcuts that can save our lot of time. Here is a list of few shortcuts that you might want to try out: cmd+shift+o Open quickly ctrl+cmd+left arrow Go Back ctrl+cmd+right arrow Go Forward ctrl+cmd+up Jump to N...

How to run sql queries using JSTL

Run sql queries using SQL tag in JSP We can run SQL queries directly in JSP page using "sql" tag. Suppose we have a 'postgres' database, with below credentials: db:'test' user: root password: 123 table name: user which have a column 'us...

Upload Screen Shot to server

Most of the apps or games allowed to the user to upload his screen shorts on the server for latter user. Today I am going to show how to upload screen shot to server in Unity3D. private string url = "www.mysiteURL"; Texture2D screenShot ...

Login Scene With Unity3D

Most of the Apps or Games required Login scene. Login in any App or Game should be secure from the hackers. Today I am going to show how you can use Login in Unity3D. It is secure and very fast process for the login. private string url...

Smoke Testing

Testing the basic and critical features of an application before proceeding with deep rigorous testing to make sure that there are no blocker bugs and the build is testable or not is known as smoke testing. Whenever a build is installed,its a go...

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...
1 251 269
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: