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
func scan(str string)[]string { | |
var head []string | |
var tail string | |
if str == "" { | |
return []string{} | |
}else{ | |
x := string(str[0]) | |
switch x { | |
case "'": |
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
irb(main):132:0> str | |
=> "a b 'c d' e" | |
irb(main):133:0> scan(str) | |
=> ["a", "b", "c d", "e"] |
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 "fmt" | |
import "os" | |
import "os/exec" | |
import "net/http" | |
func main() { | |
port := os.Args[1] | |
script := os.Args[2] |
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
(1..100).map do |i| | |
case [i % 3, i % 5] | |
in [0, 0] | |
"FizzBuzz" | |
in [0, _] | |
"Fiz" | |
in [_, 0] | |
"Buzz" | |
else | |
i.to_s |
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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package cn.orz.pascal.tinybench; | |
import java.io.IOException; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; |
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
String str = "a吉野屋𠮷野\r\n屋ア緣イ?"; | |
// byte[] bytes = str.getBytes("Windows-31j"); | |
char alt = '□'; | |
final String charset = "Windows-31j"; | |
String filteredStr = filterLowSurrogate(str); | |
String translatedStr = new String(str.getBytes(charset), Charset.forName(charset)); | |
StringBuilder sb = new StringBuilder(filteredStr.length()); | |
for (int i = 0; i < filteredStr.length(); i++) { |
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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package cn.orz.pascal.tinybench; | |
import java.io.IOException; | |
import java.nio.file.Path; | |
import java.text.ParseException; |
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
public static void checkJavacOptimizationPlus() { | |
String hello = "hello(v)"; | |
String world = "world(v)"; | |
final String HELLO = "hello(c)"; | |
final String WOLRD = "world(c)"; | |
String mixedStr2 = "hello(l)" + "world(l)" + HELLO + WOLRD + hello + world; | |
} |
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
docker run -d --name zookeeper -p 2181:2181 confluent/zookeeper | |
docker run -it --name kafka -p 9092:9092 --link zookeeper:zookeeper confluent/kafka | |
kafka-topics --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 1 --topic test | |
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: argoproj.io/v1alpha1 | |
kind: Workflow | |
metadata: | |
generateName: wf-exec-ml- | |
spec: | |
entrypoint: exec-ml | |
volumes: | |
- name: google-cloud-key | |
secret: | |
secretName: btc-prediction-key |