上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 119 下一页
摘要: GeovinDuState.py #状态模式 State Pattern class ComputerState(object): name = "state" allowed = [] def switch(self, state): """ Switch to new state """ if 阅读全文
posted @ 2022-10-26 23:43 ®Geovin Du Dream Park™ 阅读(37) 评论(0) 推荐(0)
摘要: GeovinDuTemplate.py # 模板方法模式 Template Method Pattern def get_text(): return "text 文件" """ method to get the xml version of file""" def get_xml(): retu 阅读全文
posted @ 2022-10-26 22:49 ®Geovin Du Dream Park™ 阅读(33) 评论(0) 推荐(0)
摘要: GeovinDuVisitor.py # 访问者模式 Visitor Pattern GeovinDuVistitor.py class Courses_At_GFG: def accept(self, visitor): visitor.visit(self) def teaching(self, 阅读全文
posted @ 2022-10-25 23:10 ®Geovin Du Dream Park™ 阅读(36) 评论(0) 推荐(0)
摘要: GeovinDuStrategy.py # 策略模式 Strategy Pattern Types of trading strategies: class RiskyTradingStrategy(object): def MakeTrades(self): print("进行高风险交易!") c 阅读全文
posted @ 2022-10-25 21:54 ®Geovin Du Dream Park™ 阅读(42) 评论(0) 推荐(0)
摘要: GeovinDuObserver.py # 观察者模式 Observer Pattern # The Observer class that recieves updates from the ticker on a specific symbol: class TickerObserver(obj 阅读全文
posted @ 2022-10-24 22:05 ®Geovin Du Dream Park™ 阅读(37) 评论(0) 推荐(0)
摘要: DuMediator.py # 中介者模式 Mediator Pattern import sys # ParticipantReference: class User(object): def __init__(self, med, name): self.mediator = med self. 阅读全文
posted @ 2022-10-24 06:42 ®Geovin Du Dream Park™ 阅读(33) 评论(0) 推荐(0)
摘要: DuIterator.py # 迭代器模式 Iterator Pattern # Doubly Linked List class Node(object): def __init__(self, value, nextNode, prevNode): self.value = value self 阅读全文
posted @ 2022-10-23 23:49 ®Geovin Du Dream Park™ 阅读(36) 评论(0) 推荐(0)
摘要: DuChain.py # 责任链模式 Chain of Responsibility import enum # Item Types: # An enum we'll attach to every game object to specify type: # Requires Python 3. 阅读全文
posted @ 2022-10-23 08:22 ®Geovin Du Dream Park™ 阅读(41) 评论(0) 推荐(0)
摘要: DuProxy.py # 代理模式 Proxy Pattern from abc import ABCMeta, abstractmethod import abc import random class ISubject(metaclass=ABCMeta): "An interface impl 阅读全文
posted @ 2022-10-22 23:14 ®Geovin Du Dream Park™ 阅读(20) 评论(0) 推荐(0)
摘要: from: Open Source QRCode Library - CodeProject https://www.codeproject.com/articles/20574/open-source-qrcode-library QRCodeEncoder.cs edit using Syste 阅读全文
posted @ 2022-10-22 13:13 ®Geovin Du Dream Park™ 阅读(72) 评论(0) 推荐(0)
上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 119 下一页