PGP-Protector

Archive for July, 2011

What are the odds?

by on Jul.19, 2011, under Uncategorized

I often hear of People talking about it must be a miracle because of the Odds of an event occurring,
or the Odds are so high that it can’t happen.

I don’t think people really understand that just because the “odds” are high that doesn’t mean that it can’t happen.
Example, what are the odds of you existing?

Well given that the (low estimate) sperm count of an average event is around 39,000,000

The Odds of that one event where your parents came together and created you is 1 in 39,000,000.  If any other sperm fertilized the egg, you wouldn’t be you as it would have been a different DNA pattern.

 

Same for both of your parents (1 in 39,000,000) for each of them (1 in 1.521E+15)

And same for their parents (1 in 39,000,000) for each of them (all 4) (1 in 2.31344E+30)

And if we only go back 3 generations we’re up to 1 in 5.35201E+60.

 

And remember these are overly low, assuming only 1 attempt for each pregnancy, and that there wasn’t any chance of any of your ancestors meeting up with anyone else.

Leave a Comment more...

C# WPF Registered names

by on Jul.18, 2011, under Coding

I was working on a project that was using Registered names on a WPF Form for paths so that the user can select them, over all it was working quite well, until the user was required to delete some on them (in random order)

After a small bit of tweaking, I also got that working.  Though it did bring up another issue.  When I wanted to Clear the canvas, their was no easy way to also clear all the left over Registered names on the existing paths, and not every path had a registered name.

My final solution was to come up with this small routine.  It at least appear to do the job.

 

 

        private void ClearRegisteredNames(Canvas CanvasToClear)
        {
            if (CanvasToClear != null)
            {
                foreach (object ChildObject in LogicalTreeHelper.GetChildren(CanvasToClear))
                {
                    Type Name = ChildObject.GetType();
                    if (Name == typeof(Path))
                    { 
                        // Get Path Name if Any?
                        Path FoundPath = (Path)ChildObject;
                        string PathName = FoundPath.Name;
                        if (PathName != "") CanvasToClear.UnregisterName(PathName);
                    }
                }
            }
        }
Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!