For authenticating the user via spring security we need to make our own custom authentication-provider. We can make our custom UserDetailService easily, here is the sample custom code
MyUserDetailsService.java
package com.users.serv...
User can give read and write access permission to a folder in linux using below steps:-
Press(ALT+CTRL+T) open terminal(console).
run this command on console:
Sudo chmod -R 0777 Folder name
Note:
Use absolute path for folder nam...
This tutorial will help us in learning how to create error pages in apache. We can customize the error pages based on different error codes that is writen in Apache server's Directive ErrorDocument
Follwoing are the Three digit error code:
...
MongoDB - Javascript function
$where operator : It uses to either a string containing a JavaScript expression. The full JavaScript function also used in the query system. This feature available after MongoDB version >= 2.4.
List of prop...
MongoDB - $exist and $type operator
$type operator : It matches values based on their BSON type.
e.g. We want to fetch documents from the collection which contains the value of "city" is only null.
db.collection.find( { "city" : { $typ...
MongoDB - $in and $or operator
$in operator : It match a value within the specified values within the given values.
e.g. If we want to select record which credit score is (1200 and 2000).
db.collection.find({"creditscore" :{$in :[1200,2...
MongoDB - Regular Expression
In MongoDB if we need to find record with certain pattern, then we can use regular expression. It is also "like" query in SQL.
e.g. If we want to find user email matching with "findnerd.com" pattern.
db.colle...
MongoDB - Sorting
In any application we need to show list in certain order. Generally we show's user feeds in descending order. This can be achieve in MongoDB through "sort" properties.
e.g. We need to sort student name in ascending order....
It is possible to create more than one entry point in spring security by assigning the different roles here the code script configuration of springsecurity-context.xml.
springsecurity-context.xml
<beans:beans xmlns="http://www.springfra...
MongoDB - Limit with Skip
Often we need to implement pagination in any application. We can use "limit" with "skip". "skip" will select record from given index.
e.g. We need to find 10 record started form 10th index.
db.collection.find()....
MongoDB - Skip Query
Sometime we need to find out certain number of record after a certain number of record.
e.g. We need to find out 10 record start after 10th index
db.collection.find().skip(10).pretty();
It is equivalent in SQl: ...
MongoDB - Limit Query
Sometime we need to find out certain number of record. In MongoDB we can achieve this through "limit" option.
e.g. We need to find 10 record from any collection.
db.collection.find().limit(10).pretty();
It is e...
Why waste those precious few milliseconds to type in or to find the "Notepad" or "Paint" icon when you suddenly need to store some text-snippet or an image while browsing. You can simply use your browser as a text-editor by typing (well, type onc...
Android provides some features to store and retrieve data of an application. SharedPreferences is one of the simple and easy way among them.We save data in key, value pair.
We have to call getSharedPreferences(), It returns the SharedPrefr...
It is answer to the questions like
a- how to verify address of partner in openerp
b- how to correct address entered by user
We need to verify and valid address in several cases like for - shipping ad...
If you want to change or edit the label in module in OpenERP, follow the below example.
EXAMPLE:- change label like that in product form change label of list_price(Sale Price ) to list_price(Max Price) in product.product
.xml file-
&l...
In my previous article we talked about benefits of using MVC. MVC is a buzzword these days in IT industry. If we talk about a generic MVC pattern,currently it is used in every language available.
Some of the examples include:
1-Cake PHP
2-Rub...
About AvaTax->
Global companies know that outsourcing key business functions like payroll and tax compliance makes good sense. Avalara AvaTax automates Value Added Tax (VAT) calculation directly within your accounting software. Whether yo...
I have as issue in which socket.io is not starting on any iPhone device. I have searched for it and went through some solutions but nothing worked. Here are some issue links:
https://github.com/Automattic/socket.io/issues/976
http://www.cod...
Cakephp cache used to store cache of entire layout and views. It store cache in tmp/cache/views/ folder. for use cache helper we need to use the below code in our controller
var $helpers = array('cache');
and we can also give cache time ...
This Video Tutorial will guide you To Get Started With Android.
First Download the Android Studio from below link:
https://developer.android.com/sdk/index.html
Follow the steps from mongodb official site for installation of mongodb .Here I will talk about mongodb 2.4 for ubuntu 12.04 and we will keep our database file in the Amazon EC2 EBS(Amazon Elastic Block Store) volume.
Create the data directory...
Some time we need to pass a tabular form data to our database.
one option is to using loop in Datatable and on every iteration we have to make a Database call.
But this approach is not too good and also it's a time taking and decrease our appli...
Draw Stroke Text in HTML : In this article i will show you how we can draw Stroke Text in HTML canvas. To draw Stroke Text in web page we will use Canvas API, we will draw the Stroke Text on canvas using the strokeText() method. Following is the...
Draw Text in HTML : In this article i will show you how we can draw Text in HTML canvas. To draw Text in web page we will use Canvas API, we will draw the Text on canvas using the fillText() method. Following is the simple example to draw Text on...
Draw line in HTML Canvas : In this article i will show you how we can draw line in HTML canvas. To draw line in HTML we will use Canvas API, we will draw the line on canvas using the lineTo() method. Following is the simple example to draw line ...
Draw Rectangle in web page: We can now draw the graphics in web pages. Html provides the Canvas API for drawing graphics. Html5 has the <canvas> tag to draw the graphics using JavaScript. Using <canvas> element we can draw rectangle, ...
This code will calculate the latitude and longitude of the place in background on entering the place name.
For integration of Google map to calculate Latitude and Longitude major script is :
<script src="https://maps.googleapis.com/maps/...
To fetch the data from remote server we have to make the ajax request to the server which will return the data in our desired format, and to do that in AngularJS we can use $http service which helps us to communicate with remote server.
To imp...
There are three type of visibility scope:
Public
Private
Protected
PUBLIC:
Variable or function of public scope can be accessed throughout the program.
PRIVATE :
Variable or function of private scope can be accessed only with...
To redirect page using jQuery we can use the various methods such as
In JQuery we can use location object which as multiple attribute such as host, hostname, href, origin, protocol etc, and we can set the href attribute to our custom URL, w...
CakePHP has power to do a lot with conventions by using routes. Its additionally possible to utilize custom prefixes adjacent to your admin routes for extra flexibility. Prefix routing can be enabled from within the core configuration file by set...
Hello all,
Working with HTML Editor we wanted to give a functionality to user where he can select any element from the html editor and can convert it into Numbered and Bulleted list.
We added this functionality by following these steps : -
...
If you want to validate the dynamically generated form using javascript:
You can use this code :
HTML :
<div id="example">
<form id="newForm">
<input type="text" name="email" id="email" value="mail" /&g...
"Asp.net formatting a date from JSON and working with it on clinet side"
While dealing with JSON I got an issue that dates in the JSON are serialized as plain strings.
The solution which I go...
Hello readers,
To Delete a File in Java is not a big issue, you don't need to do any rocket science for this.
So if you want to delete the file in java here below is the method.
To delete the file, you just have to issue the File.delete(...
What is user acceptance testing:-
It is the final step of testing before hand over of the application to the user. It is done by the end users or customers who will use the application. Its goal is to achieve confidence in the system. Before per...
Hi all,
This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an expe...
Asp.Net MVC is currently used and much embraced architecture in software development. It offers a layered approach to development by it's default configuration, and facilitates unit testing...
Design Patterns:-
Design Patterns provide generic, reusable designs that solve problems at the design level. A design pattern does not define code and is not specific to a given programming domain. Instead, it provides a proven, tested solutio...
Warning: "Saving Changes in not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that cant be re-created or enabled the option Prevent saving changes that r...
We can configure MySQL in Liferay very easily. The configuration for MySQL is done in the properties file named as "portal-ext.properties".
You just need to follow the below steps:
If portal-ext.properties is not available then you can m...
You can disable Reset password screen that comes on first login after Registration. Use the below steps to hide the Reset password screen:
If portal-ext.properties is not available then you can manually create portal-ext.properties file into...
Writing a JavaScript code in correct approach can be fun instead of terrifying. In this tutorial we will see shift(), unshift() and push(), pop() are the methods of JavaScript that allows us to add remove elements.
Lets discuss all these m...
How to convert JSON to a Java object: In many application we use web services and those web services deals with the JSON object, so when those web services need to communicate with our web application we need to convert those JSON objects to Java...