The homepage of Chris Tate-Davies
admin
This user hasn't shared any biographical information
Posts by admin
ThreadSMS – Review
Jul 28th
My Nokia doesn’t have threaded SMS view – and its very annoying. So, after searching about for a suitable application for this, I came across ThreadSMS by eHandySoft (http://ehandysoft.com/threadsms.htm)
Functionality:
Quick to load, and quick to navigate. On my N97 mini the scrolling was very smooth and precise. The threads are loaded with contact pictures next to the corresponding people (if you have contact pictures assigned). Clicking on a thread will open it up in a sort of bubble outline. Here you can read the flow of the thread easily.
If you want to reply, you have to click on a message, and then a text entry box appears. It would seem better to me to have the box always there, or at least an option to choose.
There’s even a method of locking your SMS so that prying eyes cannot view them (if you’re upto no good)
If you regularly receive spam SMS messages, then you can filter these out, and silence them. Another great idea.
Looks:
I looks very slick. There are around 7 bubble themes you can choose, that changes the design of the thread view.
The different threads are grouped by sender, so in the main window you get a list of your contacts with their little pictures, ordered by the most recent first. Logically.
Overall:
A good bit of software that expands the Nokia’s limited SMS functionality.
Reading the MySQL binary log
Jul 27th
Having MySQL dumping out binary logs is a very good failsafe for backup redundancy. But, how do you get any of the information out of them?
If you know a time span that you need to investigate, then you can easily use the mysqlbinlog utility:
mysqlbinlog --start-datetime="2010-07-27 14:30:00" --stop-datetime="2010-07-27 15:00:00" > backup.txt
This will export all the recorded SQL Statements performed between 2:30pm and 3pm on the 27th July 2010 to the text file “backup.txt”. I can then browse at my convenience.
If you need to re-create any of the statements, you can copy and paste into your MySQL client of choice.
Accessing the Zend_Application from a page
Jul 27th
If, like me, you need to access some Zend_Application resources (such as multidb resources) – then you need a reference to the Zend_Application and the bootstrap. I use this:
if (null == $this->_application)
{
$this->_application = Zend_Controller_Front::getInstance()
->getParam('bootstrap');
}
Retrieve email using regex
Jun 23rd
ThisĀ horrendousĀ regular expression will parse a string and return a valid email address from it.
$email = "<'Freddy'> fred@live.com";
preg_match('/[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/', $email, $match);
echo $match[0];
This will return:
fred@live.com
Basically, if you pass an array as the third parameter of the preg_match method, it will be filled with the preg_match results, and the first item of the array will be the matching string. If you use capturing groups, these will also be filled. Read more about preg_match at the PHP site here.
I am told that this expression will match 99.9% of valid email addresses in the wild.
Online regex -> php tool
Jun 22nd
I’ve found an excellent online tool, where you can give it a regex, and it will spit out the PHP syntax for use with preg_replace, preg_match, etc.
I’m forever getting ‘Unknown modifier’ errors when trying to insert regex’s into my PHP code. This sorts it out for you.
