儿子学英语

Posted on 28th November 2009 by Nio in 宝宝, 日常生活

儿子从幼儿园回来。
我:今天学英语了么?
儿:学了。
我:学什么了?给爸爸讲讲。
儿:wo-shao
我:什么?没听明白,你慢点说。
儿:就是“握勺”,握紧勺子的意思。
我:不懂。。。
儿:就是你是小老鼠,小猫咪来了,就要说“握勺”。
shxll:哦,watch out 呀,小心!
我:。。。。。。

New language features in Java 7

Posted on 25th November 2009 by Nio in Java, 程序人生 - Tags:

New language features in Java 7

I’m just back from the Devoxx conference in Antwerp. An update was given on the new language changes that will be in Java 7. The JDK currently has a release date of September 2010.

Here are 7 of the new features that have been completed:

* Language support for collections
* Automatic Resource Management
* Improved Type Inference for Generic Instance Creation (diamond)
* Underscores in numeric literals
* Strings in switch
* Binary literals
* Simplified Varargs Method Invocation

很多特性都非常有意思,比如:


List<String> list = new ArrayList<String>();
list.add("item");
String item = list.get(0);

Set<String> set = new HashSet<String>();
set.add("item");

Map<String, Integer> map = new HashMap<String, Integer>();
map.put("key", 1);
int value = map.get("key");

可以变为:


List<String> list = ["item"];
String item = list[0];

Set<String> set = {"item"};

Map<String, Integer> map = {"key" : 1};
int value = map["key"];

最有意思的是数字:


int one_million = 1_000_000;

:)

2009年的第一场雪

Posted on 1st November 2009 by Nio in 宝宝, 日常生活

有照片为证 :D


准备攻击


专心做雪球


准备投弹

(more…)