Skip to content

Instantly share code, notes, and snippets.

View wiseaidev's full-sized avatar
🦀
Rusting!

Mahmoud wiseaidev

🦀
Rusting!
View GitHub Profile
import cv2
from xml.dom import minidom
import numpy as np
from scipy.signal import convolve2d as conv
import matplotlib.pyplot as plt
import sys
if __name__ == "__main__":
# path to the cascade file
cascade_path = "Haar_Cascades/haarcascade_frontalface_default.xml"
# open and parse the xml file
import socket
import sys
import time
if __name__ == "__main__":
HOST = "localhost"
PORT = 3333
try:
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print("\n[*] Socket successfully created")
except socket.error as err:
import socket
if __name__ == "__main__":
HOST = "localhost"
PORT = 3333
try:
client_Socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print("\n[*] Socket successfully created")
except socket.error as err:
print("\n[*] Socket creation failed with error : ",err)
print("\n[*] Connecting to server @ ip = {} and port = {}".format(HOST,PORT))
''' usage :
python3 Server.py
'''
import numpy as np
import cv2
import socket
import pickle
import struct
from Recognize import *
if __name__ == "__main__":
''' usage :
python3 Client.py -v videos/video3.mkv
'''
import socket
import numpy as np
import cv2
import pickle
import struct
import time
import sys
''' usage :
python3 Server.py
'''
import numpy as np
import cv2
# Import the socket library
import socket
import pickle
import struct
from Recognize import *
@wiseaidev
wiseaidev / sleep_sort.py
Last active June 1, 2022 18:38
A pythonic implementation of the sleep sort algorithm.
from concurrent.futures import ThreadPoolExecutor
from time import sleep
from typing import List, Union
def sleep_sort(input_list: List[Union[int, float]]) -> List[Union[int, float]]:
sorted_list: List[Union[int, float]] = []
def inner(item: Union[int, float], sorted_list: List[Union[int, float]]) -> None:
sleep(item)
sorted_list.append(item)
@wiseaidev
wiseaidev / merge_lists.py
Created June 2, 2022 15:51
Different methods to merge two lists.
import random
import itertools
import operator
import functools
import collections
def extend(list1_list2):
list1, list2 = list1_list2
merged_list = []
merged_list.extend(list1)
@wiseaidev
wiseaidev / binary_search.py
Created June 3, 2022 18:36
Recursive and iterative versions of the binary search algorithm.
from typing import Union, TypeVar
E = TypeVar("E", bound=Union[int, float])
def recursive_binary_search(array: list[E], left: E, right: E, target: E) -> int:
if array != sorted(array):
array.sort()
if left is None:
left = 0

Keybase proof

I hereby claim:

  • I am wiseaidev on github.
  • I am wiseai (https://keybase.io/wiseai) on keybase.
  • I have a public key whose fingerprint is 6C63 E3A7 C1B9 E36D F2DE 91C9 FC86 41B7 1E19 147B

To claim this, I am signing this object: