小编Rém*_*émi的帖子

TextInputLayout onclick中的EditText需要2次点击?!Android的

我只是试图在TextInputLayout中的一个编辑文本上单击一下.它工作,但我需要点击EditText两次,它触发我不明白为什么.这是我的代码:

XML:

  <android.support.design.widget.TextInputLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp">

        <EditText
            android:id="@+id/start_date"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="Starting Date*: "
            android:inputType="textPersonName" />
    </android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)

Listenner:

   private void setListenners() {
        EditText startDate = (EditText) mView.findViewById(R.id.start_date);
        startDate.setOnClickListener(new View.OnClickListener() {
            @RequiresApi(api = Build.VERSION_CODES.N)
            @Override
            public void onClick(View v) {
                Calendar mcurrentDate=Calendar.getInstance();
                int mYear = mcurrentDate.get(Calendar.YEAR);
                int mMonth = mcurrentDate.get(Calendar.MONTH);
                int mDay = mcurrentDate.get(Calendar.DAY_OF_MONTH);

                DatePickerDialog mDatePicker=new DatePickerDialog(getActivity(), new DatePickerDialog.OnDateSetListener() {
                    @Override
                    public void onDateSet(DatePicker datePicker, int year, int month, int day) {
                        Log.d("DEBUG", "year: " + year + " month: " …
Run Code Online (Sandbox Code Playgroud)

android onclicklistener

19
推荐指数
2
解决办法
8184
查看次数

XCODE 中的 Expo Build 给出错误:CompileSwiftSources 正常的 arm64 com.apple.xcode.tools.swift.compiler

我正在尝试运行 expo 构建,以便可以在 XCode 模拟器中使用它。

我正在 Macbook M1 芯片上运行。

我只是从 xCode 打开 Expo 文件夹,然后尝试单击运行按钮,但出现以下错误:

Build fails with the below errors
The following build commands failed:
        CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'lottie-react-native' from project 'Pods')
        CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'ExpoModulesCore' from project 'Pods')
        CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'ExpoModulesCore' from project 'Pods')
        CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'expo-dev-menu' from project 'Pods')
        CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'expo-dev-launcher' from project 'Pods')
        PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/username/Library/Developer/Xcode/DerivedData/appname/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-84523FB004E42E06A56C6DE861F4376B.sh …
Run Code Online (Sandbox Code Playgroud)

macos xcode compiler-errors react-native apple-m1

8
推荐指数
0
解决办法
7318
查看次数

VBA:将Variable Array转换为String

我试图使用vba将变量数组转换为字符串.我尝试了两种方法,但没有它们起作用,它们似乎都在同一点上集中.

    Dim cell As Range
    Dim val As Variant

    For Each cell In Range("packing_list[Code]")
        val = cell.Value
    Next cell

    MsgBox Join(val, "//")
Run Code Online (Sandbox Code Playgroud)

    Dim oSh As Worksheet
    Dim CodeRange As Variant

    Set oSh = ActiveSheet
    CodeRange = oSh.Range("packing_list[Code]").Value

    MsgBox Join(CodeRange , "//")
Run Code Online (Sandbox Code Playgroud)

它们都是MsgBox行上的错误.我做错了什么?

谢谢

excel vba excel-vba

6
推荐指数
2
解决办法
2万
查看次数

Django名称模式未在ulrs.py中定义

我试图设置Django应用,但是每次尝试运行它时,都会收到以下错误消息:NameError:未定义名称“ patterns”

我不明白urls.py文件出了什么问题,这是它的副本:

from django.contrib import admin
from rest_framework import routers
from SecMeRe import views

router = routers.DefaultRouter()
#makes sure that the API endpoints work
router.register(r'api/SecMeRe', views.PatientViewSet)
admin.autodiscover()

urlpatterns = patterns(
    url(r'^admin/', include(admin.site.urls)),
    url(r'^', include(router.urls)),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
)
Run Code Online (Sandbox Code Playgroud)

python django django-urls

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

世博会应用服务 (eas) 上传发行说明

我们正在考虑使用 Expo 应用程序服务来构建,然后将我们的构建提交到应用商店和 Play 商店。

一切看起来都非常简单,但是,有一点我们无法弄清楚,即如何随构建版本一起提交发行说明。

我们可以像这样使用一些标志吗eas submit -p android --profile foobar --release-note release.txt

android ios expo

6
推荐指数
0
解决办法
193
查看次数

C++ ---错误C2664:'int scanf(const char*,...)':无法将参数1从'int'转换为'const char*'

我是C++的新手,我正在尝试构建这个非常简单的代码,但我不明白为什么会出现这个错误:

Error   1   error C2664: 'int scanf(const char *,...)' : cannot convert argument 1 from 'int' to 'const char *'
Run Code Online (Sandbox Code Playgroud)

这是代码:

// lab.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <stdio.h> 

int main(int argc, char* argv[])
{
    int row = 0;
    printf("Please enter the number of rows: ");
    scanf('%d', &row);
    printf("here is why you have entered %d", row);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c++ scanf

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

Google Play服务已过期.需要10298000但找到10084470

我不明白为什么我收到这条消息:

Google Play services out of date. Requires 10298000 but found 10084470
Run Code Online (Sandbox Code Playgroud)

在我的gradle中,我编译了谷歌地图版本10.2.以下是我的所有依赖项:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.1.1'
    compile 'com.android.support:design:25.1.1'

    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support:design:25.2.0'
    compile 'com.jakewharton:butterknife:7.0.1'

    compile 'com.stormpath.sdk:stormpath-sdk-android:1.1.3'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.5'

    compile 'com.android.support:cardview-v7:25.2.0'
    compile 'com.android.support:support-v4:25.2.0'

    compile 'com.squareup.okhttp3:okhttp:3.2.0'

    compile 'com.google.android.gms:play-services-maps:10.2.0'
    compile 'com.google.android.gms:play-services-location:10.2.0'

    compile 'com.android.support:preference-v7:25.2.0'
    compile 'com.android.support:recyclerview-v7:25.2.0'
    compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
    testCompile 'junit:junit:4.12'
}
Run Code Online (Sandbox Code Playgroud)

dependencies android gradle

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

在 NodeJS lambda 中使用自定义层

我在尝试将图层导入 lambda 函数时遇到错误。我已经检查了所有设置和配置,但我只是不明白为什么当我的函数部署并运行时,我收到来自 AWS 的错误,说它无法找到该layers层:

{
    "errorType": "Error",
    "errorMessage": "Cannot find module 'layers'\nRequire stack:\n- /var/task/entities/transakWebhookEvent.js\n- /var/task/handler.js\n- /var/task/s_money_movements_api.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
    "code": "MODULE_NOT_FOUND",
    "requireStack": [
        "/var/task/entities/transakWebhookEvent.js",
        "/var/task/handler.js",
        "/var/task/s_money_movements_api.js",
        "/var/runtime/UserFunction.js",
        "/var/runtime/index.js"
    ],
    "stack": [
        "Error: Cannot find module 'layers'",
        "Require stack:",
        "- /var/task/entities/transakWebhookEvent.js",
        "- /var/task/handler.js",
        "- /var/task/s_money_movements_api.js",
        "- /var/runtime/UserFunction.js",
        "- /var/runtime/index.js",
        "    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)",
        "    at Module._require.i.require (/var/task/serverless_sdk/index.js:9:73131)",
        "    at require (internal/modules/cjs/helpers.js:74:18)",
        "    at Object.<anonymous> (/var/task/entities/transakWebhookEvent.js:5:20)",
        "    at Module._compile (internal/modules/cjs/loader.js:999:30)",
        "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
        "    at Module.load (internal/modules/cjs/loader.js:863:32)",
        "    at …
Run Code Online (Sandbox Code Playgroud)

layer amazon-web-services node.js serverless

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

Django反向访问器错误

我不明白为什么我的模特的某些领域会发生冲突.

我没有任何外键,为什么他们会发生冲突?!

这是我的代码:

from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import AbstractUser
import datetime
import uuid

# Create your models here
class Patients(AbstractUser):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    first_name = models.CharField(max_length = 255)
    last_name = models.CharField(max_length = 255)
    dob = models.DateField(datetime.date.today)
    gender = models.CharField(max_length = 1)
    def __unicode__(self):
        return self.id
Run Code Online (Sandbox Code Playgroud)

这是错误:

api.Patients.groups: (fields.E304) Reverse accessor for 'Patients.groups' clashes with reverse accessor for 'User.groups'.
        HINT: Add or change a related_name argument to the definition for 'Patients.groups' or 'User.groups'. …
Run Code Online (Sandbox Code Playgroud)

python django accessor

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

按钮中的 HTML 电子邮件链接在 Outlook 桌面版中不起作用

我正在尝试发送一封 HTML 电子邮件,其中包含单击按钮即可访问的 URL。这是我使用的代码:

<div align="left" class="button-container" style="padding-top:40px;padding-right:30px;padding-bottom:40px;padding-left:40px;">
<!--[if mso]>
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 0; border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
    <tr>
        <td style="padding-top: 40px; padding-right: 30px; padding-bottom: 40px; padding-left: 40px" align="left">
            <v:roundrect
                xmlns:v="urn:schemas-microsoft-com:vml"
                xmlns:w="urn:schemas-microsoft-com:office:word" href="" style="height:39pt; width:198pt; v-text-anchor:middle;" arcsize="4%" stroke="false" fillcolor="#0f8de9">
                <w:anchorlock/>
                <v:textbox inset="0,0,0,0">
                    <center style="color:#ffffff; font-family:Arial, sans-serif; font-size:14px">
                        <![endif]-->
                        <a href="{{ url }}">
                            <div style="text-decoration:none;display:inline-block;color:#ffffff;background-color:#0f8de9;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;width:auto; width:auto;;border-top:1px solid #0f8de9;border-right:1px solid #0f8de9;border-bottom:1px solid #0f8de9;border-left:1px solid #0f8de9;padding-top:10px;padding-bottom:10px;font-family:Helvetica Neue, Helvetica, Arial, sans-serif;text-align:center;mso-border-alt:none;word-break:keep-all;">
                                <span style="padding-left:20px;padding-right:20px;font-size:14px;display:inline-block;">
                                    <span style="font-size: 16px; margin: 0; line-height: 2; word-break: …
Run Code Online (Sandbox Code Playgroud)

html hyperlink html-email

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

使用 begin_with 查询 dynamodb

我有一个使用无服务器框架创建的表:

resources:
  Resources:
    withdawlRequestTable: 
      Type: AWS::DynamoDB::Table
      Properties:
        TableName: ${self:provider.environment.WITHDRAWAL_REQUEST_TABLE}
        AttributeDefinitions:
          - AttributeName: pk
            AttributeType: S
          - AttributeName: sk
            AttributeType: S
        KeySchema:
          - AttributeName: pk
            KeyType: HASH
          - AttributeName: sk
            KeyType: RANGE
        ProvisionedThroughput:
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1
        GlobalSecondaryIndexes:
        - IndexName: sk-pk-index
          KeySchema:
          - AttributeName: sk
            KeyType: HASH
          - AttributeName: pk
            KeyType: RANGE
          Projection:
            ProjectionType: ALL
          ProvisionedThroughput: 
            ReadCapacityUnits: 1
            WriteCapacityUnits: 1
Run Code Online (Sandbox Code Playgroud)

我现在尝试使用运算符查询该表begins_with,但我不断收到此错误:

INFO    ValidationException: Invalid KeyConditionExpression: Incorrect operand type for operator or function; operator or function: begins_with, operand type: M …
Run Code Online (Sandbox Code Playgroud)

node.js amazon-dynamodb dynamodb-queries

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

在后台启动ruby / rail服务器

我只是想在后台运行ruby / rail服务器。这个应用程序包含一个redmine,我使用以下命令手动运行服务器:

bundle exec ruby bin/rails -d server -b 192.168.0.8 webrick -e production
Run Code Online (Sandbox Code Playgroud)

我试图在末尾添加&以在其他线程中运行它,但是由于某种原因,它仍然在前台运行它,在Google上查看后,我发现了这一点:https : //github.com/macournoyer/thin。但是我不确定如何使它运行服务器调用后我拥有的所有其他参数。

ruby ruby-on-rails redmine server

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

构建期间空间不足

我目前正在尝试使用python文件和require.txt中的许多额外软件包创建docker映像。

当我运行命令“ sudo docker build -t XXX”时。程序包被下载并一个接一个地安装,直到收到错误消息:“由于EnvironmentError无法安装程序包:[Errno 28]设备上没有剩余空间”

我已经做了“ sudo docker system prune”的原子选项,并且删除了所有过去的docker镜像。

此外,“ sudo docker info”显示我已经为docker分配了15 GB,尽管我不成功的docker映像大小为1 GB,但它仍然大大低于总内存。

此处未提及任何选项:https : //unix.stackexchange.com/questions/203168/docker-says-no-space-left-on-device-but-system-has-plenty-of-space或此处:Docker错误:设备上没有剩余空间 。我可以创建多个〜1GB的“失败”泊坞窗,总大小超过20GB,因此这不是我的VM HDD上空间不足的问题。因此,我将对更多的想法表示感谢。

docker

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