Recent Blog Posts
Blogs ยป Archive for August, 2006
IE7 RC1 is Here!
Following on the heels of the final IE 7 CSS support & fixes list is the announcement of the release of IE7 RC1.
Open Source Image Archiving: Exif, IPTC, XMP and all that
Related to this hack started taking a serious look at the available standards and Open Source tools for adding meta data to images, in the context of building archives of digital photography. With further prompting from reading this (Hey! MS are adopting someone else’s standard!), dumping some notes…
Photo Archiving: The Golden Rule
Store metadata in the image.
Actually should be more precise about the word metadata here – there are essentially three significant types of metadata when in comes to digital images, when it comes to who created it and where it’s stored.
First; the stuff your digital camera attaches to the image when you take a picture (e.g. camera make, time the picture was taken, exposure etc.), second; meta data you manually add to an image, typically at the time you download images from the camera to your PC (e.g. where the picture was taken, a description, keywords, name of the photographer etc.) and third; “grouping metadata” – how a collection of images relate to each other (e.g. they were all part of a single photo shoot or they are all family pictures). For the purposes of this discussion, the first two types of metadata can be regarded as a …
MS Details IE7 CSS Changes
The SitePoint News Wire returns Monday, but I couldn’t wait to post this link.
Microsoft has provided a detailed list of CSS changes in the upcoming Internet Explorer 7 (the release candidate for which is believed to be imminent).
Timing out and retrying calls to third parties
When calling third parties you want to set them a sensible timeout, and you also might want to make a few attempts before giving up. Here’s a relatively succinct way to accomplish this in Ruby (3 attempts, each with a timeout of 5 seconds):
3.times do
begin
Timeout::timeout(5) do
# Call your third party (for a example, a payment gateway)
end
@success = true
break
rescue Exception
# Try again!
end
end
if @success
# Jump for joy!
end
I’m sure somebody will chime in with an even sexier way…
Making Excel The CarlosAg Way
How to generate excel without resorting to expensive libraries or ugly COM Interop.
The effect of using Rails fragment caching
Rails provides a few caching techniques, one of which is a fragment cache. The fragment cache is a dead-easy way to cache bits of your view.
After checking that your queries are doing sensible things, the next often slowest part of the Rails stack is view rendering, especially if there’s lots of URL generation involved. More often than not you don’t want to cache the entire page as static HTML and bypass Rails altogether, instead, you want to retain the dynamic goodness of a web app and just cache the slow bits.
I recently added fragment caching to the toolmantim.com home page. Before I added fragment caching my production.log looked a little something like this:
Completed in 0.12385 (8 reqs/sec) | Rendering: 0.10077 (81%) | DB: 0.02210 (17%) | 200 OK [http://toolmantim.com/]
After fragment caching 2 parts of the application layout and the body of the home page my production.log looks a little something like this:
Completed in 0.00615 (162 reqs/sec) | Rendering: 0.00583 (94%) | DB: 0.00000 (0%) | 200 OK [http://toolmantim.com/]
A 17 times speed increase in rendering time for the cost of 2 dead-simple cache sweeper models, 4 lines of controller code and 6 lines of view code. I’d say that was …
Need to Launch a Blog? Don’t run PHP? Check out SubText
Need to create a multi-user blogging site? Running ASP.NET? Check out SubText!
Results of your Marketing Survey are here!
http://www.sitepoint.com/examples/downtobusiness/SmallBusinessSurvey06.pdf
The above URL will let you download the Sitepoint Small Business Survey of 2006. Thanks to Sitepoint again for setting this up with me. Let me know your interpretation of the results, and here are some of my observations:
1. The survey respondents are 86% men. Let’s get more women into this field!
2. Respondents are all over the map in terms of years in business. But 61% have been in business for 3 years or more. Despite this experience, 49% are generating less than $50,000 in revenue and 71% are generating less than $100,000. There is lots of opportunity to increase revenues for those who want to! Note that 17% of respondents say that their firm generates over $200,000 in revenue. Why not you?
3. About half of respondents put in 5 hours or less per month for marketing. That may help explain why about half of respondents are earning less than $50,000. YOU HAVE TO MAKE MARKETING A PRIORITY IF YOU WANT TO EARN BIG DOLLARS.
4. Related to the above responses, about 35% of you are somewhat or very comfortable with marketing and sales. That means the majority of you have an opportunity to keep learning about marketing by reading …
Ubuntu Add-Ons with PHP
The family album has been growing and coping with the volume of images, stored under Ubuntu is becoming a problem. With the attitude – “waste time to save time” – started exploring the options for some kind of digital workflow to automate whatever I can or at least keep mouse clicks to a minimum.
One particular problem is adding comments to images; most archiving software (like gthumb) has you store stuff seperately from the images, maintaining their own databases (in the case of gthumb, under ~/.gnome2/gthumb). But I’d rather have comments stay with the image (e.g. using Exif – there are other ways but Exif wins on being widely supported).
Scripting Nautilus
By chance ran into g-scripts and the notion that you can extend Nautilus (the Ubuntu file manager GUI) with your own scripts. In fact there’s a short tutorial here. The examples on g-scripts use bash scripts but figured this was a good opportunity to mis-use PHP.
Zenity
In addition to extending Nautilus, also took advantage of Zenity (I’m running Ubuntu as in Gnome, not Kbuntu), which allows you to pop dialogs out of shell scripts. For example if you run $ zenity –question –text “Feeling …
UTF-8 Email in PHP with eZ Components
One of the subjects I brushed over last week was how you handle UTF-8 in email, because I don’t have a full picture on the best way to solve this. The fundamental problem is summarized nicely on Wikipedia’s discussion of MIME;
The basic Internet e-mail transmission protocol, SMTP, supports only 7-bit ASCII characters [...]. This effectively limits Internet e-mail to messages which, when transmitted, include only the characters sufficient for writing a small number of languages, primarily English. Other languages based on the Latin alphabet typically include diacritics not supported in 7-bit ASCII, meaning text in these languages cannot be correctly represented in basic e-mail.
Part of the problem there is there are different approaches to how you can solve this. Do you send the raw UTF-8 text body encoded as quoted printable or Base64? Alternatively you could convert it to UTF-7? Or would it be easier to send the text as HTML, and use html entities for anything non-ASCII? Does that limit the number of clients that can read the mail? What about encoding of the headers like the subject or sender / receiver names (as in iconv_mime_encode())? There’s plenty of gotchas and clearly more …
Sponsored Links
SitePoint Marketplace
Buy and sell Websites, templates, domain names, hosting, graphics and more.