Geospatial Data Visualization – Part II

Yesterday, I wrote a bit about visualization of geospatial data – at the end of the day, I was able to present an early state of data visualization using the Google Maps API.

GeoSpaceVis-09The visualization included custom markers on former Luftwaffe airfields in southern Germany, and a flight path from the airfield in Munich (Riem) to the airfield of Lechfeld. When I left, there had been a couple of open items I wanted to further work on.

The curse of Flying but not Leaving

My first problem was that the Luftwaffe Flight Log I was using as an example (which can be found here) consisted of typical “training flights” at first – which means that the pilot – Walter Stolz – has departed and arrived from the same airfield, sometimes multiple times a day.

Visualizing a flight where a pilot is taking off and landing on the same airfield and without any additional information about the route taken is difficult and can only be a symbolic action. So I decided to fall back on a simple circle. Take the very first flight in the flight log (translated into plain language):

“On June 5, 1940, Walter Stolz was departing (as pilot-non-flying) the airfield of Munich-Riem in a Junkers Ju 86 E-5 at 13:12 hours. The aircraft has the registration number [VB+PF], the flight is taking 126 minutesand the cover 546 kilometer, landing at Munich-Riem at 15:18 hours.”

That is a lot of information but not enough to determine their course – and more information is not available.

Let’s consider this: the crew of [VB+PF] has been flying for 126 minutes and they covered 546 kilometers – if we ignore any head or tailwinds, etc., their flight would have taken them at a maximum anywhere within a radius of roughly 275 Kilometers.

GeoSpaceVis-02-01The insert at the top left shows the new code of the function CreateFlights – this time, I am using a circle with a diameter of 275.000 m (our 275 km) with a red outline and a mostly transparent red color. We don’t know where – but we know that somewhere within this red circle, the crew of [VB+PF] has been…

Looking at all Flights

As mentioned before, we are not looking at a single flight – we are looking of a series of flights by one airman. And that airman had a second flight on June 5th, 1940 – this time leaving at 15:21 and returning to Munich-Riem at 16:00. A sweet 39-minute flight, covering 170 kilometers…

GeoSpaceVis-02-02Let’s add some more flights – Walter Stolz has entries for June 19 and June 20, 1940 from Munich-Riem, then on June 24, 1940, from the airfield of Gablingen and then more flights from Munich-Riem. I have visualized only the first five.

GeoSpaceVis-02-03It’s getting a bit crowded now. There’s only five flights on the screen now but we already have two issues:

  1. we do not know the sequence of these flights and
  2. we will not be able to see much more if we keep adding flights.

First things first – making Data… Data!

Before I start fiddling with time (sounds cool, eh?) I need to fiddle with my data. So far, the function CreateFlights was used to more or less directly create the Google Maps Elements that represented the flights. In other words: it did not provide data, it provided the final elements to display. Now, this is gonna change:

GeoSpaceVis-02-04As you can see, I am now building an array named flights. Each element of the array is created “manually”, that is by coding it and each element contains several pieces of information:

  • The Number (“No”) indicating the flight number in the airman’s flight log.
  • The name of the Airman.
  • The FlightType. Currently, they are all 0 but I will have some 1 eventually – 0 is a local flight (departing and landing at the same airport) and 1 is a ferry flight from one airport to another one.
  • The Departure and Arrival positions, already expressed in Google Maps API LatLng.
  • The Waypoints which are currently an empty array all across.
  • The DepartureTime and ArrivalTime.
  • The Distance the flight covered (which I need to determine the different diameter of the circles when the flight is a local flight (FlightType = 0).

The chance within the CreateFlightsFromCode.js file now also means I need a routine in my code to interpret the data and act upon it.

GeoSpaceVis-02-05As you can see, I am now looping the array flights and act upon each individual item. Currently, the implementation is incomplete as the else part of the if…else… statement (dealing with the FlightType = 1 items) has not been implemented. But for now, this is fine as we only got flights which depart and arrive at the same airfield.

Where is the advantage? Well – it lies in the fact that I no longer have to worry about what to do with a certain flight and how to handle it. I can now push all that logic to the managing portion of the code and focus on the provisioning of more data.

Also, the managing code will remain unchanged if I change the way of provisioning the data – as long as I provide a filled flights array, it does not matter if I manually create the code to fill it or if I change that code to retrieve the data from elsewhere, a database for example.

Now, my Data contained within the CreateFlightsFromCode.js file is…purely data! And by the way: I already sneaked the 4th dimension in: there now is a temporal component in the data – the flight’s departure and arrival times. And by the way: running the new code on the new data produces exactly the same output with the five circles as before…

Exploiting the Temporal Component

Let’s see how we can exploit the temporal component. The ideas I am going to implement here have been strongly sparked by the tutorial video I referred to in the first post on this topic, particularly the two ones by Paul Saxman and Brendan Kenny. So this is the place to give a big “Thank you, guys!” to the two – they helped me a lot to understand the basics of what they were talking about and get these ideas transferred here. Any in case, anyone is wondering about their source code – a version is available (pretty much hidden) here.

Back to the temporal component: Paul and Brendan took a quite interesting way of dealing with time… by eliminating it. In their samples, they made sure that the data they worked with was already sorted by time (in their case the time of the earliest geoposition for each voyage) which put them into a position to know that an entry in their array (which for me is the flights array) is later the larger the index if the entry. That allowed them to fade in their data one after the other by merely applying the visibility-flag to elements in a particular way. Very clever!

Looking at my data, this is true as well – the five flights we have so far are in perfect chronological order… so we can do the same thing Paul and Brendan did. Here is a first stage of the changes – those to the already existing code:

GeoSpaceVis-02-06First of all, we keep creating the Google Maps Elements but they are now created invisible – the visible attribute takes care of that. Next, the slider is initialized – first down in the actual <body> element itself

GeoSpaceVis-02-07and then in the Java Script function – see the second red box in the image before the last. The slider receives an EventListener that is fired on the “change” event – in other words: every time the slider is moved. The listener needs a call-back function to execute when fired – that is, in my example, called updateFlights.

As a result, every time the slider is moved, the code in updateFlights is executed – which now needs a proper implementation.

GeoSpaceVis-02-08The implementation pretty much follows what Paul and Brendan did:

  • it initializes a “memory” for the previous slider value and sets it to 0 (a global variable!)
  • it reads the current value of the slider into the variable sliderValue.
  • it checks if the current value is lesser or greater than the memorized value – if it is lesser, the slider was moved to the left (into the past), otherwise, it was moved to the right (into the future).
  • Depending which direction the slider was moved, make elements invisible (to the left) or visible (to the right).
  • Finally, memorize the current value as the “old” slider value.

And here is the result – this time as a video because we want to see the slider in action 🙂

So far, so good – two things become obvious though

  • We need a “null” flight at the beginning because otherwise, the slider cannot be used to make the very first flight invisible.
  • We can nicely fade flights in and out but once faded in, they remain visible which (with more flights to come) again will overcrowd the map.

So where are we after this second post on Geospatial Data Visualization?

  • We have found a way to deal with flights departing and leaving on the same airfield.
  • We have control over the time – only displaying flights up to a certain time (determined by where the slider sits).
  • We have converted out flights into true data in preparation for later retrieval from other sources and adapted the core code to interpret the data rather than create visual elements directly.

But there are a couple of open issues to address:

  • We still need an implementation for “ferry flights” leaving one airfield and landing at another one.
  • We should have the ability to fade out “older” flights so our slider could be used to move across all flights in the data but only display those of the last 24 hours or so…
  • We need to find a better styling for the map and the controls – at the moment, it is more or less “quickly assembled” and using the standard styling.
Posted in Geospatial Data | Leave a comment

Geospatial Data Visualization – Part I

Some time ago, I stumbled across a stunning video animating the European Air Traffic for 24 hours.

It it not only stunningly beautiful, it actually visualizes information that is not even present (as data)  but made accessible by how we are looking at this video:

  • The so called NATs (North Atlantic Tracks) the aircrafts are following on their eastbound course.
  • The European Air Routes (the defined paths the aircrafts follow when flying from A to B)
  • The SIDs (Standard Instrument Departures) and STARs (Standard Approach Routes) the aircrafts have to follow when taking off or landing at an airport – London Heathrow is a great example in this video.

Apparently, the film was produced by a company called 422 South. There are more such animations on their web page, so naturally, my question is “How the hell did they do that?” And “Can something like this (maybe a bit less professional!) be achieved with own data?”.

At the Google I/O 2013, a presentation named “All the Ships in the World” was shown which – in the sense of the traffic visualization – came close to what I am looking for – it can be found on Youtube as well.

Also, one year earlier, in 2012, at the Google I/O 2012, another presentation on visualization of geospatial data was given by Brendan Kenny which also contains some really interesting elements.

So one of the early answers I found was that looking into existing technologies would be much more promising than trying to do something stupid on my own. The next question was “Where do I get some code examples from?” – as you watch the videos I have linked to so far, you can see that there is little to no code shown. Which means I know something can be done but I do not know how it is done 🙁

So I started digging a bit and came across a more “development-centric” tutorial which now revealed some of the insides of the code. The series is called “A Journey of 245k Points” and is made up of two parts – Part 1 and Part 2. These are a little bit harder to listen to but gives a significant depth of how things can be done…

Setting the Scene

One of the reasons I am doing all this is my affinity to aircrafts and specifically to information about the German Luftwaffe from 1935 – 1945. You can find more about what I am doing there on my website at www.chronicles-of-the-luftwaffe.de but for now, let’s just say I have a large number of flight logs from former Luftwaffe pilots and there is tons of data in there.

Specifically, there are two types of information that are almost predestined for geographic data visualization: the airfields and the flights. Let’s work with the Flight Log of Walter Stolz (which I have discussed in detail here). It makes it nice and easy to work as an example because you can have all the historical details already lined out before you.

Looking at the first page of his log, a few airports already are mentioned:

  • Riem (which is Munich/Riem) at the coordinates 48°07’55″N and 11°42’00″E (48.131944, 11.7)
  • Gablingen at the coordinates 48°27’00″N and 10°51’50″E (48.45, 10.8638889), and
  • Lechfeld at the coordinates 48°11’20″N and 10°51’40″E (48.1888889, 10.8611111)

The coordinates have been provided by Jürgen Zapf (see www.flugplaetze-der-luftwaffe.de)

My first Map

So my first map will be a simple and easy one – I will just try and come up with a map that showing the region between Augsburg, Munich and the Alps in a first go. The area of southern Germany these three airports are located in.

Most of the code is from developers.google.com – if you want to download my copy, click here. Let’s take a look…

GeoSpaceVis-01The code is written using DreamWeaver – that’s where the screenshot is from. It is relatively straight forward, an HTML5 document with some inline CSS for the <html> and <body> elements as well as for any element that has a “map_canvas” id.

Next, a reference to the Google Maps API, followed by an inline implementation of the Initialize() function. This function is called when the <body> element is loaded and creates a Map object associated with the <DIV> element in the body.

Pretty cool – that already gives us a map from Google that can be zoomed, dragged, and managed in any way Google Maps itself allows us to manipulate a map.

Adding the Airfield Markers

The Airfield Markers are presenting a little issue for me – not so much because I would not know how to place a marker, no: it is more the fact that there will be a large number of markers and that their creation will differ over time.

A first thought was to store them in an XML File and read them from there – a good summary of what that involves can be found here. The problem: channeling the reading of the XML File through the XMLHttpRequest requires me to host my sample files in a web server (otherwise, HTTP goes into nirvana and nothing is displayed…)

My system is running a local instance of Internet Information Server anyway so it is not a real issue… but it is not what I want to do at the moment. The screenshot below shows the working routine with the XMLHttpRequest approach.

GeoSpaceVis-02Note the extra <script> element near the top? This includes util.js which contains the downloadURL() function and associated helper routines. The downloadURL() call including its in-line call-back function can be found towards the bottom of the initialize() function.

The page is served via Internet Information Server and the markers display just fine. So now let’s rip it apart again…

First of all, I have created a new file named CreateMarkersFromArray.js – this servers as an external Java-Script file and holds one single function called CreateAirfieldMarkers. This function takes one argument targetMap which represents the map object to place the markers on. The screenshot below shows the new code within the HTML Page.

GeoSpaceVis-03Marked are the inclusion of the external Java-Script file and the call to the CreateAirfieldMarkers function which looks like this:

GeoSpaceVis-04I finally also decided to replace the standard Marker Icon with my own, more Luftwaffe-specific icon… the change is simple, just add the reference to the respective icon to the constructor of the Marker.

GeoSpaceVis-05So now we got the three airfields that Walter Stolz was using on his first flights – which is the next piece of information I would like to add to the map.

Adding an (imaginary) Flight

Let’s add an imaginary flight first – imaginary because it is not a flight in Walter Stolz’s flight log because I need a flight to go from one airfield to another one (rather than taking off and landing on the same airfield).

For now, I have settled for a flight from Munich-Riem to Lechfeld – again, the definition of the flight is placed in an external Java Script file for easier manipulation.

GeoSpaceVis-06I also adjusted my HTML Code, including the new Java Script file and adding a call to the CreateFlights function. Currently, the flight simply shows up as a single red line connecting the two airfield markers.

GeoSpaceVis-07But flights are rarely straight flights from A to B – which is why I have chosen the Polyline as basis for my flight path. Let’s just assume (imaginary flight, remember?) that Walter Stolz did not fly directly from Munich to Lechfeld, let’s say they did a trip, leaving Munich to the south-west, towards the southern tip of Lake Starnberg. Then, heading over west to the city of Schongau and then to the airfield at Lechfeld.

All that needs to be done is adding the new waypoints to the flight path (formed by the Polyline).

GeoSpaceVis-08Once the map is redrawn, the flights now looks more like a scenic flight…

GeoSpaceVis-09So far, so good. What has been achieved so far?

  • We can create a map based upon the Google Maps API
  • We know how to create Markers (our airfields) and display custom Marker Icons (our Luftwaffe crosses)
  • We can also add a flight from one airfield to another one by adding a Polyline to the map.

And what are the next steps for the days to come?

  • We need to find a way to show a flight departing and arriving at the same airfield when we do not have any additional waypoints.
  • We need to find a way to add more information to the flight such as Date, Time, Aircraft flown, etc.
  • We need to find a way to add multiple flights – from the same pilot (sequential) and other pilots (parallel).
  • We need to find a way to animate these flights – preferably using a slider control first that fades in flights as time progresses.

Is that anywhere close to the video I have referred to at the top? No – but we already have a chance to visualize geospatial data and make it “accessible”.

Posted in Geospatial Data | Leave a comment

Shuttle XS35GSV3L as Database Server

Here is the original idea: after having played (and developed) with PostgreSQL over the past months, I thought it would be cool to have the “production” database on a 24/7 environment and not running within a VMWare. That would allow me reliable, fast connections (so I hope) while maintaining my virtualized environment for further development.

I looked around a little bit and found a Shuttle system for a reasonable price – memory and a SSD were sitting on my desk anyways so I thought, I’d give it a try. Long story short, I ordered one.

The Shuttle XS35GS V3L

The system is question is a Shuttle XS35GSV3L – once the package arrived, I started putting the computer together (that is: add RAM and the SSD) and connected it. That was easy enough and I was thinking that I would have an easy go with it.

At a size of roughly 25cm x 16 cm x 4 cm, the computer is really small – and it is fan-less. Together with the SSD, there are no mechanical parts that would produce any noise and therefore, the system is just perfect as a small server.

I added 4GB DDR3 RAM – the system itself comes with an Intel Dual-Core Atom D2550 Processor.

The Operating System

Operating System of choice is Ubuntu – the current LTS (Long-term Support) version is 14.04 which I downloaded from the Ubuntu Website. Since the Shuttle does not have a DVD ROM, I had to put the image onto a USB Stick – a great tool doing that for you is the Universal USB Installer. Three easy steps take you to the desired result:

  1. Specify the system you want (for Ubuntu, make sure to select Ubuntu Server, not Ubuntu Desktop!)
  2. Point the Universal USB Installer (UUI) to the downloaded ISO Image
  3. Select the USB Stick to install and and click Create.

It will run a little while but afterwards, you have a bootable USB Stick – in my case, one that I was plugging into the Shuttle and powered it on.

USB Trouble

At first, things were running perfectly smoothly – the USB Stick was recognized, the system booted into the installer… and then my keyboard and mouse ceased to work 🙁

At first, I thought it might be the wireless keyboard – so I got a USB Keyboard directly hooked up but the result was the same: when the BIOS came up, it always claimed it did not find any USB Keyboard or Mouse – it always recognized the USB Stick as Mass Storage Device (so I knew USB was working) but without a keyboard, that was more or less useless.

Shuttle-01Now, I thought it might be a good idea to upgrade the BIOS – the version installed was not the latest and I was hoping. From Shuttle’s web site, you can get the latest BIOS for the box but one thing I needed was a program to create a bootable USB Stick with a DOS Operating system (to execute the flash procedure)… doh! I finally used BootFlashDos 1.0 to create one, threw the BIOS files onto it and installed the BIOS which went without problems. Except for it did not solve my issue…

The behavior itself was strange – when the keyboard got disconnected, it would not come back, even when I rebooted the Shuttle. But it reliably came back when I flashed the USB Stick to a new installer (same Ubuntu, just rewritten) until it got lost again?

It should not be the installer – because the BIOS comes in long before the installer kicks off. I suspect that it – for some wired reason! – has to do with the signature of the USB Stick that is written when I create a new boot stick. Very, very strange – and I did not find a solution at all… any version of Ubuntu I tried (and I tried almost any version between 12 and 14) showed the same results…

I was at the point of packing it all back together and send it back when – in one last desperate attempt – I did the following: I connected the USB Stick and the Keyboard to a USB Hub and plugged them both into the front USB Port of the shuttle… and it worked.

I am still not sure, what the issue is – and if the Shuttle would not become a server (where there is no keyboard and mouse attached) I would probably still send it back but for the moment, this solved the issue for me.

Installing the Operating System

Next step up was installing the Operating System – as I said: the system of choice is Ubuntu 14.04.1 Server – I have described the installation of Ubuntu 12.04 Server before but since some steps are slightly different, I will quickly run through it again.

Shuttle-02I have created a new Virtual Machine for this installation, basically trying to mimic the Shuttle PC itself – 1 Processor with 2 Cores, 4GB RAM, 128 GB Disk, etc. And I am using the USB Stick that I have created for the installation, not the ISO Image.

VMware and Boot-from-USB

The first thing that falls out: VMWare (natively) does not support booting from USB Devices… but fortunately, there is a workaround (which comes in handy if you need to test a USB Stick that you want to use elsewhere…) – the Plop Boot Manager. The whole procedure is described in this blog post so I just go ahead and give it a try. Unfortunately, this means to add a CD/DVD Device to the virtual machine for the moment – not reflecting the state of the Shuttle PC. However, this does the trick. First comes the Boot Manager

Shuttle-03And then comes the Ubuntu Installer… perfect, I am back in the game!

Shuttle-04Please refer to my previous post on installing Ubunti 12.04 LTS for more details – where things are the same, I will not describe them here again although some few (self-explanatory) steps are different.

The next part of the setup I want to point out is the Disk Partitioning – because I ran into trouble there yesterday: take a look at the screen below.

Shuttle-05Please note that my USB Stick that I am using for the installation shows up as device sda (the first disk) – my “true” disk (the one with the 128GB) shows up as sdb. For the moment, continue to partition this larger disk – but keep the assignments in mind!

The first screen of interest is the Software Selection screen. The last time I wrote about Ubuntu 12.04 LTS, PostgreSQL was bundled into the package but at version 9.1 – with the 14.04 release, PostgreSQL has been taken forward to version 9.3 now being included. And not only that: compared to Ubuntu 12.04, a hell more options are now available.

Shuttle-06One interesting option is “Basic Ubuntu server” right at the top which is a bit confusing because that was what I was thinking to install anyway. For the moment, I’ll leave everything unchecked (including the PostgreSQL option!) to get a plain system. But I will come back to that later!

Finally, after the main installation is through, the installer tries to setup the bootloader. Since there is only one operating system on this machine (and the Shuttle), this is what you’ll see:

Shuttle-07So select “Yes”, finish the installation and reboot your system… all should be fine, right? Well… why the hack do I get a black screen then?

Shuttle-08This happened to me on the Shuttle PC yesterday as well and I was completely stunned… I am glad that I was able to reproduce it on the virtual machine because this time I was able to see: when I hit “Yes” to install the GRUB Bootloader into the “first disk”, it took what the system knew as the “first disk” at that time – sda. Which – remember? – was out USB stick…

My Shuttle PC always started properly when the USB Stick was mounted – the virtual machine does not because of the inability to natively boot from USB. The question now is: how do I fix it?

Repairing the GRUB Bootloader

The officially suggested solution is using “Boot-Repair” – see here) so let’s do that: I downloaded the ISO Image, started the virtual machine from that image and this is what I get.

Shuttle-09It takes an awkward moment to start up but eventually, I am presented the Boot Repair Options.

Shuttle-10Following the instructions, the first button is “my” button – the “Recommended repair”. It runs for a minute or two and eventually provides me with some more information about where my next step would be in case my problem was not fixed.

Shuttle-11If you want to see that information posted, you can go here and take a look… I can now reboot the system and wait for it to come up.

Shuttle-12Remaining Installation Taks

Remember when we discussed the packages during installation and wondered what “Basic Ubuntu server” might be? Let’s find out. The first command to issue when logged in to the new system is

tasksel --list-tasks | more

This provides a listing of all defined “tasks” (which is the proper name for what we are dealingwith) and the more-part makes sure your first lines do not scroll off the screen.

Shuttle-13Note the first line? It tells us that the task “Basic Ubuntu server” is internally known as “server”.

We can query for the contents of that task by asking the system for the associated packages.

tasksel --task-packages server

which (probably best with a |more again!) shows us the packages defined for “server”.

Shuttle-14So the “Basic Ubuntu Server” task is a bunch of packages that are low-level system functionality – you can install them individually as needed or all as a set, the “Basic Ubuntu Server”.

If you want to manually install any of the packages now, your command would be

tasksel install <package name>

where package name is the internal name of what you want to install – e.g. tasksel install server. Just make sure you are superuser when you issue the command…

Shuttle-15And it does not hurt to reboot the system afterwards…

sudo reboot

Moving on to PostgreSQL

Again, I have documented the installation of PostgreSQL previously, and much of what we need to do now remains the same… but some things have changed.

First of all, keep in mind that all of the following must be done as superuser – sudo su would be a great way to start.

Next, the command apt-get update would be useful to make sure the latest package definitions are available.

As PostgreSQL 9.3 is now part of the packages, the command apt-get install postgresql-9.3 does work (without adding a new source to the package manager).

apt-get install postgresql-9.3

The following feedback is given:

Shuttle-16I’ll continue this (by answering “Y” for “Yes”) and get PostgreSQL 9.3.5 installed.

Shuttle-17So far, so good. I still need to go through the steps described in the other post in terms of Allowing Access to the Server, setting the PostgreSQL Server’s Admin Password, Opening up for Network Access and setting up Authentication. Please make sure to look these steps up there as they have not changed.

Last but not least, I need PostGIS installed – previously described here. The difference to the previous post is an update in PostGIS itself – so the installer command is now

apt-get install postgresql-9.3-postgis-2.1

to get the latest version. The final thing that needs to be done is to install the OpenSSH Server Package – otherwise, outside communication with PostgreSQL would have to be reconfigured.

apt-get install openssh-server

And done… I think?!

PS: Although most of the post was run against a virtual machine, I can assure you that I did the very same steps (and mistakes) when installing the Shuttle PC as well – so this is comparable and it shows you how I have set up my box. Maybe it comes in handy for one or the other as well (and certainly for me when I ever have to come back to do it again…)

Posted in Shuttle PC, Ubuntu | Leave a comment

Getting ready with Eclipse 4

Sometimes, you just need to start something new – in my case, I have been a developer for years and have then ventured into the more “project-related” activities, leaving the hardcore coding behind (except sometimes for personal projects). And one of these has now brought me back to coding and the insight that I probably should start looking into something new than the pure Microsoft Development Environments and C# – moving into the Eclipse 4/Java world.

Getting Eclipse 4

Unlike the Microsoft tools I am used to, Eclipse is much more dynamic in its development and the development of its plug-ins and tools.

First of all, I figured, getting Eclipse itself should be the first part. That seemed easy enough with an easy-to-access download location at download.eclipse.org. Which is where the fun starts: do I get the standard package (at the time I am writing this, Eclipse 4.4 is the most current version) or do I get any of the pre-packaged download (in my case the one for Eclipse RCP (Rich Client Platform) and RAP (Remote Application Platform, formerly Rich Ajax Platform).

The good thing is: we can try both and see where the differences are: Eclipse is not “installed” in the classical manner – it is simply executed on to of an existing JAVA Platform (which of course is also a pre-requisite to have).

What I did is creating a directory on my disk named Eclipse Environments under which I created two sub-directories RCP and Standard. I then downloaded both packages and placed them into their respective places.

Just to be on the save side (and this is probably not the way you want to do it) I have created a similar structure named Eclipse Workspaces to keep settings and project separeted.

When starting Eclipse 4.4 (the standard package), I am asked for the location of the Workspace (which I point to my standards workspace directory). Having done that, Eclipse will start.

001 - The first StartSince this is the very first time I start Ecplise, I get the somewhat “maiden” Welcome screen which I can close and – as a first step – got to the menu File | New | Other to see what type of projects my standard installation supports.

002 - Default Project Types - StandardIf I do the very same for the RCP/RAP Edition, I will see the following:

003 - Default Project Types - RCPAs you can see – the editions already differ in behaviour which is simply explained by the fact that the pre-packaged solutions already contain typical elements for a specific groups of users. Other pre-packaged solutions would yet provide other components.

Since I am targeting a Rich Client Interface, I will stick with the Eclipse 4.4 RCP/RAP edition for the time being.

The Eclipse E4 Project

To make a long story short: the E4 Project is an “in development” project that is aiming at simplifying and standardizing development with Eclipse – if you want the details, go to the Project Home Page.

What makes this project interesting – and from a learning perspective a bit difficult to handle – is the constant development. Almost any tutorial you encounter on Rich Client applications refers to the E4 Project as base component – however, the versions are changing quickly and so the current state of what you will get with the latest version is not what the person writing the tutorial got at the time it was written. And this will also be true for the words I am writing right now…

One thing that remains “constant” for the time being is the project home page – the version history and downloads can be found here.

Installing a particular version of the E4 Project is easy – it can be done through the Eclipse IDE:

  1. Start Eclipse, go to Help | Install new Software…
  2. Click the Add button next to the Work with: field
  3. In the input box, provide a meaningful name (e.g. Eclipse E4 Release 0.14)
  4. Now, go to the Download Page, click the version you want to install (in my case 0.14) and copy the URL behind the online p2 repo link text in the Comment field. (lower right corner).
  5. Paste the URL into the Location field back in the Eclipse IDE Input dialog.

004 - Downloading E4 Tools Release 014When you click OK, the package should be downloaded and examined. This is where the fun starts – for Release 0.14, this is what I see when I expand all the sections:

005 - E4 Tools 014 ContentsRelease 0.14 is from June 2013 – adding the most current integration release instead of version 0.14, I get this:

006 - E4 Tools Integration Build 20140719As you can see – the list now does not even fit the screen. In other words: what you can install, what it is named and where it is located depends on the release you download – and many tutorials do not bother to mention the exact version…

For now, I am going to install Release 0.15 which is relatively recent (January 2014) but not an “in-development” build either. As for the individual components, I am guessing on everything that is marked Incubation but not Developer Resource.

007 - E4 Tools 015 - Selected ComponentsCompleting the remaining pages of the wizard and accepting the license agreement, the installatin will start and – once finished – I will be asked to restart the Eclipse IDE which I confirm.

Going back to my previous excericise File | New | Other… provides an updated project list:

008 - Projects with E4 Tools installedWhat I am interested in is contained unter the Eclipse 4 container – a new Eclipse 4 Application Project.

009 - Eclipse 4 Application ProjectSelecting the project template and continuing brings up a New Plug-in Project wizard where I first add my very own project name.

010 - New Project Wizard - Dialog 1The remaining values on this page of the wizard remain unchanged – these are standard options defininf the location, associated JAVA Project paths and the target platform. Advancing to the next page of the wizard, I can maintain all pre-set values as well.

011 - New Project Wizard - Dialog 2Here, my project properties are defaulted based on my previous input and standard options are set. Without changing a value, I advance to the next page.

012 - New Project Wizard - Dialog 3I am not going to change anything here either – but want to point out the last option which would pre-populate the to-be application with some sample content. I am not going to do that but if you are interested to see a bit more than an empty screen at the beginning…

Clicking the Finish button builds the application and opens it up in the package explorer.

013 - New Application in IDENotice the error in the center part? This is what really upsets me about these highly dynamic environments – I have not done much and I have not deviated from any defaults, yet I do get an error…

Now, not worrying about the error now, double-click the MyE4Application.product file in the Package Explorer. From the resulting Overview window, click Launch an Eclipse application.

014 - First LaunchIt may or it may not start – but if it starts, you will just see an empty application window (remember: we have not done anything yet and we have not populated the project with the sample menus and other items).

015 - An empty ApplicationBack to my error – as I said: I would expect this not to happen – now, instead of exploring how to add elements to my empty application, I have to find out what is wrong with my development environment. So maybe it is a bug… let’s see if there are any software updates available: menu Help | Check for updates… and sure enough, there are some fixes available:

017 - Software UpdateExecuting these updates and restarting Eclipse afterwards solves my immediate issue – the Application Editor now opens.

018 - Application EditorNow with the environment set up and ready to go… let’s see what I can make from it.

Posted in Allgemein, Eclipse, Java | Leave a comment

Mounting iSCSI LUNs via Ubuntu

One of the challenges we faced during the recovery of our QNAP Data was the ability to mount the “rescued” LUN files and access their data. The system to do this is an Ubuntu 13.04 environment with open-iscsi and iscsitarget installed – the exact definition of the components I used have been published earlier.

Removing a LUN from the iSCSI Enterprise Targets

If a LUN is advertised as iSCSI Enterprise Target and has been accessed for the data required, it can be removed from the target list. To do this, open a Terminal Window and switch to superuser privileges.

sudo su

First of all, we need to stop the running iSCSI Target Service

service iscsitarget stop

Then we can remove the Target definition from /etc/iet/ietd.conf – “iet” stands for “iSCSI Enterprise Target”, “ietd” logically means “iSCSI Enterprise Target Definition”.

nano /etc/iet/ietd.conf

Locate the LUN you want to disable and comment out its definition (better than deleting it, that way you retain a documentation of how things are done). Then save the file and exit. If you need to restart the iscsitarget service for other LUNs, just issue the following command.

service iscsitarget start

Keep in mind that – if the LUN is still mounted – you will have to (or at least should) unmount it first!

Adding a new LUN as iSCSI Enterprise Target

Edit the /etc/iet/ietd.conf file to add a new iSCSI Target LUN. The format is

Target [iSCSI Qualified Name]
     Lun 0 Path=[Path to LUN]

For example

Target iqn.2014-01.private:myLUN
     Lun 0 Path=/media/azapf/.../myLun.000

Then restart the iSCSI Service

service iscsitarget restart

The service should now restart – you are not going to see much yet but you can check for any errors that may have occurred (e.g. inaccessible LUN Files, etc.) by using the command

dmesg

iSCSI LUN Discovery and Mounting

Once the iSCSI Target is defined and published, you need to discover and mount the new LUN. The tool to work with is iscsiadm – a component of open-iscsi.

The discovery tells you all “published” LUNs of a given server (portal):

iscsiadm --mode discovery --type sendtargets --portal 127.0.0.1

Working on the local TCP Lookback, this will provide a list of all locally defined iSCSI Targets. It will provide an output similar to this:

127.0.0.1:3260,1 iqn.2014-01.private:myLUN

for the LUN defined above. This is the line you need to copy (or retype) for accessing the LUN:

iscsiadm --mode node --target iqn.2014-01.private:myLUN --portal 127.0.0.1 --login

You should receive a message saying “Login to iqn.2014-01.private:myLUN successful.”

Using either the dmesg command or fdisk -l you can find the device name given to the connectd LUN. In my case, it is /dev/sdd. With this information, you can now mount the connected LUN.

mount /dev/sdd1 /mnt/LUN

In my case, however, the file system is not any of the standard Linux file systems but a VMWare Datastore so mounting is done differently (and you need to have vmfs-tools installed!)

vmfs-fuse /dev/sdd1 /mnt/LUN

That should do the job and mount the LUN…

Posted in Linux, Ubuntu | Leave a comment