新章

以前球隊在回防時, 教練總會說"快跑! 別回頭, 到定點再休息". 關於人生, 喘息點在哪兒? 我想就在滴水穿石之間! Week7 (02/17) 發現minimal-mistakes上缺了繁中, 便開了個PR#838 沒想到很快就被merge, 效率真快. 試玩BeautifulSoup 寫了個簡單的ck101Comics.py用來下載卡提諾×揪漫畫. 網路文章 Diving Into Android ‘M’ Doze & Diving into Doze Mode for Developers Android Doze在Nougat多了Light-Doze, Light-Doze的Maintenance Windows較短為了避免不同步問題, 當進入Deep-Doze(原本Marshmallow的Doze), Light-Doze會進入OVERRIDE不做任何事. 網路資源 E-book: Python for Informatics 讀書心得 Tuesdays with Morrie 讀完The Classroom, 直到這章節都是在講Mitch離開大學後的生活及偶然聽到電視上提到Morrie, 師生俩如何再度搭上線. Morrie對Mitch有很深的情感, Mitch稱他為’Coach’. “Dying,” Morrie suddenly said, “is only one thing to be sad over, Mitch. Living unhappily is something else. So many of the people who come to visit me are unhappy.” - The Classroom, p35. 論文學習 POSIX Has Become Outdated 透過libtrack觀察Andorid, OS X, and Ubuntu, 發現為了UX(user experience)與符合modern workload, 不同的OS實現原本不足且鮮少使用的POSIX abstractions, 其中IPC及Asynchronus I/O的部份更是被取代. 最後結論提到新的POSIX standard 需要著重於graphics, IPC, and threading. Week8 (02/24) 照顧小孩真的很殺時間, 尤其是老婆出國時. 西班牙海鮮燉飯(Paella Marinera) 試了做一次, 覺得是道擺盤容易, 色彩豐富, 但想做的好吃要再練練的料理. 另外Tortilla de patatas整個失敗…. ...

February 16, 2017 · 2 min · oopsmonk

Android Adoptable Storage

A study of adoptable storage in Android Marshmallow and Nougat. How to Setup a Private Disk (External USB Storage) Android adoptable storage allow APP install to external storage that can reserve more internal space for other APPs. Create Adoptable Storage Using Settings GUI Settings -> Storage & USB -> Portable storage -> Settings -> Format as internal Use sm (Storage Manager) Command Find disk id # sm list-disks disk:8,16 disk:8,0 Format as internal # sm partition disk:8,0 private # sm list-volumes all public:8,17 mounted 629C-FBAF emulated:8,2 unmounted null private mounted null emulated mounted null private:8,2 mounted 3f538e6e-e6a9-4163-ac1e-e4c6602b3c34 Now, it’s a private storage in system. ...

February 13, 2017 · 8 min · oopsmonk

Android Media Framework

Android APIs for media playback: MediaPlayer and MediaCodec. MediaPlayer mediaPlayer.setDataSource(path); //fd or url mediaPlayer.setDisplay(SurfaceHolder sh); //SurfaceView or VideoView mediaPlayer.prepare(); // MediaPlayer.start(); // MediaCodec /* init use MediaExtractor to get mime data create decoder by mime type configure decoder by video format and surface view */ MediaExtractor mExtractor; MediaCodec mDecoder; mExtractor = new MediaExtractor(); mExtractor.setDataSource(filePath); MediaFormat format = mExtractor.getTrackFormat(track_index); String mime = format.getString(MediaFormat.KEY_MIME); if mime.startsWith("video/") mExtractor.selectTrack(track_index); mDecoder = MediaCodec.createDecoderByType(mime); mDecoder.configure(format, surface, null, 0 /* Decoder */); mDecoder.start(); /*run start decode video, fill / empty buffer */ MediaCodecExample ...

June 16, 2016 · 3 min · oopsmonk

Android build error on Ubuntu 16.04 LTS

After update system from Ubuntu 14.04 to 16.04, I got some problems, when I was building Android source code. openjdk-7-jdk is gone Add PPA for OpenJDK7 sudo add-apt-repository ppa:openjdk-r/ppa sudo apt remove openjdk-* icedtea-* icedtea6-* sudo apt update && sudo apt install openjdk-7-jdk git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng maven If you have other java version in system, make sure your java version is correct. ...

June 7, 2016 · 2 min · oopsmonk

Android Full Disk Encryption Workflow (default encryption)

This study is based on Android Marshmallow. Android full disk encryption use dm-crypt, which works with block devices. Please refer to the following docs for more detail: Full Disk Encryption How to setup full disk encryption Android support forceencrypt and encryptable encryption flags, and only support ext4 and f2fs file systems. Setup forceencrypt fstab.bullhead: /dev/block/platform/soc.0/f9824900.sdhci/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check,forceencrypt=/dev/block/platform/soc.0/f9824900.sdhci/by-name/metadata Setup encryptable fstab.hammerhead: /dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check,encryptable=/dev/block/platform/msm_sdcc.1/by-name/metadata Related Properties and source code location Related source code: ...

April 29, 2016 · 3 min · oopsmonk

LibCEC on Raspberry Pi

Install requirements sudo apt-get install build-essential autoconf liblockdev1-dev \ libudev-dev git libtool pkg-config cmake libxrandr-dev -y Python and Swing support (Optional) sudo apt-get install python-dev swig -y Checkout and build libcec source code The current version is libcec-3.0.1, but I got an error as follows: make[2]: *** No rule to make target '1', needed by 'src/libcec/libcec.so.3.0.1'. Stop. Using libcec-3.0.0 instead of libcec-3.0.1, it’s work properly. git clone https://github.com/Pulse-Eight/libcec.git cd libcec git checkout libcec-3.0.0 -b cec3.0.0 Checkout platform source ...

November 3, 2015 · 11 min · oopsmonk

Firefox is Really Slow

Firefox is extremely slow on my system, include menu, right-click, tab opening…etc. Mozilla Firefox 40.0 Xubuntu 14.04 LTS 64-bit Linux 3.16.0-45-generic #60~14.04.1-Ubuntu SMP Fri Jul 24 21:16:23 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux After I turned off hardware acceleration, everything is fine. Type this in the browser’s address bar to trun it off: about:preferences#advanced

August 18, 2015 · 1 min · oopsmonk