Skip to main content

Posts

Featured

Let's talk about cryptography.

Have you ever heard of cryptography?  People write their diaries every day. For many of them, their diary is one of their best friends to whom they tell their every secret. What happens when someone else finds such a diary? That would freak out the dairy's owner for sure. Also, it might put their lives in danger. Wise men always hide their diaries so no one else finds it.  But legends hide their message so that only they can read what they wrote. So even if the diary is found by someone else, they cannot know the secrets. for example, I wrote this in my diary today.   P dyval h isvn wvza hivba jyfwavnyhwof avkhf Can you understand it? This is just a very primitive level of cryptography yet powerful enough to hide what I wrote from 90% of people. I will discuss this type of cryptography in the next blog post. The human used cryptography from the very beginning to share their messages in secret and conceal their inventions. As you may know, many people tried to find a recipe that tur
Recent posts

How to send and receive discord messages with your bot in 2023.

Hello everyone. Welcome back to the Blog of Chamodh today I will show you how to send and receive discord messages with your bot. Before getting started, I remind you that this is the second episode of the series How to make Discord bot in 2023 and if you haven't read the previous one, please read that first as I explain how to create your bot application and add it to a server there. READ:  https://blogofchamodh.blogspot.com/2023/02/how-to-make-your-own-discord-bot-2023.html We don't gonna use virtual environments, IDEs, or any other utility because we can use Replit for our coding purposes.  Let's Get Started. STEP1: Set up Replit It is really simple. Just go to  https://replit.com/~ and sign up if you have never used its service before and create a new Repl. I don't hope to guide you in this as this is an intermediate tutorial. Make sure to select Python as you create the new Repl because we are going to use Python for our back end. STEP 2: Get your token. To run ou

How to make a your own Discord bot with Python in 2023. #01

I'm sure that you have heard of discord bots way before reading this article. But have you ever tried to make your own bot with Python? If not, this is the time. Let's get started. Over time tons of discord bot tutorials have been published, but if you follow them they don't help you to build a functional bot because many of the packages used in them are updated and no longer support older syntaxes. Here is the full guide to creating your own Discord Bot in 2023 with Python. STEP 1: Create a Discord account First of all, we have to set up a developer account to create the bot. Actually, you can use your ordinary discord account to access the discord developer portal, but it is highly recommended to create a separate account for development purposes. You can create a new discord account with this link:  https://discord.com/register STEP 2: Create a new Application After creating the discord account, you have to go to the discord developer portal and sign in with your newly-c

Find the resultant torque of coplanar forces with Python

Hello everyone, today I will show you how to use Python to calculate the resultant torque of coplanar forces. In this article, we will consider forces on a coordinate plane as shown below. To calculate the resultant torque with this Python script, we want to know the magnitude, angle, and coordinates of each force. With this script, we can calculate the resultant torque around any point of the coordinate plane. Let's get started. First of all, we have to install Python and other required software to write our code. After installing Python correctly, open the code editor and create a new file with the .py extension. We don't have to install any other module as the only module we want to use in this project is the math module which comes with Python. You can import the math module with the following line. import math Then we have to create a dictionary to store all the information about forces. You can use a list instead of a dictionary to do that but I prefer using a dictionary

How to find the index of an element in a Python list.

Hello everyone, welcome back to my blog. I thought to start a series to answer the most googled question on my blogs (this blog and https://talksofchamodh.blogspot.com ) In the first episode I'm gonna show you how to find the index of an element in a list in Python. I'm sure this may have been answered before on other sites I promise you, this tutorial will be the most valuable and authentic answer for this most googled question.   What is a List in Python  A list is a widely used data structure in Python that allows you to store a data sequence. This data type has some unique characteristics. They allow us to manage our memory and do our stuff more efficiently. How to find the index of an element in a list in Python? To find the index of an element in a list, we can use an in-built method called list.index(x). It returns the first item whose value is equal to x. For instance, I have the following list. languages = [ 'python' , 'R' , 'C++' ] And I want

Find the nCr value with Python.

What is nCr notation? Hello everyone from this post you will know how to find any nCr value with Python. For those who don't know what nCr is, it is a standard notation in mathematics defined as shown below. This notation is widely used in permutations and combination fields and binomial expansion. Even though we can use the Pascal Triangle to expand binomials it is easier to use the binomial theorem which uses the nCr notation. The n! stands for the product of the numbers from 1 to n which is called the factorial of n. The factorial is defined only for positive integers and 0.  The factorial of 0 equals 1 The factorial of negative integers is not defined. Calculate the nCr Value. When you are provided with two values (n & r) you can use the above equation to calculate their nCr value.  For instance, if you want to find 2C1 you can follow the steps below. With Python..... As shown above you can calculate any nCr value. But when the number increases it becomes harder to calculat

Create a URL Shortener app with Python and Django Part-3

In this part... This will be the last part of the Create a URL Shortener app with Python and Django Series and if you have not read the last two parts yet please read them before you read this part.  PART 1 -  https://blogofchamodh.blogspot.com/2022/07/create-url-shortener-app-with-python.html PART 2 -  https://blogofchamodh.blogspot.com/2022/07/create-url-shortener-app-with-python-part2.html we have discussed how to set up our virtual environment and start the project and apps in part 1 and learned the logic and some important views in part 2. So it is vital to read them first. In this part, I will show you how to, Create the URL patterns Writing the template. Write the redirect view Create the URL patterns. To handle the URL requests we can create the URL patterns as shown below. from django . contrib import admin from django . urls import path from url_shortener import views urlpatterns = [     path ( 'admin/' , admin . site . urls ),     path ( 'create/' ,