Thursday, March 18, 2010

Change End of Line characters in eclipse

In Eclipse, go to window -> preferences -> workspace

In the bottom right handside of workspace, you will see,
New Text File Line Delimiter,
Click on other, and change it to Unix.

See Image below.



Cheers,
Sonu

Remove Ctrl M characters in vi

To remove windows end of line characters, Ctrl M characters in vi

1) open the file in vi
vi
2) Type the following
To get ^M, press ctrl key on your keyboard and press v and m

:%s/^M//g

3) dont forget to save the file with :wq!

Enjoy.

Monday, February 22, 2010

Forcing index- SQL

So if cust_num is the 6 th index created on the table. Here is how you force the index while querying the database table :

select * from tranhist (6) where cust_num='AA25150'

Thursday, February 18, 2010

Excel Printing header on each line

Goto File -> Page Setup -> goto sheet tab -> In Print Titles section, Rows to repeat at top, enter the range of rows you would like to repeat : $1:$1

http://www.mrexcel.com/tip129.shtml

Wednesday, February 3, 2010

SQL Not in vs Join example

Obviously SQL join is more efficient than the not in clause. Here is an example of both.


Most inefficient Not in query :

select count(*)
from
wire_instr w
where
w.short_code
not in (select short_code
from nostro_accts)


Slightly better Not Exists query :

select count(*) from
wire_instr w
where not exists(
select 1
from nostro_accts n where
n.short_code=w.short_code)


Finally the Join query :

Join infact creates a new table which

select w.short_code as wshort,n.short_code as nshort from wire_instr w
left outer join
nostro_accts n
on n.short_code=w.short_code
where n.short_code=null

Enjoy
-Sunny

Friday, January 29, 2010

Replace with new line in eclipse

To replace comma with new line in edit plus.

clrl h in eclipse, enter the character you want to replace, in this case ,
for the new line, click on the downward arrow next to the text and then select new line. See the picture below.



Cheers,
Sonu

Eclipse VM Args

Multiple VM args can be entered to eclipse by separating them with a space. See the picture below :




2) Issue : Eclipse doesnot allow spaces in vm arguments.

You can force eclipse to take a space by wrapping the value of your argument in double quotes.

-Dpropsfile="H:/user data/eclipse/workspace/wires/etc/dev.config.props"

Cheers,
Sonu