Smoking toooooo much PHP
Tuesday 31 May 2005
I finally got round to packaging up the XUL based Subversion browser, so you can try it out on your own servers.. The first release effort is here : FlexySvn-0.1Dependancies / Installation Instructions. - PHP5 (5.0.4 or CVS snapshot) (I might try doing a PHP4 version later.. - but you can always reverse proxy and run PHP5+apache2 on another port..)
- The svn extension
#pecl install -f svn
- The colorer library and extension
Download and build the colorer library Colorer-take5-linux.beta4.tar.bz2 (good ole ./configure;make;make install;) Then install the colorer extension:
#pecl install -f colorer
- Download the tarball, and 'tar xvzf' into your web folder.
- copy svn.php to index.php (so your config/bootstrap file will not be overwritten if I ever release another version)
- edit the index.php - it's commented and pretty simple..
- Visit the url (and hope it works)
The test machine I did all this on unfortunatly had alot of problems with apache2/php5 head and 5.0.4, Basically it segfaulted with all php calls.. - this was fixed with a small horrible hack, Feel free to add comments to this post if you come across problems or email me fixes if you can think of any.. Note:Apache must be configured with AcceptPathInfo On And PHP must be configured with magic_quotes_gpc=Off This can be done in a .htaccess file if necessary.
Saturday 28 May 2005
The highlight of this week was Sean's post describing how to use a Firefox extension to hide posts on planet-php, While I dont really agree with him that the ability to hide stuff is usefull (There's a scroll button on the right of the browser baby...!), It would far better if it would replace the current moronic acronyms being used by the PHP community... AJAX = "using XMLhttpRequest" Rest = "using Plain old POST and GET!" It's become like reading badly written code. The author makes up short names for everything, then 3 years later, it's gone out of fashion, and no-one has a clue what they where talking about (I clean floors with Ajax!) I've been using XMLhttpRequest for quite a while with Plain old POST and GET to send and receive data for XUL applications. Ocassionally this spreads back to plain old HTML, doing things like auto address filling, postcode retreival. In comparison to the complexity of SOAP or XMLRPC, 95% of web calls do nothing more than send some data, and recieve some data.. = which amazingly enough is what POST and GET do... Sending data via a standard HTTP request, just like a HTML form does, involves libraries which are much smaller than SOAP/XMLRPC.. and receiving data back can be flexible, a simple function may return a number or ERROR:......, a more compex one a simple XML document... - the great thing about these solutions is they are a breeze to debug.. - no more hunting down why SOAP types dont match on your client and app server... Unfortunatly, As I have so painfully found, Javascript on IE is practically unusable, a place where undocumented, unexpected behaviour rules! (hint: try grabbing and setting the class name of a html element). This unfortunatly relegates using XMLhttpRequest to nothing more than 'pretty add-ons', unless you are prepared to invest a considerable amount of time working around IE's bugs. Often it's easier to go the simpler route, and Ban IE. This week also brought up an interesting discussion at the office, on XUL and IE. I suggested that during the porting of some of the ASP(.net) applications to PHP, we also migrated them from (IE)HTML to XUL. This did bring up some questions like - what if the user is in an internet cafe and needs to use the applications?
- do they have to install Firefox?
In reality they are ridiculous questions, Say bye-bye to security if you expect people to use them from an internet cafe... (even though Firefox has had a few minor security issues, none have been actively exploited yet, unlike it's competion.) So introducing Firefox to an office saves time, not adds it.. I also saw that someone had written a XUL ActiveX component for IE.. (so there is potential for the mentally challenged corporate types..) But it did bring me on to thinking, that there are still some sites out there that only work in IE!, ( HKMC is my latest example of idiots in Hong Kong = click the Check your eligabilty button). So why not start creating Mozilla only sites (preferably using XUL).. If the big names = planet-php / artima / etc. stopped supporting plain old HTML, IE would dissapear to a final and well deserved death... (and given a 15 year track record, I'd be amazed if IE7 was any better). So beware, this blog may turn XUL only one day....... on our murder IE campaign....
Sunday 15 May 2005
Hell seems nicer than the eternal hunt for reasonable housing at an affordable price. Last week we went up to Island resort, (about 45minutes from the center of Hong Kong CBD, which may prove to be too far..) to look at flats. For a change, we saw something that looked really good (incredible sea view, nice clubhouse/pool etc.), the meager ~1011sqft, actually looked like that figure. Unlike Sam Wan Towers (south side of Hong Kong Island), that says it was ~1000sqft, but looked alot more like 7-800. The big trouble comes from cost..., for these tiny apartments, which we could just about squeeze everyone in, along with 10 years worth of collected crap. We would have to fork out HK$7 million dollars (or pretty close to US$1million).. Well, like most people we are not rolling cash, so morgageing that kind of property works out at around HK$25-30,0000/month (US$3-4000), leaving out the issue that interest rates may rise soon, pushing that monthly figure even higher. (which was already over budget!) So this weekend we sat down with an estate agent near our current house. and informed him of our requirements.... Cluesticks for estate agents - Dont tell us how difficult our requirements are and how crap the properties are going to be.
- Dont tell us, we must buy now as the market is going up.. (and dont bother arguing/discussing with the us, if we dont believe you) Do you think we take advice from someone who has a vested interest in saying that? It's just downright annoying
- Dont tell us about the area, if we already live there!
- When we say that we have certain requirements, dont ignore them... even so you can show us round places..
- If we found prices on the internet for properties, listed them out and asked to see them, even though they may be wrong!, show us the buildings we wanted to see...!!! (just let us know that on your books they are for XXX)
I actually asked my wife to avoid speaking cantonese to the agent to see if the blabbered on so much in english.. They do, and apparently it's the same rubbish.! Anyone living in a civilized country (definatly not asia's world shoebox), would have been amazed at the flats we where dragged round to. Swinging cat's would be a miracle, and the fact the only view from your living room window is your neighbours bathroom, is classed as 'open view', does make you wonder if there's more to life... It was not all bad, I did see one I liked, but let's just say my better half did not approve of the idea of renovating it.. (at least we could see the sea from the lounge.) It will be interesting to see where all this is going, as for the first time in 10years, we actually have a budget for this, just have no idea if property prices are in a mini-bubble at present, or is just holding steady prior to the climb....
Tuesday 10 May 2005
As things have been getting busier here, I've started partnering up with a friend to provide better service to my consulting clients. It already has quite a few benefits - A nice desk in an office, use of all the usual office facilities.
- Other programmers to bounce ideas off of, (rather than just irc...)
- Possibility to offer bigger projects, or charge more ;)
- I can farm out alot of the re-installing, virus cleaning, PITA Windows jobs..
You can see more about my partners at their web site: www.qsolutions.hk.com, while mainly a MS/ASP/.NET shop, part of my involvement is to raise their skills and knowledge of Linux and PHP. Along with helping out on the linux based on-site maintenance. (and maybe remove the flash movie from their splash page.) As part of this move, I really need to build a proper desktop workstation. The easy bit of which is deciding to go for 2 19" monitors, as having started using dual monitors, I would never return to single ones for developing. But the bigger problem comes with deciding the machine architecture. Starting with the extensive range of motherboards, with weird and wonderfull built in hardware. I need to work out how compatible the one I chose will be. Then there is the other big choice, to 64bit or not... These are some random thoughts the matter - Is there a huge difference of speed in the AMD64 (I know it's a bit faster, but is it huge enought to compensate for the other issues)?
- Is running AMD64 as a 32bit system going to be less painfull (no chroot enviroment for open office etc.)?, or does this just defy the point... (although the thought of firefox64 not running flash is quite attractive - visting www.hkgolden.com to see why..)
- I was concerned about having to upgrade to 2.6 kernels, but it looks like someone fixed davfs2 for 2.6 (which I critically depend on.)
- Is it worth trying out gentoo or are the debian-amd64 packages fast enough?, or is it going to be as annoying as freebsd?, long install times, no synaptic? (I guess it wont have gnome cvs build nightmares like freebsd.. - autoconf tools for gnome doesnt work correctly on it.) - does it solve the open office issues..
- how well sync'd is debian's amd64 port, the sparc64 install I've done seems a little outdated at times, compared with the intel boxes..
The motherboard choice is even more confusing, this gives you an idea of costs and availability of hardware in Hong Kong and I managed to find a debian motherboard compatibility list, although It looks like one of those 'trying to hit a moving target' tasks, as the list of available motherboards changes every month.. I suspect either an Abit or a Gigabyte might be the way to go, as they are pretty common here, but I'm totally confused about the motherboard graphics card integration, - It looks like the onboard graphics card is going to be useless for dual head dvi monitors. So I probably need a nVidia professional, but even that decission looks complex.. Such a pain the backside picking all this stuff, I kind of wish someone would do all the deciding for me, and deliver it at my door. But unfortunatly since I'm one of the better linux experts in Hong Kong, that doesnt leave the door open to finding anyone who could do this properly.... And if started offering this service (it's unfortunatly pretty easy for the competition to copy ...) - mind you, if you do want a custom linux box designed and delivered in Hong Kong.. give me a call, and I'll quote a consulting fee to design it.. The hardwares probably less than HK$5K, so comparing that to a baddly spec'd dell box, theres still a saving of at least HK$7K in fees' for designing the bugger..
Wednesday 4 May 2005
As I mentioned in the update to my last post about the svn bindings for php, Wez has gone off like a rocket adding almost every feature under the sun to the extension. Authentication, repository creation, diff's etc. all appear to be working. So in another fit of itch scratching, I started hacking on a Subversion browser, using the bindings to blow away the rather staid and dull efforts that have gone before... With a little XUL magic, and some clever tricks with xmlhttprequest, I threw most of the interface and application together in 2 evenings, Proving what I always suspected, XUL/JS/PHP is going to be a pretty hard combo to beat in terms of rapid development, and delivery. It has a large feature set already, and probably does as much, if not more, that most of the alternatives out there. FlexySvn is still being hacked at, although you should be able to get an idea of how it works from looking at the XUL Template, and the Page's action class. A downloadable version should be available after I go back and make a few tweaks to the svn bindings so the return values are more sensible. eg. using common names for log and ls details like - rev = the revision
- time = a unix utime() number
- datetime = a iso short formated version of the time (eg. 2001-01-01 10:30:12)
- author (rather than modified_by or other names.)
- ... others.. that need some thought....
The one major missing feature at present is the Edit page, which initially started off with the idea of using the HTML editor code from my web site, and webdav javascript posting to save. However, I have started pondering if writing a mozilla pluggin to use scintilla might be quite cute. This is apparently something like what Komodo does. The only drawback is that the documentation on how to build mozilla plugins on unix, are a little thin on the ground. My limited research indicated that using the build scripts from plugger and some of the code from the mozilla pluggin SDK might be the way to go, but then you have to start wondering, if you make the browser an editor, what happens when you accidentally write a neverending loop in javascript.. and render it on another window, - It will crash your editor?!... oops.
|