Posts

run Java in ubuntu

Running Java in Ubuntu can encounter issues as following: 1. NoClassDefFoundError issue If you got NoClassDefFoundError like below: Exception in thread "main" java.lang.NoClassDefFoundError: com/example/test/TestException Caused by: java.lang.ClassNotFoundException: com.example.test.TestException at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) Could not find the main class: TestClass. Program will exit. It is most properly that the java $CLASSPATH is not correctly set. Like setting the "Java build path" in eclipse. You can check the $CLASSPATH first: ~$ echo $CLASSPATH solution 1: ~$ export CLASSPATH=$CLASSPATH:/path/to/external/lib:/...

ubuntu usage tips

1. how to check ubuntu OS version (tested in 12.04) a. uname -a Result for 32-bit Ubuntu: Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386GNU/Linux whereas the 64-bit Ubuntu will show: Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 x86_64 x86_64x86_64 GNU/Linux or b file /sbin/init Result for 32-bit Ubuntu: /sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped whereas for the 64-bit version it would look like: /sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped 2. install .deb package To install a downloaded Debian (Ubuntu) package (.deb): Open Terminal and type sudo dpkg -i DEB_PACKAGE To remove a Debian (Ubuntu) package (.deb):  sudo dpkg -r PACKAGE_NAME ...

Google Ads Developer Blog: New Developments for the DFA API

Google Ads Developer Blog: New Developments for the DFA API : We have some exciting changes and important announcements for the DoubleClick for Advertisers community as we begin to improve our overall ...

荷兰学生研发世界首辆太阳能“家庭汽车”Stella

Image
近日,来自荷兰爱因霍芬科技大学的一群学生们研发出了称为是世界上第一辆使用太阳能的家庭用车--Stella。据他们自己介绍,这辆车将在世界太阳能挑战赛中跑上1800多英里。   届时,裁判将根据Stella的速度、能源转换率、载重量以及简易操作性做出评比。 这辆车除了在启程的时候需要借助太阳能发电站之外,其他8天的比赛时间中则都直接使用来自汽车收集的太阳能。另外,开发小队还对这辆绿色能源汽车进行了一些功能上的改进,从而让它变得更加“智能化”。比如说驾驶者将可以通过一个触屏进行所有的操控、方向盘将会“收缩或扩展”通知驾驶者车速是否过慢或过快。 10月6日,Stella将和其他9支竞赛队伍在澳大利亚进行角逐。 来源:中文业界资讯站

GUN Parallel quick start

GUN Parallel is a nice job management tool in Linux system. Detail usage of the tool can be found here . Below will give a quick start for using this tool, which took me 2 hours to figure it out. It is easy to install it in linux system. -Download the parallel (eg.  parallel-20130622.tar.bz2 )  here . You can choose the latest version. -Unzip the tar.bz2 file -Copy the parallel perl file in path parallel-20130622/src to linux /bin/ file. Then parallel is installed. An example to use parallel instead of  bash "for" loop. Specifically about the array usage. Loop #! /bin/bash group=(a b c) for $i in  $group do       bash test.sh $i done #!/bin/bash group=(a b c) parallel --header : bash test.sh {group} ::: group ${group[@]} #use --header parallel bash test.sh {1} ::: ${group[@]} #not use --header explanation: --header is used to define the name of the variable which is helpful if there are more variables for the parallel. Note: sp...

eclipse can not detect the wrong functions

Today, when I use php function "fputs" and I made a typo as "fput", and did not get an red cross for this wrongly usage, I thought I hit a bug in the eclipse php error detection plug-in. After searching for 30 mins, I found no people talking about this. And after a test, I found, seems misspelling standard functions in php is actually not an "error", though I thought it should be. I think that is because functions can be customized, like class. Thought seems it is simple, but I still think it is a good idea to add the typo error to the standards functions.

Ctrl+Z to run cmd on background in Linux system

Control + Z   is really a nice function in linux system. It helps to suspend and dose good management of the running cmds in a terminal. Here is a good explanation of the usage of  Control + Z A simple summary: Control + Z   to suspend the cmds in the terminal. You must use "bg" to re-run the suspend/stoped cmds. F + G  (fg) to bring the output of the cmds back. B + G  (bg) to run the cmds in the background jobs : to checks all the running jobs in a terminal, if you have several jobs running there, then they will be listed with a job number kill (-9) %1 : to kill the running  jobs of number 1. If it can not be killed, use kill -9 %1 .