var Person=function(){}; 定义一个function实际上是定义了一个类(class)。 静态方法 Person.say=function(){ console.log('I am a Person,I can say.') }; Person.say(); //正常运行 va ...
分类:
编程语言 时间:
2020-05-21 16:31:38
阅读次数:
63
在文件夹中创建一个sh文件,内容如下: #!/bin/bash say() { #mplayer -really-quiet "http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=5&text=$*"; #mpg321 -q "http://tts ...
分类:
系统相关 时间:
2020-05-21 16:09:49
阅读次数:
151
function Person(name,age,desc) { var obj = { name: name, age: age, desc: desc, say: function () { console.log('大家吼,我系' + this.name) } } return obj; } ...
分类:
其他好文 时间:
2020-05-16 12:44:42
阅读次数:
65
前言: 买了个阿里云最低配的服务器,身为一名啥都不懂的前端工程师,打算对全世界say:'hello world!',咋整? 一、购买完成之后: 1、重置密码:在阿里云的管理后台中找到实例列表,完了重置一下密码,说实话,光这一步我找了好久,截图的话还得打码,手懒不截了,你们自己慢慢找。 2、配置实例安 ...
分类:
其他好文 时间:
2020-05-16 09:15:15
阅读次数:
121
No picture say a P! ''' 以卡比兽为例来熟悉一下Python里的类和对象 卡比兽的英文名叫Snorlax ''' # 创建一个卡比兽类 class Snorlax: pass # 占位符 count = 0 # 类变量:卡比兽的数量 ''' 类比Java中的构造方法 ''' d ...
分类:
编程语言 时间:
2020-05-09 21:07:22
阅读次数:
75
题目:Meteor Shower S 网址:https://www.luogu.com.cn/problem/P2895 Bessie hears that an extraordinary meteor shower is coming; reports say that these meteor ...
分类:
其他好文 时间:
2020-05-01 20:59:36
阅读次数:
71
class Program { static void Main(string[] args) { var obj = EmitHelper.ImplInterface<IPerson>(); obj.say(); obj.sayHi(); } } public interface IPerson ...
分类:
其他好文 时间:
2020-04-29 18:10:20
阅读次数:
110
一个程序帮助你理解类中的一些基本的概念! a = 1 #(全局变量) def say(): print('调用了全局方法') class People(): global a a = 100 #类中定义一个全局变量, 因此不再是类的数据属性 b = 123 # 类中的数据属性,也是一种变量 def ...
分类:
编程语言 时间:
2020-04-28 18:39:08
阅读次数:
125
反射 指的是在程序运行过程中可以"动态(不见棺材不掉泪)"获取对象的信息 class People: def __init__(self,name,age): self.name=name self.age=age def say(self): print(f'{self.name}{self.ag ...
分类:
其他好文 时间:
2020-04-15 21:28:40
阅读次数:
62
Look-and-say sequence is a sequence of integers as the following: D, D1, D111, D113, D11231, D112213111, ... where D is in [0, 9] except 1. The (n+1)s ...
分类:
其他好文 时间:
2020-04-15 00:24:16
阅读次数:
63