Nokia Mobile Software University Camp Beijing

Nokia Mobile Software University Camp Beijing

16号、17号两天去参加了诺基亚移动软件大学技术营北京营的活动。与来自芬兰的maemo技术专家进行了沟通(就是不太习惯北欧式英语的发音,汗。。。)

今天在Planet Maemo和邮件列表里看到N810已经出来了,操作系统是ITOS 2008,SDK是beta版的maemo 4.0 Chinook 。这里有一些官方的截图

其他相关介绍:

http://linuxdevices.com/news/NS3669465936.html

http://www.nseries.com/nseries/v3/media/sections/products/tech_specs/en-R1/tech_specs_n810_en_R1.html

同时,N810的对社区贡献者的优惠活动也开始了,详情见这里

TurboGears开发笔记 (1)

1. 使用MySQL数据库

1.1 使用UTF-8字符集

sqlobject.dburi="mysql://root:@localhost:3306/dbname?sqlobject_encoding=utf-8&read_default_file=my.cnf"

同时,my.cnf里在client一节加入 default-character-set = utf8

1.2 使用InnoDB类型的表
修改my.cnf,mysqld一节加入 default-storage-engine=INNODB

1.3 自身外键关联
使用InnoDB类型的表,tg-admin sql drop 时会遇到由于外键约束而无法删除的问题,可以改用MyISAM类型的表。tg-admin sql create时会有警告:

Warning: a circular reference was detected in the model. Unable to sort the classes by dependency: they will be treated in alphabetic order. This may or may not work depending on your database backend. The error was:
Found a circular reference: ......

2. SQLObject

2.1 MultipleJoin最好指定joinColumn

3. Kid模板

3.1 用defined(varname) 可以判断一个变量是否存在于模板中,value_of则可以指定变量不存在时的默认值

3.2 results.count()可以得到查询结果集的大小

3.3 根据条件输出不同的内容 ${condition and ‘a’ or ‘b’}
比如交替表格中行的背景色

<tr py:for="i, row in enumerate(rows)" class="${i%2==0 and 'odd' or 'even'}">
...
</tr>

在select的option标签里输入selected属性

...
<option value="..." selected="${condition and 'selected' or None}">... </option>
...