Skip to content

Instantly share code, notes, and snippets.

View shoaibmehedi7's full-sized avatar
:octocat:
Working from home

MD Shoaib Mehedi shoaibmehedi7

:octocat:
Working from home
View GitHub Profile
#include<bits/stdc++.h>
using namespace std;
// Pushing element on the top of the stack
stack<int> stack_push(stack<int> stack)
{
for (int i = 0; i < 5; i++)
{
stack.push(i);
}
#include <memory>
#include <stdexcept>
using namespace std;
template <typename T>
class FIFO {
struct Node {
T value;
shared_ptr<Node> next = nullptr;
import cv2
import mediapipe as mp
import time
class poseDetection():
def __init__(self, mode=False, upBody=False, smooth=True, detectionConf=0.5, trackConf=0.5):
self.mode = mode
import cv2
import numpy as np
cap = cv2.VideoCapture('/home/pyarena/python/OpenCV/MotionDetection/video.mp4')
#cap = cv2.VideoCapture(-1)
ret, frame1 = cap.read()
ret, frame2 = cap.read()
import cv2
import mediapipe as mp
import time
mpDraw = mp.solutions.drawing_utils
mpPose = mp.solutions.pose
pose = mpPose.Pose()
cap = cv2.VideoCapture('/home/pyarena/python/OpenCV/poseDetection/pose.mp4')
def main():
cap = cv2.VideoCapture(
'/home/pyarena/python/OpenCV/poseDetection/pose3.mp4')
pTime = 0
detector = poseDetection()
while True:
success, img = cap.read()
img = detector.findPose(img)
lmList = detector.findPostion(img, draw=False)
# print(lmList[14])
x = 5
y = 10
# To take inputs from the user
#x = input('Enter value of x: ')
#y = input('Enter value of y: ')
# create a temporary variable and swap the values
temp = x
x = y
#general
filename = "readFileDefault.py"
f = open(filename)
lines = []
for line in f:
lines.append(line.strip())
print(lines)
for i in range(0, 5):
for j in range(0, i + 1):
# printing stars
print("* ", end="")
# ending line after each row
print("\r")
#using one-liner
# Generate Random Password
from random import choice
print(''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789%^*(-_=+)')
for i in range(10)]))