413 Request Entity Too Large
http://blog.csdn.net/fdipzone/article/details/45544497
| Syntax: | client_max_body_size size; |
|---|---|
| Default: |
client_max_body_size 1m; |
| Context: | http, server, location |
Sets the maximum allowed size of the client request body, specified in the “Content-Length” request header field. If the size in a request exceeds the configured value, the 413 (Request Entity Too Large) error is returned to the client. Please be aware that browsers cannot correctly display this error. Setting size to 0 disables checking of client request body size.
最简单的Weex图片加载器(IWXImgLoaderAdapter 简单实现)
package pro.yanglong.weex;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.util.Log;
import android.widget.ImageView;
import com.taobao.weex.adapter.IWXImgLoaderAdapter;
import com.taobao.weex.common.WXImageStrategy;
import com.taobao.weex.dom.WXImageQuality;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
/**
* Created by YangLong on 2017/11/13.
*/
public class ImageAdapter implements IWXImgLoaderAdapter {
@SuppressLint("StaticFieldLeak")
@Override
public void setImage(String url, ImageView view, WXImageQuality quality, WXImageStrategy strategy) {
if (url == null) {
return;
}
Log.d("hello", url);
final Bitmap[] bmp = new Bitmap[1];
final String _url = url;
final ImageView _view = view;
new AsyncTask() {
@Override
protected Void doInBackground(Void... params) {
InputStream in = null;
try {
in = new URL(_url).openStream();
bmp[0] = BitmapFactory.decodeStream(in);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void result) {
if (bmp[0] != null)
_view.setImageBitmap(bmp[0]);
}
}.execute();
}
}
相关知识:
在Java语言中,线程是一种特殊的对象,它必须由Thread类或其子(孙)类来创建。通常有两种方法来创建线程:其一,使用型构为Thread(Runnable)的构造子将一个实现了Runnable接口的对象包装成一个线程,其二,从Thread类派生出子类并重写run方法,使用该子类创建的对象即为线程。值得注意的是Thread类已经实现了Runnable接口,因此,任何一个线程均有它的run方法,而run方法中包含了线程所要运行的代码。线程的活动由一组方法来控制。Java语言支持多个线程的同时执行,并提供多线程之间的同步机制(关键字为synchronized)。
Failed to prepare TableSyncChunk plugin: Cannot chunk table `xxx`.`xxx` using the character column skey, most likely because all values start with the same character.
Failed to prepare TableSyncChunk plugin: Cannot chunk table `doufu`.`user_login` using the character column skey, most likely because all values start with the same character. This table must be synced separately by specifying a list of –algorithms without the Chunk algorithm at /usr/bin/pt-table-sync line 4088. while doing doufu.user_login on web3
pt-table-sync --print --execute --databases xxx h=master,u=repl,p=xxx,D=xxx,t=xxx h=slave --no-check-slave --lock=1 --charset=utf8mb4 --algorithms=Nibble,GroupBy,Stream
加参数 –algorithms=Nibble,GroupBy,Stream
MySQL查询数据库所有表的记录数排行
use information_schema;
SELECT
table_name, table_rows
FROM
tables
WHERE
TABLE_SCHEMA = ‘xxx’
ORDER BY table_rows ASC;
微博登陆:查询用户access_token的授权相关信息,包括授权时间,过期时间和scope权限。
http://open.weibo.com/wiki/Oauth2/get_token_info
到底是GET还是POST?
MySQL UPDATE JOIN
JOIN似乎不太满足这里的需求子查询更好
UPDATE novel
SET
chat_num = (SELECT
COUNT(*)
FROM
chats
WHERE
novel_id = ? AND status = 1)
WHERE
id = ?
UPDATE JOIN 似乎无法使用limit
UPDATE pay_record
JOIN
article_info ON article_info.id = pay_record.object_id
SET
novel_id = special_id
WHERE
ISNULL(novel_id) AND pay_record.id = 17;
php-fpm和软连接(symbolic link)
今天成功部署了代码发布系统,每次发布通过软连接来发布,发布后发现代码不生效,然后发现需要reload php-fpm来生效,着很不好,php-fpm是共享的,影响多个项目,随便reload会可能导致用户报错
七牛移动文件
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Storage\BucketManager;
$accessKey = 'Access_Key';
$secretKey = 'Secret_Key';
//初始化Auth状态:
$auth = new Auth($accessKey, $secretKey);
//初始化BucketManager
$bucketMgr = new BucketManager($auth);
//你要测试的空间, 并且这个key在你空间中存在
$bucket = 'Bucket_Name';
$key = 'php-logo.png';
//将文件从文件$key 改成文件名$key2。 可以在不同bucket移动
$key3 = 'php-logo3.png';
$err = $bucketMgr->move($bucket, $key2, $bucket, $key3);
echo "\n====> move $key to $key2 : \n";
if ($err !== null) {
var_dump($err);
} else {
echo "Success!";
}
https://github.com/qiniu/php-sdk/blob/master/examples/file_move.php
js中const,var,let区别
今天第一次遇到const定义的变量,查阅了相关资料整理了这篇文章。
主要内容是:js中三种定义变量的方式const, var, let的区别。
- const定义的变量不可以修改,而且必须初始化。
- var定义的变量可以修改,如果不初始化会输出undefined,不会报错。
- let是块级作用域,函数内部使用let定义后,对函数外部无影响。
原文地址:http://www.cnblogs.com/ksl666/p/5944718.html