Welcome to Bludit

Congratulations you have successfully installed your Bludit.

How do Compilers read code?

We've all had that moment of accomplishment when we had run our first ever program without any errors. Let me take you back to when I typed my first ever C program. I felt like a superhero with my code as my outfit and all of a sudden I get this thought "How does my computer understand what I'm typing? How does it understand the language that I speak?" With all this battle of thoughts in my mind I went on with trusting my imagination of an old woman dressed all-black with a crystal ball doing spooky stuff, giving me the outputs. Well, that's what I thought when I typed my first ever C program until I came to know about compilers, machine language and its purpose.

 

 

 

 

What does a Compiler do?

 

So, a compiler is an intermediate in-between the user who is typing the code and the machine acquiring the code. The code typed by the User is called the "Source Code" and the code acquired by the machine is called the "Executable Code". Let's slide in some real time analogies.. Let's say your friend Rakesh cracked a joke that leaves you confused and you don't get it. Here comes your good old pal Joe to save you from being embarrassed, he explains it and now you get it, so you can laugh along. All this happens so quick.

 

Now with respect to the above analogy, You are the machine, "Rakesh" is the User typing the Source Code and "Jimmy" who saved you by making you understand the joke is the Compiler. Interesting, right? Now let's dig deep into the details. 

Computer processors can do only a small number of things like reading and writing memory and performing arithmetic operations written in binary. A program written in binary is a machine language. You can take a look at "Machine learning and how it helps in stock prediction" by our writer Samay in the blog section.

 

How do Compilers read code?

 

Let's take a piece of simple code for example.

 

 

 The source code is understandable to us but the machine takes it as a series of meaningless characters arranged and assigned to a memory space as texts. 

So, the compiler goes on to convert the source code to an executable code by these prominent steps.

 

Lexical Analysis

 

> This step scans and divides the text into individual tokens. Tokens represent each character as a unit. In short, the compiler is figuring out what you've typed. Like..

| i | n | t | . | m | a | i | n | ( | ) | . | { | \n | \t | i | n | t | . | x | ; | \n | \t | x | . | = | . | 3 | ; | \n | }| \n |

 

Syntactic Analysis

 

> This step creates a hierarchical structure of the code by something called a "parse tree". The compiler is breaking down the grammar of the source code at this point. 

 

Semantic Analysis

 

>This step records the various contexts that we might need throughout the program, like variables, constants, etc.  Finally the corresponding machine code for the source code is generated which includes additional steps like the intermediate code, optimization, assembly code, object code and linking. Let's discuss this further more. 

 

Alright, now let's take the binary code of our simple sample code that we have used above. When it's converted to binary it looks like this..

 

 


Pretty messy right? Let's convert it into hexadecimal code, which might still be the same. So, let's convert it to assembly code which is easy to understand. 

 

The code can be understood now. So, let's focus our attention towards the third line and ignore the rest (let's just say that the rest are responsible for the starting and ending functions). The third line "MOVL $3 -4(%RBP)" corresponds to "x=3" of our source code which is nothing but the allocation of the number 3 to the variable x in a memory location. Let's perform an arithmetic operation but incrementing x to 4. Which would change our source code and assembly code to something like this..

 

The highlighted line "ADDL $1 -4C(%RBP)" indicates that the variable x is incremented by 1 and is allocated the same memory space as before. The compiler analysed the code by separating the characters of the source code(lexical analysis) as tokens, parsing the code (syntactical analysis)  and contextualized the code (semantic analysis) to complete the operation. 

We have learnt the purpose of a compiler and it's various processes in programming. Now an interesting question arises.. who programmed  the compiler? And who programmed the compiler's compiler? Well, if we followed the chain backwards then we will reach the origin of development tools where programs were written directly in machine code. Pretty tuff right? So, the next time we compile a program let's remember the efforts taken for us to have syntax highlighting, object oriented programming, libraries, debuggers etc to make our job quite simple yet effective. The innovation never ends.  

Journey from zero to hero. All about my internship at icrewsystems

What is it like to do an internship for icrewsystems?

How did it all start?

My story of discovering this company and my hidden coding talents began with a phone call to my batchmate, to talk about a bug in my college final-year project with which I was breaking my head at for weeks. I knew Leonard from my school days. Coincidentally, we were together in the same squadron in the NCC as well. We've had some fun times in the NCC.
A blast from our past, the golden days

A blast from our past in the NCC.



Like in any uniformed force, we get to forge our relationships with friends, or in other words "batchmates" in the NCC over our tenure, and during one such instance of our aeromodelling post-flight maintenance, we were talking about college and coding and Leonard had told me that he knows web development well and has a small startup which does web development. With my final year project's bug, when I struggling to find solutions, I reached out to many of my friends, and one in one such attempt, I made a call to Leonard and he told me to bring my project to his house so that he'd take a look at it. My project was pretty basic, and that basic project took me about a month to build. Upon reaching Leonard's house, he took a brief look at my code, looked at me, and asked me "You know what? This is too messed up to fix, we'll do the same project in a fresh codebase in a much-optimized way" and I was confused and scared because this project took me almost a month to build, I was worried because I thought I'll have to take another month to finish this project. But to my surprise, within 4 hours, my entire final year project came to life, exactly in the way I had described in the abstract. I kid you not, I was awestruck! For 4 hours straight, I saw Leonard typing at blazing speeds and shifting screens like Keanu reeves in the matrix. 

I WANTED TO DO THAT TOO!

I asked him if he could teach me, and he said "I'm looking to hire an intern at my company, would you be interested?" - By now, you could have guessed what my answer would have been. 


My First Step

A microphone, a Discord sign up, infinite cups of coffee and a month or two is what it took for me to understand the work that's been put to deploy a project out there to the clients (spoiler alert, it's much vast than what you learn in college). My quest from learning basic HTML  to getting to develop complex frontends and backends using robust frameworks is what this blog is all about, in other words, My journey from a zero to hero in coding!

I care not to take back my words when I say 'You too, can learn all that's offered from scratch'. All that we at icrewsystems look for in you is the willpower to go on, the perseverance, the patience to tackle problems, and to never quit. icrewsystems gives it's interns the environment to grow as a person and I should say, it's not a fan of strict grumpy faces and dictatorship regulations but compromising on time & quality is something we don't overlook. 

 We begin with a guide, documentation and you get the credentials to perform your operations. You gain access to the portal where your progress gets recorded. You have the support of your fellow interns to give you a boost in whatever you do. You get to learn all the basics in the beginning with the help of the Gods of learning web development (i.e) "Google and YouTube".

Front-end development with   HTML, CSS, JS, etc that you will normally be able to comprehend. You might be familiar with most of the topics that come under this Chapter.  These two are the core for any website to be presented with a structure and customization. Starting with these can only make your journey much much better. as you stroll in the streets of HTML and CSS, you will come across some boosters like Bootstrap, Tailwind-CSS, CSS grid, Flexbox, React etc that will make your work easier. The Web pages that you had a crush on has all these things going on behind it.

Speaking of Back-end, we mostly focus on PHPa general-purpose scripting language that is especially suited to web development. Almost all the famous websites you know has PHP, starting from WordPress to Facebook and it's free!
i should say, it might take a while to understand what's going on but as you take your steps one step at a time you'll find it to be quite easy and interesting. The point here is to not "just write meaningful code" but to code "the way the user/client will understand the content" which brings the concept of refactoring and creating a structure for the code rather than hard-coding it. That's what sets aside an exceptional code from the other ones.

As you go on to learn PHP and as you stand firm on its basics we transcend you to Laravelan  open-source PHP web framework that makes your work easier​ than you can imagine. I still remember when i spent hours to create a Login-Register form in vanilla PHP but when i learnt Laravel it took less than half an hour to get it done. The videos that we suggest comes from Laracasts, a defacto educational resource specifically for working developers building the web with PHP and JavaScript. It's kinda like Netflix for your career!  As you look at all the videos that we recommend, we stand by you when you need help. You​ experience a sense of accomplishment as you get to do things on your own which strives you to get more work done. 

I had lots of fun in exploring "how" the modern sites are made. I remember the day when I first wrote my "hello world" program, and now I'm writing this blog while finishing up complex API integration and documentation. The transition phase from training to production was a little challenging at first, it was hard, not going to lie, but during the entire training period, you're mentally built to accept that "just because it's hard, it doesn't mean it's impossible". The exciting part about icrewsystems is that you're given the opportunity to work on overseas projects. I've had the privilege to work on projects from Barbados, the United Kingdom, the United States of America, Bulgaria, and Romania. I got the chance to interact with people from all of those countries, and that is an experience very hard to get. While I was working here, my colleagues got chances to work in projects from Ireland, China, Japan, Egypt, United Arab Emirates, and so on. 

"All work and no play makes jack a dull dud", right?

Yes, We work hard, but we play harder!

We are much more than just "sit, stand, roll-over" company, we're a "fly, raft, slay" kind of a company, yes you heard me right. We take some time to appreciate ourselves with some unforgettable trips. Our work is as beautiful as the relationship that we share within the workforce of icrewsystems. We believe that productive work is a result of an unbreakable bond and limitless learning. Take a look at some of our memorable moments.

From the time when we went for flying at Bangalore

From the time we went for Rafting at Kalpakkam       

Some team dinners, and fancy get-away breakfasts all over the map!           

Sometimes, the work environment can be stressful when a lot of work is accumulated. Normal people panic but we "Web Artisans" at icrewsystems handle it differently. Ours is a place that is more like a bunch of friends helping out each other but just in a much more professional way. Our community is loaded with a diverse variety of people, developers aren't just geeks, they also beatbox, play the guitar like a pro, rap, vibe over different genres of music, cook delicious food, artists and can make the workplace a wonderful time.

My Journey so far

I still remember my first ever call with a client from overseas. Well, it was an irony because he had the same name as mine. Dealing with clients and handling their queries was the best part. You get to work with clients across the globe. Literally, we have clients from all continents. You'll get to work on diverse projects as your clients vary from time to time, I've worked on Virtual Airline projects like Skywardair and VirtualNato which gave me a lot of interest to work on, speaking of which I've also got the opportunity to work on #Feedthepoor project

 

 

 

The #feedThePoor App is a project which emphasizes on the main goal to increase the transparency in donating and to attract more donors and not let an underprivileged human starve to death. As we are blessed with the gift to code, we use it for a better cause, and being a part of it is something that I am indefinitely proud of. You as an intern will get these perks too. I can't wait to see your expressions when these happen. 

 

To conclude

So, you might think that it takes extraordinary skills to even crack the interview and get into icrewsystems, right? You're absolutely right, it does take something extraordinary. The staff here don't care about your coding skills, because I've seen it first hand, they can teach anyone to code. They are more interested in hiring character than talent. Luckily, my character was identified, and I was given the privilege to learn code in a better way. If you have read this entire blog and are thinking about how it would be if you too could be a part of icrewsystems, stop thinking and write to hello@icrewsystems.com with your CV That's the best decision you'll ever make today. 

See you on the other side. 

 

 

 

Machine Learning and how it helps in Stock Prediction

In this article, I have explained what is Machine Learning, its algorithms, and also discussed its application in the prediction of stock prices.

Human beings can acclimatize to the changing environment through learning. Learning can simply be defined as acquisition of knowledge or skills through experience, study Or being taught. However, for a machine, it is very tough to acquire new knowledge and skills from a given dataset. 

Here,we shall deal with the technology and see how stock prediction has evolved with it. 

Machine Learning

Machine learning is a branch of artificial intelligence (AI) that provides machines or computer systems the ability to automatically learn and improve from experience without being explicitly programmed to do so. The process of gaining knowledge begins with the observation or data, such as example or instructions in order to look for patterns in the data. The primary goal is to let the machines or computer learn automatically without human intervention or assistance and adjust accordingly. 

Different algorithms are written on the basis of where the technology is to be used which is mostly in case it is difficult and infeasible to develop conventional algorithms such as autonomously drive cars, find terrorist suspects, filtering emails for spams etc. 

A Brief History of Machine Learning

The history of machine learning dates back to 1950s, with Alan Turing's question "Can machines think? "published in his seminal paper "Computer Machinery and Intelligence"on the topic of artificial intelligence.

 In 1952,Arthur Samuel ,the pioneer of machine learning created a program that helped IBM computer play checkers game and seven years later in 1959 he coined the term " Machine Learning".

Algorithms used in Machine Learning

There are four types of machine learning algorithms- supervised, semisupervised, unsupervised and reinforcement. 

Supervised Learning

In Supervised learning, a machine is taught through examples. The operator provides the algorithm with a known dataset that includes desired inputs and outputs for it to find out a method to determine how to arrive at those inputs and outputs. While the operator knows the correct answers to the problem, the algorithm  finds patterns in data, learns from observation and make predictions which are corrected by the operator and this continues until it achieves high level of accuracy/performance.

Under supervised learning comes the Classification, Regression and Forecasting

Semisupervised Learning

Semisupervised learning uses both labelled and unlabelled data. Labelled data is essentially information which has meaningful tags so that the machine learning algorithm can understand the data while unlabelled data lacks that information and can learn to label unlabelled data. 

Unsupervised Learning

The machine learning algorithm studies data by identifying patterns without any answer key or human operator to instruct. Instead the machine determines the correlations and relationships by analysing available data. The algorithm is left to interpret large data sets and address that data accordingly and tries to organize the data to describe its structure

This might mean grouping the data into clusters and arranging them into more organized form. 

Assessing more data improves its ability of decision making and it becomes more refined. 

Under this method, come clustering and dimension reduction. 

Reinforcement Learning

Reinforcement learning focuses on regimented learning processes, where a machine is provided with a set of actions, parameters and end values. It tries to explore different options and possibilities, monitoring and evaluating each result determining which one is optimal. It teaches the machine trial and error . It learns from past experiences and begins to adopt its approach in response to the changing situation to achieve the best possible result.

Stocks and Shares

The companies need a huge amount of capital to invest in their business for its growth and development. They raise this capital by selling parts of their businesses as shares, also known as equities. A person buying this 'share'owns a small part of this company and becomes a ' shareholder'. Stocks are basically collection of shares

Why is Stock Prediction Needed?

People invest in shares in order to yield profit by selling the shares at higher values when the price rises. However there is ups and downs in the market everyday (note:not all share markets are open all day everyday) because of imbalance in supply and demand. As a result there are chances of making loss as well. 

For example, buying a gold bar at ₹100 and selling it when the price rises to ₹110 can generate a profit of ₹10, similarly buying 10 gold bars will yield a profit of ₹1000.But in unfavorable situations, one may make a loss of ₹1000, if he buys 10 gold bars of ₹100 each and then the price falls to ₹90 , making a loss of ₹10 per share. 

Now nobody wants to make a loss. Therefore,the shareholders make predictions about rise in price in future by carefully examining the past records of the companies and decide when to buy and when to sell. This is where machine learning comes to play. 

Prediction of Stocks using Machine Learning

Machine learning can help us predict changes in the market by examining the past records of the company. Recurrent Neural Network or RNN has proven to be one of the most powerful models for processing sequential data. The Long Short Term Memory or LTSM is one of the most successful RNN architectures. Hence we shall use RNN and LTSM approach to predict stock market indices.

Recurrent Neural Network or RNN

RNNs, used in deep learning and development of models that stimulate the activity of neurons in the human brains, are especially powerful in cases when context is critical in predicting an outcome and are distinct from other types of artificial neural networks because they use feedback loops to process a sequence of data that informs the final output,which can be another sequence of data. The feedback loop allows information to persist, the effect being knwn as memory. 

A disadvantage of the process is that during back propagation the neural network may have vanishing gradient problem. 

Long Short Term Memory or LTSM

Introduced in 1997,by two German Researchers, Horchreiter and Schmidhuber, LTSM is a unique type of RNN that is capable of learning long term dependencies useful for predictions that requires the network to retain the data for longer period of time. 

LTSM has an internal mechanism called " Gates" That can regulate the flow of information and learn which data in a sequence is important to keep or throw away.

Now that's a lot of talks, lets quickly move to the coding part!

Code and Methodology

1. Loading Dataset

To start, we are going to load our dataset. We are going to be using NIFTY stock’s historical data.

import pandas as pd

dataset = pd.read_csv('NIFTY_Train.csv',index_col="Date",parse_dates=True)

2. Data Preprocessing

In this stage, we will be normalizing our data. We will also be cleaning our data. After the dataset is transformed, we will divide it into a training set and a testing set.

#Data cleaning

dataset.isna().any()# Feature Scaling Normalization

from sklearn.preprocessing import MinMaxScaler

sc = MinMaxScaler(feature_range = (0, 1))

training_set_scaled = sc.fit_transform(training_set)# Creating a data structure with 60 timesteps and 1 output

X_train = []

y_train = []

for i in range(60, 1258):

    X_train.append(training_set_scaled[i-60:i, 0])

    y_train.append(training_set_scaled[i, 0])

X_train, y_train = np.array(X_train), np.array(y_train)

# Reshaping

X_train = np.reshape(X_train, (X_train.shape[0], X_train.shape[1], 1))

3. Feature Extraction

In this stage, we will feed different features to the neural network.

# Importing the Keras libraries and packages

from keras.models import Sequential

from keras.layers import Dense

from keras.layers import LSTM

from keras.layers import Dropout

4. Training the Neural Network

Now we will feed our training data into the neural network. Our model is made up of a sequential input layer, 3 LSTM layers, and a dense layer.

# Initialising the RNN

regressor = Sequential()# Adding the first LSTM layer and some Dropout regularisation

regressor.add(LSTM(units = 50, return_sequences = True, input_shape = (X_train.shape[1], 1)))regressor.add(Dropout(0.2))

# Adding a second LSTM layer and some Dropout regularisation

regressor.add(LSTM(units = 50, return_sequences = True))

regressor.add(Dropout(0.2))

# Adding a third LSTM layer and some Dropout regularisation

regressor.add(LSTM(units = 50, return_sequences = True))

regressor.add(Dropout(0.2))

# Adding a fourth LSTM layer and some Dropout regularisation

regressor.add(LSTM(units = 50))

regressor.add(Dropout(0.2))

# Adding the output layer

regressor.add(Dense(units = 1))

# Compiling the RNN

regressor.compile(optimizer = 'adam', loss = 'mean_squared_error')

# Fitting the RNN to the Training set

regressor.fit(X_train, y_train, epochs = 100, batch_size = 32)

Optimizer

Different types of optimizers can greatly affect the network’s success. For this network, we will use Adam optimizer. This optimizer is a combination of two other optimizers: ADAgrad and RMSprop.

ADAgrad uses a different learning rate for every time step. This is since some parameters, especially ones that are infrequent require larger learning rates while others require smaller ones. RMSprop fixes a diminishing learning rate by only using a certain number of past gradients.

Adam or Adaptive Moment Estimation can be represented with the formula

Regularization

We have to make sure that our weights don’t get too large and focus on one data point also known as overfitting. To stop this from happening we can include a penalty for large weights. For our purposes, we will use Tikhonov regularization.

Dropouts

A new way of preventing overfitting is by considering what happens when some neurons stop working. This means that our model becomes overdependent on some neurons. Dropouts make neurons much more robust and more accurate.

Output Generation

In this layer, the neural network’s output is compared to the target value. The error is minimized through backpropagation.

5. Visualization

# Visualising the results

plt.plot(real_stock_price, color = 'orange', label = 'Real NIFTY Stock Price')

plt.plot(predicted_stock_price, color = 'blue', label = 'Predicted NIFTY Stock Price')

plt.title('NIFTY Stock Price Prediction')

plt.xlabel('Time')

plt.ylabel('NIFTY Stock Price')

plt.legend()

plt.show()

Predicted Graph:

Please note that the stock prices of the year 2017 and 2018 has only been used to train the neural network. To test, only the stock data of January 2019 has been considered. Recent stock prices have not been taken because of the fact that the prices have been quite unpredictable due to COVID19 situations. 

Conclusion

To calculate the probability for a profit in the stock market, predicting prices are necessary, and to predict a price, historical data is analysed. Hence, machine learning could be used here to predict stock prices. Our model that uses RNN and LTSM approach can be used to predict stocks more accurately. This would help in reducing the probability of making a loss.

Want to make a mobile application or a website on this topic? Drop a mail at hello@icrewsystems.com with your idea.

Why does your business need an online presence?

In this article, we have discussed how having an online presence can help to boost your business.

Now that I can hardly breathe through my busy schedule, even on Sundays, I really miss those days when I used to hold my mother's forefinger, wear a little cap, and visit the market to see the vibrant shops with my wonderstruck eyes. Gone are those days when we used to go to the library to find a book on the topic we would like to learn about. In this modern era, most of those things got replaced by its online counterpart which made everything just a mouse-click away.

Even a few years ago, I used to go to the market to buy some fresh vegetables and fruits, but now I buy them from online companies like BigBasket, Grofers, etc. Now, why is that so? Isn't there the same market anymore? Well, no, going to a market takes time, and moreover these online services give me fresh vegetables and fruits delivered at my doorstep. This saves time, money and the effort needed. 

Why should I move to an online service as a customer?

woman-shopping-online-with-card-holding-silver-laptop

From a customer's perspective, my need is always to go for something that is hassle-free, time-saving, and should solve the purpose. I have to do a lot of stuff every day, so I like to keep the time spent on doing a single work as short as possible. If I have to read something, I would like to search for a book or an article online rather than going to a library or a shop. If are reading this article then probably you are doing the same. If I have to buy some groceries, then I would prefer some online grocery shops because: a) I detest queues in shops and b) I do not have to worry about the time consumed in the process. I can literally buy groceries when I'm cleaning the house, or talking to my client. Moreover, unlike traditional markets, I get reviews of the product from real customers who bought the same product before. So, I do not need to worry about if the product should really solve my purpose.‌‌

Why should you digitalize your business?

Every successful businessman I have seen have understood their customer's real need. You see, Steve Jobs understood that his customers dislike to bring out and use the stylus while using an Apple smartphone, so he made a smartphone that can be operated just by using finger touches.‌‌‌‌

According to Statista, a German online portal for statistics, around 4.57 billion people are actively using the Internet (as of April 2020). This comprises 59 percent of the world's total population! Now, why would that figure be important to your business? Well, just like you cannot clap with one hand, your business will be incomplete if you do not have customers. By having an online presence, you now have access to 4.57 billion potential customers. That might look fictional to you now, but even 0.01% of that figure can boost your business like anything!

Using Google Trends, let us look at how popular is "Online Grocery Store" at this moment. Below is the result:

Numbers represent search interest relative to the highest point on the chart for the given region and time. A value of 100 is the peak popularity for the term. A value of 50 means that the term is half as popular.

Coming back to Statista again, If we look at the number of digital buyers from 2014-2020, we will see that there's a steady increase.

In 2020, the number of digital buyers will reach 2.05 billion. To capture this huge market you just need a website and a mobile application. 

Going further we shall look into common human psychologies and how having an online presence can help you to boost your business.

1) Short Attention Span

Now, what is an Attention Span? According to Wikipedia, Attention span is the amount of time spent concentrating on a task before becoming distracted. In 2019, the average attention span of humans has decreased to 08 seconds. This means that people are no longer interested in long discussions about your product. They just want to have a short, yet informative info about your product. Now, you have two options using which you can advertise your product: 1) Paper Pamphlets 2) Website or Mobile Application.

1) Paper Pamphlets

These type of advertisement media have now been very old. Hardly anyone uses it these days. The greatest disadvantage of using these to boost your business is its limitation in production and distribution. Well, how many pamphlets can you produce? And how many can you physically hand it over to people? Maybe hundreds or even thousands but not more than that. At the end of the day, we will have wasted money and papers just to get in a few customers.

2) Websites or Mobile Application

The biggest advantage of websites and mobile applications is that it can be made very precise and to the point. In just 8 seconds you can attract them towards your products. You just need to make a good looking user interface, give short and precise information about your product, and leave your contact details so that they can contact you when they need it. One more advantage is that you do not need to hand it over physically. Moreover, you can actively edit or showcase your products online.

2) Consumer Interest Driven Contents

Not everyone likes to view products that they do not even need. I personally hate them. It is like, you went to buy tomatoes to a shop but the shopkeeper is insisting you buy a refrigerator instead. So, you need to take control of what you show to your customers. Here is where digitization comes to use. You can use different analytical services to see and analyze which people like to see what on your website and show them what they would like to see. For example, if you see that a specific customer does not like to see Oranges on your website, you can just hide that part away, or show them where they would get less emphasis. Targeting user-specific ads are widely used by many big e-commerce websites. Take Amazon, for example, you'll see if you buy a smartphone from Amazon, from the next day they will keep you updated about all their deals on smartphones. 

3) Efficient Feedback Systems

Taking feedbacks are very necessary in order to boost your business. You need to understand what exactly the customer wants. If someone wants something that you probably do not manufacture or market, you can add them if there is a possibility to do so. This makes your customers stick to you, rather than going to someone else. Now, when you have a large number of customers, it is very hard to keep track of each of them and ask for feedback. You can instead make an online portal for your customers where they can visit when they want to provide feedback on your product. In the backend, you can maintain a database of all the feedbacks and sort them out according to your needs with a click of a button. This saves your time and your customer's time as well.

How to have an online presence?

Well, by now it must be clear to you that having an online presence can help to boost your business. But now, the one question that arises is, how to have an online presence? You may not be from an IT background, and your business does not have engineers who can make you a website or a mobile application. In that case, all you need is to look for services that can make you a website and a mobile application. There are several companies online that make you a website for your business. They take up the entire responsibility of coding your website and hosting it live on the internet. This too saves your time and money, and you can concentrate on other parts of your business.

Conclusion

As of now, 76.8% of the total populace is digitalized and around 4.57 billion people are actively using the Internet (as of April 2020), so having an online presence is necessary to boost your business. Due to the busy schedule, most people have lesser time to look at your products. By taking your business online, you can now showcase your products to the world without doing paying much effort. You can easily keep track of your customers by analyzing the traffic on your website or mobile applications. You can also actively collect feedback from your customers which will let them stick to you and not move to your competitor.

Do you not have an online presence yet? Well, we at icrewsystems are here to help. Drop us a mail at hello@icrewsystems.com and we would be more than happy to write you back.

Need a Mobile Application for your business? icrewsystems can help with that too! We make mobile applications both for Android, iOS, and Web. Head over to our website by clicking here.

Understanding Trees and Heaps with Real World Examples

In this blog, I have explained Tree and Heap Data Structure using simple real-life examples.

One of the advantages of being raised in India is to experience the beautiful Indian Market! Apart from the chaotic environment, where every seller struggling to draw the attention of every buyer towards the direction of his display which may be accompanied by shoutings and music, one distinct thing that probably everyone is familiar with, is how these sellers display their stuff. Whether it is a fruit, or a vegetable, or a piece of cloth, these sellers manage to put them all in a heap.

For example, look at this old woman, and how she heaped all the coconuts:

And how the shopkeeper heaped literally everything they sell:

Looks tidy and attractive right? Well, to me (being the most unorganized person in my family history), YES! So to these shops, making heaps are an integral part of the business. Well if that does not attract you to these heaps already, I must say heaps are a necessary part of any computer science (with Algorithms and Data Structure) syllabus. But don't worry, this article will not be the same as those in your book, instead, we will be taking real-world examples to understand the same.

Now that you have a basic idea of how heap looks in the real world, we will soon be talking about how it looks in the Computer Science World! But before doing that, you need to understand Trees.

Trees

Ah, I can hear you saying "Wait, what? Trees? Hey dude, look, I'm not a kid okay, I..", yep we all know what a tree is, but, you know, we "CompSci-geeks" are weird, so we would not be talking about normal trees we see in day to day lives. Well, by "trees", "normal humans" tends to imagine this:

But we are not normal humans, right? We are the "CompSci-geeks"! So, to us, trees mean this:

(An inverted tree basically). The branches are called "edges" and the points where the branches divide or end, we call them "Nodes". The nodes that give birth to other nodes under them is called a "parent node" and its children are simply called "daughter node" or "children nodes". The main stem of the tree is called "root node". To understand better, I have circled out the parts which we call a "node" in the picture below:

So in computer science, Tree is a "non-linear" hierarchical data structure that stores the information naturally in the form of a hierarchy style. It represents the nodes connected by edges. Cool.

Now that we are familiar with "Trees", let us talk about a special type of tree called "Binary Tree".

Binary Trees

"Oh God, now whats a binary tree?", well, a binary tree is more simple than you think how it is. A Binary tree is a tree wherein every parent node has two children. Let us understand this by Mike's weird family.

Mike is a cute looking bacteria (umm, bacterias because we're too tired with humans already), he has got a sister called Juliett. Mike and Juliett's father, Mr. Charlie also has a sibling, Mr. Romeo who has two children Bravo and Foxtrot, and both Mr. Charlie and Mr. Romeo share a single father Mr. Alpha. So here's how Mike's Family tree looks like:

So you see, the good old Mr. Alpha (or the "root node" of the tree) has got two children and who in turn has got two children too. Such types of trees are called "Binary Trees". And here's a fun thing, you can call Mike as the "left child" of Mr. Charlie and Juliett as the "right child". Similarly, Mr. Charlie is "left child" and Mr. Romeo is the "right child" of Mr. Alpha.

So we got to remember this important thing: A tree is a binary tree where every parent node of the tree have at most two children.

Array Representation of a Binary tree

Well, so Mr. Alpha bought gold bars for his children and grandchildren, and since he is old, he thought to divide them into his family. So he has set some family rules for his children and grandchildren. The rules might look a bit on the tough side for you, but believe me, it is super simple. 

Mr. Alpha loves gold, so he would like to keep one for himself too. Then he made a weird rule that children on the left side of his family tree should get the most preference while dividing the bars. If any child or children is missing on the left side of his family then his part of the gold should be kept preserved until he comes and takes it, whereas if any child or children is missing on the right side of his family, then the gold should not be preserved, and will either be sold or given to someone else. 

Also, generations nearer to his generation shall get the gold first. I know I know... This is confusing. Let us understand this with a set of pictures.

So here's how the gold bars look like:

Now, Mr. Alpha thought to write names on the bars so that everyone should know which bar belongs to whom. So here's how it looks after the bar is marked and divided:

Look how Mr. Alpha gave preference according to his conditions:

1) Mr. Alpha kept a gold bar for himself.

2) The generations closer to him (in this case his direct children) got the gold bars first.

3) The children on the left side of the family tree are given the gold bars first. The child at the rightmost side of this family tree, i.e. Foxtrot got the gold bar at the end.

Now, let's say if Mike and Juliett gets missing, and the family tree looks like this:

Then the gold bars for Mike and Juliet would simply be preserved until they come back and claim for it. So here is how it will look:

Now, let's say Mike and Juliett came back, but Bravo and Foxtrot went missing, then the gold bars for them would simply be sold. Here's how it would look:

Now let me say all these in the languages of computer science. If you have to represent a binary tree in the form of an array, so you'll fill the array according to the levels of the binary tree i.e., one level (or generation from the above example) at a time. First, you'd fill the root element and then its children nodes. While filling you should remember that you will start filling from the leftmost node of a level and gradually proceed to the rightmost node. If you find a node missing but there is a node on the right to it, keep a blank space for that node. But if there is no right node, do not keep any space and go to the next level if any.

Finding the parent and children of a node

So, Mr. Alpha's children and grandchildren are forgetful, so they often forget who their parents are (yes, how weird!), so being a faithful friend of Mr. Alpha, Mr. Oscar derived some formula for them so that they can find out their parents quickly.

Mr. Oscar asked to represent the family as an array first. Then if the bacteria, who forgot who's their parent is, at index "i" in the array then:

  • It's left child is at: 
    2 × i
  • It's right child is at: 
    ( 2 × i ) + 1
  • It's parent is at: 
    [ i / 2 ]           (Remember! you must not take any decimal or fractional numbers. If its a decimal, just throw the digits after the decimal point away.)

Well, there are a lot more topics to cover under binary trees but to keep this article simple and since it is just a basic introduction to trees and heaps, we will end the trees here and move to heaps instead.

Heaps

From the introduction of the article, you must have got an idea of what heaps are in the real world. Now we shall discuss it in the "Computer Science World"!.

In the languages of computer science, Heap is a binary tree-based data structure. So, each node in heap will have at most two daughter nodes.

Heaps are of two types, Min Heap and Max Heap.

Max Heap

If we look at Mike's family tree, and consider the ages, well, of course, Mr. Alpha will be older than all. Mr. Charlie is Mr. Alpha's first child, so he is the second oldest in the family tree. Then comes Mr. Romeo, Mike, Juliett, Bravo, and Foxtrot. So you see, every child is less old than its parents. A max heap is a heap where the "key" of every node of the heap is less the key of its parent node. The "key" of a node basically means the component we are using to compare with other nodes, so in this case, the "key" is the age.

So, here, the following heap is a max heap:

You must be guessing, 16 is greater than 15, so basically Foxtrot is elder than Mike, so why is the tree so? You see the key (the age, in this case) must be less than the key of the parent node. So this condition is satisfied, hence its a max tree.

Min Heap

Opposite to max heap, the key of the parent node must be less than the key of the daughter nodes. So, let us consider the price of mobile phones Mr. Alpha's family use. So we will make the key as the "price of the mobile phones". 

Mr. Alpha being the oldest bacteria, uses a mobile phone that costs the least, maybe a Nokia 3310 XD, because he does not understand so much in mobile phones. His children use a mobile phone that costs neither too high, nor too low. but Mike and his sibling and cousins are gamers so they require a mobile phone of good specifications. So, in this case, the Heap would look like:

You see, the key of every node is less than the key of its parent node. Hence it is a min-heap.

Conclusion

A Tree in computer science is a "non-linear" hierarchical data structure that stores the information naturally in the form of a hierarchy style. It represents the nodes connected by edges. A tree where every node has at most two daughter nodes, is called a binary tree. A binary tree is a tree where the key of any node is less than the key of its parent node, is called a Max heap and A binary tree where the key of any node is more than the key of its parent node, is called a min-heap.

That's all for this article, we will be bringing more articles like this so make sure you check our page every day. 

Have doubts? Write them here.

Know these already? Wow! Well, we are looking to expand our team, check here.

Want to contact us? Send us a mail at hello@icrewsystems.com.

TECH in need, is a TECH Indeed— how it is helping us in 2020's pandemic

In this article, I've discussed about Corona Virus and how Tech is helping us in this moment of crisis.

Today marks 55 days since the World Health Organisation declared a pandemic. Yes! You guessed it right, I am talking about the Corona Virus Disease (COVID-19) pandemic. A lot of people term this pandemic as World War III... Well, fair enough, it is a war that is fought by doctors, and the "enemy" is a weirdly looking, 50-200 nanometer-sized virus, called the "Severe Acute Respiratory Syndrome Corona Virus 2 (SARS-CoV-2)", formerly known as the "2019 novel Corona Virus". Taking advantage of its small size and high communicability, this virus took the lives of 253,232 people and has affected 3,489,053 people so far. Deadly indeed, and what is more deadly is, in today's date, no vaccines or any COVID-19 dedicated medications have been discovered yet. Scientists are working as our second line defense in this war. Working day and night, scientists from all over the globe are trying to find out that one little clue that will help the world to get rid of this pandemic. Talking about the cure, it will only come into play when one is affected (or in modern terms when one is "coronic"), what if we can prevent ourselves from getting affected? Well, this is why we're asked to stay at home, maintain social distancing, and lockdowns were introduced. But wait... what about our job? what about our schools? And here comes our best friend, "Information Technology"!

Before we talk about our above-mentioned best friend and how it is helping us, let us talk about the Corona Virus a bit to understand it better.

Corona Virus— A brief Discussion

Coronaviruses are a group of common viruses that can cause various infections in mammals and birds. However, when humans are infected, these viruses can cause mild to severe respiratory infections including the common cold, and rare lethal forms like SARS, and MERS. These viruses are generally transmitted from animals to humans. As of now known, 7 kinds of coronaviruses are said to infect humans.

The protein spikes on these viruses are the reason for getting the name, Coronaviruses, as corona means the crown.

Symptoms: Symptoms of coronavirus varies from person to person, depending on its severity and type of infection. Signs of infection include cough, fever, shortness of breath, and respiratory difficulties. In severe cases, coronavirus infection can lead to other diseases like severe acute respiratory syndrome, pneumonia, kidney failure, and even death.

Now that we have a brief idea about the Corona Virus, let us talk about how IT is helping us in the hard times.

Internet and COVID-19

‌‌

Ever since we are locked inside the four walls of our house, isolated from the outside world, the Internet has been like oxygen for us. To me, a worst-case scenario would be a home-quarantine without the internet. According to Cloudflare, a United States based company that provides network infrastructure to businesses around the world, said that between January and late March, internet traffic increased by around a quarter in many major cities. We now depend on the internet to do our jobs, to go to school, and to see other people. It is our primary source of entertainment. Demand has extensively increased for certain online services in particular, like Video calling and conferencing services, online games, etc. Video calls have replaced face-to-face interaction with colleagues, family, and friends alike. A recent study has shown that more people started using the video-conferencing software "Zoom" in the first two months of 2020 than in all of 2019. A huge number of people are found using Steam, a popular online PC game store, and probably the market has never seen such an off-season demand till date. To give you an idea about how huge this is, it was found in a recent date that more than 24 million players were logged on at the same time, a 25% jump since February 2020. Coming to the online grocery stores, it is found that they are unable to handle the surge in business, with customers waiting for hours in virtual lines thousands of people long. Netflix, an American media-services provider and production company, recently said that almost 16 million people created accounts in the first three months of the year, and that is almost double the new sign-ups it saw in the final months of 2019. So by now, it must be evident to you that the Internet has indeed been our best friend ever since lockdowns were declared in countries.

But wait! That's not all, there's a lot still left to say about our best friend, i.e., the Internet! 

Online News

‌‌

During this crisis, one of the most important things is to stay updated. It is always advised to stay aware of what's happening around you, and that's where news media comes to play. Although nowadays we have a lot of news channels airing news 24/7, but people still like to read news from the newspaper. Apart from that, not everyone has the time to stare at the news channels all day, every day, so people prefer to have a newspaper so that they could get a quick look at what's happening in the world. But, in these days of lockdown, hardly any shops are open and hence no newspaper. To fill this gap, people moved to online news. 

According to statista.com, a German online portal for statistics has said, during the days of lockdown, the news consumption increased to a massive 36% worldwide! 

Moreover, much of the media is heavily reliant on advertising. In any economic downturn, advertising is one of the first things to go, being seen as a discretionary spend. The sharper the downturn, the sharper the drop in advertising spend. This looks a sharp downturn. Well, thanks to our much-hated online ads, which fill this gap too.

Robots

Ah well, you must be surprised to see this section but there are indeed "robots" who are too trying their best to help us fight the pandemic.

Pudu Technology is a meal delivery robot currently operating in China, is being to deliver meals to those infected with the virus to avoid human contact while delivering meals.

EVD Robots from a Denmark based company called "Blue Ocean Robotics" is being used to disinfect rooms with its UV light tube, that sits right on its head.

Apart from this, every day a new company is coming up with a new robot model that can help us even better. Well, it is always said, Sky is the limit!

Artificial Intelligence

You've already guessed that I'm going to eventually speak about Artificial Intelligence at some point of time. Well yes, Artificial Intelligence is one of the finest creations of mankind. An article about Tech and COVID-19 without mentioning Artificial Intelligence would really be wrong! 

The main advantage of AIs is that they can work 24/7 unlike we humans and can process more data. You'll be overwhelmed to know that one of the first warnings of this pandemic was given by an AI. Yep! You heard it right, an AI! Bluedot, a Canadian startup, came up with an Artificially Intelligent system that goes through government files, social media, news articles to find if an outbreak has started. It was successful in giving us warnings about this pandemic, however, we humans never followed the warning and we now see the consequences.

Jack Ma's Alibaba came up with an Artificially Intelligent System that can go through CT scans faster than humans. On average a human takes 15 minutes to diagnose the CT Scan data, but this tool does the same in just 20 seconds with 96% accuracy! Over a hundred clinics are using this tool to speed up Corona Virus tests. Cool isn't it?

Conclusion

Coronaviruses are a group of viruses that can cause various infections in mammals and birds. These viruses cause mild to severe respiratory infections including the common cold, and rare lethal forms of diseases in Humans. These viruses are generally transmitted from animals to humans. The name "Corona" came from the word "Crown" because the protein spikes on these viruses look like a crown. The recent pandemic is because of a virus that belongs to this family of viruses.

Since COVID-19 lockdown, multiple online services like video calling, video gaming, etc have seen huge hikes in usages. Schools and Colleges have adopted online methods of education to prevent gathering. A huge number of companies have asked their employees to work from home to prevent gathering at offices.

Robots are being deployed to minimize human interaction in areas where traces of this virus have been found. Every new day a company or a startup comes up with a new robotic model that can help even better. Artificially Intelligent Systems are being used in clinics to speed up tests, and also helping the government to estimate the spread of this virus by processing big data collected by different companies. 

Want more updates on Corona Virus? Please visit World Health Organisation's website on https://www.who.int/emergencies/diseases/novel-coronavirus-2019

Want to make a mobile application or a website to spread awareness on this topic? Drop a mail at hello@icrewsystems.com with your idea.