Skip to main content

Posts

Everyone calls her as a SON to her father. This is why...

  I bet that you will think "God has given me everything I need" after reading this life story. A girl born in a rich family, at the age of 10, her beautiful family has lost their entire wealth because of some circumstances. Due to the health issues of her father, she is the only one to look after her family at that age. She... Walked for 14Kms daily(during her menstruation also) to work in a shop for a wage of 10 rupees per day at the age of 12. Used to sell paper covers(approx. 10KG) daily made by her father and mother to shops in the main bazaar at a rate of 1Rupee per KG. Faced harassment and teasing at work. Lost her father because of Tuberculosis and Heart attack after her marriage. After marriage, used to work by making paper covers and selling them to look after her mother and to clear the debts. Maintained family with 3K rupees earned by her husband per month. Raised a daughter to be strong, independent, and confident. Now I am the daughter. That wonderful strong wom...
Recent posts
TRICK TO REDUCE TIME COMPLEXITY USING HASH CONCEPT [DICTIONARY] Today, I learned a new way to know the indices of characters in a string.  Example: If you have a string containing alphabets, and while doing some problem, inside a for loop, you need to access a particular alphabet's index in that string , you will definitely use string.index(k) function, where 'k' represents alphabet. But, it takes O(N) time, as it searches the whole string and returns the index as soon as it finds that particular alphabet. As we are performing this operation inside another for loop , this logic takes O(N^2) for implementation. But, we can know the index of that particular alphabet in O(1) time. Let us see HOW? Here, in the above code, we use the dictionary to store the alphabets in a string as keys and the corresponding indices as values. As the dictionary uses the hash table concept for accessing the value of a particular key, it takes a constant time,  i.e., O(1).  So, now if we use t...

LENGTH OF LONGEST VALID SUBSTRING

GIVEN A STRING OF PARENTHESIS, PRINT THE LENGTH OF THE LONGEST BALANCED SUBSTRING . FOR EXAMPLE: GIVEN,                1.  ()() ---> 4                 2.  ()())()()() ---> 6  Brute Force Approach:   It is to find all the substrings, and check whether they are balanced or not, and simultaneously updating the result if we find a larger valid substring than the previous one. But, this takes the time of O(N^3), since finding all the substrings take O(N^2), and for each substring, to find whether it is a valid substring, it takes a time of O(N), so this constitutes a total of O(N^3).  USING STACK:  In this approach, we will maintain a stack to store the indices of the traversed opening brackets i.e., '('. [YOU WILL KNOW THE REASON SOON, KEEP READING THE POST].  And a variable res , to store the length of the longest substring known till now....

RECOGNITION OF HANDWRITTEN DIGITS(MNIST DATA) PART ONE USING PYTORCH

HELLO GUYS, IN THIS BLOG POST I WANT TO SHOW THE BASIC INTRO TO IDENTIFICATION OF HANDWRITTEN DIGITS USING PYTORCH MNIST DATA. MNIST DATA IS THE COLLECTION OF HANDWRITTEN DIGITS. MNIST CONTAINS 70,000 HANDWRITTEN DIGITS, 60,000 FOR TRAINING AND REMAINING 10,000 ARE FOR TESTING.  THE  IMAGES ARE GRAYSCALE AND 28x28 PIXELS. WE CAN DOWNLOAD THE DATASET USING THE CODE BELOW. Here, the parameters batch_size is kept to 64 so that the training images are grouped into 64 each and shuffle is kept to TRUE, such that each time we run the code it shuffles the data and returns an iterable with new groups of batch_size. As the trainloader is iterable, we are iterating through it and collecting the first batch of images and it's corresponding labels into images and labels respectively. Now, run the above code and see the output. you will see something like this. torch.Size([64, 1, 28, 28]) torch.Size([64])  It shows that there are 64 images with grayscale an...

GET UDEMY PAID COURSES FOR FREE

HELLO GUYS, welcome to my blog. Here, In this post, I will discuss how to get UDEMY PAID courses completely for FREE . AWESOME RIGHT! The majority of UDEMY authors release their courses for free to get initial reviews and users. After getting good ratings for their courses, then they will convert their free courses to paid ones. So, be first to know about their free courses and access them before they convert their free courses into paid ones. Go through the below links and search for your courses: https://www.real.discount/ https://www.discudemy.com/ JOIN THEIR WHATSAPP GROUP AND GET DAILY UPDATES OF THE FREE COUPONS: Real.discount Coupons #25 NOTE: ENROLL IN THE COURSES BEFORE THE EXPIRATION OF THE COUPONS. YOU WILL ALSO GET A COURSE COMPLETION CERTIFICATE AFTER COMPLETION OF THE COURSE.

HOW TO DOWNLOAD AND INSTALL PYTHON FOR WINDOWS

Hello guys. In this tutorial, I will be going to show you how to set up the python environment on your Windows. So, let us get started. STEP1: First, go to this link:  https://www.python.org/downloads/ STEP2: Then scroll down and click on the latest version of Python available. At the time of writing this blog, the latest version is Python 3.7.4 STEP3: After, clicking that you will get another page, in that scroll down until you find FILES... see the picture below... Click on the link according to your computer's configuration i.e., 64bit or 32 bit, now the .exe file will be downloaded...   Step 4:   Now, open the file and you will have an environment like the picture shown below, Make sure that you should add the Python to PATH so that you can work with python from CMD. After that click on Install Now To be installed it will take some time. After that go to the CMD and type python, it will show you the information about it ...

MUTABLE AND IMMUTABLE OBJECTS IN PYTHON AND THEIR MEMORY MANAGEMENT

Everything in Python is an object. There are two types of objects in Python Mutable Immutable Mutable objects are those whose value can be changed after their creation. An example of it is a  list. Immutable objects are those whose value cannot be changed after their creation. A well-known example of this is a tuple. Mutable objects: lists, sets, dictionaries Immutable objects: Tuples, integers, floats, strings, frozen sets Before going deep into this topic, we should know about the  id() function in Python. id() function in python: This function returns the identity of an object. This is guaranteed to be unique and constant for an object. The id of an object is created when the object is created. See below for examples. example1 :                                                          ...