oaix's recent timeline updates
oaix

oaix

V2EX member #77973, joined on 2014-10-21 15:20:07 +08:00
9 G 19 S 71 B
oaix's recent replies
Apr 9, 2025
Replied to a topic by tenserG 算法 面试遇到怪题,大家有什么思路吗
Apr 8, 2025
Replied to a topic by tenserG 算法 面试遇到怪题,大家有什么思路吗
不考虑分布的话,感觉可以这样分:

```python
import random


def sample(m, n):
low = 1
upper = m * 0.3

remain = m
result = []
for _ in range(n-1):
x = low + min(remain-low, upper) * random.random()
remain -= x
result.append(x)
result.append(remain)
random.shuffle(result)
return result


for i in range(10):
print(sample(100, 10))
```
Sep 7, 2024
Replied to a topic by kkbear MySQL 咨询个 SQL 数据去重的问题
如果不用追求 100%准确,并且时间段最小粒度是天。可以每天算一个 hyperloglog ,存起来。查询的时候把对应日期的 hyperloglog 合并起来。
这个数据有些诡异:

吞吐=并发/平均响应时间

但从数据上来看平均响应小的框架,QPS 反而不高。
已恢复
Jun 10, 2023
Replied to a topic by mannixSuo 程序员 对 Java 泛型的顶级理解
只要我看不懂的代码:过度设计,只要看不懂我写的代码:辣鸡🐶
可以用 String Manipulation 插件
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2493 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 15:48 · PVG 23:48 · LAX 08:48 · JFK 11:48
♥ Do have faith in what you're doing.