Author Archives: Robins

Keil5 error: #29: expected an expression [Solved]

…/Core/Src/main.c(113): error: #29: expected an expression


preface

When defining a macro, you habitually align and type spaces, resulting in an error when calling

1. Wrong situation

#define SDA_High()   do{HAL_GPIO_WritePin(I2C_Port,I2C_SDA_Pin,GPIO_PIN_SET);}while(0)
#define SDA_Low ()   do{HAL_GPIO_WritePin(I2C_Port,I2C_SDA_Pin,GPIO_PIN_RESET);}while(0)  
//      SDA_Low ()  Spaces added for alignment

When calling the program

	SDA_Low();
	SDA_High();

Program error:
…/core/SRC/main. C (113): error: #29: expected an expression
…/core/SRC/main. C (113): error: #65: expected a “;”
solution: remove the space

Summary

Format #define identifier replacement list of macro definition
macro definition uses “identifier” to represent the content in the “replacement list”. The identifier is called the macro name. During preprocessing, the preprocessor will replace all macro names in the source program with the contents in the replacement list in the macro definition. When defining many parameters, it is recommended to use do {} while (0). For reasons, refer to the benefits of using do {} while (0) in macro definition

[Solved] Yarn install Error: “error Found incompatible module.”

Today, an error was reported when installing the dependency using yarn install. After consulting the online resources, the problem was solved. Here is a record.

The error content is as follows: no matching version was found

D:\Web Storm-Workspace\xxxx>yarn install
yarn install v1.22.15
[1/6] Validating package.json...
[2/6] Resolving packages...
[3/6] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.

info "[email protected]" is an optional dependency and failed compatibility ch
eck. Excluding it from installation.
error [email protected]: The engine "node" is incompatible with this module.
 Expected version "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0". Got "14.8
.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about
this command.

Enter the following line of code: yarn config set ignore – engines true

The problem is solved.

D:\Web Storm-Workspace\xxxx>yarn config set ignore
-engines true

yarn config v1.22.15
success Set "ignore-engines" to "true".
Done in 0.11s.

Re-execute yarn Install, you will find that yarn is successfully installed!!!

EGG Error: nodejs.Error: Invalid filename [How to Solve]

preface:

This error occurs when using the upload function of egg.

1. Error message:

Error in file name

2. Error reporting reason:

There is no configuration file information in config.default.js, but it is directly obtained in the controller, and an error CTX. Request. Files = = undefined is reported

const file = ctx.request.files[0]; //Get uploaded files

3. Solution:

Add in config.default.js:

//Enable file mode
  config.multipart = {
    mode: 'file'
  }

4. Cause new problems:   Invalid filename: order information.xlsx

5. Solutions to new problems and types have to be set. There is a parameter in the upload that is a white list

Add: whitelist: [‘. Xlsx’] in config.default.js

//Enable file mode
  config.multipart = {
    mode: 'file',
    fileSize: 1048576000,
    whitelist: ['.xlsx']
  }

That’s it!

How to Solve Excel Error Log 0: Install Error

SLOVER installation manual:
① file -> More-> Options

②Add-in

③ Bottom go

④ Check solver add in and confirm to save

⑤ solver will appear in the upper right corner of the data toolbar

Error phenomenon:
the computer with 64 bit Office installed will prompt that the macro is not available after installation

even options -> Trust Center -> Credit center settings -> Macro settings -> Enable all macros and still prompt the same error.

Solution:
① the solver cannot be installed on a 64 bit computer. You can uninstall the local 64 bit office and reinstall 32-bit office.

Or

② Install VMware, build a win10, install an office 32-bit system on the virtual machine, and open network sharing and shared folders
(1) VMware installation reference: the latest super detailed VMware virtual machine download and installation
VMware official website: VMware download
(basically the default installation)

(2) Install virtual machine win10
VMware virtual machine install windows system

(3) Setting shared folders for virtual machines
VMware sets shared folders for windows virtual machines

(4) Virtual machine settings network
I found many strategies and didn’t understand
it turns out that it’s actually very simple
when the virtual machine is turned off, select Edit virtual machine settings

then select network adapter, check bridge mode and copy physical network connection status

OK, turn on the virtual machine again and find that the virtual machine can access the Internet normally

(5) the last step is the installation of 32-bit office
Microsoft Office
come to an official website link, download and install, and finish it.

[Solved] MAC system brew install error: failure while executing

Error when installing Apache http server on Mac, brew install httpd
The error message is as follows:

==> Installing httpd dependency: nghttp2
==> Pouring nghttp2-1.44.0.big_sur.bottle.tar.gz
tar: Error opening archive: Failed to open ‘/Users/zhaopengkang/Library/Caches/Homebrew/downloads/727a7b871748b95a1fa9008831d439c4f999a5d065e3da3fe1e80b82d53c3e07–nghttp2-1.44.0.big_sur.bottle.tar.gz’
Error: Failure while executing; `tar –extract –no-same-owner –file /Users/zhaopengkang/Library/Caches/Homebrew/downloads/727a7b871748b95a1fa9008831d439c4f999a5d065e3da3fe1e80b82d53c3e07–nghttp2-1.44.0.big_sur.bottle.tar.gz –directory /private/tmp/d20211015-52303-1xq0k1l` exited with 1.

The error means: Error opening the archive file:

727a7b871748b95a1fa9008831d439c4f999a5d065e3da3fe1e80b82d53c3e07–nghttp2-1.44.0.big_sur.bottle.tar.gz,Then run the tar command to give you another backup.
All similar cases like this, directly install brew install XXX manually, and then re-execute the previous command.
I reported an error here run brew install nghttp2, re-execute brew install httpd, install successfully problem solved.

How to Solve Excel Error Log 2: Sloving method

Error phenomenon: when solver uses simple LP, it cannot find a solution satisfying constraints
tips can be answered using GRG nonlinear

Solution:
GRG nonlinear is selected for the solving method

After testing, even if the constraints input expression is correct, different solving methods will report errors.

For the differences between the three solving methods:

  1. Will build a linear programming model, using the Simplex method;
  2. Solving speed: Simplex> GRG> Evolutionary
  3. GRG may not get the global optimal solution, use Evolutionary to get the global optimal solution;
  4. Using GRG combined with Multistart can get a better local optimal solution.

in short, when an error is reported, if there is no problem with the constraints after the inspection, change the solving method

[Solved] error: cannot create �� Illegal byte sequence

Phenomenon:

Unzip a compressed package under mac(   If the folder name or file contains Chinese) Yes, the following error occurs during compressed zip archiving under Windows:

error:   cannot create �…
Illegal byte sequence

Solution::

# use ditto to replace unzip

ditto -V -x -k --sequesterRsrc --rsrc FILE_NAME.ZIP YOUR_DESTINATION

error: resource android:attr/lStar not found [How to Solve]

When integrating androidx.activity:activity in Android projects, an error is reported.xxx/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:5395: error: resource android:attr/lStar not found.error: failed linking references.

Analysis.
1. gradle introduces the configuration.

    def activity_version = "1.4.0-alpha02"

    // Java language implementation
    implementation "androidx.activity:activity:$activity_version"
    // Kotlin
    implementation "androidx.activity:activity-ktx:$activity_version"

2. Project gradle configuration:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.1"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

3. The project is a brand-new project and kotlin has not been introduced, so it is not a kotlin version number problem.

4. After modifying the compilesdkversion and targetsdkversion to 31, the operation is normal.