
编程范式,设计模式
文章平均质量分 87
FeatureOverload
github.com/RDpWTeHM
展开
-
【Leetcode】可以一行(One-Liner)Python代码解决的 Leetcode 问题 - 掌握 Python 高阶函数
Overview高阶函数reduce1281. Subtract the Product and Sum of Digits of an Integerreduce 的典型用法自己实现 `sum` 功能的函数使用匿名函数 lambda 实现阶乘 N!N!N!1486. XOR Operation in an Array反转字符串sorted1356. Sort Integers by The Number of 1 Bitsall844. Backspace String Compareany - N/Af原创 2020-07-23 10:59:47 · 812 阅读 · 0 评论 -
【程序设计】【Python】面向方面编程(Aspect-oriented programming)- 注:未完成
desc: n/aOverviewFinish MEReferencehttps://en.wikipedia.org/wiki/Cross-cutting_concern????https://en.wanweibaike.com/wiki-Cross-cutting%20concernFinish MEReferenceN/A原创 2020-04-21 11:07:59 · 273 阅读 · 0 评论 -
【程序设计】【python】dispatch - 注:未完成
desc: n/aOverviewTemplate method patternExampleDjango Dispatch in ViewDispatch in ScrapyReferenceTemplate method patternhttps://en.wikipedia.org/wiki/Template_method_pattern????https://en.wanweiba...原创 2020-04-21 11:04:21 · 731 阅读 · 0 评论 -
【C】【OOPC】(logging) 一份简单功能的类 Python Logging 功能的 logging 类实现
OverviewLogging测试ReferenceLogging#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <stdarg.h>#include <time.h>void comm...原创 2019-06-04 17:43:11 · 299 阅读 · 0 评论 -
【C】【OOPC】【链表】一份在递归函数中可用的 List 实现 - 实例:深度优先遍历算法遍历树结构获取树末端节点的值
Overview1 树 - 数据结构1.1 树 - 图示1.2 抽象程序语言内的树结构1.3 树结构实现代码1.4 初始化和构造树-实例对象2 遍历树算法 - 深度优先算法递归实现3 OOPC 链表实现Reference附附 A附 B附 C附 D提醒: 这篇博客很长,代码有点儿长,内容有点儿难度1 树 - 数据结构1.1 树 - 图示这里的树数据结构使用的是 TR098 model 作...原创 2019-06-02 01:02:45 · 644 阅读 · 0 评论 -
【重构】【技巧】个人笔记
Overview1 重构函数1.1 Replace Temp with Query(以查询取代临时变量)1 重构函数1.1 Replace Temp with Query(以查询取代临时变量)这是一个很使用的技巧,C 语言可以使用 const 对应 final。...原创 2019-05-31 22:26:29 · 154 阅读 · 0 评论 -
Structuring the Program
原文链接 *Outline of topics*Programming in the LargeSoftware Design MethodsConcepts which support modularityEncapsulationInterfaceSeparate and independent compilationOutline of topicsSoftware Design M...转载 2019-05-08 09:54:02 · 424 阅读 · 0 评论 -
【Python】高阶函数
Overview1 map - reduce1 map - reduceReference: https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/0014317852443934a86aa5bb5ea47fbbd5f35282b331335000#0Python内建了map()...原创 2019-05-02 18:18:44 · 221 阅读 · 0 评论 -
【设计模式】实例 - (Super Link) Serial 版 - basic
(Super Link) Serial 版 - basic结合了设计模式实现的 Serial 程序(用于实现 web serial(网页版串口调试助手))用到:单例模式 (及其变体)观察者模式状态模式 (Super Link) Serial 版 - basic观察者模式 - 检测硬件改动观察者模式-observer + 状态模式 + 观察者模式-publisher运行测试/使用 d...原创 2018-12-30 23:50:04 · 283 阅读 · 0 评论 -
[Python] 可变对象及定义时引用造成的坑 -动态类型就应该像动态类型地 coding
[Python] 可变对象及定义时引用造成的坑 -动态类型就应该像动态类型地 coding草稿!!!def fn(var1, var2=[]): var2.append(var1) print(var2)fn(6)[6]fn(9)[6, 9]class URLCatcher(object): urls = [] def add_ur...原创 2018-12-17 20:02:20 · 273 阅读 · 0 评论 -
【Python】创建 final +单例模式 的 管理/分配资源类
【Python】创建 final +单例模式 的 管理/分配资源类keywords: final; subclass; Singleton; 【Python】创建 final +单例模式 的 管理/分配资源类磨刀`@final` 装饰类单例模式砍柴Code(实例)Reference升级 python 版本(到 3.6/3.7)磨刀@final 装饰类from typing import ...原创 2018-12-21 10:43:37 · 854 阅读 · 0 评论 -
Why use @classmethod?
Posted on Jul 20, 2017 by doesitmatterWhy use @classmethod?本文从一个网站转载,做了适应 优快云 blog 的排版。原文点击标题 翻译 2018-12-03 20:26:22 · 214 阅读 · 0 评论 -
[流畅的 C] const 在函数中的使用技巧
[C] const 用法测试文章目录测试代码usageReference测试代码#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;#include &amp;lt;string.h&amp;gt;int main(int argc, char *argv[]){ int bar = 8; char cfoo =原创 2018-11-02 10:47:33 · 668 阅读 · 0 评论