zno2

上一页 1 2 3 4 5 6 7 ··· 21 下一页

2023年6月9日 #

19) Memento pattern

摘要: 类别: Behavioral Pattern (备忘录模式) 问题: 方案: 示例: import java.util.ArrayList; import java.util.List; public class MementoPatternDemo { public static void mai 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(8) 评论(0) 推荐(0) 编辑

18) Mediator pattern

摘要: 类别: Behavioral Pattern 问题: encapsulate [ɪn'kæpsjʊleɪt] enclose in a capsule or other small container define an object that encapsulates how a set of o 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(5) 评论(0) 推荐(0) 编辑

17) Iterator pattern

摘要: 类别: behavioral pattern 问题: Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation. 方案 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(7) 评论(0) 推荐(0) 编辑

16) Interpreter pattern

摘要: 类别: behavioral pattern 问题: Polish notation https://en.wikipedia.org/wiki/Polish_notation Abstract syntax tree https://en.wikipedia.org/wiki/Abstract_s 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(6) 评论(0) 推荐(0) 编辑

15) Command pattern

摘要: 类别: Behavioral Pattern 问题: 方案: 示例: import java.util.ArrayList; import java.util.List; public class CommandPatternDemo { public static void main(String 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(4) 评论(0) 推荐(0) 编辑

14) chain of responsibility pattern

摘要: 类别: behavioral pattern 问题: 高耦合,不灵活 if(){ }else if(){ }else if(){ } ... 方案: 示例: public class ChainOfResponsibilityPattern { public static void main(Str 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(7) 评论(0) 推荐(0) 编辑

13) Proxy Pattern

摘要: 类别: Structural Pattern 问题: 操纵一个对象时碍手碍脚,与装饰者模式不同之处: 装饰者是接口方法,授权小 代理则是整个类,授权大 方案: 示例: public class ProxyPatternDemo { public static void main(final Stri 阅读全文

posted @ 2023-06-09 13:35 zno2 阅读(16) 评论(0) 推荐(0) 编辑

12) Flyweight Pattern

摘要: 类别: Structural Pattern 问题/动机: 假若绿色是相同部分,占用1M内存 ,如果提取出来,众对象共享其内容,只占1M内存 ,否则占10M ,且随着对象增多,占用越来越多内存 ,无疑是浪费资源 A flyweight is an object that minimizes memo 阅读全文

posted @ 2023-06-09 13:35 zno2 阅读(7) 评论(0) 推荐(0) 编辑

11) Facade Pattern

摘要: 类别: Structural Pattern 问题/动机: 系统非常复杂 隐藏复杂细节,提供简单界面 方案: 示例: /* Complex parts */ public class FacadePatternDemo { public static void main(String[] args) 阅读全文

posted @ 2023-06-09 13:35 zno2 阅读(11) 评论(0) 推荐(0) 编辑

序) 设计模式参考资料

摘要: https://sourcemaking.com/design_patterns http://javapapers.com/design-patterns/ Design Patterns In software engineering, a design pattern is a general 阅读全文

posted @ 2023-06-09 13:35 zno2 阅读(7) 评论(0) 推荐(0) 编辑

小程序获取手机号

摘要: https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html 从基础库 2.21.2 开始,对获取手机号的接口进行了安全升级,以下是新版本接口使用指南。(旧版本接口目前可以继续使 阅读全文

posted @ 2023-06-09 13:34 zno2 阅读(109) 评论(0) 推荐(0) 编辑

小程序后端服务上线如何配置

摘要: https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html 两种模式:一:无端口(即默认端口443,但是请求时不能带端口) 二:有端口(即便是默认443,也要带着) 阅读全文

posted @ 2023-06-09 13:34 zno2 阅读(40) 评论(0) 推荐(0) 编辑

小程序从头开始

摘要: 1. 申请小程序 https://mp.weixin.qq.com/cgi-bin/wx?token=&lang=zh_CN a 邮箱 b 点击链接 c 填写真实姓名、身份证号 d 手机验证 e 微信扫码验证 2. 完善小程序信息 https://mp.weixin.qq.com/wxamp/hom 阅读全文

posted @ 2023-06-09 13:34 zno2 阅读(4) 评论(0) 推荐(0) 编辑

验签失败!单元测试成功!!究竟是啥坑?

摘要: 错误的入参: rawData > "{\"nickName\":\"拥有你便是拥有一切\",\"gender\":1,\"language\":\"zh_CN\",\"city\":\"Zhangjiakou\",\"province\":\"Hebei\",\"country\":\"China\ 阅读全文

posted @ 2023-06-09 13:34 zno2 阅读(24) 评论(0) 推荐(0) 编辑

小程序入门

摘要: 入口 https://mp.weixin.qq.com/cgi-bin/wx api https://developers.weixin.qq.com/miniprogram/dev/index.html ebook https://developers.weixin.qq.com/ebook?ac 阅读全文

posted @ 2023-06-09 13:34 zno2 阅读(16) 评论(0) 推荐(0) 编辑

2023年6月6日 #

10) Decorator Pattern

摘要: 类别: Structural Pattern 问题: 在不改变接口的前提下增加额外的服务 方案: 示例: public class DecoratorPatternDemo { public static void main(String[] args) { Shape circle = new C 阅读全文

posted @ 2023-06-06 13:22 zno2 阅读(11) 评论(0) 推荐(0) 编辑

9) Composite Pattern

摘要: 类别: Structual Pattern 问题: 方案: 示例: import java.util.ArrayList; import java.util.List; public class CompositePatternDemo { public static void main(Strin 阅读全文

posted @ 2023-06-06 13:22 zno2 阅读(9) 评论(0) 推荐(0) 编辑

8) Filter/Criteria Pattern

摘要: 类别: Structual Pattern 问题: 方案: 示例: import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class Crit 阅读全文

posted @ 2023-06-06 13:21 zno2 阅读(7) 评论(0) 推荐(0) 编辑

7) Bridge Pattern

摘要: 类别: Structural Patterns 问题: 连连看的问题 不使用桥接,要写81 个类,使用桥接,只需要18个类 方案: 示例: public class BridgePatternDemo { public static void main(String[] args) { Somebo 阅读全文

posted @ 2023-06-06 13:21 zno2 阅读(7) 评论(0) 推荐(0) 编辑

6) Adapter Pattern

摘要: 类别: Structural Pattern 问题: 什么是接口?按照标准提供服务,其他想要使用该接口的要按照该标准接入服务 什么是依赖?持有目标对象,拥有使用权(A use B) 数据线?数据线按USB标准接入充电宝,通过lightning 提供充电服务 手机?通过lightning标准接入数据线 阅读全文

posted @ 2023-06-06 13:21 zno2 阅读(13) 评论(0) 推荐(0) 编辑

5) Prototype Pattern

摘要: 类别: Creational Pattern 问题: 不想修改原对象状态,但需要依据当前数据进行计算 方案: 示例: public class PrototypePattern { public static void main(String[] args) { Movie movie = new 阅读全文

posted @ 2023-06-06 13:21 zno2 阅读(7) 评论(0) 推荐(0) 编辑

4) Builder Pattern

摘要: 类别: Creational pattern 问题: 构造函数入参超长易变 方案: 示例: public class BuilderPatternDemo { public static void main(String[] args) { Car.Builder builder = new Car 阅读全文

posted @ 2023-06-06 13:21 zno2 阅读(8) 评论(0) 推荐(0) 编辑

3) Singleton pattern

摘要: 类别: creational Pattern 问题/动机: 反复创建对象开销巨大耗时长消耗内存/重复使用 方案: 示例: // 1 class Demo1 { public final static Demo1 INSTANCE = new Demo1(); private Demo1() { if 阅读全文

posted @ 2023-06-06 13:21 zno2 阅读(14) 评论(0) 推荐(0) 编辑

2) Abstract Factory Pattern

摘要: 类别: Creational Pattern 问题/动机: 如何创建一套父类的问题 情形一:混淆,且不能察觉 // 下面这个方法本来是要建造一辆宝马汽车,但是因为零部件太多,粗心大意误用了奔驰的零件。 public Car createBMWCar(){ Part1 p1 = new com.bmw 阅读全文

posted @ 2023-06-06 13:20 zno2 阅读(10) 评论(0) 推荐(0) 编辑

1) Factory method pattern

摘要: 类别: Creational Pattern 问题/动机 如何创建一套子类的问题(父类引用指向子类实例) 情形1:一个方法返回一个具体的子类 极端情况:1万个子类需要一万个方法吗 极端情况:如过再扩展一万个子类,还需要再增加一万个方法吗 极端情况:虽然有一万个子类,但只需要用到其中一个,其他9999 阅读全文

posted @ 2023-06-06 13:20 zno2 阅读(23) 评论(0) 推荐(0) 编辑

var vs. let

摘要: Block A block statement is used to group zero or more statements. The block is delimited by a pair of curly brackets. let (顺序声明,顺序赋值) Declares a block 阅读全文

posted @ 2023-06-06 13:20 zno2 阅读(8) 评论(0) 推荐(0) 编辑

Re-Declaring JavaScript Variables

摘要: If you re-declare a JavaScript variable, it will not lose its value. https://www.w3schools.com/js/js_variables.asp var a = a || '123'; 上面这个例子,如果之前a被声明 阅读全文

posted @ 2023-06-06 13:20 zno2 阅读(2) 评论(0) 推荐(0) 编辑

使用 apache pdfbox 合并pdf文件

摘要: import java.io.File; import java.util.Iterator; import org.apache.commons.io.FileUtils; import org.apache.commons.io.filefilter.FileFilterUtils; impor 阅读全文

posted @ 2023-06-06 13:20 zno2 阅读(224) 评论(0) 推荐(0) 编辑

Item 1: Consider static factory methods instead of constructors

摘要: 实际应用: package java.lang; public final class Boolean implements java.io.Serializable, Comparable<Boolean> { public static final Boolean TRUE = new Bool 阅读全文

posted @ 2023-06-06 13:19 zno2 阅读(13) 评论(0) 推荐(0) 编辑

initializationError

摘要: HttpUtilsTest.sdfinitializationError(org.junit.runner.manipulation.Filter)java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=sdf 阅读全文

posted @ 2023-06-06 13:19 zno2 阅读(69) 评论(0) 推荐(0) 编辑

java.sql.Blob 转为 java.io.File

摘要: InputStream ins = blob.getBinaryStream(); // 输出到文件 File file = new File("E://test/a.pdf"); OutputStream fos = new FileOutputStream(file); // 下面将BLOB数据 阅读全文

posted @ 2023-06-06 13:19 zno2 阅读(54) 评论(0) 推荐(0) 编辑

Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers

摘要: 1)错误信息 Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service. at org.apac 阅读全文

posted @ 2023-06-06 13:19 zno2 阅读(228) 评论(0) 推荐(0) 编辑

不能直接从jar 读取文件

摘要: What is a file? https://www.computerhope.com/jargon/f/file.htm 文件的权限 delete,execute,read,write,readlink abc.jar 是一个file abc.jar!\test.xml 不是一个file,因为在 阅读全文

posted @ 2023-06-06 13:18 zno2 阅读(14) 评论(0) 推荐(0) 编辑

certificate chain

摘要: http://docs.oracle.com/cd/E19424-01/820-4811/gdzen/index.html A颁发给B,B颁发给C,... 通常起码root证书要是受信任的 Verifying a Certificate Chain Certificate chain verific 阅读全文

posted @ 2023-06-06 13:18 zno2 阅读(15) 评论(0) 推荐(0) 编辑

xades4j 苦苦寻找的是啥 (源码 == 找到了测试用例 == 找到了用法)

摘要: <dependency> <groupId>com.googlecode.xades4j</groupId> <artifactId>xades4j</artifactId> <version>1.3.2</version> </dependency> https://github.com/luis 阅读全文

posted @ 2023-06-06 13:17 zno2 阅读(9) 评论(0) 推荐(0) 编辑

php 初学者在linux上遇到的问题

摘要: 1. 访问 nginx 下的php文件,报404 解决: 安装php yum install php yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mb 阅读全文

posted @ 2023-06-06 13:17 zno2 阅读(8) 评论(0) 推荐(0) 编辑

nginx 和 php

摘要: 如果访问 index.php 那么一定要include fastcgi.conf (是相对路径,这点要注意) 举例: location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; include fastcgi.conf; } 阅读全文

posted @ 2023-06-06 13:17 zno2 阅读(6) 评论(0) 推荐(0) 编辑

xades4j : 如何创建-T

摘要: 用到哪些类,对应哪些元素 xades4j.properties.UnsignedProperties xades4j.properties.UnsignedSignatureProperty xades4j.properties.SignatureTimeStampProperty 具体实现 imp 阅读全文

posted @ 2023-06-06 13:16 zno2 阅读(13) 评论(0) 推荐(0) 编辑

keytool

摘要: http://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html Manages a keystore (database) of cryptographic keys, X.509 certificate chains, 阅读全文

posted @ 2023-06-06 13:16 zno2 阅读(23) 评论(0) 推荐(0) 编辑

字符集问题(mybatis 插入mysql中文乱码,入参是中文)

摘要: 1. 启动/停止/重启/状态 service mysqld start service mysqld stop service mysqld restart service mysqld status mysqld 是守护进程脚本,init.d 不是mysql的home 2. home/进入控制台 阅读全文

posted @ 2023-06-06 13:16 zno2 阅读(180) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 21 下一页

导航