<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>cp2019 40823224</title><link href="https://40823224.github.io/cp2019/blog/" rel="alternate"></link><link href="https://40823224.github.io/cp2019/blog/feeds/all.atom.xml" rel="self"></link><id>https://40823224.github.io/cp2019/blog/</id><updated>2019-11-28T14:00:00+08:00</updated><entry><title>十二週任務一</title><link href="https://40823224.github.io/cp2019/blog/12week.html" rel="alternate"></link><published>2019-11-28T14:00:00+08:00</published><updated>2019-11-28T14:00:00+08:00</updated><author><name>40823224</name></author><id>tag:40823224.github.io,2019-11-28:/cp2019/blog/12week.html</id><content type="html">&lt;p&gt;十二週任務一影片：&lt;/p&gt;
&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/-Aijr3ypWX4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen&gt;&lt;/iframe&gt;</content><category term="2019FallCP"></category></entry><entry><title>期中考</title><link href="https://40823224.github.io/cp2019/blog/40823224-1336.html" rel="alternate"></link><published>2019-11-07T22:00:00+08:00</published><updated>2019-11-07T22:00:00+08:00</updated><author><name>40823224</name></author><id>tag:40823224.github.io,2019-11-07:/cp2019/blog/40823224-1336.html</id><content type="html">&lt;p&gt;期中考進度影片&lt;/p&gt;
&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/fnDXyVCPv6c" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen&gt;&lt;/iframe&gt;</content><category term="2019FallCP"></category></entry><entry><title>嵌入 Dartpad</title><link href="https://40823224.github.io/cp2019/blog/embedded-dartpad-to-blog.html" rel="alternate"></link><published>2019-10-31T11:00:00+08:00</published><updated>2019-10-31T11:00:00+08:00</updated><author><name>40823224</name></author><id>tag:40823224.github.io,2019-10-31:/cp2019/blog/embedded-dartpad-to-blog.html</id><summary type="html">&lt;p&gt;在此利用 https://dartpad.github.io 將位於 downloads 目錄中的 dart 程式導入.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;在此利用 https://dartpad.github.io 將位於 downloads 目錄中的 dart 程式導入.&lt;/p&gt;


&lt;script&gt;// &lt;![CDATA[
function getDart(dirname){
    source = "https://dartpad.github.io/embed-dart.html?gh_owner=40823224&amp;gh_repo=cp2019&amp;gh_path=downloads/dart_ex/" + dirname + "&amp;theme=dark";
    document.getElementById("iframe").src = source ;
}

function getHtmlDart(dirname){
    source = "https://dartpad.github.io/embed-html.html?gh_owner=40823224&amp;gh_repo=cp2019&amp;gh_path=downloads/dart_ex/" + dirname + "&amp;theme=dark";
document.getElementById("iframe").src = source ;
}

function getFlutter(dirname){
    source = "https://dartpad.github.io/embed-flutter.html?gh_owner=40823224&amp;gh_repo=cp2019&amp;gh_path=downloads/dart_ex/" + dirname + "&amp;theme=dark";
document.getElementById("iframe").src = source ;
}

function largest(){
document.getElementById("iframe").width = document.body.clientWidth ;
document.getElementById("iframe").height = document.body.clientWidth*0.5 ;
}

function original(){
document.getElementById("iframe").width = 800 ;
document.getElementById("iframe").height = 600 ;
}
// ]]&gt;&lt;/script&gt;

&lt;!-- 取 Dart 程式的按鈕 --&gt;

&lt;p&gt;&lt;button onclick="largest()"&gt;放大&lt;/button&gt; &lt;button onclick="original()"&gt;回復&lt;/button&gt; &lt;button onclick="getDart('hello')"&gt;Hello&lt;/button&gt; &lt;button onclick="getDart('for')"&gt;For Loop&lt;/button&gt; &lt;button onclick="getDart('sum')"&gt;Sum&lt;/button&gt; &lt;button onclick="getDart('runge_kutta')"&gt;Runge-Kutta&lt;/button&gt; &lt;button onclick="getDart('mass_spring_damping')"&gt;Mass Spring Damping&lt;/button&gt; &lt;button onclick="getHtmlDart('roc_flag')"&gt;ROC Flag&lt;/button&gt; &lt;button onclick="getHtmlDart('grid')"&gt;Grid&lt;/button&gt; &lt;button onclick="getHtmlDart('slithery')"&gt;Slithery&lt;/button&gt; &lt;button onclick="getFlutter('flutter1')"&gt;Flutter1&lt;/button&gt; &lt;button onclick="getFlutter('flutter2')"&gt;Flutter2&lt;/button&gt; &lt;button onclick="getFlutter('flutter3')"&gt;Flutter3&lt;/button&gt;&lt;/p&gt;

&lt;!-- 內建放入的 Dart 原始碼 --&gt;

&lt;p&gt;&lt;iframe width="800" height="600" id="iframe" src="https://dartpad.dartlang.org/embed-dart.html?gh_owner=40823224&amp;amp;gh_repo=cp2019&amp;amp;gh_path=downloads/dart_ex/for&amp;amp;theme=dark"&gt;&lt;/iframe&gt;&lt;/p&gt;</content><category term="2019FallCP"></category></entry><entry><title>2019 Fall CP 課程</title><link href="https://40823224.github.io/cp2019/blog/2019-Fall-Win10-1903.html" rel="alternate"></link><published>2019-10-30T11:00:00+08:00</published><updated>2019-10-30T11:00:00+08:00</updated><author><name>yen</name></author><id>tag:40823224.github.io,2019-10-30:/cp2019/blog/2019-Fall-Win10-1903.html</id><summary type="html">&lt;p&gt;2019 Fall 一開始, 1903 版的 Windows 10 就大舉更新, 除了逐步去掉先前許多舊版的設定視窗, 也將系統的指令搜尋與 App 應用程式進行綁定. 許多採用可攜設定的程式執行流程, 隨著更新進程的推展, 必須因應修改才可以正常運作.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;2019 Fall 一開始, 1903 版的 Windows 10 就大舉更新, 除了逐步去掉先前許多舊版的設定視窗, 也將系統的指令搜尋與 App 應用程式進行綁定. 許多採用可攜設定的程式執行流程, 隨著更新進程的推展, 必須因應修改才可以正常運作.&lt;/p&gt;


&lt;h2&gt;為何要使用可攜系統&lt;/h2&gt;
&lt;p&gt;自從 1995 年 Windows 95 與 Solidworks 95 在個人電腦中推出, 至今二十幾年, 幾乎所有與機械設計相關的單機套件的操作系統都在 Windows 上, 但是一旦需要建構所謂的 client-server 或雲端機械設計運算系統, 以 Ubuntu 為主的 Linux 伺服器顯然在成本與效益上, 擁有許多優勢. 因此長遠來看, 任何在 Windows 上操作的計算機運算流程, 都必須設法能夠在 Windows 與 Linux 上運作.&lt;/p&gt;
&lt;p&gt;在 Windows 10 環境中使用可攜系統的原因, 主要是讓計算機程式課程中所使用的工具, 都可以放在 USB 3.0 規格以上的隨身碟或隨身硬碟上運作, 而第二個原因則是希望這些工具都能相容於 Linux 系統.&lt;/p&gt;
&lt;h2&gt;Windows 10 更新所造成的問題&lt;/h2&gt;
&lt;p&gt;電腦輔助設計室中的第三磁區, 在完全沒有還原保護的情況下, 每一台電腦每次開機都會執行 Windows 10 的更新檢查, 然後依照更新期程的排定, 逐步更新. 因此, 從實際面來看, 每一台電腦的設定與內容並非完全相同. 使用者在開機後, 就必須根據電腦的現況進行因應. 而電腦操作系統更新造成的問題在於: 各電腦的實際現況與下載可攜系統當時製作環境不同, 因此部分設定必須配合修改後, 才可正常運作.&lt;/p&gt;
&lt;h2&gt;系統 path 搜尋路徑的修改&lt;/h2&gt;
&lt;p&gt;Windows 10 1903 版次在 Fall 開學後, 將 Python 執行路徑的搜尋納入系統 path 後, 假如所使用的 Windows 10 並未安裝 Python 解譯套件, 以系統內定 path 搜尋後, 會自動將使用者導引到 Python App 的安裝畫面.&lt;/p&gt;
&lt;p&gt;這樣的改變, 將會對原先可攜程式系統造成兩種影響, 第一的影響是: start.bat 中以系統 path 設為第一優先下, 使用者在命令列中輸入 python 解譯器指令時, Windows 10 就會將使用者帶到要求 Python App 安裝的畫面.&lt;/p&gt;
&lt;p&gt;因應修改的方法, 就是將 start.bat 中操作系統 path 優先權去除, 也就是 set path=%path%;... 中的 %path% 放到最後順序, 或者乾脆刪除.&lt;/p&gt;
&lt;p&gt;第二項影響則是對 SciTE中 Python 的程式執行. 因為 2019 Fall 開始隨身程式系統製作時 path 可綁訂至隨身系統中的 Python 3.7.3, 因此 SciTE 中有關 .py 程式執行設定, 直接設為 path 中, 以 pythonw.exe 解譯 .py 程式, 一旦 path 無法指到隨身系統中的 python 解譯系統,  SciTE 中的 .py 程式執行, 就必須明確指定 Python 3.7.3 所在的指令路徑.&lt;/p&gt;
&lt;p&gt;也就是帶出 Options -&amp;gt; python.properties 設定檔案, 然後進行修改:&lt;/p&gt;
&lt;pre class="brush: python"&gt;
if PLAT_WIN
    command.go.*.py=Y:\cad\201906_fall\data\py373\pythonw -u "$(FileNameExt)"
    command.go.subsystem.*.py=1
    command.go.*.pyw=pythonw -u "$(FileNameExt)"
    command.go.subsystem.*.pyw=1
    command.build.SConscript=scons.bat --up .
    command.build.SConstruct=scons.bat .
&lt;/pre&gt;

&lt;h2&gt;python 執行路徑的修改&lt;/h2&gt;
&lt;p&gt;除了採用明碼進行設定的 python.properties 必須配合修改外, 以二位元碼設定的 py373/Scripts/pelican.exe 也必須利用 &lt;a href="https://mh-nexus.de/en/hxd/"&gt;hxd&lt;/a&gt; 進行 python 執行路徑字串置換修改.&lt;/p&gt;
&lt;h2&gt;安裝 python 新增模組&lt;/h2&gt;
&lt;p&gt;當使用者在執行 python 解譯時, 若碰到缺少特定模組時, 可以利用 &lt;/p&gt;
&lt;p&gt;python -m pip install flask_cors&lt;/p&gt;
&lt;p&gt;進行安裝.&lt;/p&gt;
&lt;h2&gt;Pelican 設定修改&lt;/h2&gt;
&lt;p&gt;theme/attila/templates/base.html 中必須進行下列修改:&lt;/p&gt;
&lt;pre class="brush: jscript"&gt;
&lt;script type="text/javascript" src="./../cmsimde/static/syntaxhighlighter/shCore.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="./../cmsimde/static/syntaxhighlighter/shBrushJScript.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="./../cmsimde/static/syntaxhighlighter/shBrushJava.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="./../cmsimde/static/syntaxhighlighter/shBrushPython.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="./../cmsimde/static/syntaxhighlighter/shBrushSql.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="./../cmsimde/static/syntaxhighlighter/shBrushXml.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="./../cmsimde/static/syntaxhighlighter/shBrushPhp.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="./../cmsimde/static/syntaxhighlighter/shBrushCpp.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="./../cmsimde/static/syntaxhighlighter/shBrushCss.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="./../cmsimde/static/syntaxhighlighter/shBrushCSharp.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="./../cmsimde/static/syntaxhighlighter/shBrushBash.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="./../cmsimde/static/syntaxhighlighter/shBrushLua.js"&gt;&lt;/script&gt;
&lt;script type='text/javascript'&gt;
    (function(){
        var corecss = document.createElement('link');
        var themecss = document.createElement('link');
        var corecssurl = "./../cmsimde/static/syntaxhighlighter/css/shCore.css";
        if ( corecss.setAttribute ) {
                corecss.setAttribute( "rel", "stylesheet" );
                corecss.setAttribute( "type", "text/css" );
                corecss.setAttribute( "href", corecssurl );
        } else {
                corecss.rel = "stylesheet";
                corecss.href = corecssurl;
        }
        document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") );
        var themecssurl = "./../cmsimde/static/syntaxhighlighter/css/shThemeDefault.css?ver=3.0.9b";
        if ( themecss.setAttribute ) {
                themecss.setAttribute( "rel", "stylesheet" );
                themecss.setAttribute( "type", "text/css" );
                themecss.setAttribute( "href", themecssurl );
        } else {
                themecss.rel = "stylesheet";
                themecss.href = themecssurl;
        }
        //document.getElementById("syntaxhighlighteranchor").appendChild(themecss);
        document.getElementsByTagName("head")[0].insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") );
    })();
    SyntaxHighlighter.config.strings.expandSource = '+ expand source';
    SyntaxHighlighter.config.strings.help = '?';
    SyntaxHighlighter.config.strings.alert = 'SyntaxHighlighter\n\n';
    SyntaxHighlighter.config.strings.noBrush = 'Can\'t find brush for: ';
    SyntaxHighlighter.config.strings.brushNotHtmlScript = 'Brush wasn\'t configured for html-script option: ';
    SyntaxHighlighter.defaults['pad-line-numbers'] = false;
    SyntaxHighlighter.defaults['toolbar'] = false;
    SyntaxHighlighter.all();
&lt;/script&gt;

&lt;!-- for LaTeX equations --&gt;
&lt;script src="https://scrum-3.github.io/web/math/MathJax.js?config=TeX-MML-AM_CHTML" type="text/javascript"&gt;&lt;/script&gt;

&lt;/pre&gt;</content><category term="2019FallCP"></category></entry></feed>