dyweb / blog Goto Github PK
View Code? Open in Web Editor NEWDongyue Tech Blog
Home Page: https://blog.dongyueweb.com
Dongyue Tech Blog
Home Page: https://blog.dongyueweb.com
While working on gce4, a lot of time is spent on parser, it's not the main focus for RDBMS.
But writing ast in unit test kills productivity, and hand written parser requires too much work for large language like SQL.
Besides gce4 is implemented in multiple languages.
It's not that straight forward to use ANTLR. For example:
In order to work on the rust runtime, I need to know ANTLR works. Though writing a runtime and generator template is not that hard because the algo is in ANLTR itself and one can reference other language's runtime.
util/toolchain
Since the domain *.dongyueweb.com supports https, we may change the generator to support https links globally.
None so far
When indexing object with nested array of objects, the default behaivor in ES is often not expected because it flatten the data.
For example, when searching from tshirts https://blog.mikemccandless.com/2012/01/searching-relational-content-with.html
{
name: dyweb
specs: [
{ size: xl, color: blue},
{ size: xxl, color: red}
]
}
If you index it directly in ES, it will flatten into:
{
name: dyweb
specs.size: [xl, xxl]
specs.color: [blue, red]
}
The flatten form will match query such as name = dyweb & size = xl & color = red
, which is actually invalid, because the xl shirt is blue while the red shirt is xxl ...
The solution in ES is using nested
https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html
Under the hood it is using lucene's join module, which provides both index time (using a block) and query time join.
If time is allowed I plan to cover
NOTE: The up to date note is in http://doc/github.com/at15/rust-learning/lib/warp/
I want to have a /shutdown
route that allows me to shutdown a http sever by hitting that endpoint.
However it is not that easy in Rust compared with Go (create a context/channel for cancellation, start two go routine, one blocks on server, one wait for cancel). Rust code is harder because it uses ownership instead of GC and has mutability rules.
The post will contain the following
Fn
, FnMut
, FnOnce
Fn
closureFour types of data model
Recently I've been reading the boo How to take smart notes. And I found it helpful both reading paper and scheduling daily workflow (not limited to writing). Create this issue to reminds me to write a post after I have finished the book (half way through it now).
Some key points mentioned by the book
N/A
We need social share button, and example would be https://github.com/XdaTk/ink-pure/blob/master/_share.html . There are many services we can choose (feel free to add more):
tongqu is using baidu share I recall. So we should choose a service and update the theme.
N/A
Update
depoly
in CONTRIBUTING.md
mentioned by @JasonQSYconfig.yaml
, or use some dark magic to do string replace instead of dump yaml, latter would erase all the commentgoimports
works better than gofmt
because it groups import. However, sometimes I want to enforce extra rules like putting proto imports at the bottom, group imports from current project together, warn/error if some packages are imported e.g. github.com/pkg/errors
.
The code is still in progress in dyweb/gommon#127 (well 5+ months PR ... 咕咕.... And the post plans to cover the following
gofmt
and goimports
worksgommon format
this wayWhile working on the blogos tutorial, I started looking at ABI for function call in different programming languages
The post is expected to cover the following
While working on gegecece and writing SQL parser (ANTLR rule). The main problem is converting parser tree to AST.
AST in SQL is (unresolved) logical plan. There are many ways to define the rule and to traverse the parser tree.
A common pattern is called visitor pattern. However, when looking at code in some dbs e.g. tidb, es. they didn't build the plan in a very visitor way. This post tries to address the following questions
ref #6 (comment)
I think google is better, because I have tried baidu, because google has some features that baidu doesn't have.
We want to implement this from upstream. ref InkProject/ink#66
NOTE: The draft is in go/pl/doc/error.md
You can't avoid error handling in any programming language (like you can't avoid death and IRS).
Although the philosophy and runtime implementation are different (error value, result, exception), there are still many things in common (e.g. wrap, unwrap, multiple errors, custom error type, error in a different thread).
Furthermore, when it comes to a cloud native (or k8s native) micro service architecture, you need to pass error across the wire.
Clearly http status code can't meet the complexity of your highly available, multi (hybrid) cloud, global scale, low latency, high throughput, custom json to yaml converter. A well defined interface error format is needed, it can be generated from different programming languages, serialized and passed through different rpc frameworks (json, gRPC) and shows the trace across different services, libraries and functions.
The post plans to cover the following
Error() string
errors.Is
, fmt.Errof("%w")
etc.?
My ubuntu is too old and guake does not support split screen terminal in that version, so I decided to use one in browser. Also was working on udash example ...
The key of a web terminal is ... add a \n
if the input does not have one, otherwise you will only read what you write (because a pseudo terminal is actually a file /dev/ptmx
) and without a \n
bash don't take any action .... (took me a while to figure it out)
ES has (multiple) aggregation. Lucene (and Solr) has facet.
Need to explain
Projects by @at15 from gradschool
We love doing bechmark, having good performance in benchmark does not mean the system is good,
but having poor results means the system cannot handle the workload.
How to generate different type of workload
Popular frameworks
Let's build one for http API (just for simplicity)
Now We have to run pre-deploy every time we update the source code. the work should be done by our lovely travis.
Since I am building agent for https://github.com/benchhub/benchboard
/proc
Recently I am building a reference management system for papers (I plan to read.jpg).
pdf.js has little documentation and most commercial products are too expensive.
This post describes:
It should serve as a good starting point for ppl frustrated with mendeley and want to write their own paper management system.
Since a semester has ended, we might put some interesting posts in various fields like Web, Distributed System, Fancy Toys, etc. Posts on our blog should be hence encouraged, both to skilled students and freshmen.
A series of tutorials, in my personal view, could be an alternative start.
TBD
There are many logging libraries in Go, however, most of them are not that handy if you have used logger in other languages (Java, C++), the performance is not good as well (i.e. using runtime to get stack and obtain line number). In this post we will walk through code of popular go logging libraries like builtin log package, logrus, zap (fast), apex/log etc, and talk about what makes them fast/slow, some gotcha in the go language itself. At last we will proposal our new design for gommon/log while the previous version is mostly modeled after logrus, the new version is more Java-ish.
I often use bind mount as a way to 'share' between host and container. However, I don't know how it works.
I don't even know how mount w/o docker works. This post aims to solve the puzzles around bind mount in docker.
I plan to cover the following and the target audiences are ppl w/ little linux background (like me)
Go's built in text/template
and html/template
is pretty useful for generating code, custom output (e.g. docker
, kubectl
, helm
).
However every time I need to use it I need to learn it again ... this post should list common syntax (and pitfalls)
And common places to use go template
Spent one day at work writing Dockerfile and Makefile. The code at work relies on many internal projects, on Jenkins, the Jenkins worker has access to all internal GithHub projects, however if I use a fully dockerized build locally and get vendor using glide install
or dep install
, it will fail because no access. The solution is to add ssh private key into container when build, and by using multi stage build, the build image is discarded right away and the runner image does not contain credentials.
Also had some interesting stuff like need to base64 encode and decode private key content, chmod 0400 ~/.ssh/id_rsa, add known host.
Benchmark w/o profiling is not very useful, you need to know where is the bottleneck.
There are many pprof posts online. However, every time I need to use pprof I found most top ranked search result are not good enough and outdated.
This post plans to cover the following
-cpuprofile
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.