问题列表 - 第246539页

VSO CI - 无论我做什么,ASPNETCORE_ENVIRONMENT都会设置为Production

我正在VSO中创建我的CI管道,我有.net核心应用程序,我创建了端点,告诉我在发布期间使用了哪个值,IHostingEnvironment.EnvironmentName通过API 公开,无论我做什么,它都设置为Produciton.我的应用程序托管在Azure中.

我做的步骤 -

我研究了Azure App Service的应用程序设置,寻找环境.想想可能会在Release配置中覆盖我的变量.

ASPNETCORE_ENVIRONMENT在发布配置中设置变量选项卡上的变量,我也在特定环境中设置它.

在环境中设置它: 在此输入图像描述 在此输入图像描述

在发布配置上设置它: 在此输入图像描述

我也setx用参数破坏了命令ASPNETCORE_ENVIRONMENT "Test".

setx命令

以上都没有任何区别,当我查询我的端点时,我回来了,我正在运行Production环境.任何帮助深表感谢.

azure-pipelines

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

Spark:将字符串列转换为数组

如何将已读取的字符串转换为数组列?即从下面的模式转换

scala> test.printSchema
root
 |-- a: long (nullable = true)
 |-- b: string (nullable = true)

+---+---+
|  a|  b|
+---+---+
|  1|2,3|
+---+---+
|  2|4,5|
+---+---+
Run Code Online (Sandbox Code Playgroud)

至:

scala> test1.printSchema
root
 |-- a: long (nullable = true)
 |-- b: array (nullable = true)
 |    |-- element: long (containsNull = true)

+---+-----+
|  a|  b  |
+---+-----+
|  1|[2,3]|
+---+-----+
|  2|[4,5]|
+---+-----+
Run Code Online (Sandbox Code Playgroud)

如果可能的话,请分享scala和python实现.在相关的说明中,如何在从文件本身读取时处理它?我有大约450列的数据,其中很少我想用这种格式指定.目前我在pyspark阅读如下:

df = spark.read.format('com.databricks.spark.csv').options(
    header='true', inferschema='true', delimiter='|').load(input_file)
Run Code Online (Sandbox Code Playgroud)

谢谢.

scala apache-spark pyspark

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

如何在Golang中创建没有字段或方法的顶级对象?

由于我来自Java并且是Golang的新手,我将尝试用Java解释我想要的东西.

    interface Car { }

    class MyCarA implements Car {
      int specificToA
    }

    class MyCarB implements Car {
      int specificToB
    }
Run Code Online (Sandbox Code Playgroud)

我认为这样的界面(如Car)在Java中称为标记界面.它只是表明编译器必要的抽象.

我怎么能在Golang中这样做?

我有

type MyCarA struct {
   specificToA int
}
type MyCarB struct {
  specificToB int
}
Run Code Online (Sandbox Code Playgroud)

我现在如何概括这些结构?它应该是一个接口还是另一个结构?

go

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

Woocommerce - 不显示购物车页面

添加到购物车选项后,我可以看到物品正在更新到CART,但是当移动到购物车页面时,它会重定向回主页.

在此输入图像描述

还提供了购物车页面短代码.

在此输入图像描述

请帮忙!我是woocommerce的新手.

wordpress shopping-cart cart missing-data woocommerce

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

Tensorflow r.1.1 中的 TrainingHelper 和 GreedyEmbeddingHelper 有什么区别(预测结果不同)?

我是 tensorflow 的初学者。我想通过使用本教程来研究 tensorflow 。

阅读本教程后,我想通过使用我的数据(用于标记化的韩国标题)运行此代码在训练模型(使用TrainingHelper)中,预测结果似乎还可以。但是在推理模型(使用GreedyEmbeddingHelper)中,预测结果非常糟糕(即使使用训练数据)。看起来像first epoch的训练模型预测。有什么区别TrainingHelperGreedyEmbeddingHelper

我认为教程和我的代码之间的区别只是超参数。

inference difference tensorflow

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

prettier-eslint,eslint-plugin-prettier和eslint-config-prettier之间有什么区别?

我想一起使用Prettier和ESLint,但我只是通过一个接一个地运行它们而遇到了一些冲突.我看到有这三个包似乎允许它们串联使用:

  • prettier-eslint
  • eslint-plugin-prettier
  • eslint-config-prettier

但是,我不确定使用哪个,因为这些包名都包含eslintprettier.

我应该使用哪个?

javascript code-formatting ecmascript-6 eslint prettier

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

如何创建和阅读登录Android设备?

我刚刚在Android上尝试了我的应用程序,它突然无法正常工作(在Windows上运行正常).有没有办法看到统一控制台的错误和Debug.Log消息 - 当我在Android上运行设备?(我使用开发模式和脚本调试).

我将adb连接到设备,也可以使用logcat和filter来"统一",但它仍然显示一个疯狂的日志.

我想看到的只是一个干净的日志,显示错误和我的Debug.Log消息,我通常可以在Unity上的Unity控制台上看到简单明了.

android unity-game-engine

4
推荐指数
2
解决办法
8190
查看次数

应用程序打开时不显示 FCM 通知

我的 android 应用程序中有工作 FCM 通知。一切正常。

我的问题是,如果应用程序打开,我不想显示通知。

这是我的 FirebaseMessagingService

public class FirebaseMessagingService extends com.google.firebase.messaging.FirebaseMessagingService{

    public static final int NOTIFICATION_ID = 1;
    private NotificationManager mNotificationManager;

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {

        showNotification(remoteMessage.getData().get("title"),remoteMessage.getData().get("message"),remoteMessage.getData().get("type")
                ,remoteMessage.getData().get("src"),remoteMessage.getData().get("productid"),remoteMessage.getData().get("productname")
                ,remoteMessage.getData().get("categoryname"),remoteMessage.getData().get("categoryid"));
    }

    public Bitmap getBitmapFromURL(String strURL) {
        try {
            URL url = new URL(strURL);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setDoInput(true);
            connection.connect();
            InputStream input = connection.getInputStream();
            Bitmap myBitmap = BitmapFactory.decodeStream(input);
            return myBitmap;
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }

    private void showNotification(String ttl,String msg, String type, String …
Run Code Online (Sandbox Code Playgroud)

android

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

如何使用前导零打印二进制的整数?

我正在做一些小事,我想打印我的u16中的所有位.

let flags = 0b0000000000101100u16;
println!("flags: {:#b}", flags);
Run Code Online (Sandbox Code Playgroud)

这打印flags: 0b101100.

如何打印flags: 0b0000000000101100

rust

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

"-spec"在Erlang语法中做了什么?如果使用或不使用-spec创建函数,那么差异是什么?

我是erlang编程的新手.我有很多疑问.其中一个是使用-spec.

"-spec"在Erlang语法中做了什么?如果使用或不使用-spec创建函数,有什么区别

没有-spec的函数

add(A, B) ->
    A + B.
Run Code Online (Sandbox Code Playgroud)

使用-spec函数

-spec add(Number, Number).
add(A, B) ->
    A + B.
Run Code Online (Sandbox Code Playgroud)

我在谷歌搜索但无法理解-spec的确切用法.有人可以解释一下吗?

erlang

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