Archives:

mutex , semaphore, monitor, condition variable No ratings yet.

mutex, semaphore,  monitor, condition variable are basic computer science concepts, but can easily get confused. some notes here. mutex:  thread has ownership, released by the one who acquired it.  no execution order ( motivation for semaphore’s schedule constraint) it is usually available in the libc/glibc pthread implementation. source code of pthread_mutex_lock() at: https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_mutex_lock.c;h=493fe4377821c3e14382eeb32a6c6ef414a9289c;hb=e0043e17dfc52fe1702746543127cb4a87232bcd semaphore:  basically manipulate the • Read More »




C++ function overloading, name mangling, name hiding No ratings yet.

C++ function overloading, name mangling, name hiding are somehow related to the same issue: overload resolution at compile time ( note override is run-time resolution). What is C++ Function overloading: two or more functions have same name and but have different parameters/signature. The way compiler distinguishes those different functions is adding additional information about arguments to function • Read More »


ipv6 testbed at home No ratings yet.

It is quite easy to setup a ipv6 testbed at home now. (1) setup linux ipv6 router apt-get install radvd  # on a vm or real box debian and copy the sample config to /etc/radvd.conf /etc/init.d/radvd restart (2) linux workstation autconfig The linux workstation should be able to autoconfig an ipv6 address ( without ” iface br0 • Read More »


maven vs make No ratings yet.

maven basic On debian 8: apt-get install mvn  # this will install maven 3.0 mvn archetype:generate –DgroupId=com.mycompany.app –DartifactId=my–app –DarchetypeArtifactId=maven–archetype–quickstart –DinteractiveMode=false it basically  mkdir -p src/main/java/  ( put your java file here), create an pom.xml 2. mvn compile #install clean Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, • Read More »


Tomcat 8, hibernate 4 and Eclipse Mars (4.5.1) No ratings yet.

On Debian 8 (1) download and install JDK 8 from oracle (2) download and install Eclipse IDE for Jave EE (3) apt-get install  tomcat8 tomcat8-admin tomcat8-examples tomcat8-user mysql-server (4) git clone https://github.com/mingewang/HibernateDataSource it seems only hibernate 3’s format are accepted. (5) mvn install, it should generate .war file (6) mysql to create db using info from http://www.journaldev.com/2905/hibernate-tomcat-jndi-datasource-example-tutorial • Read More »