摘要: #C语言max宏的进化 ##lv1:shit #define MAX(a, b) a > b ? a : b 问题所在不必多言 ##lv2:角度:参数也可为expr 解: #define MAX(a, b) (a) > (b) ? (a) : (b) bug示例: #include "stdio.h 阅读全文
posted @ 2022-09-25 15:19 阿莫誒 阅读(80) 评论(0) 推荐(0) 编辑
摘要: #OO Unit4 Summary Part1:架构设计 以类图为例,封装MyImplemention类,实现UserApi的接口,同时关联classDiagram、sequenceDiagram、stateDiagram,在各自的diagram中实现功能,MyImplemention负责调用。 对 阅读全文
posted @ 2022-06-29 15:33 阿莫誒 阅读(28) 评论(0) 推荐(0) 编辑
摘要: #OO Unit3 Summary Part1:自测数据 单条指令 直接采用随机数的方法生成 ```python def ap(persons,groups): id = random.randint(0, 2147483647) if id not in persons: persons.appe 阅读全文
posted @ 2022-06-06 15:55 阿莫誒 阅读(36) 评论(0) 推荐(0) 编辑
摘要: #OO Unit2 Summary ##Part1:同步块 锁的选择 在完成这单元第一次作业的时候,荣老师简明扼要地提出 synchronized 、wait、notifyAll就完事了,所以在完成第一次作业的时候我并没有采用Java中的Lock类,包括ReentrantLockd等。而这个做法也延 阅读全文
posted @ 2022-04-28 17:09 阿莫誒 阅读(48) 评论(1) 推荐(0) 编辑