三人与歌

文章 评论 浏览 30

三人与歌 2025-02-12 08:39:09

您可以尝试以下方法:

  1. 如果您有一个单词或一个行句,则以下代码可以执行技巧。

    在DIV标签中有一个文本,并给它一个ID。定义该ID的以下属性。

      id-name {
      身高:90px;
      线高:90px;
      文字平衡:中心;
      边界:2PX虚线红色;
    }
     

    注意:确保线路高属性与划分的高度相同。

    image

    但是,如果内容是一个以上的单词或一行,那么这是行不通的。另外,有时您无法指定PX或%的分区大小(当分区真的很小并且您希望内容完全位于中间时)。

  2. 要解决此问题,我们可以尝试以下属性组合。

      id-name {
      显示:flex;
      Jusify-content:中心;
      准项目:中心;
      边界:2PX虚线红色;
    }
     

    image

    这3行代码将内容设置在一个部门的中间(无论显示屏的大小如何)。 “ Align-Items:Center” 有助于垂直居中,而” jusify-content:Center” 将水平居中。

    注意: Flex在所有浏览器中都不起作用。确保添加适当的供应商前缀以进行额外的浏览器支持。

You can try the following methods:

  1. If you have a single word or one line sentence, then the following code can do the trick.

    Have a text inside a div tag and give it an id. Define the following properties for that id.

    id-name {
      height: 90px;
      line-height: 90px;
      text-align: center;
      border: 2px dashed red;
    }
    

    Note: Make sure the line-height property is same as the height of the division.

    Image

    But, if the content is more than one single word or a line then this doesn’t work. Also, there will be times when you cannot specify the size of a division in px or % (when the division is really small and you want the content to be exactly in the middle).

  2. To solve this issue, we can try the following combination of properties.

    id-name {
      display: flex;
      justify-content: center;
      align-items: center;
      border: 2px dashed red;
    }
    

    Image

    These 3 lines of code sets the content exactly in the middle of a division (irrespective of the size of the display). The "align-items: center" helps in vertical centering while "justify-content: center" will make it horizontally centered.

    Note: Flex does not work in all browsers. Make sure you add appropriate vendor prefixes for additional browser support.

我如何在DIV块内(水平和垂直)中心文本?

三人与歌 2025-02-12 06:45:07

您需要更新环境路径。

  1. 开放终端。

  2. vim $ home/.zshrc

  3. 按“ i”键进入插入模式。

  4. 在打开的文件中添加以下行:
    导出路径=“ $:/your_flutter_dir/flutter/bin”

  5. 按“ ESC”,然后写入:WQ!在端子中,然后按Enter将退出Vim。

  6. 重新打开终端并检查“ Flutter Doctor”

如果该解决方案不起作用,请从路径上删除双重报价,或明确使用完整的路径而不是〜。

尝试此步骤,我的问题得到了解决。

You need to update the environment path.

  1. Open terminal.

  2. vim $HOME/.zshrc

  3. Press "I" key for going to insert mode.

  4. add the following line in the opened file:
    export PATH="$PATH:/YOUR_FLUTTER_DIR/flutter/bin"

  5. Press "Esc" then write :wq! in terminal and press enter to exit vim.

  6. Reopen the terminal and check "flutter doctor"

If this solution did not work, remove the double quote from path or use the full path explicitly instead of ~.

try this steps my issue was solved with this.

ZSH终端看不到Flutter Mac

三人与歌 2025-02-11 16:45:25

从您的Arduino IDE管理Tools->管理库中安装AllBot库,这是指南 https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries

我可以下载并补充

install the ALLBOT library from Tools->Manage Libraries from your arduino ide, here is guide https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries

here i was able to to download and complie

Allbot Arduino库

三人与歌 2025-02-11 13:10:45

在开发过程中,我也面临着同样的事情,让我帮助您解决它的解决方法,

首先您在react软件包中使用代理

"private": true,
"proxy":"http://127.0.0.1:5000",


像: -

app.listen(5000,'127.0.0.1',()=>{
console.log('Server is Running');
});

两者都必须处于相同的位置,现在反应将像往常一样在端口3000上运行,但现在我们将创建代理,以便,React和Node端口在代理的帮助下间接地连接到同样。

现在,当您从React提出或发布请求时,请勿提供完整的URL,只提供您想要在后端打击并获得响应的路径,

例如: -
在发送请求时进行反应侧,以下这样的措施: -

const submithandler =()=> {

    axios.post('/api/loginuser', 
    {mobile:inputField.mobile,password:inputField.password})
    .then((res)=>{
    console.log(res);
    })
    .catch((err)=>{
    console.log(err);
    })
    }

 Node side where it will hit:-
app.post('/api/loginuser', async(req,res)=>{
//Your Code Stuff Here          
res.send()
}

在两侧相同的链接应击中,非常重要的是,

它将100%。
不要忘记

在节点主体上提到服务器正在侦听的主

during development i also faced same things, let me help you that how i solve it,

Firstly you use proxy in your react package.json, below private one:-

"private": true,
"proxy":"http://127.0.0.1:5000",

mention the same port on which your node server is running
Like:-

app.listen(5000,'127.0.0.1',()=>{
console.log('Server is Running');
});

above both must be on same , now react will run on port 3000 as usual but now we will create proxy to react So, react and node ports get connected on same with the help of proxy indirectly.

Now, when you will make GET or POST request from react then don't provide full URL, only provide the path on which you wants to get hit in backend and get response,

Example:-
React side on sending request, follow like this:-

const submitHandler=()=>{

    axios.post('/api/loginuser', 
    {mobile:inputField.mobile,password:inputField.password})
    .then((res)=>{
    console.log(res);
    })
    .catch((err)=>{
    console.log(err);
    })
    }

 Node side where it will hit:-
app.post('/api/loginuser', async(req,res)=>{
//Your Code Stuff Here          
res.send()
}

on both side same link should hit, it is very important

it will 100%.
don't forget to mention

on node main main where server is listening

如何从Express JS API(MERN堆栈)中获得React中的Cookie

三人与歌 2025-02-11 10:51:26

首先,如果您想在没有用户的情况下保存汽车,则应如下所示。

public class Car
{
    public int Id { get; set; }
    public int Year { get; set; }
    public string Plate { get; set; }

    // navigation property make nullable
    public int? UserId { get; set; }
    public User User { get; set; }
}

如果您想与用户保存,则在这种情况下,用户必须存在于数据库中。例如,在您的示例中,用户必须在数据库中存在ID = 2

First of all If you want to save Cars without User you should Cars entity as below.

public class Car
{
    public int Id { get; set; }
    public int Year { get; set; }
    public string Plate { get; set; }

    // navigation property make nullable
    public int? UserId { get; set; }
    public User User { get; set; }
}

If you want to save with user in this case that User must exist in database. For example in your example User must exists in database with id=2

可以在实体框架核心上使用导航属性插入数据6

三人与歌 2025-02-11 07:05:39

我们试图在我们的环境中创建耐用的Azure函数并成功测试,您可以

  • 使用 .net 6 使用VS 2022 V17.2.1创建耐用函数: - 创建耐用函数具有与您相同的配置。

  • 我们的 .csproj

>

  • “在此处输入图像说明” azure存储仿真 已在您的本地安装和运行。

运行功能的输出详细信息: -

“在此处输入图像说明”

“在此处inter

有关更多信息,请参阅此 Microsoft文档 | 创建耐用函数的“ nofollow noreferrer”> 。 & ,所以线程 对于类似问题。

另外 ,您可以将其引用以更新 github 问题。

We have tried to create Durable Azure function in our environment and tested successfully ,You can follow the below workaround:-

  • Created Durable function using .net 6 using VS 2022 v17.2.1 with same configuration as yours.

enter image description here

  • we have the following versions in our .csproj

enter image description here

OUTPUT DETAILS OF RUNNING FUNCTION:-

enter image description here

enter image description here

For more information please refer this MICROSOFT DOCUMENTATION|CREATE DURABLE FUNCTION USING VS 2022. & SO THREAD for similar issue.

Alternatively, you can refer this to update the vs version and azurite version as mentioned in this GitHub issue.

使用.net6(VS2022)创建的耐用Azure函数在本地调试未找到源

三人与歌 2025-02-11 04:39:59

从不和谐中得到答案。

root是指它所在的规则的基础,您可以在这种情况下使用app.root。

<CredPopup@Popup>
    auto_dismiss: False 
    title: "Type your Credentials"
    size_hint: 1, .5
    pos_hint: {'center_x': .5, 'top': .95}
    on_dismiss: app.root.set_cred({'username':username.text, 'password':password.text})

Got answer from discord.

root refers to the base of the rule it is in, you could use app.root in this case instead to use to refer to the app's root widget .

<CredPopup@Popup>
    auto_dismiss: False 
    title: "Type your Credentials"
    size_hint: 1, .5
    pos_hint: {'center_x': .5, 'top': .95}
    on_dismiss: app.root.set_cred({'username':username.text, 'password':password.text})

如何在Python Kivy中的MainLayout(widget)on_dismiss事件中执行函数?

三人与歌 2025-02-10 23:01:30

根据定义,子类继承父类的所有属性/方法。因此,当您创建/实例化子对象时,您无需参考任何父母。

class Parent:
    def __init__(self, a):
        self.a = a
    def parent_function(self):
        print(self.a)
class Child(Parent):
    def __init__(self, parent, b):
        super().__init__(b)
        self.parent = parent
    def child_function(self):
        print(self.b)

parent = Parent("a")
parent_2 = Parent("x")
child = Child(parent, "b")
child.parent_function()
child.child_function()
parent.a = "c"
child.parent.parent_function() # this will track parent

by definition, child classes inherit all properties/methods of the parent class. therefore you don't need to reference any parent when you create/instantiate the child object.

class Parent:
    def __init__(self, a):
        self.a = a
    def parent_function(self):
        print(self.a)
class Child(Parent):
    def __init__(self, parent, b):
        super().__init__(b)
        self.parent = parent
    def child_function(self):
        print(self.b)

parent = Parent("a")
parent_2 = Parent("x")
child = Child(parent, "b")
child.parent_function()
child.child_function()
parent.a = "c"
child.parent.parent_function() # this will track parent

我可以使用家长实例化实例化儿童课程吗?

三人与歌 2025-02-10 11:48:25

发生这种情况是因为 date 使用0到11的月号,但是 localdate 使用1到12的月号。 ,它不会给您正确的结果。

请停止使用 date 类,而只需使用 java.time 软件包中的类。这些特定的方法 - getDay() getmonth() getyear()在上个世纪被弃用,如果我没记错的话。

在这种情况下,您应该使用 localdate 而不是 date ,因为它表达了一年,月和日的组合,而没有时间组件。

This happens because Date uses month numbers from 0 to 11, but LocalDate uses month numbers from 1 to 12. So even if your program doesn't throw the DateTimeException, it won't give you the correct result.

Please stop using the Date class, and just use classes from the java.time package instead. Those particular methods - getDay(), getMonth() and getYear() were deprecated last century, if I recall correctly.

In this case, you should use LocalDate instead of Date, because it expresses a combination of year, month and day, with no time component.

为什么DateTime Exception仅发生在一月

三人与歌 2025-02-09 00:57:35

这是一个基于您的 formatm1b/c 向量进行分割的函数,

f1 <- function(string, vec){
  start <- c(1, cumsum(vec)[-length(vec)] + 1)
  end <- cumsum(vec)
  apply(data.frame(start, end), 1, function(i)substring(string, i[1], i[2]))
}

我们可以将其应用于

Map(function(x, y) f1(x, y), df$var1,list(formatM1B, formatM1C))

#$M1B123456789MM1158
#[1] "M1B"       "123456789" "MM"        "1158"     

#$M1C123456789zMM1183
#[1] "M1C"       "123456789" "z"         "MM"        "1183"     

Here is a function that does the splitting based on your formatM1B/C vectors,

f1 <- function(string, vec){
  start <- c(1, cumsum(vec)[-length(vec)] + 1)
  end <- cumsum(vec)
  apply(data.frame(start, end), 1, function(i)substring(string, i[1], i[2]))
}

And we can apply it as,

Map(function(x, y) f1(x, y), df$var1,list(formatM1B, formatM1C))

#$M1B123456789MM1158
#[1] "M1B"       "123456789" "MM"        "1158"     

#$M1C123456789zMM1183
#[1] "M1C"       "123456789" "z"         "MM"        "1183"     

分开差异固定宽度字符串格式

三人与歌 2025-02-08 20:29:00

这取决于测试框架,版本和设置。

在Junit 4中,一个类的一个实例用于运行类中的所有测试。这意味着是的,测试记住。

在Junit 5中,默认情况下为每个测试创建一个新实例。这包括参数化测试 - 这就是为什么(默认情况下)参数工厂方法需要静态的原因,因为还没有实例提供参数。
您可以使用 @TestInstance(lifecycle.per_class)更改行为,以再次为所有测试使用单个实例。


正如Qbrute在评论中所说的那样,测试应该独立工作。这意味着,如果您的测试类保持状态,则应重置该状态。 Junit 5使用 @BeForeEach @AfterEach 为此。最好使用 @beforeeach ,因为那时状态静脉曲张中的故障不会导致另一个测试失败。

所以:

@BeforeEach
void initializeList() {
    myList = new ArrayList<>();
    // now every test has its own fresh list
}

It depends on the test framework, version, and settings.

In JUnit 4, a single instance of a class is used to run all tests in the class. That means that yes, the tests remember.

In JUnit 5, by default a new instance is created for every test. That includes parameterized tests - that's the reason why (by default) argument factory methods need to be static, as there is no instance yet to provide the arguments.
You can use @TestInstance(Lifecycle.PER_CLASS) to change the behaviour to again use a single instance for all tests.


As QBrute said in a comment, tests should work independently. That means that if your test class maintains state, that state should be reset. JUnit 5 uses @BeforeEach and @AfterEach for that. Preferably use @BeforeEach, because then a failure in the state-reset will not lead to another test failing.

So:

@BeforeEach
void initializeList() {
    myList = new ArrayList<>();
    // now every test has its own fresh list
}

测试“记住”独立

三人与歌 2025-02-08 20:14:39

使用JQ做魔术(只需确保您的Kubeconfig在JSON中)即可。
我敢肯定,可以使用YQ的YQ进行YAML,但我让其他人填写那个。SET cluster_name to您所需的值。

jq '.clusters[0].name="'$CLUSTER_NAME'" | .contexts[0].context.cluster="'$CLUSTER_NAME'"' source/kubeconfig > target/kubeconfig

Use JQ to do the magic (just make sure your KubeConfig is in JSON).
I'm sure is possible to do it with YQ for YAML but I let someone else fill that one in. Set CLUSTER_NAME to your desired value.

jq '.clusters[0].name="'$CLUSTER_NAME'" | .contexts[0].context.cluster="'$CLUSTER_NAME'"' source/kubeconfig > target/kubeconfig

如何使用Kubectl更改Kube配置文件中的用户名?

三人与歌 2025-02-08 17:41:23

经过一番研究,我发现了window的方法的方法,该方法与OnsectionRender的作用完全相同。

After some research, I found react-window's method onItemsRendered which does exactly the same as onSectionRendered.

在反应窗口中进行占地

三人与歌 2025-02-08 09:23:46

如果您的输入始终是单行,则您应该能够利用 例如,功能

echo "Hello World" | python3 -c "print(input().upper())"

将输出

HELLO WORLD

If your input is always single line then you should be able to harness input function for example

echo "Hello World" | python3 -c "print(input().upper())"

would output

HELLO WORLD

Linux命令管带有python的“ -c”旗帜

三人与歌 2025-02-08 05:46:21

问题在于您的用户模型上的 message()关系尚未指定一个字段,因此假设相关字段称为 user_id (根据Laravel命名约定)。

您可以将字段指定为第二个参数,

public function messages()
{
    return $this->hasMany(Message::class, 'sender_id');
}

最后,您应该渴望加载消息,

User::whereNot('id', '!=', Auth::user()->id)
    ->where('email', 'like', $searchTerm)
    ->with('messages') 
    ->get();

The problem is that the messages() relation on your User-model has not specified a field, so it assumes that the related field is called user_id (as per Laravel naming conventions).

You could specify a field as the second argument,

public function messages()
{
    return $this->hasMany(Message::class, 'sender_id');
}

Finally, you should be eager loading your messages,

User::whereNot('id', '!=', Auth::user()->id)
    ->where('email', 'like', $searchTerm)
    ->with('messages') 
    ->get();

如何使用Laravel 8显示发件人的最后一条消息?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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