小编Kai*_*Kai的帖子

IntelliJ 数据库工具 - Mongo 只读

我正在通过 IntelliJ 数据库工具连接到通过 brew 安装的本地 MongoDB 实例。我可以看到和查询事物;但是一旦我尝试更新记录,例如将数据库锁设置回 false,我就会收到错误消息This table is read-only. Changes cannot be applied.

使用控制台不会发生同样的事情。我试图在数据源属性 > 选项下切换只读复选框。

是否还有其他我遗漏的设置?

jetbrains-ide intellij-idea mongodb mongodb-query datagrip

8
推荐指数
1
解决办法
3408
查看次数

Jenkins 从同一个提交多分支管道开始重复构建

我们看到 Jenkins 多分支管道的多个构建由 Bitbucket 中的相同合并提交触发。

一个构建被标记为触发:“Branch event at”

另一个由:“提交通知”

我们在插件中设置了 Jenkins 网址

Bitbucket 服务器 Webhook 到 Jenkins

并在 Jenkinsfile 设置中有一个我们的触发器,如下所示:

triggers {
    pollSCM ""
    cron "H 0 * * *"
}
Run Code Online (Sandbox Code Playgroud)

不幸的是,似乎有几个老问题没有具体的答案。

continuous-integration jenkins bitbucket-server

6
推荐指数
1
解决办法
2791
查看次数

在(Espresso)Android工具测试中启动特定的导体控制器

我正在为使用Conductor编写的应用程序编写Espresso测试。我想为每个测试指定要启动哪个控制器,这样我就不需要Espresso从每个活动的开始Activity中单击应用程序。由于只有一个活动,并没有太多的SO或google一下指挥我能找到最接近的是这个问题吗?还是不可能?

我尝试将路由器设为静态并添加吸气剂,以尝试设置特定的根进行测试,但均未成功。

android.view.ViewRootImpl $ CalledFromWrongThreadException:只有创建视图层次结构的原始线程才能触摸其视图。

在MainActivity中:

public static Router getRouter() {
    return router;
}
Run Code Online (Sandbox Code Playgroud)

在仪器测试中:

@Rule
public ActivityTestRule<MainActivity> testRule = new ActivityTestRule<>(MainActivity.class);

@Before
public void setUp() {
    Router router = testRule.getActivity().getRouter();
    router.setRoot(RouterTransaction.with(new ControllerIwantToTest()));
}

@Test
public void titleIsDisplayed() {
    onView(withText("My Controllers Title")).check(matches(isDisplayed()));
}
Run Code Online (Sandbox Code Playgroud)

java testing android android-espresso conductor

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

将输入从 html 传递到 python 并返回

我需要为作业制作一个网页,它不必上传到网络,我只是使用本地 .html 文件。我做了一些阅读并想出了以下 html 和 python:

<!DOCTYPE html>
<html>
    <head>
        <title>
            CV - Rogier
        </title>
    </head
    <body>
        <h3>
            Study
        </h3>
        <p>
            At my study we learn Python.<br>
            This is a sall example:<br>
            <form action="/cgi-bin/cvpython.py" method="get">
                First Name: <input type="text" name="first_name">  <br />
                Last Name: <input type="text" name="last_name" />
                <input type="submit" value="Submit" />
            </form>
        </p>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

Python:

import cgi
import cgitb #found this but isn't used?

form = cgi.FieldStorage()

first_name = form.getvalue('first_name').capitalize()
last_name  = form.getvalue('last_name').capitalize()

print ("Content-type:text/html\r\n\r\n")
print ("<html>")
print …
Run Code Online (Sandbox Code Playgroud)

html python cgi flask python-3.x

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

模型相互引用错误:循环依赖问题

管理模型.ts

import mongoose, { Schema, Document } from 'mongoose';
import UserRole, { IUserRole } from './user-role.model';

export interface IAdmin extends Document {
    role: IUserRole;
}

let adminSchema = new Schema<IAdmin>({
    role: {
        type: Schema.Types.ObjectId, ref: UserRole
    }
});

export default mongoose.model<IAdmin>('Admin', adminSchema);
Run Code Online (Sandbox Code Playgroud)

用户角色.model.ts

import { Schema, Document, model } from 'mongoose';

export interface IUserRole extends Document{
    updated_by: IAdmin|string;
}

let userRoleSchema = new Schema<IUserRole>({
    updated_by: {
        type: Schema.Types.ObjectId, ref: Admin
    }
})

export default model<IUserRole>('UserRole', userRoleSchema);
Run Code Online (Sandbox Code Playgroud)
MongooseError: Invalid ref at …
Run Code Online (Sandbox Code Playgroud)

mongoose mongodb node.js typescript typegoose

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

如何缩放和居中一个drawable inside layer-list android?

我试图将可绘制的图像居中,并在两侧使用一些填充物作为闪屏徽标.问题是它要么在整个屏幕上拉伸,要么在我使用时忽略任何填充gravity.

<?xml version="1.0" encoding="utf-8"?>
Run Code Online (Sandbox Code Playgroud)

<item
    android:drawable="@color/grey_3"/>

<item android:gravity="top|center_horizontal|center_vertical" android:drawable="@drawable/zc_logo_r"
      android:top="100dp"
      android:left="200dp"
      android:right="200dp"
      android:layout_margin="100dp"
    >
</item>
Run Code Online (Sandbox Code Playgroud)

我已尝试使用位图,android:gravity="fill_horizontal"以及对SO的各种其他建议,结果相同.

如何在xml中缩放和居中图像?

xml android splash-screen android-layout layer-list

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

iOS删除过期的开发人员帐户上的设备

我正在尝试在iPhone上测试一个应用程序,但始终收到错误消息:

无法添加设备“凯的iPhone”,因为该小组已达到iPhone设备的最大数量。

我已经让我的付费开发者帐户过期了,所以我使用的是免费帐户,但似乎无法再访问该页面以删除Apple开发者指南中概述的旧设备。

要禁用或启用设备:

  • 登录到developer.apple.com/account,然后单击“证书,ID和配置文件”。
  • 在设备下,选择全部。
  • 选择要禁用或启用的设备。
  • 单击启用或禁用。

我已经看过并尝试了有关问题的建议,尽管我认为考虑该问题的年龄并不重要,因为当时免费开发人员帐户不存在,并且答案提示您在续订帐户时会禁用设备。

还有其他方法可以从您的帐户中删除没有当前付费开发者会员资格的设备吗?

iphone xcode itunesconnect ios apple-developer

0
推荐指数
1
解决办法
2834
查看次数