一个路过的小学生
介绍与演示云助手的用法,包含: - 云助手的简介 - 在 ECS 实例上手动执行命令的实例 - 在 ECS 实例上安装 Jenkins 的实验
由于对阿里云 OpenAPI 数量众多,为方便查阅制作了一个 Alfred 工作流
# 本文的“接口” 本文的-"接口",等同于 [RPC](https://en.wikipedia.org/wiki/Remote_procedure_call) 类协议/框架中的接口,例如SOAP, Apache Thrift, Apache Avro, Microsoft DCOM, WCF 及集团内最常用的 HSF, Dubbo 等等。此外,还有一些 RESTful 规范/框架(如Jax-
域名未识别,DNS 解析错误,可以使用以下命令测试看看
nslookup oapi.dingtalk.com
ping -c 4 oapi.dingtalk.com
protected static String getRemoteAddr(HttpServletRequest request) {
String caller = request.getHeader("X-Forwarded-For");
if (caller == null || caller.isEmpty() || caller.equals("unknown")) {
caller = request.getHeader("Proxy-Client-IP");
}
if (caller == null || caller.isEmpty() || caller.equals("unknown")) {
caller = request.getHeader("WL-Proxy-Client-IP");
}
if (caller == null || caller.isEmpty() || caller.equals("un")) {
caller = request.getHeader("HTTP_CLIENT_IP");
}
if (caller == null || caller.isEmpty() || caller.equals("un")) {
caller = request.getHeader("X-Real-IP");
}
if (caller == null || caller.isEmpty() || caller.equals("unknown")) {
caller = request.getRemoteAddr();
}
return caller;
}
"值传递"和"引用传递"这个称谓,一般是 .NET 平台(C#, F#, VB.NET 等等) 使用的术语。
using System;
namespace Demo
{
public struct Student
{
public long Id { get; set; }
public string Name { get; set; }
}
public class Contact
{
public string Name { get; set; }
public string Email { get; set; }
}
public static class Program
{
public static void TestStruct(Student student, int number) // 默认按值传递
{
student.Name = "student name"; // 此修改不会影响到方法调用者中的 stuct
++number;
}
public static void TestStructByRef(ref Student student, ref int number) // ref 强制改为按引用传递
{
student.Name = "student name"; // 此修改*会*影响到方法调用者中的 student
++number;
}
public static void TestClass(Contact contact) // 默认按引用传递
{
contact.Name = "contact name"; // 此修改*会*影响到方法调用者中的 contact
}
public static void TestString(String hello) // 默认按引用传递
{
hello = "hello, world"; // 此修改不会影响到方法调用者中的 hello
Console.WriteLine(hello); // will print "hello, world;
}
public static void TestStringOut(out String hello) // 默认按引用传递
{
hello = "hello, world"; // 此修改不会影响到方法调用者中的 hello
Console.WriteLine(hello); // will print "hello, world;
}
static void Main(string[] args)
{
Student student = new Student();
student.Name = "new student";
Console.WriteLine(student.Name);
int number = 0;
TestStruct(student, number); // struct 默认按值传递
Console.WriteLine(student.Name); // will write "new student" ##
Console.WriteLine(number); // will write 0
Console.WriteLine();
number = 0;
TestStructByRef(ref student, ref number);
Console.WriteLine(student.Name); // will write "student name" ##
Console.WriteLine(number); // will write 1
Console.WriteLine();
Contact contact = new Contact();
contact.Name = "new contract";
Console.WriteLine(contact.Name); // will write "new contact"
TestClass(contact); // class 默认按引用传递
Console.WriteLine(contact.Name); // will write "contact name" ##
Console.WriteLine();
String hello = "hello";
TestString(hello);
Console.WriteLine(hello); // will write "hello";
hello = "hello";
TestStringOut(out hello);
Console.WriteLine(hello); // will write "hello world";
}
}
}
简单来说,使用 JAVA 语言编写出来的源代码文件 .java,被 JAVAC 编译器编译成字节码文件 .class (及压缩打包成*.jar),可以不加修改地拷贝到其他平台上、同该平台上的 JVM 运行,该平台的 JVM 使用 JIT技术 将 .class 再动态编译为可以当前平台上运行的代码指令。