Author Archives: Robins

Delete and unload node on MAC

Uninstall node
and execute the following script in turn on the terminal

sudo npm uninstall npm -g
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
sudo rm -rf /usr/local/include/node /Users/$USER/.npm
sudo rm /usr/local/bin/node
sudo rm /usr/local/share/man/man1/node.1
sudo rm /usr/local/lib/dtrace/node.d

So let’s verify that one last time

node //command not found
npm //command not found

That’s it.

reference address:
https://www.jianshu.com/p/920961b6a538

Installation library on pychar (taking pandas for example)

Some reports on the web show that there are problems when installing pandas, and the prompt seems to be the cause of PIP.
is probably your PIP version for too long. So it’s best to update the PIP at CMD first.
Enter the command in CMD:

python -m pip install -U pip

Successful information: Requirement already up-to-date.
Then turn on pycharm
1, click file/ Settings
2, and select project/project interpreter
in the popup screen
3. Click “+” on the upper right to enter the interface
for searching third-party libraries
4. Search the corresponding library or module to be installed in the search box, and click “Install Package” at the bottom left. If the installation is complete, the library displays the font color to blue, and in the previous screen lists the libraries you have installed

5. When it is finished, it will not be marked red when importing

IT Skill: How to Recall Email Message in Outlook 2007

In Go Lala Go, a hapless Helen accidentally sends a rather private email to everyone and gets fired, as everyone remembers. In real life, it’s not uncommon to accidentally send an email while it’s still being edited. How to do?Recall it immediately!

For the email Sent just now, find it in the Sent Items Folder. Open it. In the Ribbon screen that opens the email, select the following option:
Actions –> Other Actions –> Recall This Message…


Then, choose from the following dialog:


That will do.

It also is not always going to be successful. If it has already been browsed, it is going to be unsuccessful, so it is going to be fast.

Learn English together | three ways to realize digital factorial with JavaScript

click on the top
“Front end talent” can subscribe oh!
Original title: “Three Ways to Factorialize a Number in JavaScript”
Sonya Moisset
The original link: https://medium.freecodecamp.com/how-to-factorialize-a-number-in-javascript-9263c89a4b38
2. The English version of the dictionary is translated by the English version of the dictionary
Front-end technology changes with each new day, a lot of new technical articles are in English, which requires us to have a good English ability, from today on small make up and we learn English while learning the front end, due to limited ability, welcome everyone correct, together to improve English.
This article is based on Free Code Camp Basic Algorithm Scripting “Factorialize a Number”.
Translation:
This article is based on the Free Code Camp basic algorithm script “Digital factorials”.
Note: Free Code Camp is a Free online learning website. Web site address: https://www.freecodecamp.com
Key words:
algorithm
An algorithm, esp in a computer program
In mathematics, the factorial of a non-negative integer n can be a tricky algorithm. In this article, I’m going to explain three approaches, first with the recursive function, second using a while loop and third using a for loop.
Translation:
In mathematics, factorial of a non-negative integer n can be a tricky algorithm. In this article, I’ll do it three ways, first with recursive functions, second with a while loop, and third with a for loop.
Key words:
factorial
It is a factor of two
N. The factorial product
non-negative
non-negative
tricky
Difficult to deal with; Difficult to deal with; Tricky; Crafty; scheming. The treacherous; Sly.
approach
vt.& Come near, come near, come near
Vt. Close to; Get to grips with; Make closer; Try to bribe (or influence, smooth)
N. method; Way; Close to the
Vi. Near
recursive function
Recursive function
We have already seen a recursion approach on a String in the previous article, How to Reverse a String in JavaScript in 3 Different Ways ?This time we will apply the same concept on a number.
Translation:
We’ve seen recursion in string manipulation in the last article. How do you reverse strings in JavaScript in three different ways?This time we’ll apply the same concepts to Numbers.
Key words:
concept
Concept; Point of view; Thought, conception, idea; The overall impression

Algorithm Challenge

Return the factorial of the provided integer.

If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.

So, flexibly?B: Well, general rules are often terrible.

For example: 5! So it’s 1 times 2 times 3 times 4 times 5, which is 120
Translation:
Challenge algorithm
Returns the factorial of a specified integer.
If integers are represented by the letter N, the factorial is the product of all positive integers less than or equal to N.
Factorial is usually written in shorthand notation N! Said.
For example: 5! So it’s 1 times 2 times 3 times 4 times 5, which is 120
The function factorialize (num) {
return num;    
}
factorialize(5);    
Key words:
represented
V. representative; Reflect; To represent (a past tense and past participle); As a… The representative of the
positive
adj.
Positive; Be sure of STH. Positive; Positive
n.
Positive; Positive; [Language] a primal adjective; Positive quantity
shorthand notation
Simplify the symbol
Provided the test cases
Factorialize (0) should return 1factorialize(5) should return 120factorialize(10) should return 3628800factorialize(20) should return 2432902008176640000
Translation:
Provide test cases:
Factorialize (0) should return 1factorialize(5) should return 120factorialize(10) should return 3628800factorialize(20) should return 2432902008176640000
Key words:
provided
Conj. If; If; In the… Under the condition of
A. provide B. provide C. provide D. provide
What is factorializing a number all about?

When you factorialize a number, you are multiplying that number by each consecutive number minus one.

If your number is 5, you would have:
5! = 5 * 4 * 3 * 2 * 1
The pattern would be:
0! = 1
1! = 1
2! = 2 * 1
3! = 3 * 2 * 1
4! = 4 * 3 * 2 * 1
5! So it’s 5 times 4 times 3 times 2 times 1
Translation:
What exactly is a digital factorial?
When you take the factorial of a number, decrease the number by 1 each time and multiply.
If the number is 5, you should look like this:
5! So it’s 5 times 4 times 3 times 2 times 1
This pattern will:
0! = 1
1! = 1
2! = 2 * 1
3! = 3 * 2 * 1
4! = 4 * 3 * 2 * 1
5! So it’s 5 times 4 times 3 times 2 times 1
Key words:
consecutive
Continuous, continuous, or continuous; Indicating the result
multiplying
Six (multiply) four times from six. Multiply; multiply. Add to; add to Breed
1. Factorialize a Number With Recursion
The function factorialize (num) {
if (num < 0)
return -1;    
Else if (num == 0)
return 1;    
The else {
return (num * factorialize(num – 1));    
}
}
factorialize(5);    
2 Factorialize a Number with a WHILE loop
The function factorialize (num) {
var result = num;    
If (num === 0 || num === 1)
return 1;    
while (num > 1) {
num–;    
result *= num;    
}
return result;    
}
factorialize(5);    
3 Factorialize a Number with a FOR loop
The function factorialize (num) {
If (num === 0 || num === 1)
return 1;    
for (var i = num – 1; i > = 1; I -) {
num *= i;    
}
return num;    
}
factorialize(5);    

About today’s article sharing here, I hope you have a harvest, about the original English please click on the original reading view (need over the wall to see, you know)

The public,
The front-end talent
Long press to identify the left two-dimensional code to follow me click below “read the original” to view the English text down down down

How to come a good theoretical physics

I read physics related major, but I feel confused after studying for a long time, I hereby reprint the relevant opinions of two great cattle, at least have a look at what physics is in the end, and read the blog “Academic corruption is inevitable in history” article is quite fruitful.
One: How to be a good theoretical physicist.
Gerard’s Hooft gives a list, Suggestions, explanations, and links to related resources on what to learn as a theoretical physicist.
The following link is the translation version of HMY (the translation version has the website address of the original version in foreign language) :
https://www.douban.com/group/topic/23010402/
 
2. Landau Barrier:
Content: differential equations, mathematical physics equations, tensor analysis and differential geometry
2. Mechanics
, except 27, 29, 30, 37, 51 (1988)
v.i.a.old, Mathematical methods of classical mechanics
3. Classical field theory
: Landau and Lifshits II, except for the following subsections: 50, 54-57, 59-61, 68, 70, 74, 77, 97, 98, 102, 106, 108, 109, 115-119 (1989)
4. Mathematics 2
exam content: complex function, special function (Bessel, ellipse, gamma, orthogonal polynomial), integral transform
5. Quantum mechanics
exam content: Landau-Lifshits III (1989) except the following subsections: 29, 49, 51, 57, 77, 80, 84, 85, 87, 88, 90, 101, 104, 105, 106-110, 114, 138, 152
6. Quantum electrodynamics
exam content: Landau-Lifshits IV (1980) except the following subsections: 9, 14-16, 31, 35, 38-41, 46-48, 51-52, 55, 57, 66-70, 82, 84-85, 87, 89-91, 95-97, 100-101, 106-109, 112, 115-144
7. Statistical physics I
exam content: Landau-Lifshits V divided by the following subsections: 22, 30, 50, 60, 68, 70, 72, 79, 80, 84, 95, 99, 100, 125-127, 134-141, 150-153, 155-160
8. Continuum mechanics
exam content: fluid mechanics, Landau-Lifshits VI (1986), divided by the following subsections: 1, 13, 14, 21, 23, 25-27, 28, 30-32, 34-48, 53-59, 63, 67-78, 80, 83, 86-88, 90, 91, 94-141
9. Continuum electrodynamics
examination contents: Landau-Lifshits VIII (1982) except the following subsections: 1-5, 9, 15, 16, 18, 25, 28, 34-35, 42-44, 56-57, 61-64, 69, 74, 79-81, 84, 91-112, 123, 126
10. Statistical physics II
exam content: landau-lifshits IX (1978), exam the following subsections: 1-5, 7-18, 22-27, 29, 36-40, 43-48, 50, 55-61, 63-65, 69
11.
physical kinetics: Landau-Lifshits X (1979), with the following section: 1-8, 11, 12, 14, 21, 22, 24, 27-30, 32-34, 41-44, 66-69, 75, 78-82, 86, 101.
while working in kharkiv, the 24-year-old Landau laid down the “minimum standard in theoretical physics”, a set of exams that came to be known as Landau’s “barrier”, for graduate students who wished to follow him. In accordance with the later standardized requirements, the “minimum standard” consists of a mathematics and eight theoretical physics interview. The last eight are theoretical mechanics, classical field theory including special and general relativity, statistical physics, non-relativistic quantum mechanics, continuum electrodynamics, physical dynamics, continuum fluid mechanics and elastic mechanics, and quantum field theory. The test focuses on problem-solving rather than abstract theoretical frameworks, and Mr. Landau once told young students that a well-prepared person should be able to pass the ‘minimum’ in three months or, if necessary, in a year. Many of Landau’s own students have been admitted on the “minimum” basis. In fact, the “minimum” is far from a barrier for Russian students interested in theoretical physics, who usually start at the beginning of their undergraduate studies. At first Landau presided over every exam, and later his professor-level assistants Shared most of the courses, but the first mathematics and the last quantum field theory were always landau himself. Landau kept a notebook in which he kept a personal record of the names and years of those who eventually passed. According to incomplete statistics, at least 18 of the 43 went on to become members or correspondents of the Academy of Sciences of the Soviet Union or the Republic of Korea, with one winning the Nobel Prize in physics. The only non-Soviet citizen on the list is L szlOTisza, a Hungarian who passed his exam in Kharkiv in 1935 and is still alive. He was a year older than Landau, moved to America in 1941 and taught at the Massachusetts Institute of Technology until he retired. A small number of people, after passing the “barrier”, are exhausted, exhausted and exhausted, and never appear again.

C / C + + library function (tower / tower) realizes the conversion of letter case

C/C++ library function (tolower/toupper) implements case conversion of letters

This article will introduce the library function to implement the case conversion of letters, commonly used in the type. H (c ++ is cctype) library file under the definition of function methods. First let’s look at the prototype implementation of the tolower/toupper function under C:

int tolower(int c)
{
	if ((c >= 'A') && (c <= 'Z'))
		return c + ('a' - 'A');
	return c;
}

int toupper(int c)
{
	if ((c >= 'a') && (c <= 'z'))
		return c + ('A' - 'a');
	return c;
}

And I’m going to do that with two little demos.

C implementation:

#include<string.h>   //strlen
#include<stdio.h>    //printf
#include<ctype.h>    //tolower
int main()
{
    int i;
    char string[] = "THIS IS A STRING";
    printf("%s\n", string);
    for (i = 0; i < strlen(string); i++)
    {
        string[i] = tolower(string[i]);
    }
    printf("%s\n", string);
    printf("\n");
}

Save as xxX. c file, execute: GCC-O XXX xxX. c generate execute file XXX. Operation:./ XXX



above is the implementation of C. Similarly, the implementation under C++ is as follows:

#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main()
{
    string str= "THIS IS A STRING";
    for (int i=0; i <str.size(); i++)
       str[i] = tolower(str[i]);
    cout<<str<<endl;
    return 0;
}

Save as xxx. CPP, execute g++ xxx. CPP to generate the execution file a.ut, execute a.ut, and the effect is as follows:



The demo above
implements the upper case tolower case conversion, again, the lower case toupper case conversion is the same, just replace tolower with toupper.

To solve this problem, we can’t find the solution of / storage / emulated / 0 / file. I can’t. You can try this

Open Device File Explorer-& GT; Locate the MNT folder -> Find the SDCard folder -> Find storage – & gt; Find your file in turn (add it if you don’t have one) -> Just put the full path in your code.
eg:

String sdpath = Environment.getExternalStorageDirectory()
                    .getAbsolutePath();
filepath = File.separator + "mnt" + File.separator + "sdcard" + sdpath + File.separator + "movie.mp4";

Anaconda builds a new environment and installs sklearn, numpy and other modules

Under Anaconda we already have gluon’s environment
Now I want to build an environment for TensorFlow,

2. Install Tensorflow
TensorFlow currently only supports Python 3.5 on Windows.
(1) open Anaconda Prompt and input tsinghua warehouse image, so that the update will be faster:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

12
(2) Also use Anaconda Prompt to create a Python3.5 environment with the name of TensorFlow. Type the following command:

conda create -n tensorflow python=3.5

1
Run start menu -> Anaconda3 - & gt; Anaconda Navigator, click the left Environments, you can see that the environment of tensorflow has been created.


(3) TensorFlow environment is started in Anaconda Prompt:

activate tensorflow

1

Note: when not using tensorflow, close the tensorflow environment with the command: deactivate

After installing the environment, we go to the folder we want to run, such as CD TensorFlow
Then activate tensorFlow

The TensorFlow environment is fine, but tensorFlow is not installed,
conda insatll tensorflow
And in the environment to install jupyter Notebook, NUMpy and other modules
conda install jupyter notebook
conda install scikit-learn

From https://blog.csdn.net/u010858605/article/details/64128466

C / C + + rounding function: round function

: : : : : : : : : : : : : : :

#include<iostream>
#include<cmath>
using namespace std;

int main(){
	cout<<"round(1.3) = "<<round(1.3)<<endl
		<<"round(1.5) = "<<round(1.5)<<endl
		<<"round(-1.3) = "<<round(-1.3)<<endl
		<<"round(-1.5) = "<<round(-1.5)<<endl;
	return 0;
}


this function takes the form of

double round(double d);

> > > > > > > > > > cmath>

How to execute Makefile

Compiling your source code files can be tedious, specially when you want to include several source files and have to type the compiling command everytime you want to do it.  
Well, I have news for you… Your days of command line compiling are (mostly) over, because YOU will learn how to write Makefiles.
Makefiles are special format files that together with the make utility will help you to automagically build and manage your projects.
For this session you will need these files:
main.cpphello.cppfactorial.cppfunctions.h I recommend creating a new directory and placing all the files in there.
note: I use g++ for compiling. You are free to change it to a compiler of your choice
The make utility If you run

make

this program will look for a file named 
makefile in your directory, and then execute it.

If you have several makefiles, then you can execute them with the command:

make -f MyMakefile

There are several other switches to the 
make utility. For more info, 
man make.
Build Process

    Compiler takes the source files and outputs object filesLinker takes the object files and creates an executable

Compiling by hand The trivial way to compile the files and obtain an executable, is by running the command:

g++ main.cpp hello.cpp factorial.cpp -o hello

The basic Makefile The basic makefile is composed of:

target: dependencies
[tab] system command

This syntax applied to our example would look like:

all:
	g++ main.cpp hello.cpp factorial.cpp -o hello

[Download 
here]
To run this makefile on your files, type:

make -f Makefile-1

On this first example we see that our target is called 
all. This is the default target for makefiles. The 
make utility will execute this target if no other one is specified.

We also see that there are no dependencies for target 
all, so 
make safely executes the system commands specified.

Finally, make compiles the program according to the command line we gave it.

Using dependencies Sometimes is useful to use different targets. This is because if you modify a single file in your project, you don’t have to recompile everything, only what you modified. 

Here is an example:

all: hello

hello: main.o factorial.o hello.o
	g++ main.o factorial.o hello.o -o hello

main.o: main.cpp
	g++ -c main.cpp

factorial.o: factorial.cpp
	g++ -c factorial.cpp

hello.o: hello.cpp
	g++ -c hello.cpp

clean:
	rm -rf *o hello

[Download 
here]
Now we see that the target all has only dependencies, but no system commands. In order for make to execute correctly, it has to meet all the dependencies of the called target (in this case all).
Each of the dependencies are searched through all the targets available and executed if found.
In this example we see a target called clean. It is useful to have such target if you want to have a fast way to get rid of all the object files and executables.
Using variables and comments You can also use variables when writing Makefiles. It comes in handy in situations where you want to change the compiler, or the compiler options.

# I am a comment, and I want to say that the variable CC will be
# the compiler to use.
CC=g++
# Hey!, I am comment number 2. I want to say that CFLAGS will be the
# options I'll pass to the compiler.
CFLAGS=-c -Wall

all: hello

hello: main.o factorial.o hello.o
	$(CC) main.o factorial.o hello.o -o hello

main.o: main.cpp
	$(CC) $(CFLAGS) main.cpp

factorial.o: factorial.cpp
	$(CC) $(CFLAGS) factorial.cpp

hello.o: hello.cpp
	$(CC) $(CFLAGS) hello.cpp

clean:
	rm -rf *o hello

[Download 
here]
As you can see, variables can be very useful sometimes. To use them, just assign a value to a variable before you start to write your targets. After that, you can just use them with the dereference operator $(VAR). 
Where to go from here With this brief introduction to Makefiles, you can create some very sophisticated mechanism for compiling your projects. However, this is just a tip of the iceberg. I don’t expect anyone to fully understand the example presented below without having consulted some 
Make documentation (which I had to do myself) or read pages 347 to 354 of your Unix book.

CC=g++
CFLAGS=-c -Wall
LDFLAGS=
SOURCES=main.cpp hello.cpp factorial.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=hello

all: $(SOURCES) $(EXECUTABLE)
	
$(EXECUTABLE): $(OBJECTS) 
	$(CC) $(LDFLAGS) $(OBJECTS) -o $@

.cpp.o:
	$(CC) $(CFLAGS) $< -o $@


[Download 
here]
If you understand this last example, you could adapt it to your own personal projects changing only 2 lines, no matter how many additional files you have !!!.


Hector Urtubia

Notepad + + install JSON format plug-in

Download the corresponding version of the JsonViewer plug-in zip:
64: https://github.com/zbeboy/Jsonviewer2/releases
32: https://sourceforge.net/projects/nppjsonviewer/?source=typ_redirect
Unzip the package, copy the jsonviewer2.dll (64-bit) or nppjsonviewer.dll (32-bit) file to the plugins directory under the notepad++ installation directory, and then restart notepad++

Paste the data you want to format into notepad++, then click on the top plugin -> JSON Viewer—> Format JSON allows you to Format JSON data