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
// Prabindh Sundareson 2020 | |
// Age of the lockdown | |
#include "pch.h" // include #include "httplib.h" in this file | |
#include <iostream> | |
static httplib::Server svr; | |
void pressSpace() | |
{ |
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 network | |
import urequests | |
import ujson | |
import machine | |
import time | |
def do_post(url, data): | |
headers = {'Content-Type': 'application/json'} |
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 http.server import HTTPServer, BaseHTTPRequestHandler | |
from io import BytesIO | |
import os | |
import json | |
from pyautogui import press | |
def do_POST(self): | |
press('space') | |
# Standard respnse sequence headers fill here |
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
#!/bin/bash | |
MULT="100" | |
NIGHTLIES=14 | |
STABLE=13 | |
LOWEST=11 | |
RAPIDS_VERSION="0.$STABLE" | |
RAPIDS_RESULT=$STABLE | |
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
using cudf instead of Pandas | |
(Add -y for conda install rapidsai channel as below, else it waits for input) | |
!wget -c https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh | |
!chmod +x Anaconda3-5.1.0-Linux-x86_64.sh | |
!bash ./Anaconda3-5.1.0-Linux-x86_64.sh -b -f -p /usr/local | |
!conda install -y -c rapidsai -c nvidia -c numba -c conda-forge \ | |
cudf=0.13 python=3.6 cudatoolkit=10.1 | |
import cudf |
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 <iostream> | |
#include <chrono> | |
#include <ctime> | |
int main() { | |
auto timenow = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); | |
std::cout << "It sings at " << ctime(&timenow); | |
return 0;} |
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 <libavutil/timestamp.h> | |
#include <libavformat/avformat.h> | |
static FILE *open_file_write(const char *file); | |
static FILE *open_file_read(const char *file); | |
static size_t write_packt_to_file(AVPacket *packet, FILE *file); | |
static size_t read_packt_from_file(AVPacket *packet, FILE *file); | |
static void close_file(FILE *file); | |
static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt, const char *tag) |
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
static void ffmpeg_avcodec_log(void *ptr, int val, const char * msg, va_list ap) | |
{ | |
} | |
// As below, ffmpeg_avcodec_log_function() | |
av_log_set_callback(ffmpeg_avcodec_log_function); |
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
// Modified from - https://gist.github.com/cedricve/a7f6817c18eeb19a0716ed0ca0e037c4 | |
// Open the initial context variables that are needed | |
SwsContext *img_convert_ctx; | |
AVFormatContext* format_ctx = avformat_alloc_context(); | |
AVCodecContext* codec_ctx = NULL; | |
int audio_stream_index; | |
std::ofstream output_file; | |
int64_t last_time = 0, first_time = 0; |
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
// Modified from https://gist.github.com/cedricve/a7f6817c18eeb19a0716ed0ca0e037c4 | |
// Open the initial context variables that are needed | |
SwsContext *img_convert_ctx; | |
AVFormatContext* format_ctx = avformat_alloc_context(); | |
AVCodecContext* codec_ctx = NULL; | |
int video_stream_index; | |
std::ofstream output_file; | |
int64_t last_time = 0, first_time= 0; |