使用以下步骤解决了问题:
- 注销注册状态失败的设备
- 将键盘和显示器连接到相机,并使用我在初始注册尝试期间创建的密码登录(如果您尚未设置该密码,则使用默认密码)应该是 aws-cam)
- 在相机上打开 cmd 并运行以下命令来更新它:
sudo apt-get update
sudo apt-get install awscam
须藤重新启动
- 相机重新启动后,我将一根大头针插入相机的重置孔中,
- 重新进行了注册过程,成功了
require('dotenv').config();
const LocalStrategy = require('passport-local').Strategy;
const mysql = require('mysql');
const bcrypt = require('bcrypt');
const db = require('../models/database');
// this method keeps the server connected to db
mysql.createConnection({
host: "hostname", // localhost or remote hostname
username: "your_username",
password: "your_password",
port: "port_number_used_for_db"
});
这里需要注意的是,模糊背景是图像本身的延伸。因此,如果屏幕的左侧具有紫色色调,则左上角的模糊区域也将是紫色的。
您可以使用像 Blurry 这样的库,它会模糊屏幕内容,然后将其设置为背景。您可以控制所需的模糊量。
一旦获得模糊图像,请将其设置为容器布局的背景并将图片设置在前面,
例如:
val bitmap = Blurry.with(this)
.radius(10) // make it more if you want the lue to be more
.sampling(8)
.capture(findViewById(R.id.right_bottom)).get() // get the view you want to blur
imageView.setImageDrawable(BitmapDrawable(resources, bitmap)) // set the value to the background
也许他不是您想要的解决方案,而是一种方法。如果您只是将 ul
扩展几个像素并隐藏溢出内容,您将能够滚动并且根本看不到任何滚动条。
正如我所说,也许不是解决方案,但我有时在我的项目中应用过并且效果很好。你总是可以使用一些滚动条插件,但如果你想在平面CSS中使用它,我认为这是更接近的解决方案。希望对您有帮助。
.parent {
display: flex;
flex-flow: row warp;
justify-content: flex-start;
}
.content {
flex: 1 0 0%;
background: brown;
}
.sidebar {
flex: 0 0 20%;
height: 200px;
overflow: hidden;
}
.sidebar ul {
width: calc(100% + 25px);
height: 100%;
list-style: none;
margin: 0;
padding: 0 10px;
background: red;
overflow: hidden;
overflow-y: scroll;
}
.sidebar ul li {
padding: 5px 10px;
padding-right: 35px;
}
.sidebar ul li a {
display: inline-block;
}
<div class='parent'>
<div class='sidebar'>
<ul>
<li>
<a href="">ELEMENT 1</a>
</li>
<li>
<a href="">ELEMENT 2</a>
</li>
<li>
<a href="">ELEMENT 3</a>
</li>
<li>
<a href="">ELEMENT 4</a>
</li>
<li>
<a href="">ELEMENT 5</a>
</li>
<li>
<a href="">ELEMENT 6</a>
</li>
<li>
<a href="">ELEMENT 7</a>
</li>
<li>
<a href="">ELEMENT 8</a>
</li>
<li>
<a href="">ELEMENT 9</a>
</li>
</ul>
</div>
<div class='content'>
hello
</div>
</div>
我还清理了你的代码,因为你有一些不必要的 DOM 元素,至少对于这个例子来说是这样。
我的非常相似,但我宁愿以不同的方式使用 Suspense
<Suspense fallback={null}>
<Model src={src} containerRef={containerRef.current} />
</Suspense>
另外,我添加了一个错误边界以防止由于渲染而导致任何崩溃
import { withErrorBoundary } from 'react-error-boundary';
// ...
export default withErrorBoundary(ModelViewer, {
FallbackComponent: () => (<div>An error occured</div>),
onError: (err: Error, info: {componentStack: string}) => console.error(err, info),
});
发生的情况是,您生成了构建的应用程序,但没有捆绑它(使用 --directory
标志)。
因此,您的文件结构中有额外的 JS 文件。
在您的尝试中,它们与您的 Meteor 项目结构混合在 build
文件夹中(当您使用命令 meteor build build --directory
时)或直接合并(>meteor build .. --directory
)。
因此,在下一次构建运行时,Meteor 会选择这些额外的 JS 文件,就好像它们是源代码的一部分(热切加载)一样,但会失败,如警告消息中所示:
输出目录位于源代码树下。
您生成的文件可能会被解释为源代码!
考虑构建到不同的目录中
流星构建../输出
如果您指定了显式同级构建文件夹,而不仅仅是父文件夹(因此将文件直接放在 Meteor 项目根目录中),例如 meteor build ,那么它会在您的下一次尝试中起作用。 ./siblingFolder
另一种可能的解决方法是使用以点 .
开头的构建文件夹名称,以便 Meteor 在下次运行时查找源代码时忽略它,例如 流星建造./.build
请参阅特殊目录文档:
以下目录也不会作为应用代码的一部分加载:
- 名称以点开头的文件/目录,例如
.meteor
和.git
此问题已在谷歌地图最新版本 18 或更高版本中解决
implementation 'com.google.android.gms:play-services-maps:18.1.0'
try {
MapsInitializer.initialize(getApplicationContext(), MapsInitializer.Renderer.LATEST, this);
} catch (Exception e) {
Log.e(TAG, "onCreate: " + e.getMessage(), e);
}
正如 Felix 评论的那样,最好的方法可能是首先使用正则表达式提取数字,然后将它们解析为浮点数:
var x = ".175\" x 2.5\" x 144\""; // .175" x 2.5" x 144"
let numbers = x.match(/(\d*\.)?\d+/g).map(n => parseFloat(n))
var thickness = numbers[0]
var width = numbers[1]
var length = numbers[2]
console.log('thickness: ' + thickness)
console.log('width: ' + width)
console.log('length: ' + length)
请注意为什么要混合使用 jQuery
和 javascript
,但请尝试以下方式:
$(function() {
const focusInputs = $("input.focusbox");
focusInputs.change(function() {
var checked = focusInputs.filter(function() {
return $(this).is(":checked")
})
var colors = checked.map(function() {
return $(this).parent().text()
}).get()
if (colors.length == 0) {
$('#colors tr').show();
} else {
$('#colors tr').hide();
$('#colors tr').filter(function() {
return $.inArray($(this).find(".entry4").text(), colors) > -1
}).show();
}
});
});
演示
$(function() {
const focusInputs = $("input.focusbox");
focusInputs.change(function() {
var checked = focusInputs.filter(function() {
return $(this).is(":checked")
})
var colors = checked.map(function() {
return $(this).parent().text()
}).get()
if (colors.length == 0) {
$('#colors tr').show();
} else {
$('#colors tr').hide();
$('#colors tr').filter(function() {
return $.inArray($(this).find(".entry4").text(), colors) > -1
}).show();
}
});
});
body {
font-size: 10px;
}
ul,
li {
list-style-type: none;
margin: 0;
padding: 0;
}
table#colors {
margin-top: 5px;
}
table#colors tbody tr td.entry2 {
width: 200px;
}
.cf-circle {
width: 20px;
height: 20px;
border-radius: 50%;
border: 1px solid #C8C8C8;
-webkit-transition: border-radius 1s, width 1s, height 1s;
transition: border-radius 1s, width 1s, height 1s;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.0/jquery.min.js"></script>
<ul>
<li><label class="focusbox-label"><input class="focusbox" type="checkbox" checked />White</label>
</li>
<li>
<label class="focusbox-label"><input class="focusbox" type="checkbox" />Red</label>
</li>
<li>
<label class="focusbox-label"><input class="focusbox" type="checkbox" />Orange</label>
</li>
</ul>
<table id="colors">
<tbody>
<tr class="head-row">
<th class="table-cell cYellow c1 entry1">Color</th>
<th class="table-cell cYellow c1 entry2">Name</th>
<th class="table-cell cYellow c1 entry3">HTML Color Code</th>
<th class="table-cell cYellow c1 entry4">Shade Group</th>
</tr>
<tr class="s1">
<td class="table-cell entry1">
<div class="color-field cf-default cf-circle" style="background-color: #FFFFFF;"></div>
</td>
<td class="table-cell entry2">White</td>
<td class="table-cell entry3">#FFFFFF</td>
<td class="table-cell entry4">White</td>
</tr>
<tr class="s1">
<td class="table-cell entry1">
<div class="color-field cf-default cf-circle" style="background-color: #F7E7CE;"></div>
</td>
<td class="table-cell entry2">Champagne</td>
<td class="table-cell entry3">#F7E7CE</td>
<td class="table-cell entry4">White</td>
</tr>
<tr class="s1">
<td class="table-cell entry1">
<div class="color-field cf-default cf-circle" style="background-color: #ED2839;"></div>
</td>
<td class="table-cell entry2">Red (Pantone)</td>
<td class="table-cell entry3">#ED2839</td>
<td class="table-cell entry4">Red</td>
</tr>
<tr class="s1">
<td class="table-cell entry1">
<div class="color-field cf-default cf-circle" style="background-color: #ED1B24;"></div>
</td>
<td class="table-cell entry2">Red (CMYK) (pigment red)</td>
<td class="table-cell entry3">#ED1B24</td>
<td class="table-cell entry4">Red</td>
</tr>
<tr class="s1">
<td class="table-cell entry1">
<div class="color-field cf-default cf-circle" style="background-color: #FF8200;"></div>
</td>
<td class="table-cell entry2">UT orange</td>
<td class="table-cell entry3">#FF8200</td>
<td class="table-cell entry4">Orange</td>
</tr>
<tr class="s1">
<td class="table-cell entry1">
<div class="color-field cf-default cf-circle" style="background-color: #FF8000;"></div>
</td>
<td class="table-cell entry2">Orange (wheel)</td>
<td class="table-cell entry3">#FF8000</td>
<td class="table-cell entry4">Orange</td>
</tr>
</tbody>
</table>
首先,我们需要编辑我们想要从 makeData 函数返回的内容,为此,我们应该编辑 newPerson 并添加 url、firstNameUrl 和 lastNameUrl。这为我们设置了三个新的访问器
const newPerson = () => {
const statusChance = Math.random();
return {
firstName: namor.generate({ words: 1, numbers: 0 }),
lastName: namor.generate({ words: 1, numbers: 0 }),
age: Math.floor(Math.random() * 30),
visits: Math.floor(Math.random() * 100),
progress: Math.floor(Math.random() * 100),
url: " www.google.com",
firstNameUrl: namor.generate({ words: 1, numbers: 0 }),
lastNameUrl: namor.generate({ words: 1, numbers: 0 }),
status:
statusChance > 0.66
? "relationship"
: statusChance > 0.33
? "complicated"
: "single"
};
};
现在我们有了新的数据键,我们可以简单地告诉react-table通过编辑列useMemo来渲染什么
const columns = React.useMemo(
() => [
{
Header: "Name",
columns: [
{
Header: "First Name",
accessor: "firstName"
},
{
Header: "Last Name",
accessor: "lastName"
}
]
},
{
Header: "Info",
columns: [
{
Header: "Age",
accessor: "age"
},
{
Header: "Visits",
accessor: "visits"
},
{
Header: "Status",
accessor: "status"
},
{
Header: "Profile Progress",
accessor: "progress"
}
]
},
{
Header: "Url",
columns: [
{
Header: "First Name",
accessor: "firstNameUrl"
},
{
Header: "Last Name",
accessor: "lastNameUrl"
},
{
Header: "Url",
accessor: "url"
}
]
}
],
[]
);
我已经编辑了codepen,你可以找到它这里
@Edit
如果你想渲染一个自定义组件,那么你可以像下面这样做:
{
Header: "Last Name",
accessor: "lastNameUrl",
Cell: (e) => <a href="https://google.com"> {e.value} </a>
}
这将渲染为链接元素与accessor 值 - 我还更新了 codepen
这应该有效:
A = [[0, 0, 0],
[0, 0, 1],
[0, 0, 2],
[0, 0, 3],
[0, 0, 4],
[0, 0, 5],
[0, 1, 0],
[0, 1, 1],
[0, 1, 2],
[0, 1, 3],
[0, 1, 4],
[0, 1, 5],
[0, 1, 6],
[0, 1, 7],
[0, 1, 8],
[0, 1, 9],
[0, 2, 0],
[0, 2, 1],
[0, 2, 2]]
B = [[1, 1, 2],
[0, 0, 2],
[0, 0, 1],
[4, 2, 2],
[3, 1, 2],
[1, 0, 1],
[1, 1, 2],
[0, 1, 2],
[0, 0, 0],
[2, 2, 3],
[1, 2, 1],
[0, 2, 1],
[0, 2, 0],
[0, 2, 1],
[0, 1, 3],
[0, 0, 0],
[1, 2, 5],
[0, 4, 3],
[0, 1, 3]]
nums = []
for i in A:
for j in B:
if i in B:
nums.append(str(i))
nums_freq = {}
nums = list(dict.fromkeys(nums))
for i in nums:
count = 0
for j in B:
if i == str(j):
if i in nums_freq.keys():
nums_freq[i] += 1
else:
nums_freq[i] = 1
num_freq
的值:
{'[0, 0, 0]': 2,
'[0, 0, 1]': 1,
'[0, 0, 2]': 1,
'[0, 1, 2]': 1,
'[0, 1, 3]': 2,
'[0, 2, 0]': 1,
'[0, 2, 1]': 2}
你的意思是直接读取文件?
因为您始终可以在读取文件后执行此操作:
ds = ds.sel(band = 1)
它应该返回仅包含 x 和 y 作为坐标的数据集。
我肯定希望能够看到您在第二张图片中显示的内容。您首先必须了解多处理池的工作原理:
List_NumberOfFiles
中有 N
个元素(因此需要提交 N
个任务)基于块的单个任务队列,该队列将根据池的大小 (20) 和 N
进行计算,因为您没有在调用时显式指定 chunksize 参数地图
。池中的每个进程在空闲时将从任务队列中池化队列中的下一个任务“块”并执行这些任务直到完成,然后获取下一个块,直到队列中没有更多块为止。如果所有 20 个进程同时执行完它们的最后一个块,那将是一个奇迹。相反,我希望看到一个最终进程继续执行最后一个块。
例如,假设 List_NumberOfFiles
中有 302 个元素 (N
= 300)。计算出的 chunksize 值为 4。这将产生 75 个大小为 4 的块,其中一个块大小为 2。即使假设每个任务花费大约相同的时间来处理,在 20 个进程完成其任务后前 3 个块,将留下 15 个全尺寸块和一个小块。这 16 个块将被 16 个进程获取,并且 4 个进程现在将永久空闲。获取小块的进程(即只有 2 个任务的进程)很快就会永久空闲。其余 15 个进程在完成全尺寸块的处理后将永久空闲。最有可能的情况是它们都将在不同的时间结束。
现在假设您已提交 20 个任务(List_NumberOfFiles
作为 20 个元素)。计算出的块大小将为 1,这使得分析变得更加简单。池中的每个进程只有一个任务需要处理,然后才会永久空闲。如果其中一项任务的处理时间恰好比其他任务长得多怎么办?花费的时间越长,您看到除一个进程之外的所有进程空闲的时间就越长。
文件requirements.txt如:
->我认为Flask版本> 2.0有这个错误!
file requirements.txt such as:
-> I think Flask version > 2.0 has this error!
Importerror:无法导入名称&#x27; markup&#x27;从jinja2&#x27;