我对节点很新,我正在尝试为我的网站创建一个简单的服务器但是当我server.js在命令提示符下输入节点时没有任何反应.
var http = require("http");
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("It's alive!");
response.end();
}).listen(3000);
Run Code Online (Sandbox Code Playgroud)
这是我在尝试运行server.js文件时看到的内容:
我相当肯定我的代码是对的,还有什么我做错了吗?
我有以下代码(dput数据集的数据在这里):
ruz <- structure(list(date = structure(c(16617, 16618, 16619, 16622,
16623, 16624, 16625, 16626, 16629, 16630, 16631, 16632, 16633,
16636, 16637, 16638, 16639, 16640, 16643, 16644, 16645, 16646,
16647, 16650, 16651, 16652, 16653, 16654, 16657, 16658, 16659,
16660, 16661, 16664, 16665, 16666, 16667, 16668, 16671, 16672,
16673, 16674, 16675, 16678, 16679, 16680, 16681, 16682, 16685,
16686, 16687, 16688, 16689, 16692, 16693, 16694, 16695, 16696,
16699, 16700, 16701, 16702, 16703, 16706, 16707, 16708, 16709,
16710, 16713, 16714, 16715, 16716, 16717, …Run Code Online (Sandbox Code Playgroud) 我有以下内容:
var SingleEditableModule = React.createClass({
show_overlay: function(e) {
console.log($(e.target).attr('id'));
},
render: function() {
var show_overlay = this.show_overlay;
return (
<div className="large-4 small-12 columns">
<h3 className="title">{this.props.data.title}</h3>
<div className="month">
<p>
{this.props.data.month}
</p>
</div>
<div className="img-holder">
<div
id={this.props.data.id}
onClick={show_overlay}
className="action_wrapper">
<span className="swap_trigger"></span>
<span className="action">
{this.props.data.action}
</span>
</div>
</div>
<h4>{this.props.data.title_description}</h4>
<p>{this.props.data.description}</p>
</div>
);
}
});
Run Code Online (Sandbox Code Playgroud)
当我点击"action_wrapper"来检索id值时,我得到了undefined.根据我的数据结构,我应该得到'D'或'E':
var empty_modules_DE = [
{
id: 'D',
title: 'Module D',
title_description: 'Your first rotation',
description: 'In your penultimate module, Module D, you have the option of taking electives …Run Code Online (Sandbox Code Playgroud) 我正在构建一个发票系统,其中从数据库中检索项目名称和价格。价格取决于项目名称。
现在我必须这样做。
Price: <Input type="text" id="price" name="price" />
Qty : <Input type="text" id="qty" name="qty" />
Tax : <Input type="text" id="tax" name="tax" />
Discount : <Input type="text" id="disc" name="disc" />
Total : <Input type="text" id="total" name="total" value=" echo $total;"/>
Run Code Online (Sandbox Code Playgroud)
我想使用以下公式自动填充总输入字段而不重新加载
<?Php
$total = $price * $qty + $tax - $disc;
?>
Run Code Online (Sandbox Code Playgroud) 我无法将文本对齐到画布的中心,当长度超过画布的长度时,也无法让文本换行。
import { Layer, Stage, Text } from 'react-konva';
render() {
return (
<Stage height={500} width={500}>
<Layer>
<Text fontSize={60} text="`HEYYYYYYYYYYYYYYYYYYYYYYY`"
wrap="char" align="center" />
</Layer>
</Stage>
)
}
Run Code Online (Sandbox Code Playgroud) 我是一个新程序员,我需要你的帮助。我对 Atom 编辑器很陌生,但设置了一些不错的软件包,例如 Atom Beautify。在html/php文件中使用它后,我收到错误“找不到 'php-cs-fixer' 。程序可能未安装。奇怪的是,我确实安装了 php-cs-fixer 包,但是没发生什么事。
我的系统是Windows。
任何人都知道我该如何解决这个问题?
这是我第一次在这里提问。我将清楚地解释什么问题。
我正在创建一个Android应用,该应用在供稿中显示有关选项/选项的问题。我使用了RecyclerView和CardView来显示它们。我能够显示问题和其他内容,但显示选项时遇到困难。我试图循环onBindViewHolder()中的选项/选择的数组。我可以在日志中看到数据在那里,但我不知道/我不知道如何为选择动态添加视图。
我已经有了循环,但是不确定如何膨胀或显示文本视图。这是我的onBindViewHolder()代码:
public void onBindViewHolder(PublicQuestionViewHolder publicQuestionViewHolder, int i) {
publicQuestionViewHolder.questionAuthor.setText(questions.get(i).getQuestionAuthor());
publicQuestionViewHolder.questionText.setText(questions.get(i).getQuestionText());
ParseUser currentUser = ParseUser.getCurrentUser();
if (currentUser == questions.get(i).getQuestionParseUser()) {
publicQuestionViewHolder.questionEditIconImageView.setVisibility(View.VISIBLE);
} else {
publicQuestionViewHolder.questionEditIconImageView.setVisibility(View.INVISIBLE);
}
//Log.d("Options", String.valueOf(questions.get(i).getQuestionOptions().size()));
if (questions.get(i).getQuestionOptions().size() != 0) {
for (QuestionOption option : questions.get(i).getQuestionOptions()) {
if (option.getQuestionOptionType().equals("T")) {
Log.d("Option", option.getQuestionOptionText());
} else if (option.getQuestionOptionType().equals("I")) {
Log.d("Option", option.getQuestionOptionImage().getName());
}
}
}
}
Run Code Online (Sandbox Code Playgroud) 在PostgreSQL中,我想增加一个字段,但null有时候.1如果不是那么增加该字段,如果是null,则将其设置1为null?
insert into table (id, inc) values('a',1) on conflict(id) do update set inc=inc;
Run Code Online (Sandbox Code Playgroud)
当id已经存在,并且inc是null它不会工作.
有什么建议?
我只需要删除URL即可删除ReplyKeyboard。
我正在使用Python,但未使用Python BotLibrary。我会处理所有请求,因为我想要完全的灵活性。
javascript ×2
php ×2
reactjs ×2
ajax ×1
android ×1
atom-editor ×1
bash ×1
callback ×1
canvas ×1
centos ×1
ggplot2 ×1
html ×1
jquery ×1
konvajs ×1
legend ×1
mysqli ×1
node.js ×1
php-cs-fixer ×1
postgresql ×1
python-2.7 ×1
r ×1
sql ×1
telegram ×1
telegram-bot ×1
web ×1