Pino在Twip的一个patch

Posted on 2010 09.02, Thursday, 01:09 a.m.

最近twitter的Basic Auth终于挂了,挂的完全没法用了。twip也早就更新出来OAuth版本了,于是果断升级到最新版。但是twip也仅仅是把OAuth转化成Basic Auth,还是需要密码的,于是我主页上的那个twitter状态更新就完全没法搞了。 好不容易架好twip。(这东西不报错,好难架)发现pino悲剧了,pino用的是libsoup,libsoup仅仅在401的时候才会开始用emit那个authenicate的signal,最开始的时候是不会做basic auth的。twip发现没有basic auth之后却返回一个403。于是pino永远不会用basic auth去认证。 实际上pino这么做也不好,第一次的流量就浪费了|||。于是写了一个小patch,人肉做base64 encoding,然后加入到http header中。顺便表示,这个pa

Comments(0)
More...

Userspace Memory Allocator (II) - The Hoard Allocator

Posted on 2010 08.22, Sunday, 08:08 a.m.

Following last post about allocator. The traditional allocator have faced a new challenge on multi-core system. According to C standard, the malloc have to be thread-safe, that means, it is allocator's responsibility to avoid race conditions. The ptmalloc2's ancestor dlmalloc is using a global lock, which means, multiple-thread cannot allocate memory simultaneously. ptmalloc2 add the concept of arenas, which is a pre-allocated chunk of memo

Comments(0)
More...

Clang Completion Source for AutoComplete in Emacs

Posted on 2010 08.21, Saturday, 02:08 a.m.

Recently, I went to Vobile.cn's Indexing and Storage Team for internship, and writing C++ code everyday. As a heavy Emacs user, I really cannot get used to modern IDE's key binding (even if they provide Emacs similar key bindings, but still lots of differences compare to real Emacs). The Emacs key binding scheme is just perfect for me, and I don't have any plans to switch it to Netbeans/Eclipse for just writing C++ code. Yet, C++ unlike C, is a strong typed

Comments(0)
More...

Userspace Memory Allocator (I)

Posted on 2010 08.06, Friday, 09:08 a.m.

Recently, I found a very good plaything - Userspace Memory Allocator. (If you've taken OS course before, simply skip this paragraph. )Userspace memory allocation is the only way that userspace programs allocate memory. The result of malloc a virtual memory address, which is mapped (or lazily mapped) on the the physical memory through process's page table inside OS. OS only provide page-level access, but for malloc, we can allocate any size of memor

Comments(0)
More...

重写了一下个人主页的前端。

Posted on 2010 05.11, Tuesday, 07:05 a.m.

以前这个blog的前端都是自己设计和写的,当时还很弱,对CSS也不是非常熟悉。这次把模版整个重写了一遍,为了适应Free CSS Template上的格式。暂时去掉了上面的status bar。因为懒得弄了,而且我目前也已经开始用twitter了。 除此之外还加了一个gavatar的头像,原来打算用javascript搞的,后来觉得这样就把大家邮箱暴露了-,-于是老老实实写个template filter。 接下来估计是打算把twitter那面的状态同步过来吧,不过还没想好怎么弄,因为要考虑穿墙问题。

Comments(5)
More...

Switching From notify-osd to notification-daemon

Posted on 2010 03.31, Wednesday, 10:03 a.m.

Occasionally, quark mentioned that the notify-osd from ubuntu community is not standardlized. Seems that notification also become a standard under freedesktop. However, as a piece of work from Ubuntu community, artwork of notify-osd is excellent. I guess that's why there're still lots of users sticking to notify-osd. quark told me about a new theme, notification-daemon-slider. It's a perfect imitation of notify-osd. I tried this out

Comments(3)
More...

Sunpinyin2.0 release

Posted on 2010 03.19, Friday, 11:03 p.m.

经过了N多RC后,总算release了。现在google code上面的release包含了ibus和xim的wrapper。我blog中的那个链接已经失效了。那个版本和现在正式版差距太大了,是个非常久远的版本了--。 同时debian repo也基本搞定了。在以下地址 http://www.sfu.ca/~dqin/ 和 http://mike.struct.cn/sunpinyin/ 对于以前在rc阶段做过mirror的同学,对不住了。删掉重新来吧,当时觉得可以release了,可是后来发现有N多bug,又rc了好几次。 还有不到一个月就要GRE了。

Comments(4)
More...

Python's singleton, again...

Posted on 2010 03.16, Tuesday, 01:03 a.m.

I've been discussed with Pluskid before, that how to write a pythonic version of singleton. It is clear that we should do a hack on the __new__ method. Override that and add our newly spawned instance to the class member. This is a very simple way of doing singleton in Python. Today, however, i got into trouble with this. class Wrapper(object): def __new__(cls): if not hasattr(cls, '_instance'): cls._instance = object.__new__(cls)

Comments(3)
More...

Programmers Should Stay Away From These People...

Posted on 2010 02.21, Sunday, 08:02 p.m.

"Every programmer should use X", where X is mostly a language, a IDE, an code editor, or an Operating System. If any of your colleagues says this to you, you probabily want to stay away from him. Consider all the development tools that helps you through out the software cycle, no tool are perfect. More often these software are produced to adapt developers behavior, however, the habit of each developers are considerably different. I have seen coders with very long fingers can press escape key with

Comments(0)
More...

screenlets patch

Posted on 2010 01.26, Tuesday, 02:01 p.m.

screenlets seems never set the correct x,y position for me. So i made a patch for it. see attachment. The reason might because screenlets miss the change of moving the window when restarting or being ignored by the window manager during first startup. Get it here. Use it at your own risk. -w-

Comments(1)
More...
Next >