Monthly Archives: September 2006

Obsessing over a music note

0
Filed under Miscellaneous

I’ve been of work for that last week as my wife and I settle down with our new daughter Addison. She’s such a cutie, and loves falling asleep while snuggling on my chest and shoulder. I can sit there for hours just staring at her and her cute expressions as she sleeps. Besides making me a happy person, the snuggling time has also afforded me an opportunity to finally encode my CD collection.

After installing the latest iTunes and playing with the new cover flow feature, I dug out all my CD’s as well as my wife’s (even my dust covered box of CD’s from high school) and sat it next to me on the couch while snuggling with Addison. I also modified the preference in iTunes to automatically encode and eject any CD inserted, so it was basically just a few hours of sticking CD’s in the MacBook when it spit one back out. Now however, I’m in a hunt for the missing CD cover art!

Coverflow Missing Cover

The majority of it was automagically downloaded as the CD’s were encoded (or purchased from iTunes), but a few were missing and the big glaring music note is now driving me nuts! I however really like the coverflow feature. I know it’s just a gimmick but it made me want to encode my cd’s - just so I could flip through all the covers. Now I’m hooked and digging up any other CDs around the house, all I need now is an iTV to hook up to my stereo.

(I’ve also started to explore the podcast section on iTunes - there’s some good stuff in there!)

A new life…

0
Filed under Miscellaneous

Well I’ve been very busy the last week. Friday night, September 15th, my wife’s water broke, leading to a long and eventful weekend waiting for the birth of my beautiful baby girl, Addison, late Monday morning. It was a tough birth but my wife was awesome and pulled through. We’re both giddy with excitement and as you can imagine, life has drastically changed so my posts may be a little less frequent in the coming weeks.

Addison

TODO: Get PHP 5 Certified - Check!

1
Filed under Knowledge, Miscellaneous, System

Well I guess I was better prepared than I thought. The exam was tough, so if you’re preparing I suggest studying hard and make sure you know all the little details!

Dear Jeffrey Sambells, Congratulations on passing the Zend PHP Certification exam! As a Zend Certified Engineer you are now among an elite group that leads the growth of PHP. The benefits you receive as a Zend Certified Engineer include:
  • Personal profile on the on the ‘Yellow Pages for PHP Professionals’ at: http://www.zend.com/zce_yp
  • Standing out from the competition when looking for a new job; or at your annual salary review
  • Global recognition of your PHP skills
  • Discounts on selected Zend products and PHP conferences worldwide
  • Exclusive previews of emerging Zend products
Whether you are distributing an application, seeking employment, bidding on contract work, or pursuing career advancement, your new status as a Zend Certified Engineer provides a tangible and verifiable advantage. You are welcome and encouraged to add the Zend Certified Engineer logo, found at http://www.zend.com/zce-logo/, on your website or online resume with a link back to your profile on the ‘Yellow Pages for PHP Professionals’. Use the following link: http://zend.com/zce.php?c=ZEND901180&r=5112390 Your official certificate will be mailed to you within 4-6 weeks. Bonus: Get your own Zend Certified Engineer business cards for FREE! Best of luck and happy PHP’ing. Sincerely, Dhwani Vahia Education Programs Manager Zend Technologies, Inc. http://www.zend.com The php Company

php|works 2006 Day 3

1
Filed under Events, System

Session 1: eZ components

Derick Rethans Slides

eZ components are re-useable, clean IP, Open Source friendly, building blocks that you can use in your PHP applications.

Similar to PEAR, it requires a base class for common exceptions and other common elements and provides components for:

  • Command line
  • File
  • database
  • Mail
  • Image
  • Logging and Debugging
  • System Information
  • as well as a output Templating and Translation component.

Components are generally independent and do not rely on other components unless absolutely necessary and each class in prefixed with ecz to eliminate the possibility of conflicting with your existing classes.

Installation is as simple as downloading the latest source and adding the appropriate ini include path. the only trick is that component framework relies on the __autoload() function so if you’re using it in your framework, you’ll need to check for the components using ezcBase::autoload($classname); (assuming you’ve already included the base using “require ezc/base/Base.php”).

For installation of new components, you can also use the PEAR installer using the channel://components.ez.no, so for example to install the base automagically, just run PEAR install channel://components.ez.no/Base

For usage examples see the docs or Derricks slides from the seminar. Neat things include:

  • Console table formatting and progress bars!
  • Really nice logging components for creating and managing your own custom log files.
  • Database query abstraction, looked a little messy to me, but I’ll have to check it out a bit more before I judge.
  • Creating and sending MIME mail (similar to PEAR)
  • Feed readers
  • Graphs
  • SignalObserver: IPC for PHP

Session 2: Explaining EXPLAIN

Lukas Smith Slides EXPLAIN is an SQL keyword implemented by most databases that outputs what the query is going to do (execution plan) and ‘explains’ how it’s going to do it and the estimated “execution cost”. If your queries are running slowly, using EXPLAIN could reveal some interesting information about the performance of your query and where you can improve things. Remember however that EXPLAIN isn’t actually part of the SQL standard, it’s just a nice developer feature added after the fact.

When looking at the output of EXPLAIN:

EXPLAIN ANALYZE SELECT * FROM customer JOIN contact USING (last_name);

QUERY PLAN

Hash Join (cost=1.02..92.23 rows=2048 width=351) (actual time=1.366..58.684 rows=4096 loops=1) Hash Cond: ((”outer”.last_name)::text = (”inner”.last_name)::text) -> Seq Scan on customer (cost=0.00..60.48 rows=2048 width=107) (actual time=0.079..21.658 rows=2048 loops=1) -> Hash (cost=1.02..1.02 rows=2 width=287) (actual time=0.146..0.146 rows=2 loops=1) -> Seq Scan on contact (cost=0.00..1.02 rows=2 width=287) (actual time=0.074..0.088 rows=2 loops=1) Total runtime: 62.233 ms

the order of the table is important. Form the presentation, in general for complicated queries, PostgreSQL is better at picking a good execution order over MySQL (ya!).

When using indexing, the formate of your query is important. for example in you have a table where c1 and c2 columns are indexded, “c1=c2 AND c1=12″ would be better written as “c1=12 AND c2=12″ as the index may not be used on the c1=c2 comparison.

PostgreSQL allows you to specify the storage order of the records in your table so you can further optimize based on what you’ll be sorting on (he didn’t say HOW to do this, I’ll have to look into it more).

Lukas has a tendency to run out of time on his presentations so he was flying through this presentation to fit it in. I stopped typing everything to pay attention so definitely check out the slides. Related

Session 3: Apps Made Easy on Zend Framework

John Coggeshall

I’ve poked about in the Zend Framework (even submitting a proposal which was ultimately rejected due to the scope of the framework) and have been following it closely. Were at a point at work where we need to reevaluate some of our platform and decide if there are better alternatives out there. ZF combined with PEAR and eZ components, offer a lot of compelling reasons to start integrating more ‘off the self’ components rather than trying to re-invent the wheel.

The Zend Framework is just a small part of the PHP collaboration project that offers a “clean IP”, modular collection of PHP classes based on PHP 5 / E_STRICT. It provides a starting point for all your applications and demonstrates the PHP 5 best practices. It’s modular design allows only pieces to be used within your applications and achieves it’s goals with a minimal object hierarchy.

One of the ideals I like the best is that the frameworks strives to be simple and easy to use. “Simple things should be simple, complex things should be possible”. the architecture is distributed as a package, not as individual modules, which provides a “use at will” setup so everything is accessible if you want it.

The framework is namespaces to Zend:: and all constants are class based so it will lay nicely with any other components (ez, Pear). Other than setting up the proper include path in your php.ini file, all you need to do is download it (or check it out from the subversion as I do).

ZFApp

ZFApp is a framework based of ZF that sets up the initial structure of an application using the Zend Framework. It’s in the Lab project of Zend’s framework, where non-core idea prosper. ZFApp is working towards, for example, being able to write a blog in 30 minutes with all the bells and whistles including authentication, searching, syndication and more.

Taking a lot from Ruby on Rails, ZFApp provides a rudimentary installer that sets up an initial app framework where you can then begin to play. Taking the “Convention over Configuration” approach, you can then add controllers and views in the specified format and -tada-, your app will be up and running is seconds.

The demo app for the seminar was a fully functioning blog app, which appeared well rounded on minimal code. If you’re looking to build new apps based on the Zend Framework, this is definitely worth a look. From the brief introduction, the only hesitation I have is the views reliance on Smarty. I’ll have to explore more but allowing alternate template engines would be a nice add-on.

Roundup

Overall the conference was worthwhile, much better than last years. The speakers seemed well prepared and knowledgeable but I was more selective about what sessions I attended based not only on the topic but also the speaker. A few speakers could have presented themselves in a little more professional manner (no ripped shorts and flip-flops please) but the content of their presentations was still good.

I didn’t get a chance to attend the after hours events but I heard they went well so I’ll have to attend next year. Aside form the conference, I do have a few gripes with Wordpress now that I’ve been using it consistently for tree days (code formatting and headers anyone?).

As for ideas, I have a ton. I mentioned in a previous post that we’re in the rocess of migrating to PHP5 at work and I’m responsible for upgrading and improving the overall framework and system. Zend Framework, XML, convention over configuration, namespaces and a bunch of other PHP5 goodies will be at the front of my brain as we wade further into v5. It’ll be exciting!

And as a followup to my Ap’p'le post, they’ll be replacing my MacBook keyboard, but I have to leave it with them for a week once they get the part in. I’ll have to argue that a bit more as I live an hour from the store and my wife and I are expecting our first child next week so I’m not going to have time to be diving there at their leisure, let alone be without my MacBook for a week when the baby’s coming and I have to unload my cameras!

Oh, and here’s the solution they came up with for the lack of plugs…

Plugs

php|works 2006 Day 2

2
Filed under Events, System
Aside: just a note that I think abot 30-40% of the people here are using Mac laptops and about 80-90% of the speakers are.

Keynote: Microsoft platforms for the PHP Developer

Joe Stagner (Microsoft) An introduction to PHP on Windows and why you should consder it. I didn’t take a lot of notes here since we use Linux/Apache/PostgreSQL/PHP at work and have no intentions of changing for a variety of reasons I won’t get into here. This was recorded so perhaps they’ll distribute it from the phparch site.

Mentioned was PHP Designer, which may be worth a look.

Read More »

A Personal Reflection

2
Filed under Miscellaneous

I have no ‘practical Theoretical‘ educational background in programming, outside a few courses on Web topics. My background is in design and print, but I love programming. I started programming, teaching myself RealBasic and Perl, but quickly migrated to PHP years ago. I’ve been building web applications for the majority of the last decade but I realized today that I really love programming for programmers, not for clients.

Read More »

php|works 2006 Day 1

3
Filed under Events, System

Keynote

Rasmus Lerdorf Slides (may not be working yet)

Yet another excellent keynote by Rasmus, I’ll have to track him down at lunch for a little chat. Rather than go into detail, I’ll just link to the video of the keynote on Google. Highlights are:

  • Flash and IE header/cookie hacks
  • Optimizing your server and script to handle a Digg/Slashdot (including how to find bottlenecks)
  • Dom and simple XML
  • Geocoding/maps/flickr
  • Real file upload progress detection in PHP 5.2, Finally! (source)

Read More »

A midday surprise

2
Filed under Events, Projects

Went to lunch at the conference and figured I’d browse the books at the regisration desk. Guess what I found…

book.jpg

php|works 2006 Day 0.5

1
Filed under Events, System

Arrived early again today so I have almost an hour before the Rasmus Lerdorf keynote starts. Just a quick post over my excitement on getting free swag in the conference package - an Apress t-shirt! Coincidence?

php|works 2006 Day 0

0
Filed under Events, System

The official conference doesn’t actually start until tomorrow as today was an ‘extra’ day of in-depth tutorials (hence day 0 not day 1). I was however pleasantly surprised by the initial preparedness of the extra day. I arrived an hour and a half early (to beat the downtown Toronto traffic) and they were already accepting registrations and everything was ready to go. Last year I was worried I was in the wrong building as I waited in the lobby for about an hour before I even saw signs of the conference. The location itself is pretty easy to get to and has a nice atmosphere.

Conference Room

Read More »