小编cod*_*der的帖子

确认DatePicker时间更改

所以我有一个DatePicker,我可以更改某个字段,但我希望它只HTML在用户确认更改时更新.但是,目前,当我(ionChange)在我的ion-datetime元素中使用该事件时,它会在我的确认警告弹出之前自动更新UI.

如何才能使我的日期选择器中的值仅在用户按下确认时更改?

updateStartTime(startTime) {
    let alert = this.alertControl.create({
        title: 'Change start time',
        message: 'Are you sure you want to update the start time for this event?',
        buttons: [{
            text: 'Cancel',
            handler: () => {
                console.log('cancel');
            }
        }, {
            text: 'Confirm',
            handler: () => {
                console.log(startTime);
            }
        }]
    });
    alert.present();
}
Run Code Online (Sandbox Code Playgroud)

 

<ion-item detail-push>
    <ion-label><b>Start: </b></ion-label>
    <ion-datetime displayFormat="hh:mm A"
                  [(ngModel)]="item.EventStart"
                  (ionChange)="updateStartTime(item.EventStart)"></ion-datetime>
</ion-item>
Run Code Online (Sandbox Code Playgroud)

html javascript datepicker angularjs ionic-framework

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

如何使用 Apache Camel 路由从授权服务器获取访问令牌?

我有一个授权服务器 [用@SpringBootApplication@RestController@Configuration@EnableAuthorizationServeroauth2 安全性注释的简单类] 在端口上运行,8081该服务器工作正常,并在使用方法从 POSTMAN 请求时提供访问令牌POST以及键值对形式的所需参数, http://localhost:8080/oauth/token但是应该如何我在java中实现了camel路由,通过在body中传递参数来获取访问令牌?

java apache-camel

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

如何更改角度4中输入type =“ date”的输出日期格式?

实际上,我正在使用angular 4应用程序。我遇到的情况是,我必须以dd / mm / yyyy发送Date发送到服务器。

我正在使用属性作为输入类型=“ date”。但是此属性返回的值类似于yyyy / mm / dd。所以我该如何更改日期的输出格式。

Students.html

<input type="date" [(ngModel)]="Students.dob" name="Students.dob">
Run Code Online (Sandbox Code Playgroud)

选择日期后,当我用console.log()检查时。

Students.components.ts

checkDate() { console.log(Students.dob); }
Run Code Online (Sandbox Code Playgroud)

最终输出为yyyy / mm / dd。

有什么办法可以克服这个问题?请告诉我。

angular angular4-forms

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

无法解析符号'ActivityTestRule'

我学习使用浓缩咖啡来测试我的应用,但ActivityTestRule始终无法解决.这里是我的应用程序/配置的build.gradle,我敢肯定,我把试验班的src/androidTest.

非常感谢您的帮助!!

在此输入图像描述

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.example.android.teatime"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.android.support:design:27.1.1'
    compile 'com.android.support:support-annotations:27.1.1'
    compile 'com.google.android.gms:play-services-appindexing:9.8.0'
    // Testing-only dependencies
    androidTestCompile 'com.android.support:support-annotations:27.1.1'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.2'
    androidTestCompile 'com.android.support.test:runner:1.0.2'
    androidTestCompile 'com.android.support.test.espresso:espresso-contrib:3.0.2'
    androidTestCompile 'com.android.support.test:rules:1.0.2'
}
Run Code Online (Sandbox Code Playgroud)

android android-espresso

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

递增数字作为 Firestore 文档名称?

基本上总结在标题中,我想让在特定集合中创建的每个新文档都具有增量排序的序列号。这是为了正确跟踪写入数据库的新订单。AutoID是随机的并导致排序问题,我希望数据易于管理。这可以通过云功能实现吗?我可以查看任何示例代码片段吗?谢谢你!

java android firebase google-cloud-functions google-cloud-firestore

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

Jasmine测试资源管理器未在Visual Studio代码中的Jasmine测试资源管理器中显示测试用例(它阻止)列表

我正在使用Visual Studio代码,量角器,Typescript和Jasmine框架。我在“ it”块中有规格测试用例。

要查看所有测试用例或其阻止,我已经安装了“ Jasmine Test Explorer”和“ Jasmine Explorer UI”,但未列出测试用例。

您能帮我解决这个问题吗?

在此处输入图片说明

typescript protractor jasmine2.0 jasmine-reporters

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

正确使用rxjs-5-to-6迁移.tsconfig路径问题

使用rxjs-5-to-6-migrate的文档说明如下:

To refactor TypeScript code so that it doesn't depend on rxjs-compat, you can use rxjs-tslint.

npm i -g rxjs-tslint
rxjs-5-to-6-migrate -p [path/to/tsconfig.json]
Run Code Online (Sandbox Code Playgroud)

所以我做了那个然后复制了

我的tsconfig文件的根路径

rxjs-5-to-6-migrate -p [/home/ri
ckus/Documents/softwareProjects/211hospitality/suitsandtables/frontend/frontendsuitsandtables/suitsandtables/tsconfig.json]
Run Code Online (Sandbox Code Playgroud)

但是当我运行命令时,我得到以下错误.

Running the automatic migrations. Please, be patient and wait until the execution completes.
child_process.js:643
    throw err;
    ^

Error: Command failed: "/usr/local/lib/node_modules/rxjs-tslint/node_modules/.bin/tslint" -c "/usr/local/lib/node_modules/rxjs-tslint/rxjs-5-to-6-migrate.json" -p "[home/rickus/Documents/softwareProjects/211hospitality/suitsandtables/frontend/frontendsuitsandtables/suitsandtables/tsconfig.json" --fix
    at checkExecSyncError (child_process.js:603:11)
    at Object.execSync (child_process.js:640:13)
    at migrate (/usr/local/lib/node_modules/rxjs-tslint/rxjs-5-to-6-migrate.js:18:34)
    at Object.<anonymous> (/usr/local/lib/node_modules/rxjs-tslint/rxjs-5-to-6-migrate.js:25:14)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at …
Run Code Online (Sandbox Code Playgroud)

rxjs tsconfig rxjs5 angular rxjs6

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

构建时Docker文件非零代码100错误

这是我的Docker文件:

 FROM ubuntu:16.04
MAINTAINER Alexandre Savio <alexsavio@gmail.com>
RUN ln -snf /bin/bash /bin/sh
ARG DEBIAN_FRONTEND=noninteractive
ENV PETPVC_VERSION v1.2.1
ENV PETPVC_GIT https://github.com/UCL/PETPVC.git
ENV ITK_VERSION v4.12.2
ENV ITK_GIT http://itk.org/ITK.git
ENV VTK_VERSION v6.3.0
ENV VTK_GIT https://gitlab.kitware.com/vtk/vtk.git
ENV SIMPLEITK_VERSION v1.0.1
ENV SIMPLEITK_GIT http://itk.org/SimpleITK.git
ENV ANTS_VERSION v2.2.0
ENV ANTS_GIT https://github.com/stnava/ANTs.gi
ENV NEURODEBIAN_URL http://neuro.debian.net/lists/xenial.de-m.full
ENV NEURODEBIAN_PGP hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
ENV LIBXP_URL http://mirrors.kernel.org/ubuntu/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb
ENV AFNI_URL https://afni.nimh.nih.gov/pub/dist/bin/linux_fedora_21_64/@update.afni.binaries
ENV CAMINO_GIT git://git.code.sf.net/p/camino/code
ENV SPM12_URL http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/dev/spm12_latest_Linux_R2017b.zip
ENV MLAB_URL http://ssd.mathworks.com/supportfiles/downloads/R2017b/deployment_files/R2017b/installers/glnxa64/MCR_R2017b_glnxa64_installer.zip
ENV MCR_VERSION_DIR v93
ENV PYENV_NAME pyenv
ENV N_CPUS 2
RUN apt-get update && \ …
Run Code Online (Sandbox Code Playgroud)

linux windows ubuntu docker

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

Struct.error: unpack 需要 16 字节的缓冲区

我有这种格式的二进制文件,(b'A\xd9\xa5\x1ab\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0b\xda\xa5\x1ab\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\xcd\xdb\xa5\x1ab\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\xff\xdb\xa5\x1ab\x00\x00\x00\x05\x00\x00\x00\x01\x00\x00\x00\xe9\xdc\xa5\x1ab\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\xf7\xdc\xa5\x1ab\x00\x00\x00\x08\x00\x00\x00\x02\x00\x00\x00\x1b\xdd\xa5\x1a')我将该文件作为用户输入并读取read_file变量(类字节对象)中的文件。我需要使用整数模式(int、int、int、int)将其转换为 ascii ) 每个int4 个字节。我正在尝试使用struct库来解压缩它。我写了以下命令,但它给了我以下错误:

错误

print(unpack("IIII", read_file))
struct.error: unpack requires a buffer of 16 bytes
Run Code Online (Sandbox Code Playgroud)

代码

    for (dirpath, dirnames, filenames) in walk('/Users/amathur1/PycharmProjects/learningpython/NAWF_VRG_G'):
        count = 1
        for file in filenames:
            print(count, " : ", file)
            count = count + 1
        print("select file you want to convert")
        input_file = input()
        print("Selected file number is : ", input_file)

        #To open the selected file
    with open(dirpath + "/" + filenames[int(input_file) - 1], 'rb') as file: …
Run Code Online (Sandbox Code Playgroud)

python-3.x

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

如何在spring-data mongodb中使用带有arrayFilters的updateOption?

我在 Mongodb 中有一个如下所示的文档:

现在,我想转到基于特定“ _id”的文档,对于该文档,我想转到“计划”列表中的几个特定日期(不仅是一个日期,而是多个日期),我想更新状态为“BOOKED”。我浏览了这个链接, How to apply update using Filtered positional operator with arrayFilters but in MongoTemplate class, updateMultimethod does not take the updateOptionparameter. 有人可以帮忙吗

我出来。对于任何建议,我们将不胜感激。谢谢。

注意:我使用的是 spring-data 版本“2.0.3.RELEASE”,MongoDB 驱动程序版本是 v3.6.4。

下面是一份文件:

{
      "_id": "x1",
      "timeZone": "America/Los_Angeles",
      "schedule": [
        {
          "Date": "2018-07-10T00:00:00.000Z",
          "status": "AVAILABLE"
        },
        {
          "Date": "2018-07-10T00:30:00.000Z",
          "status": "AVAILABLE"
        },
        {
          "Date": "2018-07-10T08:00:00.000Z",
          "status": "AVAILABLE"
        }
      ],
      "_class": "com.scheduler.persistance.model.Calendar"
    }
Run Code Online (Sandbox Code Playgroud)

mongodb spring-data-mongodb spring-boot

5
推荐指数
2
解决办法
3498
查看次数