2012年11月14日 星期三

extern問題造成的錯誤

今天遇到的情形令人嘔血

a.c 宣告
byte X[8] = {0};

b.c 引用
extern X[] ; 
extern byte X[8] ;

若使用錯誤方式,VC6.0 compiler 過得去,但把值印出來看就會發現錯誤了。
不曉得其他compiler有沒有防此錯誤。

還是完整點寫出來比較妥當。

2012年3月21日 星期三

vs2005 + Access 2007

----筆記---  卡關中

ref   逐步解說:Web 網頁中的基本資料存取
逐步解說:建立可以顯示 Access 資料庫資料的 Web 網頁
無法順利下一步
因為只有提供 .mdb (Access 2003) 連線方式
而我的是 .accdb (Access 2007)

所以  HOW TO:使用 SqlDataSource 控制項連接至 Access 資料庫
http://msdn.microsoft.com/zh-tw/library/hktw939c(v=VS.80).aspx
繫結至資料庫
http://msdn.microsoft.com/zh-tw/library/ms178361(v=VS.80).aspx
http://msdn.microsoft.com/zh-tw/library/ms247233(v=vs.80).aspx

ref   ASP.NET用控件连接Access2010数据库报错的解决方法
http://www.soaspx.com/dotnet/asp.net/tech/tech_20111103_8235.html

但在選擇 provider 時,無法選擇 oledb.12xxx版本

http://cn-asp.net/html/c10/2009-09/755.htm
http://www.dotblogs.com.tw/maduka/archive/2011/09/14/36150.aspx


檢查Oledb  Driver

1. 檢查

系統管理工具->資料來源ODBC-> 驅動程式
有沒有 Microsoft Access Driver (*.mdb, *.accdb) / 版本: 12.xxx 開頭

2. 檢查
http://social.msdn.microsoft.com/Forums/zh-TW/238/thread/dd104ef2-b793-4fa0-9fb2-e6f9e8aab4e8/
VS2005 伺服器總管->資料連接->加入資料連接->Oledb/其他->確定-> Oledb 提供者
有沒有 Microsoft Office 12.0 Access Database Engine OLE DB Provider
3. 承2 將資料庫名稱含路徑填入伺服器名稱欄位,測試是否可正常連線。
資料庫檔案 引入時放在App_Data資料夾下,另外生成Db資料夾,且含此副本。路徑選擇App_Data這個。

所以主機有12版driver, 也可以連線,F5正常顯示

增加可編輯、刪除功能,在debug mode 時, 編輯完畢進行更新動作出現錯誤

Error: UPDATE 或 DELETE 查詢不能包含多重值欄位
待解......

尚未嘗試
http://www.haogongju.net/art/848527
http://msdn.microsoft.com/zh-tw/library/ms247297(v=vs.90).aspx


http://forum.synology.com/enu/viewtopic.php?f=20&t=29338&p=178101&hilit=joomla#p178101

2012年3月20日 星期二

XP虛擬機並安裝IIS,使用VMware

--------筆記-------
老大說要架設Web Server ....

原本打算用 XAMP 整套給他下去,但後來想想 php寫到後面難debug,而且以前寫過了,沒啥新意,所以目前打算採用另一方案
IIS + Access 2003 + C#
用Access 是因為在office裡面眾多軟件中,我從來沒正眼瞧過他,跟隨了這麼久也該給他機會了XD
而我也沒用過C#寫過網頁,正好來練練。

目前手上硬體設備
NB         OS:XP (192.168.20.76)
配備i5-M460 2.53GHz 6G
Desktop OS:WIN7  (192.168.20.99)
配備i5-2300 3.3GHz 8G



開始建立測試環境,主要步驟如下
STEP1. VMware (7.0.1) + XP
STEP2. 安裝 VS2005
STEP3. 安裝 IIS
STEP4. VMware 網路設定


STEP1. VMware (7.0.1) + XP

XP安裝真的好快..順啦!

STEP2. 安裝 VS2005
這花了一點時間,含MSDN 差不多20分鍾吧。

STEP3. 安裝 IIS ref http://msdn.microsoft.com/zh-tw/library/33487zw6(VS.80).aspx
參考 逐步解說:在 Visual Web Developer 中建立基本 Web 網頁  作下列動作
在VS2005執行
檔案->新增->網站 
click "ASP.NET網站"   位置:HTTP  click "確定"
馬上F5偵錯
warning:  ASP.NET組態未設定debug
"確定"

error : 無法存取 IIS Metabase  
solution refer ASP.NET 無法存取 IIS Metabase解決方法


cmd -> cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\
下 aspnet_regiis -i  重新安裝 asp.net 2.0.50727
Restart IIS
再來F5
error: mutuex 錯誤
錯誤:無法在Web 伺服器上啟動偵錯
... 看了一些關於ASP.net權限的網頁 解決了

STEP4. VMware 網路設定
1.剛開始使用NAT 方式再利用port forwarding 無法成功
2.測試 NB ping 桌機 ,  失敗
3.修改防火牆輸入規則 , icmp 歸在印表機連線
Windows防火牆設定 > 進階設定 > 輸入規則 > 檔案及印表機共用(回應要求 - ICMPv4-In)
選擇「啟用規則」即可
4.重ping  成功!
5.IE KEY網址,連線失敗, 未轉送
6.改成 Bridge 橋接 , 自動設定IP192.168.20.170
7.ping 桌機OK , KEY網址 ERROR !
8.ping VM error
9.開大絕  VM 關閉防火牆  
10. ping  ' IE  OK

REF:
如何運用 Windows XP 疑難排解 TCP/IP 的連線問題
http://support.microsoft.com/kb/314067/zh-tw
http://ithelp.ithome.com.tw/question/10087936

VMware 的 Bridged, Host-only 和 NAT 網路型態
http://softsmith.blogspot.com/2008/02/vmware-bridgedhost-only-nat.html

如何善用 VMware 的四種網路環境
http://phorum.study-area.org/index.php?topic=47392.0
 
VMWare三種工作模式(bridged、NAT和host-only
http://jamsan.blog.hexun.com.tw/24812738_d.html

VMware架設伺服器允許外部連入解決方案(NAT mode)
http://blog.xuite.net/sphjlc062218/thinking/32175554-VMware架設伺服器允許外部連入解決方案(NAT+mode)




 http://blog.xuite.net/jialiang/programs/38849848-【FreeBSD】利用VirtualBox啓用主機界面和NAT功能建立有效的測試環境

JQUERY
http://kelp.phate.org/2011/03/jquery-fullcalendar-aspnet-mvc.html
http://msdn.microsoft.com/zh-tw/ee787054

ASP.NET
http://www.microsoft.com/taiwan/msdn/aspdotnet/
http://www.asp.net/downloads/essential
http://quickstarts.asp.net/QuickStartv20/aspnet/Default.aspx
http://yes.nctu.edu.tw/Lecture/ASP2005/index.htm
http://www.allenkuo.com/EBook5/default.aspx?TreeNodeID=8
http://www.allenkuo.com/EBook5/view.aspx?a=1&TreeNodeID=8&id=152
http://www.w3schools.com/aspnet/aspnet_examples.asp

IIS
http://60.251.1.52/taiwan/msdn/books/ataglance/SecNetch08.htm#configuringsecurity
http://60.251.1.52/taiwan/msdn/books/ataglance/SecNetch08.htm#accessingnetworkresources

2011年5月25日 星期三

C、C++ 函式庫Reference , Borland C適用

找不到 DOS.H、BIOS.H ??
請服用
http://www.digitalmars.com/rtl/dos.html

printf fromat

%[flags][min field width][precision][length]conversion specifier
  -----  ---------------  ---------  ------ -------------------
   \             #,*        .#, .*     /             \
    \                                 /               \
   #,0,-,+, ,',I                 hh,h,l,ll,j,z,L    c,d,u,x,X,e,f,g,s,p,%
   -------------                 ---------------    -----------------------
   # | Alternate,                 hh | char,           c | unsigned char,
   0 | zero pad,                   h | short,          d | signed int,
   - | left align,                 l | long,           u | unsigned int,
   + | explicit + - sign,         ll | long long,      x | unsigned hex int,
     | space for + sign,           j | [u]intmax_t,    X | unsigned HEX int,
   ' | locale thousands grouping,  z | size_t,         e | [-]d.ddde±dd double,
   I | Use locale's alt digits     t | ptrdiff_t,      E | [-]d.dddE±dd double,
                                   L | long double,  ---------=====
   if no precision   => 6 decimal places            /  f | [-]d.ddd double,
   if precision = 0  => 0 decimal places      _____/   g | e|f as appropriate,
   if precision = #  => # decimal places               G | E|F as appropriate,
   if flag = #       => always show decimal point      s | string,
                                             ..............------
                                               /          p | pointer,
   if precision      => max field width    /           % | %

Examples of common combinations:
formatoutput
printf("%08X",32_bit_var);0000ABCD
printf("%lu",32_bit_var);43981
printf("%'d",32_bit_var);43,981
printf("%10s","string"); string
printf("%*s",10,"string"); string
printf("%-10s","string");string
printf("%-10.10s","truncateiftoolong");truncateif



REF: http://www.pixelbeat.org/programming/gcc/format_specs.html

2011年4月21日 星期四

使用codewarrior 注意點點

compile錯誤描述: reference to lable '233' is out of range

敘述:
在程式碼加上兩行程式碼
cmp.l #40,D0
beq  C_lable1
就發生錯誤..

花了挺多時間還是搞不懂,最後由david回答,特此紀念XD
david said:當發生reference to lable '233' is out of range ,此類無法判斷的錯誤訊息,需注意
1:程式碼寫法
2.前後文友寫跳躍的部份是否異常
結果證明是2,因為前面不遠處有短距跳躍 beq.s 敘述,在其後面加上了上面的兩行程式碼,結果造成距離過長跳躍不到所指向的label !!!!!!

話說,想想之前好像也遇到過一樣的問題,還是打上網誌不會忘記。錯誤描述只能參考用!!!

2011年3月13日 星期日

coldfire 縮寫術語

Table i. Acronyms and Abbreviated Terms
Term Meaning
ADC Analog-to-digital conversion
ALU Arithmetic logic unit
BDM Background debug mode
BIST Built-in self test
BSDL Boundary-scan description language
CODEC Code/decode
DAC Digital-to-analog conversion
DMA Direct memory access
DSP Digital signal processing
EA Effective address
FIFO First-in, first-out
GPIO General-purpose I/O
I2C Inter-integrated circuit
IEEE Institute for Electrical and Electronics Engineers
IFP Instruction fetch pipeline

IPL Interrupt priority level
JEDEC Joint Electron Device Engineering Council
JTAG Joint Test Action Group
LIFO Last-in, first-out
LRU Least recently used
LSB Least-significant byte
lsb Least-significant bit
MAC Multiply accumulate unit, also Media access controller
MBAR Memory base address register
MSB Most-significant byte
msb Most-significant bit
Mux Multiplex
NOP No operation
OEP Operand execution pipeline
PC Program counter

PCLK Processor clock
PLIC Physical layer interface controller
PLL Phase-locked loop
POR Power-on reset
PQFP Plastic quad flat pack
PWM Pulse width modulation
QSPI Queued serial peripheral interface
RISC Reduced instruction set computing
Rx Receive
SIM System integration module
SOF Start of frame
TAP Test access port
TTL Transistor transistor logic
Tx Transmit
UART Universal asynchronous/synchronous receiver transmitter

2011年3月3日 星期四

(咬 )文(嚼 )字

宏:「」指的是用一個字串代替另一個字串的功能。在makefile中可以使用「=」號來定義宏,使用「$(宏名)」來使用宏;還可以用「:=」追加宏的內容。習慣上,宏名使用大寫。

有一些編譯器輸出的代碼,將執行於與編譯器所在相同型別的電腦和作業系統之上,這種編譯器叫做原生編譯器。輸出可以執行於不同的平台之上的編譯器,叫做交叉編譯器。由於嵌入式系統通常沒有軟體開發環境,因此,為這類系統開發軟體時,通常需要使用交叉編譯器