や三分注定

文章 评论 浏览 27

や三分注定 2025-02-21 00:47:07

我认为这是对应用的修饰符的位置。

以下工作(用Xcode 13.4/ios 15.5进行测试)

“

struct SecondNavView: View {
    let item: String

    var body: some View {
        ZStack {
            Color.red
            Text(item)
        }
        .navigationBarTitleDisplayMode(.inline)  // << here !!
    }
}

I assume it is do to place of applied modifiers.

The following works (tested with Xcode 13.4 / iOS 15.5)

demo

struct SecondNavView: View {
    let item: String

    var body: some View {
        ZStack {
            Color.red
            Text(item)
        }
        .navigationBarTitleDisplayMode(.inline)  // << here !!
    }
}

Swiftui NavigationView:删除空格时保持返回按钮

や三分注定 2025-02-20 18:47:52

我想要一种无需每次编写身体而在不编写身体的情况下实现功能的方法

您无法定义一个函数/过程,该功能/过程引用SQL存储的函数/过程。如果您声明功能或过程,则必须包括签名和身体。

来自

create_function :: =

plsql_function_source :: =

src = “ 代码>身体是必需的。

对于呼叫规范,您可以引用一个函数,但它将是外部Java方法或C函数,而不是 SQL中定义的另一个函数。

I want a way to implement a functions without writing the body everytime but only by writing in the spec that the function is using my package.

You cannot define a function/procedure that references an SQL stored function/procedure like that. If you declare a function or procedure then it must include the signature and the body.

From the documentation:

create_function::=

Create function syntax diagram

plsql_function_source ::=

PL/SQL function source syntax

For a standalone function the body is required.

For a call specification, you can reference a function but it will be an external Java method or a C function and NOT another function defined in SQL.

如何定义自己在使对象可用于这些函数的功能时必须使用功能(在规格末尾使用我的对象)?

や三分注定 2025-02-20 12:02:09

这与 OpenPyXl 的3.1.0版本一起使用。您可以通过 pip 下载

python -m pip install https://foss.heptapod.net/openpyxl/openpyxl/-/archive/branch/3.1/openpyxl-branch-3.1.zip

并分配类似的属性,以便


from openpyxl.packaging.custom import (
    BoolProperty,
    DateTimeProperty,
    FloatProperty,
    IntProperty,
    LinkProperty,
    StringProperty,
    CustomPropertyList,
)



props = CustomPropertyList()
props.append(StringProperty(name='hello world', value='foo bar'))
wb.custom_doc_props = props
wb.save(...)

在SharePoint上保留数据。更多信息在这里: https://foss.heptapod.net/openpyxl/openpyxl/-/blob/branch/3.1/doc/workbook/workbook_custom_doc_props.rst

This works with version 3.1.0 of openpyxl. You can download via pip with

python -m pip install https://foss.heptapod.net/openpyxl/openpyxl/-/archive/branch/3.1/openpyxl-branch-3.1.zip

and assign properties like so


from openpyxl.packaging.custom import (
    BoolProperty,
    DateTimeProperty,
    FloatProperty,
    IntProperty,
    LinkProperty,
    StringProperty,
    CustomPropertyList,
)



props = CustomPropertyList()
props.append(StringProperty(name='hello world', value='foo bar'))
wb.custom_doc_props = props
wb.save(...)

Data is preserved on SharePoint. More info here: https://foss.heptapod.net/openpyxl/openpyxl/-/blob/branch/3.1/doc/workbook_custom_doc_props.rst

使用OpenPyXL添加自定义属性

や三分注定 2025-02-20 03:02:17
 &lt; ifmodule mod_rewrite.c&gt;
重新创新
重写。*  -  [e = http_authorization:%{http:授权}]
rewriteBase /〜用户名 /
重写 ^index \ .php $  -  [l]
重新WritriteCond%{request_filename}!-f
rewriteCond%{request_filename}!-d
重写。 /~username/index.php [l]
&lt;/ifmodule&gt;
 

看起来您正在使用 apache pache per-user per-user web目录?如果是这种情况,则/〜用户名不是物理目录(对您的用户目录的“别名”),并且您的文档root有效/〜用户名/(哪个真的与根层的URL路径混在一起)。

在这种情况下,您的 .htaccess 应该是这样的:

RewriteEngine On

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

请注意,我已经完全删除了 rewriteBase 完全指令。

但是,如果这是WordPress代码块的一部分(即内部#begin wordpress ... #end wordpress )注释标记,那么WordPress将尝试覆盖您的更改,除非您采取其他步骤来防止这种情况。

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /~username/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~username/index.php [L]
</IfModule>

It looks like you are using Apache per-user web directories? If that's the case then /~username is not a physical directory (it's an "alias" to your user directory) and your document root is effectively /~username/ (which really messes with root-relative URL-paths).

In which case, your .htaccess should be like this instead:

RewriteEngine On

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

Note that I've removed the RewriteBase directive altogether.

However, if this is part of the WordPress code block (ie. inside # BEGIN WordPress ... # END WordPress) comment markers then WordPress is going to try and overwrite your changes unless you take additional steps to prevent this.

Synology个人网站HTACCESS导致403个错误

や三分注定 2025-02-20 01:00:00

我在MSDN论坛上发布了同样的问题,并得到了这个答案:
https://learn.microsoft.com/en-us/aswers/questions/questions/questions/915789/uiautomation-throws-throws-throws-accessviolationexpection-on-wi.html

使用iuiAutomation ins in iuiAutomation ins in note system.windows.windows.windows.automatimation.automatomation.automatomation.automatommation.automatommationmotoge 11。

所以我将其标记为已解决的问题,但是如果有人有另一个想法或知道会发生什么情况发表评论!

I posted the same question on MSDN forums and got this answer:
https://learn.microsoft.com/en-us/answers/questions/915789/uiautomation-throws-accessviolationexception-on-wi.html

Using IUIautomation instead of System.Windows.Automation works on Windows 11.

So I'm marking this as solved but if anyone has another idea or knows what happens you're welcome to comment!

uiautomation在Windows 11上抛出了AccessViolationException

や三分注定 2025-02-20 00:03:07

在您的第一个示例中,您要这样做:

sprintf(str,"%.1fV",u0);

这意味着 u0 float 。如果不是,那么这是UB(未定义的行为)

,但在您的第二个示例中, u0 char u0; 您正在将浮点值截断为> char 。小部分将丢失。

然后,您招募它并发送。

而且,您有点“作弊”:

  1. 您正在发送 char ,但是接收 queue_t
  2. 队列用 msg_size sizef(uint8_t)而不是 size> sizef(queue_t)

这很slo脚,但它的工作率很慢。这不是很容易扩展。如果 queue_t struct已扩展并需要发送多个值,它将断开。我们需要在下面解决该问题。

收件人 startlcdtask 确实:

sprintf(str, "%.0fV", (double) msg.Buf);

两个 sprintf 不是等效的。


现在,您已经拥有两个任务,您可以选择哪个任务/函数可以进行原始ADC值的计算/转换(即 uint32_t )。无论哪种情况,我们都需要更改 queue_t 来处理该值。

这是一个引起原始值并具有显示任务的版本进行转换。

/* Definitions for UARTQueue*/
osMessageQueueId_t UARTQueueHandle;

typedef struct {
    uint32_t adcraw;
} QUEUE_t;

/* creation of UARTQueue*/
void
init_queue(void)
{
    UARTQueueHandle = osMessageQueueNew(8, sizeof(QUEUE_t),
        &UARTQueue_attributes);
}

void
StartADC(void *argument)
{
    QUEUE_t msg;

    for (;;) {
        HAL_ADCEx_InjectedStart(&hadc1);
        HAL_ADC_PollForConversion(&hadc1, 100);

        msg.adcraw = HAL_ADCEx_InjectedGetValue(&hadc1, ADC_INJECTED_RANK_1);

        osMessageQueuePut(UARTQueueHandle, &msg, 0, osWaitForever);

        HAL_ADCEx_InjectedStop(&hadc1);

        osDelay(200);
    }
}

void
StartLCDTask(void *argument)
{
    QUEUE_t msg;
    float_t u0;
    char str[20];

    for (;;) {
        osMessageQueueGet(UARTQueueHandle, &msg, 0, osWaitForever);

        u0 = msg.adcraw;
        u0 = 180 - (180 * (3 - u0 * 3 / 4096));

        sprintf(str, "%.0fV", u0);

        LCD_SetPos(0, 0);
        LCD_String(str);
    }
}

更新:

尽管我以前注意到了这一点,但我没有意识到可能的影响。

在单个任务代码中,格式是:

"%.1fV"

但是,这是多个任务代码的更改:

"%.0fV"

我怀疑这是错别字。我认为格式在两种情况下都应相同。

In your first example, you do:

sprintf(str,"%.1fV",u0);

This implies u0 is float. If it's not, then this is UB (undefined behavior)

But, in your second example, u0 is char u0; You are truncating a floating point value to a char. The fractional part will be lost.

Then, you enqueue it and send it.

And, you're "cheating" a bit:

  1. You're sending a char but receiving a QUEUE_t.
  2. The queue is initialized with a msg_size of sizeof(uint8_t) instead of sizeof(QUEUE_t)

This "happens" to work but it's sloppy. It's not very extensible. It would break if the QUEUE_t struct was extended and needed multiple values to be sent. We'll need to fix that below.

The recipient StartLCDTask does:

sprintf(str, "%.0fV", (double) msg.Buf);

The two sprintf are not equivalent.


Now that you have two tasks you have the choice of which task/function does the calculation/conversion of the raw ADC value (which is a uint32_t). In either case, we'll need to change QUEUE_t to handle the value.

Here is a version that enqueues the raw value and has the display task do the conversion.

/* Definitions for UARTQueue*/
osMessageQueueId_t UARTQueueHandle;

typedef struct {
    uint32_t adcraw;
} QUEUE_t;

/* creation of UARTQueue*/
void
init_queue(void)
{
    UARTQueueHandle = osMessageQueueNew(8, sizeof(QUEUE_t),
        &UARTQueue_attributes);
}

void
StartADC(void *argument)
{
    QUEUE_t msg;

    for (;;) {
        HAL_ADCEx_InjectedStart(&hadc1);
        HAL_ADC_PollForConversion(&hadc1, 100);

        msg.adcraw = HAL_ADCEx_InjectedGetValue(&hadc1, ADC_INJECTED_RANK_1);

        osMessageQueuePut(UARTQueueHandle, &msg, 0, osWaitForever);

        HAL_ADCEx_InjectedStop(&hadc1);

        osDelay(200);
    }
}

void
StartLCDTask(void *argument)
{
    QUEUE_t msg;
    float_t u0;
    char str[20];

    for (;;) {
        osMessageQueueGet(UARTQueueHandle, &msg, 0, osWaitForever);

        u0 = msg.adcraw;
        u0 = 180 - (180 * (3 - u0 * 3 / 4096));

        sprintf(str, "%.0fV", u0);

        LCD_SetPos(0, 0);
        LCD_String(str);
    }
}

UPDATE:

Although I noted this before, I didn't realize the possible impact.

In the single task code, the format is:

"%.1fV"

But, this got changed for the multiple task code:

"%.0fV"

I suspect that this is a typo. I think the format should be the same in both cases.

在队列弗雷托斯中传递变量

や三分注定 2025-02-19 19:11:33

问题1 :控制台打印两次

是因为使用exect 18的使用效率两次 - 请检查Chrome Dev工具上的“网络”选项卡以验证是否发送了两次请求。

您可以使用If/else语句,如果数据已经获取,则不要再次调用API。

Quality-2 :不显示列表

,因为您缺少映射功能中的返回语句。

<ul>
        {News.map((data) => {
         return <li key={data.title}>{data.title}</li>;
        })}
</ul>

希望这有帮助!

Problem-1 : Console is Printing Twice

That's because the useEffect ran twice if you are using React 18 - Please check the Network Tab on Chrome Dev Tools to verify if the request is sent twice.

You can use if/else statement, if the data is already fetched then don't call API again.

Problem-2 : Not Displaying List

That's becuase you are missing the return statement in the MAP function.

<ul>
        {News.map((data) => {
         return <li key={data.title}>{data.title}</li>;
        })}
</ul>

Hope this helps!

从React中打印来自Array的对象?

や三分注定 2025-02-19 00:24:32

如果需要 a的连续值组,则D 列使用 dataframe.shift ed dureats comapre for for dataframe.ne with dataframe.yany seriper ,然后通过

g = df[['A','D']].ne(df[['A','D']].shift()).any(1).cumsum()
a = {'A':'first','B':'first','C':'last','D':'first'}
df = df.groupby(g).agg(a)
print (df)
       A           B           C        D
1  04547  2022-07-04  2022-08-08  1000000
2  04547  2022-10-11  2022-10-18  0100000
3  04547  2022-10-24  2022-10-24  1000000
4  04547  2022-11-01  2022-11-08  0100000
5  04548  2022-10-11  2022-10-18  0100000
6  04548  2022-10-24  2022-10-24  1000000
7  04548  2022-11-01  2022-11-08  0100000

If need groups by consecutive values of A,D columns use DataFrame.shifted values comapre for not equal by DataFrame.ne with DataFrame.any for Series and then add cumualtive sum by Series.cumsum:

g = df[['A','D']].ne(df[['A','D']].shift()).any(1).cumsum()
a = {'A':'first','B':'first','C':'last','D':'first'}
df = df.groupby(g).agg(a)
print (df)
       A           B           C        D
1  04547  2022-07-04  2022-08-08  1000000
2  04547  2022-10-11  2022-10-18  0100000
3  04547  2022-10-24  2022-10-24  1000000
4  04547  2022-11-01  2022-11-08  0100000
5  04548  2022-10-11  2022-10-18  0100000
6  04548  2022-10-24  2022-10-24  1000000
7  04548  2022-11-01  2022-11-08  0100000

python pandas的独立集团

や三分注定 2025-02-18 08:33:17

您是在GET请求正文中发送 url 参数,而HTTP协议不允许。获得请求没有身体。而是将其作为URL参数发送:

Object.keys(this.items).forEach(key => {
      let value = this.items[key];
      let checkUrl = value.url + this.usersearch;
      let query = new URLSearchParams({
        url: checkUrl
      });
      fetch('/api/checkurl?' + query, {
            method: 'GET',
            mode:'cors',
            cache:'default'
     });
});

另外,请确保为GET请求配置您的后端路由。

You are sending the url param in the body of a GET request, which is not allowed by the HTTP protocol. GET requests don’t have a body. Send it as an URL param instead:

Object.keys(this.items).forEach(key => {
      let value = this.items[key];
      let checkUrl = value.url + this.usersearch;
      let query = new URLSearchParams({
        url: checkUrl
      });
      fetch('/api/checkurl?' + query, {
            method: 'GET',
            mode:'cors',
            cache:'default'
     });
});

Also, make sure your backend route is configured for GET requests.

如何处理“使用get/head方法”的“请求”不能遇到身体问题。在vuejs?

や三分注定 2025-02-18 05:30:24

更改为 Atoms 始终没有种族条件。新的效果不是。

Changes to atoms are always free of race conditions. New-def-ing is not.

使用重置有什么区别!以及一个新的DEF,以更改与原子相关的变量的值?

や三分注定 2025-02-18 04:39:39

该错误可能更清楚,但是它试图将整个字符串作为可执行文件运行,而该字符串不存在(因此没有访问权限的访问)

来向可执行创建一个列表。

subprocess.Popen([
    r'C:\Users\Computador\AppData\Local\Programs\Microsoft VS Code\Code.exe',
    r'C:\Users\Computador\Desktop\Python'
])

The error could be more clear, but it is trying to run the whole string as an executable, which doesn't exist (therefore there is no access to it)

To provide arguments to an executable, it's best to create a list.

subprocess.Popen([
    r'C:\Users\Computador\AppData\Local\Programs\Microsoft VS Code\Code.exe',
    r'C:\Users\Computador\Desktop\Python'
])

如果代码执行中发生错误

や三分注定 2025-02-18 04:00:22

Docker / Podman容器IP无法从外部客户端访问。
您需要将TCP或UDP端口从容器中曝光到主机系统,然后客户将连接到:。

主机端口和容器端口不需要是同一端口。
即,您可以使用端口80运行多个Web服务器容器,但是您需要在主机OS上选择其他服务不使用的主机端口来端口映射到容器中。即80-&gt; 80,81-&gt; 80,8080-&gt; 80等。

一旦您在容器配置中创建端口定义后,Podman将处理从主机转发到容器的端口。

您可能需要打开主机防火墙上的端口,以允许客户连接。 0.0.0.0是代表本地主机的另一种方式。

假设您的主机为10.1.1.20,您的OpenSearch仪表板容器为172.16.8.4,您的仪表板Web应用程序配置为在端口5001/TCP上收听。

您将需要docker-compose.yml文件中的端口指令才能将主机端口5001映射到类似于下面的容器端口5001。

容器:
OpenSearch-dashboard:
端口:
- “ 5001:5001”,

只要您的主机防火墙上允许端口5001,客户应该能够使用

Docker / Podman container IPs are not accessible from external clients.
You need to expose TCP or UDP ports from your container to the host system and then clients will connect to :.

The host port and the container port do not need to be the same port.
i.e. you can run multiple web server containers all using port 80 however you will need to pick unique ports on your host OS that are not used by other services to port-map to the containers. i.e 80->80, 81->80, 8080->80 etc.

Once you create the port definitions in your container configuration Podman will handle the port forwarding from the host to the container.

You might need to open the ports on the host firewall to allow clients to connect. 0.0.0.0 is another way of representing the local host.

Let say your host is 10.1.1.20 and your OpenSearch Dashboards container is 172.16.8.4 and your dashboard web app is configured to listen on port 5001/TCP.

You will need a ports directive in your docker-compose.yml file to map the host port 5001 to the container port 5001 similar to the below.

containers:
opensearch-dashboard:
ports:
- "5001:5001"

As long as port 5001 is permitted on your host firewall, the client should be able to connect using https://10.1.1.20:5001/

podman的OpenSearch仪表板得出错误的IP

や三分注定 2025-02-18 03:59:23

这取决于问题。

通常,插入,更新或删除的数据具有一些国王,您可以使用虚拟数据库复制,每个表中只有一两个行,您尝试重现错误。

如果您具有良好的错误记录功能,则可以保存在文本文件或sqlite中所有相关信息,例如出现问题的位置和原因。这将为您节省很多麻烦。

如果您需要数据库:

您还原备份并将所有敏感数据替换为更新命令,并在传递数据之前查看是否仍然发生错误。

为此,您可以提前编写这些更新命令。

一些数据库还可以加密列或混淆它们,因此您应该看到数据库支持它,并且可以在还原的数据上使用它。

that depends on the problem.

Usually the inserted, updated or deleted data have some kings that you can reproduce with a dummy database, with only one or two rows in each table and you have try to reproduce the error.

If you have good error logging feature, that saves in an text file or sqlite all relevant information like where the problem occurred and what was the cause. it will save you a lot of trouble.

If you need the database:

you restore the backup and replace all sensitive data with an UPDATE command and see if the error still occurs, before you pass the data on .

For that you can in advance write those update commands.

Some databases can encrypt also columns or obfuscate them, so you should see of your databse supports that and you can use it on the restored data.

在数据库上处理客户信息

や三分注定 2025-02-17 16:05:02

YouTube的解决方案是不可能的 - 它们故意不包括任何重定向能力,最有可能出于安全目的。能够在订阅后有条件地重定向是一个很小但非常强大的特权。


但是,如何在新标签中打开您的频道,而不是试图重定向?设计一个外观相似的“订阅”按钮,然后将其链接到您的频道。按下后,您可以在5-10秒后通过编程方式将原始页面(在您的网站上)重定向到您想要的任何页面。

用户回到您的页面后,您打算为他们准备的任何内容都可以在那里。

这不是完美无瑕的,需要精力,但是当您想在自己的网站上做某事时,YouTube的选择受到限制。

如果您想确保仅订阅用户可以看到此页面,则可以考虑使用YouTube的API检查您的频道是否在其订阅列表中。请参阅此处有关更多信息。

This will not be possible with YouTube's solution - they intentionally do not include any redirection abilities, most likely for security purposes. Being able to conditionally redirect users after they subscribe is a small but extremely powerful privilege.


However, instead of trying to redirect after they subscribe, how about opening your channel in a new tab? Design a similar-looking 'Subscribe' button and link it to your channel. After being pressed, you could then, after 5-10 seconds, programmatically redirect the original page (on your site) to move to whatever page you wanted.

Once the user comes back to your page, whatever content you intended for them could be there.

It's not flawless and requires effort, but options with YouTube are limited when you want to do something on your own website.

If you're trying to make sure only subscribed users see this page, you could look into using YouTube's APIs for checking whether your channel is on their list of subscriptions. See here for more information.

如何创建一个可嵌入的YouTube订阅按钮,该按钮在某人订阅后重定向?

や三分注定 2025-02-17 11:04:34

假设您希望列以该顺序为1,3和2,并且可以无限期地重复,则可以使用MAP中的索引,并使用剩余器计算出适当的列号。像这样:

<div className="relative grid grid-cols-3">
  {projects.map((project, i) => (
        <div
          className={`col-start-${i % 3 === 0 ? 1 : (i % 3 === 1 ? 3 : 2)}`}
          key={project.data.title}
        >
          <ProjectThumbnail />
        </div>
      ))}
</div>

Assuming you want the column to be 1,3 and 2, in that order, and repeating indefinitely, then you could use the index from map, and calculate the proper column number from that using remainders. Like this:

<div className="relative grid grid-cols-3">
  {projects.map((project, i) => (
        <div
          className={`col-start-${i % 3 === 0 ? 1 : (i % 3 === 1 ? 3 : 2)}`}
          key={project.data.title}
        >
          <ProjectThumbnail />
        </div>
      ))}
</div>

如何用图案独特的价值映射

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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