作者归档:Neo

又一次更换了评论系统

去年暑期的时候 HyperComments 开始收费,并且不给钱就不给看历史数据,一声不吭就直接进入收费模式,这也太狗了。去他妈的 HyperComments 吧,不用就不用了。于是在那个时候换了 Disqus 这个经典的评论系统。 继续阅读 →

COM6506

Week 02

public class Person {
    String name;
    double weight;
    double height;

    public Person(String name, double weight, double height) {
        this.name = name;
        this.weight = weight;
        this.height = height;
    }

    public String getName() {
        return name;
    }

    public double getWeight() {
        return weight;
    }

    public double getHeight() {
        return height;
    }

    public static void main(String[] args) {
        Person jeff = new Person("Jeff", 72.4, 2.2);
        Person jim = new Person("Jim", 65, 1.7);
        System.out.println("Jeff is " + jeff.getHeight() + "m tall.");
        System.out.println("Jim is " + jim.getHeight() + "m tall.");
    }
}

继续阅读 →

COM6516

Week01-02

/*
 * HelloWorld.java
 * A traditional Hello World program!
 */

// In Java, all programs reside in a class. This class is called HelloWorld, 
// and should be saved in a file called HelloWorld.java. This class has a single
// method called main, which is the entry point to the program.
//
// Compiling the class with javac HelloWorld.java will produce a bytecode file
// called HelloWorld.class if compilation is successful. This bytecode can then
// be run on any machine with a java bytecode interpreter. You can run the
// bytecode in a console by typing java HelloWorld.

public class HelloWorld {
    public static void main(String[] arg) {

        String helloString = "Hello";
        String worldString = "World!";

        // In Java the System.out.println command displays the argument to the 
        // console. However the command below doesn't work, because helloWorldAString
        // has not been declared. Try compiling this file to see what happens, 
        // and take a careful look at the error message that is produced.

        System.out.println(helloString + " " + worldString);

        // In Java, we can use the '+' operator to concatenate strings, 
        // so to fix this problem, either change the argument passed to the
        // System.out.println method from (helloWorldString) to 
        // (helloString + " " + worldString)
        // or declare the variable helloWorldString before it is used by 
        // System.out.println by inserting 
        // String helloWorldString = helloString + " " + worldString;

        // In Java a variable can be declared anywhere in the code, so it is
        // possible to declare a variable just before it is used, which makes for
        // code that is easier to read and understand.

        // It is conventional to use mixed case for variable names and method 
        // names in Java, with with the first letter lower case, and then the 
        // first letter of each internal word in upper case -- e.g. helloString.
        // Class names start with a capital letter -- e.g. HelloWorld.java

        // details at: http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-135099.html

    }
}

继续阅读 →

更换评论系统

最近一直在忙着毕业的事情,没有打理博客。等到基本事情都做完回来看博客的时候发现,原来使用的 HyperComments 评论系统已经开始收费了,并且只有在订阅之后才可以进入管理页面。

这样一来,原本的评论想要找回来就只能强制被收费了,那只好对 HyperComments 说再见了,重新投入 Disqus 的怀抱。

然而 Disqus 在国内被屏蔽,这也是没办法的事情,所以……以后网站的评论就只能是随缘评论了……

氧 OS 也能使用公交卡

两个月前,我换了一加 5T,算是 48 年入国军了吧,不过等于 7 看样子会有刘海,无爱,放弃;而 5T 的 835 性能又很足够,造型也很讨我喜欢。

买来后果断刷了氧 OS 使用,确实没让我失望,内置 Google 框架,使用很流畅。前两天,因为想尝试着体验一下全球上网和公交卡功能,刷成了氢 OS 8.1 稳定版,但是是 dirty flash。开机后检查各项软件,果然,电话闪退无法使用。在设置中找边所有地方也没找到全球上网,不过还好,卡券里的公交卡功能可用,没算是白刷。但是这修改过的氢的界面用起来还是各种别扭,还预装了许多中国特色软件。于是打算把公交卡功能搬到氧 OS 中使用。
继续阅读 →

MI3TD 调整系统分区/合并分区 支持 64G 支持官方 OTA【存档】

这是什么

这是一篇可以指导你将你的小米 3 TD 调整系统分区/合并分区的教程,支持 16G 和 64G 的 TD。

  • 有时候你想安装软件,提示你空间不足,去查看一下明明剩余空间还多。
  • 有时候你想刷 Gapps 包,却因为系统分区空间不够而刷不进去。

遇到以上这些情况,就需要本文的教程来解决问题了。

可能你看过许多相关帖子,不过方法都不太完美,官方合并分区方法有 BUG,合并之后存储空间会缺失一个多 G,只有 12.25G 大小,而本教程则完美解决了官方合并分区的 BUG,合并之后存储空间全部利用,不再丢失一个 G。
继续阅读 →

Python 程序设计

第二周

  • 利用嵌套循环 , 输出 2-100 之间的质数。
  • 有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少?
  • 输出 9*9 乘法口诀表。
# 输出2-100之间的素数
for i in range(2, 101):
    for j in range(2, i):
        if not (i % j):         # 如果 i 整除 j(i 不是素数)
            break                   # 跳出循环
    else:
        print(i, "是素数")

继续阅读 →

互联网应用 Lab

Lab 3

#include <unistd.h>
#include <stdio.h>

int main() {
    char *arg[] = {"/bin/ls", 0};

    /* fork, and exec within child process */
    if (fork() == 0) {
        printf("In child process:\n");
        execv(arg[0], arg);
        printf("I will never be called\n");
    }

    printf("Execution continues in parent process\n");

    return 0;
}

继续阅读 →