Google Releases Tool J2ObjC to convert Java Source Code into Objective-C Source Code

I love the Google Web Toolkit, a powerful and mature open source library to automatically translate Java Source Code into JavaScript code. While I doubt the merit of using Java to write user interfaces for JavaScript (unfortunately, this is often what the Google Web Toolkit has been advocated for), I think it is a great tool to share Business Logic between Java and JavaScript applications.

In this context, I am very happy to see Google release the free tool J2ObjC: This library is targeted to translate Java Business Logic code (not UI code!!!) from the Java Source Code into Objective-C source code. The objective of this project really appears to be to share libraries between Java and iOS applications rather than translating entire applications (with UI) from Java into Objective-C: a limitation I think is a great strength!

I hope that soon we will be able to write Business Logic-level code just once and then embed it everywhere!!!

Converting youtube video link to embed link with JavaScript

Videos on youtube usually have a URI such as the following:

These URIs cannot be used to embed the video in an iframe such as the following:

In order to work as part of an embedded iframe, youtube video links must be in the following format:

Luckily, given any ‘normal’ youtube link, it is very easy to generate such an embed link. In JavaScript, this can be done with the following function:

function createYouTubeEmbedLink (link) {
 return link.replace("", "");