bulreed 2015-03-30T03:52:47+00:00 bulreed@gmail.com MacOS上利用Sublime与Ctags查看代码 2015-03-30T10:44:00+00:00 bulreed http://bulreed.github.io/Sublime-Ctags 下载安装SublimteText,搜索安装了个破解版,还不错。

利用brew安装Ctags

brew install ctags

因为原来系统下有ctags,在/usr/bin/ctags;

利用brew安装完之后,会安装在/usr/local/Cellar/ctags/5.8_1

创建别名:

alias ctags="`brew --prefix`/bin/ctags"

并且将别名添加到系统脚本

alias ctags >> ~/.bash_profile

然后就可以利用Sublime和Ctags查看代码

利用ctags -R -f .tags,代码之间可以互相切换

]]>
github 启动之旅 2015-03-21T01:03:00+00:00 bulreed http://bulreed.github.io/start-github 今天准备开始在github上记录生活和学习的感悟与经验,过去太懒,不愿动手,也不愿动脑 得失且不论,努力为之

这个模板是拷贝github上hustcat.github.io的,仅仅是为了方便,里面涉及到的统计数据,都没有用自己的 不过也没有关系。

现在开始吧。

]]>
Android得到视频缩略图 2014-10-23T21:34:00+00:00 bulreed http://bulreed.github.io/android-video-snapshot Android得到视频缩略图,可以通过接口类 MediaMetadataRetriever 来实现

具体可以看代码

public Bitmap getVideoThumbnail(String filePath) {
            Bitmap bitmap = null;
            MediaMetadataRetriever retriever = new MediaMetadataRetriever();
            try {
                retriever.setDataSource(filePath);
                bitmap = retriever.getFrameAtTime();
            } 
            catch(IllegalArgumentException e) {
                e.printStackTrace();
            } 
            catch (RuntimeException e) {
                e.printStackTrace();
            } 
            finally {
                try {
                    retriever.release();
                } 
                catch (RuntimeException e) {
                    e.printStackTrace();
                }
            }
            return bitmap;
}

其中函数getFrameAtTime()有其他重载函数,该函数会随机选择一帧抓取,如果想要指定具体时间的缩略图,可以用函数getFrameAtTime(long timeUs), getFrameAtTime(long timeUs, int option),具体如何使用可以查doc。

]]>