我试图让一个流浪的盒子运行起来,但我不断遇到网络碰撞错误.这个盒子是trusty64的新下载.我一直在搜索处理vagrant的每个文件和文件夹,试图找到指定IP的东西我不能.我在Windows 7机器上运行流浪汉.这是我的Vagrantfile:
C:\ Users \用户.vagrant \盒...\Vagrantfile
Vagrant::Config.run do |config|
# This Vagrantfile is auto-generated by 'vagrant package' to contain
# the MAC address of the box. Custom configuration should be placed in
# the actual 'Vagrantfile' in this box.
config.vm.base_mac = "0800278493DB"
end
# Load include vagrant file if it exists after the auto-generated
# so it can override any of the settings
include_vagrantfile = File.expand_path("../include/_Vagrantfile", __FILE__)
load include_vagrantfile if File.exist?(include_vagrantfile)
Run Code Online (Sandbox Code Playgroud)
这是我从vagrant up命令收到的错误:
Bringing machine 'default' up with 'virtualbox' provider... …Run Code Online (Sandbox Code Playgroud) 我是Django的新手.我正在尝试使用模板在我的索引视图中显示我的Project模型中的数据.我尽力构建这个应用程序类似于民意调查应用程序.我不确定我做错了什么.我使用的是python 2.7和django 1.8.6
这是我的网址:
from django.conf.urls import url
from . import views
app_name = 'project'
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<pk>[0-9]+)/$', views.DetailView.as_view(), name='detail'),
]
Run Code Online (Sandbox Code Playgroud)
这是我的模型:
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.contrib.auth.models import User
from django.utils import timezone
@python_2_unicode_compatible # only if you need to support Python 2
class Contractor(models.Model):
#project
name = models.CharField(max_length=50)
address = models.CharField(max_length=100, blank=True)
phone = models.CharField(max_length=14, blank=True)
city = models.CharField(max_length=60, blank=True)
state = models.CharField(max_length=2, blank=True)
created_by = models.ForeignKey(User, related_name='Contractor_created_by') …Run Code Online (Sandbox Code Playgroud) 我是Django的新手.我正在使用Django 1.8.6与Python 2.7.我正在尝试使用base.html模板,该模板可以在整个网站中使用全局,每个应用都可以访问它.这是我的测试网站的当前结构:
twms
民意调查
迁移
静态的
模板
项目
迁移
静态的
模板
项目
的index.html
tmws
静态的
模板
tmws
base.html文件
这是project/templates/project/index.html的代码
{% extends 'tmws/base.html' %}
{% block content %}
<h1>Projects</h1>
<ul>
{% for project in project_list %}
<li><a href="{% url 'project:detail' project.id %}">{{ project.name }}</a></li>
{% endfor %}
</ul>
end of list
{% endblock %}
Run Code Online (Sandbox Code Playgroud)
这是我收到的错误:
/ project /上的TemplateDoesNotExist
tmws/base.html文件
如何从我的任何应用访问tmws/tmws/templates/tmws/base.html?
任何帮助将不胜感激!
如果需要任何其他信息,请与我们联系.
编辑
以下是来自settings.py的模板设置:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, 'templates'), # If i leave both or …Run Code Online (Sandbox Code Playgroud) 我看了一些论坛帖子,我无法找到问题的答案.我想从一个php文件得到一个响应.php文件正常运行.问题是Android App不会执行我的请求.以下是我的代码的两个示例以及我在textview中得到的结果:
public void changText(View view) {
TextView textv = (TextView)findViewById(R.id.textview1);
textv.setText("Text Has Been Changed");
BufferedReader in = null;
String data = null;
try{
HttpClient httpclient = new DefaultHttpClient();
HttpGet request = new HttpGet();
URI website = new URI("http://alanhardin.comyr.com/matt24/matt28.php");
request.setURI(website);
HttpResponse response = httpclient.execute(request);
in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
textv.append(" Connected ");
}catch(Exception e){
Log.e("log_tag", "Error in http connection "+e.toString());
}
}
Run Code Online (Sandbox Code Playgroud)
TextView显示:文本已更改
public void changText(View view) {
TextView textv = (TextView)findViewById(R.id.textview1);
textv.setText("Text Has Been Changed");
BufferedReader in = null; …Run Code Online (Sandbox Code Playgroud) 我想在宅基地流浪汉的帮助下创建一个Laravel应用程序.我正在使用Windows 7开发环境.我正在使用Per Project安装,而我正处于Laravel文档中,我可以让我的项目流浪.当我在项目中流浪时,我会被挂断电话
SSH身份验证方法:密码
我收到以下消息:
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
Run Code Online (Sandbox Code Playgroud)
我正在使用Laravel 5.3和Vagrant 1.9.0.我正在使用Vagrant 1.8.4,但是一旦我开始遇到问题,我安装了Vagrant 1.9.0,但收到了完全相同的错误.我从这里尝试了以下修复,从vb.gui我可以从启动的服务器看到以下错误:
[ 0.100000] Failed to access perfctr msr (MSR c0010007 is 0)
lvmetad is not active yet, using direct activation during sysinit
lvmetad is not active yet, using direct activation during sysinit
Scanning for Btrfs filesystems
/dev/mapper/vagrant--vg-root:clean, 127066/2559088 files, …Run Code Online (Sandbox Code Playgroud) 我正在使用具有ShellCommandActivity的AWS Data Pipeline,该ShellCommandActivity将脚本uri设置为位于s3存储桶中的bash文件。bash文件将位于同一s3存储桶中的python脚本复制到EmrCluster,然后该脚本尝试执行该python脚本。
这是我的管道输出:
{
"objects": [
{
"name": "DefaultResource1",
"id": "ResourceId_27dLM",
"amiVersion": "3.9.0",
"type": "EmrCluster",
"region": "us-east-1"
},
{
"failureAndRerunMode": "CASCADE",
"resourceRole": "DataPipelineDefaultResourceRole",
"role": "DataPipelineDefaultRole",
"pipelineLogUri": "s3://project/bin/scripts/logs/",
"scheduleType": "ONDEMAND",
"name": "Default",
"id": "Default"
},
{
"stage": "true",
"scriptUri": "s3://project/bin/scripts/RunPython.sh",
"name": "DefaultShellCommandActivity1",
"id": "ShellCommandActivityId_hA57k",
"runsOn": {
"ref": "ResourceId_27dLM"
},
"type": "ShellCommandActivity"
}
],
"parameters": []
}
Run Code Online (Sandbox Code Playgroud)
这是RunPython.sh:
#!/usr/bin/env bash
aws s3 cp s3://project/bin/scripts/Test.py ./
python ./Test.py
Run Code Online (Sandbox Code Playgroud)
这是Test.py
__author__ = 'MrRobot'
import re
import os
import sys
import boto3
print "We've …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 python 中的 SQLite Select 语句中插入一个字符串。当我尝试此代码时:
cur.execute("SELECT * FROM DB WHERE employeeNum = '?'",(empNum,))
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 0, and there are 1 supplied.
Run Code Online (Sandbox Code Playgroud)
当我尝试此代码时:
cur.execute("SELECT * FROM DB WHERE employeeNum = '",empNum,"'")
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
TypeError: function takes at most 2 arguments (3 given)
Run Code Online (Sandbox Code Playgroud)
我如何查询这个字符串?抱歉,我是 Python 新手。任何帮助将不胜感激!
我使用Laravel 5.4,我正在尝试为索引视图编写策略.我试图使用没有模型的方法,我收到以下错误:
Handler.php第133行中的HttpException:
此操作未经授权.
这是我的控制器:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\County;
use Session;
use App\Http\Controllers\Controller;
class CountyController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$counties = County::orderBy('id', 'desc')->paginate(5);
$this->authorize('index');
return view('county.index', array(
'counties' => $counties
));
}
Run Code Online (Sandbox Code Playgroud)
这是我的AuthServicePovider:
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use …Run Code Online (Sandbox Code Playgroud) public class Team {
public int health;
public int x;
public int conflict;
}
public class Test extends Activity {
Team enemy[] = new Team[50];
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
for(int i =0; i<enemy.length; i++){
enemy[i].health = 0;
enemy[i].x = -100;
enemy[i].conflict = 0;
}
}
}
Run Code Online (Sandbox Code Playgroud)
随着for循环我的游戏崩溃,没有for循环它运行.我究竟做错了什么?谢谢你的帮助提前!