How to Add Skype Indicator in UBUNTU System?

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 ...

How to utilize array_values() Function in php ?

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(...

How to show div after some time period with jQuery?

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="...

How to hide a message after some time interval with jQuery?

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: ...

How to create roles in liferay

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 ...

Restrict device to capture screen shot

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...

How to check product quantity in openerp

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,...

How to assign role to user in liferay

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...

How to use destroying widgets in OpenERP/Odoo ?

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...

Mapping NULL values onto other values

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...

Function() constructor in javascript.

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......

How to use widget parents and Children in OpenERP/Odoo ?

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...

How to adding a class to their root elements in OpenERP/Odoo ?

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...

How to use greetingswidget in OpenERP/Odoo ?

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!"); ...

How to remove 'provision' from selection list when configuring Cash Flow in Odoo

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...

How to add/remove class to an element on keyup event with jQuery?

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...

How to get TimeZone in Android

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

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...

Reset Auto increment values in mysql

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...

How to use display content in OpenERP/Odoo ?

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...

How to enable/disable a button with jQuery?

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...

How to use ir.actions.client code in OpenERP/Odoo ?

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> ...

How to use client actions in OpenERP/Odoo ?

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...

How to retain the selected value in the dropdown after page refresh ?

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 in OpenERP/Odoo ?

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...

How to refresh a function after a particular time in jsp?

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...

Cordova + IOS

How to add Sqlite plugin using command prompt in iOS + Cordova app

How to use the action manager in OpenERP/Odoo ?

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 ...

How to make Touch Listener Image in Android.

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...

Show a route between two coordinates using MKMap view in iOS

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

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...

How to take backup of a table in MySQL using PHP?

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); ...

include and require statement in php

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...

How to refresh a web page after a particular time?

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"/> ...

How to use time() Function in php ?

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...

SQL CHECK Constraint

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 ...

How to focus a text box on button click in jQuery?

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...

How to add an iscroll on a page for smooth scrolling?

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="...

Drag and drop using Javascript

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...

How to use addslashes() functionin php ?

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

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...

How to add custom field in wordpress for category

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...

How to Call Stored Procedure using Entity Manager in JPA

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...

Difference between Static and Dynamic site?

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 ...

Javascript popup boxes

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

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 ...

How to change the enter key to search key in soft keyboard

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...

Superglobal Variables in PHP

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...

How to use web-services in OpenERP/Odoo?

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 = ...

How to make wizard execution in OpenERP/Odoo?

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...
1 194 292