2009年3月19日 星期四

輸入法由注音改為倉頡先出來

輸入法由注音改為倉頡先出來





緣起:
我是一個倉頡打字的人,或許你也跟我一樣偶而會有拆不出字碼,只好改注音輸入,然後,眼,盯著鍵盤、口中不斷的發著要拆的字音,最後,好不容易打出要拆的注音符號。這是時而發生的事,所以,我們也會增加一個「注音」輸入法,但,問題來了,「注音」每次都在我「英數」和「倉頡」輸入法中間擋住,就一定還要再切換一下才會跳到我可愛的「倉頡」輸入法上來。天呀!!死微軟幾時才能讓Windows可以聰明一點,我要「倉頡」先出來啦!! >"< 遍巡google都找不到可以解決我問題的方法,最後,也不可考了,下列是我目剈前找到可以改善我問題的解決方法。直接改 regedit 系統設定,總算ok了。在這分享給跟我有一樣困擾的人。 ^^

多年後的發現:
機碼路徑:
HKEY_USERS\S-1-5-21-1547161642-412668190-1801674531-500\Keyboard Layout\Preload
設定的資料調整一下也許可以令人滿意!!(調好記得要重開機一下)





Windows98 登錄編輯器

機碼名稱:
HKEY_LOCAL_MACHINE\
System\
CurrentControlSet\
Control\
Keyboard Layouts\
E0010404
==>E0010404
名稱 資料
-------------------------------------
IME file PHON.IME
layout file kbdus.kbd
layout text 注音

==>E0020404
名稱 資料
-------------------------------------
IME file CHAJEI.IME
layout file kbdus.kbd
layout text 倉頡


將上列的 E0010404 和 E0020404 內的資料互換;
重開機後 倉頡輸入法 將在 注音輸入法 之前

==============================================
WinXP SP3 20090127
==============================================
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Keyboard Layouts\
==>E0010404
名稱 資料
-------------------------------------
IME file phon.ime
Layout Display Name @%SystemRoot%\system32\input.dll,-5066
layout file KBDUS.DLL
layout text 中文 (繁體) - 注音

==>E0020404
名稱 資料
-------------------------------------
IME file chajei.ime
Layout Display Name @%SystemRoot%\system32\input.dll,-5067
layout file KBDUS.DLL
layout text 中文 (繁體) - 倉頡

將上列的 E0010404 和 E0020404 內的資料互換;
重開機後 倉頡輸入法 將在 注音輸入法 之前

2009年3月18日 星期三

MS SQL 資料表迴圈範例

print '資料表迴圈處理'

--產生暫存資料表 #score
if exists(select * from tempdb.dbo.sysobjects where id = object_id('tempdb.dbo.#score') )
drop table #score

create table #score (
sno varchar(10), --學號
class varchar(10), --科目
num int --分數
)
insert into #score
select '001', '國', 80
union select '001', '英', 90
union select '001', '數', 55
union select '002', '國', 50
union select '002', '英', 60
union select '002', '數', 75
union select '003', '英', 98
union select '003', '數', 59
union select '004', '國', 88
union select '004', '英', 98
union select '005', '國', 58
union select '005', '數', 69
union select '006', '國', 78
union select '006', '英', 84
union select '006', '數', 59

--select * from #score

print '資料表迴圈處理顯示'
DECLARE score_cursor CURSOR
FOR
SELECT distinct sno, class, num
FROM #score
order by sno, class

OPEN score_cursor
DECLARE @sno varchar(10) -- 學號變數
DECLARE @class varchar(10) -- 科目
DECLARE @num int -- 分數

FETCH NEXT FROM score_cursor INTO @sno, @class, @num
WHILE (@@FETCH_STATUS <> -1)
BEGIN
IF (@@FETCH_STATUS <> -2)
BEGIN
PRINT @sno+','+@class+','+convert(varchar(10),@num)
END
FETCH NEXT FROM score_cursor INTO @sno, @class, @num
END
CLOSE score_cursor
DEALLOCATE score_cursor