Monday, June 21, 2010

Memento: Adding time capabilities to the Web

This summer I'm working on a research project adding Memento support to the Android platform. I'll talk more about my project at a later date, but first I want to provide a quick overview of Memento.

Memento is an architecture which allows a web browser to seamlessly access older versions of web pages. It allows you to "time-travel" on the Web.

The best way to explain this is with an example. If you were to access, you would be presented with today's version of the page. But what if you wanted to see how it looked one year ago? You would need to visit the Internet Archive's Wayback Machine to find a list of old copies of the page they had archived, and you would need to click on one of the links. And if IA didn't have the page archived, you would have to search other web archives for the archived version. This is potentially a lot of work.

Memento makes access to archived versions of a page transparent to the user. Using a web browser that supports Memento, you would only need to visit the URL as you normally would and supply a desired date... the browser would automatically locate the archived page from that date and display it to you without the need to manually search through multiple archives.

You can see this in action right now by using the Memento Firefox add-on. Below is a screen shot using the add-on to browse as it appeared on July 9, 2009. I actually told the add-on to show the June 21, 2009, version, but the July page (from the European National Archives) is the closest page that was found in any archive. This is not a failing of Memento... it's a limitation of web archiving in general.

Memento uses HTTP content negotiation to add this time dimension to the Web. Instead of discussing the technical details here, I'll instead point you to the Memento Guide Intro if you're interested. Ideally, all web browsers and web servers in the future will support the Memento HTTP headers, and no special add-on will be necessary.

Memento is the brain-child of Michael Nelson (Old Dominion Univ) and Herbert Van de Sompel (LANL). It's made a quite a stir in the past year with a write-up in New Scientist, a paper at the Linked Data on the Web workshop (LDOW2010), and some significant funding from the Library of Congress. Tim Berners-Lee said this about Memento: "This is neat; there is a real need for this."

Friday, June 18, 2010

A Dislike button for yourself

I've been playing with Facebook's new Like button which you can place on any of your web pages. When someone clicks on the Like button, it shows up in their Facebook account. All you have to do is insert an iframe into your webpage. Here's what my iframe looks like for my Harding home page:
<iframe src="" 
scrolling="no" frameborder="0" style="border:none; 
overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>

It got me wondering though, what if someone wanted to dislike me? So I created a Dislike button and rigged up a little JavaScript to display a snarky message when someone clicks on the button. You can see it on my home page, right under the Like button.

If you'd like to make your own Dislike button, just follow these steps:
  1. Place this image on your website:

  2. Use the following HTML to display the Dislike button and a place-holder for some text:
    <a href="javascript:Dislike()"><img
    src="dislike.png" width="61" height="24"
    title="Click here to dislike this item" border="0" /></a>
    <span id="dislike_text" style="position:relative; top:-7px; 
    font-family:Tahoma; font-size:8pt;"></span>

  3. Finally, insert this JavaScript function somewhere in your page which randomly chooses a message to display:
    function Dislike()
       var responses = [
          "I'm not crazy about you either.",
          "Whatever.", "Seriously?", 
          "My feelings are so hurt.",
          "I'd rather be feared than liked.", 
          "Nice try."];
       // Get a random number between 0 and responses.length - 1 
       var num = Math.floor(Math.random() * responses.length);
       document.getElementById("dislike_text").innerHTML = responses[num];

Note that this is only for fun, and it will not show up in Facebook.

If you are really interested in having a Dislike button that works in Facebook, check out this Firefox plug-in.

Wednesday, June 16, 2010

Visualizing data with Protovis

In this month's Communications of the ACM, Heer, Bostock and Ogievetsky provide an eye-opening overview of the latest visualization techniques in A Tour Through the Visualization Zoo. The graphs and figures in the article were all produced with Protovis, an open-source library developed at Stanford for producing visualizations using JavaScript and SVG.

I've reproduced a few of my favorite visualizations from the article below.

The first is an index chart which shows the relative change in stock prices of several tech companies over time. The gain/loss factor is based on a fixed point in time (the red line). You can see some correlation between the stock prices, and clearly Apple is the overall winner. The online version allows you to change the location of the red line.

This is a choropleth map showing obesity rates in the US in 2008. The online version allows you to slide the date back to 1995. As you move the dates forward, you can see how the US population gets fatter, with the highest proportion of obesity rates focused in the South. There's a saying here in Arkansas: At least we're not Mississippi! wink

When you view the obesity rates with a Dorling cartogram, you see that Arkansas actually has fewer obese people than Colorado!

The next couple of graphs show how to visualize networks. Both visualize character co-occurrence in chapters from Victor Hugo's novel Les Misérables. The first is a force-directed layout. The node in the middle is, of course, Valjean. The online version allows you to pull nodes around and watch them re-arrange themselves.

The nodes can also be rearranged in an arc diagram as shown below.

Monday, June 07, 2010

Build your own C# screen saver

I wrote a tutorial years ago about creating a Windows screen saver using the C# language. I usually let my GUI students do it as an extra credit assignment.

The tutorial was really showing signs of age, and last week I was finally able to update it. You can find it here. If you'd prefer to just jump straight to the finished product, you can download the project here. I used Visual Studio 2010 to write the demo code.

One more thing to cross off my summer to-do list.

Wednesday, June 02, 2010

Professor's plagiarism case against colleague

Inside Higher Ed reports that a Math/CS professor at Bethel University has accused another professor in the same department of plagiarizing his CS1 labs. The accuser, Benjamin Shults, says that he gave Brian Turnquist his labs for class use which had Shults' name on top. Turnquist subsequently replaced Shults' name and other identifying marks (like swapping out images of Shults with Turnquist's). The modified labs were placed on Turnquist's website.

Turnquist was found guilty of "innocent infringement" by Bethel's Grievance Review Committee, was forced to give Shults an apology, and had to remove all the labs from his website. Apparently Shults is not happy with the committee's slap on the wrist. He has not received an apology yet (see the comment at the end of the article entitled "corrections"), and he's created a website that documents the whole affair.

When I read this article, I immediately thought of all those assignments and labs I had borrowed from my fellow faculty members and the labs/assignments I have given to others to use in their classes. I have always removed their names on the documents and thought nothing of it... I assumed they were doing the same. But I have also never posted the documents on a website for public consumption.

Our department is now discussing this issue, and I think we'll all be more diligent about giving credit when modifying another's lab/assignment for class use. However, we all agreed that the best way to handle a situation like Bethel's is to go directly to the offending party.

Since Bethel is a Christian university like Harding, I couldn't help but wonder how applying the biblical principles set forth by Jesus and Paul would have drastically changed the situation.

Matthew 18:15:
"If your brother sins against you, go and tell him his fault, between you and him alone. If he listens to you, you have gained your brother."

Matthew 5:38-39:
"You have heard that it was said, 'An eye for an eye and a tooth for a tooth.' But I say to you, Do not resist the one who is evil. But if anyone slaps you on the right cheek, turn to him the other also."

1 Corinthians 6:6-7:
"But brother goes to law against brother, and that before unbelievers? To have lawsuits at all with one another is already a defeat for you. Why not rather suffer wrong? Why not rather be defrauded?"