Write high quality and maintainable code with collarjs

 

collar-login-playback

 

Check this post for full text:

http://blog.bohou.fr/2016/08/25/write-high-quality-and-maintainable-code-with-collarjs/

 

 

Why it is difficult to make high quality code?

High quality software relies on how developers understand the code:

What is the architecture? How is data structure defined? How does data flows? What does the code do? and why? Where is the best place to put my code? Will my code impacts other codes and cause bugs? Will my code cause the failure of other functions? Which framework is used in the code? How to implement it with this framework?

Developers need to have a clear answer to these questions to make high quality code.

However, these questions are not easy to answer especially when there are thousands of or millions of lines of code (LoC). It is very hard to reconstruct code-owner’s thoughts by simply reading the code line by line. Even the code-owner himself can’t remember his original thoughts if the code is created weeks ago.

Today, I will introduce a javascript library collar.js to help developers build high quality software.

 

Check this post for full text:

http://blog.bohou.fr/2016/08/25/write-high-quality-and-maintainable-code-with-collarjs/

 

ActiveMQ simple authentication configuration

To configure the simple authentication of ActiveMQ, you should specify the simple authentication config file when you start your activeMQ, like this:

 1. cd to your activeMQ directory
 2. export ACTIVEMQ_ENCRYPTION_PASSWORD=activemq
 3. bin/activemq start xbean:libexec/conf/activemq-security.xml

The file libexec/conf/activemq-security.xml contains the username and password.

Note: if you can NOT launch the activeMQ, you can use the following command to see more details

bin/activemq console xbean:libexec/conf/activemq-security.xml

Continue reading

How to install and configure tomcat 6 in ubuntu server

Tomcat is a well known and widely used java servlet container. These days I am planning a project, which needs a tomcat 6 in ubuntu server. I found that to make tomcat work in ubuntu is very easy, but you need have a little trick to change your server listening port from 8080 to 80. Here I give you the way that I make it work.

1. Install tomcat 6 in ubuntu

normally, you just need to type the following command to install it

sudo apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user tomcat6-docs tomcat6-examples

2. Start tomcat

Continue reading

How to install and configure mod_python in apache 2 server

Recently I got a new server and need to host a service on it. I found that there are tons of versions for the installation and configuration of mod_python in apache 2 server, which made me confused. Here I try to make this process more clearly.

My server installed  ubuntu server 10.10, but i think it works for the other debian distribution.

Installation

First install apache 2, type the following command in terminal:

Continue reading

How to install gnuplot in Mac OS X lion

I just bought a macbook pro recently. The first thing that I need is to setup the latex environment to write. The tex installation is not hard to achieve, you can just search “mac os latex installation” in google, you will find the dmg file to install it. The problem is I need gnuplot to draw charts, but there is no mac os binary for the latest version. So i tried to compile it my self. It is not hard but need a little trick.

First, download the latest gnuplot source from here: http://sourceforge.net/projects/gnuplot/files/gnuplot/

Continue reading

Change the icon size in Unity 2D Launcher

I have intalled ubuntu 11.04 for several days, the new unity looking is amazing, that’s why I try to upgrade all my ubuntu systems to version 11.04, including a several years old one.  The fancy effect can not be displayed because it does not support the unity 3D. Luckily, I got the unity 2D. It works good, but not configurable. The thing I want to change most is the icon size, 48 px for me is too biiiig.

A little google work gives me this link: http://www.ubunturoot.com/2011/02/remove-and-rearrange-items-in-unity-2d.html

Maybe it works for the other machines, but failed in my case.

I try to read these qml files for a while and figured out the way to change the size of the icon in unity 2d. It’s not perfect, (cause it only changes the size of the icon and the around decoration, the width of the launcher can not be changed 😦 ) but for me it is acceptable.

Continue reading