]> Zhao Yanbai Git Server - acecode.git/commitdiff
...
authoracevest <zhaoyanbai@126.com>
Tue, 24 Aug 2021 02:00:00 +0000 (10:00 +0800)
committeracevest <zhaoyanbai@126.com>
Tue, 24 Aug 2021 02:00:00 +0000 (10:00 +0800)
tools/comm/aut.py [new file with mode: 0755]
tools/mcu/DigitStrCompress/go.mod [new file with mode: 0644]
tools/mcu/DigitStrCompress/main.go [new file with mode: 0644]

diff --git a/tools/comm/aut.py b/tools/comm/aut.py
new file mode 100755 (executable)
index 0000000..e1dd8c0
--- /dev/null
@@ -0,0 +1,41 @@
+#!/usr/bin/python3
+# -*- coding: utf-8 -*-
+# ------------------------------------------------------------------------
+#   File Name: aut.py
+#      Author: Zhao Yanbai
+#              2021-08-20 10:56:36 Friday CST
+# Description: none
+# ------------------------------------------------------------------------
+
+import argparse
+import socket
+import sys
+
+
+def UDPServer(addr) :
+    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+    s.bind(addr)
+    while True :
+        data = s.recv(1024)
+        sys.stdout.write(data.decode(sys.stdout.encoding))
+        sys.stdout.flush()
+
+
+
+def main() :
+    parser  = argparse.ArgumentParser(prog='aut', description='AceVest UDP Tool', epilog='')
+    parser.add_argument('host',             help='hostname or host ip')
+    parser.add_argument('port', type=int,   help='port')
+    parser.add_argument('-l',   '--listen',     action='store_true', help='Bind and listen for incoming connections')
+    parser.add_argument('-v',   '--version',    action='version', version='%(prog)s 0.2')
+    arg = parser.parse_args()
+
+    addr = (arg.host, arg.port)
+    if arg.listen :
+        UDPServer(addr)
+    else :
+        UDPClient(addr)
+
+
+if __name__ == "__main__" :
+    main()
diff --git a/tools/mcu/DigitStrCompress/go.mod b/tools/mcu/DigitStrCompress/go.mod
new file mode 100644 (file)
index 0000000..3897864
--- /dev/null
@@ -0,0 +1,3 @@
+module DigitalStringCompress
+
+go 1.14
diff --git a/tools/mcu/DigitStrCompress/main.go b/tools/mcu/DigitStrCompress/main.go
new file mode 100644 (file)
index 0000000..1d3201d
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * ------------------------------------------------------------------------
+ *   File Name: main.go
+ *      Author: Zhao Yanbai
+ *              2021-04-28 17:27:01 Wednesday CST
+ * Description: none
+ * ------------------------------------------------------------------------
+ */
+
+package main
+
+import (
+       "fmt"
+       "math/big"
+)
+
+const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+
+func DigitalStringCompress(ds string) string {
+       var cs string
+
+       n := big.NewInt(0)
+
+       base := big.NewInt(10)
+       for c := range ds {
+               n.Mul(n, base)
+               n.Add(n, uint64(c))
+       }
+
+       return "s"
+}
+
+func main() {
+       defer fmt.Println("Program Exited...")
+
+}