In this blog post, I am going to explain how to use dependency injection in spring using setter injection and Java configuration. This blog post assumes you already have Java and Maven installed. Step 1: Create a Java Project using Maven Step 2: Let’s create some placeholder folders
I have used Spring way back in my career, but I have been lately using again at work. In this blog post, I am going to explain how to use dependency injection in spring using constructor injection and XML configuration. This blog post assumes you already have Java and Maven installed. Step 1: Create a…
In JavaScript, an object can have two types of properties: data(standard) properties and accessor properties. Every property in an object has some attributes, this blog post we are going to take a look at the attributes of data properties. The data properties have the following four attributes: [[Configurable]] – Determines whether we can change the…
I have used Spring way back in my career, but I have been lately using again at work. In this blog post, I am going to explain how to use dependency injection in spring using setter injection and XML configuration. This blog post assumes you already have Java and Maven installed. Step 1: Create a…
Below I have some useful commands to view/modify the shell in Mac or Linux. View all available shells View the current shell Change the current shell to zsh We should restart the terminal after executing the above command for the new shell to take effect. In the chsh -s we can pass any one of…
There are multiple ways to iterate/loop through all the properties in a JavaScript object.
Method 1: for-in loop
var person = {
name: 'Shravan Kasagoni',
age: 20,
isActive: true
};
person.constructor.prototype.printName = function() {
console.log(this.name);
};
person.constructor.prototype.encKey = 'somevalue';
person.constructor.prototype.printName = function() {
console.log(this.name);
};
The for-in loop iterates over all enumerable properties of an object.
for (var propertyName in person) {
console.log(propertyName, person[propertyName]);
}
Result:
name Shravan Kasagoni
age 20
isActive true
printName ƒ () {
console.log(this.name);
}
encKey somevalue
I have been playing around settings in the iTerm2 preferences to customize according to my needs, instead of creating a new profile I have made the changes to default profile itself. I want to reset all the changes I have made and start the fresh with default profile again. Using below two commands, we can…
This blog post shows how to install and set up the Apache HTTP Server with SSL on Red Hat Linux (7.x), and we can follow the similar steps for other flavors of Linux. Step 1: Install Apache HTTP Server Step 2: Enable and start the httpd service Step 3: Enable the required ports In above…
Follow the below steps to delete all the lines in a file (emptying file) using VI / VIM editor. Open the file vi <file-name> Press gg, this will move the cursor to the first line of the file. Now press dG, this deletes all the lines. Finally, type :wq to save the changes and exit from the…
Below command shows, all the git branches (local, remote) in the local git repository. The remote branches list the local git repository won’t be updated automatically even someone removes the remote branch on the server. We can use the below command to update the local list of remote git branches. Instead of the above command,…