2014年11月11日 星期二

VMWare Player:The default sound device cannot be opened:

如果VMWare player啟動linux時出現:
The default sound device cannot be opened:
A device ID has been used that is out of range for your system.
Sound will be disconnected

 這個可能是使用"瑞昱高傳真音效"卡,設定上的問題,
 我把"音效裝置連接設定",改成"AC97前置面板"(原本是HD Audio前置面板)
 就可以在VMWare Player下的Fedora 20聽到聲音了。

 或者參考以下的改法:
https://communities.vmware.com/thread/406063
If you have RealTek speakers, look within the RealTek HD Audio Manager.  Select the yellow folder near the analog panel, and make sure "Disable front panel jack detection" is selected.  This fixed the problem for me.

Apparently RealTeks detection blocks the linux virtual machine from accessing the resource, and causes the error.

2014年3月4日 星期二

直角三角形一定有一邊長是無理數,要不然有一角度是無理數

高中時,猜想的:
直角三角形一定有一邊長是無理數,要不然必有一角度是無理數。

我不會證,但由泰勒展開式,似乎可推得此結果。
不曉得是不是這樣?有沒有人證過?

2013年12月21日 星期六

寫給超新手瑪莉歐類型遊戲製作的小技巧

瑪莉歐類型遊戲製作,
對於關卡地圖,
一開始我以為是用一個raw data,
例如用0x00代表背景,0x01代表磚塊,0x02代表金幣…等,
但是這樣在製作關卡地圖,就沒有視覺化。
今天,我看過一個open source python寫的瑪莉歐程式碼,
發現有一個辦法可以使瑪莉歐遊戲關卡稍微視覺化,
就是用一個圖檔,例如*.png檔裡的顏色,來對應到關卡,
如用黃色代表磚塊,金色代表金幣…等。
為了製作方便,可以讓遊戲主程式直接用顏色判斷,
來形成關卡。若是打算要正式商業化發行,
可以寫一個*.png轉raw data的小程式,
讓遊戲主程式來讀raw data,而不用包入*.png。

 

2013年12月9日 星期一

線上嘸蝦米

此軟體原本的出處是「蝦米族樂園」,是由一群愛好嘸蝦米輸入法的使用者,共同創造出來的。真的非常實用,所以在行易與蝦米族樂園共同合作之下,在官方網站,也提供了這樣的功能。

2013年11月27日 星期三

Windows 2008 R2 boot問題的修復(轉貼)

  1. Put the Windows Server 2008 R2 installation disc in the disc drive, and then start the computer.
  2. Press any key when the message indicating “Press any key to boot from CD or DVD …”. appears.
  3. Select a language, time, currency, and a keyboard or another input method. Then click Next.
  4. Click Repair your computer.
  5. Click the operating system that you want to repair, and then click Next.
  6. In the System Recovery Options dialog box, click Command Prompt.
  7. Type Bootrec /RebuildBcd, and then press ENTER

2013年8月24日 星期六

Python: operator priority for ==, in

提供一個Python超新手的錯誤,注意以下程式碼:
>>> b = [1, 2]
>>> False == 3 in b
False

如要得到True,請改成:
>>> False == (3 in b)
True

2013年5月11日 星期六

vector string example

    string S[3]={"xxo", "oox", "o"};
    string T[4]={"x", "o", "x", "o"};
    string U[3]={"ooo", "xxxoo", "oxx"};
    vector vs(S, S+3);
    vector vt(T, T+4);
    vector vu(U, U+3);
    //FloodFill3D F;
    //cout<

Lean 4 極簡教學 (Using VS Code on macOS)

 1. Install Lean Environment: https://lean-lang.org/install/ 試著完Step one, two, three 2. 在VS code下,建一新的project: 取名Hello_World 3. 嘗試執行Main.lea...