天生の放荡

文章 评论 浏览 30

天生の放荡 2025-02-13 13:30:11

我只是解决了我的问题。我认为您只需要在要将cookie发送回服务器时,只需添加withcredentials:true(使用Axios btw)。事实证明,如果您也想从服务器中获取cookie,则需要添加该属性。现在,浏览器将cookie存储在应用程序中> cookie 。感谢所有帮助< 3

I just solved my problem. I thought you only need to add withCredentials: true (using axios btw) whenever you want to send the cookie back to the server. Turns out, you need to add that property if you want to get the cookie from the server as well. Now the browser is storing the cookie in Application > Cookies. Appreciate all the help <3

如何使用Aspnet Core 6 Web API在浏览器中设置cookie?

天生の放荡 2025-02-13 10:39:23

在您的政治.html中。您的陆地开始

{政治中的政治{%},

然后在陆上您使用的内部
{{{post.image}}} {{post.title}} ect ..

所有这些都不是政治。看起来您从AllPosts.html复制并粘贴了,创建了与政治的正确开始,但并没有改变其余的forloop:
{{politics.image.url}}} {{politics.title}} ect ..

In your political.html. your forloop starts

{% for politics in politics%}

But then inside the forloop you use
{{post.image}} {{post.title}} ect..

All of those should be politics not post. It looks like you copy and pasted from allposts.html, created the correct start of the forloop with politics, but didn't change the rest of the forloop:
{{politics.image.url}} {{politics.title}} ect..

块内容不渲染

天生の放荡 2025-02-13 08:03:56

如果需要,请仅保留唯一的值a,ba,b,c在顺序:使用:

s = df.drop_duplicates(['Type','Market']).groupby('Type')['Market'].agg(tuple)
df = df[df['Type'].isin(s.index[s.isin([('A','B'),('A','B','C')])])]
print (df)
    Type Market  Price
0      1      A      2
1      1      B      2
2      1      B      2
7      3      A      8
8      3      B      7
9      3      B      7
10     3      C      7

另一个想法:

def f(x):
    u = tuple(dict.fromkeys(x))
    return (u  == ('A','B')) | (u  == ('A','B','C'))

df = df[df.groupby('Type').Market.transform(f)]

If need keep only unique values A,B or A,B,C in order use:

s = df.drop_duplicates(['Type','Market']).groupby('Type')['Market'].agg(tuple)
df = df[df['Type'].isin(s.index[s.isin([('A','B'),('A','B','C')])])]
print (df)
    Type Market  Price
0      1      A      2
1      1      B      2
2      1      B      2
7      3      A      8
8      3      B      7
9      3      B      7
10     3      C      7

Another idea:

def f(x):
    u = tuple(dict.fromkeys(x))
    return (u  == ('A','B')) | (u  == ('A','B','C'))

df = df[df.groupby('Type').Market.transform(f)]

基于特定条件的Python中的数据框

天生の放荡 2025-02-13 06:17:11

从问题中,我看不到带有RabbitMQ的服务。
您的服务名称是Zipkin。
尝试跑步
您还可以指定外部IP

kind: Service
apiVersion: v1
metadata:
  name: zipkin
spec:
  selector:
    app: zipkin
  ports:
  - protocol: "TCP"
    port: 8081
    targetPort: 80
  type: LoadBalancer
  externalIPs:
  - 192.168.64.2

,然后可以使用 http://192.168.64.2:8081/ 访问

From the question, I don't see a service with the name rabbitmq.
Your service name is zipkin.
Try running
You can also specify external IP

kind: Service
apiVersion: v1
metadata:
  name: zipkin
spec:
  selector:
    app: zipkin
  ports:
  - protocol: "TCP"
    port: 8081
    targetPort: 80
  type: LoadBalancer
  externalIPs:
  - 192.168.64.2

Then you can use http://192.168.64.2:8081/ to access

Minikube服务URL不被炒

天生の放荡 2025-02-13 05:19:20
{
  "theme": "neutral"
}

是最简单的解决方法。 (在线编辑中的“ config”下。)

https://github.com/github.com/mermeraid.com/mermeraid.com/mermeraid -JS/Mermaid/essume/3121 开放了一年。

{
  "theme": "neutral"
}

Is the easiest workaround for this. (Under "Config" in the online editor.)

https://github.com/mermaid-js/mermaid/issues/3121 has been open for a year.

美人鱼流程图传奇风格

天生の放荡 2025-02-13 04:12:13

根据我对此案的信息,我可以建议您这样的灵魂。

这也许不是最漂亮的解决方案,但它很容易理解,并且可以正常工作。

public class Main {
    public static void main(String[] args) {

        String A = "              AAA               \n"
                + "              A:::A              \n"
                + "             A:::::A             \n"
                + "            A:::::::A            \n"
                + "           A:::::::::A           \n"
                + "          A:::::A:::::A          \n"
                + "         A:::::A A:::::A         \n"
                + "        A:::::A   A:::::A        \n"
                + "       A:::::A     A:::::A       \n"
                + "      A:::::AAAAAAAAA:::::A      \n"
                + "     A:::::::::::::::::::::A     \n"
                + "    A:::::AAAAAAAAAAAAA:::::A    \n"
                + "   A:::::A             A:::::A   \n"
                + "  A:::::A               A:::::A  \n"
                + " A:::::A                 A:::::A \n"
                + "AAAAAAA                   AAAAAAA";

        String B = "\nBBBBBBBBBBBBBBBBB  \n"
                + "B::::::::::::::::B  \n"
                + "B::::::BBBBBB:::::B \n"
                + "BB:::::B     B:::::B\n"
                + "  B::::B     B:::::B\n"
                + "  B::::B     B:::::B\n"
                + "  B::::BBBBBB:::::B \n"
                + "  B:::::::::::::BB  \n"
                + "  B::::BBBBBB:::::B \n"
                + "  B::::B     B:::::B\n"
                + "  B::::B     B:::::B\n"
                + "  B::::B     B:::::B\n"
                + "BB:::::BBBBBB::::::B\n"
                + "B:::::::::::::::::B \n"
                + "B::::::::::::::::B  \n"
                + "BBBBBBBBBBBBBBBBB ";
        
        List<String> arrayA = List.of(A.split("\n"));
        List<String> arrayB = List.of(B.split("\n"));

    
        for(int i = 0; i < arrayA.size(); i++){
            System.out.println(arrayA.get(i)+arrayB.get(i));
        }


    }

According to the Information that i have to this case, i could suggest you a Souloution like this.

This is maybe not the prettiest soloution, but it is simple to understand, and it works.

public class Main {
    public static void main(String[] args) {

        String A = "              AAA               \n"
                + "              A:::A              \n"
                + "             A:::::A             \n"
                + "            A:::::::A            \n"
                + "           A:::::::::A           \n"
                + "          A:::::A:::::A          \n"
                + "         A:::::A A:::::A         \n"
                + "        A:::::A   A:::::A        \n"
                + "       A:::::A     A:::::A       \n"
                + "      A:::::AAAAAAAAA:::::A      \n"
                + "     A:::::::::::::::::::::A     \n"
                + "    A:::::AAAAAAAAAAAAA:::::A    \n"
                + "   A:::::A             A:::::A   \n"
                + "  A:::::A               A:::::A  \n"
                + " A:::::A                 A:::::A \n"
                + "AAAAAAA                   AAAAAAA";

        String B = "\nBBBBBBBBBBBBBBBBB  \n"
                + "B::::::::::::::::B  \n"
                + "B::::::BBBBBB:::::B \n"
                + "BB:::::B     B:::::B\n"
                + "  B::::B     B:::::B\n"
                + "  B::::B     B:::::B\n"
                + "  B::::BBBBBB:::::B \n"
                + "  B:::::::::::::BB  \n"
                + "  B::::BBBBBB:::::B \n"
                + "  B::::B     B:::::B\n"
                + "  B::::B     B:::::B\n"
                + "  B::::B     B:::::B\n"
                + "BB:::::BBBBBB::::::B\n"
                + "B:::::::::::::::::B \n"
                + "B::::::::::::::::B  \n"
                + "BBBBBBBBBBBBBBBBB ";
        
        List<String> arrayA = List.of(A.split("\n"));
        List<String> arrayB = List.of(B.split("\n"));

    
        for(int i = 0; i < arrayA.size(); i++){
            System.out.println(arrayA.get(i)+arrayB.get(i));
        }


    }

如何使这些字符串彼此打印

天生の放荡 2025-02-12 18:17:35

运行以下代码解决了问题:

npx migrate-mongo create blacklist_the_beatles

Running the following code solved the problem:

npx migrate-mongo create blacklist_the_beatles

mongodb可以创建迁移脚本

天生の放荡 2025-02-12 10:03:23

只需将card组件的高度设置为fit-content,然后从card中的每个组件中删除硬编码高度:

demo

Just set up the height of a Card component to fit-content and delete the hardcoding height from every component inside the Card:

Demo

MUI:DIV高度 - 扩展以适合内容

天生の放荡 2025-02-12 09:09:16

我认为该文档只是意味着HILT需要Java 8中的语言功能,而不是将Java版本限制为1.8。我尝试将源兼容性和目标兼容性更改为11,并且效果很好。

I think the documentation just means that Hilt requires language features from Java 8, not limiting the the Java version to 1.8. I tried changing the source and target compatibility to 11 and it works totally fine.

Android项目中的Java 11中不可用HILT吗?

天生の放荡 2025-02-12 05:14:58

尝试将3.6.0版添加

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"
  type="text/javascript"></script>

到您的代码头中,然后再次运行灯塔报告。

try adding the version 3.6.0 as shown below

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"
  type="text/javascript"></script>

to your code head and run the lighthouse report again.

jQuery-包括具有已知安全漏洞的前端JavaScript库

天生の放荡 2025-02-12 02:40:03

导入模块 - 您不需要额外的努力就可以从模块中获取另一件事。它的缺点,例如

从少量打字中导入的冗余键入模块,可以访问模块的哪个项目。要从模块中使用新项目,您必须更新导入语句。

Import Module - You don't need additional efforts to fetch another thing from module. It has disadvantages such as redundant typing

Module Import From - Less typing &More control over which items of a module can be accessed.To use a new item from the module you have to update your import statement.

使用&#x27;导入模块&#x27;或来自模块导入的&#x27;?

天生の放荡 2025-02-12 01:55:55

您尚未发布任何的代码来修改字符串 - 您只是在计数加倍的字母。

要解决您的内容,您需要在您当前处于的字符串中具有“位置”,请将该字母与下一个字母(如果下一个字母)进行比较 - 如果您需要拼接字符串,请删除字母pos+1 ,然后用字母的下一个字母替换为 pos

这样就会这样:

s="aabcdghhjjk"

results = []
pos = 0
# modifying s (string == immuteable) is wasteful, could use list instead
while s:
    if len(s) < 2 or len(s) < pos+2:
        results.append(s)
        break

    # only add to results if not at results's last spot
    if not results or results[-1] != s:
        results.append(s)

    if s[pos] == s[pos+1]:       
        next_letter = chr(ord(s[pos])+1)
        # replace stuff by list slicing, creates a new immuteable string
        s = s[:pos] + next_letter + s[pos+2:]
    else:
        # not equal letters, advance position in string
        pos += 1
        
print(results)

输出:

['aabcdghhjjk', 
  'bbcdghhjjk', 
   'ccdghhjjk', 
    'ddghhjjk', 
     'eghhjjk', 
      'egijjk',  
      'egikk', 
       'egil']

仍然有一个边缘案例,您最终可能会在单词中加倍字母如果,您以后将字母替换为与已经评估的位置相结合的东西,向上。

固定边缘情况很有趣。

You haven't posted any code that does actally anything to modify the string - you are only counting letters that are doubled up.

To solve your thing you need to have "position" inside the string you are currently at, compare that letter with the next one (if next one there) - if same you need to splice the string, remove letters at pos,pos+1 and replace with the next letter of the alphabet at pos.

This would sove that:

s="aabcdghhjjk"

results = []
pos = 0
# modifying s (string == immuteable) is wasteful, could use list instead
while s:
    if len(s) < 2 or len(s) < pos+2:
        results.append(s)
        break

    # only add to results if not at results's last spot
    if not results or results[-1] != s:
        results.append(s)

    if s[pos] == s[pos+1]:       
        next_letter = chr(ord(s[pos])+1)
        # replace stuff by list slicing, creates a new immuteable string
        s = s[:pos] + next_letter + s[pos+2:]
    else:
        # not equal letters, advance position in string
        pos += 1
        
print(results)

Output:

['aabcdghhjjk', 
  'bbcdghhjjk', 
   'ccdghhjjk', 
    'ddghhjjk', 
     'eghhjjk', 
      'egijjk',  
      'egikk', 
       'egil']

There is still an edge-case where you could end up with doubled up letters in your words if you replace a letter later to something that combines with already evaluated positions to another double up.

Have fun fixing that edge case.

弦模式解析和替换下一个aphabets

天生の放荡 2025-02-12 01:10:46

保存到变量并从数组中获取数据如下

$message = $responce['value']['message'];
$phone_number = $responce['value']['metadata']['phone_number_id'];
$contact = $responce['value']['contacts'];

最简单的方法是将响应

$res = json_decode($responce);
$message = $res->value->message;
$phone_number= $res->value->metadata->phone_number_id;
$contact = $res->value->contacts;

。建议查看以下答案

The easiest way is to save the response to a variable and get the data from the array as follows

$message = $responce['value']['message'];
$phone_number = $responce['value']['metadata']['phone_number_id'];
$contact = $responce['value']['contacts'];

You can also decode the response first and then you can easily do the following

$res = json_decode($responce);
$message = $res->value->message;
$phone_number= $res->value->metadata->phone_number_id;
$contact = $res->value->contacts;

But if you want to convert the JSON you have to a Laravel object I recommend checking out the following answer.

我如何序列化whatsapp消息有效载荷以获取消息主体,phone_number_id,在laravel php中联系

天生の放荡 2025-02-11 13:46:43

您好,我遇到了同样的问题。

我通过在不使用.withConverter()的情况下为每个类编写自己的转换器来解决它。

看起来好像:

async customConverter (snapshot) {
 const { refField } = snapshot.data();
 const populated = await getDoc(refField);
 return {
    ...snapshot.data(),
    refField: populated.data(),
 };
}


async fetch () {
  const docRef = doc(firestore, 'collection', 'id');
  const snapshot = await getDoc(docRef);
  const dataPopulated = await customConverter(snapshot);
  return dataPopulated;
}

我知道这不是完美的,但是如果有人有更好的方式,我都会耳朵! )

Hello there I encountered the same problem.

I solved it by writing my own converters for each class without using .withConverter().

It looks like:

async customConverter (snapshot) {
 const { refField } = snapshot.data();
 const populated = await getDoc(refField);
 return {
    ...snapshot.data(),
    refField: populated.data(),
 };
}


async fetch () {
  const docRef = doc(firestore, 'collection', 'id');
  const snapshot = await getDoc(docRef);
  const dataPopulated = await customConverter(snapshot);
  return dataPopulated;
}

I know it's not perfect but if someone has a better way I all ears! ;)

Firebase Firestore异步带有Conconverter和参考

天生の放荡 2025-02-11 12:06:13

您可以定义几个辅助功能以调整两个数据范围的长度和宽度:

def equalize_length(short, long):
    return pd.concat(
        [
            short,
            pd.DataFrame(
                {
                    col: ["nan"] * (long.shape[0] - short.shape[0])
                    for col in short.columns
                }
            ),
        ]
    ).reset_index(drop=True)


def equalize_width(short, long):
    return pd.concat(
        [
            short,
            pd.DataFrame({col: [] for col in long.columns if col not in short.columns}),
        ],
        axis=1,
    ).reset_index(drop=True)


def equalize(df, other_df):
    if df.shape[0] <= other_df.shape[0]:
        df = equalize_length(df, other_df)
    else:
        other_df = equalize_length(other_df, df)
    if df.shape[1] <= other_df.shape[1]:
        df = equalize_width(df, other_df)
    else:
        other_df = equalize_width(other_df, df)
    df = df.fillna("nan")
    other_df = other_df.fillna("nan")
    return df, other_df

然后,在您的代码中:

a, b = equalize(a, b)

comparevalues = a.values == b.values

rows, cols = np.where(comparevalues == False)

for item in zip(rows, cols):
    a.iloc[item[0], item[1]] = " {} --> {} ".format(
        a.iloc[item[0], item[1]], b.iloc[item[0], item[1]]
    )
print(a)  # with 'a' being shorter in lenght but longer in width than 'b'
# Output
             A                      B                              C                          D
0            1          abcd --> dah                           jamba        OQEWINVSKD --> nan
1            2         efgh --> fupa              refresh --> dimez        DKVLNQIOEVM --> nan
2            3                   ijkl    portobello --> pocketfresh           asdlikvn --> nan
3            4       uhyee --> danju    performancehigh --> reverbb    asdkvnddvfvfkdd --> nan
4            5                   uhuh                      jackalack                        nan        
5   nan --> 6    nan --> freshhhhhhh    nan --> boombackimmatouchit                         nan

You could define several helper functions to adjust the length and widths of the two dataframes:

def equalize_length(short, long):
    return pd.concat(
        [
            short,
            pd.DataFrame(
                {
                    col: ["nan"] * (long.shape[0] - short.shape[0])
                    for col in short.columns
                }
            ),
        ]
    ).reset_index(drop=True)


def equalize_width(short, long):
    return pd.concat(
        [
            short,
            pd.DataFrame({col: [] for col in long.columns if col not in short.columns}),
        ],
        axis=1,
    ).reset_index(drop=True)


def equalize(df, other_df):
    if df.shape[0] <= other_df.shape[0]:
        df = equalize_length(df, other_df)
    else:
        other_df = equalize_length(other_df, df)
    if df.shape[1] <= other_df.shape[1]:
        df = equalize_width(df, other_df)
    else:
        other_df = equalize_width(other_df, df)
    df = df.fillna("nan")
    other_df = other_df.fillna("nan")
    return df, other_df

And then, in your code:

a, b = equalize(a, b)

comparevalues = a.values == b.values

rows, cols = np.where(comparevalues == False)

for item in zip(rows, cols):
    a.iloc[item[0], item[1]] = " {} --> {} ".format(
        a.iloc[item[0], item[1]], b.iloc[item[0], item[1]]
    )
print(a)  # with 'a' being shorter in lenght but longer in width than 'b'
# Output
             A                      B                              C                          D
0            1          abcd --> dah                           jamba        OQEWINVSKD --> nan
1            2         efgh --> fupa              refresh --> dimez        DKVLNQIOEVM --> nan
2            3                   ijkl    portobello --> pocketfresh           asdlikvn --> nan
3            4       uhyee --> danju    performancehigh --> reverbb    asdkvnddvfvfkdd --> nan
4            5                   uhuh                      jackalack                        nan        
5   nan --> 6    nan --> freshhhhhhh    nan --> boombackimmatouchit                         nan

如何找到两个不同长度的数据范围之间的差异?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

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