C++博客-++wythern++ http://598club.com/wythern/X presents Y for a better Zzh-cnFri, 21 Feb 2020 09:42:31 GMTFri, 21 Feb 2020 09:42:31 GMT60C++博客-++wythern++ http://598club.com/wythern/archive/2019/11/28/217004.htmlwythern)????????returnData??subscribe??????????????????????????????????????????draft???




wythern 2019-11-28 18:13 ???????o
]]>
C++博客-++wythern++ http://598club.com/wythern/archive/2019/03/27/216318.htmlwythern

江苏快三开奖结果???????git????o????????????????????????????????????a????????????a?????????a?????1?o??????-????????????o???????????????????'??a???????????????1?o????????????o??????????????????????????????o?????????????????????????a???????????????oo?????????'???????????????CRLF???LF???????a

CRLF LF CR ?????????1??????????

  • CRLF: ???carriagereturnlinefeed??????????????-????????????????|????????

  • LF: ???line feed??????????????-????????????????????

  • CR: ???carriagereturn??????????????-????????????????|???

??????????????????|??o????1?????????o???1??????????????????3?????o????????3?????1??'???????-???

?????????mac?3?????????CR???????????????????1??2?????????????o?LF

Unix(?????????????????????linux)?3?????????LF

江苏快三开奖结果windows?3?????????LFCR???????????????a????a???????????1???????????

?1??-?????????o???????3???????????-????????oo??????????????????????????????????????'????o?????????????o??????????

???3??1?3????

Android Studio??????????????????????????????????????????setting-->????'?code style??????????





















???????????

江苏快三开奖结果?????-????????a???1System-Dependent LF CR CRLF?????????System-Dependent????1???????1?????????????1??3?????????????1??????????|??????3|??a????1?????????????????????????????????????o????????????1????????????????1???

???|??????3???????????1?????a??????????????????1???????????3?????????????1?????????????

???????????1?????a??????

跨?13????????????????????3??1??????

??????????????git?o?????o?????????????????????????oo??????????mac??????????oo?????linux??????????oo?????windows?????????????????????????|???????????????a??3?????????1??????????????1??????????????????????????????o???'?????1??????o????????2???????|????????????'??

???1????3???????????1?????????core.autocrlf?????

江苏快三开奖结果git??o?o??2?-??????????????1跨?13??????????????????????????????????????LF???CRLF

????????????o???

  • git config --global core.autocrlf true


Git???????????push????a?????????????????|CRLF????????LF???????pull????????????LF????????CRLF?????core.autocrlf??????????-?1?????????|?????????Windows?3????????????????????????true???????????-???o????????????LF?????????????CRLF

  • git config --global core.autocrlf input

江苏快三开奖结果Linux???Mac?3?????????LF?????o??????????|???????????a???CRLF??o??????????|??????????????????????????????????????3????????-???????core.autocrlf????????input???????? Git ??push??????CRLF????????LF???pull???????????

  • git config --global core.autocrlf false

江苏快三开奖结果?????????????????o???-????????CRLF???????opull?????push??????????????????o?????1????????????????????1????-?

???????????oo跨?13????????????????????????????o|????????LF????????CRLF????????????????3??????????1?o???????????????????????????????1????????o???????????????????????????????????????????????????



????????sososun
????????http://www.jianshu.com/p/dd7464cf32b5
????o????????1|
????1|??????????????????????????????????????????????????3?????????????????1??3?????o?????


wythern 2019-03-27 13:29 ???????o
]]>
C++博客-++wythern++ http://598club.com/wythern/archive/2019/01/17/216208.htmlwythernGo?2??????oslice??????shuffle????????????????|??a???3????3???????o??????a??|?????o???????????1 -> N??????????????code?????1?????
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)
  }
}

????1?go??????scala?????????????????????1??????????????????r.Perm()??????o????o??????aslice????|????N??????????????a???????





wythern 2019-01-17 20:27 ???????o
]]>
C++博客-++wythern++ http://598club.com/wythern/archive/2018/08/14/215845.htmlwythernwythernTue, 14 Aug 2018 09:04:00 GMThttp://598club.com/wythern/archive/2018/08/14/215845.htmlhttp://598club.com/wythern/comments/215845.htmlhttp://598club.com/wythern/archive/2018/08/14/215845.html#Feedback0http://598club.com/wythern/comments/commentRss/215845.htmlhttp://598club.com/wythern/services/trackbacks/215845.html???????-??3????????????????????o?????????test func?????????????o?????o???????????????????????o???????????????????????
|????go test????????a-args?????????'??????????????a?????????????????????????????????2?????2???o????????????
google??????????????1?????????o?flag????????
flag.go????3???????????????????
/*
    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.

*/
????-??|????????o???????????
1. ????1?flag???????a??|???main()?????1??????????????????????test?????????????????????????????????a???????????????????????
var (
    
// Define global args flags.
    pA = flag.Int("a"0,  "a.")
    a 
= 0
)
2. parse flag???????a|???test func?????1??????????????????????????????????ainit()??test???????????
func init() {
    flag.Parse()
    a 
= *pA
}
?????????????o????????2?????????o????????|?????
func TestInit(t *testing.T) {
    flag.Parse()
    t.Log(
"a = ", a)
}
??????????????|????flag???????????????????????????2????-args?????????????????????a???3?????????????????|???go test???|???????????????????'?o????
REF
1. http://www.golangtc.com/t/584cbd16b09ecc2e1800000b
2. http://stackoverflow.com/.../process-command-line-arguments-in-go-test
3. http://hsulei.com/2017/08/23/gotest?|??????????a????1??????/



wythern 2018-08-14 17:04 ???????o
]]>
C++博客-++wythern++ http://598club.com/wythern/archive/2018/08/14/215844.htmlwythern

?-|?1?shell?????????????????shell???????????????-??1??????????'??????????????????????1 ??[],[[]],(())?????test,let??????????????1|??????????????3?3??2?????????????(?o??????????????????????????1|?a??)?????????????????????????o????????????|??????? ??????????1?3?????????????????1?'?'???????????o???????????????o????3??????????1???

????'[]???test????????????????????????????????test expr???[ expr ]??????????????????test????????a??o???????????????-?????????????-?-???|??2???????-??'????????????????????????????????????????????|??3????????????

1.test??-????????????????????|??a???==???!=???????????????o??-???|??2????????????????????o???'????????????'?????????a???????-eq, -gt?????????????????o????-???|??2????????????'??????????????????|????????o??????o????????????????|??????????????3???1??????????????????1?o??-???|??2?????????????????????????????1?????????? ?|?????????"ab"???"bc"???[ ab \< bc ]???????????o???????1??????????????????o0.

?????????[[ ]]????????????????shell??-????????a??????????????????????'???test??o???????o???????????-???|??2??????????1??????????=~????????|???????3??????shell????-??????? ??????????????'??o???????oo?????????????????????????????????test???-a,-o???????&&,||??????'?o2????????????(????1c???Java???o????)?????? ???????1????????3????a??????????o?????a|?????
1.?-???|??2???????????????????3?1????????o?????a???????????????3?1????-???|??2??????????????????????????????|??????3?1????-???|??2????o??????????????????o????????a???????-???|??2????????????????????????????a?-???|??2???????|?[[ hello == hell? ]]???????????o??????

??|??|??3?????????????????[]???[[]]????????????|?????????o?????????????1???1??|??????o??????[[ 1 == 2 ]]???????????o“???”??????[[ 1==2 ]]???????????o“???”?????????????????????????


3.??????????let???(())????????1????????????(??????'??o???????????????????????????????let????????o?)??????|????????????????(????????????a???????)????1????????????? ????'??????????????????'?????????????????<,>?-?????????????|???????????'?????????????????|?var???????|?$var???????????????????????????????????????a??????



wythern 2018-08-14 16:44 ???????o
]]>
C++博客-++wythern++ http://598club.com/wythern/archive/2018/08/01/215813.htmlwythernwythernWed, 01 Aug 2018 06:05:00 GMThttp://598club.com/wythern/archive/2018/08/01/215813.htmlhttp://598club.com/wythern/comments/215813.htmlhttp://598club.com/wythern/archive/2018/08/01/215813.html#Feedback0http://598club.com/wythern/comments/commentRss/215813.htmlhttp://598club.com/wythern/services/trackbacks/215813.html
??????????o????http://blog.slock.it/public-vs-private-chain-7b7ca45044f


wythern 2018-08-01 14:05 ???????o
]]>
C++博客-++wythern++ http://598club.com/wythern/archive/2018/07/21/215794.htmlwythernwythernSat, 21 Jul 2018 06:09:00 GMThttp://598club.com/wythern/archive/2018/07/21/215794.htmlhttp://598club.com/wythern/comments/215794.htmlhttp://598club.com/wythern/archive/2018/07/21/215794.html#Feedback0http://598club.com/wythern/comments/commentRss/215794.htmlhttp://598club.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


wythern 2018-07-21 14:09 ???????o
]]>
C++博客-++wythern++ http://598club.com/wythern/archive/2018/07/14/215784.htmlwythernwythernSat, 14 Jul 2018 09:00:00 GMThttp://598club.com/wythern/archive/2018/07/14/215784.htmlhttp://598club.com/wythern/comments/215784.htmlhttp://598club.com/wythern/archive/2018/07/14/215784.html#Feedback0http://598club.com/wythern/comments/commentRss/215784.htmlhttp://598club.com/wythern/services/trackbacks/215784.html

Introduction

Solidiay doc about ABI and contract access.
http://solidity.readthedocs.io/en/develop/abi-spec.html
http://solidity.readthedocs.io/en/latest/introduction-to-smart-contracts.html?highlight=selfdestruct
http://www.ethdocs.org/en/latest/contracts-and-transactions/accessing-contracts-and-transactions.html
http://ethdocs.org/en/latest/contracts-and-transactions/contracts.html#testing-contracts-and-transactions
http://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=suicide [global variables like msg.sender]
ABI intro in Ethereum Wiki.
http://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI#argument-encoding
http://github.com/ethereum/go-ethereum/wiki/Contract-Tutorial
JAON rpc api of Eth.
http://github.com/ethereum/wiki/wiki/JSON-RPC#json-rpc-api
http://github.com/ethereum/wiki/wiki/JavaScript-API#contract-methods
Deploy a contract using RPC.
http://github.com/rsksmart/rskj/wiki/Deploying-contracts-using-RPC-calls
A tool to generate the grpc server code for a contract
http://github.com/getamis/grpc-contract

How to test.

http://ethereum-tests.readthedocs.io/en/latest/test_types/transaction_tests.html
http://github.com/ethereum/cpp-ethereum/blob/develop/doc/generating_tests.rst
go-ethereum????????????1vm???contract?????3???tests?????????ABI???contract???????1???????????????1??????????????1?a?????????????????????web3js???????'?????go project??????????????????



wythern 2018-07-14 17:00 ???????o
]]>
C++博客-++wythern++ http://598club.com/wythern/archive/2017/06/19/215009.htmlwythernwythernMon, 19 Jun 2017 03:23:00 GMThttp://598club.com/wythern/archive/2017/06/19/215009.htmlhttp://598club.com/wythern/comments/215009.htmlhttp://598club.com/wythern/archive/2017/06/19/215009.html#Feedback0http://598club.com/wythern/comments/commentRss/215009.htmlhttp://598club.com/wythern/services/trackbacks/215009.html

http://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.



wythern 2017-06-19 11:23 ???????o
]]>
C++博客-++wythern++ http://598club.com/wythern/archive/2017/05/18/214946.htmlwythernwythernThu, 18 May 2017 06:29:00 GMThttp://598club.com/wythern/archive/2017/05/18/214946.htmlhttp://598club.com/wythern/comments/214946.htmlhttp://598club.com/wythern/archive/2017/05/18/214946.html#Feedback0http://598club.com/wythern/comments/commentRss/214946.htmlhttp://598club.com/wythern/services/trackbacks/214946.htmlUnderstanding:
1. http://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. http://acadgild.com/blog/partitioning-in-spark/ -- real case on existing partitioner & self-created partitioner.

Programming guidence.
Avoid using GroupByKey http://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! :)


wythern 2017-05-18 14:29 ???????o
]]>