我正在尝试使用Node版本6.2.1和我的一些代码.计划将大多数面向超回调的代码迁移到看起来更干净且可能表现更好的代码.
我不知道为什么,当我尝试执行节点代码时终端抛出错误.
helloz.js
(async function testingAsyncAwait() {
await console.log("Print me!");
})();
Run Code Online (Sandbox Code Playgroud)
日志 -
BOZZMOB-M-T0HZ:rest bozzmob$ node helloz.js
/Users/bozzmob/Documents/work/nextgennms/rest/helloz.js:1
(function (exports, require, module, __filename, __dirname) { (async function testingAsyncAwait() {
^^^^^^^^
SyntaxError: Unexpected token function
at Object.exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:513:28)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Function.Module.runMain (module.js:575:10)
at startup (node.js:160:18)
at node.js:456:3
BOZZMOB-M-T0HZ:rest bozzmob$ node -v
v6.2.1
Run Code Online (Sandbox Code Playgroud)
我错过了什么?请给我一些启示.
更新1:
我尝试使用Babel作为Quentin建议,但是,我仍然收到以下错误.
更新的代码 -
require("babel-core/register");
require("babel-polyfill");
(async function testingAsyncAwait() {
await console.log("Print …Run Code Online (Sandbox Code Playgroud) Capybara提供了检查链接的有用方法:
have_link
Run Code Online (Sandbox Code Playgroud)
据我所知,可以使用如下:
have_link("link_text", :href => "actual link")
Run Code Online (Sandbox Code Playgroud)
但是,我并不关心link_text,而是我只想检查href(因为将测试链接到文本更加脆弱).如果我只想检查href这将是一个视图测试.
如何使用Capybara检查而href无需检查文本?也许我可以使用正则表达式?
[编辑]根据以下答案改变了措辞
我逐步完成了Fabric的教程,并在我的项目中包含了Crashlytics.当我尝试进入Fabric仪表板时,仪表板无法打开,我总是会再次重定向到教程.
我有一个具有多个目标的应用程序,其中一些具有不同的捆绑ID.我已经设法将Fabric,特别是Crashlytics添加到过去具有相同捆绑ID的应用程序,但我不确定如何使用不同的捆绑ID进行多个目标.
我可能错过了任何指针或文档?
任何人都不知道Crashlytic或Fabric io何时会支持新的android app bundle格式aab文件?我目前正在更新所有的jenkins部署管道,以生成aab文件而不是apk文件。
干杯
我使用 Ubuntu 15.10。目前,我正在按照此处的说明从源代码构建 TensorFlow 。
我的安装成功了,除了最后一步:“Build your target with GPU support”。
当我从源代码树的根运行此命令时:
bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
我看到以下输出:
INFO: Found 1 target...
ERROR: /home/me/tensorflow/tensorflow/core/kernels/BUILD:549:1: error while parsing .d file: /home/me/.cache/bazel/_bazel_me/38a03c514c8dc954778fc9a555bce3de/tensorflow/bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/colorspace_op_gpu/tensorflow/core/kernels/colorspace_op_gpu.cu.d (No such file or directory).
nvcc warning : option '--relaxed-constexpr' has been deprecated and replaced by option '--expt-relaxed-constexpr'.
In file included from third_party/gpus/cuda/include/cuda_runtime.h:76:0,
from <command-line>:0:
third_party/gpus/cuda/include/host_config.h:115:2: error: #error -- unsupported GNU version! gcc versions later than 4.9 are not supported!
#error -- unsupported GNU version! gcc versions …Run Code Online (Sandbox Code Playgroud) 请帮助我找到 Crashlytics 说给定 UUID 缺少 dSYM 的问题。我已经搜索了我所有的 dSYM 文件,但没有找到给定的 UUID。我使用了这个命令:mdfind "com_apple_xcode_dsym_uuids == <>"从 crashlytics 检查 UUID。报告了 3 个丢失的 UUID Crashlytics。我已经上传了其中 2 个的 dSYM,但正在努力为最后一个 UUID 找到 dSYM。
我在 Fabric 中创建了一个项目,该应用程序已上传到启用了 Bitcode 的 App Store。我面临在 Fabric 上注册崩溃的问题。如何从 Fabric 中删除我的项目,以便我可以在 Fabric 中再次创建它?
在通过 Fabric 从 Crashlytics 转换为通过 Firebase 的 Crashlytics 之后,我开始在调试运行中看到以下调用堆栈,其中启用了 StrictMode 以查找资源泄漏。
StrictMode 与此代码一起使用,仅在调试版本中使用:
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedClosableObjects()
.penaltyLog()
.build());
Run Code Online (Sandbox Code Playgroud)
我在项目级 gradle 中使用了这个版本的 Fabric 的 gradle 工具:
classpath "io.fabric.tools:gradle:1.27.0"
Run Code Online (Sandbox Code Playgroud)
以及模块级 gradle 中这些版本的 Firebase 和 Crashlytics:
implementation "com.google.firebase:firebase-core:16.0.7"
implementation "com.crashlytics.sdk.android:crashlytics:2.9.8"
Run Code Online (Sandbox Code Playgroud)
在初始化期间,Firebase 检测会启动一个后台线程,该线程使用 okhttp 进行设置调用。当它发生时, StrictMode 会导致此调用堆栈弹出:
W/CrashlyticsCore: Received null settings, skipping report submission!
D/StrictMode: StrictMode policy violation: android.os.strictmode.LeakedClosableViolation: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
at android.os.StrictMode$AndroidCloseGuardReporter.report(StrictMode.java:1786)
at dalvik.system.CloseGuard.warnIfOpen(CloseGuard.java:264)
at java.util.zip.Inflater.finalize(Inflater.java:398) …Run Code Online (Sandbox Code Playgroud) 我试图验证一个电子邮件地址,如果它已经存在于表中,但这不起作用.
这是我的代码:
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$('#Submit').click(function() {
var emailVal = $('#email').val(); // assuming this is a input text field
$.post('checkemail.php', {'email' : emailVal}, function(data) {
alert(data);
});
});
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="view.php">
<p>
<input type="text" name="email" id="email" />
</p>
<p>
<input type="submit" name="Submit" id="Submit" value="Submit" />
</p>
</form>
</body></html>
Run Code Online (Sandbox Code Playgroud)
单击"提交"按钮时,它应首先使用jQuery进行验证并调用checkemail.php文件,如下所示:
<?php
include("../includes/db.php");
$sql = "SELECT email FROM lf_clients WHERE email = " .$_POST['email'];
$select = mysqli_query($con, $sql); …Run Code Online (Sandbox Code Playgroud) crashlytics ×5
android ×1
async-await ×1
asynchronous ×1
bazel ×1
capybara ×1
express ×1
firebase ×1
javascript ×1
jquery ×1
mysql ×1
node.js ×1
php ×1
tensorflow ×1
ubuntu ×1
uuid ×1