留蓝

文章 评论 浏览 28

留蓝 2025-02-20 21:38:53

您需要从表格中选择一个列。

从ID中的项目中选择SUM(量)(从TableName中选择COL1)

如果要获得匹配多个列的值,则内部选择应结合那些列。

从id中的项目中选择“ sum(量)

You need to select a column from the table.

SELECT Sum(amount) From items Where Id In (Select Col1 from TableName)

If you want to get values that match multiple columns, then the inner select should union those columns.

SELECT Sum(amount) From items Where Id In (Select Col1 from TableName Union Select Col2 from TableName)

如何获得与元组相似的数据?

留蓝 2025-02-20 10:30:31

如果要在查询上使用这些参数,
您应该使用Encodeuricomponent(),该eNCODEROMOMPONTINT()可以逃脱字符串,以便在查询中用作值。

const query = "attr1="  + value1 + 
    "&attr2=" + encodeURIComponent("va & lu&e2") + 
    "&attr3=" + value3

这将导致以下字符串:

"attr1=value1&attr2=va%20%26%20lu%26e2&attr3=value3" 

因此每个'&'被编码为“%26”

以拆分它,您现在可以依靠'&'符号:

const splitArray = query.split('&')

虽然,我将对每个查询参数值使用Encodeuricomponent()。除非我确切地知道我使用哪个值,并且不需要逃脱。

if you want to use these parameters on a query,
you should use encodeURIComponent() which will escape the string so it can be used as a value in a query.

const query = "attr1="  + value1 + 
    "&attr2=" + encodeURIComponent("va & lu&e2") + 
    "&attr3=" + value3

This will result in the following string:

"attr1=value1&attr2=va%20%26%20lu%26e2&attr3=value3" 

So every '&' is encoded as '%26'

To split it you can now rely on the '&' sign:

const splitArray = query.split('&')

Although, I would use the encodeURIComponent() for every query parameter value. unless I know exactly which value I use and that it doesn't need escaping.

将查询字符串按“但是,有些属性具有此“”。在值中

留蓝 2025-02-20 03:37:21

添加 row_axis = 0 col_axis = 1 channel_axis = 2 to apply_affine_transform()的参数。

您的图像的内存布局是“频道last”,但该功能认为它是“频道优先”。它(错误地)认为将图像列出为 [C,H,W] ,而不是 [H,W,C]

Add row_axis=0, col_axis=1, channel_axis=2 to apply_affine_transform()'s arguments.

Your image's memory layout is "channels-last", but the function thinks it is "channels-first". It (incorrectly) thinks the image laid out as [C,H,W], rather than [H,W,C].

如何将(keras/apply_affine_transform)放置起来? (theta)

留蓝 2025-02-19 14:17:34

问题在于,您试图将字典列表插入数据库中,而不是单独插入每个字典,然后使用更新语句插入以再次将它们放在一起。以下代码现在应该适合您。它使用与原始代码相同的结构,但一次插入每个词典,而不是一次尝试完成所有字典。

# Import required modules

import requests

import json

from bs4 import BeautifulSoup

# Get the data

url = 'https://opensky-network.org//api/flights/departure?airport=EDDF&begin=1517227200&end=1517230800'

content = requests.get(url).content

dataset = json.loads(content)

# Create connection

conn = sqlite3.connect("Flights")

# Insert the data

try:

cursor = conn.cursor()

cursor.execute('''create table flights(icao24 VARCHAR(50), firstSeen VARCHAR(50), estDepartureAirport VARCHAR(50), lastSeen VARCHAR(50), estArrivalAirport VARCHAR(50), callsign VARCHAR(50), estDepartureAirportHorizDistance VARCHAR(50), estDepartureAirportVertDistance VARCHAR(50), estArrivalAirportHorizDistance VARCHAR(50), estArrivalAirportVertDistance VARCHAR(50), departureAirportCandidatesCount VARCHAR(50), arrivalAirportCandidatesCount VARCHAR(50))''')

cursor.executemany('''insert into flights(icao24, firstSeen, estDepartureAirport, lastSeen, estArrivalAirport, callsign, estDepartureAirportHorizDistance, estDepartureAirportVertDistance, estArrivalAirportHorizDistance, estArrivalAirportVertDistance, 
departureAirportCandidatesCount, arrivalAirportCandidatesCount) values (?,?,?,?,?,?,?,?,?,?,?,?)''', (dataset,))

except Exception as E:

print('Error:', E)

else:

conn.commit()

print('Data inserted')

# Update the table to include the new information

try:

cursor = conn.cursor()

cursor.execute('''update flights set estDepartureAirport = ?, estDepartureAirportHorizDistance = ?, estDepartureAirportVertDistance = ?, estArrivalAirport = ?, estArrivalAirportHorizDistance = ?, estArrivalAirportVertDistance = ?, departureAirportCandidatesCount = ?, arrivalAirportCandidatesCount = ? where ICAO24 = ?''', (dataset.pop(0).get('estDepartureAirport'), dataset.pop(0).get('estDepartureAirportHorizDistance'), dataset.pop(0).get('estDepartureAirportVertDistance'), dataset.pop(0).get('estArrivalAirport'), dataset.pop(0).get('estArrivalAirportHorizDistance'), dataset.pop(0).get('estArrivalAirportVertDistance'), dataset.pop(0).get('departureAirportCandidatesCount'), dataset.pop(0).get('arrivalAirportCandidatesCount'), dataset.pop(0).get('ICAO24')))

except Exception as E:

print('Error:', E)

else:

conn.commit()

print('Data updated')

The problem was that you were trying to insert a list of dictionaries into your database instead of inserting each dictionary separately and then using an update statement after that to put them together again. The following code should work for you now. It uses the same structure as your original code but inserts each dictionary one at a time instead of trying to do it all in one go.

# Import required modules

import requests

import json

from bs4 import BeautifulSoup

# Get the data

url = 'https://opensky-network.org//api/flights/departure?airport=EDDF&begin=1517227200&end=1517230800'

content = requests.get(url).content

dataset = json.loads(content)

# Create connection

conn = sqlite3.connect("Flights")

# Insert the data

try:

cursor = conn.cursor()

cursor.execute('''create table flights(icao24 VARCHAR(50), firstSeen VARCHAR(50), estDepartureAirport VARCHAR(50), lastSeen VARCHAR(50), estArrivalAirport VARCHAR(50), callsign VARCHAR(50), estDepartureAirportHorizDistance VARCHAR(50), estDepartureAirportVertDistance VARCHAR(50), estArrivalAirportHorizDistance VARCHAR(50), estArrivalAirportVertDistance VARCHAR(50), departureAirportCandidatesCount VARCHAR(50), arrivalAirportCandidatesCount VARCHAR(50))''')

cursor.executemany('''insert into flights(icao24, firstSeen, estDepartureAirport, lastSeen, estArrivalAirport, callsign, estDepartureAirportHorizDistance, estDepartureAirportVertDistance, estArrivalAirportHorizDistance, estArrivalAirportVertDistance, 
departureAirportCandidatesCount, arrivalAirportCandidatesCount) values (?,?,?,?,?,?,?,?,?,?,?,?)''', (dataset,))

except Exception as E:

print('Error:', E)

else:

conn.commit()

print('Data inserted')

# Update the table to include the new information

try:

cursor = conn.cursor()

cursor.execute('''update flights set estDepartureAirport = ?, estDepartureAirportHorizDistance = ?, estDepartureAirportVertDistance = ?, estArrivalAirport = ?, estArrivalAirportHorizDistance = ?, estArrivalAirportVertDistance = ?, departureAirportCandidatesCount = ?, arrivalAirportCandidatesCount = ? where ICAO24 = ?''', (dataset.pop(0).get('estDepartureAirport'), dataset.pop(0).get('estDepartureAirportHorizDistance'), dataset.pop(0).get('estDepartureAirportVertDistance'), dataset.pop(0).get('estArrivalAirport'), dataset.pop(0).get('estArrivalAirportHorizDistance'), dataset.pop(0).get('estArrivalAirportVertDistance'), dataset.pop(0).get('departureAirportCandidatesCount'), dataset.pop(0).get('arrivalAirportCandidatesCount'), dataset.pop(0).get('ICAO24')))

except Exception as E:

print('Error:', E)

else:

conn.commit()

print('Data updated')

提供的绑定数量不正确-Error

留蓝 2025-02-19 09:07:35

只需从 scrollview 删除 list - 它本身就是可滚动的。

struct ContentView: View {
    var body: some View {
        List(notes){ note in
            NoteView(note: note)
                .padding(.bottom)
        }
    }
}

*问题的原因是该列表希望将父母的规模扩大,但是ScrollView没有自己的尺寸,并且期望需要滚动的大小,结果很明显 - 骑自行车冲突 - 不会崩溃/挂在骑自行车Swiftui断开布局 - 输出为空。

Just remove List from ScrollView - it is scrollable itself.

struct ContentView: View {
    var body: some View {
        List(notes){ note in
            NoteView(note: note)
                .padding(.bottom)
        }
    }
}

*the reason of the issue is that List wants to take parent size to expand, but ScrollView does not have own size and expects from content a size that needs to be scrolled, result is obvious - cycling conflict - to do not crash/hang in cycling SwiftUI breaks layout - output is empty.

可以通过foreach迭代阵列,但不能与列表一起

留蓝 2025-02-18 21:34:51

您在参数名称中有一个错别字: remote_bind_adress->远程_BIND_ADDRESS

You have a typo in the parameter name: remote_bind_adress -> remote_bind_address.

试图将Python与SSH隧道连接起来

留蓝 2025-02-18 13:14:36

将这2行更改为:

@app.route(“/”) @route(“/”)

quotesview.register(app)

QuotesView.register(app, route_base='/')

Change this 2 lines to:

@app.route("/") to @route("/")

QuotesView.register(app) to

QuotesView.register(app, route_base='/')

烧瓶分类给404个错误的应用程序

留蓝 2025-02-18 12:05:30

尝试使用 ts-node-esm index.ts 启动项目

Try to start your project with ts-node-esm index.ts

ts-node typeError [err_unknown_file_extension]:未知文件扩展名。

留蓝 2025-02-18 05:26:43

实际上使用的代码是:

const onViewableItemsChanged = useRef(({ viewableItems }) => {
    setCurrentPageIndex(viewableItems[0].index ?? 0);
}).current;

这应该使这种方法的意图更加清晰。回电传递给 useref 仅在组件安装时一次调用一次,并且返回的对象跨安装座稳定。但是,使用此代码,用 .current 立即提取对象内部的值。本质上,这是为此组件的给定安装座创建稳定实例变量

与例如:

const onViewableItemsChanged = ({ viewableItems }) => {
    setCurrentPageIndex(viewableItems[0].index ?? 0);
};

这与使用 useref 的方法非常相似,只是每次组件重新租赁时都会重新创建该函数。 没有陈旧的封闭来担心这里该函数为 setCurrentPageIndex setCurrentPageIndex 在整个渲染中都是稳定的。

重新创建功能是否仅与使用该函数的儿童组件有关。当您将新功能作为支撑传递给儿童组件时,设计经过精心设计的子组件将检测到这种变化,删除使用 old old 函数的任何功能,然后使用新功能重新启动功能。例如,如果子组件具有:

const Child = ({ fn }) => (
  <button onClick={fn}>click</button>
);

然后,每当父母更改传递的 fn prop时,孩子必须从按钮中删除上一个单击的侦听器(以前的 fn ),并添加一个新的侦听器(刚刚传递的新 fn )。

如果儿童组件与道具一起订阅了非dom事件,那么处理道具的更改可能为更困难处理。

因此,如果可能的话,希望通过稳定的道具传递稳定的道具 - 但是,如果儿童组件已经正确设计,那么几乎可以肯定的是,这两种方式都无关紧要。

请注意,创建实例变量的相同方法可以是:

const [onViewableItemsChanged] = useState(() => ({ viewableItems }) => {
    setCurrentPageIndex(viewableItems[0].index ?? 0);
});

它具有与以下方式相同的效果:

const onViewableItemsChanged = useRef(({ viewableItems }) => {
    setCurrentPageIndex(viewableItems[0].index ?? 0);
}).current;

因为参数中仅在组件安装时才发生的参数中的值。

The code that is used is actually:

const onViewableItemsChanged = useRef(({ viewableItems }) => {
    setCurrentPageIndex(viewableItems[0].index ?? 0);
}).current;

which should make the intent of this approach clearer. The callback passed to useRef is called only once, when the component mounts, and the object returned is stable across mounts. But with this code, the value inside the object is extracted immediately with the .current. Essentially, what this does is create a stable instance variable for a given mount of this component.

Compare with, for example:

const onViewableItemsChanged = ({ viewableItems }) => {
    setCurrentPageIndex(viewableItems[0].index ?? 0);
};

This is pretty similar to the approach with useRef, except that the function is created anew each time the component re-renders. There are no stale closures to worry about here, because the only outside variable referenced inside the function is setCurrentPageIndex, and setCurrentPageIndex is stable across renders.

Whether a function is re-created or not generally only matters in relation to child components that use the function. When you pass down a new function as a prop to a child component, a decently designed child component will detect that change, remove whatever functionality was using the old function, and reattach the functionality using the new function. For example, if the child component has:

const Child = ({ fn }) => (
  <button onClick={fn}>click</button>
);

Then whenever the fn prop passed down by the parent changes, the child must remove the previous click listener from the button (the previous fn), and add a new listener (the new fn that was just passed down).

If the child component subscribes to a non-DOM event with the prop, handling the changing of the prop could be more difficult to handle.

So, it could be desirable to pass down a stable prop if possible - but if the child components are already designed properly, it almost certainly won't matter either way.

Note that an identical approach to create an instance variable can be:

const [onViewableItemsChanged] = useState(() => ({ viewableItems }) => {
    setCurrentPageIndex(viewableItems[0].index ?? 0);
});

This has the same effect as:

const onViewableItemsChanged = useRef(({ viewableItems }) => {
    setCurrentPageIndex(viewableItems[0].index ?? 0);
}).current;

because the value in the argument that gets put into the state only occurs when the component mounts.

为什么我们需要将OnviewableItemschanged Prop放入React Native中的USEREF钩子内

留蓝 2025-02-18 03:13:17

其列: “在这里输入图像描述”

它的类似行292:123456789101112 [列]

Its column : enter image description here

its like line no 292 : 123456789101112 [Columns]

有人可以告诉我这个颤抖的错误是什么意思?

留蓝 2025-02-18 03:13:10

最明显的事情是将它们写成常规功能,然后在代码中删除所有,因为它们已经是相当纯净的函数:

  function MyComponent (props) {
    [data, setData] = useState(processData(characterData));
    [maxima, setMaxima] = useState(getMaxima(characterData));

    function getMaxima (data) {
      const groupedData = Object.keys(data[0]).reduce((memo, key) => {
        memo[key] = data.map((d) => d[key]);
        return memo;
      }, {});
      return Object.keys(groupedData).reduce((memo, key) => {
        memo[key] = Math.max(...groupedData[key]);
        return memo;
      }, {});
    }

    function processData (data) {
      const maxByGroup = getMaxima(data);
      const makeDataArray = (d) => {
        return Object.keys(d).map((key) => {
          return { x: key, y: d[key] / maxByGroup[key] };
        });
      };
      return data.map((datum) => makeDataArray(datum));
    }
  }

The most obvious thing to do is to just write them as regular functions and remove all the this in the code because they are already fairly pure functions:

  function MyComponent (props) {
    [data, setData] = useState(processData(characterData));
    [maxima, setMaxima] = useState(getMaxima(characterData));

    function getMaxima (data) {
      const groupedData = Object.keys(data[0]).reduce((memo, key) => {
        memo[key] = data.map((d) => d[key]);
        return memo;
      }, {});
      return Object.keys(groupedData).reduce((memo, key) => {
        memo[key] = Math.max(...groupedData[key]);
        return memo;
      }, {});
    }

    function processData (data) {
      const maxByGroup = getMaxima(data);
      const makeDataArray = (d) => {
        return Object.keys(d).map((key) => {
          return { x: key, y: d[key] / maxByGroup[key] };
        });
      };
      return data.map((datum) => makeDataArray(datum));
    }
  }

如何将React类组件中的方法转换为函数

留蓝 2025-02-17 20:13:26

您可以通过在每个帖子中添加标签名称作为类来过滤帖子。我希望这对你有帮助

        function filterPosts(tag) {
            const postsList = document.querySelectorAll('.tr-item');
            if (tag === 'all') {
                postsList.forEach(post => {
                    post.classList.remove('hidden');
                });
            } else {
                postsList.forEach(post => {
                    if (post.classList.contains(tag)) {
                        post.classList.remove('hidden');
                    } else {
                        post.classList.add('hidden');
                    }
                });
            }
        }
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .hidden {
            display: none;
        }
    </style>
</head>

<body>

    <div class="tr-nav">
        <a href="#" onclick="filterPosts('all')">
            <div class="tr-title ">All</div>
        </a>
        <a href="#" onclick="filterPosts('tag-1')">
            <div class="tr-title">Tag 1</div>
        </a>
        <a href="#" onclick="filterPosts('tag-2')">
            <div class="tr-title">Tag 2</div>
        </a>
        <a href="#" onclick="filterPosts('tag-3')">
            <div class="tr-title ">Tag 3</div>
        </a>
    </div>

    <div class="tr-wrap">
        <div class="tr-list">
            <div class="tr-item tag-3">
                <h5>Lorem ipsum dolor sit amet, consectetur</h5>
                <div class="tr-category">Tag 3</div>
            </div>
            <div class="tr-item tag-2">
                <h5>Lorem ipsum dolor sit amet, consectetur</h5>
                <div class="tr-category ">Tag 2</div>
            </div>
            <div class="tr-item tag-3">
                <h5>Lorem ipsum dolor sit amet, consectetur</h5>
                <div class="tr-category ">Tag 3</div>
            </div>
            <div class="tr-item  tag-1">
                <h5>Lorem ipsum dolor sit amet, consectetur</h5>
                <div class="tr-category">Tag 1</div>
            </div>
            <div class="tr-item tag-2">
                <h5>Lorem ipsum dolor sit amet, consectetur</h5>
                <div class="tr-category ">Tag 2</div>
            </div>
            <div class="tr-item tag-3">
                <h5>Lorem ipsum dolor sit amet, consectetur</h5>
                <div class="tr-category">Tag 3</div>
            </div>
        </div>
    </div>

</body>

</html>

You can filter your posts by adding the tag name as a class to each post. I hope this will help you

        function filterPosts(tag) {
            const postsList = document.querySelectorAll('.tr-item');
            if (tag === 'all') {
                postsList.forEach(post => {
                    post.classList.remove('hidden');
                });
            } else {
                postsList.forEach(post => {
                    if (post.classList.contains(tag)) {
                        post.classList.remove('hidden');
                    } else {
                        post.classList.add('hidden');
                    }
                });
            }
        }
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .hidden {
            display: none;
        }
    </style>
</head>

<body>

    <div class="tr-nav">
        <a href="#" onclick="filterPosts('all')">
            <div class="tr-title ">All</div>
        </a>
        <a href="#" onclick="filterPosts('tag-1')">
            <div class="tr-title">Tag 1</div>
        </a>
        <a href="#" onclick="filterPosts('tag-2')">
            <div class="tr-title">Tag 2</div>
        </a>
        <a href="#" onclick="filterPosts('tag-3')">
            <div class="tr-title ">Tag 3</div>
        </a>
    </div>

    <div class="tr-wrap">
        <div class="tr-list">
            <div class="tr-item tag-3">
                <h5>Lorem ipsum dolor sit amet, consectetur</h5>
                <div class="tr-category">Tag 3</div>
            </div>
            <div class="tr-item tag-2">
                <h5>Lorem ipsum dolor sit amet, consectetur</h5>
                <div class="tr-category ">Tag 2</div>
            </div>
            <div class="tr-item tag-3">
                <h5>Lorem ipsum dolor sit amet, consectetur</h5>
                <div class="tr-category ">Tag 3</div>
            </div>
            <div class="tr-item  tag-1">
                <h5>Lorem ipsum dolor sit amet, consectetur</h5>
                <div class="tr-category">Tag 1</div>
            </div>
            <div class="tr-item tag-2">
                <h5>Lorem ipsum dolor sit amet, consectetur</h5>
                <div class="tr-category ">Tag 2</div>
            </div>
            <div class="tr-item tag-3">
                <h5>Lorem ipsum dolor sit amet, consectetur</h5>
                <div class="tr-category">Tag 3</div>
            </div>
        </div>
    </div>

</body>

</html>

显示div如果项目包含与链接文本相同的文本

留蓝 2025-02-17 08:51:52

试图编译该片段会告诉您到底发生了什么:

$ clang++ -std=c++17 test.cc -o test.bin -Iv8/include
test.cc:18:30: error: no matching constructor for initialization of 'v8::ScriptOrigin'
    auto script_origin = new v8::ScriptOrigin(isolate, v8::String::NewFromUtf8(isolate, "main.mjs"));
                             ^                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./v8/include/v8-message.h:64:13: note: candidate constructor not viable: no known conversion from 'MaybeLocal<v8::String>' to 'Local<v8::Value>' for 2nd argument
  V8_INLINE ScriptOrigin(Isolate* isolate, Local<Value> resource_name,
            ^
./v8/include/v8-message.h:62:17: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
class V8_EXPORT ScriptOrigin {
                ^
./v8/include/v8-message.h:62:17: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
1 error generated.

特别注意摘要
没有“ Maybelocal&lt; v8 :: string&gt;'的已知转换到'local&lt; v8 :: value&gt;'对于第二个参数
您正在尝试调用不存在的构造函数。您的IDE和编译器在报告此报告时是正确的。

创建新字符串可能会失败,特别是当请求的字符串太大时,因此 newstringfromutf8 返回 maybelocal ,强迫调用代码检查错误并适当处理它们。如果字符串与“ main.mjs”一样缩错误,因此总的来说,最好使用 bool - 返回 .tolocal(...)并优雅地处理错误)。

因此,如果将最后一行更改为:

  auto script_origin = new v8::ScriptOrigin(
      isolate, 
      v8::String::NewFromUtf8(isolate, "main.mjs").ToLocalChecked());

,则该片段将编译。

插入与此无关, v8_inline 宏或 nm 的输出或符号导出或其他与链接器相关的问题也不是无关的。不用说编辑V8的标头文件也不需要嵌入V8。
通常,在使用C ++时,可以清楚地区分编译器错误和链接器错误是有意义的。当编译器抱怨时,研究可能的链接问题是“吠叫错误的树”。

Trying to compile this snippet tells you exactly what's going on:

$ clang++ -std=c++17 test.cc -o test.bin -Iv8/include
test.cc:18:30: error: no matching constructor for initialization of 'v8::ScriptOrigin'
    auto script_origin = new v8::ScriptOrigin(isolate, v8::String::NewFromUtf8(isolate, "main.mjs"));
                             ^                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./v8/include/v8-message.h:64:13: note: candidate constructor not viable: no known conversion from 'MaybeLocal<v8::String>' to 'Local<v8::Value>' for 2nd argument
  V8_INLINE ScriptOrigin(Isolate* isolate, Local<Value> resource_name,
            ^
./v8/include/v8-message.h:62:17: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
class V8_EXPORT ScriptOrigin {
                ^
./v8/include/v8-message.h:62:17: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
1 error generated.

Note in particular the snippet
no known conversion from 'MaybeLocal<v8::String>' to 'Local<v8::Value>' for 2nd argument.
You're trying to call a constructor that doesn't exist. Your IDE and the compiler are correct in reporting this.

Creating a new string can fail, in particular when the requested string is too large, so NewStringFromUtf8 returns a MaybeLocal, forcing calling code to check for errors and handle them appropriately. If the string is as short as "main.mjs", you can trust that allocating it won't fail, and simply use the .ToLocalChecked() conversion (which will crash your process if there was an error, so in general it's better to use the bool-returning .ToLocal(...) and handle errors gracefully).

So if you change the last line to:

  auto script_origin = new v8::ScriptOrigin(
      isolate, 
      v8::String::NewFromUtf8(isolate, "main.mjs").ToLocalChecked());

then this snippet will compile.

Inlining has nothing to do with this, neither does the V8_INLINE macro, or the output of nm, or symbol export or other linker-related issues. It should go without saying that editing V8's header files is also not necessary for embedding V8.
In general, when working with C++ it makes sense to distinguish clearly between compiler errors and linker errors. When the compiler is complaining, then looking into possible linking issues is "barking up the wrong tree".

V8 lib和c&#x2b;&#x2b;行为与期望和复制在单独的项目中不同

留蓝 2025-02-16 18:00:11

您是否尝试过安装您的道具,或者在调试时放断点?这对您有很大帮助!

无论如何,请尝试

<CalenderDate date ={array[0].date} />

小提示:请尝试避免使用键字作为变量名称,这很令人困惑,而且不可读取。我会说:从“阵列”切换到“ dateProp”或类似的东西。

小提示#2:始终牢记您使用的结构:
const array = [date:new Date(...)]一无所有。
我以为您想要一个数组,所以:

const myarray = []

然后,您想要其中一个或多个对象,因此:

const myarray = [{}]

每个对象都有一个键和一个值,所以:

const myarray = [{键:value,key2:value2,etc}]

是否需要更多的对象?然后去:

const myarray = [{key:value},{key2:value2},...,{keyn:valuen}]

Have you tried to console.log your props, or to put a breakpoint while debugging? This helps you a lot!

Anyway, try with

<CalenderDate date ={array[0].date} />

Little tip: please try to avoid using key-words as variable names, it's confusing and not really readable. I'd say: switch from 'array' to 'dateProp' or something similiar.

Little tip #2: always have in mind the structure you're using:
const array = [ date: new Date(...)] means nothing.
I supposed you wanted an array, so:

const myArray = []

then you wanted one or more objects inside it, so:

const myArray = [ { } ]

each object has a key and a value, so:

const myArray = [ { key: value, key2 : value2, etc } ]

want more objects inside? Then go:

const myArray = [ {key: value}, { key2: value2}, ..., { keyn : valuen} ]

可以作为道具传递的访问对象

留蓝 2025-02-16 10:43:59

You can set the list style:

我知道我知道某些领域会执行您提到的行为(如果在某个列表下显示按钮,则列表,如果列表,则)。但是我假设这与“自动”设置有关。请尝试设置使用建议的操作或您希望的任何格式,并查看是否有效。

You can set the list style:

https://github.com/microsoft/botbuilder-python/blob/31d0ffe2c079afe4c437e0de12dfbc2ef8c08964/libraries/botbuilder-dialogs/botbuilder/dialogs/choices/list_style.py

https://github.com/microsoft/botbuilder-python/blob/main/libraries/botbuilder-dialogs/botbuilder/dialogs/prompts/prompt_options.py

I know that there are some areas that will do the behavior you mentioned (show buttons if under a certain amount, a list if over). But I'm assuming that is related to the 'auto' setting. Please try setting to use Suggested Actions or whatever format you wish and see if that works.

为什么选择不显示为按钮?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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