├── x.md
├── c
├── sds
│ ├── sdstest.c
│ ├── .gitignore
│ ├── sds.h.gch
│ └── Makefile
├── implicit_convertion
│ ├── compare.py
│ ├── compare.php
│ └── compare.c
├── encapsulation
│ ├── point.h
│ ├── main.c
│ └── point.c
├── pidtest.c
├── limit.c
├── null_equal.c
├── setlinebuf.c
├── c11
│ └── noreturn.c
└── devrandom.c
├── go
├── black_magic
│ ├── a.s
│ └── linkname.go
├── offheap
│ └── main.go
├── concurrent
│ └── readme.md
├── syscall
│ ├── test.dat
│ └── file.dat
├── unicorn
│ └── readme.md
├── buffer_chain
│ └── buf_test.go
├── file
│ ├── list_all_file.go
│ ├── merged
│ ├── get_file_list.go
│ ├── filetest.go
│ └── read_all.go
├── flow_based
│ ├── foo.txt
│ └── foo.bar
├── gopsutil
│ ├── .gitignore
│ └── go.mod
├── left_recursion_detect
│ └── main.go
├── deepl
│ └── md.md
├── double_buffer
│ └── readme.md
├── redis
│ ├── readme.md
│ └── redisTest.php
├── builtin
│ ├── readme.md
│ ├── str.go
│ └── slice.go
├── peg
│ └── readme.md
├── encrypt
│ └── readme.md
├── gomod
│ ├── vendor
│ │ └── github.com
│ │ │ ├── cch123
│ │ │ ├── elasticsql
│ │ │ │ ├── .gitignore
│ │ │ │ └── glide.yaml
│ │ │ └── gomodexp
│ │ │ │ └── esutil
│ │ │ │ └── main.go
│ │ │ └── xwb1989
│ │ │ └── sqlparser
│ │ │ ├── .gitignore
│ │ │ └── CONTRIBUTORS.md
│ ├── main.go
│ └── go.mod
├── lock
│ ├── redlock.go
│ └── local_lock.go
├── dataStructs
│ ├── typeEqualTest
│ │ ├── a
│ │ │ └── sss.go
│ │ └── typetest.go
│ ├── complextest.go
│ ├── arrtest.go
│ ├── annoymous_struct.go
│ ├── listtest.go
│ └── maptest.go
├── elasticsearch
│ ├── elastic.go
│ └── elasticsql_example.go
├── map
│ ├── readme.md
│ ├── isMapOrdered.go
│ ├── range.go
│ └── structmap.go
├── pipe
│ └── pipe
├── string
│ ├── alloc_or_not_alloc
│ │ ├── readme.md
│ │ └── a_test.go
│ ├── joinAndConcatBench
│ │ └── readme.md
│ ├── split_and_same_under_array
│ │ ├── readme.md
│ │ └── ben_test.go
│ ├── convert.go
│ ├── replaceTest.go
│ ├── splintN.go
│ ├── searchStr.go
│ ├── replaceNums.go
│ ├── b.go
│ ├── hasPrefix.go
│ ├── string_display_same_but_not_euqal.go
│ └── splitTest.go
├── error
│ ├── juju_err
│ │ └── juju_err.go
│ ├── internal_err.go
│ ├── pkg_err
│ │ └── printf.go
│ └── err_print.go
├── panic
│ ├── readme.md
│ ├── panic_or_not.go
│ ├── panic_recover_and_return.go
│ └── before_1-9-2-bug.go
├── runtime
│ ├── monitor
│ │ └── memstats.go
│ ├── forloopinline.go
│ ├── gotoolobjdump.go
│ ├── inline.go
│ └── runtimeCaller.go
├── asm
│ ├── func_call
│ │ ├── readme.md
│ │ ├── call.go
│ │ └── call.s
│ ├── control_flow
│ │ └── m.go
│ ├── leaq_test
│ │ └── a.go
│ ├── refer_to_global_var_in_go_file
│ │ ├── a.go
│ │ └── a.s
│ ├── where_is_fp_sp
│ │ ├── where.go
│ │ └── where.s
│ ├── hardware_or_virtual
│ │ ├── where.go
│ │ └── where.s
│ ├── is_frame_pointer_on_stack_value_equal_to_directive_FP
│ │ ├── global.go
│ │ └── global.s
│ ├── goid
│ │ ├── goid_amd64.s
│ │ ├── goid.go
│ │ └── go_tls.h
│ ├── local_var.go
│ ├── global
│ │ └── global.go
│ ├── registers_test
│ │ └── r.go
│ ├── basic_math_ops
│ │ └── math.go
│ ├── relative_pos_of_FP_and_SP
│ │ └── global.go
│ └── what_is_struct_in_asm
│ │ └── t.s
├── memmap
│ ├── demo.jpg
│ └── memmap.go
├── gc
│ ├── pre-collect-problem
│ │ └── readme.md
│ └── readme.md
├── go1.13
│ ├── deferproc
│ ├── deferstack.go
│ └── deferproc.go
├── unsafe
│ └── readme.md
├── escape_analysis
│ ├── a.o
│ └── a.go
├── goroutine
│ ├── nilfuncgo.go
│ ├── goForPrint.go
│ ├── goroutinetest.go
│ ├── channelmakeandchannelnotmake.go
│ ├── goroutine.go
│ ├── chantest.go
│ └── channel.go
├── ringbuffer
│ └── readme.md
├── json
│ ├── ffjsontest.go
│ ├── ffjs.go
│ └── djsontest.go
├── circular_dependency
│ ├── main.go
│ ├── a
│ │ └── a.go
│ └── b
│ │ └── b.go
├── dependency-experiment
│ ├── interface_based
│ │ ├── order_service.go
│ │ └── user_service.go
│ ├── nested_struct_based
│ │ ├── order_service.go
│ │ ├── price_service.go
│ │ ├── user_service.go
│ │ └── main.go
│ ├── injection_based
│ │ └── codis.go
│ └── func_based
│ │ └── test_funcs.go
├── flowControl
│ ├── strtest.go
│ ├── typetest.go
│ ├── defertest.go
│ ├── addaddtest.go
│ ├── for.go
│ ├── gototest.go
│ └── panictest.go
├── mapexpr
│ └── readme.md
├── os
│ ├── pidtest.go
│ ├── net_proc.go
│ ├── ostest.go
│ ├── sysinfo.go
│ └── test
│ │ └── www_test.go
├── ast
│ ├── .vscode
│ │ └── settings.json
│ ├── example.go.bakk
│ ├── example.go
│ ├── example.go.bak2
│ └── example2.go
├── comparable
│ └── str.go
├── grpc
│ ├── readme.md
│ └── hello.proto
├── import_cycle
│ ├── break_cycle
│ │ ├── action
│ │ │ └── act.go
│ │ ├── item
│ │ │ └── item.go
│ │ └── character
│ │ │ └── cha.go
│ └── original
│ │ ├── character
│ │ └── cha.go
│ │ ├── item
│ │ └── item.go
│ │ └── action
│ │ └── action.go
├── linux_processes
│ ├── pidtest.go
│ └── ppidtest.go
├── html-to-markdown
│ └── go.mod
├── trace
│ ├── readme.md
│ └── trace.go
├── test_fail_in_1.13
│ ├── lib_test.go
│ └── lib.go
├── test_with_tags
│ ├── m_test.go
│ ├── readme.md
│ ├── production.go
│ ├── test_fakes.go
│ └── m.go
├── gdb
│ └── t.go
├── goyacc
│ ├── prac
│ │ └── parse.y
│ └── readme.md
├── version
│ └── v.go
├── http
│ ├── panic
│ │ └── readme.md
│ ├── http2
│ │ └── readme.md
│ ├── httpclient.go
│ └── handlerLeak.go
├── snowflake
│ ├── maxInt.go
│ └── snow.go
├── channel
│ ├── writeToClosedChannel.go
│ └── channelLen.go
├── types
│ ├── intConvert.go
│ └── aliasTypeConvert.go
├── array
│ └── array2.go
├── atomic_bench
│ ├── atomic.go
│ └── atomic_test.go
├── race
│ ├── g_test.go
│ ├── g.go
│ └── g2.go
├── unicode
│ ├── utest.go
│ └── encod.go
├── pprof
│ ├── readme.md
│ ├── pprof.go
│ └── producer_consumer_test.go
├── interface
│ ├── readme.md
│ ├── multi_instance.go
│ ├── interfaceReflect.go
│ └── inter.go
├── uuidtest
│ ├── uselib
│ │ ├── util.go
│ │ └── uuid_test.go
│ └── useUUIDGEN
│ │ ├── util.go
│ │ └── uuid_test.go
├── assert
│ ├── bench
│ │ └── assert_test.go
│ └── assert.go
├── cryptoBench
│ ├── md4
│ │ ├── md4_test.go
│ │ └── md4.go
│ └── sha1
│ │ ├── sha1_test.go
│ │ └── sha1.go
├── epoll
│ ├── easygo
│ │ ├── go.mod
│ │ └── go.sum
│ └── evio
│ │ └── evio.go
├── pool
│ └── redigo_with_pool
│ │ ├── Godeps
│ │ └── Readme
│ │ └── vendor
│ │ └── golang.org
│ │ └── x
│ │ └── net
│ │ ├── AUTHORS
│ │ └── CONTRIBUTORS
├── rand
│ └── 1.go
├── badcode
│ └── badcode.go
├── math
│ ├── nan.go
│ ├── accurance.go
│ └── rand.go
├── thrift
│ ├── GoUnusedProtection__.go
│ └── hello.thrift
├── concurrent_map_write_iter
│ └── readme.md
├── crawler
│ └── z.go
├── raft
│ ├── hashicorp
│ │ └── main.go
│ └── hashicorp.go
├── flag
│ └── parse.go
├── full_chan.go
├── gocyclo.go
├── slice
│ ├── reverse.go
│ ├── merge_slices.go
│ ├── append_when_under_array_has_capacity.go
│ ├── del_elem.go
│ ├── nil_and_empty_slice.go
│ └── nil_slice_empty_slice.go
├── gopacket
│ └── readme.md
├── reflect
│ ├── struct_type.go
│ ├── zero_is_what.go
│ ├── reflecttest.go
│ ├── time_type.go
│ └── field_offset.go
├── strconv
│ └── formatFloat.go
├── suffix
│ └── main.go
├── atomic
│ └── uber_atomic.go
├── errcheck
│ └── errcheck.go
├── line_feed.go
├── algorithm
│ └── leetcode
│ │ ├── 1
│ │ └── 1_test.go
│ │ ├── 344.go
│ │ ├── 387.go
│ │ ├── 27.go
│ │ └── 561.go
├── internal
│ ├── copytest2.go
│ └── copytest.go
├── expand
│ ├── readme.md
│ ├── slice.go
│ ├── channel.go
│ └── map.go
├── goevaluate
│ └── m.go
├── 1.9
│ └── syncMap.go
├── time
│ └── timeunmarshal.go
├── future
│ └── panic_or_not.go
├── receiver
│ ├── pointer_rec.go
│ └── normal.go
├── 1.8
│ └── db.go
├── hex
│ └── decode.go
├── closure
│ ├── closure.go
│ └── closure2.go
├── sync
│ └── structLock.go
├── net
│ ├── iptest.go
│ └── sockettest.go
├── pkgerror
│ └── demo.go
├── beanstalkDemo
│ └── producer.go
├── interface_unmsarshal.go
├── broadcast
│ └── src
│ │ └── main.go
├── dirty_part
│ └── nil_receiver.go
├── dlv.go
└── params
│ └── demo.go
├── go_web
├── echo.go
├── gin
│ └── templates
│ │ └── index.tmpl
├── form
│ └── ben_test.go
├── readme.md
├── martini.go
└── chi_with_doc.go
├── syscall
├── what_is_fork.md
├── what_is_mmap.md
├── what_is_backlog.md
├── what_is_malloc.md
└── what_is_sendfile.md
├── scala
├── rdd
│ └── rdd.txt
├── readme.md
├── lists
│ ├── create_from_range.scala
│ ├── reduce_list.scala
│ ├── short_hand.scala
│ ├── use_paren.scala
│ ├── immutable.scala
│ ├── nil_compare.scala
│ ├── access_by_position.scala
│ ├── head_tail.scala
│ ├── fold_left.scala
│ ├── list.scala
│ ├── tail_reuse.scala
│ └── list_methods.scala
├── map
│ └── basic_def.scala
├── spark
│ └── test.scala
├── object.scala
├── object_is_singleton.scala
├── lambda
│ ├── lambda.scala
│ ├── returning_annoymous_function.scala
│ ├── returning_function.scala
│ └── closure2.scala
└── tuple
│ └── tuple.scala
├── js
├── node_modules
│ └── fibers
│ │ ├── bin
│ │ ├── .npmignore
│ │ ├── darwin-ia32-v8-3.14
│ │ │ └── fibers.node
│ │ ├── darwin-x64-v8-3.14
│ │ │ └── fibers.node
│ │ ├── linux-ia32-v8-3.14
│ │ │ └── fibers.node
│ │ ├── linux-x64-v8-3.14
│ │ │ └── fibers.node
│ │ ├── win32-ia32-v8-3.14
│ │ │ └── fibers.node
│ │ └── win32-x64-v8-3.14
│ │ │ └── fibers.node
│ │ ├── .npmignore
│ │ ├── test
│ │ ├── illegal-yield.js
│ │ ├── bad-context.js
│ │ ├── started.js
│ │ ├── finish-multiple.js
│ │ ├── process-title.js
│ │ ├── already-running.js
│ │ ├── current.js
│ │ ├── stack-overflow.js
│ │ ├── unwind.js
│ │ └── pool.js
│ │ ├── quick-test.js
│ │ └── src
│ │ └── libcoro
│ │ └── README
├── test3.js
├── thistest.js
├── test.js
├── intervaltest.js
├── test2.js
├── closure2.js
├── timeouttest.js
├── segmentfault.js
├── generator.js
└── sleep.js
├── python
├── guolele
│ ├── guolele
│ │ ├── __init__.py
│ │ ├── items.pyc
│ │ ├── __init__.pyc
│ │ ├── settings.pyc
│ │ ├── spiders
│ │ │ ├── __init__.pyc
│ │ │ ├── guolele_spider.pyc
│ │ │ └── __init__.py
│ │ └── pipelines.py
│ └── scrapy.cfg
├── for_range.py
├── otp.py
├── dict_init.py
├── get_cpu.py
├── timedelta.py
├── osArgs.py
└── checkAll.py
├── design_patterns
├── Go
│ └── readme.md
├── Rust
│ └── readme.md
└── readme.md
├── readme.md
├── rust
├── rocket_complete_project
│ ├── src
│ │ ├── conf
│ │ │ ├── db.toml
│ │ │ ├── etcd.toml
│ │ │ ├── redis.toml
│ │ │ └── ratelimit.toml
│ │ ├── config
│ │ │ └── mod.rs
│ │ ├── logic
│ │ │ └── mod.rs
│ │ ├── model
│ │ │ └── mod.rs
│ │ ├── controller
│ │ │ ├── mod.rs
│ │ │ ├── order.rs
│ │ │ └── user.rs
│ │ └── init.rs
│ ├── build.rs
│ └── Cargo.toml
├── programming_rust
│ └── ch1
│ │ ├── hello
│ │ ├── target
│ │ │ └── rls
│ │ │ │ └── debug
│ │ │ │ ├── .cargo-lock
│ │ │ │ ├── .fingerprint
│ │ │ │ └── hello-361a3be39b79a777
│ │ │ │ │ ├── bin-hello-361a3be39b79a777
│ │ │ │ │ ├── dep-bin-hello-361a3be39b79a777
│ │ │ │ │ └── bin-hello-361a3be39b79a777.json
│ │ │ │ ├── libhello.d
│ │ │ │ └── deps
│ │ │ │ └── hello-361a3be39b79a777.d
│ │ ├── src
│ │ │ └── main.rs
│ │ ├── Cargo.lock
│ │ └── Cargo.toml
│ │ ├── gcd
│ │ ├── Cargo.lock
│ │ └── Cargo.toml
│ │ ├── cmd_args
│ │ ├── Cargo.lock
│ │ └── Cargo.toml
│ │ └── web-sum
│ │ └── Cargo.toml
├── rust_programming_lang
│ ├── .gitignore
│ └── guess_num
│ │ └── Cargo.toml
├── ngx_rs
│ ├── src
│ │ └── main.rs
│ └── Cargo.toml
├── future-impl
│ ├── simplefuture
│ │ ├── src
│ │ │ └── main.rs
│ │ └── Cargo.toml
│ ├── simple_poll
│ │ └── Cargo.toml
│ └── executor
│ │ ├── src
│ │ └── main.rs
│ │ └── Cargo.toml
├── rust_book
│ ├── ch2
│ │ ├── helloworld.rs
│ │ └── cargo
│ │ │ └── hello_world
│ │ │ ├── src
│ │ │ └── main.rs
│ │ │ └── Cargo.toml
│ └── ch1
│ │ ├── borrow_twice.rs
│ │ └── clone.rs
├── box_linklist
│ ├── Cargo.lock
│ └── Cargo.toml
├── lifetime_test
│ ├── Cargo.lock
│ └── Cargo.toml
├── assoc3
│ ├── readme.md
│ ├── Cargo.lock
│ └── Cargo.toml
├── read_from_stdin
│ ├── readme.md
│ ├── src
│ │ └── main.rs
│ └── Cargo.toml
├── refcell_linklist
│ ├── Cargo.lock
│ └── Cargo.toml
├── module_test
│ ├── src
│ │ ├── array.rs
│ │ ├── inner
│ │ │ ├── go.rs
│ │ │ └── mod.rs
│ │ ├── main.rs
│ │ └── list.rs
│ └── Cargo.toml
├── print_file_and_line
│ ├── src
│ │ └── main.rs
│ ├── Cargo.lock
│ └── Cargo.toml
├── thrift_test
│ ├── src
│ │ └── main.rs
│ └── Cargo.toml
├── csv_parser
│ ├── numbers.csv
│ ├── src
│ │ └── csv.pest
│ └── Cargo.toml
├── proc_macro_workshop
│ ├── src
│ │ ├── debug.rs
│ │ └── easy.rs
│ └── Cargo.toml
├── assoc
│ ├── Cargo.lock
│ └── Cargo.toml
├── pest_test
│ ├── .idea
│ │ ├── encodings.xml
│ │ ├── vcs.xml
│ │ ├── modules.xml
│ │ └── misc.xml
│ ├── Cargo.toml
│ └── src
│ │ └── ident.pest
├── assoc2
│ ├── Cargo.lock
│ └── Cargo.toml
├── box_arr
│ ├── Cargo.lock
│ ├── Cargo.toml
│ └── src
│ │ └── main.rs
├── closure
│ ├── Cargo.lock
│ └── Cargo.toml
├── flat_map
│ ├── Cargo.lock
│ └── Cargo.toml
├── hashmap
│ ├── Cargo.lock
│ └── Cargo.toml
├── rustyline_test
│ ├── .idea
│ │ ├── encodings.xml
│ │ ├── vcs.xml
│ │ ├── modules.xml
│ │ └── misc.xml
│ └── Cargo.toml
├── traits
│ ├── Cargo.lock
│ ├── Cargo.toml
│ └── src
│ │ └── main.rs
├── combine
│ └── demo
│ │ ├── Cargo.toml
│ │ └── src
│ │ └── main.rs
├── partial_eq
│ ├── Cargo.lock
│ └── Cargo.toml
├── phantomdata
│ ├── Cargo.lock
│ └── Cargo.toml
├── maplit
│ ├── .vscode
│ │ └── settings.json
│ └── Cargo.toml
├── nom
│ └── basic
│ │ ├── Cargo.toml
│ │ └── readme.md
├── elastic_test
│ ├── Cargo.toml
│ └── src
│ │ └── main.rs
├── expr_test
│ └── Cargo.toml
├── serdejson_test
│ └── Cargo.toml
├── 1.40
│ └── non_exhaustive
│ │ ├── a
│ │ ├── src
│ │ │ └── lib.rs
│ │ └── Cargo.toml
│ │ └── b
│ │ ├── src
│ │ └── main.rs
│ │ └── Cargo.toml
├── reqwest
│ └── example
│ │ └── Cargo.toml
├── iter
│ ├── Cargo.toml
│ └── src
│ │ └── main.rs
├── 1.42
│ └── hello
│ │ └── Cargo.toml
├── 1.43
│ └── hello
│ │ └── Cargo.toml
├── prec_climber_test
│ └── Cargo.toml
├── astd_load_test
│ └── Cargo.toml
├── httparse
│ └── Cargo.toml
├── loop_time_and_mul_threads_join
│ └── Cargo.toml
├── lazy_static
│ └── Cargo.toml
├── rock_test
│ └── Cargo.toml
├── actix
│ └── actix_test
│ │ └── Cargo.toml
├── load_test
│ └── Cargo.toml
├── net2_test
│ └── Cargo.toml
├── asyncstd
│ └── Cargo.toml
├── tokio_load_test
│ └── Cargo.toml
├── channel
│ └── Cargo.toml
├── mio_test
│ └── Cargo.toml
└── async_tcp_server
│ └── Cargo.toml
├── antlr_practise
├── .gitignore
├── expr
│ ├── t.expr
│ └── readme.md
├── calculator
│ └── t.expr
├── grammar_import
│ ├── readme.md
│ ├── CommonLexerRules.g4
│ └── LibExpr.g4
├── hello
│ └── Hello.g4
└── readme.md
├── php
├── exec_test.php
├── dump.rdb
├── acc_test.php
├── php_int_max.php
├── func_test.php
├── nowtest.php
├── sort.php
├── ISO8601.php
├── uniqid_test.php
├── arr_test2.php
├── explode_test.php
├── nodirect.php
├── implode_test.php
├── json_test.php
├── time_test2.php
├── ob_clean.php
├── timetest3.php
├── functest.php
├── pregreplace_test.php
├── array_unique.php
├── csvtest.php
├── mb_substr.php
├── equaltest.php
├── mobile.php
├── intstrtest.php
├── redis.php
├── accurance.php
├── array_slice.php
├── magic_test.php
├── datetest.php
├── redis_subtest.php
├── sprintftest.php
├── arr_test.php
├── unset_test.php
├── array_slice_test.php
├── array_combine_test.php
├── decode_test.php
├── coltest.php
├── fuck.php
├── copydata.php
├── array_column_test.php
└── multisort.php
├── .gitignore
├── uml
├── actor.png
├── activity.png
├── plantuml.jar
├── sequence.png
├── activity_icons.png
├── advanced_actor.png
├── advanced_activity.png
├── advanced_sequence.png
├── more_advanced_seq.png
├── more_advanced_activity.png
├── actor.txt
├── advanced_actor.txt
├── sequence.txt
├── advanced_sequence.txt
├── activity.txt
├── advanced_activity.txt
├── ufs.plantuml
└── activity_icons.txt
├── graphviz
└── psm.png
├── images
└── 5g war.png
├── shell
├── forloop.sh
├── simple_loop.sh
├── awk
│ ├── dat.txt
│ ├── test.awk
│ └── fix.sh
├── expect
└── download.sh
├── c++
├── memory_order
│ └── run.sh
├── project_template
│ ├── cpp
│ │ ├── Makefile
│ │ └── .vscode
│ │ │ └── tasks.json
│ └── .vscode
│ │ └── tasks.json
├── c++14
│ ├── nullptr.cpp
│ ├── rawstring.cpp
│ ├── map.cpp
│ ├── constptr.cpp
│ ├── rvalue.cpp
│ └── decltype.cpp
├── double.cpp
├── signal
│ ├── signal.cc
│ └── sigaction2.cc
├── goto.c
├── unordered_map.cpp
└── parent.cpp
├── os
├── chapter_4
│ ├── readme.md
│ ├── func_call.c
│ └── more_than_7_params.c
├── chapter_3
│ └── practise
│ │ ├── aplusb.go
│ │ └── loop.s
└── chapter_2
│ ├── main.c
│ └── readme.md
├── rabbitmq
└── delivery_confirm
│ └── readme.md
├── elasticconfigs
└── elasticsearch2.0
│ ├── result_window.json
│ └── reindex.json
├── vscode_configs
└── readme.md
├── vagrant_files
├── uinit.sh
├── readme.md
├── bootstrap.sh
└── init.sh
├── net
├── programming
│ ├── tcpip
│ │ └── ch7
│ │ │ └── readme.md
│ └── readme.md
└── same_port
│ └── same_port_outgoing_connections.py
├── github_icons
└── show.md
├── ch.go
└── gomod
└── main.go
/x.md:
--------------------------------------------------------------------------------
1 | ddf
2 |
--------------------------------------------------------------------------------
/c/sds/sdstest.c:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/go/black_magic/a.s:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/go/offheap/main.go:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/go_web/echo.go:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/go/concurrent/readme.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/go/syscall/test.dat:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/go/unicorn/readme.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/syscall/what_is_fork.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/syscall/what_is_mmap.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/go/buffer_chain/buf_test.go:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/go/file/list_all_file.go:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/syscall/what_is_backlog.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/syscall/what_is_malloc.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/syscall/what_is_sendfile.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/c/sds/.gitignore:
--------------------------------------------------------------------------------
1 | sds-test
2 |
--------------------------------------------------------------------------------
/go/flow_based/foo.txt:
--------------------------------------------------------------------------------
1 | foo
2 |
--------------------------------------------------------------------------------
/go/gopsutil/.gitignore:
--------------------------------------------------------------------------------
1 | vendor
2 |
--------------------------------------------------------------------------------
/go/left_recursion_detect/main.go:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/scala/rdd/rdd.txt:
--------------------------------------------------------------------------------
1 | 10 1 x
2 |
--------------------------------------------------------------------------------
/js/node_modules/fibers/bin/.npmignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/python/guolele/guolele/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/design_patterns/Go/readme.md:
--------------------------------------------------------------------------------
1 | Go dir
2 |
--------------------------------------------------------------------------------
/design_patterns/Rust/readme.md:
--------------------------------------------------------------------------------
1 | Rust dir
2 |
--------------------------------------------------------------------------------
/js/test3.js:
--------------------------------------------------------------------------------
1 | var x
2 | console.log(x)
3 |
--------------------------------------------------------------------------------
/go/deepl/md.md:
--------------------------------------------------------------------------------
1 | # abc
2 |
3 | sdfadf
4 |
5 |
--------------------------------------------------------------------------------
/go/double_buffer/readme.md:
--------------------------------------------------------------------------------
1 | # Overview
2 |
3 |
--------------------------------------------------------------------------------
/go/flow_based/foo.bar:
--------------------------------------------------------------------------------
1 | resultforreplacefoo
2 |
--------------------------------------------------------------------------------
/go/redis/readme.md:
--------------------------------------------------------------------------------
1 | go run -race redis-go.go
2 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/rust/rocket_complete_project/src/conf/db.toml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/rust/rocket_complete_project/src/conf/etcd.toml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/rust/rocket_complete_project/src/conf/redis.toml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/go/builtin/readme.md:
--------------------------------------------------------------------------------
1 | go run -gcflags "-N -l" xxx.go
--------------------------------------------------------------------------------
/rust/rocket_complete_project/src/conf/ratelimit.toml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/rust/rocket_complete_project/src/config/mod.rs:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/rust/rocket_complete_project/src/logic/mod.rs:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/rust/rocket_complete_project/src/model/mod.rs:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/scala/readme.md:
--------------------------------------------------------------------------------
1 | 运行脚本:
2 |
3 | scala xxxx.scala
4 |
--------------------------------------------------------------------------------
/antlr_practise/.gitignore:
--------------------------------------------------------------------------------
1 | */.antlr/*
2 | *.go
3 | *.tokens
4 |
--------------------------------------------------------------------------------
/go/peg/readme.md:
--------------------------------------------------------------------------------
1 | peglint -ast -s '1 + 2 + 32' ./grammar.peg
2 |
--------------------------------------------------------------------------------
/js/node_modules/fibers/.npmignore:
--------------------------------------------------------------------------------
1 | build/
2 | node_modules/
3 |
--------------------------------------------------------------------------------
/php/exec_test.php:
--------------------------------------------------------------------------------
1 | 1,
4 | 'dd' => 2
5 | ];
6 | print_r($arr);
7 |
--------------------------------------------------------------------------------
/rust/lifetime_test/Cargo.lock:
--------------------------------------------------------------------------------
1 | [[package]]
2 | name = "lifetime_test"
3 | version = "0.1.0"
4 |
5 |
--------------------------------------------------------------------------------
/rust/programming_rust/ch1/gcd/Cargo.lock:
--------------------------------------------------------------------------------
1 | [[package]]
2 | name = "gcd"
3 | version = "0.1.0"
4 |
5 |
--------------------------------------------------------------------------------
/rust/programming_rust/ch1/hello/src/main.rs:
--------------------------------------------------------------------------------
1 | fn main() {
2 | println!("Hello, world!");
3 | }
4 |
--------------------------------------------------------------------------------
/go/asm/leaq_test/a.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | func run() int
4 | func main() {
5 | println(run())
6 | }
7 |
--------------------------------------------------------------------------------
/go/json/ffjsontest.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | type Person struct {
4 | name string
5 | age int
6 | }
7 |
--------------------------------------------------------------------------------
/go_web/gin/templates/index.tmpl:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{ .title }}
4 |
5 |
6 |
--------------------------------------------------------------------------------
/php/explode_test.php:
--------------------------------------------------------------------------------
1 | skip;
5 |
--------------------------------------------------------------------------------
/c/pidtest.c:
--------------------------------------------------------------------------------
1 | #include "unistd.h"
2 |
3 | int main() {
4 | printf("%d\n", getpid());
5 | return 0;
6 | }
7 |
--------------------------------------------------------------------------------
/go/ast/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | // Place your settings in this file to overwrite default and user settings.
2 | {
3 | }
--------------------------------------------------------------------------------
/go/comparable/str.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | func main() {
4 | var a string
5 | a = "abc"
6 | a = a + "def"
7 | }
8 |
--------------------------------------------------------------------------------
/go/dependency-experiment/nested_struct_based/order_service.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | type orderService struct{}
4 |
--------------------------------------------------------------------------------
/go/string/split_and_same_under_array/readme.md:
--------------------------------------------------------------------------------
1 | go test -bench=. -benchmem
2 |
3 | strings.Replace is a disaster!
4 |
--------------------------------------------------------------------------------
/php/ob_clean.php:
--------------------------------------------------------------------------------
1 | res
2 | ~/t/g/trace ❯❯❯ go tool trace -http=0.0.0.0:8888 ./res
3 |
4 |
--------------------------------------------------------------------------------
/php/functest.php:
--------------------------------------------------------------------------------
1 | murphy: 爱和引力可以穿越
6 | @enduml
7 |
--------------------------------------------------------------------------------
/vscode_configs/readme.md:
--------------------------------------------------------------------------------
1 | you need to set this to true first
2 |
3 | > gocode close
4 |
5 | > gocode set unimported-packages true
6 |
--------------------------------------------------------------------------------
/go/goyacc/prac/parse.y:
--------------------------------------------------------------------------------
1 | %{
2 | package main
3 | import (
4 | "fmt"
5 | "text/scanner"
6 | )
7 |
8 | type Expression struct {}
9 | %}
--------------------------------------------------------------------------------
/go/import_cycle/break_cycle/item/item.go:
--------------------------------------------------------------------------------
1 | package item
2 |
3 | type Item struct {
4 | Name string
5 | Actions []action.Action
6 | }
7 |
--------------------------------------------------------------------------------
/go/version/v.go:
--------------------------------------------------------------------------------
1 | package main
2 | import "runtime"
3 | import "fmt"
4 |
5 | func main() {
6 | fmt.Println(runtime.Version())
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/os/chapter_3/practise/aplusb.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | func main() {
4 | var a = 1
5 | var b = 2
6 | var c = a + b
7 | println(c)
8 | }
9 |
--------------------------------------------------------------------------------
/php/array_unique.php:
--------------------------------------------------------------------------------
1 | 1, 'y' => 2],
4 | ['x' => 1, 'y' => 2],
5 | ['x' => 1, 'y' => 2],
6 | ];
7 |
--------------------------------------------------------------------------------
/python/guolele/guolele/spiders/guolele_spider.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cch123/test/HEAD/python/guolele/guolele/spiders/guolele_spider.pyc
--------------------------------------------------------------------------------
/go/ast/example.go.bakk:
--------------------------------------------------------------------------------
1 | package lp
2 |
3 | var a = 1
4 |
5 | const a = 1
6 |
7 | type p struct {
8 | }
9 |
10 | func main() {
11 | }
12 |
--------------------------------------------------------------------------------
/go/builtin/str.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | func p(s string) {
4 | panic(1)
5 | }
6 |
7 | func main() {
8 | var s = "hello"
9 | p(s)
10 | }
11 |
--------------------------------------------------------------------------------
/go/gomod/vendor/github.com/cch123/elasticsql/glide.yaml:
--------------------------------------------------------------------------------
1 | package: github.com/cch123/elasticsql
2 | import:
3 | - package: github.com/xwb1989/sqlparser
4 |
--------------------------------------------------------------------------------
/go/test_fail_in_1.13/lib.go:
--------------------------------------------------------------------------------
1 | package lib
2 |
3 | import "flag"
4 |
5 | func init() {
6 | flag.Parse()
7 | }
8 |
9 | func Yes() {
10 | }
11 |
--------------------------------------------------------------------------------
/go/test_with_tags/readme.md:
--------------------------------------------------------------------------------
1 | # how to test with tags and mock your function when test
2 |
3 | ```shell
4 | go test
5 |
6 | go test -tags=test
7 | ```
--------------------------------------------------------------------------------
/rust/rust_book/ch1/borrow_twice.rs:
--------------------------------------------------------------------------------
1 | fn main() {
2 | let mut x = vec!["hello", "world"];
3 | let y = &x[0];
4 | x.push("anyway");
5 | }
6 |
--------------------------------------------------------------------------------
/rust/rust_book/ch1/clone.rs:
--------------------------------------------------------------------------------
1 | fn main() {
2 | let mut x = vec!["hello", "world"];
3 | let y = x[0].clone();
4 | x.push("anyway");
5 | }
6 |
--------------------------------------------------------------------------------
/shell/awk/dat.txt:
--------------------------------------------------------------------------------
1 | 32323423423123
2 | 32323423423103
3 | 32323423423112
4 | 32323423423143
5 | 32323423423153
6 | 32323423423113
7 | 32323423423112
8 |
--------------------------------------------------------------------------------
/c/implicit_convertion/compare.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | int main() {
5 | printf("%d\n", 4 < '2');
6 | return 0;
7 | }
8 |
--------------------------------------------------------------------------------
/go/file/merged:
--------------------------------------------------------------------------------
1 | {"from" : 0,"size" : 15,"query" : {"bool": {"must" : [{"term" : {"phone" : "1866666666"}}]}},"sort" : [{"id" : "desc"}],"highlight" : {}}
2 |
--------------------------------------------------------------------------------
/go/snowflake/maxInt.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "math"
6 | )
7 |
8 | func main() {
9 | fmt.Println(math.MaxInt64)
10 | }
11 |
--------------------------------------------------------------------------------
/php/mb_substr.php:
--------------------------------------------------------------------------------
1 | 100, "A" -> 1)
2 |
3 | val myMap2 = Map(("a" ,1), ("b",2))
4 |
5 | println(myMap)
6 | println(myMap2)
7 |
--------------------------------------------------------------------------------
/go/asm/refer_to_global_var_in_go_file/a.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | var a = 999
4 |
5 | func get() int
6 |
7 | func main() {
8 | println(get())
9 | }
10 |
--------------------------------------------------------------------------------
/go/builtin/slice.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | func p(s []int) {
4 | panic(1)
5 | }
6 |
7 | func main() {
8 | var s = []int{1, 2, 3}
9 | p(s)
10 | }
11 |
--------------------------------------------------------------------------------
/go/channel/writeToClosedChannel.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | func main() {
4 | var a = make(chan int, 4)
5 | close(a)
6 | // 直接panic,思考一下why
7 | a <- 4
8 | }
9 |
--------------------------------------------------------------------------------
/go/types/intConvert.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 |
5 | func main() {
6 | var a int64 = 1
7 | var b = int32(a)
8 | fmt.Println(b)
9 | }
10 |
--------------------------------------------------------------------------------
/js/node_modules/fibers/bin/darwin-ia32-v8-3.14/fibers.node:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cch123/test/HEAD/js/node_modules/fibers/bin/darwin-ia32-v8-3.14/fibers.node
--------------------------------------------------------------------------------
/js/node_modules/fibers/bin/darwin-x64-v8-3.14/fibers.node:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cch123/test/HEAD/js/node_modules/fibers/bin/darwin-x64-v8-3.14/fibers.node
--------------------------------------------------------------------------------
/js/node_modules/fibers/bin/linux-ia32-v8-3.14/fibers.node:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cch123/test/HEAD/js/node_modules/fibers/bin/linux-ia32-v8-3.14/fibers.node
--------------------------------------------------------------------------------
/js/node_modules/fibers/bin/linux-x64-v8-3.14/fibers.node:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cch123/test/HEAD/js/node_modules/fibers/bin/linux-x64-v8-3.14/fibers.node
--------------------------------------------------------------------------------
/js/node_modules/fibers/bin/win32-ia32-v8-3.14/fibers.node:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cch123/test/HEAD/js/node_modules/fibers/bin/win32-ia32-v8-3.14/fibers.node
--------------------------------------------------------------------------------
/js/node_modules/fibers/bin/win32-x64-v8-3.14/fibers.node:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cch123/test/HEAD/js/node_modules/fibers/bin/win32-x64-v8-3.14/fibers.node
--------------------------------------------------------------------------------
/php/equaltest.php:
--------------------------------------------------------------------------------
1 | 15810540851,
4 | 'content' => '您的订单已经发货,请注意查收',
5 | );
6 | echo json_encode($x);
7 |
8 |
--------------------------------------------------------------------------------
/rust/programming_rust/ch1/gcd/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "gcd"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 |
6 | [dependencies]
7 |
--------------------------------------------------------------------------------
/go/array/array2.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 |
5 | func main() {
6 | var a = [10]int{1, 3, 4}
7 | var b = a[2:4:5]
8 | fmt.Println(b)
9 | }
10 |
--------------------------------------------------------------------------------
/go/asm/refer_to_global_var_in_go_file/a.s:
--------------------------------------------------------------------------------
1 | #include "textflag.h"
2 |
3 | TEXT ·get(SB), NOSPLIT, $0-8
4 | MOVQ ·a(SB), AX
5 | MOVQ AX, ret+0(FP)
6 | RET
7 |
--------------------------------------------------------------------------------
/go/atomic_bench/atomic.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "sync/atomic"
4 |
5 | var a int64
6 |
7 | func atomicStore(i int) {
8 | atomic.StoreInt64(&a, int64(i))
9 | }
--------------------------------------------------------------------------------
/go/race/g_test.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "testing"
4 |
5 | func BenchCalc(b *testing.B) {
6 | for i := 0; i < b.N; i++ {
7 | calc()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/go/unicode/utest.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "unicode"
6 | )
7 |
8 | func main() {
9 | fmt.Println(unicode.IsDigit('2'))
10 | }
11 |
--------------------------------------------------------------------------------
/rust/csv_parser/src/csv.pest:
--------------------------------------------------------------------------------
1 | field = { (ASCII_DIGIT | "." | "-")+ }
2 | record = { field ~ ("," ~ field)* }
3 | file = { SOI ~ (record ~ ("\r\n" | "\n"))* ~ EOI }
4 |
--------------------------------------------------------------------------------
/rust/module_test/src/list.rs:
--------------------------------------------------------------------------------
1 | use crate::inner::go;
2 | pub(super) fn print() {
3 | println!("{}", "this is in module crate::list");
4 | go::print_gogo();
5 | }
--------------------------------------------------------------------------------
/rust/proc_macro_workshop/src/debug.rs:
--------------------------------------------------------------------------------
1 | #[macro_export]
2 | macro_rules! each_tt {
3 | () => {};
4 | ($_tt:tt $($rest:tt)*) => {each_tt!($($rest)*);};
5 | }
6 |
--------------------------------------------------------------------------------
/rust/programming_rust/ch1/hello/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "hello"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 |
6 | [dependencies]
7 |
--------------------------------------------------------------------------------
/vagrant_files/uinit.sh:
--------------------------------------------------------------------------------
1 | sudo pfctl -F all -f /etc/pf.conf >/dev/null 2>&1; echo "Removing Port Forwarding (80 => 8080)\nRemove Port Forwarding (443 => 4443)"
2 |
3 |
--------------------------------------------------------------------------------
/go/goyacc/readme.md:
--------------------------------------------------------------------------------
1 | https://zhuanlan.zhihu.com/p/34770765
2 |
3 | https://github.com/vitessio/vitess/blob/dbdb3a1d6c2075edac0e0f11b93a63668f6e4559/go/vt/sqlparser/sql.y
4 |
--------------------------------------------------------------------------------
/go/pprof/readme.md:
--------------------------------------------------------------------------------
1 | 只要简单的import _ "net/http/pprof"
2 |
3 | 然后就可以localhost:port/debug/pprof来看了
4 |
5 |
6 | // cpu gvz
7 | go tool pprof ../producer_consumer ./cpu.prof
8 |
--------------------------------------------------------------------------------
/js/node_modules/fibers/test/illegal-yield.js:
--------------------------------------------------------------------------------
1 | // gh-3
2 | var Fiber = require('fibers');
3 | try {
4 | Fiber.yield();
5 | } catch(err) {
6 | console.log('pass');
7 | }
8 |
--------------------------------------------------------------------------------
/php/intstrtest.php:
--------------------------------------------------------------------------------
1 | "]
5 |
6 | [dependencies]
7 |
--------------------------------------------------------------------------------
/go_web/form/ben_test.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "testing"
4 |
5 | func BenchmarkTest(b *testing.B) {
6 | for i := 0; i < b.N; i++ {
7 | test()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/rust/proc_macro_workshop/src/easy.rs:
--------------------------------------------------------------------------------
1 | #[macro_export] // macro_export 会把这个 macro export 到 crate:: 根部
2 | macro_rules! four {
3 | () => {
4 | 1 + 3
5 | };
6 | }
7 |
--------------------------------------------------------------------------------
/rust/rust_book/ch2/cargo/hello_world/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "hello_world"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 |
6 | [dependencies]
7 |
--------------------------------------------------------------------------------
/antlr_practise/readme.md:
--------------------------------------------------------------------------------
1 | build go target
2 | -----------
3 | https://github.com/antlr/antlr4/blob/master/doc/go-target.md
4 |
5 | ```
6 | antlr4 -Dlanguage=Go hello.g4
7 | ```
8 |
--------------------------------------------------------------------------------
/go/interface/readme.md:
--------------------------------------------------------------------------------
1 | go build -gcflags "-N -l" xxx.go
2 |
3 | gdb xxx
4 |
5 | l=>列出代码
6 |
7 | b `line_number` 列出行号
8 |
9 | r 运行程序,在断点处会自动停止
10 |
11 | i locals
12 |
--------------------------------------------------------------------------------
/go/uuidtest/uselib/util.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import uuid "github.com/satori/go.uuid"
4 |
5 | var u1 uuid.UUID
6 |
7 | func test() {
8 | u1 = uuid.NewV4()
9 | }
10 |
--------------------------------------------------------------------------------
/js/node_modules/fibers/test/bad-context.js:
--------------------------------------------------------------------------------
1 | var Fiber = require('fibers');
2 |
3 | try {
4 | Fiber.prototype.run.call(null);
5 | } catch (err) {
6 | console.log('pass');
7 | }
8 |
--------------------------------------------------------------------------------
/php/redis.php:
--------------------------------------------------------------------------------
1 | connect("127.0.0.1", 6379);
4 | $setRes = $redis->set("a",1);
5 | var_dump($connRes);
6 | var_dump($setRes);
7 |
--------------------------------------------------------------------------------
/rust/assoc/Cargo.lock:
--------------------------------------------------------------------------------
1 | # This file is automatically @generated by Cargo.
2 | # It is not intended for manual editing.
3 | [[package]]
4 | name = "assoc"
5 | version = "0.1.0"
6 |
7 |
--------------------------------------------------------------------------------
/rust/box_linklist/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "box_linklist"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 |
--------------------------------------------------------------------------------
/rust/lifetime_test/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "lifetime_test"
3 | version = "0.1.0"
4 | authors = ["xargin "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 |
--------------------------------------------------------------------------------
/rust/pest_test/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/go/asm/func_call/call.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import _ "strconv"
4 |
5 | func callOther() string
6 |
7 | func main() {
8 | x := callOther()
9 | println(x, len(x))
10 | }
11 |
--------------------------------------------------------------------------------
/go/assert/bench/assert_test.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "testing"
4 |
5 | func BenchmarkAssert(b *testing.B) {
6 | for i := 0; i < b.N; i++ {
7 | asx()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/go/cryptoBench/md4/md4_test.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "testing"
4 |
5 | func BenchmarkUUID(b *testing.B) {
6 | for i := 0; i < b.N; i++ {
7 | test()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/go/cryptoBench/sha1/sha1_test.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "testing"
4 |
5 | func BenchmarkSHA1(t *testing.B) {
6 | for i := 0; i < t.N; i++ {
7 | test()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/go/epoll/easygo/go.mod:
--------------------------------------------------------------------------------
1 | module easygo
2 |
3 | go 1.14
4 |
5 | require (
6 | github.com/mailru/easygo v0.0.0-20190618140210-3c14a0dc985f
7 | golang.org/x/sys v0.1.0 // indirect
8 | )
9 |
--------------------------------------------------------------------------------
/go/uuidtest/useUUIDGEN/util.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "os/exec"
4 |
5 | var uuid []byte
6 |
7 | func test() {
8 | uuid, _ = exec.Command("uuidgen").Output()
9 | }
10 |
--------------------------------------------------------------------------------
/go/uuidtest/uselib/uuid_test.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "testing"
4 |
5 | func BenchmarkUUID(b *testing.B) {
6 | for i := 0; i < b.N; i++ {
7 | test()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/php/accurance.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/rust/traits/Cargo.lock:
--------------------------------------------------------------------------------
1 | # This file is automatically @generated by Cargo.
2 | # It is not intended for manual editing.
3 | [[package]]
4 | name = "generics"
5 | version = "0.1.0"
6 |
7 |
--------------------------------------------------------------------------------
/scala/lists/nil_compare.scala:
--------------------------------------------------------------------------------
1 | val a: List[String] = Nil
2 | val b: List[Int] = Nil
3 |
4 | a == Nil
5 | a eq Nil
6 |
7 | b == Nil
8 | b eq Nil
9 |
10 | // 上面的比较全都是 true
11 |
--------------------------------------------------------------------------------
/go/flowControl/addaddtest.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | func main() {
4 | var x = 1
5 | x++
6 | println(x)
7 | //var y = x++ syntax error!
8 | //println(y++) syntax error!
9 | }
10 |
--------------------------------------------------------------------------------
/go/uuidtest/useUUIDGEN/uuid_test.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "testing"
4 |
5 | func BenchmarkUUID(b *testing.B) {
6 | for i := 0; i < b.N; i++ {
7 | test()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/rust/combine/demo/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "demo"
3 | version = "0.1.0"
4 | authors = ["xargin "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 | combine = "3.3.0"
--------------------------------------------------------------------------------
/rust/partial_eq/Cargo.lock:
--------------------------------------------------------------------------------
1 | # This file is automatically @generated by Cargo.
2 | # It is not intended for manual editing.
3 | [[package]]
4 | name = "partial_eq"
5 | version = "0.1.0"
6 |
7 |
--------------------------------------------------------------------------------
/rust/refcell_linklist/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "refcell_linklist"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 |
--------------------------------------------------------------------------------
/scala/lists/access_by_position.scala:
--------------------------------------------------------------------------------
1 | val a = List(1,2,3)
2 |
3 | a(0)
4 | a(2)
5 | a(5)
6 |
7 | // ??
8 | intercept[IndexOutOfBoundsException] {
9 | println(a(5))
10 | }
11 |
--------------------------------------------------------------------------------
/elasticconfigs/elasticsearch2.0/reindex.json:
--------------------------------------------------------------------------------
1 | {
2 | "source": {
3 | "index": "ark_callcenter"
4 | },
5 | "dest": {
6 | "index": "ark_callcenter_g_service_worksheet"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/go/import_cycle/original/action/action.go:
--------------------------------------------------------------------------------
1 | // Package action provides ...
2 | package action
3 |
4 | type Action struct {
5 | Names []string
6 | Action func(character.Character) int
7 | }
8 |
--------------------------------------------------------------------------------
/go/pool/redigo_with_pool/Godeps/Readme:
--------------------------------------------------------------------------------
1 | This directory tree is generated automatically by godep.
2 |
3 | Please do not edit.
4 |
5 | See https://github.com/tools/godep for more information.
6 |
--------------------------------------------------------------------------------
/go/string/convert.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 |
5 | func main() {
6 | fmt.Println(string("11"))
7 | fmt.Println(string('a'))
8 | fmt.Printf("%#v\n", string(49))
9 | }
10 |
--------------------------------------------------------------------------------
/rust/phantomdata/Cargo.lock:
--------------------------------------------------------------------------------
1 | # This file is automatically @generated by Cargo.
2 | # It is not intended for manual editing.
3 | [[package]]
4 | name = "phantomdata"
5 | version = "0.1.0"
6 |
7 |
--------------------------------------------------------------------------------
/c++/c++14/nullptr.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | using namespace std;
3 |
4 | int main() {
5 | int * p = nullptr;
6 | cout << "this is nullptr in c++14 " << p <男主角" as copper #99ff99
3 | actor "星际穿越的\n男主女儿" as murphy #red
4 |
5 | copper -[#orange]> murphy: 爱和引力可以穿越
6 | @enduml
7 |
--------------------------------------------------------------------------------
/c++/c++14/rawstring.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | using namespace std;
3 |
4 | int main() {
5 | string raw = R"(\\a\\wqbdadfdsfsdf\dfadf\df\s\df\)";
6 | cout << raw << endl;
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/go/circular_dependency/a/a.go:
--------------------------------------------------------------------------------
1 | package a
2 |
3 | import "../b"
4 |
5 | func Test() {
6 | b.FormatB()
7 | println("test a")
8 | }
9 |
10 | func FormatA() {
11 | println("format a")
12 | }
13 |
--------------------------------------------------------------------------------
/go/circular_dependency/b/b.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "../a"
4 |
5 | func Test() {
6 | a.FormatA()
7 | println("test b")
8 | }
9 |
10 | func FormatB() {
11 | println("format b")
12 | }
13 |
--------------------------------------------------------------------------------
/rust/nom/basic/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "basic"
3 | version = "0.1.0"
4 | authors = ["xargin "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 | nom = "4.2.0"
9 |
10 |
--------------------------------------------------------------------------------
/scala/lists/head_tail.scala:
--------------------------------------------------------------------------------
1 | // head headOption tail
2 | val a = List(1,2,3)
3 | // 注意这两个的区别,scala里的Option是支持为空的head的,但不带option的可能会抛异常
4 | a.head
5 | a.headOption
6 | // tail没有tailOption之类的东西
7 | a.tail
8 |
--------------------------------------------------------------------------------
/scala/spark/test.scala:
--------------------------------------------------------------------------------
1 | import org.apache.spark.sql.hive.HiveContext
2 |
3 | val hiveCtx = new HiveContext(sc)
4 |
5 | val studentRDD = hiveCtx.sql("select * from test.user").rdd
6 |
7 | studentRDD
8 |
9 |
--------------------------------------------------------------------------------
/antlr_practise/grammar_import/CommonLexerRules.g4:
--------------------------------------------------------------------------------
1 | lexer grammar CommonLexerRules; // 注意开头的 lexer grammar
2 |
3 | ID : [a-zA-Z]+;
4 | INT : [0-9]+;
5 | NEWLINE:'\r'?'\n';
6 | WS : [ \t]+ -> skip; // 丢弃空白字符
7 |
--------------------------------------------------------------------------------
/c/null_equal.c:
--------------------------------------------------------------------------------
1 | #include "stdio.h"
2 | #include "stdlib.h"
3 |
4 | int main() {
5 | char * x = NULL;
6 | void * a = x;
7 | int c = a == x? 1:0;
8 | printf("%d",c);
9 | }
10 |
11 |
12 |
--------------------------------------------------------------------------------
/go/asm/hardware_or_virtual/where.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 |
5 | func where() (int, int, int, int)
6 |
7 | func main() {
8 | a, b, c, d := where()
9 | fmt.Println(a, b, c, d)
10 | }
11 |
--------------------------------------------------------------------------------
/go/rand/1.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "math/rand"
6 | )
7 |
8 | func main() {
9 | for i := 0; i < 1000; i++ {
10 | x := rand.Intn(10)
11 | fmt.Println(x)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/go/string/replaceTest.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "strings"
6 | )
7 |
8 | func main() {
9 | var a = `('a','b','c')`
10 | fmt.Println(strings.Replace(a, `'`, `"`, -1))
11 | }
12 |
--------------------------------------------------------------------------------
/js/node_modules/fibers/test/started.js:
--------------------------------------------------------------------------------
1 | // gh-12
2 | var Fiber = require('fibers');
3 | Fiber(function() {
4 | if (!Fiber.current.started) {
5 | throw new Error;
6 | }
7 | }).run();
8 | console.log('pass');
9 |
--------------------------------------------------------------------------------
/js/thistest.js:
--------------------------------------------------------------------------------
1 | var name = 'top name';
2 | function test() {
3 | var name = 'inner';
4 | console.log(this.name);
5 | }
6 | test()
7 | this.sayHi = test
8 | this.name = name
9 | console.log(this)
10 |
--------------------------------------------------------------------------------
/php/array_slice.php:
--------------------------------------------------------------------------------
1 | test();
10 |
--------------------------------------------------------------------------------
/rust/elastic_test/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "elastic_test"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 | elastic_query = "0.1.0"
9 |
--------------------------------------------------------------------------------
/rust/print_file_and_line/Cargo.lock:
--------------------------------------------------------------------------------
1 | # This file is automatically @generated by Cargo.
2 | # It is not intended for manual editing.
3 | [[package]]
4 | name = "print_file_and_line"
5 | version = "0.1.0"
6 |
7 |
--------------------------------------------------------------------------------
/rust/rustyline_test/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "rustyline_test"
3 | version = "0.1.0"
4 | authors = ["xargin "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 | rustyline = "3.0.0"
9 |
--------------------------------------------------------------------------------
/go/badcode/badcode.go:
--------------------------------------------------------------------------------
1 | if a {
2 | } else {
3 | if b {
4 | if c {
5 | } else {
6 | if d {
7 | } else {
8 | if e {
9 | } else {
10 | }
11 | }
12 | }
13 | } else {
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/go/error/internal_err.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "errors"
5 | "fmt"
6 | )
7 |
8 | func main() {
9 | err := errors.New("oh no")
10 | fmt.Println(err)
11 | fmt.Printf("%+v", err)
12 | }
13 |
--------------------------------------------------------------------------------
/go/math/nan.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "math"
6 | )
7 |
8 | func main() {
9 | n1 := math.NaN()
10 | n2 := math.NaN()
11 | fmt.Println(n1, n2)
12 | fmt.Println(n1 == n2)
13 | }
14 |
--------------------------------------------------------------------------------
/go/string/splintN.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "strings"
6 | )
7 |
8 | func main() {
9 | var a = "abc@def@gh"
10 | res := strings.SplitN(a, "@", 2)
11 | fmt.Println(res)
12 | }
13 |
--------------------------------------------------------------------------------
/go/thrift/GoUnusedProtection__.go:
--------------------------------------------------------------------------------
1 | // Autogenerated by Thrift Compiler (0.13.0)
2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
3 |
4 | package main
5 |
6 | var GoUnusedProtection__ int
7 |
--------------------------------------------------------------------------------
/js/node_modules/fibers/quick-test.js:
--------------------------------------------------------------------------------
1 | "use strict"
2 | var Fiber = require('./fibers');
3 | var fiber = Fiber(function() {
4 | process.stdout.write(Fiber.yield());
5 | });
6 | fiber.run();
7 | fiber.run('pass');
8 |
--------------------------------------------------------------------------------
/php/datetest.php:
--------------------------------------------------------------------------------
1 | strtotime('20151212')) {
6 | echo 'yes';
7 | }else {
8 | echo 'no';
9 | }
10 |
--------------------------------------------------------------------------------
/php/redis_subtest.php:
--------------------------------------------------------------------------------
1 | connect('127.0.0.1', 6379);
4 | $redis->subscribe(array("channel-1"), function($redis, $chan, $msg){
5 | echo $msg;
6 | });
7 |
--------------------------------------------------------------------------------
/rust/programming_rust/ch1/hello/target/rls/debug/libhello.d:
--------------------------------------------------------------------------------
1 | /Users/caochunhui/test/rust/programming_rust/ch1/hello/target/rls/debug/libhello.rmeta: /Users/caochunhui/test/rust/programming_rust/ch1/hello/src/main.rs
2 |
--------------------------------------------------------------------------------
/scala/object.scala:
--------------------------------------------------------------------------------
1 | // object 和 java 的静态方法类似,但实际上却是一个全局一致的单例
2 |
3 | object Greeting {
4 | def english = "Hi"
5 | def chn = "艹"
6 | }
7 |
8 | println(Greeting.english)
9 | println(Greeting.chn)
10 |
--------------------------------------------------------------------------------
/go/concurrent_map_write_iter/readme.md:
--------------------------------------------------------------------------------
1 | https://github.com/golang/go/issues/26703
2 |
3 | 不打开 -race 的选项的话,有可能 race 的栈显示不全,如两个 goroutine 发生 race,而实际上只显示其中的一个。
4 |
5 | 但线上显然是没法打开的。
6 |
7 | 可以在压力测试中开 -race 进行单独的并发测试
8 |
9 |
--------------------------------------------------------------------------------
/go/crawler/z.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "net/url"
6 | )
7 |
8 | func main() {
9 |
10 | u, err := url.Parse("http://www.abc.com/afdsaf")
11 | fmt.Println(u.Hostname(), err)
12 | }
13 |
--------------------------------------------------------------------------------
/go/redis/redisTest.php:
--------------------------------------------------------------------------------
1 | connect("localhost", "6379",0);
4 | echo time();
5 | echo "\n";
6 | for ($i =0;$i<10000;$i++) {
7 | $r = $a->get("foo".$i);
8 | }
9 | echo time();
10 |
--------------------------------------------------------------------------------
/go/runtime/forloopinline.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "time"
4 |
5 | func main() {
6 | var a []string
7 | for {
8 | var d = len(a)
9 |
10 | time.Sleep(time.Second)
11 | println(d)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/go/string/searchStr.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "sort"
4 |
5 | func main() {
6 | arr := []string{"iOS/0.9.4", "dafafa"}
7 | sort.Strings(arr)
8 | println(sort.SearchStrings(arr, "ANDROID/0.9w"))
9 | }
10 |
--------------------------------------------------------------------------------
/python/guolele/guolele/spiders/__init__.py:
--------------------------------------------------------------------------------
1 | # This package will contain the spiders of your Scrapy project
2 | #
3 | # Please refer to the documentation for information on how to create and manage
4 | # your spiders.
5 |
--------------------------------------------------------------------------------
/uml/sequence.txt:
--------------------------------------------------------------------------------
1 | @startuml
2 | participant Ark
3 | participant Noah
4 | participant "SMS网关" as sms
5 |
6 | Ark -> Noah : send sms
7 | Noah -> sms : send request
8 | Noah --> Ark : return success
9 | @enduml
10 |
--------------------------------------------------------------------------------
/go/ast/example.go:
--------------------------------------------------------------------------------
1 | package lp
2 |
3 | type person struct {
4 | age, aaa int `json:"age" form:"age"`
5 | name int `json:"name" form:"name"`
6 | info struct {
7 | detail int `json:"detail"`
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/go/ast/example.go.bak2:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // for api @post @/user/create
4 | type createAccountRequest struct {
5 | Age int `form:"age" validation:"gte=18"`
6 | Name string `form:"name" validation:"length>0"`
7 | }
8 |
--------------------------------------------------------------------------------
/go/http/http2/readme.md:
--------------------------------------------------------------------------------
1 | ```
2 | ~ ❯❯❯ curl -i https://localhost:9090 -k
3 | HTTP/2 200
4 | content-type: application/json
5 | content-length: 5
6 | date: Thu, 23 Apr 2020 07:40:12 GMT
7 |
8 | hello
9 |
10 | ```
11 |
--------------------------------------------------------------------------------
/go/raft/hashicorp/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "net/http"
4 |
5 | func main() {
6 | config(3)
7 |
8 | http.HandleFunc("/", Handler)
9 | err := http.ListenAndServe(":3333", nil)
10 | panic(err)
11 | }
12 |
--------------------------------------------------------------------------------
/os/chapter_2/main.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | void test()
5 | {
6 | printf("hello, world!\n");
7 | }
8 |
9 | int main()
10 | {
11 | test();
12 | return EXIT_SUCCESS;
13 | }
14 |
--------------------------------------------------------------------------------
/php/sprintftest.php:
--------------------------------------------------------------------------------
1 | "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 | pest = "2.0"
9 | pest_derive = "2.0"
10 |
--------------------------------------------------------------------------------
/rust/pest_test/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "pest_test"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 | pest = "2.0"
9 | pest_derive = "2.0"
10 |
--------------------------------------------------------------------------------
/rust/rust_programming_lang/guess_num/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "hello"
3 | version = "0.1.0"
4 | authors = ["xargin "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 |
9 | rand = "0.4.0"
10 |
--------------------------------------------------------------------------------
/go/dependency-experiment/nested_struct_based/price_service.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | func onlineGetPrice(orderID int) float64 {
4 | return 0
5 | }
6 |
7 | func testGetPrice(orderID int) float64 {
8 | return 0.11
9 | }
10 |
--------------------------------------------------------------------------------
/go/escape_analysis/a.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | )
6 |
7 | func t(a *int) {
8 | }
9 |
10 | func main() {
11 | var a [1]int
12 | c := a[:]
13 | fmt.Println(c)
14 | var b int
15 | t(&b)
16 | }
17 |
--------------------------------------------------------------------------------
/go/flag/parse.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "flag"
5 | "fmt"
6 | )
7 |
8 | var a = flag.String("c", "", "flag a ")
9 |
10 | func main() {
11 | // 不parse不出结果
12 | flag.Parse()
13 | fmt.Println(*a)
14 | }
15 |
--------------------------------------------------------------------------------
/go/json/ffjs.go:
--------------------------------------------------------------------------------
1 | package cch
2 |
3 | //ffjson这个是用已有的struct自动生成Marshal和Unmarshal的代码的库
4 | //必须得把代码放到GOPATH下才能正常运行。。
5 | //执行ffjson xxxxx.go,然后可以生成编解码代码
6 |
7 | type Person struct {
8 | name string
9 | age int
10 | }
11 |
--------------------------------------------------------------------------------
/js/node_modules/fibers/test/finish-multiple.js:
--------------------------------------------------------------------------------
1 | // gh-16
2 | var Fiber = require('fibers');
3 | Fiber(function() {
4 | Fiber(function() {
5 | Fiber(function() {}).run();
6 | }).run();
7 | }).run();
8 | console.log('pass');
9 |
--------------------------------------------------------------------------------
/rust/serdejson_test/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "serdejson_test"
3 | version = "0.1.0"
4 | authors = ["xargin "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 | serde_json = "1.0.37"
9 |
10 |
11 |
--------------------------------------------------------------------------------
/scala/object_is_singleton.scala:
--------------------------------------------------------------------------------
1 | // 单例证明
2 | object Greeting {
3 | def english = "Hi"
4 | def chn = "艹"
5 | }
6 |
7 | val x = Greeting
8 | val y = x
9 | val z = Greeting
10 | println(x eq y)
11 | println(x eq z)
12 |
--------------------------------------------------------------------------------
/vagrant_files/readme.md:
--------------------------------------------------------------------------------
1 | Vagrantfile是vagrant的配置文件,里面有关于vagrant-triggers的配置,如果能够成功安装vagrant-triggers这个插件的话,则不需要在mac上做额外的端口转发,如果不能安装,那么需要在启动虚拟机的时候运行init.sh
2 |
3 | init.sh是在mac上用来转发80到8080,443到4443端口的脚本
4 |
5 | uinit.sh是取消上述操作的脚本
6 |
--------------------------------------------------------------------------------
/c/setlinebuf.c:
--------------------------------------------------------------------------------
1 | #include "stdio.h"
2 |
3 | int main() {
4 | setlinebuf(stdout);
5 | printf("abc");
6 | printf("abc");
7 | printf("abc");
8 | printf("abc");
9 | sleep(10);
10 | return 1;
11 | }
12 |
--------------------------------------------------------------------------------
/go/error/pkg_err/printf.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 |
6 | "github.com/pkg/errors"
7 | )
8 |
9 | func main() {
10 | err := errors.New("whoops")
11 | fmt.Println(err)
12 | fmt.Printf("%+v", err)
13 | }
14 |
--------------------------------------------------------------------------------
/go/full_chan.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | func main() {
4 | var a = make(chan int, 1)
5 | for i := 0; i < 10; i++ {
6 | select {
7 | case a <- i:
8 | default:
9 | println("in default", i)
10 | }
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/go/gocyclo.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 |
5 | func main() {
6 | var i = 1
7 | switch i {
8 | case 0:
9 | case 1:
10 | case 2:
11 | default:
12 | }
13 | if i > 0 {
14 | }
15 |
16 | fmt.Println(i)
17 | }
18 |
--------------------------------------------------------------------------------
/go/import_cycle/break_cycle/character/cha.go:
--------------------------------------------------------------------------------
1 | package character
2 |
3 | type Character struct {
4 | Inventory []item.Item
5 | }
6 |
7 | // Do implement the interface ActionTarget
8 | func (c Character) Do() int {
9 | }
10 |
--------------------------------------------------------------------------------
/go/runtime/gotoolobjdump.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | //go tool objdump可以看生成的汇编代码,
4 | //然后在汇编内容里搜索gotoolobjdump.go
5 | //可以找到对应的行数和汇编代码的关系
6 |
7 | func main() {
8 | a := []int{1, 2, 3}
9 | b := len(a)
10 | println(b)
11 | }
12 |
--------------------------------------------------------------------------------
/go/slice/reverse.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "sort"
6 | )
7 |
8 | func main() {
9 | var a = []int{43, 32, 12, 32, 44}
10 |
11 | sort.Sort(sort.Reverse(sort.IntSlice(a)))
12 | fmt.Println(a)
13 | }
14 |
--------------------------------------------------------------------------------
/go/thrift/hello.thrift:
--------------------------------------------------------------------------------
1 | namespace go echo
2 |
3 | struct EchoReq {
4 | 1: string msg;
5 | }
6 |
7 | struct EchoRes {
8 | 1: string msg;
9 | }
10 |
11 | service Echo {
12 | EchoRes echo(1: EchoReq req);
13 | }
14 |
--------------------------------------------------------------------------------
/python/get_cpu.py:
--------------------------------------------------------------------------------
1 | import psutil
2 | import time
3 |
4 | p = psutil.Process(1)
5 |
6 | while 1:
7 | v = str(p.cpu_percent())
8 | if "0.0" != v:
9 | print(111111, v, time.time())
10 | time.sleep(1)
11 |
12 |
--------------------------------------------------------------------------------
/rust/1.40/non_exhaustive/a/src/lib.rs:
--------------------------------------------------------------------------------
1 | #[non_exhaustive]
2 | #[derive(Debug)]
3 | pub struct Person {
4 | age : i32,
5 | height : i32,
6 | }
7 |
8 | pub fn New() -> Person {
9 | Person {age :1, height : 2}
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rust/csv_parser/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "csv_parser"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 | pest = "2.0"
9 | pest_derive = "2.0"
10 |
11 |
--------------------------------------------------------------------------------
/rust/elastic_test/src/main.rs:
--------------------------------------------------------------------------------
1 | extern crate elastic_query;
2 |
3 | fn main() {
4 | let result = elastic_query::convert("a = 1 and b in (1,2,3)".to_string(), 0, 100, vec![], vec![]).unwrap();
5 | println!("{}", result);
6 | }
7 |
--------------------------------------------------------------------------------
/rust/pest_test/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/go/gopacket/readme.md:
--------------------------------------------------------------------------------
1 | https://www.devdungeon.com/content/packet-capture-injection-and-analysis-gopacket
2 |
3 | loop 拿不到 link layer,需要再改改
4 |
5 | https://stackoverflow.com/questions/59985676/sending-udp-packets-to-127-0-0-1-with-gopacket
6 |
--------------------------------------------------------------------------------
/go/os/net_proc.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "syscall"
6 | )
7 |
8 | func main() {
9 | res, err := syscall.Sysctl("security.mac.device_enforce")
10 | fmt.Printf("%#v\n", res)
11 | fmt.Println(err)
12 | }
13 |
--------------------------------------------------------------------------------
/go/pool/redigo_with_pool/vendor/golang.org/x/net/AUTHORS:
--------------------------------------------------------------------------------
1 | # This source code refers to The Go Authors for copyright purposes.
2 | # The master list of authors is in the main Go distribution,
3 | # visible at http://tip.golang.org/AUTHORS.
4 |
--------------------------------------------------------------------------------
/go/pool/redigo_with_pool/vendor/golang.org/x/net/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This source code was written by the Go contributors.
2 | # The master list of contributors is in the main Go distribution,
3 | # visible at http://tip.golang.org/CONTRIBUTORS.
4 |
--------------------------------------------------------------------------------
/go/reflect/struct_type.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "reflect"
6 | )
7 |
8 | type Person struct {
9 | age int
10 | }
11 |
12 | func main() {
13 | var a Person
14 | fmt.Println(reflect.TypeOf(a))
15 | }
16 |
--------------------------------------------------------------------------------
/go/runtime/inline.go:
--------------------------------------------------------------------------------
1 | // go build -gcflags "-m"
2 | // 可以看到编译器会做哪些内联优化
3 | package main
4 |
5 | import "fmt"
6 |
7 | func test() {
8 | }
9 |
10 | func main() {
11 | test()
12 | var a []string
13 | fmt.Println(len(a))
14 | }
15 |
--------------------------------------------------------------------------------
/go/strconv/formatFloat.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "strconv"
6 | )
7 |
8 | func main() {
9 | val := 0.00000001
10 | f := byte('e')
11 | fmt.Println(strconv.FormatFloat(float64(val), f, -1, 64))
12 | }
13 |
--------------------------------------------------------------------------------
/rust/reqwest/example/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "example"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 | reqwest = "^0.9.18"
9 | serde_json = "1.0.40"
10 |
--------------------------------------------------------------------------------
/rust/rustyline_test/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/c/sds/Makefile:
--------------------------------------------------------------------------------
1 | all: sds-test
2 |
3 | sds-test: sds.c sds.h testhelp.h
4 | $(CC) -o sds-test sds.c -Wall -std=c99 -pedantic -O2 -DSDS_TEST_MAIN
5 | @echo ">>> Type ./sds-test to run the sds.c unit tests."
6 |
7 | clean:
8 | rm -f sds-test
9 |
--------------------------------------------------------------------------------
/go_web/readme.md:
--------------------------------------------------------------------------------
1 | 目前的binding和validate模块普遍存在一个问题
2 |
3 | 因为golang的int、string之类的字段的语义缺失问题的关系(不能=nil),如果先bind,再validate,没有办法判断一个字段的0值是因为默认值导致还是因为用户输入导致
4 |
5 | 而大多数validate模块的required实际上也就只是判断deserilize之后的值是否是字段的默认值而已,这样的判断是不严谨的。很可能会出bug
6 |
7 |
--------------------------------------------------------------------------------
/js/test.js:
--------------------------------------------------------------------------------
1 | var foo = 0;
2 | var timer = setInterval(function(){
3 | foo++;
4 | }, 500);
5 | while(1){
6 | if(foo == 10){
7 | clearInterval(timer);
8 | break;
9 | } else {
10 | console.log(foo);
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/scala/lists/fold_left.scala:
--------------------------------------------------------------------------------
1 | val a = List(1, 3, 5, 7)
2 |
3 | // 和reduce一样,不过foldLeft有个start value
4 | println(a.foldLeft(0)(_ + _))
5 | println(a.foldLeft(0)(_ * _))
6 | println(a.foldLeft(10)(_ + _))
7 | println(a.foldLeft(10)(_ * _))
8 |
9 |
--------------------------------------------------------------------------------
/go/go1.13/deferproc.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 |
5 | func main() {
6 | for i := 0; i < 10; i++ {
7 | defer func() {
8 | for {
9 | var a = make([]int, 128)
10 | fmt.Println(a)
11 | }
12 | }()
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/go/goroutine/goForPrint.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "runtime"
4 | import "time"
5 |
6 | func main() {
7 |
8 | runtime.GOMAXPROCS(1)
9 | for i := 0; i < 10; i++ {
10 | go println(i)
11 | }
12 | time.Sleep(2 * time.Second)
13 | }
14 |
--------------------------------------------------------------------------------
/go/math/accurance.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 | import "reflect"
5 |
6 | func main() {
7 | var a = 0.57
8 | var b = a * 100
9 | fmt.Println(reflect.TypeOf(a).Kind())
10 | fmt.Println(b)
11 | fmt.Println(int(b))
12 | }
13 |
--------------------------------------------------------------------------------
/go/slice/merge_slices.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 |
5 | func main() {
6 | var a = []int{0, 1, 2, 3, 4, 5, 6, 7}
7 | merged := append([]int{}, a[:5]...)
8 | merged = append(merged, a[6:]...)
9 | fmt.Println(merged)
10 | }
11 |
--------------------------------------------------------------------------------
/go/suffix/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "index/suffixarray"
6 | )
7 |
8 | func main() {
9 | idx := suffixarray.New([]byte("abcdbcbcbcefg"))
10 | res := idx.Lookup([]byte("bc"), -1)
11 | fmt.Println(res)
12 | }
13 |
--------------------------------------------------------------------------------
/go_web/martini.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "github.com/go-martini/martini"
4 |
5 | func hello() string {
6 | return "Hello world"
7 | }
8 |
9 | func main() {
10 | m := martini.Classic()
11 | m.Get("/", hello)
12 | m.Run()
13 | }
14 |
--------------------------------------------------------------------------------
/php/arr_test.php:
--------------------------------------------------------------------------------
1 | ['sdfsdf'],
4 | 'sss' => ['sz'],
5 | 'x' => []
6 | ];
7 | print_r($arr);
8 | unset($arr[1]);
9 | unset($arr['sss']);
10 | unset($arr['x']);
11 | var_dump($arr);
12 |
--------------------------------------------------------------------------------
/c/encapsulation/main.c:
--------------------------------------------------------------------------------
1 | #include "point.h"
2 | #include
3 |
4 | int main() {
5 | struct Point * p = makePoint(1.1, 2.2);
6 | printf("%p", p);
7 | // printf("%f", p->x);
8 | // 这样的无法访问到 p->x 的,编译会报错
9 | return 0;
10 | }
--------------------------------------------------------------------------------
/go/asm/is_frame_pointer_on_stack_value_equal_to_directive_FP/global.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | )
6 |
7 | func output(int) (int, int)
8 |
9 | func main() {
10 | a, b := output(987654321)
11 | fmt.Println(a, b)
12 | }
13 |
--------------------------------------------------------------------------------
/go/atomic/uber_atomic.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 |
6 | atomicex "go.uber.org/atomic"
7 | )
8 |
9 | func main() {
10 | var a atomicex.Uint32
11 | fmt.Println(a.Load())
12 | a.Store(23)
13 | fmt.Println(a.Load())
14 | }
15 |
--------------------------------------------------------------------------------
/go/test_with_tags/production.go:
--------------------------------------------------------------------------------
1 | // +build !test
2 |
3 | package xxx
4 |
5 | func init() {
6 | getUserFunc = func() bool { return true }
7 | validateFunc = func() bool { return true }
8 | createOrderFunc = func() bool { return true }
9 | }
10 |
--------------------------------------------------------------------------------
/js/intervaltest.js:
--------------------------------------------------------------------------------
1 | var t, sec = 0;
2 | function countDown() {
3 | clearInterval(t);
4 | setTimeout(countDown, 1000);
5 | sec++;
6 | console.log(sec);
7 | }
8 |
9 | function test() {
10 | t = setInterval(countDown, 1000);
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/js/test2.js:
--------------------------------------------------------------------------------
1 | var x = 1;
2 | var z = 2;
3 | var y = function(x){
4 | console.log(x);
5 | };
6 | y();
7 | (function(x){
8 | y();
9 | function y(x) {
10 | console.log(x);
11 | var x = 2;
12 | console.log(x);
13 | }
14 | })();
15 |
--------------------------------------------------------------------------------
/os/chapter_2/readme.md:
--------------------------------------------------------------------------------
1 | mac 环境,
2 |
3 | > brew install binutils
4 |
5 | 所有的命令以g开头,例如greadelf,gobjdump
6 |
7 | > gcc -c
8 |
9 | -c Only run preprocess, compile, and assemble steps
10 |
11 | 只运行预处理,编译,汇编
12 |
13 | 也就是说不做链接
14 |
15 |
--------------------------------------------------------------------------------
/c++/double.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | using namespace std;
3 |
4 | int main() {
5 | double a = 0.57;
6 | double b = a * 100;
7 | cout << a << endl;
8 | cout << b << endl;
9 | cout << (int)b << endl;
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/go/asm/goid/goid_amd64.s:
--------------------------------------------------------------------------------
1 | #include "textflag.h"
2 | #include "go_tls.h"
3 |
4 | TEXT ·getg(SB), NOSPLIT, $0-8
5 | get_tls(CX)
6 | MOVQ g(CX), AX
7 | LEAQ 152(AX), BX // this is the offset
8 | MOVQ (BX), DX
9 | MOVQ DX, ret+0(FP)
10 | RET
11 |
--------------------------------------------------------------------------------
/go/errcheck/errcheck.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "net/http"
6 | )
7 |
8 | func main() {
9 | // 这种场景可以用 gas/gometalinter 检查出来
10 | req, _ := http.NewRequest("GET", "http://www.baidu.com", nil)
11 | fmt.Println(req)
12 | }
13 |
--------------------------------------------------------------------------------
/go/line_feed.go:
--------------------------------------------------------------------------------
1 | // in nginx, it append a line feed to each log line
2 | //http://www.perlmonks.org/?node_id=264431
3 | package main
4 |
5 | func main() {
6 | var a = "\x0a"
7 | var b = "\n"
8 | println(a == b)
9 | println([]byte(b)[0])
10 | }
11 |
--------------------------------------------------------------------------------
/go/slice/append_when_under_array_has_capacity.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 |
5 | func main() {
6 | var a = [...]int{1, 2, 3, 4, 5}
7 | // will use the cap of array underneath
8 | b := a[1:3]
9 | fmt.Println(len(b), cap(b))
10 | }
11 |
--------------------------------------------------------------------------------
/go/test_with_tags/test_fakes.go:
--------------------------------------------------------------------------------
1 | // +build test
2 |
3 | package xxx
4 |
5 | func init() {
6 | getUserFunc = func() bool { return false }
7 | validateFunc = func() bool { return false }
8 | createOrderFunc = func() bool { return false }
9 | }
10 |
--------------------------------------------------------------------------------
/shell/awk/test.awk:
--------------------------------------------------------------------------------
1 | {
2 | x = $1 % 1000
3 | #print x
4 | driver_id = $1
5 | order_id = $2
6 | print "update db_name.table_name"driver_id % 1000 , "set star = 5 where order_id = " driver_id ";"
7 | #print order_id
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/go/ast/example2.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Person is
4 | type Person struct {
5 | age int `json:"age"` //ffff
6 | }
7 |
8 | func main() {
9 |
10 | var i int
11 | for {
12 | if true {
13 | i++
14 | } else {
15 | i--
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/go/file/get_file_list.go:
--------------------------------------------------------------------------------
1 | package main
2 | import "io/ioutil"
3 |
4 | import "fmt"
5 | func main() {
6 | //ioutil.ReadFile(filenamoe)
7 | filePathList, _:=ioutil.ReadDir("./")
8 | for _, p := range filePathList {
9 | fmt.Println(p.Name())
10 | }
11 | }
--------------------------------------------------------------------------------
/go/goroutine/goroutinetest.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "runtime"
4 |
5 | func say(str string) {
6 | for i := 0; i < 5; i++ {
7 | runtime.Gosched()
8 | println(str)
9 | }
10 | }
11 | func main() {
12 | go say("hello")
13 | say("yess")
14 | }
15 |
--------------------------------------------------------------------------------
/os/chapter_4/func_call.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | int add(int a, int b) {
5 | return a + b;
6 | }
7 |
8 | int main(int argv, char ** argc) {
9 | int a = 1;
10 | int b = 2;
11 | printf("%d\n", add(a,b));
12 | }
13 |
--------------------------------------------------------------------------------
/php/array_slice_test.php:
--------------------------------------------------------------------------------
1 | "]
5 |
6 | [dependencies]
7 | iron = "0.5.1"
8 | mime = "0.2.3"
9 | router = "0.5.1"
10 | urlencoded = "0.5.0"
11 |
--------------------------------------------------------------------------------
/scala/lambda/lambda.scala:
--------------------------------------------------------------------------------
1 | def lambda = {x: Int => x+1}
2 | def lambda2 = (x:Int) => x+2
3 | def lambda3 = (x:Int) => x+3
4 |
5 | def lambda4 = new Function1[Int, Int] {
6 | def apply(v1: Int) : Int = v1 - 1
7 | }
8 |
9 | def lambda5(x: Int) = x + 1
10 |
--------------------------------------------------------------------------------
/go/algorithm/leetcode/344.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | func main() {
4 | }
5 |
6 | func reverseString(s string) string {
7 | var res []byte
8 |
9 | for i := len(s) - 1; i >= 0; i-- {
10 | res = append(res, s[i])
11 | }
12 |
13 | return string(res)
14 | }
15 |
--------------------------------------------------------------------------------
/go/cryptoBench/md4/md4.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "golang.org/x/crypto/md4"
4 |
5 | var hash []byte
6 |
7 | func test() {
8 |
9 | s1 := "Hello, MD4 test text"
10 | ctx := md4.New()
11 | ctx.Write([]byte(s1))
12 | hash = ctx.Sum(nil)
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/scala/lists/list.scala:
--------------------------------------------------------------------------------
1 | // 注意,和 java 是反着的
2 | //eq tests identity (same object):
3 | val a = List(1, 2, 3)
4 | val b = List(1, 2, 3)
5 | (a eq b)
6 |
7 | //== tests equality (same content):
8 | val a = List(1, 2, 3)
9 | val b = List(1, 2, 3)
10 | (a == b)
11 |
--------------------------------------------------------------------------------
/go/atomic_bench/atomic_test.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "testing"
4 |
5 | func BenchmarkAtomic(b * testing.B) {
6 | b.SetParallelism(100)
7 | b.RunParallel(func(pb *testing.PB) {
8 | for pb.Next() {
9 | atomicStore(0)
10 | }
11 | })
12 | }
13 |
--------------------------------------------------------------------------------
/go/cryptoBench/sha1/sha1.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | //Go 在多个 crypto/* 包中实现了一系列散列函数。
4 | import "crypto/sha1"
5 |
6 | var bs []byte
7 |
8 | func test() {
9 | s := "Hello, MD4 test text"
10 | h := sha1.New()
11 | h.Write([]byte(s))
12 | bs = h.Sum(nil)
13 | }
14 |
--------------------------------------------------------------------------------
/go/internal/copytest2.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 |
5 | type integer int
6 |
7 | func (i integer) printAge() {
8 | fmt.Printf("%p\n", &i)
9 | }
10 |
11 | func main() {
12 | i := integer(1)
13 | fmt.Printf("%p\n", &i)
14 | i.printAge()
15 | }
16 |
--------------------------------------------------------------------------------
/go/slice/del_elem.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 |
5 | func main() {
6 | var a = []int{0, 1, 2, 3, 4, 5, 6, 7}
7 | fmt.Println(a, "cap", cap(a), "len", len(a))
8 | a = append(a[:5], a[6:]...)
9 | fmt.Println(a, "cap", cap(a), "len", len(a))
10 | }
11 |
--------------------------------------------------------------------------------
/rust/read_from_stdin/src/main.rs:
--------------------------------------------------------------------------------
1 | use std::io::{self, Read};
2 |
3 | fn main() -> io::Result<()> {
4 | let mut buffer = Vec::new();
5 | io::stdin().read_to_end(&mut buffer)?;
6 | println!("read result : {:?}", String::from_utf8(buffer));
7 | Ok(())
8 | }
9 |
--------------------------------------------------------------------------------
/scala/lists/tail_reuse.scala:
--------------------------------------------------------------------------------
1 | val d = Nil
2 |
3 | val c = 3 :: d
4 | val b = 2 :: c
5 | val a = 1 ::b
6 | println(a)
7 | println(b)
8 | println(c)
9 | println(d)
10 |
11 | println(a.tail)
12 | println(b.tail)
13 | println(c.tail)
14 | //println(d.tail) exception
15 |
--------------------------------------------------------------------------------
/c++/signal/signal.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | void handle_sigint(int sig)
5 | {
6 | printf("Caught signal %d\n", sig);
7 | }
8 |
9 | int main()
10 | {
11 | signal(SIGINT, handle_sigint);
12 | while (1) ;
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/go/interface/multi_instance.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | type Printer interface {
4 | Print()
5 | }
6 |
7 | type person struct{}
8 |
9 | func (p person) Print() {}
10 |
11 | type gogo struct{}
12 |
13 | func (g gogo) Print() {}
14 |
15 | func main() {
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/go/raft/hashicorp.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "github.com/hashicorp/raft"
4 |
5 | func main() {
6 | conf := raft.Config{}
7 | logs := raft.Log{}
8 | stable := raft.StableStore{}
9 | raft.BootstrapCluster(conf, logs, stable, snaps, trans, configuration)
10 | }
11 |
--------------------------------------------------------------------------------
/js/node_modules/fibers/test/process-title.js:
--------------------------------------------------------------------------------
1 | // gh-10
2 | var Fiber = require('fibers');
3 |
4 | var title = process.title;
5 | Fiber(function() {
6 | process.title = 'pass';
7 | }).run();
8 | console.log(process.title === 'pass' || process.title === title ? 'pass' : 'fail');
9 |
--------------------------------------------------------------------------------
/rust/assoc/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "assoc"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8 |
9 | [dependencies]
10 |
--------------------------------------------------------------------------------
/rust/iter/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "iter"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8 |
9 | [dependencies]
10 |
--------------------------------------------------------------------------------
/rust/pest_test/src/ident.pest:
--------------------------------------------------------------------------------
1 | alpha = { 'a'..'z' | 'A'..'Z' }
2 | digit = { '0'..'9' }
3 |
4 | ident = { (alpha | digit)+ }
5 |
6 | ident_list = _{ !digit ~ ident ~ (" " ~ ident)+ }
7 | // ^
8 | // ident_list rule is silent which means it produces no tokens
9 |
--------------------------------------------------------------------------------
/shell/expect:
--------------------------------------------------------------------------------
1 | #!/usr/bin/sh
2 | user=$1
3 | if [[ $user -eq "me" ]];
4 | then
5 | expect << EOF
6 | set timeout 30
7 | spawn ssh root@10.10.38.89 -o StrictHostKeyChecking=no
8 | expect "password"
9 | send "iovVmVI!@vm\r"
10 | expect eof
11 | EOF
12 | fi
13 |
--------------------------------------------------------------------------------
/go/expand/readme.md:
--------------------------------------------------------------------------------
1 | # 内置结构扩容
2 |
3 | 需要注意的是,虽然很多人说 slice 是引用传递,但这种说法是不精确的。
4 |
5 | 如果传入函数的 slice 在函数内发生了扩容,那么扩容之后的 slice 就是该函数中新的局部 slice 了,任何修改不会影响到 caller 的 slice。
6 |
7 | 因为本质上传入 callee 的是 caller 中 slice 的地址值,这个地址值还是一个副本,只是值与 caller 中的 slice 的一样。但一旦存储该地址值本身的变量发生了变化,那就和原来没什么关系了。
8 |
--------------------------------------------------------------------------------
/go/goroutine/channelmakeandchannelnotmake.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | func main() {
4 | var a chan int
5 | var b = make(chan int)
6 | //注意,只声明不初始化的话,a的值是空,没法直接使用
7 | //go里的三种特殊数据结构都是需要初始化的
8 | println(a)
9 | println(b)
10 | a = make(chan int)
11 | println(a)
12 | }
13 |
--------------------------------------------------------------------------------
/go/string/replaceNums.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "strings"
6 | "unicode"
7 | )
8 |
9 | func main() {
10 | var a = `g_service_1323`
11 | a = strings.TrimRightFunc(a, unicode.IsDigit)
12 | a = strings.TrimRight(a, "_")
13 | fmt.Println(a)
14 | }
15 |
--------------------------------------------------------------------------------
/js/closure2.js:
--------------------------------------------------------------------------------
1 | var name = "trigkit4";
2 | var segmentFault = {
3 | name : "My SF",
4 | getNameFunc : function(){
5 | return function(){
6 | return this.name;
7 | };
8 | }
9 | };
10 | console.log(segmentFault.getNameFunc()()); //弹出trigkit4
11 |
--------------------------------------------------------------------------------
/os/chapter_3/practise/loop.s:
--------------------------------------------------------------------------------
1 | global _start
2 |
3 | section .text
4 |
5 | _start:
6 | mov rcx, 236
7 | mov rax, 123
8 |
9 | s:
10 | add rax, 123
11 | loop s; 在rcx 变为 0 之前,loop 会一直执行
12 |
13 | mov rax, 60; 'exit' syscall number
14 | xor rdi, rdi
15 | syscall
16 |
17 |
--------------------------------------------------------------------------------
/os/chapter_4/more_than_7_params.c:
--------------------------------------------------------------------------------
1 | #include "stdio.h"
2 | #include "stdlib.h"
3 |
4 | void test(long a, long b, long c, long d, long e, long f, long g, long h) {
5 | printf( "%ld\n", a+b+c+d+e+f+g+h);
6 | }
7 |
8 | int main() {
9 | test(1,2,3,4,5,6,7,8);
10 | }
11 |
--------------------------------------------------------------------------------
/rust/1.42/hello/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "hello"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8 |
9 | [dependencies]
10 |
--------------------------------------------------------------------------------
/rust/1.43/hello/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "hello"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8 |
9 | [dependencies]
10 |
--------------------------------------------------------------------------------
/rust/assoc2/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "assoc2"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8 |
9 | [dependencies]
10 |
--------------------------------------------------------------------------------
/rust/assoc3/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "assoc3"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8 |
9 | [dependencies]
10 |
--------------------------------------------------------------------------------
/rust/box_arr/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "box_arr"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8 |
9 | [dependencies]
10 |
--------------------------------------------------------------------------------
/rust/closure/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "closure"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8 |
9 | [dependencies]
10 |
--------------------------------------------------------------------------------
/rust/hashmap/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "hashmap"
3 | version = "0.1.0"
4 | authors = ["xargin "]
5 | edition = "2018"
6 |
7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8 |
9 | [dependencies]
10 |
--------------------------------------------------------------------------------
/rust/ngx_rs/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "ngx_rs"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8 |
9 | [dependencies]
10 |
--------------------------------------------------------------------------------
/rust/traits/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "generics"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8 |
9 | [dependencies]
10 |
--------------------------------------------------------------------------------
/github_icons/show.md:
--------------------------------------------------------------------------------
1 | [](https://travis-ci.org/cch123/elasticsql)
2 | [](https://godoc.org/github.com/cch123/elasticsql)
3 |
--------------------------------------------------------------------------------
/go/asm/local_var.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 |
5 | // 注意观察这个函数的 args 和 locals
6 | // 以及生成的汇编的 $x-y 之间的关系
7 | func test(x []int) int {
8 | var a = 1
9 | var b = struct{ X int }{X: 93}
10 | fmt.Println(b)
11 | return a + b.X
12 | }
13 |
14 | func main() {
15 | }
16 |
--------------------------------------------------------------------------------
/go/expand/slice.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 |
5 | func testSlice(sl []int) {
6 | for i := 0; i < 1000; i++ {
7 | sl = append(sl, i)
8 | }
9 | fmt.Println(sl)
10 | }
11 |
12 | func main() {
13 | var a = []int{}
14 | testSlice(a)
15 | fmt.Println(a)
16 | }
17 |
--------------------------------------------------------------------------------
/rust/flat_map/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "flat_map"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8 |
9 | [dependencies]
10 |
--------------------------------------------------------------------------------
/rust/partial_eq/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "partial_eq"
3 | version = "0.1.0"
4 | authors = ["Xargin "]
5 | edition = "2018"
6 |
7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8 |
9 | [dependencies]
10 |
--------------------------------------------------------------------------------
/rust/prec_climber_test/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "prec_climber_test"
3 | version = "0.1.0"
4 | authors = ["xargin "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 | pest = "2.0"
9 | pest_derive = "2.0"
10 | serde_json = "1.0.37"
11 | rustyline = "1"
12 |
--------------------------------------------------------------------------------
/uml/advanced_sequence.txt:
--------------------------------------------------------------------------------
1 | @startuml
2 | participant Ark #white
3 | participant Noah #eeffee
4 | participant "SMS \n网关" as sms
5 |
6 | Ark -[#orange]> Noah : send sms
7 | Noah -> sms : send request
8 | Noah --[#red]> Ark : return success
9 | @enduml
10 |
--------------------------------------------------------------------------------
/c++/c++14/map.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include