Main Contents

generate object methods at runtime

June 19, 2008

I have been working on a dialer button class since yesterday. It makes sense to use the command design pattern here, and I want to separate the commands and the buttons so I can change the functionality of every button at runtime.
So we are talking about something like this:
class DialerButtons:
def […]

Filed under: programming, python | Comments (0)

我果然不懂 C 啊。

April 18, 2008

from gcc-4.2.info:
5.34 An Inline Function is As Fast As a Macro
<..snipped..>
If you specify both `inline’ and `extern’ in the function definition,
then the definition is used only for inlining. In no case is the
function compiled on its own, not even if you refer to its address
explicitly. Such an address becomes an external reference, as […]

Filed under: C, programming | Comments (0)

GLOBAL and struct

September 29, 2007

Refer to: Gnu - Global - Help - How to find the definition effectively
To put the story even shorter, the GNU GLOBAL will not treat C struct as definition, but as `other symbol’ . This means you may only find a struct with global -s, which will give you lots of irrelevant results.
This […]

Filed under: C, programming | Comments (0)

Hello World?

September 13, 2007

Guess this is appropriate for a blog about software.
>>> print “Hello, world!”
Hello, world!

Filed under: programming, python | Comments (0)