Skip to content

Instantly share code, notes, and snippets.

View nobleknightt's full-sized avatar
🎯
Focusing

Ajay Dandge nobleknightt

🎯
Focusing
View GitHub Profile
@nobleknightt
nobleknightt / beep.py
Created June 16, 2024 11:08
Motion detection with camera using OpenCV
#
# beep sound using python
# -----------------------
#
# reference
# ---------
# * extract audio sample from wave file as numpy.array
# https://stackoverflow.com/a/54174291/14429185
#
# from scipy.io import wavfile
@nobleknightt
nobleknightt / extract_download_urls.py
Created June 16, 2024 10:59
Download anime episodes from animepahe.ru
import argparse
from pathlib import Path
from time import sleep
import requests
from bs4 import BeautifulSoup, element
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
@nobleknightt
nobleknightt / read_medium.py
Created June 16, 2024 10:41
Read Medium's member-only stories with Python
"""
Usage:
- Linux: `python3 read_medium.py MEDIUM_URL`
- Windows: `python read_medium.py MEDIUM_URL`
"""
import sys
from selenium import webdriver
from selenium.webdriver.common.by import By
@nobleknightt
nobleknightt / complexity-analysis.ipynb
Created July 1, 2021 10:54
complexity-analysis.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nobleknightt
nobleknightt / oop-python.ipynb
Last active June 1, 2021 06:55
🔰 Object-Oriented Programming in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Sum of elements in vector. 👇

#include <iostream>   // std::cout
#include <vector>     // std::vector
#include <numeric>    // std::accumulate
#include <functional> // std::plus

int main() {
    std::vector<int> v = {1, 2, 3, 4, 5};
    std::cout << std::accumulate(v.begin(), v.end(), 0, std::plus<int>()); // 15