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 外迴圈次數
            }

        }

    }
}

2019年10月28日 星期一

C#joey1029.txt

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

namespace _1025_作業繳交
{
    //class Ex1
    //{
    //    static public void ex1()
    //    {
    //        Console.WriteLine("EX1");
    //        Console.Read();
    //    }
    //}
   
    public class Ex1
    {

           using (Ex1 ex1=new Ex1())
           public void ex1(int x,int y)
           //静态方法不能直接使用本类的非静态方法
           {
            //int EX1= Show();
            //   }
            //public int Callbaby()
            //{
            int EX1a = Max(x,y);
            //從 EX1 倒推回去

            //Console.WriteLine(EX1a);

            //Console.Read();
            //int EX1a[] = new int[3];
            //return EX1a;
            //Console.WriteLine(Callbaby.EX1);
            //Object EX1 = new Object();
            //EX1 = EX1a.ToString();
            //Console.WriteLine(EX1);

            Console.WriteLine(EX1a.ToString());
            Console.Read();

        }
        public int Max(int X, int Y)
        {
            return (X > Y) ? X : Y;
        }
    }



    //class Ex1
    //{
    //        static public void ex1()
    //        {
    //        Clac EX1b = new Clac ();
    //        Console.WriteLine(EX1a);
    //            Console.Read();
    //        }
    //}


    //class Class1
    //{
    //    public static void OtherM()
    //    //程式只能有一個 Main 方法。
    //    {
    //        Ex1 Obj = new Ex1();
    //        Obj.Show();
    //    }
    //}

}

2019年10月8日 星期二

ajax - xampp ok - jq-ajax.html

ajax - xampp ok - jq-ajax.html

* test 驗證程式 - 先測 基本功能 是活的



snippet generator

https://snippet-generator.app/

VS Code 中自訂程式碼片段的功能(snippet)
https://pjchender.blogspot.com/2017/04/vs-code-snippet.html


VS2019 安裝
* asp.net
* (node.js)
* net 桌面
* windows 平台

建一個帳戶 joey.wda@hotmail.com
pw : @12


jQuery

$('button') ~1. 找到button~
.click(function()){ ~2. 觸發做什?~
$(this).closet('ul') ~3.本體鄰近的(方法) ul~
.parent().next() ~4. 增加尋找方法 父件的 同層~
.css('color', 'red'); ~給他個 式樣~









2019年9月19日 星期四

0920

學號 姓名 畢業學校/最高學歷 科/系/所 從事行業或工作領域 課程後希望的工作目標
16 余祥文 海洋大學 機械所 機構工程師:負責機械繪圖與
生產工程問題分析及解決
ASP.NET 軟體工程師(桃園);
Internet程式設計師

2019年9月18日 星期三

2019年9月17日 星期二

0918 - xampp build & workspace build

使用 本機 web browser test VM xammp web site

1. 本機 修改 C:\Windows\System32\drivers\etc\hosts
增加
127.0.0.1                        web108b.wda.edu.tw
192.168.67.123        web108b.wda.edu.tw

2. VM modify D:\xampp\apache\conf\extra\httpd-vhosts.conf

<VirtualHost *:80>
    ##ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "/xampp/htdocs/web108b"
    ServerName web108b.wda.edu.tw
    ##ErrorLog "logs/dummy-host2.example.com-error.log"
    ##CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

3. 建立 html folder
D:\xampp\htdocs\web108b

------------ VM <<< >>> 本機 連線 test ---------------------

** VM 裝 -----
* VM 的 xampp location
    DocumentRoot "/xampp/htdocs/web108b"
    ServerName web108b.wda.edu.tw

* 本機的 system 32
192.168.67.123        web108bvm.wda.edu.tw ?? 兩個都寫 ?? OK
* <result 本機連 vm ok -- chrome>
** 本機裝的 相反----

本機 的 xampp location ;; (注意 資料夾只能放在 /xampp-web108b/htdocs/ 底下)
    DocumentRoot "/xampp-web108b/htdocs/user108b"
    ServerName web108b.wda.edu.tw

VM的 system 32

192.168.67.23 web108b.wda.edu.tw ?? 兩個都寫 ?? OK

----------------------------------
=========joey- vs code - settings.json============
{
    "extensions.autoUpdate": false, //禁止擴展更新
    "extensions.ignoreRecommendations": true,
    "update.mode": "none", //禁止軟件版本更新
    // 在儲存時設定檔案格式。格式器必須處於可用狀態、檔案不得自動儲存,且編輯器不得關機。
    "diffEditor.ignoreTrimWhitespace": true,
    // 設定預設存檔時不做格式化,使用分別啟動
    "editor.formatOnSave": false,
    // 分別啟用指定語言
    "[php]": {
        "editor.formatOnSave": true,
    },
    "[css]": {
        "editor.formatOnSave": true
    },
    "[html]": {
        "editor.formatOnSave": true
    },
    "[javascript]": {
        "editor.formatOnSave": true
    },
    // 控制編輯器是否應自動設定貼上的內容格式。格式器必須可供使用,而且格式器應該能夠設定文件中一個範圍的格式。
    "editor.formatOnPaste": true,// 貼上程式碼時會自動幫你排版(縮排)
    "editor.formatOnSaveTimeout": 1250,
    "editor.cursorStyle": "block",
    "editor.fontFamily": "Fira Code",  //"'Courier New'"
    // - 'bounded' (當檢視區縮至最小並設定 'editor.wordWrapColumn' 時換行).
    "editor.wordWrap": "on",//每行如果超出視圖範圍就自動換行顯示。
    "editor.lineHeight": 28,
    "editor.fontLigatures": true,
    "editor.fontSize": 16, // 字體大小
    "editor.lineNumbers": "on",
    "editor.minimap.enabled": false, // 關掉右側滑動預覽檔
    "editor.renderIndentGuides": false,
    //設定的 Snippet 放在最上面顯示
    "editor.snippetSuggestions": "top",
    //1 tab = 4 spaces
    "editor.tabSize": 4,
    "editor.rulers": [
        120
    ],
    //用ctrl+滑鼠滾輪去放大縮小使
    "editor.mouseWheelZoom": true,
    //"editor.fontWeight": "300",  // Light
    //"editor.fontWeight": "400",  // Regular
    //"editor.fontWeight": "500",  // Medium
    "editor.fontWeight": "600",
    "editor.quickSuggestions": { //智慧提示
        "other": true,
        "comments": true,
        "strings": true
    },
    "workbench.colorTheme": "Seti Monokai", //Solarized Dark、Monokai
    "workbench.iconTheme": "vscode-icons", //增加文件夾圖示。 vscode-great-icons、 要先下載vscode-icons套件(後面會提到)
    "window.zoomLevel": 1,
    // Windows 的換行是 \r\n (CRLF),而 Linux 是 \n (LF),會遇到 Windows 開發後放在 Linux 跑時會 error,為了讓事情簡單化就預設是 LF 吧,這是針對新增的,舊的可以從右下角去改變它
    "files.eol": "\n",
    "files.autoSave": "onFocusChange",
    "files.autoSaveDelay": 3000,
    //設定其它副檔名的檔案跟 php 是有關係的
    "files.associations": {
        "*.inc": "php",
        "*.tpl": "html"
    },
    //新檔為 UTF8
    "files.encoding": "utf8",
    "files.trimTrailingWhitespace": true,
 //------------------------------  HTML CSS SUPPORT ------------------------------//
"css.fileExtensions": [
    "css",
    "scss"
],
"css.remoteStyleSheets": [
    "https://maxcdn.bootstrapcdn.com/bootstrap/ 4.0.0-alpha.6/css/bootstrap.min.css"
],
//============================== VSCode Browser Sync ==============================//
"browserSync.config": {
    "browser": [
        "chrome",
    ],
    "files": [
        "*.html",
        "*.log",
        "*.php",
        "/css/*.css",
        "/js/*.js"
    ],
    "codeSync": true
},
    //============================== LiveServer For Web ================================//
    "liveServer.settings.useWebExt": true,
    "liveServer.settings.host": "localhost",
    "liveServer.settings.port": 5500,

}

===========joey==================

2019年9月16日 星期一

0916

GDS
blog
Xmind
Trello

-----------------------------------
* M2432 VM 轉移 SOP test ok 9/16
1. install driver again
2. 橋接網路 choose NAT (not NAT 網路)
3. IP4 網路 改 自動取得 IP
4. 共用資夾 改 J:
-----------------------------------
9/10 刷卡說明 & PC ID 共用槽
9/11 VM build - test 龜 & classroom ok
web
共用夾
D:
9/12 sql server 2012 install
9/16 sql server db 資料庫備份與還原 與 操作
還原比較容易出錯 (還原演練; 災難復原計畫)


=========TSQL 程式碼==============

use [master]
-- 開啟 xp_cmdshell
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'xp_cmdshell', 1;
GO
RECONFIGURE;
GO 

--宣告變數
DECLARE @FolderName nvarchar(100) 
DECLARE @FileName nvarchar(100)
DECLARE @BackupFolderName nvarchar(100)
DECLARE @FileDate nvarchar(100)
DECLARE @DataBaseName nvarchar(100)
DECLARE @JobName nvarchar(100)
DECLARE @Command nvarchar(100)

--設定變數
------ 要改的地方 以下 name & 路徑
SET @DataBaseName = 'db1'
SET @BackupFolderName = 'D:\dbbackup\sql2012'
------ 要改的地方 以上 name & 路徑

SET @JobName = @DataBaseName + ' 備份'

--取得日期變數 , 例 2013-01-01 12:30:40.001
SET @FileDate = CONVERT(nvarchar(100), GETDATE(), 121)

--除去日期變數中的 - : . 符號 , 例 20130101_123040_001
SET @FileDate = REPLACE( @FileDate , '-' , '' )
SET @FileDate = REPLACE( @FileDate , ':' , '' )
SET @FileDate = REPLACE( @FileDate , '.' , '_' )
SET @FileDate = REPLACE( @FileDate , ' ' , '_' )

--設定備份目錄,並自動以年、月建立目錄
SET @FolderName = @BackupFolderName
SET @Command = 'mkdir ' + @FolderName
EXEC xp_cmdshell @Command, no_output

SET @FolderName = @FolderName + '\' + @DataBaseName 
SET @Command = 'mkdir ' + @FolderName
EXEC xp_cmdshell @Command, no_output

SET @FolderName = @FolderName + '\' + SUBSTRING(@FileDate , 1 , 4)
SET @Command = 'mkdir ' + @FolderName
EXEC xp_cmdshell @Command, no_output

SET @FolderName = @FolderName + '\' + SUBSTRING(@FileDate , 5 , 2)
SET @Command = 'mkdir ' + @FolderName
EXEC xp_cmdshell @Command, no_output

--設定檔案名稱
SET @FileName = @FolderName + '\' + @DataBaseName  + '_' + SUBSTRING(@FileDate , 1 , 15) + '.bak'

--執行備份作業
BACKUP DATABASE @DataBaseName TO DISK = @FileName WITH NOINIT , NOUNLOAD , NAME = @JobName , NOSKIP , STATS = 10, NOFORMAT


-- 關閉 xp_cmdshell
use [master]
EXEC sp_configure 'show advanced options', 0;
GO
EXEC sp_configure 'xp_cmdshell', 0;
GO
RECONFIGURE;
GO 

==========TSQL 程式碼============