This file contains 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 numpy as np | |
import cv2 | |
import time | |
from ultralytics import YOLO | |
# creating the videocapture object | |
# and reading from the input file | |
# Change it to 0 if reading from webcam | |
cap = cv2.VideoCapture('/home/ubuntu/testvideo.mp4') |
This file contains 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
void solve_quartic_equation(std::complex<double> x[], std::complex<double> a, std::complex<double> b, std::complex<double> c, std::complex<double> d, std::complex<double> e) | |
{ | |
if (!(islessequal(std::abs(std::real(a)), std::numeric_limits<double>::epsilon()) && islessequal(std::abs(std::imag(a)), std::numeric_limits<double>::epsilon()))) | |
{ | |
std::complex<double> alpha = std::complex<double>(-3.0) * std::pow(b, 2) / (std::complex<double>(8.0) * std::pow(a, 2)) + c / a; | |
std::complex<double> beta = std::pow(b, 3) / (std::complex<double>(8.0) * std::pow(a, 3)) - b * c / (std::complex<double>(2.0) * std::pow(a, 2)) + d / a; | |
std::complex<double> gamma = std::complex<double>(-3.0) * std::pow(b, 4) / (std::complex<double>(256.0) * std::pow(a, 4)) + c * std::pow(b, 2) / (std::complex<double>(16.0) * std::pow(a, 3)) - b * d / (std::complex<double>(4.0) * std::pow(a, 2)) + e / a; | |
std::complex<double> P = -std::pow(alpha, 2) / std::complex<double>(12.0) - gamma; | |
std::complex<double> Q = -st |
This file contains 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<cstdio> | |
#include<cstring> | |
#ifdef _WIN32 | |
#include <winsock2.h> | |
#include <ws2tcpip.h> | |
#else | |
#include<unistd.h> |
This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <OMX_Component.h> | |
#include <OMX_Core.h> | |
#include "tsemaphore.h" |
This file contains 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
# | |
# Himawari-8 Downloader | |
# | |
# | |
# | |
# This script will scrape the latest image from the Himawari-8 satellite, recombining the tiled image, | |
# converting it to a JPG which is saved in My Pictures\Himawari\ and then set as the desktop background. | |
# | |
# http://himawari8.nict.go.jp/himawari8-image.htm | |
# |
This file contains 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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
import urllib | |
params = { | |
'SN': 'MR', | |
'SNID': '2586199091372632788', | |
'AMOUNT': 2, | |
'PLAYDOMS': 10 |
This file contains 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
@gen.engine | |
def get_user_data(self, sn, snid, fast_withdrawals): | |
end_timestamp = time.time() | |
start_timestamp = end_timestamp - CONFIG.LOYALITY_LEVELS.PERIOD | |
active_apps_response, total_payments_response, payments_for_period_response, withdrawals_response = yield [ | |
gen.Task(self.http_client.fetch, self.__get_active_apps_url(sn, snid)), gen.Task(self.http_client.fetch, self.__get_total_payments_url(sn, snid)), | |
gen.Task(self.http_client.fetch, self.__get_payments_sum_for_period_url(sn, snid, start_timestamp, end_timestamp)), | |
gen.Task(self.http_client.fetch, self.__get_total_withdrawals_url(sn, snid, fast_withdrawals)) | |
] |
This file contains 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 <cuda.h> | |
#include <curand_kernel.h> | |
#include <stdio.h> | |
#define CUDA_CALL(x) do { if((x) != cudaSuccess) { \ | |
printf("Error at %s:%d -- %s\n",__FILE__,__LINE__, cudaGetErrorString(x)); \ | |
return EXIT_FAILURE;}} while(0) | |
#define N 10000 |