0%

1.Install package “py2app”.
1
pip install py2app
2.Package the python’s program into ‘setup.py’
1
py2applet --make-setup xxx.py
3.Encapsulate the ’setup.py‘ into an app
1
2
3
4
python setup.py py2app -A
# For other computers without SDK, including lib library.
python setup.py py2app
# For computers without SDK, you need to remove - A and package all dependencies
Read more »

1
2
3
4
5
6
7
8
9
10
11
12
# improt package
from PIL import Image
import numpy as np
import pandas as pd
from glob import glob
import os, glob
import random, csv
import cv2
import math
import matplotlib.pyplot as plt
import matplotlib.font_manager
from sklearn import svm
Read more »

1、There is basically no problem at this step of logging in to the cloud server
2、Enter the install nvm command:
1
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
3、There may be errors during installation:
1
#Failed to connect to raw.githubusercontent.com port 443

Reason: Due to some factors, GitHub’s domain name resolution was polluted.

Solution: modify the host file, the command is as follows

(1) Open the host file
1
sudo vim /etc/hosts
(2) Fill in the following
1
199.232.96.133 raw.githubusercontent.com
(2) Exit and save, and you can execute the second step again
4、Solve the problem

Entering the following commands If you still have problems.

1
nvm --version  

If prompted “nvm command not found”.

Solve the problem of “nvm command not found”.

Enter the “.nvm” folder,create a new file “.bash_profile”.

1
touch .bash_profile //create a new file
1
vim .bash_profile //open file

Enter the following

1
2
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Then close the file and execute the file, terminal input:

1
source .bash_profile
5、Test result

terminal input::

1
nvm --version  //The version number appears to indicate a successful installation

Method1:
From Ubuntu Library install MongoDB

This is an easy way to install MongoDB in the system, you only need to enter a command.

Install MongoDB

First, make sure your package is up to date. Open the terminal and enter:

1
sudo apt update && sudo apt upgrade -y

Continue to install MongoDB:

1
sudo apt install mongodb

That’s it! MongoDB is now installed on your computer.

The MongoDB service should be started automatically during installation, but check the service status:

1
sudo systemctl status mongodb

Check if the MongoDB service is running.

Run MongoDB

MongoDB is currently a systemd service, so we use systemctl to check and modify its status, using the following command:

1
2
3
4
sudo systemctl status mongodb 
sudo systemctl stop mongodb
sudo systemctl start mongodb
sudo systemctl restart mongodb

You can also modify whether MongoDB automatically starts with the system (default: enabled):

1
2
sudo systemctl disable mongodb 
sudo systemctl enable mongodb

To start using (creating and editing) the database, please enter:

1
mongo

This will start the mongo shell. For detailed information on queries and options, please check the manual.

Note: Depending on how you plan to use MongoDB, you may need to adjust the firewall. But this is beyond the content of this article, and depends on your configuration.

Uninstall MongoDB

If you install MongoDB from the Ubuntu repository and want to uninstall it (you may have to install it in an officially supported way), please enter:

1
2
3
sudo systemctl stop mongodb 
sudo apt purge mongodb
sudo apt autoremove

This should uninstall MongoDB completely. Make sure to back up any collections or documents you might want to keep, as they will be deleted!

Compostion

  As is vividly portrayed painting, in the first picture, there exist a man reading the book. In the second picture, there exist a man sitting the chair front of the bookshelf. The water is to fish what book is to human, which aroused heated discussion among the public.

  The painting, evidently, symbolically unveil a widely-recongnized fact that nothing is significant than knowledge in people daily life and social development. Why does reading the book recevied such high emphasis? People ought to attach the  importance to knowledge. The factors prove mixed. First and more, in the society level, country will have wider platform and win more influence on global state. Further more, in the individual level ,It can help individual realized their personal value and enjoy high sense of achievement. Which gives them impetus in their professional career. Finally, everyone who stand a better chance to turn crisis to opportunities forge ahead constantly when confront with a great challenge.

     In short, in the views of every aspect of this issues, we should bear in mind that reading books is of great significance to both ourselves and society. It is advisable for us to reading books of widely than  before.

Frist of all
1
pip install ipykernel

upload successful

If something goes wrong, re-enter the following code
1
pip install ipykernel

upload successful

Then input this code
1
python -m ipykernel install --name pytorch

upload successful

Now let’s take a look at the kernels installed in Jupyter notebook.

input:

1
jupyter kernelspec list

upload successful

网上找了许多方法都没能解决我的问题

后来发现是因为hexo——blog文件夹下多了一个.git的文件夹,将它删除就解决了。
其中的原理大概是hexo d命令执行时 优先选择.git文件下的路径进行执行,导致报错,或者将整个项目上传到github的branch中,导致网页无法正常访问。

Read more »

打开终端,输入sudo lsof -i:被占用的端口号(我这里是4000端口被占用)输入密码查看占用端口进程的PID(我这里是526)

upload successful

输入指令sudo kill -9 PID,杀死进程,被占用的端口就释放出来

upload successful

题目:海滩上有一堆桃子,五只猴子来分。
第一只猴子把这堆桃子凭据分为五份,多了一个,这只猴子把多的一个扔入海中,
拿走了一份。第二只猴子把剩下的桃子又平均分成五份,又多了一个,
它同样把多的一个扔入海中,拿走了一份,第三、第四、第五只猴子都是这样做的,问海滩上原来最少有多少个桃子?

Read more »