tiles使用介绍

Cesium入门10 - 3D Tiles Cesium入门10 - 3D Tiles Cesium中文网:http://cesiumcn.org/ | 国内快速访问:http://cesium.coinidea.com/ 我们团队有时把Cesium描述成一个真实世界数据的3D游戏引擎。然而,使用真实世界的数据比使用典型的视频游戏数据资料要困难得多,因为真实数据可能是难以置信的高分辨率,并且需要精确的可视化。幸运的是,Cesium 与开源社... 阅读详情
1. 概述
针对view(前台表达)部分所使用的struts tiles技术的介绍。包括tiles简介,配置,以及开发流程的介绍。
2. Struts-tiles技术简介
2.1 概念简介
Tiles Framework建立在jsp include技术的基础之上。通过xml配置文件把显示页面划分为几个“通用模块”(tiles),增强页面的可重用性,易于管理整个应用(网站)的风格,提高web page的可维护性。
2.2 主要功能简介
l 页面划分:
将页面按功能模块划分。
l 页面模版:
在xml文件中设置页面的模版,类似基类的概念,将通过它动态生成我们所需的不同的功能页面。
l 构建页面:
运行时读取tiles配置文件,通过给模版传不同的值,例如menu list等,动态构建功能页面。
3. 实现方案描述
3.1 概述
Tiles Framework实现所要做的工作主要包括:
l 页面公用部分提取:例如每个页面有共同的header部分,menu部分,copyright部分等等。
l 写tiles-def配置文件:定义layout(模版),menu等等。
l 写对应的模版jsp:用tiles的insert等标签构建通用页面。
l 将tiles框架作为struts的插件功能install到struts应用中:这部分的工作包括web.xml的配置,struts-config插件的设置,包的安装等等。
3.2 实现流程
公用部分提取:
从页面设计人员的静态页面中提取公用部分,用于模版的构建。
图例1:
 
如图例所示,每个应用都可以分析提取出一些公用部分,如header、menu、footer。这些通常都是不变的,这样我们就可能实现页面的动态生成,减轻开发任务。
Tiles-def配置文件描述
Definition的定义
根据提取出来的公用部分,可以构建一个或多个可重用的页面模版,通过在tiles-def.xml中的配置,就可以方便的利用tiles动态生成我们所需的功能页面。
示例1:
  <definition name="site.mainLayout" path="/layouts/classicLayout.jsp">   <put name="title"  value="Tiles Blank Site" />   <put name="header" value="/tiles/common/header.jsp" />   <put name="menu"   value="site.menu.bar" />   <put name="footer" value="/tiles/common/footer.jsp" />   <put name="body"   value="/tiles/body.jsp" />  </definition>
这是一个definition的例子,构建了一个向图例1那样的页面模版:
    path属性:定义模版对应的jsp文件,也就是模版的实现。
    put标签:定义了模版中要填入的具体内容。
在menu成员中又嵌套了一个definition,site.menu.bar。也就是说,可以进一步详细的定义模版中一部份内容的拆分,实现模版的嵌套。
Menu Definition的定义
示例2:
<definition name=" site.menu.bar " path="/layout/vboxLayout.jsp" >  <putList name="componentsList" >      <item value="Home"           link="/index.jsp"  />      <item value="Live Examples (new)" link="/examples/index.jsp"  />      <item value="Quick overview" link="/doc/quickOverview.jsp"  />      <item value="Tutorial"       link="/doc/tutorial.jsp"  />      <item value="Tutorial Live Examples" link="/tutorial/index.jsp" />      <item value="Download"       link="/doc/download.jsp" />      <item value="Installation"   link="/doc/installation.jsp" />      <item value="User Guide"    link="/doc/userGuide.jsp" />      <item value="Javadoc"        link="/api/index.html" />  </putList></definition>
这里是一个基本的menu的definition。
path:声明实现的jsp。
putlist:声明列表,用于显示菜单。
item:定义每个菜单项的显示名称和链接。
Definition 的继承
示例3:
<definition name="sys.operator.add.page" extends="site.mainLayout "> <put name="body" value="/sys/sysoperadd.jsp"/></definition>
在这个definition中使用到了extends属性,也就是说一个definition可以从另外一个definition中继承生成。可以overload掉父节点definition中的某些属性,像这个示例就把body显示的内容换成了/sys/sysoperadd.jsp。
Definition naming rule
本次实现的tiles definition name规则:
sino.模块简称.应用
    例如:sino.doc.documentappque领用设置查询页
          sino.doc.documentbacque回销设置查询页
          sino.doc.documentdesque销毁设置查询页
          sino.doc.documentlosque遗失设置查询页
安装
tiles可以作为struts的一个plug-in来整合到struts中。Plug-in的属性可以在web.xml中定义,也可以在struts-config.xml中定义。属性读取时会先从web.xml中读取,再从struts-config.xml中读取覆盖它。推荐直接在sturts-config.xml中定义。
<plug-in className="org.apache.struts.tiles.TilesPlugin" ><set-property property="definitions-config"value="/WEB-INF/tiles-defs.xml,/WEB-INF/tiles-tests-defs.xml,/WEB-INF/tiles-tutorial-defs.xml,/WEB-INF/tiles-examples-defs.xml" /><set-property property="moduleAware" value="true" /><set-property property="definitions-parser-validate" value="true" /></plug-in>
属性描述:
l definitions-factory-class:可以定义自己的definition-factory,classname用这个属性设置,默认是i18n factory。
l definitions-config:definition的配置文件路径和文件名,默认值是/WEB-INF/tileDefinitions.xml。
l moduleAware:在有多个definition配置文件时,设置为true表示每个文件使用不同的factory实例,false则公用一个。默认为true。
l definitions-parser-validate:是否进行DTD校验,默认为true。
l definitions-debug:设置debug级别,0最低,2最高,默认为0。
以上所有的属性都是可选的,不是必须设置的。
Layout生成
menuLayout实现(vboxLayout.jsp):
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %><%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %><%@ page import="java.util.Iterator" %><%-- Menu LayoutThis layout renders a menu with links.It takes as parameter the title and a list of items. Each item is a beanwith following properties: value, href, icon, tooltip.@param title Menu title@param items list of items. Items are beans--%><%-- Push tiles attributes in page context --%><tiles:importAttribute /><table><logic:present name="title"><tr><th colspan=2><div align="left"><strong><tiles:getAsString name="title"/></strong></div></th></tr></logic:present><%-- iterate on items list --%><logic:iterate id="item" name="items" type="org.apache.struts.tiles.beans.MenuItem" ><% // Add site URL if link starts with "/"String link = item.getLink();if(link.startsWith("/") ) link = request.getContextPath() + link;%><tr><td width="10" valign="top" ></td><td valign="top" ><font size="-1"><a href="<%=link%>"><logic:notPresent name="item" property="icon"><%=item.getValue()%></logic:notPresent><logic:present name="item" property="icon"><% // Add site URL if link starts with "/"String icon = item.getIcon();if(icon.startsWith("/") ) icon = request.getContextPath() + icon;%><img src='<%=request.getContextPath()%><bean:write name="item" property="icon" scope="page"/>'alt='<bean:write name="item" property="tooltip" scope="page" ignore="true"/>' /></logic:present></a></font></td></tr></logic:iterate></table>
说明:
importAttribute:用来引入配置文件中定义好的菜单枚举。
mainLayout实现:
mainLayout.jsp:
<%-- Layout TilesThis layout creates a HTML page with <header> and <body> tags. It rendersa header, left menu, body and footer tile.@param title String used as page title@param header Header Tile (URL of a JSP page or definition name)@param menu Menu Tile@param body Body Tile@param footer Footer Tile--%><%@ page contentType="text/html; charset=GBK" %><%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %><HTML><HEAD><link rel=stylesheet href="<%=request.getContextPath()%>/layouts/stylesheet.css"type="text/css"><title><tiles:getAsString name="title"/></title></HEAD><body bgcolor="#ffffff" text="#000000" link="#023264" alink="#023264" vlink="#023264"><table border="0" width="100%" cellspacing="5"><tr><td colspan="2"><tiles:insert attribute="header" /></td></tr><tr><td width="140" valign="top"><tiles:insert attribute='menu'/></td><td valign="top" align="left"><tiles:insert attribute='body' /></td></tr><tr><td colspan="2"><tiles:insert attribute="footer" /></td></tr></table></body></html>
header.jsp
<%@ page contentType="text/html; charset=GBK" %><table width="100%" border="0" cellspacing="0" cellpadding="0">  <tr>    <td width="48%" background="<%=request.getContextPath()%>/sys/images/p012.gif"><img src="<%=request.getContextPath()%>/sys/images/logo.gif" width="374" height="70"></td>    <td width="30%" background="<%=request.getContextPath()%>/sys/images/p012.gif"><img src="<%=request.getContextPath()%>/sys/images/p001.gif" width="202" height="70"></td>    <td width="22%" align="right" background="<%=request.getContextPath()%>/sys/images/p012.gif"><img src="<%=request.getContextPath()%>/sys/images/p002.gif" width="203" height="70"></td>  </tr></table>
footer.jsp
<%@ page contentType="text/html; charset=GBK" %><table width="100%" border="0" cellspacing="0" cellpadding="0">  <tr>    <td bgcolor="FF966B" height="1"></td>  </tr>  <tr align="center">    <td height="18" class="font9">生命保险人寿股份有限公司 版权所有</td>  </tr></table>
说明:
title:通过getAsString标签从配置文件读取,显示在页面中。
header,footer,body,menu:通过insert标签被include到mainLayout.jsp中。
menuLayout:利用struts:iterate的枚举功能生成Menu的链接列表。
这样就构成了一个图例1所示的页面模版。
应用tiles(动态页面)
在definition、layout已经定义好了之后,就可以应用到struts中用它们代替原来forward mapping使用的url。
<action path="/tutorial/testAction2"type="org.apache.struts.example.tiles.tutorial.ForwardExampleAction"><forward name="failure" path="forward.example.failure.page"/><forward name="success" path="forward.example.success.page"/></action>
关于action的配置和没有加入tiles的唯一区别就在于forward mapping使用的url变成了definition配置文件中的definition定义。
Controller
对于每个definition,还可以定义一个controller。在使用这个definition之前会先调用一个controller做一些必须的业务逻辑。
l Definition设置:
<definition name="examples.rssChannel.body" path="/examples/tiles/rssChannels.jsp" controllerUrl="/examples/controller/rssChannel.do"><putList name="urls"><add value=" http://www.newsforge.com/newsforge.rss"/><add value=" http://xmlhack.com/rss.php"/><add value=" http://lwn.net/headlines/rss"/></putList></definition>
给definition定义一个controllerUrl。
l Struts设置:
<actiontype="org.apache.struts.webapp.tiles.rssChannel.RssChannelsAction" path="/controller/rssChannel"/>
在struts-config中配置这个controllerUrl的映射class。注意controller action是没有forword mapping的,因为它对应了一个tiles definition。
l RssChannelsAction.java:
package org.apache.struts.webapp.tiles.rssChannel;……import org.apache.struts.tiles.actions.*;……public final class RssChannelsAction    extends TilesAction {……    public ActionForward perform (ComponentContext context,                                  ActionMapping mapping,                                  ActionForm form,                                  HttpServletRequest request,                                  HttpServletResponse response)        throws IOException, ServletException {……        List channels = (List) context.getAttribute ("urls");……    }}
Controller继承org.apache.struts.tiles.actions.TilesAction类,通过重写perform()方法来处理必要的逻辑。该方法与struts action的区别就是多了一个ComponetContext型参数,可以通过这个对象的getAttribute()方法读取definition中定义的输入属性。
单端反激电源的RCD钳位电路吸收设计 反激电源尖峰电压和特点: 反激开关电源主要适用于中小功率<100W的电源设计中,特点是电路简单、成本低、可靠性高、宽稳压范围、转换效率PF高。但是由于本身变压器的漏感和其他参数的影响,变压器在高速开关关断瞬间会产生很大的尖峰电压,截止时产生的尖峰电压是由电路中的储能元件释放的电流引起的突变,过高的尖峰电压会影响开关管的正常工作,需要对尖峰电压采取措施抑制尖峰电压。 如上图所示,尖峰电压的钳位抑制方式有很多种。 TVS成本偏高,属于硬件导通,元件的可靠性较差,在低电压工作效果不理想。 RCD回路吸收 阅读详情

相关推荐

EPICS Phoebus手册1

EPICS客户端phoebus 手册

yuyuyuliang00的博客 3950

掌握Tiles 框架 (一)---Tiles入门和Tiles 框架和体系结构

入门 本教程所讲述的内容 本教程讲述如何使用 Tiles 框架来创建可重用的表示组件。(在最初创建它时,Tiles 框架被命名为 Components。 后来改变了名称是因为“components(组件)”代表了太多不同的东西,不过原先的名称的精髓仍然得到了保留。) 然而,除了站点布局之外,使用 tile 还能做其他许多事情。例如,您可以划分表示层以更好地重用布局、HTML以及其他可视组件。

chj225500的专栏 3万+

Unity Sprite Editor切片功能详解:如何快速将一张大图拆分成多个小图(附常见问题解决)

本文详细解析了Unity Sprite Editor的切片功能,指导开发者如何高效地将一张大图拆分为多个独立小图。文章涵盖了自动与手动切片操作步骤、轴心点设置、子精灵命名管理等核心技巧,并针对切片错位、性能优化等常见问题提供了实用解决方案,帮助提升2D游戏资源处理效率。

i0j1k2l3m的博客 646

Tiles使用心得,使用总结

  1.tiles简介, tiles简单来说就是把多个复杂的jsp页面内可以重用的部分给拆分出来,达到重复使用的目的. 这是官网介绍 Tiles允许作者​​定义页面片段,这些片段可以在运行时被组合成一个完整的页面。这些片段或片可以被简单的包括在内,以便减少常见的页面元素的重复或者嵌入在其他的片中以开发一系列可重复使用的模板。这些模板简化了整个应用程序中一致的外观和感觉的开发.http://...

黑白电影的博客 1782

可变形卷积(Deformable Conv)原理解析与torch代码实现

图6为可变形卷积示意图。图1所示为普通卷积在输入特征图上进行卷积计算的过程,卷积核大小为3*3,在输入特征图尺寸为7*7上进行卷积,将卷积核权重与输入特征图对应位置元素相乘并求和得到输出特征图元素,按一定方式滑动窗口就能计算得到整张输出特征图。图6所示,在input feature map上普通卷积操作对应卷积采样区域是一个卷积核大小的正方形(绿框),而可变形卷积对应的卷积采样区域为一些蓝框表示的点,这就是可变形卷积与普通卷积的区别。先来一张图感受一下,图3为标准卷积与可变形卷积的卷积示例。

panghuzhenbang的博客 5万+

用 SAP-ABAP-1 把 ABAP 代码读懂:从 Generative AI Hub Orchestration 到 Joule 落地的实战指南

SAP-ABAP-1 是 SAP 推出的 ABAP 专用基础模型,专注于代码解释与理解。它能显著降低企业遗留系统的维护成本,帮助开发人员快速掌握复杂业务逻辑。该模型通过 SAP Generative AI hub 托管,支持 128,000 tokens 的上下文长度,适合分析大型 ABAP 类和 CDS 视图。典型应用场景包括代码解释、迁移辅助和云合规检查。调用需通过 Orchestration service 进行,确保企业级安全治理。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1212

tiles配置及标签使用

创建布局文件 Jsp代码   "http://tiles.apache.org/tags-tiles" prefix="tiles"%>                        "title" />                            "0" width="100%" cellspacing="5">

tangyuewei.com 1万+

华为OD面试八股真题 - 操作系统 - 1

华为OD技术面,操作系统相关八股真题提供详细解答,这篇博客主要涉及于进程和线程相关知识点

qq_45776114的博客 1633

Apache Tiles 学习(三)、Apache Tiles的基本使用

为什么80%的码农都做不了架构师?>>> ...

weixin_34289454的博客 300

使用ArcGIS Pro进行土地利用分类的机器学习与深度学习

传统的土地利用分类方法通常依赖于手动解译和规则定义,但随着机器学习和深度学习的发展,我们现在可以利用这些技术来自动化和提高分类的精度。ArcGIS Pro是一种功能强大的GIS软件,它提供了丰富的工具和功能,可以支持土地利用分类的机器学习和深度学习。我们将首先讨论数据准备和预处理的步骤,然后介绍常用的机器学习和深度学习方法,并提供相应的源代码示例。这可以通过人工标注或半自动的方式完成。数据裁剪:根据研究区域的范围,裁剪遥感影像数据,以减少计算和存储的负担,并确保只包含感兴趣的土地利用区域。

code_program481的博客 2039

基于STM32、HAL库的 CH9102X USB转UART收发器 驱动程序设计

/ 或 UART_HWCONTROL_RTS_CTS。// 其他函数实现类似,使用HAL_UART_Transmit_IT, HAL_UART_Receive_IT等。UART_TXD <---> USARTx_RX (STM32接收)UART_RXD <---> USARTx_TX (STM32发送)* @param huart: UART句柄指针。* @param huart: UART句柄指针。* @param huart: UART句柄指针。* @param huart: UART句柄指针。

corlin6688的博客 506

与Tiles框架的第一次亲密接触

一、如何使用Tiles框架1.添加jar包,struts已经集成2.配置struts-config中的plus-in属性3.配置web.xml中的taglib属性,将tiles标签配进去4.写Tiles的配置文件tiles-def.xml5.根据tiles-def.xml写布局,布局其实就是一个.jsp,只不过包含了tiles:insert6.写页面7.不同的跳转方式:1)增加新页面(每个页面需要

shanchao的专栏 744

第1章:认识OpenClaw

OpenClaw是一个开源的 AI 智能体 Gateway 网关项目名称演变:OpenClaw 原名 Clawdbot,因 Anthropic 商标顾虑在 2026年1月27日更名为 Moltbot(过渡名),最终在1月30日确定为 OpenClaw。三个名字本质是同一个项目,功能完全一致。🏠在你的电脑上运行:完全本地部署,数据隐私有保障📁访问本地文件:可以搜索、读取、编辑你电脑上的文件🔌扩展能力:通过Skills(技能)系统无限扩展功能💬多平台使用。

Maynor的博客 2832

Tiles框架如何使用介绍

    1.添加jar包,struts已经集成 <a onclick="function onclick(){function onclick(){updatecount(427)}}" href="http://www.crystaledu.bj.cn/cmt/cmtsjsqkb.html" target="_blank">   2.配置struts-config

Roger★L☆M☆J★ 1558

深度学习工具包 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")

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

struts-tiles 使用介绍

    2, Tiles 使用配制文件,文件里定义的叫"tiles组件" 简称"组件". 语法:  配置文件里tiles-defs.xml              这个com1组件可以拿来用.    使用模版的页面B.jsp:  另外com1也可以直接在struts-config.xml中当作普通页面使用.例如, 3,Tiles基本上都是使用文件定义组件这种方式.写组件文件比

ssl vpn ------adito (ssl explorer) (openvpn als)&amp;amp;&amp;amp;网络安全 977

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

spring整合tiles3简单介绍和使用

对于spring 集成 tiles3 简单介绍 网站一般分为可重复使用的模板正在呈现不同的网页之间的的。例如,一个网站中包含的页眉,页脚,菜单等项目仍然通过了该网站相同,并给它一个共同的外观和感觉。这是很难很难的代码在每一个网页,如果以后需要改变是不是所有的页面需要修改。因此,我们使用模板化机制。我们创建一个共同的页眉,页脚,菜单页,其中包括在每一页。  首先Spring - servle

usernameysz的博客 1230

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

Struts 's Tiles使用入门

Tiles使用入门 作者:孤魂一笑 一:说明Struts1.1以后增加了Tiles包使得struts在页面的处理方面多了一种选择.并且更容易实现代码的重用。Tiles中对页面的划分有点象jakarta的另外一个项目Turbine中的TDK。增加了layout的概念.其实就是把一个页面划分为几块。通常的来说一个页面大概可以划分为如下几块:head页面头部:存放一个运用的公共信息:lo

山哥's 专栏 3472

Tiles的使用

1.安装 sturts.jar,commons-digester.jar,commons-beanutils.jar,commons-collections.jar,commons-logging.jar2.配置 /WEB-INF/struts-tiles.tld /WEB-INF/struts-tiles.tld3. 1)采用Tilesmoban布局:               应

前进の毛毛 1500

tiles标签库

tiles:insert 插入到JSP页面中:这个例子将tag中指定的页面插入到整个页面中来。page属性可以是指向任何现存网络资源有效的URL。 通过引用属性来插入Tiles:该例子插入了被 “menu” 属性值引用的Tiles。当前的Tiles的context首先获得该属性值,然后它再用来作为页面目标而插入。 tiles:getAsS...

liweicarlos335的专栏 466

Tiles的使用-遗补和总结

   一.) Tiles配置要正常使用tiles,必须在Structs配置文件中加入下列代码:   className="org.apache.struts.tiles.TilesPlugin" > definitions-config" value="/WEB-INF/tiles-defs.xml, /WEB-INF/tiles-te

首席技术执行官CTO(Chief Technology Officer)|技术总监--邓斌博客 1426

Struts使用Tiles辅助开发

 对于在页面的布局管理以及可重用方面,Tiles做得很优秀,使我们在开发过程中思路非常流畅,特别是在用struts开发项目过程中,如果使用tiels来辅助开发,往往能带到事半功倍的效果。 如果要看Tiles的详细文档,请访问 http://www.lifl.fr/~dumoulin/tiles/ 在此我想从使用方式上说一下自己的经验: 往往我们的一个项目中,大部分的页面的布局都是一样的,这其中如果

zaowei21的专栏 1285

Tiles介绍

问题: Web产品开发中大家会面临着同一个问题----页面中大部分都是固定不变的,变化的只有内容部分,也可以说每个产品都有一定的风格或者是使用了几类模板。 遇到了问题就要想办法解决!相信大家也想找一个方法,提高Web代码的复用性和可维护性。下面介绍一下我们的解决方案。 解决方案: Apache Tiles 框架来创建可重用的表示组件 ,可以划分表示层以更好地重...

iteye_9230的博客 264

在Struts中使用Tiles简明手册

如果要在Struts中使用tiles,首先要保证页面可以正确引入struts-tiles.tld,即。另外在struts-config.xml配置如下:                     在    //定义一个母板                                                    在classicLayout.jsp文件中如下:       Simple

首席技术执行官CTO(Chief Technology Officer)|技术总监--邓斌博客 1564

tiles框架使用简单总结

大家好,我是IT修真院北京分院第34期的java学员,一枚正直纯洁善良的程序员(帅不过老大),今天给大家分享一下,修真院官网Java任务4中的内容:Tiles框架 1.Tiles框架简介: 最早的Tiles是组装在Struts1.1里面的,主要目的是为了将复杂的jsp页面作为一个的页面的部分机能,然后用来组合成一个最终表示用页面用的,这样的话,便于对页面的各个机能的变更及维护。现在Til...

weixin_42402753的博客 3493

TILES框架的使用

<br />1、在struts-config.xml文件中,导入定义的tiles框架文件:<br /><plug-in className="org.apache.struts.tiles.TilesPlugin" ><br />        <set-property property="definitions-config"<br />                     value="/WEB-INF/tiles-defs.xml,/WEB-INF/tiles-defs-news.xml" />

MRmaomaochong的专栏 1002

Struts中使用tiles

Struts中使用tiles                    Tiles框架                 简介:     最早的Tiles是组装在Struts1.1里面的,主要目的是为了将复数的jsp页面作为一个的页面的部分机能,然后用来组合成一个最终表示用页面用的,这样的话,便于对页面的各个机能的变更及维护。 Tiles使得struts在页面的处理方面多了一

QueenJade的收录 875
上一篇: 1TB免费邮箱!!!
下一篇: 中国人天生是奢侈品受众
zaowei21
博客等级 码龄25年 38粉丝 517原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值