顯示具有 程式設計 標籤的文章。 顯示所有文章
顯示具有 程式設計 標籤的文章。 顯示所有文章

星期一, 4月 26, 2021

[Reference]用命令列安裝 Visual Studio

Use command-line parameters to install Visual Studio

Syntax example: vs_enterprise.exe [command] <optional parameters>...

詳細內容請參閱原始文章

星期六, 3月 16, 2019

[程式] 利用 Codeigniter 3 快速建置 Restful API


教學文章:Codeigniter 3 Restful API Tutorial
Github 範例:https://github.com/chriskacerguis/codeigniter-restserver
教學影片:

星期五, 3月 15, 2013

[ASP] 把內文含有 http 或 ftp 的連結文字,直接加上 A 標籤

又一陣子沒有把 ASP 翻出來了,剛好有個需求是要將 WinForm 程式寫入的資料中,只要含有 http 或 ftp 的連結文字,在網頁上顯示時直接讓它變成可以點選。

這樣的功能看似簡單,但是做起來感覺有點麻煩,因為文字的內容得修改如下:

XXXXXXXX http://aaa.bbb.ccc/ddd/eee.zip XXXXXXXXXXXXXXXXXXXX,XXXXXXXXXXXXXXXXXXXX

XXXXXXXX  http://aaa.bbb.ccc/ddd/eee.zip
XXXXXXXXXXXXXXXXXXXX,XXXXXXXXXXXXXXXXXXXX不但找到的連結要多複製一份,還得把它包進 的標籤中;還好,這一陣子剛好在看正規表示法,找了一下 vbscript 裡正規表示法的使用方式後,就可以用比較優雅的方式把需要的功能做出來了,真棒!

程式碼如下:


Dim regEx, Match, Matches ' 建立變量。
Set regEx = New RegExp ' 建立正則表達式。
regEx.Pattern = "((h|f)[t]?tp:\/\/[^ ]+)" ' 設置模式。
regEx.IgnoreCase = True ' 設置是否區分字符大小寫。
regEx.Global = True ' 設置全局可用性。
ReplacedString = regEx.Replace(strng, "$1") ' 執行搜索。 



星期六, 5月 16, 2009

[Develop] 安裝 Visual Studio 2008 Sp1 失敗~~

要用到 jquery ,所以一定要裝上 vs.net 2008 sp1,不過,下載回來安裝後卻失敗,失敗訊息為



C:\Users\ADMINI~1\AppData\Local\Temp\1\Microsoft Visual Studio 2008 SP1\VC_IA64Runtime.exe - Exe installer's log file/hint (%temp%\dd_VC_IA64Runtime*.txt|%temp%\..\dd_VC_IA64Runtime*.txt) does not exist or is invalid


Exe (C:\Users\ADMINI~1\AppData\Local\Temp\1\Microsoft Visual Studio 2008 SP1\dotnetfx35langpack_x64zh-CHT.exe) failed with 0x80070643 - Fatal error during installation



看了一下才發現是 langpack 沒有安裝....

星期四, 3月 27, 2008

[Database] ADO Data Types與數據庫值對應


嘿!有這個對應表的話,用程式來建立資料表就方便多了。


由於用 asp + oldeb for foxpro,所以要參考 Oledb 的部分。


ADO Data Types與數據庫值對應 http://www.zaoxue.com/article/tech-48473.htm








































































































































DataType EnumValueAccessSQLServer
adBigInt20
BigInt (SQL Server 2000 +)
adBinary128
Binary
TimeStamp
adBoolean11YesNoBit
adChar129
Char
adCurrency6CurrencyMoney
SmallMoney
adDate7DateDateTime
adDBTimeStamp135DateTime (Access 97 (ODBC))DateTime
SmallDateTime
adDecimal14

adDouble5DoubleFloat
adGUID72ReplicationID (Access 97 (OLEDB)), (Access 2000 (OLEDB))UniqueIdentifier (SQL Server 7.0 +)
adIDispatch9

adInteger3AutoNumber
Integer
Long
Identity (SQL Server 6.5)
Int
adLongVarBinary205OLEObjectImage
adLongVarChar201Memo (Access 97)
Hyperlink (Access 97)
Text
adLongVarWChar203Memo (Access 2000 (OLEDB))
Hyperlink (Access 2000 (OLEDB))
NText (SQL Server 7.0 +)
adNumeric131Decimal (Access 2000 (OLEDB))Decimal
Numeric
adSingle4SingleReal
adSmallInt2IntegerSmallInt
adUnsignedTinyInt17ByteTinyInt
adVarBinary204ReplicationID (Access 97)VarBinary
adVarChar200Text (Access 97)VarChar
adVarWChar202Text (Access 2000 (OLEDB))NVarChar (SQL Server 7.0 +)

[DATABASE] 各種資料庫的欄位型態


下列的參考資料十分不錯,列出大部分用到的資料庫欄位型態,寫程式時還蠻有用的!


Databases - Field Types http://mc-computing.com/Databases/FieldTypes.html


ex:




Foxpro














































































TypeSizeDescription
Character1 to 254
Currency8 bytes18 significant figures, including 4 decimal places
Not available in Database Explorer
Date8 bytesJanuary 1st, 1 A.D to December 31st, 9999 A.D
DateTime8 bytes
Logical1 byte
Variant
Can hold any type of field
Double8 bytes+/-4.94065645841247E-324 to +/-8.9884656743115E307
13 significant figures
This range does not make sense
Numeric1 to 20 bytes- .9999999999E+19 to .9999999999E+20
up to 10 significant figures (specified by the user), same as Float
Float1 to 20 bytes- .9999999999E+19 to .9999999999E+20
up to 10 significant figures (specified by the user), same as Numeric
Integer4 bytes-2,147,483,647 to 2,147,483,647
Integer (Autoinc)4 bytesAutoincrement field
General4 bytes in tableReference to an OLE object
The type is OLE in Database Explorer
Memo4 bytes in tableValues may be modified depending on the language mapping
Database Explorer indicates that these are actually 10 bytes each
Memo (Binary)4 bytes in tableValues are not modified When the code page changes

星期三, 3月 26, 2008

[ADO] Foxpro


建立資料表(TABLE)
EX: Create Table test( id char(10), bookname character(100), number int)


刪除資料表
EX: DROP TABLE test


新增記錄
EX1: INSERT INTO test VALUES ('111', 'Life is Sad', 100)
EX2: INSERT INTO test (id, bookname, number) VALUES ('111', 'Life is Sad', 100)



  • foxpro 8.0 以後可以用 autoinc 型態來設定自動編號

  • oledb for vfp 支援 autoinc 語法,
    ex: Create Table test( id int primary key autoinc, bookname character(100), number int)

  • oledb for vfp 不支援 " CREATE DATABASE" 的語法


星期一, 3月 17, 2008

[HTML/CSS] 避免誤用不佳的 HTML標籤


開宗明義就講了,儘量用 CSS 來取代常用的HTML。
請詳讀 http://webdesign.about.com/od/css/a/aa101706.htm


How to Avoid Deprecated HTML


Use CSS Instead



When you're trying to write valid XHTML, you need to avoid the elements that have been deprecated. Using them will result in Web pages that may not work in a future version. This is because while the tag is still part of the XHTML specification, it may not be included in the future. And if it's not included, browsers won't support it.


Many deprecated XHTML elements were deprecated in favor of CSS style sheets. And it can be very easy to use CSS instead of many of these elements.


-------------------------------------------以下省略

星期五, 3月 14, 2008

[程式設計] 在文字方塊按下 Enter 後做動作


原本利用 Submit 按鈕時都沒有問題,不過,因為在表單送出前要先做檢查,所以把 submit 改成 button,這一來在文字方塊按 【Enter】就沒有作用了。


解決之道是利用 onKeyDown 這個事件來捕捉 【Enter】的 KeyCode,作法如下:
------------------------------------------------------------------------------------------
<script language=javascript>
function EnterToTab(){
if(event.keyCode==13)
event.keyCode=9;
}

</
script>
------------------------------------------------------------------------------------------
在文字方塊中加入 onkeydown="EnterToTab();" 的屬性,這樣一來就可以了。


不過,這時又會出現新的問題,在 firefox 無法捕捉到 Enter 的 KeyCode,原來兩者的捕捉 KeyCode 的屬性不一樣,完整解決方式如下:


------------------------------------------------------------------------------------------
function EnterToSubmit(e){

var keynum;
if(window.event) { // IE
keynum = e.keyCode;
}else if(e.which) { // Netscape/Firefox/Opera
keynum = e.which;
}
if(keynum == 13){
document.forms["formName"].submit();
}


}
------------------------------------------------------------------------------------------
onKeyDown="EnterToSubmit(event);"


星期三, 8月 15, 2007

[VS.NET] Visual Studio 2005 更新 sp1 失敗


之前好幾次更新 Visual Studio 2005(Express) Sp1 都以失敗告終,找又找不到原因,今天剛好心血來潮,再次求助孤狗大神,總算找到解答,原因竟是微軟本身安裝程式出問題。詳情可至下列網址閱讀:


http://support.microsoft.com/kb/925336/zh-tw


照你的環境下載 patch 檔,執行後重新開機,再來安裝 vs.net 2005 sp1 就會成功了。