Author Archives: RodStephens

About RodStephens

Rod Stephens is a software consultant and author who has written more than 30 books and 250 magazine articles covering C#, Visual Basic, Visual Basic for Applications, Delphi, and Java.

Draw a scrolling family tree in C#

The example Draw a family tree in C# shows how to draw a family tree. Unfortunately if the tree is too big, you can’t make the form big enough to display it all. One solution would be to use smaller … Continue reading

Posted in algorithms, classes, generic, graphics, OOP | Tagged , , , , , , , , , , , , , , , , , , , , , | 1 Comment

See what processes have a file locked in C#

In older versions of Windows, it was impossible to determine what processes had a file locked. The system kept track of the number of locks on a file and processes were responsible for incrementing and decrementing the count to represent … Continue reading

Posted in files, system | Tagged , , , , , , , , , | 1 Comment

Five hats puzzle solution

If you haven’t read it yet, read the Five hats puzzle. Recall that the warden has three white hats and two black hats. If the first prisoner, Art, saw two black hats, then he would know that he had a … Continue reading

Posted in books, games, puzzles | Tagged , , , , , , , , , , , | Leave a comment

Five hats puzzle

This “hats puzzle” was described on December 26, 2016 on NPR’s Car Talk show. Sadly Tommy died in 2014 and the show was a rebroadcast so this puzzler has probably been used before. My book Interview Puzzles Dissected doesn’t include … Continue reading

Posted in books, games, puzzles | Tagged , , , , , , , , , , | Leave a comment

Draw an interesting pattern of circles in C#

This program simply draws an interesting arrangement of circles. I wrote it because a C# Helper post was mentioned on this Factal [sic] Patterns & Art page. This program uses the following code to draw the circles and connecting lines. … Continue reading

Posted in algorithms, drawings, geometry, graphics, mathematics | Tagged , , , , , , , , , , , , | Leave a comment

Update to “Interview Puzzles Dissected” sample puzzles

I’ve posted another (and probably last) sample puzzle for my book Interview Puzzles Dissected. The examples are in PDF form so they look a lot like they do in the book. Take a look at the samples to get an … Continue reading

Posted in Uncategorized | Leave a comment

Draw outline graphics in C#

This example shows how to outline graphics such as text or other pictures in a Windows Forms application. The idea is to consider the pixels in an image and find those that are a certain distance away from the text. … Continue reading

Posted in algorithms, drawing, graphics | Tagged , , , , , , , , , , , | Leave a comment

Graph currency rates over time in C#

This example, which shows how to graph currency rates for a specific currency, is a bit longish. Sorry about that. It uses Yahoo Query Language (YQL), which you can use to perform a wide variety of queries on Yahoo’s data. … Continue reading

Posted in finance, internet, mathematics, web | Tagged , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Get currency exchange rates in C#

This example shows how you can get currency exchange rates from finance.yahoo.com. When it starts, the program uses the following code to get the currency exchange rates. // Get the currency symbols. private void Form1_Load(object sender, EventArgs e) { string … Continue reading

Posted in finance, internet, mathematics, web | Tagged , , , , , , , , , , , , , , , , , , , | 3 Comments

Get stock prices from different exchanges in C#

The example Get stock prices from the internet in C# shows how to download stock prices from download.finance.yahoo.com. It builds a URL of the following form to get prices for MCI, DIS, COKE, and PEP: http://download.finance.yahoo.com/d/quotes.csv?s=MCI+DIS+COKE+PEP&f=sl1d1t1c1 To get prices from … Continue reading

Posted in finance, internet, mathematics, web | Tagged , , , , , , , , , , , , , | 1 Comment