May 2nd, 2009
Zend_Search_Lucene is a good way to get search into a site relatively quickly. It’s based on Apache’s Lucene search and it’s a free alternative to getting a google applicance or something like that. One thing it’s lacked for a long time was the ability to search multiple indices (though Apache Lucene supported this Zend_Search_Lucene didn’t). In the release of ZF 1.8 it’s pointed out that this feature was now availble but I was unable to find any mention of how to use it in the document (at the time of this writing). After some detective work I found something on github that lead me to the code in the library that lead me to undertand how to use this:
require_once 'Zend/Search/Lucene/MultiSearcher.php';
$index = new Zend_Search_Lucene_Interface_MultiSearcher();
$index->addIndex(Zend_Search_Lucene::open('search/index1'));
$index->addIndex(Zend_Search_Lucene::open('search/index2'));
$index->find('someSearchQuery');
NB it doesn’t follow PEAR syntax so won’t work with Zend_Loader::loadClass. I expect there will be more updates to the documentation for this gem.
Posted in PHP, Zend Framework | No Comments »
May 1st, 2009
So years ago (2007) I created a development server using Ubuntu Feisty Fawn. At the time i thought nothing of it until recently when I couldn’t use aptitude to install stuff and after doing some research found out that Feisty Fawn is no longer supported. So right off the bat it is recommended that you deploy LTS (long term support) versions of ubuntu on commercial servers. I got hit with a double whammy (the next available LTS version 7.10 was also outdated) so I had to upgrade to 8.04 which despite info on the ubuntu website wasn’t straight forward because of bugs in the different installers. This is really the same info found on the ubuntu website
- You have to upgrade to 7.10 then from there upgrade to 8.04 so download the alternate version of Gutsy release (http://old-releases.ubuntu.com/releases/gutsy/) and burn to a cd because network install is no longer available for this release.
- Next you need to ensure you have the latest feisty fawn stuff installed. Comment out the repos in your current /etc/apt/sources.list and add
deb http://old-releases.ubuntu.com/ubuntu/ feisty main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ feisty-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ feisty-security main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ feisty-backports main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ feisty-backports main/debian-installer
deb-src http://old-releases.ubuntu.com/ubuntu/ feisty-backports main restricted universe multiverse
And then run sudo apt-get update && sudo apt-get dist-upgrade
- Comment out all the lines in /etc/apt/sources.list again and now we’re going to add the cd that we created earlier to that sources.list. To do this do sudo apt-cdrom add /media/cdrom0 and follow the instructions (they basically say insert the cd and it does it’s thing)
- Now do sudo apt-get dist-upgrade and the upgrade should work. Once you’ve managed to upgrade to 7.10 (now defunct LTS version) you can make you way to the most recent LTS version at the time of this writing (8.04) by doing another sudo do-release-upgrade
You may/may not have php problems (if you had that installed) because the suhosin patch is installed by default in this version. See this post for help with getting a non-suhosin version of php installed.
Posted in ubuntu | 1 Comment »
April 25th, 2009
So I was at the bar with co workers friday and flash remoting came up in the discussion. One of the flash developers noted that we never really used flash remoting in our projects and he reasoned because we’re not doing heavy data transfers the need wasn’t there. He went on to say he used it on a project of his and he didn’t see the gain but he thought it was cool and something good to know but he’s not sure why.
I disagree with his point of view in many regards. For one I try to only learn stuff that I perceive will add value to what I do and what I achieve. With the mountain of things I want to do in life there isn’t time to “waste” on something I can’t get value from (that said I do play my fair share of video games, but finger dexterity is important for programmers). I’ve not done so much Flex/Flash stuff in the last year but as one of the leads in our PHP practice I still champion remoting and here is why
1) I liked the idea of remoting not because of the speed gains over xml rpc but because you can pass typed objects between server and application. The idea of passing a User object and being able to use that object in flash without any manual serializing by the developer gave me goose bumps. I’ve not worked with other developers who have cherised that possibility as much as I have but I think that’s really one of the understated benefits of remoting over using xml
2) It’s faster/more efficent that xml when it comes to large datasets
3)I used it once simply because it was binary and slightly harder to hack (yes it’s not a strong point but it worked out. The system was never “breached” and all was well).
It’s a short list but no. 1 is the real reason for this post. Not having to loop through the dataset to convert into my app defined objects is great. Being a PHP dev coming from a flash background I appreciate this more than most I’m coming to realize
Posted in Flash, PHP, Programming | No Comments »
March 30th, 2009
I have been working on integrating Facebook Connect into a corporate website I’ve been working on (yeah i’s not the traditional corporate website). In the very early stage of the project openId was considered and then along came Facebook Connect. As much as I like the idea behind openId theory takes second seat to actual practice. Facebook Connect full fills a lot of the compelling theories openId put forward but with an api that is easy to use and consistent. It’s ubiquity in such a short space of time after release speaks to its virtues and as much as I like the open approach, Facebook nailed it. Still routing for ya openId hope you do better.
Posted in Web design | No Comments »
February 28th, 2009
I am currently working on a major project where the website’s performance is critical to success. All my projects for the last year have used Zend Framework and the mysqli adapter. There are sources on the internet that sing the praises of Mysqli over PDO. I was recently forced to use the pdo adapter (because of a stored procedure issue) so I decided to see what the performance hit was. My experiments were not the most scientific. I simply used Zend Profiler to profile a page (a poor performing one) and looked at execution times of the same page with the Zend Framework Db adapter being the variable. The surprising results are below:
Mysqli:

PDO

I ran the test several times, but the more than 50% execution time reduciton cannot be ingored. I am not sure if it’s because of Zend Framework’s mysqli adapter but despite what other sources indicate it seems that pdo is a good choice for our applications. It should be noted that we use caching heavily in our appilcations so number of requests (where mysqli benchmarks seem to suggest mysqli is superior) may not be a problem.
Posted in PHP, Zend Framework | No Comments »
February 13th, 2009
Geeks everywhere are excited about 1234567890 (unix time) happening today, but not so much mention of 1234554321. To commemorate the event co-workers Jim Williams and Vora Vor put this site together
Posted in Random Technology | No Comments »
December 7th, 2008
I was trying to install a php extension when I read somewhere that said extension won’t work on Ubuntu Hard Heron PHP because it has Suhosin patch installed by default from that version up and that doesn’t play nice with some extensions. After some search I found how to recompile php without Suhosin and I’m going to consolidate the info here.
- Get the php5 source (this puts it in a folder work for cleanliness sake): mkdir work && cd work && apt-get source php5 && cd php5-5.2.4
- Make sure you can build it by doing: sudo apt-get build-dep php5
- Remove suhosin patch: rm debian/patches/suhosin.patch
- nano debian/patches/series
- Remove suhosin.patch line (it’s near the bottom of the file).
- If you never built a debian package before: sudo apt-get install devscripts
- Change version number (DO NOT PUT THE WORD suhosin in the version name): debchange -v 5.2.4-2ubuntu6~customName
- When you get presented with the nano text editor, just type something like “Hopefully removed Suhosin”, and press Ctrl+X and Enter to save.
- Build (this takes a while): debuild
- The .deb packages should be in the folder if done correctly: ls -l ../*.deb
- Quick install: sudo dpkg -i ../*.deb
This recompiled php for me and the extensions and setting that were already installed were untouched.
Posted in PHP, ubuntu | 2 Comments »
November 16th, 2008
I was in love with the idea behind open id and the possibilities. As the title suggests I think there are more cons to using open id than pros. This really came to light after a client requested it and we were looking into integrating it into the site.
Cons
- The implementation is not consistent between publishers. I have experienced problems utillizing yahoo ids with my early experiments which I have written about here
- Including open id support in existing login/registration workflows are less than ideal.
- Can be used for spamming, see t his post http://robrohan.com/2008/10/31/openid-maybe-not-as-cool-as-i-thought/
- The open id is not easier to remember that the usual username/email people are accustomed to.
Pros
- Open Id strives to allow users to maintain one set of authentication credentials that can be used across multiple sites.
- The open id spec accommodates retrieving useful data from an open id provider. This means that if I allow a user to create an account on my site using their open id i can retrieve some information from their id provider like first name, last name which I can use in my system (though no provider I have tested so far does this).
There are probably other pros on the site but I think these two are of particular interest. I don’t think we’ll be including open id in our work just yet because their isn’t much value in it just yet. There is only one site that I think has gotten openId implementation correct
Posted in Programming, Random Technology | 1 Comment »
October 9th, 2008
I’ve been out of the flash world for a little while and been working more in PHP and helping develop Rokkan’s product offerings. While I’ve been knee deep in working with the Zend Framework and cranking out community sites my co worker asked me why was I following the flash blogs. It’s been great to still look in from the outside at the cool progresses that have been made and I’m excited to see two parts of my world sort of collide (Zend Framework and Amfphp ). I recently found myself making a case against using Flex in the tool that we’ve been developing, as I was doing so I realized that being away from Flash for a bit has helped me think more maturely about technology solutions and finding the balance between new techonology and practical solutions. That said I’m waiting for an AIR applications on Android announcement to help get me back knee deep in AIR.
Posted in Random Technology | No Comments »
May 28th, 2008
So when google gears was first announced the spin seemed to be challenging AIR. I never really was interested in google gears because everything I read about it seemed to fall inline with what AIR had to offer (though Adobe collaborated with the gears team to implement sqlite). In the keynote at Google I/O gears piqued my interest when a representative from myspace described how he used Google gears to add full text search to MySpace (though that should be available on the site natively but that’s becides the point). There areas where the web browser simply falls short and going the desktop application route is just overkill. I think gears is a great middle ground and really could work to the benefit of AIR because with great power comes responsibility. As much as I like AIR i am night going to enjoy having 30 AIR apps installed for the different sites I use. I believe a big part of being a good developer is using the right tools for the job.
Posted in Apollo, Google, Tools of the Trade | No Comments »