Web_programming
1.14K subscribers
354 photos
14 videos
125 files
1.22K links
Sharif web programming
If you have any questions, please feel free to ask(@yumcoder)
Download Telegram
دو لینک آخر نسخه ابزارهای آنها کمی قدیمی است و بیشتر هدف اشنایی با این مفهوم است
let create a C program named hello.c
#include <stdio.h> 

int main() {
printf("Hello World\n");
}

Now, copy the hello.c to hello_new.c
$ cp hello.c hello_new.c
and edit the hello_new.c as shown below:
#include <stdio.h>

int main(int argc, char *argv[]) {
printf("Hello World\n");
return 0;
}

Finally, create the patch file using diff command:
$ diff -u hello.c hello_new.c > hello.patch
.
It create a patch file named “hello.patch”.

--- hello.c     2018-10-03 09:09:06.762269317 +0330
+++ hello_new.c 2018-10-03 09:10:19.663639835 +0330
@@ -1,5 +1,6 @@
-#include <stdio.h>
+#include <stdio.h>

-int main() {
+int main(int argc, char *argv[]) {
printf("Hello World\n");
+return 0;
}


To apply Patch File using Patch Command
$ patch < hello.patch
patching file hello.c

And the hello.c
#include <stdio.h>

int main(int argc, char *argv[]) {
printf("Hello World\n");
return 0;
}
overflow and underflow trick :)
#cpp
یکی از بهترین ابزارها برای rpc توسط شرکت baidu نوشته شده است.
https://github.com/brpc/brpc

برخی معماران با تجربه چینی برای gateway ورودی کاربران از wangle و folly نوشته شده توسط facebook استفاده میکنند و برای ارتباط بین مولفه های درون سیستم در معماری micro-servive از brpc استفاده میکنند
#cpp #rpc
در استفاده از rpc برای مفاهیمی مانند log, cache ,... یا همان مفاهیم cross-cutting  که در برنامه نویسی aspect-oriented مطرح است میتوان middleware نوشت. یک راهنمای خوب برای آموزش این کار در go
https://medium.com/@shijuvar/writing-grpc-interceptors-in-go-bf3e7671fe48

#golang #go #grpc #rpc