我正在尝试将自定义颜色用于AppBar标头.AppBar的标题是"我的AppBar".我使用白色作为我的主要主题颜色.它适用于酒吧,但AppBar的'标题'也使用相同的'白色'颜色'
这是我的代码:
import React from 'react';
import * as Colors from 'material-ui/styles/colors';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import AppBar from 'material-ui/AppBar';
import TextField from 'material-ui/TextField';
const muiTheme = getMuiTheme({
palette: {
textColor: Colors.darkBlack,
primary1Color: Colors.white,
primary2Color: Colors.indigo700,
accent1Color: Colors.redA200,
pickerHeaderColor: Colors.darkBlack,
},
appBar: {
height: 60,
},
});
class Main extends React.Component {
render() {
// MuiThemeProvider takes the theme as a property and passed it down the hierarchy
// using React's context feature.
return (
<MuiThemeProvider …Run Code Online (Sandbox Code Playgroud) 我已经设置了Loopback项目并安装了运行我的项目所需的其他软件包.每当我尝试使用文件夹中的命令运行应用程序时
node .
Run Code Online (Sandbox Code Playgroud)
它引发了以下错误:
test_app/node_modules/strong-remoting/lib/shared-method.js:157
if (/^prototype\./.test(name)) {
^
RangeError: Maximum call stack size exceeded
Run Code Online (Sandbox Code Playgroud)
关于这个错误,我几乎不知道.你能建议任何解决方案吗?
我正在尝试使用 Material-ui Card 组件将视频嵌入到我的页面中,如下所示:
const CardExampleWithAvatar = () => (
<Card>
<CardMedia
overlay={<CardTitle title="Overlay title" subtitle="Overlay subtitle" />}
>
<video>
<source src="https://www.youtube.com/watch?v=abcdef" type="video/mp4"/>
</video>
</CardMedia>
<CardTitle title="Card title" subtitle="Card subtitle" />
<CardText>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Donec mattis pretium massa. Aliquam erat volutpat. Nulla facilisi.
Donec vulputate interdum sollicitudin. Nunc lacinia auctor quam sed pellentesque.
Aliquam dui mauris, mattis quis lacus id, pellentesque lobortis odio.
</CardText>
<CardActions>
<FlatButton label="Action1" />
<FlatButton label="Action2" />
</CardActions>
</Card>
); …Run Code Online (Sandbox Code Playgroud) 我为我的网站启用了DISQUS SSO.但我想只启用从我的网站登录并禁用DISQUS登录下拉选项中的其他社交登录选项?
我正在尝试读取 R 中的网络数据(id 图形)。该文件名为“network.txt”,数据如下:
4 0
5 0
6 0
7 0
8 0
9 0
4029 1
4030 1
4031 1
4032 1
4033 1
19088 9040
19089 9040
19090 9040
19091 9040
19092 9040
19093 9040
19094 9040
19095 9040
19096 9040
19097 9040
Run Code Online (Sandbox Code Playgroud)
而且,我正在使用 read.table() 模块阅读它。
data = read.table("network.txt",sep="\t",header=FALSE)
colnames( data ) <- unlist(c('to', 'from'))
Error in `colnames<-`(`*tmp*`, value = c("to", "from")) :
'names' attribute [2] must be the same length as the vector [1]
Run Code Online (Sandbox Code Playgroud)
那么,如何分配列名呢?读取原始数据文件有没有错误?
我正在尝试将Portuguese文本插入到我的表格中。但是,它给出了'ascii' codec can't encode character '\xea'错误。
这是我在做什么:
os.environ["NLS_LANG"] = ".AL32UTF8"
query = "INSERT INTO MESSAGE (MESSAGE,LANGUAGE) VALUES (:MESSAGE,:LANGUAGE)"
data = {'MESSAGE': '..... assistência para ajuda responda AJUDA Sua', 'LANGUAGE': 'Portuguese'}
cursor = conn.cursor()
cursor.execute(query, data)
.....
Run Code Online (Sandbox Code Playgroud)
我的表结构:
CREATE TABLE MESSAGE (
language VARCHAR2(12) NOT NULL,
message NVARCHAR2(350) NOT NULL
);
Run Code Online (Sandbox Code Playgroud)
我不确定是否需要设置任何内容以将其他字符插入到数据库中。
我models.py在两个不同的应用程序中有两个Django .
processor app models.py
from address.models import Address
...defining clasess
class Displayble(models.Model):
# It has no DB fields
Run Code Online (Sandbox Code Playgroud)
address app models.py
from processor.models import Displayable
class Address(models.Model, Displayble):
...some fields, stored in DB
Run Code Online (Sandbox Code Playgroud)
将Dispalyble类移动到另一个文件是解决此依赖关系的唯一选择吗?
我正在使用数据集来查看薪水与大学GPA之间的关系.我正在使用sklearn线性回归模型.我认为系数应该是截距和coff.相应特征的价值.但该模型给出了单一价值.
from sklearn.cross_validation import train_test_split
from sklearn.linear_model import LinearRegression
# Use only one feature : CollegeGPA
labour_data_gpa = labour_data[['collegeGPA']]
# salary as a dependent variable
labour_data_salary = labour_data[['Salary']]
# Split the data into training/testing sets
gpa_train, gpa_test, salary_train, salary_test = train_test_split(labour_data_gpa, labour_data_salary)
# Create linear regression object
regression = LinearRegression()
# Train the model using the training sets (first parameter is x )
regression.fit(gpa_train, salary_train)
#coefficients
regression.coef_
The output is : Out[12]: array([[ 3235.66359637]])
Run Code Online (Sandbox Code Playgroud) python ×3
material-ui ×2
reactjs ×2
cx-oracle ×1
data-mining ×1
data-science ×1
dependencies ×1
disqus ×1
django ×1
import ×1
javascript ×1
loopbackjs ×1
node.js ×1
oracle ×1
pandas ×1
r ×1
react-jsx ×1
scikit-learn ×1