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

【C#】Microsoft C# 视频学习总结

一、文档链接

C# 文档 - 入门、教程、参考。| Microsoft Learn

二、基础学习

1、输出语法

Console.WriteLine()

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){Console.WriteLine("Hello World!");}}
}
Hello World!

2、输出语句中可使用美元符号和花括号写法进行拼接

Console.WriteLine($"{}")

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){String friend = "Kcoff";Console.WriteLine("Hello " + friend);Console.WriteLine($"Hello {friend}");String secondFriend = "Kendra";Console.WriteLine($"My friend are {friend} and {secondFriend}");}}
}
Hello Kcoff
Hello Kcoff
My friend are Kcoff and Kendra

3、字符串长度查询

strName.Length

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){String friend = "Kcoff";Console.WriteLine($"The name {friend} has {friend.Length} letters.");}}
}
The name Kcoff has 5 letters.

4、去除字符串空白符

strName.TrimStart()strName.TrimEnd()strName.Trim()

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){String greeting = "      Hello World!     ";// 中括号的作用:可视化空白Console.WriteLine($"[{greeting}]");Console.WriteLine($"***{greeting}***");String trimmedGreeting = greeting.TrimStart();Console.WriteLine($"[{trimmedGreeting}]");trimmedGreeting = greeting.TrimEnd();Console.WriteLine($"[{trimmedGreeting}]");trimmedGreeting = greeting.Trim();Console.WriteLine($"[{trimmedGreeting}]");}}
}
[      Hello World!     ]
***      Hello World!     ***
[Hello World!     ]
[      Hello World!]
[Hello World!]

5、字符串替换

strName.Replace(source, target)

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){String sayHello = "Hello World!";Console.WriteLine(sayHello);sayHello = sayHello.Replace("Hello", "Greetings");Console.WriteLine(sayHello);}}
}
Hello World!
Greetings World!

6、字符串大小写转换

strName.ToUpper()strName.ToLower()

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){String sayHello = "Hello World!";Console.WriteLine(sayHello.ToUpper());Console.WriteLine(sayHello.ToLower());}}
}
HELLO WORLD!
hello world!

7、字符串是否包含什么、是否以什么为开头、是否以什么为结尾

strName.Contains(target)strName.StartsWith(target)strName.EndsWith(target)

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){String songLyrics = "You say goodbye, and I say hello";var result = songLyrics.Contains("goodbye");Console.WriteLine(result);Console.WriteLine(songLyrics.Contains("greetings"));var result2 = songLyrics.StartsWith("You");Console.WriteLine(result2);Console.WriteLine(songLyrics.StartsWith("goodbye"));var result3 = songLyrics.EndsWith("hello");Console.WriteLine(result3);Console.WriteLine(songLyrics.EndsWith("goodbye"));}}
}
True
False
True
False
True
False

8、计算

1、加减乘除

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){int a = 18;int b = 6;int c = a + b;Console.WriteLine(c);int d = a - b;Console.WriteLine(d);int e = a * b;Console.WriteLine(e);int f = a / b;Console.WriteLine(f);}}
}
24
12
108
3

2、计算顺序

优先计算括号里面的计算,之后先算乘除后算加减

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){int a = 5;int b = 4;int c = 2;int d = a + b * c;Console.WriteLine(d);int e = (a + b) * c;Console.WriteLine(e);int f = (a + b) - 6 * c + (12 * 4) / 3 + 12;Console.WriteLine(f);}}
}
13
18
25

3、除法只保留整数部分

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){int a = 7;int b = 4;int c = 3;int d = (a + b) / c;Console.WriteLine(d);}}
}
3

4、取余数

被除数 % 除数

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){int a = 7;int b = 4;int c = 3;int d = (a + b) / c;int e = (a + b) % c;// 商Console.WriteLine($"quotient: {d}");// 余数Console.WriteLine($"remainder: {e}");}}
}
quotient: 3
remainder: 2

9、类型(最大值、最小值及部分计算)

1、int

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){int max = int.MaxValue;int min = int.MinValue;Console.WriteLine($"The range of integers type is {min} to {max}");int what = max + 3;Console.WriteLine($"An example of overflow: {what}");}}
}
The range of integers type is -2147483648 to 2147483647
An example of overflow: -2147483646

2、double

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){double max = double.MaxValue;double min = double.MinValue;Console.WriteLine($"The range of double type is {min} to {max}");}}
}
The range of double type is -1.79769313486232E+308 to 1.79769313486232E+308
using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){double a = 5;double b = 4;double c = 2;double d = (a + b) / c;Console.WriteLine(d);a = 19;b = 23;c = 8;double e = (a + b) / c;Console.WriteLine(e);double third = 1.0 / 3.0;Console.WriteLine(third);}}
}
4.5
5.25
0.333333333333333

3、decimal

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){decimal max = decimal.MaxValue;decimal min = decimal.MinValue;Console.WriteLine($"The range of decimal type is {min} to {max}");}}
}
The range of decimal type is -79228162514264337593543950335 to 79228162514264337593543950335
using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){double a = 1.0;double b = 3.0;Console.WriteLine(a / b);decimal c = 1.0M;decimal d = 3.0M;Console.WriteLine(c / d);}}
}
0.333333333333333
0.3333333333333333333333333333

4、long

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){long max = long.MaxValue;long min = long.MinValue;Console.WriteLine($"The range of long type is {min} to {max}");}}
}
The range of long type is -9223372036854775808 to 9223372036854775807

5、short

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){short max = short.MaxValue;short min = short.MinValue;Console.WriteLine($"The range of short type is {min} to {max}");}}
}
The range of short type is -32768 to 32767

10、圆的面积

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){double radius = 2.50;double area = Math.PI * radius * radius;Console.WriteLine(area);}}
}
19.634954084936208

11、if-else 语句

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){int a = 5;int b = 6;bool something = a + b > 10;if (something)Console.WriteLine("The answer is greater then 10");}}
}
The answer is greater then 10
using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){int a = 5;int b = 3;bool something = a + b > 10;if (something){Console.WriteLine("The answer is greater then 10");}else{Console.WriteLine("The answer is not greater then 10");}}}
}
The answer is not greater then 10

12、&& 和 ||

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){int a = 5;int b = 3;int c = 4;if ((a + b + c > 10) && (a == b)){Console.WriteLine("The answer is greater then 10");Console.WriteLine("And the first number is equal to the second");}else{Console.WriteLine("The answer is not greater then 10");Console.WriteLine("Or the first number is not equal to the second");}}}
}
The answer is not greater then 10
Or the first number is not equal to the second
using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){int a = 5;int b = 3;int c = 4;if ((a + b + c > 10) || (a == b)){Console.WriteLine("The answer is greater then 10");Console.WriteLine("And the first number is equal to the second");}else{Console.WriteLine("The answer is not greater then 10");Console.WriteLine("Or the first number is not equal to the second");}}}
}
The answer is greater then 10
And the first number is equal to the second

13、while 语句

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){int counter = 0;while (counter < 10){Console.WriteLine($"Hello World! The counter is {counter}");counter++;}}}
}
Hello World! The counter is 0
Hello World! The counter is 1
Hello World! The counter is 2
Hello World! The counter is 3
Hello World! The counter is 4
Hello World! The counter is 5
Hello World! The counter is 6
Hello World! The counter is 7
Hello World! The counter is 8
Hello World! The counter is 9

14、do-while 语句

和 while 语句的区别是至少会执行一次操作

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){int counter = 10;// 至少执行一次操作do{Console.WriteLine($"Hello World! The counter is {counter}");counter++;} while (counter < 10);}}
}
Hello World! The counter is 10

15、for 语句

1、写法

执行顺序:int index = 0 -> index < 10 -> Console.WriteLine() -> index++

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){for (int index = 0; index < 10; index++){Console.WriteLine($"Hello World! The index is {index}");}}}
}
Hello World! The index is 0
Hello World! The index is 1
Hello World! The index is 2
Hello World! The index is 3
Hello World! The index is 4
Hello World! The index is 5
Hello World! The index is 6
Hello World! The index is 7
Hello World! The index is 8
Hello World! The index is 9

2、求 1~20 中能被 3 整除的数的总和

using System;
namespace HelloWorldApplication
{class HelloWorld{static void Main(string[] args){int sum = 0;for (int i = 1; i <= 20; i++) {if (i % 3 == 0){sum = sum + i;}}Console.WriteLine($"The sum is {sum}");}}
}
The sum is 63

16、Arrays、List、Collections

1、输出

foreachfor

using System;
using System.Collections.Generic;namespace ConsoleApp
{class Program{static void Main(string[] args){var names = new List<string> { "Scott", "Kendra" };foreach (var name in names){Console.WriteLine($"Hello {name.ToUpper()}!");}for (int i = 0; i < names.Count; i++){Console.WriteLine($"Hello {names[i].ToUpper()}!");}}}
}
Hello SCOTT!
Hello KENDRA!
Hello SCOTT!
Hello KENDRA!

2、新增或删除

list.Add(source)list.Remove(source)

using System;
using System.Collections.Generic;namespace ConsoleApp
{class Program{static void Main(string[] args){var names = new List<string> { "Scott", "Kendra" };names.Add("Maria");names.Add("Bill");names.Remove("Scott");foreach (var name in names){Console.WriteLine(name);}Console.WriteLine(names[1]);}}
}
Kendra
Maria
Bill
Maria

3、索引

list.IndexOf(target)

using System;
using System.Collections.Generic;namespace ConsoleApp
{class Program{static void Main(string[] args){var names = new List<string> { "WEIRD", "Scott", "Kendra" };names.Add("Maria");names.Add("Bill");names.Remove("Scott");foreach (var name in names){Console.WriteLine(name);}var index = names.IndexOf("Kendra");if (index != -1){Console.WriteLine($"When an item is not found, IndexOf returns {index}");}else{Console.WriteLine($"The name {names[index]} is at index {index}");}}}
}
WEIRD
Kendra
Maria
Bill
When an item is not found, IndexOf returns 1

4、排序

list.Sort()

using System;
using System.Collections.Generic;namespace ConsoleApp
{class Program{static void Main(string[] args){var names = new List<string> { "New Friend", "Scott", "Kendra" };names.Add("Maria");names.Add("Bill");foreach (var name in names){Console.WriteLine(name);}Console.WriteLine();names.Sort();foreach (var name in names){Console.WriteLine(name);}}}
}
New Friend
Scott
Kendra
Maria
BillBill
Kendra
Maria
New Friend
Scott

5、斐波那契数列

using System;
using System.Collections.Generic;namespace ConsoleApp
{class Program{static void Main(string[] args){var fibonacciNumbers = new List<int> { 1, 1 };while (fibonacciNumbers.Count < 20){var previous = fibonacciNumbers[fibonacciNumbers.Count - 1];var previous2 = fibonacciNumbers[fibonacciNumbers.Count - 2];fibonacciNumbers.Add(previous + previous2);}foreach (var item in fibonacciNumbers){Console.WriteLine(item);}}}
}
1
1
2
3
5
8
13
21
34
55
89
144
233
377
610
987
1597
2584
4181
6765

17、面向对象

1、模拟银行创建用户并存钱

using System;namespace ConsoleApp
{public class BankAccount{public string Number { get; }public string Owner { get; set; }public decimal Balance { get; }public BankAccount(string name, decimal initialBalance){this.Owner = name;this.Balance = initialBalance;}public void MakeDeposit(decimal amount, DateTime date, string note){}public void MakeWithdrawal(decimal amount, DateTime date, string note){}}
}
using System;namespace ConsoleApp
{class Program{static void Main(string[] args){var account = new BankAccount("Kendra", 10000);Console.WriteLine($"Account {account.Number} was created for {account.Owner} with {account.Balance}");}}
}
Account  was created for Kendra with 10000

2、模拟银行存款取款

using System;namespace ConsoleApp
{public class Transaction{public decimal Amount { get; }public DateTime Date { get; }public string Notes { get; }public Transaction(decimal amount, DateTime date, string note){this.Amount = amount;this.Date = date;this.Notes = note;}}
}
using System;
using System.Collections.Generic;namespace ConsoleApp
{public class BankAccount{public string Number { get; }public string Owner { get; set; }public decimal Balance{ get{decimal balance = 0;foreach (var item in allTransactions){balance += item.Amount;}return balance;}}private static int accountNumberSeed = 1234567890;private List<Transaction> allTransactions = new List<Transaction>();public BankAccount(string name, decimal initialBalance){this.Owner = name;MakeDeposit(initialBalance, DateTime.Now, "Initial Balance");this.Number = accountNumberSeed.ToString();accountNumberSeed++;}// 存款public void MakeDeposit(decimal amount, DateTime date, string note){if (amount <= 0){throw new ArgumentOutOfRangeException(nameof(amount), "Amount of deposit must be positive");}var deposit = new Transaction(amount, date, note);allTransactions.Add(deposit);}// 取款public void MakeWithdrawal(decimal amount, DateTime date, string note){if (amount <= 0){throw new ArgumentOutOfRangeException(nameof(amount), "Amount of deposit must be positive");}if (Balance - amount < 0){throw new InvalidOperationException("Not sufficient funds for this withdrawal");}var withdrawal = new Transaction(-amount, date, note);allTransactions.Add(withdrawal);}}
}
using System;namespace ConsoleApp
{class Program{static void Main(string[] args){var account = new BankAccount("Kendra", 10000);Console.WriteLine($"Account {account.Number} was created for {account.Owner} with {account.Balance}");account.MakeWithdrawal(120, DateTime.Now, "Hammock");Console.WriteLine(account.Balance);}}
}
Account 1234567890 was created for Kendra with 10000
9880

3、存取款异常处理

using System;namespace ConsoleApp
{class Program{static void Main(string[] args){var account = new BankAccount("Kendra", 10000);Console.WriteLine($"Account {account.Number} was created for {account.Owner} with {account.Balance}");account.MakeWithdrawal(120, DateTime.Now, "Hammock");Console.WriteLine(account.Balance);account.MakeWithdrawal(50, DateTime.Now, "Xbox Game");Console.WriteLine(account.Balance);// hey this is a comment// Test for a negative balancetry{account.MakeWithdrawal(75000, DateTime.Now, "Attempt to overdraw");}catch (InvalidOperationException e){Console.WriteLine("Exception caught trying to overdraw");Console.WriteLine(e.ToString());}// Test that the initial balances must be posttivetry{var invalidAccount = new BankAccount("invalid", -55);}catch (ArgumentOutOfRangeException e){Console.WriteLine("Exception caught creating account with negative balance");Console.WriteLine(e.ToString());}}}
}
Account 1234567890 was created for Kendra with 10000
9880
9830
Exception caught trying to overdraw
System.InvalidOperationException: Not sufficient funds for this withdrawalat ConsoleApp.BankAccount.MakeWithdrawal(Decimal amount, DateTime date, String note) in F:\CSharpRepository\ConsoleApp\ConsoleApp\BankAccount.cs:line 58at ConsoleApp.Program.Main(String[] args) in F:\CSharpRepository\ConsoleApp\ConsoleApp\Program.cs:line 24
Exception caught creating account with negative balance
System.ArgumentOutOfRangeException: Amount of deposit must be positive (Parameter 'amount')at ConsoleApp.BankAccount.MakeDeposit(Decimal amount, DateTime date, String note) in F:\CSharpRepository\ConsoleApp\ConsoleApp\BankAccount.cs:line 44at ConsoleApp.BankAccount..ctor(String name, Decimal initialBalance) in F:\CSharpRepository\ConsoleApp\ConsoleApp\BankAccount.cs:line 32at ConsoleApp.Program.Main(String[] args) in F:\CSharpRepository\ConsoleApp\ConsoleApp\Program.cs:line 35

4、账户交易历史记录

using System;
using System.Collections.Generic;
using System.Text;namespace ConsoleApp
{public class BankAccount{public string Number { get; }public string Owner { get; set; }public decimal Balance{ get{decimal balance = 0;foreach (var item in allTransactions){balance += item.Amount;}return balance;}}private static int accountNumberSeed = 1234567890;private List<Transaction> allTransactions = new List<Transaction>();public BankAccount(string name, decimal initialBalance){this.Owner = name;MakeDeposit(initialBalance, DateTime.Now, "Initial Balance");this.Number = accountNumberSeed.ToString();accountNumberSeed++;}public void MakeDeposit(decimal amount, DateTime date, string note){if (amount <= 0){throw new ArgumentOutOfRangeException(nameof(amount), "Amount of deposit must be positive");}var deposit = new Transaction(amount, date, note);allTransactions.Add(deposit);}public void MakeWithdrawal(decimal amount, DateTime date, string note){if (amount <= 0){throw new ArgumentOutOfRangeException(nameof(amount), "Amount of deposit must be positive");}if (Balance - amount < 0){throw new InvalidOperationException("Not sufficient funds for this withdrawal");}var withdrawal = new Transaction(-amount, date, note);allTransactions.Add(withdrawal);}public string GetAccountHistory(){var report = new StringBuilder();// HEADERreport.AppendLine("Date\t\tAmount\tNote");foreach (var item in allTransactions){// ROWSreport.AppendLine($"{item.Date.ToShortDateString()}\t{item.Amount}\t{item.Notes}");}return report.ToString();}}
}
using System;namespace ConsoleApp
{class Program{static void Main(string[] args){var account = new BankAccount("Kendra", 10000);Console.WriteLine($"Account {account.Number} was created for {account.Owner} with {account.Balance}");account.MakeWithdrawal(120, DateTime.Now, "Hammock");account.MakeWithdrawal(50, DateTime.Now, "Xbox Game");Console.WriteLine(account.GetAccountHistory());}}
}
Account 1234567890 was created for Kendra with 10000
Date            Amount  Note
2023/12/12      10000   Initial Balance
2023/12/12      -120    Hammock
2023/12/12      -50     Xbox Game

三、使用软件及快捷键

1、软件

Microsoft Visual Studio Enterprise 2022 (64 位)

2、快捷键

效果快捷键
运行代码(非调试)ctrl + f5
运行代码(调试代码)f5
多行注释ctrl + k,ctrl + c
取消多行注释ctrl + k,ctrl + u
格式化代码(对齐代码)ctrl + k,ctrl + d
自动补齐代码Tab
任意位置换行以及自动加花括号shift + enter
复制选中行或光标所在行ctrl + d
删除选中行或光标所在行ctrl + l(小写L)
输入指定行进行跳转ctrl + g
将选中行或光标所在行进行移动alt + 方向键上或下
自动选中光标右侧内容ctrl + w

注:直接按住 ctrl 即可

相关文章:

【C#】Microsoft C# 视频学习总结

一、文档链接 C# 文档 - 入门、教程、参考。| Microsoft Learn 二、基础学习 1、输出语法 Console.WriteLine() using System; namespace HelloWorldApplication {class HelloWorld{static void Main(string[] args){Console.WriteLine("Hello World!");}} }Hel…...

【已解决-实操篇】SaTokenException: 非Web上下文无法获取Request问题解决-实操篇

在上一篇《【理论篇】SaTokenException: 非Web上下文无法获取Request问题解决 -理论篇》中&#xff0c;凯哥(公众号&#xff1a;凯哥Java)介绍了了产生这个问题的源码在哪里&#xff0c;以及怎么解决的方案。没有给出实际操作步骤。 本文&#xff0c;凯哥就通过threadLocal方案…...

论文润色机构哪个好 快码论文

大家好&#xff0c;今天来聊聊论文润色机构哪个好&#xff0c;希望能给大家提供一点参考。 以下是针对论文重复率高的情况&#xff0c;提供一些修改建议和技巧&#xff0c;可以借助此类工具&#xff1a; 标题&#xff1a;论文润色机构哪个好――专业、高效、可靠的学术支持 一…...

Idea执行bat使用maven打包springboot项目成docker镜像并push到Harbor

如果执行以下命令失败&#xff0c;先把mvn的-q参数去掉&#xff0c;让错误输出到控制台。 《idea配置优化、Maven配置镜像、并行构建加速打包、解决maven打包时偶尔几个文件没权限的问题》下面的使用company-repo私有仓库和阿里云镜像仓库同时使用的配置参考。 bat echo off …...

NCNN 源码学习【三】:数据处理

一、Topic&#xff1a;数据处理 这次我们来一段NCNN应用代码中&#xff0c;除了推理外最重要的一部分代码&#xff0c;数据处理&#xff1a; ncnn::Mat in ncnn::Mat::from_pixels_resize(bgr.data, ncnn::Mat::PIXEL_BGR, bgr.cols, bgr.rows, 227, 227);const float mean_v…...

RabbitMq基本使用

目录 SpringAMQP1.准备Demo工程2.快速入门1.1.消息发送1.2.消息接收1.3.测试 3.WorkQueues模型3.1.消息发送3.2.消息接收3.3.测试3.4.能者多劳3.5.总结 SpringAMQP 将来我们开发业务功能的时候&#xff0c;肯定不会在控制台收发消息&#xff0c;而是应该基于编程的方式。由于R…...

windows wsl2 ubuntu上部署 redroid云手机

Redroid WSL2部署文档 下载wsl内核源码 #文档注明 5.15和5.10 版本内核可以部署成功&#xff0c;这里我当前最新的发布版本 #下载wsl 源码 wget --progressbar:force --output-documentlinux-msft-wsl-5.15.133.1.tar.gz https://codeload.github.com/microsoft/WSL2-Linux-Ker…...

创维电视机 | 用当贝播放器解决创维电视机不能播放MKV视频的问题

小故事在下面&#xff0c;感兴趣可以看看&#xff0c;开头我就直接放解决方案 创维电视虽然是基于Android开发的&#xff0c;可以安装apk软件&#xff0c;但是基本不能用&#xff0c;一定要选择适配电视的视频播放器&#xff0c;或者使用本文中提供的创维版当贝播放器。 原软…...

【STM32】DMA直接存储器存取

1 DMA简介 DMA&#xff08;Direct Memory Access&#xff09;直接存储器存取 可以直接访问STM32的存储器的&#xff0c;包括运行SRAM、程序存储器Flash和寄存器等等 DMA可以提供外设寄存器和存储器或者存储器和存储器之间的高速数据传输&#xff0c;无须CPU干预&#xff0c;节…...

Vue3-09-条件渲染-v-show 的基本使用

v-show 的作用 v-show 可以根据条件表达式的值【展示】或【隐藏】html 元素。v-show 的特点 v-show 的实现方式是 控制 dom 元素的 css的 display的属性&#xff0c; 因此&#xff0c;无论该元素是否展示&#xff0c;该元素都会正常渲染在页面上&#xff0c; 当v-show 的 条件…...

ArrayList与LinkLIst

ArrayList 在Java中&#xff0c;ArrayList是java.util包中的一个类&#xff0c;它实现了List接口&#xff0c;是一个动态数组&#xff0c;可以根据需要自动增长或缩小。下面是ArrayList的一些基本特性以及其底层原理的简要讲解&#xff1a; ArrayList基本特性&#xff1a; 动…...

位运算(、|、^、~、>>、<<)

分类 编程技术 1.位运算概述 从现代计算机中所有的数据二进制的形式存储在设备中。即 0、1 两种状态&#xff0c;计算机对二进制数据进行的运算(、-、*、/)都是叫位运算&#xff0c;即将符号位共同参与运算的运算。 口说无凭&#xff0c;举一个简单的例子来看下 CPU 是如何进…...

Centos7部署SVN

文章目录 &#xff08;1&#xff09;SVN概述&#xff08;2&#xff09;SVN与Samba共享&#xff08;3&#xff09;安装SVN&#xff08;4&#xff09;SVN搭建实例&#xff08;5&#xff09;pc连接svn服务器&#xff08;6&#xff09;svn图标所代表含义 &#xff08;1&#xff09;…...

Vue中this.$nextTick的执行时机

一、Vue中this.$nextTick的执行时机&#xff0c;整体可分为两种情况&#xff1a; 第一种&#xff1a;下一次 Dom 更新之后执行&#xff08;即等待DOM更新结束之后&#xff0c;执行nextTick的延迟回调函数&#xff09;&#xff1b; 第二种&#xff1a;页面挂载后 &#xff08;m…...

Unity中的ShaderToy

文章目录 前言一、ShaderToy网站二、ShaderToy基本框架1、我们可以在ShaderToy网站中&#xff0c;这样看用到的GLSL文档2、void mainImage 是我们的程序入口&#xff0c;类似于片断着色器3、fragColor作为输出变量&#xff0c;为屏幕每一像素的颜色&#xff0c;alpha一般赋值为…...

2 使用postman进行接口测试

上一篇&#xff1a;1 接口测试介绍-CSDN博客 拿到开发提供的接口文档后&#xff0c;结合需求文档开始做接口测试用例设计&#xff0c;下面用最常见也最简单的注册功能介绍整个流程。 说明&#xff1a;以演示接口测试流程为主&#xff0c;不对演示功能做详细的测试&#xff0c;…...

【数据库设计和SQL基础语法】--查询数据--聚合函数

一、聚合函数概述 1.1 定义 聚合函数是一类在数据库中用于对多个行进行计算并返回单个结果的函数。它们能够对数据进行汇总、统计和计算&#xff0c;常用于提取有关数据集的摘要信息。聚合函数在 SQL 查询中广泛应用&#xff0c;包括统计总数、平均值、最大值、最小值等。 1…...

Module ‘app‘: platform ‘android-33‘ not found.

目录 一、报错信息 二、解决方法 一、报错信息 Module app: platform android-33 not found. 检查你的应用程序的build.gradle文件中的targetSdkVersion和compileSdkVersion是否正确设置为已安装的Android SDK版本。 确保你的Android Studio已正确安装并配置了所需的Android …...

MySQL按序批量操作大量数据

MySQL按序批量操作大量数据&#xff08;Java、springboot、mybatisplus、ElasticSearch&#xff09; 以同步全量MySQL数据到ElasticSearch为例。 核心代码 业务逻辑&#xff1a; public boolean syncToElasticsearch() {log.info("Starting data synchronization to El…...

strict-origin-when-cross-origin

严格限制同源策略 &#xff08;1&#xff09;允许服务器的同源IP地址访问 &#xff08;2&#xff09;允许Referer --- 后端服务器要配置...

【大模型RAG】拍照搜题技术架构速览:三层管道、两级检索、兜底大模型

摘要 拍照搜题系统采用“三层管道&#xff08;多模态 OCR → 语义检索 → 答案渲染&#xff09;、两级检索&#xff08;倒排 BM25 向量 HNSW&#xff09;并以大语言模型兜底”的整体框架&#xff1a; 多模态 OCR 层 将题目图片经过超分、去噪、倾斜校正后&#xff0c;分别用…...

逻辑回归:给不确定性划界的分类大师

想象你是一名医生。面对患者的检查报告&#xff08;肿瘤大小、血液指标&#xff09;&#xff0c;你需要做出一个**决定性判断**&#xff1a;恶性还是良性&#xff1f;这种“非黑即白”的抉择&#xff0c;正是**逻辑回归&#xff08;Logistic Regression&#xff09;** 的战场&a…...

mongodb源码分析session执行handleRequest命令find过程

mongo/transport/service_state_machine.cpp已经分析startSession创建ASIOSession过程&#xff0c;并且验证connection是否超过限制ASIOSession和connection是循环接受客户端命令&#xff0c;把数据流转换成Message&#xff0c;状态转变流程是&#xff1a;State::Created 》 St…...

无法与IP建立连接,未能下载VSCode服务器

如题&#xff0c;在远程连接服务器的时候突然遇到了这个提示。 查阅了一圈&#xff0c;发现是VSCode版本自动更新惹的祸&#xff01;&#xff01;&#xff01; 在VSCode的帮助->关于这里发现前几天VSCode自动更新了&#xff0c;我的版本号变成了1.100.3 才导致了远程连接出…...

聊聊 Pulsar:Producer 源码解析

一、前言 Apache Pulsar 是一个企业级的开源分布式消息传递平台&#xff0c;以其高性能、可扩展性和存储计算分离架构在消息队列和流处理领域独树一帜。在 Pulsar 的核心架构中&#xff0c;Producer&#xff08;生产者&#xff09; 是连接客户端应用与消息队列的第一步。生产者…...

生成 Git SSH 证书

&#x1f511; 1. ​​生成 SSH 密钥对​​ 在终端&#xff08;Windows 使用 Git Bash&#xff0c;Mac/Linux 使用 Terminal&#xff09;执行命令&#xff1a; ssh-keygen -t rsa -b 4096 -C "your_emailexample.com" ​​参数说明​​&#xff1a; -t rsa&#x…...

Java-41 深入浅出 Spring - 声明式事务的支持 事务配置 XML模式 XML+注解模式

点一下关注吧&#xff01;&#xff01;&#xff01;非常感谢&#xff01;&#xff01;持续更新&#xff01;&#xff01;&#xff01; &#x1f680; AI篇持续更新中&#xff01;&#xff08;长期更新&#xff09; 目前2025年06月05日更新到&#xff1a; AI炼丹日志-28 - Aud…...

有限自动机到正规文法转换器v1.0

1 项目简介 这是一个功能强大的有限自动机&#xff08;Finite Automaton, FA&#xff09;到正规文法&#xff08;Regular Grammar&#xff09;转换器&#xff0c;它配备了一个直观且完整的图形用户界面&#xff0c;使用户能够轻松地进行操作和观察。该程序基于编译原理中的经典…...

vulnyx Blogger writeup

信息收集 arp-scan nmap 获取userFlag 上web看看 一个默认的页面&#xff0c;gobuster扫一下目录 可以看到扫出的目录中得到了一个有价值的目录/wordpress&#xff0c;说明目标所使用的cms是wordpress&#xff0c;访问http://192.168.43.213/wordpress/然后查看源码能看到 这…...

Java后端检查空条件查询

通过抛出运行异常&#xff1a;throw new RuntimeException("请输入查询条件&#xff01;");BranchWarehouseServiceImpl.java // 查询试剂交易&#xff08;入库/出库&#xff09;记录Overridepublic List<BranchWarehouseTransactions> queryForReagent(Branch…...