痴情

文章 评论 浏览 30

痴情 2025-02-04 20:44:48

如果使用语句使用,则如果条件为真,则将执行之后的第一个语句。如果您在(带卷曲括号)之后有一个块,则对整个块很重要。如果没有块,则仅计算一个语句。单个半龙是一个空的语句。您也可以从您的示例中编写代码:

if(a==b) {
    ;
}

If you use an if statement, the first statement after the if will be executed if the condition is true. If you have a block after the if (with curly braces), it counts for that whole block. If there is no block it counts for only one statement. A single semicolon is an empty statement. You could also write the code from you example like this:

if(a==b) {
    ;
}

' if'陈述

痴情 2025-02-04 11:45:49

从技术上讲,这无法通过JavaScript实现。您可以使用一些自动化工具,例如自动启用,例如

某些键盘也支持Marco功能。您可以记录一个宏并复制每个记录,如果整个过程都可以重复。

Technically, this cannot be achieved via JavaScript. You can use some automation tools like AutoIt e.g.

Some Keyboards are also supporting Marco functions. You can record a Macro and copy every record if the entire process is repeatable.

从一个浏览器窗口复制文本到另一个浏览器窗口

痴情 2025-02-02 22:40:50

“桌子”是完整的桌子
“ Th”是标题
“ TD”是

最佳练习,即坚持使用您的样式的一个标准。
将它们放在顶部(页面级)的样式标签中,或者将它们全部放在您的HTML元素(内联)中,一致性是最好的,但是这里是JSFIDDLE,请执行您需要的工作:

https://jsfiddle.net/dmiranda9872/bx1ste92sste92/15/15/

<DOCTYPE! html>
<html>
  <title> Info </title>
  <style> 

    table ,th, td, caption {
    }
    table {
        border-spacing: 30px; 
        background-color: #2ECC71;
        width: 50%;
        text-align: center;
        padding: 5px;
    }
    th, td {
      background-color: white;
      padding: 5px;
    }
  </style>
  <body>
      <table>
        <tr>
          <th> Days </th> 
          <th> Weather </th>
        </tr>
        <tr>
          <td> Monday </td> 
          <td> Sunny </td>
        </tr>
        <tr>
          <td> Tuesday </td> 
          <td> Rainy </td> 
         </tr>
      </table>
  </body>
</html>

"Table" is the full table
"TH" are the headers
"TD" are the cells

Best practice to stick to one standard with where you put your styles.
Either put them in the style tag at the top (page level) or put them all in your html elements (inline), consistency is best early on, but here is the JSfiddle doing what you need:

https://jsfiddle.net/dmiranda9872/bx1ste92/15/

<DOCTYPE! html>
<html>
  <title> Info </title>
  <style> 

    table ,th, td, caption {
    }
    table {
        border-spacing: 30px; 
        background-color: #2ECC71;
        width: 50%;
        text-align: center;
        padding: 5px;
    }
    th, td {
      background-color: white;
      padding: 5px;
    }
  </style>
  <body>
      <table>
        <tr>
          <th> Days </th> 
          <th> Weather </th>
        </tr>
        <tr>
          <td> Monday </td> 
          <td> Sunny </td>
        </tr>
        <tr>
          <td> Tuesday </td> 
          <td> Rainy </td> 
         </tr>
      </table>
  </body>
</html>

如何更改表背景颜色而不覆盖单元背景颜色

痴情 2025-02-02 21:00:50

首先,您无法验证表单请求中的路由

参数
示例:

Route::get('/calendar/{day}', 'App\Http\Controllers\HomeController@calendar')
    ->name('calendar')
    ->where('day', '/^[0-9]{4}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])$/');

如果您仍然要使用 validate()函数或表单请求

$request->merge([
   'day' => $day
]);

$this->validate($request, [
   'day' => 'date_format:Ymd',
]);

表单请求方式 - 覆盖 all()方法

public function all($k = null){
   $data = parent::all($k);
   $data['day'] = $this->route('day');
   return $data;
}

如果什么都没有起作用,请尝试遵循代码

public function calendar(Request $request, $day){
 $data = $request->all();
 $data['day'] = $day; 

 $validator = Validator::make($data, [
   'day' => 'required|date_format:Ymd',
 ]);
  
 if($validator->fails()){
    // Do Something abort(404);
 }

}

laravel 5如何验证路由参数?

但是我建议您作为请求参数发送它如果要使用 validate()函数。

Firstly, you can not validate route parameters inside Form Request

But, you can use regex for validating your route
Example:

Route::get('/calendar/{day}', 'App\Http\Controllers\HomeController@calendar')
    ->name('calendar')
    ->where('day', '/^[0-9]{4}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])$/');

If You still want to use validate() function or Form Request

$request->merge([
   'day' => $day
]);

$this->validate($request, [
   'day' => 'date_format:Ymd',
]);

Form Request Way - Override all() method

public function all($k = null){
   $data = parent::all($k);
   $data['day'] = $this->route('day');
   return $data;
}

If Nothing Works, Try Following code

public function calendar(Request $request, $day){
 $data = $request->all();
 $data['day'] = $day; 

 $validator = Validator::make($data, [
   'day' => 'required|date_format:Ymd',
 ]);
  
 if($validator->fails()){
    // Do Something abort(404);
 }

}

Laravel 5 how to validate route parameters?

But I would suggest you to send it as request parameter if you want to use validate() function.

Laravel-是否可以使用Illuminate \ Foundation \ http \ formrequest验证获得通配符的请求;

痴情 2025-02-02 19:11:59

您的 QuerySelector actionDivarchiveBtn 不正确。因为您是通过 ID 搜索的,但是在布局中,它是 class ,所以我在布局 class 中更改为 id ,现在它作品。但是,您可能需要 class 在布局中,然后将更改为

function load_mailbox(string) {
  console.log(string);
}

function addElements(mailbox) {
  if (mailbox != 'sent') {
    let actionDivArchiveBtn = document.querySelector('#actions')
    let archiveButton = document.createElement("button");
    archiveButton.classList.add('archive');
    archiveButton.innerHTML = `SOME TEXT<i class="fa fa-archive" aria-hidden="true"></i>`
    actionDivArchiveBtn.appendChild(archiveButton);

    archiveButton.addEventListener('click', () => {
      if (email.archived === false) {
        actionDivArchiveBtn.style.color = "blue";
        fetch(`/emails/archive/${id}`, {
          method: 'PUT',
          body: JSON.stringify({
            archived: true
          })
        })
      } else {
        actionDivArchiveBtn.style.color = "black";
        fetch(`/emails/archive/${id}`, {
          method: 'PUT',
          body: JSON.stringify({
            archived: false
          })
        })
      }
    })
  }
  load_mailbox('inbox');
}

addElements('receive');
<div id="actions">
  <span class="action"><i class="fa fa-reply" aria-hidden="true"></i></span>
</div>

<div class="header">
  <span class="from">${email.sender}</span>
  
  <span class="date">
    <span class="float-right"></span>${email.timestamp}
  </span>
</div>

<div class="title">${email.subject}</div>

<div class="description">${email.body}</div>

Your querySelector for actionDivArchiveBtn is incorrect. Because you search by id but in layout it is class so I changed in layout class to id and now it works. But may be you need class in layout then change # to . in querySelector:

function load_mailbox(string) {
  console.log(string);
}

function addElements(mailbox) {
  if (mailbox != 'sent') {
    let actionDivArchiveBtn = document.querySelector('#actions')
    let archiveButton = document.createElement("button");
    archiveButton.classList.add('archive');
    archiveButton.innerHTML = `SOME TEXT<i class="fa fa-archive" aria-hidden="true"></i>`
    actionDivArchiveBtn.appendChild(archiveButton);

    archiveButton.addEventListener('click', () => {
      if (email.archived === false) {
        actionDivArchiveBtn.style.color = "blue";
        fetch(`/emails/archive/${id}`, {
          method: 'PUT',
          body: JSON.stringify({
            archived: true
          })
        })
      } else {
        actionDivArchiveBtn.style.color = "black";
        fetch(`/emails/archive/${id}`, {
          method: 'PUT',
          body: JSON.stringify({
            archived: false
          })
        })
      }
    })
  }
  load_mailbox('inbox');
}

addElements('receive');
<div id="actions">
  <span class="action"><i class="fa fa-reply" aria-hidden="true"></i></span>
</div>

<div class="header">
  <span class="from">${email.sender}</span>
  
  <span class="date">
    <span class="float-right"></span>${email.timestamp}
  </span>
</div>

<div class="title">${email.subject}</div>

<div class="description">${email.body}</div>

按钮未显示使用JS动态添加到页面

痴情 2025-02-02 12:43:42

您不应断言异常消息(除非它们面信给用户,否则依赖于这些消息)。
如果抛出异常是合同的一部分,那么您应该将一种带有给定错误代码的特定类型之一扔出,并且应该断言这一点。如果不是,那么谁在乎消息说的话?

You should not be asserting exception messages (unless they are surfced to the user, or something downndstream relies on them).
If throwing an exception is a part of contract, then you should be throwing one of a specific type with a given error code, and tests should be asserting that. And if it isn't, then who cares what the message said?

Scala测试:如何在不进行硬编码的情况下安全地断言异常消息?

痴情 2025-02-02 12:07:55
  • V 2 初始化。
  • 表达式 v ++ 增量 v to 3 ,然后返回 2
  • 语句 var v = v ++; 分配 2 to v (覆盖 3 in v 使用 2 V ++ 返回)。
  • console.log(v)打印 2
  • v is initialized with 2.
  • The expression v++ increments v to 3 and then returns 2.
  • The statement var v = v++; assigns 2 to v (overwrites the 3 in v with the 2 returned from v++).
  • console.log(v) prints 2

JavaScript中的好奇双var案例

痴情 2025-02-01 21:11:37

长期,您想要的是使用GIT工作室。

为了修复您当前的情况,您可以通过从本地目录创建遥控器来挑选回购之间的挑选。

通过将另一个本地存储库作为遥控器添加并进行 git提取,您可以将您想要的任何提交挑选出您想要的任何提交。

例如,如果您想从 old_clone 中挑选以 e9bee1bc 开始的sha consit:

cd /projects/new_clone
git remote add old_clone /projects/old_clone
git fetch old_clone
git cherry-pick e9bee1bc

您也可以使用类似的策略将多个克隆的远程转换为工作者。例如,如果您想从原始项目创建一个工作室,并从 branch1 new_clone 添加本地副本到新的Worktree:

cd /projects/original
git worktree add /projects/worktree_1
cd /projects/worktree_1
git remote add new_clone /projects/new_clone
git fetch new_clone
git switch -c branch1 new_clone/branch1

Long term, what you want is to use git worktrees.

In order to repair your current situation, you can cherry-pick between repos by creating remotes from your local directories.

By adding another local repo as a remote and doing a git fetch, you can cherry-pick any commit you want from that repo with just the SHA.

For example, if you want to cherry-pick the commit from old_clone with a SHA starting with e9bee1bc:

cd /projects/new_clone
git remote add old_clone /projects/old_clone
git fetch old_clone
git cherry-pick e9bee1bc

You could also use a similar strategy to convert your multiple cloned remotes into worktrees. For example, if you want to create a worktree from your original project and add a local copy of branch1 from new_clone to your new worktree:

cd /projects/original
git worktree add /projects/worktree_1
cd /projects/worktree_1
git remote add new_clone /projects/new_clone
git fetch new_clone
git switch -c branch1 new_clone/branch1

我如何在不是工作室而是从同一遥控器克隆的本地存储库之间的提交?

痴情 2025-02-01 20:29:47

您现在可以使用此

不需要CLI,您只需要使用此Docker Image MongoDB/Mongodb-atlas-local

You can easily do that now with this https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-deploy-docker/.

No CLI needed, you only have to use this docker image mongodb/mongodb-atlas-local

Docker中的Mongo Atlas搜索索引

痴情 2025-02-01 20:16:03

是的,从技术上讲,这是绝对正确的。

我建议您将您的模式变成三州。轻,黑暗和系统默认。

当我将设备设置为Dark Mode时,我希望所有应用程序默认情况下使用DAMM模式。我不想打开所有37个应用程序并找到设置并单独切换。默认值应该是,如果我没有明确设置它,它将从我在系统设置中设置的值中获取值。

Yes, technically, this is absolutely correct.

I would suggest you make your mode a three-state. Light, Dark and System Default.

When I set my device to dark mode, I want all my apps to go to dark mode by default. I don't want to open all 37 apps and find the setting and switch them individually. The default should be that if I have not set it explicitely, it will take the value from what I have set in my system settings.

用集团切换主题。我在做对吗?

痴情 2025-02-01 19:44:56

选项1:将新方法分配给现有枚举

确实简单地将方法分配给 foo 有效吗?

foo.catch = lambda self = none:print(如果self是没有其他“ mr_t”的话,如果self是foo.mr_t else't else“ ka-bong”)

如果不是,为什么?它确实像一种方法一样行事,并且如果该方法是从成员调用的,则“自我”将被“ foo”成员填充。

如果您想从Python创建类的机制和“类”语句语法中受益,那么使用“ Pseudo” Metaclass:可召唤的可呼叫,可以占用类主体的内容,以及名称和基础, - 它可以只需将新创建的方法和属性添加到现有枚举类别:

def EnumMixinExtender(name, bases, ns):
    original = bases[0]
    for k, v in ns.items():
        setattr(original, k, v)
    return original

这将使您在

class MixinFoo(Foo, metaclass=EnumMixinExtender):
   def catch_phrase(self=None):
        ...

此选项的情况下扩展 foo mixInfoo.member1是foo.member1 :foo类是猴子修补的 - 无需关心导入顺序:使用“ foo”的每个人都可以使用“ catch_phrase”。

选项2 -mixInfoo!= foo:

如果必须保留独特的 foo 类,并且需要 foo.member1不是mixinfoo.member.member1 sovererts true true-伪 - 米特类是倒转事物,并创建 foo 的副本,该副本将从Mixin中定义的新类成员中得出。 Metaclass代码只能以相反的顺序来实现,以便枚举类稍后出现。

def ReverseMixinAdder(name, bases, ns):
    pre_bases = tuple(base for base in bases if not isinstance(base, enum.EnumMeta))
    pos_bases = tuple(base for base in bases if isinstance(base, enum.EnumMeta))

    new_mixin = type(f"{name}_mixin", pre_bases, ns)
    member_space = {}
    for base in pos_bases:
        member_space |= {k: v.value for k, v in base.__members__.items()}
    new_enum = Enum(name, member_space, type=new_mixin )
    return new_enum

只需将其用作上面的元素,您就会获得一个独立的“ MixInfoo”类,可以将其传递并独立于FOO。缺点是,不仅其成员“不是” foo成员,只有副本,而且MixInfoo根本不会是一个子类或其他与Foo相关的子类。

(顺便说一句,只需忽略允许一个人使用的机制,如果您不使用它们,则可以合并多个枚举。我也没有测试过该部分)

选项3 -mixInfoo!= foo,但是IssubClass(MixInfoo,foo):

如果必须将mixInfoo作为foo的一个独特类,并且仍然具有 mixInfoo.member1是foo.member1 issubClass(mixinfoo,foo) soverert true,

好吧...当人们尝试使用Mixin方法扩展枚举时,我们拥有:

    565                 if issubclass(base, Enum) and base._member_names_:
--> 566                     raise TypeError(

确保这是一个实现细节 - 但是此时所有的Enummeta检查都是... Member_names - 恰好是可分配的。

如果一个人简单地将虚假值分配给“ foo。 member_names ”,则可以随意通过额外的mixin方法和普通属性进行子分类。 ._ Member_names _ 以后可以还原。

这样做,这些断言存在: foomixin.member1是foo.member1 foomixin不是foo , issubclass(foomixin,foomixin,foo)。但是,新方法不能直接在成员上调用 - 也就是说,在前两个选项中,一个可以执行 foomixin.member1.catch_phrase(),因为成员枚举保持 class 没有新方法,不起作用。 (解决方法是 foomixin.catch_phrase(foomixin.member1 )。

如果有人希望这最后一部分起作用,则foo.members可以拥有其类__ class __ class __ 属性更新为 foomixin - 它将起作用,但是原始的 foo.members 也已更新Intherplo

class MetaMixinEnum(enum.EnumMeta):
    registry = {}

    @classmethod
    def _get_enum(mcls, bases):
        enum_index, member_names = next((i, base._member_names_) for i, base in enumerate(bases) if issubclass(base, Enum))
        return bases[enum_index], member_names

    @classmethod
    def __prepare__(mcls, name, bases):
        base_enum, member_names = mcls._get_enum(bases)
        mcls.registry[base_enum] = member_names
        base_enum._member_names_ = []
        return super().__prepare__(name, bases)

    def __new__(mcls, name, bases, ns):
        base_enum, _  = mcls._get_enum(bases)
        try:
            new_cls = super().__new__(mcls, name, bases, ns)
        finally:
            member_names = base_enum._member_names_ = mcls.registry[base_enum]
        new_cls._member_names_ = member_names[:]
        for name in member_names:
            setattr(getattr(new_cls, name), "__class__", new_cls)
        return new_cls


class FooMixin(Foo, metaclass=MetaMixinEnum):
    def catch_phrase(self):
        ...

Option 1: assign new methods to existing Enum

Does simply assigning a method to Foo works?

Like in Foo.catch = lambda self=None: print(Foo if self is None else "MR_T" if self is Foo.MR_T else "Ka-bong")

If not, why? It does behave, for all purposes as a method would, and "self" is filled with the "Foo" member if the method is called from the member.

If you want to benefit from Python's mechanism for creating classes and the "class" statement block syntax, this is easily feasible with a "pseudo" metaclass: a callable that will take in the contents of the class body, along with the name and bases - it can them just add the newly created methods and attributes to the existing Enum class:

def EnumMixinExtender(name, bases, ns):
    original = bases[0]
    for k, v in ns.items():
        setattr(original, k, v)
    return original

This will allow you to extend Foo in place with

class MixinFoo(Foo, metaclass=EnumMixinExtender):
   def catch_phrase(self=None):
        ...

With this option, MixinFoo is Foo and MixinFoo.member1 is Foo.member1: the Foo class is monkey patched in place - no need to care about import order: everyone using "Foo" can use "catch_phrase".

Option 2 - MixinFoo != Foo:

If one must preserve a distinct Foo class and need that Foo.member1 is not MixinFoo.member1 asserts True - the way out, still using a pseudo-metaclass is to invert things, and create a copy of Foo that would derive from the new class-members defined in the Mixin. The metaclass code just does that in the reversed order, so that the Enum class comes later into the mix.

def ReverseMixinAdder(name, bases, ns):
    pre_bases = tuple(base for base in bases if not isinstance(base, enum.EnumMeta))
    pos_bases = tuple(base for base in bases if isinstance(base, enum.EnumMeta))

    new_mixin = type(f"{name}_mixin", pre_bases, ns)
    member_space = {}
    for base in pos_bases:
        member_space |= {k: v.value for k, v in base.__members__.items()}
    new_enum = Enum(name, member_space, type=new_mixin )
    return new_enum

Just use that as the metaclas, like above, and you get an independent "MixinFoo" class, that can be passed around and used independent from Foo. The drawback is that not only its members "are not" Foo members, just copies, but MixinFoo won't be a subclass or otherwise related to Foo at all.

(btw, just ignore the mechanisms allowing one to merge more than one Enum if you won't use them. I had not tested that part either)

Option 3 - MixinFoo != Foo, but issubclass(MixinFoo, Foo):

If one must have MixinFoo as a distinct class from Foo and still have MixinFoo.member1 is Foo.member1 and issubclass(MixinFoo, Foo) to assert True,

Well... looking into the traceback when one tries to extend an Enum with mixin methods we have:

    565                 if issubclass(base, Enum) and base._member_names_:
--> 566                     raise TypeError(

Sure this is an implementation detail - but all EnumMeta checks at this point is... member_names - which happens to be assignable.

If one simply assigns a falsey value to "Foo.member_names", it can be subclassed, with extra mixin methods and ordinary attributes at will. The ._member_names_ can be restored afterwards.

Doing this, these assertions hold: FooMixin.member1 is Foo.member1, FooMixin is not Foo, issubclass(FooMixin, Foo). However, the new methods can not be called directly on the members - that is, in the previous two options one can do FooMixin.member1.catch_phrase(), while under this, as the member enum keeps the class Foo which does not have the new method, that does not work. (The workaround is FooMixin.catch_phrase(FooMixin.member1) .

If one wants this last part to work, Foo.members can have their __class__ attribute updated to FooMixin - and it will work, but then the original Foo.members are updated inplace as well.

I have the intuition this final form is what you are really asking for here -

class MetaMixinEnum(enum.EnumMeta):
    registry = {}

    @classmethod
    def _get_enum(mcls, bases):
        enum_index, member_names = next((i, base._member_names_) for i, base in enumerate(bases) if issubclass(base, Enum))
        return bases[enum_index], member_names

    @classmethod
    def __prepare__(mcls, name, bases):
        base_enum, member_names = mcls._get_enum(bases)
        mcls.registry[base_enum] = member_names
        base_enum._member_names_ = []
        return super().__prepare__(name, bases)

    def __new__(mcls, name, bases, ns):
        base_enum, _  = mcls._get_enum(bases)
        try:
            new_cls = super().__new__(mcls, name, bases, ns)
        finally:
            member_names = base_enum._member_names_ = mcls.registry[base_enum]
        new_cls._member_names_ = member_names[:]
        for name in member_names:
            setattr(getattr(new_cls, name), "__class__", new_cls)
        return new_cls


class FooMixin(Foo, metaclass=MetaMixinEnum):
    def catch_phrase(self):
        ...

创建后,将混合蛋白添加到Python枚举中?

痴情 2025-02-01 15:53:31

每个文档从这里

有一种“简单”的案例表达式,是上述一般形式的变体:

CASE expression
    WHEN value THEN result
    [WHEN ...]
    [ELSE result]
END

计算第一个表达式,然后将其与wher whes ense等于它等于它的每个值表达式进行比较。如果找不到匹配,则返回其他子句(或null值)的结果。这类似于c。

中的开关语句

这在您的情况下转化为:

SELECT
    CASE extract('quarter' FROM now())
    WHEN 1 THEN
        'winter'
    WHEN 2 THEN
        'spring'
    WHEN 3 THEN
        'summer'
    WHEN 4 THEN
        'fall'
    END;

 case  
--------
 spring

Per documentation from here CASE:

There is a “simple” form of CASE expression that is a variant of the general form above:

CASE expression
    WHEN value THEN result
    [WHEN ...]
    [ELSE result]
END

The first expression is computed, then compared to each of the value expressions in the WHEN clauses until one is found that is equal to it. If no match is found, the result of the ELSE clause (or a null value) is returned. This is similar to the switch statement in C.

This translates in your case to:

SELECT
    CASE extract('quarter' FROM now())
    WHEN 1 THEN
        'winter'
    WHEN 2 THEN
        'spring'
    WHEN 3 THEN
        'summer'
    WHEN 4 THEN
        'fall'
    END;

 case  
--------
 spring

创建一个postgresql函数,该功能返回字符串&#x27; fall&#x27;,&#x27; spring&#x27;取决于年份

痴情 2025-02-01 07:24:17

这取决于应渲染标题和页脚组件的几页。
如果您只想在几页上渲染它们,最简单的解决方案将是将它们移至您想要渲染的组件/页面。

如果您只想将它​​们隐藏在一个或两个地方,则可以使用 useroutematch 钩子。

您还可以构建一些摘要来简化可读性:让我们制作布局组件,该组件将接受Prop(例如 renderheadsheaderanderandfooter (您可以更改当然的名称

That depends on how many pages should render the Header and Footer components.
If you want to render them on just a few pages, the simplest solution will be to move them to the components/pages where you'd like to render them.

If you'd like to hide them in just one or two places you can use the useRouteMatch hook.

You can also build some abstractions to simplify the readability a bit: let's make the Layout component, which will accept a prop (like renderHeaderAndFooter (you can change the name of course ????)).

Layout component:

const Layout = ({ renderHeaderAndFooter, children }) => (
  <div>
    {renderHeaderAndFooter && (
      <Header />
    )}
    {children}
    {renderHeaderAndFooter && (
      <Footer />
    )}
  </div>
)

and the place of usage:

const HomeScreen = () => (
  <Layout renderHeaderAndFooter={true}>
    // make stuff
  </Layout>
)
const Invoices = () => (
  <Layout renderHeaderAndFooter={false}>
    // make stuff
  </Layout>
)

如何隐藏某些路线的某些组件

痴情 2025-02-01 05:29:57

毕色库图书馆的问题是问题,当我将每个“蓝牙”更改为“插座”时,它可以正常工作。

It was problem with Pybluez Library, when I changed every "bluetooth" to a "socket", it work as it have to work.

通过pip安装毕色和导入的麻烦

痴情 2025-01-31 16:43:30

指定您要编辑的代码的哪一部分是有帮助的,尤其是当事物以不同的语言命名时。据我了解,您需要做的就是这样:

for fila in range(len(lista_nodos)):
    for columna in range(len(lista_nodos)):
        if fila == columna:
            valor = 0
        else:
            valor = int(input("Ingrese valor de nodo " +lista_nodos[fila]+" con el nodo " +lista_nodos[columna]+ ":"))
    
        while(valor < 0):
            print("ERROR: Valor negativo. Ingrese un valor positivo")
            valor = int(input("Ingrese valor de nodo " +lista_nodos[fila]+" con el nodo " +lista_nodos[columna]+ "(si el valor pertenece a la diagonal (i=j) ingresar un 0):"))
    
        pagina.cell(row = fila+2, column = columna+2, value = valor)
            

it would have been helpful to specify which portion of the code you want to edit, especially when things are named in a different language. From what I understand, all you need to do is this:

for fila in range(len(lista_nodos)):
    for columna in range(len(lista_nodos)):
        if fila == columna:
            valor = 0
        else:
            valor = int(input("Ingrese valor de nodo " +lista_nodos[fila]+" con el nodo " +lista_nodos[columna]+ ":"))
    
        while(valor < 0):
            print("ERROR: Valor negativo. Ingrese un valor positivo")
            valor = int(input("Ingrese valor de nodo " +lista_nodos[fila]+" con el nodo " +lista_nodos[columna]+ "(si el valor pertenece a la diagonal (i=j) ingresar un 0):"))
    
        pagina.cell(row = fila+2, column = columna+2, value = valor)
            

我如何将请求矩阵的对角线修改为i = j的零

更多

推荐作者

佚名

文章 0 评论 0

今天

文章 0 评论 0

゛时过境迁

文章 0 评论 0

达拉崩吧

文章 0 评论 0

呆萌少年

文章 0 评论 0

孤者何惧

文章 0 评论 0

更多

友情链接

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