Would like to repeat the ls -l command on unix command line every 30 seconds?
$ while true; do ls -l; sleep 30; done;
Thursday, April 26, 2007
Wednesday, April 25, 2007
How to turn on QuickEdit Mode for cygwin
Want to get right button copy and left button drag select works in cywin?
Here are the steps:
Here are the steps:
Right click on the icon in the upper left of the title bar
and select properties Under Options, select 'QuickEdit Mode',
hit ok Select 'Modify shortcut that started this window'
Tuesday, April 24, 2007
How to select a element without specific attribute?
I ran into this simple question in one of my task:
Here is how you select an element without a specific attribute:
Here is how you select an element without a specific attribute:
B[@C=''] selects B that has no C attribute or has attributePlease refer to here.
with empty value.
B[not(@C)] seelcts b that don't have a C attribute
B[not(@*)] selects B that have no attribute.
Tuesday, April 17, 2007
Wednesday, April 11, 2007
vi replace with confirmation and replace with regex group
Search from every line, replace confirmation (with [y]es)
:%s/search_string/replace_string/gc
Replace with regex group:
:%s/<img alt="\(.\+\)"\ssrc=.\+/\1/gc
Vi simple tutorial
Some examples:
You have [admin, admin1, user3], and you would like to change it to ['admin','admin1','user3']; here your are:%s\(\w\+\)/'\1'/gc
:%s/search_string/replace_string/gc
Replace with regex group:
:%s/<img alt="\(.\+\)"\ssrc=.\+/\1/gc
Vi simple tutorial
Some examples:
You have [admin, admin1, user3], and you would like to change it to ['admin','admin1','user3']; here your are:%s\(\w\+\)/'\1'/gc
Monday, April 9, 2007
IntelliJ supports UTF-8?
One of my colleague complained that the IntelliJ does not support UTF-8 correctly:
- System.out.println("Dealer Caterpillar ciężkiego używanego wyposażenia i używanych części"); when you run it, the special character corrupted.
- After you safe the java file, restart the Intellij, the special character corrupted.
Thursday, April 5, 2007
Gvim: encoding puzzles.
You can reload a file using a different encoding if vim wasn't able to detect the correct encoding:
:e ++enc=<encoding>
for example:
:e ++enc=utf-8
Choose a font type like Courier New.
You can achieve both of these by adding the following lines in your gvim startup configuration file .vimrc:
set enc=utf-8
set guifont=Courier_New:h11:cDEFAULT
How to comment multiple lines in vim?
Place cursor at the beginning of the first line you want to change.
Press Ctrl+v
Move the cursor down to the last line you want to change.
Press I (The capital letter after H and before J)
Type in the text you wish to insert
Press Esc
Now all lines selected should show the inserted text.
Want to insert new line in file?
try \r, like:
%s/,/,\r/gc
Subscribe to:
Posts (Atom)