Wednesday, August 28, 2013

AIX netstat show PID

Refer to: https://www.ibm.com/developerworks/community/blogs/brian/entry/determine_which_processes_have_listening_ports_on_aix15?lang=en


The netstat command in AIX is a little bit different.

# netstat -Aan | grep LISTEN | grep 30001
f100050000b05bb8 tcp

# rmsock f100050000b05bb8 tcpcb

Sunday, August 25, 2013

Eclipse doesn't show right color under Ubuntu

Refer to:
http://askubuntu.com/questions/70599/how-to-change-tooltip-background-color-in-unity

Install and open gnome-color-chooser .
Go to Specific → Tooltips and put black foreground over pale yellow background.

Saturday, August 24, 2013

Error creating managed object for class org.jboss.weld.servlet.WeldListener

I choose to let glassfish publish new changes automatically and when I was adding @Named to one EJB, this error popped up.

Solution: Restart Eclipse and it is gone.

Friday, May 17, 2013

Procedure compiled with errors

select * from SYS.USER_ERRORS where NAME = 'PROCEDURE NAME' and type = 'PROCEDURE'


show errors procedure sonica.PALLET_DESTACKER_TEST

Thursday, April 18, 2013

Select Nth Row From A Table In Oracle

Original link:
http://stackoverflow.com/questions/4509167/select-nth-row-from-a-table-in-oracle


select * 
  from ( select a.*, rownum rnum
           from ( YOUR_QUERY_GOES_HERE  ) a
          where rownum <= N_ROWS )
 where rnum >= N_ROWS

Monday, April 8, 2013

Search a string in clob ---ORACLE

replace table_name, column_name and string

select * from table_name where dbms_lob.instr(column_name,'string')>0;

Thursday, April 4, 2013

Eclipse auto save before run

Here has the correct answer:

http://stackoverflow.com/questions/2943122/eclipse-auto-save

The second one is correct:

if 

Window -> Preferences -> General -> Workspace and there you can check "Save automatically before build" + "Build automatically" 

don't work try this 

Preferences -> Run/Debug -> Launching -> "Save dirty editors before launching"

Monday, April 1, 2013

Compile and run Java in vim

The is the original post in stackoverflow:

http://stackoverflow.com/questions/6411979/compiling-java-code-in-vim-more-efficiently

I added two lines to it:

F12 can jump out of quickfix mode
F8 can run the java program

vimrc:


autocmd Filetype java set makeprg=javac\ %
set errorformat=%A%f:%l:\ %m,%-Z%p^,%-C%.%#
map <F9> :make<Return>:copen<Return>
map <F10> :cprevious<Return>
map <F11> :cnext<Return>
map <F12> :ccl<Return>
map <F8> :!java %:r<Return>

Thursday, February 7, 2013

PLSQL developer 8, oracle client 32 bit 10g and windows 7

Problem:

Even I use the 32 bit oracle client 10g on my windows 7 machine, I still can't use PLSQL developer 8 correctly. Every time I try to log in, it pops up an empty window with no error message.

Solution:

Right solution is found here:
http://stackoverflow.com/questions/3895354/allround-automations-pl-sql-developer-on-windows-7-tns-over-ip-connect-to-remo

RUN IT AS ADMINISTRATOR!!!!

Friday, February 1, 2013

Youtube has no sound in Chrome

Problem:

I was trying to play a video on youtube in Chrome. It has the video but with no sound. The system speaker works fine and I can listen to the music played by the media player. Therefore, the conclusion is that there is something wrong with Chrome.

Solution:

Open an IE and set it as default browser. Then restart Chrome.

Tuesday, January 22, 2013

Can't change default jre even though path has been modified

Problem:

The Path in environment variable is using JDK1.6 but java -version shows actually JRE 1.7 is being used.

Solution:

I am on a Windows 7 machine. I am using this way but I don't like it.

Go to C:\Windows\System32, change the java.exe and javaw.exe to whatever you like.
Then the system will pick up the setting in Path.

Wednesday, January 9, 2013

error: can't create transaction lock on /var/lib/rpm/__db.000

error: can't create transaction lock on /var/lib/rpm/__db.000

Solution:

Install it as root user.