All the Little Pieces, or TextIterator in PHP 6

13 July 2006 » In PHP » 11 Comments

I have been working on the Unicode support in PHP for quite a while now and I figure that it is time to start talking about Unicode and I18N in general and specifically about some of the new features that PHP 6 will be bringing to the table.

First up is the new Swiss-army knife-like TextIterator class. The purpose of this class is to provide access to various text units in a generic fashion. Actually, I lied. TextIterator implements ICU‘s full boundary analysis API, so what it really gives you are the boundaries between the text units. A slight distinction, but well worth remembering. And what are these units, might you ask?

  • codepoints
  • combining sequences
  • characters (slightly different than combining sequences)
  • words
  • line breaks
  • sentences

As its name tells you, TextIterator also implements PHP’s Iterator interface and thus can be used in such constructs as foreach(). As a quick example, let’s go through a string and extract all words contained in it (skipping empty pieces). Using foreach() it is as simple as:


$str = "The quick brown fox jumped over the lazy dog.";

foreach (new

TextIterator($str, TextIterator::WORD)

as

$num => $word) {

if (

$word[0] != " ") {

printf("%d. %s\n", $num, $word);

}

}



The result is:

0. The
2. quick
4. brown
6. fox
8. jumped
10. over
12. the
14. lazy
16. dog
17. .

Continue reading “All the Little Pieces, or TextIterator in PHP 6” &#8594

Yahoo! Looking for PHP Talent

11 July 2006 » In PHP » Comments Off on Yahoo! Looking for PHP Talent

Yahoo Site Operations Group needs a top-class PHP developer. Here is the official job description:

Yahoos Site Operations Group is looking for a software engineer to build and support existing tools for the Operations groups. You will be responsible for the design, implementation and ongoing maintenance and operation of internal web-based applications targeted at an operations/service-engineering audience. If you thrive on fast-paced development, challenging projects, and being part of a fun and highly-skilled team, read on.

This position will require development of scalable database-driven web applications able to communicate with various backend systems via web services, direct database connections, etc. You should be comfortable with all aspects of the development cycle from requirements-gathering and specification design to implementation and ongoing development.

The ideal candidate will be comfortable working in a cross-functional environment as part of a team composed of project managers, senior engineers, database architects, tech writers, etc. You should be able to identify and fill gaps, find innovative solutions for design problems, work well independently with an eye for high-level objectives, and consistently deliver quality products in a timely fashion.

Required Qualifications
– 5+ years of industry experience building top quality web apps
– Proven expertise with PHP and MySQL
– Expert level UI skills (HTML, CSS, JavaScript)
– Knowledge of C/C++ is a big plus
– Experience with object oriented design and development (PHP/C++)
– Experience with data modeling and advanced query design, optimization, and benchmarking
– Web Services (REST, SOAP, XML_RPC, etc) experience
– Expertise in at least one Unix shell scripting language (bash, PHP CLI, Perl, etc)
– Understand software engineering life cycle, client/server application and Internet application architectures (TCP/IP, HTTP, etc)
– Significant experience with requirements analysis, design, coding, testing, documentation, and application maintenance
– Experience with Linux/Unix/BSD system administration and shell scripting, Apache, and basic database administration
– BS or MS in Computer Science
– Excellent self-motivating, multi-tasking, communication, and interpersonal skills

If that sounds like you, send me a resume and I’ll forward it to the hiring manager.

Sara joins Yahoo!

10 July 2006 » In PHP, Work » Comments Off on Sara joins Yahoo!

This may be known to some of you already, but Sara Golemon, author of runkit, classkit, ssh2, and other PECL packages as well as a regular contributor to PHP core, has started at Yahoo! today. She’ll be working in the Search & Marketplace Group and will be a valuable addition to the team. Welcome, Sara!

Half-kingdom for the Desktop

21 June 2006 » In Tech » 1 Comment

Last week was the first time I had to do a hard shutdown on my Powerbook. It was a strange feeling. There I was, doing something that used to be a regular occurrence in the Windows world, and now it really bothered me that I had to hold down the Power button for 5 seconds and wait for my Mac to commit temporary suicide. And I was apprehensive for a good reason.

After powering back up, I discovered that my desktop (lowercase) was gone. No icons, and I could not drag anything to the background at all. I still had ~/Desktop folder but it seemed to be disconnected from the actual display. No one I asked about this has encountered the problem before, but I had a hunch it had to do with a corrupted preference file or something similar.

After much muckying around (creating a new user, making sure its desktop was operational, running Preferential Treatment over all .plist files, doing a binary sieve on the .plists to find the offending one) I narrowed it down to com.apple.finder.plist. A bit more yahoo’ing revealed that the culprit was a “secret” preference called CreateDesktop. If set to false, it tells Finder not to display the desktop. Brilliant. Somehow this got turned off during the hard shutdown and my desktop got lost at sea. Anyways, if you ever get sick of your Desktop (or want to restore it, like I did), you can change the setting via:

defaults write com.apple.finder CreateDesktop -bool <false or true>

Until later. I am going to go click on all the icons.

UPDATE: Fixed the HTML escaping of the command (the bool arguments were hidden).

Conference Update

20 June 2006 » In Talks » 1 Comment

I gave the Unicode talk, which is slowly evolving, at the PHPConf in Moscow in May (more on that trip later) and at the New York PHP Conference last week. The slides for both can be found on the talks page. Next week is the ApacheCon Europe in Dublin and then OSCON in Portland last week of July. Stop by and say hello. Unicode is not scary, I promise.

PHP-GTK Book is Out

30 April 2006 » In Books, PHP » Comments Off on PHP-GTK Book is Out

Well, I certainly never imagined back when I was starting work on PHP-GTK that one day there would be a 400 page book about it. Pro PHP-GTK by Scott Mattocks is the first English language book on this topic and it is on the bookshelves, real and virtual, right now. I just wanted to say, kudos to Scott and congrats on his newborn as well. He’s very productive. 🙂

Notes from php|tek 2006

29 April 2006 » In Talks » 5 Comments

I was in Orlando this past week at the php|tek conference, put on by php|architect. I gave two presentations there: PHP 6 and Unicode and Regex Clinic. The slides for both of them are available on my Talks page.

The social highlight of the conference was, perhaps, the dinner outing on Thursday night which culminated in an impromptu speed beer drinking contest. Guess who started it. (hint: name starts with Ras and ends with beer glass slamming on the table)

A Day in the Life of Schmichael

21 April 2006 » In Funny, Work » 1 Comment

Let it be known that Yahoo! engineers are not without a sense of whimsy. Michael Radwin, who is the main engineering manager for my group, has been on paternal leave for the past 3 months. Evidently, his direct reports got somewhat lonely without the attention of the fearless leader and his friendly smile..

Emergency Supplies

21 April 2006 » In Funny » Comments Off on Emergency Supplies

Now that’s what I call an emergency supply kit.

Good Old Times

18 April 2006 » In PHP » 9 Comments

I was browsing the MARC archives the other day and decide to see what my very first posting to any of the PHP lists was. It turned out to be this one on php-general list. And then shortly thereafter I posted on php-dev offering to help with … wait for it … PHP on Windows development. And here’s my first submitted bug, too. <tear up />.

Ah, good old times indeed.. Especially considering Zeev’s reply to me. 🙂

Page 11 of 25« First...910111213...20...Last »