How to Display the Index in Reverse Order for *ngFor Angular

Let's say that we have data in array e.g tasks = ['task 5', 'task 4', 'task 3', 'task 2', 'task 1']. Now when we will use ngFor then it will display the data like this: *ngFor="let task of tasks; let i = index" Task #{{i}}: {{task}} Output: Task 0: task 5 Task 1: task 4 Task 2: task 3 Task 3: task 2 Task 4: task 1 But we want to reverse the order of only the index. In order to do that in ts file of the angular components, define a veriable named as totalTasks: number. Now make it...
forward

How To Develop Custom WordPress Plugin from Scratch using OOP

This post describes the exact step to develop a custom WordPress plugin from scratch using Object-Oriented Programming. Go to https://wppb.me/, fill the form and download your zip file Edit the main file (plugin-name.php) and update texts like 'description' if you want Create all custom post types, make sure that the custom post type title is not longer than 20 characters otherwise you will get an error 'invalid post type' function create_post_uni_lms_classes_std() { register_post_type( 'uni_lms_classes', array( 'labels' => array( 'name' => __('Classes','unilms'), 'singular_name' => __('Class','unilms'), 'add_new' => __('Add New','unilms'), 'add_new_item' => __('Add New Class','unilms'), 'edit' => __('Edit','unilms'), 'edit_item' => __('Edit Class','unilms'),...
forward

How to Deploy NodeJS App in GoDaddy Shared Hosting

This post describes the exact steps to deploy a NodeJS app on GoDaddy shared hosting. Log in to GoDaddy account and click Manage HostingIn settings, click server and make sure SSH access is onClick manage against SSH access and note down the credentialsInstall a tool (Putty, MobaXTerm, etc.) to connect to the server using SSHOnce connected cd into the directory where you want to deploy a NodeJS app. It will be public_html for main domain or public_html/ in case of subdomainrun the command: wget https://nodejs.org/dist/v6.9.2/node-v6.9.2-linux-x64.tar.xzAbove command will install the node in your directoryUpload your app in zip format and extract...
forward

Reporting Research Findings – Research Methodologies – Notes

Reporting research findings is the last phase of any type of research. It's important to know how are you going to report your research findings? because there maybe some restrictions about structure, style and content of your report and it may affect the way you conduct your research. One of the purposes of the reporting research findings is to convince people that you have done a great piece of research. The more professional is the reporting the more are the chances of success. There are three ways to communicate / report research findings i.e written reports, journal articles and oral...
forward

Topic Selection – Research Methodologies – Notes

Topic selection is the most tricky part of the research and is said to be the mother of all successful proposals. Following are some tips for topic selection. Topic Selection: Idea / topic should be novel (unique) Select a topic that interests you and motivates you to work on it It should be complex enough to require research from multiple sources It all starts from literature review Read about the topic of your interest Try to find out the loopholes / deficiencies in previous studies Don't settle on the first idea that appeals you Be flexible while selecting the topic...
forward

Polymorphism in Java – OOP – Code Example

In previous posts we have discussed many important topics of object oriented programming like classes, objects, inheritance etc. In this post we will discuss polymorphism in Java which is another important OOP concept. What is Polymorphism in Java? The word polymorphism means 'a state of having many shapes'. In terms of object oriented programming it's the ability to process objects of various types and classes through a single uniform interface. An object, variable or function may take on multiple forms / shapes and this phenomenon is known as Polymorphism. Example of Polymorphism in JAVA: [js] public int add(int a, int b){...
forward

IS-A and HAS-A Relationships in Java – Code Example

Code reuse-ability is the fundamental objective of object oriented programming. To achieve code reuse-ability objective, we use IS-A, HAS-A relationships. IS-A relationship is another name of inheritance or we can say that IS-A relationship is achieved through inheritance. In inheritance child class can inherit attributes and methods from its parent class. For example we have a Student class which inherits from Human class then it means that it follows the IS-A relationship because a Student IS-A Human. Further it should be noted that a Student IS-A Human but a Human may not be a Student. It means that child class...
forward

Code Example To Generate Word Cloud Using R – Data Analysis

Word cloud help us to understand and visualize important keywords in given textual data sets. R is a powerful programming language used for exploration and visualization of data. Following code snippet can be used to generate word cloud using R programming language. [js] install.packages("tm") // package for text mining install.packages("wordcloud") // to generate word cloud install.packages("RColorBrewer") // to add colors in the word cloud library(tm)     // loading tm package library(RColorBrewer) // loading RColorBrewer package library(wordcloud) // loading wordcloud package text_data <- read_csv("data.csv") // reading data from csv file text <- text_data$col_name      // extracting data from column 'col_name'...
forward

Useful R Packages for Data Analysis

R is a powerful programming language used for exploring and analyzing data effectively. R provides many built in functions for data analysis. Furthermore there are many other R packages for data analysis which can extend the data analysis functionality. Following are some useful R packages which can be installed for specific tasks. Twitter Data Analysis: //rtweet.info install.packages(rtweet) Text Mining: install.packages("tm") // for text mining install.packages("SnowballC") // for text stemming install.packages("wordcloud")  // word-cloud generator install.packages("stopwords") // for multilingual stop words Colors: install.packages("RColorBrewer") // to add colors Visualization: install.packages("ggplot2") // for data visualization functions  ...
forward

Useful R Functions – Exploratory Data Analysis

R is a programming language used for statistical analysis and exploratory data analysis projects. According to the official website: R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. [source] Following are some useful R functions which can be used for data exploration and visualization. To read data from CSV file: data_obj <- read_csv("data.csv") In above line data_obj is the object name in which your data will be saved, data.csv is the...
forward