Tag Archives: experience

[Solved] Vue Project startup error: no eslint configuration found

rimraf node_ Modules delete node_ modules

Delete package lock json

npm init -y

npm install eslint –save-dev

Add manually the following code is configured for the eslintrc.js  file. The rules can be configured by themselves

module.exports = {
    root: true,
    parserOptions: {
      parser: 'babel-eslint',
      sourceType: 'module'
    },
    env: {
      browser: true,
      node: true,
      es6: true,
    },
    extends: ['plugin:vue/recommended', 'eslint:recommended'],
  
    // add your custom rules here
    //it is base on https://github.com/vuejs/eslint-config-vue
    rules: {
      "vue/max-attributes-per-line": [2, {
        "singleline": 10,
        "multiline": {
          "max": 1,
          "allowFirstLine": false
        }
      }],
      "vue/singleline-html-element-content-newline": "off",
      "vue/multiline-html-element-content-newline":"off",
      "vue/name-property-casing": ["error", "PascalCase"],
      "vue/no-v-html": "off",
      'accessor-pairs': 2,
      'arrow-spacing': [2, {
        'before': true,
        'after': true
      }],
      'block-spacing': [2, 'always'],
      'brace-style': [2, '1tbs', {
        'allowSingleLine': true
      }],
      'camelcase': [0, {
        'properties': 'always'
      }],
      'comma-dangle': [2, 'never'],
      'comma-spacing': [2, {
        'before': false,
        'after': true
      }],
      'comma-style': [2, 'last'],
      'constructor-super': 2,
      'curly': [2, 'multi-line'],
      'dot-location': [2, 'property'],
      'eol-last': 2,
      'eqeqeq': ["error", "always", {"null": "ignore"}],
      'generator-star-spacing': [2, {
        'before': true,
        'after': true
      }],
      'handle-callback-err': [2, '^(err|error)$'],
      'indent': [2, 2, {
        'SwitchCase': 1
      }],
      'jsx-quotes': [2, 'prefer-single'],
      'key-spacing': [2, {
        'beforeColon': false,
        'afterColon': true
      }],
      'keyword-spacing': [2, {
        'before': true,
        'after': true
      }],
      'new-cap': [2, {
        'newIsCap': true,
        'capIsNew': false
      }],
      'new-parens': 2,
      'no-array-constructor': 2,
      'no-caller': 2,
      'no-console': 'off',
      'no-class-assign': 2,
      'no-cond-assign': 2,
      'no-const-assign': 2,
      'no-control-regex': 0,
      'no-delete-var': 2,
      'no-dupe-args': 2,
      'no-dupe-class-members': 2,
      'no-dupe-keys': 2,
      'no-duplicate-case': 2,
      'no-empty-character-class': 2,
      'no-empty-pattern': 2,
      'no-eval': 2,
      'no-ex-assign': 2,
      'no-extend-native': 2,
      'no-extra-bind': 2,
      'no-extra-boolean-cast': 2,
      'no-extra-parens': [2, 'functions'],
      'no-fallthrough': 2,
      'no-floating-decimal': 2,
      'no-func-assign': 2,
      'no-implied-eval': 2,
      'no-inner-declarations': [2, 'functions'],
      'no-invalid-regexp': 2,
      'no-irregular-whitespace': 2,
      'no-iterator': 2,
      'no-label-var': 2,
      'no-labels': [2, {
        'allowLoop': false,
        'allowSwitch': false
      }],
      'no-lone-blocks': 2,
      'no-mixed-spaces-and-tabs': 2,
      'no-multi-spaces': 2,
      'no-multi-str': 2,
      'no-multiple-empty-lines': [2, {
        'max': 1
      }],
      'no-native-reassign': 2,
      'no-negated-in-lhs': 2,
      'no-new-object': 2,
      'no-new-require': 2,
      'no-new-symbol': 2,
      'no-new-wrappers': 2,
      'no-obj-calls': 2,
      'no-octal': 2,
      'no-octal-escape': 2,
      'no-path-concat': 2,
      'no-proto': 2,
      'no-redeclare': 2,
      'no-regex-spaces': 2,
      'no-return-assign': [2, 'except-parens'],
      'no-self-assign': 2,
      'no-self-compare': 2,
      'no-sequences': 2,
      'no-shadow-restricted-names': 2,
      'no-spaced-func': 2,
      'no-sparse-arrays': 2,
      'no-this-before-super': 2,
      'no-throw-literal': 2,
      'no-trailing-spaces': 2,
      'no-undef': 2,
      'no-undef-init': 2,
      'no-unexpected-multiline': 2,
      'no-unmodified-loop-condition': 2,
      'no-unneeded-ternary': [2, {
        'defaultAssignment': false
      }],
      'no-unreachable': 2,
      'no-unsafe-finally': 2,
      'no-unused-vars': [2, {
        'vars': 'all',
        'args': 'none'
      }],
      'no-useless-call': 2,
      'no-useless-computed-key': 2,
      'no-useless-constructor': 2,
      'no-useless-escape': 0,
      'no-whitespace-before-property': 2,
      'no-with': 2,
      'one-var': [2, {
        'initialized': 'never'
      }],
      'operator-linebreak': [2, 'after', {
        'overrides': {
          '?': 'before',
          ':': 'before'
        }
      }],
      'padded-blocks': [2, 'never'],
      'quotes': [2, 'single', {
        'avoidEscape': true,
        'allowTemplateLiterals': true
      }],
      'semi': [2, 'never'],
      'semi-spacing': [2, {
        'before': false,
        'after': true
      }],
      'space-before-blocks': [2, 'always'],
      'space-before-function-paren': [2, 'never'],
      'space-in-parens': [2, 'never'],
      'space-infix-ops': 2,
      'space-unary-ops': [2, {
        'words': true,
        'nonwords': false
      }],
      'spaced-comment': [2, 'always', {
        'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
      }],
      'template-curly-spacing': [2, 'never'],
      'use-isnan': 2,
      'valid-typeof': 2,
      'wrap-iife': [2, 'any'],
      'yield-star-spacing': [2, 'both'],
      'yoda': [2, 'never'],
      'prefer-const': 2,
      'no-debugger': process.env.NODE_ENV === 'production' ?2 : 0,
      'object-curly-spacing': [2, 'always', {
        objectsInObjects: false
      }],
      'array-bracket-spacing': [2, 'never']
    },
    globals: {
      'AMap': false,
      'AMapUI': false,
      '__webpack_public_path__': true
    }
  }
  

[Solved] Error reading comm device when writing serial communication with MSComm control

1. Problem description

In the process of serial communication written with MSComm control, when receiving the data sent by the serial port under the message response function OnComm function, in get_ An error reading comm develop error occurs in the input() function. The specific codes are as follows:

void XXXDlg::OnCommMscommLaser()
{
	memset(chstrLaser, 0, 1024);    //chstrLaseris a global variable.

	short i = m_mscomLaser.get_InBufferCount(); // statement 1.
	if(m_mscomLaser.get_CommEvent() == 2) // An event value of 2 means there are characters in the receive buffer.
	{
		/*m_recivedMsg = "";
		
		CString csstr = "";*/

		VARIANT InputData = m_mscomLaser.get_Input(); //Statement 2, read buffer.

		COleSafeArray csa = InputData; //VARIANT variable is converted to COleSafeArray variable.

		//translate to byte class.
		DWORD size = csa.GetOneDimSize();
		for(long k = 0; k < size; k++)
			csa.GetElement(&k, chstrLaser + k);
	}

    // Further processing of the received data ......

	return;
}

Each time the function is triggered, the data length of the receive buffer obtained by statement 1 is 30, which means that the receive buffer has data with a length of 30. However, the above error prompt will appear in statement 2, and the code after statement 2 will not be executed.

2.Method exploration

1. At first, I thought it was a data line problem. By changing the data line and making the data line myself, the problem could not be solved.

2. I suspected that there was a problem with the communication equipment. I also changed the equipment for debugging, but the same problem still occurred.

3. Suspected that the communication protocol was not clear.

4. Wait

3. Solution

After many serial port debugging assistants failed, I found that a serial port debugging assistant can communicate normally. I will provide the debugging assistant later. The current problem may be that the code is written incorrectly, and the data cable and equipment are OK.

Through a large number of searches, I found that one solution was to update the serial driver. After trying, I found that it was really possible. After a whole day, I finally solved this problem. I was very excited.

Here is the solution:

1. Download serial driver

My is a USB to 232 data cable, so I downloaded the prolific USB to serial comm port driver. You can download the corresponding driver according to your actual situation. Here I provide the driver that solves my problem: Click to download the serial port driver.

2. Update driver

After downloading the driver, start updating the driver:

a. Click Manage – > Click device manager -> Locate the serial port configured through the MSComm control

b. Right click the serial driver and click Update Driver Software – > Select browse computer for driver software

c. Click Browse to find the downloaded serial driver

d. Click next to solve the above problems after updating.

Tomcat memory overflow in Eclipse: Java. Lang. outofmemoryerror: permgen space solution:

1. Configure the size of this part of heap memory through the JVM parameter – XX: maxpermsize = 256M.  

2. How to configure the memory size of Tomcat in eclipse?

First, you need to double-click Tomcat server, as shown in the figure below:

Double click the figure above to display the Tomcat configuration interface

Then, click the link in the red rectangular box in the figure above, and the node of Tomcat parameter configuration will pop up. To select the arguments parameter box:

As shown in the figure above, you can set the value of – XX: maxpermsize = 256M in the VM arguments text box. Of course, you can add other JVM parameters, such as maximum memory, minimum memory, etc.

[Solved] Tomcat7 Start Error: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardCon

When transforming a project in eclipse, tomcat7 is always started

Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/AtomLocal]]

terms of settlement:

Right click project properties, find deployment assembly, add Java build path entries and Maven dependencies

hypercan Have unordered match in sub-expressions.

Question:

Hyperscan 5.4.0 compiles the following rule: have unordered match in sub expressions

0  :/ com$/Q
1:/http./Q
2:/  ( ! ( 0)&( 1))/C

reason:

Because the two subexpressions 0 and 1 in the logical combination of rule 2 contain rules leading to disorder, which are not supported in hypersan. Rules similar to rule 0 can be used alone, but they are not allowed in combination logic https://github.com/intel/hyperscan/issues/234

Revision:

Remove the rule of 0 in combinatorial logic,

reference resources:

https://github.com/intel/hyperscan/issues/234

https://gitmemory.com/issue/intel/hyperscan/234/626130718

https://bestofcpp.com/repo/intel-hyperscan-cpp-regular-expression

http://intel.github.io/hyperscan/dev-reference/compilation.html#logical -combinations

https://github.com/intel/hyperscan/releases

Error: could not fork new process for connection: Resource temporarily unavailable

The target user has too many processes or threads.
alone without each process limit Linux threads, just on the system process of the total limit
(thread is essentially on Linux has Shared address space of the process),
to check the number of threads:
the cat/proc/sys/kernel/threads – Max
to increase the number of threads:
echo 100000 > /proc/sys/kernel/threads-max
There is also a limit to the number of processes (and threads) that a single user can create, ulimit/getrlimit details about these limits.

Vs2017 C + + cannot open source file: “sdkddkver. H”, “stdio. H”, “TCHAR. H”

The first time it was installed, the error in the picture appeared. Searched for this for a long time, thought is the installation problem, uninstall reinstall several times…… Thirty grams of stuff, it’s no joke.

But finally found that the reason for this problem is!! In the case of Visual Studio default installation, there are files that are not checked by default, that is, they are not installed by default. (Also should be because Win10SDK installation failed, but how to install also can not install, even if…

, causing problems)
But!!!!! H and stdio.h exist in these files.
It is not installed by default, as shown in the figure below:

Because oneself is this pit for a long time, think the net search is all sorts of separate download, the latter search, and then reconfigure and so on incomparable trouble operation. Here are some of the easiest ways to do it once and for all

Solution:
Just go to Programs and Functions, go to VS, right-click, modify, and check those, and you’re done.


Right-click and go to Change
Then you can see:

Then, click More and Select – Modify (check the box). After the completion of the picture, found that I forgot that several are unsolved problems ticked)

C++, check, and then confirm the modification OK, wait for the installation, problem solved. You don’t have to go to download WindowsSDK yourself.

Solve!
(after this can be used, my development needs can basically meet, but this is the installation of Win10SDK failure, the helpless move)

Separate installation, you can reference this article: http://blog.csdn.net/hhh1108/article/details/50352027
There is also a point of benefit, so you can install to other disks. Configure it yourself. VS will be installed on the C drive.

Of course, if you can install the Win10SDK on your computer, you should not have this problem.

Xcode configuring OpenGL

Xcode configuration OpenGL
Link GLFW
Download the source files, http://www.glfw.org/download.html
compilation Open a terminal, type the command line

cmake .
sudo make install

Compiles displays library paths, such as:
Installing:/usr/local/lib/libglfw3. A

<>sr /local/include/>

the source file: http://glew.sourceforge.net/ zip is ok

make
sudo make install
make clean

This is going to be a slow step
Sudo make install on Mac OS X EI Capitan
install -d-m 0755 “/usr/include/GL”
stall: mkdir /usr/include: Operation not permitted
m>: * [install.include] Error 71
This is because, starting with El Capitan, Mac OS X has enabled System Integrity Protection, which no longer allows direct access to directories under /usr, except /usr/local, so you need to install GLEW under /usr/local. GLEW’s Makefile will be changed to GLEW_DEST?= /usr = GLEW_DEST?Sudo make install = /usr/local
Then link some Framework
Cocoa, IOKIT, CoreVideo, and the generated libglfw3.a

Cause of runtime error on OJ

Except for the five cliches
1. Array size is too small, resulting in access to the memory should not be accessed
2. A division by zero error occurred
3. A large array is defined inside a function, causing the program stack to run out
4, The pointer is used incorrectly, resulting in access to the memory should not be accessed
5. It is also possible that the program threw an unreceived exception
The author also found that sometimes open array on OJ is too large (global variables, can run normally in the local) will cause runtime error, we need to pay attention to.