WP-Syntax代码高亮

WP-Syntax代码高亮

www.wpdaxue.com/wp-syntax.html

WP-Syntax 代码书写格式

<pre lang="html" line="1" escaped="true">
//这里添加代码……
</pre>

 

其中,lang=”html”表示代码语言为html,请根据自己需要修改; line=”1″ 表示显示行号,如果不需要,去掉即可;escaped=”true” 是为了防止代码转义,如果不需要,去掉即可。

注意:在wordpress后台使用 WP-Syntax 等代码高亮插件,需要在html模式下添加代码,不要随意切换到可视化模式,否则代码就容易转义!!

 

WP-Syntax 插件支持的高亮语言


'actionscript' => array('as'),
'ada' => array('a', 'ada', 'adb', 'ads'),
'apache' => array('conf'),
'asm' => array('ash', 'asm', 'inc'),
'asp' => array('asp'),
'bash' => array('sh'),
'bf' => array('bf'),
'c' => array('c', 'h'),
'c_mac' => array('c', 'h'),
'caddcl' => array(),
'cadlisp' => array(),
'cdfg' => array('cdfg'),
'cobol' => array('cbl'),
'cpp' => array('cpp', 'hpp', 'C', 'H', 'CPP', 'HPP'),
'csharp' => array('cs'),
'css' => array('css'),
'd' => array('d'),
'delphi' => array('dpk', 'dpr', 'pp', 'pas'),
'diff' => array('diff', 'patch'),
'dos' => array('bat', 'cmd'),
'gettext' => array('po', 'pot'),
'gml' => array('gml'),
'gnuplot' => array('plt'),
'groovy' => array('groovy'),
'haskell' => array('hs'),
'html4strict' => array('html', 'htm'),
'ini' => array('ini', 'desktop'),
'java' => array('java'),
'javascript' => array('js'),
'klonec' => array('kl1'),
'klonecpp' => array('klx'),
'latex' => array('tex'),
'lisp' => array('lisp'),
'lua' => array('lua'),
'matlab' => array('m'),
'mpasm' => array(),
'mysql' => array('sql'),
'nsis' => array(),
'objc' => array(),
'oobas' => array(),
'oracle8' => array(),
'oracle10' => array(),
'pascal' => array('pas'),
'perl' => array('pl', 'pm'),
'php' => array('php', 'php5', 'phtml', 'phps'),
'povray' => array('pov'),
'providex' => array('pvc', 'pvx'),
'prolog' => array('pl'),
'python' => array('py'),
'qbasic' => array('bi'),
'reg' => array('reg'),
'ruby' => array('rb'),
'sas' => array('sas'),
'scala' => array('scala'),
'scheme' => array('scm'),
'scilab' => array('sci'),
'smalltalk' => array('st'),
'smarty' => array(),
'tcl' => array('tcl'),
'vb' => array('bas'),
'vbnet' => array(),
'visualfoxpro' => array(),
'whitespace' => array('ws'),
'xml' => array('xml', 'svg'),
'z80' => array('z80', 'asm', 'inc')


包装cout等ostream对象的方法

包装cout等ostream对象的方法

http://stackoverflow.com/questions/1134388/stdendl-is-of-unknown-type-when-overloading-operator

技术关键在于std::endl是一个函数

 

 
#include 

struct MyStream
{
    template 
    MyStream& operator< <(const T& x)
    {
        std::cout << x;

        return *this;
    }


    // function that takes a custom stream, and returns it
    typedef MyStream& (*MyStreamManipulator)(MyStream&);

    // take in a function with the custom signature
    MyStream& operator<<(MyStreamManipulator manip)
    {
        // call the function, and return it's value
        return manip(*this);
    }

    // define the custom endl for this stream.
    // note how it matches the `MyStreamManipulator`
    // function signature
    static MyStream& endl(MyStream& stream)
    {
        // print a new line
        std::cout << std::endl;

        // do other stuff with the stream
        // std::cout, for example, will flush the stream
        stream << "Called MyStream::endl!" << std::endl;

        return stream;
    }

    // this is the type of std::cout
    typedef std::basic_ostream > CoutType;

    // this is the function signature of std::endl
    typedef CoutType& (*StandardEndLine)(CoutType&);

    // define an operator< < to take in std::endl
    MyStream& operator<<(StandardEndLine manip)
    {
        // call the function, but we cannot return it's value
        manip(std::cout);

        return *this;
    }
};

int main(void)
{
    MyStream stream;

    stream << 10 << " faces.";
    stream << MyStream::endl;
    stream << std::endl;

    return 0;
}

文件夹遍历

文件夹遍历

http://www.cppblog.com/shongbee2/archive/2009/03/30/78366.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364418%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364428%28v=vs.85%29.aspx

用windows的API实现文件夹的遍历扫描的程序
使用到的API:
FindFirstFile
FindNextFile
FindClose
主要用到的结构:
WIN32_FIND_DATA
在msdn都有详细的说明。这里也简要说明一下:
HANDLE WINAPI FindFirstFile(
__in          LPCTSTR lpFileName, //要查找的文件路径
__out         LPWIN32_FIND_DATA lpFindFileData//保存文件结构的指针
);
查找对应的路径,如果查找返回查找的句柄,然后我们可以通过该句柄去查找下一个和关闭这个句柄。
如果查找失败,则返回(INVALED_HANDLE_VALUE)(-1),可以通过GetLastError();来得到他的错误类型。
注意:查找第一个的时候,他不仅返回了查找的句柄,他也把第一个的文件信息保存在lpFindFileData里面了。所以这个也是要处理的。


例程:
头文件包含:
#include <windows.h>
#include <winbase.h>    // 在这里定义

 


#include 
#include 
#include 
using namespace std;

#include 
#include     // 在这里



int main()
{

    // HANDLE WINAPI FindFirstFile(
    //       _In_   LPCTSTR lpFileName,             C风格字符串 名
    //      _Out_  LPWIN32_FIND_DATA lpFindFileData        指向接收信息的结构体的指针
    //      );

    // 关于返回值
    // 成功, 则返回用来继续查找或者关闭用的句柄
    //
    // 失败,则返回 INVALID_HANDLE_VALUE 并且结构体内容是不确定的
    // 获取更多信息在 GetLastError 函数
    //
    // 如果没有找到文件 GetLastError 函数会返回 ERROR_FILE_NOT_FOUND

    // 关于第一个参数
    // The directory or path, and the file name, which can include wildcard characters,
    // for example, an asterisk (*) or a question mark (?).
    //
    // This parameter should not be NULL, an invalid string
    // (for example, an empty string or a string that is missing the terminating null character),
    // or end in a trailing backslash ().
    //
    // If the string ends with a wildcard, period (.),
    // or directory name,
    // the user must have access permissions to the root and all subdirectories on the path.
    //
    // In the ANSI version of this function, the name is limited to MAX_PATH characters.
    // To extend this limit to 32,767 wide characters,
    // call the Unicode version of the function and prepend "\?" to the path.


    // BOOL WINAPI FindNextFile(
    //     _In_   HANDLE hFindFile,             上一个函数的返回句柄
    //     _Out_  LPWIN32_FIND_DATA lpFindFileData
    // );
    // 失败返回false【没有下一个??】    并且结构体返回内容不确定
    // 具体失败信息查看 GetLastError

    // BOOL WINAPI FindClose(
    //     _Inout_  HANDLE hFindFile       关闭句柄
    // );

    // 结构体内容
    // typedef struct _WIN32_FIND_DATA {
    //     DWORD    dwFileAttributes;
    //     FILETIME ftCreationTime;
    //     FILETIME ftLastAccessTime;
    //     FILETIME ftLastWriteTime;
    //     DWORD    nFileSizeHigh;
    //     DWORD    nFileSizeLow;
    //     DWORD    dwReserved0;
    //     DWORD    dwReserved1;
    //     CHAR    cFileName[MAX_PATH];
    //     CHAR    cAlternateFileName[14];
    //      } WIN32_FIND_DATA, *PWIN32_FIND_DATA, *LPWIN32_FIND_DATA;

    // DWORD WINAPI GetLastError(void);
    // 返回上一个错误代码

    WIN32_FIND_DATA FindFileData;
    LPWIN32_FIND_DATA lpFindFileData = &FindFileData;

    string path = ".\png\*.png";

    HANDLE handle = FindFirstFile( path.c_str(), lpFindFileData );

    if ( INVALID_HANDLE_VALUE == handle )
    {
        cout < < "INVALID_HANDLE_VALUE" << endl;
        cin.get();
        return -1;
    }

    do{
        if (  !( lpFindFileData->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)  )
        {
            cout < < lpFindFileData->cFileName < < endl;
        }
        int t = GetLastError();
//        cout << "GetLastError " << t << endl;
        if ( ERROR_FILE_NOT_FOUND == t )
        {
            cout << "ERROR_FILE_NOT_FOUND" << endl;
        }
    }while ( FindNextFile( handle, lpFindFileData ) );

    if ( !FindClose(handle) )
    {
        cout << "CloseFail" << endl;
        return -1;
    }

    cin.get();

    return 0;
}







win虚拟按键编码

win虚拟按键编码

http://msdn.microsoft.com/en-us/library/ms927178.aspx

Virtual key codes

Symbolic constant Hexadecimal value Mouse or keyboard equivalent
VK_LBUTTON 01 Left mouse button
VK_RBUTTON 02 Right mouse button
VK_CANCEL 03 Control-break processing
VK_MBUTTON 04 Middle mouse button on a three-button mouse
0507 Undefined
VK_BACK 08 BACKSPACE key
VK_TAB 09 TAB key
0A0B Undefined
VK_CLEAR 0C CLEAR key
VK_RETURN 0D ENTER key
0E0F Undefined
VK_SHIFT 10 SHIFT key
VK_CONTROL 11 CTRL key
VK_MENU 12 ALT key
VK_PAUSE 13 PAUSE key
VK_CAPITAL 14 CAPS LOCK key
1519 Reserved for Kanji systems
1A Undefined
VK_ESCAPE 1B ESC key
1C1F Reserved for Kanji systems
VK_SPACE 20 SPACEBAR
VK_PRIOR 21 PAGE UP key
VK_NEXT 22 PAGE DOWN key
VK_END 23 END key
VK_HOME 24 HOME key
VK_LEFT 25 LEFT ARROW key
VK_UP 26 UP ARROW key
VK_RIGHT 27 RIGHT ARROW key
VK_DOWN 28 DOWN ARROW key
VK_SELECT 29 SELECT key
2A Specific to original equipment manufacturer
VK_EXECUTE 2B EXECUTE key
VK_SNAPSHOT 2C PRINT SCREEN key
VK_INSERT 2D INS key
VK_DELETE 2E DEL key
VK_HELP 2F HELP key
3A40 Undefined
VK_LWIN 5B Left Windows key on a Microsoft Natural Keyboard
VK_RWIN 5C Right Windows key on a Microsoft Natural Keyboard
VK_APPS 5D Applications key on a Microsoft Natural Keyboard
5E5F Undefined
VK_NUMPAD0 60 Numeric keypad 0 key
VK_NUMPAD1 61 Numeric keypad 1 key
VK_NUMPAD2 62 Numeric keypad 2 key
VK_NUMPAD3 63 Numeric keypad 3 key
VK_NUMPAD4 64 Numeric keypad 4 key
VK_NUMPAD5 65 Numeric keypad 5 key
VK_NUMPAD6 66 Numeric keypad 6 key
VK_NUMPAD7 67 Numeric keypad 7 key
VK_NUMPAD8 68 Numeric keypad 8 key
VK_NUMPAD9 69 Numeric keypad 9 key
VK_MULTIPLY 6A Multiply key
VK_ADD 6B Add key
VK_SEPARATOR 6C Separator key
VK_SUBTRACT 6D Subtract key
VK_DECIMAL 6E Decimal key
VK_DIVIDE 6F Divide key
VK_F1 70 F1 key
VK_F2 71 F2 key
VK_F3 72 F3 key
VK_F4 73 F4 key
VK_F5 74 F5 key
VK_F6 75 F6 key
VK_F7 76 F7 key
VK_F8 77 F8 key
VK_F9 78 F9 key
VK_F10 79 F10 key
VK_F11 7A F11 key
VK_F12 7B F12 key
VK_F13 7C F13 key
VK_F14 7D F14 key
VK_F15 7E F15 key
VK_F16 7F F16 key
VK_F17 80H F17 key
VK_F18 81H F18 key
VK_F19 82H F19 key
VK_F20 83H F20 key
VK_F21 84H F21 key
VK_F22 85H F22 key(PPC only) Key used to lock device.
VK_F23 86H F23 key
VK_F24 87H F24 key
888F Unassigned
VK_NUMLOCK 90 NUM LOCK key
VK_SCROLL 91 SCROLL LOCK key
VK_LSHIFT 0xA0 Left SHIFT
VK_RSHIFT 0xA1 Right SHIFT
VK_LCONTROL 0xA2 Left CTRL
VK_RCONTROL 0xA3 Right CTRL
VK_LMENU 0xA4 Left ALT
VK_RMENU 0xA5 Right ALT
BA-C0 Specific to original equipment manufacturer; reserved. See following tables.
C1-DA Unassigned
DB-E2 Specific to original equipment manufacturer; reserved. See following tables.
E3 – E4 Specific to original equipment manufacturer
E5 Unassigned
E6 Specific to original equipment manufacturer
VK_PACKET E7 Used to pass Unicode characters as if they were keystrokes. If VK_PACKET is used with SendInput, then the Unicode character to be delivered should be placed into the lower 16 bits of the scan code. If a keyboard message is removed from the message queue and the virtual key is VK_PACKET, then the Unicode character will be the upper 16 bits of the lparam.
E8 Unassigned
E9-F5 Specific to original equipment manufacturer
VK_ATTN F6 ATTN key
VK_CRSEL F7 CRSEL key
VK_EXSEL F8 EXSEL key
VK_EREOF F9 Erase EOF key
VK_PLAY FA PLAY key
VK_ZOOM FB ZOOM key
VK_NONAME FC Reserved for future use
VK_PA1 FD PA1 key
VK_OEM_CLEAR FE CLEAR key
VK_KEYLOCK F22 Key used to lock device

Original equipment manufacturers should make special note of the VK key ranges reserved for specific original equipment manufacturer use: 2A, DBE4, E6, and E9F5.

In addition to the VK key assignments in the previous table, Microsoft has assigned the following specific original equipment manufacturer VK keys.

Symbolic constant Hexadecimal value Mouse or keyboard equivalent
VK_OEM_SCROLL 0x91 None
VK_OEM_1 0xBA “;:” for US
VK_OEM_PLUS 0xBB “+” any country/region
VK_OEM_COMMA 0xBC “,” any country/region
VK_OEM_MINUS 0xBD “-” any country/region
VK_OEM_PERIOD 0xBE “.” any country/region
VK_OEM_2 0xBF “/?” for US
VK_OEM_3 0xC0 “`~” for US
VK_OEM_4 0xDB “[{” for US
VK_OEM_5 0xDC “|” for US
VK_OEM_6 0xDD “]}” for US
VK_OEM_7 0xDE “‘”” for US
VK_OEM_8 0xDF None
VK_OEM_AX 0xE1 AX key on Japanese AX keyboard
VK_OEM_102 0xE2 “<>” or “|” on RT 102-key keyboard

For East Asian Input Method Editors (IMEs) the following additional virtual keyboard definitions must be observed.

Symbolic constant Hexadecimal value Description
VK_DBE_ALPHANUMERIC 0x0f0 Changes the mode to alphanumeric.
VK_DBE_KATAKANA 0x0f1 Changes the mode to Katakana.
VK_DBE_HIRAGANA 0x0f2 Changes the mode to Hiragana.
VK_DBE_SBCSCHAR 0x0f3 Changes the mode to single-byte characters.
VK_DBE_DBCSCHAR 0x0f4 Changes the mode to double-byte characters.
VK_DBE_ROMAN 0x0f5 Changes the mode to Roman characters.
VK_DBE_NOROMAN 0x0f6 Changes the mode to non-Roman characters.
VK_DBE_ENTERWORDREGISTERMODE 0x0f7 Activates the word registration dialog box.
VK_DBE_ENTERIMECONFIGMODE 0x0f8 Activates a dialog box for setting up an IME environment.
VK_DBE_FLUSHSTRING 0x0f9 Deletes the undetermined string without determining it.
VK_DBE_CODEINPUT 0x0fa Changes the mode to code input.
VK_DBE_NOCODEINPUT 0x0fb Changes the mode to no-code input.

Original equipment manufacturers should not use the unassigned portions of the VK mapping tables. Microsoft will assign these values in the future. If manufacturers require additional VK mappings, they should reuse some of the current manufacturer-specific and vendor-specific assignments.

域名更新,博客再开

域名更新,博客再开

趁着优惠花钱买了收费域名
再也不会像那样无缘无故就停止解析了.

空间倒是没有改,还是这个服务商
只是对文件进行了迁移
如果有访问失败 or 跳转到原地址【jeremie.tk】的
请将【.tk】改为【.asia】即可访问.

至于空间的话,现在还可以满足,什么时候不能满足了再换好了..恩恩~

「花右京メイド隊 La Verite」公式ホームページ

「花右京メイド隊 La Verite」公式ホームページ

这是对官网的抓取备份.
防止有可能存在的关闭,所以我抓取了一份..

源站点:http://www.geneon-ent.co.jp/rondorobe/anime/hanaukyo/
镜像站点:http://jeremie.asia/anime/hanaukyo/

工具:TeleportUltra 1.65
配置:8层、广度优先

「花右京メイド隊 La Verite」公式ホームページ  网站首页截图
「花右京メイド隊 La Verite」公式ホームページ 网站首页截图