微凉

文章 评论 浏览 30

微凉 2025-02-19 22:30:59

有一个可能的解决方案或解决方法(2021年2月):

github动作:跳过拉请请求并用推动工作流[跳过CI]

github操作现在支持跳过pushpull_request workflows通过在您的提交消息中查找一些通用关键字。

如果您的按下或PR的头提交中的任何提交消息包含字符串[SKIP CI][CI SKIP][no CI> ][跳过操作][动作Skip]将跳过在推送或pull_request事件上触发的工作流程。

但是,如问题1313

这不会禁用检查是否是强制性的 - 这也不是我们会更改的。

有一个 features request request

这可能是我最想要的github功能,到目前为止。

几乎不可能在不采用某种昂贵的解决方案的情况下进行检查,而无需进行任何需要检查 - 要么是自动化的昂贵的解决方法,要么是手动昂贵的解决方法(例如,人们成为人类的衬里,类型的检查员和测试套件验证器,并在公关评论像2009年一样。

最终结果是,我们最终有一个讨厌的习惯,即使确实需要标记有条件的状态检查,这也导致人们过早地合并了东西,因为我们已经使用了一些对CI状态为红色main,这并不理想。

人们过早地合并了东西, /Github.com/github-community/community/discussions/13690“ rel =“ nofollow noreferrer”>仅在分支保护的必需操作工作流程时,才需要运行”。

此外,为了澄清,这不仅应该在github操作中添加,而应在github级别作为所有必需状态检查的选项,无论CI / CD提供商如何。

There is one possible solution or workaround (Feb. 2021):

GitHub Actions: Skip pull request and push workflows with [skip ci]

GitHub Actions now supports skipping push and pull_request workflows by looking for some common keywords in your commit message.

If any commit message in your push or the HEAD commit of your PR contains the strings [skip ci], [ci skip], [no ci], [skip actions], or [actions skip] workflows triggered on the push or pull_request events will be skipped.

But, as mentioned in issue 1313:

This doesn't disable whether checks are mandatory - nor is this something that we'll change.

There is a feature request:

This is possibly my single most wanted GitHub feature, by far.

It’s almost impossible to guarantee safety in a monorepo without conditionally required checks without adopting some kind of expensive workaround – either an automated expensive workaround, or a manually expensive workaround (e.g. folks becoming human linters, type checkers, and test suite validators on PR reviews like it’s 2009 again.

The end result is that we’ve ended up with a nasty habit of marking no conditional status checks as required, even though they really are required, which has led to folks prematurely merging things because we’ve gotten a bit too used to CI status being red on main, which isn’t ideal, to put it lightly.

See also "Required actions workflows from branch protections should only be required if run".

Also, just to clarify, this shouldn’t just be added in GitHub Actions, but rather at the GitHub level as an option for all required status checks, regardless of CI / CD provider.

GitHub可选状态检查

微凉 2025-02-19 18:20:44

运行Django应用程序时,指定端口python manage.py runserver 0.0.0.0:8080用于使用8080而不是8000

When you run the django app specify the port like this python manage.py runserver 0.0.0.0:8080 to use 8080 instead of 8000

我如何更改spyne中的django应用程序服务器端口号

微凉 2025-02-19 14:28:32

您必须使用新域名声明aws :: api的新块,并将其链接到另一个events

我已经更新了您的代码:

Resources:
  ApiCertificate:
    Type: AWS::CertificateManager::Certificate
    Properties:
      DomainName: !Sub abc-${StageName}.xyz.com
      ValidationMethod: DNS
  RestApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: !Ref StageName
      EndpointConfiguration: REGIONAL
      Domain:
        DomainName: !Sub abc-${StageName}.xyz.com
        CertificateArn: !Ref ApiCertificate
        Route53:
          HostedZoneName: "xyz.com."
  SecondApiCertificate:
    Type: AWS::CertificateManager::Certificate
    Properties:
      DomainName: !Sub pqr-${StageName}.stu.com
      ValidationMethod: DNS
  SecondRestApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: !Ref StageName
      EndpointConfiguration: REGIONAL
      Domain:
        DomainName: !Sub pqr-${StageName}.stu.com
        CertificateArn: !Ref SecondApiCertificate
        Route53:
          HostedZoneName: "stu.com."
  loginFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: src/handlers/login.loginHandler
      Runtime: nodejs16.x
      Architectures:
        - x86_64
      MemorySize: 128
      Timeout: 100
      
      Events:
        Api:
          Type: Api
          Properties:
            Path: /login
            Method: POST
            RestApiId: !Ref RestApi
        SecondApi:
          Type: Api
          Properties:
            Path: /login
            Method: POST
            RestApiId: !Ref SecondRestApit 

You have to declare a new block for AWS::Serverless::Api with your new domain and link that with another Events.

I have updated your code:

Resources:
  ApiCertificate:
    Type: AWS::CertificateManager::Certificate
    Properties:
      DomainName: !Sub abc-${StageName}.xyz.com
      ValidationMethod: DNS
  RestApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: !Ref StageName
      EndpointConfiguration: REGIONAL
      Domain:
        DomainName: !Sub abc-${StageName}.xyz.com
        CertificateArn: !Ref ApiCertificate
        Route53:
          HostedZoneName: "xyz.com."
  SecondApiCertificate:
    Type: AWS::CertificateManager::Certificate
    Properties:
      DomainName: !Sub pqr-${StageName}.stu.com
      ValidationMethod: DNS
  SecondRestApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: !Ref StageName
      EndpointConfiguration: REGIONAL
      Domain:
        DomainName: !Sub pqr-${StageName}.stu.com
        CertificateArn: !Ref SecondApiCertificate
        Route53:
          HostedZoneName: "stu.com."
  loginFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: src/handlers/login.loginHandler
      Runtime: nodejs16.x
      Architectures:
        - x86_64
      MemorySize: 128
      Timeout: 100
      
      Events:
        Api:
          Type: Api
          Properties:
            Path: /login
            Method: POST
            RestApiId: !Ref RestApi
        SecondApi:
          Type: Api
          Properties:
            Path: /login
            Method: POST
            RestApiId: !Ref SecondRestApit 

AWS SAM映射到单个功能的两个域

微凉 2025-02-19 07:21:47

编辑

在评论中(由 Philfreo )指出了最新版本。如果需要在其最新版本中进行任何嵌套的子模型:

git submodule foreach --recursive git pull

----------------------

这不是官方的方法吗?

git submodule update --init

我每次都使用它。到目前为止没有问题。

编辑:

我刚刚发现您可以使用:

git submodule foreach --recursive git submodule update --init 

它还将递归地拉动所有子模型,即依赖。

Edit:

In the comments was pointed out (by philfreo ) that the latest version is required. If there is any nested submodules that need to be in their latest version :

git submodule foreach --recursive git pull

-----Outdated comment below-----

Isn't this the official way to do it ?

git submodule update --init

I use it every time. No problems so far.

Edit:

I just found that you can use:

git submodule foreach --recursive git submodule update --init 

Which will also recursively pull all of the submodules, i.e. dependancies.

为所有git subsodules提取最新更改

微凉 2025-02-19 03:07:18

您可以将QuerySelector用于单个元素或QuerySelectorAll用于多个元素。您可以在其中使用CSS查询。

document.querySelector("switch-field input:checked").style.background = 
 "#4400ff";

You can use querySelector for single element or querySelectorAll for multiple elements. You can use CSS query in that.

document.querySelector("switch-field input:checked").style.background = 
 "#4400ff";

如何针对“换入场输入:检查”用JavaScript对CSS属性进行更改

微凉 2025-02-18 15:07:37

我不完全理解您想要的东西,但让我解释一些事情:

  1. 您不能直接在uinavigationController中直接添加uiviewController,我们将ViewController而不是:

     让ViewController =某些ViewController //您的ViewController
    让NavigationController = uinavigationController(rootviewController:viewController)//这成为要使用的ViewController。 
    self.present(navigation controller)//使用示例
     
  2. 我们不包装所有<代码> uiviewController 在uinavigationController,只有导航父母。

I don't fully understand what you want, but let me explain a few things:

  1. You can't add a UINavigationController directly in a UIViewController, we wrap the ViewController instead:

    let viewController = some ViewController //your ViewController
    let navigationController = UINavigationController(rootViewController: viewController)//this becomes the ViewController to be used. 
    self.present(navigationController)//example of usage
    
  2. We don't wrap every UIViewController in UINavigationController, only the navigation parents.

如何在uiviewController中创建一个uinavigation controll,以程序为快速

微凉 2025-02-18 05:40:16

原因是rs.getString(i)在双引号内部,因此只是字符串的一部分。您想将rs.getString(i)的结果限制到字符串。

例如:

“&lt; input type = \“ text \” name = \“ titel \” value = \“” + rs.getString(i) +“ \” \“ \” + ...

The reason is rs.getString(i) is inside the double quote so it's just part of a string. You want to concat the result of rs.getString(i) to the string.

For example:

"<input type=\"text\" name=\"titel\" value=\"" + rs.getString(i) + "\" + ...

如何在循环中通过表格提交数据?

微凉 2025-02-17 03:53:56
# Create a comma-separated string with names
the_names = ', '.join(List) # 'tom, jerry, katie'

# Interpolate it into the "main" string
string = f"Their Names are ({the_names}) and they like candy."
# Create a comma-separated string with names
the_names = ', '.join(List) # 'tom, jerry, katie'

# Interpolate it into the "main" string
string = f"Their Names are ({the_names}) and they like candy."

如何将可变长度列表插入字符串

微凉 2025-02-16 23:00:50

setState是异步

setState is async, it means that console.log can't display the value before it has changed

setState不会在用空数组中使用usedeft中的EventListener内部更新

微凉 2025-02-16 02:52:55

您应该有一个解决方案和该解决方案中的许多项目。项目的一个程序。 右键单击解决方案而不是创建ConsoleApp创建ClassLibrary Project 。但是,即使您的项目也有不同的程序。CS文件,您可以在其他项目中使用其类别。

You should have one solution and many projects in that solution.One of the project have program.cs that class is start point of the entire solution.Usually you will see program.cs in the Console.app or WebApi etc or WinForm. When you right click on solution instead of creating ConsoleApp create ClassLibrary Project. But even your projects have different program.cs files you can use their classess in your other projects.

我如何将多个保护c#编译成一个

微凉 2025-02-15 21:18:53

要抓住页面中的所有表:

tables = pd.read_html("https://www.marketwatch.com/tools/earnings-calendar")

只需查看第一个:

print(tables[0].head())

如果您确定所有表都有相同的列,则可以将它们置为一个数据帧:

df = pd.concat(pd.read_html("https://www.marketwatch.com/tools/earnings-calendar"))

To grap all tables in page:

tables = pd.read_html("https://www.marketwatch.com/tools/earnings-calendar")

Just look at the first:

print(tables[0].head())

If you are sure all tables have same columns, you can concat them to have only one dataframe:

df = pd.concat(pd.read_html("https://www.marketwatch.com/tools/earnings-calendar"))

&#x27; nontype&#x27;对象没有属性&#x27; find_all&#x27;与美丽的小组

微凉 2025-02-15 12:59:32

DART的类型推理算法在顶级声明和本地声明方面有所不同。
这是因为顶级声明都可以互相指代,而本地声明只能指较早的本地声明(或最高级别的声明,但首先推断出这些声明,因此它们在这一点上是安全的)。

因此,顶级推断不像本地类型的推理那样聪明,但在合理的时间内也是可决定的。

在顶级和班级声明上写类型。更安全。

Dart's type inference algorithm differs for top-level declarations and local declarations.
That's because top-level declarations can all refer to each other, while local declarations can only refer to earlier local declarations (or to top-level declarations, but those are inferred first, so they're safe at this point).

Because of that, the top-level inference is not as clever as the local type inference, but it's also decidable in reasonable time.

Write types on top-level and class level declarations. It's safer.

当未指定返回类型时,DART显示了另一个内部功能的精确返回类型,但对于顶级的动态

微凉 2025-02-15 08:09:41

codepro 最近由Google发布了Eclipse Project。它是免费的,非常有效的。该插件具有'查找死亡代码'具有一个/多个入口点的功能(S)。效果很好。

CodePro was recently released by Google with the Eclipse project. It is free and highly effective. The plugin has a 'Find Dead Code' feature with one/many entry point(s). Works pretty well.

如何在Java项目中找到未使用/死亡代码

微凉 2025-02-14 13:06:24

库返回不同错误类型的库功能进一步使我们的代码复杂化,尤其是当我们尝试设计函数以返回结果时。

我建议使用ok(),它将结果转换为option(将电位err转换为<代码>无),与运算符结合使用,该操作员拆开有效值,或者结束我们的函数返回none

显而易见的缺点是我们对出了什么问题的知识。

值得指出的是,Rust不需要最后条款,因为尽管失败,但总是执行清理代码。

另请注意,无法在main()函数中使用。在那里,我们需要unwrap(),在发生错误的情况下调用panic()

为了展示此信息,请考虑以下读取JSON文件并解析它的代码,并处理不同类型的错误。

use std::fs;
use serde_json::{Value};

// --------------------------------------------------------
// file_name: Text -> () -> Some( ObjectJson ) | None
// --------------------------------------------------------
fn read_file( file_name: String ) -> Option<Value> {

    let contents : String = fs::read_to_string( file_name ).ok() ? ;  // read the file

    let obj : Value = serde_json::from_str( & contents ).ok() ? ; // convert the text into a JSON object

    Some( obj )

} // ()

// --------------------------------------------------------
// --------------------------------------------------------
fn main() {

    let json_obj = read_file( "data.json".to_string() ).unwrap();

    println!( "{:}", json_obj[0] );

}

Library functions returning different error types further complicate our code, especially if we try to design our function to return a Result.

I would suggest using ok(), which converts a Result into an Option (translating a potential Err into None), combined with the ? operator, which unwraps a valid value, or else ends our function returning None.

The obvious drawback is that we lose knowledge of what has gone wrong.

It's worth pointing out that Rust doesn't need a finally clause because clean-up code is always executed despite a failing ?.

Also note that ? can't be used in the main() function. There, we need unwrap(), which calls panic() in case of an error.

In order to showcase this, consider the following code that reads a JSON file and parses it, dealing with different types of errors.

use std::fs;
use serde_json::{Value};

// --------------------------------------------------------
// file_name: Text -> () -> Some( ObjectJson ) | None
// --------------------------------------------------------
fn read_file( file_name: String ) -> Option<Value> {

    let contents : String = fs::read_to_string( file_name ).ok() ? ;  // read the file

    let obj : Value = serde_json::from_str( & contents ).ok() ? ; // convert the text into a JSON object

    Some( obj )

} // ()

// --------------------------------------------------------
// --------------------------------------------------------
fn main() {

    let json_obj = read_file( "data.json".to_string() ).unwrap();

    println!( "{:}", json_obj[0] );

}

等于trycatch语句的生锈是什么?

微凉 2025-02-13 19:40:20

我很有趣地调试一个问题,其中&lt; h:commandlink&gt;richfaces dataTable拒绝发射的操作中。该表曾经在某个时候工作,但没有明显的原因停止。我毫不犹豫地毫不犹豫地发现我的rich:datatable正在使用错误的rowkeyconverter,返回了richfaces愉快地用作行键的nulls。这阻止了我的&lt; h:commandlink&gt;操作被调用。

I had lots of fun debugging an issue where a <h:commandLink>'s action in richfaces datatable refused to fire. The table used to work at some point but stopped for no apparent reason. I left no stone unturned, only to find out that my rich:datatable was using the wrong rowKeyConverter which returned nulls that richfaces happily used as row keys. This prevented my <h:commandLink> action from getting called.

commandbutton/commandlink/ajax action/侦听器方法未调用或输入值未设置/更新

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文