[oh-my-zsh] For safety, we will not load completions from these directories until [oh-my-zsh] you fix their permissions and ownership and restart zsh. [oh-my-zsh] See the above list for directories with group or other writability.
[oh-my-zsh] To fix your permissions you can do so by disabling [oh-my-zsh] the write permission of "group" and "others" and making sure that the [oh-my-zsh] owner of these directories is either root or your current user. [oh-my-zsh] The following command may help: [oh-my-zsh] compaudit | xargs chmod g-w,o-w
[oh-my-zsh] If the above didn't help or you want to skip the verification of [oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to [oh-my-zsh] "true" before oh-my-zsh is sourced in your zshrc file.
- Each game, or “line” of bowling, includes ten turns, or “frames” for the bowler. - In each frame, the bowler gets up to two tries to knock down all the pins. - If in two tries, he fails to knock them all down, his score for that frame is the total number of pins knocked down in his two tries. - If in two tries he knocks them all down, this is called a “spare” and his score for the frame is ten plus the number of pins knocked down on his next throw (in his next turn). - If on his first try in the frame he knocks down all the pins, this is called a “strike”. His turn is over, and his score for the frame is ten plus the simple total of the pins knocked down in his next two rolls. - If he gets a spare or strike in the last (tenth) frame, the bowler gets to throw one or two more bonus balls, respectively. These bonus throws are taken as part of the same turn. If the bonus throws knock down all the pins, the process does not repeat: the bonus throws are only used to calculate the score of the final frame. - The game score is the total of all frame scores.
publicint? Calculate(List<int> fellPins) { var frames = new List<Frame>();
//todo remove this condition after pass single frame test if (fellPins.Count == 2) { if (fellPins[0] != 10) { frames.Add(new Frame(fellPins[0], fellPins[1])); } } if (fellPins.Count == 3 && fellPins[0] + fellPins[1] == 10) { var frame = new Frame(fellPins[0], fellPins[1]); frame.SetBonus(fellPins[2]); frames.Add(frame); } for (int i = 0; i < fellPins.Count; i++) { frames.Add(new Frame(fellPins[0])); } return NullableSum(frames); }
publicint? Calculate(List<int> fellPins) { var frames = new List<Frame>(); //todo remove this condition after pass single frame test if (fellPins.Count == 2) { if (fellPins[0] != 10) { frames.Add(new Frame(fellPins[0], fellPins[1])); } } if (fellPins.Count == 3 && fellPins[0] + fellPins[1] == 10) { var frame = new Frame(fellPins[0], fellPins[1]); frame.SetBonus(fellPins[2]); frames.Add(frame); } for (int i = 0; i < fellPins.Count; i++) { frames.Add(new Frame(fellPins[0])); }
return NullableSum(frames); }
我們建一個 For Loop 目標要將這些醜醜的 if 判斷式移到 Loop 之中 結果大致如下, 過程當然也是逐步的抽離
[Fact] publicvoidtestSimpleAddition() { Money five = Money.dollar(5); IExpression sum = five.plus(five); Bank bank = new Bank(); Money reduce = bank.reduce(sum,"USD"); Assert.Equal(Money.dollar(10), reduce); }
IExpression result = five.plus(five); Sum sum = (Sum) result;
這個時候編譯會失敗, 原因是 Sum 未實作 IExpression 介面, 一樣一個Commit搞定他 重新跑一下測試, 還是紅燈但是錯誤訊息變了, 無法將 Money 轉型成 Sum
System.InvalidCastException Unable to cast object of type ‘Marsen.NetCore.Dojo.Tests.Books.TddByExample.Money’ to type ‘Marsen.NetCore.Dojo.Tests.Books.TddByExample.Sum’.`
首先我覺得將來銀行的受到的鎂光燈好像比 Line 與樂天還多, 當然也可能是我的同溫層太厚的關係. 另外在將來銀行的官網或臉書上, 我找不到正式的公關回應. 所以不太確定新聞提到的將來銀行的回應是出自何處? 總之目前還有點渾濁, 我覺得要讓子彈再飛一會兒.
相比而言 Line 與樂天的新聞就少很多, 一路看下來我覺得比較像是一場只發生在將來銀行的媒體/行銷戰, 就我而言將來銀行的 Logo 或是營銷手段是迎合年輕人的, 但是我不了解的是,一個美美的官網或臉書你只用來介紹 Logo 的設計理念跟找網紅拍小短片 ? 撰寫本篇 Blog 時的臉書最後一篇文章是在跟風鮭魚時事哏, 而不對一些傳媒的新聞作出回應 ? (可能是我看漏,有人可以提供給我的話十分感謝) 有種「行銷成功卻公關完敗」的感覺.
env_reset If set, sudo will reset the environment to only contain the LOGNAME, SHELL, USER, USERNAME and the SUDO_* variables. Any variables in the caller’s environment that match the `env_keep` and `env_check` lists are then added. The default contents of the `env_keep` and `env_check` lists are displayed when sudo is run by root with the -V option. If the secure_path option is set, its value will be used for the PATH environment variable. This flag is on by default.
解決方法
最簡單的方法加上-E, 將 User 的環境變數先載入
1 2 3 4
The -E (preserve environment) option indicates to the security policy that the user wishes to preserve their existing environment variables. The security policy may return an error if the -E option is specified and the user does not have permission to preserve the environment.