Thursday, May 22, 2014

ZR6AIC: How to setup Putty to do X forwarding for Linux Ub...

ZR6AIC: How to setup Putty to do X forwarding for Linux Ub...: How to setup Putty to do X forwarding for Linux Ubuntu and Raspberry Pi. (Remote desktop your Linux)Remote control your Linux and Raspberry...

Tuesday, May 6, 2014

关于JavaScript


AngularJS基于GoogleV8 JavaScript 引擎,将JavaScript转成native machine code prior to execution

MEAN 框架
AngularJS, NodeJs, ExpressJs with MongoDB as backend.  Together these are popularly referred as MEAN stack technologies.
  • MongoDB - NoSQL Database .Written in C++, MongoDB features: JSON-style documents with dynamic schemas and Full Indexing support.
  • NodeJS - Core -
  • ExpressJS - Web app framework - Express is a minimal and flexible node.js web application framework, providing a robust set of features for building hybrid web applications.
  • AngularJS - JS MVC - AngularJS is a client-side JavaScript framework , maintained by Google, that assists with running single-page applications.

Angularjs-Nodejs-Angular.png

Monday, April 21, 2014

第六周主题:数字 之 GrayCode in LeetCode (in java)

题目:
要求:
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of gray code. A gray code sequence must begin with 0.
For example, given n = 2, return [0,1,3,2]. Its gray code sequence is:
00 - 0
01 - 1
11 - 3
10 - 2
Note: For a given n, a gray code sequence is not uniquely defined.
For example, [0,2,3,1] is also a valid gray code sequence according to the above definition.
For now, the judge is able to judge based on one instance of gray code sequence. Sorry about that.
解答:
画画就出来了。为了好分析,我们看n=4的情况,那么一共有2^4=16种codes
0 0 0 0
0 0 0 1
0 0 1 1
0 0 1 0
0 1 1 0
0 1 1 1
0 1 0 1
0 1 0 0
1 1 0 0
1 1 0 1
1 1 1 1
1 1 1 0
1 0 1 0
1 0 1 1
1 0 0 1
1 0 0 0
规律:
(1)第一列对半分成up 和down 部分, up都是0,down都是1;
(2)从二列开始,在前一列子列的基础上,再对半细分成up和down部分,如果在第一列的down部分,则需要把01序列倒过来。

References: