Monday, December 28, 2009

Java Eclipse Usage

Here is the step by step usage of Eclipse IDE to run Java programs. I will show you how to run a "hello world" program in Eclipse.

step 1. After installing Eclipse, double click on eclipse.exe in the eclipse folder.

----------------------------------------------------------------------------------

step 2. In the Select a workspace tab, give the path where you want your java programs to be. eg: see the screen shot.



----------------------------------------------------------------------------------

step 3. close the welcome window.



----------------------------------------------------------------------------------

step 4. Click on File > new > Java Project.



----------------------------------------------------------------------------------

step 5. A new window "New Java Project" opens, in the "Project name" tab, fill in your project name, eg: hellomyworld. and click on Finish and NOT next.



----------------------------------------------------------------------------------

step 6. Right click on the "hellomyworld" in the left side and the click "new" and then "file" and a "New File" window will open. Fill in your java file name(make sure that the file name and class name which has main method are the same) and then click Finish.





----------------------------------------------------------------------------------

step 7. In the left side, click on the plus maek beside "hellomyworld", do this similarly to "JRE System Library". Then drag the file from "JRE System Library" to src.



----------------------------------------------------------------------------------

step 8. Write your hello world program in the file "helloworld2.java" by clicking on it in the left side.



----------------------------------------------------------------------------------

step 9. click on the run button (green color) and then check the output in the below window.



Thats it guys, happy programming!!

Thursday, October 8, 2009

Download videos from internet

So Folks, If you are thinking about how to any video from Youtube, google, yahoo, dailymotion, break.com or anywhere in the interent, and also some of these online tools that I am going to tell you can be used to convert audios and videos to any format of your choice.

Let me show you all the best options you can use for downloading:

1) http://keepvid.com/
2) http://clipnabber.com
3) http://javimoya.com/blog/youtube_en.php
4) http://vixy.net/
5) http://www.youtubex.com/
6) http://www.viddownloader.com/
7) http://www.kcoolonline.com/
8) http://download.uzeik.net/eng.php
9) http://downthisvideo.com/
10) http://www.videoronk.com/
11) http://heywatch.com/page/home
12) http://www.mediaconverter.org/
13) http://zamzar.com/url/

In case you do not want to download videos online, then here are some of the most coolest desktop applications which can download videos:

1) http://www.orbitdownloader.com/
2) http://www.vdownloader.es/
3) https://addons.mozilla.org/en-US/firefox/addon/2390
4) http://www.benjaminstrahs.com/
5) http://keepv.com/

Enjoy downloading ... !!

Big Boss 3 Day - 2

Day 2:

Download Video

Day 2 was quite boring except for some chota mota fights. Starting from the alarm, everyone got up and started dancing to dan te nan of Kaminey except for Bhaktiyaar who has no problem with the creepy and annoying alarm and the inmates were seen asking each other, how come he sleeps in this alarm and then Jaya's dance....oops sorry! Jaya jeee's dance for the song was also fun. everyone danced to refresh and then nothing really great happened during the morning hours. It was during lunch time when Vidhu was arranging plates and Poonam came in and asked Vidhu why he did not arrange the glass of water along with the plates. Hearing this Vidhu was quite angry the way Poonam almost ordered him...Actually she did not tell it with good taste and then there was a nok-jok between the big two and then ended up with Vidhu saying that Poonam was a VIP and we were all small people. Anyways, then it was time for deshdrohi's fight with Poonam and Tanaaz. This argument was better than Poonam's and Vidhu's quarrel. The fight was regarding KKR(deshdrohi) not doing the work of the house. Tanaaz's statement was really fun and nice to hear as she said him directly yo his face that he is not important and hearing this deshdrhi shouted saying that he is very important. All this was just fun for the viewers to watch but what goes in the inmates mind is quite not known since our very Shamita madam who was quite chup chaap all the days had to do something to grab the attention, so what did our abla naari do? started crying- first with small tears and then big droplets! actually no one bothered to ask her, that's why. Then Vidhu pacified her about all this. She was called in the confession room and then she told some non sense problem of hers and told Big boss about the environment, i mean negative environment in the house.
Then the fun part started when Sherlyn wanted to get to change her bed..I have to tell you she wanted to change her bedroom itself! yes! you heard it right, she wanted to sleep in the mens room...what a joke.She doesn't want to be with the ladies since she feels left alone...bechaari! Then there was some normal discussion and then deshdrohi was so excited about the duty tonite for safeguarding the tijori since he had do it with firangi Claudia behen. During that time firangi was so pissed because KKR was pissing her off! simple! The day ended up with this scene.

Precap: Vidhu is seen shouting at some one, no clue as to whom..That would be even more interesting.

Tuesday, October 6, 2009

Big Boss 3 - Day 1

Day 1:

Download Video

It was night time and then after everybody had a some hi-hello talks with each one, the daunting sound of Big Boss was heard giving them a shocking news of one of them is going to be eliminated. Tanaaz's face had to be seen, what an actress?? As if she was going out! Anyways, the next morning, each one had to nominate 2 people who would be voted out and the nomination list was quite clear as Jaya Sawanth was easily the favourite among all! Yes people, she was the won who got 9 votes from 13 inmates. And trailing with 4 votes each were Sherlyn Chopra
and our very own Desh Drohi KKR. This was done the next morning. The nomination list for week 1 is as seen below: before that let me remind you that voting is for the perosn who would be evicted from the house by viewers.

celeb nominated(->) person 1 and person 2:

Aditi -> Jaya & Sherlyn
Bakhtiyaar -> Jaya & deshdrohi(KKR)
Claudia -> Jaya & Ismail
Ismail -> Aditi & Claudia
Jaya -> deshdrohi & Sherlyn
Deshdrohi -> Jaya & Poonam
Poonam -> Deshdrohi & Rohit
Raju -> Jaya & Aditi
Rohit -> Jaya & Claudia
Shamita -> Jaya & Sherlyn
Sherlyn -> Deshdrohi & Tanaaz
Tanaaz -> Jaya & Sherlyn
Vindu -> Jaya & Rohit

Nomination summary: Jaya - 9 votes, Sherlyn and Deshdrohi - 4 votes each

Day 1 morning nomination list had lot of stories to tell. Rohit snors loudly as told by Vindu. Poor pehelwaan could not sleep the whole night! There seems to be tension between Tanaaz and Sherlyn. Bechaari Sherlyn was asked to stop singing in the morning by Tanaaz. I wonder why! Their first task was to enact as some member in the family. Ismail became father, no goodies to guess the mother..yes yes it was Jaya jeeee. Raju was one of the daamaat and others being either daughter or son or entangled in some relation. Seems that Big boss 3 wants a soap story also to be created! So everyone enacted according to their character, the only thing good about it was the dresses these people wore. Nothing really fizzy happened except for Big boss calling Vindu, Sherlyn and deshdrohi inside the confession room after they were caught discussing the nomination result. Actually after the nominations were disclosed by Big Boss, deshdrohi was so shocked that his name came in the list..he thought how come his name come in the list since "I am Hero"? But the most shocked was Sherlyn who was seen weeping in the garden area. So she kept on asking one question (chk out the "Things that were funny") to deshdrohi and Vindu and deshdrohi was trying pacifying her for no good. Vindu kept on saying one thing and that is dont discuss nominations since it is against the kaidha kanoon of Big boss, but who would stop the adamant Sherlyn! atlast wohi hua jo hona tha, they were called by Big boss and were asked not to talk about nomination in the future.

Things that were funny: Sherlyn kept on saying one thing " maine in logon ke liye bartan maaanje,phir bhi yeh logon ne mujhe vote kiya, aaj se mein kuch kaam nahin karne vaali! what a joke guys? one thing is for sure, Sherlyn and Deshdrohi's attitude stinks in the house. Beware of lot of fights in the house since there seems to be people with different emotions and mental balance..lolz

Big Boss - 3



Big Boss 3 updates:
Inaugural day ->

The big boss season 3 started with a bang with big B amitabh bachchan as host giving the show its biggest attraction ever.It started with celebrities coming from different ages of life different walks of life coming in to the house of big boss. Let me first tell about the celebs this time in Big boss 3 who are going to be locked in Big boss house, they are:

1 Ismail Darbar
2 Sherlyn Chopra
3 Kamal Rashid Khan
4 Poonam Dhillon
5 Bakhtiyaar Irani
6 Tanaaz Irani
7 Vindu Dara Singh
8 Aditi Gowitrikar
9 Jaya Sawant
10 Shamita Shetty
11 Claudia Ciesla
12 Rohit Verma
13 Raju Srivastav

These celebs also got into the house in the same order.
The whole set up of the stage and red carpet for the celebs' entrance was more than overwhelming.Amitabh bachchan first showed the viewers a view of th ebig boss house and some rules of the house. The house had as usual bedrooms, kitchen,store room and most interesting a jail which would have anyone who breaks the rule of the Big Boss. Celebs started coming one by one starting with Ismail Darbar followed by KKR of Desh Drohi fame, Sherlyn Chopra and many more. Each celeb before getting on to the stage was hugged by their near and dear ones who came to say a last good bye before they entered the big boss house. Each celeb after getting on to the stage had a small chat with Amitabh bachchan, some narrating their childhood memories like Ismail Darbar telling how he still remembers Big B's red color car number and used to sway hands for a hi and have a glimpse of the mega star. Phoonam Dhillon and amitabh had common topics to discuss and that is their incident that happened during the shoot of the movie Trishul. So each celeb had something or the other to say. Before their
chat some celebs even performed. Like Shamita performed on her number sharara sharara and Raju shrivastav has some jokes under his sleeves to crack and make people laugh at. Each celeb moved in the the house and started exploring the house and inmates. So after every celeb had entered the big boss house, every body were sitting on the couch and talking and gup-shupping. Every body seemed to be having a quite chat. Later they were told by the Big Boss about their dinner and store room with luggage kept.After keeping the luggage in their bedroom, they moved on to have their dinner and with that episode 1 came to a wrap.

what to watch out for: the the precap, they show one celeb is going to be eliminated by the inmates. shamita was talking about some person who was nutty(may be KKR) in the confession room and Poonam was talking about some one who was very quite and was not mingling with any one(who would that be). This show is going to turn out to be an interesting one seeing the people who are totally different from one another. You can surely imagine fights and cat fights happen very soon since the big boss house seems to have potential bombs. After Sherlyn's Choli malfunction, wait and watch what else of who all malfunctions!

Twist in Big Boss 3: This time there is going to be non celebrity who would enter the house of Big Boss.

Sunday, October 4, 2009

Stop Slip Disc

With time changing so rapidly the problems like bachaches, neck pain has struck the young people which was common among the older age group few years back. So what is this Slip Disc?
->Disc is the cushion between the two adjacent bones in the spine and when this disc gets displaced from its position, it is called Slip Disc which causes pain in the legs and sciatica and slip disc in the neck causes pain in the arms. So now you know what a slip disc is. If you are wondering what you did to get a slip disc, then see the below checklist:
-> Bad posture while sitting and standing.
-> obesity where in your whole body weight pressure goes on to your spine.
-> lack of sleep and exercise makes your body rusty and more prone to slip disc problems.
-> Smoking, irresponsible and irregular eating habits with inadequate nutrition.
If you are one among those who are lucky enough not to have a slip disc and have had a bad lifestyle, then you now know what not to do!
but for those unlucky ones, surgery is recommended by doctors with severe pain. Proper rest, medicines and physical therapies also can assure to reduce the pain. Meditation, yoga and good exercise also is another treatment.

As the old saying goes, prevention is better than cure, it is always advisable what to do what not to. Have al look below for "Do" and "Don't do" checklist:

Do's:
-> Maintain proper posture while sitting and standing.
-> Exercising at gym should be done as told be the gym instructor.
-> Make a good diet plan with intake of wholesome food.
-> Whether you are a student or working professional, have a good balance between your professional and personal life to keep your stress level low.
-> Exercise regularly.
-> Water intake should be ample, more during summers.
-> Early diagnose and treatment from a physician is a wise decision.

Don't do:
-> Going to those pani puri, pav bhajji stalls, avoid all those fast food eateries.
-> Smoking is injurious to your disc! chalta hai! (don't do it)
-> It professionals should sitting continously in front of the computer, take breaks.
-> Use extra cushion or soft bed and pillows.
-> a small bend and walk is in-style.
-> life without any recreational activities.

Simple and Effective exercises to cure slip disc problem:





So guys you now know what to do, what not not. you also know hot to treat and avoid slip disc. You no longer should let your back pain control your life. So have a happy life without a slip disc.

Saturday, September 12, 2009

Programming in Pro*C/C++

Programming Blogs - BlogCatalog Blog Directory

Introduction
The Oracle pre-compiler is a programming tool that allows you to incorporate SQL statements directly into your program. It takes your source code as input and then translates the embedded SQL statements into Oracle runtime library calls, generating a modified source program that you can then compile, link, and execute in the usual way. This process enables you to write ‘human readable’ SQL within your code, which Oracle can then translate into low level API calls to interact with the database.
The pre-compilers are available for a number of programming languages (e.g. C/C++ and COBOL) and are supported on the majority of today’s platforms (e.g. UNIX and NT). This guide focuses primarily on the C/C++ implementation of the Oracle pre-compiler and provides numerous examples and tips for your development. Please refer to the Oracle installation guide for how to install Pro*C as it can vary from platform to platform.
By running the Pro*C pre-processor against your source code prior to compilation, SQL can be written using a number of different Pro*C 'methods'. These determine how your final application essentially interacts with the database and directly affects the efficiency, flexibility and nature of your SQL. The first section of this guide provides a high-level overview of two such approaches: ‘Embedded SQL’ and dynamic SQL as these are generally the most common forms of Pro*C you will encounter.

Pro*C Syntax
All SQL statements need to start with EXEC SQL and end with a semicolon ";". You can place the SQL statements anywhere within a C/C++ block, with the restriction that the declarative statements do not come after the executable statements.
Example:
{
int a;
/* ... */
EXEC SQL SELECT salary INTO :a
FROM Employee
WHERE SSN=216574419;
/* ... */
printf("The salary is %d\n", a);
/* ... */
}

Preprocessor Directives
The C/C++ preprocessor directives that work with Pro*C are #include and #if. Pro*C does not recognize #define. For example, the following code is invalid:
#define THE_SSN 216574419
/* ... */
EXEC SQL SELECT salary INTO :a
FROM Employee
WHERE SSN = THE_SSN; /* INVALID */

Statement Labels
You can connect C/C++ labels with SQL as in:
EXEC SQL WHENEVER SQLERROR GOTO error_in_SQL;
/* ... */
error_in_SQL:
/* do error handling */
We will come to what WHENEVER means later in the section on Error Handling

Database Types and the Pro*C/C++ Equivalent
There are many combinations for Oracle database types (e.g. CHAR) and their Pro*C/C++ equivalents. For a definitive list you should refer to the Oracle manual, however the following table summarises the most frequently used options from my experience. In general you also need to check which platform your application is going to run on, as the later versions of Oracle for Solaris for example, support the long long C/C++ datatypes (18 digits).

CHAR(1) char variable;
CHAR(N) char variable[N+1];
VARCHAR2(N) char variable[N+1];
NUMBER(N) long variable; Where N<10>10
NUMBER(N,M) char variable[N+1];
DATE char variable[21];

Legal and Illegal usage of host variables
The following code illustrates both legal and illegal host variable references:

int deptnos[3] = { 000, 111, 222 };
int get_deptno() { return deptnos[2]; }
int *get_deptnoptr() { return &(deptnos[2]); }
int main() {
int x; char *y; int z;
/* ... */
EXEC SQL INSERT INTO emp(empno, ename, deptno)
VALUES(:x, :y, :z); /* LEGAL */
EXEC SQL INSERT INTO emp(empno, ename, deptno)
VALUES(:x + 1, /* LEGAL: the reference is to x */
'Big Shot', /* LEGAL: but not really a host var */
:deptnos[2]); /* LEGAL: array element is fine */
EXEC SQL INSERT INTO emp(empno, ename, deptno)
VALUES(:x, :y,
:(*(deptnos+2))); /* ILLEGAL: although it has an
lvalue */
EXEC SQL INSERT INTO emp(empno, ename, deptno)
VALUES(:x, :y,
:get_deptno()); /* ILLEGAL: no function calls */
EXEC SQL INSERT INTO emp(empno, ename, deptno)
VALUES(:x, :y,
:(*get_depnoptr())); /* ILLEGAL: although it has an lvalue */
/* ... */
}

Other Important constructs in Pro*C/C++
Pointers
You can define pointers using the regular C syntax, and use them in embedded SQL statements. As usual, prefix them with a colon:
int *x;
/* ... */
EXEC SQL SELECT xyz INTO :x FROM ...;
The result of this SELECT statement will be written into *x, not x.

Structures
Structures can be used as host variables, as illustrated in the following example:
typedef struct {
char name[21]; /* one greater than column length; for '\0' */
int SSN;
} Emp;
/* ... */
Emp bigshot;
/* ... */
EXEC SQL INSERT INTO emp (ename, eSSN)
VALUES (:bigshot);

Arrays
Host arrays can be used in the following way:
int emp_number[50];
char name[50][11];
/* ... */
EXEC SQL INSERT INTO emp(emp_number, name)
VALUES (:emp_number, :emp_name);

Quick recap with an example
#include
#include
#include
#include
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR uid[30];
VARCHAR pwd[30];
EXEC SQL END DECLARE SECTION;
EXEC SQL INCLUDE SQLCA.H;
void main()
{
strcpy(uid.arr,"SCOTT");
uid.len =strlen(uid.arr);
strcpy(pwd.arr,"TIGER");
pwd.len = strlen(pwd.arr);
EXEC SQL WHENEVER SQLERROR GOTO errexit;
EXEC SQL CONNECT :uid IDENTIFIED BY :pwd;
printf("Connected to Oracle8i using Scott/Tiger\n");
EXEC SQL COMMIT WORK RELEASE;
return;
errexit: printf("Connection failed");
return;
}
/* end of main */

Error handling
WHENEVER statement is used to specify what action to be taken when there is an error in the subsequent statements. EXEC SQL WHENEVER SQLERROR GOTO errexit;
The above statement specifies if there is an error in any of the subsequent statements then control should goto a label called errexit.
There are other forms of WHENEVER statement that we will examine in later articles.
The next statement used CONNECT command to connect to Oracle. It uses host variables - uid and pwd to supply username and password. Once connection is successful then it displays a message and then COMMIT WORK RELEASE will release the resources and log off. EXEC SQL CONNECT :uid IDENTIFIED BY :pwd; printf("Connected to Oracle8i using Scott/Tiger\n"); EXEC SQL COMMIT WORK RELEASE; return;
Statements given after lable errexit will be executed when connection is not successful. It displays an error message and terminates main(). errexit: printf("Connection failed"); return;

Dynamic SQL
While embedded SQL is fine for fixed applications, sometimes it is important for a program to dynamically create entire SQL statements. With dynamic SQL, a statement stored in a string variable can be issued. PREPARE turns a character string into a SQL statement, and EXECUTE executes that statement. Consider the following example.
char *s = "INSERT INTO emp VALUES(1234, 'jon', 3)";
EXEC SQL PREPARE q FROM :s;
EXEC SQL EXECUTE q;
Alternatively, PREPARE and EXECUTE may be combined into one statement:
char *s = "INSERT INTO emp VALUES(1234, 'jon', 3)";
EXEC SQL EXECUTE IMMEDIATE :s;

WHENEVER Statement
This statement allows you to do automatic error checking and handling. The syntax is:
EXEC SQL WHENEVER ;
Oracle automatically checks SQLCA for , and if such condition is detected, your program will automatically perform .
can be any of the following:
SQLWARNING - sqlwarn[0] is set because Oracle returned a warning
SQLERROR - sqlcode is negative because Oracle returned an error
NOT FOUND - sqlcode is positive because Oracle could not find a row that meets your WHERE condition, or a SELECT INTO or FETCH returned no rows
can be any of the following:
CONTINUE - Program will try to continue to run with the next statement if possible
DO - Program transfers control to an error handling function
GOTO