December 20, 2021

Password Generator using python || codeAj

 Password Generator  using python


import random
lower='abcdefghijklmnopqrstuvwxyz'
upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
number = '0123456789'
symbol='[]{}#()*;._-'
all=lower+upper+number+symbol
length=8
i=1
while(i<=10):
password = "".join(random.sample(all,length))
print(password)
i+=1

August 27, 2021

video downloader UI using html || codeaj

 







Source code

<!DOCTYPE html>

<html>

    <head>

    <title>Youtube Downloader</title>

        <style>

            body{

                padding:20px

            }

            form{

                border-style:inset;

                text-align: center;

                background-color:lightgray;

                border-radius: 10px

                

                

            }    

            p{

                font-family: sans-serif

            }

            h1{

                font-family: monospace;

                color: brown

            }

        </style>

    </head>

    <body bgcolor="Darkgray">

        <spam><img src="logo.png" alt="Logo" width="50" height="50"></spam>

        <font size=40 color="brown">Utoob</font>

        <p>utoob is most powerful tool to download youtube videos and also there is option to download videos in different qualities .<br>

        if you are talking about or server then its is the one of the most faster server entire the world.

        and also you an download mp3 files of the these videos . me and my teams are continuesly working to improver our website and make it more faster.

        </p>

        

        <form>

        <h1>Youtube Downloader </h1>

        <img src="logo.png" alt="Logo" width="150" height="150">

        <h3><u>Paste Youtube link</u></h3>

        

        <input type="text" autofocus>

            <button type="reset">Clear</button>

            <br><br>

        

            <button type="button">convert</button>

            <br><br>

        </form><br>

        <form>

            <p><b>Speed Test App using kivy,kivymd(python) || codeaj</b> <p>

            

            <p><b>Rating : </b>4.5</p>

            <p><b>Views : </b>16734</p>

            

            <img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPcwB1TdEz36vXYsTgI7GyfudEiSTQQAZTm5SZ_jKOEbycvuo3eTS1hs3H97orDoRNt-QDWm3DaM4tnVLqJD4ygiPsKvgD5GDM-U-NHOWAHEoitRrlN7cp0cd8RuOKL2Dr6Ph5qSMXDIl-/s1920/shapeeee.png" alt="thembnel_image" width="200" >

            

            <p><u><b>select video quality</b></u></p>

        <input type=radio name="quality">Mp3 

        <input type=radio name="quality">3gp

        <input type=radio name="quality">360p

            

        <input type=radio name="quality">720p

            

        <input type=radio name="quality">1080p

        <br><br>

            <button type="button" onclick="downloaded">download</button><br><br>


        </form>

        

        <p>

        If you have created original content for your website, copyright &copy; law can protect it. Every website should include a brief statement identifying the copyright&copy; owner. Providing such a statement gives notice to visitors that your website belongs to you and that they cannot copy the content without your permission.

        </p>

        

        

        

    </body>

</html>

July 22, 2021

Login UI using kivymd ,kivy (Python)

 Login User Interface Screen using kivyMD kivy (python).











Source Code

 

from kivymd.app import MDApp
from kivy.lang.builder import Builder
from kivy.core.window import Window
from kivymd.uix.button import MDRectangleFlatButton
from kivymd.uix.dialog import MDDialog

Window.size=(350,600)
UI = '''
#:import Snackbar kivymd.uix.snackbar.Snackbar

MDBoxLayout:
orientation : 'vertical'
MDToolbar :
title : "Wordpress Post"
right_action_items :[["weather-sunny",lambda x : app.blackwhit()]]
elevation : 20

MDGridLayout:
cols : 1
padding : 30,60,30,100
spacing : 10
pos_hint : {"center_x":.5,"center_y":.5}
MDCard:
#size_hint: None, None
#size: "280dp", "180dp"
pos_hint: {"center_x": .5, "center_y": .5}
radius: [20,]
elevation : 30
opacity : .9
MDBoxLayout:
orientation : 'vertical'
padding :10,10,10,70
spacing : 10
Image :
source : "wordpress.png"
#opacity : .9
pos_hint: {"center_x": .5, "center_y": .2}
size_hint : .8,.8

MDTextField :
id : username
hint_text : "Enter username "
helper_text:'Hint : codepyy,codeaj'
helper_text_mode : "on_focus"
icon_right : "wordpress"
icon_right_color : app.theme_cls.primary_color
pos_hint : {'center_x': 0.5, 'center_y': 1}
size_hint_x: None
width : 250

MDTextField :
id : pass
hint_text : "Password"
helper_text:'Hint : CodeAj123'
helper_text_mode : "on_focus"
icon_right : "eye-off"
password : True
icon_right_color : app.theme_cls.primary_color
pos_hint : {'center_x': 0.5, 'center_y': 0.8}
required: True
size_hint_x: None
width : 250

MDRoundFlatButton :
text : "Post"
pos_hint : {'center_x': 0.5, 'center_y': 0.1}
on_press : app.post()
on_release: Snackbar(text="news is poated").open()




'''


class WordPressUI(MDApp):
def build(self):
self.theme_cls.theme_style = "Dark"
self.theme_cls.primary_palette = "Gray"
return Builder.load_string(UI)

def blackwhit(self):

if self.theme_cls.theme_style == "Light" :
self.theme_cls.theme_style = "Dark"
self.theme_cls.primary_palette = "Gray"
else :
self.theme_cls.theme_style = "Light"
self.theme_cls.primary_palette = "Blue"

def close_dilog(self, obj):
self.dialog.dismiss()

def post(self):
print(self.root.ids.username.text)
close = MDRectangleFlatButton(text="Close", on_release=self.close_dilog)
more = MDRectangleFlatButton(text="Download")
self.dialog = MDDialog(title=f"POSTING...",
size_hint_y=None,
height="600",
text=f"Author : ",
size_hint=(0.9, 1),
buttons=[close, more],
)
self.dialog.open()
if __name__ == '__main__':
WordPressUI().run()

please follow 

June 14, 2021

shape detection project using python openCV modul


source code 


import cv2
import numpy as np


def stackImages(scale,imgArray):
rows = len(imgArray)
cols = len(imgArray[0])
rowsAvailable = isinstance(imgArray[0], list)
width = imgArray[0][0].shape[1]
height = imgArray[0][0].shape[0]
if rowsAvailable:
for x in range(0, rows):
for y in range(0, cols):
if imgArray[x][y].shape[:2] == imgArray[0][0].shape[:2]:
imgArray[x][y] = cv2.resize(imgArray[x][y], (0, 0), None, scale, scale)
else:
imgArray[x][y] = cv2.resize(imgArray[x][y], (imgArray[0][0].shape[1], imgArray[0][0].shape[0]),
None, scale, scale)
if len(imgArray[x][y].shape) == 2: imgArray[x][y] = cv2.cvtColor(imgArray[x][y], cv2.COLOR_GRAY2BGR)
imageBlank = np.zeros((height, width, 3), np.uint8)
hor = [imageBlank] * rows
hor_con = [imageBlank] * rows
for x in range(0, rows):
hor[x] = np.hstack(imgArray[x])
ver = np.vstack(hor)
else:
for x in range(0, rows):
if imgArray[x].shape[:2] == imgArray[0].shape[:2]:
imgArray[x] = cv2.resize(imgArray[x], (0, 0), None, scale, scale)
else:
imgArray[x] = cv2.resize(imgArray[x], (imgArray[0].shape[1], imgArray[0].shape[0]), None, scale, scale)
if len(imgArray[x].shape) == 2: imgArray[x] = cv2.cvtColor(imgArray[x], cv2.COLOR_GRAY2BGR)
hor = np.hstack(imgArray)
ver = hor
return ver

def getcounters(img):
countours,hierarchy=cv2.findContours(img,cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_NONE)
for cnt in countours:
area=cv2.contourArea(cnt)
print (area)
if area>500:
cv2.drawContours(imgcountour,cnt,-1,(255,0,0),3)
peri=cv2.arcLength(cnt,True)
print(peri)
approx=cv2.approxPolyDP(cnt ,0.02*peri,True)
print(approx)
print(len(approx))
objcor=len(approx)
x,y,w,h=cv2.boundingRect(approx)
if objcor==3:
objectType=f"triangle {area}"
elif objcor==4:
aspectRatio=w/float(h)
if aspectRatio>0.95 and aspectRatio<1.05 :
objectType=f"Square {area}"
else:
objectType=f"Rectangle {area}"
elif objcor>4:
objectType=f"circle {area}"
else:
objectType="not define"

cv2.rectangle(imgcountour,(x,y),(x+w,y+h),(0,255,0),2)

cv2.putText(imgcountour,objectType,(x+(w//2)-10,y+(h//2)-10),cv2.FONT_HERSHEY_COMPLEX,0.5,(0,0,0),2)


#path='shape.jpg'

#img=cv2.imread(path)

cap=cv2.VideoCapture(0)
cap.set(3,1080) #width (chanel number,size)
cap.set(4,800) #height
cap.set(10,100) #brightness
while True:
sucess,img=cap.read()


imgcountour= img.copy()

imgGray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
imgBlur = cv2.GaussianBlur(imgGray,(7,7),1)
imgCanny=cv2.Canny(imgBlur,50,50)
getcounters(imgCanny)

imgBlank=np.zeros_like(img)

# stackimg=stackImages(0.8,([img],[imgcountour]))
cv2.imshow("image ",imgcountour)
#cv2.imshow("stack image ",stackimg)
#cv2.waitKey(0)
#cv2.imshow("video", img)

if cv2.waitKey(1) & 0xff == ord("q"):
break

May 30, 2021

engineering mathematics 3 solutions || module -1

 

engineering mathematics 3 solutions

part 1

credit to Dr. Akhilesh Jain ( Asst. Professor, Department of Mathematics)


Get all engineering mathematics 3 solutions(m3)  from the given link 

Click here

please follow


May 19, 2021

check the triangle is valid or not using c++

 Question : if three sides of a triangle are entered through the keyboard, write a program to check whether the triangle is valid or not. the triangle is valid if the sum of two sides is greater than the largest of three sides.



source code 

#include <iostream>

#include<conio.h>

int greternum(int ,int,int); 

int sumofsmaller(int ,int ,int,int );

using namespace std;



int main()

{

int a,b,c,grater,smaller;

cout<<"Enter 3 number : ";

cin>>a>>b>>c;

grater=greternum(a,b,c);

smaller=sumofsmaller(a,b,c,grater);

//cout<<grater <<endl<<smaller <<endl;

if (smaller > grater)

{

cout<<"it is valid triangle ";

}

else 

{

cout<<"it is not valid triangle ";

}  


getch();

return 0;

}



int sumofsmaller(int a, int b,int c,int grater)

{

if (a<grater && b<grater)

{

return a+b;

}

else if (a<grater && c<grater )

{

return a+c;

}

else

{

return c+b;

}

}


int greternum(int num1,int num2,int num3)

{

if (num1<num2 && num3<num2)

{

return num2;

}

else if (num1<num3 && num2<num3 )

{

return num3;

}

else

{

return num1;

}

}

May 18, 2021

covid19 updater

 covid19 updater is a desktop app used to upload live coronavirus data on your Facebook page post. by just click on the start button. 


Screenshots 




output post photo :




download exe file 

covid19 updater


April 17, 2021

Area of triangle with given sides using c++

 Question :

if lengths of three sides of the triangle are input through the keyboard ,write a program to find the area of the triangle .

SCREENSHOTS 











SOURCE CODE 


#include <iostream>

#include<conio.h>

#include <math.h>

using namespace std;

int main()

{

int a,b,c ;

float area;

cout <<"Enter 3 sides of triangle : \n";

cin>>a>>b>>c;

area=sqrt(pow(((4*a*a*b*b)-((a*a)+(b*b)-(c*c))),2))/4;

cout<<area;

}

April 07, 2021

Reverse given 5 digit numbers using C++ programming

 Question: If a five-digit number is input through the keyboard. Write a program to reverse a number.


solution : 


Screenshot



source code 

#include <iostream>

#include<conio.h>

using namespace std ;

int main()

{

int n;

int rev[6],revn=0;

cout<<"Enter a 5 digit number : ";

cin >>n;

for(int i=1; i<6; i++)

{

rev[i]=n%10;

n=n/10;

}

for(int i=1; i<6; i++)

{

cout<<rev[i];

}

}

Sum of 5 digit number using c++

 QN 1. if a five-digit number is input through the keyboard ,write a program to calculate the sum of digits. (hint: Use the modules operator '%').

solution:

Screenshot 





SOURCE CODE

#include <iostream>

#include<conio.h>

using namespace std ;

int main()

{

int n;

int sum =0;

cout<<"Enter a 5 digit number : ";

cin >>n;

for(int i ; i<6; i++)

{

sum = sum + n%10;

n=n/10;

}

cout<<sum;

}



April 04, 2021

weather app using tkinter python

In this app, we use API to get the weather information. 
 we use free API in this project you can also buy.

screenshots of Weather app




SOURCE CODE 

#IMPORTS MODULE 
import tkinter as tk
import requests
import time
import os

#DEFINE FUNCTION TO GET WEATHER INFORMATION
def getweather(root):
    try:
        city=textfield.get()
        api="http://api.openweathermap.org/data/2.5/weather?q="+city+"&appid=d9db53c6ebe4a8110caa93993b1d48d5"
        json_data=requests.get(api).json()
        condition= json_data['weather'][0]['main']
        temp=int(json_data['main']['temp']-273.15)
        temp_min = int(json_data['main']['temp_min'] - 273.15)
        temp_max = int(json_data['main']['temp_max'] - 273.15)
        pressure = json_data['main']['pressure']
        humidity = json_data['main']['humidity']
        wind = json_data['wind']['speed']
        sunrise=time.strftime("%I:%M:%S", time.gmtime(json_data['sys']['sunrise']-19800))
        sunset = time.strftime("%I:%M:%S", time.gmtime(json_data['sys']['sunset'] - 19800))

        final_info = condition + "\n" + str(temp) + "℃"
        final_data = "\nMax Temperature : "+str(temp_max)+"\nMin Temperature : "+str(temp_min)+"\nPressure : "+str(pressure)+"\nHumidity : "+str(humidity)+"\nWind Speed : "+str(wind)+"\nSunRise : "+str(sunrise)+"\nSunSet : "+str(sunset)


        l1.config(text = final_info)
        l2.config(text = final_data)
    except:
        invalid="invalid city name OR there is no internet connection !! "
        i.config(text=invalid)

#GUI PART USING TKINTER
root = tk.Tk()
root.geometry("500x600")
root.title ("weather app")
f=("poppins",15,"bold")
t=("poppins",35,"bold")
col='gray22'
fcol='gray'


root.configure(background = col)    #backgroung color
l0=tk.Label(root,text='City/Place Name',font=t,bg= col,fg=fcol).pack()
l3=tk.Label(root ,text='powered by ajay',font='poppins 10 bold', bg = col,fg= fcol ).place(x='350',y='550')


textfield=tk.Entry(root,font=t,bg=col,fg=fcol)
textfield.pack(pady=20)
textfield.focus()
textfield.bind('<Return>',getweather)

i=tk.Label(root,bg=col,fg=fcol,font ='areal 10 bold')
i.pack()

l1=tk.Label(root,font = t,bg=col,fg=fcol)
l1.pack()
l2=tk.Label(root,font=f,bg=col,fg=fcol)
l2.pack()

# it creates a loop to view the GUI continues.
root.mainloop()


Project GIT link












March 24, 2021

Decimal into Binary converter using python

In this blog you you can learn how to how to make decimal to binary converter program.


process of conversion :-












source code : 

#decimal to binary converter

def dec_bin(dec):                        #define function

    binnum=[0]*dec                        #list created

    i=0                                             #assign i for count

    while dec > 0:                            #while loop

        binnum[i] = dec%2                #logic part 1

        dec = dec//2                            #logic part 2

        i += 1                                      #increase by 1

    for j in range (i-1,-1,-1):                         #for loop for reverse the binary number to p

        print(binnum[j],end="")                    #printing binary number    

dec = int(input("enter the decimal number : "))                #take input through user 

dec_bin(dec)                                                                       #function calling.. 


March 23, 2021

Sum of all digit of number using python

 Question :

Find sum of all digit of number :-

this problem is solved by two method  :-

1st is without recursion method and 

2nd is using recursion method 

let's start ,

Without recursion method 

step 1 :

make a function with name sumofDigit(num) : and pass the argument which is entered from the user 

def sumofDigit(num):


step 2 :

we use while loop here for checking if num is grater then 0 is show in the code below :-

add=0

while num>0:

if the condition is True then we move to the next step


step 3 :

this step is totally on logic as shown below : -

add  =  add  + num%10

num = num//10

print(add)                #to print the result


step 4 :

in the step you come out from the function and call the function  as shown below : -

num=int (input("enter the number : "));            #take input through user 

sumofDigit(num)                     #function call 


COMPLETE SOURCE CODE 



1st method of without using recursion 

#sum of 4 digit number without recursion


num=int (input("Enter the number : "))

add=0

while num>0:

     add=add+num%10

     num=num//10


print(add)


2nd Method using recursion 

#sum of 4 digit using recurssion

def sdig(num):

    if num==0:

        return 0

    return ((num%10) + sdig(num//10))



num=int (input("Enter the number : "))

print(f"sum of digit of {num} is {sdig(num)}")


March 22, 2021

Reverse digit using python

 Question :

write a function reverse_number () to return the reverse of the number entered.

Example :

Reverse_number(1234) display 4321




Source code :




def reverse_number (num):

    add=""

    while (num > 0):

        n=num%10                                  # logic 

        num=num//10                                               


        add=str(add)+str(n)

    print(add)


num = int (input("Enter the number : "))

reverse_number(num)


March 20, 2021

InstaBot module Upload photo on instagram using python

 Instabot


In  this session  we learn how to upload picture using python library called instabot .

How to instabot on your pc .

step 1: 

go to the START, search  cmd then, press enter key

after that your command prompt is open as show in the given picture : -


step 2: 

you have to type pip install instbot and press ENTER  on the command prompt as shown in picture below : -



AFTER doing this all steps then your instabot is successfully installed on your pc . as shown in picture below : -



now go to the OPEN your IDLE and write the code below : -

Source Code


from instabot import Bot

bot=Bot()

bot.login(username= "yout username ",password="your password")

bot.upload_photo("C:/Users/ajay pandit/Desktop/UtubDownloader 18-03-2021 08_17_23.png" ,caption=" write caption here " )


March 19, 2021

mini robot project using python

 Mini robot using python 













In this project we use four library

1. SpeechRecognition library

2. wikipedia libirary

3. gTTS library

4. pyaudio library

5. playsound library 



source code

import speech_recognition as sr

import wikipedia

from gtts import gTTS

from playsound import playsound


#recording part

for i in range(1,10):

    rec = sr.Recognizer()

    with sr.Microphone() as source:

        print("clearing backgroung noise.....")

        rec.adjust_for_ambient_noise(source, duration=1)

        print("weating for your message : ")

        recaudio = rec.listen(source)

        print("recording done... !")

    try:

        # recording to text converting part

        print("printing the message ....")

        text = rec.recognize_google(recaudio, language='hindi-IN')

        print(f"your messange is : {format(text)}")


        # listining part

        topic = (f"searching for ---> {format(text)}")

        summ = wikipedia.summary(topic)

        print(summ)

        tts = gTTS(summ)

        tts.save(f"wiki{format(text)}.mp3")


        # reading audio file

        print("reading.....")

        playsound(f"wiki{format(text)}.mp3")


    except:

        print("keyword is not found !!")


March 18, 2021

Digital clock using C++

Digital clock using c++
Object oriented concepts are used in this program...........



 

source code 

#include<iostream>

#include<conio.h>

#include<windows.h>

using namespace std;

class time

{

public:

int h,m,s;

public:

void gettime()

{

int e=0;

while (e==0)

{

cout<<"hour : ";

cin>>h;

cout<<"minute : ";

cin>>m;

cout<<"secound : ";

cin>>s;

if (h<24 && m<60 && s<60)

{

e++;

}

else

{

system ("cls");

}

}

}

void conditions()

{

system("cls");

cout<<h<<":"<<m<<":"<<s<<endl;

Sleep(1000);

s++;

}

void secound()

{

if (s>59)

{

s=0;

m++;

}

}

void minute ()

{

if (m>59)

{

m=0;

h++;

}

}

void hour ()

{

if (h>24)

{

h=0;

}

}

};


int main()

{

int a=0;

time obj;

obj.gettime();

while(a==0)

{

obj.conditions();

obj.secound();

obj.minute();

obj.hour();

}

}

March 07, 2021

strong number using python

 Strong number is a special number whose sum of factorial of digits is equal to the original number. For example: 145 is strong number. Since, 1! + 4!

IDLE view : 













source code :

#strong number 145

def fact(n):    #calculating factorial 

    if (n>0):

        return (n*fact(n-1))

    else:

        return (1)

#strong number  code

add=0

num=input("enter the number : ")

l=(len(num))

for i in range(0,l):

    add=add+fact(int(num[i]))

if int(num)==add:

    print(f"{num} is strong number ")

else:

    print (f"{num} is not strong number ")

    



prime number using python

 Positive integer greater than 1 which has no other factors except 1 and the number itself is called a prime number. 2, 3, 5, 7 etc. are prime numbers as they do not have any other factors. But 6 is not prime (it is composite) since, 2 x 3 = 6.









num=int(input("enter the numbr : "))


for i in range (2,num):

    if (num%i != 0 ):

        print(f"{num} is  a prime number ")

        break

    else:

        print (f"{num} is not prime number ")

        break;


video :




find the cube of the range given digits. || codeAj

Find the cube of the range given Digits. Source Code r= int ( input ( "enter the range of digit : " )) def number_conter (n): ...