绮筵

文章 评论 浏览 30

绮筵 2025-02-02 13:50:16

您是否在Heroku运行了迁移?如果不是这样,您可以这样做:
Heroku Run Rake DB:迁移-App = your_app_name

Did you run the migrations in heroku? if not then you can do it like this:
heroku run rake db:migrate --app=your_app_name

PG :: UndefinedTable:错误:关系“条目”不存在

绮筵 2025-02-02 11:28:57

仅通过从 nvidia-smi 命令中查看您的SS,似乎您的GPU似乎并未用于此模型培训。因此,您可能想研究它,并在模型培训期间开始使用GPU进行计算。

Just by looking at your SS from nvidia-smi command, it seems like your GPU is not being used for this model training. So, you might wanna look into it and start using your GPU for computation during model training.

`resource exhaustedError:图形执行错误“尝试使用model.fit()训练TensorFlow模型时

绮筵 2025-02-02 02:09:37

我为您制作了一个模板,希望它有帮助

                <!DOCTYPE html>
                <html lang="en">
                <head>
                <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
                <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>
                </head>
                
                <body>
                <div class="container">
                <div class="row row-cols-2 row-cols-lg-6 g-2 g-lg-3">
                <div class="col">
                <div class="p-md-2 ">
                    <img src="https://cdn.shopify.com/s/files/1/0130/1797/2795/files/podcast_063b8574-56e0-4fa2-a9a9-c85f701754f3.png?v=1651638533" alt="podcast"    width="75%;" >
                
                </div>
                </div>
                <div class="col">
                <div class="p-2 ">use the name</div>
                </div>
                <div class="p-md-2 ">
                <img src="https://cdn.shopify.com/s/files/1/0130/1797/2795/files/podcast_063b8574-56e0-4fa2-a9a9-c85f701754f3.png?v=1651638533" alt="podcast"    width="75%;" >
                
                </div>
                <div class="col">
                <div class="p-2 ">use the name</div>
                </div>
                <div class="p-md-2 ">
                <img src="https://cdn.shopify.com/s/files/1/0130/1797/2795/files/podcast_063b8574-56e0-4fa2-a9a9-c85f701754f3.png?v=1651638533" alt="podcast"    width="75%;" >
                
                </div>
                <div class="col">
                <div class="p-2 ">use the name</div>
                </div>
                <div class="p-md-2 ">
                <img src="https://cdn.shopify.com/s/files/1/0130/1797/2795/files/podcast_063b8574-56e0-4fa2-a9a9-c85f701754f3.png?v=1651638533" alt="podcast"    width="75%;" >
                
                </div>
                <div class="col">
                <div class="p-2 ">use the name</div>
                </div>
                <div class="p-md-2 ">
                <img src="https://cdn.shopify.com/s/files/1/0130/1797/2795/files/podcast_063b8574-56e0-4fa2-a9a9-c85f701754f3.png?v=1651638533" alt="podcast"    width="75%;" >
                
                </div>
                <div class="col">
                <div class="p-2 ">use the name</div>
                </div>
                </div>
                </div>
                
                </body>
                </html>

ive have made a template for you hope it helps

                <!DOCTYPE html>
                <html lang="en">
                <head>
                <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
                <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>
                </head>
                
                <body>
                <div class="container">
                <div class="row row-cols-2 row-cols-lg-6 g-2 g-lg-3">
                <div class="col">
                <div class="p-md-2 ">
                    <img src="https://cdn.shopify.com/s/files/1/0130/1797/2795/files/podcast_063b8574-56e0-4fa2-a9a9-c85f701754f3.png?v=1651638533" alt="podcast"    width="75%;" >
                
                </div>
                </div>
                <div class="col">
                <div class="p-2 ">use the name</div>
                </div>
                <div class="p-md-2 ">
                <img src="https://cdn.shopify.com/s/files/1/0130/1797/2795/files/podcast_063b8574-56e0-4fa2-a9a9-c85f701754f3.png?v=1651638533" alt="podcast"    width="75%;" >
                
                </div>
                <div class="col">
                <div class="p-2 ">use the name</div>
                </div>
                <div class="p-md-2 ">
                <img src="https://cdn.shopify.com/s/files/1/0130/1797/2795/files/podcast_063b8574-56e0-4fa2-a9a9-c85f701754f3.png?v=1651638533" alt="podcast"    width="75%;" >
                
                </div>
                <div class="col">
                <div class="p-2 ">use the name</div>
                </div>
                <div class="p-md-2 ">
                <img src="https://cdn.shopify.com/s/files/1/0130/1797/2795/files/podcast_063b8574-56e0-4fa2-a9a9-c85f701754f3.png?v=1651638533" alt="podcast"    width="75%;" >
                
                </div>
                <div class="col">
                <div class="p-2 ">use the name</div>
                </div>
                <div class="p-md-2 ">
                <img src="https://cdn.shopify.com/s/files/1/0130/1797/2795/files/podcast_063b8574-56e0-4fa2-a9a9-c85f701754f3.png?v=1651638533" alt="podcast"    width="75%;" >
                
                </div>
                <div class="col">
                <div class="p-2 ">use the name</div>
                </div>
                </div>
                </div>
                
                </body>
                </html>

如何以网格格式并排显示响应式图像和文本

绮筵 2025-02-01 23:43:26

使用链接器来帮助诊断错误,

大多数现代链接器都包含一个详细的选项,该选项在不同程度上打印出来;

  • 链接调用(命令行),
  • 链接阶段中包含哪些库的数据,
  • 库的位置,
  • 所使用的搜索路径。

对于GCC和Clang;您通常会在命令行中添加 -v -wl, - derbose -v -wl,-v 。可以在此处找到更多细节;

对于MSVC,/verbose (特别是/verbose:lib )被添加到链接命令行。

Use the linker to help diagnose the error

Most modern linkers include a verbose option that prints out to varying degrees;

  • Link invocation (command line),
  • Data on what libraries are included in the link stage,
  • The location of the libraries,
  • Search paths used.

For gcc and clang; you would typically add -v -Wl,--verbose or -v -Wl,-v to the command line. More details can be found here;

For MSVC, /VERBOSE (in particular /VERBOSE:LIB) is added to the link command line.

什么是未定义的参考/未解决的外部符号错误,我该如何修复?

绮筵 2025-02-01 18:36:13

这样的事情非常好,因为所有的获取都将等待

<script setup>
const { data } = await useFetch('https://jsonplaceholder.typicode.com/todos/1')
console.log('data', data.value.userId)
const { data: photos } = await useFetch(`https://jsonplaceholder.typicode.com/photos/${data.value.userId}`)
console.log('data2', photos.value)
</script>

<template>
  <div>
    first data: {{ data }}
  </div>
  <hr />
  <div>
    photos: {{ photos }}
  </div>
</template>

Something like this works perfectly fine, since all the fetching will be awaited

<script setup>
const { data } = await useFetch('https://jsonplaceholder.typicode.com/todos/1')
console.log('data', data.value.userId)
const { data: photos } = await useFetch(`https://jsonplaceholder.typicode.com/photos/${data.value.userId}`)
console.log('data2', photos.value)
</script>

<template>
  <div>
    first data: {{ data }}
  </div>
  <hr />
  <div>
    photos: {{ photos }}
  </div>
</template>

enter image description here

NUXT3:两个链如何提取?

绮筵 2025-02-01 11:22:02

您可以使用 df.sample(2).index 获取随机采样数据的DF中的索引,然后您可以将其传递到 .loc 以设置组这些索引是“实验性”的列如下:

df.loc[df.sample(2).index, 'group'] = 'experimental'

输出:

    species  name         group
0  platypus  mike  experimental
1    monkey  paul  experimental
2    possum  doug       control

You can use df.sample(2).index to get the indexes in your df of the randomly sampled data, you can then pass this into .loc to set the group column for those indexes to be 'experimental' as below:

df.loc[df.sample(2).index, 'group'] = 'experimental'

Output:

    species  name         group
0  platypus  mike  experimental
1    monkey  paul  experimental
2    possum  doug       control

如何将值分配给PANDAS DataFrame的随机子集?

绮筵 2025-02-01 10:20:51

对于大数字,您可能要使用缓存。你能做这样的事情吗?

// Recursive solution
int fib(int n, int cache[]) {
    if (n == 0) {
        return 0;
    }
    if (n == 1) {
        return 1;
    }
    if (cache[n]!= 0) {
        return cache[n];
    }
    cache[n] = fib(n - 1, cache) + fib(n - 2, cache);
    return cache[n];
}

// Iterative solution
int fib(int n) {
    int cache[n + 1];
    cache[0] = 0;
    cache[1] = 1;
    for (int i = 2; i <= n; i++) {
        cache[i] = cache[i - 1] + cache[i - 2];
    }
    return cache[n];
}

For a large number, you probably want to utilize a cache. Could you do something like this?

// Recursive solution
int fib(int n, int cache[]) {
    if (n == 0) {
        return 0;
    }
    if (n == 1) {
        return 1;
    }
    if (cache[n]!= 0) {
        return cache[n];
    }
    cache[n] = fib(n - 1, cache) + fib(n - 2, cache);
    return cache[n];
}

// Iterative solution
int fib(int n) {
    int cache[n + 1];
    cache[0] = 0;
    cache[1] = 1;
    for (int i = 2; i <= n; i++) {
        cache[i] = cache[i - 1] + cache[i - 2];
    }
    return cache[n];
}

问题是由未初始化的阵列引起的

绮筵 2025-02-01 05:48:08

类中的代码块是在“启动”上运行的。您只需在该代码块中或之后完成任何需要做的事情:

class Constants:
    data = {1: "123!"}    # define the data right here
    capacity = 123
 
    data[2] = "aaa"       # ... or here

Constants.data[3] = "bb"  # ... or here

The code inside the class block is what's running at "startup". You can simply do anything you need to do in that code block, or even after it:

class Constants:
    data = {1: "123!"}    # define the data right here
    capacity = 123
 
    data[2] = "aaa"       # ... or here

Constants.data[3] = "bb"  # ... or here

Python:初始化班级成员

绮筵 2025-01-31 05:09:54

VScodium内部缺乏良好支持的远程扩展非常不便。我想开发一些GO代码(其他语言可能有不同的要求)。目前我尝试了一些选项:

1。将代码放在Windows

WSL中安装Windows驱动器,因此在Windows中运行的编辑器可以更改本地文件,Linux将拾取更改。

PROS:

  • 仍然在本地编辑文件
  • ,只要在Windows上安装了所有工具 (对我来说,GO工具还必须安装在Windows中到WSL)

cons:

  • 没有文件观察器支持(Inotify不起作用) =手动重新编译
  • 缓慢构建/文件访问/docker Access

2。与延伸本身混乱

进行了几次调整,使Vscode扩展运行运行非常简单,请参阅: https://github.com/vscodium/vscodium/issues/1265

pros:

  • 在VSCODE中工作以及VSCODE
  • 可以在Linux中完全存储在Linux中,以获取适当的文件,以获取适当的文件,观看支持

< strong>缺点:

  • 任何更新(扩展/IDE-尽管其他人取得了成功,我都没有尝试过这种情况
  • )完全(尽管在Linux和Windows中都安装了工具)

3。来自WSL (WSLG)内部的启动代码

这是我最终使用的,因为无法在我的IDE中看到错误太烦人了(这很可能是GO虽然是事的,但在测试时对JS没有问题)。

  • 在WSL上启动WSL
  • 安装与代码
    • wget -qo-https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/raw/master/pub.gpg.gpg | GPG - dearmor | =/usr/share/keyrings/vscodium-archive-keyring.gpg
    • echo'deb [signed-by =/usr/share/keyrings/vscodium-archive-keyring.gpg] https://download.vscodium.com/debs vscodium v​​scodium main'| sudo tee /etc/apt/sources.list.d/vscodium.list
    • sudo apt Update&amp;&amp; sudo apt安装代码
  • 删除WSL警告nag
    • echo -e&gt;&gt; 〜/.bashrc“ \ nexport gdk_scale = 2 \ nalias codium ='dont_prompt_wsl_install = 1 codium'”
    • 源〜/.bashrc
  • set ractional scaping support(in Windows) “ https://github.com/microsoft/wslg/issues/23” rel =“ nofollow noreferrer”> https://github.com/microsoft/wslg/issues/23
    • 创建文件:%userProfile%\。wslgconfig
    • add:
[system-distro-env]
WESTON_RDP_DEBUG_DESKTOP_SCALING_FACTOR=100
  • 在vscodium(ctrl-)中缩放两次,

然后在Windows中,创建一个快捷方式,然后在目标字段中添加:

c:\ windows \ system322 \ wsl.exe bash -c“导出gdk_scale = 2&amp; dont_prompt_wsl_install = 1 codium”

这将直接启动WSL版本。

PROS:

  • 可以将文件完全存储在Linux中,以获取适当的文件观看支持
  • IDE Intellisense Works (即使在GO)

Cons:

  • 比 WSLG应用程序的本机Windows
  • 缩放量表尚未支持,因此4K屏幕的标准150%Windows缩放不起作用,您需要调整字体尺寸,并使用超大 /尺寸较小的菜单栏。

Lack of a well supported remote extension within VSCodium is very inconvenient. I wanted to develop some Go code (other languages may have different requirements). There are currently a few options that I tried:

1. Leave the code in Windows

WSL mounts the Windows drives, so your editor running in Windows can change the local files and Linux will pick the changes up.

Pros:

  • Still editing files locally
  • Intellisense will work as long as all tooling is installed on Windows (for me, Go tools also had to be installed in Windows in addition to WSL)

Cons:

  • No file watcher support (inotify doesn't work) = manual recompilation
  • Slower builds / file access / Docker access

2. Mess with the extension itself

With a few tweaks it's pretty simple to get the VSCode extension running, see: https://github.com/VSCodium/vscodium/issues/1265

Pros:

  • Works as well as in VSCode
  • Can store files fully within Linux to get proper file watching support

Cons:

  • Breaks with any updates (extension / IDE - nothing I tried prevented this despite others having success)
  • Intellisense didn't work for me in Go at all (despite tools being installed in both Linux and Windows)

3. Launch Codium from within WSL (WSLg)

This is what I have ended up using because not being able to see errors in my IDE was too annoying (this is most likely a Go thing though and was no issue for JS when tested).

  • Launch WSL
  • Install VS Codium on WSL
    • wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | gpg --dearmor | sudo dd of=/usr/share/keyrings/vscodium-archive-keyring.gpg
    • echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.gpg ] https://download.vscodium.com/debs vscodium main' | sudo tee /etc/apt/sources.list.d/vscodium.list
    • sudo apt update && sudo apt install codium
  • Remove the WSL warning nag
    • echo -e >> ~/.bashrc "\nexport GDK_SCALE=2\nalias codium='DONT_PROMPT_WSL_INSTALL=1 codium'"
    • source ~/.bashrc
  • Set Fractional Scaling Support (in Windows) - https://github.com/microsoft/wslg/issues/23
    • Create File: %UserProfile%\.wslgconfig
    • Add:
[system-distro-env]
WESTON_RDP_DEBUG_DESKTOP_SCALING_FACTOR=100
  • Zoom out twice in VSCodium (Ctrl-)

Then in Windows, create a shortcut and in the target field add:

C:\Windows\System32\wsl.exe bash -c "export GDK_SCALE=2 && DONT_PROMPT_WSL_INSTALL=1 codium"

This will launch the WSL version directly.

Pros:

  • Can store files fully within Linux to get proper file watching support
  • IDE intellisense works (even in Go)

Cons:

  • It's a bit slower than native Windows
  • Fractional scaling of WSLg apps is not yet supported, so the standard 150% Windows scaling for 4k screens won't work and you need to adjust font sizes and put up with an oversized / undersized menu bar.

如何在Windows 10上设置Windows子系统Linux(WSL 2)

绮筵 2025-01-31 05:00:12

对我来说,这是针对Nuget设置

工具 - &gt; Nuget软件包经理 - &GT;软件包maneger设置

在此处输入图像描述

for me it was for nuget setting

Tools -> NuGet Package Manager -> Package Maneger Settings

enter image description here

Visual Studio 22缓慢的构建时间

绮筵 2025-01-30 15:28:35

我发现您可以在哪里更改设置,如果其他人也在寻找此设置,我将在此处发布。

虽然,我仍然不知道这些信息存储在哪里。

I found where you can change the settings, and I am posting it here in case that other people are looking for this as well.

Although, I still don't know where this information is stored.

enter image description here

VS代码如何记住受信任的工作空间?

绮筵 2025-01-30 09:47:48

首先,您需要桌子的自我加入。
然后使用 json_object() {“ user_name”:“ user_code”} 和不 {“ user_name”,“ user_name”, “ user_code”} ,最后汇总并使用 json_arrayagg()

SELECT t1.*,
       JSON_ARRAYAGG(JSON_OBJECT(t2.username, t2.code)) secondary_users
FROM tablename t1 LEFT JOIN tablename t2
ON t2.secondary_user = t1.id
WHERE t1.secondary_user IS NULL
GROUP BY t1.id;

我假设 id 是表的主要键。

请参阅

First you need a self join of the table.
Then use JSON_OBJECT() to create valid json objects for a user in the form of {"user_name": "user_code"} and not {"user_name", "user_code"} and finally aggregate and use JSON_ARRAYAGG():

SELECT t1.*,
       JSON_ARRAYAGG(JSON_OBJECT(t2.username, t2.code)) secondary_users
FROM tablename t1 LEFT JOIN tablename t2
ON t2.secondary_user = t1.id
WHERE t1.secondary_user IS NULL
GROUP BY t1.id;

I assume that id is the primary key of the table.

See the demo.

MySQL行具有相同的值,但在不同的列中&amp;一行显示

绮筵 2025-01-30 09:16:30

您需要将数据旋转为长格式:

ggplot(tidyr::pivot_longer(MD3[1:2], 1:2),
       aes(x = value, fill = name)) +
  geom_bar(position = 'dodge') +
  scale_fill_brewer(palette = 'Set1') +
  theme_light()

”在此处输入图像说明“

您甚至可以以这种方式绘制所有列,而无需额外的努力

ggplot(tidyr::pivot_longer(MD3, tidyr::everything()),
       aes(x = value, fill = name)) +
  geom_bar(position = 'dodge') +
  scale_fill_brewer(palette = 'Set1') +
  theme_light()

“在此处输入映像说明”

如果您需要更改传奇中的标签,并且x轴,使用 labs

ggplot(tidyr::pivot_longer(MD3[1:2], 1:2),
       aes(x = value, fill = name)) +
  geom_bar(position = 'dodge') +
  scale_fill_brewer(palette = 'Set1') +
  theme_light() +
  labs(x = 'My x variables', fill = 'My categories')

ggplot(subset(tidyr::pivot_longer(MD3[1:2], 1:2), !is.na(value)),
       aes(x = value, fill = name)) +
  geom_bar(position = 'dodge') +
  scale_fill_brewer(palette = 'Set1') +
  theme_light() +
  labs(x = 'My x variables', fill = 'My categories')

​/81imp.png“ rel =” nofollow noreferrer“> ”

You need to pivot your data into long format:

ggplot(tidyr::pivot_longer(MD3[1:2], 1:2),
       aes(x = value, fill = name)) +
  geom_bar(position = 'dodge') +
  scale_fill_brewer(palette = 'Set1') +
  theme_light()

enter image description here

You can even plot all your columns this way with no extra effort

ggplot(tidyr::pivot_longer(MD3, tidyr::everything()),
       aes(x = value, fill = name)) +
  geom_bar(position = 'dodge') +
  scale_fill_brewer(palette = 'Set1') +
  theme_light()

enter image description here

If you need to change the labels in the legend and x axis, use labs

ggplot(tidyr::pivot_longer(MD3[1:2], 1:2),
       aes(x = value, fill = name)) +
  geom_bar(position = 'dodge') +
  scale_fill_brewer(palette = 'Set1') +
  theme_light() +
  labs(x = 'My x variables', fill = 'My categories')

enter image description here

To remove NA values, filter them out of your data frame to start with:

ggplot(subset(tidyr::pivot_longer(MD3[1:2], 1:2), !is.na(value)),
       aes(x = value, fill = name)) +
  geom_bar(position = 'dodge') +
  scale_fill_brewer(palette = 'Set1') +
  theme_light() +
  labs(x = 'My x variables', fill = 'My categories')

enter image description here

结合多个直方图GGPLOT

绮筵 2025-01-30 08:52:04

将帐户添加到计算机的本地管理员以修复操作。

Add the account to the Local Admin of the Machine to fix the Operation.Mail one

失败编写文件log_file_risk_alert_report:授予用户的权限&#x27;&#x27;不足以执行此操作

绮筵 2025-01-30 02:04:16

您在 ops()调用中使用了错误的关键字。您必须使用 cmap 而不是 color

这是一个非常基本的示例,改编自

import holoviews as hv
from holoviews import opts
hv.extension('bokeh')

factors = ["a", "b", "c", "d", "e", "f", "g", "h"]
x =  [50, 40, 65, 10, 25, 37, 80, 60]
scatter = hv.Scatter((factors, x))
spikes = hv.Spikes(scatter)

x = ["foo", "foo", "foo", "bar", "bar", "bar", "baz", "baz", "baz"]
y = ["foo", "bar", "baz", "foo", "bar", "baz", "foo", "bar", "baz"]
z = [0, 1, 2, 3, 4, 5, 6, 7, 8]
colors = ['#00FF00','#FFFF00','#FF0000','#FFFF00','#FF0000', '#00FF00','#FF0000', '#00FF00','#FFFF00']

hv.HeatMap((x,y,z)).opts(width=450, height=400, cmap=colors,  tools=['hover'])

output

”用户定义的颜色的热图。”

You are using the wrong keyword in your ops() call. You have to use cmap instead of color.

Here is a very basic example, adapted from here.

import holoviews as hv
from holoviews import opts
hv.extension('bokeh')

factors = ["a", "b", "c", "d", "e", "f", "g", "h"]
x =  [50, 40, 65, 10, 25, 37, 80, 60]
scatter = hv.Scatter((factors, x))
spikes = hv.Spikes(scatter)

x = ["foo", "foo", "foo", "bar", "bar", "bar", "baz", "baz", "baz"]
y = ["foo", "bar", "baz", "foo", "bar", "baz", "foo", "bar", "baz"]
z = [0, 1, 2, 3, 4, 5, 6, 7, 8]
colors = ['#00FF00','#FFFF00','#FF0000','#FFFF00','#FF0000', '#00FF00','#FF0000', '#00FF00','#FFFF00']

hv.HeatMap((x,y,z)).opts(width=450, height=400, cmap=colors,  tools=['hover'])

Output

HeatMap with user defined colors.

Hotoviews Heatmap的有条件颜色

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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