Remember to do a training agency website when need to locate, then use the Sohu API, not very accurate.Later when the e-commerce use of Sina's API, feel OK,,,, at that time, if you have a local IP library how cool ah? At that time, the shared IP library is only QQ Pure library, the inside of something more miscellaneousI found a good thing when I saw this news (http://news.cnblogs.com/n/530762/) in the blog
has been so frustrating is indeed the shortest. This fact is needed to prove the principle of jumping global optimization.The following gives a simple proof of the correctness of the Dijkstra algorithm, the detailed and complete mathematical proof can refer to this idea:The problem of the jump-through global optimization is the name of the next-Hop global optimization Problem:A single-hop global optimization proves that the following gives a simple proof of the global optimization by jumping, p
You can use the following code to get the MAC address, depending on your actual needs./*** get MAC address * @param ipAddress127.0.0.1* @return based on IP address * @throws SocketException* @throws unknownhostexception*/publicstatic stringgetlocalmac (stringipaddress) throwssocketexception,unknownhostexception {//TODOAuto-generatedmethodstubStringstr= ""; stringmacaddress= "";finalstringloopback_address=
To accomplish useful work, peers in peer-to-peer applications must be able to discover each other and interact with each other. This article provides an implementation of a discovery based on IP multicast.
Before a software entity can participate in a direct peer-to-peer interaction with a Peer-to-peer application feature, the entity must discover the appropriate peers to interact with. All available Peer-
{
[AsyncSocket release];
[Super dealloc];
}
@ End
Here we only implement a simple client. The server implementation is written by pathy. In the source code.
Compile the running result:
Server:
bogon:iosworkspacevsp$./Servers.py
The client's IP address is: ('192. 168.0.169 ', 192)
Subsequent data
Client:
19:14:47. 723 iphone. socket [3186: 307] WB: Notice: WinterBoard
19:14:48. 892 iphone. socket [3186: 307] onSocket: 0x16bd00
Attention:The settings file is typically in the/ETC/HTTPD/CONF.D directory1. vim/etc/httpd/conf.d/vhost1.conf Create the Vhost1.conf file and enter the following contentServerName www1.magedu.comDocumentroot/data/vhosts/www12. vim/etc/httpd/conf.d/vhost2.conf Create the Vhost2.conf file and enter the following contentServerName www1.magedu.comDocumentroot/data/vhosts/www1Using HTTPD-T to detect syntax with or without errors3, mkdir-pv/etc/httpd/conf.d/vhosts/www{1,2} Create directory4. Create a
1. Based on IP access to the location of the user's ideas:Query the database by IP address, then extract the corresponding geographic information from the database
2. Download the Maxmind database download addresshttps://dev.maxmind.com/geoip/geoip2/geolite2/It has the binary format and CSV format, which can be downloaded first:
geolite2-city.mmdb.gz
geolite2-cou
Based on IP to judge, will automatically jump to the visitor's IP according to the location of the city's local substationThe reference code is as follows:
Function lookaddress (SIP)Dim str1, str2, STR3, STR4Dim numDim IRSIf IsNumeric (Left (SIP, 2)) ThenIf sip = "127.0.0.1" Then sip = "192.168.0.1"STR1 = Left (sip, InStr (SIP, ".")-1)SIP = Mid (sip, INSTR (SIP,
A few days ago, we helped the company build a navigation page for internal resources, allowing employees to access various common systems. Because this page contains some sensitive information, we want to authenticate it, but it is only enabled when it is accessed from the internet. When it is accessed from the company intranet, you do not need to enter the account password.According to this requirement, I studied Nginx configuration and found that the satisfy command can solve this problem well
msg[30] in the case that the structure is a chat message is the chat message, if the MSG is not the string I specify, the server will send it as a chat message forwarding, so if I enter "FILE" in the chat room and send ... You know, the bug came up.。Send and receive files I was in the server send and receive the file to send and receive functions, to determine that the received file is jumped into this function, so there may be two clients send receive files when other client group chat message
restart the Apache service/application/apache/bin/apachectl-t/application/apache/bin/apachectl GracefulTo configure a virtual host based on an IP address
Configure an IP alias: (The following settings take effect temporarily)Ifconfig eno16777736:0 172.17.0.111/24 up
Modify a site profile vim httpd-vhosts.confUse the # number to comment out the previ
Linux Web server (ii)1: Build a domain-based virtual hostFirst, set up a DNS server for two sites, and create a new zone, respectively: Www.goole.com and www.baidu.com2) Modify the configuration file3) Modify the data file4) Restart the DNS service5) Build Two websites6: Preparing the Web page7) Open the virtual host configuration file, modify the configuration file8: Add the following content9) Modify the master configuration file to enable the virtu
This article illustrates the method of PHP based on Curl to implement random IP address crawling content. Share to everyone for your reference, specific as follows:
Using PHP Curl We can simulate user behavior, we can set the IP and browser information we visit and set the post mode.
Curl is a very cool thing! ~ Unexpectedly also can generate random
This article mainly shares the js method for locating the geographical location of the current City Based on the IP address on the PC end, which has good reference value. Let's take a look at the following code:
Words not much to say, direct sticker code!Running this code is OK:The interface used:? format=jsreturn Result:var remote_ip_info = {"ret": 1, "Start": "1.192.0.0", "End": "1.193.127.255", "Country": "\u4e2d\u56fd", "province": "\ u6cb3\u5357 "," City ":" \u90d1\u5dde ","District": "", "ISP": "\u7535\u4fe1", "type": "", "desc": ""};Country: CountryProvince: ProvinceCity: UrbanISP: Network used (e.g. telecommunications) JS gets the city based on the
This article mainly to share with you how PHP based on IP address to obtain the city, this article mainly in the form of code, I hope to help everyone.
/octet-stream;Sendfile on;Keepalive_timeout 65;upstream Web1 {Server 192.168.1.101:80 weight=1 max_fails=2 fail_timeout=30s;Server 192.168.1.102: weight=1 max_fails=2 fail_timeout=30s;}#web1 Load Module name (custom).# Weight weights, the higher the value the greater the priority.#max_fails the maximum number of failures, the list of loads is excluded if the host fails to connect two consecutive times.#fail_timeout the wait time for the request to fail.server {Listen 80;server_name localhost;Loc
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.