EvoTalk

Archive for the ‘Code Snippet’ Category

03 二月, 2010

C# Call Method With String Name

Posted by: asd In: C++| Code Snippet

以變數名稱當作函式名稱來呼叫
參考:Call Static Method With a String Name in C#
帶參數的方法參考: 谁能讲解一下c# 中关于MethodBase Invoke方法?

view plain

CODE:

System.Text.Encoding utf_8 = System.Text.Encoding.UTF8;

 

// This is our Unicode string:

string s_unicode = "abcéabc";

 

// Convert a string to utf-8 bytes.

byte[] utf8Bytes = System.Text.Encoding.UTF8.GetBytes(s_unicode);

 

// Convert utf-8 bytes to a string.

string s_unicode2 = System.Text.Encoding.UTF8.GetString(utf8Bytes);

 

MessageBox.Show(s_unicode2);

reference : C# to convert from utf-8 bytes to string and back

31 十二月, 2009

Free C++ Skin Library

Posted by: asd In: C++| Code Snippet| 科技新知| 程式設計| 軟體使用

FreeCL(Free Control Library)是一個open source且free的Windows  skin library,包含了常用的Windows標準元件、Shell元件、IE風格 menu 以及 dialog

1. 安裝「python-2.5.4」
2. 安裝「PyGtk, PyOpenGL, PyGtkGlExt, PyWin32 all in one installer」
使用 「Glade」拉界面 ,「Pythonwin」  IDE  debug,

13 十月, 2009

Perl Here Document

Posted by: asd In: Code Snippet| Perl| 程式設計

Use Perl here documents to print multiple lines of output
example:
view plain

PERL:

print <<FOO;

Perl offers a convenient way of printing multiple lines of output through an interesting feature known as a "Perl here document".

 

A multiline Perl here document works like this:

<ol>

    <li>The first line of your command will include the two characters <code>&lt;&lt;</code> followed by a [...]



  • BK: 大於和小於在今日更廣泛地使用於標籤上,故在此補充該英文用法: : angle bracket []: square bracket
  • luh1688: 非常實用且謝謝!~
  • asd: 好的,不過很久沒修改了,不知道能不能動 寄到您的yahoo信箱
  • LIANG: nice post, thank you
  • Justmaker: 您好,請問可以跟你要source嗎?我最近有在看股票,想要enhance您的小工具,不知是否可以開放?

Category

Page 1 of 3512345»...Last »