param

python操作mysql数据库

 ̄綄美尐妖づ 提交于 2019-12-03 14:06:09
在我们做自动化测试工作中,肯定会用到查询数据库验证数据库的操作; 本篇主要写的就是封装好的针对数据库的基本操作,如果工作中遇到造数据也可以直接调用; 代码: # project :Python_Script # -*- coding = UTF-8 -*- # Autohr :XingHeYang # File :operation_mysql_database.py # time :2019/11/5 10:24 # Describe :封装对mysql数据库的基本操作 # --------------------------------------- import pymysql class Operation_Mysql(): def __init__(self,host,user,password,db,charset='utf8'): ''' 初始化连接mysql的操作 :param host: 传入mysql主机地址 :param user: 传入连接mysql用户名 :param password: 传入连接密码 :param db: 指定数据库名 :param charset: 字符编码格式 默认utf8编码 ''' self.connect = pymysql.connect( # 连接mysql host = host, user = user,

Java 文档注释

若如初见. 提交于 2019-12-03 12:19:24
Java 支持三种注释方式。前两种分别是 // 和 /* */ ,第三种被称作说明注释,它以 /** 开始,以 */ 结束。 说明注释允许你在程序中嵌入关于程序的信息。你可以使用 javadoc 工具软件来生成信息,并输出到HTML文件中。 说明注释,使你更加方便的记录你的程序信息。 javadoc 标签 javadoc 工具软件识别以下标签: 标签 描述 示例 @author 标识一个类的作者 @author description @deprecated 指名一个过期的类或成员 @deprecated description {@docRoot} 指明当前文档根目录的路径 Directory Path @exception 标志一个类抛出的异常 @exception exception-name explanation {@inheritDoc} 从直接父类继承的注释 Inherits a comment from the immediate surperclass. {@link} 插入一个到另一个主题的链接 {@link name text} {@linkplain} 插入一个到另一个主题的链接,但是该链接显示纯文本字体 Inserts an in-line link to another topic. @param 说明一个方法的参数 @param parameter

mysql 截取字符函数substring(param1,param2,param3) 的用法

感情迁移 提交于 2019-12-03 11:58:05
substring(paramter1,paramter2,paramter3)       截取字段长度 paramter1        被截取的字段 paramter2        从第几位开始截取,负数表示从末尾开始数,的位数开始截取 paramter3        截取多少位,省略时,表示截取到最后 示例: substring(best123456,2,3)            结果为    est substring(best123456,2)           结果为    est123456 substring(best123456,-5,3)          结果为    234 substring(best123456,-5)           结果为    23456 来源: https://www.cnblogs.com/whitemouseV2-0/p/11795215.html

go 学习 (四):接口 & 方法

送分小仙女□ 提交于 2019-12-03 11:16:25
接口声明 // 接口声明 语法:接口是一个 函数签名 的集合,函数签名(函数的声明,不包括实现) type interfaceName interface { method1(param paramType, param paramType...) (returnName returnType ...) method2(param paramType, param paramType...) (returnName returnType ...) } // 接口名一般加 er type writer interface { write(num int) (n int, flag bool) cache(p []byte) int } // 若方法名首字母是大写时,且接口名首字母也是大写时,这个方法可以被接口所在的包(package)之外的代码访问。 // 声明结构体 type structName struct {   filed1 filedType   filed2 filedType } // 实现接口中的方法 func (structVariableName structName) method1 (param paramType, param paramType...) (returnName returnType returName returnType, ...) {

async/await 与 Promise 详解

时光总嘲笑我的痴心妄想 提交于 2019-12-03 11:03:34
async 是什么? async 中文翻译过来是 “异步,非同步,异步通信” 的意思。 async 是 ES7 才有的 与异步操作有关 的关键字,和 Promise , Generator 有很大关联的。 注:ES7/8/9 都是 ES6 的补充 怎么用? 语法 : async function name([param[, param[, ... param]]]) { statements } // name: 函数名称。 // param: 要传递给函数的参数的名称。 // statements: 函数体语句。 返回值 :   async 函数返回一个 Promise 对象,可以使用 then 方法添加回调函数。 async function helloAsync(){ return "helloAsync"; } console.log(helloAsync()) // Promise {<resolved>: "helloAsync"} helloAsync().then(v=>{ console.log(v); // helloAsync }) 既然说到了 async 函数,那就必然少不了要说说 await 。 await 是什么? await 中文翻译过来的意思是 “等待,暂停函数的执行,等待异步任务完成” async 函数中 可能 会有 await 表达式,async

图片验证码工具类

若如初见. 提交于 2019-12-03 09:47:34
图片验证码工具类 文章 https://blog.csdn.net/lzxlfly/article/details/93381526 需求 session中放入登录验证码,一定时间后定时清除。 每次使用过验证码后清除,需要重新生成验证码。 工具类 package com.yuantiao.smartcardms.util; import javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.Random; public class CaptchaCodeUtil { public static void main(String[] args) throws IOException { // CaptchaCodeUtil captchaCodeUtil = new CaptchaCodeUtil(); // captchaCodeUtil.createImageCode("changhe"); // captchaCodeUtil.write(new

探究 canvas 绘图中撤销(undo)功能的实现方式

99封情书 提交于 2019-12-03 09:43:08
本文转载于: 猿2048 网站☞ https://www.mk2048.com/blog/blog.php?id=ia1bkkaiib 最近在做网页版图片处理相关的项目,也算是初入了 canvas 的坑。项目需求中有一个给图片添加水印的功能。我们知道,在浏览器端实现图片添加水印功能,通常的做法就是使用 canvas 的 drawImage 方法。对于普通的合成(比如一张底图和一张 PNG 水印图片合成)来说,其大致实现原理如下: var canvas = document.getElementById("canvas"); var ctx = canvas.getContext('2d'); // img: 底图 // watermarkImg: 水印图片 // x, y 是画布上放置 img 的坐标 ctx.drawImage(img, x, y); ctx.drawImage(watermarkImg, x, y); 直接连续使用 drawImage() 把对应的图片绘制到 canvas 画布上就行。 以上就是背景介绍。但是略麻烦的是添加水印的需求中还有一个需要实现的功能是用户能够切换水印的位置。我们自然会想到能否实现 canvas 的 undo 功能,当用户切换水印位置时,先撤销上一步 drawImage 操作,然后再重新绘制水印图片位置。 restore / save ?

react-native底部导航栏实现

痴心易碎 提交于 2019-12-03 09:38:47
react-native-tab-navigator实现:     bottom.js代码如下:      import React, {Component} from 'react'; import {StyleSheet, View,Text,Image} from 'react-native'; import TabNavigator from 'react-native-tab-navigator' export default class Bottom extends Component { /*初始化state*/ constructor(props){ super(); this.state={ selectedTab:'tb_msg', } } /** * 公共组件方法 * @param selectedTab 选中的tab * @param title * @param icon * @param selectedIcon * @param imageStyle 选中时渲染图标的颜色 * @param mark 角标 * @param viewContent 页面内容 * @returns {*} */ tabNavigatorItems(selectedTab,title,icon,selectedIcon,imageStyle,mark,viewContent

php阳历转阴历(农历),阴历转阳历的方法

牧云@^-^@ 提交于 2019-12-03 08:51:34
<?php header ( "Content-Type: text/html; charset=utf-8" ); class Lunar{ var $MIN_YEAR=1891; var $MAX_YEAR=2100; var $lunarInfo=array( array(0,2,9,21936),array(6,1,30,9656),array(0,2,17,9584),array(0,2,6,21168),array(5,1,26,43344),array(0,2,13,59728), array(0,2,2,27296),array(3,1,22,44368),array(0,2,10,43856),array(8,1,30,19304),array(0,2,19,19168),array(0,2,8,42352), array(5,1,29,21096),array(0,2,16,53856),array(0,2,4,55632),array(4,1,25,27304),array(0,2,13,22176),array(0,2,2,39632), array(2,1,22,19176),array(0,2,10,19168),array(6,1,30,42200),array(0,2,18,42192),array(0,2,6,53840),array(5,1,26

pass java variable in jsp:param

Deadly 提交于 2019-12-03 08:40:49
问题 <%! String str = "prerna"; %> <jsp:include page="index.html"> <jsp:param name="type1" value=<%=str%> > </jsp:param> </jsp:include> I want to pass a java variable in the param tag,but i am not sure how to do it. I also want to access it in index.html . Can anyone suggest me the way to do it ? 回答1: Just put it in value directly. <jsp:include page="index.html"> <jsp:param name="type1" value="prerna" /> </jsp:include> Or use JSTL <c:set> to set it and EL ${} to get it. <%@taglib prefix="c" uri=