在工作中经常用到JavaScript,今天总结一下JavaScript编写类的几种写法以及这几种写法的优缺点,关于JavaScript编写类的方式,在网上看到很多,而且每个人的写法都不太一样,经常看到的就是以下几种方式。

1、构造函数方式

  用构造函数模拟"类",在其内部用this关键字指代实例对象。

基本语法:

function 类名(){
     this.属性名;//公共属性
     var 属性名;//私有属性
    /*凡是定义类的公共属性和公共方法都要使用this*/
    //定义类的公共函数
    this.函数名=function(){
            .....
    }
    //定义类的私有函数
    function 函数名(){
    ......
    }
}

范例:

 1 /*定义一个Person类*/
2 function Person(_name,_age,_salary){
3 //Person类的公开属性,类的公开属性的定义方式是:”this.属性名“
4 this.name=_name;
5 //Person类的私有属性,类的私有属性的定义方式是:”var 属性名“
6 var age=_age;//私有属性
7 var salary=_salary;//私有属性
8
9 /*定义私有属性Age的对外公开访问方法*/
10 this.setAge = function(intAge) {
11 age = intAge;
12 }
13 /*定义私有属性Age的对外公开访问方法*/
14 this.getAge = function() {
15 return age;
16 }
17
18 //定义Person类的公开方法(特权方法),类的公开方法的定义方式是:”this.functionName=function(){.....}“
19 this.Show=function(){
20 document.writeln("在公开方法里面访问类的私有属性是允许的,age="+age+"\t"+"salary="+salary);//在公开方法里面访问类的私有属性是允许的
21 }
22 //公共方法
23 this.publicMethod = function(){
24 document.writeln("在公开方法里面访问类的私有方法是允许的");
25 privateFn();//在公开方法里面调用类的私有方法
26 privateFn2();//在公开方法里面调用类的私有方法
27 }
28 /*
29 定义Person类的私有方法(内部方法),
30 类的私有方法的定义方式是:”function functionName(){.....}“,
31 或者 var functionName=function(){....}
32 */
33 function privateFn(){
34 document.writeln("我是Person类的私有函数privateFn");
35 }
36
37 var privateFn2=function(){
38 document.writeln("我是Person类的私有函数privateFn2");
39 }
40 }

测试Person类

 1     var p1 = new Person("孤傲苍狼",24,2300);
2 var p2 = new Person("白虎神皇",24,2300);
3 document.write("<pre>");
4 document.writeln("p1 instanceof Person的结果是:"+(p1 instanceof Person));//p1是Person类的实例,结果是true
5 document.writeln("p2 instanceof Person的结果是:"+(p2 instanceof Person));//p2是Person类的实例,结果是true
6 //当==两边的内容是对象或者是对象的函数属性时,则比较内存地址是否相等
7 document.writeln("当==两边的内容是对象或者是对象的函数属性时,则比较内存地址是否相等");
8 document.writeln("比较p1和p2这两个对象的show方法的内存地址是否一样:p1.show== p2.show的结果是:"+(p1.show == p2.show));//false
9 document.writeln("p1.show == p2.show的结果是:"+(p1.show == p2.show)+",这证明p1对象和p2对象不是共享一个show方法,在内存中show方法的代码有2份,存放在两块内存区域");
10 document.writeln("name是Person类定义的public属性,可以使用类的对象去直接访问类的public属性");
11 document.writeln("p1.name="+p1.name);//访问公有属性,这是可以正常访问的
12 document.writeln("age和salary是Person类定义的private属性,不能使用类的对象去直接访问类私有属性,这是访问不了的,结果都是undefined");
13 document.writeln("p1.age="+p1.age+","+"p1.salary="+p1.salary)//不能使用类的对象去直接访问类私有属性,这是访问不了的,结果都是undefined
14 p1.show();//调用类的公共函数,这次允许的
15 p1.publicMethod();//调用类的公共函数,这次允许的
16 p1.setAge(24);//使用public方法setAge方法为私有属性age赋值
17 document.writeln("使用public方法getAge方法获取私有属性age的值,p1.getAge()="+p1.getAge());//使用getAge方法获取私有属性age的值
18 //document.writeln("p1.privateFn():"+p1.privateFn()+"&nbsp;p1.privateFn2():"+p1.privateFn2());//不能使用类的对象去调用类的私有方法,这里会报错”对象不支持此属性或者方法
19 document.write("</pre>");

测试结果:

  aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA2sAAADWCAIAAADAa43xAAAgAElEQVR4nO2d0ZbruopF6/9/2v1wx0j7CFgsZDuV1J7z4Q5HRrBAskVnp07/HAAAAAAAE35+WwAAAAAAfBl0kAAAAAAwgw7yW/n5+UmvhZk2/ikwjecZAAAAwLfCwf+VLB3bXR1kvHaMtQAAAAD4ewwOfr9L+Op+ov1S7de/e4vRKz1LU6i/OOQ7SAAAADAZNIXv6RJ+txdpv3uLd98veBEpxKTpfOZ3kPSgAAAAX8Qj30Fe4U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cQbbT/eNwQ0x7yMXrkc/W7Wh61CAancqm8v+6K/qAaUZmAZ0R31trORKwUY2U0aa9UpDU+Jad3Cqv8N9OAABwO/13KtX/NT/q3tJjMp6gqWV60FanbxVoudYZxdNdSEozip6j8+ra8flERpWr1HNq3GrQbv2RtGJ7Dl/j0Zu5HG09UwG6GpVOrdzRuT09OknLteEz5mumH1fNiQUAALeQv83bN7I+GrePwycQUsW4nqUt9/B9PpHR66NzwL8GHSV+fdItlxrozmax/ynwxZjL4Wz7K5JanRenv38np7No+wAAvoLHX9Z/9cuAJ/L6q7X6Uj5/OW5RyE4GAIANeMUDAAAAwAw6SAAAAACYQQcJAAAAADP+D9Pcz+IJ99NYAAAAAElFTkSuQmCC" alt="" />

  这种方式的优点是:可以根据参数来构造不同的对象实例 ,每个对象的属性一般是不相同的,缺点是构造每个实例对象时,方法不能共享,Person类里面定义的那些方法,p1对象有一份,p2也有一份,那么在内存中就得开辟两块内存空间来分别存储p1的方法和p2的方法,这样就造成了内存的浪费。对于一个类的不同实例对象,这些对象的属性一般是不相同的,但是方法是相同的,所以节约内存的做法就是把方法放到内存的一块区域中存放,然后每个实例对象都从这块内存中取出方法。

2、原型方式

需要说明的是,使用原型方式编写JavaScript类是无法给类添加私有属性和私有方法的,使用原型方式添加的属性和方法都是public的。

写法一:

 1 /*定义一个Person类*/
2 function Person(_name,_age,_weight,_height){
3 this.init(_name,_age,_weight,_height);
4 }
5
6 /*使用原型的方式定义Person类的public属性:name,age,weight,height,使用原型的方式添加的属性都是public的*/
7 Person.prototype.name;
8 Person.prototype.age;
9 Person.prototype.weight;
10 Person.prototype.height;
11 /*使用原型的方式给Person类添加public方法,使用原型的方式添加的方法都是public的*/
12 /*使用原型的方式给Person类添加init方法*/
13 Person.prototype.init = function(_name,_age,_weight,_height) {
14 if(_name != undefined && _age!=undefined && _weight!=undefined && _height!=undefined){
15 this.name = _name;
16 this.age = _age;
17 this.weight=_weight;
18 this.height=_height;
19 document.writeln("this.name="+this.name+",this.age="+this.age+",this.weight="+this.weight+",this.height="+this.height);
20 }
21
22 }
23 /*使用原型的方式给Person类添加show方法*/
24 Person.prototype.show = function(){
25 document.writeln("show method");
26 }

测试Person类

 1     document.write("<pre>");
2 var p1 = new Person("孤傲苍狼",24,115,160);
3 var p2 = new Person("白虎神皇",25,120,170);
4 var p3 = new Person();
5 p3.init("玄天邪帝",26,130,180);//调用public方法init初始化p3对象
6 document.writeln("p1 instanceof Person的结果是:"+(p1 instanceof Person));//p1是Person类的实例,结果是true
7 document.writeln("p2 instanceof Person的结果是:"+(p2 instanceof Person));//p2是Person类的实例,结果是true
8 document.writeln("p3 instanceof Person的结果是:"+(p3 instanceof Person));//p3是Person类的实例,结果是true
9 //当==两边的内容是对象或者是对象的函数属性时,则比较内存地址是否相等
10 document.writeln("当==两边的内容是对象或者是对象的函数属性时,则比较内存地址是否相等");
11 document.writeln("比较p1和p2这两个对象的show方法的内存地址是否一样:p1.show == p2.show的结果是:"+(p1.show == p2.show));//true
12 document.writeln("p1.show == p2.show的结果是:"+(p1.show == p2.show)+",这证明p1对象和p2对象共享一个show方法,在内存中show方法的代码只有一份,存放在内存的一块区域");//true
13 document.writeln("p1.name="+p1.name+",p1.age="+p1.age+",p1.weight="+p1.weight+",p1.height="+p1.height);//访问公有属性,这是可以正常访问的
14 document.writeln("p2.name="+p2.name+",p2.age="+p2.age+",p2.weight="+p2.weight+",p2.height="+p2.height);//访问公有属性,这是可以正常访问的
15 p3.name="灭世魔尊";//为公共属性重新赋值
16 document.writeln("p3.name="+p3.name);//访问公有属性,这是可以正常访问的
17 p1.show();//调用类的公共函数,这次允许的
18 document.write("</pre>");

测试结果:

  aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA2cAAADHCAIAAAAS3bxBAAAgAElEQVR4nO2d25bbuq5t/f8/rfMw1/FWCGBgkLpYLvf+kCZTIG6ESETlSl4bAAAAAEDH69MOAAAAAMAXQNcIAAAAAD0/2jW+Xq/Xa4z9PRIvKiXptZDUYg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U/7/Zg1lx4YCAAAAMAXsfgvI95JdGDNpY8HAgAAAPC90DUCAAAAQI/6r5/fI5v817P3H4V8asLRGSVNl6qIAAAAAGAW6/+hHjpIITn8WVqd+X+o03eNUy5VegAAAADARDVk75F4fVHXKN4sHnGp0gMAAAAAJuq/VxbXV79rrJxZc0nrBwAAAICWQ68Vq+u2Pzv+E+qDfgIAAADAFM0vjqQf01vvwa3rz96z3n9qnVrGcSn9wTcAAAAA+NBFAQAAAEAPXSMAAAAA9NA1AgAAAEAPXSMAAAAA9NA1AgAAAEDP/wOTRo9+pe3NmAAAAABJRU5ErkJggg==" alt="" />

写法二:

使用原型方式给类定义public属性和public方法更加优雅的写法,我个人推荐使用这种方式,这种方式看起来比较舒服
 1     /*定义类Person2*/
2 function Person2(){
3
4 }
5
6 /*使用原型方式给类定义public属性和public方法更加优雅的写法*/
7 Person2.prototype = {
8 name:"",//public属性
9 age:0,//public属性
10 weight:0,//public属性
11 height:0,//public属性
12 /*public方法*/
13 init:function(_name,_age,_weight,_height) {
14 this.name = _name;
15 this.age = _age;
16 this.weight=_weight;
17 this.height=_height;
18 document.writeln("this.name="+this.name+",this.age="+this.age+",this.weight="+this.weight+",this.height="+this.height);
19 },
20 /*public方法*/
21 show:function(){
22 document.writeln("show method");
23 }
24 };

测试代码:

 1     document.write("<pre>");
2 var p2_1 = new Person2();
3 var p2_2 = new Person2();
4 p2_1.init("孤傲苍狼",24,115,160);
5 p2_2.init("白虎神皇",25,120,170);
6 document.writeln("p2_1.name="+p2_1.name+",p2_1.age="+p2_1.age+",p2_1.weight="+p2_1.weight+",p2_1.height="+p2_1.height);//访问公有属性,这是可以正常访问的
7 document.writeln("p2_2.name="+p2_2.name+",p2_2.age="+p2_2.age+",p2_2.weight="+p2_2.weight+",p2_2.height="+p2_2.height);//访问公有属性,这是可以正常访问的
8 document.writeln("p2_1 instanceof Person2的结果是:"+(p2_1 instanceof Person2));//p2_1是Person2类的实例,结果是true
9 document.writeln("p2_2 instanceof Person2的结果是:"+(p2_2 instanceof Person2));//p2_2是Person2类的实例,结果是true
10 //当==两边的内容是对象或者是对象的函数属性时,则比较内存地址是否相等
11 document.writeln("当==两边的内容是对象或者是对象的函数属性时,则比较内存地址是否相等");
12 document.writeln("比较p2_1和p2_2这两个对象的init方法的内存地址是否一样:p2_1.init == p2_2.init的结果是:"+(p2_1.init == p2_2.init));//true
13 p2_1.name="灭世魔尊";//为公共属性重新赋值
14 document.writeln("p2_1.name="+p2_1.name);//访问公有属性,这是可以正常访问的
15 p2_1.show();//调用类的公共函数,这次允许的
16 document.write("</pre>");

测试结果:

  aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAn8AAACbCAIAAACcZmoRAAAbvElEQVR4nO2c27bjIA5E8/8/7XmYNR4aSaUSBkKOaz/0crDQDZDiJH0+lxBCCCH28vm2A0IIIcTrUPcVQgghdvPq7vv5fD6fPgP3iL2IlLjXQBKLCSGE+PP8/Tbwaeheul3QCrgdOqUVtkrUgIUQ4s1QPSBqVPfdef4spO2CUVu91jz7tqrS9p/yW8uB3+iMaQN3qwrHSA0NLy5jyL6TG95RK/I55sZ0nbwh9x3zLItCRCTdAoz8Fl0rjbrvPd4ev7S0MSXMtUhm9XeXA7w1Iavb34idGXcl3fDHdlEkvCKfO3U+z2d0UVIuRBV1X1+slYmEXc2p3Y6S82DkTKJChlMaaYhGzuR5t4iE1X2HbTGpU/cVe0i+0WzHr6YVdcJASWi46WruU1HbtyKFWNK6ev1b911t1n/QKvg6GFmM5HHs05cDaAD5ZDJvg7UX343dLrSNa8AQ0ManDmeSjzGy7vpZCjOyZXW6ar+bzyj2SF6IiRSefbtjEAnze9fV6U6/D0kqGVnBqiKLdoqr2cWNFIuBEFzT7t0ny2Gv02wPhBB5nk68RxbFzm+w6GU3pbpXI8fwYEn5aUcbv1ydz6qfQkyk0H2ju/g8I9tQpz0YtjjybQyrcsVutVa4uxVFEVkstR/sJ+MDuRytcFqS+MwDb6tzUw0PtyK/waKXTKSlgg52FC+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RffXsK4QQ4k/id9/ug1/3pXvrHryyPnfPuv/FOrEM45L7gbYQQgixH/UhIYQQYjfqvkIIIcRu1H2FEEKI3aj7CiGEELtR9xVCCCF2o+4rhBBC7OY/NlxbWRZjvDgAAAAASUVORK5CYII=" alt="" />

  原型方式的优点:所有对象实例都共享类中定义的方法,这样就没有造成内存浪费。缺点,第一,不能定义类的私有属性和私有方法,第二,给在创建对象,给对象的属性初始化时,需要额外写一个初始化对象的方法。

3、构造函数+原型

  构造函数方式和原型方式都有各自的优缺点,因此可以把这两种方式合并起来,用构造函数方式来定义类的属性(public属性,private属性),用原型方式来定义类的方法(public方法)。互补不足,这就有了第三种写法。

 1     /*定义一个Person类*/
2 function Person(_name,_age,_salary){
3 //在Person类内部定义类的public属性和private属性以及private方法
4 //Person类的公开属性,类的公开属性的定义方式是:”this.属性名“
5 this.name=_name;
6 //Person类的私有属性,类的私有属性的定义方式是:”var 属性名“
7 var age=_age;//私有属性,只能在类内部使用
8 var salary=_salary;//私有属性,只能在类内部使用
9 /*
10 定义Person类的私有方法(内部方法),只能在类内部使用
11 类的私有方法的定义方式是:”function functionName(){.....}“,
12 或者 var functionName=function(){....}
13 */
14 function privateFn(){
15 document.write("<pre>");
16 document.writeln("我是Person类的私有属性age,只能在Person类内部使用,初始化后age="+age);
17 document.writeln("我是Person类的私有函数privateFn,只能在Person类内部使用");
18 document.write("</pre>");
19 }
20
21 var privateFn2=function(){
22 document.write("<pre>");
23 document.writeln("我是Person类的私有属性salary,只能在Person类内部使用,初始化后salary="+salary);
24 document.writeln("我是Person类的私有函数privateFn2,只能在Person类内部使用");
25 document.write("</pre>");
26 }
27
28 privateFn();//在Person类内部调用私有方法
29 privateFn2();//在Person类内部调用私有方法
30 }
31
32 //使用prototype原型方式定义的方法(public方法)是无法访问类的私有属性和私有方法的
33 //使用prototype原型方式定义Person类的方public方法
34 Person.prototype={
35 setName:function(_name){
36 this.name = _name;
37 //privateFn();//不能调用Person类定义的私有方法privateFn(),会报错:缺少对象
38 },
39 getName:function(){
40 return this.name;
41 },
42 show:function(){
43 document.writeln("公开方法show");
44 },
45 //公共方法
46 publicMethod:function(){
47 document.writeln("公开方法publicMethod");
48 }
49 };

测试代码:

 1     var p1 = new Person("孤傲苍狼",24,2300);
2 var p2 = new Person("白虎神皇",25,3000);
3 document.write("<pre>");
4 document.writeln("p1 instanceof Person的结果是:"+(p1 instanceof Person));//p1是Person类的实例,结果是true
5 document.writeln("p2 instanceof Person的结果是:"+(p2 instanceof Person));//p2是Person类的实例,结果是true
6 //当==两边的内容是对象或者是对象的函数属性时,则比较内存地址是否相等
7 document.writeln("当==两边的内容是对象或者是对象的函数属性时,则比较内存地址是否相等");
8 document.writeln("比较p1和p2这两个对象的show方法的内存地址是否一样:p1.show== p2.show的结果是:"+(p1.show == p2.show));//true
9 document.writeln("p1.show == p2.show的结果是:"+(p1.show == p2.show)+",这证明p1对象和p2对象共享一个show方法,在内存中show方法的代码有1份,存放在1块内存区域");
10 document.writeln("name是Person类定义的public属性,可以使用类的对象去直接访问类的public属性");
11 document.writeln("p1.name="+p1.name);//访问公有属性,这是可以正常访问的
12 document.writeln("age和salary是Person类定义的private属性,不能使用类的对象去直接访问类私有属性,这是访问不了的,结果都是undefined");
13 document.writeln("p1.age="+p1.age+","+"p1.salary="+p1.salary)//不能使用类的对象去直接访问类私有属性,这是访问不了的,结果都是undefined
14 p1.show();//调用类的公共函数,这次允许的
15 p1.publicMethod();//调用类的公共函数,这次允许的
16 p1.setName("玄天邪帝");//调用类的公共函数设置为name属性重新赋值
17 document.writeln("p1.getName="+p1.getName());
18 //document.writeln("p1.privateFn():"+p1.privateFn()+"&nbsp;p1.privateFn2():"+p1.privateFn2());//不能使用类的对象去调用类的私有方法,这里会报错”对象不支持此属性或者方法
19 document.write("</pre>");

运行结果:

  aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA0IAAAFpCAIAAAA+yA//AAAgAElEQVR4nO2d3ZqrOM9tc/83zT7o/eZjWdLUtIEEU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H+Z9b8nrST1rIU2sVL4lTZuGIxtXNtxnug8AAAA/GWsluv4C7bqbvrbQ9OHe7ZxUfI65wEAAOAv4373XzQQy5LtSNvzxesH/VL1uPMAAADwlynfHqWkku1IHB+6n1Ss9aFyLMq30yujUXj/cR9I1BDjqmTa6ZVXAAAA8Jc57c3Z7GDVjrzkyyd9FwAAAODv8NROiFdTAAAA8MehDQIAAAB4JLRxAAAAAI+ENm7bVr9mp2f5OvnVMAAAACxAA/H/Eb3US6LFhnFH56VhAgAAwM8w1zRc3WSk3c+lhmbbKdOfV/YXtXHuK/yHRSZiAAAAgL/NRN9wRVOVdjai77kI35CWTD1/d6X+FAAAAICWL7+Nu0Mb13Zm/nu79FZsf5ffBQIAAAC8ybuoqpkw2wvd4mhDr927q4XprWQUngrQz0AakWmUNg4AAABamv/jwmyXs5ep9Aj9W9HGpVN8SeGqbltFdK3aymFh3fQBAAAAYPtkG5d2KmYbNygRksstkR+alhTv3qpkTrWeAAAAAP9xfhu3Fd8GqySrkfadVvs2bq9H93Z+XGY4tHEAAABwNYfauLQravsk523coFx0RaKNm23O9JS2MRUx6kTRxgEAAMACecuVdh5xsOpOzOlRySCTNkOD/ve/lZIm/vk2VA+mnmuZtHMFAAAA0Kz/hrHU+Jx3S2lr6LSq+m7U0Lqx5D4AAAD8acp3aYeUnqEEAAAAAAR0WgAAAACPhDYOAAAA4JHQxgEAAAA8Eto4AAAAgEfy/wBybkU4knPQiAAAAABJRU5ErkJggg==" alt="" />

  第三种方式通过前两种方式的结合,算是达到了一个比较理想的写法了,可以通过传参构造对象实例,对象实例都共享同一份方法不造成内存浪费。第三种方式在开发中用得最多,我本人也是采用这种方式来编写JavaScript类。

JavaScript学习总结(十二)——JavaScript编写类的更多相关文章

  1. JavaScript学习总结(十四)——JavaScript编写类的扩展方法

    在​J​a​v​a​S​c​r​i​p​t​中​可以使​用​类的p​r​o​t​o​t​y​p​e属性来​扩​展​类的属​性​和​方​法,在实际开发当中,当JavaScript内置的那些类所提供的动态 ...

  2. ROS学习(十二)—— 编写简单的消息发布器和订阅器(C++)

    一.创建发布器节点 1 节点功能: 不断的在ROS网络中广播消息 2 创建节点 (1)打开工作空间目录 cd ~/catkin_ws/src/beginner_tutorials 创建一个发布器节点( ...

  3. JavaScript学习笔记(十二) 回调模式(Callback Pattern)

    函数就是对象,所以他们可以作为一个参数传递给其它函数: 当你将introduceBugs()作为一个参数传递给writeCode(),然后在某个时间点,writeCode()有可能执行(调用)intr ...

  4. JavaScript学习总结(十六)——Javascript闭包(Closure)

    原文地址: http://www.cnblogs.com/xdp-gacl/p/3703876.html 闭包(closure)是Javascript语言的一个难点,也是它的特色, 很多高级应用都要依 ...

  5. JavaScript学习总结(十八)——JavaScript获取浏览器类型与版本

    从网上找到一段使用JavaScript判断浏览器以及浏览器版本的比较好的代码,在此记录一下: 1 <script type="text/javascript"> 2 v ...

  6. JavaScript学习总结(二)

    JavaScript学习总结(二) ---- 对象 在JavaScript中,几乎用到的每个js都离不开它的对象.下面我们深入了解一下js对象. js中对象的分类跟之前我们学过的语言中函数的分类一样, ...

  7. python3.4学习笔记(十二) python正则表达式的使用,使用pyspider匹配输出带.html结尾的URL

    python3.4学习笔记(十二) python正则表达式的使用,使用pyspider匹配输出带.html结尾的URL实战例子:使用pyspider匹配输出带.html结尾的URL:@config(a ...

  8. Go语言学习笔记十二: 范围(Range)

    Go语言学习笔记十二: 范围(Range) rang这个关键字主要用来遍历数组,切片,通道或Map.在数组和切片中返回索引值,在Map中返回key. 这个特别像python的方式.不过写法上比较怪异使 ...

  9. Tensorflow深度学习之十二:基础图像处理之二

    Tensorflow深度学习之十二:基础图像处理之二 from:https://blog.csdn.net/davincil/article/details/76598474   首先放出原始图像: ...

随机推荐

  1. 20145216史婧瑶《网络对抗》Web基础

    20145216史婧瑶<网络对抗>Web基础 实验问题回答 (1)什么是表单 表单在网页中主要负责数据采集功能.一个表单有三个基本组成部分: 表单标签.表单域.表单按钮. (2)浏览器可以 ...

  2. 20145327 《网络对抗》逆向及BOF基础实践

    20145327 <网络对抗>逆向及BOF基础实践 实践目标 本次实践的对象是一个名为pwn1的linux可执行文件. 该程序正常执行流程是:main调用foo函数,foo函数会简单回显任 ...

  3. mpvue小程序开发入门级指南

    报错指南 "Error: ERR_GET_SESSION_KEY {"code":5100,"message":"(-1)服务内部错误,请稍 ...

  4. bzoj 1010 玩具装箱toy -斜率优化

    P教授要去看奥运,但是他舍不下他的玩具,于是他决定把所有的玩具运到北京.他使用自己的压缩器进行压缩,其可以将任意物品变成一堆,再放到一种特殊的一维容器中.P教授有编号为1...N的N件玩具,第i件玩具 ...

  5. vijos 1098 合唱队形 - 动态规划

    描述 N位同学站成一排,音乐老师要请其中的(N-K)位同学出列,使得剩下的K位同学排成合唱队形. 合唱队形是指这样的一种队形:设K位同学从左到右依次编号为1,2…,K,他们的身高分别为T1,T2,…, ...

  6. Python3基础 while 循环示例

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  7. HDU1043 Eight(八数码:逆向BFS打表+康托展开)题解

    Eight Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Sub ...

  8. 简单Shell案例

    使用shell命令进行左对齐或者右对齐 [root@bj-aws-yace-tbj mnt]# cat test.sh #! /bin/bash file=./test.txt echo -e &qu ...

  9. 【问题解决】An internal error occurred during: "Computing additional info". Could not initialize class javax.crypto.JceSecurityManager

    在使用eclipse时对象后使用点操作符时总是会弹出错误,很是烦人 An internal error occurred during: "Computing additional info ...

  10. 51nod 1201 整数划分 基础DP

    1201 整数划分  基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题  收藏  关注 将N分为若干个不同整数的和,有多少种不同的划分方式,例如:n = 6,{6} ...