This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://medium.com/@mlowicki/strings-fieldsfunc-vs-strings-split-96c667912f78 | |
fmt.Printf("%#v\n", strings.Split("/a/b/c", "/")) | |
// []string{"", "a", "b", "c"} | |
fmt.Printf("%#v\n", strings.FieldsFunc("/a/b/c", func(c rune) bool { return c == ‘/’ })) | |
// []string{"a", "b", "c"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"os/exec" | |
"time" | |
) | |
func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'); | |
var port = 9922; | |
var host = '192.168.7.160'; | |
var client= new net.Socket(); | |
//创建socket客户端 | |
client.setEncoding('binary'); | |
//连接到服务端 | |
client.connect(port,host,function(){ | |
client.write('hello server'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::string src = " aa |b \t ccc[gg] "; | |
std::vector<std::string> list; | |
boost::split(list, std::string(src), boost::is_any_of(" \t,;\r\n|[]"), boost::token_compress_on); | |
if (list.size() <= 0) | |
return; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (A) | |
time.AfterFunc(5 * time.Minute, func() { | |
fmt.Printf("expired") | |
} | |
// (B) create a Timer object | |
timer := time.NewTimer(5 * time.Minute) | |
<-timer.C | |
fmt.Printf("expired") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ | |
cout << "hello, world." << endl; | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
int main(int argc, char *argv[]) | |
{ | |
printf("Hello world!\n"); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1beta1 | |
kind: Deployment | |
metadata: | |
name: httpd | |
spec: | |
replicas: 3 | |
template: | |
metadata: | |
labels: | |
app: httpd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: batch/v2alpha1 | |
kind: CronJob | |
metadata: | |
name: hello | |
spec: | |
schedule: "*/1 * * * *" | |
jobTemplate: | |
spec: | |
template: | |
spec: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: myjob | |
spec: | |
template: | |
metadata: | |
name: myjob | |
spec: | |
containers: |