Skip to main content

Posts

Euclid's Division Lemma - Program

Hello Everyone, how y'all are fine. In this blog, we are gonna try to build program for Euclid's Division Lemma. It just a mathematical theorem that states that "Given positive integers a and b, there exist unique integers q and r such that a = bq +r, 0 <  r < b". Here basically 'a' is dividend, 'b' is divisor, 'q' is quotient and 'r' is remainder. This is user to find the HCF(Highest Common Factor) of two numbers. We are going to build program to do exactly that. I am using C programming language, however this can be done using any programming language. So I created a new C program file using vim and I used the below code.    ======= Code ======= #include <stdio.h> void main(){         int num1,num2,a,b,q,r;         printf("Enter a number: ");         scanf("%d",&num1);         printf("Enter another number: ");         scanf("%d",&num2);     ...
Recent posts

Project Narutopedia Webscraper

Hello Guys, It's been a while since I have posted something, isn't it?  So, what's up you ask? Well, it happened on Monday, 22nd February, 2021. I was just passing my time, watching a Youtube video on a virtual assistant project. The video was quite impressive to be honest. They even used some package to extract data from Wikipedia. After watching that video, I thought to myself, is there any such package for Narutopedia? Now those of you who know me personally, know how big of a Naruto and Boruto fan I am, so I started to check if I could find one, however, I couldn't find any. I am not saying that there is no Python package for Narutopedia, there could be one, it's just that I couldn't find any. So I thought, "Why not make a simple app that can extract data from Narutopedia for anything we search?". The only problem back then was that I had no idea how to do that. I then started to research and it took only a few minutes until I realized that there i...

Swap two numbers without using a temporary variable

It's been a while since I've posted any blogs and vlogs. I've been trying to record videos for Planet of Codes Youtube channel, but there's quite a lot of noise whenever I try to record, so I thought why not I communicate through these blogs instead till I am able to record something for Youtube. So here we are, blogging for something that I actually tried to record in the form of a video. Usually in high schools and colleges, when most of us initially learn programming, we get a programming problem to swap two numbers. Usually the solution looks something like the below. num1 = 32 num2 = 87 temp = num1 num1 = num2 num2 = temp print(num1) print(num2) Note: Usually institutions ask students to write this program in C or C++ in first semester, however the above program is in Python, because, It's the logic that matters. This program can be written in any other programming language too. Well, here we are using a temporary variable "temp".  This problem can ac...

6 Hours NodeJS Challenge

So, what is Node.JS? Well, " Node.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside a web browser ". At least that's all that I know about Node right now. But, that is going to change today. Well, I saw this YouTube video a few days back where a developer, who had no idea about golang a.k.a "Go Programming Language" and managed to learn it and create a simple application using it within a few hours. He was an professionally experience developer which I certainly am not at current point of time, however, even he must have faced some challenges while doing so. After all, it was officially a challenge after all. Although I am not professionally a developer, I really wanted to take up such a challenge. This blog is a record of how the challenge went for me. Of course, a few hours of time is not sufficient to master any programming language, I think that after reaching a certain level as a programmer we can cer...

GREP - The secret weapon of UNIX/Linux

UNIX has some very powerful tools in it's arsenal in the form of it's commands. Most of these are all inherited by Linux making it a powerful free and open source operating system. One of these tools that can get quite handy is "grep" command. Grep is short for "Global Regular Expression Print". It was developed by Ken Thompson for UNIX operating system. He also created B programming language that is a direct predecessor to C programming language . He, along with Dennis Ritchie , was also involved in the creation of C programming language and UNIX operating system. If you have read my first blog , then you would know that I am fairly new to Linux, however I did learned Unix as a part of my curriculum back in the collage days. Even back then, I wasn't very good in using Unix commands. Now that I have started using Linux, I've got an opportunity to explore the terminal side of this OS. Knowing UNIX/Linux is quite a vital skill in the IT Industry. Ev...