标签: offset

如何使用Kafka SSL&ACL获取kafka偏移量

我有一个带有 SSL&ACL 的 kafka 集群\n当我关闭 ACL 时,我可以从 kafka-consumer-offset-checker.sh 获取偏移量

\n\n

\r\n
\r\n
[root@node128 kafka_2.10-0.10.0.0]# bin/kafka-consumer-offset-checker.sh --zookeeper localhost:2181/kafka-test --group consumer-group-1 --topic testtopic\r\n[2016-09-02 14:03:51,722] WARN WARNING: ConsumerOffsetChecker is deprecated and will be dropped in releases following 0.9.0. Use ConsumerGroupCommand instead. (kafka.tools.ConsumerOffsetChecker$)\r\nGroup           Topic                          Pid Offset          logSize         Lag             Owner\r\nconsumer-group-1 testtopic                      0   99981           99981           0               none
Run Code Online (Sandbox Code Playgroud)\r\n
\r\n
\r\n

\n\n

但是当我这样配置时

\n\n

\r\n
\r\n
ssl.keystore.location=/opt/ssl_key/server.keystore.jks\r\nssl.keystore.password=xdata123\r\nssl.key.password=xdata123\r\nssl.truststore.location=/opt/ssl_key/server.truststore.jks\r\nssl.truststore.password=xdata123\r\n\r\nssl.client.auth=required\r\nssl.enabled.protocols=TLSv1.2,TLSv1.1,TLSv1\r\nssl.keystore.type=JKS\r\nssl.truststore.type=JKS\r\n\r\nsecurity.inter.broker.protocol=SSL\r\nauthorizer.class.name=kafka.security.auth.SimpleAclAuthorizer
Run Code Online (Sandbox Code Playgroud)\r\n
\r\n
\r\n

\n\n

只需打开 ACL 并使用 kafka-acls.sh 为主题 testtopic 和组 Consumer-group-1\xef\xbc\x8c 添加主体

\n\n

我无法从 kafka-consumer-offset-checker.sh 获取 kafka 偏移量的结果。\nACL 中是否有不同的内容?\n如何在 …

offset apache-kafka kafka-consumer-api

5
推荐指数
1
解决办法
1221
查看次数

尝试在 Selenium 中拖动/移动元素时如何找出 x 和 y 偏移量?

我在用

builder.moveToElement(element).moveByOffset(x,y).click().build().perform(); 
Run Code Online (Sandbox Code Playgroud)

在上面的函数中,我不确定 X 和 Y 的值,因此我必须多次运行测试才能找出 X 和 Y 的正确值。

示例:首先我会尝试使用 5、5,然后如果我看到它比 5、10 等更靠右一点。

他们有办法一次性找到它吗?

selenium offset selenium-webdriver

5
推荐指数
1
解决办法
3万
查看次数

为什么谷歌自然语言为分析的字符串返回错误的 beginOffset?

我正在使用 google-cloud/language api 进行 #annotate 调用,并从我从各种在线资源中获取的评论 csv 中分析实体和情绪。

\n\n

首先,我尝试分析的字符串包含 commentId,因此我重新格式化:

\n\n
youtubez22htrtb1ymtdlka404t1aokg2kirffb53u3pya0,i just bot a Nostromo... ( ._.)\xef\xbb\xbf\nyoutubez22oet0bruejcdf0gacdp431wxg3vb2zxoiov1da,Good Job Baby! MSI Propeller Blade Technology!\xef\xbb\xbf\nyoutubez22ri11akra4tfku3acdp432h1qyzap3yy4ziifc,"exactly, i have to deal with that damned brick, and the power supply can't be upgraded because of it, because as far as power supply goes, i have never seen an external one on newegg that has more power then the x51's\xef\xbb\xbf"\nyoutubez23ttpsyolztc1ep004t1aokg5zuyqxfqykgyjqs,"I like how people are liking your comment about liking the fact that Sky DID …
Run Code Online (Sandbox Code Playgroud)

javascript string offset google-language-api sentiment-analysis

5
推荐指数
1
解决办法
347
查看次数

AssertJ 比较双精度值

我想将双精度值与 AssertJ 进行比较。我不明白为什么我的测试失败。

@Test
public void testInterestToQuote() {
    double result = BasicCalculator.accumulationFactorByYearsAndInterest(years, interest)
    Assertions.assertThat(result).isCloseTo(expected, Assertions.offset(0.1d))
}
Run Code Online (Sandbox Code Playgroud)

例外是:

java.lang.AssertionError: 
Expecting:
   <7.256571590148141E-5>
to be close to:
   <7.25>
by less than <0.1> but difference was <7.249927434284099>.
(a difference of exactly <0.1> being considered valid)
Run Code Online (Sandbox Code Playgroud)

为什么断言失败?

double compare offset assertj

5
推荐指数
1
解决办法
6623
查看次数

Python 使日期时间偏移感知

我想获取日期时间的偏移量并创建一个感知字符串。

以下 IDLE 代码有效:

Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0] on linux

import datetime
date_now = datetime.datetime.now()
date_now_with_offset = date_now.astimezone()
print(date_now_with_offset)
2018-06-03 17:48:50.258504-05:00
Run Code Online (Sandbox Code Playgroud)

脚本中的以下代码给出错误:

import datetime
date_now = datetime.datetime.now()
date_now_with_offset = date_now.astimezone()
print(date_now_with_offset)

TypeError: Required argument 'tz' (pos 1) not found
Run Code Online (Sandbox Code Playgroud)

我意识到偏移量和时区是不同的,但在任何给定时刻,本地时间应该与准确的时区偏移量相同,即使时区偏移量在一年中可能会波动。

发生了什么以及为什么?最好的解决方案是什么?

python time datetime offset

5
推荐指数
1
解决办法
3184
查看次数

键盘偏移在 SwiftUI 2 中不再起作用

所以我有一个 ObservableObject 将发布的变量“currentHeight”设置为键盘的高度:

import Foundation
import SwiftUI

class KeyboardResponder: ObservableObject {

@Published var currentHeight: CGFloat = 0

var _center: NotificationCenter

init(center: NotificationCenter = .default) {
    _center = center
    _center.addObserver(self, selector: #selector(keyBoardWillShow(notification:)), name: UIResponder.keyboardWillShowNotification, object: nil)
    _center.addObserver(self, selector: #selector(keyBoardWillHide(notification:)), name: UIResponder.keyboardWillHideNotification, object: nil)
}

@objc func keyBoardWillShow(notification: Notification) {
    if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue {
        withAnimation {
           currentHeight = keyboardSize.height
        }
    }
    print("the KEYBOARD HEIGHT IS \(self.currentHeight)")
}

@objc func keyBoardWillHide(notification: Notification) {
    withAnimation {
       currentHeight = 0
    } …
Run Code Online (Sandbox Code Playgroud)

keyboard xcode offset swift swiftui

5
推荐指数
1
解决办法
459
查看次数

SwiftUI 中的偏移量和按钮有问题吗?

我有一组按顺时针旋转显示的按钮,但我无法正确单击它们:

我认为偏移有问题,但我不知道如何解决它,有什么建议吗?

这是代码:

struct CategoryView: View {
    // Circle Radius
    @State private var radius: Double = 150
    let circleSize: Double = 350
    // Degree of circle
    @State private var degree = -90.0
    let cards = ["John", "Mark", "Alex", "Kevin", "Jimmy"]
    
    var body: some View {
        ZStack {
            let anglePerCount = Double.pi * 2.0 / Double(cards.count)
            ForEach(0..<cards.count, id: \.self) { index in
                let angle = Double(index) * anglePerCount
                let xOffset = CGFloat(radius * cos(angle))
                let yOffset = CGFloat(radius * sin(angle))
                Button …
Run Code Online (Sandbox Code Playgroud)

xcode offset ios swift swiftui

5
推荐指数
1
解决办法
1625
查看次数

jQuery中的offsetParent()没有返回预期的相对位置祖先

我有一些HTML具有以下近似结构和定位:

<div class="grand-parent" style="position: absolute">
  <div class="parent" style="position: relative">
    <div class="child"></div>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

在我的jQuery小部件中,我正在尝试插入位于小部件所针对的元素的"偏移父级"内的元素.为此,我基本上有这样的代码:

var targetElement = $('.child');
$('<div/>').appendTo(targetElement.offsetParent());
Run Code Online (Sandbox Code Playgroud)

不幸的是,该元素似乎是作为孩子插入.grand-parent而不是parent.我对offsetParent()(以及文档似乎支持这一点)的理解是offsetParent()应该返回,.parent因为它是相对的.我对offsetParent的理解是不正确的,还是jQuery存在问题(我使用的是1.4.1).

javascript jquery positioning offset

4
推荐指数
1
解决办法
2536
查看次数

在vba中向下移动行的范围

我试图选择我的电子表格的前7行(确切的数字可能会有所不同)并将其向下移动32行(向下移动的行数也可能不同).有人可以帮我代码吗?我试过了:

Worksheets("Report").Cells(x1, 5).EntireRow.Offset(32, 0).Select
Run Code Online (Sandbox Code Playgroud)

我也试过了

for i = 1 to 7
set x1 = worksheets("Report").Cells(i, 5)
Rows(x1).EntireRow.Offset(32, 0).Select
Run Code Online (Sandbox Code Playgroud)

也不会工作.在此先感谢您的帮助!

vba move rows offset

4
推荐指数
1
解决办法
3万
查看次数

PHP注意:未初始化的字符串偏移量:0

我在OpenCart日志中收到此错误.说错误在第1行,即:

<?php if(isset($social_discount['name']) && $social_discount['name']!="") { ?>
Run Code Online (Sandbox Code Playgroud)

非常感谢任何帮助来解决这个问题.

php string initialization offset

4
推荐指数
1
解决办法
2万
查看次数