标准库算法

欢迎访问我的博客首页。

标准库算法

  • 1. 查找对象的算法
  • 2. 其它只读算法
  • 3. 二分搜索算法
  • 4. 写容器元素的算法
  • 5. 划分与排序算法
  • 6. 通用重排操作
  • 7. 排列算法
  • 8. 有序序 列的 集合算法
  • 9. 最 小值和 最大值
  • 10. 数值算法
  • 11. 参考

  Pred 表示返回值为布尔类型的可调用对象。

1. 查找对象的算法


  序列无需有序。

/* 简单查找算法 */
find(beg, end, val)									// 查找指定值。返回迭代器。
find_if(beg , end, unaryPred)						// 查找指定值。返回迭代器。
find_if_not(beg, end, unaryPred)					// 查找指定值。返回迭代器。
count(beg, end, val)								// 统计指定值出现的次数。返回整数。
count_if(beg, end, unaryPred)						// 统计指定值出现的次数。返回整数。
all_of(beg, end, unaryPred)							// 是否全部满足条件。返回布尔。
any_of(beg, end, unaryPred)							// 是否有值满足条件。返回布尔。
none_of(beg, end, unaryPred)						// 是否都不满足条件。返回布尔。
/* 查找重复值的算法 */
adjacent_find(beg, end)								// 第一次出现相邻位置相等的地方。返回迭代器。
adjacent_find(beg, end, binaryPred)					// 第一次出现相邻位置相等的地方。返回迭代器。
search_n(beg, end, count, val)						// 第一次连续出现 count 个 val 的地方。返回迭代器。
search_n(beg, end, count, val, binaryPred)			// 第一次连续出现 count 个 val 的地方。返回迭代器。
/* 查找子序列的算法 */
search(beg1, end1, beg2, end2)						// 第二个序列在第一个序列中,第一次出现的地方。返回迭代器。
search(beg1, end1, beg2, end2, binaryPred)			// 第二个序列在第一个序列中,第一次出现的地方。返回迭代器。
find_first_of(beg1, end1, beg2, end2)				// 第二个序列中任一元素在第一个序列中出现的地方。返回迭代器。
find_first_of(beg1, end1, beg2, end2, binaryPred)	// 第二个序列中任一元素在第一个序列中出现的地方。返回迭代器。
find_end(beg1, end1, beg2, end2)					// 第二个序列在第一个序列中,最后一次出现的地方。返回迭代器。
find_end(beg1, end1, beg2, end2, binaryPred)		// 第二个序列在第一个序列中,最后一次出现的地方。返回迭代器。

  例子。

void test_1() {std::string data1 = "12365478911789";std::string data2 = "789";std::string::iterator it;int n;// find。第一次出现 '7' 的位置:data[6]。it = std::find(data1.begin(), data1.end(), '7');cout << it - data1.begin() << endl;// count。'1' 出现的次数:3。cout << std::count(data1.begin(), data1.end(), '1') << endl;// all_of。所有元素都大于 '0':1。n = std::all_of(data1.begin(), data1.end(), [](char ch) -> bool {return ch > '0';});cout << n << endl;// adjacent_find:第一次出现相邻元素相等的地方:data[9]。it = adjacent_find(data1.begin(), data1.end());cout << it - data1.begin() << endl;// search_n:第一个连续出现 2 个 '1' 的地方:data[9]。it = search_n(data1.begin(), data1.end(), 2, '1', [](char ch1, char ch2) {return ch1 == ch2;});cout << it - data1.begin() << endl;// search。查找子序列:data_sub 在 data1 中第一次出现的地方:a[6]。it = std::search(data1.begin(), data1.end(), data2.begin(), data2.end());cout << it - data1.begin() << endl;// find_first_of。data_sub 的任意一个(不是第一个)元素在 data1 中首次出现的位置:6、7 或 8。it = std::find_first_of(data1.begin(), data1.end(), data2.begin(), data2.end());cout << it - data1.begin() << endl;// find_end。查找子序列:data_sub 在 data1 中最后一次出现的地方:a[11]。it = std::find_end(data1.begin(), data1.end(), data2.begin(), data2.end());cout << it - data1.begin() << endl;
}

2. 其它只读算法


  介绍。

for_each(beg, end, unaryOp)				// 遍历。返回可调用对象。
mismatch(beg1, end1, beg2)				// 两个序列第一次出现不对应相等的地方。返回一对迭代器。
mismatch(beg1, end1, beg2, binaryPred)	// 两个序列第一次出现不对应相等的地方。返回一对迭代器。
equal(beg1, end1, beg2)					// 两个序列是否相等。返回布尔。
equal(beg1, end1, beg2, binaryPred)		// 两个序列是否相等。返回布尔。

  例子。

void test_2() {// for_each。逐个处理元素,如输出、修改。std::string data1 = "12345";std::for_each(data1.begin(), data1.end(), [](char &ch) {ch += 1;});cout << data1 << endl;// mismatch。第一次出现不对应相等的地方。std::string data2_1 = "12345";std::string data2_2 = "12365";std::pair<std::string::iterator, std::string::iterator> it = std::mismatch(data2_1.begin(), data2_1.end(), data2_2.begin());cout << it.first - data2_1.begin() << ", " << it.second - data2_2.begin() << endl;// equal。是否完全与第一个序列一样。cout << std::equal(data2_1.begin(), data2_1.end(), data2_2.begin()) << endl;
}

3. 二分搜索算法


  序列需有序。

lower_bound(beg, end, val)			// 第一个大于等于 val 的位置。返回迭代器。
lower_bound(beg, end, val, comp)	// 第一个大于等于 val 的位置。返回迭代器。
upper_bound(beg, end, val)			// 第一个大于 val 的位置。返回迭代器。
upper_bound(beg, end, val, comp)	// 第一个大于 val 的位置。返回迭代器。
equal_range(beg, end, val)			// 同时求 lower_bound 和 upper_bound。返回一对迭代器。
equal_range(beg, end, val, comp)	// 同时求 lower_bound 和 upper_bound。返回一对迭代器。
binary_search(beg, end, val)		// 是否存在指定值。返回布尔。
binary_search(beg, end, val, comp)	// 是否存在指定值。返回布尔。

  例子。

void test_3() {std::string data = "133556";// lower_bound。第一个大于等于 val 的地方。cout << std::lower_bound(data.begin(), data.end(), '3') - data.begin() << endl; // data[1]。cout << std::lower_bound(data.begin(), data.end(), '4') - data.begin() << endl; // data[3]。cout << std::lower_bound(data.begin(), data.end(), '5') - data.begin() << endl; // data[3]。// upper_bound。第一个大于 val 的地方。cout << std::upper_bound(data.begin(), data.end(), '3') - data.begin() << endl; // data[3]。cout << std::upper_bound(data.begin(), data.end(), '4') - data.begin() << endl; // data[3]。cout << std::upper_bound(data.begin(), data.end(), '5') - data.begin() << endl; // data[5]。// equal_range。同时求 lower_bound 和 upper_bound。std::pair<std::string::iterator, std::string::iterator> it;it = std::equal_range(data.begin(), data.end(), '3');cout << it.first - data.begin() << ", " << it.second - data.begin() << endl; // data[1], data[3]。it = std::equal_range(data.begin(), data.end(), '4');cout << it.first - data.begin() << ", " << it.second - data.begin() << endl; // data[3], data[3]。it = std::equal_range(data.begin(), data.end(), '5');cout << it.first - data.begin() << ", " << it.second - data.begin() << endl; // data[3], data[5]。// binary_search。cout << std::binary_search(data.begin(), data.end(), '3') << endl; // True。cout << std::binary_search(data.begin(), data.end(), '4') << endl; // false。
}

4. 写容器元素的算法


  介绍。

/* 只写不读元素的算法 */
fill(beg, end, val)									// 赋值。返回空。
fill_n(dest, cnt, val)								// 赋值。返回迭代器。
generate(beg, end, Gen)								// 赋值。返回空。
generate_n(dest, cnt, Gen)							// 赋值。返回迭代器。
/* 使用输入迭代器的写算法 */
copy(beg, end, dest)								// 拷贝。
copy_if(beg, end, dest, unaryPred)					// 拷贝。
copy_n(beg, n, dest)								// 拷贝。
move(beg, end, dest)								// 移动。
transform(beg, end, dest, unaryOp)					// 处理、拷贝。
transform(beg, end, beg2, dest, binaryOp)			// 处理、拷贝。
replace_copy(beg, end, dest, old_val, new_val)		// 替换、拷贝。
replace_copy_if(beg, end, dest, unaryPred, new_val)	// 替换、拷贝。
merge(beg1, end1, beg2, end2, dest)					// 合并有序序列得到第三个有序序列。
merge(beg1, end1, beg2, end2, dest, comp)			// 合并有序序列得到第三个有序序列。
/* 使用前向迭代器的写算法 */
iter_swap(iter1, iter2)								// 交换两个序列的一个元素。
swap_ranges(beg1, end1, beg2)						// 交换两个序列的一段元素。
replace(beg, end, old_val, new_val)					// 使用 new_val 替换一段值。
replace_if(beg, end, unaryPred, new_val)
/* 使用双向迭代器的写算法 */
copy_backward(beg, end, dest)						// 向目的序列尾部拷贝。
move_backward(beg, end, dest)						// 向目的序列尾部移动。
inplace_merge(beg, mid, end)						// 对包含两个有序序列的序列排序。
inplace_merge(beg, mid, end, comp)					// 对包含两个有序序列的序列排序。

  例子。

void test_4() {std::string data;std::string::iterator end;data.resize(2);// fillstd::fill(data.begin(), data.end(), '1');cout << data << endl;// fill_nend = std::fill_n(data.begin(), data.size(), '2');assert(end == data.end());cout << data << endl;// generatestd::generate(data.begin(), data.end(), [&]() -> char {return '3';});cout << data << endl;// generate_nend = std::generate_n(data.begin(), data.size(), [&]() -> char {return '4';});assert(end == data.end());cout << data << endl;std::string src = "12345";std::string dest(4, '0');// copy。如果 dest 容量耗尽则停止拷贝。std::copy(src.begin(), src.end(), dest.begin()); // "1234"。cout << dest << endl;// move// transformstd::transform(src.begin(), src.end(), dest.begin(), [](char ch) {return ch + 1;});cout << dest << endl;std::string src2 = "22222";std::transform(src.begin(), src.end(), src2.begin(), dest.begin(), [](char ch1, char ch2) {return ch1 + ch2 - '0';});cout << dest << endl;// replace_copystd::replace_copy(src.begin(), src.end(), dest.begin(), '3', 'z');cout << dest << endl;// replace_copy_ifstd::replace_copy_if(src.begin(),src.end(),dest.begin(),[](char ch) {return ch == '3';},'z');cout << dest << endl;// merge。两个输入序列要么都是升序要么都是降序。std::string data1 = "12468";std::string data2 = "12345";dest.resize(20);std::merge(data1.begin(), data1.end(), data2.begin(), data2.end(), dest.begin());cout << dest << endl;// iter_swap。交换两个迭代器所指元素。std::iter_swap(data1.begin() + 3, data2.end() - 1);cout << data1 << " " << data2 << endl;// swap_rangesstd::string data3 = "123";std::string data4 = "abcdef";std::string::iterator it;it = std::swap_ranges(data3.begin(), data3.end(), data4.begin());assert(it - data4.begin() == data3.size());cout << data3 << ", " << data4 << endl;// replacestd::string data5 = "123456";std::replace(data5.begin(), data5.end(), '3', 'c');cout << data5 << endl;// copy_backwardstd::string data6 = "123";std::string data7(4, 'z');std::copy_backward(data6.begin(), data6.end(), data7.end());cout << data6 << ", " << data7 << endl;// move_backward// inplace_mergestd::string data8 = "135246";std::inplace_merge(data8.begin(), data8.begin() + 3, data8.end(), [](char ch1, char ch2) {return ch1 < ch2;});cout << data8 << endl;
}

5. 划分与排序算法


  介绍。

/* 划分算法 */
is_partitioned(beg, end, unaryPred) // 满足谓词的元素在前,不满足的在后?
partition_copy(beg, end, dest1, dest2, unaryPred)// 分别拷贝满足谓词的元素和不满足的元素。
partition_point(beg, end, unaryPred)// 满足谓词的最后一个元素的尾后迭代器。
stable_parition(beg, end, unaryPred)// 稳定排序:满足谓词的元素在前。
partition(beg, end, unaryPred)// 不稳定排序:满足谓词的元素在前。
/* 排序算法 */
sort(beg, end)
stable_sort(beg, end)
sort(beg, end, comp)
stable_sort(beg, end, comp)
is_sorted(beg, end)
is_sorted(beg, end, comp)
is_sorted_until(beg, end)// 乱序开始的位置。
is_sorted_until(beg, end, comp)// 乱序开始的位置。
partial_sort(beg, mid, end)// 仅排序到 mid。
partial_sort(beg, mid, end, comp)
partial_sort_copy(beg, end, destBeg, destEnd)
partial_sort_copy(beg, end, destBeg, destEnd, comp)
nth_element(beg, nth, end)// 排序,使 nth 前的元素都比它小,后面的都比它大。
nth_element(beg, nth, end, comp)

  例子。

void test_5() {// is_partitionedstd::string data1 = "1342";cout << std::is_partitioned(data1.begin(), data1.end(), [](char ch) {return (ch - '0') % 2 == 1;}) << endl;// partition_copystd::string data2(5, 'a');std::string data3(5, 'b');std::pair<std::string::iterator, std::string::iterator> it =std::partition_copy(data1.begin(), data1.end(), data2.begin(), data3.begin(), [](char ch) {return (ch - '0') % 2 == 1;});assert(it.first - data2.begin() == 2);assert(it.second - data3.begin() == 2);cout << data2 << ", " << data3 << endl;// partition_pointstd::string::iterator it2 = std::partition_point(data1.begin(), data1.end(), [](char ch) {return (ch - '0') % 2 == 1;});assert(it2 - data1.begin() == 2);// stable_partitionstd::string data4 = "12345";it2 = std::stable_partition(data4.begin(), data4.end(), [](char ch) {return (ch - '0') % 2 == 1;});assert(it2 - data4.begin() == 3);cout << data4 << endl;// partition。不保证相对位置不变,比如结果可能是 13524,也可能是 31542 等。std::string data5 = "12345";it2 = std::stable_partition(data5.begin(), data5.end(), [](char ch) {return (ch - '0') % 2 == 1;});assert(it2 - data5.begin() == 3);cout << data5 << endl;// sort// is_sorted_until。第一个有序序列的长度。std::string data6 = "zabc";it2 = std::is_sorted_until(data6.begin(), data6.end());assert(it2 - data6.begin() == 1);// partial_sort。找出最小的 3 个元素放到开头,后面的元素相对位置可能会被打乱。std::string data7 = "abxyzcghds";std::partial_sort(data7.begin(), data7.begin() + 3, data7.end());cout << data7 << endl;// partial_sort_copy。根据目标容器的容量按元素大小顺序拷贝过去,原容器内的元素不变。std::string data8 = "abxyzcghds";std::string data9;data9.resize(3);std::partial_sort_copy(data8.begin(), data8.end(), data9.begin(), data9.end());cout << data8 << ", " << data9 << endl;// nth_element。a[2] 前面的元素都比 a[2] 小,后面的元素都比 a[2] 大。std::string data10 = "7036281549";std::nth_element(data10.begin(), data10.begin() + 2, data10.end());cout << data10 << endl;
}

6. 通用重排操作


  介绍。

/* 使用前向迭代器的重排算法 */
remove(beg, end, val)
remove_if(beg, end, unaryPred)
remove_copy(beg, end, dest, val)
remove_copy_if(beg, end, dest, unaryPred)
unique(beg, end)
unique(beg, end, binaryPred)
unique_copy(beg, end, dest)
unique_copy_if(beg, end, dest, binaryPred)
rotate(beg, mid, end)
rotate_copy(beg, mid, end, dest)
/* 使用双向迭代器的重排算法 */
reverse(beg, end)
reverse_copy(beg, end, dest)
/* 使用随机访问迭代器的重排算法 */
random_shuffle(beg, end)
random_shuffle(beg, end, rand)
shuffle(beg, end, Uniform_rand)

  例子。

void test_6() {std::string::iterator it;// removestd::string data1 = "121345";it = std::remove(data1.begin(), data1.end(), '1');cout << data1 << ", " << it - data1.begin() << endl;// remove_copystd::string data2 = "121345";std::string dest2;dest2.resize(10);it = std::remove_copy(data2.begin(), data2.end(), dest2.begin(), '1');assert(it - dest2.begin() == 4);cout << dest2 << endl;// unique。仅处理相邻且相等的元素。std::string data3 = "144422355";it = std::unique(data3.begin(), data3.end());assert(it - data3.begin() == 5);cout << it - data3.begin() << endl;cout << data3 << endl;// rotatestd::string data4 = "987a123";it = std::rotate(data4.begin(), data4.begin() + 3, data4.end());cout << data4 << ", " << it - data4.begin() << endl;// reversestd::string data5 = "123";std::reverse(data5.begin(), data5.end());cout << data5 << endl;// random_shufflestd::string data6 = "123";srand((unsigned)time(NULL));std::random_shuffle(data6.begin(), data6.end());cout << data6 << endl;// shufflestd::string data7 = "123";std::shuffle(data7.begin(), data7.end(), std::random_device());cout << data7 << endl;
}

7. 排列算法


  介绍。

is_permutation(beg1, end1, beg2)
is_permutation(beg1, end1, beg2), binaryPred)
next_permutation(beg, end)
next_permutation(beg, end, comp)
prev_permutation(beg, end)
prev_permutation(beg, end, comp)

  例子。


void test_7() {// is_permutationstd::string data1_1 = "123";std::string data1_2 = "213";cout << std::is_permutation(data1_1.begin(), data1_1.end(), data1_2.begin()) << endl;// next_permutationcout << std::next_permutation(data1_1.begin(), data1_1.end()) << ", " << data1_1 << endl;cout << std::prev_permutation(data1_1.begin(), data1_1.end()) << ", " << data1_1 << endl;
}

8. 有序序 列的 集合算法


  介绍。

includes(beg, end, beg2 , end2)
includes(beg, end, beg2, end2, comp)
set_union(beg, end, beg2, end2, dest)
set_union(beg, end, beg2, end2, dest, comp)
set_intersection(beg, end, beg2, end2, dest)
set_intersection(beg, end, beg2, end2, dest, comp)
set_difference(beg, end, beg2, end2, dest)
set_difference(beg, end, beg2, end2, dest, comp)
set_symmetric_difference(beg, end, beg2, end2, dest)
set_symmetric_difference(beg, end, beg2, end2, dest, comp)

  例子。

// 必须有序。
void test_8() {// includestd::string data1_1 = "123456";std::string data1_2 = "15";cout << std::includes(data1_1.begin(), data1_1.end(), data1_2.begin(), data1_2.end()) << endl;// set_union。求交集。std::string data2_1 = "0134679";std::string data2_2 = "125689";std::string dest2;dest2.resize(10);std::set_union(data2_1.begin(), data2_1.end(), data2_2.begin(), data2_2.end(), dest2.begin());cout << dest2 << endl;// set_intersection。求并集。std::string dest3;dest3.resize(10);std::set_intersection(data2_1.begin(), data2_1.end(), data2_2.begin(), data2_2.end(), dest3.begin());cout << dest3 << endl;// set_difference。差集。// set_symmetric_difference。
}

9. 最 小值和 最大值


  介绍。

min(val1, val2)
min(val1, val2, comp)
min(init_list)
min(init_list, comp)
max(val1, val2)
max(val1, val2, comp)
max(init_list)
max(init_list, comp)
minmax(val1, val2)
minnmax(val1, val2, comp)
minmax(init_list)
minmax(init list, comp)
min_element(beg, end)
min_element(beg, end, comp)
max_element(beg, end)
max_element(beg, end, comp)
minmax_element(beg, end)
minmax_element(beg, end, comp)
/* 字典序比较 */
lexicographical_compare(beg1, end1, beg2, end2)
lexicographical_compare(beg1, end1, beg2, end2, comp)

  例子。

void test_9() {// minstd::string data1 = "102";char ch = std::min({'1', '0', '2'});cout << ch << endl;// lexicographical_comparestd::string data2_1 = "012";std::string data2_2 = "001";cout << std::lexicographical_compare(data2_1.begin(), data2_1.end(), data2_2.begin(), data2_2.end()) << endl;
}

10. 数值算法


  介绍。

accumulate(beg, end, init)
accumulate(beg, end, init, binaryOp)
inner_product(beg1, end1, beg2, init)
inner_product(beg1, end1, beg2, init, binOp1, binOp2)
partial_sum(beg, end, dest)
partial_sum(beg, end, dest, binaryOp)
adjacent_difference(beg, end, dest)
adjacent_difference(beg, end, dest, binaryOp)
iota(beg, end, val)

  例子。

void test_10() {// accumulatestd::vector<int> data1 = {1, 2, 3};cout << std::accumulate(data1.begin(), data1.end(), 100, [](int a, int b) {return a + b;}) << endl;// inner_product// partial_sumstd::vector<int> dest3;dest3.resize(10);std::partial_sum(data1.begin(), data1.end(), dest3.begin());print(dest3);// adjacent_differencestd::adjacent_difference(data1.begin(), data1.end(), dest3.begin());print(dest3);// iotastd::iota(data1.begin(), data1.end(), 0);print(data1);
}

11. 参考


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/15095.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Python序列的概念与使用-课后作业[python123题库]

序列的概念与使用-课后作业 一、单项选择题 1、关于Python组合数据类型&#xff0c;以下描述错误的是&#xff1a;‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬…

Flutter 中的 DecoratedBox 小部件:全面指南

Flutter 中的 DecoratedBox 小部件&#xff1a;全面指南 在Flutter中&#xff0c;DecoratedBox是一个功能丰富的小部件&#xff0c;它为子组件提供了多种装饰效果&#xff0c;如背景色、边框和阴影。通过DecoratedBox&#xff0c;你可以轻松地为任何小部件添加装饰&#xff0c…

PLSQL连接Linux Oracle21c

PLSQL连接Linux Oracle21c 一、安装PLsql 下载官网 https://www.allroundautomations.com/registered-plsqldev/ 二、Oracle Instant Client下载 使用plsql连接oracle的时候是需要本地先安装oracle客户端&#xff0c;英文名就是Oracle Instant Client。 官方下载地址&…

初出茅庐的小李博客之用MQTT.fx软件进行消息发布与订阅【 基于EMQX Cloud】

MQTT.fx软件使用简单介绍 MQTT.fx 的软件界面如下图所示&#xff0c;最上方为 MQTT Broker 连接地址栏&#xff0c;及其连接配置。其下方功能 Tabs 含有 Publish 发布栏、Subscribe 订阅栏、Scripts 脚本栏、Broker Status 状态消息栏、Log 日志信息控制栏。 连接之前要明确几…

【Linux系列】软链接使用

&#x1f49d;&#x1f49d;&#x1f49d;欢迎来到我的博客&#xff0c;很高兴能够在这里和您见面&#xff01;希望您在这里可以感受到一份轻松愉快的氛围&#xff0c;不仅可以获得有趣的内容和知识&#xff0c;也可以畅所欲言、分享您的想法和见解。 推荐:kwan 的首页,持续学…

深入编程逻辑:从分支到循环的奥秘

新书上架~&#x1f447;全国包邮奥~ python实用小工具开发教程http://pythontoolsteach.com/3 欢迎关注我&#x1f446;&#xff0c;收藏下次不迷路┗|&#xff40;O′|┛ 嗷~~ 目录 一、编程逻辑的基石&#xff1a;分支与循环 分支逻辑详解 代码案例&#xff1a;判断整数是…

函数的拓展

7.1.1 基本用法 在ES6之前&#xff0c;不能直接为函数的参数指定默认值&#xff0c;只能采用变通的方法。 function log(x.y){ y y || Worldl console.log(x,y); }log(hello) //hello World log(hello,Chine) //hello Chine log(hello,) //hello World上面的代码检查函数…

UE5 双手握剑的实现(逆向运动学IK)

UE5 双手握剑的实现 IK 前言 什么是IK&#xff1f; UE官方给我们提供了很多对于IK处理的节点&#xff0c;比如ABRIK、Two Bone IK、Full Body IK 、CCD IK等&#xff0c;但是看到这&#xff0c;很多人就好奇了&#xff0c;什么是IK&#xff1f; 首先我们来看看虚幻小白人的骨…

[图解]产品经理创新之阿布思考法

0 00:00:00,000 --> 00:00:01,900 那刚才我们讲到了 1 00:00:02,730 --> 00:00:03,746 业务序列图 2 00:00:03,746 --> 00:00:04,560 然后怎么 3 00:00:05,530 --> 00:00:06,963 画现状&#xff0c;怎么改进 4 00:00:06,963 --> 00:00:09,012 然后改进的模式…

【Spring Security + OAuth2】授权

Spring Security OAuth2 第一章 Spring Security 快速入门 第二章 Spring Security 自定义配置 第三章 Spring Security 前后端分离配置 第四章 Spring Security 身份认证 第五章 Spring Security 授权 第六章 OAuth2 文章目录 Spring Security OAuth21、基于request的授权1…

一条命令安装Metasploit Framework

做安全渗透的人都或多或少的使用kali-Linux系统中msfconsole命令启动工具&#xff0c;然而也经常会有人遇到这样那样的问题无法启动 今天我们就用一条命令来重新安装这个工具 curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/met…

AI学习AI知识路线

数学基础 一、数据分析 二、概率论 三、线性代数及矩阵 l 数学基础 1)常数e2)导数3)梯度 4)Taylor5)gini系数6)信息熵与组合数 1)概率论基础2)古典模型3)常见概率分布 4)大数定理和中心极限定理5)协方差(矩阵)和相关系数 6)最大似然估计和最大后验估计 1)线性空间及线性变…

Windows内核--内存区对象(Section Object)(5.2)

内存区对象 Section Object表示可以共享的内存段。进程可以使用Section与其他进程共享其部分内存地址空间. Section还可为进程提供将文件映射到其内存地址空间的机制。 Linux有mmap与之类似。 参考: Section Objects and Views 内存区对象是虚拟描述符表VAD节点的一种 VAD树节点…

LabVIEW如何确保自动化设备的稳定性和可靠性?

为了确保LabVIEW在自动化设备中的稳定性和可靠性&#xff0c;可以采取以下关键措施&#xff1a; 1. 代码架构与设计 模块化设计&#xff1a;将程序分解为独立的模块或子VI&#xff0c;每个模块负责特定功能&#xff0c;便于测试和维护。状态机架构&#xff1a;使用状态机架构…

zookeeper选主之LeaderLatch

概述 利用zookeeper来进行选主&#xff0c;可以使用apache curator framework&#xff0c;它给我们封装了两种选主工具&#xff0c;它们分别是LeaderSelector和LeaderLatch。它们各自的应用场景不一样&#xff0c;LeaderSelector应用于那些需要频繁变主的情况&#xff0c;而Le…

Redis机制-Redis互斥锁、分布式锁

目录 一 互斥锁 二 分布式锁 Redis实现分布式锁 redisson实现分布式锁 可重入性&#xff1a; 主从一致性&#xff08;性能差&#xff09;&#xff1a; 一 互斥锁 假设我们现在有一个业务要实现秒杀优惠券的功能&#xff0c;如果是一个正常的流程&#xff0c;线程之间应该…

数据结构中链表的题目

题目&#xff1a; 设计一个算法&#xff0c;要求将链表中所有节点的链接方向“原地”逆转&#xff0c;即要求仅利用原表的存储空间。 对于这个问题&#xff0c;首先要分析的是&#xff1a;链表中的头和尾节点如何插入&#xff1f;其次就是&#xff1a;如何链接&#xff1f; 搞懂…

阅读笔记——《未知协议状态机推断技术研究综述》

【参考文献】盛嘉杰, 牛胜杰, 陈阳, 等. 未知协议状态机推断技术研究综述[J]. 计算机与现代化, 2023 (05): 58.【注】本文仅为作者个人学习笔记&#xff0c;如有冒犯&#xff0c;请联系作者删除。 摘要 协议逆向工程&#xff08;PRE&#xff09;描述了协议的行为逻辑&#xff…

spring cloud config server源码学习(一)

文章目录 1. 注解EnableConfigServer2. ConfigServerAutoConfiguration2.1 ConditionalOnBean和ConditionalOnProperty2.2 Import注解2.2.1. EnvironmentRepositoryConfiguration.class2.2.2. CompositeConfiguration.class2.2.3. ResourceRepositoryConfiguration.class2.2.4.…

python3 + selenium webdriver自动化测试启动不同浏览器

selenium webdriver自动化测试启动不同浏览器 selenium webdriver 介绍Selenium WebDriver 进行自动化测试的一般流程浏览器驱动下载浏览器驱动的安装chrome、edge、Firefox、Opera、Safari、phantomjs 应用Headless Chrome 、Headless Firefox 应用 selenium webdriver 介绍 …