Aditya Chatterjee's Blog, page 209

May 19, 2020

Super keyword Reference in Java

This article at OpenGenus explains the use of super keyword in Java. Also, we will discuss how it can be used for several purposes with various examples.

Super keyword is used to call the Constructor of the Parent Class. It is required when we need to pass some arguments to Parent Class and complete object instantiation. Recall that this keyword has two meanings: to denote a reference to the implicit parameter and to call another Constructor of the same class. Likewise, the super keyword has...

 •  0 comments  •  flag
Share on Twitter
Published on May 19, 2020 00:45

May 18, 2020

Journey to becoming the Most Active GitHubber in India

Journey to becoming the Most Active GitHubber in India

Success isnt always about Greatness, its about consistency. Consistent, hard work gains success. Greatness will come. - Dwayne Johnson

Journey to becoming the Most Active GitHubber in India

Like most of the engineering students, I was stuck between what was taught in the university and what was being practiced in the industry. The huge gap between the two widens even further for software industry where trends and technology changes on a very rapid pace.

I would like to stress a fact before I proceed to talk about the #301DaysofCode challenge,...

 •  0 comments  •  flag
Share on Twitter
Published on May 18, 2020 15:11

Minimum number of increment or decrement (by 1) operations to make array in increasing order

Given an array of size N. Find the minimum number of increment or decrement operations to make the array in increasing order. In each move, we can add or subtract 1 to any element in the array.

This problem can be solved in O(N x R) time where N is the number of elements and R is the range of the elements. This is achieved using Dynamic Programming.

Examples:

Input : a = { 5, 6, 6, 3 } Output : 3 Explanation : Modified array is { 5, 6, 6, 6 } Input : a = { 1, 2, 2, 3 } Output : 0 Explanation...
 •  0 comments  •  flag
Share on Twitter
Published on May 18, 2020 09:37

Minimum number of increment (by 1) operations to make array in increasing order

Given an array of size N . Find the number of increment (by 1) operations required to make the array in increasing order. In each move, we can add 1 to any element in the array.

This can be solved in linear time O(N) using a Mathematical Algorithm.

Examples:

Input : a = { 5, 6, 6, 3 } Output : 6 Explanation : Modified array is { 5, 6, 7, 8 } Input : a = { 1, 2, 3 } Output : 0 Input : a = { 1, 4, 3 } Output : 2 Explanation : Modified array is { 1, 4, 5 } Intuition

Lets take two numbers p and...

 •  0 comments  •  flag
Share on Twitter
Published on May 18, 2020 09:03

May 17, 2020

Activation Functions in Machine Learning: A Breakdown

Activation Functions in Machine Learning: A Breakdown

The goal of this article at OpenGenus, is to simplify Math-heavy and counter-intuitive topic of Activation Functions in Machine Learning that can trip up newcomers to this exciting field!

We have covered the basics of Activation functions intuitively, its significance/ importance and its different types like Sigmoid Function, tanh Function and ReLU function.

A Brief Intro to Neural Neworks

The functions we shall be talking about are used often in the creation of Artificial Neural Networks...

 •  0 comments  •  flag
Share on Twitter
Published on May 17, 2020 13:11

Online C Code Compiler using Flask

In this article, we have explored how we can develop an online C Programming language compiler using Flask (a Python web framework). It can be extended to support any programming language. The basic idea is to store the text form the textarea into a file on the server machine and compile and execute the file on the server machine and return the output/error (if any) to the user.

Flow of application

Now we will learn about how the dataflow occurs in the application. As you can see in the...

 •  0 comments  •  flag
Share on Twitter
Published on May 17, 2020 04:32

May 16, 2020

Basics of std::multiset in C++

std::multiset is associative type of STL container. It comes under set header. These header contains two types of class templates:

a) set - store unique elements only.
b) multiset - accept duplicate elements also.

We have explored the basics of multiset container in C++ in depth. We have covered initialize, accessing elements, member functions, modifiers like emplace, its iterators, observers and much more.

Features :

a) Upon insertion of elements, they always follows strict weak...

 •  0 comments  •  flag
Share on Twitter
Published on May 16, 2020 15:51

May 15, 2020

Handling date and time in Python using datetime module

Handling date and time in Python using datetime module

In Python, date and time are not represented as specific data types, but a special module called datetime module can be imported in order to work with date and time as objects.

Installation

This is an inbuilt module, hence it does not require any specific installation.

How it works

The classes in this module are used for manipulating dates and times. These classes provide a number of functions which can be used to work with them. As these are datetime objects in Python, when you manipulate...

 •  0 comments  •  flag
Share on Twitter
Published on May 15, 2020 16:45

Introduction to Abstract Window Toolkit (AWT) in Java

Abstract Window Toolkit(AWT) is an to create GUI using JAVA for Window based applications.It is said to be platform dependent as it implements itself over the underlying Operating System.Thus,it uses the native components like the windows,panels,dialog and whatever you see on the GUI of your Operating System.It calls the platforms subroutines to implement the functionalities.Depending on the Operating System(platform)the UI will be different from OS to OS.For Example you can see below that...

 •  0 comments  •  flag
Share on Twitter
Published on May 15, 2020 05:26

Ways to convert double to string in C++

There are various ways of converting string to double in the C language; but before going into the ways, let me give you a quick intro to string and double.

C provides the programmers a wide variety of built-in as well as user defined data types. String and double are both data types but they differ in a few respects:

Double is a built-in/primitive data type while std::string is a part of the standard library that comes with the C compiler which can be used after including the string.h...
 •  0 comments  •  flag
Share on Twitter
Published on May 15, 2020 04:07