Tuesday, June 01, 2010

Sudoku rEvolution

A couple of years ago, I posted about a pet project of mine - my Sudoku Solver program. Over the years, I have continued to tweak it and I am pleased to say that it is evolving nicely.

In my previous post, I showed the results of solving a "Super Difficult" Sudoku puzzle from Carol Vorderman's "How To Do Sudoku" book using my Sudoku2 program. This puzzle required 496 recursions to solve and was solved in 228 milliseconds on my old Pentium D 3Ghz machine.

Well, computers have evolved. The same "Super Difficult" puzzle, using the same Sudoku2 program, was solved in just 156 milliseconds on a single core Windows 7 virtual machine with 1.5GB RAM, hosted on my Macbook Pro 2.4Ghz i5 machine. Not bad!

 Sudoku2 - SOLVED after 496 recursions in 156 milliseconds

 239 485 167
 751 396 284
 846 721 593

 628 173 945
 913 542 876
 475 869 321

 187 254 639
 364 918 752
 592 637 418

My latest version, Sudoku3, makes use of the same recursive, backtracking algorithm as its predecessor, but I have used Lambda expressions to dramatically simplify the code. I also implemented an optimisation to cache row, group and column assignments for cells and changed the algorithm to reduce the number of recursions. These changes have resulted in simpler code and significant performance improvements. Sudoku3 solves the "Super Difficult" puzzle in just 94 milliseconds on the same virtual machine. I am really stoked with these results!


 Sudoku3 - SOLVED after 248 recursions in 94 milliseconds

 239 485 167
 751 396 284
 846 721 593

 628 173 945
 913 542 876
 475 869 321

 187 254 639
 364 918 752
 592 637 418

I have uploaded the code for Sudoku3 to MediaFire for those who are interested.

In future, I plan to make use of threading to see if I can further improve performance by modifying the code to run parallel solution attempts on different processors. This is more tricky than it sounds. My first attempt showed that the thread management overhead resulted in a performance degradation.

I am going to try the new the new .NET Framework 4 parallel programming features and Reactive Extensions to see whether I can harness the power of parallel processing and make it faster. Watch this space...

Monday, May 24, 2010

Working with Equitel in Bogota

Last month there were several press announcements about the partnership between MiX Telematics and Equitel. Myself and three of my colleagues from MiX Telematics have had the pleasure of working with Equitel for the last week and what a pleasure it has been!

Russell Simmonds (Team Leader, MiX Telematics) & Ricardo Correa Pulido (Development Director, Equitel) in front of the Equitel building in Bogota.

I must admit that I was somewhat apprehensive about travelling to Bogota, Colombia as it is a city that has received much bad press in the past. I am pleased to say that my concerns have been completely allayed. Apparently Colombia fell victim to a high crime rate in the past due largely to corrupt law enforcement officials. A strict national security policy and eradication of corruption has turned this around and Bogota is a city alive with construction and other development activity.

Bogota is a great city and Columbia a beautiful country! The people are friendly and helpful and have a real zest for life. Like every city, there are areas to be avoided, but we have not felt unsafe at any time during our visit. We spent the day walking around an area in the North East of the city today and thoroughly enjoyed ourselves despite getting drenched in a downpour on the way back.

The team from Equitel are extremely professional and it is truly a pleasure working with them. We have found communication easy despite the language barrier. Most of the people at Equitel speak English very well. It is exciting to participate in this integration project and we are very enthusiastic about what will arise from our partnership.

Juan, the head of Equitel, and his team have been outstanding hosts! In all my travels, I have never experienced such excellent hospitality. They have given us a taste of Colombia and we are totally hooked. We have had the privilege of visiting several fine establishments and places of interest and built relationships that will last a lifetime. I will always remember Bogota for it's vibey music.

I am grateful for the opportunity to be a part of this great venture. It will be with fond memories that I bid farewell to our colleagues from Equitel when we leave on Wednesday. I look forward to my next visit to Colombia with great anticipation.

A panoramic view of Bogota with the Andes mountain range in the background.

Dusting off Wayne's Spot

I think the time has come to dust off this old blog of mine. It's been a while since I posted anything and I plan to pick up the pen again so to speak. Watch this space...

Friday, December 05, 2008

Breakthrough

Looking in through tear-stained aching eyes,
Swirling threads of choking pain engulf the one I love.
The ever-tightening, overwhelming web keeps closing in.
Helplessly I cling to the One who shares our pain.

Faith the shield that quenches fiery darts,
Too small it seems to raise us from the depths.
In quiet desperation I call upon His precious name.
I wrestle with all my might to leave it with Him.

Building up, the wave intensifies,
Dark blue turns to deepest, blackest night.
Every fiber of my being stretched in burning anguish,
Breathing hurts too much and tears run dry.

When will You reach out and hold her hand?
Will You fill the gulf that can’t be crossed?
You speak of purifying fire that will burn up every thread.
I trust in You alone my God and King.

Wednesday, September 10, 2008

In loving memory of Gag

G and James

Hey G,

I can't believe you've been gone a year. It feels like yesterday that we were enjoying those lovely low clouds on a cold winter's morning. I miss you now more than ever! I'll never stop missing you my boet!

I miss flying with you so much! I really miss your smile! I miss your enthusiasm, your zest for life and your handshake! The world is not as bright since you left but you left us with memories that will never fade. I am so grateful for all the awesome times we had together.

I love you and I'm looking forward to seeing you again some day. Have a ball up there and enjoy the flying!

Lots of love,
Your big boet.

Thursday, November 22, 2007

Fun at Keisie

We had a great weekend riding our bikes on a beautiful farm in Keisie Valley near Montague this weekend. The terrain is absolutely fantastic with great riding for all tastes. GraZer organised the trip for us after thoroughly enjoying the regional enduro event which took place there earlier this year.

I managed to drop my bike on a rocky section and smash my odo on the first day. Francois had a nasty fall in the same spot the following day. Charles got a puncture and little Jonathan almost passed out from heat exhaustion and dehydration at one point. But despite all that, we had a ball!

GraZer was an outstanding host as always and patiently led us all through a variety of terrain ranging from easy to eish! The man is a machine! I don't know where he gets the energy from. The family rode like champions and thoroughly enjoyed themselves.

This was taken on top of a koppie on the farm. There is an awesome 360 degree panoramic view from the top of it. We were so proud of Reece for making it to the top! It was the steepest hill climb he's ever done on his little bike.

Keisie

GraZer managed to pack all our bikes into the braai lapa at night. The sun shining on the bikes in the morning reminded me of a bike shop showroom window.

Bike Shop

We're hoping to go back again in January. It was really excellent fun!

Monday, November 05, 2007

It hurts!

Since Gareth died, I just haven't had anything to write about. Things I used to enjoy (like blogging) just seem so irrelevant now.

I have always sympathised with people who have lost a loved one but I never imagined how difficult it would be to bear the tremendous grief that comes with the sudden, unexpected loss of a brother in the prime of his life.

This grief is like an unbearable weight that never seems to lift. It comes in waves. Its effects are profound. There are good days and bad days. Life goes on but it will never be the same again. The world somehow seems just a little bit darker.

I know Gareth is having a ball! He is with his Lord and Saviour, Jesus Christ. He is rejoicing, reunited with Laddie, Nana and all the others who went before him. I know that we will meet again when my time comes, but I miss him so much! I am so grateful for the wonderful memories. Memories which I will treasure forever.

Tuesday, September 25, 2007

To G

To G

Gareth Davies, my precious brother.
15 July 1973 to 10 September 2007.

Your radiant smile will never fade.
You were a gift sent from above.
You visited us for just a while.
You filled our lives with joy and love.

You lived your dream and gave your all.
You loved with love that will not die.
You lived each moment to the full.
Your gift you used, taught us to fly.

We find it hard to understand,
Why you had to go away.
We say farewell and not goodbye.
We’ll be with you again someday.

We thank the Lord for sharing you.
Our loss we know is just your gain.
You’re living out your dream with Him.
So long until we meet again.

Sunday, August 26, 2007

PicooZ

A while ago, a friend of mine brought a tiny remote controlled helicopter called a PiccoZ to the office. I was really impressed with it and hoped that I would one day be able to get one. I searched online and found that they were quite reasonably priced, but the shipping costs, which would have been more than the cost of the helicopter, made it too expensive.

We were in Toys 'R Us on Saturday shopping for a birthday gift when to my delight, I found that they have them in stock. I bought one and have had great fun flying it in the house over the weekend. It is quite easy to fly and I'm hoping to teach the boys to fly it.

Here is a picture of it flying in our lounge. Great fun on a rainy day!

Saturday, August 18, 2007

Flickr Toys

Framed

This is probably old news for Flickr veterans, but I thought I would share it for the benefit of other Flickr newbies.

There are some really neat free tools available on the Big Huge Labs web site. These tools enable you to create calendars, posters, cool photo widgets and a whole host of other fun things using your Flickr photos. The example above was created using the "Framer" tool, and the one below using the "Hockneyizer" tool.

Yellow and green

Tuesday, August 07, 2007

Ode to the Thunderbird

In the clouds

There is no freedom to be found,
Like that I find in clear blue skies,
Rising up above the clouds,
Soaring where the eagle flies.

Crosswinds

There is no thrill like that I feel,
Turning tight and flying low,
Seeing things that can't be seen,
Going where men cannot go.

Air to air

There's nothing that relaxes more,
Than floating on a gentle breeze,
Trees and mountains dwarfed below,
Flying high with graceful ease.

Silhouette

Oh Thunderbird you set me free,
You liberate my weary soul,
I dream of flying you once more,
When the world around me takes its toll.

Sunset cruise

Saturday, August 04, 2007

Quicksand

We took advantage of the great weather today and went riding our bikes. I took James for a ride on Dump's bike and what looked like hard pack turned out to be quicksand.

Oh bother!

It took six of us to pull her out using a rope. That quicksand really sucks (literally)!

Quicksand

Tuesday, July 24, 2007

Prepare to be amAzed!

Over the weekend I discovered free navigation software for mobile phones called amAze. I have been using it for a few days and I must admit, I am really impressed - or should I say amAzed! I can highly recommend it.

The great thing about amAze is that it is written in Java 2 Mobile Edition and therefore works on most modern mobile phones. You don't have to have a phone with an integrated GPS like the N95 to use it. It works brilliantly with a Bluetooth GPS receiver connected to your phone. Two of my friends have installed it on an N70 and N73 and are using it with Bluetooth GPS receivers with excellent results. The amAze site lists phones which have been verified to work with the software and many phones from most major vendors are included.

Even if you don't have a Bluetooth GPS, I'd still say it's worth having as the maps and address search feature are useful even without the turn-by-turn navigation.

The address search is very easy to use and works well:




During navigation you can switch seamlessly between the map view and the arrow view. I have found that the voice prompts are very good and I don't even need to look at the screen.



Here is a Flash video clip from the amAze site which gives an impression of how it works (you need sound to hear the voice prompts).



I was planning to one day purchase a Nokia navigation license for my N95, but now that I have amAze on my phone, I will be able to put the money to better use. It's not quite a Garmin but hey, it's free, and I always have it with me!

Friday, July 20, 2007

Flying N95

I have tried out the Sports Tracker software on my N95 to log trips in my car and it worked brilliantly (I'm not into running or cycling - I try to avoid any exercise that involves less than 10 horse power).

I planned to give Sports Tracker a try on my off-road motorcycle by placing my N95 in the pocket of my hydration pack, but before I got a chance to do that, a more interesting opportunity arose...

Whilst on holiday in Jo'burg, I decided to try it out in my brother Gareth's model aeroplane. He has a Funtana S40 3D aerobatic radio controlled aircraft.
 
I created an activity named "Flying" in Sports Tracker with the settings I required and got it up and running, ensuring that the GPS had lock. I set the phone to use the "Offline" profile to avoid unwanted RF interference.
 
Next we placed the phone in a bubble-wrap envelope inside the fuselage of the aircraft. Unfortunately I had to close the phone's slide due to space constraints.
 
Then we closed her up carefully. I threatened Gareth with his life fearing the potential demise of my beloved N95 (when a radio controlled aircraft crashes, there is usually nothing but toothpicks left over). He gave me the usual "There are no guarantees" speech.
 
Finally Gareth took her for a hair raising, high speed, high G flight. When he landed after about 15 minutes of redical manoeuvres, I said a prayer of thanks that my phone had made it unscathed and we eagerly opened her up to review the results.
 
Sadly, Sports Tracker only recorded the first minute or so of flying. I think the GPS lost lock during the first aerobatic manoeuvre and was unable to re-acquire it because of the high speed and rapid acceleration. Having the phone's slide closed probably also inhibited the GPS's performance.
BUT we still managed to get just under 1km of track recorded and clocked the Funtana at 120km/h straight and level (about 840km/h scale speed) - not bad. We wanted to give it another go but ran out of time. Perhaps some other time...

Boys and their toys - all in the spirit of fun I say!

Monday, July 02, 2007

New firmware for N95

I have read several posts about the new N95 firmware which was released by Nokia in May. All of the articles I read spoke of the cool new features and improvements included in the new release and I couldn't wait to get my grubby little mitts on it.

Like a good compliant user, I faithfully tried to upgrade my phone using the Nokia Phone Updater software once or twice a week for the last four weeks or so. Each time I was disappointed by a message saying that there is no new version available for my phone.

Just as I was starting to get really frustrated, I stumbled upon this great post on Simply Symbian over the weekend. Following these instructions, I successfully changed my phone's product code using the Nemisis Service Suite so that the Nokia Phone Updater believes it is a European model. I was then able to download the new firmware and upgrade the phone successfully. Yeehaa!

The new firmware is awesome! My GPS now acquires lock in seconds thanks to the new Assisted GPS feature. The phone's UI is much more responsive too.

I guess Nokia will eventually get to releasing the new firmware in this region, but if you're like me and just can't wait for them to decide when we Africans need access to their latest technology, give this a go.

Saturday, June 30, 2007

Book of faces

I first heard of Facebook aeons ago but never bothered taking a look. Then suddenly, a few weeks ago, there was huge hype about South Africans on Facebook in the press. There was mention of it on the KFM breakfast show and then Eishman, author of a blog I read regularly posted about it. I decided I should take a look.

At first I struggled to find anyone I know. The methods provided for finding friends are pretty lame. None of the schools I went to showed up in the search list. Neither did the companies I have worked for.

One of the expectations I have of this kind of site, is to be able to link up with long lost buddies whose e-mail addresses I don't have. I don't know why they don't just provide a facility to search for friends by name like other sites do. That would be the simplest and no harm could come of it as people have to confirm they are interested in linking up with you before you can interact with them.

The only way I eventually found a friend of mine was when I went to invite him to join Facebook. I happened to enter the same e-mail address he used to register on Facebook (an unlikely coincidence as he, like most of us, has several e-mail aliases) and then it told me that he was already a member.

Once I had found one friend, I was quickly able to find some others through his profile. To my surprise, it seems that half of the company I work for are Facebook addicts. I wonder why my company name search never yielded any results?

After playing with Facebook for a few weeks, I have concluded that it is a clever web site with some great ideas, but that is all there is to it. I don't think it's going to change the world and I certainly don't see what all the hype is about.

I heard from a network admin at the office that over 2GB of bandwidth went to Facebook this month. No, it wasn't me and yes, I guess it won't be long before it gets added to the blocked sites list.

Saturday, June 23, 2007

Mobile codes

I discovered a neat technology on the Nokia web site called Mobile Codes. Nokia have included barcode scanning software on the N95 and other S60 devices facilitating scanning of 2D barcodes using the built-in camera.

2D barcodes can carry much more data than old fashioned 1D codes so there are loads of possibilities for this technology. For example, it would be possible to print a 2D barcode containing your contact details on the back of your business card. Contacts could then scan your business card directly into their phone's address book. Pretty cool!

I think I could use this technology to scan a Sudoku puzzle into the N95 and then have the N95 solve it as suggested by Craniac in response to my post entitled Sudoku Success.

Here is a 2D barcode containing this site's URL:

Wayne's Spot

These are screenshots of my N95 reading it off my computer's screen. After the phone has read the URL, clicking on it opens the phone's web browser and navigates to it.

Barcode Reader URL after scanning

The Blind

The BlindStretched beyond the limit
Straining, pressing in
Looking but not seeing
Reeling deep within

Tighter than a drum
Icy steel-cold mind
Heart of stone not flesh
This side of the blind

Prison bars still choking
Walls where doors have been
Radiant light once reaching
Too far to be seen

Tender hearts are aching
Solutions hard to find
Hear the cries for answers
From within the blind

Monday, June 18, 2007

What is a Dad?

Jusin and Daniel speaking on what Dads are all about...

Saturday, June 16, 2007

Father's Day

It's Father's Day tomorrow! Time to wax soppy...

Dad, what can I say? You played such a big roll in moulding and shaping me throughout my life. Words can't describe how grateful I am for all your input and endless encouragement. Your unwavering grasp of what's right and what's not has always been an inspiration to me. Thanks for eveything you've done for me. I love you!

Dad

Wow, what a blessing it is to be a father! I am so grateful for my four precious sons. They are such amazing gifts. Guys, I love you too. You are the little lights of my life.

My beautiful boys