2019年12月17日 星期二

vscode 讀 *.cshtml - 只能跳 key word, 不能用 chrome run

//============================== VSCode Browser Sync ==============================//
"browserSync.config": {
"browser": [
"chrome",
],
"files": [
"*.html",
"*.cshtml",
"*.log",
"*.php",
"/css/*.css",
"/js/*.js"
],
"codeSync": true
},
//==========================================================//
"emmet.includeLanguages":{
"cshtml":"html"
}
}

2019年12月1日 星期日

重構 wda

statement for BigCo
Hamlet: $650.00(55 seats)
As You Like It: $580.00(35 seats)
Othello:$500.00(40 seats)
Amount wned is $o1,730.00
You arned 47 credits



function statement (invoice,plays){
let totalAmount = 0;
let volume Credits = 0;
let result = '$tatement for ${invoice.customer}\n';
const format = new Intl.NumberFormat("en-US",{style:"currency", currency:"USD", minimumFractionDigits:2}).format;
for (let erf of invoice.pperformaces){
const play =play[perf.playID];
let thisAmount=0;
switch (play.type){
case "tragedy":
thisAmount = 40000;
if (perf.audience>30{ thisAmount+=1000*(perf.audience-30);}
break;
case"comedy":
thisAmount =30000;
if (

function statement (invoice,plays){ let totalAmount = 0; let volume Credits = 0; let result = '$tatement for ${invoice.customer}\n'; const format = new Intl.NumberFormat("en-US",{style:"currency", currency:"USD", minimumFractionDigits:2}).format; for (let erf of invoice.pperformaces){ const play =play[perf.playID]; let thisAmount=0; switch (play.type){ case "tragedy": thisAmount = 40000; if (perf.audience>30{ thisAmount+=1000*(perf.audience-30);} break; case"comedy": thisAmount =30000; if (perf.audience>20){ thisAmount +=10000+500*(perf.audience-20); } thisAmount +=300*perf.audience; break; default:

2019年11月26日 星期二

Virtualbox_setting (如何裝 VM)

D:\Portable-VirtualBox\data\.VirtualBox\Machines


Key Word: Virtual Box Protoable

http://www.vbox.me/

Installation instructions
1. Download and run Portable-VirtualBox_v5.1.22-Starter_v6.4.10-Win_all.exe.
2. Choose a folder to extract to.  (ex: V:\)
3. 先到資料夾 V:\Protable-VirtualBox\data\language
   將 chinese.ini 另存新檔 taiwan.ini 後,利用 word 讀檔後翻譯成繁體,複製完整內容,貼回 taiwan.ini。
4. 打開資料夾 V:\Protable-VirtualBox\data\settings\vboxinstall.ini, 修改要下載的檔案。
   [download]
   key1=http://download.virtualbox.org/virtualbox/6.0.12/VirtualBox-6.0.12-133076-Win.exe
   key2=http://download.virtualbox.org/virtualbox/6.0.12/Oracle_VM_VirtualBox_Extension_Pack-6.0.12-133076.vbox-extpack
 

   PS: 參考網站提供內容: http://download.virtualbox.org/virtualbox  , 可下載其他版本。
   例如:
   [download]
   key1=http://download.virtualbox.org/virtualbox/6.0.8/VirtualBox-6.0.8-130520-Win.exe
   key2=http://download.virtualbox.org/virtualbox/6.0.8/Oracle_VM_VirtualBox_Extension_Pack-6.0.8-130520.vbox-extpack
 
5. Go to the folder(Portable-VirtualBox) and run Portable-VirtualBox.exe. You’ll see a window like the one below:
   (1)Please select your language   => taiwan  => 按下 OK
      透過 Search 找到 taiwan.ini

   (2)選擇要下載 32位元或64位元版本
   (3)勾選,檔提取或壓縮完畢後運行 portable-VirtualBox
   (4)按下 "下載 VirtualBox的安裝檔"
      開始下載,下載完後, 按下確定,開始拷貝資料到 V:\Portable-VirtualBox\app32 與 V:\Portable-VirtualBox\app64

 
6. 啟動若出現:
   無法獲取 VirtualBox COM 物件。
   應用程式現在將終止時:


   把所有 V:\Portable-VirtualBox\app64\drivers 的驅動程式 (*.inf) 都執行安裝一次.
 
7. 啟動後修改路徑:
   喜好設定  -> 一般 -> 預設機器資料夾: V:\Portable-VirtualBox\data\.VirtualBox\Virtual Machine
 

8. 網路連線
   step1: 進到網路連線,滑鼠右鍵點選「區域連線」,再點選「內容」
   step2: 在「區域連線 內容」視窗中點選「安裝」
   step3: 在「請選取網路連線類型」視窗中點選「服務」,再點選「新增」
   step4: 在「選取網路服務」視窗中點選「從磁片安裝」
   step5: 在「從磁片安裝」視窗中點選「瀏覽」
   step6: 在「找出檔案位置」視窗中,進入您VirtualBox Portable的資料夾路徑如「D:\Portable-VirtualBox\app64\drivers\network\netlwf」下,點選netflt 資料夾中的的 「VBoxNetFlt.inf」,在點選「確定」進行安裝
   step7: 安裝完畢後會發現「區域連線 內容」視窗中多了「VirtualBox Bridged Networking Driver」
   step8: 在VirtualBox的網路連線,而我們點選「橋接介面卡(Bridged Adapter)」,使VirtualBox裡的作業系統可以存取我們的區域網路,這樣就可以使用pietty對安裝好的作業系統進行連線了

2019年11月14日 星期四

CSS 濾鏡

多重背景圖片的使用


* 圖片要用 透明的
* key sentence : background-image: url('images/grass.png'), url('images/birds.png'), url('images/rainbow.png');


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>多重背景圖片的使用</title>
    <style type="text/css" media="screen">
        body {
            font-family: microsoft jhengHei;
            background-image: url('images/bg2.jpg');
            background-size: cover;
            background-repeat: no-repeat;
        }

        div {
            width: 590px;
            height: 500px;
            padding: 5px;
            margin: 30px auto;
            border: 1px #333 solid;
            background-color: #fff;
            background-image: url('images/grass.png'), url('images/birds.png'), url('images/rainbow.png');
            background-size: cover;
        }

        div p {
            line-height: 18px;
            letter-spacing: 1px;
            text-align: justify;
            padding: 5px;
            box-sizing: border-box;
        }
    </style>

</head>

<body>
    <div>
        <p>Responsive website design is a new trend in web.
        </p>
    </div>
</body>

</html>


2019年10月30日 星期三

C# 多型 範例

target main
1. 設定 薪水 $70K
2. Bonus $30K
3. 印出 john 經理 Total 薪水

-------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsolePolymorphism1
{
    //定義 Employee 員工當作父類別
    class Employee
    {  // _salary 宣告為保護層級,只讓子類別中使用
       protected int _salary;        //父類別的欄位
          public virtual int Salary  //父類別的屬性
        {
            get {
                return _salary;
            }
            set {
                //薪資< 20000, 以 20000 計算; 薪資 > 40000 以 40000 計算
                if (value < 20000)
                    _salary = 20000;
                else if (value > 40000)
                {
                    _salary = 40000;
                }
                else
                    _salary = value;
            }
        }
    }

    class Manager : Employee
    {
        public int Bonus { get; set; }

        public override int Salary
        {
            get
            {
                return _salary;
            }
            set
            {
                //薪資< 30000, 以 30000 計算; 薪資 > 60000 以 60000 計算
                if (value < 30000)
                    _salary = 30000;
                else if (value > 60000)
                {
                    _salary = 60000;
                }
                else
                    _salary = value;
            }
        }

        public void ShowTotal()
        {
            Console.WriteLine("\n 實領的薪資: {0}元", (Bonus + Salary).ToString("0,0"));
        }

    }
    class Program
    {
        static void Main(string[] args)
        {
       
        Manager john =new Manager();
        john.Salary=70000;
        john.Bounus =30000;
        john.ShowTotal();
        Console.Read();
        }
    }
}

2019年10月29日 星期二

check 迴圈次數

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace test1
{
    class Program
    {
        static void Main(string[] arg)
        //以定義一個以上 進入點, modify /main
        // ref : http://justin0002.blogspot.com/2012/12/c.html
        {
            // ref :https://sweetkikibaby.pixnet.net/blog/post/191310453
            int[,] arr1 = new int[3, 2] { {1,2},{ 3,4},{ 5,6} };

            {

                for (int i = 0; i <= arr1.GetLength(0) - 1; i++)
                {
                    for (int j = 0; j <= arr1.GetLength(1) - 1; j++)
                    {
                        Console.WriteLine(arr1[i, j].ToString());
                       
                    }
                    Console.ReadLine();// check 內迴圈次數
                }
                Console.ReadLine();// check 外迴圈次數
            }

        }

    }
}