Atitit ATI LicenseService Design principle

Source: Internet
Author: User

Atitit ATI LicenseService Design principle

C:\0workspace\AtiPlatf\src_atibrow\com\attilax\license\LicenseX.java

V1

More time to be super

V2 According to the percentage of slow time .

draft V3:

Laicense file, Hto sh aes time:

Invoke

System. out.println( Licensex.iscanuse_byusepercent("2016-05-01") );

Author :: ★ (Attilax) >>>    nickname : old Wow's paw   (   full name:: ATTILAX AKBAR AL RAPANUI  Attilax   Baroque   Alpha   Rapa Nui   )   Kanji name: Ayron, Email:[email protected]

reprint Please indicate source: http://www.cnblogs.com/attilax/

Private int usepercent(String Last_check_time) {

String d= "2016-09-01";

 Date D= Dateutil.str2date(Last_check_time, false);

 if(New Date().GetTime()<=D.GetTime())

return ;

 int Dayinterval = Dateutil.Getdayinterval(D,New Date());

&NBSP; if ( dayinterval > 100 )  

&NBSP; return   0 ;

&NBSP; dayinterval 100 - dayinterval

return dayinterval ;

}

Public Boolean iscanuse_byusepercent(String Last_check_time) {

int Use=usepercent(last_check_time );

int RDMRANDOMX.Random(1,  -);

if (rdm<=use)

return true;

Else

return false;

}

Atitit ATI LicenseService Design principle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.