2013年7月15日 星期一

firefox media player 播放音樂不能播放

更新完了 firefox 21 後,發現以前上的網站用 media player 播放音樂不能播放了,重新安裝 firefox 和 media player 插件都不能解決,問題找錯方向了。
原來問題是 firefox 21 更新後,設定預設不同了,關閉一個設定。如何設定看下面
首先在 firefox 的地址欄上輸入 about:config , 按 enter 進入,會有警告字句提醒小心修改設定可能引起 firefox 不穩定,按確定進入下圖,

  1. 地址欄上輸入 about:config
  2. 在 search 欄輸入 plugins.load_appdir_plugins
  3. 在 Preference Name 就會看這個項目,雙擊 value 改成 true
修改後,關閉 firefox 重開就行了。

2013年7月14日 星期日

C# 操作、型式和變數:Operators, Types, and Variables


 C#中,一定要宣告變數的型態!
Example 1: Boolean
using System;

class
Booleans
{
    public static void Main()
    {
        bool content = true;
        bool noContent = false;

        Console.WriteLine("It is {0} that C# Station provides C# programming language content.", content);
        Console.WriteLine("The statement above is not {0}.", noContent);
    }
}
 
 Example 2:
using System;

class Unary
{
    public static void Main()
    {
        int unary = 0;
        int preIncrement;
        int preDecrement;
        int postIncrement;
        int postDecrement;
        int positive;
        int negative;
        sbyte bitNot;
        bool logNot;

        preIncrement = ++unary; // unary+1
後印出
        Console.WriteLine("pre-Increment: {0}", preIncrement); //
印出1unary = 1

        preDecrement = --unary; // unary-1
後印出
        Console.WriteLine("pre-Decrement: {0}", preDecrement); // 印出0unary = 0
        postDecrement = unary--; // unary
後印出-1
          Console.WriteLine("Post-Decrement: {0}", postDecrement); //印出0 unary = -1
        postIncrement = unary++; // unary
後印出+1
          Console.WriteLine("Post-Increment: {0}", postIncrement); //印出-1 unary = 0
        Console.WriteLine("Final Value of Unary: {0}", unary);

        positive = -postIncrement;
        Console.WriteLine("Positive: {0}", positive);

        negative = +postIncrement;
        Console.WriteLine("Negative: {0}", negative);

        bitNot = 0;
        bitNot = (sbyte)(~bitNot);
        Console.WriteLine("Bitwise Not: {0}", bitNot);

        logNot = false;
        logNot = !logNot;
        Console.WriteLine("Logical Not: {0}", logNot);
    }
}
Example 3: Array
 using System;

class Array
{
    public static void Main()
    {
        int[] myInts = { 5, 10, 15 }; //
向量myInts,由int[]接起來為整數!
        bool[][] myBools = new bool[2][]; //
jagged array,向量裡的一個向量(an array of arrays)。很像MATLAB裡的cell
        // 產生三個向量在myInts裡
        myBools[0] = new bool[2]; // 初始化(new),產生boolean值,有2個元素
        myBools[1] = new bool[1]; 
// 初始化(new),產生boolean值,有1個元素
        double[,] myDoubles = new double[2, 2];
        string[] myStrings = new string[3];

        Console.WriteLine("myInts[0]: {0}, myInts[1]: {1}, myInts[2]: {2}", myInts[0], myInts[1], myInts[2]);

        myBools[0][0] = true; //
myBools[0]有2個元素,其元素再加用一個[]來指定!
          myBools[0][1] = false;
        myBools[1][0] = true;
        Console.WriteLine("myBools[0][0]: {0}, myBools[1][0]: {1}", myBools[0][0], myBools[1][0]);

        myDoubles[0, 0] = 3.147;
        myDoubles[0, 1] = 7.157;
        myDoubles[1, 1] = 2.117;
        myDoubles[1, 0] = 56.00138917;
        Console.WriteLine("myDoubles[0, 0]: {0}, myDoubles[1, 0]: {1}", myDoubles[0, 0], myDoubles[1, 0]);

        myStrings[0] = "Joe";
        myStrings[1] = "Matt";
        myStrings[2] = "Robert";
        Console.WriteLine("myStrings[0]: {0}, myStrings[1]: {1}, myStrings[2]: {2}", myStrings[0], myStrings[1], myStrings[2]);

    }
}
And here's the output:
myInts[0]: 5, myInts[1]: 10, myInts[2]: 15
myBools[0][0]: true, myBools[1][0]: true
myDoubles[0, 0]: 3.147, myDoubles[1, 0]: 56.00138917
myStrings[0]: Joe, myStrings[1]: Matt, myStrings[2]: Robert


2013年7月13日 星期六

開始幹C# (Getting Started with C#)

C# 分大小寫 (case-sensitive)
 註解  /* ... */

Example 1:

using
System; // 查考System空間,所以我們可以用這空間裡的很多種code (referencing the System namespace )
 

 class Welcome // class可包有data和method來執行;complie完後會有個叫Welcome.exe的檔案
{
    // Main begins program execution.// 方法 method     
    static void Main()  
   // 程式最一開始進入的地方(entry point);Main是保留字;static表示這method只能在這class用!
  // 每個method都有傳回值(return),這邊是void,表示不傳回東西。
    {
        // Write to console
        Console.WriteLine("Welcome to the C# Station Tutorial!"); 
      //  Console是System空間裡的一種class,WriteLine是Console裡的一種method。
     // 如果不用using System,那就必須寫System.Console.WriteLine(...)     
   }
}


 class和method都用{ (left curly brace)和 } (right curly brace)包起來。

Example 2: 輸入command在console裡面

// Namespace Declaration
using
System;

// Program start class
class NamedWelcome
{
    // Main begins program execution.
    static void Main(string[] args) // args是丟進來的東西;string[]指接進來的東西是字串型式。
    {
        // 假如在console輸入 NamedWelcome PK,則args[0]接受了字串PK,前面的{0}代表接受了第0個字串,
       // PK取代了{0}
          Console.WriteLine("Hello, {0}!", args[0]);
        Console.WriteLine("Welcome to the C# Station Tutorial!"); 

       Console.ReadKey(); // 把console停住,不自動關掉。
    }
}


Example 3: 使用者輸入

// Namespace Declaration
using System;

// Program start class
class InteractiveWelcome
{
    // Main begins program execution.
    public static void Main() //加了public,這個class以外的class都可以叫這個method!
   // 預設是private,就是在這個class裡才能被使用!
    {
        // 用Write代表寫到console上,並停留在這一行。
        // 用WriteLine代表寫到console上,並跳到下一行。
        Console.Write("What is your name?: ");
        Console.Write("Hello, {0}! ", Console.ReadLine()); // 等使用者輸入和按Enter!


// 上面也可寫成
//string name = Console.ReadLine();
//Console.Write("Hello, {0}! ", name);

 
            }
}



2012年10月1日 星期一

台語之感慨

其實應該嘛要來定定打一寡仔台語文章,
乾焦會曉講是無夠的。
對親像人香港毋止講爾,擱會曉寫(雖然寫的嘛毋是正確的字),
上重要的是因朋友之間攏會曉用,用來開講。
對台灣大部份的人來講,遮嘛無法度的代誌,
誰叫人的教育自細漢就是學國語的,
台語其實定定卻予當做一種土話按呢對待,
毋關是毋是刁工的,尤其是查某朋友。
我的母語是台語,國語是我去學校才學的,
自細漢我就捌感覺奇怪,是按那學校學的佮厝裡講的攏無仝?
其實我讀國中的時陣,我嘛捌看袂起台語,
感覺彼是一種足倯的話(我嘛捌卻予台灣的"國民教育"洗過腦!)。
這馬我會因為會曉講在地的台語來驕傲,
用台語佮爸母、朋友講是予我感覺上親切的。
我毋是講國語就按那,逐家攏是語言,無應該啥卻予啥看袂起,
我只是無佮意台灣社會的這種氣氛,
教台語看作一種無水準的話!
可惜的是,我無看好後擺台語的未來,
我感覺伊會慢慢無去,因為這馬的少年查某攏無佮意講啊,
自然的,因的囝仔對無可能會擱講,
身為母語的一種,上自然的就是對家己的母親遮學。
希望會曉講台語的朋友,鬥陣來支持家己的母語,袂予伊無去。

2009年9月23日 星期三

門關住了心

想無事一身輕,也想心中空盪盪的。
牽掛著它,有時候讓人難受。
是不想想的,但是它很調皮,敲敲我的頭,讓我心神不寧。
說想忘了,卻是這麼困難。
想看一看,幻想著能不期而遇,仍舊撲了空。
拖著疲累的身軀,漫無目的地走著,聽著車馬暄囂,看著矇矓的星空,想著頑皮的笑容。
是否能靜靜躺在草地上,牽著手,分享妳和我的快樂,這是我想要的世界。

2009年9月14日 星期一

教我如何不想她

教我如何不想她 (劉半農, 1926)

天上飄著些微雲,地上吹著些微風。
啊─! 微風吹動了我頭髮,教我如何不想她!
月光戀愛著海洋,海洋戀愛著月光。
啊─! 這般蜜也似的銀夜,教我如何不想她!
水面落花慢慢流,水底魚兒慢慢游。
啊─! 燕子,你說些什麼話?教我如何不想她!
枯樹在冷風裡搖,野火在暮色中燒。
啊─! 西天還有些兒殘霞,教我如何不想她!

2009年8月29日 星期六

4314

住了一年半的寢室,終於要跟它說byebye了。
每天進出都是那麼地理所當然,明天後就只能出不能進了。
當初半年來回中正,最討厭的就是下雨的時候~
還要穿雨衣,忍受風雨的吹打,感覺就像落水雞一般。
雖然寢室沒很乾淨(因為我都懶得打掃,只能靠室友。哈哈)
有個缺點是夏天超熱,熱到爆炸!
有個優點就是我可以一下完課就回去休息,不用趴在lab睡覺。
有個優點就是我可以騎著腳踏車,優閒地騎到體育館打球。
有個大優點就是可以快速地和大家出去玩,
也不是說我在家就出不來,只是還要跑中正很麻煩,哈。
唯一在寢室遇到的怪事,就只有半夜爬起來去跟室友問"你是誰"(台語)?
然後嚇到室友不敢動。哈哈。
不過,住寢室讓我越來越宅...
總有人看到我就會說 "咦?宅男出來行動了啊!!!!"