我的页面上有一个居中的表单,使用顶部和左侧值以及css3转换.
<div class="middle">
<h1>This is blurry, or should be.</h1>
</div>
Run Code Online (Sandbox Code Playgroud)
.middle {
position: absolute;
top: 50%;
left: 50%;
min-width: 390px;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
/** backface-visibility: hidden; **/
}
h1 {
padding-bottom: 5px;
border-bottom: 3px solid blue
}
Run Code Online (Sandbox Code Playgroud)
注意背面可见性.当设置为隐藏时,使用chrome 42解决了所有问题.它不会变得模糊.对于其他人使用相同的chrome版本,它会使它变得模糊.
这是没有BV的样子:http://jsfiddle.net/mzws2fnp/

对你来说它可能是模糊的,对其他人可能不是.
以下是BV的样子:http://jsfiddle.net/mzws2fnp/2/

出于某种原因,人们看到边界模糊,但我没有.我知道背面 - 可见性:隐藏是为了解决这个问题,它对我有用,而不是对其他人使用与我相同的浏览器.
我在我的游戏模型中有一个方法,它检索在一个数据库中的表中注册的所有游戏的列表,遍历找到的每个游戏并从另一个数据库中获取数据,最后从数据库中抓取一个随机图像URL并将其附加到统计对象.困惑了吗?
不要再困惑了,这是方法:
public static function getStats($player, $cache = 30) {
// Return a collection of all games registered from the website database
$games = Game::get(['game']);
foreach($games as $game) {
// For each iteration, return the statistics from the games database for that game
// Grab game meta information from the website database, $game->game is the game name.
$list = Game::where('game', $game->game)->remember($cache)->first();
// From the game database, retrieve the statistics
$stats[$game->game] = DB::connection('game')->table($list->stats_table)
->select(DB::raw($list->statistics))
->where('Username', $player)
->remember($cache)
->first();
// …Run Code Online (Sandbox Code Playgroud) 使用CKEDITOR时,我的表单不会在第一次提交时向服务器发送数据.如果我单击一次,它将发送空字段而不输入.但是,如果我第二次提交,它会将输入的数据发送到服务器.所以你需要提交两次数据才能传递给服务器.
我有CKEDITOR与BBCODE插件捆绑在一起.
$('form#ajax').on('submit', function(){
var that = $(this),
url = that.attr('action'),
type = that.attr('method'),
data = {};
that.find('[name]').each(function(index, value){
var that = $(this),
name = that.attr('name'),
value = that.val();
data[name] = value;
});
console.log(data.message); // Outputs on second submit
$.ajax({
url: url,
type: type,
data: data,
success: function(response){
//
}
});
return false;
});
Run Code Online (Sandbox Code Playgroud)
{{ Form::open(array('action' => 'AppsController@sendApp', 'class' => 'app', 'id' => 'ajax')) }}
<div class="form-container">
{{ Form::label('message', 'Application', array('style' => 'padding-top: 5px')) }}
<textarea name="message" …Run Code Online (Sandbox Code Playgroud) 我最近切换到Laravel的基于环境的应用程序部署,我决定使用$ _ENV在.env文件中存储我的本地和生产服务器的凭据但是我发现调试打开时会发生异常并引发错误显示公开数据库凭据的环境变量.
现在我确定调试将始终关闭生产,因为这是我默认的,然后我在我的本地环境的本地文件夹中覆盖它,但是,如果不知何故某些调试在生产时打开并且用户强制404例外,他们需要做的就是读取页面,直到他们在普通视图中看到环境变量暴露凭证.在文档中,它表示对任何"真实"应用程序来说,保持数据库凭据远离实际配置是最佳做法.我在这里可能有点偏执.
有没有办法可以限制laravel显示的调试屏幕中显示的内容?
我正在运行Laravel Vagrant Homestead,我决定清理我的所有项目,并将我的主项目文件夹的位置从我的桌面移动到我的公司C:/,以使事情更有条理.当我启动我的VM时,它无法进行身份验证.
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 => 8000 (adapter 1)
default: 3306 => 33060 (adapter 1)
default: 5432 => 54320 (adapter 1)
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM …Run Code Online (Sandbox Code Playgroud) 我试图使用Java在以下等式中求解y:
为了可见性,我将分子和分母分成单独的变量.我需要x = -3通过x = 4以增量为单位进行计算0.5.
for(double x = -3; x <= 4; x += .5)
{
// Now we compute the formula for all values in between -3 and 4 in increments of 0.5
double top = ( 9 * Math.pow(x, 3) ) - ( 27 * Math.pow(x, 2) ) - ( (4 * x) + 12 );
double bottom = ( Math.pow(( 3 * Math.pow(x, 2) + 1 ) , 1/2) + …Run Code Online (Sandbox Code Playgroud) 我有一个不使用自动增量主键的用户表,而是使用二进制uuid主键.我设置我的自定义模型与我的表进行交互但是,我在使用::find()因为这样的情况尝试查找记录时遇到了麻烦,这个uuid需要通过使用HEX()和UNHEX()mysql函数进行搜索.如何覆盖它并将其中的任何内容置于::find()十六进制中.模型的名称是Player.
因此,如果我试图找到一个具有uuid的用户9d823b9eec224cbea10b69bec2c5adef,我无法通过以下方式找到它们:
Player::find('9d823b9eec224cbea10b69bec2c5adef') 因为uuid需要不被解雇.
我试过Player::find("UNHEX('9d823b9eec224cbea10b69bec2c5adef')");没有结果.
到目前为止这是我的模型:
class Player extends Eloquent {
protected $table = 'players';
protected $connection = 'game';
protected $primaryKey = 'uuid';
public $incrementing = false;
public $timestamps = false;
}
Run Code Online (Sandbox Code Playgroud)
uuid的数据类型是binary(16)
更新
我已经通过使用它来工作Player::find(DB::raw("UNHEX('9d823b9eec224cbea10b69bec2c5adef')"));但是每次我需要查找用户时都要编写很多东西.
有什么方法可以让参数::find()始终贯穿DB::raw("UNHEX('uuid')")或通过函数传递hex2bin()?
我100%肯定我将永远使用UUID所以我想覆盖::find(),而不是创建一个新方法.
我正在尝试在Laravel中设置一个智能错误捕获系统,这样我就可以为每个错误定义一个视图,而不是传统的"这里出了问题".调试关闭的消息.我已成功捕获典型的http标头,例如404,403,405和500但是现在我想要捕获ModelNotFoundException并简单地返回404.这是我到目前为止所得到的:
App::error(function(Exception $e, $code) {
$error = ['code' => $code];
switch($code) {
case 403:
return Response::view('errors.error', $error, $code);
break;
case 404:
return Response::view('errors.error', $error, $code);
break;
case 405:
return Response::view('errors.error', $error, $code);
break;
case 500:
return Response::view('errors.error', $error, $code);
break;
default:
return;
break;
}
/*
| Returns null if the error is not 401, 403, 404, 500, 405
| I just have a default of null in the switch on $code.
if(!in_array($code, [401, 403, 404, 500, 405])) {
return;
} …Run Code Online (Sandbox Code Playgroud)