Tuesday, January 31, 2006

Maintain Determination


With enough determination, no goal is out of reach. Determination carries you past seemingly insurmountable obstacles and makes things real that were once considered impossible.
So how do you create and maintain sufficient determination to take you where you want to go? How do you keep the power of determination working for you?
To maintain your determination, you simply must remember it. For as powerful as your determination can be, it is nothing more than a concept in your mind.
As long as you can keep that concept of determination at the front of your mind, it will work for you. As long as you can remember, with passion and with clarity, the what, why and how of your determination, it will carry you forward.
When the challenges come, remember that you are determined and you will be. Though your determination won't solve your problems for you, it can keep you going long enough for you to solve them yourself.
What things in your life do you truly wish to change, to improve, to create, to accomplish, and why? Sincerely answer that question, and you'll discover plenty of determination within yourself.
Keep that determination in mind as each moment goes by, and you'll accomplish whatever you choose to accomplish.
-- Ralph Marston

Monday, January 30, 2006

Value of Attention

Sometimes you can move ahead more quickly by slowing down. Often you can get more accomplished by being less busy.

When you rush quickly through a task, without taking the time to get it right, what have you accomplished? When you hurry through life so frantically that you can't keep track of where you are, what value does that bring you?

When you try to do too many things at once, you're sending yourself a subtle, yet powerful, negative message. You're telling yourself that not one of those efforts, by itself, is worthy of your undivided attention.

Similarly, when you rush through a task, you're sending yourself a message that the task is not worthy of your time. If you have no respect for what you're doing, it won't produce much value, no matter how quickly or in what quantity you do it.

To achieve maximum value, work quickly enough to get it done and slowly enough to do it right. Before taking on a new task, be sure that you have enough quality time to give it your full attention.

Stop wasting so much energy rushing from one thing to the next and back again. And you'll have more than enough time to create real, lasting value.

-- Ralph Marston

Friday, January 27, 2006

Quote on Great People


“Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great."

-- Mark Twain.

Tuesday, January 24, 2006

Choice of Feelings


People come into your life for a reason, a season, or a lifetime. When you figure out which it is, you’ll know exactly what to do.-Michelle Ventor
Choice of feelings
You create your feelings and you are responsible for them. By controlling those feelings in a positive and purposeful way, you can profoundly change your life for the better.
If you blame another person for your feelings, what you're really doing is giving that person control over an important part of your life. If you avoid taking responsibility for your feelings, those feelings can quickly overwhelm you and leave you powerless.
The way you feel can affect every corner of your life. By taking positive control of your feelings, you put yourself in a powerful and influential position in your world.
Keep in mind that every feeling you experience is a feeling you have chosen. Though much of what comes your way is beyond your control, the way you feel about it all is completely up to you.
If your life seems to be stuck, that's a sure sign that you're holding on to feelings that are no longer appropriate. Know that you can let those feelings go and be gloriously free to move quickly ahead.
Feelings are powerful and can bring much richness to life, and the power they have is the power you choose to give them. Choose your feelings wisely, and life will be rich indeed.
-- Ralph Marston

Monday, January 23, 2006

Getting out of dissappointment


It feels lousy to be disappointed, whether it is by other people, by circumstances, or by your own mistakes. And yet, in each disappointment there is also opportunity.  When a disappointment comes, acknowledge it and feel it for what it is. Then quickly step away from it and take a more objective look.
You'll discover that in the larger context of your life, that disappointment can have positive value. Though one door has been closed to you, many more have just been opened.
From each disappointment you can gain knowledge, motivation, perspective and a more clearly defined purpose. From each disappointment, you can learn much about life and about yourself, much that will help you move on ahead.
When life lets you down, there is value to be found in that disappointment. Quickly get back up and begin to live that value.
When you go forward, you will occasionally stumble. And when you choose to positively recover from those stumbles, you'll move more quickly ahead.
-- Ralph Marston

Friday, January 20, 2006

Thursday, January 19, 2006

Remove the limits on your thoughts

Here's a story about George Dantzig - the famed mathematician who's contributions to Operations Research and systems engineering have made him immortal.

As a college student, George studied very hard and often late  into the night. So late, that he overslept one morning, arriving 20 minutes  late for Prof. Neyman's class. He quickly copied the two maths problems on the board, assuming they were the homework assignment. It took him several days to work through the two problems, but finally he  had a breakthrough and dropped the homework on Neyman's desk the next day.

Six weeks later, on a Sunday morning, George was awakened at 6 a.m. by his excited professor. Since George was late for class, he hadn't heard the professor  announce that the two unsolvable equations on the board were mathematical  mind-teasers that even Einstein hadn't been able to answer. But George Dantzig, working without any thoughts of limitation, had solved not one, but two problems that had stumped mathematicians for thousands of  years.

Simply put, George solved the problems because he didn't know he couldn't.

You are not limited to the life you now live. It has been accepted by you  as the best you can do at this moment. Any time you're ready to go beyond the limitations currently in your life, you're capable of doing that by  choosing different thoughts. All you must do is figure out how you can do it, not whether or not you can. And once you have made your mind up to do it, it's amazing how your mind  begis to figure out how. Afterall, a person is limited only by the thoughts that he/she chooses. 


Tuesday, January 17, 2006

Take the first step


Take the first step in faith. You don't have to see the whole staircase, just take the first step.-Martin Luther King, Jr.

Take the time
Take the time to put something back where it belongs, and you'll easily be able to find it next time you need it. Take the time to learn, and you'll make yourself more effective.
Take the time to listen, and you'll much more clearly understand. Take the time to think before you act, and your actions will take you where you want to go with no regrets.
Take the time to say thank you and to appreciate the good things you have, and abundance will grow in your life. Take the time to truly enjoy yourself, and you'll inject positive energy into all you do.
Take the time to offer a word of encouragement, and your world will be a brighter place. Take the time to give a helping hand to someone in need, and your own troubles will suddenly shrink away.
Take the time to work through a challenge, and you'll discover a whole new level of positive opportunities. Take the time to be curious and aware of the world around you, and you'll see magnificent possibilities in every direction.
Take the time to love, to smile, to wonder, to play, and to find out who you really are. Take the time to fully live in each moment as it comes along, and life will be rich indeed.
-- Ralph Marston

Monday, January 16, 2006

Code

often encounter code like this:















































































































view plainprint?

The excessive nesting of conditional clauses pushes the code out into an arrow formation:









(image placeholder)

And you know you're definitely in trouble when the code you're reading is regularly exceeding the right margin on a typical 1280x1024 display. This is the Arrow Anti-Pattern in action.
One of my primary refactoring tasks is "flattening" arrow code like this. Those sharp, pointy barbs are dangerous! Arrow code has a high cyclomatic complexity value-- a measure of how many distinct paths there are through code:
Studies show a correlation between a program's cyclomatic complexity and its error frequency. A low cyclomatic complexity contributes to a program's understandability and indicates it is amenable to modification at lower risk than a more complex program. A module's cyclomatic complexity is also a strong indicator of its testability.
Where appropriate, I flatten that arrow code by doing the following:
  1. Replace conditions with guard clauses. This code..

  2. if (SomeNecessaryCondition) {

  3.     // function body code

  4. }
.. works better as a guard clause:
if (!SomeNecessaryCondition)
{
    throw new RequiredConditionMissingException;
}
// function body code
  1. Decompose conditional blocks into seperate functions. In the above example, we're in a do..while loop which could be decomposed:

  2. do

  3. {

  4.     ValidateRowAttribute(drc[rowIdx]);

  5.     rowIdx++;

  6. }

  7. while(rowIdx < rowCount && GetIdAsInt32(drc[rowIdx]) == Id);

  8. Convert negative checks into positive checks. As a broad rule, I prefer to put the positive comparison first and let the negative comparison fall out naturally into the else clause. I think this reads a lot better and, more importantly, avoids the "I ain't not doing that" syndrome:

  9. if (Attributes[attrVal.AttributeClassId] is ArrayList)

  10. {

  11.     // do stuff

  12. }

  13. else

  14. {

  15.     // do stuff

  16. }

  17. Always opportunistically return as soon as possible from the function. Once your work is done, get the heck out of there! This isn't always possible -- you might have resources you need to clean up. But whatever you do, you have to abandon the ill-conceived idea that there should only be one exit point at the bottom of the function.
The goal is to have code that scrolls vertically a lot.. but not so much horizontally.