[Java] SoapUI使用Java获取各时间日期方法
import java.util.*;
import java.text.SimpleDateFormat; // current date
String dateNew = today() // tomorrow
String tomorrow = tomorrow() // yesterday
String yesterday = yesterday() // the day before yesterday
String theDayBeforeYesterday = theDayBeforeYesterday() // Last Market Close
String lastMarketClose = lastMarketClose()
log.info "------> lastMarketClose : "+lastMarketClose // Last Market Close -2 days
String lastMarketCloseMinus2Days = lastMarketCloseMinus2Days() // Two years ago of Last Market Close -2 days
String twoYearsAgoOfLastMarketCloseMinus2Days = twoYearsAgoOfLastMarketCloseMinus2Days(lastMarketCloseMinus2Days) // yesterday of Last Market Close
String yesterdayOfLastMarketClose = yesterdayOfLastMarketClose(lastMarketClose) // a month ago of Last Market Close
String aMonthAgoOfLastMarketClose = aMonthAgoOfLastMarketClose(lastMarketClose) // three months ago of Last Market Close
String threeMonthsAgoOfLastMarketClose = threeMonthsAgoOfLastMarketClose(lastMarketClose) // three years ago of Last Market Close
String threeYearsAgoOfLastMarketClose = threeYearsAgoOfLastMarketClose(lastMarketClose)
log.info "------> threeYearsAgoOfLastMarketClose : "+threeYearsAgoOfLastMarketClose // the last day of last week
String theLastDayOfLastWeek = theLastDayOfLastWeek() // the last day of last month
String theLastDayOfLastMonth = theLastDayOfLastMonth() // Get the same day of last month
String theSameDayOfLastMonth = theSameDayOfLastMonth() // The first day of the quarter
String theFirstDayOfTheQuarter = theFirstDayOfTheQuarter() // The last day of last quarter
String theLastDayOfLastQuarter = theLastDayOfLastQuarter(theFirstDayOfTheQuarter) // a year ago after The last day of last quarter
String aYearAgoAfterTheLastDayOfLastQuarter = aYearAgoAfterTheLastDayOfLastQuarter(theFirstDayOfTheQuarter) // The first day of last quarter
String theFirstDayOfLastQuarter = theFirstDayOfLastQuarter(theFirstDayOfTheQuarter) // The last day of two quarters ago
String theLastDayOfTwoQuartersAgo = theLastDayOfTwoQuartersAgo(theLastDayOfLastQuarter) // The first day of six months ago after two quarters
String theFirstDayOfSixMonthsAgoAfterTwoQuarters = theFirstDayOfSixMonthsAgoAfterTwoQuarters(theLastDayOfTwoQuartersAgo) // yesterday of three months ago
String yesterdayOfThreeMonthsAgo = yesterdayOfThreeMonthsAgo() // The first day of two months ago
String theFirstDayOfTwoMonthsAgo = theFirstDayOfTwoMonthsAgo() // The last day of two months ago
String theLastDayOfTwoMonthsAgo = theLastDayOfTwoMonthsAgo() // The first day of three months ago
String theFirstDayOfThreeMonthsAgo = theFirstDayOfThreeMonthsAgo() // The first day of six months ago
String theFirstDayOfSixMonthsAgo = theFirstDayOfSixMonthsAgo() // The first day of this year
String theFirstDayOfThisYear = theFirstDayOfThisYear() // The last day of last year
String theLastDayOfLastYear = theLastDayOfLastYear() // tomorrow of last year
String tomorrowOfLastYear = tomorrowOfLastYear() // the first day of this month last year
String theFirstDayOfThisMonthLastYear = theFirstDayOfThisMonthLastYear() // the first day of last year
String theFirstDayOfLastYear = theFirstDayOfLastYear() // the same day of this month three years ago
String theSameDayOfThisMonthThreeYearsAgo = theSameDayOfThisMonthThreeYearsAgo() // the first day of this month three years ago
String theFirstDayOfThisMonthThreeYearsAgo = theFirstDayOfThisMonthThreeYearsAgo() // the first day of three years ago
String theFirstDayOfThreeYearsAgo = theFirstDayOfThreeYearsAgo() // Set the project level property : currentDate,yesterDay,lastMonth , its value will updated with dateNew
testRunner.testCase.testSuite.project.setPropertyValue( "currentDate", dateNew )
testRunner.testCase.testSuite.project.setPropertyValue( "tomorrow", tomorrow )
testRunner.testCase.testSuite.project.setPropertyValue( "yesterday", yesterday )
testRunner.testCase.testSuite.project.setPropertyValue( "theDayBeforeYesterday", theDayBeforeYesterday )
testRunner.testCase.testSuite.project.setPropertyValue( "lastMarketClose", lastMarketClose )
testRunner.testCase.testSuite.project.setPropertyValue( "lastMarketCloseMinus2Days", lastMarketCloseMinus2Days )
testRunner.testCase.testSuite.project.setPropertyValue( "twoYearsAgoOfLastMarketCloseMinus2Days", twoYearsAgoOfLastMarketCloseMinus2Days )
testRunner.testCase.testSuite.project.setPropertyValue( "threeYearsAgoOfLastMarketClose", threeYearsAgoOfLastMarketClose )
testRunner.testCase.testSuite.project.setPropertyValue( "theDayBeforeYesterday", theDayBeforeYesterday )
testRunner.testCase.testSuite.project.setPropertyValue( "theLastDayOfLastWeek", theLastDayOfLastWeek )
testRunner.testCase.testSuite.project.setPropertyValue( "yesterdayOfLastMarketClose", yesterdayOfLastMarketClose )
testRunner.testCase.testSuite.project.setPropertyValue( "aMonthAgoOfLastMarketClose", aMonthAgoOfLastMarketClose )
testRunner.testCase.testSuite.project.setPropertyValue( "threeMonthsAgoOfLastMarketClose", threeMonthsAgoOfLastMarketClose )
testRunner.testCase.testSuite.project.setPropertyValue( "theFirstDayOfTheQuarter", theFirstDayOfTheQuarter )
testRunner.testCase.testSuite.project.setPropertyValue( "theLastDayOfLastQuarter", theLastDayOfLastQuarter )
testRunner.testCase.testSuite.project.setPropertyValue( "aYearAgoAfterTheLastDayOfLastQuarter", aYearAgoAfterTheLastDayOfLastQuarter )
testRunner.testCase.testSuite.project.setPropertyValue( "theFirstDayOfLastQuarter", theFirstDayOfLastQuarter )
testRunner.testCase.testSuite.project.setPropertyValue( "theLastDayOfTwoQuartersAgo", theLastDayOfTwoQuartersAgo )
testRunner.testCase.testSuite.project.setPropertyValue( "theFirstDayOfSixMonthsAgoAfterTwoQuarters", theFirstDayOfSixMonthsAgoAfterTwoQuarters )
testRunner.testCase.testSuite.project.setPropertyValue( "theSameDayOfLastMonth", theSameDayOfLastMonth )
testRunner.testCase.testSuite.project.setPropertyValue( "theLastDayOfLastMonth", theLastDayOfLastMonth )
testRunner.testCase.testSuite.project.setPropertyValue( "yesterdayOfThreeMonthsAgo", yesterdayOfThreeMonthsAgo )
testRunner.testCase.testSuite.project.setPropertyValue( "theFirstDayOfTwoMonthsAgo", theFirstDayOfTwoMonthsAgo )
testRunner.testCase.testSuite.project.setPropertyValue( "theLastDayOfTwoMonthsAgo", theLastDayOfTwoMonthsAgo )
testRunner.testCase.testSuite.project.setPropertyValue( "theFirstDayOfThreeMonthsAgo", theFirstDayOfThreeMonthsAgo )
testRunner.testCase.testSuite.project.setPropertyValue( "theFirstDayOfSixMonthsAgo", theFirstDayOfSixMonthsAgo )
testRunner.testCase.testSuite.project.setPropertyValue( "theFirstDayOfThisYear", theFirstDayOfThisYear )
testRunner.testCase.testSuite.project.setPropertyValue( "theLastDayOfLastYear", theLastDayOfLastYear )
testRunner.testCase.testSuite.project.setPropertyValue( "tomorrowOfLastYear", tomorrowOfLastYear )
testRunner.testCase.testSuite.project.setPropertyValue( "theFirstDayOfThisMonthLastYear", theFirstDayOfThisMonthLastYear )
testRunner.testCase.testSuite.project.setPropertyValue( "theFirstDayOfLastYear", theFirstDayOfLastYear )
testRunner.testCase.testSuite.project.setPropertyValue( "theSameDayOfThisMonthThreeYearsAgo", theSameDayOfThisMonthThreeYearsAgo )
testRunner.testCase.testSuite.project.setPropertyValue( "theFirstDayOfThisMonthThreeYearsAgo", theFirstDayOfThisMonthThreeYearsAgo )
testRunner.testCase.testSuite.project.setPropertyValue( "theFirstDayOfThreeYearsAgo", theFirstDayOfThreeYearsAgo ) //**********************************************************************Methods************************************************************************** def today(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
str = sdf.format(lastDate.getTime());
return str;
} def yesterday(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.DATE, -1);
str = sdf.format(lastDate.getTime());
return str;
} def theDayBeforeYesterday(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.DATE, -2);
str = sdf.format(lastDate.getTime());
return str;
} def theLastDayOfLastMonth(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.MONTH, -1);
lastDate.set(Calendar.DATE, 1);
lastDate.roll(Calendar.DATE, -1);
str = sdf.format(lastDate.getTime());
return str;
} def theSameDayOfLastMonth(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.roll(Calendar.MONTH, -1);
str = sdf.format(lastDate.getTime());
return str;
} def tomorrow(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def yesterdayOfThreeMonthsAgo(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.MONTH, -3);
lastDate.add(Calendar.DATE, -1);
str = sdf.format(lastDate.getTime());
return str;
} def theFirstDayOfTwoMonthsAgo(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.MONTH, -2);
lastDate.set(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def theLastDayOfTwoMonthsAgo(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.MONTH, -2);
lastDate.set(Calendar.DATE, 1);
lastDate.roll(Calendar.DATE, -1);
str = sdf.format(lastDate.getTime());
return str;
} def theFirstDayOfThreeMonthsAgo(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.MONTH, -3);
lastDate.set(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def theFirstDayOfSixMonthsAgo(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.MONTH, -6);
lastDate.set(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def tomorrowOfLastYear(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.YEAR, -1);
lastDate.add(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def theSameDayOfThisMonthThreeYearsAgo(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.YEAR, -3);
str = sdf.format(lastDate.getTime());
return str;
} def theFirstDayOfThisMonthThreeYearsAgo(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.YEAR, -3);
lastDate.set(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def theFirstDayOfThreeYearsAgo(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.YEAR, -3);
lastDate.set(Calendar.MONTH, 0);
lastDate.set(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def theFirstDayOfThisYear(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.set(Calendar.MONTH, 0);
lastDate.set(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def theLastDayOfLastYear(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.YEAR, -1);
lastDate.set(Calendar.MONTH, 11);
lastDate.set(Calendar.DATE, 31);
str = sdf.format(lastDate.getTime());
return str;
} def theFirstDayOfTheQuarter(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
int i = 0
int j = 0
int month = lastDate.get(Calendar.MONTH)
if (month >= 1 && month <= 3) {
j = 0;
}
if (month >= 4 && month <= 6) {
j = 3;
}
if (month >= 7 && month <= 9) {
j = 6;
}
if (month >= 10 && month <= 12) {
j = 9;
}
lastDate.set(Calendar.MONTH, j);
lastDate.set(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def theLastDayOfLastQuarter(String theFirstDayOfTheQuarter){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(theFirstDayOfTheQuarter)
Calendar lastDate = Calendar.getInstance();
lastDate.setTime(date);
lastDate.add(Calendar.MONTH, -1);
lastDate.roll(Calendar.DATE, -1);
str = sdf.format(lastDate.getTime());
return str;
} def aYearAgoAfterTheLastDayOfLastQuarter(String theFirstDayOfTheQuarter){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(theFirstDayOfTheQuarter)
Calendar lastDate = Calendar.getInstance();
lastDate.setTime(date);
lastDate.add(Calendar.YEAR, -1);
str = sdf.format(lastDate.getTime());
return str;
} def theFirstDayOfLastQuarter(String theFirstDayOfTheQuarter){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(theFirstDayOfTheQuarter)
Calendar lastDate = Calendar.getInstance();
lastDate.setTime(date);
lastDate.add(Calendar.MONTH, -3);
str = sdf.format(lastDate.getTime());
return str;
} def theLastDayOfTwoQuartersAgo(String theLastDayOfLastQuarter){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(theLastDayOfLastQuarter)
Calendar lastDate = Calendar.getInstance();
lastDate.setTime(date);
lastDate.add(Calendar.MONTH, -3);
lastDate.set(Calendar.DATE, 1);
lastDate.roll(Calendar.DATE, -1);
str = sdf.format(lastDate.getTime());
return str;
} def theFirstDayOfSixMonthsAgoAfterTwoQuarters(String theLastDayOfTwoQuartersAgo){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(theLastDayOfTwoQuartersAgo)
Calendar lastDate = Calendar.getInstance();
lastDate.setTime(date);
lastDate.add(Calendar.MONTH, -8);
lastDate.set(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def theFirstDayOfThisMonthLastYear(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.YEAR, -1);
lastDate.set(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def theFirstDayOfLastYear(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.YEAR, -1);
lastDate.set(Calendar.MONTH,0)
lastDate.set(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def theLastDayOfLastWeek(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.WEEK_OF_MONTH,-1);
lastDate.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);
str = sdf.format(lastDate.getTime());
return str;
} def lastMarketClose(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
String ss = lastDate.get(Calendar.DAY_OF_WEEK)
if ("1".equals(ss)){
lastDate.add(Calendar.WEEK_OF_MONTH,-1);
lastDate.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY)
}
if ("7".equals(ss)){
lastDate.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY)
}
str = sdf.format(lastDate.getTime());
return str;
} def lastMarketCloseMinus2Days(){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar lastDate = Calendar.getInstance();
lastDate.add(Calendar.DATE, -2);
String ss = lastDate.get(Calendar.DAY_OF_WEEK)
if ("1".equals(ss) ){
lastDate.add(Calendar.WEEK_OF_MONTH,-1);
lastDate.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY)
}
if ("7".equals(ss)){
lastDate.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY)
}
str = sdf.format(lastDate.getTime());
return str;
} def twoYearsAgoOfLastMarketCloseMinus2Days(String lastMarketCloseMinus2Days){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(lastMarketCloseMinus2Days)
Calendar lastDate = Calendar.getInstance();
lastDate.setTime(date);
lastDate.add(Calendar.YEAR, -2)
lastDate.add(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def yesterdayOfLastMarketClose(String lastMarketClose){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(lastMarketClose)
Calendar lastDate = Calendar.getInstance();
lastDate.setTime(date);
lastDate.add(Calendar.DATE, -1);
str = sdf.format(lastDate.getTime());
return str;
} def aMonthAgoOfLastMarketClose(String lastMarketClose){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(lastMarketClose)
Calendar lastDate = Calendar.getInstance();
lastDate.setTime(date);
lastDate.add(Calendar.MONTH, -1)
lastDate.add(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def threeMonthsAgoOfLastMarketClose(String lastMarketClose){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(lastMarketClose)
Calendar lastDate = Calendar.getInstance();
lastDate.setTime(date);
lastDate.add(Calendar.MONTH, -3)
lastDate.add(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
} def threeYearsAgoOfLastMarketClose(String lastMarketClose){
String str = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(lastMarketClose)
Calendar lastDate = Calendar.getInstance();
lastDate.setTime(date);
lastDate.add(Calendar.YEAR, -3)
lastDate.add(Calendar.DATE, 1);
str = sdf.format(lastDate.getTime());
return str;
}
[Java] SoapUI使用Java获取各时间日期方法的更多相关文章
- java代码--Date类获取当前时间-格式化输出
44:52 阅读数:2299 package cn.Date; import java.text.Format; import java.text.SimpleDateFormat; import ...
- java 通过网络 ntp 获取网络时间
需要 commons-net-3.4.jar 库. import org.apache.commons.net.ntp.NTPUDPClient; import org.apache.commons. ...
- java获取当前日期时间代码总结
1.获取当前时间,和某个时间进行比较.此时主要拿long型的时间值. 方法如下: 要使用 java.util.Date .获取当前时间的代码如下 代码如下 复制代码 Date date = new ...
- atitit.获取北京时间CST 功能api总结 O7
atitit.获取北京时间CST 功能api总结 O7 1. 获取cst时间(北京时间)两布:1.抓取url timtstamp >>format 到cst 1 2. 设置本机时间 se ...
- java学习第13天( java获取当前时间,有关大数据的运算及精确数字运算,Date类)
一 java获取当前时间 学习一个函数,得到当前时间的准确值 System.currectTimeMillis(). 可以得到以毫秒为单位的当前时间.它主要用于计算程序运行时间,long start= ...
- Java获取系统时间
Java可以通过SimpleDateFormat格式化类对Date进行格式话获取时间. import java.util.*; import java.text.*; public class Tes ...
- Java 获取各时区时间,获取当前时间到格林威治时间1970年01月01日00时00分00秒的秒数
格林威治时间即UTC/GMT时间,1970年01月01日00时00分00秒(即UTC+8的北京时间1970年01月01日08时00分00秒)计算代码如下: /** * 获取指定时间到格林威治时间的秒数 ...
- Java从服务器上获取时间,动态在jsp页面显示
Java获取服务器时间,动态显示到jsp页面,大家都是到Java只能获取一次,到页面的时间是静态的,不过通过js和Java的合作,巧妙地实现此功能 本人是给电视做系统,客户要求页面能显示时间,因为电视 ...
- android java获取当前时间的总结
import java.text.SimpleDateFormat; SimpleDateFormat formatter = new SimpleDateFormat (&q ...
随机推荐
- android 案例二 登录界面
效果图: 运行图: 总结: 编写这个简单的用户登录界面,主要用到了以下的知识: java基础中的IO流的操作 用以读取.显示用户的信息 Android布局 线性布局和相对布局 数据的存储选在包 ...
- 16.语句include和require的区别是什么?为避免多次包含同一文件,可用(?)语句代替它们?
require->require是无条件包含也就是如果一个流程里加入require,无论条件成立与否都会先执行 require include->include有返回值,而require没 ...
- sql语句修改字段长度
sql语句修改字段长度 alter table <表名> alter column <字段名> 新类型名(长度) 例: alter table students alter c ...
- 论文阅读(Xiang Bai——【CVPR2012】Detecting Texts of Arbitrary Orientations in Natural Images)
Xiang Bai--[CVPR2012]Detecting Texts of Arbitrary Orientations in Natural Images 目录 作者和相关链接 方法概括 方法细 ...
- AngularJs的UI组件ui-Bootstrap---tabs控件
tabs控件使用uib-tabset指令和uib-tab指令,效果是这样的: <!DOCTYPE html> <html ng-app="ui.bootstrap.demo ...
- 【实践】js 如何实现动态添加文本节点
对于我这个js 小白来说 今天鼓起勇气做起了邮箱认证这个特效 但是这次不是想说如何实现这这个特效而是想记录一下特效当中的某个部分 那就是向元素节点动态添加文本节点 百度了一下动态添加文本节点的方式 是 ...
- WebApi身份认证解决方案:Basic基础认证
前言:最近,讨论到数据库安全的问题,于是就引出了WebApi服务没有加任何验证的问题.也就是说,任何人只要知道了接口的url,都能够模拟http请求去访问我们的服务接口,从而去增删改查数据库,这后果想 ...
- web系统开发为什么用asp.net MVC,为什么不用?
向高手咨询下,现在asp.net MVC很流行,但我好像提不起兴趣.企业级Web应用,使用纯HTML+jquery交互+Http Handler(或WebAPI),不是挺好的吗?有很多优点:1.Ht ...
- 前端使用js读取文件
最近同时问我js能不能读取本地文件: 想起以前看到js读取本地文件的文章,然后自己写了个demo. ps:这有点想Java的IO流,但是又有差别. 首先我们定义一个input标签type=" ...
- [转]html5音乐播放器
http://files.cnblogs.com/files/xjyggd/html5music.rar import java.io.File;import java.util.ArrayList; ...