ArcGIS API for JavaScript Error Uncaught(in promise): TypeError: xxx is not a constructor

preface

When using ArcGIS API JavaScript, the following errors are reported:

Cause of error

When we use require to import related packages when using ArcGIS API, the parameters in the following functionshould be consistent with the order of packages in require , otherwise the above errors will be caused.

How to Solve MacOS Big Sur MySQL workbench flashback problem

The program is executed directly from the command line

$ /Applications/MySQLWorkbench.app/Contents/MacOS/MySQLWorkbench
Fatal Python error: initfsencoding: unable to load the file system codec, sys.path = ['/Applications/MySQLWorkbench.app/Contents/Resources/libraries', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python37.zip', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload']
ModuleNotFoundError: No module named 'encodings'

Current thread 0x000000010a883e00 (most recent call first):
Abort trap: 6

After checking that there is no Python 3.7 on the system, the solution is as follows:

# Install python 3.7
$ brew install [email protected]
# Create a soft connection
$ sudo ln -s /usr/local/Cellar/python\@3.7/3.7.10/Frameworks/Python.framework /Library/Frameworks/Python.framework

Run MySQL workbench again successfully.

[How to Fix] MySQL Workbench for Mac Flashback

After MySQL workbench 8.0.23 Mac version is installed successfully, double-click to open and flash back

Start at the command line and you can see the error:

Fatal Python error: initfsencoding: unable to load the file system codec, sys.path = ['/Users/georgi/Applications/MySQLWorkbench.app/Contents/Resources/libraries', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python37.zip', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload']
ModuleNotFoundError: No module named 'encodings'

The reason is python

Solution:

1. Scheme 1: command line startup

PYTHONPATH=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7 /Applications/MySQLWorkbench.app/Contents/MacOS/MySQLWorkbench

2. Scheme 2: modify the MySQL workbench running file

cd /Applications/MySQLWorkbench.app/Contents/MacOS
mv MySQLWorkbench MySQLWorkbench.bak
echo "PYTHONPATH=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7 /Applications/MySQLWorkbench.app/Contents/MacOS/MySQLWorkbench.bak" > MySQLWorkbench
chmod +x MySQLWorkbench

After executing the above commands, double-click MySQL workbench to start normally

reference resources: https://bugs.mysql.com/bug.php?id=102364

Download and save uniapp pictures to Android error reporting app

To save a picture to a mobile photo album, you must download a download file to download the picture. The picture can be saved normally on IOS mobile phone, but it fails to save on an Android mobile phone

the returned address is of unknown type. At this time, saving will fail

Therefore, it is necessary to uni.download file ({filePath: wx.env.USER_ DATA_ PATH + ‘/ file.jpg ’})
add this code to change the address, and then it will be saved successfully

//Save images locally
			savePoster(){
				uni.showLoading({
					title:'Downloading...'
				})
				uni.downloadFile({
					url:this.playBillUrl,//  This is the web image address that the backend gets
					filePath: wx.env.USER_DATA_PATH + '/file.jpg',// This must be written here otherwise Android will download the address after it appears.unknown
					success:res => {
						uni.hideLoading()
						if (res.statusCode === 200) {
						
							uni.saveImageToPhotosAlbum({
								filePath: res.filePath,
								success: function() {
									uni.showToast({
										title:'save sucessfully'
									})
								},
								fail: function(res) {
									console.log(res)
									uni.showToast({
										title:'save failed, please try again later'
									})
								}
							});
						} else {
							uni.showToast({
								title:'Download error'
							})
							uni.hideLoading()	
						}
					
					}
				})

ReflectionUtils can not access XXX “private final”

code:

RedisConnection redisConnection = redisConectionFactory.getConnection();
        Field jedisField = ReflectionUtils.findField(JedisConnection.class, "jedis");
        Jedis jedis = (Jedis) ReflectionUtils.getField(jedisField, redisConnection);

Reflection problems
code changes:

RedisConnection redisConnection = redisConectionFactory.getConnection();
        Field jedisField = ReflectionUtils.findField(JedisConnection.class, "jedis");
        // Use only when getting properties modified with private
        jedisField.setAccessible(true);
        Jedis jedis = (Jedis) ReflectionUtils.getField(jedisField, redisConnection);

Vue cannot read property ‘xxx’ of undefined solutions

Problem scenario

Use {} text interpolation to display content through cascade. In the following code, foo returns through the back-end interface.
Before the back-end content returns, the console will not read the property ‘xxx’ of undefined.

<div>
  <h1>{{ foo.title }}</h1>
  <p>{{ foo.description }}</p>
</div>

Solution

<div>
  <h1 v-if="foo.title">{{ foo.title }}</h1>
  <p v-if="foo.description">{{ foo.description }}</p>
</div>

perhaps

<div>
  <template v-if="foo">
    <h1>{{ foo.title }}</h1>
    <p>{{ foo.description }}</p>
  </template>
</div>

perhaps

new Vue({
  foo: {
    title: '',
    description : ''
  },
  created(){
    // Calling the back-end interface
  }
})

HTTP Basic: Access denied

Problem: git push error HTTP basic: access denied

Reason: the user name and password configured by local git are inconsistent with those registered on gitlabs.

Solution: enter control panel user account credential manager?Windows credentials, find git in it, click Edit password, and update to the latest password

reference

Mavenzai install Error: There are test failures

Error statement: failed to execute goal org.apache.maven . plugins:maven-surefire-plugin :2.12.4:test (default-test) on project web_ nanchang: There are test failures.

Solution:
1. Find the specified project that reports an error, which project will be prompted in the Error statement generally
2. Add a plug-in in the POM file of the project, which can pass through install successfully generally 2 org.apache.maven. plugins Maven surefire plugin true
3. If not, please check whether the service on the virtual machine is enabled and restart

ImageIO.read () unsupported image type when reading picture_ exception Unsupported Image Type

ImageIO.read Error in reading a picture:

javax.imageio.IIOException : Unsupported Image Type_ exception Unsupported Image Type

Adding dependencies to Maven projects can solve this problem

<dependency>
	<groupId>com.twelvemonkeys.imageio</groupId>
	<artifactId>imageio-jpeg</artifactId>
	<version>3.3.2</version>
</dependency>