小编Jus*_*tin的帖子

使用扫描仪读取utf-8

使用Scanner时遇到UTF-8编码问题.我的数据文件的示例两行:

000001 M?lynas Tadas 63210309683 V 2003/03/17 2016/03/17 
000002 Raudonas Tomas 65505023282 V 2006/01/26 2018/01/26
Run Code Online (Sandbox Code Playgroud)

目前我使用Scanner单独读取文本而不是整行,因为这样更方便,但由于编码,它无法正确读取.我已经阅读了有关使用InputStream等的内容,但我不想处理凌乱的线路斩波.有没有办法使用UTF-8 扫描仪

java encoding utf-8 java.util.scanner

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

PLSQL生成随机整数

在Oracle Sql developer 11g中,如何生成随机整数并将其分配给变量?这是我到目前为止所尝试的:

S_TB := SELECT dbms_random.value(1,10) num FROM dual;
Run Code Online (Sandbox Code Playgroud)

使用此代码我收到错误:

S_TB := SELECT dbms_random.value(1,10) num FROM dual
Error report -
Unknown Command
Run Code Online (Sandbox Code Playgroud)

解决我的问题的正确方法是什么?

sql oracle plsql oracle11g oracle-sqldeveloper

5
推荐指数
4
解决办法
5万
查看次数

对象中的C++对象

我正在从OOP角度编写一个用于C++的Arduino程序并遇到一个问题:类的方法无法看到该类的构造函数中定义的对象.我试图完成的是创建一个对象(类),用于容纳各种方法,这些方法用于计算和输出DHT11传感器的数据.完整代码:

* DhtSensor.h
 *
 *  Created on: 2017-04-18
 *      Author: Secret
 */

#ifndef DhtSensor_h
#define DhtSensor_h

class DhtSensor {
public:
    DhtSensor(int dhtPin); //constructor
    void read();
    void printToScreen(); //a method for printing to LCD

private:
    unsigned long previousMillis; //Millis() of last reading
    const long readInterval = 3000; //How often we take readings
    float readingData[2][30]; //store current ant last values of temperature [0] and humidity [1] readings
    int readingIndex;
    bool initDone; //Bool value to check if initialization has been complete …
Run Code Online (Sandbox Code Playgroud)

c++ arduino

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