我在本地计算机上创建了一个wordpress站点,然后将其上传到远程服务器.CSS没有工作,我意识到它正在寻找localhost试图找到它,当它应该看着远程服务器.所以我去了www.remoteserver.co.uk/wp-admin,它将我重定向到localhost/wp-admin.
有谁知道我做错了什么?
我刚刚安装了account-google和accounts-ui包,我收到了错误:
W20150525-10:41:42.384(1)? (STDERR)
W20150525-10:41:42.384(1)? (STDERR) /home/andy/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150525-10:41:42.384(1)? (STDERR) throw(ex);
W20150525-10:41:42.384(1)? (STDERR) ^
W20150525-10:41:42.449(1)? (STDERR) Error: A method named '/users/insert' is already defined
W20150525-10:41:42.449(1)? (STDERR) at packages/ddp/livedata_server.js:1461:1
W20150525-10:41:42.449(1)? (STDERR) at Function._.each._.forEach (packages/underscore/underscore.js:113:1)
W20150525-10:41:42.449(1)? (STDERR) at [object Object]._.extend.methods (packages/ddp/livedata_server.js:1459:1)
W20150525-10:41:42.449(1)? (STDERR) at [object Object].Mongo.Collection._defineMutationMethods (packages/mongo/collection.js:904:1)
W20150525-10:41:42.449(1)? (STDERR) at new Mongo.Collection (packages/mongo/collection.js:209:1)
W20150525-10:41:42.449(1)? (STDERR) at app/meteor.js:1:44
W20150525-10:41:42.449(1)? (STDERR) at app/meteor.js:16:3
W20150525-10:41:42.450(1)? (STDERR) at /home/andy/dev/meteor/.meteor/local/build/programs/server/boot.js:222:10
W20150525-10:41:42.450(1)? (STDERR) at Array.forEach (native)
W20150525-10:41:42.450(1)? (STDERR) at Function._.each._.forEach (/home/andy/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
=> Exited with code: 8
Run Code Online (Sandbox Code Playgroud)
我的代码目前非常简单(对此非常新!).这是meteor.html:
<head> …Run Code Online (Sandbox Code Playgroud) 我有三个需要在数据透视表中相关的模型:用户,学生,计划.因此,每个用户都可以订阅学生计划.
到目前为止我发现的是为两个模型创建一个支点,比如User和Plan,并将student_id作为额外字段附加:
$user->plans()->attach([1 => ['student_id' => $student_id]);
Run Code Online (Sandbox Code Playgroud)
这样做的一个问题是,如果我尝试检索特定用户的计划,我不会得到学生模型,只有id,所以:
return $this->BelongsToMany('App\Plan', 'plans_students_users', 'user_id', 'plan_id')
->withPivot('student_id');
Run Code Online (Sandbox Code Playgroud)
所以,我必须做第二个查询来获得学生模型.
有没有其他方法可以解决它,因为我想要在所有方向进行查询,例如:
$user->plans() (attaching the students)
$student->plans() (attaching the user)
$plan->users() (attaching the students)
$plan->students() (attaching the users)
Run Code Online (Sandbox Code Playgroud) 我有一个Vuex商店,我正在注入我的实例:
import store from '../store';
const mainNav = new Vue({
el: '#main-nav',
store,
components: { NavComponent }
});
Run Code Online (Sandbox Code Playgroud)
我正在组件中的该商店创建一个计算属性:
computed: {
isWide() {
return this.$store.state.nav.type === 'wide';
}
}
Run Code Online (Sandbox Code Playgroud)
这确实this.isWide在组件初始化时为模板创建了属性,但是当更新存储值时,组件不会注册它 - 旧值仍在模板上.
我在这做错了什么?
我正在使用mod_wsgi来提供django网站,但我有一个内部服务器错误.这是apache日志:
[Fri May 31 10:11:25 2013] [error] python_init: Python version mismatch, expected '2.7.2+', found '2.7.3'.
[Fri May 31 10:11:25 2013] [error] python_init: Python executable found '/usr/bin/python'.
[Fri May 31 10:11:25 2013] [error] python_init: Python path being used '/usr/lib/python2.7/:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload'.
[Fri May 31 10:11:25 2013] [warn] mod_wsgi: Compiled for Python/2.7.2+.
[Fri May 31 10:11:25 2013] [warn] mod_wsgi: Runtime using Python/2.7.3.
[Fri May 31 10:11:25 2013] [notice] Apache/2.2.22 (Ubuntu) DAV/2 mod_fcgid/2.3.6 mod_python/3.3.1 Python/2.7.3 mod_ssl/2.2.22 OpenSSL/1.0.1 mod_wsgi/3.3 mod_perl/2.0.5 Perl/v5.14.2 configured -- resuming normal operations …Run Code Online (Sandbox Code Playgroud) 我正在尝试将jQuery事件处理程序转换为纯javascript.页面上有特定选择器的负载,因此设计时只有一个具有该选择器的事件定位文档:
$(document).on("click", selectorString, function(event) {
// do stuff
});
Run Code Online (Sandbox Code Playgroud)
selector选择器列表在哪里作为字符串" .one, .two, .three".
我很难在没有jQuery的情况下复制这个:
document.addEventListener("click", function(event){
if (elementHasClass(event.target, selectorString) {
// do stuff
}
});
Run Code Online (Sandbox Code Playgroud)
但是,这并不具有所期望的行为,作为听者只有在document元素,而不是所选元素中的文档.有人能帮忙吗?
尝试使用 nodemailer 设置联系表单。这是我的 app.js 中的内容:
// EMail configuration
var smtpTransport = nodemailer.createTransport("SMTP",{
service: "Gmail",
auth: {
user: "myemailaddress",
pass: "xxx"
}
});
// CONTACT FORM
app.get('/contact', function (req, res) {
res.render("contact");
});
app.post('/contact', function (req, res) {
var mailOptions = {
from: req.body.email, // sender address
to: "myemailaddress", // list of receivers
subject: req.body.subject, // Subject line
text: req.body.message, // plaintext body
}
smtpTransport.sendMail(mailOptions, function(error, response){
if(error){
console.log(error);
}else{
console.log("Message sent: " + response.message);
}
smtpTransport.close(); // shut down the …Run Code Online (Sandbox Code Playgroud) 目前,我有以下设置:
记录:
mydomain.com - aaa.aaa.aaa.aaa
subdomain.mydomain.com - aaa.aaa.aaa.aaa
NS记录:
mydomain.com - ns.mydomain.com
我想要做的是将子域保持在该IP地址并将mydomain.com移动到新服务器(bbb.bbb.bbb.bbb和ns.newserver.com).这可能吗,我需要添加哪些记录?
我有一个表,我想在id中添加 - > unsigned().目前,迁移看起来像:$table->increments('id');
所以我想进行一次新的迁移,将其设置为unsigned,但文档中没有太多可以做到这一点.这是正确的方法:
public function up()
{
Schema::table('authors', function($t) {
$t->unsigned('id', 'authors_id_unsigned');
});
}
public function down()
{
Schema::table('authors', function($t) {
$t->dropUnsigned('authors_id_unsigned');
});
}
Run Code Online (Sandbox Code Playgroud)
我只是在这里猜测,因为我在文档中找不到它.
/node_modules/webpack/lib/TemplatedPathPlugin.js:72
.replace(REGEXP_HASH, withHashLength(getReplacer(data.hash), data.hashWithLength))
^
Run Code Online (Sandbox Code Playgroud)
我在运行时遇到这个错误webpack- 它似乎path是一个对象而不是一个字符串,因此找不到替换方法.任何人都可以解释这个错误吗?这是我的webpack.config.js:
var webpack = require('webpack');
var path = require('path');
var basePath = 'app';
var outputFile = 'output.js';
var config = {
entry: basePath + '/index.js',
output: {
path: basePath,
filename: outputFile
},
resolve: {
extensions: ['', '.js']
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
}]
}
};
module.exports = config;
Run Code Online (Sandbox Code Playgroud)