image72
html
MSN Messenger Button
http://settings.messenger.live.com/applications/CreateHtml.aspx
MSN Messenger Button
http://3c.msn.com.tw/messengerbutton/
msnim protocol
msnim协议的使用
首先,为了书写方便,这里做一个约定,约定 A 代表 contact=username@hotmail.com,其中username@hotmail.com表示你的Live ID,在实际使用时用你自己的账号代替。
1、视频聊天
msnim:video?A
2、直接对话
msnim:chat?A
3、音频对话
msnim:voice?A
4、添加联系人
msnim:add?A
例:msnim:add?Contact=yulri@msn.com
即把我添加为MSN好友。
|
image72
使用google-code-prettify提供的高亮脚本,可以支持类CShellxml类型的代码高亮。
进入blogger模板设置,在<head>标签里引用相关的js和css,如下:
<link href='http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css' rel='stylesheet' type='text/css'/>
<script src='http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js' type='text/javascript'/>
在body标签中添加onload事件,调用脚本对代码进行格式化:
<body onload='prettyPrint()'>
发布文章时,需要格式化的文档,只需要使用下面的标签包含起来即可:
<pre class="prettyprint">...</pre>
或
<code class="prettyprint">...</code>
_________________________________________
color_console.py
"""
Colors text in console mode application (win32).
Uses ctypes and Win32 methods SetConsoleTextAttribute and
GetConsoleScreenBufferInfo.
$Id: color_console.py 534 2009-05-10 04:00:59Z andre $
"""
from ctypes import windll, Structure, c_short, c_ushort, byref
SHORT = c_short
WORD = c_ushort
class COORD(Structure):
"""struct in wincon.h."""
_fields_ = [
("X", SHORT),
("Y", SHORT)]
class SMALL_RECT(Structure):
"""struct in wincon.h."""
_fields_ = [
("Left", SHORT),
("Top", SHORT),
("Right", SHORT),
("Bottom", SHORT)]
class CONSOLE_SCREEN_BUFFER_INFO(Structure):
"""struct in wincon.h."""
_fields_ = [
("dwSize", COORD),
("dwCursorPosition", COORD),
("wAttributes", WORD),
("srWindow", SMALL_RECT),
("dwMaximumWindowSize", COORD)]
# winbase.h
STD_INPUT_HANDLE = -10
STD_OUTPUT_HANDLE = -11
STD_ERROR_HANDLE = -12
# wincon.h
FOREGROUND_BLACK = 0x0000
FOREGROUND_BLUE = 0x0001
FOREGROUND_GREEN = 0x0002
FOREGROUND_CYAN = 0x0003
FOREGROUND_RED = 0x0004
FOREGROUND_MAGENTA = 0x0005
FOREGROUND_YELLOW = 0x0006
FOREGROUND_GREY = 0x0007
FOREGROUND_INTENSITY = 0x0008 # foreground color is intensified.
BACKGROUND_BLACK = 0x0000
BACKGROUND_BLUE = 0x0010
BACKGROUND_GREEN = 0x0020
BACKGROUND_CYAN = 0x0030
BACKGROUND_RED = 0x0040
BACKGROUND_MAGENTA = 0x0050
BACKGROUND_YELLOW = 0x0060
BACKGROUND_GREY = 0x0070
BACKGROUND_INTENSITY = 0x0080 # background color is intensified.
stdout_handle = windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE)
SetConsoleTextAttribute = windll.kernel32.SetConsoleTextAttribute
GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo
def get_text_attr():
"""Returns the character attributes (colors) of the console screen
buffer."""
csbi = CONSOLE_SCREEN_BUFFER_INFO()
GetConsoleScreenBufferInfo(stdout_handle, byref(csbi))
return csbi.wAttributes
def set_text_attr(color):
"""Sets the character attributes (colors) of the console screen
buffer. Color is a combination of foreground and background color,
foreground and background intensity."""
SetConsoleTextAttribute(stdout_handle, color)
_____________________________________________________________
test_color_console_py26.py
"""
Test module color_console (Python 2.6). Does not work with Python 3.0 (mainly
due to the usage of print. In Python 3.0 print is a builtin function and no more
a statement.
$Id: test_color_console_py26.py 535 2009-05-11 02:48:29Z andre $
"""
import color_console as cons
def test():
"""Simple test for color_console."""
default_colors = cons.get_text_attr()
default_bg = default_colors & 0x0070
cons.set_text_attr(cons.FOREGROUND_BLUE | default_bg |
cons.FOREGROUND_INTENSITY)
print '==========================================='
cons.set_text_attr(cons.FOREGROUND_BLUE | cons.BACKGROUND_GREY |
cons.FOREGROUND_INTENSITY | cons.BACKGROUND_INTENSITY)
print 'And Now for Something',
cons.set_text_attr(cons.FOREGROUND_RED | cons.BACKGROUND_GREY |
cons.FOREGROUND_INTENSITY | cons.BACKGROUND_INTENSITY)
print 'Completely Different!',
cons.set_text_attr(default_colors)
print
cons.set_text_attr(cons.FOREGROUND_RED | default_bg |
cons.FOREGROUND_INTENSITY)
print '==========================================='
cons.set_text_attr(default_colors)
if __name__ == "__main__":
test()
|