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

Getting coming sunday from current date in Java

To get the coming Sunday from the current date or specified date, write the following code: public static Date getNearestWeekend(Date date) { try { Calendar c = Calendar.getInstance(); Calendar cal1 = Calendar.getInstan...

Getting distance between two locations by lat/long

You will get distance between two location easily by using below code. You will just need lat/long of both location for which you have to calculate distance. /** * Get distance of location between two locations * @param lat2 * @param lon...

Transitioning with Views

To make the app look elegant and impressive, the programmers implement some animations or in other words transitions to switch between views. These transitions are provided by the Xcode libraries and are very easy to implement and use. The step b...

In app purchase sample code for iOS apps

Import StoreKit.Framework into your xcode project first. Apple allows three types of purchases within the app and Apple terms them as consumables, non-consumables and subscriptions. Consumables are products that are consumed immediately. ...

Search Engine Optimization Process

This Blog is all about SEO Strategy and how it works for a particular website .First of all in this there is a need to know about SEO, SEO(Search Engine optimization) is a process of increasing the visibility of your website on various search eng...

ERROR: Error 1005: Can't create table (errno: 121)

Sometimes we get this error on creating table in MySQL.This error will come when we use the constraint with the same name that is already used somewhere else. If the table you're trying to create includes a foreign key constraint, and you've p...

Full Screen on Flex

Some time we need to apply the full screen in swf. The following code can be used for full screen. <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns....

Creating xml from SQL query

This blog will show you how to create an xml from sql query having sql data. Write down the followng query to generate xml:- WITH XMLNAMESPACES ('http://www.dossia.org/v2.0/xml/phr' as phr) Select OrderResultID,OrderID ,PatientID ,SpecimenNum...

Could not determine temp directory, please specify a cache_dir manually

"Could not determine temp directory, please specify a cache_dir manually" in Magento Some times this error occur when you transfer the code to your server. This error mostly occur with Shared Server. To Solve it follow the below steps - ...

Unbinding Model in cakePHP

Lets say there are two models named as User and Post. A User hasMany Post, so in our User model we have a relation like this :- class User extends AppModel{ var $name = User; var $hasMany = array(Post=>array(foreignKey=>user&#95;...

Set php file permission on Shared server.

If you are getting an error of 404 not found/503 Internal server error on shared server, while you running any php project or any php file . Then reset permission of your php file to 644 . For testing create a index.php file and print '...

How to check if your device is connected to Internet

We need to check if device is connected to Internet on making every API call (or call to Remote server). The function below returns true if device is connected to Internet. //**This function tells whether the device having an Internet connec...

Resizing and Rotating UIImage

We often need to rotate or resize images in iPhone apps. Attached is a demo project that uses a handy category for doing the same. How to use : Add UIImage+Extension.h and UIImage+Extension.m to project. Import UIImage+Extension.h in re...

Some basic animation examples in iOS

Here are some basic animation examples like : Fade in/out, rotate, zoom etc. How to use : Add Animations.h and Animations.m files in your project. Import Animations.h class. Invoke required class method in this way : [Animations ...

Using Email or Username to login with auth in cakephp

We seldom need to login into application using Email or Username while using Auth with Cakephp. To achieve this we either need to write customized Auth component or we can achieve the same with the following code : public function validateUs...

How to register your app on facebook

Please follow these simple step to register your app on facebook Open Developer account from your Facebook. Select "Create App" you'll be directed to a page where number of options will be available at the top bar. One can reach there by j...

Fetch All Notifications

Snippet to fetch all local notifications of the app. One can customize any notification and cancel the same. UIApplication *app = [UIApplication sharedApplication]; NSArray *eventArray = [app scheduledLocalNotifications]; for (int ...

Handling of HTTP in Angular

<html ng-app="phonecatApp" ng-controller="PhoneListCtrl"> <head> <script src="lib/angular/angular.js"></script> <script src="js/controllers.js"></script> </head> <body > <...

Slide-Out Navigation Panel

Slide-Out Navigation is quite popular nowadays. It enhances usability and gives a different look and feel to the app. Apps like Facebook, Path and many others use this feature. Attached with this blog is a nice library called SWRevealViewControll...

How to make http post request by passing xml using c#

Following function will expect a generic List and serialize into xml and make an http post request and after receiving response it will again deserialize xml into generic list:- public customer CreateOrder(customer objCustomerRequest) ...

Form submit in javascript

I would like to share an interesting feature that I found as I was trying to submit form through JavaScript. If you are trying to "form.submit()" through javascript and any form elements present with the name of "submit" in it, then in that case...

SEO Techniques and Its Business Value

What is SEO A three letter word SEO, seems to be very short but having so much worth in its significance. SEO stands for Search Engine Optimization which means optimizing websites for the search engines so that they can match the exact guidelin...

Working with triggers in mySql Database

A trigger is SQL code which runs just before or just after an INSERT, UPDATE or DELETE event occurs on a particular database table. Creating a Trigger: Consider we have two tables: CREATE TABLE `blog` ( `id` mediumint(8) unsigned...

How to Add Selector to the Button in Android

Adding Button Selector to add button selector to the button in the android xlm layout file, create a new xml file named button selector and use the following code : <?xml version="1.0" encoding="utf-8"?> <selector xmlns:andr...

UICollectionViews

A relatively new feature of iOS is the UICollectionViews. The UICollectionView allows the programmer to arrange the data into cells, which in turn can be arranged in grids. The photos in the photo gallery of phone can be seen in thumbnails, a...

Time Difference between two timezones - Php

Many a times we need to take out time difference between two time zone using Date class in php. We can use the following code :- $timeZone = ['Any Timezone']; $default = date("Y-m-d h:i:s A");// UTC $dateTimeZone =...

Internet An Effective Marketing Weapon

In the early stage of the nineties when the Internet has just reached our doorstep, then we considered it as much puzzled and useless thing, as it was a new technology to everyone and we all were not familiar with the basics of the interconnected...

How to download any CSV file while working with PHP

/* Header file to includes. fopen is use to open a file in write mode here. fputcsv function is use to output the CSV file having the name of columns and data coming from database. */ header('Content-Type: text/csv; charset=utf-8'); header('...

Knowing the "graph"

A histogram, You might have seen after you open Photoshop, using camera raw. Its a graph playing with color highlights and tones of an image. While it may be intimidating looking, histograms are nothing really all that complex. What they repres...

To add pause/stop functionality on mouse hover using easySlider1.7

To add pause/stop functionality on mouse hover using easySlider1.7 Step 1: Open easySlider JS file in editor like notepad, notepad++ etc. Step 2: Go to line number 56, and add below bold marked line. continuous: false, numeric: ...

Forming Tree structure in cakephp

Sometime you may need to form a tree structure from the values of the database table. For Ex- You may need to form a hierarchy of categories and subcategories like this: My Categories Fun Sport Surfing ...

Understand Drupal patches and apply them using git

Hi All, I was confused about how to implement patches into our Drupal modules or in other files. There is a way to apply these patches automatically. We have to install git bash and then we can apply available patches and as well as create new...

How to get Rounded Corner bitmap ?

In many android applications, we need to set rounded corner image in ImageView. The bad part is that ImageView does not provide any property for this. So for this the following method will help you get rounded corner Bitmap:- public static Bit...

How to display phone book contacts in iphone through coding

The following code will present viewController which will show all the contacts of phone book Please do add Addressbook.framework in your code. Also import AddressBookUI file to use the following code. ABPeoplePickerNavigationController *pic...

Sending custom emails in Magento Without Template

*It's simple to send custom emails in magento by using zend mail function with success and error messages see the following code * public function postAction() { $params = $this->getRequest()->getPost(); $re...

Redirect urls in magento with parameters

we can redirect urls in magento with parameters by using magento's default _redirect() function you have to create an array for parameters you want to use in url see the following example: $param = array( '_query'=&g...

How to Make A Simple DropDown in HTML With The Help of Jquery and CSS

You Can Use Below Code to Make A Simple Drop Down In HTML With The Help Of Jquery And CSS ***Jquery*** <script> $(function(){ $('.DropDown > ul > li').on('click', function(){ $('.DropDown ul ul').slideUp(); ...

Objective C coding style

Language US English should be used. Preferred: UIColor *myColor = [UIColor whiteColor]; Not Preferred: UIColor *myColour = [UIColor whiteColor]; Code Organization Use #pragma mark - to categorize methods in functional groupin...

How to set default value of column with datatype varchar to empty string

We usually face this kind of issue when we are doing programing with respect to a column with varchar data-type. If we don't add any value to a particular column it takes it as NULL. Thus forcing the developer to check for NULL every-time other t...

How to Use Priority and Severity in Bug Tracking Tool

The terms Priority & Severity are used in bug tracking to share the importance of the bug among the team & to fix it. Priority: The priority status set by the team lead & he is consulting with client as per project requirement. Pr...

How to save file in document dicretory

Following code will help you to add or delete file from document directory. -(NSString *)saveFileWithOldName:(NSString*)oldNameStr { NSArray *dirPaths; NSString *docsDirs; NSString *tempStr2; dirPaths = NSSearchPathForDire...

Date difference between two timezones in PHP

Here is a short function to get the difference between two timezones in PHP:- function diff(){ $date1 = "2014-02-27T20:00:00+04:00"; $date2 = "2014-02-28T07:20:00+08:00"; $diff = abs(strtotime($date2) - strtotime($date1));...

Get timezone from address or zipcode or address

Hi, We can get user's timezone if we have only address or zipcode of that user. First of all we need to get latitude and longitude then using these lat and long we can get timezone. However this is 2 step approach but it is much accurate becau...

How to fetch data from XML file and insert into SQL Database

Fetch data from XML file and insert into SQL Database Step1. Create a Stored procedure in Sql database which takes one input parameter and one output parameter which returns Success /Failure Create PROCEDURE [dbo].[SP&#95;Insert&#95...

How to filter hasMany related model records in cakePHP when using find function?

Lets say we have models User and Friend related by User hasMany Friend relation. If we are required to pull out all users along with their female friends then how do we do that? Usually people think like this : $this->User->find('all...

auto-fill drop-down options on basis of previous seclection

Following example illustrate filling state (province) drop-down on basis of country. Drop-down HTML <select id="countryDropBox"> <option value="">--Select Country--</option> <option value="1">India</option...

Communicating with server via API to get data

Occasionally the programmer needs to communicate with the server to send and receive data from the iPhone. Usually the communication is done to get data from the database that is in the server. To communicate with the server the programmer has to...

Getting address and city from lot/long in Java

This blog will help you in getting geographical information of any location by using latitude/longitude. By using Java API Geocoder, it is easy to get geographical information of any location. The response will be in JSON or XML format. Wri...

What is Leverage Browser Caching and how to use it.

Here is the brief explanation of Leverage Browser Caching and how to use it to improve website performance. When a web browser i.e. Chrome, Firefox, Internet Explorer, Safari etc displays webpage it has to load several things like css files, j...

zip/unzip file on linux server through command prompt

Create zip file of existing folder on linux server use below command - "zip -r folder.zip target&#95;foldername" To unzip an zip file - "unzip filename.zip"
1 254 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: