Archive for September 2008
Morse Code practice utilities and files
Jack Twilley has an excellent set of open source utilities for generating Morse code audio practice files. If you cannot put the source code to use, you can track the audio files he generates via RSS.
GWT-Restlet example app
Rob Heittman posted a simple, standalone example of integrating Restlet technology into GWT apps. See the “Examples” section toward the end of the page.
GWT-Restlet snippet
Rob Heittman was good enough to post this tidbit of what a RESTful call and callback look like using the Restlet API in Google Web Toolkit:
button.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
new Client(Protocol.HTTP).put("http://localhost:8888/demo/hello.txt", "entity", new Callback() {
@Override
public void onEvent(Request request, Response response) {
try {
label.setText(response.getEntity().getText());
} catch (final Exception ioException) {
GWT.log("Restlet I/O failed", ioException);
}
}
});
}
});
You’d use this in conjunction with a server process that can handle RESTful requests. A bit more detail can be found here.
New JXTA ContentService
Mike Cumings, JXTA community member, has been busy at work writing a Content service for JXTA. In Mike’s own words:
“The ContentService is a recent addition to the JXTA (JXSE) API which allows arbitrary data (Content) to be transferred from one Peer to another. The specific mechanism/algorithms used to transfer the Content are abstracted away, allowing the developer to utilize an existing general purpose transfer mechanisms or create their own transfer implementation, all while exposing as much state information – such as the details of the transfer progress – to the API user.”
The ContentService is a great addition to the platform, making it much easier from a programmer’s perspective to move bits from one peer to another. The service is available in the platform now, at the head of the SVN trunk, and will be available in official release form with the next release of the platform.
Good stuff, Mike!
Boilerplate for Cocoa/iPhone NSURLConnection and NSXMLParser delegates
There may be an easier, more sophisticated way to do this, but here’s one way to add boilerplate code for the methods required of delegates of Cocoa or iPhone NSURLConnection and NSXMLParser. Add parser-delegates.sh and url-delegates.sh to your bin directory, then add them to your User Scripts in Xcode via “Edit User Scripts/Add Script File…”. When you need to implement these methods in a class file, place the cursor where you want the delegates, then execute the scripts via the Xcode User Script facility. The script output will be pasted into the editor at the cursor.