Skip to content

Instantly share code, notes, and snippets.

/*
* INPUT: 100 \n
* TIPS: 输入必须有序, 否则pos无意义
* 1 10 11 11 12 12 13 15 16 18 2 2 20 20 20 20 21 21 21 22 22 22 23 23 23 23 24 24 24 24 24 27 27 28 32 35 4 40 40 40 41 42 44 44 46 47 47 5 5 52 53 54 57 58 6 60 61 62 62 63 63 64 65 65 65 69 7 70 70 71 71 72 75 75 76 77 8 8 82 84 84 85 86 86 87 89 9 9 91 91 93 93 95 95 96 97 97 98 98 99
* Search X \n
* OUTPUT: position of X
*/
#include <cstdio>
#include <algorithm>
using namespace std;
<?php
print <<<EOT
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
# Link: https://unix.stackexchange.com/questions/77007/mv-cannot-stat-no-such-file-or-directory-in-shell-script
# Failed
mv /path/to/FILE /new/path/to/FILE
# Double Quote the directory
mv "/path/to/"FILE "/new/path/to/"FILE
ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY 'PASSWORD';

identifier 标识符ID | Unique

Identifier refers to name given to entities such as variables, functions, structures etc.

type qualifier 类型限制

In the C, C++, and D programming languages, a type qualifier is a keyword that is applied to a type, resulting in a qualified type.
For example, const int is a qualified type representing a constant integer, while int is the corresponding unqualified type, simply an integer.
In D these are known as type constructors, by analogy with constructors in object-oriented programming.

// It Depand on value
// 1. Value 0 | -1
#include <string.h>
memset(arr, -1, sizeof(arr));
// 2. any value
#include <algorithm>
using namespace std;
fill(arr, arr+len, VAL); // address
// C lang way
char str[MAXN];
sprintf(str, "%d", num);
// Cpp way c++11
std::string str = std::to_string(num);
int arr[] = {73, 68, 80, 85, 73, 74, 33, 49, 74, 90, 23, 22, 1, 0, 57, 11, 27, 35, 60, 45};
int len = sizeof(arr) / sizeof(arr[0]);
sort(arr, arr+len, compare);
// SET the purpose condition.
bool compare(int front, int end) {
return front > end; // DESC
return front < end; // ASC

Purpose

For transfering data.

When to use

As the name self says.

  • Only parameter to encode >encodeURI