Creating an offline Rich-Client-Application using HTML, CSS and Java with SWT

There are a lot of frameworks out there to create offline applications and rich clients in Java. One exotic alternative is to use the HTML, CSS and Javascript for this purpose and render the application in a Java frame using SWT and SWT’s browser component. Creating a new Project We’re using maven here for our project but you shouldn’t have a problem to use SBT, Gradle or Ivy instead… Adding Maven Dependencies We need two things .. first comes a repository for the swt dependencies … ...

November 12, 2012 · 6 min · 1084 words · Micha Kops

HTML5 Server Send Events using Node.js or Jetty

The HTML5 working draft describes different techniques to push information from a server to the client and the one described in this tutorial are Server-Send Events (SSE). Using Server-Send-Events eliminates the need to poll a server periodically for information using AJAX and is really easy to implement because of the simple specification and the fact that nearly all modern browsers already implement this specification. The Client Side Registering for Server Send Events (SSE) is quite easy .. simply create a new EventSource object that is bound to the URL where the events are propagated. ...

October 21, 2012 · 4 min · 720 words · Micha Kops

Video Manipulation using HTML 5 and Javascript

Some funny stuff can be done using HTML 5, canvas elements and the video events API. In the following example we’re using these techniques to apply graphic effects to a video embedded in a HTML page.. The Goal Please take a look at the following screencast on YouTube to get an idea of what the final example looks like or just take a look at the demo page. As you can see a video is rendered and a clone is displayed with a strange swirl effect applied. ...

August 5, 2012 · 3 min · 636 words · Micha Kops

Screenscraping made easy using jsoup and Maven

Sometimes in a developer’s life there is no clean API available to gather information from a web application .. no SOAP, no XML-RPC and no REST .. just a website hiding the information we’re looking for somewhere in its DOM hierarchy – so the only solution is screenscraping. Screenscraping always leaves me with a bad feeling – but luckily there is a tool that makes this job at least a bit easier for a developer .. jsoup to the rescue! ...

August 30, 2011 · 3 min · 526 words · Micha Kops

Linux Snippets

These are not only linux snippets but also bash snippets and snippets using tools that run under Linux, *nix or sometimes even MacOSX, I should reorder this article someday ;) Settings for more reliable bash scripts set -euo pipefail this gives us …​ -e: exit script if a single command fails -u: exit script if an unset variable is used -o pipefail: return value of a pipeline is the status of the last command to exit with a non-zero status, or zero if no command exited with a non-zero status ...

March 1, 2010 · 15 min · 3006 words · Micha Kops