This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <memory> | |
#include <stdexcept> | |
using namespace std; | |
template <typename T> | |
class FIFO { | |
struct Node { | |
T value; | |
shared_ptr<Node> next = nullptr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#general | |
filename = "readFileDefault.py" | |
f = open(filename) | |
lines = [] | |
for line in f: | |
lines.append(line.strip()) | |
print(lines) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(0, 5): | |
for j in range(0, i + 1): | |
# printing stars | |
print("* ", end="") | |
# ending line after each row | |
print("\r") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#using one-liner | |
# Generate Random Password | |
from random import choice | |
print(''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789%^*(-_=+)') | |
for i in range(10)])) |