腾讯云 k8s java 程序参数配置 2019年8月28日 | Leave a comment 解决: 在腾讯云 pod 界面 按行分开 如 -Xmx1024m -Xms512m -Duser.timezone=GMT+8 -Djava.security.egd=file:/dev/./urandom -jar /app/my.jar --server.port=80 1234567 -Xmx1024m-Xms512m-Duser.timezone=GMT+8-Djava.security.egd=file:/dev/./urandom-jar/app/my.jar--server.port=80 … Read More
加入 taobao sdk 后 maven compile 卡住 2019年8月21日 | Leave a comment 一直编译中 解决: 调试发现一直在扫描 taobao jar 包里边的东西 解压 taobao… Read More
【转】How to Build Good Software 2019年8月20日 | Leave a comment https://www.csc.gov.sg/articles/how-to-build-good-softw… Read More
apache client https 禁止证书检测 2019年8月13日 | Leave a comment 解决: /** * 绕过验证 * * @return * @throws NoSuchAlgorithmException * @throws KeyManagementException */ static SSLContext createIgnoreVerifySSL() throws NoSuchAlgorithmException, KeyManagementException { SSLContext sc = SSLContext.getInstance("SSLv3"); // 实现一个X509TrustManager接口,用于绕过验证,不用修改里面的方法 X509TrustManager trustManager = new X509TrustManager() { @Override public void checkClientTrusted( java.security.cert.X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } @Override public void checkServerTrusted( java.security.cert.X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } @Override public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; } }; sc.init(null, new TrustManager[]{trustManager}, null); return sc; } public static CloseableHttpClient ignoreSSLClient() throws KeyManagementException, NoSuchAlgorithmException { //采用绕过验证的方式处理https请求 SSLContext sslcontext = HttpUtils.createIgnoreVerifySSL(); //设置协议http和https对应的处理socket链接工厂的对象 Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create() .register("http", PlainConnectionSocketFactory.INSTANCE) .register("https", new SSLConnectionSocketFactory(sslcontext)) .build(); PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry); HttpClients.custom().setConnectionManager(connManager); //创建自定义的httpclient对象 CloseableHttpClient client = HttpClients.custom().setConnectionManager(connManager).build(); return client; } 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 /** * 绕过验证 * * @return * @throws NoSuchAlgorithmException * @throws KeyManagementException */ static SSLContext createIgnoreVerifySSL() throws NoSuchAlgorithmException, KeyManagementException { SSLContext sc = SSLContext.getInstance("SSLv3"); // 实现一个X509TrustManager接口,用于绕过验证,不用修改里面的方法 X509TrustManager trustManager = new X509TrustManager() { @Override public void checkClientTrusted( java.security.cert.X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } @Override public void checkServerTrusted( java.security.cert.X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } @Override public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; } }; sc.init(null, new TrustManager[]{trustManager}, null); return sc; } public static CloseableHttpClient ignoreSSLClient() throws KeyManagementException, NoSuchAlgorithmException {//采用绕过验证的方式处理https请求 SSLContext sslcontext = HttpUtils.createIgnoreVerifySSL(); //设置协议http和https对应的处理socket链接工厂的对象 Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create() .register("http", PlainConnectionSocketFactory.INSTANCE) .register("https", new SSLConnectionSocketFactory(sslcontext)) .build(); PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry); HttpClients.custom().setConnectionManager(connManager); //创建自定义的httpclient对象 CloseableHttpClient client = HttpClients.custom().setConnectionManager(connManager).build(); return client; } &nbs… Read More
缓存注意!!serialVersionUID 2019年7月25日 | Leave a comment https://docs.oracle.com/javase/6/docs/platform/serializ… Read More
ios UIScrollView 里边放一个 UIStackView 该怎么设置 AutoLayout 约束 2019年7月11日 | Leave a comment 问题 UIScrollView 里边放一个 UIStackView 该怎么设置 AutoLayout 约束 &… Read More
swift toJson 2019年7月4日 | Leave a comment 问题: 解决: import Foundation func toJson(obj : Any) -> String?{ do { let aa = toObj(obj:obj) let jsonData = try JSONSerialization.data(withJSONObject: aa, options: []) let jsonString = String.init(data: jsonData, encoding: .utf8) return jsonString } catch { print(error) return nil } } func toObj(obj : Any) -> Any{ if let a = obj as? [Any] { var a2 = [Any]() for e in a { let d = toObj(obj: e) a2.append(d) } return a2 }else if obj is Int || obj is String || obj is Bool || obj is Float || obj is Double || obj is NSNull { return obj } else { let dic = toDictionary(obj: obj); if dic.count > 0 { return dic }else {////optional none return obj } } } func toDictionary(obj : Any) -> [String: Any] { var dictionary = [String: Any]() let otherSelf = Mirror(reflecting: obj) for child in otherSelf.children { guard let key = child.label else { continue } let v = child.value dictionary[key] = toObj(obj:v) } return dictionary } extension Dictionary { func floatValue(_ name:Dictionary.Key) ->Float?{ var ret : Float? = nil if let n = self[name] as? NSNumber { ret = n.floatValue }else if let f = self[name] as? Float { ret = f } return ret } } 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 import Foundation func toJson(obj : Any) -> String?{ do { let aa = toObj(obj:obj) let jsonData = try JSONSerialization.data(withJSONObject: aa, options: []) let jsonString = String.init(data: jsonData, encoding: .utf8) return jsonString } catch { print(error) return nil }}func toObj(obj : Any) -> Any{ if let a = obj as? [Any] { var a2 = [Any]() for e in a { let d = toObj(obj: e) a2.append(d) } return a2 }else if obj is Int || obj is String || obj is Bool || obj is Float || obj is Double || obj is NSNull { return obj } else { let dic = toDictionary(obj: obj); if dic.count > 0 { return dic }else {////optional none return obj } }} func toDictionary(obj : Any) -> [String: Any] { var dictionary = [String: Any]() let otherSelf = Mirror(reflecting: obj) for child in otherSelf.children { guard let key = child.label else { continue } let v = child.value dictionary[key] = toObj(obj:v) } return dictionary} extension Dictionary { func floatValue(_ name:Dictionary.Key) ->Float?{ var ret : Float? = nil if let n = self[name] as? NSNumber { ret = n.floatValue }else if let f = self[name] as? Float { ret = f } return ret }} … Read More
如何定制 spring security 403 返回的错误 2019年7月1日 | Leave a comment 问题: 默认返回的 解决: [crayon-67472b63b930… Read More
【转】什么是服务治理平台? 2019年6月21日 | Leave a comment https://blog.csdn.net/simplemurrina/article/details/841… Read More