对于检查两个数组是否相等的我的equals方法,第一个方法"equals"是否实际检查两个数组是否相等还是仅测试内存地址?或者我应该包括两者?
public boolean equals(Object otherObject)
{
if (otherObject == null)
{
return false;
}
else if (getClass() != otherObject.getClass())
{
return false;
}
else
{
RegressionModel otherRegressionModel = (RegressionModel)otherObject;
return (xValues == (otherRegressionModel.xValues) && yValues == (otherRegressionModel.yValues));
}
}
Run Code Online (Sandbox Code Playgroud)
要么
public static boolean equalArrays(double[] x, double[] y)
{
if(x.length != y.length)
{
return false;
}
else
{
for(int index = 0; index < x.length; index++)
{
if (x[index] != y[index])
{
return false;
}
}
return true;
}
}
Run Code Online (Sandbox Code Playgroud) 我试图使这两个图形具有响应性,以便如果我突出显示一个选择并放大其中一个,另一个图形会在相同的日期放大。
例如,在我发布的第一张图片中,如果我在一个图表上放大 1 月,我希望另一个图表也在相同的日期范围内放大。
你可以在我所附的图片中看到我想要做什么。
谁能帮帮我吗?
import dash
import dash_core_components as dcc
import dash_html_components as html
import ssl
import pandas as pd
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
ssl._create_default_https_context = ssl._create_unverified_context
df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv")
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
colors = {
'background': '#111111',
'text': '#7FDBFF'
}
app.layout = html.Div(style={'backgroundColor': colors['background']}, children=[
html.H1(
children='graph1',
style={
'textAlign': 'center',
'color': colors['text']
}
),
html.Div(children='Displaying Apple High and Low.', style={
'textAlign': 'center',
'color': colors['text']
}),
dcc.Graph(
id='example-graph-2',
figure={
'data': [
{'y': df['AAPL.Open'], 'x': df['Date'], 'type': 'line', 'name': …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 codepen 中的代码。我所要做的就是复制 CSS 和 HTML 吗?另外,我需要添加SCSS吗?谢谢!
http://codepen.io/anon/pen/pbzawL
超文本标记语言
<link href='http://fonts.googleapis.com/css?family=Varela' rel='stylesheet' type='text/css'>
<div class="glitch" data-text="GLITCH">GLITCH</div>
Run Code Online (Sandbox Code Playgroud)