编译型语言
			人类代码 ————》一次性把代码给 翻译官(编译器)————》汇编--》机器语言
			代表 : c,c++,golang
			优点:执行速度快
			缺点:跨平台可移植性差
				硬件  , cpu , 有自己指令规则  0000000001 打印, 1110000 play music
					intel ,amd : 复杂指令集 ,高性能高功耗
					ARM :精简指令集   手机  平板 , 低功耗

					你的基于intel平台编译出来的程序是没有办法在arm平台上运行
               软件,你的c程序想在windows,linux,mac同时可以运行,
					windows  invoke_window
					linux,mac  call_window
		解释型语言
			人类代码 ————》边执行边翻译(解释),陪同翻译(解释器/虚拟机) ————》机器语言
			代表:python,php,java,ruby,c#
			优点:跨平台好
			缺点:翻译需要时间,执行速度 慢
			编译型语言Comopile:C,C++编译成可执行文件机器码与CPU接触,多个文件编译 后链接起来生成一个可执行文件又称为链接程序。一次把所有的代码转换成机器语言,然后写成可执行文件。
			解释型语言:Java,Python更容易移植 边运行边解释。
计算机不能直接理解任何除机器语言以外的语言,所以必须要把程序员所写的程序语言翻译成机器语言才能执行程序。程序语言翻译成机器语言的工具,被称为翻译器。
var s ="hello";
var i = 0;
var b = true;
a = 100         # 不需要在a前面定义变量a的数据类型,内部自动记录了整形
b = 3.1415      # 不需要在b前面定义变量b的数据类型,内部自动记录了浮点型
yum install -y gcc

yum install libtermcap-devel ncurses-devel libevent-devel readline-devel

curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz

tar -zxf lua-5.3.5.tar.gz

cd lua-5.3.5

make linux test

make install
>>> 67 + 8
75
>>> 67 + '8'
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    67 + '8'
TypeError: unsupported operand type(s) for +: 'int' and 'str'
 1 package Com.Table;
 2 
 3 
 4 interface InterfaceA
 5 {
 6     public final String InterfaceA = "InterfaceA";
 7     abstract void ShowStringA();
 8 }
 9 interface InterfaceB extends InterfaceA
10 {
11     public final String InterfaceB = "InterfaceB";
12     abstract void ShowStringB();
13 }
14 interface InterfaceC extends InterfaceB
15 {
16     public final String InterfaceC = "InterfaceC";
17     abstract void ShowStringC();
18 }
19 public class ThirteenTable implements InterfaceA, InterfaceB, InterfaceC{
20     @Override
21     public void ShowStringA() {
22         System.out.println(InterfaceA);
23     }
24  
25     @Override
26     public void ShowStringB() {
27         System.out.println(InterfaceB);
28     }
29  
30     @Override
31     public void ShowStringC() {
32         System.out.println(InterfaceC);
33     }
34  
35     public static void main(String []args)
36     {
37         ThirteenTable Interface = new ThirteenTable();
38         Interface.ShowStringA();
39         Interface.ShowStringB();
40         Interface.ShowStringC();
41     }
42 }
SHOW VARIABLES LIKE 'innodb_log_buffer_size';-- global级别,无session级别
String s1 = "1";
String s2 =  "2";
final String s3 = s1 + s2;//按理来说这一步应该会产生一个新的String对象,但是编译器判断是final类型,直接会将s1+s2替换为“12”
 1 package Com.Table;
 2 
 3 
 4 class Penson
 5 {
 6     protected String name;
 7     protected String addr;
 8     protected String sex;
 9     protected int age;
10  
11     public String getName() {
12         return name;
13     }
14  
15     public void setName(String name) {
16         this.name = name;
17     }
18  
19     public String getAddr() {
20         return addr;
21     }
22  
23     public void setAddr(String addr) {
24         this.addr = addr;
25     }
26  
27     public String getSex() {
28         return sex;
29     }
30  
31     public void setSex(String sex) {
32         this.sex = sex;
33     }
34  
35     public int getAge() {
36         return age;
37     }
38  
39     public void setAge(int age) {
40         this.age = age;
41     }
42  
43     void ShowItems()
44     {
45         System.out.println("姓名:" + getName()
46                 + " 地址:" + getAddr()
47                 + " 性别:" + getSex()
48                 + " 年龄:" + getAge());
49     }
50 }
51  
52 class Student extends Penson
53 {
54     int mathScore;
55     int englishScore;
56  
57     public Student(String name, String addr, String sex, int age, int mathScore, int englishScore) {
58         this.mathScore = mathScore;
59         this.englishScore = englishScore;
60         this.name = name;
61         this.addr = addr;
62         this.sex = sex;
63         this.age = age;
64     }
65  
66     void ShowItems()
67     {
68         System.out.println("姓名:" + getName()
69                 + " 地址:" + getAddr()
70                 + " 性别:" + getSex()
71                 + " 年龄:" + getAge()
72                 + " 数学成绩:" + mathScore
73                 + " 英语成绩:" + englishScore);
74     }
75 }
76 public class FourteenTable {
77     public static void main(String []args)
78     {
79         Student stu = new Student("borter", "Beijing", "boy", 22, 80, 90);
80         stu.ShowItems();
81     }
82 }
83  
运行环境:
root@ubuntu:~# go version
go version go1.6.2 linux/amd64设置GOPATH:
root@ubuntu:/home/go# export GOPATH=/home/go
root@ubuntu:/home/go# echo $GOPATH
/home/go学习一门新语言时,一种仪式性的开场程序就是从那个经典的helloWorld开始:
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")}
root@ubuntu:/home/go/ch01# go run helloworld.go 
Hello, World!root@ubuntu:/home/go/ch01# go build helloworld.go 
root@ubuntu:/home/go/ch01# ls -l
total 2240
-rwxr-xr-x 1 root root 2288216 Jun 30 03:13 helloworld
-rw-r--r-- 1 root root 74 Jun 30 03:10 helloworld.go
root@ubuntu:/home/go/ch01# ./helloworld 
Hello, World!
// 第一段代码
var a = 1;

// 第二段代码
function sum (a,b) {
  return a + b;
}
alert(a); //返回undefined
    var a = 1;
    alert(a); //返回值1
    //由于变量的声明在预编译期被处理,所以在执行期对所有代码来说都是可见的。
    //而变量的初始化过程发生在执行期而非预编译期,执行期JS解释器按照代码顺序进行解释执行,在第一行代码处a尚未被初始化赋值,
    //所以JS解释器会使用默认值undefined
and,as,assert,break,class,continue,def,del,elif,else,except,exec,finally,for,from,global,
if,import,in,is ,lambda,not,or,pass,print,raise,return,try,while,with,yield.
变量的赋值
name=’ykyk'
name2=name
print(name,name2)
 
name = ‘tina’
print(name,name2)
public class Test {
  public static void main(String[] args) {
    List<String> strs = new ArrayList<>();
    strs.add("String");
    List<Integer> ints = new ArrayList<>();
    ints.add(1);
    System.out.println(strs.getClass() == ints.getClass());
  }
}
public class HELLO{
 public static void main(String[] args){
     System.out.print("Hello World!");
  }
}
type rtype struct {
    size       uintptr
    ptrdata    uintptr  // number of bytes in the type that can contain pointers
    hash       uint32   // hash of type; avoids computation in hash tables
    tflag      tflag    // extra type information flags
    align      uint8    // alignment of variable with this type
    fieldAlign uint8    // alignment of struct field with this type
    kind       uint8    // enumeration for C
    alg        *typeAlg // algorithm table
    gcdata     *byte    // garbage collection data
    str        nameOff  // string form
    ptrToThis  typeOff  // type for pointer to this type, may be zero
}
m1<-c(1,2,3)#生成了一个数值型向量
m2<-c("你好","Hello")#生成了一个字符型向量
  • 1
  • 2
  • 3
  • 4
  • 5