# Use latest himawari 8 photo as wallpaper
# for Windows user
from datetime import datetime, timezone, timedelta
import requests
import ctypes
from PIL import Image, ImageDraw, ImageFont
import cv2
import numpy as np
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 <iostream> | |
#include <cstdlib> | |
#define MAX_VALUE 65536 | |
using namespace std; | |
class N { //node declaration | |
public: | |
int k; | |
N *l, *r; | |
bool leftTh, rightTh; | |
}; |
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 <mpi.h> | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <cstdlib> | |
#include <ctime> | |
void bubble_sort(std::vector<int>& arr) { | |
int n = arr.size(); | |
for (int i = 0; i < n - 1; ++i) { |
The Windows and Linux operating systems have a slight variation in how they handle newlines in files. Typically, in the Windows environment a line is terminated with the two characters \r\n. The \r character represents a carriage return, and \n represents a newline. In Linux, only the \n character is used to terminate a line.
This causes some interesting behavior issues when moving between the Windows and Linux environment. For example, if you have a multi-line text file that was created in Linux, and then try to open it using a program such as Windows Notepad, the entire contents of the file will appear on a single line.
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 <iostream> | |
#include <bitset> | |
typedef unsigned int uint; | |
static uint nextPowerOfTwo(uint x) { | |
std::bitset<32> a(x); | |
std::cout << a << '\n'; | |
--x; | |
a = x; |
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
#define _POSIX_SOURCE | |
// If you define this macro, then the functionality from | |
// the POSIX.1 standard (IEEE Standard 1003.1) is available | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#undef _POSIX_SOURCE | |
#include <stdio.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 <time.h> | |
#include <tchar.h> | |
#define ARRAY_MIN (1024) /* 1/4 smallest cache */ | |
#define ARRAY_MAX (4096*4096) /* 1/4 largest cache */ | |
int x[ARRAY_MAX]; /* array going to stride through */ | |
double get_seconds() { /* routine to read time in seconds */ | |
__time64_t ltime; | |
_time64(<ime); |
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
#define _GNU_SOURCE | |
/* | |
If you define this macro, everything is included: ISO C89, ISO C99, | |
POSIX.1, POSIX.2, BSD, SVID, X/Open, LFS, and GNU extensions. | |
*/ | |
#define _FILE_OFFSET_BITS 64 | |
/* | |
This macro determines which file system interface | |
shall be used, one replacing the other. | |
*/ |
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 <mpi.h> | |
int main (int argc, char *argv[]) | |
{ | |
int rank, comm_size; | |
MPI_Init(&argc, &argv); | |
MPI_Comm_rank(MPI_COMM_WORLD, &rank); | |
MPI_Comm_size(MPI_COMM_WORLD, &comm_size); |