月度归档:2017年04月

SM961驱动三星官方下载地址

http://www.samsung.com/semiconductor/minisite/ssd/download/tools.html

3.1:

https://s3.ap-northeast-2.amazonaws.com/global.semi.static/SAMSUNG_SSD_970_Driver_190125/7FD357322A6707A720E1A71EF11A3BE1EED819E011D317626415F0281A68833C/Samsung_NVM_Express_Driver_3.1.exe

2.3:
http://downloadcenter.samsung.com/content/DR/201710/20171026151637517/Samsung_NVM_Express_Driver_2.3.exe

2.2:
http://www.samsung.com/global/business/semiconductor/minisite/SSD/downloads/software/Samsung_NVM_Express_Driver_22.zip

950pro
http://www.samsung.com/global/business/semiconductor/minisite/SSD/downloads/software/Samsung_NVM_Express_Driver_22.zip

laravel初始化与权限配置

准备工作:安装composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

创建新项目:项目名“codepub”

composer create-project --prefer-dist laravel/laravel codepub
# 进入新项目目录
cd codepub

目录权限配置
nobody是nginx的运行用户,嫌麻烦可以直接chmod 777 -R .
确保这两个目录有可写权限

[root@i codepub]# chown nobody:nobody storage -R
[root@i codepub]# chown nobody:nobody bootstrap/cache -R

这个时候运行会报错

RuntimeException in Encrypter.php line 43:
The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

解决办法是(估计是在生成和配置一个密匙之类的,.env文件可以看到变化):

php artisan key:generate

奇异的慢查询,MYSQL慢查询之坑

这是个慢查询

SELECT *, `user_id` as uid
FROM (`journals`)
WHERE `user_id` IN ('1456870', 2573141) 
AND `status` =  1
ORDER BY `id` desc
LIMIT 20

这个则不是

SELECT *, `user_id` as uid
FROM (`journals`)
WHERE `user_id` IN (1456870, 2573141) 
AND `status` =  1
ORDER BY `id` desc
LIMIT 20

scrollView.setOnScrollChangeListener

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    scrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
        @Override
        public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
            Log.i("iTag.scrollY", String.valueOf(scrollY));
            Log.i("iTag.oldScrollY", String.valueOf(oldScrollY));
            if (scrollY < 0 && oldScrollY < 0) {
                textView.setText("");
                doGet();
            }
        }
    });
}

WebView

WebView webView = (WebView) activity.findViewById(R.id.web1);
if (webView.getUrl() == null) {
    webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().supportMultipleWindows();
    webView.setWebViewClient(new WebViewClient());
    webView.setWebChromeClient(new WebChromeClient());
    webView.loadUrl("http://www.baidu.com/");
}