Notes-9:lua binder另一隻輪子的雛形

    利用c++0x新特性來實現一個lua binder, 這是個超級雛形,基本上實現了從函數參數的拆卸和重新組裝。    從xLB_caller壓入兩個實參(類比lua_State可以給我們提供實參)template<class R, class...A> struct xLB_caller {};template<class R, class...A>struct xLB_caller<R (*)(A...)> { typedef R

No1:luacom excel 使用分列設定文字格式設定

把格子改成文字格式設定用“分列”最徹底(如NumberFormate並不起作用,如同在GUI操作一樣,設定儲存格格式為文本,但不會調整顯示。這個問題比較糾結,不知是否有人知道其原因)。WorkSheet.Columns[1].NumberFormat:='@'好像也不穩定。分列調用的是range.TextToColumns,可從宏錄製中看到,這個比較詳細http://www.cnblogs.com/outman2008/archive/2009/04/25/1443436.html。參數詳看ht

No2:luacom中文內容輸出BUG及修正

    使用cell.Value2輸出中文內容時總是亂碼。懷疑是utf-8的原因,轉換後結果仍然是亂碼。自己再寫個轉換的再測試,依然是亂碼,莫非有BUG!?下個LUACOM的源碼,查看函數tLuaCOMTypeHandler::com2lua和tStringBuffer tUtil::bstr2string。整個過程看起來都OK,但再測試發現,結果字串少了一個bytes。   

No3:luacom WMI monitor process create and close

luacom中使用WMI監視進行的建立和關閉。還是挺酷的。然後開啟一個Notepad.exe,再關閉它,就能看到兩行輸出。WMI入門package.cpath=[[C:\Program Files\Lua\5.1\clibs\?.dll]]require "luacom"strComputer = "mycomputername"objWMIService =

CentOS5.6代理程式更新源配置

linux包管理工具用過 yast,明了簡單,非常易用,特別是使用iso時。用過apt-get,ubuntu的wiki很方便,照做就行。就是覺得yum不太好用,今天在同事的協助下設定了一下,也不複雜,簡單記錄一下:背景:用的http代理1.在/etc/yum.repo.d/下面建立xxx.repo檔案,內容就是源地址,可以從網找.2.擷取官方的KEY檔案,主要是防止軟體被修改,使用了rpm關於代理的參數:rpm --httpproxy HOSTIP --httpport PORT

STL雜記(4)

1.模板執行個體化(instantiated)的兩個層次,聲明和使用時的定義檢查,參數依賴內容只做聲明檢查// details/lazy.cpp template <typename T> class Safe { }; template <int N> class Danger { public: typedef char Block[N]; // would fail for N<=0 }; template <typename T,

ecos 編譯時間無法找到 tclConfig.sh 和 tkConfig.sh

 這是因為 tcl-devel tk-devel 一般系統中預設是不安裝的,至少cent-os 5.5 和fedora 11是這樣的,安裝這兩個包即可。# yum install tcl-devel tk-devel 補記: ubuntu 10.04.2 上為了便於多個版本的tcl的存在,tcl被安裝的位置不太一樣,如tcl8.5標頭檔目錄:/usr/include/tcl8.5/    

Notes-5:wxLua介面檔案的GVIM文法高亮

wxLua的介面副檔名是.i, 如果用gvim編輯會和其實的檔案類型文法高這衝突. 為此建議把.i檔案和xxxoverride.hpp的檔案都改成.wli副檔名, 以下是wli的文法高亮, 初步調試在gvim7.3上可用. " Vim syntax file" Language: wli" Maintainer: loon.x <wunoman@qq.com>" Last Change: 2011 May 30" Remark: Includ the C++

how make none-bare git repo to bare

 在雲端儲存的時代,各種網盤都來了。自己沒事寫點代碼時,用用git,利用網盤的自動同步功能,便可以自己架一個私人的准git server了,原理很簡單的,把git repo放網盤裡就可以了。 不過,這個時候我們需要將原來不是bare的repo,弄成bare的才完美。摘自GIT FAQ,自己試了一下。 我的環境: Windows XP + msysgit步驟:   * 假設原來的repo檔案夾為 F:/repo  * 在網盤的目錄下建立一個檔案夾,例如 test  * 右鍵檔案夾,選擇 Git

Notes-11:編譯wxWidget 2.9.2

1. 下載wxWidget 2.9.2http://wxwidgets.org/downloads/#latest_dev2. 下載filefn.patch,gcc-4.7-name-lookup.patch,用cygwin的patch.exe打上patch.exe -p0 < filefn.patchpatch.exe -p0 < gcc-4.7-name-lookup.patch3. 編譯mingw32-make.exe -f makefile.gcc

STL雜記(1)

STL就象一個大的類型推導機器. 她把類型做為參數,用推導做為運算.通過匹配規則來確實最後的調用.1.類型有簡單的如int ,有複雜的如 int

MinGW(msys 1.0) 編譯 splint

 splint是一個開源的Lint工具,在mingw上編譯還需要一點修改。 首先mingw(msys 1.0)中必須包含gcc g++ flex bison,其他我也不知道了,反正我當時把開發用的基本都裝上了。 切換到解壓的原始碼目錄 # ./configure# 將產生的config.h重新命名為winconfig.h,並在最後添加 #undef WIN32# 開啟osd.c檔案,在#include "osd.h" 一行下面,加#define WIN32,在檔案最後加#undef WIN32

Notes-12: 在DLL中使用wxWidget

在DLL中使用wx,還是需要提供是一個wxApp。可以這樣寫一個/*---------------------------------------------------------------------------dawnwxApp-----------------------------------------------------------------------------*/class dawnwxApp : public wxApp {public:virtual bool

Difference between Monitor mode and Promiscuous mode

Monitor mode enables a wireless nic to capture packets without associating with an access point or ad-hoc network. This is desireable in that you can choose to "monitor" a specific channel, and you need never transmit any packets. In fact

Notes-7:variadic template

#include <iostream>using namespace std;template<typename T>void print_comma_separated_list(const T& value) { std::cout<<value<<std::endl;}template<typename First,typename ... Rest>void

1.fstream.STL

1.斷行符號STL裡有個fstream類,用來讀寫檔案,對於文字檔的斷行符號處理得注意個問題,那就是開方模式中要使用ios_base::binary,才能正確的進行讀寫。讀出資料時要有啟用這個模式,寫的時候也一樣。 const char* filename="a.txt";fstream file;file.open(filename, ios_base::in | ios_base::binary);if (file.fail()) goto LB_FAIL;//失敗

Access VirtualBox Shared Folders within Ubuntu 11.10 (Oneiric Ocelot)

http://www.liberiangeek.net/2011/10/access-virtualbox-shared-folders-within-ubuntu-11-10-oneiric-ocelot/ This brief guide shows you how to share a folder from the host machine and access it within Ubuntu – the guest machine using VirtualBox. We have

Notes-6:LUA應用之利用luacom接收IE,Excel訊息

package.cpath=[[D:\Tools\Lua\5.1\clibs\?.dll]];require "luacom"excel=luacom.CreateObject("Excel.Application");assert(excel);excel.Visible=true;workbook=excel.Workbooks:Add();print("workbook=" .. tostring(workbook));workbook_events={}function

使用線程的三種方式

1.流水線:每個線程反覆的在資料序列集上執行同一操作,並把操作結果傳遞給下一步驟的其它線程。Pipelie:Each thread repeatedly performs the same operation on a sequence of date sets, passing each result to another thread for the next step. This is also known as an "assembly

使用xdmcp協議遠端連線Redhat

基本環境:Redhat 5.6 gnomeXManager修改:/etc/gdm/custom.conf檔案在[xdmcp]標籤下添加:Enable=true重啟 X Server:init 3(關閉 X Server)init 5(起動 X Server)通過 XDMCP,從 Linux主機登入。底下的流程在『用戶端』執行:請務必要在 X Window 當中,進入 X Window的方式有:[root@client ~]# startx# 或[root@client ~]# init 5(1)

總頁數: 61357 1 .... 13317 13318 13319 13320 13321 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.