Php id card verification code calculation method and php verification code calculation method
The meaning of each Chinese (Mainland) citizen ID card number is described in many articles on the Internet. The last digit of the ID card number is the verification code, which is calculated based on the first 17 digits. The algorithm is like this: multiply each number of the first 17 digits by a string of weighti
I believe in a number of Web sites will see a number of articles published after the article is issued in a few seconds ago or a few months ago sent the document, below I will introduce the use of PHP to calculate the time lag to calculate how long the article publication distance from now.
The code is as follows
Copy Code
/*** Time Difference calculation*/function Time2units ($time){$year = Floor ($time/60/60/24/365)
we assume that the Earth is a perfect sphere, its radius is the mean radius of the Earth, which is recorded as R. If the zero-degree longitude line is used as the basis, the distance between the two points can be calculated based on the latitude and longitude of any two points on the Earth's surface. (here, the error caused by the calculation of the earth's surface topography is ignored, only theoretical estimates ). Set the longitude and latitude of
File Memory size calculation, memory size Calculation
/**
* Calculate the size of all files in a file.
Note: to calculate the size of all files in a folder, you must first obtain all files, then obtain the size of all files, and then add them together.
*/
NSFileManager * manager = [NSFileManager defamanager manager];
// Extract the file that requires Calculation
Date calculation implemented in java and date calculation implemented in javaThe date calculation here is relatively biased and rarely used (for example, obtaining the Monday or Sunday of the week where today is the week of the month ...), these methods are left over from previous projects. Now let's sort them out and share them with you.The tool class mainly inc
varDef_pi=Math.PI;//3.14159265359varDef_2pi=2*Math.PI;//6.28318530712vardef_pi180=Math.PI/180.0;//0.01745329252varDef_r=6370996.81;//radius of Earth//Using Arc angle method to calculate the distance between two points on the map and inconsistent with the Baidu map calculation resultsfunction getshortdistance(Lon1,LAT1,Lon2,LAT2){varEw1,ns1,Ew2,ns2;varDX,Dy,Dew;varDistance;//Angle converted to radiansEw1=Lon1*def_pi180;NS1=LAT1*def_pi180;Ew2=Lon2*de
2501. Calculation
ConstraintsTime limit:1 secs, Memory limit:256 MBDescription_gxx encountered a troublesome equation: S = n1 + N2 + N3 + ... + NK, known as N, K, for the value of S. Because _GXX maths is poor, I hope you can tell him the answer. But because his math is so bad, you just need to tell him to divide the remainder of s by 9901.InputTwo integers, N and K (n≤1000, k≤109).OutputA number that represents the remainder of s divided by 9901.
Python time difference calculation method, python Time Difference Calculation
This article describes how to calculate the time difference in python. Share it with you for your reference. The specific analysis is as follows:
1. Problem:
How can we calculate the interval of days, weeks, months, and years between two dates given to you?
2. solution:
The standard module datetime and third-party package dateutil
parts: exponent and mantissa, such a method of expression will generally lose a certain degree of precision, some floating-point operations will produce a certain error. For example, the binary representation of 2.4 is not exactly 2.4. Instead the nearest binary representation is 2.3999999999999999. The value of a floating-point number is actually computed by a particular mathematical formula.
In fact, the Java float can only be used for scientific calculations or engineering calculations, in m
Php simple calculation of page loading time, php Calculation of page loading
This example describes how to calculate the page loading time in php. Share it with you for your reference. The specific implementation method is as follows:
Simply put the start time in the page header, and the end time at the end of the page to calculate the page loading time
$ Start = time (); // put a long operation in heres
C ++ Displacement Calculation and Displacement Calculation
Int main () {int a = 3; int B = a
Today, I looked at the displacement operation and found that many blog posts calculated the complicated displacement. I wrote a code to find a small rule. I wonder if it was an existing algorithm (or my guess is incorrect ), now, I hope you can provide comments and suggestions.
Take the left displacement as an e
[[Nsfilemanager Defaultmanager] removeitematpath: [filedownload creatpath:p. Name] Error:nil]; Remove from Table[self. Receivearry removeobjectatindex: Indexpath.row]; [_tableview deleterowsatindexpaths:@[indexpath] withrowanimation: Uitableviewrowanimationautomatic]; Remove the file from the local technology directly by using the File Manager directly delete,,,,,,,, Delete the contents of the cell must first delete the contents of the source array, and then delete the cor
Relational calculation methods of the Set, and relational calculation methods of the Set
A = [4, 5, 6, 7, 8]A = set ()# A. add ('adfaaaa') # add as only one element# A. update ([121212]) # It must be an iterative object to add# Print ()B = {1, 2, 3, 4, 5}# Print the total elements at the intersection of the SetPrint (a. intersection (B) # method 1Print (a B) # method 2
{4, 5}
# Print out all the elements o
Java date comparison, date calculation, and java date comparison Calculation
They are common comparison methods between dates for future reference.
Warm-up: Get the current time
SimpleDateFormat df = new SimpleDateFormat ("yyyy-MM-dd HH: mm: ss"); // you can specify the date format.String nowDate = df. format (new Date (); // new Date () is used to obtain the current system time.
Note: The landlord always t
Date and common time calculation in php, and date calculation in php
It was used in projects until today, yesterday, this week, this month, this quarter, this year, last week, last quarter, and so on, therefore, we plan to summarize and learn related time knowledge points of php.
1. Read the date function in the php manual.
Common time functions:
Checkdate () to verify whether a time is correct
Date_default
Python implements the reciprocal calculation method, and python implements reciprocal calculation.
This example describes how to calculate the countdown in python. Share it with you for your reference. The details are as follows:
class Expr: def __add__(self, other): return Plus(self, other) def __mul__(self, other): return Times(self, other) class Int(Expr): def __init__(self, n): self.n = n def
JS handles some simple calculation questions and JS handles simple calculation questions
Let's first look at the effect after running:
Next we will share with you all the code:
The JS Code and style can be flexibly changed when needed. Thank you for your support for the help house.
date parameter is a DATE value and your calculation only contains the YEAR, MONTH, and DAY sections (that is, there is no time section), the result is a DATE value. Otherwise, the result is a DATETIME value.
Mysql> SELECT "23:59:59" + INTERVAL 1 SECOND;-> 00:00:00
Mysql> select interval 1 DAY + "1997-12-31 ";
-> 1998-01-01
Mysql> SELECT "1998-01-01"-INTERVAL 1 SECOND;
-> 1997-12-31 23:59:59
Mysql> SELECTDATE_ADD("23:59:59", INTERVAL 1 SECOND );
-> 00
.
Second, bookmark calculation
1. Insert the Formula field. Switch to the Insert tab, click the field button, and select "Formula" in the pop-up window. Then, after the "=" in the field Code text box, type "one + two + three + four + five" (add up the bookmark for each question score), and the last field code is "= one + two + three + four + five".
2. Change the score. Double-click the Text form field, in the pop-up window
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.