July 28, 2015: A fellow Delphian recently asked if it was possible to highlight a particular word wherever it occurred in a DBGrid. I gave him some suggestions but didn't hear, back so I decided to try it for myself. I used a StringGrid to create a demo in our Delphi Techniques section which should transfer to DBGrids. As usual (and thankfully), there were a few unexpected complications to sharpen problem solving skills and keep programming fun. Check out the GridWordHighlight page for more information and downloading the code.
July 17, 2015: A couple of years ago I posted a bulk Find and Replace program which would scan text files in a given folder which match given file name mask and change all occurrences of a given string to a new replacement string. I recently needed to process a set of files of email addresses and replace all "@" characters with commas (",") so that Excel could automatically break out the website address parts into a separate column. The files happened to be in Unicode character format (2 bytes per character) which my program didn't handle correctly. Find and Replace Version 2 posted today corrects that. Both ANSI and Unicode character files can now be processed correctly.
July 8, 2015:
Chess PGN (Portable Game Notation) is a widely used format for recording chess
games for historical or study purposes. There are many playback
programs available and the world didn't need another. However a DFF
viewer requested it about 10 years ago and I couldn't locate an existing one in Delphi, and
it sounded like (and was) an interesting project.
Chess PGN Version 5,2 posted today has a
small change which doesn't change the executable results but prevents aborted
execution after recompiling with data range checking.
June 29, 2015: Acrostic Variation,
posted today, implements a solver for this Mensa® calendar
puzzle from March 16, 2015. It uses a search technique probably used by
most human solvers; concentrating on the word intersections to find candidates;
the program just does it a lot fasterJ.
June 17, 2015: A License Key Generator program was posted several months ago to explore how unique keys might be generated to allow a program to verify owner or expiration date information. To my surprise, the program was recently flagged as a "Keygen Trojan" by a well respected security scanner. I revisited the source code and made a few formatting and spelling enhancements and the warning disappeared. So, just in case, I reposted the License Key Generator V1.1 program today.
June 10, 2015: A program illustrating many graphic
manipulation effects in Delphi was posted 12 years ago. It was largely
written by a young Czech programmer, Ivan Sivak, who I'm sure has moved on to
bigger and better things by now. I made only minor changes to his code
before posting it. A fix was posted today in the Contrast/Brightness
section of Graphic
Effects correcting a problem of white or light gray pixels displaying as
May 31, 2015: Just time to squeeze in one more little program this month. Outdoor activities have taken up most of my time recently and most of the daily Mensa Calendar puzzles are either solvable by programs I've already written or are not amenable to being solved by computer. But yesterday's offering was a good candidate so here it is:
A surprising number of U.S. state names contain multiple pairs of letters which form standard two-letter state abbreviations. For example ALABAMA contains two: AL and MA (Alabama and Massachusetts). If we don't allow overlapping abbreviations, there is only one state name that contains as many as four abbreviations. Can you find it?
State Abbreviations is a 50 line program which finds the answer
by listing and counting the embedded abbreviations for all 50 states. The
preceding link is to a page of twenty or so Beginner's level programs.
Just click the bookmark or scroll to the bottom of that page to download the
source or executable for the new program.
May 11, 2015: A viewer discovered a memory leak in our Big Integers unit which carried over to the Big Float unit. UBigIntsV4 allows mathematical operations on integers whose size is only limited by available memory and UBigFloatV4 extends the extended precision feature to floating point numbers using UBigIntsForFloatV4 for the integer parts. The Free method in both of the big integers unit released the memory specifically allocated by the program but neglected to call the inherited Free method which releases the memory taken by the system when the integer object was created. Today's' postings include a revised library zip file, DFFLibV4_11May2015 containing the revised units. Two test programs, BigIntsTest and BigFloatTest were modified to report allocated memory after each operation to verify the correction and to help indentify future memory release problems.
April 29, 2015: Three points are placed randomly on the circumference of a circle. What is the probability that all three points lie within same semicircle? Check out Circular Reasoning to verify your answer.
April 19, 2015:
A buddy of mine is designing a Veteran's Day monument which will consist of
panels representing the Armed Forces services and aligned in such a way that the
sun will cast a shadow on the memorial plaque on November 11 at 11:AM. At
his location, he thought that the sun would cast the shadow again in February
when the the sun will be at the same altitude at that hour. I took
advantage of the opportunity to educate him about the "analemma" figure 8
shape of the sun's path through the sky and assure him that the February sun at
11 AM will be about 10 degrees further East than the November path. I
updated AstroDemo Version 2.0, our
Astronomy unit test program, with an "animated" analemma. That option helped me
determine that at 11:11 AM in Lucedale, MS, the crossing point of the figure 8
occurs on February 12 as days are getting longer and August 29 on the way back
down, so no problem for Jim's project!
April 13, 2015: Here's an interesting little puzzle that requires some human thought to solve efficiently:
A farmer tells his son to select five watermelons to take to market. Because the watermelons are sold by weight, they must be put on a scale before the trip to town, but the son makes a small mistake and weighs them in pairs. Here are the weights he comes up with, in pounds: 20, 22, ,23, 24, 25, 26, 27, 28, 30, 31. How much does each of the watermelons weigh? (Source: Sit & Solve® Brainteasers (Sit & Solve® Series)
The Weighing Watermelons program posted today implements the solving strategy.
March 15, 2015:
Another calendar puzzle that is well suited to using the computer as a helper.
The two pieces required to solve Mind Your Ps and Qs will not only be mirror imaged (flipped about their vertical axes), but also reversed to top bottom (flipped about their horizontal axes). Interestingly, and perhaps a clue to help solving these puzzles, these two flips are equivalent to a 180° rotation.
Rather drawing heavy outlines, the two pieces are defined on the program by
assigning a color to each of the two letters and assigning colors to other grid
cells by clicking.
March 8, 2015: Windows makes it's time zone information
available to programs in a "TimeZoneInformation" record. Several years ago
I wrote a program to illustrate how to access this information in Delphi,
the namesake programming language for this site.
2 corrects the Daylight Saving time start and end date displays from that
record which requires an undocumented "trick" to display correctly.
The system "Day of Month" value in these fields does not contain day of month
but rather acts as a template defining which occurrence of the "Day of Week"
value defines Daylight Savings starts and ends (1st Sunday, 3rd Wednesday, etc).
The supplied values are now converted to the correct "Day of Month" in the
March 3, 2015:
This puzzle type requires the player to find the word for the missing row of
a 3-row grid such that every column is a valid 3-letter word.
WordGrid_3LetterWords Version 2.0
posted today reflects changes required to solve the 7 column Mensa
Calendar puzzle for February 13, 2015 (shown at right). As usual when I
revisit a program, a couple of additional enhancements are included.
The What's New Archives
(Click to expand)
July 7, 2014: Note: this "Collapsible" month by month list of postings since year 2000 is not collapsing for some reason, making this a very large home page. Until it gets fixed, you can reference the complete quarter by quarter list of postings on the Newsletter page.
Copyright © 2000-2015 , Gary Darby
All rights reserved.