2020年6月26日 星期五

Windows10下載語言Basic typing(基本鍵入)都會0x80240438的Error code

如果只需要在 英文版Windows安裝注音輸入法可以參考http://it.rex.tw/2020/07/windows.html

因為英文版Win10安裝繁體中文language pack之後還是無法使用注音輸入法
所以還是得安裝Basic typing(基本鍵入)
Windows10下載語言Basic typing都會0x80240438的Error code
不管是透過GUI介面
還是指令(DISM.exe /Online /Add-Capability /CapabilityName:Language.Basic~~~zh-TW~0.0.1.0)
錯誤畫面如下圖:


https://docs.microsoft.com/en-us/windows/deployment/update/fod-and-lang-packs
The Specify settings for optional component installation and component repair policy, located under Computer Configuration\Administrative Templates\System in the Group Policy Editor, can be used to specify alternate ways to acquire FOD packages, language packages, and content for corruption repair. However, it’s important to note this policy only allows specifying one alternate location and behaves differently across OS versions.

https://answers.microsoft.com/en-us/windows/forum/all/traditional-chinese-ime-is-not-ready-yet-on-win10/df59048c-34e5-4835-9e96-6c972a27c913
I'm in an enterprise, and I was able to resolve this once I stumbled upon this.
"For Windows domain environments running WSUS or SCCM, change the Specify settings for optional component installation and component repair policy to enable downloading FOD and language packs from Windows Update. This setting is located in Computer Configuration\Administrative Templates\System in the Group Policy Editor."
I created a test policy, with this setting enabled, and got everything to work on my test box.
Hope this can help someone.



原因可能是因為該電腦曾經加入過網域,機碼被改成向內部WSUS更新
所以要改成直接跟微軟Windows Update更新


2020年6月25日 星期四

國外買的Windows 10切換到注音輸入法出現“Traditional Chinese IME is not ready yet”

已經安裝繁體中文Language Pack,但切換到注音輸入法出現“Traditional Chinese IME is not ready yet”


https://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/problems-using-a-japanese-or-traditional-chinese/db5a0ddf-2c50-4f0d-a961-58902f40acda

  • For Traditional Chinese basic typing:
DISM.exe /Online /Add-Capability /CapabilityName:Language.Basic~~~zh-TW~0.0.1.0


如果只需要在 英文版Windows安裝注音輸入法可以參考http://it.rex.tw/2020/07/windows.html

ref:
http://www.infomate.tw/2020/01/windows10-traditional-chinese-ime-is.html

https://blog.dino9021.com/2017/02/windows-10.html
Add-WindowsCapability -Name "Language.Basic~~~zh-TW~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.Handwriting~~~zh-TW~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.OCR~~~zh-TW~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.Speech~~~zh-TW~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.TextToSpeech~~~zh-TW~0.0.1.0" -Online
Add-WindowsCapability -Name "Language.Fonts.Hant~~~und-HANT~0.0.1.0" -Online
Add-WindowsCapability -Name "International.Locale.Taiwan~~~zh-TW~0.0.1.0" -Online


 

2020年6月19日 星期五

Windows10英文版內網安裝繁體中文語系和介面

會有這個需求是因為內網電腦不能連Internet,國外只買的到英文版,但是公文和內部系統是中文,需要offline方式安裝中文Language Pack

參考這個網站作法
https://4sysops.com/archives/local-experience-packs-add-languages-to-windows-10-and-server-2019/
實測沒有LXP(LocalExperiencePack)也可以成功,不太清楚LXP的用途

安裝完Language Pack之後仍需要安裝Basic typing(基本鍵入)
請參考 http://it.rex.tw/2020/06/windows10basic-typing0x80240438error.html

(1)
到大量授權中心或是MSDN網站下載mu_windows_10_language_pack_version_1809之類的iso檔,如果是2004版的Win10請下載對應的2004版本


(2)
透過lpksetup安裝zh-TW的LanguagePack(Microsoft-Windows-Client-Language-Pack_x64_zh-tw.cab)



(3)
使用PowerShell執行以下指令
繁體中文版
Set-WinUILanguageOverride -Language zh-TW

英文版
Set-WinUILanguageOverride -Language en-US

簡體中文版
Set-WinUILanguageOverride -Language zh-CN

(4)
登出再登入Windows

備註:
不能是Single language edition的Windows 10

其他參考資料:
https://blog.miniasp.com/post/2018/10/03/PowerShell-Custom-Scripts-for-Azure-Windows-VM


https://docs.microsoft.com/zh-tw/windows-hardware/manufacture/desktop/add-language-packs-to-windows
Language Interface Packs (LIPs): Partially-localized language pack. Requires a base language pack. In Windows 10, version 1809, LIPs are delivered as Local Experience Packs (LXPs) .appx files,

2020年6月13日 星期六

免費用於開發測試用途的IBM MQ Advanced for Developers

https://developer.ibm.com/messaging/mq-downloads/

No cost non-production use downloads

MQ Advanced for Developers

版本功能比較:
https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.1.0/com.ibm.mq.pro.doc/q126140_.htm

2020年6月12日 星期五

移轉TIBCO MFT組態檔設定到新的伺服器

https://support.tibco.com/s/article/How-to-copy-TIBCO-MFT-Platform-Server-for-Windows-DNI-definitions-to-a-new-installation

Details
 Is there a way of exporting DNI Templates and Initiation Directories from one TIBCO MFT Platform Server for Windows machine and then importing them on another TIBCO MFT Platform Server for Windows machine?
Resolution
 The DNI Templates and Initiation Directories are stored in the ftmssvr.pqf file. To copy the DNI Templates and Initiation Directories between two machines, copy the ftmssvr.pqf file from the current machine and replace the same file on the new server. This file is located in the <MFTPS> directory (i.e. MFT Platform Server for Windows home directory). To replace the ftmssvr.pqf file, follow these steps:

- Stop the Platform Server for Windows service
- Rename the existing Platform Server for Windows ftmssvr.pqf file to ftmssvr.pqf.backup
- Copy ftmssvr.pqf file to the Platform Server directory
- Start the Platform Server service
- Check the Transfer Templates and the Initiation Directories on the Platform Server Administrator.


Note:

1.  This article does not apply to pDNI.

2. The copy of the ftmssvr.pqf file works very well as long as both servers have the same configuration (server name/file paths etc.) 
This is very useful if the new server is configured exactly like the parent (server name/file paths etc.).

3. If the server has a different configuration, copying to a new server configuration may require additional steps with regards to configuring the DNI templates. Most of the DNI transfer information will need to be changed.

2020年6月7日 星期日

wkhtmltopdf

https://wkhtmltopdf.org

SQL Server Trace Flag List

https://seniordba.wordpress.com/2015/12/09/sql-server-trace-flag-list-2330-update/

UNION和UNION ALL的差別,UNION會移除重複資料

UNION會移除重複資料
UNION ALL會保留重複資料


執行計畫:
UNION會先Concatenation 再Distinct Sort再輸出結果
UNION ALL只有Concatenation就輸出結果

GROUP BY會去掉重複的資料


2020年6月6日 星期六

T-SQL Querying: TOP and OFFSET-FETCH

https://www.microsoftpressstore.com/articles/article.aspx?p=2314819

OFFSET 25 ROWS

從第26筆資料開始(跳過前25筆)

 use Northwind
 GO

SELECT * FROM Orders
ORDER BY OrderID
OFFSET 25 ROWS

OFFSET 0 ROWS FETCH FIRST 25 ROWS ONLY

 use Northwind
 GO

SELECT * FROM Orders
ORDER BY OrderID
OFFSET 0 ROWS FETCH FIRST 25 ROWS ONLY


效果同
SELECT TOP(25) * FROM Orders
ORDER BY OrderID

差別:
TOP不是ANSI SQL,但是TOP還可以搭配PERCENT和WITH TIES很方便
OFFSET是 ANSI SQL

OFFSET 50 ROWS FETCH NEXT 25 ROWS ONLY

找出51筆到75筆的資料
通常用在分頁
要加ORDER BY

 use Northwind
 GO

SELECT * FROM Orders
ORDER BY OrderID
OFFSET 50 ROWS FETCH NEXT 25 ROWS ONLY



分頁效果(每頁25筆,顯示第2頁的資料)
DECLARE @pagesize AS BIGINT = 25, @pagenum AS BIGINT = 2;
SELECT *
FROM Orders
ORDER BY OrderID DESC
OFFSET (@pagenum - 1) * @pagesize ROWS FETCH NEXT @pagesize ROWS ONLY;

(重要)使用WITH TIES語法找出成績排名前8名的學生,因為平分,得到9筆資料

SELECT TOP 8 WITH TIES * FROM students ORDER BY score DESC

因為需求是排名前8名
如果用沒加WITH TIES只會有8筆,導致資料不正確

REF:
https://blog.csdn.net/whaxrl/article/details/51218230

order by (select null)

https://stackoverflow.com/questions/10066819/what-does-order-by-select-null-mean


T-SQL Querying: TOP and OFFSET-FETCH
https://www.microsoftpressstore.com/articles/article.aspx?p=2314819

ORDER BY要搭配indexes使用

資料量大,有index時SQL Server就不用真的去Sort資料
效能會比較好

SELECT TOP (1) PERCENT

SELECT TOP (1) PERCENT *
FROM Orders
ORDER BY orderdate DESC;

取出前1%的資料

ORDER BY NULLS FIRST、ORDER BY NULLS LAST

原來Oracle有這種語法,SQL Server沒有這語法
https://www.oracletutorial.com/oracle-basics/oracle-order-by/

而且是ANSI SQL:2003語法
https://en.wikipedia.org/wiki/Order_by

TSQL個別取得年月日

SELECT YEAR(GETDATE()) , MONTH(GETDATE()) ,DAY(GETDATE())

CONVERT(nvarchar(30), GETDATE(), 126) AS UsingConvertTo_ISO8601

https://docs.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?redirectedfrom=MSDN&view=sql-server-ver15#g-using-cast-and-convert-with-datetime-data

找出開頭不是數字的資料

開頭不是數字的資料
SELECT * FROM Table_1 WHERE T1 LIKE '[^0-9]%' 

開頭數字的資料
SELECT * FROM Table_1 WHERE T1 LIKE '[0-9]%'

找出開頭第二個字是D的資料 LIKE '_D%'

SELECT * FROM Table_1 WHERE T1 LIKE '_D%'

找出開頭第二個字是D的資料

TRY_CAST

SELECT * FROM  Table_1 WHERE  TRY_CAST(T1 AS INT) > 10
=>可以得到結果

SELECT * FROM  Table_1 WHERE  CAST(T1 AS INT) > 10
=>將 varchar 值 'A         ' 轉換成資料類型 int 時,轉換失敗。