These two tips, do not write do not know, a write scare!
Are seemingly simple, actually do up on the Meng, have to think carefully, can write right!
All have the date operation of the program should be careful Oh!
Let's say the second one:
2. Calculate the age accurately according to the date of birth!
The so-called calculation of the exact age is: birthday is not a day to grow one year old!
Everyone commonly used, the number of years counted as age
...
Editor's note: The week used to calculate the actual date is no problem. The principle is calculated based on the number of weeks known to be January 1, 1. If the day of the week is agreed on in your topic, you should pay attention to whether the day of the week is the same as the actual week, and if so, you need to consider a few days apart.
If you feel that not enough fun, you can look at the following formula of the derivation process, so th
For some large files, sometimes you will need to calculate some of the content of the hash, the following function calculates the file tail 1 m, the middle jump 100M take 10K and file size hash value Public StaticString Calhash (String path)throwsIOException {File file=NewFile (path); if(!File.canread ())return""; if(File.length () ) { return""; } //FileInputStream in = new FileInputStream (file);Randomaccessfile in =NewRando
In a paper, there will be many questions, the points of each topic are different, how to quickly calculate the total score of all the topics?, we all know that in the spreadsheet can be easily calculated, in fact, in the WPS text can also use formulas to calculate the table, but the score of each question is not in the table, But scattered at the end of each topic, how to
Background
It involves using Tomcat as a server in our daily development, but how much of a thread pool should we set up? And according to what principles to design this thread pool?Next, I will introduce how I design and calculate.
Goal
Determine the tomcat server thread pool size
Specific methods
It is well known that Tomcat accepts a request post-processing process that involves CPU and IO time. When IO waits, the C
, the greater the degree. The horizontal line is latitude, and the vertical line is longitude. Of course, we can calculate the equation of four yuan and two times. Both longitude and latitude are an angle. Longitude is a two-sided angle, which is the angle of two meridians. Because all meridians are the same length, in order to measure longitude to select a starting point, after 1884 years of International conference, decided to take the meridian line
Script Function
The script is written in Perl to calculate the MD5 value of the file.
Script usage
After installing the operating system, the server calculates the MD5 values of all the binary files in the PATH variable, calculates the MD5 values of a single file, and computes a directory (including subdirectories) the MD5 values of all files are recorded in the file, and a new copy is generated later. Then, two files are compared to determine whether
The synodic of the Chinese lunar calendar is the basis of lunar calendars, and synodic is strictly to the sun and Moon, the day of the beginning of the month as the first, so the moon and sun time calculation is the key to make the lunar calendar. This paper will introduce the theory of ELP-2000/82 Moon operation and how to calculate the time of sun and moon with Elp-2000/82 Moon Operation theory.
To calculate
What to do: a total of 12 months of JSON data (that is, 12 JSON files), a unit of JSON data is shown below. Read the data and find the annual and quarterly averages for each (over 100) cities.
{"Time_point": "2014-01","Area": "* * *","AQI": "71","Pm2_5": "47","PM10": "69","Rank": "7"}
I do this in two steps, read the JSON and import SQLite, find the database data as needed, and calculate the average. Import the database first the move is
There are two ways to calculate the time difference, one is to convert the times to minutes, one to convert the time to hours, the latter to divide so it is unavoidable to generate floating-point numbers, so we choose to convert to minutes to calculate.Title: Calculate their time difference at two points, for example, 1:50 and 3:21Define four variables to save the input timeDefault a time is less than B tim
When Excel establishes a financial report, it is usually necessary to calculate the relevant data, which is where we use the Excel program to facilitate the language. In the calculation of data, you need to establish a formula to achieve, and in the use of the formula, you need to refer to the value of the cell to calculate, then in Excel how to use the calculation formula for the operation? The following s
The calculation of personal income tax seems to be more complicated, it seems that it is impossible to use the VBA macro programming and only calculate by formula. In fact, the function formula provided by Excel can not only calculate the personal income tax, but also have a lot of flexibility: you can change the withholding tax base at will, arbitrarily change the deduction of tax subsection limit value an
The calculation of personal income tax seems to be more complicated, it seems that it is impossible to use the VBA macro programming and only calculate by formula. In fact, the function formula provided by Excel can not only calculate the personal income tax, but also have a lot of flexibility: you can change the withholding tax base at will, arbitrarily change the deduction of tax subsection limit value an
PHP used to generate machine code, to others to calculate the number to use, how to break?The following is the decrypted source code, before the source code is encrypted;This machine code will be generated. Machine code: BDC16D-1843D62D2956-2D2956EEF3A8-F3A8The science of the information looks like the MD5 turn 16 into the system what, there will be cracked master did not?$get _string = "TYCFTKHUVOJHJHPC";function Strtomd5_pass ($STR){Global $get _str
A recent project requires me to calculate the distance between two places, not a straight distance.That must use the relevant map API Ah, I chose the Baidu map
I have set the incoming parameters of two, respectively, the origin and destination of the district (county) nameThe first is to use JS SDK to calculate, but the network requirements a little high, network stability can be calculated, instability wil
Shopping cart clicks can reduce or add items and automatically calculate prices:
Shopping cart may have such a function, that is, click on the button can achieve a reduction or increase in the number of goods, and can be real-time calculation of the total price of goods, the following is a code example to introduce how to achieve this function, of course, the following simulation of the implementation of the shopping cart is difficult But you can get
Tags: style blog http io ar color OS sp forPeter wrote a post a while ago about choosing a good InnoDB log file size. Ânot to pick in Peter, but the post actually kind of talks about a lot of things and then doesn ' t tell you how to choose A good log file size! Âso I thought I ' d clarify it a little.The basic point is this your log file needs to being big enough to let InnoDB optimize its I/O, but not so big that recovery Takes a long time. Âthat much Peter covered really well. Âbut How does c
How to calculate the day of the week?Slowtiger published on 2009-11-19 08:42:00How to calculate the day of the week?--Caille (Zeller) formulaWhat is the day of the week in history? What day of the future is the week? With regard to this problem, there are many computational formulae (two general formulas and some piecewise formulas), the most famous of which is the Caille (Zeller) formula. namely w=y+[y/4]+
Sometimes, we need to know how much memory Java objects occupy, someone to compare two times before and after two times System.GC () to calculate the size of the Java object, or the size of the estimated objects according to the Java object Memory in the Java Virtual Machine specification, These two methods are more or less problematic because System.GC () does not necessarily promote GC, the same type of object in 32-bit and 64-bit JVM uses the same
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.