Featured
-
How Regression Testing Detects Integral Errors In Business Processes
Humans are forever changing and evolving and so to
by kristina.rigina -
Get Display Banner Advertising Opportunity on FindNerd Platform
“Do you have a product or service that nee
by manoj.rawat -
Android O Released with Top 7 New Features for App Developers
Android was founded by Andy Rubin, Rich Miner, Nic
by sudhanshu.tripathi -
Top 5 Features That Make Laravel the Best PHP Framework for Development
Laravel is a free open source Web Framework of PHP
by abhishek.tiwari.458 -
Objective C or Swift - Which Technology to Learn for iOS Development?
Swift programming language is completely based on
by siddharth.sindhi
Tags
Implementing AFNetworking
AFNetworking is currently the most popular 3rd party networking library for iOS and OSX. The latest version of AFNetworking (2.0) is built on top of NSURLSession which is the new preferred method of networking introduced in iOS 7 (in place of old...
Storing and retrieving String[ ] Array using SharedPreferences in Android.
I came across to the many questions asking about to store some kind data in Shared-preferences such as String[] array. Many of these questions are answered with "Use a database".
But here i will show you a perfect piece of code by which you ...
PHP Script to import any excel database in MySql
Hello Friends,
If you want to import any excel sheet to your My SQL database you can use the following code below.
I have specified comments wherever needed.This is complete script and here you need to keep the classes directory with your cod...
Indexing in Mysql
Indexing is useful for faster searching of data. Suppose you have a product table in your database with more than 2,00,000 records, now when you search a record on basis of product name, it takes time too long. Now if you want to perform your sea...
Date base search in Mysql
Hello Friends,
Generally we need to do date based search in mysql like Get all the users registered in the last week, or last day, last month, last year. We have very good function of mysql DATE_SUB(). Lets get some the example below:
1) Se...
Convert HTML string to Plane NSString
Hi Friends, Sometime in API responses we get html strings. To get pure string from html string this code will help you.
NSString *htmlStr = @"html String";
NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
NSDict...
How to detect screenshot taken by user in iPhone.
With the help of the notification "UIApplicationUserDidTakeScreenshotNotification" in our application we can detect the screenshot taken from iPhone.
Use the following line of code to generate notification for same.
[[NSNotificationCenter def...
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 :
...