
Featured
-
How Regression Testing Detects Integral Errors In Business Processes
Humans are forever changing and evolving and so to
by kristina.rigina -
Get Display Banner Advertising Opportunity on FindNerd Platform
“Do you have a product or service that nee
by manoj.rawat -
Android O Released with Top 7 New Features for App Developers
Android was founded by Andy Rubin, Rich Miner, Nic
by sudhanshu.tripathi -
Top 5 Features That Make Laravel the Best PHP Framework for Development
Laravel is a free open source Web Framework of PHP
by abhishek.tiwari.458 -
Objective C or Swift - Which Technology to Learn for iOS Development?
Swift programming language is completely based on
by siddharth.sindhi
Tags
encode password before saving it to database
Hello Readers. Here is small code to encode password before it is saved into database.
Add the following code in your Model file User.php
App::uses('BlowfishPasswordHasher', 'Controller/Component/Auth');
class User extends AppModel {
...
Formatting date in different format in java
Formatting Date in java:
There is a predefined format for dealing with dates in java , but suppose if you want the date in some other format other than the default one then you can use the SimpleDateFormat class of the java.text ...
How to check and complete value of journal entry method in Odoo
If you want to check and complete value of journal entry method in Odoo follow the following code:
if 'account_id' not in vals or 'journal_id' not in vals:
raise UserError(_("It is mandatory to specify an account and a...
MVC Custom Authorize Attribute with Use of Enum
Hi All,
In many of our scenario's we need to use Authorize Attribute in our MVC project. The limitation of which is just that we can't use our custom user roles. What if we intend to use custom enum to Authorize some of our Action Meth...
Reset Password link code in cakephp
Hello Readers! Here is a cakephp code to reset your password.
Create a view reset.ctp and paste the below code to it:
<?php echo $this->Session->flash(); ?>
<div class="container">
<div class="midBlock clearfix"...
Manage old database to new database in PostgreSQl (OpenERP)
In OpenERP if users manage old database to new database and delete all record in old database and use this database in new financial year so using database query in Postgresql framework to manage database. This is very helpful for new financial y...
Forgot Password link code in cakephp
Hello Readers! Here is the code to send link to your email address when you click on Forgot Password link during login in cakephp.
Create a view forgot_password.ctp and paste the below code to it:
<?php echo $this->Session->flash...
Delegates in C#
Delegates in C#
1) Delegate is a kind of function pointer as we have in C or C++.
2) It holds the reference to a method.
3) Reference to a method can be changed at run-time.
4) We can add or remove reference to method using += and -= ...
How to set the expected payment date in Odoo?
If you want to set the expected payment data in Odoo follow the following code :
if vals.get('expected_pay_date') and self.invoice_id:
msg = _('New expected payment date: ') + vals['expected_pay_date'] + '.\n' + vals.get('intern...
Elements and Layouts in Cakephp
If we are required to Create elements and add it in layouts and views ithe can do it as In app/views/elements folder create an element file adminsidebar.ctp with the below code :
<?php
echo Hello Cakephp !!;
?>
Call t...
How to create and exchange rate difference journal entry in Odoo?
If you want to create and exchange rate difference journal entry in Odoo follow the following code:
rate_diff = rec.debit_move_id.debit / rec.debit_move_id.amount_currency - rec.credit_move_id.credit / -rec.credit_move_id.amount_currency
...
How to return the writeoff move.line which is to be reconciled in Odoo?
If you want to return the writeoff move.line which is to be reconciled follow the following code .
return writeoff_move.line_ids.filtered(lambda r: r.account_id == self[0].account_id)
@api.multi
def remove_move_reconci...
Ajax with PHP
Ajax codes are used to communicate between web pages and the server without loading the page.
lets demonstrate a search through ajax call with php
<html>
<head>
<style>
span {
...
How to watermark image usimg Qimage component in cakephp
For watermarking image using Qimage component in cakephp first we have to download Qimage plugin after downloading Qimage plugin we have to put it into App/Controller/Component .
Then we have to do all this in our controller....
How to make simulate animation in android
In the below example I have created simulate animation in android. Here I have added first TextView and ImageView in activity_main.xml layout ,In MainActivity I have used Runnable Thread. On this animation image will be rotate like watch. You can...
How to get right debit / credit in accounting module?
If you want to get right debit / credit in accounting module follow the following code .
target_currency = target_currency or company_currency
line_currency = line.currency_id or company_currency
amount_currency_st...
How to apply ir_rules by filtering out in Odoo?
If you want to apply ir_rules by filtering out follow the following code .
rows = self.env.cr.dictfetchall()
ids = [x['account_id'] for x in rows]
allowed_ids = set(self.env['account.account'].browse(ids).ids)
row...
How to put the invoice link and partner_id on the account_move ?
If you want to put the invoice link and partner_id on the account_move follow the following code :
invoice_id = fields.Many2one('account.invoice', oldname="invoice")
partner_id = fields.Many2one('res.partner', string='Partner', index=T...
INTERSECT Clause
INTERSECT Clause:
It works similar like union clause as it is used to combine two SELECT statements, but it returns tuples only from first SELECT statement which are common to tuples in the second SELECT statement.
Syntax:
S...
Sort php array by particular column
Hello friends,
Most of time we need to sort php array as ascending order or descending order but some case we need to sort array by particular column.
For Example:
Given Array:
$inventory = array(
array("type"=>&q...
How to check amounts in the partial reconcile table aren't signed or not ?
If you want to check amounts in the partial reconcile table aren't signed or not then follow the following code .
amount = abs(line.debit - line.credit)
amount_residual_currency = abs(line.amount_currency) or 0.0
...
How to change the label of a button on click event
Sometimes we need to change the label of a button on click event. Suppose you have button label as "Start" and you want to change that to "Stop" upon clicking start button.
Example: In the below example I've created a f...
How to remember username and password in cakephp using cookies
As we seen in login page if we click or check the checkbox of “Remember Me” then our login id will be remembered by the browser . This is done by using cookies .
our login form contain email field and password alo...
How to trace SQL query or SP on a page
HI Guys,
Some times we want to know that what SQL operation is running on a particular page or a event, then we have to debug our code base and we get the result, but it's time taking process to debug code line by line and as well as some ...
Beta Testing Mistakes
Beta testing includes sending the item to beta test locales outside the testing environment for real world introduction. Numerous people have come over beta testing in real life situations/circumstances – it could have been anythi...
How to override magento blocks
In this blog tutorial, i will explain how to override magento blocks using an XML- based configuration file. Config.xml is module configuration file in which we will override magento block.
As magento best practices, we should not change any cor...
Beta Test Management & Components for Beta Success.
Beta Test Management
There is a wide arrangement of activities your beta testers would be more than willing to bring an interest for with the target of upgrading your item.
The most typical activities are:-
...
Override Magento Controllers
In this blog post, i will explain how to override magento controllers.
As per magento best practices, we should not change any core files.
So, what we will do is, create a new module called My_Pant and then we will perform our task to overrid...
How to make Runnable Thread in android
In the below code I have created Runnable Thread program in android. Here first I have added TextView in activity_main.xml layout. In MainActivity I have used handler class then I have created a new Runnable interface , And I have also ...
Random Testing Or Monkey Testing
‘Random Testing’ is also called a ‘Monkey Testing’. Random testing is a kind of black box testing. We mainly focused in the functional testing on it. Generally random testing is executed when there is not sufficient time p...
Getting object values from json data
Getting object values from Json:
If you have a data in Json format and you need to retrieve the object values from that day, it can be easily done using Java.
Lets see an example,
If you are using maven add the following ...
Bug debugging in PHP
We do many wrong things while writing the program.
It rarely work on the first time.
PHP generate the error after finding.
We can send the error message to other place.
They can also be sent with other program output also.
Set the ...
Pass Element ID that Triggers `onclick` Event to the Event Handling Function
When we apply onclick event to an element, sometimes we need to pass ID of that element to the event handling function. We can do this by passing id to function as this.id or we can pass the element itself.
Example: In the below example I&...
How to Create excel files in php
Applications that are written in php most of the times need to export data for some purposes. In this tutorial, we will learn "How to export that data in Excel CSV fomat?" CSV is known as the EXCEL spreadsheet that have the data in a gr...
Getting current url in jQuery
Sometimes we need to identify which is the current URL of JSP page to perform some functionality. We can do this very easily by adding the below line in you on load function:
$(function(){
var url = window.location.href;
...
How to make ListView animation in android
In the below example I have created ListView animation in android. Here, first I have created ListView and Button in activity_main.xml layout and also added animation layout with in ListView. Then in Second step I have created list_anim layout wi...
Regular expression
Regular expression is basically a sequence of character.
They are used for pattern matching.
We can use these to match the string inside a string and can also replace the string by another.
PHP have two kind of regular expressi...
Var vs Dynamic Keywords in C#.
Var vs Dynamic Keywords in C#
1) Introduction of these keywords
var was introduced in C# 3.0.
dynamic was introduced in C# 4.0.
2) Variable initialization
When a variable is declared as var type then the variable i...
How to get path of function being used in PHP
Hello Reader's! if you want to get the name of function and method being called, Then by using PHP you can do this as explain below:-
Lets's see the example as below here we are using the info provided by a php exception, it's a...
How to get IP address of remote machine in PHP?
Hello Reader's if you want to make the tracking system of your website, then the best way is to get the records of the IP address from user. Getting the IP of remote of PC can done on various ways. PHP let you do this by using  ...
Creating object in Json format using java
Json object:
You easily write your object in json format with java . Json format is used because it becomes easy to exchange information in this form. It is easy to understand and easy to write.
Lets see an example,
If yo...
Magento Models Overriding
In this tutorial, i will explain how to override magento models using an XML- based configuration file. Models play an important role as they connect our application to database & implement most of the business logic.
we should not change an...
How to Make Forgot Password in Codeigniter
Many times the user forget their password which they opt at the time of registration, and the developer who is new in Codeigniter framework struggles to create this module. So, in this tutorial, I will guide you to make the forgot password module...
How to create components and use in cakephp
Hello friends,
Cakephp provides a utility packages of logic that are shared between controllers.You can also create your own components. If you find yourself wanting to copy and paste things between controllers, you should consider creating yo...
Storage Classes in C
The storage class in C are the one which defines the scope or life time of the variable and functions
Four Different storage classes of C are :
Auto
Register
Static
Extern
Auto Storage Class
Auto storage c...
How to integrate share on twitter button on website
Hello Reader's if you are developing product shopping based web portal in which you want to integrate the twitter tweet button, then this blog is very helpful to you.
To integrate the twitter tweet button you have to follow some step ...
How to make facebook share button on website?
Hello Reader's if you are developing the Ecommerce based website in which you want to integrate the facebook sharing option, then this blog is very helpful to you.
So lets start with the html doc.
To get Facebook sharing first you...
How to remove markers from Google Maps API?
Remove markers from Google MAPS API v3:
I was facing issues while removing all the markers from the Google map API. I know how to remove markers in Google Maps API v2 by :
map.clearOverlays();
Now the question is how to remove markers ...
How to make only digits validation for textbox using Jquery
Hello Reader's! if you are making the html form in which some textbox you only want as taking the digits only. Then in this blog you can learn how to make this digit type validation. Since now most of the website are providing the frontend ty...
How to replace localhost by project name from URL
Hello Reader's if you are working on single project and want to rename localhost to any other word then this blog is very helful to you.
So let's start with the following steps
Step 1 : Open httpd.conf file you can f...