Tag Archives: ProgrammerAH

Selenium reports an error and solves the problem of element not interactive exception, element not interactive

An error
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
The solution
Selenium – common issues an error: (a) element interaction ElementNotInteractableException – small insect’s big dream – blog garden
https://www.cnblogs.com/xiaochongc/p/12450134.html

The solution to the error of importing CSV from Python to Python

Daily analysis of data sources into Python, sometimes there will be errors and display garbled code problems, today to review the common errors.
Python code
import pandas as pd
import numpy as np
Df = pd read_csv invest_record_2018. CSV (” “)
Error message
UnicodeDecodeError Traceback (most recent call last)
pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader._convert_tokens
(pandas/_libs/parsers.c:14858)()
pandas/_libs/parsers.pyx in
pandas._libs.parsers.TextReader._convert_with_dtype
(pandas/_libs/parsers.c:17119)()
Error message shows the file encoding error, so adjust the code
import pandas as pd
import numpy as np
df=pd.read_csv(“invest_record_2018.csv”,encoding=”utf-8″)
Error report still, change the code
import pandas as pd
import numpy as np
df=pd.read_csv(“invest_record_2018.csv”,encoding=”gbk”)
Encoding =” iso-8859-1 “can also be used to stop the error
import pandas as pd
import numpy as np
df=pd.read_csv(“invest_record_2018.csv”,encoding=”ISO-8859-1″)
Neither code will display an error. You can continue writing.
Chinese garbled code problem
df.head()
Preview the first 5 lines, Chinese display garbled code
Continue to change the code
import pandas as pd
import numpy as np
df=pd.read_csv(“invest_record_2018.csv”,encoding=”gbk”)
df.head()
After execution, display is normal, problem solved.
Coding classification
Encoding =” UTF-8 “(encoding=” UTF-8″, encoding=” UTF-8 “, encoding=” UTF-8 “)

Solutions to UCenter Info: MySQL query error app1

UCenter info: MySQL Query Error
l :SELECT * FROM [Table]notelist WHERE closed= ‘0’ AND app1< ‘1’ AND app1 & gt; ‘- 5’ LIMIT 1
Error: Unknown column ‘app1’ in ‘where clause’
Errno: 1054
find another method to solve the problem, as follows:
the first method:
in UCenter modify ID for the application of 1, testing process has the following Error message:
UCENTER INFO: MySQL Query Error
SQL:SELECT * FROM [Table]notelist WHERE closed= ‘0’ AND app1< ‘1’ AND app1 & gt;
Error:Unknown column ‘app1’ in ‘where clause’
rno :1054 LIMIT 1
Error:Unknown column ‘app1’ in ‘where clause
Mysql> select app1, app1, app1, app1, app1, app1, app1, app1, app1, app1
Using a database management software such as phpMyAdmin, look at the pre_notelist table of the UCenter database to see if the app1 field exists. If not, execute the following SQL statement:
ALTER TABLE pre_notelistd a> tinyint>) NOT NULL DEFAULT ‘0’;
> At this point, the problem is solved and the pro test is available.

The second method

https://www.discuz.net/thread-3167324-1-1.html due to their site before integrating several applications, and then make a mistake, just delete the appid in uc. The appid in the pre_ucenter_applications table is changed directly in the database. The appid in the pre_ucenter_applications table is changed directly in the database. And then it comes up, every time you update it, the cache comes up:
UCENTER INFO: MySQL Query Error
SQL:SELECT * FROM notelist WHERE closed= ‘0’ AND app1< ‘1’ AND app1 & gt;
Error:Unknown column ‘app1’ in ‘where clause’
rno :1054 LIMIT 1
Error:Unknown column ‘app1’ in ‘where clause
This kind of error, although does not affect the use, but looking uncomfortable! Here’s how to do it! (Note that there is only one DZ forum without integrating other applications.)
The idea is to restore the initial default Settings for the pre_ucenter_applications and pre_ucenter_notelist- tables. AppID starts at 1 again
First enter the phpmyadmin database — — — — — — — — — — – find pre_ucenter_notelist – back into the following interface:
the first step: find position shown in the following screenshot:
click on the “browse” said if the data is empty, don’t tube it, if not delete all empty, pay attention to is to remove the data on the surface of the table data, not delete next step in the data table

click on the “structure” will appear the following interface:
only need to keep APP1, if not APP1, but app6.app8.app10… (or other APP number), then delete directly, just keep the app1 line, as shown in the picture above! (Note that there is only one DZ forum without integrating other applications.)
Step 3:
modify pre_ucenter_applications table, put the appid modified into 1. Leave everything else alone.
after saving, exit the database!
Step 4:
Modify the config_ucenter. PHP directory in the forum root config to change the appID to 1
Step 5:
Change the app.php folder in the data cache under the UC_SERVER root of the forum. Change the appID to 1 as well
Step 6:
Log in to the UC_SERVER background. Refer to config_ucenter.php this data into the application list to fill in the corresponding parameters, save the update cache! (If the server didn’t cache the file when saving it, it will cause an error. Never mind the refresh, just go!)
Finally enter the DZ background [webmaster] – [UCENTER setting] refer to UC inside fill out, pay attention to the APPID, communication key to keep consistent! Ensure successful communication
= = = best update cache, clearing the browser traces, refresh, back into the background will not appear afore-mentioned problems, the principle is to restore pre_ucenter_applications and pre_ucenter_notelist – table of the initial default Settings. AppID again starting from 1 =
My personal solution
In addition to the above method,
the other Settings are not to make any changes
Just change the uCenter IP address: change it to the localhost IP address and the error will disappear

Running course of Kafka in Windows Environment

Start ZooKeeper, run CMD and type
zkserver

E:\kafka\kafka_2.12-2.3.0
en run
.\> \ Windows \kafka-server-start.bat.\config\server.properties

CMD
: \kafka\kafka_2.12-2.3.0
<>> kafka-t>s. Bat –create –zookeeper localhost:2181 –replication-factor 1 –partitions 1-topic test
Producer
run CMD, enter kafka bin\ Windows folder
: \kafka\kafka_2.12-2.3.0\bin\ Windows
t>run
kafka-c>le-producer.bat — broke-list localhost:9092 –topic test

E:\kafka\kafka_2.12-2.3.0\bin\ Windows
en run
k>-console-consumer.bat –bootstrap-server localhost:9092 –topic test –from — beginning

There is no windows solution in dual system Ubuntu grub startup

I am a dual system installed with UEFI+GPT. Computer: Lenovo R720 System: Windows10 +Ubuntu16.04
After installing Ubuntu16.04, Win10 from the GRUB menu was somehow missing. (If you don’t even have GRUB on display, click on Windows 10 to install Ubuntu.)
Goal: Access Win10 from Ubuntu GRUB.
Implementation:
The terminal executes the following commands in turn

sudo grub-install /dev/sda
sudo chmod -x /etc/grub.d/30_os-prober
sudo gedit /etc/grub.d/40_custom

Enter the following in the 40_custom file that opens:

menuentry 'Win10' {
insmod part_gpt
insmod chain
insmod ntfs
set root='(hd0,gpt1)'
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

The terminal continues to execute sudo update-grub
The file /boot/grub/grub.cfg has been changed.
After rebooting, the Win10 option appears in the GRUB menu.
More:
If need to modify the order of the grub or modify grub background:
this is grub Customizer installation method: https://www.tuziang.com/combat/635.html

Solution to flash back of MacBook Pro open software of M1 chip

Due to the ARM architecture, there are still a considerable number of Mac software not upgraded ARM architecture support can not run on the Mac computer with M1 chip. When opened on the computer with M1 chip, it may prompt [” XXX “cannot be opened because of a problem. Please contact the developer…]


However, most applications are compatible with the M1 chip, as follows:
1. Open Access, enter the application directory, find the software icon, right click on the icon and select “Show Profile”, or select the icon and press the shortcut key “Command + I” to open the profile;
2. Check “Open with Rosetta” and then open the software and run it.
About Rosetta
Rosetta 2 runs in the background every time you use an App built specifically for Macs equipped with Intel processors. Rosetta will automatically convert the App to work with the Apple chip.
In most cases, apps that require Rosetta will not show any difference in performance.
What software can be run through Rosetta?
To see if the application supports Rosetta, look at the type of “Type” on the profile:
The application (generic) means that the App supports both Apple chips and Intel processors and uses Apple chips by default.
The application (Intel) says that the App only supports Intel processors and requires Rosetta to run on any Mac with Apple’s chip.

Mac php7.4.13 using PECL installation extension to report error

A recent installation of PHP7.4, after successful installation using PECL to install the extension to report an error

In file included from /usr/local/Cellar/[email protected]/7.4.13_1/include/php/Zend/zend.h:356:
/usr/local/Cellar/[email protected]/7.4.13_1/include/php/Zend/zend_operators.h:523:10: error: 'asm goto' constructs are not supported yet
        __asm__ goto(
                ^
/usr/local/Cellar/[email protected]/7.4.13_1/include/php/Zend/zend_operators.h:586:10: error: 'asm goto' constructs are not supported yet
        __asm__ goto(
                ^
/usr/local/Cellar/[email protected]/7.4.13_1/include/php/Zend/zend_operators.h:656:10: error: 'asm goto' constructs are not supported yet
        __asm__ goto(
                ^
/usr/local/Cellar/[email protected]/7.4.13_1/include/php/Zend/zend_operators.h:766:10: error: 'asm goto' constructs are not supported yet
        __asm__ goto(
                ^
4 errors generated.
make: *** [src/php7/igbinary.lo] Error 1
ERROR: `make' failed12345678910111213141516

/usr/local/Cellar/[email protected]/7.4.13_1/include/ PHP /Zend/ zend_operator. h
Zend_use_asm_arithmetic = 0

#if defined(HAVE_ASM_GOTO) && !__has_feature(memory_sanitizer)
#  define ZEND_USE_ASM_ARITHMETIC 0
#else
#  define ZEND_USE_ASM_ARITHMETIC 0
#endif12345

Never mind that both values of # are set to 0

How to set vscode interface to Chinese

How to set VSCode to Chinese?In this article, we will introduce the method of setting the VSCode interface to Chinese. There is a certain reference value, there is a need for friends can refer to, hope to be helpful to everyone.

the relevant recommendation: basic course “vscode

vscode interface is set to the Chinese method

1. Visual Studio Code

br> 2> Open Visual Studio Code

br> <>bb3 3. At the same time, press the Ctrl + Shift + X shortcut

the “Expansion” view text box on the left and type “Language Packs”. Click on the Language you want. Here we install simplified Chinese

How to handle exception in springboot

SpringBoot exception handling in five ways: a, a custom error page:

SpringBoot default exception handling mechanism need to be in SRC/main/resources/templates directory to create the error. The HTML page (no matter what exceptions will intercept). Different to intercept errors is necessary under the templates to create the error folder named with error code to the HTML

2: @ ControllerAdvice + @ ExceptionHandler annotation processing abnormal
you need to create a global exception class that can handle the exception. You need to add the @ControllerAdvice annotation on this class.
@ ControllerAdvice
public class GlobalException {
@ ExceptionHandler (value = {Java. Lang. ArithmeticException. Class})
public ModelAndView arithmeticExceptionHandler (Exception e) {
ModelAndView mv = new ModelAndView();
mv. AddObject (” error “, e. oString ());
mv. SetViewName (” error “);
return mv;
}
}

> All you need to do is add the following method to the controller:
@ExceptionHandler(value={java.lang.ArithmeticException.class})
public ModelAndView arithmeticExceptionHandler(Exception e) {
ModelAndView mv = new ModelAndView();
mv. AddObject (” error “, e. oString ());
mv. SetViewName (” error “);
return mv;
}

requires the implementation of the HandlerExceptionResolver interface in the global exception class
@Configuration
public class GlobalException implements HandlerExceptionResolver {
@Override
public ModelAndView resolverException(HttpServletRequest request, HttpServletResponse response, Object object, Exception exception) {
ModelAndView mv = new ModelAndView();
if(Exception instanceof ArithMeticException) {
.setViewName (” error “);
}
mv. AddObject (” error “, the exception. The toString ());
return mv;

}}
5, configuration, exception handling SimpleMappingExceptionResolver
in the global exception class to add a method to complete the unification of the exception class
@Configuration
public class GlobalException {
public SimpleMappingExceptionResolver getSimpleMappingExceptionResolver() {
SimpleMappingExceptionResolver resolver = new SimpleMappingExceptionResolver();
Properties properties = new Properties();
properties. The put (” Java. Lang. ArithmeticException “, “error”);
resolver.setExceptionMappings(properties);
return resolver;
}
}