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

Inheritance in Java OOP – Code Example 2

In previous post we learned about inheritance in Java programming by using simple code example. In this post we will consider another code example of inheritance in Java. In previous post we created a Car class (child class) which inherited some attributes and methods from Vehicle class (parent class). In this post we will create a Student class (child class) which will inherit attributes and methods from Human class (parent class). [js] //Student class code: package learningclassesaobjects; public class Student extends Human { int rollNo; public void setRollNo(int x){ rollNo = x; } public void getRollNo(){ System.out.printf("Your Roll No is:...
forward

Inheritance in Java OOP – Code Example 1

In our previous post we learned how to create classes and objects by using code example. In this post we will learn inheritance which is another important object oriented programming (OOP) concept. Inheritance in Java is like a parent child relationship. As child inherit some properties or behaviors from parents, similarly in inheritance (OOP Concept) a child class can inherit properties and methods from parent class. Following simple code example explains the inheritance concepts in Java programming. This code consists of 3 Java classes, main class (LearningInheritance.java), parent class (Vehicle.java) and child class (Car.java). Create a new project in netbeans (java...
forward

Limitations of Social Media Analysis for Participatory Urban Planning Process

In previous post we discussed how social media participatory process can help city designers, planners or administrators in decision making process. In this post we discuss the limitations / shortcomings of social media participatory process for urban planning. This post is a short summary of the paper titled as 'Missing intentionality: the limitations of social media analysis for participatory urban design' by Luca Simeone. Objective: The objective of this case study was to find limitations of social media analysis for participatory urban planning process. They analysed what city inhabitants are publishing on their social media profiles to perceive what they think...
forward

Classes and Objects in Java Programming – Code Example

In this post we will learn (java syntax) what are classes and objects in Java programming. Classes and objects are fundamental object oriented programming concepts. In previous post we discussed some important object oriented programming concepts. If you want to learn about classes and objects, class constructor method, constructor parameters, instance variables, class methods and main method then read this post. In this simple program we will learn how to create a class and class objects in Java programming. Further we will also learn how to create instance variables (attributes) and methods for class in Java programming. [js] package carclassjava;...
forward

Social Media Participation in Urban Planning

Social media is generating a huge amount of data every second and this data can be used to make important decisions about any particular topic. This post is a short summary of a research paper titled as 'SOCIAL MEDIA PARTICIPATION IN URBAN PLANNING: A NEW WAY TO INTERACT AND TAKE DECISIONS' by E. López-Ornelas, R. Abascal-Mena, S. Zepeda-Hernández. Textual analysis is performed on social media data to know the sentiments (opinions) of the people about any topic. This type of analysis is very important for organizations and institutions to make important decisions. In this paper they have used the installation of a...
forward