Wednesday, December 31, 2008

AdVaNcE HaPpY NeW YeaR 2009 !!!!!!!!!!!!!

cid:image012.jpg@01C84B9D.F8131D10

Thursday, April 3, 2008

SOA Links

Learn About Service Oriented Architecture (SOA)
http://www.microsoft.com/biztalk/solutions/soa/overview.mspx

SOA on .NET
http://geekswithblogs.net/.NETonMyMind/archive/2007/06/24/113425.aspx

Introduction to Service Oriented Architecture (SOA)
http://www.devshed.com/index2.php?option=content&task=view&id=557&pop=1&hide_ads=1&page=0&hide_js=1

Thursday, March 27, 2008

Paypal integration in ASP.net Links

http://www.spiderweblogic.com/Paypal-Integration-Code.aspx
Paypal Integration Code: Using ASP.Net / C#

http://www.west-wind.com/presentations/PayPalIntegration/PayPalIntegration.asp
Integrating PayPal Payments into E-Commerce Applications with ASP.NET

https://www.paypal.com/IntegrationCenter/ic_sdk-resource.html
PayPal API: SOAP Interface

3-Tier Architecture links

Some of links for understanding 3-tier architecture in ASP.net
 
http://www.c-sharpcorner.com/UploadFile/paulabraham/Building3TierAppPA11282005053625AM/Building3TierAppPA.aspx

--
--------------------------------------------------------------
"A successful career will no longer be about promotion. It will be about mastery."
— Michael Hammer
--------------------------------------------------------------

Wednesday, March 19, 2008

Ways to Pass Data Between Webforms

        1- Query String    
        2- Cookies
        3- Session variables
        4- Cross Page Posting
        5- Submit form
        6- Server.Transfer or Server.Execute
 

Wednesday, March 5, 2008

Thread Programming

Thread Programming :
--------------------------------
  I faced Threading problems.

I developed the thread for reading from Network :

 int ThreadProc() 
 {
  while(bRun)
  {
   ReadFromNetwork();
  }
  return 0;
  
 }

 if I put the above code, I am getting CPU time as almost 100%.
CPU doesnt execute other processes. I put a Sleep(100), So that the OS executes the other processes during the sleep of that  program.
Sleep(0) also gives timeslice to execute other process.
 

 


 while(1){ } or While(bRun) {}  is called as Busy loop technically.

 Technically they call it as Busy waiting or Spinning.

busy waiting or spinning is a technique in which a process repeatedly checks to see if a condition is true,
such as waiting for keyboard input or waiting for a lock to become available. It can also be used to delay execution for some
amount of time; this was necessary on old computers that had no method of waiting a specific length of time other than
by repeating a useless loop a specific number of times, but on modern computers with clocks and different processor speeds,
this form of time delay is often inaccurate and a sign of a naïve attempt at programming.

Alternatives to busy waiting:
-----------------------------------------
 Most operating systems and threading libraries provide a wide set of system calls which will block the process
on an event, such as lock acquisitions, timers, I/O availability, or signals. This is often the simplest, most efficient, fair, and
race-free way. A single call checks, informs the scheduler of the event it is waiting for, inserts a memory barrier where applicable,
and may perform a requested I/O operation before returning. Other processes can use the CPU while the caller is blocked.
The scheduler is given the information needed to implement priority inheritance or other mechanisms to avoid starvation.

 Busy waiting itself can be made much less wasteful by using a "delay" function found on most operating systems.
This puts a thread to sleep for a specified time, during which the thread will waste no CPU time.
 If the loop is checking something simple then it will spend most of its time asleep and will not waste a large proportion
of the available CPU time. It will still consume some CPU time though.

When busy waits are appropriate :
------------------------------------------------
 In low-level hardware driver programming, sometimes busy waits are actually desirable.
It is not practical to implement hardware interrupt-based signalling for every hardware device, particularly for devices
 that are seldom accessed. Sometimes it is necessary to write some sort of control data to a hardware device and
then read back some sort of status data, which is not valid until several, perhaps even tens of clock cycles later.
The programmer could call an operating system delay function, but more time would be spent simply performing the
 function call (let alone switching to an interim thread) than is required by the hardware. In such cases, it is common to
implement a busy wait that keeps reading the status data until it is valid. Calling a delay function in this case would actually
waste CPU time due to the comparatively large overhead involved in the function call and thread switching.

 For Some important Operations, we can set the ThreadPriority to Highest.This will improves the execution speed.

For Windows programming, we can do the following:

ThreadProc()
{
 While(true)
 {
  DWORD dwWait = WaitForSingleObject(m_hThreadStopEvent,5);
  if (dwWait == WAIT_OBJECT_0)  //ThreadStopEvent occurred
  {
   break;
  }

  ReadFromNetwork();
 }
  return 0;


The Description for the above code is as follows:
 it will waits for 5 milliseconds for ThreadStop Event. if this event occurs, the control comes out of the while loop.
other wise control will be in loop and will reads data from the network.
 whenever we want to comes out of the ThreadProc() fn just rise the ThreadStopEvent.

Wednesday, February 27, 2008

Top 10 Best Practices for Production ASP.NET Applications

http://daptivate.com/archive/2008/02/12/top-10-best-practices-for-production-asp-net-applications.aspx

--
--------------------------------------------------------------
"A successful career will no longer be about promotion. It will be about mastery."
— Michael Hammer
--------------------------------------------------------------

Monday, February 4, 2008

Find Tables associated with the corresponding Field name (Oracle)

The following query is used to find the tables associated with corresponding field name

select * from user_tab_columns where column_name='FIELDNAME'

select * from all_tab_columns where column_name = 'FIELDNAME'


Friday, February 1, 2008

READ-VERY USEFUL- A chat with Dr.Devi Shetty, Narayana Hrudayalaya (Heart Specialist) Bangalore

Dear All,
This might be useful to all of us.

 


A chat with Dr. Devi Shetty, Narayana Hrudayalaya
(Heart Specialist) Bangalore
was arranged by WIPRO for its employees .
The transcript of the chat is given below. Useful for everyone.


Qn: What are the thumb rules for a layman to take care of his heart?


Ans:
1. Diet - Less of carbohydrate, more of protein, less oil
2. Exercise - Half an hour's walk, at least five days a week; avoid lifts and avoid sitting for a long time
3. Quit smoking
4. Control weight
5. Control blood pressure and sugar


Qn: Is eating non-veg food (fish) good for the heart?


Ans: No


Qn: It's still a grave shock to hear that some apparently healthy person
 gets a cardiac arrest. How do we understand it in perspective?  

Ans: This is called silent attack; that is why we recommend everyone past the age of 30 to undergo routine health checkups.


Qn: Are heart diseases hereditary?
 

Ans: Yes
 

Qn: What are the ways in which the heart is stressed? What practices do you suggest to de-stress?


Ans: Change your attitude towards life. Do not look for perfection in everything in life.


Qn: Is walking better than jogging or is more intensive exercise required to keep a healthy heart?


Ans: Walking is better than jogging since jogging leads to early fatigue and injury to joints
 

Qn: You have done so much for the poor and needy. What has inspired you to do so?


Ans: Mother Theresa, who was my patient


Qn: Can people with low blood pressure suffer heart diseases?


Ans: Extremely rare


Qn: Does cholesterol accumulates right from an early age (I'm currently only 22) or do you have to worry about it only after you are above 30 years of age?


Ans: Cholesterol accumulates from childhood.


Qn: How do irregular eating habits affect the heart ?


Ans: You tend to eat junk food when the habits are irregular and your body's enzyme release for digestion gets confused.


Qn: How can I control cholesterol content without using medicines?


Ans: Control diet, walk and eat walnut.


Qn: Can yoga prevent heart ailments?


Ans: Yoga helps.


Qn: Which is the best and worst food for the heart?
 

Ans:
Fruits and vegetables are the best and the worst is oil.

Qn: Which oil is better - groundnut, sunflower, olive?


Ans: All oils are bad
.

Qn: What is the routine checkup one should go through? Is there any specific test?
 

Ans: Routine blood test to ensure sugar, cholesterol is ok. Check BP, Treadmill test after an echo.


Qn: What are the first aid steps to be taken on a heart attack?


Ans: Help the person into a sleeping position
, place an aspirin tablet under the tongue with a sorbitrate tablet if available, and rush him to a coronary care unit since the maximum casualty takes place within the first hour.

Qn: How do you differentiate between pain caused by a heart attack and that caused due to gastric trouble?


Ans: Extremely difficult without ECG.


Qn: What is the main cause of a steep increase in heart problems amongst youngsters? I see people of about 30-40 yrs of age having heart attacks and serious heart problems.


Ans: Increased awareness has increased incidents. Also,
sedentary lifestyles, smoking, junk food, lack of exercise in a country where people are genetically three times more vulnerable for heart attacks than Europeans and Americans.

Qn: Is it possible for a person to have BP outside the normal range of 120/80 and yet be perfectly healthy?


Ans: Yes.


Qn: Marriages within close relatives can lead to heart problems for the child. Is it true?


Ans : Yes, co-sanguinity leads to congenital abnormalities and you may not have a software engineer as a child


Qn: Many of us have an irregular daily routine and many a times we have to stay late nights in office. Does this affect our heart ? What precautions would you recommend?


Ans : When you are young, nature protects you against all these irregularities. However, as you grow older, respect the biological clock.


Qn: Will taking anti-hypertensive drugs cause some other complications (short / long term)?


Ans : Yes, most drugs have some side effects. However, modern anti-hypertensive drugs are extremely safe.


Qn: Will consuming more coffee/tea lead to heart attacks?


Ans : No.


Qn: Are asthma patients more prone to heart disease?


Ans : No.


Qn: How would you define junk food?


Ans : Fried food like Kentucky , McDonalds , samosas, and even masala dosas.


Qn: You mentioned that Indians are three times more vulnerable. What is the reason for this, as Europeans and Americans also eat a lot of junk food?


Ans: Every race is vulnerable to some disease and unfortunately, Indians are vulnerable for the most expensive disease.


Qn: Does consuming bananas help reduce hypertension?


Ans : No.


Qn: Can a person help himself during a heart attack (Because we see a lot of forwarded emails on this)?


Ans : Yes. Lie down comfortably and put an aspirin tablet of any description under the tongue and ask someone to take you to the nearest coronary care unit without any delay and do not wait for the ambulance since most of the time, the ambulance does not turn up.


Qn: Do, in any way, low white blood cells and low hemoglobin count lead to heart problems?


Ans : No. But it is ideal to have normal hemoglobin level to increase your exercise capacity.


Qn: Sometimes, due to the hectic schedule we are not able to exercise. So, does walking while doing daily chores at home or climbing the stairs in the house, work as a substitute for exercise?
 

Ans : Certainly. Avoid sitting continuously for more than half an hour and even the act of getting out of the chair and going to another chair and sitting helps a lot.


Qn: Is there a relation between heart problems and blood sugar?


Ans: Yes. A strong relationship since diabetics are more vulnerable to heart attacks than non-diabetics.


Qn: What are the things one needs to take care of after a heart operation?


Ans : Diet, exercise, drugs on time
, Control cholesterol, BP, weight.

Qn: Are people working on night shifts more vulnerable to heart disease when compared to day shift workers?
 

Ans : No.


Qn: What are the modern anti-hypertensive drugs?
 

Ans : There are hundreds of drugs and your doctor will chose the right combination for your problem, but my suggestion is to avoid the drugs and go for natural ways of controlling blood pressure by walk, diet to reduce weight and changing attitudes towards lifestyles.


Qn: Does dispirin or similar headache pills increase the risk of heart attacks?


Ans : No.


Qn: Why is the rate of heart attacks more in men than in women?


Ans : Nature protects women till the age of 45.


Qn: How can one keep the heart in a good condition?


Ans : Eat a healthy diet, avoid junk food, exercise everyday, do not smoke and, go for health checkup
s if you are past the age of 30 ( once in six months recommended).....

Send it to all your friends.......
They might be benefited……


--
Regards,
Rajesh Prabhu. R

"There is no future in any job. The future lies in the man who holds the job." - George Crane
"A busy man has time for everything and a lazy man has time for nothing."

Tuesday, January 22, 2008

Get country information from IP Address

In many of the blogs and websites we can find the country information about the user who browse the page. This information is very helpful to get the statistical report of the site. For the fast few days, I was very eager to find the way to implement the same in my web applications too. Today I came across the solution from the following sites,

http://www.developerfusion.co.uk/show/4549/1/ - Extracting the Country from the IP Address
http://ip-to-country.webhosting.info/ - The IP to Country Database (CSV Format)