- 使用 firefox
- 安装 greasemonkey 插件, https://addons.mozilla.org/en-US/firefox/addon/748
- 重启 firefox
- 打开 http://userscripts.org/scripts/show/58599
- 点击 Install
源码位于: http://userscripts.org/scripts/review/58599
Hello, I am LI Daobing(first name is family name). You can talk with me in English or Chinese.
class _Foo {
};
typedef boost::shared_ptr<_Foo> Foo;
Foo foo_new(constructor args...);
方法如下:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1,SHA256
Sat, 09 May 2009 17:23:00 +0800
For a number of reasons, i've recently set up a new OpenPGP key, and
will be transitioning away from my old one.
The old key will continue to be valid for some time, but i prefer all
future correspondence to come to the new one. I would also like this
new key to be re-integrated into the web of trust. This message is
signed by both keys to certify the transition.
the old key was:
pub 1024D/6087D2F8 2004-09-05
Key fingerprint = 2F18 9473 01F7 5240 A6E8 B1BC E535 0AE0 6087 D2F8
And the new key is:
pub 4096R/2F6E9AE0 2009-05-09
Key fingerprint = 4223 125E ED8B 189C 67CA 2B52 8CB9 287E 2F6E 9AE0
To fetch key, you can get it with:
gpg --keyserver keys.gnupg.net --recv-key 2F6E9AE0
If you already know my old key, you can now verify that the new key is
signed by the old one:
gpg --check-sigs 2F6E9AE0
If you don't already know my old key, or you just want to be double
extra paranoid, you can check the fingerprint against the one above:
gpg --fingerprint 2F6E9AE0
If you are satisfied that you've got the right key, and the UIDs match
what you expect, I'd appreciate it if you would sign my key:
gpg --sign-key 2F6E9AE0
Lastly, if you could upload these signatures, i would appreciate it.
You can either send me an e-mail with the new signatures (if you have
a functional MTA on your system):
gpg --armor --export 2F6E9AE0 | mail -s 'OpenPGP Signatures' lidaobing@gmail.com
Or you can just upload the signatures to a public keyserver directly:
gpg --keyserver keys.gnupg.net --send-key 2F6E9AE0
Please let me know if there is any trouble, and sorry for the
inconvenience.
Regards,
LI Daobing
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkoFWHUACgkQ5TUK4GCH0vht3gCeJ76nYpGU+91pArBxH0zmv/hY
xRMAn0jcxnAkAp40BdnPQkC+mkRMeYBziQIcBAEBCAAGBQJKBVh1AAoJEIy5KH4v
bprgsh4QALvXQd+Lst/+WR7WpUF0h5efBlb8uc4lU5LAnlMS+UuDZSJuLOIJZX4z
6nHbyqfJa9WbnVeme9wlvdEM2BHw5A58b6+lxNEcjoINuYEbQriAJ66LaH+o0Qoj
tf6w3ojRp+YZrsdQJYmZkZoPEYXuOnH3rVSNzmI6HnkW5VePp8J5twxRkKCg3kM4
XSm9uzq8Aj7lD+q0CMdqKeTm6Yxu+XCXRvvyNEMbNbyZTRJFVSqzUvc+TrTz+nz5
1sLG1icFGEh8iqzO9Mq0xUpD74mLy/7s0fG0bvTUXu9VmcarweEp5l3IU5hGgQXr
pXWAtvTvOq42gVJcsQ2KQDLwcUq55oEP5l5ioDzqcK2l2x6kUJ+z7x1xgTDpdt97
CU8QeWKNblHLNtGipJs/qNvE0JLS+soUH0wfBEy333+dHhRqmyjJ+Q8GAu0bdv2D
MPIKA7HURao7MKnF7HNjKAPgrrCGYQ4WcR1n1O3LLzAg2ag1bd0vx5XjQWhPnEhN
/ttJTNW3qzw1fXsNHLK3UUcS5KX9Evyr81DwzbHjn2F5Gk7P1/0/Ed/6akf6pGpJ
ho4aVfZgz7zdDL0yG3800YCxs6nJMSt1IKimJA2bh3zAtox+QUgxnQqL4Bp6one+
+3ttIgdMEOmcIcGV0zh9RCxt+JpXeqQ5/TLsUpdYS20aqtEZaVeM
=H6UO
-----END PGP SIGNATURE-----
#!/usr/bin/env python
import logging
import sys
log = logging.getLogger(__name__)
def main():
lines = file('debian/control').readlines()
l1 = None
l2 = None
for idx, x in enumerate(lines):
if x.startswith('Maintainer:'):
l1 = idx
elif x.startswith('XSBC-Original-Maintainer:'):
l2 = idx
if l1 is None:
log.error("can't find maintainer line")
sys.exit(1)
isUbuntu = l2 is not None
if isUbuntu:
maintainer = lines[l2].lstrip('XSBC-Original-Maintainer:').strip()
else:
maintainer = lines[l1].lstrip('Maintainer:').strip()
if isUbuntu:
lines[l1] = 'Maintainer: %s\n' % maintainer
del lines[l2]
else:
lines[l1] = 'Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>\n' \
+ 'XSBC-Original-Maintainer: %s\n' % maintainer
file('debian/control', 'w').writelines(lines)
if __name__ == '__main__':
main()
struct _Xxx {
GObject parent_instance;
XxxPrivate* priv;
}
import gobject
class MyObject(gobject.GObject):
foo = gobject.property(type=str, default='bar')
boolprop = gobject.property(type=bool, default=False)
def __init__(self):
gobject.GObject.__init__(self)
@gobject.property
def readonly(self):
return 'readonly'
log4j.appender.SYSLOG=org.apache.log4j.net.SyslogAppender
log4j.appender.SYSLOG.syslogHost=192.168.101.101
log4j.appender.SYSLOG.facility=local3
log4j.appender.SYSLOG.facilityPrinting=false
log4j.appender.SYSLOG.layout=org.apache.log4j.PatternLayout
log4j.appender.SYSLOG.layout.ConversionPattern=%d{dd-MM-yyyy HH:mm:ss} %-5p (%C:%M:%L) - %m%n
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{dd-MM-yyyy HH:mm:ss} %-5p (%C:%M:%L) - %m%n
log4j.rootLogger=info, CONSOLE, SYSLOG
log4j.FATAL = 0 = syslog.EMERG
log4j.ERROR = 3 = syslog.ERR
log4j.WARN = 4 = syslog.WARNING
log4j.INFO = 6 = syslog.INFO
log4j.DEBUG = 7 = syslog.DEBUG
filter f_foo { facility(local3); };
destination df_foo { file("/var/log/foo.log" owner("foo")); };
log {
source(s_all);
filter(f_foo);
filter(f_at_least_warn);
destination(df_foo);
};
deb http://ppa.launchpad.net/lidaobing/ppa/ubuntu intrepid main

public class MyDA {
//...
}
public class MyApp {
public MyApp() {
da = new MyDA();
}
private MyDA da;
//...
}
public interface IMyDA {
//...
}
public class MyDA implements IMyDA {
//...
}
public class MyApp {
public MyApp() {
setDA(new MyDA());
}
protected void setDA(IMyDA da) {
this.da = da;
}
private IMyDA da;
//...
}
public interface IMyDA {
//...
}
public class MyDA implements IMyDA {
//...
}
public class MyDAFactory {
public IMyDA createMyDA(String name) {
if(name.equals("foo")) {
return new MyDA();
} else {
throw new Exception();
}
}
}
public class MyApp {
public MyApp() {
setDA(MyDAFactory.createMyDA("foo"));
}
protected void setDA(IMyDA da) {
this.da = da;
}
private IMyDA da;
//...
}
用到的 myapp.xml 文件
public interface IMyDA {
//...
}
public class MyDA implements IMyDA {
//...
}
public class MyApp {
public MyApp() {
BeanFactory factory = new XmlBeanFactory(
new FileInputStream("myapp.xml"));
da = (IMyDA) factory.getBean("da");
}
private IMyDA da;
//...
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="da" class="MyDA"/>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!-- 配置 mysql 连接 -->
<bean id="db" class="com.mysql.Connection">
<property name="uri"
value="mysql://userName:secret@192.168.12.23/dbname"/>
</bean>
<!-- 配置 proxool -->
<bean id="proxool" class="com.proxool.Pool">
<property name="db" ref="db"/>
<property name="maxConnection" value="200"/>
</bean>
<!-- 配置 memcache -->
<bean id="memcache" class="com.memcache.Foo">
<property name="config" value="192.168.23.34:12345">
</bean>
<!-- 配置 SuperMyDA -->
<bean id="da" class="SuperMyDA">
<property name="proxool" ref="proxool"/>
<property name="memcache" ref="memcache"/>
</bean>
</beans>