Hello everyone,
From past day I am trying to get Skype indicator on top right tray of my screen.
I tried the below command to install indicator:
sudo apt-get install sni-qt:i386
And restarted system, but it didn't worked.
Some ...
why we use array_values() function in php ?
The array_values() function use for returns an array which have all the values of an array.
you can see below example:
<?php
//firstly create a array of a city detail
$Citydetail=array(...
Sometimes we need to display some alert or dive after some period on Web page.
We can do this by using setTimeout method as below:
<html>
<head>
<title>Demo to show div</title>
<script type="...
Whenever we submit a form or do some task, we usually display a success message, but sometimes it is required to hide this message automatically after some time period.
We can do this by two ways:
By using setTimeout method:
...
Hello guys
Here, I am creating custom roles in liferay 6.2. I have three (i.e vendor, client and standard user) roles to create in liferay portal and assign them permissions, So we need to create "regular" roles.
Step 1: Create custom roles ...
For safety reasons in many application we need to restrict a user from capturing screen shot of a screen or an activity.
In Android, we can easily restrict a user by applying FLAG_SECURE
//Restrict screenshot
getWindow().setFlags(WindowMana...
To check product quantity in openerp
You have to write this function in .py file to check product quantity in product module and relate his to
the inventory management. See code given below
def check_product_quantity(self, cr, uid, product,...
Hello guys
Here, I assign custom created roles to user from custom portlet in liferay 6.2.
I create three regular roles i.e vendor, client and standard user from liferay portal.
Now, I assign the role to particular user from liferay portl...
If you display content to your users, you should also be able to erase it. This is done via the destroy() method.
greeting.destroy();
First thing you see on destruction of a widget is calling destroy() on all its children. Then comes remova...
In database, sometimes we have to insert the record with some NULL values. But at the time of displaying the data to the user, it doesn't make sense to display NULL values. In order to make the data more readable, we have to display values such a...
You can use function constructor along with new keyword when you want to define your function dynamically. Function constructor accepts any number of string arguments.
This is the syntax for it:
var variablename = new Function(Arg1, Arg2......
If you want to widget parents and Children in OpenERP(Odoo) follow the below mentioned code and paste it in your wizard .js file:
local.HomePage = instance.Widget.extend({
start: function() {
var greeting = new local.GreetingsWi...
If you want to adding a class to their root elements in OpenERP(Odoo) follow the below mentioned code and paste it in your wizard .js file:
local.HomePage = instance.Widget.extend({
className: 'oe_petstore_homepage',
...
});
local...
If you want to use greetingswidget in OpenERP(Odoo) follow the below mentioned code and paste it in your wizard .js file:
local.HomePage = instance.Widget.extend({
start: function() {
this.$el.append("Hello dear Odoo user!");
...
In below example, I have written Python script to remove 'provision' from selection list when configuring Cash Flow Codes. Paste below python code in .py file :
def fields_get(self, cr, uid, fields=None, context=None):
res = super(accoun...
We can add or remove a class to an element very easily by using addClass() and removeClass() methods. To do this on keyup event of a textbox we just need call these functions when we bind keyup event to textbox.
Example:
<input id="sear...
In order to get the TimeZone, we have TimeZone class in android.
For getting TimeZone of a device do the following steps:-
Step 1
Create an Object of Calender
Calender calender = Calendar.getInstance();
Step 2
Get TimeZone object by ...
How to show checkbox selected using MVCCheckBoxList in Asp.Net MVC
In my previous blog I have discussed about how to use MVCCheckBoxList. Please visit the following link for reference:
MVCCheckBoxList in Asp.Net MVC
Issue:
The problem w...
To reset the auto-increment values you can apply any one of the method given below:
Auto increment value can be reset by using alter table statement. Syntax to reset auto-increment value is as follows:
ALTER TABLE table_name AUTO_INCREM...
We have two methods and features to display content.
1-format the widget's data
2-display the widget
The HomePage widget already has a start() method. This method is part of the normal widget lifecycle and it is automatical...
Sometimes we need to enable/disable a button based on some condition. We can do this easily by using "disable" attribute of a button.
Example:
<button type="button" id="voteButton">vote</button>
To disable a button write t...
On the server side, we can simply defined an ir.actions.client. In below code we will use .xml file.
<record id="action_home_page" model="ir.actions.client">
<field name="tag">petstore.homepage</field>
</record>
...
A client action is an action type defined almost entirely in the client, in javascript for Odoo web. The server simply sends an action tag and optionally adds a few parameters, but beyond that everything is handled by custom client code.For examp...
To retain the selected value in the dropdown on refresh, sessionStorage is used to store the value within the user's browser. First, the values have to be set using sessionStorage.setItem("SelItem", selVal); SelItem is a variable in which we are ...
How to modify the PetToysList component so clicking on a toy replaces the homepage by the toy's form view in OpenERP/Odoo ?
If you want to modify the PetToysList component in OpenERP(Odoo) so that when you click on a toy it replaces the homepa...
To refresh a function after a particular time interval to refresh the values on the page.
We can do this by using setInterval() function on page load.
Write the below code where refresh() function will be the function that you want to refresh...
The action manager can be invoked explicitly from javascript code by creating a dictionary describing an action of the right type, and calling an action manager instance with it.
In below example I have written javascript to Include only parent ...
Here I have created and example of Touch Listener Image. In this example a image can pull left, right, up and down easily. It can be used to shift your mobile app icon left and right. For this in below code I have used MotionEvent() method. Below...
In ios when we want to show a route or poly line between two coordinate then we use the following function.
most of time we use this when we want to dislplay the route from current location to destination address.
Here mapView is the property...
How to bind RadioButton using Enum in Asp.Net MVC
For binding RadioButton using Enum in Asp.Net MVC, we have to follow the following steps:-
Step1: First create the Model class say 'RegisterationModel' in the Models Folder for the RadioBut...
You can use PHP to take backup of a table in MySQL. For this, you need to write the following code:
$dbhost = 'localhost';
$dbuser = 'dbusername';
$dbpass = 'dbpassword';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
...
In php you can include the content of one PHP file into another PHP file using the following statement:
include statement:
It will produce a warning if the file is missing or uable to load the file and the script continues to execute.
Syn...
Sometimes we need to refresh web page after a particular time interval to refresh the content present on that page.
So we can do this easily by writing the meta tag in the page source code:
<meta http-equiv="refresh" content="60"/>
...
What is use of time() Function in php ?
Php time() function basically use for returns a current unix timestamp. In which, you can utilize the date() function to format it to your desiderata.
You can see below example of time() function...
It limits the value range which is mentioned in column.
Example of check constraint
CREATE TABLE Persons
(
PId int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
CONSTRAINT ...
Sometimes we need to focus a textbox on button click based on some condition. We can do this by using focus().
Example- Suppose I want to focus search-box on button click if the search-box is empty, then we can do this as below:
<input i...
We can simply add an iscroll in our page so that the scrolling becomes smooth in iphone. You simply need to download the js file and inject it into your HTML.
Here is an example code:
<html>
<header>
<h1 class="...
If you want to drag your element from one point to another, here is the code below using Javascript:
HTML:
<div id="dragElement">Drag me!</div>
CSS:
#dragElement {
width:100px;
height:100px;
background-color:#66...
What is addslashes() function ?
The addslashes() function basically used to returns a string with backslashes before characters that need to be quoted in database queries.
Mostly it is used for predefined characters, addslashes() function i...
HTML title tag is must for Search Engine Optimization and it gives title to your web page.
The HTML title tag must be used inside the head tag.
The title of the page is displayed on the title bar of the browser.
Example
<!DOCTYPE htm...
Hello Reader's! if you are new to wordpress development and need to add more custom fields in category, Then you can learn it from the code below:-
Step:1-
Open the file functinon.php and add the following code in it.
add_action( 'category...
Call stored procedure in JPA : Here I am going to tell you that how you can call the stored procedure using JPA entity manager. Following is the example to call stored procedure using entity manger.
Suppose we have a stored procedure called 'g...
Hello Readers
The below is the difference between the static website and the dynamic website:
Static website is a site which is used using HTML. In this each web pages is a static type means separate document there is no use of databases ...
Hello Readers
Javascript has three kind of popup boxes:
Alert box
Confirm box.
Prompt box.
Alert box: If you want the information comes through the user then we use the alert popup box.
Syntax of alert box:
window.alert("som...
How to use CheckBoxList in Asp.Net MVC
For using CheckBoxList in Asp.Net MVC, we have to follow the following steps:-
Step1: First download the CheckBoxList from Nuget, Once it is downloaded we can see the reference of MVCCheckBoxList in ...
If you want to change the enter key to search key, here is the code to get the same:-
Step 1:- In your xml file add the following EditText
<EditText
android:id="@+id/ed_search_key"
android:layout_w...
Superglobals variables in php are the built-in array. They are available in every scope. You can access the superglobal variable inside and outside the methods.
PHP Superglobals variables:
$_COOKIE
contains values provided to the scri...
If you want to use WebServices
in OpenERP(Odoo) follow the below mentioned code and paste it in your WebServices XML-RPC
file:
import xmlrpclib
define HOST, PORT, DB, USER, PASS
url = 'http://%s:%d/xmlrpc/common' % (HOST,PORT)
sock = ...
If you want to make wizard execution
in OpenERP(Odoo) follow the below mentioned code and paste it in your wizard views_xml
file:
<record id="action_idea_cleanup_wizard" model="ir.actions.act_window">
<field name="name">Clean...