我有一个登录系统.如何使用cookie 实现安全记忆系统.
我应该以cookie用户名和密码存储什么值,但我如何保护它?
我正在Laravel 5 上使用出色的干预库实现一些图像处理。如果图像很小,比如小于 700KB,宽度小于 800px,它就可以正常工作。
但它无法处理大尺寸图像,我想上传 8 MB 宽、2000 像素宽的图像。
我尝试过经典的碰撞方式,memory_limit但它不起作用
ini_set("memory_limit","20M");
Run Code Online (Sandbox Code Playgroud)
有没有什么解决方案可以在不杀死服务器的情况下工作。
这是我的上传服务的代码。它Request::file('file')使用干预从图像中提取图像并将其调整为 3 个尺寸。
拇指宽 200px
public function photo($file)
{
$me = Auth::user();
//user folder for upload
$userFolder = $me->media_folder;
//Check the folder exist, if not create one
if($this->setupUsrFolder($userFolder)) {
//Unique filename for image
$filename = $this->getUniqueFilename($userFolder);
//Bump the memory to perform the image manipulation
ini_set("memory_limit","20M");
//Generate thumb, medium, and max_width image
$img = Image::make($file);
//big_img …Run Code Online (Sandbox Code Playgroud)有没有办法避免页面刷新时出现这种闪烁,它是一个modal以HTML为主的组件slot,但是当我刷新页面时它会闪烁.我的应用程序没有使用路由器,因此它不是完整的SPA.
看到gif.
这是代码.
.body {
padding: 2em;
text-align: center;
display: table-cell;
vertical-align: middle;
}
.modal-mask {
position: absolute;
z-index: 9998;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .5);
display: table;
transition: opacity .3s ease;
}
.modal-wrapper {
display: table-cell;
vertical-align: middle;
}
.modal-container {
width: 70%;
margin: 1em auto;
padding: 20px 30px;
background-color: #fff;
border-radius: 2px;
box-shadow: 0 2px 8px rgba(0, 0, 0, .33);
transition: all .3s ease;
font-family: Helvetica, Arial, …Run Code Online (Sandbox Code Playgroud)我想使用 GeoJSON 数据在 mapbox 地图上显示自定义标签,我name在功能下添加properties了一个color我想显示为区域的多边形填充颜色,我不知道该怎么做,我已经搜索了很多但发现关于这个主题,我对 MapBox 很陌生,需要您的帮助:
这是代码
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'mapbox://styles/mapbox/streets-v9', // stylesheet location
center: [55.2324,25.073], // starting position
zoom: 12 // starting zoom
});
// Draw map
var draw = new MapboxDraw({
displayControlsDefault: false,
controls: {
polygon: false,
trash: false
}
});
map.addControl(draw);
// Add zoom and rotation controls to the map.
map.addControl(new mapboxgl.NavigationControl());
var featureCollection = {
"type": "FeatureCollection",
"features": [ …Run Code Online (Sandbox Code Playgroud) 我有一个mysql表,其中包含以下cols.
Id Name Sex
Run Code Online (Sandbox Code Playgroud)
和性别列有枚举类型('男','女','未指定')
如何在下拉列表中列出枚举值并将当前存储的值设置为选中状态
我已经将这段代码放在一起以获得用户的活动,看他是走路还是开车还是静止,但它不起作用,onHandleIntent从未打过电话.它正在连接到GoogleApiClient.
这是我的代码
活动布局
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<TextView android:text="@string/hello_world" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/msg" />
Run Code Online (Sandbox Code Playgroud)
主要活动
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.ActivityRecognition;
public class MainActivity extends ActionBarActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
private Context mContext;
private GoogleApiClient mGApiClient;
private BroadcastReceiver receiver;
private TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); …Run Code Online (Sandbox Code Playgroud) 我创建了一个自定义TextView来使用Font Awesome支持,当你在layout xml中添加文本(unicode )时它工作得很好.但如果我试图动态使用我的适配器设置文本view.setText(),它不应用字体.
FontView类
public class FontView extends TextView {
private static final String TAG = FontView.class.getSimpleName();
//Cache the font load status to improve performance
private static Typeface font;
public FontView(Context context) {
super(context);
setFont(context);
}
public FontView(Context context, AttributeSet attrs) {
super(context, attrs);
setFont(context);
}
public FontView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
setFont(context);
}
private void setFont(Context context) {
// prevent exception in Android Studio / ADT interface builder
if …Run Code Online (Sandbox Code Playgroud) 我正在将文件上传到s3我希望使用控制器中的以下代码安全地下载它,但它不起作用。
我正在使用 Laravel 5.5,文件可见性在s3.
if( Storage::disk('s3')->exists($file_path) ) {
$file = Storage::disk('s3')->get($file_path);
return response()->download($file);
}
abort(404, 'File not found.');
Run Code Online (Sandbox Code Playgroud)
它给了我这个错误
is_file() expects parameter 1 to be a valid path, string given
...
/home/vagrant/spark-etr/vendor/symfony/http-foundation/File/File.php:36
#1 /home/vagrant/spark-etr/vendor/symfony/http-foundation/File/File.php(36): is_file('\\xFF\\xD8\\xFF\\xE0\\x00\\x10JFIF\\x00\\x01\\x01\\x00\\x00...')
#2 /home/vagrant/spark-etr/vendor/symfony/http-foundation/BinaryFileResponse.php(94): Symfony\\Component\\HttpFoundation\\File\\File->__construct('\\xFF\\xD8\\xFF\\xE0\\x00\\x10JFIF\\x00\\x01\\x01\\x00\\x00...')
#3 /home/vagrant/spark-etr/vendor/symfony/http-foundation/BinaryFileResponse.php(53): Symfony\\Component\\HttpFoundation\\BinaryFileResponse->setFile('\\xFF\\xD8\\xFF\\xE0\\x00\\x10JFIF\\x00\\x01\\x01\\x00\\x00...', 'attachment', false, true)
#4 /home/vagrant/spark-etr/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(125): Symfony\\Component\\HttpFoundation\\BinaryFileResponse->__construct('\\xFF\\xD8\\xFF\\xE0\\x00\\x10JFIF\\x00\\x01\\x01\\x00\\x00...', 200, Array, true, 'attachment')
Run Code Online (Sandbox Code Playgroud)
该文件已打开s3,因为我在下载之前检查是否存在。
转储$filevar 给我这样的二进制文件
请帮忙
我想创建一个圆形条,随着它的进展,它会变得更粗.
是否可以使用css或svg,它可以在离子移动应用程序上运行.
这是我想要实现的目标:
这里是起点的小提琴:
.wrap {
background: #0b1626;
padding: 2em;
color: #FFF;
font-family: 'Arial Black';
}
.knob {
position: relative;
margin: 0 auto;
padding: 1.5em;
width: 220px;
height: 220px;
border-radius: 50%;
border: 1px solid #e84d51;
}
.knob .val {
padding-top: 1em;
font-size: 28px;
text-align: center;
}Run Code Online (Sandbox Code Playgroud)
<div class="wrap">
<div class="knob">
<div class="stats">
<p class="val">16,858<br>1,285</p>
</div>
</div>
</div>Run Code Online (Sandbox Code Playgroud)
我想在 angular 应用程序中online使用拨打电话之前检查用户是否在$http,作为后备,我会得到cached dataif 网络不可用。
有没有像before回调$http这样的选项来运行这个检查?
或者也许有任何其他方式来解决这个问题,我有network state& 缓存localstorage
php ×4
android ×2
javascript ×2
laravel ×2
amazon-s3 ×1
angularjs ×1
cookies ×1
css ×1
css-shapes ×1
css3 ×1
enums ×1
geojson ×1
intervention ×1
ionic ×1
java ×1
mapbox ×1
mapbox-gl-js ×1
mysql ×1
remember-me ×1
svg ×1
textview ×1
vue.js ×1
vuejs2 ×1