土豪我们做朋友吧

文章 评论 浏览 28

土豪我们做朋友吧 2025-02-20 22:30:43

您可以添加“ Webhook”类型的消息步骤,以调用Braze /users/track api以归因自定义用户属性,然后将此属性用于决策拆分块。

在webhook中,您可以访问

{
  "attributes": [
    {
      "external_id": "{{${user_id}}}",
      "custom_property": "{{canvas_entry_properties.${custom_value}}}"
    }
  ]
}

当通过API触发画布时canvas_entry_properties像这样

{
    "canvas_id": "<canvas id>",
    "recipients": [
        {
            "external_user_id": "<user id>",
            "canvas_entry_properties": {
                "custom_value": "Value"
            }
        }
    ]
}

”输入图像描述在这里”

You could add a Message step of type "Webhook" to call Braze /users/track API to attribute a custom user attribute, and then use this attribute for the Decision split block.

In the Webhook you have access to canvas entry properties which you can access like this:

{
  "attributes": [
    {
      "external_id": "{{${user_id}}}",
      "custom_property": "{{canvas_entry_properties.${custom_value}}}"
    }
  ]
}

and when triggering the Canvas via API passing it to the canvas_entry_properties like this

{
    "canvas_id": "<canvas id>",
    "recipients": [
        {
            "external_user_id": "<user id>",
            "canvas_entry_properties": {
                "custom_value": "Value"
            }
        }
    ]
}

enter image description here

使用自定义事件属性进行铜牌中的帆布决策分裂?

土豪我们做朋友吧 2025-02-20 18:46:22

您必须在settings.xml上正确配置中心访问:

 <profiles>
    <profile>
      <id>nexus</id>
      <!--Enable snapshots for the built in central repo to direct -->
      <!--all requests to nexus via the mirror -->
      <repositories>
        <repository>
          <id>central</id>
          <url>https://central</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>https://central</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
   <activeProfiles>
    <activeProfile>nexus</activeProfile>
   </activeProfiles>

You have to configure the central access in your settings.xml correctly like this:

 <profiles>
    <profile>
      <id>nexus</id>
      <!--Enable snapshots for the built in central repo to direct -->
      <!--all requests to nexus via the mirror -->
      <repositories>
        <repository>
          <id>central</id>
          <url>https://central</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>https://central</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
   <activeProfiles>
    <activeProfile>nexus</activeProfile>
   </activeProfiles>

为什么“盖镜子的镜子”存储库;错误,尽管在Maven设置中使用HTTPS URL .xml

土豪我们做朋友吧 2025-02-20 17:48:44

感谢所有提示,我只是注意到我的单元格中有一个错误格式而不是字符串,而Len函数在那里丢了错误。

Thanks for all the tips, I just noticed that I had an error in my cells where it was a number format instead of a string, and the LEN function was throwing an error there.

VBA类型的不匹配错误与范围。值和范围。

土豪我们做朋友吧 2025-02-20 17:39:24

我会选择Asyncio和Aiohttp,这是一个完整的示例,说明如何同时执行多个请求并最终获得结果,

import aiohttp
import asyncio

async def geturl(url, session):
    async with session.get(url) as resp:
        if resp.status == 200:
            return (await resp.json())['name']
        else:
            return "ERROR"

async def main():
    urls = [f'https://pokeapi.co/api/v2/pokemon/{i}' for i in range(1,10)]
    async with aiohttp.ClientSession() as session:
        tasks = [geturl(url, session) for url in urls]
        # asyncio.gather will run all the tasks concurrently
        # and return their results once all tasks have returned
        all_results = await asyncio.gather(*tasks)
        print(all_results)

asyncio.run(main())

这将按照方式打印出前10个口袋妖怪名称,您可以根据需要调整

I would go with asyncio and aiohttp here is a complete example of how to do multiple requests concurrently and get the result in the end

import aiohttp
import asyncio

async def geturl(url, session):
    async with session.get(url) as resp:
        if resp.status == 200:
            return (await resp.json())['name']
        else:
            return "ERROR"

async def main():
    urls = [f'https://pokeapi.co/api/v2/pokemon/{i}' for i in range(1,10)]
    async with aiohttp.ClientSession() as session:
        tasks = [geturl(url, session) for url in urls]
        # asyncio.gather will run all the tasks concurrently
        # and return their results once all tasks have returned
        all_results = await asyncio.gather(*tasks)
        print(all_results)

asyncio.run(main())

This will print the first 10 pokemon names by the way, you can tweak for your needs

如何读取URL的文件和Web用多线程刮擦它们

土豪我们做朋友吧 2025-02-20 01:55:19

在没有您获得的输出以及预期输出的示例的情况下,尝试并理解您要问的内容是非常困难的。

但是,我认为您想要这样的东西:

SELECT I.AINVOICEID, SUM(I.totalBASE) AS totalBASE, InvDate
FROM Invoice I  INNER JOIN
(
    SELECT L.ABINVOICEID, J.JOBID
    FROM INLines L INNER JOIN
        Jobs J ON L.ARLJOBID = J.JOBID
    GROUP BY L.ABINVOICEID, J.JOBID
) LJ ON I.AINVOICEID = L.ABINVOICEID
WHERE I.InvDate BETWEEN '05/01/2022' AND '05/31/2022'
GROUP BY I.AINVOICEID, InvDate

这是基于您的SQL查询,它实际上并不需要在嵌入式或工作表上加入,因为您正在从发票表中获得所需的一切选择?

如果这不是您所追求的,那么如果您可以详细说明,那么这里的社区应该能够更好地协助您的问题。

It is quite difficult to try and make sense of what you're asking without an example of the output that you're getting and what the expected output is.

However, I think you're wanting something like this:

SELECT I.AINVOICEID, SUM(I.totalBASE) AS totalBASE, InvDate
FROM Invoice I  INNER JOIN
(
    SELECT L.ABINVOICEID, J.JOBID
    FROM INLines L INNER JOIN
        Jobs J ON L.ARLJOBID = J.JOBID
    GROUP BY L.ABINVOICEID, J.JOBID
) LJ ON I.AINVOICEID = L.ABINVOICEID
WHERE I.InvDate BETWEEN '05/01/2022' AND '05/31/2022'
GROUP BY I.AINVOICEID, InvDate

This is based on what your SQL query which doesn't really look like it needs to JOIN on the INLines or Jobs table because you're getting everything you need from the Invoice table in the SELECT ?

If this isn't what you're after, if you can elaborate a bit more, then the community on here should be able to better assist with your question.

两个ID匹配一个引起重复的ID

土豪我们做朋友吧 2025-02-20 00:43:28

尝试使用purrr :: transpose

map(transpose(test_dat), bind_rows)

这里有一点视觉辅助,以了解该功能的作用:

另外,test_func不返回任何内容。因此,在您的preprex中,您应该将以下内容添加为最后一行:return(df_list)


output

[[1]]
# A tibble: 9 x 2
   gear value
  <dbl> <dbl>
1     3  16.1
2     4  24.5
3     5  21.4
4     3  16.1
5     4  24.5
6     5  21.4
7     3  16.1
8     4  24.5
9     5  21.4

[[2]]
# A tibble: 18 x 2
    carb value
   <dbl> <dbl>
 1     1  25.3
 2     2  22.4
 3     3  16.3
 4     4  15.8
 5     6  19.7
 6     8  15  
 7     1  25.3
 8     2  22.4
 9     3  16.3
10     4  15.8
11     6  19.7
12     8  15  
13     1  25.3
14     2  22.4
15     3  16.3
16     4  15.8
17     6  19.7
18     8  15  

Try using purrr::transpose:

map(transpose(test_dat), bind_rows)

From the purrr cheatsheet here is a little visual aid to understand what that function does:

enter image description here

Also, test_func does not return anything. So, in your reprex you should add the following as the last line: return(df_list)


Output

[[1]]
# A tibble: 9 x 2
   gear value
  <dbl> <dbl>
1     3  16.1
2     4  24.5
3     5  21.4
4     3  16.1
5     4  24.5
6     5  21.4
7     3  16.1
8     4  24.5
9     5  21.4

[[2]]
# A tibble: 18 x 2
    carb value
   <dbl> <dbl>
 1     1  25.3
 2     2  22.4
 3     3  16.3
 4     4  15.8
 5     6  19.7
 6     8  15  
 7     1  25.3
 8     2  22.4
 9     3  16.3
10     4  15.8
11     6  19.7
12     8  15  
13     1  25.3
14     2  22.4
15     3  16.3
16     4  15.8
17     6  19.7
18     8  15  

使用purrr :: map_dfr()在列表中输出单独的数据帧

土豪我们做朋友吧 2025-02-19 23:02:08

更改此信息:

pbImage1.Image = new Bitmap(strImagePath + "1.jpg");

对此:

pbImage1.ImageLocation = Path.Combine(strImagePath, "1.jpg");

对于其他人,您的问题应该消失,因为文件不会被锁定,因此您不必担心解锁它们。

Change this:

pbImage1.Image = new Bitmap(strImagePath + "1.jpg");

to this:

pbImage1.ImageLocation = Path.Combine(strImagePath, "1.jpg");

and for the others and your issue should go away because the files will not be locked, so you don't have to worry about unlocking them.

如何在Winforms中显示图像然后删除?

土豪我们做朋友吧 2025-02-19 16:03:37

SheetOpenPageButton不需要导航controller,它既不使用也不需要在此处显示的代码中实例化。

您在gotoreStuarantFromStory [sic]中的navigationContoller来自收集范围的范围,并且根据您的代码也不是零,因此pushViewController从未实际调用过。

SheetOpenPageButton does not need a navigationController, it's neither used nor instantiated in the code you have shown here.

The navigationContoller your refer to in goToRestuarantFromStory[sic] is from the scope of your collectionView and according to your code also nil, so pushViewController is never actually called.

如何在按钮中传递参数

土豪我们做朋友吧 2025-02-19 07:29:02

给定您的示例场景(返回value s的总和),在我看来,您无需在顺序中实际获取每个value ;重要的是仅在正确的几个月子集中获取value。另外,您是根据词典中存在的,而不是基于索引中的

如果是这种情况,您可以首先过滤到正确的几个月子集,然后在该子集上迭代以检索每个相应的value

如果endMonth&gt; = startMontheNDMONTH&lt; StartMonth。您可以使用该方法 .where() 来自名称空间
system.linq 进行过滤。

可能的实现可能看起来如下:

//DaysInTheMonth is a Dictionary<int, int>

private static int GetTotalDays(int startMonth, int endMonth)
{
    var months = DaysInTheMonth.Select(entry => entry.Key);

    if (endMonth >= startMonth)
    {
        months = months
            .Where(m => m >= startMonth && m <= endMonth);
    }
    else
    {
        months = months
            .Where(m => m >= startMonth || m <= endMonth);
    }

    int days = 0;

    foreach (var month in months)
    {
        days += DaysInTheMonth[month];
    }

    return days;
}

startMonth = 7endMonth = 5,这将计算以下几个月的时间:1,1,, 2、3、4、5、7、8、9、10、11、12而不是7、8、9、10、11、11、12、1、2、3、4、5 < /代码>

示例小提琴在这里

Given your example scenario (returning a sum of Values), it seems to me like you do not need to actually get each Value in order; what is important is simply getting the Values for the correct subset of months. Also, you are fetching each Value based on a Key that exists in the dictionary, not based on an index.

If this is the case, you could first filter out the correct subset of months, and then iterate over that subset to retrieve each respective Value.

The filtering of months will look different if endMonth >= startMonth than if endMonth < startMonth. You may utilize the method .Where() from the namespace
System.Linq to do the filtering accordingly.

A possible implementation may look like the following:

//DaysInTheMonth is a Dictionary<int, int>

private static int GetTotalDays(int startMonth, int endMonth)
{
    var months = DaysInTheMonth.Select(entry => entry.Key);

    if (endMonth >= startMonth)
    {
        months = months
            .Where(m => m >= startMonth && m <= endMonth);
    }
    else
    {
        months = months
            .Where(m => m >= startMonth || m <= endMonth);
    }

    int days = 0;

    foreach (var month in months)
    {
        days += DaysInTheMonth[month];
    }

    return days;
}

For startMonth = 7 and endMonth = 5, this will calculate the sum of days in this order of months: 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12 rather than 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5

Example fiddle here.

特定索引值之间的词典项目的非线性检索

土豪我们做朋友吧 2025-02-19 03:41:45

我终于弄清楚了我需要做什么。

在“ git提取”之后,以下命令同时显示本地和远程更改:

$ git diff --stat --cached origin/Release_Candidate

 AP4Configuration/ChangeLog.txt    | 3 ++-
 AP4Configuration/appsettings.json | 3 ++-
 Local5.txt                        | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

但是要查看我自己修改的文件,并且将作为我本地提交的一部分推动:

$ git diff --stat --merge-base origin/Release_Candidate

 AP4Configuration/appsettings.json | 3 ++-
 Local5.txt                        | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

此列表不显示ChangElog.txt 。现在,它仅显示我本地提交的文件。因此,我可以看到将推出提交中的哪些文件,哪些文件需要从服务器端提交中提取。

I've finally figured out what I need to do.

After a 'git fetch', the following command shows both local and remote changes:

$ git diff --stat --cached origin/Release_Candidate

 AP4Configuration/ChangeLog.txt    | 3 ++-
 AP4Configuration/appsettings.json | 3 ++-
 Local5.txt                        | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

But to see the file(s) that I myself modified, and that will be pushed as part of my local commits:

$ git diff --stat --merge-base origin/Release_Candidate

 AP4Configuration/appsettings.json | 3 ++-
 Local5.txt                        | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

This list does not show Changelog.txt. It now only shows the files I committed locally. Therefore I can see which files in the commits will be pushed, and which ones will need pulling from the server-side commits.

如何区分需要在git中提取的文件,以及在本地提交并准备推送的文件

土豪我们做朋友吧 2025-02-18 17:30:53

你可以这样做

import csv
import json

with open('test.csv') as infile:
    reader = csv.DictReader(infile)
    out = [{"wavelength": row['wavelength'],"n": row["n"], "k": row["k"], "alpha": ["alpha"]} for row in reader]
keys = out[0].keys()
ref_out = {key: [i[key] for i in out ] for key in keys} 


    
with open('data.json', 'w') as outfile:
    json.dump(ref_out, outfile)

You can do it this way

import csv
import json

with open('test.csv') as infile:
    reader = csv.DictReader(infile)
    out = [{"wavelength": row['wavelength'],"n": row["n"], "k": row["k"], "alpha": ["alpha"]} for row in reader]
keys = out[0].keys()
ref_out = {key: [i[key] for i in out ] for key in keys} 


    
with open('data.json', 'w') as outfile:
    json.dump(ref_out, outfile)

将(.CSV)文件中的列转换为Python中的(.json)列数组

土豪我们做朋友吧 2025-02-18 16:57:23

防止数据库中重复用户名的最佳方法是为列添加唯一的索引

-- Make it unique
ALTER TABLE users ADD UNIQUE (username);

这将防止表格中具有相同用户名的复制记录。当您尝试插入相同的一个时,将产生错误。

然后,您可以在PHP中查看异常并检查原因。重复约束SQL错误代码为1062。

这是使用PDO时如何捕获此错误的示例:

$error = [];
$username = 'Dharman';

$pdo = new \PDO("mysql:host=localhost;dbname=test;charset=utf8mb4", 'user', 'password', [
    \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,  // make sure the error reporting is enabled!
    \PDO::ATTR_EMULATE_PREPARES => false
]);

try {
    $stmt = $pdo->prepare('INSERT INTO users(username) VALUE(?)');
    $stmt->execute([$username]);
} catch (\PDOException $e) {
    if ($e->errorInfo[1] === 1062) {
        $error[] = "This username is already taken!";
    } else {
        throw $e; // let the exception to be processed further 
    }
}

这是使用MySQLI时如何捕获此错误的示例:

$error = [];
$username = 'Dharman';

// make sure the error reporting is enabled!
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = new mysqli('localhost', 'user', 'password', 'test');
$mysqli->set_charset('utf8mb4');

try {
    $stmt = $mysqli->prepare('INSERT INTO users(username) VALUE(?)');
    $stmt->bind_param('s', $username);
    $stmt->execute();
} catch (\mysqli_sql_exception $e) {
    if ($e->getCode() === 1062) {
        $error[] = "This username is already taken!";
    } else {
        throw $e; // let the exception to be processed further 
    }
}

The best way to prevent duplicate usernames in the database is to add a UNIQUE index for the column

-- Make it unique
ALTER TABLE users ADD UNIQUE (username);

This will prevent duplicate records in the table with the same username. When you try to insert the same one then an error will be generated.

You can then catch the exception in PHP and check the reason. The duplicate constraint SQL error code is 1062.

Here is an example of how to catch this error when using PDO:

$error = [];
$username = 'Dharman';

$pdo = new \PDO("mysql:host=localhost;dbname=test;charset=utf8mb4", 'user', 'password', [
    \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,  // make sure the error reporting is enabled!
    \PDO::ATTR_EMULATE_PREPARES => false
]);

try {
    $stmt = $pdo->prepare('INSERT INTO users(username) VALUE(?)');
    $stmt->execute([$username]);
} catch (\PDOException $e) {
    if ($e->errorInfo[1] === 1062) {
        $error[] = "This username is already taken!";
    } else {
        throw $e; // let the exception to be processed further 
    }
}

Here is an example of how to catch this error when using mysqli:

$error = [];
$username = 'Dharman';

// make sure the error reporting is enabled!
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = new mysqli('localhost', 'user', 'password', 'test');
$mysqli->set_charset('utf8mb4');

try {
    $stmt = $mysqli->prepare('INSERT INTO users(username) VALUE(?)');
    $stmt->bind_param('s', $username);
    $stmt->execute();
} catch (\mysqli_sql_exception $e) {
    if ($e->getCode() === 1062) {
        $error[] = "This username is already taken!";
    } else {
        throw $e; // let the exception to be processed further 
    }
}

人们注册时如何防止重复用户名?

土豪我们做朋友吧 2025-02-18 02:58:54

这将无法正常工作。您显示的输出语法是有效的YAML列表,但仅包含一个单个shell Word,因此它正在寻找一个名为touch bar.txt的命令,其中该空间将成为文件名的一部分/usr/bin

Helm使用的GO文本/模板引擎并不特别了解YAML。当您直接写出这样的值时,它会使用并非特别有用的默认格式。 Helm有几个略有文献记录的扩展名,以更有用的格式写出值。对于您的示例,我可能会使用:

foo:
{{- with .Values.foo.command }}{{/* like "if", but also rebinds `.` */}}
  exec:
    command:
{{ toYaml . | indent 6 }}
{{- end }}

这应该写出来:

foo:
  exec:
    command:
      - touch
      - bar.txt
###### note: 6 spaces here matches `indent 6`

您可以适合命令:{{tojson .values.foo.command}}}} 中。无论哪种情况,它都可能没有value.yaml文件中的确切格式,因为Helm在启动时会解析YAML,然后写出等效结构。

This will not work as expected. The output syntax you show is a valid YAML list, but only containing a single shell word, and so it is looking for a command named touch bar.txt, where the space would be part of the filename in /usr/bin.

The Go text/template engine that Helm uses isn't especially aware of YAML. When you directly write out a value like this, it uses a default formatting that's not especially useful. Helm has a couple of lightly-documented extensions to write out values in a more useful format. For your example I might use:

foo:
{{- with .Values.foo.command }}{{/* like "if", but also rebinds `.` */}}
  exec:
    command:
{{ toYaml . | indent 6 }}
{{- end }}

This should write out:

foo:
  exec:
    command:
      - touch
      - bar.txt
###### note: 6 spaces here matches `indent 6`

You may be able to fit command: {{ toJson .Values.foo.command }} into a single line. In either case it may not have the exact formatting that's in the values.yaml file, since Helm parses the YAML at startup time and then writes out the equivalent structure.

Helm-是否可以将引号添加到其模板上列表中的所有项目?

土豪我们做朋友吧 2025-02-17 15:11:04

我认为您面临的问题是您在./ Datastore的内部创建了数据,因此,它在clearv1()文件。另一种方法是,当您最初制作数据变量时,它是用./ DataStore制成的,并且仅存在。因此,它制造了一个新变量,而不是更新现有变量。

另一个问题是,您正在尝试使用LET DATA = [value]在您调用的函数的内部创建变量,忽略了外部的任何变量。根据JavaScript中的经验,更新现有变量时,请使用[name] = [value]

如果您想了解更多信息,这是“ noreferrer”>“ noreferrer”>“ noreferrer”>导入语句 and 让语言

I think the problem your facing is the fact that you created data inside of ./dataStore, and thus, it does not exist in clearV1() file. Another way to put is, when you made the data variable initially, it was made in ./dataStore and only exists there. So it makes a new variable instead of updating the existing one.

Another problem is, you are trying to using let data = [value]. let creates the variable just inside of the function you called it in, ignoring any variables on the outside. As a rule of thumb in javascript, when updating an existing variable, use [name] = [value].

If you want to learn more, here's the MDN docs for import statements and let statements.

导入的功能不做在运行开玩笑时应该做的事情

土豪我们做朋友吧 2025-02-17 08:53:39

尝试在数据有效载荷中添加高或最大的优先级。

Data = new Dictionary<string, string>()
{
    {"myData", "One more try to say Succeded!"},
    {"priority", "high"},                   
},

这种复杂条件必须匹配以显示您的通知:
https://github.com/crossgeeks/ FireBasePushNotificationPlugin/blob/d86266a9f45687b418f5f1e69c34868681d1ff6e27/plugin.firebasepushnotification/defaultpushnotificationhandificationhandler.android.android.android.cs#l151#l151

Try adding priority with high or max to your Data Payload.

Data = new Dictionary<string, string>()
{
    {"myData", "One more try to say Succeded!"},
    {"priority", "high"},                   
},

This complex condition must match to show your notification:
https://github.com/CrossGeeks/FirebasePushNotificationPlugin/blob/d86266a9f45687b418f5f1e69c348681d1ff6e27/Plugin.FirebasePushNotification/DefaultPushNotificationHandler.android.cs#L151

Xamarin推送通知

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

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