Pages

Wednesday, August 19, 2009

Converting GPX tracks to Google's kml format

Earlier this year I bought a neat GPS tracker for recording hiking trips and geotag my photos. With the software provided I can export these tracks to the GPX format which is an XML format for describing waypoint, tracks and routes. But for displaying my tracks in Google Earth, I need the kml format, which is also an XML format. For the transformation I use the free tool GPSBabel and a small batch script for convenient conversion.


@echo off
setlocal
if "%2"=="" (set out="%~n1.kml") else (set out=%2)
echo gpsbabel -i gpx -f %1 -o kml -F %out%
gpsbabel -i gpx -f %1 -o kml -F %out%
endlocal


The script could easily modified for the backward conversion (kml to gpx)

Wednesday, July 22, 2009

Batch MP3 encoding with lame

I recently bought the new album from Chimaira and liked listen ot it on my iPod. Since I like the mp3 format, I did not want to import it with iTunes using the AAC format I used the open and free mp3 encoder Lame. I ripped the CD tracks using Winamp and configured it to export the tracks to the format "Artist - Album - TrackNumber - SongTitle".wav. After that, I can encode the wav's to mp3's. But encoding each wav file manually is quite time consuming, especially, when all id3 tag information had to be entered manually. So I wrote a little Windows batch file that encodes all the wav's in a batch and automatically sets the ID3 tags.

The source for the script is:

@echo off

if "%1"=="" (
echo Usage: %0 [files] {genre} {year}
goto :eof
)

rem %2=genre
rem %3=year
if "%2"=="" (set GENRE=) else (set GENRE=--tg "%2")
if "%3"=="" (set YEAR=) else (set YEAR=--ty "%3")

for /R %%f in (%1) do (
echo Converting "%%~nxf"

rem extract from format "Artist - Album - trackNo - Title"
for /F "tokens=1,2,3,4 delims=-" %%A in ("%%~nf") DO (
call :encode "%%~nxf" "%%A" "%%B" "%%C" "%%D" "%GENRE%" "%YEAR%"
)
echo.
)

goto :eof

:encode
SETLOCAL

rem strip quotes
set _artist=%~2
set _album=%~3
set _trackNo=%~4
set _title=%~5

rem trim spaces
set artist=%_artist:~0,-1%
set album=%_album:~1,-1%
set trackNo=%_trackNo:~1,-1%
set title=%_title:~1%

echo Artist: "%artist%"
echo Album: "%album%"
echo TrackNO: "%trackNo%"
echo Title: "%title%"
if NOT "%genre%"=="" echo Genre: "%genre:~6,-1%"
if NOT "%year%"=="" echo Year: "%year:~6,-1%"

lame.exe -h -V 6 "%~1" "%~n1.mp3" --add-id3v2 --tt "%title%" --ta "%artist%" --tl "%album%" --tn "%trackNo%" %genre% %year%
ENDLOCAL

goto :eof

:eof

With the help of the scripts I could easily encode the files of an entire directory using:

myScipt *.wav 137 2009

Note, that 137 refers to the Genre list of the lame encoder. Use "lame --genre-list" to print an alphabetically sorted ID3 genre list.


Friday, May 8, 2009

Single Sign On with Quickr 8.1 and SPNEGO

Yesterday I was at a customer that is using Lotus Quickr 8.1 (J2EE) and als uses an ISSW asset - the SPNEGO TAI for WebSphere Application Server 6.0 - for WebSphere Portal 6.0. This customer wanted to use the TAI for Quickr too, respectively the underlying Application Server version 6.0.2.17.

And after some troubleshooting and a fix for WAS we finally managed to achieve SPNEGO/Windows Single Sign On for Quickr 8.1!

The only real issue with the product (Quickr) itself was a bug in the redirection after the request had not been intercepted by any TAI where the user was redirected to an error page instead of the login page. This was no specific SPNEGO TAI issue but an issue with the Trust Association Interception in general in the Quickr 8.1 and 8.1.1 underlying App Server, version 6.0.2.17.

However there is a technote and a fix for that known issue if you ever stumble upon this error.

After that fix had been installed - which went pretty smooth - Single Sign On with SPNEGO worked properly. At least in the WebUI but unfortunately not with the connectors.

One of the issues was that with SPNEGO enabled it didn't matter which values we specified for the main UI as user/pwd in the first dialog that comes up when we added a place to the connectors. These values were sent to the server and failed. However, the SPNEGO credentials were also sent along as we were authenticated successfully. But there were other user/pwd dialog boxes that appeared in the usage of the connectors as well. These did not work correctly with SPNEGO enabled.
Currently the Java based connectors (ie ST, Notes 8 Standard, etc) do not work at all when SPNEGO is enabled.

As a workaround to disable SPNEGO for the Connectors we considered two options:
The first (that was tested and finally implemented) was simply to create an additional DNS entry for the same Quickr server and specified this entry in the Connector (ie. web.quickr.intranet.com for the browser and connector.quickr.intranet.com for the connector). The TAI is configured to intercept only requests to a particular URL respectively a host (ie. web.quickr.intranet.com). If a request is sent to a different hostname (ie connector.quickr.intranet.com), the request is not intercepted and thus no Single Sign On happens.

The second option we thought of but did not test yet was to configure the TAI that way, that it uses a filter to exclude the URL used by the Connector respectively only intercept requests for the protected URLs of the web ui, which are URLs that contain /lotus/myquickr. Using the HTTPFilter for the configured server and a filter string "request-url==/lotus/myquickr" should do the job, but as mentioned - we did not test this.

Luckily, Quickr 8.2 is coming soon with official SSO support for the Connectors and it will be backward compatible to Quickr 8.1.1.

Wednesday, February 25, 2009

Quickr UI hacking

This week I was in a workshop at a customer where we discussed among others how to customize Quickr for Portal. They had some special requirements regarding the UI about which I'd like to write here.

One of their requirements was, to have a sidebar menu on the left-hand side containing the place navigation in the upper part of the sidebar and the functional elements below the navigation. They took the current Quickr for Domino look&feel as an example. I don't exactly know how the Quickr for Domino works, but I know that the Quickr for Portal works differently. The main problem is, that the PDM portlet (Library) in Quickr J2EE contains the entire toolbox as a right-side menu (with the "Create" button on top of if). So I needed to find a way to rip it off the portlet and place it in the right side navigation. I did this using JavaScript and it was actually only a couple lines of code.

First of all, create a place that uses a theme policy that displays the sidebar. Create a page that contains the library portlet (the one with the right sidebar). Then open the Default.jsp of the theme and search for the expression that includes the sidebar.

<%@ include file="./sideNav.jspf" %>

Place the following html snippet below this sidebar include.

<div id="injection-point"> </div>

Its important, that it is not a standalone html tag.
Now go to the end of the file and add the following script before the closing body tag:

<script type="text/javascript">
document.getElementById("injection-point").appendChild(document.getElementById("sidebar").parentNode);
document.getElementById("sidebar").style.visibility = "visible";
</script>


You could see, that the visibility attribute of the sidebar is set to visible, this comes a long with a change in the styles.jsp where you'll have to add the following snippet
#sidebar {
visibility: hidden;
}

This prevents from showing the sidebar on the right side during page load and then jumping to the left side, when the rendering process is complete. The sidebar is simply not shown from the beginning. Now save the files and see what happens :)

The final result looks like this:




Using this technique of adding injection points to the theme and some javascript code that moves elements around, you could easily modify the entire look and feel. For a customization I did this week for a customer, I moved the Create button and the Action menu to the left bar, and the other sections to the right side (outside of the portlet area). I also modified the search box, which is completely generated by a JSP tag.

Friday, February 13, 2009

Pointing to a specific Activity using the Portal Bookmark portlet

Today we tried to create a landing page for a Portal with integrated Connections. The landing page should contain a link to give feedback. Since it is a PoC we'd like to use an Activity for collecting feedback to demonstrate the various usage possibilites for Lotus Connections. The link to the feedback activity should have been provided in the Bookmark portlet of WebSphere Portal. However, we encountered a minor issue for which we found a solution.

The problem was, that the URL to the Activity contained a comma character respectively the octet encoding of it (%2C). Although this format is conforming with URL RFC 1738 (paragraph 2.2.) the Bookmark portlet refused to accept this URL stating the URL was not valid.

However, we found a workaround for that. We created a Portal URL page pointing to the feedback activity and put this URL page underneath the Activities URL page in the portal page structure so that it remains invisble. We assigned a uniquename to this URL page pointing to the Feedback Activity and created a bookmark in the bookmark portlet that pointed to the Portal URL page for the Feedback Activity. Thats it. The uniquename is required, otherwise this URL page would not be selectable as portal internal page in the Bookmark portlet.

By the way, I like the approach of collecting feedback using an Activity. The users can comment on existing feedback, agree, disagree. The feedback can be given in a structured way, like technical feedback, opinions, enhancement requests, and the users could even post files. The receivers of the feedback can give answers directly to the posts and users could easily subscribe to updates to stay informed about what's going on. And the best of all: it's usable out-of-the-box, we did not need to create a custom feedback form :)

Monday, January 12, 2009

Twitter for business ... or how to prevent your partner calling you during a speech

Several times colleagues are asking me, what the use of Twitter is or why they should do it as well. Well, what twitter is, is captured  pretty good in this video: Twitter in plain English. But that possibly does not capture their business case. But maybe this blog entry can give some more uses.

But how can twitter - or microblogging in general - can help employees doing a better job?

In my opinion the most practical use is: get quick and easy access to knowledge! Of course not all jobs require a broad use of knowledge, but for me, working in the Services and Consulting business, it does.
And here are several ways I benefit from Twitter.

1. Build up a follower network.
Build up a network of colleagues, all around the world, that work in the same or related topics that you are. Follow them, and ask them to follow you, too. That way, a broadcast is received by a wide number of peers who may be able to help you and who know you, too. Secondly, this colleague-net builds up a stronger community for itself.

2. Subscribe to search-feeds.
Use the search feature of Twitter and the ability to subscribe to the search filters. That way you get notified of people that tweet about a topic of your interest that you are not following. Maybe you are able to help them. In the other direction, you can post to the public community as well, if they subscribed to such a search feed you might get help from people you does not know, yet. A good example for such feed is the Lotus Connections search feed.

3. Use hashtags.
By the use of hashtags - keywords with a leading # - you could mark your post or keywords in it to indicate, the post contains some information of a certain category. More information about hashtags can be found on hashtags.org. The effect is similar to the search feed, though the search feed may produce more "false hits".

4. Retweet
ReTweet (RT) is a resend of your post by another user to his followers. By this, information - if its valuable enough - reaches even the farthest wrinkle of the community. If you have something important to say about a certain topic and you share your knowledge in a blog, you could announce a new post via Twitter. Not only that you do some advertising for you and your blog and by this build up your reputation in a certain topic, but also that the information - if its really valuable - spreads around the community via retweet (RT).

But there is one final thing you take into consideration: give your personal Twitter network time to evolve, to grow, to strengthen the valuable connections. You also have to put some initial energy into it, build up your network, convince your reluctant colleagues to use it, too. Show them how to use the tools. In the beginning, they don't even have to contribute, in the beginning it might be sufficent, to just build the connections and it is sufficient when only a minority contributes, the rest will follow soon.

Twitter is really easy, even non-technical-adept people can use it, on their phone, on their desktop, via browser, via instant messaging. So even your wife or husband can use it! And you can let them know, what you are doing, that you hold a speech or a presentation, and if they just read your post, they maybe won't call you in inappropriate situations any longer ;)

Sunday, January 11, 2009

My personal world tour 2009, don't miss a show!

Last week I've made up mind about my vacation days this year. It required some planning to get the most out of the weekends with public holidays and the vacation days I have this year, but I think I made the best out of it. So here are my plans.

The whole "travel season" starts in April when the winter - hopefully - has found its end and its getting warmer again. Right in the beginning of April, I'll fly to Dublin. I've never been to Ireland before and this city is on my list of places I'd like to visit. I think I'll hang a little around there in the first weekend of April before I'll have a roadtrip over the isle over the week that follows. In the end of the week I'll return back to Dublin from where I take another flight right over to London where I'll spent the Eastern weekend before returning back to Zurich. Last year I already planned to travel to Irland for a week so I combine the trip with two city trips I planned anyway for the year.

Next trip will be a weekend trip to Prague on the first weekend of May. It will be a three-days-visit, where I'll fly to Prague on thursday evening and return back to Zurich on Monday in early morning. The good thing about this trip is, it doesn't cost my one of my precious vacation days since Friday, 1st May is a public holiday.

Already a week later, I found a really cheap flight to Hamburg (only 28€ !!!) where my mother lives. This week I'll work remotely the whole week and also I am able to attend her birthday celebration the weekend after that. I also planned to spent a couple of days in Stockholm this year. I've never been to Scandinavia before and I chose to start with Sweden and Stockholm. Originally I planned to fly directly from Hamburg to Stockholm, but I found a cheap flight over Riga with a 7h-stop right there. So I decided to make 2 flights instead and spent whole two days in Riga before jumping over to Stockholm for another two days. This will be on the Ascenion Day and the successing weekend, and I just need to use a single vacation day for the friday which is a bridging day. On the next monday I'll return back to Zurich in early moring for work as usual.

Up to this point I've booked most of the flights (7 of 9) and spent "only" 800 Swiss Francs for this, which is quite cheap considering the distances I cover - around 7000km! ... But that is also the reason for planning such a long time in advance - the flights on the public holidays-days are in high demand and get expepensive pretty early.

For the Pentecost weekend I have no plans so far, but maybe I'll spent the weekend in Amsterdam. I've been there once before but I liked it quite a bit there and would really like to go there once again, but thats not a fixed plan so far. Other options for this weekend would be Rome or Athens, I'll see.

Quite a big trip is planned for the end of June which is the longest vacation planned for the year. I'll visit a former colleage of mine from the Boeblingen lab who moved to Stanford in late 2007. Another colleague from the lab will most likely accompany me on this trip. Its planned to stay 2 whole weeks over there. This will be my very first time being far away from Europe (though I've been to Turkey, which belongs to Asia, but it was quite close to Europe) and I'm quite excited to see America respectively the USA :)

In the end of July, I will head north again up to a small village north of Hamburg for the Wacken Open Air which is the world's largest Heavy Metal Open Air festival, and its it's 20th anniversary, and I can tell, I am rather excited to go there, its my second "Wacken".

Up to this point, I'll have been to five cities I've never been to before: Dublin, London, Prague, Riga and Stockholm. Visited another continent (North-America), and by this I will have increased my personal number of countries I've visited by 6 (Ireland, England, Czech Republic, Latvia, Sweden and USA and will have spent most of my vacation days, leaving only more days.

And these two I will use to visit again a friend who lives in Vienna, where we also plan to take over to Bratislava, which is just around 50km away from Vienna, which will increase my cities-and-countries-Ive-been again by one. This trip is panned for late August or early September.

After all these trips, the cold time of year will begin a again, which I consider totally as best time for working.

And to close this post, I'd like to experiment a little bit, how "real" the Web 2.0 community can get. All the city trips mentioned above, I planned to do alone - so far. But I'd like to invite you, to acompany my along the way. If you live in or near one of those cities and like to meet me in person, drinking a beer or a glas of wine with me, guide me through the city, give me recommendations for places I shouldn't miss, offer me accomodation - feel free to contact me! Don't be reluctant, I'm keen to meet new and interessting people, IBMr or no IBMr that doesn't matter, and I'm quite open mindend and uncomplicated :)
For contacting you could use several channels, via comments on this blog, email me, send me a message on Twitter or in Facebook.