Root cause analysis – 5 Whys

 

5 Whys is a fundamental technique to find the root causes for problems. It was originally introduced and implemented by Sakichi Toyoda at Toyota Corporation

The basic process is keep asking “Why” to find the root cause. In a typical case, it’s almost possible to find the root cause within 5 whys. But it doesn’t mean that we’ve to stop analyzing further if we can’t find the root cause within 5 whys. It all depends on the complexity of the problem we’re handling. Here’s a classic example published in business week

A few years ago National Parks managers noticed the Jefferson Memorial was crumbling at an alarming rate. When they asked why, they found out it was being washed far more often than other memorials. For most organizations, the analysis would stop here. The solution is clear, right? Adjust the cleaning schedule to match those of the other memorials.

But they did not stop there. They kept asking why for each problems.

  1. This monument is deteriorating faster than any other monuments.
  2. Why? – Found that this monument is washed more frequently than other monuments.
  3. Why? – The bird droppings are high
  4. Why? – There are large population of spiders which the birds were feeding
  5. Why? – Increasing of midges in and around the memorial
  6. Why? – Midges are mate in a unique quality light between specific timings.
  7. Why? – (not really about why midges mate) This unique quality of light created by lighting monument before the dusk.

 

They reached the real root cause of the problem and preferred the action to change the light timings a bit late. By changing this schedule they were able to reduce the bird droppings by 90%

What we’ve to infer from this example.

  • In most of the stages explained above looked like dead end and we felt like to choose trivial solutions but they’ve move forwarded further.
  • When we analyze root cause, initially less people will be involved. Participants will increase on exploring more.
  • The root cause can’t be found on single stretch. It may take any long depends on the problem, information available and the people involved in it
  • The root causes can’t solve the entire problem. It may sometimes solve the entire problem but sometimes it may help us to reduce the damage
  • The action we’re taking should be appropriate otherwise it will increase the damage.
  • It’s required to make sure that the root cause was right before investing time and money in it.

But before starting all these we’ve to ask the fundamental question, do we really need to solve this problem? To solve the problem, it required to analyze the severity, priority, cost and resources available.

Once we decide proceed, we can employ Fish Bone diagram or Ishikawa diagram to effectively map the whys. The causes are grouped in the main groups and formed through brain storming sessions. For e.g. in the manufacturing industry basically we can classify the causes under 8M’s.

  • Machine (technology)
  • Method (process)
  • Material (Includes Raw Material, Consumables and Information.)
  • Man Power (physical work)/Mind Power (brain work): Kaizens, Suggestions
    Measurement (Inspection)
  • Milieu/Mother Nature (Environment)
  • Management/Money Power
  • Maintenance

I am not explaining how to create Fishbone diagram, but it’s really powerful enough to map and find the problems root causes. So keep asking “Why” and when it make sense, stop asking “Why” and proceed to fix the problems.

 

How to save Icon as bitmap?

 

Icons are being a bit mysterious comparing to bitmaps. Now how we can save and icon to bitmap. There are several methods to do this. Here’s a simple tweak to save it using memory DC.

void SaveBitmapToFile( BYTE* pBitmapBits, LONG lWidth, LONG lHeight,WORD wBitsPerPixel, LPCTSTR lpszFileName )
{
    BITMAPINFOHEADER bmpInfoHeader = {0};
    // Set the size
    bmpInfoHeader.biSize = sizeof(BITMAPINFOHEADER);
    // Bit count
    bmpInfoHeader.biBitCount = wBitsPerPixel;
    // Use all colors
    bmpInfoHeader.biClrImportant = 0;
    // Use as many colors according to bits per pixel
    bmpInfoHeader.biClrUsed = 0;
    // Store as un Compressed
    bmpInfoHeader.biCompression = BI_RGB;
    // Set the height in pixels
    bmpInfoHeader.biHeight = lHeight;
    // Width of the Image in pixels
    bmpInfoHeader.biWidth = lWidth;
    // Default number of planes
    bmpInfoHeader.biPlanes = 1;
    // Calculate the image size in bytes
    bmpInfoHeader.biSizeImage = lWidth* lHeight * (wBitsPerPixel/8);

    BITMAPFILEHEADER bfh = {0};
    // This value should be values of BM letters i.e 0x4D42
    // 0x4D = M 0×42 = B storing in reverse order to match with endian
    bfh.bfType=0x4D42;
    /* or
    bfh.bfType = ‘B’+(‘M’ << 8);
    // <<8 used to shift ‘M’ to end
    */
    // Offset to the RGBQUAD
    bfh.bfOffBits = sizeof(BITMAPINFOHEADER) + sizeof(BITMAPFILEHEADER);
    // Total size of image including size of headers
    bfh.bfSize = bfh.bfOffBits + bmpInfoHeader.biSizeImage;
    // Create the file in disk to write
    HANDLE hFile = CreateFile( lpszFileName,GENERIC_WRITE, 0,NULL,

                               CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,NULL);

    if( !hFile ) // return if error opening file
    {
        return;
    }

    DWORD dwWritten = 0;
    // Write the File header
    WriteFile( hFile, &bfh, sizeof(bfh), &dwWritten , NULL );
    // Write the bitmap info header
    WriteFile( hFile, &bmpInfoHeader, sizeof(bmpInfoHeader), &dwWritten, NULL );
    // Write the RGB Data
    WriteFile( hFile, pBitmapBits, bmpInfoHeader.biSizeImage, &dwWritten, NULL );
    // Close the file handle
    CloseHandle( hFile );
}

void CLoadIconSampleDlg::OnBnClickedButtonSaveIcon()
{
	// Loading resource from DLL.
	HMODULE h = LoadLibrary( L"myresource.dll" );

	if( !h )
	{
		MessageBox( L"Failed to load library" );
		return;
	}

	INT id = GetDlgItemInt( IDC_EDIT1 );
	m_hLoadedIcon = LoadIcon( (HINSTANCE) h , MAKEINTRESOURCE( id ) );

	CBitmap bmpSave;
	CClientDC dc(this);
	bmpSave.CreateCompatibleBitmap( &dc, 32, 32 );

	CDC dcMem;
	dcMem.CreateCompatibleDC( &dc );
	dcMem.SelectObject( &bmpSave );
	dcMem.DrawIcon( 0, 0, m_hLoadedIcon );

	BITMAP bmpInfo;
	bmpSave.GetBitmap( &bmpInfo );

	int size = bmpInfo.bmHeight* bmpInfo.bmWidth * (bmpInfo.bmBitsPixel / 8 );
	unsigned char* pBytes = new unsigned char[size];
	bmpSave.GetBitmapBits( size, pBytes );
	SaveBitmapToFile( pBytes, 32, 32, bmpInfo.bmBitsPixel, _T( "C:\\temp\\temp.bmp" ));
	delete []pBytes;

	FreeLibrary( h );
}
 

Using Ribbon Editor to design the Ribbon for your application

 

Visual Studio 2010 has integrated the new Ribbon Designer for MFC Applications. Previously I blogged about integrating ribbon with the MFC application and adding even handlers to get the notifications. But the developer must visualize the ribbon while scripting the ribbon code. But using the new Ribbon Designer, we can design ribbons designer, just like the menu designer.


Please check the following links to explore more.
How to integrate a simple ribbon with your MFC Application?
How to handle Ribbon Control Events?
Ribbon designer (MSDN)

 

Proudly powered by WordPress
Theme: Esquire by Matthew Buchanan.