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
/* | |
* Round robin algorithm. | |
* | |
* It got rid of the disadvantages of the greedy algorithm, | |
* so each process gets an equal amount of CPU time, that makes round-robin the most efficient on big numbers of processes. | |
* But for little numbers it could be less efficient (depending on the quantum factor). | |
*/ | |
#include <stdio.h> | |
#include <limits.h> |
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
# USAGE: | |
# Get creds on https://stepik.org/oauth2/applications/ | |
# s = Stepik('client_id', | |
# 'client_secret') | |
# link = s.upload_file(path_to file, stepik_filename, course=102606) | |
from os import PathLike | |
from typing import Union |
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
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
import math | |
# Clover imports | |
import rospy | |
from clover import srv | |
from std_srvs.srv import Trigger | |
# Computer vision imports |
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
from PyQt5 import QtGui | |
from PyQt5.QtWidgets import QApplication, QDialog, QProgressBar, QPushButton, QVBoxLayout | |
import sys | |
from PyQt5.QtCore import Qt, QThread, pyqtSignal | |
import time | |
class MyThread(QThread): | |
# Create a counter thread | |
change_value = pyqtSignal(int) |
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 serial | |
def search(): | |
found = False | |
for j in range(3): | |
for i in range(64): | |
try: | |
if j == 0: | |
port = "/dev/ttyACM" + str(i) | |
elif j == 1: |
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 "mavlink.h" | |
// Launch the serial port in setup | |
void setup() { | |
// MAVLink interface start | |
Serial.begin(57600); | |
Serial3.begin(57600); | |
Mav_Request_Data(); |
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
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters | |
import logging | |
from uncv import classificate | |
# Enable logging | |
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', | |
level=logging.INFO) | |
logger = logging.getLogger(__name__) |
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 as cv | |
import numpy as np | |
def check(frame, mask): | |
contours = cv.findContours(mask, cv.RETR_TREE, cv.CHAIN_APPROX_NONE) | |
contours = contours[1] | |
if contours: | |
contours = sorted(contours, key=cv.contourArea, reverse=True) |