Almost a Blog

Month: May, 2004

Word Parser in C++

I have been writing a word parser in C++ for a while now and noticed two things that had quite a distinct affect on performance. I was storing the words in a “map” which is a standard associative container. I knew I should have been using a hash_map but unfortunately when writing the parser I had access to a minimal Borland library on a windows box so hash_map was out of the question.
When I got home however and back on the Linux box I had a poke around and discovered “ext/hash_map” which is not officially part of the C++ standard but its widely used and so in my eyes ok.
This change had a marked improvement as the word list grew to just over a few thousand. Having a word list in excess of a few hundred thousand meant that it had a vast improvement in performance.
Another improvement was the way I was reading files into a single string object then parsing the string for its words. I was originally using “getline” and appending the string but this is slow even if you reserve space for the string.
If you are looking for a
faster more elegant way to read a file into a string look no further

Dizzy Spells

Since starting work at the ACU and using a Iiyama AS4636D TFT LCD display I have started to get dizzy spells. I have now had 4 occourances where I lost my balance for about half a second. Three of these times where in front of the screen and one was while walking down the road just after work.
I have been taking regular eys breaks and trying to read up on what might be causing the problem and if its a common complaint but so far I have not found any concrete evidence. I have also tried to fiddle with the settings but unfortunately I am using Linux so I cannot use their test.bmp program to see if I can set the screen up correctly.
Its a shame because the monitor is the dogs danglies but it just dosn’t seem to agree with me.

Text Parser

While on holiday I wrote a simple parser in C++ that will be used to create the word list for the lexicon. It now needs to be tested to see if its fast enough for use. It might just turn out that my C++ is a bit rusty and its a pile of crap. Nonetheless its pretty close to working.
I will post some times etc whenever I get them.

Casa Pablo

If ever you happen to be in Estepona and are looking for a restaurant and not to sure where to go I can recommend “Casa Pablo” which can be found in “Plaza de las Flores” which is a very pretty little square just off the main street.
I had the “House Pate” which come as two large portions and was excellent. I went for the stroganoff steak which was cooked to perfection and tasted as good as it looked. I didn’t see a vegetarian dish on the menu but if you eat fish then you will be fine because there fish was seemed to hit the right spot for two of our party.