Archive for the 'Solutions' Category

Turn a plain text URL into a hyperlink wrapped in an LI

Saturday, November 18th, 2006

Add these lines to your .emacs:

(fset 'list-hyperlink-from-URL
[? ? ?\C-y ? ? down ?\C-a])

Barneys.com rated second most effective luxury e-commerce Web site

Thursday, November 16th, 2006

Barneys’ website is… first for trust and security. …the top-rated site for exceeding customer expectations and for improving overall brand favorability. Respondents who found that the site exceeded their expectations say the site has excellent quality and images, and is easy to use.

links I’ve tagged with Barneys

Article is mirrored after the jump.
(more…)

BlogLines inside NetVibes

Wednesday, November 1st, 2006

I’ve been using NetVibes for a while. But I just discovered the Web Page Module. And that has greatly increased NetVibes’ usefulness to me.

First, there are several visualizations (newsmap, delicious map, delicious LiveMarks and digg spy ) which cannot be replaced by an RSS feed. Web Page Module allows me to view each of these interfaces from within Netvibes, each in its own tab. NewsMap is so flexible that it fits into one column of a 3-column layout.

Netvibes is a smooth interface for reading 10 or 20 important feeds. Beyond that, I either have to scroll deeper than I’d like, or I have to start breaking up my feeds into tabs; and then I have to go back to BlogLines. Reading a bunch of little boxes spread across many tabs, does not appeal to me. I cannot make a good case for just why that is, however.

In any case, tonight I realized that the Web Page Module means that I can put BlogLines inside Netvibes. So now I truly do have all my feed-reading on one page.

Logging and reporting

Thursday, October 5th, 2006

I wrote my first reporting script yesterday. It crawls a source tree and reports each occurrence of a specific regular expression.

Today I will be trying out SSMTP under Cygwin. I’m not sure where I can send mail from. I guess I can use one the SMTP that’s already running on one of the servers.

Automated reporting has been a dream of mine for a long time. The trouble has been building a work environment where it was possible to develop a best practices document. Forming a list, of consensus best practices, took a long time. However, the reporting script was written within 24 hours of completion of the first draft of the best practices document.
(more…)

How to run a command and save the output, in Perl

Wednesday, September 20th, 2006

Assuming we are in a directory that contains a file called

myfile.

>perl -e “open(FOO,’cat myfile |’)|| die ‘cat failed’; while (){ print }”

Now I can treat FOO just like I would any other filehandle.

Neat little example of a useful JavaScript closure

Monday, September 11th, 2006

I just picked up the 5th edition of David Flanagan’s JavaScript, the Definitive Guide. I find it amusing that that book is the only JavaScript book officially recommended at comp.lang.javascript.

Closures are a powerful feature of JavaScript. However it’s often hard to explain in a few words, just what is useful about closures. Well, here on page 131 of the Rhino book, is the recipe for a unique ID generator that doesn’t require a global counter.

One thing that I personally enjoy about the Flanagan book is that he says things like “don’t pollute the global namespace.” :) This technique does not pollute the global namespace.

var uid = (
  function(){
    var id=0;
    return function(){
      return id++ ;
    };
  }
)();
//then just say:
alert(uid());

var uid = (function(){var id=0; return function(){return id++ ;};})();

The Simplest Example of Recursion in JavaScript

Friday, September 8th, 2006

Here is the simplest example of recursion that I can think of:

(function (arr, count) {
alert[count];
if(count

Why is this important?
(more…)

given a set of id3v1 tags, infer the values of blank ARTIST and TITLE fields with Perl

Thursday, June 8th, 2006

In 2001, I wrote a Perl script to put id3v1 tags into mp3 files that didn’t have any tag information; using MP3::Info to get and set tag information.
(more…)

Set a nested DOM property with Javascript, using square bracket notation

Tuesday, June 6th, 2006

In the comp.lang.javascript Javascript Best Practices document, I came across an interesting discussion of the reasons for preferring square bracket notation to eval().

The consensus seems to be that eval is evil, and that “if it exists in your page, there is almost always a more correct way to accomplish what you are doing.”

(more…)

Vic Sussman on Larry King Live (Transcript)

Wednesday, May 31st, 2006

I remember watching Vic on Larry King with the vice president. Al Gore is a huge dude, and Larry’s desk is small, so they were all crammed in right next to each other. Vic did what he could to bring up the difficult questions :)

I would love to find the video of this so I could post it on YouTube. This is just some of the transcript.

The transcript is mirrored after the jump.
(more…)