为了限制类属性的被外界访问范围,通常在类中设置了set方法和get方法用于对属性值的赋值与取值,这样在对属性赋值取值的时候就会略显复杂。 有没有既能检查参数,又可以用类似属性这样简单的方式来访问类的变量呢?对于追求完美的Python程序员来说,这是必须要做到的! 还记得装饰器(decorator)可 ...
分类:
其他好文 时间:
2020-04-30 23:35:10
阅读次数:
108
import org.apache.commons.lang3.StringUtils; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Created by */ public class RegexUti ...
分类:
移动开发 时间:
2020-04-30 21:17:37
阅读次数:
73
1. 基本使用: 输出 #re #pattern = re.compile() #生成pattern对象#pattern.match #pattern.search#pattern.find str1 = "itest python" pa = re.compile(r"itest")#加r代表是原 ...
分类:
编程语言 时间:
2020-04-30 21:14:33
阅读次数:
71
迭代器模式 迭代器模式(Iterator Pattern)是 Java 和 .Net 编程环境中非常常用的设计模式。 这种模式用于顺序访问集合对象的元素,不需要知道集合对象的底层表示。 迭代器模式属于行为型模式。 TS版本: 介绍 意图:提供一种方法顺序访问一个聚合对象中各个元素, 而又无须暴露该对 ...
分类:
其他好文 时间:
2020-04-30 19:36:42
阅读次数:
55
原始语句: INSERT INTO mail_send ( createTime, updateTime, flag, accountId, messageID, sender, senderName, fromer, replyTo, toer, ccer, bccer, SUBJECT, tex ...
分类:
其他好文 时间:
2020-04-30 15:34:27
阅读次数:
64
Proxy Pattern 代理模式 The proxy pattern provides an object that controls access to another object, intercepting all calls. 代理模式提供一个对象,该对象控制对另一个对象的访问,拦截所有 ...
分类:
编程语言 时间:
2020-04-30 15:33:57
阅读次数:
78
基本介绍 迭代器模式(Iterator Pattern)是 Java 中使用最多的一种模式,它可以顺序的访问容器中的元素,但不需要知道容器的内部细节 模式结构 Iterator(抽象迭代器):定义遍历元素所需的基本方法 ConcreteIterator(具体迭代器):根据自己的需求实现抽象方法,完成 ...
分类:
其他好文 时间:
2020-04-30 11:42:04
阅读次数:
65
https://indexoutofrange.com/Could_not_load_file_or_assembly_or_one_of_its_dependencies/ Reading assembly binding log files (Fusion Log) This is my pre ...
分类:
其他好文 时间:
2020-04-30 11:29:55
阅读次数:
63
一、Redis 中的发布订阅功能 与 Redis 发布订阅相关的命令有 6 个,分别如下: PSUBSCRIBE pattern [pattern …]:订阅一个或者多个符合pattern格式的频道 PUBLISH channel message:发布消息到chanel中 PUBSUB subcom ...
分类:
编程语言 时间:
2020-04-29 12:24:00
阅读次数:
61
装饰者模式 装饰者模式(Decorator),不改变原本对象,动态地给一个对象添加一些额外的职责,比继承更加灵活(继承在扩展功能上是静态的),符合开闭原则(对于扩展是开放的,对于更改是封闭的) Component:抽象的装饰主体 ConcreteComponent:具体的装饰主体 Decorator ...
分类:
其他好文 时间:
2020-04-28 15:00:51
阅读次数:
49