param

Processing stacks of parameters using 'for-each' in XSL?

淺唱寂寞╮ 提交于 2019-12-02 08:23:05
I have a series of param elements inside a template that rely upon each other (i.e. each subsequent param uses the value of the previous one as part of it's XPath) e.g. <xsl:param name="input1" select="path/node/@value"/> <xsl:param name="input2" select="path/anothernode[@value=$input1]/anothervalue"/> <xsl:param name="input3" select="path/thirdnode[@value=$input2]/@endvalue"/> etc. etc. The stack of params works perfectly on a single run through. However, when I use a for-each loop to call the template and pass the for-each value to it using xsl:with-param, only the top param is processed -

excel解析成java实体

怎甘沉沦 提交于 2019-12-02 08:10:12
问题 由于业务的迭代和各种数据订正等等场景。excel解析的场景越来越多,但是现成的工具类其实还是不够自动化,我们需要一个只关注解析对象的工具,其他的东西尽量做到封装。 可以把excel表格看成RDB的表一样,一行就代表一条记录,对应代码一个entity。根据不同的需求我们只需要编写列与entity字段的映射关系即可,其他的兼容性与实现细节不关心。 实现方式 /** * 将表格的数据转换成目标对象 * @param inputStream 文件流 * @param fileName 判断是否是xlsx或则xls的依据 * @param cellElementMapper 回调函数, 映射元素属性与行的值 * @param <TARGET> 需要转换成的行 model * @return */ public static < TARGET > List < TARGET > parseToList ( InputStream inputStream , String fileName , Function < ArrayList < String > , TARGET > cellElementMapper ) { Workbook workbook = null ; try { workbook = isXlsxFile ( fileName ) ? new

本地缓存google Guava

China☆狼群 提交于 2019-12-02 06:30:55
1.引入依赖 GuavaCache是google开源Java类库Guava的其中一个模块,在maven工程下使用可在pom文件加入如下依赖: <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>23.0</version> </dependency> 1 2 3 4 5 2.适用情况 你愿意消耗一些内存空间来提升速度。 你预料到某些键会被查询一次以上。 缓存中存放的数据总量不会超出内存容量。(Guava Cache是单个应用运行时的本地缓存。它不把数据存放到文件或外部服务器。) 3.范例 //LoadingCache在缓存项不存在时可以自动加载缓存 LoadingCache<String,Object> cache = CacheBuilder.newBuilder() //设置并发级别为8,并发级别是指可以同时写缓存的线程数 .concurrencyLevel(8) //设置写缓存后8秒钟过期 .expireAfterWrite(8, TimeUnit.SECONDS) //设置缓存容器的初始容量为10 .initialCapacity(10) //设置缓存最大容量为100,超过100之后就会按照LRU最近虽少使用算法来移除缓存项 .maximumSize

JSP 自我学习笔记2

ぐ巨炮叔叔 提交于 2019-12-02 06:23:33
JSP 自我学习笔记2 一 .学习目标 主要学习jsp中的jsp:include,jsp:forward,jsp:param 二 .讲解内容 jsp:include动作 jsp:include动作是在主页面被请求时,将次级页面的输出包含进来。尽管被包含的页面的输出中不能含有JSP,但这些页面可以是其他资源所产生的 结果。服务器按照正常的方式对指向被包含资源的URL进行解释,因而这个URL可以是Servlet或JSP页面。服务器以通常的方式运行被包含的页面, 将产生的输出放到主页面中,这种方式与RequestDispatcher类的include方法一致。它的优点是在被包含的页面发生更改时,无须对主页 面做出修改。它的缺点是所包含的是次级页面的输出,而非次级页面的实际代码,所以在被包含的页面中不能使用任何有可能在整体上影响主页面的JSP构造。 语法: <jsp:include page="sample.jsp" flush="true"> <jsp:param name="name" value="value"/> </jsp:include> 其中参数设置可以没有,如果没有参数设置,则必须采用 <jsp:include page="sample.jsp" flush="true"/> jsp:forward动作

RecyclerView 通用适配器

£可爱£侵袭症+ 提交于 2019-12-02 06:07:58
原文地址:https://www.jianshu.com/p/82a74c9ccba5 public abstract class RVBaseAdapter<T> extends RecyclerView.Adapter<RVBaseAdapter.CommonViewHolder> { protected List<T> mBeans; protected Context mContext; protected boolean mAnimateItems = true; protected int mLastAnimatedPosition = -1; public RVBaseAdapter(Context context, List<T> beans) { mContext = context; mBeans = beans; } @Override public RVBaseAdapter.CommonViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater = LayoutInflater.from(mContext); View view = inflater.inflate(getItemLayoutID(viewType), parent,

layui table分页时记住选中状态

痞子三分冷 提交于 2019-12-02 05:59:29
Js脚本 define(["jquery", "layui"], function ($, layui) { var table = layui.table; //记录选中表格记录编号 var checkedMultiList = []; var tableCheckBoxMultiColumnUtil = { /*初始化分页设置*/ init: function (settings) { var param = { //表格id gridId: '', //表格lay-filter值 filterId: '', //表格主键字段名 fieldName: '' }; $.extend(param, settings); //设置当前保存数据参数 if (checkedMultiList[param.gridId] == null) { checkedMultiList[param.gridId] = []; } //监听选中行 table.on('checkbox(' + param.filterId + ')', function (obj) { var type = obj.type; var checked = obj.checked; //当前选中数据 var checkRowData = []; //当前取消选中的数据 var cacelCheckedRowData =

CAD关于图层修改图层亮度操作(com接口c#语言)

蹲街弑〆低调 提交于 2019-12-02 05:34:20
控件提供,让CAD图层上的所有对象,按指定亮度显示功能,比如亮度设置0,表示对象显示成灰色,一般一些背景不让修改的对象放在背景层上,然后把亮度设置成0. Mx_SetLayerBright函数详细说明,参考: http://www.mxdraw.com/help/MxDrawXCustomFunction__Mx_SetLayerBright@LPCTSTR@DOUBLE@LONG.htm Mx_SetBright 函数详细说明,参考: http://www.mxdraw.com/help/MxDrawXCustomFunction__Mx_SetBright@IN_LONG@CString.htm 例如设置图层 222按50%显示, C#代码: MxDrawResbuf param = new MxDrawResbuf(); // 图层名 param.AddString("222"); // 图层亮度. param.AddDouble(50); // 不自动调用更新显示函数 param.AddLong(0); axMxDrawX1.CallEx("Mx_SetLayerBright", param); 来源: https://www.cnblogs.com/yzy0224/p/11732030.html

【websocket】spring boot 集成 websocket 的四种方式

孤街浪徒 提交于 2019-12-02 03:36:54
集成 websocket 的四种方案 1. 原生注解 pom.xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> </dependency> WebSocketConfig /* * * * * blog.coder4j.cn * * Copyright (C) 2016-2019 All Rights Reserved. * */ package cn.coder4j.study.example.websocket.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.socket.config.annotation.EnableWebSocket; import org.springframework.web.socket.server.standard.ServerEndpointExporter; /** * @author buhao *

ffmpeg生成视频封面图

拥有回忆 提交于 2019-12-02 02:33:55
ffmpeg 是一个视频处理软件 php-ffmpeg 是一个让 php 可以操作 ffmpeg 的 php插件,封装好了各种操作命令。直接调用对应的方法即可。 使用过程很曲折也很简单 曲折在于一直想使用php-ffmpeg插件,各种尝试,最后失败,可能是该插件暂不支持php7.1 很简单在于放弃php-ffmpeg后,使用ffmpeg的原生命令,只需一条命令即可生成缩略图。 下载安装ffmpeg,配置环境变量,即通过 ffmpeg -v 即可调用ffmpeg(如不配置,需要加上绝对路径) - 使用过程只需一条命令,几个参数即可 /** * 获取视频封面图片,与视频在相同文件夹下 * @param string $inFile 视频文件地址 * @param int $time 截图的秒数 * @param int $width 图片宽度 * @param int $height 图片高度 * @return string * User: LiZheng 271648298@qq.com * Date: 2019/10/12 */ public function getVideoCover($inFile, $time = 1, $width = 320, $height = 240) { //输出文件名 $outFileName = substr($inFile, 0,

操作excel表格

筅森魡賤 提交于 2019-12-02 02:28:26
import xlrdfrom xlutils.copy import copyclass OpraterExcel(): def __init__(self, file_path=None, sheet_index=None): if file_path == None: self.file_path = '../configdata/test.xlsx' else: self.file_path = file_path if sheet_index == None: self.sheet_index = 0 else: self.sheet_index = sheet_index self.sheet = self.load_file() def load_file(self): workbook = xlrd.open_workbook(self.file_path) sheet = workbook.sheet_by_index(self.sheet_index) return sheet def get_value(self,row,col): ''' 依据行列获取表格数据 :param row: :param col: :return: ''' return self.sheet.cell_value(rowx=row,colx=col) def write(self,