RESTful web services
A RESTful web accommodations are predicated on HTTP methods and the concept of REST. A RESTFul web service defines the base URI for the accommodations, the fortified MIME-types and operations like POST, GET, etc.
JAX-RS...
jQuery Selectors are used to find out matching elements and select one or more HTML elements using jQuery and then perform operations on them.
Factory function is a synonym of jQuery() function start with the dollar sign and parentheses $(...
Hello Readers,
unwrap() is the jquery method which is used to removes the element of the parent of the selected or matched element in jquery and after that it returns the jquery object as a result.
Syntax :
$(selector).unwrap()
In ...
In one of my recent projects, I had to execute a bat file which was expecting one argument before execution.
Content of bat file was like this :
"%~dp0phantomjs.exe" "%~dp0..\examples\rasterize.js" "%1" "%~dp0twingle.jpg"
If you Analise t...
PDO is PHP Data Objects which is used to connect to any database. Benefit of using PDO is that if there is any problem in our query it has an exception class to handle it. If any exception thrown to the try block, the script stops and directly fl...
In my recent blog, I have written about the topic Natural Link Building & Attributes of Quality Backlinks, in which I described completely what is natural link building and what are ...
Convert a string to uppercase:
strtoupper() function is used to convert a string to uppercase. It convert all characters of string to uppercase.
Syntax:
strtoupper(string)
You have to pass only one parameter to the function i.e., th...
Hello Friends,
If you are looking to remove index.php from URL. By default Codelginter Path will appear like this "http://www.abc.com/index.php/users/userinfo", if you want to change this with "http://www.abc.com/users/userinfo"
//Replace y...
Convert first character to uppercase:
To convert first character of a string to uppercase we use a function in PHP ucfirst().
Syntax:
ucfirst(string)
This function includes only one parameter that is the string whose first character...
In openerp you make a request to read the assets while the transaction creating is not done and As the assets are generated during the same transaction and the rendering of the templates will call them. There is a scenario where the assets are un...
Aggregrate function is a function which returns single value by performing a calculation on a set of values.MySQL provides many aggregate functions such as AVG, COUNT, SUM, MIN, MAX, etc.
MIN returns the smallest value in a given column
MI...
Here is the exmaple for opening your HTML in a new tab with jQuery, first we define a function for the window in which we take variables for the tab (w) and for HTML (html) that will be opened in a new tab.
Then we define a click event from whic...
Hi Guys,
Here i am posting that how you can use image with color in background.
<div>
block {
background: #1e7f00 url("http://api.ning.com/files/rBZCY6X2uOlTJ8P9qLiTaHrX71x-bhRd9qAkTQBwNkSJPHtbC0Md09jy7l2JFbAGIWeexn8YrPUqqxKklZ5...
We can remove nil elements from an array in number of ways. Here i am demonstrating the frequently used methods for removing nil elements from an array.
1> using present method with reject
>> [ "a", nil, "b", nil, "c", nil ].reje...
Many of the wordpress themes are having options in admin panel for uploading and changing the logo. But if we want to make a custom logo that is used in converting HTML to wordpress or for making any custom wordpress theme or we do not have any o...
In this example I have a list of images that loads after getting the response. I want to preview the image which is clicked. So I am sending the images url and its unique id into the click function and then comparing the ids, display that image o...
Hello friends,
Most of time we need to create 2-D array in javascript but javascript does not provide direct syntax of multidimensional array . But we can create custom two-dimensional array in javascript.
For Example :
var myarray=new Arra...
Hello Friends,
If you are you looking to implement any Zend library in your development. Please follow the below example for the same. Here we are using mailing library in the below example:
1) Include library path as below
include '/def...
have a quiz script. My script contains quiz.js, getquestions.php, insertresults.php. In quiz.js:
var i = 1;
var sec = 20;
var timetaken = 0;
var answer;
var points;
var result = .5;
var score = 0;
var f = new Date();
var duration;
var...
cal_info() Function in PHP as the name suggests, is the function that returns the information about a particular calender that you have specified.
Syntax:
cal_info(calendar);
In above function there is only one parameter which is the c...
Hello readers, In this blog I guide you "How to convert XML to JSON using PHP"
Below is the 2 example converting XML to JSON.
1. example
$xml = simplexml_load_string($xml_string);
$json = json_encode($xml);
$array = json_decode($json,T...
To convert hexadecimal values to ASCII characters we will use a PHP function hex2bin().
Syntax:
hex2bin(string);
In above line we have a passed a parameter string in the function which is basically the hexadecimal value that we need t...
Hello Everyone today I guide you "What is the difference between isset and array_key_exists in PHP"
The below example helps you to differentiate between isset() and array_key_exists() .
isset() will only return true or false
array_key_exists...
Hello Readers,
parent() is the jquery method which is used to return the parent element of the given selector or the current element in jquery. We use parent() method without parameter as default but if we pass any parameter inside the parent(...
Hello Friends,
Some time we need implement custom mysql queries in CakePHP. If you are looking to implement custom mysql query in cake php please follow the below example:
// Define your query and replace this with query written below
$qu...
Ruby setter & getter methods are similar to properties used in .net. They are used to access the instance variables of a class outside the class using the object of the class. By default instance variables are only accessible inside the insta...
This plugin provides us some native dialog elements that are much more customizable than the browers dialogs.
There are some methods in it:-
navigator.notification.alert
navigator.notification.confirm
navigator.notification.prom...
Hello all,
While playing with of code, we came across a situation where had to show a pdf file in our html page and to do that, I found a very simple solution where showed the file by passing the file path to the src attribute of the iframe.
...
The mysqli_num_fields() function is used to display the number of fields in a result set. In other words, you can say that it returns the number of columns that is coming from a select query.
Syntax:
mysqli_num_fields(result);
In above...
Here we will learn how to filter multiple variable using the filter_var_array() function.It returns an array of values for all the requested variables else it will return FALSE if failed.
Example
$abcd = array
(
"firstname" =>...
<-- Chapter 24: SQL Aliases
Chapter 25
SQL Joins
SQL Joins clause are used to combine data rows from two or more than two tables according to common field values between them.
Lets see an examples from the below tables "customer...
Hi Readers,
If you are using Bootstrap in your application you should use modal to show popups in your web application. Modal is a very nice feature provided by the Bootstrap to show nice and beautiful popups which can be easily modifiable...
Hello readers, In this blog I will help you to know "What does keyword 'var' do in PHP ?"
It's regarding declaring class new member factors inside PHP4, and it will no longer needed. It'll operate inside PHP5, however it will increase an E_STR...
In openerp If the report is using a custom model to render its html and fallback on the generic html rendering. report is generates and returns html version of a new report.
use this function in your own module in .py file,
def get_html(...
Hello all,
While working on a project, we came across a situation where we had an iframe that had dynamic content inside it,
and to make our page responsive, we were not allowed to give fix height to the iframe, but since the iframe had th...
Hello Guys
Portlet preferences is use for layout setup in liferay.
Here, We have setup layout from controller of the custom portlet in liferay.
Follow the below steps to setup layout:
Step 1: add below lines in Liferay-portlet.xml
...
REPLACE INTO Statement:
It is used to insert a row in a table.It is similar to INSERT INTO statement but it does not allow duplicate row as it replaces the old one with the new one.
Syntax:
REPLACE INTO tablename (column1, column2, col...
In openerp render function returns the 'ir.ui.view' but embellish it with some variables/methods used in reports. param values is additional methods/variables used in the rendering returns is html representation of the template.
use this code sh...
Here I am posting that how to change the color of placeholder.
you can use the code below.
::-webkit-input-placeholder { color: red; }
:-moz-placeholder { /* Firefox 18- */ color: red; }
::-moz-placeholder { /* Firefox 19+
*/ ...
1. SQL WHERE Clause:-
SQL WHERE Clause is one of the most useful feature of the SQL query as it is used to specify a condition while fetching the data from single table or joining with multiple tables,it also allows you to select specific ...
In MySQL, DELETE and TRUNCATE both are used for deleting data from table.
DELETE
DELETE comes under DML(Data
Manipulation Language).
DELETE can
be used to delete a particular row
by using WHERE clause.
It is slower
than TRUNCATE as...
In python simple client program opens a connection to a given port 9876543 and given host. It is very simple to create a socket client using Python's socket module function. The socket.connect(hosname, port ) opens a TCP connection to hostname on...
Ruby also supports constructors like other Object Oriented Languages. Constructors are used to initialize the instance variables. In most of the Object Oriented Languages constructors has the same name as that of the class, and does not have any ...
In python simple server is Internet servers, we use the socket function available in socket module to create a socket object. After then a socket object is used to call other functions to setup a socket server. after this call bind(hostname, port...
Hello readers today I will guide you "To detect search engine bots using php".
Search Engine Bots:- Search engines refers to, generally people which make use of programmed software program providers referred to as spiders, crawlers, software i...
To display images from a directory randomly first of all we will give the path to the directory. Then we will select the directory. After that we will open the directory and will get all the files of the directory.
<?php
$Image_Path = "";...
In angular we are provided with date $filter that formats date to a string based on the requested format.
There are several formats.Some of them are :-
'medium': equivalent to 'MMM d, y h:mm:ss a' for en_US locale (e.g. Dec 4 201512:05:08 ...
Adaptive payment provides facility to allow payment between sender and multiple recievers.
Steps for adaptive payment are as follows:-
1 First need to create app for paypal.
Get username,passsword,applicationid and signature recieved fr...