param

支付宝RSA签名

天大地大妈咪最大 提交于 2020-01-10 15:40:50
1、参考网上相关文章,开放php中的openssl,但使用网上例子调用openssl_pkey_new,一直报100013错误。后改用用支付宝提供的SDKdemo程序 发现使用提供的privkye,可以生成签名串,但使用苹果电脑生成的key就不成功。 参考此文http://orangeholic.iteye.com/blog/2161771 PHP RSA加解密示例 ,在centos下 yum install openssl,再利用生成命令产生privkey和publickey能生成签名。 2、例子说明,参考支付宝官网文档https://doc.open.alipay.com/doc2/detail?treeId=54&articleId=103419&docType=1 服务端SDK 方法说明 加签方法(如果不用SDK调用,推荐用该方法加签) 1 2 3 4 5 6 /** @param params 参数列表 key-参数名称 value-参数值 @param privateKey 加签私钥 @param charset 加签字符集 **/ String AlipaySignature.rsaSign(Map<String, String> params, String privateKey, String charset) 验签方法(同步请求时,如果不用SDK调用

CookieUtils工具类

佐手、 提交于 2020-01-10 14:33:42
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> import com.example.demo.constant.Constant; import com.example.demo.util.DateUtil; import com.example.demo.util.idmake.KeyGenerator; import com.example.demo.util.xcode.EncryptUtil; import com.example.demo.util.xcode.SecurityUtil; import org.apache.commons.codec.binary.Hex; import org.springframework.util.SerializationUtils; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax

SpringBoot时间戳与MySql数据库记录相差14小时排错

寵の児 提交于 2020-01-10 04:49:03
项目中遇到存储的时间戳与真实时间 相差14小时 的现象,以下为解决步骤. 问题 CREATE TABLE `incident` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `recovery_time` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4; 以上为数据库建表语句,其中 created_time 是插入记录时自动设置, recovery_time 需要手动进行设置. 测试时发现, created_time 为正确的北京时间,然而 recovery_time 则与设置时间相差14小时. 尝试措施 jvm时区设置 //设置jvm默认时间 System.setProperty("user.timezone", "UTC"); 数据库时区查询 查看数据库时区设置: show variables like '%time_zone%'; --- 查询结果如下所示: --- system_time_zone: CST --- time_zone:SYSTEM 查询 CST

TB2解决定位导航撞人问题

谁说我不能喝 提交于 2020-01-10 01:36:51
分析 我启动定位导航的launch文件在 here 有说明: 打开rplidar驱动 map_server发布map 设置一开始的初始位置xya,然后rplidar_amcl.launch.xml $(find turtlebot_navigation)/launch/includes/amcl/$(arg laser_type)_amcl.launch.xml 启动move_base.launch.xml的launch 由于现在movebase出现貌似localplanner没有进行planner,经过测试发现local的costmap数据并不是全0的情况(有可能是因为碰撞发生recovery 行为的时候才不为0,其他仍然0) 设置地点导航之后直接按照global planner的路线一直往前走,没有进行局部的避障。 PS:在 此篇文章中,貌似launch文件有加一个发布odom和map之间tf关系的node <node pkg="tf" type="static_transform_publisher" name="map_odom_broadcaster" args="0 0 0 0 0 0 /map /odom 100" /> move_base.launch.xml <!-- ROS navigation stack with velocity smoother and

MyBatis方法参数详解

谁说胖子不能爱 提交于 2020-01-09 12:26:33
1. 单参数方法 单参数方法的参数详解, 主要介绍不同类型的参数,在Mapper映射文件中的配置方式. 参数为: 简单类型(基本数据类型+String) 参数为: 对象类型 参数为: List集合类型-List 参数为: List集合类型-List 参数为: 数组类型 参数为: Set集合类型 参数为: Map集合类型 1.1 简单类型 1.1.1 方法示例 public User findUserById ( int id ) ; 1.1.2 映射配置 <!-- public User findUserById(int id); --> < select id = " findUserById " resultType = " com.itheima.domain.User " > select * from user where id = #{id} </ select > <!-- 如果只有一个参数,且参数是基本数据类型,则#{}中,可以随便写. 如: #{aaa}也可以 --> 1.2 对象类型 1.2.1 方法示例 public List < User > findUserByUsernameAndPassword ( User user ) ; 1.2.2 映射配置 <!-- public List<User> findUserByUsernameAndPassword

xml文件的方式实现动态代理基于SpringAOP

自闭症网瘾萝莉.ら 提交于 2020-01-08 12:46:53
1.配置spring容器 导入jar包        com.springsource.net.sf.cglib-2.2.0.jar     com.springsource.org.aopalliance-1.0.0.jar     com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar     commons-logging-1.1.3.jar     spring-aop-4.2.2.RELEASE.jar     spring-beans-4.2.2.RELEASE.jar     spring-context-4.2.2.RELEASE.jar     spring-core-4.2.2.RELEASE.jar     spring-expression-4.2.2.RELEASE.jar 配置xml文件 1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xmlns:p="http://www.springframework.org/schema/p" 5

统计一段长字符串中某字符串的出现次数

烈酒焚心 提交于 2020-01-08 10:05:50
截取字符串统计字符串出现次数 通过替换字符串,统计字符串出现次数 通过正则表达式,统计字符串出现次数 package constxiong.interview; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 统计一段长字符串中某字符串的出现次数 * @author ConstXiong * @date 2019-11-13 11:01:22 */ public class TestCountWordTimesInText { public static void main(String[] args) { String text = "统计一CX段长CX字符串中某字符串的出C现X次cx数"; String word = "CX"; System.out.println(countWordTimesByCutString(text, word)); System.out.println(countWordTimesByReplace(text, word)); System.out.println(countWordTimesByRegex(text, word));//正则匹配,需要注通配符的使用对结果的影响 } /** * 截取字符串统计字符串出现次数 * @param text *

记 Hook 一次游戏客户端

旧街凉风 提交于 2020-01-07 23:59:02
创建 Hook 应用 先创建一个应用,用来做 Hook 之用 修改 app\build.gradle ,加入仓库与 Xposed 模块依赖 apply plugin: 'com.android.application' android { compileSdkVersion 29 buildToolsVersion "29.0.2" defaultConfig { applicationId "com.seliote.hook4ft" minSdkVersion 19 targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } } // 加入仓库 repositories { jcenter() } dependencies { implementation fileTree(dir: 'libs', include: ['*

适配器模式

ε祈祈猫儿з 提交于 2020-01-07 23:55:12
概念:把不同的接口封装成统一的api 实例: 这里以数据库连接为例 首先定义一个接口来约束数据库类必须实现的方法:DatabaseInterFace.php <?php namespace app; /** * 数据库连接接口 * Interface DatabaseInterFace * @package app */ interface DatabaseInterFace { /** * 数据库连接 * @param $host string 地址 * @param $user string 用户名 * @param $password string 密码 * @param $dbName string 数据库名 * @return mixed */ public function connect($host, $user, $password, $dbName); /** * 执行sql * @param $sql string 执行语句 * @return mixed */ public function query($sql); /** * 关闭数据库连接 * @return mixed */ public function close(); } 开始定义数据库连接类: 以Mysql.php为例 <?php namespace app\driver; /** *

Java日志相关概述

两盒软妹~` 提交于 2020-01-07 20:34:49
日志是代码调试、生产运维必备工具,基本所有软件都会有日志记录。 1.常用日志框架介绍 1.Logging jdk1.5自带日志工具类,位于java.util.logging; 2.Log4j 市场占有率最高的一个日志框架,注意2015/08/05这一天,Apache宣布停止维护了,用户需要切到Log4j2上面去; 3.commons-logging, apache最早提供的日志门面接口,用户可以根据自己喜欢选择不同日志实现框架,而不必改动日志定义。 4.slf4j simple logging facade for java,也是日志门面接口框架,和 Apache 的 commons-logging 是一样的概念,它们都不是具体的日志框架,你可以指定其他主流的日志实现框架。使用 Slf4j 可以很灵活的使用占位符进行参数占位,简化代码,拥有更好的可读性。 5.Logback 是 Slf4j 的原生实现框架,同样也是出自 Log4j 一个人之手,但拥有比 log4j 更多的优点、特性和更做强的性能,现在基本都用来代替 log4j 成为主流。 2.日志级别 Log4j 的级别类 org.apache.log4j.Level 里面定义了日志级别,日志输出优先级由高到底分别为以下8种。 OFF,关闭,不输出日志 FATAL,致命,输出非常严重的可能会导致应用程序终止的错误 ERROR,错误