当前位置:首页 > 第4页

[eclipse]“Syntax error, insert "}" to complete”报错的解决方案

2023年07月30日 11:05:11服务端
[eclipse]“Syntax error, insert
背景:本人在网上学习java时,看到一段样例代码比较好,因此复制粘贴到eclipse中看看编译结果。结果eclipse报“Syntax error, insert "}" to complete”错误。如下图所示: 经过查找,代码中没有缺少“}”号,也没有语法错误。再经常反复查找问题,终于发现导致报...

maven的安装与配置使用

2023年07月30日 10:44:52服务端
maven的安装与配置使用
一 maven的安装 1 在镜像(https://mirrors.tuna.tsinghua.edu.cn/apache/)中下载指定的版本(注意,Maven 版本与IDE版本应保持匹配)。 2 解压之后需要进行配置 系统变量:M2_HOME:Maven安装路径 JAVA_HOME: JDK安装路径...

shell script中的syntax error near unexpected token `then' 问题

2023年07月30日 10:34:22服务端
shell script中的syntax error near unexpected token `then' 问题
其实这是一个shell下判断符号 [ ] 加空格的问题,一定要小心 编写《鸟哥》给的示例程序时,运行时出现:syntax error near unexpected token `then' [root@localhost scripts]# vi sh06-02.sh [root@localhos...

IDEA不能将java以外的文件 编译到class目录中

2023年07月30日 10:24:54服务端
IDEA不能将java以外的文件 编译到class目录中
问题场景: 根据相对路径找一个文件File,报错:“File” not found 解决方法: 1、build工程后,查看target -˃ class目录中,是否有自己需要的文件 2、如果没有,就修改pom.xml文件 src/main/java ˂...

Substring用法详解

2023年07月30日 10:09:37服务端
public String substring(int beginIndex) 返回一个新的字符串,它是该字符创的一个子集。该子集字符串从指定索引处的字符开始,直到此字符串末尾 例如:"happy".substring(2) returns "ppy" 参数:beginIndex-起始索引(包括)...

设计模式:Singleton模式

2023年07月30日 10:07:24服务端
以下内容摘自http://www.uml.org.cn/sjms/sjms112401.htm,呵呵... 以后做参考。 GOF著作中对Singleton模式的描述为:保证一个class只有一个实体(Instance),并为它提供一个全局访问点(global access point)。 从其描述来...

YoloV5_RuntimeError: CUDA out of memory. Tried to allocate 100.00 MiB (GPU 0; 2.00 GiB total capacity; 1.15 GiB already allocated; 0 bytes free; 1.19 GiB reserved in total by PyTorch)

2023年07月30日 09:56:17服务端
YoloV5_RuntimeError: CUDA out of memory. Tried to allocate 100.00 MiB (GPU 0; 2.00 GiB total capacity; 1.15 GiB already allocated; 0 bytes free; 1.19 GiB reserved in total by PyTorch)
报错信息: RuntimeError: CUDA out of memory. Tried to allocate 100.00 MiB (GPU 0; 2.00 GiB total capacity; 1.15 GiB already allocated; 0 bytes free; 1.19 G...

java unreachable code不可达代码

2023年07月30日 09:30:24服务端
例子: static int test(int testval) { int target = 1; if (testval ˃ target) System.out.println(1); return -1;(下边是永远不会达到的代码,所以编译器提示错误(unreachable code)) i...

Syntax Error: Error: Cannot find module ‘node-sass‘

2023年07月30日 09:21:59服务端
Syntax Error: Error: Cannot find module ‘node-sass‘
出现问题原因: vscode运行前端项目输入npm run dev命令触发此错误 解决办法: 指定淘宝镜像安装node-sass win+r 打开cmd控制台输入 npm install -g cnpm --registry=https://registry.npm.taobao.org 安装成功后...

dotnet C# 在 finally 抛异常会发生什么

2023年07月30日 09:21:13服务端
dotnet C# 在 finally 抛异常会发生什么
如果我在一个方法的 finally 里面抛出异常,而在 try 里面也抛出,那在上层拿到的是什么 如果我在一个方法的 finally 里面抛出异常,而在 try 里面也抛出,那在上层拿到的是什么 如下面代码 private void F1() {...