Closed
Description
行号高度与代码高度不一致,仅包含空格的空行会导致行号计算问题
https://ld246.com/article/1724737366356
复制下面的代码直接粘贴到代码块里:
import redis.clients.jedis.Jedis;
public class HyperLogLogExample {
public static void main(String[] args) {
// 连接 Redis 服务器
Jedis jedis = new Jedis("localhost");
// 创建一个 HyperLogLog 实例
String hyperLogLogKey = "unique_users";
// 模拟用户访问行为,向 HyperLogLog 中添加元素
jedis.pfadd(hyperLogLogKey, "user1", "user2", "user3", "user4");
// 获取 HyperLogLog 的基数估计结果
long estimatedCount = jedis.pfcount(hyperLogLogKey);
System.out.println("Estimated unique users: " + estimatedCount);
// 模拟新的用户访问
jedis.pfadd(hyperLogLogKey, "user5", "user6", "user7");
// 更新基数估计结果
estimatedCount = jedis.pfcount(hyperLogLogKey);
System.out.println("Updated estimated unique users: " + estimatedCount);
// 关闭 Redis 连接
jedis.close();
}
}
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
MuuToT commentedon Aug 27, 2024
我重新测了下 好似是因为这里有个不可见的东东导致的
TCOTC commentedon Aug 27, 2024
眼神真好,第 10 行的高度为零:
gagmeng commentedon Aug 27, 2024
TCOTC commentedon Aug 27, 2024
@gagmeng 如果是用了主题,更新一下主题或者跟主题仓库反馈一下
88250 commentedon Aug 28, 2024
我先关闭了,如果还有问题请继续跟帖,谢谢 🙏
I'll close it now. If you have any questions, please continue to post. Thank you 🙏
MuuToT commentedon Aug 28, 2024
@88250 这里默认主题也会有这个情况 为啥会有个零高的行啊
88250 commentedon Aug 28, 2024
@Vanessa219 仅包含空格的空行会导致行号计算问题。
[-]行号高度与代码高度不一致[/-][+]Lines containing only spaces in a code block cause line number calculation errors[/+]gagmeng commentedon Aug 28, 2024
是因为主题的原因导致的吗?我是其它主题也是一样出问题了
TCOTC commentedon Aug 28, 2024
@gagmeng 你截图里的那个行高不一致的症状看起来是主题的问题。因为新版本 DOM 改了,所有主题都需要适配
🐛 #12346