Tuesday, February 27, 2007

Firebug and Net View

It seems that Firebug has a nice little bug. This caught me out when using it to monitor if some of our files were getting cached. Basically it seems that firebug doesn't notice when some files come from the cache and reports them as being downloaded again.

Monday, January 29, 2007

Microsoft, Patnets and BlueJ (Java IDE)

Through Planet Eclipse I found a post detailing how Microsoft first stole and then patented an idea from a Educational Java IDE called BlueJ developed by Deakin University and the University of Kent. Although this may have been done unintentionally I hope this blows up into a bit of a PR disaster for them as their behavior in this matter doesn't seem very good.

Friday, January 12, 2007

ProxyUserDirectoryProvider

As part of the work I have been doing with Sakai and Bodington I needed to allow Sakai to access the user details that are stored in Bodington. The normal way to do this would be to write a UserDirectoryProvider (UDP) that sits in the components folder. The problem is that I didn't want to put the whole of Bodington into the components classloader and tomcat was going to load Bodington anyway as a webapp. The solution was to create a proxy that could be injected with the real Bodington UDP when Bodington started up. This needed to be an API that extended the standard UDP:

public interface ProxyUserDirectoryProvider extends UserDirectoryProvider {
UserDirectoryProvider getUdp();
void setUdp(UserDirectoryProvider udp);
}

This ProxyUserDirectoryProvider could then be requested from the component manager at Bodington startup and setUdp() called with the full implementation of the Bodington UDP. The proxy I created is currently sitting in https://svn.oucs.ox.ac.uk/projects/vle/sakai/user-proxy/trunk/.

Wednesday, December 13, 2006

element.getAttribute("class")

Why are even the simple things sometimes hard? Attempting to get a element attribute. Here is a table of what the various browsers return when trying to get the class attribute having already found an element:
var element = document.getElementById("theSpan");
in a document containing the HTML:
<span id="theSpan" class="something">
Browser element. getAttribute( "class" ); element. getAttribute( "CLASS" ); element. getAttribute( "className" ); element. attributes[ "class" ]; element. className;
Firefox 2.0 something something null [object Attr] something
Opera 9.0 something something null [object Attr] something
Safari 1.3.2 something something null undefined something
IE 5.5 (Mac) null null something something something
IE 7.0 null null something [object] something

Updated: Thanks to anonymous for pointing out that you can just use element.className to get the class name used and it seems to work correctly across all browsers I tested.

It seems that there is no simple way to get the class attribute across browsers. The solution seems to be to get the class attribute and if it undefined try the className attribute. Most other attributes should work fine, it is just that IE doesn't like the class attribute that throws the spanner in the works. Here is the quick testing page.

Tuesday, December 12, 2006

Label Based Feeds

When I was at the Sakai conference I was asked if I wanted my blog added to Sakai Planet, the thing is that I blog about more than just Sakai and so only the posts for Sakai should end up in the planet. After a little googling I discovered you can have feeds for labels and it seems that my sakai feed works. I wonder why Google don't make this the default RSS feed when viewing all the posts for a tag?

Tuesday, November 28, 2006

Marketing through last.fm

I have had an account on last.fm for a while now. I send most of music listening to it. A few days ago I got a friend invite from TheHijacker. Looking at the profile it seems this is the profile for a previous member of Dodgy called Nigel Clark who decided to send me a friend invite because I was one of the top listeners to Dodgy in a last week (25 listens). I also a day later got a private message from him saying I should visit his website. I believe he it trying to promote his new album 21st Century Man. To be honest I don't mind this sort of promotion much, as it is obvious that I will quite happily listen to Dodgy and so will probably like his new album. This sort of promotion also isn't at the moment automated and so he obviously feels it is worth his time sending me the message. However I signed up with last.fm because it allows me to find other music rather than have it pushed on me. Although I'm guessing that Nigel Clark hasn't yet reached a big enough critical mass opn last.fm to be recommended to me as other people aren't yet listening to it.

Friday, November 03, 2006

Sakai Site.equals()

Took a little while to figure this one out but in Sakai the org.sakaiproject.site.api.Site equals() method will return true when passed a string if it matches the ID of the site. The reason they do this is so that they can save a list of site IDs and then have a collection of sites and call siteList.removeAll(stringList);. This can be seen is action in the CharonPortal where is is used to hide sites that the user isn't interested in.