Planet R (km) mass (x 10^29 kg)
Sun 696000 1.9891e+09
Earth 6371 5973.6
Moon 1737 73.5
Mars 3390 641.85
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<opencv2/opencv.hpp> | |
cv::Mat Thinning(cv::Mat image) { | |
//https://github.com/bsdnoobz/zhang-suen-thinning | |
CV_Assert(image.channels() == 1); | |
CV_Assert(image.depth() != sizeof(uchar)); | |
CV_Assert(image.rows > 3 && image.cols > 3); | |
cv::Mat ret = image; | |
ret /= 255; | |
cv::Mat prev_img = cv::Mat::zeros(ret.size(), CV_8UC1); |
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 <fstream> | |
using namespace std; | |
using ull = unsigned long long; | |
ull fast_ipow(ull x, ull y, ull z) { | |
ull tmp = 1LL; | |
x %= z; | |
while (y) { |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
static void merge(char* left, char* mid, char* right, char* end, char* dest, size_t size, | |
int (*compar)(const void*, const void*)) { | |
if (left == mid || mid == end) { | |
memcpy(dest, left, end - left); |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#include <sys/time.h> | |
static void merge(char *left, char *mid, char *right, char *end, char *dest, size_t size, int (*compar)(const void *, const void *)) { | |
if (left == mid || mid == end) { | |
memcpy(dest, left, end - left); | |
return; |
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 psutil | |
import multiprocessing | |
import numpy as np | |
import time | |
import os | |
import shutil | |
import requests | |
import io | |
import schedule | |
import sys |
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
curl -fsSL https://code-server.dev/install.sh | sh |
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
#ifndef LIBTORCH_CIFAR10_H | |
#define LIBTORCH_CIFAR10_H | |
#include<torch/torch.h> | |
namespace { | |
constexpr uint32_t kTrainSize = 50000; | |
constexpr uint32_t kTestSize = 10000; | |
const std::vector<std::string> kTrainImagesFilename = { "data_batch_1.bin","data_batch_2.bin","data_batch_3.bin","data_batch_4.bin","data_batch_5.bin" }; | |
const std::vector<std::string> kTestImagesFilename = {"test_batch.bin"}; | |
constexpr uint32_t kImageRows = 32; | |
constexpr uint32_t kImageColumns = 32; |
NewerOlder