2024年11月11日 星期一

[csharp]發生 Managed Debugging Assistant 'NonComVisibleBaseClass' 錯誤

 我不知道原因,但只知道解法。從解法來看,是 VS IDE 管太多卡到舊DLL了。


In Visual Studio 2019: 

Debug Menu, Windows --> Exception settings, opens the Exception settings window. 

There expand "Managed Debugging Assistants" and finally uncheck NonComVisibleBaseClass


參考:

https://stackoverflow.com/questions/1049742/noncomvisiblebaseclass-was-detected-how-do-i-fix-this

2024年8月27日 星期二

[golang]http.HandleFunc 新的 routing pattern

 在 Go1.22 的時候,讓 http.HandleFunc 新的 routing pattern 可以用變數的形式拿到 URL 路徑裡的值


要使用這個功能,要讓 go build 使用新的編譯方法,不然它總是用舊方法編譯,這是為了相容性。


最簡單就是在 go.mod 裡加上一行 go 1.22 或是 go 1.23





https://stackoverflow.com/questions/28745161/with-gos-webserver-where-does-the-root-of-the-website-map-onto-the-filesystem


https://tip.golang.org/doc/godebug


https://programmingpercy.tech/blog/exciting-go-update-v-1-22/


https://github.com/babafemi99/up-I-go/blob/main/main.go


https://gowithore.hashnode.dev/go-up-or-go-down


https://stackoverflow.com/questions/24116147/how-to-download-file-in-browser-from-go-server


https://mileslin.github.io/2020/03/Golang/%E5%BB%BA%E7%AB%8B%E4%B8%8B%E8%BC%89%E6%AA%94%E6%A1%88%E7%9A%84-Http-Response/

2024年3月18日 星期一

[secs]HSMS timeout

 T6: Active 端

    select.req <-T6-> select.rsp

T7: Passive 端

    open -> not_select <-T7-> select

T5: Active 端

    connect_fail <-T5-> connecting

T8: msg:{B <-T8-> B...}

2024年3月7日 星期四

[csharp]C# 如何得知某個 class 有實作某個介面

 ## 方法

1. objectType.GetInterfaces().Contains(interfaceType)


2. interfaceType.IsAssignableFrom(objectType)


3. objectType.IsAssignableTo(interfaceType)


4. objectType.GetInterface(nameof(interface)) != null


## 參考來源

https://www.facebook.com/groups/1706638306295947/?multi_permalinks=3338835626409532

2024年1月7日 星期日

[vmware]突然出現 misc.rsba_no 不存在的問題

 是否出現 misc.rsba_no 不存在的問題?其實解答不是表面上可以看到的。


我最近突然遇到很多個 suspend 的 vm 開起來就出現這個問題,導致許多暫存的東西皆無法回復。


回頭去查發現這情況都發生在主機的 hyper-v 功能打開之後,來回測試一番,覺得應該是 CPU 特性有改變,讓 vmware 無法回復狀態。


很重要的資料在 vm 裡沒存的話,還是改回去做處理。

2023年12月19日 星期二

[C#]C# 最近出現的 ? ! 是做什麼用的?

 C# 最近出現的 ? ! 是做什麼用的?


最近終於找到一個圖快速介紹這些?!是做什麼用的。


主要是用以解決 null 相關的問題的語法糖


https://twitter.com/mwaseemzakir/status/1647856976477450240/photo/1


Ternary Operator (?:)

Null Forgiving Operator (!.)

Null Conditional Operator (?.)

Null Coalescing Operator (??)

Null Coalescing Assignment Operator (??=)

2022年12月14日 星期三

[DDS]Vortex Opensplice 建議跳槽到 Cyclone DDS

> We, therefore, encourage the Vortex Opensplice open source community users to consider migrating to Cyclone DDS.

看到就準備要跳了喔 


https://github.com/ADLINK-IST/opensplice


For more than a decade, the Vortex Opensplice open source project helped to evangelise and successfully deploy the OMG Data Distribution Service Technology in thousands of industrial and academic projects worldwide. The Vortex Opensplice core team and the community have gained tremendous experience and know-how from these interactions.


Capitalizing on our lengthy experience developing data-centric middleware in real-time distributed systems the core team launched Cyclone DDS, a brand-new open source OMG DDS implementation. Cyclone DDS under the Eclipse foundation governance continues our mission to fuel innovation and serve a more diverse customer base. It is gaining momentum in many opensource frameworks and industrial contexts including ROS2 , Autoware etc. It also represents a genuinely open-source data distribution solution with full source code access and updates.


Buoyed by this success and adoptions, it became obvious that the focus of the core team and the community should now be Cyclone DDS. We, therefore, encourage the Vortex Opensplice open source community users to consider migrating to Cyclone DDS. The migration is straightforward when the ISO CPP V2 APIs are in use. For users that are building mission- and/or business-critical systems, ADLINK continues to support Vortex Opensplice Professional Edition and offers a commercially supported version with extra features and guarantees of support.