原创 Golang 使用const定義枚舉

package main import ( "fmt" ) // 使用const 來定義一個Color的枚舉 type Color int const ( RED Color = iota BLACK ) type Tre

原创 Go 二分查找法

func search(nums []int, target int) int { min := 0 max := len(nums) - 1 mid := max - min for min <= max { mid

原创 將GO 的併發簡單封裝成一個函數

  ///filelist 待處理的切片 ///f 具體執行的函數 --例如,遍歷filelist,拿到每一個元素,作爲參加數傳給f函數進行處理 func H_Goroutine(filelist []string,f func(s

原创 Win7添加程序進右鍵菜單

運行regedit 找到HKEY_CLASSES_ROOT\Directory\Background\shell 新建項-填寫名稱(怎麼好記怎麼填)例如:GoLand 新建項-command 雙擊command裏的"默認",將你想要的程序

原创 python 讀取中文路徑的亂碼問題

在使用os.listdir(r"C:\中文路徑")時會提示亂碼問題. import os pathname = r"D:\中文路徑" paths = os.listdir(pathname.encode("gbk").decode("

原创 OneKeySetMat

macroScript OneKeySetMat category:"HYQ SDTools" toolTip:"OneKeySetMat" (---------------------------------------

原创 3dsmax script 使用腳本獲取激活材質球所關連的物體

fn GetObjsFromActiveMat = ( --local Mtls = #() --所選物體的材質名集合 local resultObjs=#() local noMatObj = #() mat

原创 Unity 裏使用Windows.Forms的方法記錄

找到如下兩個dll, System.Deployment.dll(D:\Program Files\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.5) System.Windows.Forms

原创 Golang正則表達式 與 strings 結合獲取文件信息

package main import ( "bufio" "fmt" "io" "io/ioutil" "os" "regexp" "strings" ) func main() { path := `.\i

原创 3dsmax獲取文件相關屬性

/*numcontents = fileProperties.getNumProperties #contents --獲取contents裏所有屬性的數量 numsummary = fileProperties.getNum

原创 Golang字符串遍歷

  package main import (     "fmt" ) func main() {     v4 :='  牀前明月光, 疑似地上霜. 舉着望明月, 低頭思故鄉. `          v6 := []run

原创 Golang 正則提取相關信息

package main import ( "encoding/csv" "fmt" "github.com/hyq/Tools" "os" "path/filepath" "regexp" "strconv"

原创 VScode 調試Golang

 1,在VScode找到Go插件 2,在VSCode裏的菜單欄裏找到"查看"-"調試"-"添加配置",打開一個launch.json文件,將下面的複製進去替換. 注意將 "env": {                 "GOPATH"

原创 3dsmax Script 數組去重複元素

fn RemoveTheSame List = ( local Alist=#() for item in List do ( if findItem Alist item == 0 then append Alist

原创 3dsmax script 去除重複元素

----去除重複元素 --List 需要處理的數組 --返回一個數理好的的數組 fn RemoveTheSame List = ( try ( local Alist=#() if List.c