2016年12月28日 星期三

Node.js

  • Node.js® 

    1. a JavaScript runtime built on Chrome's V8 JavaScript engine
      • 一種用JavaScript寫的virtual machine (translator)
    2. uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.
    3. npm (package ecosystem) is the largest ecosystem of open source libraries in the world.

  • General

    • install: Node.js v7.3.0 and npm v3.10.10
    • JavaScript
    • NVM (Node Version Manager), nave

  • Web

  • Database

    • mongoDB
    • mongoose

  • Multimedia 

    • fluent-ffmpeg
    • image-ninja
    • sharp
    • GraphicsMagick
    • ImageMagick
    • canvas


  • http://cnodejs.org

2016年12月26日 星期一

The BAR

Samuel J. Tilden
Memorial read before the Association of the bar of the city of New York,
Tuesday, December 14th, 1886

The bar,
if it is to continue to exist,
if it would restore itself to the dignity and honor which it once possessed,
must be bold in defence and,
if need be, bold in aggression.

2016年12月20日 星期二

Keynote, Page如何從裡面抓圖?

常常投影片打完,要用到裡面的圖或影片時,不知道怎麼取出來.
圖會用土法煉鋼,"command+shift+4"截圖到桌面,影片就...

其實這些資料在Sierra的Mac OS中都是可以直接用的:

1. 在Finder中複製一個原檔(點雙指後選"Duplicate", or "command+C", "command+V")
2. 將"xxx copy.key"改名為"xxx copy.zip" (會跳出視窗要你確認)
3. 點兩下"xxx copy.zip",解開後看到一個"xxx copy"的資料夾
4. 那一堆圖、影片等,就在Data下面

省下一堆時間!

參考

2016年12月13日 星期二

MT7688 Firmware


Build from source

Document

 

Environment

  • 用MBP跑VirtualBox (ubuntu 14.04),跑了三小時還沒跑完...找台電腦灌native Linux較實在!
  • Host: 14.04.3 LTS

Source

  • LinkIt Smart 7688 firmware v0.9.4
  • OpenWrt Linux distribution (Chaos Calmer 15.05.1)
firmware$ git clone git://git.openwrt.org/15.05/openwrt.gitbin/ramips/openwrt-ramips-mt7688-LinkIt7688-squashfs-sysupgrade.bin

bootloader$ git clone https://github.com/MediaTek-Labs/linkit-smart-uboot.git

kernel packagebin/ramips/packages/base/

Buttons (MPU, WiFi buttons) 的使用

F/w upgrade — USB
  1. 按住WiFi button
  2. 按一下MPU button後放開
  3. WiFi燈熄掉後 (or 按住至少 5sec)再放開WiFi button
Reset MPU
按一下MPU button

切換到AP mode
按住WiFi button 至少5 sec後再放開
http://192.168.100.1/

Cross-compile C/C++

  • Openwrt-SDK-LInkit
    • package  (source code)
      • helloworld
        • Makefile
        • src
          • Makefile
          • helloworld.c
    • build_dir (executable binary)
      • target-mipsel_24kec+dsp_uClibc-0.9.33.2
        • helloworld
          • helloworld
    • bin  (install package)
      • ramips
        • package
          • base
            • helloworld_1.0.0-1_ramips_24kec.ipk


在 Openwrt-SDK-LInkit 目錄下
> make V=99

執行executable binary
產生的
executable binary在 build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/helloworld 下

確認產生的executable binary格式
> cd build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/helloworld
> file helloworld


executable binary upload到Linkit Smart中> scp helloworld root@mylinkit.local:/root

登入Linkit Smartssh root@mylinkit.local> .helloworld

安裝package> cd bin/ramips/package/base> scp helloworld_1.0.0-1_ramips_24kec.ipk  root@mylinkit.local:/root

登入Linkit Smartssh root@mylinkit.local> opkg install



2016年12月4日 星期日

Mac Xcode


Xcode 8.0

$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

$ pod --version
1.1.1

$ sudo gem which cocoapods
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods.rb


sudo gem install -n /usr/local/bin cocoapods


Melange -- Bad Land



利吉惡地, 利吉月世界


2016年11月28日 星期一

Android Develop


What actually happens when you swipe an app out of the recent apps list?

Difference between killing an app by clearing it from Recent Apps menu and “Force Stop”



NavigationView.setItemIconTintList(null);

Facebook Login for Android


http://stackoverflow.com/questions/28387602/notification-bar-icon-turns-white-in-android-5-lollipop/39142981#39142981

http://stackoverflow.com/questions/30795431/icon-not-displaying-in-notification-white-square-shown-instead

http://stackoverflow.com/questions/8589880/how-can-i-change-included-xml-layout-to-another-layout-on-java-code

http://stackoverflow.com/questions/18999601/how-can-i-programmatically-include-layout-in-android


2016年11月16日 星期三

NORDIC nRF51



S130

nRF51 Series - Common Application Libraries

nRF52832 System OFF with Wake on Reset
GPIO Wakeup from System OFF Not Working
nrf51822 wake-up on interrupt and send advertisement

RAM Retention Example
Definitive information on GPREGRET register

PWM/buzzer


nRF52

  • MDK 515 -- from Atlas
  • nRF52 SDK
  • Softdevice s132
- hex file: https://www.nordicsemi.com/eng/nordic/Products/nRF52832/S132-SD/48743

  • I2C (TWI)
http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk52.v0.9.2%2Ftwi_master_with_twis_slave_example.html


Part

  • BLE module: MDBT40
    • http://raytaccorp.blogspot.tw/
  • freescale: MMA 8451



http://www.compuphase.com/software_termite.htm



Module
https://www.nordicsemi.com/chi/node_176/node_20262


https://devzone.nordicsemi.com/blogs/22/getting-started-with-nrf51-development-on-mac-os-x/
https://devzone.nordicsemi.com/blogs/648/recent-updates-to-rknrfgo/

2016年11月9日 星期三

東京八景 -- 太宰治


井之頭公園,是東京市郊知名景點.
武藏野這邊的夕陽也被列為東京八景之一.

太宰治嘗試著翻閱自己胸中的相本,想決定其他七景.


但,稱得上藝術的,並不是東京的風景,而是風景中的自己.

是藝術欺騙了自己,還是自己欺騙了藝術?
結論,自己本身就是藝術.


「戶塚的梅雨,本鄉的黃昏,神田的祭典,柏木的初雪,八丁堀的煙火,芝的滿月,天沼的日落,銀座的閃電,板橋腦科醫院的大波斯菊,荻窪的晨霧,武藏野的夕陽」

不滿意別人以藝術之名來決定的東京八景,
所以想試著自己決定東京的美景.
回憶的黑暗花朵卻紛紛跳出,難以整理.
也覺得勉強整理八景是卑鄙的事,

而在那年的春、夏,又發現了自己的二景.


不滿意目前的旅程,但是當初自己規劃完又覺得是最佳的.

真正走過後才覺得不然時,只能再等下一次的旅程.

不滿意目前的創作,構思、下筆之時卻總覺得是最好的.

只好在創作中批判自己的創作,想表達自己想要呈現的,其實比真實寫出來的更好...

到底追求完美的過程中,

會出現多少次的不完美?
要如何面對這些不完美?
又要如何從中決定哪些是可以給人欣賞的完美?

現在的完美,或許是過去的不完美,也有可能是未來的不完美.


人生,到底要如何面對所謂的完美?

看來還是只能無從選擇地面對,不完美

所以只好,「獻給苦難的人們」.




旅人滑著手機中的照片,想挑出幾張代表照
手機中的照片算是藝術嗎?

那真正的藝術,
是拍攝這些照片的自己,
還是拍攝到的景本來就是藝術?

挑了半天的照片,
結果忘了真的藝術根本不是照片.

永恆是完美的話,

我們只能選擇,面對 如此短暫的永恆 的 不完美.

這就是旅人.

向鴻全◎太宰治──在風景中懺悔自剖的東京 - 聯合文學

2016年9月12日 星期一

葛的斯堡(蓋茲堡)公墓的獻詞

1863年11月19日
林肯在賓州的蓋茲堡國家公墓揭幕式中發表此演說,
哀悼在長達五個半月的蓋茲堡之役中陣亡的將士。

Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.

Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.

But, in a larger sense, we can not dedicate -- we can not consecrate -- we can not hallow -- this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us -- that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion -- that we here highly resolve that these dead shall not have died in vain -- that this nation, under God, shall have a new birth of freedom -- and that government of the people, by the people, for the people, shall not perish from the earth.



2016年7月14日 星期四

MT7688

Linkit ONE
https://github.com/twilio/linkit-one-sensor-samples/tree/master/Libraries
https://github.com/intel-iot-devkit/mraa/blob/master/examples/python/bmp85.py


seeedstudio 的 LinkIt-Smart-7688


Forums

I2C
https://github.com/sajingeo/i2crw






PWM LED

Basic Concepts of MRAA

Get Started with the MediaTek LinkIt™ Smart 7688 Development Platform

Using OpenWrt SDK to Build C/C++ Programs


ssh-keygen -R 192.168.3.10

> brew install coreutils
> alias readlink=“greadlink”

Copying Files To the Board


Eclipse

brew
apt-get install gawk
apt-get install ccache
vi scripts/ipkg-build (ogargs, format=gnu)


MRAA
blinky/Makefile 
  DEPENDS:=+libmraa
  $(eval….. +libmraa))

  1. brew install sdl --use-gcc
  2. brew uninstall ffmpeg
  3. brew install ffmpeg --use-gcc --with-ffplay

MCS


Wi-Fi






https://labs.mediatek.com/forums/posts/list/3785.page
https://wiki.openwrt.org/toh/seeed/linkit7688