Author Archives: Robins

Unit package manager error

Although the idea of changing unity to package manager is very good, we always encounter various exotic problems. For example, when importing the project, when processing the package, all kinds of prompts report errors, resulting in the project cannot be opened normally… Click continue to flash back.

Unity package manager error: unable to connect“ https://packages.unity.cn ”

It seems to be the problem of unity China.

The solutions are as follows:

Add environment variables and add them directly from the command line under CMD (please open it in administrator mode). The command is as follows: setx unity_ NOPROXY localhost,127.0.0.1

Wait for the environment variable to be added.

Update: some projects can be done like this. Today another project will always prompt unable to connect“ https://packages.unity.cn “It’s very painful. Unity is too rubbish. Normally, I copy the package cache from other projects. Shouldn’t it work?He can’t

Problems in springboot upgrade 2.4.0: when allowcredentials is true, allowedorigins cannot contain the specia

    When allowCredentials is true, allowedOrigins cannot contain the special value “*“since that cannot be set on the “Access-Control-Allow-Origin” response header. To allow credentials to a set of origins, list them explicitly or consider using”allowedOriginPatterns” instead.

The translation is as follows:

Solution: cross domain configuration error, replace . Allowedorigins with . Allowedoriginpatterns .

Before revision:

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    /**
     * Open cross-domain
     */
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        // Set the routes that are allowed across the domain
        registry.addMapping("/**")
                // Set the domain name that allows cross-domain requests
                .allowedOrigins("*")
                // whether to allow certificates (cookies)
                .allowCredentials(true)
                // set the allowed methods
                .allowedMethods("*")
                // Allowed time across domains
                .maxAge(3600);
    }

}

After modification:

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    /**
     * Open cross-domain
     */
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        // Set the routes that are allowed across the domain
        registry.addMapping("/**")
                // Set the domain name that allows cross-domain requests
                .allowedOriginPatterns("*")
                // whether to allow certificates (cookies)
                .allowCredentials(true)
                // Set the allowed methods
                .allowedMethods("*")
                // Allowed time across domains
                .maxAge(3600);
    }

}

Android monitor EditText text input EditText monitor events and input events

Method 1: use setonkeylistener (), which can only listen to hard keyboard events, so most Android devices can’t use it

editText.setOnKeyListener(new View.OnKeyListener() {              
            @Override  
            public boolean onKey(View v, int keyCode, KeyEvent event) {  
                Log.i(TAG, editText.getText());  
                return false;  
            }  
        }); 

method 2: use textwatcher class to monitor the soft keyboard and hard keyboard, just implement the ontextchanged method. In addition, textwatcher also provides the beforetextchanged and aftertextchanged methods for more detailed input monitoring

editText.addTextChangedListener(new TextWatcher() {           
            @Override  
            public void onTextChanged(CharSequence s, int start, int before, int count) {  
            	Log.i(TAG, "please input the status in the word, count is the number of the string your input"); 
                Log.i(TAG, editText.getText());  
            }  
              
            @Override  
            public void beforeTextChanged(CharSequence s, int start, int count,  
                    int after) {   
            	Log.i(TAG, "input the status after your text");  
            }  
              
            @Override  
            public void afterTextChanged(Editable s) {   
            	Log.i(TAG, "input the status before your text");  
            }  
        });

Method 3: when the input value reaches the maximum value, it is not allowed to input again. In addition, EditText does not provide us with the function of forbidding input of EditText. The following method also realizes this function.

 

  private void setEditable(EditText editText, int maxLength, boolean value) {  
        if (value) {  
            editText.setFilters(new InputFilter[] { new MyEditFilter(maxLength) });  
            editText.setCursorVisible(true);  
            editText.setFocusableInTouchMode(true);  
            editText.requestFocus();  
        } else {  
            editText.setFilters(new InputFilter[] { new InputFilter() {  
                @Override  
                public CharSequence filter(CharSequence source, int start,  
                        int end, Spanned dest, int dstart, int dend) {  
                    return source.length() < 1 ?dest.subSequence(dstart, dend)  
                            : "";  
                }  
            } });  
            editText.setCursorVisible(false);  
            editText.setFocusableInTouchMode(false);  
            editText.clearFocus();  
        }  
    } 

Could not install packages due to anenvironment error: [winerror 5] access denied

I’ve been learning Python before, but I’m not familiar with PIP

Every time you install a package, PIP will

You are asked to install the updated version of PIP, which is 10.1

But after the update, when installing other libraries, we habitually install the libraries in the same way as before

This is a problem

Due to time constraints, pip10.1 has no time to study. I want to go back, but I can’t

Look at the wrong requirements

Just Python – M PIP install — user — upgrade PIP = = 9.0.3

Just add a — user

As for why, I don’t know. I’ll be in a hurry when I have a problem. I can use it

If you still report an error when installing some packages after returning!!

I often encounter this error, and I feel that the online solutions are a bit messy

Just add a — user directly after install

Vs code solves the problem that latex does not display references and [?] is displayed in the text

After compiling, display without reference:

solution:

    compile to make sure that there are. Aux files in the same directory folder as. Tex. click Terminal – & gt; new terminal on the top navigation bar of vscode to export the console. Enter the command: BibTex will automatically prompt the file name, and then recompile to display the references

    Note: if the reference is displayed, but the text is [?], note that the quotation of latex is: balabalabalab , there is a space between the text and , or compile twice !

Eclipse Tomcat Error creating bean with name ‘sqlSessionFactory’ defined in URL…

[operation environment]

jdk1.8+eclipse+apache tomcat v7.0

 

[phenomenon]

Code running error org.apache.catelina . core.StandardContext listenerStart

Error creating bean with name ‘sqlSessionFactory’ defined in URL [file:/E:/apache-tomcat-7.0.63-windows-x64

 

Tomcat error

 

Reason: no Tomcat jar package added

Select the project, right-click, select build path — & gt; add Libraries… — & gt; select server runtime — & gt; next — & gt; select Apache Tomcat v7.0 — & gt; OK.

 

 

 

 

 

TypeException: Error setting non null for parameter #1 with JdbcType null

Insert the expiration date into mysql. The error is:

Login exception is org.apache.ibatis . type.TypeException : Could not set parameters for mapping: ParameterMapping{property=’expired’, mode=IN, javaType=class java.util.Date , jdbcType=null, numericScale=null, resultMapId=’null’, jdbcTypeName=’null’, expression=’null’}. Cause: org.apache.ibatis . type.TypeException : Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException : Parameter index out of range (1 > number of parameters, which is 0).

I always thought that the MySQL insert date required format. After traversing various methods, I saw a blog and found that it was a problem with my own insert statement…

@Insert({"insert into ", TABLE_NAME, "(", INSERT_FIELDS,") values (#userId}, #{expired}, #{status}, #{ticket})" })

There is one missing userid{

Right for

@Insert({"insert into ", TABLE_NAME, "(", INSERT_FIELDS,") values (#{userId}, #{expired}, #{status}, #{ticket})" })

Taikeng, record it

Attributeerror: object has no attribute

Error report: in the front-end test, the interface sends a put request, the error report occurs on the interface, the request cannot respond, and the server status code is 500.

Error analysis: semantically, “the object does not have a XXX attribute.”.

Look up most of the information, most of the problems with Python. The front end of this project uses react, and the back end uses the djongo framework of Python.

The main reason for asking the back-end colleagues is that the data type of the parameters passed by the front-end is incorrect. The back end needs a string “true”, but the front end passes a Boolean “true”, which causes the above problem.

In case of such a problem, the error code returned by the server is 500. For such a problem, usually ask the back-end colleagues to check the log for common analysis.

An error is reported after Android studio creates a new virtual machine. Emulator: emulator: error: unknown AVD name

Background: after Android studio is installed, a new virtual machine is created, and then it runs normally for the first time, and then it runs with two errors:
1. Emulator: emulator: error: unknown AVD name, use – list avds to see valid list.
2. Emulator: process finished with exit code 1
search the Internet for the problem, and find the following solution: save a note.
Original source: https://blog.csdn.net/xiaoxiao133/article/details/79819532
Abstract:
Open AVD manager, or you can find

in the menu bar tools, and then click Show on disk in the inverted triangle on the right

the picture is from the original blog Then jump to the folder of your virtual machine and copy the previous path. Take the original blog map as an example:
* * C: (users/administrator) \ *
just use the previous path (all the previous paths of Android include “\”)

and then go to Android in the computer environment variable_ SDK_ Under home

* add Android_ SDK_ The value of the home variable is changed to the path that was copied just now, C:: Restart Android studio!!
Thank you again for understanding Android_ SDK_ Environment variable of home!
Please contact me to delete it.

Yapi platform deployment error (MAC must report error) solution

1. Deploy Yapi locally

According to the official documents, after the global installation of Yapi CLI and mongodb, the terminal executes Yapi server, and the browser enters 127.0.0.1:9090 to open the deployment page

After filling in the basic information, click Start deployment, wait for a period of time, the problem appears

node server/install.js

Error:internal/modules/cjs/loader.js:584
   throw err;

Errpr:Cannot find module 'nodemailer'
  at Function.Module_resolveFileName(.........)
  at Function.Module_resolveFileName(.........)
  ........

   

The reason for the error is probably the lack of nodemailer module, so I tried to install the module globally. After the installation, I still reported the same error. In this way, I kept looking for the error. I deleted the project and started over again. After repeated tossing and tossing, I was about to re install the system. After one afternoon’s tossing and tossing, I finally found a solution

2. Solutions

Due to the problem of MAC permission, Yapi is initialized according to the official document writing method, and finally there is no write permission in NPM, resulting in the loss of packets

Modify the “Yapi server” as

sudo yapi server

Then the project is deployed again and the problem is solved