C++ Primer(第五版) 17.3.4节练习

S对偶性和N = 2⋆$$ \ mathcal {N} = {2} ^ {\ star} $$的理论(II):非简单带状代数 我们推导了一个由N = 2⋆$$ \ mathcal {N} = {2} ^ {\ star} $$超对称理论的势所满足的模块化异常方程,该非对称理论带有非简单的带节距代数,包括经典B r和 C r无限级数和特殊的F 4和G 2情况。 该方程根据S-对偶群的准模形式递归确定小质量的展开中的精确正势。 我们还讨论了这些理论在S对偶下的行为,并表明SO(2 r +1)理论的正势映射到Sp(2 r)理论的正势,反之亦然,而异常的F 4和G 2 与N = 4 $$ \ mathcal {N} = 4 $$超对称理论发生的情况类似,这些理论被映射到自身(直到根的旋转)。 这些结果扩展了对伴随论文中出现的简单群体的分析。 立即下载

17.24    

#include <iostream>
#include <regex>

using namespace std;

int main()
{
	string phone = 
		"(\\()?(\\d{3})(\\))?([-. ])?(\\d{3})([-. ])?(\\d{4})";
	regex r(phone);
	smatch m;
	string s;
	string fmt = "$2.$5.$7";
	
	while (getline(cin, s))
		cout << regex_replace(s, r, fmt) << endl;
		
	return 0;
}

17.25    

#include <iostream>
#include <regex>
#include <vector>

using namespace std;

int main()
{
	string phone = 
		"(\\()?(\\d{3})(\\))?([-. ])?(\\d{3})([-. ])?(\\d{4})";
	regex r(phone);
	string s;
	string fmt = "$2.$5.$7";
	
	while (getline(cin, s)) {	
		s = regex_replace(s, r, fmt);
		sregex_iterator it(s.begin(), s.end(), r);
		cout << it->str() << endl;
	}
		
	return 0;
}

17.26

#include <iostream>
#include <regex>

using namespace std;

int main()
{
	string phone = 
		"(\\()?(\\d{3})(\\))?([-. ])?(\\d{3})([-. ])?(\\d{4})";
	regex r(phone);
	smatch m;
	string s;
	string fmt = "$2.$5.$7";
	
	while (getline(cin, s)) {	
		s = regex_replace(s, r, fmt);
		sregex_iterator it(s.begin(), s.end(), r), end_it;
		auto beg = it;
		
		if (beg == end_it) {
			cout << "no match" << endl;
			continue;
		}
		
		if (++beg == end_it)
			cout << it->str() << endl;	
		else {
			while (beg != end_it) {
				cout << beg->str() << endl;	
				++beg;
			}
				
		}	
	}
		
	return 0;
}

17.27    

#include <iostream>
#include <regex>

using namespace std;

int main()
{
	string pattern = "(\\d{5})([-])?(\\d{4})";	
	regex r(pattern);
	
	string s;
	string fmt = "$1-$3";
	
	while (getline(cin, s)) 
		cout << regex_replace(s, r, fmt) << endl;
		
	return 0;
}

 

里海NX二次开发3000例-专栏目录 UDO(User Defined Object)是“用户自定义对象”。应用非常广,可以用UDO创建自定义特征,也可以对NX原有的特征添加一些特殊信息,这些信息会保存在部件中,以后可以查询。还可以实时追踪NX对象,例如做3D包容盒线框自动追踪实体,做2D矩形框自动追踪图纸尺寸值,这些在下面的例子都有介绍。读者可以自己编译下面的例子,体会理解UDO的用法。------里海 20230512序号内容​链接01使用UDO在所有实体上设置更新回调​链接02使用UDO生成跟踪实体的线框​链接03删除UDO​链接。 阅读详情

相关推荐

ArcGIS新手必看:用Landsat 8数据计算植被覆盖度的完整流程(附DEM裁剪技巧)

本文为ArcGIS新手提供了使用Landsat 8数据计算植被覆盖度的完整流程指南。详细讲解了从数据预处理、NDVI计算到基于像元二分模型反演植被覆盖度的核心步骤,并重点分享了利用DEM进行精确裁剪的实用技巧,帮助用户高效完成地表信息提取与分析。

weixin_29279047的博客 246

C++ Primer 第五版 第十七章 练习题编程题目答案

https://github.com/jzplp/Cpp-Primer-Answer 练习17.117.1 程序代码 练习17.217.2 程序代码 练习17.3 TextQuery类 仅本题使用 Query和继承类 仅本题使用 QueryResult类更改为tuple类型17.3 TextQuery.h程序代码17.3 TextQuery.cpp程序代码17.3 Query.h程序代码17.3 Query.cpp程序代码17.3 测试程序代码 我认为QueryResult

Coding home - 漂流瓶jz 936

WPF实战:利用Live Charts实现高性能动态曲线可视化

本文详细介绍了如何在WPF中使用Live Charts实现高性能动态曲线可视化,特别适用于工业监控和金融分析等实时数据场景。通过增量渲染、内存复用和硬件加速等核心技术,Live Charts能够高效处理高频数据更新,显著提升图表流畅度。文章提供了从基础实现到工业级优化的完整解决方案,帮助开发者应对各种性能挑战。

weixin_29189373的博客 417

C++ //练习 17.24 编写你自己版本的重排电话号码格式的程序。

【代码】C++ //练习 17.24 编写你自己版本的重排电话号码格式的程序。

Made in Code 285

避坑指南:Allegro 17.2更新封装时遇到的5个典型问题及解决方案(含Symbol报错处理)

本文深度解析Allegro 17.2封装更新过程中的核心机制与常见陷阱。针对“Update Symbols”功能失效、焊盘不匹配、DRC报错、图形层叠错误等5大典型问题,提供从原理分析到实战解决方案的完整指南,帮助用户实现从“更新失败”到“丝滑替换”的平稳过渡。

tgb34567890的博客 1050

学习心得——COMSOL Multiphysics with MATLAB联合仿真及寻优计算

学习心得——COMSOL Multiphysics with MATLAB联合仿真及寻优计算

weixin_41678956的博客 8670

c++ primer中文版第五版作业第十七章

没看懂意思,如果只是单纯要排除某些指定的单词的话,在匹配之后输出之前判断一下这个单词是否是要排除的那些单词之一即可,但这并不是一个好办法。一行的长度超过传递给getline的字符数组的大小时,会导致输入流的条件状态被置为错误,导致后续读入失败。如果使用[^c]ei进行初始化,那么此模式只能匹配首字母不是c的三个字母组成的单词,其余单词都不能匹配。如果循环内定义b、e,那么每步循环都会创建一个新引擎及分布对象,从而每步循环都会生成相同的值。版本稍微复杂一点,自己定义一个类的版本更自由。

fuluoyide312的博客 1243

Keil5安装包别乱下!手把手教你从官网精准下载C51/V960和MDK5,并完成2032年有效注册(避坑网络资源失效)

本文详细介绍了如何从Keil官网安全下载C51 V9.60和MDK5开发环境,并提供2032年有效注册的完整指南。通过验证安装包完整性、自定义安装路径和长期激活方案,帮助开发者避开网络资源陷阱,搭建稳定的STM32开发环境。

weixin_26886855的博客 549

昨天内部haskell freetalk的ppt和源码

本次交流主要围绕haskell在windows/yBSD上的安装、语言特性、利用单子对象封 装副作用、文本解析库parsec、多核处理器并行计算支持、与C程序静态联编等方 面展开,并形成了一定的产出,代码也放入了上述zip包中。我没有找到粘贴zip附件的功能,所以uuencode贴在下面了。用uudecode解开即可。begin 644 20070329_haskell_freetalk.zipM

st_monad的专栏 4万+

内存越界一定会导致程序崩溃吗?详解内存越界

本文详细解释了内存越界不一定导致内存越界的问题,全面介绍了C++内存越界的相关内容。

dvlinker的技术专栏 2万+

终于找到两个稳定好用的Docker镜像加速源,拉取速度提升几十倍!

国内使用Docker经常遇到镜像拉取慢、超时失败的问题🐳 本文分享两个亲测好用的免费镜像加速源⚡ 实测拉取速度从十几分钟缩短到几十秒,稳定性接近100%📊 支持一键配置脚本,支持多平台使用✨

XiaoqiangClub的博客 970

kvo,kvc

KVO,即:Key-Value Observing  建立在 KVC 之上,它能够观察一个对象的 KVC key path 值的变化,它提供一种机制,当指定的对象的属性被修改后,则对象就会接受到通知。简单的说就是每次指定的被观察的对象的属性被修改后,KVO就会自动通知相应的观察者了。 KVC,即是指 NSKeyValueCoding,一个非正式的 Protocol,提供一种机制来

KimmyKin的博客 430

【异常】Nacos 2.x 核心报错:Server check fail (gRPC 端口连不通) 排查指南 Server check fail, please check server xxx-

Nacos 2.x 的 gRPC 升级大幅提升了推送效率,但也对网络基础设施提出了更高要求。遇到。

奶爸的编程之路,也就一周冷个三天 369

C++Primer中文版第五版答案全集

本文章会持续更新c++primer第五版中的所有答案,如果文章中内容有错误或者不合适的地方,欢迎各位读者留言不吝赐教!

qq130106486的博客 1万+

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain&#39;s apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath(&#39;DeepLearnToolbox&#39;));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand(&#39;state&#39;,0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = &#39;sigm&#39;;%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, &#39;Too big error&#39;);```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, &#39;Too big error&#39;);```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

C++ primer (中文版-第五版 )练习题答案

本人为跨考计算机研究生的一名学生,复试考C++。之前学过一点C,想利用自己时间系统的学一遍C++为之后打基础,再看《C++ primer》同时想利用课后习题练习下,特此写下这篇博客。若有错误不足之处请多指教,谢谢。

weixin_43576804的博客 4698

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

C++ Primer(第五版) 2.4--2.5.3节练习

2.26 (a)错误,const对象必须初始化; (d)错误,const对象的值不能再改变。 2.27 (a)错误,非常量引用不能绑定到字面值; (b)合法; (c)合法,常量引用可以绑定字面值; (d)合法,p3指向的值和自身都不能改变; (e)合法; ...

wlli1985的博客 593

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

C++ Primer(第五版) 3.5.4--3.6节练习

3.37 输出结果是hello,每个字符占一行。 3.38 指针的值只是所指对象的内存地址,将两个地址值相加没有意义。 3.39 #include <iostream> #include <cstring> #include <string> using namespace std; int main() { string s1...

wlli1985的博客 496

C++ Primer(第五版) 6.7节练习

C++ Primer(第五版) 6.7节练习

阿木寺的博客 1330

C++ Primer(第五版)3.3.1--3.4.1节练习

3.12 (a)正确;(b)错误,元素类型不匹配;(c)正确。 3.13 (a)元素数量0;(b)元素数量10,每个都为0;(c)元素数量10,每个都为42;(d)元素数量1,值为10; (e)元素数量2,值为10和42;(f)元素数量10,都为空串;(g)元素数量10,每个字符串都为"hi"。 3.14 #include <iostream...

wlli1985的博客 447

C++ primer(第五版) 练习 3.21 个人code

 C++ primer(第五版) 练习 3.21 题目:

jierandefeng的专栏 791

C++ Primer(第五版)6.3.2--6.4节练习

6.30 1)for循环中的return没有返回值,编译器报错; 2)for循环之后没有return语句,编译器无法发现这一错误。 6.31 当引用绑定的是函数的局部变量时,返回的引用或常量引用都是无效的。 6.32 合法。功能是把数组按照其索引号赋值。get函数接受一个数组指针和索引号为参数,返回数组该元素的引用,然后在main函数的for循环中赋值。...

wlli1985的博客 578

C++ Primer(第五版)7.1.4节练习

7.11 添加构造函数 struct Sales_data { Sales_data()= default; Sales_data(const string &s): bookNo(s) { } Sales_data(const string &s, unsigned n, double p): bookNo(s), units_sold(n), reve...

wlli1985的博客 419

C++ Primer(第五版) 4.5--4.8节练习

4.17 前置版本:先将运算对象加1,将改变后的对象作为求值结果;后置版本:将运算对象加1,但求值结果是运算对象改变之前的那个值的副本。 4.18 使用前置,pbeg先加1,再解引用,无法输出第一个元素,而且最后会越界。 4.19 (a)先判定ptr是否有效,有效则判定ptr指向的值是否为0,并递增ptr; (b)先判定ival是否为0,非0则继续检查(...

wlli1985的博客 317

C++ primer第五版 7.1.3节练习

定义Sales_data的头文件 #ifndef CH6_H_INCLUDED #define CH6_H_INCLUDED #include #include using namespace std; struct Sales_data{ string isbn() const { return bookNo; } Sales_data& Combine(const Sales_da

DLililiDengDaa~~ 452

C++Primer第五版 习题答案

【第一章】:https://blog.csdn.net/Dust_Evc/article/details/114280415?spm=1001.2014.3001.5502 【第二章】: 【第三章】:https://blog.csdn.net/Dust_Evc/article/details/114159821?spm=1001.2014.3001.5502 【第四章】: 【第五章】: 【第六章】:https://blog.csdn.net/Dust_Evc/article/details/114

欢迎关注,共同进步! 2940

C++ primer 第五版 中文版 9.3.3 节练习

C++ primer 第五版 中文版 9.3.3 节练习 练习 9.25:对于t

jierandefeng的专栏 1140
上一篇: C++ Primer(第五版) 17.3.3节练习
下一篇: C++ Primer(第五版) 17.4.1--17.4.2节练习
龙心雕虫
博客等级 码龄17年 25粉丝 125原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值