上一页 1 2 3 4 5 6 ··· 272 下一页

2025年12月14日

摘要: AngryPanda 上图来自: https://www.bilibili.com/video/BV1xF4m1j7US/ 来自: https://blog.csdn.net/qyf__123/article/details/85232935 以下中 m 表示bitmap的总容量,n 表示布隆过滤器 阅读全文
posted @ 2025-12-14 12:34 Angry_Panda 阅读(34) 评论(0) 推荐(0)

2025年12月13日

摘要: 1. 将函数绑定到类对象上 from types import MethodType class Student: def __init__(self, name): self._name = name def get_name(obj): print(f"Name is {obj._name}") 阅读全文
posted @ 2025-12-13 21:23 Angry_Panda 阅读(10) 评论(0) 推荐(0)
摘要: ![image](https://img2024.cnblogs.com/blog/1088037/202512/1088037-20251213203019899-1239447146.png) ![image](https://img2024.cnblogs.com/blog/1088037/202512/1088037-20251213203031408-920578825.png) ![i 阅读全文
posted @ 2025-12-13 20:30 Angry_Panda 阅读(7) 评论(0) 推荐(0)
摘要: 代码 1: # x**2-x-1==0 for x in range(2*10_00000): x = x/100000.0 # 0 10 if int((x**2-x-1)*100000) ==0 : print(x) break 代码 2: for x in range(2*10_00000): 阅读全文
posted @ 2025-12-13 20:02 Angry_Panda 阅读(13) 评论(0) 推荐(0)
摘要: 代码: functools.partialmethod from functools import partial, partialmethod class ImageProcessor: def __init__(self, image_path) -> None: self.image_path 阅读全文
posted @ 2025-12-13 16:55 Angry_Panda 阅读(30) 评论(0) 推荐(0)
摘要: 代码: class Node: def __init__(self, data) -> None: self.data = data self.after = None def __str__(self): return f"node : {self.data = }" head_node = No 阅读全文
posted @ 2025-12-13 16:28 Angry_Panda 阅读(38) 评论(0) 推荐(0)
摘要: 代码:(来自:https://blog.csdn.net/weixin_44689630/article/details/99829998) instances = {} def singleton(cls): def get_instance(*args, **kwargs): cls_name 阅读全文
posted @ 2025-12-13 15:52 Angry_Panda 阅读(7) 评论(0) 推荐(0)

2025年12月11日

摘要: 代码: from functools import lru_cache @lru_cache(maxsize=128) def fibonacci(n): if n < 2: return n return fibonacci(n-1) + fibonacci(n-2) # 示例调用 print(f 阅读全文
posted @ 2025-12-11 21:52 Angry_Panda 阅读(7) 评论(0) 推荐(0)
摘要: 代码 1: # 1次 z 3号 2次 x3 4号 3次 x3 5号 def f(n): x = 1 y = 1 if n <= 2: raise ValueError("n must be greater than 2") for _ in range(n-2): z = x + y x = y y 阅读全文
posted @ 2025-12-11 21:34 Angry_Panda 阅读(6) 评论(0) 推荐(0)

2025年12月10日

摘要: 代码 1: import functools import time def timer(func): @functools.wraps(func) def wrapper(*args, **kwargs): start_time = time.time() result = func(*args, 阅读全文
posted @ 2025-12-10 21:47 Angry_Panda 阅读(4) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 272 下一页

导航