02 原型模式

原型模式 参考文章 原型模式 package prototype_pattern type Person struct { Name string Age int } type Cloner interface { Clone() interface{} } func (s *Person) Clone() interface{} { var n Person n.Name = s.Name n.Age = s.Age return n }……

Continue reading

01 单例模式

单例模式 从网上找的 单例模式 golang实现 参考的文章Go语言中的单例模式 代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 package example import ( "sync" ) // the singleton struct/object type singleton struct{} var instance *singleton var once sync.Once func GetSingleInstance() *singleton { once.Do(func() { instance = &singleton{} }) return instance }……

Continue reading

SSL TLS Diffie Hellman Modulus 1024 Bits

Liberty Profile 这个要修复,可能要修改两个地方。 server.xml 加入 1 2 3 <ssl id="defaultSSLConfig" keyStoreRef="defaultKeyStore" securityLevel="CUSTOM" enabledCiphers="TLS_RSA_WITH_AES_128_CBC_SHA TLS_RSA_WITH_AES_128_CBC_SHA256 "/> jvm.options加入 -Djdk.tls.disabledAlgorithms=SSLv3, RC4, DH keySize <768……

Continue reading

Python Nest

背景 最近有做一个nestjs的项目,用的nestjs实现的微服务,如果所有的功能都用node/nestjs写,那倒也没有什么问题了。可是有一个功能是需要用到机器学习,代码是用python写的,需要用python实现一个微服务,供nest app来调用,同时,python代码也需要调……

Continue reading