Monday, December 19, 2022

Lyrics about destiny , karma and sin .陳健安 On Chan - 《在錯誤的宇宙尋找愛》

意外聽到一首2019的歌,看了MV和歌詞,就喜歡上了。 
這種帶點宗教宿命色彩的詞總是很吸引我。
超脫得很浪漫。

詞: 黃偉文 曲: 馮穎琪

編/:謝國維 意識一早超脫 情愛這東西 越過了天地 並未眷戀螻蟻 沒有光陰跟遠近 我是叢電波 破天際 但你的召喚 讓我將功德放低 為你呱呱出世 回到這身體 自降四千等 為覓人類一吻 作謝禮 誰話愛戀 苦海濟世 會創造奇蹟 將蒼生撫慰 被你吸引 讓我當初失智慧 這宇宙 這種深情根本虛構 失了足 才會跌落你的地球 目光遠大如我 你有限維度裡 看春秋 很後悔 但愛死方會得救 為了找到真愛 尋遍每粒沙 住進你的家 就為明白這叫 錯誤嗎 求做對簡單的愛侶 與你歷其境 方知多可怕 沒法擺脫 俗套的分手戲碼 這宇宙 這種深情根本虛構 失了足 才會跌落你的地球 上天已難回去 我似被囚在你 那春秋 不恨你 恨我太晚參透 親手作孽 惡果他人怎可解救 貪怨癡 要葬在你的地球 為了擁抱你 換這雙手 一早已 被切去兩翼 禁飛走 這樣勇 試問你可能夠 自絕位列仙班 都不算太內疚 但愛到欠自我 我笑我下流 這宇宙 這種深情根本虛構 失了足 才會跌入你的溫柔 在你的結界 盪過韆鞦 我便無力 再看北斗 不恨你 恨我的反抗不夠 我的愛全被接收 必須再重頭禪修 練到清心寡愛 無懼色誘

Tuesday, December 6, 2022

MySQL database : Double type Numeric value out of range issue

 That was a really silly mistake I made due to not reading the manual ...


I want to save numeric value with 1 decimal point . i.e. : 2.0 , 1.5 , 1.0 , 0.5 and 0.0 .

The datatype was set as double (1,1) . After test, I found out that I never able to save value bigger than or equal to 1.0  . The maximum number I saved with options (2.0 , 1.5 , 1.0 , 0.5 , 0.0) is 0.5
instead of 2.0 .

I checked through the program codes and try to figure out the error in calculation related functions.


However the answer is about the database datatype. 

Double (1,1) in MySQL never able to save number bigger than or equal to 1. 

This setting doesn't mean 1number and 1 decimal point. It means the entire number has 1 digit ONLY.

Quoted from official document as below : 

DOUBLE[(M,D)]

Here, (M,D) means that values can be stored with up to M digits in total, of which 

D digits may be after the decimal point

Double (1,1) means totally ONE digit , and ONE digit follows decimal point. The only digit is assigned decimal part , so I never able to save value before decimal point.

After I set datatype to Double (2,1) , issue resolved. 


Just a diary to remind myself to read manual .




Quoted from official : 

As of MySQL 8.0.17, the nonstandard FLOAT(M,D) and DOUBLE(M,D) syntax is deprecated and you should expect support for it to be removed in a future version of MySQL.

Tuesday, November 29, 2022

The most romantic poem i have heard 偽十四行詩 葉青

 偽十四行詩

第一行不能出現「我愛你」否則接下來的十三行全都是廢話了

第二行是 你怎麼能這麼遠 而世界很近 世界對我是無可 對你是奈何

第三行應該轉折所以我不要愛你好了 這樣你將獲得平靜與安全

第四行用來交代原因 其實 我不知道這一切是怎麼變成這樣子的

第五行我總是正在想你 這個你 那個你 都在那些從前裡

第六行想到從前 痛了 所以沒有字

第七行剛好寫到一半了 我們之間 你卻什麼都不打算寫下

第八行你知道你有光嗎 每次你在我面前我很難好好直視 你的眼睛

第九行確實很久了啊 這些年來我喝的酒常常與你無關 現在不喝了 喝酒缺乏意義

第十行讓我抽兩根菸再寫 在你身邊抽過菸的結果是 一抽起菸 你像是就在這裡

第十一行寫起來有兩個一 我們 可不可以 是兩個一 什麼時候變成二 由你決定

第十二行我想放棄一切 或是放棄你 哪一個比較容易 你會允許什麼 當我懇求

第十三行留白 因為我想再多想你一遍 仔仔細細地想

第十四行我不打算結束你 你已經結束我 這最後的一行 是對於結束的 無效抵抗

第十五行 十四行詩 絕對不可以有第十五行 正如我絕對不能 愛你


-----------------------------------------------------------------------------------------------------

作者葉青的詩全都很浪漫優美,正如她所說,她的詩刪去贅詞只剩三個字:「我愛你」。

  

Sunday, September 11, 2022

LONG LIVE

  But life of course consists of final partings as well as first meetings

Goodbye our Queen.



Tuesday, August 9, 2022

隨意歌詞翻譯 Chinese Lyrics translation - 說說話 Say Something 王靖雯

 說說話


作詞:王靖雯
作曲:王靖雯


你在哪啊
Where are you
還是老樣子嗎
Are you still look the same 
脾氣還是那麼差
Bad temper as always 
上班會遲到嗎
Late for work
飯有按時吃嗎
Have you ate on time
是不是還那麼晚回家
Back home late as always

你在幹嘛
What are you doing now
會偶爾想想我嗎
Will you think of me
我只是想和你說說話
I just want to say something with you


我最近過得還好啊
I live as good and
我這裡飄起了雪花
There is snowing 
可我找不到你 我好想你
And I can't reach you , I am thinking of you
我沒有辦法
I can do nothing however

我們 也曾是對方唯一的希望
We are the only hope of each other in past
現在 誰又代替我出場
I was replaced by someone now 
我總讓你失望
I always let you down
夜還如此漫長
This night is long still
我不奢望 只想看看你模樣
I just want to see you again and not looking for anything

你在幹嘛
What are you doing now
會偶爾想想我嗎
Will you think of me
我只是想和你說說話
I just want to say something with you
我最近過得還好啊
I live as good and
我這裡飄起了雪花
There is snowing 
可我找不到你 我好想你
And I can't reach you , I am thinking of you
我沒有辦法
I can do nothing however

我們 也曾是對方唯一的希望
We are the only hope of each other in past
現在 誰又代替我出場
I was replaced by someone now 
我總讓你失望
I always let you down
夜還如此漫長
This night is long still
我不奢望 只想看看你模樣
I just want to see you again and not looking for anything

我不再是你生命的一束光
I am not the light of you anymore
你會 靠在 另一個肩膀
You will lean on the shoulder of other
就這樣散了場
Everything dismissed 
就算夜再漫長
Night is long and dark
別回頭望 請忘了我模樣
Do not look back for me however 

就這樣散了場
It just ended like that
就算人來人往
People come and go
可那幾年 只有你為我鼓掌
in past you are the only one who appreciate me 
你在哪啊
Where are you now however

Wednesday, June 22, 2022

The NVL Maker (KiriKiri 吉里吉里2) : Particle.dll 粒子特效插件使用 為遊戲加入各種火光動畫效果

在日文網站發現一個在吉里吉里2做動畫特效的插件( Particle.dll ),可製作各種火光雷電特炫目效果。特意嘗試能否使用在The Nvl Maker繁體版中,實測完全可行。

只需要解決兩件事。

—下載那個插件(廢話。。。)

—解決範例文本字元編碼問題 (可使用免費的Notepad++)


詳細步驟如下 : 

1。下載並解壓 particle.zip

2。把scenario Folder內的文檔轉成UTF-16 LE BOM 編碼。(用Notepad++即可)

3。把image , others 內的檔案複製一份到NVL maker 專案(project)內Data Folder的
同名Folder 中。

4。把particle.dll 複製到NVL maker 專案(project)內plugin Folder中。

5。修改NVL maker 專案(Project)內Data Folder的startup.tjs,加上以下這句,去連結插件。

Plugins.link("plugin/particle.dll"); 
6。將步驟2改好編碼的first.ks改名為prelogue.ks,與particle.ks一同放到NVL maker 專案(project)內Data的scenario Folder 中。
(取代原有prelogue.ks前,請先備份原來的prelogue.ks)

7。啟動krkr.exe,在標題畫面按Start (或開始遊戲),直接看效果。

8。看完後可將prelogue.ks還原成原本檔案。 


日文網上還有其他附件圖片和定義asd可使用,都是很PRO的效果,可慢慢發掘。

作者也創作了個工具去寫效果定義檔,可課5000支持一下。



Wednesday, June 15, 2022

PowerShell Script : Convert UTF-8 text file into UTF-16 Unicode encoding file , salesforce dataloader export csv to UTF-16 Unicode SFDC 原生編碼字元轉換補遺

The native dataloader from Salesforce only export .csv file in UTF-8 encoding . And it is asked to exchange information with Therefore™ information management application which uses UTF-16 encoding data .

The pros and cons of UTF-8 and UTF-16 (Unicode) encoding can be found in here.
Storage and indexing speed etc. matters. 

The most easy way to do this is using powershell script to encode the .csv from Salesforce dataloader export to Unicode in mainly one line .PS script. Schedule this script into window task scheduler , done.

  

Get-content -encoding UTF8 $filename | Set-Content -encoding Unicode "$new_filename"

Script below shows how to convert multiple UTF-8 files in folder into UTF-16 files with error log tracking. 

Both UTF-8 and UTF-16 files will be available in the folder after conversion.
UTF-8 abc.csv will be cloned , and a UTF-16 abc_utf16.csv will be created in the same folder.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#Continue conversion even if one file failed , just log down the error.
$ErrorActionPreference="SilentlyContinue"
Stop-Transcript | out-null
$ErrorActionPreference = "Continue"
#-path of the log file
Start-Transcript -path "C:\ABCProject\log\utfLog.txt" -append
try {
#double bracket for path with space
#get all csv files inside that folder
get-childitem "C:\ABCProject\write\*.csv" | 

  foreach-object { 
    $name = $_.FullName;
    write-host "The file name" $name;
    $fname = $name.replace(".csv","_utf16.csv");
    write-host "The new file" $fname;
    get-content -encoding UTF8 $name  | Set-Content  -encoding Unicode  "$fname" 
}
 Stop-Transcript
 exit
}
catch {
  #log -message "Get-WmiObject cmdlet failed" -type "Error"
  write-host "Error found " $_.Exception.Message.ToString() -type "Error"

}

Migrating from Renpy to Godot

 Due to the limitation of renpy in rendering dynamic screen ,  due the the black border it gives in different UI scale resolution , finally ...