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

How to create form in CakePHP ?

We can create form by using FormHelper class in Cake PHP. For Example: Create file register.ctp in (/app/view/users) directory. <?php echo $this->Form->create('User', array('controller'=>'users', 'action'=>'login)) echo...

How to share in whats app from Android application

Using Android Intent system we can share on whats app from our application. Whats App application have listeners that listen to intents to share media and texts. Simply create an intent to share text, for example, and WhatsApp will be display...

Abort the current XMLHttpRequest in AJAX?

For this operation we have a function abort(). Here is the process code. var xhr; xhr = $.ajax({ url: 'ajax/userDetails/user_id/3', success: function(data) { console.log(data); } }) fn(); //Abort the Ajax...

ir.model.fields in OpenERP/Odoo ?

ir.model.fields provides information about the fields of Odoo models and allows adding custom fields without using Python code. model_id: Many2one to ir.model to which the field belongs name: the field's technical name (used in read or write) ...

load text file content from assest folder to textview

If you want to read some file from assest folder of your project then first you have to get assest folder file named read.txt. InputStream class is used to read data or content from file, network or from memory, we can also use this input stre...

Closures in javascript?

Whenever we defined a function within another function, the inner function has accessibility for the variables in the outer function. Following is the example of closure. function mainFunction(outerData) { var mainFuncData = 3; ...

ir.model in OpenERP/Odoo ?

ir.model provides information about Odoo models via its various fields. such as name : a human-readable description of the model model : the name of each model in the system state : whether the model was generated in Python code (base) or by c...

How to use md5() function in php ?

What is utilization of md5() function ? MD5 stand to Message-Digest Algorithm, and MD5 is widely utilized in security-cognate applications. It Calculates the MD5 hash of str utilizing the RSA Data Security, and returns that hash. So, b...

How to delete records in OpenERP/Odoo ?

Records can be deleted in bulk by providing their ids to unlink(). For example code like below. models.execute_kw(db, uid, password, 'res.partner', 'unlink', [[id]]) check if the deleted record is still in the database models.execute_kw(db, ...

read phone call logs in android

Android provides Cursor interface to get all calls logs. A cursor interface provides read-write to get the result set by database query. Here stringOrder query will access phone calls date wise in desc order. Cursor loader basically perform q...

HABTM in cakephp?

HABTM stands for Has And Belongs To Many. Its is a cake php associations that we defined in a models for accesing associated data across different entities over the database tables. Example - A product have more then one tags, and in the s...

CakePHP built-in sessions

CakePHP have several In-built sessions configurations. We can use these sessions as the basis or can create a fully custom solution for that. To use defaults inbuilt sessions, we can simply set the defaults key to the name and can override any s...

Include a JavaScript file in another JavaScript file using jquery?

We can achieve this using javascript or using jquery.Below methods demonstrate it. Method 1: Use any JavaScript to include another js file. Step 1: Add following function in your page. function includeScript(url) { var head = ...

How to update records in OpenERP/Odoo ?

In update records can be updated using write(), it takes a list of records to update and a mapping of updated fields to values similar to create() .for example code is like below. models.execute_kw(db, uid, password, 'res.partner', 'write', [[...

redirect http to https in Zend Framework?

For redirecting http to https, please follow the below steps :- First - Please Open .htaccess file from /public OR /public_html. Second - Add below code in opened .htaccess at the top. RewriteEngine On RewriteCond %{HTTPS} off RewriteR...

Including files in PHP

In PHP there is a feature which allows to write code in a different file and call it where ever there is a need for executing the code. this can be done by using the include and require functions. with the help of the these two functions we ca...

PHP $_SERVER superglobal variables.

$_SERVER is a PHP super global variable which holds information about headers, paths, and script locations. The example below shows how to use some of the elements in $_SERVER. <?php echo $_SERVER['PHP_SELF']; echo "<br>"; echo ...

How to read records in OpenERP/Odoo ?

In record data is accessible via the read() method, which takes a list of ids (as returned by search()) and optionally a list of fields to fetch. ids = models.execute_kw(db, uid, password, 'res.partner', 'search', [[['is_company', '=...

How to get count records in OpenERP/Odoo ?

In count records retrieve a list of records and count them, search_count() can be used to retrieve only the number of records matching the query. It takes the same domain filter as search() and no other parameter.For example code is like below. ...

Why to use CakePHP ?

Code generation: CakePHP Framework generates the code automatically using the bake command which enable the developer to execute the bake command. Database: programmer is not required to write Insert, update, select & delete queries becaus...

Event Loop in node.js?

As we know that , Node js is a single threaded application but it also support concurrency based on concept of event and callbacks. Every api that we are doing using node.js are asynchronous and single thread,node js uses asynchronous fu...

How to get device local ip address ?

Every android device has a local ip address and we can easily get that ip address for our backend purpose like we can save that ip address to our server. In below method NetworkInterface is a interface that provides many methods to get device ...

Facebook SDK for PHP

Hello Readers , The following code demonstrate how you would accomplish common tasks with the Facebook SDK for PHP. This SDK can be use in facebook login , Retrieve a user's profile , Post a link to a user's feed. window.fbAsyncInit =...

How to make Advanced Adapter in Android.

If you want to create Item view function check below example. In the below example I have created a Advanced class. By using Advanced adpater many opretions can be consumed. In Advanced adapter we can easily use view holder method. Adapter call t...

How to use str_replace () function in php ?

What is utilization of str_replace () function ? there are 3 main uses of str_replace () function in php. 1-str_replace() function supersedes some characters with some other characters in a string. 2-str_replace() Supersede all occurren...

Get Android device Model programatically

The following method can help you to find device manufacturer name and model name. To get these details Android provides Build class to get system properties like Build.MANUFACTURER returns the device build name. Build.MODEL returns the model ...

error-first callback in node.js?

If user pass errors and data then we use Error-first callbacks .There are two argument in callbacks. first argument is always an error object which is for to check if something went wrong. and we use additional argument along with this paramete...

How to use strpos() function in php ?

What is the strpos() function ? The strpos() function searches for a concrete text within a string. In other word we can say that strpos() function use for searching position of Text Within a String. If text word match will found, th...

Download a file programatically

In Android we can download a file from a given url so that we can use that file's data without downloading again and again so we save that file in internal or external storage of device. you can use this method to download your file, you have ...

Foreach in reverse order

We can use array_reverse function to invert the values of array.This way we can allow them to get reverse order. Ex : - $data = Array( 'ProductA', 'ProductB', 'ProductC', 'ProductD', 'ProductE' ); foreach ( array_reverse(...

Exceptions in CakePHP

CakePHP uses the exceptions internally to show the logical cake PHP errors. All of the exceptions that occur in CakePHP raises a CakeException. CakePHP is also having the number of exception classes that we can use for HTTP errors. For con...

Html Helper in CakePHP

If you want to make your page more reliable ,then Use HtmlHelper instead of html tag in your (xyz.ctp). CakePHP Helper will enable your application more light & flexible. By using these HtmlHelper ,we can create well formed markup in our Cake...

How to change the action overflow menu icon

To change the action overflow menu icon first you need to create a style for the overflow icon in which you need to set the new icon then use this style in your app theme. Step 1 Create a style for your menu overflow icon in styles.xml and set...

Enable curl in xampp?

For this modify the php.ini files in your xampp folder.These three file you have to change to enable curl library with XAMPP in Windows Browse and open these 3 files C:\Program Files\xampp\apache\bin\php.ini C:\Program Files\xampp\php\php....

How to perform TinyMCE Form Submission

Whenever textarea is replaced by TinyMCE, at that time it will hidden and TinyMCE editor which is an iframe is display in place of this. When we make standard form submission then it is handled by TinyMce. But in case of Ajax form submission,w...

How to use user defined function in PHP ?

Firstly let us know What is the user defined function in php ? This function declaration starts with the word "function" and user defined function name is not case-sensitive. User defined function starts with a letter not a number. Use...

How to use arsort() function in php ?

What is tht arsort() function in php ? The arsort() function sorts an associative array in descending order, as reported by the value. why use arsort() function in php ? arsort() is fundamentally used when sorting associative array in ...

Difference between ArrayList and Vector

Hi, It is one of the important topics in java. For dynamically resizable array we use ArrayList. ArrayList provides us fast access as compare to simple array. 1. As we go to synchronization, Vector is synchronized means at a single time o...

Difference between HashSet and TreeSet

Hi, I am explaining the difference between HashSet and TreeSet in Java. First of all they both come from the same family. They implement the Set Interface. In HashSet, values store in random order. That means it is not sure that the ele...

How to get the current Cordinate in OpenERP/Odoo ?

For current cordinate we have to add a button resetting the product's coordinates to the location of the user, you can get these coordinates using the javascript geolocation API. Now we would like to display an additional button to automatically...

How to show the cordinates on Google Map in OpenERP/Odoo ?

To Add two fields to product for storing a latitude and a longitude, then for this you have to create a new form widget to display the latitude and longitude of a product's origin on a map. Displaying the two position fields and a map widget usi...

How to get data from rss feed in android

RSS simply means Really Simple syndication, this is a xml document which is created by a website. You need to parse this xml file and show the information:- Here is the code that can help you :- Step 1:-Declare the variable of which you wa...

Ways to get data from one page to another page in PHP?

Hello Readers In php there are many different ways to get the data from one page to another page in php. Using session by passing values between pages: This is the one of the method to get the data from one page to another page in php and...

How to Create a transit location with company_id in odoo-9

To Create a transit location with company_id being the given company_id. This is needed in case of resupply routes between warehouses belonging to the same company, because we don't want to create accounting entries at that time. For this use thi...

Generate Dynamic Table content by using form fields in AngularJs

Generate Dynamic Table content by using form fields in AngularJs We all know that "AngularJs" is adopting vastly. We already found so many example of AngularJs and Application in AngularJS. We had created an example of "AngularJs" relate ...

How to create a color field in OpenERP/Odoo ?

To create a Field Color class, the value of this field should be a string containing a color code like those used in CSS. This color field should display in block whose color corresponds to the value of the field. In read-write mode. For more see...

How to make read-write field in OpenERP/Odoo ?

In Read-only fields, which only display content and don't allow the user to modify it can be useful, but most fields in Odoo also allow editing. In the write field the Abstract field class sets a widget property named effective_readonly. The fie...

How to create Account Analytic Line class to compute the line in odoo-9

To create Account Analytic Line to compute the line and inherit the class account_analytic_line in odoo-9 then write this function in .py file in your module in odoo. Use this code show in given below def _compute_accountanalytic(self, d...

How to use asort() function in php ?

What is tht asort() function in php ? The asort() function sorts an associative array in ascending order as reported by the value. why use asort() function in php ? asort() is fundamentally used when sorting associative array where the...

How to split Sublime editor into multiple screens

We can split sublime editor into 2 or more screen in any one of the following 2 ways :- I am going to tell you how to split it into 2 screens, using the similar way you can split in into more than 2 screens also or vice-versa. 1>...
1 174 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: