Tuesday, September 29, 2009

Why every other playoff system sucks

Many times we’ve seen a underdog team defeating a top-ranked team in the 1st round of a major tournament. Most people rejoice (except the fans of the losing team) since everybody loves a fairy tale  victory, The organizer’s are happy since it creates a lot of buzz and everybody’s happy that the sports is still not dead since anything can happen.

Let’s take a deeper look. Team A wins 63 games out of 80 games in the regular season plays Team B which won around 40 games. Team A loses the match and bows out of the tournament. Everybody is surprised for a moment, Team B probably loses in the next round since they again play a better team and are already happy with the results they have in hand [there was a reason it only won 40 games out of 80].

The above is a common format used across many competitions in the world (NBA, Cricket Tournaments, NCAA Tournament, Champions league). But, I think such upsets does more harm to the game than benefits it. Since the team who was definitely one of the better teams in the tournament is out due to having a bad day or couple of major players being out/suspended for the game.

ncaa_mens

Some organizers e.g. the NBA, try to avoid the above scenario by either keeping N (=3,5,7) no. of matches or sometimes  giving the top ranked team a home advantage or sometimes both. Playing multiple matches definitely lowers the odds of the better team losing, however, this usually leads to some boring matches in the initial part of the tournament.

Nba_format Here comes the format used by the Australian Football league, which looks like this:

800px-AFL_finals_v2 Clearly, this system has numerous advantages than the knockout system usually followed. To quote Wikipedia “Under this finals system, the final eight teams are broken up into four groups of two. Each group of two earns one extra benefit over the teams beneath it. These benefits are home ground finals and the double-chance, whereby a first-week loss will not eliminate the team from the finals.”

I think atleast some tournaments should explore this format like the NCAA basketball tournament and the Cricket world cup which have the worst structure since there is only a single match between the teams and there’s no clear home-court advantage.

References:

http://en.wikipedia.org/wiki/AFL_finals_system

Saturday, September 12, 2009

The Decorator Pattern

Decorator pattern is a kind of structural design pattern which provides a way to attach new state and behavior to an object dynamically. The original object is left untouched which makes the pattern useful for changing systems. Decorators both inherit the original class and contain an instant of it.
The Decorator pattern is generally used when a object is needed with some extra functionality than an existing class but the existing class is not available for subclassing or one doesn't want to subclass for some reason (e.g. to avoid class explosion).
The following example illustrates the pattern:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DPPractice
{
    class DecoratorPattern
    {
        interface IWindow
        {
            string getDescription();
            void draw();
        }
        public class SimpleWindow : IWindow
        {
            public void draw()
            {
                //draw Simple Window
            }

            public string getDescription()
            {
                return "simple window";
            }

        }
        class VerticalScrollBarDecorator : IWindow
        {

            private IWindow decoratedWindow;

            public VerticalScrollBarDecorator(IWindow decoratedWindow)
            {
                this.decoratedWindow = decoratedWindow;
            }


            public void draw()
            {
                drawVerticalScrollBar();
                decoratedWindow.draw();
            }

            private void drawVerticalScrollBar()
            {
                // draw the vertical scrollbar
            }

            public String getDescription()
            {
                return decoratedWindow.getDescription() + ", including vertical scrollbars";
            }
        }

        static void Main(String[] args)
        {
            // create a decorated Window with horizontal and vertical scrollbars
            IWindow window = new VerticalScrollBarDecorator(new SimpleWindow());

            // print the Window's description
            Console.WriteLine(window.getDescription());
        }


    }
}





As can be seen from the example the Decorator pattern is heavily utilized in displaying windows etc. adding and excluding scroll bars easily while rendering.

Other uses of the Decorator Pattern:

1. Decorators are used in I/O API's of C#.
System.IO.Stream is decorated by
System.IO.BufferedStream
System.IO.FileStream Etc.

2. As illustrated by the example the Decorator pattern is heavily utilized in rendering windows/display objects

References:
http://en.wikipedia.org/wiki/Decorator_pattern
Design Patterns: Elements of Reusable Object-Oriented Software
C# 3.0 Design Patterns

Monday, September 7, 2009

Time Management

This weekend I took some time out to watch the Time Management talk by Randy Pausch.Randy Pausch was an Computer Science professor at CMU. He died of cancer in July, 2008. He was a great speaker and some of his lectures has become very famous in the last few years. The most famous one being “The Last Lecture: Really Achieving Your Childhood Dreams" which is one of the most inspiring talks I have ever heard.

The talk on Time management, however, is a more pragmatic talk and talks about techniques to manage time better. Again, the underlying principle in Randy’s talk is to maximize life and fun.

Here is the talk followed with my notes. The slides are available here.

1. Pragmatic Talk
    a. Time is only commodity that matters
2. Agenda:
    a. Set goals
    b. Avoid wasting time
    c. Deal w/ boss
    d. How to delegate to others
    e. Tools
    f. Stress and Procrastination
3. Slides on website, Red stars are important
4. Americans bad at dealing with time
    a. Waste time
    b. Time and money are equitable
    c. How much is your time worth/hr
    d. Costs company twice your salary
    e. 50000/yr --> 100k cost to org
    f. Decisions: Outsource vs. DIY
    g. Manage time as money
        i. Money is not well managed
        ii. Though better
    h. Money can be earned later, Time doesn’t comes back
    i. Boss == Academic Advisor/Parents
5. One good thief [11]
    a. Talk is composed mainly from nuggets from the 2 books
        i. Time Management for Teachers
        ii. Career Track Seminar: Taking control of Your Work Day
    b. Time Famine:
        i. Problem is systematic
        ii. Long term solution required
    c. This is Life Advice
6. Overall goal is Fun
        a. Maximize time is a means so that we maximize fun
    7. Typical Office worker wastes 2 hours/day[13]
        a. Messy desk etc.
    8. Manage time well to be successful
        a. Meta skills
        b. If you want to run with ppl faster than you, optimize the skills you have
    9. Planning [16]
        a. Great if you can cross stuff from your to-do list
        b. More important to do the right things adequately than Doing (wrong) things right
        c. 80/20 rule: Very small things on ur list is gonna matter most
        d. Experience comes with time and no shortcuts.
        e. When things don’t go well, you're learning a lot and it'll be better soon.
    10. Inspiration
        a. If you can dream it, you can do it.
        b. If you refuse to dream it, you won't do it.
        c. Disneyland: 366 days
            i. Used everyone of them
    11. Planning
        a. Daily/Weekly/Semester
        b. You can always change the plan
    12. To do lists
        a. Break stuff into small steps
        b. Boss: Grow your people
        c. Eat that frog. Start with the big one first
        d. *Covey's four quadrants
            i. Go to Quad 2 after Q1 rather than Q3
        e. *Paperwork
            i. No clutter
            ii. Touch each piece of paper/email only once
                1) Inbox is not to-do list
        f. Filing system
            i. All paper goes there in alpha order
            ii. Everything should have a place
    13. Desk [ime - 28:06]
        a. Atleast 2 monitors
            i. Left:
                1) To do list
            ii. Mid:
                1) Inbox
            iii. Right:
                1) Calendar
        b. *Speaker Phone
            i. Great for waiting
            ii. Timer: Great for making people guilty on other side     
            iii. Telephone Techniques
                1) Group your calls
                2) Keep calls short
                3) Use a headset
        c. *Thank you cards
                1) Very important
                2) Tangible way to tell someone how much you appreciated things
        d. Recycle Bin:
            i. Can dig stuff out
            ii. Post-its/notepad
            iii. Find a system for yourself
        e. Others
            i. Address Stamper
            ii. Kleenex
    14. Scheduling
        a. You don’t find time for important things, you make it
                1) By not wasting time on other things
                2) Learn to say no
                    a) “I’ll do it if nobody else steps forward”
                    b) “I’ll be your deep fall back," but you have to keep searching.
        b. Find your Most productive times
        c. Find your dead times
        d. *Interruptions
            i. 6-9 minutes, 4-5 minute recovery
            ii. reduce frequency and length of interruptions
            iii. No Email "ding"
        e. Cut things short
            i. Stand up, stroll to the door, complement, thank, shake hands
        f. Time journal
            i. Record your time
            ii. Update not at EOD
        g. Make up fake meeting b/w near by meetings
            i. Go to lib.
    15. Work-life balance
            i. Work fewer hours/get more done
    16. Focus on things that are important
            i. Smoking women concerned about noise of jackhammers on her unborn child
            ii. Effective vs. Efficient
    17. Procrastination
        a.   Quotes
            i. If I wait long enough it will go away
            ii. Parkinson's mail
        b. Make fake deadlines
        c. Get into a comfort zone
            i. Identify why you aren’t enthusiastic
            ii. Don't be afraid to ask people
    18. Delegation
        a. Authority with responsibility
            i. Empower ppl to get it done
            ii. Always do the ugliest/dirtiest job yourself
        b. Can't be vague
            i. Specific thing
            ii. Specific time
            iii. Specific reward/penalty for them
        c. Challenge people
            i. Delegate until people complain
            ii. Email: Get it in writing
            iii. Give objectives not procedures
            iv. Relative importance of tasks
        d. Never too early to delegate
        e. Reinforce behavior you want repeated
    19. Meetings
        a. No black-berries
        b. Agenda
        c. 1 minute minutes: an efficient way to keep track of decisions made in a meeting: who is responsible for what by when?
    20. Technology
        a. Computer's are faster but they take longer
        b. End to end
        c. It must make your life better
        d. New way of doing things
    21. Email Tips
        a. Save all of it/Searchable
        b. If you want something done, only one recipient.
        c. If you really want something done, CC their boss.
        d. Follow up after 48 hours
    22. Communication with Boss
        a. Write things down
        b. When's next meeting
        c. What's the goal
        d. Who to ask for help
        e. They want Results!
    23. General Advice
        a. No vacation if you're connected to work
        b. Kill TV
        c. Convert Money to Time esp if you have children
        d. Eat, sleep and exercise
        e. Never break a promise, but re-negotiate them if need be
        f. If you haven’t got time to do it right, you don’t have time to do it wrong
        g. Recognize that most things are pass/fail.
        h. Feedback loops: ask in confidence
    24. Reading
        a. One minute Manager
        b. 7 Habits
    25. Do it now
        a. Get a day-timer/PDA
        b. TODO list in priority order/Covey 4 quads
        c. Time Journal/Count hours of TV
        d. Revisit the talk in 30 days and ask "What have I changed?"
    26. "Time is the only thing you have and one day you may find that you have less than you imagined".

Since the formatting above is not great, Here are the notes in a one note format:

http://cid-c10db90c8a3e3ef0.skydrive.live.com/self.aspx/.Public/Time%20Management.one

References:

http://en.wikipedia.org/wiki/Randy_Pausch
http://www.cs.virginia.edu/~robins/Randy/RandyPauschTimeManagement2007.pdf
http://www.cs.virginia.edu/~robins/Randy/

Related Posts with Thumbnails