Author Archives: Robins

kubectl get csr No resources found.

Error message: kubectl get CSR
No resources found.
error analysis: the master side could not receive the node application to join kubernetes request information
problem solved: by checking the log file, it was found that kubelet did not start successfully. After screening kubelet, it was found that there was No kubelet command option

C# WinForm gets the storage path of the selected file

Select the file and click OK to display the absolute path of the file in the text box.

    public void getfilepath()
    {
        OpenFileDialog dlg = new OpenFileDialog();
        dlg.Filter = "Arbitrary files (*. *)|*. *";  //type and description of the file
        if (dlg.ShowDialog() == DialogResult.OK)  //After the selection is made
        {
            string filePath = dlg.FileName;
            textBox1.Text = filePath;

        }
    }

POI set excel cell background color (use of setfillforegrondcolor and setfillpattern)

    IndexedColors.AQUA.getIndex()IndexedColors.AUTOMATIC.getIndex()IndexedColors.BLUE.getIndex()IndexedColors.BLUE_GREY.getIndex()IndexedColors.BRIGHT_GREEN.getIndex()IndexedColors.BROWN.getIndex()Ind exedColors.CORAL.getIndex()IndexedColors.CORNFLOWER_BLUE.getIndex()IndexedColors.DARK_BLUE.getIndex()IndexedColors.DARK_GREEN.getIndex()IndexedColors.DARK_RED.getIndex()IndexedColors.DARK_TEAL.getInde x()IndexedColors.DARK_YELLOW.getIndex()IndexedColors.GOLD.getIndex()IndexedColors.GREEN.getIndex()IndexedColors.GREY_25_PERCENT.getIndex()IndexedColors.GREY_40_PERCENT.getIndex()IndexedColors.GREY_50_ PERCENT.getIndex()IndexedColors.GREY_80_PERCENT.getIndex()IndexedColors.INDIGO.getIndex()IndexedColors.LAVENDER.getIndex()IndexedColors.LEMON_CHIFFON.getIndex()IndexedColors.LIGHT_BLUE.getIndex()Index edColors.LEMON_CHIFFON.getIndex()IndexedColors.LIGHT_BLUE.getIndex()IndexedColors.LIGHT_CORNFLOWER_BLUE.getIndex()IndexedColors.LIGHT_GREEN.getIndex()IndexedColors.LIGHT_ORANGE.getIndex()IndexedColors .LIGHT_TURQUOISE.getIndex()IndexedColors.LIGHT_YELLOW.getIndex()IndexedColors.LIME.getIndex()IndexedColors.MAROON.getIndex()IndexedColors.OLIVE_GREEN.getIndex()IndexedColors.ORANGE.getIndex()IndexedCo lors.ORCHID.getIndex()IndexedColors.PALE_BLUE.getIndex()IndexedColors.PINK.getIndex()IndexedColors.PLUM.getIndex()IndexedColors.RED.getIndex()IndexedColors.ROSE.getIndex()IndexedColors.ROYAL_BLUE.getI ndex()IndexedColors.SEA_GREEN.getIndex()IndexedColors.SKY_BLUE.getIndex()IndexedColors.TAN.getIndex()IndexedColors.TEAL.getIndex()IndexedColors.TURQUOISE.getIndex()IndexedColors.VIOLET.getIndex()Index EdColors. WHITE. GetIndex IndexedColors ()// WHITE. YELLOW. GetIndex ()

Installing Vue devtools under mac

A, download
Go to the official Vue DevTools home page at GitHub. Because downloading directly from the Chrome app store requires over the wall.
the official address: https://github.com/vuejs/vue-devtools.git
Install the NPM package, the dependency package required by the project
Go to the directory where you downloaded the Vue-devtools-dev folder and enter the following code from the command

   npm install

Edit project files

  npm run build

Iv. Modify Persistent
Shells -> enter under the vue-devtools-dev folder. chrome -> Manifest.json, find Persistent, and change its value to true

Add to Chrome
1. Open the chrome extensions page, and make the following extensions available:
– chrome://extensions/
– more tools L – extensions (E)

Retrofit displays the downloaded content

        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
        OkHttpClient client = new OkHttpClient.Builder()
                .addInterceptor(interceptor)
                .retryOnConnectionFailure(true)
                .connectTimeout(15, TimeUnit.SECONDS)
                .build();


        Retrofit retrofit = new Retrofit.Builder().baseUrl(api_url).client(client).addConverterFactory(GsonConverterFactory.create()).build();
                RetrofitService service = retrofit.create(RetrofitService.class);

        Call<ApiGetMapFarms> getMapFarms = service.getMapFarms(api_token, farm_group_id);
        getMapFarms.enqueue(new Callback<ApiGetMapFarms>() {

Note: if the parse line to the parse line, if the copy of the parse will not resolve because of the whitespace problem

How to Fix Errors encountered in executing Python scripts with command line parameters

Today, when I was learning to execute a Python script with command line parameters, there was an error
ModuleNotFoundError: No module named ‘cv2’ at runtime. The problem has been solved, so I think I can write a note for your reference


import argparse
import cv2 as cv
import imutils
ap=argparse.ArgumentParser()
ap.add_argument('-i','--input',required=True,help='path to input image')
ap.add_argument('-o','--output',required=True,help='path to output image')
args=vars(ap.parse_args())

Then open the console and type

// An highlighted block
$ python shape_counter.py --help

It did not get the result I wanted, so an error was returned, and cv2 (ModuleNotFoundError: No Module named ‘Cv2’) had to be found in the file. I think pycharm and the environment of this machine are independent. I tried to run OpenCV in Pycharm and did not report any mistakes, so they are independent. OpenCV is also installed in the native environment before it can be used.
first open our console
install OpenCV


again error, the yellow part is important information, tell us to upgrade our PIP to 20.2.3 version
upgrade PIP version
command:

python -m pip install --upgrade pip


appears such a page is successfully upgraded
again install OpenCV
command:

python -m pip install opencv-python


install imutils
command:

python -m pip install imutils


ok, now let’s go to our script file and open the console and type:

python shape_counter.py --help

Results:

Python syntax error except exception, e: ^ syntax error: invalid syntax

The reason this is a problem is because python2 and python3 have different syntax
Python2 and 3 deal with the except clause in a slightly different syntax, which is worth noting;
Python2

try:
    print ("hello world")
except ZeroDivisionError, err:      # , Add reason parameter name 
    print ('Exception: ', err)

Python3

try:
    print ("hello,world")
except ZeroDivisionError as err:        # as Add reason parameter name 
    print ('Exception: ', err)

As seems to work if you want compatibility

Quickly create a local typescript running environment.

Quickly create a native Typescript runtime environment.

npm init -f
npm -D i typescript@4
npm -D i @types/node@12 @types/vscode@1
npm -D i ts-node

npm -g i https://github.com/zhmhbest/AttachConfiguration
attach package.json "main='src/index.ts'"
attach package.json "scripts>build='tsc -p ./'"
attach package.json "scripts>watch='tsc -watch -p ./'"
attach package.json "scripts>start='ts-node src/index.ts'"

mkdir src
mkdir .vscode
touch ./tsconfig.json
touch ./src/index.ts
touch ./.vscode/launch.json

tsconfig.json

{
    "compilerOptions": {
        "sourceMap": true,
        "module": "CommonJS",
        "target": "ES2016",
        "lib": ["ES2016"],
        "rootDir": "./src",
        "outDir": "./out",
        "strict": true,
        "skipLibCheck": true,
        "noImplicitReturns": true,
        "noFallthroughCasesInSwitch": true,
        "noUnusedParameters": true,
    },
    "include": ["./src/**/*"],
    "exclude": ["node_modules", "dist", "out"]
}

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "node",
            "request": "launch",
            "args": [
                "${workspaceRoot}/src/index.ts"
            ],
            "runtimeArgs": [
                "--nolazy",
                "-r",
                "ts-node/register"
            ],
            "sourceMaps": true,
            "cwd": "${workspaceRoot}",
            "protocol": "inspector",
            "console": "integratedTerminal",
            "internalConsoleOptions": "neverOpen"
        }
    ]
}

index.ts

function sayHello() {
    console.log("Hello!");
}
sayHello();

Introduction of Hadoop HDFS and the use of basic client commands

HDFS basic functions
Basic function
has the basic operation function of file system;

file blocks for unit store the data in different machine disk
the default 128 MB large data slices, 3 copies of the
the NameNode master node: virtual directory maintenance, management of child nodes (Secondly the NameNode) storage resources scheduling, and the client interaction
the DataNode from multiple nodes: save the data, register when they start with the master node, the master node can know the information of it, convenient later call
(DataNode from cluster nodes to meet the basic conditions: Linux01, 02 01… The IP domain name between the secret set. Because nodes communicate with each other)
Linux01:NameNode DataNode
Linux02:DataNode
Linux03:DataNode
Use of client base commands

    location bin/HDFS DFS among them are some commands to upload: HDFS DFS – put./to/(the front is a local path, followed by HDFS path) directory: HDFS DFS – ls/(files in the directory view points, and other road king in the same way) to create folders: HDFS DFS – mkdir/data (create the folder in the root directory) to check the file content: HDFS DFS – cat file path from HDFS download: HDFS DFS get /data/1.txt/(HDFS path in front followed by local path)

Linux shell RM deletes all. O suffix files in the subdirectory

How it works: Use the pipe command to find the files you want to delete in your home directory, then construct the parameter list using “xargs” and run the command.
Example 1: Delete all files with the suffix O in the current directory including subdirectories of the current directory

find . -name "*.o"  | xargs rm -f

Example 2: Remove all bak suffix files including subdirectories under /root

find /root -name *.bak | xargs rm -f

Command details reference:
Linux Shell LS Xargs RM Combined Delete File
https://blog.csdn.net/whatday/article/details/104027935