How to plot candle stick chart using python

Here I will not explain what is candle stick chart in details. But it’s one of the best way to visualize the stock price chart as it contains the OHLC (open, high, low, close) price information of a price chart. As shown in the above picture, the green body means closing price is higher than…

Array: Binary Search and the Ordered Array

Now imagine an Array where the numbers are stored in an orderly manner. Means minimum index stores the lowest number and the maximum index number (Here the number is 6) stores the highest number but in the orderly manner. Please take a look for a sample ordered Array as shown below:- Here in the above…

Python Game: Lottery Winner

Here we will randomly select the name from list of names, and randomly prizes will be assigned to them. So lets write the outline of the code. Now let’s check the code:- This code will work, now we have to check whether the code design is correct or not, which can be checked using Pylint….

Mongo Db: Normalization and De-Normalization

Normalization:- There are present multiple ways to represents your data. One of the way is in a Normalized way. Normalized way means, dividing up the data in to multiple collections. Another important aspect is that document of one collection can be referenced by the multiple documents of the different collections. That means there present some…

Java composition with example

In one word, composition is nothing but a ‘Has-A’ relationship. As we know, in object oriented programming there are two popular relationship present, one is ‘Is A’ and another one is ‘Has A’ relationship. The main benefit of has a relationship is that this can reference many classes. Let us check an example of Television….

Concept of Compound Index in MongoDB for interview

Compound index means when we are creating an index on more than one keys. The best way to check how compound index affect the searching and sorting time is directly test it in the Mongo shell. Let’s create one collection of student with keys ‘student_id’,’student_name’ and ‘age’:- Now we will try to sort this output…

JavaScript Scope

In JavaScript we can define variable by using “var” and “let” keyword. JavaScript scope works slightly different way than other object oriented programming language like java. In the below example please look how the variables are defined:- Here “var” keyword works differently than the “let” keyword. Here “let” will not be executed at the very…

Class 2: Python and Object Oriented Programming

My cat and My neighbor’s cat both has different name. Now we can create this name attribute at the time when we are creating the object. The main benefit is, the code will be much more shorter, clean and more readable. This can be achieved with the help of constructor. In the above example, I…