Tag Archives: ProgrammerAH

Duplicate modifier for the method XXX in type XXX

A very low-level error when writing code. At that time, I didn’t carefully look at the method I wrote. As a result, the constructor wrote more permission modifiers. The record is as follows:

private final ExecutionEnvironment env;
    private final String jobId;
    private final CalJobParam.JdbcParam dataSink;
	
	public public IndicatorParamFunction(ExecutionEnvironment env, String jobId, CalJobParam.JdbcParam dataSink) {
		this.env = env;
		this.jobId = jobId;
		this.dataSink = dataSink;
	}

More public………….. zero

XML tag has empty body less… (Ctrl+F1) Reports empty tag body. The validation works in XML / JSP

The activity of the Android manifest file has been warned several times. The first reaction is that you can’t remember to look it up online. Just wrap it or end it with a ‘/’.

On the Internet:

It appears to have worked by getting rid of the closing tags and replacing them with the self closing tags

<activity
    android:name="com.np.npvideoserver.UserConfig"
    android:configChanges="orientation|keyboard"></activity>

Change to

<activity
    android:name="com.np.npvideoserver.UserConfig"
    android:configChanges="orientation|keyboard">
</activity>

or

<activity
    android:name="com.np.npvideoserver.UserConfig"
    android:configChanges="orientation|keyboard"/>

 

Matlab matrix transpose function

For the known matrix A, matlab provides us with two transpose operations.

A. ‘non conjugate transpose

A ‘conjugate transpose

When a is a real matrix, they are the same

Simply conjugate with: conj ()

Simple transpose: transpose ()

example:

 

  a =

        12.0000                  0 + 2.0000i         5.0000          
        0                             5.0000               4.0000 

>> a’

             ans =

                      12.0000                  0          
                      0 – 2.0000i              5.0000          
                      5.0000                    4.0000         

>> a.’

           ans =

                   12.0000                  0          
                  0 + 2.0000i              5.0000          
                  5.0000                    4.0000

Springboot startup error: java.lang.IllegalArgumentException : Property ‘sqlSessionFactory’ or ‘sqlSessionTempla

Refer to this blog: https://www.cnblogs.com/dbaxyx/p/10663485.html

Error information:

Caused by: java.lang.IllegalArgumentException : Property ‘sqlSessionFactory’ or ‘sqlSessionTemplate’ are required
    at org.springframework.util . Assert.notNull ( Assert.java:198 )
    at org.mybatis.spring . support.SqlSessionDaoSupport.checkDaoConfig ( SqlSessionDaoSupport.java:74 )
    at org.mybatis.spring . mapper.MapperFactoryBean.checkDaoConfig ( MapperFactoryBean.java:90 )
    at org.springframework.dao . support.DaoSupport.afterPropertiesSet ( DaoSupport.java:44 )
    at org.springframework.beans . factory.support.AbstractAutowireCapableBeanFactory .invokeInitMethods(AbstractAutowi reCapableBeanFactory.java:1837 )
    at org.springframework.beans . factory.support.AbstractAutowireCapableBeanFactory .initializeBean(AbstractAutowi reCapableBeanFactory.java:1774 )
    … 56 common frames omitted

This is because there is no package introduced:

<dependency>
    <groupId>org.mybatis.spring.boot</groupId>
    <artifactId>mybatis-spring-boot-starter</artifactId>
    <version>1.3.2</version>
</dependency>

Just import (pay attention to jar package conflicts)

urlopen error unknown url type:httpë/HTTP Error 400:Bad Request

DevTools listening on ws://127.0.0.1:18388/devtools/browser/166d68b9-5bd6-4eaf-9c9c-90b26921a7ae
Traceback (most recent call last):
  File "C:\Users\yanghang\Desktop\comic.py", line 39, in <module>
    urllib.request.urlretrieve(**thisurl2**,filename=localpath)
  File "F:\Python\lib\urllib\request.py", line 248, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "F:\Python\lib\urllib\request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "F:\Python\lib\urllib\request.py", line 526, in open
    response = self._open(req, data)
  File "F:\Python\lib\urllib\request.py", line 549, in _open
    'unknown_open', req)
  File "F:\Python\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "F:\Python\lib\urllib\request.py", line 1388, in unknown_open
    raise URLError('unknown url type: %s' % type)
urllib.error.URLError:  urlopen error unknown url type: "http

To solve this problem, I have tried many methods on the Internet. But I found that there is no error when I change thisurl2 to a certain URL, so the easiest way is to put all the URLs in a list first, and then call it

Python: crawler handles strings of XML and HTML

When crawling a web page, sometimes the data returned by the web page is XML or HTML fragments, which needs to be processed and analyzed by yourself. After searching the processing methods on the Internet, here is a summary.
First, let’s give a simple “Crawler”:

import urllib2
def get_html(url,response_handler):
    response=urllib2.urlopen(url)
    return response_handler(response.read())

#crawl the page
get_html("www.zhihu.com/topics",html_parser)

The above is to get a single page of the “Crawler”, it is indeed very simple, but also describes the core process of crawler: grab the web page and analyze the web page.
The process of crawling web pages is basically solidified, and our focus is on response_ In the handler, this parameter is the method of analyzing web pages. In some popular crawler frameworks, we mainly need to complete the process of analyzing web pages. The example above uses XML_ The parser function, do not think that there is a default implementation (in fact, there is no), let’s complete this function:

#Use lxml library to analyze web pages, the detailed use of this library can be Google
import lxml.etree
def html_parser(response):
    page=lxml.etree.HTML(response)
    #XPATH is used here to fetch the elements, XPATH usage on your own Google
    for elem in page.xpath('//ul[@class="zm-topic-cat-main"]/li'):
        print elem.xpath('a/text()')[0]

We used it lxml.etree.HTML () load the content of the web page. The returned object can use XPath to retrieve the elements of the web page. It seems that it also supports CSS syntax to retrieve elements. For details, please refer to the relevant documents. The above analysis function completes printing the names of all categories.

For the method of parsing XML strings, it is similar to the above, with the following examples:

import lxml.etree
def xml_parser(response):
    page=lxml.etree.fromstring(response)
    #do what you want
    pass

That’s all for now

Where’s Maven pom.xml Configure aliyun warehouse in

<repositories>
        <repository>
            <id>nexus-aliyun</id>
            <name>Nexus aliyun</name>
            <url>https://maven.aliyun.com/repository/public</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>nexus-aliyun</id>
            <name>Nexus aliyun</name>
            <url>https://maven.aliyun.com/repository/public</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>

 

Using CONDA virtual environment in pychar

(1) View the directory of the new virtual environment:>; conda env list
(2) Select File->; setting-> Project:****-> Project Interperter-> Existing Environment imports the environment address
(3) Select the virtual environment created above
D:\installed\Anaconda3
:\installed\Anaconda3\envs\tensorflow\python.exe :\installed\Anaconda3\envs\tensorflow\python.exe :\installed\Anaconda3\envs\tensorflow\python.exe

Activity of Android studio_ main.xml Unable to preview (gray page)

The activity_main.xml in Android Studio cannot be previewed (the gray page only displays the ActionBaroverLayout) and controls cannot be pulled into it. The styles.xml file is in the values file

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
</style>

To change to the preview state, add “base.” before the Theme in the

Solution of off grid pin in Ad

AD software gives a warning of “OFF GRID PIN” in the process of use, which is not caused by the electrical connection problem of the schematic diagram, but the reason that the PIN pin of the component or device is not aligned with the grid. The solution is as follows:
(1) Open AD and click “Project” – “Engineering Parameters”
(2) “Error Reporting” – “Cheesecake Associated with Others” – “Off-grid object” – Right click – “Cheesecake closed”

— — — — — — — — — — — — — — — — — — — — —
the author: Tang Lingyuan
source: CSDN
,
https://blog.csdn.net/u014473675/article/details/80629913 copyright statement: this article original articles for bloggers, reproduced please attach link to blog!