idea配置mybits generate时报错,请问是哪配错了吗?

报错说找不到driver-class-name核对了很多次都没问题啊

报错:

D:\jdk1.8.0_121\bin\java.exe -Dmaven.multiModuleProjectDirectory=D:\mycode\demo_mybits\demo "-Dmaven.home=D:\software\idea\IntelliJ IDEA 2018.2.6\plugins\maven\lib\maven3" "-Dclassworlds.conf=D:\software\idea\IntelliJ IDEA 2018.2.6\plugins\maven\lib\maven3\bin\m2.conf" "-javaagent:D:\software\idea\IntelliJ IDEA 2018.2.6\lib\idea_rt.jar=7115:D:\software\idea\IntelliJ IDEA 2018.2.6\bin" -Dfile.encoding=UTF-8 -classpath "D:\software\idea\IntelliJ IDEA 2018.2.6\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2018.2.6 mybatis-generator:generate -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- mybatis-generator-maven-plugin:1.3.2:generate (default-cli) @ demo ---
[INFO] Connecting to the Database
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.637 s
[INFO] Finished at: 2019-11-11T09:52:35+08:00
[INFO] Final Memory: 14M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project demo: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Exception getting JDBC Driver: {spring.datasource.driver-class-name} -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project demo: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Exception getting JDBC Driver
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Exception getting JDBC Driver
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    ... 21 more
Caused by: java.lang.RuntimeException: Exception getting JDBC Driver
    at org.mybatis.generator.internal.db.ConnectionFactory.getDriver(ConnectionFactory.java:85)
    at org.mybatis.generator.internal.db.ConnectionFactory.getConnection(ConnectionFactory.java:54)
    at org.mybatis.generator.config.Context.getConnection(Context.java:526)
    at org.mybatis.generator.config.Context.introspectTables(Context.java:436)
    at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:222)
    at org.mybatis.generator.maven.MyBatisGeneratorMojo.execute(MyBatisGeneratorMojo.java:203)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    ... 22 more
Caused by: java.lang.ClassNotFoundException: {spring.datasource.driver-class-name}
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at org.mybatis.generator.internal.ObjectFactory.internalClassForName(ObjectFactory.java:150)
    at org.mybatis.generator.internal.ObjectFactory.externalClassForName(ObjectFactory.java:121)
    at org.mybatis.generator.internal.db.ConnectionFactory.getDriver(ConnectionFactory.java:82)
    ... 28 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Process finished with exit code 1

application.properties

## 服务器端口,如果不配置默认是8080端口
server.port=9090 

## 数据库设置
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/boot_demo?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=x5

## mybatis配置
# 参数类型的包别名设置
mybatis.typeAliasesPackage=com.example.demo.model
# 指向映射xml文件目录
mybatis.mapperLocations=classpath:mapper/*.xml

pagehelper.helperDialect=mysql
pagehelper.reasonable=true
pagehelper.supportMethodsArguments=true
pagehelper.params=count=countSql

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.0.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>demo</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper-spring-boot-starter</artifactId>
            <version>1.2.10</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.mybatis.generator</groupId>
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>1.3.7</version>
                <configuration>
                    <verbose>true</verbose>
                    <overwrite>true</overwrite>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>8.0.18</version>
                        <scope>runtime</scope>
                    </dependency>
                </dependencies>
            </plugin>

        </plugins>
    </build>

</project>

generatorConfig.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">

<generatorConfiguration>
    <!--导入配置文件-->
    <properties resource="application.properties"></properties>

    <!-- 一个数据库一个context -->
    <context id="default">

        <!-- 注释生成设置 -->
        <commentGenerator>
            <!-- 是否生成注释代时间戳-->
            <property name="suppressDate" value="true" />
            <!-- 是否取消注释 -->
            <property name="suppressAllComments" value="true" />
        </commentGenerator>

        <!--jdbc的数据库连接-->
        <jdbcConnection driverClass="{spring.datasource.driver-class-name}" connectionURL="{spring.datasource.url}" userId="{spring.datasource.username}" password="{spring.datasource.password}">
            <property name="nullCatalogMeansCurrent" value="true" />
        </jdbcConnection>

        <!-- 类型转换 -->
        <javaTypeResolver>
            <!-- 是否使用bigDecimal, false可自动转化以下类型(Long, Integer, Short, etc.) -->
            <property name="forceBigDecimals" value="false" />
        </javaTypeResolver>

        <!-- targetPackage:生成的实体类所在的包 -->
        <!-- targetProject:生成的实体类所在的硬盘位置 -->
        <javaModelGenerator targetPackage="com.example.demo.model" targetProject="src/main/java">
            <!-- 是否允许子包 -->
            <property name="enableSubPackages" value="false" />
            <!-- 是否对modal添加构造函数 -->
            <property name="constructorBased" value="true" />
            <!-- 是否清理从数据库中查询出的字符串左右两边的空白字符 -->
            <property name="trimStrings" value="true" />
            <!-- 建立modal对象是否不可改变 即生成的modal对象不会有setter方法,只有构造方法 -->
            <property name="immutable" value="false" />
        </javaModelGenerator>

        <!-- targetPackage 和 targetProject:生成的  mapper xml 文件的包和位置 -->
        <sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources">
            <!-- 是否在当前路径下新加一层schema,ex:false路径com.qikegu.demo.model, com.qikegu.demo.model.[schemaName] -->
            <property name="enableSubPackages" value="false" />
            <!-- 是否针对string类型的字段在set的时候进行trim调用 -->
            <property name="trimStrings" value="true"/>
        </sqlMapGenerator>

        <!-- targetPackage 和  targetProject:生成的  java interface 文件的包和位置 -->
        <javaClientGenerator type="XMLMAPPER" targetPackage="com.example.demo.repository" targetProject="src/main/java">
            <!-- 是否在当前路径下新加一层schema,ex:false路径com.qikegu.demo.model, com.qikegu.demo.model.[schemaName] -->
            <property name="enableSubPackages" value="false" />
        </javaClientGenerator>

        <!-- 配置表信息 -->
        <!-- schema即为数据库名 tableName为对应的数据库表 domainObjectName是要生成的实体类 enable*ByExample, 是否生成 example类   -->
        <!-- 不同的表,修改tableName和domainObjectName就可以 -->
        <table tableName="user" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false">
        </table>
    </context>
</generatorConfiguration>

m0_37247078
m0_37247078 已经解决配置文件引入忘记加$号了<!--jdbc的数据库连接--> <jdbcConnection driverClass="${spring.datasource.driver-class-name}" connectionURL="${spring.datasource.url}" userId="${spring.datasource.username}" password="${spring.datasource.password}"> <property name="nullCatalogMeansCurrent" value="true" /> </jdbcConnection>
3 个月之前 回复

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
关于从游戏官方获取数据时出现报错现象,请求解读代码(新手求助)
我在向官方摘取数据时出现问题 2错误代码如下 File "gun.py", line 130, in <module> telemetry = api.telemetry(Match_Telemetry_URL) File "C:\ProgramData\Anaconda3\lib\site-packages\pubg_python\base.py", line 92, in telemetry return Telemetry(data, url) File "C:\ProgramData\Anaconda3\lib\site-packages\pubg_python\domain\telemetry\base.py", line 13, in __init__ for event_data in self.generate_events_data(data) File "C:\ProgramData\Anaconda3\lib\site-packages\pubg_python\domain\telemetry\base.py", line 13, in <listcomp> for event_data in self.generate_events_data(data) File "C:\ProgramData\Anaconda3\lib\site-packages\pubg_python\domain\telemetry\events.py", line 17, in instance return globals()[data['_T']](data) KeyError: 'LogBlackZoneEnded' 3,最重要的是我想知道KeyError:LogBlackZoneEnded是那种错误?
Find Black Hand 的问题
Problem Description I like playing game with my friends, although sometimes look pretty naive. Today I invent a new game called find black hand. The game is not about catching bad people but playing on a string. Now I generate a string S and several short ones s[i], and I define three kinds of operations. 1. Delete: remove the ith character. 2. Insert: in any position, insert a character if you like. 3. Change: change the ith character into another character if you like. For each short string s[i], we define a function f(i). After several operations on S, we can find a substring of S which is the same to s[i]. And f(i) is the minimal number of operations to achieve. It looks so native that I think every one of you can solve f(i) perfectly. So I join the string S from end to end, and f(i) changes nothing. So the string "bb" is also a substring of string "baaab". The "black hand" is the short string s[i] whose f(i) is minimal. Now it's your time to find the black hand. Input There are multiple test cases. The first line contains a non-empty string S whose length is not more than 100,000. The next line contains an integer N (1 <= N <= 10) indicating the number of the short string. Each of the next N lines contains a short non-empty string whose length is not more than 10. All strings in the input would not have blank and all characters are lower case. Output For each test case, output a string first indicating the "black hand", and then output an integer indicating the minimal number of the operation. If there are more than one "black hand", please output the smallest one in lexicographical order. Sample Input aaabbbb 2 alice bob Sample Output bob 1
OpenGL ES3.0纹理贴图问题,贴图发生错误,无法显示贴图细节是怎么回事啊?
最近在学习OpenGL ES,按照书上教程尝试写了个demo,然后发现在纹理贴图这块遇到问题了,求助各位大佬 程序思路很简单,画5个点然后贴上纹理,但是纹理总是出现错误,下面是截图: ![图片说明](https://img-ask.csdn.net/upload/202002/12/1581502455_517510.jpg) 这个是要贴的纹理,大小为512 \*1024,另外正方形纹理我也试过同样不行 ![图片说明](https://img-ask.csdn.net/upload/202002/12/1581502536_603856.png) 接下来是代码: 首先是Render: ```java package com.example.firstopengl; import android.content.Context; import android.opengl.GLES30; import android.opengl.GLSurfaceView; import android.opengl.Matrix; import com.airhockey.android.objects.Mallet; import com.airhockey.android.objects.Table; import com.airhockey.android.programs.ColorShaderProgram; import com.airhockey.android.programs.TextureShaderProgram; import com.airhockey.android.util.MatrixHelper; import com.airhockey.android.util.TextureHelper; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; public class AirHockeyRender implements GLSurfaceView.Renderer { private final String TAG = "AirHockeyRender"; private final Context context; private final float[] projectionMatrix = new float[16]; private final float[] modelMatrix = new float[16]; private Table table; private Mallet mallet; private TextureShaderProgram textureShaderProgram; private ColorShaderProgram colorShaderProgram; private int texture; public AirHockeyRender(Context context){ this.context = context; } @Override public void onSurfaceCreated(GL10 gl, EGLConfig config) { GLES30.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); table = new Table(); mallet = new Mallet(); textureShaderProgram = new TextureShaderProgram(context); colorShaderProgram = new ColorShaderProgram(context); texture = TextureHelper.loadTexture(context, R.drawable.air_hockey_surface); } @Override public void onDrawFrame(GL10 gl) { GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT); textureShaderProgram.useProgram(); textureShaderProgram.setUniforms(projectionMatrix, texture); table.bindData(textureShaderProgram); table.draw(); colorShaderProgram.useProgram(); colorShaderProgram.setUniform(projectionMatrix); mallet.bindData(colorShaderProgram); mallet.draw(); } @Override public void onSurfaceChanged(GL10 gl, int width, int height) { final float[] temp = new float[16]; //设置视口 GLES30.glViewport(0, 0, width, height); MatrixHelper.perspectiveM(projectionMatrix, 45, (float)width/(float)height, 1f, 10f); Matrix.setIdentityM(modelMatrix, 0); Matrix.translateM(modelMatrix, 0, 0f, 0f, -3.1f); Matrix.rotateM(modelMatrix, 0, -60f, 1f, 0f, 0f); Matrix.multiplyMM(temp, 0 ,projectionMatrix, 0, modelMatrix, 0); System.arraycopy(temp, 0, projectionMatrix, 0, temp.length); } } ``` 接下来是纹理生成相关 ``` package com.airhockey.android.util; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.opengl.GLES30; import android.opengl.GLUtils; import android.util.Log; import com.airhockey.android.Constants; import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; import java.nio.ByteOrder; public class TextureHelper { private final static String TAG = "TextureHelper"; public static int loadTexture(Context context, int resourceId){ final int[] textureObject = new int[1]; GLES30.glGenTextures(1, textureObject, 0); if(textureObject[0]==0){ if(LoggerConfig.ON){ Log.w(TAG, "Could not generate a new OpenGL texture object"); } return 0; } final BitmapFactory.Options options = new BitmapFactory.Options(); //需要原始的图像数据,而不是缩放的版本 options.inScaled = false; //将图像转换为位图 final Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), resourceId, options); if(bitmap==null){ if(LoggerConfig.ON){ Log.w(TAG, "Resource ID"+resourceId+"could not be decoded"); } GLES30.glDeleteTextures(1, textureObject, 0); return 0; } //告诉opengl纹理调用使用此纹理 GLES30.glBindTexture(GLES30.GL_TEXTURE_2D, textureObject[0]); GLES30.glTexParameteri(GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_MIN_FILTER, GLES30.GL_LINEAR_MIPMAP_LINEAR); GLES30.glTexParameteri(GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_MAG_FILTER, GLES30.GL_LINEAR); GLES30.glTexParameterf(GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_S, GLES30.GL_REPEAT); GLES30.glTexParameterf(GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_T, GLES30.GL_REPEAT); //将位图加载至opengl中 GLUtils.texImage2D(GLES30.GL_TEXTURE_2D, 0, bitmap, 0); //加载后释放位图,解除绑定 bitmap.recycle(); //生成mip贴图 GLES30.glGenerateMipmap(GLES30.GL_TEXTURE_2D); GLES30.glBindTexture(GLES30.GL_TEXTURE_2D, 0); return textureObject[0]; } } ``` 然后是画的物体: ``` package com.airhockey.android.objects; import android.opengl.GLES30; import com.airhockey.android.Constants; import com.airhockey.android.data.VertexArray; import com.airhockey.android.programs.TextureShaderProgram; public class Table { private static final int POSITION_COMPONENT_COUNT = 2; private static final int TEXTURE_COORDINATES_COMPONENT_COUNT = 2; private static final int STRIDE = (POSITION_COMPONENT_COUNT+TEXTURE_COORDINATES_COMPONENT_COUNT) * Constants.BYTE_PER_FLOAT; private final VertexArray vertexArray; private static final float[] VERTEX_DATA = { //x,y,s,t //三角扇区 0f, 0f, 0.5f, 0.5f, -0.5f, -0.8f, 0.0f, 1.0f, 0.5f, -0.8f, 1.0f, 1.0f, 0.5f, 0.8f, 1.0f, 0.0f, -0.5f, 0.8f, 0.0f, 0.0f, -0.5f, -0.8f, 0.0f, 1.0f // -0.5f, -0.8f, 0f, 1f, // -0.5f, 0.8f, 0f, 0f, // 0.5f, -0.8f, 1f, 1f, // // -0.5f, 0.8f, 0f, 0f, // 0.5f, -0.8f, 1f, 1f, // 0.5f, 0.8f, 1f, 0f }; public Table(){ vertexArray = new VertexArray(VERTEX_DATA); } public void bindData(TextureShaderProgram textureProgram){ vertexArray.setVertexAttribPointer(0, textureProgram.getPositonAttributeLocation(), POSITION_COMPONENT_COUNT, STRIDE); vertexArray.setVertexAttribPointer(POSITION_COMPONENT_COUNT, textureProgram.getTextureCoordinatesAttributeLocation(), TEXTURE_COORDINATES_COMPONENT_COUNT, STRIDE); } public void draw(){ GLES30.glDrawArrays(GLES30.GL_TRIANGLE_FAN, 0, 6); } } ``` 头真的大,研究了好久都没研究出来怎么回事
Estimation 估算的问题
Problem Description “There are too many numbers here!” your boss bellows. “How am I supposed to make sense of all of this? Pare it down! Estimate!” You are disappointed. It took a lot of work to generate those numbers. But, you’ll do what your boss asks. You decide to estimate in the following way: You have an array A of numbers. You will partition it into k contiguous sections, which won’t necessarily be of the same size. Then, you’ll use a single number to estimate an entire section. In other words, for your array A of size n, you want to create another array B of size n, which has k contiguous sections. If i and j are in the same section, then B[i]=B[j]. You want to minimize the error, expressed as the sum of the absolute values of the differences (Σ|A[i]-B[i]|). Input There will be several test cases in the input. Each test case will begin with two integers on a line, n (1≤n≤2,000) and k (1≤k≤25, k≤n), where n is the size of the array, and k is the number of contiguous sections to use in estimation. The array A will be on the next n lines, one integer per line. Each integer element of A will be in the range from -10,000 to 10,000, inclusive. The input will end with a line with two 0s. Output For each test case, output a single integer on its own line, which is the minimum error you can achieve. Output no extra spaces, and do not separate answers with blank lines. All possible inputs yield answers which will fit in a signed 64-bit integer. Sample Input 7 2 6 5 4 3 2 1 7 0 0 Sample Output 9
IDEA中使用MyBatis generator插件配置generator.xml读取不到配置文件
环境: IDEA 2019 JDK1.8 mybatis-generator-maven-plugin为1.3.2 1.在maven中我已经引入了mybatis-generator-maven-plugin,如图:![版本为1.3.2](https://img-ask.csdn.net/upload/201912/02/1575280384_969030.png) 2.然后开始配置generator.xml文件,此次项目中的所有配置文件都放在resources下,如图: ![图片说明](https://img-ask.csdn.net/upload/201912/02/1575280526_10720.png) 3.报错信息为:Cannot resolve file 'datasource.properties' 4.运行mybatis-generator:generator控制台报错信息如下: [ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project mmall: Access denied for user 'root'@'127.0.0.1' (using password: YES) -> [Help 1] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Grade School Multiplication 乘法的问题
Problem Description An educational software company, All Computer Math (ACM), has a section on multiplication of integers. They want to display the calculations in the traditional grade school format, like the following computation of 432 × 5678: 432 5678 ------- 3456 3024 2592 2160 ------- 2452896 Note well that the final product is printed without any leading spaces, but that leading spaces are necessary on some of the other lines to maintain proper alignment. However, as per our regional rules, there should never be any lines with trailing white space. Note that the lines of dashes have length matching the final product. As a special case, when one of the digits of the second operand is a zero, it generates a single 0 in the partial answers, and the next partial result should be on the same line rather than the next line down. For example, consider the following product of 200001 × 90040: 200001 90040 ----------- 8000040 180000900 ----------- 18008090040 The rightmost digit of the second operand is a 0, causing a 0 to be placed in the rightmost column of the first partial product. However, rather than continue to a new line, the partial product of 4 × 200001 is placed on the same line as that 0. The third and fourth least-significant digits of the second operand are zeros, each resulting in a 0 in the second partial product on the same line as the result of 9 × 200001. As a final special case, if there is only one line in the partial answer, it constitutes a full answer, and so there is no need for computing a sum. For example, a computation of 246 × 70 would be formatted as 246 70 ----- 17220 Your job is to generate the solution displays. Input The input contains one or more data sets. Each data set consists of two positive integers on a line, designating the operands in the desired order. Neither number will have more than 6 digits, and neither will have leading zeros. After the last data set is a line containing only 0 0. Output For each data set, output a label line containing "Problem " with the number of the problem, followed by the complete multiplication problem in accordance with the format rules described above. Sample Input 432 5678 200001 90040 246 70 0 0 Sample Output Problem 1 432 5678 ------- 3456 3024 2592 2160 ------- 2452896 Problem 2 200001 90040 ----------- 8000040 180000900 ----------- 18008090040 Problem 3 246 70 ----- 17220
Essay Scoring System 不太会实现了
Problem Description Professor Binns has finally got tired of scoring essays himself and implemented an automatic essay scoring system to help him screen the numerous essays. Strongly against such an idea, you decided to generate a meaningless essay which can get high mark in his system to prove that his system does not work at all. You've obtained the rules used by Binns's system to score the essay, they're as follows: a) The word in the essay must be from a particular set of words. If not, the essay will receive a score zero and is automatically rejected. b) Every word in the specified set has a positive integer associated with it, indicating the score the submitter will get for using that word once. c) A word can be used in several different ways; for example, in English, the word “word” can be used as both a noun and a verb. Every occurrence of specific patterns (like verb – adjective – noun) will earn the submitter a particular score. In particular, it is allowed for a word to be interpreted in different ways in different patterns. You're interested in generating an essay of a specified length with maximum possible score. Input There are multiple test cases in the input file. Each test case starts with three integers N, M and K, (1 <= N <= 100, 0 <= M <= 8, 0 <= K <= 6), the length of the essay to generate, the number of words in the dictionary and the number of patterns, respectively. The following M lines describe the words in the dictionary; each line consists of two integers, Wi, and Ti, (0 <= Wi <= 2000, 1 <= Ti <= 5), representing the score submitter gets every time he/she uses the word, and the number of ways the word can be used. The next part of the input describes the patterns. Each of the K lines describes one pattern, beginning with two integers, Wi, and Ci, (0 <= Wi <= 2000, 1 <= Ci <= 6), indicating the score one can get every time the pattern is used, and the number of consecutive parts in the pattern; followed by Ci integers describing the language parts in the pattern. It is guaranteed that the total number of ways to use a word does not exceed 5; furthermore, the total number of parts contained in all patterns (sum of all Cis) will not exceed 25. There is a blank line after each test case. Input ends with End-of-File. Output For every test case, you should output one integer on a separate line, the maximum score one can get, in the format as indicated in the sample output. Sample Input 2 3 2 4 3 0 1 2 5 2 2 3 1 2 0 4 1 2 1 3 10 2 4 2 2 3 2 4 3 0 1 2 5 2 2 3 1 2 0 4 1 2 1 3 2 2 4 2 Sample Output Case 1: 16 Case 2: 10
The Two Note Rag 标签的问题
Problem Description Since most computers are binary machines, both powers of two and problems that involve only two values are important to computer scientists. The following problem has to do with powers of two and the digits 1 and 2. Some powers of two as decimal values, such as 29 = 512 and 289 = 618,970,019,642,690,137,449,562,112 end in a string of digits consisting only of 1's and 2's (12 for 29 and 2112 for 289 ). In fact, it can be proved that: For every integer R, there exists a power of 2 such that 2K uses only the digits 1 and 2 in its last R digits. This is shown a bit more clearly in the following table: Your job is to write a program that will determine, for given R, the smallest K such that 2K ends in a string of R digits containing only 1's and 2's. Input The first line of the input contains a single decimal integer, N, 1 ≤ N ≤ 50, the number of problem data sets to follow. Each data set consists of a single integer R, 1 ≤ R ≤ 20, for which we want a power of 2 ending in a string of R 1's and 2's. Output For each data set, you should generate one line of output with the following values: The data set number as a decimal integer (start counting at one), a space, the input value R, another space, and the smallest value K for which 2K ends in a string of R 1's and 2's. Sample Input 6 1 2 4 5 7 15 Sample Output 1 1 1 2 2 9 3 4 89 4 5 589 5 7 3089 6 15 11687815589
Consecutive Digits 连续的数字
Problem Description As a recruiting ploy, Google once posted billboards in Harvard Square and in the Silicon Valley area just stating “{first 10-digit prime found in consecutive digits of e}.com”. In other words, find that 10-digit sequence and then connect to the web site— and find out that Google is trying to hire people who can solve a particular kind of problem. Not to be outdone, Gaggle (a loosy-goosy fuzzy logic search firm), has devised its own recruiting problem. Consider the base 7 expansion of a rational number. For example, the first few digits of the base 7 expansion of 1/510 = 0.12541...7,33/410 = 11.15151...7, and 6/4910 = 0.06000...7, From this expansion, find the digits in a particular range of positions to the right of the "decimal" point. Input The input file begins with a line containing a single integer specifying the number of problem sets in the file. Each problem set is specified by four base 10 numbers on a single line, n d b e, where n and d are the numerator and denominator of the rational number and 0 ≤ n ≤ 5,000 and 1 ≤ d ≤ 5,000. b and e are the beginning and ending positions for the desired range of digits, with 0 ≤ b,e ≤ 250 and 0 ≤ (e-b) ≤ 20. Note that 0 is the position immediately to the right of the decimal point. Output Each problem set will be numbered (beginning at one) and will generate a single line: Problem k: n / d, base 7 digits b through e: result where k is replaced by the problem set number, result is your computed result, and the other values are the corresponding input values. Sample Input 4 1 5 0 0 6 49 1 3 33 4 2 7 511 977 122 126 Sample Output Problem set 1: 1 / 5, base 7 digits 0 through 0: 1 Problem set 2: 6 / 49, base 7 digits 1 through 3: 600 Problem set 3: 33 / 4, base 7 digits 2 through 7: 151515 Problem set 4: 511 / 977, base 7 digits 122 through 126: 12425
IDEA利用JPA生成model报错cannot generate mapping XML
cannot generate mapping XML 以前没报错啊 现在咋报错了 ![图片说明](https://img-ask.csdn.net/upload/201810/30/1540868030_860578.jpg)
Elasticsearch nested 嵌套分词查询返回结果不准确
通过ES分词搜索文档的标题和内容,标题和内容这两个字段是分词的text字段。 因为一个文档时多语言的,所以mapping设置是嵌套的,但是搜索出来的结果并不是我期望的。 ```json { "mappings": { "properties": { "title": { // 标题字段 "type": "nested", "properties": { "lang": { // 语种字段,"zh/en/ja..." "type": "keyword" }, "value": { // 标题对应的值 "type": "text", "search_analyzer": "ik_max_word", "analyzer": "ik_max_word", "fields": { "keyword": { "ignore_above": 256, "type": "keyword" } } } } }, "content": { // 正文内容 "type": "nested", "properties": { "lang": { "type": "keyword" }, "value": { "type": "text", "search_analyzer": "ik_max_word", "analyzer": "ik_max_word", "fields": { "keyword": { "ignore_above": 256, "type": "keyword" } } } } }, "baseCode": { //属于某个知识库下 "type": "keyword" }, "knowledgeId": { // 唯一ID "type": "long" }, "order": { // 序号 "type": "integer" }, "publish": { // 发布状态 "type": "integer" }, "status": { // 逻辑删除,0删除1存在 "type": "integer" } } } } ``` 这个是查询条件: ```json { "query": { "bool": { "must": [{ "bool": { "should": [{ "nested": { "query": { "bool": { "must": [{ "term": { "title.lang": { "value": "zh", "boost": 1 } } }, { "match": { "title.value": { "query": "测试", "operator": "OR", "prefix_length": 0, "max_expansions": 50, "fuzzy_transpositions": true, "lenient": false, "zero_terms_query": "NONE", "auto_generate_synonyms_phrase_query": true, "boost": 1.5 } } } ], "adjust_pure_negative": true, "boost": 1.5 } }, "path": "title", "ignore_unmapped": false, "score_mode": "avg", "boost": 2 } }, { "nested": { "query": { "bool": { "must": [{ "term": { "content.lang": { "value": "zh", "boost": 1 } } }, { "match": { "content.value": { "query": "测试", "operator": "OR", "prefix_length": 0, "max_expansions": 50, "fuzzy_transpositions": true, "lenient": false, "zero_terms_query": "NONE", "auto_generate_synonyms_phrase_query": true, "boost": 1 } } } ], "adjust_pure_negative": true, "boost": 1 } }, "path": "content", "ignore_unmapped": false, "score_mode": "avg", "boost": 1 } } ], "adjust_pure_negative": true, "boost": 2 } }, { "term": { "status": { "value": 1, "boost": 1 } } }, { "term": { "categoryType": { "value": 0, "boost": 1 } } }, { "term": { "baseCode": { "value": "B8rqalut2bajk", "boost": 1 } } }, { "term": { "publish": { "value": 1, "boost": 1 } } }, { "term": { "isOpen": { "value": 1, "boost": 1 } } } ], "adjust_pure_negative": true, "boost": 1 } } } ``` 期望结果是标题是“测试标题并有多个测试词语”的数据在第一个,因为标题和内容都匹配到了,并且次数最多。但是第一条返回的并不是这条。 ![图片说明](https://img-ask.csdn.net/upload/202001/31/1580472299_2137.png) 但实际返回的第一条数据是这个: ![图片说明](https://img-ask.csdn.net/upload/202001/31/1580472386_601750.png) 怎么样才能返回第一条是我想要的数据呢?
springboot 多模块打包war,tomcat启动提示找不到配置文件
新项目使用springboot maven module方式新建了多个子模块,(多个)web,service,dao,entity,util、storage。其中web依赖entity、service、util、storage。 uitl模块中有个ConfigUtil.java @Component @ConfigurationProperties @PropertySource(value = "classpath:config.properties",encoding = "utf-8") public class ConfigUtil { ...... } 其中config.properties文件放在util模块的resources文件夹下。 在将其中一个web项目打包成war时,在tomcat中启动时提示找不到config.properties ![图片说明](https://img-ask.csdn.net/upload/202001/20/1579522003_255875.png) 下面是uitl模块的pom文件 ``` <?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.zjyc.dsy</groupId> <artifactId>dsy-al</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <groupId>com.zjyc.dsy.util</groupId> <artifactId>dsy-util</artifactId> <name>dsy-util</name> <packaging>jar</packaging> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>artemis</groupId> <artifactId>artemis-lib</artifactId> <version>1.0</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/resources/jar/artemis-http-client-1.0-SNAPSHOT.jar</systemPath> </dependency> </dependencies> <build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> </includes> <!-- resource的filtering属性用来表示资源文件中的占位符是否需要被替换,true为需要替换。 --> <filtering>false</filtering> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*</include> </includes> <filtering>false</filtering> </resource> </resources> </build> </project> ``` 下面是web模块的pom ``` <?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <packaging>war</packaging> <parent> <groupId>com.zjyc.dsy</groupId> <artifactId>dsy-al</artifactId> <version>0.0.1-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>com.zjyc.dsy.web</groupId> <artifactId>dsy-web</artifactId> <name>dsy-web</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>com.zjyc.dsy.entity</groupId> <artifactId>dsy-entity</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>com.zjyc.dsy.service</groupId> <artifactId>dsy-service</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>com.zjyc.dsy.util</groupId> <artifactId>dsy-util</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>com.zjyc.dsy.storage</groupId> <artifactId>dsy-storage</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>4.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <!-- 引入java编译器插件 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> <compilerVersion>1.8</compilerVersion> <encoding>UTF-8</encoding> </configuration> </plugin> <!-- 资源文件拷贝插件 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>unpack</id> <phase>generate-resources</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>com.zjyc.dsy.util</groupId> <artifactId>dsy-util</artifactId> <version>0.0.1-SNAPSHOT</version> <type>jar</type> <overWrite>true</overWrite> <outputDirectory>${project.build.directory}/classes</outputDirectory> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> </plugins> <pluginManagement> <plugins> <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId> org.apache.maven.plugins </groupId> <artifactId> maven-dependency-plugin </artifactId> <versionRange> [2.1,) </versionRange> <goals> <goal>unpack</goal> </goals> </pluginExecutionFilter> <action> <ignore></ignore> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> </plugins> </pluginManagement> <resources> <resource> <directory>${project.basedir}/src/main/resources</directory> <excludes> <exclude>**/*.properties</exclude> </excludes> </resource> </resources> </build> </project> ``` 下面是war解压之后classes的目录结构 ![图片说明](https://img-ask.csdn.net/upload/202001/20/1579522257_42080.png) tomcat启动报错代码 ``` 20-Jan-2020 19:55:46.409 警告 [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxSpareThreads' to '500' did not find a matching property. 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.6 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Mar 5 2018 09:34:35 UTC 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.6.0 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows Server 2008 R2 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 6.1 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_161\jre 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_161-b12 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: E:\apache-tomcat-9 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: E:\apache-tomcat-9 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=E:\apache-tomcat-9\conf\logging.properties 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs= 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=E:\apache-tomcat-9 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=E:\apache-tomcat-9 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=E:\apache-tomcat-9\temp 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.6.3]. 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 20-Jan-2020 19:55:47.440 信息 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.0.2m 2 Nov 2017] 20-Jan-2020 19:55:47.565 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-80"] 20-Jan-2020 19:55:47.612 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 20-Jan-2020 19:55:47.628 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-7778"] 20-Jan-2020 19:55:47.628 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 20-Jan-2020 19:55:47.628 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1553 ms 20-Jan-2020 19:55:47.659 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina] 20-Jan-2020 19:55:47.659 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.6 20-Jan-2020 19:55:47.675 信息 [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [E:\apache-tomcat-9\webapps\dsy-web-0.0.1-SNAPSHOT.war] 20-Jan-2020 19:55:50.815 信息 [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 20-Jan-2020 19:55:52.456 严重 [main] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/dsy-web-0.0.1-SNAPSHOT]] at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:742) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1586) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:966) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:682) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.zjyc.dsy.web.App]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/config.properties] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:184) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:325) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:242) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:152) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:132) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:92) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5030) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ... 38 more Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/config.properties] at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:159) at org.springframework.core.io.support.EncodedResource.getReader(EncodedResource.java:143) at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:95) at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:73) at org.springframework.core.io.support.PropertiesLoaderUtils.loadProperties(PropertiesLoaderUtils.java:59) at org.springframework.core.io.support.ResourcePropertySource.<init>(ResourcePropertySource.java:67) at org.springframework.core.io.support.DefaultPropertySourceFactory.createPropertySource(DefaultPropertySourceFactory.java:37) at org.springframework.context.annotation.ConfigurationClassParser.processPropertySource(ConfigurationClassParser.java:455) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:274) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:194) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:298) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:202) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:170) ... 54 more 20-Jan-2020 19:55:52.471 严重 [main] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [E:\apache-tomcat-9\webapps\dsy-web-0.0.1-SNAPSHOT.war] java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/dsy-web-0.0.1-SNAPSHOT]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:746) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1586) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:966) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:682) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493) 20-Jan-2020 19:55:52.487 信息 [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [E:\apache-tomcat-9\webapps\dsy-web-0.0.1-SNAPSHOT.war] has finished in [4,812] ms 20-Jan-2020 19:55:52.487 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-80"] 20-Jan-2020 19:55:52.503 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-7778"] 20-Jan-2020 19:55:52.518 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 4881 ms ```
IDEA 生成get set方法失效,快捷键和右键中的generate都不起作用
IDEA 生成get set方法失效,快捷键和右键中的generate都不起作用, IDEA版本是2016.3
Against Mammoths 正确算法
Problem Description Back to year 3024, humans finally developed a new technology that enables them to conquer the alien races. The new technology made it possible to produce huge spaceships known as Saber Tooth spaceships as powerful as the aliens' defending mammoths. At that time, humans ruled several planets while some others were under control of the aliens. Using Saber Tooth ships, humans finally defeated aliens and this became the first Planet War in history. Our goal is to run a simulation of the ancient war to verify some historical hypotheses. Producing each spaceship takes an amount of time which is constant for each planet but may vary among different planets. We call the number of spaceships each planet can produce in a year, the production rate of that planet. Note that each planet has a number of spaceships in it initially (before the simulation starts). The planets start producing ships when the simulation starts, so if a planet has nships initially, and has the production rate p, it will have n + p ships at the beginning of year 1, and n + i × p ships at the beginning of year i (years are started from zero). Bradley Bennett, the commander in chief of the human armies, decided a strategy for the war. For each alien planet A, he chooses a corresponding human planet P, and produces spaceships in P until a certain moment at which he sends all spaceships in P to invade the planet A. No alien planet is invaded by two human planets and no human planet sends its spaceships to two different alien planets. The defense power of the alien planets comes from their powerful mammoths. Each alien planet contains a number of mammoths initially and produces a number of mammoths each year (called the production rate of the planet). When a fight between spaceships and mammoths takes place, the side having the greater number of troops is the winner. If the spaceships win, the alien planet is defeated. In case the number of mammoths and spaceships are equal, the spaceships win. The difficulty with planning this strategy is that it takes some time for the spaceships to reach the alien planets, and during this time, the aliens produce mammoths. The time required for spaceships to travel from each human planet to each alien planet is known. The ships can leave their planets only at the beginning of years (right after the ships are produced) and reach the alien planets at the beginning of years too (right after the mammoths are produced). As an example, consider a human planet with two initial spaceships and production rate three invading an alien planet with two initial mammoths and production rate two. The time required to travel between the two planets is two years and the ships are ordered to leave at year one. In this case, five ships leave the human planet. When they reach the alien planet, they confront eight mammoths and will be defeated during the fight. Bennett decided to prepare a plan that destroys every alien planet in the shortest possible time. Your task is to write a program to generate such a plan. The output is the shortest possible time (in years) in which every alien planet is defeated. Input There are multiple test cases in the input. The first line of each test case contains two numbers H and A which are the number of planets under the control of humans and aliens respectively (both between 1 and 250). The second line of the test case contains H non-negative integers n1 m1 n2 m2 … nH mH. The number ni is the initial number of Saber Tooth spaceships in the ith human planet and mi is the production rate of that planet. The third line contains A non-negative integers which specify the initial number of mammoths and the production rate of the alien planets in the same format as the second line. After the third line, there are H lines each containing A positive integers. The jth number on the ith line shows how many years it takes a spaceship to travel from the ith human planet to the jth alien planet. The last line of the input contains two zero numbers. Every number in the input except H and A is between 0 and 40000. Output The output for each test case contains a single integer which is the minimum time in which all alien planets can be defeated. If it is impossible to destroy all alien planets, the output should be IMPOSSIBLE. Sample Input 2 1 2 3 0 3 2 2 2 2 0 0 Sample Output 6
MyBatis逆向工程提示javax.net.ssl.SSLException是什么问题?
请问MyBatis逆向工程提示javax.net.ssl.SSLException是什么问题?怎么解决? 错误提示: ``` Wed Jan 22 15:08:37 CST 2020 WARN: Caught while disconnecting... EXCEPTION STACK TRACE: ** BEGIN NESTED EXCEPTION ** javax.net.ssl.SSLException MESSAGE: closing inbound before receiving peer's close_notify STACKTRACE: javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:133) at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:264) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:255) at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:645) at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:624) at com.mysql.cj.protocol.a.NativeProtocol.quit(NativeProtocol.java:1284) at com.mysql.cj.NativeSession.quit(NativeSession.java:182) at com.mysql.cj.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:1911) at com.mysql.cj.jdbc.ConnectionImpl.close(ConnectionImpl.java:730) at org.mybatis.generator.config.Context.closeConnection(Context.java:535) at org.mybatis.generator.config.Context.introspectTables(Context.java:468) at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:222) at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:133) at GeneratorSqlmap.generator(GeneratorSqlmap.java:27) at GeneratorSqlmap.main(GeneratorSqlmap.java:33) ** END NESTED EXCEPTION ** WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.mybatis.generator.internal.DomWriter (file:/F:/SSM%e9%a1%b9%e7%9b%ae%e5%ae%9e%e6%88%98/%e7%ac%ac%e4%b8%80%e4%bb%b6%20maven%e7%ae%a1%e7%90%86%e7%9a%84ssm%e6%a1%86%e6%9e%b6(%e8%af%a6%e8%a7%a3)/e3%e5%95%86%e5%9f%8e_day01/%e9%bb%91%e9%a9%ac32%e6%9c%9f/01.%e6%95%99%e6%a1%88-3.0/01.%e5%8f%82%e8%80%83%e8%b5%84%e6%96%99/mybatis/%e9%80%86%e5%90%91%e5%b7%a5%e7%a8%8b/generatorSqlmapCustom/lib/mybatis-generator-core-1.3.2.jar) to method com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.getXmlVersion() WARNING: Please consider reporting this to the maintainers of org.mybatis.generator.internal.DomWriter WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release ``` 工程结构: ![图片说明](https://img-ask.csdn.net/upload/202001/22/1579677296_992794.png) GeneratorSqlmap类 ``` public class GeneratorSqlmap { public void generator() throws Exception{ List<String> warnings = new ArrayList<String>(); boolean overwrite = true; File configFile = new File("generatorConfig.xml"); ConfigurationParser cp = new ConfigurationParser(warnings); Configuration config = cp.parseConfiguration(configFile); DefaultShellCallback callback = new DefaultShellCallback(overwrite); MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings); myBatisGenerator.generate(null); } public static void main(String[] args) throws Exception { try { GeneratorSqlmap generatorSqlmap = new GeneratorSqlmap(); generatorSqlmap.generator(); } catch (Exception e) { e.printStackTrace(); } } } ``` generatorConfig.xml ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> <generatorConfiguration> <context id="testTables" targetRuntime="MyBatis3"> <commentGenerator> <!-- 是否去除自动生成的注释 true:是 : false:否 --> <property name="suppressAllComments" value="true" /> </commentGenerator> <!--数据库连接的信息:驱动类、连接地址、用户名、密码 --> <jdbcConnection driverClass="com.mysql.cj.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/e3mall?serverTimezone=UTC" userId="root" password="root"> </jdbcConnection> <!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和 NUMERIC 类型解析为java.math.BigDecimal --> <javaTypeResolver> <property name="forceBigDecimals" value="false" /> </javaTypeResolver> <!-- targetProject:生成PO类的位置 --> <javaModelGenerator targetPackage="cn.e3mall.pojo" targetProject=".\src"> <!-- enableSubPackages:是否让schema作为包的后缀 --> <property name="enableSubPackages" value="false" /> <!-- 从数据库返回的值被清理前后的空格 --> <property name="trimStrings" value="true" /> </javaModelGenerator> <!-- targetProject:mapper映射文件生成的位置 --> <sqlMapGenerator targetPackage="cn.e3mall.mapper" targetProject=".\src"> <!-- enableSubPackages:是否让schema作为包的后缀 --> <property name="enableSubPackages" value="false" /> </sqlMapGenerator> <!-- targetPackage:mapper接口生成的位置 --> <javaClientGenerator type="XMLMAPPER" targetPackage="cn.e3mall.mapper" targetProject=".\src"> <!-- enableSubPackages:是否让schema作为包的后缀 --> <property name="enableSubPackages" value="false" /> </javaClientGenerator> <!-- 指定数据库表 --> <table schema="" tableName="tb_content"></table> <table schema="" tableName="tb_content_category"></table> <table schema="" tableName="tb_item"></table> <table schema="" tableName="tb_item_cat"></table> <table schema="" tableName="tb_item_desc"></table> <table schema="" tableName="tb_item_param"></table> <table schema="" tableName="tb_item_param_item"></table> <table schema="" tableName="tb_order"></table> <table schema="" tableName="tb_order_item"></table> <table schema="" tableName="tb_order_shipping"></table> <table schema="" tableName="tb_user"></table> </context> </generatorConfiguration> ```
Tensorflow测试训练styleGAN时报错 No OpKernel was registered to support Op 'NcclAllReduce' with these attrs.
在测试官方StyleGAN。 运行官方与训练模型pretrained_example.py generate_figures.py 没有问题。GPU工作正常。 运行train.py时报错 尝试只用单个GPU训练时没有报错。 NcclAllReduce应该跟多GPU通信有关,不太了解。 InvalidArgumentError (see above for traceback): No OpKernel was registered to support Op 'NcclAllReduce' with these attrs. Registered devices: [CPU,GPU], Registered kernels: <no registered kernels> [[Node: TrainD/SumAcrossGPUs/NcclAllReduce = NcclAllReduce[T=DT_FLOAT, num_devices=2, reduction="sum", shared_name="c112", _device="/device:GPU:0"](GPU0/TrainD_grad/gradients/AddN_160)]] 经过多番google 尝试过 重启 conda install keras-gpu 重新安装tensorflow-gpu==1.10.0(跟官方版本保持一致) ``` …… Building TensorFlow graph... Setting up snapshot image grid... Setting up run dir... Training... Traceback (most recent call last): File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\client\session.py", line 1278, in _do_call return fn(*args) File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\client\session.py", line 1263, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\client\session.py", line 1350, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op 'NcclAllReduce' with these attrs. Registered devices: [CPU,GPU], Registered kernels: <no registered kernels> [[Node: TrainD/SumAcrossGPUs/NcclAllReduce = NcclAllReduce[T=DT_FLOAT, num_devices=2, reduction="sum", shared_name="c112", _device="/device:GPU:0"](GPU0/TrainD_grad/gradients/AddN_160)]] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "train.py", line 191, in <module> main() File "train.py", line 186, in main dnnlib.submit_run(**kwargs) File "E:\MachineLearning\stylegan-master\dnnlib\submission\submit.py", line 290, in submit_run run_wrapper(submit_config) File "E:\MachineLearning\stylegan-master\dnnlib\submission\submit.py", line 242, in run_wrapper util.call_func_by_name(func_name=submit_config.run_func_name, submit_config=submit_config, **submit_config.run_func_kwargs) File "E:\MachineLearning\stylegan-master\dnnlib\util.py", line 257, in call_func_by_name return func_obj(*args, **kwargs) File "E:\MachineLearning\stylegan-master\training\training_loop.py", line 230, in training_loop tflib.run([D_train_op, Gs_update_op], {lod_in: sched.lod, lrate_in: sched.D_lrate, minibatch_in: sched.minibatch}) File "E:\MachineLearning\stylegan-master\dnnlib\tflib\tfutil.py", line 26, in run return tf.get_default_session().run(*args, **kwargs) File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\client\session.py", line 877, in run run_metadata_ptr) File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\client\session.py", line 1100, in _run feed_dict_tensor, options, run_metadata) File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\client\session.py", line 1272, in _do_run run_metadata) File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\client\session.py", line 1291, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op 'NcclAllReduce' with these attrs. Registered devices: [CPU,GPU], Registered kernels: <no registered kernels> [[Node: TrainD/SumAcrossGPUs/NcclAllReduce = NcclAllReduce[T=DT_FLOAT, num_devices=2, reduction="sum", shared_name="c112", _device="/device:GPU:0"](GPU0/TrainD_grad/gradients/AddN_160)]] Caused by op 'TrainD/SumAcrossGPUs/NcclAllReduce', defined at: File "train.py", line 191, in <module> main() File "train.py", line 186, in main dnnlib.submit_run(**kwargs) File "E:\MachineLearning\stylegan-master\dnnlib\submission\submit.py", line 290, in submit_run run_wrapper(submit_config) File "E:\MachineLearning\stylegan-master\dnnlib\submission\submit.py", line 242, in run_wrapper util.call_func_by_name(func_name=submit_config.run_func_name, submit_config=submit_config, **submit_config.run_func_kwargs) File "E:\MachineLearning\stylegan-master\dnnlib\util.py", line 257, in call_func_by_name return func_obj(*args, **kwargs) File "E:\MachineLearning\stylegan-master\training\training_loop.py", line 185, in training_loop D_train_op = D_opt.apply_updates() File "E:\MachineLearning\stylegan-master\dnnlib\tflib\optimizer.py", line 135, in apply_updates g = nccl_ops.all_sum(g) File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\contrib\nccl\python\ops\nccl_ops.py", line 49, in all_sum return _apply_all_reduce('sum', tensors) File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\contrib\nccl\python\ops\nccl_ops.py", line 230, in _apply_all_reduce shared_name=shared_name)) File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\contrib\nccl\ops\gen_nccl_ops.py", line 59, in nccl_all_reduce num_devices=num_devices, shared_name=shared_name, name=name) File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\util\deprecation.py", line 454, in new_func return func(*args, **kwargs) File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\framework\ops.py", line 3156, in create_op op_def=op_def) File "d:\Users\admin\Anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\framework\ops.py", line 1718, in __init__ self._traceback = tf_stack.extract_stack() InvalidArgumentError (see above for traceback): No OpKernel was registered to support Op 'NcclAllReduce' with these attrs. Registered devices: [CPU,GPU], Registered kernels: <no registered kernels> [[Node: TrainD/SumAcrossGPUs/NcclAllReduce = NcclAllReduce[T=DT_FLOAT, num_devices=2, reduction="sum", shared_name="c112", _device="/device:GPU:0"](GPU0/TrainD_grad/gradients/AddN_160)]] ``` ``` #conda list: # Name Version Build Channel _tflow_select 2.1.0 gpu absl-py 0.8.1 pypi_0 pypi alabaster 0.7.12 py36_0 asn1crypto 1.2.0 py36_0 astor 0.8.0 pypi_0 pypi astroid 2.3.2 py36_0 attrs 19.3.0 py_0 babel 2.7.0 py_0 backcall 0.1.0 py36_0 blas 1.0 mkl bleach 3.1.0 py36_0 ca-certificates 2019.10.16 0 certifi 2019.9.11 py36_0 cffi 1.13.1 py36h7a1dbc1_0 chardet 3.0.4 py36_1003 cloudpickle 1.2.2 py_0 colorama 0.4.1 py36_0 cryptography 2.8 py36h7a1dbc1_0 cudatoolkit 9.0 1 cudnn 7.6.4 cuda9.0_0 decorator 4.4.1 py_0 defusedxml 0.6.0 py_0 django 2.2.7 pypi_0 pypi docutils 0.15.2 py36_0 entrypoints 0.3 py36_0 gast 0.3.2 py_0 grpcio 1.25.0 pypi_0 pypi h5py 2.9.0 py36h5e291fa_0 hdf5 1.10.4 h7ebc959_0 icc_rt 2019.0.0 h0cc432a_1 icu 58.2 ha66f8fd_1 idna 2.8 pypi_0 pypi image 1.5.27 pypi_0 pypi imagesize 1.1.0 py36_0 importlib_metadata 0.23 py36_0 intel-openmp 2019.4 245 ipykernel 5.1.3 py36h39e3cac_0 ipython 7.9.0 py36h39e3cac_0 ipython_genutils 0.2.0 py36h3c5d0ee_0 isort 4.3.21 py36_0 jedi 0.15.1 py36_0 jinja2 2.10.3 py_0 jpeg 9b hb83a4c4_2 jsonschema 3.1.1 py36_0 jupyter_client 5.3.4 py36_0 jupyter_core 4.6.1 py36_0 keras-applications 1.0.8 py_0 keras-base 2.2.4 py36_0 keras-gpu 2.2.4 0 keras-preprocessing 1.1.0 py_1 keyring 18.0.0 py36_0 lazy-object-proxy 1.4.3 py36he774522_0 libpng 1.6.37 h2a8f88b_0 libprotobuf 3.9.2 h7bd577a_0 libsodium 1.0.16 h9d3ae62_0 markdown 3.1.1 py36_0 markupsafe 1.1.1 py36he774522_0 mccabe 0.6.1 py36_1 mistune 0.8.4 py36he774522_0 mkl 2019.4 245 mkl-service 2.3.0 py36hb782905_0 mkl_fft 1.0.15 py36h14836fe_0 mkl_random 1.1.0 py36h675688f_0 more-itertools 7.2.0 py36_0 nbconvert 5.6.1 py36_0 nbformat 4.4.0 py36h3a5bc1b_0 numpy 1.17.3 py36h4ceb530_0 numpy-base 1.17.3 py36hc3f5095_0 numpydoc 0.9.1 py_0 openssl 1.1.1d he774522_3 packaging 19.2 py_0 pandoc 2.2.3.2 0 pandocfilters 1.4.2 py36_1 parso 0.5.1 py_0 pickleshare 0.7.5 py36_0 pillow 6.2.1 pypi_0 pypi pip 19.3.1 py36_0 prompt_toolkit 2.0.10 py_0 protobuf 3.10.0 pypi_0 pypi psutil 5.6.3 py36he774522_0 pycodestyle 2.5.0 py36_0 pycparser 2.19 py36_0 pyflakes 2.1.1 py36_0 pygments 2.4.2 py_0 pylint 2.4.3 py36_0 pyopenssl 19.0.0 py36_0 pyparsing 2.4.2 py_0 pyqt 5.9.2 py36h6538335_2 pyreadline 2.1 py36_1 pyrsistent 0.15.4 py36he774522_0 pysocks 1.7.1 py36_0 python 3.6.9 h5500b2f_0 python-dateutil 2.8.1 py_0 pytz 2019.3 py_0 pywin32 223 py36hfa6e2cd_1 pyyaml 5.1.2 py36he774522_0 pyzmq 18.1.0 py36ha925a31_0 qt 5.9.7 vc14h73c81de_0 qtawesome 0.6.0 py_0 qtconsole 4.5.5 py_0 qtpy 1.9.0 py_0 requests 2.22.0 py36_0 rope 0.14.0 py_0 scipy 1.3.1 py36h29ff71c_0 setuptools 39.1.0 pypi_0 pypi sip 4.19.8 py36h6538335_0 six 1.13.0 pypi_0 pypi snowballstemmer 2.0.0 py_0 sphinx 2.2.1 py_0 sphinxcontrib-applehelp 1.0.1 py_0 sphinxcontrib-devhelp 1.0.1 py_0 sphinxcontrib-htmlhelp 1.0.2 py_0 sphinxcontrib-jsmath 1.0.1 py_0 sphinxcontrib-qthelp 1.0.2 py_0 sphinxcontrib-serializinghtml 1.1.3 py_0 spyder 3.3.6 py36_0 spyder-kernels 0.5.2 py36_0 sqlite 3.30.1 he774522_0 sqlparse 0.3.0 pypi_0 pypi tensorboard 1.10.0 py36he025d50_0 tensorflow 1.10.0 gpu_py36h3514669_0 tensorflow-base 1.10.0 gpu_py36h6e53903_0 tensorflow-gpu 1.10.0 pypi_0 pypi termcolor 1.1.0 pypi_0 pypi testpath 0.4.2 py36_0 tornado 6.0.3 py36he774522_0 traitlets 4.3.3 py36_0 typed-ast 1.4.0 py36he774522_0 urllib3 1.25.6 pypi_0 pypi vc 14.1 h0510ff6_4 vs2015_runtime 14.16.27012 hf0eaf9b_0 wcwidth 0.1.7 py36h3d5aa90_0 webencodings 0.5.1 py36_1 werkzeug 0.16.0 py_0 wheel 0.33.6 py36_0 win_inet_pton 1.1.0 py36_0 wincertstore 0.2 py36h7fe50ca_0 wrapt 1.11.2 py36he774522_0 yaml 0.1.7 hc54c509_2 zeromq 4.3.1 h33f27b4_3 zipp 0.6.0 py_0 zlib 1.2.11 h62dcd97_3 ``` 2*RTX2080Ti driver 4.19.67
Random Walking 程序思路
Problem Description The Army of Coin-tossing Monkeys (ACM) is in the business of producing randomness. Good random numbers are important for many applications, such as cryptography, online gambling, randomized algorithms and panic attempts at solutions in the last few seconds of programming competitions. Recently, one of the best monkeys has had to retire. However, before he left, he invented a new, cheaper way to generate randomness compared to directly using the randomness generated by coin-tossing monkeys. The method starts by taking an undirected graph with 2n nodes labelled 0, 1, …, 2n - 1. To generate k random n-bit numbers, they will let the monkeys toss n coins to decide where on the graph to start. This node number is the first number output. The monkeys will then pick a random edge from this node, and jump to the node that this edge connects to. This new node will be the second random number output. They will then select a random edge from this node (possibly back to the node they arrived from in the last step), follow it and output the number of the node they landed on. This walk will continue until k numbers have been output. During experiments, the ACM has noticed that different graphs give different output distributions, some of them not very random. So, they have asked for your help testing the graphs to see if the randomness is of good enough quality to sell. They consider a graph good if, for each of the n bits in each of the k numbers generated, the probability that this bit is output as 1 is greater than 25% and smaller than 75%. Input The input will consist of several data sets. Each set will start with a line consisting of three numbers k, n, e separated by single spaces, where k is the number of n-bit numbers to be generated and e is the number of edges in the graph (1 ≤ k ≤ 100, 1 ≤ n ≤ 10 and 1 ≤ e ≤ 2000). The next e lines will consist of two space-separated integers v1, v2 where 0 ≤ v1, v2 < 2n and v1 ≠ v2. Edges are undirected and each node is guaranteed to have at least one edge. There may be multiple edges between the same pair of nodes. The last test case will be followed by a line with k = n = e = 0, which should not be processed. Output For each input case, output a single line consisting of the word Yes if the graph is good, and No otherwise. Sample Input 10 2 3 0 3 1 3 2 3 5 2 4 0 1 0 3 1 2 2 3 0 0 0 Sample Output No Yes
Sequence Folding 顺序的序列问题
Problem Description Alice and Bob are practicing hard for the new ICPC season. They hold many private contests where only the two of them compete against each other. They almost have identical knowledge and skills, the matter which results many times in ties in both the number of problems solved and in time penalty! To break the tie, Alice and Bob invented a tie breaker technique called sequence folding! The following are the steps of this technique: 1- Generate a random integer N >= 2. 2- Generate a sequence of N random integers. 3- If N = 2 go to step 6. 4- Fold the sequence by adding the Nth element to the first, the N-1th element to the second and so on, if N is odd then the middle element is added to itself, figure 1 illustrates the folding process. 5- Set N = ceil (N/2) and go to step 3. 6- The sequence now contains two numbers, if the first is greater than the second then Alice wins, otherwise Bob wins. Figure 1.a Before Folding Figure 1.b After one step of folding Figure 1.c After two steps of folding, Alice wins! In this problem you’re given the sequence of N integers and are asked determine the contest winner using the sequence folding tie breaker technique. Input The first line contains T (1 <= T <= 100), the number of test cases. The first line of each test case contains an integer (2 <= N <= 100), the number of elements of the sequence. The next line contains N space separated integers. The sum of any subset of the numbers fit in a 32 bit signed integer. Output For each test case print the name of the winner. Follow the output format below. Sample Input 2 5 2 5 10 3 -4 3 5 4 -3 Sample Output Case #1: Alice Case #2: Bob
Generator 生成器的问题
Problem Description We can generate a random string by generating a sequence of random characters and concatenating them together. Each character is chosen independently from the first n letters in the English alphabet with equal probability. Only capital letters are used in this problem. The generation is stopped as soon as one of specific patterns occurs in the random string. Your task is to predict the expected length of the generated string. Input Standard input will contain multiple test cases. First line is the number of case x. Each test case consists of integer N (1<=N<=8) which is the number of letters used, and M (1<=M<=10) which is the number of patterns used. The following M lines contain the patterns which are non-empty strings consisting of letters chosen from the first N upper case English letters. The length of any pattern will not exceed 10. Output For each test case, print the expected length of the generated random string. All output numbers are rounded to the second digit after the decimal point. Sample Input 4 2 1 A 2 1 ABA 3 1 AAAAA 2 2 A AA Sample Output 2.00 10.00 363.00 2.00
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
win10系统安装教程(U盘PE+UEFI安装)
一、准备工作 u盘,电脑一台,win10原版镜像(msdn官网) 二、下载wepe工具箱  极力推荐微pe(微pe官方下载) 下载64位的win10 pe,使用工具箱制作启动U盘打开软件,   选择安装到U盘(按照操作无需更改) 三、重启进入pe系统   1、关机后,将U盘插入电脑 2、按下电源后,按住F12进入启动项选择(技嘉主板是F12)     选择需要启
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小人工智障。 思路可以运用在不同地方,主要介绍的是思路。
Nginx 软件层面加强Nginx性能优化的面试问答和解决方案
Nginx 软件层面加强Nginx性能优化的面试问答和解决方案 去年我去爱卡汽车面试PHP,一轮和二轮面的都不错,在三轮面到Nginx的时候很多问题当时不知道怎么回答,确实没有深入学习过,花了一段时间的学习,终于能解答Nginx高性能优化的问题了,10月24号为了获得程序员勋章,发布了半个优化笔记,浏览到了1000+,受到这个鼓舞,我抽时间在仔细整理下关于Nginx性能优化的问题,我们从软件说起。...
【管理系统课程设计】美少女手把手教你后台管理
【文章后台管理系统】URL设计与建模分析+项目源码+运行界面 栏目管理、文章列表、用户管理、角色管理、权限管理模块(文章最后附有源码) 1. 这是一个什么系统? 1.1 学习后台管理系统的原因 随着时代的变迁,现如今各大云服务平台横空出世,市面上有许多如学生信息系统、图书阅读系统、停车场管理系统等的管理系统,而本人家里就有人在用烟草销售系统,直接在网上完成挑选、购买与提交收货点,方便又快捷。 试想,若没有烟草销售系统,本人家人想要购买烟草,还要独自前往药...
11月19日科技资讯|华为明日发布鸿蒙整体战略;京东宣告全面向技术转型;Kotlin 1.3.60 发布
「极客头条」—— 技术人员的新闻圈! CSDN 的读者朋友们早上好哇,「极客头条」来啦,快来看今天都有哪些值得我们技术人关注的重要新闻吧。扫描上方二维码进入 CSDN App 可以收听御姐萌妹 Style 的人工版音频哟。 一分钟速览新闻点! 6G 专家组成员:速率是 5G 的 10 至 100 倍,预计 2030 年商用 雷军:很多人多次劝我放弃WPS,能坚持下来并不是纯粹的商业决定 ...
C语言魔塔游戏
很早就很想写这个,今天终于写完了。 游戏截图: 编译环境: VS2017 游戏需要一些图片,如果有想要的或者对游戏有什么看法的可以加我的QQ 2985486630 讨论,如果暂时没有回应,可以在博客下方留言,到时候我会看到。 下面我来介绍一下游戏的主要功能和实现方式 首先是玩家的定义,使用结构体,这个名字是可以自己改变的 struct gamerole { char n
化繁为简 - 腾讯计费高一致TDXA的实践之路
导语:腾讯计费是孵化于支撑腾讯内部业务千亿级营收的互联网计费平台,在如此庞大的业务体量下,腾讯计费要支撑业务的快速增长,同时还要保证每笔交易不错账。采用最终一致性或离线补...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
Java学习笔记(七十二)—— Cookie
概述 会话技术: 会话:一次会话中包含多次请求和响应 一次会话:浏览器第一次给服务器发送资源请求,会话建立,直到有一方断开为止 功能:在一次会话的范围内的多次请求间,共享数据 方式: 客户端会话技术:Cookie,把数据存储到客户端 服务器端会话技术:Session,把数据存储到服务器端 Cookie 概念:客户端会话技术,将数据存储到客户端 快速入门: 使用步骤: 创建C
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆  每天早上8:30推送 作者| Mr.K   编辑| Emma 来源| 技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯
程序员该看的几部电影
##1、骇客帝国(1999) 概念:在线/离线,递归,循环,矩阵等 剧情简介: 不久的将来,网络黑客尼奥对这个看似正常的现实世界产生了怀疑。 他结识了黑客崔妮蒂,并见到了黑客组织的首领墨菲斯。 墨菲斯告诉他,现实世界其实是由一个名叫“母体”的计算机人工智能系统控制,人们就像他们饲养的动物,没有自由和思想,而尼奥就是能够拯救人类的救世主。 可是,救赎之路从来都不会一帆风顺,到底哪里才是真实的世界?
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
@程序员,如何花式构建线程?
作者 |曾建责编 | 郭芮出品 | CSDN(ID:CSDNnews)在项目和业务的开发中,我们难免要经常使用线程来进行业务处理,使用线程可以保证我们的业务在相互处理之间可以保证原子性...
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布了 2019年国民经济报告 ,报告中指出:年末中国大陆总人口(包括31个
强烈推荐10本程序员在家读的书
很遗憾,这个鼠年春节注定是刻骨铭心的,新型冠状病毒让每个人的神经都是紧绷的。那些处在武汉的白衣天使们,尤其值得我们的尊敬。而我们这些窝在家里的程序员,能不外出就不外出,就是对社会做出的最大的贡献。 有些读者私下问我,窝了几天,有点颓丧,能否推荐几本书在家里看看。我花了一天的时间,挑选了 10 本我最喜欢的书,你可以挑选感兴趣的来读一读。读书不仅可以平复恐惧的压力,还可以对未来充满希望,毕竟苦难终
Linux自学篇——linux命令英文全称及解释
man: Manual 意思是手册,可以用这个命令查询其他命令的用法。 pwd:Print working directory 显示当前目录 su:Swith user 切换用户,切换到root用户 cd:Change directory 切换目录 ls:List files 列出目录下的文件 ps:Process Status 进程状态 mk
Python实战:抓肺炎疫情实时数据,画2019-nCoV疫情地图
文章目录1. 前言2. 数据下载3. 数据处理4. 数据可视化 1. 前言 今天,群里白垩老师问如何用python画武汉肺炎疫情地图。白垩老师是研究海洋生态与地球生物的学者,国家重点实验室成员,于不惑之年学习python,实为我等学习楷模。先前我并没有关注武汉肺炎的具体数据,也没有画过类似的数据分布图。于是就拿了两个小时,专门研究了一下,遂成此文。 2月6日追记:本文发布后,腾讯的数据源多次变更u
智力题(程序员面试经典)
NO.1  有20瓶药丸,其中19瓶装有1克/粒的药丸,余下一瓶装有1.1克/粒的药丸。给你一台称重精准的天平,怎么找出比较重的那瓶药丸?天平只能用一次。 解法 有时候,严格的限制条件有可能反倒是解题的线索。在这个问题中,限制条件是天平只能用一次。 因为天平只能用一次,我们也得以知道一个有趣的事实:一次必须同时称很多药丸,其实更准确地说,是必须从19瓶拿出药丸进行称重。否则,如果跳过两瓶或更多瓶药
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
2020年的1月,我辞掉了我的第一份工作
其实,这篇文章,我应该早点写的,毕竟现在已经2月份了。不过一些其它原因,或者是我的惰性、还有一些迷茫的念头,让自己迟迟没有试着写一点东西,记录下,或者说是总结下自己前3年的工作上的经历、学习的过程。 我自己知道的,在写自己的博客方面,我的文笔很一般,非技术类的文章不想去写;另外我又是一个还比较热衷于技术的人,而平常复杂一点的东西,如果想写文章写的清楚点,是需要足够...
别低估自己的直觉,也别高估自己的智商
所有群全部吵翻天,朋友圈全部沦陷,公众号疯狂转发。这两周没怎么发原创,只发新闻,可能有人注意到了。我不是懒,是文章写了却没发,因为大家的关注力始终在这次的疫情上面,发了也没人看。当然,我...
Java坑人面试题系列: 包装类(中级难度)
Java Magazine上面有一个专门坑人的面试题系列: https://blogs.oracle.com/javamagazine/quiz-2。 这些问题的设计宗旨,主要是测试面试者对Java语言的了解程度,而不是为了用弯弯绕绕的手段把面试者搞蒙。 如果你看过往期的问题,就会发现每一个都不简单。 这些试题模拟了认证考试中的一些难题。 而 “中级(intermediate)” 和 “高级(ad
Spring Boot 2.x基础教程:使用JdbcTemplate访问MySQL数据库
在第2章节中,我们介绍了如何通过Spring Boot来实现HTTP接口,以及围绕HTTP接口相关的单元测试、文档生成等实用技能。但是,这些内容还不足以帮助我们构建一个动态应用的服务端程序。不论我们是要做App、小程序、还是传统的Web站点,对于用户的信息、相关业务的内容,通常都需要对其进行存储,而不是像第2章节中那样,把用户信息存储在内存中(重启就丢了!)。 对于信息的存储,现在已经有非常非常多...
基于Python的人脸自动戴口罩系统
目录 1、项目背景 2、页面设计 3、器官识别 4、退出系统 1、项目背景 2019年新型冠状病毒感染的肺炎疫情发生以来,牵动人心,举国哀痛,口罩、酒精、消毒液奇货可居。 抢不到口罩,怎么办?作为技术人今天分享如何使用Python实现自动戴口罩系统,来安慰自己,系统效果如下所示: 本系统的实现原理是借助 Dlib模块的Landmark人脸68个关键点检测库轻松识别出人脸五官
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。 再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。 下文是原回答,希望能对你能有所启发。 如果我说,这个世界上人真的分三六九等,...
相关热词 c# 识别回车 c#生成条形码ean13 c#子控制器调用父控制器 c# 写大文件 c# 浏览pdf c#获取桌面图标的句柄 c# list反射 c# 句柄 进程 c# 倒计时 线程 c# 窗体背景色
立即提问

相似问题

1
配置完liberty却无法正常运行,报错FrameworkEvent ERROR Bundle是什么意思?
0
训练模型前运行train.py报错?
2
使用Mybatis的代码生成器报错java.sql.SQLException: Column 'IS_GENERATEDCOLUMN' not found.
1
python 明明下载了scipy库,但运行显示不能import imread
0
wepy init standard 提示错误
1
EXTJS 使用cordova打包报错问题
2
淘淘商城在构建mybatis逆向工程报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException
1
运行结果如下:train(generator,discriminator,gan_model,latent_dim) NameError: name 'train' is not defined,请问如何解决
1
Springboot启动报错 一个是找不到url 一个是找不到dao
1
用完cmake后原本可以运行的opengl程序报错“(ig9icd32.dll)处引发的异常: 0xC0000005: 读取位置 0x00000000 时发生访问冲突。”
1
fastboot线刷过程中执行命令:fastboot -w,返回……CreateProcess failed: 绯荤粺鎵句笉鍒版寚瀹氱殑鏂囦欢銆?(2) fastboot: error: Cannot generate image for userdata……
0
python使用wordcloud为什么生成的图片颜色这么浅
1
QCC3034如何更改自带系统语音包?
2
PHP大神请进,解答一下我项目中的报错!!!!
1
mybatis-genertor无法实例化自定义插件
2
idea创建Maven项目没有src目录 Run有错误
1
DataNode未报错直接关闭
0
运行高翔博客例程报错——段错误(核心已存储)
1
flask+mysql实现的web应用,在注册页面点击注册后提示 Instance '<User at 0x5486a10>' has been deleted?
1
Tensorflow测试训练styleGAN时报错 No OpKernel was registered to support Op 'NcclAllReduce' with these attrs.