2020年5月30日 星期六

重構

以下只是個人的教育訓練的準備內容,並非文章。
======================
  • [Training 開場]
為什麼要提這個?
業界很紅 書出了兩版(重構-改善既有程式的設計) 第一版用Java 第二版用JavaScript
我也覺得很有效 (拿code出來比對)
好處多多 : 讓工作有效率 別人來問邏輯時 需求評估時 程式編寫時 叫修維運時 最終能準時下班 快樂生活
老闆如果不是開發背景,會覺得沒有效益,所以要讓老闆知道這個名詞。
  • [What] 什麼是重構?
不改變原先程式執行的外在結果,而是影響內部結構,提高人類理解性,以降低維運成本
重構是有風險的,所以有理論(原則)、(手)方法、工具可以降低風險,帶來不少好處
  • [Why] 為什麼要重構?有什麼好處?
電腦才不管程式碼是簡潔或冗長的 (clear or ugly),但人會!
任何人都會寫程式(能跑出結果就好),但能寫出讓人看得懂的城市才是人
程式在寫的時間不多,反而在大部分都在讀和修改中。後續的接手的人才不會痛苦
如果有需求要評估或有bug要修改時,要花很多時間找要新增或修改在哪裡,改了會不會與其他交會影響(也就是產生副作用side effect)
clean code !
性能不一定會提升,所以重構不一定是性能優化,若是性能問題,著手的可能是整體設計或資料結構的改變。

  • [When] 何時該重構?
要新入新功能時
有計畫性的
code review時
當這個功能寫的超大一坨,全部重寫比重構簡單時,就不該重構。
  • [How] 重構的方法與工具
事前一定要有測試案例或測試程式來作為驗證
一次改一點就跑自動化測試,不要等到改了一大堆後才又在trace error
註解還是要寫,原因及重點要寫清楚不要寫下時間點和人名等沒用的資訊
pair-programing  誰都會犯錯,多個人一起把關,同時可以帶領一起了解及學習,分攤壓力,甚至會減少開發時間
自動化重構 : Eclipse 有一些refactoring 功能(Extract method、rename variable 等等)




2020年3月20日 星期五

英文文法的解說

之前國中考高中,就一直抱持著唸書靠自己不是靠學校,所以考上大家公認的第一志願明星高中也沒去念,跑去念離家最近的高中,考大學也沒太用心也不懂國立頂尖大學有甚麼用,只知道國立的學費比較便宜,但出了社會後才體會到學校好壞的差別,好的學校就是有好的教授與教育資源,從最近看到交大開放式課程的內容,就更體會到教育資源的差別,好的老師讓你學習快樂、從中體會到以往不懂的事,那種恍然大悟的經歷不是光靠自己就能看到、學到的,謝謝交大有這麼棒的開放式學習環境,讓已經四十歲的我在充實進修時能夠覺得如此方便與滿足。

昨天完成了第一週課程,今天星期六早上很興奮地完成第二週,劉老師講得太棒了 !



  • 2020-03-22 早上看完第三週課程


  • 2020-04-02 早上看完第四週課程





  • 2020-04-03,04-05完成第五週課程



  • 2020-04-05完成第六週課程


  • 2020-04-11 第七週

  • 2020-04-18 第八週

  • 2020-04-19

這個課程雖然沒講到文法,卻是給學習英文的我們很多好問題去思考,最終提問學歷的光環能用多久,雖然是說進公司的那天就沒用了,但不代表就不重要,學歷就像一張入場卷讓你能進入該公司的職位,但後續的努力和態度就是工作上成敗的關鍵,另外就算學歷不好進入公司表現極佳,最終面臨升遷考核在與人競爭,當表現和績效相當時,學歷的高低多多少少還是有點優先度的參考指標,所以千萬不要認為學歷不重要,否則到需要學歷這張紙時你會更辛苦地去追求更高的學歷。

PS. 就像只有淡大學士學歷的我,到了40歲還希望去拚個碩士。

Lec09 英語語法的溝通功能 第十週課程




Lec10 英語語法的溝通功能


  • 2020-05-30 Lec11 英語語法的溝通功能



Lec12 英語語法的溝通功能

Lec13 英語語法的溝通功能


Lec14 英語語法的溝通功能



Lec15 英語語法的溝通功能 第十七週課程


2020年3月14日 星期六

The Four Seasons of the Year


  • Spring

In spring,it rains a lot
Birds starts singing sweet songs
The weather is warm
You can see rainbows in the sky.
The trees are blooming.
Tiny buds appear on trees.
Buds are followed by blossoms and leaves.
The grass is growing
Plants begin to sprout
Flowers are blooming.
Birds return in spring.
They build a nest.
Chicks hatch from eggs.
You can hear ducklings quacking.
You can see beautiful butterflies, cute ladybugs
tulip 鬱金香 daffodil 黃水仙花
Bees fly from flower to flower.
You can see lambs in the fields.
Children have fun flying a kite.
Families enjoy a picnic in the spring sunshine.


  • Summer

In summer , the weather is sunny and hot.
People love spending time at the beach.
The wear swimsuits.
You can have fun with the inflatable raft.充氣筏 or with the inflatable rubber ring (充氣橡膠泳圈)
Other people prefer riding on a jet ski.(水上摩托車)
You can go on a sailboat ride.帆船 or travel on an island.
People wear goggles to protect their eyes when swimming.
Swimming is very fun.
You can wear a diving mask to see underwater
You can lie on a beach chair and have a suntan.
Sunglasses can protect your eyes from the sun.
Suntan lotion can protect your skin from the sun.
You can sit under a beach umbrella and have an ice cream. a fresh cold juice or watermelon.
There are many shells and starfish on the seashore.
You can lie on a beach towel.
Some people like wearing flip flops on the beach.人字拖鞋(由其走路時的響聲而得名)
You can have a great time riding a surfboard.
A cool box keeps your food and drink cool.
Windsurfing風帆 is so much fun and lying on a water mattress床墊 is so relaxing !
Children love playing with beach toys and building sand castle.


  • Fall

The weather begins to get colder.
It rains a lot.
You should take your umbrella.
The wind is blowing.
The leaves are falling from the tree and change from green to red ,orange,yellow or brown.
Many birds migrate south to warmer climates for the winter.
Children are have fun jumping in the leaves.
Fall is the season of harvest. Fruits and vegetables are ripe.成熟
You can see lots of haystacks草堆 and mushrooms sunflowers.
Wheat is ripe and ready to harvest.
Here comes the harvester.
We harvest pumpkin 、corn、 grapes、 apples、 pears 、walnuts胡桃 、plums李子梅子
Acorns橡實 and chestnuts栗子 are ripe ,too
Squirrels love them.松鼠
People celebrate Thanksgiving in November.
They are thankful for the blessings of life.


  • Winter 

Winter is the coldest season of the year.
Everything is covered in snow.
Some animals,like bears,hedgehogs刺蝟,bats hibernate during winter.
Snowflakes are falling on the ground.
The water is frozen. You can see lots of icicles all around.
Let's see what we should wear in winter to keep us warm.
Sweater boots jacket scarf ,Beanie hat,gloves.
Children make snowballs.
They are having fun building a snowman.
The girl is ice-skating.
Two little girls are sledding乘雪橇 down the hill.
A boy is skiing.
Snowboarding is very fun,too.
That girl is making a snow angel !
Everyone is very excited because Santa is coming to town.

2020年2月21日 星期五

AWS 紀錄

繼上週為了在AWS上跑K8S,就開始踏上雲端服務之旅,在註冊完後(IAM)就會開始進到AWS管理控制台,也買了自己在AWS的網域服務(Route 53),啟用了S3 儲存貯體來放置k8s的相關設定。
本週(2020-02-22)進修ELK時,網路上看到有人分享怎麼用EC2,所以也跟著試著創立一個Ubuntu的instance,創建過程中會讓我們下載*.pem檔,透過puttyGen從pem檔產生*ppk,在載入此ppk檔後就可以在Windows由putty連上該台server,完全不用輸入帳號與密碼即可login。

COVID-19 確診經歷紀實

原本以為真的是天選之人,就算先前家裡兩個小孩都確診都逃過了(可能有中獎但無症狀吧),不過就在2023年六月18日破解自認為天選之人的"心態",為什麼可以確認就是這天中獎的呢?因為在前都是居家上班,到人多的室內場所都會戴口罩,就剛好這天傍晚原本只想說要去附近的國...