Tuesday, November 6, 2012

Blood Pressure Chart


The 1st Number: Systolic pressure is the blood pressure when the heart muscle contracts.


The 2nd Number: Diastolic pressure is the blood pressure when the heart is relaxed.



Tuesday, October 9, 2012

Remove duplicates in excel

Excel remove duplicates :

1.Select all the rows, including the column headers, in the list you want to filter.

2.On the Data menu, point to Filter, and then click Advanced Filter.

3.In the Advanced Filter dialog box, click Filter the list, in place.

4.Select the Unique records only check box, and then click OK.

The filtered list is displayed and the duplicate rows are hidden.

5.On the Edit menu, click Office Clipboard.

The Clipboard task pane is displayed.


6.Make sure the filtered list is still selected, and then click Copy .

The filtered list is highlighted with bounding outlines and the selection appears as an item at the top of the Clipboard.
7.On the Data menu, point to Filter, and then click Show All.

The original list is re-displayed.
8.Press the DELETE key.

The original list is deleted.

9.In the Clipboard, click on the filtered list item.

The filtered list appears in the same location as the original list.

Source : http://office.microsoft.com/en-us/excel-help/delete-duplicate-rows-from-a-list-in-excel-HA001034626.aspx

Friday, October 5, 2012

Create Java inline thread

import java.util.Date;

public class InlineThreadDemo {
 public static void main(String[] args) {
System.out.println( "parent thread " + new Date(System.currentTimeMillis())); // launch child thread using
// inline declaration
new Thread( new Runnable() {
public void run() {
try {
Thread.sleep(10 * 1000);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println( "child thread " + new Date(System.currentTimeMillis()));
}
}).start();

System.out.println( "parent thread " + new Date(System.currentTimeMillis())); }}


Wednesday, October 3, 2012

Two guards riddle - one will always lie

You are imprisoned in a chamber with two doors as the only exit. One door leads to death by cancer, filled with complications and malpractice; the other door leads to riches of jewelry, money and fine clothing for the rest of your life. There are two guards standing before you: one guard always lies; the other always tells the truth. Of course, you don’t know their identities. You can ask only one question to save your life. What should you ask?



Solutilon :
This is a logic question and can be answered if one realizes that the TRUTH of a LIE is a LIE, and the LIE of a TRUTH is a LIE. You need one guard to give you the other guard’s answer. Knowing this one could ask a question like, “If I were to ask the other guard which door leads to freedom, what would he say?”


If you ask the guard who always tells the truth, he would tell you the other guard would point you to the door of death. If you ask the guard who always lies, he would tell you the opposite door of the truth-telling guard and point you to the door of death. In either case, both guards will point to the door of death so you should choose the other one

Monday, September 17, 2012

Prevent Picasaweb private albums from redirecting to Google +

When I shared my private albums on Picasaweb, via e-mail only, the damn thing is still redirecting to Google Plus. I have trouble viewing these albums in firewall settings and not everyone of my friends has Google+. Here is how you prevent this from happening.

 You take the link with Auth key to your private album, and add  "&noredirect=1" in the end. That should work. Not sure why this is default behaviour when you wanted to share via e-mail. I hate Google+. There can be better integration.

 https://picasaweb.google.com/103124484697486858492?authkey=XXXXXXXXXXXXXXXXXXXX&noredirect=1

-Enjoy.

Friday, September 7, 2012

Unix vi commands

 I hated these black screens and these unix commands in particular. Trying to book mark so I wont forget ;)

Go to First line of the file  - :1
Go to last line - Shift G
Move up - k
Move down - j
Move left - l
Move right - h

Move forward by one word - w
Move backward by one word - b

Move to the end of line : $
Move to the beginning of line : 0 (zero)

And there is a lot more, all well documented here below :

http://www.ccsf.edu/Pub/Fac/vi.html

Monday, July 9, 2012

SVN merge branch to trunk in subclipse

1.First of all make sure you are up to date. Update your working copy of the target branch, ie. where you are merging into. In this example we're working on the trunk of "core" and we want to grab the changes that have happened in the maintenance branch and merge them.


2.Resolve any conflicts. There should be no conflicts at this stage between the working copy and the repository.

3.Select the SVN merge option on the working copy. In Eclipse this is going to be found under the "Team" menu and called "Merge Branch". SVN: Merging in Eclipse

4.Change the From URL to the specific branch you want to be merged into your working copy. In this example we're looking for the p400 maintenance branch (./core/branches/p400).

5.Change the From Revision to the last revision that was merged into the target branch. Essentially you don't want to keep merging the whole branch history, you just want to include those changes since the last time you merged. There is no easy way to determine the last merge point at this time in Subversion. You have to review your message log and look for the last commit that talks about merging. If you are disciplined about the commit messages you use for merging this should be easy (see below). Make a note of what that revision is -- you'll need this later when you commit your changes. SVN: Merge with Eclipse

6.Change the To Revision to the latest (i.e. head). Make a note of what that revision is -- you'll need this later when you commit your changes.

7.Click Merge and wait. Depending on how big the differences are this may be quick or Eclipse my just fall over. If you have such an enormous change that you can't get it done in Eclipse you may need to make the range of revisions you are merging smaller. Or you may even have to skip certain revisions and do them manually if they are massive. We've had this problem from time to time when updating large third-party libraries. The vast majority of the time you will be fine.

8.Review changes and resolve conflicts. Once the merge is complete, look through the changes made to your working copy and make sure you address any conflicts you find.

9.Once all the changes have been resolved in the target working copy, check them in with a single commit. The reason you're not doing lots of commits is that these are changes that should have been documented in the branch from which you merged. The commit message needs to be in a specific format that details the merge and is easy to find in the future. We use the following format, but you can use anything that works for you -- as long as you stick to it.


courtesy : http://stackoverflow.com/questions/3611693/merging-of-branch-to-trunk-in-svn-using-eclipse

Wednesday, June 13, 2012

Outer join vs Not in

Using outer join to find records in table1 which are not in table2

In this case, I have records in table, playdb..pbt_cusip_pool ( with cusips not in mast..sec_mst) and I need to find them. This outer join works better than not in and not exists clauses.

When you do the outer join, it will show everything from the first table, although not matched with the second table, value from the second tbl will be null, and that is what we are tapping into by using where s.cusip = null :) try it out.. this is fun.

select p.cusip, s.cusip from playdb..pbt_cusip_pool p
left outer join mast..sec_mst s
on (p.cusip = s.cusip)
where s.cusip is null



Tuesday, January 31, 2012

Check user sessions in Sybase

1) right click on the database (ex: SYCORP_DB1)
2) DBTools
3) Session Manager
4) There is an option on the top to copy all rows
5) Paste them to excel

External Link :