Author Archives: Robins

UnhandledPromiseRejectionWarning Error: Can‘t set headers after they are sent (How to Fix)

(node:57300) UnhandledPromiseRejectionWarning: Error: Can't set headers after they are sent.
    at validateHeader (_http_outgoing.js:491:11)
    at ServerResponse.setHeader (_http_outgoing.js:498:3)

In the Node project, you encountered this error while doing module splitting.
is checked to be package.json deleted

"babel-preset-env": "1.3.2",
"babel-preset-es2015": "6.24.1",
"babel-preset-stage-2": "6.24.1"

These three modules cause these three modules not to be deleted.
is originally required by the server to render the json inside the reference file is relative. Node_modules relative to the root directory, so the items below the root directory are related to modules such as vue, Babel-Polyfill, etc.

Python Error: bash syntax error near unexpected token `newline’

Downloaded the code on Github and executed the following error locally:

Namely: bash: Syntax error near unexpected Token ‘newline’
The original code is

$ python pano.py <txtlists/files1.txt>

Solution: Angle brackets < > To remove, ‘< ‘and’ & gt; ‘is a special character that needs attention when typing at the command terminal.

Python synthesizes multiple pictures into one video

Reference python + opencv to save the picture as video – 2016 update,
code example is:

def imgs2video(imgs_dir, save_name):
    fps = 24
    fourcc = cv2.VideoWriter_fourcc(*'MJPG')
    video_writer = cv2.VideoWriter(save_name, fourcc, fps, (1920, 1080))
    # no glob, need number-index increasing
    imgs = glob.glob(os.path.join(imgs_dir, '*.png'))

    for i in range(len(imgs)):
        imgname = os.path.join(imgs_dir, 'core-{:02d}.png'.format(i))
        frame = cv2.imread(imgname)
        video_writer.write(frame)

    video_writer.release()

Reference python opencv VideoWriter: opencv:frame size mismatched video size,

    1. Error
"mMovieWriter.status: 3. Error: Cannot Save"

Because I already have a file with the same name, I can’t overwrite it, so just delete it and convert it.

      1. Warning:
OpenCV: Frame size does not match video size.
      1. warning:
WARNING: -finishWriting should not be called on the main thread.

Proxy error:could not proxy request

The problem

To explore the
The problem of Proxy error is because the port number is occupied. There are 500 problems in the front end, indicating that there are problems in the back end server, not the proxy in the front-end vue.config. Check that the port number on the back end matches the port number on the front end.

Back end:
where the test environment is called. But the front start local environment,

Fix:
changes the test environment to local

It will run normally
Common web code
Popularize some common signs:

100: Continue
200: Success
400: error requests
401: Unauthorized
403: Server rejects request, prohibits
404: Server could not find the requested page
405: Suppressing the method specified in the request
408: Request for timeout
414: The requested URL is too long for the server to process.
500: Internal server error
505: Server does not support the version of the http protocol used in the request

IDEA-Error java error release version 5 not supported (How To Fix)

Refer to the

\rightarrow

→ Refer to article 1 and article 2
Content of the error
Error:java: error: release version 5 not supported

Error reason
Error setting Java compiler in project structure or Settings
The solution
1, the project structure
Click

File-Project Structure

File \rightarrow Project Structure

File→ProjectStructure
make sure that the SDK versions under the Project are the same
make sure that the Language level version in Sources is the same as the one used
make sure that the Module SDKl version is the same as the one used

2, the Preferences

    1. Click on Preferences(or Settings in Win version

    1. ) to search Java Compiler to ensure that the Target byte code version is the same as the selected version

3. Re-execution should have been resolved

4. One more question
Every time the pom file is modified, the original setting is useless and the error is reported again. The solution is to add maven-compiler-plugin to
in the parent pom and specify the JDK version to be used by the JDK

	<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>13</source>
                    <target>13</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

[How to Fix] Fatal error: init(coder:) has not been implemented

The problem
Customize view and then use xib to load this view. Run it and then crash :

Thread 1: Fatal error: init(coder:) has not been implemented

The solution
will

required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
}

Just call the superclass method instead:

required init?(coder aDecoder: NSCoder) {
    super.init(coder: aDecoder)
}

[How to Fix] dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

1. Problem: There is a dependency problem during the Ubuntu software installation process

 “E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).” 

The following two commands as instructed did not solve the problem.

sudo apt-get -f install
sudo apt-get --fix-broken install

Instead, the problem of “DPkg-deb: error: paste subprocess was killed by signal (Broken pipe)” appeared again

Preparing to unpack .../ros-melodic-moveit-core_0.10.8-0bionic.20181227.040044_amd64.deb ...
Unpacking ros-melodic-moveit-core (0.10.8-0bionic.20181227.040044) over (0.10.5-0bionic.20181117.193206) ...
dpkg: error processing archive /var/cache/apt/archives/ros-melodic-moveit-core_0.10.8-0bionic.20181227.040044_amd64.deb (--unpack):
 trying to overwrite '/opt/ros/melodic/include/moveit/collision_distance_field/collision_detector_allocator_distance_field.h', which is also in package ros-melodic-moveit-experimental 0.10.5-0bionic.20181117.194840
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/ros-melodic-moveit-core_0.10.8-0bionic.20181227.040044_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Final solution:

sudo apt-get autoremove ros-melodic-moveie-experimental
sudo apt-get -f install

Postscript: the origin of this problem is a legacy problem that occurred when installing ros under ubuntu18.04. As it had no impact on normal software installation, it was abandoned. However, today when installing teamviewer, I encountered a dependency problem and reported an error when -f install could not be performed. After many unsuccessful attempts to re-install ROS, I unexpectedly purge the command and failed to execute. As a result, The problem is overwhelming and I have little knowledge of the system.

[How to Fix] org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.

org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:230)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:729)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2261)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2134)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1988)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
at $Proxy54.save(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy55.save(Unknown Source)
at org.rtx.wmprd.test.TestAsnServices.main(TestAsnServices.java:37)
Caused by: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0xde (at char #541, byte #127)
at com.ctc.wstx.sr.StreamScanner.throwFromIOE(StreamScanner.java:708)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1086)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:218)
... 32 more
Caused by: java.io.CharConversionException: Invalid UTF-8 middle byte 0xde (at char #541, byte #127)
at com.ctc.wstx.io.UTF8Reader.reportInvalidOther(UTF8Reader.java:313)
at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:204)
at com.ctc.wstx.io.MergedReader.read(MergedReader.java:101)
at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:84)
at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:992)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:1034)
at com.ctc.wstx.sr.StreamScanner.getNextChar(StreamScanner.java:794)
at com.ctc.wstx.sr.BasicStreamReader.parseNormalizedAttrValue(BasicStreamReader.java:1900)
at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:3037)
at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2936)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2848)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
... 33 more
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)
at $Proxy54.save(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy55.save(Unknown Source)
at org.rtx.wmprd.test.TestAsnServices.main(TestAsnServices.java:37)
Caused by: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0xde (at char #541, byte #127)
at com.ctc.wstx.sr.StreamScanner.throwFromIOE(StreamScanner.java:708)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1086)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:218)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:729)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2261)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2134)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1988)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
... 17 more
Caused by: java.io.CharConversionException: Invalid UTF-8 middle byte 0xde (at char #541, byte #127)
at com.ctc.wstx.io.UTF8Reader.reportInvalidOther(UTF8Reader.java:313)
at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:204)
at com.ctc.wstx.io.MergedReader.read(MergedReader.java:101)
at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:84)
at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:992)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:1034)
at com.ctc.wstx.sr.StreamScanner.getNextChar(StreamScanner.java:794)
at com.ctc.wstx.sr.BasicStreamReader.parseNormalizedAttrValue(BasicStreamReader.java:1900)
at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:3037)
at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2936)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2848)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
... 33 more

When using Apache CXF, the above exception appears in the calling method. After careful inspection, the ASM package is missing. Just introduce the ASM package.

-1: error: fatal error: no input files problem solved

QT error is reported as follows: -1: error: fatal error: no input files
cause: two consecutive // causes in project pro file SOURCES += configuration.
qmake syntax to add a source file or a configuration ends with a slash, if two slashes appear in a row, then there is an empty input, but qmake does not avoid the empty file input, causing GCC to pass to the empty file compilation business.

Error: unrecognized command line option “-std=c++11”, to solve the problem that ubuntu does not support c++11

The cause of this compilation error is not high enough in the g++ GCC version.
Add the source

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test

$ sudo apt-get update

Install version 4.8

$ sudo apt-get install gcc-4.8 g++-4.8

View the local installation version

$ ls -lh /usr/bin/g++*

You should see that 4.6 and 4.8 are shipped.
Switch version

$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6

$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8

$ sudo update-alternatives --config gcc

here select version 4.8 serial number
Check the g++ version again

$ g++ --version

Confirm that the current version is 4.8, the problem has been solved!
From: http://my.oschina.net/chenyoca/blog/226455