锘??xml version="1.0" encoding="utf-8" standalone="yes"?>C++鍗氬-++wythern++http://www.2676208.com/wythern/X presents Y for a better Zzh-cnWed, 31 Jul 2019 23:12:06 GMTWed, 31 Jul 2019 23:12:06 GMT60[杞琞CRLF鍜孡F鍦ㄨ法骞冲彴宸ヤ綔鏃跺欏甫鏉ョ殑鐑︽伡浠ュ強瑙e喅鏂规硶http://www.2676208.com/wythern/archive/2019/03/27/216318.htmlwythernwythernWed, 27 Mar 2019 05:29:00 GMThttp://www.2676208.com/wythern/archive/2019/03/27/216318.htmlhttp://www.2676208.com/wythern/comments/216318.htmlhttp://www.2676208.com/wythern/archive/2019/03/27/216318.html#Feedback0http://www.2676208.com/wythern/comments/commentRss/216318.htmlhttp://www.2676208.com/wythern/services/trackbacks/216318.html鍦?#23005;?/a>

鍦ㄤ娇鐢╣it鎻愪氦浠g爜鏃跺欙紝鏈?#37827;跺欎細閬囧埌涓涓棶棰橈紝灏辨槸鑷?#23480;辨槑鏄?#37721;慨鏀逛簡鍏?#28051;?#37713;犺?#32029;鎻愪氦涓?#37720;?#28000;?#37722;?#37721;?#37916;版暣涓?#37826;?#28000;堕兘琚慨鏀逛簡?#32029;鍦?#29825;剧疆?#31777;?#29304;寮忛?#24226;牸浠?#37722;庤繕?#32048;鏈?#37819;愪氦涓?#28051;?#37720;荤殑鎯呭喌?#32029;杩欎釜鏃跺欑粡甯?#29825;?#27996;烘懜涓嶅埌澶磋剳?#32029;鍏跺疄灏辨槸CRLF鍜孡F鍦ㄤ綔鎬?/p>

CRLF LF CR ?#20824;?#27128;浠涔堟剰鎬濓細

  • CRLF: ?#27128;carriagereturnlinefeed?#27537;?#32521;鍐欍?#28051;?#37826;囨剰鎬濇槸鍥?#26462;?#37817;?#29723;?#37510;?/p>

  • LF: ?#27128;line feed?#27537;?#32521;鍐欙紝涓?#37826;囨剰鎬濇槸鎹?#29723;?#37510;?/p>

  • CR: ?#27128;carriagereturn?#27537;?#32521;鍐欍?#28051;?#37826;囨剰鎬濇槸鍥?#26462;?#37510;?/p>

绠鍗曠殑鎹?#29723;屽洖杞?#28051;?#28000;涔?#28028;氬紩鍑?#26473;欎箞澶氱殑?#26870;棰?#37723;紝鍏抽敭鍦?#27996;庢?#23940;綔绯荤粺涔?#38338;寸殑鍒嗘?#32048;

鏃?#37832;熺殑mac绯荤粺?#23047;鐢–R褰撳?#27693;崲琛岋紝鐜?#37734;?#28052;?#23480;茬粡?#31930;涓鎴愪簡LF

Unix(鍖?#37722;?#37916;?#37734;?#28598;ч噺?#23047;鐢ㄧ殑linux)绯荤粺?#23047;鐢↙F

windows绯荤粺?#23047;鐢↙FCR褰撳?#27693;崲琛?#38171;?#38007;綔?#20222;鏄庣殑鍏?#28729;规?#38171;?#38171;?#38171;?/p>

涔熸?#27128;鍥?#28051;?#28051;?#37722;?#32495;荤粺?#27537;鍒嗘?#32029;鍦?#28598;?#27996;?#37719;忎綔鍏?#37722;屽紑鍙戠殑鏃跺欙紝鍙兘瀵?#38007;?#37819;愪氦浠g爜鏃跺欎骇鐢熼棶棰?#37510;?/p>

瑙e喅鏂规硶?#32048;

Android Studio鍐?#38318;?#37721;?#28000;?#29825;剧疆涓?#37722;屾ā寮忥紝鍏?#28003;?#28003;嶇疆鍦╯etting-->鎼滅储code style瑙?#28051;?#37733;撅細





















璁剧疆?#29304;寮?/div>

鍏?#28051;?#37832;?#37733;?#28051;?#38315;夐」System-Dependent LF CR CRLF?#32029;?#31919;璁ゆ槸System-Dependent?#32029;涔?#28751;辨槸鏍规嵁浣犳槸浠涔?#32495;荤粺閫夋嫨浠涔堢被鍨嬶紝濡傛灉鎯宠鑷?#28729;?#28052;夌殑璇?#37721;?#28000;?#37734;ㄨ繖?#22135;璁剧疆?#32029;浠?#37722;庡垱寤虹殑鏂?#28000;g爜涔熼粯璁?#37922;?#29825;剧疆?#27537;鏂?#23534;?/p>

鑰屽?#20635;灉鎯?#37719;曠嫭?#24936;鏀规?#24874;釜鏂?#28000;剁殑?#34987;鍨嬶紝涔?#37721;?#28000;?#37734;?#37721;?#28051;?#29785;?#26473;?#29723;屼慨鏀癸紝瑙?#28051;?#37733;撅細

鍗曠嫭?#24936;鏀规?#24874;釜鏂?#28000;?/div>

?#27861;骞冲彴鍚堜綔鏃跺欑殑瑙e喅鏂?#23534;忥細

褰?#37812;?#28000;娇鐢╣it搴?#37819;愪氦浠g爜?#27537;鏃跺欙紝鏈夌殑浜?#37721;兘?#23047;鐢╩ac?#32029;鏈夌殑浜轰娇鐢╨inux?#32029;鏈夌殑浜轰娇鐢╳indows?#32029;涓?#37722;岀殑寮鍙?#37916;?#28583;?#28641;傛灉?#20824;?#27128;鎸夌収鑷?#23480;?#32495;荤粺?#27537;鏂?#23534;?#28000;绘剰?#24936;鏀规崲琛岀被鍨嬶紝?#27622;鍏嶄細璁?#28000;g爜搴撴暣浣撴販涔辨垨鑰?#27996;?#37922;?#29825;?#28598;氭病鏈夊繀瑕佺殑浠g爜鏇?#37826;?/p>

閭?#28052;?#29785;e喅璇ラ棶棰樼殑鏂?#23534;?#37832;夛細core.autocrlf鍛?#28000;?/strong>

git涓轰簡闃?#23005;?#28000;?#28051;婇棶棰?#37813;?#28052;辮法骞冲彴鍚堜綔寮鍙戯紝?#23047;鐢?#37723;?#28000;?#37721;?#28000;?#26462;?#37718;朙F鍜孋RLF

鍏?#28003;?#28003;?#37916;?#28051;猴細

  • git config --global core.autocrlf true


Git鍙?#28000;?#37734;?#28003;爌ush鏃?#38007;?#37716;?#37734;版妸琛岀粨鏉熺CRLF杞?#37817;?#37812;怢F?#32029;鑰?#37734;╬ull浠g爜鏃?#37814;奓F杞?#37817;?#37812;怌RLF銆?#37922;╟ore.autocrlf鏉?#37813;?#23534;姝?#26916;瑰?#29115;兘?#32029;濡傛灉?#27128;鍦╓indows绯荤粺涓婏紝鎶?#28729;?#29825;剧疆鎴恡rue?#32029;?#32342;鏍?#35120;撶鍑?#28000;g爜鏃?#38171;孡F?#32048;琚?#26462;?#37817;?#37812;怌RLF

  • git config --global core.autocrlf input

Linux鎴朚ac绯荤粺?#23047;鐢↙F?#32148;涓?#29723;岀粨鏉熺锛?#35120;?#28051;涓?#28000;RLF涓?#29723;岀粨鏉熺?#27537;鏂?#28000;?#28051;?#28751;?#36423;?#29722;?#23534;?#37711;?#37827;朵?#29370;偗瀹氭兂杩?#29723;屼慨姝o紝鎶奵ore.autocrlf璁剧疆鎴恑nput鏉?#37723;?#29831;?Git 鍦╬ush鏃?#37814;奀RLF杞?#37817;?#37812;怢F?#32029;pull鏃?#28051;?#26462;?#37817;?/p>

  • git config --global core.autocrlf false

鍦?#37832;?#37734;?#37724;?#28000;g爜搴?#28051;兘淇?#37923;機RLF?#32029;鏃犺?#31750;ull?#32341;?#27128;push?#20824;涓?#37721;橈紝浠g爜搴?#28000;涔?#37837;鳳紝鏈?#37734;拌繕?#27128;浠涔?#37837;峰瓙

褰撶劧鍦?#28598;?#27996;鸿法骞冲彴宸ヤ綔鏃跺欙紝鏈濂借繕?#27128;?#23475;瀹氫娇鐢↙F?#32029;?#32341;?#27128;CRLF?#32029;鐒跺悗涓?#37722;?#32495;荤粺杩?#29723;屽?#29808;?#26050;殑璁剧疆?#32029;?#32342;鏍锋槸宸ヤ綔瑙勮寖?#32029;涔熸湁鍒?#27996;?#37819;?#26946;?#23480;ヤ綔鏁?#37916;囷紝甯?#37832;?#28000;?#28051;?#37721;?#28000;?#29999;?#37716;?#28598;?#28729;?#37510;?/strong>



?#32148;鑰咃細sososun
閾炬帴?#32048;https://www.jianshu.com/p/dd7464cf32b5
鏉ユ簮?#32048;绠涔?br />绠涔﹁憲?#32148;鏉?#35120;掍綔鑰?#37813;鏈夛紝浠讳?#26334;舰寮忕殑杞?#26462;介兘璇疯仈绯讳綔鑰呰?#23792;?#26945;巿鏉?#39582;舵敞鏄?#37713;?#28598;?#37510;?/div>

]]>How to shuffle arrays and slices in Gohttp://www.2676208.com/wythern/archive/2019/01/17/216208.htmlwythernwythernThu, 17 Jan 2019 12:27:00 GMThttp://www.2676208.com/wythern/archive/2019/01/17/216208.htmlhttp://www.2676208.com/wythern/comments/216208.htmlhttp://www.2676208.com/wythern/archive/2019/01/17/216208.html#Feedback0http://www.2676208.com/wythern/comments/commentRss/216208.htmlhttp://www.2676208.com/wythern/services/trackbacks/216208.html鍦?#23005;?br />
鐢?#27996;?/a>Go?#30149;鏈?#28051;簊lice鎻愪緵shuffle鍑芥暟?#32029;鎵浠ラ渶瑕?#38007;?#23480;辨?#20914;?#28852;硶銆?#37922;?#27996;庢垜鍙渶瑕侀殢鏈?#28051;娆?#38316;?#37720;? -> N?#32029;鎵浠ヨ繖娈礳ode鏈鍖归厤銆?br />
func main() {
  vals := []int{10, 12, 14, 16, 18, 20}
  r := rand.New(rand.NewSource(time.Now().Unix()))
  for _, i := range r.Perm(len(vals)) {
    val := vals[i]
    fmt.Println(val)
  }
}

浼间箮go涓嶅儚scala鏈夐偅绉?#37807;版ф眰鍊肩殑鐗规э紝鎵浠ヨ繖閲岀殑r.Perm()?#32341;?#27128;浜?#37922;熶簡涓涓猻lice?#32029;濡傛灉N寰?#28598;?#37721;兘?#27128;涓棶棰?#37510;?br />




]]>go test 鐢╝rgs?#29995;鍙傛暟http://www.2676208.com/wythern/archive/2018/08/14/215845.htmlwythernwythernTue, 14 Aug 2018 09:04:00 GMThttp://www.2676208.com/wythern/archive/2018/08/14/215845.htmlhttp://www.2676208.com/wythern/comments/215845.htmlhttp://www.2676208.com/wythern/archive/2018/08/14/215845.html#Feedback0http://www.2676208.com/wythern/comments/commentRss/215845.htmlhttp://www.2676208.com/wythern/services/trackbacks/215845.html娴?#29831;?#28051;?#37807;抽?#26473;囧懡浠?#29723;?#28028;?#38315;?#28051;浜?#37721;傛暟缁檛est func?#32029;缃?#28051;?#37813;句簡涓浜涜祫鏂欎絾杩囩▼涓嶆槸寰堥『鍒╋紝?#32342;?#22135;璁?#35120;?#28051;涓?#37510;?/div>
棣?#37711;坓o test鏈?#28051;涓?args?#27537;鍙傛暟璇?#37721;?#28000;?#26440;惧埌杩欎釜鐩殑?#32029;浣?#28729;炴祴涓?#37833;?#37721;?#37916;?#37832;夋病鏈夋病鍖?#37714;?#37510;?#37510;?#37510;?/div>
google鏌ュ埌?#27537;澶?#38318;ㄥ垎涔熸槸鐢ㄥ埌?#31777;flag?#34987;鍨?#37510;?/div>
flag.go?#27537;娉?#38322;?#37712;欑殑?#30254;杈冩?#21614;
/*
    Package flag implements command-line flag parsing.

    Usage:

    Define flags using flag.String(), Bool(), Int(), etc.

    This declares an integer flag, -flagname, stored in the pointer ip, with type *int.
        import "flag"
        var ip = flag.Int("flagname", 1234, "help message for flagname")
    If you like, you can bind the flag to a variable using the Var() functions.
        var flagvar int
        func init() {
            flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname")
        }
    Or you can create custom flags that satisfy the Value interface (with
    pointer receivers) and couple them to flag parsing by
        flag.Var(&flagVal, "name", "help message for flagname")
    For such flags, the default value is just the initial value of the variable.

    After all flags are defined, call
        flag.Parse()
    to parse the command line into the defined flags.

*/
鍥?#23005;ら渶瑕佸?#27697;殑浜?#37807;?#28751;辨槸?#32048;
1. 瀹?#28052;塮lag?#32029;杩欎釜?#28214;瑕?#37734;╩ain()鎵?#29723;?#28052;嬪?#23941;?#23678;垚?#32029;鎴戣繖?#22135;鍦╰est鏂?#28000;堕?#23684;潰鐢?#37711;?#28766;鍙橀噺瀹屾垚?#32029;浣哸鍙?#28000;?#37824;?#37734;?#37713;芥暟閲岄潰銆?/div>
var (
    
// Define global args flags.
    pA = flag.Int("a"0,  "a.")
    a 
= 0
)
2. parse flag?#32029;杩欎釜瑕?#37734;╰est func鎵?#29723;?#28052;嬪墠?#32029;鎵浠?#37721;?#28000;?#38000;冭檻鍔?#37711;?#28051;涓猧nit()鍦╰est鏂?#28000;堕噷銆?/div>
func init() {
    flag.Parse()
    a 
= *pA
}
鍚庨潰?#23047;鐢?#26473;欎簺鍙橀噺灏辨病鏈夐棶棰樹簡?#32029;?#30254;濡傝繖鏍?/div>
func TestInit(t *testing.T) {
    flag.Parse()
    t.Log(
"a = ", a)
}
?#32342;?#22135;鐢ㄥ埌?#27537;涓?#29781;佹槸flag?#27537;鍔熻兘?#32029;娴?#29831;?#37922;?#37721;?#37916;?#37832;夋病鏈?args?#26870;棰?#28051;嶅ぇ?#32029;鎵浠?#26473;欎釜鐢ㄦ硶鍙兘涓嶆槸寰堢鍚坓o test?#27537;瑕佹眰?#32029;鍏?#37922;?#29863;?#37833;?#37712;?#29831;翠簡銆?/div>
REF
1. https://www.golangtc.com/t/584cbd16b09ecc2e1800000b
2. https://stackoverflow.com/.../process-command-line-arguments-in-go-test
3. https://hsulei.com/2017/08/23/gotest濡備綍?#23047;鐢?#38007;?#28729;?#28052;?#37721;傛暟/



]]>[杞琞shell涓璱f鏉?#28000;跺瓧绗?#28051;?#37510;?#37825;板?#26945;瘮瀵癸紝[[ ]]鍜孾 ]鍖?#37714;?/title><link>http://www.2676208.com/wythern/archive/2018/08/14/215844.html</link><dc:creator>wythern</dc:creator><author>wythern</author><pubDate>Tue, 14 Aug 2018 08:44:00 GMT</pubDate><guid>http://www.2676208.com/wythern/archive/2018/08/14/215844.html</guid><wfw:comment>http://www.2676208.com/wythern/comments/215844.html</wfw:comment><comments>http://www.2676208.com/wythern/archive/2018/08/14/215844.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.2676208.com/wythern/comments/commentRss/215844.html</wfw:commentRss><trackback:ping>http://www.2676208.com/wythern/services/trackbacks/215844.html</trackback:ping><description><![CDATA[<p style="margin: 10px auto; line-height: 1.5; text-indent: 0px; caret-color: #000000; color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">鍘?#37826;?a href="https://www.cnblogs.com/include/archive/2011/12/09/2307905.html">鍦?#23005;?/a><br /></p><p style="margin: 10px auto; line-height: 1.5; text-indent: 0px; caret-color: #000000; color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">瀛?#28052;爏hell?#27537;鏃跺?#37804;绘槸琚玸hell閲岀殑鏉?#28000;跺垽鏂?#37826;?#23534;忔?#28850;緱澶寸柤?#32029;?#31905;甯?#28051;?#37933;?#38316;?#37824;?鐢╗],[[]],(())?#32341;?#27128;test,let?#32029;鑰屽緢灏?#37832;?#28052;?#37814;?#28729;?#28000;殑鍏?#32495;?#29825;?#29785;g殑寰堟?#21614;(搴?#29831;ユ槸鎴戞?#29112;?#23480;?#37812;栨槸鐪?#28052;?#28598;?#28751;??#32029;浠?#28598;?#37804;荤粨涓涓嬶紝鍩虹?#27537;涓滆タ濡?#28729;?#28000;??#27537;?#23047;鐢?#37826;规硶涓嶅啀璧?#26473;帮紝閲嶇偣璇磋瀹?#28000;殑鍖?#37714;殑?#23047;鐢?#37827;跺簲璇?#23049;ㄦ剰?#27537;鍦?#37826;?#37510;?br /><br />鍏堣[]鍜宼est?#32029;涓?#38000;呮槸涓鏍风殑?#32029;鍦?#37723;?#28000;?#29723;岄噷test expr鍜孾 expr ]?#27537;鏁堟?#28357;浉鍚?#37510;倀est?#27537;涓?#28051;?#37737;?#37832;綔鐢ㄦ槸鍒?#37826;?#37826;?#28000;?#37510;?#37714;?#37826;?#28699;?#32471;?#28051;?#37510;?#37714;?#37826;暣鏁?#37510;?#37824;?#37816;佷娇鐢?#28051;庢?#26669;潪灏?#29723;?#26440;?#23534;?#26473;炴帴璧?#37833;?#37510;?#29781;?#23049;ㄦ剰?#27537;鏈夛細<br /><br />1.test涓?#37721;?#37922;ㄧ殑?#30254;杈?#26473;?#32480;?#32471;?#37721;?#37832;?=鍜?=?#32029;涓?#38000;呴兘?#27128;鐢?#27996;庡瓧绗?#28051;叉瘮杈冪殑?#32029;涓?#37721;?#37922;?#27996;庢暣鏁版瘮杈冿紝?#26275;鏁版瘮杈?#37721;兘?#23047;鐢?eq, -gt?#32342;绉嶅舰寮?#37510;?#37827;犺?#28888;槸瀛?#32471;?#28051;叉瘮杈冭繕?#27128;?#26275;鏁版瘮杈冮兘鍗?#28051;?#28051;?#29781;佷娇鐢?#28598;?#27996;?#37721;?#28751;?#27996;?#37721;?#37510;?#35120;撶?#35769;紝濡傛灉浣?#28729;?#37734;?#37807;?#37922;?#28052;熸槸鍙?#28000;ョ殑?#32029;瀵逛?#24225;瓧绗?#28051;叉瘮杈?#37721;?#28000;ヤ娇鐢?#28751;栨嫭鍙风殑杞?#28052;?#35120;?#23534;忥紝 濡傛灉?#30254;杈?ab"鍜?bc"?#32048;[ ab \< bc ]?#32029;缁撴灉涓虹湡?#32029;涔?#28751;辨槸杩?#37733;炵姸鎬?#28051;?.<br /><br />鐒跺?#24226;槸[[ ]]?#32029;?#32342;?#27128;鍐呯疆鍦╯hell涓殑涓涓?#37723;?#28000;わ紝瀹?#28751;辨瘮鍒氭墠璇寸殑test寮?#28598;х殑澶氫簡銆?#37824;?#37816;佸瓧绗?#28051;茬殑妯?#23534;?#37718;归厤锛堜娇鐢?~鎿嶄綔绗?#37827;?#37922;?#38007;?#37824;?#37816;乻hell?#27537;姝?#37714;?#29723;?#26440;?寮?#38171;?#37510;?#32480;鐩?#23534;?#28598;х殑浠?#27996;?#37721;戞寚锛侀?#26440;?#32513;?#37722;?#37721;?#28000;?#28051;嶄娇鐢╰est?#27537;-a,-o鑰屼娇鐢?amp;&,||?#32342;鏍?#37831;?#27996;?#37714;囩殑褰?#23534;?閽?#28725;筩銆丣ava绋?#25652;?#37723;?銆?#35120;?鐒讹紝涔?#28051;?#37922;?#37807;崇殑澶?#28598;?#37833;傦紝鍩?#37832;?#37721;?#29781;?#29825;?#28003;?br />1.瀛?#32471;?#28051;叉瘮杈?#37827;跺彲浠?#37814;?#37721;宠?#22317;殑?#32148;涓?#28051;涓?#22959;?#23534;?#38171;堣繖?#27128;鍙宠?#22317;殑瀛?#32471;?#28051;?#28051;嶅姞鍙屽紩鍙风殑鎯呭喌涓?#37510;?#28641;傛灉鍙宠?#22317;殑瀛?#32471;?#28051;?#37716;犱簡鍙屽紩鍙鳳紝鍒?#29825;?#28051;烘槸涓涓?#37826;?#37832;?#28699;?#32471;?#28051;?#37510;?#38171;夛紝鑰?#28051;?#28000;?#28000;呮槸涓涓?#28699;?#32471;?#28051;詫紝?#30254;濡俒[ hello == hell? ]]?#32029;缁撴灉涓虹湡銆?/p><p style="margin: 10px auto; line-height: 1.5; text-indent: 0px; caret-color: #000000; color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">鍙?#28598;栬娉ㄦ剰?#27537;?#27128;?#32029;?#23047;鐢╗]鍜孾[]]?#27537;鏃跺欎笉瑕?#37722;濆暚绌烘牸?#32029;姣?#28051;椤?#28051;?#26440;归兘瑕?#37832;夌?#28888;牸?#32029;[[ 1 == 2 ]]?#27537;缁撴灉涓?#8220;鍋?#8221;?#32029;浣哰[ 1==2 ]]?#27537;缁撴灉涓?#8220;?#28257;”锛?#37722;?#28051;绉?#37828;剧?#33333;槸閿欑殑</p><p style="margin: 10px auto; line-height: 1.5; text-indent: 0px; caret-color: #000000; color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;"><br />3.鏈鍚?#28751;辨槸let鍜?())?#32029;涓?#38000;?#28052;熸槸涓鏍风殑(鎴?#38000;?#29831;?#37737;?#37832;?#28051;婃槸涓鏍风殑?#32029;鍙屾嫭鍙锋瘮let绋?#23534;?#28051;浜?銆?#28051;?#29781;?#26473;?#29723;?#32480;?#37832;?#26473;?#32480;?涓婇潰?#27537;涓?#28051;兘涓?#29723;??#32029;涔熸瘮杈?#38315;?#37722;?#26473;?琛屾暣鏁版瘮杈冿紝鍙?#28000;?#37929;存帴?#23047;鐢?#37908;熸?#22796;殑<,>绛夋瘮杈?#26473;?#32480;?#32471;?#37510;?#37721;?#28000;?#37929;存帴?#23047;鐢?#37721;橀噺鍚嶅?#20482;ar鑰?#28051;嶉渶瑕?var?#32342;鏍风殑褰?#23534;?#37510;?#37824;?#37816;佸垎鍙烽殧寮?#27537;澶?#28051;?#29723;?#26440;?#23534;?/p><img src ="http://www.2676208.com/wythern/aggbug/215844.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.2676208.com/wythern/" target="_blank">wythern</a> 2018-08-14 16:44 <a href="http://www.2676208.com/wythern/archive/2018/08/14/215844.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>涓寮?#37733;句簡瑙?#37711;?#38334;?#37724;岀閾?/title><link>http://www.2676208.com/wythern/archive/2018/08/01/215813.html</link><dc:creator>wythern</dc:creator><author>wythern</author><pubDate>Wed, 01 Aug 2018 06:05:00 GMT</pubDate><guid>http://www.2676208.com/wythern/archive/2018/08/01/215813.html</guid><wfw:comment>http://www.2676208.com/wythern/comments/215813.html</wfw:comment><comments>http://www.2676208.com/wythern/archive/2018/08/01/215813.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.2676208.com/wythern/comments/commentRss/215813.html</wfw:commentRss><trackback:ping>http://www.2676208.com/wythern/services/trackbacks/215813.html</trackback:ping><description><![CDATA[<div><img src="https://cdn-images-1.medium.com/max/1600/0*s0QUH2j9SAetBKQv." alt="" longdesc="private_and_public_chain" /><img src="http://www.2676208.com/images/cppblog_com/wythern/0_x2A_s0QUH2j9SAetBKQv..png" alt="" longdesc="private_and_public_chain" /></div><div>鍥剧墖鏉ユ簮?#32048;https://blog.slock.it/public-vs-private-chain-7b7ca45044f</div><img src ="http://www.2676208.com/wythern/aggbug/215813.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.2676208.com/wythern/" target="_blank">wythern</a> 2018-08-01 14:05 <a href="http://www.2676208.com/wythern/archive/2018/08/01/215813.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>Full go tool list (keep constructing)http://www.2676208.com/wythern/archive/2018/07/21/215794.htmlwythernwythernSat, 21 Jul 2018 06:09:00 GMThttp://www.2676208.com/wythern/archive/2018/07/21/215794.htmlhttp://www.2676208.com/wythern/comments/215794.htmlhttp://www.2676208.com/wythern/archive/2018/07/21/215794.html#Feedback0http://www.2676208.com/wythern/comments/commentRss/215794.htmlhttp://www.2676208.com/wythern/services/trackbacks/215794.html
go get github.com/golang/lint/golint
go get github.com/kisielk/errcheck
go get golang.org/x/tools/cmd/benchcmp
go get github.com/cespare/prettybench
go get github.com/ajstarks/svgo/benchviz
go get golang.org/x/tools/cmd/stringer
go get github.com/josharian/impl
go get golang.org/x/tools/cmd/goimports
go get sourcegraph.com/sqs/goreturns
go get code.google.com/p/rog-go/exp/cmd/godef
go get github.com/nsf/gocode
go get golang.org/x/tools/cmd/oracle
go get golang.org/x/tools/cmd/gorename
go get github.com/kisielk/godepgraph


]]>Some materials about RPC transaction call.http://www.2676208.com/wythern/archive/2018/07/14/215784.htmlwythernwythernSat, 14 Jul 2018 09:00:00 GMThttp://www.2676208.com/wythern/archive/2018/07/14/215784.htmlhttp://www.2676208.com/wythern/comments/215784.htmlhttp://www.2676208.com/wythern/archive/2018/07/14/215784.html#Feedback0http://www.2676208.com/wythern/comments/commentRss/215784.htmlhttp://www.2676208.com/wythern/services/trackbacks/215784.html

Introduction


How to test.




]]>What is shade jar, and what is its purpose.http://www.2676208.com/wythern/archive/2017/06/19/215009.htmlwythernwythernMon, 19 Jun 2017 03:23:00 GMThttp://www.2676208.com/wythern/archive/2017/06/19/215009.htmlhttp://www.2676208.com/wythern/comments/215009.htmlhttp://www.2676208.com/wythern/archive/2017/06/19/215009.html#Feedback0http://www.2676208.com/wythern/comments/commentRss/215009.htmlhttp://www.2676208.com/wythern/services/trackbacks/215009.html

https://stackoverflow.com/questions/13620281/what-is-the-maven-shade-plugin-used-for-and-why-would-you-want-to-relocate-java


Uber JAR, in short, is a JAR containing everything.

Normally in Maven, we rely on dependency management. An artifact contains only the classes/resources of itself. Maven will be responsible to find out all artifacts (JARs etc) that the project depending on when the project is built.

An uber-jar is something that take all dependencies, and extract the content of the dependencies and put them with the classes/resources of the project itself, in one big JAR. By having such uber-jar, it is easy for execution, because you will need only one big JAR instead of tons of small JARs to run your app. It also ease distribution in some case.

Just a side-note. Avoid using uber-jar as Maven dependency, as it is ruining the dependency resolution feature of Maven. Normally we create uber-jar only for the final artifact for actual deployment or for manual distribution, but not for putting to Maven repository.


Update: I have just discovered I haven't answered one part of the question : "What's the point of renaming the packages of the dependencies?". Here is some brief updates and hopefully will help people having similar question.

Creating uber-jar for ease of deployment is one use case of shade plugin. There are also other common use cases which involve package renaming.

For example, I am developing Foo library, which depends on a specific version (e.g. 1.0) of Bar library. Assuming I cannot make use of other version of Bar lib (because API change, or other technical issues, etc). If I simply declare Bar:1.0 as Foo's dependency in Maven, it is possible to fall into a problem: A Qux project is depending on Foo, and also Bar:2.0 (and it cannot use Bar:1.0 because Qux needs to use new feature in Bar:2.0). Here is the dilemma: should Qux use Bar:1.0 (which Qux's code will not work) or Bar:2.0 (which Foo's code will not work)?

In order to solve this problem, developer of Foo can choose to use shade plugin to rename its usage of Bar, so that all classes in Bar:1.0 jar are embedded in Foo jar, and the package of the embedded Bar classes is changed from com.bar to com.foo.bar. By doing so, Qux can safely depends on Bar:2.0 because now Foo is no longer depending on Bar, and it is using is own copy of "altered" Bar located in another package.



]]>[Collection] Spark partition related things.http://www.2676208.com/wythern/archive/2017/05/18/214946.htmlwythernwythernThu, 18 May 2017 06:29:00 GMThttp://www.2676208.com/wythern/archive/2017/05/18/214946.htmlhttp://www.2676208.com/wythern/comments/214946.htmlhttp://www.2676208.com/wythern/archive/2017/05/18/214946.html#Feedback0http://www.2676208.com/wythern/comments/commentRss/214946.htmlhttp://www.2676208.com/wythern/services/trackbacks/214946.htmlUnderstanding:
1. https://www.dezyre.com/article/how-data-partitioning-in-spark-helps-achieve-more-parallelism/297
2. http://dev.sortable.com/spark-repartition/ -- example of partition & repartition to avoid data-imbalance.
3. https://acadgild.com/blog/partitioning-in-spark/ -- real case on existing partitioner & self-created partitioner.

Programming guidence.
Avoid using GroupByKey https://databricks.gitbooks.io/databricks-spark-knowledge-base/content/best_practices/prefer_reducebykey_over_groupbykey.html

Reference 1 says: Applying transformations that return RDDs with specific partitioners. Some operation on RDDs that hold to and propagate a partitioner are-
  • Join
  • LeftOuterJoin
  • RightOuterJoin
  • groupByKey
  • reduceByKey
  • foldByKey
  • sort
  • partitionBy
  • foldByKey
groupByKey is one of them, My understanding is such operations may cause extra shuffle, but repartition also helps relieve data imbalance if well considered, so use head please! :)


]]>ubuntu switch window in current workspace.http://www.2676208.com/wythern/archive/2017/04/17/214859.htmlwythernwythernMon, 17 Apr 2017 02:21:00 GMThttp://www.2676208.com/wythern/archive/2017/04/17/214859.htmlhttp://www.2676208.com/wythern/comments/214859.htmlhttp://www.2676208.com/wythern/archive/2017/04/17/214859.html#Feedback0http://www.2676208.com/wythern/comments/commentRss/214859.htmlhttp://www.2676208.com/wythern/services/trackbacks/214859.html
[ref]https://unix.stackexchange.com/questions/171964/restrict-alttab-to-the-current-workspace-in-gnome-3

]]> 探灵笔记系统攻略
内蒙古时时票软件 山东时时开奖视频直播 秒速赛计划网页 三d开机号和试机号今今天 东方6+1开奖 福建体彩22大星走势图 手机棋牌万能透视软件 时时彩超级计划王 新时时中奖方法 天津时时彩手机开奖