Sunday, May 31, 2009

Replacing the liftgate supports on a Hyundai Santa Fe

Last week the “shock absorber” looking things that held up the hatchback door of my Hyundai Santa Fe gave out. Once these things stopped working, the hatchback wouldn't stay open and it took real effort to hold the door up.

After calling around here is what I first found out:

  1. Depending on who you speak to, these shock absorber things are called by various names:
    1. Lift-gate/Tailgate struts
    2. Lift-gate/Tailgate lifters
    3. Lift-gate/Tailgate lift supports
  2. Having these replaced at a Hyundai dealership costs about $225.00
  3. A local garage quoted me $180.00 to replace them.
  4. The cost of one Hyundai OEM lift-gate lift support strut is about $62.50.

It looks like most of the shops quote about 1 hour of labor to replace these liftgate supports. After having figured out how to replace them myself, I found that it will take you all of 60 seconds to replace each liftgate support. Add to that, the fact that you can buy after-market liftgate supports that are exactly like the original for $60.00 for a pair, you can save yourself approximately $100.00.

So here are the instructions:

  1. Order the replacement liftgate supports.
    1. The lift supports I got (after-market) are manufactured by AVM Industries under the brand-name Strong-Arm. They have the model number 6109.
      They have the following specs:
      Extended Length 21.92IN
      Compressed Length 13.92IN
    2. I got mine from Advance Auto Parts, where they are called Lift Supports. (link). They are also available on Amazon.com (StrongArm Lift Supports), Ebay.com (auto), as well as other local auto stores.
    3. Remember to make sure that they fit your car’s make, model and year.
      P5312435
    4. According to the mechanic as well as the packaging, its best to replace these in pairs.
      P5312436
  2. Replacing the lift supports:
    1. You will need a screw-driver, maybe a nose-pliers and one other person to help you.
    2. With even one lift support not working, the liftgate will not stay open. Have the other person hold the liftgate open. They will have to be tall enough to hold the door fully open. In addition, they should be able to hold the door up for at least 3 to 4 minutes.
    3. Don't remove both liftgate supports at the same time! The door is EXTREMELY heavy – I learnt this the hard way (OUCH!)
    4. Remember – the chrome side of the support goes downwards. (shaft down)
    5. Each side of the lift support has a ball socket. The ball joint on the body of the car is held by the socket using a small metallic clip like spring.
      P5312433   P5312434
      A screw-driver inserted between the cylinder body and the spring clip will allow you to pull the old lift-supports away from the body of the car. Do one side and then the other.
    6. Once you have removed the old lift supports, you can put in the new ones. Again use the screw-driver to loosen the spring and allow for easy fitting of the lift supports on to the body’s ball joints.
      IMG_0161 IMG_0163 IMG_0162
    7. Repeat on the other lift-support.
  3. Save $100.00!

Link your Facebook and GMail accounts

Why? – Once you are logged in to GMail you are automatically signed in to Facebook when you access a facebook page.

Other sites that FaceBook supports – MySpace, Yahoo!, Vidoop, MyOpenId, Verisign PIP, etc.

Facebook enables this feature using OpenID.

How?

1. Log in to your GMail account.

2. Go to FaceBook.com

3. Go to your account settings page:

image

4. Click on change for Linked Accounts

image

5. Select an account and click “Link Account”.

image

6. In the window that pops up, make sure that the correct Google account is being used to link to FaceBook.

You are done!

Type in Indian languages in any website – Google Transliteration

In “Send emails in Hindi – Gmail Transliteration”, I had shown you how to enable Google Transliteration so that you could type words phonetically in English and have them automatically converted to an Indian language like Hindi.

Google has now released a set of bookmarklets that enable this feature on any website.

Checkout this Google help doc to find out how to enable it in your browser as well as use it on any website.

Type in Hindi using transliteration bookmarklet

Or, drag the following link onto your bookmarks toolbar and then click on it once to enable it and click on it a 2nd time to disable it.

Here is a screen-cast of me using transliteration to type my status message in Hindi in Facebook.

Design and Manufacturing Process behind the new MacBooks

Even though the whole piece comes off as an ad, it nevertheless gives an interesting insight into the design philosophy at Apple that make products such as the new MacBook and the iPhone so innovative.

Wednesday, May 27, 2009

A Google Spreadsheet to compute approximate monthly mortgage payments

A Google Spreadsheet to compute approximate monthly mortgage payments: http://spreadsheets.google.com/ccc?key=r5PPwE0BkayyM7hKtwNojiQ

Rounding, Mid-points and the U.S. Currency

While working on a credit card processing application, I had the following question:

When it comes to mid-point rounding, what is the standard that should be used in U.S. monetary transactions?

By default, .Net uses the “To Even” standard – where the digit at the rounding position is converted to the next higher even number if it is an odd number. For eg:

3.555 rounded to 2 decimal places = 3.56
3.545 rounded to 2 decimal places = 3.54

But .Net also provides an overloaded Round method, which allows you to specify another method of midpoint rounding – “Away from Zero”. Using away from zero, the above examples result in:

3.555 rounded to 2 decimal places = 3.56
3.545 rounded to 2 decimal places = 3.55

So, for financial transactions which one do you use?

MSDN has this to say about the 2 types of rounding:

  • MidpointRounding.ToEven. If the digit in the decimals position is odd, it is changed to an even digit. Otherwise, it is left unchanged. This behavior follows IEEE Standard 754, section 4. It is sometimes called rounding to nearest, or banker's rounding. It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.

  • MidpointRounding.AwayFromZero. The digit in the decimals position is always rounded up to the next digit. This is the most commonly known rounding method. It is known as symmetric arithmetic rounding.

    It is tempting to use the “To Even” method because it is called “bankers rounding”, but not so fast! A quick Google for Banker’s rounding, turn up the fact that the term banker’s rounding is not a standard (not at least one that is used by the banker type). The only people that seem to use it frequently are the computer type.

    The reason that the “To Even” rounding type is used often is that over a large number of transactions, as it would have rounded some numbers down and other up, the sum of all the rounding shouldn’t be biased in any one direction. But if you used the “Away from zero”, then over a large number of transactions, you would end up with a sum that is biased away from zero (hence the name). This is demonstrated by the following code, which exaggerates the problem by using a number with an even digit in the rounding location (causing ToEven to do nothing, but AwayFromZero rounds up each time).

    static void TestRounding(decimal startNum, int numDecimals, int iter, decimal add)
        {
            decimal currentNum = startNum;
            
            decimal sumTE = 0;
            decimal sumAZ = 0;
            
            for (int i = 0; i < iter; i++)
            {
                sumAZ += Math.Round(currentNum, numDecimals, MidpointRounding.AwayFromZero);
                sumTE += Math.Round(currentNum, numDecimals, MidpointRounding.ToEven);
                currentNum += add;
            }
            Console.WriteLine("Sum using away from zero:" + sumAZ);
            Console.WriteLine("Sum using to even:" + sumTE);
            Console.WriteLine("Difference: " + (sumAZ-sumTE));
        }

    The results of running the code with the following arguments TestRounding(0.045M,2,10000, 1.00M) is:

    Sum using away from zero:49995500.00
    Sum using to even:49995400.00
    Difference: 100.00

    As you can see – in just 10,000 iterations, the difference between the 2 types of rounding got up to a 100. If you had the ability to divert the difference into a personal account – then the choice is not difficult!

    But then, what is the standard?

    For the EU, as seen from the following document “Converting rates and rules”, the standard is to use the “Away from zero” rounding:

    Once the conversion from the national currency has been made, then the euro amount can be rounded up or down to the nearest euro cent: if the number in the third decimal place is less than 5, the second decimal remains unchanged (for example, €1.264 becomes €1.26); but if the third decimal is 5 or above, then the second decimal must be rounded up, for example €1.265 becomes €1.27.

    Article 5
    (pg 27 – COUNCIL REGULATION (EC)No 1103/97 (Introduction of the Euro))

    Monetary amounts to be paid or accounted for when a rounding takes place after a
    conversion into the euro unit pursuant to Article 4 shall be rounded up or down to the
    nearest cent
    . Monetary amounts to be paid or accounted for which are converted into a
    national currency unit shall be rounded up or down to the nearest sub-unit or in the
    absence of a sub-unit to the nearest unit, or according to national law or practice to a
    multiple or fraction of the sub-unit or unit of the national currency unit. If the application of the conversion rate gives a result which is exactly half-way, the sum shall be rounded up.


    The IRS too suggests using the “Away from zero” rounding when it comes to reporting amounts on tax returns (http://www.irs.gov/instructions/i5227/ch01.html & http://www.irs.gov/instructions/i7004/ch01.html):

    Rounding Off to Whole Dollars

    You may round off cents to whole dollars on your return and schedules. If you do round dollars, you must round all amounts. To round, drop amounts under 50 cents and increase amounts from 50 to 99 cents to the next dollar. For example, $1.39 becomes $1 and $2.50 becomes $3.

    If you have to add two or more amounts to figure the amount to enter on a line, include cents when adding the amounts and round off only the total.

    Apart from the above documents, I have not found any other documents that discuss the standard way in which rounding should be implemented in applications that work with monetary values.

    Conclusion:

    So what is the standard – there doesn't seem to be any! But I would use the Away from zero because that is what the EU and IRS seem to be using. Caveat – realize this makes sense only when you are rounding to the nearest sub-unit (cents in the case of dollars). Do not use Away from Zero, if you are rounding up to the nearest whole dollar, unless it makes sense to do so in your case or you have explicit requirements that say that you need to do that.

    running the code sample with the arguments “TestRounding(2.5M,0,10000, 1.00M);” results in a difference of 5000!

    BTW:

    If you are working with values that represent money – remember that doubles can introduce their own set of problems and for the purpose of accuracy you should always use the decimal data type. (read more about this at Quick what is the output of (0.1 + 0.2) == 0.3)

    Other resources:

    .Net Midpoint rounding
    http://msdn.microsoft.com/en-us/library/system.midpointrounding.aspx

    IEEE 754 (Rounding Algorithms)
    http://en.wikipedia.org/wiki/IEEE_754#Rounding_algorithms

    Guidelines for the conversion of past data related to the Euro
    http://www.euro.gov.mt/pdf/guideline_en_02.pdf

  • Tuesday, May 26, 2009

    ASP.Net 3 tier diagram example

    Here is an example of an ASP.Net 3 tier diagram example

    3-thierLayers_2

    Words - Philadelphia lawyer

    Philadelphia lawyer • \fill-uh-DELL-fee-uh-LAW-yer\  • noun
    : a lawyer knowledgeable in the most minute aspects of the law

    Sunday, May 24, 2009

    Managing teams by developing expertise

    A very interesting talk titled “Developing Expertise: Herding Racehorses, Racing Sheep” that discusses managing people on software teams. Most of the information is general enough to be useful to anybody who works in or manages a team.

    The speaker – Dave Thomas - uses the Dreyfus model of skill acquisition, to help explain the different types of people that make up a team. The first 30 minutes is an introduction to the Dreyfus model and explains the 5 levels of people on teams. The 2nd part of talk – talks about how to use the 5 different levels to help manage not just the people on your teams, but also how you interact with them and others outside your team.

    Watch the video of the presentation on InfoQ: Developing Expertise: Herding Racehorses, Racing Sheep

    Some of the interesting slides:

    image

    What hasn't changed over the years in software engineering: bug rates – because software, hardware, etc have improved, but we are the same humans developing the code.

    image

    image

    Know what stage your team members are at. Don't try and use a novice to do the job of an expert and dont make an expert do the job of a novice.

    image

    The above slide shows the distribution of people amongst the various Dreyfus levels. The interesting point that Dave makes about this slide is that there is a high number of people that seem to get stuck in level 2. The surprising thing is that this is true for almost all industries. And the reason that Dave believes this is, that at level 3 and above, the person needs to become more independent and begins taking fewer instructions on how to get the job done. This independence brings with it risk. Most people treat their work as a job and not as a passion. People who do not treat their work as a passion will rarely want to take on risk as all they want to do is to do their job and go home; and for this they want to be told what to do. Another reason that Dave points out is that as this chart applies to all fields of work, even many managers fall into this Dreyfus levels. And it follows from the chart that many managers will also be in level 2, which would mean that they would prefer that people who work under them just fall their orders – which would mean that they would encourage people to stay in level 2.

    Personally, I think software development is such an enjoyable experience that its sad that more people do not treat it as a passion and treat it simply as a job.

    image

    Understand the level at which the person you are working with falls into. Understand what you need for the level you are at for that subject. Use it to force people to treat you as novice when you are a novice and as an expert when you are an expert.

    image

    image image

    Which jobs will get lost (sent off-shore). Jobs that need people that are at level 1 or level 2 – as they need instruction, not expertise.

     image

    What can we do to move up Dreyfus scale?

    Certifications are irrelevant (measures knowledge, not how well you understand it or how you apply it to solve problems). Experience in the traditional sense too does not matter – as that just measures years at work (20 years of experience can mean “1 year of experience, repeated 20 times”).

    What matters is the “Experience Portfolio”, which is all the knowledge, experience, skills and understanding that you have gathered into your toolbox as you have worked through various problems and situations. This is what  moves you from stage 1 novice to a stage 5 expert.

    This is what you can do:

    image image

     

    image image

     Remember: its not your company’s job to train you – IT’S YOURS! (In every other profession – doctors, engineers, etc – have to do keep abreast with the latest changes in their fields and need to know how and when to use the latest advances to do their work)

    Remember – the real question here is “how do you improve”.

    image

    Remember to “Measure your progress” against the Dreyfus scale.

    Useful links:

    Dreyfus model of skill acquisition

    Blog post by Dave on the “Herding horses, racing sheep” presentation - http://pragdave.pragprog.com/pragdave/2004/04/end_of_the_know.html

    Experience Counts! (Wrong!) - http://bit.ly/8dawy

    The Dreyfus model

    Dreyfus-model

    Friday, May 22, 2009

    How I carry my digital SLR lens hood

    Before, I realized I could do this, I rarely ended up using the lens hood on my digital SLR.
    But while I was walking around, I saw a professional photographer who had his hood mounted in reverse on the lens.
    I tried it and it worked. Now I can carry the hood with me all the time and use it more often than I used to previously.
    Below you can see the 2 ways in which the hood has been mounted on to the lens (the first one is the in use position and the 2nd one is the storage position - which you can see makes it easy to store it in your camera bag)

    Denver housing market poised for a rebound

    Came across this video recommended by The Mortgage Design (blog), that talks about the top 5 cities poised to make a recovery in the housing market. Denver is number 1. (aired may 19,2009 on the NBC Today Show)

    Visit msnbc.com for Breaking News, World News, and News about the Economy

    Tuesday, May 19, 2009

    TFS - Unit Test Adapter threw exception: Could not load file or assembly or one of its dependencies

    If you ever get the following error:

    Unit Test Adapter threw exception: Could not load file or assembly “dll module name” or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

    The most probable reason that is causing the error is that your modules are setup to be signed, but because you have enabled code coverage analysis (which adds code to the modules), the signing has been invalidated.

    Here is how to fix it (or this is what I did to fix it - YMMV):

    Under the Test menu of Visual Studio, goto Edit Test Run Configurations | Local Test Run (“testrun name”)

    image

    You have 2 choices: Disable Code Coverage Analysis, or if you keep code coverage analysis enabled, then you need to provide the same key file used to sign your original assemblies as the re-signing key file.

    image

    Scrum – Cheapest Planning Poker Cards

    These are the cheapest planning poker cards that I have come across ($2.50 per deck – which 4 people can use).

    http://store.mountaingoatsoftware.com/products/planning-poker-cards

    image 

    Want it cheaper – print your own:

    http://www.agile-swiss.org/wiki/images/6/6f/PokerPlanningCards1Front.pdf  (page 1)
    http://www.agile-swiss.org/wiki/images/a/ad/PokerPlanningCards2Front.pdf (page 2)

    And here is one more set in PDF format that you can print:

    Page 1
    Page 2

    Want to be eco-friendly? then try this online version: http://www.planningpoker.com/

    Monday, May 18, 2009

    Words - Soiree

    soi·ree 
          Listen to the pronunciation of soiree \swä-ˈrā\

    a party or reception held in the evening

    Beers, Diapers and Dads – DataMining truth or legend?

    If you have ever been associated with field of data-mining or artificial intelligence then you have most probably come across the story of the diapers, dads and beers.

    The story goes so:

    In a certain state, in a certain store, that kept all records of transactions it was found that there was a high correlation between the purchasing of beers and diapers. It was also found that the people purchasing the diapers and beers together, tended to be men. It was postulated that:

    • diaper purchases were left to the men, because of the enormity of the package sizes
    • Men, being men, automatically gravitate to the beer aisle

    As a result of the above correlation, which was extracted using data-mining, the store moved the aisles of diapers closer to the beer aisle. Sales of diapers and beers sky-rocketed.

    But is the above story an urban software legend or is there truth behind it?

    It looks like it is partly both. According to this story in the Forbes magazine, the story had its origins in truth:

    Where did this tale start? It appears to have come from one Thomas Blischok, now chief executive of Decisioneering Group in Scottsdale, Ariz. As vice president of industry consulting for NCR, he was doing a study for American Stores' Osco Drugs in 1992 when he discovered dozens of correlations, including one connecting beer and diapers in
    transactions between 5 p.m. and 7 p.m. Blischok recounted the tale in a speech, and it became the stuff of consultants' pitches, trade magazine articles and the ad shown above. But did Osco rearrange its beer or diaper shelves as a result? Nope.
    Birth of a Leged – Forbes.com

    The Diaper-Beer Syndrome: http://www.forbes.com/forbes/1998/0406/6107128a.html

    I do the work for free….

    I do the work for free, I get paid to be afraid. – GapingVoid.com

    afraid0901

    Sunday, May 17, 2009

    Sequence Diagrams – the best tool for creating them

    I have been using Visio to create my Sequence Diagrams and the problems with Visio are plenty:

    1. It doesnt have many constructs (eg: loops, conditions, etc).
    2. Its a pain to draw, as you have to remain cognizant of how the overall diagram looks. This typically involves, resizing the page, moving around objects and changing spacing.
    3. If you realize that you missed something, then you have to spend time repositioning objects so as to insert what you missed.

    Today I came across a really cool tool that allows you to describe the activity and automatically generates the Sequence diagram. To me this is a lot more powerful, because it lets you concentrate on correctly describing the sequence of activities and the diagramming is left to the algorithms at WebSequenceDiagrams. From my initial testing – I love Web Sequence Diagrams. If you are a software engineer, you definitely need to give it a try.

    Here is a simple example:

    The sequence diagram is based on the example on the Agile Modeling website: http://www.agilemodeling.com/artifacts/sequenceDiagram.htm

    I converted figure 3 on that page to the following description:

    Student->Seminar:enrollStudent 
    activate Seminar 
    Seminar->Course:isStudentEligible 
    activate Course 
    Course->Student:getSeminarHistory 
    Student-->Course:seminarHistory 
    Course-->Seminar:eligibiltyStatus 
    deactivate Course 
    Seminar-->Student:enrollmentStatus 
    deactivate 
    Seminar Student->Student:updateRecords

    image

    With a simple Combo box selection you can easily change the sequence diagram format to a variety of other ones:

    Of which the Napkin format is one of my favorite:

    image

    Check out the web-based Sequence Diagramming tool at http://www.websequencediagrams.com/

    Cool Quotes – Free Speech by Justice Douglas

    "Free speech, may indeed best serve its high purpose when it induces a condition of unrest, creates dissatisfaction with conditions as they are or even stirs people to anger." - Justice Douglas

    The above quote by Justice Douglas came from the case Terminiello v. City of Chicago (1949)

    Another of his interesting quotes:

    "Inanimate objects are sometimes parties in litigation. A ship has a legal personality, a fiction found useful for maritime purposes. The corporation sole - a creature of ecclesiastical law - is an acceptable adversary and large fortunes ride on its cases.... So it should be as respects valleys, alpine meadows, rivers, lakes, estuaries, beaches, ridges, groves of trees, swampland, or even air that feels the destructive pressures of modern technology and modern life. The river, for example, is the living symbol of all the life it sustains or nourishes - fish, aquatic insects, water ouzels, otter, fisher, deer, elk, bear, and all other animals, including man, who are dependent on it or who enjoy it for its sight, its sound, or its life. The river as plaintiff speaks for the ecological unit of life that is part of it."

    Sierra Club v. Morton

    http://en.wikipedia.org/wiki/William_O._Douglas

    I came across his free speech quote in this article in the New York Times: Images, the Law and War.

    Saturday, May 16, 2009

    Serpinski algorithm animated demo

    I created a windows application to learn about the Serpinski algorithm. Here is a recording of the algorithm in operation.

    Wednesday, May 13, 2009

    Sequence diagram elements

    The following were taken from Sparx

    Sequence Diagram Elements

    Sequence Diagram Connectors

    image 

    image

    image 

    image

    image

    image

    image

    image

    image 

     

    image

     

    image 

     

    image 

     

    image 

     

    And here is an example from http://www.agilemodeling.com/artifacts/sequenceDiagram.htm: