Posts

Showing posts from September, 2013

Using Boost regular expressions as word finders

A sample demonstration of using the Boost libraries as a means of finding matching words in a large array table, that match the given lookup criteria. Suppose you are wrestling with a cryptic crossword and want to find all seven-letter words whose third letter is 'Y' and fifth letter is 'N', or better still, run a program that will find these words for you. The Boost regex_match algorithm can be easily used to determine whether a given regular expression matches all of a given character sequence, in the steps described as follows: 1. Define the regular expression In my simple example, I would like to find out all (case insensitive) words with seven characters and with third letter 'Y' / fifth letter 'N', so I define a boost::regex to do this: [code language="cpp"] static const boost::regex ex("..y.n.."); [/code] 2. Read the text file into a std::string There seem to be a plethora of dictionaries and word lists a...

When the NetBeans IDE cannot start a new project

Image
Some hints and tips on how to overcome an annoying little gotcha that causes the Linux-based NetBeans IDE to freeze when trying to create a new project: Instead of presenting the user with the options for creating a new project as shown in the screenshot below, the screen remains stuck with the egg timer, and does not allow the user to proceed: