EvoTalk

Archive for the ‘C++’ 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

30 七月, 2009

Sort Map Value

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

use stl set to simulate map
view plain

CODE:

#include <iostream>

#include <vector>

#include <algorithm>

#include <set>

#include <map>

using namespace std;

 

class compare

{

public:

 

 //the error is over here

 bool operator()(pair<int, int> p1, pair <int, int> p2) const

 {

  if (p1.second == p2.second)

   return p1.first <p2.first;

  else

     return p1.second <p2.second;

 }

};

 

typedef set<pair<int, int>, compare> MMap;

 

void main(int argc, char* argv[])

{

 MMap D;

 D.insert(make_pair<int, int>(1, 10));

 D.insert(make_pair<int, int>(2, 2));

 D.insert(make_pair<int, int>(3, 2));

 D.insert(make_pair<int, int>(4, 3));

 D.insert(make_pair<int, int>(5, 6));

 

 MMap::const_iterator iter(D.begin());

 MMap::const_iterator [...]

Tags:

24 六月, 2009

AMR Codec

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

--AMR-NB--
-    The fixed-point (TS26.073)
-    The float (TS26.104)
-    The specification(TS26.071)
--AMR-WB--
-    The fixed-point (TS26.173)
-    The float (TS26.204)
-    The specification(TS26.171)

3GPP Specification 26-series



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

Category

Page 1 of 2212345»...Last »