小编obe*_*tie的帖子

Bazel 可以显示所有分析错误吗?

当我调用 Bazel 命令并且存在分析错误时,它仅显示其中之一。例如:

ERROR: /Users/oliver/src/github.com/monzo/wearedev/service.transaction-enrichment/handler/BUILD.bazel:3:1: target '//service.personal-account-signup/domain:go_default_library' is not visible from target '//service.transaction-enrichment/handler:go_default_library'. Check the visibility declaration of the former target if you think the dependency is legitimate
ERROR: /Users/oliver/src/github.com/monzo/wearedev/service.transaction-enrichment/handler/BUILD.bazel:3:1: target '//service.prepaid-bridge/domain:go_default_library' is not visible from target '//service.transaction-enrichment/handler:go_default_library'. Check the visibility declaration of the former target if you think the dependency is legitimate
ERROR: Analysis of target '//service.transaction-enrichment/handler:go_default_test' failed; build aborted: Analysis of target '//service.transaction-enrichment/handler:go_default_library' failed; build aborted
INFO: Elapsed time: 1.049s
INFO: 0 processes.
FAILED: Build did NOT complete …
Run Code Online (Sandbox Code Playgroud)

bazel

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

在导航栏上方添加视图

我正在尝试实现类似于在iOS 7上的新消息应用程序(Safari也是如此)中看到的效果,其中导航栏本身内有一个进度条:

进度条在iOS 7的导航栏中看到

我尝试了几种方法,并找到一种几乎可行的方法.我正在使用的是一个自定义子类,UINavigationBar它在初始化时将我的自定义进度条添加为子视图.这工作得很好,但是当我尝试添加NSLayoutConstraints它时应用程序崩溃了.

工作代码(没有布局约束,因此不适应方向更改):

- (void)commonInit
{
    if (!self.progressIndicator) {
        self.progressIndicator = [[ECourseProgressIndicatorView alloc] initWithFrame:CGRectMake(0, self.bounds.size.height - 3, self.bounds.size.width, 3)];
        [self addSubview:self.progressIndicator];
    }
}
Run Code Online (Sandbox Code Playgroud)

代码我希望能够使用(NSLayoutConstraint添加s),但崩溃:

- (void)commonInit
{
    if (!self.progressIndicator) {
        self.progressIndicator = [[ECourseProgressIndicatorView alloc] initWithFrame:CGRectMake(0, self.bounds.size.height - 3, self.bounds.size.width, 3)];
        [self addSubview:self.progressIndicator];

        self.progressIndicator.translatesAutoresizingMaskIntoConstraints = NO;
        [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-0-[progressIndicator]-0-|" options:0 metrics:nil views:@{@"progressIndicator": self.progressIndicator}]];
        [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[progressIndicator(==3)]-0-|" options:0 metrics:nil views:@{@"progressIndicator": self.progressIndicator}]];
    }
}
Run Code Online (Sandbox Code Playgroud)

运行具有布局约束的代码时遇到的错误包含在此处的Gist中.如果我没有设置translatesAutoresizingMaskIntoConstraints = NO,那么代码可以工作,但我指定的布局约束将被忽略,以支持自动调整大小的掩码约束.

谁能摆脱任何光明?

PS我最初想到将进度条添加为UINavigationBar上方的视图(所以根本不在其层次结构中),但是我找不到有关如何在导航栏上方直观地定位视图的信息(以Z坐标术语表示) ,而不是Y).

注意:我在Apple开发人员论坛中发布了这个 …

iphone objective-c uinavigationbar ios ios7

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

在没有变量扩展的情况下在bash中打印一系列命令

我有一个脚本,我用set -x它来执行命令时打印一些命令.

在展开之后和执行之前,打印一些简单的命令,for命令,case命令,select 命令和算术for命令及其参数或关联的单词列表.PS4扩展变量的值,并在命令及其扩展参数之前打印结果值.

有没有办法获得这种行为,但打印变量扩展?我正在捕获日志输出并将其发送到集中式记录器,但我不希望输出某些敏感变量的值.

bash

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

在 Scala 中绑定引用自身的类型意味着什么?

我在 GitHub 上查看一些代码,发现了这个类型声明:

abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product with TreePatternBits {
Run Code Online (Sandbox Code Playgroud)

(这是来自 Spark 源代码,尽管这个问题实际上并不是关于 Spark,而是关于 Scala 的类型系统。)

这对我来说是新的。用简单的英语来说,这种类型绑定是什么意思?

generics scala f-bounded-polymorphism

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