Archive

Archive for February, 2009

A few places still left for the PHP Quebec Conference!

February 18th, 2009 No comments

 

The PHP Quebec team is waiting for you from March 4 to 6 at the Hilton Hotel downtown Montreal for the 2009 PHP Quebec Conference.

The Seventh Annual Conference PHP Quebec will start in 2 weeks. This event – the largest of its kind in North America – will last three days and will include some 55 conferences and workshops, a job fair, a cocktail and many informal ways for “networking”. There are so many activities that we had to reserve four different rooms to allow all participants to attend. Topics discussed include security, databases, project management, best practices, and we will have special presentations on frameworks and CMS to name just a few.

One of the featured speakers of the Conference in 2009 is Zeev Suraski, co-founder of Zend Technologies. In his presentation entitled “Why PHP Wins”, he will explain how PHP became the programming language of choice for web developement. Recall that Zeev Suraski had contributed to develop PHP 3 with Andi Gutmans in 1997 and PHP 4 in 1999. Sign up today for this unqiue chance to meet him in person.

Several workshops – the PHPLabs – will be “interactive”. Speakers and attendees will discuss about solutions based on real life experience. That is why it’s suggested that you bring your laptop.

Please note that only a handful of places remain, so don’t wait. Register online before February 28 and to secure your presence at the conference.

For more information visit the conference website:
http://conf.phpquebec.org/

Hope to see you there!

Tags:

CodeIgniter at PHP Québec

February 6th, 2009 4 comments

Here is the code produced during the CodeIgniter presentation at PHP Québec yesterday.

foot.zip

lastIndexOf with RegEx?

February 6th, 2009 No comments

I was quite surprised that Flex did not have a way to get the index of the LAST matching substring. I want get the index of a word’s first character based on the cursor’s position (I’m working with the text property of a UITextField).

To achieve that I’m getting all text in front of that word: text.substring(0, cursorPosition). Then, I simply want to search for the last non-word character (\W), if there is any. That way, I can have the index of the first character of the word.

So to get the last non-word character, I can’t use lastIndexOf() because it doesn’t support RegEx, I can’t use match() because it returns an array of substrings instead of indices and I can’t use search() because it returns the first index, not the last.

There is a way around the missing “searchLast()” and “searchAll()” functions.

I get a substring before the cursorPosition: text.substring(0, cursorPosition)
I loop through all characters backwards and check if it’s a non-word char.
Once I find it, I record the index at which it was found. 

There might be other ways to get the beginning of a word based on cursor position, so don’t hesitate to share them. I really hope that the next SDK version will come with searchLast() and searchAll() functions.

Tags: ,