小编Red*_*ket的帖子

如何创建重定向到URL的HTML取消按钮

我正在使用w3schools Tryit编辑器中按钮,我正在尝试弄清楚当我点击"取消"按钮时我的浏览器重定向到URL.

这是我尝试过的:

<form action="demo_form.asp" method="get">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <button type="submit" value="Submit">Submit</button>
  <button type="reset" value="Reset">Reset</button>
  <button type="cancel" onclick="javascript:window.location='http://stackoverflow.com';">Cancel</button>
</form>
Run Code Online (Sandbox Code Playgroud)

但它不起作用.有任何想法吗?

html javascript forms htmlbutton

31
推荐指数
7
解决办法
15万
查看次数

如何在降价中逃脱反击?

我正在写一些文档markdown,我想记录如何使用bash HEREDOC创建文本文件.这是我要记录的命令:

# cat > /tmp/answers.txt <<EOT
> value1=blah
> value2=something else
> value3=`hostname`
> value4=onetwothree
EOT
Run Code Online (Sandbox Code Playgroud)

在markdown中,使用`将文本呈现为"代码"我试过这样做...

`# cat > /tmp/answers.txt <<EOT`
`> value1=blah`
`> value2=something else`
`> value3=\`hostname\``
`> value4=onetwothree`
`EOT`
Run Code Online (Sandbox Code Playgroud)

......但是这会导致看起来像这样......

# cat > /tmp/answers.txt <<EOT
> value1=blah
> value2=something else
> value3=\
Run Code Online (Sandbox Code Playgroud)

主机名
> value4 = onetwothree
EOT

markdown github-flavored-markdown

23
推荐指数
3
解决办法
5081
查看次数

如何制作按钮填充表格单元格

我有这个HTML ...

<p align='center'>
<table width='100%'>
<tr>
<td align='center'><form><input type=submit value="click me"></form></td>
</tr>
</table>
</p>
Run Code Online (Sandbox Code Playgroud)

...导致表格和按钮看起来像这样......

没有填表的按钮

...这很好,但是如何让按钮填满整个单元?

谢谢!

html

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

无法在任务'上设置只读属性'jniFolders'的值:android:packageDebug'

我想在Android工作室中打开和投影我暂时没有工作,但是当Android Studio尝试加载项目时它失败并显示以下错误消息:

Error:(21, 0) Cannot set the value of read-only property 'jniFolders' on task ':android:packageDebug'.
Run Code Online (Sandbox Code Playgroud)

我点击指向的链接build.gradle,我猜这些线是问题...

// needed to add JNI shared libraries to APK when compiling on CLI
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
    pkgTask.jniFolders = new HashSet<File>()
    pkgTask.jniFolders.add(new File(projectDir, 'libs'))
}
Run Code Online (Sandbox Code Playgroud)

我在这里看到一个答案:谷歌AppInvites打破构建,说...

通过添加此代码修复:

android {
  sourcesets {
    main {
      jniLibs.srcDir new File(buildDir, 'lib')
    {
  }
}
Run Code Online (Sandbox Code Playgroud)

但上述答案并不十分清楚.我不确定要改变哪一行,答案中的括号似乎不匹配.

我完全不知道该怎么办?任何帮助表示赞赏.

谢谢

android android-studio android-gradle-plugin

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

PGP TarBall File Signature Keys Verification fails with no valid OpenPGP data found

This is the first time I figured I had better check the keys of the bind software I want to install. So I downloaded what I think is a OpenPGP key ...

$ wget ftp://ftp.isc.org/isc/bind9/9.9.4/bind-9.9.4.tar.gz.sha1.asc
Run Code Online (Sandbox Code Playgroud)

... then I tried to "import" this key like this ...

$ gpg --import bind-9.9.4.tar.gz.sha1.asc
Run Code Online (Sandbox Code Playgroud)

... but I get this error message:

gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
Run Code Online (Sandbox Code Playgroud)

What am I doing wrong?

Thanks!

openpgp

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

如何确定Google Play服务的版本?

我正在从Eclipse迁移到Android Studio.我有一个项目,我导入Android Studio使用Google Play服务,所以我按照我在此处找到的文档:http: //developer.android.com/google/play-services/setup.html 此文档说我需要编辑我的build.gradle文件.他们给出了一个例子:

apply plugin: 'com.android.application'
...

dependencies {
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.google.android.gms:play-services:6.5.87'
}
Run Code Online (Sandbox Code Playgroud)

此外,文档还提到"每次更新Google Play服务时,请确保更新此版本号.",我假设6.5.87在上面的示例中.那么如何确定我使用Android SDK管理器安装的"版本"Google Play服务.这是我的android sdk的屏幕截图:

在此输入图像描述

所以我的Android SDK管理器告诉我我已经安装了"修订版",那么我将什么放入我的build.gradle文件中?

    compile 'com.google.android.gms:play-services:6.5.22'
Run Code Online (Sandbox Code Playgroud)

... 或者可能 ...

    compile 'com.google.android.gms:play-services:22'
Run Code Online (Sandbox Code Playgroud)

任何帮助赞赏!

更新:谢谢你的所有答案.

我能够找到这样的版本:

Leila001@win8 ~/Windows_Home/AppData/Local/Android/android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/res/values
$ cat version.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <integer name="google_play_services_version">6587000</integer>
</resources>
Run Code Online (Sandbox Code Playgroud)

android gradle google-play-services android-studio

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

如何从命令行导入我的 django 应用程序模型?

我希望能够通过 python 控制台操作我的 Django 应用程序模型。我可以用 PyCharm 做到这一点,但在这种情况下我无法访问 PyCharm。我试过这个:

[root@myhost scripts]# source /apps/capman/env/bin/activate
(env) [root@myhost scripts]# python
Python 2.7.14 (default, Jan  9 2018, 20:51:20)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> from vc.models import *
Run Code Online (Sandbox Code Playgroud)

但我收到错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named vc.models 
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

python django

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

如何获取基于模型初始化的复选框?

我正在编写我的第一个非教程angular.js网络应用程序.我正在使用两个智能表和清单模型.下面是一个使用第一个st-safe-srcall_types是看起来像这样JSON对象的数组...

[
  {
    "_id": "56417a9603aba26400fcdb6a",
    "type": "Beer",
    "__v": 0
  },
  {
    "_id": "56456140cb5c3e8f004f4c49",
    "type": "Skiing",
    "__v": 0
  },
  ...
Run Code Online (Sandbox Code Playgroud)

这是我用来显示这些数据的表的html:

  <table st-table="displayedCollection" st-safe-src="all_types" class="table table-striped">
      <thead>
          <tr>
              <th st-sort="type">Types</th>
          </tr>
      </thead>
      <tbody>
          <tr ng-repeat="x in displayedCollection">
              <td><input type="checkbox" checklist-model="vendor.types" checklist-value="x.type">{{x.type}}</td>
          </tr>
          <tr><td>id ({{curid}}) {{vendor.types}}</td></tr>
      </tbody>
      <tfoot>
          <tr>
              <td colspan="5" class="text-center">
                  <div st-pagination="" st-items-by-page="itemsByPage" st-displayed-pages="7"></div>
              </td>
          </tr>
      </tfoot>
  </table>
Run Code Online (Sandbox Code Playgroud)

当我将数据加载到其中时,此表看起来像这样.选中复选框以匹配我的模型中的数据.

在此输入图像描述

但是当我尝试在第二个智能表中做同样的事情时,更完整的json对象看起来像这样......

[
  {
    "_id": "569f047dd90a7874025b344e",
    "product_title": "Plugs",
    "product_img_001": "p001.jpg",
    "product_img_002": "p002.jpg",
    "product_vid_001": "bp.mov",
    "__v": 0,
    "product_sizes": [ …
Run Code Online (Sandbox Code Playgroud)

javascript json angularjs smart-table checklist-model

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

如何在ansible中迭代库存组?

我看过一些与我的问题类似的SO帖子:Ansible:迭代库存组Ansible迭代由变量设置的库存组中的主机和其他人,但我仍然不明白我做错了什么:

这是我的库存文件:

[root@82c420275711 playbooks]# cat inventory.dev
#
#   - Comments begin with the '#' character
#   - Blank lines are ignored
#   - Groups of hosts are delimited by [header] elements
#   - You can enter hostnames or ip addresses
#   - A hostname/ip can be a member of multiple groups
[localhost]
127.0.0.1

[virtual_centers]
172.17.0.2
172.17.0.5
Run Code Online (Sandbox Code Playgroud)

这是我的剧本中遇到问题的部分:

- name: "allow {{ item }} to allow port 514"
  firewalld:
    immediate: yes
    rich_rule: "rule family=\"ipv4\" source address=\"{{ item …
Run Code Online (Sandbox Code Playgroud)

ansible

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

为什么我仍然看到旧图标?

我正在尝试更新ic_launcher.png我的应用程序的文件.出于某种原因,我仍然在手机上的"应用程序设置"中获得了这个非常小的旧版本图标:

在此输入图像描述

此外,当我看到卸载屏幕时,图标不正确:

在此输入图像描述

但是在点击"卸载"后,确认屏幕的图标很好. 在此输入图像描述

安装应用程序时,主屏幕上的启动器图标也会正常显示.

在此输入图像描述

android android-studio

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