Image Sprites in CSS

Image sprites is a collection of different images in a single image. image sprites can can be used in html page for showing different images seperately and help us to increase our image loading time. Any Web page with multiple images generates th...

Javascript DOM -document.getElementById( ) Method

This method is used to get the elements after given specified id. Using this method we can get value from the input text field. But before to get value from input field , we need to define id for the input field. Syntax: document.getElement...

How to insert form data using Wordpress

Hello Reader's! If you are new to wordpress and looking for the method to insert form data into table, Then you can use the Wordpress liberary code to do that:- <?php global $wpdb; $wpdb->insert('wp_custom_user', ...

Pointers in C

C has an interesting and powerful feature of pointers. It differs it from other languages. As the name suggests it points to something. Whenever we declare some data type it holds some memory. If we define a variable ptr then, &ptr is the add...

REST in Rails

REST, is REpresentational State Transfer which provides the appropriate way of heterogeneous application-to-application communication. REST consists of principles that define how Web standards, such as HTTP and URIs should be used Five key pr...

isNaN() And isInfinite() in Java

isNaN() and isInfinite() methods in Java are the member functions of the java.lang.Double and java.lang.Float classes. Both the functions here are static member functions of the classes. NaN here stands for the Not-a-Number, it specifies wheth...

How to get data from dictionary and add them into an array in ios

If you want to get data from dictionary and add them into an array below code will help you, In this blog firstly i have created a NSMutableAarray and after that created a NSArray which contain the value like ram,13 etc then i created a NSMutable...

Create a dictionary which contain an array

To create a dictionary which contain an array below tutorial will help you. In this blog firstly we create a NSArray which contain some value and after that I have displayed all the value and then created a NSMutableDictioary and provide a key t...

How to convert Json Object into Json Array

Hello Reader's. If you have a json object and you need to convert it into array then you just need to write the code below, and you will get the array converted format. var obj = {"0":"1","1":"2","2":"3","3":"4"}; var arr = []; for (elem ...

add touch event to UIView

To provide some action on touch of any view ,UITapGestureRecognizer is used. Write this code in viewDidLoad - (void)viewDidLoad { [super viewDidLoad]; myView.userInteractionEnabled = YES; UITapGestureRecognizer *singleFingerTap = ...

How to change HTML tags using Javascript

Hi If you want to change the tags of HTML with another tags then you can perform this action using JS in realitme. Let's consider and example to change the <h2> tag with <i> using JS. <h2 class="xyzxterms" style="cursor: defaul...

How to bind a Dropdown without using Model in Asp.Net MVC

How to bind a Dropdown without using Model in Asp.Net MVC For Binding the Dropdown without using Model, we have to follow the following steps:- Step1: Firstly in the Controller create an instance of List<selectlistitem> and add items ...

How to read properties from property file in jsp?

Create a property file in the package with extension '.properties' and use those properties defined in the file in jsp by importing the resource bundle package in the jsp. Example: config.properties name=tom email=tom@gmail.com phone...

Dynamically adding ListViewItem to Listview

To dynammically add new elements into listview we need a Edittext(etAddItem) to input the item/element, a Button(btnAdd) for adding item to the list, and a listview which shows elements in a vertical scrolling manner. etAddItem = (Edit...

How to select from subquery using Laravel Query Builder?

Sub query is one the important section of database query.There are n number of situation where we want to implement sub query to fetch the data from the table. In Laravel 4.x there is no specific keyword to perform any sub query.To perform sub q...

Laravel 4: how to run a raw SQL?

There are n number of situation where we want to write complex query so It is very difficult to write complex query using Laravel.So to overcome such problem Laravel provide raw query option. The syntax of writing raw query is:- Syntax: DB:...

Allowing user to select same day date using foundation datepicker

While using foundation datepicker we came across on issue while picking date for the same day i.e if today is 5th then user was not able to pick it from calender as it was disabled. The issue comes when you are in timezone that is in - of UTC : ...

Setting up Laravel on a Mac php artisan migrate error: No such file or directory

I have all code in github and my project is running properly in Ubuntu system . I want to run and set up my Laravel project on a Mac and I am getting error "No such file or directory" when we write the command php artisan migrate ...

What is the best place to load JS in html

Hello Reader's!, If you need to know which is the best place for putting the JS. You can put the js functions in the head part. But it'll be a good habit to put all of your functions in a separate file. You can also call for the external script...

Introduction and Basic Overview of JavaScript "Strict Mode"

Introduction: Strict Mode is one of the new feature introduced in ECMAScript5 edition. Strict Mode is a group of the language that remove disfavor features. The Strict mode is not mandatory, it means that if we want o...

How to detect if caps lock is on/off

Hello Reader's, If want to make alert when the upper/lower case letter key is pressed. Then by using Javascript you can see it in the code below:- $('#cap').keypress(function(e) { var s = String.fromCharCode( e.which ); if ( s.toU...

logging SQL queries

AJAX request runs a RAW parameterized Postgres SQL Query after receiving request Suppose we have a situation like that Here's my situation in my php view file, I make AJAX request to the server The AJAX request is received and runs a...

Odoo View inheritance

Instead of modifying existing views in place (by overwriting them), Odoo provides view inheritance where children "extension" views are applied on top of root views, and can add or remove content from their parent. Code like below-> <rec...

How to add minutes in a given date using Javascript

Hello Reader's, If you need to add some minutes to a given date, Then by using Javascript you can use as follows:- var d1 = new Date (), d2 = new Date ( d1 ); d2.setMinutes ( d1.getMinutes() + 50 ); //adding 50 min to the date alert ( d...

Difference Between WebService And API

Hello Readers There is difference between webservice and API. A Web Service is basically a type of API, which always operates over HTTP though some (like SOAP) can use alternate transports( like SMTP). An API is a (Application Programming I...

How to refresh a List in Android?

1)Write activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent...

form_for in Rails

It is a Rails helper method that shows forms on the view For example, while Rendering a partial form: <%= form_for([@post, @post.comments.build]) do |f| %> <div class="field"> <%= f.label :commenter %><br /> ...

Freeze TextView text while restore fragment from Backstack/ onOrientationChange

Some time TextView lost text while getting fragment from Back-stack or when screen orientation changed. I also faced that problem. Here is the solution for save state of TextView forcefully. Add Tag android:freezesText="true...

Odoo Model inheritance

Odoo provides two inheritance mechanisms to extend an existing model in a modular way. The first inheritance mechanism allows a module to modify the behavior of a model defined in another module: 1. add fields to a model, 2. override...

Relational fields in Odoo

If you want to make relational fields in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file: - name = fields.Char(string="Title", required=True) description = fields.Text() responsible_id = fields.Many2...

How to get mouse swipe input in Unity 3D?

Moving objects on Mouse swipe is a very interesting way of getting user input , it is very different from traditional approach of getting input from keyboard keys . It provids user with unique experience and makes user part of the game. Belo...

How to print featured image in wordpress

Hello Reader's! If you learning the wordpress and want to show the contents of a page from admin panel. Then you can use the code below:- First you need to publish the page with it's title, content and a featured image. Now open the page and...

Relations between models in Odoo

If you want to make relations between models in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file: - <pre>name = fields.Char(string="Title", required=True) description = fields.Text() class Session(model...

How to check user current notification setting in objective C

hello friends , You can check user's current notification setting by following line of codes. // this method is deprecated in iOS 8.0 UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; i...

Cordova plugin InAppBrowser

Hi All, Today we will discuss in this blog how to use InAppBrowser in your Cordova Application. -InAppBrowser is a web browser view in a Cordova application that displays when calling window.open() function. To use the functionality in your C...

How to create a UILabel & UIButton programmatically in Swift

hello friends, this is how we can create a UIButton and UILabel in swift. Set a UILabel in swift var label = UILabel(frame: CGRectMake(100, 100, self.view.bounds.size.width, 50)) label.center = self.view.center la...

CakePHP Folder Structure

After downlaoding and extracting CakePHP folder, one should see the following files and folders: app cake vendors plugins .htaccess index.php README Three main folders in which one will usually work: 1.The app folder is one...

Blur Effect on screen in iOS

To add the blur Effect on screen please follow the below steps Select an image on which you want to add the blur effect. Add an imageView on screen with the size you want blur effect on screen. Add the effect with the same size on which yo...

Migration in Ruby on Rails

Migrations comes up with the convenient way to alter your database in a structured and organized pattern. it makes use of Ruby DSL so no need to write SQL statements, allowing your schema to reflect changes independently. Anatomy of Migrat...

Working with MathML in HTML5

MathMl is a easy way to insert math symbols, expressions and formulas into your web page. The supported browser can convert them to numeric values and symbols. To start writing the math code you have to use <math></math> tag for creat...

Bundling in Asp.Net MVC

Bundling in Asp.Net MVC What Bundling is actually:         It is a process of grouping files into a Bundle, so that they can be loaded through one HTTP request and can be referenced by a unique Bundle Name. Need of B...

How to make Action Bar in Android?

Here I have created Action Bar in android. In android Action Bar is used to provide navigation and perform some actions. In this blog I have implement a Action Bar in my Android project and perform actions such as switching fragment. Below ex...

Base URL in Wordpress

Hello Reader's! In wordpress you can use the base url as written below <?php echo bloginfo('template_url'); ?> Lets take an example:- If you want to link the CSS <link rel="stylesheet" href="<?php echo bloginfo('temp...

How to create menu using Wordpress

Hello Reader's! If you are new to WordPress and you have to create the menu for first time. You just have to do the steps below:- Step1:- Open or Create a file functions.php in your theme folder and paste the code below:- add_action( 'after...

Website Development: 10 PHP Programming Mistakes Web Developers Should Avoid!

Source: www.finalwebsites.com PHP as a scripting language has gained immense popularity among web developers who strive to ensure that their websites are attractive and have a great functionality. Its because of PHP that developers are ab...

CakePHP request Cycle

When a user requests a page or a resource then the CAKEPHP request cycle starts. It can be explained with the below diagram: Let's now discuss the request cycle diagram with steps: 1.The request is redirected to webroot/index.php ba...

Diiference Between C and C++

Basic difference between C and C++: C C++ C follow procedural programming language C++ follow procedural and object oriented ...

How to get size of a file using HTML 5

Hello Reader's! If you are looking for an HTML 5 validation which tell user the size of an file the code will help you:- In HTML fileL <input type="file" id="file" /> In the JS file //binds to onchange event of your input fiel...

How to detect a textbox's content has changed

Hello Reader's If want to detect if text box value changed the alert box open to user. Then you can perform this function by using the Javascript. The function is written below:- $(function() { var content = $('#txtbox').val(); $...

How to make a simple file reader using Javascript

Hello Readers, If you developing the website to browse any file and showing its's content on the web page, Then by using Javascript you can do this as follows:- function readSingleFile(e) { var file = e.target.files[0]; if (!file) { ...
1 202 292