Entries
Filters: Sorted by date
Label elements
Peter Van Djick asks why does hardly anyone use LABEL tags?
It’s a very good question—in my opinion label tags, like title attributes on links, are a complete no-brainer. They’re well supported by all modern browsers, completely backwards compatible (in that there are no ill effects for older browsers), great for accessibility and easy to implement. They’re much more than just an accessibility issue—the usability of a form is dramatically increased by the addition of label tags, especially for radio and check boxes where they greatly increase the “target area” for the user to click on.
Validity would be nice
In-Valids is an enjoyable rant by Joe Clark chastising the big guys on the web for being completely incapable of producing valid HTML.
Nice titles
Stuart has posted yet another inobtrusive DHTML gem—Nice Titles, inspired by a thread on web graphics.
pngcrush
Mark invoked the lazy web earlier today in a bid to find a good way of bulk optimizing PNG files. Several people recommended pngcrush in the comments and it sounds like a fantastically useful piece of software—apparently it can run 114 different lossless compression methods on an image and automatically chose the most efficient one.
Hashing client-side data
Via Scott, a clever PHP technique for ensuring data sent to the browser as a cookie or hidden form variable isn’t tampered with by the user:
[... 248 words]Image Drag bookmarklet
I got a good response to yesterday’s call for help on finding an HTML element’s co-ordinates on a page. I ended up using PPK’s findPos functions which seemed to do the trick just fine.
[... 338 words]Help needed
Does anyone know if it is possible to find an HTML element’s exact position on the page (in terms of pixels-from-the-top and pixels-from-the-left) using javascript? The element I have in mind is an image that has not had any positioning applied to it, but I imagine any solution will work for other elements as well. I need something that works in Mozilla/Phoenix, although a solution for IE would be nice as well. It’s for a bookmarklet I’m thinking of writing.
Real girls eat beef
Cool-2B-Real is a site for teenage girls. Real girls are “keepin’ it real” by building strong bodies and strong minds... and they’re feeling great about themselves!
It has health and fitness tips, tips on feeling good about yourself, a poll (“What type of beef do you most like to eat with your friends?”), and a set of Smart Snackin’ recipes such as Nacho Beef Dip, Beef on Bamboo, Easy Beef Chili and Roast Beef and Veggie Wrap. And beef games too.
Meetup needs work
It looks like Scott got burned by a PHP MeetUp arranged at an out of business restaurant that then failed to materialise at all. From his comments it seems like he’s not the only person to hit problems. I have yet to attend a meetup (the Bristol UK ones rarely have anyone sign up for them) but I love the concept, so it’s a real shame to hear about problems like this. Hopefully the MeetUp team are working on ways to stop this kind of thing from happening—some kind of short-lived email mailing list for each location/event might go some way to ensuring people who sign up for them know what’s going on and bother to show up. At least their recent changes page shows that they have been actively trying to improve the overall experience.
A better phoenix icon
And over on Blogzilla, Lim Chee Aun has finally solved the niggling bug with Phoenix 0.5 on Windows where the icon shown in the taskbar is an ugly default Windows image.
Better mouse gestures
Optimoz have released Version 0.3.5 Release Candidate 3 of their mouse gestures add-on for Mozilla based browsers. I hadn’t tried the version 0.3.5 series before and the improvements are impressive to say the least:
[... 171 words]Enhanced textareas
Via Leonard Lin, a nice demonstration of an enhanced HTML text area (with buttons to add tags) that works in IE, Mozilla and Phoenix. Until recently this had not been possible thanks to a long standing Mozilla bug.
More YAML
Paul Tchistopolskii’s XML Alternatives reminded me to take another look at YAML. The specification has been updated since I last looked and seems to be a bit more complicated, but it’s still a very nicely designed format. Implementations are available for Perl, Python and Ruby with C and Java on the way but strangely no one seems to be doing one for PHP yet. I’m doing a course at Uni on compilers at the moment which includes quite a lot of stuff about writing parsers so I’m very tempted to have a go at a YAML implementation in the next few weeks just to try stuff out. The possibility of easily swapping relatively complex data structures between PHP and Python is pretty tempting as well.
The slashdot effect
Dave Winer asks why Joel Spolsky gets much more traffic when slashdotted than UserLand’s hosted sites tend to. Joel explains (it’s all down to network effects) and mpt kicks in a few ideas as well.
Zeldman and definition lists
I’m really liking Jeffrey Zeldman’s latest redesign. Aside from a pretty face, the markup holds some interesting ideas as well. For example, I’ve never seen a definition list used for a blogroll style list before:
[... 194 words]More on screen scraping
In response to yesterday’s screen scraping post, Richard Jones describes a screen scraping technique that uses PyWebPwerf, a Python performance measuring tool.
[... 80 words]Vellum on Windows
Via Paul Freeman, detailed instructions for installing Stuart’s Vellum Python blogging system on Windows using either IIS or Apache.
Mechanize the web
Via Keith Devens, Screen-scraping with WWW::Mechanize describes how Perl’s WWW::Mechanize module can be used to grab information from sites that require a user login. I’ve always dismissed screen scraping as something of a wasted effort, given the fact that a major rewrite of the scraper is required whenever the target site tweaks its HTML. This article has encouraged me to reconsider—some of the functionality in WWW::Mechanise is fantastic:
Python bits and bobs
Two fun bits from the Daily Python URL today (still without permalinks). SQLObject is an object-relational mapper class which can create objects that directly map to rows in a relational database, making INSERTs and UPDATEs much simpler. I’ve tried to write this kind of thing in PHP before with mixed results, so I’m quite tempted to pinch the idea of tracking foreign keys and joins for my next attempt. More immediately useful however is rlcompleter2 which adds tab based auto completion to the Python interactive prompt. I had a play with it earlier and it was definitely an improvement on the vanilla command line.
Switched
I never thought I’d actually do it, but I’ve switched. Not to one of these (I only wish I could afford it), but to Mandrake 9. The way I figured it I only ever use Windows 98 for browsing the web, editing text files and messing around with Python, so I might as well get stuck in to a more exciting operating system with the same capabilities.
[... 238 words]Mmm... pie
Weebl and Bob like pie. I also like pie. Luckily for me, my girlfriend, while frequently a disaster in the kitchen (rice and OXO gravy anyone?), is a truly accomplished pie chef as of last night. She has posted her delectable recipe here. Her chocolate chip cookies are even better.
More markovers
Other weblogs.com remakes: (via Scripting News): Gary Taylor, Dave Polaschek, Douglas Bowman. Doug’s is particularly impressive, featuring an almost pixel perfect recreation of the original page with nice semantic markup and nods towards accessibility as well.
Weblogs.com table using floats
I’ve knocked up another attempt at Weblogs.com in CSS, this time using floats instead of absolute/relative positioning. It seems to work pretty well.
K5 text ads
Via Inluminent, a short Q&Awith Rusty of K5 discussing the site’s innovative new text-ads-with-comments format.
[... 335 words]Weblogs markover
Also, I know it isn’t what Dave was after but I’ve recreated the front page of Weblogs.com in structural/semantic XHTML and CSS as well. Again, it works fine in Phoenix and IE 6 but probably needs a few tweaks for other modern browsers (and Netscape 4 gets a plain layout without any styles at all). I’ve actually got quite a large collection of “markovers” now—I started doing them last year while learning CSS and they have been accumulating ever since. One of these days I plan to put them online together with a basic overview of the techniques used and problems encountered with each one.
Dynamic Python class methods
Dynamically extending APIs: Mark Pilgrim demonstrates how Python’s “new” module can be used to dynamically add new methods to existing classes at run time, and shows how this can be used to increase productivity when parsing XML. I’ve long been impressed with Python’s ability to add new methods to an object at runtime just by assigning a function reference to an object property but I had no idea it was possible to do this with classes as well. If you liked that tip, Dive Into Python has in depth explanations of more obscure Python features than you can shake a stick at.
Work safe CSS
Here’s a novel use of a stylesheet switcher: Providing a “work safe” edition of a weblog.
Letter to the editor spam
Scott is horrified by the fact that some American political organisations are co-ordinating massive “letter to the editor” campaigns using email lists and websites. It’s certainly a worrying trend, but once again Google comes to the rescue. Try this query and see for yourself.