内心旳酸楚

文章 评论 浏览 29

内心旳酸楚 2025-02-20 12:56:42

您错过了印刷品的括号。

print (np.concatenate(arr1, arr2), axis = 0)

应该是

print (np.concatenate((arr1, arr2), axis = 0))

You missed a parenthesis in your print.

print (np.concatenate(arr1, arr2), axis = 0)

should be

print (np.concatenate((arr1, arr2), axis = 0))

TypeError:只有整数标量阵列可以转换为标量 - 2个基本阵列中的错误

内心旳酸楚 2025-02-20 00:49:24

您正在尝试在null上使用seturi()

您仅检查是否有一个称为“服务详细信息操作”的侧栏元素 - 但是,如果“服务详细措施”,“登录到cpanel”或“登录到Webmail”不存在,则您正在尝试设置URI对于不存在的副本子元素。

这很可能与WHMCS更改Menuitems在8.4.1中的工作方式有关: https://docs.whmcs.com/changelog:whmcs_v8.4#maintance_4

core -17437-防止声明错误与菜单项有关
也称为:core-17436

新名称是“ Cpanel”和“ Webmail”,而不是“登录到Cpanel”和“登录到WebMail”。
为了避免抛出例外,您应该检查Menuitem是否存在。

You're trying to use setUri() on null.

You're only checking if there's a sidebar element called "Service Details Actions" - but if either "Service Details Actions", "Login to cPanel" or "Login to Webmail" doesn't exist, you're trying to set a uri for a sidebare child element that doesn't exist.

This most likely has something to do with WHMCS changing how menuitems worked in 8.4.1: https://docs.whmcs.com/Changelog:WHMCS_V8.4#Maintenance_4

CORE-17437 - Prevent declaration error related to Menu items
Also known as: CORE-17436

New names are "cpanel" and "webmail" instead of "Login to cPanel" and "Login to Webmail".
To avoid exceptions being thrown, you should check if the menuitem exists.

CPANEL帐户登录-WHMCS

内心旳酸楚 2025-02-19 18:59:40

我使用module.export =“ value”获取我想要的数据。我在index.js中进行了此操作,需要索引。

const datas = require("./index.js")
const client = datas.Client

I used module.export = "Value" to get the data I wanted. I did this in index.js and required index.js to get the data

const datas = require("./index.js")
const client = datas.Client

有没有办法将变量从index.js获取到另一个文件?

内心旳酸楚 2025-02-19 14:47:24
  1. 是的,A 简单关联将是正确的选择。无论如何,这是一个共享聚合,它没有定义的语义。参见p。 UML 2.5的110:

表示该属性已共享聚合语义。共享聚合的精确语义因应用区域和建模者而异。

因此,您最好询问图表作者有关他的意图。

  1. 这不是依赖性,而是关联。依赖性将用虚线呈现。导航性(使您认为这是一种依赖性的箭头权利)是少量用途。它表明OrderDetail可以看到item,但反之亦然。最好仅在一侧使用角色名称来表达这一事实。例如,仅在右侧放置item,而左侧没有任何内容。

我们能学到什么? UML是关于沟通的!

  1. Yes, a simple association would be the right choice. Anyhow, this is a shared aggregation which has no defined semantics. See p. 110 of UML 2.5:

Indicates that the Property has shared aggregation semantics. Precise semantics of shared aggregation varies by application area and modeler.

So you best ask the diagram author about his intentions.

  1. It's not a dependency but an association. A dependency would be rendered with a dashed line. The navigability (the arrow right which made you belief it's a dependency) however is of minor use. It indicates that OrderDetail can see Item but not vice versa. A fact that could better be expressed by using role names only at one side. E.g. placing item only on the right hand side and nothing to the left.

What can we learn? UML is about communication!

不了解关系之间的区别

内心旳酸楚 2025-02-19 07:25:52

时钟周期5-7在您的桌子上不正确。这是正确的表:

Clk  State
1    IDLE
2    SETUP
3    ACCESS
4    ACCESS 
5    ACCESS
6    IDLE
7    SETUP
8    ACCESS
9    ACCESS

5仍然处于访问状态,因为PSEL和PENABLE仍然是1。6

处于空闲状态,因为PSEL和PENABLE为0。第1个APB传输在第5周期中完成。7

是2nd的开始APB传输,这是设置状态。

可以从访问设置过渡,但这将需要PSEL保留1。这将是背对背的转移(转移之间没有空闲)。您的波形并未显示这种情况。但是,背靠背的转移看起来像这样:

            1   2   3   4   5   6   7   8   9
           _   _   _   _   _   _   _   _   _
clk      _| |_| |_| |_| |_| |_| |_| |_| |_| |_
               __________________________
psel     _____|               
                   ___________     _______
penable  _________|           |___|
                           _______     ___
pready   _________________|       |___|

state       I   S   A   A   A   S   A   A

Clock cycles 5-7 are incorrect in your table. This is the correct table:

Clk  State
1    IDLE
2    SETUP
3    ACCESS
4    ACCESS 
5    ACCESS
6    IDLE
7    SETUP
8    ACCESS
9    ACCESS

5 is still in the ACCESS state since PSEL and PENABLE are still 1.

6 is in the IDLE state since PSEL and PENABLE are 0. The 1st APB transfer completed in cycle 5.

7 is the start of the 2nd APB transfer, which is the SETUP state.

It is possible to transition from ACCESS to SETUP, but that would require PSEL to remain 1. This would be a back-to-back transfer (with no IDLE between the transfers). Your waveforms do not show that scenario. But, a back-to-back transfer could look like this:

            1   2   3   4   5   6   7   8   9
           _   _   _   _   _   _   _   _   _
clk      _| |_| |_| |_| |_| |_| |_| |_| |_| |_
               __________________________
psel     _____|               
                   ___________     _______
penable  _________|           |___|
                           _______     ___
pready   _________________|       |___|

state       I   S   A   A   A   S   A   A

APB协议与操作状态冲突?

内心旳酸楚 2025-02-18 21:31:41

我不知道他为什么没有将其作为答案,但是您可以做Dean Flinter所说的话:

SELECT pid
       ,LISTAGG(DISTINCT acc_no, ',') WITHIN GROUP(ORDER BY acc_no) 
        AS acc_no_txt
FROM
(SELECT pid
      ,CASE WHEN acc_no_v01 IN ('not found','blank','nil-value','',' ','null') THEN NULL
       ELSE acc_no_v01
       END
       AS acc_no
      ,MIN(TRY_TO_NUMBER(T2.vp_no)) AS vp_no
FROM table_1 T1
JOIN table_2 T2
ON T2.click_stream_integration_id = T1.click_stream_integration_id
WHERE T2.date = '2022-01-01'
AND pid='123456789'
GROUP BY pid,acc_no_v01
ORDER BY TRY_TO_NUMBER(vp_no)
)
GROUP BY pid;

I don't know why he didn't post it as an answer but you can do what Dean Flinter said:

SELECT pid
       ,LISTAGG(DISTINCT acc_no, ',') WITHIN GROUP(ORDER BY acc_no) 
        AS acc_no_txt
FROM
(SELECT pid
      ,CASE WHEN acc_no_v01 IN ('not found','blank','nil-value','',' ','null') THEN NULL
       ELSE acc_no_v01
       END
       AS acc_no
      ,MIN(TRY_TO_NUMBER(T2.vp_no)) AS vp_no
FROM table_1 T1
JOIN table_2 T2
ON T2.click_stream_integration_id = T1.click_stream_integration_id
WHERE T2.date = '2022-01-01'
AND pid='123456789'
GROUP BY pid,acc_no_v01
ORDER BY TRY_TO_NUMBER(vp_no)
)
GROUP BY pid;

我需要帮助使用ListAgg功能

内心旳酸楚 2025-02-18 13:27:57

scroll-behavior css属性元素顺利滚动。
element.scrollintoview 用于程序上卷轴滚动一个元素。

如果您想滚动到页面的标题 scroll-behavior:smooth您可以选择行为选项并设置它到平滑

var header = document.getElementById("header")
header.scrollIntoView({ behavior: "smooth" })

scroll-behavior CSS property make the contents within an element scroll smoothly.
While Element.scrollIntoView is used to programmatically scroll to an element.

If you want for example scroll to the header of the page with scroll-behavior: smooth you can opt-in the behavior option and set it to smooth.

var header = document.getElementById("header")
header.scrollIntoView({ behavior: "smooth" })

我的滚动行为设置为在CSS中平滑,但是如何在JS中写入它?

内心旳酸楚 2025-02-18 11:02:16

您可以尝试使用给定的2种方法。

1。

<form #f="ngForm" (ngSubmit)="submit(f)">
  <div class="form-group">
    <label for="firstname">Name </label><br />
    <input
      type="text"
      class="form-control"
      name="firstname"
      [(ngModel)]="employee.firstname"
    />
  </div>
  <button class="btn" type="submit">Update Employee Name</button>
</form>
<form #f="ngForm" (ngSubmit)="submit(f)">
  <div class="form-group">
    <label for="firstname">Name </label><br />
    <input
      type="text"
      class="form-control"
      name="firstname"
      [value]="employee.firstname"
    />
  </div>
  <button class="btn" type="submit">Update Employee Name</button>
</form>

工作演示

You can try with given 2 approach.

1.

<form #f="ngForm" (ngSubmit)="submit(f)">
  <div class="form-group">
    <label for="firstname">Name </label><br />
    <input
      type="text"
      class="form-control"
      name="firstname"
      [(ngModel)]="employee.firstname"
    />
  </div>
  <button class="btn" type="submit">Update Employee Name</button>
</form>
<form #f="ngForm" (ngSubmit)="submit(f)">
  <div class="form-group">
    <label for="firstname">Name </label><br />
    <input
      type="text"
      class="form-control"
      name="firstname"
      [value]="employee.firstname"
    />
  </div>
  <button class="btn" type="submit">Update Employee Name</button>
</form>

Working Demo

Angular HTML表单 - 值属性在输入字段中不起作用

内心旳酸楚 2025-02-18 08:35:09

您不显示代码,但我想您使用scrollview。您可以尝试添加参数:physics = NeverScrollablesCrollphysics(), to ListView Widget。

You do not show code, but I guess, You use kind a scrollview. You can try add parameter: physics = NeverScrollableScrollPhysics(), to ListView widget.

当我滚动时,ListView会上下上下

内心旳酸楚 2025-02-18 06:16:18

这是我想到的,它对其他人可能很有用 - 将ACSII转换为十进制,创建AudioBuffer,这是ASCII/DICMAL的长度,映射值-1和1之间的小数-1和1之间,将结果放入AudioBuffer中并播放。一旦您知道要寻找什么(我完全没有)就不复杂。

// String to convert to audio
var html = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan commodo pretium. Aliquam porta tortor ut quam sagittis posuere. Nullam in condimentum purus, nec vulputate risus. Sed a sollicitudin ipsum. Pellentesque diam nisi, viverra vitae metus at, consectetur posuere lorem. Morbi faucibus sed mi quis cursus. Morbi et tincidunt sem. Phasellus pretium ultricies massa, sit amet consectetur urna rutrum nec. Proin vel velit neque. Fusce eget nulla dui. Phasellus id risus ut lacus laoreet rhoncus. Nunc ultrices eleifend eros, et rhoncus dui dictum sit amet. In dignissim velit ac rhoncus faucibus. Sed viverra lorem at nulla mollis auctor. Etiam vel lacinia neque. Nullam ipsum sapien, rutrum egestas nulla a, efficitur mattis nisi. Nulla non nibh arcu. Vestibulum quis dui non mauris placerat egestas. Suspendisse potenti. Nulla porta id felis sit amet feugiat. Fusce felis metus, ultrices eget posuere id, consectetur nec augue. Nulla nec tortor ac felis rhoncus tempor quis id erat. Nam semper tincidunt ex eu iaculis. Cras a turpis eget dui viverra elementum. In eu orci sodales, ornare leo ut, fermentum elit. Aenean non sem at dui laoreet gravida eu a magna. Praesent vitae urna mattis, efficitur erat id, sagittis neque. Sed sit amet suscipit felis. Nam fringilla ligula leo, vitae malesuada ipsum tincidunt nec. Proin at justo in nisl accumsan consectetur. Phasellus sit amet nisl lacus. Quisque ornare enim laoreet sapien ultricies, ornare faucibus diam condimentum. Donec facilisis at turpis in iaculis. Phasellus laoreet condimentum varius. Phasellus sed dui ut nibh placerat ultrices quis vel lacus. Cras nec vehicula diam. Vivamus vel lacus accumsan, faucibus quam vitae, hendrerit nibh. Aliquam et elementum nunc. Sed mi est, lobortis eu orci sed, tempor vehicula mauris. Aenean non massa varius, ultrices justo eu, cursus ante. In ex nulla, tincidunt eget arcu hendrerit, tempor eleifend ipsum. Vivamus suscipit justo at finibus faucibus. Cras dolor erat, blandit sit amet lacus sit amet, sollicitudin aliquet arcu. Nulla nec sodales neque. Suspendisse sed laoreet mauris. Curabitur sapien neque, lobortis at blandit in, eleifend aliquet velit. Nullam dictum justo quis tellus rutrum, at tincidunt libero iaculis. Nulla convallis eget nisl viverra hendrerit. Nulla imperdiet orci non suscipit elementum. Nunc a metus finibus arcu fermentum porttitor. Morbi semper porttitor cursus.";

// String length
var htmllength = html.length;

// Create an audio context
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();

// Create an empty three-second stereo buffer at the sample rate of the AudioContext
//const audiobuffer = audioCtx.createBuffer(2, audioCtx.sampleRate * 3, audioCtx.sampleRate);
const audiobuffer = audioCtx.createBuffer(2, htmllength, audioCtx.sampleRate);

// Map a number from one range to another
function map (number, inMin, inMax, outMin, outMax)
{
    return (number - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
}

// Fill the buffer with white noise;
// just random values between -1.0 and 1.0
for (var channel = 0; channel < audiobuffer.numberOfChannels; channel++)
{
    // This gives us the actual array that contains the data
    var nowBuffering = audiobuffer.getChannelData(channel);

    // Loop through the array
    for (var i = 0; i < audiobuffer.length; i++)
    {
        // Get each character
        var char = html.charAt(i);

        // Get the character's binary character code (0 - 256)
        var decimal = char.charCodeAt(0);

        // Map binary character code to PCM audio number
        var pcmnumber = map(decimal, 0, 256, -1, 1);

        // Add PCM audio to group of slots in audiobuffer 
        nowBuffering[i] = pcmnumber;
    }
}

// Get an AudioBufferSourceNode.
// This is the AudioNode to use when we want to play an AudioBuffer
var source = audioCtx.createBufferSource();

// set the buffer in the AudioBufferSourceNode
source.buffer = audiobuffer;

// Set volume
gainnode = audioCtx.createGain();
gainnode.gain.value = 1.0;

// Slow down the playback rate
source.playbackRate.value = 0.1;

// connect the AudioBufferSourceNode to the
// destination so we can hear the sound
source.connect(gainnode).connect(audioCtx.destination);

// start the source playing
//source.loop = true;
source.start(0);

Here is what I came up with, it may be useful to others - convert acsii to decimal, create audiobuffer that's the length of the ascii/decimal, map the decimal between values -1 and 1, put the result into audiobuffer and play it. Not complicated once you know what to look for (which I completely didn't).

// String to convert to audio
var html = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan commodo pretium. Aliquam porta tortor ut quam sagittis posuere. Nullam in condimentum purus, nec vulputate risus. Sed a sollicitudin ipsum. Pellentesque diam nisi, viverra vitae metus at, consectetur posuere lorem. Morbi faucibus sed mi quis cursus. Morbi et tincidunt sem. Phasellus pretium ultricies massa, sit amet consectetur urna rutrum nec. Proin vel velit neque. Fusce eget nulla dui. Phasellus id risus ut lacus laoreet rhoncus. Nunc ultrices eleifend eros, et rhoncus dui dictum sit amet. In dignissim velit ac rhoncus faucibus. Sed viverra lorem at nulla mollis auctor. Etiam vel lacinia neque. Nullam ipsum sapien, rutrum egestas nulla a, efficitur mattis nisi. Nulla non nibh arcu. Vestibulum quis dui non mauris placerat egestas. Suspendisse potenti. Nulla porta id felis sit amet feugiat. Fusce felis metus, ultrices eget posuere id, consectetur nec augue. Nulla nec tortor ac felis rhoncus tempor quis id erat. Nam semper tincidunt ex eu iaculis. Cras a turpis eget dui viverra elementum. In eu orci sodales, ornare leo ut, fermentum elit. Aenean non sem at dui laoreet gravida eu a magna. Praesent vitae urna mattis, efficitur erat id, sagittis neque. Sed sit amet suscipit felis. Nam fringilla ligula leo, vitae malesuada ipsum tincidunt nec. Proin at justo in nisl accumsan consectetur. Phasellus sit amet nisl lacus. Quisque ornare enim laoreet sapien ultricies, ornare faucibus diam condimentum. Donec facilisis at turpis in iaculis. Phasellus laoreet condimentum varius. Phasellus sed dui ut nibh placerat ultrices quis vel lacus. Cras nec vehicula diam. Vivamus vel lacus accumsan, faucibus quam vitae, hendrerit nibh. Aliquam et elementum nunc. Sed mi est, lobortis eu orci sed, tempor vehicula mauris. Aenean non massa varius, ultrices justo eu, cursus ante. In ex nulla, tincidunt eget arcu hendrerit, tempor eleifend ipsum. Vivamus suscipit justo at finibus faucibus. Cras dolor erat, blandit sit amet lacus sit amet, sollicitudin aliquet arcu. Nulla nec sodales neque. Suspendisse sed laoreet mauris. Curabitur sapien neque, lobortis at blandit in, eleifend aliquet velit. Nullam dictum justo quis tellus rutrum, at tincidunt libero iaculis. Nulla convallis eget nisl viverra hendrerit. Nulla imperdiet orci non suscipit elementum. Nunc a metus finibus arcu fermentum porttitor. Morbi semper porttitor cursus.";

// String length
var htmllength = html.length;

// Create an audio context
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();

// Create an empty three-second stereo buffer at the sample rate of the AudioContext
//const audiobuffer = audioCtx.createBuffer(2, audioCtx.sampleRate * 3, audioCtx.sampleRate);
const audiobuffer = audioCtx.createBuffer(2, htmllength, audioCtx.sampleRate);

// Map a number from one range to another
function map (number, inMin, inMax, outMin, outMax)
{
    return (number - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
}

// Fill the buffer with white noise;
// just random values between -1.0 and 1.0
for (var channel = 0; channel < audiobuffer.numberOfChannels; channel++)
{
    // This gives us the actual array that contains the data
    var nowBuffering = audiobuffer.getChannelData(channel);

    // Loop through the array
    for (var i = 0; i < audiobuffer.length; i++)
    {
        // Get each character
        var char = html.charAt(i);

        // Get the character's binary character code (0 - 256)
        var decimal = char.charCodeAt(0);

        // Map binary character code to PCM audio number
        var pcmnumber = map(decimal, 0, 256, -1, 1);

        // Add PCM audio to group of slots in audiobuffer 
        nowBuffering[i] = pcmnumber;
    }
}

// Get an AudioBufferSourceNode.
// This is the AudioNode to use when we want to play an AudioBuffer
var source = audioCtx.createBufferSource();

// set the buffer in the AudioBufferSourceNode
source.buffer = audiobuffer;

// Set volume
gainnode = audioCtx.createGain();
gainnode.gain.value = 1.0;

// Slow down the playback rate
source.playbackRate.value = 0.1;

// connect the AudioBufferSourceNode to the
// destination so we can hear the sound
source.connect(gainnode).connect(audioCtx.destination);

// start the source playing
//source.loop = true;
source.start(0);

手动生成音频文件

内心旳酸楚 2025-02-17 17:43:08

我认为您想更改

$teachername = implode(",",$teachername);
$submittedby = implode(",",$submittedby);
$item = implode(",",$item);
$description = implode(",",$description);
$quantity = implode(",",$quantity);
$vendor = implode(",",$vendor);
$notes = implode(",",$notes);

$count = 1;

$insertquery = "INSERT INTO orderinfo(teachername,submittedby,item,description,quantity,vendor,notes) VALUES('".$teachername."','".$submittedby."','".$item."','".$description."','".$quantity."','".$vendor."','".$notes."')";
mysqli_query($con,$insertquery);

$teachername = implode(",",$teachername);
$submittedby = implode(",",$submittedby);
$notes = implode(",",$notes);
for ($i = 0; $i <= count($item); $i++) {
    $curItem = $item[$i];
    $curDescription = $description[$i];
    $curQuantity = $quantity[$i];
    $curVendor = $vendor[$i];

    $insertquery = "INSERT INTO orderinfo(teachername,submittedby,item,description,quantity,vendor,notes) VALUES('".$teachername."','".$submittedby."','".$curItem."','".$curDescription."','".$curQuantity."','".$curVendor."','".$notes."')";
    mysqli_query($con,$insertquery);
}

,以便为每个$ item,您将新行插入数据库。

I think you want to change

$teachername = implode(",",$teachername);
$submittedby = implode(",",$submittedby);
$item = implode(",",$item);
$description = implode(",",$description);
$quantity = implode(",",$quantity);
$vendor = implode(",",$vendor);
$notes = implode(",",$notes);

$count = 1;

$insertquery = "INSERT INTO orderinfo(teachername,submittedby,item,description,quantity,vendor,notes) VALUES('".$teachername."','".$submittedby."','".$item."','".$description."','".$quantity."','".$vendor."','".$notes."')";
mysqli_query($con,$insertquery);

to

$teachername = implode(",",$teachername);
$submittedby = implode(",",$submittedby);
$notes = implode(",",$notes);
for ($i = 0; $i <= count($item); $i++) {
    $curItem = $item[$i];
    $curDescription = $description[$i];
    $curQuantity = $quantity[$i];
    $curVendor = $vendor[$i];

    $insertquery = "INSERT INTO orderinfo(teachername,submittedby,item,description,quantity,vendor,notes) VALUES('".$teachername."','".$submittedby."','".$curItem."','".$curDescription."','".$curQuantity."','".$curVendor."','".$notes."')";
    mysqli_query($con,$insertquery);
}

so that for each $item, you insert a new row into the database.

使弦不出现在同一行

内心旳酸楚 2025-02-17 16:20:04

您可以使用以下给出的内容,

>>> import pandas as pd
>>> import numpy as np
>>> 
>>> dictA = {'emp ID': [0, 1],'FirstName': ['Prasanna', 'Siva'],'LastName': ['K','B']
...          }
>>> 
>>> dictB = {'emp ID': [0, 1, 2],'FirstName': ['Prasanna', 'Siva', 'Karunas'],'LastName': ['K','B','Y']
...          }
>>> 
>>> 
>>> 
>>> 
>>> dfA = pd.DataFrame(dictA)
>>> dfB = pd.DataFrame(dictB)
>>> 
>>> 
>>> 
>>> dfA
   emp ID FirstName LastName
0       0  Prasanna        K
1       1      Siva        B
>>> dfB
   emp ID FirstName LastName
0       0  Prasanna        K
1       1      Siva        B
2       2   Karunas        Y
>>> 

# For checking whether there are some unique values of dataframe B which are not present in dataframe A
>>> dfB['present'] = dfB['emp ID'].isin(dfA['emp ID'])
>>> dfB
   emp ID FirstName LastName  present
0       0  Prasanna        K     True
1       1      Siva        B     True
2       2   Karunas        Y    False

# For checking whether there are unique values of dataframe A which are not present in dataframe B
>>> dfA['present'] = dfA['emp ID'].isin(dfB['emp ID'])
>>> dfA
   emp ID FirstName LastName  present
0       0  Prasanna        K     True
1       1      Siva        B     True

进行编辑

>>> import pandas as pd 
>>> import numpy as np
>>>  
... dictA = {'emp ID': [0, 1,2,3],'FirstName': ['Prasanna', 'Siva','Bala','foo'],'LastName': ['K','B','Y','Y_F']
... }
>>>  
... dictB = {'emp ID': [0, 1, 2],'FirstName': ['Prasanna', 'Siva', 'Karunas'],'LastName': ['K','B','Y']        }
>>>  
...  
...  
...  
... dfA = pd.DataFrame(dictA)
>>> dfB = pd.DataFrame(dictB)
>>>  
... 
>>> 
>>>  
... dfA
   emp ID FirstName LastName
0       0  Prasanna        K
1       1      Siva        B
2       2      Bala        Y
3       3       foo      Y_F
>>> 
>>> dfB
   emp ID FirstName LastName
0       0  Prasanna        K
1       1      Siva        B
2       2   Karunas        Y
>>> 
>>>  
... 
>>> # For checking whether there are some unique values of dataframe B which are not same in dataframe A (for all columns together)
... 
>>> dfB['same_all'] = dfB['emp ID'].isin(dfA['emp ID']) & dfB['FirstName'].isin(dfA['FirstName']) &  dfB['LastName'].isin(dfA['LastName'])
>>>  
... 
>>> dfB
   emp ID FirstName LastName  same_all
0       0  Prasanna        K      True
1       1      Siva        B      True
2       2   Karunas        Y     False
>>> 
>>> # Or for checking each column separately you can use something like for dataframe A
... dfB['same_emp_ID'] = dfB['emp ID'].isin(dfA['emp ID']) 
>>> 
>>> dfB['same_FirstName'] = dfB['FirstName'].isin(dfA['FirstName'])  
>>> 
>>> dfB['same_LastName'] = dfB['LastName'].isin(dfA['LastName'])
>>> 
>>> # For checking whether there are unique values of dataframe A which are not same in dataframe B (for all columns together)
... 
>>> dfA['same_all'] = dfA['emp ID'].isin(dfB['emp ID']) & dfA['FirstName'].isin(dfB['FirstName']) &  dfA['LastName'].isin(dfB['LastName'])
>>> 
>>> 
>>> dfA
   emp ID FirstName LastName  same_all
0       0  Prasanna        K      True
1       1      Siva        B      True
2       2      Bala        Y     False
3       3       foo      Y_F     False
>>> 
>>> 
>>> # Or for checking each column separately you can use something like for dataframe A
... dfA['same_emp_ID'] = dfA['emp ID'].isin(dfB['emp ID']) 
>>> 
>>> dfA['same_FirstName'] = dfA['FirstName'].isin(dfB['FirstName'])  
>>> 
>>> dfA['same_LastName'] = dfA['LastName'].isin(dfB['LastName'])
>>> 
>>> 
>>> dfA
   emp ID FirstName LastName  same_all  same_emp_ID  same_FirstName  same_LastName
0       0  Prasanna        K      True         True            True           True
1       1      Siva        B      True         True            True           True
2       2      Bala        Y     False         True           False           True
3       3       foo      Y_F     False        False           False          False
>>> 
>>> dfB
   emp ID FirstName LastName  same_all  same_emp_ID  same_FirstName  same_LastName
0       0  Prasanna        K      True         True            True           True
1       1      Siva        B      True         True            True           True
2       2   Karunas        Y     False         True           False           True
>>> 

按照从在这里

You can use something like the one given below,

>>> import pandas as pd
>>> import numpy as np
>>> 
>>> dictA = {'emp ID': [0, 1],'FirstName': ['Prasanna', 'Siva'],'LastName': ['K','B']
...          }
>>> 
>>> dictB = {'emp ID': [0, 1, 2],'FirstName': ['Prasanna', 'Siva', 'Karunas'],'LastName': ['K','B','Y']
...          }
>>> 
>>> 
>>> 
>>> 
>>> dfA = pd.DataFrame(dictA)
>>> dfB = pd.DataFrame(dictB)
>>> 
>>> 
>>> 
>>> dfA
   emp ID FirstName LastName
0       0  Prasanna        K
1       1      Siva        B
>>> dfB
   emp ID FirstName LastName
0       0  Prasanna        K
1       1      Siva        B
2       2   Karunas        Y
>>> 

# For checking whether there are some unique values of dataframe B which are not present in dataframe A
>>> dfB['present'] = dfB['emp ID'].isin(dfA['emp ID'])
>>> dfB
   emp ID FirstName LastName  present
0       0  Prasanna        K     True
1       1      Siva        B     True
2       2   Karunas        Y    False

# For checking whether there are unique values of dataframe A which are not present in dataframe B
>>> dfA['present'] = dfA['emp ID'].isin(dfB['emp ID'])
>>> dfA
   emp ID FirstName LastName  present
0       0  Prasanna        K     True
1       1      Siva        B     True

Edit as per the comment of the OP

>>> import pandas as pd 
>>> import numpy as np
>>>  
... dictA = {'emp ID': [0, 1,2,3],'FirstName': ['Prasanna', 'Siva','Bala','foo'],'LastName': ['K','B','Y','Y_F']
... }
>>>  
... dictB = {'emp ID': [0, 1, 2],'FirstName': ['Prasanna', 'Siva', 'Karunas'],'LastName': ['K','B','Y']        }
>>>  
...  
...  
...  
... dfA = pd.DataFrame(dictA)
>>> dfB = pd.DataFrame(dictB)
>>>  
... 
>>> 
>>>  
... dfA
   emp ID FirstName LastName
0       0  Prasanna        K
1       1      Siva        B
2       2      Bala        Y
3       3       foo      Y_F
>>> 
>>> dfB
   emp ID FirstName LastName
0       0  Prasanna        K
1       1      Siva        B
2       2   Karunas        Y
>>> 
>>>  
... 
>>> # For checking whether there are some unique values of dataframe B which are not same in dataframe A (for all columns together)
... 
>>> dfB['same_all'] = dfB['emp ID'].isin(dfA['emp ID']) & dfB['FirstName'].isin(dfA['FirstName']) &  dfB['LastName'].isin(dfA['LastName'])
>>>  
... 
>>> dfB
   emp ID FirstName LastName  same_all
0       0  Prasanna        K      True
1       1      Siva        B      True
2       2   Karunas        Y     False
>>> 
>>> # Or for checking each column separately you can use something like for dataframe A
... dfB['same_emp_ID'] = dfB['emp ID'].isin(dfA['emp ID']) 
>>> 
>>> dfB['same_FirstName'] = dfB['FirstName'].isin(dfA['FirstName'])  
>>> 
>>> dfB['same_LastName'] = dfB['LastName'].isin(dfA['LastName'])
>>> 
>>> # For checking whether there are unique values of dataframe A which are not same in dataframe B (for all columns together)
... 
>>> dfA['same_all'] = dfA['emp ID'].isin(dfB['emp ID']) & dfA['FirstName'].isin(dfB['FirstName']) &  dfA['LastName'].isin(dfB['LastName'])
>>> 
>>> 
>>> dfA
   emp ID FirstName LastName  same_all
0       0  Prasanna        K      True
1       1      Siva        B      True
2       2      Bala        Y     False
3       3       foo      Y_F     False
>>> 
>>> 
>>> # Or for checking each column separately you can use something like for dataframe A
... dfA['same_emp_ID'] = dfA['emp ID'].isin(dfB['emp ID']) 
>>> 
>>> dfA['same_FirstName'] = dfA['FirstName'].isin(dfB['FirstName'])  
>>> 
>>> dfA['same_LastName'] = dfA['LastName'].isin(dfB['LastName'])
>>> 
>>> 
>>> dfA
   emp ID FirstName LastName  same_all  same_emp_ID  same_FirstName  same_LastName
0       0  Prasanna        K      True         True            True           True
1       1      Siva        B      True         True            True           True
2       2      Bala        Y     False         True           False           True
3       3       foo      Y_F     False        False           False          False
>>> 
>>> dfB
   emp ID FirstName LastName  same_all  same_emp_ID  same_FirstName  same_LastName
0       0  Prasanna        K      True         True            True           True
1       1      Siva        B      True         True            True           True
2       2   Karunas        Y     False         True           False           True
>>> 

Taken from here

想要使用列值比较两个数据帧

内心旳酸楚 2025-02-17 11:34:12

下面的yaml应该起作用。

stages:
- stage: A
  jobs:
  - job: A
    displayName: SQL generate variable
    steps:
    - powershell: |
          $value = 'somevalue'
          echo "##vso[task.setvariable variable=sqloutput;isOutput=true]$value"
      name: setvarStep
    - script: echo $(setvarStep.sqloutput)
      name: echovar

  - job: B
    dependsOn: A
    displayName: Use variable that SQL script output as condition
    variables:
      myVarFromJobA: $[ dependencies.A.outputs['setvarStep.sqloutput'] ]  # map in the variable
      myvar: true    
    condition: eq(variables['myVarFromJobA'],'somevalue')
    steps:
    - script: echo $(myVarFromJobA)
      name: echovar

结果:

“

The below YAML should work.

stages:
- stage: A
  jobs:
  - job: A
    displayName: SQL generate variable
    steps:
    - powershell: |
          $value = 'somevalue'
          echo "##vso[task.setvariable variable=sqloutput;isOutput=true]$value"
      name: setvarStep
    - script: echo $(setvarStep.sqloutput)
      name: echovar

  - job: B
    dependsOn: A
    displayName: Use variable that SQL script output as condition
    variables:
      myVarFromJobA: $[ dependencies.A.outputs['setvarStep.sqloutput'] ]  # map in the variable
      myvar: true    
    condition: eq(variables['myVarFromJobA'],'somevalue')
    steps:
    - script: echo $(myVarFromJobA)
      name: echovar

Result:

enter image description here

Azure Devops YAML-动态条件评估

内心旳酸楚 2025-02-17 06:56:08

请尝试使用此(修改后的GGV2使用443端口)。另外,请确保您的角色和政策正确设置正确:

---
services:
  aws.greengrass.Nucleus:
    version: "2.5.6"
    configuration:
      mqtt:
        port: 443
      greengrassDataPlanePort: 443
  aws.greengrass.FleetProvisioningByClaim:
    configuration:
      rootPath: "greengrass/v2"
      awsRegion: "us-west-2"
      iotDataEndpoint: "<data-endpoint>-ats.iot.us-west-2.amazonaws.com"
      iotCredentialEndpoint: "<credentials-endpoint>.credentials.iot.us-west-2.amazonaws.com"
      iotRoleAlias: "GGProvisionTest_TokenExchange_RoleAlias"
      provisioningTemplate: "GGProvisionTest_Template"
      claimCertificatePath: "greengrass/v2/claim-certs/claim.pem.crt"
      claimCertificatePrivateKeyPath: "greengrass/v2/claim-certs/claim.private.pem.key"
      rootCaPath: "greengrass/v2/AmazonRootCA1.pem"
      templateParameters:
        ThingName: "<thingName>"
        ThingGroupName: "<thingGroup>"

Please try with this (modified GGv2 to use 443 port). Also, make sure your role and policy are setup correctly:

---
services:
  aws.greengrass.Nucleus:
    version: "2.5.6"
    configuration:
      mqtt:
        port: 443
      greengrassDataPlanePort: 443
  aws.greengrass.FleetProvisioningByClaim:
    configuration:
      rootPath: "greengrass/v2"
      awsRegion: "us-west-2"
      iotDataEndpoint: "<data-endpoint>-ats.iot.us-west-2.amazonaws.com"
      iotCredentialEndpoint: "<credentials-endpoint>.credentials.iot.us-west-2.amazonaws.com"
      iotRoleAlias: "GGProvisionTest_TokenExchange_RoleAlias"
      provisioningTemplate: "GGProvisionTest_Template"
      claimCertificatePath: "greengrass/v2/claim-certs/claim.pem.crt"
      claimCertificatePrivateKeyPath: "greengrass/v2/claim-certs/claim.private.pem.key"
      rootCaPath: "greengrass/v2/AmazonRootCA1.pem"
      templateParameters:
        ThingName: "<thingName>"
        ThingGroupName: "<thingGroup>"

绿草设备被注册为物联网,但在舰队供应后不作为绿草核心

内心旳酸楚 2025-02-17 01:27:21

我认为这个问题的快速解决方法可能是使用lodash的_。uniqby() method( https://lodash.com/docs/4.17.15#uniqby )。这将为您提供19个重新加载的19个显示,但至少可以确保您没有任何重复的项目。

我认为真正的解决方案是弄清楚为什么API返回第10个项目两次。在尝试从数据库中获取原始查询时,起始值似乎可能是不正确的。

使用Burp Suite并与代理拦截器一起玩,看起来查询最终看起来像这样的东西:/api/cratce?locale = en&amp; populate =*&amp;分页[start] = 10&amp;分页[limit] = 10&amp; sort [0] = date%3ADESC。我认为,如果您碰到分页[启动] 1,那应该实际上可以解决您的问题。至少对我做了。

I think a quick fix to this issue could be using something like lodash's _.uniqBy() method (https://lodash.com/docs/4.17.15#uniqBy). That will give you a total of 19 to display on the first reload, but it would at least ensure that you don't have any duplicate items.

I think the real fix is to figure out why the API is returning that 10th item twice; it seems like the starting value might be incorrect when trying to grab from the database for the original query.

Using burp suite and playing with the proxy interceptor, it looks like the query ends up looking something like this: /api/articles?locale=en&populate=*&pagination[start]=10&pagination[limit]=10&sort[0]=date%3Adesc. I think if you bump up the pagination[start] by 1, that should actually fix your problem. It did for me at least.

Next.js中的无限滚动使第一个获取的最后一个元素加倍

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

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