Monthly Archives: November 2016

Sample Puzzles for Interview Puzzles Dissected

Here are some sample puzzles (in PDF format) from my book Interview Puzzles Dissected. Three Birds – Calculate the total number of miles three birds fly while zigzagging between each other during a trip from New York to Philadelphia. We … Continue reading

Posted in books, games, miscellany, puzzles | Tagged , , , , , , , , , , , , , | 1 Comment

Convert doc files into docx files in C#

This example shows how to write a C# program to automatically convert doc files into docx files. In a previous version of Windows, whenever I double-clicked a .doc file, I got this error message: Error The operating system is not … Continue reading

Posted in Office, Word | Tagged , , , , , , , , , , , , | Leave a comment

Override WndProc to see when the user clicks any control on a form in C#

A form’s WndProc method processes messages sent to the form by the Windows operating system. This is an extremely important method that allows forms to move, resize, repaint, and perform other critical operations. While you normally don’t need to change … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , | Leave a comment

Save and restore line drawings in C#

The example Draw and move line segments in C# shows how to build a simple line editor. This example adds the ability to save and restore drawings. The first step is to save all of the drawing information in a … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , , , , , , , , , , , , , , , | 7 Comments

Center the cursor over a particular control in C#

Some programs move the mouse to center the cursor over a particular control to make some sort of selection easier. For example, it might move the mouse over a dialog’s OK button. Personally I find that annoying as a user, … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , , , | Leave a comment

Take actions depending on the day of the week in C#

When the program starts, it uses the following code to display a different message in two different ways for each day of the week. // Display a message that depends on the day of the week. private void Form1_Load(object sender, … Continue reading

Posted in variables | Tagged , , , , , , , | Leave a comment

Find the Friday following a given date in C#

This example shows how you can find the Friday following a particular date. You can use a similar method to find other days of the week following a specific date. (Note that I have updated this example from its original … Continue reading

Posted in variables | Tagged , , , , , , , , , , , | 2 Comments

Create a directory and intermediate directories in C#

The System.IO.Directory class’s CreateDirectory method creates a directory. If the directory’s path includes missing intermediate directories, it creates them, too. For example, if C:\DirA is empty and you use CreateDirectory to create C:\DirA\DirB\DirC, then the method automatically creates DirB as … Continue reading

Posted in directories | Tagged , , , , , , , , , | 1 Comment

Book Errata Page: Interview Puzzles Dissected

This is the errata page for my book Interview Puzzles Dissected, Solving and Understanding Interview Puzzles. If you find mistakes, please post them here in the Leave a Reply box at the bottom of the page. If you have questions, … Continue reading

Posted in books, games, miscellany, puzzles | Tagged , , , , , , , , , , , , , | 1 Comment

Table of Contents: Interview Puzzles Dissected

This is a brief summary of the book’s table of contents. Introduction Explains some background, how to use interview puzzles to get useful information, and conventions used in the book. Chapter 1: Basic Background Provides some background and general tips … Continue reading

Posted in books, games, miscellany | Tagged , , , , , , , , , , , , | 2 Comments