Manoj's profileमनोज अग्रवालPhotosBlogListsMore Tools Help
8/20/2008

Free e-book: Writing Secure Code, Second Edition, by Michael Howard and David LeBlanc

Writing Secure Code
Discover the best practices for writing secure code and stopping malicious hackers in their tracks—direct from the top security experts at Microsoft! For one week only, you can download the e-book of Writing Secure Code, Second Edition for free. This offer requires a valid Windows Live ID and the access code 7234-N4E8-4995. Activate your access code by August 28, 2008. Download the e-book today!

Detailed instructions:
1) Go to http://www.microsoft.com/learning/access
.
2) Type your access code. (The code is case sensitive.) You will need to accept the License Agreement before you can proceed. Click Send.
3) You will be prompted to sign in using a valid Windows Live ID. If you already have a profile on Microsoft.com, use that Windows Live ID. If you do not have a Windows Live ID, use the options on the page to sign up for one.
4) On the Thank You page, click My Learning to access the e-book.
5) On the My Learning page, scroll to the E-Reference section. Click on Writing Secure Code, Second Edition to access the e-book.

After activating the access code with your Windows Live ID, you can either download the e-book files to your computer or return to the Microsoft Learning website to access the e-book online. Online access is limited to one year from the date of activation. To access the e-book online,
simply go to http://learning.microsoft.com/Manager/default.aspx and sign in using your Windows Live ID. Then click My Learning in the left navigation area to access this e-book again.

7/23/2008

Top 10 Concepts That Every Software Engineer Should Know

Top 10 Concepts That Every Software Engineer Should Know

Written by Alex Iskold

The future of software development is about good craftsmen. With infrastructure like Amazon Web Services and an abundance of basic libraries, it no longer takes a village to build a good piece of software.

These days, a couple of engineers who know what they are doing can deliver complete systems. In this post, we discuss the top 10 concepts software engineers should know to achieve that.

A successful software engineer knows and uses design patterns, actively refactors code, writes unit tests and religiously seeks simplicity. Beyond the basic methods, there are concepts that good software engineers know about. These transcend programming languages and projects - they are not design patterns, but rather broad areas that you need to be familiar with. The top 10 concepts are:

  1. Interfaces
  2. Conventions and Templates
  3. Layering
  4. Algorithmic Complexity
  5. Hashing
  6. Caching
  7. Concurrency
  8. Cloud Computing
  9. Security
  10. Relational Databases

10. Relational Databases

Relational Databases have recently been getting a bad name because they cannot scale well to support massive web services. Yet this was one of the most fundamental achievements in computing that has carried us for two decades and will remain for a long time. Relational databases are excellent for order management systems, corporate databases and P&L data.

At the core of the relational database is the concept of representing information in records. Each record is added to a table, which defines the type of information. The database offers a way to search the records using a query language, nowadays SQL. The database offers a way to correlate information from multiple tables.

The technique of data normalization is about correct ways of partitioning the data among tables to minimize data redundancy and maximize the speed of retrieval.

9. Security

With the rise of hacking and data sensitivity, the security is paramount. Security is a broad topic that includes authentication, authorization, and information transmission.

Authentication is about verifying user identity. A typical website prompts for a password. The authentication typically happens over SSL (secure socket layer), a way to transmit encrypted information over HTTP. Authorization is about permissions and is important in corporate systems, particularly those that define workflows. The recently developed OAuth protocol helps web services to enable users to open access to their private information. This is how Flickr permits access to individual photos or data sets.

Another security area is network protection. This concerns operating systems, configuration and monitoring to thwart hackers. Not only network is vulnerable, any piece of software is. Firefox browser, marketed as the most secure, has to patch the code continuously. To write secure code for your system requires understanding specifics and potential problems.

 

8. Cloud Computing

In our recent post Reaching For The Sky Through Compute Clouds we talked about how commodity cloud computing is changing the way we deliver large-scale web applications. Massively parallel, cheap cloud computing reduces both costs and time to market.

Cloud computing grew out of parallel computing, a concept that many problems can be solved faster by running the computations in parallel.

After parallel algorithms came grid computing, which ran parallel computations on idle desktops. One of the first examples was SETI@home project out of Berkley, which used spare CPU cycles to crunch data coming from space. Grid computing is widely adopted by financial companies, which run massive risk calculations. The concept of under-utilized resources, together with the rise of J2EE platform, gave rise to the precursor of cloud computing: application server virtualization. The idea was to run applications on demand and change what is available depending on the time of day and user activity.

Today's most vivid example of cloud computing is Amazon Web Services, a package available via API. Amazon's offering includes a cloud service (EC2), a database for storing and serving large media files (S3), an indexing service (SimpleDB), and the Queue service (SQS). These first blocks already empower an unprecedented way of doing large-scale computing, and surely the best is yet to come.

7. Concurrency

Concurrency is one topic engineers notoriously get wrong, and understandibly so, because the brain does juggle many things at a time and in schools linear thinking is emphasized. Yet concurrency is important in any modern system.

Concurrency is about parallelism, but inside the application. Most modern languages have an in-built concept of concurrency; in Java, it's implemented using Threads.

A classic concurrency example is the producer/consumer, where the producer generates data or tasks, and places it for worker threads to consume and execute. The complexity in concurrency programming stems from the fact Threads often needs to operate on the common data. Each Thread has its own sequence of execution, but accesses common data. One of the most sophisticated concurrency libraries has been developed by Doug Lea and is now part of core Java.

 

6. Caching

No modern web system runs without a cache, which is an in-memory store that holds a subset of information typically stored in the database. The need for cache comes from the fact that generating results based on the database is costly. For example, if you have a website that lists books that were popular last week, you'd want to compute this information once and place it into cache. User requests fetch data from the cache instead of hitting the database and regenerating the same information.

Caching comes with a cost. Only some subsets of information can be stored in memory. The most common data pruning strategy is to evict items that are least recently used (LRU). The prunning needs to be efficient, not to slow down the application.

A lot of modern web applications, including Facebook, rely on a distributed caching system called Memcached, developed by Brad Firzpatrick when working on LiveJournal. The idea was to create a caching system that utilises spare memory capacity on the network. Today, there are Memcached libraries for many popular languages, including Java and PHP.

5. Hashing

The idea behind hashing is fast access to data. If the data is stored sequentially, the time to find the item is proportional to the size of the list. For each element, a hash function calculates a number, which is used as an index into the table. Given a good hash function that uniformly spreads data along the table, the look-up time is constant. Perfecting hashing is difficult and to deal with that hashtable implementations support collision resolution.

Beyond the basic storage of data, hashes are also important in distributed systems. The so-called uniform hash is used to evenly allocate data among computers in a cloud database. A flavor of this technique is part of Google's indexing service; each URL is hashed to particular computer. Memcached similarly uses a hash function.

Hash functions can be complex and sophisticated, but modern libraries have good defaults. The important thing is how hashes work and how to tune them for maximum performance benefit.

 

 

4. Algorithmic Complexity

There are just a handful of things engineers must know about algorithmic complexity. First is big O notation. If something takes O(n) it's linear in the size of data. O(n^2) is quadratic. Using this notation, you should know that search through a list is O(n) and binary search (through a sorted list) is log(n). And sorting of n items would take n*log(n) time.

Your code should (almost) never have multiple nested loops (a loop inside a loop inside a loop). Most of the code written today should use Hashtables, simple lists and singly nested loops.

Due to abundance of excellent libraries, we are not as focused on efficiency these days. That's fine, as tuning can happen later on, after you get the design right.

Elegant algorithms and performance is something you shouldn't ignore. Writing compact and readable code helps ensure your algorithms are clean and simple.

3. Layering

Layering is probably the simplest way to discuss software architecture. It first got serious attention when John Lakos published his book about Large-scale C++ systems. Lakos argued that software consists of layers. The book introduced the concept of layering. The method is this. For each software component, count the number of other components it relies on. That is the metric of how complex the component is.

Lakos contended a good software follows the shape of a pyramid; i.e., there's a progressive increase in the cummulative complexity of each component, but not in the immediate complexity. Put differently, a good software system consists of small, reusable building blocks, each carrying its own responsibility. In a good system, no cyclic dependencies between components are present and the whole system is a stack of layers of functionality, forming a pyramid.

Lakos's work was a precursor to many developments in software engineering, most notably Refactoring. The idea behind refactoring is continuously sculpting the software to ensure it'is structurally sound and flexible. Another major contribution was by Dr Robert Martin from Object Mentor, who wrote about dependecies and acyclic architectures

Among tools that help engineers deal with system architecture are Structure 101 developed by Headway software, and SA4J developed by my former company, Information Laboratory, and now available from IBM.

2. Conventions and Templates

Naming conventions and basic templates are the most overlooked software patterns, yet probably the most powerful.

Naming conventions enable software automation. For example, Java Beans framework is based on a simple naming convention for getters and setters. And canonical URLs in del.icio.us: http://del.icio.us/tag/software take the user to the page that has all items tagged software.

Many social software utilise naming conventions in a similar way. For example, if your user name is johnsmith then likely your avatar is johnsmith.jpg and your rss feed is johnsmith.xml.

Naming conventions are also used in testing, for example JUnit automatically recognizes all the methods in the class that start with prefix test.

The templates are not C++ or Java language constructs. We're talking about template files that contain variables and then allow binding of objects, resolution, and rendering the result for the client.

Cold Fusion was one of the first to popularize templates for web applications. Java followed with JSPs, and recently Apache developed handy general purpose templating for Java called Velocity. PHP can be used as its own templating engine because it supports eval function (be careful with security). For XML programming it is standard to use XSL language to do templates.

From generation of HTML pages to sending standardized support emails, templates are an essential helper in any modern software system.

1. Interfaces

The most important concept in software is interface. Any good software is a model of a real (or imaginary) system. Understanding how to model the problem in terms of correct and simple interfaces is crucial. Lots of systems suffer from the extremes: clumped, lengthy code with little abstractions, or an overly designed system with unnecessary complexity and unused code.

Among the many books, Agile Programming by Dr Robert Martin stands out because of focus on modeling correct interfaces.

In modeling, there are ways you can iterate towards the right solution. Firstly, never add methods that might be useful in the future. Be minimalist, get away with as little as possible. Secondly, don't be afraid to recognize today that what you did yesterday wasn't right. Be willing to change things. Thirdly, be patient and enjoy the process. Ultimately you will arrive at a system that feels right. Until then, keep iterating and don't settle.

 

 

Conclusion

Modern software engineering is sophisticated and powerful, with decades of experience, millions of lines of supporting code and unprecidented access to cloud computing. Today, just a couple of smart people can create software that previously required the efforts of dozens of people. But a good craftsman still needs to know what tools to use, when and why.

6/8/2008

Upcoming Webcasts (Aspiring Architects, .NET Framework 3.5)

Aspiring Architect Series 2008

June 16th, 2008 – 12:00 p.m. to 1:00 p.m. – Introduction to the aspiring architect Web Cast series
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380836&Culture=en-CA

June 17th, 2008 – 12:00 p.m. to 1:00 p.m. – Services Oriented Architecture and Enterprise Service Bus – Beyond the hype
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380838&Culture=en-CA

June 18th, 2008 – 12:00 p.m. to 1:00 p.m. – TOGAF and Zachman, a real-world perspective
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380840&Culture=en-CA

June 19th, 2008 – 12:00 p.m. to 1:00 p.m. – Services Oriented Architecture (Web Cast in French)
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380842&Culture=en-CA

June 20th, 2008 – 12:00 p.m. to 1:00 p.m. – Interoperability (Web Cast in French)
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380844&Culture=fr-CA

June 23rd , 2008 – 12:00 p.m. to 1:00 p.m. – Realizing dynamic systems
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380846&Culture=en-CA

June 24th, 2008 – 12:00 p.m. to 1:00 p.m. – Web 2.0, beyond the hype
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380848&Culture=en-CA

June 25th, 2008 – 12:00 p.m. to 1:00 p.m. – Architecting for the user experience
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380850&Culture=en-CA

June 26th, 2008 – 12:00 p.m. to 1:00 p.m. – Conclusion and next steps
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380852&Culture=en-CA

.NET Framework 3.5: Create Connected Applications

MSDN Webcast: ADO.NET Data Services Overview (Part 1 of 2) (Level 100)

Tuesday, June 17, 2008, 11:00 A.M.–12:00 P.M. Pacific Time

MSDN Webcast: geekSpeak: Workflow Services in .NET 3.5 with Jon Flanders (Level 200)

Wednesday, June 18, 2008, 12:00 P.M.–1:00 P.M. Pacific Time

MSDN Webcast: Calling Services from Silverlight 2.0 with Jon Flanders (Level 300)

Monday, June 23, 2008, 9:00 A.M.–10:00 A.M. Pacific Time

MSDN Webcast: ADO.NET Data Services Overview (Part 2 of 2) (Level 100)

Tuesday, June 24, 2008, 11:00 A.M.–12:00 P.M. Pacific Time

MSDN Webcast: Windows Workflow Communication in Depth with Matt Milner (Level 400)

Thursday, June 26, 2008, 9:00 A.M.–10:00 A.M. Pacific Time

4/27/2008

50 Ways to Help the Planet

01

1. CHANGE YOUR LIGHT
If every household in the United State replaced one regular lightbulb with one of those new compact fluorescent bulbs, the pollution reduction would be equivalent to removing one million cars from the road. Don't like the color of light? Use these bulbs for closets, laundry rooms and other places where it won't irk you as much.

 

Moon

2. TURN OFF COMPUTERS AT NIGHT
By turning off your computer instead of leaving it in sleep mode, you can save 40 watt-hours per day. That adds up to 4 cents a day, or $14 per year. If you don't want to wait for your computer to start up, set it to turn on automatically a few minutes before you get to work, or boot up while you're pouring your morning cup 'o joe.

 

02

3. DON'T RINSE
Skip rinsing dishes before using your dishwasher and save up to 20 gallons of water each load. Plus, you're saving time and the energy used to heat the additional water.

 

02

4. DO NOT PRE-HEAT THE OVEN
Unless you are making bread or pastries of some sort, don't pre-heat the oven. Just turn it on when you put the dish in. Also, when checking on your food, look through the oven window instead of opening the door.

 

02

5. RECYCLE GLASS
Recycled glass reduces related air pollution by 20 percent and related water pollution by 50 percent. If it isn't recycled it can take a million years to decompose.

 

diaper pin

6. DIAPER WITH A CONSCIENCE
By the time a child is toilet trained, a parent will change between 5,000 and 8,000 diapers, adding up to approximately 3.5 million tons of waste in U.S. landfills each year. Whether you choose cloth or a more environmentally-friendly disposable, you're making a choice that has a much gentler impact on our planet.

 

clothespin

7. HANG DRY
Get a clothesline or rack to dry your clothes by the air. Your wardrobe will maintain color and fit, and you'll save money. Your favorite t-shirt will last longer too.

 

Star!

8. GO VEGETARIAN ONCE A WEEK
One less meat-based meal a week helps the planet and your diet. For example: It requires 2,500 gallons of water to produce one pound of beef. You will also also save some trees. For each hamburger that originated from animals raised on rainforest land, approximately 55 square feet of forest have been destroyed.

 

Fork and knife

9. WASH IN COLD OR WARM
If all the households in the U.S. switched from hot-hot cycle to warm-cold, we could save the energy comparable to 100,000 barrels of oil a day. Only launder when you have a full load.

 

Napkin

10. USE ONE LESS PAPER NAPKIN
During an average year, an American uses approximately 2,200 napkins—around six each day. If everyone in the U.S. used one less napkin a day, more than a billion pounds of napkins could be saved from landfills each year.

 

Paper

11. USE BOTH SIDES OF PAPER
American businesses throw away 21 million tons of paper every year, equal to 175 pounds per office worker. For a quick and easy way to halve this, set your printer's default option to print double-sided (duplex printing). And when you're finished with your documents, don't forget to take them to the recycling bin.

 

Newspaper

12. RECYCLE NEWSPAPER
There are 63 million newspapers printed each day in the U.S. Of these, 44 million, or about 69%, of them will be thrown away. Recycling just the Sunday papers would save more than half a million trees every week.

 

Gift

13. WRAP CREATIVELY
You can reuse gift bags, bows and event paper, but you can also make something unique by using old maps, cloth or even newspaper. Flip a paper grocery bag inside out and give your child stamps or markers to create their own wrapping paper that's environmentally friendly and extra special for the recipient.

 

Water

14. RETHINK BOTTLED WATER
Nearly 90% of plastic water bottles are not recycled, instead taking thousands of years to decompose. Buy a reusable container and fill it with tap water, a great choice for the environment, your wallet, and possibly your health. The EPA's standards for tap water are more stringent than the FDA's standards for bottled water.

 

Shower!

15. BAN BATHTIME!
Have a no-bath week, and take showers instead. Baths require almost twice as much water. Not only will you reduce water consumption, but the energy costs associated with heating the water.

 

brush

16. BRUSH WITHOUT RUNNING
You've heard this one before, but maybe you still do it. You'll conserve up to five gallons per day if you stop. Daily savings in the U.S. alone could add up to 1.5 billion gallons--more water than folks use in the Big Apple.

 

Shower

17. SHOWER WITH YOUR PARTNER
Sneak in a shower with your loved one to start the day with some zest that doesn't come in a bar. Not only have you made a wise choice for the environment, but you may notice some other added...um...benefits.

 

Shorten

18. TAKE A SHORTER SHOWER
Every two minutes you save on your shower can conserve more than ten gallons of water. If everyone in the country saved just one gallon from their daily shower, over the course of the year it would equal twice the amount of freshwater withdrawn from the Great Lakes every day.

 

Tree

19. PLANT A TREE
It's good for the air, the land, can shade your house and save on cooling (plant on the west side of your home), and they can also improve the value of your property. Make it meaningful for the whole family and plant a tree every year for each member.

 

Vvvvrrrooooom

20. USE YOUR CRUISE CONTROL
You paid for those extra buttons in your car, so put them to work! When using cruise control your vehicle could get up to 15% better mileage. Considering today's gasoline prices, this is a boon not only for the environment but your budget as well.

 

Weee

21. SECOND-HAND DOESN'T MEAN SECOND-BEST
Consider buying items from a second-hand store. Toys, bicycles, roller blades, and other age and size-specific items are quickly outgrown. Second hand stores often sell these items in excellent condition since they are used for such a short period of time, and will generally buy them back when you no longer need them.

 

Globey

22. BUY LOCAL
Consider the amount of pollution created to get your food from the farm to your table. Whenever possible, buy from local farmers or farmers' markets, supporting your local economy and reducing the amount of greenhouse gas created when products are flown or trucked in.

 

This is a thermometer

23. ADJUST YOUR THERMOSTAT
Adjust your thermostat one degree higher in the summer and one degree cooler in the winter. Each degree celsius less will save about 10% on your energy use! In addition, invest in a programmable thermostat which allows you to regulate temperature based on the times you are at home or away.

 

MMmmmmm, coffee

24. INVEST IN YOUR OWN COFFEE CUP
If you start every morning with a steamy cup, a quick tabulation can show you that the waste is piling up. Invest in a reusable cup, which not only cuts down on waste, but keeps your beverage hot for a much longer time. Most coffee shops will happily fill your own cup, and many even offer you a discount in exchange!

 

Thre and back

25. BATCH ERRANDS
Feel like you spend your whole week trying to catch up with the errands? Take a few moments once a week to make a list of all the errands that need to get done, and see if you can batch them into one trip. Not only will you be saving gasoline, but you might find yourself with much better time-management skills.

 

switch

26. TURN OFF LIGHTS
Always turn off incandescent bulbs when you leave a room. Fluorescent bulbs are more affected by the number of times it is switched on and off, so turn them off when you leave a room for 15 minutes or more. You'll save energy on the bulb itself, but also on cooling costs, as lights contribute heat to a room.

 

Mow

27. GREENER LAWN CARE
If you must water your lawn, do it early in the morning before any moisture is lost to evaporation. Have a few weeds? Spot treat them with vinegar. Not sure if you should rake? Normal clippings act as a natural fertilizer, let them be. If you've waited too long, rake by hand — it's excellent exercise.

 

Basket

28. PICNIC WITH A MARKER
Some time in between the artichoke dip and the coleslaw, you lost track of your cup, and now there are a sea of matching cups on the table, one of which might be yours. The next time you picnic, set out permanent marker next to disposable dinnerware so guests can mark their cup and everyone will only use one.

 

Celly

29. RECYCLE OLD CELL PHONES
The average cell phone lasts around 18 months, which means 130 million phones will be retired each year. If they go into landfills, the phones and their batteries introduce toxic substances into our environment. There are plenty of reputable programs where you can recycle your phone, many which benefit noble causes.

 

Wrenching

30. MAINTAIN YOUR VEHICLE
Not only are you extending the life of your vehicle, but you are creating less pollution and saving gas. A properly maintained vehicle, clean air filters, and inflated tires can greatly improve your vehicle's performance. And it might not hurt to clean out the trunk—all that extra weight could be costing you at the pump.

 

No Mommy!

31. RECYCLE UNWANTED WIRE HANGERS
Wire hangers are generally made of steel, which is often not accepted by some recycling programs. So what do you do with them? Most dry cleaners will accept them back to reuse or recycle. (Cue Joan Crawford.)

 

Chug

32. CHOOSE GLASS BOTTLES OVER ALUMINUM CANS
The energy required to produce a single 12 oz. aluminum can from virgin ore is enough to produce nearly two new 12 oz. glass bottles. So the next time you buy a six-pack of beer, opt for glass bottles over aluminum cans. The manufacturing energy conserved could power your television through two Sunday NFL games.

 

Homeward bound

33. TELECOMMUTE
See if you can work out an arrangement with your employer that you work from home for some portion of the week. Not only will you save money and gasoline, and you get to work in your pajamas!

 

Eternal flame

34. KEEP YOUR FIREPLACE DAMPER CLOSED
Keeping the damper open (when you're not using your fireplace) is like keeping a 48-inch window wide open during the winter; it allows warm air to go right up the chimney. This can add up to hundreds of dollars each winter in energy loss.

 

junk

35. CUT DOWN ON JUNK MAIL
Feel like you need to lose a few pounds? It might be your junk mail that's weighing you down. The average American receives 40 pounds of junk mail each year, destroying 100 millions trees. There are many services that can help reduce the clutter in your mailbox, saving trees and the precious space on your countertops.

 

Light a candle light a match step down step down watch your heel crush crush

36. CHOOSE MATCHES OVER LIGHTERS
Most lighters are made out of plastic and filled with butane fuel, both petroleum products. Since most lighters are considered "disposable," over 1.5 billion end up in landfills each year. When choosing matches, pick cardboard over wood. Wood matches come from trees, whereas most cardboard matches are made from recycled paper.

 

Yellow pages

37. LET YOUR FINGERS DO THE WALKING—ONLINE
Consider if you really need a paper phone book. If not, call to stop phone book delivery and use an online directory instead. Some estimate that telephone books make up almost ten percent of waste at dump sites. And if you still receive the book, don't forget to recycle your old volumes.

 

give

38. GIVE IT AWAY
Before you throw something away, think about if someone else might need it. Either donate to a charitable organization or post it on a web site designed to connect people and things, such as Freecycle.com.

 

Wash

39. GO TO A CAR WASH
Professional car washes are often more efficient with water consumption. If everyone in the U.S. who washes their car themselves took just one visit to the car wash we could save nearly 8.7 billion gallons of water.

 

02

40. PLASTIC BAGS SUCK
Each year the U.S. uses 84 billion plastic bags, a significant portion of the 500 billion used worldwide. They are not biodegradable, and are making their way into our oceans, and subsequently, the food chain. Stronger, reusable bags are an inexpensive and readily available option.

 

Fly

41. FLY WITH AN E-TICKET
The cost of processing a paper ticket is approximately $10, while processing an e-ticket costs only $1. In the near future, e-tickets will be the only option, saving the airline industry $3 billion a year. In addition to financial savings, the sheer amount of paper eliminated by this process is commendable.


 

Click

42. DOWNLOAD YOUR SOFTWARE
Most software comes on a compact disc, and more than thirty billion compact discs of all types are sold annually. That's a huge amount of waste, not to mention the associated packaging. Another bonus to downloading your software is that it's often available for download at a later date when you upgrade to a new computer or are attempting to recover from a crash.

 

Who uses answering machines?

43. STOP YOUR ANSWERING MACHINE
Answering machines use energy 24 hours a day, seven days a week. And when they break, they're just one more thing that goes into the landfill. If all answering machines in U.S. homes were eventually replaced by voice mail services, the annual energy savings would total nearly two billion kilowatt-hours.


 

I like my sugar with coffee and cream

44. SKIP THE COFFEE STIRRER
Each year, Americans throw away 138 billion straws and stirrers. But skipping the stirrer doesn't mean drinking your coffee black. Simply put your sugar and cream in first, and then pour in the coffee, and it should be well mixed.

Determined to stir? Break off a piece of pasta from the cupboard. You can nibble after using it, compost, or throw away with less guilt.

 

Woof

45. FIND A BETTER WAY TO BREAK THE ICE
When a big winter storm heads our way, most of us use some sort of ice melter to treat steps and sidewalks. While this makes the sidewalks safer for people, it may pose a hazard for pets who might ingest these products. Rock salt and salt-based ice-melting products can cause health problems as well as contaminate wells and drinking water. Look for a pet-safe deicer, readily available in many stores.


Swab 

46. USE COTTON SWABS WITH A PAPERBOARD SPINDLE
Some brands of cotton swabs have a paperboard spindle while others are made of plastic. If 10% of U.S. households switched to a paperboard spindle, the petroleum energy saved per year would be equivalent to over 150,000 gallons of gasoline.

 

Compute

47. PAY BILLS ONLINE
By some estimates, if all households in the U.S. paid their bills online and received electronic statements instead of paper, we'd save 18.5 million trees every year, 2.2 billion tons of carbon dioxide and other greenhouse gases, and 1.7 billion pounds of solid waste.

 

Stop me oh oh oh stop me

48. STOP PAPER BANK STATEMENTS
Some banks will pay you a dollar or donate money on your behalf when you cancel the monthly paper statements you get in the mail. If every household took advantage of online bank statements, the money saved could send more than seventeen thousand recent high school graduates to a public university for a year.

 

Battery

49. USE RECHARGABLE BATTERIES
Each year 15 billion batteries produced and sold and most of them are disposable alkaline batteries. Only a fraction of those are recycled. Buy a charger and a few sets of rechargeable batteries. Although it requires an upfront investment, it is one that should pay off in no time. And on Christmas morning when all the stores are closed? You'll be fully stocked.

 

Shout it out

50. SHARE!
Take what you've learned, and pass the knowledge on to others. If every person you know could take one small step toward being greener, the collective effort could be phenomenal.

1/24/2008

Create your own passport size photos

www.epassportphoto.com lets you easily convert any of your digital picture into a valid passport size photograph.
 
You pick a country and then select whether you need the photo for a visa, passport or applying for a citizenship. Then upload the digital photo, crop and you immediately get a printable strip of 6-8 photographs for free.
 
Very useful, and time saving.
    10/3/2009

    Principles of Agile Software Development

    • Get case 1 fully working before starting case 2. Another way of saying this to use a kitchen metaphor is: “Serve the current meal before starting to cook the next“.  The biggest problem with software development is to start a bunch of things in parallel, because inevitably work will include something that is later discarded, meaning wasted work.  Work on one case; get it fully functional; get the tests running; write the documentation; check it all in as a finished piece of work, before you start on the next case.
    • Never break the build.  Pretty obvious, but must be included in any list of software development advice.  A programmer who is taking all the proper precautions to test before checking in will never break the build.  If the build is broken, it is always because someone took a shortcut.
    • Never implement a routine before it is needed in a use case.  When implementing a particular class, you should have a particular use case in mind, and you should implement only the methods required for that use case.  You might think about  the potential for other capabilities on a class, and you might document this in a comment, but implementation should wait until it is actually needed in a use case.
    • Never add a data member before it is needed in a use case. Exactly like above except with regard to class data members.  It may seem obvious that a “customer” record will need a “ship to address”, but that ship to address should not be implemented until you have a use case which specifically needs it.
    • Don’t be afraid to make a decision;  don’t be afraid to change an earlier decision.  Agile development is about responding to uncertainty and quickly responding.  Early in development you do not have complete information.  You should delay decisions as long as possible, but there comes a time that a decision is needed to move forward.  You cannot hold up decision until that information comes in.  Instead, make the best decision you can on the available information.  Later, when new information arrives, don’t be afraid to change that decision.  (Some dinosaurs call this flip-flopping, but I call it reacting to a changing environment.)
    • Continually learn how to improve quality. This job never ends, so you should expect to be constantly on the lookout for things that could be improved, and collect examples of ways that quality problems were identified and addressed.
    • Measure, measure, measure. Agile development is help address the problem of uncertainty about the future, but there should be no uncertainty about the past.  Tests should be continually running.  Performance of every run should be measured and recorded.
    • Design around people, not systems. Too often developers get sidetracked into designing for technical opportunities.  You should never lose sight of the ultimate purpose of the software, and that is to help people get work done.
    • Tests are part of the product.  Many developers and managers consider the product to be what you ship to the customer, and everything else less important.  The tests should be considered an actual part of the product, worthy of full consideration during design, and even, in many cases, delivered with the product to the customer. (This latter part is controversial, but a built-in self-test as part of a software delivery takes inconsequential space, and yet provide tremendous benefit when needed.  Such an approach should be considered.)
    • Write the test before the code. The test itself can be used to clarify the design for exactly what is needed.   Many times there are flaws in the design approach which are discovered when working through the test cases.  Think how much time would be saved to work through those cases before coding.  But: write the test for case1, and code for case 1, before starting case 2.
    • Eliminate Waste. Frankly, another ubiquitous platitude which must be included in any list of development principles because it is so important.  There is no end to the job of looking for waste where it exists and eliminating it.  Eliminate anything that does not add value to the actual customer.  If you cannot identify the value to the customer, then you probably don’t need it.
    • Build a culture of immediate response to build breakage. Understand that when the build is broken, it affect everyone in the project, and so there is nothing more important than making sure that the central core code is building and testing properly.  I have seen teams that allowed broken tests to persist for months because it was someone else’s job.  Everyone suffered, but nobody acted.  Instead, there needs to be widespread recognition that a little work will pay back in a big way over the team.
    • Every team members needs to understand the needs of the customer.  Large complex projects must be broken into separate teams and further divided for handing out to developers, but this should never be done to the extent that people lose sight of the desires and goals of the actual users of the final product.
    • Keep related definitions together. Structure the code so that highly related things are located together, possibly within one class.   This is a standard OO design principle of encapsulation.  Ideally, all the code outside the class will not need to know the details of the internal workings.  Some developers delight in spreading details across multiple files in order to organize in different way: such as to keep all the same data types together, or to organize alphabetically.  For example, putting all the constants in one class in a different package from where they are being used adds unnecessarily to the complexity of the program.   The guiding rule should be to group by relatedness with the result being to hide complexity.
    • Always run the tests before checking in. This guideline will help you satisfy the  “never break the build” guideline.
    • Premature optimization is the root of all evil. A quote from Don Knuth which rings true today.  Code should be written well to avoid needless waste at the micro level, but optimization beyond the individual method level should wait until testing within the entire program with a stress test bases on an actual end user use case.  Intuition of what is important for overall performance is almost always wrong when based only on a static understanding of the code.  Instead, measure the behavior of the complete system, to identify the 1% of the code that really makes a different in performance, and focus on that.
    • Minimize backlog of uncompleted coding tasks. When a developer starts to work on a use case, there is a cost associated with all the code that has been modified, but not completed and tested.  Holding uncompleted changes for days or weeks adds up to a significant risk of waste due to rework.  Consider three tasks estimated to take 1 day each.  Starting all three at one time, and working in parallel for three days involves an accumulation of 9 “units” of cost.  But doing each task sequentially, completing each task before starting the next, involves only 3 “units” of cost.  This is not intuitive.  Our intuition tells us that while we are in there, we might as well do three things at once, before buttoning the work up.  But software is not like physical construction.  Short, quick, and complete jobs not only cause less cognitive load, but also reduce the chance that uncompleted work will conflict with another person’s uncompleted work.
    • Never over generalize functionality. This is also known as “YAGNI – You Aren’t Going to Need It” .  While coding a particular class, programmers like to think with a small tweak this class might be used for several other purposes.  This is fine if those purposes are required by the current use case, but usually the programmer is thinking about uses which have not been invented yet, and which may in fact never be needed.  (This subject always reminds me of the classic Saturday Night Live skit about the product which was both a floor wax, and a dessert topping.)
    • Never use 3 lines when 2 lines would do. Succinctness in code pays every time someone else has to read it.  But don’t shrink the code to the point of being difficult to read.  Smaller, well written code can easier to maintain and easier to spot errors in, than verbose, ornately written code.  Always simplify as much as possible, but no more.
    • Never ever measure code by counting lines. The number of lines needed to do a particular task varies greatly from programmer to programmer, and from style to style.  The number of lines of code does not tell you much of anything about the completeness or the quality of the code.  Code quality can vary by a factor of 200, and this overwhelms any usefulness of the count of the lines.  Count instead functioning use cases.
    • Continually re-design and re-factor. Apply this cautiously because some code is brittle and difficult to change, but in general you should not be afraid to change the code to match the real use case.  A data member may have been an integer in the past, but when a use case requires it to be a floating point don’t be afraid to change it.
    • Delete dead code. There is a tendency to let “sleeping dogs lie” when it comes to large blocks of code that is not well understood.  One example is adding a new method to a class to replace another, quite often the developer will leave the old method there “just in case”.  Some effort should be expended to check to see if that method is needed, and delete it if there is no evidence that it is needed.  The worst offense is commenting out blocks of code, and leaving that commented code around.  Commented code should be deleted as soon as you know that the tests run, and certainly before checking it in.  It is easy to add code at any time, it is hard to delete code at any time.  Therefore, at a particular time that you have a good idea that something might not be needed, and small extra effort to verify this and eliminate the code will make the codebase more maintainable.
    • Don’t invent new languages. Programmers love to make text files that drive functionality in way configurable at run-time.  There are no end of configuration files to be able to change the behavior of the program without recompiling.  The advent of XML is driving an unending chain of specialized custom “scripting languages” that allow functionality to be “programmed” by the end user without having to compile.   The flaw in this reasoning is that the precise definition of the behavior of the operations almost never well defined outside of the context of a particular implementation, and these types of scripting languages are mainly useful only to people who have an intimate knowledge of the internal working of the code body in question.  Thus, real end users without detailed internal knowledge can never possibly know what is necessary to anticipate the effect of complex combinations of commands.   Scripting languages have a use, and cannot be eliminated, but the designer must take a very conservative approach and use existing languages as far as possible, and avoid inventing new ones.
    • Do not create a design until you are ready to implement and test the implementation. You should have some overall idea of where you are going, and a overview of the system architecture that will be aimed for, but no detailed design, no detailed description of functional implementation should be written down until the development iteration that will allow that design to be implemented and tests.  The detailed design should cover only as much as is needed to handle the current use case.  The biggest cause of waste in software development is time spend designing things that are not needed or need to be redesigned because of some mistaken assumptions that the design is based on.
    • Software is Plastic. Unlike physical manufacturing, software can be changed in significant ways very easily.   In fact there is plenty of evidence that software is easier to change than the design specifications that describe the software.  Furthermore, software communicates the design more effectively than the specification.  Therefore, you should spend the time to implement the design directly, so that customers can see the details of the design.  If you miss and have the change the design, it is easier to change the software than it would be to change the spec.   But most important, your information about what the customers wants is far better after they have seen the code running.
    • Take the time to code a complete description of the problem in the code that detects and reports exceptional situations. Programmers are often very lazy and throw exceptions with superficial descriptions of what is wrong.  Thinking that they are the only people who will ever see the problem, and they will remember the meaning of the problem from the vague description included.  But in fact more time is wasted in customer support situations because of inaccurate or incomplete error reports than any other cause.   Write every error message is if you are explaining the situation to someone who just walked into the room and has no experience with the code.  The customer, and the customer support team, after all, have no experience with the code.

    Courtesy kswenson.

    9/7/2009

    Lessons Learned from the “Last Lecture”

    I liked J. D. Meier's post about Randy Pausch's last lecture so much, I copied it verbatim.
     
     
     

    In this video, the “Last Lecture,” Randy Pausch talks about his dreams, enabling the dreams of others, and what lets you get to achieve your dreams.  The idea of the last lecture is a hypothetical question, “if you knew were going to die, and you had one last lecture, what would you say to your students?”  For Randy, it wasn’t hypothetical.  He was fighting pancreatic cancer.  This talk is not about death, though.  It’s about life and how to live.  Specifically, it’s about achieving childhood dreams and about how you can try to achieve them.

    Lessons Learned
    Here are my lessons learned from the “Last Lecture”:

    • Have specific dreams.  Randy didn’t want to be an astronaut, he wanted the floating.  When he got older, he found a way to experience zero-gravity, without having to first become an astronaut.
    • Brick walls are there for a reason.  They let us prove how badly we want things.  Brick walls let us show our dedication.  “They are there to separate us from the people who don’t really want to achieve their childhood dreams.”
    • Be good at something.  It makes you valuable.  Have something to bring to the table, because that will make you more welcomed. 
    • When you don’t get what you want, you get experience.  Randy says it so well, "Experience is what you get when you didn’t get what you wanted."
    • Most of what we learn, we learn indirectly (or by "head fake")  Randy teaches us that we actually don’t want our kids to learn football … but we send our kids out to learn much more important things: teamwork, sportsmanship, perseverance.  “These kind of head fake learnings are absolutely important and you should keep your eye out for them because they are everywhere.”
    • It’s all about the fundamentals.  You’ve got to get the fundamentals down, because otherwise the fancy stuff isn’t going to work.
    • Have fun.  Never underestimate the importance of fun.  Choose to have fun.  Have fun while learning something hard.  Randy says, “I don’t know how to not have fun.  I’m dying and I’m having fun.  And, I’m going to keep having fun, everyday I have left, because there’s no other way to play it.”
    • It’s not what you say, but how you say it.  Randy shares an example, where two people say the same thing, but they say it in different ways: “I don’t know” is different than, “Well, I don’t have much information but one of my star faculty members is here and he’s all excited so I want to learn more.”
    • You can have your cake and eat it too.  Randy, wanted to be a Disney imagineer, but liked his life as a professor.  He struck a deal where he could consult one day a week with the imagineers.
    • Hand the torch to somebody who can carry it forward.  “When you’ve had something for 10 years that you hold so precious, it’s the toughest thing in the world to hand it over, and the only advice I can give you is find somebody better than you to hand it to.”
    • Get somebody to be reflective.  “The best gift an educator can give, to get somebody to become self-reflective.”
    • Never lose the child-like Wonder.  It’s just too important.  It’s what drives us.
    • There are moments that change your life.  10 years later if you know in retrospect, it was one of those moments, you’re blessed.  But to know it, *at* the moment …
    • Work and play well with others.   What goes around comes around.  You can’t get there alone.  Tell the truth, be earnest, apologize when you screw up, and focus on others, not yourself.
    • Apologize properly.  Apologize (properly).  A good apology has 3 parts: 1) I’m sorry.  2) It was my fault. 3) How do I make it right?
    • Never give up.  “Don’t bail; the best gold is at the bottom of the barrels of crap.”
    • Do the right thing.  When you do the right thing, good stuff has a way to happen.
    • Get a feedback loop and listen to it. When people give you feedback, cherish it and use it.  “It can be a spreadsheet of data or it can be one great person that tells you what you need to hear.  The hard part is listening to it.”
    • Show gratitude
    • Don’t complain.  Just work harder.   Jackie Robinson had it in his contract not to complain, even when the fans spit on him.  You can choose to take your finite time, and energy and effort and you can spend it complaining or you can spend it playing the game hard, which is probably going to be more helpful to you in the long run.
    • Find the best in everybody.  Find the best in everybody, no matter how you have to wait for them to show it. “You might have to wait a long time, sometimes years, but People will show you their good side.  Just keep waiting no matter how long it takes.  No one is all evil.  Everybody has a good side.  Just keep waiting, it will come out.”
    • Be prepared.  “Luck" is where preparation meets opportunity.
    • If you lead your life the right way, your dreams will come to you.  “It’s not about how to achieve your dreams, but how to lead your life.  If you lead your life the right way, the Karma will take care of itself.  The dreams will come to you.”

    Decide If You’re Tigger or Eeyore
    Decide if you’re Tigger or Eeyore.  You just have to decide if you’re Tigger or Eeyore.  Tigger finds the fun in every situation.  Eeyore wallows in self-misery.

    Leadership Skills from Captain Kirk
    Randy shares how he learned the value of leadership from Captain Kirk.  “What I learned that carried me forward in leadership later is that  he wasn’t the smartest guy on the ship.  I mean, Spock was pretty smart,and McCoy was the doctor, and Scotty was the engineer … and, you sort of go, and what skill set did he have to get on this damn thing and run it? … and clearly there is this skill set called leadership, and whether or not you liked the series, there’s no doubt that there was a lot to be learned about leading people by watching this kind of action.”

    When Nobody’s Saying Anything to You Anymore, That Means They Gave Up
    Your worst critics can be your best coaches.  It’s tough love.  Randy tells the story of one of his most grueling football practices.  When it was all over, one of the assistant coaches came over and said, “Coach Graham rode you pretty hard, didn’t he?”   Randy replied, “yeah.”  The assistant responded, “That’s a good thing … When you’re screwing up, and nobody’s saying anything to you anymore, that means they gave up.”

    Randy’s take away was … when you see yourself doing something badly and nobody’s bothering to tell you anymore, that’s a very bad place to be.  Your critics are your ones telling you they still love you and care.

    People vs. Things
    Randy shares a lesson about the importance of people vs things.  His parents taught him early on the importance of people over things.  When he got his first convertible, he drove to his sister’s house to pickup his niece and nephew to watch them for the weekend.  While his sister explained to her kids how careful they needed to be in Randy’s new car, Randy slowly poured a can of soda on the back seat of his car, to make the point that it’s just a thing.  Randy says this was a good thing because his nephew got the flu and threw up on the backseat on the way back.

    The point Randy makes is that he doesn’t care how much value you get by owning a shiny thing.  It doesn’t feel as good as he felt that his 8 year old nephew wasn’t embarrassed that he had the flu.

    Additional Resources
    Here are related resources:

    8/16/2009

    This Bridge Is Alive

    In the depths of northeastern India, in one of the wettest places on earth, bridges aren't built - they're grown.

    The living bridges of Cherrapunji, India are made from the roots of the Ficus elastica tree. This tree produces a series of secondary roots from higher up its trunk and can comfortably perch atop huge boulders along the riverbanks, or even in the middle of the rivers themselves.

    Cherrapunji is credited with being the wettest place on earth, and The War-Khasis, a tribe in Meghalaya, long ago noticed this tree and saw in its powerful roots an opportunity to easily cross the area's many rivers. Now, whenever and wherever the need arises, they simply grow their bridges.

    In order to make a rubber tree's roots grow in the right direction - say, over a river - the Khasis use betel nut trunks, sliced down the middle and hollowed out, to create root-guidance systems.
    The thin, tender roots of the rubber tree, prevented from fanning out by the betel nut trunks, grow straight out. When they reach the other side of the river, they're allowed to take root in the soil. Given enough time, a sturdy, living bridge is produced.

    The root bridges, some of which are over a hundred feet long, take ten to fifteen years to become fully functional, but they're extraordinarily strong - strong enough that some of them can support the weight of fifty or more people at a time.

    Because they are alive and still growing, the bridges actually gain strength over time - and some of the ancient root bridges used daily by the people of the villages around Cherrapunji may be well over five hundred years old.


    One special root bridge, believed to be the only one of its kind in the world, is actually two bridges stacked one over the other and has come to be known as the "Umshiang Double-Decker Root Bridge."

     



    All the credit for this post goes to Atlas Obscura's Wonderful Post on living root bridges.
    5/20/2009

    Microsoft's Vision For the Future

    Microsoft's five minute video on what the year 2019 will look like is pretty amazing. I want to live in this world. GIVE IT TO ME NOW
     
     
    3/4/2009

    Writing's Powerful Message

    There was once a young man who, in his youth, professed a desire to become a "great" writer.

    When asked to define "great" he said "I want to write stuff that the whole world will read, stuff that people will react to on a truly emotional level, stuff that will make them scream, cry, wail, howl in pain, desperation, and anger!"

    He now works for Microsoft writing error messages.

    12/30/2008

    Random Tips

    Best way to download mp3 from youtube

    If you want to download music without getting into trouble I suggest you download the mp3 file from a youtube video, you can find most songs on youtube and you can download the mp3 at http://www.listentoyoutube.com/  I have tried several similar applications and this is the one that works better.

     

    Health Tips

    Combine cardio with weight training to lose weight.

    Many people just focus on cardio exercise when trying to lose weight but it is way more effective to combine it with weight training, cardio will help you burn calories and increase your metabolic rate for a couple of hours but intensive weight training, on the other hand, has been reported to cause increases in metabolic rate that last for up to a couple of days.

    Having a faster metabolic rate means that you can process calories easier and more efficiently than someone with a slower metabolism, that's why bodybuilders can eat more junk food without getting fat.

     

    Never ever skip breakfast

    My tip is NEVER EVER skip breakfast, no matter how guilty you feel because you have overeaten the previous night. Also, breakfast is the only meal when I will make myself eat even if I’m not that hungry. It really makes a difference because it is easier to lose wight and you have more energy throughout the day when you eat breakfast.

     

    Let your muscles rest after a weight training session

    You should let your muscles rest at least one day after your weight training session. You can workout daily (taking off 1 or 2 days a week) but don't exercise the same muscle two days in a row. Do this in order to avoid injuries and to let your muscles recover so they can grow.

     

    Frequency is more important than duration when working out.

    Frequency is almost always more beneficial than duration when working out. For instance, although theoretically you are burning the same amount of calories, five 30-minute workouts are going to be more beneficial to your health than two 75-minute sessions

     

    Car Tips

    Keep your car on good shape by changing the oils and fluids

    If you want your car to last, you need to change the oils and fluids on a regular basis. It is recommended to make regular oil change services (not just an oil & filter change) at 3000 mile intervals, changing it at intervals greater than 3000 miles will harm your engine. When using synthetic oil it is recommended making oil changes at maximum 6000 miles intervals.

     

    Finding a good mechanic you trust.

    Finding a good mechanic can be difficult so when you find one you usually stay with that mechanic for years. A good way to start looking for a mechanic you can trust is using a local business review website like yelp.com, then after you find one near you with positive reviews you can still ask for references.

    If you take your car to a mechanic that can't repair your car promptly or "repairs" your car but it keeps having the same problems or even new issues then you should cut your losses and immediately start looking for a better mechanic or else you may end up wasting a lot of time and money.

    12/22/2008

    Have Yourself a Merry Little Christmas

     
    11/8/2008

    Check the Current Geographical Location of any Indian Railways Train

    IndiaRail Info is an interesting Google Maps mashup that helps you visualize the current geographical location of any train in India. Just type train name or train number and check its exact location on the map.

    indian train location 

    India Rail Info has a database of all trains and railway stations in India.

    For example, the Bandra Garib Rath Express (2910) has crossed Kota junction at 8:23pm IST. Unfortunately this site does not extrapolate this data to guess the location between two junctions, so the train is still shown at Kota.

    Thanks digital inspiration.

    10/21/2008

    Waterfall "Printer"

    This waterfall installation located in the Canal City Hakata shopping complex in Fukuoka, Japan can form intricate patters using water sprayed from hundreds of nozzles that are precisely controlled by computers.

       

    10/16/2008

    Signs You'll Live Longer Than You Think

    Surprising Signs You'll Live Longer Than You Think
     
    Sign 1: Your Mom Had You Young
    Surprising Signs You'll Live Longer Than You Think // Mother and daughter in field (© Janie Airey/Getty Images)

    If she was under age 25, you're twice as likely to live to 100 as someone born to an older mom, according to University of Chicago scientists. They suspect that younger moms' best eggs go first to fertilization, thus producing healthier offspring.

    Sign 2: You're a Tea Lover

    Surprising Signs You'll Live Longer Than You Think // Tea cups (© Sang An/FoodPix/Jupiterimages)

    Both green and black teas contain a concentrated dose of catechins, substances that help blood vessels relax and protect your heart. In a study of more than 40,500 Japanese men and women, those who drank 5 or more cups of green tea every day had the lowest risk of dying from heart disease and stroke. Other studies involving black tea showed similar results.
    You really need only one or two cups of tea daily to start doing your heart some goodjust make sure it's a fresh brew. Ready-to-drink teas (the kind you find in the supermarket beverage section) don't offer the same health benefits. "Once water is added to tea leaves, their catechins degrade within a few days," says Jeffrey Blumberg, Ph.D., a professor of nutrition science and policy at Tufts University. Also, some studies show that adding milk may eliminate tea's protective effects on the cardiovascular system, so stick to just lemon or honey.

    Sign3 : You'd Rather Walk
    Surprising Signs You'll Live Longer Than You Think // Woman walking (© MM Productions/Corbis)

    "Fit" peopledefined as those who walk for about 30 minutes a dayare more likely to live longer than those who walk less, regardless of how much body fat they have, according to a recent study of 2,603 men and women. Similarly, overweight women can improve their heart health by adding just 10 minutes of activity to their daily routine, says recent research. So take a walk on your lunch hour, do laps around the field while your kid is at soccer practicefind ways to move a little more, every day.

    Sign 4: You Skip Soda (Even Diet)
    Surprising Signs You'll Live Longer Than You Think // Can of soda (© Josh Westrich/zefa/Corbis)

    Scientists in Boston found that drinking one or more regular or diet colas every day doubles your risk of metabolic syndromea cluster of conditions, including high blood pressure, elevated insulin levels, and excess fat around the waist, that increase your chance of heart disease and diabetes. One culprit could be the additive that gives soda its caramel color, which upped the risk of metabolic syndrome in animal studies. Scientists also speculate that soda drinkers regularly expose their taste buds to natural or artificial sweeteners, conditioning themselves to prefer and crave sweeter foods, which may lead to weight gain, says Vasan S. Ramachandran, M.D., a professor of medicine at Boston University School of Medicine and the study's lead researcher. Better choices: Switch to tea if you need a caffeine hit. If it's fizz you're after, try sparkling water with a splash of juice. By controlling blood pressure and cholesterol levels, preventing diabetes, and not smoking, you can add 6 to 9 1/2 healthy years to your life.

    Sign 5: You Have Strong Legs

    Surprising Signs You'll Live Longer Than You Think // Woman lifting weights against a fitness ball (© Basim Abdel-Aziz/DK Stock/Getty ImagesO

    Lower-body strength translates into good balance, flexibility, and endurance. As you get older, those attributes are key to reducing your risk of falls and injuriesparticularly hip fractures, which often quickly lead to declining health. Up to 20 percent of hip-fracture patients die within one year because of complications from the trauma. "Having weak thigh muscles is the number-one predictor of frailty in old age," says Robert Butler, M.D., president of the International Longevity Center–USA in New York City. To strengthen them, target your quads with the "phantom chair" move, says Joan Price, author of The Anytime, Anywhere Exercise Book (Adams, 2007). Here's how: Stand with back against wall. Slowly walk feet out and slide back down until you're in a seated position, ensuring knees aren't beyond toes and lower back is pressed against wall. Hold until your thighs tell you, 'Enough!' Do this daily, increasing your hold by a few seconds each time.

    Sign 6: You Eat Purple Food
    Surprising Signs You'll Live Longer Than You Think // Bowl of Concord grapes (© FoodCollection/SuperStock )

    Concord grapes, blueberries, red wine: They all get that deep, rich color from polyphenols—compounds that reduce heart disease risk and may also protect against Alzheimer's disease, according to the new research. Polyphenols help keep blood vessels and arteries flexible and healthy. "What's good for your coronary arteries is also good for your brain's blood vessels," says Robert Krikorian, Ph.D., director of the Cognitive Disorders Center at the University of Cincinnati. Preliminary animal studies suggest that adding dark grapes to your diet may improve brain function. What's more, in a recent human study, researchers found that eating one or more cups of blueberries every day may improve communication between brain cells, enhancing your memory.

    Sign 7: You Were a Healthy-Weight Teen

    Surprising Signs You'll Live Longer Than You Think // Woman on a scale (© Christina Kennedy/DK Stock/Getty Images)

    A study in the Journal of Pediatrics that followed 137 African Americans from birth to age 28 found that being overweight at age 14 increases your risk of developing type 2 diabetes in adulthood. Adults with diabetes are two to four times more likely to develop heart disease than those without the condition, according to the American Heart Association.

    Sign 8: You Don't Like Burgers
    Surprising Signs You'll Live Longer Than You Think // Burgers on a grill (© Mark Thomas/FoodPix/Jupiterimages)

    A few palm-size servings (about 2 1/2 ounces) of beef, pork, or lamb now and then is no big deal, but eating more than 18 ounces of red meat per week ups your risk of colorectal cancerthe third most common type, according to a major report by the American Institute for Cancer Research. Colorectal cancer risk also rises by 42 percent with every 3 1/2-ounce serving of processed meat (such as hot dogs, bacon, and deli meats) eaten per day, the report determined. Experts aren't sure why red and processed meats are so harmful, but one of their suspects is the carcinogens that can form when meat is grilled, smoked, or curedor when preservatives, such as nitrates, are added. "You can have an occasional hot dog at a baseball game, but just don't make it a habit," says Karen Collins, R.D., a nutrition advisor at AICR. And when you do grill red meat, marinate it first, keep pieces small (kebab-size), and flip them oftenall of which can help prevent carcinogens from forming. If you're baking or roasting it, keep the oven temp under 400°F.

    Sign 9: You've Been a College Freshman
    Surprising Signs You'll Live Longer Than You Think // Young man studying in library (© Thomas Barwick/Getty Images)

    A recent Harvard Medical School study found that people with more than 12 years of formal education (even if it's only one year of college) live 18 months longer than those with fewer years of schooling. Why? The more education you have, the less likely you are to smoke. In fact, only about 10 percent of adults with an undergraduate degree smoke, compared with 35 percent of those with a high school education or less, according to the CDC.

    Sign 10: You Really Like Your Friends …
    Surprising Signs You'll Live Longer Than You Think // Group of people standing in doorway (© Andrew Hobbs/Getty Images)

    "Good interpersonal relationships act as a buffer against stress," says Micah Sadigh, Ph.D., an associate professor of psychology at Cedar Crest College. Knowing you have people who support you keeps you healthy, mentally and physically: Chronic stress weakens the immune system and ages cells faster, ultimately shortening life span by 4 to 8 years, according to one study. Not just any person will do, however. "You need friends you can talk to without being judged or criticized," says Sadigh.

     
    Sign 11: … and They're Healthy
    Surprising Signs You'll Live Longer Than You Think // Two women sitting on the edge of a pool (© Lauren Burke/Getty Images)

    If your closest friends gain weight, your chance of doing the same could increase by 57 percent, according to a study in the New England of Journal of Medicine. "To maintain a healthy lifestyle, it's important to associate with people who have similar goals," says Nicholas A. Christakis, M.D., Ph.D., the study's lead researcher. Join a weight loss group, or train with a pal for a charity walk.

    Sign 12: You Don't Have a Housekeeper
    Surprising Signs You'll Live Longer Than You Think // Woman cleaning (© Justin Pumfrey/Getty Images)

    Just by vacuuming, mopping floors, or washing windows for a little more than an hour, the average person can burn about 285 calories, lowering risk of death by 30 percent, according to a study of 302 adults in their 70s and 80s.

    Sign13 : You're a Flourisher

    Surprising Signs You'll Live Longer Than You Think // Man playing guitar (© Matt Carr/Getty Images)

    About 17 percent of Americans are flourishers, says a study in American Psychologist. They have a positive outlook on life, a sense of purpose and community, and are healthier than "languishers"about 10 percent of adults who don't feel good about themselves. Most of us fall somewhere in between. "We should strive to flourish, to find meaning in our lives," says Corey Keyes, Ph.D., a professor of sociology at Emory University. "In Sardinia and Okinawa, where people live the longest, hard work is important, but not more so than spending time with family, nurturing spirituality, and doing for others."

     

     
    1/2/2008

    Download Free Visual Studio 2008 eBooks

    Courtesy MS Press (Click on the following images to download)
     
    Ajax   Linq   silverlight
    12/31/2007

    Happy New Year

    Happy New Year