我升级到Ubuntu 13.10.最初在更新后运行apache时,有丢失/损坏的文件,所以我只是重新安装了apache.我备份了vhost文件.
尝试从浏览器访问我的Laravel项目时,会收到403错误.我已经多次更改了根文件夹的权限,但仍然是禁止的.我不相信这是一个laravel问题,因为我已经在13.04修复它,并且我使用相同的文件.
这是我的000-default.conf文件,位于/ sites-enabled和/ sites-available中.自安装以来,我的apache2.conf文件没有改变.
<VirtualHost *:80>
DocumentRoot /home/brennan/development/MasonACM/public
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/brennan/development/MasonACM/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
同样重要的是要注意我的.htaccess文件没有丢失,并且自从该站点在13.04上工作以来没有被更改.
更新:
我现在有apache的主机设置工作,但现在浏览器显示index.php的实际代码,这意味着apache由于某种原因没有使用php.我刚刚检查过php是否安装了,为什么apache不会认出来呢?
我有一个全新的Laravel.跑步时,php artisan migrate:refresh我收到一条消息说Application In Production! Do you really wish to run this command?'
我知道这是4.2中的更新,但我无法弄清楚如何将其关闭.
我在源代码中发现,Illuminate\Console\ConfirmableTrait如果测试通过,它来自并运行:if ($this->getLaravel()->environment() == 'production')
我不确定为什么它认为我在制作中.我从不设置任何环境.这是我目前仍在使用的默认环境检测.
$env = $app->detectEnvironment(array(
'local' => array('homestead')
));
Run Code Online (Sandbox Code Playgroud)
此外,如果我将生产环境设置为不是我的机器的主机名,我仍然有同样的问题.
我试图看看我的控制器中是否选中了复选框.我已经读过这是执行此操作的代码
if (Input::get('attending_lan', true))
Run Code Online (Sandbox Code Playgroud)
但即使取消选中该复选框,也会返回true.
我有一个卡类
public class Card {
private int value, suit;
public Card(int value, int suit) {
this.value = value;
this.suit = suit;
}
//gets, sets, toString
}
Run Code Online (Sandbox Code Playgroud)
这就是我通常填充CardList的方法
for(int suit = 1; suit <= 4; ++suit)
for(int value = 1; value <= 13; ++value)
Cards.add(new Card(value, suit));
Run Code Online (Sandbox Code Playgroud)
但我想使用Lambda表达式来初始化它
ArrayList<Card> Cards = IntStream.range(1, 4)
.map(value -> IntStream.range(1, 13)
.map(suit -> new Card(value, suit)));
Run Code Online (Sandbox Code Playgroud)
Intellij正在给我一个错误 .map(suit -> new Card(suit, value))
它说"lambda表达式中不兼容的返回类型卡"
x = 'yellow'
print(sorted(x))
Run Code Online (Sandbox Code Playgroud)
回报
['e', 'l', 'l', 'o', 'w', 'y']
Run Code Online (Sandbox Code Playgroud)
我希望它回归
ellowy
怎么跑我'ellowy'没有字母在列表中返回?
当我尝试使用一个方法返回一个私有变量时,似乎值从构造对象开始变化.这是我的代码和输出.
main.cpp中
#include <iostream>
#include "coordinate.h"
using namespace std;
int main()
{
Coordinate c(1, 1);
cout << c.getX() << endl;
}
Run Code Online (Sandbox Code Playgroud)
coordinate.cpp
#include "coordinate.h"
#include <iostream>
using namespace std;
Coordinate::Coordinate(int x, int y)
{
x = x;
y = y;
cout << x << endl;
}
Run Code Online (Sandbox Code Playgroud)
coordinate.h
#ifndef COORDINATE_H
#define COORDINATE_H
class Coordinate
{
private:
int x;
int y;
public:
Coordinate(int x, int y);
int getX() { return x; }
int getY() { return y; }
};
#endif
Run Code Online (Sandbox Code Playgroud)

我有一个仅在CMD或python shell中运行的单词解扰游戏。当用户正确或错误地猜出单词时,会说“按任意键再次播放”
我将如何重新开始?
我正在创建一个自定义新标签页,我想要localhost和我的路由器的链接.似乎我想链接到其中一个,它只是将它附加到我的地址栏中的现有文本,而不是像http://链接那样清除它.
$('#router').on('click', function() {
window.open("192.168.1.1");
});
Run Code Online (Sandbox Code Playgroud)
这是它打开的地址:
文件:/// C:/Users/brennan/development/new_tab/192.168.1.1
而不只是:
192.168.1.1
如何比较字符串中的单个字符和另一个字符串(可能大于或小于一个字符)
这个程序给了我近300行随机错误。错误也没有引用特定的行号,只是有关“ char *”,“”或“ std :: to_string”的很多东西。
#include <iostream>
#include <string>
using std::cout;
using std::string;
int main() {
string str = "MDCXIV";
string test = "D";
if (test == str[4]) { // This line causes the problems
cout << test << endl;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)