ipify—A Simple IP Address API


你可以直接访问:[https://api.ipify.org/][1] 查看你的IP





你值得使用 ipify是因为:

  • 你可以毫无限制地使用它(即使你每分钟做数百万个请求)。

  • 它总是在线并可用的,它的基础设施是由 Heroku 提供的,这意味着你不用管运行API的服务器是否挂掉了,如果有龙卷风摧毁了东海岸,ipify仍将运行。

  • 它兼容IPv4和IPv6地址,无论你使用什么样的技术,都不会有问题。

  • ipify是开源的,Git仓库

  • 从不记录访问者信息

  • 最后,ipify是 Randall Degges 资助的,所以不用担心它会消失




ip=$(curl -s https://api.ipify.org)
echo "My public IP address is: $ip"


# This example requires the requests library be installed.  You can learn more
# about the Requests library here: http://docs.python-requests.org/en/latest/
from requests import get
ip = get('https://api.ipify.org').text
print('My public IP address is: {}'.format(ip))


    $ip = file_get_contents('https://api.ipify.org');
    echo "My public IP address is: " . $ip;


try (java.util.Scanner s = new java.util.Scanner(new java.net.URL("https://api.ipify.org").openStream(), "UTF-8").useDelimiter("\\A")) {
    System.out.println("My current IP address is " + s.next());
} catch (java.io.IOException e) {


var http = require('http');
http.get({'host': 'api.ipify.org', 'port': 80, 'path': '/'}, function(resp) {
  resp.on('data', function(ip) {
    console.log("My public IP address is: " + ip);


<script type="application/javascript">
  function getIP(json) {
    document.write("My public IP address is: ", json.ip);
<script type="application/javascript" src="https://api.ipify.org?format=jsonp&callback=getIP"></script>


<script type="application/javascript">
  $(function() {
      function(json) {
        document.write("My public IP address is: ", json.ip);


package main
import (
func main() {
        res, _ := http.Get("https://api.ipify.org")
        ip, _ := ioutil.ReadAll(res.Body)

A Simple Question of Chemistry


Your chemistry lab instructor is a very enthusiastic graduate student who clearly has forgotten what their undergraduate Chemistry 101 lab experience was like. Your instructor has come up with the brilliant idea that you will monitor the temperature of your mixture every minute for the entire lab. You will then plot the rate of change for the entire duration of the lab.nBeing a promising computer scientist, you know you can automate part of this procedure, so you are writing a program you can run on your laptop during chemistry labs. (Laptops are only occasionally dissolved by the chemicals used in such labs.) You will write a program that will let you enter in each temperature as you observe it. The program will then calculate the difference between this temperature and the previous one, and print out the difference. Then you can feed this input into a simple graphing program and finish your plot before you leave the chemistry lab.nnnInputnnThe input is a series of temperatures, one per line, ranging from -10 to 200. The temperatures may be specified up to two decimal places. After the final observation, the number 999 will indicate the end of the input data stream. All data sets will have at least two temperature observations.nnnOutputnnYour program should output a series of differences between each temperature and the previous temperature. There is one fewer difference observed than the number of temperature observations (output nothing for the first temperature). Differences are always output to two decimal points, with no leading zeroes (except for the ones place for a number less than 1, such as 0.01) or spaces.nnAfter the final output, print a line with "End of Output"nnnSample Inputnn10.0n12.05n30.25n20n999nnnSample Outputnn2.05n18.20n-10.25nEnd of Output 问答

a simple question about deploying a simple bean in deploytool of j2eesdk


distribute: D:\examples\MyFirstExample.earrn*** Operation failed:rnjava.lang.IllegalStateException: Premature end of file.rnrnat com.sun.enterprise.deployapi.SunDeploymentManager.distribute(SunDeploymentManager.java:728)rnrnat com.sun.enterprise.deployapi.SunDeploymentManager.distribute(SunDeploymentManager.java:249)rnrnat com.sun.enterprise.tools.deployment.ui.deploy.DeploymentPlatform._distribute(DeploymentPlatform.java:955)rnrnat com.sun.enterprise.tools.deployment.ui.deploy.DeploymentPlatform._deploy(DeploymentPlatform.java:1051)rnrnat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rnrnat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rnrnat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rnrnat java.lang.reflect.Method.invoke(Method.java:324)rnrnat com.sun.enterprise.tools.deployment.ui.utils.UIActionDispatcher.invoke(UIActionDispatcher.java:365)rnrnat com.sun.enterprise.tools.deployment.ui.utils.UIActionDispatcher.invoke(UIActionDispatcher.java:387)rnrnat com.sun.enterprise.tools.deployment.ui.deploy.DeploymentPlatform$DeploymentProcess.run(DeploymentPlatform.java:1492)rnrnat com.sun.enterprise.tools.deployment.ui.utils.ExecProcess$ThreadProcess.run(ExecProcess.java:570)rnrnat java.lang.Thread.run(Thread.java:536)rnrnrn**********************************************************************rn[Completed (time=0.4sec, status=20)]rn**********************************************************************rnrnrnthe source code has compiled successfully,so there should be no problem in the files itseldrnrnand the deployment descriptor is as follows:rnrnrnrn Your first EJB application rnrn JUST A TESTrnrn rnrn rnrn Examplernrn examples.ExampleHomernrn examples.Examplernrn examples.ExampleBeanrnrn Statelessrnrn Containerrnrn rnrn rnrnrnrnthe sun-j2ee-ri.xml is as follows:rnrnrnrnrn rn rn Examplern Examplern rn rn rnrnrnrnand I am sure the directory structures is all rightrn.The problem may result from deploying,but I just do not know why?rni am using standard deploytool in j2eesdkrnrnthank you very much!!!!!!!rnrn 论坛