English-transcribe-We-choose-to-go-to-the-Moon

We choose to go to the Moon

I appreciate your president having made me an honorary visiting professor, and i will assure you that my first lecture will be very brief.

I am delighted to be here and I’m particularly delighted to be here on this occasion.

We meet at a college noted for knowledge, in a city noted for progress, in a state noted for strength, and we stand in need of all three, for we meet in an hour of change and challenge, in a decade of hope and fear, in an age of both knowledge and ignorance. The greater our knowledge increases, the greater our ignorance unfolds.

Read More

Pyhton-Practice:Pic-to-char

  • title: Convert Pic To Chargraphic
  • principle: every pixel has a RGB value, one char can replaces one RGB value or some RGB value, then a pic consisted of pixels can be converted to a document with char
  • code:
Read More

Python_Comprehend_Daily

  • argparse
    • add_argument
      • const/default: these two attribute can not only be const like 1 or one, but can be function like max/sum/all
Read More

Life-Target

  • Programming
    • 编写一个自动将github更新消息发送到qq的小程序
    • 编写一个备忘录软件
Read More

JEECMS播放视频黑屏问题解决方法

  • 问题: 在使用JEECMS V8.1 发布包含视频内容后在线播放视频时, 出现黑屏即只有声音没有图像的情况
  • 浅析: 出现这种情况主要是视频编码的问题
  • 解决方法: 使用H264格式进行转码, 随即正常播放
Read More

Python问题解析-关于__getattr__的链式调用的应用的一点解析

  • <span style=”background-color: red>关于__getattr__()的链式调用的应用的一点解析

Read More

JavaScript-Note.md

  • 原型链

    • 构造实例和定义方法的先后问题

      • 代码如下

        1
        2
        3
        4
        5
        6
        7
        8
        function Person () {
        this.name = 'John';
        }
        var person = new Person();
        Person.prototype.say = function() {
        console.log('Hello,' + this.name);
        };
        person.say();//Hello,John

        虽然原型方法在构造实例之后声明, 但因为在调用方法之前就已经声明了, 因此之后的每个实例都拥有该方法.
        如果我们这样写:

        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        function Person () {
        this.name = 'John';
        }
        var person = new Person();
        Person.prototype = {
        say: function() {
        console.log('Hello,' + this.name);
        }
        };
        person.say();//person.say is not a function

        person.say方法没找到, 报错.
        原因: var person = new Person()创建了一个新实例, 即Person.prototype指向了一个空对象. 对于实例person来说, 其内部有一个原型链指针proto, 该指针指向了Person.prototype指向的对象.而接下来:

        1
        2
        3
        4
        5
        Person.prototype = {
        say: function() {
        console.log('Hello,' + this.name);
        }
        };

        则将Person.prototype重置了, 使其指向了另一个对象即: Object(say: function)
        而此时person.proto的指向没有变, 其指向的空对象没有say方法, 因此报错.
        想要成功运行, 则需将方法定义放在构造实例之前:

        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        function Person () {
        this.name = 'John';
        }
        Person.prototype = {
        say: function() {
        console.log('Hello,' + this.name);
        }
        };
        var person = new Person();
        person.say();

        其实, 只需要明白原型对象的结构即可:

        1
        2
        3
        4
        5
        Function.prototype = {
        constructor : Function,
        __proto__ : parent prototype,
        some prototype properties: ...
        };
      • 构造函数格式: 为了区分普通函数和构造函数, 按照约定, 构造函数首字母应当大写, 而普通函数首字母应当小写

  • Ajax cross domain session change problem and solution

    • 解释: 使用ajax跨域请求服务器会出现sessionId变化的问题, 即每次连接都会产生一个新的sessionId
Read More

Python_Note

  • Python基础
    • Python命令行: 可以直接在命令行中编写函数, 这样可以在cmd中调用函数
    • 使用list和tuple
Read More

Python_Note

  • Python基础
    • Python命令行: 可以直接在命令行中编写函数, 这样可以在cmd中调用函数
    • 使用list和tuple
      • list
Read More

CSAPPP练习题3-30

  • 题目:
    下面的C函数忽略了switch语句的主体. 在C代码中, 情况标号是不连续的, 而有些情况有多个标号.

Read More