Author: Xuan Hu

  • 记秋游骑行小分队

    最近很忙很忙,各种deadline逼的人想死,但还是忙里偷闲各种骑车和玩耍。上周六班长DQ组织了全班的秋游活动,难得人聚了很多,更难得的是我们还组织了骑行小分队,秋游+骑行,岂不快哉!

    还是老规矩废话不多说,本次骑行路线可以参见最后的控件或此链接,全程62.76km,平均速度20.1 km/h,最高速度41.9 km/h。

    参与本次骑行的有光哥、永太和新杰。光哥玩车没多久,骑了一趟川藏线之后就把车卖了,这次是骑车陪着他很多年的老山地,以前的车质量就是好啊,虽然变速神马的肯定不能和新车比,但是还是很赞了。新杰骑的是刚买不久的美利达领航者,第一次出远门就被渐了一身泥,也算是非常有意思的经历了。永太骑着从别人那里借来的山寨山地,着实一路上追赶的很辛苦,能够坚持下来确实非常赞,经过这次骑行应该也能深刻理解“论装备的重要性”了。

    秋游是在上庄水库的一个农家乐烧烤,由于离学校也就15公里左右,直接骑过去没啥意思,所以我们选择了先去凤凰岭,然后再折返回来去上庄水库,这样到达目的地大概有40多公里的路程,考虑到有新手和设备,也算不错的行程了。还有一件很有趣的事是,在到凤凰岭的时候,正好遇到了北大车协迎新拉练,好巧合,这学期一定要去报名!

    在农家乐吃的也很high,还玩了三国杀,打扑克、台球和乒乓球,虽然台球桌和乒乓球桌都很次,但是玩的那份劲很棒!烧烤更是大吃特吃,自己烤的也很开心。感谢班长DQ和组织这次秋游的小伙伴,还有三位陪着我一起骑行的小伙伴,希望我们以后能有更多的玩耍。

    接下来还有一大波deadline将要到来,赶紧干活去了……



  • 记第一次长距离爬坡——登顶解字石

    早上七点左右出发,从中关村北大街到上地那然后切到西三旗桥的G6辅路,沿途从110国道,212省道一直到达解字石的顶峰返回,具体路线可以参见最后的控件或此链接

    同行者 duyue, 这是他的 本次骑行纪录

    解锁以下成就:
    – 第一次长距离爬坡(长度6.4km,海拔641m)
    – 单日破百(115.16km)
    – 两个小腿都抽筋(我还有什么批注可以添加呢?)

    路上的风景很不错,两次看到了松鼠,成片的山林,人也不是很多,空气更是赞,还遇到了坐在车里给我们加油的小萝莉!爬坡超累,很久没有这种觉得自己弱爆了的绝望感,特别是在转了一个弯之后发现前面还没到的时候……很感谢duyue一直带着我,在我骑不动的时候等我,在我抽筋的时候帮我拉筋,这么好的男人竟然到现在还单身,简直天理不容!求个妹子将他收走,包邮!

    好吧,貌似有点歪楼了,回归正题。最近入了好多装备(可怜我的钱包!)除了前面看到的详细记录行程的Garmin Edge 200 GPS码表,今天还穿着昨天刚刚到货的Jakroo的骑行裤,骑行眼镜、头盔、魔术头巾之类的之前都有了,这样目前能想到还缺的装备就是上衣和手套了,I will be a more professional cyclist by then!

    骑行途中还是有很多感悟的,特别是在那段爬坡的时候。一开始就想着跟在领骑的人后面就行了,然后才发现自己真的是 too young, too simple, and sometimes navie。 人家都是QS级的人物,是你随便能跟上的么?跟上了也是人家为了带队而已,爬坡都是坡顶等人,谁还管你?这也基本是我第一次左小腿抽筋的原因。在爬坡途中歇了两三次,应该可以更少一些的,感觉主要被打败的不是体力,而是心理,特别是转弯之后发现是另一个坡,内心瞬间就被绝望感所占据了,要是内心能强大点,肯定能多坚持一会。最后快要到山顶的时候,一兴奋猛踩了几脚,前面都是龟爬的速度,都累成狗了最后一激动还想来个回光返照,然后成功的让右小腿也抽筋了。duyue一路上都在提醒我,要保持踏频,保持节奏,其实自己做的不是很好,除了前面提到的原因之外,其实也是自己本身的原因,平时就想着超车、追人啊神马的,很少想过培养自己的节奏和频率,自然真正需要用的时候就捉襟见肘了。duyue在路上还一直鼓励我,还安慰我说就快到了,虽然我知道是骗我的,但是心里还是挺温暖的。duyue说我这第一次爬坡比他第一次爬好的多,其实我想说能成功登顶有一大半都是他的功劳才对,谢谢你,下次请你吃好吃的!

    骑车就像做人,骑行的路也是学做人的路。



  • Report #2 about Porting GTG

    After roughly porting GTG and liblarch to gtk3, I was supposed to working on debug to make the porting branch more stronger, or in other words, apply coverage [1] into current porting branch. But after some discussion with mentor, we change the plan and decide to port GTG and liblarch to python3 first.

    Porting liblarch to python3 is really smoothly. After using official 2to3 script, everything seems to work fine only with some little modificaiton. But I encounter some problem when try to port GTG to python3, cause GTG uses a third party module, `configobj`, to deal with the configuration processing. The problem is that `configobj` has no official python3 port [2]. Though there are some other talented guys ported it to python3 [3], but using unofficial configobj will make it difficult for GTG to release and distribute. So I have to port configobj to some other alternatives. Fortunately, there is an usable alternative in python official library. It’s called `ConfigParser` in python2 or ‘configparser’ in python3. Though it’s not so friendly to use and doesn’t support so many features when compared with `configobj`, we failed to find any other better choice to make everything work.

    As I need to prepared for the oral presentation on JCDL[4] at the end of July and after which I spend several days back home from school company with my parents, the progress is somewhat slow during that period of time. When working on port from configobj to ConfigParser, we choose to work based on the current develop branch which is still written in python2 and pygtk. Cause the code doesn’t do anything with GUI and can be written in python3 easily, so there won’t be so much more work and it will be better for testing and backwards compatibility.

    I have two main problems during the porting from `configobj` to `ConfigParser`. The first one is that configobj can support get/set configuration via the methods just like dict, but it seems to be really hard the make ConfigParser object work in the same way. Since `configobj` is used in many places, to avoid modifing too many codes and keep the same interface when interacting with configuration file. I just failed to come up with an elegant solution. The second one is that configobj support to save configuration via `.write()` method without any more parameters and object indicating sections in configuration can get the whole config via `.parent` property but both of them are not supported in ConfigParser. Mentor suggested to make it work via python magic like __dict__, __get__ and other underscore methods, but also pointing out that the tricky hack will make it hard for future maintainance.

    I forced myself to look through the current code and how config objects are used according to mentor’s suggestion. After listing all the related operations together, I finally think up a solution which should be simple and elegant. Just make everything work via a simple wrapper based on `ConfigParser` object and implementing all needed interface in that wrapper. After being stucked at this problem for severals days, it’s really exciting to hava a not so bad solution. This really consume too much time because I am not familiar enough with the code of GTG and appear to be irritable when refactoring.

    Now the porting from configobj to ConfigParser has been successfully merged [5] into development branch with some other bugs fixed and I am working on porting GTG to python3 in last several days. It’s almost done only with some little problem need to be fixed. I will continue working on porting deprecated widgets [6] of gtk3 and setting up coverage testing as well as some other bugs fixing. Let’s continue enjoying the GSoC times!

    [1] https://pypi.python.org/pypi/coverage/
    [2] http://www.voidspace.org.uk/python/weblog/arch_d7_2010_12_11.shtml
    [3] https://bitbucket.org/zubin71/configobj-py3
    [4] http://jcdl.org/
    [5] http://bazaar.launchpad.net/~gtg/gtg/trunk/revision/1307
    [6] https://developer.gnome.org/gtk3/stable/DeprecatedObjects.html