Archives

For some reason, I enjoy making self-referential New Year’s resolutions.

For example, let’s say that last year I resolved to keep the resolution which I would make the following year. A bit strange, but there seems to be no reason I can’t resolve to do something in the future. New Year’s resolutions in general are a statement about what you intend to do in the future.

Now, this year I resolve to break the resolution I made last year.

I’m not going to bother writing down the reasoning that follows this, but I’ll pause while you take a moment and work it out. If you want.

It essentially a form of the “The following sentence is true. The preceding sentence if false.” sort of thing, applied to New Year’s resolutions. The significance of this is difficult to convey, and I’d be the first to say that I’m not the person you want to go to if you’re looking for a complete explanation of Gödel’s theorem. But since it was Hofstadter’s excellent book on that subject that sparked my interest in computer science in the first place, I maintain a friendly attachment to this sort of thought experiment.

CSS Pseudo Elements and Safari

December 28th, 2007

I noted some peculiarities with CSS pseudo-elements implementation between Firefox and Safari today. IE does not support them, so it’s basically meaningless to bring it into the discussion.

I used a CSS rule to add an “external link” icon, most famously from Wikipedia. It looks a bit like a:after { content: url( images/external_link.gif; }. Pretty neat, but this adds the icon to every link on the page, including titles, tags, menu items… not precisely what I wanted. So I followed it with some rules that looked a bit like:

.some-class a:after { content: url(); }

Made sense to me; I assumed this would override the first rule in the given class of elements, and those links would not be followed by the external link icon.

Yes and no.

Firefox liked my override just fine. Safari, however, ignored it. Hm. So I tried

.some-class a:after { content: none; }

That must be better. Let’s check. ... Nope; Firefox is still okay with it, but Safari is unfazed, showing off the little icons after every single link on the page.

So I tried again:

.some-class a:after { content: ""; }

Just an empty string. Sure enough, that did it. Safari likes me again, and Firefox is okay with this rule as well. It is quite possible that the last rule is really the Proper Way To Do It, and Firefox was just being easy. Possible. But regardless, if you’re trying to do something similar, that last rule may be helpful.

I don’t know about you, but I haven’t seen a list of FAQs(Frequently Asked Questions) in years that seemed to have any likelihood of containing actual questions which were really asked with any frequency by the users or visitors of the site or service. It’s basically an open secret that these lists represent the answers that the site owners want to give us; the answers they know, or the things that they believe we want to know, or simply the things that they want us to know.

Those lists need a new name. Something like “Stuff We Want You To Know.” Or, “Things We Paid Our Intern To Write.”

A FAQ list should be exactly that—Questions that are Asked Frequently. Only that, nothing more than that.

  • If no one is asking you questions about your site or service, there is no need for a FAQ page.
  • If people occasionally ask questions, but they do not ask the same questions, there is no need for a FAQ page.

I want to add more bullet points, but I can’t. That’s it. Someone needs to be asking you questions, and they need to be asking the same questions… frequently... in order for you to need a FAQ page. If you don’t have questions being asked frequently… you don’t need FAQs.

(Aside: when writing the indefinite article in front of an acronym which begins with a vowel sound when spelled out, ie eff-ay-que but with a consonant when read in full, ie Frequently Asked Questions, do we say an FAQ or a FAQ? Is there a grammar for using the indefinite article in front of ambiguously pronounced acronyms? Enquiring minds want to know.)

SQLite

December 24th, 2007

It’s possibly criminal, but to date, I’ve not yet used SQLite for anything.

Noting that SQLite3 has become the default database for Rails 2.0.2, I thought I’d wander over to their site and take a look. I soon found the famous page, which lists some well-known users of the database, including Adobe, Firefox, Google, and many others.

Of note, it seems Sun is using it in Solaris 10; they note “Sun has essentially replaced the traditional unix /etc/inittab file with an SQLite database.” This is an interesting idea all on its own.

Firefox 3 Beta 2

December 23rd, 2007

Firefox 3 Beta 2 is available.

I likes. Doubleplus Good.

Away From Blog

December 17th, 2007

I don’t think I’ll be writing much this week—in Cabo San Lucas, Mexico, on vacation with family.

Whuffie

December 14th, 2007

Everyone seemed to be talking recently about “w00t” being declared word of the year by some dictionary, which is maybe why this stuck out at me.

Was just reading CodingHorror’s post on blacklists, and noted that he quoted Mark Pilgrim using Whuffie in a sentence, with no reference or explanation at all; nor did Jeff see the need to explain it. That was sort of cool, I thought; I didn’t think the word had had the time or exposure to be out there with no explanation needed.

So, I wonder when “whuffie” will make it’s way into a dictionary?

In case you are completely lost and haven’t yet opened a new tab to Google it, “whuffie” was the reputation-based currency in Cory Doctorow’s fine novel Down And Out In The Magic Kingdom, which I highly recommend. It’s also free to download, so you really have no excuse.

Why Learn Scheme?

December 13th, 2007

I’ve done a little Scheme on my own, and in a class at the University of Minnesota that I took last year. I don’t use it regularly, and I don’t anticipate ever using it in my career (although the opportunity to do so would be interesting). That said, I think it was invaluable, and I wish more schools included it, especially as an introductory course.

If it isn’t (generally) applicable to the workplace, then, why?

Two main reasons:

  • recursion
  • lists

I think one of the most valuable things you learn by programming Scheme is how much you can accomplish with very little in the way of structures and methods. With only lists and recursive functions, you can do almost anything you’d want to do.

You also get a chance to deal with different ways to do recursion, to manipulate lists, to make lists act like arrays &/or trees. All good things to know.

Of course, you also get the opportunity to see what all the fuss is about lambda. I think the light that goes on with that is also worthwhile, though mostly just if you’re inclined to enjoy programming for its own sake. If you’re learning it simply for a vocation, this may or may not be as interesting; your mileage may vary.

Say What You Are, Not What You Do

December 11th, 2007

This is difficult advice to follow, because to the standard American mode of thinking (and probably to others as well), it seems a little bit false, or a little bit arrogant, or a little bit starry-eyed. However, in certain contexts, it’s accepted. I’m becoming convinced that in order to get to do what you really want to do, you need to start labeling yourself what you are, rather than what you do. And they aren’t the same thing.

Exhibit A: Graduates in acting, theatre, and a variety of other creative endeavors typically get out of school and go right on working in the restaurants or other combinations of part-time jobs they’ve had while going through school.

But if you ask them what they do, they’ll tell you they’re an Actor. Without a trace of shame, not hiding anything, not trying to be something they aren’t. He/she is an Actor. They just aren’t doing it full time, yet. To the driven individual, that’s irrelevant. They won’t tell you they’re a waiter, because that’s not who they are.

Exhibit B: A bit more on the radical side, I had a friend in Canada who had been deeply, passionately involved in the socialist movement there. Americans like to typify Canada as socialist, but rest assured there are always people who want things to go even further. Without getting into the rightness or wrongness of the politics at all, that was my friend: completely immersed in what, to him, was The Cause.

If you were to ask him what he did, he would tell you I’m a professional revolutionary. Didn’t matter that he was a student and might have had some part-time job somewhere. What he was (in his words) was a revolutionary.

I think you find the same with people who will tell you they are an artist, an entrepreneur, a writer, a musician—whatever. What they’re doing right now to pay the bills, is irrelevant.

On the other hand, you have most people, who will tell you what they do, and then try to suffix it with, but I’d really like to… I understand that; I’ve usually done that. I’m just starting to think that if you actually want to get there, you have to switch to saying I am a [what you want to do], and you’ll probably have to do that before you’ve actually “arrived”.

So what am I? I’ll let you know as soon as I’ve figured out what I want to do when I grow up.

I was asking myself the other day, why does XML use explicit closing tags?

What I mean is, like:

  <person>
    <name>Phil</name>
    <gender>Male</gender>
    <occupation>Rails Developer</occupation>
  </person>

Normal enough. We’re used to this, it’s just the way it works.

Except that it’s not really necessary; other than for human readability (which may be a good enough reason), there’s no technical reason a tag should need to be closed by name.

In other words, we could decide that we could write:

  <person>
    <name>Phil</>
    <gender>Male</>
    <occupation>Rails Developer</>
  </>

Now, that’s not valid XML, but I don’t see any reason why it couldn’t be adopted. The reason it would work is that in XML, overlapping tags is illegal. Therefore, every closing tag should automatically be assumed to be closing the most recently opened tag.

For example, this is illegal:

  <strong><p>You shouldn't do <em>this</strong></p></em>

Ecch. However, if you were allowed to use </> as a generic closing tag, you could write the above as:

  <strong><p>You might do <em>this</></></>

Notwithstanding that it’s illegal to next a block element inside an inline element, each closing tag would be assumed to be closing the most recently opened tag, so they would all match. Let’s switch <strong> and <p> to make it valid:

<p> <strong> Like <em> this </> </> </>

Now, I’m not actually seriously proposing changing the XML standard just because it would work. Having to close tags which match the element name, i.e. <block></block> certainly aids readability. In fact, I find that with generic tags, like <div>, I often follow the the ending </div> tag with a comment, such as <!-- #the_id_of_the_div_block -->, just so it’s easy to figure out what’s going on when you read the code a year from now. So maybe ending xml elements with meaningful end tags is just a Good Idea, regardless of whether or not generic closing tags would “work”.

I just thought it was interesting that they would work, and I wonder if this has ever come up. Anyone know?

Mephisto

December 10th, 2007

I'll risk the wrath of the community and admit that Mephisto does not seem quite as intuitive as Wordpress. The documentation and ease of use is a little spare, a little obscure.

That said, I like it.

Hello, World

December 10th, 2007

Testing this out.