Archive for July, 2007

OSCON Day 2

Monday, July 30th, 2007

Here are the sessions I attended on the second day:

VIM for PHP Programmers
Andrei Zmievski, Chief Architect, Outspark, Inc.

I had a tough time deciding if I wanted to go see Andrei, as there was
a session on Windmill - http://windmill.osafoundation.org/ a new
automated Ajax testing tool. It was a very informative session if you
use vim, he demoed a lot of plugins I’d never seen.

Cache That!
Gopal Vijayaraghavan, Yahoo!

I wanted to go to “Error Handling in Ajax” but at the last minute, the
event director came in and told us the session was canceled. This was
my 2nd choice, so I came in a little late to a packed room. Gopal
is the lead developer of the APC php caching engine
http://pecl.php.net/package/APC which seems like a no-brainer to use.

PDO: PHP Data Objects
Wez Furlong, Lead Architect, OmniTI, Inc.

PDO is similar to ADODB or the PEAR database abstraction layer, except
that it is a PECL package, so it is much faster.

Security 2.0
Chris Shiflett, Principal, OmniTI Computer Consulting, Inc.

Chris covered the two main website attacks - XSS and CSRF, as well as
newer attacks, which are basically a combination of both of them.

Prototype and Object.prototype: JavaScript Power Tools
Amy Hoy, Lead Interaction Designer, Lime Wire, LLC

Lately, I’ve been playing around with Prototype (an Ajax/javascript
library) http://www.prototypejs.org/ so I went to this session. I
learned a couple of tricks, but mainly she just covered the basics of
Prototype.

PHP Add-ons for Fun and Profit
Brenda Wallace, Catalyst IT

Brenda covered memcache, a data caching library, eAccelerator, which
is a php cache & data caching library.

OSCON Day 1

Thursday, July 26th, 2007

Free starbucks in the morning, free beer in the evening, what more could I ask for? Oh yes, I suppose there was time to learn as well. I went to 6 sessions today:

The Future of Rich Internet Applications with PHP
Andi Gutmans, Co-Founder and VP of Technology, Zend Technologies, Inc.

This basically ended up being an overview of the Zend Framework, with an emphasis on Ajax.  Interesting, but nothing I hadn’t seen before.  He did show some interesting mash-ups with Yahoo analyzer and flickr.

PHP Security: Fact and Fiction
Andi Gutmans, Co-Founder and VP of Technology, Zend Technologies, Inc.

While this was in the PHP track, Andi did a broad overview of security.  He compared securing a php script to securing a plane trip - it takes a lot of pieces, all which you need to pay attention to.  You also need to assume you are going to be hacked at some point, so you should take steps to limit the effects on your system when this happens.  He listed a few tools I don’t have any experience with - Nessus, SAINT, PHP-SAT, all of which I will have to check out.

Who Am I? The Age of the Digital Identity
Robert Richards, Development Manager, Local Thunder

This was an overview of OpenID.  Once/if it catches on, it will be a nice service.

PHP: Bigger and Faster
Rasmus Lerdorf, Yahoo!

Rasmus’ session was the most interesting. For those who don’t know who he is, he wrote PHP 1.0, and currently works for Yahoo working on improving php performance and security. He demonstrated some excellent tools, most of a few of which I had never seen in action:

Yslow - analyzes webpages, finds ways to speed them up from a front end perspective.  Released just a couple days ago.

Seige - allows you to send simultaneous requests to a webpage

Valgrind - linux process profiler. See which layer (apache, php, database, etc is taking the most resources)

Xdebug - php level profiler. Find which parts of the program are taking the most time, which functions have the most calls.

kcachegrind - reads valgrind & xdebug logs, gives visual output

Ending Rails Envy in PHP5
Sam Minnee, Development Director, SilverStripe

Sam went over the use of __call() and how he used it to extend the SilverStripe CRM program.

Improving Performance by Profiling PHP Applications
Patrick Reilly, Senior Developer, OmniTI Computer Consulting

Patrick had a few technical difficulties in his presentation, and he seemed to be missing some of his notes.  I don’t think he was as well prepared as the other speakers, or maybe it was just nerves.  He covered APD, which is similar to Xdebug.  Today I wish I would have asked him what APD does that Xdebug can’t do, alas, I always think of my questions way too late.  I think speakers should be available for questions the following day for people like me.
As a side note, I’d say 70% of people here have macbooks. I think the general consensus is linux just doesn’t make a good desktop.

OSCON Day 0

Wednesday, July 25th, 2007

Sleeping the day before a big event has always been tough for me. I wake up every 15 minutes and look at the clock - time to go yet? No? Back to sleep. Repeat.

Yesterday was one of those days. Luckily I was able to catch some Z’s on the plane, as well as read most of the latest Harry Potter book (seemed like 1/5 people on the plane had the same idea). Phoenix airport was a bit small, no good place to eat, so I made do with a turkey and swiss sandwhich. On the 2nd plane, I sat next to a guy who was a musician. Though I didn’t catch his name, he said he was playing with George Clinton in a couple of days, awesome. I did a google search, I think this is the guy.

Once I got to the airport, I gave my hotel a call and waited for the free shuttle. And waited. And waited. My hotel was only 3 miles from the airport, yet it took an hour for the shuttle to arrive. To be fair, I may have missed him the first time around, the van had 2 hotel names on the side, perhaps I wasn’t looking carefully enough. In any case, the driver and rest of the staff was very friendly. The hotel was very quite, and just a parking lot walk away from the light rail, which was very nice. They have a coffee shop with decent brew right on the premises, so I am fully caffeinated for today’s events.

My biggest complaint is the internet, or lack there of. They claim they have free wireless access, but what they really mean is, free access if your room is close enough to the coffee shop. My room isn’t. Bleh. I may be able to switch rooms, but I think I have enough to keep me busy. If I really need access, I’ll just head down to the lobby.

Currently, I’m at the Oregon Convention center lobby, waiting for the sessions to start. More on this story later.

Needz… Decaf

Tuesday, July 17th, 2007

Needz… Decaf

Maybe I’m just getting old, but I’m starting to notice more and more the effects of things I put in my body. If I eat the wrong things, I feel sluggish. If I stay up late, I feel like a zombie the next day. If I drink caffeine at night, I can’t sleep. I used to just go through the day like a machine. I could eat or drink whatever I wanted, stay up late when I wanted, nothing seemed to affect me. Now I’m realizing how awesome that was, I guess you don’t know what you’ve got till it’s gone.

Yesterday I was driving home, and I felt wired. It was sort of making me nervous, I didn’t like the feeling at all. Yes, I was able to play tennis and get all that nervous energy out, but still - I didn’t like it. So from now on, I have a new rule - no caffeine after 1 pm.

Controlling the amount of energy in your body is something I started thinking about a few weeks ago at a card tournament. Just before the tournament, I had to run to my car, which was several blocks away. When I sat down to play, I felt surprisingly calm. Normally I have all this nervous energy running through my body, and no real way to let it out. But since I had just gone for a run, I must have burned off all the sugars & other junk that would fuel my nervousness. So I just sat there, calm as a monk. It was a pleasant experience, so now before any card tournament, I’m going to repeat the process.

On Upgrading to PHP5

Tuesday, July 17th, 2007

Vid had a post yesterday where he writes about his concerns regarding the push to upgrade to PHP5. If you have not heard already, the PHP developers announced a couple of weeks ago they will be discontinuing support for PHP4. The reaction to this has been mixed, and I was perplexed at the developers who seem to be against the change. While most of the applications already work for PHP5, they just don’t understand the point of forcing people to upgrade.

Vid is correct on many accounts. End users don’t care what the back end is doing. Many coders don’t care about the enhancements to PHP5, they just want their code to work. If it’s already working, why mess with it now? For me personally, when I started working with the new XML library, I was blown away on the amount of progress that had been made. Working with the old version was like pulling teeth, the new version was cake. Now if I had a program already working with the old XML library, would I want to re-write the whole thing just for PHP5? Probably not.

The statemeant “PHP5 gives cleaner, faster code” is pointless. Only good practice can give you cleaner and faster code, there are still going to be a million and one idiots out there writing bad code.

However, I believe a lot of people are missing one main point - one program is easier to maintain than two. PHP has a limited number of developers working on their engine. If they can stop support for PHP4, that leaves more people free to fix bugs in PHP5 and put effort towards PHP6. Seems like forcing people to upgrade is a small price to pay.

My Summer is Filling Up

Wednesday, July 11th, 2007

My boss told me last week the company is sending me to OSCON this year. It’s the first time I’ve attended any type of software convention, and I’m looking forward to it, though I wish they would send some of my co-workers along with me. Lisa wanted to go just to checkout the city of Portland, but seeing how plane tickets are currently over $600, I thought that was a bit high, seeing how I would probably only be there a couple days. I still need to decide which seminars I want to attend, and of course my company doesn’t want to pay for the entire week.

Last night we held our VS release celebration for the “World’s Finest” set. It was a blast. I put together a Outsiders/Arkham inmates deck that ended up going 5-0. Insanity is too good in sealed. I had to cut 3 cards I wanted to play just to make my deck “Insane” but the benifits were well worth it. One of the cards I had in my pull was Beside Myself, which drew me a LOT of extra cards. I don’t see how I could lose drawing 5-10 cards more than my opponent. Other all-star cards were Katana (5 drop), Deathstroke, and Great White. At the end of the night, I won 6 packs of cards, a playmat, and EA versions of Batman, Superman, and some plot twist I don’t recall the name of.

Only 1 more month left till PC Indy.

Internet Explorer Versus FireFox Javascript

Wednesday, July 11th, 2007

Terry, a co-worker of mine, sent me an interesting e-mail last night. He did some speed tests on a javascript sorting function we use in our programs. I’ll just post the contents of his email:

Although it seems to be “conventional wisdom” on the Internet that Internet Explorer executes Javascript inefficiently versus the Mozilla/FireFox family of browsers, I decided to run a direct comparison test of the two.

The rules were as follows:

1) All Sales Report HTML Table rows were populated.

2) Javascript code is heavily optimized, and object references are minimized using globals where appropriate.

3) FireFox version 2.0.0.4 used.

4) Internet Explorer 6.0.290 used.

5) VendWatch as it currently exists, was utilized as the basis for the tests.

Results were as follows:

BROWSER

Row Count

DATE Data

STRING Data

NUMERIC Data

FireFox

365

2.703 secs

1.015 secs

1.188 secs

Internet Explorer

365

6.454 secs

3.047 secs

4.875

FireFox

100

0.516 secs

0.266 secs

0.234 secs

Internet Explorer

100

1.078 secs

0.469 secs

0.890 secs

FireFox

999

8.984 secs

3.531 secs

3.063 secs

Internet Explorer

999

31.578 secs

15.734 secs

24.031 secs

As can be seen above, Internet Explorer was consistently considerably slower than FireFox. Keep in mind that the performance timing is only counting time while the sorting logic was running and was not counting anything else. The goal was to keep the timing as close to what a user would see as possible.

 

Obviously the conventional wisdom is 100% accurate as regards Internet Explorer, and although it might have been interesting to have included IE7.x in the above tests ( due to Microsoft insistence that they have “improved” javascript performance ), it is obviously so much more preferable to be running FireFox that I just did not bother to do so !

 

Another strike against IE.

Where did the Weekend Go?

Monday, July 9th, 2007

Working over the weekend because the company you work for fails at planning sucks. At least I was able to catch the men’s Wimbledon finals and the UFC. Federer vs. Nadal is really shaping up to be a great rivalry. I honestly thought Nadal was going to pull it off during that 4th set, and I still think he would have won if he didn’t injure his knee. He was looking dominant, Federer frustrated. Then he had to take that break to get his knee looked at, and things turned around. He probably would have still been able to battle back and beat anyone else in the world, but Federer is just too good.

The UFC 73 was pretty good. Here’s a quick breakdown of the matches

Herring vs Nogueira - Herring fought to the best of his ability (read- not on par with Nogueira), with the exception of the last 30 seconds of round 1 and the first two minutes of round 2. He scored a great headkick, all he had to do was keep the pressure on, and he would walk away the victor. I was actually a little surprised the ref didn’t stop it anyway, Nogueira was barely able to stand.

Sherk vs Franca - This happened almost exactly as I though it would. Sherk took Frana down at will, established position, and used his GnP. Franca got a couple of big random shots, but it wasn’t enough. That ju-jitsu that he was always bragging about did nothing for him.

Evans vs Ortiz - I thought this one looked pretty bad on paper. Both of them are mediocre strikers and both good wrestlers, but not great with submissions. A lot of time was spent trying to get a takedown that just wasn’t there. Once a fighter was able to score a takedown, the other was able to get it back to his feet. Then they would trade shots, no bombs, just enough to mix things up. During the 3rd round, Ortiz looked tired, Evans looked fresh. I think if it would have been a title match, Evans would probably been able to push the pace in rounds 4 and 5 for a win.

Marquardt vs Silva - I picked Marquardt to win this, because in Silva’s last fight, he had zero takedown defense. Marquardt is coming off a win over Dean Lister, who has way better submission skills than Silva, so he should be safe on the ground. He just needed to avoid Silva’s pinpoint accurate striking. Unfortunately, he couldn’t do that. Every shot Silva threw counted, and he won easily in round 1.

Florian vs Robinson - Robinson pushed the pace early, Florian weathered the storm, waited for a mistake, then got on top and won easily. The question is, what’s next for Florian? After watching Sherk completely destroy Franca, does Florian really have a chance? He already lost in their first match, I can’t see the second going any different.

Primer

Thursday, July 5th, 2007

Yesterday I watched the the movie Primer. Twice. And I still didn’t fully understand what was going on. To be fair, the first time I was playing Warcraft as I watched, so I wasn’t giving it my full attention. As the movie started to get really confusing, I had to stop it, because I couldn’t follow what was happening. Even when I watched with no distractions, I wasn’t sure of all the events as they unfolded. Apparently some people don’t like the idea of trying to puzzle out the plot of a movie, because it only has a 6.8 rating on IMDB. I loved it, I give it at least 9/10.

The movie revolves around two guys who invent a time machine on accident. The writer makes no attempt to hold back on the tech speak, and no attempt to make sure you understand what is happening. Instead, we are taken on a ride following these two guys who are scheming to make money playing the stock market. At one point in the movie, a guy accidentally (or is it an accident?) brings his cell phone back in time with him. It rings, and at that moment, you realize something is terribly wrong. What happens when two exact copies of a cell phone exist at a given moment in time? Will they both ring? If he answers, and the other guy misses the call, what will that change? Or is his phone even ringing at all, now that phone #2 is ringing?

The paradox of going back in time to change something became very real at that moment, and then the movie takes a real turn, as many of events you have already seen are told in flashback. You see a lot of what we had already seen take place again from a different perspective (from the perspective of the guy who went back in time). The question becomes, did they happen that way the first time through, or is it actually different this time. Is there only 1 timeline, or, by going back in time, are we actually creating a completely different timeline.

Today I had to go read on Wikipedia several theories on what actually happened in the movie, and I am enthralled. When I get home I’m watching the whole thing over again. Watching the same movie 3 times in 2 days? That’s a record for me.

Shogun to Fight in UFC this September

Tuesday, July 3rd, 2007

According to SI, Shogun is coming to the UFC. If you don’t know who Shogun is, watch this highlight video. The guy has amazing talent, a very aggressive style, and goes full blast through the whole fight. All combine to one of the most exciting fighters to watch, so I can’t wait. He’ll be the lightweight champ by Superbowl Sunday, so long as he finds a way to incorporate a sledge hammer into his training routine.

Zend Framework 1.0

Monday, July 2nd, 2007

Andi Gutman reports that Zend Framework 1.0 was released to day. While I really like their approach to a Framework (take only what you need and ignore the rest), not having a good tutorial is really hurting them. An in depth reference guide just does not cut it in the Google age. A few months back, we started on a new project at work, and we had to decide between using a MVC framework or writing our own framework, so I downloaded several to try out. Zend was one of the one of the toughest to get up and running from scratch, purely because of the lack of some type of quick start guide or tutorial. When evaluating a framework, I don’t want to spend several days learning the ins and outs of how everything works, I just want to get the basic feel of it in a matter of hours.

For the curious, I ended up recommending CakePHP for the project. In the end, however, I was voted down in favor of simply throwing our hodgepodge of code together. Welcome to 2008 people. Even getting my coworkers to use a template engine like Smarty was like pulling teeth. Two months in, I think they are finally starting to understand the benefits of well structured code, at least I can sleep knowing I’m doing some good around here.