Skip to content

Instantly share code, notes, and snippets.

View NicholasShatokhin's full-sized avatar

Nicholas Shatokhin NicholasShatokhin

  • Donets'k, Ukraine
View GitHub Profile
#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
@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))
]
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2
import urllib
params = {
'SN': 'MR',
'SNID': '2586199091372632788',
'AMOUNT': 2,
'PLAYDOMS': 10
@NicholasShatokhin
NicholasShatokhin / himawari.ps1
Created February 4, 2016 00:04 — forked from anonymous/himawari.ps1
Himawari-8 Downloader corrected by tproger
#
# 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
#
@NicholasShatokhin
NicholasShatokhin / main.c
Created May 8, 2018 15:17
OpenMAX h264 decoding video
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <OMX_Component.h>
#include <OMX_Core.h>
#include "tsemaphore.h"
@NicholasShatokhin
NicholasShatokhin / main.cpp
Created August 13, 2019 15:07 — forked from mtvee/main.cpp
cross platform socket example c/c++
#include<cstdio>
#include<cstring>
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include<unistd.h>
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
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')