We are strongly race behind chemicals ( drugs) for normal illness. There are some Breathing exercises that helps to prevent illness without taking medicines. Let's see....
Our noses have left and right nostrils. Are these nostrils having the same function for inhaling (breathe in) and exhaling (breathe out)?
Actually it’s not the same and we can feel the difference. Accordingly, the right side represents the sun and the left side represents the moon.
When having headaches, try to close your right nostril and use your left nostril to do breathing for about 5 min. The headache will be gone.
If you feel too tired, do it the opposite way. Close your left nostril and breathe through your right nostril. After a while, you will feel refreshed again.
Because the right side belongs to heat, so it gets hot easily. The left side gets cold easily.
Women breathe mainly with their left nostril, so they get calmed down easily. Men breathe mostly with their right nostril, so they get angry easily.!
When we wake up, do we notice which nostril breathes faster? Is it the left side or the right side?
If the left nostril breathes faster, you will feel very tired. Close your left nostril and use your right nostril for breathing and you will get refreshed quickly.
You can teach your kids about it. The effect of breathing therapy on them is much better than for adults.
I used to tell others who also suffer from headaches to try this method as it was effective for me. It also worked for those who have tried this breathing techniques as well. This is a natural therapy, unlike taking medicines for a long time, which may have negative side effects.
So, why don’t you try this breathing techniques out?
Practise the correct ways of breathing (breathe in and breathe out) and your body will be in a very relaxing condition!
Sundar Developer
Wednesday, 12 December 2012
How to Read Gmail Unread messages using C#
I am coming with Gmail feature that may be useful although many people don't know and how to access it via simple C# code.
Gmail gives a feature called Atom feed that is xml format file to know the unread messages .
http://mail.google.com/mail/feed/atom/ shows the most recent unread items from your inbox.
Gmail also offers feeds for your labels:http://mail.google.com/mail/feed/atom/labelname/ .
To know the feature in detials go to this link @ (the unofficial news and tips about Google).
As a developer you can download the C# example here.
All what you need is create instance a simple class called GmailHandler and drop this lines in your project.
There are 2 steps in the procedure
- Create the gmail handler class: GmailHandler gmailFeed = new GmailHandler("WriteHereYourGmailUserName(ex: babu))", "WriteHereYourGmailPassword(ex: ****)");
- Get the feed: XmlDocument myXml = gmailFeed.GetGmailAtom();
happy coding............
Thanks to Ahmed Essawy for sharing this...
Given here http://fci-h.blogspot.in/2009/09/reading-atom-feed-of-gmail-inbox-via-c.html
Update:
Sorry guys I'm not good at content editing.. Forgive me if any mistakes found.
For this we need to call the specific atom url with the authentication.
What ahmed is trying is make this as class library and make it more object oriented. If you don't care about such things go below
StringBuilder sBuilder = new StringBuilder();
// create a request for gmail atom url
WebRequest webRequest = WebRequest.Create( "https://mail.google.com/mail/feed/atom");
// make the request pre authenticated
webRequest.PreAuthenticate = true;
// Create the credentials and attach it to the request
System.Net.NetworkCredential credentials = new NetworkCredential("gmail username", "gmail password");
webRequest.Credentials = credentials;
//Pass the request and get the response
WebResponse webResponse = webRequest.GetResponse();
Stream stream = webResponse.GetResponseStream();
// Get the response stream and read it to a string builder
while ((byteCount = stream.Read(buffer, 0, buffer.Length)) > 0)
sBuilder.Append(System.Text.Encoding.ASCII.GetString(buffer, 0, byteCount));
// Then convert the string to xml
feedXml = new XmlDocument();
feedxml.Load(sBuilder.ToString());
This method only returns the unread gmail messages only.. You can make it to some sort of notifications to your app....
Thanks....
Tuesday, 27 November 2012
Faster Web Development Tricks
These trucks are somewhere i studied on the web.
The advice provided by Mann was organized around six principles outlined below.
1. Quickly Respond to Network Requests.
The advice provided by Mann was organized around six principles outlined below.
1. Quickly Respond to Network Requests.
- Avoid Redirections. 63% of the top 1,000 websites use redirections. They could increase the speed of their pages by 10% by not performing a redirect.
- Avoid Meta-refresh. 14% of the world’s URLs use meta-refreshes.
- Minimize server response time by using CDNs located as close as possible to the user
- Maximize the usage of concurrent connections by downloading resources from different domains
- Reuse connections. Don’t close the connection when responding to a request.
- Make sure data served by partner sites is not delaying page load
- Understand the network timing components –Redirect, Cache, DNS, Request, Response, etc. –. Use the Navigation Timing API on IE 9&10 to measure the time spent by the browser on each operation.
- Request gzipped content
- Keep resources locally in packages, such as the Package Resource Index generated for the Windows Store apps. That way they are readily available when necessary.
- Cache dynamic resources in HTML5 App Cache. This cache downloads the resources only once avoiding multiple network trips. The cache automatically re-downloads resources when the version of the application changes.
- Provide cacheable content whenever possible by using the “Expires” field in the response.
- Use conditional requests by setting the If-Modified-Since field of the request.
- Cache data requests –HTTP, XML, JSON, etc. – because about 95-96% of the requests don’t change over the day. Although a reasonable idea, less than 1% of the websites cache the requests received.
- Standardize file naming capitalization. While a server may recognize Icon.jpg as icon.jpg, they are different resources for the web platform, generating different network requests.
- Use the HTTP header field “X-UA-Compatible: IE=EmulateIE7” instead of the HTML tag <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"> to force IE run in a legacy mode that might be needed for certain business web applications. It’s faster that way.
- Stylesheets should be linked at the top of the page inside the <head>, after the <title> in order to provide a smooth rendering.
- Stylesheets should never be linked at the bottom of the page. The page may be flashing while loading.
- Avoid “@import” for hierarchical styles because it synchronously blocks the creation of CSS data structures and screen painting.
- Avoid embedded and inline styles because it forces the browser to make a context switch between the HTML and CSS parsers.
- Only include the necessary styles. Avoid downloading and parsing style that won’t be used.
- Link JavaScript only at the bottom of the page. This makes sure that the images, CSS, etc. are already loaded so the scripts can do they job without waiting on the resources, and avoiding context switching.
- Do not link JavaScript in the head of the page. Use the “defer” attribute if some scripts must be loaded at the beginning.
- Avoid inline JavaScript to avoid context switching.
- Use the “async” attribute to load JavaScript to make the entire script loading and executing asynchronous.
- Avoid duplicate code. 52% of the world’s web pages contain 100 lines or more of duplicate code such as linking a JavaScript file twice.
- Standardize on one JS framework, be it jQuery, Dojo, Prototype.js, etc.. The browser won’t have to load multiple frameworks that provide basically the same functionality.
- Don’t load scripts –FB, Twitter, etc. - just to be cool. They compete for resources.
- Avoid downloading too many images, keeping their number to maximum 20-30 due to page load time.
- Use image sprites to combine multiple images into one. This technique reduces the number of network connections, and the number of bytes downloaded and GPU cycles.
- Create image sprites by hand because tools may leave large empty spaces leading to larger downloads and more GPU cycles.
- Use PNG: best compromise between download size, decoding time, compatibility, and compression rate. JPEG may be used for photographs.
- Use the native image resolution to avoid unnecessary bytes download and CPU processing for scaling.
- Replace images with CSS3 gradients when possible.
- Replace images with CSS3 border radius when possible.
- Use CSS3 transforms to create move, rotate or skew effects.
- Use Data URI for small single images. It saves an image download.
- Avoid complex SVGs which require longer downloads and processing.
- Specify an image preview when including an HTML5. The browser won’t have to download the entire video to figure out what the preview image should be.
- Use HTML5 instead of Flash, Silverlight, or QuickTime. HTML5 is faster and the plug-in runtime takes system resources.
- Proactively download rich media asynchronously and keep it in the app cache.
- Use Integers when doing math operations in JavaScript, if possible. Floating point operations take much longer in JavaScript than their corresponding integer operations. Convert floating points into integers with Math.floor and Math.ceil, especially for computationally intensive operations.
- Minify JavaScript code for smaller downloads and better runtime performance.
- Initialize JS on demand. Load JS dynamically when needed.
- Minimize DOM interactions by caching variable such as document, body, etc.
- Use the built-in DOM code such as element.firstChild or node.nextSibling. They are highly optimized, better than what a third party library might provide.
- Use querySelectorAll for accessing a large number of DOM elements.
- Use .innerHTML to construct dynamic pages.
- Batch markup changes.
- Maintain a Small and Healthy DOM – maximum 1,000 elements.
- JSON is faster than XML.
- Use the browser’s JSON native methods.
- Don’t abuse the usage of regular expressions.
- Understand JavaScript timers: setTimeout and clearInterval. Don’t let timers run unless you use them for something. Also, combine timers.
- Align timers to the display frame at 16.7 ms if the monitor refreshes at 60Hz.
- Use requestAnimationFrame for animations to do graphics work in IE 10/Chrome/Firefox. It makes a call back when it is the time to paint, so there is no need for a timer.
- Use the visibility API (document.hidden, Visibilityhange) to determine the visibility state of the application, and throttle down activity when the page is hidden. Saves CPU and battery life.
Subscribe to:
Comments (Atom)