Web Services--gSOAP 2.7.6 第七章(7.2.1)

Claude Code 实战指南:从入门到高效编程 本文是一份Claude Code实战指南,旨在帮助开发者从入门到精通这款AI编程助手。文章详细讲解了如何通过清晰的指令公式与Claude Code高效沟通,并展示了如何将其深度集成到日常开发工作流中,例如理解陌生代码、调试和生成测试文档。指南还提供了避坑建议与最佳实践,并通过构建一个天气查询CLI工具的完整案例,演示了如何利用Claude Code加速开发进程,实现从设计到代码的高效人机协作。 阅读详情

本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如有版权争议,请联系QQ:643166601,本人会及处理。翻译新手,有错是必然的,求高人指点。欢迎同为新手的你共同学习。

 

7.2.1 Example

7.2.1 例子

The following example specifies three remote methods to be implemented by a new SOAP Web service:

下面的例子指定三个远程方法通过一个新的SOAP Web service实现:

 

// Contents of file ”calc.h”:

typedef double xsd__double;

int ns__add(xsd__double a, xsd__double b, xsd__double &result);

int ns__sub(xsd__double a, xsd__double b, xsd__double &result);

int ns__sqrt(xsd__double a, xsd__double &result);

 

The add and sub methods are intended to add and subtract two double floating point numbers stored in input parameters a and b and should return the result of the operation in the result output parameter. 

这个add和sub方法是打算去加和减两个浮点数,输入参数a和b将返回操作结果在result输出参数中。

The qsrt method is intended to take the square root of input parameter a and to return the result in the output parameter result. 

这个sqrt方法是打算获得输入参数a的平方根和返回操作结果在输出参数result中。

The xsd__double type is recognized by the gSOAP compiler as the xsd:double XSD Schema data type. 

这个xsd__double类型被gSOAP编译识别为XSD数据类型的xsd:double。

The use of typedef is a convenient way to associate primitive C types with primitive XML Schema data types.

使用typedef是一种方便的方法去关联原始C类型和原始XML Schema数据类型。

To generate the skeleton routines, the gSOAP compiler is invoked from the command line with:

去生成skeleton程序,这个gSOAP编译器被调用在命令行中:

 

soapcpp2 calc.h

 

 

The compiler generates the skeleton routines for the add, sub, and sqrt remote methods specified in the calc.h header file. 

这个编译器成skeletona程序,在calc.h头文件中指定用于add,sub,和sqrt的远程方法。

The skeleton routines are respectively, soap_serve_ns__add, soap_serve_ns__sub, and soap_serve_ns__sqrt and saved in the file soapServer.cpp. 

这个skeleton程序是分别是soap_serve_ns__add,soap_serve_ns__sub和soap_serve_ns__sqrt被保存在soapServer.cpp文件中。

The generated file soapC.cpp contains serializers and deserializers for the skeleton. 

这个生成的soapC.cpp 文件包含序列化和反序列化的skeleton。

The compiler also generates a service dispatcher:

这个编译器也生成一个服务调度:

the soap_serve function handles client requests on the standard input stream and dispatches the remote method requests to the appropriate skeletons to serve the requests. 

这个soap_serve函数处理标准的输入流的客户端请求和调度远程方法请求到适当的skeleton的服务请求。

The skeleton in turn calls the remote method implementation function. 

这个skeleton在返回远程方法实现功能。

The function prototype of the remote method implementation function is specified in the header file that is input to the gSOAP compiler.

这个远程方法函数原型实现的功能是指定输入头文件到gSOAP编译器。

 

Here is an example Calculator service application that uses the generated soap_serve routine to handle client requests:

这里是一个例子计算服务程序,使用生成的soap_serve程序去处理客户端请求:

 

// Contents of file ”calc.cpp”:

#include ”soapH.h”

#include <math.h> // for sqrt()

main()

{

soap_serve(soap_new()); // use the remote method request dispatcher

}

// Implementation of the ”add” remote method:

int ns__add(struct soap *soap, double a, double b, double &result)

{

result = a + b;

return SOAP_OK;

}

// Implementation of the ”sub” remote method:

int ns__sub(struct soap *soap, double a, double b, double &result)

{

result = a - b;

return SOAP_OK;

}

// Implementation of the ”sqrt” remote method:

int ns__sqrt(struct soap *soap, double a, double &result)

{

if (a >= 0)

{

result = sqrt(a);

return SOAP_OK;

}

else

return soap_receiver_fault(soap, ”Square root of negative number”, ”I can only take the square

root of a non-negative number”);

}

// As always, a namespace mapping table is needed:

struct Namespace namespaces[] =

{ // {”ns-prefix”, ”ns-name”}

{”SOAP-ENV”, ”http://schemas.xmlsoap.org/soap/envelope/”},

{”SOAP-ENC”, ”http://schemas.xmlsoap.org/soap/encoding/”},

{”xsi”, ”http://www.w3.org/2001/XMLSchema-instance”},

{”xsd”, ”http://www.w3.org/2001/XMLSchema”},

{”ns”, ”urn:simple-calc”}, // bind ”ns” namespace prefix

{NULL, NULL}

};

 

Note that the remote methods have an extra input parameter which is a pointer to the gSOAP runtime environment. 

注意这个远程方法有一个额外的输入参数,它是一个指针指向gSOAP运行时环境。

The implementation of the remote methods MUST return a SOAP error code. 

这个远程方法必须实现返回一个SOAP error代码。

The code SOAP_OK denotes success, while SOAP_FAULT denotes an exception with details that can be defined by the user. 

这个代码SOAP_OK表示成,然而SOAP_FALT表示异常,可以被用户定义详细。

The exception description can be assigned to the soap->fault->faultstring string and details can be assigned to the soap->fault->detail string. 

这个异常描述可以是赋值到soap->fault->faultstring字符串和详细可以是赋值到soap->fault->detail字符串。

This is SOAP 1.1 specific. 

这是SOAP 1.1明确的。

SOAP 1.2 requires the soap->fault->SOAP_ENV__Reason and the soap->fault->SOAP_ENV__Detail strings to be assigned. 

SOAP 1.2要求赋值到soap->fault->SOAP_ENV__Reason和soap->fault->SOAP_ENV__Detail字符串。

Better is to use the soap_receiver_fault function that allocates a fault struct and sets the SOAP Fault string and details regardless of the SOAP 1.1 or SOAP 1.2 version used. 

更好方法是使用soap_receiver_fault函数,分配一个fault结构体和设置SOAP错误字符串和详细的不管SOAP 1.1或 SOAP 1.2版本都能用。

The soap_receiver_fault function returns SOAP_FAULT, i.e. an application-specific fault. 

这个soap_receiver_fault函数返回SOAP_FAULT,即一个应用程序特定的错误。

The fault exception will be passed on to the client of this service.

这个错误异常将传递到客户端的服务。

This service application can be readily installed as a CGI application. 

这个服务应用程序可以容易地安装一个CGI程序。

The service description would be:

这个服务描述将是:

 

Endpoint URL: the URL of the CGI application

SOAP action: ”” (2 quotes)

Remote method namespace: urn:simple-calc

Remote method name: add

Input parameters: a of type xsd:double and b of type xsd:double

Output parameter: result of type xsd:double

Remote method name: sub

Input parameters: a of type xsd:double and b of type xsd:double

Output parameter: result of type xsd:double

Remote method name: sqrt

Input parameter: a of type xsd:double

Output parameter: result of type xsd:double or a SOAP Fault

 

The soapcpp2 compile generates a WSDL file for this service, see Section 7.2.8.

这个soapcpp2编译器生成这个服务的一个WSDL文件,请看7.2.8部分。

Unless the CGI application inspects and checks the environment variable SOAPAction which contains the SOAP action request by a client, the SOAP action is ignored by the CGI application. 

除非这个CGI应用程序检查和检查这个环境变量SOAPAction,包含一个客户端的SOAP动作请求,这个SOAP动作是被CGI应用程序忽略。

SOAP actions are specific to the SOAP protocol and provide a means for routing requests and for security reasons (e.g. firewall software can inspect SOAP action headers to grant or deny the SOAP request. Note that this requires the SOAP service to check the SOAP action header as well to match it with the remote method.)

SOAP动作是特定的SOAP协议和提供按某路线发送的请求的安全理由(例如,防火墙软件可以检查SOAP动作头文件授权或据金额SOAP请求。注意这需要SOAP服务去检查SOAP动作头文件还有匹配它的远程方法。)

The header file input to the gSOAP compiler does not need to be modified to generate client stubs for accessing this service. 

这个头文件输入到gSOAP编译器不需要修改去生成访问这个服务的客户端stubs。

Client applications can be developed by using the same header file as for which the service application was developed. 

作为这个服务应用程序的开发,客户端应用程序可以使用相同的头文件开发。

For example, the soap_call_ns__add stub routine is available from the soapClient.cpp file after invoking the gSOAP compiler on the calc.h header file. 

例如,这个soap_call_ns__add stub程序是可用soapClient.cpp文件在之后调用gSOAP编译器的calc.h头文件。

As a result, client and service applications can be developed without the need to know the details of the SOAP encoding used.

其结果是,客户端和服务端应用程序可以开发不需要知道详细的SOAP使用的编码。

PaddleOCR PP-OCRv5实战:5分钟搞定身份证信息提取(附完整代码) 本文详细介绍了如何利用PaddleOCR的PP-OCRv5模型,在5分钟内快速搭建身份证信息提取流程。文章从环境搭建、核心代码实战出发,深入解析了PP-OCRv5针对证件识别的优化特性,并提供了从OCR结果到结构化数据的完整处理方案与避坑指南,帮助开发者高效实现AI驱动的自动化信息提取。 阅读详情

相关推荐

PPPoE上网配置不求人:华为路由器命令行操作指南(2023最新版)

本文提供2023年最新的华为路由器PPPoE上网配置命令行操作指南。通过详细的步骤讲解,从连接设备、创建拨号接口、绑定PPPoE客户端到配置内网与NAT,手把手教你完成配置,并附有验证排错方法,助你轻松实现稳定上网。

s4t5u6v的博客 685

gsoap初始化释放_gSOAP中文文档

1、背景转贴2 gSOAP文档翻译计划2.1 gSOAP文档翻译计划(序)前一阵子需要在unix c平台下创建一个webservice应用。头痛之余,上网查询相关资料,偶然发现了gSOAP开发包。于是乎立即下载试用了一下,效果很好。在它的帮助下,我很快完成了webservice应用的设计开发工作。今天,心里突然升起一个念头:为何不把整个gSOAP的帮助文档翻译一下呢?一来可以方便与其他同仁的交流;...

weixin_34777998的博客 501

unity shader 后处理实现水墨风格渲染「Low Poly 」变「水墨画 」

水墨风格渲染 这次学校的比赛打算做一个中国古代背景的游戏,所以尝试做了水墨风格的渲染。 主要按以下四步来实现的效果: 根据色调和饱和度调整饱和度。 对图像进行模糊 水墨风格的物体边缘 物体内画笔笔触的模拟 接下来我分别就这四步依次展开说明: 调整饱和度 这里我使用Post-Processing Stack 的Color Grading 来调节饱和度,通过使用Grading Curv...

九级铁甲蛹的博客 1万+

Web Services--gSOAP 2.7.6 第七章(7.1.3)

下载地址:http://sourceforge.net/projects/gsoap2 官方网站:http://genivia.com/Products/gsoap/index.html 本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如有版

Coperator 753

解锁医疗AI密码:医疗人工智能专业大学四年学习路径

医疗AI人才培养路径解析 本文系统梳理了医疗人工智能专业四年培养方案,分为基础、进阶、应用和拓展四个阶段: 大一聚焦基础学科,涵盖高等数学、医学概论、Python编程等核心课程,辅以医学数据认知实习。大二深入机器学习和医学数据处理领域,学习监督/无监督学习算法及医学影像分析技术。大三进入深度学习阶段,掌握CNN/RNN等神经网络模型,并实践医疗AI应用开发。大四关注前沿技术如大模型在医疗中的应用,完成毕业设计与企业实习。 课程体系强调医工交叉,每学期均配置实践环节,从基础编程到参与真实医疗AI项目,逐步培养

AllenLV的博客 2509

R语言实战:5分钟搞定GEO单细胞数据(scRNA-seq)下载与整理(附完整代码)

本文详细介绍了如何使用R语言快速下载和整理GEO单细胞数据(scRNA-seq),提供完整的自动化处理代码。从环境准备、数据获取到文件整理和质量检查,涵盖10X Genomics标准格式及非标准数据的处理技巧,帮助生物信息学研究者高效完成数据预处理工作。

weixin_29054399的博客 613

Web Services--gSOAP 2.7.6 第七章(7.1)

下载地址:http://sourceforge.net/projects/gsoap2 官方网站:http://genivia.com/Products/gsoap/index.html 本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如有版

Coperator 786

从拆解到调试:用CS5523改造旧款车载显示屏的完整记录(MIPI转eDP方案)

本文详细记录了使用CS5523芯片将旧款车载显示屏从MIPI接口改造为eDP驱动的完整过程。通过对比LT8911等芯片,选择CS5523实现低功耗、高兼容性的显示升级,涵盖硬件改造、固件配置及调试技巧,最终成功提升显示效果200%。

web99的专栏 346

Web Services--gSOAP 2.7.6 第七章(7.1.2)

下载地址:http://sourceforge.net/projects/gsoap2 官方网站:http://genivia.com/Products/gsoap/index.html 本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如有版

Coperator 732

Windows 24H2升级后eNSP AR_40报错40?VirtualBox虚拟化修复指南

虚拟化技术通过Hypervisor在操作系统与硬件间建立抽象层,使虚拟机能够共享物理资源。其核心原理依赖CPU的VT-x/AMD-V指令集,而Windows 24H2对内核隔离与驱动签名的强化会直接占用或拦截这些虚拟化资源。在工程实践中,VirtualBox作为Type-2型Hypervisor,常因内存完整性开启或版本过旧导致虚拟网卡创建失败,进而引发设备启动中断。典型场景包括网络仿真实验、多系统测试环境搭建等。当eNSP的AR_40路由器依赖VirtualBox引擎时,24H2的安全策略变更便会触发错误

weixin_34375251的博客 220

第2.0章 机器人C++学习开篇(一):SLAM为什么使用C++语言及学习路线资料推荐

ROS(机器人操作系统):机器人领域的“操作系统”,提供节点通信、参数管理、工具链支持,是SLAM算法在机器人上部署的核心框架。PCL(点云库):处理三维点云数据的利器,包含滤波、分割、配准等算法,是激光SLAM的核心依赖。Eigen(矩阵运算库):高效的矩阵与线性代数运算库,SLAM中的位姿变换、优化求解都依赖它。Ceres/G2O(优化库):SLAM后端优化的“王牌”,Ceres擅长通用非线性优化,G2O则专为图优化设计,二者是BA( bundle adjustment)等算法的实现基础。

行知SLAM 1249

Web Services--gSOAP 2.7.6 第七章(7.1.1)

下载地址:http://sourceforge.net/projects/gsoap2 官方网站:http://genivia.com/Products/gsoap/index.html 本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如有版

Coperator 849

点云数据处理:体素滤波算法

体素滤波是一种简单而有效的点云数据处理方法,可用于去除离群点和平滑点云表面。体素滤波是一种常用的点云数据处理算法,用于去除离群点并平滑点云表面。在本文中,我们将介绍CloudCompare和PCL(Point Cloud Library)中的体素滤波算法,并提供相应的源代码示例。PCL是一个专门用于点云处理的开源库,提供了一系列高效的点云处理算法和工具。然后,我们创建了一个。方法执行体素滤波,并将滤波后的点云保存为"filtered_cloud.ply"文件。方法来执行体素滤波,指定体素大小为0.01。

ZyqfCss的博客 391

Web Services--gSOAP 2.7.6 第七章(7.1.5)

下载地址:http://sourceforge.net/projects/gsoap2 官方网站:http://genivia.com/Products/gsoap/index.html 本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如有版

Coperator 660

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

Web Services--gSOAP 2.7.6 第七章(7.1.4)

下载地址:http://sourceforge.net/projects/gsoap2 官方网站:http://genivia.com/Products/gsoap/index.html 本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如有版

Coperator 694

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

通过双向证书认证使用 gSOAP 访问 web services

概述 本文通过一系列的实验步骤描述,向您展示如何使用 gSOAP 编写的客户端,通过双向证书认证,访问由 tomcat7 和 Axis2 搭建的 web 服务。全文循序渐进,分为几个阶段逐步展开,每个阶段相关的注意事项和遇到过的一些问题也一并记录下来供读者参考。 先简单介绍一下需要准备的工具。 服务端:由 tomcat7+axis2 搭建而成 客户端:由 gSOAP 工具生成 证书 :用...

PeterCuiy 794

深度学习工具包 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'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('DeepLearnToolbox'));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('state',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'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',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 = 'sigm';%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, 'Too big error');```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('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';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)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';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, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% 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'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 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, 'Too big error');```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('state',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, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',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, 'Too big error');%% ex3 neural net with dropoutrand('state',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, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % 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, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % 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, 'Too big error');%% 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('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % 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, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Symbian学习笔记(20) - 用gSOAP更简单地实现Web Services Client

昨天折腾了一下那个gSOAP,发现这东西比Symbian自带的WebServiceAPI更简单方便,推荐使用!gSOAP的官方网站是:http://gsoap2.sourceforge.net/具体使用方法不多说,因为网上GOOGLE 一下很多资料。下面只对在symbian环境下使用略说几点。我下载的是最新版的v2.7.10,下载的压缩包里就有一个symbian目录,里面是在symbi

SHARE & TOP 6108

ONVIF学习【2】——SOAP介绍以及gSOAP使用

onvif

holly的专栏 2240

Web Services--gSOAP 2.7.6 User Guide 目录

下载地址:http://sourceforge.net/projects/gsoap2   官方网站:http://genivia.com/Products/gsoap/index.html 本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如有

Coperator 937

Web Services--gSOAP 2.7.6 第七章(7.2.2)

下载地址:http://sourceforge.net/projects/gsoap2 官方网站:http://genivia.com/Products/gsoap/index.html 本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如

Coperator 820

使用C++编写web services

这篇文章原文在我的blog : www.breezemind.com你可以在上面下载到本文的代码。gSOAP Tutorial : Part IIntroduction:The gSOAP toolkit provides a SOAP/XML-to-C/C++ language binding toease the development of SOAP/XML Web serv

tcysb的专栏 898

Hello, gSoap: 用 gSoap 创建自己的第一个 Web Services 程序。

目录1. 准备项目文件夹。2. 创建源代码3. 生成 Web Services 源代码4. 编译项目5. 部署 1. 准备项目文件夹。 先创建一个文件夹保存我们这个项目的文件。 把 stdsoap2.cpp 文件从 gSoap 的文件夹里复制到当前文件夹,等一会编译项目的时候要用。其实可以用更优雅的方法,比如设置搜索路径等。本文中,我就粗暴处理了,直接复制过来,当然这样也无伤大雅, 2. 创建源代码 头文件 hello.h: int ns__hello(std::string name, std::stri

程序猿视角 383

Web Services--gSOAP 2.7.6 第一章(1.2)

下载地址:http://sourceforge.net/projects/gsoap2 官方网站:http://genivia.com/Products/gsoap/index.html 本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如有版

Coperator 875

Web Services--gSOAP 2.7.6 第七章(7.2)

下载地址:http://sourceforge.net/projects/gsoap2 官方网站:http://genivia.com/Products/gsoap/index.html 本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如

Coperator 649

Web Services--gSOAP 2.7.6 第一章(1.4)

下载地址:http://sourceforge.net/projects/gsoap2 官方网站:http://genivia.com/Products/gsoap/index.html 本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如有版

Coperator 844

Web Services--gSOAP 2.7.6 第一章(1.1)

下载地址:http://sourceforge.net/projects/gsoap2 官方网站:http://genivia.com/Products/gsoap/index.html 本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如有版

Coperator 983
上一篇: SNMP--How to install SNMP extension agent DLL(如何安装SNMP扩展代理DLL)
下一篇: Web Services--gSOAP 2.7.6 第七章(7.2.2)
dblion
博客等级 码龄16年 23粉丝 104原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值