小编Say*_*ame的帖子

有ESP32-S2或ESP32芯片的模拟器吗?

我正在开发一个 esp 项目,并使用esp32s2工具链编译了我的代码,并创建了一个可以在真实设备上运行的二进制文件。但我没有真正的设备来测试我的二进制文件。有没有模拟器可以模拟ESP32-S2芯片或者ESP32芯片?

esp32

13
推荐指数
2
解决办法
9938
查看次数

如何从 GitHub Actions 中的 Android Gradle 文件获取版本名称?

我必须使用 GitHub 操作提供的创建发布操作来创建发布。build.gradle 文件中的默认配置参数如下;

defaultConfig {
    applicationId "com.example.myapp"
    minSdk 21
    targetSdk 31
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Run Code Online (Sandbox Code Playgroud)

以及 GitHub Actions yml 文件中的操作,如下所示;

- name: Create Release
    id: create_release
    uses: actions/create-release@v1
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    with:
      tag_name: <I need gradle version name here! It is 1.0>
      release_name: Release <I need gradle version name here! It is 1.0>
      body: |
        Release body
      draft: false
      prerelease: false
Run Code Online (Sandbox Code Playgroud)

如何获取 GitHub Actions yml 文件中的 gradle versionName 以创建 GitHub 版本?

android github github-actions

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

如何从服务帐户获取刷新令牌

是否可以从发送到“/oauth2/v4/token”路径的JWT请求中获取refresh_token?

{
  "access_token" : "1/8xbJqaOZXSUZbHLl5EOtu1pxz3fmmetKx9W8CV4t79M",
  "token_type" : "Bearer",
  "expires_in" : 3600
}
Run Code Online (Sandbox Code Playgroud)

响应不包含刷新令牌密钥。

参考链接:https://developers.google.com/identity/protocols/OAuth2ServiceAccount

google-api oauth-2.0 jwt google-oauth service-accounts

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

在javascript中从类数组中获取对象

我有一个类似的javascript类,

class Snake{
    constructor(id, trail){
        this.velocityX = 0;
        this.velocityY = -1;
        this.trail = trail;
        this.id = id;
    }
    moveRight(){
        console.log('move');
    }
}
Run Code Online (Sandbox Code Playgroud)

和一个存储Snake对象的数组.

this.snakeList = new Array();
this.snakeList.push(new Snake(10, newSnakeTrail));
this.snakeList.push(new Snake(20, newSnakeTrail));
this.snakeList.push(new Snake(30, newSnakeTrail));
this.snakeList.push(new Snake(22, newSnakeTrail));
this.snakeList.push(new Snake(40, newSnakeTrail));
Run Code Online (Sandbox Code Playgroud)

例如,我想从id为20的数组中删除该元素.

我怎样才能做到这一点?

javascript arrays

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