参考链接
月度存档: 2018年12月
单例模式
class Manager {
// 工厂模式
factory Manager() =>_getInstance()
static Manager get instance => _getInstance();
static Manager _instance;
Manager._internal() {
// 初始化
}
static Manager _getInstance() {
if (_instance == null) {
_instance = new Manager._internal();
}
return _instance;
}
}
调用
Manager manager = new Manager();
Manager manager2 = Manager.instance;
升级wordpress发现502,于是查找接近方式,有人提出执行如下命令
mv /usr/lib64/libsqlite3.so.0.8.6 /usr/lib64/libsqlite3.so.0.8.6.bak
当时并未发现异常,但是当需要git pull时,发现提示如下
fatal: unable to access ‘xxxx’: Problem with the SSL CA cert (path? access rights?)
尝试各种解决方式,当尝试如下方法时
yum update -y nss curl libcurl
发现提示
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
No module named sqlite
Please install a package which provides this module, or
verify that the module is installed correctly.
It’s possible that the above module doesn’t match the
current version of Python, which is:
2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
If you cannot solve this problem yourself, please go to
the yum faq at:
于是怀疑是之前操作引起的问题,恢复后可以pull
阿里云服务器维护日常
查看硬盘剩余空间
df -hl

- 文件系统 Filesystem
- 容量 Size
- 已用 Used
- 可用 Avail
- 已用% Use%
- 挂载点 Mounted on
String pathvideo = "你的网络视频路径";
//加载视频第一帧
Bitmap bitmap = getNetVideoBitmap(pathvideo);
holder.img.setImageBitmap(bitmap);//对应的ImageView赋值图片
public static Bitmap getNetVideoBitmap(String videoUrl) {
Bitmap bitmap = null;
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
//根据url获取缩略图
retriever.setDataSource(videoUrl, new HashMap());
//获得第一帧图片
bitmap = retriever.getFrameAtTime();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} finally {
retriever.release();
}
return bitmap;
}
参考链接