Archive for March, 2016

‘eregi’ is deprecated errors

The other weekend I was setting up Plogger for my daughter to share her photos. She’s been really getting in to photography and I think she’s really getting good at it. If you’re interested (and she starts uploading stuff and takes down the pics I posted) you can check it out here: lexie.fourthwoods.com

Anyway, apparently I’m running a newer PHP than Plogger was originally written for because I got a bunch of errors along the lines of:

Deprecated: Function eregi() is deprecated in blah....

It seems the whole class of functions have been deprecated in PHP 5.3.0. Fortunately there is an easy fix. For instance:

eregi("NIKON", $make)

should be changed to:

preg_match('/NIKON/i',$make)

Note the regular expression is wrapped in ‘/’ characters which denote the pattern to search. after the last ‘/’ is the ‘i’ modifier flag which indicates case insensitive which is what eregi does.

Other functions that can be replaced similarly are:

ereg()          // replace with preg_match()

ereg_replace()  // replace with preg_replace()

eregi()         // replace with preg_match() with the 'i'
                // modifier

eregi_replace() // replace with preg_replace() with the
                // 'i' modifier
Thursday, March 31st, 2016 PHP, Programming No Comments

Sudoku Forever

I’ve taken the Sudoku JavaScript game I created and ported it to an app for Android. Sudoku Forever is based on the same Sudoku solver described in my JavaScript article but with a few more improvements and optimizations. It is very fast consistently generating a new board between 200 and 500 milliseconds.

Here’s a screenshot:
Sudoku Forever Screenshot

Sudoku Forever also features the ability to save the current game state whenever you close the app as well as Save Game slots so you can save the current game and come back to it later.

Here’s the Home Page for Sudoku Forever.

And of course the link to it on Google Play.

QR Code for Google Play link

Let me know what you think and be sure to leave a rating and feedback on Google Play!

Saturday, March 5th, 2016 Android, Java No Comments