`
文章列表
< Installing software from source in Linux - 1.2 > So you've downloaded a software package with tar.gz or tar.bz2 extension and have no idea what to do with it. Or perhaps you already know that it's most likely the source code of the program you want to install and you have to compi ...
1. to show current mysql version: >show variables like '%version%';   2. create database or table with specified character set & collate: >create database default character set utf8 collate utf8_general_ci; >create table <table-name>(columns...)   default character set utf8 ...

Colors

    博客分类:
  • Tips
1. Classic windows backgroup: R:58 G:110 B:165
  How to use 4 spaces instead of tab in vim:   1 :set ts=4   2 :set number   3 :set autoindent   4 :set expandtab   5 :set softtabstop=4   6 :set shiftwidth=4 :set showmode :set number :set nonumber :set ts=2 --------- display tab as 2 size(or add [:set ts=2] in ~/.vimrc, if not existi ...
1. declare the interface of libray:  max.h  ------------------------------  int max(int,int); 2. implement the interface:  max.c  ------------------------------  #include "max.h"  int max(int a, int b)  {    return a > b ? a : b;  } 3. code the invoker:  main.c  ----------------------- ...

const

    博客分类:
  • C
There are two type of const: 1. const int  *p;  <----- pointer 'p' is not const, while to what it points is const.e.g.: int i; const int ci = 5; const int *p; p = &i; p = &ci; *p = 10; // error here   2. int *const cp; <----- the pointer 'cp' is const, you can't reassign value ...
1. highlight warning log message in eclipse console: Configure two separate appenders. One for the levels WARN and higher and one for the levels INFO and lower. Assign them to the std.err and std.out. Here a config example:       <appender name="CONSOLE.ERR" class="org.apache ...
0. install compiler and associate environment. sudo apt-get install build-essential or install with CD(without internet): sudo apt-cdrom add sudo aptitude update sudo aptitude install build-essential gcc -v   1. The printf("Content-type:text/plain\n\n"); is mandatory for cgi prog ...
1. A class with a given name can only be loaded once by a given classloader.   2. When the JVM is started, three class loaders are used:     1.Bootstrap class loader - loads the core Java libraries(<JAVA_HOME>/lib directory). This class loader, which is part of the core JVM, is writtern i ...
1.Generally speaking the only way to get a Container-Managed Resource is via dependency injection or lookup from within a Container-Managed Component.   2. Singleton a.Singletons have an '@Startup' annotation which can be applied to the bean class. When used, the Container will instantiate the ...

Spring

    博客分类:
  • Java
1. @Autowired vs. setter @Autowired can mark in field or setter, with @Autowired, setter is not necessary; If @Autowired is not apply to property, then setter is necesary for injection.   2. @Controller, @Service, @Repository, @Component     <context:annotation-config />     <contex ...
1.persistence.xml -------------------------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">     <persistence-unit name ...

Apache Ant

    博客分类:
  • Java
1. Add additional command line arguments for <javac> task: <javac srcdir="${dist}/trsWeb" destdir="${dist}/build/trsWeb"     fork="true" classpath="${compile_classpath}" source="1.5" target="1.5"     nowarn="true"> ...
1. Problem: log4j:WARN Document root element "log4j:configuration", must match DOCTYPE root "null". Solution: Add '<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">' to log4j.xml     e.g.:     <?xml version="1.0" encoding="UTF-8" ?& ...
0. useful commands:     mvn install:install-file -DgroupId=org.apache.maven.archetypes -DartifactId=${myArtifactId} -Dversion=RELEASE -Dpackaging=jar -Dfile=/path/to/file     mvn deploy:deploy-file -DgroupId=org.apache.maven.archetypes -DartifactId=${myArtifactId} -Dversion=RELEASE -Dpackaging=j ...
Global site tag (gtag.js) - Google Analytics