Recent Blog Posts
Blogs ยป Archive for January, 2006
Track Your Hacks with CVS
The following is republished from the Tech Times #130.
Quite by coincidence, three times in the past week I have had to hack the code of some open source software that went into the site I was working on. First I had to modify phpBB to include an embedded calendar on the home page of a private forum I administer. Next I made some custom tweaks to the code of the K2 theme for Wordpress. Finally, I had to hack phpAdsNew to produce XHTML Strict output.
In each case, the hack required me to actually modify the code of the software. Obviously I prefer not to do this, because when the next release comes along the updated files will overwrite my hacks, and I’ll need to implement them all over again.
Normally I’d just document my hacks someplace and grumble about the lack of customization features in the software, but three times in a week was too much. Let me show you how I solved the problem using a common development tool in an unconventional way!
CVS (Concurrent Versions System) is a system for tracking changes made to files in a project over time, potentially by multiple developers, each working on his or her …
A simple way to eliminate many payment hassles
In the last blog entry, I parenthetically noted that I send electronic links to clients for credit card payments. It’s worth a separate post to discuss this tactic.
If you are like me, you hate anything not related to directly serving clients. And collecting payments is probably one of the biggest hassles.
So I’ve set up my online shopping cart (using www.1shoppingcart.com) to collect payments from clients. Once a client gives me the go ahead, I send them a link for payment. If we agree to 3 installments of $1500, I set up a special product for them so that they pay up front and are automatically billed every 30 days for 2 additional cycles.
The benefits are clear:
- No more sending out invoices and stressing over when you will receive payment.
- Immediate payment.
- Automatic payment.
- You can get paid as soon as a client gives you the go ahead, so you don’t have to worry about “buyer’s remorse” or something coming up.
- I even charge some clients the 2% or 2.5% credit card processing fee, and they don’t mind as this process saves them time, too.
This doesn’t work with all clients. Some large organizations like universities don’t give their faculty …
Javascript Inheritance
Searching Google for “Javascript Inheritance” returns some interesting but, IMO, also frustrating results such as Douglas Crockford’s various takes in Classical Inheritance in JavaScript or Kevin Lindsey’s approach, the former not really providing a clear answer while the latter relies on the convention of attaching a “superclass” property to your objects and effectively requires glueing your objects together for each instance you create.
Meanwhile libraries like prototype and MochKit have evolved their own conventions and strategies which you may or not may not appreciate. I’m grumpy in each case . prototype, despite having some very cool code in it, extends built-in Javascript types like Object which I don’t appreciate - makes me nervous about mixing in other Javascript libraries from other sources. Meanwhile looking at MochKit (which may be the best AJAX implementation out there, having made good reference to twisted) suffers from the kind of smartness summarized here, when it comes to it’s “Base”.
An Alternative
There is another way which probably gives you most of what you expect if you’re coming from a language like Java (ooops - can’t seem to stop it ;)). This is thanks to Troels Knak-Nielsen (author of indite - the realtime validating wysiwyg widget) who told …
Apple “photocasting” Mac only, uses invalid RSS
(via Dave Winer) Apple’s newly-released iPhoto 6 does an admirable job of making it easy for its users to publish feeds of their photos from their desktop. When Steve Jobs announced the product, he cited its use of “industry standard” RSS technology to make this posssible.
This all sounds great until you try to visit a photocasting feed in a browser other than Safari, or subscribe using a feed reader other than NetNewsWire. The site detects that you’re not using a photocast-capable client and displays an HTML page asking you to use Safari instead.
The error page in question also provides a direct link to the RSS feed for the photocast. If you know your XML, check out this browser-viewable sample, and the validation report that points out some of the errors it contains. The feed validator misses further errors to do with nonstandard tags that have not been marked as such with the apple-wallpapers: namespace prefix. Update: The validator has been updated to catch these errors.
The long and short of it is that Apple’s new iPhoto 6 produces invalid RSS that most feed readers will be unable to process. In order to hide this fact, Apple has put up the equivalent …
CSS On/Images Off
Following on from yesterday’s logo placement discussion — a few people quite rightly mentioned the simplicity of placing the logo using an IMG tag within H1 tags. There’s no doubt there’s a lot to be said for this method, and there’s a good reason why it is the current standard. However it might be worth noting that it may not be quite a robust as you may think.
Take the ‘CSS On /Images Off’ situation that many low-bandwidth users prefer. As a developer sitting on the end of a cable, it’s easy to scoff at this scenario, but if you’re:
- Paying a premium rate to browse through your web phone, or
- Living in an area where you don’t have effective access to broadband
– it’s not such a radical prospect. In fact, I seem to remember even Roger Johannson Johansson of 456 Berea St mentioning recently that he still only has access to dial-up in his area.
It’s fair to say that both current versions of Firefox and Opera do a great job at scaling and even coloring the ALT text to the H1’s styling if you block the images.
However, IE renders a …
The case of the disappearing client
A client of mine was hot and heavy to move forward with an engagement last month. He paid me 50% upfront right away (BTW — I am more than willing to give up credit card fees to send an electronic link to clients for upfront payment; many times, clients will even pay 2% more than the engagement price to cover these fees and get me started right away.), and I have been delivering ever since.
Then, suddenly, he disappeared. I sent stuff, and heard nothing back. He didn’t return my calls. I delivered a set of brochures he needed for an urgent meeting, for which he had to review proofs at the printer, and I heard nothing.
Friday I called again and the receptionist said he was at a meeting. He didn’t return my calls.
So today I sent an email with more deliverables saying I couldn’t do more unless he was more responsive, that I enjoyed working with him, but the relationship had to be a two-way street.
In my mind, I was thinking, “He hates my work and is going to fire me. Or his company has changed course. Or he found someone less expensive. Or something really bad happened when my …
Design Patterns in Dynamic Programming
Via reddit (great site if you suffer attention defecit): Design Patterns in Dynamic Programming by Peter Norvig (Director Research at Google).
In slide form it’s somewhat tricky to extract anything more than the gist of what’s being said but there’s some really interesting stuff here. It’s perhaps easiest to understand in context of this old but (unusually) insightful post on /.;
The dirty unacknowledged secret of design patterns is that they’re strongly coupled to a language. For example, switching from a statically typed language like Java to a dynamic one with forwarding substantially changes the approach to Factory, Proxy, Singleton, Observer and others. In fact, they’re often rendered trivial.
This is the first serious attempt I’ve seen to identify patterns specific to dynamic languages and found myself nodding. For example Partial Evaluation [slide 1] and slide 2;
Intent: Write literate code, compile to efficient code
A prime example of that in PHP would be WACT’s template components which turn declarative template tags into “runtime” PHP spaghetti (that you don’t need to care about). Believe this is also a big selling point in Rails, which has made good use of Ruby’s macro capabilies for stuff like defining object relationships in active records - by way of …
Google’s Insider View As a Domain Registrar
Nick Wilsdon has posted an interesting blog post about just what Google knows as a Domain Name Registrar (which it became in Feb 2005):
believe Google has built or is building a tool to analyse domain names. The API access they were given as a Registrar allows them to carry out the level of automated queries they needed for this. I would also go further and suggest this tool is building up a historical picture of each domain through regular scraping of their WHOIS records.
Read the rest of Nick’s blog post.
The sysadmin view on “Why PHP”
A funny from the Python crowd: phpfilter - PHP “support” under CherryPy. There is a serious side to that though - it’s spitting out something that looks like a PHP parse error - i.e. this is a developer problem (e.g. someone ftp’d a PHP straight onto their live web server for “testing”), not a runtime error.
More to the point, when was the last time you saw a PHP runtime error take down an entire application or web server? And no - “MySQL Connection Failed: Can’t connect to local MySQL server” doesn’t count - PHP and the web server are still running - the MySQL server (or otherwise) is to blame.
With PHP it’s very hard for a script to take down the runtime environment - the web server - I’d argue that you’d have to be deliberately trying to do so, perhaps filling up disk space or otherwise. Innocent mistakes, specific instances of runtime problems (e.g. script execution too long) and bugs remain local to specific requests and the PHP script handling them. On the next request, we begin again from scratch.
It may now be reasonable to claim that Apache + mod_php has served more HTTP requests for dynamic pages than …
Let the game come to you
I remember when Michael Jordan and Larry Bird were at their peak, people used to say that “the game came to them.”
They did less to get great results. Somehow they could read the court and respond to the situation, while also creating new situations.
I hope you are doing the same with your marketing. Having “the game come to you” in marketing means:
- Customers contact you, so you don’t have to chase them.
- You are known as the go-to professional in your marketplace.
- When you do reach out to prospects, they see your value and are happy to speak with you.
That’s the opposite of most marketing strategies, where you feel like you are working too hard for too little in the way of results.
How do you get the game to come to you?
- Get visible with educational and informational pieces (speeches, articles, research).
- Develop and nurture proactive referral networks and systems.
- Describe your business in ways that set you apart as having a specific edge (and have raving clients do the same on your behalf).
I like writing for Sitepoint because the range of reader experience is so broad. Some of you understand the above intellectually, but haven’t experienced …
Sponsored Links
SitePoint Marketplace
Buy and sell Websites, templates, domain names, hosting, graphics and more.
Download sample chapters of any of our popular books.



