夏至、离别

文章 评论 浏览 29

夏至、离别 2025-02-11 00:13:25

解决了。我只需要创建对AHT(电话号码)和AHT(电话SE)的措施,然后我可以使用一个更简单的措施的“ check aht on target on Target on Target on Target on target on target on target”措施为´ aht(phone)= divide(sum(sum(sum)) fact_phone [attral aht]),sum(fact_phone [总呼叫回答])) ..现在我只需要弄清楚如果特定措施的AHT导致空白。这是稍后的答案,我必须等两天。

Solved it. I only had to create the to measures AHT (Phone NO) and AHT (Phone SE), then I could use the "Check AHT on target" measure on one simpler measure being ´AHT (Phone) = DIVIDE(SUM(fact_Phone[Total AHT]),SUM(fact_Phone[Total calls answered])) ..now I just need to figure out how to return nothing if the AHT for the specific measures result in blanks.. and I will mark this as the answer later, I have to wait two days though.

Power BI:使用有条件格式的DIM表作为标准,保留一个措施而不是多个

夏至、离别 2025-02-10 22:54:55

如果产品等于或低于1000,则返回其总和。

if x*y <= 1000:
   return x*y
else:
   return x+y 

20 * 30 = 600
600&lt; 1000
返回600

50 * 10 = 500
500&lt; 1000
返回500

if the product is equal to or lower than 1000, else return their sum.

if x*y <= 1000:
   return x*y
else:
   return x+y 

20 * 30 = 600
600 < 1000
return 600

50 * 10 = 500
500 < 1000
return 500

乘法或两个数字的总和

夏至、离别 2025-02-09 01:01:02

您的打字稿配置具有-NoImplicity设置。

因此,您要么需要明确指定任何类型任何

arrOfObject.reduce((prev:any, cur:any) => prev + cur.value, 0);

或者,您可以为对象创建新类型。

interface NameValue {
   name: string,
   value: number
}

const arrOfObject: NameValue[] = [
  {
    name: "A",
    value: 1,
  },
  {
    name: "B",
    value: 2,
  },
  {
    name: "C",
    value: 3,
  },
];

arrOfObject.reduce((prev, cur) => prev + cur.value, 0);

Your TypeScript config has the --noImplicitAny setting turned on.

So you either need to specify the type any, explicitly.

arrOfObject.reduce((prev:any, cur:any) => prev + cur.value, 0);

or you could alternatively create a new type for your object.

interface NameValue {
   name: string,
   value: number
}

const arrOfObject: NameValue[] = [
  {
    name: "A",
    value: 1,
  },
  {
    name: "B",
    value: 2,
  },
  {
    name: "C",
    value: 3,
  },
];

arrOfObject.reduce((prev, cur) => prev + cur.value, 0);

如何键入减少方法

夏至、离别 2025-02-08 09:31:42

您似乎至少需要一个自定义方案和主机,例如以下示例:

<activity ... exported=true>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="myapp" android:host="open" />
    </intent-filter>
</activity>

进行测试

adb shell am start -W -a android.intent.action.VIEW -d myapp://open

您可以通过执行此命令使用与Intent-Filter关联的活动

。如果它仍然不起作用,则可能是使用自定义方案的使用QR码阅读器。例如,开源应用程序 binary eye de.markusfisch.android.binaryeye )没有问题带有链接的代码 myApp:// open

You seem to require at least a custom scheme and host like the following example:

<activity ... exported=true>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="myapp" android:host="open" />
    </intent-filter>
</activity>

You can test it using

adb shell am start -W -a android.intent.action.VIEW -d myapp://open

By executing this command the activity that is associated with the intent-filter will open.

If it still doesn't work then may be the used QR code reader is not usuable with custom schemes. For example the open source app Binary Eye (de.markusfisch.android.binaryeye) has no problem opening an app using a QR code with a link myapp://open.

Android/Java:如何在没有HTTP的情况下创建个性化方案?

夏至、离别 2025-02-07 10:44:01

您可以复制数组并根据值过滤它们。请参阅此处的演示: https:///stackblitz.com/EditiT/eDIT/EDIT/EDIT/typescript-xwww2ai ?file = index.ts

const values = [
  { id: 1, name: 'a' },
  { id: 2, name: 'b' },
  { id: 3, name: 'c' },
  { id: 4, name: 'a' },
];

const copyValues = [...values];

const duplicateObjects = values.filter(
  (v) => copyValues.filter((cp) => cp.name === v.name).length > 1
);
console.log(duplicateObjects);

You can copy the array and filter them based on value. See the demo here: https://stackblitz.com/edit/typescript-xww2ai?file=index.ts

const values = [
  { id: 1, name: 'a' },
  { id: 2, name: 'b' },
  { id: 3, name: 'c' },
  { id: 4, name: 'a' },
];

const copyValues = [...values];

const duplicateObjects = values.filter(
  (v) => copyValues.filter((cp) => cp.name === v.name).length > 1
);
console.log(duplicateObjects);

通过重复属性的打字稿过滤器阵列

夏至、离别 2025-02-07 07:04:21

您可能需要服务器端渲染技术才能在HTML和脚本中生成电子邮件值。
您可以考虑在nodejs中启动服务,在请求中获取电子邮件值,以及在响应中,使用您的HTML和脚本返回电子邮件。

You may need a server-side rendering technology to generate your email value into your HTML and scripts.
You can consider starting a service in nodejs, get the email value in the request,and in the response,return the email with your html and scripts.

如何打印JavaScript变量并在控制台中显示它们?

夏至、离别 2025-02-07 05:00:55

我很久以前发现了这一点,很容易:

function getUrlVars() {
    var vars = {};
    var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,    
    function(m,key,value) {
      vars[key] = value;
    });
    return vars;
  }

然后这样称呼:

var fType = getUrlVars()["type"];

I found this ages ago, very easy:

function getUrlVars() {
    var vars = {};
    var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,    
    function(m,key,value) {
      vars[key] = value;
    });
    return vars;
  }

Then call it like this:

var fType = getUrlVars()["type"];

从“ get”中获取值参数(JavaScript)

夏至、离别 2025-02-07 02:27:13

使用每个复选框使用单独的名称属性值,并使用条件而不是交换机(如果只需要一个值,则使用“单选”按钮):

html:

<form action="form3.php" method="POST">
 <fieldset>
  <legend> select your team </legend>
  <input type="checkbox" name="punto3_1" value="1"> 1 </input>
  <input type="checkbox" name="punto3_2" value="2"> 2 </input>
  <p><input type="submit"></p>       
 </fieldset>
</form>

php:

<?php
if (
      (isset($_REQUEST['punto3_1']) && $_REQUEST['punto3_1'] != "")
      || (isset($_REQUEST['punto3_2']) && $_REQUEST['punto3_2'] != "")

)
{
    $punto3_1 = $_REQUEST['punto3_1'];
    $punto3_2 = $_REQUEST['punto3_2'];

    $conn = new mysqli("localhost", "root", "", "progetto2");
    if ($conn == false)
    {
    die("fail: " . $conn->connect_error);
    }

    if(isset($_REQUEST['punto3_1']) && $_REQUEST['punto3_1'] != ""){
        //your logic for punto3_1 will goes here....
    } elseif(isset($_REQUEST['punto3_2']) && $_REQUEST['punto3_2'] != ""){
        //your logic for punto3_2 will goes here....
    } else {
       //your logic for punto3_1 and punto3_2 will goes here....
    }
} else {
    echo "Please, do at least one selection";
}
?>

Use separate name attribute values for each checkbox and use if conditions instead of a switch (or use the radio button if you have required only one value) example:

HTML:

<form action="form3.php" method="POST">
 <fieldset>
  <legend> select your team </legend>
  <input type="checkbox" name="punto3_1" value="1"> 1 </input>
  <input type="checkbox" name="punto3_2" value="2"> 2 </input>
  <p><input type="submit"></p>       
 </fieldset>
</form>

PHP:

<?php
if (
      (isset($_REQUEST['punto3_1']) && $_REQUEST['punto3_1'] != "")
      || (isset($_REQUEST['punto3_2']) && $_REQUEST['punto3_2'] != "")

)
{
    $punto3_1 = $_REQUEST['punto3_1'];
    $punto3_2 = $_REQUEST['punto3_2'];

    $conn = new mysqli("localhost", "root", "", "progetto2");
    if ($conn == false)
    {
    die("fail: " . $conn->connect_error);
    }

    if(isset($_REQUEST['punto3_1']) && $_REQUEST['punto3_1'] != ""){
        //your logic for punto3_1 will goes here....
    } elseif(isset($_REQUEST['punto3_2']) && $_REQUEST['punto3_2'] != ""){
        //your logic for punto3_2 will goes here....
    } else {
       //your logic for punto3_1 and punto3_2 will goes here....
    }
} else {
    echo "Please, do at least one selection";
}
?>

与Switch语句的PHP中的复选框

夏至、离别 2025-02-06 19:51:19

这是一个小技巧,有时对我有帮助。

对我有用的是做一个这样的临时谓词:

bool debugGetIsPlayerPlaying(Player player)
{
    return player.Current.IsPlaying;
}

然后,当您进行此替换时...

private static SearchNodes MapNode(GameList node)
{
    return new SearchNodes
    {
        Id = node.Id.ToString(),
        GameTitle = node.Title,
        Story = node.Story,
        Published = node.Game.Published,
        PlayerHistory = node.Players.Where(e => debugGetIsPlayerPlaying(e.Player)).Select(e => e.Player.Name).ToArray()
    };            
}

...它为您提供了可以设置断点并逐步进行的东西,以帮助您确定失败的LINQ中发生的事情询问。希望这很有帮助!

Here's a little trick that has helped me at times like these.

What works for me is to make a temporary predicate like this:

bool debugGetIsPlayerPlaying(Player player)
{
    return player.Current.IsPlaying;
}

and then when you do this replacement...

private static SearchNodes MapNode(GameList node)
{
    return new SearchNodes
    {
        Id = node.Id.ToString(),
        GameTitle = node.Title,
        Story = node.Story,
        Published = node.Game.Published,
        PlayerHistory = node.Players.Where(e => debugGetIsPlayerPlaying(e.Player)).Select(e => e.Player.Name).ToArray()
    };            
}

... it gives you something you can set breakpoints on and step through to help you determine exactly what's going on in the failing Linq query. Hope this is helpful!

linq,即使我正在过滤条件,子句也返回所有内容

夏至、离别 2025-02-06 18:23:16

安装软件包时,Opam运行将构建。为了防止越野车的档案(可能会偶然运行 rm -rf /code>),Opam使用BubbleWrap来砂盒子构建。安装BubbleWrap( apt-get install bubblewrap ),或者,如果您想跳过,因为无论如何都在容器中运行,请这样初始化OPAM:

opam init --disable-sandboxing

OPAM runs builds when installing packages. To guard against buggy makefiles (that might run rm -rf / by accident), OPAM uses bubblewrap to sandbox the builds. Either install bubblewrap (apt-get install bubblewrap) or, if you wish to skip, because you're running in a container anyway, initialize OPAM like this:

opam init --disable-sandboxing

Opam Init在Docker上失败

夏至、离别 2025-02-06 17:27:19

我认为正确的方式是

s = df.loc[(df['from']<=0) & (df['to']<=400000000), 'value']
print(s)
0    0.01
Name: value, dtype: float64

I think correct way is with DataFrame.loc for select column by mask, also is change <= from < for second condition:

s = df.loc[(df['from']<=0) & (df['to']<=400000000), 'value']
print(s)
0    0.01
Name: value, dtype: float64

熊猫检查两个数据框列并访问第三值

夏至、离别 2025-02-06 07:35:38

您可以在 jq 中进行比较,使用 -e 选项返回其退出状态,并在 bash 中对此做出反应例如,使用语句使用

if jq -e '
  .config | map(select(.main != null) | .main[].mainAccount) | .[0] == .[1]
' file.json >/dev/null
then echo "equal"
else echo "not equal"
fi
not equal

You can do the comparison within jq, return the boolean result as its exit status using the -e option, and react upon that in bash, e.g. using an if statement.

if jq -e '
  .config | map(select(.main != null) | .main[].mainAccount) | .[0] == .[1]
' file.json >/dev/null
then echo "equal"
else echo "not equal"
fi
not equal

如何对多个子树进行检查

夏至、离别 2025-02-06 05:45:16

我认为有几种方法可以在这里做您想做的事。我会让您决定自己认为最适合您的东西。

  1. timesince timeuntil django中的模板格式化标签可能会立即为您提供所需的内容。

{{今天| TimeUntil:Contract.starting_date}}

https://docs.djangoproject.com/en/4.0/ref/templates/builtins/#timesince

  1. 另一个选项是使用 datetime 模块。

这是一个显示DateTime对象之间几天差异的示例:

import datetime
now = datetime.datetime.now()
startingDate = now + datetime.timedelta(days=7)
daysRemaining = (startingDate-now).days
print(daysRemaining) # INFO: prints '7'

我认为这不是您想要的,但是这是另一个示例,使用 strftime timeDERTA 获得更具体的格式:

tomorrowFormatted = datetime.datetime.strftime(datetime.datetime.now() + datetime.timedelta(days=1), "%d-%b-%Y")

I think there are a few ways to do what you want here. I'll let you decide what you think works best for you.

  1. The timesince or timeuntil template formatting tags within Django may give you what you want immediately.

{{ today |timeuntil:contract.starting_date }}

https://docs.djangoproject.com/en/4.0/ref/templates/builtins/#timesince
https://docs.djangoproject.com/en/4.0/ref/templates/builtins/#timeuntil

  1. Another option is to make use of the datetime module.

Here is an example showing the difference in days between datetime objects:

import datetime
now = datetime.datetime.now()
startingDate = now + datetime.timedelta(days=7)
daysRemaining = (startingDate-now).days
print(daysRemaining) # INFO: prints '7'

I don't think this is what you want, but here is another example, using strftime and timedelta to get more specific formatting:

tomorrowFormatted = datetime.datetime.strftime(datetime.datetime.now() + datetime.timedelta(days=1), "%d-%b-%Y")

仅在Django模板上显示几天

夏至、离别 2025-02-06 04:49:10

使用 exec 而不是 System exec 用给定的过程替换当前过程,而 system 将启动一个新过程并等待其退出。

Use exec instead of system. exec replaces the current process with the one given, while system will start a new process and wait for it to exit.

打开PDF文件时,需要同时退出当前的Perl脚本

夏至、离别 2025-02-06 02:43:16

如前所述在这里

> 3.0.x 版本的Spring Cloud Cloud Stream的版本中劝阻Spring-Cloud-stream-test-sup-support 。推荐的用于测试消息通道的工件是基于弹簧集成的新测试粘合剂。有了这种新的测试活页夹,您不再需要传统的spring-cloud-stream-test-support-support粘合剂。

如果您必须使用旧的测试活页夹(Spring-Cloud-stream-test-binder),则必须将KAFKA流的特定测试隔离到测试类中,然后排除 testsupportBinderaUtoconFiguration

如果旧的测试粘合剂在类Path(Spring-Cloud-stream-test-pumport)中,请尝试以下任何选项,

以避免尝试将KAFKA流组件绑定到该活页夹中,从而导致日志中抛出的例外。

   @EnableAutoConfiguration(exclude = TestSupportBinderAutoConfiguration.class)

或以下。

@TestPropertySource(properties ="spring.autoconfigure.exclude=org.springframework.cloud.stream.test.binder.TestSupportBinderAutoConfiguration")

我们的案例删除了 spring-cloud-stream-test-support 库库解决了问题。

As mentioned here

The usage of spring-cloud-stream-test-support is discouraged in the 3.0.x versions of Spring Cloud Stream. The recommended artifact for testing message channel based binders is the new Spring Integration based test binder. With this new test binder, you no longer need the legacy spring-cloud-stream-test-support binder.

If you must use the old test binder (spring-cloud-stream-test-binder), then you have to isolate the Kafka Streams specific tests to a test class and then exclude the TestSupportBinderAutoConfiguration.

If the old test binder is in the classpath (spring-cloud-stream-test-support), try any of the following options

to avoid trying to bind Kafka Streams components to that binder which results in an exception thrown in the logs.

   @EnableAutoConfiguration(exclude = TestSupportBinderAutoConfiguration.class)

Or the following.

@TestPropertySource(properties ="spring.autoconfigure.exclude=org.springframework.cloud.stream.test.binder.TestSupportBinderAutoConfiguration")

Our case removing the spring-cloud-stream-test-support library solved the problem.

kafkamessagechannelbinder不能被施放到类测试中

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文