Author Archives: Robins

seaborn.load_ Data set error urlerror: < urlopen error [winerror 10060] the connection attempt failed because the connecting party did not reply correctly after a period of time or the connected host did not respond

In case of urlerror: & lt; Urlopen error [winerror 10060] the connection attempt failed because the connecting party did not reply correctly after a period of time or the connected host did not respond& gt; Before this problem, you may encounter this error: urllib. Error. Urlerror: & lt; urlopen error [Errno 11004] getaddrinfo failed>, The solutions are as follows:

 
one   urllib.error.URLError: < urlopen error [Errno 11004] getaddrinfo failed>

Method 1: modify the DNS address https://blog.csdn.net/qq_ 43474959/article/details/107902588

Method 2: if you still can’t get it, you can directly download the data set to the Seaborn data file directory. Generally, the address of Seaborn data is in the C: (users) directory, and the download address of Seaborn data set is: https://codechina.csdn.net/mirrors/mwaskom/seaborn-data?utm_ source=csdn_ github_ accelerator

 
2. URLError: < Urlopen error [winerror 10060] the connection attempt failed because the connecting party did not reply correctly after a period of time or the connected host did not respond& gt;

After solving the first problem, continue to run. You may encounter new errors. The solutions are as follows:

Step 1: make sure that the downloaded data set is stored in the Seaborn data folder. Note that this folder is generated automatically and should be brought with the Seaborn library when it is installed. The general path is C: (users) \ \ (user name) \ \ Seaborn data

Step 2: check the storage format of the downloaded library. My initial file format was. Data, which led to an error. It is recommended to change the suffix to. CSV, and then run it again

Resolution AAPT: error: resource drawable/ (aka xxx) not found

When an error occurs, do not suspect that the as is wrong! It’s just that there is an error in the newly compiled XML, not necessarily the file with the error prompt.

1. Execute file – & gt; Invalid cache/restart, recompile.

2. Check the latest XML file in the drawable folder for errors. Common errors are as follows:

I repeat

<?xml version=”1.0″ encoding=”utf-8″?& gt;
<?xml version=”1.0″ encoding=”utf-8″?& gt;

gazebo7 CMake Error:Could not find a package configuration file provided by “gazebo_plugins“

Running catkin on Ubuntu 16.04 gazebo7_ Cmake error

Error details:

CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "gazebo_plugins"
  with any of the following names:

    gazebo_pluginsConfig.cmake
    gazebo_plugins-config.cmake

terms of settlement:

sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control

Catkin make

Idea for Mac setting JVM running parameters to solve running stuck problem

Mac platform, idea running project Karton

resolvent:

1、 Modify the host file:

Sudo VIM/private/etc/hosts
will

127.0.0.1 localhost
is modified to:

127.0.0.1 localhost [host name]. Local
problem solved
how to view your own host name?Use the following command:

hostname

XXX. Local is the information that needs to be added to the hosts file.

2、 Modify the VM parameters to the appropriate size
idea – help eidit custom VM options

-Xms2048m// minimum running memory
– xmx4096m// maximum running memory
– XX: reservedcodacache size = 240m// code cache size
(adjust according to the computer configuration) this setting is 16g memory configuration

3、 Reduce unnecessary breakpoint settings when debugging or running a project

Solution to error reporting in Java @ override

 
Sometimes when the eclipse project of Java is compiled on a different computer, the @ override always reports an error. Just remove the @ override, but it can’t fundamentally solve the problem, because sometimes there are too many @ override places.

This is a problem with JDK. We already have @ override for jdk5, but we don’t support the implementation of the interface. We think it’s not override and report an error. JDK6 fixed this bug. You can add @ override to both the method coverage of the parent class and the implementation of the interface.

To solve this problem, first make sure that JDK 1.6 is installed on the machine,

Then, select the eclipse menu windows – & gt; Preferences–> java-> Compiler–> Select 1.6 for compiler compliance level, refresh the project and recompile.

If the problem is not solved, right-click the project that reported the error and select properties — & gt; Java Compiler–> Select 1.6 from compiler compliance level to refresh the project and recompile.

 

django.db.utils.OperationalError: no such table: django_admin_log

Problem orientation


Using Python shell to delete custom user table data

from MyApp import models
dU = models.SysUsers.objects.all()
dU.delete()

The error is as follows

django.db.utils.OperationalError: no such table: django_admin_log

terms of settlement


Direct migrate may not work. Parameters should be added as follows

python manage.py makemigrations
python manage.py migrate --run-syncdb

Alpine Linux executable file crash report error / lib / x86 not found_ 64 Linux GNU / libc.so solution

reason:

reason:

Most linux software is connected with glibc, GNU libc Library (libc provides standard C library and POSIX API).

Most Linux distributions are based on glibc.

Alpine Linux is based on the musl libc library, which is a minimal implementation and strictly follows POSIX.

For example, executable files built on glibc distribution depend on/lib/x86_ 64 Linux GNU/libc. So. 6, which cannot be used on Alpine (except for static links).

resolvent:

Method 1: install the libc6 compatible package: APK add libc6 compat. This wrapper provides a lightweight glibc compatible layer. For simple applications, that’s enough.

Method 2, install the appropriate glibc on alpine, and provide all glibc methods and functions. Alpine can be built using glibc and should be installed in the following programs (for example):

# Source: https://github.com/anapsix/docker-alpine-java

ENV GLIBC_REPO=https://github.com/sgerrand/alpine-pkg-glibc
ENV GLIBC_VERSION=2.30-r0

RUN set -ex && \
    apk --update add libstdc++ curl ca-certificates && \
    for pkg in glibc-${GLIBC_VERSION} glibc-bin-${GLIBC_VERSION}; \
        do curl -sSL ${GLIBC_REPO}/releases/download/${GLIBC_VERSION}/${pkg}.apk -o /tmp/${pkg}.apk; done && \
    apk add --allow-untrusted /tmp/*.apk && \
    rm -v /tmp/*.apk && \
    /usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib

Method 3, using statically linked executable files. The static executable does not have dynamic dependencies and can run on any Linux.

Method 4, the software execution file can be built on alpine

 
 

Read in wannier90 output file hr.dat to construct real space Hamiltonian to calculate Fermi surface

def get_uniformity_kpoint(n):
    kPoints = []
    for i in range(n):
        for j in range(n):
            kPoints.append(i/n * rec[0] + j/n * rec[1])
    np.save("kPoints.npy", np.array(kPoints))
    return kPoints

Take points evenly along the inverted parallelogram. Carry out the previous calculation.

The whole Brillouin zone is restored by translation.

import numpy as np
import matplotlib.cm as cm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.axes3d import Axes3D
from matplotlib.ticker import LinearLocator, FormatStrFormatter

basis_vector = [[1.37287871,1.37287871,-2.74575742],[-2.74575742,1.37287871,1.37287871],[13.36629497,13.36629497,13.36629497]]
V = np.dot(basis_vector[0], np.cross(basis_vector[1], basis_vector[2]) )
rec = [np.cross(basis_vector[1], basis_vector[2]) * 2 * np.pi/V,
       np.cross(basis_vector[2], basis_vector[0]) * 2 * np.pi/V,
       np.cross(basis_vector[0], basis_vector[1]) * 2 * np.pi/V]

print(rec)
nk = 200
Ek = np.load("Ek_mesh.npy")[:, 0]
Ek = Ek.reshape(nk, nk)
print(Ek.shape)

kPoints = np.load("kPoints.npy")
print(kPoints.shape)
kx = kPoints[:,0]
ky = kPoints[:,1]
print(kx.shape)
kx = kx.reshape(nk, nk)
ky = ky.reshape(nk, nk)



plt.contour(kx, ky, Ek, [0.0])
plt.contour(kx + rec[0][0] -rec[1][0] , ky + rec[0][1] -rec[1][1] , Ek, [0.0])
plt.contour(kx - rec[0][0], ky - rec[0][1] , Ek, [0.0])
plt.contour(kx - rec[1][0], ky - rec[1][1] , Ek, [0.0])
plt.contour(kx  +rec[0][0], ky + rec[0][1] , Ek, [0.0])
plt.show()

SVN: Please execute the ‘Cleanup‘ command.

There is a new bug in the project. I need to extract a new branch, but after extraction, this problem occurs in the update branch

Please execute the ‘Cleanup’ command.

Why

Svn was interrupted due to an error updating the file with SVN

Solutions

Scheme 1:

Click TortoiseSVN
select clean up
select break write locks
OK

Scheme 2:

If scheme 1 fails, your SVN operation may be suspended

Download SQLite3 tool
decompress the sqlite3.exe file to the same level directory of. SVN directory
open the command line tool, switch to the same level directory of. SVN, and execute the following command
sqlite3.exe. SVN/wc.db “select * from work”_ queue”  
// this command can view the currently suspended SVN operations

sqlite3.exe .svn/wc.db “delete from work_ queue”  
// this command can delete the current suspended SVN operation

and then proceed to scheme 1

Scheme 3:

Check out a new. SVN file and replace the old. SVN file

Link to the original text: https://blog.csdn.net/lk1822791193/article/details/82655947

ValueError: The field admin.LogEntry.user was declared with a lazy reference to ‘MyApp.sysusers‘

Problem description


E:\SweetYaya\MyProj03>python manage.py migrate
Operations to perform:
  Apply all migrations: MyApp, admin, auth, contenttypes, sessions
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    main()
  File "manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "D:\Program Files\Python36\lib\site-packages\django\core\management\__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "D:\Program Files\Python36\lib\site-packages\django\core\management\__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "D:\Program Files\Python36\lib\site-packages\django\core\management\base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "D:\Program Files\Python36\lib\site-packages\django\core\management\base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "D:\Program Files\Python36\lib\site-packages\django\core\management\base.py", line 89, in wrapped
    res = handle_func(*args, **kwargs)
  File "D:\Program Files\Python36\lib\site-packages\django\core\management\commands\migrate.py", line 202, in handle
    pre_migrate_apps = pre_migrate_state.apps
  File "D:\Program Files\Python36\lib\site-packages\django\utils\functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "D:\Program Files\Python36\lib\site-packages\django\db\migrations\state.py", line 208, in apps
    return StateApps(self.real_apps, self.models)
  File "D:\Program Files\Python36\lib\site-packages\django\db\migrations\state.py", line 277, in __init__
    raise ValueError("\n".join(error.msg for error in errors))
ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'MyApp.sysuser', but app 'MyApp' doesn't provide model 'sysuser'.

Find your own python3. X and enter the site packages/Django/contrib/admin/migrations file directory__ init__. Py file, delete all others( Be careful not to__ init__. If you delete the PY file, don’t delete the migrations in the folder contrib/contenttypes. Otherwise, the function of migrate will be invalid and Django can only be removed.

Python uses cxfree to package script files into executable programs

  I have tried to package Python scripts with pyinstall before, but I encountered many problems in the process of using pyinstall, such as too large volume of packaged files, too many irrelevant files in the root directory of packaged programs, and so on.

  So instead of pyinstaller, I use cxfree to package Python scripts. Without saying much, let’s get to the point.

1. Install CX_ Freeze:

  The version of Python I use is 3.8.8. I can install CX directly with pypi_ Freeze。

  Command: PIP install CX_ Freeze

  CX installed_ The version of freeze is 6.6. After installation, you can start to package the script. Let’s simply create a script file for packaging.

hello.py:

import datetime

Print (‘Hello, the current date and time are: ‘, datetime. Datetime. Now())

input()

I store this script in the pinstar folder under disk D

Next, we introduce two ways to package the above script as. Exe

  First, after win + R, enter CMD to enter the command line, and then CD   C: Enter the scripts directory in the python installation path.

Here, the path following the CD is the installation path of Python in my computer. Just replace this path with the path of Python in my computer. For example, if anaconda is used, the path can be changed to the path of scripts folder under anaconda.

  After the path is switched, use the command cxfree D:: (pinstarr) Hello. Py — target dir D:: (pinstarr) dist, and press enter