Java uses the calendar class to get the specified date
The acquisition of a specified date is based on the number of days when the specified date differs from the current date, and then sets the value of calendar. day_of_month using the set method.
Calendar Cal = calendar. getinstance ();
Cal. Set (calendar. day_of_month, Cal. Get (calendar. day_of_month)-dayplu
Subnet division definition: Internet organizations define five IP addresses, which are A, B, and C. There are 126 Class A networks, and each class A network may have 16777214 hosts, which are in the same broadcast domain. It is impossible to have so many nodes in the same broadcast domain. The network will be saturated due to broadcast communication. As a result, most of the 16777214 addresses are not allocated. You can further divide a class-based IP
As we all know, in order to determine subnets, separate the host and router each interface, resulting in a number of separate network islands, interface to the end of these independent network connections. Each of these independent networks is called a subnet (subnet).
You must know something about IP addresses, right? We know that the TCP/IP protocol that is widely used on the internet is the use of IP ad
regeneration of dead processes.
6./etc/fstab Information of the file system that can be mounted in the system.
7./etc/lvmtab Run the following command:# Strings/etc/lvmtab; view system VG and disk information.
8./etc/rc. config. d/netconf Contains the system name and network configuration information, such as the IP address, subnet mask, and route information.
9./STAND/SystemContains the system driver and subsystem information, kernel device informat
file names of a file from the database.Find./-name index. jsp find the file named index. jsp in the current directoryGrep (grep "mobile = 13712345678" logfile1, in logfile1Search for "mobile = 13712345678 ")Ping (ping 61.129.78.9, ping www.163.com, and test whether the network connection is normal)Ifconfig (ifconfig, view the local IP address, subnet mask, etc)Ps (ps aux view processes started in the system, ps aux | grep programe1,Check if program 1
About DHCP principles
DHCP principle IP address lease request packets sent by the customerThe DHCP Client initializes TCP/IP and sends a dhcpdiscover broadcast packet to the network through UDP port 67 to request the lease IP address. The Source IP address in the broadcast package is 0.0.0.0, and the target IP address is 255.255.255.255. The package also contains the client's MAC address and computer name.IP address lease in DHCP response provides packetsAny DHCP server that receives a dhcpdisco
architecture is adopted in the transmission plane of Ason, in order to realize the routing, we can use the hierarchical routing method to realize the transmission plane of Ason Network connectivity (NC) that supports End-to-end business. Based on the analysis of the network structure of Ason and the routing structure of Ason, this paper focuses on the implementation of the hierarchical routing technology in Ason.
The layer network structure of Ason
It is suggested by g.805 that the transport
the SubnetID field to x=4,2 4 times=16, which is larger than the maximum number of subnets that may be used 10, meets the requirements.2) Select the length value y of the HostID field, and ask for the Y-order of the Nhost≤2。 For example, if the number of subnet hosts is nhost to 12, select the length value of the HostID field to y=4,2 4 times=16, which is larger than the maximum number of possible hosts 12, meets the requirements.Note: A value of 0 f
Common functions of date and time operations in Java
1. Calculate the maximum number of days in a monthCalendar time = calendar. getinstance ();Time. Clear ();Time. Set (calendar. year, year );Time. Set (calendar. Month, I-1); // note that the Calendar Object is 0 by defaultInt day = time. getactualmaximum (calendar. day_of_month); // number of days of the current monthNote: before using the set method, you must clear it first. Otherwise, many information will inherit from the current system
. Calculate the maximum number of days of a month
Calendar time = Calendar. getInstance ();Time. clear ();Time. set (Calendar. YEAR, year); // year is intTime. set (Calendar. MONTH, I-1); // note that the Calendar Object is 0 by defaultInt day = time. getActualMaximum (Calendar. DAY_OF_MONTH); // number of days of the current monthNote: before using the set method, you must clear it first. Otherwise, many information will inherit from the current system time.
2. Conversion of Calendar and Date
. Calculate the maximum number of days of a month
Calendar time = calendar. getinstance ();Time. Clear ();Time. Set (calendar. year, year); // year is intTime. Set (calendar. Month, I-1); // note that the Calendar Object is 0 by defaultInt day = time. getactualmaximum (calendar. day_of_month); // number of days of the current monthNote: before using the set method, you must clear it first. Otherwise, many information will inherit from the current system time.
2. Conversion of calendar and date
1. calculate the maximum number of days of calendar month. getinstance (); time. clear (); time. set (calendar. year, year); // year is inttime. set (calendar. month, I-1); // note that the default January Calendar Object is 0 int day = time. getactualmaximum (calendar. day_of_month); // number of days of the current month Note: before using the set method, you must clear it first. Otherwise, many information will inherit from the current system time. conversion of calendar and date (1) convert
number of days in a monthCalendar time = Calendar. getInstance ();Time. clear ();Time. set (Calendar. YEAR, year );Time. set (Calendar. MONTH, I-1); // note that the Calendar Object is 0 by defaultIntday = time. getActualMaximum (Calendar. DAY_OF_MONTH); // number of days of the current monthNote: before using the set method, you must clear it first. Otherwise, many information will inherit from the current system time.2. Conversion of Calendar and Date(1) convert Calendar to DateCalendar
network.
Command:/etc/rc.d/init.d/network restartThe second type (quick change):
Ifconfig eth0 x.x.x.x//Set the NIC
Ifconfig eth0 Network x.x.x.x//Set subnet mask
Broadcast addresses and DNS are used by default.Note: The network configuration for this operation takes effect immediately, but only temporarily, and the system reboot will revert to the previous.The third (modify the bottom-level network card file content):
Calendar class of java
The Calendar in java is often ignored during development. This blog summarizes this class, which is helpful for later project use periods.Functions of the Calendar constant (field)
Calendar cal = Calendar. getInstance (); cal. get (Calendar. DATE); // ----------------------- 1-31cal.get (Calendar. DAY_OF_MONTH); // --------------- 1-31cal.get (Calendar. DAY_OF_WEEK); // --------------
requires a restart of the network.
Command:/etc/rc.d/init.d/network restartThe second type (quick change):
Ifconfig eth0 x.x.x.x//Set the NIC
Ifconfig eth0 Network x.x.x.x//Set subnet mask
Broadcast addresses and DNS are used by default.Note: The network configuration for this operation takes effect immediately, but only temporarily, and the system reboot will revert to the previous.The third (modify the bottom-level network ca
understanding of the network ID and host ID. To express an IP address, you can use either the address + subnet mask or the address prefix. Otherwise, you cannot determine which network the IP address belongs, even more unable to know its network ID and host ID.In fact, this is a very simple question. You don't need to calculate it at all. You just need to understand the meaning of the address prefix "/16. Because the network ID and host ID must be th
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.