当前位置: 首页 > 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 --- 后端服务器要配置...

7.4.分块查找

一.分块查找的算法思想&#xff1a; 1.实例&#xff1a; 以上述图片的顺序表为例&#xff0c; 该顺序表的数据元素从整体来看是乱序的&#xff0c;但如果把这些数据元素分成一块一块的小区间&#xff0c; 第一个区间[0,1]索引上的数据元素都是小于等于10的&#xff0c; 第二…...

练习(含atoi的模拟实现,自定义类型等练习)

一、结构体大小的计算及位段 &#xff08;结构体大小计算及位段 详解请看&#xff1a;自定义类型&#xff1a;结构体进阶-CSDN博客&#xff09; 1.在32位系统环境&#xff0c;编译选项为4字节对齐&#xff0c;那么sizeof(A)和sizeof(B)是多少&#xff1f; #pragma pack(4)st…...

如何在看板中体现优先级变化

在看板中有效体现优先级变化的关键措施包括&#xff1a;采用颜色或标签标识优先级、设置任务排序规则、使用独立的优先级列或泳道、结合自动化规则同步优先级变化、建立定期的优先级审查流程。其中&#xff0c;设置任务排序规则尤其重要&#xff0c;因为它让看板视觉上直观地体…...

基于服务器使用 apt 安装、配置 Nginx

&#x1f9fe; 一、查看可安装的 Nginx 版本 首先&#xff0c;你可以运行以下命令查看可用版本&#xff1a; apt-cache madison nginx-core输出示例&#xff1a; nginx-core | 1.18.0-6ubuntu14.6 | http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages ng…...

React Native在HarmonyOS 5.0阅读类应用开发中的实践

一、技术选型背景 随着HarmonyOS 5.0对Web兼容层的增强&#xff0c;React Native作为跨平台框架可通过重新编译ArkTS组件实现85%以上的代码复用率。阅读类应用具有UI复杂度低、数据流清晰的特点。 二、核心实现方案 1. 环境配置 &#xff08;1&#xff09;使用React Native…...

vue3 字体颜色设置的多种方式

在Vue 3中设置字体颜色可以通过多种方式实现&#xff0c;这取决于你是想在组件内部直接设置&#xff0c;还是在CSS/SCSS/LESS等样式文件中定义。以下是几种常见的方法&#xff1a; 1. 内联样式 你可以直接在模板中使用style绑定来设置字体颜色。 <template><div :s…...

深入解析C++中的extern关键字:跨文件共享变量与函数的终极指南

&#x1f680; C extern 关键字深度解析&#xff1a;跨文件编程的终极指南 &#x1f4c5; 更新时间&#xff1a;2025年6月5日 &#x1f3f7;️ 标签&#xff1a;C | extern关键字 | 多文件编程 | 链接与声明 | 现代C 文章目录 前言&#x1f525;一、extern 是什么&#xff1f;&…...

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

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

Linux C语言网络编程详细入门教程:如何一步步实现TCP服务端与客户端通信

文章目录 Linux C语言网络编程详细入门教程&#xff1a;如何一步步实现TCP服务端与客户端通信前言一、网络通信基础概念二、服务端与客户端的完整流程图解三、每一步的详细讲解和代码示例1. 创建Socket&#xff08;服务端和客户端都要&#xff09;2. 绑定本地地址和端口&#x…...

Qemu arm操作系统开发环境

使用qemu虚拟arm硬件比较合适。 步骤如下&#xff1a; 安装qemu apt install qemu-system安装aarch64-none-elf-gcc 需要手动下载&#xff0c;下载地址&#xff1a;https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x…...