VNC Notes

1.每次服务器关闭后,都要重新kill,重新申请vnc端口号。否则出现“authentication failure”

#vncpassword 修改密码
#vncserver -geometry 1280x1024(不能是*,用小写x(字母)) 设置vnc server分辨率
#vncserver -alwaysshared 设置vnc的同一个显示窗口可以连接多个客户机,一般默认是连接最后发送连接请求的客户机
vncserver -kill :15 暴力停止vnc server(一定要记得冒号前加空格,否则kill失败。开多个端口而不用,很浪费资源,一般就一个)

登录进去后,黑屏:
1。一般是因为xstartup配置信息错误,直接把别人的拷过来就行
2。然后重启vncserver(重新开端口),搞定。
(检查下是否需要更改权限 chmod 777 xstartup 用ll可查看文件的读写权限--不确定)。

VNC的基本运行原理和一些Windows下的远程控制软件很相象。VNC的服务器端应用程序在UNIX和Linux操作系统中适应性很强,图形用户界面十分友好,看上去和Windows下的软件界面也很类似。在任何安装了客户端的应用程序(vncviewer)的Linux平台的计算机都能十分方便的和安装了服务器端的应用程序(vncserver)的计算机相互连接。另外,服务器端 (vncserver)还内建了Java Web接口,这样用户通过服务器端对其他计算机的操作就能通过Netscape显示出来了,这样的操作过程和显示方式比较直观方便。

在Linux中,VNC包括以下四各命令:vncserver,vncviewer,vncpasswd,和vncconnect。大多数情况下我只需要其中的两个命令:vncserver和vncviewer。下面对这些命令详细描述:

vncserver
此服务程序必须在在主(或遥控)计算机上运行。你只能作为使用者(不需要根用户身份)使用此项服务。

vncviewer
本地应用程序,用于远程接入运行vncserver的计算机并显示其环境。
你需要知道远程计算机的IP地址和vncserver设定的密码。

vncpasswd
vncserver的密码设置工具。vncserver服务程序没有设置密码将不能运行(好习惯)。
如果你没有设置,运行vncserver时它会提示你输入一个密码。
所以,一般我不会单独运行这个命令来设置密码。

vncconnect
告诉vncserver连接到远程一个运行vncviewer的计算机的IP和端口号。
这样我就可以避免给其他人一个接入的密码。

Xvnc
一个vnc“主控”程序,一般来说不需要直接运行。(vncserver和vncviewer实际上是Xvnc的脚本)

查找所有可用的选项,运行:
Xvnc --help

出于安全的考虑,一般不建议直接以超级用户帐号运行vncserver程序。如果你需要超级用户的环境,请以一般用户登录后再使用su命令登录到超级用户帐号

Miscellaneous Notes

  1. The objective of natural language processing:
    The processing power of computers is huge, we need to take advantage of this processing power. There is a gap between natural language and computer language (formal language). NLP is designed to fill this gap.

  2. A sentence can be syntatically correct while semantically meaningless.
    Semantic grammar should be replaced by syntactic grammar in semantic parsing.

  3. Dependency grammar (dependency relations) are used to generate subject-verb-predict relationship, then this s-v-p relation is used to generate a semantic representation of the sentence (first-order-logic). To interoperate with other semantic systems. this FOL representation may need to be aligned with other representations.

  4. IN pycharm setting, saving theme settings (on your own name) should be performed on the "font" section instead of the "Colors&Fonts" section to change the background color of editor.

  5. In java, a package name must be a fully qualified name start from the top of the package. An import can be performed at the package level or the class level. In contrast, a golang package import can only be performed at the package level, also, the package declaration are at the current package only, fully qualified name is not needed.

  6. If a method has side-effect, then it will modify the value of memory outside of the local space.

  7. C++ function without overload can accept the specified type value as argument, such as sleep() in time.h.

  8. In C/C++ context, the programming API is mostly provided by the OS instead of the language spec/std library itself. Notably, glibc, posix standards, etc. However, C++11 provides standard libraries that are quite convinent. Most c and c++ "standard" libraries are provided by GNU, with a few useful third-party libraries such as boost being popular as well.

ES6 and JSX Study Note

  1. A function can be legidmitly called without giving required arguments.

  2. The building block of a react app is react element (which is a html element with JSX sytax embedded). React element can be generated by expanding react component (which is a collection of react elements).

  3. React component take the form of either ES6 function or ES6 class. React elements or smaller react components should be returned by the parent component when implemented as a ES6 function. When implemented as a ES6 class, react elements or smaller react components should be provided in the render() method definition (via "return" keyword).

  4. React components accepts props as the container to pass data down through the component chain.

  5. In react, an event is defined as a function and passed as inline HTML event property: "onClick=function" using JSX syntax.

  6. "state" can be updated via setState function. This function assign a new object to the state of a component. "setState" function accepts a annonymous function rather than a property assignment.

  7. State and preState are predefined react properties.

  8. React.Component has setState method

  9. In react, a render(return()) mehthod can only accepts a as input, that is to say, only "one" element can be rendered. Multiple elements should be wrapped into one to be rendered. A react component can render multiple smaller components without wrapping.

  10. In react, inline css style should be put into an object definition rather than string. The naming convention is camel case.

  11. The local state of a component can only be assigned directly when initialization (in the constructor). Otherwise the only way to revise it is through setState method.

Linux Path Notes

Path of Executable

This is the path that corresponds to the first part in a full command.

Executable can be either full path or just file name.
Example: gcc abc.c

The full path of an incomplete executable (gcc) is looked up in the path list defined by the environment variable PATH (defined in the .bashrc, .configure, system init scripts, etc).

Path of Arguments

Arguments (if it is a file in the file system) can be either full path or just file name.

If the argument is given by only a file name. The path is regarded as a relative path (relative to the current working directory). The full path is then generated to be used by the executable.

Maven Plugin Notes

maven-jar-plugin

  1. 协助Jar打包
  2. org.apache.maven.plugins
    maven-jar-plugin



    sparkexample1.App


maven-assembly-plugin

  1. The Assembly Plugin for Maven is primarily intended to allow users to aggregate the project output along with its dependencies, modules, site documentation, and other files into a single distributable archive.
  2. org.apache.maven.plugins
    maven-assembly-plugin
    2.4


    jar-with-dependencies



    com.your-package.MainClass




    package
    single


手动添加jar包以满足mvn依赖需求

1.加载jar包到本地 (以加载saxon-dom-9.0.jar为例)

首先在工程的pom.xml文件中加入


net.sf.saxon
saxon-dom
9.0

pom.xml配置完成后,再执行以下命令:

mvn install:install-file -DgroupId=net.sf.saxon -DartifactId=saxon-dom -Dversion=9.0 -Dpackaging=jar -Dfile=/home/ubuntu/saxon-dom-9.0.jar

说明:-Dfile指第三方jar的路径,其它的注意要确保maven命令中groupId、artifactId、version与pom.xml中的配置相同,-Dpackaging表示加载的文件类型

  1. 例子:
    mvn install:install-file -DgroupId=log4j -DartifactId=log4j -Dversion=1.2.17 -Dpackaging=jar -Dfile=/home/rao/.m2/repository/log4j-1.2.17.jar

mvn install:install-file -DgroupId=org.apache.htrace -DartifactId=htrace-core -Dversion=3.1.0-incubating -Dpackaging=jar -Dfile=/home/rao/.m2/repository/htrace-core-3.1.0-incubating.jar

Polymorphism and Generics

  1. Polymorphism refers to the fact that method invocation of a variable (identifier) is applied by calling the specific method of the object that it refers to rather than the method defined by the variable's type. Polymorphism occurs when a parent method is overloaded by the child class. Or by method overload in the same class level.

  2. Generics refers to the mechanism that the type of the argument(s) allowed in class instantiation/method invocation is more than one.

  3. The possible overlapping of polymorphism and generics: method with only one parameter.

Unity3d Study Notes

FixedUpdate

(Also called physics step)

Runs with physics
1. Input.GetAxis will return a value between 0 and 1
2. Input.GetAxisRaw will return a value -1, 0, 1

NormalUpdate

Runs with rendering

Axis

Axes are actually inputs.

GetComponent<>()

This is a constructor that returns the reference of a component object of the same GameObject that this class attached on by type name.