Tuesday, April 7, 2009
#include<stdio.h>
#include<conio.h>
void findpath(int);//function to find the path
void printpath();//function to print the path
int graph[13][13]=
//0 1 2 3 4 5 6 7 8 9 10 11 12
{0,1,0,0,0,0,0,0,0,0,0 ,0 ,0,//0
0,0,1,1,0,0,0,0,0,0,0 ,0 ,0,//1
0,0,0,0,0,0,0,0,0,0,0 ,1 ,0,//2
0,0,0,0,1,1,1,0,0,0,0 ,0 ,0,//3
0,0,0,0,0,0,0,0,0,0,0 ,1 ,0,//4
0,0,0,0,0,0,0,0,0,0,0 ,1 ,0,//5
0,0,0,0,0,0,0,1,0,0,0 ,0 ,0,//6
0,0,0,0,0,0,0,0,1,0,0 ,0 ,0,//7
0,0,0,0,0,0,1,0,0,1,1 ,0 ,0,//8
0,0,1,0,0,0,0,0,0,0,0 ,1 ,0,//9
0,0,0,0,0,0,0,0,0,0,0 ,0 ,1,//10
0,0,0,0,0,0,0,0,0,0,0 ,0 ,0,//11
0,0,0,0,0,0,0,0,0,0,0 ,0 ,0};//12
int i=0,j=0,k=0,temp=0;//k--->acts as a pointer to the queue cur path
int start_node=0;//stores the start node
int path[13][13];//stores the paths available
int curpath[13]={0,0,0,0,0,0,0,0,0,0,0,0,0};//queue of the path formed
int final[13]={0,0,0,0,0,0,0,0,0,0,0,1,1};//final state or not
int tot_paths[13]={0,0,0,0,0,0,0,0,0,0,0,0,0};//total paths available from a state
int path_count[13]={0,0,0,0,0,0,0,0,0,0,0,0,0};//paths that have been traversed
int flag_cycle;//it is a flag which is set to 1 if the current path has a cycle
int previ;
void main()
{
clrscr();
for(i=0;i<13;i++)
{
printf("\nPath %d:",i);
k=0;
for(j=0;j<13;j++)
{
path[i][j]=0;
if(graph[i][j]!=0)
{
printf("%d,",j);
tot_paths[i]++;
path[i][k++]=j;
}
}
}
printf("\n\n\nThe paths available are:\n");
findpath(start_node);
printpath();
for(temp=k-1;temp>=0;temp--)
{
if(tot_paths[curpath[temp]]<=path_count[curpath[temp]])
{
path_count[curpath[temp]]=0;
curpath[temp]=0;
k--;
}
else
{
k--;
findpath(curpath[temp]);
printpath();
}
}
getch();
}
void findpath(int start)
{
int count;
i=start;
count=path_count[i];
while(!final[i])//while final state is not reached
{
//check whether there is a cycle in the graph,if so skip it
if(checkpath(i))
{
curpath[k]=i;
i=previ;
return;
}
curpath[k++]=i;//add the node in the queue
path_count[i]++;//increment the path count
previ=i;
i=path[i][count];//move to the next node
count=path_count[i];//update count
}
//the same process is repeated for the final state
curpath[k++]=i;
path_count[i]++;
i=path[i][count];
count=path_count[i];
k--;
}
void printpath()//when this fn. ends temp should be equal to k
{
int temp1;
//check whether this path contains a cycle
//if so skip it
for(temp1=0;temp1<k;temp1++)
{
if(curpath[k]==curpath[temp1])
{
temp=k;
return;
}
}
printf("\n");
for(temp=0;temp<k;temp++)//don't change this variable temp,it is a global
variable!
{
printf("%d--->",curpath[tem]);
}
printf("%d",curpath[temp]);
}
int checkpath(int value)//checks whether there is a cycle
{
int temp1;
for(temp1=0;temp1<k;temp1++)
{
if(value==curpath[temp1])
return 1;
}
return 0;
}
Labels: Programming
Sunday, April 5, 2009
I have titled it, "Time To Live". Hopefully, I would finish it before next April.
Labels: Deepak's Scribble
Friday, March 27, 2009
People generally do not know the full version of this nursery poem all they know is the first stanza of the poem, here is the full version poem!
Twinkle, twinkle, little star,
How I wonder what you are!
Up above the world so high,
Like a diamond in the sky!
When the blazing sun is gone,
When he nothing shines upon,
Then you show your little light,
Twinkle, twinkle, all the night.
Then the traveller in the dark,
Thanks you for your tiny spark,
He could not see which way to go,
If you did not twinkle so.
In the dark blue sky you keep,
And often through my curtains peep,
For you never shut your eye,
Till the sun is in the sky.
As your bright and tiny spark,
Lights the traveller in the dark,—
Though I know not what you are,
Twinkle, twinkle, little star.
Labels: Rhymes
Saturday, March 14, 2009
I got a wonderful mail on cancer from my Harish Kumar! Have a read!
AFTER YEARS OF TELLING PEOPLE CHEMOTHERAPY IS THE ONLY WAY TO TRY AND
ELIMINATE CANCER, JOHNS HOPKINS IS FINALLY STARTING TO TELL YOU THERE IS AN ALTERNATIVE WAY .
Cancer Update from Johns Hopkins :
1. Every person has cancer cells in the body. These cancer cells do not show up in the standard tests until they have multiplied to a few billion. When doctors tell cancer patients that there are no more cancer cells in their bodies after treatment, it just means the tests are unable to detect the cancer cells because they have not reached the detectable size.
2. Cancer cells occur between 6 to more than 10 times in a person's lifetime.
3. When the person's immune system is strong the cancer cells will be destroyed and prevented from multiplying and forming tumours.
4. When a person has cancer it indicates the person has multiple nutritional deficiencies. These could be due to genetic, environmental, food and lifestyle factors.
5.. To overcome the multiple nutritional deficiencies, changing diet and including supplements will strengthen the immune system.
6.. Chemotherapy involves poisoning the rapidly-growing cancer cells and also destroys rapidly-growing healthy cells in the bone marrow,
gastro-intestinal tract etc, and can cause organ damage, like liver, kidneys, heart, lungs etc.
7. Radiation while destroying cancer cells also burns, scars and damages healthy cells, tissues and organs.
8. Initial treatment with chemotherapy and radiation will often reduce tumor size. However prolonged use of chemotherapy and radiation do not result in more tumor destruction.
9. When the body has too much toxic burden from chemotherapy and radiation the immune system is either compromised or destroyed, hence the person can succumb to various kinds of infections and complications.
10. Chemotherapy and radiation can cause cancer cells to mutate and become resistant and difficult to destroy. Surgery can also cause cancer cells to spread to other sites.
11. An effective way to battle cancer is to starve the cancer cells by not feeding it with the foods it needs to multiply.
WHAT CANCER CELLS FEED ON:
a. Sugar is a cancer-feeder. By cutting off sugar it cuts off one important food supply to the cancer cells. Sugar substitutes like NutraSweet, Equal,Spoonful etc are made with Aspartame and it is harmful. A better natural substitute would be Manuka honey or molasses but only in very small amounts. Table salt has a chemical added to make it white in colour. Better alternative is Bragg's aminos or sea salt.
b. Milk causes the body to produce mucus, especially in the gastro-intestinal tract. Cancer feeds on mucus. By cutting off milk and
substituting with unsweetened soya milk, cancer cells are being starved..
c. Cancer cells thrive in an acid environment. A meat-based diet is acidic and it is best to eat fish, and a little chicken rather than beef or pork. Meat also contains livestock antibiotics, growth hormones and parasites, which are all harmful, especially to people with cancer.
d. A diet made of 80% fresh vegetables and juice, whole grains, seeds, nuts and a little fruits help put the body into an alkaline
environment. About 20% can be from cooked food including beans. Fresh vegetable juices provide live enzymes that are easily absorbed and reach down to cellular levels within 15 minutes to no urish and enhance growth of healthy cells. To obtain live enzymes for building healthy cells try and drink fresh vegetable juice (most vegetables including bean sprouts) and eat some raw vegetables 2 or 3 times a day. Enzymes are destroyed at temperatures of 104 degrees F (40 degrees C).
e. Avoid coffee, tea, and chocolate, which have high caffeine. Green tea is a better alternative and has cancer-fighting properties. Water- best to drink purified water, or filtered, to avoid known toxins and heavy metals in tap water. Distilled water is acidic, avoid it.
12. Meat protein is difficult to digest and requires a lot of digestive enzymes. Undigested meat remaining in the intestines become putrified and leads to more toxic buildup.
13. Cancer cell walls have a tough protein covering. By refraining from or eating less meat it frees more enzymes to attack the protein walls of cancer cells and allows the body's killer cells to destroy the cancer cells.
14. Some supplements build up the immune system (IP6, Flor-ssence, Essiac, anti-oxidants, vitamins, minerals, EFAs etc.) to enable the
body's own killer cells to destroy cancer cells. Other supplements like vitamin E are known to cause apoptosis, or programmed cell death, the body's normal method of disposing of damaged, unwanted, or unneeded cells.
15. Cancer is a disease of the mind, body, and spirit. A proactive and positive spirit will help the cancer warrior be a survivor. Anger,
unforgiveness and bitterness put the body into a stressful and acidic environment. Learn to have a loving and forgiving spirit. Learn to relax and enjoy life.
16. Cancer cells cannot thrive in an oxygenated environment. Exercising daily, and deep breathing help to get more oxygen down to the cellular level. Oxygen therapy is another means employed to destroy cancer cells.
Labels: Medicine
Tuesday, March 3, 2009
Here's a trick which allows you to use any folder as a drive in Windows. This trick comes very handy when you use a particular folder often, and want to quickly access it like in Command Prompt. It actually adds a new drive in My Computer with your specified drive letter(whatever you specify) and that drive actually points to your designated folder. Once you open the drive, you can access the folder.
The DOS command SUBST is used to create a virtual drive allowing you to add any file path and used as a drive.
SUBST [drive1: [drive2:]path]
drive1: Specifies a virtual drive to which you want to assign a path.
drive2: Specifies a physical drive and path you want to assign to a virtual drive.
For example, to create a virtual drive with a specified path:
- Find a folder you want to use as a drive and remember its path. For demonstration i will be using ‘H:\sd’ as the path.
- Open Command Prompt and type “subst drive-letter path”
- For example, type “subst z: H:\sd” and press Enter.
Article idea: http://system-hacks.blogspot.com/2008/08/converting-folder-into-drive.html
Labels: Windows corner...
Monday, March 2, 2009
Check Username availability for different sites at a single place
0 comments Posted by Deepak at 8:12 PMCurrently the site allows you to check from 68 popular sites and more sites will be added soon. So all in all a good tool, so before creating an account on your desired Site first check this site out.
Labels: Internet
Forty Chapters can be termed as ‘A Novel Writing Wizard’, you move one step at a time, defining each attribute of your novel, starting from the name, then characters (their name, their characters and all), later you define the acts, and finally you start with the chapters.
Once you are done with your writing, or at any point of time if you feel like exporting your work, as shown in the animation, you can download your manuscript in any one of the available formats, namely text, PDF, Word.
It will be very useful for budding novel writers. I am writing my third novel Final Fiasco using this site!
Labels: Fun with english, Internet, Novels
Labels: GOOGLE
Sunday, February 22, 2009
It's official call sign is Cadillac One, but it will always be known as the Obamobile.
But his Secret Service agents have already been familiarising themselves with the machine they call 'The Beast', built by General Motors in Detroit and based on a Cadillac chassis.
The company refuses to give precise details of how it will perform its primary purpose - protecting the president.
But bulletproof glass and armourplatingare standard throughout and the car is hermetically-sealed to withstand chemical weapons.
As with previous presidential limos it is packed with electronic communication systems to allow Mr Obama to keep in contact with the outside world.
One personal touch will be the remote-controlled ten-CD changer on which he can play his favourite artists, said to include Stevie Wonder and Bob Dylan.
Despite the protection afforded by Cadillac One, the Secret Service will be taking no chances when Mr Obama is sworn in as the 44th president.
A three-mile security perimeter will be thrown around the U.S. Capital, with no vehicles allowed inside, to prevent a car bomb attack.
The Beast: Cadillac One, Barack Obama's new presidential limo - also known as the Obamamobile
Labels: News