ret := new(pb.Reply) | |
if x, ok := in.Arg.GetKind().(*structpb.Value_StringValue); ok { | |
s := x.StringValue + “ Generic!!!” | |
ret.Ret = &structpb.Value{ | |
Kind: &structpb.Value_StringValue{ | |
StringValue: s | |
} | |
} | |
} else if x, ok := in.Arg.GetKind().(*structpb.Value_NumberValue); ok { | |
i := x.NumberValue + 3345678 |
req.Arg = &structpb.Value{Kind: &structpb.Value_StringValue{StringValue: "string"}} | |
r, err := c.DoSomething(context.Background(), req) |
package slice | |
import ( | |
"sync" | |
"time" | |
) | |
type Batcher struct { | |
cb cb | |
threshold int |
package sliceSwap | |
import ( | |
"sync" | |
"time" | |
) | |
type Batcher struct { | |
cb cb | |
threshold int |
package channelSwap | |
import ( | |
"sync" | |
"time" | |
) | |
type Batcher struct { | |
cb cb | |
threshold int |
Since I researching a lot of solutions of how to create a blog, there are a lot of resources shows howto do this task,
- static generic html from markdown (Hugo, Jekyll...etc)
- build your own blog service
- using gist as blog engine
- rendering your gist in a third party website (gist.io, bl.ocks.org...etc)
I choice the third one, because I think this one is the simplest one and you just using the gist as the database, your posts never gone away and centrolized in gist only.
Recentlly, I got an oppertunity to have an interview process of Canonical Taipei, the take-home task is very interesting for me, since I am a backend engineer.
the task I'll not gonna describe in here but it takes me come to an idea: what if I try to build a deb file in Rust?
the launchpad aka sudo apt install XDDD
this building system is very secure, you don't have internet while building, and currently the cargo or rustup still cannot be installed by apt command.
I was trying to use this lib
this lib is cool that can help you to calculate financing indicators, and it used a beautiful way to present the incoming value of an indicator: a Next trait
so after some coding the code looks like
let mut ema5 = EMA::new(5)?;
let mut ema7 = EMA::new(7)?;
let mut ema10 = EMA::new(10)?;