将disableAutoFocus = {true}
属性添加到任何popover
或依靠popover的任何其他组件都应防止任何滚动怪异。您可能还需要使用disableenforcefocus
,具体取决于您想要的行为。这些是来自modal
组件的道具(其中popover
是): https://mui.com/material-ui/api/modal/
我只是跑了在iframe中使用&lt;菜单 /&gt; < /code>时,将其纳入类似的问题,该< /&gt; < /code>在打开时会导致浏览器滚动页面并专注于iframe。在此
&lt;菜单/&gt;
的情况下,我还必须将autofocusItem添加到
menulistprops
,所以这些是我的相关道具:
<Menu
MenuListProps={{
autoFocusItem: false,
}}
disableAutoFocus
/* other props */
>
{/* MenuList components */}
</Menu>
最简单的解决方案是创建JavaScript函数,并为AJAX Success
回调称其为调用。
function callServerAsync(){
$.ajax({
url: '...',
success: function(response) {
successCallback(response);
}
});
}
function successCallback(responseObj){
// Do something like read the response and show data
alert(JSON.stringify(responseObj)); // Only applicable to a JSON response
}
function foo(callback) {
$.ajax({
url: '...',
success: function(response) {
return callback(null, response);
}
});
}
var result = foo(function(err, result){
if (!err)
console.log(result);
});
问题是row ['startts']&lt; data ['startts']&lt;行['endts']
,您可以使用
data['startTS'].between(row['startTS'], row['endTS'], inclusive='neither')
# or
(row['startTS'] < data['startTS']) & (df['startTS'] < row['endTS'])
使用您的下载文件,并将我的区域设置设置为德语(德国)
,我可以复制您的问题。
您需要告诉电源查询(这就是您使用data =&gt;从text/csv
操作中使用时使用的内容)源文件正在使用中心值。
为此:
- 当窗口打开时,而不是 load 选择变换数据。
- 当PQ编辑器打开时,选择
home =&gt;高级编辑器
- 更改第二行以读取:
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type},
{"Column2", type number}, {"Column3", type number}},"en-US")
- 请注意,我们已经更改了数据类型并在末尾添加了文化参数
- 这可以从UI完成。我会让你探索。
我的高级编辑器中的整个代码(由于语言而可能有所不同):
let
Source = Csv.Document(File.Contents("C:\Users\ron\Desktop\Invariants_at_QPs.txt"),[Delimiter=",", Columns=3, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type},
{"Column2", type number}, {"Column3", type number}},"en-US")
in
#"Changed Type"
结果的一部分:
我弄清楚了这个问题,正是相机出于神秘的原因在特定时间之前返回框架。
1-我尝试了没有套接字和线程的代码,以避免复杂性,因此主要问题是来自相机
2-启动应用程序之间的差异很小(thing time.time.time()),所以我现在发送从请求中,从主要应用程序到其他服务器的时间戳,因此该过程的序列现在看起来不错。
也许这取决于.env文件的路径,也取决于您执行脚本的方式。也许要运行的firebase命令(例如firebase servions - 仅函数
)在路径透视图中运行node Index.js
功能)。
换句话说,您需要确定主脚本的路径,然后确定.env
文件的相对路径,并将此路径设置为dotenv.config()。
您在另一个按钮内放一个按钮。从块按钮内的跨度中删除BTN BTN-primary
。
function toDefault() {
const btn = document.getElementById('submitBtn');
btn.innerHTML = '<span>Submit</span>';
}
实际上,所需的一切都是将线性scaleeffect
替换为自定义几何效果,该效应提供了必要的比例曲线(最初生长然后跌落)。
这是一种可能的方法的演示(用Xcode 13.4/ios 15.5)
主要部分:
struct JumpyEffect: GeometryEffect {
let offset: Double
var value: Double
var animatableData: Double {
get { value }
set { value = newValue }
}
func effectValue(size: CGSize) -> ProjectionTransform {
let trans = (value + offset * (pow(5, value - 1/pow(value, 5))))
let transform = CGAffineTransform(translationX: size.width * 0.5, y: size.height * 0.5)
.scaledBy(x: trans, y: trans)
.translatedBy(x: -size.width * 0.5, y: -size.height * 0.5)
return ProjectionTransform(transform)
}
}
用法
.modifier(JumpyEffect(offset: isPressed ? 0.3 : 0, value: isPressed ? 0.8 : 1))
在sapply
在其余列上循环。
sapply(c('Method2', 'Method3', 'Method4'), \(x)
cor.test(database[, 1], database[, x], method='spearman')[c('estimate', 'p.value')])
# Method2 Method3 Method4
# estimate 0.8787879 0.9272727 0.9030303
# p.value 0.001977059 0.0001301624 0.000880225
问题的逻辑说明是,当您启动程序时,OS中的当前工作目录不是包含您的node.html
文件的目录。因此,fs.ReadFileSync('node.html',“ utf8”);
仅在当前工作目录中查看的目录找不到目标文件。
正如您发现的那样,您可以通过构建一个更完整的路径来解决问题,该路径指定所需的实际目录,而不仅仅是普通文件名。您还可以在启动应用程序之前确保将当前的工作目录正确设置为服务器目录。
构建自己通往服务器目录的路径的通常方法是使用path.join()
:
fs.readFileSync(path.join(__dirname, 'node.html'), "utf8");
我将考虑与先前答案使用mask
和径向梯度。只需调整两个变量,直到获得所需的结果:
.box {
height:300px;
background: url(https://images.unsplash.com/photo-1581362508717-f542c1ecf295?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1651&q=80) center/cover;
-webkit-mask:
radial-gradient(var(--r1,100%) var(--r2,50%) at top ,white 79.5%,transparent 80%) top left,
radial-gradient(var(--r1,100%) var(--r2,50%) at bottom,transparent 79.5%,white 80%) top center,
radial-gradient(var(--r1,100%) var(--r2,50%) at top ,white 79.5%,transparent 80%) top right;
mask:
radial-gradient(var(--r1,100%) var(--r2,50%) at top ,white 79.5%,transparent 80%) top left,
radial-gradient(var(--r1,100%) var(--r2,50%) at bottom,transparent 79.5%,white 80%) top center,
radial-gradient(var(--r1,100%) var(--r2,50%) at top ,white 79.5%,transparent 80%) top right;
/* adjust the 150% to control the covered area, the bigger the value the bigger the area will be*/
-webkit-mask-size:33.4% 150%;
-webkit-mask-repeat:no-repeat;
mask-size:33.4% 150%;
mask-repeat:no-repeat;
}
<div class="box" style="--r1:130%;--r2:71.5%">
</div>
要理解技巧bask
background
:
.box {
height:300px;
background:
radial-gradient(var(--r1,100%) var(--r2,50%) at top ,red 79.5%,transparent 80%) top left,
radial-gradient(var(--r1,100%) var(--r2,50%) at bottom,transparent 79.5%,blue 80%) top center,
radial-gradient(var(--r1,100%) var(--r2,50%) at top ,red 79.5%,transparent 80%) top right;
mask:
radial-gradient(var(--r1,100%) var(--r2,50%) at top ,red 79.5%,transparent 80%) top left,
radial-gradient(var(--r1,100%) var(--r2,50%) at bottom,transparent 79.5%,blue 80%) top center,
radial-gradient(var(--r1,100%) var(--r2,50%) at top ,red 79.5%,transparent 80%) top right;
background-size:33.4% 150%;
background-repeat:no-repeat;
border:1px solid;
}
<div class="box" style="--r1:130%;--r2:71.5%">
</div>
将其应用于您的代码:
.hero-container {
background: url(https://images.unsplash.com/photo-1581362508717-f542c1ecf295?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1651&q=80) top/cover;
padding: 16.625rem 0;
-webkit-mask:
radial-gradient(var(--r1,160%) var(--r2,68.15%) at top ,white 79.5%,transparent 80%) top left,
radial-gradient(var(--r1,160%) var(--r2,68.15%) at bottom,transparent 79.5%,white 80%) top center,
radial-gradient(var(--r1,160%) var(--r2,68.15%) at top ,white 79.5%,transparent 80%) top right;
mask:
radial-gradient(var(--r1,160%) var(--r2,68.15%) at top ,white 79.5%,transparent 80%) top left,
radial-gradient(var(--r1,160%) var(--r2,68.15%) at bottom,transparent 79.5%,white 80%) top center,
radial-gradient(var(--r1,160%) var(--r2,68.15%) at top ,white 79.5%,transparent 80%) top right;
-webkit-mask-size:33.4% 140%;
-webkit-mask-repeat:no-repeat;
mask-size:33.4% 140%;
mask-repeat:no-repeat;
}
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.css">
<section class="hero-container position-relative">
<div class="container">
<div class="row">
<div class="col-md-7 col-xs-12">
<h1 class="mb-3">Lorem ipsum dolor sit amet</h1>
<p class="mb-4 text-white">Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet</p>
<button class="btn btn-secondary">Register My Club</button>
</div>
</div>
</div>
</section>
首先,您的XML应该是良好的。这就是为什么我添加了一个root元素
xml
<root>
<item>
<datapoint>5</datapoint>
</item>
<item>
<datapoint>4</datapoint>
</item>
<item>
<datapoint>6</datapoint>
</item>
<item>
<datapoint>8</datapoint>
</item>
<item>
<datapoint>9</datapoint>
</item>
</root>
xquery
for $x in /root/item[last()-1]/datapoint
return $x
输出
<datapoint>8</datapoint>
我也有一个类似的问题,需要比较不同维度椭圆的拟合错误。以下代码计算每个观测点和椭圆中心之间的角度。然后,它以相同的角度计算观测点和椭圆上的点之间的距离。添加所有点的距离,并通过除以点数来归一化。然后将平均距离除以椭圆的半偏轴,以计算相对于椭圆大小的误差距离。
import math
import numpy as np
from skimage.measure import EllipseModel
from matplotlib.patches import Ellipse
import matplotlib.pyplot as plt
# * * * * * * *
# Calculate the coordinates of the intersection point of the ellipse and the line
# * * * * * * *
def ellipse_line_intersection(Xc, Yc, L, W, phi, theta):
# Get semimajor and semiminor axes
a = L / 2
b = W / 2
# Calculate the parametric equations of the line
dx = a * np.cos(theta)
dy = a * np.sin(theta)
# Rotate the line to align the ellipse with the coordinate axes
cos_phi = np.cos(phi)
sin_phi = np.sin(phi)
x1_rot = (dx * cos_phi + dy * sin_phi)
y1_rot = (-dx * sin_phi + dy * cos_phi)
# Coefficients of the quadratic equation
A = (x1_rot / a) ** 2 + (y1_rot / b) ** 2
B = 2 * ((Xc * cos_phi + Yc * sin_phi - Xc * cos_phi - Yc * sin_phi) * x1_rot / a ** 2 +
(Xc * sin_phi - Yc * cos_phi - Xc * sin_phi + Yc * cos_phi) * y1_rot / b ** 2)
C = ((Xc * cos_phi + Yc * sin_phi - Xc * cos_phi - Yc * sin_phi) ** 2 / a ** 2 +
(Xc * sin_phi - Yc * cos_phi - Xc * sin_phi + Yc * cos_phi) ** 2 / b ** 2) - 1
# Solve the quadratic equation
discriminant = B ** 2 - 4 * A * C
if discriminant < 0:
return [] # No intersection
t1 = (-B + np.sqrt(discriminant)) / (2 * A)
t2 = (-B - np.sqrt(discriminant)) / (2 * A)
# Calculate the intersection points
x1 = Xc + dx * t1 # positive root
y1 = Yc + dy * t1
x2 = Xc + dx * t2 # negative root
y2 = Yc + dy * t2
return [(x1, y1), (x2, y2)]
# * * * * * * *
# Main program
# * * * * * * *
x1 = [710.804, 710.117, 709.565, 709.036, 707.839, 707.424, 706.889, 705.913, 705.037, 704.58, 703.758,704.105, 704.552, 704.833, 705.204, 706.027, 706.932, 708.041, 708.849, 709.379, 709.797, 710.272,710.494, 710.871, 711.033, 711.018, 710.804]
y1 = [493.076, 491.902, 491.409, 490.947, 490.396, 491.456, 491.887, 492.917, 494.022, 494.882, 496.085,496.934, 497.723, 498.17, 498.656, 498.929, 499.248, 499.156, 498.768, 498.487, 497.853, 497.212,496.753, 495.957, 495.003, 493.997, 493.076]
points = list(zip(x1,y1))
print(points)
a_points = np.array(points)
n1 = len(a_points)
calc_x = [0]*n1 # coordinates of points along the elliptical curve
calc_y = [0]*n1
x = a_points[:, 0]
y = a_points[:, 1]
ell = EllipseModel()
ell.estimate(a_points)
residuals = ell.residuals(a_points)
xc, yc, a, b, phi = ell.params # a and b are semimajor and semiminor axes, respectively
print(f' n1={n1}')
ddt = 1 # >0 for debugging
fitting_error = 0
n = 0
distance = 0
sum_of_error_distances = 0
while n < n1:
x_o = x[n] # observed x
y_o = y[n] # observed y
# Calculate theta (angle to the observed point) = arctan( (y-yc)/(x-xc) )
theta = math.atan2( (y_o - yc), (x_o - xc) )
if theta < 0 :
theta = math.radians(360) + theta # correct for quadrants III and IV
if ddt > 0 :
print(f'x_o[{n}]={x_o:,.4f} y_o[{n}]={y_o:,.4f} theta={theta:.4f} ({np.rad2deg(theta):.3f} deg.)')
# calculate predicted intersection point on elliptical curve based on theta
intersection_points = ellipse_line_intersection(xc, yc, 2*a, 2*b, phi, theta)
calc_x[n], calc_y[n] = intersection_points[0] # select only the positive solution
if ddt > 0:
print(f' calc_x[{n}]={calc_x[n]:.3f}, calc_y[{n}]={calc_y[n]:.3f}')
# distance between observed and predicted points
distance = math.sqrt((x_o - calc_x[n])**2 + (y_o - calc_y[n])**2)
sum_of_error_distances += distance
n = n + 1
average_error_distance = sum_of_error_distances/n
print(f'Average error distance = {average_error_distance:.4f}')
fitting_error = average_error_distance*100/b
# Percent average error distance relative to minor axis
print(f'Fitting error = {fitting_error:.4f}%')
print("center = ", (xc, yc))
print("angle of rotation = ", phi)
print("axes = ", (a,b))
print('residuals= ', residuals)
fig, axs = plt.subplots(2, 1, sharex=True, sharey=True)
axs[0].scatter(x,y)
axs[1].scatter(x, y)
axs[1].plot(calc_x, calc_y, 'x')
axs[1].scatter(xc, yc, color='red', s=100)
axs[1].set_xlim(x.min(), x.max())
axs[1].set_ylim(y.min(), y.max())
axs[0].set_title(f' points: {n1}, fitting error: {fitting_error:.3f}%')
ell_patch = Ellipse(xy=(xc, yc), width=2*a, height=2*b, angle=phi*180/np.pi, edgecolor='red', facecolor='none')
axs[1].add_patch(ell_patch)
plt.show()
好的,我在关于隐藏输入字段值的评论中是错误的。
我的意思是,这仍然是一个问题,但是除了您制作的JS代码错误外,它应该运行原样。
因此,首先,给我错误的印象是,您通常会根据我的要求提交一张表格,然后按照我的说法正确设置表格值,以便在提交时提供请求的数据。您制作了很多形式,一种是每次迭代的形式,这不是错误的,但是您所做的就是在OnClick事件中说,以始终激活网站上的第一种形式。即
document.forms[0]
,无论您单击什么,都将仅提交使用第一个隐藏输入字段的值。
如您所拥有的IF-ELSE条款,我不会依赖DOM中的表单索引,而是使用某些内容来创建每种表单唯一的ID,然后使用document.getElementById()获取确切的表单并提交。但是您已经给出了表格名称,因此您可以使用document.getElementsByname()或给出相同值的表单。
名称不需要唯一,ID应该。
只是一个小样本:
<form id="siCompeticion"+{{competicionAPI['id']}} ...>
<input type="hidden" name="something" value={{competicionAPI['id']}}>
<a href="#" onclick="javascript:document.getElementById("siCompeticion"+{{competicionAPI['id']}}).submit();return false;">CLICK ME</a>
</form>
在您的位置,我很可能会编写一些JS代码来执行Ajax请求,这很可能是使用jQuery。无论如何,我都会避免做出很多形式。
您为什么假设“访问者”的意思是“获取”?访问者只是一个通用术语,可提供某种访问该属性的访问。可以读取访问
(“ getter”),写入访问(“ setter”)或其他东西。事件也有登录器(添加和删除,尽管还有更多)。
配件比“与成员互动的方法”短,而不是“ Geters and Setters”。也许“ Geters and Setters”是您在这里寻找的东西。
最终,出于原因:这个概念需要一个名称来简化和形式化用法,这就是选择的单词。
Why are you assuming that "accessor" means "get"? Accessor is just a generic term that provides some kind of access to the property. That could be read access
("getter"), write access ("setter"), or something else. Events also have accessors (add and remove, although more are possible).
Accessors is simply shorter than "methods for interacting with the member", and more generic than "getters and setters". Maybe "getters and setters" is the thing you're looking for here.
Ultimately, though, for reasons: the concept needed a name to simplify and formalize usage, and that was the word that was chosen.
c#为什么属性的获取和设置方法都称为访问者,但不称为登录器和突变器?