Archive for April, 2008

Zend Framework Webinar - ZF Q&A Session

Posted April 30, 2008, 11:31am In: Zend Framework

The Zend Framework Webinar just finished. To be honest, I got to both nerd out and have some fun with it - including poking fun at the ZF team and Wil for dropping his mic.

There were a lot of topics discussed, including the future of Zend Framework, current challenges, and addressed concerns. They did let us know (I don’t subscribe to the Zend newsletter so I didn’t know this) that ZF has crossed the five million download mark, a jaw dropping number, as well as whispered some confirmation about integration with a third party javascript library. While I can postulate that the library will be either Dojo or jQuery (Dojo is used by a couple in the ZF team, and jQuery has critical mass), they pointed out (and re-iterated) that they don’t want to lock the community into one solution. If I want to use mooTools, YUI, etc, I’ll be able to. Cool.

Here’s what I got out of the webinar:

Be “just a wee bit more” Involved
There needs to be more visibility from the entire ZF team. Guys, let’s be honest, the person getting the most visibility right now is Matthew, and while I think he’s a splendid lad, there are more of you - I’m not saying that I don’t hear from Wil or Ralph or Darby, but I’d like to see more articles from you folks on DevZone and your particular blogs.

Go For More Community Involvement
There were a bunch of ideas tossed around, from building demo apps, open sourcing the code of the framework site (which isn’t going to happen any time soon, but they haven’t ruled it out) to having guest bloggers. Yes Wil, I will volunteer if needed =P. The problem that I addressed when I piped up is that projects like zfforums.com, despite having good intentions, don’t have the critical mass of users to make me prefer them to the mailing lists. And I hate email.

CLI Tools, With More On The Horizon
The challenge of developing CLI tools was addressed, and I translated this as “We’re working on it”. I wouldn’t mind a few code generation tools guys, that’s all I ask for. Creating all those blasted folders and files when I get a new project is sooo tedious.

The Future Is Bright and Shiny!
With talk about 2.0 (or 3.0 and 4.0, depending on who’s wise-cracks you listen to), Zend Framework Certification and lots of new code stuff - like Zend Framework Extras and scaffolding - the future looks bright indeed for the Zend Framework. There’s even talk about generating revenue!

Suffice it to say that I’ll be sticking with ZF, and blogging about it, for the foreseeable future.

There’s also more feedback via Joshteam’s Weblog.

“Compliments of the highest order”

Posted April 29, 2008, 10:37pm In: Startup Experiences

I got an email from a client today that gave me seven sorts of warm fuzzies.

Dude I just wanted to let you know I am extremely impressed with your attention to detail with the cut you did for me…

I was particularly fond of this line:

You do world-class work.

As middleman contractors, we enjoy a life of anonymity and our work is very commonly taken for granted. Every once and a while, it’s nice to learn that our work is appreciated.

Zend_Console_Process

Posted April 27, 2008, 9:11pm In: Zend Framework, PHP

Rarely do I get excited about a Zend proposal - and I definitely don’t post about the ones in progress on my blog. However, Zend_Console_Process deserves some attention.

If you’re at all familiar with pcntl this is for you. Pcntl allows you to control processes from within PHP (essentially allowing you to run threaded PHP code; fake “real” threading, at least). Zend_Console_Process is a Zend style interface to create threaded PHP applications in a usable manner.

If you take a gander at Ben’s first example, you’ll see the advantages:

Now, there’s been some interesting discussion on the mailing list already. For instance:

… Calling this “Threading” is a major misnomer. Threading would imply it has access to the same address space and descriptor table. That is not the case if this uses fork…

-Michael

Good point; so don’t take anything you read on the ZF site (actually, anywhere on the internet for that matter) as divine writ.

Like I said in my last post, it’s all about choosing the right technology. If you need to resize a couple dozen images, this will do you fine. If you need to build a video trans-coding server that can handle hundreds of videos at a time, well… perhaps it is time to choose a different language to do your heavy lifting. The fact that it doesn’t work on windows is a large hit to the adoption of Zend_Console_Process, but in my humble opinion, it is the most interesting proposal to come into review status since Zend_Service_Amazon_S3.

Handling Large(5GB+) File Uploads

Posted April 24, 2008, 9:25pm In: PHP, Development

A couple days ago I met with a potential client who posed an interesting challenge. He wanted to upload very large files (upwards of 6GB-7GB) to his server using PHP. I told him it was possible, but I don’t recommend it. There’s a few reasons why.

One of the biggest problems I have with most web applications is file uploads. As a developer, I rarely need to upload anything larger than, say, 100MB - this covers a lot of code files, libraries and so forth. Generally, in an OOP world, if a file is larger than a couple megabytes you’re probably doing something wrong anyways.

But, I’m a developer. I work with people on a daily basis that aren’t developers. Hi-res photos, PSDs, even digital media files such as AVIs & MOVs, are something that should be considered when building an application. A complicated PSD, for instance, can easily grow upwards of two gigabytes.

And therein lies the problem.

Let’s face it, PHP, for all its glory, is quite simply, not the best language for uploading files. This is a three pronged problem. The first is PHP, which I’ll elaborate on. The second is HTTP. HTTP is just not suitable for receiving large files; don’t get me wrong, it’s possible, but I question the wisdom. The third is actually client based - it takes time to upload a file, and most people I know (especially non-web savvy folk) get irritated when it doesn’t work immediately.

Let’s take, for instance, what most people do to get around the upload problem by overriding the PHP default limit. Formerly, you could set these variables using ini_set() and ini_restore(), but some of the overrides are no longer available through these methods. You can use a php.ini file, set the options directly but chances are you do something like this, via an .htaccess file.

Make no mistake, this is bad, and a potential security hole. Why? Because someone could easily setup a denial of service attack and bring your servers to its knees.

Addressing the Problem

Okay, so now that I’ve said that uploading files as big as we’re talking is a bad idea, what’s the solution?

First, address the HTTP problem. We’ve got several options, but something I found a few years ago is very promising. Take the challenge outside PHP.

Meet Tramline (http://infrae.com/products/tramline), an upload and download accelerator that plugs into Apache. Using mod_python, it provides a direct means to bypass PHP altogether and hook into Apache. A bit more security tweaking and it is an acceptable solution. There’s more alternatives too. Curl, WebDAV, Java, Streams, Python and Perl to name a few.

At this point, it is fair to say that one should choose the right tools for the right job. This is also true with the client upload problem. It is completely unacceptable to use a file control, have the user hit submit and expect them to wait there for five minutes or more. That said, there are alternatives. SWFUpload, YUI Uploader and various other Javascript methods as well, and with a bit of tweaking I’m sure they could be modified to utilize a service.

6GB-7GB? Easy. Just don’t stick to your PHP guns.

I’m interested to hear how other folks have handled large file uploads.

Saying No

Posted April 22, 2008, 9:11am In: VC/Funding Related, Dragonfly R&D, Personal

I have to admit my favorite blog to read lately has been trumped by TechCrunch and is now Rick Segal. Onlookers would say that that’s because I have a personal investment on keeping tabs on Rick because I want to go after money for Karmba eventually… In fact, it’s much more simple. I find that Rick’s posts convey a lot of wisdom (not to mention common sense) that could be applied not only to the pursuit of venture capital, but everyday business and personal life as well.

Take, for instance, Rick’s post about The No Email Thread. One line in particular stood out.

your time is just as valuable (or more) than mine

Doesn’t sound like a there is lot of ego there. Despite Rick’s history - not to mention the fact that he and his team of mad scientists control the flow of millions of dollars - he still recognizes that time is valuable and tries to conduct his business affairs in such a manner.

I think that most people in this industry could learn a thing or two by checking their ego when they open an email or go to a meeting. Programmers especially are guilty of this. We build applications, engineer specifications and somehow it gets in our brain that we’re god’s gift to [insert your demographic here].

Your time is valuable, but so is the time of the people you’re working with. If you’re not interested in an RFP, a potential client, or a partnership, take a lesson from Rick and tie it off in a respectable manner so they can move on.

Kudos Rick. Keep it up.

End of Week Two

Posted April 20, 2008, 8:35pm In: Startup Experiences, Startup Life

It has been my experience that one of the most common factors for many people to start new companies is a reaction to events out of their control - such as getting laid off or fired. I’ve seen many that end up standing around like a deer in the headlights as they hit the panic button, only to determine that the best course of action is to start a new venture.

Back in the dot com, I tried to start up a web design company like so many others. Twice. It failed miserably, crashed and burned. It was then that I realized two things. The first is that I needed to face the hard truth that I just wasn’t a designer. The other is that I quite simply wasn’t ready for such a venture. After closing shop (and that shop was of course my $800/mo apartment) and nursing my battered pride, I got some advice. Stay in the industry, work for other people. Lay low and bide your time. So that’s exactly what I did. I didn’t lose my entrepreneurial spirit however. I co-founded a content management company, and stayed in the startup industry. A year ago, I left Cambrian House with the firm intention of starting a company anew… only to sign on with another company a couple months later at the nigh fanatical request of a friend of mind. What was intended to be short term wasn’t exactly that.

Fast forward to the here and now.

A piece of advice that has always stuck in my mind when talking to other entrepreneurs is to “quit your day job“. It is a ludicrous thought to those that don’t possess an entrepreneurial drive, and doctrine to those that are unhappy doing anything else than forging ahead on the path less taken. It motivates to the point of insomnia, drives one to work that much harder on their venture of choice.

However, my venture of choice, codenamed Karmba, is a product. Products take time to build, and I certainly don’t have the resources to devote to one hundred percent development whilst paying the bills. As such, when I left the safety and security of working for someone else, I had a plan. Start consulting, leveraging my technical aptitude to agencies and development companies. This in turn helps fund the product during downtime, allowing the hiring of other developers and designers alike.

And so, it has been two weeks since I deliberately left security and stability (not to mention a fantastic company) to pursue personal goals and dreams. I continue to feel what thousands have felt before, including myself. Uncertainty, lack of confidence and restless nights, coupled with dreams of a brighter future.

As I press into week three, I am reminded of feeling an unparalleled ambition and sense of accomplishment that only taking the path less traveled provokes. Despite the fear of failure and lack of sleep, I know I made the right call. Besides, like Wil Schroter said:

There are no weekends, only 2 days per week with different work hours.

Tungle

Posted April 16, 2008, 7:57am In: Web Related

After hearing about Tungle almost a year ago, I found the concept pretty exciting. Organizing and coordinating is a pain, and there’s no silver bullet for it.

But that doesn’t stop people from trying. Tungle has gone into public beta, as of today.

http://www.tungle.com/ - Best of luck, lads!

Calgary VC Roundtable Location Confirmed

Posted April 8, 2008, 10:22am In: VC/Funding Related, Personal

When I first heard about the VC Roundtable that Rick Segal is putting on, I jumped to sign up with nary a thought.

Just got an email via eventbrite.com. Looks like we’ve got a confirmation on the location.

Now, if I could just figure out what the devil I’m going to wear.

Building an audit engine with Zend Framework

Posted April 3, 2008, 7:53am In: Dragonfly R&D, Zend Framework

Part of what I love with ZF is the ease at which I can extend it to do what I need.

For instance, recently I was developing my app (codenamed Karmba) - something I needed to do is to be able to log every transaction, and at any time restore a version of information.

Let’s say for instance, that I have a blog - I know, I know, everyone uses that as an example, but let’s stick with something familiar, okay - and within my admin, I want to edit an entry. I start with my controller.

Disclaimer: This post is based on a real application, but isn’t all of the actual code. It is not plug and play; expecting this code to work out of the gate does not reflect what I’m trying to do.

For reference, DomainObject is just a convenience class - you can easily replace it with Zend_Db_Table

Now, let’s take a look at the Factory itself. A majority of this should be familiar to you.

Now, to illustrate my point, we create an object, Blog_Post - within Blog_Post there’s as much or as little as we need to alter the data.

Now this is where we start to see a little bit of the magic happen. Db_Table_Row (or another suitably named object) accesses functions that are called by Zend based on certain events. The event that I want to illustrate here is _postUpdate - an event that fires AFTER the object is updated. Now, a bit of hacking is required to get this to work. If you don’t know what _cleanData, _data or _modifiedFields are and how they’re used, a lot of this won’t make sense to you.

Now, inside AuditFactory is where we log all our transactions. We can revert entire objects or alternatively pick and choose what we update. That’s why every field gets a new object.

And that’s it!

This example proves how powerful the Zend_Db component of the Zend Framework is - and how contrary to popular belief - easy it is to extend existing functionality in a real world environment.

Audit factory doesn’t need to log to a database either. You could easily alter the class to the log entries to disk, or send an email, et cetera.

Feel free to comment, or expand on what I’ve said.

TheFunded re: VCs

Posted April 3, 2008, 6:51am In: VC/Funding Related

I read an article on TechCrunch that summarized Adeo Ressi speaking at Next Web.

Now, there’s a dozen ways to skin a cat - a morbid metaphor if ever there was one - and it seems that everyone has something to say based on their experiences. Of course, some are more credible than others, but let’s try not to forget that these are opinions, not writ or law. I can point out a couple statements that would have some VC folk grabbing their pitchforks and going on a witch hunt.

It’s easy to forget that people that give advice, however good their intentions, might have their own agenda; surely the reason that thefunded.com was started is enough reason to take anything that Adeo says with a grain of salt. Don’t take what anyone says about receiving large sums of money as doctrine.

That said, I’m not saying that the multitude of things people say are wrong or right. Simply that it’s up to us, the founders, funded and those (like me) in between, to make up our own minds.