小编Sti*_*ijn的帖子

Apache-POI:“无法解析符号”

我想使用Apache POI在Java中读写Excel文件。我将 Maven 用于依赖项,但是在导入时出现错误:Cannot resolve symbol usermodel例如。

这些是我的进口:

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
Run Code Online (Sandbox Code Playgroud)

这是我的 POM:

<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>groupId</groupId>
<artifactId>Boekhouding</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-3.17</artifactId>
        <version>3.10-FINAL</version>
        <systemPath>${basedir}\src\lib\poi-3.17.jar</systemPath>
    </dependency>


    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>${apache.poi.version}</version>
        <systemPath>${basedir}\src\lib\poi-ooxml-3.17.jar</systemPath>
    </dependency>
</dependencies>
</project>
Run Code Online (Sandbox Code Playgroud)

java excel apache-poi maven

2
推荐指数
1
解决办法
4011
查看次数

卡在无限循环中

我试图用c ++简单地猜测我的数字游戏,但计算机需要猜测我的数字.但问题是我陷入了这种无限循环.我只是一个初学者,所以这是一个非常基本的程序.

这是我的代码:

int secretNumber = rand() %100 + 1; // random number between 1-100
int tries=0;
int input;

cout <<"typ your number\n";
cin >> input;

do
{
    cout <<secretNumber <<endl;
    ++tries;

    if (secretNumber > input)
    {
        cout <<"To high i guess?\n";
    }
    else if (secretNumber < input)
    {
        cout <<"To low I guess?\n";
    }
    else 
    {
        cout <<"Yes, i got it in " <<tries <<" tries!";
    }
}while (input != secretNumber);

return 0;

}
Run Code Online (Sandbox Code Playgroud)

c++ infinite-loop do-while

0
推荐指数
1
解决办法
4495
查看次数

Node.js Express 框架:无法获取 CSS 文件

我想通过 node.js 使用 localhost 访问我的 .html。我为此使用了 express 框架。我的 .html 包含一些 CSS,但这不会加载 html 文件。

代码:

var express = require('express');
var app = express();

app.use(express.static('public'));
app.engine('.html', require('ejs').renderFile);

app.get('/', function(req, res) {
    res.render('FrontPage.html');
});

app.listen(3000, function(){
    console.log("listening to 3000");
})
Run Code Online (Sandbox Code Playgroud)

HTML:

<head>
    <link rel="stylesheet" type="text/css" href="./css/FrontPageCSS.css">
</head>



<body style="background-image:url(./img/bg.jpg)">

<div id="header">
        <a href="./frontPage.html"><img src="./img/Logo.png" height="5%" width="5%" alt="logo"></a>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
        <script src="./script/FrontPageJS.js"></script>
</div>

<div id="buttonWrapper">
    <div id="first" class="first">
        This is my first button
    </div>

    <div id="second" class="second">
        This is my second button
    </div>
</div> …
Run Code Online (Sandbox Code Playgroud)

css node.js express

0
推荐指数
1
解决办法
4578
查看次数

标签 统计

apache-poi ×1

c++ ×1

css ×1

do-while ×1

excel ×1

express ×1

infinite-loop ×1

java ×1

maven ×1

node.js ×1