当前位置: 首页 > news >正文

21天打卡掌握java基础操作

Java安装环境变量配置-day1

参考:
https://www.runoob.com/w3cnote/windows10-java-setup.html
在这里插入图片描述
生成class文件
在这里插入图片描述
在这里插入图片描述

java21天打卡-day2

输入和输出
题目:设计一个程序,输入上次考试成绩(int)和本次考试成绩(int),然后输出成绩提高的百分比,保留两位小数位。
import java.util.Scanner;

public class HelloWorld{
public static void main(String[] args) {
//System.out.println(“HelloWorld”);
Scanner scan = new Scanner(System.in);
System.out.println(“输出上次成绩”);
float s1 = scan.nextFloat();
System.out.println(“输入本次成绩”);
float s2 = scan.nextFloat();

    System.out.println(s1 + " " + s2);float f = (s2 - s1) / s2 * 100;String status = f >= 0 ? "提高" : "降低";System.out.printf("本次成绩与上次成绩相比, %s了 %.2f%%", status, f);
}

}
在这里插入图片描述

Java21天打卡Day5-ifelse

在这里插入图片描述
在这里插入图片描述

import java.util.Scanner;public class Day5 {public static void main(String[] args) {//输入考试成绩,如果成绩大于80,打印“优秀”,如果成绩大于60,打印“及格”,,如果成绩小于60,打印“不及格”Scanner scan = new Scanner(System.in);System.out.println("请输入考试成绩");float a = scan.nextFloat();if (a>=80){System.out.println("优秀");}else if (a>=60){System.out.println("及格");}elseSystem.out.println("不及格");}
}

Java21天打卡Day6-switch

import java.util.Scanner;public class Day6 {//switch case语句//题目:输入一个号码,判断该号码,是1就是一等奖,2是二等奖,3是三等奖,其他的阳光普照奖public static void main(String[] args){Scanner in=new Scanner(System.in);System.out.println("请输入一个号码");int a=in.nextInt();switch (a){case 1:System.out.println("一等奖");break;case 2:System.out.println("二等奖");break;case 3:System.out.println("三等奖");default:System.out.println("阳光普照奖");}}
}

在这里插入图片描述

Java21天打卡Day7-循环

public class Day7 {//循环语句//while//do while//for//题目1:求1-100之和//题目2:嵌套循环:在控制台输出九九乘法表public static void main(String[] args){int sum=0;for(int i=1;i<=100;i++){sum=sum+i;}System.out.println("1-100的和是"+sum);for(int i=1;i<=9;i++){for(int j=1;j<=i;j++){System.out.print(j+"*"+i+"="+j*i+" ");//print可以输出不换行}System.out.println();//i循环结束后换行
//}}}

在这里插入图片描述

Java21天打卡Day8-break

break和continue

break:表示跳出当前层循环
continue:表示跳出本次循环,进入下一次循环

import com.sun.org.apache.xerces.internal.util.SynchronizedSymbolTable;public class Day8 {//21天Java打卡,第1期8天0815////break和continue////break:表示跳出当前层循环//continue:表示跳出本次循环,进入下一次循环//题目1:从1-10之中,当执行第5次时,打印“第五次执行完毕,退出循环”public static void main(String[] args){for(int i=1;i<11;i++){System.out.println(i);if(i==5){System.out.println("第五次执行完毕,退出循环");break;}}}
}

题目2: for (int i = 0; i < 10; i++) {

if (i == 3) {
continue;
}
System.out.println("num is: " + i);
}执行该代码块,打印输出内容是?输出0到9 除了3

在这里插入图片描述

java21天打卡-Day9 字符串

字符串1:
1、定义一个字符串
2、获取字符串的长度
3、字符串的拼接,在定义一个字符串,把两个字符串连起来
4、字符串大小写转换
5、去出字符串的空格

public class Day9 {public static void main(String[] args){
//        字符串1:
//        1、定义一个字符串
//        2、获取字符串的长度
//        3、字符串的拼接,在定义一个字符串,把两个字符串连起来
//        4、字符串大小写转换
//        5、去出字符串的空格 trim()String s="hello world";System.out.println("字符串的长度是"+s.length());String s2=s+"你好";System.out.println("拼接后的字符串是"+s2);System.out.println("字符串转换为大写"+s.toUpperCase());System.out.println("去除空格后的字符串是"+s.trim());}
}

java21天打卡 day10-字符串2

字符串2:
1、截取子字符串
1)取从第三个字符开始到最后
2)取第二到第四个字符
2、分割字符串

public class Day10 {public static void main(String[] args){//字符串2://1、截取子字符串//1)取从第三个字符开始到最后 注意index是2//参考 http://c.biancheng.net/view/830.html//2)取第二到第四个字符//2、分割字符串//参考 http://c.biancheng.net/view/5807.htmlString s="hello world";System.out.println(s.substring(2));System.out.println(s.substring(1,4));String[] a=s.split(" ");//参数为分隔符 这里是按照空格分割for(int i=0;i<a.length;i++){System.out.println(a[i]);}}
}

在这里插入图片描述

Java21天打卡Day11-字符串3

public class Day11 {public static void main(String[] args){//1、字符的替换//2、字符串的查找String s="hello world";System.out.println("l第一次出现的位置是"+s.indexOf("l"));String a=s.replace("l","m");System.out.println("替换后的字符串是"+a);System.out.println("原字符串是"+s);//可见原字符串没变}
}

在这里插入图片描述

Java21天打卡day16-类1

public class Person {String Name;int Age;String Sex;public void setName(String name) {Name = name;}public void setAge(int age) {Age = age;}public void setSex(String sex) {Sex = sex;}public String getName() {return Name;}public int getAge() {return Age;}public String getSex() {return Sex;}public static void main(String[] args) {Person p = new Person();p.setName("zhangsan");p.setAge(20);p.setSex("男");System.out.print(p.getName() +","+ p.getAge()+"," + p.getSex());}}

set和get方法都是类的方法
main方法也在类中。

java21天打卡Day12-IO流

IO流
构造file对象

File f=new File(“…\report.log”);
System.out.println(f.getPath()); //传参的路径 …\report.log
System.out.println(f.getAbsolutePath()); //绝对路径 E:\git\06team…\report.log
System.out.println(f.getCanonicalPath()); //和绝对路径类似,但是是规范路径 E:\git\report.log
创建和删除文件

f.createNewFile()
f.delete();
判断是否有这个文件

System.out.println(f.isFile());
遍历文件和目录

File[] fs1=f.listFiles();  //目录下所有的文件和子目录
if(fs1!=null){for(File f1:fs1){System.out.println(f1);}

题目1:打开本地的一个文件,并把文件内容打印出来
方法一:
try {
BufferedReader in = new BufferedReader(new FileReader(“e://report.log”));
String str;
while ((str = in.readLine()) != null) {
System.out.println(str);
}
System.out.println(str);
} catch (IOException e) {
System.out.println(e);
}
在这里插入图片描述

方法二:
InputStream input=null;
try {
input= new FileInputStream(“e://report.log”);
InputStreamReader reader = new InputStreamReader(input,“utf-8”);
int n;
while ((n = reader.read()) != -1) { // 利用while同时读取并判断
System.out.print((char)n);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} finally {
if (input != null) { input.close(); }

    }

import java.io.*;

public class Day13 {
public static void main(String[] args){
String path=“C:\Users\Administrator\Desktop\helloworld.txt”;
InputStream input=null;
try {
input= new FileInputStream(path);
InputStreamReader reader = new InputStreamReader(input,“utf-8”);
int n;
while ((n = reader.read()) != -1) { // 利用while同时读取并判断
System.out.print((char)n);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (java.io.IOException e2){e2.printStackTrace();
}
// finally {
// if (input != null) { input.close(); }
// }
}
}

题目2:复制一个文件到另一个文件中

 public static void copy(String f1, String f2) throws IOException {File file = new File(f2);if(!file.exists()){file.createNewFile();}InputStream input=new FileInputStream(f1);OutputStream out=new FileOutputStream(f2);int n;while ((n=input.read())!=-1){out.write(n);System.out.println(n);}input.close();out.close();}

在这里插入图片描述
会在给的f2路径生成文件,并复制f1路径文件的内容。

java21天打卡Day13-正则表达式

java21天打卡Day13-正则表达式
20/100
发布文章
seanyang_
未选择文件
在这里插入图片描述
原来正则表达式是这样用的
在这里插入图片描述

在这里插入图片描述
原来正则表达式是这样用的
在这里插入图片描述

java21天打卡-day14 日期时间

import java.util.Calendar;
import java.util.Date;public class Day14 {//数字和日期//Date//题目1:分别打印出当前时间所属的年月日////Calendar类//题目2:计算出当前时间的年月日,时分秒,星期几,本月的第几周,本周的第几天////题目3:计算出5天之后的日期public static void main(String[] args){Date d=new Date();System.out.println(d);System.out.println(d.getYear()+1900); //getYear()返回的年份必须加上1900System.out.println(d.getMonth()+1); //,getMonth()返回的月份是0~11分别表示1~12月,所以要加1System.out.println(d.getDate()); //而getDate()返回的日期范围是1~31,又不能加1。Calendar calendar = Calendar.getInstance(); // 如果不设置时间,则默认为当前时间calendar.setTime(new Date()); // 将系统当前时间赋值给 Calendar 对象System.out.println("现在时刻:" + calendar.getTime()); // 获取当前时间int year = calendar.get(Calendar.YEAR); // 获取当前年份System.out.println("现在是" + year + "年");int month = calendar.get(Calendar.MONTH) + 1; // 获取当前月份(月份从 0 开始,所以加 1)System.out.print(month + "月");int day = calendar.get(Calendar.DATE); // 获取日System.out.print(day + "日");int week = calendar.get(Calendar.DAY_OF_WEEK) - 1; // 获取今天星期几(以星期日为第一天)System.out.print("星期" + week);int hour = calendar.get(Calendar.HOUR_OF_DAY); // 获取当前小时数(24 小时制)System.out.print(hour + "时");int minute = calendar.get(Calendar.MINUTE); // 获取当前分钟System.out.print(minute + "分");int second = calendar.get(Calendar.SECOND); // 获取当前秒数System.out.print(second + "秒");int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH); // 获取今天是本月第几天System.out.println("今天是本月的第 " + dayOfMonth + " 天");int dayOfWeekInMonth = calendar.get(Calendar.DAY_OF_WEEK_IN_MONTH); // 获取今天是本月第几周System.out.println("今天是本月第 " + dayOfWeekInMonth + " 周");Calendar c=Calendar.getInstance();c.add(Calendar.DAY_OF_MONTH,5);}
}

Java21天打卡-Day15 数组

import java.util.Arrays;public class Day15 {//数组//题目1://创建一个长度是8的字符串数组,使用8个长度是5的随机字符串初始化这个数组 对这个数组进行排序,按照每个字符串的首字母排序(无视大小写)//注1: 不能使用Arrays.sort() 要自己写//注2: 无视大小写,即 Axxxx 和 axxxxx 没有先后顺序public static void main(String[] args) {String []str = new String[8];for(int i =0;i<str.length;i++){str[i]= makeStr();}System.out.println("排序前"+ Arrays.toString(str));for (int j = 0; j < str.length; j++) {for (int i = 0; i < str.length - j - 1; i++) {char firstChar1 = str[i].charAt(0);char firstChar2 = str[i + 1].charAt(0);firstChar1 = Character.toLowerCase(firstChar1);firstChar2 = Character.toLowerCase(firstChar2);if (firstChar1 > firstChar2) {String temp = str[i];str[i] = str[i + 1];str[i + 1] = temp;}}}System.out.println("排序后"+Arrays.toString(str));
}public  static String makeStr(){String pool = "";for (short i = '0'; i <= '9'; i++) {pool+=(char)i;}for (short i = 'a'; i <= 'z'; i++) {pool+=(char)i;}for (short i = 'A'; i <= 'Z'; i++) {pool+=(char)i;}char cs2[] = new char[5];for (int i = 0; i < cs2.length; i++) {int index = (int) (Math.random()*pool.length());cs2[i] =  pool.charAt( index );}String result2 = new String(cs2);return result2;}
}

java21天打卡day17-类2

构造方法是定义在java类中的一个用来初始化对象的方法,用new+构造方法,创建一个新的对象,并可以给对象中的实例进行赋值,java默认调用无参数的构造方法

public class Person {//构造方法//1、什么是构造方法(自己描述),java默认调用构造方法么?构造方式是类的一种特殊方法,用来初始化类的一个新的对象,在创建对象之后自动调用。//2、定义一个无参数构造方法和有参数构造方法//定义一个类person,创建一个无参数构造方法 :person(){},并打印出结果:我是一个无参数的构造方法//创建一个有参数的构造方法 person(string name),对name进行赋值,最后print打印出name//3、在main方法里new person类,分别构造有参数和无参数的方法:print打印结果String Name;Person(){System.out.println("我是一个无参数的构造方法");}Person(String name){System.out.println(name);}public static void main(String[] args) {Person p = new Person();Person p2=new Person("张三");}}

Java21天打卡day18–继承

public class Person18 {//继承//1、描述什么是继承 在已存在的类的基础上进行扩展,从而产生新的类//2、创建一个person类,赋予name、age、sex属性,并创建一个有参数的构造方法并赋值//3、创建一个方法work,print打印出结果:name是一个测试工程师//4、创建一个类 Engineer,继承person,调用person的work方法//5、在main方法里,new engineer类,对name进行赋值,并调用work方法,查看打印结果public String name;public int age;public String sex;public Person18(String name, int age, String sex) {this.name = name;this.age = age;this.sex = sex;}public void work() {System.out.println(name + "是一个测试工程师");}public static void main(String[] args) {Engineer e = new Engineer("张三",25,"女");e.work();}
}
public class Engineer extends Person18 {public Engineer(String name, int age, String sex) {super(name,age, sex);}
}

出错的地方:
1.一个文件只能有一个类,所以子类必须新写一个文件。
2.子类的构造函数继承了父类的有参数构造函数,所以子类构造函数也要有参数。
3.初始化的时候,只能初始化全部构造函数,因为这里只有一个构造函数。

Java21天打卡day19-异常

//异常
//异常分类
//编译时异常:程序编译时的异常例子 IO异常,SQL异常
//运行时异常的区别:程序在运行时出现的异常,会自动抛出该异常
//异常处理
//
//try catch finally处理异常
//throws 和 throw 的区别
//throws是用于在方法声明抛出的异常是(Oexcetion)类型,而throw是用于抛出异常。

Java 的异常处理通过 5 个关键字来实现:try、catch、throw、throws 和 finally。try catch 语句用于捕获并处理异常,finally 语句用于在任何情况下(除特殊情况外)都必须执行的代码,throw 语句用于拋出异常,throws 语句用于声明可能会出现的异常。

try {// 可能发生异常的语句
} catch(ExceptionType e) {// 处理异常语句
}
语法的处理代码块 1 中,可以使用以下 3 个方法输出相应的异常信息。
printStackTrace() 方法:指出异常的类型、性质、栈层次及出现在程序中的位置(关于 printStackTrace 方法的使用可参考《Java的异常跟踪栈》一节)。
getMessage() 方法:输出错误的性质。
toString() 方法:给出异常的类型与性质。

//题目1:完成一个编译时异常的举例 其实就是写的时候会有红线提示进行异常处理
//题目2:完成一个运行时异常的举例
public class Day19 {
public static void main(String[] args){
System.out.println(3/0);
}

}

//题目3:完成一个运行时异常捕获,获取异常信息后打印异常信息。
public class Day19 {
public static void main(String[] args){try{System.out.println(3/0);}catch (Exception e){e.printStackTrace();System.out.println("啊啊啊啊,出错了");//如果没有异常处理,这句是不会打印的}
}

}

//题目4:自定义一个异常并捕获抛出
import java.util.InputMismatchException;
import java.util.Scanner;public class Test {public static void main(String[] args) {int age;Scanner in=new Scanner((System.in));System.out.println("请输入您的年龄");try {age=in.nextInt();if(age<0){throw new MyException("您输入的年龄为负数,输出错误");}else if(age>100){throw new MyException("您输入的年龄大于100,输出错误");}else {System.out.println("您的年龄是"+age);}}catch (InputMismatchException e1){System.out.println("您输入的年龄不是数字");}catch (MyException e2){System.out.println(e2.getMessage());}}
}
public class MyException extends Exception {public  MyException(){super();//继承父类构造函数}public MyException(String str){super(str);}}

参考:http://c.biancheng.net/view/1051.html

参考答案:

答案:题目1:@Test//获取系统编译时异常,需要抛出异常或者进行异常捕获 try catch
public void getBuildException(){File file = new File("/dd");FileInputStream inputStream =new FileInputStream(file);
}直接会有红线提示:
或者运行时会提示:
Error:(15, 39) java: 未报告的异常错误java.io.FileNotFoundException; 必须对其进行捕获或声明以便抛出题目2:
public class ex {public static void getRunException() {int a = 1 / 0;System.out.println("异常已经出现了看我打印不打印");}public static void main(String[] args) {// getBuildException();}
}运行时会出现:
Exception in thread "main" java.lang.ArithmeticException: / by zeroat com.benben.exception.ex.getRunException(ex.java:19)at com.benben.exception.ex.main(ex.java:24)题目3:@Test//获取系统运行时异常
public void getRunException() {try {int a = 1 / 0;System.out.println("异常已经出现了看我打印不打印");} catch (RuntimeException e) {System.out.println(e.getMessage() + "异常信息");System.out.println(e.toString() + "输出异常串");System.out.println("打印异常信息");e.printStackTrace();} finally {System.out.println("finally 输出了");}
}题目4:
//抛出一个 自定义的异常,并由调用此方法的对象方法捕获后处理 throw
自定义的异常类:
Oexcetion.javapublic class Oexcetion extends RuntimeException {final long serialVersionUID = -703407466939L;public Oexcetion() {}public Oexcetion(String msg) {super(msg);}
}ex.java
class ex {public void biJia(int a, int b) throws Oexcetion {if (a < b) {throw new Oexcetion("出现自定义异常了");}}
}

java21天打卡day20-集合

集合list
ArrayList

查询速度快
线程不安全
LinkedList

增删速度快
线程不安全
Vector

线程安全
查询速度快
常用方法练习

add(value) 添加元素
get(index) 获取元素
remove(index) 删除元素
题目1:新建三个list实现类的对象
题目2:遍历List
1)迭代器
2)增强for循环

数组长度不可变化
List 是一个有序、可重复的集合
List 实现了 Collection 接口,它主要有两个常用的实现类:ArrayList 类和 LinkedList 类。
ArrayList 类实现了可变数组的大小,存储在内的数据称为元素。它还提供了快速基于索引访问元素的方式,对尾部成员的增加和删除支持较好。
LinkedList 类采用链表结构保存对象,这种结构的优点是便于向集合中插入或者删除元素

import java.util.*;public class Day20 {public static void main(String[] args){List list1=new ArrayList();list1.add("1");list1.add("2");System.out.println("list1集合元素如下");Iterator it=list1.iterator();//迭代器?while(it.hasNext()){System.out.print(it.next()+",");}LinkedList list2=new LinkedList();list2.add("hello");list2.add("world");System.out.println("list2集合元素如下");for(int i=0;i<list2.size();i++){System.out.print(list2.get(i)+",");}Vector vector=new Vector();}
}

参考答案:

1)
import java.util.ArrayList;public class demo {public static void iterator() {ArrayList arrayList = new ArrayList();arrayList.add(2);arrayList.add(new Object());arrayList.add(new String("5"));;//遍历集合元素Iterator iterator = arrayList.iterator();while (iterator.hasNext()) {System.out.println(iterator.next());}}public static void main(String[] args) {iterator();}}
 import java.util.ArrayList;public class demo {public static void LinkedList() {ArrayList arrayList = new ArrayList();arrayList.add(1);arrayList.add(2);arrayList.add(3);arrayList.add(14);for (Object list:arrayList)//这个方法厉害了{System.out.println(list);}}public static void main(String[] args) {LinkedList();}}

Java21天打卡练习Day21-集合map

HashMap
TreeMap:根据KEY排序
LinkedHashMap
HashTable
创建4个map实现类的对象

Map hashMap = new HashMap();
Map linkedHashMap = new LinkedHashMap();
Map treeMap = new TreeMap();
Map hashtable = new Hashtable();

常用方法练习
put(key,value)添加元素,添加相同的key值是替换原来的value
putAll(Map) 添加新的map数据,已存在就刷新
get(key) 根据key查找元素
remove(key) 根据key删除元素
containsKey(key) 判断是否存在key值
containsValue(value) 判断是否存在value
clear() 删除所有元素
relpace(key,value1,value2) 修改value1 变成value2
isEmpty() 判断集合是否为空
size() 获取集合长度

遍历map四种方法:
http://c.biancheng.net/view/6872.html

import java.util.*;public class Day21 {public static void main(String[] args){HashMap h=new HashMap();h.put("青花瓷","周杰伦");h.put("画","邓紫棋");h.put("断桥残雪","许嵩");Iterator it=h.keySet().iterator();//keySet是得到key的集合while(it.hasNext()){Object key=it.next();//得到hashmap的key?//不知道是什么对象就用Object?Object val=h.get(key);System.out.println("歌曲:"+key+"歌手:"+val);}}}

参考答案:

map遍历
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
public class d {public static void itMap() {Map hashMap = new HashMap();hashMap.put("1",1);hashMap.put("2",2);hashMap.put("3",3);//普通Iterator<String> iterator = hashMap.keySet().iterator();while (iterator.hasNext()) {String key = iterator.next();System.out.println(hashMap.get(key));}//entrySet最快Iterator<Map.Entry<String,Object>> iterator1 = hashMap.entrySet().iterator();while (iterator1.hasNext()) {Map.Entry<String, Object> entry = iterator1.next();System.out.println(entry.getKey());}}public static void main(String[] args) {itMap();}
}增强for循环,遍历HashMap
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;public static void main(String[] args) {// LinkedList();//iterator();//itMap();Map<String, Integer> hashMap = new HashMap<String, Integer>();//Map hashMap = new HashMap();hashMap.put("1",1);hashMap.put("2",2);hashMap.put("3",3);//普通for (Object key : hashMap.keySet()) {System.out.println("key=" + key + "  value=" + hashMap.get(key));}//entrySetfor(Map.Entry<String, Integer> entry: hashMap.entrySet()) {System.out.println(entry.getKey());}}
}

相关文章:

21天打卡掌握java基础操作

Java安装环境变量配置-day1 参考&#xff1a; https://www.runoob.com/w3cnote/windows10-java-setup.html 生成class文件 java21天打卡-day2 输入和输出 题目&#xff1a;设计一个程序&#xff0c;输入上次考试成绩&#xff08;int&#xff09;和本次考试成绩&#xff0…...

SQL题目记录

1.商品推荐题目 1.思路&#xff1a; 通过取差集 得出要推荐的商品差集的选取&#xff1a;except直接取差集 或者a left join b on where b null 2.知识点 1.except selectfriendship_info.user1_id as user_id,sku_id fromfriendship_infojoin favor_info on friendship_in…...

Linux程序调试器——gdb的使用

gdb的概述 GDB 全称“GNU symbolic debugger”&#xff0c;从名称上不难看出&#xff0c;它诞生于 GNU 计划&#xff08;同时诞生的还有 GCC、Emacs 等&#xff09;&#xff0c;是 Linux 下常用的程序调试器。发展至今&#xff0c;GDB 已经迭代了诸多个版本&#xff0c;当下的…...

前端打包项目上线-nginx

第一步&#xff1a;下载nginx。 直接下载 nginx/Windows-1.25.2 pgp 第二步&#xff1a;解压zip包 第三步&#xff1a;打开文件夹&#xff0c;把http里的路径打开cmd 第四步&#xff1a;打开你的http-server服务&#xff0c;没有下载去下一次就ok了 打开后就可以访问了 第五步…...

创龙瑞芯微RK3568参数修改(调试口波特率和rootfs文件)

前言 前面写了基本的文件编译、系统编译和系统烧写&#xff0c;差不多前期工作就准备的差不多了。目前的东西能解决大部分入门级的需求。当然如果需要开发的话&#xff0c;还需要修改其他东西&#xff0c;下面一步一步的给小伙伴介绍关键参数怎么修改。 给定波特率 拿到开发板…...

VMware——VMware17安装WindowServer2012R2环境(图解版)

目录 一、WindowServer2012R2镜像百度云下载二、安装 一、WindowServer2012R2镜像百度云下载 下载链接&#xff1a;https://pan.baidu.com/s/1TWnSRJTk0ruGNn4YinzIgA 提取码&#xff1a;e7u0 二、安装 打开虚拟机&#xff0c;点击【创建新的虚拟机】&#xff0c;如下图&…...

ModuleNotFoundError: No module named ‘torch‘

目录 情况1,真的没有安装pytorch情况2(安装了与CUDA不对应的pytorch版本导致无法识别出torch) 情况1,真的没有安装pytorch 虚拟环境里面真的是没有torch,这种情况就easy job了,点击此链接直接安装与CUDA对应的pytorch版本,CTRLF直接搜索对应CUDA版本即可查找到对应的命令.按图…...

采用Spring Boot框架开发的医院预约挂号系统3e3g0+vue+java

本医院预约挂号系统有管理员&#xff0c;医生和用户。管理员功能有个人中心&#xff0c;用户管理&#xff0c;医生管理&#xff0c;科室信息管理&#xff0c;预约挂号管理&#xff0c;用户投诉管理&#xff0c;投诉处理管理&#xff0c;通知公告管理&#xff0c;科室分类管理。…...

Jmeter性能测试(压力测试)

1.先保存 2.添加请求&#xff08;即添加一个线程组&#xff09; 3.添加取样器&#xff08;在线程组下面添加一个http请求&#xff09; 场景1&#xff1a;模拟半小时之内1000个用户访问服务器资源&#xff0c;要求平均响应时间在3000毫秒内&#xff0c;且错误率为0&#xff0…...

NetCore/Net8下使用Redis的分布式锁实现秒杀功能

目的 本文主要是使用NetCore/Net8加上Redis来实现一个简单的秒杀功能&#xff0c;学习Redis的分布式锁功能。 准备工作 1.Visual Studio 2022开发工具 2.Redis集群&#xff08;6个Redis实例&#xff0c;3主3从&#xff09;或者单个Redis实例也可以。 实现思路 1.秒杀开始…...

openGauss学习笔记-102 openGauss 数据库管理-管理数据库安全-客户端接入之查看数据库连接数

文章目录 openGauss学习笔记-102 openGauss 数据库管理-管理数据库安全-客户端接入之查看数据库连接数102.1 背景信息102.2 操作步骤 openGauss学习笔记-102 openGauss 数据库管理-管理数据库安全-客户端接入之查看数据库连接数 102.1 背景信息 当用户连接数达到上限后&#…...

lspci源码

lspci 显示Linux系统的pci设备最简单的方法就是使用lspci命令&#xff0c;前提是要安装pciutils包&#xff08;centos在最小化安装时不会自带该包&#xff0c;需要自己下载安装&#xff09; pciutils包的源码github地址为&#xff1a; https://github.com/pciutils/pciutils …...

CMake教程-第 8 步:添加自定义命令和生成文件

CMake教程-第 8 步&#xff1a;添加自定义命令和生成文件 1 CMake教程介绍2 学习步骤Step 1: A Basic Starting PointStep 2: Adding a LibraryStep 3: Adding Usage Requirements for a LibraryStep 4: Adding Generator ExpressionsStep 5: Installing and TestingStep 6: Ad…...

快速入门:Spring Cache

目录 一:Spring Cache简介 二:Spring Cache常用注解 2.1:EnableCaching 2.2: Cacheable 2.3:CachePut 2.4:CacheEvict 三:Spring Cache案例 3.1:先在pom.xml中引入两个依赖 3.2:案例 3.2.1:构建数据库表 3.2.2:构建User类 3.2.3:构建Controller mapper层代码 3.…...

探索音频传输系统:数字声音的无限可能 | 百能云芯

音频传输系统是一项关键的技术&#xff0c;已经在数字时代的各个领域中广泛应用&#xff0c;从音乐流媒体到电话通信&#xff0c;再到多媒体制作。本文将深入探讨音频传输系统的定义、工作原理以及在现代生活中的各种应用&#xff0c;以帮助您更好地了解这一重要技术。 音频传输…...

【C++】-c++的类型转换

&#x1f496;作者&#xff1a;小树苗渴望变成参天大树&#x1f388; &#x1f389;作者宣言&#xff1a;认真写好每一篇博客&#x1f4a4; &#x1f38a;作者gitee:gitee✨ &#x1f49e;作者专栏&#xff1a;C语言,数据结构初阶,Linux,C 动态规划算法&#x1f384; 如 果 你 …...

《论文阅读28》OGMM

一、论文 研究领域&#xff1a; 点云配准 | 有监督 部分重叠论文&#xff1a;Overlap-guided Gaussian Mixture Models for Point Cloud Registration WACV 2023 二、概述 概率3D点云配准方法在克服噪声、异常值和密度变化方面表现出有竞争力的性能。本文将点云对的配准问题…...

忆联分布式数据库存储解决方案,助力MySQL实现高性能、低时延

据艾瑞咨询研究院《2022 年中国数据库研究报告》显示&#xff0c;截止2021年&#xff0c;中国分布式数据库占比达到 20%左右&#xff0c;主要以 MySQL 和 PostgreSQL 为代表的开源数据库为主。MySQL 作为备受欢迎的开源数据库&#xff0c;当前已广泛应用于互联网、金融、交通、…...

网络安全内网渗透之信息收集--systeminfo查看电脑有无加域

systeminfo输出的内容很多&#xff0c;包括主机名、OS名称、OS版本、域信息、打的补丁程序等。 其中&#xff0c;查看电脑有无加域可以快速搜索&#xff1a; systeminfo|findstr "域:" 输出结果为WORKGROUP&#xff0c;可见该机器没有加域&#xff1a; systeminfo…...

MySQL高可用架构学习

MHA&#xff08;Master HA&#xff09;是一款开源的由Perl语言开发的MySQL高可用架构方案。它为MySQL 主从复制架构提供了 automating master failover 功能。MHA在监控到 master 节点故障时&#xff0c;会提升其中拥有最新数据的 slave 节点成为新的 master 节点&#xff0c;在…...

seata的AT模式分析

&#xff08;1&#xff09;AT模式的核心组件&#xff1a; 事务协调器 TC 维护全局和分支事务的状态&#xff1b; 维护全局锁的状态&#xff1b; 接受TM的提交或者回滚命令&#xff0c;联系RM进行分支事务的提交或者回滚。 事务管理者 TM 开启全局事务&#xff0c;向TC申请…...

【算法练习Day22】 组合总和 III电话号码的字母组合

​&#x1f4dd;个人主页&#xff1a;Sherry的成长之路 &#x1f3e0;学习社区&#xff1a;Sherry的成长之路&#xff08;个人社区&#xff09; &#x1f4d6;专栏链接&#xff1a;练题 &#x1f3af;长路漫漫浩浩&#xff0c;万事皆有期待 文章目录 组合总和 III剪枝 电话号码…...

react-------JS对象、数组方法实际应用集合

目录 1、向空对象里添加键值对 2、js在数组对象中添加和删除键值对&#xff08;对象属性&#xff09;的方法 2.1 添加 3、对已有的数据更换键值对的属性名 4、js字符串拼接、数组转字符串 5、从数组中提取元素 1、向空对象里添加键值对 对象的属性可以使用[ ] 或者 . 而…...

AWS SAP-C02教程6--安全

云的安全是一个重要的问题,很多企业不上云的原因就认为云不安全,特别是对安全性要求较高的企业,所以云安全是一个非常广泛且重要的话题,其实在之前章节中的组件都会或多或少讲述与其相关的安全问题,这里也会详细讲一下。本章主要通过讲述一些独立或与安全有关的组件以及网…...

Go学习第一章——开发环境安装以及快速入门(GoLand)

Go开发环境安装以及快速入门 一、环境配置1.1 go开发工具1.2 go sdk下载3.1 go相关命令行 二、快速入门2.1 创建项目2.2 创建.go程序文件2.3.配置 mod 的开启与关闭2.4 用 GoLand 写第一份代码2.5.代码静态检测&#xff08;此部分非必要&#xff09; 三、初步了解3.1 代码解释以…...

大数据学习(14)-Map Join和Common Join

&&大数据学习&& &#x1f525;系列专栏&#xff1a; &#x1f451;哲学语录: 承认自己的无知&#xff0c;乃是开启智慧的大门 &#x1f496;如果觉得博主的文章还不错的话&#xff0c;请点赞&#x1f44d;收藏⭐️留言&#x1f4dd;支持一下博>主哦&#x…...

Docker安装ES7.14和Kibana7.14(无账号密码)

一、Docker安装ES7.14.0 1、下载镜像 docker pull elasticsearch:7.14.0 2、docker安装7.14.0 mkdir -p /usr/local/elasticsearch/config mkdir -p /usr/local/elasticsearch/data chmod 777 -R /usr/local/elasticsearch/ echo "http.host: 0.0.0.0" >> /u…...

Zynq中断与AMP~双核串口环回之PS与PL通信

实现思路&#xff1a; 额外配置&#xff1a;通过PL配置计数器&#xff0c;向CPU0和CPU1发送硬中断。 1.串口中断CPU0&#xff0c;在中断中设置接收设置好字长的数据&#xff0c;如果这些数据的数值符合约定的命令&#xff0c;则关闭硬中断&#xff0c;并将这部分数据存入AxiLi…...

【一:实战开发testng的介绍】

目录 1、主要内容1.1、为啥要做接口测试1.2、接口自动化测试落地过程1.3、接口测试范围1.4、手工接口常用的工具1.5、自动化框架的设计 2、testng自动化测试框架基本测试1、基本注解2、忽略测试3、依赖测试4、超时测试5、异常测试6、通过xml文件参数测试7、通过data实现数据驱动…...

C现代方法(第9章)笔记——函数

文章目录 第9章 函数9.1 函数的定义和调用9.1.1 函数定义9.1.2 函数调用 9.2 函数声明9.3 实际参数9.3.1 实际参数的转换9.3.2 数组型实际参数9.3.3 变长数组形式参数(C99)9.3.4 在数组参数声明中使用static(C99)9.3.5 复合字面量 9.4 return语句9.5 程序终止9.5.1 exit函数 9.…...