Sunday 29 January 2017

Use Particle without WIFI




ref:
https://community.particle.io/t/can-a-photon-boot-without-wifi/17685/7
https://community.particle.io/t/solved-make-photon-run-code-without-being-necessarily-connected-to-the-particle-cloud/25953/2
https://community.particle.io/t/using-photon-without-internet-connection/19061/3
https://docs.particle.io/reference/firmware/photon/#manual-mode

Wednesday 25 January 2017

Coding Environment: Sublime + Ctags + CScope


Step 0: Install Sublime

For Sublime-Text-2:
sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text
For Sublime-Text-3:
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer


Step 1: Install Package Control

 - Open Sublime => Ctrl + ~

 - Copy either of these two at the text editor at the bottom.

Sublime text 3

[code]import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())


Sublime text 2

[code]import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

 - Restart Sublime.

Step 2: Install Ctags Plugin

 - Go to: Preference -> Package Control -> Install Package

 - Input ctags and install it.

 - sudo apt-get install exuberant-ctags
Step 3: CScope

...

ref:
http://askubuntu.com/questions/172698/how-do-i-install-sublime-text-2-3
https://www.granneman.com/webdev/editors/sublime-text/packages/how-to-install-and-use-package-control/
https://packagecontrol.io/installation#st2
http://www.lai18.com/content/2459203.html?from=cancel
http://www.cnblogs.com/bluestorm/p/5680527.html






Saturday 14 January 2017

How to Use diff and patch to Compare and Merge Things/Versions

I was working on a few test branch versions this week and I've discovered some bugs. When I want to return to the developing branch versions, I'd like to find out what did I do to fix the bugs and patch them into the developing versions. Therefore, I need to use diff and patch to do that.

(1) diff
Suppose I am comparing directory/folder/file A and B:
                            diff -c -a -b -x *.tag -x *.log A B > AB.diffexplanation:
    > -c     output difference with content format
    > -a     compulsory text mode
    > -b     ignore blank difference
    > -x     filter the files don't want to be compared (more patterns apply)

(2) patch
to be continue...


ref:
http://blog.csdn.net/magicpang/article/details/3030089