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

【置顶】 本博博文汇总

文章目录 前言音视频ijkplayer源码分析FFmpeg、音视频协议Andriod系统音视频框架C、C Android&Java源码分析、绘制、渲染Dalvik、Art虚拟机Java并发 计算机基础操作系统计算机网络设计模式、数据结构、算法 前言 23年底了&#xff0c;想来也工作十年&#xff0c;也一直在c…...

react.js源码二

三、调度Scheduler scheduling(调度)是fiber reconciliation的一个过程,主要决定应该在何时做什么?在stack reconciler中,reconciliation是“一气呵成”,对于函数来说,这没什么问题,因为我们只想要函数的运行结果,但对于UI来说还需要考虑以下问题: 并不是所有的state更…...

如何学习英语

前言 首先写一些自己的感言吧&#xff0c;其实从大学的时候就在不断地听英语&#xff0c;学英语&#xff0c;但是到毕业十几年后&#xff0c;英语一直没起到什么作用&#xff0c;当然最有作用的时候就是几次英语面试吧。 工作之后有一段学习英语的经历&#xff0c;当时花费了…...

robot测试自动化

一. 安装 黑羽robot 首先确保你电脑上安装好了 Python 3.7 或者 3.8 版本的解释器 hyrobot 使用说明1 | 白月黑羽 安装RF 黑羽robot基于Robot Framework &#xff0c;所以必须先安装RobotFramework 直接执行如下Pip命令即可&#xff1a; pip install robotframework...

Linux---重定向命令

1. 重定向命令的介绍 重定向也称为输出重定向&#xff0c;把在终端执行命令的结果保存到目标文件。 2. 重定向命令的使用 命令说明>如果文件存在会覆盖原有文件内容&#xff0c;相当于文件操作中的‘w’模式>>如果文件存在会追加写入文件末尾&#xff0c;相当于文件…...

小区生活污水处理需要哪些设备和工艺

在小区生活中&#xff0c;污水处理是一个非常重要的环节&#xff0c;它关乎到环境的保护和居民的生活质量。因此&#xff0c;了解小区生活污水处理所需要的设备和工艺是至关重要的。 首先&#xff0c;在小区生活污水处理中&#xff0c;需要用到的设备包括污水收集系统、初级沉淀…...

【高性能计算】Cpp + Eigen + Intel MKL + 函数写成传引用

CUDA加速原理:CUDA编程学习:自定义Pytorch+cpp/cuda extension 高质量C++进阶[2]:如何让线性代数加速1000倍? 【gcc, cmake, eigen, opencv,ubuntu】三.eigen和mkl安装和使用 Linux下MKL库的安装部署与使用,并利用cmake编译器调用MKL库去提升eigen库的计算速度 Eigen库…...

【教学类-05-02】20231216 (比大小> <=)X-Y之间的比大小88题(补全88格子,有空格分割提示)

作品展示&#xff1a; 背景需求&#xff1a; 1、以前做过一份比大小的题目 【教学类-05-01】20211018 Python VSC 大班 数字比大小&#xff08;&#xff1e; &#xff1c;&#xff09;_vsc比较3位数大小-CSDN博客文章浏览阅读674次。【教学类-05-01】20211018 Python VSC 大班…...

【Spark精讲】Spark与MapReduce对比

目录 对比总结 MapReduce流程 ​编辑 MapTask流程 ReduceTask流程 MapReduce原理 阶段划分 Map shuffle Partition Collector Sort Spill Merge Reduce shuffle Copy Merge Sort 对比总结 Map端读取文件&#xff1a;都是需要通过split概念来进行逻辑切片&…...

SQL错题集3

1.薪水第二多的员工的emp_no以及其对应的薪水salary limit a,b 其中a表示查询数据的起始位置&#xff0c;b表示返回的数量。 &#xff08;MySQL数据库中的记录是从0开始的&#xff09; 注意从0开始 2.员工编号emp_no为10001其自入职以来的薪水salary涨幅值growth 聚合函数不能…...