My Podcast selection

21 06 2009

I have a 30 min drive to work each day. The road I use is single lane and used by big trucks, taxi’s and a wide array of mine vehicles. I always thought that taxi drivers were the worst but have since changed my mind.

In my opinion the worst drivers are people driving mine vehicles especially the ones with 4×4’s. But luckily I have found something to take my mind of the driving in a range of nice podcasts. This is my selection in order of preference:

1. Dan Carlin’s Hardcore History

WOW History presented in an interesting and fun way. You can hear that Dan does much research before each show. The way he presents each topic makes you think differently about history and the present day.

2. The Naked Scientists

Not just science news but also stuff you can do at home. Great for learning about all the different science fields

3. Linux Outlaws

Fabian and Dan are just two normal Linux users talking about Linux and related free/open source topics. The show always has a great selection of news and is probably the best pod cast when it comes to finding out what distribution released when. The Microwatch section also keeps tabs on what the evil Micro$oft is up to.

4. Ubuntu UK Podcast

A few Brits talking about Linux and Ubuntu. Because of their link to the Ubuntu distribution you get a good idea about the latest ongoings at Canonical and the Ubuntu distro. Also look out for the competitions.

There you go. If you have any other podcasts that you like please let me know so that I can try them.





Google Web Toolkit (GWT) – Generate FileMenu from XML

21 06 2009

I have been playing around with GWT the last few weeks and wrote a nice little function that reads a XML file and builds a FileMenu.

Real GWT programmers will probably frown on the code but please keep in mind this is only for fun. The XML structure looks like this:


links

mainLink name='My Links'
subLink name='Blog' url='http://fredreh.wordpress.com' title='My Blog' /subLink
subLink name='Facebook' url='http://facebook.com' title='See some friends' /subLink
/mainLink

mainLink name='Test'
subLink name='Tester' url='http://www.test.ac.za/' title='Tester' /subLink
/mainLink

mainLink name='Search Engines'
subLink name='Google' url='http://www.google.com/' title='Google' /subLink
subLink name='Wolfram' url='http://www.google.com/' title='Wolfram' /subLink
/mainLink

/links

The file name is links.xml the function BuildMenu() looks like this:


public void BuildMenu()
{
//Build the menus
//The requist builder for the XML passwords
RequestBuilder buildL = new RequestBuilder(RequestBuilder.GET,"links.xml");
//The main menu
final MenuBar linksmen = new MenuBar(true);
try
{
buildL.sendRequest(null,new RequestCallback()
{
public void onError(Request request, Throwable exception)
{
Window.alert("Could not get a list of Links for MenuBar");
}

public void onResponseReceived(Request request, Response response)
{

//Check the xml file and load the nodes inside
Element TopLvl = XMLParser.parse(response.getText()).getDocumentElement();

//Get a list of nodes under the main node
NodeList mainLink = TopLvl.getElementsByTagName("mainLink");

//Loop through the list of mainLink nodes
for(int j=0;j<mainLink.getLength();j++)
{
//Create the Element representing a
Element main = (Element)mainLink.item(j);

//The menubar representing a
MenuBar MLink = new MenuBar(true);

//A list of nodes inside the each one is a
NodeList subLink = main.getElementsByTagName("subLink");

//Loop through the list of subLink nodes
for(int i=0;i<subLink.getLength();i++)
{
//Create the Element representing a
final Element sub = (Element)subLink.item(i);
//Add the subLink details to the Mlink MenuBar
MLink.addItem(sub.getAttribute("name"),new Command(){public void execute(){Window.open(sub.getAttribute("url"),sub.getAttribute("title"),"");}});
}

//Add the completed MLink menubar to the main linksmen MenuBar
linksmen.addItem( main.getAttribute("name"),MLink);
}

}
}
);
}
catch (RequestException e)
{
Window.alert("Error");
return;
}

GLeftMen.setWidget(0,0,lblLinks);
GLeftMen.setWidget(1,0,linksmen);
}

I commented the code heavily and it shoud be clear.

Looking at the code I wonder how difficult it would be to take the XML generated by Glade and then build an interface when the user loads the page.

Anyway I hope someone can use the code it is licenced under WTFPL