RSS ? Recent Blog Posts

Blogs » Archive for November, 2007

Dust-Me Selectors Version 2.0

by James Edwards

After many months of toiling in our secret underground laboratories, Dust-Me Selectors Version 2.0 is finally here!

If you’re one of the many people who made suggestions or commented on the original version, you’ll be pleased to know that the new version incorporates everything you asked for and more.

It was quite a challenge to bring all this together, particularly since Mozilla’s documentation is so … er … erratic (in fact for some functionality I had to look in Firefox’s source code just to figure out how it’s done!) But there’s nothing like a challenge to exercise the mind, and I think you’ll agree that the final result is well worth the gritty struggle.

To summarise the new features:

  • New spidering capability — it can spider either a Sitemap XML file, or an HTML sitemap (ie. it will spider one link deep from any page).
  • Shows which selectors have been used, as well as unused.
  • Data storage has been taken out of the preferences system and into the filesystem — data is stored in JSON files in a user-selectable
    folder.
  • Better support for Conditional Comments — it can now recognise any number of stylesheets within a single comment.
  • Extended automation so it can re-parse a page automatically whenever the …
 

Vector Magic: Stanford’s AutoTracer Bullet

by Alex Walker

The following is republished from the Design View #39.

Ah, you’ve got to love those wonderful geeks at Stanford.

Lock ‘em in a room with a computer, a case of Red Bull, and two bags of Skittles, and they’ll invent Google before lunch, then go on to solve one of the most intractable problems of graphic design software in the afternoon.

Whatever you call it — Autotrace, Live Trace, PowerTRACE — the ability to convert bitmap images into vector artwork software has been around since at least Adobe
Streamline’s release in the early 1990s. In fact, I remember spending hours experimenting with Streamline’s many dials and sliders trying to get the perfect result back in the day.

How often have I put the practice to work? Not often.

The problem was always twofold:

Problem A. The vector artwork produced was always spectacularly chaotic, inefficient and tangled — the design equivalent of spaghetti code –
and generally took much longer to clean up than it would have taken to draw the artwork from scratch.

Problem B. The algorithms used to produce the vector shapes invariably impose the same blocky, woodcut effect on all artwork. This was fine if you were looking for a rough-cut, medieval look, but if not… well…

With …

 

Keep Your Template Logic in the Template

by Wyatt Barnett

Why keeping your template logic in the template is next to godliness. With a concrete example.

 

In All Fairness … Internet Explorer Still Stinks

by Kevin Yank

This is the story of how SitePoint tried to give Internet Explorer a fighting chance … and it lost anyway.

If you’ve been paying attention, you’ll have caught the subtle (and not-so-subtle) hints that SitePoint has been quietly working on a series of references, beginning with The Ultimate CSS Reference.

position property sneak peek

What hasn’t been revealed (until now) is that this reference will be released not just as a slick SitePoint book, but also as a freely-accessible Reference section right here on sitepoint.com! Our aim with this project is to produce the definitive CSS reference, both on the Web and in print.

Obviously, a big part of assembling this reference has been compiling browser compatibility information. And although our hard-working authors might disagree, one of the trickiest parts of the project has been determining how that information should be presented.

The Inherit Issue

A good example of this is the inherit value, which according to the spec is supported by all CSS properties. A little over a year ago, David Hammond’s site that rates browser standards compliance generated an uproar on Chris Wilson’s blog when it counted the lack of support for inherit as a point against IE for each and …

 

All in the mind?

by James Edwards

You remember what the Jedi say:

Don’t think — feel

And we all talk in terms of reason and emotion being different things; of thinking and feeling being semi-independent aspects of our state of being. We talk about the "head" and the "heart" as separate vessels for these aspects. But they’re not.

The heart doesn’t really control emotions, it’s just a muscle that pumps blood around the body. And while emotions do have a bio-chemical nature, and as such, are things we genuinely feel, they’re still controlled by the brain; which itself has an electro-chemical nature, and as such, an equally genuine physical presence.

So what is the difference between thinking and feeling? Isn’t it all just in the mind?

 

Web Directions North: Early Bird Pricing Ending Soon!

by Matthew Magain

Web Directions NorthThe special rate for buying your tickets to Web Directions North, held in Vancouver in February next year, ends in just over a week.

While I’ll always have a soft spot for the original Web Directions South conference held in Sydney each year, there’s no denying that its sister conference — now in its second year — has one of the most enviable programs going. With a huge line-up of incredible speakers and two days of excellent workshops, WDN is undoubtedly up there as one of the conferences to attend for web professionals.

But on top of that, this conference plays its trump card by offering two days of skiing or snowboarding with speakers and other attendees.

SitePoint will be there as proud sponsors of the conference, and many of SitePoint’s recent titles will be available for sale to conference-goers. Additionally, Cameron Adams (author of several SitePoint books) will be delivering a workshop titled Frontiers of JavaScript. If you’ve learned your JavaScript skills from any of these books, you’ll enjoy this full day of hands-on learning from The Man In Blue himself.

Pah, Vancouver might have great skiing and boarding, but Australia has beautiful beaches. Oh drat, Vancouver …

 

Processing HTML with Hpricot

by Myles Eftos

In this world of Web2.0 mashups and easy API access, it is quite refreshing how easy it is to pull data for third party sites and re-mash it into something new. Unfortunately, not everyone has been bitten by this bug, so we as developers sometimes have to do a little more leg work to get the information we need. A common technique is called a screen scrape where your application acts like a browser and parses the HTML returned from the third party server.

Although this should be simple enough, anyone who has ever tried to do this knows the pain of dancing with regular expressions in an attempt to find the the tags that you need. Luckily, us rubyists have the Hpricot library which takes the hard work out of parsing HTML. Hpricot allows developers to access html elements via CSS-selectors and X-Path, so you can target specific tags really easily. And because it is written in C, it is pretty fast too.

Installation

Hpricot is a gem, so installation is as easy as:

gem install hpricot

The just require the library at the top of the ruby file:

require ‘hpricot’

Usage

Lets take this HTML snippet:

<html>
<head>
<title>Snippet</title>
</head>
<body>

 

Visual Studio 2008 RTM Is Here!

by Wyatt Barnett

In case you have been under a rock, shacking up or in jail or otherwise indisposed, Visual Studio 2008 RTM is here! For full details, see Scott Guthrie’s official announcement. Personally, I think the most compelling new features are:

  • Javascript intellisense & debugging. Quite frankly, I suck at javascript–even after reading the very awesome Simply Javascript cover to cover–mainly because it requires remembering more details about things than I am currently prepared to remember. Moreover, lack of good debuggers really hurts the cause. Alerting values out just does not cut it, especially with the level of complexity involved in modern javascript.
  • HashSets. Finally. The only thing that would have made me more happy is if they made native collections with event notification on adds, updates and deletes.

Note I did not really mention LINQ, and that is quite intentional. LINQ itself is really, really awesome. But LINQ2SQL has the potential to become the DataSet of the 2008 generation. Just like it’s predecessor, it is designed to be a RAD tool to let just about anyone drag-n-drop database objects on forms and make neat, functional apps. And it will work for simple things. But once one starts kicking in complex, real-world data scenarios and …

 

Do you have the right personality for running your own business?

by Miles Burke

I’m always meeting people who have jumped into freelance or small business life without really understanding their own skills matrix. As rewarding as it is starting your own business, there are some negatives as well. It’s great that you’re a PHP expert, or can design like the best of them, but do you really want to run your own business?

Here’s some myths of running your own business, and the reality I have found from these;

I can spend all day doing what I want to do, and turning down the rest.
Sure - if your dream is wanting to spend copious amounts of hours wrestling with your accounting package, endless meetings with clients, planning your cash flow and dealing with debtors, then I guess that myth holds true. The rest of us though will find we get very little actual time to do what our hearts would prefer.

Running my own business means I can work how and when I want.
Within reason, this is true, however you’ll also find, especially in the early days, you’ll end up working when your clients want you to, and never actually getting that weekly game of Golf in. When you realise that billable hours equals income, you …

 

Index of PHP tokens for Emacs and beyond

by Troels Knak-Nielsen

I’ve been using Emacs as my primary editor for a while now. A lot of people prefer IDE’s, but I’ve never been comfortable with them. I kind of like the ability to show a list of classes & functions in a file though. Emacs can use ctags to generate a list of tokens for a file, but I weren’t really satisfied with its output.
As you probably know, PHP has a ridiculous amount of functions for all kinds of things, and as it happens, token_get_all gives access to the Zend Engine tokenizer. In other words, the same chunk of code, which PHP itself uses, when reading a .php file. This provides an excellent base for writing a script, which can parse the socks off ctags.

So without further ado: ~/scripts/tokens.php parses a file and prints the classes and functions found in there. It also prints a small excerpt of any docblocks, which precedes the item. This makes for a nice table of contents.

<?php
if (!defined(’T_UNSPECIFIED_STRING’)) {
define(’T_UNSPECIFIED_STRING’, -1);
}
function token_get_all_improved($data) {
$tokens = array();
$line = 1;
$col = 0;
$level = 0;
$scope_level = null;
$in_scope = false;
foreach (token_get_all($data) as $token) {

 

Sponsored Links

SitePoint Marketplace

Buy and sell Websites, templates, domain names, hosting, graphics and more.

Logo Design, Web page Design and more!

99designs

  • Custom logo designs created ‘just for you’.
  • Pick the design you like best.
  • Only pay if you’re satisfied with the result.