问题列表 - 第280947页

导入React和ReactDOM

导入react和reactDOM时,我总是看到:

import React from 'react';
import ReactDOM from 'react-dom';
Run Code Online (Sandbox Code Playgroud)

我可以命名React和ReactDOM吗?

javascript reactjs

4
推荐指数
1
解决办法
690
查看次数

从 Azure DevOps 部署到应用服务环境

我们的子网中有 1 个内部ASE。在同一网络的不同子网中,我们部署了一台虚拟机,充当Azure DevOps Agent Windows v2

我们可以从访问此虚拟网络的计算机手动部署 Web 应用程序(使用 Visual Studio),但无法从 Azure DevOps 进行部署。

这是我们所做的

  • 存在默认 NSG 规则,因此在 80/443 端口上启用流量。更新了 NSG 以允许流量进出:13.107.6.18313.107.9.183(检查所有端口)
  • 管道任务添加标志-allowUntrusted

我们在部署过程中遇到的错误是:

More Information: Could not connect to the remote computer ("{myapp}.scm.{customdomain}.com"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
Error: Unable to connect to the remote server
Error: A connection attempt …
Run Code Online (Sandbox Code Playgroud)

azure azure-deployment azure-app-service-envrmnt azure-devops

3
推荐指数
1
解决办法
4834
查看次数

Perfectly vertical align top of fonts of 2 different text sizes using CSS

I want to achieve this design: 例

Note that both text are perfectly top aligned but I'm almost sure this is impossible to achieve in CSS in a scalable way (I mean not hardcoding pixels with position relative/top for example).

Using flex looked like a good way to achieve this but since this is text, the top alignment is correct but based on the text 'bounding box' but the letters '77' don't take up 100% height of that box, causing it …

html css

5
推荐指数
1
解决办法
69
查看次数

如何告诉 BabelJS 不要覆盖它

Babel 正在替换thisvoid 0我怎样才能防止这种行为?

我有这个代码:

((parent)=>{
  parent.something = {}
})(this)
Run Code Online (Sandbox Code Playgroud)

使用 babel 它呈现如下

(function (parent) {
  parent.something = {}
})(void 0);
Run Code Online (Sandbox Code Playgroud)

我需要这个

(function (parent) {
  parent.something = {}
})(this);
Run Code Online (Sandbox Code Playgroud)

我知道我可以使用self,但这并非在所有情况下都相同

webpack babeljs

3
推荐指数
1
解决办法
864
查看次数

Centering a div, margin: 0 auto; not working

After searching to center my div all I could get was margin: 0 auto; together with an assigned width, but still it not working.

My problem is simply centering a div. I have no idea why margin: 0 auto; isn't working.

Here is the layout of my CSS/html:

CSS

    .countdown-box {
       position: absolute;
       width: 80px;
       margin: 0 auto;
       height: 130px;
       /*left: 50%;*/
       background: #008040;
       border-radius: 4px;
       z-index: 2;
    }
Run Code Online (Sandbox Code Playgroud)
<div class="countdown-box"></div>
Run Code Online (Sandbox Code Playgroud)

html css

-1
推荐指数
1
解决办法
54
查看次数

TypeError:无法对“文档”执行“评估”:结果不是节点集,因此无法通过 Selenium 使用 Xpath 进行转换

部分页面来源:

<span style="display:block; overflow:hidden; white-space: nowrap">Gi2/0/20</span>
Run Code Online (Sandbox Code Playgroud)

部分代码:

from selenium import webdriver
...
driver = webdriver.Chrome()
...
IP_CLICK = browser.find_element_by_xpath('//span[@style="display:block; overflow:hidden; white-space: nowrap"]/text()="Gi2/0/20"').click()
Run Code Online (Sandbox Code Playgroud)

我尝试使用表达式在网页中选择一个元素xpath,但出现以下错误:

InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //span[@style="display:block; overflow:hidden; white-space: nowrap"]/text()="Gi2/0/20" because of the following error:
Run Code Online (Sandbox Code Playgroud)

TypeError:无法对“文档”执行“评估”:结果不是节点集,因此无法转换为所需的类型。(会话信息: chrome=72.0.3626.121) (驱动程序信息: chromedriver=73.0.3683.20 (8e2b610813e167eee3619ac4ce6e42e3ec622017),platform=Windows NT 6.1.7601 SP1 x86_64)

python selenium xpath xpath-1.0 selenium-webdriver

6
推荐指数
1
解决办法
2万
查看次数

How to read a memory dump in binary from GDB?

At the time of a crash I have a post crash handler where I try to dump whats in certain memory regions

auto memdump = std::fstream("FileMemDump.bin", std::ios::out | std::ios::binary);
auto memRegion = getMemoryRegion();
std::cout << "Memory region start: " << memRegion.start << " size: " << memRegion.size;
memdump.write((char*)memRegion.start, memRegion.size);
memdump.close();
Run Code Online (Sandbox Code Playgroud)

and after the file has created a core file So after I load the core in the following manner :

#gdb ./exec ./core.file
Run Code Online (Sandbox Code Playgroud)

I give the restore command; the start …

linux gdb c++11

5
推荐指数
0
解决办法
338
查看次数

如何在Mac终端中使“g”=“git”?

当我在终端中时,是否有办法设置命令的快捷方式?例如,如果我输入“g”,则它等于“git”,如果我输入“gs”,则它等于“git status”。ETC?

git macos terminal

0
推荐指数
1
解决办法
1457
查看次数

状态逻辑和React中的状态有什么区别?

我正在查看钩子文档,他们说得很清楚

这些组件的状态是完全独立的。挂钩是重用有状态逻辑而不是状态本身的一种方法。

我想弄清楚这两件事之间的区别。

state reactjs react-hooks

3
推荐指数
2
解决办法
382
查看次数

加载后如何在网站背景中绘制网格线?

我正在尝试为网站的背景制作动画,该背景具有坚实的背景,然后我想在其上“绘制”网格线。现在我有这样的背景:

background-color: #269;
background-image: linear-gradient(@light-grey 2px, transparent 2px),
    linear-gradient(90deg, @light-grey 2px, transparent 2px),
    linear-gradient(rgba(255, 255, 255, .3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .3) 1px, transparent 1px);
background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px;
Run Code Online (Sandbox Code Playgroud)

我希望它像这样,除了我希望线性梯度一个接一个地加载,并在可能的情况下使它们看起来像草绘的。

我尝试查看此代码: 页面加载时背景颜色发生变化

它似乎沿着我正在尝试的方式前进,但是我不希望整个背景发生变化,我只想绘制网格。

我还认为我可能需要使用它来使其在页面加载后绘制: JavaScript在页面加载后执行

我应该为线性渐变分配ID并在Javascript函数中调用它们吗?

javascript css gridlines linear-gradients css-animations

5
推荐指数
0
解决办法
68
查看次数